@dr.pogodin/react-utils 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/development/client/index.js +3 -0
- package/build/development/client/index.js.map +1 -1
- package/build/development/index.js +36 -84
- package/build/development/index.js.map +1 -1
- package/build/development/server/renderer.js +3 -1
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/shared/components/Button/index.js +2 -1
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/Checkbox/index.js +2 -1
- package/build/development/shared/components/Checkbox/index.js.map +1 -1
- package/build/development/shared/components/Dropdown/index.js +14 -9
- package/build/development/shared/components/Dropdown/index.js.map +1 -1
- package/build/development/shared/components/Input/index.js +2 -1
- package/build/development/shared/components/Input/index.js.map +1 -1
- package/build/development/shared/components/Modal/index.js +2 -1
- package/build/development/shared/components/Modal/index.js.map +1 -1
- package/build/development/shared/components/PageLayout/index.js +2 -1
- package/build/development/shared/components/PageLayout/index.js.map +1 -1
- package/build/development/shared/components/TextArea/index.js +94 -0
- package/build/development/shared/components/TextArea/index.js.map +1 -0
- package/build/development/shared/components/Throbber/index.js +2 -1
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/shared/components/WithTooltip/Tooltip.js +2 -1
- package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/development/shared/components/WithTooltip/index.js +1 -0
- package/build/development/shared/components/WithTooltip/index.js.map +1 -1
- package/build/development/shared/components/YouTubeVideo/index.js +2 -1
- package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/development/shared/components/index.js +7 -0
- package/build/development/shared/components/index.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js +2 -0
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/shared/utils/jest/index.js +2 -0
- package/build/development/shared/utils/jest/index.js.map +1 -1
- package/build/development/style.css +89 -0
- package/build/development/web.bundle.js +37 -17
- package/build/production/client/index.js +1 -1
- package/build/production/client/index.js.map +1 -1
- package/build/production/index.js +1 -1
- package/build/production/index.js.map +1 -1
- package/build/production/server/renderer.js +1 -1
- package/build/production/server/renderer.js.map +1 -1
- package/build/production/shared/components/Button/index.js +2 -2
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/Checkbox/index.js +2 -2
- package/build/production/shared/components/Checkbox/index.js.map +1 -1
- package/build/production/shared/components/Dropdown/index.js +2 -2
- package/build/production/shared/components/Dropdown/index.js.map +1 -1
- package/build/production/shared/components/Input/index.js +2 -2
- package/build/production/shared/components/Input/index.js.map +1 -1
- package/build/production/shared/components/Modal/index.js +2 -2
- package/build/production/shared/components/Modal/index.js.map +1 -1
- package/build/production/shared/components/PageLayout/index.js +2 -2
- package/build/production/shared/components/PageLayout/index.js.map +1 -1
- package/build/production/shared/components/TextArea/index.js +10 -0
- package/build/production/shared/components/TextArea/index.js.map +1 -0
- package/build/production/shared/components/Throbber/index.js +2 -2
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/shared/components/WithTooltip/Tooltip.js +2 -2
- package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/production/shared/components/WithTooltip/index.js +1 -1
- package/build/production/shared/components/WithTooltip/index.js.map +1 -1
- package/build/production/shared/components/YouTubeVideo/index.js +2 -2
- package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/production/shared/components/index.js +1 -1
- package/build/production/shared/components/index.js.map +1 -1
- package/build/production/style.css +1 -1
- package/build/production/style.css.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/index.d.ts +1 -1
- package/build/types-code/shared/components/Button/index.d.ts +2 -5
- package/build/types-code/shared/components/Checkbox/index.d.ts +2 -5
- package/build/types-code/shared/components/Dropdown/index.d.ts +2 -8
- package/build/types-code/shared/components/Input/index.d.ts +2 -5
- package/build/types-code/shared/components/Modal/index.d.ts +2 -4
- package/build/types-code/shared/components/PageLayout/index.d.ts +2 -7
- package/build/types-code/shared/components/TextArea/index.d.ts +12 -0
- package/build/types-code/shared/components/Throbber/index.d.ts +2 -5
- package/build/types-code/shared/components/WithTooltip/Tooltip.d.ts +1 -6
- package/build/types-code/shared/components/WithTooltip/index.d.ts +3 -4
- package/build/types-code/shared/components/YouTubeVideo/index.d.ts +2 -4
- package/build/types-code/shared/components/index.d.ts +1 -0
- package/build/types-scss/src/shared/components/Dropdown/theme.scss.d.ts +1 -0
- package/build/types-scss/src/shared/components/TextArea/style.scss.d.ts +6 -0
- package/package.json +37 -37
- package/src/client/index.tsx +1 -1
- package/src/index.ts +1 -16
- package/src/server/renderer.tsx +4 -1
- package/src/shared/components/Button/index.tsx +4 -10
- package/src/shared/components/Checkbox/index.tsx +9 -10
- package/src/shared/components/Dropdown/index.tsx +28 -25
- package/src/shared/components/Dropdown/theme.scss +6 -0
- package/src/shared/components/Input/index.tsx +8 -10
- package/src/shared/components/Modal/index.tsx +4 -8
- package/src/shared/components/PageLayout/index.tsx +15 -14
- package/src/shared/components/TextArea/index.tsx +107 -0
- package/src/shared/components/TextArea/style.scss +37 -0
- package/src/shared/components/Throbber/index.tsx +8 -10
- package/src/shared/components/WithTooltip/Tooltip.tsx +10 -6
- package/src/shared/components/WithTooltip/index.tsx +7 -4
- package/src/shared/components/YouTubeVideo/index.tsx +4 -8
- package/src/shared/components/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","Error","webpackStats","runSsr","logger","undefined","debug","noop","info","log","warn","cleanup","entry","p","module","Application","entryExportName","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","cache","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n/* eslint-disable global-require, import/no-dynamic-require */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { type IFs, createFsFromVolume, Volume } from 'memfs';\nimport webpack from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport ssrFactory from 'server/renderer';\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString\n ? JSON.parse(optionsString) : {}) as webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n let factory = require(path.resolve(this.rootDir, factoryPath));\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs as IFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack() {\n this.loadWebpackConfig();\n\n const compiler = webpack(this.global.webpackConfig as webpack.Configuration);\n compiler.outputFileSystem = this.global.webpackOutputFs;\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr() {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n if (options.logger === undefined) {\n options.logger = {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n }\n\n if (!options.buildInfo) options.buildInfo = this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry);\n const module = require(p);\n cleanup = module.cleanup;\n options.Application = module[options.entryExportName || 'default'];\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n if (error) fail(error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString ? JSON.parse(requestString) : {};\n\n if (!request.url) request.url = '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n let root;\n switch (options.root) {\n case 'TEST': root = this.testFolder; break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup() {\n await super.setup();\n await this.runWebpack();\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown() {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n super.teardown();\n }\n}\n"],"mappings":";;;;;;;AAiBA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,qBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAGA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAhCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AAMA;AASe,MAAMO,SAAS,SAASC,6BAAQ,CAAC;EAa9C;AACF;AACA;AACA;EACEC,iBAAiBA,CAAA,EAAG;IAClB,MAAMC,aAAa,GAAG,IAAI,CAACC,OAAO,CAAC,wBAAwB,CAAW;IAEtE,MAAMC,OAAO,GAAIF,aAAa,GAC1BG,IAAI,CAACC,KAAK,CAACJ,aAAa,CAAC,GAAG,CAAC,CAA2B;IAE5D,IAAAK,gBAAQ,EAACH,OAAO,EAAE;MAChBI,OAAO,EAAE,IAAI,CAACC,UAAU;MACxBC,EAAE,EAAE,IAAI,CAACC,MAAM,CAACC;IAClB,CAAC,CAAC;IAEF,MAAMC,WAAW,GAAG,IAAI,CAACV,OAAO,CAAC,wBAAwB,CAAW;IACpE,IAAIW,OAAO,GAAG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GAAG,IAAI;EAClD;EAEA,MAAMC,QAAQA,CAAA,EAAG;IACf,OAAO,IAAI,CAAChF,MAAM,CAAC+E,6BAA6B;;IAEhD;IACA;IACA;IACA;IACA;IACA;IACAE,MAAM,CAACC,IAAI,CAACrG,OAAO,CAACsG,KAAK,CAAC,CAACC,OAAO,CAAEC,GAAG,IAAK;MAC1C,OAAOxG,OAAO,CAACsG,KAAK,CAACE,GAAG,CAAC;IAC3B,CAAC,CAAC;IACFX,2BAAQ,CAACY,MAAM,CAAC,CAAC;IACjB,KAAK,CAACN,QAAQ,CAAC,CAAC;EAClB;AACF;AAACO,OAAA,CAAAhF,OAAA,GAAAnB,SAAA"}
|
|
1
|
+
{"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","Error","webpackStats","runSsr","logger","undefined","debug","noop","info","log","warn","cleanup","entry","p","module","Application","entryExportName","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","cache","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n/* eslint-disable global-require, import/no-dynamic-require */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { type IFs, createFsFromVolume, Volume } from 'memfs';\nimport webpack from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport ssrFactory from 'server/renderer';\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString\n ? JSON.parse(optionsString) : {}) as webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n let factory = require(path.resolve(this.rootDir, factoryPath));\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs as IFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack() {\n this.loadWebpackConfig();\n\n const compiler = webpack(this.global.webpackConfig as webpack.Configuration);\n compiler.outputFileSystem = this.global.webpackOutputFs;\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr() {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n if (options.logger === undefined) {\n options.logger = {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n }\n\n if (!options.buildInfo) options.buildInfo = this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry);\n const module = require(p);\n cleanup = module.cleanup;\n options.Application = module[options.entryExportName || 'default'];\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n if (error) fail(error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString ? JSON.parse(requestString) : {};\n\n if (!request.url) request.url = '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n let root;\n switch (options.root) {\n case 'TEST': root = this.testFolder; break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup() {\n await super.setup();\n await this.runWebpack();\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown() {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n super.teardown();\n }\n}\n"],"mappings":";;;;;;;AAiBA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;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Module) return e;
|
|
|
41
41
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
42
42
|
|
|
43
43
|
/* eslint-enable import/no-extraneous-dependencies */
|
|
44
|
+
|
|
44
45
|
/**
|
|
45
46
|
* An alias for [act(..)](https://reactjs.org/docs/test-utils.html#act)
|
|
46
47
|
* from `react-dom/test-utils`.
|
|
47
48
|
* @param {function} action
|
|
48
49
|
*/
|
|
50
|
+
|
|
49
51
|
global.IS_REACT_ACT_ENVIRONMENT = true;
|
|
50
52
|
const originalProcessVersions = process.versions;
|
|
51
53
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_mockdate","_interopRequireDefault","require","_client","_testUtils","_interopRequireWildcard","_reactTestRenderer","_shallow","_global","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","global","IS_REACT_ACT_ENVIRONMENT","originalProcessVersions","process","versions","mockClientSide","value","unmockClientSide","writable","getMockUuid","seed","x","toString","padStart","slice","mockTimer","time","mockdate","Date","now","jest","advanceTimersByTime","mount","scene","root","element","document","createElement","body","appendChild","res","destroy","act","unmount","remove","createRoot","render","component","Renderer","create","toJSON","shallowRender","renderer","createRenderer","getRenderOutput","shallowSnapshot","expect","toMatchSnapshot","snapshot","simulate","exports","TU","Simulate"],"sources":["../../../../../src/shared/utils/jest/index.tsx"],"sourcesContent":["/* global expect, jest, document */\n/* eslint-disable import/no-extraneous-dependencies */\n\nimport mockdate from 'mockdate';\nimport { type ReactElement, type ReactNode } from 'react';\nimport { type Root, createRoot } from 'react-dom/client';\nimport TU, { act } from 'react-dom/test-utils';\n\n/* eslint-disable import/no-extraneous-dependencies */\nimport Renderer from 'react-test-renderer';\nimport { type ShallowRenderer, createRenderer } from 'react-test-renderer/shallow';\n/* eslint-enable import/no-extraneous-dependencies */\n\n/**\n * An alias for [act(..)](https://reactjs.org/docs/test-utils.html#act)\n * from `react-dom/test-utils`.\n * @param {function} action\n */\nexport { act };\n\nexport { default as getGlobal } from './global';\n\ndeclare global {\n // eslint-disable-next-line no-var, vars-on-top\n var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;\n}\n\nglobal.IS_REACT_ACT_ENVIRONMENT = true;\n\nconst originalProcessVersions = process.versions;\n\n/**\n * Tricks **react-utils** into thinking the test is running within client-side\n * (browser) environment.\n */\nexport function mockClientSide() {\n Object.defineProperty(process, 'versions', { value: null });\n}\n\n/**\n * Reverts the effect of {@link module:JU.mockClientSide mockClientSide(..)}.\n */\nexport function unmockClientSide() {\n Object.defineProperty(process, 'versions', {\n value: originalProcessVersions,\n writable: false,\n });\n}\n\n/**\n * Generates a mock UUID, or better said it determenistically transforms given\n * `seed` number into a UUID-formatted string.\n * @param {number} seed\n * @return {string}\n */\nexport function getMockUuid(seed = 0) {\n const x = seed.toString(16).padStart(32, '0');\n return `${x.slice(0, 8)}-${x.slice(8, 12)}-${x.slice(12, 16)}-${x.slice(16, 20)}-${x.slice(20)}`;\n}\n\n/**\n * Advances mock timers, and mock date by the specified time.\n * @param {number} time Time step [ms].\n * @returns {Promise} Wait for this to \"jump after\" any async code which should\n * be executed because of the mock time movement.\n */\nexport async function mockTimer(time: number) {\n mockdate.set(time + Date.now());\n jest.advanceTimersByTime(time);\n}\n\nexport type MountedSceneT = HTMLElement & {\n destroy: () => void;\n};\n\n/**\n * Mounts `scene` to the DOM, and returns the root scene element.\n * @param scene\n * @return Created container DOM element with destroy() function\n * attached.\n */\nexport function mount(scene: ReactNode): MountedSceneT {\n let root: Root;\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const res: MountedSceneT = (element as unknown) as MountedSceneT;\n res.destroy = () => {\n act(() => root.unmount());\n res.remove();\n };\n\n act(() => {\n root = createRoot(res);\n root.render(scene);\n });\n return res;\n}\n\n/* OLD STUFF BELOW THIS MARK */\n\n/**\n * Renders provided ReactJS component into JSON representation of the component\n * tree, using [`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the rendered tree.\n * @example\n * import { JU } from '@dr.pogodin/react-utils';\n * console.log(JU.render(<div>Example</div>));\n */\nexport function render(component: ReactElement) {\n return Renderer.create(component).toJSON();\n}\n\n/**\n * Generates a shallow render of given ReactJS component, using\n * [react-test-renderer/shallow](https://reactjs.org/docs/shallow-renderer.html)\n * and returns the result.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the shallow component's render tree.\n */\nexport function shallowRender(component: ReactElement) {\n const renderer: ShallowRenderer = createRenderer();\n renderer.render(component);\n return renderer.getRenderOutput();\n}\n\n/**\n * Makes a shallow snapshot test of the given ReactJS component, and also\n * returns JSON representation of the rendered component tree. Under the hood\n * it uses {@link module:JU.shallowRender shallowRender(..)} to generate\n * the render, then executes `expect(RENDER_RESULT).toMatchSnapshot()`,\n * and finally returns the `RENDER_RESULT` to the caller.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of shallow render.\n */\nexport function shallowSnapshot(component: ReactElement) {\n const res = shallowRender(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\n/**\n * Makes snapshot test of the given ReactJS component, and also returns JSON\n * representation of the rendered component tree. Under the hood, it uses\n * {@link module:JU.render render(..)} to render it, then executes\n * `expect(RENDER_RESULT).toMatchSnapshot()`, and then returns `RENDER_RESULT`.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON render of the component.\n */\nexport function snapshot(component: ReactElement) {\n const res = render(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\nexport const simulate = TU.Simulate;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,kBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAA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Default","require","_client","_testUtils","_interopRequireWildcard","_reactTestRenderer","_shallow","_global","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","global","IS_REACT_ACT_ENVIRONMENT","originalProcessVersions","process","versions","mockClientSide","value","unmockClientSide","writable","getMockUuid","seed","x","toString","padStart","slice","mockTimer","time","mockdate","Date","now","jest","advanceTimersByTime","mount","scene","root","element","document","createElement","body","appendChild","res","destroy","act","unmount","remove","createRoot","render","component","Renderer","create","toJSON","shallowRender","renderer","createRenderer","getRenderOutput","shallowSnapshot","expect","toMatchSnapshot","snapshot","simulate","exports","TU","Simulate"],"sources":["../../../../../src/shared/utils/jest/index.tsx"],"sourcesContent":["/* global expect, jest, document */\n/* eslint-disable import/no-extraneous-dependencies */\n\nimport mockdate from 'mockdate';\nimport { type ReactElement, type ReactNode } from 'react';\nimport { type Root, createRoot } from 'react-dom/client';\nimport TU, { act } from 'react-dom/test-utils';\n\n/* eslint-disable import/no-extraneous-dependencies */\nimport Renderer from 'react-test-renderer';\nimport { type ShallowRenderer, createRenderer } from 'react-test-renderer/shallow';\n/* eslint-enable import/no-extraneous-dependencies */\n\n/**\n * An alias for [act(..)](https://reactjs.org/docs/test-utils.html#act)\n * from `react-dom/test-utils`.\n * @param {function} action\n */\nexport { act };\n\nexport { default as getGlobal } from './global';\n\ndeclare global {\n // eslint-disable-next-line no-var, vars-on-top\n var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;\n}\n\nglobal.IS_REACT_ACT_ENVIRONMENT = true;\n\nconst originalProcessVersions = process.versions;\n\n/**\n * Tricks **react-utils** into thinking the test is running within client-side\n * (browser) environment.\n */\nexport function mockClientSide() {\n Object.defineProperty(process, 'versions', { value: null });\n}\n\n/**\n * Reverts the effect of {@link module:JU.mockClientSide mockClientSide(..)}.\n */\nexport function unmockClientSide() {\n Object.defineProperty(process, 'versions', {\n value: originalProcessVersions,\n writable: false,\n });\n}\n\n/**\n * Generates a mock UUID, or better said it determenistically transforms given\n * `seed` number into a UUID-formatted string.\n * @param {number} seed\n * @return {string}\n */\nexport function getMockUuid(seed = 0) {\n const x = seed.toString(16).padStart(32, '0');\n return `${x.slice(0, 8)}-${x.slice(8, 12)}-${x.slice(12, 16)}-${x.slice(16, 20)}-${x.slice(20)}`;\n}\n\n/**\n * Advances mock timers, and mock date by the specified time.\n * @param {number} time Time step [ms].\n * @returns {Promise} Wait for this to \"jump after\" any async code which should\n * be executed because of the mock time movement.\n */\nexport async function mockTimer(time: number) {\n mockdate.set(time + Date.now());\n jest.advanceTimersByTime(time);\n}\n\nexport type MountedSceneT = HTMLElement & {\n destroy: () => void;\n};\n\n/**\n * Mounts `scene` to the DOM, and returns the root scene element.\n * @param scene\n * @return Created container DOM element with destroy() function\n * attached.\n */\nexport function mount(scene: ReactNode): MountedSceneT {\n let root: Root;\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const res: MountedSceneT = (element as unknown) as MountedSceneT;\n res.destroy = () => {\n act(() => root.unmount());\n res.remove();\n };\n\n act(() => {\n root = createRoot(res);\n root.render(scene);\n });\n return res;\n}\n\n/* OLD STUFF BELOW THIS MARK */\n\n/**\n * Renders provided ReactJS component into JSON representation of the component\n * tree, using [`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the rendered tree.\n * @example\n * import { JU } from '@dr.pogodin/react-utils';\n * console.log(JU.render(<div>Example</div>));\n */\nexport function render(component: ReactElement) {\n return Renderer.create(component).toJSON();\n}\n\n/**\n * Generates a shallow render of given ReactJS component, using\n * [react-test-renderer/shallow](https://reactjs.org/docs/shallow-renderer.html)\n * and returns the result.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the shallow component's render tree.\n */\nexport function shallowRender(component: ReactElement) {\n const renderer: ShallowRenderer = createRenderer();\n renderer.render(component);\n return renderer.getRenderOutput();\n}\n\n/**\n * Makes a shallow snapshot test of the given ReactJS component, and also\n * returns JSON representation of the rendered component tree. Under the hood\n * it uses {@link module:JU.shallowRender shallowRender(..)} to generate\n * the render, then executes `expect(RENDER_RESULT).toMatchSnapshot()`,\n * and finally returns the `RENDER_RESULT` to the caller.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of shallow render.\n */\nexport function shallowSnapshot(component: ReactElement) {\n const res = shallowRender(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\n/**\n * Makes snapshot test of the given ReactJS component, and also returns JSON\n * representation of the rendered component tree. Under the hood, it uses\n * {@link module:JU.render render(..)} to render it, then executes\n * `expect(RENDER_RESULT).toMatchSnapshot()`, and then returns `RENDER_RESULT`.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON render of the component.\n */\nexport function snapshot(component: ReactElement) {\n const res = render(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\nexport const simulate = TU.Simulate;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,kBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAUA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAgD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA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AACZ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,MAAMA,CAACC,SAAuB,EAAE;EAC9C,OAAOC,0BAAQ,CAACC,MAAM,CAACF,SAAS,CAAC,CAACG,MAAM,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAACJ,SAAuB,EAAE;EACrD,MAAMK,QAAyB,GAAG,IAAAC,uBAAc,EAAC,CAAC;EAClDD,QAAQ,CAACN,MAAM,CAACC,SAAS,CAAC;EAC1B,OAAOK,QAAQ,CAACE,eAAe,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAACR,SAAuB,EAAE;EACvD,MAAMP,GAAG,GAAGW,aAAa,CAACJ,SAAS,CAAC;EACpCS,MAAM,CAAChB,GAAG,CAAC,CAACiB,eAAe,CAAC,CAAC;EAC7B,OAAOjB,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkB,QAAQA,CAACX,SAAuB,EAAE;EAChD,MAAMP,GAAG,GAAGM,MAAM,CAACC,SAAS,CAAC;EAC7BS,MAAM,CAAChB,GAAG,CAAC,CAACiB,eAAe,CAAC,CAAC;EAC7B,OAAOjB,GAAG;AACZ;AAEO,MAAMmB,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,kBAAE,CAACC,QAAQ"}
|
|
@@ -217,16 +217,23 @@ body {
|
|
|
217
217
|
/**
|
|
218
218
|
* A simple drop-in typography mixin.
|
|
219
219
|
*/
|
|
220
|
+
*.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___dropdown___-LiQj8,
|
|
221
|
+
.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___context___haRIry.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___dropdown___-LiQj8,
|
|
222
|
+
.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___ad___D4XHG2.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___hoc___N3nd34.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___dropdown___-LiQj8 {
|
|
223
|
+
position: relative;
|
|
224
|
+
}
|
|
220
225
|
*.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___arrow___-zPK7Y,
|
|
221
226
|
.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___context___haRIry.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___arrow___-zPK7Y,
|
|
222
227
|
.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___ad___D4XHG2.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___hoc___N3nd34.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___arrow___-zPK7Y {
|
|
223
228
|
background-image: linear-gradient(to top, lightgray, white 50%, white);
|
|
224
229
|
border: 1px solid gray;
|
|
225
230
|
border-radius: 0 0.3em 0.3em 0;
|
|
231
|
+
bottom: 0;
|
|
226
232
|
padding: 0.3em 0.6em;
|
|
227
233
|
pointer-events: none;
|
|
228
234
|
position: absolute;
|
|
229
235
|
right: 0;
|
|
236
|
+
top: 0;
|
|
230
237
|
}
|
|
231
238
|
*.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___container___9CQpeA,
|
|
232
239
|
.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___context___haRIry.-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___container___9CQpeA,
|
|
@@ -602,3 +609,85 @@ body.scrolling-disabled-by-modal {
|
|
|
602
609
|
transform: translateY(50%);
|
|
603
610
|
width: 100%;
|
|
604
611
|
}
|
|
612
|
+
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
|
613
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[4]!./src/shared/components/TextArea/style.scss ***!
|
|
614
|
+
\*************************************************************************************************************************************************************************************************************************************************************************************************************/
|
|
615
|
+
/* Collection of standard mixins, being used all around. */
|
|
616
|
+
/* Auxiliary mixins for fonts inclusion. */
|
|
617
|
+
/**
|
|
618
|
+
* Includes a font, provided as a set of alternative files in EOT, WOFF, TTF,
|
|
619
|
+
* SVG formats into the app.
|
|
620
|
+
* $font-name {String}
|
|
621
|
+
* $font-weight {Number}
|
|
622
|
+
* $font-style {String}
|
|
623
|
+
* $font-url {String} Path to the font file, without the filename itself.
|
|
624
|
+
* $font-file {String} Font filename, without extension (should be the same for
|
|
625
|
+
* each version of the font in different formats.
|
|
626
|
+
*/
|
|
627
|
+
/**
|
|
628
|
+
* Includes a font, provided in the TTF format only.
|
|
629
|
+
* $font-name {String}
|
|
630
|
+
* $font-weight {Number}
|
|
631
|
+
* $font-style {String}
|
|
632
|
+
* $font-url {String}
|
|
633
|
+
*/
|
|
634
|
+
/**
|
|
635
|
+
* Mixins for different layout sizes: xs, sm, md, lg.
|
|
636
|
+
* Breaking points are defined in _variables.scss
|
|
637
|
+
* The range mixins A-to-B all means "for the sizes from A to B, both
|
|
638
|
+
* inclusive", in particular it means that mixin A-to-lg is equivalent to
|
|
639
|
+
* all sizes from A (inclusive) and larger.
|
|
640
|
+
*
|
|
641
|
+
* NOTE: For convenience, these mixins are sorted not alphabetically, but,
|
|
642
|
+
* first, by increase of the first size; second, by increase of the second size.
|
|
643
|
+
*/
|
|
644
|
+
/* Break points. */
|
|
645
|
+
/* XS */
|
|
646
|
+
/* SM */
|
|
647
|
+
/* MM */
|
|
648
|
+
/* MD */
|
|
649
|
+
/* LG */
|
|
650
|
+
/* XL */
|
|
651
|
+
/**
|
|
652
|
+
* A simple drop-in typography mixin.
|
|
653
|
+
*/
|
|
654
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___container___dzMVIB,
|
|
655
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___container___dzMVIB,
|
|
656
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___container___dzMVIB {
|
|
657
|
+
margin: 0.1em;
|
|
658
|
+
position: relative;
|
|
659
|
+
}
|
|
660
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg,
|
|
661
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg,
|
|
662
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg {
|
|
663
|
+
background: white;
|
|
664
|
+
border: 1px solid gray;
|
|
665
|
+
border-radius: 0.3em;
|
|
666
|
+
box-sizing: border-box;
|
|
667
|
+
font: inherit;
|
|
668
|
+
height: 0;
|
|
669
|
+
outline: none;
|
|
670
|
+
overflow: hidden;
|
|
671
|
+
padding: 0.3em 0.3em calc(0.3em + 1px);
|
|
672
|
+
resize: none;
|
|
673
|
+
}
|
|
674
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg:focus,
|
|
675
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg:focus,
|
|
676
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg:focus {
|
|
677
|
+
border-color: blue;
|
|
678
|
+
box-shadow: 0 0 3px 1px lightblue;
|
|
679
|
+
}
|
|
680
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::-moz-placeholder, .-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::-moz-placeholder, .-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::-moz-placeholder {
|
|
681
|
+
color: gray;
|
|
682
|
+
}
|
|
683
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::placeholder,
|
|
684
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::placeholder,
|
|
685
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___textarea___zd-OFg::placeholder {
|
|
686
|
+
color: gray;
|
|
687
|
+
}
|
|
688
|
+
*.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hidden___GiHBXI,
|
|
689
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___context___KVPc7g.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hidden___GiHBXI,
|
|
690
|
+
.-dr-pogodin-react-utils___src-shared-components-TextArea-style___ad___z2GQ0Z.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hoc___8R1Qdj.-dr-pogodin-react-utils___src-shared-components-TextArea-style___hidden___GiHBXI {
|
|
691
|
+
position: absolute;
|
|
692
|
+
z-index: -1;
|
|
693
|
+
}
|