@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.
Files changed (103) hide show
  1. package/build/development/client/index.js +3 -0
  2. package/build/development/client/index.js.map +1 -1
  3. package/build/development/index.js +36 -84
  4. package/build/development/index.js.map +1 -1
  5. package/build/development/server/renderer.js +3 -1
  6. package/build/development/server/renderer.js.map +1 -1
  7. package/build/development/shared/components/Button/index.js +2 -1
  8. package/build/development/shared/components/Button/index.js.map +1 -1
  9. package/build/development/shared/components/Checkbox/index.js +2 -1
  10. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  11. package/build/development/shared/components/Dropdown/index.js +14 -9
  12. package/build/development/shared/components/Dropdown/index.js.map +1 -1
  13. package/build/development/shared/components/Input/index.js +2 -1
  14. package/build/development/shared/components/Input/index.js.map +1 -1
  15. package/build/development/shared/components/Modal/index.js +2 -1
  16. package/build/development/shared/components/Modal/index.js.map +1 -1
  17. package/build/development/shared/components/PageLayout/index.js +2 -1
  18. package/build/development/shared/components/PageLayout/index.js.map +1 -1
  19. package/build/development/shared/components/TextArea/index.js +94 -0
  20. package/build/development/shared/components/TextArea/index.js.map +1 -0
  21. package/build/development/shared/components/Throbber/index.js +2 -1
  22. package/build/development/shared/components/Throbber/index.js.map +1 -1
  23. package/build/development/shared/components/WithTooltip/Tooltip.js +2 -1
  24. package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
  25. package/build/development/shared/components/WithTooltip/index.js +1 -0
  26. package/build/development/shared/components/WithTooltip/index.js.map +1 -1
  27. package/build/development/shared/components/YouTubeVideo/index.js +2 -1
  28. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  29. package/build/development/shared/components/index.js +7 -0
  30. package/build/development/shared/components/index.js.map +1 -1
  31. package/build/development/shared/utils/jest/E2eSsrEnv.js +2 -0
  32. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  33. package/build/development/shared/utils/jest/index.js +2 -0
  34. package/build/development/shared/utils/jest/index.js.map +1 -1
  35. package/build/development/style.css +89 -0
  36. package/build/development/web.bundle.js +37 -17
  37. package/build/production/client/index.js +1 -1
  38. package/build/production/client/index.js.map +1 -1
  39. package/build/production/index.js +1 -1
  40. package/build/production/index.js.map +1 -1
  41. package/build/production/server/renderer.js +1 -1
  42. package/build/production/server/renderer.js.map +1 -1
  43. package/build/production/shared/components/Button/index.js +2 -2
  44. package/build/production/shared/components/Button/index.js.map +1 -1
  45. package/build/production/shared/components/Checkbox/index.js +2 -2
  46. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  47. package/build/production/shared/components/Dropdown/index.js +2 -2
  48. package/build/production/shared/components/Dropdown/index.js.map +1 -1
  49. package/build/production/shared/components/Input/index.js +2 -2
  50. package/build/production/shared/components/Input/index.js.map +1 -1
  51. package/build/production/shared/components/Modal/index.js +2 -2
  52. package/build/production/shared/components/Modal/index.js.map +1 -1
  53. package/build/production/shared/components/PageLayout/index.js +2 -2
  54. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  55. package/build/production/shared/components/TextArea/index.js +10 -0
  56. package/build/production/shared/components/TextArea/index.js.map +1 -0
  57. package/build/production/shared/components/Throbber/index.js +2 -2
  58. package/build/production/shared/components/Throbber/index.js.map +1 -1
  59. package/build/production/shared/components/WithTooltip/Tooltip.js +2 -2
  60. package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
  61. package/build/production/shared/components/WithTooltip/index.js +1 -1
  62. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  63. package/build/production/shared/components/YouTubeVideo/index.js +2 -2
  64. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  65. package/build/production/shared/components/index.js +1 -1
  66. package/build/production/shared/components/index.js.map +1 -1
  67. package/build/production/style.css +1 -1
  68. package/build/production/style.css.map +1 -1
  69. package/build/production/web.bundle.js +1 -1
  70. package/build/production/web.bundle.js.map +1 -1
  71. package/build/types-code/index.d.ts +1 -1
  72. package/build/types-code/shared/components/Button/index.d.ts +2 -5
  73. package/build/types-code/shared/components/Checkbox/index.d.ts +2 -5
  74. package/build/types-code/shared/components/Dropdown/index.d.ts +2 -8
  75. package/build/types-code/shared/components/Input/index.d.ts +2 -5
  76. package/build/types-code/shared/components/Modal/index.d.ts +2 -4
  77. package/build/types-code/shared/components/PageLayout/index.d.ts +2 -7
  78. package/build/types-code/shared/components/TextArea/index.d.ts +12 -0
  79. package/build/types-code/shared/components/Throbber/index.d.ts +2 -5
  80. package/build/types-code/shared/components/WithTooltip/Tooltip.d.ts +1 -6
  81. package/build/types-code/shared/components/WithTooltip/index.d.ts +3 -4
  82. package/build/types-code/shared/components/YouTubeVideo/index.d.ts +2 -4
  83. package/build/types-code/shared/components/index.d.ts +1 -0
  84. package/build/types-scss/src/shared/components/Dropdown/theme.scss.d.ts +1 -0
  85. package/build/types-scss/src/shared/components/TextArea/style.scss.d.ts +6 -0
  86. package/package.json +37 -37
  87. package/src/client/index.tsx +1 -1
  88. package/src/index.ts +1 -16
  89. package/src/server/renderer.tsx +4 -1
  90. package/src/shared/components/Button/index.tsx +4 -10
  91. package/src/shared/components/Checkbox/index.tsx +9 -10
  92. package/src/shared/components/Dropdown/index.tsx +28 -25
  93. package/src/shared/components/Dropdown/theme.scss +6 -0
  94. package/src/shared/components/Input/index.tsx +8 -10
  95. package/src/shared/components/Modal/index.tsx +4 -8
  96. package/src/shared/components/PageLayout/index.tsx +15 -14
  97. package/src/shared/components/TextArea/index.tsx +107 -0
  98. package/src/shared/components/TextArea/style.scss +37 -0
  99. package/src/shared/components/Throbber/index.tsx +8 -10
  100. package/src/shared/components/WithTooltip/Tooltip.tsx +10 -6
  101. package/src/shared/components/WithTooltip/index.tsx +7 -4
  102. package/src/shared/components/YouTubeVideo/index.tsx +4 -8
  103. package/src/shared/components/index.ts +2 -0
@@ -5,6 +5,6 @@ declare const client: any;
5
5
  export { default as api } from 'axios';
6
6
  export * as PT from 'prop-types';
7
7
  export { type AsyncCollectionLoaderT, type AsyncDataEnvelopeT, type AsyncDataLoaderT, type ForceT, type UseAsyncDataOptionsT, type UseAsyncDataResT, type UseGlobalStateResT, type ValueOrInitializerT, getGlobalState, GlobalStateProvider, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType, } from '@dr.pogodin/react-global-state';
8
- export { BaseModal, Button, Checkbox, Dropdown, Input, Link, PageLayout, MetaTags, Modal, NavLink, ScalableRect, Throbber, WithTooltip, YouTubeVideo, } from './shared/components';
8
+ export * from './shared/components';
9
9
  export { type Theme, config, Barrier, Emitter, isomorphy, getSsrContext, JU, Semaphore, splitComponent, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
10
10
  export { client, server };
@@ -1,5 +1,6 @@
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"];
3
4
  type PropsT = {
4
5
  active?: boolean;
5
6
  children?: ReactNode;
@@ -9,11 +10,7 @@ type PropsT = {
9
10
  onMouseDown?: React.MouseEventHandler;
10
11
  openNewTab?: boolean;
11
12
  replace?: boolean;
12
- theme: Theme & {
13
- active?: string;
14
- button?: string;
15
- disabled?: string;
16
- };
13
+ theme: Theme<typeof validThemeKeys>;
17
14
  to?: object | string;
18
15
  };
19
16
  /**
@@ -1,14 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
+ declare const validThemeKeys: readonly ["checkbox", "container", "label"];
3
4
  type PropT = {
4
5
  checked?: boolean;
5
6
  label?: string;
6
7
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
7
- theme: Theme & {
8
- checkbox?: string;
9
- container?: string;
10
- label?: string;
11
- };
8
+ theme: Theme<typeof validThemeKeys>;
12
9
  };
13
10
  /**
14
11
  * Checkbox component theme: a map of
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
+ declare const validThemeKeys: readonly ["arrow", "container", "dropdown", "hiddenOption", "label", "option", "select"];
3
4
  type DropdownOptionT = {
4
5
  name?: string | null;
5
6
  value: string;
@@ -9,14 +10,7 @@ type PropsT = {
9
10
  label?: string;
10
11
  onChange?: React.ChangeEventHandler<HTMLSelectElement>;
11
12
  options?: Array<DropdownOptionT | string>;
12
- theme: Theme & {
13
- arrow?: string;
14
- container?: string;
15
- hiddenOption?: string;
16
- label?: string;
17
- option?: string;
18
- select?: string;
19
- };
13
+ theme: Theme<typeof validThemeKeys>;
20
14
  value?: string;
21
15
  };
22
16
  declare const ThemedDropdown: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
@@ -1,11 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
+ declare const validThemeKeys: readonly ["container", "input", "label"];
3
4
  declare const ThemedInput: import("@dr.pogodin/react-themes").ThemedComponent<React.InputHTMLAttributes<HTMLInputElement> & {
4
5
  label?: string | undefined;
5
- theme: Theme & {
6
- container?: string;
7
- input?: string;
8
- label?: string;
9
- };
6
+ theme: Theme<typeof validThemeKeys>;
10
7
  } & React.RefAttributes<HTMLInputElement>>;
11
8
  export default ThemedInput;
@@ -1,13 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
3
  import './styles.scss';
4
+ declare const validThemeKeys: readonly ["container", "overlay"];
4
5
  type PropsT = {
5
6
  children?: ReactNode;
6
7
  onCancel?: () => void;
7
- theme: Theme & {
8
- container?: string;
9
- overlay?: string;
10
- };
8
+ theme: Theme<typeof validThemeKeys>;
11
9
  };
12
10
  /**
13
11
  * The `<Modal>` component implements a simple themeable modal window, wrapped
@@ -1,16 +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
4
  type PropsT = {
4
5
  children?: ReactNode;
5
6
  leftSidePanelContent?: ReactNode;
6
7
  rightSidePanelContent?: ReactNode;
7
- theme: Theme & {
8
- container?: string;
9
- mainPanel?: string;
10
- sidePanel?: string;
11
- leftSidePanel?: string;
12
- rightSidePanel?: string;
13
- };
8
+ theme: Theme<typeof validThemeKeys>;
14
9
  };
15
10
  declare const ThemedPageLayout: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
16
11
  export default ThemedPageLayout;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { type Theme } from '@dr.pogodin/react-themes';
3
+ declare const validThemeKeys: readonly ["container", "hidden", "textarea"];
4
+ type Props = {
5
+ onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
6
+ onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
7
+ placeholder?: string;
8
+ theme: Theme<typeof validThemeKeys>;
9
+ value?: string;
10
+ };
11
+ declare const ThemedTextArea: import("@dr.pogodin/react-themes").ThemedComponent<Props>;
12
+ export default ThemedTextArea;
@@ -1,10 +1,7 @@
1
1
  import { type Theme } from '@dr.pogodin/react-themes';
2
+ declare const validThemeKeys: readonly ["bouncing", "circle", "container"];
2
3
  type PropsT = {
3
- theme: Theme & {
4
- bouncing?: string;
5
- container?: string;
6
- circle?: string;
7
- };
4
+ theme: Theme<typeof validThemeKeys>;
8
5
  };
9
6
  declare const ThemedThrobber: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
10
7
  export default ThemedThrobber;
@@ -10,12 +10,7 @@ export declare enum PLACEMENTS {
10
10
  BELOW_CURSOR = "BELOW_CURSOR",
11
11
  BELOW_ELEMENT = "BELOW_ELEMENT"
12
12
  }
13
- export interface TooltipThemeT {
14
- appearance?: string;
15
- arrow?: string;
16
- content?: string;
17
- container?: string;
18
- }
13
+ export declare const validThemeKeys: readonly ["appearance", "arrow", "content", "container"];
19
14
  declare const Tooltip: React.ForwardRefExoticComponent<{
20
15
  children?: ReactNode;
21
16
  theme: any;
@@ -1,13 +1,12 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
- import { PLACEMENTS, type TooltipThemeT } from './Tooltip';
3
+ import { PLACEMENTS } from './Tooltip';
4
+ declare const validThemeKeys: readonly ["appearance", "arrow", "content", "container", "wrapper"];
4
5
  type PropsT = {
5
6
  children?: ReactNode;
6
7
  placement?: PLACEMENTS;
7
8
  tip?: ReactNode;
8
- theme: Theme & TooltipThemeT & {
9
- wrapper?: string;
10
- };
9
+ theme: Theme<typeof validThemeKeys>;
11
10
  };
12
11
  declare const ThemedWrapper: import("@dr.pogodin/react-themes").ThemedComponent<PropsT>;
13
12
  type ExportT = typeof ThemedWrapper & {
@@ -1,8 +1,6 @@
1
1
  import { type Theme } from '@dr.pogodin/react-themes';
2
- type ComponentThemeT = Theme & {
3
- container?: string;
4
- video?: string;
5
- };
2
+ declare const validThemeKeys: readonly ["container", "video"];
3
+ type ComponentThemeT = Theme<typeof validThemeKeys>;
6
4
  type PropsT = {
7
5
  autoplay?: boolean;
8
6
  src: string;
@@ -14,3 +14,4 @@ export { default as ScalableRect } from './ScalableRect';
14
14
  export { default as Throbber } from './Throbber';
15
15
  export { default as WithTooltip } from './WithTooltip';
16
16
  export { default as YouTubeVideo } from './YouTubeVideo';
17
+ export { default as TextArea } from './TextArea';
@@ -2,6 +2,7 @@ export declare const ad: string;
2
2
  export declare const arrow: string;
3
3
  export declare const container: string;
4
4
  export declare const context: string;
5
+ export declare const dropdown: string;
5
6
  export declare const hiddenOption: string;
6
7
  export declare const hoc: string;
7
8
  export declare const label: string;
@@ -0,0 +1,6 @@
1
+ export declare const ad: string;
2
+ export declare const container: string;
3
+ export declare const context: string;
4
+ export declare const hidden: string;
5
+ export declare const hoc: string;
6
+ export declare const textarea: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.0",
2
+ "version": "1.29.0",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"
@@ -8,17 +8,17 @@
8
8
  "url": "https://github.com/birdofpreyru/react-utils/issues"
9
9
  },
10
10
  "dependencies": {
11
- "@babel/runtime": "^7.23.4",
11
+ "@babel/runtime": "^7.23.8",
12
12
  "@dr.pogodin/babel-plugin-react-css-modules": "^6.12.0",
13
13
  "@dr.pogodin/csurf": "^1.13.0",
14
14
  "@dr.pogodin/js-utils": "^0.0.6",
15
- "@dr.pogodin/react-global-state": "^0.11.0",
16
- "@dr.pogodin/react-themes": "^1.5.1",
15
+ "@dr.pogodin/react-global-state": "^0.12.0",
16
+ "@dr.pogodin/react-themes": "^1.6.0",
17
17
  "@jest/environment": "^29.7.0",
18
- "axios": "^1.6.2",
18
+ "axios": "^1.6.5",
19
19
  "commander": "^11.1.0",
20
20
  "compression": "^1.7.4",
21
- "config": "^3.3.9",
21
+ "config": "^3.3.10",
22
22
  "cookie": "^0.6.0",
23
23
  "cookie-parser": "^1.4.6",
24
24
  "cross-env": "^7.0.3",
@@ -36,10 +36,10 @@
36
36
  "react": "^18.2.0",
37
37
  "react-dom": "^18.2.0",
38
38
  "react-helmet": "^6.1.0",
39
- "react-router-dom": "^6.20.0",
39
+ "react-router-dom": "^6.21.1",
40
40
  "request-ip": "^3.3.0",
41
41
  "rimraf": "^5.0.5",
42
- "serialize-javascript": "^6.0.1",
42
+ "serialize-javascript": "^6.0.2",
43
43
  "serve-favicon": "^2.5.0",
44
44
  "source-map-support": "^0.5.21",
45
45
  "uuid": "^9.0.1",
@@ -48,56 +48,56 @@
48
48
  "description": "Collection of generic ReactJS components and utils",
49
49
  "devDependencies": {
50
50
  "@babel/cli": "^7.23.4",
51
- "@babel/core": "^7.23.3",
51
+ "@babel/core": "^7.23.7",
52
52
  "@babel/eslint-parser": "^7.23.3",
53
- "@babel/eslint-plugin": "^7.22.10",
53
+ "@babel/eslint-plugin": "^7.23.5",
54
54
  "@babel/node": "^7.22.19",
55
- "@babel/plugin-transform-runtime": "^7.23.4",
56
- "@babel/preset-env": "^7.23.3",
55
+ "@babel/plugin-transform-runtime": "^7.23.7",
56
+ "@babel/preset-env": "^7.23.8",
57
57
  "@babel/preset-react": "^7.23.3",
58
58
  "@babel/preset-typescript": "^7.23.3",
59
- "@babel/register": "^7.22.15",
59
+ "@babel/register": "^7.23.7",
60
60
  "@dr.pogodin/babel-plugin-transform-assets": "^1.2.2",
61
61
  "@dr.pogodin/babel-preset-svgr": "^1.8.0",
62
62
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
63
63
  "@tsconfig/recommended": "^1.0.3",
64
- "@tsd/typescript": "^5.3.2",
64
+ "@tsd/typescript": "^5.3.3",
65
65
  "@types/compression": "^1.7.5",
66
66
  "@types/config": "^3.3.3",
67
67
  "@types/cookie": "^0.6.0",
68
68
  "@types/cookie-parser": "^1.4.6",
69
69
  "@types/csurf": "^1.11.5",
70
70
  "@types/express": "^4.17.21",
71
- "@types/jest": "^29.5.10",
71
+ "@types/jest": "^29.5.11",
72
72
  "@types/lodash": "^4.14.202",
73
73
  "@types/morgan": "^1.9.9",
74
- "@types/node-forge": "^1.3.10",
74
+ "@types/node-forge": "^1.3.11",
75
75
  "@types/pretty": "^2.0.3",
76
- "@types/react": "^18.2.39",
77
- "@types/react-dom": "^18.2.17",
78
- "@types/react-helmet": "^6.1.9",
76
+ "@types/react": "^18.2.47",
77
+ "@types/react-dom": "^18.2.18",
78
+ "@types/react-helmet": "^6.1.11",
79
79
  "@types/react-test-renderer": "^18.0.7",
80
80
  "@types/request-ip": "^0.0.41",
81
81
  "@types/serialize-javascript": "^5.0.4",
82
82
  "@types/serve-favicon": "^2.5.7",
83
- "@types/supertest": "^2.0.16",
83
+ "@types/supertest": "^6.0.2",
84
84
  "@types/uuid": "^9.0.7",
85
85
  "@types/webpack": "^5.28.5",
86
- "@typescript-eslint/eslint-plugin": "^6.13.0",
87
- "@typescript-eslint/parser": "^6.13.0",
86
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
87
+ "@typescript-eslint/parser": "^6.18.1",
88
88
  "autoprefixer": "^10.4.16",
89
89
  "babel-jest": "^29.7.0",
90
90
  "babel-loader": "^9.1.3",
91
91
  "babel-plugin-module-resolver": "^5.0.0",
92
- "core-js": "^3.33.3",
93
- "css-loader": "^6.8.1",
92
+ "core-js": "^3.35.0",
93
+ "css-loader": "^6.9.0",
94
94
  "css-minimizer-webpack-plugin": "^5.0.1",
95
- "eslint": "^8.54.0",
95
+ "eslint": "^8.56.0",
96
96
  "eslint-config-airbnb": "^19.0.4",
97
97
  "eslint-config-airbnb-typescript": "^17.1.0",
98
98
  "eslint-import-resolver-babel-module": "^5.3.2",
99
- "eslint-plugin-import": "^2.29.0",
100
- "eslint-plugin-jest": "^27.6.0",
99
+ "eslint-plugin-import": "^2.29.1",
100
+ "eslint-plugin-jest": "^27.6.2",
101
101
  "eslint-plugin-jsx-a11y": "^6.8.0",
102
102
  "eslint-plugin-react": "^7.33.2",
103
103
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -108,26 +108,26 @@
108
108
  "mini-css-extract-plugin": "^2.7.6",
109
109
  "mockdate": "^3.0.5",
110
110
  "nodelist-foreach-polyfill": "^1.2.0",
111
- "postcss": "^8.4.31",
112
- "postcss-loader": "^7.3.3",
111
+ "postcss": "^8.4.33",
112
+ "postcss-loader": "^7.3.4",
113
113
  "postcss-scss": "^4.0.9",
114
114
  "pretty": "^2.0.0",
115
115
  "react-refresh": "^0.14.0",
116
116
  "react-test-renderer": "^18.2.0",
117
- "regenerator-runtime": "^0.14.0",
117
+ "regenerator-runtime": "^0.14.1",
118
118
  "resolve-url-loader": "^5.0.0",
119
- "sass": "^1.69.5",
120
- "sass-loader": "^13.3.2",
119
+ "sass": "^1.69.7",
120
+ "sass-loader": "^13.3.3",
121
121
  "sitemap": "^7.1.1",
122
- "stylelint": "^15.11.0",
123
- "stylelint-config-standard-scss": "^11.1.0",
122
+ "stylelint": "^16.1.0",
123
+ "stylelint-config-standard-scss": "^13.0.0",
124
124
  "supertest": "^6.3.3",
125
125
  "tsc-alias": "^1.8.8",
126
126
  "typed-scss-modules": "^8.0.0",
127
- "typescript": "^5.3.2",
127
+ "typescript": "^5.3.3",
128
128
  "webpack": "^5.89.0",
129
- "webpack-dev-middleware": "^6.1.1",
130
- "webpack-hot-middleware": "^2.25.4",
129
+ "webpack-dev-middleware": "^7.0.0",
130
+ "webpack-hot-middleware": "^2.26.0",
131
131
  "webpack-merge": "^5.10.0",
132
132
  "workbox-core": "^7.0.0",
133
133
  "workbox-precaching": "^7.0.0",
@@ -27,7 +27,7 @@ export default function Launch(
27
27
  if (!container) throw Error('Failed to find container for React app');
28
28
  const scene = (
29
29
  <GlobalStateProvider initialState={getInj().ISTATE}>
30
- <BrowserRouter>
30
+ <BrowserRouter future={{ v7_relativeSplatPath: true }}>
31
31
  <Application />
32
32
  </BrowserRouter>
33
33
  </GlobalStateProvider>
package/src/index.ts CHANGED
@@ -28,22 +28,7 @@ export {
28
28
  withGlobalStateType,
29
29
  } from '@dr.pogodin/react-global-state';
30
30
 
31
- export {
32
- BaseModal,
33
- Button,
34
- Checkbox,
35
- Dropdown,
36
- Input,
37
- Link,
38
- PageLayout,
39
- MetaTags,
40
- Modal,
41
- NavLink,
42
- ScalableRect,
43
- Throbber,
44
- WithTooltip,
45
- YouTubeVideo,
46
- } from 'components';
31
+ export * from 'components';
47
32
 
48
33
  export {
49
34
  type Theme,
@@ -439,7 +439,10 @@ export default function factory(
439
439
  initialState={ssrContext.state}
440
440
  ssrContext={ssrContext}
441
441
  >
442
- <StaticRouter location={req.url}>
442
+ <StaticRouter
443
+ future={{ v7_relativeSplatPath: true }}
444
+ location={req.url}
445
+ >
443
446
  <App2 />
444
447
  </StaticRouter>
445
448
  </GlobalStateProvider>,
@@ -9,6 +9,8 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
9
9
 
10
10
  import defaultTheme from './style.scss';
11
11
 
12
+ const validThemeKeys = ['active', 'button', 'disabled'] as const;
13
+
12
14
  type PropsT = {
13
15
  active?: boolean;
14
16
  children?: ReactNode;
@@ -18,11 +20,7 @@ type PropsT = {
18
20
  onMouseDown?: React.MouseEventHandler;
19
21
  openNewTab?: boolean;
20
22
  replace?: boolean;
21
- theme: Theme & {
22
- active?: string;
23
- button?: string;
24
- disabled?: string;
25
- };
23
+ theme: Theme<typeof validThemeKeys>;
26
24
  // TODO: It needs a more precise typing of the object option.
27
25
  to?: object | string;
28
26
  };
@@ -89,11 +87,7 @@ const BaseButton: React.FunctionComponent<PropsT> = ({
89
87
  * @prop {string} [button] to the root element of any button.
90
88
  * @prop {string} [disabled] to the root element of disabled button.
91
89
  */
92
- const ThemedButton = themed(BaseButton, 'Button', [
93
- 'active',
94
- 'button',
95
- 'disabled',
96
- ], defaultTheme);
90
+ const ThemedButton = themed(BaseButton, 'Button', validThemeKeys, defaultTheme);
97
91
 
98
92
  /**
99
93
  * Implements themeable buttons, and button-line links (elements which look
@@ -4,15 +4,13 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
4
4
 
5
5
  import defaultTheme from './theme.scss';
6
6
 
7
+ const validThemeKeys = ['checkbox', 'container', 'label'] as const;
8
+
7
9
  type PropT = {
8
10
  checked?: boolean;
9
11
  label?: string;
10
12
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
11
- theme: Theme & {
12
- checkbox?: string;
13
- container?: string
14
- label?: string;
15
- };
13
+ theme: Theme<typeof validThemeKeys>;
16
14
  };
17
15
 
18
16
  const Checkbox: React.FunctionComponent<PropT> = ({
@@ -39,11 +37,12 @@ const Checkbox: React.FunctionComponent<PropT> = ({
39
37
  * @prop [container] to the root checkbox element.
40
38
  * @prop [label] to the checkbox label element.
41
39
  */
42
- const ThemedCheckbox = themed(Checkbox, 'Checkbox', [
43
- 'checkbox',
44
- 'container',
45
- 'label',
46
- ], defaultTheme);
40
+ const ThemedCheckbox = themed(
41
+ Checkbox,
42
+ 'Checkbox',
43
+ validThemeKeys,
44
+ defaultTheme,
45
+ );
47
46
 
48
47
  /**
49
48
  * The `<Checkbox>` component implements themeable checkboxes.
@@ -4,6 +4,16 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
4
4
 
5
5
  import defaultTheme from './theme.scss';
6
6
 
7
+ const validThemeKeys = [
8
+ 'arrow',
9
+ 'container',
10
+ 'dropdown',
11
+ 'hiddenOption',
12
+ 'label',
13
+ 'option',
14
+ 'select',
15
+ ] as const;
16
+
7
17
  type DropdownOptionT = {
8
18
  name?: string | null;
9
19
  value: string;
@@ -14,14 +24,7 @@ type PropsT = {
14
24
  label?: string;
15
25
  onChange?: React.ChangeEventHandler<HTMLSelectElement>;
16
26
  options?: Array<DropdownOptionT | string>;
17
- theme: Theme & {
18
- arrow?: string;
19
- container?: string;
20
- hiddenOption?: string;
21
- label?: string;
22
- option?: string;
23
- select?: string;
24
- };
27
+ theme: Theme<typeof validThemeKeys>;
25
28
  value?: string;
26
29
  };
27
30
 
@@ -94,27 +97,27 @@ const Dropdown: React.FunctionComponent<PropsT> = ({
94
97
  return (
95
98
  <div className={theme.container}>
96
99
  { label === undefined ? null : <p className={theme.label}>{label}</p> }
97
- <select
98
- className={theme.select}
99
- onChange={onChange}
100
- value={value}
101
- >
102
- {hiddenOption}
103
- {optionElements}
104
- </select>
105
- <div className={theme.arrow}>▼</div>
100
+ <div className={theme.dropdown}>
101
+ <select
102
+ className={theme.select}
103
+ onChange={onChange}
104
+ value={value}
105
+ >
106
+ {hiddenOption}
107
+ {optionElements}
108
+ </select>
109
+ <div className={theme.arrow}>▼</div>
110
+ </div>
106
111
  </div>
107
112
  );
108
113
  };
109
114
 
110
- const ThemedDropdown = themed(Dropdown, 'Dropdown', [
111
- 'arrow',
112
- 'container',
113
- 'hiddenOption',
114
- 'label',
115
- 'option',
116
- 'select',
117
- ], defaultTheme);
115
+ const ThemedDropdown = themed(
116
+ Dropdown,
117
+ 'Dropdown',
118
+ validThemeKeys,
119
+ defaultTheme,
120
+ );
118
121
 
119
122
  Dropdown.propTypes = {
120
123
  filter: PT.func,
@@ -3,14 +3,20 @@
3
3
  *,
4
4
  .context,
5
5
  .ad.hoc {
6
+ &.dropdown {
7
+ position: relative;
8
+ }
9
+
6
10
  &.arrow {
7
11
  background-image: linear-gradient(to top, lightgray, white 50%, white);
8
12
  border: 1px solid gray;
9
13
  border-radius: 0 0.3em 0.3em 0;
14
+ bottom: 0;
10
15
  padding: 0.3em 0.6em;
11
16
  pointer-events: none;
12
17
  position: absolute;
13
18
  right: 0;
19
+ top: 0;
14
20
  }
15
21
 
16
22
  &.container {
@@ -5,13 +5,15 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
5
5
 
6
6
  import defaultTheme from './theme.scss';
7
7
 
8
+ const validThemeKeys = [
9
+ 'container',
10
+ 'input',
11
+ 'label',
12
+ ] as const;
13
+
8
14
  type PropsT = React.InputHTMLAttributes<HTMLInputElement> & {
9
15
  label?: string;
10
- theme: Theme & {
11
- container?: string;
12
- input?: string;
13
- label?: string;
14
- };
16
+ theme: Theme<typeof validThemeKeys>;
15
17
  };
16
18
 
17
19
  /**
@@ -41,11 +43,7 @@ const Input = forwardRef<HTMLInputElement, PropsT>((
41
43
  </span>
42
44
  ));
43
45
 
44
- const ThemedInput = themed(Input, 'Input', [
45
- 'container',
46
- 'input',
47
- 'label',
48
- ], defaultTheme);
46
+ const ThemedInput = themed(Input, 'Input', validThemeKeys, defaultTheme);
49
47
 
50
48
  Input.propTypes = {
51
49
  label: PT.string,
@@ -17,13 +17,12 @@ import themed, { type Theme } from '@dr.pogodin/react-themes';
17
17
  import baseTheme from './base-theme.scss';
18
18
  import './styles.scss';
19
19
 
20
+ const validThemeKeys = ['container', 'overlay'] as const;
21
+
20
22
  type PropsT = {
21
23
  children?: ReactNode;
22
24
  onCancel?: () => void;
23
- theme: Theme & {
24
- container?: string;
25
- overlay?: string;
26
- };
25
+ theme: Theme<typeof validThemeKeys>;
27
26
  };
28
27
 
29
28
  /**
@@ -120,10 +119,7 @@ const BaseModal: React.FunctionComponent<PropsT> = ({
120
119
  const ThemedModal = themed(
121
120
  BaseModal,
122
121
  'Modal',
123
- [
124
- 'container',
125
- 'overlay',
126
- ],
122
+ validThemeKeys,
127
123
  baseTheme,
128
124
  );
129
125