@dr.pogodin/react-utils 1.35.5 → 1.36.1

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.
Files changed (169) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/development/index.js +0 -6
  3. package/build/development/index.js.map +1 -1
  4. package/build/development/server/Cache.js +19 -19
  5. package/build/development/server/Cache.js.map +1 -1
  6. package/build/development/server/renderer.js +7 -4
  7. package/build/development/server/renderer.js.map +1 -1
  8. package/build/development/server/server.js +4 -1
  9. package/build/development/server/server.js.map +1 -1
  10. package/build/development/shared/components/Button/index.js +1 -16
  11. package/build/development/shared/components/Button/index.js.map +1 -1
  12. package/build/development/shared/components/Checkbox/index.js +1 -29
  13. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  14. package/build/development/shared/components/GenericLink/index.js +0 -15
  15. package/build/development/shared/components/GenericLink/index.js.map +1 -1
  16. package/build/development/shared/components/Input/index.js +1 -8
  17. package/build/development/shared/components/Input/index.js.map +1 -1
  18. package/build/development/shared/components/MetaTags.js +0 -12
  19. package/build/development/shared/components/MetaTags.js.map +1 -1
  20. package/build/development/shared/components/Modal/index.js +2 -13
  21. package/build/development/shared/components/Modal/index.js.map +1 -1
  22. package/build/development/shared/components/PageLayout/index.js +1 -10
  23. package/build/development/shared/components/PageLayout/index.js.map +1 -1
  24. package/build/development/shared/components/TextArea/index.js +1 -12
  25. package/build/development/shared/components/TextArea/index.js.map +1 -1
  26. package/build/development/shared/components/Throbber/index.js +1 -6
  27. package/build/development/shared/components/Throbber/index.js.map +1 -1
  28. package/build/development/shared/components/WithTooltip/Tooltip.js +1 -8
  29. package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
  30. package/build/development/shared/components/WithTooltip/index.js +1 -9
  31. package/build/development/shared/components/WithTooltip/index.js.map +1 -1
  32. package/build/development/shared/components/YouTubeVideo/index.js +2 -11
  33. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  34. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +1 -16
  35. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  36. package/build/development/shared/components/selectors/CustomDropdown/index.js +2 -12
  37. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  38. package/build/development/shared/components/selectors/NativeDropdown/index.js +2 -12
  39. package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  40. package/build/development/shared/components/selectors/Switch/index.js +21 -28
  41. package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
  42. package/build/development/shared/components/selectors/common.js +0 -19
  43. package/build/development/shared/components/selectors/common.js.map +1 -1
  44. package/build/development/shared/components/selectors/index.js +0 -13
  45. package/build/development/shared/components/selectors/index.js.map +1 -1
  46. package/build/development/shared/utils/jest/index.js +4 -2
  47. package/build/development/shared/utils/jest/index.js.map +1 -1
  48. package/build/development/shared/utils/splitComponent.js +11 -12
  49. package/build/development/shared/utils/splitComponent.js.map +1 -1
  50. package/build/development/web.bundle.js +26 -36
  51. package/build/production/index.js +1 -1
  52. package/build/production/index.js.map +1 -1
  53. package/build/production/server/Cache.js +3 -3
  54. package/build/production/server/Cache.js.map +1 -1
  55. package/build/production/server/renderer.js +2 -2
  56. package/build/production/server/renderer.js.map +1 -1
  57. package/build/production/server/server.js +1 -1
  58. package/build/production/server/server.js.map +1 -1
  59. package/build/production/shared/components/Button/index.js +3 -3
  60. package/build/production/shared/components/Button/index.js.map +1 -1
  61. package/build/production/shared/components/Checkbox/index.js +1 -16
  62. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  63. package/build/production/shared/components/GenericLink/index.js +2 -2
  64. package/build/production/shared/components/GenericLink/index.js.map +1 -1
  65. package/build/production/shared/components/Input/index.js +2 -2
  66. package/build/production/shared/components/Input/index.js.map +1 -1
  67. package/build/production/shared/components/MetaTags.js +2 -2
  68. package/build/production/shared/components/MetaTags.js.map +1 -1
  69. package/build/production/shared/components/Modal/index.js +2 -2
  70. package/build/production/shared/components/Modal/index.js.map +1 -1
  71. package/build/production/shared/components/PageLayout/index.js +2 -2
  72. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  73. package/build/production/shared/components/TextArea/index.js +2 -2
  74. package/build/production/shared/components/TextArea/index.js.map +1 -1
  75. package/build/production/shared/components/Throbber/index.js +2 -2
  76. package/build/production/shared/components/Throbber/index.js.map +1 -1
  77. package/build/production/shared/components/WithTooltip/Tooltip.js +3 -3
  78. package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
  79. package/build/production/shared/components/WithTooltip/index.js +2 -2
  80. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  81. package/build/production/shared/components/YouTubeVideo/index.js +3 -3
  82. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  83. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +2 -2
  84. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  85. package/build/production/shared/components/selectors/CustomDropdown/index.js +2 -2
  86. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  87. package/build/production/shared/components/selectors/NativeDropdown/index.js +3 -3
  88. package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  89. package/build/production/shared/components/selectors/Switch/index.js +1 -1
  90. package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
  91. package/build/production/shared/components/selectors/common.js +2 -4
  92. package/build/production/shared/components/selectors/common.js.map +1 -1
  93. package/build/production/shared/components/selectors/index.js +1 -1
  94. package/build/production/shared/components/selectors/index.js.map +1 -1
  95. package/build/production/shared/utils/jest/index.js +1 -1
  96. package/build/production/shared/utils/jest/index.js.map +1 -1
  97. package/build/production/shared/utils/splitComponent.js +5 -5
  98. package/build/production/shared/utils/splitComponent.js.map +1 -1
  99. package/build/production/web.bundle.js +1 -1
  100. package/build/production/web.bundle.js.map +1 -1
  101. package/build/types-code/index.d.ts +1 -2
  102. package/build/types-code/server/Cache.d.ts +3 -11
  103. package/build/types-code/server/index.d.ts +0 -2
  104. package/build/types-code/server/renderer.d.ts +0 -1
  105. package/build/types-code/server/server.d.ts +0 -1
  106. package/build/types-code/shared/components/Button/index.d.ts +3 -4
  107. package/build/types-code/shared/components/Checkbox/index.d.ts +3 -12
  108. package/build/types-code/shared/components/Input/index.d.ts +4 -5
  109. package/build/types-code/shared/components/Link.d.ts +0 -1
  110. package/build/types-code/shared/components/Modal/index.d.ts +3 -4
  111. package/build/types-code/shared/components/NavLink.d.ts +0 -1
  112. package/build/types-code/shared/components/PageLayout/index.d.ts +4 -4
  113. package/build/types-code/shared/components/TextArea/index.d.ts +4 -5
  114. package/build/types-code/shared/components/Throbber/index.d.ts +4 -4
  115. package/build/types-code/shared/components/WithTooltip/Tooltip.d.ts +1 -1
  116. package/build/types-code/shared/components/WithTooltip/index.d.ts +2 -3
  117. package/build/types-code/shared/components/YouTubeVideo/index.d.ts +3 -4
  118. package/build/types-code/shared/components/selectors/CustomDropdown/Options/index.d.ts +1 -2
  119. package/build/types-code/shared/components/selectors/CustomDropdown/index.d.ts +2 -3
  120. package/build/types-code/shared/components/selectors/NativeDropdown/index.d.ts +2 -2
  121. package/build/types-code/shared/components/selectors/Switch/index.d.ts +4 -5
  122. package/build/types-code/shared/components/selectors/common.d.ts +4 -10
  123. package/build/types-code/shared/components/selectors/index.d.ts +1 -1
  124. package/build/types-code/shared/utils/globalState.d.ts +1 -2
  125. package/build/types-code/shared/utils/jest/index.d.ts +4 -1
  126. package/build/types-code/shared/utils/splitComponent.d.ts +0 -1
  127. package/build/types-code/shared/utils/webpack.d.ts +0 -1
  128. package/config/babel/node-ssr.js +1 -1
  129. package/config/babel/webpack.js +1 -1
  130. package/config/eslint/default.json +1 -0
  131. package/config/eslint/jest.json +1 -0
  132. package/config/eslint/typescript.js +7 -0
  133. package/config/typescript/base.json +9 -0
  134. package/config/webpack/app-base.d.ts +0 -1
  135. package/config/webpack/app-base.js +1 -1
  136. package/config/webpack/app-development.js +1 -1
  137. package/config/webpack/app-production.js +1 -1
  138. package/config/webpack/lib-base.js +1 -2
  139. package/config/webpack/lib-development.js +1 -1
  140. package/config/webpack/lib-production.js +1 -1
  141. package/package.json +16 -17
  142. package/src/index.ts +0 -1
  143. package/src/server/Cache.ts +31 -30
  144. package/src/server/renderer.tsx +8 -5
  145. package/src/server/server.ts +6 -1
  146. package/src/shared/components/Button/index.tsx +2 -20
  147. package/src/shared/components/Checkbox/index.tsx +2 -37
  148. package/src/shared/components/GenericLink/index.tsx +0 -15
  149. package/src/shared/components/Input/index.tsx +6 -15
  150. package/src/shared/components/MetaTags.tsx +0 -12
  151. package/src/shared/components/Modal/index.tsx +3 -22
  152. package/src/shared/components/PageLayout/index.tsx +8 -24
  153. package/src/shared/components/TextArea/index.tsx +6 -24
  154. package/src/shared/components/Throbber/index.tsx +6 -18
  155. package/src/shared/components/WithTooltip/Tooltip.tsx +6 -14
  156. package/src/shared/components/WithTooltip/index.tsx +3 -24
  157. package/src/shared/components/YouTubeVideo/index.tsx +3 -20
  158. package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +2 -20
  159. package/src/shared/components/selectors/CustomDropdown/index.tsx +3 -27
  160. package/src/shared/components/selectors/NativeDropdown/index.tsx +3 -27
  161. package/src/shared/components/selectors/Switch/index.tsx +34 -50
  162. package/src/shared/components/selectors/common.ts +12 -44
  163. package/src/shared/components/selectors/index.ts +0 -2
  164. package/src/shared/utils/jest/index.tsx +13 -2
  165. package/src/shared/utils/splitComponent.tsx +14 -11
  166. package/tsconfig.configs.json +7 -3
  167. package/tsconfig.json +3 -10
  168. package/tsconfig.types.json +1 -7
  169. package/tstyche.config.json +6 -0
@@ -1,9 +1,8 @@
1
1
  import 'styles/global.scss';
2
2
  import type ServerT from './server';
3
- declare const server: typeof ServerT | null;
3
+ declare const server: (typeof ServerT) | null;
4
4
  declare const client: any;
5
5
  export { default as api } from 'axios';
6
- export * as PT from 'prop-types';
7
6
  export { type AsyncCollectionLoaderT, type AsyncDataEnvelopeT, type AsyncDataLoaderT, type ForceT, type UseAsyncDataOptionsT, type UseAsyncDataResT, type UseGlobalStateResT, type ValueOrInitializerT, getGlobalState, GlobalStateProvider, newAsyncDataEnvelope, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType, } from '@dr.pogodin/react-global-state';
8
7
  export * from './shared/components';
9
8
  export { type Listener, type Theme, config, Barrier, Emitter, isomorphy, getSsrContext, Semaphore, splitComponent, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
@@ -2,17 +2,9 @@
2
2
  * Implements the static cache.
3
3
  */
4
4
  export default class Cache<DatumT> {
5
- private: {
6
- items: {
7
- [key: string]: {
8
- data: DatumT;
9
- size: number;
10
- timestamp: number;
11
- };
12
- };
13
- maxSize: number;
14
- size: number;
15
- };
5
+ private items;
6
+ private maxSize;
7
+ private size;
16
8
  constructor(maxSize: number);
17
9
  /**
18
10
  * Cache lookup.
@@ -1,5 +1,3 @@
1
- /// <reference types="express" />
2
- /// <reference types="node" />
3
1
  import 'source-map-support/register';
4
2
  import http from 'http';
5
3
  import 'raf/polyfill';
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * ExpressJS middleware for server-side rendering of a ReactJS app.
3
3
  */
4
- /// <reference types="cookie-parser" />
5
4
  import { type Request, type RequestHandler } from 'express';
6
5
  import { type ComponentType } from 'react';
7
6
  import winston from 'winston';
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Creation of standard ExpressJS server for ReactJS apps.
3
3
  */
4
- /// <reference types="cookie-parser" />
5
4
  import { type Express, type Request } from 'express';
6
5
  import { type HelmetOptions } from 'helmet';
7
6
  import { type Configuration } from 'webpack';
@@ -1,6 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["active", "button", "disabled"];
4
3
  type PropsT = {
5
4
  active?: boolean;
6
5
  children?: ReactNode;
@@ -10,7 +9,7 @@ type PropsT = {
10
9
  onMouseDown?: React.MouseEventHandler;
11
10
  openNewTab?: boolean;
12
11
  replace?: boolean;
13
- theme: Theme<typeof validThemeKeys>;
12
+ theme: Theme<'active' | 'button' | 'disabled'>;
14
13
  to?: object | string;
15
14
  };
16
15
  export declare const BaseButton: React.FunctionComponent<PropsT>;
@@ -21,5 +20,5 @@ export declare const BaseButton: React.FunctionComponent<PropsT>;
21
20
  * @prop {string} [button] to the root element of any button.
22
21
  * @prop {string} [disabled] to the root element of disabled button.
23
22
  */
24
- declare const ThemedButton: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
25
- export default ThemedButton;
23
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
24
+ export default _default;
@@ -1,18 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["checkbox", "container", "label"];
4
2
  type PropT = {
5
3
  checked?: boolean;
6
4
  label?: React.ReactNode;
7
5
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
8
- theme: Theme<typeof validThemeKeys>;
6
+ theme: Theme<'checkbox' | 'container' | 'label'>;
9
7
  };
10
- /**
11
- * Checkbox component theme: a map of
12
- * CSS classes to append to its elements:
13
- * @prop [checkbox] to the underlying checkbox `<input>` element.
14
- * @prop [container] to the root checkbox element.
15
- * @prop [label] to the checkbox label element.
16
- */
17
- declare const ThemedCheckbox: import("@dr.pogodin/react-themes").ThemedComponent<PropT>;
18
- export default ThemedCheckbox;
8
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropT>;
9
+ export default _default;
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["container", "input", "label"];
4
- declare const ThemedInput: import("@dr.pogodin/react-themes").ThemedComponent<React.InputHTMLAttributes<HTMLInputElement> & {
2
+ type ThemeKeyT = 'container' | 'input' | 'label';
3
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<React.InputHTMLAttributes<HTMLInputElement> & {
5
4
  label?: React.ReactNode;
6
- theme: Theme<typeof validThemeKeys>;
5
+ theme: Theme<ThemeKeyT>;
7
6
  } & React.RefAttributes<HTMLInputElement>>;
8
- export default ThemedInput;
7
+ export default _default;
@@ -5,7 +5,6 @@
5
5
  * - User opts to open the reference in a new tab;
6
6
  * - User explicitely opts to use <a>.
7
7
  */
8
- /// <reference types="react" />
9
8
  import { type PropsT as GenericLinkPropsT } from './GenericLink';
10
9
  type PropsT = Omit<GenericLinkPropsT, 'routerLinkType'>;
11
10
  declare const Link: React.FunctionComponent<PropsT>;
@@ -1,13 +1,12 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["container", "overlay"];
4
3
  type PropsT = {
5
4
  cancelOnScrolling?: boolean;
6
5
  children?: ReactNode;
7
6
  containerStyle?: React.CSSProperties;
8
7
  dontDisableScrolling?: boolean;
9
8
  onCancel?: () => void;
10
- theme: Theme<typeof validThemeKeys>;
9
+ theme: Theme<'container' | 'overlay'>;
11
10
  };
12
11
  /**
13
12
  * The `<Modal>` component implements a simple themeable modal window, wrapped
@@ -21,6 +20,6 @@ type PropsT = {
21
20
  * @param {ModalTheme} [props.theme] _Ad hoc_ theme.
22
21
  */
23
22
  declare const BaseModal: React.FunctionComponent<PropsT>;
24
- declare const ThemedModal: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
25
- export default ThemedModal;
23
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
24
+ export default _default;
26
25
  export { BaseModal };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PropsT as GenericLinkPropsT } from './GenericLink';
3
2
  type PropsT = Omit<GenericLinkPropsT, 'routerLinkType'>;
4
3
  declare const NavLink: React.FunctionComponent<PropsT>;
@@ -1,11 +1,11 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["container", "leftSidePanel", "mainPanel", "rightSidePanel", "sidePanel"];
3
+ type ThemeKeyT = 'container' | 'leftSidePanel' | 'mainPanel' | 'rightSidePanel' | 'sidePanel';
4
4
  type PropsT = {
5
5
  children?: ReactNode;
6
6
  leftSidePanelContent?: ReactNode;
7
7
  rightSidePanelContent?: ReactNode;
8
- theme: Theme<typeof validThemeKeys>;
8
+ theme: Theme<ThemeKeyT>;
9
9
  };
10
- declare const ThemedPageLayout: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
11
- export default ThemedPageLayout;
10
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
11
+ export default _default;
@@ -1,13 +1,12 @@
1
- /// <reference types="react" />
2
1
  import { type Theme } from '@dr.pogodin/react-themes';
3
- declare const validThemeKeys: readonly ["container", "hidden", "textarea"];
2
+ type ThemeKeyT = 'container' | 'hidden' | 'textarea';
4
3
  type Props = {
5
4
  disabled?: boolean;
6
5
  onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
7
6
  onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
8
7
  placeholder?: string;
9
- theme: Theme<typeof validThemeKeys>;
8
+ theme: Theme<ThemeKeyT>;
10
9
  value?: string;
11
10
  };
12
- declare const ThemedTextArea: import("@dr.pogodin/react-themes").ThemedComponent<Props>;
13
- export default ThemedTextArea;
11
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<Props>;
12
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import { type Theme } from '@dr.pogodin/react-themes';
2
- declare const validThemeKeys: readonly ["bouncing", "circle", "container"];
2
+ type ThemeKeyT = 'bouncing' | 'circle' | 'container';
3
3
  type PropsT = {
4
- theme: Theme<typeof validThemeKeys>;
4
+ theme: Theme<ThemeKeyT>;
5
5
  };
6
- declare const ThemedThrobber: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
7
- export default ThemedThrobber;
6
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
7
+ export default _default;
@@ -10,7 +10,7 @@ export declare enum PLACEMENTS {
10
10
  BELOW_CURSOR = "BELOW_CURSOR",
11
11
  BELOW_ELEMENT = "BELOW_ELEMENT"
12
12
  }
13
- export declare const validThemeKeys: readonly ["appearance", "arrow", "content", "container"];
13
+ export type ThemeKeysT = 'appearance' | 'arrow' | 'content' | 'container';
14
14
  declare const Tooltip: React.ForwardRefExoticComponent<{
15
15
  children?: ReactNode;
16
16
  theme: any;
@@ -1,12 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
- import { PLACEMENTS } from './Tooltip';
4
- declare const validThemeKeys: readonly ["appearance", "arrow", "content", "container", "wrapper"];
3
+ import { type ThemeKeysT as TooltipThemeKeysT, PLACEMENTS } from './Tooltip';
5
4
  type PropsT = {
6
5
  children?: ReactNode;
7
6
  placement?: PLACEMENTS;
8
7
  tip?: ReactNode;
9
- theme: Theme<typeof validThemeKeys>;
8
+ theme: Theme<'wrapper' | TooltipThemeKeysT>;
10
9
  };
11
10
  declare const ThemedWrapper: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
12
11
  type ExportT = typeof ThemedWrapper & {
@@ -1,11 +1,10 @@
1
1
  import { type Theme } from '@dr.pogodin/react-themes';
2
- declare const validThemeKeys: readonly ["container", "video"];
3
- type ComponentThemeT = Theme<typeof validThemeKeys>;
2
+ type ComponentThemeT = Theme<'container' | 'video'>;
4
3
  type PropsT = {
5
4
  autoplay?: boolean;
6
5
  src: string;
7
6
  theme: ComponentThemeT;
8
7
  title?: string;
9
8
  };
10
- declare const ThemedYouTubeVideo: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
11
- export default ThemedYouTubeVideo;
9
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
10
+ export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type OptionT, type OptionsT, type ValueT } from '../../common';
3
2
  export type ContainerPosT = {
4
3
  left: number;
@@ -14,7 +13,7 @@ type PropsT = {
14
13
  containerStyle?: ContainerPosT;
15
14
  filter?: (item: OptionT<React.ReactNode> | ValueT) => boolean;
16
15
  optionClass: string;
17
- options: OptionsT<React.ReactNode>;
16
+ options: Readonly<OptionsT<React.ReactNode>>;
18
17
  onCancel: () => void;
19
18
  onChange: (value: ValueT) => void;
20
19
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PropsT, type ValueT } from '../common';
3
- declare const ThemedCustomDropdown: import("@dr.pogodin/react-themes").ThemedComponent<PropsT<React.ReactNode, (value: ValueT) => void>>;
4
- export default ThemedCustomDropdown;
2
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT<React.ReactNode, (value: ValueT) => void>>;
3
+ export default _default;
@@ -1,3 +1,3 @@
1
1
  import { type PropsT } from '../common';
2
- declare const ThemedDropdown: import("@dr.pogodin/react-themes").ThemedComponent<PropsT<string>>;
3
- export default ThemedDropdown;
2
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT<string>>;
3
+ export default _default;
@@ -1,13 +1,12 @@
1
- /// <reference types="react" />
2
1
  import { type Theme } from '@dr.pogodin/react-themes';
3
2
  import { type OptionsT, type ValueT } from '../common';
4
- declare const validThemeKeys: readonly ["container", "label", "option", "options", "selected"];
3
+ type ThemeKeyT = 'container' | 'label' | 'option' | 'options' | 'selected';
5
4
  type PropsT = {
6
5
  label?: React.ReactNode;
7
6
  onChange?: (value: ValueT) => void;
8
7
  options?: Readonly<OptionsT<React.ReactNode>>;
9
- theme: Theme<typeof validThemeKeys>;
8
+ theme: Theme<ThemeKeyT>;
10
9
  value?: ValueT;
11
10
  };
12
- declare const ThemedSwitch: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
13
- export default ThemedSwitch;
11
+ declare const _default: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
12
+ export default _default;
@@ -1,9 +1,6 @@
1
- /// <reference types="react" />
2
- import PT from 'prop-types';
3
1
  import type { Theme } from '@dr.pogodin/react-themes';
4
- export declare const validThemeKeys: readonly ["active", "arrow", "container", "dropdown", "hiddenOption", "label", "option", "select", "upward"];
2
+ type ThemeKeyT = 'active' | 'arrow' | 'container' | 'dropdown' | 'hiddenOption' | 'label' | 'option' | 'select' | 'upward';
5
3
  export type ValueT = number | string;
6
- export declare const valueValidator: PT.Requireable<ValueT>;
7
4
  export type OptionT<NameT> = {
8
5
  name?: NameT | null;
9
6
  value: ValueT;
@@ -13,13 +10,10 @@ export type PropsT<NameT, OnChangeT = React.ChangeEventHandler<HTMLSelectElement
13
10
  filter?: (item: OptionT<NameT> | ValueT) => boolean;
14
11
  label?: React.ReactNode;
15
12
  onChange?: OnChangeT;
16
- options?: OptionsT<NameT>;
17
- theme: Theme<typeof validThemeKeys>;
13
+ options?: Readonly<OptionsT<NameT>>;
14
+ theme: Theme<ThemeKeyT>;
18
15
  value?: ValueT;
19
16
  };
20
- export declare const optionValidator: PT.Requireable<OptionT<React.ReactNode> | ValueT>;
21
- export declare const optionsValidator: PT.Requireable<NonNullable<ValueT | OptionT<React.ReactNode>>[]>;
22
- export declare const stringOptionValidator: PT.Requireable<OptionT<string> | ValueT>;
23
- export declare const stringOptionsValidator: PT.Requireable<NonNullable<ValueT | OptionT<string>>[]>;
24
17
  /** Returns option value and name as a tuple. */
25
18
  export declare function optionValueName<NameT>(option: OptionT<NameT> | ValueT): [ValueT, NameT | ValueT];
19
+ export {};
@@ -1,4 +1,4 @@
1
1
  export { default as CustomDropdown } from './CustomDropdown';
2
2
  export { default as Dropdown } from './NativeDropdown';
3
3
  export { default as Switch } from './Switch';
4
- export { type OptionT, type OptionsT, optionValidator, optionsValidator, } from './common';
4
+ export { type OptionT, type OptionsT, } from './common';
@@ -1,4 +1,3 @@
1
- /// <reference types="cookie-parser" />
2
1
  import type { Request } from 'express';
3
2
  import { type SsrContext } from '@dr.pogodin/react-global-state';
4
3
  export type ChunkGroupsT = {
@@ -22,5 +21,5 @@ export interface SsrContextT<StateT> extends SsrContext<StateT> {
22
21
  req: Request;
23
22
  status: number;
24
23
  }
25
- declare const getSsrContext: (throwWithoutSsrContext?: boolean | undefined) => SsrContextT<unknown> | undefined;
24
+ declare const getSsrContext: (throwWithoutSsrContext?: boolean) => SsrContextT<unknown> | undefined;
26
25
  export { getSsrContext, };
@@ -42,4 +42,7 @@ export type MountedSceneT = HTMLElement & {
42
42
  * attached.
43
43
  */
44
44
  export declare function mount(scene: ReactNode): MountedSceneT;
45
- export declare function snapshot(element: React.ReactElement): RenderResult;
45
+ type SnapshotOptionsT = {
46
+ await?: Promise<void>;
47
+ };
48
+ export declare function snapshot(element: React.ReactElement, options?: SnapshotOptionsT): Promise<RenderResult>;
@@ -1,4 +1,3 @@
1
- /// <reference types="trusted-types" />
2
1
  import { type ComponentType, type ReactNode } from 'react';
3
2
  import { type ChunkGroupsT } from './globalState';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * Requires the specified module without including it into the bundle during
4
3
  * Webpack build.
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  return result;
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.default = getConfig;
27
28
  const lodash_1 = require("lodash");
28
29
  const webpack_1 = __importStar(require("./webpack"));
29
30
  /**
@@ -88,4 +89,3 @@ function getConfig(babel, ops = {}) {
88
89
  addStyling(config);
89
90
  return config;
90
91
  }
91
- exports.default = getConfig;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENVIRONMENTS = void 0;
4
+ exports.default = getPreset;
4
5
  const { generateScopedNameFactory, } = require('@dr.pogodin/babel-plugin-react-css-modules/utils');
5
6
  const generateScopedNameDev = generateScopedNameFactory('[package]___[path][name]___[local]___[hash:base64:6]');
6
7
  const generateScopedNameProd = generateScopedNameFactory('[hash:base64:6]');
@@ -104,4 +105,3 @@ function getPreset(babel, ops = {}) {
104
105
  }
105
106
  return res;
106
107
  }
107
- exports.default = getPreset;
@@ -18,6 +18,7 @@
18
18
  "react/no-unknown-property": ["error", {
19
19
  "ignore": ["styleName"]
20
20
  }],
21
+ "react/prop-types": "off",
21
22
  "react/react-in-jsx-scope": 0,
22
23
  "react/require-default-props": 0
23
24
  },
@@ -13,6 +13,7 @@
13
13
  "import/no-extraneous-dependencies": 0,
14
14
  "no-console": 0,
15
15
  "no-new-func": 0,
16
+ "react/prop-types": "off",
16
17
  "react/require-default-props": 0
17
18
  }
18
19
  }
@@ -24,6 +24,13 @@ module.exports = {
24
24
  'react/no-unknown-property': ['error', {
25
25
  ignore: ['styleName'],
26
26
  }],
27
+
28
+ // TODO: propTypes checks will be silently ignored starting with React v19:
29
+ // https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops
30
+ // The rule is still enabled in the base ESLint configs, thus for now we
31
+ // override it here.
32
+ 'react/prop-types': 'off',
33
+
27
34
  'react/react-in-jsx-scope': 0,
28
35
 
29
36
  // TODO: .defaultProps will be deprecated in React@19.
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@tsconfig/recommended/tsconfig.json",
4
+ "compilerOptions": {
5
+ "jsx": "react-jsx",
6
+ "noUncheckedIndexedAccess": true,
7
+ "verbatimModuleSyntax": true
8
+ }
9
+ }
@@ -4,7 +4,6 @@
4
4
  * @desc
5
5
  * Base [Webpack](https://webpack.js.org/) configuration for apps.
6
6
  */
7
- /// <reference types="node" />
8
7
  import nodeFs from 'fs';
9
8
  import { type Configuration } from 'webpack';
10
9
  export type BuildInfoT = {
@@ -9,6 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.default = configFactory;
12
13
  const fs_1 = __importDefault(require("fs"));
13
14
  const path_1 = __importDefault(require("path"));
14
15
  const sitemap_1 = __importDefault(require("sitemap"));
@@ -316,4 +317,3 @@ function configFactory(ops) {
316
317
  },
317
318
  };
318
319
  }
319
- exports.default = configFactory;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = configFactory;
6
7
  /**
7
8
  * @category Configs
8
9
  * @module webpack/app-development
@@ -63,4 +64,3 @@ function configFactory(ops) {
63
64
  });
64
65
  return res;
65
66
  }
66
- exports.default = configFactory;
@@ -8,6 +8,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.default = configFactory;
11
12
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
12
13
  const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
13
14
  const webpack_1 = __importDefault(require("webpack"));
@@ -51,4 +52,3 @@ function configFactory(ops) {
51
52
  });
52
53
  return res;
53
54
  }
54
- exports.default = configFactory;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = configFactory;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const autoprefixer_1 = __importDefault(require("autoprefixer"));
9
10
  const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
@@ -34,7 +35,6 @@ function configFactory(ops) {
34
35
  'dayjs',
35
36
  'lodash',
36
37
  /node-forge/,
37
- 'prop-types',
38
38
  'qs',
39
39
  'react',
40
40
  /react-dom/,
@@ -157,4 +157,3 @@ function configFactory(ops) {
157
157
  },
158
158
  };
159
159
  }
160
- exports.default = configFactory;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = configFactory;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const webpack_1 = __importDefault(require("webpack"));
9
10
  const webpack_merge_1 = require("webpack-merge");
@@ -31,4 +32,3 @@ function configFactory(ops) {
31
32
  },
32
33
  });
33
34
  }
34
- exports.default = configFactory;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = configFactory;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
9
10
  const webpack_1 = __importDefault(require("webpack"));
@@ -38,4 +39,3 @@ function configFactory(ops) {
38
39
  ],
39
40
  });
40
41
  }
41
- exports.default = configFactory;