diff --git a/.eslintignore b/.eslintignore index 8249db6a46..a952689d73 100644 --- a/.eslintignore +++ b/.eslintignore @@ -10,21 +10,17 @@ packages/babel-plugin-orbit-components/__fixtures__/ packages/eslint-plugin-orbit-components/dist !.storybook !.remarkrc.js +!.size-limit.cjs !.size-limit.js # from gitignore packages/orbit-components/src/icons/* -packages/orbit-components/src/Illustration/index.*.flow -packages/orbit-components/src/AirportIllustration/index.*.flow -packages/orbit-components/src/ServiceLogo/index.*.flow -packages/orbit-components/src/FeatureIcon/index.*.flow -packages/orbit-components/src/Illustration/index.d.ts -packages/orbit-components/src/AirportIllustration/index.d.ts -packages/orbit-components/src/ServiceLogo/index.d.ts -packages/orbit-components/src/FeatureIcon/index.d.ts docs/.cache docs/public # orbit design tokens packages/orbit-design-tokens/output/ + +# transforms +packages/orbit-components/transforms/__testfixtures__/* diff --git a/.eslintrc.js b/.eslintrc.js index c9ec5a2b42..8c0ea85395 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,5 @@ -// @noflow +const { DEV_DEPENDENCIES } = require("./utils/eslint"); + module.exports = { root: true, reportUnusedDisableDirectives: true, @@ -14,31 +15,6 @@ module.exports = { "no-unused-expressions": "off", "babel/no-unused-expressions": "error", "import/no-useless-path-segments": ["error", { noUselessIndex: true }], - "import/no-extraneous-dependencies": [ - "error", - { - devDependencies: [ - "**/*.test.*", - "**/__tests__/**", - "**/__testfixtures__/**", - "**/__examples__/**", - "**/cypress/**", - "**/*.stories.*", - "**/*.config.*", - "**/stories/**", - "**/tasks/**", - "docs/**", - "packages/eslint-plugin-orbit-components/**", - "packages/orbit-design-tokens/src/theo/**", - "packages/*/.storybook/**", - "**/config/**", - "**/scripts/**", - "publish.mjs", - "**/.remarkrc.js", - "**/.size-limit.js", - ], - }, - ], "import/order": [ "error", { @@ -71,8 +47,24 @@ module.exports = { "react/no-access-state-in-setstate": "off", "jsx-a11y/label-has-associated-control": "off", "no-await-in-loop": "off", + // to improve performance locally + // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#my-linting-feels-really-slow + ...(!process.env.CI + ? { + "import/no-named-as-default": "off", + "import/no-cycle": "off", + "import/no-unused-modules": "off", + "import/no-deprecated": "off", + } + : null), }, overrides: [ + { + files: DEV_DEPENDENCIES, + rules: { + "import/no-extraneous-dependencies": ["error", { devDependencies: true }], + }, + }, { files: ["*.js?(x)", "*.js?(x).flow"], extends: ["plugin:flowtype/recommended", "prettier"], @@ -84,7 +76,13 @@ module.exports = { }, }, { - files: "*.ts?(x)", + files: ["packages/orbit-components/{src,es,lib}/**/*.js?(x)", "*.js?(x).flow"], + rules: { + "flowtype/require-valid-file-annotation": ["error", "always"], + }, + }, + { + files: ["*.ts?(x)", "*.d.ts", "*.mts"], extends: [ // disables core ESLint rules which are handled by TypeScript "plugin:@typescript-eslint/eslint-recommended", @@ -92,13 +90,18 @@ module.exports = { "prettier", ], parserOptions: { + extraFileExtensions: [".mts"], + tsconfigRootDir: __dirname, project: [ + "./tsconfig.scripts.json", "./tsconfig.json", - "./packages/orbit-tracking/tsconfig.json", + "./packages/*/tsconfig.json", + "./packages/*/scripts/tsconfig.json", + "./packages/orbit-components/.storybook/tsconfig.json", "./docs/tsconfig.json", "./packages/orbit-components/cypress/tsconfig.json", ], - ecmaVersion: 2018, + ecmaVersion: 2020, sourceType: "module", }, settings: { @@ -110,7 +113,7 @@ module.exports = { }, rules: { "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/prefer-readonly-parameter-types": "error", + "@typescript-eslint/prefer-readonly-parameter-types": "off", "@typescript-eslint/no-empty-function": "off", "no-shadow": "off", "@typescript-eslint/no-shadow": "error", @@ -129,6 +132,10 @@ module.exports = { }, ], "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }], + "import/named": "off", + "import/namespace": "off", + "import/default": "off", + "import/no-named-as-default-member": "off", }, }, { @@ -184,8 +191,6 @@ module.exports = { { files: "docs/**", rules: { - // we're not using Flow in docs - "flowtype/require-valid-file-annotation": "off", // these make sense for libraries, but not documentation "global-require": "off", camelcase: "off", @@ -251,6 +256,25 @@ module.exports = { "@typescript-eslint/prefer-readonly-parameter-types": "off", }, }, + { + files: ["packages/orbit-components/scripts/*"], + rules: { + "no-console": "off", + "no-restricted-syntax": "off", + }, + }, + { + files: ["packages/orbit-tracking/src/**/*", "packages/orbit-components/config/**/*"], + rules: { + "@typescript-eslint/prefer-readonly-parameter-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "no-restricted-syntax": "off", + "guard-for-in": "off", + "no-console": "off", + "import/extensions": "off", + }, + }, { files: ["packages/eslint-plugin-orbit-components/src/**"], rules: { @@ -269,16 +293,6 @@ module.exports = { "orbit-components/unique-id": "off", }, }, - { - files: [ - "packages/orbit-components/{src,es,lib}/**/*.js?(x)", - "packages/orbit-design-tokens/{src,es,lib}/**/*.js?(x)", - "*.js?(x).flow", - ], - rules: { - "flowtype/require-valid-file-annotation": ["error", "always"], - }, - }, { files: "**/config/**", globals: { diff --git a/.github/contributing.md b/.github/contributing.md index cd0991e853..e11a9a8477 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -2,9 +2,15 @@ ## Table of Contents -- [Commit message & history](#commit-message-history) -- [Repository structure](#repository-structure) -- [Environment requirements](#environment-requirements) +- [Contribution guide](#contribution-guide) + - [Table of Contents](#table-of-contents) +- [Commit message & history](#commit-message--history) +- [Repository Structure](#repository-structure) + - [`@kiwicom/orbit-components`](#kiwicomorbit-components) + - [`@kiwicom/babel-plugin-orbit-components`](#kiwicombabel-plugin-orbit-components) + - [Root](#root) +- [Environment Requirements](#environment-requirements) +- [How to develop](#how-to-develop) - [Testing](#testing) --- @@ -81,7 +87,6 @@ This is a shortcut for `yalc publish --push`, which "publishes" the package agai Run `yarn test-ci` to perform the same automatic checks as the CI server. You can also run some of these checks separately: -- `yarn flow` - Flow check - `yarn tsc` - TypeScript check - `yarn eslint .` - ESLint check - `yarn test` - run all Jest tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4937d557f..f57961a7b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: yarn tracking build - name: Type checks - run: yarn check:types + run: yarn check:types && yarn flow check - name: Lint run: | diff --git a/.gitignore b/.gitignore index f5a35ae11e..282cca0287 100644 --- a/.gitignore +++ b/.gitignore @@ -38,8 +38,8 @@ build/Release node_modules/ jspm_packages/ -# Typescript v1 declaration files -typings/ +# TypeScript incremental compilation information +*.tsbuildinfo # Optional npm cache directory .npm diff --git a/.size-limit.js b/.size-limit.js index 4986705375..688f005e50 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -1 +1 @@ -module.exports = require("./packages/orbit-components/.size-limit"); +module.exports = require("./packages/orbit-components/.size-limit.js"); diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js index eae2f5eeeb..3ca453e49a 100644 --- a/docs/.eslintrc.js +++ b/docs/.eslintrc.js @@ -1,3 +1,6 @@ -// this disables Gatbsy's built-in eslint-loader -// https://www.gatsbyjs.com/docs/eslint/#disabling-eslint -module.exports = {}; +// adding an ESLint config disables Gatbsy's built-in eslint-loader +module.exports = { + rules: { + "import/no-extraneous-dependencies": ["error", { packageDir: [__dirname, `${__dirname}/..`] }], + }, +}; diff --git a/docs/package.json b/docs/package.json index 8fdd8250d5..0b00444fcb 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "gatsby develop", "fetch:contributors": "babel-node ./plugins/contributors/fetchContributors.mjs", + "check:types": "tsc", "build": "gatsby build", "clean": "gatsby clean", "serve": "gatsby serve", @@ -20,10 +21,10 @@ }, "dependencies": { "@adeira/js": "^2.1.1", - "@babel/core": "^7.18.2", - "@babel/generator": "^7.17.9", "@babel/runtime": "^7.18.2", - "@babel/standalone": "^7.17.6", + "@babel/core": "^7.18.9", + "@babel/generator": "^7.18.9", + "@babel/standalone": "^7.18.9", "@csstools/convert-colors": "^2.0.0", "@icons-pack/react-simple-icons": "^4.0.0", "@jsdevtools/rehype-url-inspector": "^2.0.2", @@ -99,7 +100,6 @@ "jsondiffpatch": "^0.4.1", "lodash": "^4.17.21", "memfs": "^3.2.0", - "prettier": "^2.1.2", "prism-react-renderer": "^1.2.1", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -121,6 +121,8 @@ "unist-util-visit": "^2.0.3", "use-resize-observer": "^8.0.0", "uuid": "^8.3.2", - "vfile-reporter": "^7.0.4" + "webpack": "^5.74.0", + "vfile-reporter": "^7.0.4", + "zx": "7.0.7" } } diff --git a/docs/services/changelog.ts b/docs/services/changelog.ts index 13df31cba7..a850342985 100644 --- a/docs/services/changelog.ts +++ b/docs/services/changelog.ts @@ -1,6 +1,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies import remark from "remark"; -// eslint-disable-next-line import/no-extraneous-dependencies import mdx from "remark-mdx"; import path from "path"; import { read, write } from "to-vfile"; @@ -18,7 +17,7 @@ export default async () => { try { const file = await read(path.resolve(process.cwd(), "packages/orbit-components/CHANGELOG.md")); - const { contents } = await remark().use(mdx).use(headings).process(file); + const contents = await remark().use(mdx).use(headings).process(file); const output = contents.toString().replace("## Change Log", ""); await write({ diff --git a/docs/services/checkLinks.ts b/docs/services/checkLinks.ts index 53ad404905..650026b16f 100644 --- a/docs/services/checkLinks.ts +++ b/docs/services/checkLinks.ts @@ -1,7 +1,6 @@ -import globby from "globby"; import server from "browser-sync"; import checkLinks from "check-links"; -import path from "path"; +import { path, globby } from "zx"; import unified from "unified"; import parse from "rehype-parse"; import inspectUrls from "@jsdevtools/rehype-url-inspector"; diff --git a/docs/src/__examples__/Modal/SIZES.tsx b/docs/src/__examples__/Modal/SIZES.tsx index 6e6e46f950..fa73e90e01 100644 --- a/docs/src/__examples__/Modal/SIZES.tsx +++ b/docs/src/__examples__/Modal/SIZES.tsx @@ -1,5 +1,4 @@ import React from "react"; -import defaultTheme from "@kiwicom/orbit-components/lib/defaultTheme"; import { Button, Stack, ModalSection, Modal } from "@kiwicom/orbit-components"; export default { diff --git a/docs/src/__examples__/SocialButton/services.tsx b/docs/src/__examples__/SocialButton/services.tsx index 33a176e01e..01d8809a3e 100644 --- a/docs/src/__examples__/SocialButton/services.tsx +++ b/docs/src/__examples__/SocialButton/services.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { SocialButton, Stack } from "@kiwicom/orbit-components"; +import { SocialButton } from "@kiwicom/orbit-components"; export default { Example: () => Sign in with Apple , diff --git a/docs/src/components/BrandedTile.tsx b/docs/src/components/BrandedTile.tsx index 78c2b1d027..55020dfcd6 100644 --- a/docs/src/components/BrandedTile.tsx +++ b/docs/src/components/BrandedTile.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Heading, Stack, Button, Grid, mediaQueries as mq } from "@kiwicom/orbit-components"; +import { Heading, Stack, Button, mediaQueries as mq } from "@kiwicom/orbit-components"; import { StyledButtonPrimitive } from "@kiwicom/orbit-components/lib/primitives/ButtonPrimitive"; import useTheme from "@kiwicom/orbit-components/lib/hooks/useTheme"; import styled, { css } from "styled-components"; diff --git a/docs/src/components/ComponentStatus/ComponentStatusList.tsx b/docs/src/components/ComponentStatus/ComponentStatusList.tsx index 998ad7fe41..c480701b3f 100644 --- a/docs/src/components/ComponentStatus/ComponentStatusList.tsx +++ b/docs/src/components/ComponentStatus/ComponentStatusList.tsx @@ -159,7 +159,6 @@ const ComponentStatusList = () => { {item.docs === "Released" ? ( ` `} `; -interface Props extends SpaceAfter { +interface Props extends Common.SpaceAfter { level: number; children?: React.ReactNode; noId?: boolean; diff --git a/docs/src/docs-table.tsx b/docs/src/docs-table.tsx index d3e1f3baef..26f72edabf 100644 --- a/docs/src/docs-table.tsx +++ b/docs/src/docs-table.tsx @@ -319,7 +319,7 @@ const PropsTable = ({ children }) => { return ( - +
diff --git a/docs/src/mdx-components.tsx b/docs/src/mdx-components.tsx index 37fff3b3c9..da11a2d08b 100644 --- a/docs/src/mdx-components.tsx +++ b/docs/src/mdx-components.tsx @@ -11,8 +11,8 @@ import { TableCell, } from "@kiwicom/orbit-components"; import { NewWindow } from "@kiwicom/orbit-components/icons"; -import type { SpaceAfter } from "@kiwicom/orbit-components/lib/common/common"; -import type { Type } from "@kiwicom/orbit-components/lib/Heading"; +import { SpaceAfter } from "@kiwicom/orbit-components/lib/common/types"; +import { Type } from "@kiwicom/orbit-components/lib/Heading/types"; import { Link } from "gatsby"; import { css } from "styled-components"; @@ -171,7 +171,6 @@ export const a = function Anchor({ const useExternalIcon = isExternal && typeof children === "string"; return ( - {/* @ts-expect-error ts-missing-module */} diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx index ba02ab524b..5dba5f814e 100644 --- a/docs/src/pages/index.tsx +++ b/docs/src/pages/index.tsx @@ -1,13 +1,6 @@ import React from "react"; import { Link } from "gatsby"; -import { - Heading, - Inline, - Stack, - Grid, - Button, - mediaQueries as mq, -} from "@kiwicom/orbit-components"; +import { Heading, Inline, Stack, Grid, Button } from "@kiwicom/orbit-components"; import { NewWindow } from "@kiwicom/orbit-components/icons"; import { css } from "styled-components"; import { WindowLocation } from "@reach/router"; @@ -68,7 +61,6 @@ export default function Home({ location, path }: Props) { > -
} - // @ts-expect-error asComponent has wrong type declaration asComponent={GatsbyLinkToButton} href="/getting-started/" > diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 3f6c97ec61..69e72d4482 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,13 +1,13 @@ { - "extends": "../tsconfig.json", - "include": ["**/*"], + "extends": "../tsconfig.base.json", "compilerOptions": { "target": "ESNext", "module": "esnext", + "noEmit": true, "moduleResolution": "node", "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "useUnknownInCatchVariables": false }, - "exclude": [] + "exclude": ["**/scripts/**/*"] } diff --git a/flow-typed/npm/@babel/cli_vx.x.x.js b/flow-typed/npm/@babel/cli_vx.x.x.js deleted file mode 100644 index 56718a18e7..0000000000 --- a/flow-typed/npm/@babel/cli_vx.x.x.js +++ /dev/null @@ -1,90 +0,0 @@ -// flow-typed signature: 9c43898047dc1cf53f5aad40011db318 -// flow-typed version: <>/@babel/cli_v^7.12.8/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/cli' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/cli' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/cli/bin/babel-external-helpers' { - declare module.exports: any; -} - -declare module '@babel/cli/bin/babel' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel-external-helpers' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel/dir' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel/file' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel/options' { - declare module.exports: any; -} - -declare module '@babel/cli/lib/babel/util' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/cli/bin/babel-external-helpers.js' { - declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>; -} -declare module '@babel/cli/bin/babel.js' { - declare module.exports: $Exports<'@babel/cli/bin/babel'>; -} -declare module '@babel/cli/index' { - declare module.exports: $Exports<'@babel/cli'>; -} -declare module '@babel/cli/index.js' { - declare module.exports: $Exports<'@babel/cli'>; -} -declare module '@babel/cli/lib/babel-external-helpers.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>; -} -declare module '@babel/cli/lib/babel/dir.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>; -} -declare module '@babel/cli/lib/babel/file.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel/file'>; -} -declare module '@babel/cli/lib/babel/index' { - declare module.exports: $Exports<'@babel/cli/lib/babel'>; -} -declare module '@babel/cli/lib/babel/index.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel'>; -} -declare module '@babel/cli/lib/babel/options.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel/options'>; -} -declare module '@babel/cli/lib/babel/util.js' { - declare module.exports: $Exports<'@babel/cli/lib/babel/util'>; -} diff --git a/flow-typed/npm/@babel/core_vx.x.x.js b/flow-typed/npm/@babel/core_vx.x.x.js deleted file mode 100644 index 2ae4b52b56..0000000000 --- a/flow-typed/npm/@babel/core_vx.x.x.js +++ /dev/null @@ -1,421 +0,0 @@ -// flow-typed signature: 2044b43b897f58e8eb386af41aee5980 -// flow-typed version: <>/@babel/core_v^7.12.10/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/core' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/core' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/core/lib/config/cache-contexts' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/caching' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/config-chain' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/config-descriptors' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/configuration' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/import' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/index-browser' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/module-types' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/package' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/plugins' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/types' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/files/utils' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/full' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/helpers/config-api' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/helpers/environment' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/item' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/partial' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/pattern-to-regex' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/plugin' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/printer' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/resolve-targets-browser' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/resolve-targets' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/util' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/validation/option-assertions' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/validation/options' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/validation/plugins' { - declare module.exports: any; -} - -declare module '@babel/core/lib/config/validation/removed' { - declare module.exports: any; -} - -declare module '@babel/core/lib/gensync-utils/async' { - declare module.exports: any; -} - -declare module '@babel/core/lib/gensync-utils/fs' { - declare module.exports: any; -} - -declare module '@babel/core/lib' { - declare module.exports: any; -} - -declare module '@babel/core/lib/parse' { - declare module.exports: any; -} - -declare module '@babel/core/lib/parser' { - declare module.exports: any; -} - -declare module '@babel/core/lib/parser/util/missing-plugin-helper' { - declare module.exports: any; -} - -declare module '@babel/core/lib/tools/build-external-helpers' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transform-ast' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transform-file-browser' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transform-file' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transform' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/block-hoist-plugin' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/file/file' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/file/generate' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/file/merge-map' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/normalize-file' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/normalize-opts' { - declare module.exports: any; -} - -declare module '@babel/core/lib/transformation/plugin-pass' { - declare module.exports: any; -} - -declare module '@babel/core/src/config/files/index-browser' { - declare module.exports: any; -} - -declare module '@babel/core/src/config/files' { - declare module.exports: any; -} - -declare module '@babel/core/src/config/resolve-targets-browser' { - declare module.exports: any; -} - -declare module '@babel/core/src/config/resolve-targets' { - declare module.exports: any; -} - -declare module '@babel/core/src/transform-file-browser' { - declare module.exports: any; -} - -declare module '@babel/core/src/transform-file' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/core/lib/config/cache-contexts.js' { - declare module.exports: $Exports<'@babel/core/lib/config/cache-contexts'>; -} -declare module '@babel/core/lib/config/caching.js' { - declare module.exports: $Exports<'@babel/core/lib/config/caching'>; -} -declare module '@babel/core/lib/config/config-chain.js' { - declare module.exports: $Exports<'@babel/core/lib/config/config-chain'>; -} -declare module '@babel/core/lib/config/config-descriptors.js' { - declare module.exports: $Exports<'@babel/core/lib/config/config-descriptors'>; -} -declare module '@babel/core/lib/config/files/configuration.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/configuration'>; -} -declare module '@babel/core/lib/config/files/import.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/import'>; -} -declare module '@babel/core/lib/config/files/index-browser.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/index-browser'>; -} -declare module '@babel/core/lib/config/files/index' { - declare module.exports: $Exports<'@babel/core/lib/config/files'>; -} -declare module '@babel/core/lib/config/files/index.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files'>; -} -declare module '@babel/core/lib/config/files/module-types.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/module-types'>; -} -declare module '@babel/core/lib/config/files/package.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/package'>; -} -declare module '@babel/core/lib/config/files/plugins.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/plugins'>; -} -declare module '@babel/core/lib/config/files/types.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/types'>; -} -declare module '@babel/core/lib/config/files/utils.js' { - declare module.exports: $Exports<'@babel/core/lib/config/files/utils'>; -} -declare module '@babel/core/lib/config/full.js' { - declare module.exports: $Exports<'@babel/core/lib/config/full'>; -} -declare module '@babel/core/lib/config/helpers/config-api.js' { - declare module.exports: $Exports<'@babel/core/lib/config/helpers/config-api'>; -} -declare module '@babel/core/lib/config/helpers/environment.js' { - declare module.exports: $Exports<'@babel/core/lib/config/helpers/environment'>; -} -declare module '@babel/core/lib/config/index' { - declare module.exports: $Exports<'@babel/core/lib/config'>; -} -declare module '@babel/core/lib/config/index.js' { - declare module.exports: $Exports<'@babel/core/lib/config'>; -} -declare module '@babel/core/lib/config/item.js' { - declare module.exports: $Exports<'@babel/core/lib/config/item'>; -} -declare module '@babel/core/lib/config/partial.js' { - declare module.exports: $Exports<'@babel/core/lib/config/partial'>; -} -declare module '@babel/core/lib/config/pattern-to-regex.js' { - declare module.exports: $Exports<'@babel/core/lib/config/pattern-to-regex'>; -} -declare module '@babel/core/lib/config/plugin.js' { - declare module.exports: $Exports<'@babel/core/lib/config/plugin'>; -} -declare module '@babel/core/lib/config/printer.js' { - declare module.exports: $Exports<'@babel/core/lib/config/printer'>; -} -declare module '@babel/core/lib/config/resolve-targets-browser.js' { - declare module.exports: $Exports<'@babel/core/lib/config/resolve-targets-browser'>; -} -declare module '@babel/core/lib/config/resolve-targets.js' { - declare module.exports: $Exports<'@babel/core/lib/config/resolve-targets'>; -} -declare module '@babel/core/lib/config/util.js' { - declare module.exports: $Exports<'@babel/core/lib/config/util'>; -} -declare module '@babel/core/lib/config/validation/option-assertions.js' { - declare module.exports: $Exports<'@babel/core/lib/config/validation/option-assertions'>; -} -declare module '@babel/core/lib/config/validation/options.js' { - declare module.exports: $Exports<'@babel/core/lib/config/validation/options'>; -} -declare module '@babel/core/lib/config/validation/plugins.js' { - declare module.exports: $Exports<'@babel/core/lib/config/validation/plugins'>; -} -declare module '@babel/core/lib/config/validation/removed.js' { - declare module.exports: $Exports<'@babel/core/lib/config/validation/removed'>; -} -declare module '@babel/core/lib/gensync-utils/async.js' { - declare module.exports: $Exports<'@babel/core/lib/gensync-utils/async'>; -} -declare module '@babel/core/lib/gensync-utils/fs.js' { - declare module.exports: $Exports<'@babel/core/lib/gensync-utils/fs'>; -} -declare module '@babel/core/lib/index' { - declare module.exports: $Exports<'@babel/core/lib'>; -} -declare module '@babel/core/lib/index.js' { - declare module.exports: $Exports<'@babel/core/lib'>; -} -declare module '@babel/core/lib/parse.js' { - declare module.exports: $Exports<'@babel/core/lib/parse'>; -} -declare module '@babel/core/lib/parser/index' { - declare module.exports: $Exports<'@babel/core/lib/parser'>; -} -declare module '@babel/core/lib/parser/index.js' { - declare module.exports: $Exports<'@babel/core/lib/parser'>; -} -declare module '@babel/core/lib/parser/util/missing-plugin-helper.js' { - declare module.exports: $Exports<'@babel/core/lib/parser/util/missing-plugin-helper'>; -} -declare module '@babel/core/lib/tools/build-external-helpers.js' { - declare module.exports: $Exports<'@babel/core/lib/tools/build-external-helpers'>; -} -declare module '@babel/core/lib/transform-ast.js' { - declare module.exports: $Exports<'@babel/core/lib/transform-ast'>; -} -declare module '@babel/core/lib/transform-file-browser.js' { - declare module.exports: $Exports<'@babel/core/lib/transform-file-browser'>; -} -declare module '@babel/core/lib/transform-file.js' { - declare module.exports: $Exports<'@babel/core/lib/transform-file'>; -} -declare module '@babel/core/lib/transform.js' { - declare module.exports: $Exports<'@babel/core/lib/transform'>; -} -declare module '@babel/core/lib/transformation/block-hoist-plugin.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/block-hoist-plugin'>; -} -declare module '@babel/core/lib/transformation/file/file.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/file/file'>; -} -declare module '@babel/core/lib/transformation/file/generate.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/file/generate'>; -} -declare module '@babel/core/lib/transformation/file/merge-map.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/file/merge-map'>; -} -declare module '@babel/core/lib/transformation/index' { - declare module.exports: $Exports<'@babel/core/lib/transformation'>; -} -declare module '@babel/core/lib/transformation/index.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation'>; -} -declare module '@babel/core/lib/transformation/normalize-file.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-file'>; -} -declare module '@babel/core/lib/transformation/normalize-opts.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-opts'>; -} -declare module '@babel/core/lib/transformation/plugin-pass.js' { - declare module.exports: $Exports<'@babel/core/lib/transformation/plugin-pass'>; -} -declare module '@babel/core/src/config/files/index-browser.js' { - declare module.exports: $Exports<'@babel/core/src/config/files/index-browser'>; -} -declare module '@babel/core/src/config/files/index' { - declare module.exports: $Exports<'@babel/core/src/config/files'>; -} -declare module '@babel/core/src/config/files/index.js' { - declare module.exports: $Exports<'@babel/core/src/config/files'>; -} -declare module '@babel/core/src/config/resolve-targets-browser.js' { - declare module.exports: $Exports<'@babel/core/src/config/resolve-targets-browser'>; -} -declare module '@babel/core/src/config/resolve-targets.js' { - declare module.exports: $Exports<'@babel/core/src/config/resolve-targets'>; -} -declare module '@babel/core/src/transform-file-browser.js' { - declare module.exports: $Exports<'@babel/core/src/transform-file-browser'>; -} -declare module '@babel/core/src/transform-file.js' { - declare module.exports: $Exports<'@babel/core/src/transform-file'>; -} diff --git a/flow-typed/npm/@babel/generator_vx.x.x.js b/flow-typed/npm/@babel/generator_vx.x.x.js deleted file mode 100644 index 1353dc89e0..0000000000 --- a/flow-typed/npm/@babel/generator_vx.x.x.js +++ /dev/null @@ -1,167 +0,0 @@ -// flow-typed signature: 1835f343b28f7eefa90e0387814105ae -// flow-typed version: <>/@babel/generator_v^7.12.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/generator' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/generator' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/generator/lib/buffer' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/base' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/classes' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/expressions' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/flow' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/jsx' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/methods' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/modules' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/statements' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/template-literals' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/types' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/generators/typescript' { - declare module.exports: any; -} - -declare module '@babel/generator/lib' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/node' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/node/parentheses' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/node/whitespace' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/printer' { - declare module.exports: any; -} - -declare module '@babel/generator/lib/source-map' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/generator/lib/buffer.js' { - declare module.exports: $Exports<'@babel/generator/lib/buffer'>; -} -declare module '@babel/generator/lib/generators/base.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/base'>; -} -declare module '@babel/generator/lib/generators/classes.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/classes'>; -} -declare module '@babel/generator/lib/generators/expressions.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/expressions'>; -} -declare module '@babel/generator/lib/generators/flow.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/flow'>; -} -declare module '@babel/generator/lib/generators/index' { - declare module.exports: $Exports<'@babel/generator/lib/generators'>; -} -declare module '@babel/generator/lib/generators/index.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators'>; -} -declare module '@babel/generator/lib/generators/jsx.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/jsx'>; -} -declare module '@babel/generator/lib/generators/methods.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/methods'>; -} -declare module '@babel/generator/lib/generators/modules.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/modules'>; -} -declare module '@babel/generator/lib/generators/statements.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/statements'>; -} -declare module '@babel/generator/lib/generators/template-literals.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/template-literals'>; -} -declare module '@babel/generator/lib/generators/types.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/types'>; -} -declare module '@babel/generator/lib/generators/typescript.js' { - declare module.exports: $Exports<'@babel/generator/lib/generators/typescript'>; -} -declare module '@babel/generator/lib/index' { - declare module.exports: $Exports<'@babel/generator/lib'>; -} -declare module '@babel/generator/lib/index.js' { - declare module.exports: $Exports<'@babel/generator/lib'>; -} -declare module '@babel/generator/lib/node/index' { - declare module.exports: $Exports<'@babel/generator/lib/node'>; -} -declare module '@babel/generator/lib/node/index.js' { - declare module.exports: $Exports<'@babel/generator/lib/node'>; -} -declare module '@babel/generator/lib/node/parentheses.js' { - declare module.exports: $Exports<'@babel/generator/lib/node/parentheses'>; -} -declare module '@babel/generator/lib/node/whitespace.js' { - declare module.exports: $Exports<'@babel/generator/lib/node/whitespace'>; -} -declare module '@babel/generator/lib/printer.js' { - declare module.exports: $Exports<'@babel/generator/lib/printer'>; -} -declare module '@babel/generator/lib/source-map.js' { - declare module.exports: $Exports<'@babel/generator/lib/source-map'>; -} diff --git a/flow-typed/npm/@babel/node_vx.x.x.js b/flow-typed/npm/@babel/node_vx.x.x.js deleted file mode 100644 index 40cb0eab09..0000000000 --- a/flow-typed/npm/@babel/node_vx.x.x.js +++ /dev/null @@ -1,46 +0,0 @@ -// flow-typed signature: ff4fb76bf2919124af9a37c6ad23895f -// flow-typed version: <>/@babel/node_v^7.12.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/node' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/node' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/node/bin/babel-node' { - declare module.exports: any; -} - -declare module '@babel/node/lib/_babel-node' { - declare module.exports: any; -} - -declare module '@babel/node/lib/babel-node' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/node/bin/babel-node.js' { - declare module.exports: $Exports<'@babel/node/bin/babel-node'>; -} -declare module '@babel/node/lib/_babel-node.js' { - declare module.exports: $Exports<'@babel/node/lib/_babel-node'>; -} -declare module '@babel/node/lib/babel-node.js' { - declare module.exports: $Exports<'@babel/node/lib/babel-node'>; -} diff --git a/flow-typed/npm/@babel/parser_vx.x.x.js b/flow-typed/npm/@babel/parser_vx.x.x.js deleted file mode 100644 index 2749416151..0000000000 --- a/flow-typed/npm/@babel/parser_vx.x.x.js +++ /dev/null @@ -1,42 +0,0 @@ -// flow-typed signature: 2b99b2d0b2b01991ac28f0e22ac2dec1 -// flow-typed version: <>/@babel/parser_v^7.12.17/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/parser' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/parser' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/parser/bin/babel-parser' { - declare module.exports: any; -} - -declare module '@babel/parser/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/parser/bin/babel-parser.js' { - declare module.exports: $Exports<'@babel/parser/bin/babel-parser'>; -} -declare module '@babel/parser/lib/index' { - declare module.exports: $Exports<'@babel/parser/lib'>; -} -declare module '@babel/parser/lib/index.js' { - declare module.exports: $Exports<'@babel/parser/lib'>; -} diff --git a/flow-typed/npm/@babel/preset-env_vx.x.x.js b/flow-typed/npm/@babel/preset-env_vx.x.x.js deleted file mode 100644 index 77c59ef83f..0000000000 --- a/flow-typed/npm/@babel/preset-env_vx.x.x.js +++ /dev/null @@ -1,189 +0,0 @@ -// flow-typed signature: e98e5677efa724769305e00aeb2aed99 -// flow-typed version: <>/@babel/preset-env_v^7.12.17/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/preset-env' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/preset-env' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/preset-env/data/built-in-modules' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/built-in-modules.json' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/built-ins' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/built-ins.json' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/corejs2-built-ins' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/corejs2-built-ins.json' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/plugins' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/plugins.json' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/shipped-proposals' { - declare module.exports: any; -} - -declare module '@babel/preset-env/data/unreleased-labels' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/available-plugins' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/debug' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/filter-items' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/get-option-specific-excludes' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/module-transformations' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/normalize-options' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/options' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/plugins-compat-data' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/polyfills/babel-polyfill' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/polyfills/regenerator' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/polyfills/utils' { - declare module.exports: any; -} - -declare module '@babel/preset-env/lib/targets-parser' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/preset-env/data/built-in-modules.js' { - declare module.exports: $Exports<'@babel/preset-env/data/built-in-modules'>; -} -declare module '@babel/preset-env/data/built-in-modules.json.js' { - declare module.exports: $Exports<'@babel/preset-env/data/built-in-modules.json'>; -} -declare module '@babel/preset-env/data/built-ins.js' { - declare module.exports: $Exports<'@babel/preset-env/data/built-ins'>; -} -declare module '@babel/preset-env/data/built-ins.json.js' { - declare module.exports: $Exports<'@babel/preset-env/data/built-ins.json'>; -} -declare module '@babel/preset-env/data/corejs2-built-ins.js' { - declare module.exports: $Exports<'@babel/preset-env/data/corejs2-built-ins'>; -} -declare module '@babel/preset-env/data/corejs2-built-ins.json.js' { - declare module.exports: $Exports<'@babel/preset-env/data/corejs2-built-ins.json'>; -} -declare module '@babel/preset-env/data/plugins.js' { - declare module.exports: $Exports<'@babel/preset-env/data/plugins'>; -} -declare module '@babel/preset-env/data/plugins.json.js' { - declare module.exports: $Exports<'@babel/preset-env/data/plugins.json'>; -} -declare module '@babel/preset-env/data/shipped-proposals.js' { - declare module.exports: $Exports<'@babel/preset-env/data/shipped-proposals'>; -} -declare module '@babel/preset-env/data/unreleased-labels.js' { - declare module.exports: $Exports<'@babel/preset-env/data/unreleased-labels'>; -} -declare module '@babel/preset-env/lib/available-plugins.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/available-plugins'>; -} -declare module '@babel/preset-env/lib/debug.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/debug'>; -} -declare module '@babel/preset-env/lib/filter-items.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/filter-items'>; -} -declare module '@babel/preset-env/lib/get-option-specific-excludes.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/get-option-specific-excludes'>; -} -declare module '@babel/preset-env/lib/index' { - declare module.exports: $Exports<'@babel/preset-env/lib'>; -} -declare module '@babel/preset-env/lib/index.js' { - declare module.exports: $Exports<'@babel/preset-env/lib'>; -} -declare module '@babel/preset-env/lib/module-transformations.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/module-transformations'>; -} -declare module '@babel/preset-env/lib/normalize-options.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/normalize-options'>; -} -declare module '@babel/preset-env/lib/options.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/options'>; -} -declare module '@babel/preset-env/lib/plugins-compat-data.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/plugins-compat-data'>; -} -declare module '@babel/preset-env/lib/polyfills/babel-polyfill.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/babel-polyfill'>; -} -declare module '@babel/preset-env/lib/polyfills/regenerator.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/regenerator'>; -} -declare module '@babel/preset-env/lib/polyfills/utils.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/utils'>; -} -declare module '@babel/preset-env/lib/targets-parser.js' { - declare module.exports: $Exports<'@babel/preset-env/lib/targets-parser'>; -} diff --git a/flow-typed/npm/@babel/preset-flow_vx.x.x.js b/flow-typed/npm/@babel/preset-flow_vx.x.x.js deleted file mode 100644 index 60645dee9c..0000000000 --- a/flow-typed/npm/@babel/preset-flow_vx.x.x.js +++ /dev/null @@ -1,35 +0,0 @@ -// flow-typed signature: 525f4f25f4b2b2d2388b850a358f1009 -// flow-typed version: <>/@babel/preset-flow_v^7.12.13/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/preset-flow' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/preset-flow' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/preset-flow/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/preset-flow/lib/index' { - declare module.exports: $Exports<'@babel/preset-flow/lib'>; -} -declare module '@babel/preset-flow/lib/index.js' { - declare module.exports: $Exports<'@babel/preset-flow/lib'>; -} diff --git a/flow-typed/npm/@babel/preset-react_vx.x.x.js b/flow-typed/npm/@babel/preset-react_vx.x.x.js deleted file mode 100644 index 80811c2f44..0000000000 --- a/flow-typed/npm/@babel/preset-react_vx.x.x.js +++ /dev/null @@ -1,35 +0,0 @@ -// flow-typed signature: d952bb27e100465f9abcfeb83e90b7d9 -// flow-typed version: <>/@babel/preset-react_v^7.12.13/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/preset-react' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/preset-react' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/preset-react/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/preset-react/lib/index' { - declare module.exports: $Exports<'@babel/preset-react/lib'>; -} -declare module '@babel/preset-react/lib/index.js' { - declare module.exports: $Exports<'@babel/preset-react/lib'>; -} diff --git a/flow-typed/npm/@babel/preset-typescript_vx.x.x.js b/flow-typed/npm/@babel/preset-typescript_vx.x.x.js deleted file mode 100644 index 78d4d87aa8..0000000000 --- a/flow-typed/npm/@babel/preset-typescript_vx.x.x.js +++ /dev/null @@ -1,35 +0,0 @@ -// flow-typed signature: bb9fb58747b70694381f6add5337ec44 -// flow-typed version: <>/@babel/preset-typescript_v^7.13.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/preset-typescript' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/preset-typescript' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/preset-typescript/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/preset-typescript/lib/index' { - declare module.exports: $Exports<'@babel/preset-typescript/lib'>; -} -declare module '@babel/preset-typescript/lib/index.js' { - declare module.exports: $Exports<'@babel/preset-typescript/lib'>; -} diff --git a/flow-typed/npm/@babel/runtime_vx.x.x.js b/flow-typed/npm/@babel/runtime_vx.x.x.js deleted file mode 100644 index a78abca46f..0000000000 --- a/flow-typed/npm/@babel/runtime_vx.x.x.js +++ /dev/null @@ -1,1267 +0,0 @@ -// flow-typed signature: 4f7b0a58c3a011ea3a13a3877be930e4 -// flow-typed version: <>/@babel/runtime_v^7.11.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@babel/runtime' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@babel/runtime' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@babel/runtime/helpers/applyDecoratedDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/arrayLikeToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/arrayWithHoles' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/arrayWithoutHoles' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/assertThisInitialized' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/AsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/asyncGeneratorDelegate' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/asyncIterator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/asyncToGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/awaitAsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/AwaitValue' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classApplyDescriptorDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classApplyDescriptorGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classApplyDescriptorSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classCallCheck' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classCheckPrivateStaticAccess' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classExtractFieldDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classNameTDZError' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateFieldDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateFieldGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateFieldLooseBase' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateFieldLooseKey' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateFieldSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateMethodGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classPrivateMethodSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classStaticPrivateFieldDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classStaticPrivateMethodGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/classStaticPrivateMethodSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/construct' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/createClass' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/createForOfIteratorHelper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/createForOfIteratorHelperLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/createSuper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/decorate' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/defaults' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/defineEnumerableProperties' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/defineProperty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/arrayLikeToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/arrayWithHoles' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/arrayWithoutHoles' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/assertThisInitialized' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/AsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/asyncIterator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/asyncToGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/AwaitValue' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classApplyDescriptorGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classApplyDescriptorSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classCallCheck' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classCheckPrivateStaticAccess' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classExtractFieldDescriptor' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classNameTDZError' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateFieldDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateFieldGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateFieldSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateMethodGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classPrivateMethodSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/construct' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/createClass' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/createForOfIteratorHelper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/createForOfIteratorHelperLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/createSuper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/decorate' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/defaults' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/defineEnumerableProperties' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/defineProperty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/extends' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/get' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/getPrototypeOf' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/inherits' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/inheritsLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/initializerDefineProperty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/initializerWarningHelper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/instanceof' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/interopRequireDefault' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/interopRequireWildcard' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/isNativeFunction' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/isNativeReflectConstruct' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/iterableToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/iterableToArrayLimit' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/jsx' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/maybeArrayLike' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/newArrowCheck' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/nonIterableRest' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/nonIterableSpread' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/objectSpread' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/objectSpread2' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/objectWithoutProperties' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/possibleConstructorReturn' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/readOnlyError' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/set' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/setPrototypeOf' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/slicedToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/slicedToArrayLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/superPropBase' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/tdz' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/temporalRef' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/temporalUndefined' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/toArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/toConsumableArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/toPrimitive' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/toPropertyKey' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/typeof' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/unsupportedIterableToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/wrapNativeSuper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/wrapRegExp' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/esm/writeOnlyError' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/extends' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/get' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/getPrototypeOf' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/inherits' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/inheritsLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/initializerDefineProperty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/initializerWarningHelper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/instanceof' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/interopRequireDefault' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/interopRequireWildcard' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/isNativeFunction' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/isNativeReflectConstruct' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/iterableToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/iterableToArrayLimit' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/iterableToArrayLimitLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/jsx' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/maybeArrayLike' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/newArrowCheck' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/nonIterableRest' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/nonIterableSpread' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/objectDestructuringEmpty' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/objectSpread' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/objectSpread2' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/objectWithoutProperties' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/possibleConstructorReturn' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/readOnlyError' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/set' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/setPrototypeOf' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/skipFirstGeneratorNext' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/slicedToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/slicedToArrayLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/superPropBase' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/taggedTemplateLiteral' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/tdz' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/temporalRef' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/temporalUndefined' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/toArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/toConsumableArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/toPrimitive' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/toPropertyKey' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/typeof' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/unsupportedIterableToArray' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/wrapAsyncGenerator' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/wrapNativeSuper' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/wrapRegExp' { - declare module.exports: any; -} - -declare module '@babel/runtime/helpers/writeOnlyError' { - declare module.exports: any; -} - -declare module '@babel/runtime/regenerator' { - declare module.exports: any; -} - -// Filename aliases -declare module '@babel/runtime/helpers/applyDecoratedDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/applyDecoratedDescriptor'>; -} -declare module '@babel/runtime/helpers/arrayLikeToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/arrayLikeToArray'>; -} -declare module '@babel/runtime/helpers/arrayWithHoles.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithHoles'>; -} -declare module '@babel/runtime/helpers/arrayWithoutHoles.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithoutHoles'>; -} -declare module '@babel/runtime/helpers/assertThisInitialized.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/assertThisInitialized'>; -} -declare module '@babel/runtime/helpers/AsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/AsyncGenerator'>; -} -declare module '@babel/runtime/helpers/asyncGeneratorDelegate.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/asyncGeneratorDelegate'>; -} -declare module '@babel/runtime/helpers/asyncIterator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/asyncIterator'>; -} -declare module '@babel/runtime/helpers/asyncToGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/asyncToGenerator'>; -} -declare module '@babel/runtime/helpers/awaitAsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/awaitAsyncGenerator'>; -} -declare module '@babel/runtime/helpers/AwaitValue.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/AwaitValue'>; -} -declare module '@babel/runtime/helpers/classApplyDescriptorDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classApplyDescriptorDestructureSet'>; -} -declare module '@babel/runtime/helpers/classApplyDescriptorGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classApplyDescriptorGet'>; -} -declare module '@babel/runtime/helpers/classApplyDescriptorSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classApplyDescriptorSet'>; -} -declare module '@babel/runtime/helpers/classCallCheck.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classCallCheck'>; -} -declare module '@babel/runtime/helpers/classCheckPrivateStaticAccess.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classCheckPrivateStaticAccess'>; -} -declare module '@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor'>; -} -declare module '@babel/runtime/helpers/classExtractFieldDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classExtractFieldDescriptor'>; -} -declare module '@babel/runtime/helpers/classNameTDZError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classNameTDZError'>; -} -declare module '@babel/runtime/helpers/classPrivateFieldDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldDestructureSet'>; -} -declare module '@babel/runtime/helpers/classPrivateFieldGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldGet'>; -} -declare module '@babel/runtime/helpers/classPrivateFieldLooseBase.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseBase'>; -} -declare module '@babel/runtime/helpers/classPrivateFieldLooseKey.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseKey'>; -} -declare module '@babel/runtime/helpers/classPrivateFieldSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldSet'>; -} -declare module '@babel/runtime/helpers/classPrivateMethodGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodGet'>; -} -declare module '@babel/runtime/helpers/classPrivateMethodSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodSet'>; -} -declare module '@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldDestructureSet'>; -} -declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecGet'>; -} -declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecSet'>; -} -declare module '@babel/runtime/helpers/classStaticPrivateMethodGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodGet'>; -} -declare module '@babel/runtime/helpers/classStaticPrivateMethodSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodSet'>; -} -declare module '@babel/runtime/helpers/construct.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/construct'>; -} -declare module '@babel/runtime/helpers/createClass.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/createClass'>; -} -declare module '@babel/runtime/helpers/createForOfIteratorHelper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/createForOfIteratorHelper'>; -} -declare module '@babel/runtime/helpers/createForOfIteratorHelperLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/createForOfIteratorHelperLoose'>; -} -declare module '@babel/runtime/helpers/createSuper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/createSuper'>; -} -declare module '@babel/runtime/helpers/decorate.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/decorate'>; -} -declare module '@babel/runtime/helpers/defaults.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/defaults'>; -} -declare module '@babel/runtime/helpers/defineEnumerableProperties.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/defineEnumerableProperties'>; -} -declare module '@babel/runtime/helpers/defineProperty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/defineProperty'>; -} -declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/applyDecoratedDescriptor'>; -} -declare module '@babel/runtime/helpers/esm/arrayLikeToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayLikeToArray'>; -} -declare module '@babel/runtime/helpers/esm/arrayWithHoles.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithHoles'>; -} -declare module '@babel/runtime/helpers/esm/arrayWithoutHoles.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithoutHoles'>; -} -declare module '@babel/runtime/helpers/esm/assertThisInitialized.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/assertThisInitialized'>; -} -declare module '@babel/runtime/helpers/esm/AsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/AsyncGenerator'>; -} -declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncGeneratorDelegate'>; -} -declare module '@babel/runtime/helpers/esm/asyncIterator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncIterator'>; -} -declare module '@babel/runtime/helpers/esm/asyncToGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncToGenerator'>; -} -declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/awaitAsyncGenerator'>; -} -declare module '@babel/runtime/helpers/esm/AwaitValue.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/AwaitValue'>; -} -declare module '@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet'>; -} -declare module '@babel/runtime/helpers/esm/classApplyDescriptorGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classApplyDescriptorGet'>; -} -declare module '@babel/runtime/helpers/esm/classApplyDescriptorSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classApplyDescriptorSet'>; -} -declare module '@babel/runtime/helpers/esm/classCallCheck.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classCallCheck'>; -} -declare module '@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classCheckPrivateStaticAccess'>; -} -declare module '@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor'>; -} -declare module '@babel/runtime/helpers/esm/classExtractFieldDescriptor.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classExtractFieldDescriptor'>; -} -declare module '@babel/runtime/helpers/esm/classNameTDZError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classNameTDZError'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldDestructureSet'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateFieldGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldGet'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseBase'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseKey'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateFieldSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldSet'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateMethodGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodGet'>; -} -declare module '@babel/runtime/helpers/esm/classPrivateMethodSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodSet'>; -} -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet'>; -} -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet'>; -} -declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet'>; -} -declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodGet'>; -} -declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodSet'>; -} -declare module '@babel/runtime/helpers/esm/construct.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/construct'>; -} -declare module '@babel/runtime/helpers/esm/createClass.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/createClass'>; -} -declare module '@babel/runtime/helpers/esm/createForOfIteratorHelper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/createForOfIteratorHelper'>; -} -declare module '@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/createForOfIteratorHelperLoose'>; -} -declare module '@babel/runtime/helpers/esm/createSuper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/createSuper'>; -} -declare module '@babel/runtime/helpers/esm/decorate.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/decorate'>; -} -declare module '@babel/runtime/helpers/esm/defaults.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/defaults'>; -} -declare module '@babel/runtime/helpers/esm/defineEnumerableProperties.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineEnumerableProperties'>; -} -declare module '@babel/runtime/helpers/esm/defineProperty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineProperty'>; -} -declare module '@babel/runtime/helpers/esm/extends.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/extends'>; -} -declare module '@babel/runtime/helpers/esm/get.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/get'>; -} -declare module '@babel/runtime/helpers/esm/getPrototypeOf.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/getPrototypeOf'>; -} -declare module '@babel/runtime/helpers/esm/inherits.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/inherits'>; -} -declare module '@babel/runtime/helpers/esm/inheritsLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/inheritsLoose'>; -} -declare module '@babel/runtime/helpers/esm/initializerDefineProperty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerDefineProperty'>; -} -declare module '@babel/runtime/helpers/esm/initializerWarningHelper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerWarningHelper'>; -} -declare module '@babel/runtime/helpers/esm/instanceof.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/instanceof'>; -} -declare module '@babel/runtime/helpers/esm/interopRequireDefault.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireDefault'>; -} -declare module '@babel/runtime/helpers/esm/interopRequireWildcard.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireWildcard'>; -} -declare module '@babel/runtime/helpers/esm/isNativeFunction.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/isNativeFunction'>; -} -declare module '@babel/runtime/helpers/esm/isNativeReflectConstruct.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/isNativeReflectConstruct'>; -} -declare module '@babel/runtime/helpers/esm/iterableToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArray'>; -} -declare module '@babel/runtime/helpers/esm/iterableToArrayLimit.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimit'>; -} -declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimitLoose'>; -} -declare module '@babel/runtime/helpers/esm/jsx.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/jsx'>; -} -declare module '@babel/runtime/helpers/esm/maybeArrayLike.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/maybeArrayLike'>; -} -declare module '@babel/runtime/helpers/esm/newArrowCheck.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/newArrowCheck'>; -} -declare module '@babel/runtime/helpers/esm/nonIterableRest.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableRest'>; -} -declare module '@babel/runtime/helpers/esm/nonIterableSpread.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableSpread'>; -} -declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectDestructuringEmpty'>; -} -declare module '@babel/runtime/helpers/esm/objectSpread.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectSpread'>; -} -declare module '@babel/runtime/helpers/esm/objectSpread2.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectSpread2'>; -} -declare module '@babel/runtime/helpers/esm/objectWithoutProperties.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutProperties'>; -} -declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutPropertiesLoose'>; -} -declare module '@babel/runtime/helpers/esm/possibleConstructorReturn.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/possibleConstructorReturn'>; -} -declare module '@babel/runtime/helpers/esm/readOnlyError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/readOnlyError'>; -} -declare module '@babel/runtime/helpers/esm/set.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/set'>; -} -declare module '@babel/runtime/helpers/esm/setPrototypeOf.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/setPrototypeOf'>; -} -declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/skipFirstGeneratorNext'>; -} -declare module '@babel/runtime/helpers/esm/slicedToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArray'>; -} -declare module '@babel/runtime/helpers/esm/slicedToArrayLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArrayLoose'>; -} -declare module '@babel/runtime/helpers/esm/superPropBase.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/superPropBase'>; -} -declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteral'>; -} -declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteralLoose'>; -} -declare module '@babel/runtime/helpers/esm/tdz.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/tdz'>; -} -declare module '@babel/runtime/helpers/esm/temporalRef.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalRef'>; -} -declare module '@babel/runtime/helpers/esm/temporalUndefined.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalUndefined'>; -} -declare module '@babel/runtime/helpers/esm/toArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/toArray'>; -} -declare module '@babel/runtime/helpers/esm/toConsumableArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/toConsumableArray'>; -} -declare module '@babel/runtime/helpers/esm/toPrimitive.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPrimitive'>; -} -declare module '@babel/runtime/helpers/esm/toPropertyKey.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPropertyKey'>; -} -declare module '@babel/runtime/helpers/esm/typeof.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/typeof'>; -} -declare module '@babel/runtime/helpers/esm/unsupportedIterableToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/unsupportedIterableToArray'>; -} -declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapAsyncGenerator'>; -} -declare module '@babel/runtime/helpers/esm/wrapNativeSuper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapNativeSuper'>; -} -declare module '@babel/runtime/helpers/esm/wrapRegExp.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapRegExp'>; -} -declare module '@babel/runtime/helpers/esm/writeOnlyError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/esm/writeOnlyError'>; -} -declare module '@babel/runtime/helpers/extends.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/extends'>; -} -declare module '@babel/runtime/helpers/get.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/get'>; -} -declare module '@babel/runtime/helpers/getPrototypeOf.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/getPrototypeOf'>; -} -declare module '@babel/runtime/helpers/inherits.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/inherits'>; -} -declare module '@babel/runtime/helpers/inheritsLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/inheritsLoose'>; -} -declare module '@babel/runtime/helpers/initializerDefineProperty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/initializerDefineProperty'>; -} -declare module '@babel/runtime/helpers/initializerWarningHelper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/initializerWarningHelper'>; -} -declare module '@babel/runtime/helpers/instanceof.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/instanceof'>; -} -declare module '@babel/runtime/helpers/interopRequireDefault.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireDefault'>; -} -declare module '@babel/runtime/helpers/interopRequireWildcard.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireWildcard'>; -} -declare module '@babel/runtime/helpers/isNativeFunction.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/isNativeFunction'>; -} -declare module '@babel/runtime/helpers/isNativeReflectConstruct.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/isNativeReflectConstruct'>; -} -declare module '@babel/runtime/helpers/iterableToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArray'>; -} -declare module '@babel/runtime/helpers/iterableToArrayLimit.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimit'>; -} -declare module '@babel/runtime/helpers/iterableToArrayLimitLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimitLoose'>; -} -declare module '@babel/runtime/helpers/jsx.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/jsx'>; -} -declare module '@babel/runtime/helpers/maybeArrayLike.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/maybeArrayLike'>; -} -declare module '@babel/runtime/helpers/newArrowCheck.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/newArrowCheck'>; -} -declare module '@babel/runtime/helpers/nonIterableRest.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableRest'>; -} -declare module '@babel/runtime/helpers/nonIterableSpread.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableSpread'>; -} -declare module '@babel/runtime/helpers/objectDestructuringEmpty.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/objectDestructuringEmpty'>; -} -declare module '@babel/runtime/helpers/objectSpread.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/objectSpread'>; -} -declare module '@babel/runtime/helpers/objectSpread2.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/objectSpread2'>; -} -declare module '@babel/runtime/helpers/objectWithoutProperties.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutProperties'>; -} -declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutPropertiesLoose'>; -} -declare module '@babel/runtime/helpers/possibleConstructorReturn.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/possibleConstructorReturn'>; -} -declare module '@babel/runtime/helpers/readOnlyError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/readOnlyError'>; -} -declare module '@babel/runtime/helpers/set.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/set'>; -} -declare module '@babel/runtime/helpers/setPrototypeOf.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/setPrototypeOf'>; -} -declare module '@babel/runtime/helpers/skipFirstGeneratorNext.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/skipFirstGeneratorNext'>; -} -declare module '@babel/runtime/helpers/slicedToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArray'>; -} -declare module '@babel/runtime/helpers/slicedToArrayLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArrayLoose'>; -} -declare module '@babel/runtime/helpers/superPropBase.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/superPropBase'>; -} -declare module '@babel/runtime/helpers/taggedTemplateLiteral.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteral'>; -} -declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteralLoose'>; -} -declare module '@babel/runtime/helpers/tdz.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/tdz'>; -} -declare module '@babel/runtime/helpers/temporalRef.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/temporalRef'>; -} -declare module '@babel/runtime/helpers/temporalUndefined.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/temporalUndefined'>; -} -declare module '@babel/runtime/helpers/toArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/toArray'>; -} -declare module '@babel/runtime/helpers/toConsumableArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/toConsumableArray'>; -} -declare module '@babel/runtime/helpers/toPrimitive.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/toPrimitive'>; -} -declare module '@babel/runtime/helpers/toPropertyKey.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/toPropertyKey'>; -} -declare module '@babel/runtime/helpers/typeof.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/typeof'>; -} -declare module '@babel/runtime/helpers/unsupportedIterableToArray.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/unsupportedIterableToArray'>; -} -declare module '@babel/runtime/helpers/wrapAsyncGenerator.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/wrapAsyncGenerator'>; -} -declare module '@babel/runtime/helpers/wrapNativeSuper.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/wrapNativeSuper'>; -} -declare module '@babel/runtime/helpers/wrapRegExp.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/wrapRegExp'>; -} -declare module '@babel/runtime/helpers/writeOnlyError.js' { - declare module.exports: $Exports<'@babel/runtime/helpers/writeOnlyError'>; -} -declare module '@babel/runtime/regenerator/index' { - declare module.exports: $Exports<'@babel/runtime/regenerator'>; -} -declare module '@babel/runtime/regenerator/index.js' { - declare module.exports: $Exports<'@babel/runtime/regenerator'>; -} diff --git a/flow-typed/npm/@commitlint/cli_vx.x.x.js b/flow-typed/npm/@commitlint/cli_vx.x.x.js deleted file mode 100644 index fa3d099760..0000000000 --- a/flow-typed/npm/@commitlint/cli_vx.x.x.js +++ /dev/null @@ -1,59 +0,0 @@ -// flow-typed signature: eeedd21c1d9c4415f8dacc46319df938 -// flow-typed version: <>/@commitlint/cli_v^11.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@commitlint/cli' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@commitlint/cli' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@commitlint/cli/cli' { - declare module.exports: any; -} - -declare module '@commitlint/cli/lib/cli-error' { - declare module.exports: any; -} - -declare module '@commitlint/cli/lib/cli' { - declare module.exports: any; -} - -declare module '@commitlint/cli/lib/types' { - declare module.exports: any; -} - -// Filename aliases -declare module '@commitlint/cli/cli.js' { - declare module.exports: $Exports<'@commitlint/cli/cli'>; -} -declare module '@commitlint/cli/index' { - declare module.exports: $Exports<'@commitlint/cli'>; -} -declare module '@commitlint/cli/index.js' { - declare module.exports: $Exports<'@commitlint/cli'>; -} -declare module '@commitlint/cli/lib/cli-error.js' { - declare module.exports: $Exports<'@commitlint/cli/lib/cli-error'>; -} -declare module '@commitlint/cli/lib/cli.js' { - declare module.exports: $Exports<'@commitlint/cli/lib/cli'>; -} -declare module '@commitlint/cli/lib/types.js' { - declare module.exports: $Exports<'@commitlint/cli/lib/types'>; -} diff --git a/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js b/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js deleted file mode 100644 index 5ed27320b5..0000000000 --- a/flow-typed/npm/@commitlint/config-conventional_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: d914824770384ac2af04de53758149a3 -// flow-typed version: <>/@commitlint/config-conventional_v^11.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@commitlint/config-conventional' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@commitlint/config-conventional' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module '@commitlint/config-conventional/index' { - declare module.exports: $Exports<'@commitlint/config-conventional'>; -} -declare module '@commitlint/config-conventional/index.js' { - declare module.exports: $Exports<'@commitlint/config-conventional'>; -} diff --git a/flow-typed/npm/@kiwicom/browserslist-config_vx.x.x.js b/flow-typed/npm/@kiwicom/browserslist-config_vx.x.x.js deleted file mode 100644 index dadaebef73..0000000000 --- a/flow-typed/npm/@kiwicom/browserslist-config_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: af0f76e2b6113ddc70ea404a4273fd53 -// flow-typed version: <>/@kiwicom/browserslist-config_v^1.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@kiwicom/browserslist-config' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@kiwicom/browserslist-config' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module '@kiwicom/browserslist-config/index' { - declare module.exports: $Exports<'@kiwicom/browserslist-config'>; -} -declare module '@kiwicom/browserslist-config/index.js' { - declare module.exports: $Exports<'@kiwicom/browserslist-config'>; -} diff --git a/flow-typed/npm/@lerna/project_vx.x.x.js b/flow-typed/npm/@lerna/project_vx.x.x.js deleted file mode 100644 index df6ca6910e..0000000000 --- a/flow-typed/npm/@lerna/project_vx.x.x.js +++ /dev/null @@ -1,59 +0,0 @@ -// flow-typed signature: 8004b52dfe6a958968a89fa06d061e3a -// flow-typed version: <>/@lerna/project_v^3.21.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@lerna/project' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@lerna/project' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@lerna/project/lib/apply-extends' { - declare module.exports: any; -} - -declare module '@lerna/project/lib/deprecate-config' { - declare module.exports: any; -} - -declare module '@lerna/project/lib/make-file-finder' { - declare module.exports: any; -} - -declare module '@lerna/project/lib/shallow-extend' { - declare module.exports: any; -} - -// Filename aliases -declare module '@lerna/project/index' { - declare module.exports: $Exports<'@lerna/project'>; -} -declare module '@lerna/project/index.js' { - declare module.exports: $Exports<'@lerna/project'>; -} -declare module '@lerna/project/lib/apply-extends.js' { - declare module.exports: $Exports<'@lerna/project/lib/apply-extends'>; -} -declare module '@lerna/project/lib/deprecate-config.js' { - declare module.exports: $Exports<'@lerna/project/lib/deprecate-config'>; -} -declare module '@lerna/project/lib/make-file-finder.js' { - declare module.exports: $Exports<'@lerna/project/lib/make-file-finder'>; -} -declare module '@lerna/project/lib/shallow-extend.js' { - declare module.exports: $Exports<'@lerna/project/lib/shallow-extend'>; -} diff --git a/flow-typed/npm/@octokit/rest_vx.x.x.js b/flow-typed/npm/@octokit/rest_vx.x.x.js deleted file mode 100644 index 2ff02bbd13..0000000000 --- a/flow-typed/npm/@octokit/rest_vx.x.x.js +++ /dev/null @@ -1,62 +0,0 @@ -// flow-typed signature: dc280da3c2a0dbe9313a5676c2cb1788 -// flow-typed version: <>/@octokit/rest_v^18.0.14/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@octokit/rest' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@octokit/rest' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@octokit/rest/dist-node' { - declare module.exports: any; -} - -declare module '@octokit/rest/dist-src' { - declare module.exports: any; -} - -declare module '@octokit/rest/dist-src/version' { - declare module.exports: any; -} - -declare module '@octokit/rest/dist-web' { - declare module.exports: any; -} - -// Filename aliases -declare module '@octokit/rest/dist-node/index' { - declare module.exports: $Exports<'@octokit/rest/dist-node'>; -} -declare module '@octokit/rest/dist-node/index.js' { - declare module.exports: $Exports<'@octokit/rest/dist-node'>; -} -declare module '@octokit/rest/dist-src/index' { - declare module.exports: $Exports<'@octokit/rest/dist-src'>; -} -declare module '@octokit/rest/dist-src/index.js' { - declare module.exports: $Exports<'@octokit/rest/dist-src'>; -} -declare module '@octokit/rest/dist-src/version.js' { - declare module.exports: $Exports<'@octokit/rest/dist-src/version'>; -} -declare module '@octokit/rest/dist-web/index' { - declare module.exports: $Exports<'@octokit/rest/dist-web'>; -} -declare module '@octokit/rest/dist-web/index.js' { - declare module.exports: $Exports<'@octokit/rest/dist-web'>; -} diff --git a/flow-typed/npm/@storybook/addon-actions_vx.x.x.js b/flow-typed/npm/@storybook/addon-actions_vx.x.x.js deleted file mode 100644 index 0ce2fb85c4..0000000000 --- a/flow-typed/npm/@storybook/addon-actions_vx.x.x.js +++ /dev/null @@ -1,218 +0,0 @@ -// flow-typed signature: 356c73dcd2a7928f862dd1b0f40aa7bd -// flow-typed version: <>/@storybook/addon-actions_v^6.0.28/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addon-actions' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addon-actions' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addon-actions/dist/components/ActionLogger' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/components/ActionLogger/style' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/constants' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/containers/ActionLogger' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/ActionDisplay' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/ActionOptions' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/ActionsFunction' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/ActionsMap' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/DecoratorFunction' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models/HandlerFunction' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/models' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preset/addArgs' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preset/addDecorator' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview/action' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview/actions' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview/configureActions' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview/decorateAction' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/preview/withActions' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/register' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/dist/typings.d' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-actions/register' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addon-actions/dist/components/ActionLogger/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/components/ActionLogger'>; -} -declare module '@storybook/addon-actions/dist/components/ActionLogger/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/components/ActionLogger'>; -} -declare module '@storybook/addon-actions/dist/components/ActionLogger/style.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/components/ActionLogger/style'>; -} -declare module '@storybook/addon-actions/dist/constants.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/constants'>; -} -declare module '@storybook/addon-actions/dist/containers/ActionLogger/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/containers/ActionLogger'>; -} -declare module '@storybook/addon-actions/dist/containers/ActionLogger/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/containers/ActionLogger'>; -} -declare module '@storybook/addon-actions/dist/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist'>; -} -declare module '@storybook/addon-actions/dist/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist'>; -} -declare module '@storybook/addon-actions/dist/models/ActionDisplay.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/ActionDisplay'>; -} -declare module '@storybook/addon-actions/dist/models/ActionOptions.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/ActionOptions'>; -} -declare module '@storybook/addon-actions/dist/models/ActionsFunction.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/ActionsFunction'>; -} -declare module '@storybook/addon-actions/dist/models/ActionsMap.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/ActionsMap'>; -} -declare module '@storybook/addon-actions/dist/models/DecoratorFunction.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/DecoratorFunction'>; -} -declare module '@storybook/addon-actions/dist/models/HandlerFunction.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models/HandlerFunction'>; -} -declare module '@storybook/addon-actions/dist/models/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models'>; -} -declare module '@storybook/addon-actions/dist/models/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/models'>; -} -declare module '@storybook/addon-actions/dist/preset/addArgs.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preset/addArgs'>; -} -declare module '@storybook/addon-actions/dist/preset/addDecorator.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preset/addDecorator'>; -} -declare module '@storybook/addon-actions/dist/preset/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preset'>; -} -declare module '@storybook/addon-actions/dist/preset/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preset'>; -} -declare module '@storybook/addon-actions/dist/preview/action.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview/action'>; -} -declare module '@storybook/addon-actions/dist/preview/actions.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview/actions'>; -} -declare module '@storybook/addon-actions/dist/preview/configureActions.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview/configureActions'>; -} -declare module '@storybook/addon-actions/dist/preview/decorateAction.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview/decorateAction'>; -} -declare module '@storybook/addon-actions/dist/preview/index' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview'>; -} -declare module '@storybook/addon-actions/dist/preview/index.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview'>; -} -declare module '@storybook/addon-actions/dist/preview/withActions.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/preview/withActions'>; -} -declare module '@storybook/addon-actions/dist/register.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/register'>; -} -declare module '@storybook/addon-actions/dist/typings.d.js' { - declare module.exports: $Exports<'@storybook/addon-actions/dist/typings.d'>; -} -declare module '@storybook/addon-actions/preset.js' { - declare module.exports: $Exports<'@storybook/addon-actions/preset'>; -} -declare module '@storybook/addon-actions/register.js' { - declare module.exports: $Exports<'@storybook/addon-actions/register'>; -} diff --git a/flow-typed/npm/@storybook/addon-backgrounds_vx.x.x.js b/flow-typed/npm/@storybook/addon-backgrounds_vx.x.x.js deleted file mode 100644 index c4d1422607..0000000000 --- a/flow-typed/npm/@storybook/addon-backgrounds_vx.x.x.js +++ /dev/null @@ -1,159 +0,0 @@ -// flow-typed signature: a15a5f2d185c5cc24f796ba8658e63c3 -// flow-typed version: <>/@storybook/addon-backgrounds_v^6.1.10/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addon-backgrounds' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addon-backgrounds' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addon-backgrounds/dist/components/ColorIcon' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/constants' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/containers/BackgroundSelector' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/containers/GridSelector' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/decorators' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/decorators/withBackground' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/decorators/withGrid' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/helpers' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/preset/addDecorator' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/preset/addParameter' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/register' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/types' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/dist/typings.d' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-backgrounds/register' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addon-backgrounds/dist/components/ColorIcon.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/components/ColorIcon'>; -} -declare module '@storybook/addon-backgrounds/dist/constants.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/constants'>; -} -declare module '@storybook/addon-backgrounds/dist/containers/BackgroundSelector.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/containers/BackgroundSelector'>; -} -declare module '@storybook/addon-backgrounds/dist/containers/GridSelector.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/containers/GridSelector'>; -} -declare module '@storybook/addon-backgrounds/dist/decorators/index' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/decorators'>; -} -declare module '@storybook/addon-backgrounds/dist/decorators/index.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/decorators'>; -} -declare module '@storybook/addon-backgrounds/dist/decorators/withBackground.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/decorators/withBackground'>; -} -declare module '@storybook/addon-backgrounds/dist/decorators/withGrid.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/decorators/withGrid'>; -} -declare module '@storybook/addon-backgrounds/dist/helpers/index' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/helpers'>; -} -declare module '@storybook/addon-backgrounds/dist/helpers/index.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/helpers'>; -} -declare module '@storybook/addon-backgrounds/dist/index' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist'>; -} -declare module '@storybook/addon-backgrounds/dist/index.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist'>; -} -declare module '@storybook/addon-backgrounds/dist/preset/addDecorator.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/preset/addDecorator'>; -} -declare module '@storybook/addon-backgrounds/dist/preset/addParameter.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/preset/addParameter'>; -} -declare module '@storybook/addon-backgrounds/dist/preset/index' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/preset'>; -} -declare module '@storybook/addon-backgrounds/dist/preset/index.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/preset'>; -} -declare module '@storybook/addon-backgrounds/dist/register.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/register'>; -} -declare module '@storybook/addon-backgrounds/dist/types/index' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/types'>; -} -declare module '@storybook/addon-backgrounds/dist/types/index.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/types'>; -} -declare module '@storybook/addon-backgrounds/dist/typings.d.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/dist/typings.d'>; -} -declare module '@storybook/addon-backgrounds/preset.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/preset'>; -} -declare module '@storybook/addon-backgrounds/register.js' { - declare module.exports: $Exports<'@storybook/addon-backgrounds/register'>; -} diff --git a/flow-typed/npm/@storybook/addon-info_vx.x.x.js b/flow-typed/npm/@storybook/addon-info_vx.x.x.js deleted file mode 100644 index 14780c29af..0000000000 --- a/flow-typed/npm/@storybook/addon-info_vx.x.x.js +++ /dev/null @@ -1,265 +0,0 @@ -// flow-typed signature: 58fa3a9c415bf894453ba8ffcfa23fb2 -// flow-typed version: <>/@storybook/addon-info_v^6.0.0-alpha.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addon-info' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addon-info' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addon-info/dist/components/makeTableComponent' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/code' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/htags' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/pre/copy' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/pre/copyButton' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/pre/pre' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/markdown/text' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/Props' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Table' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Tbody' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Td' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Th' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Thead' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable/components/Tr' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropTable' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/PropVal' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/Story' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/ArrayOf' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/Enum' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/InstanceOf' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/Literal' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/ObjectOf' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/OneOf' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/OneOfType' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/PrettyPropType' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/PropertyLabel' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/proptypes' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/Shape' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/components/types/Signature' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist' { - declare module.exports: any; -} - -declare module '@storybook/addon-info/dist/react-utils' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addon-info/dist/components/makeTableComponent.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/makeTableComponent'>; -} -declare module '@storybook/addon-info/dist/components/markdown/code.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/code'>; -} -declare module '@storybook/addon-info/dist/components/markdown/htags.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/htags'>; -} -declare module '@storybook/addon-info/dist/components/markdown/index' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown'>; -} -declare module '@storybook/addon-info/dist/components/markdown/index.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown'>; -} -declare module '@storybook/addon-info/dist/components/markdown/pre/copy.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/pre/copy'>; -} -declare module '@storybook/addon-info/dist/components/markdown/pre/copyButton.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/pre/copyButton'>; -} -declare module '@storybook/addon-info/dist/components/markdown/pre/pre.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/pre/pre'>; -} -declare module '@storybook/addon-info/dist/components/markdown/text.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/markdown/text'>; -} -declare module '@storybook/addon-info/dist/components/Props.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/Props'>; -} -declare module '@storybook/addon-info/dist/components/PropTable.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Table.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Table'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Tbody.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Tbody'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Td.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Td'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Th.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Th'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Thead.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Thead'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/components/Tr.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable/components/Tr'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/index' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable'>; -} -declare module '@storybook/addon-info/dist/components/PropTable/index.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropTable'>; -} -declare module '@storybook/addon-info/dist/components/PropVal.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/PropVal'>; -} -declare module '@storybook/addon-info/dist/components/Story.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/Story'>; -} -declare module '@storybook/addon-info/dist/components/types/ArrayOf.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/ArrayOf'>; -} -declare module '@storybook/addon-info/dist/components/types/Enum.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/Enum'>; -} -declare module '@storybook/addon-info/dist/components/types/InstanceOf.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/InstanceOf'>; -} -declare module '@storybook/addon-info/dist/components/types/Literal.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/Literal'>; -} -declare module '@storybook/addon-info/dist/components/types/ObjectOf.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/ObjectOf'>; -} -declare module '@storybook/addon-info/dist/components/types/OneOf.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/OneOf'>; -} -declare module '@storybook/addon-info/dist/components/types/OneOfType.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/OneOfType'>; -} -declare module '@storybook/addon-info/dist/components/types/PrettyPropType.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/PrettyPropType'>; -} -declare module '@storybook/addon-info/dist/components/types/PropertyLabel.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/PropertyLabel'>; -} -declare module '@storybook/addon-info/dist/components/types/proptypes.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/proptypes'>; -} -declare module '@storybook/addon-info/dist/components/types/Shape.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/Shape'>; -} -declare module '@storybook/addon-info/dist/components/types/Signature.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/components/types/Signature'>; -} -declare module '@storybook/addon-info/dist/index' { - declare module.exports: $Exports<'@storybook/addon-info/dist'>; -} -declare module '@storybook/addon-info/dist/index.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist'>; -} -declare module '@storybook/addon-info/dist/react-utils.js' { - declare module.exports: $Exports<'@storybook/addon-info/dist/react-utils'>; -} diff --git a/flow-typed/npm/@storybook/addon-knobs_vx.x.x.js b/flow-typed/npm/@storybook/addon-knobs_vx.x.x.js deleted file mode 100644 index 70fc43aaac..0000000000 --- a/flow-typed/npm/@storybook/addon-knobs_vx.x.x.js +++ /dev/null @@ -1,258 +0,0 @@ -// flow-typed signature: b4aea83f99f96aeca362086e562f6f2f -// flow-typed version: <>/@storybook/addon-knobs_v^6.1.11/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addon-knobs' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addon-knobs' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addon-knobs/dist/__types__/knob-test-cases' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/Panel' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/PropForm' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Array' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Boolean' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Button' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Checkboxes' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Color' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Date' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Files' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Number' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Object' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Options' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Radio' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Select' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/Text' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/components/types/types' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/converters' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/KnobManager' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/KnobStore' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/preset/addDecorator' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/register' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/registerKnobs' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/shared' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/title' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/type-defs' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/dist/typings.d' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-knobs/register' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addon-knobs/dist/__types__/knob-test-cases.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/__types__/knob-test-cases'>; -} -declare module '@storybook/addon-knobs/dist/components/Panel.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/Panel'>; -} -declare module '@storybook/addon-knobs/dist/components/PropForm.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/PropForm'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Array.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Array'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Boolean.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Boolean'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Button.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Button'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Checkboxes.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Checkboxes'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Color.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Color'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Date.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Date'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Files.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Files'>; -} -declare module '@storybook/addon-knobs/dist/components/types/index' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types'>; -} -declare module '@storybook/addon-knobs/dist/components/types/index.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Number.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Number'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Object.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Object'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Options.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Options'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Radio.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Radio'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Select.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Select'>; -} -declare module '@storybook/addon-knobs/dist/components/types/Text.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/Text'>; -} -declare module '@storybook/addon-knobs/dist/components/types/types.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/components/types/types'>; -} -declare module '@storybook/addon-knobs/dist/converters.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/converters'>; -} -declare module '@storybook/addon-knobs/dist/index' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist'>; -} -declare module '@storybook/addon-knobs/dist/index.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist'>; -} -declare module '@storybook/addon-knobs/dist/KnobManager.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/KnobManager'>; -} -declare module '@storybook/addon-knobs/dist/KnobStore.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/KnobStore'>; -} -declare module '@storybook/addon-knobs/dist/preset/addDecorator.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/preset/addDecorator'>; -} -declare module '@storybook/addon-knobs/dist/preset/index' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/preset'>; -} -declare module '@storybook/addon-knobs/dist/preset/index.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/preset'>; -} -declare module '@storybook/addon-knobs/dist/register.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/register'>; -} -declare module '@storybook/addon-knobs/dist/registerKnobs.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/registerKnobs'>; -} -declare module '@storybook/addon-knobs/dist/shared.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/shared'>; -} -declare module '@storybook/addon-knobs/dist/title.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/title'>; -} -declare module '@storybook/addon-knobs/dist/type-defs.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/type-defs'>; -} -declare module '@storybook/addon-knobs/dist/typings.d.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/dist/typings.d'>; -} -declare module '@storybook/addon-knobs/preset.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/preset'>; -} -declare module '@storybook/addon-knobs/register.js' { - declare module.exports: $Exports<'@storybook/addon-knobs/register'>; -} diff --git a/flow-typed/npm/@storybook/addon-viewport_vx.x.x.js b/flow-typed/npm/@storybook/addon-viewport_vx.x.x.js deleted file mode 100644 index 7abbeceee1..0000000000 --- a/flow-typed/npm/@storybook/addon-viewport_vx.x.x.js +++ /dev/null @@ -1,108 +0,0 @@ -// flow-typed signature: 0723fc35848dd3f84dfc7db6d2ce1db5 -// flow-typed version: <>/@storybook/addon-viewport_v^6.0.28/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addon-viewport' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addon-viewport' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addon-viewport/dist/constants' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/defaults' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/models' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/models/Viewport' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/models/ViewportAddonParameter' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/preview' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/register' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/dist/Tool' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/preset' { - declare module.exports: any; -} - -declare module '@storybook/addon-viewport/register' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addon-viewport/dist/constants.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/constants'>; -} -declare module '@storybook/addon-viewport/dist/defaults.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/defaults'>; -} -declare module '@storybook/addon-viewport/dist/models/index' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/models'>; -} -declare module '@storybook/addon-viewport/dist/models/index.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/models'>; -} -declare module '@storybook/addon-viewport/dist/models/Viewport.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/models/Viewport'>; -} -declare module '@storybook/addon-viewport/dist/models/ViewportAddonParameter.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/models/ViewportAddonParameter'>; -} -declare module '@storybook/addon-viewport/dist/preset/index' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/preset'>; -} -declare module '@storybook/addon-viewport/dist/preset/index.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/preset'>; -} -declare module '@storybook/addon-viewport/dist/preview.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/preview'>; -} -declare module '@storybook/addon-viewport/dist/register.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/register'>; -} -declare module '@storybook/addon-viewport/dist/Tool.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/dist/Tool'>; -} -declare module '@storybook/addon-viewport/preset.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/preset'>; -} -declare module '@storybook/addon-viewport/register.js' { - declare module.exports: $Exports<'@storybook/addon-viewport/register'>; -} diff --git a/flow-typed/npm/@storybook/addons_vx.x.x.js b/flow-typed/npm/@storybook/addons_vx.x.x.js deleted file mode 100644 index d800978257..0000000000 --- a/flow-typed/npm/@storybook/addons_vx.x.x.js +++ /dev/null @@ -1,77 +0,0 @@ -// flow-typed signature: 619063b87c064cd1cec76721e1978c44 -// flow-typed version: <>/@storybook/addons_v^6.0.28/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/addons' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/addons' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/addons/dist/hooks' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist/make-decorator' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist/public_api' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist/storybook-channel-mock' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist/types' { - declare module.exports: any; -} - -declare module '@storybook/addons/dist/typings.d' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/addons/dist/hooks.js' { - declare module.exports: $Exports<'@storybook/addons/dist/hooks'>; -} -declare module '@storybook/addons/dist/index' { - declare module.exports: $Exports<'@storybook/addons/dist'>; -} -declare module '@storybook/addons/dist/index.js' { - declare module.exports: $Exports<'@storybook/addons/dist'>; -} -declare module '@storybook/addons/dist/make-decorator.js' { - declare module.exports: $Exports<'@storybook/addons/dist/make-decorator'>; -} -declare module '@storybook/addons/dist/public_api.js' { - declare module.exports: $Exports<'@storybook/addons/dist/public_api'>; -} -declare module '@storybook/addons/dist/storybook-channel-mock.js' { - declare module.exports: $Exports<'@storybook/addons/dist/storybook-channel-mock'>; -} -declare module '@storybook/addons/dist/types.js' { - declare module.exports: $Exports<'@storybook/addons/dist/types'>; -} -declare module '@storybook/addons/dist/typings.d.js' { - declare module.exports: $Exports<'@storybook/addons/dist/typings.d'>; -} diff --git a/flow-typed/npm/@storybook/react_v6.x.x.js b/flow-typed/npm/@storybook/react_v6.x.x.js deleted file mode 100644 index 15b05e31e6..0000000000 --- a/flow-typed/npm/@storybook/react_v6.x.x.js +++ /dev/null @@ -1,67 +0,0 @@ -// flow-typed signature: ffbe262652c2690829aaf72cb827a910 -// flow-typed version: 9d326d4ede/@storybook/react_v6.x.x/flow_>=v0.142.x - -type NodeModule = typeof module; - -declare module '@storybook/react' { - declare type Context = {| - +argTypes: { [key: string]: any, ... }, - +args: { [key: string]: any, ... }, - +globals: { [key: string]: any, ... }, - +hooks: { [key: string]: any, ... }, - +id: string, - +kind: string, - +name: string, - +parameters: { [key: string]: any, ... }, - +story: string, - |}; - declare type Renderable = - | string - | number - | React$Element - | Iterable; - declare type RenderCallback = ( - context: Context - ) => Renderable; - declare type RenderFunction = () => Renderable; - - declare type StoryDecorator = ( - story: RenderFunction, - context: Context - ) => Renderable; - - declare type DecoratorParameters = { [key: string]: any, ... }; - - declare interface Story { - +kind: string; - add( - storyName: string, - callback: RenderCallback, - parameters?: DecoratorParameters - ): Story; - addDecorator(decorator: StoryDecorator): Story; - addParameters(parameters: DecoratorParameters): Story; - } - - declare interface StoryObject { - name: string; - render: RenderFunction; - } - - declare interface StoryBucket { - kind: string; - filename: string; - stories: Array; - } - - declare function addDecorator(decorator: StoryDecorator): void; - declare function addParameters(parameters: DecoratorParameters): void; - declare function clearDecorators(): void; - declare function configure(fn: () => void, module: NodeModule): void; - declare function setAddon(addon: { [key: string]: any, ... }): void; - declare function storiesOf(name: string, module: NodeModule): Story; - declare function storiesOf(name: string, module: NodeModule): Story & T; - declare function forceReRender(): void; - - declare function getStorybook(): Array; -} diff --git a/flow-typed/npm/@storybook/storybook-deployer_vx.x.x.js b/flow-typed/npm/@storybook/storybook-deployer_vx.x.x.js deleted file mode 100644 index 4b7575c343..0000000000 --- a/flow-typed/npm/@storybook/storybook-deployer_vx.x.x.js +++ /dev/null @@ -1,53 +0,0 @@ -// flow-typed signature: 60aecd27d67353787ce998838efc4a7c -// flow-typed version: <>/@storybook/storybook-deployer_v^2.8.7/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/storybook-deployer' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/storybook-deployer' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/storybook-deployer/src/build-monorepo-index' { - declare module.exports: any; -} - -declare module '@storybook/storybook-deployer/src/build' { - declare module.exports: any; -} - -declare module '@storybook/storybook-deployer/src/parse-args' { - declare module.exports: any; -} - -declare module '@storybook/storybook-deployer/src/utils' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/storybook-deployer/src/build-monorepo-index.js' { - declare module.exports: $Exports<'@storybook/storybook-deployer/src/build-monorepo-index'>; -} -declare module '@storybook/storybook-deployer/src/build.js' { - declare module.exports: $Exports<'@storybook/storybook-deployer/src/build'>; -} -declare module '@storybook/storybook-deployer/src/parse-args.js' { - declare module.exports: $Exports<'@storybook/storybook-deployer/src/parse-args'>; -} -declare module '@storybook/storybook-deployer/src/utils.js' { - declare module.exports: $Exports<'@storybook/storybook-deployer/src/utils'>; -} diff --git a/flow-typed/npm/@storybook/theming_vx.x.x.js b/flow-typed/npm/@storybook/theming_vx.x.x.js deleted file mode 100644 index 4481156597..0000000000 --- a/flow-typed/npm/@storybook/theming_vx.x.x.js +++ /dev/null @@ -1,133 +0,0 @@ -// flow-typed signature: 64d76a754e16d0dfddcc676793a43453 -// flow-typed version: <>/@storybook/theming_v^6.1.17/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@storybook/theming' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@storybook/theming' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@storybook/theming/create' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/animation' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/base' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/convert' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/create' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/ensure' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/global' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/modules/syntax' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/themes/dark' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/themes/light' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/types' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/typings.d' { - declare module.exports: any; -} - -declare module '@storybook/theming/dist/utils' { - declare module.exports: any; -} - -declare module '@storybook/theming/paths' { - declare module.exports: any; -} - -// Filename aliases -declare module '@storybook/theming/create.js' { - declare module.exports: $Exports<'@storybook/theming/create'>; -} -declare module '@storybook/theming/dist/animation.js' { - declare module.exports: $Exports<'@storybook/theming/dist/animation'>; -} -declare module '@storybook/theming/dist/base.js' { - declare module.exports: $Exports<'@storybook/theming/dist/base'>; -} -declare module '@storybook/theming/dist/convert.js' { - declare module.exports: $Exports<'@storybook/theming/dist/convert'>; -} -declare module '@storybook/theming/dist/create.js' { - declare module.exports: $Exports<'@storybook/theming/dist/create'>; -} -declare module '@storybook/theming/dist/ensure.js' { - declare module.exports: $Exports<'@storybook/theming/dist/ensure'>; -} -declare module '@storybook/theming/dist/global.js' { - declare module.exports: $Exports<'@storybook/theming/dist/global'>; -} -declare module '@storybook/theming/dist/index' { - declare module.exports: $Exports<'@storybook/theming/dist'>; -} -declare module '@storybook/theming/dist/index.js' { - declare module.exports: $Exports<'@storybook/theming/dist'>; -} -declare module '@storybook/theming/dist/modules/syntax.js' { - declare module.exports: $Exports<'@storybook/theming/dist/modules/syntax'>; -} -declare module '@storybook/theming/dist/themes/dark.js' { - declare module.exports: $Exports<'@storybook/theming/dist/themes/dark'>; -} -declare module '@storybook/theming/dist/themes/light.js' { - declare module.exports: $Exports<'@storybook/theming/dist/themes/light'>; -} -declare module '@storybook/theming/dist/types.js' { - declare module.exports: $Exports<'@storybook/theming/dist/types'>; -} -declare module '@storybook/theming/dist/typings.d.js' { - declare module.exports: $Exports<'@storybook/theming/dist/typings.d'>; -} -declare module '@storybook/theming/dist/utils.js' { - declare module.exports: $Exports<'@storybook/theming/dist/utils'>; -} -declare module '@storybook/theming/paths.js' { - declare module.exports: $Exports<'@storybook/theming/paths'>; -} diff --git a/flow-typed/npm/@svgr/core_vx.x.x.js b/flow-typed/npm/@svgr/core_vx.x.x.js deleted file mode 100644 index 860f0e7961..0000000000 --- a/flow-typed/npm/@svgr/core_vx.x.x.js +++ /dev/null @@ -1,63 +0,0 @@ -// flow-typed signature: 3ea72d6750127bd58f2acf2caa5c43b9 -// flow-typed version: <>/@svgr/core_v^5.5.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@svgr/core' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@svgr/core' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@svgr/core/lib/config' { - declare module.exports: any; -} - -declare module '@svgr/core/lib/convert' { - declare module.exports: any; -} - -declare module '@svgr/core/lib' { - declare module.exports: any; -} - -declare module '@svgr/core/lib/plugins' { - declare module.exports: any; -} - -declare module '@svgr/core/lib/state' { - declare module.exports: any; -} - -// Filename aliases -declare module '@svgr/core/lib/config.js' { - declare module.exports: $Exports<'@svgr/core/lib/config'>; -} -declare module '@svgr/core/lib/convert.js' { - declare module.exports: $Exports<'@svgr/core/lib/convert'>; -} -declare module '@svgr/core/lib/index' { - declare module.exports: $Exports<'@svgr/core/lib'>; -} -declare module '@svgr/core/lib/index.js' { - declare module.exports: $Exports<'@svgr/core/lib'>; -} -declare module '@svgr/core/lib/plugins.js' { - declare module.exports: $Exports<'@svgr/core/lib/plugins'>; -} -declare module '@svgr/core/lib/state.js' { - declare module.exports: $Exports<'@svgr/core/lib/state'>; -} diff --git a/flow-typed/npm/@svgr/plugin-jsx_vx.x.x.js b/flow-typed/npm/@svgr/plugin-jsx_vx.x.x.js deleted file mode 100644 index 4cda1e4aa7..0000000000 --- a/flow-typed/npm/@svgr/plugin-jsx_vx.x.x.js +++ /dev/null @@ -1,35 +0,0 @@ -// flow-typed signature: f5290d703aa1136b531f0ec1b3f81f06 -// flow-typed version: <>/@svgr/plugin-jsx_v^5.5.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@svgr/plugin-jsx' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@svgr/plugin-jsx' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@svgr/plugin-jsx/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@svgr/plugin-jsx/lib/index' { - declare module.exports: $Exports<'@svgr/plugin-jsx/lib'>; -} -declare module '@svgr/plugin-jsx/lib/index.js' { - declare module.exports: $Exports<'@svgr/plugin-jsx/lib'>; -} diff --git a/flow-typed/npm/@svgr/plugin-prettier_vx.x.x.js b/flow-typed/npm/@svgr/plugin-prettier_vx.x.x.js deleted file mode 100644 index 2f3be910ec..0000000000 --- a/flow-typed/npm/@svgr/plugin-prettier_vx.x.x.js +++ /dev/null @@ -1,35 +0,0 @@ -// flow-typed signature: fc04c19a33a2d56bb5de67e2faf39daa -// flow-typed version: <>/@svgr/plugin-prettier_v^5.5.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@svgr/plugin-prettier' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@svgr/plugin-prettier' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@svgr/plugin-prettier/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@svgr/plugin-prettier/lib/index' { - declare module.exports: $Exports<'@svgr/plugin-prettier/lib'>; -} -declare module '@svgr/plugin-prettier/lib/index.js' { - declare module.exports: $Exports<'@svgr/plugin-prettier/lib'>; -} diff --git a/flow-typed/npm/@svgr/plugin-svgo_vx.x.x.js b/flow-typed/npm/@svgr/plugin-svgo_vx.x.x.js deleted file mode 100644 index 49f709ed4f..0000000000 --- a/flow-typed/npm/@svgr/plugin-svgo_vx.x.x.js +++ /dev/null @@ -1,42 +0,0 @@ -// flow-typed signature: d612ed3f2d40c7358ccb073335ec32fc -// flow-typed version: <>/@svgr/plugin-svgo_v^5.5.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@svgr/plugin-svgo' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@svgr/plugin-svgo' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@svgr/plugin-svgo/lib/config' { - declare module.exports: any; -} - -declare module '@svgr/plugin-svgo/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module '@svgr/plugin-svgo/lib/config.js' { - declare module.exports: $Exports<'@svgr/plugin-svgo/lib/config'>; -} -declare module '@svgr/plugin-svgo/lib/index' { - declare module.exports: $Exports<'@svgr/plugin-svgo/lib'>; -} -declare module '@svgr/plugin-svgo/lib/index.js' { - declare module.exports: $Exports<'@svgr/plugin-svgo/lib'>; -} diff --git a/flow-typed/npm/@testing-library/jest-dom_v5.5.x.js b/flow-typed/npm/@testing-library/jest-dom_v5.5.x.js deleted file mode 100644 index 5b389f866a..0000000000 --- a/flow-typed/npm/@testing-library/jest-dom_v5.5.x.js +++ /dev/null @@ -1,46 +0,0 @@ -// flow-typed signature: 0c9447942a6ffdb5f79f218bfe8e58d9 -// flow-typed version: fe9fda6713/@testing-library/jest-dom_v5.5.x/flow_>=v0.104.x - -declare module '@testing-library/jest-dom' { - declare type JestMatcherResult = { - message?: string | (() => string), - pass: boolean, - ... - }; - - declare type Result = JestMatcherResult | Promise; - - declare module.exports: {| - /** - * @deprecated - */ - toBeInTheDOM(container?: HTMLElement): Result, - - toBeInTheDocument(): Result, - toBeVisible(): Result, - toBeEmpty(): Result, - toBeDisabled(): Result, - toBeEnabled(): Result, - toBeInvalid(): Result, - toBeRequired(): Result, - toBeValid(): Result, - toContainElement(element: HTMLElement | null): Result, - toContainHTML(htmlText: string): Result, - toHaveAttribute(attr: string, value?: any): Result, - toHaveClass(...classNames: string[]): Result, - toHaveFocus(): Result, - toHaveFormValues(expectedValues: { [name: string]: any, ... }): Result, - toHaveStyle(css: string | { [name: string]: any, ... }): Result, - toHaveTextContent( - text: string | RegExp, - options?: {| normalizeWhitespace: boolean |} - ): Result, - toHaveValue(value?: string | string[] | number): Result, - toHaveDisplayValue(value: string | string[]): Result, - toBeChecked(): Result, - |}; -} - -declare module '@testing-library/jest-dom/extend-expect' { - declare module.exports: any; -} diff --git a/flow-typed/npm/@testing-library/react-hooks_vx.x.x.js b/flow-typed/npm/@testing-library/react-hooks_vx.x.x.js deleted file mode 100644 index e0ef53f911..0000000000 --- a/flow-typed/npm/@testing-library/react-hooks_vx.x.x.js +++ /dev/null @@ -1,237 +0,0 @@ -// flow-typed signature: 88a5ac8fa6857df4d7df4877764fd20b -// flow-typed version: <>/@testing-library/react-hooks_v^5.0.3/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@testing-library/react-hooks' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@testing-library/react-hooks' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@testing-library/react-hooks/disable-error-filtering' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/dom' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/dom/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/dont-cleanup-after-each' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/core/asyncUtils' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/core/cleanup' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/core/console' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/core' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/dom' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/dom/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/helpers/createTestHarness' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/helpers/error' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/helpers/promises' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/native' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/native/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/server' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/server/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/types' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/lib/types/react' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/native' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/native/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/pure' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/server' { - declare module.exports: any; -} - -declare module '@testing-library/react-hooks/server/pure' { - declare module.exports: any; -} - -// Filename aliases -declare module '@testing-library/react-hooks/disable-error-filtering.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/disable-error-filtering'>; -} -declare module '@testing-library/react-hooks/dom/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/dom'>; -} -declare module '@testing-library/react-hooks/dom/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/dom'>; -} -declare module '@testing-library/react-hooks/dom/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/dom/pure'>; -} -declare module '@testing-library/react-hooks/dont-cleanup-after-each.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/dont-cleanup-after-each'>; -} -declare module '@testing-library/react-hooks/lib/core/asyncUtils.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/core/asyncUtils'>; -} -declare module '@testing-library/react-hooks/lib/core/cleanup.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/core/cleanup'>; -} -declare module '@testing-library/react-hooks/lib/core/console.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/core/console'>; -} -declare module '@testing-library/react-hooks/lib/core/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/core'>; -} -declare module '@testing-library/react-hooks/lib/core/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/core'>; -} -declare module '@testing-library/react-hooks/lib/dom/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/dom'>; -} -declare module '@testing-library/react-hooks/lib/dom/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/dom'>; -} -declare module '@testing-library/react-hooks/lib/dom/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/dom/pure'>; -} -declare module '@testing-library/react-hooks/lib/helpers/createTestHarness.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/helpers/createTestHarness'>; -} -declare module '@testing-library/react-hooks/lib/helpers/error.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/helpers/error'>; -} -declare module '@testing-library/react-hooks/lib/helpers/promises.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/helpers/promises'>; -} -declare module '@testing-library/react-hooks/lib/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib'>; -} -declare module '@testing-library/react-hooks/lib/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib'>; -} -declare module '@testing-library/react-hooks/lib/native/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/native'>; -} -declare module '@testing-library/react-hooks/lib/native/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/native'>; -} -declare module '@testing-library/react-hooks/lib/native/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/native/pure'>; -} -declare module '@testing-library/react-hooks/lib/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/pure'>; -} -declare module '@testing-library/react-hooks/lib/server/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/server'>; -} -declare module '@testing-library/react-hooks/lib/server/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/server'>; -} -declare module '@testing-library/react-hooks/lib/server/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/server/pure'>; -} -declare module '@testing-library/react-hooks/lib/types/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/types'>; -} -declare module '@testing-library/react-hooks/lib/types/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/types'>; -} -declare module '@testing-library/react-hooks/lib/types/react.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/lib/types/react'>; -} -declare module '@testing-library/react-hooks/native/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/native'>; -} -declare module '@testing-library/react-hooks/native/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/native'>; -} -declare module '@testing-library/react-hooks/native/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/native/pure'>; -} -declare module '@testing-library/react-hooks/pure/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/pure'>; -} -declare module '@testing-library/react-hooks/pure/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/pure'>; -} -declare module '@testing-library/react-hooks/server/index' { - declare module.exports: $Exports<'@testing-library/react-hooks/server'>; -} -declare module '@testing-library/react-hooks/server/index.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/server'>; -} -declare module '@testing-library/react-hooks/server/pure.js' { - declare module.exports: $Exports<'@testing-library/react-hooks/server/pure'>; -} diff --git a/flow-typed/npm/@testing-library/react_v11.x.x.js b/flow-typed/npm/@testing-library/react_v11.x.x.js deleted file mode 100644 index c6506ae868..0000000000 --- a/flow-typed/npm/@testing-library/react_v11.x.x.js +++ /dev/null @@ -1,670 +0,0 @@ -// flow-typed signature: 6f8a40accb2445e1ba35aa962ded3dfe -// flow-typed version: 12efeb009c/@testing-library/react_v11.x.x/flow_>=v0.104.x - -/** - * A local copy from: - * https://github.com/A11yance/aria-query/blob/2e6a3011a0d8987655f3a14853934fe3df38a8d8/flow/aria.js - */ -declare module '@@aria-query' { - declare export type ARIAAbstractRole = - | 'command' - | 'composite' - | 'input' - | 'landmark' - | 'range' - | 'roletype' - | 'section' - | 'sectionhead' - | 'select' - | 'structure' - | 'widget' - | 'window'; - - declare export type ARIAWidgetRole = - | 'button' - | 'checkbox' - | 'gridcell' - | 'link' - | 'menuitem' - | 'menuitemcheckbox' - | 'menuitemradio' - | 'option' - | 'progressbar' - | 'radio' - | 'scrollbar' - | 'searchbox' - | 'slider' - | 'spinbutton' - | 'switch' - | 'tab' - | 'tabpanel' - | 'textbox' - | 'treeitem'; - - declare export type ARIACompositeWidgetRole = - | 'combobox' - | 'grid' - | 'listbox' - | 'menu' - | 'menubar' - | 'radiogroup' - | 'tablist' - | 'tree' - | 'treegrid'; - - declare export type ARIADocumentStructureRole = - | 'application' - | 'article' - | 'blockquote' - | 'caption' - | 'cell' - | 'columnheader' - | 'definition' - | 'deletion' - | 'directory' - | 'document' - | 'emphasis' - | 'feed' - | 'figure' - | 'generic' - | 'group' - | 'heading' - | 'img' - | 'insertion' - | 'list' - | 'listitem' - | 'math' - | 'meter' - | 'none' - | 'note' - | 'paragraph' - | 'presentation' - | 'row' - | 'rowgroup' - | 'rowheader' - | 'separator' - | 'strong' - | 'subscript' - | 'superscript' - | 'table' - | 'term' - | 'time' - | 'toolbar' - | 'tooltip'; - - declare export type ARIALandmarkRole = - | 'banner' - | 'complementary' - | 'contentinfo' - | 'form' - | 'main' - | 'navigation' - | 'region' - | 'search'; - - declare export type ARIALiveRegionRole = - | 'alert' - | 'log' - | 'marquee' - | 'status' - | 'timer'; - - declare export type ARIAWindowRole = 'alertdialog' | 'dialog'; - - declare export type ARIAUncategorizedRole = 'code'; - - declare export type ARIADPubRole = - | 'doc-abstract' - | 'doc-acknowledgments' - | 'doc-afterword' - | 'doc-appendix' - | 'doc-backlink' - | 'doc-biblioentry' - | 'doc-bibliography' - | 'doc-biblioref' - | 'doc-chapter' - | 'doc-colophon' - | 'doc-conclusion' - | 'doc-cover' - | 'doc-credit' - | 'doc-credits' - | 'doc-dedication' - | 'doc-endnote' - | 'doc-endnotes' - | 'doc-epigraph' - | 'doc-epilogue' - | 'doc-errata' - | 'doc-example' - | 'doc-footnote' - | 'doc-foreword' - | 'doc-glossary' - | 'doc-glossref' - | 'doc-index' - | 'doc-introduction' - | 'doc-noteref' - | 'doc-notice' - | 'doc-pagebreak' - | 'doc-pagelist' - | 'doc-part' - | 'doc-preface' - | 'doc-prologue' - | 'doc-pullquote' - | 'doc-qna' - | 'doc-subtitle' - | 'doc-tip' - | 'doc-toc'; - - declare export type ARIARole = - | ARIAWidgetRole - | ARIACompositeWidgetRole - | ARIADocumentStructureRole - | ARIALandmarkRole - | ARIALiveRegionRole - | ARIAWindowRole - | ARIAUncategorizedRole; -} - -declare module '@testing-library/react' { - import type { ARIARole } from '@@aria-query'; - - // This type comes from - // https://github.com/facebook/flow/blob/v0.104.0/lib/react-dom.js#L64 - declare type ReactDOMTestUtilsThenable = { - then(resolve: () => mixed, reject?: () => mixed): mixed, - ... - }; - // This type comes from - // https://github.com/facebook/flow/blob/v0.104.0/lib/react-dom.js#L116 - declare type ReactDOMTestUtilsAct = ( - callback: () => void | ReactDOMTestUtilsThenable - ) => ReactDOMTestUtilsThenable; - - declare type WaitForOptions = {| - container?: HTMLElement, - timeout?: number, - interval?: number, - onTimeout?: (error: Error) => Error, - mutationObserverOptions?: MutationObserverInit, - |}; - - declare type MatcherFunction = ( - content: string, - element: ?Element - ) => boolean; - - declare type Matcher = MatcherFunction | RegExp | string | number; - - declare type ByRoleMatcher = ARIARole | MatcherFunction; - - declare type NormalizerFn = (text: string) => string; - - declare type MatcherOptions = {| - exact?: boolean, - /** Use normalizer with getDefaultNormalizer instead */ - trim?: boolean, - /** Use normalizer with getDefaultNormalizer instead */ - collapseWhitespace?: boolean, - normalizer?: NormalizerFn, - /** suppress suggestions for a specific query */ - suggest?: boolean, - |}; - - declare type ByRoleOptions = {| - ...MatcherOptions, - /** - * If true includes elements in the query set that are usually excluded from - * the accessibility tree. `role="none"` or `role="presentation"` are included - * in either case. - */ - hidden?: boolean, - /** - * If true only includes elements in the query set that are marked as - * selected in the accessibility tree, i.e., `aria-selected="true"` - */ - selected?: boolean, - /** - * If true only includes elements in the query set that are marked as - * checked in the accessibility tree, i.e., `aria-checked="true"` - */ - checked?: boolean, - /** - * If true only includes elements in the query set that are marked as - * pressed in the accessibility tree, i.e., `aria-pressed="true"` - */ - pressed?: boolean, - /** - * If true only includes elements in the query set that are marked as - * expanded in the accessibility tree, i.e., `aria-expanded="true"` - */ - expanded?: boolean, - /** - * Includes elements with the `"heading"` role matching the indicated level, - * either by the semantic HTML heading elements `

-

` or matching - * the `aria-level` attribute. - */ - level?: number, - /** - * Includes every role used in the `role` attribute - * For example *ByRole('progressbar', {queryFallbacks: true})` will find
`. - */ - queryFallbacks?: boolean, - /** - * Only considers elements with the specified accessible name. - */ - name?: - | string - | RegExp - | ((accessibleName: string, element: Element) => boolean), - |}; - - declare type SelectorMatcherOptions = {| - ...MatcherOptions, - selector?: string, - |}; - - declare type QueryByBoundAttribute = ( - text: Matcher, - options?: MatcherOptions - ) => ?HTMLElement; - - declare type AllByBoundAttribute = ( - text: Matcher, - options?: MatcherOptions - ) => Array; - - declare type FindAllByBoundAttribute = ( - text: Matcher, - options?: MatcherOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type GetByBoundAttribute = ( - text: Matcher, - options?: MatcherOptions - ) => HTMLElement; - - declare type FindByBoundAttribute = ( - text: Matcher, - options?: MatcherOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type QueryByText = ( - text: Matcher, - options?: SelectorMatcherOptions - ) => ?HTMLElement; - - declare type AllByText = ( - text: Matcher, - options?: SelectorMatcherOptions - ) => Array; - - declare type FindAllByText = ( - text: Matcher, - options?: SelectorMatcherOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type GetByText = ( - text: Matcher, - options?: SelectorMatcherOptions - ) => HTMLElement; - - declare type FindByText = ( - text: Matcher, - options?: SelectorMatcherOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type AllByRole = ( - role: ByRoleMatcher, - options?: ByRoleOptions - ) => HTMLElement[]; - - declare type GetByRole = ( - role: ByRoleMatcher, - options?: ByRoleOptions - ) => HTMLElement; - - declare type QueryByRole = ( - role: ByRoleMatcher, - options?: ByRoleOptions - ) => HTMLElement | null; - - declare type FindByRole = ( - role: ByRoleMatcher, - options?: ByRoleOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type FindAllByRole = ( - role: ByRoleMatcher, - options?: ByRoleOptions, - waitForElementOptions?: WaitForOptions - ) => Promise; - - declare type GetsAndQueries = {| - getByLabelText: GetByText, - getAllByLabelText: AllByText, - queryByLabelText: QueryByText, - queryAllByLabelText: AllByText, - findByLabelText: FindByText, - findAllByLabelText: FindAllByText, - - getByPlaceholderText: GetByBoundAttribute, - getAllByPlaceholderText: AllByBoundAttribute, - queryByPlaceholderText: QueryByBoundAttribute, - queryAllByPlaceholderText: AllByBoundAttribute, - findByPlaceholderText: FindByBoundAttribute, - findAllByPlaceholderText: FindAllByBoundAttribute, - - getByText: GetByText, - getAllByText: AllByText, - queryByText: QueryByText, - queryAllByText: AllByText, - findByText: FindByText, - findAllByText: FindAllByText, - - getByAltText: GetByBoundAttribute, - getAllByAltText: AllByBoundAttribute, - queryByAltText: QueryByBoundAttribute, - queryAllByAltText: AllByBoundAttribute, - findByAltText: FindByBoundAttribute, - findAllByAltText: FindAllByBoundAttribute, - - getByTitle: GetByBoundAttribute, - getAllByTitle: AllByBoundAttribute, - queryByTitle: QueryByBoundAttribute, - queryAllByTitle: AllByBoundAttribute, - findByTitle: FindByBoundAttribute, - findAllByTitle: FindAllByBoundAttribute, - - getByDisplayValue: GetByBoundAttribute, - getAllByDisplayValue: AllByBoundAttribute, - queryByDisplayValue: QueryByBoundAttribute, - queryAllByDisplayValue: AllByBoundAttribute, - findByDisplayValue: FindByBoundAttribute, - findAllByDisplayValue: FindAllByBoundAttribute, - - getByRole: GetByRole, - getAllByRole: AllByRole, - queryByRole: QueryByRole, - queryAllByRole: AllByRole, - findByRole: FindByRole, - findAllByRole: FindAllByRole, - - getByTestId: GetByBoundAttribute, - getAllByTestId: AllByBoundAttribute, - queryByTestId: QueryByBoundAttribute, - queryAllByTestId: AllByBoundAttribute, - findByTestId: FindByBoundAttribute, - findAllByTestId: FindAllByBoundAttribute, - |}; - - declare type FireEvent = ( - element: HTMLElement, - eventProperties?: TInit - ) => boolean; - - declare type Screen = { - ...Queries, - /** - * Convenience function for `pretty-dom` which also allows an array - * of elements - */ - debug: ( - baseElement?: - | HTMLElement - | DocumentFragment - | Array, - maxLength?: number, - options?: { ... } // @TODO pretty format OptionsReceived - ) => void, - /** - * Convenience function for `Testing Playground` which logs URL that - * can be opened in a browser - */ - logTestingPlaygroundURL: (element?: Element | Document) => void, - ... - }; - - declare type RenderResult = { - ...Queries, - container: HTMLElement, - unmount: () => boolean, - baseElement: HTMLElement, - asFragment: () => DocumentFragment, - debug: ( - baseElement?: - | HTMLElement - | DocumentFragment - | Array, - maxLength?: number - ) => void, - rerender: (ui: React$Element<*>) => void, - ... - }; - - declare export type RenderOptionsWithoutCustomQueries = {| - container?: HTMLElement, - baseElement?: HTMLElement, - hydrate?: boolean, - wrapper?: React$ComponentType, - |}; - - declare export type RenderOptionsWithCustomQueries< - CustomQueries: { ... } - > = {| - queries: CustomQueries, - container?: HTMLElement, - baseElement?: HTMLElement, - hydrate?: boolean, - wrapper?: React$ComponentType, - |}; - - declare export function render( - ui: React$Element, - options?: RenderOptionsWithoutCustomQueries - ): RenderResult<>; - declare export function render< - CustomQueries: { [string]: (...args: Array) => any, ... } - >( - ui: React$Element, - options: RenderOptionsWithCustomQueries - ): RenderResult; - - declare export var act: ReactDOMTestUtilsAct; - declare export function cleanup(): void; - - declare export function waitFor( - callback: () => T | Promise, - options?: {| - container?: HTMLElement, - timeout?: number, - interval?: number, - mutationObserverOptions?: MutationObserverInit, - |} - ): Promise; - - declare export function waitForElementToBeRemoved( - callback: (() => T) | T, - options?: {| - container?: HTMLElement, - timeout?: number, - interval?: number, - mutationObserverOptions?: MutationObserverInit, - |} - ): Promise; - - /** - * @deprecated `wait` has been deprecated and replaced by `waitFor` instead. - * In most cases you should be able to find/replace `wait` with `waitFor`. - * Learn more: https://testing-library.com/docs/dom-testing-library/api-async#waitfor. - */ - declare export function wait( - callback?: () => void, - options?: { - timeout?: number, - interval?: number, - ... - } - ): Promise; - - /** - * @deprecated `waitForDomChange` has been deprecated. - * Use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor. - */ - declare export function waitForDomChange(options?: { - container?: HTMLElement, - timeout?: number, - mutationObserverOptions?: MutationObserverInit, - ... - }): Promise; - - /** - * @deprecated `waitForElement` has been deprecated. - * Use a `find*` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) - * or use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor - */ - declare export function waitForElement( - callback?: () => T, - options?: { - container?: HTMLElement, - timeout?: number, - mutationObserverOptions?: MutationObserverInit, - ... - } - ): Promise; - - declare export function within( - element: HTMLElement, - queriesToBind?: GetsAndQueries | Array - ): GetsAndQueries; - - declare export var fireEvent: {| - (element: HTMLElement, event: Event): void, - - copy: FireEvent, - cut: FireEvent, - paste: FireEvent, - compositionEnd: FireEvent, - compositionStart: FireEvent, - compositionUpdate: FireEvent, - keyDown: FireEvent, - keyPress: FireEvent, - keyUp: FireEvent, - focus: FireEvent, - blur: FireEvent, - change: FireEvent, - input: FireEvent, - invalid: FireEvent, - submit: FireEvent, - click: FireEvent, - contextMenu: FireEvent, - dblClick: FireEvent, - doubleClick: FireEvent, - drag: FireEvent, - dragEnd: FireEvent, - dragEnter: FireEvent, - dragExit: FireEvent, - dragLeave: FireEvent, - dragOver: FireEvent, - dragStart: FireEvent, - drop: FireEvent, - mouseDown: FireEvent, - mouseEnter: FireEvent, - mouseLeave: FireEvent, - mouseMove: FireEvent, - mouseOut: FireEvent, - mouseOver: FireEvent, - mouseUp: FireEvent, - select: FireEvent, - touchCancel: FireEvent, - touchEnd: FireEvent, - touchMove: FireEvent, - touchStart: FireEvent, - scroll: FireEvent, - wheel: FireEvent, - abort: FireEvent, - canPlay: FireEvent, - canPlayThrough: FireEvent, - durationChange: FireEvent, - emptied: FireEvent, - encrypted: FireEvent, - ended: FireEvent, - loadedData: FireEvent, - loadedMetadata: FireEvent, - loadStart: FireEvent, - pause: FireEvent, - play: FireEvent, - playing: FireEvent, - progress: FireEvent, - rateChange: FireEvent, - seeked: FireEvent, - seeking: FireEvent, - stalled: FireEvent, - suspend: FireEvent, - timeUpdate: FireEvent, - volumeChange: FireEvent, - waiting: FireEvent, - load: FireEvent, - error: FireEvent, - animationStart: FireEvent, - animationEnd: FireEvent, - animationIteration: FireEvent, - transitionEnd: FireEvent, - |}; - // dom-testing-library re-declares - declare export function queryByTestId( - container: HTMLElement, - id: Matcher, - options?: MatcherOptions - ): ?HTMLElement; - declare export function getByTestId( - container: HTMLElement, - id: Matcher, - options?: MatcherOptions - ): HTMLElement; - declare export function queryByText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): ?HTMLElement; - declare export function getByText( - container: HTMLElement, - text: Matcher, - options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; - declare export function queryByPlaceholderText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): ?HTMLElement; - declare export function getByPlaceholderText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): HTMLElement; - declare export function queryByLabelText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): ?HTMLElement; - declare export function getByLabelText( - container: HTMLElement, - text: Matcher, - options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; - declare export function queryByAltText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): ?HTMLElement; - declare export function getByAltText( - container: HTMLElement, - text: Matcher, - options?: MatcherOptions - ): HTMLElement; - declare export function getNodeText(node: HTMLElement): string; - declare export var screen: Screen<>; -} diff --git a/flow-typed/npm/@testing-library/user-event_v12.x.x.js b/flow-typed/npm/@testing-library/user-event_v12.x.x.js deleted file mode 100644 index 6aa7d44724..0000000000 --- a/flow-typed/npm/@testing-library/user-event_v12.x.x.js +++ /dev/null @@ -1,90 +0,0 @@ -// flow-typed signature: 6a6252b4e3cb976db493544a72da3039 -// flow-typed version: 47a326d3b8/@testing-library/user-event_v12.x.x/flow_>=v0.104.x - -declare module '@testing-library/user-event' { - declare type TypeOpts = {| - skipClick?: boolean, - skipAutoClose?: boolean, - delay?: number, - initialSelectionStart?: number, - initialSelectionEnd?: number, - |}; - - declare type TabUserOptions = {| - shift?: boolean, - focusTrap?: Document | Element, - |}; - - // As of Flow 0.134.x WindowProxy is any, which would annihilate all typechecking. - declare type TargetElement = Element; /* | WindowProxy */ - - declare type FilesArgument = File | File[]; - - declare type UploadInitArgument = {| - clickInit?: MouseEvent$MouseEventInit, - changeInit?: Event, - |}; - - declare type ClickOptions = {| - skipHover?: boolean, - clickCount?: number, - |}; - - declare type UserEvent = {| - clear: (element: TargetElement) => void, - - click: ( - element: TargetElement, - eventInit?: MouseEvent$MouseEventInit, - options?: ClickOptions - ) => void, - - dblClick: ( - element: TargetElement, - eventInit?: MouseEvent$MouseEventInit, - options?: ClickOptions - ) => void, - - selectOptions: ( - element: TargetElement, - values: string | string[] | HTMLElement | HTMLElement[], - eventInit?: MouseEvent$MouseEventInit - ) => void, - - deselectOptions: ( - element: TargetElement, - values: string | string[] | HTMLElement | HTMLElement[], - eventInit?: MouseEvent$MouseEventInit - ) => void, - - upload: ( - element: TargetElement, - files: FilesArgument, - init?: UploadInitArgument - ) => void, - - type: ( - element: TargetElement, - text: string, - userOpts?: TypeOpts - ) => Promise, - - tab: (userOpts?: TabUserOptions) => void, - - paste: ( - element: TargetElement, - text: string, - eventInit?: MouseEvent$MouseEventInit, - pasteOptions?: {| - initialSelectionStart?: number, - initialSelectionEnd?: number, - |} - ) => void, - - hover: (element: TargetElement, init?: MouseEvent$MouseEventInit) => void, - - unhover: (element: TargetElement, init?: MouseEvent$MouseEventInit) => void, - |}; - - declare export default UserEvent; -} diff --git a/flow-typed/npm/@types/styled-components_vx.x.x.js b/flow-typed/npm/@types/styled-components_vx.x.x.js deleted file mode 100644 index f1e42ff9e4..0000000000 --- a/flow-typed/npm/@types/styled-components_vx.x.x.js +++ /dev/null @@ -1,18 +0,0 @@ -// flow-typed signature: a3f5ac6dd042f343038b48bb6ba6c738 -// flow-typed version: <>/@types/styled-components_v^5.1.4/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@types/styled-components' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@types/styled-components' { - declare module.exports: any; -} diff --git a/flow-typed/npm/@typescript-eslint/eslint-plugin_vx.x.x.js b/flow-typed/npm/@typescript-eslint/eslint-plugin_vx.x.x.js deleted file mode 100644 index ac250bfa19..0000000000 --- a/flow-typed/npm/@typescript-eslint/eslint-plugin_vx.x.x.js +++ /dev/null @@ -1,1076 +0,0 @@ -// flow-typed signature: 6c9229d6d8f7114745dfec30fbe41763 -// flow-typed version: <>/@typescript-eslint/eslint-plugin_v^4.9.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@typescript-eslint/eslint-plugin' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@typescript-eslint/eslint-plugin' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@typescript-eslint/eslint-plugin/dist/configs/all' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/configs/base' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/configs/recommended' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/array-type' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/await-thenable' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-types' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/brace-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/comma-dangle' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/comma-spacing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/default-param-last' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/dot-notation' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/init-declarations' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/member-ordering' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/method-signature-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-imports' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-empty-function' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-loop-func' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-misused-new' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-namespace' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-redeclare' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-require-imports' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-shadow' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-this-alias' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-type-alias' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-var-requires' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-includes' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/promise-function-async' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/quotes' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/require-await' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/return-await' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/semi' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/typedef' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/unbound-method' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/rules/unified-signatures' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/astUtils' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/createRule' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/misc' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/nullThrows' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/objectIterators' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/propertyTypes' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/requiresQuoting' { - declare module.exports: any; -} - -declare module '@typescript-eslint/eslint-plugin/dist/util/types' { - declare module.exports: any; -} - -// Filename aliases -declare module '@typescript-eslint/eslint-plugin/dist/configs/all.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/configs/all'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/configs/base.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/configs/base'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/configs/recommended.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/configs/recommended'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/index' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/index.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/array-type.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/array-type'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/await-thenable'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/ban-types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/ban-types'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/brace-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/brace-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/comma-dangle'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/comma-spacing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/default-param-last'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/dot-notation'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/indent.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/indent'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/index' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/index.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/init-declarations'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/member-ordering'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/method-signature-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/format'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/index.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/parse-options'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/shared'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/types'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/validator'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/naming-convention'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-imports.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-imports'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-empty-function'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-loop-func'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-misused-new'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-namespace'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-redeclare'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-require-imports'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-shadow'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-this-alias'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-type-alias'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/no-var-requires'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-includes'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/promise-function-async'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/quotes.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/quotes'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/require-await.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/require-await'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/return-await.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/return-await'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/semi.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/semi'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/typedef.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/typedef'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/unbound-method'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/rules/unified-signatures'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/astUtils.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/astUtils'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/createRule.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/createRule'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/index' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/index.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/misc.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/misc'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/nullThrows.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/nullThrows'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/objectIterators.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/objectIterators'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/propertyTypes.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/propertyTypes'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/requiresQuoting.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/requiresQuoting'>; -} -declare module '@typescript-eslint/eslint-plugin/dist/util/types.js' { - declare module.exports: $Exports<'@typescript-eslint/eslint-plugin/dist/util/types'>; -} diff --git a/flow-typed/npm/@typescript-eslint/parser_vx.x.x.js b/flow-typed/npm/@typescript-eslint/parser_vx.x.x.js deleted file mode 100644 index 9bb7b16ff3..0000000000 --- a/flow-typed/npm/@typescript-eslint/parser_vx.x.x.js +++ /dev/null @@ -1,42 +0,0 @@ -// flow-typed signature: ffbad9d4cacc669da500c8265b74db16 -// flow-typed version: <>/@typescript-eslint/parser_v^4.15.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * '@typescript-eslint/parser' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module '@typescript-eslint/parser' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module '@typescript-eslint/parser/dist' { - declare module.exports: any; -} - -declare module '@typescript-eslint/parser/dist/parser' { - declare module.exports: any; -} - -// Filename aliases -declare module '@typescript-eslint/parser/dist/index' { - declare module.exports: $Exports<'@typescript-eslint/parser/dist'>; -} -declare module '@typescript-eslint/parser/dist/index.js' { - declare module.exports: $Exports<'@typescript-eslint/parser/dist'>; -} -declare module '@typescript-eslint/parser/dist/parser.js' { - declare module.exports: $Exports<'@typescript-eslint/parser/dist/parser'>; -} diff --git a/flow-typed/npm/babel-cli_vx.x.x.js b/flow-typed/npm/babel-cli_vx.x.x.js deleted file mode 100644 index ac2b33eae6..0000000000 --- a/flow-typed/npm/babel-cli_vx.x.x.js +++ /dev/null @@ -1,108 +0,0 @@ -// flow-typed signature: d5f68d326987c61447e2c6d0a154b3e1 -// flow-typed version: <>/babel-cli_v^6.26.0/flow_v0.65.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-cli' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-cli' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-cli/bin/babel-doctor' { - declare module.exports: any; -} - -declare module 'babel-cli/bin/babel-external-helpers' { - declare module.exports: any; -} - -declare module 'babel-cli/bin/babel-node' { - declare module.exports: any; -} - -declare module 'babel-cli/bin/babel' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/_babel-node' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel-external-helpers' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel-node' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel/dir' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel/file' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel/index' { - declare module.exports: any; -} - -declare module 'babel-cli/lib/babel/util' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-cli/bin/babel-doctor.js' { - declare module.exports: $Exports<'babel-cli/bin/babel-doctor'>; -} -declare module 'babel-cli/bin/babel-external-helpers.js' { - declare module.exports: $Exports<'babel-cli/bin/babel-external-helpers'>; -} -declare module 'babel-cli/bin/babel-node.js' { - declare module.exports: $Exports<'babel-cli/bin/babel-node'>; -} -declare module 'babel-cli/bin/babel.js' { - declare module.exports: $Exports<'babel-cli/bin/babel'>; -} -declare module 'babel-cli/index' { - declare module.exports: $Exports<'babel-cli'>; -} -declare module 'babel-cli/index.js' { - declare module.exports: $Exports<'babel-cli'>; -} -declare module 'babel-cli/lib/_babel-node.js' { - declare module.exports: $Exports<'babel-cli/lib/_babel-node'>; -} -declare module 'babel-cli/lib/babel-external-helpers.js' { - declare module.exports: $Exports<'babel-cli/lib/babel-external-helpers'>; -} -declare module 'babel-cli/lib/babel-node.js' { - declare module.exports: $Exports<'babel-cli/lib/babel-node'>; -} -declare module 'babel-cli/lib/babel/dir.js' { - declare module.exports: $Exports<'babel-cli/lib/babel/dir'>; -} -declare module 'babel-cli/lib/babel/file.js' { - declare module.exports: $Exports<'babel-cli/lib/babel/file'>; -} -declare module 'babel-cli/lib/babel/index.js' { - declare module.exports: $Exports<'babel-cli/lib/babel/index'>; -} -declare module 'babel-cli/lib/babel/util.js' { - declare module.exports: $Exports<'babel-cli/lib/babel/util'>; -} diff --git a/flow-typed/npm/babel-core_vx.x.x.js b/flow-typed/npm/babel-core_vx.x.x.js deleted file mode 100644 index c79931b28f..0000000000 --- a/flow-typed/npm/babel-core_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 1ac1d3f0898b54a77b01b01cbf0ea831 -// flow-typed version: <>/babel-core_v^7.0.0-bridge.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-core' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-core' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'babel-core/index' { - declare module.exports: $Exports<'babel-core'>; -} -declare module 'babel-core/index.js' { - declare module.exports: $Exports<'babel-core'>; -} diff --git a/flow-typed/npm/babel-eslint_vx.x.x.js b/flow-typed/npm/babel-eslint_vx.x.x.js deleted file mode 100644 index 34b1e1ac51..0000000000 --- a/flow-typed/npm/babel-eslint_vx.x.x.js +++ /dev/null @@ -1,122 +0,0 @@ -// flow-typed signature: 25df4f8d9dfc689247f944c7a3db6070 -// flow-typed version: <>/babel-eslint_v^10.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-eslint' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-eslint' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-eslint/lib/analyze-scope' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/attachComments' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/convertComments' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/toAST' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/toToken' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/babylon-to-espree/toTokens' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/parse-with-scope' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/parse' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/require-from-eslint' { - declare module.exports: any; -} - -declare module 'babel-eslint/lib/visitor-keys' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-eslint/lib/analyze-scope.js' { - declare module.exports: $Exports<'babel-eslint/lib/analyze-scope'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/attachComments.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/attachComments'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/convertComments.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertComments'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertTemplateType'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/index' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/index.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/toAST.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toAST'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/toToken.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toToken'>; -} -declare module 'babel-eslint/lib/babylon-to-espree/toTokens.js' { - declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toTokens'>; -} -declare module 'babel-eslint/lib/index' { - declare module.exports: $Exports<'babel-eslint/lib'>; -} -declare module 'babel-eslint/lib/index.js' { - declare module.exports: $Exports<'babel-eslint/lib'>; -} -declare module 'babel-eslint/lib/parse-with-scope.js' { - declare module.exports: $Exports<'babel-eslint/lib/parse-with-scope'>; -} -declare module 'babel-eslint/lib/parse.js' { - declare module.exports: $Exports<'babel-eslint/lib/parse'>; -} -declare module 'babel-eslint/lib/require-from-eslint.js' { - declare module.exports: $Exports<'babel-eslint/lib/require-from-eslint'>; -} -declare module 'babel-eslint/lib/visitor-keys.js' { - declare module.exports: $Exports<'babel-eslint/lib/visitor-keys'>; -} diff --git a/flow-typed/npm/babel-jest_vx.x.x.js b/flow-typed/npm/babel-jest_vx.x.x.js deleted file mode 100644 index b6f24dd873..0000000000 --- a/flow-typed/npm/babel-jest_vx.x.x.js +++ /dev/null @@ -1,42 +0,0 @@ -// flow-typed signature: 81e7f283d4978593f45aa124d5479437 -// flow-typed version: <>/babel-jest_v^26.6.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-jest' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-jest' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-jest/build' { - declare module.exports: any; -} - -declare module 'babel-jest/build/loadBabelConfig' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-jest/build/index' { - declare module.exports: $Exports<'babel-jest/build'>; -} -declare module 'babel-jest/build/index.js' { - declare module.exports: $Exports<'babel-jest/build'>; -} -declare module 'babel-jest/build/loadBabelConfig.js' { - declare module.exports: $Exports<'babel-jest/build/loadBabelConfig'>; -} diff --git a/flow-typed/npm/babel-loader_vx.x.x.js b/flow-typed/npm/babel-loader_vx.x.x.js deleted file mode 100644 index bc99da0f05..0000000000 --- a/flow-typed/npm/babel-loader_vx.x.x.js +++ /dev/null @@ -1,63 +0,0 @@ -// flow-typed signature: 4cfc3a15007c8f7fb75397ca4fe735ee -// flow-typed version: <>/babel-loader_v^8.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-loader' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-loader' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-loader/lib/cache' { - declare module.exports: any; -} - -declare module 'babel-loader/lib/Error' { - declare module.exports: any; -} - -declare module 'babel-loader/lib' { - declare module.exports: any; -} - -declare module 'babel-loader/lib/injectCaller' { - declare module.exports: any; -} - -declare module 'babel-loader/lib/transform' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-loader/lib/cache.js' { - declare module.exports: $Exports<'babel-loader/lib/cache'>; -} -declare module 'babel-loader/lib/Error.js' { - declare module.exports: $Exports<'babel-loader/lib/Error'>; -} -declare module 'babel-loader/lib/index' { - declare module.exports: $Exports<'babel-loader/lib'>; -} -declare module 'babel-loader/lib/index.js' { - declare module.exports: $Exports<'babel-loader/lib'>; -} -declare module 'babel-loader/lib/injectCaller.js' { - declare module.exports: $Exports<'babel-loader/lib/injectCaller'>; -} -declare module 'babel-loader/lib/transform.js' { - declare module.exports: $Exports<'babel-loader/lib/transform'>; -} diff --git a/flow-typed/npm/babel-plugin-require-context-hook_vx.x.x.js b/flow-typed/npm/babel-plugin-require-context-hook_vx.x.x.js deleted file mode 100644 index c4ed93fa4f..0000000000 --- a/flow-typed/npm/babel-plugin-require-context-hook_vx.x.x.js +++ /dev/null @@ -1,73 +0,0 @@ -// flow-typed signature: 0d5b518e4dbb5d1b44dfd60fa381d524 -// flow-typed version: <>/babel-plugin-require-context-hook_v^1.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-plugin-require-context-hook' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-plugin-require-context-hook' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-plugin-require-context-hook/register' { - declare module.exports: any; -} - -declare module 'babel-plugin-require-context-hook/test/a/a' { - declare module.exports: any; -} - -declare module 'babel-plugin-require-context-hook/test/a/b/b' { - declare module.exports: any; -} - -declare module 'babel-plugin-require-context-hook/test/a/no' { - declare module.exports: any; -} - -declare module 'babel-plugin-require-context-hook/test/run' { - declare module.exports: any; -} - -declare module 'babel-plugin-require-context-hook/test/test' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-plugin-require-context-hook/index' { - declare module.exports: $Exports<'babel-plugin-require-context-hook'>; -} -declare module 'babel-plugin-require-context-hook/index.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook'>; -} -declare module 'babel-plugin-require-context-hook/register.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/register'>; -} -declare module 'babel-plugin-require-context-hook/test/a/a.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/test/a/a'>; -} -declare module 'babel-plugin-require-context-hook/test/a/b/b.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/test/a/b/b'>; -} -declare module 'babel-plugin-require-context-hook/test/a/no.jsx' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/test/a/no'>; -} -declare module 'babel-plugin-require-context-hook/test/run.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/test/run'>; -} -declare module 'babel-plugin-require-context-hook/test/test.js' { - declare module.exports: $Exports<'babel-plugin-require-context-hook/test/test'>; -} diff --git a/flow-typed/npm/babel-plugin-styled-components_vx.x.x.js b/flow-typed/npm/babel-plugin-styled-components_vx.x.x.js deleted file mode 100644 index c4ce41081d..0000000000 --- a/flow-typed/npm/babel-plugin-styled-components_vx.x.x.js +++ /dev/null @@ -1,139 +0,0 @@ -// flow-typed signature: 1b72121f2e9db4e96934a1a6a7b841c3 -// flow-typed version: <>/babel-plugin-styled-components_v^1.12.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-plugin-styled-components' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-plugin-styled-components' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-plugin-styled-components/lib/css/placeholderUtils' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/minify' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/utils/detectors' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/utils/getName' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/utils/hash' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/utils/options' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/utils/prefixDigit' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/assignStyledRequired' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/displayNameAndId' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/minify' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/pure' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/templateLiterals' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/templateLiterals/transpile' { - declare module.exports: any; -} - -declare module 'babel-plugin-styled-components/lib/visitors/transpileCssProp' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-plugin-styled-components/lib/css/placeholderUtils.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/css/placeholderUtils'>; -} -declare module 'babel-plugin-styled-components/lib/index' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib'>; -} -declare module 'babel-plugin-styled-components/lib/index.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib'>; -} -declare module 'babel-plugin-styled-components/lib/minify/index' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/minify'>; -} -declare module 'babel-plugin-styled-components/lib/minify/index.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/minify'>; -} -declare module 'babel-plugin-styled-components/lib/utils/detectors.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/utils/detectors'>; -} -declare module 'babel-plugin-styled-components/lib/utils/getName.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/utils/getName'>; -} -declare module 'babel-plugin-styled-components/lib/utils/hash.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/utils/hash'>; -} -declare module 'babel-plugin-styled-components/lib/utils/options.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/utils/options'>; -} -declare module 'babel-plugin-styled-components/lib/utils/prefixDigit.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/utils/prefixDigit'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/assignStyledRequired.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/assignStyledRequired'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/displayNameAndId.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/displayNameAndId'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/minify.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/minify'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/pure.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/pure'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/templateLiterals/index' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/templateLiterals'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/templateLiterals/index.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/templateLiterals'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/templateLiterals/transpile.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/templateLiterals/transpile'>; -} -declare module 'babel-plugin-styled-components/lib/visitors/transpileCssProp.js' { - declare module.exports: $Exports<'babel-plugin-styled-components/lib/visitors/transpileCssProp'>; -} diff --git a/flow-typed/npm/babel-preset-env_vx.x.x.js b/flow-typed/npm/babel-preset-env_vx.x.x.js deleted file mode 100644 index dce74b7376..0000000000 --- a/flow-typed/npm/babel-preset-env_vx.x.x.js +++ /dev/null @@ -1,88 +0,0 @@ -// flow-typed signature: 6b30a19e7e74f426446f54a13326abc6 -// flow-typed version: <>/babel-preset-env_v^1.6.1/flow_v0.65.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-preset-env' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-preset-env' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-preset-env/data/built-in-features' { - declare module.exports: any; -} - -declare module 'babel-preset-env/data/plugin-features' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/default-includes' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/index' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/module-transformations' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/normalize-options' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/targets-parser' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/transform-polyfill-require-plugin' { - declare module.exports: any; -} - -declare module 'babel-preset-env/lib/utils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-preset-env/data/built-in-features.js' { - declare module.exports: $Exports<'babel-preset-env/data/built-in-features'>; -} -declare module 'babel-preset-env/data/plugin-features.js' { - declare module.exports: $Exports<'babel-preset-env/data/plugin-features'>; -} -declare module 'babel-preset-env/lib/default-includes.js' { - declare module.exports: $Exports<'babel-preset-env/lib/default-includes'>; -} -declare module 'babel-preset-env/lib/index.js' { - declare module.exports: $Exports<'babel-preset-env/lib/index'>; -} -declare module 'babel-preset-env/lib/module-transformations.js' { - declare module.exports: $Exports<'babel-preset-env/lib/module-transformations'>; -} -declare module 'babel-preset-env/lib/normalize-options.js' { - declare module.exports: $Exports<'babel-preset-env/lib/normalize-options'>; -} -declare module 'babel-preset-env/lib/targets-parser.js' { - declare module.exports: $Exports<'babel-preset-env/lib/targets-parser'>; -} -declare module 'babel-preset-env/lib/transform-polyfill-require-plugin.js' { - declare module.exports: $Exports<'babel-preset-env/lib/transform-polyfill-require-plugin'>; -} -declare module 'babel-preset-env/lib/utils.js' { - declare module.exports: $Exports<'babel-preset-env/lib/utils'>; -} diff --git a/flow-typed/npm/babel-preset-es2015_vx.x.x.js b/flow-typed/npm/babel-preset-es2015_vx.x.x.js deleted file mode 100644 index b105d026ae..0000000000 --- a/flow-typed/npm/babel-preset-es2015_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 71a8ef0d347e41a0128dfceeaf538628 -// flow-typed version: <>/babel-preset-es2015_v^6.24.1/flow_v0.65.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-preset-es2015' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-preset-es2015' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-preset-es2015/lib/index' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-preset-es2015/lib/index.js' { - declare module.exports: $Exports<'babel-preset-es2015/lib/index'>; -} diff --git a/flow-typed/npm/babel-preset-react_vx.x.x.js b/flow-typed/npm/babel-preset-react_vx.x.x.js deleted file mode 100644 index aef9aa320f..0000000000 --- a/flow-typed/npm/babel-preset-react_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: f48b66c8da84a2483a0b0f5b9398daa7 -// flow-typed version: <>/babel-preset-react_v^6.24.1/flow_v0.65.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-preset-react' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-preset-react' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-preset-react/lib/index' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-preset-react/lib/index.js' { - declare module.exports: $Exports<'babel-preset-react/lib/index'>; -} diff --git a/flow-typed/npm/babel-preset-stage-2_vx.x.x.js b/flow-typed/npm/babel-preset-stage-2_vx.x.x.js deleted file mode 100644 index 0e45a0b689..0000000000 --- a/flow-typed/npm/babel-preset-stage-2_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: aaab8e4fd0fd3b0b50e0302104fb8792 -// flow-typed version: <>/babel-preset-stage-2_v^6.24.1/flow_v0.65.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'babel-preset-stage-2' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'babel-preset-stage-2' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'babel-preset-stage-2/lib/index' { - declare module.exports: any; -} - -// Filename aliases -declare module 'babel-preset-stage-2/lib/index.js' { - declare module.exports: $Exports<'babel-preset-stage-2/lib/index'>; -} diff --git a/flow-typed/npm/browser-sync_vx.x.x.js b/flow-typed/npm/browser-sync_vx.x.x.js deleted file mode 100644 index 71353259f3..0000000000 --- a/flow-typed/npm/browser-sync_vx.x.x.js +++ /dev/null @@ -1,444 +0,0 @@ -// flow-typed signature: 0f570446c324c3155eac5a217b838ce3 -// flow-typed version: <>/browser-sync_v^2.26.14/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'browser-sync' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'browser-sync' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'browser-sync/dist/args' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/async-tasks' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/async' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/bin' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/browser-sync' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/cli-info' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/cli-options' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/command.init' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/command.recipe' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/command.reload' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/command.start' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/addCwdToWatchOptions' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/addDefaultIgnorePatterns' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/addToFilesOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/appendServerDirectoryOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/appendServerIndexOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/copyCLIIgnoreToWatchOptions' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleExtensionsOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleFilesOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleGhostModeOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleHostOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handlePortsOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleProxyOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/cli/transforms/handleServerOption' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/config' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/connect-utils' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/default-config' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/file-event-handler' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/file-utils' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/file-watcher' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/hooks' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/http-protocol' { - declare module.exports: any; -} - -declare module 'browser-sync/dist' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/internal-events' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/lodash.custom' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/logger' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/options' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/plugins' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/exit' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/init' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/notify' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/pause' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/public-utils' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/reload' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/resume' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/public/stream' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/proxy-server' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/proxy-utils' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/serve-static-wrapper' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/snippet-server' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/static-server' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/server/utils' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/snippet' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/sockets' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/tunnel' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/types' { - declare module.exports: any; -} - -declare module 'browser-sync/dist/utils' { - declare module.exports: any; -} - -declare module 'browser-sync/templates/cli-template' { - declare module.exports: any; -} - -// Filename aliases -declare module 'browser-sync/dist/args.js' { - declare module.exports: $Exports<'browser-sync/dist/args'>; -} -declare module 'browser-sync/dist/async-tasks.js' { - declare module.exports: $Exports<'browser-sync/dist/async-tasks'>; -} -declare module 'browser-sync/dist/async.js' { - declare module.exports: $Exports<'browser-sync/dist/async'>; -} -declare module 'browser-sync/dist/bin.js' { - declare module.exports: $Exports<'browser-sync/dist/bin'>; -} -declare module 'browser-sync/dist/browser-sync.js' { - declare module.exports: $Exports<'browser-sync/dist/browser-sync'>; -} -declare module 'browser-sync/dist/cli/cli-info.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/cli-info'>; -} -declare module 'browser-sync/dist/cli/cli-options.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/cli-options'>; -} -declare module 'browser-sync/dist/cli/command.init.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/command.init'>; -} -declare module 'browser-sync/dist/cli/command.recipe.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/command.recipe'>; -} -declare module 'browser-sync/dist/cli/command.reload.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/command.reload'>; -} -declare module 'browser-sync/dist/cli/command.start.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/command.start'>; -} -declare module 'browser-sync/dist/cli/transforms/addCwdToWatchOptions.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/addCwdToWatchOptions'>; -} -declare module 'browser-sync/dist/cli/transforms/addDefaultIgnorePatterns.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/addDefaultIgnorePatterns'>; -} -declare module 'browser-sync/dist/cli/transforms/addToFilesOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/addToFilesOption'>; -} -declare module 'browser-sync/dist/cli/transforms/appendServerDirectoryOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/appendServerDirectoryOption'>; -} -declare module 'browser-sync/dist/cli/transforms/appendServerIndexOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/appendServerIndexOption'>; -} -declare module 'browser-sync/dist/cli/transforms/copyCLIIgnoreToWatchOptions.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/copyCLIIgnoreToWatchOptions'>; -} -declare module 'browser-sync/dist/cli/transforms/handleExtensionsOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleExtensionsOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handleFilesOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleFilesOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handleGhostModeOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleGhostModeOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handleHostOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleHostOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handlePortsOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handlePortsOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handleProxyOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleProxyOption'>; -} -declare module 'browser-sync/dist/cli/transforms/handleServerOption.js' { - declare module.exports: $Exports<'browser-sync/dist/cli/transforms/handleServerOption'>; -} -declare module 'browser-sync/dist/config.js' { - declare module.exports: $Exports<'browser-sync/dist/config'>; -} -declare module 'browser-sync/dist/connect-utils.js' { - declare module.exports: $Exports<'browser-sync/dist/connect-utils'>; -} -declare module 'browser-sync/dist/default-config.js' { - declare module.exports: $Exports<'browser-sync/dist/default-config'>; -} -declare module 'browser-sync/dist/file-event-handler.js' { - declare module.exports: $Exports<'browser-sync/dist/file-event-handler'>; -} -declare module 'browser-sync/dist/file-utils.js' { - declare module.exports: $Exports<'browser-sync/dist/file-utils'>; -} -declare module 'browser-sync/dist/file-watcher.js' { - declare module.exports: $Exports<'browser-sync/dist/file-watcher'>; -} -declare module 'browser-sync/dist/hooks.js' { - declare module.exports: $Exports<'browser-sync/dist/hooks'>; -} -declare module 'browser-sync/dist/http-protocol.js' { - declare module.exports: $Exports<'browser-sync/dist/http-protocol'>; -} -declare module 'browser-sync/dist/index' { - declare module.exports: $Exports<'browser-sync/dist'>; -} -declare module 'browser-sync/dist/index.js' { - declare module.exports: $Exports<'browser-sync/dist'>; -} -declare module 'browser-sync/dist/internal-events.js' { - declare module.exports: $Exports<'browser-sync/dist/internal-events'>; -} -declare module 'browser-sync/dist/lodash.custom.js' { - declare module.exports: $Exports<'browser-sync/dist/lodash.custom'>; -} -declare module 'browser-sync/dist/logger.js' { - declare module.exports: $Exports<'browser-sync/dist/logger'>; -} -declare module 'browser-sync/dist/options.js' { - declare module.exports: $Exports<'browser-sync/dist/options'>; -} -declare module 'browser-sync/dist/plugins.js' { - declare module.exports: $Exports<'browser-sync/dist/plugins'>; -} -declare module 'browser-sync/dist/public/exit.js' { - declare module.exports: $Exports<'browser-sync/dist/public/exit'>; -} -declare module 'browser-sync/dist/public/init.js' { - declare module.exports: $Exports<'browser-sync/dist/public/init'>; -} -declare module 'browser-sync/dist/public/notify.js' { - declare module.exports: $Exports<'browser-sync/dist/public/notify'>; -} -declare module 'browser-sync/dist/public/pause.js' { - declare module.exports: $Exports<'browser-sync/dist/public/pause'>; -} -declare module 'browser-sync/dist/public/public-utils.js' { - declare module.exports: $Exports<'browser-sync/dist/public/public-utils'>; -} -declare module 'browser-sync/dist/public/reload.js' { - declare module.exports: $Exports<'browser-sync/dist/public/reload'>; -} -declare module 'browser-sync/dist/public/resume.js' { - declare module.exports: $Exports<'browser-sync/dist/public/resume'>; -} -declare module 'browser-sync/dist/public/stream.js' { - declare module.exports: $Exports<'browser-sync/dist/public/stream'>; -} -declare module 'browser-sync/dist/server/index' { - declare module.exports: $Exports<'browser-sync/dist/server'>; -} -declare module 'browser-sync/dist/server/index.js' { - declare module.exports: $Exports<'browser-sync/dist/server'>; -} -declare module 'browser-sync/dist/server/proxy-server.js' { - declare module.exports: $Exports<'browser-sync/dist/server/proxy-server'>; -} -declare module 'browser-sync/dist/server/proxy-utils.js' { - declare module.exports: $Exports<'browser-sync/dist/server/proxy-utils'>; -} -declare module 'browser-sync/dist/server/serve-static-wrapper.js' { - declare module.exports: $Exports<'browser-sync/dist/server/serve-static-wrapper'>; -} -declare module 'browser-sync/dist/server/snippet-server.js' { - declare module.exports: $Exports<'browser-sync/dist/server/snippet-server'>; -} -declare module 'browser-sync/dist/server/static-server.js' { - declare module.exports: $Exports<'browser-sync/dist/server/static-server'>; -} -declare module 'browser-sync/dist/server/utils.js' { - declare module.exports: $Exports<'browser-sync/dist/server/utils'>; -} -declare module 'browser-sync/dist/snippet.js' { - declare module.exports: $Exports<'browser-sync/dist/snippet'>; -} -declare module 'browser-sync/dist/sockets.js' { - declare module.exports: $Exports<'browser-sync/dist/sockets'>; -} -declare module 'browser-sync/dist/tunnel.js' { - declare module.exports: $Exports<'browser-sync/dist/tunnel'>; -} -declare module 'browser-sync/dist/types.js' { - declare module.exports: $Exports<'browser-sync/dist/types'>; -} -declare module 'browser-sync/dist/utils.js' { - declare module.exports: $Exports<'browser-sync/dist/utils'>; -} -declare module 'browser-sync/templates/cli-template.js' { - declare module.exports: $Exports<'browser-sync/templates/cli-template'>; -} diff --git a/flow-typed/npm/browserslist_vx.x.x.js b/flow-typed/npm/browserslist_vx.x.x.js deleted file mode 100644 index 4766d7452b..0000000000 --- a/flow-typed/npm/browserslist_vx.x.x.js +++ /dev/null @@ -1,66 +0,0 @@ -// flow-typed signature: 0d21d9f5e9c393811f1d056eefcdde24 -// flow-typed version: <>/browserslist_v^4.14.5/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'browserslist' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'browserslist' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'browserslist/browser' { - declare module.exports: any; -} - -declare module 'browserslist/cli' { - declare module.exports: any; -} - -declare module 'browserslist/error' { - declare module.exports: any; -} - -declare module 'browserslist/node' { - declare module.exports: any; -} - -declare module 'browserslist/update-db' { - declare module.exports: any; -} - -// Filename aliases -declare module 'browserslist/browser.js' { - declare module.exports: $Exports<'browserslist/browser'>; -} -declare module 'browserslist/cli.js' { - declare module.exports: $Exports<'browserslist/cli'>; -} -declare module 'browserslist/error.js' { - declare module.exports: $Exports<'browserslist/error'>; -} -declare module 'browserslist/index' { - declare module.exports: $Exports<'browserslist'>; -} -declare module 'browserslist/index.js' { - declare module.exports: $Exports<'browserslist'>; -} -declare module 'browserslist/node.js' { - declare module.exports: $Exports<'browserslist/node'>; -} -declare module 'browserslist/update-db.js' { - declare module.exports: $Exports<'browserslist/update-db'>; -} diff --git a/flow-typed/npm/camelcase_vx.x.x.js b/flow-typed/npm/camelcase_vx.x.x.js deleted file mode 100644 index 09651ddc41..0000000000 --- a/flow-typed/npm/camelcase_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 965fd5941c0a1a1d3b71c7af1d789007 -// flow-typed version: <>/camelcase_v^6.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'camelcase' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'camelcase' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'camelcase/index' { - declare module.exports: $Exports<'camelcase'>; -} -declare module 'camelcase/index.js' { - declare module.exports: $Exports<'camelcase'>; -} diff --git a/flow-typed/npm/caniuse-db_vx.x.x.js b/flow-typed/npm/caniuse-db_vx.x.x.js deleted file mode 100644 index 4af851b240..0000000000 --- a/flow-typed/npm/caniuse-db_vx.x.x.js +++ /dev/null @@ -1,18 +0,0 @@ -// flow-typed signature: 293b97aebca3110e908b2d9b27ef0c76 -// flow-typed version: <>/caniuse-db_v^1.0.30001185/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'caniuse-db' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'caniuse-db' { - declare module.exports: any; -} diff --git a/flow-typed/npm/capitalize_vx.x.x.js b/flow-typed/npm/capitalize_vx.x.x.js deleted file mode 100644 index 8811b59097..0000000000 --- a/flow-typed/npm/capitalize_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 0a8213f09f8964950b4780402d96dbe5 -// flow-typed version: <>/capitalize_v^2.0.3/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'capitalize' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'capitalize' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'capitalize/index' { - declare module.exports: $Exports<'capitalize'>; -} -declare module 'capitalize/index.js' { - declare module.exports: $Exports<'capitalize'>; -} diff --git a/flow-typed/npm/check-links_vx.x.x.js b/flow-typed/npm/check-links_vx.x.x.js deleted file mode 100644 index 9742e0cb12..0000000000 --- a/flow-typed/npm/check-links_vx.x.x.js +++ /dev/null @@ -1,52 +0,0 @@ -// flow-typed signature: 6090d119a448250900ed62943e545da4 -// flow-typed version: <>/check-links_v^1.1.8/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'check-links' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'check-links' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'check-links/lib/check-link' { - declare module.exports: any; -} - -declare module 'check-links/test/check-link.test' { - declare module.exports: any; -} - -declare module 'check-links/test/index.test' { - declare module.exports: any; -} - -// Filename aliases -declare module 'check-links/index' { - declare module.exports: $Exports<'check-links'>; -} -declare module 'check-links/index.js' { - declare module.exports: $Exports<'check-links'>; -} -declare module 'check-links/lib/check-link.js' { - declare module.exports: $Exports<'check-links/lib/check-link'>; -} -declare module 'check-links/test/check-link.test.js' { - declare module.exports: $Exports<'check-links/test/check-link.test'>; -} -declare module 'check-links/test/index.test.js' { - declare module.exports: $Exports<'check-links/test/index.test'>; -} diff --git a/flow-typed/npm/conventional-changelog_vx.x.x.js b/flow-typed/npm/conventional-changelog_vx.x.x.js deleted file mode 100644 index ef19c0c8d0..0000000000 --- a/flow-typed/npm/conventional-changelog_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 331868e08273142eee2c14e85afbb92f -// flow-typed version: <>/conventional-changelog_v^3.1.24/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'conventional-changelog' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'conventional-changelog' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'conventional-changelog/index' { - declare module.exports: $Exports<'conventional-changelog'>; -} -declare module 'conventional-changelog/index.js' { - declare module.exports: $Exports<'conventional-changelog'>; -} diff --git a/flow-typed/npm/copyfiles_vx.x.x.js b/flow-typed/npm/copyfiles_vx.x.x.js deleted file mode 100644 index b9be4ba576..0000000000 --- a/flow-typed/npm/copyfiles_vx.x.x.js +++ /dev/null @@ -1,38 +0,0 @@ -// flow-typed signature: 3d939e1e770c1188c0fd675b1184e178 -// flow-typed version: <>/copyfiles_v^2.4.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'copyfiles' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'copyfiles' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'copyfiles/test/test.fromNode' { - declare module.exports: any; -} - -// Filename aliases -declare module 'copyfiles/index' { - declare module.exports: $Exports<'copyfiles'>; -} -declare module 'copyfiles/index.js' { - declare module.exports: $Exports<'copyfiles'>; -} -declare module 'copyfiles/test/test.fromNode.js' { - declare module.exports: $Exports<'copyfiles/test/test.fromNode'>; -} diff --git a/flow-typed/npm/cross-env_vx.x.x.js b/flow-typed/npm/cross-env_vx.x.x.js deleted file mode 100644 index f6e2fc95ad..0000000000 --- a/flow-typed/npm/cross-env_vx.x.x.js +++ /dev/null @@ -1,70 +0,0 @@ -// flow-typed signature: db42be795fabfe955218e153f985b793 -// flow-typed version: <>/cross-env_v^7.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'cross-env' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'cross-env' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'cross-env/src/bin/cross-env-shell' { - declare module.exports: any; -} - -declare module 'cross-env/src/bin/cross-env' { - declare module.exports: any; -} - -declare module 'cross-env/src/command' { - declare module.exports: any; -} - -declare module 'cross-env/src' { - declare module.exports: any; -} - -declare module 'cross-env/src/is-windows' { - declare module.exports: any; -} - -declare module 'cross-env/src/variable' { - declare module.exports: any; -} - -// Filename aliases -declare module 'cross-env/src/bin/cross-env-shell.js' { - declare module.exports: $Exports<'cross-env/src/bin/cross-env-shell'>; -} -declare module 'cross-env/src/bin/cross-env.js' { - declare module.exports: $Exports<'cross-env/src/bin/cross-env'>; -} -declare module 'cross-env/src/command.js' { - declare module.exports: $Exports<'cross-env/src/command'>; -} -declare module 'cross-env/src/index' { - declare module.exports: $Exports<'cross-env/src'>; -} -declare module 'cross-env/src/index.js' { - declare module.exports: $Exports<'cross-env/src'>; -} -declare module 'cross-env/src/is-windows.js' { - declare module.exports: $Exports<'cross-env/src/is-windows'>; -} -declare module 'cross-env/src/variable.js' { - declare module.exports: $Exports<'cross-env/src/variable'>; -} diff --git a/flow-typed/npm/dotenv-safe_vx.x.x.js b/flow-typed/npm/dotenv-safe_vx.x.x.js deleted file mode 100644 index f739ab9b5d..0000000000 --- a/flow-typed/npm/dotenv-safe_vx.x.x.js +++ /dev/null @@ -1,45 +0,0 @@ -// flow-typed signature: 5426aecfd786b94d78c313bffc12a259 -// flow-typed version: <>/dotenv-safe_v^8.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'dotenv-safe' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'dotenv-safe' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'dotenv-safe/config' { - declare module.exports: any; -} - -declare module 'dotenv-safe/MissingEnvVarsError' { - declare module.exports: any; -} - -// Filename aliases -declare module 'dotenv-safe/config.js' { - declare module.exports: $Exports<'dotenv-safe/config'>; -} -declare module 'dotenv-safe/index' { - declare module.exports: $Exports<'dotenv-safe'>; -} -declare module 'dotenv-safe/index.js' { - declare module.exports: $Exports<'dotenv-safe'>; -} -declare module 'dotenv-safe/MissingEnvVarsError.js' { - declare module.exports: $Exports<'dotenv-safe/MissingEnvVarsError'>; -} diff --git a/flow-typed/npm/eslint-config-airbnb_vx.x.x.js b/flow-typed/npm/eslint-config-airbnb_vx.x.x.js deleted file mode 100644 index 2428e07f03..0000000000 --- a/flow-typed/npm/eslint-config-airbnb_vx.x.x.js +++ /dev/null @@ -1,101 +0,0 @@ -// flow-typed signature: 7a07d245cc8694484d795164d7cac2bc -// flow-typed version: <>/eslint-config-airbnb_v^18.2.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-config-airbnb' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-config-airbnb' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-config-airbnb/base' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/hooks' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/legacy' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/rules/react-a11y' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/rules/react-hooks' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/rules/react' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/test/requires' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/test/test-base' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/test/test-react-order' { - declare module.exports: any; -} - -declare module 'eslint-config-airbnb/whitespace' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-config-airbnb/base.js' { - declare module.exports: $Exports<'eslint-config-airbnb/base'>; -} -declare module 'eslint-config-airbnb/hooks.js' { - declare module.exports: $Exports<'eslint-config-airbnb/hooks'>; -} -declare module 'eslint-config-airbnb/index' { - declare module.exports: $Exports<'eslint-config-airbnb'>; -} -declare module 'eslint-config-airbnb/index.js' { - declare module.exports: $Exports<'eslint-config-airbnb'>; -} -declare module 'eslint-config-airbnb/legacy.js' { - declare module.exports: $Exports<'eslint-config-airbnb/legacy'>; -} -declare module 'eslint-config-airbnb/rules/react-a11y.js' { - declare module.exports: $Exports<'eslint-config-airbnb/rules/react-a11y'>; -} -declare module 'eslint-config-airbnb/rules/react-hooks.js' { - declare module.exports: $Exports<'eslint-config-airbnb/rules/react-hooks'>; -} -declare module 'eslint-config-airbnb/rules/react.js' { - declare module.exports: $Exports<'eslint-config-airbnb/rules/react'>; -} -declare module 'eslint-config-airbnb/test/requires.js' { - declare module.exports: $Exports<'eslint-config-airbnb/test/requires'>; -} -declare module 'eslint-config-airbnb/test/test-base.js' { - declare module.exports: $Exports<'eslint-config-airbnb/test/test-base'>; -} -declare module 'eslint-config-airbnb/test/test-react-order.js' { - declare module.exports: $Exports<'eslint-config-airbnb/test/test-react-order'>; -} -declare module 'eslint-config-airbnb/whitespace.js' { - declare module.exports: $Exports<'eslint-config-airbnb/whitespace'>; -} diff --git a/flow-typed/npm/eslint-config-prettier_vx.x.x.js b/flow-typed/npm/eslint-config-prettier_vx.x.x.js deleted file mode 100644 index 056afe1cf1..0000000000 --- a/flow-typed/npm/eslint-config-prettier_vx.x.x.js +++ /dev/null @@ -1,101 +0,0 @@ -// flow-typed signature: 6c6e2cf8d2655b3bcc3ee37a98536a21 -// flow-typed version: <>/eslint-config-prettier_v^7.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-config-prettier' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-config-prettier' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-config-prettier/@typescript-eslint' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/babel' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/bin/cli' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/bin/validators' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/flowtype' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/prettier' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/react' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/standard' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/unicorn' { - declare module.exports: any; -} - -declare module 'eslint-config-prettier/vue' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-config-prettier/@typescript-eslint.js' { - declare module.exports: $Exports<'eslint-config-prettier/@typescript-eslint'>; -} -declare module 'eslint-config-prettier/babel.js' { - declare module.exports: $Exports<'eslint-config-prettier/babel'>; -} -declare module 'eslint-config-prettier/bin/cli.js' { - declare module.exports: $Exports<'eslint-config-prettier/bin/cli'>; -} -declare module 'eslint-config-prettier/bin/validators.js' { - declare module.exports: $Exports<'eslint-config-prettier/bin/validators'>; -} -declare module 'eslint-config-prettier/flowtype.js' { - declare module.exports: $Exports<'eslint-config-prettier/flowtype'>; -} -declare module 'eslint-config-prettier/index' { - declare module.exports: $Exports<'eslint-config-prettier'>; -} -declare module 'eslint-config-prettier/index.js' { - declare module.exports: $Exports<'eslint-config-prettier'>; -} -declare module 'eslint-config-prettier/prettier.js' { - declare module.exports: $Exports<'eslint-config-prettier/prettier'>; -} -declare module 'eslint-config-prettier/react.js' { - declare module.exports: $Exports<'eslint-config-prettier/react'>; -} -declare module 'eslint-config-prettier/standard.js' { - declare module.exports: $Exports<'eslint-config-prettier/standard'>; -} -declare module 'eslint-config-prettier/unicorn.js' { - declare module.exports: $Exports<'eslint-config-prettier/unicorn'>; -} -declare module 'eslint-config-prettier/vue.js' { - declare module.exports: $Exports<'eslint-config-prettier/vue'>; -} diff --git a/flow-typed/npm/eslint-import-resolver-alias_vx.x.x.js b/flow-typed/npm/eslint-import-resolver-alias_vx.x.x.js deleted file mode 100644 index ea2f421aa6..0000000000 --- a/flow-typed/npm/eslint-import-resolver-alias_vx.x.x.js +++ /dev/null @@ -1,38 +0,0 @@ -// flow-typed signature: d5b89467114806aa6eafa383bd024d77 -// flow-typed version: <>/eslint-import-resolver-alias_v^1.1.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-import-resolver-alias' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-import-resolver-alias' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-import-resolver-alias/core' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-import-resolver-alias/core.js' { - declare module.exports: $Exports<'eslint-import-resolver-alias/core'>; -} -declare module 'eslint-import-resolver-alias/index' { - declare module.exports: $Exports<'eslint-import-resolver-alias'>; -} -declare module 'eslint-import-resolver-alias/index.js' { - declare module.exports: $Exports<'eslint-import-resolver-alias'>; -} diff --git a/flow-typed/npm/eslint-plugin-babel_vx.x.x.js b/flow-typed/npm/eslint-plugin-babel_vx.x.x.js deleted file mode 100644 index fdebd49d20..0000000000 --- a/flow-typed/npm/eslint-plugin-babel_vx.x.x.js +++ /dev/null @@ -1,199 +0,0 @@ -// flow-typed signature: ea65441a041b6bb2ab3cb4387f746179 -// flow-typed version: <>/eslint-plugin-babel_v^5.3.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-babel' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-babel' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-babel/rules/array-bracket-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/arrow-parens' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/camelcase' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/flow-object-type' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/func-params-comma-dangle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/generator-star-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/new-cap' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/no-await-in-loop' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/no-invalid-this' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/no-unused-expressions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/object-curly-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/object-shorthand' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/quotes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/semi' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/rules/valid-typeof' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/camelcase' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/new-cap' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/no-invalid-this' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/no-unused-expressions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/object-curly-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/quotes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/semi' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/rules/valid-typeof' { - declare module.exports: any; -} - -declare module 'eslint-plugin-babel/tests/RuleTester' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-babel/index' { - declare module.exports: $Exports<'eslint-plugin-babel'>; -} -declare module 'eslint-plugin-babel/index.js' { - declare module.exports: $Exports<'eslint-plugin-babel'>; -} -declare module 'eslint-plugin-babel/rules/array-bracket-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/array-bracket-spacing'>; -} -declare module 'eslint-plugin-babel/rules/arrow-parens.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/arrow-parens'>; -} -declare module 'eslint-plugin-babel/rules/camelcase.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/camelcase'>; -} -declare module 'eslint-plugin-babel/rules/flow-object-type.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/flow-object-type'>; -} -declare module 'eslint-plugin-babel/rules/func-params-comma-dangle.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/func-params-comma-dangle'>; -} -declare module 'eslint-plugin-babel/rules/generator-star-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/generator-star-spacing'>; -} -declare module 'eslint-plugin-babel/rules/new-cap.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/new-cap'>; -} -declare module 'eslint-plugin-babel/rules/no-await-in-loop.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/no-await-in-loop'>; -} -declare module 'eslint-plugin-babel/rules/no-invalid-this.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/no-invalid-this'>; -} -declare module 'eslint-plugin-babel/rules/no-unused-expressions.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/no-unused-expressions'>; -} -declare module 'eslint-plugin-babel/rules/object-curly-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/object-curly-spacing'>; -} -declare module 'eslint-plugin-babel/rules/object-shorthand.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/object-shorthand'>; -} -declare module 'eslint-plugin-babel/rules/quotes.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/quotes'>; -} -declare module 'eslint-plugin-babel/rules/semi.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/semi'>; -} -declare module 'eslint-plugin-babel/rules/valid-typeof.js' { - declare module.exports: $Exports<'eslint-plugin-babel/rules/valid-typeof'>; -} -declare module 'eslint-plugin-babel/tests/rules/camelcase.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/camelcase'>; -} -declare module 'eslint-plugin-babel/tests/rules/new-cap.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/new-cap'>; -} -declare module 'eslint-plugin-babel/tests/rules/no-invalid-this.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/no-invalid-this'>; -} -declare module 'eslint-plugin-babel/tests/rules/no-unused-expressions.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/no-unused-expressions'>; -} -declare module 'eslint-plugin-babel/tests/rules/object-curly-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/object-curly-spacing'>; -} -declare module 'eslint-plugin-babel/tests/rules/quotes.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/quotes'>; -} -declare module 'eslint-plugin-babel/tests/rules/semi.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/semi'>; -} -declare module 'eslint-plugin-babel/tests/rules/valid-typeof.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/rules/valid-typeof'>; -} -declare module 'eslint-plugin-babel/tests/RuleTester.js' { - declare module.exports: $Exports<'eslint-plugin-babel/tests/RuleTester'>; -} diff --git a/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js b/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js deleted file mode 100644 index 352b7d2c54..0000000000 --- a/flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js +++ /dev/null @@ -1,534 +0,0 @@ -// flow-typed signature: 7e266382dbe375066994aeac68e8e894 -// flow-typed version: <>/eslint-plugin-flowtype_v^5.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-flowtype' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-flowtype' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-flowtype/dist/bin/addAssertions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/bin/checkDocs' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/bin/checkTests' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/bin/utilities' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/isSimpleType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/needWrap' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyleComplexType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyleSimpleType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/arrowParens' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/booleanStyle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/defineFlowType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/delimiterDangle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/genericSpacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noDupeKeys' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noExistentialType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noInternalFlowType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noMixed' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noMutableArray' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noUnusedExpressions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/noWeakTypes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/objectTypeCurlySpacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireCompoundTypeAlias' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireExactType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireIndexerName' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireInexactType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireParameterType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireReadonlyReactProps' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireReturnType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireTypesAtTop' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/requireVariableType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/semi' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/sortKeys' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/spreadExactType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateVariables' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeIdMatch' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/typeImportStyle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/useFlowType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/rules/validSyntax' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/getParameterName' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/isFlowFile' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/isNoFlowFile' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/isNoFlowFileAnnotation' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/quoteName' { - declare module.exports: any; -} - -declare module 'eslint-plugin-flowtype/dist/utilities/spacingFixers' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-flowtype/dist/bin/addAssertions.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/bin/addAssertions'>; -} -declare module 'eslint-plugin-flowtype/dist/bin/checkDocs.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/bin/checkDocs'>; -} -declare module 'eslint-plugin-flowtype/dist/bin/checkTests.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/bin/checkTests'>; -} -declare module 'eslint-plugin-flowtype/dist/bin/utilities.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/bin/utilities'>; -} -declare module 'eslint-plugin-flowtype/dist/index' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist'>; -} -declare module 'eslint-plugin-flowtype/dist/index.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/index' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyle'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/index.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyle'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/isSimpleType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyle/isSimpleType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyle/needWrap.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyle/needWrap'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyleComplexType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyleComplexType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrayStyleSimpleType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrayStyleSimpleType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/arrowParens.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/arrowParens'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/booleanStyle.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/booleanStyle'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/defineFlowType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/defineFlowType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/delimiterDangle.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/delimiterDangle'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/genericSpacing.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/genericSpacing'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noDupeKeys.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noDupeKeys'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noExistentialType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noExistentialType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noInternalFlowType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noInternalFlowType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noMixed.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noMixed'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noMutableArray.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noMutableArray'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noUnusedExpressions.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noUnusedExpressions'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/noWeakTypes.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noWeakTypes'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/objectTypeCurlySpacing.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/objectTypeCurlySpacing'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireCompoundTypeAlias.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireCompoundTypeAlias'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireExactType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireExactType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireIndexerName.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireIndexerName'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireInexactType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireInexactType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireParameterType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireParameterType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireReadonlyReactProps.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireReadonlyReactProps'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireReturnType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireReturnType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireTypesAtTop.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireTypesAtTop'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/requireVariableType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireVariableType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/semi.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/semi'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/sortKeys.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/sortKeys'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/spreadExactType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spreadExactType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateVariables.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateVariables'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/index' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/index.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeIdMatch.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeIdMatch'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/typeImportStyle.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeImportStyle'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/useFlowType.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/useFlowType'>; -} -declare module 'eslint-plugin-flowtype/dist/rules/validSyntax.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/validSyntax'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/getParameterName.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getParameterName'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/index' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/index.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/isFlowFile.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isFlowFile'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/isNoFlowFile.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isNoFlowFile'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/isNoFlowFileAnnotation.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isNoFlowFileAnnotation'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/quoteName.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/quoteName'>; -} -declare module 'eslint-plugin-flowtype/dist/utilities/spacingFixers.js' { - declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/spacingFixers'>; -} diff --git a/flow-typed/npm/eslint-plugin-import_vx.x.x.js b/flow-typed/npm/eslint-plugin-import_vx.x.x.js deleted file mode 100644 index aa70818f07..0000000000 --- a/flow-typed/npm/eslint-plugin-import_vx.x.x.js +++ /dev/null @@ -1,423 +0,0 @@ -// flow-typed signature: ecd93511f5976b017b974bfcad75b0a5 -// flow-typed version: <>/eslint-plugin-import_v^2.22.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-import' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-import' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-import/config/electron' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/errors' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/react-native' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/react' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/recommended' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/stage-0' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/typescript' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/config/warnings' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/core/importType' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/core/staticRequire' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/docsUrl' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/ExportMap' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/importDeclaration' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/default' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/exports-last' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/extensions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/first' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/group-exports' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/imports-first' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/max-dependencies' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/named' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/namespace' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/newline-after-import' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-absolute-path' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-amd' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-commonjs' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-cycle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-default-export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-deprecated' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-duplicates' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-dynamic-require' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-internal-modules' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-mutable-exports' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-named-as-default' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-named-default' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-named-export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-namespace' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-restricted-paths' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-self-import' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-unassigned-import' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-unresolved' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-unused-modules' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/order' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/prefer-default-export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/unambiguous' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/memo-parser' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-import/config/electron.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/electron'>; -} -declare module 'eslint-plugin-import/config/errors.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/errors'>; -} -declare module 'eslint-plugin-import/config/react-native.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/react-native'>; -} -declare module 'eslint-plugin-import/config/react.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/react'>; -} -declare module 'eslint-plugin-import/config/recommended.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/recommended'>; -} -declare module 'eslint-plugin-import/config/stage-0.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/stage-0'>; -} -declare module 'eslint-plugin-import/config/typescript.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/typescript'>; -} -declare module 'eslint-plugin-import/config/warnings.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/warnings'>; -} -declare module 'eslint-plugin-import/lib/core/importType.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/core/importType'>; -} -declare module 'eslint-plugin-import/lib/core/staticRequire.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/core/staticRequire'>; -} -declare module 'eslint-plugin-import/lib/docsUrl.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/docsUrl'>; -} -declare module 'eslint-plugin-import/lib/ExportMap.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/ExportMap'>; -} -declare module 'eslint-plugin-import/lib/importDeclaration.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/importDeclaration'>; -} -declare module 'eslint-plugin-import/lib/index' { - declare module.exports: $Exports<'eslint-plugin-import/lib'>; -} -declare module 'eslint-plugin-import/lib/index.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib'>; -} -declare module 'eslint-plugin-import/lib/rules/default.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/default'>; -} -declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/dynamic-import-chunkname'>; -} -declare module 'eslint-plugin-import/lib/rules/export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/export'>; -} -declare module 'eslint-plugin-import/lib/rules/exports-last.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/exports-last'>; -} -declare module 'eslint-plugin-import/lib/rules/extensions.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/extensions'>; -} -declare module 'eslint-plugin-import/lib/rules/first.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/first'>; -} -declare module 'eslint-plugin-import/lib/rules/group-exports.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/group-exports'>; -} -declare module 'eslint-plugin-import/lib/rules/imports-first.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/imports-first'>; -} -declare module 'eslint-plugin-import/lib/rules/max-dependencies.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/max-dependencies'>; -} -declare module 'eslint-plugin-import/lib/rules/named.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/named'>; -} -declare module 'eslint-plugin-import/lib/rules/namespace.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/namespace'>; -} -declare module 'eslint-plugin-import/lib/rules/newline-after-import.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/newline-after-import'>; -} -declare module 'eslint-plugin-import/lib/rules/no-absolute-path.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-absolute-path'>; -} -declare module 'eslint-plugin-import/lib/rules/no-amd.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-amd'>; -} -declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-anonymous-default-export'>; -} -declare module 'eslint-plugin-import/lib/rules/no-commonjs.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-commonjs'>; -} -declare module 'eslint-plugin-import/lib/rules/no-cycle.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-cycle'>; -} -declare module 'eslint-plugin-import/lib/rules/no-default-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-default-export'>; -} -declare module 'eslint-plugin-import/lib/rules/no-deprecated.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-deprecated'>; -} -declare module 'eslint-plugin-import/lib/rules/no-duplicates.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-duplicates'>; -} -declare module 'eslint-plugin-import/lib/rules/no-dynamic-require.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-dynamic-require'>; -} -declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-extraneous-dependencies'>; -} -declare module 'eslint-plugin-import/lib/rules/no-internal-modules.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-internal-modules'>; -} -declare module 'eslint-plugin-import/lib/rules/no-mutable-exports.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-mutable-exports'>; -} -declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default-member'>; -} -declare module 'eslint-plugin-import/lib/rules/no-named-as-default.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default'>; -} -declare module 'eslint-plugin-import/lib/rules/no-named-default.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-default'>; -} -declare module 'eslint-plugin-import/lib/rules/no-named-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-export'>; -} -declare module 'eslint-plugin-import/lib/rules/no-namespace.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-namespace'>; -} -declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-nodejs-modules'>; -} -declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-relative-parent-imports'>; -} -declare module 'eslint-plugin-import/lib/rules/no-restricted-paths.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-restricted-paths'>; -} -declare module 'eslint-plugin-import/lib/rules/no-self-import.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-self-import'>; -} -declare module 'eslint-plugin-import/lib/rules/no-unassigned-import.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unassigned-import'>; -} -declare module 'eslint-plugin-import/lib/rules/no-unresolved.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unresolved'>; -} -declare module 'eslint-plugin-import/lib/rules/no-unused-modules.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unused-modules'>; -} -declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-useless-path-segments'>; -} -declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-webpack-loader-syntax'>; -} -declare module 'eslint-plugin-import/lib/rules/order.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/order'>; -} -declare module 'eslint-plugin-import/lib/rules/prefer-default-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/prefer-default-export'>; -} -declare module 'eslint-plugin-import/lib/rules/unambiguous.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/unambiguous'>; -} -declare module 'eslint-plugin-import/memo-parser/index' { - declare module.exports: $Exports<'eslint-plugin-import/memo-parser'>; -} -declare module 'eslint-plugin-import/memo-parser/index.js' { - declare module.exports: $Exports<'eslint-plugin-import/memo-parser'>; -} diff --git a/flow-typed/npm/eslint-plugin-jest_vx.x.x.js b/flow-typed/npm/eslint-plugin-jest_vx.x.x.js deleted file mode 100644 index d620589cef..0000000000 --- a/flow-typed/npm/eslint-plugin-jest_vx.x.x.js +++ /dev/null @@ -1,364 +0,0 @@ -// flow-typed signature: 6aff7118450af0d6c44825d220034013 -// flow-typed version: <>/eslint-plugin-jest_v^24.1.3/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-jest' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-jest' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-jest/lib' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/processors/snapshot-processor' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/consistent-test-it' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/expect-expect' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/lowercase-name' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-alias-methods' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-commented-out-tests' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-conditional-expect' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-deprecated-functions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-disabled-tests' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-done-callback' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-duplicate-hooks' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-expect-resolves' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-export' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-focused-tests' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-hooks' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-identical-title' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-if' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-interpolation-in-snapshots' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-jasmine-globals' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-jest-import' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-large-snapshots' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-mocks-import' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-restricted-matchers' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-standalone-expect' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-test-prefixes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-test-return-statement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-truthy-falsy' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/no-try-expect' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-called-with' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-expect-assertions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-hooks-on-top' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-inline-snapshots' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-spy-on' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-strict-equal' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-to-be-null' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-to-be-undefined' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-to-contain' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-to-have-length' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/prefer-todo' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/require-to-throw-message' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/require-top-level-describe' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/unbound-method' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/utils' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/valid-describe' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/valid-expect-in-promise' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/valid-expect' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jest/lib/rules/valid-title' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-jest/lib/index' { - declare module.exports: $Exports<'eslint-plugin-jest/lib'>; -} -declare module 'eslint-plugin-jest/lib/index.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib'>; -} -declare module 'eslint-plugin-jest/lib/processors/snapshot-processor.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/processors/snapshot-processor'>; -} -declare module 'eslint-plugin-jest/lib/rules/consistent-test-it.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/consistent-test-it'>; -} -declare module 'eslint-plugin-jest/lib/rules/expect-expect.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/expect-expect'>; -} -declare module 'eslint-plugin-jest/lib/rules/lowercase-name.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/lowercase-name'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-alias-methods.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-alias-methods'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-commented-out-tests.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-commented-out-tests'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-conditional-expect.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-conditional-expect'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-deprecated-functions.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-deprecated-functions'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-disabled-tests.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-disabled-tests'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-done-callback.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-done-callback'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-duplicate-hooks.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-duplicate-hooks'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-expect-resolves.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-expect-resolves'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-export.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-export'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-focused-tests.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-focused-tests'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-hooks.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-hooks'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-identical-title.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-identical-title'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-if.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-if'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-interpolation-in-snapshots.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-interpolation-in-snapshots'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-jasmine-globals.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-jasmine-globals'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-jest-import.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-jest-import'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-large-snapshots.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-large-snapshots'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-mocks-import.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-mocks-import'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-restricted-matchers.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-restricted-matchers'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-standalone-expect.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-standalone-expect'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-test-prefixes.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-test-prefixes'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-test-return-statement.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-test-return-statement'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-truthy-falsy.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-truthy-falsy'>; -} -declare module 'eslint-plugin-jest/lib/rules/no-try-expect.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/no-try-expect'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-called-with.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-called-with'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-expect-assertions.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-expect-assertions'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-hooks-on-top.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-hooks-on-top'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-inline-snapshots.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-inline-snapshots'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-spy-on.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-spy-on'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-strict-equal.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-strict-equal'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-to-be-null.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-to-be-null'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-to-be-undefined.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-to-be-undefined'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-to-contain.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-to-contain'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-to-have-length.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-to-have-length'>; -} -declare module 'eslint-plugin-jest/lib/rules/prefer-todo.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/prefer-todo'>; -} -declare module 'eslint-plugin-jest/lib/rules/require-to-throw-message.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/require-to-throw-message'>; -} -declare module 'eslint-plugin-jest/lib/rules/require-top-level-describe.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/require-top-level-describe'>; -} -declare module 'eslint-plugin-jest/lib/rules/unbound-method.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/unbound-method'>; -} -declare module 'eslint-plugin-jest/lib/rules/utils.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/utils'>; -} -declare module 'eslint-plugin-jest/lib/rules/valid-describe.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/valid-describe'>; -} -declare module 'eslint-plugin-jest/lib/rules/valid-expect-in-promise.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/valid-expect-in-promise'>; -} -declare module 'eslint-plugin-jest/lib/rules/valid-expect.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/valid-expect'>; -} -declare module 'eslint-plugin-jest/lib/rules/valid-title.js' { - declare module.exports: $Exports<'eslint-plugin-jest/lib/rules/valid-title'>; -} diff --git a/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js b/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js deleted file mode 100644 index 753e2d6b8a..0000000000 --- a/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js +++ /dev/null @@ -1,1235 +0,0 @@ -// flow-typed signature: 65aa74614bd6c7551b24a5c0ad2f12ff -// flow-typed version: <>/eslint-plugin-jsx-a11y_v^6.4.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-jsx-a11y' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-jsx-a11y' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/axeMapping' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/index-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/autocomplete-valid-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/autocomplete-valid' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/lang' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/scope' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isDOMElement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/schemas' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/scripts/create-rule' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/genInteractives'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/LiteralMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/axeMapping.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/axeMapping'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/index-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/index-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-is-valid-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/autocomplete-valid-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/autocomplete-valid-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/index' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/index.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/alt-text'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/anchor-is-valid'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-props'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-role'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/autocomplete-valid.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/autocomplete-valid'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/heading-has-content'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/html-has-lang'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-for'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/lang.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/lang'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/media-has-caption'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-access-key'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-autofocus'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-onchange'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/scope.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/scope'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/attributesComparator'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getComputedRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getExplicitRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getImplicitRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getSuggestion'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getTabIndex'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isAbstractRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isDisabledElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isDOMElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isDOMElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isPresentationRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/schemas.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/schemas'>; -} -declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/addRuleToIndex'>; -} -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/doc'>; -} -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/rule'>; -} -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/test'>; -} -declare module 'eslint-plugin-jsx-a11y/scripts/create-rule.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/create-rule'>; -} diff --git a/flow-typed/npm/eslint-plugin-mdx_vx.x.x.js b/flow-typed/npm/eslint-plugin-mdx_vx.x.x.js deleted file mode 100644 index 53a4e541e3..0000000000 --- a/flow-typed/npm/eslint-plugin-mdx_vx.x.x.js +++ /dev/null @@ -1,212 +0,0 @@ -// flow-typed signature: c3b7e12880871241acca1a621e081b63 -// flow-typed version: <>/eslint-plugin-mdx_v^1.8.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-mdx' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-mdx' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-mdx/lib/cjs' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/cjs.min' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs/base' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs/code-blocks' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs/helpers' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs/overrides' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/configs/recommended' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/es2015' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/es2015.min' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/esm' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/esm.min' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors/helpers' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors/markdown' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors/options' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors/remark' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/processors/types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules/helpers' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules/no-jsx-html-comments' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules/no-unused-expressions' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules/remark' { - declare module.exports: any; -} - -declare module 'eslint-plugin-mdx/lib/rules/types' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-mdx/lib/cjs.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/cjs'>; -} -declare module 'eslint-plugin-mdx/lib/cjs.min.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/cjs.min'>; -} -declare module 'eslint-plugin-mdx/lib/configs/base.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs/base'>; -} -declare module 'eslint-plugin-mdx/lib/configs/code-blocks.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs/code-blocks'>; -} -declare module 'eslint-plugin-mdx/lib/configs/helpers.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs/helpers'>; -} -declare module 'eslint-plugin-mdx/lib/configs/index' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs'>; -} -declare module 'eslint-plugin-mdx/lib/configs/index.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs'>; -} -declare module 'eslint-plugin-mdx/lib/configs/overrides.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs/overrides'>; -} -declare module 'eslint-plugin-mdx/lib/configs/recommended.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/configs/recommended'>; -} -declare module 'eslint-plugin-mdx/lib/es2015.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/es2015'>; -} -declare module 'eslint-plugin-mdx/lib/es2015.min.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/es2015.min'>; -} -declare module 'eslint-plugin-mdx/lib/esm.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/esm'>; -} -declare module 'eslint-plugin-mdx/lib/esm.min.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/esm.min'>; -} -declare module 'eslint-plugin-mdx/lib/index' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib'>; -} -declare module 'eslint-plugin-mdx/lib/index.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib'>; -} -declare module 'eslint-plugin-mdx/lib/processors/helpers.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors/helpers'>; -} -declare module 'eslint-plugin-mdx/lib/processors/index' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors'>; -} -declare module 'eslint-plugin-mdx/lib/processors/index.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors'>; -} -declare module 'eslint-plugin-mdx/lib/processors/markdown.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors/markdown'>; -} -declare module 'eslint-plugin-mdx/lib/processors/options.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors/options'>; -} -declare module 'eslint-plugin-mdx/lib/processors/remark.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors/remark'>; -} -declare module 'eslint-plugin-mdx/lib/processors/types.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/processors/types'>; -} -declare module 'eslint-plugin-mdx/lib/rules/helpers.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules/helpers'>; -} -declare module 'eslint-plugin-mdx/lib/rules/index' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules'>; -} -declare module 'eslint-plugin-mdx/lib/rules/index.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules'>; -} -declare module 'eslint-plugin-mdx/lib/rules/no-jsx-html-comments.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules/no-jsx-html-comments'>; -} -declare module 'eslint-plugin-mdx/lib/rules/no-unused-expressions.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules/no-unused-expressions'>; -} -declare module 'eslint-plugin-mdx/lib/rules/remark.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules/remark'>; -} -declare module 'eslint-plugin-mdx/lib/rules/types.js' { - declare module.exports: $Exports<'eslint-plugin-mdx/lib/rules/types'>; -} diff --git a/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js b/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js deleted file mode 100644 index b13f146cc3..0000000000 --- a/flow-typed/npm/eslint-plugin-prettier_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 0a294380ea980a4e3bfa8f1d97a11a88 -// flow-typed version: <>/eslint-plugin-prettier_v^3.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-prettier' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-prettier' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-prettier/eslint-plugin-prettier' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-prettier/eslint-plugin-prettier.js' { - declare module.exports: $Exports<'eslint-plugin-prettier/eslint-plugin-prettier'>; -} diff --git a/flow-typed/npm/eslint-plugin-react-hooks_vx.x.x.js b/flow-typed/npm/eslint-plugin-react-hooks_vx.x.x.js deleted file mode 100644 index 7602a78315..0000000000 --- a/flow-typed/npm/eslint-plugin-react-hooks_vx.x.x.js +++ /dev/null @@ -1,45 +0,0 @@ -// flow-typed signature: b54eb6f842ab6e9e0d133990a12e2d89 -// flow-typed version: <>/eslint-plugin-react-hooks_v^4.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-react-hooks' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-react-hooks' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js' { - declare module.exports: $Exports<'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development'>; -} -declare module 'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js' { - declare module.exports: $Exports<'eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min'>; -} -declare module 'eslint-plugin-react-hooks/index' { - declare module.exports: $Exports<'eslint-plugin-react-hooks'>; -} -declare module 'eslint-plugin-react-hooks/index.js' { - declare module.exports: $Exports<'eslint-plugin-react-hooks'>; -} diff --git a/flow-typed/npm/eslint-plugin-react_vx.x.x.js b/flow-typed/npm/eslint-plugin-react_vx.x.x.js deleted file mode 100644 index 539b54f4a2..0000000000 --- a/flow-typed/npm/eslint-plugin-react_vx.x.x.js +++ /dev/null @@ -1,801 +0,0 @@ -// flow-typed signature: 9f1284daa77d915d48ad3459990e4507 -// flow-typed version: <>/eslint-plugin-react_v^7.21.5/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint-plugin-react' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint-plugin-react' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint-plugin-react/lib/rules/boolean-prop-naming' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/button-has-type' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/default-props-match-prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/destructuring-assignment' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/display-name' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/forbid-component-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/forbid-dom-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/forbid-elements' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/forbid-foreign-prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/forbid-prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/function-component-definition' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-boolean-value' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-child-element-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-closing-bracket-location' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-closing-tag-location' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-curly-brace-presence' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-curly-newline' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-curly-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-equals-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-filename-extension' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-first-prop-new-line' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-fragments' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-handler-names' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-indent-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-indent' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-key' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-max-depth' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-max-props-per-line' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-newline' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-bind' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-comment-textnodes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-constructed-context-values' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-duplicate-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-literals' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-script-url' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-target-blank' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-undef' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-no-useless-fragment' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-one-expression-per-line' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-pascal-case' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-props-no-spreading' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-sort-default-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-sort-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-space-before-closing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-tag-spacing' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-uses-react' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-uses-vars' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/jsx-wrap-multilines' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-access-state-in-setstate' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-adjacent-inline-elements' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-array-index-key' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-children-prop' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-danger-with-children' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-danger' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-deprecated' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-did-mount-set-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-did-update-set-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-direct-mutation-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-find-dom-node' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-is-mounted' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-multi-comp' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-redundant-should-component-update' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-render-return-value' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-set-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-string-refs' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-this-in-sfc' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-typos' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unescaped-entities' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unknown-property' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unsafe' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unstable-nested-components' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unused-prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-unused-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/no-will-update-set-state' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/prefer-es6-class' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/prefer-read-only-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/prefer-stateless-function' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/react-in-jsx-scope' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/require-default-props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/require-optimization' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/require-render-return' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/self-closing-comp' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/sort-comp' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/sort-prop-types' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/state-in-constructor' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/static-property-placement' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/style-prop-object' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/rules/void-dom-elements-no-children' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/annotations' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/ast' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/Components' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/defaultProps' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/docsUrl' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/error' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/getTokenBeforeClosingBracket' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/isFirstLetterCapitalized' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/jsx' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/linkComponents' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/log' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/makeNoMethodSetStateRule' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/pragma' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/props' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/propTypes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/propTypesSort' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/propWrapper' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/usedPropTypes' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/variable' { - declare module.exports: any; -} - -declare module 'eslint-plugin-react/lib/util/version' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint-plugin-react/index' { - declare module.exports: $Exports<'eslint-plugin-react'>; -} -declare module 'eslint-plugin-react/index.js' { - declare module.exports: $Exports<'eslint-plugin-react'>; -} -declare module 'eslint-plugin-react/lib/rules/boolean-prop-naming.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/boolean-prop-naming'>; -} -declare module 'eslint-plugin-react/lib/rules/button-has-type.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/button-has-type'>; -} -declare module 'eslint-plugin-react/lib/rules/default-props-match-prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/default-props-match-prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/destructuring-assignment.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/destructuring-assignment'>; -} -declare module 'eslint-plugin-react/lib/rules/display-name.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/display-name'>; -} -declare module 'eslint-plugin-react/lib/rules/forbid-component-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/forbid-component-props'>; -} -declare module 'eslint-plugin-react/lib/rules/forbid-dom-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/forbid-dom-props'>; -} -declare module 'eslint-plugin-react/lib/rules/forbid-elements.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/forbid-elements'>; -} -declare module 'eslint-plugin-react/lib/rules/forbid-foreign-prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/forbid-foreign-prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/forbid-prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/forbid-prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/function-component-definition.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/function-component-definition'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-boolean-value.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-boolean-value'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-child-element-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-child-element-spacing'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-closing-bracket-location'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-closing-tag-location.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-closing-tag-location'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-curly-brace-presence.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-curly-brace-presence'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-curly-newline.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-curly-newline'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-curly-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-curly-spacing'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-equals-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-equals-spacing'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-filename-extension.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-filename-extension'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-first-prop-new-line.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-first-prop-new-line'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-fragments.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-fragments'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-handler-names.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-handler-names'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-indent-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-indent-props'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-indent.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-indent'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-key.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-key'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-max-depth.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-max-depth'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-max-props-per-line.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-max-props-per-line'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-newline.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-newline'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-bind.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-bind'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-comment-textnodes.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-comment-textnodes'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-constructed-context-values.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-constructed-context-values'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-duplicate-props'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-literals.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-literals'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-script-url.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-script-url'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-target-blank.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-target-blank'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-undef.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-undef'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-no-useless-fragment.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-no-useless-fragment'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-one-expression-per-line.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-one-expression-per-line'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-pascal-case.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-pascal-case'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-props-no-multi-spaces'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-props-no-spreading.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-props-no-spreading'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-sort-default-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-sort-default-props'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-sort-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-sort-props'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-space-before-closing.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-space-before-closing'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-tag-spacing.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-tag-spacing'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-uses-react.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-uses-react'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-uses-vars.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-uses-vars'>; -} -declare module 'eslint-plugin-react/lib/rules/jsx-wrap-multilines.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/jsx-wrap-multilines'>; -} -declare module 'eslint-plugin-react/lib/rules/no-access-state-in-setstate.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-access-state-in-setstate'>; -} -declare module 'eslint-plugin-react/lib/rules/no-adjacent-inline-elements.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-adjacent-inline-elements'>; -} -declare module 'eslint-plugin-react/lib/rules/no-array-index-key.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-array-index-key'>; -} -declare module 'eslint-plugin-react/lib/rules/no-children-prop.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-children-prop'>; -} -declare module 'eslint-plugin-react/lib/rules/no-danger-with-children.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-danger-with-children'>; -} -declare module 'eslint-plugin-react/lib/rules/no-danger.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-danger'>; -} -declare module 'eslint-plugin-react/lib/rules/no-deprecated.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-deprecated'>; -} -declare module 'eslint-plugin-react/lib/rules/no-did-mount-set-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-did-mount-set-state'>; -} -declare module 'eslint-plugin-react/lib/rules/no-did-update-set-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-did-update-set-state'>; -} -declare module 'eslint-plugin-react/lib/rules/no-direct-mutation-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-direct-mutation-state'>; -} -declare module 'eslint-plugin-react/lib/rules/no-find-dom-node.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-find-dom-node'>; -} -declare module 'eslint-plugin-react/lib/rules/no-is-mounted.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-is-mounted'>; -} -declare module 'eslint-plugin-react/lib/rules/no-multi-comp.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-multi-comp'>; -} -declare module 'eslint-plugin-react/lib/rules/no-redundant-should-component-update.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-redundant-should-component-update'>; -} -declare module 'eslint-plugin-react/lib/rules/no-render-return-value.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-render-return-value'>; -} -declare module 'eslint-plugin-react/lib/rules/no-set-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-set-state'>; -} -declare module 'eslint-plugin-react/lib/rules/no-string-refs.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-string-refs'>; -} -declare module 'eslint-plugin-react/lib/rules/no-this-in-sfc.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-this-in-sfc'>; -} -declare module 'eslint-plugin-react/lib/rules/no-typos.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-typos'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unescaped-entities.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unescaped-entities'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unknown-property.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unknown-property'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unsafe.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unsafe'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unstable-nested-components.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unstable-nested-components'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unused-prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unused-prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/no-unused-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-unused-state'>; -} -declare module 'eslint-plugin-react/lib/rules/no-will-update-set-state.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/no-will-update-set-state'>; -} -declare module 'eslint-plugin-react/lib/rules/prefer-es6-class.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/prefer-es6-class'>; -} -declare module 'eslint-plugin-react/lib/rules/prefer-read-only-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/prefer-read-only-props'>; -} -declare module 'eslint-plugin-react/lib/rules/prefer-stateless-function.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/prefer-stateless-function'>; -} -declare module 'eslint-plugin-react/lib/rules/prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/react-in-jsx-scope.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/react-in-jsx-scope'>; -} -declare module 'eslint-plugin-react/lib/rules/require-default-props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/require-default-props'>; -} -declare module 'eslint-plugin-react/lib/rules/require-optimization.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/require-optimization'>; -} -declare module 'eslint-plugin-react/lib/rules/require-render-return.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/require-render-return'>; -} -declare module 'eslint-plugin-react/lib/rules/self-closing-comp.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/self-closing-comp'>; -} -declare module 'eslint-plugin-react/lib/rules/sort-comp.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/sort-comp'>; -} -declare module 'eslint-plugin-react/lib/rules/sort-prop-types.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/sort-prop-types'>; -} -declare module 'eslint-plugin-react/lib/rules/state-in-constructor.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/state-in-constructor'>; -} -declare module 'eslint-plugin-react/lib/rules/static-property-placement.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/static-property-placement'>; -} -declare module 'eslint-plugin-react/lib/rules/style-prop-object.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/style-prop-object'>; -} -declare module 'eslint-plugin-react/lib/rules/void-dom-elements-no-children.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/rules/void-dom-elements-no-children'>; -} -declare module 'eslint-plugin-react/lib/util/annotations.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/annotations'>; -} -declare module 'eslint-plugin-react/lib/util/ast.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/ast'>; -} -declare module 'eslint-plugin-react/lib/util/Components.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/Components'>; -} -declare module 'eslint-plugin-react/lib/util/defaultProps.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/defaultProps'>; -} -declare module 'eslint-plugin-react/lib/util/docsUrl.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/docsUrl'>; -} -declare module 'eslint-plugin-react/lib/util/error.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/error'>; -} -declare module 'eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/getTokenBeforeClosingBracket'>; -} -declare module 'eslint-plugin-react/lib/util/isFirstLetterCapitalized.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/isFirstLetterCapitalized'>; -} -declare module 'eslint-plugin-react/lib/util/jsx.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/jsx'>; -} -declare module 'eslint-plugin-react/lib/util/linkComponents.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/linkComponents'>; -} -declare module 'eslint-plugin-react/lib/util/log.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/log'>; -} -declare module 'eslint-plugin-react/lib/util/makeNoMethodSetStateRule.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/makeNoMethodSetStateRule'>; -} -declare module 'eslint-plugin-react/lib/util/pragma.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/pragma'>; -} -declare module 'eslint-plugin-react/lib/util/props.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/props'>; -} -declare module 'eslint-plugin-react/lib/util/propTypes.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/propTypes'>; -} -declare module 'eslint-plugin-react/lib/util/propTypesSort.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/propTypesSort'>; -} -declare module 'eslint-plugin-react/lib/util/propWrapper.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/propWrapper'>; -} -declare module 'eslint-plugin-react/lib/util/usedPropTypes.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/usedPropTypes'>; -} -declare module 'eslint-plugin-react/lib/util/variable.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/variable'>; -} -declare module 'eslint-plugin-react/lib/util/version.js' { - declare module.exports: $Exports<'eslint-plugin-react/lib/util/version'>; -} diff --git a/flow-typed/npm/eslint_vx.x.x.js b/flow-typed/npm/eslint_vx.x.x.js deleted file mode 100644 index 68cff68ca4..0000000000 --- a/flow-typed/npm/eslint_vx.x.x.js +++ /dev/null @@ -1,2681 +0,0 @@ -// flow-typed signature: e4cb159326e5ded2b15fadb5d97119ac -// flow-typed version: <>/eslint_v^7.14.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'eslint' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'eslint' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'eslint/bin/eslint' { - declare module.exports: any; -} - -declare module 'eslint/conf/config-schema' { - declare module.exports: any; -} - -declare module 'eslint/conf/default-cli-options' { - declare module.exports: any; -} - -declare module 'eslint/conf/eslint-all' { - declare module.exports: any; -} - -declare module 'eslint/conf/eslint-recommended' { - declare module.exports: any; -} - -declare module 'eslint/lib/api' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/cli-engine' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/file-enumerator' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/checkstyle' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/codeframe' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/compact' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/html' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/jslint-xml' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/json-with-metadata' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/json' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/junit' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/stylish' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/table' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/tap' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/unix' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/formatters/visualstudio' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/hash' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/lint-result-cache' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/load-rules' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli-engine/xml-escape' { - declare module.exports: any; -} - -declare module 'eslint/lib/cli' { - declare module.exports: any; -} - -declare module 'eslint/lib/eslint/eslint' { - declare module.exports: any; -} - -declare module 'eslint/lib/eslint' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/autoconfig' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/config-file' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/config-initializer' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/config-rule' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/npm-utils' { - declare module.exports: any; -} - -declare module 'eslint/lib/init/source-code-utils' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/apply-disable-directives' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/code-path-analyzer' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/code-path-segment' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/code-path-state' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/code-path' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/debug-helpers' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/fork-context' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/code-path-analysis/id-generator' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/config-comment-parser' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/interpolate' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/linter' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/node-event-generator' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/report-translator' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/rule-fixer' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/rules' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/safe-emitter' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/source-code-fixer' { - declare module.exports: any; -} - -declare module 'eslint/lib/linter/timing' { - declare module.exports: any; -} - -declare module 'eslint/lib/options' { - declare module.exports: any; -} - -declare module 'eslint/lib/rule-tester' { - declare module.exports: any; -} - -declare module 'eslint/lib/rule-tester/rule-tester' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/accessor-pairs' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/array-bracket-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/array-bracket-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/array-callback-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/array-element-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/arrow-body-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/arrow-parens' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/arrow-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/block-scoped-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/block-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/brace-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/callback-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/camelcase' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/capitalized-comments' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/class-methods-use-this' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/comma-dangle' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/comma-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/comma-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/complexity' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/computed-property-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/consistent-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/consistent-this' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/constructor-super' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/curly' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/default-case-last' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/default-case' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/default-param-last' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/dot-location' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/dot-notation' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/eol-last' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/eqeqeq' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/for-direction' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/func-call-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/func-name-matching' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/func-names' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/func-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/function-call-argument-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/function-paren-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/generator-star-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/getter-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/global-require' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/grouped-accessor-pairs' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/guard-for-in' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/handle-callback-err' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/id-blacklist' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/id-denylist' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/id-length' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/id-match' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/implicit-arrow-linebreak' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/indent-legacy' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/indent' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/init-declarations' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/jsx-quotes' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/key-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/keyword-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/line-comment-position' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/linebreak-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/lines-around-comment' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/lines-around-directive' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/lines-between-class-members' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-classes-per-file' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-depth' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-len' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-lines-per-function' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-lines' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-nested-callbacks' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-params' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-statements-per-line' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/max-statements' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/multiline-comment-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/multiline-ternary' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/new-cap' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/new-parens' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/newline-after-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/newline-before-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/newline-per-chained-call' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-alert' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-array-constructor' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-async-promise-executor' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-await-in-loop' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-bitwise' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-buffer-constructor' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-caller' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-case-declarations' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-catch-shadow' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-class-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-compare-neg-zero' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-cond-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-confusing-arrow' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-console' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-const-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-constant-condition' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-constructor-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-continue' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-control-regex' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-debugger' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-delete-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-div-regex' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-dupe-args' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-dupe-class-members' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-dupe-else-if' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-dupe-keys' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-duplicate-case' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-duplicate-imports' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-else-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-empty-character-class' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-empty-function' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-empty-pattern' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-empty' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-eq-null' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-eval' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-ex-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extend-native' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extra-bind' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extra-boolean-cast' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extra-label' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extra-parens' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-extra-semi' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-fallthrough' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-floating-decimal' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-func-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-global-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-implicit-coercion' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-implicit-globals' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-implied-eval' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-import-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-inline-comments' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-inner-declarations' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-invalid-regexp' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-invalid-this' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-irregular-whitespace' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-iterator' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-label-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-labels' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-lone-blocks' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-lonely-if' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-loop-func' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-loss-of-precision' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-magic-numbers' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-misleading-character-class' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-mixed-operators' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-mixed-requires' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-mixed-spaces-and-tabs' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-multi-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-multi-spaces' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-multi-str' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-multiple-empty-lines' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-native-reassign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-negated-condition' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-negated-in-lhs' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-nested-ternary' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new-func' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new-object' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new-require' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new-symbol' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new-wrappers' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-new' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-nonoctal-decimal-escape' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-obj-calls' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-octal-escape' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-octal' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-param-reassign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-path-concat' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-plusplus' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-process-env' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-process-exit' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-promise-executor-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-proto' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-prototype-builtins' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-redeclare' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-regex-spaces' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-exports' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-globals' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-imports' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-modules' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-properties' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-restricted-syntax' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-return-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-return-await' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-script-url' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-self-assign' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-self-compare' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-sequences' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-setter-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-shadow-restricted-names' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-shadow' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-spaced-func' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-sparse-arrays' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-sync' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-tabs' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-template-curly-in-string' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-ternary' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-this-before-super' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-throw-literal' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-trailing-spaces' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-undef-init' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-undef' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-undefined' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-underscore-dangle' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unexpected-multiline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unmodified-loop-condition' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unneeded-ternary' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unreachable-loop' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unreachable' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unsafe-finally' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unsafe-negation' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unsafe-optional-chaining' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unused-expressions' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unused-labels' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-unused-vars' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-use-before-define' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-backreference' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-call' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-catch' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-computed-key' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-concat' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-constructor' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-escape' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-rename' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-useless-return' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-void' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-warning-comments' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-whitespace-before-property' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/no-with' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/nonblock-statement-body-position' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/object-curly-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/object-curly-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/object-property-newline' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/object-shorthand' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/one-var-declaration-per-line' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/one-var' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/operator-assignment' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/operator-linebreak' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/padded-blocks' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/padding-line-between-statements' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-arrow-callback' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-const' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-destructuring' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-exponentiation-operator' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-named-capture-group' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-numeric-literals' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-object-spread' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-promise-reject-errors' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-reflect' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-regex-literals' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-rest-params' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-spread' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/prefer-template' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/quote-props' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/quotes' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/radix' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/require-atomic-updates' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/require-await' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/require-jsdoc' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/require-unicode-regexp' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/require-yield' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/rest-spread-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/semi-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/semi-style' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/semi' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/sort-imports' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/sort-keys' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/sort-vars' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/space-before-blocks' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/space-before-function-paren' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/space-in-parens' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/space-infix-ops' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/space-unary-ops' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/spaced-comment' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/strict' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/switch-colon-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/symbol-description' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/template-curly-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/template-tag-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/unicode-bom' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/use-isnan' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/ast-utils' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/fix-tracker' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/keywords' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/lazy-loading-rule-map' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/patterns/letters' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/unicode' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/unicode/is-combining-character' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/unicode/is-emoji-modifier' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/unicode/is-regional-indicator-symbol' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/utils/unicode/is-surrogate-pair' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/valid-jsdoc' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/valid-typeof' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/vars-on-top' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/wrap-iife' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/wrap-regex' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/yield-star-spacing' { - declare module.exports: any; -} - -declare module 'eslint/lib/rules/yoda' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/ajv' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/ast-utils' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/config-validator' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/deprecation-warnings' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/logging' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/relative-module-resolver' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/runtime-info' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/traverser' { - declare module.exports: any; -} - -declare module 'eslint/lib/shared/types' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/source-code' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/backward-token-comment-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/backward-token-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/cursors' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/decorative-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/filter-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/forward-token-comment-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/forward-token-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/limit-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/padded-token-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/skip-cursor' { - declare module.exports: any; -} - -declare module 'eslint/lib/source-code/token-store/utils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'eslint/bin/eslint.js' { - declare module.exports: $Exports<'eslint/bin/eslint'>; -} -declare module 'eslint/conf/config-schema.js' { - declare module.exports: $Exports<'eslint/conf/config-schema'>; -} -declare module 'eslint/conf/default-cli-options.js' { - declare module.exports: $Exports<'eslint/conf/default-cli-options'>; -} -declare module 'eslint/conf/eslint-all.js' { - declare module.exports: $Exports<'eslint/conf/eslint-all'>; -} -declare module 'eslint/conf/eslint-recommended.js' { - declare module.exports: $Exports<'eslint/conf/eslint-recommended'>; -} -declare module 'eslint/lib/api.js' { - declare module.exports: $Exports<'eslint/lib/api'>; -} -declare module 'eslint/lib/cli-engine/cli-engine.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/cli-engine'>; -} -declare module 'eslint/lib/cli-engine/file-enumerator.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/file-enumerator'>; -} -declare module 'eslint/lib/cli-engine/formatters/checkstyle.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/checkstyle'>; -} -declare module 'eslint/lib/cli-engine/formatters/codeframe.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/codeframe'>; -} -declare module 'eslint/lib/cli-engine/formatters/compact.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/compact'>; -} -declare module 'eslint/lib/cli-engine/formatters/html.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/html'>; -} -declare module 'eslint/lib/cli-engine/formatters/jslint-xml.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/jslint-xml'>; -} -declare module 'eslint/lib/cli-engine/formatters/json-with-metadata.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/json-with-metadata'>; -} -declare module 'eslint/lib/cli-engine/formatters/json.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/json'>; -} -declare module 'eslint/lib/cli-engine/formatters/junit.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/junit'>; -} -declare module 'eslint/lib/cli-engine/formatters/stylish.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/stylish'>; -} -declare module 'eslint/lib/cli-engine/formatters/table.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/table'>; -} -declare module 'eslint/lib/cli-engine/formatters/tap.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/tap'>; -} -declare module 'eslint/lib/cli-engine/formatters/unix.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/unix'>; -} -declare module 'eslint/lib/cli-engine/formatters/visualstudio.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/formatters/visualstudio'>; -} -declare module 'eslint/lib/cli-engine/hash.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/hash'>; -} -declare module 'eslint/lib/cli-engine/index' { - declare module.exports: $Exports<'eslint/lib/cli-engine'>; -} -declare module 'eslint/lib/cli-engine/index.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine'>; -} -declare module 'eslint/lib/cli-engine/lint-result-cache.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/lint-result-cache'>; -} -declare module 'eslint/lib/cli-engine/load-rules.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/load-rules'>; -} -declare module 'eslint/lib/cli-engine/xml-escape.js' { - declare module.exports: $Exports<'eslint/lib/cli-engine/xml-escape'>; -} -declare module 'eslint/lib/cli.js' { - declare module.exports: $Exports<'eslint/lib/cli'>; -} -declare module 'eslint/lib/eslint/eslint.js' { - declare module.exports: $Exports<'eslint/lib/eslint/eslint'>; -} -declare module 'eslint/lib/eslint/index' { - declare module.exports: $Exports<'eslint/lib/eslint'>; -} -declare module 'eslint/lib/eslint/index.js' { - declare module.exports: $Exports<'eslint/lib/eslint'>; -} -declare module 'eslint/lib/init/autoconfig.js' { - declare module.exports: $Exports<'eslint/lib/init/autoconfig'>; -} -declare module 'eslint/lib/init/config-file.js' { - declare module.exports: $Exports<'eslint/lib/init/config-file'>; -} -declare module 'eslint/lib/init/config-initializer.js' { - declare module.exports: $Exports<'eslint/lib/init/config-initializer'>; -} -declare module 'eslint/lib/init/config-rule.js' { - declare module.exports: $Exports<'eslint/lib/init/config-rule'>; -} -declare module 'eslint/lib/init/npm-utils.js' { - declare module.exports: $Exports<'eslint/lib/init/npm-utils'>; -} -declare module 'eslint/lib/init/source-code-utils.js' { - declare module.exports: $Exports<'eslint/lib/init/source-code-utils'>; -} -declare module 'eslint/lib/linter/apply-disable-directives.js' { - declare module.exports: $Exports<'eslint/lib/linter/apply-disable-directives'>; -} -declare module 'eslint/lib/linter/code-path-analysis/code-path-analyzer.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/code-path-analyzer'>; -} -declare module 'eslint/lib/linter/code-path-analysis/code-path-segment.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/code-path-segment'>; -} -declare module 'eslint/lib/linter/code-path-analysis/code-path-state.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/code-path-state'>; -} -declare module 'eslint/lib/linter/code-path-analysis/code-path.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/code-path'>; -} -declare module 'eslint/lib/linter/code-path-analysis/debug-helpers.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/debug-helpers'>; -} -declare module 'eslint/lib/linter/code-path-analysis/fork-context.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/fork-context'>; -} -declare module 'eslint/lib/linter/code-path-analysis/id-generator.js' { - declare module.exports: $Exports<'eslint/lib/linter/code-path-analysis/id-generator'>; -} -declare module 'eslint/lib/linter/config-comment-parser.js' { - declare module.exports: $Exports<'eslint/lib/linter/config-comment-parser'>; -} -declare module 'eslint/lib/linter/index' { - declare module.exports: $Exports<'eslint/lib/linter'>; -} -declare module 'eslint/lib/linter/index.js' { - declare module.exports: $Exports<'eslint/lib/linter'>; -} -declare module 'eslint/lib/linter/interpolate.js' { - declare module.exports: $Exports<'eslint/lib/linter/interpolate'>; -} -declare module 'eslint/lib/linter/linter.js' { - declare module.exports: $Exports<'eslint/lib/linter/linter'>; -} -declare module 'eslint/lib/linter/node-event-generator.js' { - declare module.exports: $Exports<'eslint/lib/linter/node-event-generator'>; -} -declare module 'eslint/lib/linter/report-translator.js' { - declare module.exports: $Exports<'eslint/lib/linter/report-translator'>; -} -declare module 'eslint/lib/linter/rule-fixer.js' { - declare module.exports: $Exports<'eslint/lib/linter/rule-fixer'>; -} -declare module 'eslint/lib/linter/rules.js' { - declare module.exports: $Exports<'eslint/lib/linter/rules'>; -} -declare module 'eslint/lib/linter/safe-emitter.js' { - declare module.exports: $Exports<'eslint/lib/linter/safe-emitter'>; -} -declare module 'eslint/lib/linter/source-code-fixer.js' { - declare module.exports: $Exports<'eslint/lib/linter/source-code-fixer'>; -} -declare module 'eslint/lib/linter/timing.js' { - declare module.exports: $Exports<'eslint/lib/linter/timing'>; -} -declare module 'eslint/lib/options.js' { - declare module.exports: $Exports<'eslint/lib/options'>; -} -declare module 'eslint/lib/rule-tester/index' { - declare module.exports: $Exports<'eslint/lib/rule-tester'>; -} -declare module 'eslint/lib/rule-tester/index.js' { - declare module.exports: $Exports<'eslint/lib/rule-tester'>; -} -declare module 'eslint/lib/rule-tester/rule-tester.js' { - declare module.exports: $Exports<'eslint/lib/rule-tester/rule-tester'>; -} -declare module 'eslint/lib/rules/accessor-pairs.js' { - declare module.exports: $Exports<'eslint/lib/rules/accessor-pairs'>; -} -declare module 'eslint/lib/rules/array-bracket-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/array-bracket-newline'>; -} -declare module 'eslint/lib/rules/array-bracket-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/array-bracket-spacing'>; -} -declare module 'eslint/lib/rules/array-callback-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/array-callback-return'>; -} -declare module 'eslint/lib/rules/array-element-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/array-element-newline'>; -} -declare module 'eslint/lib/rules/arrow-body-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/arrow-body-style'>; -} -declare module 'eslint/lib/rules/arrow-parens.js' { - declare module.exports: $Exports<'eslint/lib/rules/arrow-parens'>; -} -declare module 'eslint/lib/rules/arrow-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/arrow-spacing'>; -} -declare module 'eslint/lib/rules/block-scoped-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/block-scoped-var'>; -} -declare module 'eslint/lib/rules/block-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/block-spacing'>; -} -declare module 'eslint/lib/rules/brace-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/brace-style'>; -} -declare module 'eslint/lib/rules/callback-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/callback-return'>; -} -declare module 'eslint/lib/rules/camelcase.js' { - declare module.exports: $Exports<'eslint/lib/rules/camelcase'>; -} -declare module 'eslint/lib/rules/capitalized-comments.js' { - declare module.exports: $Exports<'eslint/lib/rules/capitalized-comments'>; -} -declare module 'eslint/lib/rules/class-methods-use-this.js' { - declare module.exports: $Exports<'eslint/lib/rules/class-methods-use-this'>; -} -declare module 'eslint/lib/rules/comma-dangle.js' { - declare module.exports: $Exports<'eslint/lib/rules/comma-dangle'>; -} -declare module 'eslint/lib/rules/comma-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/comma-spacing'>; -} -declare module 'eslint/lib/rules/comma-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/comma-style'>; -} -declare module 'eslint/lib/rules/complexity.js' { - declare module.exports: $Exports<'eslint/lib/rules/complexity'>; -} -declare module 'eslint/lib/rules/computed-property-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/computed-property-spacing'>; -} -declare module 'eslint/lib/rules/consistent-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/consistent-return'>; -} -declare module 'eslint/lib/rules/consistent-this.js' { - declare module.exports: $Exports<'eslint/lib/rules/consistent-this'>; -} -declare module 'eslint/lib/rules/constructor-super.js' { - declare module.exports: $Exports<'eslint/lib/rules/constructor-super'>; -} -declare module 'eslint/lib/rules/curly.js' { - declare module.exports: $Exports<'eslint/lib/rules/curly'>; -} -declare module 'eslint/lib/rules/default-case-last.js' { - declare module.exports: $Exports<'eslint/lib/rules/default-case-last'>; -} -declare module 'eslint/lib/rules/default-case.js' { - declare module.exports: $Exports<'eslint/lib/rules/default-case'>; -} -declare module 'eslint/lib/rules/default-param-last.js' { - declare module.exports: $Exports<'eslint/lib/rules/default-param-last'>; -} -declare module 'eslint/lib/rules/dot-location.js' { - declare module.exports: $Exports<'eslint/lib/rules/dot-location'>; -} -declare module 'eslint/lib/rules/dot-notation.js' { - declare module.exports: $Exports<'eslint/lib/rules/dot-notation'>; -} -declare module 'eslint/lib/rules/eol-last.js' { - declare module.exports: $Exports<'eslint/lib/rules/eol-last'>; -} -declare module 'eslint/lib/rules/eqeqeq.js' { - declare module.exports: $Exports<'eslint/lib/rules/eqeqeq'>; -} -declare module 'eslint/lib/rules/for-direction.js' { - declare module.exports: $Exports<'eslint/lib/rules/for-direction'>; -} -declare module 'eslint/lib/rules/func-call-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/func-call-spacing'>; -} -declare module 'eslint/lib/rules/func-name-matching.js' { - declare module.exports: $Exports<'eslint/lib/rules/func-name-matching'>; -} -declare module 'eslint/lib/rules/func-names.js' { - declare module.exports: $Exports<'eslint/lib/rules/func-names'>; -} -declare module 'eslint/lib/rules/func-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/func-style'>; -} -declare module 'eslint/lib/rules/function-call-argument-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/function-call-argument-newline'>; -} -declare module 'eslint/lib/rules/function-paren-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/function-paren-newline'>; -} -declare module 'eslint/lib/rules/generator-star-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/generator-star-spacing'>; -} -declare module 'eslint/lib/rules/getter-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/getter-return'>; -} -declare module 'eslint/lib/rules/global-require.js' { - declare module.exports: $Exports<'eslint/lib/rules/global-require'>; -} -declare module 'eslint/lib/rules/grouped-accessor-pairs.js' { - declare module.exports: $Exports<'eslint/lib/rules/grouped-accessor-pairs'>; -} -declare module 'eslint/lib/rules/guard-for-in.js' { - declare module.exports: $Exports<'eslint/lib/rules/guard-for-in'>; -} -declare module 'eslint/lib/rules/handle-callback-err.js' { - declare module.exports: $Exports<'eslint/lib/rules/handle-callback-err'>; -} -declare module 'eslint/lib/rules/id-blacklist.js' { - declare module.exports: $Exports<'eslint/lib/rules/id-blacklist'>; -} -declare module 'eslint/lib/rules/id-denylist.js' { - declare module.exports: $Exports<'eslint/lib/rules/id-denylist'>; -} -declare module 'eslint/lib/rules/id-length.js' { - declare module.exports: $Exports<'eslint/lib/rules/id-length'>; -} -declare module 'eslint/lib/rules/id-match.js' { - declare module.exports: $Exports<'eslint/lib/rules/id-match'>; -} -declare module 'eslint/lib/rules/implicit-arrow-linebreak.js' { - declare module.exports: $Exports<'eslint/lib/rules/implicit-arrow-linebreak'>; -} -declare module 'eslint/lib/rules/indent-legacy.js' { - declare module.exports: $Exports<'eslint/lib/rules/indent-legacy'>; -} -declare module 'eslint/lib/rules/indent.js' { - declare module.exports: $Exports<'eslint/lib/rules/indent'>; -} -declare module 'eslint/lib/rules/index' { - declare module.exports: $Exports<'eslint/lib/rules'>; -} -declare module 'eslint/lib/rules/index.js' { - declare module.exports: $Exports<'eslint/lib/rules'>; -} -declare module 'eslint/lib/rules/init-declarations.js' { - declare module.exports: $Exports<'eslint/lib/rules/init-declarations'>; -} -declare module 'eslint/lib/rules/jsx-quotes.js' { - declare module.exports: $Exports<'eslint/lib/rules/jsx-quotes'>; -} -declare module 'eslint/lib/rules/key-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/key-spacing'>; -} -declare module 'eslint/lib/rules/keyword-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/keyword-spacing'>; -} -declare module 'eslint/lib/rules/line-comment-position.js' { - declare module.exports: $Exports<'eslint/lib/rules/line-comment-position'>; -} -declare module 'eslint/lib/rules/linebreak-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/linebreak-style'>; -} -declare module 'eslint/lib/rules/lines-around-comment.js' { - declare module.exports: $Exports<'eslint/lib/rules/lines-around-comment'>; -} -declare module 'eslint/lib/rules/lines-around-directive.js' { - declare module.exports: $Exports<'eslint/lib/rules/lines-around-directive'>; -} -declare module 'eslint/lib/rules/lines-between-class-members.js' { - declare module.exports: $Exports<'eslint/lib/rules/lines-between-class-members'>; -} -declare module 'eslint/lib/rules/max-classes-per-file.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-classes-per-file'>; -} -declare module 'eslint/lib/rules/max-depth.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-depth'>; -} -declare module 'eslint/lib/rules/max-len.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-len'>; -} -declare module 'eslint/lib/rules/max-lines-per-function.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-lines-per-function'>; -} -declare module 'eslint/lib/rules/max-lines.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-lines'>; -} -declare module 'eslint/lib/rules/max-nested-callbacks.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-nested-callbacks'>; -} -declare module 'eslint/lib/rules/max-params.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-params'>; -} -declare module 'eslint/lib/rules/max-statements-per-line.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-statements-per-line'>; -} -declare module 'eslint/lib/rules/max-statements.js' { - declare module.exports: $Exports<'eslint/lib/rules/max-statements'>; -} -declare module 'eslint/lib/rules/multiline-comment-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/multiline-comment-style'>; -} -declare module 'eslint/lib/rules/multiline-ternary.js' { - declare module.exports: $Exports<'eslint/lib/rules/multiline-ternary'>; -} -declare module 'eslint/lib/rules/new-cap.js' { - declare module.exports: $Exports<'eslint/lib/rules/new-cap'>; -} -declare module 'eslint/lib/rules/new-parens.js' { - declare module.exports: $Exports<'eslint/lib/rules/new-parens'>; -} -declare module 'eslint/lib/rules/newline-after-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/newline-after-var'>; -} -declare module 'eslint/lib/rules/newline-before-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/newline-before-return'>; -} -declare module 'eslint/lib/rules/newline-per-chained-call.js' { - declare module.exports: $Exports<'eslint/lib/rules/newline-per-chained-call'>; -} -declare module 'eslint/lib/rules/no-alert.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-alert'>; -} -declare module 'eslint/lib/rules/no-array-constructor.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-array-constructor'>; -} -declare module 'eslint/lib/rules/no-async-promise-executor.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-async-promise-executor'>; -} -declare module 'eslint/lib/rules/no-await-in-loop.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-await-in-loop'>; -} -declare module 'eslint/lib/rules/no-bitwise.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-bitwise'>; -} -declare module 'eslint/lib/rules/no-buffer-constructor.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-buffer-constructor'>; -} -declare module 'eslint/lib/rules/no-caller.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-caller'>; -} -declare module 'eslint/lib/rules/no-case-declarations.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-case-declarations'>; -} -declare module 'eslint/lib/rules/no-catch-shadow.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-catch-shadow'>; -} -declare module 'eslint/lib/rules/no-class-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-class-assign'>; -} -declare module 'eslint/lib/rules/no-compare-neg-zero.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-compare-neg-zero'>; -} -declare module 'eslint/lib/rules/no-cond-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-cond-assign'>; -} -declare module 'eslint/lib/rules/no-confusing-arrow.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-confusing-arrow'>; -} -declare module 'eslint/lib/rules/no-console.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-console'>; -} -declare module 'eslint/lib/rules/no-const-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-const-assign'>; -} -declare module 'eslint/lib/rules/no-constant-condition.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-constant-condition'>; -} -declare module 'eslint/lib/rules/no-constructor-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-constructor-return'>; -} -declare module 'eslint/lib/rules/no-continue.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-continue'>; -} -declare module 'eslint/lib/rules/no-control-regex.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-control-regex'>; -} -declare module 'eslint/lib/rules/no-debugger.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-debugger'>; -} -declare module 'eslint/lib/rules/no-delete-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-delete-var'>; -} -declare module 'eslint/lib/rules/no-div-regex.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-div-regex'>; -} -declare module 'eslint/lib/rules/no-dupe-args.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-dupe-args'>; -} -declare module 'eslint/lib/rules/no-dupe-class-members.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-dupe-class-members'>; -} -declare module 'eslint/lib/rules/no-dupe-else-if.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-dupe-else-if'>; -} -declare module 'eslint/lib/rules/no-dupe-keys.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-dupe-keys'>; -} -declare module 'eslint/lib/rules/no-duplicate-case.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-case'>; -} -declare module 'eslint/lib/rules/no-duplicate-imports.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-imports'>; -} -declare module 'eslint/lib/rules/no-else-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-else-return'>; -} -declare module 'eslint/lib/rules/no-empty-character-class.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-empty-character-class'>; -} -declare module 'eslint/lib/rules/no-empty-function.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-empty-function'>; -} -declare module 'eslint/lib/rules/no-empty-pattern.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-empty-pattern'>; -} -declare module 'eslint/lib/rules/no-empty.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-empty'>; -} -declare module 'eslint/lib/rules/no-eq-null.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-eq-null'>; -} -declare module 'eslint/lib/rules/no-eval.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-eval'>; -} -declare module 'eslint/lib/rules/no-ex-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-ex-assign'>; -} -declare module 'eslint/lib/rules/no-extend-native.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extend-native'>; -} -declare module 'eslint/lib/rules/no-extra-bind.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extra-bind'>; -} -declare module 'eslint/lib/rules/no-extra-boolean-cast.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extra-boolean-cast'>; -} -declare module 'eslint/lib/rules/no-extra-label.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extra-label'>; -} -declare module 'eslint/lib/rules/no-extra-parens.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extra-parens'>; -} -declare module 'eslint/lib/rules/no-extra-semi.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-extra-semi'>; -} -declare module 'eslint/lib/rules/no-fallthrough.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-fallthrough'>; -} -declare module 'eslint/lib/rules/no-floating-decimal.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-floating-decimal'>; -} -declare module 'eslint/lib/rules/no-func-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-func-assign'>; -} -declare module 'eslint/lib/rules/no-global-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-global-assign'>; -} -declare module 'eslint/lib/rules/no-implicit-coercion.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-implicit-coercion'>; -} -declare module 'eslint/lib/rules/no-implicit-globals.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-implicit-globals'>; -} -declare module 'eslint/lib/rules/no-implied-eval.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-implied-eval'>; -} -declare module 'eslint/lib/rules/no-import-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-import-assign'>; -} -declare module 'eslint/lib/rules/no-inline-comments.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-inline-comments'>; -} -declare module 'eslint/lib/rules/no-inner-declarations.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-inner-declarations'>; -} -declare module 'eslint/lib/rules/no-invalid-regexp.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-invalid-regexp'>; -} -declare module 'eslint/lib/rules/no-invalid-this.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-invalid-this'>; -} -declare module 'eslint/lib/rules/no-irregular-whitespace.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-irregular-whitespace'>; -} -declare module 'eslint/lib/rules/no-iterator.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-iterator'>; -} -declare module 'eslint/lib/rules/no-label-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-label-var'>; -} -declare module 'eslint/lib/rules/no-labels.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-labels'>; -} -declare module 'eslint/lib/rules/no-lone-blocks.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-lone-blocks'>; -} -declare module 'eslint/lib/rules/no-lonely-if.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-lonely-if'>; -} -declare module 'eslint/lib/rules/no-loop-func.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-loop-func'>; -} -declare module 'eslint/lib/rules/no-loss-of-precision.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-loss-of-precision'>; -} -declare module 'eslint/lib/rules/no-magic-numbers.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-magic-numbers'>; -} -declare module 'eslint/lib/rules/no-misleading-character-class.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-misleading-character-class'>; -} -declare module 'eslint/lib/rules/no-mixed-operators.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-mixed-operators'>; -} -declare module 'eslint/lib/rules/no-mixed-requires.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-mixed-requires'>; -} -declare module 'eslint/lib/rules/no-mixed-spaces-and-tabs.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-mixed-spaces-and-tabs'>; -} -declare module 'eslint/lib/rules/no-multi-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-multi-assign'>; -} -declare module 'eslint/lib/rules/no-multi-spaces.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-multi-spaces'>; -} -declare module 'eslint/lib/rules/no-multi-str.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-multi-str'>; -} -declare module 'eslint/lib/rules/no-multiple-empty-lines.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-multiple-empty-lines'>; -} -declare module 'eslint/lib/rules/no-native-reassign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-native-reassign'>; -} -declare module 'eslint/lib/rules/no-negated-condition.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-negated-condition'>; -} -declare module 'eslint/lib/rules/no-negated-in-lhs.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-negated-in-lhs'>; -} -declare module 'eslint/lib/rules/no-nested-ternary.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-nested-ternary'>; -} -declare module 'eslint/lib/rules/no-new-func.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new-func'>; -} -declare module 'eslint/lib/rules/no-new-object.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new-object'>; -} -declare module 'eslint/lib/rules/no-new-require.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new-require'>; -} -declare module 'eslint/lib/rules/no-new-symbol.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new-symbol'>; -} -declare module 'eslint/lib/rules/no-new-wrappers.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new-wrappers'>; -} -declare module 'eslint/lib/rules/no-new.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-new'>; -} -declare module 'eslint/lib/rules/no-nonoctal-decimal-escape.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-nonoctal-decimal-escape'>; -} -declare module 'eslint/lib/rules/no-obj-calls.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-obj-calls'>; -} -declare module 'eslint/lib/rules/no-octal-escape.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-octal-escape'>; -} -declare module 'eslint/lib/rules/no-octal.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-octal'>; -} -declare module 'eslint/lib/rules/no-param-reassign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-param-reassign'>; -} -declare module 'eslint/lib/rules/no-path-concat.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-path-concat'>; -} -declare module 'eslint/lib/rules/no-plusplus.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-plusplus'>; -} -declare module 'eslint/lib/rules/no-process-env.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-process-env'>; -} -declare module 'eslint/lib/rules/no-process-exit.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-process-exit'>; -} -declare module 'eslint/lib/rules/no-promise-executor-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-promise-executor-return'>; -} -declare module 'eslint/lib/rules/no-proto.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-proto'>; -} -declare module 'eslint/lib/rules/no-prototype-builtins.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-prototype-builtins'>; -} -declare module 'eslint/lib/rules/no-redeclare.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-redeclare'>; -} -declare module 'eslint/lib/rules/no-regex-spaces.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-regex-spaces'>; -} -declare module 'eslint/lib/rules/no-restricted-exports.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-exports'>; -} -declare module 'eslint/lib/rules/no-restricted-globals.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-globals'>; -} -declare module 'eslint/lib/rules/no-restricted-imports.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-imports'>; -} -declare module 'eslint/lib/rules/no-restricted-modules.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-modules'>; -} -declare module 'eslint/lib/rules/no-restricted-properties.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-properties'>; -} -declare module 'eslint/lib/rules/no-restricted-syntax.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-restricted-syntax'>; -} -declare module 'eslint/lib/rules/no-return-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-return-assign'>; -} -declare module 'eslint/lib/rules/no-return-await.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-return-await'>; -} -declare module 'eslint/lib/rules/no-script-url.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-script-url'>; -} -declare module 'eslint/lib/rules/no-self-assign.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-self-assign'>; -} -declare module 'eslint/lib/rules/no-self-compare.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-self-compare'>; -} -declare module 'eslint/lib/rules/no-sequences.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-sequences'>; -} -declare module 'eslint/lib/rules/no-setter-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-setter-return'>; -} -declare module 'eslint/lib/rules/no-shadow-restricted-names.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-shadow-restricted-names'>; -} -declare module 'eslint/lib/rules/no-shadow.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-shadow'>; -} -declare module 'eslint/lib/rules/no-spaced-func.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-spaced-func'>; -} -declare module 'eslint/lib/rules/no-sparse-arrays.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-sparse-arrays'>; -} -declare module 'eslint/lib/rules/no-sync.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-sync'>; -} -declare module 'eslint/lib/rules/no-tabs.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-tabs'>; -} -declare module 'eslint/lib/rules/no-template-curly-in-string.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-template-curly-in-string'>; -} -declare module 'eslint/lib/rules/no-ternary.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-ternary'>; -} -declare module 'eslint/lib/rules/no-this-before-super.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-this-before-super'>; -} -declare module 'eslint/lib/rules/no-throw-literal.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-throw-literal'>; -} -declare module 'eslint/lib/rules/no-trailing-spaces.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-trailing-spaces'>; -} -declare module 'eslint/lib/rules/no-undef-init.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-undef-init'>; -} -declare module 'eslint/lib/rules/no-undef.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-undef'>; -} -declare module 'eslint/lib/rules/no-undefined.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-undefined'>; -} -declare module 'eslint/lib/rules/no-underscore-dangle.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-underscore-dangle'>; -} -declare module 'eslint/lib/rules/no-unexpected-multiline.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unexpected-multiline'>; -} -declare module 'eslint/lib/rules/no-unmodified-loop-condition.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unmodified-loop-condition'>; -} -declare module 'eslint/lib/rules/no-unneeded-ternary.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unneeded-ternary'>; -} -declare module 'eslint/lib/rules/no-unreachable-loop.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unreachable-loop'>; -} -declare module 'eslint/lib/rules/no-unreachable.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unreachable'>; -} -declare module 'eslint/lib/rules/no-unsafe-finally.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-finally'>; -} -declare module 'eslint/lib/rules/no-unsafe-negation.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-negation'>; -} -declare module 'eslint/lib/rules/no-unsafe-optional-chaining.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-optional-chaining'>; -} -declare module 'eslint/lib/rules/no-unused-expressions.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unused-expressions'>; -} -declare module 'eslint/lib/rules/no-unused-labels.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unused-labels'>; -} -declare module 'eslint/lib/rules/no-unused-vars.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-unused-vars'>; -} -declare module 'eslint/lib/rules/no-use-before-define.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-use-before-define'>; -} -declare module 'eslint/lib/rules/no-useless-backreference.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-backreference'>; -} -declare module 'eslint/lib/rules/no-useless-call.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-call'>; -} -declare module 'eslint/lib/rules/no-useless-catch.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-catch'>; -} -declare module 'eslint/lib/rules/no-useless-computed-key.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-computed-key'>; -} -declare module 'eslint/lib/rules/no-useless-concat.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-concat'>; -} -declare module 'eslint/lib/rules/no-useless-constructor.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-constructor'>; -} -declare module 'eslint/lib/rules/no-useless-escape.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-escape'>; -} -declare module 'eslint/lib/rules/no-useless-rename.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-rename'>; -} -declare module 'eslint/lib/rules/no-useless-return.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-useless-return'>; -} -declare module 'eslint/lib/rules/no-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-var'>; -} -declare module 'eslint/lib/rules/no-void.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-void'>; -} -declare module 'eslint/lib/rules/no-warning-comments.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-warning-comments'>; -} -declare module 'eslint/lib/rules/no-whitespace-before-property.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-whitespace-before-property'>; -} -declare module 'eslint/lib/rules/no-with.js' { - declare module.exports: $Exports<'eslint/lib/rules/no-with'>; -} -declare module 'eslint/lib/rules/nonblock-statement-body-position.js' { - declare module.exports: $Exports<'eslint/lib/rules/nonblock-statement-body-position'>; -} -declare module 'eslint/lib/rules/object-curly-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/object-curly-newline'>; -} -declare module 'eslint/lib/rules/object-curly-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/object-curly-spacing'>; -} -declare module 'eslint/lib/rules/object-property-newline.js' { - declare module.exports: $Exports<'eslint/lib/rules/object-property-newline'>; -} -declare module 'eslint/lib/rules/object-shorthand.js' { - declare module.exports: $Exports<'eslint/lib/rules/object-shorthand'>; -} -declare module 'eslint/lib/rules/one-var-declaration-per-line.js' { - declare module.exports: $Exports<'eslint/lib/rules/one-var-declaration-per-line'>; -} -declare module 'eslint/lib/rules/one-var.js' { - declare module.exports: $Exports<'eslint/lib/rules/one-var'>; -} -declare module 'eslint/lib/rules/operator-assignment.js' { - declare module.exports: $Exports<'eslint/lib/rules/operator-assignment'>; -} -declare module 'eslint/lib/rules/operator-linebreak.js' { - declare module.exports: $Exports<'eslint/lib/rules/operator-linebreak'>; -} -declare module 'eslint/lib/rules/padded-blocks.js' { - declare module.exports: $Exports<'eslint/lib/rules/padded-blocks'>; -} -declare module 'eslint/lib/rules/padding-line-between-statements.js' { - declare module.exports: $Exports<'eslint/lib/rules/padding-line-between-statements'>; -} -declare module 'eslint/lib/rules/prefer-arrow-callback.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-arrow-callback'>; -} -declare module 'eslint/lib/rules/prefer-const.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-const'>; -} -declare module 'eslint/lib/rules/prefer-destructuring.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-destructuring'>; -} -declare module 'eslint/lib/rules/prefer-exponentiation-operator.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-exponentiation-operator'>; -} -declare module 'eslint/lib/rules/prefer-named-capture-group.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-named-capture-group'>; -} -declare module 'eslint/lib/rules/prefer-numeric-literals.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-numeric-literals'>; -} -declare module 'eslint/lib/rules/prefer-object-spread.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-object-spread'>; -} -declare module 'eslint/lib/rules/prefer-promise-reject-errors.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-promise-reject-errors'>; -} -declare module 'eslint/lib/rules/prefer-reflect.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-reflect'>; -} -declare module 'eslint/lib/rules/prefer-regex-literals.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-regex-literals'>; -} -declare module 'eslint/lib/rules/prefer-rest-params.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-rest-params'>; -} -declare module 'eslint/lib/rules/prefer-spread.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-spread'>; -} -declare module 'eslint/lib/rules/prefer-template.js' { - declare module.exports: $Exports<'eslint/lib/rules/prefer-template'>; -} -declare module 'eslint/lib/rules/quote-props.js' { - declare module.exports: $Exports<'eslint/lib/rules/quote-props'>; -} -declare module 'eslint/lib/rules/quotes.js' { - declare module.exports: $Exports<'eslint/lib/rules/quotes'>; -} -declare module 'eslint/lib/rules/radix.js' { - declare module.exports: $Exports<'eslint/lib/rules/radix'>; -} -declare module 'eslint/lib/rules/require-atomic-updates.js' { - declare module.exports: $Exports<'eslint/lib/rules/require-atomic-updates'>; -} -declare module 'eslint/lib/rules/require-await.js' { - declare module.exports: $Exports<'eslint/lib/rules/require-await'>; -} -declare module 'eslint/lib/rules/require-jsdoc.js' { - declare module.exports: $Exports<'eslint/lib/rules/require-jsdoc'>; -} -declare module 'eslint/lib/rules/require-unicode-regexp.js' { - declare module.exports: $Exports<'eslint/lib/rules/require-unicode-regexp'>; -} -declare module 'eslint/lib/rules/require-yield.js' { - declare module.exports: $Exports<'eslint/lib/rules/require-yield'>; -} -declare module 'eslint/lib/rules/rest-spread-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/rest-spread-spacing'>; -} -declare module 'eslint/lib/rules/semi-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/semi-spacing'>; -} -declare module 'eslint/lib/rules/semi-style.js' { - declare module.exports: $Exports<'eslint/lib/rules/semi-style'>; -} -declare module 'eslint/lib/rules/semi.js' { - declare module.exports: $Exports<'eslint/lib/rules/semi'>; -} -declare module 'eslint/lib/rules/sort-imports.js' { - declare module.exports: $Exports<'eslint/lib/rules/sort-imports'>; -} -declare module 'eslint/lib/rules/sort-keys.js' { - declare module.exports: $Exports<'eslint/lib/rules/sort-keys'>; -} -declare module 'eslint/lib/rules/sort-vars.js' { - declare module.exports: $Exports<'eslint/lib/rules/sort-vars'>; -} -declare module 'eslint/lib/rules/space-before-blocks.js' { - declare module.exports: $Exports<'eslint/lib/rules/space-before-blocks'>; -} -declare module 'eslint/lib/rules/space-before-function-paren.js' { - declare module.exports: $Exports<'eslint/lib/rules/space-before-function-paren'>; -} -declare module 'eslint/lib/rules/space-in-parens.js' { - declare module.exports: $Exports<'eslint/lib/rules/space-in-parens'>; -} -declare module 'eslint/lib/rules/space-infix-ops.js' { - declare module.exports: $Exports<'eslint/lib/rules/space-infix-ops'>; -} -declare module 'eslint/lib/rules/space-unary-ops.js' { - declare module.exports: $Exports<'eslint/lib/rules/space-unary-ops'>; -} -declare module 'eslint/lib/rules/spaced-comment.js' { - declare module.exports: $Exports<'eslint/lib/rules/spaced-comment'>; -} -declare module 'eslint/lib/rules/strict.js' { - declare module.exports: $Exports<'eslint/lib/rules/strict'>; -} -declare module 'eslint/lib/rules/switch-colon-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/switch-colon-spacing'>; -} -declare module 'eslint/lib/rules/symbol-description.js' { - declare module.exports: $Exports<'eslint/lib/rules/symbol-description'>; -} -declare module 'eslint/lib/rules/template-curly-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/template-curly-spacing'>; -} -declare module 'eslint/lib/rules/template-tag-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/template-tag-spacing'>; -} -declare module 'eslint/lib/rules/unicode-bom.js' { - declare module.exports: $Exports<'eslint/lib/rules/unicode-bom'>; -} -declare module 'eslint/lib/rules/use-isnan.js' { - declare module.exports: $Exports<'eslint/lib/rules/use-isnan'>; -} -declare module 'eslint/lib/rules/utils/ast-utils.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/ast-utils'>; -} -declare module 'eslint/lib/rules/utils/fix-tracker.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/fix-tracker'>; -} -declare module 'eslint/lib/rules/utils/keywords.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/keywords'>; -} -declare module 'eslint/lib/rules/utils/lazy-loading-rule-map.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/lazy-loading-rule-map'>; -} -declare module 'eslint/lib/rules/utils/patterns/letters.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/patterns/letters'>; -} -declare module 'eslint/lib/rules/utils/unicode/index' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode'>; -} -declare module 'eslint/lib/rules/utils/unicode/index.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode'>; -} -declare module 'eslint/lib/rules/utils/unicode/is-combining-character.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode/is-combining-character'>; -} -declare module 'eslint/lib/rules/utils/unicode/is-emoji-modifier.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode/is-emoji-modifier'>; -} -declare module 'eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode/is-regional-indicator-symbol'>; -} -declare module 'eslint/lib/rules/utils/unicode/is-surrogate-pair.js' { - declare module.exports: $Exports<'eslint/lib/rules/utils/unicode/is-surrogate-pair'>; -} -declare module 'eslint/lib/rules/valid-jsdoc.js' { - declare module.exports: $Exports<'eslint/lib/rules/valid-jsdoc'>; -} -declare module 'eslint/lib/rules/valid-typeof.js' { - declare module.exports: $Exports<'eslint/lib/rules/valid-typeof'>; -} -declare module 'eslint/lib/rules/vars-on-top.js' { - declare module.exports: $Exports<'eslint/lib/rules/vars-on-top'>; -} -declare module 'eslint/lib/rules/wrap-iife.js' { - declare module.exports: $Exports<'eslint/lib/rules/wrap-iife'>; -} -declare module 'eslint/lib/rules/wrap-regex.js' { - declare module.exports: $Exports<'eslint/lib/rules/wrap-regex'>; -} -declare module 'eslint/lib/rules/yield-star-spacing.js' { - declare module.exports: $Exports<'eslint/lib/rules/yield-star-spacing'>; -} -declare module 'eslint/lib/rules/yoda.js' { - declare module.exports: $Exports<'eslint/lib/rules/yoda'>; -} -declare module 'eslint/lib/shared/ajv.js' { - declare module.exports: $Exports<'eslint/lib/shared/ajv'>; -} -declare module 'eslint/lib/shared/ast-utils.js' { - declare module.exports: $Exports<'eslint/lib/shared/ast-utils'>; -} -declare module 'eslint/lib/shared/config-validator.js' { - declare module.exports: $Exports<'eslint/lib/shared/config-validator'>; -} -declare module 'eslint/lib/shared/deprecation-warnings.js' { - declare module.exports: $Exports<'eslint/lib/shared/deprecation-warnings'>; -} -declare module 'eslint/lib/shared/logging.js' { - declare module.exports: $Exports<'eslint/lib/shared/logging'>; -} -declare module 'eslint/lib/shared/relative-module-resolver.js' { - declare module.exports: $Exports<'eslint/lib/shared/relative-module-resolver'>; -} -declare module 'eslint/lib/shared/runtime-info.js' { - declare module.exports: $Exports<'eslint/lib/shared/runtime-info'>; -} -declare module 'eslint/lib/shared/traverser.js' { - declare module.exports: $Exports<'eslint/lib/shared/traverser'>; -} -declare module 'eslint/lib/shared/types.js' { - declare module.exports: $Exports<'eslint/lib/shared/types'>; -} -declare module 'eslint/lib/source-code/index' { - declare module.exports: $Exports<'eslint/lib/source-code'>; -} -declare module 'eslint/lib/source-code/index.js' { - declare module.exports: $Exports<'eslint/lib/source-code'>; -} -declare module 'eslint/lib/source-code/source-code.js' { - declare module.exports: $Exports<'eslint/lib/source-code/source-code'>; -} -declare module 'eslint/lib/source-code/token-store/backward-token-comment-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/backward-token-comment-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/backward-token-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/backward-token-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/cursor'>; -} -declare module 'eslint/lib/source-code/token-store/cursors.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/cursors'>; -} -declare module 'eslint/lib/source-code/token-store/decorative-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/decorative-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/filter-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/filter-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/forward-token-comment-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/forward-token-comment-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/forward-token-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/forward-token-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/index' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store'>; -} -declare module 'eslint/lib/source-code/token-store/index.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store'>; -} -declare module 'eslint/lib/source-code/token-store/limit-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/limit-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/padded-token-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/padded-token-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/skip-cursor.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/skip-cursor'>; -} -declare module 'eslint/lib/source-code/token-store/utils.js' { - declare module.exports: $Exports<'eslint/lib/source-code/token-store/utils'>; -} diff --git a/flow-typed/npm/fancy-log_vx.x.x.js b/flow-typed/npm/fancy-log_vx.x.x.js deleted file mode 100644 index 3b2125f5fd..0000000000 --- a/flow-typed/npm/fancy-log_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: bf6cc13bb6545e16ac252ec26d6f4179 -// flow-typed version: <>/fancy-log_v^1.3.3/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'fancy-log' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'fancy-log' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'fancy-log/index' { - declare module.exports: $Exports<'fancy-log'>; -} -declare module 'fancy-log/index.js' { - declare module.exports: $Exports<'fancy-log'>; -} diff --git a/flow-typed/npm/flow-bin_v0.x.x.js b/flow-typed/npm/flow-bin_v0.x.x.js deleted file mode 100644 index fda1f2901a..0000000000 --- a/flow-typed/npm/flow-bin_v0.x.x.js +++ /dev/null @@ -1,6 +0,0 @@ -// flow-typed signature: 28fdff7f110e1c75efab63ff205dda30 -// flow-typed version: c6154227d1/flow-bin_v0.x.x/flow_>=v0.104.x - -declare module "flow-bin" { - declare module.exports: string; -} diff --git a/flow-typed/npm/fs-extra_vx.x.x.js b/flow-typed/npm/fs-extra_vx.x.x.js deleted file mode 100644 index 8def45d8ed..0000000000 --- a/flow-typed/npm/fs-extra_vx.x.x.js +++ /dev/null @@ -1,267 +0,0 @@ -// flow-typed signature: c8770802ff32339973ba521dba6c17e0 -// flow-typed version: <>/fs-extra_v^9.0.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'fs-extra' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'fs-extra' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'fs-extra/lib/copy-sync/copy-sync' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/copy-sync' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/copy/copy' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/copy' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/empty' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure/file' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure/link' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure/symlink-paths' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure/symlink-type' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/ensure/symlink' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/fs' { - declare module.exports: any; -} - -declare module 'fs-extra/lib' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/json' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/json/jsonfile' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/json/output-json-sync' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/json/output-json' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/mkdirs' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/mkdirs/make-dir' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/move-sync' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/move-sync/move-sync' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/move' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/move/move' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/output' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/path-exists' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/remove' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/remove/rimraf' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/util/stat' { - declare module.exports: any; -} - -declare module 'fs-extra/lib/util/utimes' { - declare module.exports: any; -} - -// Filename aliases -declare module 'fs-extra/lib/copy-sync/copy-sync.js' { - declare module.exports: $Exports<'fs-extra/lib/copy-sync/copy-sync'>; -} -declare module 'fs-extra/lib/copy-sync/index' { - declare module.exports: $Exports<'fs-extra/lib/copy-sync'>; -} -declare module 'fs-extra/lib/copy-sync/index.js' { - declare module.exports: $Exports<'fs-extra/lib/copy-sync'>; -} -declare module 'fs-extra/lib/copy/copy.js' { - declare module.exports: $Exports<'fs-extra/lib/copy/copy'>; -} -declare module 'fs-extra/lib/copy/index' { - declare module.exports: $Exports<'fs-extra/lib/copy'>; -} -declare module 'fs-extra/lib/copy/index.js' { - declare module.exports: $Exports<'fs-extra/lib/copy'>; -} -declare module 'fs-extra/lib/empty/index' { - declare module.exports: $Exports<'fs-extra/lib/empty'>; -} -declare module 'fs-extra/lib/empty/index.js' { - declare module.exports: $Exports<'fs-extra/lib/empty'>; -} -declare module 'fs-extra/lib/ensure/file.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure/file'>; -} -declare module 'fs-extra/lib/ensure/index' { - declare module.exports: $Exports<'fs-extra/lib/ensure'>; -} -declare module 'fs-extra/lib/ensure/index.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure'>; -} -declare module 'fs-extra/lib/ensure/link.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure/link'>; -} -declare module 'fs-extra/lib/ensure/symlink-paths.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure/symlink-paths'>; -} -declare module 'fs-extra/lib/ensure/symlink-type.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure/symlink-type'>; -} -declare module 'fs-extra/lib/ensure/symlink.js' { - declare module.exports: $Exports<'fs-extra/lib/ensure/symlink'>; -} -declare module 'fs-extra/lib/fs/index' { - declare module.exports: $Exports<'fs-extra/lib/fs'>; -} -declare module 'fs-extra/lib/fs/index.js' { - declare module.exports: $Exports<'fs-extra/lib/fs'>; -} -declare module 'fs-extra/lib/index' { - declare module.exports: $Exports<'fs-extra/lib'>; -} -declare module 'fs-extra/lib/index.js' { - declare module.exports: $Exports<'fs-extra/lib'>; -} -declare module 'fs-extra/lib/json/index' { - declare module.exports: $Exports<'fs-extra/lib/json'>; -} -declare module 'fs-extra/lib/json/index.js' { - declare module.exports: $Exports<'fs-extra/lib/json'>; -} -declare module 'fs-extra/lib/json/jsonfile.js' { - declare module.exports: $Exports<'fs-extra/lib/json/jsonfile'>; -} -declare module 'fs-extra/lib/json/output-json-sync.js' { - declare module.exports: $Exports<'fs-extra/lib/json/output-json-sync'>; -} -declare module 'fs-extra/lib/json/output-json.js' { - declare module.exports: $Exports<'fs-extra/lib/json/output-json'>; -} -declare module 'fs-extra/lib/mkdirs/index' { - declare module.exports: $Exports<'fs-extra/lib/mkdirs'>; -} -declare module 'fs-extra/lib/mkdirs/index.js' { - declare module.exports: $Exports<'fs-extra/lib/mkdirs'>; -} -declare module 'fs-extra/lib/mkdirs/make-dir.js' { - declare module.exports: $Exports<'fs-extra/lib/mkdirs/make-dir'>; -} -declare module 'fs-extra/lib/move-sync/index' { - declare module.exports: $Exports<'fs-extra/lib/move-sync'>; -} -declare module 'fs-extra/lib/move-sync/index.js' { - declare module.exports: $Exports<'fs-extra/lib/move-sync'>; -} -declare module 'fs-extra/lib/move-sync/move-sync.js' { - declare module.exports: $Exports<'fs-extra/lib/move-sync/move-sync'>; -} -declare module 'fs-extra/lib/move/index' { - declare module.exports: $Exports<'fs-extra/lib/move'>; -} -declare module 'fs-extra/lib/move/index.js' { - declare module.exports: $Exports<'fs-extra/lib/move'>; -} -declare module 'fs-extra/lib/move/move.js' { - declare module.exports: $Exports<'fs-extra/lib/move/move'>; -} -declare module 'fs-extra/lib/output/index' { - declare module.exports: $Exports<'fs-extra/lib/output'>; -} -declare module 'fs-extra/lib/output/index.js' { - declare module.exports: $Exports<'fs-extra/lib/output'>; -} -declare module 'fs-extra/lib/path-exists/index' { - declare module.exports: $Exports<'fs-extra/lib/path-exists'>; -} -declare module 'fs-extra/lib/path-exists/index.js' { - declare module.exports: $Exports<'fs-extra/lib/path-exists'>; -} -declare module 'fs-extra/lib/remove/index' { - declare module.exports: $Exports<'fs-extra/lib/remove'>; -} -declare module 'fs-extra/lib/remove/index.js' { - declare module.exports: $Exports<'fs-extra/lib/remove'>; -} -declare module 'fs-extra/lib/remove/rimraf.js' { - declare module.exports: $Exports<'fs-extra/lib/remove/rimraf'>; -} -declare module 'fs-extra/lib/util/stat.js' { - declare module.exports: $Exports<'fs-extra/lib/util/stat'>; -} -declare module 'fs-extra/lib/util/utimes.js' { - declare module.exports: $Exports<'fs-extra/lib/util/utimes'>; -} diff --git a/flow-typed/npm/glob_v7.1.x.js b/flow-typed/npm/glob_v7.1.x.js deleted file mode 100644 index fafd3388a9..0000000000 --- a/flow-typed/npm/glob_v7.1.x.js +++ /dev/null @@ -1,79 +0,0 @@ -// flow-typed signature: 3ef3befc3c68e2aae85e7f9b5319f077 -// flow-typed version: c6154227d1/glob_v7.1.x/flow_>=v0.104.x - -declare module "glob" { - declare type MinimatchOptions = {| - debug?: boolean, - nobrace?: boolean, - noglobstar?: boolean, - dot?: boolean, - noext?: boolean, - nocase?: boolean, - nonull?: boolean, - matchBase?: boolean, - nocomment?: boolean, - nonegate?: boolean, - flipNegate?: boolean - |}; - - declare type Options = {| - ...MinimatchOptions, - cwd?: string, - root?: string, - nomount?: boolean, - mark?: boolean, - nosort?: boolean, - stat?: boolean, - silent?: boolean, - strict?: boolean, - cache?: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }, - statCache?: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }, - symlinks?: { [path: string]: boolean | void, ... }, - realpathCache?: { [path: string]: string, ... }, - sync?: boolean, - nounique?: boolean, - nodir?: boolean, - ignore?: string | $ReadOnlyArray, - follow?: boolean, - realpath?: boolean, - absolute?: boolean - |}; - - /** - * Called when an error occurs, or matches are found - * err - * matches: filenames found matching the pattern - */ - declare type CallBack = (err: ?Error, matches: Array) => void; - - declare class Glob extends events$EventEmitter { - constructor(pattern: string): this; - constructor(pattern: string, callback: CallBack): this; - constructor(pattern: string, options: Options, callback: CallBack): this; - - minimatch: {...}; - options: Options; - aborted: boolean; - cache: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }; - statCache: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }; - symlinks: { [path: string]: boolean | void, ... }; - realpathCache: { [path: string]: string, ... }; - found: Array; - - pause(): void; - resume(): void; - abort(): void; - } - - declare class GlobModule { - Glob: Class; - - (pattern: string, callback: CallBack): void; - (pattern: string, options: Options, callback: CallBack): void; - - hasMagic(pattern: string, options?: Options): boolean; - sync(pattern: string, options?: Options): Array; - } - - declare module.exports: GlobModule; -} diff --git a/flow-typed/npm/globby_vx.x.x.js b/flow-typed/npm/globby_vx.x.x.js deleted file mode 100644 index 255b05cd5d..0000000000 --- a/flow-typed/npm/globby_vx.x.x.js +++ /dev/null @@ -1,45 +0,0 @@ -// flow-typed signature: 7f5c373bea45b94a4ef646ab067a663a -// flow-typed version: <>/globby_v^11.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'globby' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'globby' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'globby/gitignore' { - declare module.exports: any; -} - -declare module 'globby/stream-utils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'globby/gitignore.js' { - declare module.exports: $Exports<'globby/gitignore'>; -} -declare module 'globby/index' { - declare module.exports: $Exports<'globby'>; -} -declare module 'globby/index.js' { - declare module.exports: $Exports<'globby'>; -} -declare module 'globby/stream-utils.js' { - declare module.exports: $Exports<'globby/stream-utils'>; -} diff --git a/flow-typed/npm/gulp_vx.x.x.js b/flow-typed/npm/gulp_vx.x.x.js deleted file mode 100644 index 873706d6e1..0000000000 --- a/flow-typed/npm/gulp_vx.x.x.js +++ /dev/null @@ -1,38 +0,0 @@ -// flow-typed signature: 5b0df4ec4c56cf96d43d6d30d2052f9e -// flow-typed version: <>/gulp_v^4.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'gulp' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'gulp' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'gulp/bin/gulp' { - declare module.exports: any; -} - -// Filename aliases -declare module 'gulp/bin/gulp.js' { - declare module.exports: $Exports<'gulp/bin/gulp'>; -} -declare module 'gulp/index' { - declare module.exports: $Exports<'gulp'>; -} -declare module 'gulp/index.js' { - declare module.exports: $Exports<'gulp'>; -} diff --git a/flow-typed/npm/husky_vx.x.x.js b/flow-typed/npm/husky_vx.x.x.js deleted file mode 100644 index d679520cfa..0000000000 --- a/flow-typed/npm/husky_vx.x.x.js +++ /dev/null @@ -1,167 +0,0 @@ -// flow-typed signature: d2151c27cc36ba017cf5e50db8e96ee4 -// flow-typed version: <>/husky_v^4.3.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'husky' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'husky' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'husky/bin/run' { - declare module.exports: any; -} - -declare module 'husky/husky' { - declare module.exports: any; -} - -declare module 'husky/lib/checkGitDirEnv' { - declare module.exports: any; -} - -declare module 'husky/lib/debug' { - declare module.exports: any; -} - -declare module 'husky/lib/getConf' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/bin' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/checkGitVersion' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/getBanner' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/gitRevParse' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/hooks' { - declare module.exports: any; -} - -declare module 'husky/lib/installer' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/is' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/localScript' { - declare module.exports: any; -} - -declare module 'husky/lib/installer/mainScript' { - declare module.exports: any; -} - -declare module 'husky/lib/read-pkg' { - declare module.exports: any; -} - -declare module 'husky/lib/runner/bin' { - declare module.exports: any; -} - -declare module 'husky/lib/runner' { - declare module.exports: any; -} - -declare module 'husky/lib/upgrader/bin' { - declare module.exports: any; -} - -declare module 'husky/lib/upgrader' { - declare module.exports: any; -} - -// Filename aliases -declare module 'husky/bin/run.js' { - declare module.exports: $Exports<'husky/bin/run'>; -} -declare module 'husky/husky.js' { - declare module.exports: $Exports<'husky/husky'>; -} -declare module 'husky/lib/checkGitDirEnv.js' { - declare module.exports: $Exports<'husky/lib/checkGitDirEnv'>; -} -declare module 'husky/lib/debug.js' { - declare module.exports: $Exports<'husky/lib/debug'>; -} -declare module 'husky/lib/getConf.js' { - declare module.exports: $Exports<'husky/lib/getConf'>; -} -declare module 'husky/lib/installer/bin.js' { - declare module.exports: $Exports<'husky/lib/installer/bin'>; -} -declare module 'husky/lib/installer/checkGitVersion.js' { - declare module.exports: $Exports<'husky/lib/installer/checkGitVersion'>; -} -declare module 'husky/lib/installer/getBanner.js' { - declare module.exports: $Exports<'husky/lib/installer/getBanner'>; -} -declare module 'husky/lib/installer/gitRevParse.js' { - declare module.exports: $Exports<'husky/lib/installer/gitRevParse'>; -} -declare module 'husky/lib/installer/hooks.js' { - declare module.exports: $Exports<'husky/lib/installer/hooks'>; -} -declare module 'husky/lib/installer/index' { - declare module.exports: $Exports<'husky/lib/installer'>; -} -declare module 'husky/lib/installer/index.js' { - declare module.exports: $Exports<'husky/lib/installer'>; -} -declare module 'husky/lib/installer/is.js' { - declare module.exports: $Exports<'husky/lib/installer/is'>; -} -declare module 'husky/lib/installer/localScript.js' { - declare module.exports: $Exports<'husky/lib/installer/localScript'>; -} -declare module 'husky/lib/installer/mainScript.js' { - declare module.exports: $Exports<'husky/lib/installer/mainScript'>; -} -declare module 'husky/lib/read-pkg.js' { - declare module.exports: $Exports<'husky/lib/read-pkg'>; -} -declare module 'husky/lib/runner/bin.js' { - declare module.exports: $Exports<'husky/lib/runner/bin'>; -} -declare module 'husky/lib/runner/index' { - declare module.exports: $Exports<'husky/lib/runner'>; -} -declare module 'husky/lib/runner/index.js' { - declare module.exports: $Exports<'husky/lib/runner'>; -} -declare module 'husky/lib/upgrader/bin.js' { - declare module.exports: $Exports<'husky/lib/upgrader/bin'>; -} -declare module 'husky/lib/upgrader/index' { - declare module.exports: $Exports<'husky/lib/upgrader'>; -} -declare module 'husky/lib/upgrader/index.js' { - declare module.exports: $Exports<'husky/lib/upgrader'>; -} diff --git a/flow-typed/npm/isomorphic-unfetch_v3.x.x.js b/flow-typed/npm/isomorphic-unfetch_v3.x.x.js deleted file mode 100644 index ceaff69b68..0000000000 --- a/flow-typed/npm/isomorphic-unfetch_v3.x.x.js +++ /dev/null @@ -1,7 +0,0 @@ -// flow-typed signature: 2ddf92ef847d86157568bfa6c10606ac -// flow-typed version: c6154227d1/isomorphic-unfetch_v3.x.x/flow_>=v0.104.x - - -declare module 'isomorphic-unfetch' { - declare module.exports: (input: string | Request | URL, init?: RequestOptions) => Promise; -} diff --git a/flow-typed/npm/jest-matchmedia-mock_vx.x.x.js b/flow-typed/npm/jest-matchmedia-mock_vx.x.x.js deleted file mode 100644 index 8e570bb80e..0000000000 --- a/flow-typed/npm/jest-matchmedia-mock_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 2ba7bb5675fcf0035fcb1a2d8e8091cb -// flow-typed version: <>/jest-matchmedia-mock_v^1.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'jest-matchmedia-mock' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'jest-matchmedia-mock' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'jest-matchmedia-mock/dist/matchmedia-mock' { - declare module.exports: any; -} - -// Filename aliases -declare module 'jest-matchmedia-mock/dist/matchmedia-mock.js' { - declare module.exports: $Exports<'jest-matchmedia-mock/dist/matchmedia-mock'>; -} diff --git a/flow-typed/npm/jest-styled-components_vx.x.x.js b/flow-typed/npm/jest-styled-components_vx.x.x.js deleted file mode 100644 index 0863b25d6b..0000000000 --- a/flow-typed/npm/jest-styled-components_vx.x.x.js +++ /dev/null @@ -1,83 +0,0 @@ -// flow-typed signature: a3073b8b544aed77d19a6a157cd99c1c -// flow-typed version: <>/jest-styled-components_v^6.2.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'jest-styled-components' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'jest-styled-components' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'jest-styled-components/native' { - declare module.exports: any; -} - -declare module 'jest-styled-components/serializer' { - declare module.exports: any; -} - -declare module 'jest-styled-components/src' { - declare module.exports: any; -} - -declare module 'jest-styled-components/src/native/toHaveStyleRule' { - declare module.exports: any; -} - -declare module 'jest-styled-components/src/styleSheetSerializer' { - declare module.exports: any; -} - -declare module 'jest-styled-components/src/toHaveStyleRule' { - declare module.exports: any; -} - -declare module 'jest-styled-components/src/utils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'jest-styled-components/native/index' { - declare module.exports: $Exports<'jest-styled-components/native'>; -} -declare module 'jest-styled-components/native/index.js' { - declare module.exports: $Exports<'jest-styled-components/native'>; -} -declare module 'jest-styled-components/serializer/index' { - declare module.exports: $Exports<'jest-styled-components/serializer'>; -} -declare module 'jest-styled-components/serializer/index.js' { - declare module.exports: $Exports<'jest-styled-components/serializer'>; -} -declare module 'jest-styled-components/src/index' { - declare module.exports: $Exports<'jest-styled-components/src'>; -} -declare module 'jest-styled-components/src/index.js' { - declare module.exports: $Exports<'jest-styled-components/src'>; -} -declare module 'jest-styled-components/src/native/toHaveStyleRule.js' { - declare module.exports: $Exports<'jest-styled-components/src/native/toHaveStyleRule'>; -} -declare module 'jest-styled-components/src/styleSheetSerializer.js' { - declare module.exports: $Exports<'jest-styled-components/src/styleSheetSerializer'>; -} -declare module 'jest-styled-components/src/toHaveStyleRule.js' { - declare module.exports: $Exports<'jest-styled-components/src/toHaveStyleRule'>; -} -declare module 'jest-styled-components/src/utils.js' { - declare module.exports: $Exports<'jest-styled-components/src/utils'>; -} diff --git a/flow-typed/npm/jest_v26.x.x.js b/flow-typed/npm/jest_v26.x.x.js deleted file mode 100644 index 4844206366..0000000000 --- a/flow-typed/npm/jest_v26.x.x.js +++ /dev/null @@ -1,1226 +0,0 @@ -// flow-typed signature: e3af2fa52d8b68d50f28a98fe6a6d971 -// flow-typed version: 76f8523085/jest_v26.x.x/flow_>=v0.134.x - -type JestMockFn, TReturn> = { - (...args: TArguments): TReturn, - /** - * An object for introspecting mock calls - */ - mock: { - /** - * An array that represents all calls that have been made into this mock - * function. Each call is represented by an array of arguments that were - * passed during the call. - */ - calls: Array, - /** - * An array that contains all the object instances that have been - * instantiated from this mock function. - */ - instances: Array, - /** - * An array that contains all the object results that have been - * returned by this mock function call - */ - results: Array<{ - isThrow: boolean, - value: TReturn, - ... - }>, - ... - }, - /** - * Resets all information stored in the mockFn.mock.calls and - * mockFn.mock.instances arrays. Often this is useful when you want to clean - * up a mock's usage data between two assertions. - */ - mockClear(): void, - /** - * Resets all information stored in the mock. This is useful when you want to - * completely restore a mock back to its initial state. - */ - mockReset(): void, - /** - * Removes the mock and restores the initial implementation. This is useful - * when you want to mock functions in certain test cases and restore the - * original implementation in others. Beware that mockFn.mockRestore only - * works when mock was created with jest.spyOn. Thus you have to take care of - * restoration yourself when manually assigning jest.fn(). - */ - mockRestore(): void, - /** - * Accepts a function that should be used as the implementation of the mock. - * The mock itself will still record all calls that go into and instances - * that come from itself -- the only difference is that the implementation - * will also be executed when the mock is called. - */ - mockImplementation( - fn: (...args: TArguments) => TReturn - ): JestMockFn, - /** - * Accepts a function that will be used as an implementation of the mock for - * one call to the mocked function. Can be chained so that multiple function - * calls produce different results. - */ - mockImplementationOnce( - fn: (...args: TArguments) => TReturn - ): JestMockFn, - /** - * Accepts a string to use in test result output in place of "jest.fn()" to - * indicate which mock function is being referenced. - */ - mockName(name: string): JestMockFn, - /** - * Just a simple sugar function for returning `this` - */ - mockReturnThis(): void, - /** - * Accepts a value that will be returned whenever the mock function is called. - */ - mockReturnValue(value: TReturn): JestMockFn, - /** - * Sugar for only returning a value once inside your mock - */ - mockReturnValueOnce(value: TReturn): JestMockFn, - /** - * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value)) - */ - mockResolvedValue(value: TReturn): JestMockFn>, - /** - * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value)) - */ - mockResolvedValueOnce( - value: TReturn - ): JestMockFn>, - /** - * Sugar for jest.fn().mockImplementation(() => Promise.reject(value)) - */ - mockRejectedValue(value: TReturn): JestMockFn>, - /** - * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value)) - */ - mockRejectedValueOnce(value: TReturn): JestMockFn>, - ... -}; - -type JestAsymmetricEqualityType = { - /** - * A custom Jasmine equality tester - */ - asymmetricMatch(value: mixed): boolean, - ... -}; - -type JestCallsType = { - allArgs(): mixed, - all(): mixed, - any(): boolean, - count(): number, - first(): mixed, - mostRecent(): mixed, - reset(): void, - ... -}; - -type JestClockType = { - install(): void, - mockDate(date: Date): void, - tick(milliseconds?: number): void, - uninstall(): void, - ... -}; - -type JestMatcherResult = { - message?: string | (() => string), - pass: boolean, - ... -}; - -type JestMatcher = ( - received: any, - ...actual: Array -) => JestMatcherResult | Promise; - -type JestPromiseType = { - /** - * Use rejects to unwrap the reason of a rejected promise so any other - * matcher can be chained. If the promise is fulfilled the assertion fails. - */ - rejects: JestExpectType, - /** - * Use resolves to unwrap the value of a fulfilled promise so any other - * matcher can be chained. If the promise is rejected the assertion fails. - */ - resolves: JestExpectType, - ... -}; - -/** - * Jest allows functions and classes to be used as test names in test() and - * describe() - */ -type JestTestName = string | Function; - -/** - * Plugin: jest-styled-components - */ - -type JestStyledComponentsMatcherValue = - | string - | JestAsymmetricEqualityType - | RegExp - | typeof undefined; - -type JestStyledComponentsMatcherOptions = { - media?: string, - modifier?: string, - supports?: string, - ... -}; - -type JestStyledComponentsMatchersType = { - toHaveStyleRule( - property: string, - value: JestStyledComponentsMatcherValue, - options?: JestStyledComponentsMatcherOptions - ): void, - ... -}; - -/** - * Plugin: jest-enzyme - */ -type EnzymeMatchersType = { - // 5.x - toBeEmpty(): void, - toBePresent(): void, - // 6.x - toBeChecked(): void, - toBeDisabled(): void, - toBeEmptyRender(): void, - toContainMatchingElement(selector: string): void, - toContainMatchingElements(n: number, selector: string): void, - toContainExactlyOneMatchingElement(selector: string): void, - toContainReact(element: React$Element): void, - toExist(): void, - toHaveClassName(className: string): void, - toHaveHTML(html: string): void, - toHaveProp: ((propKey: string, propValue?: any) => void) & - ((props: { ... }) => void), - toHaveRef(refName: string): void, - toHaveState: ((stateKey: string, stateValue?: any) => void) & - ((state: { ... }) => void), - toHaveStyle: ((styleKey: string, styleValue?: any) => void) & - ((style: { ... }) => void), - toHaveTagName(tagName: string): void, - toHaveText(text: string): void, - toHaveValue(value: any): void, - toIncludeText(text: string): void, - toMatchElement( - element: React$Element, - options?: {| ignoreProps?: boolean, verbose?: boolean |} - ): void, - toMatchSelector(selector: string): void, - // 7.x - toHaveDisplayName(name: string): void, - ... -}; - -// DOM testing library extensions (jest-dom) -// https://github.com/testing-library/jest-dom -type DomTestingLibraryType = { - /** - * @deprecated - */ - toBeInTheDOM(container?: HTMLElement): void, - - // 4.x - toBeInTheDocument(): void, - toBeVisible(): void, - toBeEmpty(): void, - toBeDisabled(): void, - toBeEnabled(): void, - toBeInvalid(): void, - toBeRequired(): void, - toBeValid(): void, - toContainElement(element: HTMLElement | null): void, - toContainHTML(htmlText: string): void, - toHaveAttribute(attr: string, value?: any): void, - toHaveClass(...classNames: string[]): void, - toHaveFocus(): void, - toHaveFormValues(expectedValues: { [name: string]: any, ... }): void, - toHaveStyle(css: string | { [name: string]: any, ... }): void, - toHaveTextContent( - text: string | RegExp, - options?: {| normalizeWhitespace: boolean |} - ): void, - toHaveValue(value?: string | string[] | number): void, - - // 5.x - toHaveDisplayValue(value: string | string[]): void, - toBeChecked(): void, - ... -}; - -// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers -type JestJQueryMatchersType = { - toExist(): void, - toHaveLength(len: number): void, - toHaveId(id: string): void, - toHaveClass(className: string): void, - toHaveTag(tag: string): void, - toHaveAttr(key: string, val?: any): void, - toHaveProp(key: string, val?: any): void, - toHaveText(text: string | RegExp): void, - toHaveData(key: string, val?: any): void, - toHaveValue(val: any): void, - toHaveCss(css: { [key: string]: any, ... }): void, - toBeChecked(): void, - toBeDisabled(): void, - toBeEmpty(): void, - toBeHidden(): void, - toBeSelected(): void, - toBeVisible(): void, - toBeFocused(): void, - toBeInDom(): void, - toBeMatchedBy(sel: string): void, - toHaveDescendant(sel: string): void, - toHaveDescendantWithText(sel: string, text: string | RegExp): void, - ... -}; - -// Jest Extended Matchers: https://github.com/jest-community/jest-extended -type JestExtendedMatchersType = { - /** - * Note: Currently unimplemented - * Passing assertion - * - * @param {String} message - */ - // pass(message: string): void; - - /** - * Note: Currently unimplemented - * Failing assertion - * - * @param {String} message - */ - // fail(message: string): void; - - /** - * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty. - */ - toBeEmpty(): void, - /** - * Use .toBeOneOf when checking if a value is a member of a given Array. - * @param {Array.<*>} members - */ - toBeOneOf(members: any[]): void, - /** - * Use `.toBeNil` when checking a value is `null` or `undefined`. - */ - toBeNil(): void, - /** - * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`. - * @param {Function} predicate - */ - toSatisfy(predicate: (n: any) => boolean): void, - /** - * Use `.toBeArray` when checking if a value is an `Array`. - */ - toBeArray(): void, - /** - * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x. - * @param {Number} x - */ - toBeArrayOfSize(x: number): void, - /** - * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set. - * @param {Array.<*>} members - */ - toIncludeAllMembers(members: any[]): void, - /** - * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set. - * @param {Array.<*>} members - */ - toIncludeAnyMembers(members: any[]): void, - /** - * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array. - * @param {Function} predicate - */ - toSatisfyAll(predicate: (n: any) => boolean): void, - /** - * Use `.toBeBoolean` when checking if a value is a `Boolean`. - */ - toBeBoolean(): void, - /** - * Use `.toBeTrue` when checking a value is equal (===) to `true`. - */ - toBeTrue(): void, - /** - * Use `.toBeFalse` when checking a value is equal (===) to `false`. - */ - toBeFalse(): void, - /** - * Use .toBeDate when checking if a value is a Date. - */ - toBeDate(): void, - /** - * Use `.toBeFunction` when checking if a value is a `Function`. - */ - toBeFunction(): void, - /** - * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. - * - * Note: Required Jest version >22 - * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same - * - * @param {Mock} mock - */ - toHaveBeenCalledBefore(mock: JestMockFn): void, - /** - * Use `.toBeNumber` when checking if a value is a `Number`. - */ - toBeNumber(): void, - /** - * Use `.toBeNaN` when checking a value is `NaN`. - */ - toBeNaN(): void, - /** - * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`. - */ - toBeFinite(): void, - /** - * Use `.toBePositive` when checking if a value is a positive `Number`. - */ - toBePositive(): void, - /** - * Use `.toBeNegative` when checking if a value is a negative `Number`. - */ - toBeNegative(): void, - /** - * Use `.toBeEven` when checking if a value is an even `Number`. - */ - toBeEven(): void, - /** - * Use `.toBeOdd` when checking if a value is an odd `Number`. - */ - toBeOdd(): void, - /** - * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive). - * - * @param {Number} start - * @param {Number} end - */ - toBeWithin(start: number, end: number): void, - /** - * Use `.toBeObject` when checking if a value is an `Object`. - */ - toBeObject(): void, - /** - * Use `.toContainKey` when checking if an object contains the provided key. - * - * @param {String} key - */ - toContainKey(key: string): void, - /** - * Use `.toContainKeys` when checking if an object has all of the provided keys. - * - * @param {Array.} keys - */ - toContainKeys(keys: string[]): void, - /** - * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys. - * - * @param {Array.} keys - */ - toContainAllKeys(keys: string[]): void, - /** - * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys. - * - * @param {Array.} keys - */ - toContainAnyKeys(keys: string[]): void, - /** - * Use `.toContainValue` when checking if an object contains the provided value. - * - * @param {*} value - */ - toContainValue(value: any): void, - /** - * Use `.toContainValues` when checking if an object contains all of the provided values. - * - * @param {Array.<*>} values - */ - toContainValues(values: any[]): void, - /** - * Use `.toContainAllValues` when checking if an object only contains all of the provided values. - * - * @param {Array.<*>} values - */ - toContainAllValues(values: any[]): void, - /** - * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values. - * - * @param {Array.<*>} values - */ - toContainAnyValues(values: any[]): void, - /** - * Use `.toContainEntry` when checking if an object contains the provided entry. - * - * @param {Array.} entry - */ - toContainEntry(entry: [string, string]): void, - /** - * Use `.toContainEntries` when checking if an object contains all of the provided entries. - * - * @param {Array.>} entries - */ - toContainEntries(entries: [string, string][]): void, - /** - * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries. - * - * @param {Array.>} entries - */ - toContainAllEntries(entries: [string, string][]): void, - /** - * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries. - * - * @param {Array.>} entries - */ - toContainAnyEntries(entries: [string, string][]): void, - /** - * Use `.toBeExtensible` when checking if an object is extensible. - */ - toBeExtensible(): void, - /** - * Use `.toBeFrozen` when checking if an object is frozen. - */ - toBeFrozen(): void, - /** - * Use `.toBeSealed` when checking if an object is sealed. - */ - toBeSealed(): void, - /** - * Use `.toBeString` when checking if a value is a `String`. - */ - toBeString(): void, - /** - * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings. - * - * @param {String} string - */ - toEqualCaseInsensitive(string: string): void, - /** - * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix. - * - * @param {String} prefix - */ - toStartWith(prefix: string): void, - /** - * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix. - * - * @param {String} suffix - */ - toEndWith(suffix: string): void, - /** - * Use `.toInclude` when checking if a `String` includes the given `String` substring. - * - * @param {String} substring - */ - toInclude(substring: string): void, - /** - * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times. - * - * @param {String} substring - * @param {Number} times - */ - toIncludeRepeated(substring: string, times: number): void, - /** - * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings. - * - * @param {Array.} substring - */ - toIncludeMultiple(substring: string[]): void, - ... -}; - -// Diffing snapshot utility for Jest (snapshot-diff) -// https://github.com/jest-community/snapshot-diff -type SnapshotDiffType = { - /** - * Compare the difference between the actual in the `expect()` - * vs the object inside `valueB` with some extra options. - */ - toMatchDiffSnapshot( - valueB: any, - options?: {| - expand?: boolean, - colors?: boolean, - contextLines?: number, - stablePatchmarks?: boolean, - aAnnotation?: string, - bAnnotation?: string, - |}, - testName?: string - ): void, - ... -}; - -interface JestExpectType { - not: JestExpectType & - EnzymeMatchersType & - DomTestingLibraryType & - JestJQueryMatchersType & - JestStyledComponentsMatchersType & - JestExtendedMatchersType & - SnapshotDiffType; - /** - * If you have a mock function, you can use .lastCalledWith to test what - * arguments it was last called with. - */ - lastCalledWith(...args: Array): void; - /** - * toBe just checks that a value is what you expect. It uses === to check - * strict equality. - */ - toBe(value: any): void; - /** - * Use .toBeCalledWith to ensure that a mock function was called with - * specific arguments. - */ - toBeCalledWith(...args: Array): void; - /** - * Using exact equality with floating point numbers is a bad idea. Rounding - * means that intuitive things fail. - */ - toBeCloseTo(num: number, delta: any): void; - /** - * Use .toBeDefined to check that a variable is not undefined. - */ - toBeDefined(): void; - /** - * Use .toBeFalsy when you don't care what a value is, you just want to - * ensure a value is false in a boolean context. - */ - toBeFalsy(): void; - /** - * To compare floating point numbers, you can use toBeGreaterThan. - */ - toBeGreaterThan(number: number): void; - /** - * To compare floating point numbers, you can use toBeGreaterThanOrEqual. - */ - toBeGreaterThanOrEqual(number: number): void; - /** - * To compare floating point numbers, you can use toBeLessThan. - */ - toBeLessThan(number: number): void; - /** - * To compare floating point numbers, you can use toBeLessThanOrEqual. - */ - toBeLessThanOrEqual(number: number): void; - /** - * Use .toBeInstanceOf(Class) to check that an object is an instance of a - * class. - */ - toBeInstanceOf(cls: Class<*>): void; - /** - * .toBeNull() is the same as .toBe(null) but the error messages are a bit - * nicer. - */ - toBeNull(): void; - /** - * Use .toBeTruthy when you don't care what a value is, you just want to - * ensure a value is true in a boolean context. - */ - toBeTruthy(): void; - /** - * Use .toBeUndefined to check that a variable is undefined. - */ - toBeUndefined(): void; - /** - * Use .toContain when you want to check that an item is in a list. For - * testing the items in the list, this uses ===, a strict equality check. - */ - toContain(item: any): void; - /** - * Use .toContainEqual when you want to check that an item is in a list. For - * testing the items in the list, this matcher recursively checks the - * equality of all fields, rather than checking for object identity. - */ - toContainEqual(item: any): void; - /** - * Use .toEqual when you want to check that two objects have the same value. - * This matcher recursively checks the equality of all fields, rather than - * checking for object identity. - */ - toEqual(value: any): void; - /** - * Use .toHaveBeenCalled to ensure that a mock function got called. - */ - toHaveBeenCalled(): void; - toBeCalled(): void; - /** - * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact - * number of times. - */ - toHaveBeenCalledTimes(number: number): void; - toBeCalledTimes(number: number): void; - /** - * - */ - toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void; - nthCalledWith(nthCall: number, ...args: Array): void; - /** - * - */ - toHaveReturned(): void; - toReturn(): void; - /** - * - */ - toHaveReturnedTimes(number: number): void; - toReturnTimes(number: number): void; - /** - * - */ - toHaveReturnedWith(value: any): void; - toReturnWith(value: any): void; - /** - * - */ - toHaveLastReturnedWith(value: any): void; - lastReturnedWith(value: any): void; - /** - * - */ - toHaveNthReturnedWith(nthCall: number, value: any): void; - nthReturnedWith(nthCall: number, value: any): void; - /** - * Use .toHaveBeenCalledWith to ensure that a mock function was called with - * specific arguments. - */ - toHaveBeenCalledWith(...args: Array): void; - toBeCalledWith(...args: Array): void; - /** - * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called - * with specific arguments. - */ - toHaveBeenLastCalledWith(...args: Array): void; - lastCalledWith(...args: Array): void; - /** - * Check that an object has a .length property and it is set to a certain - * numeric value. - */ - toHaveLength(number: number): void; - /** - * - */ - toHaveProperty(propPath: string | $ReadOnlyArray, value?: any): void; - /** - * Use .toMatch to check that a string matches a regular expression or string. - */ - toMatch(regexpOrString: RegExp | string): void; - /** - * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. - */ - toMatchObject(object: Object | Array): void; - /** - * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object. - */ - toStrictEqual(value: any): void; - /** - * This ensures that an Object matches the most recent snapshot. - */ - toMatchSnapshot(propertyMatchers?: any, name?: string): void; - /** - * This ensures that an Object matches the most recent snapshot. - */ - toMatchSnapshot(name: string): void; - - toMatchInlineSnapshot(snapshot?: string): void; - toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void; - /** - * Use .toThrow to test that a function throws when it is called. - * If you want to test that a specific error gets thrown, you can provide an - * argument to toThrow. The argument can be a string for the error message, - * a class for the error, or a regex that should match the error. - * - * Alias: .toThrowError - */ - toThrow(message?: string | Error | Class | RegExp): void; - toThrowError(message?: string | Error | Class | RegExp): void; - /** - * Use .toThrowErrorMatchingSnapshot to test that a function throws a error - * matching the most recent snapshot when it is called. - */ - toThrowErrorMatchingSnapshot(): void; - toThrowErrorMatchingInlineSnapshot(snapshot?: string): void; -} - -type JestObjectType = { - /** - * Disables automatic mocking in the module loader. - * - * After this method is called, all `require()`s will return the real - * versions of each module (rather than a mocked version). - */ - disableAutomock(): JestObjectType, - /** - * An un-hoisted version of disableAutomock - */ - autoMockOff(): JestObjectType, - /** - * Enables automatic mocking in the module loader. - */ - enableAutomock(): JestObjectType, - /** - * An un-hoisted version of enableAutomock - */ - autoMockOn(): JestObjectType, - /** - * Clears the mock.calls and mock.instances properties of all mocks. - * Equivalent to calling .mockClear() on every mocked function. - */ - clearAllMocks(): JestObjectType, - /** - * Resets the state of all mocks. Equivalent to calling .mockReset() on every - * mocked function. - */ - resetAllMocks(): JestObjectType, - /** - * Restores all mocks back to their original value. - */ - restoreAllMocks(): JestObjectType, - /** - * Removes any pending timers from the timer system. - */ - clearAllTimers(): void, - /** - * Returns the number of fake timers still left to run. - */ - getTimerCount(): number, - /** - * Set the current system time used by fake timers. - * Simulates a user changing the system clock while your program is running. - * It affects the current time but it does not in itself cause - * e.g. timers to fire; they will fire exactly as they would have done - * without the call to jest.setSystemTime(). - */ - setSystemTime(now?: number | Date): void, - /** - * The same as `mock` but not moved to the top of the expectation by - * babel-jest. - */ - doMock(moduleName: string, moduleFactory?: any): JestObjectType, - /** - * The same as `unmock` but not moved to the top of the expectation by - * babel-jest. - */ - dontMock(moduleName: string): JestObjectType, - /** - * Returns a new, unused mock function. Optionally takes a mock - * implementation. - */ - fn, TReturn>( - implementation?: (...args: TArguments) => TReturn - ): JestMockFn, - /** - * Determines if the given function is a mocked function. - */ - isMockFunction(fn: Function): boolean, - /** - * Given the name of a module, use the automatic mocking system to generate a - * mocked version of the module for you. - */ - genMockFromModule(moduleName: string): any, - /** - * Mocks a module with an auto-mocked version when it is being required. - * - * The second argument can be used to specify an explicit module factory that - * is being run instead of using Jest's automocking feature. - * - * The third argument can be used to create virtual mocks -- mocks of modules - * that don't exist anywhere in the system. - */ - mock( - moduleName: string, - moduleFactory?: any, - options?: Object - ): JestObjectType, - /** - * Returns the actual module instead of a mock, bypassing all checks on - * whether the module should receive a mock implementation or not. - */ - requireActual(m: $Flow$ModuleRef | string): T, - /** - * Returns a mock module instead of the actual module, bypassing all checks - * on whether the module should be required normally or not. - */ - requireMock(moduleName: string): any, - /** - * Resets the module registry - the cache of all required modules. This is - * useful to isolate modules where local state might conflict between tests. - */ - resetModules(): JestObjectType, - /** - * Creates a sandbox registry for the modules that are loaded inside the - * callback function. This is useful to isolate specific modules for every - * test so that local module state doesn't conflict between tests. - */ - isolateModules(fn: () => void): JestObjectType, - /** - * Exhausts the micro-task queue (usually interfaced in node via - * process.nextTick). - */ - runAllTicks(): void, - /** - * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), - * setInterval(), and setImmediate()). - */ - runAllTimers(): void, - /** - * Exhausts all tasks queued by setImmediate(). - */ - runAllImmediates(): void, - /** - * Executes only the macro task queue (i.e. all tasks queued by setTimeout() - * or setInterval() and setImmediate()). - */ - advanceTimersByTime(msToRun: number): void, - /** - * Executes only the macro task queue (i.e. all tasks queued by setTimeout() - * or setInterval() and setImmediate()). - * - * Renamed to `advanceTimersByTime`. - */ - runTimersToTime(msToRun: number): void, - /** - * Executes only the macro-tasks that are currently pending (i.e., only the - * tasks that have been queued by setTimeout() or setInterval() up to this - * point) - */ - runOnlyPendingTimers(): void, - /** - * Explicitly supplies the mock object that the module system should return - * for the specified module. Note: It is recommended to use jest.mock() - * instead. - */ - setMock(moduleName: string, moduleExports: any): JestObjectType, - /** - * Indicates that the module system should never return a mocked version of - * the specified module from require() (e.g. that it should always return the - * real module). - */ - unmock(moduleName: string): JestObjectType, - /** - * Instructs Jest to use fake versions of the standard timer functions - * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, - * setImmediate and clearImmediate). - */ - useFakeTimers(mode?: 'modern' | 'legacy'): JestObjectType, - /** - * Instructs Jest to use the real versions of the standard timer functions. - */ - useRealTimers(): JestObjectType, - /** - * Creates a mock function similar to jest.fn but also tracks calls to - * object[methodName]. - */ - spyOn( - object: Object, - methodName: string, - accessType?: 'get' | 'set' - ): JestMockFn, - /** - * Set the default timeout interval for tests and before/after hooks in milliseconds. - * Note: The default timeout interval is 5 seconds if this method is not called. - */ - setTimeout(timeout: number): JestObjectType, - ... -}; - -type JestSpyType = { calls: JestCallsType, ... }; - -type JestDoneFn = {| - (error?: Error): void, - fail: (error: Error) => void, -|}; - -/** Runs this function after every test inside this context */ -declare function afterEach( - fn: (done: JestDoneFn) => ?Promise, - timeout?: number -): void; -/** Runs this function before every test inside this context */ -declare function beforeEach( - fn: (done: JestDoneFn) => ?Promise, - timeout?: number -): void; -/** Runs this function after all tests have finished inside this context */ -declare function afterAll( - fn: (done: JestDoneFn) => ?Promise, - timeout?: number -): void; -/** Runs this function before any tests have started inside this context */ -declare function beforeAll( - fn: (done: JestDoneFn) => ?Promise, - timeout?: number -): void; - -/** A context for grouping tests together */ -declare var describe: { - /** - * Creates a block that groups together several related tests in one "test suite" - */ - (name: JestTestName, fn: () => void): void, - /** - * Only run this describe block - */ - only(name: JestTestName, fn: () => void): void, - /** - * Skip running this describe block - */ - skip(name: JestTestName, fn: () => void): void, - /** - * each runs this test against array of argument arrays per each run - * - * @param {table} table of Test - */ - each( - ...table: Array | mixed> | [Array, string] - ): ( - name: JestTestName, - fn?: (...args: Array) => ?Promise, - timeout?: number - ) => void, - ... -}; - -/** An individual test unit */ -declare var it: { - /** - * An individual test unit - * - * @param {JestTestName} Name of Test - * @param {Function} Test - * @param {number} Timeout for the test, in milliseconds. - */ - ( - name: JestTestName, - fn?: (done: JestDoneFn) => ?Promise, - timeout?: number - ): void, - /** - * Only run this test - * - * @param {JestTestName} Name of Test - * @param {Function} Test - * @param {number} Timeout for the test, in milliseconds. - */ - only: {| - ( - name: JestTestName, - fn?: (done: JestDoneFn) => ?Promise, - timeout?: number - ): void, - each( - ...table: Array | mixed> | [Array, string] - ): ( - name: JestTestName, - fn?: (...args: Array) => ?Promise, - timeout?: number - ) => void, - |}, - /** - * Skip running this test - * - * @param {JestTestName} Name of Test - * @param {Function} Test - * @param {number} Timeout for the test, in milliseconds. - */ - skip( - name: JestTestName, - fn?: (done: JestDoneFn) => ?Promise, - timeout?: number - ): void, - /** - * Highlight planned tests in the summary output - * - * @param {String} Name of Test to do - */ - todo(name: string): void, - /** - * Run the test concurrently - * - * @param {JestTestName} Name of Test - * @param {Function} Test - * @param {number} Timeout for the test, in milliseconds. - */ - concurrent( - name: JestTestName, - fn?: (done: JestDoneFn) => ?Promise, - timeout?: number - ): void, - /** - * each runs this test against array of argument arrays per each run - * - * @param {table} table of Test - */ - each( - ...table: Array | mixed> | [Array, string] - ): ( - name: JestTestName, - fn?: (...args: Array) => ?Promise, - timeout?: number - ) => void, - ... -}; - -declare function fit( - name: JestTestName, - fn: (done: JestDoneFn) => ?Promise, - timeout?: number -): void; -/** An individual test unit */ -declare var test: typeof it; -/** A disabled group of tests */ -declare var xdescribe: typeof describe; -/** A focused group of tests */ -declare var fdescribe: typeof describe; -/** A disabled individual test */ -declare var xit: typeof it; -/** A disabled individual test */ -declare var xtest: typeof it; - -type JestPrettyFormatColors = { - comment: { - close: string, - open: string, - ... - }, - content: { - close: string, - open: string, - ... - }, - prop: { - close: string, - open: string, - ... - }, - tag: { - close: string, - open: string, - ... - }, - value: { - close: string, - open: string, - ... - }, - ... -}; - -type JestPrettyFormatIndent = (string) => string; -type JestPrettyFormatRefs = Array; -type JestPrettyFormatPrint = (any) => string; -type JestPrettyFormatStringOrNull = string | null; - -type JestPrettyFormatOptions = {| - callToJSON: boolean, - edgeSpacing: string, - escapeRegex: boolean, - highlight: boolean, - indent: number, - maxDepth: number, - min: boolean, - plugins: JestPrettyFormatPlugins, - printFunctionName: boolean, - spacing: string, - theme: {| - comment: string, - content: string, - prop: string, - tag: string, - value: string, - |}, -|}; - -type JestPrettyFormatPlugin = { - print: ( - val: any, - serialize: JestPrettyFormatPrint, - indent: JestPrettyFormatIndent, - opts: JestPrettyFormatOptions, - colors: JestPrettyFormatColors - ) => string, - test: (any) => boolean, - ... -}; - -type JestPrettyFormatPlugins = Array; - -/** The expect function is used every time you want to test a value */ -declare var expect: { - /** The object that you want to make assertions against */ - ( - value: any - ): JestExpectType & - JestPromiseType & - EnzymeMatchersType & - DomTestingLibraryType & - JestJQueryMatchersType & - JestStyledComponentsMatchersType & - JestExtendedMatchersType & - SnapshotDiffType, - /** Add additional Jasmine matchers to Jest's roster */ - extend(matchers: { [name: string]: JestMatcher, ... }): void, - /** Add a module that formats application-specific data structures. */ - addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void, - assertions(expectedAssertions: number): void, - hasAssertions(): void, - any(value: mixed): JestAsymmetricEqualityType, - anything(): any, - arrayContaining(value: Array): Array, - objectContaining(value: Object): Object, - /** Matches any received string that contains the exact expected string. */ - stringContaining(value: string): string, - stringMatching(value: string | RegExp): string, - not: { - arrayContaining: (value: $ReadOnlyArray) => Array, - objectContaining: (value: { ... }) => Object, - stringContaining: (value: string) => string, - stringMatching: (value: string | RegExp) => string, - ... - }, - ... -}; - -// TODO handle return type -// http://jasmine.github.io/2.4/introduction.html#section-Spies -declare function spyOn(value: mixed, method: string): Object; - -/** Holds all functions related to manipulating test runner */ -declare var jest: JestObjectType; - -/** - * The global Jasmine object, this is generally not exposed as the public API, - * using features inside here could break in later versions of Jest. - */ -declare var jasmine: { - DEFAULT_TIMEOUT_INTERVAL: number, - any(value: mixed): JestAsymmetricEqualityType, - anything(): any, - arrayContaining(value: Array): Array, - clock(): JestClockType, - createSpy(name: string): JestSpyType, - createSpyObj( - baseName: string, - methodNames: Array - ): { [methodName: string]: JestSpyType, ... }, - objectContaining(value: Object): Object, - stringMatching(value: string): string, - ... -}; diff --git a/flow-typed/npm/jest_v28.x.x.js b/flow-typed/npm/jest_v28.x.x.js new file mode 100644 index 0000000000..1ac16d1754 --- /dev/null +++ b/flow-typed/npm/jest_v28.x.x.js @@ -0,0 +1,1267 @@ +// flow-typed signature: fd6b1d81136037fad6c4e96fa7354af4 +// flow-typed version: 3153a3ba01/jest_v28.x.x/flow_>=v0.134.x + +type JestMockFn, TReturn> = { + (...args: TArguments): TReturn, + /** + * An object for introspecting mock calls + */ + mock: { + /** + * An array that represents all calls that have been made into this mock + * function. Each call is represented by an array of arguments that were + * passed during the call. + */ + calls: Array, + /** + * An array containing the call arguments of the last call that was made + * to this mock function. If the function was not called, it will return + * undefined. + */ + lastCall: TArguments, + /** + * An array that contains all the object instances that have been + * instantiated from this mock function. + */ + instances: Array, + /** + * An array that contains all the object results that have been + * returned by this mock function call + */ + results: Array<{ + isThrow: boolean, + value: TReturn, + ... + }>, + ... + }, + /** + * Resets all information stored in the mockFn.mock.calls and + * mockFn.mock.instances arrays. Often this is useful when you want to clean + * up a mock's usage data between two assertions. + */ + mockClear(): void, + /** + * Resets all information stored in the mock. This is useful when you want to + * completely restore a mock back to its initial state. + */ + mockReset(): void, + /** + * Removes the mock and restores the initial implementation. This is useful + * when you want to mock functions in certain test cases and restore the + * original implementation in others. Beware that mockFn.mockRestore only + * works when mock was created with jest.spyOn. Thus you have to take care of + * restoration yourself when manually assigning jest.fn(). + */ + mockRestore(): void, + /** + * Accepts a function that should be used as the implementation of the mock. + * The mock itself will still record all calls that go into and instances + * that come from itself -- the only difference is that the implementation + * will also be executed when the mock is called. + */ + mockImplementation( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a function that will be used as an implementation of the mock for + * one call to the mocked function. Can be chained so that multiple function + * calls produce different results. + */ + mockImplementationOnce( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a string to use in test result output in place of "jest.fn()" to + * indicate which mock function is being referenced. + */ + mockName(name: string): JestMockFn, + /** + * Just a simple sugar function for returning `this` + */ + mockReturnThis(): void, + /** + * Accepts a value that will be returned whenever the mock function is called. + */ + mockReturnValue(value: TReturn): JestMockFn, + /** + * Sugar for only returning a value once inside your mock + */ + mockReturnValueOnce(value: TReturn): JestMockFn, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value)) + */ + mockResolvedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value)) + */ + mockResolvedValueOnce( + value: TReturn + ): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.reject(value)) + */ + mockRejectedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value)) + */ + mockRejectedValueOnce(value: TReturn): JestMockFn>, + ... +}; + +type JestAsymmetricEqualityType = { + /** + * A custom Jasmine equality tester + */ + asymmetricMatch(value: mixed): boolean, + ... +}; + +type JestCallsType = { + allArgs(): mixed, + all(): mixed, + any(): boolean, + count(): number, + first(): mixed, + mostRecent(): mixed, + reset(): void, + ... +}; + +type JestClockType = { + install(): void, + mockDate(date: Date): void, + tick(milliseconds?: number): void, + uninstall(): void, + ... +}; + +type JestMatcherResult = { + message?: string | (() => string), + pass: boolean, + ... +}; + +type JestMatcher = ( + received: any, + ...actual: Array +) => JestMatcherResult | Promise; + +type JestPromiseType = { + /** + * Use rejects to unwrap the reason of a rejected promise so any other + * matcher can be chained. If the promise is fulfilled the assertion fails. + */ + rejects: JestExpectType, + /** + * Use resolves to unwrap the value of a fulfilled promise so any other + * matcher can be chained. If the promise is rejected the assertion fails. + */ + resolves: JestExpectType, + ... +}; + +/** + * Jest allows functions and classes to be used as test names in test() and + * describe() + */ +type JestTestName = string | Function; + +type FakeableAPI = + | 'Date' + | 'hrtime' + | 'nextTick' + | 'performance' + | 'queueMicrotask' + | 'requestAnimationFrame' + | 'cancelAnimationFrame' + | 'requestIdleCallback' + | 'cancelIdleCallback' + | 'setImmediate' + | 'clearImmediate' + | 'setInterval' + | 'clearInterval' + | 'setTimeout' + | 'clearTimeout'; + +type FakeTimersConfig = { + advanceTimers?: boolean | number, + doNotFake?: Array, + now?: number | Date, + timerLimit?: number, + legacyFakeTimers?: boolean, + ... +}; + +/** + * Plugin: jest-styled-components + */ + +type JestStyledComponentsMatcherValue = + | string + | JestAsymmetricEqualityType + | RegExp + | typeof undefined; + +type JestStyledComponentsMatcherOptions = { + media?: string, + modifier?: string, + supports?: string, + ... +}; + +type JestStyledComponentsMatchersType = { + toHaveStyleRule( + property: string, + value: JestStyledComponentsMatcherValue, + options?: JestStyledComponentsMatcherOptions + ): void, + ... +}; + +/** + * Plugin: jest-enzyme + */ +type EnzymeMatchersType = { + // 5.x + toBeEmpty(): void, + toBePresent(): void, + // 6.x + toBeChecked(): void, + toBeDisabled(): void, + toBeEmptyRender(): void, + toContainMatchingElement(selector: string): void, + toContainMatchingElements(n: number, selector: string): void, + toContainExactlyOneMatchingElement(selector: string): void, + toContainReact(element: React$Element): void, + toExist(): void, + toHaveClassName(className: string): void, + toHaveHTML(html: string): void, + toHaveProp: ((propKey: string, propValue?: any) => void) & + ((props: { ... }) => void), + toHaveRef(refName: string): void, + toHaveState: ((stateKey: string, stateValue?: any) => void) & + ((state: { ... }) => void), + toHaveStyle: ((styleKey: string, styleValue?: any) => void) & + ((style: { ... }) => void), + toHaveTagName(tagName: string): void, + toHaveText(text: string): void, + toHaveValue(value: any): void, + toIncludeText(text: string): void, + toMatchElement( + element: React$Element, + options?: {| ignoreProps?: boolean, verbose?: boolean |} + ): void, + toMatchSelector(selector: string): void, + // 7.x + toHaveDisplayName(name: string): void, + ... +}; + +// DOM testing library extensions (jest-dom) +// https://github.com/testing-library/jest-dom +type DomTestingLibraryType = { + /** + * @deprecated + */ + toBeInTheDOM(container?: HTMLElement): void, + + // 4.x + toBeInTheDocument(): void, + toBeVisible(): void, + toBeEmpty(): void, + toBeDisabled(): void, + toBeEnabled(): void, + toBeInvalid(): void, + toBeRequired(): void, + toBeValid(): void, + toContainElement(element: HTMLElement | null): void, + toContainHTML(htmlText: string): void, + toHaveAttribute(attr: string, value?: any): void, + toHaveClass(...classNames: string[]): void, + toHaveFocus(): void, + toHaveFormValues(expectedValues: { [name: string]: any, ... }): void, + toHaveStyle(css: string | { [name: string]: any, ... }): void, + toHaveTextContent( + text: string | RegExp, + options?: {| normalizeWhitespace: boolean |} + ): void, + toHaveValue(value?: string | string[] | number): void, + + // 5.x + toHaveDisplayValue(value: string | string[]): void, + toBeChecked(): void, + toBeEmptyDOMElement(): void, + toBePartiallyChecked(): void, + toHaveDescription(text: string | RegExp): void, + ... +}; + +// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers +type JestJQueryMatchersType = { + toExist(): void, + toHaveLength(len: number): void, + toHaveId(id: string): void, + toHaveClass(className: string): void, + toHaveTag(tag: string): void, + toHaveAttr(key: string, val?: any): void, + toHaveProp(key: string, val?: any): void, + toHaveText(text: string | RegExp): void, + toHaveData(key: string, val?: any): void, + toHaveValue(val: any): void, + toHaveCss(css: { [key: string]: any, ... }): void, + toBeChecked(): void, + toBeDisabled(): void, + toBeEmpty(): void, + toBeHidden(): void, + toBeSelected(): void, + toBeVisible(): void, + toBeFocused(): void, + toBeInDom(): void, + toBeMatchedBy(sel: string): void, + toHaveDescendant(sel: string): void, + toHaveDescendantWithText(sel: string, text: string | RegExp): void, + ... +}; + +// Jest Extended Matchers: https://github.com/jest-community/jest-extended +type JestExtendedMatchersType = { + /** + * Note: Currently unimplemented + * Passing assertion + * + * @param {String} message + */ + // pass(message: string): void; + + /** + * Note: Currently unimplemented + * Failing assertion + * + * @param {String} message + */ + // fail(message: string): void; + + /** + * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty. + */ + toBeEmpty(): void, + /** + * Use .toBeOneOf when checking if a value is a member of a given Array. + * @param {Array.<*>} members + */ + toBeOneOf(members: any[]): void, + /** + * Use `.toBeNil` when checking a value is `null` or `undefined`. + */ + toBeNil(): void, + /** + * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`. + * @param {Function} predicate + */ + toSatisfy(predicate: (n: any) => boolean): void, + /** + * Use `.toBeArray` when checking if a value is an `Array`. + */ + toBeArray(): void, + /** + * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x. + * @param {Number} x + */ + toBeArrayOfSize(x: number): void, + /** + * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set. + * @param {Array.<*>} members + */ + toIncludeAllMembers(members: any[]): void, + /** + * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set. + * @param {Array.<*>} members + */ + toIncludeAnyMembers(members: any[]): void, + /** + * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array. + * @param {Function} predicate + */ + toSatisfyAll(predicate: (n: any) => boolean): void, + /** + * Use `.toBeBoolean` when checking if a value is a `Boolean`. + */ + toBeBoolean(): void, + /** + * Use `.toBeTrue` when checking a value is equal (===) to `true`. + */ + toBeTrue(): void, + /** + * Use `.toBeFalse` when checking a value is equal (===) to `false`. + */ + toBeFalse(): void, + /** + * Use .toBeDate when checking if a value is a Date. + */ + toBeDate(): void, + /** + * Use `.toBeFunction` when checking if a value is a `Function`. + */ + toBeFunction(): void, + /** + * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. + * + * Note: Required Jest version >22 + * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same + * + * @param {Mock} mock + */ + toHaveBeenCalledBefore(mock: JestMockFn): void, + /** + * Use `.toBeNumber` when checking if a value is a `Number`. + */ + toBeNumber(): void, + /** + * Use `.toBeNaN` when checking a value is `NaN`. + */ + toBeNaN(): void, + /** + * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`. + */ + toBeFinite(): void, + /** + * Use `.toBePositive` when checking if a value is a positive `Number`. + */ + toBePositive(): void, + /** + * Use `.toBeNegative` when checking if a value is a negative `Number`. + */ + toBeNegative(): void, + /** + * Use `.toBeEven` when checking if a value is an even `Number`. + */ + toBeEven(): void, + /** + * Use `.toBeOdd` when checking if a value is an odd `Number`. + */ + toBeOdd(): void, + /** + * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive). + * + * @param {Number} start + * @param {Number} end + */ + toBeWithin(start: number, end: number): void, + /** + * Use `.toBeObject` when checking if a value is an `Object`. + */ + toBeObject(): void, + /** + * Use `.toContainKey` when checking if an object contains the provided key. + * + * @param {String} key + */ + toContainKey(key: string): void, + /** + * Use `.toContainKeys` when checking if an object has all of the provided keys. + * + * @param {Array.} keys + */ + toContainKeys(keys: string[]): void, + /** + * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys. + * + * @param {Array.} keys + */ + toContainAllKeys(keys: string[]): void, + /** + * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys. + * + * @param {Array.} keys + */ + toContainAnyKeys(keys: string[]): void, + /** + * Use `.toContainValue` when checking if an object contains the provided value. + * + * @param {*} value + */ + toContainValue(value: any): void, + /** + * Use `.toContainValues` when checking if an object contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainValues(values: any[]): void, + /** + * Use `.toContainAllValues` when checking if an object only contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainAllValues(values: any[]): void, + /** + * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values. + * + * @param {Array.<*>} values + */ + toContainAnyValues(values: any[]): void, + /** + * Use `.toContainEntry` when checking if an object contains the provided entry. + * + * @param {Array.} entry + */ + toContainEntry(entry: [string, string]): void, + /** + * Use `.toContainEntries` when checking if an object contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainEntries(entries: [string, string][]): void, + /** + * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainAllEntries(entries: [string, string][]): void, + /** + * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries. + * + * @param {Array.>} entries + */ + toContainAnyEntries(entries: [string, string][]): void, + /** + * Use `.toBeExtensible` when checking if an object is extensible. + */ + toBeExtensible(): void, + /** + * Use `.toBeFrozen` when checking if an object is frozen. + */ + toBeFrozen(): void, + /** + * Use `.toBeSealed` when checking if an object is sealed. + */ + toBeSealed(): void, + /** + * Use `.toBeString` when checking if a value is a `String`. + */ + toBeString(): void, + /** + * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings. + * + * @param {String} string + */ + toEqualCaseInsensitive(string: string): void, + /** + * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix. + * + * @param {String} prefix + */ + toStartWith(prefix: string): void, + /** + * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix. + * + * @param {String} suffix + */ + toEndWith(suffix: string): void, + /** + * Use `.toInclude` when checking if a `String` includes the given `String` substring. + * + * @param {String} substring + */ + toInclude(substring: string): void, + /** + * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times. + * + * @param {String} substring + * @param {Number} times + */ + toIncludeRepeated(substring: string, times: number): void, + /** + * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings. + * + * @param {Array.} substring + */ + toIncludeMultiple(substring: string[]): void, + ... +}; + +// Diffing snapshot utility for Jest (snapshot-diff) +// https://github.com/jest-community/snapshot-diff +type SnapshotDiffType = { + /** + * Compare the difference between the actual in the `expect()` + * vs the object inside `valueB` with some extra options. + */ + toMatchDiffSnapshot( + valueB: any, + options?: {| + expand?: boolean, + colors?: boolean, + contextLines?: number, + stablePatchmarks?: boolean, + aAnnotation?: string, + bAnnotation?: string, + |}, + testName?: string + ): void, + ... +}; + +interface JestExpectType { + not: JestExpectType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType & + SnapshotDiffType; + /** + * If you have a mock function, you can use .lastCalledWith to test what + * arguments it was last called with. + */ + lastCalledWith(...args: Array): void; + /** + * toBe just checks that a value is what you expect. It uses === to check + * strict equality. + */ + toBe(value: any): void; + /** + * Use .toBeCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toBeCalledWith(...args: Array): void; + /** + * Using exact equality with floating point numbers is a bad idea. Rounding + * means that intuitive things fail. + */ + toBeCloseTo(num: number, delta: any): void; + /** + * Use .toBeDefined to check that a variable is not undefined. + */ + toBeDefined(): void; + /** + * Use .toBeFalsy when you don't care what a value is, you just want to + * ensure a value is false in a boolean context. + */ + toBeFalsy(): void; + /** + * To compare floating point numbers, you can use toBeGreaterThan. + */ + toBeGreaterThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeGreaterThanOrEqual. + */ + toBeGreaterThanOrEqual(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThan. + */ + toBeLessThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThanOrEqual. + */ + toBeLessThanOrEqual(number: number): void; + /** + * Use .toBeInstanceOf(Class) to check that an object is an instance of a + * class. + */ + toBeInstanceOf(cls: Class<*>): void; + /** + * .toBeNull() is the same as .toBe(null) but the error messages are a bit + * nicer. + */ + toBeNull(): void; + /** + * Use .toBeTruthy when you don't care what a value is, you just want to + * ensure a value is true in a boolean context. + */ + toBeTruthy(): void; + /** + * Use .toBeUndefined to check that a variable is undefined. + */ + toBeUndefined(): void; + /** + * Use .toContain when you want to check that an item is in a list. For + * testing the items in the list, this uses ===, a strict equality check. + */ + toContain(item: any): void; + /** + * Use .toContainEqual when you want to check that an item is in a list. For + * testing the items in the list, this matcher recursively checks the + * equality of all fields, rather than checking for object identity. + */ + toContainEqual(item: any): void; + /** + * Use .toEqual when you want to check that two objects have the same value. + * This matcher recursively checks the equality of all fields, rather than + * checking for object identity. + */ + toEqual(value: any): void; + /** + * Use .toHaveBeenCalled to ensure that a mock function got called. + */ + toHaveBeenCalled(): void; + toBeCalled(): void; + /** + * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact + * number of times. + */ + toHaveBeenCalledTimes(number: number): void; + toBeCalledTimes(number: number): void; + /** + * + */ + toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void; + nthCalledWith(nthCall: number, ...args: Array): void; + /** + * + */ + toHaveReturned(): void; + toReturn(): void; + /** + * + */ + toHaveReturnedTimes(number: number): void; + toReturnTimes(number: number): void; + /** + * + */ + toHaveReturnedWith(value: any): void; + toReturnWith(value: any): void; + /** + * + */ + toHaveLastReturnedWith(value: any): void; + lastReturnedWith(value: any): void; + /** + * + */ + toHaveNthReturnedWith(nthCall: number, value: any): void; + nthReturnedWith(nthCall: number, value: any): void; + /** + * Use .toHaveBeenCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toHaveBeenCalledWith(...args: Array): void; + toBeCalledWith(...args: Array): void; + /** + * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called + * with specific arguments. + */ + toHaveBeenLastCalledWith(...args: Array): void; + lastCalledWith(...args: Array): void; + /** + * Check that an object has a .length property and it is set to a certain + * numeric value. + */ + toHaveLength(number: number): void; + /** + * + */ + toHaveProperty(propPath: string | $ReadOnlyArray, value?: any): void; + /** + * Use .toMatch to check that a string matches a regular expression or string. + */ + toMatch(regexpOrString: RegExp | string): void; + /** + * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. + */ + toMatchObject(object: Object | Array): void; + /** + * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object. + */ + toStrictEqual(value: any): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(propertyMatchers?: any, name?: string): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(name: string): void; + + toMatchInlineSnapshot(snapshot?: string): void; + toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void; + /** + * Use .toThrow to test that a function throws when it is called. + * If you want to test that a specific error gets thrown, you can provide an + * argument to toThrow. The argument can be a string for the error message, + * a class for the error, or a regex that should match the error. + * + * Alias: .toThrowError + */ + toThrow(message?: string | Error | Class | RegExp): void; + toThrowError(message?: string | Error | Class | RegExp): void; + /** + * Use .toThrowErrorMatchingSnapshot to test that a function throws a error + * matching the most recent snapshot when it is called. + */ + toThrowErrorMatchingSnapshot(): void; + toThrowErrorMatchingInlineSnapshot(snapshot?: string): void; +} + +type JestObjectType = { + /** + * Disables automatic mocking in the module loader. + * + * After this method is called, all `require()`s will return the real + * versions of each module (rather than a mocked version). + */ + disableAutomock(): JestObjectType, + /** + * An un-hoisted version of disableAutomock + */ + autoMockOff(): JestObjectType, + /** + * Enables automatic mocking in the module loader. + */ + enableAutomock(): JestObjectType, + /** + * An un-hoisted version of enableAutomock + */ + autoMockOn(): JestObjectType, + /** + * Clears the mock.calls and mock.instances properties of all mocks. + * Equivalent to calling .mockClear() on every mocked function. + */ + clearAllMocks(): JestObjectType, + /** + * Resets the state of all mocks. Equivalent to calling .mockReset() on every + * mocked function. + */ + resetAllMocks(): JestObjectType, + /** + * Restores all mocks back to their original value. + */ + restoreAllMocks(): JestObjectType, + /** + * Removes any pending timers from the timer system. + */ + clearAllTimers(): void, + /** + * Returns the number of fake timers still left to run. + */ + getTimerCount(): number, + /** + * Set the current system time used by fake timers. + * Simulates a user changing the system clock while your program is running. + * It affects the current time but it does not in itself cause + * e.g. timers to fire; they will fire exactly as they would have done + * without the call to jest.setSystemTime(). + */ + setSystemTime(now?: number | Date): void, + /** + * The same as `mock` but not moved to the top of the expectation by + * babel-jest. + */ + doMock(moduleName: string, moduleFactory?: any): JestObjectType, + /** + * The same as `unmock` but not moved to the top of the expectation by + * babel-jest. + */ + dontMock(moduleName: string): JestObjectType, + /** + * Returns a new, unused mock function. Optionally takes a mock + * implementation. + */ + fn, TReturn>( + implementation?: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Determines if the given function is a mocked function. + */ + isMockFunction(fn: Function): boolean, + /** + * Alias of `createMockFromModule`. + */ + genMockFromModule(moduleName: string): any, + /** + * Given the name of a module, use the automatic mocking system to generate a + * mocked version of the module for you. + */ + createMockFromModule(moduleName: string): any, + /** + * Mocks a module with an auto-mocked version when it is being required. + * + * The second argument can be used to specify an explicit module factory that + * is being run instead of using Jest's automocking feature. + * + * The third argument can be used to create virtual mocks -- mocks of modules + * that don't exist anywhere in the system. + */ + mock( + moduleName: string, + moduleFactory?: any, + options?: Object + ): JestObjectType, + /** + * Returns the actual module instead of a mock, bypassing all checks on + * whether the module should receive a mock implementation or not. + */ + requireActual(m: $Flow$ModuleRef | string): T, + /** + * Returns a mock module instead of the actual module, bypassing all checks + * on whether the module should be required normally or not. + */ + requireMock(moduleName: string): any, + /** + * Resets the module registry - the cache of all required modules. This is + * useful to isolate modules where local state might conflict between tests. + */ + resetModules(): JestObjectType, + /** + * Creates a sandbox registry for the modules that are loaded inside the + * callback function. This is useful to isolate specific modules for every + * test so that local module state doesn't conflict between tests. + */ + isolateModules(fn: () => void): JestObjectType, + /** + * Exhausts the micro-task queue (usually interfaced in node via + * process.nextTick). + */ + runAllTicks(): void, + /** + * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), + * setInterval(), and setImmediate()). + */ + runAllTimers(): void, + /** + * Exhausts all tasks queued by setImmediate(). + */ + runAllImmediates(): void, + /** + * Executes only the macro task queue (i.e. all tasks queued by setTimeout() + * or setInterval() and setImmediate()). + */ + advanceTimersByTime(msToRun: number): void, + /** + * Executes only the macro-tasks that are currently pending (i.e., only the + * tasks that have been queued by setTimeout() or setInterval() up to this + * point) + */ + runOnlyPendingTimers(): void, + /** + * Explicitly supplies the mock object that the module system should return + * for the specified module. Note: It is recommended to use jest.mock() + * instead. + */ + setMock(moduleName: string, moduleExports: any): JestObjectType, + /** + * Indicates that the module system should never return a mocked version of + * the specified module from require() (e.g. that it should always return the + * real module). + */ + unmock(moduleName: string): JestObjectType, + /** + * Instructs Jest to use fake versions of the standard timer functions + * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, + * setImmediate and clearImmediate). + */ + useFakeTimers(fakeTimersConfig?: FakeTimersConfig): JestObjectType, + /** + * Instructs Jest to use the real versions of the standard timer functions. + */ + useRealTimers(): JestObjectType, + /** + * Creates a mock function similar to jest.fn but also tracks calls to + * object[methodName]. + */ + spyOn( + object: Object, + methodName: string, + accessType?: 'get' | 'set' + ): JestMockFn, + /** + * Set the default timeout interval for tests and before/after hooks in milliseconds. + * Note: The default timeout interval is 5 seconds if this method is not called. + */ + setTimeout(timeout: number): JestObjectType, + ... +}; + +type JestSpyType = { calls: JestCallsType, ... }; + +type JestDoneFn = {| + (error?: Error): void, + fail: (error: Error) => void, +|}; + +/** Runs this function after every test inside this context */ +declare function afterEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before every test inside this context */ +declare function beforeEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function after all tests have finished inside this context */ +declare function afterAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before any tests have started inside this context */ +declare function beforeAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; + +/** A context for grouping tests together */ +declare var describe: { + /** + * Creates a block that groups together several related tests in one "test suite" + */ + (name: JestTestName, fn: () => void): void, + /** + * Only run this describe block + */ + only(name: JestTestName, fn: () => void): void, + /** + * Skip running this describe block + */ + skip(name: JestTestName, fn: () => void): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +/** An individual test unit */ +declare var it: { + /** + * An individual test unit + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * Only run this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + only: {| + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + |}, + /** + * Skip running this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + skip: {| + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + |}, + /** + * Highlight planned tests in the summary output + * + * @param {String} Name of Test to do + */ + todo(name: string): void, + /** + * Run the test concurrently + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + concurrent( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +declare function fit( + name: JestTestName, + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** An individual test unit */ +declare var test: typeof it; +/** A disabled group of tests */ +declare var xdescribe: typeof describe; +/** A focused group of tests */ +declare var fdescribe: typeof describe; +/** A disabled individual test */ +declare var xit: typeof it; +/** A disabled individual test */ +declare var xtest: typeof it; + +type JestPrettyFormatColors = { + comment: { + close: string, + open: string, + ... + }, + content: { + close: string, + open: string, + ... + }, + prop: { + close: string, + open: string, + ... + }, + tag: { + close: string, + open: string, + ... + }, + value: { + close: string, + open: string, + ... + }, + ... +}; + +type JestPrettyFormatIndent = (string) => string; +type JestPrettyFormatRefs = Array; +type JestPrettyFormatPrint = (any) => string; +type JestPrettyFormatStringOrNull = string | null; + +type JestPrettyFormatOptions = {| + callToJSON: boolean, + edgeSpacing: string, + escapeRegex: boolean, + highlight: boolean, + indent: number, + maxDepth: number, + min: boolean, + plugins: JestPrettyFormatPlugins, + printFunctionName: boolean, + spacing: string, + theme: {| + comment: string, + content: string, + prop: string, + tag: string, + value: string, + |}, +|}; + +type JestPrettyFormatPlugin = { + print: ( + val: any, + serialize: JestPrettyFormatPrint, + indent: JestPrettyFormatIndent, + opts: JestPrettyFormatOptions, + colors: JestPrettyFormatColors + ) => string, + test: (any) => boolean, + ... +}; + +type JestPrettyFormatPlugins = Array; + +/** The expect function is used every time you want to test a value */ +declare var expect: { + /** The object that you want to make assertions against */ + ( + value: any + ): JestExpectType & + JestPromiseType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType & + SnapshotDiffType, + /** Add additional Jasmine matchers to Jest's roster */ + extend(matchers: { [name: string]: JestMatcher, ... }): void, + /** Add a module that formats application-specific data structures. */ + addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void, + assertions(expectedAssertions: number): void, + hasAssertions(): void, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + objectContaining(value: Object): Object, + /** Matches any received string that contains the exact expected string. */ + stringContaining(value: string): string, + stringMatching(value: string | RegExp): string, + not: { + arrayContaining: (value: $ReadOnlyArray) => Array, + objectContaining: (value: { ... }) => Object, + stringContaining: (value: string) => string, + stringMatching: (value: string | RegExp) => string, + ... + }, + ... +}; + +// TODO handle return type +// http://jasmine.github.io/2.4/introduction.html#section-Spies +declare function spyOn(value: mixed, method: string): Object; + +/** Holds all functions related to manipulating test runner */ +declare var jest: JestObjectType; + +/** + * The global Jasmine object, this is generally not exposed as the public API, + * using features inside here could break in later versions of Jest. + */ +declare var jasmine: { + DEFAULT_TIMEOUT_INTERVAL: number, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + clock(): JestClockType, + createSpy(name: string): JestSpyType, + createSpyObj( + baseName: string, + methodNames: Array + ): { [methodName: string]: JestSpyType, ... }, + objectContaining(value: Object): Object, + stringMatching(value: string): string, + ... +}; diff --git a/flow-typed/npm/jscodeshift_vx.x.x.js b/flow-typed/npm/jscodeshift_vx.x.x.js deleted file mode 100644 index 6934370b02..0000000000 --- a/flow-typed/npm/jscodeshift_vx.x.x.js +++ /dev/null @@ -1,338 +0,0 @@ -// flow-typed signature: e56ff1c974793feaa66844b113f04365 -// flow-typed version: <>/jscodeshift_v^0.11.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'jscodeshift' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'jscodeshift' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'jscodeshift/bin/jscodeshift' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/argsParser' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/Collection' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/collections' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/collections/JSXElement' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/collections/Node' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/collections/VariableDeclarator' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/core' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/getParser' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/ignoreFiles' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/matchNode' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/Runner' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/template' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/testUtils' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/utils/intersection' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/utils/once' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/utils/union' { - declare module.exports: any; -} - -declare module 'jscodeshift/dist/Worker' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/babel5Compat' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/babylon' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/flow' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/ts' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/tsOptions' { - declare module.exports: any; -} - -declare module 'jscodeshift/parser/tsx' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/argsParser' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/Collection' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/collections' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/collections/JSXElement' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/collections/Node' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/collections/VariableDeclarator' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/core' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/getParser' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/ignoreFiles' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/matchNode' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/Runner' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/template' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/testUtils' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/utils/intersection' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/utils/once' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/utils/union' { - declare module.exports: any; -} - -declare module 'jscodeshift/src/Worker' { - declare module.exports: any; -} - -declare module 'jscodeshift/utils/requirePackage' { - declare module.exports: any; -} - -declare module 'jscodeshift/utils/testUtils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'jscodeshift/bin/jscodeshift.js' { - declare module.exports: $Exports<'jscodeshift/bin/jscodeshift'>; -} -declare module 'jscodeshift/dist/argsParser.js' { - declare module.exports: $Exports<'jscodeshift/dist/argsParser'>; -} -declare module 'jscodeshift/dist/Collection.js' { - declare module.exports: $Exports<'jscodeshift/dist/Collection'>; -} -declare module 'jscodeshift/dist/collections/index' { - declare module.exports: $Exports<'jscodeshift/dist/collections'>; -} -declare module 'jscodeshift/dist/collections/index.js' { - declare module.exports: $Exports<'jscodeshift/dist/collections'>; -} -declare module 'jscodeshift/dist/collections/JSXElement.js' { - declare module.exports: $Exports<'jscodeshift/dist/collections/JSXElement'>; -} -declare module 'jscodeshift/dist/collections/Node.js' { - declare module.exports: $Exports<'jscodeshift/dist/collections/Node'>; -} -declare module 'jscodeshift/dist/collections/VariableDeclarator.js' { - declare module.exports: $Exports<'jscodeshift/dist/collections/VariableDeclarator'>; -} -declare module 'jscodeshift/dist/core.js' { - declare module.exports: $Exports<'jscodeshift/dist/core'>; -} -declare module 'jscodeshift/dist/getParser.js' { - declare module.exports: $Exports<'jscodeshift/dist/getParser'>; -} -declare module 'jscodeshift/dist/ignoreFiles.js' { - declare module.exports: $Exports<'jscodeshift/dist/ignoreFiles'>; -} -declare module 'jscodeshift/dist/matchNode.js' { - declare module.exports: $Exports<'jscodeshift/dist/matchNode'>; -} -declare module 'jscodeshift/dist/Runner.js' { - declare module.exports: $Exports<'jscodeshift/dist/Runner'>; -} -declare module 'jscodeshift/dist/template.js' { - declare module.exports: $Exports<'jscodeshift/dist/template'>; -} -declare module 'jscodeshift/dist/testUtils.js' { - declare module.exports: $Exports<'jscodeshift/dist/testUtils'>; -} -declare module 'jscodeshift/dist/utils/intersection.js' { - declare module.exports: $Exports<'jscodeshift/dist/utils/intersection'>; -} -declare module 'jscodeshift/dist/utils/once.js' { - declare module.exports: $Exports<'jscodeshift/dist/utils/once'>; -} -declare module 'jscodeshift/dist/utils/union.js' { - declare module.exports: $Exports<'jscodeshift/dist/utils/union'>; -} -declare module 'jscodeshift/dist/Worker.js' { - declare module.exports: $Exports<'jscodeshift/dist/Worker'>; -} -declare module 'jscodeshift/index' { - declare module.exports: $Exports<'jscodeshift'>; -} -declare module 'jscodeshift/index.js' { - declare module.exports: $Exports<'jscodeshift'>; -} -declare module 'jscodeshift/parser/babel5Compat.js' { - declare module.exports: $Exports<'jscodeshift/parser/babel5Compat'>; -} -declare module 'jscodeshift/parser/babylon.js' { - declare module.exports: $Exports<'jscodeshift/parser/babylon'>; -} -declare module 'jscodeshift/parser/flow.js' { - declare module.exports: $Exports<'jscodeshift/parser/flow'>; -} -declare module 'jscodeshift/parser/ts.js' { - declare module.exports: $Exports<'jscodeshift/parser/ts'>; -} -declare module 'jscodeshift/parser/tsOptions.js' { - declare module.exports: $Exports<'jscodeshift/parser/tsOptions'>; -} -declare module 'jscodeshift/parser/tsx.js' { - declare module.exports: $Exports<'jscodeshift/parser/tsx'>; -} -declare module 'jscodeshift/src/argsParser.js' { - declare module.exports: $Exports<'jscodeshift/src/argsParser'>; -} -declare module 'jscodeshift/src/Collection.js' { - declare module.exports: $Exports<'jscodeshift/src/Collection'>; -} -declare module 'jscodeshift/src/collections/index' { - declare module.exports: $Exports<'jscodeshift/src/collections'>; -} -declare module 'jscodeshift/src/collections/index.js' { - declare module.exports: $Exports<'jscodeshift/src/collections'>; -} -declare module 'jscodeshift/src/collections/JSXElement.js' { - declare module.exports: $Exports<'jscodeshift/src/collections/JSXElement'>; -} -declare module 'jscodeshift/src/collections/Node.js' { - declare module.exports: $Exports<'jscodeshift/src/collections/Node'>; -} -declare module 'jscodeshift/src/collections/VariableDeclarator.js' { - declare module.exports: $Exports<'jscodeshift/src/collections/VariableDeclarator'>; -} -declare module 'jscodeshift/src/core.js' { - declare module.exports: $Exports<'jscodeshift/src/core'>; -} -declare module 'jscodeshift/src/getParser.js' { - declare module.exports: $Exports<'jscodeshift/src/getParser'>; -} -declare module 'jscodeshift/src/ignoreFiles.js' { - declare module.exports: $Exports<'jscodeshift/src/ignoreFiles'>; -} -declare module 'jscodeshift/src/matchNode.js' { - declare module.exports: $Exports<'jscodeshift/src/matchNode'>; -} -declare module 'jscodeshift/src/Runner.js' { - declare module.exports: $Exports<'jscodeshift/src/Runner'>; -} -declare module 'jscodeshift/src/template.js' { - declare module.exports: $Exports<'jscodeshift/src/template'>; -} -declare module 'jscodeshift/src/testUtils.js' { - declare module.exports: $Exports<'jscodeshift/src/testUtils'>; -} -declare module 'jscodeshift/src/utils/intersection.js' { - declare module.exports: $Exports<'jscodeshift/src/utils/intersection'>; -} -declare module 'jscodeshift/src/utils/once.js' { - declare module.exports: $Exports<'jscodeshift/src/utils/once'>; -} -declare module 'jscodeshift/src/utils/union.js' { - declare module.exports: $Exports<'jscodeshift/src/utils/union'>; -} -declare module 'jscodeshift/src/Worker.js' { - declare module.exports: $Exports<'jscodeshift/src/Worker'>; -} -declare module 'jscodeshift/utils/requirePackage.js' { - declare module.exports: $Exports<'jscodeshift/utils/requirePackage'>; -} -declare module 'jscodeshift/utils/testUtils.js' { - declare module.exports: $Exports<'jscodeshift/utils/testUtils'>; -} diff --git a/flow-typed/npm/jsdom_vx.x.x.js b/flow-typed/npm/jsdom_vx.x.x.js deleted file mode 100644 index f03dc058b2..0000000000 --- a/flow-typed/npm/jsdom_vx.x.x.js +++ /dev/null @@ -1,3220 +0,0 @@ -// flow-typed signature: b3a7c8a54bc159000aa74a302ab4cd66 -// flow-typed version: <>/jsdom_v^16.4.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'jsdom' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'jsdom' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'jsdom/lib/api' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/default-stylesheet' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/not-implemented' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/parser/html' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/parser' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/parser/xml' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/async-resource-queue' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/no-op-resource-loader' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/per-document-resource-loader' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/request-manager' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/resource-loader' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/resources/resource-queue' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/browser/Window' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/level2/style' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/level3/xpath' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/aborting/AbortController-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/aborting/AbortSignal-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/attributes' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/attributes/Attr-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/cssom/StyleSheetList-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/documents' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/domparsing/DOMParser-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/domparsing/serialization' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/CloseEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/CompositionEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/CustomEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/ErrorEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/Event-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/EventModifierMixin-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/EventTarget-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/FocusEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/HashChangeEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/InputEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/KeyboardEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/MessageEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/MouseEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/PageTransitionEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/PopStateEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/ProgressEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/StorageEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/TouchEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/UIEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/events/WheelEvent-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/fetch/header-list' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/fetch/header-types' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/fetch/Headers-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/file-api/Blob-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/file-api/File-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/file-api/FileList-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/file-api/FileReader-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/AbortController' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/AbortSignal' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/AbstractRange' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/AddEventListenerOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/AssignedNodesOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Attr' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/BarProp' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/BinaryType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Blob' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/BlobCallback' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/BlobPropertyBag' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CanPlayTypeResult' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CDATASection' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CharacterData' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CloseEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CloseEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Comment' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CompositionEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CompositionEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CustomElementConstructor' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CustomElementRegistry' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CustomEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/CustomEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Document' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DocumentFragment' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DocumentReadyState' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DocumentType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DOMImplementation' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DOMParser' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DOMStringMap' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/DOMTokenList' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Element' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ElementCreationOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ElementDefinitionOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EndingType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ErrorEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ErrorEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Event' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventHandlerNonNull' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventListener' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventListenerOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventModifierInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/EventTarget' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/External' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/File' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FileList' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FilePropertyBag' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FileReader' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FocusEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FocusEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/FormData' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Function' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/GetRootNodeOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HashChangeEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HashChangeEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Headers' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/History' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLAnchorElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLAreaElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLAudioElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLBaseElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLBodyElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLBRElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLButtonElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLCanvasElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLCollection' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDataElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDataListElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDetailsElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDialogElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDivElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLDListElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLEmbedElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLFontElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLFormElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLFrameElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLHeadElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLHeadingElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLHRElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLHtmlElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLIFrameElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLImageElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLInputElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLLabelElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLLegendElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLLIElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLLinkElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMapElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMarqueeElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMediaElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMenuElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMetaElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLMeterElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLModElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLObjectElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLOListElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptionElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptionsCollection' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLOutputElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLParagraphElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLParamElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLPictureElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLPreElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLProgressElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLQuoteElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLScriptElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLSelectElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLSlotElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLSourceElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLSpanElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLStyleElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableCellElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableColElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableRowElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTemplateElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTimeElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTitleElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLTrackElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLUListElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLUnknownElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/HTMLVideoElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/InputEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/InputEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/KeyboardEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/KeyboardEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Location' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MessageEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MessageEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MimeType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MimeTypeArray' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MouseEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MouseEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MutationCallback' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MutationObserver' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MutationObserverInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/MutationRecord' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/NamedNodeMap' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Navigator' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Node' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/NodeFilter' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/NodeIterator' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/NodeList' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/PageTransitionEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/PageTransitionEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Performance' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Plugin' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/PluginArray' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/PopStateEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/PopStateEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ProcessingInstruction' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ProgressEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ProgressEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Range' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Screen' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ScrollBehavior' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ScrollLogicalPosition' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ScrollOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ScrollRestoration' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Selection' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SelectionMode' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ShadowRoot' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ShadowRootInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ShadowRootMode' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/StaticRange' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/StaticRangeInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Storage' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/StorageEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/StorageEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/StyleSheetList' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SupportedType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGAnimatedString' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGGraphicsElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGNumber' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGStringList' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGSVGElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/SVGTitleElement' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/Text' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/TextTrackKind' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/TouchEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/TouchEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/TreeWalker' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/UIEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/UIEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/utils' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/ValidityState' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/VisibilityState' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/VoidFunction' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/WebSocket' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/WheelEvent' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/WheelEventInit' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLDocument' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequest' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/generated/XMLSerializer' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/binary-data' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/create-element' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/create-event-accessor' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/custom-elements' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/dates-and-times' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/details' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/document-base-url' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/events' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/focusing' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/form-controls' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/html-constructor' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/internal-constants' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/json' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/mutation-observers' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/namespaces' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/node' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/number-and-date-inputs' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/ordered-set' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/runtime-script-errors' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/selectors' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/shadow-dom' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/strings' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/style-rules' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/stylesheets' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/svg/basic-types' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/svg/render' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/text' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/traversal' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/validate-names' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/helpers/wrap-cookie-jar-for-request' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/hr-time/Performance-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/interfaces' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/named-properties-window' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/MimeType-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/Navigator-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorID-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/Plugin-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/navigator/PluginArray-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/node-document-position' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/node-type' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/node' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/CDATASection-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/CharacterData-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ChildNode-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Comment-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Document-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DocumentType-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DOMStringMap-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/DOMTokenList-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Element-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLCollection-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/LinkStyle-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Node-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/NodeList-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ParentNode-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/ShadowRoot-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Slotable-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/SVGElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/SVGTests-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/Text-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/nodes/XMLDocument-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/post-message' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/range/AbstractRange-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/range/boundary-point' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/range/Range-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/range/StaticRange-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/selection/Selection-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/svg/SVGListBase' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/svg/SVGNumber-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/svg/SVGStringList-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/traversal/helpers' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/traversal/NodeIterator-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/traversal/TreeWalker-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/websockets/WebSocket-impl-browser' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/websockets/WebSocket-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/webstorage/Storage-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/BarProp-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/External-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/History-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/Location-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/navigation' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/Screen-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/window/SessionHistory' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/FormData-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/xhr-sync-worker' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/xhr-utils' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/named-properties-tracker' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/utils' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/virtual-console' { - declare module.exports: any; -} - -declare module 'jsdom/lib/jsdom/vm-shim' { - declare module.exports: any; -} - -// Filename aliases -declare module 'jsdom/lib/api.js' { - declare module.exports: $Exports<'jsdom/lib/api'>; -} -declare module 'jsdom/lib/jsdom/browser/default-stylesheet.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/default-stylesheet'>; -} -declare module 'jsdom/lib/jsdom/browser/not-implemented.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/not-implemented'>; -} -declare module 'jsdom/lib/jsdom/browser/parser/html.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/parser/html'>; -} -declare module 'jsdom/lib/jsdom/browser/parser/index' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/parser'>; -} -declare module 'jsdom/lib/jsdom/browser/parser/index.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/parser'>; -} -declare module 'jsdom/lib/jsdom/browser/parser/xml.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/parser/xml'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/async-resource-queue.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/async-resource-queue'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/no-op-resource-loader.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/no-op-resource-loader'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/per-document-resource-loader'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/request-manager.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/request-manager'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/resource-loader.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/resource-loader'>; -} -declare module 'jsdom/lib/jsdom/browser/resources/resource-queue.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resources/resource-queue'>; -} -declare module 'jsdom/lib/jsdom/browser/Window.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/browser/Window'>; -} -declare module 'jsdom/lib/jsdom/level2/style.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/level2/style'>; -} -declare module 'jsdom/lib/jsdom/level3/xpath.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/level3/xpath'>; -} -declare module 'jsdom/lib/jsdom/living/aborting/AbortController-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/aborting/AbortController-impl'>; -} -declare module 'jsdom/lib/jsdom/living/aborting/AbortSignal-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/aborting/AbortSignal-impl'>; -} -declare module 'jsdom/lib/jsdom/living/attributes.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/attributes'>; -} -declare module 'jsdom/lib/jsdom/living/attributes/Attr-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/attributes/Attr-impl'>; -} -declare module 'jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl'>; -} -declare module 'jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl'>; -} -declare module 'jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl'>; -} -declare module 'jsdom/lib/jsdom/living/cssom/StyleSheetList-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/cssom/StyleSheetList-impl'>; -} -declare module 'jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl'>; -} -declare module 'jsdom/lib/jsdom/living/documents.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/documents'>; -} -declare module 'jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/domparsing/DOMParser-impl'>; -} -declare module 'jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization'>; -} -declare module 'jsdom/lib/jsdom/living/domparsing/serialization.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/domparsing/serialization'>; -} -declare module 'jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/CloseEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/CloseEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/CompositionEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/CompositionEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/CustomEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/CustomEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/ErrorEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/ErrorEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/Event-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/Event-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/EventModifierMixin-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/EventTarget-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/EventTarget-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/FocusEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/FocusEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/HashChangeEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/InputEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/InputEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/KeyboardEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/MessageEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/MessageEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/MouseEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/MouseEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/PageTransitionEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/PageTransitionEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/PopStateEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/PopStateEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/ProgressEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/ProgressEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/StorageEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/StorageEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/TouchEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/TouchEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/UIEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/UIEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/events/WheelEvent-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/WheelEvent-impl'>; -} -declare module 'jsdom/lib/jsdom/living/fetch/header-list.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/fetch/header-list'>; -} -declare module 'jsdom/lib/jsdom/living/fetch/header-types.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/fetch/header-types'>; -} -declare module 'jsdom/lib/jsdom/living/fetch/Headers-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/fetch/Headers-impl'>; -} -declare module 'jsdom/lib/jsdom/living/file-api/Blob-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/Blob-impl'>; -} -declare module 'jsdom/lib/jsdom/living/file-api/File-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/File-impl'>; -} -declare module 'jsdom/lib/jsdom/living/file-api/FileList-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/FileList-impl'>; -} -declare module 'jsdom/lib/jsdom/living/file-api/FileReader-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/FileReader-impl'>; -} -declare module 'jsdom/lib/jsdom/living/generated/AbortController.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AbortController'>; -} -declare module 'jsdom/lib/jsdom/living/generated/AbortSignal.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AbortSignal'>; -} -declare module 'jsdom/lib/jsdom/living/generated/AbstractRange.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AbstractRange'>; -} -declare module 'jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AddEventListenerOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/AssignedNodesOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AssignedNodesOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Attr.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Attr'>; -} -declare module 'jsdom/lib/jsdom/living/generated/BarProp.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/BarProp'>; -} -declare module 'jsdom/lib/jsdom/living/generated/BinaryType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/BinaryType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Blob.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Blob'>; -} -declare module 'jsdom/lib/jsdom/living/generated/BlobCallback.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/BlobCallback'>; -} -declare module 'jsdom/lib/jsdom/living/generated/BlobPropertyBag.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/BlobPropertyBag'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CanPlayTypeResult.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CanPlayTypeResult'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CDATASection.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CDATASection'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CharacterData.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CharacterData'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CloseEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CloseEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CloseEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CloseEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Comment.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Comment'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CompositionEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CompositionEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CompositionEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CompositionEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CustomElementConstructor.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomElementConstructor'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CustomElementRegistry.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomElementRegistry'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CustomEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/CustomEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Document.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Document'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DocumentFragment.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DocumentFragment'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DocumentReadyState.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DocumentReadyState'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DocumentType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DocumentType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DOMImplementation.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMImplementation'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DOMParser.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMParser'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DOMStringMap.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMStringMap'>; -} -declare module 'jsdom/lib/jsdom/living/generated/DOMTokenList.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMTokenList'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Element.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Element'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ElementCreationOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ElementCreationOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ElementDefinitionOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ElementDefinitionOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EndingType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EndingType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ErrorEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ErrorEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ErrorEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ErrorEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Event.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Event'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventHandlerNonNull'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventListener.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventListener'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventListenerOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventListenerOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventModifierInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventModifierInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/EventTarget.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventTarget'>; -} -declare module 'jsdom/lib/jsdom/living/generated/External.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/External'>; -} -declare module 'jsdom/lib/jsdom/living/generated/File.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/File'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FileList.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FileList'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FilePropertyBag.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FilePropertyBag'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FileReader.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FileReader'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FocusEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FocusEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FocusEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FocusEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/FormData.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FormData'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Function.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Function'>; -} -declare module 'jsdom/lib/jsdom/living/generated/GetRootNodeOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/GetRootNodeOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HashChangeEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HashChangeEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HashChangeEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HashChangeEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Headers.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Headers'>; -} -declare module 'jsdom/lib/jsdom/living/generated/History.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/History'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAnchorElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLAreaElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAreaElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLAudioElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAudioElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLBaseElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBaseElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLBodyElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBodyElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLBRElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBRElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLButtonElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLButtonElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLCanvasElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLCollection.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLCollection'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDataElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDataElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDataListElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDataListElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDetailsElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDetailsElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDialogElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDialogElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDivElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDivElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLDListElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDListElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLEmbedElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLFontElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFontElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLFormElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFormElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLFrameElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFrameElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLHeadElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHeadElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHeadingElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLHRElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHRElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHtmlElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLIFrameElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLImageElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLImageElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLInputElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLInputElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLLabelElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLabelElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLLegendElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLegendElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLLIElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLIElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLLinkElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLinkElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMapElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMapElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMarqueeElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMarqueeElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMediaElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMediaElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMenuElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMenuElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMetaElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMetaElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLMeterElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMeterElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLModElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLModElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLObjectElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLObjectElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLOListElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOListElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptionElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOptionElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLOptionsCollection.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOptionsCollection'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLOutputElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOutputElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLParagraphElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLParamElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLParamElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLPictureElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLPictureElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLPreElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLPreElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLProgressElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLProgressElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLQuoteElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLScriptElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLScriptElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLSelectElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSelectElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLSlotElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSlotElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLSourceElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSourceElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLSpanElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSpanElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLStyleElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLStyleElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableCellElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableColElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableColElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableRowElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTemplateElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTimeElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTimeElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTitleElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTitleElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLTrackElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTrackElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLUListElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLUListElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLUnknownElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/HTMLVideoElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLVideoElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/InputEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/InputEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/InputEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/InputEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/KeyboardEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/KeyboardEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/KeyboardEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/KeyboardEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Location.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Location'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MessageEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MessageEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MessageEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MessageEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MimeType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MimeType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MimeTypeArray.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MimeTypeArray'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MouseEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MouseEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MouseEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MouseEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MutationCallback.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MutationCallback'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MutationObserver.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MutationObserver'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MutationObserverInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MutationObserverInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/MutationRecord.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MutationRecord'>; -} -declare module 'jsdom/lib/jsdom/living/generated/NamedNodeMap.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NamedNodeMap'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Navigator.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Navigator'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Node.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Node'>; -} -declare module 'jsdom/lib/jsdom/living/generated/NodeFilter.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NodeFilter'>; -} -declare module 'jsdom/lib/jsdom/living/generated/NodeIterator.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NodeIterator'>; -} -declare module 'jsdom/lib/jsdom/living/generated/NodeList.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NodeList'>; -} -declare module 'jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull'>; -} -declare module 'jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull'>; -} -declare module 'jsdom/lib/jsdom/living/generated/PageTransitionEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PageTransitionEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PageTransitionEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Performance.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Performance'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Plugin.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Plugin'>; -} -declare module 'jsdom/lib/jsdom/living/generated/PluginArray.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PluginArray'>; -} -declare module 'jsdom/lib/jsdom/living/generated/PopStateEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PopStateEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/PopStateEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PopStateEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ProcessingInstruction.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProcessingInstruction'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ProgressEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProgressEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ProgressEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProgressEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Range.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Range'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Screen.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Screen'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ScrollBehavior.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollBehavior'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollLogicalPosition'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ScrollOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ScrollRestoration.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollRestoration'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Selection.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Selection'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SelectionMode.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SelectionMode'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ShadowRoot.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ShadowRoot'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ShadowRootInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ShadowRootInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ShadowRootMode.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ShadowRootMode'>; -} -declare module 'jsdom/lib/jsdom/living/generated/StaticRange.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/StaticRange'>; -} -declare module 'jsdom/lib/jsdom/living/generated/StaticRangeInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/StaticRangeInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Storage.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Storage'>; -} -declare module 'jsdom/lib/jsdom/living/generated/StorageEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/StorageEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/StorageEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/StorageEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/StyleSheetList.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/StyleSheetList'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SupportedType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SupportedType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGAnimatedString.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGAnimatedString'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGGraphicsElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGNumber.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGNumber'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGStringList.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGStringList'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGSVGElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGSVGElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/SVGTitleElement.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/SVGTitleElement'>; -} -declare module 'jsdom/lib/jsdom/living/generated/Text.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Text'>; -} -declare module 'jsdom/lib/jsdom/living/generated/TextTrackKind.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TextTrackKind'>; -} -declare module 'jsdom/lib/jsdom/living/generated/TouchEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TouchEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/TouchEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TouchEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/TreeWalker.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TreeWalker'>; -} -declare module 'jsdom/lib/jsdom/living/generated/UIEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/UIEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/UIEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/UIEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/utils.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/utils'>; -} -declare module 'jsdom/lib/jsdom/living/generated/ValidityState.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ValidityState'>; -} -declare module 'jsdom/lib/jsdom/living/generated/VisibilityState.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/VisibilityState'>; -} -declare module 'jsdom/lib/jsdom/living/generated/VoidFunction.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/VoidFunction'>; -} -declare module 'jsdom/lib/jsdom/living/generated/WebSocket.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/WebSocket'>; -} -declare module 'jsdom/lib/jsdom/living/generated/WheelEvent.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/WheelEvent'>; -} -declare module 'jsdom/lib/jsdom/living/generated/WheelEventInit.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/WheelEventInit'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLDocument.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLDocument'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequest.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLHttpRequest'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload'>; -} -declare module 'jsdom/lib/jsdom/living/generated/XMLSerializer.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLSerializer'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/binary-data.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/binary-data'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/create-element.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/create-element'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/create-event-accessor.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/create-event-accessor'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/custom-elements.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/custom-elements'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/dates-and-times.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/dates-and-times'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/details.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/details'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/document-base-url.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/document-base-url'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/events.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/events'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/focusing.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/focusing'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/form-controls.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/form-controls'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/html-constructor.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/html-constructor'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/internal-constants.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/internal-constants'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/json.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/json'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/mutation-observers.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/mutation-observers'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/namespaces.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/namespaces'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/node.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/node'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/number-and-date-inputs.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/number-and-date-inputs'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/ordered-set.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/ordered-set'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/runtime-script-errors.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/runtime-script-errors'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/selectors.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/selectors'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/shadow-dom.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/shadow-dom'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/strings.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/strings'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/style-rules.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/style-rules'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/stylesheets.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/stylesheets'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/svg/basic-types.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/svg/basic-types'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/svg/render.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/svg/render'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/text.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/text'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/traversal.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/traversal'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/validate-names.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/validate-names'>; -} -declare module 'jsdom/lib/jsdom/living/helpers/wrap-cookie-jar-for-request.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/wrap-cookie-jar-for-request'>; -} -declare module 'jsdom/lib/jsdom/living/hr-time/Performance-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/hr-time/Performance-impl'>; -} -declare module 'jsdom/lib/jsdom/living/interfaces.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/interfaces'>; -} -declare module 'jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl'>; -} -declare module 'jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl'>; -} -declare module 'jsdom/lib/jsdom/living/named-properties-window.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/named-properties-window'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/MimeType-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/MimeType-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/Navigator-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/Navigator-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorID-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/Plugin-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/Plugin-impl'>; -} -declare module 'jsdom/lib/jsdom/living/navigator/PluginArray-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/PluginArray-impl'>; -} -declare module 'jsdom/lib/jsdom/living/node-document-position.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-document-position'>; -} -declare module 'jsdom/lib/jsdom/living/node-type.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-type'>; -} -declare module 'jsdom/lib/jsdom/living/node.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/node'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/CDATASection-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/CDATASection-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/CharacterData-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/CharacterData-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ChildNode-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ChildNode-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Comment-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Comment-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Document-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Document-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DocumentType-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DocumentType-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DOMStringMap-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DOMStringMap-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/DOMTokenList-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DOMTokenList-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Element-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Element-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLCollection-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLCollection-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/LinkStyle-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Node-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Node-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/NodeList-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/NodeList-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ParentNode-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ParentNode-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ShadowRoot-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Slotable-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Slotable-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/SVGElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/SVGElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/SVGTests-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/SVGTests-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/Text-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Text-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl'>; -} -declare module 'jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/XMLDocument-impl'>; -} -declare module 'jsdom/lib/jsdom/living/post-message.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/post-message'>; -} -declare module 'jsdom/lib/jsdom/living/range/AbstractRange-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/range/AbstractRange-impl'>; -} -declare module 'jsdom/lib/jsdom/living/range/boundary-point.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/range/boundary-point'>; -} -declare module 'jsdom/lib/jsdom/living/range/Range-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/range/Range-impl'>; -} -declare module 'jsdom/lib/jsdom/living/range/StaticRange-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/range/StaticRange-impl'>; -} -declare module 'jsdom/lib/jsdom/living/selection/Selection-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/selection/Selection-impl'>; -} -declare module 'jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl'>; -} -declare module 'jsdom/lib/jsdom/living/svg/SVGListBase.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/svg/SVGListBase'>; -} -declare module 'jsdom/lib/jsdom/living/svg/SVGNumber-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/svg/SVGNumber-impl'>; -} -declare module 'jsdom/lib/jsdom/living/svg/SVGStringList-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/svg/SVGStringList-impl'>; -} -declare module 'jsdom/lib/jsdom/living/traversal/helpers.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/traversal/helpers'>; -} -declare module 'jsdom/lib/jsdom/living/traversal/NodeIterator-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/traversal/NodeIterator-impl'>; -} -declare module 'jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/traversal/TreeWalker-impl'>; -} -declare module 'jsdom/lib/jsdom/living/websockets/WebSocket-impl-browser.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/websockets/WebSocket-impl-browser'>; -} -declare module 'jsdom/lib/jsdom/living/websockets/WebSocket-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/websockets/WebSocket-impl'>; -} -declare module 'jsdom/lib/jsdom/living/webstorage/Storage-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/webstorage/Storage-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/BarProp-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/BarProp-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/External-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/External-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/History-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/History-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/Location-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/Location-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/navigation.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/navigation'>; -} -declare module 'jsdom/lib/jsdom/living/window/Screen-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/Screen-impl'>; -} -declare module 'jsdom/lib/jsdom/living/window/SessionHistory.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/SessionHistory'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/FormData-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/FormData-impl'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/xhr-sync-worker'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/xhr-utils.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/xhr-utils'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl'>; -} -declare module 'jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl'>; -} -declare module 'jsdom/lib/jsdom/named-properties-tracker.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/named-properties-tracker'>; -} -declare module 'jsdom/lib/jsdom/utils.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/utils'>; -} -declare module 'jsdom/lib/jsdom/virtual-console.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/virtual-console'>; -} -declare module 'jsdom/lib/jsdom/vm-shim.js' { - declare module.exports: $Exports<'jsdom/lib/jsdom/vm-shim'>; -} diff --git a/flow-typed/npm/lerna_vx.x.x.js b/flow-typed/npm/lerna_vx.x.x.js deleted file mode 100644 index cb1d11ba8f..0000000000 --- a/flow-typed/npm/lerna_vx.x.x.js +++ /dev/null @@ -1,38 +0,0 @@ -// flow-typed signature: 933cda40d383cbe0390a92a80e3a3052 -// flow-typed version: <>/lerna_v4.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'lerna' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'lerna' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'lerna/cli' { - declare module.exports: any; -} - -// Filename aliases -declare module 'lerna/cli.js' { - declare module.exports: $Exports<'lerna/cli'>; -} -declare module 'lerna/index' { - declare module.exports: $Exports<'lerna'>; -} -declare module 'lerna/index.js' { - declare module.exports: $Exports<'lerna'>; -} diff --git a/flow-typed/npm/lint-staged_vx.x.x.js b/flow-typed/npm/lint-staged_vx.x.x.js deleted file mode 100644 index 14013f8a1a..0000000000 --- a/flow-typed/npm/lint-staged_vx.x.x.js +++ /dev/null @@ -1,161 +0,0 @@ -// flow-typed signature: 76c2bc4cad002fa552553994c02e9ac8 -// flow-typed version: <>/lint-staged_v^10.5.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'lint-staged' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'lint-staged' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'lint-staged/bin/lint-staged' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/chunkFiles' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/execGit' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/file' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/formatConfig' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/generateTasks' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/getRenderer' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/getStagedFiles' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/gitWorkflow' { - declare module.exports: any; -} - -declare module 'lint-staged/lib' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/makeCmdTasks' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/messages' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/printTaskOutput' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/resolveGitRepo' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/resolveTaskFn' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/runAll' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/state' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/symbols' { - declare module.exports: any; -} - -declare module 'lint-staged/lib/validateConfig' { - declare module.exports: any; -} - -// Filename aliases -declare module 'lint-staged/bin/lint-staged.js' { - declare module.exports: $Exports<'lint-staged/bin/lint-staged'>; -} -declare module 'lint-staged/lib/chunkFiles.js' { - declare module.exports: $Exports<'lint-staged/lib/chunkFiles'>; -} -declare module 'lint-staged/lib/execGit.js' { - declare module.exports: $Exports<'lint-staged/lib/execGit'>; -} -declare module 'lint-staged/lib/file.js' { - declare module.exports: $Exports<'lint-staged/lib/file'>; -} -declare module 'lint-staged/lib/formatConfig.js' { - declare module.exports: $Exports<'lint-staged/lib/formatConfig'>; -} -declare module 'lint-staged/lib/generateTasks.js' { - declare module.exports: $Exports<'lint-staged/lib/generateTasks'>; -} -declare module 'lint-staged/lib/getRenderer.js' { - declare module.exports: $Exports<'lint-staged/lib/getRenderer'>; -} -declare module 'lint-staged/lib/getStagedFiles.js' { - declare module.exports: $Exports<'lint-staged/lib/getStagedFiles'>; -} -declare module 'lint-staged/lib/gitWorkflow.js' { - declare module.exports: $Exports<'lint-staged/lib/gitWorkflow'>; -} -declare module 'lint-staged/lib/index' { - declare module.exports: $Exports<'lint-staged/lib'>; -} -declare module 'lint-staged/lib/index.js' { - declare module.exports: $Exports<'lint-staged/lib'>; -} -declare module 'lint-staged/lib/makeCmdTasks.js' { - declare module.exports: $Exports<'lint-staged/lib/makeCmdTasks'>; -} -declare module 'lint-staged/lib/messages.js' { - declare module.exports: $Exports<'lint-staged/lib/messages'>; -} -declare module 'lint-staged/lib/printTaskOutput.js' { - declare module.exports: $Exports<'lint-staged/lib/printTaskOutput'>; -} -declare module 'lint-staged/lib/resolveGitRepo.js' { - declare module.exports: $Exports<'lint-staged/lib/resolveGitRepo'>; -} -declare module 'lint-staged/lib/resolveTaskFn.js' { - declare module.exports: $Exports<'lint-staged/lib/resolveTaskFn'>; -} -declare module 'lint-staged/lib/runAll.js' { - declare module.exports: $Exports<'lint-staged/lib/runAll'>; -} -declare module 'lint-staged/lib/state.js' { - declare module.exports: $Exports<'lint-staged/lib/state'>; -} -declare module 'lint-staged/lib/symbols.js' { - declare module.exports: $Exports<'lint-staged/lib/symbols'>; -} -declare module 'lint-staged/lib/validateConfig.js' { - declare module.exports: $Exports<'lint-staged/lib/validateConfig'>; -} diff --git a/flow-typed/npm/loki_vx.x.x.js b/flow-typed/npm/loki_vx.x.x.js deleted file mode 100644 index 1b0c78350f..0000000000 --- a/flow-typed/npm/loki_vx.x.x.js +++ /dev/null @@ -1,46 +0,0 @@ -// flow-typed signature: 92c9c7796c1c47ce6698bf6403458a22 -// flow-typed version: <>/loki_v^0.27.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'loki' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'loki' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'loki/configure-react-native' { - declare module.exports: any; -} - -declare module 'loki/configure-react' { - declare module.exports: any; -} - -declare module 'loki/configure-vue' { - declare module.exports: any; -} - -// Filename aliases -declare module 'loki/configure-react-native.js' { - declare module.exports: $Exports<'loki/configure-react-native'>; -} -declare module 'loki/configure-react.js' { - declare module.exports: $Exports<'loki/configure-react'>; -} -declare module 'loki/configure-vue.js' { - declare module.exports: $Exports<'loki/configure-vue'>; -} diff --git a/flow-typed/npm/make-runnable_vx.x.x.js b/flow-typed/npm/make-runnable_vx.x.x.js deleted file mode 100644 index aadad3987c..0000000000 --- a/flow-typed/npm/make-runnable_vx.x.x.js +++ /dev/null @@ -1,80 +0,0 @@ -// flow-typed signature: f334d42273a4a3a0119f6ee8f0e39b10 -// flow-typed version: <>/make-runnable_v^1.3.8/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'make-runnable' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'make-runnable' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'make-runnable/custom' { - declare module.exports: any; -} - -declare module 'make-runnable/engine' { - declare module.exports: any; -} - -declare module 'make-runnable/test/test_module_no_output_frame' { - declare module.exports: any; -} - -declare module 'make-runnable/test/test' { - declare module.exports: any; -} - -declare module 'make-runnable/test/testModules/basic' { - declare module.exports: any; -} - -declare module 'make-runnable/test/testModules/noOutputFrame' { - declare module.exports: any; -} - -declare module 'make-runnable/utils/mergeObjects' { - declare module.exports: any; -} - -// Filename aliases -declare module 'make-runnable/custom.js' { - declare module.exports: $Exports<'make-runnable/custom'>; -} -declare module 'make-runnable/engine.js' { - declare module.exports: $Exports<'make-runnable/engine'>; -} -declare module 'make-runnable/index' { - declare module.exports: $Exports<'make-runnable'>; -} -declare module 'make-runnable/index.js' { - declare module.exports: $Exports<'make-runnable'>; -} -declare module 'make-runnable/test/test_module_no_output_frame.js' { - declare module.exports: $Exports<'make-runnable/test/test_module_no_output_frame'>; -} -declare module 'make-runnable/test/test.js' { - declare module.exports: $Exports<'make-runnable/test/test'>; -} -declare module 'make-runnable/test/testModules/basic.js' { - declare module.exports: $Exports<'make-runnable/test/testModules/basic'>; -} -declare module 'make-runnable/test/testModules/noOutputFrame.js' { - declare module.exports: $Exports<'make-runnable/test/testModules/noOutputFrame'>; -} -declare module 'make-runnable/utils/mergeObjects.js' { - declare module.exports: $Exports<'make-runnable/utils/mergeObjects'>; -} diff --git a/flow-typed/npm/markdown-chalk_vx.x.x.js b/flow-typed/npm/markdown-chalk_vx.x.x.js deleted file mode 100644 index c7e4a3e6ca..0000000000 --- a/flow-typed/npm/markdown-chalk_vx.x.x.js +++ /dev/null @@ -1,42 +0,0 @@ -// flow-typed signature: fd62ddde7bbe04dd2eed6abe3dbe36b4 -// flow-typed version: <>/markdown-chalk_v^2.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'markdown-chalk' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'markdown-chalk' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'markdown-chalk/bin' { - declare module.exports: any; -} - -declare module 'markdown-chalk/test/test' { - declare module.exports: any; -} - -// Filename aliases -declare module 'markdown-chalk/bin/index' { - declare module.exports: $Exports<'markdown-chalk/bin'>; -} -declare module 'markdown-chalk/bin/index.js' { - declare module.exports: $Exports<'markdown-chalk/bin'>; -} -declare module 'markdown-chalk/test/test.js' { - declare module.exports: $Exports<'markdown-chalk/test/test'>; -} diff --git a/flow-typed/npm/markdown-magic_vx.x.x.js b/flow-typed/npm/markdown-magic_vx.x.x.js deleted file mode 100644 index 4e116f27bc..0000000000 --- a/flow-typed/npm/markdown-magic_vx.x.x.js +++ /dev/null @@ -1,153 +0,0 @@ -// flow-typed signature: a95c2f2b469d3a7cddd6245dde45f1fb -// flow-typed version: <>/markdown-magic_v^1.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'markdown-magic' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'markdown-magic' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'markdown-magic/cli-utils' { - declare module.exports: any; -} - -declare module 'markdown-magic/cli' { - declare module.exports: any; -} - -declare module 'markdown-magic/examples/basic-usage' { - declare module.exports: any; -} - -declare module 'markdown-magic/examples/generate-readme' { - declare module.exports: any; -} - -declare module 'markdown-magic/examples/plugin-example' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/processFile' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/transforms/code' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/transforms' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/transforms/remote' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/transforms/toc' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/updateContents' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/utils/regex' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/utils/remoteRequest' { - declare module.exports: any; -} - -declare module 'markdown-magic/lib/utils/sortOrder' { - declare module.exports: any; -} - -declare module 'markdown-magic/markdown.config' { - declare module.exports: any; -} - -declare module 'markdown-magic/test/fixtures/local-code-file' { - declare module.exports: any; -} - -declare module 'markdown-magic/test/main.test' { - declare module.exports: any; -} - -// Filename aliases -declare module 'markdown-magic/cli-utils.js' { - declare module.exports: $Exports<'markdown-magic/cli-utils'>; -} -declare module 'markdown-magic/cli.js' { - declare module.exports: $Exports<'markdown-magic/cli'>; -} -declare module 'markdown-magic/examples/basic-usage.js' { - declare module.exports: $Exports<'markdown-magic/examples/basic-usage'>; -} -declare module 'markdown-magic/examples/generate-readme.js' { - declare module.exports: $Exports<'markdown-magic/examples/generate-readme'>; -} -declare module 'markdown-magic/examples/plugin-example.js' { - declare module.exports: $Exports<'markdown-magic/examples/plugin-example'>; -} -declare module 'markdown-magic/index' { - declare module.exports: $Exports<'markdown-magic'>; -} -declare module 'markdown-magic/index.js' { - declare module.exports: $Exports<'markdown-magic'>; -} -declare module 'markdown-magic/lib/processFile.js' { - declare module.exports: $Exports<'markdown-magic/lib/processFile'>; -} -declare module 'markdown-magic/lib/transforms/code.js' { - declare module.exports: $Exports<'markdown-magic/lib/transforms/code'>; -} -declare module 'markdown-magic/lib/transforms/index' { - declare module.exports: $Exports<'markdown-magic/lib/transforms'>; -} -declare module 'markdown-magic/lib/transforms/index.js' { - declare module.exports: $Exports<'markdown-magic/lib/transforms'>; -} -declare module 'markdown-magic/lib/transforms/remote.js' { - declare module.exports: $Exports<'markdown-magic/lib/transforms/remote'>; -} -declare module 'markdown-magic/lib/transforms/toc.js' { - declare module.exports: $Exports<'markdown-magic/lib/transforms/toc'>; -} -declare module 'markdown-magic/lib/updateContents.js' { - declare module.exports: $Exports<'markdown-magic/lib/updateContents'>; -} -declare module 'markdown-magic/lib/utils/regex.js' { - declare module.exports: $Exports<'markdown-magic/lib/utils/regex'>; -} -declare module 'markdown-magic/lib/utils/remoteRequest.js' { - declare module.exports: $Exports<'markdown-magic/lib/utils/remoteRequest'>; -} -declare module 'markdown-magic/lib/utils/sortOrder.js' { - declare module.exports: $Exports<'markdown-magic/lib/utils/sortOrder'>; -} -declare module 'markdown-magic/markdown.config.js' { - declare module.exports: $Exports<'markdown-magic/markdown.config'>; -} -declare module 'markdown-magic/test/fixtures/local-code-file.js' { - declare module.exports: $Exports<'markdown-magic/test/fixtures/local-code-file'>; -} -declare module 'markdown-magic/test/main.test.js' { - declare module.exports: $Exports<'markdown-magic/test/main.test'>; -} diff --git a/flow-typed/npm/memfs_vx.x.x.js b/flow-typed/npm/memfs_vx.x.x.js deleted file mode 100644 index d22421bb74..0000000000 --- a/flow-typed/npm/memfs_vx.x.x.js +++ /dev/null @@ -1,133 +0,0 @@ -// flow-typed signature: 1daef48c1b61aa99f1002dd27c158dcc -// flow-typed version: <>/memfs_v^3.2.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'memfs' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'memfs' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'memfs/lib/constants' { - declare module.exports: any; -} - -declare module 'memfs/lib/Dirent' { - declare module.exports: any; -} - -declare module 'memfs/lib/encoding' { - declare module.exports: any; -} - -declare module 'memfs/lib/getBigInt' { - declare module.exports: any; -} - -declare module 'memfs/lib' { - declare module.exports: any; -} - -declare module 'memfs/lib/internal/buffer' { - declare module.exports: any; -} - -declare module 'memfs/lib/internal/errors' { - declare module.exports: any; -} - -declare module 'memfs/lib/node' { - declare module.exports: any; -} - -declare module 'memfs/lib/process' { - declare module.exports: any; -} - -declare module 'memfs/lib/promises' { - declare module.exports: any; -} - -declare module 'memfs/lib/setImmediate' { - declare module.exports: any; -} - -declare module 'memfs/lib/setTimeoutUnref' { - declare module.exports: any; -} - -declare module 'memfs/lib/Stats' { - declare module.exports: any; -} - -declare module 'memfs/lib/volume-localstorage' { - declare module.exports: any; -} - -declare module 'memfs/lib/volume' { - declare module.exports: any; -} - -// Filename aliases -declare module 'memfs/lib/constants.js' { - declare module.exports: $Exports<'memfs/lib/constants'>; -} -declare module 'memfs/lib/Dirent.js' { - declare module.exports: $Exports<'memfs/lib/Dirent'>; -} -declare module 'memfs/lib/encoding.js' { - declare module.exports: $Exports<'memfs/lib/encoding'>; -} -declare module 'memfs/lib/getBigInt.js' { - declare module.exports: $Exports<'memfs/lib/getBigInt'>; -} -declare module 'memfs/lib/index' { - declare module.exports: $Exports<'memfs/lib'>; -} -declare module 'memfs/lib/index.js' { - declare module.exports: $Exports<'memfs/lib'>; -} -declare module 'memfs/lib/internal/buffer.js' { - declare module.exports: $Exports<'memfs/lib/internal/buffer'>; -} -declare module 'memfs/lib/internal/errors.js' { - declare module.exports: $Exports<'memfs/lib/internal/errors'>; -} -declare module 'memfs/lib/node.js' { - declare module.exports: $Exports<'memfs/lib/node'>; -} -declare module 'memfs/lib/process.js' { - declare module.exports: $Exports<'memfs/lib/process'>; -} -declare module 'memfs/lib/promises.js' { - declare module.exports: $Exports<'memfs/lib/promises'>; -} -declare module 'memfs/lib/setImmediate.js' { - declare module.exports: $Exports<'memfs/lib/setImmediate'>; -} -declare module 'memfs/lib/setTimeoutUnref.js' { - declare module.exports: $Exports<'memfs/lib/setTimeoutUnref'>; -} -declare module 'memfs/lib/Stats.js' { - declare module.exports: $Exports<'memfs/lib/Stats'>; -} -declare module 'memfs/lib/volume-localstorage.js' { - declare module.exports: $Exports<'memfs/lib/volume-localstorage'>; -} -declare module 'memfs/lib/volume.js' { - declare module.exports: $Exports<'memfs/lib/volume'>; -} diff --git a/flow-typed/npm/merge-stream_vx.x.x.js b/flow-typed/npm/merge-stream_vx.x.x.js deleted file mode 100644 index 3eacea2632..0000000000 --- a/flow-typed/npm/merge-stream_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: ee6742b6c45b69886a2613151bb33f0d -// flow-typed version: <>/merge-stream_v^2.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'merge-stream' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'merge-stream' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'merge-stream/index' { - declare module.exports: $Exports<'merge-stream'>; -} -declare module 'merge-stream/index.js' { - declare module.exports: $Exports<'merge-stream'>; -} diff --git a/flow-typed/npm/mkdirp_vx.x.x.js b/flow-typed/npm/mkdirp_vx.x.x.js deleted file mode 100644 index cf3a98a837..0000000000 --- a/flow-typed/npm/mkdirp_vx.x.x.js +++ /dev/null @@ -1,80 +0,0 @@ -// flow-typed signature: 5362ddab67bd5a6b70a467d99c6f32be -// flow-typed version: <>/mkdirp_v^1.0.4/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'mkdirp' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'mkdirp' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'mkdirp/bin/cmd' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/find-made' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/mkdirp-manual' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/mkdirp-native' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/opts-arg' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/path-arg' { - declare module.exports: any; -} - -declare module 'mkdirp/lib/use-native' { - declare module.exports: any; -} - -// Filename aliases -declare module 'mkdirp/bin/cmd.js' { - declare module.exports: $Exports<'mkdirp/bin/cmd'>; -} -declare module 'mkdirp/index' { - declare module.exports: $Exports<'mkdirp'>; -} -declare module 'mkdirp/index.js' { - declare module.exports: $Exports<'mkdirp'>; -} -declare module 'mkdirp/lib/find-made.js' { - declare module.exports: $Exports<'mkdirp/lib/find-made'>; -} -declare module 'mkdirp/lib/mkdirp-manual.js' { - declare module.exports: $Exports<'mkdirp/lib/mkdirp-manual'>; -} -declare module 'mkdirp/lib/mkdirp-native.js' { - declare module.exports: $Exports<'mkdirp/lib/mkdirp-native'>; -} -declare module 'mkdirp/lib/opts-arg.js' { - declare module.exports: $Exports<'mkdirp/lib/opts-arg'>; -} -declare module 'mkdirp/lib/path-arg.js' { - declare module.exports: $Exports<'mkdirp/lib/path-arg'>; -} -declare module 'mkdirp/lib/use-native.js' { - declare module.exports: $Exports<'mkdirp/lib/use-native'>; -} diff --git a/flow-typed/npm/pinst_vx.x.x.js b/flow-typed/npm/pinst_vx.x.x.js deleted file mode 100644 index 35081c77b4..0000000000 --- a/flow-typed/npm/pinst_vx.x.x.js +++ /dev/null @@ -1,38 +0,0 @@ -// flow-typed signature: 913a7beff2730b1725cbc924497c37a8 -// flow-typed version: <>/pinst_v^2.1.4/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'pinst' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'pinst' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'pinst/bin' { - declare module.exports: any; -} - -// Filename aliases -declare module 'pinst/bin.js' { - declare module.exports: $Exports<'pinst/bin'>; -} -declare module 'pinst/index' { - declare module.exports: $Exports<'pinst'>; -} -declare module 'pinst/index.js' { - declare module.exports: $Exports<'pinst'>; -} diff --git a/flow-typed/npm/prettier_vx.x.x.js b/flow-typed/npm/prettier_vx.x.x.js deleted file mode 100644 index 273d1a24a9..0000000000 --- a/flow-typed/npm/prettier_vx.x.x.js +++ /dev/null @@ -1,143 +0,0 @@ -// flow-typed signature: 32a8f3c0a3d53e6ecc3e28d5abce7063 -// flow-typed version: <>/prettier_v^2.1.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'prettier' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'prettier' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'prettier/bin-prettier' { - declare module.exports: any; -} - -declare module 'prettier/doc' { - declare module.exports: any; -} - -declare module 'prettier/parser-angular' { - declare module.exports: any; -} - -declare module 'prettier/parser-babel' { - declare module.exports: any; -} - -declare module 'prettier/parser-espree' { - declare module.exports: any; -} - -declare module 'prettier/parser-flow' { - declare module.exports: any; -} - -declare module 'prettier/parser-glimmer' { - declare module.exports: any; -} - -declare module 'prettier/parser-graphql' { - declare module.exports: any; -} - -declare module 'prettier/parser-html' { - declare module.exports: any; -} - -declare module 'prettier/parser-markdown' { - declare module.exports: any; -} - -declare module 'prettier/parser-meriyah' { - declare module.exports: any; -} - -declare module 'prettier/parser-postcss' { - declare module.exports: any; -} - -declare module 'prettier/parser-typescript' { - declare module.exports: any; -} - -declare module 'prettier/parser-yaml' { - declare module.exports: any; -} - -declare module 'prettier/standalone' { - declare module.exports: any; -} - -declare module 'prettier/third-party' { - declare module.exports: any; -} - -// Filename aliases -declare module 'prettier/bin-prettier.js' { - declare module.exports: $Exports<'prettier/bin-prettier'>; -} -declare module 'prettier/doc.js' { - declare module.exports: $Exports<'prettier/doc'>; -} -declare module 'prettier/index' { - declare module.exports: $Exports<'prettier'>; -} -declare module 'prettier/index.js' { - declare module.exports: $Exports<'prettier'>; -} -declare module 'prettier/parser-angular.js' { - declare module.exports: $Exports<'prettier/parser-angular'>; -} -declare module 'prettier/parser-babel.js' { - declare module.exports: $Exports<'prettier/parser-babel'>; -} -declare module 'prettier/parser-espree.js' { - declare module.exports: $Exports<'prettier/parser-espree'>; -} -declare module 'prettier/parser-flow.js' { - declare module.exports: $Exports<'prettier/parser-flow'>; -} -declare module 'prettier/parser-glimmer.js' { - declare module.exports: $Exports<'prettier/parser-glimmer'>; -} -declare module 'prettier/parser-graphql.js' { - declare module.exports: $Exports<'prettier/parser-graphql'>; -} -declare module 'prettier/parser-html.js' { - declare module.exports: $Exports<'prettier/parser-html'>; -} -declare module 'prettier/parser-markdown.js' { - declare module.exports: $Exports<'prettier/parser-markdown'>; -} -declare module 'prettier/parser-meriyah.js' { - declare module.exports: $Exports<'prettier/parser-meriyah'>; -} -declare module 'prettier/parser-postcss.js' { - declare module.exports: $Exports<'prettier/parser-postcss'>; -} -declare module 'prettier/parser-typescript.js' { - declare module.exports: $Exports<'prettier/parser-typescript'>; -} -declare module 'prettier/parser-yaml.js' { - declare module.exports: $Exports<'prettier/parser-yaml'>; -} -declare module 'prettier/standalone.js' { - declare module.exports: $Exports<'prettier/standalone'>; -} -declare module 'prettier/third-party.js' { - declare module.exports: $Exports<'prettier/third-party'>; -} diff --git a/flow-typed/npm/raf_vx.x.x.js b/flow-typed/npm/raf_vx.x.x.js deleted file mode 100644 index 14b2bc85e9..0000000000 --- a/flow-typed/npm/raf_vx.x.x.js +++ /dev/null @@ -1,52 +0,0 @@ -// flow-typed signature: 4882787848856ef83f15e26dcb0d4296 -// flow-typed version: <>/raf_v^3.4.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'raf' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'raf' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'raf/polyfill' { - declare module.exports: any; -} - -declare module 'raf/test' { - declare module.exports: any; -} - -declare module 'raf/window' { - declare module.exports: any; -} - -// Filename aliases -declare module 'raf/index' { - declare module.exports: $Exports<'raf'>; -} -declare module 'raf/index.js' { - declare module.exports: $Exports<'raf'>; -} -declare module 'raf/polyfill.js' { - declare module.exports: $Exports<'raf/polyfill'>; -} -declare module 'raf/test.js' { - declare module.exports: $Exports<'raf/test'>; -} -declare module 'raf/window.js' { - declare module.exports: $Exports<'raf/window'>; -} diff --git a/flow-typed/npm/react-dom_v16.x.x.js b/flow-typed/npm/react-dom_v16.x.x.js deleted file mode 100644 index 889928b996..0000000000 --- a/flow-typed/npm/react-dom_v16.x.x.js +++ /dev/null @@ -1,110 +0,0 @@ -// flow-typed signature: a333d1cdbb5a4103d0be63a412070e22 -// flow-typed version: b2693c1879/react-dom_v16.x.x/flow_>=v0.117.x - -declare module 'react-dom' { - declare function findDOMNode( - componentOrElement: Element | ?React$Component, - ): null | Element | Text; - - declare function render( - element: React$Element, - container: Element, - callback?: () => void, - ): React$ElementRef; - - declare function hydrate( - element: React$Element, - container: Element, - callback?: () => void, - ): React$ElementRef; - - declare function createPortal( - node: React$Node, - container: Element, - ): React$Portal; - - declare function unmountComponentAtNode(container: any): boolean; - declare var version: string; - - declare function unstable_batchedUpdates( - callback: (a: A, b: B, c: C, d: D, e: E) => mixed, - a: A, - b: B, - c: C, - d: D, - e: E, - ): void; - declare function unstable_renderSubtreeIntoContainer< - ElementType: React$ElementType, - >( - parentComponent: React$Component, - nextElement: React$Element, - container: any, - callback?: () => void, - ): React$ElementRef; -} - -declare module 'react-dom/server' { - declare function renderToString(element: React$Node): string; - declare function renderToStaticMarkup(element: React$Node): string; - declare function renderToNodeStream(element: React$Node): stream$Readable; - declare function renderToStaticNodeStream( - element: React$Node, - ): stream$Readable; - declare var version: string; -} - -type Thenable = { then(resolve: () => mixed, reject?: () => mixed): mixed, ... }; - -declare module 'react-dom/test-utils' { - declare var Simulate: { [eventName: string]: (element: Element, eventData?: Object) => void, ... }; - declare function renderIntoDocument( - instance: React$Element, - ): React$Component; - declare function mockComponent( - componentClass: React$ElementType, - mockTagName?: string, - ): Object; - declare function isElement(element: React$Element): boolean; - declare function isElementOfType( - element: React$Element, - componentClass: React$ElementType, - ): boolean; - declare function isDOMComponent(instance: any): boolean; - declare function isCompositeComponent( - instance: React$Component, - ): boolean; - declare function isCompositeComponentWithType( - instance: React$Component, - componentClass: React$ElementType, - ): boolean; - declare function findAllInRenderedTree( - tree: React$Component, - test: (child: React$Component) => boolean, - ): Array>; - declare function scryRenderedDOMComponentsWithClass( - tree: React$Component, - className: string, - ): Array; - declare function findRenderedDOMComponentWithClass( - tree: React$Component, - className: string, - ): ?Element; - declare function scryRenderedDOMComponentsWithTag( - tree: React$Component, - tagName: string, - ): Array; - declare function findRenderedDOMComponentWithTag( - tree: React$Component, - tagName: string, - ): ?Element; - declare function scryRenderedComponentsWithType( - tree: React$Component, - componentClass: React$ElementType, - ): Array>; - declare function findRenderedComponentWithType( - tree: React$Component, - componentClass: React$ElementType, - ): ?React$Component; - declare function act(callback: () => void | Thenable): Thenable; -} diff --git a/flow-typed/npm/react-dom_v17.x.x.js b/flow-typed/npm/react-dom_v17.x.x.js new file mode 100644 index 0000000000..7c5fe5329e --- /dev/null +++ b/flow-typed/npm/react-dom_v17.x.x.js @@ -0,0 +1,139 @@ +// flow-typed signature: e556c06e721548417501c08b01fec911 +// flow-typed version: ad3adf2de8/react-dom_v17.x.x/flow_>=v0.127.x + +declare module 'react-dom' { + declare var version: string; + + declare function findDOMNode( + componentOrElement: Element | ?React$Component + ): null | Element | Text; + + declare function render( + element: React$Element, + container: Element, + callback?: () => void + ): React$ElementRef; + + declare function hydrate( + element: React$Element, + container: Element, + callback?: () => void + ): React$ElementRef; + + declare function createPortal( + node: React$Node, + container: Element + ): React$Portal; + + declare function unmountComponentAtNode(container: any): boolean; + + declare function unstable_batchedUpdates( + callback: (a: A, b: B, c: C, d: D, e: E) => mixed, + a: A, + b: B, + c: C, + d: D, + e: E + ): void; + + declare function unstable_renderSubtreeIntoContainer< + ElementType: React$ElementType + >( + parentComponent: React$Component, + nextElement: React$Element, + container: any, + callback?: () => void + ): React$ElementRef; +} + +declare module 'react-dom/server' { + declare var version: string; + + declare function renderToString(element: React$Node): string; + + declare function renderToStaticMarkup(element: React$Node): string; + + declare function renderToNodeStream(element: React$Node): stream$Readable; + + declare function renderToStaticNodeStream( + element: React$Node + ): stream$Readable; +} + +declare module 'react-dom/test-utils' { + declare interface Thenable { + then(resolve: () => mixed, reject?: () => mixed): mixed, + } + + declare var Simulate: { + [eventName: string]: ( + element: Element, + eventData?: { [key: string]: mixed, ... } + ) => void, + ... + }; + + declare function renderIntoDocument( + instance: React$Element + ): React$Component; + + declare function mockComponent( + componentClass: React$ElementType, + mockTagName?: string + ): { [key: string]: mixed, ... }; + + declare function isElement(element: React$Element): boolean; + + declare function isElementOfType( + element: React$Element, + componentClass: React$ElementType + ): boolean; + + declare function isDOMComponent(instance: any): boolean; + + declare function isCompositeComponent( + instance: React$Component + ): boolean; + + declare function isCompositeComponentWithType( + instance: React$Component, + componentClass: React$ElementType + ): boolean; + + declare function findAllInRenderedTree( + tree: React$Component, + test: (child: React$Component) => boolean + ): Array>; + + declare function scryRenderedDOMComponentsWithClass( + tree: React$Component, + className: string + ): Array; + + declare function findRenderedDOMComponentWithClass( + tree: React$Component, + className: string + ): ?Element; + + declare function scryRenderedDOMComponentsWithTag( + tree: React$Component, + tagName: string + ): Array; + + declare function findRenderedDOMComponentWithTag( + tree: React$Component, + tagName: string + ): ?Element; + + declare function scryRenderedComponentsWithType( + tree: React$Component, + componentClass: React$ElementType + ): Array>; + + declare function findRenderedComponentWithType( + tree: React$Component, + componentClass: React$ElementType + ): ?React$Component; + + declare function act(callback: () => void | Thenable): Thenable; +} diff --git a/flow-typed/npm/react-test-renderer_v16.x.x.js b/flow-typed/npm/react-test-renderer_v16.x.x.js deleted file mode 100644 index 44dc3e2c71..0000000000 --- a/flow-typed/npm/react-test-renderer_v16.x.x.js +++ /dev/null @@ -1,79 +0,0 @@ -// flow-typed signature: 7bac6c05f7415881918d3d510109e739 -// flow-typed version: fce74493f0/react-test-renderer_v16.x.x/flow_>=v0.104.x - -// Type definitions for react-test-renderer 16.x.x -// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer - -type ReactComponentInstance = React$Component; - -type ReactTestRendererJSON = { - type: string, - props: { [propName: string]: any, ... }, - children: null | ReactTestRendererJSON[], - ... -}; - -type ReactTestRendererTree = ReactTestRendererJSON & { - nodeType: "component" | "host", - instance: ?ReactComponentInstance, - rendered: null | ReactTestRendererTree, - ... -}; - -type ReactTestInstance = { - instance: ?ReactComponentInstance, - type: string, - props: { [propName: string]: any, ... }, - parent: null | ReactTestInstance, - children: Array, - find(predicate: (node: ReactTestInstance) => boolean): ReactTestInstance, - findByType(type: React$ElementType): ReactTestInstance, - findByProps(props: { [propName: string]: any, ... }): ReactTestInstance, - findAll( - predicate: (node: ReactTestInstance) => boolean, - options?: { deep: boolean, ... } - ): ReactTestInstance[], - findAllByType( - type: React$ElementType, - options?: { deep: boolean, ... } - ): ReactTestInstance[], - findAllByProps( - props: { [propName: string]: any, ... }, - options?: { deep: boolean, ... } - ): ReactTestInstance[], - ... -}; - -type TestRendererOptions = { createNodeMock(element: React$Element): any, ... }; - -declare module "react-test-renderer" { - declare export type ReactTestRenderer = { - toJSON(): null | ReactTestRendererJSON, - toTree(): null | ReactTestRendererTree, - unmount(nextElement?: React$Element): void, - update(nextElement: React$Element): void, - getInstance(): ?ReactComponentInstance, - root: ReactTestInstance, - ... - }; - - declare type Thenable = { then(resolve: () => mixed, reject?: () => mixed): mixed, ... }; - - declare function create( - nextElement: React$Element, - options?: TestRendererOptions - ): ReactTestRenderer; - - declare function act(callback: () => void | Promise): Thenable; -} - -declare module "react-test-renderer/shallow" { - declare export default class ShallowRenderer { - static createRenderer(): ShallowRenderer; - getMountedInstance(): ReactTestInstance; - getRenderOutput>(): E; - getRenderOutput(): React$Element; - render(element: React$Element, context?: any): void; - unmount(): void; - } -} diff --git a/flow-typed/npm/remark-cli_vx.x.x.js b/flow-typed/npm/remark-cli_vx.x.x.js deleted file mode 100644 index bf7f6a96f3..0000000000 --- a/flow-typed/npm/remark-cli_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 3f1ce81f27304703e06f078d74c03ff1 -// flow-typed version: <>/remark-cli_v^9.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-cli' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-cli' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'remark-cli/cli' { - declare module.exports: any; -} - -// Filename aliases -declare module 'remark-cli/cli.js' { - declare module.exports: $Exports<'remark-cli/cli'>; -} diff --git a/flow-typed/npm/remark-frontmatter_vx.x.x.js b/flow-typed/npm/remark-frontmatter_vx.x.x.js deleted file mode 100644 index 260d082309..0000000000 --- a/flow-typed/npm/remark-frontmatter_vx.x.x.js +++ /dev/null @@ -1,59 +0,0 @@ -// flow-typed signature: b35c3f08044d058f0270e3ee029deb32 -// flow-typed version: <>/remark-frontmatter_v^2.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-frontmatter' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-frontmatter' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'remark-frontmatter/lib/compile' { - declare module.exports: any; -} - -declare module 'remark-frontmatter/lib/fence' { - declare module.exports: any; -} - -declare module 'remark-frontmatter/lib/matters' { - declare module.exports: any; -} - -declare module 'remark-frontmatter/lib/parse' { - declare module.exports: any; -} - -// Filename aliases -declare module 'remark-frontmatter/index' { - declare module.exports: $Exports<'remark-frontmatter'>; -} -declare module 'remark-frontmatter/index.js' { - declare module.exports: $Exports<'remark-frontmatter'>; -} -declare module 'remark-frontmatter/lib/compile.js' { - declare module.exports: $Exports<'remark-frontmatter/lib/compile'>; -} -declare module 'remark-frontmatter/lib/fence.js' { - declare module.exports: $Exports<'remark-frontmatter/lib/fence'>; -} -declare module 'remark-frontmatter/lib/matters.js' { - declare module.exports: $Exports<'remark-frontmatter/lib/matters'>; -} -declare module 'remark-frontmatter/lib/parse.js' { - declare module.exports: $Exports<'remark-frontmatter/lib/parse'>; -} diff --git a/flow-typed/npm/remark-lint-first-heading-level_vx.x.x.js b/flow-typed/npm/remark-lint-first-heading-level_vx.x.x.js deleted file mode 100644 index b6ac2401ac..0000000000 --- a/flow-typed/npm/remark-lint-first-heading-level_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: e4ce111eda1fa2e433c1568a3b219047 -// flow-typed version: <>/remark-lint-first-heading-level_v^2.0.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-lint-first-heading-level' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-lint-first-heading-level' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'remark-lint-first-heading-level/index' { - declare module.exports: $Exports<'remark-lint-first-heading-level'>; -} -declare module 'remark-lint-first-heading-level/index.js' { - declare module.exports: $Exports<'remark-lint-first-heading-level'>; -} diff --git a/flow-typed/npm/remark-lint_vx.x.x.js b/flow-typed/npm/remark-lint_vx.x.x.js deleted file mode 100644 index e754efd965..0000000000 --- a/flow-typed/npm/remark-lint_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 1385452cf9d17a1ad727357227297f0f -// flow-typed version: <>/remark-lint_v^8.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-lint' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-lint' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'remark-lint/index' { - declare module.exports: $Exports<'remark-lint'>; -} -declare module 'remark-lint/index.js' { - declare module.exports: $Exports<'remark-lint'>; -} diff --git a/flow-typed/npm/remark-mdx_vx.x.x.js b/flow-typed/npm/remark-mdx_vx.x.x.js deleted file mode 100644 index 2fb9022a7e..0000000000 --- a/flow-typed/npm/remark-mdx_vx.x.x.js +++ /dev/null @@ -1,52 +0,0 @@ -// flow-typed signature: d72bc770c38620f50ac25791b95c86a2 -// flow-typed version: <>/remark-mdx_v^1.6.22/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-mdx' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-mdx' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'remark-mdx/block' { - declare module.exports: any; -} - -declare module 'remark-mdx/extract-imports-and-exports' { - declare module.exports: any; -} - -declare module 'remark-mdx/tag' { - declare module.exports: any; -} - -// Filename aliases -declare module 'remark-mdx/block.js' { - declare module.exports: $Exports<'remark-mdx/block'>; -} -declare module 'remark-mdx/extract-imports-and-exports.js' { - declare module.exports: $Exports<'remark-mdx/extract-imports-and-exports'>; -} -declare module 'remark-mdx/index' { - declare module.exports: $Exports<'remark-mdx'>; -} -declare module 'remark-mdx/index.js' { - declare module.exports: $Exports<'remark-mdx'>; -} -declare module 'remark-mdx/tag.js' { - declare module.exports: $Exports<'remark-mdx/tag'>; -} diff --git a/flow-typed/npm/remark-preset-lint-markdown-style-guide_vx.x.x.js b/flow-typed/npm/remark-preset-lint-markdown-style-guide_vx.x.x.js deleted file mode 100644 index c39a3d6d65..0000000000 --- a/flow-typed/npm/remark-preset-lint-markdown-style-guide_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: 8cb15f14e28bc72283e27cccb2e3822e -// flow-typed version: <>/remark-preset-lint-markdown-style-guide_v^4.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-preset-lint-markdown-style-guide' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-preset-lint-markdown-style-guide' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'remark-preset-lint-markdown-style-guide/index' { - declare module.exports: $Exports<'remark-preset-lint-markdown-style-guide'>; -} -declare module 'remark-preset-lint-markdown-style-guide/index.js' { - declare module.exports: $Exports<'remark-preset-lint-markdown-style-guide'>; -} diff --git a/flow-typed/npm/remark-preset-lint-recommended_vx.x.x.js b/flow-typed/npm/remark-preset-lint-recommended_vx.x.x.js deleted file mode 100644 index a9c37e8471..0000000000 --- a/flow-typed/npm/remark-preset-lint-recommended_vx.x.x.js +++ /dev/null @@ -1,33 +0,0 @@ -// flow-typed signature: f05ddc885c691f6c79c637f40f10973c -// flow-typed version: <>/remark-preset-lint-recommended_v^5.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-preset-lint-recommended' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-preset-lint-recommended' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ - - -// Filename aliases -declare module 'remark-preset-lint-recommended/index' { - declare module.exports: $Exports<'remark-preset-lint-recommended'>; -} -declare module 'remark-preset-lint-recommended/index.js' { - declare module.exports: $Exports<'remark-preset-lint-recommended'>; -} diff --git a/flow-typed/npm/remark-preset-prettier_vx.x.x.js b/flow-typed/npm/remark-preset-prettier_vx.x.x.js deleted file mode 100644 index 20df75b537..0000000000 --- a/flow-typed/npm/remark-preset-prettier_vx.x.x.js +++ /dev/null @@ -1,46 +0,0 @@ -// flow-typed signature: c62ac23f9f01af5c4efcdde87b756794 -// flow-typed version: <>/remark-preset-prettier_v^0.4.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-preset-prettier' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-preset-prettier' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'remark-preset-prettier/lib/cjs' { - declare module.exports: any; -} - -declare module 'remark-preset-prettier/lib/es2015' { - declare module.exports: any; -} - -declare module 'remark-preset-prettier/lib/esm' { - declare module.exports: any; -} - -// Filename aliases -declare module 'remark-preset-prettier/lib/cjs.js' { - declare module.exports: $Exports<'remark-preset-prettier/lib/cjs'>; -} -declare module 'remark-preset-prettier/lib/es2015.js' { - declare module.exports: $Exports<'remark-preset-prettier/lib/es2015'>; -} -declare module 'remark-preset-prettier/lib/esm.js' { - declare module.exports: $Exports<'remark-preset-prettier/lib/esm'>; -} diff --git a/flow-typed/npm/remark-validate-links_vx.x.x.js b/flow-typed/npm/remark-validate-links_vx.x.x.js deleted file mode 100644 index 4ed60967d7..0000000000 --- a/flow-typed/npm/remark-validate-links_vx.x.x.js +++ /dev/null @@ -1,131 +0,0 @@ -// flow-typed signature: 966cd2d5231e80c9140be7e1aaeaa187 -// flow-typed version: <>/remark-validate-links_v^10.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'remark-validate-links' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'remark-validate-links' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'remark-validate-links/lib/check/check-files.browser' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/check/check-files' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/check' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/check/merge-landmarks' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/check/merge-references' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/check/validate' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/constants' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/find/config' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/find/find-repo.browser' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/find/find-repo' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/find/find' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib/find' { - declare module.exports: any; -} - -declare module 'remark-validate-links/lib' { - declare module.exports: any; -} - -// Filename aliases -declare module 'remark-validate-links/index' { - declare module.exports: $Exports<'remark-validate-links'>; -} -declare module 'remark-validate-links/index.js' { - declare module.exports: $Exports<'remark-validate-links'>; -} -declare module 'remark-validate-links/lib/check/check-files.browser.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check/check-files.browser'>; -} -declare module 'remark-validate-links/lib/check/check-files.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check/check-files'>; -} -declare module 'remark-validate-links/lib/check/index' { - declare module.exports: $Exports<'remark-validate-links/lib/check'>; -} -declare module 'remark-validate-links/lib/check/index.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check'>; -} -declare module 'remark-validate-links/lib/check/merge-landmarks.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check/merge-landmarks'>; -} -declare module 'remark-validate-links/lib/check/merge-references.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check/merge-references'>; -} -declare module 'remark-validate-links/lib/check/validate.js' { - declare module.exports: $Exports<'remark-validate-links/lib/check/validate'>; -} -declare module 'remark-validate-links/lib/constants.js' { - declare module.exports: $Exports<'remark-validate-links/lib/constants'>; -} -declare module 'remark-validate-links/lib/find/config.js' { - declare module.exports: $Exports<'remark-validate-links/lib/find/config'>; -} -declare module 'remark-validate-links/lib/find/find-repo.browser.js' { - declare module.exports: $Exports<'remark-validate-links/lib/find/find-repo.browser'>; -} -declare module 'remark-validate-links/lib/find/find-repo.js' { - declare module.exports: $Exports<'remark-validate-links/lib/find/find-repo'>; -} -declare module 'remark-validate-links/lib/find/find.js' { - declare module.exports: $Exports<'remark-validate-links/lib/find/find'>; -} -declare module 'remark-validate-links/lib/find/index' { - declare module.exports: $Exports<'remark-validate-links/lib/find'>; -} -declare module 'remark-validate-links/lib/find/index.js' { - declare module.exports: $Exports<'remark-validate-links/lib/find'>; -} -declare module 'remark-validate-links/lib/index' { - declare module.exports: $Exports<'remark-validate-links/lib'>; -} -declare module 'remark-validate-links/lib/index.js' { - declare module.exports: $Exports<'remark-validate-links/lib'>; -} diff --git a/flow-typed/npm/rimraf_v2.x.x.js b/flow-typed/npm/rimraf_v2.x.x.js deleted file mode 100644 index 13b85249c4..0000000000 --- a/flow-typed/npm/rimraf_v2.x.x.js +++ /dev/null @@ -1,18 +0,0 @@ -// flow-typed signature: 1dff23447d5e18f5ac2b05aaec7cfb74 -// flow-typed version: a453e98ea2/rimraf_v2.x.x/flow_>=v0.25.0 - -declare module 'rimraf' { - declare type Options = { - maxBusyTries?: number, - emfileWait?: number, - glob?: boolean, - disableGlob?: boolean - }; - - declare type Callback = (err: ?Error, path: ?string) => void; - - declare module.exports: { - (f: string, opts?: Options | Callback, callback?: Callback): void; - sync(path: string, opts?: Options): void; - }; -} diff --git a/flow-typed/npm/rimraf_vx.x.x.js b/flow-typed/npm/rimraf_vx.x.x.js deleted file mode 100644 index d9b001f4d4..0000000000 --- a/flow-typed/npm/rimraf_vx.x.x.js +++ /dev/null @@ -1,39 +0,0 @@ -// flow-typed signature: 6aae6645894163d28fcece7fdf15113c -// flow-typed version: <>/rimraf_v^3.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'rimraf' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'rimraf' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'rimraf/bin' { - declare module.exports: any; -} - -declare module 'rimraf/rimraf' { - declare module.exports: any; -} - -// Filename aliases -declare module 'rimraf/bin.js' { - declare module.exports: $Exports<'rimraf/bin'>; -} -declare module 'rimraf/rimraf.js' { - declare module.exports: $Exports<'rimraf/rimraf'>; -} diff --git a/flow-typed/npm/sharp_vx.x.x.js b/flow-typed/npm/sharp_vx.x.x.js deleted file mode 100644 index d549e9f969..0000000000 --- a/flow-typed/npm/sharp_vx.x.x.js +++ /dev/null @@ -1,140 +0,0 @@ -// flow-typed signature: 17a964bd6b4e07a47536f427557ea194 -// flow-typed version: <>/sharp_v^0.27.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'sharp' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'sharp' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'sharp/install/dll-copy' { - declare module.exports: any; -} - -declare module 'sharp/install/libvips' { - declare module.exports: any; -} - -declare module 'sharp/lib/agent' { - declare module.exports: any; -} - -declare module 'sharp/lib/channel' { - declare module.exports: any; -} - -declare module 'sharp/lib/colour' { - declare module.exports: any; -} - -declare module 'sharp/lib/composite' { - declare module.exports: any; -} - -declare module 'sharp/lib/constructor' { - declare module.exports: any; -} - -declare module 'sharp/lib' { - declare module.exports: any; -} - -declare module 'sharp/lib/input' { - declare module.exports: any; -} - -declare module 'sharp/lib/is' { - declare module.exports: any; -} - -declare module 'sharp/lib/libvips' { - declare module.exports: any; -} - -declare module 'sharp/lib/operation' { - declare module.exports: any; -} - -declare module 'sharp/lib/output' { - declare module.exports: any; -} - -declare module 'sharp/lib/platform' { - declare module.exports: any; -} - -declare module 'sharp/lib/resize' { - declare module.exports: any; -} - -declare module 'sharp/lib/utility' { - declare module.exports: any; -} - -// Filename aliases -declare module 'sharp/install/dll-copy.js' { - declare module.exports: $Exports<'sharp/install/dll-copy'>; -} -declare module 'sharp/install/libvips.js' { - declare module.exports: $Exports<'sharp/install/libvips'>; -} -declare module 'sharp/lib/agent.js' { - declare module.exports: $Exports<'sharp/lib/agent'>; -} -declare module 'sharp/lib/channel.js' { - declare module.exports: $Exports<'sharp/lib/channel'>; -} -declare module 'sharp/lib/colour.js' { - declare module.exports: $Exports<'sharp/lib/colour'>; -} -declare module 'sharp/lib/composite.js' { - declare module.exports: $Exports<'sharp/lib/composite'>; -} -declare module 'sharp/lib/constructor.js' { - declare module.exports: $Exports<'sharp/lib/constructor'>; -} -declare module 'sharp/lib/index' { - declare module.exports: $Exports<'sharp/lib'>; -} -declare module 'sharp/lib/index.js' { - declare module.exports: $Exports<'sharp/lib'>; -} -declare module 'sharp/lib/input.js' { - declare module.exports: $Exports<'sharp/lib/input'>; -} -declare module 'sharp/lib/is.js' { - declare module.exports: $Exports<'sharp/lib/is'>; -} -declare module 'sharp/lib/libvips.js' { - declare module.exports: $Exports<'sharp/lib/libvips'>; -} -declare module 'sharp/lib/operation.js' { - declare module.exports: $Exports<'sharp/lib/operation'>; -} -declare module 'sharp/lib/output.js' { - declare module.exports: $Exports<'sharp/lib/output'>; -} -declare module 'sharp/lib/platform.js' { - declare module.exports: $Exports<'sharp/lib/platform'>; -} -declare module 'sharp/lib/resize.js' { - declare module.exports: $Exports<'sharp/lib/resize'>; -} -declare module 'sharp/lib/utility.js' { - declare module.exports: $Exports<'sharp/lib/utility'>; -} diff --git a/flow-typed/npm/styled-components_v4.x.x.js b/flow-typed/npm/styled-components_v4.x.x.js deleted file mode 100644 index 9a6de0573d..0000000000 --- a/flow-typed/npm/styled-components_v4.x.x.js +++ /dev/null @@ -1,449 +0,0 @@ -// flow-typed signature: c17015ec421be0534f16a612e1354d1f -// flow-typed version: 52fe4a44bf/styled-components_v4.x.x/flow_>=v0.104.x - -// @flow - -declare module 'styled-components' { - declare class InterpolatableComponent

extends React$Component

{ - static +styledComponentId: string; - } - - declare export type Interpolation

= - | ((executionContext: P) => - | ((executionContext: P) => InterpolationBase) - | InterpolationBase - ) - | Class> - | InterpolationBase - - declare export type InterpolationBase = - | CSSRules - | KeyFrames - | string - | number - | false // falsy values are OK, true is the only one not allowed, because it renders as "true" - | null - | void - | {[ruleOrSelector: string]: string | number, ...} // CSS-in-JS object returned by polished are also supported, partially - - declare export type TaggedTemplateLiteral = { - [[call]]: (strings: string[], ...interpolations: Interpolation[]) => R, - [[call]]: ((props: I) => Interpolation) => R, - ... - }; - - // Should this be `mixed` perhaps? - declare export type CSSRules = Interpolation[] // eslint-disable-line flowtype/no-weak-types - - declare export type CSSConstructor = TaggedTemplateLiteral // eslint-disable-line flowtype/no-weak-types - declare export type KeyFramesConstructor = TaggedTemplateLiteral // eslint-disable-line flowtype/no-weak-types - declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral> // eslint-disable-line flowtype/no-weak-types - - declare interface Tag { - styleTag: HTMLStyleElement | null; - getIds(): string[]; - hasNameForId(id: string, name: string): boolean; - insertMarker(id: string): T; - insertRules(id: string, cssRules: string[], name: ?string): void; - removeRules(id: string): void; - css(): string; - toHTML(additionalAttrs: ?string): string; - toElement(): React$Element<*>; - clone(): Tag; - sealed: boolean; - } - - // The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over - declare export class StyleSheet { - static get master() : StyleSheet; - static get instance() : StyleSheet; - static reset(forceServer? : boolean) : void; - - id : number; - forceServer : boolean; - target : ?HTMLElement; - tagMap : { [string]: Tag, ... }; // eslint-disable-line flowtype/no-weak-types - deferred: { [string]: string[] | void, ... }; - rehydratedNames: { [string]: boolean, ... }; - ignoreRehydratedNames: { [string]: boolean, ... }; - tags: Tag[]; // eslint-disable-line flowtype/no-weak-types - importRuleTag: Tag; // eslint-disable-line flowtype/no-weak-types - capacity: number; - clones: StyleSheet[]; - - constructor(?HTMLElement) : this; - rehydrate() : this; - clone() : StyleSheet; - sealAllTags() : void; - makeTag(tag : ?Tag) : Tag; // eslint-disable-line flowtype/no-weak-types - getImportRuleTag() : Tag; // eslint-disable-line flowtype/no-weak-types - getTagForId(id : string): Tag; // eslint-disable-line flowtype/no-weak-types - hasId(id: string) : boolean; - hasNameForId(id: string, name: string) : boolean; - deferredInject(id : string, cssRules : string[]) : void; - inject(id: string, cssRules : string[], name? : string) : void; - remove(id : string) : void; - toHtml() : string; - toReactElements() : React$ElementType[]; - } - - declare export function isStyledComponent(target: any): boolean; - - declare type SCMProps = { - children?: React$Element, - sheet?: StyleSheet, - target?: HTMLElement, - ... - } - - declare export var StyleSheetContext: React$Context; - declare export var StyleSheetConsumer : React$ComponentType<{| - children: (value: StyleSheet) => ?React$Node - |}> - declare var StyleSheetProvider: React$ComponentType<{| - children?: React$Node, - value: StyleSheet, - |}> - - declare export class StyleSheetManager extends React$Component { - getContext(sheet: ?StyleSheet, target: ?HTMLElement): StyleSheet; - render(): React$Element - } - - declare export class ServerStyleSheet { - instance: StyleSheet; - masterSheet: StyleSheet; - sealed: boolean; - - seal(): void; - //$FlowFixMe - collectStyles(children: any): React$Element; - getStyleTags(): string; - toReactElements(): React$ElementType[]; - // This seems to be use a port of node streams in the Browsers. Not gonna type this for now - // eslint-disable-next-line flowtype/no-weak-types - interleaveWithNodeStream(stream: any): any; - } - - declare export class KeyFrames { - id : string; - name : string; - rules : string[]; - - constructor(name : string, rules : string[]) : this; - inject(StyleSheet) : void; - toString() : string; - getName() : string; - } - - // I think any is appropriate here? - // eslint-disable-next-line flowtype/no-weak-types - declare export var css : CSSConstructor; - declare export var keyframes : KeyFramesConstructor; - declare export var createGlobalStyle : CreateGlobalStyleConstructor - declare export var ThemeConsumer : React$ComponentType<{| - children: (value: mixed) => ?React$Node - |}> - declare export var ThemeProvider: React$ComponentType<{| - children?: ?React$Node, - theme: mixed | (mixed) => mixed, - |}> - - /** - Any because the intended use-case is for users to do: - - import {ThemeContext} from 'styled-components'; - ... - const theme = React.useContext(ThemeContext); - - If they want DRY-er code, they could declare their own version of this via something like - - import { ThemeContext as SCThemeContext } from 'styled-components'; - export const ThemeContext: React$Context = SCThemeContext; - - and then - - import {ThemeContext} from './theme'; - */ - // eslint-disable-next-line flowtype/no-weak-types - declare export var ThemeContext: React$Context; - - declare export type ThemeProps = {| - theme: T - |} - - declare type CommonSCProps = {| - children?: React$Node, - className?: ?string, - style?: {[string]: string | number, ...}, - |} - - declare export type PropsWithTheme = {| - ...ThemeProps, - ...CommonSCProps, // Not sure how useful this is here, but it's technically correct to have it - ...$Exact - |} - - declare export function withTheme(Component: React$AbstractComponent): React$AbstractComponent<$Diff>, Instance> - - declare export type StyledComponent, ...CommonSCProps, ...}> = React$AbstractComponent & Class> - - declare export type StyledFactory = {| - [[call]]: TaggedTemplateLiteral, StyledComponent>; - +attrs: (((StyleProps) => A) | A) => TaggedTemplateLiteral< - PropsWithTheme<{|...$Exact, ...$Exact|}, Theme>, - StyledComponent, ...$Exact|}, $Exact>, Theme, Instance> - >; - |} - - declare export type StyledShorthandFactory = {| - [[call]]: (string[], ...Interpolation>[]) => StyledComponent; - [[call]]: ((props: PropsWithTheme) => Interpolation) => StyledComponent; - +attrs: (((StyleProps) => A) | A) => TaggedTemplateLiteral< - PropsWithTheme<{|...$Exact, ...$Exact|}, Theme>, - StyledComponent, ...$Exact|}, $Exact>, Theme, V> - >; - |} - - - declare type BuiltinElementInstances = { - a: React$ElementRef<'a'>, - abbr: React$ElementRef<'abbr'>, - address: React$ElementRef<'address'>, - area: React$ElementRef<'area'>, - article: React$ElementRef<'article'>, - aside: React$ElementRef<'aside'>, - audio: React$ElementRef<'audio'>, - b: React$ElementRef<'b'>, - base: React$ElementRef<'base'>, - bdi: React$ElementRef<'bdi'>, - bdo: React$ElementRef<'bdo'>, - big: React$ElementRef<'big'>, - blockquote: React$ElementRef<'blockquote'>, - body: React$ElementRef<'body'>, - br: React$ElementRef<'br'>, - button: React$ElementRef<'button'>, - canvas: React$ElementRef<'canvas'>, - caption: React$ElementRef<'caption'>, - cite: React$ElementRef<'cite'>, - code: React$ElementRef<'code'>, - col: React$ElementRef<'col'>, - colgroup: React$ElementRef<'colgroup'>, - data: React$ElementRef<'data'>, - datalist: React$ElementRef<'datalist'>, - dd: React$ElementRef<'dd'>, - del: React$ElementRef<'del'>, - details: React$ElementRef<'details'>, - dfn: React$ElementRef<'dfn'>, - dialog: React$ElementRef<'dialog'>, - div: React$ElementRef<'div'>, - dl: React$ElementRef<'dl'>, - dt: React$ElementRef<'dt'>, - em: React$ElementRef<'em'>, - embed: React$ElementRef<'embed'>, - fieldset: React$ElementRef<'fieldset'>, - figcaption: React$ElementRef<'figcaption'>, - figure: React$ElementRef<'figure'>, - footer: React$ElementRef<'footer'>, - form: React$ElementRef<'form'>, - h1: React$ElementRef<'h1'>, - h2: React$ElementRef<'h2'>, - h3: React$ElementRef<'h3'>, - h4: React$ElementRef<'h4'>, - h5: React$ElementRef<'h5'>, - h6: React$ElementRef<'h6'>, - head: React$ElementRef<'head'>, - header: React$ElementRef<'header'>, - hgroup: React$ElementRef<'hgroup'>, - hr: React$ElementRef<'hr'>, - html: React$ElementRef<'html'>, - i: React$ElementRef<'i'>, - iframe: React$ElementRef<'iframe'>, - img: React$ElementRef<'img'>, - input: React$ElementRef<'input'>, - ins: React$ElementRef<'ins'>, - kbd: React$ElementRef<'kbd'>, - label: React$ElementRef<'label'>, - legend: React$ElementRef<'legend'>, - li: React$ElementRef<'li'>, - link: React$ElementRef<'link'>, - main: React$ElementRef<'main'>, - map: React$ElementRef<'map'>, - mark: React$ElementRef<'mark'>, - menu: React$ElementRef<'menu'>, - meta: React$ElementRef<'meta'>, - meter: React$ElementRef<'meter'>, - nav: React$ElementRef<'nav'>, - noscript: React$ElementRef<'noscript'>, - object: React$ElementRef<'object'>, - ol: React$ElementRef<'ol'>, - optgroup: React$ElementRef<'optgroup'>, - option: React$ElementRef<'option'>, - output: React$ElementRef<'output'>, - p: React$ElementRef<'p'>, - param: React$ElementRef<'param'>, - picture: React$ElementRef<'picture'>, - pre: React$ElementRef<'pre'>, - progress: React$ElementRef<'progress'>, - q: React$ElementRef<'q'>, - rp: React$ElementRef<'rp'>, - rt: React$ElementRef<'rt'>, - ruby: React$ElementRef<'ruby'>, - s: React$ElementRef<'s'>, - samp: React$ElementRef<'samp'>, - script: React$ElementRef<'script'>, - section: React$ElementRef<'section'>, - select: React$ElementRef<'select'>, - small: React$ElementRef<'small'>, - source: React$ElementRef<'source'>, - span: React$ElementRef<'span'>, - strong: React$ElementRef<'strong'>, - style: React$ElementRef<'style'>, - sub: React$ElementRef<'sub'>, - summary: React$ElementRef<'summary'>, - sup: React$ElementRef<'sup'>, - table: React$ElementRef<'table'>, - tbody: React$ElementRef<'tbody'>, - td: React$ElementRef<'td'>, - textarea: React$ElementRef<'textarea'>, - tfoot: React$ElementRef<'tfoot'>, - th: React$ElementRef<'th'>, - thead: React$ElementRef<'thead'>, - time: React$ElementRef<'time'>, - title: React$ElementRef<'title'>, - tr: React$ElementRef<'tr'>, - track: React$ElementRef<'track'>, - u: React$ElementRef<'u'>, - ul: React$ElementRef<'ul'>, - var: React$ElementRef<'var'>, - video: React$ElementRef<'video'>, - wbr: React$ElementRef<'wbr'>, - // SVG - circle: React$ElementRef<'circle'>, - clipPath: React$ElementRef<'clipPath'>, - defs: React$ElementRef<'defs'>, - ellipse: React$ElementRef<'ellipse'>, - g: React$ElementRef<'g'>, - image: React$ElementRef<'image'>, - line: React$ElementRef<'line'>, - linearGradient: React$ElementRef<'linearGradient'>, - mask: React$ElementRef<'mask'>, - path: React$ElementRef<'path'>, - pattern: React$ElementRef<'pattern'>, - polygon: React$ElementRef<'polygon'>, - polyline: React$ElementRef<'polyline'>, - radialGradient: React$ElementRef<'radialGradient'>, - rect: React$ElementRef<'rect'>, - stop: React$ElementRef<'stop'>, - svg: React$ElementRef<'svg'>, - text: React$ElementRef<'text'>, - tspan: React$ElementRef<'tspan'>, - // Deprecated, should be HTMLUnknownElement, but Flow doesn't support it - keygen: React$ElementRef<'keygen'>, - menuitem: React$ElementRef<'menuitem'>, - ... - } - - declare type BuiltinElementType = $ElementType - - declare type ConvenientShorthands = $ObjMap< - BuiltinElementInstances, - (V) => StyledShorthandFactory - > - - declare interface Styled { - >(ElementName): StyledFactory>; - , Theme, OwnProps = React$ElementConfig>(Comp): StyledFactory<{|...$Exact|}, Theme, Comp>; - } - - declare export default Styled & ConvenientShorthands -} - - -declare module 'styled-components/native' { - import type { - CSSRules, - CSSConstructor, - KeyFramesConstructor, - CreateGlobalStyleConstructor, - StyledComponent, - Interpolation, - - // "private" types - TaggedTemplateLiteral, - StyledFactory, - StyledShorthandFactory, - ThemeProps, - PropsWithTheme, - } from 'styled-components'; - - declare type BuiltinElementInstances = { - ActivityIndicator: React$ComponentType<{...}>, - ActivityIndicatorIOS: React$ComponentType<{...}>, - ART: React$ComponentType<{...}>, - Button: React$ComponentType<{...}>, - DatePickerIOS: React$ComponentType<{...}>, - DrawerLayoutAndroid: React$ComponentType<{...}>, - Image: React$ComponentType<{...}>, - ImageBackground: React$ComponentType<{...}>, - ImageEditor: React$ComponentType<{...}>, - ImageStore: React$ComponentType<{...}>, - KeyboardAvoidingView: React$ComponentType<{...}>, - ListView: React$ComponentType<{...}>, - MapView: React$ComponentType<{...}>, - Modal: React$ComponentType<{...}>, - NavigatorIOS: React$ComponentType<{...}>, - Picker: React$ComponentType<{...}>, - PickerIOS: React$ComponentType<{...}>, - ProgressBarAndroid: React$ComponentType<{...}>, - ProgressViewIOS: React$ComponentType<{...}>, - ScrollView: React$ComponentType<{...}>, - SegmentedControlIOS: React$ComponentType<{...}>, - Slider: React$ComponentType<{...}>, - SliderIOS: React$ComponentType<{...}>, - SnapshotViewIOS: React$ComponentType<{...}>, - Switch: React$ComponentType<{...}>, - RecyclerViewBackedScrollView: React$ComponentType<{...}>, - RefreshControl: React$ComponentType<{...}>, - SafeAreaView: React$ComponentType<{...}>, - StatusBar: React$ComponentType<{...}>, - SwipeableListView: React$ComponentType<{...}>, - SwitchAndroid: React$ComponentType<{...}>, - SwitchIOS: React$ComponentType<{...}>, - TabBarIOS: React$ComponentType<{...}>, - Text: React$ComponentType<{...}>, - TextInput: React$ComponentType<{...}>, - ToastAndroid: React$ComponentType<{...}>, - ToolbarAndroid: React$ComponentType<{...}>, - Touchable: React$ComponentType<{...}>, - TouchableHighlight: React$ComponentType<{...}>, - TouchableNativeFeedback: React$ComponentType<{...}>, - TouchableOpacity: React$ComponentType<{...}>, - TouchableWithoutFeedback: React$ComponentType<{...}>, - View: React$ComponentType<{...}>, - ViewPagerAndroid: React$ComponentType<{...}>, - WebView: React$ComponentType<{...}>, - FlatList: React$ComponentType<{...}>, - SectionList: React$ComponentType<{...}>, - VirtualizedList: React$ComponentType<{...}>, - ... - } - - declare type BuiltinElementType = $ElementType - - declare type ConvenientShorthands = $ObjMap< - BuiltinElementInstances, - (V) => StyledShorthandFactory - > - - declare interface Styled { - >(ElementName): StyledFactory>; - , Theme, OwnProps = React$ElementConfig>(Comp): StyledFactory<{|...$Exact|}, Theme, Comp>; - } - - declare export default Styled & ConvenientShorthands -} - -declare module 'styled-components/macro' { - declare export * from 'styled-components'; -} diff --git a/flow-typed/npm/styled-components_v5.x.x.js b/flow-typed/npm/styled-components_v5.x.x.js new file mode 100644 index 0000000000..9e2797dd0a --- /dev/null +++ b/flow-typed/npm/styled-components_v5.x.x.js @@ -0,0 +1,531 @@ +// flow-typed signature: ff5fd8efec7131ad9a2c76baef58d620 +// flow-typed version: 80277df6ae/styled-components_v5.x.x/flow_>=v0.134.x + +// @flow + +declare module 'styled-components' { + declare class InterpolatableComponent

extends React$Component

{ + static +styledComponentId: string; + } + + declare export type Styles = { + [ruleOrSelector: string]: string | number, // | Styles, + ..., + }; + + declare export type Interpolation

= + | (( + executionContext: P + ) => ((executionContext: P) => InterpolationBase) | InterpolationBase) + | InterpolationBase; + + declare export type InterpolationBase = + | CSSRules + | KeyFrames + | string + | number + | false // falsy values are OK, true is the only one not allowed, because it renders as "true" + | null + | void + | Styles + | Class>; // eslint-disable-line flowtype/no-weak-types + + declare export type TaggedTemplateLiteral = { + [[call]]: (strings: string[], ...interpolations: Interpolation[]) => R, + [[call]]: ((props: I) => Interpolation) => R, + ... + }; + + // Should this be `mixed` perhaps? + declare export type CSSRules = Interpolation[]; // eslint-disable-line flowtype/no-weak-types + + declare export type CSSConstructor = TaggedTemplateLiteral; // eslint-disable-line flowtype/no-weak-types + declare export type KeyFramesConstructor = TaggedTemplateLiteral< + any, // eslint-disable-line flowtype/no-weak-types + KeyFrames + >; + declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral< + any, // eslint-disable-line flowtype/no-weak-types + React$ComponentType + >; + + declare interface Tag { + styleTag: HTMLStyleElement | null; + getIds(): string[]; + hasNameForId(id: string, name: string): boolean; + insertMarker(id: string): T; + insertRules(id: string, cssRules: string[], name: ?string): void; + removeRules(id: string): void; + css(): string; + toHTML(additionalAttrs: ?string): string; + toElement(): React$Element; + clone(): Tag; + sealed: boolean; + } + + // The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over + declare export class StyleSheet { + static get master(): StyleSheet; + static get instance(): StyleSheet; + static reset(forceServer?: boolean): void; + + id: number; + forceServer: boolean; + target: ?HTMLElement; + tagMap: { [string]: Tag, ... }; // eslint-disable-line flowtype/no-weak-types + deferred: { [string]: string[] | void, ... }; + rehydratedNames: { [string]: boolean, ... }; + ignoreRehydratedNames: { [string]: boolean, ... }; + tags: Tag[]; // eslint-disable-line flowtype/no-weak-types + importRuleTag: Tag; // eslint-disable-line flowtype/no-weak-types + capacity: number; + clones: StyleSheet[]; + + constructor(?HTMLElement): this; + rehydrate(): this; + clone(): StyleSheet; + sealAllTags(): void; + makeTag(tag: ?Tag): Tag; // eslint-disable-line flowtype/no-weak-types + getImportRuleTag(): Tag; // eslint-disable-line flowtype/no-weak-types + getTagForId(id: string): Tag; // eslint-disable-line flowtype/no-weak-types + hasId(id: string): boolean; + hasNameForId(id: string, name: string): boolean; + deferredInject(id: string, cssRules: string[]): void; + inject(id: string, cssRules: string[], name?: string): void; + remove(id: string): void; + toHtml(): string; + toReactElements(): React$ElementType[]; + } + + declare export function isStyledComponent(target: mixed): boolean; + + declare type SCMProps = { + children?: React$Node, + sheet?: StyleSheet, + target?: HTMLElement, + ... + }; + + declare export var StyleSheetContext: React$Context; + declare export var StyleSheetConsumer: React$ComponentType<{| + children: (value: StyleSheet) => ?React$Node, + |}>; + declare var StyleSheetProvider: React$ComponentType<{| + children?: React$Node, + value: StyleSheet, + |}>; + + /** + * plugin + * + * @param {number} context + * @param {Array} selector + * @param {Array} parent + * @param {string} content + * @param {number} line + * @param {number} column + * @param {number} length + * @return {(string|void)?} + */ + + declare type StylisPluginSignature = ( + context: number, + selector: string[], + parent: string[], + content: string, + line: number, + column: number, + length: number + ) => string | void; + + declare export class StyleSheetManager extends React$Component { + getContext(sheet: ?StyleSheet, target: ?HTMLElement): StyleSheet; + render(): React$Element; + stylisPlugins?: StylisPluginSignature[]; + disableVendorPrefixes?: boolean; + disableCSSOMInjection?: boolean; + } + + declare export class ServerStyleSheet { + instance: StyleSheet; + masterSheet: StyleSheet; + sealed: boolean; + + seal(): void; + collectStyles(children: any): React$Element; // eslint-disable-line flowtype/no-weak-types + getStyleTags(): string; + toReactElements(): React$ElementType[]; + // This seems to be use a port of node streams in the Browsers. Not gonna type this for now + // eslint-disable-next-line flowtype/no-weak-types + interleaveWithNodeStream(stream: any): any; + } + + declare export class KeyFrames { + id: string; + name: string; + rules: string[]; + + constructor(name: string, rules: string[]): this; + inject(StyleSheet): void; + toString(): string; + getName(): string; + } + + // I think any is appropriate here? + // eslint-disable-next-line flowtype/no-weak-types + declare export var css: CSSConstructor; + declare export var keyframes: KeyFramesConstructor; + declare export var createGlobalStyle: CreateGlobalStyleConstructor; + declare export var ThemeConsumer: React$ComponentType<{| + children: (value: mixed) => ?React$Node, + |}>; + declare export var ThemeProvider: React$ComponentType<{| + children?: ?React$Node, + theme: mixed | (mixed => mixed), + |}>; + + /** + Any because the intended use-case is for users to do: + + import {ThemeContext} from 'styled-components'; + ... + const theme = React.useContext(ThemeContext); + + If they want DRY-er code, they could declare their own version of this via something like + + import { ThemeContext as SCThemeContext } from 'styled-components'; + export const ThemeContext: React$Context = SCThemeContext; + + and then + + import {ThemeContext} from './theme'; + */ + // eslint-disable-next-line flowtype/no-weak-types + declare export var ThemeContext: React$Context; + + declare export type ThemeProps = {| + theme: T, + |}; + + declare type CommonSCProps = {| + children?: React$Node, + className?: ?string, + style?: { [string]: string | number, ... }, + ref?: React$Ref, // eslint-disable-line flowtype/no-weak-types + |}; + + declare export type PropsWithTheme = {| + ...ThemeProps, + ...CommonSCProps, // Not sure how useful this is here, but it's technically correct to have it + ...$Exact, + |}; + + declare export function withTheme( + Component: React$AbstractComponent + ): React$AbstractComponent<$Diff>, Instance>; + + declare export function useTheme(): Theme; + + declare export type StyledComponent< + Props, + Theme, + Instance, + MergedProps = { ...$Exact, ...CommonSCProps, ... } + > = React$AbstractComponent & + Class>; + + declare export type StyledFactory = {| + [[call]]: TaggedTemplateLiteral< + PropsWithTheme, + StyledComponent + >, + +attrs: ( + (StyleProps => A) | A + ) => TaggedTemplateLiteral< + PropsWithTheme<{| ...$Exact, ...$Exact |}, Theme>, + StyledComponent< + React$Config<{| ...$Exact, ...$Exact |}, $Exact>, + Theme, + Instance + > + >, + |}; + + declare export type StyledShorthandFactory = {| + [[call]]: ( + string[], + ...Interpolation>[] + ) => StyledComponent, + [[call]]: ( + (props: PropsWithTheme) => Interpolation // eslint-disable-line flowtype/no-weak-types + ) => StyledComponent, + +attrs: ( + (StyleProps => A) | A + ) => TaggedTemplateLiteral< + PropsWithTheme<{| ...$Exact, ...$Exact |}, Theme>, + StyledComponent< + React$Config<{| ...$Exact, ...$Exact |}, $Exact>, + Theme, + V + > + >, + |}; + + declare type BuiltinElementInstances = { + a: React$ElementRef<'a'>, + abbr: React$ElementRef<'abbr'>, + address: React$ElementRef<'address'>, + area: React$ElementRef<'area'>, + article: React$ElementRef<'article'>, + aside: React$ElementRef<'aside'>, + audio: React$ElementRef<'audio'>, + b: React$ElementRef<'b'>, + base: React$ElementRef<'base'>, + bdi: React$ElementRef<'bdi'>, + bdo: React$ElementRef<'bdo'>, + big: React$ElementRef<'big'>, + blockquote: React$ElementRef<'blockquote'>, + body: React$ElementRef<'body'>, + br: React$ElementRef<'br'>, + button: React$ElementRef<'button'>, + canvas: React$ElementRef<'canvas'>, + caption: React$ElementRef<'caption'>, + cite: React$ElementRef<'cite'>, + code: React$ElementRef<'code'>, + col: React$ElementRef<'col'>, + colgroup: React$ElementRef<'colgroup'>, + data: React$ElementRef<'data'>, + datalist: React$ElementRef<'datalist'>, + dd: React$ElementRef<'dd'>, + del: React$ElementRef<'del'>, + details: React$ElementRef<'details'>, + dfn: React$ElementRef<'dfn'>, + dialog: React$ElementRef<'dialog'>, + div: React$ElementRef<'div'>, + dl: React$ElementRef<'dl'>, + dt: React$ElementRef<'dt'>, + em: React$ElementRef<'em'>, + embed: React$ElementRef<'embed'>, + fieldset: React$ElementRef<'fieldset'>, + figcaption: React$ElementRef<'figcaption'>, + figure: React$ElementRef<'figure'>, + footer: React$ElementRef<'footer'>, + form: React$ElementRef<'form'>, + h1: React$ElementRef<'h1'>, + h2: React$ElementRef<'h2'>, + h3: React$ElementRef<'h3'>, + h4: React$ElementRef<'h4'>, + h5: React$ElementRef<'h5'>, + h6: React$ElementRef<'h6'>, + head: React$ElementRef<'head'>, + header: React$ElementRef<'header'>, + hgroup: React$ElementRef<'hgroup'>, + hr: React$ElementRef<'hr'>, + html: React$ElementRef<'html'>, + i: React$ElementRef<'i'>, + iframe: React$ElementRef<'iframe'>, + img: React$ElementRef<'img'>, + input: React$ElementRef<'input'>, + ins: React$ElementRef<'ins'>, + kbd: React$ElementRef<'kbd'>, + label: React$ElementRef<'label'>, + legend: React$ElementRef<'legend'>, + li: React$ElementRef<'li'>, + link: React$ElementRef<'link'>, + main: React$ElementRef<'main'>, + map: React$ElementRef<'map'>, + mark: React$ElementRef<'mark'>, + menu: React$ElementRef<'menu'>, + meta: React$ElementRef<'meta'>, + meter: React$ElementRef<'meter'>, + nav: React$ElementRef<'nav'>, + noscript: React$ElementRef<'noscript'>, + object: React$ElementRef<'object'>, + ol: React$ElementRef<'ol'>, + optgroup: React$ElementRef<'optgroup'>, + option: React$ElementRef<'option'>, + output: React$ElementRef<'output'>, + p: React$ElementRef<'p'>, + param: React$ElementRef<'param'>, + picture: React$ElementRef<'picture'>, + pre: React$ElementRef<'pre'>, + progress: React$ElementRef<'progress'>, + q: React$ElementRef<'q'>, + rp: React$ElementRef<'rp'>, + rt: React$ElementRef<'rt'>, + ruby: React$ElementRef<'ruby'>, + s: React$ElementRef<'s'>, + samp: React$ElementRef<'samp'>, + script: React$ElementRef<'script'>, + section: React$ElementRef<'section'>, + select: React$ElementRef<'select'>, + small: React$ElementRef<'small'>, + source: React$ElementRef<'source'>, + span: React$ElementRef<'span'>, + strong: React$ElementRef<'strong'>, + style: React$ElementRef<'style'>, + sub: React$ElementRef<'sub'>, + summary: React$ElementRef<'summary'>, + sup: React$ElementRef<'sup'>, + table: React$ElementRef<'table'>, + tbody: React$ElementRef<'tbody'>, + td: React$ElementRef<'td'>, + textarea: React$ElementRef<'textarea'>, + tfoot: React$ElementRef<'tfoot'>, + th: React$ElementRef<'th'>, + thead: React$ElementRef<'thead'>, + time: React$ElementRef<'time'>, + title: React$ElementRef<'title'>, + tr: React$ElementRef<'tr'>, + track: React$ElementRef<'track'>, + u: React$ElementRef<'u'>, + ul: React$ElementRef<'ul'>, + var: React$ElementRef<'var'>, + video: React$ElementRef<'video'>, + wbr: React$ElementRef<'wbr'>, + // SVG + circle: React$ElementRef<'circle'>, + clipPath: React$ElementRef<'clipPath'>, + defs: React$ElementRef<'defs'>, + ellipse: React$ElementRef<'ellipse'>, + g: React$ElementRef<'g'>, + image: React$ElementRef<'image'>, + line: React$ElementRef<'line'>, + linearGradient: React$ElementRef<'linearGradient'>, + mask: React$ElementRef<'mask'>, + path: React$ElementRef<'path'>, + pattern: React$ElementRef<'pattern'>, + polygon: React$ElementRef<'polygon'>, + polyline: React$ElementRef<'polyline'>, + radialGradient: React$ElementRef<'radialGradient'>, + rect: React$ElementRef<'rect'>, + stop: React$ElementRef<'stop'>, + svg: React$ElementRef<'svg'>, + text: React$ElementRef<'text'>, + tspan: React$ElementRef<'tspan'>, + // Deprecated, should be HTMLUnknownElement, but Flow doesn't support it + keygen: React$ElementRef<'keygen'>, + menuitem: React$ElementRef<'menuitem'>, + ... + }; + + declare type BuiltinElementType = $ElementType< + BuiltinElementInstances, + ElementName + >; + + declare type ConvenientShorthands = $ObjMap< + BuiltinElementInstances, + (V) => StyledShorthandFactory + >; + + declare interface Styled { + , Theme, OwnProps = React$ElementConfig>( + Comp + ): StyledFactory<{| ...$Exact |}, Theme, Comp>; + >( + ElementName + ): StyledFactory>; + } + + declare export default Styled & ConvenientShorthands; +} + +declare module 'styled-components/native' { + import type { + CSSRules, + CSSConstructor, + KeyFramesConstructor, + CreateGlobalStyleConstructor, + StyledComponent, + Interpolation, + + // "private" types + TaggedTemplateLiteral, + StyledFactory, + StyledShorthandFactory, + ThemeProps, + PropsWithTheme, + } from 'styled-components'; + + declare type BuiltinElementInstances = { + ActivityIndicator: React$ComponentType<{ ... }>, + ActivityIndicatorIOS: React$ComponentType<{ ... }>, + ART: React$ComponentType<{ ... }>, + Button: React$ComponentType<{ ... }>, + DatePickerIOS: React$ComponentType<{ ... }>, + DrawerLayoutAndroid: React$ComponentType<{ ... }>, + Image: React$ComponentType<{ ... }>, + ImageBackground: React$ComponentType<{ ... }>, + ImageEditor: React$ComponentType<{ ... }>, + ImageStore: React$ComponentType<{ ... }>, + KeyboardAvoidingView: React$ComponentType<{ ... }>, + ListView: React$ComponentType<{ ... }>, + MapView: React$ComponentType<{ ... }>, + Modal: React$ComponentType<{ ... }>, + NavigatorIOS: React$ComponentType<{ ... }>, + Picker: React$ComponentType<{ ... }>, + PickerIOS: React$ComponentType<{ ... }>, + ProgressBarAndroid: React$ComponentType<{ ... }>, + ProgressViewIOS: React$ComponentType<{ ... }>, + ScrollView: React$ComponentType<{ ... }>, + SegmentedControlIOS: React$ComponentType<{ ... }>, + Slider: React$ComponentType<{ ... }>, + SliderIOS: React$ComponentType<{ ... }>, + SnapshotViewIOS: React$ComponentType<{ ... }>, + Switch: React$ComponentType<{ ... }>, + RecyclerViewBackedScrollView: React$ComponentType<{ ... }>, + RefreshControl: React$ComponentType<{ ... }>, + SafeAreaView: React$ComponentType<{ ... }>, + StatusBar: React$ComponentType<{ ... }>, + SwipeableListView: React$ComponentType<{ ... }>, + SwitchAndroid: React$ComponentType<{ ... }>, + SwitchIOS: React$ComponentType<{ ... }>, + TabBarIOS: React$ComponentType<{ ... }>, + Text: React$ComponentType<{ ... }>, + TextInput: React$ComponentType<{ ... }>, + ToastAndroid: React$ComponentType<{ ... }>, + ToolbarAndroid: React$ComponentType<{ ... }>, + Touchable: React$ComponentType<{ ... }>, + TouchableHighlight: React$ComponentType<{ ... }>, + TouchableNativeFeedback: React$ComponentType<{ ... }>, + TouchableOpacity: React$ComponentType<{ ... }>, + TouchableWithoutFeedback: React$ComponentType<{ ... }>, + View: React$ComponentType<{ ... }>, + ViewPagerAndroid: React$ComponentType<{ ... }>, + WebView: React$ComponentType<{ ... }>, + FlatList: React$ComponentType<{ ... }>, + SectionList: React$ComponentType<{ ... }>, + VirtualizedList: React$ComponentType<{ ... }>, + ... + }; + + declare type BuiltinElementType = $ElementType< + BuiltinElementInstances, + ElementName + >; + + declare type ConvenientShorthands = $ObjMap< + BuiltinElementInstances, + (V) => StyledShorthandFactory + >; + + declare interface Styled { + >( + ElementName + ): StyledFactory>; + < + Comp: React$ComponentType, + Theme, + OwnProps = React$ElementConfig + >( + Comp + ): StyledFactory<{| ...$Exact |}, Theme, Comp>; + } + + declare export default Styled & ConvenientShorthands; +} + +declare module 'styled-components/macro' { + declare export * from 'styled-components'; +} diff --git a/flow-typed/npm/surge_vx.x.x.js b/flow-typed/npm/surge_vx.x.x.js deleted file mode 100644 index 99380c86da..0000000000 --- a/flow-typed/npm/surge_vx.x.x.js +++ /dev/null @@ -1,413 +0,0 @@ -// flow-typed signature: d23ce0f29870158ce060c137d8a2c323 -// flow-typed version: <>/surge_v^0.21.7/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'surge' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'surge' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'surge/lib/cli' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/auth' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/card' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/creds' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/deploy' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/discovery' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/domain' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/domainOrSilent' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/email' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/endpoint' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/help' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/ipaddress' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/list' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/log' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/login' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/logout' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/payment' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/pemOrSilent' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/pkg' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/plan' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/plans' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/plus' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/prep' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/project' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/protocol' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/setcard' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/shorthand' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/size' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/ssl' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/stats' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/subscribe' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/subscription' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/teardown' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/token' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/tokencheck' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/util/creds' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/util/helpers' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/util/skin' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/version' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/welcome' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/whitelist' { - declare module.exports: any; -} - -declare module 'surge/lib/middleware/whoami' { - declare module.exports: any; -} - -declare module 'surge/lib/surge' { - declare module.exports: any; -} - -declare module 'surge/test/actions' { - declare module.exports: any; -} - -declare module 'surge/test/basic' { - declare module.exports: any; -} - -declare module 'surge/test/cname' { - declare module.exports: any; -} - -declare module 'surge/test/fixtures/bin/commander-no-args' { - declare module.exports: any; -} - -declare module 'surge/test/fixtures/bin/commander-no-hooks' { - declare module.exports: any; -} - -declare module 'surge/test/fixtures/bin/minimist' { - declare module.exports: any; -} - -declare module 'surge/test/fixtures/bin/yargs' { - declare module.exports: any; -} - -declare module 'surge/test/plus' { - declare module.exports: any; -} - -declare module 'surge/test/publish' { - declare module.exports: any; -} - -declare module 'surge/test/teardown' { - declare module.exports: any; -} - -declare module 'surge/test/welcome' { - declare module.exports: any; -} - -// Filename aliases -declare module 'surge/lib/cli.js' { - declare module.exports: $Exports<'surge/lib/cli'>; -} -declare module 'surge/lib/middleware/auth.js' { - declare module.exports: $Exports<'surge/lib/middleware/auth'>; -} -declare module 'surge/lib/middleware/card.js' { - declare module.exports: $Exports<'surge/lib/middleware/card'>; -} -declare module 'surge/lib/middleware/creds.js' { - declare module.exports: $Exports<'surge/lib/middleware/creds'>; -} -declare module 'surge/lib/middleware/deploy.js' { - declare module.exports: $Exports<'surge/lib/middleware/deploy'>; -} -declare module 'surge/lib/middleware/discovery.js' { - declare module.exports: $Exports<'surge/lib/middleware/discovery'>; -} -declare module 'surge/lib/middleware/domain.js' { - declare module.exports: $Exports<'surge/lib/middleware/domain'>; -} -declare module 'surge/lib/middleware/domainOrSilent.js' { - declare module.exports: $Exports<'surge/lib/middleware/domainOrSilent'>; -} -declare module 'surge/lib/middleware/email.js' { - declare module.exports: $Exports<'surge/lib/middleware/email'>; -} -declare module 'surge/lib/middleware/endpoint.js' { - declare module.exports: $Exports<'surge/lib/middleware/endpoint'>; -} -declare module 'surge/lib/middleware/help.js' { - declare module.exports: $Exports<'surge/lib/middleware/help'>; -} -declare module 'surge/lib/middleware/index' { - declare module.exports: $Exports<'surge/lib/middleware'>; -} -declare module 'surge/lib/middleware/index.js' { - declare module.exports: $Exports<'surge/lib/middleware'>; -} -declare module 'surge/lib/middleware/ipaddress.js' { - declare module.exports: $Exports<'surge/lib/middleware/ipaddress'>; -} -declare module 'surge/lib/middleware/list.js' { - declare module.exports: $Exports<'surge/lib/middleware/list'>; -} -declare module 'surge/lib/middleware/log.js' { - declare module.exports: $Exports<'surge/lib/middleware/log'>; -} -declare module 'surge/lib/middleware/login.js' { - declare module.exports: $Exports<'surge/lib/middleware/login'>; -} -declare module 'surge/lib/middleware/logout.js' { - declare module.exports: $Exports<'surge/lib/middleware/logout'>; -} -declare module 'surge/lib/middleware/payment.js' { - declare module.exports: $Exports<'surge/lib/middleware/payment'>; -} -declare module 'surge/lib/middleware/pemOrSilent.js' { - declare module.exports: $Exports<'surge/lib/middleware/pemOrSilent'>; -} -declare module 'surge/lib/middleware/pkg.js' { - declare module.exports: $Exports<'surge/lib/middleware/pkg'>; -} -declare module 'surge/lib/middleware/plan.js' { - declare module.exports: $Exports<'surge/lib/middleware/plan'>; -} -declare module 'surge/lib/middleware/plans.js' { - declare module.exports: $Exports<'surge/lib/middleware/plans'>; -} -declare module 'surge/lib/middleware/plus.js' { - declare module.exports: $Exports<'surge/lib/middleware/plus'>; -} -declare module 'surge/lib/middleware/prep.js' { - declare module.exports: $Exports<'surge/lib/middleware/prep'>; -} -declare module 'surge/lib/middleware/project.js' { - declare module.exports: $Exports<'surge/lib/middleware/project'>; -} -declare module 'surge/lib/middleware/protocol.js' { - declare module.exports: $Exports<'surge/lib/middleware/protocol'>; -} -declare module 'surge/lib/middleware/setcard.js' { - declare module.exports: $Exports<'surge/lib/middleware/setcard'>; -} -declare module 'surge/lib/middleware/shorthand.js' { - declare module.exports: $Exports<'surge/lib/middleware/shorthand'>; -} -declare module 'surge/lib/middleware/size.js' { - declare module.exports: $Exports<'surge/lib/middleware/size'>; -} -declare module 'surge/lib/middleware/ssl.js' { - declare module.exports: $Exports<'surge/lib/middleware/ssl'>; -} -declare module 'surge/lib/middleware/stats.js' { - declare module.exports: $Exports<'surge/lib/middleware/stats'>; -} -declare module 'surge/lib/middleware/subscribe.js' { - declare module.exports: $Exports<'surge/lib/middleware/subscribe'>; -} -declare module 'surge/lib/middleware/subscription.js' { - declare module.exports: $Exports<'surge/lib/middleware/subscription'>; -} -declare module 'surge/lib/middleware/teardown.js' { - declare module.exports: $Exports<'surge/lib/middleware/teardown'>; -} -declare module 'surge/lib/middleware/token.js' { - declare module.exports: $Exports<'surge/lib/middleware/token'>; -} -declare module 'surge/lib/middleware/tokencheck.js' { - declare module.exports: $Exports<'surge/lib/middleware/tokencheck'>; -} -declare module 'surge/lib/middleware/util/creds.js' { - declare module.exports: $Exports<'surge/lib/middleware/util/creds'>; -} -declare module 'surge/lib/middleware/util/helpers.js' { - declare module.exports: $Exports<'surge/lib/middleware/util/helpers'>; -} -declare module 'surge/lib/middleware/util/skin.js' { - declare module.exports: $Exports<'surge/lib/middleware/util/skin'>; -} -declare module 'surge/lib/middleware/version.js' { - declare module.exports: $Exports<'surge/lib/middleware/version'>; -} -declare module 'surge/lib/middleware/welcome.js' { - declare module.exports: $Exports<'surge/lib/middleware/welcome'>; -} -declare module 'surge/lib/middleware/whitelist.js' { - declare module.exports: $Exports<'surge/lib/middleware/whitelist'>; -} -declare module 'surge/lib/middleware/whoami.js' { - declare module.exports: $Exports<'surge/lib/middleware/whoami'>; -} -declare module 'surge/lib/surge.js' { - declare module.exports: $Exports<'surge/lib/surge'>; -} -declare module 'surge/test/actions.js' { - declare module.exports: $Exports<'surge/test/actions'>; -} -declare module 'surge/test/basic.js' { - declare module.exports: $Exports<'surge/test/basic'>; -} -declare module 'surge/test/cname.js' { - declare module.exports: $Exports<'surge/test/cname'>; -} -declare module 'surge/test/fixtures/bin/commander-no-args.js' { - declare module.exports: $Exports<'surge/test/fixtures/bin/commander-no-args'>; -} -declare module 'surge/test/fixtures/bin/commander-no-hooks.js' { - declare module.exports: $Exports<'surge/test/fixtures/bin/commander-no-hooks'>; -} -declare module 'surge/test/fixtures/bin/minimist.js' { - declare module.exports: $Exports<'surge/test/fixtures/bin/minimist'>; -} -declare module 'surge/test/fixtures/bin/yargs.js' { - declare module.exports: $Exports<'surge/test/fixtures/bin/yargs'>; -} -declare module 'surge/test/plus.js' { - declare module.exports: $Exports<'surge/test/plus'>; -} -declare module 'surge/test/publish.js' { - declare module.exports: $Exports<'surge/test/publish'>; -} -declare module 'surge/test/teardown.js' { - declare module.exports: $Exports<'surge/test/teardown'>; -} -declare module 'surge/test/welcome.js' { - declare module.exports: $Exports<'surge/test/welcome'>; -} diff --git a/flow-typed/npm/svg2ttf_vx.x.x.js b/flow-typed/npm/svg2ttf_vx.x.x.js deleted file mode 100644 index b249cb7bb6..0000000000 --- a/flow-typed/npm/svg2ttf_vx.x.x.js +++ /dev/null @@ -1,164 +0,0 @@ -// flow-typed signature: ec3139dd7887c120dcf4cf429ccb7ebd -// flow-typed version: <>/svg2ttf_v^5.0.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'svg2ttf' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'svg2ttf' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'svg2ttf/lib/math' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/sfnt' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/str' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/svg' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/cmap' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/glyf' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/gsub' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/head' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/hhea' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/hmtx' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/loca' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/maxp' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/name' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/os2' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/tables/post' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ttf/utils' { - declare module.exports: any; -} - -declare module 'svg2ttf/lib/ucs2' { - declare module.exports: any; -} - -declare module 'svg2ttf/svg2ttf' { - declare module.exports: any; -} - -// Filename aliases -declare module 'svg2ttf/index' { - declare module.exports: $Exports<'svg2ttf'>; -} -declare module 'svg2ttf/index.js' { - declare module.exports: $Exports<'svg2ttf'>; -} -declare module 'svg2ttf/lib/math.js' { - declare module.exports: $Exports<'svg2ttf/lib/math'>; -} -declare module 'svg2ttf/lib/sfnt.js' { - declare module.exports: $Exports<'svg2ttf/lib/sfnt'>; -} -declare module 'svg2ttf/lib/str.js' { - declare module.exports: $Exports<'svg2ttf/lib/str'>; -} -declare module 'svg2ttf/lib/svg.js' { - declare module.exports: $Exports<'svg2ttf/lib/svg'>; -} -declare module 'svg2ttf/lib/ttf.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf'>; -} -declare module 'svg2ttf/lib/ttf/tables/cmap.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/cmap'>; -} -declare module 'svg2ttf/lib/ttf/tables/glyf.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/glyf'>; -} -declare module 'svg2ttf/lib/ttf/tables/gsub.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/gsub'>; -} -declare module 'svg2ttf/lib/ttf/tables/head.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/head'>; -} -declare module 'svg2ttf/lib/ttf/tables/hhea.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/hhea'>; -} -declare module 'svg2ttf/lib/ttf/tables/hmtx.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/hmtx'>; -} -declare module 'svg2ttf/lib/ttf/tables/loca.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/loca'>; -} -declare module 'svg2ttf/lib/ttf/tables/maxp.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/maxp'>; -} -declare module 'svg2ttf/lib/ttf/tables/name.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/name'>; -} -declare module 'svg2ttf/lib/ttf/tables/os2.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/os2'>; -} -declare module 'svg2ttf/lib/ttf/tables/post.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/tables/post'>; -} -declare module 'svg2ttf/lib/ttf/utils.js' { - declare module.exports: $Exports<'svg2ttf/lib/ttf/utils'>; -} -declare module 'svg2ttf/lib/ucs2.js' { - declare module.exports: $Exports<'svg2ttf/lib/ucs2'>; -} -declare module 'svg2ttf/svg2ttf.js' { - declare module.exports: $Exports<'svg2ttf/svg2ttf'>; -} diff --git a/flow-typed/npm/svgicons2svgfont_vx.x.x.js b/flow-typed/npm/svgicons2svgfont_vx.x.x.js deleted file mode 100644 index cd7d45ace9..0000000000 --- a/flow-typed/npm/svgicons2svgfont_vx.x.x.js +++ /dev/null @@ -1,98 +0,0 @@ -// flow-typed signature: a8815043ca8031eb48ad2e7f0f114c6c -// flow-typed version: <>/svgicons2svgfont_v^9.0.4/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'svgicons2svgfont' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'svgicons2svgfont' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'svgicons2svgfont/bin/svgicons2svgfont' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/src/filesorter' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/src/iconsdir' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/src' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/src/metadata' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/src/svgshapes2svgpath' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/tests/cli.mocha' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/tests/filesorter.mocha' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/tests/index.mocha' { - declare module.exports: any; -} - -declare module 'svgicons2svgfont/tests/metadata.mocha' { - declare module.exports: any; -} - -// Filename aliases -declare module 'svgicons2svgfont/bin/svgicons2svgfont.js' { - declare module.exports: $Exports<'svgicons2svgfont/bin/svgicons2svgfont'>; -} -declare module 'svgicons2svgfont/src/filesorter.js' { - declare module.exports: $Exports<'svgicons2svgfont/src/filesorter'>; -} -declare module 'svgicons2svgfont/src/iconsdir.js' { - declare module.exports: $Exports<'svgicons2svgfont/src/iconsdir'>; -} -declare module 'svgicons2svgfont/src/index' { - declare module.exports: $Exports<'svgicons2svgfont/src'>; -} -declare module 'svgicons2svgfont/src/index.js' { - declare module.exports: $Exports<'svgicons2svgfont/src'>; -} -declare module 'svgicons2svgfont/src/metadata.js' { - declare module.exports: $Exports<'svgicons2svgfont/src/metadata'>; -} -declare module 'svgicons2svgfont/src/svgshapes2svgpath.js' { - declare module.exports: $Exports<'svgicons2svgfont/src/svgshapes2svgpath'>; -} -declare module 'svgicons2svgfont/tests/cli.mocha.js' { - declare module.exports: $Exports<'svgicons2svgfont/tests/cli.mocha'>; -} -declare module 'svgicons2svgfont/tests/filesorter.mocha.js' { - declare module.exports: $Exports<'svgicons2svgfont/tests/filesorter.mocha'>; -} -declare module 'svgicons2svgfont/tests/index.mocha.js' { - declare module.exports: $Exports<'svgicons2svgfont/tests/index.mocha'>; -} -declare module 'svgicons2svgfont/tests/metadata.mocha.js' { - declare module.exports: $Exports<'svgicons2svgfont/tests/metadata.mocha'>; -} diff --git a/flow-typed/npm/through2_vx.x.x.js b/flow-typed/npm/through2_vx.x.x.js deleted file mode 100644 index 3e17a755fd..0000000000 --- a/flow-typed/npm/through2_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 0e7049bad4c5ac0faba26b49ee07866d -// flow-typed version: <>/through2_v^4.0.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'through2' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'through2' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'through2/through2' { - declare module.exports: any; -} - -// Filename aliases -declare module 'through2/through2.js' { - declare module.exports: $Exports<'through2/through2'>; -} diff --git a/flow-typed/npm/ttf2woff2_vx.x.x.js b/flow-typed/npm/ttf2woff2_vx.x.x.js deleted file mode 100644 index a7f7e1c2a2..0000000000 --- a/flow-typed/npm/ttf2woff2_vx.x.x.js +++ /dev/null @@ -1,76 +0,0 @@ -// flow-typed signature: 2ba50c9e63c6f6e803d7bca8b48d4238 -// flow-typed version: <>/ttf2woff2_v^4.0.1/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'ttf2woff2' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'ttf2woff2' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'ttf2woff2/bin/ttf2woff2' { - declare module.exports: any; -} - -declare module 'ttf2woff2/dist' { - declare module.exports: any; -} - -declare module 'ttf2woff2/jssrc' { - declare module.exports: any; -} - -declare module 'ttf2woff2/jssrc/post' { - declare module.exports: any; -} - -declare module 'ttf2woff2/jssrc/ttf2woff2' { - declare module.exports: any; -} - -declare module 'ttf2woff2/src' { - declare module.exports: any; -} - -// Filename aliases -declare module 'ttf2woff2/bin/ttf2woff2.js' { - declare module.exports: $Exports<'ttf2woff2/bin/ttf2woff2'>; -} -declare module 'ttf2woff2/dist/index' { - declare module.exports: $Exports<'ttf2woff2/dist'>; -} -declare module 'ttf2woff2/dist/index.js' { - declare module.exports: $Exports<'ttf2woff2/dist'>; -} -declare module 'ttf2woff2/jssrc/index' { - declare module.exports: $Exports<'ttf2woff2/jssrc'>; -} -declare module 'ttf2woff2/jssrc/index.js' { - declare module.exports: $Exports<'ttf2woff2/jssrc'>; -} -declare module 'ttf2woff2/jssrc/post.js' { - declare module.exports: $Exports<'ttf2woff2/jssrc/post'>; -} -declare module 'ttf2woff2/jssrc/ttf2woff2.js' { - declare module.exports: $Exports<'ttf2woff2/jssrc/ttf2woff2'>; -} -declare module 'ttf2woff2/src/index' { - declare module.exports: $Exports<'ttf2woff2/src'>; -} -declare module 'ttf2woff2/src/index.js' { - declare module.exports: $Exports<'ttf2woff2/src'>; -} diff --git a/flow-typed/npm/typescript_vx.x.x.js b/flow-typed/npm/typescript_vx.x.x.js deleted file mode 100644 index 93014f6c8b..0000000000 --- a/flow-typed/npm/typescript_vx.x.x.js +++ /dev/null @@ -1,81 +0,0 @@ -// flow-typed signature: 08de1c48926ae2b745877b3d0152ab83 -// flow-typed version: <>/typescript_v^4.1.2/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'typescript' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'typescript' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'typescript/lib/cancellationToken' { - declare module.exports: any; -} - -declare module 'typescript/lib/tsc' { - declare module.exports: any; -} - -declare module 'typescript/lib/tsserver' { - declare module.exports: any; -} - -declare module 'typescript/lib/tsserverlibrary' { - declare module.exports: any; -} - -declare module 'typescript/lib/typescript' { - declare module.exports: any; -} - -declare module 'typescript/lib/typescriptServices' { - declare module.exports: any; -} - -declare module 'typescript/lib/typingsInstaller' { - declare module.exports: any; -} - -declare module 'typescript/lib/watchGuard' { - declare module.exports: any; -} - -// Filename aliases -declare module 'typescript/lib/cancellationToken.js' { - declare module.exports: $Exports<'typescript/lib/cancellationToken'>; -} -declare module 'typescript/lib/tsc.js' { - declare module.exports: $Exports<'typescript/lib/tsc'>; -} -declare module 'typescript/lib/tsserver.js' { - declare module.exports: $Exports<'typescript/lib/tsserver'>; -} -declare module 'typescript/lib/tsserverlibrary.js' { - declare module.exports: $Exports<'typescript/lib/tsserverlibrary'>; -} -declare module 'typescript/lib/typescript.js' { - declare module.exports: $Exports<'typescript/lib/typescript'>; -} -declare module 'typescript/lib/typescriptServices.js' { - declare module.exports: $Exports<'typescript/lib/typescriptServices'>; -} -declare module 'typescript/lib/typingsInstaller.js' { - declare module.exports: $Exports<'typescript/lib/typingsInstaller'>; -} -declare module 'typescript/lib/watchGuard.js' { - declare module.exports: $Exports<'typescript/lib/watchGuard'>; -} diff --git a/flow-typed/npm/webpack-cli_vx.x.x.js b/flow-typed/npm/webpack-cli_vx.x.x.js deleted file mode 100644 index 06f7f1add5..0000000000 --- a/flow-typed/npm/webpack-cli_vx.x.x.js +++ /dev/null @@ -1,143 +0,0 @@ -// flow-typed signature: 002bded5490389b9d56fd313a9f6d7c3 -// flow-typed version: <>/webpack-cli_v^4.1.0/flow_v0.147.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'webpack-cli' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'webpack-cli' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'webpack-cli/bin/cli' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/bootstrap' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/plugins/CLIPlugin' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/__tests__/get-package-manager.test' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/__tests__/prompt-installation.test' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/capitalize-first-letter' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/dynamic-import-loader' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/get-package-manager' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/logger' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/package-exists' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/prompt-installation' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/run-command' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/utils/to-kebab-case' { - declare module.exports: any; -} - -declare module 'webpack-cli/lib/webpack-cli' { - declare module.exports: any; -} - -// Filename aliases -declare module 'webpack-cli/bin/cli.js' { - declare module.exports: $Exports<'webpack-cli/bin/cli'>; -} -declare module 'webpack-cli/lib/bootstrap.js' { - declare module.exports: $Exports<'webpack-cli/lib/bootstrap'>; -} -declare module 'webpack-cli/lib/index' { - declare module.exports: $Exports<'webpack-cli/lib'>; -} -declare module 'webpack-cli/lib/index.js' { - declare module.exports: $Exports<'webpack-cli/lib'>; -} -declare module 'webpack-cli/lib/plugins/CLIPlugin.js' { - declare module.exports: $Exports<'webpack-cli/lib/plugins/CLIPlugin'>; -} -declare module 'webpack-cli/lib/utils/__tests__/get-package-manager.test.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/__tests__/get-package-manager.test'>; -} -declare module 'webpack-cli/lib/utils/__tests__/prompt-installation.test.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/__tests__/prompt-installation.test'>; -} -declare module 'webpack-cli/lib/utils/capitalize-first-letter.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/capitalize-first-letter'>; -} -declare module 'webpack-cli/lib/utils/dynamic-import-loader.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/dynamic-import-loader'>; -} -declare module 'webpack-cli/lib/utils/get-package-manager.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/get-package-manager'>; -} -declare module 'webpack-cli/lib/utils/index' { - declare module.exports: $Exports<'webpack-cli/lib/utils'>; -} -declare module 'webpack-cli/lib/utils/index.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils'>; -} -declare module 'webpack-cli/lib/utils/logger.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/logger'>; -} -declare module 'webpack-cli/lib/utils/package-exists.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/package-exists'>; -} -declare module 'webpack-cli/lib/utils/prompt-installation.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/prompt-installation'>; -} -declare module 'webpack-cli/lib/utils/run-command.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/run-command'>; -} -declare module 'webpack-cli/lib/utils/to-kebab-case.js' { - declare module.exports: $Exports<'webpack-cli/lib/utils/to-kebab-case'>; -} -declare module 'webpack-cli/lib/webpack-cli.js' { - declare module.exports: $Exports<'webpack-cli/lib/webpack-cli'>; -} diff --git a/lint-staged.config.js b/lint-staged.config.js index 90074522e7..ed4837e941 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,7 +1,7 @@ // @noflow module.exports = { - "*.{js?(x),js?(x).flow,ts?(x)}": "eslint --fix --report-unused-disable-directives", + "*.{js,jsx,flow,ts,tsx}": "eslint --fix --report-unused-disable-directives", "*.{md,json,yaml,yml}": "prettier --write", "*.mdx": "eslint --fix --report-unused-disable-directives", "**/!(snippets)/*.mdx": "remark -q -u validate-links --no-config", diff --git a/package.json b/package.json index 8b6fc1706c..e1cd8aa769 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build-ci": "yarn size:build", "components": "yarn workspace @kiwicom/orbit-components", - "checks": "zx scripts/checks.mjs", + "checks": "ts-node --esm scripts/checks.mts", "check:types": "yarn checks --types", "check:links": "yarn checks --links", "check:css": "yarn checks --css", @@ -40,31 +40,33 @@ "author": "kiwi.com", "license": "MIT", "resolutions": { - "@types/eslint": "^7.28.2", + "@types/eslint": "^7.29.0", "@types/react": "^17.0.26", - "@types/react-dom": "^17.0.9" + "@types/react-dom": "^17.0.9", + "ts-node": "^10.9.1" }, "devDependencies": { - "@babel/core": "^7.18.2", + "@babel/core": "^7.18.9", + "@babel/runtime": "7.18.9", "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", "@kiwicom/browserslist-config": "^3.0.0", - "@lerna/project": "^3.21.0", "@octokit/rest": "^19.0.5", - "@size-limit/file": "^6.0.3", - "@size-limit/webpack": "^6.0.3", "@stylelint/postcss-css-in-js": "^0.38.0", + "@lerna/project": "^5.2.0", + "@size-limit/file": "^8.0.0", + "@size-limit/webpack": "^8.0.0", "@typescript-eslint/eslint-plugin": "^4.29.0", "@typescript-eslint/parser": "^4.33.0", "babel-eslint": "^10.1.0", - "babel-jest": "^27.4.5", + "babel-jest": "^28.1.3", "browserslist": "^4.16.6", "conventional-changelog": "^3.1.24", "cross-env": "^7.0.2", "dotenv-safe": "^8.2.0", - "eslint": "^7.28.0", + "eslint": "^7.32.0", "eslint-config-airbnb": "^18.2.1", - "eslint-config-prettier": "^8.4.0", + "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^2.4.0", @@ -75,14 +77,14 @@ "eslint-plugin-jest": "^24.1.3", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-mdx": "^1.8.2", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.21.5", "eslint-plugin-react-hooks": "^4.2.0", - "flow-bin": "^0.178.1", + "flow-bin": "^0.187.1", "husky": "^6.0.0", "jest": "^28.1.1", "jest-environment-jsdom": "^28.1.1", - "lerna": "4.0.0", + "lerna": "5.2.0", "lint-staged": "^12.3.2", "markdown-chalk": "^2.1.0", "markdown-magic": "^2.6.0", @@ -102,15 +104,15 @@ "remark-preset-lint-recommended": "^5.0.0", "remark-preset-prettier": "^0.4.0", "remark-validate-links": "^10.0.2", - "size-limit": "^6.0.3", + "size-limit": "^8.0.0", "slackify-markdown": "^4.3.1", "styled-components": "^5.3.1", "stylelint": "^14.14.1", "stylelint-config-recommended": "^9.0.0", "stylelint-config-styled-components": "^0.1.1", "through2": "^4.0.2", - "ts-node": "^10.7.0", - "typescript": "^4.6.3", - "zx": "^7.0.0" + "ts-node": "^10.9.1", + "typescript": "^4.8.3", + "zx": "^7.0.7" } } diff --git a/packages/babel-plugin-orbit-components/.babelrc.js b/packages/babel-plugin-orbit-components/.babelrc.js index 71618e384b..fbc6b3ab5e 100644 --- a/packages/babel-plugin-orbit-components/.babelrc.js +++ b/packages/babel-plugin-orbit-components/.babelrc.js @@ -1,6 +1,5 @@ // @flow - module.exports = { - presets: ['@babel/preset-env'], + presets: ["@babel/preset-env"], plugins: ["@kiwicom/orbit-components"], }; diff --git a/packages/babel-plugin-orbit-components/package.json b/packages/babel-plugin-orbit-components/package.json index 3edd26d2f7..4c13399667 100644 --- a/packages/babel-plugin-orbit-components/package.json +++ b/packages/babel-plugin-orbit-components/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@babel/cli": "^7.12.8", "@babel/core": "^7.18.2", - "@kiwicom/orbit-components": "^4.2.0", + "@kiwicom/orbit-components": "*", "prettier": "^2.1.2", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/packages/eslint-plugin-orbit-components/.eslintrc.js b/packages/eslint-plugin-orbit-components/.eslintrc.js new file mode 100644 index 0000000000..1952d681de --- /dev/null +++ b/packages/eslint-plugin-orbit-components/.eslintrc.js @@ -0,0 +1,15 @@ +const { DEV_DEPENDENCIES } = require("../../utils/eslint"); + +module.exports = { + overrides: [ + { + files: DEV_DEPENDENCIES, + rules: { + "import/no-extraneous-dependencies": [ + "error", + { packageDir: [__dirname, `${__dirname}/../..`] }, + ], + }, + }, + ], +}; diff --git a/packages/eslint-plugin-orbit-components/package.json b/packages/eslint-plugin-orbit-components/package.json index 5004f3aad2..169ddc2921 100644 --- a/packages/eslint-plugin-orbit-components/package.json +++ b/packages/eslint-plugin-orbit-components/package.json @@ -26,11 +26,14 @@ ], "scripts": { "build": "yarn clean && babel ./src --extensions '.ts' --out-dir ./dist", - "clean": "rimraf dist", + "clean": "del dist", "postinstall": "yarn build", "prepublishOnly": "yarn build && pinst --disable", "postpublish": "pinst --enable" }, + "peerDependencies": { + "eslint": ">=7" + }, "dependencies": { "@babel/types": "=7.12.10" }, @@ -44,6 +47,6 @@ "babel-eslint": "^10.1.0", "eslint": "^7.14.0", "pinst": "^2.1.4", - "rimraf": "^3.0.2" + "del-cli": "^4.0.1" } } diff --git a/packages/orbit-components/.gitignore b/packages/orbit-components/.gitignore index 355c90a9a8..5a0c0b8c1b 100644 --- a/packages/orbit-components/.gitignore +++ b/packages/orbit-components/.gitignore @@ -8,10 +8,6 @@ src/data/airportIllustrations.json src/data/illustrations.json src/data/icons.json -src/Illustration/index.*.flow -src/AirportIllustration/index.*.flow -src/ServiceLogo/index.*.flow -src/FeatureIcon/index.*.flow src/Illustration/index.d.ts src/AirportIllustration/index.d.ts src/ServiceLogo/index.d.ts diff --git a/packages/orbit-components/.size-limit.js b/packages/orbit-components/.size-limit.js index 0bde5a6756..b68156274b 100644 --- a/packages/orbit-components/.size-limit.js +++ b/packages/orbit-components/.size-limit.js @@ -1,5 +1,5 @@ /* eslint-disable no-restricted-syntax */ -const { fs } = require("zx"); +const fs = require("fs"); const { peerDependencies } = require("./package.json"); @@ -12,7 +12,7 @@ const sortBy = key => { }; const exportMatches = fs - .readFileSync(`${__dirname}/src/index.js`) + .readFileSync(`${__dirname}/src/index.ts`) .toString() .matchAll( /export (\{ (default as )?(?.*) \}|\* as (?.*)) from "(?.*)"/g, @@ -35,17 +35,11 @@ for (const { module.exports = [ { - name: "Orbit ESM", + name: "esm", path: `${__dirname}/es/size-measurer.js`, import: "{ Orbit }", limit: "190 kB", }, - { - name: "Orbit CJS", - path: `${__dirname}/lib/index.js`, - import: "{ Orbit }", - limit: "210 kB", - }, ...entries.sort(sortBy("name")), ].map(entry => ({ ...entry, diff --git a/packages/orbit-components/.storybook/.babelrc b/packages/orbit-components/.storybook/.babelrc new file mode 100644 index 0000000000..3313ff9ef0 --- /dev/null +++ b/packages/orbit-components/.storybook/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-env", "@babel/preset-typescript"] +} diff --git a/packages/orbit-components/.storybook/main.js b/packages/orbit-components/.storybook/main.js deleted file mode 100644 index 417e9c26d4..0000000000 --- a/packages/orbit-components/.storybook/main.js +++ /dev/null @@ -1,42 +0,0 @@ -// @noflow -/* eslint-disable no-param-reassign */ -const path = require("path"); - -module.exports = { - core: { - builder: "webpack5", - options: { - lazyCompilation: true, - }, - }, - staticDirs: [path.resolve(__dirname, "../static")], - stories: ["../src/**/*.stories.*"], - framework: "@storybook/react", - addons: [ - "@storybook/addon-knobs", - "@storybook/addon-actions", - "@storybook/addon-viewport", - "@storybook/addon-backgrounds", - ], - features: { - babelModeV7: true, - }, - webpackFinal(config) { - // resolve to .js rather than .mjs to avoid webpack failing because of ambiguous imports - config.resolve.alias["@adeira/js"] = require.resolve("@adeira/js/src/index.js"); - config.resolve.extensions = config.resolve.extensions.filter(ext => ext !== ".mjs"); - - config.module.rules.push({ - test: /\.jsx?$/, - use: [ - { - options: { envName: "esm" }, - loader: require.resolve("babel-loader"), - }, - ], - exclude: /node_modules\/(?!(loki)\/).*/, // Loki is not transpilled, throws error in IE 11 - }); - - return config; - }, -}; diff --git a/packages/orbit-components/.storybook/main.ts b/packages/orbit-components/.storybook/main.ts new file mode 100644 index 0000000000..8343a7ada7 --- /dev/null +++ b/packages/orbit-components/.storybook/main.ts @@ -0,0 +1,44 @@ +/* eslint-disable no-param-reassign */ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const path = require("path"); + +const config = { + core: { + builder: "webpack5", + }, + staticDirs: [path.resolve(__dirname, "../static")], + stories: ["../src/**/*.stories.*"], + framework: "@storybook/react", + addons: [ + "@storybook/addon-knobs", + "@storybook/addon-actions", + "@storybook/addon-viewport", + "@storybook/addon-backgrounds", + ], + features: { + babelModeV7: true, + }, + webpackFinal(cfg) { + if (cfg) { + // resolve to .js rather than .mjs to avoid webpack failing because of ambiguous imports + cfg.resolve.alias["@adeira/js"] = require.resolve("@adeira/js/src/index.js"); + cfg.resolve.extensions = cfg.resolve.extensions.filter(ext => ext !== ".mjs"); + + cfg.module.rules.push({ + test: /\.(ts|tsx|mts)$/, + loader: require.resolve("babel-loader"), + options: { + presets: ["@babel/preset-typescript"], + }, + }); + + cfg.resolve.extensions.push(".ts", ".tsx", ".mts"); + + return cfg; + } + + return undefined; + }, +}; + +module.exports = config; diff --git a/packages/orbit-components/.storybook/manager.js b/packages/orbit-components/.storybook/manager.js deleted file mode 100644 index fecca47b7f..0000000000 --- a/packages/orbit-components/.storybook/manager.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import { addons } from "@storybook/addons"; - -import orbitTheme from "./orbitTheme"; - -addons.setConfig({ - theme: orbitTheme, - panelPosition: "bottom", -}); diff --git a/packages/orbit-components/.storybook/manager.ts b/packages/orbit-components/.storybook/manager.ts new file mode 100644 index 0000000000..fe4e64f22f --- /dev/null +++ b/packages/orbit-components/.storybook/manager.ts @@ -0,0 +1,8 @@ +import { addons } from "@storybook/addons"; + +import orbitTheme from "./orbitTheme"; + +addons.setConfig({ + theme: orbitTheme, + panelPosition: "bottom", +}); diff --git a/packages/orbit-components/.storybook/orbitDecorator.jsx b/packages/orbit-components/.storybook/orbitDecorator.jsx deleted file mode 100644 index 796393359c..0000000000 --- a/packages/orbit-components/.storybook/orbitDecorator.jsx +++ /dev/null @@ -1,43 +0,0 @@ -// @noflow -import * as React from "react"; -import jsxToString from "react-element-to-jsx-string"; -import { Code } from "@storybook/addon-info/dist/components/markdown"; - -import defaultTheme from "../src/defaultTheme"; -import ThemeProvider from "../src/ThemeProvider"; -import Heading from "../src/Heading"; -import Text from "../src/Text"; - -const orbitDecorator = (storyFn, context) => { - const children = storyFn(context); - const { globals } = context; - const options = { - filterProps: val => val != null && val !== "", - functionValue: () => { - return "function()"; - }, - }; - - const inverted = globals.backgrounds ? globals.backgrounds.value === "#333333" : undefined; - - return ( - -

- - ); -}; - -export default orbitDecorator; diff --git a/packages/orbit-components/.storybook/orbitDecorator.tsx b/packages/orbit-components/.storybook/orbitDecorator.tsx new file mode 100644 index 0000000000..cc7e67479d --- /dev/null +++ b/packages/orbit-components/.storybook/orbitDecorator.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import jsxToString from "react-element-to-jsx-string"; +import { Code } from "@storybook/addon-info/dist/components/markdown"; + +import defaultTheme from "../src/defaultTheme"; +import ThemeProvider from "../src/ThemeProvider"; +import Heading from "../src/Heading"; +import Text from "../src/Text"; + +const orbitDecorator = (storyFn, context) => { + const children = storyFn(context); + const { globals } = context; + const options = { + filterProps: val => val != null && val !== "", + functionValue: () => { + return "function()"; + }, + }; + + const inverted = globals.backgrounds ? globals.backgrounds.value === "#333333" : undefined; + + return ( + +
+ + {context.kind} + + + {context.parameters?.info} + + {children} + {process.env.NODE_ENV !== "loki" ? ( +
+ +
+ ) : null} +
+
+ ); +}; + +export default orbitDecorator; diff --git a/packages/orbit-components/.storybook/orbitTheme.js b/packages/orbit-components/.storybook/orbitTheme.js deleted file mode 100644 index cd18e4e232..0000000000 --- a/packages/orbit-components/.storybook/orbitTheme.js +++ /dev/null @@ -1,9 +0,0 @@ -// @noflow -import { create } from "@storybook/theming"; - -export default create({ - base: "light", - brandTitle: "Orbit", - brandUrl: "https://orbit.kiwi", - brandImage: "https://images.kiwi.com/common/orbit-logo-full.png", -}); diff --git a/packages/orbit-components/.storybook/orbitTheme.ts b/packages/orbit-components/.storybook/orbitTheme.ts new file mode 100644 index 0000000000..3209a81471 --- /dev/null +++ b/packages/orbit-components/.storybook/orbitTheme.ts @@ -0,0 +1,8 @@ +import { create } from "@storybook/theming"; + +export default create({ + base: "light", + brandTitle: "Orbit", + brandUrl: "https://orbit.kiwi", + brandImage: "https://images.kiwi.com/common/orbit-logo-full.png", +}); diff --git a/packages/orbit-components/.storybook/preview.js b/packages/orbit-components/.storybook/preview.js deleted file mode 100644 index 06032d19c8..0000000000 --- a/packages/orbit-components/.storybook/preview.js +++ /dev/null @@ -1,35 +0,0 @@ -// @noflow -import { addDecorator } from "@storybook/react"; - -import "loki/configure-react"; -import { QUERIES } from "../src/utils/mediaQuery/consts"; -import orbitDecorator from "./orbitDecorator"; -import theme from "../src/defaultTheme"; - -const tokens = { - smallMobile: 320, - [QUERIES.MEDIUMMOBILE]: theme.orbit.widthBreakpointMediumMobile, - [QUERIES.LARGEMOBILE]: theme.orbit.widthBreakpointLargeMobile, - [QUERIES.TABLET]: theme.orbit.widthBreakpointTablet, - [QUERIES.DESKTOP]: theme.orbit.widthBreakpointDesktop, - [QUERIES.LARGEDESKTOP]: theme.orbit.widthBreakpointLargeDesktop, -}; - -const viewports = Object.entries(tokens).reduce((acc, [viewport, width]) => { - acc[viewport] = { - name: viewport, - styles: { - width: `${String(width)}px`, - height: `100vh`, - }, - }; - return acc; -}, {}); - -export const parameters = { - viewport: { - viewports, - }, -}; - -addDecorator(orbitDecorator); diff --git a/packages/orbit-components/.storybook/preview.ts b/packages/orbit-components/.storybook/preview.ts new file mode 100644 index 0000000000..d66b2ee431 --- /dev/null +++ b/packages/orbit-components/.storybook/preview.ts @@ -0,0 +1,34 @@ +import { addDecorator } from "@storybook/react"; + +import "loki/configure-react"; +import { QUERIES } from "../src/utils/mediaQuery/consts"; +import orbitDecorator from "./orbitDecorator"; +import theme from "../src/defaultTheme"; + +const tokens = { + smallMobile: 320, + [QUERIES.mediumMobile]: theme.orbit.widthBreakpointMediumMobile, + [QUERIES.largeMobile]: theme.orbit.widthBreakpointLargeMobile, + [QUERIES.tablet]: theme.orbit.widthBreakpointTablet, + [QUERIES.desktop]: theme.orbit.widthBreakpointDesktop, + [QUERIES.largeDesktop]: theme.orbit.widthBreakpointLargeDesktop, +}; + +const viewports = Object.entries(tokens).reduce((acc, [viewport, width]) => { + acc[viewport] = { + name: viewport, + styles: { + width: `${String(width)}px`, + height: `100vh`, + }, + }; + return acc; +}, {}); + +export const parameters = { + viewport: { + viewports, + }, +}; + +addDecorator(orbitDecorator); diff --git a/packages/orbit-components/.storybook/tsconfig.json b/packages/orbit-components/.storybook/tsconfig.json new file mode 100644 index 0000000000..345a46b8f3 --- /dev/null +++ b/packages/orbit-components/.storybook/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "noEmit": true, + "module": "commonjs", + "target": "ESNext", + "jsx": "react" + }, + "include": ["./**/*"] +} diff --git a/packages/orbit-components/babel.config.js b/packages/orbit-components/babel.config.js index b29ef60eb9..1170a53ba2 100644 --- a/packages/orbit-components/babel.config.js +++ b/packages/orbit-components/babel.config.js @@ -1,33 +1,21 @@ -// @noflow - module.exports = { presets: [ [require.resolve("@babel/preset-env"), { bugfixes: true, loose: true }], [require.resolve("@babel/preset-react"), { runtime: "classic" }], - require.resolve("@babel/preset-flow"), + [require.resolve("@babel/preset-typescript"), { isTSX: true, allExtensions: true }], ], plugins: [ require.resolve("babel-plugin-styled-components"), - [ - "@babel/plugin-proposal-class-properties", - { - loose: true, - }, - ], - [ - "@babel/plugin-proposal-private-methods", - { - loose: true, - }, - ], + [require.resolve("@babel/plugin-proposal-class-properties"), { loose: true }], + [require.resolve("@babel/plugin-proposal-private-methods"), { loose: true }], require.resolve("@babel/plugin-proposal-object-rest-spread"), require.resolve("@babel/plugin-proposal-nullish-coalescing-operator"), + require.resolve("@adeira/babel-preset-adeira/src/adeira-js-warning"), + require.resolve("@adeira/babel-preset-adeira/src/adeira-js-invariant"), [ require.resolve("@babel/plugin-transform-runtime"), { version: require("@babel/runtime/package.json").version }, ], - require.resolve("@adeira/babel-preset-adeira/src/adeira-js-warning"), - require.resolve("@adeira/babel-preset-adeira/src/adeira-js-invariant"), ], env: { esm: { diff --git a/packages/orbit-components/config/build.mjs b/packages/orbit-components/config/build.mjs deleted file mode 100644 index 6ea602ea2c..0000000000 --- a/packages/orbit-components/config/build.mjs +++ /dev/null @@ -1,105 +0,0 @@ -import { $, chalk, globby, fs } from "zx"; -import * as babel from "@babel/core"; -import ora from "ora"; -import dedent from "dedent"; - -const logStep = msg => { - console.log(`\n${chalk.yellow.underline(msg)}`); -}; - -(async () => { - if (argv.size) { - console.log( - chalk.magentaBright( - `\nThe --size flag is on, meaning that we're building only what is necessary for measuring size.`, - ), - ); - } - - logStep("Cleanup"); - - await $`rimraf lib es umd "src/icons/*.{js?(x),js?(x).flow,d.ts}" orbit-icons-font orbit-icons-font.zip orbit-svgs.zip .out`; - - logStep("Building icons"); - - await $`babel-node config/buildIcons.js`; - - logStep("Build tokens"); - - await $`yarn workspace @kiwicom/orbit-design-tokens build`; - - if (!argv.size) { - await $`zx config/createSVGFont.mjs`; - await $`cd src/icons; zip -r ../../orbit-svgs.zip ./svg; cd -`; - await $`zip -j orbit-svgs.zip orbit-icons-font/orbit-icons.svg`; - await $`zip -r orbit-icons-font.zip orbit-icons-font`; - } - - logStep("Compiling source"); - - const files = await globby("**/*.js?(x)", { - cwd: "src", - ignore: [ - "**/__tests__/**", - "**/*.test.*", - "**/__typetests__/**", - "**/examples.*", - "**/*.stories.*", - ], - }); - - const commonJs = ["CommonJS", "lib", await babel.loadOptions()]; - const esModules = ["ES Modules", "es", await babel.loadOptions({ envName: "esm" })]; - - for (const [name, dir, options] of [commonJs, esModules]) { - const spinner = ora(name).start(); - for (const file of files) { - const result = await babel.transformFileAsync(`src/${file}`, options); - await fs.outputFile(`${dir}/${file.replace(/\.jsx$/, ".js")}`, result.code); - } - spinner.succeed(`${name} → ${dir}`); - } - - if (argv.size) { - // https://github.com/ai/size-limit/issues/265 - await fs.outputFile( - `es/size-measurer.js`, - dedent` - import * as Orbit from "."; - import * as rtl from "./utils/rtl"; - - export { Orbit, rtl }; - `, - ); - } - - if (!argv.size) { - const spinner = ora("UMD").start(); - $.verbose = false; - await $`webpack --mode=production`; - $.verbose = true; - spinner.succeed(`UMD → umd`); - - logStep("Type declarations"); - - await $`babel-node config/typeFiles.js`; - await $`cpy "**/*.{js?(x).flow,d.ts}" ../lib --cwd src --parents`; - await $`cpy "**/*.{js?(x).flow,d.ts}" ../es --cwd src --parents`; - - for (const file of await globby("{lib,es}/**/*.jsx.flow")) { - await fs.rename(file, file.replace(/\.jsx\.flow$/, ".js.flow")); - } - } - - if (argv.size) { - logStep("Copying dictionaries"); - - await $`cpy "**/*.json" ../lib --cwd src --parents`; - await $`cpy "**/*.json" ../es --cwd src --parents`; - } else { - logStep("Copying dictionaries and documentation"); - - await $`cpy "**/*.{md,json}" ../lib --cwd src --parents`; - await $`cpy "**/*.{md,json}" ../es --cwd src --parents`; - } -})(); diff --git a/packages/orbit-components/config/build/buildIcons.mts b/packages/orbit-components/config/build/buildIcons.mts new file mode 100644 index 0000000000..bae125f955 --- /dev/null +++ b/packages/orbit-components/config/build/buildIcons.mts @@ -0,0 +1,198 @@ +import { path, fs, globby } from "zx"; +import { JSDOM } from "jsdom"; +import capitalize from "capitalize"; +import camelcase from "camelcase"; +import mkdirp from "mkdirp"; +import { types as t } from "@babel/core"; +import { transform } from "@svgr/core"; +import svgoPlugin from "@svgr/plugin-svgo"; +import jsxPlugin from "@svgr/plugin-jsx"; +import prettierPlugin from "@svgr/plugin-prettier"; +import filedirname from "filedirname"; + +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { getProperty, getHTMLComments } from "../checkIcons.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { NAMES as ILLUSTRATION_NAMES } from "../../src/Illustration/consts.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { NAMES as AIRPORT_ILLUSTRATION_NAMES } from "../../src/AirportIllustration/consts.mts"; + +(async () => { + const files = await globby("src/icons/svg/*.svg"); + const [, __dirname] = filedirname(); + + const names = files.map(inputFileName => { + const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, ""); + const functionName = capitalize(camelcase(baseName), true); + const outputComponentFileName = `${functionName}.tsx`; + + return { + inputFileName, + outputComponentFileName, + functionName, + baseName, + }; + }); + + const componentPath = path.join(__dirname, "../../", "src", "icons"); + // @ts-expect-error TODO + mkdirp(componentPath); + + function getViewBox(attributes) { + return getProperty(attributes, "viewBox", "0 0 24 24"); + } + + const template = ({ componentName, jsx }, { tpl }) => { + const viewBox = getViewBox(jsx.openingElement.attributes); + const iconPath = t.jsxFragment(t.jsxOpeningFragment(), t.jsxClosingFragment(), jsx.children); + const iconViewbox = typeof viewBox === "string" ? t.stringLiteral(viewBox) : ""; + const iconName = t.stringLiteral(componentName); + + return tpl` + /* eslint-disable */ + import * as React from "react"; + + import createIcon from "../Icon/createIcon"; + + export default createIcon(${iconPath}, ${iconViewbox}, ${iconName}); + `; + }; + + const flowTemplate = functionName => `// @flow +import * as React from "react"; + +import type { Props } from "../Icon"; + +export type ${functionName}Type = React.ComponentType; + +declare export default ${functionName}Type; + `; + + const typescriptTemplate = (functionName: string) => ` +import * as React from "react"; + +import { Props } from "../Icon/types"; + +declare const ${functionName}: React.FunctionComponent; + +export { ${functionName}, ${functionName} as default }; + `; + + names.forEach(async ({ inputFileName, outputComponentFileName, functionName }) => { + const dom = await JSDOM.fromFile(inputFileName); + const content = dom.window.document.querySelector("svg"); + + if (content) { + transform( + content.outerHTML, + { + plugins: [svgoPlugin, jsxPlugin, prettierPlugin], + svgProps: { viewBox: getViewBox(content.attributes) || "" }, + template, + }, + { componentName: functionName }, + ) + .then(code => { + fs.writeFileSync(path.join(componentPath, outputComponentFileName), code); + }) + .catch(err => console.error(err)); + } + + // write Flow declaration for every icon + fs.writeFileSync( + path.join(componentPath, `${outputComponentFileName.replace(/\.tsx?/, ".js")}.flow`), + flowTemplate(functionName), + ); + + // write TypeScript declaration for every icon + fs.writeFileSync( + path.join(componentPath, `${outputComponentFileName.replace(/\.tsx?/, "")}.d.ts`), + typescriptTemplate(functionName), + ); + }); + + const index = names + .map( + ({ functionName }) => `export { default as ${functionName} +} from "./${functionName}"; \n`, + ) + .join(""); + + fs.writeFileSync(path.join(componentPath, "index.ts"), index); + + const flow = `// @flow +import * as React from "react";\n\n`; + + const TSHeader = `// Type definitions for @kiwicom/orbit-components +// Project: https://github.com/kiwicom/orbit/\n`; + + const iconMapper = interpolation => + names.map(({ functionName }) => interpolation(functionName)).join(""); + + fs.writeFileSync( + path.join(componentPath, "index.js.flow"), + flow + + iconMapper(name => `import type { ${name}Type } from "./${name}";\n`) + + iconMapper(name => `declare export var ${name}: ${name}Type;\n`), + ); + + fs.writeFileSync( + path.join(componentPath, "index.d.ts"), + TSHeader + iconMapper(name => `export { ${name} } from "./${name}";\n`), + ); + + // create icons json file + Promise.all( + names.map( + ({ inputFileName, baseName }) => + new Promise((resolve, reject) => { + fs.readFile(inputFileName, "utf8", (err, content) => { + if (err) reject(); + // only get the HTML comments + const comments = getHTMLComments(content); + const url = `https://raw.githubusercontent.com/kiwicom/orbit/master/packages/orbit-components/src/icons/svg/${baseName}.svg`; + const dom = JSDOM.fragment(content); + const svg = dom.querySelector("svg")?.outerHTML; + resolve({ [baseName]: { ...comments, svg, url } }); + }); + }), + ), + ).then(data => + fs.writeFileSync( + path.join(__dirname, "../../", "src", "data", "icons.json"), + JSON.stringify(Object.assign({}, ...data)), + ), + ); + + // create illustrations json file + const illustrationsJSON = Object.assign( + {}, + ...ILLUSTRATION_NAMES.map(illustration => ({ + [illustration]: { + resized: `https://images.kiwi.com/illustrations/0x400/${illustration}-Q85.png`, + original: `https://images.kiwi.com/illustrations/originals/${illustration}.png`, + }, + })), + ); + + fs.writeFileSync( + path.join(__dirname, "../../", "src", "data", "illustrations.json"), + JSON.stringify(illustrationsJSON), + ); + + // create airport illustrations json file + const airportIllustrationsJSON = Object.assign( + {}, + ...AIRPORT_ILLUSTRATION_NAMES.map(illustration => ({ + [illustration]: { + resized: `https://images.kiwi.com/illustrations/0x400/${illustration}-Q85.png`, + original: `https://images.kiwi.com/illustrations/originals/${illustration}.png`, + }, + })), + ); + + fs.writeFileSync( + path.join(__dirname, "../../", "src", "data", "airportIllustrations.json"), + JSON.stringify(airportIllustrationsJSON), + ); +})(); diff --git a/packages/orbit-components/config/build/buildSize.mts b/packages/orbit-components/config/build/buildSize.mts new file mode 100644 index 0000000000..9111e158df --- /dev/null +++ b/packages/orbit-components/config/build/buildSize.mts @@ -0,0 +1,22 @@ +import { fs, $ } from "zx"; +import dedent from "dedent"; + +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { logStep } from "./helpers.mts"; + +export default async function buildSize() { + await fs.outputFile( + `es/size-measurer.js`, + dedent` + import * as Orbit from "."; + import * as rtl from "./utils/rtl"; + + export { Orbit, rtl }; + `, + ); + + logStep("Copying dictionaries"); + + await $`cpy "**/*.json" ../lib --cwd src --parents`; + await $`cpy "**/*.json" ../es --cwd src --parents`; +} diff --git a/packages/orbit-components/config/build/compileSource.mts b/packages/orbit-components/config/build/compileSource.mts new file mode 100644 index 0000000000..1c453c3088 --- /dev/null +++ b/packages/orbit-components/config/build/compileSource.mts @@ -0,0 +1,54 @@ +import { path, fs, globby, chalk, $ } from "zx"; +import babel from "@babel/core"; +import ora from "ora"; + +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { COMPILE_IGNORE_PATTERNS } from "./consts.mts"; + +type ModuleItem = ["cjs" | "esm", string, babel.TransformOptions | undefined | null]; + +const parseFile = (file: string, options: babel.TransformOptions) => { + return babel.transformFileAsync(file, options); +}; + +const renameFileExtension = (file: string) => { + if (path.extname(file) === ".ts" || path.extname(file) === ".tsx") { + return file.replace(/\.tsx?$/, ".js"); + } + + return file; +}; + +export default async function compileSource() { + const files = await globby("**/*.{mts,ts,tsx}", { + cwd: "src", + ignore: COMPILE_IGNORE_PATTERNS, + }); + + const cjsOptions = babel.loadOptions(); + const esmOptions = babel.loadOptions({ envName: "esm" }); + + const commonJs: ModuleItem = ["cjs", "lib", cjsOptions]; + const esModules: ModuleItem = ["esm", "es", esmOptions]; + + for (const [name, dir, options] of [commonJs, esModules]) { + if (options) { + console.log(chalk.greenBright(`Compiling files for ${name}`)); + const spinner = ora(name).start(); + + for (const file of files) { + const result = await parseFile(path.join("src", file), options); + + await fs.outputFile(renameFileExtension(path.join(dir, file)), result?.code); + } + + spinner.succeed(`${name} → ${dir}`); + } + } + + const spinner = ora("UMD").start(); + $.verbose = false; + await $`webpack --mode=production`; + $.verbose = true; + spinner.succeed(`UMD → umd`); +} diff --git a/packages/orbit-components/config/build/consts.mts b/packages/orbit-components/config/build/consts.mts new file mode 100644 index 0000000000..6313680ed4 --- /dev/null +++ b/packages/orbit-components/config/build/consts.mts @@ -0,0 +1,20 @@ +export const OUTPUT_PATTERNS = [ + "lib", + "es", + "umd", + ".out", + "src/icons/*.{ts?(x),d.ts}", + "orbit-icons-font", + "orbit-icons-font.zip", + "orbit-svgs.zip", +]; + +export const COMPILE_IGNORE_PATTERNS = [ + "**/*.d.ts", + "**/*.stories.*", + "**/*.test.*", + "**/__tests__/**/*", + "**/__typetests__/**/*", + "**/__examples__/*.*", + "**/examples.*", +]; diff --git a/packages/orbit-components/config/build/generateDeclarations.mts b/packages/orbit-components/config/build/generateDeclarations.mts new file mode 100644 index 0000000000..4f32123e4d --- /dev/null +++ b/packages/orbit-components/config/build/generateDeclarations.mts @@ -0,0 +1,44 @@ +import { $, chalk, fs, globby } from "zx"; +import flowgen, { beautify } from "flowgen"; +import filedirname from "filedirname"; +import dedent from "dedent"; + +const [, __dirname] = filedirname(); + +export default async function generateTypeDeclarations() { + await $`ts-node --esm config/typeFiles.mts`; + + console.log(chalk.greenBright.bold("Generating type declarations...")); + await $`cpy "**/*.js.flow" ../lib --cwd src --parents`; + await $`cpy "**/*.js.flow" ../es --cwd src --parents`; + await $`del tsconfig.tsbuildinfo`; // reset potential incremental compilation information + await $`tsc`; + await $`tsc --rootDir src --outDir es --declaration --emitDeclarationOnly --moduleResolution node`; + + console.log(chalk.greenBright.bold("Generating flow declarations...")); + const tsDeclarations = await globby("{lib,es}/*.d.ts"); + await Promise.all( + tsDeclarations.map(async declaration => { + const flowDeclPath = declaration.replace(".d.ts", ".js.flow"); + try { + if (await fs.pathExists(flowDeclPath)) return; + const flowDecl = beautify( + flowgen.compiler.compileDefinitionFile(declaration, { + interfaceRecords: true, + }), + ); + const content = ["// @flow", flowDecl].join("\n"); + await fs.writeFile(flowDeclPath, content); + } catch (err) { + if (err instanceof Error) { + err.message = dedent` + Failed to create a Flow libdef + ${__dirname}/${flowDeclPath} + ${err.message} + `; + throw err; + } + } + }), + ); +} diff --git a/packages/orbit-components/config/build/helpers.mts b/packages/orbit-components/config/build/helpers.mts new file mode 100644 index 0000000000..9fe68a0323 --- /dev/null +++ b/packages/orbit-components/config/build/helpers.mts @@ -0,0 +1,3 @@ +import { chalk } from "zx"; + +export const logStep = (msg: string) => console.log(`\n${chalk.yellow.underline(msg)}`); diff --git a/packages/orbit-components/config/build/index.mts b/packages/orbit-components/config/build/index.mts new file mode 100644 index 0000000000..061a0a5a93 --- /dev/null +++ b/packages/orbit-components/config/build/index.mts @@ -0,0 +1,52 @@ +import { $, argv, chalk } from "zx"; + +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import compileSource from "./compileSource.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { logStep } from "./helpers.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import { OUTPUT_PATTERNS } from "./consts.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import generateTypeDeclarations from "./generateDeclarations.mts"; +// @ts-expect-error FIXME: currently ts has some issue with importing mts ext +import buildSize from "./buildSize.mts"; + +(async () => { + logStep("Cleanup"); + + await $`del ${OUTPUT_PATTERNS}`; + + logStep("Building icons"); + + await $`ts-node --esm config/build/buildIcons.mts`; + + if (argv.size) { + console.log( + chalk.magentaBright( + `\nThe --size flag is on, meaning that we're building only what is necessary for measuring size.`, + ), + ); + } + + if (!argv.size) { + await $`ts-node --esm config/createSVGFont.mts`; + await $`cd src/icons; zip -r ../../orbit-svgs.zip ./svg; cd -`; + await $`zip -j orbit-svgs.zip orbit-icons-font/orbit-icons.svg`; + await $`zip -r orbit-icons-font.zip orbit-icons-font`; + } + + logStep("Compiling source"); + + await compileSource(); + + if (argv.size) { + await buildSize(); + } else { + logStep("Type declarations"); + await generateTypeDeclarations(); + + logStep("Copying dictionaries and documentation"); + await $`cpy "**/*.{md,json}" ../lib --cwd src --parents`; + await $`cpy "**/*.{md,json}" ../es --cwd src --parents`; + } +})(); diff --git a/packages/orbit-components/config/buildIcons.js b/packages/orbit-components/config/buildIcons.js deleted file mode 100644 index 7c1fe7027b..0000000000 --- a/packages/orbit-components/config/buildIcons.js +++ /dev/null @@ -1,187 +0,0 @@ -import path from "path"; -import fs from "fs"; -import { JSDOM } from "jsdom"; -import capitalize from "capitalize"; -import camelcase from "camelcase"; -import mkdirp from "mkdirp"; -import glob from "glob"; -import svgr from "@svgr/core"; -import * as t from "@babel/types"; -import svgoPlugin from "@svgr/plugin-svgo"; -import jsxPlugin from "@svgr/plugin-jsx"; -import prettierPlugin from "@svgr/plugin-prettier"; - -import { getProperty, getHTMLComments } from "./checkIcons"; -import { NAMES as ILLUSTRATION_NAMES } from "../src/Illustration/consts"; -import { NAMES as AIRPORT_ILLUSTRATION_NAMES } from "../src/AirportIllustration/consts"; - -const files = glob.sync("src/icons/svg/*.svg"); - -const names = files.map(inputFileName => { - const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, ""); - const functionName = capitalize(camelcase(baseName), true); - const outputComponentFileName = `${functionName}.jsx`; - - return { - inputFileName, - outputComponentFileName, - functionName, - baseName, - }; -}); - -const componentPath = path.join(__dirname, "..", "src", "icons"); -mkdirp(componentPath); - -function getViewBox(attributes) { - return getProperty(attributes, "viewBox", "0 0 24 24"); -} - -const template = (code, opts, { componentName, jsx }) => { - const viewBox = getViewBox(jsx.openingElement.attributes); - - const temp = code.template(` - // @flow - /* eslint-disable */ - import * as React from "react"; - - import createIcon from "../Icon/createIcon"; - - export default createIcon(PATH, VIEWBOX, NAME) - `); - - return temp({ - PATH: t.jsxFragment(t.jsxOpeningFragment(), t.jsxClosingFragment(), jsx.children), - VIEWBOX: t.stringLiteral(viewBox), - NAME: t.stringLiteral(componentName.name), - }); -}; - -const flowTemplate = functionName => `// @flow -import * as React from "react"; - -import type { Props } from "../Icon"; - -export type ${functionName}Type = React.ComponentType; - -declare export default ${functionName}Type; -`; - -const typescriptTemplate = functionName => `// @flow -import * as React from "react"; - -import { Props } from "../Icon"; - -declare const ${functionName}: React.FunctionComponent; -export { ${functionName}, ${functionName} as default }; -`; - -names.forEach(async ({ inputFileName, outputComponentFileName, functionName }) => { - const dom = await JSDOM.fromFile(inputFileName); - const content = dom.window.document.querySelector("svg"); - - svgr( - content.outerHTML, - { - plugins: [svgoPlugin, jsxPlugin, prettierPlugin], - svgProps: { viewBox: getViewBox(content.attributes) }, - template, - }, - { componentName: functionName }, - ) - .then(code => { - fs.writeFileSync(path.join(componentPath, outputComponentFileName), code); - }) - .catch(err => console.error(err)); - - // write Flow declaration for every icon - fs.writeFileSync( - path.join(componentPath, `${outputComponentFileName}.flow`), - flowTemplate(functionName), - ); - // write TypeScript declaration for every icon - fs.writeFileSync( - path.join(componentPath, `${outputComponentFileName.replace(/\.jsx?/, "")}.d.ts`), - typescriptTemplate(functionName), - ); -}); - -const index = names - .map(({ functionName }) => `export { default as ${functionName} } from "./${functionName}";\n`) - .join(""); -fs.writeFileSync(path.join(componentPath, "index.js"), index); - -const flow = `// @flow -import * as React from "react";\n\n`; - -const TSHeader = `// Type definitions for @kiwicom/orbit-components -// Project: https://github.com/kiwicom/orbit/\n`; - -const iconMapper = interpolation => - names.map(({ functionName }) => interpolation(functionName)).join(""); - -fs.writeFileSync( - path.join(componentPath, "index.js.flow"), - flow + - iconMapper(name => `import type { ${name}Type } from "./${name}";\n`) + - iconMapper(name => `declare export var ${name}: ${name}Type;\n`), -); -fs.writeFileSync( - path.join(componentPath, "index.d.ts"), - TSHeader + iconMapper(name => `export { ${name} } from "./${name}";\n`), -); - -// create icons json file -Promise.all( - names.map( - ({ inputFileName, baseName }) => - new Promise((resolve, reject) => { - fs.readFile(inputFileName, "utf8", (err, content) => { - if (err) reject(); - // only get the HTML comments - const comments = getHTMLComments(content, baseName); - const url = `https://raw.githubusercontent.com/kiwicom/orbit/master/packages/orbit-components/src/icons/svg/${baseName}.svg`; - const dom = JSDOM.fragment(content); - const svg = dom.querySelector("svg").outerHTML; - resolve({ [baseName]: { ...comments, svg, url } }); - }); - }), - ), -).then(data => - fs.writeFileSync( - path.join(__dirname, "..", "src", "data", "icons.json"), - JSON.stringify(Object.assign({}, ...data)), - ), -); - -// create illustrations json file -const illustrationsJSON = Object.assign( - {}, - ...ILLUSTRATION_NAMES.map(illustration => ({ - [illustration]: { - resized: `https://images.kiwi.com/illustrations/0x400/${illustration}-Q85.png`, - original: `https://images.kiwi.com/illustrations/originals/${illustration}.png`, - }, - })), -); - -fs.writeFileSync( - path.join(__dirname, "..", "src", "data", "illustrations.json"), - JSON.stringify(illustrationsJSON), -); - -// create airport illustrations json file -const airportIllustrationsJSON = Object.assign( - {}, - ...AIRPORT_ILLUSTRATION_NAMES.map(illustration => ({ - [illustration]: { - resized: `https://images.kiwi.com/illustrations/0x400/${illustration}-Q85.png`, - original: `https://images.kiwi.com/illustrations/originals/${illustration}.png`, - }, - })), -); - -fs.writeFileSync( - path.join(__dirname, "..", "src", "data", "airportIllustrations.json"), - JSON.stringify(airportIllustrationsJSON), -); diff --git a/packages/orbit-components/config/checkIcons.js b/packages/orbit-components/config/checkIcons.js deleted file mode 100644 index 1233e32146..0000000000 --- a/packages/orbit-components/config/checkIcons.js +++ /dev/null @@ -1,138 +0,0 @@ -/* -This script checks the validity of a given set of icons. They need to: - -- Have unique HTML character comments (and not empty) -- Do not have fill attributes (fill, fill-rule) -- Have an standard size (can be specified on the checkIcons function, in pixels) -*/ - -import path from "path"; -import { JSDOM } from "jsdom"; -import glob from "glob"; -import dedent from "dedent"; - -// Default icon size to enforce in px -const DEFAULT_ICON_SIZE = "24"; -const DEFAULT_ICON_PATH = "src/icons/svg/*.svg"; - -export function getHTMLComments(content) { - const rawComments = content.match(//gm); - if (rawComments) { - return Object.assign( - {}, - ...rawComments.map(item => { - // remove HTML comments and split by colon - const items = item.replace(//gm, "$1").split(":"); - // one icon has color as character - const value = items[1] === "" && items[2] === "" ? ":" : items[1]; - return { [items[0]]: value }; - }), - ); - } - return null; -} - -export function getProperty(attributes, name, defaultValue = null) { - for (let i = attributes.length - 1; i >= 0; i -= 1) { - if (attributes[i].name === name) { - return attributes[i].value; - } - } - return defaultValue; -} - -// This function checks if there's a character value in the SVG definition or if the character value already exists in some icon (has to be unique) -function checkCharacterValues(comments, baseName, allCharacters) { - if (!comments || !comments.character) { - throw new Error( - `A character value needs to be present in SVG definition of ${baseName}.svg as HTML comment. Otherwise the icon font build will be broken.`, - ); - } - allCharacters.forEach(({ name, char }) => { - if (char === comments.character) { - throw new Error( - `A character ${comments.character} is already present on ${name} icon. Change the character value on ${baseName}, so it's unique.`, - ); - } - }); - allCharacters.push({ name: baseName, char: comments.character }); -} - -// Checks if the fill attributes are present on the icons and throw an error if so -function checkFillAttributes(comments, content, name) { - // only check icons that don't have replacement for icon font - if (comments && comments.iconFont !== "false" && comments.customColor == null) { - const findAttrAndThrowErr = node => { - if (getProperty(node.attributes, "fill")) { - throw new Error( - `${name} contains the "fill" attribute, please delete it, otherwise this icon will look broken in the icon font`, - ); - } - if (getProperty(node.attributes, "fill-rule") === "evenodd") { - throw new Error( - dedent` - ${name} contains the "fill-rule" attribute with the value "evenodd". - You must redraw the icon in a way that converts this attribute to its default value, "nonzero", otherwise this icon will look broken in the icon font. - - Thankfully, there's a Figma plugin that helps you do exactly that, Fill Rule Editor: - - https://www.figma.com/community/plugin/771155994770327940/Fill-Rule-Editor - `, - ); - } - }; - // For the main DOM element - findAttrAndThrowErr(content); - // for all the children - paths - Object.values(content.children).forEach(node => findAttrAndThrowErr(node)); - } -} - -// This function checks if the icon complies with a given size (e.g. 24 x 24) -function checkIconSize(content, name, size) { - const phrase = attrName => `The ${attrName} attribute on the ${name} SVG icon has to be ${size}!`; - - ["width", "height"].forEach(attrName => { - if (getProperty(content.attributes, attrName) !== size) { - throw new Error(phrase(attrName)); - } - }); -} - -export default async function checkIcons( - iconPaths = DEFAULT_ICON_PATH, - iconSize = DEFAULT_ICON_SIZE, -) { - const files = glob.sync(iconPaths || DEFAULT_ICON_PATH); - - if (!files || !files.length) { - console.error("There are no icons on the specified path"); - process.exit(1); - } - - const allIconsCharacters = []; - - // We get the names of the icons in the directory - const names = files.map(inputFileName => { - const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, ""); - return { - inputFileName, - baseName, - }; - }); - - names.forEach(async ({ inputFileName, baseName }) => { - const dom = await JSDOM.fromFile(inputFileName); - const comments = getHTMLComments(dom.serialize()); - const content = dom.window.document.querySelector("svg"); - - try { - checkFillAttributes(comments, content, inputFileName); - checkCharacterValues(comments, baseName, allIconsCharacters); - checkIconSize(content, baseName, iconSize); - } catch (error) { - console.error(error.message); - process.exit(1); - } - }); -} diff --git a/packages/orbit-components/config/checkIcons.mts b/packages/orbit-components/config/checkIcons.mts new file mode 100644 index 0000000000..75de9935ee --- /dev/null +++ b/packages/orbit-components/config/checkIcons.mts @@ -0,0 +1,143 @@ +/* +This script checks the validity of a given set of icons. They need to: + +- Have unique HTML character comments (and not empty) +- Do not have fill attributes (fill, fill-rule) +- Have an standard size (can be specified on the checkIcons function, in pixels) +*/ + +import { path, globby } from "zx"; +import { JSDOM } from "jsdom"; +import dedent from "dedent"; + +// Default icon size to enforce in px +const DEFAULT_ICON_SIZE = "24"; +const DEFAULT_ICON_PATH = "src/icons/svg/*.svg"; + +interface Attr { + name: string; + value: string; +} + +export function getHTMLComments(content: string) { + const rawComments = content.match(//gm); + if (rawComments) { + return Object.assign( + {}, + ...rawComments.map(item => { + // remove HTML comments and split by colon + const items = item.replace(//gm, "$1").split(":"); + // one icon has color as character + const value = items[1] === "" && items[2] === "" ? ":" : items[1]; + return { [items[0]]: value }; + }), + ); + } + + return null; +} + +export function getProperty(attributes: Attr[], name: string, defaultValue: null | string = null) { + for (let i = attributes.length - 1; i >= 0; i -= 1) { + if (attributes[i].name === name) { + return attributes[i].value; + } + } + return defaultValue; +} + +// This function checks if there's a character value in the SVG definition or if the character value already exists in some icon (has to be unique) +function checkCharacterValues(comments, baseName, allCharacters) { + if (!comments || !comments.character) { + throw new Error( + `A character value needs to be present in SVG definition of ${baseName}.svg as HTML comment. Otherwise the icon font build will be broken.`, + ); + } + allCharacters.forEach(({ name, char }) => { + if (char === comments.character) { + throw new Error( + `A character ${comments.character} is already present on ${name} icon. Change the character value on ${baseName}, so it's unique.`, + ); + } + }); + allCharacters.push({ name: baseName, char: comments.character }); +} + +// Checks if the fill attributes are present on the icons and throw an error if so +function checkFillAttributes(comments, content, name) { + // only check icons that don't have replacement for icon font + if (comments && comments.iconFont !== "false" && comments.customColor == null) { + const findAttrAndThrowErr = node => { + if (getProperty(node.attributes, "fill")) { + throw new Error( + `${name} contains the "fill" attribute, please delete it, otherwise this icon will look broken in the icon font`, + ); + } + if (getProperty(node.attributes, "fill-rule") === "evenodd") { + throw new Error( + dedent` + ${name} contains the "fill-rule" attribute with the value "evenodd". + You must redraw the icon in a way that converts this attribute to its default value, "nonzero", otherwise this icon will look broken in the icon font. + + Thankfully, there's a Figma plugin that helps you do exactly that, Fill Rule Editor: + + https://www.figma.com/community/plugin/771155994770327940/Fill-Rule-Editor + `, + ); + } + }; + // For the main DOM element + findAttrAndThrowErr(content); + // for all the children - paths + Object.values(content.children).forEach(node => findAttrAndThrowErr(node)); + } +} + +// This function checks if the icon complies with a given size (e.g. 24 x 24) +function checkIconSize(content, name, size) { + const phrase = attrName => `The ${attrName} attribute on the ${name} SVG icon has to be ${size}!`; + + ["width", "height"].forEach(attrName => { + if (getProperty(content.attributes, attrName) !== size) { + throw new Error(phrase(attrName)); + } + }); +} + +export default async function checkIcons( + iconPaths = DEFAULT_ICON_PATH, + iconSize = DEFAULT_ICON_SIZE, +) { + const files = await globby(iconPaths || DEFAULT_ICON_PATH); + + if (!files || !files.length) { + console.error("There are no icons on the specified path"); + process.exit(1); + } + + const allIconsCharacters = []; + + // We get the names of the icons in the directory + const names = files.map(inputFileName => { + const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, ""); + return { + inputFileName, + baseName, + }; + }); + + names.forEach(async ({ inputFileName, baseName }) => { + const dom = await JSDOM.fromFile(inputFileName); + const comments = getHTMLComments(dom.serialize()); + const content = dom.window.document.querySelector("svg"); + + try { + checkFillAttributes(comments, content, inputFileName); + checkCharacterValues(comments, baseName, allIconsCharacters); + checkIconSize(content, baseName, iconSize); + } catch (error) { + console.error(error.message); + process.exit(1); + } + }); +} diff --git a/packages/orbit-components/config/checkIconsCli.js b/packages/orbit-components/config/checkIconsCli.js deleted file mode 100644 index 200ec9c703..0000000000 --- a/packages/orbit-components/config/checkIconsCli.js +++ /dev/null @@ -1,16 +0,0 @@ -import checkIcons from "./checkIcons"; - -/* - Paths are provided as arguments as for example in lint staged, - and formatted to blob pattern strings e.g. '({pattern1, pattern2}) -*/ -const paths = process.argv.slice(2); -const formatPaths = pattern => (pattern.length > 1 ? `{${pattern.join(",")}}` : pattern[0]); - -const iconPaths = formatPaths(paths); - -if (iconPaths) { - checkIcons(iconPaths); -} else { - checkIcons(); -} diff --git a/packages/orbit-components/config/checkIconsCli.mts b/packages/orbit-components/config/checkIconsCli.mts new file mode 100644 index 0000000000..4ba9ada049 --- /dev/null +++ b/packages/orbit-components/config/checkIconsCli.mts @@ -0,0 +1,17 @@ +// @ts-expect-error TODO +import checkIcons from "./checkIcons.mts"; + +/* + Paths are provided as arguments as for example in lint staged, + and formatted to blob pattern strings e.g. '({pattern1, pattern2}) +*/ +const paths = process.argv.slice(2); +const formatPaths = pattern => (pattern.length > 1 ? `{${pattern.join(",")}}` : pattern[0]); + +const iconPaths = formatPaths(paths); + +if (iconPaths) { + checkIcons(iconPaths); +} else { + checkIcons(); +} diff --git a/packages/orbit-components/config/createSVGFont.mjs b/packages/orbit-components/config/createSVGFont.mjs deleted file mode 100644 index 9fda83ac54..0000000000 --- a/packages/orbit-components/config/createSVGFont.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import SVGIcons2SVGFontStream from "svgicons2svgfont"; -import { path, fs } from "zx"; -import svg2ttf from "svg2ttf"; -import ttf2woff2 from "ttf2woff2"; - -const ORBIT_ICONS_DIR = path.join(__dirname, "../orbit-icons-font"); - -const createSVG = () => - new Promise((resolve, reject) => { - if (!fs.existsSync(ORBIT_ICONS_DIR)) { - fs.mkdirSync(ORBIT_ICONS_DIR); - } - - const fontStream = new SVGIcons2SVGFontStream({ - fontName: "orbit-icons", - fontHeight: 1000, - normalize: true, - verbose: false, - }); - - fontStream - .pipe(fs.createWriteStream(path.join(ORBIT_ICONS_DIR, "orbit-icons.svg"))) - .on("finish", () => { - resolve(); - }) - .on("error", err => { - reject(err); - }); - - const iconList = JSON.parse(fs.readFileSync(path.join(__dirname, "../src/data/icons.json"))); - - Object.keys(iconList).forEach(iconName => { - const iconPath = - iconList[iconName].iconFont === "false" ? "../src/icons/svg/mobile/" : "../src/icons/svg/"; - const icon = fs.createReadStream(path.join(__dirname, iconPath, `${iconName}.svg`)); - - // $FlowFixMe - icon.metadata = { - unicode: [String.fromCharCode(Number(`0x${iconList[iconName].character}`))], - name: iconName, - }; - - fontStream.write(icon); - }); - - fontStream.end(); - }); - -createSVG().then(() => { - const TTF_PATH = path.join(ORBIT_ICONS_DIR, "orbit-icons.ttf"); - - const TTF = svg2ttf(fs.readFileSync(path.join(ORBIT_ICONS_DIR, "orbit-icons.svg"), "utf8"), {}); - fs.writeFileSync(TTF_PATH, Buffer.from(TTF.buffer)); - - fs.writeFileSync( - path.join(ORBIT_ICONS_DIR, "orbit-icons.woff2"), - ttf2woff2(fs.readFileSync(TTF_PATH)), - ); -}); diff --git a/packages/orbit-components/config/createSVGFont.mts b/packages/orbit-components/config/createSVGFont.mts new file mode 100644 index 0000000000..1ad4ac6e32 --- /dev/null +++ b/packages/orbit-components/config/createSVGFont.mts @@ -0,0 +1,62 @@ +import SVGIcons2SVGFontStream from "svgicons2svgfont"; +import { path, fs } from "zx"; +import svg2ttf from "svg2ttf"; +import ttf2woff2 from "ttf2woff2"; +import filedirname from "filedirname"; + +const [, __dirname] = filedirname(); +const ORBIT_ICONS_DIR = path.join(__dirname, "../orbit-icons-font"); + +const createSVG = () => + new Promise((resolve, reject) => { + if (!fs.existsSync(ORBIT_ICONS_DIR)) { + fs.mkdirSync(ORBIT_ICONS_DIR); + } + + const fontStream = new SVGIcons2SVGFontStream({ + fontName: "orbit-icons", + fontHeight: 1000, + normalize: true, + }); + + fontStream + .pipe(fs.createWriteStream(path.join(ORBIT_ICONS_DIR, "orbit-icons.svg"))) + .on("finish", () => { + resolve(undefined); + }) + .on("error", (err: Error) => { + reject(err); + }); + + const iconList = JSON.parse( + fs.readFileSync(path.join(__dirname, "/../src/data/icons.json"), "utf8"), + ); + + Object.keys(iconList).forEach(iconName => { + const iconPath = + iconList[iconName].iconFont === "false" ? "../src/icons/svg/mobile/" : "../src/icons/svg/"; + const icon = fs.createReadStream(path.join(__dirname, iconPath, `${iconName}.svg`)); + + // @ts-expect-error TODO + icon.metadata = { + unicode: [String.fromCharCode(Number(`0x${iconList[iconName].character}`))], + name: iconName, + }; + + fontStream.write(icon); + }); + + fontStream.end(); + }); + +createSVG().then(() => { + const TTF_PATH = path.join(ORBIT_ICONS_DIR, "orbit-icons.ttf"); + + const TTF = svg2ttf(fs.readFileSync(path.join(ORBIT_ICONS_DIR, "orbit-icons.svg"), "utf8"), {}); + fs.writeFileSync(TTF_PATH, Buffer.from(TTF.buffer)); + + fs.writeFileSync( + path.join(ORBIT_ICONS_DIR, "orbit-icons.woff2"), + ttf2woff2(fs.readFileSync(TTF_PATH)), + ); +}); diff --git a/packages/orbit-components/config/deploymentUtils.js b/packages/orbit-components/config/deploymentUtils.js deleted file mode 100644 index 1f91d133be..0000000000 --- a/packages/orbit-components/config/deploymentUtils.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -// const { resolve } = require("path"); -const { Octokit } = require("@octokit/rest"); - -const repo = "orbit"; - -const parseDescription = (body, str) => { - if (body.match(str)) return body; - return body.concat(`\n ${str}`); -}; - -export const updateLiveURL = async ( - pr: number, - lastUrl: string, - token: string, - urlName: string = "LiveURL", -) => { - if (!pr) throw new Error("Missing PR number"); - - const octokit = new Octokit({ log: console, auth: token }); - - const { data } = await octokit.pulls.get({ - owner: "kiwicom", - repo, - pull_number: pr, - }); - - await octokit.pulls.update({ - owner: "kiwicom", - repo, - pull_number: pr, - body: parseDescription(data.body, `${urlName}: ${lastUrl}`), - }); -}; - -require("make-runnable"); diff --git a/packages/orbit-components/config/deploymentUtils.mts b/packages/orbit-components/config/deploymentUtils.mts new file mode 100644 index 0000000000..cd9c0fed6d --- /dev/null +++ b/packages/orbit-components/config/deploymentUtils.mts @@ -0,0 +1,33 @@ +import { Octokit } from "@octokit/rest"; +import "make-runnable"; + +const repo = "orbit"; + +const parseDescription = (body: string | null, str: string) => { + if (body && body.match(str)) return body; + return (body && body.concat(`\n ${str}`)) || ""; +}; + +export const updateLiveURL = async ( + pr: number, + lastUrl: string, + token: string, + urlName = "LiveURL", +) => { + if (!pr) throw new Error("Missing PR number"); + + const octokit = new Octokit({ log: console, auth: token }); + + const { data } = await octokit.pulls.get({ + owner: "kiwicom", + repo, + pull_number: pr, + }); + + await octokit.pulls.update({ + owner: "kiwicom", + repo, + pull_number: pr, + body: parseDescription(data.body, `${urlName}: ${lastUrl}`), + }); +}; diff --git a/packages/orbit-components/config/fetchIcons.mjs b/packages/orbit-components/config/fetchIcons.mjs deleted file mode 100644 index 6bffae2545..0000000000 --- a/packages/orbit-components/config/fetchIcons.mjs +++ /dev/null @@ -1,164 +0,0 @@ -import axios from "axios"; -import dotenv from "dotenv-safe"; -import dedent from "dedent"; -import ora from "ora"; -import { path, argv, fs, chalk } from "zx"; - -const EXCLUDE_COMPONENTS = ["Header", "FeatureIcons"]; -const ICONS_ID = "wjYAT0sNBXtirEoyKgXUwr"; -const FIGMA_FILE_URI = `https://api.figma.com/v1/files/${ICONS_ID}`; -const FIGMA_IMAGE_URI = `https://api.figma.com/v1/images/${ICONS_ID}`; -const SVG_FOLDER = path.resolve(process.cwd(), "src/icons/svg"); - -// helper functions -const isCorrectSize = name => { - const size = argv.size || "large"; - return name === `size=${size}`; -}; - -const range = (start, end) => Array.from({ length: end - start + 1 }, (_, i) => start + i); - -const sampleSize = (arr, size) => { - return arr - .slice(0) - .sort(() => Math.random() - 0.5) - .slice(0, size); -}; - -const removeCommentId = str => str.replace(//g, ""); - -try { - dotenv.config({ - example: `${process.cwd()}/../../.env.example`, - path: `${process.cwd()}/../../.env`, - }); -} catch (err) { - if (err.missing.includes("FIGMA_TOKEN")) { - throw new Error( - dedent` - Figma token is missing in the .env file: - ${err.missing.join("\n")} - You can generate one in your Figma account settings - `, - ); - } -} - -const api = url => - axios({ - method: "GET", - url, - headers: { "Content-Type": "application/", "X-FIGMA-TOKEN": process.env.FIGMA_TOKEN }, - }); - -const parseNodes = nodes => { - const result = {}; - let name = ""; - - const fn = data => { - // for of is slightly faster - for (const node of data) { - if (node.type === "COMPONENT_SET" || node.type === "FRAME") { - name = node.name; - fn(node.children); - } - if (node.type === "COMPONENT" && isCorrectSize(node.name)) { - result[node.id] = name; - } - } - }; - - fn(nodes); - - return result; -}; - -// just to avoid unnecessary breaking change -const parseName = name => { - if (name === "no-guarantee") return "kiwicom-no-guarantee"; - if (name === "guarantee") return "kiwicom-guarantee"; - if (name === "care-kiwi.com") return "kiwicom-care"; - if (name === "kiwi.com") return "kiwicom"; - if (name === "notificiation-add") return "notification-add"; - if (name === "google-colored") return "google"; - - if (/-colored/g.test(name)) return name.split("-").reverse().join("-"); - - return name; -}; - -const setSvgContent = (name, content, id) => { - if (/colored-/g.test(name) || name === "google") { - return dedent` - - - ${content}`; - } - - return dedent` - - ${content.replace(/(fill|clip)-rule="evenodd"|fill=".*"/gm, "")} - `; -}; - -async function saveOrbitIcons(data) { - const uniqueIds = sampleSize(range(1000, 9000), data.length + 1); - - let idx = 0; - for (const { name, svg } of data) { - idx += 1; - const parsedName = parseName(name); - const content = setSvgContent(parsedName, svg, uniqueIds[idx]); - const filePath = path.join(SVG_FOLDER, `${parsedName}.svg`); - - if (!fs.existsSync(filePath)) { - await fs.writeFile(filePath, content, "utf-8").then(() => { - console.log(chalk.green.bold(`saved ${parsedName}`)); - }); - } else if (removeCommentId(content) !== removeCommentId(fs.readFileSync(filePath, "utf-8"))) { - await fs.writeFile(filePath, content, "utf-8").then(() => { - console.log(chalk.yellow.bold(`file was changed, updated the content for: ${parsedName}`)); - }); - } - } -} - -const fetchOrbitIcons = async () => { - try { - const filesSpinner = ora(chalk.bold.underline.magenta("Fetching file ids...")).start(); - const { data } = await api(FIGMA_FILE_URI); - filesSpinner.succeed(chalk.bold.green("done")); - - const nodes = data.document.children - .find(node => node.type === "CANVAS" && node.name === "Icons") - .children.filter(node => !EXCLUDE_COMPONENTS.includes(node.name)); - - const icons = parseNodes(nodes); - const params = new URLSearchParams([ - ["ids", decodeURIComponent(Object.keys(icons).join(","))], - ["format", "svg"], - ]); - - const imagesSpinner = ora(chalk.bold.underline.magenta("Fetching and savings svgs...")).start(); - const { data: imagesData } = await api(`${FIGMA_IMAGE_URI}?${params.toString()}`); - - const svgs = await axios.all( - Object.entries(icons).map(([id, name]) => - axios.get(imagesData.images[id]).then(res => { - return { - id, - name: name.toLowerCase().replace(/\+kg/, "").replace(/\s+/g, "-"), - svg: res.data, - }; - }), - ), - ); - - await saveOrbitIcons(svgs); - imagesSpinner.succeed(chalk.bold.green("done")); - } catch (err) { - console.error(err); - } -}; - -fetchOrbitIcons(); diff --git a/packages/orbit-components/config/fetchIcons.mts b/packages/orbit-components/config/fetchIcons.mts new file mode 100644 index 0000000000..7002507ff4 --- /dev/null +++ b/packages/orbit-components/config/fetchIcons.mts @@ -0,0 +1,166 @@ +import axios from "axios"; +import dotenv from "dotenv-safe"; +import dedent from "dedent"; +import ora from "ora"; +import { path, argv, fs, chalk } from "zx"; + +const EXCLUDE_COMPONENTS = ["Header", "FeatureIcons"]; +const ICONS_ID = "wjYAT0sNBXtirEoyKgXUwr"; +const FIGMA_FILE_URI = `https://api.figma.com/v1/files/${ICONS_ID}`; +const FIGMA_IMAGE_URI = `https://api.figma.com/v1/images/${ICONS_ID}`; +const SVG_FOLDER = path.resolve(process.cwd(), "src/icons/svg"); + +// helper functions +const isCorrectSize = (name: string) => { + const size = argv.size || "large"; + return name === `size=${size}`; +}; + +const range = (start: number, end: number): number[] => + Array.from({ length: end - start + 1 }, (_, i) => start + i); + +const sampleSize = (arr: number[], size: number) => { + return arr + .slice(0) + .sort(() => Math.random() - 0.5) + .slice(0, size); +}; + +const removeCommentId = (str: string) => str.replace(//g, ""); + +try { + dotenv.config({ + example: `${process.cwd()}/../../.env.example`, + path: `${process.cwd()}/../../.env`, + }); +} catch (err) { + if (err.missing.includes("FIGMA_TOKEN")) { + throw new Error( + dedent` + Figma token is missing in the .env file: + ${err.missing.join("\n")} + You can generate one in your Figma account settings + `, + ); + } +} + +const api = (url: string) => + axios({ + method: "GET", + url, + headers: { "Content-Type": "application/", "X-FIGMA-TOKEN": process.env.FIGMA_TOKEN || "" }, + }); + +const parseNodes = nodes => { + const result = {}; + let name = ""; + + const fn = data => { + // for of is slightly faster + for (const node of data) { + if (node.type === "COMPONENT_SET" || node.type === "FRAME") { + name = node.name; + fn(node.children); + } + if (node.type === "COMPONENT" && isCorrectSize(node.name)) { + result[node.id] = name; + } + } + }; + + fn(nodes); + + return result; +}; + +// just to avoid unnecessary breaking change +const parseName = (name: string) => { + if (name === "no-guarantee") return "kiwicom-no-guarantee"; + if (name === "guarantee") return "kiwicom-guarantee"; + if (name === "care-kiwi.com") return "kiwicom-care"; + if (name === "kiwi.com") return "kiwicom"; + if (name === "notificiation-add") return "notification-add"; + if (name === "google-colored") return "google"; + + if (/-colored/g.test(name)) return name.split("-").reverse().join("-"); + + return name; +}; + +const setSvgContent = (name: string, content: string, id: number) => { + if (/colored-/g.test(name) || name === "google") { + return dedent` + + + ${content}`; + } + + return dedent` + + ${content.replace(/(fill|clip)-rule="evenodd"|fill=".*"/gm, "")} + `; +}; + +async function saveOrbitIcons(data) { + const uniqueIds = sampleSize(range(1000, 9000), data.length + 1); + + let idx = 0; + for (const { name, svg } of data) { + idx += 1; + const parsedName = parseName(name); + const content = setSvgContent(parsedName, svg, uniqueIds[idx]); + const filePath = path.join(SVG_FOLDER, `${parsedName}.svg`); + + if (!fs.existsSync(filePath)) { + await fs.writeFile(filePath, content, "utf-8").then(() => { + console.log(chalk.green.bold(`saved ${parsedName}`)); + }); + } else if (removeCommentId(content) !== removeCommentId(fs.readFileSync(filePath, "utf-8"))) { + await fs.writeFile(filePath, content, "utf-8").then(() => { + console.log(chalk.yellow.bold(`file was changed, updated the content for: ${parsedName}`)); + }); + } + } +} + +const fetchOrbitIcons = async () => { + try { + const filesSpinner = ora(chalk.bold.underline.magenta("Fetching file ids...")).start(); + const { data } = await api(FIGMA_FILE_URI); + filesSpinner.succeed(chalk.bold.green("done")); + + const nodes = data.document.children + .find(node => node.type === "CANVAS" && node.name === "Icons") + .children.filter(node => !EXCLUDE_COMPONENTS.includes(node.name)); + + const icons = parseNodes(nodes); + const params = new URLSearchParams([ + ["ids", decodeURIComponent(Object.keys(icons).join(","))], + ["format", "svg"], + ]); + + const imagesSpinner = ora(chalk.bold.underline.magenta("Fetching and savings svgs...")).start(); + const { data: imagesData } = await api(`${FIGMA_IMAGE_URI}?${params.toString()}`); + + const svgs = await axios.all( + Object.entries(icons).map(([id, name]) => + axios.get(imagesData.images[id]).then(res => { + return { + id, + // @ts-expect-error TODO + name: name.toLowerCase().replace(/\+kg/, "").replace(/\s+/g, "-"), + svg: res.data, + }; + }), + ), + ); + + await saveOrbitIcons(svgs); + imagesSpinner.succeed(chalk.bold.green("done")); + } catch (err) { + console.error(err); + } +}; + +fetchOrbitIcons(); diff --git a/packages/orbit-components/config/fetchTranslations.mjs b/packages/orbit-components/config/fetchTranslations.mjs deleted file mode 100644 index f19ce701a4..0000000000 --- a/packages/orbit-components/config/fetchTranslations.mjs +++ /dev/null @@ -1,114 +0,0 @@ -// @flow -import { fetch, path, fs } from "zx"; -import dedent from "dedent"; -import dotenv from "dotenv-safe"; - -try { - dotenv.config({ - example: `${process.cwd()}/../../.env.example`, - path: `${process.cwd()}/../../.env`, - }); -} catch (err) { - if ( - err.missing.includes("PHRASE_APP_PROJECT_ID") || - err.missing.includes("PHRASE_APP_ACCESS_TOKEN") - ) { - throw new Error( - dedent` - Some PhraseApp secrets are missing in the .env file: - - ${err.missing.join("\n")} - - You can find them in 1Password. - `, - ); - } -} - -const env = name => process.env[name] || ""; - -const PHRASE_APP_BASE_URL = "https://api.phraseapp.com/api/v2"; -const PHRASE_APP_PROJECT_ID = env("PHRASE_APP_PROJECT_ID"); -const PHRASE_APP_ACCESS_TOKEN = env("PHRASE_APP_ACCESS_TOKEN"); - -const LOCALES_URL = `${PHRASE_APP_BASE_URL}/projects/${PHRASE_APP_PROJECT_ID}/locales?per_page=50`; - -const SINGLE_LOCAL_URL = `${PHRASE_APP_BASE_URL}/projects/${PHRASE_APP_PROJECT_ID}/locales`; -const FILE_FORMAT = "nested_json"; -const LOCALES_DATA = path.join(__dirname, "..", "src", "data", "dictionary"); - -const INDEX_TEMPLATE = `// @flow\n__IMPORTS__\n\nexport default {\n__DECLARATIONS__\n};\n`; - -const fetchJSON = async url => { - const options = { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: `token ${PHRASE_APP_ACCESS_TOKEN}`, - }, - }; - return (await fetch(url, options)).json(); -}; - -const getImport = (c, p) => `import ${c} from "./${p}.json";`; - -const writeFile = (filename, content) => - new Promise((resolve, reject) => { - fs.outputFile(filename, content, "utf8", err => { - if (err) { - reject(err); - } - - resolve(); - }); - }); - -const writeIndexFile = async codes => { - const fullCodes = codes.map(code => { - const shortCode = code.split("-").join(""); - const importPath = getImport(shortCode, code); - return { code, shortCode, importPath }; - }); - const imports = fullCodes.map(f => f.importPath).join("\n"); - const declarations = fullCodes.map(f => ` "${f.code}": ${f.shortCode},`).join("\n"); - const content = INDEX_TEMPLATE.replace("__IMPORTS__", imports).replace( - "__DECLARATIONS__", - declarations, - ); - return writeFile(path.join(LOCALES_DATA, "index.js"), content); -}; - -const flatten = (obj = {}, keyPrefix = "") => - Object.entries(obj).reduce((result, [key, value]) => { - if (value && typeof value === "object") { - return { - ...result, - ...flatten(value, `${keyPrefix}${key}.`), - }; - } - return { - ...result, - [keyPrefix + key]: value, - }; - }, {}); - -(async () => { - try { - const allLocales = await fetchJSON(LOCALES_URL); - // PhraseApp has limits on parallel requests - // that's why we process requests in sequence - for (const locale of allLocales) { - const translation = await fetchJSON( - `${SINGLE_LOCAL_URL}/${locale.id}/download?file_format=${FILE_FORMAT}&tags=orbit&encoding=UTF-8`, - ); - await writeFile( - path.join(LOCALES_DATA, `${locale.code}.json`), - JSON.stringify(flatten(translation.orbit), null, 2), - ); - } - await writeIndexFile(Object.keys(allLocales).map(l => allLocales[l].code)); - } catch (error) { - console.error(error); - process.exit(1); - } -})(); diff --git a/packages/orbit-components/config/fetchTranslations.mts b/packages/orbit-components/config/fetchTranslations.mts new file mode 100644 index 0000000000..4fa81fe528 --- /dev/null +++ b/packages/orbit-components/config/fetchTranslations.mts @@ -0,0 +1,118 @@ +// @flow +import { fetch, path, fs } from "zx"; +import dedent from "dedent"; +import dotenv from "dotenv-safe"; + +try { + dotenv.config({ + example: `${process.cwd()}/../../.env.example`, + path: `${process.cwd()}/../../.env`, + }); +} catch (err) { + if ( + err.missing.includes("PHRASE_APP_PROJECT_ID") || + err.missing.includes("PHRASE_APP_ACCESS_TOKEN") + ) { + throw new Error( + dedent` + Some PhraseApp secrets are missing in the .env file: + + ${err.missing.join("\n")} + + You can find them in 1Password. + `, + ); + } +} + +const env = name => process.env[name] || ""; + +const PHRASE_APP_BASE_URL = "https://api.phraseapp.com/api/v2"; +const PHRASE_APP_PROJECT_ID = env("PHRASE_APP_PROJECT_ID"); +const PHRASE_APP_ACCESS_TOKEN = env("PHRASE_APP_ACCESS_TOKEN"); + +const LOCALES_URL = `${PHRASE_APP_BASE_URL}/projects/${PHRASE_APP_PROJECT_ID}/locales?per_page=50`; + +const SINGLE_LOCAL_URL = `${PHRASE_APP_BASE_URL}/projects/${PHRASE_APP_PROJECT_ID}/locales`; +const FILE_FORMAT = "nested_json"; +const LOCALES_DATA = path.join(__dirname, "..", "src", "data", "dictionary"); + +const INDEX_TEMPLATE = `// @flow\n__IMPORTS__\n\nexport default {\n__DECLARATIONS__\n};\n`; + +const fetchJSON = async (url: string) => { + const options = { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `token ${PHRASE_APP_ACCESS_TOKEN}`, + }, + }; + + return (await fetch(url, options)).json(); +}; + +const getImport = (c, p) => `import ${c} from "./${p}.json";`; + +const writeFile = (filename, content) => + new Promise((resolve, reject) => { + fs.outputFile(filename, content, "utf8", err => { + if (err) { + reject(err); + } + + Promise.resolve(); + }); + }); + +const writeIndexFile = async codes => { + const fullCodes = codes.map(code => { + const shortCode = code.split("-").join(""); + const importPath = getImport(shortCode, code); + return { code, shortCode, importPath }; + }); + const imports = fullCodes.map(f => f.importPath).join("\n"); + const declarations = fullCodes.map(f => ` "${f.code}": ${f.shortCode},`).join("\n"); + const content = INDEX_TEMPLATE.replace("__IMPORTS__", imports).replace( + "__DECLARATIONS__", + declarations, + ); + return writeFile(path.join(LOCALES_DATA, "index.js"), content); +}; + +const flatten = (obj = {}, keyPrefix = "") => + Object.entries(obj).reduce((result, [key, value]) => { + if (value && typeof value === "object") { + return { + ...result, + ...flatten(value, `${keyPrefix}${key}.`), + }; + } + return { + ...result, + [keyPrefix + key]: value, + }; + }, {}); + +(async () => { + try { + const allLocales = await fetchJSON(LOCALES_URL); + // PhraseApp has limits on parallel requests + // that's why we process requests in sequence + // @ts-expect-error TODO + for (const locale of allLocales) { + const translation = await fetchJSON( + `${SINGLE_LOCAL_URL}/${locale.id}/download?file_format=${FILE_FORMAT}&tags=orbit&encoding=UTF-8`, + ); + await writeFile( + path.join(LOCALES_DATA, `${locale.code}.json`), + // @ts-expect-error TODO + JSON.stringify(flatten(translation.orbit), null, 2), + ); + } + // @ts-expect-error TODO + await writeIndexFile(Object.keys(allLocales).map(l => allLocales[l].code)); + } catch (error) { + console.error(error); + process.exit(1); + } +})(); diff --git a/packages/orbit-components/config/generatePngIcons.js b/packages/orbit-components/config/generatePngIcons.js deleted file mode 100644 index d2a3b4838d..0000000000 --- a/packages/orbit-components/config/generatePngIcons.js +++ /dev/null @@ -1,103 +0,0 @@ -// @flow -const sharp = require("sharp"); -const fs = require("fs"); -const path = require("path"); -const { defaultTokens } = require("@kiwicom/orbit-design-tokens"); - -const DIR = path.join(__dirname, "../orbit-email-icons"); -const sizesToGenerate = [32, 48]; -const colors = [ - ["white", defaultTokens.paletteWhite], - ["secondary", defaultTokens.paletteInkLight], - ["tertiary", defaultTokens.paletteInkLighter], - ["primary", defaultTokens.paletteInkNormal], - ["warning", defaultTokens.paletteOrangeNormal], - ["error", defaultTokens.paletteRedNormal], - ["success", defaultTokens.paletteGreenNormal], - ["info", defaultTokens.paletteBlueNormal], -]; - -async function readFile(pathToFile) { - return new Promise((resolve, reject) => { - fs.readFile(pathToFile, "utf8", (err, data) => { - if (err) { - reject(err); - } - resolve(data); - }); - }); -} - -async function readDir(pathToDir) { - return new Promise((resolve, reject) => { - fs.readdir(pathToDir, (err, files) => { - if (err) { - reject(err); - } - resolve(files); - }); - }); -} - -async function generateIcon(pathToFile, size, color, extraDir) { - const nameSplit = pathToFile.split("/"); - const name = nameSplit[nameSplit.length - 1].replace(".svg", ""); - const file = - fs.lstatSync(`./src/icons/svg/${pathToFile}`).isFile() && - (await readFile(`./src/icons/svg/${pathToFile}`)); - - if (file) { - const updateBuffer = Buffer.from( - file.toString().replace(` { - const curDir = path.resolve(parentDir, childDir); - if (!fs.existsSync(curDir)) { - fs.mkdirSync(curDir); - } - return curDir; - }, initDir); -} - -(async () => { - try { - // Sync paths - sizesToGenerate.forEach(size => { - colors.forEach(color => { - generatePath(`${DIR}/${color[0]}/${size}x${size}`); - }); - }); - - // Find all icons - const files = await readDir("./src/icons/svg/"); - - const promises = []; - - // Generate every variant - files.forEach(file => { - colors.forEach(color => { - sizesToGenerate.forEach(size => { - promises.push(generateIcon(file, size, color[1], color[0])); - }); - }); - }); - - await Promise.all(promises); - } catch (error) { - console.error(error); - } -})(); diff --git a/packages/orbit-components/config/generatePngIcons.mts b/packages/orbit-components/config/generatePngIcons.mts new file mode 100644 index 0000000000..82286100b6 --- /dev/null +++ b/packages/orbit-components/config/generatePngIcons.mts @@ -0,0 +1,104 @@ +import sharp from "sharp"; +import { fs, path } from "zx"; +import filedirname from "filedirname"; +import { defaultTokens } from "@kiwicom/orbit-design-tokens"; + +const [, __dirname] = filedirname(); +const DIR = path.join(__dirname, "../orbit-email-icons"); +const sizesToGenerate = [32, 48]; +const colors = [ + ["white", defaultTokens.paletteWhite], + ["secondary", defaultTokens.paletteCloudNormal], + ["tertiary", defaultTokens.paletteInkLight], + ["primary", defaultTokens.paletteInkNormal], + ["warning", defaultTokens.paletteOrangeNormal], + ["error", defaultTokens.paletteRedNormal], + ["success", defaultTokens.paletteGreenNormal], + ["info", defaultTokens.paletteBlueNormal], +]; + +async function readFile(pathToFile) { + return new Promise((resolve, reject) => { + fs.readFile(pathToFile, "utf8", (err, data) => { + if (err) { + reject(err); + } + resolve(data); + }); + }); +} + +async function readDir(pathToDir) { + return new Promise((resolve, reject) => { + fs.readdir(pathToDir, (err, files) => { + if (err) { + reject(err); + } + resolve(files); + }); + }); +} + +async function generateIcon(pathToFile, size, color, extraDir) { + const nameSplit = pathToFile.split("/"); + const name = nameSplit[nameSplit.length - 1].replace(".svg", ""); + const file = + fs.lstatSync(`./src/icons/svg/${pathToFile}`).isFile() && + (await readFile(`./src/icons/svg/${pathToFile}`)); + + if (file) { + const updateBuffer = Buffer.from( + file.toString().replace(` { + const curDir = path.resolve(parentDir, childDir); + if (!fs.existsSync(curDir)) { + fs.mkdirSync(curDir); + } + return curDir; + }, initDir); +} + +(async () => { + try { + // Sync paths + sizesToGenerate.forEach(size => { + colors.forEach(color => { + generatePath(`${DIR}/${color[0]}/${size}x${size}`); + }); + }); + + // Find all icons + const files = await readDir("./src/icons/svg/"); + + const promises: Promise[] = []; + + // Generate every variant + // @ts-expect-error TODO + files.forEach(file => { + colors.forEach(color => { + sizesToGenerate.forEach(size => { + promises.push(generateIcon(file, size, color[1], color[0])); + }); + }); + }); + + await Promise.all(promises); + } catch (error) { + console.error(error); + } +})(); diff --git a/packages/orbit-components/config/jestSetupFramework.js b/packages/orbit-components/config/jestSetupFramework.ts similarity index 100% rename from packages/orbit-components/config/jestSetupFramework.js rename to packages/orbit-components/config/jestSetupFramework.ts diff --git a/packages/orbit-components/config/registerContext.js b/packages/orbit-components/config/registerContext.ts similarity index 100% rename from packages/orbit-components/config/registerContext.js rename to packages/orbit-components/config/registerContext.ts diff --git a/packages/orbit-components/config/typeFiles.js b/packages/orbit-components/config/typeFiles.js deleted file mode 100644 index 15725df260..0000000000 --- a/packages/orbit-components/config/typeFiles.js +++ /dev/null @@ -1,62 +0,0 @@ -// @flow -import path from "path"; -import fs from "fs"; - -import { NAMES as ILLUSTRATION_NAMES } from "../src/Illustration/consts"; -import { NAMES as AIRPORT_ILLUSTRATION_NAMES } from "../src/AirportIllustration/consts"; -import { NAME_OPTIONS as SERVICE_LOGOS_NAMES } from "../src/ServiceLogo/consts"; -import { NAME_OPTIONS as FEATURE_ICONS_NAMES } from "../src/FeatureIcon/consts"; - -const generateTypeFile = async (templatePath, replacements) => { - const TEMPLATE = await fs.readFileSync(templatePath, "utf8"); - const suffixArray = templatePath.split("."); - const suffix = suffixArray[suffixArray.length - 1]; - - const replacedTemplate = Object.keys(replacements).reduce( - (acc, cur) => acc.replace(new RegExp(`%${cur}%`, "g"), replacements[cur]), - TEMPLATE, - ); - - await fs.writeFileSync( - path.join(path.dirname(templatePath), suffix === "flow" ? "index.jsx.flow" : "index.d.ts"), - replacedTemplate, - ); -}; - -const templateFiles = [ - [ - path.join(__dirname, "..", "src", "AirportIllustration", "FLOW_TEMPLATE.flow"), - AIRPORT_ILLUSTRATION_NAMES, - ], - [ - path.join(__dirname, "..", "src", "AirportIllustration", "TYPESCRIPT_TEMPLATE.template"), - AIRPORT_ILLUSTRATION_NAMES, - ], - [path.join(__dirname, "..", "src", "Illustration", "FLOW_TEMPLATE.flow"), ILLUSTRATION_NAMES], - [ - path.join(__dirname, "..", "src", "Illustration", "TYPESCRIPT_TEMPLATE.template"), - ILLUSTRATION_NAMES, - ], - [ - path.join(__dirname, "..", "src", "ServiceLogo", "FLOW_TEMPLATE.flow"), - Object.values(SERVICE_LOGOS_NAMES), - ], - [ - path.join(__dirname, "..", "src", "ServiceLogo", "TYPESCRIPT_TEMPLATE.template"), - Object.values(SERVICE_LOGOS_NAMES), - ], - [ - path.join(__dirname, "..", "src", "FeatureIcon", "FLOW_TEMPLATE.flow"), - Object.values(FEATURE_ICONS_NAMES), - ], - [ - path.join(__dirname, "..", "src", "FeatureIcon", "TYPESCRIPT_TEMPLATE.template"), - Object.values(FEATURE_ICONS_NAMES), - ], -]; - -templateFiles.forEach(arr => { - generateTypeFile(arr[0], { - NAMES: `${arr[1].map(item => `\n | "${String(item)}"`).join("")};`, - }); -}); diff --git a/packages/orbit-components/config/typeFiles.mts b/packages/orbit-components/config/typeFiles.mts new file mode 100644 index 0000000000..453e3a6ab6 --- /dev/null +++ b/packages/orbit-components/config/typeFiles.mts @@ -0,0 +1,49 @@ +import { path, fs } from "zx"; +import filedirname from "filedirname"; + +// @ts-expect-error TODO +import { NAMES as ILLUSTRATION_NAMES } from "../src/Illustration/consts.mts"; +// @ts-expect-error TODO +import { NAMES as AIRPORT_ILLUSTRATION_NAMES } from "../src/AirportIllustration/consts.mts"; +// @ts-expect-error TODO +import { NAME_OPTIONS as SERVICE_LOGOS_NAMES } from "../src/ServiceLogo/consts.mts"; +// @ts-expect-error TODO +import { NAME_OPTIONS as FEATURE_ICONS_NAMES } from "../src/FeatureIcon/consts.mts"; + +const [, __dirname] = filedirname(); + +const generateTypeFile = async (templatePath: string, replacements: Record) => { + const TEMPLATE = fs.readFileSync(templatePath, "utf8"); + + const replacedTemplate = Object.keys(replacements).reduce( + (acc, cur) => acc.replace(new RegExp(`%${cur}%`, "g"), replacements[cur]), + TEMPLATE, + ); + + fs.writeFileSync(path.join(path.dirname(templatePath), "types.ts"), replacedTemplate); +}; + +const templateFiles = [ + { + path: path.join(__dirname, "..", "src", "AirportIllustration", "TYPESCRIPT_TEMPLATE.template"), + names: AIRPORT_ILLUSTRATION_NAMES, + }, + { + path: path.join(__dirname, "..", "src", "Illustration", "TYPESCRIPT_TEMPLATE.template"), + names: ILLUSTRATION_NAMES, + }, + { + path: path.join(__dirname, "..", "src", "ServiceLogo", "TYPESCRIPT_TEMPLATE.template"), + names: Object.values(SERVICE_LOGOS_NAMES), + }, + { + path: path.join(__dirname, "..", "src", "FeatureIcon", "TYPESCRIPT_TEMPLATE.template"), + names: Object.values(FEATURE_ICONS_NAMES), + }, +]; + +templateFiles.forEach(arr => { + generateTypeFile(arr.path, { + NAMES: `${arr.names.map(item => `\n | "${String(item)}"`).join("")};`, + }); +}); diff --git a/packages/orbit-components/cypress/tsconfig.json b/packages/orbit-components/cypress/tsconfig.json index 1399921d14..21be8170ee 100644 --- a/packages/orbit-components/cypress/tsconfig.json +++ b/packages/orbit-components/cypress/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "types": ["cypress", "@testing-library/cypress"] + "types": ["cypress", "@testing-library/cypress"], + "skipLibCheck": true }, "include": ["**/*.test.*"], "exclude": [] diff --git a/packages/orbit-components/jest.config.js b/packages/orbit-components/jest.config.js index 5d49c0f884..7ebb5835f3 100644 --- a/packages/orbit-components/jest.config.js +++ b/packages/orbit-components/jest.config.js @@ -1,10 +1,9 @@ // @noflow - module.exports = { displayName: "orbit-components", testEnvironment: "jsdom", - setupFiles: ["raf/polyfill", "./config/registerContext"], - setupFilesAfterEnv: ["./config/jestSetupFramework"], + setupFiles: ["raf/polyfill", "./config/registerContext.ts"], + setupFilesAfterEnv: ["./config/jestSetupFramework.ts"], transform: { "\\.[jt]sx?$": ["babel-jest", { root: __dirname }], }, diff --git a/packages/orbit-components/package.json b/packages/orbit-components/package.json index e5df2d3240..e68b9565bf 100644 --- a/packages/orbit-components/package.json +++ b/packages/orbit-components/package.json @@ -3,26 +3,30 @@ "version": "4.2.0", "description": "Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.", "sideEffects": false, + "main": "lib/index.js", + "module": "es/index.js", "scripts": { "storybook": "start-storybook -p 6007 -c .storybook --ci", "cy:dev": "vite cypress/integration --logLevel silent", "cy:run": "start-server-and-test cy:dev http-get://localhost:3000 'cypress run'", "cy:open": "start-server-and-test cy:dev http-get://localhost:3000 'cypress open'", - "prepublishOnly": "yarn build", - "build": "zx config/build.mjs", + "prepublishOnly": "yarn build && pinst --disable", + "postpublish": "pinst --enable", + "build": "ts-node --esm config/build/index.mts", "size:build": "yarn build --size", "size": "size-limit", "size:why": "size-limit --why", - "fetch:icons": "zx config/fetchIcons.mjs", - "check:icons": "babel-node config/checkIconsCli.js", - "build:iconsPng": "node config/generatePngIcons.js", - "build:storybook": "babel-node config/buildIcons.js && build-storybook -c .storybook -o .out", + "fetch:icons": "ts-node --esm config/fetchIcons.mts", + "check:icons": "ts-node --esm config/checkIconsCli.mts", + "check:types": "tsc --noEmit --emitDeclarationOnly false", + "flow:ci": "flow check", + "build:iconsPng": "ts-node --esm config/generatePngIcons.mts", + "build:storybook": "ts-node --esm config/build/buildIcons.mts && build-storybook -c .storybook -o .out", "eslint:check": "eslint . --report-unused-disable-directives", - "fetch-translations": "zx config/fetchTranslations.mjs --quiet", + "fetch-translations": "ts-node --esm config/fetchTranslations.mts --quiet", "deploy:storybook": "yarn storybook-to-ghpages -e ./.out", "deploy:surge": "yarn surge .out/", - "deploy:updateURL": "yarn babel-node config/deploymentUtils.js updateLiveURL", - "compile:ts": "yarn tsc", + "deploy:updateURL": "ts-node --esm config/deploymentUtils.mts updateLiveURL", "docs-gen": "monstra docs" }, "storybook-deployer": { @@ -57,9 +61,6 @@ "readme.md", "yarn.lock" ], - "main": "lib/index.js", - "module": "es/index.js", - "author": "kiwi.com", "license": "MIT", "resolutions": { "webpack": "^5.69.1", @@ -69,7 +70,8 @@ "style-loader": "^2.0.0", "terser-webpack-plugin": "^5.0.0", "webpack-dev-middleware": "^4.1.0", - "webpack-virtual-modules": "^0.4.2" + "webpack-virtual-modules": "^0.4.2", + "ts-node": "^10.9.1" }, "peerDependencies": { "@babel/runtime": "^7.18.9", @@ -108,6 +110,9 @@ "@nanostores/react": "^0.2.0", "@nanostores/router": "^0.3.1", "@octokit/rest": "^18.0.14", + "@size-limit/file": "^8.0.0", + "@size-limit/webpack": "^8.0.0", + "@size-limit/webpack-why": "^8.0.0", "@storybook/addon-actions": "^6.4.19", "@storybook/addon-backgrounds": "^6.5.9", "@storybook/addon-info": "^6.0.0-alpha.2", @@ -119,17 +124,24 @@ "@storybook/react": "^6.4.19", "@storybook/storybook-deployer": "^2.8.10", "@storybook/theming": "^6.4.19", - "@svgr/core": "^5.5.0", - "@svgr/plugin-jsx": "^5.5.0", - "@svgr/plugin-prettier": "^5.5.0", - "@svgr/plugin-svgo": "^5.5.0", + "@svgr/core": "^6.3.1", + "@svgr/plugin-jsx": "^6.3.1", + "@svgr/plugin-prettier": "^6.3.1", + "@svgr/plugin-svgo": "^6.3.1", "@testing-library/cypress": "^8.0.0", "@testing-library/jest-dom": "^5.11.10", "@testing-library/react": "^11.2.7", "@testing-library/react-hooks": "^7.0.0", "@testing-library/user-event": "^13.1.1", + "@types/capitalize": "^2.0.0", + "@types/dedent": "^0.7.0", "@types/react": "^17.0.26", + "@types/react-dom": "^17.0.9", + "@types/readable-stream": "^2.3.13", + "@types/storybook__react": "^5.2.1", "@types/styled-components": "^5.1.15", + "@types/svgicons2svgfont": "^10.0.1", + "@types/webpack": "^5.28.0", "axios": "^0.27.2", "babel-loader": "^8.2.5", "babel-plugin-require-context-hook": "^1.0.0", @@ -140,11 +152,13 @@ "cypress": "^8.3.0", "dedent": "^0.7.0", "dotenv-safe": "^8.2.0", + "filedirname": "^2.7.0", + "flowgen": "^1.20.1", "fs-extra": "^9.0.1", "glob": "^7.1.2", "jest-matchmedia-mock": "^1.1.0", "jest-styled-components": "^7.0.5", - "jscodeshift": "^0.13.0", + "jscodeshift": "^0.13.1", "jsdom": "^16.5.3", "loki": "^0.30.3", "make-runnable": "^1.3.10", @@ -153,7 +167,6 @@ "nanostores": "^0.5.12", "ora": "^6.1.0", "pinst": "^2.1.4", - "prettier": "^2.1.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-element-to-jsx-string": "^14.3.2", @@ -165,8 +178,10 @@ "surge": "^0.23.0", "svg2ttf": "^6.0.0", "svgicons2svgfont": "^10.0.0", + "ts-node": "10.9.1", "ttf2woff2": "^4.0.1", "vite": "^2.9.13", + "typescript": "^4.8.3", "webpack": "^5.69.1", "webpack-cli": "^4.9.2", "zx": "^7.0.7" diff --git a/packages/orbit-components/src/Accordion/Accordion.stories.jsx b/packages/orbit-components/src/Accordion/Accordion.stories.jsx deleted file mode 100644 index 7b1b9c5976..0000000000 --- a/packages/orbit-components/src/Accordion/Accordion.stories.jsx +++ /dev/null @@ -1,261 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; - -import Text from "../Text"; -import Button from "../Button"; -import Stack from "../Stack"; -import AccordionSection from "./AccordionSection"; -import useMediaQuery from "../hooks/useMediaQuery"; - -import Accordion from "."; - -const Footer = () => { - const { isTablet, isMediumMobile } = useMediaQuery(); - - return ( - - - - - ); -}; - -export default { - title: "Accordion", -}; - -export const Default = (): React.Node => { - const [expandedSection, setExpandedSection] = React.useState("0X1"); - - return ( - setExpandedSection(id)}> - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - > - This is a content text - - - ); -}; - -export const AccordionWithDisabledSections = (): React.Node => { - const [expandedSection, setExpandedSection] = React.useState("0X1"); - - return ( - setExpandedSection(id)}> - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - > - This is a content text - - - ); -}; - -AccordionWithDisabledSections.story = { - name: "Accordion with disabled sections", -}; - -export const AccordionWithCustomActions = (): React.Node => { - const [expandedSection, setExpandedSection] = React.useState("0X1"); - - return ( - setExpandedSection(id)}> - - This is a header label - This is a header label - - } - actions={} - > - This is a content text - - - This is a header label - This is a header label - - } - actions={} - > - This is a content text - - - This is a header label - This is a header label - - } - actions={ - - - - - } - > - This is a content text - - - ); -}; - -AccordionWithCustomActions.story = { - name: "Accordion with custom actions", -}; - -export const AccordionWithStickyFooter = (): React.Node => { - const [expandedSection, setExpandedSection] = React.useState("0X1"); - - return ( - setExpandedSection(id)}> - - This is a header label - This is a header label - - } - > - This is a content text - - - This is a header label - This is a header label - - } - footer={
} - > - This is a content text - This is a content text - This is a content text - - This is a content text - - This is a content text - This is a content text - This is a content text - This is a content text - - This is a content text - - This is a content text - This is a content text - This is a content text -
- - This is a content text - This is a content text - - } - footer={
} - > - This is a content text - This is a content text - This is a content text - This is a content text -
-
- ); -}; - -AccordionWithStickyFooter.story = { - name: "Accordion with sticky footer", -}; - -export const LoadingAccordion = (): React.Node => { - return ( - - This is a section content - - ); -}; diff --git a/packages/orbit-components/src/Accordion/Accordion.stories.tsx b/packages/orbit-components/src/Accordion/Accordion.stories.tsx new file mode 100644 index 0000000000..ff942fd77f --- /dev/null +++ b/packages/orbit-components/src/Accordion/Accordion.stories.tsx @@ -0,0 +1,259 @@ +import React from "react"; + +import Text from "../Text"; +import Button from "../Button"; +import Stack from "../Stack"; +import AccordionSection from "./AccordionSection"; +import useMediaQuery from "../hooks/useMediaQuery"; + +import Accordion from "."; + +const Footer = () => { + const { isTablet, isMediumMobile } = useMediaQuery(); + + return ( + + + + + ); +}; + +export default { + title: "Accordion", +}; + +export const Default = () => { + const [expandedSection, setExpandedSection] = React.useState("0X1"); + + return ( + setExpandedSection(String(id))}> + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + > + This is a content text + + + ); +}; + +export const AccordionWithDisabledSections = () => { + const [expandedSection, setExpandedSection] = React.useState("0X1"); + + return ( + setExpandedSection(String(id))}> + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + > + This is a content text + + + ); +}; + +AccordionWithDisabledSections.story = { + name: "Accordion with disabled sections", +}; + +export const AccordionWithCustomActions = () => { + const [expandedSection, setExpandedSection] = React.useState("0X1"); + + return ( + setExpandedSection(String(id))}> + + This is a header label + This is a header label + + } + actions={} + > + This is a content text + + + This is a header label + This is a header label + + } + actions={} + > + This is a content text + + + This is a header label + This is a header label + + } + actions={ + + + + + } + > + This is a content text + + + ); +}; + +AccordionWithCustomActions.story = { + name: "Accordion with custom actions", +}; + +export const AccordionWithStickyFooter = () => { + const [expandedSection, setExpandedSection] = React.useState("0X1"); + + return ( + setExpandedSection(String(id))}> + + This is a header label + This is a header label + + } + > + This is a content text + + + This is a header label + This is a header label + + } + footer={
} + > + This is a content text + This is a content text + This is a content text + + This is a content text + + This is a content text + This is a content text + This is a content text + This is a content text + + This is a content text + + This is a content text + This is a content text + This is a content text +
+ + This is a content text + This is a content text + + } + footer={
} + > + This is a content text + This is a content text + This is a content text + This is a content text +
+
+ ); +}; + +AccordionWithStickyFooter.story = { + name: "Accordion with sticky footer", +}; + +export const LoadingAccordion = () => { + return ( + + This is a section content + + ); +}; diff --git a/packages/orbit-components/src/Accordion/AccordionContext.js b/packages/orbit-components/src/Accordion/AccordionContext.js deleted file mode 100644 index 81a8baa317..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionContext.js +++ /dev/null @@ -1,17 +0,0 @@ -// @flow -import * as React from "react"; - -import type { Context } from "./AccordionContext"; - -export const accordionDefault: Context = { - onExpand: () => {}, - expanded: false, - loading: false, -}; - -const context: React.Context = React.createContext(accordionDefault); -context.displayName = "AccordionOrbitContext"; - -export const useAccordion = (): Context => React.useContext(context); - -export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Accordion/AccordionContext.js.flow b/packages/orbit-components/src/Accordion/AccordionContext.js.flow deleted file mode 100644 index 4e6ccfc68a..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionContext.js.flow +++ /dev/null @@ -1,16 +0,0 @@ -// @flow -import * as React from "react"; - -export type Context = {| - +onExpand?: () => void | Promise, - +expanded: boolean, - +loading?: boolean, -|}; - -declare export var accordionDefault: Context; - -declare export var context: React.Context; - -declare export function useAccordion(): Context; - -export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Accordion/AccordionContext.ts b/packages/orbit-components/src/Accordion/AccordionContext.ts new file mode 100644 index 0000000000..6a3a01a7dc --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionContext.ts @@ -0,0 +1,22 @@ +import React from "react"; + +import * as Common from "../common/types"; + +interface Context { + readonly onExpand?: Common.Callback; + readonly expanded: boolean; + readonly loading?: boolean; +} + +export const accordionDefault: Context = { + onExpand: () => {}, + expanded: false, + loading: false, +}; + +const context: React.Context = React.createContext(accordionDefault); +context.displayName = "AccordionOrbitContext"; + +export const useAccordion = (): Context => React.useContext(context); + +export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.jsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.jsx deleted file mode 100644 index 7d13a60773..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.jsx +++ /dev/null @@ -1,26 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import defaultTheme from "../../../defaultTheme"; -import type { Globals } from "../../../common/common.js.flow"; - -const Wrapper = styled.div` - padding: ${({ theme }) => `0 ${theme.orbit.spaceLarge} ${theme.orbit.spaceLarge}`}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Wrapper.defaultProps = { - theme: defaultTheme, -}; - -type Props = {| - children: React.Node, - ...Globals, -|}; - -const AccordionSectionContent = ({ children, dataTest }: Props): React.Node => ( - {children} -); - -export default AccordionSectionContent; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.tsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.tsx new file mode 100644 index 0000000000..57664b919d --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionContent.tsx @@ -0,0 +1,23 @@ +import React from "react"; +import styled from "styled-components"; + +import defaultTheme from "../../../defaultTheme"; +import * as Common from "../../../common/types"; + +const StyledWrapper = styled.div` + padding: ${({ theme }) => `0 ${theme.orbit.spaceLarge} ${theme.orbit.spaceLarge}`}; +`; + +StyledWrapper.defaultProps = { + theme: defaultTheme, +}; + +interface Props extends Common.Globals { + children: React.ReactNode; +} + +const AccordionSectionContent = ({ children, dataTest }: Props) => ( + {children} +); + +export default AccordionSectionContent; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.jsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.jsx deleted file mode 100644 index b9f531672a..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.jsx +++ /dev/null @@ -1,32 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import defaultTheme from "../../../defaultTheme"; -import type { Globals } from "../../../common/common.js.flow"; - -const Wrapper = styled.div` - display: flex; - padding: ${({ theme }) => theme.orbit.spaceLarge}; - background-color: ${({ theme }) => theme.orbit.paletteWhite}; - position: sticky; - bottom: 0; - box-sizing: border-box; - box-shadow: ${({ theme }) => theme.orbit.boxShadowActionActive}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Wrapper.defaultProps = { - theme: defaultTheme, -}; - -type Props = {| - children: React.Node, - ...Globals, -|}; - -const AccordionSectionFooter = ({ children, dataTest }: Props): React.Node => ( - {children} -); - -export default AccordionSectionFooter; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.tsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.tsx new file mode 100644 index 0000000000..96505f6aff --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionFooter.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import styled from "styled-components"; + +import defaultTheme from "../../../defaultTheme"; +import * as Common from "../../../common/types"; + +const StyledWrapper = styled.div` + display: flex; + padding: ${({ theme }) => theme.orbit.spaceLarge}; + background-color: ${({ theme }) => theme.orbit.paletteWhite}; + position: sticky; + bottom: 0; + box-sizing: border-box; + box-shadow: ${({ theme }) => theme.orbit.boxShadowActionActive}; +`; + +StyledWrapper.defaultProps = { + theme: defaultTheme, +}; + +interface Props extends Common.Globals { + children: React.ReactNode; +} + +const AccordionSectionFooter = ({ children, dataTest }: Props) => ( + {children} +); + +export default AccordionSectionFooter; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.jsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.jsx deleted file mode 100644 index fa18245927..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.jsx +++ /dev/null @@ -1,72 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import Button from "../../../Button"; -import defaultTheme from "../../../defaultTheme"; -import transition from "../../../utils/transition"; -import type { Globals } from "../../../common/common.js.flow"; - -const Wrapper = styled.div` - display: flex; - padding: ${({ theme, noPadding }) => !noPadding && theme.orbit.spaceLarge}; - background-color: ${({ theme }) => theme.orbit.paletteWhite}; - align-items: center; - min-height: ${({ expanded }) => (expanded ? "19px" : "44px")}; - transition: ${transition(["min-height"], "fast", "ease-in-out")}; -`; - -const HeaderContent = styled.div` - display: flex; - flex-grow: 1; - align-items: center; -`; - -const HeaderActions = styled.div` - display: flex; - margin-left: ${({ theme }) => theme.orbit.spaceLarge}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Wrapper.defaultProps = { - theme: defaultTheme, -}; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -HeaderActions.defaultProps = { - theme: defaultTheme, -}; - -type Props = {| - children: React.Node, - expanded: boolean, - expandable: boolean, - onExpand?: () => void | Promise, - actions?: React.Node, - ...Globals, -|}; - -const AccordionSectionHeader = ({ - children, - actions, - expanded, - onExpand, - expandable, - dataTest, -}: Props): React.Node => ( - - {children} - {!expanded && ( - - {expandable && - (actions || ( - - ))} - - )} - -); - -export default AccordionSectionHeader; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.tsx b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.tsx new file mode 100644 index 0000000000..fcd5d99f39 --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionSection/components/SectionHeader.tsx @@ -0,0 +1,72 @@ +import React from "react"; +import styled, { css } from "styled-components"; + +import Button from "../../../Button"; +import * as Common from "../../../common/types"; +import defaultTheme from "../../../defaultTheme"; + +const StyledWrapper = styled.div<{ + expanded: boolean; + "data-test"?: string | boolean; +}>` + ${({ theme, expanded }) => css` + display: flex; + padding: ${theme.orbit.spaceLarge}; + background-color: ${theme.orbit.paletteWhite}; + align-items: center; + min-height: ${expanded ? "19px" : "44px"}; + transition: max-height ${theme.orbit.durationFast} ease-in-out; + `}; +`; + +StyledWrapper.defaultProps = { + theme: defaultTheme, +}; + +const HeaderContent = styled.div` + display: flex; + flex-grow: 1; + align-items: center; +`; + +const HeaderActions = styled.div` + display: flex; + margin-left: ${({ theme }) => theme.orbit.spaceLarge}; +`; + +HeaderActions.defaultProps = { + theme: defaultTheme, +}; + +interface Props extends Common.Globals { + readonly children: React.ReactNode; + readonly expanded: boolean; + readonly expandable: boolean; + readonly onExpand?: Common.Callback; + readonly actions?: React.ReactNode; +} + +const AccordionSectionHeader = ({ + children, + actions, + expanded, + onExpand, + expandable, + dataTest, +}: Props) => ( + + {children} + {!expanded && ( + + {expandable && + (actions || ( + + ))} + + )} + +); + +export default AccordionSectionHeader; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/index.d.ts b/packages/orbit-components/src/Accordion/AccordionSection/index.d.ts deleted file mode 100644 index 7352d469d6..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionSection/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../../common/common"; - -export interface Props extends Common.Global { - readonly children?: React.ReactNode; - readonly actions?: React.ReactNode; - readonly expanded?: boolean; - readonly expandable?: boolean; - readonly onExpand?: Common.Callback; - readonly header?: React.ReactNode; - readonly footer?: React.ReactNode; -} - -declare const AccordionSection: React.FunctionComponent; -export { AccordionSection, AccordionSection as default }; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/index.jsx.flow b/packages/orbit-components/src/Accordion/AccordionSection/index.js.flow similarity index 100% rename from packages/orbit-components/src/Accordion/AccordionSection/index.jsx.flow rename to packages/orbit-components/src/Accordion/AccordionSection/index.js.flow diff --git a/packages/orbit-components/src/Accordion/AccordionSection/index.jsx b/packages/orbit-components/src/Accordion/AccordionSection/index.jsx deleted file mode 100644 index 3127446bb2..0000000000 --- a/packages/orbit-components/src/Accordion/AccordionSection/index.jsx +++ /dev/null @@ -1,57 +0,0 @@ -// @flow -import * as React from "react"; - -import { useAccordion } from "../AccordionContext"; -import useRandomId from "../../hooks/useRandomId"; -import useBoundingRect from "../../hooks/useBoundingRect"; -import Slide from "../../utils/Slide"; -import Loading from "../../Loading"; -import AccordionWrapper from "../components/AccordionWrapper"; -import SectionHeader from "./components/SectionHeader"; -import SectionFooter from "./components/SectionFooter"; -import SectionContent from "./components/SectionContent"; - -import type { Props } from "."; - -const AccordionSection = ({ - children, - header, - footer, - actions, - dataTest, - expandable = true, -}: Props): React.Node => { - const { expanded, onExpand, loading } = useAccordion(); - - const slideId = useRandomId(); - const isExpanded = expandable && expanded; - - const [{ height }, ref] = useBoundingRect({ height: isExpanded ? null : 0 }); - - return ( - - - {header && ( - - {header} - - )} - - -
- {children && {children}} - {footer && {footer}} -
- - - - ); -}; - -export default AccordionSection; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/index.tsx b/packages/orbit-components/src/Accordion/AccordionSection/index.tsx new file mode 100644 index 0000000000..a2a5389d9f --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionSection/index.tsx @@ -0,0 +1,55 @@ +import React from "react"; + +import { useAccordion } from "../AccordionContext"; +import useRandomId from "../../hooks/useRandomId"; +import useBoundingRect from "../../hooks/useBoundingRect"; +import Slide from "../../utils/Slide"; +import Loading from "../../Loading"; +import AccordionWrapper from "../components/AccordionWrapper"; +import SectionHeader from "./components/SectionHeader"; +import SectionFooter from "./components/SectionFooter"; +import SectionContent from "./components/SectionContent"; +import { Props } from "./types"; + +const AccordionSection = ({ + children, + header, + footer, + actions, + dataTest, + expandable = true, +}: Props) => { + const { expanded, onExpand, loading } = useAccordion(); + + const slideId = useRandomId(); + const isExpanded = expandable && expanded; + + const [{ height }, ref] = useBoundingRect({ height: isExpanded ? null : 0 }); + + return ( + + + {header && ( + + {header} + + )} + + +
+ {children && {children}} + {footer && {footer}} +
+
+
+
+ ); +}; + +export default AccordionSection; diff --git a/packages/orbit-components/src/Accordion/AccordionSection/types.ts b/packages/orbit-components/src/Accordion/AccordionSection/types.ts new file mode 100644 index 0000000000..37c7cbccea --- /dev/null +++ b/packages/orbit-components/src/Accordion/AccordionSection/types.ts @@ -0,0 +1,16 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import React from "react"; + +import * as Common from "../../common/types"; + +export interface Props extends Common.Globals { + readonly children?: React.ReactNode; + readonly actions?: React.ReactNode; + readonly expanded?: boolean; + readonly expandable?: boolean; + readonly onExpand?: Common.Callback; + readonly header?: React.ReactNode; + readonly footer?: React.ReactNode; +} diff --git a/packages/orbit-components/src/Accordion/__tests__/index.test.jsx b/packages/orbit-components/src/Accordion/__tests__/index.test.jsx deleted file mode 100644 index f66a2ce767..0000000000 --- a/packages/orbit-components/src/Accordion/__tests__/index.test.jsx +++ /dev/null @@ -1,55 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import Accordion, { AccordionSection } from ".."; - -describe(`Accordion`, () => { - const expandedSection = "0X1"; - const dataTest = "Accordion"; - const sectionDataTest = "AccordionSection"; - const onExpand = jest.fn(); - - it("should have passed props", () => { - render( - - - Section - - , - ); - - expect(screen.getByTestId(dataTest)).toBeInTheDocument(); - expect(screen.getByTestId(sectionDataTest)).toBeInTheDocument(); - }); - - it("should render loading", () => { - render( - - - , - ); - - expect(screen.getByTestId(`${sectionDataTest}Loading`)).toBeInTheDocument(); - }); - - describe(`AccordionSection`, () => { - it("should render passed components", () => { - render( - - Section - , - ); - - expect(screen.getByTestId(`${sectionDataTest}Header`)).toBeInTheDocument(); - expect(screen.getByTestId(`${sectionDataTest}Content`)).toBeInTheDocument(); - expect(screen.getByTestId(`${sectionDataTest}Footer`)).toBeInTheDocument(); - }); - }); -}); diff --git a/packages/orbit-components/src/Accordion/__tests__/index.test.tsx b/packages/orbit-components/src/Accordion/__tests__/index.test.tsx new file mode 100644 index 0000000000..3aeda179b1 --- /dev/null +++ b/packages/orbit-components/src/Accordion/__tests__/index.test.tsx @@ -0,0 +1,54 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; + +import Accordion, { AccordionSection } from ".."; + +describe(`Accordion`, () => { + const expandedSection = "0X1"; + const dataTest = "Accordion"; + const sectionDataTest = "AccordionSection"; + const onExpand = jest.fn(); + + it("should have passed props", () => { + render( + + + Section + + , + ); + + expect(screen.getByTestId(dataTest)).toBeInTheDocument(); + expect(screen.getByTestId(sectionDataTest)).toBeInTheDocument(); + }); + + it("should render loading", () => { + render( + + + , + ); + + expect(screen.getByTestId(`${sectionDataTest}Loading`)).toBeInTheDocument(); + }); + + describe(`AccordionSection`, () => { + it("should render passed components", () => { + render( + + Section + , + ); + + expect(screen.getByTestId(`${sectionDataTest}Header`)).toBeInTheDocument(); + expect(screen.getByTestId(`${sectionDataTest}Content`)).toBeInTheDocument(); + expect(screen.getByTestId(`${sectionDataTest}Footer`)).toBeInTheDocument(); + }); + }); +}); diff --git a/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.jsx.flow b/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.js.flow similarity index 100% rename from packages/orbit-components/src/Accordion/components/AccordionWrapper/index.jsx.flow rename to packages/orbit-components/src/Accordion/components/AccordionWrapper/index.js.flow diff --git a/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.jsx b/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.jsx deleted file mode 100644 index ef6f280d38..0000000000 --- a/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.jsx +++ /dev/null @@ -1,33 +0,0 @@ -// @flow -import styled from "styled-components"; -import * as React from "react"; - -import transition from "../../../utils/transition"; -import { CardElement } from "../../../Card/helpers/mixins"; -import defaultTheme from "../../../defaultTheme"; -import { getBorder, getBorderRadius } from "../../../Card/helpers/borders"; - -import type { Props } from "."; - -const StyledAccordionWrapper = styled.div` - ${CardElement}; - border: ${getBorder}; - border-radius: ${getBorderRadius}; - transition: ${transition(["margin"], "fast", "ease-in-out")}; - margin: ${({ theme }) => theme.orbit.spaceXSmall} 0; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledAccordionWrapper.defaultProps = { - theme: defaultTheme, -}; - -const AccordionWrapper = ({ dataTest, initialExpanded, ...props }: Props): React.Node => ( - -); - -export default AccordionWrapper; diff --git a/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.tsx b/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.tsx new file mode 100644 index 0000000000..6c68b43717 --- /dev/null +++ b/packages/orbit-components/src/Accordion/components/AccordionWrapper/index.tsx @@ -0,0 +1,29 @@ +import styled from "styled-components"; +import React from "react"; + +import { CardElement } from "../../../Card/helpers/mixins"; +import { getBorder, getBorderRadius } from "../../../Card/helpers/borders"; +import { Props } from "./types"; +import defaultTheme from "../../../defaultTheme"; + +const StyledAccordionWrapper = styled.div<{ expanded?: boolean }>` + ${CardElement}; + border: ${getBorder}; + border-radius: ${getBorderRadius}; + transition: margin ${({ theme }) => theme.orbit.durationFast} ease-in-out; + margin: ${({ theme }) => theme.orbit.spaceXSmall} 0; +`; + +StyledAccordionWrapper.defaultProps = { + theme: defaultTheme, +}; + +const AccordionWrapper = ({ dataTest, initialExpanded, ...props }: Props) => ( + +); + +export default AccordionWrapper; diff --git a/packages/orbit-components/src/Accordion/components/AccordionWrapper/types.ts b/packages/orbit-components/src/Accordion/components/AccordionWrapper/types.ts new file mode 100644 index 0000000000..0b169931fb --- /dev/null +++ b/packages/orbit-components/src/Accordion/components/AccordionWrapper/types.ts @@ -0,0 +1,14 @@ +import React from "react"; + +export interface Props { + readonly children: React.ReactNode; + readonly bottomBorder?: boolean; + readonly roundedBottom?: boolean; + readonly roundedTop?: boolean; + readonly expanded?: boolean; + readonly noPadding?: boolean; + readonly dataTest?: string; + readonly noBorderTop?: boolean; + readonly expandable?: boolean; + readonly initialExpanded?: boolean; +} diff --git a/packages/orbit-components/src/Accordion/index.d.ts b/packages/orbit-components/src/Accordion/index.d.ts deleted file mode 100644 index ada3ceb074..0000000000 --- a/packages/orbit-components/src/Accordion/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import AccordionSection from "./AccordionSection"; -import * as Common from "../common/common"; - -/* - DOCS: - To implement Accordion component into your project you'll need to the import the Accordion and the [AccordionSection](#Accordionsection): - ```jsx - import Accordion, { AccordionSection } from "@kiwicom/orbit-components/lib/Accordion"; - ``` - - After adding import into your project you can use it simply like: - - ```jsx - - Hello World! - - ``` -*/ - -export interface Props extends Common.Global, Common.SpaceAfter { - /** The content of the Accordion. You can use only AccordionSection */ - readonly children?: React.ReactNode; - /** Optional prop to control which AccordionSection (by id) is expanded */ - readonly expandedSection?: string | number; - /** If true it will render the Loading component */ - readonly loading?: boolean; - /** Callback (along with sectionId) that is triggered when section is expanding */ - readonly onExpand?: (sectionId: string | number) => void | Promise; -} - -declare const Accordion: React.FunctionComponent; -declare const StyledAccordion: React.ComponentType; -export { Accordion, Accordion as default, AccordionSection, StyledAccordion }; diff --git a/packages/orbit-components/src/Accordion/index.js.flow b/packages/orbit-components/src/Accordion/index.js.flow new file mode 100644 index 0000000000..a3aac98a35 --- /dev/null +++ b/packages/orbit-components/src/Accordion/index.js.flow @@ -0,0 +1,22 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/card/ +*/ +import * as React from "react"; + +import type { spaceAfter } from "../common/getSpacingToken/index.js.flow"; +import type { Globals } from "../common/common.js.flow"; +import typeof AccordionSectionType from "./AccordionSection/index.js.flow"; + +export type Props = {| + +children?: React.Node, + +expandedSection?: string | number, + +onExpand?: (sectionId: string | number) => void | Promise, + +loading?: boolean, + ...Globals, + ...spaceAfter, +|}; + +declare export default React.ComponentType; +declare export var AccordionSection: AccordionSectionType; +declare export var StyledAccordion: React.ComponentType; diff --git a/packages/orbit-components/src/Accordion/index.jsx b/packages/orbit-components/src/Accordion/index.jsx deleted file mode 100644 index 96f3b48d5d..0000000000 --- a/packages/orbit-components/src/Accordion/index.jsx +++ /dev/null @@ -1,56 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import defaultTheme from "../defaultTheme"; -import { Provider as SectionProvider } from "./AccordionContext"; -import getSpacingToken from "../common/getSpacingToken"; - -import type { Props } from "."; - -export const StyledAccordion: any = styled.div` - width: 100%; - box-sizing: border-box; - position: relative; - font-family: ${({ theme }) => theme.orbit.fontFamily}; - margin-bottom: ${getSpacingToken}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledAccordion.defaultProps = { - theme: defaultTheme, -}; - -const Accordion = ({ - children, - dataTest, - id, - spaceAfter, - expandedSection, - loading, - onExpand, -}: Props): React.Node => ( - - {children - ? React.Children.map(children, item => { - if (!item) return null; - - const { id: innerId } = item.props; - // Determine if section is expanded - const isExpanded = expandedSection === innerId; - // Callback with section id - // onExpand is not required prop to have easier loading use case - const handleExpand = () => onExpand && onExpand(innerId); - - return ( - - {item} - - ); - }) - : null} - -); - -export default Accordion; -export { default as AccordionSection } from "./AccordionSection"; diff --git a/packages/orbit-components/src/Accordion/index.jsx.flow b/packages/orbit-components/src/Accordion/index.jsx.flow deleted file mode 100644 index d687f7d4b3..0000000000 --- a/packages/orbit-components/src/Accordion/index.jsx.flow +++ /dev/null @@ -1,22 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/card/ -*/ -import * as React from "react"; - -import type { spaceAfter } from "../common/getSpacingToken"; -import type { Globals } from "../common/common.js.flow"; -import typeof AccordionSectionType from "./AccordionSection"; - -export type Props = {| - +children?: React.Node, - +expandedSection?: string | number, - +onExpand?: (sectionId: string | number) => void | Promise, - +loading?: boolean, - ...Globals, - ...spaceAfter, -|}; - -declare export default React.ComponentType; -declare export var AccordionSection: AccordionSectionType; -declare export var StyledAccordion: React.ComponentType; diff --git a/packages/orbit-components/src/Accordion/index.tsx b/packages/orbit-components/src/Accordion/index.tsx new file mode 100644 index 0000000000..eb070a368c --- /dev/null +++ b/packages/orbit-components/src/Accordion/index.tsx @@ -0,0 +1,59 @@ +import React from "react"; +import styled, { css } from "styled-components"; + +import { Provider as SectionProvider } from "./AccordionContext"; +import getSpacingToken from "../common/getSpacingToken"; +import type { Props } from "./types"; +import * as Common from "../common/types"; +import defaultTheme from "../defaultTheme"; + +interface StyledProps extends Common.SpaceAfter {} + +export const StyledAccordion = styled.div` + ${({ theme }) => css` + width: 100%; + box-sizing: border-box; + position: relative; + font-family: ${theme.orbit.fontFamily}; + margin-bottom: ${getSpacingToken}; + `}; +`; + +StyledAccordion.defaultProps = { + theme: defaultTheme, +}; + +const Accordion = ({ + children, + dataTest, + id, + spaceAfter, + expandedSection, + loading, + onExpand, +}: Props) => ( + + {children + ? React.Children.map(children, item => { + if (!item) return null; + + // @ts-expect-error TODO + const { id: innerId } = item.props; + // Determine if section is expanded + const isExpanded = expandedSection === innerId; + // Callback with section id + // onExpand is not required prop to have easier loading use case + const handleExpand = () => onExpand && onExpand(innerId); + + return ( + + {item} + + ); + }) + : null} + +); + +export default Accordion; +export { default as AccordionSection } from "./AccordionSection"; diff --git a/packages/orbit-components/src/Accordion/types.ts b/packages/orbit-components/src/Accordion/types.ts new file mode 100644 index 0000000000..11886e2620 --- /dev/null +++ b/packages/orbit-components/src/Accordion/types.ts @@ -0,0 +1,33 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import React from "react"; + +import * as Common from "../common/types"; + +/* + DOCS: + To implement Accordion component into your project you'll need to the import the Accordion and the [AccordionSection](#Accordionsection): + ```jsx + import Accordion, { AccordionSection } from "@kiwicom/orbit-components/lib/Accordion"; + ``` + + After adding import into your project you can use it simply like: + + ```jsx + + Hello World! + + ``` +*/ + +export interface Props extends Common.Globals, Common.SpaceAfter { + /** The content of the Accordion. You can use only AccordionSection */ + readonly children?: React.ReactNode; + /** Optional prop to control which AccordionSection (by id) is expanded */ + readonly expandedSection?: string | number; + /** If true it will render the Loading component */ + readonly loading?: boolean; + /** Callback (along with sectionId) that is triggered when section is expanding */ + readonly onExpand?: (sectionId: string | number) => void | Promise; +} diff --git a/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.jsx b/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.jsx deleted file mode 100644 index 74784776d2..0000000000 --- a/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.jsx +++ /dev/null @@ -1,50 +0,0 @@ -// @flow - -import * as React from "react"; -import { select, text } from "@storybook/addon-knobs"; - -import { NAMES } from "./consts"; -import { SIZE_OPTIONS } from "../primitives/IllustrationPrimitive/consts"; -import SPACINGS_AFTER from "../common/getSpacingToken/consts"; -import IllustrationPrimitiveList from "../primitives/IllustrationPrimitive/IllustrationPrimitiveList"; - -import AirportIllustration from "."; - -export default { - title: "AirportIllustration", -}; - -export const Playground = (): React.Node => { - const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.MEDIUM); - const name = select("Name", Object.values(NAMES), "BGYFastTrack"); - const dataTest = text("dataTest", "test"); - const alt = text("alt", null); - const spaceAfter = select("spaceAfter", [null, ...Object.values(SPACINGS_AFTER)]); - return ( - - ); -}; - -Playground.story = { - parameters: { - info: "Explore our new set of Airportillustrations for Kiwi.com.", - }, -}; - -export const ListOfAllAirportIllustrations = (): React.Node => { - return ; -}; - -ListOfAllAirportIllustrations.story = { - name: "List of all AirportIllustrations", - - parameters: { - info: "Explore our new set of Airportillustrations for Kiwi.com.", - }, -}; diff --git a/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.tsx b/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.tsx new file mode 100644 index 0000000000..48798eab91 --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/AirportIllustration.stories.tsx @@ -0,0 +1,49 @@ +import React from "react"; +import { select, text } from "@storybook/addon-knobs"; + +// @ts-expect-error TODO +import { NAMES } from "./consts.mts"; +import { SIZE_OPTIONS } from "../primitives/IllustrationPrimitive/consts"; +import SPACINGS_AFTER from "../common/getSpacingToken/consts"; +import IllustrationPrimitiveList from "../primitives/IllustrationPrimitive/IllustrationPrimitiveList"; + +import AirportIllustration from "."; + +export default { + title: "AirportIllustration", +}; + +export const Playground = () => { + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.MEDIUM); + const name = select("Name", NAMES, "BGYFastTrack"); + const dataTest = text("dataTest", "test"); + const alt = text("alt", "null"); + const spaceAfter = select("spaceAfter", Object.values(SPACINGS_AFTER), SPACINGS_AFTER.SMALL); + return ( + + ); +}; + +Playground.story = { + parameters: { + info: "Explore our new set of Airportillustrations for Kiwi.com.", + }, +}; + +export const ListOfAllAirportIllustrations = () => { + return ; +}; + +ListOfAllAirportIllustrations.story = { + name: "List of all AirportIllustrations", + + parameters: { + info: "Explore our new set of Airportillustrations for Kiwi.com.", + }, +}; diff --git a/packages/orbit-components/src/AirportIllustration/FLOW_TEMPLATE.flow b/packages/orbit-components/src/AirportIllustration/FLOW_TEMPLATE.flow deleted file mode 100644 index 040fed0855..0000000000 --- a/packages/orbit-components/src/AirportIllustration/FLOW_TEMPLATE.flow +++ /dev/null @@ -1,19 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/illustration/ -*/ -import * as React from "react"; -import type { Globals } from "../common/common.js.flow"; -import type { spaceAfter } from "../common/getSpacingToken/index"; - -type Name =%NAMES% - -export type Props = {| - +size?: "extraSmall" | "small" | "medium" | "large" | "display", - +name: Name, - +alt?: string, - ...Globals, - ...spaceAfter, -|}; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/AirportIllustration/TYPESCRIPT_TEMPLATE.template b/packages/orbit-components/src/AirportIllustration/TYPESCRIPT_TEMPLATE.template index cff7ce59c7..006816fdd6 100644 --- a/packages/orbit-components/src/AirportIllustration/TYPESCRIPT_TEMPLATE.template +++ b/packages/orbit-components/src/AirportIllustration/TYPESCRIPT_TEMPLATE.template @@ -1,14 +1,13 @@ -// @flow /* DOCUMENTATION: https://orbit.kiwi/components/airportillustration/ */ import * as React from "react"; -import * as Common from "../common/common"; +import * as Common from "../common/types"; type Name =%NAMES% -export interface Props extends Common.Global, Common.SpaceAfter { +export interface Props extends Common.Globals, Common.SpaceAfter { readonly size?: "extraSmall" | "small" | "medium" | "large" | "display"; readonly name: Name; readonly alt?: string; diff --git a/packages/orbit-components/src/AirportIllustration/__tests__/index.test.jsx b/packages/orbit-components/src/AirportIllustration/__tests__/index.test.jsx deleted file mode 100644 index ce0e8f74e2..0000000000 --- a/packages/orbit-components/src/AirportIllustration/__tests__/index.test.jsx +++ /dev/null @@ -1,45 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import AirportIllustration from ".."; -import { SIZE_OPTIONS } from "../../primitives/IllustrationPrimitive/consts"; -import SPACINGS_AFTER from "../../common/getSpacingToken/consts"; -import defaultTheme from "../../defaultTheme"; - -const name = "BGYFastTrack"; -const dataTest = "test"; - -describe(`AirportIllustration of ${name}`, () => { - beforeEach(() => { - render( - , - ); - }); - - it("should have passed props", () => { - expect(screen.getByRole("img")).toHaveAttribute("alt", name); - expect(screen.getByRole("img")).toHaveAttribute("data-test", dataTest); - }); - - it("should render proper image", () => { - expect(screen.getByRole("img").getAttribute("src")).toMatchInlineSnapshot( - `"//images.kiwi.com/illustrations/0x90/BGYFastTrack-Q85.png"`, - ); - expect(screen.getByRole("img").getAttribute("srcset")).toMatchInlineSnapshot( - `"//images.kiwi.com/illustrations/0x180/BGYFastTrack-Q85.png 2x, //images.kiwi.com/illustrations/0x270/BGYFastTrack-Q85.png 3x"`, - ); - }); - - it("should have margin-bottom", () => { - expect(getComputedStyle(screen.getByRole("img"))).toHaveProperty( - "margin-bottom", - defaultTheme.orbit.spaceSmall, - ); - }); -}); diff --git a/packages/orbit-components/src/AirportIllustration/__tests__/index.test.tsx b/packages/orbit-components/src/AirportIllustration/__tests__/index.test.tsx new file mode 100644 index 0000000000..40ddaa5e0c --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/__tests__/index.test.tsx @@ -0,0 +1,44 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; + +import AirportIllustration from ".."; +import { SIZE_OPTIONS } from "../../primitives/IllustrationPrimitive/consts"; +import SPACINGS_AFTER from "../../common/getSpacingToken/consts"; +import defaultTheme from "../../defaultTheme"; + +const name = "BGYFastTrack"; +const dataTest = "test"; + +describe(`AirportIllustration of ${name}`, () => { + beforeEach(() => { + render( + , + ); + }); + + it("should have passed props", () => { + expect(screen.getByRole("img")).toHaveAttribute("alt", name); + expect(screen.getByRole("img")).toHaveAttribute("data-test", dataTest); + }); + + it("should render proper image", () => { + expect(screen.getByRole("img").getAttribute("src")).toMatchInlineSnapshot( + `"//images.kiwi.com/illustrations/0x90/BGYFastTrack-Q85.png"`, + ); + expect(screen.getByRole("img").getAttribute("srcset")).toMatchInlineSnapshot( + `"//images.kiwi.com/illustrations/0x180/BGYFastTrack-Q85.png 2x, //images.kiwi.com/illustrations/0x270/BGYFastTrack-Q85.png 3x"`, + ); + }); + + it("should have margin-bottom", () => { + expect(getComputedStyle(screen.getByRole("img"))).toHaveProperty( + "margin-bottom", + defaultTheme.orbit.spaceSmall, + ); + }); +}); diff --git a/packages/orbit-components/src/AirportIllustration/consts.js b/packages/orbit-components/src/AirportIllustration/consts.js deleted file mode 100644 index 091af9ed28..0000000000 --- a/packages/orbit-components/src/AirportIllustration/consts.js +++ /dev/null @@ -1,10 +0,0 @@ -// @flow - -export const NAMES = [ - "BGYFastTrack", - "BUDFastTrack", - "MRSSmartPass", - "NCEFastTrack", - "PRGSmartPass", - "VCESmartPass", -]; diff --git a/packages/orbit-components/src/AirportIllustration/consts.mts b/packages/orbit-components/src/AirportIllustration/consts.mts new file mode 100644 index 0000000000..4bd6f45bb1 --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/consts.mts @@ -0,0 +1,8 @@ +export const NAMES = [ + "BGYFastTrack", + "BUDFastTrack", + "MRSSmartPass", + "NCEFastTrack", + "PRGSmartPass", + "VCESmartPass", +]; diff --git a/packages/orbit-components/src/AirportIllustration/index.js.flow b/packages/orbit-components/src/AirportIllustration/index.js.flow new file mode 100644 index 0000000000..a6b02f6849 --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/index.js.flow @@ -0,0 +1,26 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/illustration/ +*/ +import * as React from "react"; + +import type { Globals } from "../common/common.js.flow"; +import type { spaceAfter } from "../common/getSpacingToken/index.js.flow"; + +type Name = + | "BGYFastTrack" + | "BUDFastTrack" + | "MRSSmartPass" + | "NCEFastTrack" + | "PRGSmartPass" + | "VCESmartPass"; + +export type Props = {| + +size?: "extraSmall" | "small" | "medium" | "large" | "display", + +name: Name, + +alt?: string, + ...Globals, + ...spaceAfter, +|}; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/AirportIllustration/index.jsx b/packages/orbit-components/src/AirportIllustration/index.jsx deleted file mode 100644 index 8bfad640bc..0000000000 --- a/packages/orbit-components/src/AirportIllustration/index.jsx +++ /dev/null @@ -1,13 +0,0 @@ -// @flow -import * as React from "react"; - -import { SIZE_OPTIONS } from "../primitives/IllustrationPrimitive/consts"; -import IllustrationPrimitive from "../primitives/IllustrationPrimitive"; - -import type { Props } from "."; - -const AirportIllustration = ({ size = SIZE_OPTIONS.MEDIUM, ...props }: Props): React.Node => ( - -); - -export default AirportIllustration; diff --git a/packages/orbit-components/src/AirportIllustration/index.tsx b/packages/orbit-components/src/AirportIllustration/index.tsx new file mode 100644 index 0000000000..c6ff7c618e --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/index.tsx @@ -0,0 +1,11 @@ +import React from "react"; + +import { Props } from "./types"; +import { SIZE_OPTIONS } from "../primitives/IllustrationPrimitive/consts"; +import IllustrationPrimitive from "../primitives/IllustrationPrimitive"; + +const AirportIllustration = ({ size = SIZE_OPTIONS.MEDIUM, ...props }: Props) => ( + +); + +export default AirportIllustration; diff --git a/packages/orbit-components/src/AirportIllustration/types.ts b/packages/orbit-components/src/AirportIllustration/types.ts new file mode 100644 index 0000000000..891118250c --- /dev/null +++ b/packages/orbit-components/src/AirportIllustration/types.ts @@ -0,0 +1,23 @@ +/* + DOCUMENTATION: https://orbit.kiwi/components/airportillustration/ +*/ +import * as React from "react"; + +import * as Common from "../common/types"; + +type Name = + | "BGYFastTrack" + | "BUDFastTrack" + | "MRSSmartPass" + | "NCEFastTrack" + | "PRGSmartPass" + | "VCESmartPass"; + +export interface Props extends Common.Globals, Common.SpaceAfter { + readonly size?: "extraSmall" | "small" | "medium" | "large" | "display"; + readonly name: Name; + readonly alt?: string; +} + +declare const AirportIllustration: React.FunctionComponent; +export { AirportIllustration, AirportIllustration as default }; diff --git a/packages/orbit-components/src/Alert/Alert.stories.jsx b/packages/orbit-components/src/Alert/Alert.stories.jsx deleted file mode 100644 index 2f321db5bb..0000000000 --- a/packages/orbit-components/src/Alert/Alert.stories.jsx +++ /dev/null @@ -1,257 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, boolean, select } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import { TYPE_OPTIONS } from "./consts"; -import { TYPE_OPTIONS as BUTTON_TYPE_OPTIONS } from "./AlertButton/consts"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; -import SPACINGS_AFTER from "../common/getSpacingToken/consts"; -import List from "../List"; -import ListItem from "../List/ListItem"; -import Text from "../Text"; -import Stack from "../Stack"; -import Heading from "../Heading"; -import CountryFlag from "../CountryFlag"; - -import Alert, { AlertButton } from "."; - -const getIcons = defaultIcon => select("Icon", [null, ...Object.keys(Icons)], defaultIcon); -const getIcon = source => Icons[source]; - -export default { - title: "Alert", -}; - -export const Default = (): React.Node => { - const message = "The quick, brown fox jumps over a lazy dog."; - return ; -}; - -Default.story = { - parameters: { - info: - "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Content = (): React.Node => { - const message = "The quick, brown fox jumps over a lazy dog."; - return {message}; -}; - -export const Button = (): React.Node => { - const type = select("type", Object.values(BUTTON_TYPE_OPTIONS), BUTTON_TYPE_OPTIONS.INFO); - - return AlertButton; -}; - -export const InfoAlert = (): React.Node => { - const title = text("Title", "Some additional information"); - const message = text("Message", "The quick, brown fox jumps over a lazy dog."); - return ( - - {message} - - ); -}; - -InfoAlert.story = { - name: "Info alert", - - parameters: { - info: - "Use when you need to inform users about something that is happening in their booking or a trip. If the issue is potentially dangerous, consider using warning alert. Keep in mind that warning alert can stress users more than the informational one. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SuccessAlert = (): React.Node => { - const title = text("Title", "You did it!"); - const message = text("Message", "The quick, brown fox jumps over a lazy dog."); - return ( - - {message} - - ); -}; - -SuccessAlert.story = { - name: "Success alert", - - parameters: { - info: - "Use when a user just performed some action and we need to tell them that action was successful. This button is usually used without an action button.Avoid using success banner if there is any follow-up action, for example, in cases where we need to confirm something to users by e-mail later. It's recommended to use informational alert instead. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const WarningAlert = (): React.Node => { - const title = text("Title", "Be careful!"); - const message = text("Message", "The quick, brown fox jumps over a lazy dog."); - return ( - - {message} - - ); -}; - -WarningAlert.story = { - name: "Warning alert", - - parameters: { - info: - "Use in cases when you need to inform users about a potentially dangerous situation in their trip and it requires some action from them. However, if the issue requires immediate attention, use critical alert instead. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CriticalAlert = (): React.Node => { - const title = text("Title", "Something has gone horribly wrong"); - const message = text("Message", "The quick, brown fox jumps over a lazy dog."); - return ( - - {message} - - ); -}; - -CriticalAlert.story = { - name: "Critical alert", - - parameters: { - info: - "Use when something is blocking users from continuing or when some issue needs to be resolved immediately. A critical alert should provide some form of solution for their problem. If something is important for users to solve as soon as possible, automatic open of a modal window is worthy of considering. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const OnlyTitle = (): React.Node => { - const title = text("Title", "The quick, brown fox jumps over a lazy dog."); - return ; -}; - -OnlyTitle.story = { - name: "Only title", - - parameters: { - info: - "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const InlineActions = (): React.Node => { - const type = select("Type", Object.values(TYPE_OPTIONS), "info"); - const title = text("Title", "You can change the title by changing the Title knob"); - const button = text("Button", "I am a link"); - const closable = boolean("Closable", false); - const Icon = getIcon(getIcons("Airplane")); - - return ( - } - title={title} - closable={closable} - onClose={action("Close")} - inlineActions={ - - {button} - - } - /> - ); -}; - -InlineActions.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Playground = (): React.Node => { - const type = select("Type", Object.values(TYPE_OPTIONS), "info"); - const title = text("Title", "You can change the title by changing the Title knob"); - const message = text("Message", "Also you can change the message by changing the Message knob"); - const dataTest = text("dataTest", "test"); - const button = text("Button", "I am a link"); - const closable = boolean("Closable", false); - const Icon = getIcon(getIcons("Airplane")); - const spaceAfter = select("spaceAfter", [null, ...Object.values(SPACINGS_AFTER)]); - const suppressed = boolean("suppressed", false); - - return ( - } - title={title} - suppressed={suppressed} - closable={closable} - onClose={action("Close")} - dataTest={dataTest} - spaceAfter={spaceAfter} - > - - -
{message}
- - - 623 Kč will be refunded by your payment card - - 623 Kč will be refunded by your payment card - -
- - - {button} - - {/* $FlowExpectedError */} - - {button} - - -
-
- ); -}; - -Playground.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Rtl = (): React.Node => ( - - } - title="The title of the Alert" - closable - onClose={action("Close")} - > - - - - Requirements found here are for reference purposes only. Contact the embassy or your - foreign ministry for more information. - - - Make sure you know your visa requirements for these countries: - - - }>Poland - - - Check Visa Requirements - - - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/Alert/Alert.stories.tsx b/packages/orbit-components/src/Alert/Alert.stories.tsx new file mode 100644 index 0000000000..6f5aa9f4ab --- /dev/null +++ b/packages/orbit-components/src/Alert/Alert.stories.tsx @@ -0,0 +1,260 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, boolean, select } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import { TYPE_OPTIONS } from "./consts"; +import { TYPE_OPTIONS as BUTTON_TYPE_OPTIONS } from "./AlertButton/consts"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import SPACINGS_AFTER from "../common/getSpacingToken/consts"; +import List from "../List"; +import ListItem from "../List/ListItem"; +import Text from "../Text"; +import Stack from "../Stack"; +import Heading from "../Heading"; +import CountryFlag from "../CountryFlag"; + +import Alert, { AlertButton } from "."; + +const getIcons = (defaultIcon: string) => select("Icon", ["", ...Object.keys(Icons)], defaultIcon); + +const getIcon = (source: string): React.ReactNode => Icons[source]; + +export default { + title: "Alert", +}; + +export const Default = () => { + const message = "The quick, brown fox jumps over a lazy dog."; + return ; +}; + +Default.story = { + parameters: { + info: + "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Content = () => { + const message = "The quick, brown fox jumps over a lazy dog."; + return {message}; +}; + +export const Button = () => { + const type = select("type", Object.values(BUTTON_TYPE_OPTIONS), BUTTON_TYPE_OPTIONS.INFO); + + return AlertButton; +}; + +export const InfoAlert = () => { + const title = text("Title", "Some additional information"); + const message = text("Message", "The quick, brown fox jumps over a lazy dog."); + return ( + + {message} + + ); +}; + +InfoAlert.story = { + name: "Info alert", + + parameters: { + info: + "Use when you need to inform users about something that is happening in their booking or a trip. If the issue is potentially dangerous, consider using warning alert. Keep in mind that warning alert can stress users more than the informational one. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SuccessAlert = () => { + const title = text("Title", "You did it!"); + const message = text("Message", "The quick, brown fox jumps over a lazy dog."); + return ( + + {message} + + ); +}; + +SuccessAlert.story = { + name: "Success alert", + + parameters: { + info: + "Use when a user just performed some action and we need to tell them that action was successful. This button is usually used without an action button.Avoid using success banner if there is any follow-up action, for example, in cases where we need to confirm something to users by e-mail later. It's recommended to use informational alert instead. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const WarningAlert = () => { + const title = text("Title", "Be careful!"); + const message = text("Message", "The quick, brown fox jumps over a lazy dog."); + return ( + + {message} + + ); +}; + +WarningAlert.story = { + name: "Warning alert", + + parameters: { + info: + "Use in cases when you need to inform users about a potentially dangerous situation in their trip and it requires some action from them. However, if the issue requires immediate attention, use critical alert instead. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CriticalAlert = () => { + const title = text("Title", "Something has gone horribly wrong"); + const message = text("Message", "The quick, brown fox jumps over a lazy dog."); + return ( + + {message} + + ); +}; + +CriticalAlert.story = { + name: "Critical alert", + + parameters: { + info: + "Use when something is blocking users from continuing or when some issue needs to be resolved immediately. A critical alert should provide some form of solution for their problem. If something is important for users to solve as soon as possible, automatic open of a modal window is worthy of considering. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const OnlyTitle = () => { + const title = text("Title", "The quick, brown fox jumps over a lazy dog."); + return ; +}; + +OnlyTitle.story = { + name: "Only title", + + parameters: { + info: + "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const InlineActions = () => { + const type = select("Type", Object.values(TYPE_OPTIONS), "info"); + const title = text("Title", "You can change the title by changing the Title knob"); + const button = text("Button", "I am a link"); + const closable = boolean("Closable", false); + const Icon = getIcon(getIcons("Airplane")); + + return ( + + {button} + + } + /> + ); +}; + +InlineActions.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Playground = () => { + const type = select("Type", Object.values(TYPE_OPTIONS), "info"); + const title = text("Title", "You can change the title by changing the Title knob"); + const message = text("Message", "Also you can change the message by changing the Message knob"); + const dataTest = text("dataTest", "test"); + const button = text("Button", "I am a link"); + const closable = boolean("Closable", false); + const Icon = getIcon(getIcons("Airplane")); + const spaceAfter = select("spaceAfter", Object.values(SPACINGS_AFTER), SPACINGS_AFTER.SMALL); + const suppressed = boolean("suppressed", false); + + return ( + + + +
{message}
+ + + 623 Kč will be refunded by your payment card + + 623 Kč will be refunded by your payment card + +
+ + + {button} + + + {button} + + +
+
+ ); +}; + +Playground.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Rtl = () => { + const Icon = getIcon(getIcons("Airplane")); + + return ( + + + + + + Requirements found here are for reference purposes only. Contact the embassy or your + foreign ministry for more information. + + + Make sure you know your visa requirements for these countries: + + + }>Poland + + + Check Visa Requirements + + + + ); +}; + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/Alert/AlertButton/consts.js b/packages/orbit-components/src/Alert/AlertButton/consts.js deleted file mode 100644 index 3e250adad9..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/consts.js +++ /dev/null @@ -1,21 +0,0 @@ -// @flow -export const TYPE_OPTIONS = { - INFO: "info", - SUCCESS: "success", - WARNING: "warning", - CRITICAL: "critical", - INFO_SUBTLE: "infoSubtle", - SUCCESS_SUBTLE: "successSubtle", - WARNING_SUBTLE: "warningSubtle", - CRITICAL_SUBTLE: "criticalSubtle", - SECONDARY: "secondary", -}; - -export const TOKENS = { - backgroundButton: "backgroundButton", - backgroundButtonHover: "backgroundButtonHover", - backgroundButtonActive: "backgroundButtonActive", - backgroundButtonFocus: "backgroundButtonFocus", - colorTextButton: "colorTextButton", - borderColorButtonFocus: "borderColorButtonFocus", -}; diff --git a/packages/orbit-components/src/Alert/AlertButton/consts.ts b/packages/orbit-components/src/Alert/AlertButton/consts.ts new file mode 100644 index 0000000000..096cb540a7 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/consts.ts @@ -0,0 +1,20 @@ +export enum TYPE_OPTIONS { + INFO = "info", + SUCCESS = "success", + WARNING = "warning", + CRITICAL = "critical", + INFO_SUBTLE = "infoSubtle", + SUCCESS_SUBTLE = "successSubtle", + WARNING_SUBTLE = "warningSubtle", + CRITICAL_SUBTLE = "criticalSubtle", + SECONDARY = "secondary", +} + +export enum TOKENS { + backgroundButton = "backgroundButton", + backgroundButtonHover = "backgroundButtonHover", + backgroundButtonActive = "backgroundButtonActive", + backgroundButtonFocus = "backgroundButtonFocus", + colorTextButton = "colorTextButton", + borderColorButtonFocus = "borderColorButtonFocus", +} diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js deleted file mode 100644 index b6ace3edb3..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js +++ /dev/null @@ -1,34 +0,0 @@ -// @flow -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import { TOKENS, TYPE_OPTIONS } from "../consts"; -import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; -import getAlertButtonTypeToken from "./getAlertButtonTypeToken"; -import type { GetAlertButtonBoxShadow } from "./getAlertButtonBoxShadow"; - -const opacity = { - [TYPE_OPTIONS.INFO]: 15, - [TYPE_OPTIONS.SUCCESS]: 15, - [TYPE_OPTIONS.WARNING]: 15, - [TYPE_OPTIONS.CRITICAL]: 15, - [TYPE_OPTIONS.INFO_SUBTLE]: 8, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: 8, - [TYPE_OPTIONS.WARNING_SUBTLE]: 8, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: 8, -}; - -const getAlertButtonBoxShadow: GetAlertButtonBoxShadow = (state, disabled, theme, type) => { - const wrappedButtonTypeToken = name => getAlertButtonTypeToken(name, type, theme); - if (disabled) { - return null; - } - if (state === BUTTON_STATES.ACTIVE) { - return `inset 0 0 6px 3px ${convertHexToRgba(theme.orbit.paletteInkDark, opacity[type])};`; - } - if (state === BUTTON_STATES.FOCUS) { - return `0 0 0 3px ${wrappedButtonTypeToken(TOKENS.borderColorButtonFocus)}`; - } - return null; -}; - -export default getAlertButtonBoxShadow; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js.flow b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js.flow deleted file mode 100644 index 2c39a15a6f..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import type { Type } from ".."; -import type { Theme } from "../../../defaultTheme"; - -type State = "default" | "focus" | "active" | "hover"; - -export type GetAlertButtonBoxShadow = ( - state: State, - disabled: boolean, - theme: Theme, - type: Type, -) => ?string; - -declare export default GetAlertButtonBoxShadow; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.ts b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.ts new file mode 100644 index 0000000000..c8a8678dc7 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonBoxShadow.ts @@ -0,0 +1,43 @@ +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import { Theme } from "../../../defaultTheme"; +import getAlertButtonTypeToken, { TokenName } from "./getAlertButtonTypeToken"; +import { TOKENS, TYPE_OPTIONS } from "../consts"; +import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; +import { Type } from "../types"; + +const opacity = { + [TYPE_OPTIONS.INFO]: 15, + [TYPE_OPTIONS.SUCCESS]: 15, + [TYPE_OPTIONS.WARNING]: 15, + [TYPE_OPTIONS.CRITICAL]: 15, + [TYPE_OPTIONS.INFO_SUBTLE]: 8, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: 8, + [TYPE_OPTIONS.WARNING_SUBTLE]: 8, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: 8, +}; + +export type State = "default" | "focus" | "active" | "hover"; + +const getAlertButtonBoxShadow = ( + state: State, + disabled: boolean, + theme: Theme, + type: Type, +): string | null => { + const wrappedButtonTypeToken = (name: TokenName) => getAlertButtonTypeToken(name, type, theme); + + if (disabled) return null; + + if (state === BUTTON_STATES.ACTIVE) { + return `inset 0 0 6px 3px ${convertHexToRgba(theme.orbit.paletteInkDark, opacity[type])};`; + } + + if (state === BUTTON_STATES.FOCUS) { + return `0 0 0 3px ${wrappedButtonTypeToken(TOKENS.borderColorButtonFocus)}`; + } + + return null; +}; + +export default getAlertButtonBoxShadow; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js deleted file mode 100644 index 9ae299a763..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js +++ /dev/null @@ -1,10 +0,0 @@ -// @flow -import { TOKENS } from "../consts"; -import getAlertButtonTypeToken from "./getAlertButtonTypeToken"; -import type { GetAlertButtonIconForeground } from "./getAlertButtonIconForeground"; - -const getAlertButtonIconForeground: GetAlertButtonIconForeground = ({ theme, type }) => ({ - foreground: getAlertButtonTypeToken(TOKENS.colorTextButton, type, theme), -}); - -export default getAlertButtonIconForeground; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js.flow b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js.flow deleted file mode 100644 index 2581c0fa47..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.js.flow +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import type { ThemeProps } from "../../../defaultTheme"; -import type { Type } from ".."; -import type { IconForeground } from "../../../primitives/ButtonPrimitive"; - -export type GetAlertButtonIconForeground = ({| - type: Type, - ...ThemeProps, -|}) => IconForeground; - -declare export default GetAlertButtonIconForeground; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.ts b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.ts new file mode 100644 index 0000000000..9e2f425a51 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonIconForeground.ts @@ -0,0 +1,16 @@ +import { TOKENS } from "../consts"; +import getAlertButtonTypeToken from "./getAlertButtonTypeToken"; +import { Theme } from "../../../defaultTheme"; +import { Type } from "../types"; + +const getAlertButtonIconForeground = ({ + theme, + type, +}: { + theme: Theme; + type: Type; +}): { foreground: string } => ({ + foreground: getAlertButtonTypeToken(TOKENS.colorTextButton, type, theme), +}); + +export default getAlertButtonIconForeground; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js deleted file mode 100644 index f095263490..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js +++ /dev/null @@ -1,27 +0,0 @@ -// @flow -import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; -import getAlertButtonTypeToken from "./getAlertButtonTypeToken"; -import { TOKENS } from "../consts"; -import getAlertButtonBoxShadow from "./getAlertButtonBoxShadow"; -import type { GetAlertButtonStyles } from "./getAlertButtonStyles"; - -const getAlertButtonStyles: GetAlertButtonStyles = ({ disabled, theme, type }) => { - const wrappedBoxShadow = state => getAlertButtonBoxShadow(state, disabled, theme, type); - const wrappedTypeToken = name => getAlertButtonTypeToken(name, type, theme); - const boxShadow = { - boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), - boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), - boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), - boxShadowFocus: wrappedBoxShadow(BUTTON_STATES.FOCUS), - }; - return { - background: wrappedTypeToken(TOKENS.backgroundButton), - backgroundHover: wrappedTypeToken(TOKENS.backgroundButtonHover), - backgroundActive: wrappedTypeToken(TOKENS.backgroundButtonActive), - backgroundFocus: null, - foreground: wrappedTypeToken(TOKENS.colorTextButton), - ...boxShadow, - }; -}; - -export default getAlertButtonStyles; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js.flow b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js.flow deleted file mode 100644 index 8e4b51bb60..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow - -import type { ThemeProps } from "../../../defaultTheme"; -import type { Type } from ".."; -import type { Background, BoxShadow, Foreground } from "../../../primitives/ButtonPrimitive"; - -export type GetAlertButtonStyles = ({| - disabled: boolean, - type: Type, - ...ThemeProps, -|}) => {| - ...Background, - ...Foreground, - ...BoxShadow, -|}; - -declare export default GetAlertButtonStyles; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.ts b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.ts new file mode 100644 index 0000000000..a2591530c1 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonStyles.ts @@ -0,0 +1,35 @@ +import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; +import getAlertButtonTypeToken, { TokenName } from "./getAlertButtonTypeToken"; +import { TOKENS } from "../consts"; +import getAlertButtonBoxShadow, { State } from "./getAlertButtonBoxShadow"; +import { Theme } from "../../../defaultTheme"; +import { Type } from "../types"; + +const getAlertButtonStyles = ({ + disabled, + theme, + type, +}: { + disabled: boolean; + theme: Theme; + type: Type; +}): Record => { + const wrappedBoxShadow = (state: State) => getAlertButtonBoxShadow(state, disabled, theme, type); + const wrappedTypeToken = (name: TokenName) => getAlertButtonTypeToken(name, type, theme); + const boxShadow = { + boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), + boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), + boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), + boxShadowFocus: wrappedBoxShadow(BUTTON_STATES.FOCUS), + }; + return { + background: wrappedTypeToken(TOKENS.backgroundButton), + backgroundHover: wrappedTypeToken(TOKENS.backgroundButtonHover), + backgroundActive: wrappedTypeToken(TOKENS.backgroundButtonActive), + backgroundFocus: null, + foreground: wrappedTypeToken(TOKENS.colorTextButton), + ...boxShadow, + }; +}; + +export default getAlertButtonStyles; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js deleted file mode 100644 index 95e9492206..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js +++ /dev/null @@ -1,75 +0,0 @@ -// @flow -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import { TOKENS, TYPE_OPTIONS } from "../consts"; -import type { GetAlertButtonTypeToken } from "./getAlertButtonTypeToken"; - -const getAlertButtonTypeToken: GetAlertButtonTypeToken = (name, type, theme) => { - const tokens = { - [TOKENS.backgroundButton]: { - [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfo, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccess, - [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarning, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCritical, - [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightHover, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightHover, - [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightHover, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondary, - }, - [TOKENS.backgroundButtonHover]: { - [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfoHover, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccessHover, - [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarningHover, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalHover, - [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightHover, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightHover, - [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightHover, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, - }, - [TOKENS.backgroundButtonActive]: { - [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfoActive, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccessActive, - [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarningActive, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalActive, - [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightActive, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightActive, - [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightActive, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightActive, - }, - [TOKENS.backgroundButtonFocus]: { - [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueNormal, 10), - [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenNormal, 10), - [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 10), - [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 10), - [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLight, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLight, - [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLight, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, - }, - [TOKENS.colorTextButton]: { - [TYPE_OPTIONS.INFO]: theme.orbit.colorTextButtonInfo, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.colorTextButtonSuccess, - [TYPE_OPTIONS.WARNING]: theme.orbit.colorTextButtonWarning, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCritical, - [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueDark, - [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenDark, - [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeDark, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.paletteInkDark, - }, - [TOKENS.borderColorButtonFocus]: { - [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueNormal, 50), - [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenNormal, 50), - [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 50), - [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), - [TYPE_OPTIONS.INFO_SUBTLE]: convertHexToRgba(theme.orbit.paletteBlueNormal, 50), - [TYPE_OPTIONS.SUCCESS_SUBTLE]: convertHexToRgba(theme.orbit.paletteGreenNormal, 50), - [TYPE_OPTIONS.WARNING_SUBTLE]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 50), - [TYPE_OPTIONS.CRITICAL_SUBTLE]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), - }, - }; - return tokens[name][type]; -}; - -export default getAlertButtonTypeToken; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js.flow b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js.flow deleted file mode 100644 index 5b18234191..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.js.flow +++ /dev/null @@ -1,15 +0,0 @@ -// @flow -import type { Type } from ".."; -import type { Theme } from "../../../defaultTheme"; - -export type TokenName = - | "backgroundButton" - | "backgroundButtonHover" - | "backgroundButtonActive" - | "backgroundButtonFocus" - | "colorTextButton" - | "borderColorButtonFocus"; - -export type GetAlertButtonTypeToken = (name: TokenName, type: Type, theme: Theme) => string; - -declare export default GetAlertButtonTypeToken; diff --git a/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.ts b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.ts new file mode 100644 index 0000000000..c373cfeae7 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/helpers/getAlertButtonTypeToken.ts @@ -0,0 +1,85 @@ +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import { TOKENS, TYPE_OPTIONS } from "../consts"; +import { Type } from "../types"; +import { Theme } from "../../../defaultTheme"; + +export type TokenName = + | "backgroundButton" + | "backgroundButtonHover" + | "backgroundButtonActive" + | "backgroundButtonFocus" + | "colorTextButton" + | "borderColorButtonFocus"; + +type GetAlertButtonTypeToken = (name: TokenName, type: Type, theme: Theme) => string; + +const getAlertButtonTypeToken: GetAlertButtonTypeToken = (name, type, theme) => { + const tokens = { + [TOKENS.backgroundButton]: { + [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfo, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccess, + [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarning, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCritical, + [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightHover, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightHover, + [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightHover, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondary, + }, + [TOKENS.backgroundButtonHover]: { + [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfoHover, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccessHover, + [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarningHover, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalHover, + [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightHover, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightHover, + [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightHover, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, + }, + [TOKENS.backgroundButtonActive]: { + [TYPE_OPTIONS.INFO]: theme.orbit.backgroundButtonInfoActive, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.backgroundButtonSuccessActive, + [TYPE_OPTIONS.WARNING]: theme.orbit.backgroundButtonWarningActive, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalActive, + [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLightActive, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLightActive, + [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLightActive, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightActive, + }, + [TOKENS.backgroundButtonFocus]: { + [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueNormal, 10), + [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenNormal, 10), + [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 10), + [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 10), + [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueLight, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenLight, + [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeLight, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, + }, + [TOKENS.colorTextButton]: { + [TYPE_OPTIONS.INFO]: theme.orbit.colorTextButtonInfo, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.colorTextButtonSuccess, + [TYPE_OPTIONS.WARNING]: theme.orbit.colorTextButtonWarning, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCritical, + [TYPE_OPTIONS.INFO_SUBTLE]: theme.orbit.paletteBlueDark, + [TYPE_OPTIONS.SUCCESS_SUBTLE]: theme.orbit.paletteGreenDark, + [TYPE_OPTIONS.WARNING_SUBTLE]: theme.orbit.paletteOrangeDark, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.paletteInkDark, + }, + [TOKENS.borderColorButtonFocus]: { + [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueNormal, 50), + [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenNormal, 50), + [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 50), + [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), + [TYPE_OPTIONS.INFO_SUBTLE]: convertHexToRgba(theme.orbit.paletteBlueNormal, 50), + [TYPE_OPTIONS.SUCCESS_SUBTLE]: convertHexToRgba(theme.orbit.paletteGreenNormal, 50), + [TYPE_OPTIONS.WARNING_SUBTLE]: convertHexToRgba(theme.orbit.paletteOrangeNormal, 50), + [TYPE_OPTIONS.CRITICAL_SUBTLE]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), + }, + }; + return tokens[name][type]; +}; + +export default getAlertButtonTypeToken; diff --git a/packages/orbit-components/src/Alert/AlertButton/index.d.ts b/packages/orbit-components/src/Alert/AlertButton/index.d.ts deleted file mode 100644 index 715e952687..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import { ButtonCommonProps } from "../../primitives/ButtonPrimitive"; - -type Type = - | "info" - | "success" - | "warning" - | "critical" - | "infoSubtle" - | "successSubtle" - | "warningSubtle" - | "criticalSubtle"; - -type OmittedButtonCommonProps = Omit; - -type Props = { - readonly type?: Type; -} & OmittedButtonCommonProps; - -declare const AlertButton: React.FunctionComponent; -export { AlertButton, AlertButton as default }; diff --git a/packages/orbit-components/src/Alert/AlertButton/index.js.flow b/packages/orbit-components/src/Alert/AlertButton/index.js.flow new file mode 100644 index 0000000000..1599fb3890 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/index.js.flow @@ -0,0 +1,21 @@ +// @flow +import * as React from "react"; + +import type { ButtonCommonProps } from "../../primitives/ButtonPrimitive/index.js.flow"; + +export type Type = + | "info" + | "success" + | "warning" + | "critical" + | "infoSubtle" + | "successSubtle" + | "warningSubtle" + | "criticalSubtle"; + +export type Props = {| + +type?: Type, + ...$Diff, +|}; + +declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/Alert/AlertButton/index.jsx b/packages/orbit-components/src/Alert/AlertButton/index.jsx deleted file mode 100644 index 7758634244..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/index.jsx +++ /dev/null @@ -1,42 +0,0 @@ -// @flow -import * as React from "react"; - -import { TYPE_OPTIONS } from "./consts"; -import ButtonPrimitive from "../../primitives/ButtonPrimitive"; -import getIconContainer from "../../primitives/ButtonPrimitive/common/getIconContainer"; -import getCommonProps from "../../primitives/ButtonPrimitive/common/getCommonProps"; -import useTheme from "../../hooks/useTheme"; -import getAlertButtonStyles from "./helpers/getAlertButtonStyles"; -import getAlertButtonIconForeground from "./helpers/getAlertButtonIconForeground"; -import { SIZE_OPTIONS } from "../../primitives/ButtonPrimitive/common/consts"; - -import type { Props } from "."; - -const AlertButton: React.AbstractComponent = React.forwardRef< - Props, - HTMLButtonElement, ->(({ type = TYPE_OPTIONS.INFO, disabled = false, ...props }, ref) => { - const theme = useTheme(); - const propsWithTheme = { theme, ...props }; - const commonProps = getCommonProps({ ...propsWithTheme, size: SIZE_OPTIONS.SMALL }); - const buttonStyles = getAlertButtonStyles({ type, theme, disabled }); - const icons = getIconContainer({ - ...propsWithTheme, - iconForeground: getAlertButtonIconForeground({ type, theme }), - }); - - return ( - - ); -}); - -AlertButton.displayName = "AlertButton"; - -export default AlertButton; diff --git a/packages/orbit-components/src/Alert/AlertButton/index.jsx.flow b/packages/orbit-components/src/Alert/AlertButton/index.jsx.flow deleted file mode 100644 index 485ad7cef4..0000000000 --- a/packages/orbit-components/src/Alert/AlertButton/index.jsx.flow +++ /dev/null @@ -1,21 +0,0 @@ -// @flow -import * as React from "react"; - -import type { ButtonCommonProps } from "../../primitives/ButtonPrimitive"; - -export type Type = - | "info" - | "success" - | "warning" - | "critical" - | "infoSubtle" - | "successSubtle" - | "warningSubtle" - | "criticalSubtle"; - -export type Props = {| - +type?: Type, - ...$Diff, -|}; - -declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/Alert/AlertButton/index.tsx b/packages/orbit-components/src/Alert/AlertButton/index.tsx new file mode 100644 index 0000000000..9344f775d3 --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/index.tsx @@ -0,0 +1,41 @@ +import * as React from "react"; + +import { TYPE_OPTIONS } from "./consts"; +import ButtonPrimitive from "../../primitives/ButtonPrimitive"; +import getIconContainer from "../../primitives/ButtonPrimitive/common/getIconContainer"; +import getCommonProps from "../../primitives/ButtonPrimitive/common/getCommonProps"; +import useTheme from "../../hooks/useTheme"; +import getAlertButtonStyles from "./helpers/getAlertButtonStyles"; +import getAlertButtonIconForeground from "./helpers/getAlertButtonIconForeground"; +import { SIZE_OPTIONS } from "../../primitives/ButtonPrimitive/common/consts"; +import { Props } from "./types"; + +const AlertButton = React.forwardRef( + ({ type = TYPE_OPTIONS.INFO, children, disabled = false, ...props }, ref) => { + const theme = useTheme(); + const propsWithTheme = { theme, ...props }; + const commonProps = getCommonProps({ ...propsWithTheme, size: SIZE_OPTIONS.SMALL }); + const buttonStyles = getAlertButtonStyles({ type, theme, disabled }); + const icons = getIconContainer({ + ...propsWithTheme, + iconForeground: getAlertButtonIconForeground({ type, theme }), + }); + + return ( + + {children} + + ); + }, +); + +AlertButton.displayName = "AlertButton"; + +export default AlertButton; diff --git a/packages/orbit-components/src/Alert/AlertButton/types.ts b/packages/orbit-components/src/Alert/AlertButton/types.ts new file mode 100644 index 0000000000..11253a212c --- /dev/null +++ b/packages/orbit-components/src/Alert/AlertButton/types.ts @@ -0,0 +1,26 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import { ButtonCommonProps } from "../../primitives/ButtonPrimitive/types"; + +export type Type = + | "info" + | "secondary" + | "success" + | "warning" + | "critical" + | "infoSubtle" + | "successSubtle" + | "warningSubtle" + | "criticalSubtle"; + +type OmittedButtonCommonProps = Omit; + +export type Props = { + readonly type?: Type; +} & OmittedButtonCommonProps; + +declare const AlertButton: React.FunctionComponent; +export { AlertButton, AlertButton as default }; diff --git a/packages/orbit-components/src/Alert/__tests__/index.test.jsx b/packages/orbit-components/src/Alert/__tests__/index.test.jsx deleted file mode 100644 index ce9d746668..0000000000 --- a/packages/orbit-components/src/Alert/__tests__/index.test.jsx +++ /dev/null @@ -1,41 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import Alert from ".."; -import defaultTheme from "../../defaultTheme"; -import SPACINGS_AFTER from "../../common/getSpacingToken/consts"; - -const message = "Alert message"; - -describe("Alert", () => { - it("should contain children", () => { - render({message}); - expect(screen.getByText(message)).toBeInTheDocument(); - }); - it("should have data-test", () => { - const dataTest = "test"; - render({message}); - expect(screen.getByTestId(dataTest)).toBeInTheDocument(); - }); - it("should have margin-bottom", () => { - const { container } = render({message}); - // $FlowFixMe - expect(getComputedStyle(container.firstChild)).toHaveProperty( - "margin-bottom", - defaultTheme.orbit.spaceSmall, - ); - }); - it("should be closable", () => { - const onClose = jest.fn(); - render( - - {message} - , - ); - - userEvent.click(screen.getByRole("button")); - expect(onClose).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/Alert/__tests__/index.test.tsx b/packages/orbit-components/src/Alert/__tests__/index.test.tsx new file mode 100644 index 0000000000..8e44a97eaa --- /dev/null +++ b/packages/orbit-components/src/Alert/__tests__/index.test.tsx @@ -0,0 +1,40 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import Alert from ".."; +import defaultTheme from "../../defaultTheme"; +import SPACINGS_AFTER from "../../common/getSpacingToken/consts"; + +const message = "Alert message"; + +describe("Alert", () => { + it("should contain children", () => { + render({message}); + expect(screen.getByText(message)).toBeInTheDocument(); + }); + it("should have data-test", () => { + const dataTest = "test"; + render({message}); + expect(screen.getByTestId(dataTest)).toBeInTheDocument(); + }); + it("should have margin-bottom", () => { + const { container } = render({message}); + // @ts-expect-error TODO + expect(getComputedStyle(container.firstChild)).toHaveProperty( + "margin-bottom", + defaultTheme.orbit.spaceSmall, + ); + }); + it("should be closable", () => { + const onClose = jest.fn(); + render( + + {message} + , + ); + + userEvent.click(screen.getByRole("button")); + expect(onClose).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/Alert/consts.js b/packages/orbit-components/src/Alert/consts.js deleted file mode 100644 index a486525e87..0000000000 --- a/packages/orbit-components/src/Alert/consts.js +++ /dev/null @@ -1,18 +0,0 @@ -// @flow -export const TYPE_OPTIONS = { - INFO: "info", - SUCCESS: "success", - WARNING: "warning", - CRITICAL: "critical", -}; - -export const TOKENS = { - backgroundAlert: "backgroundAlert", - colorIconAlert: "colorIconAlert", - colorTextLinkAlertHover: "colorTextLinkAlertHover", - colorTextLinkAlertFocus: "colorTextLinkAlertFocus", - colorBorderAlert: "colorBorderAlert", - colorAccentBorder: "colorAccentBorder", -}; - -export const CLOSE_BUTTON_DATA_TEST = "AlertCloseButton"; diff --git a/packages/orbit-components/src/Alert/consts.ts b/packages/orbit-components/src/Alert/consts.ts new file mode 100644 index 0000000000..d603497604 --- /dev/null +++ b/packages/orbit-components/src/Alert/consts.ts @@ -0,0 +1,19 @@ +import { Type } from "./types"; + +export const TYPE_OPTIONS: Record<"INFO" | "SUCCESS" | "WARNING" | "CRITICAL", Type> = { + INFO: "info", + SUCCESS: "success", + WARNING: "warning", + CRITICAL: "critical", +}; + +export const TOKENS = { + backgroundAlert: "backgroundAlert", + colorIconAlert: "colorIconAlert", + colorTextLinkAlertHover: "colorTextLinkAlertHover", + colorTextLinkAlertFocus: "colorTextLinkAlertFocus", + colorBorderAlert: "colorBorderAlert", + colorAccentBorder: "colorAccentBorder", +}; + +export const CLOSE_BUTTON_DATA_TEST = "AlertCloseButton"; diff --git a/packages/orbit-components/src/Alert/index.d.ts b/packages/orbit-components/src/Alert/index.d.ts deleted file mode 100644 index eddbbfaad3..0000000000 --- a/packages/orbit-components/src/Alert/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; -import AlertButton from "./AlertButton"; - -type Type = "info" | "success" | "warning" | "critical"; - -export interface Props extends Common.Global, Common.SpaceAfter { - readonly type?: Type; - readonly children?: React.ReactNode; - readonly title?: Common.Translation; - readonly icon?: boolean | React.ReactElement; - readonly closable?: boolean; - readonly inlineActions?: React.ReactNode; - readonly onClose?: Common.Callback; - readonly suppressed?: boolean; -} - -declare const Alert: React.FunctionComponent; -export { Alert, Alert as default, AlertButton }; diff --git a/packages/orbit-components/src/Alert/index.js.flow b/packages/orbit-components/src/Alert/index.js.flow new file mode 100644 index 0000000000..b4cd82e482 --- /dev/null +++ b/packages/orbit-components/src/Alert/index.js.flow @@ -0,0 +1,28 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/alert-message/ +*/ +import * as React from "react"; + +import type { spaceAfter } from "../common/getSpacingToken/index.js.flow"; +import type { Globals, Translation } from "../common/common.js.flow"; +import type { Props as AlertButtonProps } from "./AlertButton/index.js.flow"; + +type Type = "info" | "success" | "warning" | "critical"; + +export type Props = {| + +type?: Type, + +children?: React.Node, + +title?: Translation, + +icon?: React.Element | boolean, + +closable?: boolean, + +suppressed?: boolean, + +inlineActions?: React.Node, + +onClose?: () => void | Promise, + ...Globals, + ...spaceAfter, +|}; + +declare export var AlertButton: React.AbstractComponent; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Alert/index.jsx b/packages/orbit-components/src/Alert/index.jsx deleted file mode 100644 index 520643816b..0000000000 --- a/packages/orbit-components/src/Alert/index.jsx +++ /dev/null @@ -1,331 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import defaultTheme from "../defaultTheme"; -import InformationCircle from "../icons/InformationCircle"; -import Check from "../icons/Check"; -import AlertTriangle from "../icons/Alert"; -import AlertCircle from "../icons/AlertCircle"; -import Close from "../icons/Close"; -import ButtonLink from "../ButtonLink"; -import { StyledTextLink, getLinkStyle } from "../TextLink"; -import { TYPE_OPTIONS, TOKENS, CLOSE_BUTTON_DATA_TEST } from "./consts"; -import { rtlSpacing, right, left } from "../utils/rtl"; -import getSpacingToken from "../common/getSpacingToken"; -import { Item } from "../List/ListItem"; -import { StyledText } from "../Text"; -import useTranslate from "../hooks/useTranslate"; -import { StyledHeading } from "../Heading"; -import media from "../utils/mediaQuery"; - -import type { Props } from "."; - -type IconProps = {| - icon: any, - type: string, - className: string, -|}; - -const getTypeToken = name => ({ theme, type, suppressed }) => { - const tokens = { - [TOKENS.colorIconAlert]: { - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueNormal, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenNormal, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeNormal, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedNormal, - }, - [TOKENS.backgroundAlert]: { - [TYPE_OPTIONS.INFO]: suppressed - ? theme.orbit.paletteCloudLight - : theme.orbit.backgroundAlertInfo, - [TYPE_OPTIONS.SUCCESS]: suppressed - ? theme.orbit.paletteCloudLight - : theme.orbit.backgroundAlertSuccess, - [TYPE_OPTIONS.WARNING]: suppressed - ? theme.orbit.paletteCloudLight - : theme.orbit.backgroundAlertWarning, - [TYPE_OPTIONS.CRITICAL]: suppressed - ? theme.orbit.paletteCloudLight - : theme.orbit.backgroundAlertCritical, - }, - // TODO: create token - [TOKENS.colorTextLinkAlertHover]: { - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueDarkHover, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenDarkHover, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeDarkHover, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedDarkActive, - }, - // TODO: create token - [TOKENS.colorTextLinkAlertFocus]: { - [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueDarkHover, 10), - [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenDarkHover, 10), - [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeDarkHover, 10), - [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedDarkActive, 10), - }, - [TOKENS.colorBorderAlert]: { - [TYPE_OPTIONS.INFO]: suppressed - ? theme.orbit.paletteCloudNormal - : theme.orbit.paletteBlueLightHover, - [TYPE_OPTIONS.SUCCESS]: suppressed - ? theme.orbit.paletteCloudNormal - : theme.orbit.paletteGreenLightHover, - [TYPE_OPTIONS.WARNING]: suppressed - ? theme.orbit.paletteCloudNormal - : theme.orbit.paletteOrangeLightHover, - [TYPE_OPTIONS.CRITICAL]: suppressed - ? theme.orbit.paletteCloudNormal - : theme.orbit.paletteRedLightHover, - }, - [TOKENS.colorAccentBorder]: { - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueNormal, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenNormal, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeNormal, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedNormal, - }, - }; - return tokens[name][type]; -}; - -const StyledIcon = styled(({ icon, type, className }: IconProps) => { - // Icon should be boolean and TRUE - if (typeof icon === "boolean" && icon) { - if (type === TYPE_OPTIONS.INFO) { - return ; - } - if (type === TYPE_OPTIONS.SUCCESS) { - return ; - } - if (type === TYPE_OPTIONS.WARNING) { - return ; - } - if (type === TYPE_OPTIONS.CRITICAL) { - return ; - } - } - if (React.isValidElement(icon)) { - return React.cloneElement(icon, { className, size: "small" }); - } - - return icon; -})``; - -const StyledDiv = ({ - className, - children, - dataTest, - id, -}: {| - className: string, - id: string, - children: React.Node, - dataTest: string, -|}) => ( -
- {children} -
-); - -const StyledAlert = styled(StyledDiv)` - ${({ theme, closable }) => css` - position: relative; - display: flex; - width: 100%; - border-radius: ${theme.orbit.borderRadiusLarge}; - border: 1px solid ${getTypeToken(TOKENS.colorBorderAlert)}; - background: ${getTypeToken(TOKENS.backgroundAlert)}; - color: ${theme.orbit.paletteInkDark}; - font-family: ${theme.orbit.fontFamily}; - font-size: ${theme.orbit.fontSizeTextNormal}; - box-sizing: border-box; - margin-bottom: ${getSpacingToken}; - border-top: 3px solid ${getTypeToken(TOKENS.colorAccentBorder)}; - - padding: ${closable - ? rtlSpacing( - `${theme.orbit.spaceSmall} ${theme.orbit.spaceLarge} ${theme.orbit.spaceSmall} ${theme.orbit.spaceSmall}`, - ) - : theme.orbit.spaceSmall}; - - ${media.largeMobile(css` - border-top: 1px solid ${getTypeToken(TOKENS.colorBorderAlert)}; - border-${left}: 3px solid ${getTypeToken(TOKENS.colorAccentBorder)}; - `)} - - ${media.tablet(css` - border-radius: ${theme.orbit.borderRadiusNormal}; - `)} - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledAlert.defaultProps = { - theme: defaultTheme, -}; - -const StyledIconContainer = styled(StyledDiv)` - ${({ theme, inlineActions }) => css` - flex-shrink: 0; - margin: ${rtlSpacing(`0 ${theme.orbit.spaceXSmall} 0 0`)}; - color: ${getTypeToken(TOKENS.colorIconAlert)}; - display: ${inlineActions && "flex"}; - align-items: ${inlineActions && "center"}; - - ${media.tablet(css` - margin: ${rtlSpacing(`0 ${theme.orbit.spaceXSmall} 0 0`)}; - - ${StyledIcon} { - width: 20px; - height: 20px; - } - `)} - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledIconContainer.defaultProps = { - theme: defaultTheme, -}; - -const StyledContentWrapper = styled(StyledDiv)` - ${({ title, inlineActions }) => css` - flex: 1; // IE wrapping fix - display: flex; - flex-direction: ${title && inlineActions ? "row" : "column"}; - align-items: ${!title && "center"}; - justify-content: ${inlineActions && "space-between"}; - `} -`; - -const StyledTitle = styled(StyledDiv)` - ${({ theme, hasChildren, inlineActions }) => css` - color: ${theme.orbit.paletteInkDark}; - display: flex; - align-items: center; - min-height: 20px; - margin-bottom: ${hasChildren && (inlineActions ? "0" : theme.orbit.spaceXXSmall)}; - font-weight: ${theme.orbit.fontWeightBold}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledTitle.defaultProps = { - theme: defaultTheme, -}; - -const StyledContent = styled(StyledDiv)` - ${({ inlineActions, theme }) => css` - display: flex; - align-items: center; - min-height: 20px; - width: ${!inlineActions && "100%"}; - - & a:not([class]), - & ${StyledTextLink} { - ${getLinkStyle}; - } - - & ${Item}, ${StyledText}, ${StyledHeading} { - color: ${theme.orbit.paletteInkDark}; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledContent.defaultProps = { - theme: defaultTheme, -}; - -const CloseContainer = styled(StyledDiv)` - ${({ theme, hasChildren }) => css` - position: absolute; - top: ${hasChildren ? 0 : "50%"}; - margin-top: ${!hasChildren && `-${theme.orbit.widthIconSmall}`}; - ${right}: 0; - margin-${right}: ${!hasChildren && theme.orbit.spaceXSmall}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -CloseContainer.defaultProps = { - theme: defaultTheme, -}; - -const AlertCloseButton = ({ hasChildren, dataTest, onClick, icon }) => { - const translate = useTranslate(); - return ( - - - - ); -}; - -const Alert = (props: Props): React.Node => { - const { - type = TYPE_OPTIONS.INFO, - title, - icon, - closable, - onClose, - children, - dataTest, - id, - spaceAfter, - suppressed, - inlineActions, - } = props; - return ( - - {icon && ( - - - - )} - - {title && ( - - {title} - - )} - {children && !inlineActions && ( - - {children} - - )} - {inlineActions && ( - - {inlineActions} - - )} - - {closable && ( - } - /> - )} - - ); -}; - -export { default as AlertButton } from "./AlertButton"; - -export default Alert; diff --git a/packages/orbit-components/src/Alert/index.jsx.flow b/packages/orbit-components/src/Alert/index.jsx.flow deleted file mode 100644 index 5fc3c64014..0000000000 --- a/packages/orbit-components/src/Alert/index.jsx.flow +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/alert-message/ -*/ -import * as React from "react"; - -import type { spaceAfter } from "../common/getSpacingToken"; -import type { Globals, Translation } from "../common/common.js.flow"; -import type { Props as AlertButtonProps } from "./AlertButton"; - -type Type = "info" | "success" | "warning" | "critical"; - -export type Props = {| - +type?: Type, - +children?: React.Node, - +title?: Translation, - +icon?: React.Element | boolean, - +closable?: boolean, - +suppressed?: boolean, - +inlineActions?: React.Node, - +onClose?: () => void | Promise, - ...Globals, - ...spaceAfter, -|}; - -declare export var AlertButton: React.AbstractComponent; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Alert/index.tsx b/packages/orbit-components/src/Alert/index.tsx new file mode 100644 index 0000000000..b6ddde3b3c --- /dev/null +++ b/packages/orbit-components/src/Alert/index.tsx @@ -0,0 +1,335 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import { Props as IconProps } from "../Icon/types"; +import * as Common from "../common/types"; +import { Type, Props } from "./types"; +import defaultTheme, { Theme } from "../defaultTheme"; +import InformationCircle from "../icons/InformationCircle"; +import Check from "../icons/Check"; +import AlertTriangle from "../icons/Alert"; +import AlertCircle from "../icons/AlertCircle"; +import Close from "../icons/Close"; +import ButtonLink from "../ButtonLink"; +import { StyledTextLink, getLinkStyle } from "../TextLink"; +import { TYPE_OPTIONS, TOKENS, CLOSE_BUTTON_DATA_TEST } from "./consts"; +import { rtlSpacing, right, left } from "../utils/rtl"; +import getSpacingToken from "../common/getSpacingToken"; +import { Item } from "../List/ListItem"; +import { StyledText } from "../Text"; +import useTranslate from "../hooks/useTranslate"; +import { StyledHeading } from "../Heading"; +import media from "../utils/mediaQuery"; + +const getTypeToken = (name: string) => ({ + theme, + type, + suppressed, +}: { + theme: Theme; + type: Type; + suppressed?: boolean; +}) => { + const tokens = { + [TOKENS.colorIconAlert]: { + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueNormal, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenNormal, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeNormal, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedNormal, + }, + [TOKENS.backgroundAlert]: { + [TYPE_OPTIONS.INFO]: suppressed + ? theme.orbit.paletteCloudLight + : theme.orbit.backgroundAlertInfo, + [TYPE_OPTIONS.SUCCESS]: suppressed + ? theme.orbit.paletteCloudLight + : theme.orbit.backgroundAlertSuccess, + [TYPE_OPTIONS.WARNING]: suppressed + ? theme.orbit.paletteCloudLight + : theme.orbit.backgroundAlertWarning, + [TYPE_OPTIONS.CRITICAL]: suppressed + ? theme.orbit.paletteCloudLight + : theme.orbit.backgroundAlertCritical, + }, + // TODO: create token + [TOKENS.colorTextLinkAlertHover]: { + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueDarkHover, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenDarkHover, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeDarkHover, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedDarkActive, + }, + // TODO: create token + [TOKENS.colorTextLinkAlertFocus]: { + [TYPE_OPTIONS.INFO]: convertHexToRgba(theme.orbit.paletteBlueDarkHover, 10), + [TYPE_OPTIONS.SUCCESS]: convertHexToRgba(theme.orbit.paletteGreenDarkHover, 10), + [TYPE_OPTIONS.WARNING]: convertHexToRgba(theme.orbit.paletteOrangeDarkHover, 10), + [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedDarkActive, 10), + }, + [TOKENS.colorBorderAlert]: { + [TYPE_OPTIONS.INFO]: suppressed + ? theme.orbit.paletteCloudNormal + : theme.orbit.paletteBlueLightHover, + [TYPE_OPTIONS.SUCCESS]: suppressed + ? theme.orbit.paletteCloudNormal + : theme.orbit.paletteGreenLightHover, + [TYPE_OPTIONS.WARNING]: suppressed + ? theme.orbit.paletteCloudNormal + : theme.orbit.paletteOrangeLightHover, + [TYPE_OPTIONS.CRITICAL]: suppressed + ? theme.orbit.paletteCloudNormal + : theme.orbit.paletteRedLightHover, + }, + [TOKENS.colorAccentBorder]: { + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueNormal, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenNormal, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeNormal, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedNormal, + }, + }; + + return tokens[name][type]; +}; + +const StyledIcon = ({ icon, type }: Pick) => { + // Icon should be boolean and TRUE + if (typeof icon === "boolean" && icon) { + if (type === TYPE_OPTIONS.INFO) { + return ; + } + if (type === TYPE_OPTIONS.SUCCESS) { + return ; + } + if (type === TYPE_OPTIONS.WARNING) { + return ; + } + if (type === TYPE_OPTIONS.CRITICAL) { + return ; + } + } + + if (React.isValidElement(icon) && typeof icon !== "boolean") { + // @ts-expect-error TODO + return React.cloneElement(icon, { size: "small" }); + } + + return <>{icon}; +}; + +const StyledAlert = styled.div<{ + closable?: boolean; + spaceAfter?: Common.SpaceAfterSizes; + icon?: React.ReactNode; + suppressed?: boolean; + type: Type; +}>` + ${({ theme, closable }) => css` + position: relative; + display: flex; + width: 100%; + border-radius: ${theme.orbit.borderRadiusLarge}; + border: 1px solid ${getTypeToken(TOKENS.colorBorderAlert)}; + background: ${getTypeToken(TOKENS.backgroundAlert)}; + color: ${theme.orbit.paletteInkDark}; + font-family: ${theme.orbit.fontFamily}; + font-size: ${theme.orbit.fontSizeTextNormal}; + box-sizing: border-box; + margin-bottom: ${getSpacingToken}; + border-top: 3px solid ${getTypeToken(TOKENS.colorAccentBorder)}; + + padding: ${closable + ? rtlSpacing( + `${theme.orbit.spaceSmall} ${theme.orbit.spaceLarge} ${theme.orbit.spaceSmall} ${theme.orbit.spaceSmall}`, + ) + : theme.orbit.spaceSmall}; + + ${media.largeMobile(css` + border-top: 1px solid ${getTypeToken(TOKENS.colorBorderAlert)}; + border-${left}: 3px solid ${getTypeToken(TOKENS.colorAccentBorder)}; + `)} + + ${media.tablet(css` + border-radius: ${theme.orbit.borderRadiusNormal}; + `)} + `} +`; + +StyledAlert.defaultProps = { + theme: defaultTheme, +}; + +const StyledIconContainer = styled.div<{ inlineActions: boolean; type: Type }>` + ${({ theme, inlineActions }) => css` + flex-shrink: 0; + margin: ${rtlSpacing(`0 ${theme.orbit.spaceXSmall} 0 0`)}; + color: ${getTypeToken(TOKENS.colorIconAlert)}; + display: ${inlineActions && "flex"}; + align-items: ${inlineActions && "center"}; + + ${media.tablet(css` + margin: ${rtlSpacing(`0 ${theme.orbit.spaceXSmall} 0 0`)({ theme })}; + svg { + width: 20px; + height: 20px; + } + `)} + `} +`; + +StyledIconContainer.defaultProps = { + theme: defaultTheme, +}; + +const StyledContentWrapper = styled.div<{ + hasTitle: boolean; + inlineActions: boolean; +}>` + ${({ hasTitle, inlineActions }) => css` + flex: 1; // IE wrapping fix + display: flex; + flex-direction: ${hasTitle && inlineActions ? "row" : "column"}; + align-items: ${!hasTitle && "center"}; + justify-content: ${inlineActions && "space-between"}; + `} +`; + +const StyledTitle = styled.div<{ inlineActions?: boolean; hasChildren: boolean }>` + ${({ theme, hasChildren, inlineActions }) => css` + color: ${theme.orbit.paletteInkDark}; + display: flex; + align-items: center; + min-height: 20px; + margin-bottom: ${hasChildren && (inlineActions ? "0" : theme.orbit.spaceXXSmall)}; + font-weight: ${theme.orbit.fontWeightBold}; + `} +`; + +StyledTitle.defaultProps = { + theme: defaultTheme, +}; + +const StyledContent = styled.div<{ inlineActions?: boolean; type: Type; $noUnderline: boolean }>` + ${({ inlineActions, theme }) => css` + display: flex; + align-items: center; + min-height: 20px; + width: ${!inlineActions && "100%"}; + + & a:not([class]), + & ${StyledTextLink} { + ${getLinkStyle}; + } + + & ${Item}, ${StyledText}, ${StyledHeading} { + color: ${theme.orbit.paletteInkDark}; + } + `} +`; + +StyledContent.defaultProps = { + theme: defaultTheme, +}; + +const CloseContainer = styled.div<{ + hasChildren: boolean; +}>` + ${({ theme, hasChildren }) => css` + position: absolute; + top: ${hasChildren ? 0 : "50%"}; + margin-top: ${!hasChildren && `-${theme.orbit.widthIconSmall}`}; + ${right}: 0; + margin-${right}: ${!hasChildren && theme.orbit.spaceXSmall}; + `} +`; + +CloseContainer.defaultProps = { + theme: defaultTheme, +}; + +const AlertCloseButton = ({ + hasChildren, + dataTest, + onClick, + icon, +}: { + hasChildren: boolean; + dataTest: string; + onClick?: Common.Callback; + icon: React.ReactNode; +}) => { + const translate = useTranslate(); + return ( + + + + ); +}; + +const Alert = (props: Props) => { + const { + type = TYPE_OPTIONS.INFO, + title, + icon, + closable, + onClose, + children, + dataTest, + id, + spaceAfter, + suppressed, + inlineActions, + } = props; + return ( + + {icon && ( + + + + )} + + {title && ( + + {title} + + )} + {children && !inlineActions && ( + + {children} + + )} + {inlineActions && ( + + {inlineActions} + + )} + + {closable && ( + } + /> + )} + + ); +}; + +export { default as AlertButton } from "./AlertButton"; + +export default Alert; diff --git a/packages/orbit-components/src/Alert/types.ts b/packages/orbit-components/src/Alert/types.ts new file mode 100644 index 0000000000..9e021e03b3 --- /dev/null +++ b/packages/orbit-components/src/Alert/types.ts @@ -0,0 +1,18 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export type Type = "info" | "success" | "warning" | "critical"; +export interface Props extends Common.Globals, Common.SpaceAfter { + readonly type?: Type; + readonly children?: React.ReactNode; + readonly title?: Common.Translation; + readonly icon?: React.ReactNode; + readonly closable?: boolean; + readonly inlineActions?: React.ReactNode; + readonly onClose?: Common.Callback; + readonly suppressed?: boolean; +} diff --git a/packages/orbit-components/src/Badge/Badge.stories.jsx b/packages/orbit-components/src/Badge/Badge.stories.jsx deleted file mode 100644 index a8ba1a9ad0..0000000000 --- a/packages/orbit-components/src/Badge/Badge.stories.jsx +++ /dev/null @@ -1,263 +0,0 @@ -// @flow -import * as React from "react"; -import { text, select } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import { TYPE_OPTIONS } from "./consts"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; - -import Badge from "."; - -const getIcons = defaultIcon => select("Icon", [null, ...Object.keys(Icons)], defaultIcon); -const getIcon = source => Icons[source]; - -export default { - title: "Badge", -}; - -export const Default = (): React.Node => { - const content = text("Content", "Badge"); - const Icon = getIcon(getIcons("Airplane")); - - return }>{content}; -}; - -Default.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Neutral = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Neutral.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Info = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Info.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const InfoInverted = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -InfoInverted.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Success = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Success.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const SuccessInverted = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -SuccessInverted.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Warning = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Warning.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const WarningInverted = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -WarningInverted.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Critical = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Critical.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const CriticalInverted = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -CriticalInverted.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Dark = (): React.Node => { - const content = text("Content", "Badge"); - return ( - }> - {content} - - ); -}; - -Dark.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const White = (): React.Element<"div"> => { - const content = text("Content", "Badge"); - return ( -
- }> - {content} - -
- ); -}; - -White.story = { - parameters: { - info: "Check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const BadgeWithTranslatedNode = (): React.Node => ( - }> - Content should - be - with space - -); - -BadgeWithTranslatedNode.story = { - name: "Badge with translated node", -}; - -export const Playground = (): React.Node => { - const content = text("Content", "Badge"); - const type = select("Type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.INFO); - const dataTest = text("dataTest", "test"); - const Icon = getIcon(getIcons("Airplane")); - const ariaLabel = text("ariaLabel", "test"); - - return ( - } dataTest={dataTest} ariaLabel={ariaLabel}> - {content} - - ); -}; - -Playground.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Accessibility = (): React.Node => { - const content = text("Content", "Badge"); - const Icon = getIcon(getIcons("Airplane")); - const ariaLabel = text("ariaLabel", "test"); - - return ( - } ariaLabel={ariaLabel}> - {content} - - ); -}; - -Accessibility.story = { - parameters: { - info: "This is a preview of component accessibility props", - }, -}; - -export const Rtl = (): React.Node => ( - - }> - Badge - - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/Badge/Badge.stories.tsx b/packages/orbit-components/src/Badge/Badge.stories.tsx new file mode 100644 index 0000000000..eabf61246c --- /dev/null +++ b/packages/orbit-components/src/Badge/Badge.stories.tsx @@ -0,0 +1,263 @@ +import React from "react"; +import { text, select } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import { TYPE_OPTIONS } from "./consts"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; + +import Badge from "."; + +const getIcons = (defaultIcon: string | null) => + select("Icon", [null, ...Object.keys(Icons)], defaultIcon); +const getIcon = (source: string | null) => source && Icons[source]; + +export default { + title: "Badge", +}; + +export const Default = () => { + const content = text("Content", "Badge"); + const Icon = getIcon(getIcons("Airplane")); + + return }>{content}; +}; + +Default.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Neutral = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Neutral.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Info = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Info.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const InfoInverted = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +InfoInverted.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Success = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Success.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const SuccessInverted = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +SuccessInverted.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Warning = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Warning.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const WarningInverted = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +WarningInverted.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Critical = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Critical.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const CriticalInverted = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +CriticalInverted.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Dark = () => { + const content = text("Content", "Badge"); + return ( + }> + {content} + + ); +}; + +Dark.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const White = () => { + const content = text("Content", "Badge"); + return ( +
+ }> + {content} + +
+ ); +}; + +White.story = { + parameters: { + info: "Check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const BadgeWithTranslatedNode = () => ( + }> + Content should + be + with space + +); + +BadgeWithTranslatedNode.story = { + name: "Badge with translated node", +}; + +export const Playground = () => { + const content = text("Content", "Badge"); + const type = select("Type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.INFO); + const dataTest = text("dataTest", "test"); + const Icon = getIcon(getIcons("Airplane")); + const ariaLabel = text("ariaLabel", "test"); + + return ( + } dataTest={dataTest} ariaLabel={ariaLabel}> + {content} + + ); +}; + +Playground.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Accessibility = () => { + const content = text("Content", "Badge"); + const Icon = getIcon(getIcons("Airplane")); + const ariaLabel = text("ariaLabel", "test"); + + return ( + } ariaLabel={ariaLabel}> + {content} + + ); +}; + +Accessibility.story = { + parameters: { + info: "This is a preview of component accessibility props", + }, +}; + +export const Rtl = () => ( + + }> + Badge + + +); + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/Badge/__tests__/index.test.jsx b/packages/orbit-components/src/Badge/__tests__/index.test.jsx deleted file mode 100644 index 550aa96f2c..0000000000 --- a/packages/orbit-components/src/Badge/__tests__/index.test.jsx +++ /dev/null @@ -1,34 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import Badge from ".."; -import Sightseeing from "../../icons/Sightseeing"; - -describe("Badge", () => { - const content = "badge"; - const type = "info"; - const dataTest = "test"; - const icon = ; - const ariaLabel = content; - - beforeEach(() => { - render( - - {content} - , - ); - }); - - it("should have passed props", () => { - const style = getComputedStyle(screen.getByTestId(dataTest)); - expect(style.border).toMatchInlineSnapshot(`"1px solid #def0fc"`); - expect(screen.getByTestId(dataTest)).toBeInTheDocument(); - expect(screen.getByLabelText(ariaLabel)).toBeInTheDocument(); - expect(screen.getByLabelText("sightseeing")).toBeInTheDocument(); - }); - it("should contain a content", () => { - expect(screen.getByText(content)).toBeInTheDocument(); - }); -}); diff --git a/packages/orbit-components/src/Badge/__tests__/index.test.tsx b/packages/orbit-components/src/Badge/__tests__/index.test.tsx new file mode 100644 index 0000000000..89d30ae09c --- /dev/null +++ b/packages/orbit-components/src/Badge/__tests__/index.test.tsx @@ -0,0 +1,32 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; + +import Badge from ".."; +import Sightseeing from "../../icons/Sightseeing"; + +describe("Badge", () => { + const content = "badge"; + const type = "info"; + const dataTest = "test"; + const icon = ; + const ariaLabel = content; + + beforeEach(() => { + render( + + {content} + , + ); + }); + + it("should have passed props", () => { + const style = getComputedStyle(screen.getByTestId(dataTest)); + expect(style.border).toMatchInlineSnapshot(`"1px solid #def0fc"`); + expect(screen.getByTestId(dataTest)).toBeInTheDocument(); + expect(screen.getByLabelText(ariaLabel)).toBeInTheDocument(); + expect(screen.getByLabelText("sightseeing")).toBeInTheDocument(); + }); + it("should contain a content", () => { + expect(screen.getByText(content)).toBeInTheDocument(); + }); +}); diff --git a/packages/orbit-components/src/Badge/consts.js b/packages/orbit-components/src/Badge/consts.js deleted file mode 100644 index 1d4b9e5591..0000000000 --- a/packages/orbit-components/src/Badge/consts.js +++ /dev/null @@ -1,23 +0,0 @@ -// @flow -export const TYPE_OPTIONS = { - NEUTRAL: "neutral", - INFO: "info", - SUCCESS: "success", - WARNING: "warning", - CRITICAL: "critical", - DARK: "dark", - WHITE: "white", - INFO_INVERTED: "infoInverted", - CRITICAL_INVERTED: "criticalInverted", - SUCCESS_INVERTED: "successInverted", - WARNING_INVERTED: "warningInverted", - BUNDLE_BASIC: "bundleBasic", - BUNDLE_MEDIUM: "bundleMedium", - BUNDLE_TOP: "bundleTop", -}; - -export const TOKENS = { - background: "background", - color: "color", - border: "border", -}; diff --git a/packages/orbit-components/src/Badge/consts.ts b/packages/orbit-components/src/Badge/consts.ts new file mode 100644 index 0000000000..c86b105b23 --- /dev/null +++ b/packages/orbit-components/src/Badge/consts.ts @@ -0,0 +1,24 @@ +import { Type } from "./types"; + +export const TYPE_OPTIONS: Record = { + NEUTRAL: "neutral", + INFO: "info", + SUCCESS: "success", + WARNING: "warning", + CRITICAL: "critical", + DARK: "dark", + WHITE: "white", + INFO_INVERTED: "infoInverted", + CRITICAL_INVERTED: "criticalInverted", + SUCCESS_INVERTED: "successInverted", + WARNING_INVERTED: "warningInverted", + BUNDLE_BASIC: "bundleBasic", + BUNDLE_MEDIUM: "bundleMedium", + BUNDLE_TOP: "bundleTop", +}; + +export const TOKENS = { + background: "background", + color: "color", + border: "border", +}; diff --git a/packages/orbit-components/src/Badge/index.d.ts b/packages/orbit-components/src/Badge/index.d.ts deleted file mode 100644 index 3b0a61dd15..0000000000 --- a/packages/orbit-components/src/Badge/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import { Carrier } from "../CarrierLogo"; -import * as Common from "../common/common"; - -export type Type = - | "neutral" - | "dark" - | "info" - | "success" - | "warning" - | "critical" - | "white" - | "infoInverted" - | "criticalInverted" - | "successInverted" - | "warningInverted" - | "bundleBasic" - | "bundleMedium" - | "bundleTop"; - -export interface Props extends Common.Global { - readonly children?: React.ReactNode; - readonly type?: Type; - readonly border?: boolean; - readonly carriers?: Carrier[]; - readonly icon?: React.ReactNode; - readonly ariaLabel?: string; -} - -declare const Badge: React.FunctionComponent; -export { Badge, Badge as default }; diff --git a/packages/orbit-components/src/Badge/index.js.flow b/packages/orbit-components/src/Badge/index.js.flow new file mode 100644 index 0000000000..46f7bb62bd --- /dev/null +++ b/packages/orbit-components/src/Badge/index.js.flow @@ -0,0 +1,36 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/badge/ +*/ +import * as React from "react"; + +import type { Carrier } from "../CarrierLogo/index.js.flow"; +import type { Globals } from "../common/common.js.flow"; + +export type Type = + | "neutral" + | "dark" + | "info" + | "success" + | "warning" + | "critical" + | "white" + | "infoInverted" + | "criticalInverted" + | "successInverted" + | "warningInverted" + | "bundleBasic" + | "bundleMedium" + | "bundleTop"; + +export type Props = {| + +children?: React.Node, + +carriers?: Carrier[], + +border?: boolean, + +type?: Type, + +icon?: React.Node, + +ariaLabel?: string, + ...Globals, +|}; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Badge/index.jsx b/packages/orbit-components/src/Badge/index.jsx deleted file mode 100644 index f830cdcc3f..0000000000 --- a/packages/orbit-components/src/Badge/index.jsx +++ /dev/null @@ -1,92 +0,0 @@ -// @flow -import * as React from "react"; - -import BadgePrimitive from "../primitives/BadgePrimitive"; -import { TYPE_OPTIONS, TOKENS } from "./consts"; -import useTheme from "../hooks/useTheme"; - -import type { Props } from "."; - -const getTypeToken = ({ name, theme, type }) => { - const tokens = { - [TOKENS.background]: { - [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudLight, - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLight, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLight, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLight, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLight, - [TYPE_OPTIONS.DARK]: theme.orbit.paletteInkDark, - [TYPE_OPTIONS.WHITE]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.INFO_INVERTED]: theme.orbit.paletteBlueNormal, - [TYPE_OPTIONS.CRITICAL_INVERTED]: theme.orbit.paletteRedNormal, - [TYPE_OPTIONS.SUCCESS_INVERTED]: theme.orbit.paletteGreenNormal, - [TYPE_OPTIONS.WARNING_INVERTED]: theme.orbit.paletteOrangeNormal, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundBadgeBundleBasic, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundBadgeBundleMedium, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundBadgeBundleTop, - }, - [TOKENS.color]: { - [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteInkDark, - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueDark, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenDark, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeDark, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedDark, - [TYPE_OPTIONS.DARK]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.WHITE]: theme.orbit.paletteInkDark, - [TYPE_OPTIONS.INFO_INVERTED]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.CRITICAL_INVERTED]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.SUCCESS_INVERTED]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.WARNING_INVERTED]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, - }, - [TOKENS.border]: { - [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudNormal, - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLightHover, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLightHover, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLightHover, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLightHover, - [TYPE_OPTIONS.DARK]: null, - [TYPE_OPTIONS.WHITE]: theme.orbit.paletteCloudNormal, - [TYPE_OPTIONS.INFO_INVERTED]: null, - [TYPE_OPTIONS.CRITICAL_INVERTED]: null, - [TYPE_OPTIONS.SUCCESS_INVERTED]: null, - [TYPE_OPTIONS.WARNING_INVERTED]: null, - [TYPE_OPTIONS.BUNDLE_BASIC]: null, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: null, - [TYPE_OPTIONS.BUNDLE_TOP]: null, - }, - }; - return tokens[name][type]; -}; - -const Badge = ({ - type = TYPE_OPTIONS.NEUTRAL, - border = true, - icon, - children, - ariaLabel, - dataTest, - id, - carriers, -}: Props): React.Node => { - const theme = useTheme(); - - return ( - - {children} - - ); -}; - -export default Badge; diff --git a/packages/orbit-components/src/Badge/index.jsx.flow b/packages/orbit-components/src/Badge/index.jsx.flow deleted file mode 100644 index 278543d6da..0000000000 --- a/packages/orbit-components/src/Badge/index.jsx.flow +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/badge/ -*/ -import * as React from "react"; - -import type { Carrier } from "../CarrierLogo"; -import type { Globals } from "../common/common.js.flow"; - -export type Type = - | "neutral" - | "dark" - | "info" - | "success" - | "warning" - | "critical" - | "white" - | "infoInverted" - | "criticalInverted" - | "successInverted" - | "warningInverted" - | "bundleBasic" - | "bundleMedium" - | "bundleTop"; - -export type Props = {| - +children?: React.Node, - +carriers?: Carrier[], - +border?: boolean, - +type?: Type, - +icon?: React.Node, - +ariaLabel?: string, - ...Globals, -|}; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Badge/index.tsx b/packages/orbit-components/src/Badge/index.tsx new file mode 100644 index 0000000000..36f9bf760d --- /dev/null +++ b/packages/orbit-components/src/Badge/index.tsx @@ -0,0 +1,90 @@ +import React from "react"; + +import BadgePrimitive from "../primitives/BadgePrimitive"; +import { TYPE_OPTIONS, TOKENS } from "./consts"; +import useTheme from "../hooks/useTheme"; +import { Props } from "./types"; + +const getTypeToken = ({ name, theme, type }) => { + const tokens = { + [TOKENS.background]: { + [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudLight, + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLight, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLight, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLight, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLight, + [TYPE_OPTIONS.DARK]: theme.orbit.paletteInkDark, + [TYPE_OPTIONS.WHITE]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.INFO_INVERTED]: theme.orbit.paletteBlueNormal, + [TYPE_OPTIONS.CRITICAL_INVERTED]: theme.orbit.paletteRedNormal, + [TYPE_OPTIONS.SUCCESS_INVERTED]: theme.orbit.paletteGreenNormal, + [TYPE_OPTIONS.WARNING_INVERTED]: theme.orbit.paletteOrangeNormal, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundBadgeBundleBasic, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundBadgeBundleMedium, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundBadgeBundleTop, + }, + [TOKENS.color]: { + [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteInkDark, + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueDark, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenDark, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeDark, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedDark, + [TYPE_OPTIONS.DARK]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.WHITE]: theme.orbit.paletteInkDark, + [TYPE_OPTIONS.INFO_INVERTED]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.CRITICAL_INVERTED]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.SUCCESS_INVERTED]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.WARNING_INVERTED]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, + }, + [TOKENS.border]: { + [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudNormal, + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLightHover, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLightHover, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLightHover, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLightHover, + [TYPE_OPTIONS.DARK]: null, + [TYPE_OPTIONS.WHITE]: theme.orbit.paletteCloudNormal, + [TYPE_OPTIONS.INFO_INVERTED]: null, + [TYPE_OPTIONS.CRITICAL_INVERTED]: null, + [TYPE_OPTIONS.SUCCESS_INVERTED]: null, + [TYPE_OPTIONS.WARNING_INVERTED]: null, + [TYPE_OPTIONS.BUNDLE_BASIC]: null, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: null, + [TYPE_OPTIONS.BUNDLE_TOP]: null, + }, + }; + return tokens[name][type]; +}; + +const Badge = ({ + type = TYPE_OPTIONS.NEUTRAL, + border = true, + icon, + children, + ariaLabel, + dataTest, + id, + carriers, +}: Props) => { + const theme = useTheme(); + + return ( + + {children} + + ); +}; + +export default Badge; diff --git a/packages/orbit-components/src/Badge/types.ts b/packages/orbit-components/src/Badge/types.ts new file mode 100644 index 0000000000..155db3dfa1 --- /dev/null +++ b/packages/orbit-components/src/Badge/types.ts @@ -0,0 +1,31 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit +import React from "react"; + +import { Carrier } from "../CarrierLogo/types"; +import * as Common from "../common/types"; + +export type Type = + | "neutral" + | "dark" + | "info" + | "success" + | "warning" + | "critical" + | "white" + | "infoInverted" + | "criticalInverted" + | "successInverted" + | "warningInverted" + | "bundleBasic" + | "bundleMedium" + | "bundleTop"; + +export interface Props extends Common.Globals { + readonly children?: React.ReactNode; + readonly type?: Type; + readonly border?: boolean; + readonly carriers?: Carrier[]; + readonly icon?: React.ReactNode; + readonly ariaLabel?: string; +} diff --git a/packages/orbit-components/src/BadgeList/BadgeList.stories.jsx b/packages/orbit-components/src/BadgeList/BadgeList.stories.jsx deleted file mode 100644 index 44d2afd88e..0000000000 --- a/packages/orbit-components/src/BadgeList/BadgeList.stories.jsx +++ /dev/null @@ -1,106 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, select, boolean } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import Tooltip from "../Tooltip"; -import TextLink from "../TextLink"; -import TYPE_OPTIONS from "./consts"; -import Text from "../Text"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; - -import BadgeList, { BadgeListItem } from "."; - -export default { - title: "BadgeList", -}; - -export const Default = (): React.Node => { - return ( - - }> - You're departing from a different place - - }> - You must collect and recheck your baggage - - - ); -}; - -export const Types = (): React.Node => { - const component = type => ( - } type={type}> - - Transfer protected - {" "} - by the Kiwi.com Guarantee - - ); - return ( - - {component(TYPE_OPTIONS.NEUTRAL)} - {component(TYPE_OPTIONS.INFO)} - {component(TYPE_OPTIONS.SUCCESS)} - {component(TYPE_OPTIONS.WARNING)} - {component(TYPE_OPTIONS.CRITICAL)} - - ); -}; - -export const Playground = (): React.Node => { - const dataTest = text("dataTest", "test"); - const type = select("type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.NEUTRAL); - const strikeThrough = boolean("strikeThrough", false); - - return ( - - } type={type} strikeThrough={strikeThrough}> - You're departing from a different place - - } type={type} strikeThrough={strikeThrough}> - - Self transfer at Vienna - {" "} - is your responsibility - - } type={type} strikeThrough={strikeThrough}> - - Transfer protected - {" "} - by the Kiwi.com Guarantee - - - ); -}; - -Playground.story = { - parameters: { - info: "Here you can try BadgeList component with additional functionality.", - }, -}; - -export const RTL = (): React.Node => { - return ( - - - }> - You're departing from a different place - - }> - - Self transfer at Vienna - {" "} - is your responsibility - - }> - - Transfer protected - {" "} - by the Kiwi.com Guarantee - - - - ); -}; diff --git a/packages/orbit-components/src/BadgeList/BadgeList.stories.tsx b/packages/orbit-components/src/BadgeList/BadgeList.stories.tsx new file mode 100644 index 0000000000..fb2c9e12d5 --- /dev/null +++ b/packages/orbit-components/src/BadgeList/BadgeList.stories.tsx @@ -0,0 +1,105 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, select, boolean } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import Tooltip from "../Tooltip"; +import TextLink from "../TextLink"; +import { TYPE_OPTIONS } from "./consts"; +import Text from "../Text"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; + +import BadgeList, { BadgeListItem } from "."; + +export default { + title: "BadgeList", +}; + +export const Default = () => { + return ( + + }> + You're departing from a different place + + }> + You must collect and recheck your baggage + + + ); +}; + +export const Types = () => { + const component = type => ( + } type={type}> + + Transfer protected + {" "} + by the Kiwi.com Guarantee + + ); + return ( + + {component(TYPE_OPTIONS.NEUTRAL)} + {component(TYPE_OPTIONS.INFO)} + {component(TYPE_OPTIONS.SUCCESS)} + {component(TYPE_OPTIONS.WARNING)} + {component(TYPE_OPTIONS.CRITICAL)} + + ); +}; + +export const Playground = () => { + const dataTest = text("dataTest", "test"); + const type = select("type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.NEUTRAL); + const strikeThrough = boolean("strikeThrough", false); + + return ( + + } type={type} strikeThrough={strikeThrough}> + You're departing from a different place + + } type={type} strikeThrough={strikeThrough}> + + Self transfer at Vienna + {" "} + is your responsibility + + } type={type} strikeThrough={strikeThrough}> + + Transfer protected + {" "} + by the Kiwi.com Guarantee + + + ); +}; + +Playground.story = { + parameters: { + info: "Here you can try BadgeList component with additional functionality.", + }, +}; + +export const RTL = () => { + return ( + + + }> + You're departing from a different place + + }> + + Self transfer at Vienna + {" "} + is your responsibility + + }> + + Transfer protected + {" "} + by the Kiwi.com Guarantee + + + + ); +}; diff --git a/packages/orbit-components/src/BadgeList/BadgeListItem/index.d.ts b/packages/orbit-components/src/BadgeList/BadgeListItem/index.d.ts deleted file mode 100644 index 64cb09c069..0000000000 --- a/packages/orbit-components/src/BadgeList/BadgeListItem/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; -import { AnyStyledComponent } from "styled-components"; - -import * as Common from "../../common/common"; - -export type Type = "neutral" | "info" | "success" | "warning" | "critical"; - -export interface Props extends Common.Global { - readonly children: React.ReactNode; - readonly type?: Type; - readonly strikeThrough?: boolean; - readonly icon: React.ReactNode; -} - -declare const getIconColor: (type: Type) => string; -declare const BadgeListItem: React.FunctionComponent; -declare const StyledBadgeListItem: AnyStyledComponent; -declare const StyledVerticalBadge: AnyStyledComponent; -declare const StyledBadgeContent: AnyStyledComponent; - -export { - BadgeListItem, - StyledBadgeListItem, - StyledVerticalBadge, - getIconColor, - StyledBadgeContent, - BadgeListItem as default, -}; diff --git a/packages/orbit-components/src/BadgeList/BadgeListItem/index.jsx.flow b/packages/orbit-components/src/BadgeList/BadgeListItem/index.js.flow similarity index 100% rename from packages/orbit-components/src/BadgeList/BadgeListItem/index.jsx.flow rename to packages/orbit-components/src/BadgeList/BadgeListItem/index.js.flow diff --git a/packages/orbit-components/src/BadgeList/BadgeListItem/index.jsx b/packages/orbit-components/src/BadgeList/BadgeListItem/index.jsx deleted file mode 100644 index a861d84360..0000000000 --- a/packages/orbit-components/src/BadgeList/BadgeListItem/index.jsx +++ /dev/null @@ -1,111 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import Text, { StyledText } from "../../Text"; -import TYPE_OPTIONS from "../consts"; -import defaultTheme from "../../defaultTheme"; -import { ICON_COLORS } from "../../Icon/consts"; -import { StyledTooltipChildren } from "../../primitives/TooltipPrimitive"; -import { right } from "../../utils/rtl"; - -import type { Props, Type } from "."; - -const getBackground = ({ theme, $type }) => { - const tokens = { - [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudLight, - [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLight, - [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLight, - [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLight, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLight, - }; - return tokens[$type]; -}; - -export const getIconColor = (type: Type): string => { - if (type === TYPE_OPTIONS.NEUTRAL) return ICON_COLORS.SECONDARY; - return type; -}; - -export const StyledBadgeListItem: any = styled.li` - ${({ theme }) => css` - display: flex; - flex-direction: row; - width: 100%; - & + & { - margin-top: ${theme.orbit.spaceXXSmall}; - } - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledBadgeListItem.defaultProps = { - theme: defaultTheme, -}; - -export const StyledVerticalBadge: any = styled.div` - ${({ theme }) => css` - background: ${getBackground}; - display: flex; - align-items: center; - justify-content: center; - margin-${right}: ${theme.orbit.spaceXSmall}; - flex-shrink: 0; - height: ${theme.orbit.heightIconMedium}; - width: ${theme.orbit.widthIconMedium}; - border-radius: ${theme.orbit.borderRadiusCircle}; - svg { - height: ${theme.orbit.heightIconSmall}; - width: ${theme.orbit.widthIconSmall}; - } - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledVerticalBadge.defaultProps = { - theme: defaultTheme, -}; - -export const StyledBadgeContent: any = styled.div` - ${({ theme }) => css` - display: inline-flex; - align-items: center; - &, - ${StyledText} { - font-size: ${theme.orbit.fontSizeTextSmall}; - line-height: ${theme.orbit.lineHeightTextSmall}; - } - - ${StyledTooltipChildren} ${StyledText} { - font-weight: ${theme.orbit.fontWeightMedium}; - } - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledBadgeContent.defaultProps = { - theme: defaultTheme, -}; - -const BadgeListItem = ({ - icon, - strikeThrough, - type = TYPE_OPTIONS.NEUTRAL, - dataTest, - children, -}: Props): React.Node => { - return ( - - - {React.isValidElement(icon) && React.cloneElement(icon, { color: getIconColor(type) })} - - - - {children} - - - - ); -}; - -export default BadgeListItem; diff --git a/packages/orbit-components/src/BadgeList/BadgeListItem/index.tsx b/packages/orbit-components/src/BadgeList/BadgeListItem/index.tsx new file mode 100644 index 0000000000..df25fb21d3 --- /dev/null +++ b/packages/orbit-components/src/BadgeList/BadgeListItem/index.tsx @@ -0,0 +1,113 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import Text, { StyledText } from "../../Text"; +import { TYPE_OPTIONS } from "../consts"; +import defaultTheme from "../../defaultTheme"; +import { ICON_COLORS } from "../../Icon/consts"; +import { StyledTooltipChildren } from "../../primitives/TooltipPrimitive"; +import { right } from "../../utils/rtl"; +import { Props, Type } from "./types"; +import { Props as IconProps } from "../../Icon/types"; + +const getBackground = ({ theme, $type }: { theme: typeof defaultTheme; $type?: Type }) => { + const tokens = { + [TYPE_OPTIONS.NEUTRAL]: theme.orbit.paletteCloudLight, + [TYPE_OPTIONS.INFO]: theme.orbit.paletteBlueLight, + [TYPE_OPTIONS.SUCCESS]: theme.orbit.paletteGreenLight, + [TYPE_OPTIONS.WARNING]: theme.orbit.paletteOrangeLight, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.paletteRedLight, + }; + + if (!$type) return null; + + return tokens[$type]; +}; + +export const getIconColor = (type: Type) => { + if (type === TYPE_OPTIONS.NEUTRAL) return ICON_COLORS.SECONDARY; + return type; +}; + +export const StyledBadgeListItem = styled.li` + ${({ theme }) => css` + display: flex; + flex-direction: row; + width: 100%; + & + & { + margin-top: ${theme.orbit.spaceXXSmall}; + } + `}; +`; + +StyledBadgeListItem.defaultProps = { + theme: defaultTheme, +}; + +export const StyledVerticalBadge = styled.div<{ $type?: Props["type"] }>` + ${({ theme, $type }) => css` + background: ${getBackground({ theme, $type })}; + display: flex; + align-items: center; + justify-content: center; + margin-${right}: ${theme.orbit.spaceXSmall}; + flex-shrink: 0; + height: ${theme.orbit.heightIconMedium}; + width: ${theme.orbit.widthIconMedium}; + border-radius: ${theme.orbit.borderRadiusCircle}; + svg { + height: ${theme.orbit.heightIconSmall}; + width: ${theme.orbit.widthIconSmall}; + } + `}; +`; + +StyledVerticalBadge.defaultProps = { + theme: defaultTheme, +}; + +export const StyledBadgeContent = styled.div` + ${({ theme }) => css` + display: inline-flex; + align-items: center; + &, + ${StyledText} { + font-size: ${theme.orbit.fontSizeTextSmall}; + line-height: ${theme.orbit.lineHeightTextSmall}; + } + + ${StyledTooltipChildren} ${StyledText} { + font-weight: ${theme.orbit.fontWeightMedium}; + } + `}; +`; + +StyledBadgeContent.defaultProps = { + theme: defaultTheme, +}; + +const BadgeListItem = ({ + icon, + strikeThrough, + type = TYPE_OPTIONS.NEUTRAL, + dataTest, + children, +}: Props) => { + return ( + + + {React.isValidElement(icon) && + React.cloneElement(icon as React.ReactElement, { + color: getIconColor(type), + })} + + + + {children} + + + + ); +}; + +export default BadgeListItem; diff --git a/packages/orbit-components/src/BadgeList/BadgeListItem/types.ts b/packages/orbit-components/src/BadgeList/BadgeListItem/types.ts new file mode 100644 index 0000000000..249f892c40 --- /dev/null +++ b/packages/orbit-components/src/BadgeList/BadgeListItem/types.ts @@ -0,0 +1,13 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit +import * as React from "react"; + +import * as Common from "../../common/types"; + +export type Type = "neutral" | "info" | "success" | "warning" | "critical"; +export interface Props extends Common.Globals { + readonly children: React.ReactNode; + readonly type?: Type; + readonly strikeThrough?: boolean; + readonly icon: React.ReactNode; +} diff --git a/packages/orbit-components/src/BadgeList/__tests__/index.test.jsx b/packages/orbit-components/src/BadgeList/__tests__/index.test.jsx deleted file mode 100644 index 3dfba1d1bb..0000000000 --- a/packages/orbit-components/src/BadgeList/__tests__/index.test.jsx +++ /dev/null @@ -1,24 +0,0 @@ -// @flow -import * as React from "react"; -import { screen, render } from "@testing-library/react"; - -import BadgeList, { BadgeListItem } from ".."; -import Airplane from "../../icons/Airplane"; - -describe("BadgeList", () => { - it("should have expected DOM output", () => { - const dataTest = "test"; - const childrenDataTest = "childrenTest"; - const childrenText = "Lorem ipsum dolor sit amet"; - render( - - } dataTest={childrenDataTest}> - {childrenText} - - , - ); - expect(screen.getByTestId(dataTest)).toBeInTheDocument(); - expect(screen.getByTestId(childrenDataTest)).toBeInTheDocument(); - expect(screen.getByText(childrenText)).toBeInTheDocument(); - }); -}); diff --git a/packages/orbit-components/src/BadgeList/__tests__/index.test.tsx b/packages/orbit-components/src/BadgeList/__tests__/index.test.tsx new file mode 100644 index 0000000000..b2a29c0a20 --- /dev/null +++ b/packages/orbit-components/src/BadgeList/__tests__/index.test.tsx @@ -0,0 +1,23 @@ +import * as React from "react"; +import { screen, render } from "@testing-library/react"; + +import BadgeList, { BadgeListItem } from ".."; +import Airplane from "../../icons/Airplane"; + +describe("BadgeList", () => { + it("should have expected DOM output", () => { + const dataTest = "test"; + const childrenDataTest = "childrenTest"; + const childrenText = "Lorem ipsum dolor sit amet"; + render( + + } dataTest={childrenDataTest}> + {childrenText} + + , + ); + expect(screen.getByTestId(dataTest)).toBeInTheDocument(); + expect(screen.getByTestId(childrenDataTest)).toBeInTheDocument(); + expect(screen.getByText(childrenText)).toBeInTheDocument(); + }); +}); diff --git a/packages/orbit-components/src/BadgeList/consts.js b/packages/orbit-components/src/BadgeList/consts.js deleted file mode 100644 index 45f7e86c6c..0000000000 --- a/packages/orbit-components/src/BadgeList/consts.js +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -export default { - NEUTRAL: "neutral", - INFO: "info", - SUCCESS: "success", - WARNING: "warning", - CRITICAL: "critical", -}; diff --git a/packages/orbit-components/src/BadgeList/consts.ts b/packages/orbit-components/src/BadgeList/consts.ts new file mode 100644 index 0000000000..2a91fd5058 --- /dev/null +++ b/packages/orbit-components/src/BadgeList/consts.ts @@ -0,0 +1,7 @@ +export enum TYPE_OPTIONS { + NEUTRAL = "neutral", + INFO = "info", + SUCCESS = "success", + WARNING = "warning", + CRITICAL = "critical", +} diff --git a/packages/orbit-components/src/BadgeList/index.d.ts b/packages/orbit-components/src/BadgeList/index.d.ts deleted file mode 100644 index db51080d87..0000000000 --- a/packages/orbit-components/src/BadgeList/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; -import BadgeListItem from "./BadgeListItem"; - -export interface Props extends Common.Global { - readonly children: React.ReactNode; -} - -declare const BadgeList: React.FunctionComponent; - -export { BadgeList, BadgeList as default, BadgeListItem }; diff --git a/packages/orbit-components/src/BadgeList/index.js.flow b/packages/orbit-components/src/BadgeList/index.js.flow new file mode 100644 index 0000000000..2e093f94ea --- /dev/null +++ b/packages/orbit-components/src/BadgeList/index.js.flow @@ -0,0 +1,17 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/badgelist/ +*/ +import * as React from "react"; + +import type { Globals } from "../common/common.js.flow"; +import type { Props as BadgeListItemProps } from "./BadgeListItem/index.js.flow"; + +export type Props = {| + +children: React.Node, + ...Globals, +|}; + +declare export var BadgeListItem: React.ComponentType; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/BadgeList/index.jsx b/packages/orbit-components/src/BadgeList/index.jsx deleted file mode 100644 index 7b64084536..0000000000 --- a/packages/orbit-components/src/BadgeList/index.jsx +++ /dev/null @@ -1,23 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import type { Props } from "."; - -const StyledBadgeList = styled.ul` - margin: 0; - padding: 0; - display: flex; - flex-direction: column; -`; - -const BadgeList = ({ children, dataTest, id }: Props): React.Node => { - return ( - - {children} - - ); -}; - -export { default as BadgeListItem } from "./BadgeListItem"; -export default BadgeList; diff --git a/packages/orbit-components/src/BadgeList/index.jsx.flow b/packages/orbit-components/src/BadgeList/index.jsx.flow deleted file mode 100644 index 3195d6a2af..0000000000 --- a/packages/orbit-components/src/BadgeList/index.jsx.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/badgelist/ -*/ -import * as React from "react"; - -import type { Globals } from "../common/common.js.flow"; -import type { Props as BadgeListItemProps } from "./BadgeListItem"; - -export type Props = {| - +children: React.Node, - ...Globals, -|}; - -declare export var BadgeListItem: React.ComponentType; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/BadgeList/index.tsx b/packages/orbit-components/src/BadgeList/index.tsx new file mode 100644 index 0000000000..2c72ed495f --- /dev/null +++ b/packages/orbit-components/src/BadgeList/index.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import styled from "styled-components"; + +import { Props } from "./types"; + +const StyledBadgeList = styled.ul` + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +`; + +const BadgeList = ({ children, dataTest, id }: Props) => { + return ( + + {children} + + ); +}; + +export { default as BadgeListItem } from "./BadgeListItem"; +export default BadgeList; diff --git a/packages/orbit-components/src/BadgeList/types.ts b/packages/orbit-components/src/BadgeList/types.ts new file mode 100644 index 0000000000..7fe780b5ee --- /dev/null +++ b/packages/orbit-components/src/BadgeList/types.ts @@ -0,0 +1,10 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly children: React.ReactNode; +} diff --git a/packages/orbit-components/src/BaggageStepper/Stepper.stories.jsx b/packages/orbit-components/src/BaggageStepper/Stepper.stories.jsx deleted file mode 100644 index bb13b8139e..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper.stories.jsx +++ /dev/null @@ -1,65 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, number, boolean } from "@storybook/addon-knobs"; - -import BaggageStepper from "."; - -export default { - title: "BaggageStepper", -}; - -export const Default = (): React.Node => { - const titleIncrement = text("Title increment", "Add a passenger"); - const titleDecrement = text("Title decrement", "Remove a passenger"); - - return ( - - ); -}; - -Default.story = { - parameters: { - info: "Some description about this type of BaggageStepper in general.", - }, -}; - -export const Playground = (): React.Node => { - const min = number("minValue", 1); - const max = number("maxValue", 10); - const step = number("step", 2); - const defaultValue = number("defaultValue", 4); - const name = text("Name", "name"); - const disabled = boolean("disabled", false); - const selected = boolean("selected", false); - const dataTest = text("dataTest", "test"); - const titleIncrement = text("Title increment", "Add a passenger"); - const titleDecrement = text("Title decrement", "Remove a passenger"); - return ( - - ); -}; - -Playground.story = { - parameters: { - info: "Here you can try BaggageStepper component with additional functionality.", - }, -}; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper.stories.tsx b/packages/orbit-components/src/BaggageStepper/Stepper.stories.tsx new file mode 100644 index 0000000000..a0669fc9fc --- /dev/null +++ b/packages/orbit-components/src/BaggageStepper/Stepper.stories.tsx @@ -0,0 +1,64 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, number, boolean } from "@storybook/addon-knobs"; + +import BaggageStepper from "."; + +export default { + title: "BaggageStepper", +}; + +export const Default = () => { + const titleIncrement = text("Title increment", "Add a passenger"); + const titleDecrement = text("Title decrement", "Remove a passenger"); + + return ( + + ); +}; + +Default.story = { + parameters: { + info: "Some description about this type of BaggageStepper in general.", + }, +}; + +export const Playground = () => { + const min = number("minValue", 1); + const max = number("maxValue", 10); + const step = number("step", 2); + const defaultValue = number("defaultValue", 4); + const name = text("Name", "name"); + const disabled = boolean("disabled", false); + const selected = boolean("selected", false); + const dataTest = text("dataTest", "test"); + const titleIncrement = text("Title increment", "Add a passenger"); + const titleDecrement = text("Title decrement", "Remove a passenger"); + return ( + + ); +}; + +Playground.story = { + parameters: { + info: "Here you can try BaggageStepper component with additional functionality.", + }, +}; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/Button.jsx b/packages/orbit-components/src/BaggageStepper/Stepper/Button.jsx deleted file mode 100644 index 444b34a8c1..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper/Button.jsx +++ /dev/null @@ -1,60 +0,0 @@ -// @flow -import * as React from "react"; - -import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; -import getBoxShadow from "./helpers/getBoxShadow"; -import getPadding from "../../primitives/ButtonPrimitive/common/getPadding"; -import useTheme from "../../hooks/useTheme"; -import type { Props as PrimitiveProps } from "../../primitives/ButtonPrimitive"; -import ButtonPrimitive from "../../primitives/ButtonPrimitive"; -import { ICON_SIZE, BUTTON_SIZE } from "./consts"; - -type Props = {| - +selected?: boolean, - ...PrimitiveProps, -|}; - -const Button = ({ - selected, - iconLeft, - iconRight, - disabled, - height = BUTTON_SIZE, - width = BUTTON_SIZE, - children, - ...props -}: Props): React.Node => { - const theme = useTheme(); - const onlyIcon = Boolean(iconLeft && !children); - const padding = getPadding(onlyIcon, iconRight, iconLeft, "small", theme); - const wrappedBoxShadow = state => getBoxShadow({ state, disabled, theme, selected }); - - const boxShadow = { - boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), - boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), - boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), - boxShadowFocus: wrappedBoxShadow(BUTTON_STATES.FOCUS), - }; - - return ( - - ); -}; - -export default Button; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/Button.tsx b/packages/orbit-components/src/BaggageStepper/Stepper/Button.tsx new file mode 100644 index 0000000000..4ecad69ecf --- /dev/null +++ b/packages/orbit-components/src/BaggageStepper/Stepper/Button.tsx @@ -0,0 +1,58 @@ +import * as React from "react"; + +import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; +import getBoxShadow from "./helpers/getBoxShadow"; +import getPadding from "../../primitives/ButtonPrimitive/common/getPadding"; +import useTheme from "../../hooks/useTheme"; +import { Props as PrimitiveProps } from "../../primitives/ButtonPrimitive/types"; +import ButtonPrimitive from "../../primitives/ButtonPrimitive"; +import { ICON_SIZE, BUTTON_SIZE } from "./consts"; + +interface Props extends PrimitiveProps { + readonly selected?: boolean; +} + +const Button = ({ + selected, + iconLeft, + iconRight, + disabled, + height = BUTTON_SIZE, + width = BUTTON_SIZE, + children, + ...props +}: Props) => { + const theme = useTheme(); + const onlyIcon = Boolean(iconLeft && !children); + const padding = getPadding(onlyIcon, iconRight, iconLeft, "small", theme); + const wrappedBoxShadow = state => getBoxShadow({ state, disabled, theme, selected }); + + const boxShadow = { + boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), + boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), + boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), + boxShadowFocus: wrappedBoxShadow(BUTTON_STATES.FOCUS), + }; + + return ( + + ); +}; + +export default Button; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/consts.js b/packages/orbit-components/src/BaggageStepper/Stepper/consts.js deleted file mode 100644 index 15e22803f9..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper/consts.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -export const ICON_SIZE = "10px"; -export const BUTTON_SIZE = "20px"; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/consts.ts b/packages/orbit-components/src/BaggageStepper/Stepper/consts.ts new file mode 100644 index 0000000000..f9c4d6fe75 --- /dev/null +++ b/packages/orbit-components/src/BaggageStepper/Stepper/consts.ts @@ -0,0 +1,2 @@ +export const ICON_SIZE = "10px"; +export const BUTTON_SIZE = "20px"; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.js b/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.js deleted file mode 100644 index 6e9b6a485c..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import type { Theme } from "../../../defaultTheme"; -import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; - -type Args = {| - state: string, - disabled?: boolean, - theme: Theme, - selected?: boolean, -|}; - -const getButtonBoxShadow = ({ state, disabled, theme, selected }: Args): string | null => { - if (disabled) return null; - - if (state === BUTTON_STATES.FOCUS) { - return `0 0 0 2px ${ - selected - ? convertHexToRgba(theme.orbit.paletteBlueNormal, 30) - : convertHexToRgba(theme.orbit.paletteInkNormal, 30) - }}`; - } - - return null; -}; - -export default getButtonBoxShadow; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.ts b/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.ts new file mode 100644 index 0000000000..72f820a95c --- /dev/null +++ b/packages/orbit-components/src/BaggageStepper/Stepper/helpers/getBoxShadow.ts @@ -0,0 +1,27 @@ +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import type { Theme } from "../../../defaultTheme"; +import { BUTTON_STATES } from "../../../primitives/ButtonPrimitive/common/consts"; + +interface Args { + readonly state: string; + readonly disabled?: boolean; + readonly theme: Theme; + readonly selected?: boolean; +} + +const getButtonBoxShadow = ({ state, disabled, theme, selected }: Args): string | null => { + if (disabled) return null; + + if (state === BUTTON_STATES.FOCUS) { + return `0 0 0 2px ${ + selected + ? convertHexToRgba(theme.orbit.paletteBlueNormal, 30) + : convertHexToRgba(theme.orbit.paletteInkNormal, 30) + }}`; + } + + return null; +}; + +export default getButtonBoxShadow; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/index.d.ts b/packages/orbit-components/src/BaggageStepper/Stepper/index.d.ts deleted file mode 100644 index 44e16d0c62..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../../common/common"; -import { SharedProps, Event } from ".."; - -type InputEvent = Common.Event>; -export interface Props extends SharedProps { - readonly value?: number | string | (() => string); - readonly disabledIncrement?: boolean; - readonly disabledDecrement?: boolean; - readonly onKeyDown?: InputEvent; - readonly onDecrement?: Event; - readonly onIncrement?: Event; - readonly onChange?: InputEvent; - readonly selected?: boolean; -} - -declare const StepperStateless: React.FunctionComponent; -export { StepperStateless, StepperStateless as default }; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/index.js.flow b/packages/orbit-components/src/BaggageStepper/Stepper/index.js.flow new file mode 100644 index 0000000000..29a254799e --- /dev/null +++ b/packages/orbit-components/src/BaggageStepper/Stepper/index.js.flow @@ -0,0 +1,24 @@ +// @flow +import * as React from "react"; + +import type { SharedProps } from "../index.js.flow"; + +export type StateLessProps = {| + ...SharedProps, + +value: number | string | (() => string), + +disabledIncrement?: boolean, + +disabledDecrement?: boolean, + +onKeyDown?: (ev: SyntheticKeyboardEvent) => void | Promise, + +onDecrement?: ( + ev: SyntheticEvent | SyntheticKeyboardEvent, + ) => void | Promise, + +onIncrement?: ( + ev: SyntheticEvent | SyntheticKeyboardEvent, + ) => void | Promise, + +onChange?: (SyntheticInputEvent) => void | Promise, + +selected?: boolean, +|}; + +export type StepperStatelessType = React.ComponentType; + +declare export default StepperStatelessType; diff --git a/packages/orbit-components/src/BaggageStepper/Stepper/index.jsx b/packages/orbit-components/src/BaggageStepper/Stepper/index.jsx deleted file mode 100644 index 68b7d1b868..0000000000 --- a/packages/orbit-components/src/BaggageStepper/Stepper/index.jsx +++ /dev/null @@ -1,117 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import Button from "./Button"; -import Minus from "../../icons/Minus"; -import Plus from "../../icons/Plus"; -import defaultTheme from "../../defaultTheme"; - -import type { StateLessProps } from "."; - -const StyledStepper = styled.div` - display: flex; - align-items: center; - width: 100%; - flex: 1 1 auto; -`; - -const StyledStepperInput = styled.input` - ${({ theme }) => css` - width: 100%; - height: 22px; - padding: 0; - border: 0; - font-size: ${theme.orbit.fontSizeTextLarge}; - font-weight: ${theme.orbit.fontWeightBold}; - color: ${theme.orbit.paletteInkDark}; - text-align: center; - min-width: 0; - - &:disabled { - background-color: transparent; - } - &::-webkit-inner-spin-button, - &::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; - } - - &:focus { - outline: none; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledStepperInput.defaultProps = { - theme: defaultTheme, -}; - -const StepperStateless = ({ - selected, - disabled, - dataTest, - value, - name, - minValue, - maxValue, - onKeyDown, - onBlur, - onFocus, - onIncrement, - onDecrement, - titleIncrement, - titleDecrement, - disabledIncrement, - disabledDecrement, -}: StateLessProps): React.Node => { - return ( - -
; -}; - -Default.story = { - parameters: { - info: - "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const BasicButtons = (): React.Node => { - const children = text("Children", "Button"); - const fullWidth = boolean("fullWidth", false); - const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], "primary"); - const size = select("Size", Object.values(SIZE_OPTIONS), "normal"); - - return ( - - ); -}; - -BasicButtons.story = { - name: "Basic buttons", - - parameters: { - info: - "Basic buttons have three sizes (large, normal and small) and can be either primary or secondary type. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const ButtonWithIcons = (): React.Node => { - const children = text("Children", "Button"); - const fullWidth = boolean("fullWidth", false); - const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], "primary"); - const size = select("Size", Object.values(SIZE_OPTIONS), "small"); - const IconLeft = getIcon(getIcons("iconLeft", "PlusCircle")); - const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); - return ( - - ); -}; - -ButtonWithIcons.story = { - name: "Button with icons", - - parameters: { - info: - "Buttons with icon are great when you need to draw more attention to the action. However, it's essential to not over-use these buttons. If everything tries to grab attention, things usually get messy. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SubtleButtons = (): React.Node => { - const children = text("Children", "Button"); - const IconLeft = getIcon(getIcons("iconLeft", "CloseCircle")); - - return ( - - - - - ); -}; - -SubtleButtons.story = { - name: "Subtle buttons", - - parameters: { - info: - "We use status buttons exclusively in Alert messages when we need to show supporting action connected to the displayed message. We only use the small size of buttons. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CircledButton = (): React.Node => { - const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.NORMAL); - const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], TYPE_OPTIONS.PRIMARY); - const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); - - return ( - - ); -}; - -DestructiveButtons.story = { - name: "Destructive buttons", - - parameters: { - info: - "Destructive buttons are a specific version of critical status buttons, paired together with 'Remove' icon. We use them when we need to inform our users about possible dangerous actions (canceling a booking, removing an item, etc.). Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const ButtonAsALink = (): React.Node => { - const children = text("Children", "I am a link"); - const href = text("Href", "https://kiwi.com"); - const external = boolean("External", false); - const disabled = boolean("Disabled", false); - const size = select("Size", Object.values(SIZE_OPTIONS), "normal"); - - return ( - - ); -}; - -ButtonAsALink.story = { - name: "Button as a link", - - parameters: { - info: - "If you need to, you can pass some href to this component and it will automatically render into anchor.", - }, -}; - -export const Playground = (): React.Node => { - const children = text("Children", "Button"); - const href = text("Href", undefined); - const external = boolean("External", false); - const asComponent = text("asComponent", "button"); - const disabled = boolean("Disabled", false); - const fullWidth = boolean("fullWidth", false); - const type = select("Type", Object.values(TYPE_OPTIONS), "primary"); - const size = select("Size", Object.values(SIZE_OPTIONS), "normal"); - const width = number("Width", 0); - const circled = boolean("Circled", false); - const loading = boolean("Loading", false); - const submit = boolean("Submit", false); - const dataTest = text("dataTest", "test"); - const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); - const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); - const ariaExpanded = boolean("Aria expanded", false); - const ariaControls = text("Aria controls", "element ID"); - const tabIndex = text("tabIndex", "0"); - const spaceAfter = select("spaceAfter", [null, ...Object.values(SPACINGS_AFTER)]); - const title = text("Title", "Additional information for accessibility"); - const rel = text("Rel", "nofollow"); - const contentAlign = select( - "contentAlign", - ["start", "center", "end", "space-between"], - "center", - ); - const contentWidth = text("contentWidth", "100%"); - - return ( - - ); -}; - -Playground.story = { - parameters: { - info: "Some description about this type of component. ", - }, -}; - -export const Accessibility = (): React.Node => { - const children = text("Children", "Button"); - const ariaExpanded = boolean("Aria expanded", false); - const ariaControls = text("Aria controls", "element ID"); - const title = text("Title", "Additional information for accessibility"); - - return ( - - ); -}; - -Accessibility.story = { - parameters: { - info: "This is a preview of component accessibility props", - }, -}; - -export const Rtl = (): React.Node => ( - - - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/Button/Button.stories.tsx b/packages/orbit-components/src/Button/Button.stories.tsx new file mode 100644 index 0000000000..7d8cc86f65 --- /dev/null +++ b/packages/orbit-components/src/Button/Button.stories.tsx @@ -0,0 +1,307 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, number, boolean, select } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import { TYPE_OPTIONS, SIZE_OPTIONS } from "./consts"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import Stack from "../Stack"; +import SPACINGS_AFTER from "../common/getSpacingToken/consts"; + +import Button from "."; + +const getIcons = (name: string, defaultIcon: string) => + select(name, Object.keys(Icons), defaultIcon); + +const getIcon = (source: string | null) => (source ? Icons[source] : null); + +export default { + title: "Button", +}; + +export const Default = () => { + const children = text("Children", "Default button"); + return ; +}; + +Default.story = { + parameters: { + info: + "This is the default configuration of this component. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const BasicButtons = () => { + const children = text("Children", "Button"); + const fullWidth = boolean("fullWidth", false); + const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], TYPE_OPTIONS.PRIMARY); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.SMALL); + + return ( + + ); +}; + +BasicButtons.story = { + name: "Basic buttons", + + parameters: { + info: + "Basic buttons have three sizes (large, normal and small) and can be either primary or secondary type. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const ButtonWithIcons = () => { + const children = text("Children", "Button"); + const fullWidth = boolean("fullWidth", false); + const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], TYPE_OPTIONS.PRIMARY); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.NORMAL); + const IconLeft = getIcon(getIcons("iconLeft", "PlusCircle")); + const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); + return ( + + ); +}; + +ButtonWithIcons.story = { + name: "Button with icons", + + parameters: { + info: + "Buttons with icon are great when you need to draw more attention to the action. However, it's essential to not over-use these buttons. If everything tries to grab attention, things usually get messy. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SubtleButtons = () => { + const children = text("Children", "Button"); + const IconLeft = getIcon(getIcons("iconLeft", "CloseCircle")); + + return ( + + + + + ); +}; + +SubtleButtons.story = { + name: "Subtle buttons", + + parameters: { + info: + "We use status buttons exclusively in Alert messages when we need to show supporting action connected to the displayed message. We only use the small size of buttons. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CircledButton = () => { + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.NORMAL); + const type = select("Type", [TYPE_OPTIONS.PRIMARY, TYPE_OPTIONS.SECONDARY], TYPE_OPTIONS.PRIMARY); + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + + return ( + + ); +}; + +DestructiveButtons.story = { + name: "Destructive buttons", + + parameters: { + info: + "Destructive buttons are a specific version of critical status buttons, paired together with 'Remove' icon. We use them when we need to inform our users about possible dangerous actions (canceling a booking, removing an item, etc.). Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const ButtonAsALink = () => { + const children = text("Children", "I am a link"); + const href = text("Href", "https://kiwi.com"); + const external = boolean("External", false); + const disabled = boolean("Disabled", false); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.NORMAL); + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + + return ( + + ); +}; + +ButtonAsALink.story = { + name: "Button as a link", + + parameters: { + info: + "If you need to, you can pass some href to this component and it will automatically render into anchor.", + }, +}; + +export const Playground = () => { + const children = text("Children", "Button"); + const href = text("Href", ""); + const external = boolean("External", false); + const asComponent = text("asComponent", "button"); + const disabled = boolean("Disabled", false); + const fullWidth = boolean("fullWidth", false); + const type = select("Type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.PRIMARY); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.NORMAL); + const width = number("Width", 0); + const circled = boolean("Circled", false); + const loading = boolean("Loading", false); + const submit = boolean("Submit", false); + const dataTest = text("dataTest", "test"); + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); + const ariaExpanded = boolean("Aria expanded", false); + const ariaControls = text("Aria controls", "element ID"); + const tabIndex = text("tabIndex", "0"); + const spaceAfter = select("spaceAfter", Object.values(SPACINGS_AFTER), SPACINGS_AFTER.SMALL); + const title = text("Title", "Additional information for accessibility"); + const rel = text("Rel", "nofollow"); + const contentAlign = select( + "contentAlign", + ["start", "center", "end", "space-between"], + "center", + ); + const contentWidth = text("contentWidth", "100%"); + + return ( + + ); +}; + +Playground.story = { + parameters: { + info: "Some description about this type of component. ", + }, +}; + +export const Accessibility = () => { + const children = text("Children", "Button"); + const ariaExpanded = boolean("Aria expanded", false); + const ariaControls = text("Aria controls", "element ID"); + const title = text("Title", "Additional information for accessibility"); + + return ( + + ); +}; + +Accessibility.story = { + parameters: { + info: "This is a preview of component accessibility props", + }, +}; + +export const Rtl = () => { + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + + return ( + + + + ); +}; + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/Button/consts.js b/packages/orbit-components/src/Button/consts.js deleted file mode 100644 index 2c16dd4af1..0000000000 --- a/packages/orbit-components/src/Button/consts.js +++ /dev/null @@ -1,39 +0,0 @@ -// @flow -export const TYPE_OPTIONS = { - PRIMARY: "primary", - SECONDARY: "secondary", - CRITICAL: "critical", - WHITE: "white", - PRIMARY_SUBTLE: "primarySubtle", - CRITICAL_SUBTLE: "criticalSubtle", - BUNDLE_BASIC: "bundleBasic", - BUNDLE_MEDIUM: "bundleMedium", - BUNDLE_TOP: "bundleTop", -}; - -export const SIZE_OPTIONS = { - SMALL: "small", - NORMAL: "normal", - LARGE: "large", -}; - -export const TOKENS = { - // Size tokens - heightButton: "heightButton", - loadingWidth: "loadingWidth", - loadingHeight: "loadingHeight", - fontSizeButton: "fontSizeButton", - paddingButton: "paddingButton", - paddingButtonWithIcons: "paddingButtonWithIcons", - paddingButtonWithLeftIcon: "paddingButtonWithLeftIcon", - paddingButtonWithRightIcon: "paddingButtonWithRightIcon", - // Type tokens - backgroundButton: "backgroundButton", - backgroundButtonHover: "backgroundButtonHover", - backgroundButtonActive: "backgroundButtonActive", - backgroundButtonFocus: "backgroundButtonFocus", - colorTextButton: "colorTextButton", - colorTextButtonHover: "colorTextButtonHover", - colorTextButtonActive: "colorTextButtonActive", - borderColorButtonFocus: "borderColorButtonFocus", -}; diff --git a/packages/orbit-components/src/Button/consts.ts b/packages/orbit-components/src/Button/consts.ts new file mode 100644 index 0000000000..e75ed5983e --- /dev/null +++ b/packages/orbit-components/src/Button/consts.ts @@ -0,0 +1,38 @@ +export enum TYPE_OPTIONS { + PRIMARY = "primary", + SECONDARY = "secondary", + CRITICAL = "critical", + WHITE = "white", + PRIMARY_SUBTLE = "primarySubtle", + CRITICAL_SUBTLE = "criticalSubtle", + BUNDLE_BASIC = "bundleBasic", + BUNDLE_MEDIUM = "bundleMedium", + BUNDLE_TOP = "bundleTop", +} + +export enum SIZE_OPTIONS { + SMALL = "small", + NORMAL = "normal", + LARGE = "large", +} + +export enum TOKENS { + // Size tokens + heightButton = "heightButton", + loadingWidth = "loadingWidth", + loadingHeight = "loadingHeight", + fontSizeButton = "fontSizeButton", + paddingButton = "paddingButton", + paddingButtonWithIcons = "paddingButtonWithIcons", + paddingButtonWithLeftIcon = "paddingButtonWithLeftIcon", + paddingButtonWithRightIcon = "paddingButtonWithRightIcon", + // Type tokens + backgroundButton = "backgroundButton", + backgroundButtonHover = "backgroundButtonHover", + backgroundButtonActive = "backgroundButtonActive", + backgroundButtonFocus = "backgroundButtonFocus", + colorTextButton = "colorTextButton", + colorTextButtonHover = "colorTextButtonHover", + colorTextButtonActive = "colorTextButtonActive", + borderColorButtonFocus = "borderColorButtonFocus", +} diff --git a/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js b/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js deleted file mode 100644 index 27b8010aff..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js +++ /dev/null @@ -1,35 +0,0 @@ -// @flow -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import { TOKENS, TYPE_OPTIONS } from "../consts"; -import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; -import getButtonTypeToken from "./getButtonTypeToken"; -import type { GetButtonBoxShadow } from "./getButtonBoxShadow"; - -const opacity = { - [TYPE_OPTIONS.PRIMARY]: 15, - [TYPE_OPTIONS.SECONDARY]: 8, - [TYPE_OPTIONS.CRITICAL]: 15, - [TYPE_OPTIONS.WHITE]: 8, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: 8, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: 8, - [TYPE_OPTIONS.BUNDLE_BASIC]: 15, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: 15, - [TYPE_OPTIONS.BUNDLE_TOP]: 15, -}; - -const getButtonBoxShadow: GetButtonBoxShadow = ({ state, disabled, theme, type }) => { - const wrappedButtonTypeToken = name => getButtonTypeToken({ name, type, theme }); - if (disabled) { - return null; - } - if (state === BUTTON_STATES.ACTIVE) { - return `inset 0 0 6px 3px ${convertHexToRgba(theme.orbit.paletteInkDark, opacity[type])};`; - } - if (state === BUTTON_STATES.FOCUS) { - return `0 0 0 3px ${wrappedButtonTypeToken(TOKENS.borderColorButtonFocus)}`; - } - return null; -}; - -export default getButtonBoxShadow; diff --git a/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js.flow b/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js.flow deleted file mode 100644 index e2436c6949..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import type { Type } from ".."; -import type { Theme } from "../../defaultTheme"; - -type State = "default" | "focus" | "active" | "hover"; - -export type GetButtonBoxShadow = ({| - state: State, - disabled?: boolean, - theme: Theme, - type: Type, -|}) => ?string; - -declare export default GetButtonBoxShadow; diff --git a/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.ts b/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.ts new file mode 100644 index 0000000000..10f051511a --- /dev/null +++ b/packages/orbit-components/src/Button/helpers/getButtonBoxShadow.ts @@ -0,0 +1,49 @@ +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; +import { Interpolation } from "styled-components"; + +import { TOKENS, TYPE_OPTIONS } from "../consts"; +import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; +import getButtonTypeToken from "./getButtonTypeToken"; +import { Type, ButtonStates } from "../types"; +import { Theme } from "../../defaultTheme"; + +const opacity = { + [TYPE_OPTIONS.PRIMARY]: 15, + [TYPE_OPTIONS.SECONDARY]: 8, + [TYPE_OPTIONS.CRITICAL]: 15, + [TYPE_OPTIONS.WHITE]: 8, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: 8, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: 8, + [TYPE_OPTIONS.BUNDLE_BASIC]: 15, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: 15, + [TYPE_OPTIONS.BUNDLE_TOP]: 15, +}; + +interface BoxShadowProps { + state: ButtonStates; + disabled: boolean; + theme: Theme; + type: Type; +} + +const getButtonBoxShadow = ({ + state, + disabled, + theme, + type, +}: BoxShadowProps): Interpolation | null => { + const wrappedButtonTypeToken = (name: string) => getButtonTypeToken({ name, type, theme }); + if (disabled) return null; + + if (state === BUTTON_STATES.ACTIVE) { + return `inset 0 0 6px 3px ${convertHexToRgba(theme.orbit.paletteInkDark, opacity[type])};`; + } + + if (state === BUTTON_STATES.FOCUS) { + return `0 0 0 3px ${wrappedButtonTypeToken(TOKENS.borderColorButtonFocus)}`; + } + + return null; +}; + +export default getButtonBoxShadow; diff --git a/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js b/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js deleted file mode 100644 index 8a773cf339..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow -import { TOKENS } from "../consts"; -import getButtonTypeToken from "./getButtonTypeToken"; -import type { GetButtonIconForeground } from "./getButtonIconForeground"; - -const getButtonIconForeground: GetButtonIconForeground = ({ theme, type }) => { - const wrappedTypeToken = name => getButtonTypeToken({ name, type, theme }); - return { - foreground: wrappedTypeToken(TOKENS.colorTextButton), - foregroundHover: wrappedTypeToken(TOKENS.colorTextButtonHover), - foregroundActive: wrappedTypeToken(TOKENS.colorTextButtonActive), - foregroundFocus: wrappedTypeToken(TOKENS.colorTextButtonActive), - }; -}; - -export default getButtonIconForeground; diff --git a/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js.flow b/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js.flow deleted file mode 100644 index 8531f8ffca..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonIconForeground.js.flow +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import type { ThemeProps } from "../../defaultTheme"; -import type { Type } from ".."; -import type { IconForeground } from "../../primitives/ButtonPrimitive"; - -export type GetButtonIconForeground = ({| - type: Type, - ...ThemeProps, -|}) => IconForeground; - -declare export default GetButtonIconForeground; diff --git a/packages/orbit-components/src/Button/helpers/getButtonIconForeground.ts b/packages/orbit-components/src/Button/helpers/getButtonIconForeground.ts new file mode 100644 index 0000000000..8dfde6efb1 --- /dev/null +++ b/packages/orbit-components/src/Button/helpers/getButtonIconForeground.ts @@ -0,0 +1,27 @@ +import { TOKENS } from "../consts"; +import getButtonTypeToken from "./getButtonTypeToken"; +import { Theme } from "../../defaultTheme"; +import { Type } from "../types"; + +const getButtonIconForeground = ({ + theme, + type, +}: { + theme: Theme; + type: Type; +}): { + foreground: string; + foregroundHover: string; + foregroundActive: string; + foregroundFocus: string; +} => { + const wrappedTypeToken = (name: string) => getButtonTypeToken({ name, type, theme }); + return { + foreground: wrappedTypeToken(TOKENS.colorTextButton), + foregroundHover: wrappedTypeToken(TOKENS.colorTextButtonHover), + foregroundActive: wrappedTypeToken(TOKENS.colorTextButtonActive), + foregroundFocus: wrappedTypeToken(TOKENS.colorTextButtonActive), + }; +}; + +export default getButtonIconForeground; diff --git a/packages/orbit-components/src/Button/helpers/getButtonStyles.js b/packages/orbit-components/src/Button/helpers/getButtonStyles.js deleted file mode 100644 index bca0e6b8c8..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonStyles.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; -import getButtonTypeToken from "./getButtonTypeToken"; -import { TOKENS } from "../consts"; -import getButtonBoxShadow from "./getButtonBoxShadow"; -import type { GetButtonStyles } from "./getButtonStyles"; - -const getButtonStyles: GetButtonStyles = ({ disabled, theme, type }) => { - const wrappedBoxShadow = state => getButtonBoxShadow({ state, disabled, theme, type }); - const wrappedTypeToken = name => getButtonTypeToken({ name, type, theme }); - const boxShadow = { - boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), - boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), - boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), - }; - return { - background: wrappedTypeToken(TOKENS.backgroundButton), - backgroundHover: wrappedTypeToken(TOKENS.backgroundButtonHover), - backgroundActive: wrappedTypeToken(TOKENS.backgroundButtonActive), - backgroundFocus: null, - foreground: wrappedTypeToken(TOKENS.colorTextButton), - foregroundHover: wrappedTypeToken(TOKENS.colorTextButtonHover), - foregroundActive: wrappedTypeToken(TOKENS.colorTextButtonActive), - ...boxShadow, - }; -}; - -export default getButtonStyles; diff --git a/packages/orbit-components/src/Button/helpers/getButtonStyles.js.flow b/packages/orbit-components/src/Button/helpers/getButtonStyles.js.flow deleted file mode 100644 index 2c806d1161..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonStyles.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow - -import type { ThemeProps } from "../../defaultTheme"; -import type { Type } from ".."; -import type { Background, BoxShadow, Foreground } from "../../primitives/ButtonPrimitive"; - -export type GetButtonStyles = ({| - type: Type, - disabled?: boolean, - ...ThemeProps, -|}) => {| - ...Background, - ...Foreground, - ...BoxShadow, -|}; - -declare export default GetButtonStyles; diff --git a/packages/orbit-components/src/Button/helpers/getButtonStyles.ts b/packages/orbit-components/src/Button/helpers/getButtonStyles.ts new file mode 100644 index 0000000000..b5f25f1d6b --- /dev/null +++ b/packages/orbit-components/src/Button/helpers/getButtonStyles.ts @@ -0,0 +1,45 @@ +import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts"; +import getButtonTypeToken from "./getButtonTypeToken"; +import { TOKENS } from "../consts"; +import getButtonBoxShadow from "./getButtonBoxShadow"; +import { Theme } from "../../defaultTheme"; +import { Type, ButtonStates } from "../types"; + +const getButtonStyles = ({ + disabled, + theme, + type, +}: { + disabled: boolean; + theme: Theme; + type: Type; +}): { + background: string; + backgroundHover: string; + backgroundActive: string; + backgroundFocus: string | null; + foreground: string; + foregroundHover: string; + foregroundActive: string; +} => { + const wrappedBoxShadow = (state: ButtonStates) => + getButtonBoxShadow({ state, disabled, theme, type }); + const wrappedTypeToken = (name: string) => getButtonTypeToken({ name, type, theme }); + const boxShadow = { + boxShadow: wrappedBoxShadow(BUTTON_STATES.DEFAULT), + boxShadowHover: wrappedBoxShadow(BUTTON_STATES.HOVER), + boxShadowActive: wrappedBoxShadow(BUTTON_STATES.ACTIVE), + }; + return { + background: wrappedTypeToken(TOKENS.backgroundButton), + backgroundHover: wrappedTypeToken(TOKENS.backgroundButtonHover), + backgroundActive: wrappedTypeToken(TOKENS.backgroundButtonActive), + backgroundFocus: null, + foreground: wrappedTypeToken(TOKENS.colorTextButton), + foregroundHover: wrappedTypeToken(TOKENS.colorTextButtonHover), + foregroundActive: wrappedTypeToken(TOKENS.colorTextButtonActive), + ...boxShadow, + }; +}; + +export default getButtonStyles; diff --git a/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js b/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js deleted file mode 100644 index 08ec76403e..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js +++ /dev/null @@ -1,103 +0,0 @@ -// @flow -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import { TOKENS, TYPE_OPTIONS } from "../consts"; -import type { GetButtonTypeToken } from "./getButtonTypeToken"; - -const getButtonTypeToken: GetButtonTypeToken = ({ name, type, theme }) => { - const tokens = { - [TOKENS.backgroundButton]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimary, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondary, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCritical, - [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhite, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLight, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasic, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMedium, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTop, - }, - [TOKENS.backgroundButtonHover]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimaryHover, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondaryHover, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalHover, - [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhiteHover, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLightHover, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasicHover, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMediumHover, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTopHover, - }, - [TOKENS.backgroundButtonActive]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimaryActive, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondaryActive, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalActive, - [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhiteActive, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLightActive, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightActive, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasicActive, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMediumActive, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTopActive, - }, - [TOKENS.backgroundButtonFocus]: { - [TYPE_OPTIONS.PRIMARY]: convertHexToRgba(theme.orbit.paletteProductNormal, 10), - [TYPE_OPTIONS.SECONDARY]: convertHexToRgba(theme.orbit.paletteInkNormal, 10), - [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 10), - [TYPE_OPTIONS.WHITE]: convertHexToRgba(theme.orbit.paletteWhite, 20), - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLight, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasic, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMedium, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTop, - }, - [TOKENS.colorTextButton]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimary, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondary, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCritical, - [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhite, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductNormal, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedNormal, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, - }, - [TOKENS.colorTextButtonHover]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimaryHover, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondaryHover, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCriticalHover, - [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhiteHover, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductDark, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, - }, - [TOKENS.colorTextButtonActive]: { - [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimaryActive, - [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondaryActive, - [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCriticalActive, - [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhiteActive, - [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductDark, - [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, - [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, - [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, - }, - [TOKENS.borderColorButtonFocus]: { - [TYPE_OPTIONS.PRIMARY]: convertHexToRgba(theme.orbit.paletteProductNormal, 50), - [TYPE_OPTIONS.SECONDARY]: convertHexToRgba(theme.orbit.paletteInkNormal, 30), - [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), - // because it's not possible to see outline on the white bg, we use active token - [TYPE_OPTIONS.WHITE]: convertHexToRgba(theme.orbit.paletteWhiteActive, 50), - [TYPE_OPTIONS.PRIMARY_SUBTLE]: convertHexToRgba(theme.orbit.paletteProductNormal, 50), - [TYPE_OPTIONS.CRITICAL_SUBTLE]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), - // TODO: currently we do not have tokens for these colors - [TYPE_OPTIONS.BUNDLE_BASIC]: convertHexToRgba(`#E13E3B`, 50), - [TYPE_OPTIONS.BUNDLE_MEDIUM]: convertHexToRgba(`#3719AB`, 50), - [TYPE_OPTIONS.BUNDLE_TOP]: convertHexToRgba(`#2D2D2E`, 50), - }, - }; - return tokens[name][type]; -}; - -export default getButtonTypeToken; diff --git a/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js.flow b/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js.flow deleted file mode 100644 index b69cdf79e3..0000000000 --- a/packages/orbit-components/src/Button/helpers/getButtonTypeToken.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow -import type { Type } from ".."; -import type { Theme } from "../../defaultTheme"; - -export type TokenName = - | "backgroundButton" - | "backgroundButtonHover" - | "backgroundButtonActive" - | "backgroundButtonFocus" - | "colorTextButton" - | "colorTextButtonHover" - | "colorTextButtonActive" - | "borderColorButtonFocus"; - -export type GetButtonTypeToken = ({| name: TokenName, type: Type, theme: Theme |}) => string; - -declare export default GetButtonTypeToken; diff --git a/packages/orbit-components/src/Button/helpers/getButtonTypeToken.ts b/packages/orbit-components/src/Button/helpers/getButtonTypeToken.ts new file mode 100644 index 0000000000..f4d8b60768 --- /dev/null +++ b/packages/orbit-components/src/Button/helpers/getButtonTypeToken.ts @@ -0,0 +1,112 @@ +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import { Theme } from "../../defaultTheme"; +import { Type } from "../types"; +import { TOKENS, TYPE_OPTIONS } from "../consts"; + +const getButtonTypeToken = ({ + name, + type, + theme, +}: { + name: string; + type: Type; + theme: Theme; +}): string => { + const tokens = { + [TOKENS.backgroundButton]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimary, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondary, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCritical, + [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhite, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLight, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasic, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMedium, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTop, + }, + [TOKENS.backgroundButtonHover]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimaryHover, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondaryHover, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalHover, + [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhiteHover, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLightHover, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightHover, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasicHover, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMediumHover, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTopHover, + }, + [TOKENS.backgroundButtonActive]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.backgroundButtonPrimaryActive, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.backgroundButtonSecondaryActive, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.backgroundButtonCriticalActive, + [TYPE_OPTIONS.WHITE]: theme.orbit.backgroundButtonWhiteActive, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLightActive, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLightActive, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasicActive, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMediumActive, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTopActive, + }, + [TOKENS.backgroundButtonFocus]: { + [TYPE_OPTIONS.PRIMARY]: convertHexToRgba(theme.orbit.paletteProductNormal, 10), + [TYPE_OPTIONS.SECONDARY]: convertHexToRgba(theme.orbit.paletteInkNormal, 10), + [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 10), + [TYPE_OPTIONS.WHITE]: convertHexToRgba(theme.orbit.paletteWhite, 20), + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductLight, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedLight, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.backgroundButtonBundleBasic, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.backgroundButtonBundleMedium, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.backgroundButtonBundleTop, + }, + [TOKENS.colorTextButton]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimary, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondary, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCritical, + [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhite, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductNormal, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedNormal, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, + }, + [TOKENS.colorTextButtonHover]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimaryHover, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondaryHover, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCriticalHover, + [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhiteHover, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductDark, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, + }, + [TOKENS.colorTextButtonActive]: { + [TYPE_OPTIONS.PRIMARY]: theme.orbit.colorTextButtonPrimaryActive, + [TYPE_OPTIONS.SECONDARY]: theme.orbit.colorTextButtonSecondaryActive, + [TYPE_OPTIONS.CRITICAL]: theme.orbit.colorTextButtonCriticalActive, + [TYPE_OPTIONS.WHITE]: theme.orbit.colorTextButtonWhiteActive, + [TYPE_OPTIONS.PRIMARY_SUBTLE]: theme.orbit.paletteProductDark, + [TYPE_OPTIONS.CRITICAL_SUBTLE]: theme.orbit.paletteRedDark, + [TYPE_OPTIONS.BUNDLE_BASIC]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_MEDIUM]: theme.orbit.paletteWhite, + [TYPE_OPTIONS.BUNDLE_TOP]: theme.orbit.paletteWhite, + }, + [TOKENS.borderColorButtonFocus]: { + [TYPE_OPTIONS.PRIMARY]: convertHexToRgba(theme.orbit.paletteProductNormal, 50), + [TYPE_OPTIONS.SECONDARY]: convertHexToRgba(theme.orbit.paletteInkNormal, 30), + [TYPE_OPTIONS.CRITICAL]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), + // because it's not possible to see outline on the white bg, we use active token + [TYPE_OPTIONS.WHITE]: convertHexToRgba(theme.orbit.paletteWhiteActive, 50), + [TYPE_OPTIONS.PRIMARY_SUBTLE]: convertHexToRgba(theme.orbit.paletteProductNormal, 50), + [TYPE_OPTIONS.CRITICAL_SUBTLE]: convertHexToRgba(theme.orbit.paletteRedNormal, 50), + // TODO: currently we do not have tokens for these colors + [TYPE_OPTIONS.BUNDLE_BASIC]: convertHexToRgba(`#E13E3B`, 50), + [TYPE_OPTIONS.BUNDLE_MEDIUM]: convertHexToRgba(`#3719AB`, 50), + [TYPE_OPTIONS.BUNDLE_TOP]: convertHexToRgba(`#2D2D2E`, 50), + }, + }; + + return tokens[name][type]; +}; + +export default getButtonTypeToken; diff --git a/packages/orbit-components/src/Button/index.d.ts b/packages/orbit-components/src/Button/index.d.ts deleted file mode 100644 index c10655f621..0000000000 --- a/packages/orbit-components/src/Button/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive"; - -type Type = - | "primary" - | "secondary" - | "critical" - | "primarySubtle" - | "criticalSubtle" - | "white" - | "bundleBasic" - | "bundleMedium" - | "bundleTop"; - -export interface Props extends ButtonCommonProps { - readonly type?: Type; - readonly size?: Size; -} - -declare const Button: React.FunctionComponent; -export { Button, Button as default }; diff --git a/packages/orbit-components/src/Button/index.js.flow b/packages/orbit-components/src/Button/index.js.flow new file mode 100644 index 0000000000..037b60e527 --- /dev/null +++ b/packages/orbit-components/src/Button/index.js.flow @@ -0,0 +1,26 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/button/ +*/ +import * as React from "react"; + +import type { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive/index.js.flow"; + +export type Type = + | "primary" + | "secondary" + | "critical" + | "primarySubtle" + | "criticalSubtle" + | "white" + | "bundleBasic" + | "bundleMedium" + | "bundleTop"; + +export type Props = {| + +type?: Type, + +size?: Size, + ...ButtonCommonProps, +|}; + +declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/Button/index.jsx b/packages/orbit-components/src/Button/index.jsx deleted file mode 100644 index 5a40997e8f..0000000000 --- a/packages/orbit-components/src/Button/index.jsx +++ /dev/null @@ -1,40 +0,0 @@ -// @flow -import * as React from "react"; - -import { TYPE_OPTIONS } from "./consts"; -import ButtonPrimitive from "../primitives/ButtonPrimitive"; -import getIconContainer from "../primitives/ButtonPrimitive/common/getIconContainer"; -import getCommonProps from "../primitives/ButtonPrimitive/common/getCommonProps"; -import useTheme from "../hooks/useTheme"; -import getButtonStyles from "./helpers/getButtonStyles"; -import getButtonIconForeground from "./helpers/getButtonIconForeground"; - -import type { Props } from "."; - -const Button: React.AbstractComponent = React.forwardRef< - Props, - HTMLButtonElement, ->(({ type = TYPE_OPTIONS.PRIMARY, size, disabled = false, ...props }, ref) => { - const theme = useTheme(); - const propsWithTheme = { theme, size, ...props }; - const commonProps = getCommonProps(propsWithTheme); - const buttonStyles = getButtonStyles({ type, theme, disabled }); - const icons = getIconContainer({ - ...propsWithTheme, - iconForeground: getButtonIconForeground({ type, theme }), - }); - return ( - - ); -}); - -Button.displayName = "Button"; - -export default Button; diff --git a/packages/orbit-components/src/Button/index.jsx.flow b/packages/orbit-components/src/Button/index.jsx.flow deleted file mode 100644 index 66d22f5f52..0000000000 --- a/packages/orbit-components/src/Button/index.jsx.flow +++ /dev/null @@ -1,26 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/button/ -*/ -import * as React from "react"; - -import type { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive"; - -export type Type = - | "primary" - | "secondary" - | "critical" - | "primarySubtle" - | "criticalSubtle" - | "white" - | "bundleBasic" - | "bundleMedium" - | "bundleTop"; - -export type Props = {| - +type?: Type, - +size?: Size, - ...ButtonCommonProps, -|}; - -declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/Button/index.tsx b/packages/orbit-components/src/Button/index.tsx new file mode 100644 index 0000000000..cf7a4c90b2 --- /dev/null +++ b/packages/orbit-components/src/Button/index.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; + +import { TYPE_OPTIONS } from "./consts"; +import ButtonPrimitive from "../primitives/ButtonPrimitive"; +import getIconContainer from "../primitives/ButtonPrimitive/common/getIconContainer"; +import getCommonProps from "../primitives/ButtonPrimitive/common/getCommonProps"; +import useTheme from "../hooks/useTheme"; +import getButtonStyles from "./helpers/getButtonStyles"; +import getButtonIconForeground from "./helpers/getButtonIconForeground"; +import { Props } from "./types"; + +const Button = React.forwardRef( + ({ type = TYPE_OPTIONS.PRIMARY, size, disabled = false, ...props }, ref) => { + const theme = useTheme(); + const propsWithTheme = { theme, size, ...props }; + const commonProps = getCommonProps(propsWithTheme); + const buttonStyles = getButtonStyles({ type, theme, disabled }); + const icons = getIconContainer({ + ...propsWithTheme, + iconForeground: getButtonIconForeground({ type, theme }), + }); + return ( + + ); + }, +); + +Button.displayName = "Button"; + +export default Button; diff --git a/packages/orbit-components/src/Button/types.ts b/packages/orbit-components/src/Button/types.ts new file mode 100644 index 0000000000..a9b40c9a8a --- /dev/null +++ b/packages/orbit-components/src/Button/types.ts @@ -0,0 +1,22 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive/types"; + +export type Type = + | "primary" + | "secondary" + | "critical" + | "primarySubtle" + | "criticalSubtle" + | "white" + | "bundleBasic" + | "bundleMedium" + | "bundleTop"; + +export type ButtonStates = "default" | "hover" | "active" | "focus"; + +export interface Props extends ButtonCommonProps { + readonly type?: Type; + readonly size?: Size; +} diff --git a/packages/orbit-components/src/ButtonGroup/ButtonGroup.stories.jsx b/packages/orbit-components/src/ButtonGroup/ButtonGroup.stories.jsx deleted file mode 100644 index 1ed66d855e..0000000000 --- a/packages/orbit-components/src/ButtonGroup/ButtonGroup.stories.jsx +++ /dev/null @@ -1,70 +0,0 @@ -// @flow - -import * as React from "react"; -import { text } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import Button from "../Button"; -import ButtonLink from "../ButtonLink"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; - -import ButtonGroup from "."; - -export default { - title: "ButtonGroup", -}; - -export const WithButtons = (): React.Node => { - const dataTest = text("dataTest", "test"); - return ( - - - - + + - - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - }); -}); diff --git a/packages/orbit-components/src/ButtonGroup/__tests__/index.test.tsx b/packages/orbit-components/src/ButtonGroup/__tests__/index.test.tsx new file mode 100644 index 0000000000..1cc3d3ee97 --- /dev/null +++ b/packages/orbit-components/src/ButtonGroup/__tests__/index.test.tsx @@ -0,0 +1,20 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; + +import Button from "../../Button"; +import Airplane from "../../icons/Airplane"; +import ButtonGroup from ".."; + +const children = "button"; + +describe("ButtonGroup", () => { + it("should have data-test", () => { + render( + + + + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + }); +}); diff --git a/packages/orbit-components/src/ButtonGroup/index.d.ts b/packages/orbit-components/src/ButtonGroup/index.d.ts deleted file mode 100644 index 9dd4c685f4..0000000000 --- a/packages/orbit-components/src/ButtonGroup/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly children: React.ReactNode; -} - -declare const ButtonGroup: React.FunctionComponent; -export { ButtonGroup, ButtonGroup as default }; diff --git a/packages/orbit-components/src/ButtonGroup/index.jsx.flow b/packages/orbit-components/src/ButtonGroup/index.js.flow similarity index 100% rename from packages/orbit-components/src/ButtonGroup/index.jsx.flow rename to packages/orbit-components/src/ButtonGroup/index.js.flow diff --git a/packages/orbit-components/src/ButtonGroup/index.jsx b/packages/orbit-components/src/ButtonGroup/index.jsx deleted file mode 100644 index f273cf69a2..0000000000 --- a/packages/orbit-components/src/ButtonGroup/index.jsx +++ /dev/null @@ -1,51 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import defaultTheme from "../defaultTheme"; -import { borderRadius, rtlSpacing } from "../utils/rtl"; -import { StyledButtonPrimitive } from "../primitives/ButtonPrimitive"; -import mq from "../utils/mediaQuery"; - -import type { Props } from "."; - -const StyledButtonGroup = styled.div` - display: flex; - - ${StyledButtonPrimitive} { - border-radius: 0; - margin: ${({ theme }) => rtlSpacing(theme.orbit.marginButtonGroup)}; - - :first-child { - border-radius: ${borderRadius("6px 0 0 6px")}; - } - - :last-child { - border-radius: ${borderRadius("0 6px 6px 0")}; - margin: 0; - } - } - ${mq.tablet(css` - ${StyledButtonPrimitive} { - :first-child { - border-radius: ${({ theme }) => - borderRadius(`${theme.orbit.borderRadiusNormal} 0 0 ${theme.orbit.borderRadiusNormal}`)}; - } - :last-child { - border-radius: ${({ theme }) => - borderRadius(`0 ${theme.orbit.borderRadiusNormal} ${theme.orbit.borderRadiusNormal} 0`)}; - } - } - `)}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledButtonGroup.defaultProps = { - theme: defaultTheme, -}; - -const ButtonGroup = ({ children, dataTest }: Props): React.Node => ( - {children} -); - -export default ButtonGroup; diff --git a/packages/orbit-components/src/ButtonGroup/index.tsx b/packages/orbit-components/src/ButtonGroup/index.tsx new file mode 100644 index 0000000000..ca20f34d3e --- /dev/null +++ b/packages/orbit-components/src/ButtonGroup/index.tsx @@ -0,0 +1,48 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme from "../defaultTheme"; +import { borderRadius, rtlSpacing } from "../utils/rtl"; +import { StyledButtonPrimitive } from "../primitives/ButtonPrimitive"; +import mq from "../utils/mediaQuery"; +import { Props } from "./types"; + +const StyledButtonGroup = styled.div` + display: flex; + + ${StyledButtonPrimitive} { + border-radius: 0; + margin: ${({ theme }) => rtlSpacing(theme.orbit.marginButtonGroup)}; + + :first-child { + border-radius: ${borderRadius("6px 0 0 6px")}; + } + + :last-child { + border-radius: ${borderRadius("0 6px 6px 0")}; + margin: 0; + } + } + ${mq.tablet(css` + ${StyledButtonPrimitive} { + :first-child { + border-radius: ${({ theme }) => + borderRadius(`${theme.orbit.borderRadiusNormal} 0 0 ${theme.orbit.borderRadiusNormal}`)}; + } + :last-child { + border-radius: ${({ theme }) => + borderRadius(`0 ${theme.orbit.borderRadiusNormal} ${theme.orbit.borderRadiusNormal} 0`)}; + } + } + `)}; +`; + +StyledButtonGroup.defaultProps = { + theme: defaultTheme, +}; + +const ButtonGroup = ({ children, dataTest }: Props) => ( + {children} +); + +export default ButtonGroup; diff --git a/packages/orbit-components/src/ButtonGroup/types.ts b/packages/orbit-components/src/ButtonGroup/types.ts new file mode 100644 index 0000000000..7fe780b5ee --- /dev/null +++ b/packages/orbit-components/src/ButtonGroup/types.ts @@ -0,0 +1,10 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly children: React.ReactNode; +} diff --git a/packages/orbit-components/src/ButtonLink/ButtonLink.stories.jsx b/packages/orbit-components/src/ButtonLink/ButtonLink.stories.jsx deleted file mode 100644 index 58ccc9c7d3..0000000000 --- a/packages/orbit-components/src/ButtonLink/ButtonLink.stories.jsx +++ /dev/null @@ -1,170 +0,0 @@ -// @flow - -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, number, boolean, select } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import { TYPES } from "./consts"; -import { SIZE_OPTIONS } from "../primitives/ButtonPrimitive/common/consts"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; -import SPACINGS_AFTER from "../common/getSpacingToken/consts"; - -import ButtonLink from "."; - -const getIcons = (name, defaultIcon) => select(name, [null, ...Object.keys(Icons)], defaultIcon); -const getIcon = source => Icons[source]; - -export default { - title: "ButtonLink", -}; - -export const Default = (): React.Node => ( - ButtonLink -); - -Default.story = { - parameters: { - info: - "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", - }, -}; - -export const Secondary = (): React.Node => ( - - ButtonLink - -); - -Secondary.story = { - parameters: { - info: - "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", - }, -}; - -export const Critical = (): React.Node => ( - - ButtonLink - -); - -Critical.story = { - parameters: { - info: - "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", - }, -}; - -export const Circled = (): React.Node => { - const circled = boolean("circled", true); - const type = select("Type", Object.values(TYPES), TYPES.SECONDARY); - const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); - const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); - - return ( - } - onClick={action("clicked")} - circled={circled} - title="Button" - /> - ); -}; - -Circled.story = { - parameters: { - info: - "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", - }, -}; - -export const Playground = (): React.Node => { - const children = text("Children", "ButtonLink"); - const disabled = boolean("Disabled", false); - const fullWidth = boolean("fullWidth", false); - const type = select("Type", Object.values(TYPES), TYPES.SECONDARY); - const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); - const width = number("Width", 0); - const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); - const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); - const href = text("Href", ""); - const dataTest = text("dataTest", "test"); - const external = boolean("External", false); - const compact = boolean("compact", false); - const submit = boolean("Submit", false); - const ariaExpanded = boolean("Aria expanded", false); - const ariaControls = text("Aria controls", "element ID"); - const tabIndex = text("tabIndex", "0"); - const spaceAfter = select("spaceAfter", [null, ...Object.values(SPACINGS_AFTER)]); - const title = text("Title", "Additional information for accessibility"); - const rel = text("Rel", "nofollow"); - - return ( - } - iconRight={IconRight && } - width={width} - external={external} - onClick={action("clicked")} - compact={compact} - submit={submit} - ariaExpanded={ariaExpanded} - ariaControls={ariaControls} - tabIndex={tabIndex} - spaceAfter={spaceAfter} - title={title} - rel={rel} - > - {children} - - ); -}; - -Playground.story = { - parameters: { - info: - "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", - }, -}; - -export const Accessibility = (): React.Node => { - const children = text("Children", "ButtonLink"); - const ariaExpanded = boolean("Aria expanded", false); - const ariaControls = text("Aria controls", "element ID"); - const title = text("Title", "Additional information for accessibility"); - - return ( - - {children} - - ); -}; - -Accessibility.story = { - parameters: { - info: "This is a preview of component accessibility props", - }, -}; - -export const Rtl = (): React.Node => ( - - }>ButtonLink - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/ButtonLink/ButtonLink.stories.tsx b/packages/orbit-components/src/ButtonLink/ButtonLink.stories.tsx new file mode 100644 index 0000000000..c679669288 --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/ButtonLink.stories.tsx @@ -0,0 +1,168 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, number, boolean, select } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import { TYPES } from "./consts"; +import { SIZE_OPTIONS } from "../primitives/ButtonPrimitive/common/consts"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import SPACINGS_AFTER from "../common/getSpacingToken/consts"; + +import ButtonLink from "."; + +const getIcons = (name: string, defaultIcon: string) => + select(name, [null, ...Object.keys(Icons)], defaultIcon); + +const getIcon = (source: string | null) => (source ? Icons[source] : null); + +export default { + title: "ButtonLink", +}; + +export const Default = () => ButtonLink; + +Default.story = { + parameters: { + info: + "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", + }, +}; + +export const Secondary = () => ( + + ButtonLink + +); + +Secondary.story = { + parameters: { + info: + "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", + }, +}; + +export const Critical = () => ( + + ButtonLink + +); + +Critical.story = { + parameters: { + info: + "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", + }, +}; + +export const Circled = () => { + const circled = boolean("circled", true); + const type = select("Type", Object.values(TYPES), TYPES.SECONDARY); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + + return ( + } + onClick={action("clicked")} + circled={circled} + title="Button" + /> + ); +}; + +Circled.story = { + parameters: { + info: + "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", + }, +}; + +export const Playground = () => { + const children = text("Children", "ButtonLink"); + const disabled = boolean("Disabled", false); + const fullWidth = boolean("fullWidth", false); + const type = select("Type", Object.values(TYPES), TYPES.SECONDARY); + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); + const width = number("Width", 0); + const IconLeft = getIcon(getIcons("iconLeft", "Airplane")); + const IconRight = getIcon(getIcons("iconRight", "ChevronDown")); + const href = text("Href", ""); + const dataTest = text("dataTest", "test"); + const external = boolean("External", false); + const compact = boolean("compact", false); + const submit = boolean("Submit", false); + const ariaExpanded = boolean("Aria expanded", false); + const ariaControls = text("Aria controls", "element ID"); + const tabIndex = text("tabIndex", "0"); + const spaceAfter = select("spaceAfter", [undefined, ...Object.values(SPACINGS_AFTER)], undefined); + const title = text("Title", "Additional information for accessibility"); + const rel = text("Rel", "nofollow"); + + return ( + } + iconRight={IconRight && } + width={String(width)} + external={external} + onClick={action("clicked")} + compact={compact} + submit={submit} + ariaExpanded={ariaExpanded} + ariaControls={ariaControls} + tabIndex={tabIndex} + spaceAfter={spaceAfter} + title={title} + rel={rel} + > + {children} + + ); +}; + +Playground.story = { + parameters: { + info: + "Link buttons have a similar look as classic links, but the area surrounding them is clickable. That makes them great to use outside of paragraphs or for less important actions in the interface. We use Link buttons only in a small and normal version.", + }, +}; + +export const Accessibility = () => { + const children = text("Children", "ButtonLink"); + const ariaExpanded = boolean("Aria expanded", false); + const ariaControls = text("Aria controls", "element ID"); + const title = text("Title", "Additional information for accessibility"); + + return ( + + {children} + + ); +}; + +Accessibility.story = { + parameters: { + info: "This is a preview of component accessibility props", + }, +}; + +export const Rtl = () => ( + + }>ButtonLink + +); + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/ButtonLink/consts.js b/packages/orbit-components/src/ButtonLink/consts.js deleted file mode 100644 index e94e6d933f..0000000000 --- a/packages/orbit-components/src/ButtonLink/consts.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow -export const TYPES = { - PRIMARY: "primary", - SECONDARY: "secondary", - CRITICAL: "critical", -}; - -export const TOKENS = { - background: "background", - backgroundHover: "backgroundHover", - backgroundActive: "backgroundActive", - foreground: "foreground", - foregroundHover: "foregroundHover", - foregroundActive: "foregroundActive", - marginRightIcon: "marginRightIcon", -}; diff --git a/packages/orbit-components/src/ButtonLink/consts.ts b/packages/orbit-components/src/ButtonLink/consts.ts new file mode 100644 index 0000000000..9b023a049c --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/consts.ts @@ -0,0 +1,15 @@ +export enum TYPES { + PRIMARY = "primary", + SECONDARY = "secondary", + CRITICAL = "critical", +} + +export enum TOKENS { + background = "background", + backgroundHover = "backgroundHover", + backgroundActive = "backgroundActive", + foreground = "foreground", + foregroundHover = "foregroundHover", + foregroundActive = "foregroundActive", + marginRightIcon = "marginRightIcon", +} diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js deleted file mode 100644 index b027d1e79e..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js +++ /dev/null @@ -1,10 +0,0 @@ -// @flow -import getCommonProps from "../../primitives/ButtonPrimitive/common/getCommonProps"; -import type { GetButtonLinkCommonProps } from "./getButtonLinkCommonProps"; - -const getButtonLinkCommonProps: GetButtonLinkCommonProps = props => { - if (!props.compact) return getCommonProps(props); - return { ...getCommonProps(props), padding: "0" }; -}; - -export default getButtonLinkCommonProps; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js.flow b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js.flow deleted file mode 100644 index afa1804599..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -import type { GetCommonPropsReturn } from "../../primitives/ButtonPrimitive/common/getCommonProps"; -import type { Props } from ".."; -import type { ThemeProps } from "../../defaultTheme"; - -export type GetButtonLinkCommonProps = ({| ...Props, ...ThemeProps |}) => GetCommonPropsReturn; - -declare export default GetButtonLinkCommonProps; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.ts b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.ts new file mode 100644 index 0000000000..92d32b223f --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkCommonProps.ts @@ -0,0 +1,19 @@ +import getCommonProps, { + Params as CommonParams, + Output as CommonOutput, +} from "../../primitives/ButtonPrimitive/common/getCommonProps"; + +interface Props extends CommonParams { + readonly compact?: boolean; +} + +interface Output extends CommonOutput { + padding: string; +} + +const getButtonLinkCommonProps = (props: Props): Output => { + if (!props.compact) return getCommonProps(props); + return { ...getCommonProps(props), padding: "0" }; +}; + +export default getButtonLinkCommonProps; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js deleted file mode 100644 index bf05b17200..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js +++ /dev/null @@ -1,26 +0,0 @@ -// @flow -import { TOKENS, TYPES } from "../consts"; -import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; -import type { GetButtonLinkIconForeground } from "./getButtonLinkIconForeground"; - -const getButtonLinkIconForeground: GetButtonLinkIconForeground = ({ type, theme, compact }) => { - const wrappedTypeReturn = usedType => ({ - foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), - foregroundHover: getButtonLinkTypeToken(TOKENS.foregroundHover, usedType, theme), - foregroundActive: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme), - foregroundFocus: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme), - }); - - if (compact && type === TYPES.SECONDARY) { - return { - foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), - foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, - foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, - foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive, - }; - } - - return wrappedTypeReturn(type); -}; - -export default getButtonLinkIconForeground; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js.flow b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js.flow deleted file mode 100644 index 771084db58..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.js.flow +++ /dev/null @@ -1,13 +0,0 @@ -// @flow - -import type { ThemeProps } from "../../defaultTheme"; -import type { Type } from ".."; -import type { IconForeground } from "../../primitives/ButtonPrimitive"; - -export type GetButtonLinkIconForeground = ({| - type: Type, - ...ThemeProps, - compact: boolean, -|}) => IconForeground; - -declare export default GetButtonLinkIconForeground; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.ts b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.ts new file mode 100644 index 0000000000..6222ca1065 --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkIconForeground.ts @@ -0,0 +1,37 @@ +import { TOKENS, TYPES } from "../consts"; +import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; +import { Type } from "../types"; +import { Theme } from "../../defaultTheme"; +import { IconForeground } from "../../primitives/ButtonPrimitive/types"; + +type getButtonLinkIconForegroundType = ({ + type, + theme, + compact, +}: { + type: Type; + theme: Theme; + compact: boolean; +}) => IconForeground; + +const getButtonLinkIconForeground: getButtonLinkIconForegroundType = ({ type, theme, compact }) => { + const wrappedTypeReturn = (usedType: Type) => ({ + foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), + foregroundHover: getButtonLinkTypeToken(TOKENS.foregroundHover, usedType, theme), + foregroundActive: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme), + foregroundFocus: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme), + }); + + if (compact && type === TYPES.SECONDARY) { + return { + foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), + foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, + foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, + foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive, + }; + } + + return wrappedTypeReturn(type); +}; + +export default getButtonLinkIconForeground; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js deleted file mode 100644 index 7e8dcd3cff..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js +++ /dev/null @@ -1,37 +0,0 @@ -// @flow - -import { TOKENS, TYPES } from "../consts"; -import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; -import type { GetButtonLinkStyles } from "./getButtonLinkStyles"; - -const getButtonLinkStyles: GetButtonLinkStyles = ({ type, theme, compact }) => { - const wrappedTypeToken = name => getButtonLinkTypeToken(name, type, theme); - const commonStyles = { - background: wrappedTypeToken(TOKENS.background), - foreground: wrappedTypeToken(TOKENS.foreground), - foregroundHover: wrappedTypeToken(TOKENS.foregroundHover), - foregroundActive: wrappedTypeToken(TOKENS.foregroundActive), - foregroundFocus: wrappedTypeToken(TOKENS.foregroundActive), - }; - - if (compact) { - if (type === TYPES.SECONDARY) { - return { - ...commonStyles, - foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, - foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, - foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive, - }; - } - return commonStyles; - } - - return { - backgroundHover: wrappedTypeToken(TOKENS.backgroundHover), - backgroundActive: wrappedTypeToken(TOKENS.backgroundActive), - backgroundFocus: wrappedTypeToken(TOKENS.backgroundActive), - ...commonStyles, - }; -}; - -export default getButtonLinkStyles; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js.flow b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js.flow deleted file mode 100644 index 844989ac76..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.js.flow +++ /dev/null @@ -1,23 +0,0 @@ -// @flow - -import type { ThemeProps } from "../../defaultTheme"; -import type { Type } from ".."; -import type { - Background, - BoxShadow, - Foreground, - Underlined, -} from "../../primitives/ButtonPrimitive"; - -export type GetButtonLinkStyles = ({| - type: Type, - compact: boolean, - ...ThemeProps, -|}) => {| - ...Background, - ...Foreground, - ...BoxShadow, - ...Underlined, -|}; - -declare export default GetButtonLinkStyles; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.ts b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.ts new file mode 100644 index 0000000000..21d4ac138e --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkStyles.ts @@ -0,0 +1,57 @@ +import { TOKENS, TYPES } from "../consts"; +import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; +import { Type } from "../types"; +import { Theme } from "../../defaultTheme"; + +interface ButtonLinkStyles { + background?: string; + backgroundHover?: string; + backgroundActive?: string; + backgroundFocus?: string; + foreground?: string; + foregroundHover?: string; + foregroundActive?: string; + foregroundFocus?: string; +} + +type GetButtonLinkStylesType = ({ + type, + theme, + compact, +}: { + type: Type; + theme: Theme; + compact: boolean; +}) => ButtonLinkStyles; + +const getButtonLinkStyles: GetButtonLinkStylesType = ({ type, theme, compact }) => { + const wrappedTypeToken = (name: string) => getButtonLinkTypeToken(name, type, theme); + const commonStyles: Partial = { + background: wrappedTypeToken(TOKENS.background), + foreground: wrappedTypeToken(TOKENS.foreground), + foregroundHover: wrappedTypeToken(TOKENS.foregroundHover), + foregroundActive: wrappedTypeToken(TOKENS.foregroundActive), + foregroundFocus: wrappedTypeToken(TOKENS.foregroundActive), + }; + + if (compact) { + if (type === TYPES.SECONDARY) { + return { + ...commonStyles, + foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, + foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, + foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive, + }; + } + return commonStyles; + } + + return { + backgroundHover: wrappedTypeToken(TOKENS.backgroundHover), + backgroundActive: wrappedTypeToken(TOKENS.backgroundActive), + backgroundFocus: wrappedTypeToken(TOKENS.backgroundActive), + ...commonStyles, + }; +}; + +export default getButtonLinkStyles; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js deleted file mode 100644 index 7b6f0a11e6..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js +++ /dev/null @@ -1,41 +0,0 @@ -// @flow -import { TOKENS, TYPES } from "../consts"; -import type { GetButtonLinkTypeToken } from "./getButtonLinkTypeToken"; - -const getButtonLinkTypeToken: GetButtonLinkTypeToken = (name, type, theme) => { - const tokens = { - [TOKENS.background]: { - [TYPES.PRIMARY]: "transparent", - [TYPES.SECONDARY]: "transparent", - [TYPES.CRITICAL]: "transparent", - }, - [TOKENS.backgroundHover]: { - [TYPES.PRIMARY]: theme.orbit.paletteProductLightHover, - [TYPES.SECONDARY]: theme.orbit.paletteCloudLightHover, - [TYPES.CRITICAL]: theme.orbit.paletteRedLightHover, - }, - [TOKENS.backgroundActive]: { - [TYPES.PRIMARY]: theme.orbit.paletteProductLightActive, - [TYPES.SECONDARY]: theme.orbit.paletteCloudLightActive, - [TYPES.CRITICAL]: theme.orbit.paletteRedLightActive, - }, - [TOKENS.foreground]: { - [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimary, - [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondary, - [TYPES.CRITICAL]: theme.orbit.paletteRedNormal, - }, - [TOKENS.foregroundHover]: { - [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryHover, - [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryHover, - [TYPES.CRITICAL]: theme.orbit.paletteRedDarkHover, - }, - [TOKENS.foregroundActive]: { - [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryActive, - [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryActive, - [TYPES.CRITICAL]: theme.orbit.paletteRedDarkActive, - }, - }; - return tokens[name][type]; -}; - -export default getButtonLinkTypeToken; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js.flow b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js.flow deleted file mode 100644 index ac3e6b6811..0000000000 --- a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.js.flow +++ /dev/null @@ -1,15 +0,0 @@ -// @flow -import type { Theme } from "../../defaultTheme"; -import type { Type } from ".."; - -type Name = - | "background" - | "backgroundHover" - | "backgroundActive" - | "foreground" - | "foregroundHover" - | "foregroundActive"; - -export type GetButtonLinkTypeToken = (name: Name, type: Type, theme: Theme) => string; - -declare export default GetButtonLinkTypeToken; diff --git a/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.ts b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.ts new file mode 100644 index 0000000000..dba0ff1301 --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/helpers/getButtonLinkTypeToken.ts @@ -0,0 +1,41 @@ +import { TOKENS, TYPES } from "../consts"; +import { Type } from "../types"; +import { Theme } from "../../defaultTheme"; + +const getButtonLinkTypeToken = (name: string, type: Type, theme: Theme): string => { + const tokens = { + [TOKENS.background]: { + [TYPES.PRIMARY]: "transparent", + [TYPES.SECONDARY]: "transparent", + [TYPES.CRITICAL]: "transparent", + }, + [TOKENS.backgroundHover]: { + [TYPES.PRIMARY]: theme.orbit.paletteProductLightHover, + [TYPES.SECONDARY]: theme.orbit.paletteCloudLightHover, + [TYPES.CRITICAL]: theme.orbit.paletteRedLightHover, + }, + [TOKENS.backgroundActive]: { + [TYPES.PRIMARY]: theme.orbit.paletteProductLightActive, + [TYPES.SECONDARY]: theme.orbit.paletteCloudLightActive, + [TYPES.CRITICAL]: theme.orbit.paletteRedLightActive, + }, + [TOKENS.foreground]: { + [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimary, + [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondary, + [TYPES.CRITICAL]: theme.orbit.paletteRedNormal, + }, + [TOKENS.foregroundHover]: { + [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryHover, + [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryHover, + [TYPES.CRITICAL]: theme.orbit.paletteRedDarkHover, + }, + [TOKENS.foregroundActive]: { + [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryActive, + [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryActive, + [TYPES.CRITICAL]: theme.orbit.paletteRedDarkActive, + }, + }; + return tokens[name][type]; +}; + +export default getButtonLinkTypeToken; diff --git a/packages/orbit-components/src/ButtonLink/index.d.ts b/packages/orbit-components/src/ButtonLink/index.d.ts deleted file mode 100644 index 6d9f57e514..0000000000 --- a/packages/orbit-components/src/ButtonLink/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; -import { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive"; - -type Type = "primary" | "secondary" | "critical"; - -export interface Props extends Common.Global, Common.Ref, Common.SpaceAfter, ButtonCommonProps { - readonly compact?: boolean; - readonly type?: Type; - readonly size?: Size; -} - -declare const ButtonLink: React.FunctionComponent; -export { ButtonLink, ButtonLink as default }; diff --git a/packages/orbit-components/src/ButtonLink/index.js.flow b/packages/orbit-components/src/ButtonLink/index.js.flow new file mode 100644 index 0000000000..8932600f44 --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/index.js.flow @@ -0,0 +1,18 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/buttonlink/ +*/ +import * as React from "react"; + +import type { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive/index.js.flow"; + +export type Type = "primary" | "secondary" | "critical"; + +export type Props = {| + +compact?: boolean, + +type?: Type, + +size?: Size, + ...ButtonCommonProps, +|}; + +declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/ButtonLink/index.jsx b/packages/orbit-components/src/ButtonLink/index.jsx deleted file mode 100644 index 1517f0c62a..0000000000 --- a/packages/orbit-components/src/ButtonLink/index.jsx +++ /dev/null @@ -1,31 +0,0 @@ -// @flow -import * as React from "react"; - -import { TYPES } from "./consts"; -import ButtonPrimitive from "../primitives/ButtonPrimitive"; -import useTheme from "../hooks/useTheme"; -import getIconContainer from "../primitives/ButtonPrimitive/common/getIconContainer"; -import getButtonLinkStyles from "./helpers/getButtonLinkStyles"; -import getButtonLinkIconForeground from "./helpers/getButtonLinkIconForeground"; -import getButtonLinkCommonProps from "./helpers/getButtonLinkCommonProps"; - -import type { Props } from "."; - -const ButtonLink: React.AbstractComponent = React.forwardRef< - Props, - HTMLButtonElement, ->(({ type = TYPES.PRIMARY, size, compact = false, ...props }, ref) => { - const theme = useTheme(); - const propsWithTheme = { theme, size, ...props }; - const commonProps = getButtonLinkCommonProps({ ...propsWithTheme, compact }); - const buttonLinkStyles = getButtonLinkStyles({ type, theme, compact }); - const icons = getIconContainer({ - ...propsWithTheme, - iconForeground: getButtonLinkIconForeground({ type, theme, compact }), - }); - return ; -}); - -ButtonLink.displayName = "ButtonLink"; - -export default ButtonLink; diff --git a/packages/orbit-components/src/ButtonLink/index.jsx.flow b/packages/orbit-components/src/ButtonLink/index.jsx.flow deleted file mode 100644 index 10376158b1..0000000000 --- a/packages/orbit-components/src/ButtonLink/index.jsx.flow +++ /dev/null @@ -1,18 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/buttonlink/ -*/ -import * as React from "react"; - -import type { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive"; - -export type Type = "primary" | "secondary" | "critical"; - -export type Props = {| - +compact?: boolean, - +type?: Type, - +size?: Size, - ...ButtonCommonProps, -|}; - -declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/ButtonLink/index.tsx b/packages/orbit-components/src/ButtonLink/index.tsx new file mode 100644 index 0000000000..07d547f0c7 --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/index.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; + +import { TYPES } from "./consts"; +import ButtonPrimitive from "../primitives/ButtonPrimitive"; +import useTheme from "../hooks/useTheme"; +import getIconContainer from "../primitives/ButtonPrimitive/common/getIconContainer"; +import getButtonLinkStyles from "./helpers/getButtonLinkStyles"; +import getButtonLinkIconForeground from "./helpers/getButtonLinkIconForeground"; +import getButtonLinkCommonProps from "./helpers/getButtonLinkCommonProps"; +import { Props } from "./types"; + +const ButtonLink = React.forwardRef( + ({ type = TYPES.PRIMARY, size, compact = false, ...props }, ref) => { + const theme = useTheme(); + const propsWithTheme = { theme, size, ...props }; + const commonProps = getButtonLinkCommonProps({ ...propsWithTheme, compact }); + const buttonLinkStyles = getButtonLinkStyles({ type, theme, compact }); + const icons = getIconContainer({ + ...propsWithTheme, + iconForeground: getButtonLinkIconForeground({ type, theme, compact }), + }); + return ( + // @ts-expect-error FIXME: migration issue + + ); + }, +); + +ButtonLink.displayName = "ButtonLink"; + +export default ButtonLink; diff --git a/packages/orbit-components/src/ButtonLink/types.ts b/packages/orbit-components/src/ButtonLink/types.ts new file mode 100644 index 0000000000..04b5d7837c --- /dev/null +++ b/packages/orbit-components/src/ButtonLink/types.ts @@ -0,0 +1,18 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; +import { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive/types"; + +export type Type = "primary" | "secondary" | "critical"; + +export interface Props extends Common.Globals, Common.Ref, Common.SpaceAfter, ButtonCommonProps { + readonly compact?: boolean; + readonly type?: Type; + readonly size?: Size; +} + +declare const ButtonLink: React.FunctionComponent; +export { ButtonLink, ButtonLink as default }; diff --git a/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.jsx b/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.jsx deleted file mode 100644 index a4f1297211..0000000000 --- a/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.jsx +++ /dev/null @@ -1,45 +0,0 @@ -// @flow -import * as React from "react"; -import { text, select } from "@storybook/addon-knobs"; -import { action } from "@storybook/addon-actions"; - -import { LANGUAGE } from "./consts"; -import Stack from "../Stack"; - -import ButtonMobileStore from "."; - -export default { - title: "ButtonMobileStore", -}; - -export const Default = (): React.Node => { - const href = text("href", "#"); - const lang = select("lang", Object.values(LANGUAGE), "EN"); - - return ( - <> - - - - - - ); -}; - -Default.story = { - parameters: { - info: "This is the default configuration of this component.", - }, -}; diff --git a/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.tsx b/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.tsx new file mode 100644 index 0000000000..7af7c04d94 --- /dev/null +++ b/packages/orbit-components/src/ButtonMobileStore/ButtonMobileStore.stories.tsx @@ -0,0 +1,44 @@ +import * as React from "react"; +import { text, select } from "@storybook/addon-knobs"; +import { action } from "@storybook/addon-actions"; + +import { LANGUAGE } from "./consts"; +import Stack from "../Stack"; + +import ButtonMobileStore from "."; + +export default { + title: "ButtonMobileStore", +}; + +export const Default = () => { + const href = text("href", "#"); + const lang = select("lang", Object.values(LANGUAGE), LANGUAGE.EN); + + return ( + <> + + + + + + ); +}; + +Default.story = { + parameters: { + info: "This is the default configuration of this component.", + }, +}; diff --git a/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.jsx b/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.jsx deleted file mode 100644 index d3c5d6fdef..0000000000 --- a/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.jsx +++ /dev/null @@ -1,24 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import ButtonMobileStore from ".."; -import { TYPE_OPTIONS } from "../consts"; - -describe("ButtonMobileStore", () => { - it("default", () => { - const onClick = jest.fn(); - render( - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - const link = screen.getByRole("link"); - expect(link).toHaveAttribute("href", "#"); - expect(link).toHaveAttribute("rel", expect.stringContaining("noopener")); - expect(link).toHaveAttribute("target", "_blank"); - userEvent.click(link); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.tsx b/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.tsx new file mode 100644 index 0000000000..16a899a714 --- /dev/null +++ b/packages/orbit-components/src/ButtonMobileStore/__tests__/index.test.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import ButtonMobileStore from ".."; +import { TYPE_OPTIONS } from "../consts"; + +describe("ButtonMobileStore", () => { + it("default", () => { + const onClick = jest.fn(); + render( + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + const link = screen.getByRole("link"); + expect(link).toHaveAttribute("href", "#"); + expect(link).toHaveAttribute("rel", expect.stringContaining("noopener")); + expect(link).toHaveAttribute("target", "_blank"); + userEvent.click(link); + expect(onClick).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/ButtonMobileStore/consts.js b/packages/orbit-components/src/ButtonMobileStore/consts.js deleted file mode 100644 index 35783c78cd..0000000000 --- a/packages/orbit-components/src/ButtonMobileStore/consts.js +++ /dev/null @@ -1,32 +0,0 @@ -// @flow -export const TYPE_OPTIONS = { - APPSTORE: "appStore", - GOOGLEPLAY: "googlePlay", -}; - -export const LANGUAGE = { - BG: "BG", - CS: "CS", - DA: "DA", - DE: "DE", - EN: "EN", - ES: "ES", - FI: "FI", - FR: "FR", - HU: "HU", - IT: "IT", - JA: "JA", - KO: "KO", - NL: "NL", - PL: "PL", - PT: "PT", - RO: "RO", - RU: "RU", - SK: "SK", - SR: "SR", - SV: "SV", - TR: "TR", - ZH: "ZH", -}; - -export const HEIGHT = "40px"; diff --git a/packages/orbit-components/src/ButtonMobileStore/consts.ts b/packages/orbit-components/src/ButtonMobileStore/consts.ts new file mode 100644 index 0000000000..a837ce789a --- /dev/null +++ b/packages/orbit-components/src/ButtonMobileStore/consts.ts @@ -0,0 +1,31 @@ +export enum TYPE_OPTIONS { + APPSTORE = "appStore", + GOOGLEPLAY = "googlePlay", +} + +export enum LANGUAGE { + BG = "BG", + CS = "CS", + DA = "DA", + DE = "DE", + EN = "EN", + ES = "ES", + FI = "FI", + FR = "FR", + HU = "HU", + IT = "IT", + JA = "JA", + KO = "KO", + NL = "NL", + PL = "PL", + PT = "PT", + RO = "RO", + RU = "RU", + SK = "SK", + SR = "SR", + SV = "SV", + TR = "TR", + ZH = "ZH", +} + +export const HEIGHT = "40px"; diff --git a/packages/orbit-components/src/ButtonMobileStore/index.d.ts b/packages/orbit-components/src/ButtonMobileStore/index.d.ts deleted file mode 100644 index 2f5db7e51f..0000000000 --- a/packages/orbit-components/src/ButtonMobileStore/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// @noflow -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -type Type = "appStore" | "googlePlay"; -export interface Props extends Common.Global { - readonly type?: Type; - readonly stopPropagation?: boolean; - readonly href?: string; - readonly alt?: string; - readonly lang?: string; - readonly onClick?: Common.Event>; -} - -declare const ButtonMobileStore: React.FunctionComponent; -export { ButtonMobileStore, ButtonMobileStore as default }; diff --git a/packages/orbit-components/src/ButtonMobileStore/index.jsx.flow b/packages/orbit-components/src/ButtonMobileStore/index.js.flow similarity index 100% rename from packages/orbit-components/src/ButtonMobileStore/index.jsx.flow rename to packages/orbit-components/src/ButtonMobileStore/index.js.flow diff --git a/packages/orbit-components/src/ButtonMobileStore/index.jsx b/packages/orbit-components/src/ButtonMobileStore/index.jsx deleted file mode 100644 index d49162bfa7..0000000000 --- a/packages/orbit-components/src/ButtonMobileStore/index.jsx +++ /dev/null @@ -1,60 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import defaultTheme from "../defaultTheme"; -import { HEIGHT, TYPE_OPTIONS, LANGUAGE } from "./consts"; - -import type { Props } from "."; - -const StyledButtonMobileStore = styled(({ theme, type, ...props }) => ( - {props.children} -))` - display: inline-block; - height: ${HEIGHT}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledButtonMobileStore.defaultProps = { - theme: defaultTheme, -}; - -const getSrc = (type, lang) => { - if (type === "appStore") - return `https://images.kiwi.com/common/AppStoreButton${lang}.png, https://images.kiwi.com/common/AppStoreButton${lang}@2x.png 2x`; - return `https://images.kiwi.com/common/GooglePlayButton${lang}.png, https://images.kiwi.com/common/GooglePlayButton${lang}@2x.png 2x`; -}; - -const ButtonMobileStore = ({ - type = TYPE_OPTIONS.APPSTORE, - lang = LANGUAGE.EN, - href, - onClick, - dataTest, - id, - alt = "", - stopPropagation = false, -}: Props): React.Node => { - const onClickHandler = ev => { - if (stopPropagation) { - ev.stopPropagation(); - if (onClick) onClick(); - } - if (onClick) onClick(); - }; - - return ( - - {alt} - - ); -}; - -export default ButtonMobileStore; diff --git a/packages/orbit-components/src/ButtonMobileStore/index.tsx b/packages/orbit-components/src/ButtonMobileStore/index.tsx new file mode 100644 index 0000000000..f4466af838 --- /dev/null +++ b/packages/orbit-components/src/ButtonMobileStore/index.tsx @@ -0,0 +1,55 @@ +import * as React from "react"; +import styled from "styled-components"; + +import defaultTheme from "../defaultTheme"; +import { HEIGHT, TYPE_OPTIONS, LANGUAGE } from "./consts"; +import { Props, Type } from "./types"; + +const StyledButtonMobileStore = styled.a` + display: inline-block; + height: ${HEIGHT}; +`; + +StyledButtonMobileStore.defaultProps = { + theme: defaultTheme, +}; + +const getSrc = (type: Type, lang: string) => { + if (type === "appStore") + return `https://images.kiwi.com/common/AppStoreButton${lang}.png, https://images.kiwi.com/common/AppStoreButton${lang}@2x.png 2x`; + return `https://images.kiwi.com/common/GooglePlayButton${lang}.png, https://images.kiwi.com/common/GooglePlayButton${lang}@2x.png 2x`; +}; + +const ButtonMobileStore = ({ + type = TYPE_OPTIONS.APPSTORE, + lang = LANGUAGE.EN, + href, + onClick, + dataTest, + id, + alt = "", + stopPropagation = false, +}: Props) => { + const onClickHandler = (ev: React.MouseEvent) => { + if (stopPropagation) { + ev.stopPropagation(); + if (onClick) onClick(ev); + } + if (onClick) onClick(ev); + }; + + return ( + + {alt} + + ); +}; + +export default ButtonMobileStore; diff --git a/packages/orbit-components/src/ButtonMobileStore/types.ts b/packages/orbit-components/src/ButtonMobileStore/types.ts new file mode 100644 index 0000000000..b629ca9fd8 --- /dev/null +++ b/packages/orbit-components/src/ButtonMobileStore/types.ts @@ -0,0 +1,16 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export type Type = "appStore" | "googlePlay"; +export interface Props extends Common.Globals { + readonly type?: Type; + readonly stopPropagation?: boolean; + readonly href?: string; + readonly alt?: string; + readonly lang?: string; + readonly onClick?: (ev: React.MouseEvent) => void; +} diff --git a/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.jsx b/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.jsx deleted file mode 100644 index 7494d51948..0000000000 --- a/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.jsx +++ /dev/null @@ -1,140 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, select, boolean } from "@storybook/addon-knobs"; - -import * as Icons from "../icons"; -import Illustration from "../Illustration"; -import { NAMES } from "../Illustration/consts"; -import Button from "../Button"; -import List from "../List"; -import ListItem from "../List/ListItem"; - -import CallOutBanner from "."; - -export default { - title: "CallOutBanner", -}; - -export const Default = (): React.Node => { - const title = text("title", "Rooms in Warsaw"); - const description = text( - "description", - "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", - ); - return ( - } - actions={ - - } - > - - }>Up to 50% off. - }> - From 3-star budget to 5-star luxury. - - - - ); -}; - -Default.story = { - parameters: { - info: "This is the default configuration of this component.", - }, -}; - -export const Actionable = (): React.Node => { - const title = text("title", "Rooms in Warsaw"); - const description = text( - "description", - "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", - ); - return ( - } - actions={ - - } - > - - }>Up to 50% off. - }> - From 3-star budget to 5-star luxury. - - - - ); -}; - -Actionable.story = { - parameters: { - info: "This is the default configuration of this component.", - }, -}; - -export const Playground = (): React.Node => { - const title = text("title", "Rooms in Warsaw"); - const description = text( - "description", - "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", - ); - const onClick = boolean("onClick", false); - const actions = boolean("actions", false); - const dataTest = text("dataTest", "test"); - const illustration = select("illustration", [null, ...Object.values(NAMES)], "Accommodation"); - return ( - : undefined} - actions={ - actions ? ( - - ) : null - } - > - - }>Up to 50% off. - }> - From 3-star budget to 5-star luxury. - - - - ); -}; - -Playground.story = { - parameters: { - info: "This is the default configuration of this component.", - }, -}; diff --git a/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.tsx b/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.tsx new file mode 100644 index 0000000000..4742cc7e67 --- /dev/null +++ b/packages/orbit-components/src/CallOutBanner/CallOutBanner.stories.tsx @@ -0,0 +1,140 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, select, boolean } from "@storybook/addon-knobs"; + +import * as Icons from "../icons"; +import Illustration from "../Illustration"; +// @ts-expect-error currently can't resolve mts properly +import { NAMES } from "../Illustration/consts.mts"; +import Button from "../Button"; +import List from "../List"; +import ListItem from "../List/ListItem"; + +import CallOutBanner from "."; + +export default { + title: "CallOutBanner", +}; + +export const Default = () => { + const title = text("title", "Rooms in Warsaw"); + const description = text( + "description", + "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", + ); + return ( + } + actions={ + + } + > + + }>Up to 50% off. + }> + From 3-star budget to 5-star luxury. + + + + ); +}; + +Default.story = { + parameters: { + info: "This is the default configuration of this component.", + }, +}; + +export const Actionable = () => { + const title = text("title", "Rooms in Warsaw"); + const description = text( + "description", + "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", + ); + return ( + } + actions={ + + } + > + + }>Up to 50% off. + }> + From 3-star budget to 5-star luxury. + + + + ); +}; + +Actionable.story = { + parameters: { + info: "This is the default configuration of this component.", + }, +}; + +export const Playground = () => { + const title = text("title", "Rooms in Warsaw"); + const description = text( + "description", + "Select your hotel, hostel, apartment, or B&B from more than a million properties worldwide.", + ); + const onClick = boolean("onClick", false); + const actions = boolean("actions", false); + const dataTest = text("dataTest", "test"); + const illustration = select("illustration", NAMES, "Accommodation"); + return ( + : undefined} + actions={ + actions ? ( + + ) : null + } + > + + }>Up to 50% off. + }> + From 3-star budget to 5-star luxury. + + + + ); +}; + +Playground.story = { + parameters: { + info: "This is the default configuration of this component.", + }, +}; diff --git a/packages/orbit-components/src/CallOutBanner/__tests__/index.test.jsx b/packages/orbit-components/src/CallOutBanner/__tests__/index.test.jsx deleted file mode 100644 index 741d1d41fb..0000000000 --- a/packages/orbit-components/src/CallOutBanner/__tests__/index.test.jsx +++ /dev/null @@ -1,37 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import CallOutBanner from ".."; -import Illustration from "../../Illustration"; - -describe("CallOutBanner", () => { - it("flat", () => { - render( - - } - />, - ); - const banner = screen.getByTestId("test"); - expect(banner).toHaveAttribute("tabindex", "0"); - expect(banner.textContent).toMatch("title"); - expect(banner.textContent).toMatch("description"); - expect(screen.getByTestId("illustration")); - }); - it("actionable", () => { - const onClick = jest.fn(); - render(); - const banner = screen.getByTestId("test"); - expect(banner).toHaveAttribute("tabindex", "0"); - userEvent.click(banner); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/CallOutBanner/__tests__/index.test.tsx b/packages/orbit-components/src/CallOutBanner/__tests__/index.test.tsx new file mode 100644 index 0000000000..f975d44674 --- /dev/null +++ b/packages/orbit-components/src/CallOutBanner/__tests__/index.test.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import CallOutBanner from ".."; +import Illustration from "../../Illustration"; + +describe("CallOutBanner", () => { + it("flat", () => { + render( + + } + />, + ); + const banner = screen.getByTestId("test"); + expect(banner).toHaveAttribute("tabindex", "0"); + expect(banner.textContent).toMatch("title"); + expect(banner.textContent).toMatch("description"); + expect(screen.getByTestId("illustration")); + }); + it("actionable", () => { + const onClick = jest.fn(); + render(); + const banner = screen.getByTestId("test"); + expect(banner).toHaveAttribute("tabindex", "0"); + userEvent.click(banner); + expect(onClick).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/CallOutBanner/index.d.ts b/packages/orbit-components/src/CallOutBanner/index.d.ts deleted file mode 100644 index 329a3d0ad0..0000000000 --- a/packages/orbit-components/src/CallOutBanner/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; -import Illustration from "../Illustration"; - -export interface Props { - readonly tabIndex?: string | number; - readonly onClick?: Common.Callback; - readonly title: Common.Translation; - readonly description?: Common.Translation; - readonly illustration?: React.ReactElement; - readonly actions?: React.ReactNode; - readonly children?: React.ReactNode; -} - -declare const CallOutBanner: React.FunctionComponent; -export { CallOutBanner, CallOutBanner as default }; diff --git a/packages/orbit-components/src/CallOutBanner/index.js.flow b/packages/orbit-components/src/CallOutBanner/index.js.flow new file mode 100644 index 0000000000..e99bd32427 --- /dev/null +++ b/packages/orbit-components/src/CallOutBanner/index.js.flow @@ -0,0 +1,18 @@ +// @flow +import * as React from "react"; + +import type { Translation, Globals } from "../common/common.js.flow"; +import Illustration from "../Illustration/index.js.flow"; + +export type Props = {| + tabIndex?: string | number, + onClick?: () => void | Promise, + title: Translation, + description?: Translation, + illustration?: React.Element, + actions?: React.Node, + children?: React.Node, + ...Globals, +|}; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/CallOutBanner/index.jsx b/packages/orbit-components/src/CallOutBanner/index.jsx deleted file mode 100644 index bc841d479b..0000000000 --- a/packages/orbit-components/src/CallOutBanner/index.jsx +++ /dev/null @@ -1,91 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import mq from "../utils/mediaQuery"; -import defaultTheme from "../defaultTheme"; -import Heading from "../Heading"; -import Stack from "../Stack"; -import Text from "../Text"; - -import type { Props } from "."; - -const StyledCallOutBanner = styled.div` - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: flex-start; - background: ${({ theme }) => theme.orbit.paletteWhite}; - border-radius: ${({ theme }) => theme.orbit.borderRadiusSmall}; - padding: ${({ theme }) => theme.orbit.spaceMedium}; - ${({ onClick }) => - onClick - ? css` - box-shadow: ${({ theme }) => theme.orbit.boxShadowAction}; - transition: box-shadow ${({ theme }) => theme.orbit.durationFast} ease-in-out; - cursor: pointer; - :active, - :hover { - box-shadow: ${({ theme }) => theme.orbit.boxShadowActionActive}; - } - border: 1px solid transparent; - ` - : css` - border: 1px solid ${({ theme }) => theme.orbit.paletteCloudNormal}; - `}; - ${mq.largeMobile(css` - flex-direction: row; - padding: ${({ theme }) => theme.orbit.spaceLarge}; - `)}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCallOutBanner.defaultProps = { - theme: defaultTheme, -}; - -const StyledIllustration = styled.div` - padding-bottom: ${({ theme }) => theme.orbit.spaceMedium}; - ${mq.largeMobile(css` - padding-right: ${({ theme }) => theme.orbit.spaceLarge}; - padding-bottom: 0; - `)}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledIllustration.defaultProps = { - theme: defaultTheme, -}; - -const CallOutBanner = ({ - children, - illustration, - actions, - title, - onClick, - tabIndex, - description, - dataTest, - id, -}: Props): React.Node => ( - - {illustration && {illustration}} - - - - {title && {title}} - {description && {description}} - - {children} - - {actions} - - -); - -export default CallOutBanner; diff --git a/packages/orbit-components/src/CallOutBanner/index.jsx.flow b/packages/orbit-components/src/CallOutBanner/index.jsx.flow deleted file mode 100644 index e1319f03e9..0000000000 --- a/packages/orbit-components/src/CallOutBanner/index.jsx.flow +++ /dev/null @@ -1,18 +0,0 @@ -// @flow -import * as React from "react"; - -import type { Translation, Globals } from "../common/common.js.flow"; -import Illustration from "../Illustration"; - -export type Props = {| - tabIndex?: string | number, - onClick?: () => void | Promise, - title: Translation, - description?: Translation, - illustration?: React.Element, - actions?: React.Node, - children?: React.Node, - ...Globals, -|}; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/CallOutBanner/index.tsx b/packages/orbit-components/src/CallOutBanner/index.tsx new file mode 100644 index 0000000000..6576fab54b --- /dev/null +++ b/packages/orbit-components/src/CallOutBanner/index.tsx @@ -0,0 +1,89 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import mq from "../utils/mediaQuery"; +import defaultTheme from "../defaultTheme"; +import Heading from "../Heading"; +import Stack from "../Stack"; +import Text from "../Text"; +import { Props } from "./types"; + +const StyledCallOutBanner = styled.div>` + ${({ theme, onClick }) => css` + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + background: ${theme.orbit.paletteWhite}; + border-radius: ${theme.orbit.borderRadiusSmall}; + padding: ${theme.orbit.spaceMedium}; + ${onClick + ? css` + box-shadow: ${theme.orbit.boxShadowAction}; + transition: box-shadow ${theme.orbit.durationFast} ease-in-out; + cursor: pointer; + :active, + :hover { + box-shadow: ${theme.orbit.boxShadowActionActive}; + outline: none; + } + border: 1px solid transparent; + ` + : css` + border: 1px solid ${theme.orbit.paletteCloudNormal}; + `}; + ${mq.largeMobile(css` + flex-direction: row; + padding: ${theme.orbit.spaceLarge}; + `)}; + `}; +`; + +StyledCallOutBanner.defaultProps = { + theme: defaultTheme, +}; + +const StyledIllustration = styled.div` + padding-bottom: ${({ theme }) => theme.orbit.spaceMedium}; + ${mq.largeMobile(css` + padding-right: ${({ theme }) => theme.orbit.spaceLarge}; + padding-bottom: 0; + `)}; +`; + +StyledIllustration.defaultProps = { + theme: defaultTheme, +}; + +const CallOutBanner = ({ + children, + illustration, + actions, + title, + onClick, + tabIndex, + description, + dataTest, + id, +}: Props) => ( + + {illustration && {illustration}} + + + + {title && {title}} + {description && {description}} + + {children} + + {actions} + + +); + +export default CallOutBanner; diff --git a/packages/orbit-components/src/CallOutBanner/types.ts b/packages/orbit-components/src/CallOutBanner/types.ts new file mode 100644 index 0000000000..4902035250 --- /dev/null +++ b/packages/orbit-components/src/CallOutBanner/types.ts @@ -0,0 +1,17 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; +import Illustration from "../Illustration"; + +export interface Props extends Common.Globals { + readonly tabIndex?: number; + readonly onClick?: Common.Callback; + readonly title: Common.Translation; + readonly description?: Common.Translation; + readonly illustration?: React.ReactElement; + readonly actions?: React.ReactNode; + readonly children?: React.ReactNode; +} diff --git a/packages/orbit-components/src/Card/Card.stories.jsx b/packages/orbit-components/src/Card/Card.stories.jsx deleted file mode 100644 index d90620184f..0000000000 --- a/packages/orbit-components/src/Card/Card.stories.jsx +++ /dev/null @@ -1,352 +0,0 @@ -// @flow -import * as React from "react"; -import { text, boolean, select } from "@storybook/addon-knobs"; -import { action } from "@storybook/addon-actions"; - -import RenderInRtl from "../utils/rtl/RenderInRtl"; -import CarrierLogo from "../CarrierLogo"; -import Stack from "../Stack"; -import Text from "../Text"; -import Button from "../Button"; -import Badge from "../Badge"; -import Clock from "../icons/Clock"; -import CardSection from "./CardSection"; -import * as Icons from "../icons"; -import { ELEMENT_OPTIONS } from "../Heading/consts"; - -import Card from "."; - -export default { - title: "Card", -}; - -export const Default = (): React.Node => { - const title = text("Title", "Card with title"); - const titleAs = select("titleAs", Object.values(ELEMENT_OPTIONS), ELEMENT_OPTIONS.H2); - return } title={title} titleAs={titleAs} />; -}; - -export const CardWithDescription = (): React.Node => { - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - return ( - } - onClose={action("onClose")} - title={title} - description={description} - /> - ); -}; - -CardWithDescription.story = { - name: "Card with description", -}; - -export const CardWithActions = (): React.Node => { - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - return ( - } - title={title} - description={description} - actions={} - /> - ); -}; - -CardWithActions.story = { - name: "Card with actions", -}; - -export const CardWithOnlySection = (): React.Node => { - return ( - - This is content of card - - ); -}; - -CardWithOnlySection.story = { - name: "Card with only section", -}; - -export const CardWithSections = (): React.Node => { - const titleAs = select("titleAs", Object.values(ELEMENT_OPTIONS), ELEMENT_OPTIONS.H2); - const sectionTitle = text("SectionTitle", "Section Title"); - const sectionDescription = text("SectionDescription", "Section Description"); - return ( - - } - description={sectionDescription} - titleAs={titleAs} - /> - } - title={sectionTitle} - description={sectionDescription} - titleAs={titleAs} - /> - } - title={sectionTitle} - description={sectionDescription} - titleAs={titleAs} - /> - - ); -}; - -CardWithSections.story = { - name: "Card with sections", -}; - -export const CardWithExpandableSections = (): React.Node => { - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - const sectionTitle = text("SectionTitle", "Section Title"); - return ( - - - This is a section content - - - This is a section content - - - This is a section content - - - ); -}; - -CardWithExpandableSections.story = { - name: "Card with expandable sections", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CardWithControlledAndUncontrolled = (): React.Node => { - const expanded = boolean("expanded", true); - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - const sectionTitle = text("SectionTitle", "Section Title"); - return ( - - - This is a section content - - - This is a section content - - - ); -}; - -CardWithControlledAndUncontrolled.story = { - name: "Card with controlled and uncontrolled", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CardWithControlledWithKnobe = (): React.Node => { - const expanded = boolean("expanded", false); - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - const sectionTitle = text("SectionTitle", "Section Title"); - return ( - - - This is a section content - - - ); -}; - -CardWithControlledWithKnobe.story = { - name: "Card with controlled with knobe", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CardWithDefaultExpanded = (): React.Node => { - const initialExpanded = boolean("initialExpended", true); - return ( - - } - header={ - - Trip length: 1h55m - } type="warning"> - Unavailable - - - } - > - Hidden content - - - Close - - } - icon={} - onClose={action("onClose")} - header={ - - Trip length: 1h55m - } type="warning"> - Unavailable - - - } - > - By default visible content - - - ); -}; - -CardWithDefaultExpanded.story = { - name: "Card with default expanded", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const CardWithMixedSections = (): React.Node => { - const title = text("Title", "Card with title"); - const description = text("Description", "This is description of the card"); - const sectionTitle = text("SectionTitle", "Section Title"); - const sectionDescription = text("SectionDescription", "Section Description"); - return ( - Button}> - } - title={sectionTitle} - actions={ - - } - description={sectionDescription} - > - Section Content - - - Expandable Content - - - Section Content - - - ); -}; - -CardWithMixedSections.story = { - name: "Card with mixed sections", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const LoadingCard = (): React.Node => { - const title = text("Title", "Card with title"); - return ( - - kek - - ); -}; - -LoadingCard.story = { - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Rtl = (): React.Node => ( - - } - description="Description of the CardHeader" - > - - Text in content - - - Text in content - - - Text in content - - - Action} - > - Text in content - - - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: - "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Accessibility = (): React.Node => { - const title = text("Title", "Card with title"); - const dataA11ySection = text("dataA11ySection", "ID-OF-CARD"); - return ; -}; - -Accessibility.story = { - parameters: { - info: "This is a preview of component accessibility props", - }, -}; diff --git a/packages/orbit-components/src/Card/Card.stories.tsx b/packages/orbit-components/src/Card/Card.stories.tsx new file mode 100644 index 0000000000..72ae2414e3 --- /dev/null +++ b/packages/orbit-components/src/Card/Card.stories.tsx @@ -0,0 +1,351 @@ +import * as React from "react"; +import { text, boolean, select } from "@storybook/addon-knobs"; +import { action } from "@storybook/addon-actions"; + +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import CarrierLogo from "../CarrierLogo"; +import Stack from "../Stack"; +import Text from "../Text"; +import Button from "../Button"; +import Badge from "../Badge"; +import Clock from "../icons/Clock"; +import CardSection from "./CardSection"; +import * as Icons from "../icons"; +import { ELEMENT_OPTIONS } from "../Heading/consts"; + +import Card from "."; + +export default { + title: "Card", +}; + +export const Default = () => { + const title = text("Title", "Card with title"); + const titleAs = select("titleAs", Object.values(ELEMENT_OPTIONS), ELEMENT_OPTIONS.H2); + return } title={title} titleAs={titleAs} />; +}; + +export const CardWithDescription = () => { + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + return ( + } + onClose={action("onClose")} + title={title} + description={description} + /> + ); +}; + +CardWithDescription.story = { + name: "Card with description", +}; + +export const CardWithActions = () => { + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + return ( + } + title={title} + description={description} + actions={} + /> + ); +}; + +CardWithActions.story = { + name: "Card with actions", +}; + +export const CardWithOnlySection = () => { + return ( + + This is content of card + + ); +}; + +CardWithOnlySection.story = { + name: "Card with only section", +}; + +export const CardWithSections = () => { + const titleAs = select("titleAs", Object.values(ELEMENT_OPTIONS), ELEMENT_OPTIONS.H2); + const sectionTitle = text("SectionTitle", "Section Title"); + const sectionDescription = text("SectionDescription", "Section Description"); + return ( + + } + description={sectionDescription} + titleAs={titleAs} + /> + } + title={sectionTitle} + description={sectionDescription} + titleAs={titleAs} + /> + } + title={sectionTitle} + description={sectionDescription} + titleAs={titleAs} + /> + + ); +}; + +CardWithSections.story = { + name: "Card with sections", +}; + +export const CardWithExpandableSections = () => { + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + const sectionTitle = text("SectionTitle", "Section Title"); + return ( + + + This is a section content + + + This is a section content + + + This is a section content + + + ); +}; + +CardWithExpandableSections.story = { + name: "Card with expandable sections", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CardWithControlledAndUncontrolled = () => { + const expanded = boolean("expanded", true); + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + const sectionTitle = text("SectionTitle", "Section Title"); + return ( + + + This is a section content + + + This is a section content + + + ); +}; + +CardWithControlledAndUncontrolled.story = { + name: "Card with controlled and uncontrolled", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CardWithControlledWithKnobe = () => { + const expanded = boolean("expanded", false); + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + const sectionTitle = text("SectionTitle", "Section Title"); + return ( + + + This is a section content + + + ); +}; + +CardWithControlledWithKnobe.story = { + name: "Card with controlled with knobe", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CardWithDefaultExpanded = () => { + const initialExpanded = boolean("initialExpended", true); + return ( + + } + header={ + + Trip length: 1h55m + } type="warning"> + Unavailable + + + } + > + Hidden content + + + Close + + } + icon={} + onClose={action("onClose")} + header={ + + Trip length: 1h55m + } type="warning"> + Unavailable + + + } + > + By default visible content + + + ); +}; + +CardWithDefaultExpanded.story = { + name: "Card with default expanded", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const CardWithMixedSections = () => { + const title = text("Title", "Card with title"); + const description = text("Description", "This is description of the card"); + const sectionTitle = text("SectionTitle", "Section Title"); + const sectionDescription = text("SectionDescription", "Section Description"); + return ( + Button}> + } + title={sectionTitle} + actions={ + + } + description={sectionDescription} + > + Section Content + + + Expandable Content + + + Section Content + + + ); +}; + +CardWithMixedSections.story = { + name: "Card with mixed sections", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const LoadingCard = () => { + const title = text("Title", "Card with title"); + return ( + + kek + + ); +}; + +LoadingCard.story = { + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Rtl = () => ( + + } + description="Description of the CardHeader" + > + + Text in content + + + Text in content + + + Text in content + + + Action} + > + Text in content + + + +); + +Rtl.story = { + name: "RTL", + + parameters: { + info: + "Card sections allow you to create separate sections in every card when you need to create more advanced content structure. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Accessibility = () => { + const title = text("Title", "Card with title"); + const dataA11ySection = text("dataA11ySection", "ID-OF-CARD"); + return ; +}; + +Accessibility.story = { + parameters: { + info: "This is a preview of component accessibility props", + }, +}; diff --git a/packages/orbit-components/src/Card/CardContext.js b/packages/orbit-components/src/Card/CardContext.js deleted file mode 100644 index 261d54ef59..0000000000 --- a/packages/orbit-components/src/Card/CardContext.js +++ /dev/null @@ -1,24 +0,0 @@ -// @flow -import * as React from "react"; - -import type { Context } from "./CardContext"; - -export const cardDefault: Context = { - setExpandedSections: () => {}, - addSection: () => {}, - isOpened: false, - removeSection: () => {}, - roundedBorders: { - top: false, - bottom: false, - }, - index: 0, - noBorderTop: false, -}; - -const context: React.Context = React.createContext(cardDefault); -context.displayName = "CardOrbitContext"; - -export const useCard = (): Context => React.useContext(context); - -export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Card/CardContext.js.flow b/packages/orbit-components/src/Card/CardContext.js.flow deleted file mode 100644 index 4a15a22193..0000000000 --- a/packages/orbit-components/src/Card/CardContext.js.flow +++ /dev/null @@ -1,25 +0,0 @@ -// @flow -import * as React from "react"; - -type RoundedBorders = {| - top: boolean, - bottom: boolean, -|}; - -export type Context = {| - +setExpandedSections?: (arr: number[]) => void, - +roundedBorders: RoundedBorders, - +addSection: (index: number) => void, - +removeSection: (index: number) => void, - +index: number, - +isOpened: boolean, - +noBorderTop: boolean, -|}; - -declare export var cardDefault: Context; - -declare export var context: React.Context; - -declare export function useCard(): Context; - -export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Card/CardContext.ts b/packages/orbit-components/src/Card/CardContext.ts new file mode 100644 index 0000000000..a113572e6f --- /dev/null +++ b/packages/orbit-components/src/Card/CardContext.ts @@ -0,0 +1,29 @@ +import * as React from "react"; + +interface Context { + addSection: (arg: number) => void; + isOpened: boolean; + removeSection: (arg: number) => void; + roundedBorders: Record<"top" | "bottom", boolean>; + index: number; + noBorderTop: boolean; +} + +export const cardDefault: Context = { + addSection: () => {}, + isOpened: false, + removeSection: () => {}, + roundedBorders: { + top: false, + bottom: false, + }, + index: 0, + noBorderTop: false, +}; + +const context = React.createContext(cardDefault); +context.displayName = "CardOrbitContext"; + +export const useCard = (): Context => React.useContext(context); + +export const { Consumer, Provider } = context; diff --git a/packages/orbit-components/src/Card/CardSection/components/SectionContent.jsx b/packages/orbit-components/src/Card/CardSection/components/SectionContent.jsx deleted file mode 100644 index 3571c4875a..0000000000 --- a/packages/orbit-components/src/Card/CardSection/components/SectionContent.jsx +++ /dev/null @@ -1,78 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import transition from "../../../utils/transition"; -import defaultTheme from "../../../defaultTheme"; -import Slide from "../../../utils/Slide"; -import mq from "../../../utils/mediaQuery"; -import useBoundingRect from "../../../hooks/useBoundingRect"; - -const StyledCardSectionContent = styled.div` - font-family: ${({ theme }) => theme.orbit.fontFamily}; - font-size: ${({ theme }) => theme.orbit.fontSizeTextNormal}; - line-height: ${({ theme }) => theme.orbit.lineHeightTextNormal}; - color: ${({ theme }) => theme.orbit.colorTextPrimary}; - width: 100%; - border-top: ${({ theme, expanded, noSeparator }) => - expanded && !noSeparator - ? `1px solid ${theme.orbit.paletteCloudNormal}` - : `0px solid ${theme.orbit.paletteCloudNormal}`}; - padding-top: ${({ hasPaddingTop, theme }) => hasPaddingTop && theme.orbit.spaceMedium}; - transition: ${transition(["padding", "border-top"], "fast", "linear")}; - - ${mq.largeMobile(css` - padding-top: ${({ theme, hasPaddingTop }) => hasPaddingTop && theme.orbit.spaceLarge}; - `)} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCardSectionContent.defaultProps = { - theme: defaultTheme, -}; - -type Props = {| - expandable: boolean, - expanded?: boolean, - children?: React.Node, - noSeparator?: boolean, - hasPaddingTop: boolean, - slideID: string, - labelID: string, -|}; - -const SectionContent = ({ - expandable, - expanded, - children, - noSeparator, - hasPaddingTop, - slideID, - labelID, -}: Props): React.Node => { - const [{ height }, ref] = useBoundingRect({ height: expanded ? null : 0 }); - - return ( - <> - {expandable ? ( - - - {children} - - - ) : ( - - {children} - - )} - - ); -}; - -export default SectionContent; diff --git a/packages/orbit-components/src/Card/CardSection/components/SectionContent.tsx b/packages/orbit-components/src/Card/CardSection/components/SectionContent.tsx new file mode 100644 index 0000000000..6d1cea9911 --- /dev/null +++ b/packages/orbit-components/src/Card/CardSection/components/SectionContent.tsx @@ -0,0 +1,77 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import transition from "../../../utils/transition"; +import defaultTheme from "../../../defaultTheme"; +import Slide from "../../../utils/Slide"; +import mq from "../../../utils/mediaQuery"; +import useBoundingRect from "../../../hooks/useBoundingRect"; + +interface Props { + expandable: boolean; + expanded?: boolean; + children?: React.ReactNode; + noSeparator?: boolean; + hasPaddingTop: boolean; + slideID: string; + labelID: string; +} + +const StyledCardSectionContent = styled.div>` + ${({ theme, expanded, noSeparator, hasPaddingTop }) => css` + font-family: ${theme.orbit.fontFamily}; + font-size: ${theme.orbit.fontSizeTextNormal}; + line-height: ${theme.orbit.lineHeightTextNormal}; + color: ${theme.orbit.colorTextPrimary}; + width: 100%; + border-top: ${expanded && !noSeparator + ? `1px solid ${theme.orbit.paletteCloudNormal}` + : `0px solid ${theme.orbit.paletteCloudNormal}`}; + padding-top: ${hasPaddingTop && theme.orbit.spaceMedium}; + transition: ${transition(["padding", "border-top"], "fast", "linear")}; + + ${mq.largeMobile(css` + padding-top: ${theme.orbit.spaceLarge}; + `)} + `} +`; + +StyledCardSectionContent.defaultProps = { + theme: defaultTheme, +}; + +const SectionContent = ({ + expandable, + expanded, + children, + noSeparator, + hasPaddingTop, + slideID, + labelID, +}: Props) => { + const [{ height }, ref] = useBoundingRect({ height: expanded ? null : 0 }); + + return ( + <> + {expandable ? ( + + + {children} + + + ) : ( + + {children} + + )} + + ); +}; + +export default SectionContent; diff --git a/packages/orbit-components/src/Card/CardSection/components/SectionHeader.jsx b/packages/orbit-components/src/Card/CardSection/components/SectionHeader.jsx deleted file mode 100644 index b6deeda3c1..0000000000 --- a/packages/orbit-components/src/Card/CardSection/components/SectionHeader.jsx +++ /dev/null @@ -1,113 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import transition from "../../../utils/transition"; -import mq from "../../../utils/mediaQuery"; -import { getSize } from "../../../Icon"; -import { ICON_SIZES } from "../../../Icon/consts"; -import defaultTheme from "../../../defaultTheme"; -import Header from "../../components/Header"; -import type { As } from "../../../Heading"; - -const SpacingMobile = css` - ${({ theme }) => String(parseInt(theme.orbit.spaceMedium, 10) + 1)}px; -`; - -const SpacingDesktop = css` - ${({ theme }) => String(parseInt(theme.orbit.spaceLarge, 10) + 1)}px; -`; - -const StyledCardSectionHeader = styled.div` - transition: ${transition(["margin"], "fast", "linear")}; - cursor: ${({ expandable }) => expandable && "pointer"}; - position: relative; - padding: ${({ theme }) => theme.orbit.spaceMedium}; - margin: -${SpacingMobile}; - margin-bottom: ${({ expanded, isContent }) => expanded && isContent && 0}; - min-height: ${({ expandable }) => expandable && getSize(ICON_SIZES.MEDIUM)}; - - ${mq.largeMobile(css` - margin: -${SpacingDesktop}; - padding: ${({ theme }) => theme.orbit.spaceLarge}; - margin-bottom: ${({ expanded, isContent }) => expanded && isContent && 0}; - `)} - - &:hover { - background: ${({ theme, expandable }) => expandable && theme.orbit.paletteWhiteHover}; - } - - &:focus { - background: ${({ theme, expandable }) => expandable && theme.orbit.paletteWhiteHover}; - z-index: 1; - } -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCardSectionHeader.defaultProps = { - theme: defaultTheme, -}; - -type Props = {| - title?: React.Node, - titleAs?: As, - description?: React.Node, - icon?: React.Node, - actions?: React.Node, - dataA11ySection?: string, - header?: React.Node, - expandable?: boolean, - expanded?: boolean, - handleKeyDown: (ev: SyntheticKeyboardEvent) => void, - onClick?: () => void, - slideID: string, - isContent: boolean, - labelID: string, -|}; - -const CardSectionHeader = ({ - title, - titleAs, - description, - icon, - isContent, - expandable, - expanded, - onClick, - slideID, - labelID, - actions, - handleKeyDown, - header, - dataA11ySection, -}: Props): React.Node => { - return ( - -
- - ); -}; - -export default CardSectionHeader; diff --git a/packages/orbit-components/src/Card/CardSection/components/SectionHeader.tsx b/packages/orbit-components/src/Card/CardSection/components/SectionHeader.tsx new file mode 100644 index 0000000000..1fb256f267 --- /dev/null +++ b/packages/orbit-components/src/Card/CardSection/components/SectionHeader.tsx @@ -0,0 +1,117 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import transition from "../../../utils/transition"; +import mq from "../../../utils/mediaQuery"; +import { getSize } from "../../../Icon"; +import { ICON_SIZES } from "../../../Icon/consts"; +import defaultTheme from "../../../defaultTheme"; +import Header from "../../components/Header"; +import { As } from "../../../Heading/types"; + +const SpacingMobile = css` + ${({ theme }) => String(parseInt(theme.orbit.spaceMedium, 10) + 1)}px; +`; + +const SpacingDesktop = css` + ${({ theme }) => String(parseInt(theme.orbit.spaceLarge, 10) + 1)}px; +`; + +const StyledCardSectionHeader = styled.div<{ + expandable?: boolean; + isContent?: boolean; + expanded?: boolean; +}>` + ${({ theme, expandable, isContent, expanded }) => css` + transition: ${transition(["margin"], "fast", "linear")}; + cursor: ${expandable && "pointer"}; + position: relative; + padding: ${theme.orbit.spaceMedium}; + margin: -${SpacingMobile}; + margin-bottom: ${expanded && isContent && 0}; + min-height: ${expandable && getSize(ICON_SIZES.MEDIUM)}; + + ${mq.largeMobile(css` + margin: -${SpacingDesktop}; + padding: ${theme.orbit.spaceLarge}; + margin-bottom: ${expanded && isContent && 0}; + `)} + + &:hover { + background: ${expandable && theme.orbit.paletteWhiteHover}; + } + + &:focus { + background: ${expandable && theme.orbit.paletteWhiteHover}; + z-index: 1; + } + `} +`; + +StyledCardSectionHeader.defaultProps = { + theme: defaultTheme, +}; + +interface Props { + title?: React.ReactNode; + titleAs?: As; + description?: React.ReactNode; + icon?: React.ReactNode; + actions?: React.ReactNode; + dataA11ySection?: string; + header?: React.ReactNode; + expandable?: boolean; + expanded?: boolean; + handleKeyDown: React.KeyboardEventHandler; + onClick?: React.MouseEventHandler; + slideID: string; + isContent: boolean; + labelID: string; +} + +const CardSectionHeader = ({ + title, + titleAs, + description, + icon, + isContent, + expandable, + expanded, + onClick, + slideID, + labelID, + actions, + handleKeyDown, + header, + dataA11ySection, +}: Props) => { + return ( + +
+ + ); +}; + +export default CardSectionHeader; diff --git a/packages/orbit-components/src/Card/CardSection/index.d.ts b/packages/orbit-components/src/Card/CardSection/index.d.ts deleted file mode 100644 index 0a96cd742c..0000000000 --- a/packages/orbit-components/src/Card/CardSection/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../../common/common"; - -export interface Props extends Common.Global { - readonly title?: React.ReactNode; - readonly icon?: React.ReactNode; - readonly description?: React.ReactNode; - readonly children?: React.ReactNode; - readonly expandable?: boolean; - readonly initialExpanded?: boolean; - readonly actions?: React.ReactNode; - readonly expanded?: boolean; - readonly noSeparator?: boolean; - readonly onClose?: Common.Callback; - readonly onExpand?: Common.Callback; - readonly onClick?: Common.Callback; - readonly header?: React.ReactNode; -} - -declare const CardSection: React.FunctionComponent; -export { CardSection, CardSection as default }; diff --git a/packages/orbit-components/src/Card/CardSection/index.js.flow b/packages/orbit-components/src/Card/CardSection/index.js.flow new file mode 100644 index 0000000000..2ddc613e13 --- /dev/null +++ b/packages/orbit-components/src/Card/CardSection/index.js.flow @@ -0,0 +1,28 @@ +// @flow +import * as React from "react"; +import type { StyledComponent } from "styled-components"; + +import type { Globals } from "../../common/common.js.flow"; +import type { As } from "../../Heading/index.js.flow"; + +export type Props = {| + +title?: React.Node, + +titleAs?: As, + +icon?: React.Node, + +description?: React.Node, + +children?: React.Node, + +expandable?: boolean, + +initialExpanded?: boolean, + +actions?: React.Node, + +expanded?: boolean, + +noSeparator?: boolean, + +onClick?: () => void | Promise, + +onClose?: () => void | Promise, + +onExpand?: () => void | Promise, + +header?: React.Node, + ...Globals, +|}; + +declare export var StyledCardSection: StyledComponent; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Card/CardSection/index.jsx b/packages/orbit-components/src/Card/CardSection/index.jsx deleted file mode 100644 index aeecb1770a..0000000000 --- a/packages/orbit-components/src/Card/CardSection/index.jsx +++ /dev/null @@ -1,133 +0,0 @@ -// @flow -import * as React from "react"; - -import KEY_CODE_MAP from "../../common/keyMaps"; -import CardWrapper from "../components/CardWrapper"; -import { useCard } from "../CardContext"; -import SectionHeader from "./components/SectionHeader"; -import SectionContent from "./components/SectionContent"; -import useRandomId from "../../hooks/useRandomId"; -import { ELEMENT_OPTIONS } from "../../Heading/consts"; - -import type { Props } from "."; - -const CardSection = ({ - title, - titleAs = ELEMENT_OPTIONS.DIV, - icon, - description, - onClick, - children, - expandable = false, - expanded, - initialExpanded = false, - onClose, - header, - onExpand, - dataTest, - actions, - noSeparator, -}: Props): React.Node => { - const { addSection, removeSection, index, roundedBorders, noBorderTop, isOpened } = useCard(); - const [opened, setOpened] = React.useState(isOpened || initialExpanded); - - const isControlled = React.useMemo(() => expanded != null, [expanded]); - - // effect that solves controlled component - React.useEffect(() => { - if (isControlled) { - if (expanded) { - addSection(index); - setOpened(true); - } else { - removeSection(index); - setOpened(false); - } - } - }, [addSection, expanded, index, isControlled, removeSection]); - - // effect that solves initialExpanded behavior - React.useEffect(() => { - if (initialExpanded) { - addSection(index); - setOpened(true); - } - }, [addSection, index, initialExpanded]); - - const handleClick = () => { - if (!isControlled) { - if (!opened) { - addSection(index); - setOpened(true); - } else { - removeSection(index); - setOpened(false); - } - } - - if (opened && onClose) { - onClose(); - } - - if (!opened && onExpand) { - onExpand(); - } - }; - - const handleKeyDown = (ev: SyntheticKeyboardEvent) => { - if (ev.keyCode === KEY_CODE_MAP.SPACE) { - ev.preventDefault(); - } - - if (ev.keyCode === KEY_CODE_MAP.ENTER || ev.keyCode === KEY_CODE_MAP.SPACE) { - handleClick(); - } - }; - - const slideID = useRandomId(); - - return ( - - {(title || header) && ( - - )} - - {children ? ( - - {children} - - ) : null} - - ); -}; - -export default CardSection; diff --git a/packages/orbit-components/src/Card/CardSection/index.jsx.flow b/packages/orbit-components/src/Card/CardSection/index.jsx.flow deleted file mode 100644 index 1d6f47eba5..0000000000 --- a/packages/orbit-components/src/Card/CardSection/index.jsx.flow +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import * as React from "react"; -import type { StyledComponent } from "styled-components"; - -import type { Globals } from "../../common/common.js.flow"; -import type { As } from "../../Heading"; - -export type Props = {| - +title?: React.Node, - +titleAs?: As, - +icon?: React.Node, - +description?: React.Node, - +children?: React.Node, - +expandable?: boolean, - +initialExpanded?: boolean, - +actions?: React.Node, - +expanded?: boolean, - +noSeparator?: boolean, - +onClick?: () => void | Promise, - +onClose?: () => void | Promise, - +onExpand?: () => void | Promise, - +header?: React.Node, - ...Globals, -|}; - -declare export var StyledCardSection: StyledComponent; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Card/CardSection/index.tsx b/packages/orbit-components/src/Card/CardSection/index.tsx new file mode 100644 index 0000000000..97b259f24f --- /dev/null +++ b/packages/orbit-components/src/Card/CardSection/index.tsx @@ -0,0 +1,131 @@ +import * as React from "react"; + +import KEY_CODE_MAP from "../../common/keyMaps"; +import CardWrapper from "../components/CardWrapper"; +import { useCard } from "../CardContext"; +import SectionHeader from "./components/SectionHeader"; +import SectionContent from "./components/SectionContent"; +import useRandomId from "../../hooks/useRandomId"; +import { ELEMENT_OPTIONS } from "../../Heading/consts"; +import { Props } from "./types"; + +const CardSection = ({ + title, + titleAs = ELEMENT_OPTIONS.DIV, + icon, + description, + onClick, + children, + expandable = false, + expanded, + initialExpanded = false, + onClose, + header, + onExpand, + dataTest, + actions, + noSeparator, +}: Props) => { + const { addSection, removeSection, index, roundedBorders, noBorderTop, isOpened } = useCard(); + const [opened, setOpened] = React.useState(isOpened || initialExpanded); + + const isControlled = React.useMemo(() => expanded != null, [expanded]); + + // effect that solves controlled component + React.useEffect(() => { + if (isControlled) { + if (expanded) { + addSection(index); + setOpened(true); + } else { + removeSection(index); + setOpened(false); + } + } + }, [addSection, expanded, index, isControlled, removeSection]); + + // effect that solves initialExpanded behavior + React.useEffect(() => { + if (initialExpanded) { + addSection(index); + setOpened(true); + } + }, [addSection, index, initialExpanded]); + + const handleClick = () => { + if (!isControlled) { + if (!opened) { + addSection(index); + setOpened(true); + } else { + removeSection(index); + setOpened(false); + } + } + + if (opened && onClose) { + onClose(); + } + + if (!opened && onExpand) { + onExpand(); + } + }; + + const handleKeyDown = (ev: React.KeyboardEvent) => { + if (ev.keyCode === KEY_CODE_MAP.SPACE) { + ev.preventDefault(); + } + + if (ev.keyCode === KEY_CODE_MAP.ENTER || ev.keyCode === KEY_CODE_MAP.SPACE) { + handleClick(); + } + }; + + const slideID = useRandomId(); + + return ( + + {(title || header) && ( + + )} + + {children ? ( + + {children} + + ) : null} + + ); +}; + +export default CardSection; diff --git a/packages/orbit-components/src/Card/CardSection/types.ts b/packages/orbit-components/src/Card/CardSection/types.ts new file mode 100644 index 0000000000..4dedbcc34e --- /dev/null +++ b/packages/orbit-components/src/Card/CardSection/types.ts @@ -0,0 +1,24 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../../common/types"; +import { As } from "../../Heading/types"; + +export interface Props extends Common.Globals { + readonly title?: React.ReactNode; + readonly titleAs?: As; + readonly icon?: React.ReactNode; + readonly description?: React.ReactNode; + readonly children?: React.ReactNode; + readonly expandable?: boolean; + readonly initialExpanded?: boolean; + readonly actions?: React.ReactNode; + readonly expanded?: boolean; + readonly noSeparator?: boolean; + readonly onClose?: Common.Callback; + readonly onExpand?: Common.Callback; + readonly onClick?: Common.Callback; + readonly header?: React.ReactNode; +} diff --git a/packages/orbit-components/src/Card/__tests__/index.test.jsx b/packages/orbit-components/src/Card/__tests__/index.test.jsx deleted file mode 100644 index 3fe02983ae..0000000000 --- a/packages/orbit-components/src/Card/__tests__/index.test.jsx +++ /dev/null @@ -1,114 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import Card, { CardSection } from ".."; -import Button from "../../Button"; -import { Airplane } from "../../icons"; - -describe("Card", () => { - it("default", () => { - render( - } - actions={} - />, - ); - expect(screen.getByTestId("test")); - expect(screen.getByText("kek")).toBeInTheDocument(); - expect(screen.getByText("description")).toBeInTheDocument(); - expect(screen.getByTestId("airplane")); - expect(screen.getByRole("button")); - }); - - it("section", () => { - render( - - } - actions={} - expandable - expanded - > - section - - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("kek")).toBeInTheDocument(); - expect(screen.getByText("description")).toBeInTheDocument(); - expect(screen.getByTestId("airplane")).toBeInTheDocument(); - expect(screen.getByRole("button", { name: "action" })).toBeInTheDocument(); - expect(screen.getByText("section")).toBeInTheDocument(); - }); - - it("loading", () => { - render( - - section - , - ); - expect(screen.queryByText("section")).not.toBeInTheDocument(); - }); - - it("should be clickable", () => { - const onClick = jest.fn(); - - render( - - - , - ); - - userEvent.click(screen.getByText("kek")); - expect(onClick).toHaveBeenCalled(); - }); - - describe("expandable", () => { - it("controlled", () => { - const { rerender } = render( - - - expandable - - , - ); - const content = document.querySelector("[aria-hidden]"); - expect(content).toHaveAttribute("aria-hidden", "true"); - userEvent.click(screen.getByText("kek")); - expect(content).toHaveAttribute("aria-hidden", "true"); - rerender( - - - expandable - - , - ); - expect(content).toHaveAttribute("aria-hidden", "false"); - userEvent.click(screen.getByText("kek")); - expect(content).toHaveAttribute("aria-hidden", "false"); - }); - - it("uncontrolled", () => { - render( - - - expandable - - , - ); - const content = document.querySelector("[aria-hidden]"); - expect(content).toHaveAttribute("aria-hidden", "true"); - userEvent.click(screen.getByText("kek")); - expect(content).toHaveAttribute("aria-hidden", "false"); - }); - }); -}); diff --git a/packages/orbit-components/src/Card/__tests__/index.test.tsx b/packages/orbit-components/src/Card/__tests__/index.test.tsx new file mode 100644 index 0000000000..4833c76543 --- /dev/null +++ b/packages/orbit-components/src/Card/__tests__/index.test.tsx @@ -0,0 +1,112 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import Card, { CardSection } from ".."; +import Button from "../../Button"; +import { Airplane } from "../../icons"; + +describe("Card", () => { + it("default", () => { + render( + } + actions={} + />, + ); + expect(screen.getByTestId("test")); + expect(screen.getByText("kek")).toBeInTheDocument(); + expect(screen.getByText("description")).toBeInTheDocument(); + expect(screen.getByTestId("airplane")); + expect(screen.getByRole("button")); + }); + + it("section", () => { + render( + + } + actions={} + expandable + expanded + > + section + + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("kek")).toBeInTheDocument(); + expect(screen.getByText("description")).toBeInTheDocument(); + expect(screen.getByTestId("airplane")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "action" })).toBeInTheDocument(); + expect(screen.getByText("section")).toBeInTheDocument(); + }); + + it("loading", () => { + render( + + section + , + ); + expect(screen.queryByText("section")).not.toBeInTheDocument(); + }); + + it("should be clickable", () => { + const onClick = jest.fn(); + + render( + + + , + ); + + userEvent.click(screen.getByText("kek")); + expect(onClick).toHaveBeenCalled(); + }); + + describe("expandable", () => { + it("controlled", () => { + const { rerender } = render( + + + expandable + + , + ); + const content = document.querySelector("[aria-hidden]"); + expect(content).toHaveAttribute("aria-hidden", "true"); + userEvent.click(screen.getByText("kek")); + expect(content).toHaveAttribute("aria-hidden", "true"); + rerender( + + + expandable + + , + ); + expect(content).toHaveAttribute("aria-hidden", "false"); + userEvent.click(screen.getByText("kek")); + expect(content).toHaveAttribute("aria-hidden", "false"); + }); + + it("uncontrolled", () => { + render( + + + expandable + + , + ); + const content = document.querySelector("[aria-hidden]"); + expect(content).toHaveAttribute("aria-hidden", "true"); + userEvent.click(screen.getByText("kek")); + expect(content).toHaveAttribute("aria-hidden", "false"); + }); + }); +}); diff --git a/packages/orbit-components/src/Card/components/CardWrapper/index.jsx.flow b/packages/orbit-components/src/Card/components/CardWrapper/index.js.flow similarity index 100% rename from packages/orbit-components/src/Card/components/CardWrapper/index.jsx.flow rename to packages/orbit-components/src/Card/components/CardWrapper/index.js.flow diff --git a/packages/orbit-components/src/Card/components/CardWrapper/index.jsx b/packages/orbit-components/src/Card/components/CardWrapper/index.jsx deleted file mode 100644 index a1a4af19d2..0000000000 --- a/packages/orbit-components/src/Card/components/CardWrapper/index.jsx +++ /dev/null @@ -1,140 +0,0 @@ -// @flow -import styled, { css } from "styled-components"; -import * as React from "react"; - -import transition from "../../../utils/transition"; -import mq from "../../../utils/mediaQuery"; -import { CardElement } from "../../helpers/mixins"; -import defaultTheme from "../../../defaultTheme"; -import { getBorder, getBorderRadius, getBorderRadiusMobile } from "../../helpers/borders"; - -import type { Props } from "."; - -const topBorderRadius = css` - border-top-left-radius: ${({ expanded }) => expanded && getBorderRadiusMobile}; - border-top-right-radius: ${({ expanded }) => expanded && getBorderRadiusMobile}; - - ${mq.largeMobile(css` - border-top-left-radius: ${getBorderRadius}; - border-top-right-radius: ${getBorderRadius}; - `)} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -topBorderRadius.defaultTheme = { - theme: defaultTheme, -}; - -const bottomBorderRadius = css` - border-bottom-left-radius: ${({ expanded }) => expanded && getBorderRadiusMobile}; - border-bottom-right-radius: ${({ expanded }) => expanded && getBorderRadiusMobile}; - - ${mq.largeMobile(css` - border-bottom-left-radius: ${getBorderRadius}; - border-bottom-right-radius: ${getBorderRadius}; - `)} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -bottomBorderRadius.defaultProps = { - theme: defaultTheme, -}; - -const StyledCardWrapper = styled.div` - ${({ - theme, - expandable, - expanded, - noPadding, - noBorderTop, - bottomBorder, - roundedTop, - roundedBottom, - onClick, - }) => css` - padding: ${!noPadding && theme.orbit.spaceMedium}; - cursor: ${onClick && `pointer`}; - ${CardElement}; - ${bottomBorder && bottomBorderRadius}; - border-bottom: ${(roundedBottom || bottomBorder) && getBorder}; - transition: ${transition(["margin"], "fast", "ease-in-out")}; - ${noBorderTop && - !expandable && - ` - border-top: 1px solid transparent; - padding-top: 0 !important; - `}; - - ${expanded && - ` - margin: ${theme.orbit.spaceXSmall} 0; - border: 1px solid transparent; - `}; - - ${roundedTop && topBorderRadius}; - ${roundedBottom && bottomBorderRadius} - - &:last-of-type { - ${!expanded && - css` - border-bottom: ${getBorder}; - `} - } - - ${mq.largeMobile(css` - &:first-of-type { - ${topBorderRadius}; - } - - &:last-of-type { - ${bottomBorderRadius}; - } - - padding: ${!noPadding && theme.orbit.spaceLarge}; - `)} - - &:focus { - background: ${theme.orbit.paletteWhiteHover}; - } - - &:hover { - background: ${onClick && theme.orbit.paletteWhiteHover}; - } - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCardWrapper.defaultProps = { - theme: defaultTheme, -}; - -const CardWrapper = ({ - children, - onClick, - bottomBorder, - roundedBottom, - roundedTop, - expanded, - noBorderTop, - dataTest, - noPadding, - expandable, - initialExpanded, -}: Props): React.Node => ( - - {children} - -); - -export default CardWrapper; diff --git a/packages/orbit-components/src/Card/components/CardWrapper/index.tsx b/packages/orbit-components/src/Card/components/CardWrapper/index.tsx new file mode 100644 index 0000000000..3bb9400b98 --- /dev/null +++ b/packages/orbit-components/src/Card/components/CardWrapper/index.tsx @@ -0,0 +1,130 @@ +import styled, { css } from "styled-components"; +import * as React from "react"; + +import transition from "../../../utils/transition"; +import mq from "../../../utils/mediaQuery"; +import { CardElement } from "../../helpers/mixins"; +import defaultTheme from "../../../defaultTheme"; +import { getBorder, getBorderRadius, getBorderRadiusMobile } from "../../helpers/borders"; +import { Props } from "./types"; + +const topBorderRadius = css` + border-top-left-radius: ${({ expanded }: { expanded?: boolean }) => + expanded && getBorderRadiusMobile}; + border-top-right-radius: ${({ expanded }: { expanded?: boolean }) => + expanded && getBorderRadiusMobile}; + + ${mq.largeMobile(css` + border-top-left-radius: ${getBorderRadius}; + border-top-right-radius: ${getBorderRadius}; + `)} +`; + +const bottomBorderRadius = css` + ${({ expanded }: { expanded?: boolean }) => css` + border-bottom-left-radius: ${expanded && getBorderRadiusMobile}; + border-bottom-right-radius: ${expanded && getBorderRadiusMobile}; + ${mq.largeMobile(css` + border-bottom-left-radius: ${getBorderRadius}; + border-bottom-right-radius: ${getBorderRadius}; + `)} + `} +`; + +const StyledCardWrapper = styled.div` + ${({ + theme, + expandable, + expanded, + noPadding, + noBorderTop, + bottomBorder, + roundedTop, + roundedBottom, + onClick, + }) => css` + padding: ${!noPadding && theme.orbit.spaceMedium}; + cursor: ${onClick && `pointer`}; + ${CardElement}; + ${bottomBorder && bottomBorderRadius}; + border-bottom: ${(roundedBottom || bottomBorder) && getBorder}; + transition: ${transition(["margin"], "fast", "ease-in-out")}; + ${noBorderTop && + !expandable && + ` + border-top: 1px solid transparent; + padding-top: 0 !important; + `}; + + ${expanded && + ` + margin: ${theme.orbit.spaceXSmall} 0; + border: 1px solid transparent; + `}; + + ${roundedTop && topBorderRadius}; + ${roundedBottom && bottomBorderRadius} + + &:last-of-type { + ${!expanded && + css` + border-bottom: ${getBorder}; + `} + } + + ${mq.largeMobile(css` + &:first-of-type { + ${topBorderRadius}; + } + + &:last-of-type { + ${bottomBorderRadius}; + } + + padding: ${!noPadding && theme.orbit.spaceLarge}; + `)} + + &:focus { + background: ${theme.orbit.paletteWhiteHover}; + } + + &:hover { + background: ${onClick && theme.orbit.paletteWhiteHover}; + } + `}; +`; + +StyledCardWrapper.defaultProps = { + theme: defaultTheme, +}; + +const CardWrapper = ({ + children, + onClick, + bottomBorder, + roundedBottom, + roundedTop, + expanded, + noBorderTop, + dataTest, + noPadding, + expandable, + initialExpanded, +}: Props) => ( + + {children} + +); + +export default CardWrapper; diff --git a/packages/orbit-components/src/Card/components/CardWrapper/types.ts b/packages/orbit-components/src/Card/components/CardWrapper/types.ts new file mode 100644 index 0000000000..b6bf1180b5 --- /dev/null +++ b/packages/orbit-components/src/Card/components/CardWrapper/types.ts @@ -0,0 +1,15 @@ +import * as React from "react"; + +export interface Props { + readonly children: React.ReactNode; + readonly onClick?: React.MouseEventHandler; + readonly bottomBorder?: boolean; + readonly roundedBottom?: boolean; + readonly roundedTop?: boolean; + readonly expanded?: boolean; + readonly noPadding?: boolean; + readonly dataTest?: string; + readonly noBorderTop?: boolean; + readonly expandable?: boolean; + readonly initialExpanded?: boolean; +} diff --git a/packages/orbit-components/src/Card/components/Header/index.js.flow b/packages/orbit-components/src/Card/components/Header/index.js.flow new file mode 100644 index 0000000000..2605480a59 --- /dev/null +++ b/packages/orbit-components/src/Card/components/Header/index.js.flow @@ -0,0 +1,20 @@ +// @flow +import * as React from "react"; + +import type { As } from "../../../Heading/index.js.flow"; + +export type Props = {| + +description?: React.Node, + +icon?: React.Node, + +actions?: React.Node, + +onClose?: () => void | Promise, + +title?: React.Node, + +titleAs?: As, + +isSection?: boolean, + +dataA11ySection?: string, + +expandable?: boolean, + +expanded?: boolean, + +header?: React.Node, +|}; + +declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Card/components/Header/index.jsx b/packages/orbit-components/src/Card/components/Header/index.jsx deleted file mode 100644 index 51605e34a0..0000000000 --- a/packages/orbit-components/src/Card/components/Header/index.jsx +++ /dev/null @@ -1,101 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import transition from "../../../utils/transition"; -import { right } from "../../../utils/rtl"; -import defaultTheme from "../../../defaultTheme"; -import ChevronDown from "../../../icons/ChevronDown"; -import Stack from "../../../Stack"; -import Heading from "../../../Heading"; -import Text from "../../../Text"; -import Close from "../../../icons/Close"; -import useTranslate from "../../../hooks/useTranslate"; -import ButtonLink from "../../../ButtonLink"; - -import type { Props } from "."; - -const ChevronIcon = styled(ChevronDown)` - transform: ${({ expanded }) => expanded && "rotate(-180deg)"}; - transition: ${transition(["transform"], "fast", "ease-in-out")}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -ChevronIcon.defaultProps = { - theme: defaultTheme, -}; - -const StyledCloseContainer = styled.div` - position: absolute; - top: 0; - ${right}: 0; - z-index: 1; -`; - -const CardCloseButton = ({ onClick }) => { - const translate = useTranslate(); - return ( - } - onClick={onClick} - title={translate("button_close")} - /> - ); -}; - -const Header = ({ - description, - icon, - title, - titleAs, - isSection, - actions, - dataA11ySection, - onClose, - header, - expandable, - expanded, -}: Props): React.Node => ( - - {(title || description || icon) && !header && ( - - - {icon} - {title && ( - - {title} - - )} - - {description && {description}} - - )} - {header && icon} - {header} - {expandable && !actions && } - {actions && ( - - {actions} - - )} - {onClose && !actions && ( - - - - )} - -); - -export default Header; diff --git a/packages/orbit-components/src/Card/components/Header/index.jsx.flow b/packages/orbit-components/src/Card/components/Header/index.jsx.flow deleted file mode 100644 index 5af2251ae2..0000000000 --- a/packages/orbit-components/src/Card/components/Header/index.jsx.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow -import * as React from "react"; - -import type { As } from "../../../Heading"; - -export type Props = {| - +description?: React.Node, - +icon?: React.Node, - +actions?: React.Node, - +onClose?: () => void | Promise, - +title?: React.Node, - +titleAs?: As, - +isSection?: boolean, - +dataA11ySection?: string, - +expandable?: boolean, - +expanded?: boolean, - +header?: React.Node, -|}; - -declare export default React.ComponentType; diff --git a/packages/orbit-components/src/Card/components/Header/index.tsx b/packages/orbit-components/src/Card/components/Header/index.tsx new file mode 100644 index 0000000000..827992bb4b --- /dev/null +++ b/packages/orbit-components/src/Card/components/Header/index.tsx @@ -0,0 +1,98 @@ +import * as React from "react"; +import styled from "styled-components"; + +import transition from "../../../utils/transition"; +import { right } from "../../../utils/rtl"; +import defaultTheme from "../../../defaultTheme"; +import ChevronDown from "../../../icons/ChevronDown"; +import Stack from "../../../Stack"; +import Heading from "../../../Heading"; +import Text from "../../../Text"; +import Close from "../../../icons/Close"; +import useTranslate from "../../../hooks/useTranslate"; +import ButtonLink from "../../../ButtonLink"; +import { Props } from "./types"; + +const ChevronIcon = styled(ChevronDown)<{ expanded?: Props["expanded"] }>` + transform: ${({ expanded }) => expanded && "rotate(-180deg)"}; + transition: ${transition(["transform"], "fast", "ease-in-out")}; +`; + +ChevronIcon.defaultProps = { + theme: defaultTheme, +}; + +const StyledCloseContainer = styled.div` + position: absolute; + top: 0; + ${right}: 0; + z-index: 1; +`; + +const CardCloseButton = ({ onClick }) => { + const translate = useTranslate(); + return ( + } + onClick={onClick} + title={translate("button_close")} + /> + ); +}; + +const Header = ({ + description, + icon, + title, + titleAs, + isSection, + actions, + dataA11ySection, + onClose, + header, + expandable, + expanded, +}: Props) => ( + + {(title || description || icon) && !header && ( + + + {icon} + {title && ( + + {title} + + )} + + {description && {description}} + + )} + {header && icon} + {header} + {expandable && !actions && } + {actions && ( + + {actions} + + )} + {onClose && !actions && ( + + + + )} + +); + +export default Header; diff --git a/packages/orbit-components/src/Card/components/Header/types.ts b/packages/orbit-components/src/Card/components/Header/types.ts new file mode 100644 index 0000000000..dd623b3886 --- /dev/null +++ b/packages/orbit-components/src/Card/components/Header/types.ts @@ -0,0 +1,18 @@ +import * as React from "react"; + +import * as Common from "../../../common/types"; +import { As } from "../../../Heading/types"; + +export interface Props { + description?: React.ReactNode; + icon?: React.ReactNode; + actions?: React.ReactNode; + onClose?: Common.Event>; + title?: React.ReactNode; + titleAs?: As; + isSection?: boolean; + dataA11ySection?: string; + expandable?: boolean; + expanded?: boolean; + header?: React.ReactNode; +} diff --git a/packages/orbit-components/src/Card/helpers/borders.js b/packages/orbit-components/src/Card/helpers/borders.js deleted file mode 100644 index 4d10f7e0fd..0000000000 --- a/packages/orbit-components/src/Card/helpers/borders.js +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import type { ThemeProps } from "../../defaultTheme"; - -export const getBorder = ({ theme }: ThemeProps): string => - `${theme.orbit.borderWidthCard} ${theme.orbit.borderStyleCard} ${theme.orbit.borderColorCard}`; - -export const getBorderRadius = ({ theme }: ThemeProps): string => - `${theme.orbit.borderRadiusNormal}`; - -export const getBorderRadiusMobile = ({ theme }: ThemeProps): string => - `${theme.orbit.borderRadiusLarge}`; diff --git a/packages/orbit-components/src/Card/helpers/borders.ts b/packages/orbit-components/src/Card/helpers/borders.ts new file mode 100644 index 0000000000..9c8f5426c1 --- /dev/null +++ b/packages/orbit-components/src/Card/helpers/borders.ts @@ -0,0 +1,10 @@ +import { ThemeProps } from "../../defaultTheme"; + +export const getBorder = ({ theme }: ThemeProps): string => + `${theme.orbit.borderWidthCard} ${theme.orbit.borderStyleCard} ${theme.orbit.borderColorCard}`; + +export const getBorderRadius = ({ theme }: ThemeProps): string => + `${theme.orbit.borderRadiusNormal}`; + +export const getBorderRadiusMobile = ({ theme }: ThemeProps): string => + `${theme.orbit.borderRadiusLarge}`; diff --git a/packages/orbit-components/src/Card/helpers/mixins.js b/packages/orbit-components/src/Card/helpers/mixins.js deleted file mode 100644 index a75b3689de..0000000000 --- a/packages/orbit-components/src/Card/helpers/mixins.js +++ /dev/null @@ -1,23 +0,0 @@ -// @flow -import { css } from "styled-components"; - -import mq from "../../utils/mediaQuery"; -import defaultTheme from "../../defaultTheme"; -import { getBorder } from "./borders"; - -export const CardElement: any = css` - width: 100%; - box-sizing: border-box; - position: relative; - box-shadow: ${({ expanded, theme }) => expanded && theme.orbit.boxShadowActionActive}; - border-top: ${({ expanded }) => !expanded && getBorder}; - background: ${({ theme }) => theme.orbit.backgroundCard}; - ${mq.largeMobile(css` - border-left: ${({ expanded }) => !expanded && getBorder}; - border-right: ${({ expanded }) => !expanded && getBorder}; - `)} -`; - -CardElement.defaultProps = { - theme: defaultTheme, -}; diff --git a/packages/orbit-components/src/Card/helpers/mixins.ts b/packages/orbit-components/src/Card/helpers/mixins.ts new file mode 100644 index 0000000000..3473647b01 --- /dev/null +++ b/packages/orbit-components/src/Card/helpers/mixins.ts @@ -0,0 +1,20 @@ +import { css } from "styled-components"; + +import mq from "../../utils/mediaQuery"; +import { getBorder } from "./borders"; +import { Theme } from "../../defaultTheme"; + +export const CardElement = css` + ${({ theme, expanded }: { theme: Theme; expanded?: boolean }) => css` + width: 100%; + box-sizing: border-box; + position: relative; + box-shadow: ${expanded && theme.orbit.boxShadowActionActive}; + border-top: ${!expanded && getBorder}; + background: ${theme.orbit.backgroundCard}; + ${mq.largeMobile(css` + border-left: ${!expanded && getBorder}; + border-right: ${!expanded && getBorder}; + `)}; + `}; +`; diff --git a/packages/orbit-components/src/Card/index.d.ts b/packages/orbit-components/src/Card/index.d.ts deleted file mode 100644 index 33f0d300e8..0000000000 --- a/packages/orbit-components/src/Card/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import CardSection from "./CardSection"; -import * as Common from "../common/common"; -import { As } from "../Heading"; - -export interface Props extends Common.Global, Common.SpaceAfter { - readonly children?: React.ReactNode; - readonly title?: React.ReactNode; - readonly titleAs?: As; - readonly description?: React.ReactNode; - readonly icon?: React.ReactNode; - readonly actions?: React.ReactNode; - readonly onClose?: Common.Event>; - readonly loading?: boolean; - readonly header?: React.ReactNode; - readonly dataA11ySection?: string; -} - -declare const Card: React.FunctionComponent; -declare const StyledCard: React.ComponentType; - -export { Card, Card as default, CardSection, StyledCard }; diff --git a/packages/orbit-components/src/Card/index.js.flow b/packages/orbit-components/src/Card/index.js.flow new file mode 100644 index 0000000000..a3b1189d3c --- /dev/null +++ b/packages/orbit-components/src/Card/index.js.flow @@ -0,0 +1,30 @@ +// @flow +/* + DOCUMENTATION: https://orbit.kiwi/components/card/ +*/ +import * as React from "react"; +import type { StyledComponent } from "styled-components"; + +import type { spaceAfter } from "../common/getSpacingToken/index.js.flow"; +import type { Globals } from "../common/common.js.flow"; +import typeof CardSectionType from "./CardSection/index.js.flow"; +import type { As } from "../Heading/index.js.flow"; + +export type Props = {| + +children?: React.Node, + +title?: React.Node, + +titleAs?: As, + +description?: React.Node, + +icon?: React.Node, + +actions?: React.Node, + +onClose?: () => void | Promise, + +loading?: boolean, + +header?: React.Node, + +dataA11ySection?: string, + ...Globals, + ...spaceAfter, +|}; + +declare export default React.ComponentType; +declare export var CardSection: CardSectionType; +declare export var StyledCard: StyledComponent; diff --git a/packages/orbit-components/src/Card/index.jsx b/packages/orbit-components/src/Card/index.jsx deleted file mode 100644 index 1aafeacf66..0000000000 --- a/packages/orbit-components/src/Card/index.jsx +++ /dev/null @@ -1,134 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import Loading from "../Loading"; -import CardWrapper from "./components/CardWrapper"; -import { Provider as SectionProvider } from "./CardContext"; -import defaultTheme from "../defaultTheme"; -import getSpacingToken from "../common/getSpacingToken"; -import Header from "./components/Header"; -import { ELEMENT_OPTIONS } from "../Heading/consts"; - -import type { Props } from "."; - -export const StyledCard: any = styled.div` - width: 100%; - box-sizing: border-box; - position: relative; - font-family: ${({ theme }) => theme.orbit.fontFamily}; - margin-bottom: ${getSpacingToken}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCard.defaultProps = { - theme: defaultTheme, -}; - -const Card = ({ - title, - titleAs = ELEMENT_OPTIONS.H2, - icon, - actions, - description, - children, - dataTest, - id, - onClose, - loading, - header, - spaceAfter, - dataA11ySection, -}: Props): React.Node => { - const [expandedSections, setExpandedSections] = React.useState([]); - - // handles array of expanded sections - const addSection = React.useCallback((index: number) => { - setExpandedSections(prev => (prev.indexOf(index) === -1 ? [...prev, index] : prev)); - }, []); - - const removeSection = React.useCallback((index: number) => { - setExpandedSections(prev => - prev.indexOf(index) !== -1 ? prev.filter(val => val !== index) : prev, - ); - }, []); - - // Currently disable that code, becuase of IE 11, where it does not work - // It will be fixed later, when we'll find solution - // eslint-disable-next-line no-unused-vars - const renderSection = (item, index) => { - if (React.isValidElement(item)) { - // if (item.props.children && item.type.name !== "CardSection") { - // return React.createElement(CardSection, { - // ...item.props.children.props, - // key: index, - // }); - - return React.cloneElement(item); - } - - return null; - }; - - return ( - - {(title || header) && !loading && ( - val === 0)}> -
- - )} - - {children - ? React.Children.map(children, (item, key) => { - if (!item) return null; - const topRoundedBorder = - expandedSections.indexOf(key - 1) !== -1 || expandedSections.indexOf(key) !== -1; - const bottomRounderBorder = - expandedSections.indexOf(key + 1) !== -1 || expandedSections.indexOf(key) !== -1; - - // This is used for the case when user wants to map sections and change their order - // related issue: #1005 - const index = Number(item.key) || key; - - return ( - val === index), - }} - > - {loading ? ( - - - {renderSection(item, index)} - - - ) : ( - renderSection(item, index) - )} - - ); - }) - : null} - - ); -}; - -export default Card; -export { default as CardSection } from "./CardSection"; diff --git a/packages/orbit-components/src/Card/index.jsx.flow b/packages/orbit-components/src/Card/index.jsx.flow deleted file mode 100644 index a30fe5fe5a..0000000000 --- a/packages/orbit-components/src/Card/index.jsx.flow +++ /dev/null @@ -1,30 +0,0 @@ -// @flow -/* - DOCUMENTATION: https://orbit.kiwi/components/card/ -*/ -import * as React from "react"; -import type { StyledComponent } from "styled-components"; - -import type { spaceAfter } from "../common/getSpacingToken"; -import type { Globals } from "../common/common.js.flow"; -import typeof CardSectionType from "./CardSection"; -import type { As } from "../Heading"; - -export type Props = {| - +children?: React.Node, - +title?: React.Node, - +titleAs?: As, - +description?: React.Node, - +icon?: React.Node, - +actions?: React.Node, - +onClose?: () => void | Promise, - +loading?: boolean, - +header?: React.Node, - +dataA11ySection?: string, - ...Globals, - ...spaceAfter, -|}; - -declare export default React.ComponentType; -declare export var CardSection: CardSectionType; -declare export var StyledCard: StyledComponent; diff --git a/packages/orbit-components/src/Card/index.tsx b/packages/orbit-components/src/Card/index.tsx new file mode 100644 index 0000000000..8b62c0a0c5 --- /dev/null +++ b/packages/orbit-components/src/Card/index.tsx @@ -0,0 +1,132 @@ +import * as React from "react"; +import styled from "styled-components"; + +import Loading from "../Loading"; +import CardWrapper from "./components/CardWrapper"; +import { Provider as SectionProvider } from "./CardContext"; +import defaultTheme from "../defaultTheme"; +import getSpacingToken from "../common/getSpacingToken"; +import Header from "./components/Header"; +import { ELEMENT_OPTIONS } from "../Heading/consts"; +import { Props } from "./types"; +import * as Common from "../common/types"; + +export const StyledCard = styled.div<{ spaceAfter?: Common.SpaceAfterSizes }>` + width: 100%; + box-sizing: border-box; + position: relative; + font-family: ${({ theme }) => theme.orbit.fontFamily}; + margin-bottom: ${getSpacingToken}; +`; + +StyledCard.defaultProps = { + theme: defaultTheme, +}; + +const Card = ({ + title, + titleAs = ELEMENT_OPTIONS.H2, + icon, + actions, + description, + children, + dataTest, + id, + onClose, + loading, + header, + spaceAfter, + dataA11ySection, +}: Props) => { + const [expandedSections, setExpandedSections] = React.useState([]); + + // handles array of expanded sections + const addSection = React.useCallback((index: number) => { + setExpandedSections(prev => (prev.indexOf(index) === -1 ? [...prev, index] : prev)); + }, []); + + const removeSection = React.useCallback((index: number) => { + setExpandedSections(prev => + prev.indexOf(index) !== -1 ? prev.filter(val => val !== index) : prev, + ); + }, []); + + // Currently disable that code, becuase of IE 11, where it does not work + // It will be fixed later, when we'll find solution + const renderSection = item => { + if (React.isValidElement(item)) { + // if (item.props.children && item.type.name !== "CardSection") { + // return React.createElement(CardSection, { + // ...item.props.children.props, + // key: index, + // }); + + return React.cloneElement(item); + } + + return null; + }; + + return ( + + {(title || header) && !loading && ( + val === 0)}> +
+ + )} + + {children + ? React.Children.map(children, (item, key) => { + if (!item) return null; + const topRoundedBorder = + expandedSections.indexOf(key - 1) !== -1 || expandedSections.indexOf(key) !== -1; + const bottomRounderBorder = + expandedSections.indexOf(key + 1) !== -1 || expandedSections.indexOf(key) !== -1; + + // This is used for the case when user wants to map sections and change their order + // related issue: #1005 + // @ts-expect-error TODO + const index = Number(item.key) || key; + + return ( + val === index), + }} + > + {loading ? ( + + + {renderSection(item)} + + + ) : ( + renderSection(item) + )} + + ); + }) + : null} + + ); +}; + +export default Card; +export { default as CardSection } from "./CardSection"; diff --git a/packages/orbit-components/src/Card/types.ts b/packages/orbit-components/src/Card/types.ts new file mode 100644 index 0000000000..f5244bb95c --- /dev/null +++ b/packages/orbit-components/src/Card/types.ts @@ -0,0 +1,20 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; +import { As } from "../Heading/types"; + +export interface Props extends Common.Globals, Common.SpaceAfter { + readonly children?: React.ReactNode; + readonly title?: React.ReactNode; + readonly titleAs?: As; + readonly description?: React.ReactNode; + readonly icon?: React.ReactNode; + readonly actions?: React.ReactNode; + readonly onClose?: Common.Event>; + readonly loading?: boolean; + readonly header?: React.ReactNode; + readonly dataA11ySection?: string; +} diff --git a/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.jsx b/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.jsx deleted file mode 100644 index 663b2b56e2..0000000000 --- a/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.jsx +++ /dev/null @@ -1,136 +0,0 @@ -// @flow - -import * as React from "react"; -import { object, select, text } from "@storybook/addon-knobs"; - -import { SIZE_OPTIONS, CARRIER_TYPE_OPTIONS } from "./consts"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; - -import CarrierLogo from "."; - -const carriersLabel = "Carriers"; - -export default { - title: "CarrierLogo", -}; - -export const OneCarrier = (): React.Node => { - const size = select("Size", Object.values(SIZE_OPTIONS), "large"); - const dataTest = text("dataTest", "test"); - - const carrier = [{ code: "FR", name: "Ryanair" }]; - - const carriersObject = object(carriersLabel, carrier); - - return ; -}; - -OneCarrier.story = { - name: "One carrier", - - parameters: { - info: - "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const TwoCarriers = (): React.Node => { - const carrier = [ - { code: "FR", name: "Ryanair" }, - { code: "TO", name: "Transavia France" }, - ]; - - const carriersObject = object(carriersLabel, carrier); - - return ; -}; - -TwoCarriers.story = { - name: "Two carriers", - - parameters: { - info: - "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const FourCarriers = (): React.Node => { - const carrier = [ - { code: "FR", name: "Ryanair" }, - { code: "TO", name: "Transavia France" }, - { code: "VY", name: "Vueling" }, - { code: "OK", name: "Czech Airlines" }, - ]; - - const carriersObject = object(carriersLabel, carrier); - - return ; -}; - -FourCarriers.story = { - name: "Four carriers", - - parameters: { - info: - "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const NonExistingCarriers = (): React.Node => { - const carrier = [ - { code: "LOL", name: "Lorem ipsum", type: "airline" }, - { code: "KEK", name: "Lorem ipsum", type: "bus" }, - { code: "BUR", name: "Lorem ipsum", type: "train" }, - ]; - - const carriersObject = object(carriersLabel, carrier); - - return ; -}; - -NonExistingCarriers.story = { - name: "Non-existing carriers", - - parameters: { - info: - "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const NonExistingCarrier = (): React.Node => { - const size = select("Size", Object.values(SIZE_OPTIONS), "large"); - const carrierType = select("Type", Object.values(CARRIER_TYPE_OPTIONS), "airline"); - const carrier = [{ code: "LAL", name: "Lorem ipsum", type: carrierType }]; - const carriersObject = object(carriersLabel, carrier); - - return ; -}; - -NonExistingCarrier.story = { - name: "Non-existing carrier", - - parameters: { - info: - "CarrierLogo can display proper placeholder for non-existing carriers by its type. If not you specify the type of carrier, airline placeholder will be displayed.", - }, -}; - -export const Rtl = (): React.Node => ( - - - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.tsx b/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.tsx new file mode 100644 index 0000000000..dbdc3d10af --- /dev/null +++ b/packages/orbit-components/src/CarrierLogo/CarrierLogo.stories.tsx @@ -0,0 +1,139 @@ +import * as React from "react"; +import { object, select, text } from "@storybook/addon-knobs"; + +import { SIZE_OPTIONS, CARRIER_TYPE_OPTIONS } from "./consts"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import { Carrier } from "./types"; + +import CarrierLogo from "."; + +const carriersLabel = "Carriers"; + +export default { + title: "CarrierLogo", +}; + +export const OneCarrier = () => { + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); + const dataTest = text("dataTest", "test"); + + const carrier = [{ code: "FR", name: "Ryanair" }]; + + const carriersObject = object(carriersLabel, carrier); + + return ; +}; + +OneCarrier.story = { + name: "One carrier", + + parameters: { + info: + "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const TwoCarriers = () => { + const carrier: Carrier[] = [ + { code: "FR", name: "Ryanair" }, + { code: "TO", name: "Transavia France" }, + ]; + + const carriersObject = object(carriersLabel, carrier); + + return ; +}; + +TwoCarriers.story = { + name: "Two carriers", + + parameters: { + info: + "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const FourCarriers = () => { + const carrier = [ + { code: "FR", name: "Ryanair" }, + { code: "TO", name: "Transavia France" }, + { code: "VY", name: "Vueling" }, + { code: "OK", name: "Czech Airlines" }, + ]; + + const carriersObject = object(carriersLabel, carrier); + + return ; +}; + +FourCarriers.story = { + name: "Four carriers", + + parameters: { + info: + "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const NonExistingCarriers = () => { + const carrier: Carrier[] = [ + { code: "LOL", name: "Lorem ipsum", type: "airline" }, + { code: "KEK", name: "Lorem ipsum", type: "bus" }, + { code: "BUR", name: "Lorem ipsum", type: "train" }, + ]; + + const carriersObject = object(carriersLabel, carrier); + + return ; +}; + +NonExistingCarriers.story = { + name: "Non-existing carriers", + + parameters: { + info: + "Carrier logo displays one or more logos of transport carriers. It is usually together with the travel itinerary. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const NonExistingCarrier = () => { + const size = select("Size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.LARGE); + const carrierType = select( + "Type", + Object.values(CARRIER_TYPE_OPTIONS), + CARRIER_TYPE_OPTIONS.AIRLINE, + ); + const carrier = [{ code: "LAL", name: "Lorem ipsum", type: carrierType }]; + const carriersObject = object(carriersLabel, carrier); + + return ; +}; + +NonExistingCarrier.story = { + name: "Non-existing carrier", + + parameters: { + info: + "CarrierLogo can display proper placeholder for non-existing carriers by its type. If not you specify the type of carrier, airline placeholder will be displayed.", + }, +}; + +export const Rtl = () => ( + + + +); + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/CarrierLogo/__tests__/index.test.jsx b/packages/orbit-components/src/CarrierLogo/__tests__/index.test.jsx deleted file mode 100644 index 02658d0480..0000000000 --- a/packages/orbit-components/src/CarrierLogo/__tests__/index.test.jsx +++ /dev/null @@ -1,39 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import CarrierLogo from ".."; -import { SIZE_OPTIONS } from "../consts"; - -describe("CarrierLogo", () => { - it("default", () => { - render( - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByAltText("Ryanair")).toBeInTheDocument(); - expect(screen.getByTitle("Ryanair")).toBeInTheDocument(); - const img = screen.getByRole("img"); - expect(img.getAttribute("src")).toMatchInlineSnapshot( - `"//images.kiwi.com/airlines/32x32/FR.png?default=airline.png"`, - ); - expect(img.getAttribute("srcset")).toMatchInlineSnapshot( - `"//images.kiwi.com/airlines/64x64/FR.png?default=airline.png 2x"`, - ); - }); - - it("fallback", () => { - render(); - const img = screen.getByRole("img"); - expect(img.getAttribute("src")).toMatchInlineSnapshot( - `"//images.kiwi.com/airlines/32x32/TO.png?default=bus.png"`, - ); - expect(img.getAttribute("srcset")).toMatchInlineSnapshot( - `"//images.kiwi.com/airlines/64x64/TO.png?default=bus.png 2x"`, - ); - }); -}); diff --git a/packages/orbit-components/src/CarrierLogo/__tests__/index.test.tsx b/packages/orbit-components/src/CarrierLogo/__tests__/index.test.tsx new file mode 100644 index 0000000000..c4675f1459 --- /dev/null +++ b/packages/orbit-components/src/CarrierLogo/__tests__/index.test.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; + +import CarrierLogo from ".."; +import { SIZE_OPTIONS } from "../consts"; + +describe("CarrierLogo", () => { + it("default", () => { + render( + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByAltText("Ryanair")).toBeInTheDocument(); + expect(screen.getByTitle("Ryanair")).toBeInTheDocument(); + const img = screen.getByRole("img"); + expect(img.getAttribute("src")).toMatchInlineSnapshot( + `"//images.kiwi.com/airlines/32x32/FR.png?default=airline.png"`, + ); + expect(img.getAttribute("srcset")).toMatchInlineSnapshot( + `"//images.kiwi.com/airlines/64x64/FR.png?default=airline.png 2x"`, + ); + }); + + it("fallback", () => { + render(); + const img = screen.getByRole("img"); + expect(img.getAttribute("src")).toMatchInlineSnapshot( + `"//images.kiwi.com/airlines/32x32/TO.png?default=bus.png"`, + ); + expect(img.getAttribute("srcset")).toMatchInlineSnapshot( + `"//images.kiwi.com/airlines/64x64/TO.png?default=bus.png 2x"`, + ); + }); +}); diff --git a/packages/orbit-components/src/CarrierLogo/consts.js b/packages/orbit-components/src/CarrierLogo/consts.js deleted file mode 100644 index 9e35fc7f86..0000000000 --- a/packages/orbit-components/src/CarrierLogo/consts.js +++ /dev/null @@ -1,18 +0,0 @@ -// @flow - -export const SIZE_OPTIONS = { - SMALL: "small", - MEDIUM: "medium", - LARGE: "large", -}; - -export const CARRIER_TYPE_OPTIONS = { - AIRLINE: "airline", - BUS: "bus", - TRAIN: "train", - PRIVATE_TRANSFER: "private_transfer", - FERRY: "ferry", - KIWICOM: "kiwicom", -}; - -export const BASE_URL = "//images.kiwi.com"; diff --git a/packages/orbit-components/src/CarrierLogo/consts.ts b/packages/orbit-components/src/CarrierLogo/consts.ts new file mode 100644 index 0000000000..acf665adfa --- /dev/null +++ b/packages/orbit-components/src/CarrierLogo/consts.ts @@ -0,0 +1,16 @@ +export enum SIZE_OPTIONS { + SMALL = "small", + MEDIUM = "medium", + LARGE = "large", +} + +export enum CARRIER_TYPE_OPTIONS { + AIRLINE = "airline", + BUS = "bus", + TRAIN = "train", + KIWICOM = "kiwicom", + PRIVATE_TRANSFER = "private_transfer", + FERRY = "ferry", +} + +export const BASE_URL = "//images.kiwi.com"; diff --git a/packages/orbit-components/src/CarrierLogo/index.d.ts b/packages/orbit-components/src/CarrierLogo/index.d.ts deleted file mode 100644 index b9c10eae11..0000000000 --- a/packages/orbit-components/src/CarrierLogo/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -type Size = "small" | "medium" | "large"; - -export interface Carrier { - code: string; - name: string; - type?: "airline" | "bus" | "train" | "ferry" | "private_transfer" | "kiwicom"; -} - -export interface Props extends Common.Global { - readonly size?: Size; - readonly rounded?: boolean; - readonly carriers: Common.Carrier[]; -} - -declare const CarrierLogo: React.FunctionComponent; -export { CarrierLogo, CarrierLogo as default }; diff --git a/packages/orbit-components/src/CarrierLogo/index.jsx.flow b/packages/orbit-components/src/CarrierLogo/index.js.flow similarity index 100% rename from packages/orbit-components/src/CarrierLogo/index.jsx.flow rename to packages/orbit-components/src/CarrierLogo/index.js.flow diff --git a/packages/orbit-components/src/CarrierLogo/index.jsx b/packages/orbit-components/src/CarrierLogo/index.jsx deleted file mode 100644 index 2b13fb04ca..0000000000 --- a/packages/orbit-components/src/CarrierLogo/index.jsx +++ /dev/null @@ -1,115 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import defaultTheme from "../defaultTheme"; -import { SIZE_OPTIONS, BASE_URL } from "./consts"; - -import type { Props } from "."; - -const getRenderSize = ({ theme, size }) => { - const renderSizes = { - [SIZE_OPTIONS.SMALL]: parseInt(theme.orbit.heightIconSmall, 10), - [SIZE_OPTIONS.MEDIUM]: parseInt(theme.orbit.heightIconMedium, 10), - [SIZE_OPTIONS.LARGE]: parseInt(theme.orbit.heightIconLarge, 10), - }; - return renderSizes[size]; -}; - -const getCarrierLogoSize = ({ theme, carriersLength, size }) => { - const defaultSizes = - carriersLength > 1 - ? getRenderSize({ theme, size: SIZE_OPTIONS.SMALL }) - : getRenderSize({ theme, size }); - - return `${defaultSizes - (carriersLength > 2 ? 1 : 0)}px`; -}; - -const getURLSizes = ({ size }) => { - const urlSizes = { - base: { - [SIZE_OPTIONS.SMALL]: 16, - [SIZE_OPTIONS.MEDIUM]: 32, - [SIZE_OPTIONS.LARGE]: 32, - }, - retina: { - [SIZE_OPTIONS.SMALL]: 32, - [SIZE_OPTIONS.MEDIUM]: 64, - [SIZE_OPTIONS.LARGE]: 64, - }, - }; - return { - base: urlSizes.base[size], - retina: urlSizes.retina[size], - }; -}; - -const StyledImage = styled.img.attrs(({ carrierType = "airline", carriersLength, size, code }) => { - const urlSizes = - carriersLength > 1 ? getURLSizes({ size: SIZE_OPTIONS.SMALL }) : getURLSizes({ size }); - return { - src: `${BASE_URL}/airlines/${urlSizes.base}x${urlSizes.base}/${code}.png?default=${carrierType}.png`, - srcSet: `${BASE_URL}/airlines/${urlSizes.retina}x${urlSizes.retina}/${code}.png?default=${carrierType}.png 2x`, - }; -})` - ${({ theme, rounded }) => css` - background-color: ${theme.orbit.backgroundCarrierLogo}; - border-radius: ${rounded ? theme.orbit.borderRadiusCircle : theme.orbit.borderRadiusNormal}; - height: ${getCarrierLogoSize}; - width: ${getCarrierLogoSize}; - &:last-child { - align-self: flex-end; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledImage.defaultProps = { - theme: defaultTheme, -}; - -export const StyledCarrierLogo: any = styled.div` - ${({ theme, carriers, size }) => css` - background-color: ${theme.orbit.backgroundCarrierLogo}; - height: ${carriers.length > 1 - ? theme.orbit.heightIconLarge - : `${getRenderSize({ theme, size })}px`}; - width: ${carriers.length > 1 - ? theme.orbit.widthIconLarge - : `${getRenderSize({ theme, size })}px`}; - display: flex; - flex-direction: ${carriers.length > 1 ? "column" : "row"}; - flex-wrap: ${carriers.length > 2 && "wrap"}; - align-content: space-between; - justify-content: space-between; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCarrierLogo.defaultProps = { - theme: defaultTheme, -}; - -const CarrierLogo = ({ - size = SIZE_OPTIONS.LARGE, - carriers, - dataTest, - id, - rounded, -}: Props): React.Node => ( - - {carriers.slice(0, 4).map(carrierImage => ( - - ))} - -); -export default CarrierLogo; diff --git a/packages/orbit-components/src/CarrierLogo/index.tsx b/packages/orbit-components/src/CarrierLogo/index.tsx new file mode 100644 index 0000000000..83eca17ab9 --- /dev/null +++ b/packages/orbit-components/src/CarrierLogo/index.tsx @@ -0,0 +1,116 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme, { Theme } from "../defaultTheme"; +import { SIZE_OPTIONS, BASE_URL } from "./consts"; +import { Props, CarrierType, Size, Carrier } from "./types"; + +interface StyledProps { + rounded?: boolean; + carrierType?: CarrierType; + carriersLength: number; + size: Size; + theme: Theme; + code: string; +} + +const getRenderSize = ({ theme, size }) => { + const renderSizes = { + [SIZE_OPTIONS.SMALL]: parseInt(theme.orbit.heightIconSmall, 10), + [SIZE_OPTIONS.MEDIUM]: parseInt(theme.orbit.heightIconMedium, 10), + [SIZE_OPTIONS.LARGE]: parseInt(theme.orbit.heightIconLarge, 10), + }; + return renderSizes[size]; +}; + +const getCarrierLogoSize = ({ theme, carriersLength, size }) => { + const defaultSizes = + carriersLength > 1 + ? getRenderSize({ theme, size: SIZE_OPTIONS.SMALL }) + : getRenderSize({ theme, size }); + + return `${defaultSizes - (carriersLength > 2 ? 1 : 0)}px`; +}; + +const getURLSizes = ({ size }) => { + const urlSizes = { + base: { + [SIZE_OPTIONS.SMALL]: 16, + [SIZE_OPTIONS.MEDIUM]: 32, + [SIZE_OPTIONS.LARGE]: 32, + }, + retina: { + [SIZE_OPTIONS.SMALL]: 32, + [SIZE_OPTIONS.MEDIUM]: 64, + [SIZE_OPTIONS.LARGE]: 64, + }, + }; + return { + base: urlSizes.base[size], + retina: urlSizes.retina[size], + }; +}; + +const StyledImage = styled.img.attrs( + ({ carrierType = "airline", carriersLength, size, code }) => { + const urlSizes = + carriersLength > 1 ? getURLSizes({ size: SIZE_OPTIONS.SMALL }) : getURLSizes({ size }); + return { + src: `${BASE_URL}/airlines/${urlSizes.base}x${urlSizes.base}/${code}.png?default=${carrierType}.png`, + srcSet: `${BASE_URL}/airlines/${urlSizes.retina}x${urlSizes.retina}/${code}.png?default=${carrierType}.png 2x`, + }; + }, +)` + ${({ theme, rounded }: StyledProps) => css` + background-color: ${theme.orbit.backgroundCarrierLogo}; + border-radius: ${rounded ? theme.orbit.borderRadiusCircle : theme.orbit.borderRadiusNormal}; + height: ${getCarrierLogoSize}; + width: ${getCarrierLogoSize}; + &:last-child { + align-self: flex-end; + } + `} +`; + +StyledImage.defaultProps = { + theme: defaultTheme, +}; + +export const StyledCarrierLogo = styled.div<{ theme: Theme; carriers: Carrier[]; size: Size }>` + ${({ theme, carriers, size }) => css` + background-color: ${theme.orbit.backgroundCarrierLogo}; + height: ${carriers.length > 1 + ? theme.orbit.heightIconLarge + : `${getRenderSize({ theme, size })}px`}; + width: ${carriers.length > 1 + ? theme.orbit.widthIconLarge + : `${getRenderSize({ theme, size })}px`}; + display: flex; + flex-direction: ${carriers.length > 1 ? "column" : "row"}; + flex-wrap: ${carriers.length > 2 && "wrap"}; + align-content: space-between; + justify-content: space-between; + `} +`; + +StyledCarrierLogo.defaultProps = { + theme: defaultTheme, +}; + +const CarrierLogo = ({ size = SIZE_OPTIONS.LARGE, carriers, dataTest, id, rounded }: Props) => ( + + {carriers.slice(0, 4).map(carrierImage => ( + + ))} + +); +export default CarrierLogo; diff --git a/packages/orbit-components/src/CarrierLogo/types.ts b/packages/orbit-components/src/CarrierLogo/types.ts new file mode 100644 index 0000000000..3e43cbc2e9 --- /dev/null +++ b/packages/orbit-components/src/CarrierLogo/types.ts @@ -0,0 +1,19 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as Common from "../common/types"; + +export type Size = "small" | "medium" | "large"; +export type CarrierType = "airline" | "bus" | "train" | "ferry" | "private_transfer" | "kiwicom"; + +export interface Carrier { + code: string; + name: string; + type?: CarrierType; +} + +export interface Props extends Common.Globals { + readonly size?: Size; + readonly rounded?: boolean; + readonly carriers: Common.Carrier[]; +} diff --git a/packages/orbit-components/src/Checkbox/Checkbox.stories.jsx b/packages/orbit-components/src/Checkbox/Checkbox.stories.jsx deleted file mode 100644 index 8ce5782014..0000000000 --- a/packages/orbit-components/src/Checkbox/Checkbox.stories.jsx +++ /dev/null @@ -1,166 +0,0 @@ -// @flow - -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, boolean } from "@storybook/addon-knobs"; - -import Text from "../Text"; -import TextLink from "../TextLink"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; -import Tooltip from "../Tooltip"; - -import Checkbox from "."; - -export default { - title: "CheckBox", -}; - -export const Default = (): React.Node => { - const label = text("Label", "Label"); - const checked = boolean("Checked", false); - return ; -}; - -Default.story = { - parameters: { - info: "Checkbox needs only label and onChange by default.", - }, -}; - -export const WithHelp = (): React.Node => { - const label = text("Label", "Label"); - const value = text("Value", "value"); - const info = text("Info", "Additional information about this choice"); - return ; -}; - -WithHelp.story = { - name: "With help", - - parameters: { - info: "Additionally you can add info to this component.", - }, -}; - -export const WithError = (): React.Node => { - const label = text("Label", "Label"); - const hasError = boolean("hasError", true); - const checked = boolean("checked", false); - return ( - - ); -}; - -WithError.story = { - name: "With error", - - parameters: { - info: - "Show there is an error with the hasError prop. Only displays when checked and disabled are false.", - }, -}; - -export const WithTextLinkInLabel = (): React.Node => { - const checked = boolean("checked", true); - return ( - - I instruct Kiwi.com to cancel this booking under the herein specified conditions and to - process a refund in accordance with Kiwi.com’  - - Terms and Conditions - - . - - } - checked={checked} - value="value" - onChange={action("changed")} - /> - ); -}; - -WithTextLinkInLabel.story = { - name: "With TextLink in label", - - parameters: { - info: "Additionally you can add info to this component.", - }, -}; - -export const WithTooltip = (): React.Node => { - return ( - - } - /> - ); -}; - -WithTooltip.story = { - parameters: { - info: "Additionally you can add tooltip to this component.", - }, -}; - -export const Playground = (): React.Node => { - const label = text("Label", "Label"); - const value = text("Value", "value"); - const checked = boolean("Checked", true); - const disabled = boolean("Disabled", false); - const hasError = boolean("hasError", false); - const readOnly = boolean("readOnly", false); - const info = text("Info", "Additional information for this choice"); - const dataTest = text("dataTest", "test"); - const name = text("name", "name"); - return ( - - ); -}; - -Playground.story = { - parameters: { - info: "Playground of Checkbox", - }, -}; - -export const Rtl = (): React.Node => ( - - - I instruct Kiwi.com to cancel this booking under the herein specified conditions and to - process a refund in accordance with Kiwi.com’  - Terms and Conditions. - - } - checked - value="value" - onChange={action("changed")} - /> - -); - -Rtl.story = { - name: "RTL", - - parameters: { - info: "This is a preview of this component in RTL setup.", - }, -}; diff --git a/packages/orbit-components/src/Checkbox/Checkbox.stories.tsx b/packages/orbit-components/src/Checkbox/Checkbox.stories.tsx new file mode 100644 index 0000000000..f9ac18946b --- /dev/null +++ b/packages/orbit-components/src/Checkbox/Checkbox.stories.tsx @@ -0,0 +1,164 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, boolean } from "@storybook/addon-knobs"; + +import Text from "../Text"; +import TextLink from "../TextLink"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import Tooltip from "../Tooltip"; + +import Checkbox from "."; + +export default { + title: "CheckBox", +}; + +export const Default = () => { + const label = text("Label", "Label"); + const checked = boolean("Checked", false); + return ; +}; + +Default.story = { + parameters: { + info: "Checkbox needs only label and onChange by default.", + }, +}; + +export const WithHelp = () => { + const label = text("Label", "Label"); + const value = text("Value", "value"); + const info = text("Info", "Additional information about this choice"); + return ; +}; + +WithHelp.story = { + name: "With help", + + parameters: { + info: "Additionally you can add info to this component.", + }, +}; + +export const WithError = () => { + const label = text("Label", "Label"); + const hasError = boolean("hasError", true); + const checked = boolean("checked", false); + return ( + + ); +}; + +WithError.story = { + name: "With error", + + parameters: { + info: + "Show there is an error with the hasError prop. Only displays when checked and disabled are false.", + }, +}; + +export const WithTextLinkInLabel = () => { + const checked = boolean("checked", true); + return ( + + I instruct Kiwi.com to cancel this booking under the herein specified conditions and to + process a refund in accordance with Kiwi.com’  + + Terms and Conditions + + . + + } + checked={checked} + value="value" + onChange={action("changed")} + /> + ); +}; + +WithTextLinkInLabel.story = { + name: "With TextLink in label", + + parameters: { + info: "Additionally you can add info to this component.", + }, +}; + +export const WithTooltip = () => { + return ( + + } + /> + ); +}; + +WithTooltip.story = { + parameters: { + info: "Additionally you can add tooltip to this component.", + }, +}; + +export const Playground = () => { + const label = text("Label", "Label"); + const value = text("Value", "value"); + const checked = boolean("Checked", true); + const disabled = boolean("Disabled", false); + const hasError = boolean("hasError", false); + const readOnly = boolean("readOnly", false); + const info = text("Info", "Additional information for this choice"); + const dataTest = text("dataTest", "test"); + const name = text("name", "name"); + return ( + + ); +}; + +Playground.story = { + parameters: { + info: "Playground of Checkbox", + }, +}; + +export const Rtl = () => ( + + + I instruct Kiwi.com to cancel this booking under the herein specified conditions and to + process a refund in accordance with Kiwi.com’  + Terms and Conditions. + + } + checked + value="value" + onChange={action("changed")} + /> + +); + +Rtl.story = { + name: "RTL", + + parameters: { + info: "This is a preview of this component in RTL setup.", + }, +}; diff --git a/packages/orbit-components/src/Checkbox/__tests__/index.test.jsx b/packages/orbit-components/src/Checkbox/__tests__/index.test.jsx deleted file mode 100644 index fc9f64cc82..0000000000 --- a/packages/orbit-components/src/Checkbox/__tests__/index.test.jsx +++ /dev/null @@ -1,30 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import CheckBox from ".."; - -describe("CheckBox", () => { - it("default", () => { - const onChange = jest.fn(); - render( - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - const checkbox = screen.getByRole("checkbox", { name: "Checkbox" }); - expect(checkbox).toHaveAttribute("value", "option"); - expect(checkbox).toHaveAttribute("name", "name"); - expect(checkbox).toHaveAttribute("tabIndex", "-1"); - userEvent.click(checkbox); - expect(onChange).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/Checkbox/__tests__/index.test.tsx b/packages/orbit-components/src/Checkbox/__tests__/index.test.tsx new file mode 100644 index 0000000000..bf1806eacf --- /dev/null +++ b/packages/orbit-components/src/Checkbox/__tests__/index.test.tsx @@ -0,0 +1,28 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import CheckBox from ".."; + +describe("CheckBox", () => { + it("default", () => { + const onChange = jest.fn(); + render( + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + const checkbox = screen.getByRole("checkbox", { name: "Checkbox" }); + expect(checkbox).toHaveAttribute("value", "option"); + expect(checkbox).toHaveAttribute("name", "name"); + expect(checkbox).toHaveAttribute("tabIndex", "-1"); + userEvent.click(checkbox); + expect(onChange).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/Checkbox/consts.js b/packages/orbit-components/src/Checkbox/consts.js deleted file mode 100644 index 977e2f20c3..0000000000 --- a/packages/orbit-components/src/Checkbox/consts.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow - -const TOKENS = { - background: "background", - borderColor: "borderColor", - iconColor: "iconColor", -}; - -export default TOKENS; diff --git a/packages/orbit-components/src/Checkbox/consts.ts b/packages/orbit-components/src/Checkbox/consts.ts new file mode 100644 index 0000000000..a980939ac3 --- /dev/null +++ b/packages/orbit-components/src/Checkbox/consts.ts @@ -0,0 +1,7 @@ +enum TOKENS { + background = "background", + borderColor = "borderColor", + iconColor = "iconColor", +} + +export default TOKENS; diff --git a/packages/orbit-components/src/Checkbox/index.d.ts b/packages/orbit-components/src/Checkbox/index.d.ts deleted file mode 100644 index 88d1a72abf..0000000000 --- a/packages/orbit-components/src/Checkbox/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global, Common.Ref { - readonly label?: React.ReactNode; - readonly value?: string; - readonly hasError?: boolean; - readonly disabled?: boolean; - readonly checked?: boolean; - readonly name?: string; - readonly info?: React.ReactNode; - readonly tabIndex?: string | number; - readonly readOnly?: boolean; - readonly tooltip?: React.ReactNode | null; - // Should be InputEvent type - // There is missing support for this event type in Typescript ATM - // @see https://fettblog.eu/typescript-react/events/#wheres-inputevent - readonly onChange?: React.ChangeEventHandler; -} - -declare const Checkbox: React.FunctionComponent; -export { Checkbox, Checkbox as default }; diff --git a/packages/orbit-components/src/Checkbox/index.jsx.flow b/packages/orbit-components/src/Checkbox/index.js.flow similarity index 100% rename from packages/orbit-components/src/Checkbox/index.jsx.flow rename to packages/orbit-components/src/Checkbox/index.js.flow diff --git a/packages/orbit-components/src/Checkbox/index.jsx b/packages/orbit-components/src/Checkbox/index.jsx deleted file mode 100644 index ab90fec4ad..0000000000 --- a/packages/orbit-components/src/Checkbox/index.jsx +++ /dev/null @@ -1,255 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import defaultTheme from "../defaultTheme"; -import TOKENS from "./consts"; -import Check from "../icons/Check"; -import { StyledText } from "../Text"; -import { rtlSpacing } from "../utils/rtl"; -import getFieldDataState from "../common/getFieldDataState"; -import cloneWithTooltip from "../utils/cloneWithTooltip"; -import media from "../utils/mediaQuery"; -import { defaultFocus } from "../utils/common"; - -import type { Props } from "."; - -const getToken = name => ({ theme, hasError, disabled, checked }) => { - const resolveBorderColor = () => { - if (disabled) { - return theme.orbit.paletteCloudDark; - } - if (checked) { - return theme.orbit.paletteBlueNormal; - } - if (hasError && !disabled && !checked) { - return theme.orbit.borderColorCheckboxRadioError; - } - - return theme.orbit.borderColorCheckboxRadio; - }; - - const getBackground = () => { - if (disabled && checked) { - return theme.orbit.paletteCloudDark; - } - if (disabled && !checked) { - return theme.orbit.paletteCloudNormal; - } - return checked ? theme.orbit.paletteBlueNormal : theme.orbit.backgroundInput; - }; - - const tokens = { - [TOKENS.background]: getBackground(), - [TOKENS.borderColor]: resolveBorderColor(), - [TOKENS.iconColor]: disabled - ? theme.orbit.paletteCloudDark - : theme.orbit.colorIconCheckboxRadio, - }; - - return tokens[name]; -}; - -const IconContainer = styled.div` - ${({ theme, checked }) => css` - position: relative; - box-sizing: border-box; - flex: 0 0 auto; - display: flex; - align-items: center; - justify-content: center; - background-color: ${getToken(TOKENS.background)}; - height: ${theme.orbit.heightCheckbox}; - width: ${theme.orbit.widthCheckbox}; - border-radius: ${theme.orbit.borderRadiusLarge}; - transform: scale(1); - transition: all ${theme.orbit.durationFast} ease-in-out; - - & > svg { - visibility: hidden; - display: flex; - align-items: center; - justify-content: center; - width: 16px; - height: 16px; - } - - &:hover { - background-color: ${checked ? theme.orbit.paletteBlueDark : theme.orbit.backgroundInput}; - } - - ${media.desktop(css` - border-radius: ${theme.orbit.borderRadiusNormal}; - `)} - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -IconContainer.defaultProps = { - theme: defaultTheme, -}; - -const TextContainer = styled.div` - display: flex; - flex-direction: column; - margin: ${({ theme }) => rtlSpacing(`0 0 0 ${theme.orbit.spaceXSmall}`)}; - flex: 1; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -TextContainer.defaultProps = { - theme: defaultTheme, -}; - -const Info = styled.span` - ${({ theme }) => css` - font-size: ${theme.orbit.fontSizeFormFeedback}; - color: ${theme.orbit.colorInfoCheckBoxRadio}; - line-height: ${theme.orbit.lineHeightTextSmall}; - `}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Info.defaultProps = { - theme: defaultTheme, -}; - -const LabelText = styled.span` - ${({ theme }) => css` - font-family: ${theme.orbit.fontFamily}; - font-weight: ${theme.orbit.fontWeightMedium}; - font-size: ${theme.orbit.fontSizeFormLabel}; - color: ${theme.orbit.colorFormLabel}; - line-height: ${theme.orbit.heightCheckbox}; - - ${StyledText} { - font-weight: ${theme.orbit.fontWeightMedium}; - font-size: ${theme.orbit.fontSizeFormLabel}; - color: ${theme.orbit.colorFormLabel}; - line-height: ${theme.orbit.heightCheckbox}; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -LabelText.defaultProps = { - theme: defaultTheme, -}; - -const Input = styled.input` - opacity: 0; - z-index: -1; - position: absolute; - &:checked + ${IconContainer} > svg { - visibility: visible; - } - - &:focus + ${IconContainer} { - ${defaultFocus} - } -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Input.defaultProps = { - theme: defaultTheme, -}; - -export const Label: any = styled(({ className, children, dataTest }) => ( - -))` - font-family: ${({ theme }) => theme.orbit.fontFamily}; - display: flex; - width: 100%; - flex-direction: row; - align-items: self-start; - opacity: ${({ disabled, theme }) => (disabled ? theme.orbit.opacityCheckboxDisabled : "1")}; - cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")}; - position: relative; - - ${IconContainer} { - color: ${getToken(TOKENS.iconColor)}; - border: 1px solid ${getToken(TOKENS.borderColor)}; - } - - &:hover ${IconContainer} { - border-color: ${({ disabled, theme, checked }) => - !disabled && checked ? theme.orbit.paletteBlueDark : theme.orbit.paletteBlueLightActive}; - box-shadow: none; - } - - &:active ${IconContainer} { - border-color: ${({ disabled, theme }) => - disabled ? getToken(TOKENS.borderColor) : theme.orbit.paletteBlueNormal}; - transform: ${({ disabled, theme }) => - !disabled && `scale(${theme.orbit.modifierScaleCheckboxRadioActive})`}; - } -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -Label.defaultProps = { - theme: defaultTheme, -}; - -const Checkbox: React.AbstractComponent = React.forwardRef( - (props, ref) => { - const { - label, - value, - hasError = false, - disabled = false, - checked = false, - name, - onChange, - dataTest, - id, - info, - readOnly, - tabIndex, - tooltip, - } = props; - - const preventOnClick = ev => ev.preventDefault(); - - return ( - - ); - }, -); - -Checkbox.displayName = "Checkbox"; - -export default Checkbox; diff --git a/packages/orbit-components/src/Checkbox/index.tsx b/packages/orbit-components/src/Checkbox/index.tsx new file mode 100644 index 0000000000..6302d81ae6 --- /dev/null +++ b/packages/orbit-components/src/Checkbox/index.tsx @@ -0,0 +1,259 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme from "../defaultTheme"; +import TOKENS from "./consts"; +import Check from "../icons/Check"; +import { StyledText } from "../Text"; +import { rtlSpacing } from "../utils/rtl"; +import getFieldDataState from "../common/getFieldDataState"; +import cloneWithTooltip from "../utils/cloneWithTooltip"; +import media from "../utils/mediaQuery"; +import { defaultFocus } from "../utils/common"; +import { Props } from "./types"; + +interface StyledInputProps extends Props { + error: boolean; +} + +const getToken = (name: keyof typeof TOKENS) => ({ + theme, + hasError, + disabled, + checked, +}: { + theme: typeof defaultTheme; + hasError?: boolean; + disabled?: boolean; + checked?: boolean; +}): string => { + const resolveBorderColor = () => { + if (disabled) { + return theme.orbit.paletteCloudDark; + } + if (checked) { + return theme.orbit.paletteBlueNormal; + } + if (hasError && !disabled && !checked) { + return theme.orbit.borderColorCheckboxRadioError; + } + + return theme.orbit.borderColorCheckboxRadio; + }; + + const getBackground = () => { + if (disabled && checked) { + return theme.orbit.paletteCloudDark; + } + if (disabled && !checked) { + return theme.orbit.paletteCloudNormal; + } + return checked ? theme.orbit.paletteBlueNormal : theme.orbit.backgroundInput; + }; + + const tokens = { + [TOKENS.background]: getBackground(), + [TOKENS.borderColor]: resolveBorderColor(), + [TOKENS.iconColor]: disabled + ? theme.orbit.paletteCloudDark + : theme.orbit.colorIconCheckboxRadio, + }; + + return tokens[name]; +}; + +const StyledIconContainer = styled.div<{ checked: boolean; disabled: boolean }>` + ${({ theme, checked }) => css` + position: relative; + box-sizing: border-box; + flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: center; + background-color: ${getToken(TOKENS.background)}; + height: ${theme.orbit.heightCheckbox}; + width: ${theme.orbit.widthCheckbox}; + border-radius: ${theme.orbit.borderRadiusLarge}; + transform: scale(1); + transition: all ${theme.orbit.durationFast} ease-in-out; + + & > svg { + visibility: hidden; + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + } + + &:hover { + background-color: ${checked ? theme.orbit.paletteBlueDark : theme.orbit.backgroundInput}; + } + + ${media.desktop(css` + border-radius: ${theme.orbit.borderRadiusNormal}; + `)} + `}; +`; + +StyledIconContainer.defaultProps = { + theme: defaultTheme, +}; + +const StyledTextContainer = styled.div` + display: flex; + flex-direction: column; + margin: ${({ theme }) => rtlSpacing(`0 0 0 ${theme.orbit.spaceXSmall}`)}; + flex: 1; +`; + +StyledTextContainer.defaultProps = { + theme: defaultTheme, +}; + +const Info = styled.span` + ${({ theme }) => css` + font-size: ${theme.orbit.fontSizeFormFeedback}; + color: ${theme.orbit.colorInfoCheckBoxRadio}; + line-height: ${theme.orbit.lineHeightTextSmall}; + `}; +`; + +Info.defaultProps = { + theme: defaultTheme, +}; + +const StyledLabelText = styled.span` + ${({ theme }) => css` + font-family: ${theme.orbit.fontFamily}; + font-weight: ${theme.orbit.fontWeightMedium}; + font-size: ${theme.orbit.fontSizeFormLabel}; + color: ${theme.orbit.colorFormLabel}; + line-height: ${theme.orbit.heightCheckbox}; + + ${StyledText} { + font-weight: ${theme.orbit.fontWeightMedium}; + font-size: ${theme.orbit.fontSizeFormLabel}; + color: ${theme.orbit.colorFormLabel}; + line-height: ${theme.orbit.heightCheckbox}; + } + `} +`; + +StyledLabelText.defaultProps = { + theme: defaultTheme, +}; + +const StyledInput = styled.input` + opacity: 0; + z-index: -1; + position: absolute; + &:checked + ${StyledIconContainer} > svg { + visibility: visible; + } + + &:focus + ${StyledIconContainer} { + ${defaultFocus} + } +`; + +StyledInput.defaultProps = { + theme: defaultTheme, +}; + +export const StyledLabel = styled(({ className, children, dataTest }) => ( + +))` + font-family: ${({ theme }) => theme.orbit.fontFamily}; + display: flex; + width: 100%; + flex-direction: row; + align-items: self-start; + opacity: ${({ disabled, theme }) => (disabled ? theme.orbit.opacityCheckboxDisabled : "1")}; + cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")}; + position: relative; + + ${StyledIconContainer} { + color: ${getToken(TOKENS.iconColor)}; + border: 1px solid ${getToken(TOKENS.borderColor)}; + } + + &:hover ${StyledIconContainer} { + border-color: ${({ disabled, theme, checked }) => + !disabled && checked ? theme.orbit.paletteBlueDark : theme.orbit.paletteBlueLightActive}; + box-shadow: none; + } + + &:active ${StyledIconContainer} { + border-color: ${({ disabled, theme }) => + disabled ? getToken(TOKENS.borderColor) : theme.orbit.paletteBlueNormal}; + transform: ${({ disabled, theme }) => + !disabled && `scale(${theme.orbit.modifierScaleCheckboxRadioActive})`}; + } +`; + +StyledLabel.defaultProps = { + theme: defaultTheme, +}; + +const Checkbox = React.forwardRef((props, ref) => { + const { + label, + value, + hasError = false, + disabled = false, + checked = false, + name, + onChange, + dataTest, + id, + info, + readOnly, + tabIndex, + tooltip, + } = props; + + const preventOnClick: React.MouseEventHandler = ev => ev.preventDefault(); + + return ( + + + {cloneWithTooltip( + tooltip, + + + , + )} + {(label || info) && ( + + {label && {label}} + {info && {info}} + + )} + + ); +}); + +Checkbox.displayName = "Checkbox"; + +export default Checkbox; diff --git a/packages/orbit-components/src/Checkbox/types.ts b/packages/orbit-components/src/Checkbox/types.ts new file mode 100644 index 0000000000..42d8c405c5 --- /dev/null +++ b/packages/orbit-components/src/Checkbox/types.ts @@ -0,0 +1,23 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly label?: React.ReactNode; + readonly value?: string; + readonly hasError?: boolean; + readonly disabled?: boolean; + readonly checked?: boolean; + readonly name?: string; + readonly info?: React.ReactNode; + readonly tabIndex?: string | number; + readonly readOnly?: boolean; + readonly tooltip?: React.ReactNode | null; + // Should be InputEvent type + // There is missing support for this event type in Typescript ATM + // @see https://fettblog.eu/typescript-react/events/#wheres-inputevent + readonly onChange?: (ev: React.ChangeEvent) => void; +} diff --git a/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.jsx b/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.jsx deleted file mode 100644 index 39eb7d076b..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.jsx +++ /dev/null @@ -1,176 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, select, boolean } from "@storybook/addon-knobs"; -import { FixedSizeList } from "react-window"; - -import { LABEL_ELEMENTS, LABEL_SIZES } from "./consts"; -import Radio from "../Radio"; -import Checkbox from "../Checkbox"; - -import ChoiceGroup from "."; - -export default { - title: "ChoiceGroup", -}; - -export const Default = (): React.Node => { - const label = text("Label", "What was the reason for your cancellation?"); - return ( - - - - - - ); -}; - -Default.story = { - parameters: { - info: "Playground of ChoiceGroup", - }, -}; - -export const Multiple = (): React.Node => { - const label = text("Label", "What was the reason for your cancellation?"); - return ( - - - - - - ); -}; - -Multiple.story = { - parameters: { - info: "Playground of ChoiceGroup", - }, -}; - -export const Filter = (): React.Node => { - const label = text("Label", "What was the reason for your cancellation?"); - const onlySelectionText = text("onlySelectionText", "Only"); - return ( - - - - - - ); -}; - -Filter.story = { - parameters: { - info: "Playground of ChoiceGroup", - }, -}; - -export const WithError = (): React.Node => { - const label = text("Label", "Label"); - const error = text("Error", "Error message (explain how to solve it)"); - - return ( - - - - - - ); -}; - -WithError.story = { - name: "With error", - - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const RenderProp = (): React.Node => { - const boxShadowSize = "3px"; - return ( - - {({ Container, Item, spacing }) => ( - ( -
- )} - innerElementType={Container} - height={150} - itemCount={500} - // computed height + top padding + spacing between items - itemSize={20 + parseInt(spacing, 10)} - > - {({ style, index }) => ( -
- - - -
- )} - - )} - - ); -}; - -RenderProp.story = { - name: "Render prop", - parameters: { - info: "A virtual list, demonstrating a use case for passing function as children", - }, -}; - -export const Playground = (): React.Node => { - const dataTest = text("dataTest", "test"); - const label = text("Label", "What was the reason for your cancellation?"); - const labelSize = select("labelSize", Object.values(LABEL_SIZES), LABEL_SIZES.NORMAL); - const labelAs = select("labelAs", Object.values(LABEL_ELEMENTS), LABEL_ELEMENTS.H4); - const error = text("error", "Something is wrong"); - const filter = boolean("Filter", false); - return ( - - - - - - ); -}; - -Playground.story = { - parameters: { - info: "Playground of ChoiceGroup", - }, -}; diff --git a/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.tsx b/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.tsx new file mode 100644 index 0000000000..284142c3fc --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/ChoiceGroup.stories.tsx @@ -0,0 +1,176 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, select, boolean } from "@storybook/addon-knobs"; +import { FixedSizeList } from "react-window"; + +import { LABEL_ELEMENTS, LABEL_SIZES } from "./consts"; +import Radio from "../Radio"; +import Checkbox from "../Checkbox"; + +import ChoiceGroup from "."; + +export default { + title: "ChoiceGroup", +}; + +export const Default = () => { + const label = text("Label", "What was the reason for your cancellation?"); + return ( + + + + + + ); +}; + +Default.story = { + parameters: { + info: "Playground of ChoiceGroup", + }, +}; + +export const Multiple = () => { + const label = text("Label", "What was the reason for your cancellation?"); + return ( + + + + + + ); +}; + +Multiple.story = { + parameters: { + info: "Playground of ChoiceGroup", + }, +}; + +export const Filter = () => { + const label = text("Label", "What was the reason for your cancellation?"); + const onlySelectionText = text("onlySelectionText", "Only"); + return ( + + + + + + ); +}; + +Filter.story = { + parameters: { + info: "Playground of ChoiceGroup", + }, +}; + +export const WithError = () => { + const label = text("Label", "Label"); + const error = text("Error", "Error message (explain how to solve it)"); + + return ( + + + + + + ); +}; + +WithError.story = { + name: "With error", + + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const RenderProp = () => { + const boxShadowSize = "3px"; + return ( + + {({ Container, Item, spacing }) => ( + ( +
+ )} + innerElementType={Container} + height={150} + itemCount={500} + // computed height + top padding + spacing between items + itemSize={20 + parseInt(spacing, 10)} + > + {({ style, index }) => ( +
+ {/* @ts-expect-error TODO */} + + + +
+ )} + + )} + + ); +}; + +RenderProp.story = { + name: "Render prop", + parameters: { + info: "A virtual list, demonstrating a use case for passing function as children", + }, +}; + +export const Playground = () => { + const dataTest = text("dataTest", "test"); + const label = text("Label", "What was the reason for your cancellation?"); + const labelSize = select("labelSize", Object.values(LABEL_SIZES), LABEL_SIZES.NORMAL); + const labelAs = select("labelAs", Object.values(LABEL_ELEMENTS), LABEL_ELEMENTS.H4); + const error = text("error", "Something is wrong"); + const filter = boolean("Filter", false); + return ( + + + + + + ); +}; + +Playground.story = { + parameters: { + info: "Playground of ChoiceGroup", + }, +}; diff --git a/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.jsx b/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.jsx deleted file mode 100644 index e07f5460de..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.jsx +++ /dev/null @@ -1,88 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import { LABEL_ELEMENTS, LABEL_SIZES } from "../consts"; -import Radio from "../../Radio"; -import Checkbox from "../../Checkbox"; -import ChoiceGroup from ".."; - -describe("ChoiceGroup", () => { - it("radio", () => { - const onChange = jest.fn(); - render( - - - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("Label")).toBeInTheDocument(); - userEvent.click(screen.getByRole("radio", { name: "Option" })); - expect(onChange).toHaveBeenCalled(); - }); - - it("filter", () => { - const onOnlySelection = jest.fn(); - render( - {}} - onOnlySelection={onOnlySelection} - onlySelectionText="Only" - > - - , - ); - userEvent.click(screen.getByText("Only")); - expect(onOnlySelection).toHaveBeenCalled(); - }); - - it("render prop", () => { - const onChange = jest.fn(); - render( - - {({ Container, Item, spacing }) => ( - - - - - - )} - , - ); - userEvent.click(screen.getByRole("radio", { name: "Option" })); - expect(onChange).toHaveBeenCalled(); - }); - - it("should have error", () => { - render( - {}} labelSize={LABEL_SIZES.LARGE} error="kek"> - - , - ); - - expect(screen.getByText("kek")).toBeInTheDocument(); - }); - - it("should have ref", () => { - const ref = React.createRef(); - - render( - {}}> - - , - ); - - expect(ref.current).toBeDefined(); - }); -}); diff --git a/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.tsx b/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.tsx new file mode 100644 index 0000000000..777f25f205 --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/__tests__/index.test.tsx @@ -0,0 +1,87 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import { LABEL_ELEMENTS, LABEL_SIZES } from "../consts"; +import Radio from "../../Radio"; +import Checkbox from "../../Checkbox"; +import ChoiceGroup from ".."; + +describe("ChoiceGroup", () => { + it("radio", () => { + const onChange = jest.fn(); + render( + + + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("Label")).toBeInTheDocument(); + userEvent.click(screen.getByRole("radio", { name: "Option" })); + expect(onChange).toHaveBeenCalled(); + }); + + it("filter", () => { + const onOnlySelection = jest.fn(); + render( + {}} + onOnlySelection={onOnlySelection} + onlySelectionText="Only" + > + + , + ); + userEvent.click(screen.getByText("Only")); + expect(onOnlySelection).toHaveBeenCalled(); + }); + + it("render prop", () => { + const onChange = jest.fn(); + render( + + {({ Container, Item, spacing }) => ( + + + + + + )} + , + ); + userEvent.click(screen.getByRole("radio", { name: "Option" })); + expect(onChange).toHaveBeenCalled(); + }); + + it("should have error", () => { + render( + {}} labelSize={LABEL_SIZES.LARGE} error="kek"> + + , + ); + + expect(screen.getByText("kek")).toBeInTheDocument(); + }); + + it("should have ref", () => { + const ref = React.createRef(); + + render( + {}}> + + , + ); + + expect(ref.current).toBeDefined(); + }); +}); diff --git a/packages/orbit-components/src/ChoiceGroup/components/Feedback.jsx.flow b/packages/orbit-components/src/ChoiceGroup/components/Feedback.js.flow similarity index 100% rename from packages/orbit-components/src/ChoiceGroup/components/Feedback.jsx.flow rename to packages/orbit-components/src/ChoiceGroup/components/Feedback.js.flow diff --git a/packages/orbit-components/src/ChoiceGroup/components/Feedback.jsx b/packages/orbit-components/src/ChoiceGroup/components/Feedback.jsx deleted file mode 100644 index 8df0e20dc3..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/components/Feedback.jsx +++ /dev/null @@ -1,49 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import defaultTheme from "../../defaultTheme"; -import type { Props } from "./Feedback"; - -export const StyledFormFeedback: any = styled(({ theme, type, ...props }) =>
)` - ${({ theme }) => css` - color: ${theme.orbit.colorTextError}; - font-family: ${theme.orbit.fontFamily}; - font-size: ${theme.orbit.fontSizeFormFeedback}; - font-weight: ${theme.orbit.fontWeightMedium}; - line-height: ${theme.orbit.lineHeightText}; - width: 100%; - margin-top: 2px; - position: absolute; - top: 100%; - max-height: ${Math.floor( - theme.orbit.lineHeightText * parseInt(theme.orbit.fontSizeFormFeedback, 10), - )}px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - & a { - color: ${theme.orbit.colorTextError}; - font-weight: ${theme.orbit.fontWeightMedium}; - text-decoration: underline; - cursor: pointer; - } - strong, - b { - font-weight: ${theme.fontWeightMedium}; - color: ${theme.paletteInkDark}; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledFormFeedback.defaultProps = { - theme: defaultTheme, -}; - -const FormFeedback = (props: Props): React.Node => { - const { children, dataTest } = props; - return {children}; -}; - -export default FormFeedback; diff --git a/packages/orbit-components/src/ChoiceGroup/components/Feedback.tsx b/packages/orbit-components/src/ChoiceGroup/components/Feedback.tsx new file mode 100644 index 0000000000..bc50efe936 --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/components/Feedback.tsx @@ -0,0 +1,51 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme from "../../defaultTheme"; + +interface Props { + dataTest?: string; + children: React.ReactNode; +} + +export const StyledFormFeedback = styled(props =>
)` + ${({ theme }) => css` + color: ${theme.orbit.colorTextError}; + font-family: ${theme.orbit.fontFamily}; + font-size: ${theme.orbit.fontSizeFormFeedback}; + font-weight: ${theme.orbit.fontWeightMedium}; + line-height: ${theme.orbit.lineHeightText}; + width: 100%; + margin-top: 2px; + position: absolute; + top: 100%; + max-height: ${Math.floor( + theme.orbit.lineHeightText * parseInt(theme.orbit.fontSizeFormFeedback, 10), + )}px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + & a { + color: ${theme.orbit.colorTextError}; + font-weight: ${theme.orbit.fontWeightMedium}; + text-decoration: underline; + cursor: pointer; + } + strong, + b { + font-weight: ${theme.fontWeightMedium}; + color: ${theme.paletteInkDark}; + } + `} +`; + +StyledFormFeedback.defaultProps = { + theme: defaultTheme, +}; + +const FormFeedback = (props: Props) => { + const { children, dataTest } = props; + return {children}; +}; + +export default FormFeedback; diff --git a/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.jsx.flow b/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.js.flow similarity index 100% rename from packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.jsx.flow rename to packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.js.flow diff --git a/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.jsx b/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.jsx deleted file mode 100644 index 93f0ee0819..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.jsx +++ /dev/null @@ -1,94 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import type { FilterWrapperType } from "./FilterWrapper"; -import defaultTheme from "../../defaultTheme"; -import ButtonLink from "../../ButtonLink"; - -const StyledOnlyButton = styled.div``; - -const hoverAndFocus = () => css` - background-color: ${({ theme }) => theme.orbit.paletteBlueLight}; - - ${StyledOnlyButton} { - visibility: visible; - opacity: 1; - } -`; - -// NOTE:https://skypicker.slack.com/archives/CAMS40F7B/p1658992944387749 -const StyledContentWrapper = styled.div` - ${({ disabled }) => css` - box-sizing: border-box; - width: 100%; - padding-left: 4px; - border-radius: 4px; - display: flex; - align-items: center; - height: ${({ theme }) => theme.orbit.heightButtonSmall}; - - ${StyledOnlyButton} { - visibility: hidden; - opacity: 0; - } - - ${!disabled && - css` - @media (hover: none) { - ${StyledOnlyButton} { - visibility: visible; - opacity: 0.3; - &:hover { - opacity: 1; - } - } - } - - @media (hover) and (pointer: fine) { - &:hover { - ${hoverAndFocus}; - } - - &:focus-within { - ${hoverAndFocus} - } - } - `}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledContentWrapper.defaultProps = { - theme: defaultTheme, -}; - -const FilterWrapper: FilterWrapperType = ({ - child, - children, - onOnlySelection, - onlySelectionText, -}) => { - const { value, label, disabled } = child.props; - - return ( - - {children} - {onOnlySelection && !disabled && ( - - { - onOnlySelection(ev, { value, label }); - }} - > - {onlySelectionText} - - - )} - - ); -}; - -export default FilterWrapper; diff --git a/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.tsx b/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.tsx new file mode 100644 index 0000000000..82774d0826 --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/components/FilterWrapper.tsx @@ -0,0 +1,95 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme from "../../defaultTheme"; +import ButtonLink from "../../ButtonLink"; + +const StyledOnlyButton = styled.div``; + +interface Props { + readonly child: React.ReactElement>; + readonly children: React.ReactElement>; + readonly onlySelectionText: React.ReactNode; + readonly onOnlySelection?: ( + ev: React.SyntheticEvent, + obj: Record<"label" | "value", string>, + ) => void | Promise; +} + +const hoverAndFocus = () => css` + background-color: ${({ theme }) => theme.orbit.paletteBlueLight}; + + ${StyledOnlyButton} { + visibility: visible; + opacity: 1; + } +`; + +const StyledContentWrapper = styled.div<{ disabled: boolean }>` + ${({ disabled }) => css` + box-sizing: border-box; + width: 100%; + padding-left: 4px; + border-radius: 4px; + display: flex; + align-items: center; + height: ${({ theme }) => theme.orbit.heightButtonSmall}; + + ${StyledOnlyButton} { + visibility: hidden; + opacity: 0; + } + + ${!disabled && + css` + @media (hover: none) { + ${StyledOnlyButton} { + visibility: visible; + opacity: 0.3; + &:hover { + opacity: 1; + } + } + } + + @media (hover) and (pointer: fine) { + &:hover { + ${hoverAndFocus}; + } + + &:focus-within { + ${hoverAndFocus} + } + } + `}; + `} +`; + +StyledContentWrapper.defaultProps = { + theme: defaultTheme, +}; + +const FilterWrapper = ({ child, children, onOnlySelection, onlySelectionText }: Props) => { + const { value, label, disabled } = child.props; + + return ( + + {children} + {onOnlySelection && !disabled && ( + + { + onOnlySelection(ev, { value, label }); + }} + > + {onlySelectionText} + + + )} + + ); +}; + +export default FilterWrapper; diff --git a/packages/orbit-components/src/ChoiceGroup/consts.js b/packages/orbit-components/src/ChoiceGroup/consts.js deleted file mode 100644 index 1f8111830c..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/consts.js +++ /dev/null @@ -1,13 +0,0 @@ -// @flow -export const LABEL_SIZES = { - NORMAL: "normal", - LARGE: "large", -}; - -export const LABEL_ELEMENTS = { - H2: "h2", - H3: "h3", - H4: "h4", - H5: "h5", - H6: "h6", -}; diff --git a/packages/orbit-components/src/ChoiceGroup/consts.ts b/packages/orbit-components/src/ChoiceGroup/consts.ts new file mode 100644 index 0000000000..87e7753056 --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/consts.ts @@ -0,0 +1,12 @@ +export enum LABEL_SIZES { + NORMAL = "normal", + LARGE = "large", +} + +export enum LABEL_ELEMENTS { + H2 = "h2", + H3 = "h3", + H4 = "h4", + H5 = "h5", + H6 = "h6", +} diff --git a/packages/orbit-components/src/ChoiceGroup/index.d.ts b/packages/orbit-components/src/ChoiceGroup/index.d.ts deleted file mode 100644 index 5eaad9f68a..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -type Size = "normal" | "large"; -type Element = "h2" | "h3" | "h4" | "h5" | "h6"; - -export interface Props extends Common.Global { - readonly children: - | React.ReactNode - | ((args: { - readonly Container: "div"; - readonly Item: React.ComponentType<{ readonly children: React.ReactNode }>; - readonly spacing: string; - }) => React.ReactNode); - readonly label?: Common.Translation; - readonly labelSize?: Size; - readonly labelAs?: Element; - readonly error?: Common.Translation; - readonly onlySelectionText?: Common.Translation; - readonly filter?: boolean; - readonly onOnlySelection?: ( - // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types - event: React.SyntheticEvent, - param2: { readonly value: string; readonly label: string }, - ) => void | Promise; - // InputEvent - readonly onChange: Common.Event>; -} - -declare const ChoiceGroup: React.ForwardRefRenderFunction; -export { ChoiceGroup, ChoiceGroup as default }; diff --git a/packages/orbit-components/src/ChoiceGroup/index.jsx.flow b/packages/orbit-components/src/ChoiceGroup/index.js.flow similarity index 100% rename from packages/orbit-components/src/ChoiceGroup/index.jsx.flow rename to packages/orbit-components/src/ChoiceGroup/index.js.flow diff --git a/packages/orbit-components/src/ChoiceGroup/index.jsx b/packages/orbit-components/src/ChoiceGroup/index.jsx deleted file mode 100644 index d1b9c44831..0000000000 --- a/packages/orbit-components/src/ChoiceGroup/index.jsx +++ /dev/null @@ -1,128 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import Heading from "../Heading"; -import Stack from "../Stack"; -import { LABEL_SIZES, LABEL_ELEMENTS } from "./consts"; -import Feedback, { StyledFormFeedback } from "./components/Feedback"; -import defaultTheme from "../defaultTheme"; -import FilterWrapper from "./components/FilterWrapper"; -import useRandomId from "../hooks/useRandomId"; -import useTheme from "../hooks/useTheme"; - -import type { Props } from "."; - -const getHeadingSize = size => { - const SIZES = { - [LABEL_SIZES.NORMAL]: "title3", - [LABEL_SIZES.LARGE]: "title2", - }; - return SIZES[size]; -}; - -const StyledChoiceGroup = styled.div` - width: 100%; - display: flex; - flex-direction: column; - - ${StyledFormFeedback} { - position: relative; - margin-top: ${({ theme }) => theme.orbit.spaceXSmall}; - top: initial; - } -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledChoiceGroup.defaultProps = { - theme: defaultTheme, -}; - -const ChoiceGroup: React.AbstractComponent = React.forwardRef( - ( - { - dataTest, - id, - label, - labelSize = LABEL_SIZES.NORMAL, - labelAs = LABEL_ELEMENTS.H4, - error, - children, - filter, - onOnlySelection, - onlySelectionText, - onChange, - }, - ref, - ): React.Node => { - const groupID = useRandomId(); - const theme = useTheme(); - - const handleChange = (ev: SyntheticInputEvent) => { - if (onChange) { - onChange(ev); - } - }; - - const itemProps = { - onChange: handleChange, - hasError: Boolean(error), - }; - - return ( - - {label && ( - - {label} - - )} - {typeof children === "function" ? ( - children({ - // for now a plain
is all we need, but we're reserving this space in the API - // in case we'll need something more in the future - Container: "div", - Item: ({ children: itemChildren }) => { - return !filter ? ( - React.cloneElement(React.Children.only(itemChildren), itemProps) - ) : ( - - {React.cloneElement(React.Children.only(itemChildren), itemProps)} - - ); - }, - spacing: filter ? "0px" : theme.orbit.spaceXSmall, - }) - ) : ( - - {React.Children.map(children, child => { - return !filter ? ( - React.cloneElement(child, itemProps) - ) : ( - - {React.cloneElement(child, itemProps)} - - ); - })} - - )} - {error && {error}} - - ); - }, -); - -export default ChoiceGroup; diff --git a/packages/orbit-components/src/ChoiceGroup/index.tsx b/packages/orbit-components/src/ChoiceGroup/index.tsx new file mode 100644 index 0000000000..b8e4c1ebe3 --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/index.tsx @@ -0,0 +1,133 @@ +import * as React from "react"; +import styled from "styled-components"; + +import Heading from "../Heading"; +import { Type } from "../Heading/types"; +import Stack from "../Stack"; +import { LABEL_SIZES, LABEL_ELEMENTS } from "./consts"; +import Feedback, { StyledFormFeedback } from "./components/Feedback"; +import defaultTheme from "../defaultTheme"; +import FilterWrapper from "./components/FilterWrapper"; +import useRandomId from "../hooks/useRandomId"; +import useTheme from "../hooks/useTheme"; +import { Props, Size } from "./types"; + +const getHeadingSize = (size: Size): Type => { + const SIZES: Record = { + [LABEL_SIZES.NORMAL]: "title3", + [LABEL_SIZES.LARGE]: "title2", + }; + + return SIZES[size]; +}; + +const StyledChoiceGroup = styled.div` + width: 100%; + display: flex; + flex-direction: column; + + ${StyledFormFeedback} { + position: relative; + margin-top: ${({ theme }) => theme.orbit.spaceXSmall}; + top: initial; + } +`; + +StyledChoiceGroup.defaultProps = { + theme: defaultTheme, +}; + +const ChoiceGroup = React.forwardRef( + ( + { + dataTest, + id, + label, + labelSize = LABEL_SIZES.NORMAL, + labelAs = LABEL_ELEMENTS.H4, + error, + children, + filter, + onOnlySelection, + onlySelectionText, + onChange, + }, + ref, + ) => { + const groupID = useRandomId(); + const theme = useTheme(); + + const handleChange = (ev: React.SyntheticEvent) => { + if (onChange) { + onChange(ev); + } + }; + + const itemProps = { + onChange: handleChange, + hasError: Boolean(error), + }; + + return ( + + {label && ( + + {label} + + )} + {typeof children === "function" ? ( + children({ + // for now a plain
is all we need, but we're reserving this space in the API + // in case we'll need something more in the future + Container: "div", + Item: ({ children: itemChildren }) => { + return !filter ? ( + // @ts-expect-error TODO + React.cloneElement(React.Children.only(itemChildren), itemProps) + ) : ( + + {/* @ts-expect-error TODO */} + {React.cloneElement(React.Children.only(itemChildren), itemProps)} + + ); + }, + spacing: filter ? "0px" : theme.orbit.spaceXSmall, + }) + ) : ( + + {React.Children.map(children, child => { + return !filter ? ( + // @ts-expect-error TODO + React.cloneElement(child, itemProps) + ) : ( + + {/* @ts-expect-error TODO */} + {React.cloneElement(child, itemProps)} + + ); + })} + + )} + {error && {error}} + + ); + }, +); + +export default ChoiceGroup; diff --git a/packages/orbit-components/src/ChoiceGroup/types.ts b/packages/orbit-components/src/ChoiceGroup/types.ts new file mode 100644 index 0000000000..c6205c859a --- /dev/null +++ b/packages/orbit-components/src/ChoiceGroup/types.ts @@ -0,0 +1,31 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export type Size = "normal" | "large"; +type Element = "h2" | "h3" | "h4" | "h5" | "h6"; + +export interface Props extends Common.Globals { + readonly children: + | React.ReactNode + | ((args: { + readonly Container: "div"; + readonly Item: React.ComponentType<{ readonly children: React.ReactNode }>; + readonly spacing: string; + }) => React.ReactNode); + readonly label?: Common.Translation; + readonly labelSize?: Size; + readonly labelAs?: Element; + readonly error?: Common.Translation; + readonly onlySelectionText?: Common.Translation; + readonly filter?: boolean; + readonly onOnlySelection?: ( + event: React.SyntheticEvent, + param2: { readonly value: string; readonly label: string }, + ) => void | Promise; + // InputEvent + readonly onChange: Common.Event>; +} diff --git a/packages/orbit-components/src/ClickOutside/__tests__/index.test.jsx b/packages/orbit-components/src/ClickOutside/__tests__/index.test.jsx deleted file mode 100644 index 1ade8ff4d8..0000000000 --- a/packages/orbit-components/src/ClickOutside/__tests__/index.test.jsx +++ /dev/null @@ -1,32 +0,0 @@ -// @flow -import * as React from "react"; -import { render, cleanup } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import ClickOutside from ".."; - -describe("ClickOutside", () => { - it("should trigger when clicked outside", () => { - const insideRef: {| current: React.ElementRef |} = React.createRef(); - const outsideRef: {| current: React.ElementRef |} = React.createRef(); - const onClickOutside = jest.fn(); - render( -
- -
Lorem ispum
-
-
, - ); - userEvent.click(insideRef.current); - expect(onClickOutside).not.toHaveBeenCalled(); - userEvent.click(outsideRef.current); - expect(onClickOutside).toHaveBeenCalled(); - }); - - it("should clean up when unmounted", () => { - const removeEventListenerSpy = jest.spyOn(document, "removeEventListener"); - render( {}}>Lorem ipsum); - cleanup(); - expect(removeEventListenerSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/ClickOutside/__tests__/index.test.tsx b/packages/orbit-components/src/ClickOutside/__tests__/index.test.tsx new file mode 100644 index 0000000000..fa9cc73c91 --- /dev/null +++ b/packages/orbit-components/src/ClickOutside/__tests__/index.test.tsx @@ -0,0 +1,36 @@ +import * as React from "react"; +import { render, cleanup, act } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import ClickOutside from ".."; + +describe("ClickOutside", () => { + it("should trigger when clicked outside", async () => { + const insideRef = React.createRef(); + const outsideRef = React.createRef(); + const onClickOutside = jest.fn(); + + act(() => { + render( +
+ +
Lorem ipsum
+
+
, + ); + + userEvent.click(insideRef.current as HTMLDivElement); + expect(onClickOutside).not.toHaveBeenCalled(); + }); + + userEvent.click(outsideRef.current as HTMLDivElement); + expect(onClickOutside).toHaveBeenCalled(); + }); + + it("should clean up when unmounted", () => { + const removeEventListenerSpy = jest.spyOn(document, "removeEventListener"); + render( {}}>Lorem ipsum); + cleanup(); + expect(removeEventListenerSpy).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/ClickOutside/index.d.ts b/packages/orbit-components/src/ClickOutside/index.d.ts deleted file mode 100644 index 81accd5e93..0000000000 --- a/packages/orbit-components/src/ClickOutside/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props { - readonly onClickOutside?: Common.Event; - readonly children: React.ReactNode | React.ReactNode[]; -} - -declare const ClickOutside: React.FunctionComponent; -export { ClickOutside, ClickOutside as default }; diff --git a/packages/orbit-components/src/ClickOutside/index.jsx.flow b/packages/orbit-components/src/ClickOutside/index.js.flow similarity index 100% rename from packages/orbit-components/src/ClickOutside/index.jsx.flow rename to packages/orbit-components/src/ClickOutside/index.js.flow diff --git a/packages/orbit-components/src/ClickOutside/index.jsx b/packages/orbit-components/src/ClickOutside/index.jsx deleted file mode 100644 index 17eb8edcb2..0000000000 --- a/packages/orbit-components/src/ClickOutside/index.jsx +++ /dev/null @@ -1,41 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import type { Props } from "."; - -const Inner = styled.div` - width: 100%; -`; - -class ClickOutside extends React.PureComponent { - node: {| current: null | HTMLDivElement |} = React.createRef(); - - componentDidMount() { - document.addEventListener("click", this.handleClickOutside, true); - } - - componentWillUnmount() { - document.removeEventListener("click", this.handleClickOutside, true); - } - - handleClickOutside: (ev: MouseEvent) => void = (ev: MouseEvent) => { - const { onClickOutside } = this.props; - if ( - onClickOutside && - this.node.current && - ev.target instanceof Node && - !this.node.current.contains(ev.target) - ) { - onClickOutside(ev); - } - }; - - render(): React.Node { - const { children } = this.props; - - return {children}; - } -} - -export default ClickOutside; diff --git a/packages/orbit-components/src/ClickOutside/index.tsx b/packages/orbit-components/src/ClickOutside/index.tsx new file mode 100644 index 0000000000..76b7cde633 --- /dev/null +++ b/packages/orbit-components/src/ClickOutside/index.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import styled from "styled-components"; + +import { Props } from "./types"; + +const InnerStyled = styled.div` + width: 100%; +`; + +export default function ClickOutside({ children, onClickOutside }: Props) { + const ref = React.useRef(null); + + React.useEffect(() => { + const handleClickOutside = (ev: MouseEvent) => { + if (onClickOutside && ref.current && !ref.current.contains(ev.currentTarget as Node)) { + onClickOutside(ev); + } + }; + + document.addEventListener("mousedown", handleClickOutside); + return () => { + document.removeEventListener("mousedown", handleClickOutside); + }; + }, [onClickOutside]); + + return {children}; +} diff --git a/packages/orbit-components/src/ClickOutside/types.ts b/packages/orbit-components/src/ClickOutside/types.ts new file mode 100644 index 0000000000..0c8a63687b --- /dev/null +++ b/packages/orbit-components/src/ClickOutside/types.ts @@ -0,0 +1,9 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +export interface Props { + readonly onClickOutside?: (ev: MouseEvent) => void; + readonly children: React.ReactNode | React.ReactNode[]; +} diff --git a/packages/orbit-components/src/Collapse/Collapse.stories.jsx b/packages/orbit-components/src/Collapse/Collapse.stories.jsx deleted file mode 100644 index bcb26085c0..0000000000 --- a/packages/orbit-components/src/Collapse/Collapse.stories.jsx +++ /dev/null @@ -1,300 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { text, boolean } from "@storybook/addon-knobs"; - -import Badge from "../Badge"; -import ChoiceGroup from "../ChoiceGroup"; -import Checkbox from "../Checkbox"; -import Slider from "../Slider"; -import Stack from "../Stack"; -import TextLink from "../TextLink"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; - -import Collapse from "."; - -export default { - title: "Collapse", -}; - -export const Default = (): React.Node => { - const label = text("label", "Duration"); - return ( - - - - ); -}; - -Default.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const WithCustomLabel = (): React.Node => { - return ( - - Custom label - Custom label - Custom label - Custom label - - } - > - - - ); -}; - -export const OpenedByDefault = (): React.Node => { - const label = text("label", "Duration"); - return ( - - - - ); -}; - -OpenedByDefault.story = { - name: "Opened by default", - - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const WithActions = (): React.Node => { - const label = text("label", "Transportation"); - return ( - - Clear - - } - > - - - - - - - ); -}; - -WithActions.story = { - name: "With actions", - - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const MultipleCollapses = (): React.Node => { - const label = text("label", "Transportation"); - return ( - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -MultipleCollapses.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Uncontrolled = (): React.Node => { - const label = text("label", "Duration"); - const expanded = boolean("expanded", true); - return ( - - - - ); -}; - -Uncontrolled.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Rtl = (): React.Node => { - const label = text("label", "Transportation"); - return ( - - - Clear - - } - > - - - - - - - - ); -}; - -Rtl.story = { - name: "RTL", - - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; diff --git a/packages/orbit-components/src/Collapse/Collapse.stories.tsx b/packages/orbit-components/src/Collapse/Collapse.stories.tsx new file mode 100644 index 0000000000..a746d37d24 --- /dev/null +++ b/packages/orbit-components/src/Collapse/Collapse.stories.tsx @@ -0,0 +1,299 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { text, boolean } from "@storybook/addon-knobs"; + +import Badge from "../Badge"; +import ChoiceGroup from "../ChoiceGroup"; +import Checkbox from "../Checkbox"; +import Slider from "../Slider"; +import Stack from "../Stack"; +import TextLink from "../TextLink"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; + +import Collapse from "."; + +export default { + title: "Collapse", +}; + +export const Default = () => { + const label = text("label", "Duration"); + return ( + + + + ); +}; + +Default.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const WithCustomLabel = () => { + return ( + + Custom label + Custom label + Custom label + Custom label + + } + > + + + ); +}; + +export const OpenedByDefault = () => { + const label = text("label", "Duration"); + return ( + + + + ); +}; + +OpenedByDefault.story = { + name: "Opened by default", + + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const WithActions = () => { + const label = text("label", "Transportation"); + return ( + + Clear + + } + > + + + + + + + ); +}; + +WithActions.story = { + name: "With actions", + + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const MultipleCollapses = () => { + const label = text("label", "Transportation"); + return ( + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +MultipleCollapses.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Uncontrolled = () => { + const label = text("label", "Duration"); + const expanded = boolean("expanded", true); + return ( + + + + ); +}; + +Uncontrolled.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Rtl = () => { + const label = text("label", "Transportation"); + return ( + + + Clear + + } + > + + + + + + + + ); +}; + +Rtl.story = { + name: "RTL", + + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; diff --git a/packages/orbit-components/src/Collapse/__tests__/index.test.jsx b/packages/orbit-components/src/Collapse/__tests__/index.test.jsx deleted file mode 100644 index 937765b7bd..0000000000 --- a/packages/orbit-components/src/Collapse/__tests__/index.test.jsx +++ /dev/null @@ -1,79 +0,0 @@ -// @flow - -import * as React from "react"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import Collapse from ".."; - -const toggleButtons = [ - [0, "label"], - [1, "icon button"], -]; - -describe("Collapse", () => { - it("should have expected parts of DOM output", () => { - render( - -
children
-
, - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("Collapse")).toBeInTheDocument(); - }); - - it("should have customLabel", () => { - render( - -
children
-
, - ); - expect(screen.getByText("customLabel")).toBeInTheDocument(); - }); - - it.each(toggleButtons)("should trigger click handler when clicking on %s", buttonIndex => { - const onClick = jest.fn(); - render( - -
children
-
, - ); - const toggleButton = screen.getAllByRole("button", { name: "Collapse" })[buttonIndex]; - userEvent.click(toggleButton); - expect(onClick).toHaveBeenCalled(); - }); - - describe("uncontrolled", () => { - it.each(toggleButtons)("should expand/collapse when clicking on %s", buttonIndex => { - render( - -
children
-
, - ); - const toggleButton = screen.getAllByRole("button", { name: "Collapse" })[buttonIndex]; - // with ByRole we can test whether the content is visible because of aria-hidden - expect(screen.queryByRole("article")).not.toBeInTheDocument(); - userEvent.click(toggleButton); - expect(screen.getByRole("article")).toBeInTheDocument(); - userEvent.click(toggleButton); - expect(screen.queryByRole("article")).not.toBeInTheDocument(); - }); - }); - - describe("controlled", () => { - it("should expand/collapse with prop", () => { - const { rerender } = render( - -
children
-
, - ); - expect(screen.queryByRole("article")).not.toBeInTheDocument(); - rerender( - -
children
-
, - ); - expect(screen.getByRole("article")).toBeInTheDocument(); - }); - }); -}); diff --git a/packages/orbit-components/src/Collapse/__tests__/index.test.tsx b/packages/orbit-components/src/Collapse/__tests__/index.test.tsx new file mode 100644 index 0000000000..1f59e1f261 --- /dev/null +++ b/packages/orbit-components/src/Collapse/__tests__/index.test.tsx @@ -0,0 +1,77 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import Collapse from ".."; + +const toggleButtons = [ + [0, "label"], + [1, "icon button"], +]; + +describe("Collapse", () => { + it("should have expected parts of DOM output", () => { + render( + +
children
+
, + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("Collapse")).toBeInTheDocument(); + }); + + it("should have customLabel", () => { + render( + +
children
+
, + ); + expect(screen.getByText("customLabel")).toBeInTheDocument(); + }); + + it.each(toggleButtons)("should trigger click handler when clicking on %s", buttonIndex => { + const onClick = jest.fn(); + render( + +
children
+
, + ); + const toggleButton = screen.getAllByRole("button", { name: "Collapse" })[buttonIndex]; + userEvent.click(toggleButton); + expect(onClick).toHaveBeenCalled(); + }); + + describe("uncontrolled", () => { + it.each(toggleButtons)("should expand/collapse when clicking on %s", buttonIndex => { + render( + +
children
+
, + ); + const toggleButton = screen.getAllByRole("button", { name: "Collapse" })[buttonIndex]; + // with ByRole we can test whether the content is visible because of aria-hidden + expect(screen.queryByRole("article")).not.toBeInTheDocument(); + userEvent.click(toggleButton); + expect(screen.getByRole("article")).toBeInTheDocument(); + userEvent.click(toggleButton); + expect(screen.queryByRole("article")).not.toBeInTheDocument(); + }); + }); + + describe("controlled", () => { + it("should expand/collapse with prop", () => { + const { rerender } = render( + +
children
+
, + ); + expect(screen.queryByRole("article")).not.toBeInTheDocument(); + rerender( + +
children
+
, + ); + expect(screen.getByRole("article")).toBeInTheDocument(); + }); + }); +}); diff --git a/packages/orbit-components/src/Collapse/index.d.ts b/packages/orbit-components/src/Collapse/index.d.ts deleted file mode 100644 index 748b9e24a0..0000000000 --- a/packages/orbit-components/src/Collapse/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly initialExpanded?: boolean; - readonly expanded?: boolean; - readonly label?: Common.Translation; - readonly children: React.ReactNode; - readonly actions?: React.ReactNode; - readonly customLabel?: React.ReactNode; - readonly onClick?: ( - // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types - e: React.SyntheticEvent, - state: boolean, - ) => void | Promise; -} - -declare const Collapse: React.FunctionComponent; -export { Collapse, Collapse as default }; diff --git a/packages/orbit-components/src/Collapse/index.jsx.flow b/packages/orbit-components/src/Collapse/index.js.flow similarity index 100% rename from packages/orbit-components/src/Collapse/index.jsx.flow rename to packages/orbit-components/src/Collapse/index.js.flow diff --git a/packages/orbit-components/src/Collapse/index.jsx b/packages/orbit-components/src/Collapse/index.jsx deleted file mode 100644 index d490ad59a2..0000000000 --- a/packages/orbit-components/src/Collapse/index.jsx +++ /dev/null @@ -1,148 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import Heading from "../Heading"; -import Stack from "../Stack"; -import ButtonLink from "../ButtonLink"; -import ChevronDown from "../icons/ChevronDown"; -import Slide from "../utils/Slide"; -import defaultTheme from "../defaultTheme"; -import { useRandomIdSeed } from "../hooks/useRandomId"; -import useBoundingRect from "../hooks/useBoundingRect"; - -import type { Props } from "."; - -const AnimatedIcon = styled(ChevronDown)` - ${({ theme }) => css` - transition: transform ${theme.orbit.durationFast} ease-in-out; - ${({ expanded }) => - expanded && - css` - transform: rotate(180deg); - `}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -AnimatedIcon.defaultProps = { - theme: defaultTheme, -}; -const StyledCollapse = styled.div` - ${({ theme }) => css` - width: 100%; - display: block; - border-bottom: 1px solid ${theme.orbit.paletteCloudNormal}; - padding-bottom: ${theme.orbit.spaceSmall}; - margin-bottom: ${theme.orbit.spaceMedium}; - :last-child, - :only-child { - border: 0; - margin: 0; - } - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCollapse.defaultProps = { - theme: defaultTheme, -}; - -const StyledCollapseLabel = styled.div` - width: 100%; - display: block; - cursor: pointer; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCollapseLabel.defaultProps = { - theme: defaultTheme, -}; - -const StyledCollapseChildren = styled.div` - ${({ theme }) => css` - margin: ${theme.orbit.spaceSmall} 0; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCollapseChildren.defaultProps = { - theme: defaultTheme, -}; - -const StyledActionsWrapper = styled.div` - display: flex; - align-items: center; -`; - -const Collapse = ({ - initialExpanded = false, - customLabel, - expanded: expandedProp, - label, - children, - dataTest, - id, - onClick, - actions, -}: Props): React.Node => { - const isControlledComponent = React.useMemo(() => expandedProp != null, [expandedProp]); - const [expandedState, setExpandedState] = React.useState( - isControlledComponent ? expandedProp : initialExpanded, - ); - const expanded = isControlledComponent ? expandedProp : expandedState; - const [{ height }, node] = useBoundingRect({ height: expanded ? null : 0 }); - - const randomId = useRandomIdSeed(); - const slideID = randomId("slideID"); - const labelID = randomId("labelID"); - - const handleClick = React.useCallback( - event => { - if (!isControlledComponent) { - if (onClick) { - onClick(event, !expanded); - } - - setExpandedState(!expanded); - } else if (onClick) { - onClick(event, !expanded); - } - }, - [expanded, isControlledComponent, onClick], - ); - - return ( - - - - {label && !customLabel && {label}} - {customLabel} - {/* TODO: dictionary for title */} - - { - ev.stopPropagation(); - }} - > - {actions} - - } - size="small" - type="secondary" - ariaLabelledby={labelID} - ariaExpanded={expanded} - ariaControls={slideID} - /> - - - - - {children} - - - ); -}; - -export default Collapse; diff --git a/packages/orbit-components/src/Collapse/index.tsx b/packages/orbit-components/src/Collapse/index.tsx new file mode 100644 index 0000000000..4426d014ae --- /dev/null +++ b/packages/orbit-components/src/Collapse/index.tsx @@ -0,0 +1,141 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import Heading from "../Heading"; +import Stack from "../Stack"; +import ButtonLink from "../ButtonLink"; +import ChevronDown from "../icons/ChevronDown"; +import Slide from "../utils/Slide"; +import defaultTheme from "../defaultTheme"; +import { useRandomIdSeed } from "../hooks/useRandomId"; +import useBoundingRect from "../hooks/useBoundingRect"; +import { Props } from "./types"; + +const AnimatedIcon = styled(ChevronDown)<{ expanded?: boolean }>` + ${({ theme, expanded }) => css` + transition: transform ${theme.orbit.durationFast} ease-in-out; + ${expanded && + css` + transform: rotate(180deg); + `}; + `} +`; + +AnimatedIcon.defaultProps = { + theme: defaultTheme, +}; + +const StyledCollapse = styled.div` + ${({ theme }) => css` + width: 100%; + display: block; + border-bottom: 1px solid ${theme.orbit.paletteCloudNormal}; + padding-bottom: ${theme.orbit.spaceSmall}; + margin-bottom: ${theme.orbit.spaceMedium}; + :last-child, + :only-child { + border: 0; + margin: 0; + } + `} +`; + +StyledCollapse.defaultProps = { + theme: defaultTheme, +}; + +const StyledCollapseLabel = styled.div` + width: 100%; + display: block; + cursor: pointer; +`; + +StyledCollapseLabel.defaultProps = { + theme: defaultTheme, +}; + +const StyledCollapseChildren: any = styled.div` + ${({ theme }) => css` + margin: ${theme.orbit.spaceSmall} 0; + `} +`; + +StyledCollapseChildren.defaultProps = { + theme: defaultTheme, +}; + +const StyledActionsWrapper = styled.div` + display: flex; + align-items: center; +`; + +const Collapse = ({ + initialExpanded = false, + customLabel, + expanded: expandedProp, + label, + children, + dataTest, + id, + onClick, + actions, +}: Props) => { + const isControlledComponent = React.useMemo(() => expandedProp != null, [expandedProp]); + const [expandedState, setExpandedState] = React.useState( + isControlledComponent ? expandedProp : initialExpanded, + ); + const expanded = isControlledComponent ? expandedProp : expandedState; + const [{ height }, node] = useBoundingRect({ height: expanded ? null : 0 }); + + const randomId = useRandomIdSeed(); + const slideID = randomId("slideID"); + const labelID = randomId("labelID"); + + const handleClick = React.useCallback( + event => { + if (!isControlledComponent) { + if (onClick) { + onClick(event, !expanded); + } + + setExpandedState(!expanded); + } else if (onClick) { + onClick(event, !expanded); + } + }, + [expanded, isControlledComponent, onClick], + ); + + return ( + + + + {label && !customLabel && {label}} + {customLabel} + + { + ev.stopPropagation(); + }} + > + {actions} + + } + size="small" + type="secondary" + ariaLabelledby={labelID} + ariaExpanded={expanded} + ariaControls={slideID} + /> + + + + + {children} + + + ); +}; + +export default Collapse; diff --git a/packages/orbit-components/src/Collapse/types.ts b/packages/orbit-components/src/Collapse/types.ts new file mode 100644 index 0000000000..9414e7d759 --- /dev/null +++ b/packages/orbit-components/src/Collapse/types.ts @@ -0,0 +1,19 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly initialExpanded?: boolean; + readonly expanded?: boolean; + readonly label?: Common.Translation; + readonly children: React.ReactNode; + readonly actions?: React.ReactNode; + readonly customLabel?: React.ReactNode; + readonly onClick?: ( + e: React.SyntheticEvent, + state: boolean, + ) => void | Promise; +} diff --git a/packages/orbit-components/src/CountryFlag/CountryFlag.stories.jsx b/packages/orbit-components/src/CountryFlag/CountryFlag.stories.jsx deleted file mode 100644 index 09c7eee565..0000000000 --- a/packages/orbit-components/src/CountryFlag/CountryFlag.stories.jsx +++ /dev/null @@ -1,40 +0,0 @@ -// @flow - -import * as React from "react"; -import { text, select } from "@storybook/addon-knobs"; - -import { CODES, SIZES } from "./consts"; - -import CountryFlag from "."; - -export default { - title: "CountryFlag", -}; - -export const Default = (): React.Node => { - const code = text("Code", CODES.ANYWHERE); - - return ; -}; - -Default.story = { - parameters: { - info: - "Country flag displays one flag of selected country. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Playground = (): React.Node => { - const code = text("Code", CODES.ANYWHERE); - const name = text("Name", "Country"); - const size = select("Size", Object.values(SIZES), SIZES.SMALL); - const dataTest = text("dataTest", "test"); - return ; -}; - -Playground.story = { - parameters: { - info: - "Country flag displays one flag of selected country. Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; diff --git a/packages/orbit-components/src/CountryFlag/CountryFlag.stories.tsx b/packages/orbit-components/src/CountryFlag/CountryFlag.stories.tsx new file mode 100644 index 0000000000..fcbdeed1c6 --- /dev/null +++ b/packages/orbit-components/src/CountryFlag/CountryFlag.stories.tsx @@ -0,0 +1,38 @@ +import React from "react"; +import { text, select } from "@storybook/addon-knobs"; + +import { CODES, SIZES } from "./consts"; + +import CountryFlag from "."; + +export default { + title: "CountryFlag", +}; + +export const Default = () => { + const code = text("Code", CODES.ANYWHERE); + + return ; +}; + +Default.story = { + parameters: { + info: + "Country flag displays one flag of selected country. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Playground = () => { + const code = text("Code", CODES.ANYWHERE); + const name = text("Name", "Country"); + const size = select("Size", Object.values(SIZES), SIZES.SMALL); + const dataTest = text("dataTest", "test"); + return ; +}; + +Playground.story = { + parameters: { + info: + "Country flag displays one flag of selected country. Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; diff --git a/packages/orbit-components/src/CountryFlag/__tests__/index.test.jsx b/packages/orbit-components/src/CountryFlag/__tests__/index.test.jsx deleted file mode 100644 index b8ebe6f2cf..0000000000 --- a/packages/orbit-components/src/CountryFlag/__tests__/index.test.jsx +++ /dev/null @@ -1,46 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen, cleanup } from "@testing-library/react"; - -import CountryFlag from ".."; - -describe("CountryFlag", () => { - it("should have expected DOM output", () => { - render(); - const flag = screen.getByRole("img", { name: "Anywhere" }); - expect(flag).toHaveAttribute("src", expect.stringContaining("anywhere")); - expect(flag).toHaveAttribute("srcset", expect.stringContaining("anywhere")); - expect(screen.getByTitle("Anywhere")).toBeInTheDocument(); - expect(screen.getByAltText("Anywhere")).toBeInTheDocument(); - expect(screen.getByTestId("test")).toBeInTheDocument(); - }); - it("should support omitting code and name", () => { - let flag; - render(); - flag = screen.getByRole("img", { name: "Undefined" }); - expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); - cleanup(); - render(); - flag = screen.getByRole("img", { name: "Country" }); - expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); - cleanup(); - render(); - flag = screen.getByRole("img"); - expect(flag).toHaveAttribute("src", expect.stringContaining("us")); - expect(flag).not.toHaveAttribute("alt"); - expect(flag).not.toHaveAttribute("title"); - }); - it("should warn and fallback on unknown code", () => { - const consoleSpy = jest.spyOn(console, "warn").mockImplementation(() => {}); - render(); - const flag = screen.getByRole("img", { name: "Country" }); - expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); - expect(consoleSpy).toHaveBeenCalledWith("Country code not supported: 404"); - consoleSpy.mockRestore(); - }); - it("should support case insensitive code", () => { - render(); - const flag = screen.getByRole("img"); - expect(flag).toHaveAttribute("src", expect.stringContaining("us")); - }); -}); diff --git a/packages/orbit-components/src/CountryFlag/__tests__/index.test.tsx b/packages/orbit-components/src/CountryFlag/__tests__/index.test.tsx new file mode 100644 index 0000000000..7871f5dfdd --- /dev/null +++ b/packages/orbit-components/src/CountryFlag/__tests__/index.test.tsx @@ -0,0 +1,45 @@ +import React from "react"; +import { render, screen, cleanup } from "@testing-library/react"; + +import CountryFlag from ".."; + +describe("CountryFlag", () => { + it("should have expected DOM output", () => { + render(); + const flag = screen.getByRole("img", { name: "Anywhere" }); + expect(flag).toHaveAttribute("src", expect.stringContaining("anywhere")); + expect(flag).toHaveAttribute("srcset", expect.stringContaining("anywhere")); + expect(screen.getByTitle("Anywhere")).toBeInTheDocument(); + expect(screen.getByAltText("Anywhere")).toBeInTheDocument(); + expect(screen.getByTestId("test")).toBeInTheDocument(); + }); + it("should support omitting code and name", () => { + let flag; + render(); + flag = screen.getByRole("img", { name: "Undefined" }); + expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); + cleanup(); + render(); + flag = screen.getByRole("img", { name: "Country" }); + expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); + cleanup(); + render(); + flag = screen.getByRole("img"); + expect(flag).toHaveAttribute("src", expect.stringContaining("us")); + expect(flag).not.toHaveAttribute("alt"); + expect(flag).not.toHaveAttribute("title"); + }); + it("should warn and fallback on unknown code", () => { + const consoleSpy = jest.spyOn(console, "warn").mockImplementation(() => {}); + render(); + const flag = screen.getByRole("img", { name: "Country" }); + expect(flag).toHaveAttribute("src", expect.stringContaining("undefined")); + expect(consoleSpy).toHaveBeenCalledWith("Country code not supported: 404"); + consoleSpy.mockRestore(); + }); + it("should support case insensitive code", () => { + render(); + const flag = screen.getByRole("img"); + expect(flag).toHaveAttribute("src", expect.stringContaining("us")); + }); +}); diff --git a/packages/orbit-components/src/CountryFlag/consts.js b/packages/orbit-components/src/CountryFlag/consts.js deleted file mode 100644 index 4ff4b7f8fc..0000000000 --- a/packages/orbit-components/src/CountryFlag/consts.js +++ /dev/null @@ -1,273 +0,0 @@ -// @flow -export const baseURL = "//images.kiwi.com"; - -export const CODES = { - AD: "ad", - AE: "ae", - AF: "af", - AG: "ag", - AI: "ai", - AL: "al", - AM: "am", - AN: "an", - ANYWHERE: "anywhere", - AO: "ao", - AQ: "aq", - AR: "ar", - AS: "as", - AT: "at", - AU: "au", - AW: "aw", - AX: "ax", - AZ: "az", - BA: "ba", - BB: "bb", - BD: "bd", - BE: "be", - BF: "bf", - BG: "bg", - BH: "bh", - BI: "bi", - BJ: "bj", - BL: "bl", - BM: "bm", - BN: "bn", - BO: "bo", - BQ: "bq", - BR: "br", - BS: "bs", - BT: "bt", - BV: "bv", - BW: "bw", - BY: "by", - BZ: "bz", - CA_FR: "ca-fr", - CA: "ca", - CC: "cc", - CD: "cd", - CF: "cf", - CG: "cg", - CH: "ch", - CI: "ci", - CK: "ck", - CL: "cl", - CM: "cm", - CN: "cn", - CO: "co", - CR: "cr", - CS: "cs", - CT: "ct", - CU: "cu", - CV: "cv", - CW: "cw", - CX: "cx", - CY: "cy", - CZ: "cz", - DE: "de", - DJ: "dj", - DK: "dk", - DM: "dm", - DO: "do", - DZ: "dz", - EC: "ec", - EE: "ee", - EG: "eg", - EH: "eh", - ER: "er", - ES: "es", - ET: "et", - EU: "eu", - FI: "fi", - FJ: "fj", - FK: "fk", - FM: "fm", - FO: "fo", - FR: "fr", - GA: "ga", - GB: "gb", - GD: "gd", - GE: "ge", - GF: "gf", - GG: "gg", - GH: "gh", - GI: "gi", - GL: "gl", - GM: "gm", - GN: "gn", - GP: "gp", - GQ: "gq", - GR: "gr", - GS: "gs", - GT: "gt", - GU: "gu", - GW: "gw", - GY: "gy", - HK: "hk", - HM: "hm", - HN: "hn", - HR: "hr", - HT: "ht", - HU: "hu", - IC: "ic", - ID: "id", - IE: "ie", - IL: "il", - IM: "im", - IN: "in", - IO: "io", - IQ: "iq", - IR: "ir", - IS: "is", - IT: "it", - JE: "je", - JM: "jm", - JO: "jo", - JP: "jp", - KE: "ke", - KG: "kg", - KH: "kh", - KI: "ki", - KM: "km", - KN: "kn", - KP: "kp", - KR: "kr", - KW: "kw", - KY: "ky", - KZ: "kz", - LA: "la", - LB: "lb", - LC: "lc", - LI: "li", - LK: "lk", - LR: "lr", - LS: "ls", - LT: "lt", - LU: "lu", - LV: "lv", - LY: "ly", - MA: "ma", - MC: "mc", - MD: "md", - ME: "me", - MF: "mf", - MG: "mg", - MH: "mh", - MK: "mk", - ML: "ml", - MM: "mm", - MN: "mn", - MO: "mo", - MP: "mp", - MQ: "mq", - MR: "mr", - MS: "ms", - MT: "mt", - MU: "mu", - MV: "mv", - MW: "mw", - MX: "mx", - MY: "my", - MZ: "mz", - NA: "na", - NC: "nc", - NE: "ne", - NF: "nf", - NG: "ng", - NI: "ni", - NL: "nl", - NO: "no", - NP: "np", - NR: "nr", - NU: "nu", - NZ: "nz", - OM: "om", - PA: "pa", - PE: "pe", - PF: "pf", - PG: "pg", - PH: "ph", - PK: "pk", - PL: "pl", - PM: "pm", - PN: "pn", - PR: "pr", - PS: "ps", - PT: "pt", - PW: "pw", - PY: "py", - QA: "qa", - RE: "re", - RO: "ro", - RS: "rs", - RU: "ru", - RW: "rw", - SA: "sa", - SB: "sb", - SC: "sc", - SD: "sd", - SE: "se", - SG: "sg", - SH: "sh", - SI: "si", - SJ: "sj", - SK: "sk", - SL: "sl", - SM: "sm", - SN: "sn", - SO: "so", - SR: "sr", - SS: "ss", - ST: "st", - SV: "sv", - SX: "sx", - SY: "sy", - SZ: "sz", - TC: "tc", - TD: "td", - TF: "tf", - TG: "tg", - TH: "th", - TJ: "tj", - TK: "tk", - TL: "tl", - TM: "tm", - TN: "tn", - TO: "to", - TR: "tr", - TT: "tt", - TV: "tv", - TW: "tw", - TZ: "tz", - UA: "ua", - UG: "ug", - UM: "um", - UNDEFINED: "undefined", - US: "us", - UY: "uy", - UZ: "uz", - VA: "va", - VC: "vc", - VE: "ve", - VG: "vg", - VI: "vi", - VN: "vn", - VU: "vu", - WF: "wf", - WS: "ws", - XK: "xk", - YE: "ye", - YT: "yt", - ZA: "za", - ZM: "zm", - ZW: "zw", -}; - -export const SIZES = { - SMALL: "small", - MEDIUM: "medium", -}; - -export const TOKENS = { - WIDTH: "width", - HEIGHT: "height", -}; diff --git a/packages/orbit-components/src/CountryFlag/consts.ts b/packages/orbit-components/src/CountryFlag/consts.ts new file mode 100644 index 0000000000..dcd6560d95 --- /dev/null +++ b/packages/orbit-components/src/CountryFlag/consts.ts @@ -0,0 +1,272 @@ +export const baseURL = "//images.kiwi.com"; + +export const CODES = { + AD: "ad", + AE: "ae", + AF: "af", + AG: "ag", + AI: "ai", + AL: "al", + AM: "am", + AN: "an", + ANYWHERE: "anywhere", + AO: "ao", + AQ: "aq", + AR: "ar", + AS: "as", + AT: "at", + AU: "au", + AW: "aw", + AX: "ax", + AZ: "az", + BA: "ba", + BB: "bb", + BD: "bd", + BE: "be", + BF: "bf", + BG: "bg", + BH: "bh", + BI: "bi", + BJ: "bj", + BL: "bl", + BM: "bm", + BN: "bn", + BO: "bo", + BQ: "bq", + BR: "br", + BS: "bs", + BT: "bt", + BV: "bv", + BW: "bw", + BY: "by", + BZ: "bz", + CA_FR: "ca-fr", + CA: "ca", + CC: "cc", + CD: "cd", + CF: "cf", + CG: "cg", + CH: "ch", + CI: "ci", + CK: "ck", + CL: "cl", + CM: "cm", + CN: "cn", + CO: "co", + CR: "cr", + CS: "cs", + CT: "ct", + CU: "cu", + CV: "cv", + CW: "cw", + CX: "cx", + CY: "cy", + CZ: "cz", + DE: "de", + DJ: "dj", + DK: "dk", + DM: "dm", + DO: "do", + DZ: "dz", + EC: "ec", + EE: "ee", + EG: "eg", + EH: "eh", + ER: "er", + ES: "es", + ET: "et", + EU: "eu", + FI: "fi", + FJ: "fj", + FK: "fk", + FM: "fm", + FO: "fo", + FR: "fr", + GA: "ga", + GB: "gb", + GD: "gd", + GE: "ge", + GF: "gf", + GG: "gg", + GH: "gh", + GI: "gi", + GL: "gl", + GM: "gm", + GN: "gn", + GP: "gp", + GQ: "gq", + GR: "gr", + GS: "gs", + GT: "gt", + GU: "gu", + GW: "gw", + GY: "gy", + HK: "hk", + HM: "hm", + HN: "hn", + HR: "hr", + HT: "ht", + HU: "hu", + IC: "ic", + ID: "id", + IE: "ie", + IL: "il", + IM: "im", + IN: "in", + IO: "io", + IQ: "iq", + IR: "ir", + IS: "is", + IT: "it", + JE: "je", + JM: "jm", + JO: "jo", + JP: "jp", + KE: "ke", + KG: "kg", + KH: "kh", + KI: "ki", + KM: "km", + KN: "kn", + KP: "kp", + KR: "kr", + KW: "kw", + KY: "ky", + KZ: "kz", + LA: "la", + LB: "lb", + LC: "lc", + LI: "li", + LK: "lk", + LR: "lr", + LS: "ls", + LT: "lt", + LU: "lu", + LV: "lv", + LY: "ly", + MA: "ma", + MC: "mc", + MD: "md", + ME: "me", + MF: "mf", + MG: "mg", + MH: "mh", + MK: "mk", + ML: "ml", + MM: "mm", + MN: "mn", + MO: "mo", + MP: "mp", + MQ: "mq", + MR: "mr", + MS: "ms", + MT: "mt", + MU: "mu", + MV: "mv", + MW: "mw", + MX: "mx", + MY: "my", + MZ: "mz", + NA: "na", + NC: "nc", + NE: "ne", + NF: "nf", + NG: "ng", + NI: "ni", + NL: "nl", + NO: "no", + NP: "np", + NR: "nr", + NU: "nu", + NZ: "nz", + OM: "om", + PA: "pa", + PE: "pe", + PF: "pf", + PG: "pg", + PH: "ph", + PK: "pk", + PL: "pl", + PM: "pm", + PN: "pn", + PR: "pr", + PS: "ps", + PT: "pt", + PW: "pw", + PY: "py", + QA: "qa", + RE: "re", + RO: "ro", + RS: "rs", + RU: "ru", + RW: "rw", + SA: "sa", + SB: "sb", + SC: "sc", + SD: "sd", + SE: "se", + SG: "sg", + SH: "sh", + SI: "si", + SJ: "sj", + SK: "sk", + SL: "sl", + SM: "sm", + SN: "sn", + SO: "so", + SR: "sr", + SS: "ss", + ST: "st", + SV: "sv", + SX: "sx", + SY: "sy", + SZ: "sz", + TC: "tc", + TD: "td", + TF: "tf", + TG: "tg", + TH: "th", + TJ: "tj", + TK: "tk", + TL: "tl", + TM: "tm", + TN: "tn", + TO: "to", + TR: "tr", + TT: "tt", + TV: "tv", + TW: "tw", + TZ: "tz", + UA: "ua", + UG: "ug", + UM: "um", + UNDEFINED: "undefined", + US: "us", + UY: "uy", + UZ: "uz", + VA: "va", + VC: "vc", + VE: "ve", + VG: "vg", + VI: "vi", + VN: "vn", + VU: "vu", + WF: "wf", + WS: "ws", + XK: "xk", + YE: "ye", + YT: "yt", + ZA: "za", + ZM: "zm", + ZW: "zw", +}; + +export enum SIZES { + SMALL = "small", + MEDIUM = "medium", +} + +export enum TOKENS { + WIDTH = "width", + HEIGHT = "height", +} diff --git a/packages/orbit-components/src/CountryFlag/index.d.ts b/packages/orbit-components/src/CountryFlag/index.d.ts deleted file mode 100644 index 86b87c60c0..0000000000 --- a/packages/orbit-components/src/CountryFlag/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly code?: string; - readonly name?: string; - readonly size?: "small" | "medium"; -} - -declare const CountryFlag: React.FunctionComponent; -export { CountryFlag, CountryFlag as default }; diff --git a/packages/orbit-components/src/CountryFlag/index.jsx.flow b/packages/orbit-components/src/CountryFlag/index.js.flow similarity index 100% rename from packages/orbit-components/src/CountryFlag/index.jsx.flow rename to packages/orbit-components/src/CountryFlag/index.js.flow diff --git a/packages/orbit-components/src/CountryFlag/index.jsx b/packages/orbit-components/src/CountryFlag/index.jsx deleted file mode 100644 index 39ea09a16e..0000000000 --- a/packages/orbit-components/src/CountryFlag/index.jsx +++ /dev/null @@ -1,106 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; -import { warning } from "@adeira/js"; -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import defaultTheme from "../defaultTheme"; -import { baseURL, CODES, SIZES, TOKENS } from "./consts"; - -import type { Props } from "."; - -const getSizeToken = name => ({ theme, size }) => { - const tokens = { - [TOKENS.WIDTH]: { - [SIZES.SMALL]: "16px", - [SIZES.MEDIUM]: theme.orbit.widthCountryFlag, - }, - [TOKENS.HEIGHT]: { - [SIZES.SMALL]: "9px", - [SIZES.MEDIUM]: "13px", - }, - }; - return tokens[name][size]; -}; - -const StyledCountryFlag = styled.div` - position: relative; - height: ${getSizeToken(TOKENS.HEIGHT)}; - width: ${getSizeToken(TOKENS.WIDTH)}; - background-color: ${({ theme }) => theme.orbit.backgroundCountryFlag}; - border-radius: ${({ theme }) => theme.orbit.borderRadiusSmall}; - overflow: hidden; - flex-shrink: 0; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCountryFlag.defaultProps = { - theme: defaultTheme, -}; - -export const StyledImage: any = styled.img.attrs(({ theme, size, code }) => { - const width = parseInt(getSizeToken(TOKENS.WIDTH)({ theme, size }), 10); - return { - src: `${baseURL}/flags/${width}x0/flag-${code.toLowerCase()}.jpg`, - srcSet: `${baseURL}/flags/${width * 2}x0/flag-${code.toLowerCase()}.jpg 2x`, - }; -})` - display: block; - height: 100%; - width: 100%; - flex-shrink: 0; -`; - -StyledImage.defaultProps = { - theme: defaultTheme, -}; - -const StyledShadow = styled.div` - position: absolute; - display: block; - height: 100%; - width: 100%; - top: 0; - right: 0; - bottom: 0; - left: 0; - // TODO: create token borderColorCountryFlag - // TODO: create token borderWidthCountryFlag - box-shadow: inset 0 0 0 1px ${({ theme }) => convertHexToRgba(theme.orbit.paletteInkDark, 10)}; - border-radius: ${({ theme }) => theme.orbit.borderRadiusSmall}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledShadow.defaultProps = { - theme: defaultTheme, -}; - -function getCountryProps(code?: string, name?: string): {| code: string, name?: string |} { - const codeNormalized = code ? code.toUpperCase().replace("-", "_") : "UNDEFINED"; - const countryCodeExists = codeNormalized in CODES; - - warning(countryCodeExists, "Country code not supported: %s", code); - const countryCode = countryCodeExists ? CODES[codeNormalized] : CODES.UNDEFINED; - const countryName = countryCode === CODES.UNDEFINED && !name ? "Undefined" : name; - return { code: countryCode, name: countryName }; -} - -const CountryFlag = ({ dataTest, size = SIZES.MEDIUM, id, ...props }: Props): React.Node => { - const { code, name } = getCountryProps(props.code, props.name); - return ( - - - - - ); -}; - -export default CountryFlag; diff --git a/packages/orbit-components/src/CountryFlag/index.tsx b/packages/orbit-components/src/CountryFlag/index.tsx new file mode 100644 index 0000000000..b8b2704229 --- /dev/null +++ b/packages/orbit-components/src/CountryFlag/index.tsx @@ -0,0 +1,104 @@ +import React from "react"; +import styled from "styled-components"; +import { warning } from "@adeira/js"; +import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; + +import defaultTheme, { Theme } from "../defaultTheme"; +import { baseURL, CODES, SIZES, TOKENS } from "./consts"; +import { Props, Size } from "./types"; + +const getSizeToken = (name: string) => ({ theme, size }: { theme: Theme; size: Size }) => { + const tokens = { + [TOKENS.WIDTH]: { + [SIZES.SMALL]: "16px", + [SIZES.MEDIUM]: theme.orbit.widthCountryFlag, + }, + [TOKENS.HEIGHT]: { + [SIZES.SMALL]: "9px", + [SIZES.MEDIUM]: "13px", + }, + }; + return tokens[name][size]; +}; + +const StyledCountryFlag = styled.div<{ size: Size }>` + position: relative; + height: ${getSizeToken(TOKENS.HEIGHT)}; + width: ${getSizeToken(TOKENS.WIDTH)}; + background-color: ${({ theme }) => theme.orbit.backgroundCountryFlag}; + border-radius: ${({ theme }) => theme.orbit.borderRadiusSmall}; + overflow: hidden; + flex-shrink: 0; +`; + +StyledCountryFlag.defaultProps = { + theme: defaultTheme, +}; + +export const StyledImage: any = styled.img.attrs<{ size: Size; code: string }>( + ({ theme, size, code }: { theme: Theme; size: Size; code: string }) => { + const width = parseInt(getSizeToken(TOKENS.WIDTH)({ theme, size }), 10); + return { + src: `${baseURL}/flags/${width}x0/flag-${code.toLowerCase()}.jpg`, + srcSet: `${baseURL}/flags/${width * 2}x0/flag-${code.toLowerCase()}.jpg 2x`, + }; + }, +)` + display: block; + height: 100%; + width: 100%; + flex-shrink: 0; +`; + +StyledImage.defaultProps = { + theme: defaultTheme, +}; + +const StyledShadow = styled.div` + position: absolute; + display: block; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + // TODO: create token borderColorCountryFlag + // TODO: create token borderWidthCountryFlag + box-shadow: inset 0 0 0 1px ${({ theme }) => convertHexToRgba(theme.orbit.paletteInkDark, 10)}; + border-radius: ${({ theme }) => theme.orbit.borderRadiusSmall}; +`; + +StyledShadow.defaultProps = { + theme: defaultTheme, +}; + +function getCountryProps(code?: string, name?: string) { + const codeNormalized = code ? code.toUpperCase().replace("-", "_") : "UNDEFINED"; + const countryCodeExists = codeNormalized in CODES; + + warning(countryCodeExists, "Country code not supported: %s", code); + const countryCode = countryCodeExists ? CODES[codeNormalized] : CODES.UNDEFINED; + const countryName = countryCode === CODES.UNDEFINED && !name ? "Undefined" : name; + return { code: countryCode, name: countryName }; +} + +const CountryFlag = ({ dataTest, size = SIZES.MEDIUM, id, ...props }: Props) => { + const { code, name } = getCountryProps(props.code, props.name); + return ( + + + + + ); +}; + +export default CountryFlag; diff --git a/packages/orbit-components/src/CountryFlag/types.ts b/packages/orbit-components/src/CountryFlag/types.ts new file mode 100644 index 0000000000..0759aff5a7 --- /dev/null +++ b/packages/orbit-components/src/CountryFlag/types.ts @@ -0,0 +1,12 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as Common from "../common/types"; + +export type Size = "small" | "medium"; + +export interface Props extends Common.Globals { + readonly code?: string; + readonly name?: string; + readonly size?: Size; +} diff --git a/packages/orbit-components/src/Coupon/Coupon.stories.jsx b/packages/orbit-components/src/Coupon/Coupon.stories.jsx deleted file mode 100644 index d88ed3680f..0000000000 --- a/packages/orbit-components/src/Coupon/Coupon.stories.jsx +++ /dev/null @@ -1,54 +0,0 @@ -// @flow -import * as React from "react"; -import { select, text } from "@storybook/addon-knobs"; - -import Text from "../Text"; -import List, { ListItem } from "../List"; -import { SIZES } from "../List/consts"; - -import Coupon from "."; - -export default { - title: "Coupon", -}; - -export const Default = (): React.Node => { - const content = text("content", "PROMOTIONCODE"); - const size = select("Size", Object.values(SIZES), SIZES.SMALL); - return ( - - - - Lorem ipsum dolor sit amet, consectetuer {content} elit. Proin pede - metus, vulputate nec, fermentum fringilla, vehicula vitae, justo. - - - - ); -}; - -Default.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; - -export const Playground = (): React.Node => { - const dataTest = text("dataTest", "test"); - const content = text("content", "CODE"); - - return ( - - Lorem ipsum dolor sit amet, consectetuer {content} elit. - Proin pede metus, vulputate nec, fermentum fringilla, vehicula vitae, justo. - - ); -}; - -Playground.story = { - parameters: { - info: - "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", - }, -}; diff --git a/packages/orbit-components/src/Coupon/Coupon.stories.tsx b/packages/orbit-components/src/Coupon/Coupon.stories.tsx new file mode 100644 index 0000000000..c354674828 --- /dev/null +++ b/packages/orbit-components/src/Coupon/Coupon.stories.tsx @@ -0,0 +1,53 @@ +import React from "react"; +import { select, text } from "@storybook/addon-knobs"; + +import Text from "../Text"; +import List, { ListItem } from "../List"; +import { SIZES } from "../List/consts"; + +import Coupon from "."; + +export default { + title: "Coupon", +}; + +export const Default = () => { + const content = text("content", "PROMOTIONCODE"); + const size = select("Size", Object.values(SIZES), SIZES.SMALL); + return ( + + + + Lorem ipsum dolor sit amet, consectetuer {content} elit. Proin pede + metus, vulputate nec, fermentum fringilla, vehicula vitae, justo. + + + + ); +}; + +Default.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; + +export const Playground = () => { + const dataTest = text("dataTest", "test"); + const content = text("content", "CODE"); + + return ( + + Lorem ipsum dolor sit amet, consectetuer {content} elit. + Proin pede metus, vulputate nec, fermentum fringilla, vehicula vitae, justo. + + ); +}; + +Playground.story = { + parameters: { + info: + "You can try all possible configurations of this component. However, check Orbit.Kiwi for more detailed design guidelines.", + }, +}; diff --git a/packages/orbit-components/src/Coupon/__tests__/index.test.jsx b/packages/orbit-components/src/Coupon/__tests__/index.test.jsx deleted file mode 100644 index 74aff83dc9..0000000000 --- a/packages/orbit-components/src/Coupon/__tests__/index.test.jsx +++ /dev/null @@ -1,13 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import Coupon from ".."; - -describe("Coupon", () => { - it("should have expected DOM output", () => { - render(code); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("code")).toBeInTheDocument(); - }); -}); diff --git a/packages/orbit-components/src/Coupon/__tests__/index.test.tsx b/packages/orbit-components/src/Coupon/__tests__/index.test.tsx new file mode 100644 index 0000000000..9a78b14a63 --- /dev/null +++ b/packages/orbit-components/src/Coupon/__tests__/index.test.tsx @@ -0,0 +1,12 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; + +import Coupon from ".."; + +describe("Coupon", () => { + it("should have expected DOM output", () => { + render(code); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("code")).toBeInTheDocument(); + }); +}); diff --git a/packages/orbit-components/src/Coupon/index.d.ts b/packages/orbit-components/src/Coupon/index.d.ts deleted file mode 100644 index 8bc495103f..0000000000 --- a/packages/orbit-components/src/Coupon/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly children: React.ReactNode; -} - -declare const Coupon: React.FunctionComponent; -export { Coupon, Coupon as default }; diff --git a/packages/orbit-components/src/Coupon/index.jsx.flow b/packages/orbit-components/src/Coupon/index.js.flow similarity index 100% rename from packages/orbit-components/src/Coupon/index.jsx.flow rename to packages/orbit-components/src/Coupon/index.js.flow diff --git a/packages/orbit-components/src/Coupon/index.jsx b/packages/orbit-components/src/Coupon/index.jsx deleted file mode 100644 index e563e27738..0000000000 --- a/packages/orbit-components/src/Coupon/index.jsx +++ /dev/null @@ -1,34 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import defaultTheme from "../defaultTheme"; - -import type { Props } from "."; - -const StyledCoupon = styled.mark` - display: inline; - background: none; - font-size: ${({ theme }) => theme.orbit.fontSizeTextSmall}; - letter-spacing: 0.75px; - text-transform: uppercase; - border: 1px dashed ${({ theme }) => theme.orbit.paletteCloudNormal}; - padding: 2px ${({ theme }) => theme.orbit.spaceXXSmall}; - line-height: inherit; - font-weight: ${({ theme }) => theme.orbit.fontWeightMedium}; - border-radius: ${({ theme }) => theme.orbit.borderRadiusNormal}; - color: ${({ theme }) => theme.orbit.paletteInkDark}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledCoupon.defaultProps = { - theme: defaultTheme, -}; - -const Coupon = ({ children, dataTest, id }: Props): React.Node => ( - - {children} - -); - -export default Coupon; diff --git a/packages/orbit-components/src/Coupon/index.tsx b/packages/orbit-components/src/Coupon/index.tsx new file mode 100644 index 0000000000..ce93c15e80 --- /dev/null +++ b/packages/orbit-components/src/Coupon/index.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import defaultTheme from "../defaultTheme"; +import { Props } from "./types"; + +const StyledCoupon = styled.mark` + ${({ theme }) => css` + display: inline; + background: none; + font-size: ${theme.orbit.fontSizeTextSmall}; + letter-spacing: 0.75px; + text-transform: uppercase; + border: 1px dashed ${theme.orbit.paletteCloudDarker}; + padding: 2px ${theme.orbit.spaceXXSmall}; + line-height: inherit; + font-weight: ${theme.orbit.fontWeightMedium}; + border-radius: ${theme.orbit.borderRadiusNormal}; + color: ${theme.orbit.paletteInkDark}; + `} +`; + +StyledCoupon.defaultProps = { + theme: defaultTheme, +}; + +const Coupon = ({ children, dataTest, id }: Props) => ( + + {children} + +); + +export default Coupon; diff --git a/packages/orbit-components/src/Coupon/types.ts b/packages/orbit-components/src/Coupon/types.ts new file mode 100644 index 0000000000..7fe780b5ee --- /dev/null +++ b/packages/orbit-components/src/Coupon/types.ts @@ -0,0 +1,10 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly children: React.ReactNode; +} diff --git a/packages/orbit-components/src/Desktop/Desktop.stories.jsx b/packages/orbit-components/src/Desktop/Desktop.stories.jsx deleted file mode 100644 index a52f75a489..0000000000 --- a/packages/orbit-components/src/Desktop/Desktop.stories.jsx +++ /dev/null @@ -1,35 +0,0 @@ -// @flow - -import * as React from "react"; -import styled from "styled-components"; - -import Desktop from "."; - -const Component = styled.div` - height: 150px; - width: 150px; - background: red; - color: #fff; - display: flex; - align-items: center; - direction: column; - justify-content: center; -`; - -export default { - title: "Desktop", -}; - -export const Default = (): React.Node => { - return ( - - Desktop - - ); -}; - -Default.story = { - parameters: { - info: "Visible only on mq.desktop and mq.largeDesktop.", - }, -}; diff --git a/packages/orbit-components/src/Desktop/Desktop.stories.tsx b/packages/orbit-components/src/Desktop/Desktop.stories.tsx new file mode 100644 index 0000000000..bfbabdeaa3 --- /dev/null +++ b/packages/orbit-components/src/Desktop/Desktop.stories.tsx @@ -0,0 +1,33 @@ +import * as React from "react"; +import styled from "styled-components"; + +import Desktop from "."; + +const Component = styled.div` + height: 150px; + width: 150px; + background: red; + color: #fff; + display: flex; + align-items: center; + direction: column; + justify-content: center; +`; + +export default { + title: "Desktop", +}; + +export const Default = () => { + return ( + + Desktop + + ); +}; + +Default.story = { + parameters: { + info: "Visible only on mq.desktop and mq.largeDesktop.", + }, +}; diff --git a/packages/orbit-components/src/Desktop/__tests__/index.test.jsx b/packages/orbit-components/src/Desktop/__tests__/index.test.jsx deleted file mode 100644 index 8334b8854e..0000000000 --- a/packages/orbit-components/src/Desktop/__tests__/index.test.jsx +++ /dev/null @@ -1,53 +0,0 @@ -// @flow strict - -import * as React from "react"; -import { render } from "@testing-library/react"; - -import Desktop from ".."; - -describe("Desktop", () => { - it("should output expected styles", () => { - const { container } = render(kek); - expect(container.firstChild).toMatchInlineSnapshot(` - .c0 { - display: none; - } - - @media (min-width:414px) { - .c0 { - display: none; - } - } - - @media (min-width:576px) { - .c0 { - display: none; - } - } - - @media (min-width:768px) { - .c0 { - display: none; - } - } - - @media (min-width:992px) { - .c0 { - display: inline-block; - } - } - - @media (min-width:1200px) { - .c0 { - display: inline-block; - } - } - -
- kek -
- `); - }); -}); diff --git a/packages/orbit-components/src/Desktop/__tests__/index.test.tsx b/packages/orbit-components/src/Desktop/__tests__/index.test.tsx new file mode 100644 index 0000000000..959407ec56 --- /dev/null +++ b/packages/orbit-components/src/Desktop/__tests__/index.test.tsx @@ -0,0 +1,52 @@ +import * as React from "react"; +import { render } from "@testing-library/react"; + +import Desktop from ".."; + +describe("Desktop", () => { + it("should output expected styles", () => { + const { container } = render(kek); + expect(container.firstChild).toMatchInlineSnapshot(` + .c0 { + display: none; + } + + @media (min-width:414px) { + .c0 { + display: none; + } + } + + @media (min-width:576px) { + .c0 { + display: none; + } + } + + @media (min-width:768px) { + .c0 { + display: none; + } + } + + @media (min-width:992px) { + .c0 { + display: inline-block; + } + } + + @media (min-width:1200px) { + .c0 { + display: inline-block; + } + } + +
+ kek +
+ `); + }); +}); diff --git a/packages/orbit-components/src/Desktop/index.d.ts b/packages/orbit-components/src/Desktop/index.d.ts deleted file mode 100644 index 7f72870f49..0000000000 --- a/packages/orbit-components/src/Desktop/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly children: React.ReactNode; -} - -declare const Desktop: React.FunctionComponent; -export { Desktop, Desktop as default }; diff --git a/packages/orbit-components/src/Desktop/index.jsx.flow b/packages/orbit-components/src/Desktop/index.js.flow similarity index 100% rename from packages/orbit-components/src/Desktop/index.jsx.flow rename to packages/orbit-components/src/Desktop/index.js.flow diff --git a/packages/orbit-components/src/Desktop/index.jsx b/packages/orbit-components/src/Desktop/index.jsx deleted file mode 100644 index 044c7798a7..0000000000 --- a/packages/orbit-components/src/Desktop/index.jsx +++ /dev/null @@ -1,12 +0,0 @@ -// @flow -import * as React from "react"; - -import Hide from "../Hide"; - -import type { Props } from "."; - -const Desktop = ({ children }: Props): React.Node => ( - {children} -); - -export default Desktop; diff --git a/packages/orbit-components/src/Desktop/index.tsx b/packages/orbit-components/src/Desktop/index.tsx new file mode 100644 index 0000000000..cda30c65cc --- /dev/null +++ b/packages/orbit-components/src/Desktop/index.tsx @@ -0,0 +1,10 @@ +import * as React from "react"; + +import Hide from "../Hide"; +import { Props } from "./types"; + +const Desktop = ({ children }: Props) => ( + {children} +); + +export default Desktop; diff --git a/packages/orbit-components/src/Desktop/types.ts b/packages/orbit-components/src/Desktop/types.ts new file mode 100644 index 0000000000..7fe780b5ee --- /dev/null +++ b/packages/orbit-components/src/Desktop/types.ts @@ -0,0 +1,10 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly children: React.ReactNode; +} diff --git a/packages/orbit-components/src/Dialog/Dialog.stories.jsx b/packages/orbit-components/src/Dialog/Dialog.stories.jsx deleted file mode 100644 index 30088361f1..0000000000 --- a/packages/orbit-components/src/Dialog/Dialog.stories.jsx +++ /dev/null @@ -1,63 +0,0 @@ -// @flow - -import * as React from "react"; -import { text, select, number } from "@storybook/addon-knobs"; -import { action } from "@storybook/addon-actions"; - -import Button from "../Button"; -import ButtonLink from "../ButtonLink"; -import Illustration from "../Illustration"; -import { NAMES } from "../Illustration/consts"; - -import Dialog from "."; - -export default { - title: "Dialog", -}; - -export const Default = (): React.Node => { - const title = text("title", "Log out"); - const description = text("description", "Are you sure you want to log out now?"); - const dataTest = text("dataTest", "test"); - return ( - Log out} - /> - ); -}; - -Default.story = { - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Playground = (): React.Node => { - const title = text("title", "Log out"); - const description = text("description", "Are you sure you want to log out now?"); - const illustration = select("illustration", NAMES, "NoNotification"); - const dataTest = text("dataTest", "test"); - const maxWidth = number("maxWidth", undefined); - - return ( - } - dataTest={dataTest} - onClose={action("onClose")} - primaryAction={} - secondaryAction={Cancel} - /> - ); -}; - -Playground.story = { - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; diff --git a/packages/orbit-components/src/Dialog/Dialog.stories.tsx b/packages/orbit-components/src/Dialog/Dialog.stories.tsx new file mode 100644 index 0000000000..b4030b0a3b --- /dev/null +++ b/packages/orbit-components/src/Dialog/Dialog.stories.tsx @@ -0,0 +1,62 @@ +import * as React from "react"; +import { text, select, number } from "@storybook/addon-knobs"; +import { action } from "@storybook/addon-actions"; + +import Button from "../Button"; +import ButtonLink from "../ButtonLink"; +import Illustration from "../Illustration"; +// @ts-expect-error currently can't resolve properly mts +import { NAMES } from "../Illustration/consts.mts"; + +import Dialog from "."; + +export default { + title: "Dialog", +}; + +export const Default = () => { + const title = text("title", "Log out"); + const description = text("description", "Are you sure you want to log out now?"); + const dataTest = text("dataTest", "test"); + return ( + Log out} + /> + ); +}; + +Default.story = { + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Playground = () => { + const title = text("title", "Log out"); + const description = text("description", "Are you sure you want to log out now?"); + const illustration = select("illustration", NAMES, "NoNotification"); + const dataTest = text("dataTest", "test"); + const maxWidth = number("maxWidth", NaN); + + return ( + } + dataTest={dataTest} + onClose={action("onClose")} + primaryAction={} + secondaryAction={Cancel} + /> + ); +}; + +Playground.story = { + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; diff --git a/packages/orbit-components/src/Dialog/__tests__/index.test.jsx b/packages/orbit-components/src/Dialog/__tests__/index.test.jsx deleted file mode 100644 index 0291af0e3b..0000000000 --- a/packages/orbit-components/src/Dialog/__tests__/index.test.jsx +++ /dev/null @@ -1,25 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen } from "@testing-library/react"; - -import Dialog from ".."; -import Button from "../../Button"; - -describe("Dialog", () => { - it("should have expected DOM output", () => { - render( - Log out} - secondaryAction={} - />, - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("Logging out")).toBeInTheDocument(); - expect(screen.getByText("Are you sure you want to log out now?")).toBeInTheDocument(); - expect(screen.getByRole("button", { name: "Log out" })); - expect(screen.getByRole("button", { name: "Close" })); - }); -}); diff --git a/packages/orbit-components/src/Dialog/__tests__/index.test.tsx b/packages/orbit-components/src/Dialog/__tests__/index.test.tsx new file mode 100644 index 0000000000..4c9ad02fcd --- /dev/null +++ b/packages/orbit-components/src/Dialog/__tests__/index.test.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { render, screen } from "@testing-library/react"; + +import Dialog from ".."; +import Button from "../../Button"; + +describe("Dialog", () => { + it("should have expected DOM output", () => { + render( + Log out} + secondaryAction={} + />, + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("Logging out")).toBeInTheDocument(); + expect(screen.getByText("Are you sure you want to log out now?")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Log out" })); + expect(screen.getByRole("button", { name: "Close" })); + }); +}); diff --git a/packages/orbit-components/src/Dialog/index.d.ts b/packages/orbit-components/src/Dialog/index.d.ts deleted file mode 100644 index f390539a3b..0000000000 --- a/packages/orbit-components/src/Dialog/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -export interface Props extends Common.Global { - readonly title: React.ReactNode; - readonly description?: React.ReactNode; - readonly renderInPortal?: boolean; - readonly maxWidth?: number; - readonly illustration?: React.ReactNode; - readonly primaryAction: React.ReactNode; - readonly secondaryAction?: React.ReactNode; - readonly lockScrolling?: boolean; - readonly onClose?: Common.Callback; -} - -declare const Dialog: React.FunctionComponent; -export { Dialog, Dialog as default }; diff --git a/packages/orbit-components/src/Dialog/index.jsx.flow b/packages/orbit-components/src/Dialog/index.js.flow similarity index 100% rename from packages/orbit-components/src/Dialog/index.jsx.flow rename to packages/orbit-components/src/Dialog/index.js.flow diff --git a/packages/orbit-components/src/Dialog/index.jsx b/packages/orbit-components/src/Dialog/index.jsx deleted file mode 100644 index daa2a26521..0000000000 --- a/packages/orbit-components/src/Dialog/index.jsx +++ /dev/null @@ -1,207 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; - -import useFocusTrap from "../hooks/useFocusTrap"; -import Portal from "../Portal"; -import useTheme from "../hooks/useTheme"; -import defaultTheme from "../defaultTheme"; -import Heading from "../Heading"; -import Text, { StyledText } from "../Text"; -import Stack from "../Stack"; -import useLockScrolling from "../hooks/useLockScrolling"; -import mq from "../utils/mediaQuery"; -import { StyledButtonPrimitive } from "../primitives/ButtonPrimitive"; -import KEY_CODE_MAP from "../common/keyMaps"; -import useRandomId from "../hooks/useRandomId"; -import { left } from "../utils/rtl"; - -import type { Props } from "."; - -const StyledDialog = styled.div` - ${({ theme }) => css` - font-family: ${theme.orbit.fontFamily}; - width: 100%; - height: 100%; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - padding: ${theme.orbit.spaceMedium}; - z-index: ${theme.orbit.zIndexModalOverlay}; - box-sizing: border-box; - outline: none; - overflow-x: hidden; - background-color: rgba(0, 0, 0, 0.5); - transition: opacity ${theme.orbit.durationFast} ease-in-out; - ${mq.largeMobile(css` - opacity: 1; - display: flex; - justify-content: center; - align-items: center; - `)}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledDialog.defaultProps = { - theme: defaultTheme, -}; - -const StyledDialogCenterWrapper = styled.div` - display: flex; - align-items: center; - min-height: 100%; -`; - -const StyledDialogContent = styled.div` - ${({ theme, $maxWidth }) => css` - display: block; - width: 100%; - max-width: ${$maxWidth}px; - box-sizing: border-box; - padding: ${`${theme.orbit.spaceLarge} ${theme.orbit.spaceMedium} ${theme.orbit.spaceMedium}`}; - background: ${theme.orbit.paletteWhite}; - border-radius: 12px; - bottom: ${({ shown }) => (shown ? "0" : "-100%")}; - box-shadow: ${theme.orbit.boxShadowOverlay}; - text-align: center; - ${StyledText} { - text-align: center; - } - ${mq.largeMobile(css` - min-width: ${theme.orbit.widthModalSmall}; - border-radius: 9px; - padding: ${theme.orbit.spaceLarge}; - text-align: ${left}; - ${StyledText} { - text-align: ${left}; - } - `)}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledDialogContent.defaultProps = { - theme: defaultTheme, -}; - -const StyledAction = styled(({ width, theme, ...props }) =>
)` - width: 100%; - ${StyledButtonPrimitive} { - width: 100%; - flex: 1 1 auto; - } - ${mq.largeMobile( - css` - width: auto; - ${StyledButtonPrimitive} { - width: auto; - flex: 0 0 auto; - } - `, - )}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledAction.defaultProps = { - theme: defaultTheme, -}; - -const IllustrationContainer = styled.div` - margin-bottom: 16px; -`; - -const Dialog = ({ - dataTest, - id, - title, - description, - primaryAction, - secondaryAction, - onClose, - maxWidth, - renderInPortal = true, - illustration, - lockScrolling = true, -}: Props): React.Node => { - const wrapperRef = React.useRef(null); - useLockScrolling(wrapperRef, lockScrolling); - const ref = React.useRef(null); - const theme = useTheme(); - const transitionLength = React.useMemo(() => parseFloat(theme.orbit.durationFast) * 1000, [ - theme.orbit.durationFast, - ]); - const [shown, setShown] = React.useState(false); - - useFocusTrap(ref); - - React.useEffect(() => { - const timer = setTimeout(() => { - setShown(true); - if (ref.current) { - ref.current.focus(); - } - }, transitionLength); - return () => clearTimeout(timer); - }, [transitionLength]); - - const handleClose = ev => { - if (ref.current && onClose) { - if (ref.current && !ref.current.contains(ev.target)) onClose(); - } - }; - - React.useEffect(() => { - const handleKeyDown = ev => { - if (ev.keyCode === KEY_CODE_MAP.ESC && onClose) { - onClose(); - } - }; - window.addEventListener("keydown", handleKeyDown); - return () => window.removeEventListener("keydown", handleKeyDown); - }, [onClose]); - - const dialogID = useRandomId(); - - const dialog = ( - - - - {illustration && {illustration}} - - {title && ( - - {title} - - )} - {description && {description}} - - - {secondaryAction && {secondaryAction}} - {primaryAction} - - - - - ); - - return renderInPortal ? {dialog} : dialog; -}; - -export default Dialog; diff --git a/packages/orbit-components/src/Dialog/index.tsx b/packages/orbit-components/src/Dialog/index.tsx new file mode 100644 index 0000000000..85072b08f6 --- /dev/null +++ b/packages/orbit-components/src/Dialog/index.tsx @@ -0,0 +1,203 @@ +import * as React from "react"; +import styled, { css } from "styled-components"; + +import useFocusTrap from "../hooks/useFocusTrap"; +import Portal from "../Portal"; +import useTheme from "../hooks/useTheme"; +import defaultTheme from "../defaultTheme"; +import Heading from "../Heading"; +import Text, { StyledText } from "../Text"; +import Stack from "../Stack"; +import useLockScrolling from "../hooks/useLockScrolling"; +import mq from "../utils/mediaQuery"; +import { StyledButtonPrimitive } from "../primitives/ButtonPrimitive"; +import KEY_CODE_MAP from "../common/keyMaps"; +import useRandomId from "../hooks/useRandomId"; +import { left } from "../utils/rtl"; +import { Props } from "./types"; + +const StyledDialog = styled.div` + ${({ theme }) => css` + font-family: ${theme.orbit.fontFamily}; + width: 100%; + height: 100%; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: ${theme.orbit.spaceMedium}; + z-index: ${theme.orbit.zIndexModalOverlay}; + box-sizing: border-box; + outline: none; + overflow-x: hidden; + background-color: rgba(0, 0, 0, 0.5); + transition: opacity ${theme.orbit.durationFast} ease-in-out; + ${mq.largeMobile(css` + opacity: 1; + display: flex; + justify-content: center; + align-items: center; + `)}; + `} +`; + +StyledDialog.defaultProps = { + theme: defaultTheme, +}; + +const StyledDialogCenterWrapper = styled.div` + display: flex; + align-items: center; + min-height: 100%; +`; + +const StyledDialogContent = styled.div<{ $maxWidth?: number; shown?: boolean }>` + ${({ theme, $maxWidth, shown }) => css` + display: block; + width: 100%; + max-width: ${$maxWidth}px; + box-sizing: border-box; + padding: ${`${theme.orbit.spaceLarge} ${theme.orbit.spaceMedium} ${theme.orbit.spaceMedium}`}; + background: ${theme.orbit.paletteWhite}; + border-radius: 12px; + bottom: ${shown ? "0" : "-100%"}; + box-shadow: ${theme.orbit.boxShadowOverlay}; + text-align: center; + ${StyledText} { + text-align: center; + } + ${mq.largeMobile(css` + min-width: ${theme.orbit.widthModalSmall}; + border-radius: 9px; + padding: ${theme.orbit.spaceLarge}; + text-align: ${left}; + ${StyledText} { + text-align: ${left}; + } + `)}; + `} +`; + +StyledDialogContent.defaultProps = { + theme: defaultTheme, +}; + +const StyledAction = styled.div` + width: 100%; + + ${StyledButtonPrimitive} { + width: 100%; + flex: 1 1 auto; + } + + ${mq.largeMobile( + css` + width: auto; + ${StyledButtonPrimitive} { + width: auto; + flex: 0 0 auto; + } + `, + )}; +`; + +StyledAction.defaultProps = { + theme: defaultTheme, +}; + +const IllustrationContainer = styled.div` + margin-bottom: 16px; +`; + +const Dialog = ({ + dataTest, + id, + title, + description, + primaryAction, + secondaryAction, + onClose, + maxWidth, + renderInPortal = true, + illustration, + lockScrolling = true, +}: Props) => { + const wrapperRef = React.useRef(null); + useLockScrolling(wrapperRef, lockScrolling); + const ref = React.useRef(null); + const theme = useTheme(); + const transitionLength = React.useMemo(() => parseFloat(theme.orbit.durationFast) * 1000, [ + theme.orbit.durationFast, + ]); + const [shown, setShown] = React.useState(false); + + useFocusTrap(ref); + + React.useEffect(() => { + const timer = setTimeout(() => { + setShown(true); + if (ref.current) { + ref.current.focus(); + } + }, transitionLength); + return () => clearTimeout(timer); + }, [transitionLength]); + + const handleClose = (ev: React.MouseEvent) => { + if (ref.current && onClose) { + if (ref.current && !ref.current.contains(ev.currentTarget)) onClose(); + } + }; + + React.useEffect(() => { + const handleKeyDown = ev => { + if (ev.keyCode === KEY_CODE_MAP.ESC && onClose) { + onClose(); + } + }; + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, [onClose]); + + const dialogID = useRandomId(); + + const dialog = ( + + + + {illustration && {illustration}} + + {title && ( + + {title} + + )} + {description && {description}} + + + {secondaryAction && {secondaryAction}} + {primaryAction} + + + + + ); + + return renderInPortal ? {dialog} : dialog; +}; + +export default Dialog; diff --git a/packages/orbit-components/src/Dialog/types.ts b/packages/orbit-components/src/Dialog/types.ts new file mode 100644 index 0000000000..775293b4d3 --- /dev/null +++ b/packages/orbit-components/src/Dialog/types.ts @@ -0,0 +1,18 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +import * as Common from "../common/types"; + +export interface Props extends Common.Globals { + readonly title: React.ReactNode; + readonly description?: React.ReactNode; + readonly renderInPortal?: boolean; + readonly maxWidth?: number; + readonly illustration?: React.ReactNode; + readonly primaryAction: React.ReactNode; + readonly secondaryAction?: React.ReactNode; + readonly lockScrolling?: boolean; + readonly onClose?: Common.Callback; +} diff --git a/packages/orbit-components/src/Dictionary/DictionaryContext.js b/packages/orbit-components/src/Dictionary/DictionaryContext.js deleted file mode 100644 index 5bbfbaf8fd..0000000000 --- a/packages/orbit-components/src/Dictionary/DictionaryContext.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import * as React from "react"; - -import type { DictionaryContextType } from "./DictionaryContext"; - -const DictionaryContext: DictionaryContextType = React.createContext({}); -DictionaryContext.displayName = "DictionaryOrbitContext"; - -export default DictionaryContext; diff --git a/packages/orbit-components/src/Dictionary/DictionaryContext.js.flow b/packages/orbit-components/src/Dictionary/DictionaryContext.js.flow deleted file mode 100644 index 9880ba1c74..0000000000 --- a/packages/orbit-components/src/Dictionary/DictionaryContext.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -import * as React from "react"; - -import type { Translations } from "."; - -export type DictionaryContextType = React.Context; - -declare export default DictionaryContextType; diff --git a/packages/orbit-components/src/Dictionary/DictionaryContext.ts b/packages/orbit-components/src/Dictionary/DictionaryContext.ts new file mode 100644 index 0000000000..7c40ab7e85 --- /dev/null +++ b/packages/orbit-components/src/Dictionary/DictionaryContext.ts @@ -0,0 +1,8 @@ +import * as React from "react"; + +import { Translations } from "./types"; + +const DictionaryContext = React.createContext({}); +DictionaryContext.displayName = "DictionaryOrbitContext"; + +export default DictionaryContext; diff --git a/packages/orbit-components/src/Dictionary/index.d.ts b/packages/orbit-components/src/Dictionary/index.d.ts deleted file mode 100644 index 258bc1da5e..0000000000 --- a/packages/orbit-components/src/Dictionary/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -export type Translations = { - [key: string]: string; -}; - -export interface Props { - readonly values: Translations; - readonly children: React.ReactNode; -} - -declare const Dictionary: React.FunctionComponent; -export { Dictionary, Dictionary as default }; diff --git a/packages/orbit-components/src/Dictionary/index.jsx.flow b/packages/orbit-components/src/Dictionary/index.js.flow similarity index 100% rename from packages/orbit-components/src/Dictionary/index.jsx.flow rename to packages/orbit-components/src/Dictionary/index.js.flow diff --git a/packages/orbit-components/src/Dictionary/index.jsx b/packages/orbit-components/src/Dictionary/index.jsx deleted file mode 100644 index babe3b595b..0000000000 --- a/packages/orbit-components/src/Dictionary/index.jsx +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import * as React from "react"; - -import { pureTranslate } from "../Translate"; -import DictionaryContext from "./DictionaryContext"; - -import type { Props } from "."; - -const Dictionary = ({ values, children }: Props): React.Node => ( - {children} -); - -export function withDictionary(Component: React.ComponentType): (props: any) => React.Node { - return function DictionaryComponent(props: any) { - return ( - - {dictionary => ( - pureTranslate(dictionary, tKey, values)} - /> - )} - - ); - }; -} - -export default Dictionary; diff --git a/packages/orbit-components/src/Dictionary/index.tsx b/packages/orbit-components/src/Dictionary/index.tsx new file mode 100644 index 0000000000..719c80532a --- /dev/null +++ b/packages/orbit-components/src/Dictionary/index.tsx @@ -0,0 +1,26 @@ +import * as React from "react"; + +import { pureTranslate } from "../Translate"; +import DictionaryContext from "./DictionaryContext"; +import { Props } from "./types"; + +const Dictionary = ({ values, children }: Props) => ( + {children} +); + +export function withDictionary(Component: React.ComponentType) { + return function DictionaryComponent(props: any) { + return ( + + {dictionary => ( + pureTranslate(dictionary, tKey, values)} + /> + )} + + ); + }; +} + +export default Dictionary; diff --git a/packages/orbit-components/src/Dictionary/types.ts b/packages/orbit-components/src/Dictionary/types.ts new file mode 100644 index 0000000000..b7553245db --- /dev/null +++ b/packages/orbit-components/src/Dictionary/types.ts @@ -0,0 +1,11 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as React from "react"; + +export type Translations = Record; + +export interface Props { + readonly values: Translations; + readonly children: React.ReactNode; +} diff --git a/packages/orbit-components/src/Drawer/Drawer.stories.jsx b/packages/orbit-components/src/Drawer/Drawer.stories.jsx deleted file mode 100644 index 14662b1d91..0000000000 --- a/packages/orbit-components/src/Drawer/Drawer.stories.jsx +++ /dev/null @@ -1,471 +0,0 @@ -// @flow -import * as React from "react"; -import { action } from "@storybook/addon-actions"; -import { boolean, text, select } from "@storybook/addon-knobs"; - -import Stack from "../Stack"; -import Heading from "../Heading"; -import Button from "../Button"; -import Text from "../Text"; -import TextLink from "../TextLink"; -import Separator from "../Separator"; -import Illustration from "../Illustration"; -import NewWindow from "../icons/NewWindow"; -import RenderInRtl from "../utils/rtl/RenderInRtl"; -import POSITIONS from "./consts"; -import InputField from "../InputField"; -import Search from "../icons/Search"; -import Tile from "../Tile"; -import Collapse from "../Collapse"; -import LinkList from "../LinkList"; - -import Drawer from "."; - -export default { - title: "Drawer", -}; - -export const SideNavigation = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const width = text("width", "320px"); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - } - > - - - Refer a Friend - Subscribe to newsletter - Kiwi.com Stories - - - - - Terms & Conditions - Terms of Use - Privacy Policy - Security - Cookies settings - - - - - About Kiwi.com - Careers - Care Kiwi.com - Code Kiwi.com - Kiwi.com Guarantee - Press kit - - - - Sign out - - - ); -}; - -SideNavigation.story = { - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SmartFaq = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); - const width = text("width", "480px"); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - Need help? - We are here for you. First, let is narrow down your request. - - - - - } type="secondary"> - Full FAQ site - - - - - ); -}; - -SmartFaq.story = { - name: "SmartFAQ", - - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const Suppressed = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); - const width = text("width", "480px"); - const suppressed = boolean("suppressed", true); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - - - - - - - - ); -}; - -Suppressed.story = { - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const WithTitle = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const title = text("Title", "Title"); - const width = text("width", "320px"); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - Refer a Friend - Subscribe to newsletter - Kiwi.com Stories - - - - - Terms & Conditions - Terms of Use - Privacy Policy - Security - Cookies settings - - - - - About Kiwi.com - Careers - Care Kiwi.com - Code Kiwi.com - Kiwi.com Guarantee - Press kit - - - - Sign out - - - ); -}; - -WithTitle.story = { - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SmartFaqSearch = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); - const width = text("width", "480px"); - const suppressed = boolean("suppressed", true); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - Sign In - - } - > - - } /> - - - - - - - - - ); -}; - -SmartFaqSearch.story = { - name: "SmartFAQ Search", - - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SideNavigationInRtl = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const width = text("width", "320px"); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - - } - > - - - Refer a Friend - Subscribe to newsletter - Kiwi.com Stories - - - - - Terms & Conditions - Terms of Use - Privacy Policy - Security - Cookies settings - - - - - About Kiwi.com - Careers - Care Kiwi.com - Code Kiwi.com - Kiwi.com Guarantee - Press kit - - - - Sign out - - - - ); -}; - -SideNavigationInRtl.story = { - name: "Side Navigation in RTL", - - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SmartFaqInRtl = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); - const width = text("width", "480px"); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - - - Need help? - We are here for you. First, let is narrow down your request. - - - - - } type="secondary"> - Full FAQ site - - - - - - ); -}; - -SmartFaqInRtl.story = { - name: "SmartFAQ in RTL", - - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; - -export const SmartFaqSearchInRtl = (): React.Node => { - const shown = boolean("shown", true); - const dataTest = text("dataTest", "test"); - const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); - const width = text("width", "480px"); - const suppressed = boolean("suppressed", true); - const fixedHeader = boolean("fixedHeader", false); - - return ( - - - Sign In - - } - > - - } /> - - - - - - - - - - ); -}; - -SmartFaqSearchInRtl.story = { - name: "SmartFAQ Search in RTL", - - parameters: { - info: "Visit Orbit.Kiwi for more detailed guidelines.", - }, -}; diff --git a/packages/orbit-components/src/Drawer/Drawer.stories.tsx b/packages/orbit-components/src/Drawer/Drawer.stories.tsx new file mode 100644 index 0000000000..e60839323e --- /dev/null +++ b/packages/orbit-components/src/Drawer/Drawer.stories.tsx @@ -0,0 +1,470 @@ +import * as React from "react"; +import { action } from "@storybook/addon-actions"; +import { boolean, text, select } from "@storybook/addon-knobs"; + +import Stack from "../Stack"; +import Heading from "../Heading"; +import Button from "../Button"; +import Text from "../Text"; +import TextLink from "../TextLink"; +import Separator from "../Separator"; +import Illustration from "../Illustration"; +import NewWindow from "../icons/NewWindow"; +import RenderInRtl from "../utils/rtl/RenderInRtl"; +import POSITIONS from "./consts"; +import InputField from "../InputField"; +import Search from "../icons/Search"; +import Tile from "../Tile"; +import Collapse from "../Collapse"; +import LinkList from "../LinkList"; + +import Drawer from "."; + +export default { + title: "Drawer", +}; + +export const SideNavigation = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const width = text("width", "320px"); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + } + > + + + Refer a Friend + Subscribe to newsletter + Kiwi.com Stories + + + + + Terms & Conditions + Terms of Use + Privacy Policy + Security + Cookies settings + + + + + About Kiwi.com + Careers + Care Kiwi.com + Code Kiwi.com + Kiwi.com Guarantee + Press kit + + + + Sign out + + + ); +}; + +SideNavigation.story = { + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SmartFaq = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); + const width = text("width", "480px"); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + Need help? + We are here for you. First, let is narrow down your request. + + + + + } type="secondary"> + Full FAQ site + + + + + ); +}; + +SmartFaq.story = { + name: "SmartFAQ", + + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const Suppressed = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); + const width = text("width", "480px"); + const suppressed = boolean("suppressed", true); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + + + + + + + + ); +}; + +Suppressed.story = { + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const WithTitle = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const title = text("Title", "Title"); + const width = text("width", "320px"); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + Refer a Friend + Subscribe to newsletter + Kiwi.com Stories + + + + + Terms & Conditions + Terms of Use + Privacy Policy + Security + Cookies settings + + + + + About Kiwi.com + Careers + Care Kiwi.com + Code Kiwi.com + Kiwi.com Guarantee + Press kit + + + + Sign out + + + ); +}; + +WithTitle.story = { + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SmartFaqSearch = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); + const width = text("width", "480px"); + const suppressed = boolean("suppressed", true); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + Sign In + + } + > + + } /> + + + + + + + + + ); +}; + +SmartFaqSearch.story = { + name: "SmartFAQ Search", + + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SideNavigationInRtl = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const width = text("width", "320px"); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + + } + > + + + Refer a Friend + Subscribe to newsletter + Kiwi.com Stories + + + + + Terms & Conditions + Terms of Use + Privacy Policy + Security + Cookies settings + + + + + About Kiwi.com + Careers + Care Kiwi.com + Code Kiwi.com + Kiwi.com Guarantee + Press kit + + + + Sign out + + + + ); +}; + +SideNavigationInRtl.story = { + name: "Side Navigation in RTL", + + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SmartFaqInRtl = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); + const width = text("width", "480px"); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + + + Need help? + We are here for you. First, let is narrow down your request. + + + + + } type="secondary"> + Full FAQ site + + + + + + ); +}; + +SmartFaqInRtl.story = { + name: "SmartFAQ in RTL", + + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; + +export const SmartFaqSearchInRtl = () => { + const shown = boolean("shown", true); + const dataTest = text("dataTest", "test"); + const position = select("position", Object.values(POSITIONS), POSITIONS.RIGHT); + const width = text("width", "480px"); + const suppressed = boolean("suppressed", true); + const fixedHeader = boolean("fixedHeader", false); + + return ( + + + Sign In + + } + > + + } /> + + + + + + + + + + ); +}; + +SmartFaqSearchInRtl.story = { + name: "SmartFAQ Search in RTL", + + parameters: { + info: "Visit Orbit.Kiwi for more detailed guidelines.", + }, +}; diff --git a/packages/orbit-components/src/Drawer/__tests__/index.test.jsx b/packages/orbit-components/src/Drawer/__tests__/index.test.jsx deleted file mode 100644 index 0470861196..0000000000 --- a/packages/orbit-components/src/Drawer/__tests__/index.test.jsx +++ /dev/null @@ -1,53 +0,0 @@ -// @flow -import * as React from "react"; -import { render, screen, act } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; - -import Drawer from ".."; - -jest.useFakeTimers("modern"); - -describe("Drawer", () => { - it("should have expected DOM output", () => { - render( - - content - , - ); - expect(screen.getByTestId("test")).toBeInTheDocument(); - expect(screen.getByText("content")); - }); - it("should be able to toggle visibility", () => { - const { rerender } = render(content); - expect(screen.getByText("content")).not.toBeVisible(); - rerender(content); - expect(screen.getByText("content")).toBeVisible(); - rerender(content); - act(() => { - jest.runOnlyPendingTimers(); - }); - expect(screen.getByText("content")).not.toBeVisible(); - }); - it("should trigger close handler when clicked on close button", () => { - const onClose = jest.fn(); - render( - - content - , - ); - userEvent.click(screen.getByRole("button", { name: "Hide" })); - expect(onClose).toHaveBeenCalled(); - }); - it("should trigger close handler when clicked on backdrop", () => { - const onClose = jest.fn(); - render( - -
- , - ); - userEvent.click(screen.getByTestId("content")); - expect(onClose).not.toHaveBeenCalled(); - userEvent.click(screen.getByTestId("container")); - expect(onClose).toHaveBeenCalled(); - }); -}); diff --git a/packages/orbit-components/src/Drawer/__tests__/index.test.tsx b/packages/orbit-components/src/Drawer/__tests__/index.test.tsx new file mode 100644 index 0000000000..f982d4776b --- /dev/null +++ b/packages/orbit-components/src/Drawer/__tests__/index.test.tsx @@ -0,0 +1,52 @@ +import * as React from "react"; +import { render, screen, act } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +import Drawer from ".."; + +jest.useFakeTimers("modern"); + +describe("Drawer", () => { + it("should have expected DOM output", () => { + render( + + content + , + ); + expect(screen.getByTestId("test")).toBeInTheDocument(); + expect(screen.getByText("content")); + }); + it("should be able to toggle visibility", () => { + const { rerender } = render(content); + expect(screen.getByText("content")).not.toBeVisible(); + rerender(content); + expect(screen.getByText("content")).toBeVisible(); + rerender(content); + act(() => { + jest.runOnlyPendingTimers(); + }); + expect(screen.getByText("content")).not.toBeVisible(); + }); + it("should trigger close handler when clicked on close button", () => { + const onClose = jest.fn(); + render( + + content + , + ); + userEvent.click(screen.getByRole("button", { name: "Hide" })); + expect(onClose).toHaveBeenCalled(); + }); + it("should trigger close handler when clicked on backdrop", () => { + const onClose = jest.fn(); + render( + +
+ , + ); + userEvent.click(screen.getByTestId("content")); + expect(onClose).not.toHaveBeenCalled(); + userEvent.click(screen.getByTestId("container")); + expect(onClose).toHaveBeenCalled(); + }); +}); diff --git a/packages/orbit-components/src/Drawer/components/DrawerClose.d.ts b/packages/orbit-components/src/Drawer/components/DrawerClose.d.ts deleted file mode 100644 index 7b41372df4..0000000000 --- a/packages/orbit-components/src/Drawer/components/DrawerClose.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../../common/common"; - -export interface Props { - readonly onClick?: Common.Callback; -} - -declare const DrawerClose: React.ForwardRefRenderFunction; -export { DrawerClose, DrawerClose as default }; diff --git a/packages/orbit-components/src/Drawer/components/DrawerClose.jsx b/packages/orbit-components/src/Drawer/components/DrawerClose.jsx deleted file mode 100644 index 9b6e7c84cd..0000000000 --- a/packages/orbit-components/src/Drawer/components/DrawerClose.jsx +++ /dev/null @@ -1,39 +0,0 @@ -// @flow -import * as React from "react"; -import styled from "styled-components"; - -import ButtonLink from "../../ButtonLink"; -import Close from "../../icons/Close"; -import type { Props } from "./DrawerClose"; -import defaultTheme from "../../defaultTheme"; -import { left } from "../../utils/rtl"; -import useTranslate from "../../hooks/useTranslate"; - -const StyledDrawerClose = styled.div` - margin-${left}: ${({ theme }) => theme.orbit.spaceMedium}; -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledDrawerClose.defaultProps = { - theme: defaultTheme, -}; - -const DrawerClose: React.AbstractComponent = React.forwardRef( - ({ onClick }, ref): React.Node => { - const translate = useTranslate(); - - return ( - - } - ref={ref} - type="secondary" - title={translate("drawer_hide")} - /> - - ); - }, -); - -export default DrawerClose; diff --git a/packages/orbit-components/src/Drawer/components/DrawerClose.jsx.flow b/packages/orbit-components/src/Drawer/components/DrawerClose.jsx.flow deleted file mode 100644 index d9c26e0521..0000000000 --- a/packages/orbit-components/src/Drawer/components/DrawerClose.jsx.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -import * as React from "react"; - -import type { OnClose } from ".."; - -export type Props = {| +onClick?: OnClose |}; - -declare export default React.AbstractComponent; diff --git a/packages/orbit-components/src/Drawer/components/DrawerClose.tsx b/packages/orbit-components/src/Drawer/components/DrawerClose.tsx new file mode 100644 index 0000000000..1ee7def9dd --- /dev/null +++ b/packages/orbit-components/src/Drawer/components/DrawerClose.tsx @@ -0,0 +1,35 @@ +import * as React from "react"; +import styled from "styled-components"; + +import ButtonLink from "../../ButtonLink"; +import Close from "../../icons/Close"; +import defaultTheme from "../../defaultTheme"; +import { left } from "../../utils/rtl"; +import useTranslate from "../../hooks/useTranslate"; +import { Props } from "./types"; + +const StyledDrawerClose = styled.div` + margin-${left}: ${({ theme }) => theme.orbit.spaceMedium}; +`; + +StyledDrawerClose.defaultProps = { + theme: defaultTheme, +}; + +const DrawerClose = React.forwardRef(({ onClick }, ref) => { + const translate = useTranslate(); + + return ( + + } + ref={ref} + type="secondary" + title={translate("drawer_hide")} + /> + + ); +}); + +export default DrawerClose; diff --git a/packages/orbit-components/src/Drawer/components/types.ts b/packages/orbit-components/src/Drawer/components/types.ts new file mode 100644 index 0000000000..1d5faa3a6d --- /dev/null +++ b/packages/orbit-components/src/Drawer/components/types.ts @@ -0,0 +1,8 @@ +// Type definitions for @kiwicom/orbit-components +// Project: http://github.com/kiwicom/orbit + +import * as Common from "../../common/types"; + +export interface Props { + readonly onClick?: Common.Callback; +} diff --git a/packages/orbit-components/src/Drawer/consts.js b/packages/orbit-components/src/Drawer/consts.js deleted file mode 100644 index 52fdb1ae13..0000000000 --- a/packages/orbit-components/src/Drawer/consts.js +++ /dev/null @@ -1,4 +0,0 @@ -// @flow -const POSITIONS = { RIGHT: "right", LEFT: "left" }; - -export default POSITIONS; diff --git a/packages/orbit-components/src/Drawer/consts.ts b/packages/orbit-components/src/Drawer/consts.ts new file mode 100644 index 0000000000..f01401191e --- /dev/null +++ b/packages/orbit-components/src/Drawer/consts.ts @@ -0,0 +1,6 @@ +enum POSITIONS { + RIGHT = "right", + LEFT = "left", +} + +export default POSITIONS; diff --git a/packages/orbit-components/src/Drawer/helpers/__tests__/__snapshots__/getTransitionAnimation.test.js.snap b/packages/orbit-components/src/Drawer/helpers/__tests__/__snapshots__/getTransitionAnimation.test.ts.snap similarity index 100% rename from packages/orbit-components/src/Drawer/helpers/__tests__/__snapshots__/getTransitionAnimation.test.js.snap rename to packages/orbit-components/src/Drawer/helpers/__tests__/__snapshots__/getTransitionAnimation.test.ts.snap diff --git a/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.js b/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.js deleted file mode 100644 index 3476969792..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.js +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import getPosition from "../getPosition"; -import POSITIONS from "../../consts"; -import theme from "../../../defaultTheme"; - -describe("getPosition", () => { - it("should return proper values", () => { - expect(getPosition({ position: POSITIONS.RIGHT, theme }).join("")).toBe("right:0;"); - expect(getPosition({ position: POSITIONS.LEFT, theme }).join("")).toBe("left:0;"); - }); -}); diff --git a/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.ts b/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.ts new file mode 100644 index 0000000000..a826e67b3a --- /dev/null +++ b/packages/orbit-components/src/Drawer/helpers/__tests__/getPosition.test.ts @@ -0,0 +1,10 @@ +import getPosition from "../getPosition"; +import POSITIONS from "../../consts"; +import theme from "../../../defaultTheme"; + +describe("getPosition", () => { + it("should return proper values", () => { + expect(getPosition({ position: POSITIONS.RIGHT, theme }).join("")).toBe("right:0;"); + expect(getPosition({ position: POSITIONS.LEFT, theme }).join("")).toBe("left:0;"); + }); +}); diff --git a/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.js b/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.js deleted file mode 100644 index 03e1c6448c..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.js +++ /dev/null @@ -1,61 +0,0 @@ -// @flow -import getTransitionAnimation from "../getTransitionAnimation"; -import theme from "../../../defaultTheme"; -import POSITIONS from "../../consts"; - -/* - It's very hard to match returned values from function, that returns deeply nested interpolation. - Instead of some evaluation hack, snapshots are quiet easy for maintainability of this function. - */ - -describe("getTransitionAnimation on the right", () => { - const width = "320px"; - const position = POSITIONS.RIGHT; - it("shown, should match snapshot", () => { - expect(getTransitionAnimation({ width, shown: true, position, theme })).toMatchSnapshot(); - }); - it("not shown, should match snapshot", () => { - expect(getTransitionAnimation({ width, shown: false, position, theme })).toMatchSnapshot(); - }); -}); - -describe("getTransitionAnimation on the left", () => { - const width = "320px"; - const position = POSITIONS.LEFT; - it("shown, should match snapshot", () => { - expect(getTransitionAnimation({ width, shown: true, position, theme })).toMatchSnapshot(); - }); - it("not shown, should match snapshot", () => { - expect(getTransitionAnimation({ width, shown: false, position, theme })).toMatchSnapshot(); - }); -}); - -describe("getTransitionAnimation on the right in RTL", () => { - const width = "320px"; - const position = POSITIONS.RIGHT; - it("shown, should match snapshot", () => { - expect( - getTransitionAnimation({ width, shown: true, position, theme: { ...theme, rtl: true } }), - ).toMatchSnapshot(); - }); - it("not shown, should match snapshot", () => { - expect( - getTransitionAnimation({ width, shown: false, position, theme: { ...theme, rtl: true } }), - ).toMatchSnapshot(); - }); -}); - -describe("getTransitionAnimation on the left in RTL", () => { - const width = "320px"; - const position = POSITIONS.LEFT; - it("shown, should match snapshot", () => { - expect( - getTransitionAnimation({ width, shown: true, position, theme: { ...theme, rtl: true } }), - ).toMatchSnapshot(); - }); - it("not shown, should match snapshot", () => { - expect( - getTransitionAnimation({ width, shown: false, position, theme: { ...theme, rtl: true } }), - ).toMatchSnapshot(); - }); -}); diff --git a/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.ts b/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.ts new file mode 100644 index 0000000000..ca55cc2de6 --- /dev/null +++ b/packages/orbit-components/src/Drawer/helpers/__tests__/getTransitionAnimation.test.ts @@ -0,0 +1,60 @@ +import getTransitionAnimation from "../getTransitionAnimation"; +import theme from "../../../defaultTheme"; +import POSITIONS from "../../consts"; + +/* + It's very hard to match returned values from function, that returns deeply nested interpolation. + Instead of some evaluation hack, snapshots are quiet easy for maintainability of this function. + */ + +describe("getTransitionAnimation on the right", () => { + const width = "320px"; + const position = POSITIONS.RIGHT; + it("shown, should match snapshot", () => { + expect(getTransitionAnimation({ width, shown: true, position, theme })).toMatchSnapshot(); + }); + it("not shown, should match snapshot", () => { + expect(getTransitionAnimation({ width, shown: false, position, theme })).toMatchSnapshot(); + }); +}); + +describe("getTransitionAnimation on the left", () => { + const width = "320px"; + const position = POSITIONS.LEFT; + it("shown, should match snapshot", () => { + expect(getTransitionAnimation({ width, shown: true, position, theme })).toMatchSnapshot(); + }); + it("not shown, should match snapshot", () => { + expect(getTransitionAnimation({ width, shown: false, position, theme })).toMatchSnapshot(); + }); +}); + +describe("getTransitionAnimation on the right in RTL", () => { + const width = "320px"; + const position = POSITIONS.RIGHT; + it("shown, should match snapshot", () => { + expect( + getTransitionAnimation({ width, shown: true, position, theme: { ...theme, rtl: true } }), + ).toMatchSnapshot(); + }); + it("not shown, should match snapshot", () => { + expect( + getTransitionAnimation({ width, shown: false, position, theme: { ...theme, rtl: true } }), + ).toMatchSnapshot(); + }); +}); + +describe("getTransitionAnimation on the left in RTL", () => { + const width = "320px"; + const position = POSITIONS.LEFT; + it("shown, should match snapshot", () => { + expect( + getTransitionAnimation({ width, shown: true, position, theme: { ...theme, rtl: true } }), + ).toMatchSnapshot(); + }); + it("not shown, should match snapshot", () => { + expect( + getTransitionAnimation({ width, shown: false, position, theme: { ...theme, rtl: true } }), + ).toMatchSnapshot(); + }); +}); diff --git a/packages/orbit-components/src/Drawer/helpers/getPosition.js b/packages/orbit-components/src/Drawer/helpers/getPosition.js deleted file mode 100644 index 099ca4730f..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/getPosition.js +++ /dev/null @@ -1,11 +0,0 @@ -// @flow -import { css } from "styled-components"; - -import POSITIONS from "../consts"; -import { left, right } from "../../utils/rtl"; -import type { GetPosition } from "./getPosition"; - -const getPosition: GetPosition = ({ position, theme }) => css` - ${position === POSITIONS.RIGHT ? right({ theme }) : left({ theme })}: 0; -`; -export default getPosition; diff --git a/packages/orbit-components/src/Drawer/helpers/getPosition.js.flow b/packages/orbit-components/src/Drawer/helpers/getPosition.js.flow deleted file mode 100644 index 0f32f68af4..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/getPosition.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import type { CSSRules } from "styled-components"; - -import type { Position } from ".."; -import type { Theme } from "../../defaultTheme"; - -export type GetPosition = ({| position: Position, theme: Theme |}) => CSSRules; - -declare export default GetPosition; diff --git a/packages/orbit-components/src/Drawer/helpers/getPosition.ts b/packages/orbit-components/src/Drawer/helpers/getPosition.ts new file mode 100644 index 0000000000..2689eadc05 --- /dev/null +++ b/packages/orbit-components/src/Drawer/helpers/getPosition.ts @@ -0,0 +1,17 @@ +import { css, FlattenSimpleInterpolation } from "styled-components"; + +import { Theme } from "../../defaultTheme"; +import POSITIONS from "../consts"; +import { left, right } from "../../utils/rtl"; + +const getPosition = ({ + position, + theme, +}: { + position: "right" | "left"; + theme: Theme; +}): FlattenSimpleInterpolation => css` + ${position === POSITIONS.RIGHT ? right({ theme }) : left({ theme })}: 0; +`; + +export default getPosition; diff --git a/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js b/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js deleted file mode 100644 index f15fab71ba..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js +++ /dev/null @@ -1,27 +0,0 @@ -// @flow -import { css } from "styled-components"; - -import mq from "../../utils/mediaQuery"; -import POSITIONS from "../consts"; -import type { GetTransitionAnimation } from "./getTransitionAnimation"; - -const computedWidth = (width, isPrefixed) => `${isPrefixed ? "-" : ""}${width}`; - -const transitionCss = ({ width, shown }) => isPrefixed => { - return css` - transform: translate3d(${shown ? "0, 0, 0" : `${computedWidth("100%", isPrefixed)} , 0, 0`}); - ${mq.largeMobile(css` - transform: translate3d(${shown ? "0, 0, 0" : `${computedWidth(width, isPrefixed)} , 0, 0`}); - `)}; - `; -}; - -const getTransitionAnimation: GetTransitionAnimation = ({ width, shown, position, theme }) => { - const resultCss = transitionCss({ width, shown }); - if ((position === POSITIONS.RIGHT && !theme.rtl) || (position === POSITIONS.LEFT && theme.rtl)) { - return resultCss(false); - } - return resultCss(true); -}; - -export default getTransitionAnimation; diff --git a/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js.flow b/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js.flow deleted file mode 100644 index b2a0a214ad..0000000000 --- a/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import type { CSSRules } from "styled-components"; - -import type { Position } from ".."; -import type { Theme } from "../../defaultTheme"; - -export type GetTransitionAnimation = ({| - width: string, - shown: boolean, - position: Position, - theme: Theme, -|}) => CSSRules; - -declare export default GetTransitionAnimation; diff --git a/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.ts b/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.ts new file mode 100644 index 0000000000..497357577e --- /dev/null +++ b/packages/orbit-components/src/Drawer/helpers/getTransitionAnimation.ts @@ -0,0 +1,38 @@ +import { css, FlattenInterpolation, ThemeProps } from "styled-components"; + +import mq from "../../utils/mediaQuery"; +import POSITIONS from "../consts"; +import { Theme } from "../../defaultTheme"; + +const computedWidth = (width: string, isPrefixed: boolean) => `${isPrefixed ? "-" : ""}${width}`; + +const transitionCss = ({ width, shown }: { width: string; shown?: boolean }) => ( + isPrefixed: boolean, +) => { + return css` + transform: translate3d(${shown ? "0, 0, 0" : `${computedWidth("100%", isPrefixed)} , 0, 0`}); + ${mq.largeMobile(css` + transform: translate3d(${shown ? "0, 0, 0" : `${computedWidth(width, isPrefixed)} , 0, 0`}); + `)}; + `; +}; + +const getTransitionAnimation = ({ + width, + shown, + position, + theme, +}: { + width: string; + shown?: boolean; + position: "right" | "left"; + theme: Theme; +}): FlattenInterpolation> => { + const resultCss = transitionCss({ width, shown }); + if ((position === POSITIONS.RIGHT && !theme.rtl) || (position === POSITIONS.LEFT && theme.rtl)) { + return resultCss(false); + } + return resultCss(true); +}; + +export default getTransitionAnimation; diff --git a/packages/orbit-components/src/Drawer/index.d.ts b/packages/orbit-components/src/Drawer/index.d.ts deleted file mode 100644 index 9150baf1f5..0000000000 --- a/packages/orbit-components/src/Drawer/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for @kiwicom/orbit-components -// Project: http://github.com/kiwicom/orbit - -import * as React from "react"; - -import * as Common from "../common/common"; - -type Position = "left" | "right"; - -export interface Props extends Common.Global { - readonly actions?: React.ReactNode; - readonly children: React.ReactNode; - readonly lockScrolling?: boolean; - readonly noPadding?: boolean; - readonly onClose?: Common.Callback; - readonly fixedHeader?: boolean; - readonly position?: Position; - readonly shown: boolean; - readonly suppressed?: boolean; - readonly title?: Common.Translation; - readonly width?: string; -} - -declare const Drawer: React.FunctionComponent; -export { Drawer, Drawer as default }; diff --git a/packages/orbit-components/src/Drawer/index.jsx.flow b/packages/orbit-components/src/Drawer/index.js.flow similarity index 100% rename from packages/orbit-components/src/Drawer/index.jsx.flow rename to packages/orbit-components/src/Drawer/index.js.flow diff --git a/packages/orbit-components/src/Drawer/index.jsx b/packages/orbit-components/src/Drawer/index.jsx deleted file mode 100644 index 36fd4bc182..0000000000 --- a/packages/orbit-components/src/Drawer/index.jsx +++ /dev/null @@ -1,246 +0,0 @@ -// @flow -import * as React from "react"; -import styled, { css } from "styled-components"; -import { convertHexToRgba } from "@kiwicom/orbit-design-tokens"; - -import KEY_CODE_MAP from "../common/keyMaps"; -import useFocusTrap from "../hooks/useFocusTrap"; -import useLockScrolling from "../hooks/useLockScrolling"; -import transition from "../utils/transition"; -import mq from "../utils/mediaQuery"; -import defaultTheme from "../defaultTheme"; -import DrawerClose from "./components/DrawerClose"; -import POSITIONS from "./consts"; -import getPosition from "./helpers/getPosition"; -import getTransitionAnimation from "./helpers/getTransitionAnimation"; -import useTheme from "../hooks/useTheme"; -import Stack from "../Stack"; -import useStateWithTimeout from "../hooks/useStateWithTimeout"; -import Heading from "../Heading"; -import { rtlSpacing } from "../utils/rtl"; - -import type { Props } from "."; - -const getPadding = ({ noPadding, theme, hasTopPadding }) => { - const padding = space => (!hasTopPadding ? rtlSpacing(`0 ${space} ${space}`) : space); - return ( - !noPadding && - css` - padding: ${padding(theme.orbit.spaceMedium)}; - ${mq.largeMobile(css` - padding: ${padding(theme.orbit.spaceXLarge)}; - `)}; - ` - ); -}; - -const StyledDrawer = styled.div` - ${({ theme, overlayShown, shown }) => css` - display: flex; - visibility: ${overlayShown ? "visible" : "hidden"}; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - width: 100%; - height: 100%; - background-color: ${shown ? convertHexToRgba(theme.orbit.paletteInkDark, 50) : "transparent"}; - z-index: ${theme.orbit.zIndexDrawer}; - transition: ${transition(["background-color"], "fast", "ease-in-out")}; - `} -`; - -// $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 -StyledDrawer.defaultProps = { - theme: defaultTheme, -}; - -const StyledDrawerSide = styled( - React.forwardRef(({ theme, width, position, shown, suppressed, ...props }, ref) => ( -