@dr.pogodin/react-utils 1.57.0-alpha.1 → 1.57.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/CHANGELOG.md +7 -1
- package/bin/release.sh +1 -1
- package/build/development/shared/components/Button/index.js +6 -6
- package/build/development/shared/components/Checkbox/index.js +10 -10
- package/build/development/shared/components/GenericLink/index.js +1 -1
- package/build/development/shared/components/Input/index.js +9 -9
- package/build/development/shared/components/Modal/index.js +6 -6
- package/build/development/shared/components/PageLayout/index.js +6 -6
- package/build/development/shared/components/TextArea/index.js +9 -9
- package/build/development/shared/components/Throbber/index.js +6 -6
- package/build/development/shared/components/WithTooltip/index.js +7 -7
- package/build/development/shared/components/YouTubeVideo/index.js +9 -9
- package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/index.js +11 -11
- package/build/development/shared/components/selectors/NativeDropdown/index.js +12 -12
- package/build/development/shared/components/selectors/Switch/index.js +7 -7
- package/build/production/shared/components/Button/index.js +1 -1
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/Checkbox/index.js +1 -1
- package/build/production/shared/components/Checkbox/index.js.map +1 -1
- package/build/production/shared/components/GenericLink/index.js +1 -1
- package/build/production/shared/components/Input/index.js +1 -1
- package/build/production/shared/components/Modal/index.js +1 -1
- package/build/production/shared/components/Modal/index.js.map +1 -1
- package/build/production/shared/components/PageLayout/index.js +1 -1
- package/build/production/shared/components/PageLayout/index.js.map +1 -1
- package/build/production/shared/components/TextArea/index.js +1 -1
- package/build/production/shared/components/Throbber/index.js +1 -1
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/shared/components/WithTooltip/index.js +1 -1
- package/build/production/shared/components/YouTubeVideo/index.js +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/index.js +1 -1
- package/build/production/shared/components/selectors/NativeDropdown/index.js +1 -1
- package/build/production/shared/components/selectors/Switch/index.js +1 -1
- package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
- package/build/types-code/client/getInj.d.ts +1 -1
- package/build/types-code/client/init.d.ts +1 -1
- package/build/types-code/index.d.ts +3 -3
- package/build/types-code/server/renderer.d.ts +2 -2
- package/build/types-code/shared/components/index.d.ts +11 -11
- package/config/babel/webpack.d.ts +0 -2
- package/config/babel/webpack.js +8 -7
- package/config/webpack/app-base.d.ts +1 -1
- package/config/webpack/app-base.js +45 -57
- package/config/webpack/app-development.js +1 -1
- package/config/webpack/app-production.js +30 -0
- package/package.json +21 -18
package/CHANGELOG.md
CHANGED
package/bin/release.sh
CHANGED
|
@@ -23,4 +23,4 @@ gsutil -m rsync -d -r docs/build gs://docs.pogodin.studio/react-utils
|
|
|
23
23
|
|
|
24
24
|
# Library package release.
|
|
25
25
|
export NPM_ID_TOKEN=$(circleci run oidc get --claims '{"aud": "npm:registry.npmjs.org"}')
|
|
26
|
-
npm publish --access public
|
|
26
|
+
npm publish --access public
|
|
@@ -2,12 +2,12 @@ import { c as _c } from "react/compiler-runtime"; // The <Button> component impl
|
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
import Link from "../Link.js";
|
|
4
4
|
const defaultTheme = {
|
|
5
|
-
"context": "
|
|
6
|
-
"ad": "
|
|
7
|
-
"hoc": "
|
|
8
|
-
"button": "
|
|
9
|
-
"active": "
|
|
10
|
-
"disabled": "
|
|
5
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___context___0S7CYa",
|
|
6
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___ad___YFXz0-",
|
|
7
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___hoc___BElFuo",
|
|
8
|
+
"button": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___button___hXiBOw",
|
|
9
|
+
"active": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___active___biX-UA",
|
|
10
|
+
"disabled": "-dr-pogodin-react-utils___build-web-shared-components-Button-style___disabled___-6CH9q"
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
export const BaseButton = t0 => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
const defaultTheme = {
|
|
4
|
-
"context": "
|
|
5
|
-
"ad": "
|
|
6
|
-
"hoc": "
|
|
7
|
-
"checkbox": "
|
|
8
|
-
"indeterminate": "
|
|
9
|
-
"container": "
|
|
10
|
-
"label": "
|
|
11
|
-
"error": "
|
|
12
|
-
"errorMessage": "
|
|
13
|
-
"disabled": "
|
|
4
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___context___08mmmo",
|
|
5
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___ad___Hc06MV",
|
|
6
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___hoc___toOtOd",
|
|
7
|
+
"checkbox": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___checkbox___v4DmWM",
|
|
8
|
+
"indeterminate": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___indeterminate___ckSC8W",
|
|
9
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___container___g7wee9",
|
|
10
|
+
"label": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___label___XQ57WS",
|
|
11
|
+
"error": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___error___foaF-C",
|
|
12
|
+
"errorMessage": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___errorMessage___WC9mi1",
|
|
13
|
+
"disabled": "-dr-pogodin-react-utils___build-web-shared-components-Checkbox-theme___disabled___baVvQA"
|
|
14
14
|
};
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const Checkbox = t0 => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
const S = {
|
|
3
|
-
"link": "
|
|
3
|
+
"link": "-dr-pogodin-react-utils___build-web-shared-components-GenericLink-style___link___hXmkf-"
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime"; /**
|
|
6
6
|
* The `<Link>` component, and almost identical `<NavLink>` component, are
|
|
@@ -2,15 +2,15 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
3
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
4
4
|
const defaultTheme = {
|
|
5
|
-
"context": "
|
|
6
|
-
"ad": "
|
|
7
|
-
"hoc": "
|
|
8
|
-
"container": "
|
|
9
|
-
"children": "
|
|
10
|
-
"input": "
|
|
11
|
-
"label": "
|
|
12
|
-
"error": "
|
|
13
|
-
"errorMessage": "
|
|
5
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___context___-Jj9Dp",
|
|
6
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___ad___IOZUc8",
|
|
7
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___hoc___nSzLXc",
|
|
8
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___container___wW08uK",
|
|
9
|
+
"children": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___children___hCuQWP",
|
|
10
|
+
"input": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___input___oYQ-Uo",
|
|
11
|
+
"label": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___label___OTmX5n",
|
|
12
|
+
"error": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___error___7jrZ-X",
|
|
13
|
+
"errorMessage": "-dr-pogodin-react-utils___build-web-shared-components-Input-theme___errorMessage___qjYbwz"
|
|
14
14
|
};
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
16
16
|
* Themeable input field, based on the standard HTML `<input>` element.
|
|
@@ -3,14 +3,14 @@ import { useEffect, useMemo, useRef } from "react";
|
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
5
5
|
const defaultTheme = {
|
|
6
|
-
"context": "
|
|
7
|
-
"ad": "
|
|
8
|
-
"hoc": "
|
|
9
|
-
"overlay": "
|
|
10
|
-
"container": "
|
|
6
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-Modal-base-theme___context___sCYXfW",
|
|
7
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-Modal-base-theme___ad___e0BH-f",
|
|
8
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-Modal-base-theme___hoc___vqUuSP",
|
|
9
|
+
"overlay": "-dr-pogodin-react-utils___build-web-shared-components-Modal-base-theme___overlay___uAH4as",
|
|
10
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-Modal-base-theme___container___zqpc6q"
|
|
11
11
|
};
|
|
12
12
|
const S = {
|
|
13
|
-
"scrollingDisabledByModal": "
|
|
13
|
+
"scrollingDisabledByModal": "-dr-pogodin-react-utils___build-web-shared-components-Modal-styles___scrollingDisabledByModal___yfvOIZ"
|
|
14
14
|
};
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
16
16
|
* The `<Modal>` component implements a simple themeable modal window, wrapped
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
const baseTheme = {
|
|
4
|
-
"context": "
|
|
5
|
-
"ad": "
|
|
6
|
-
"hoc": "
|
|
7
|
-
"container": "
|
|
8
|
-
"mainPanel": "
|
|
9
|
-
"sidePanel": "
|
|
4
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___context___zv9tdn",
|
|
5
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___ad___yr8hbI",
|
|
6
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___hoc___01Mz0J",
|
|
7
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___container___blPmpk",
|
|
8
|
+
"mainPanel": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___mainPanel___zPoY0u",
|
|
9
|
+
"sidePanel": "-dr-pogodin-react-utils___build-web-shared-components-PageLayout-base-theme___sidePanel___mRD159"
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
12
12
|
* Simple and themeable page layout. It keeps the main content centered in
|
|
@@ -2,15 +2,15 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
3
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
4
4
|
const defaultTheme = {
|
|
5
|
-
"context": "
|
|
6
|
-
"ad": "
|
|
7
|
-
"hoc": "
|
|
8
|
-
"container": "
|
|
9
|
-
"label": "
|
|
10
|
-
"textarea": "
|
|
11
|
-
"error": "
|
|
12
|
-
"errorMessage": "
|
|
13
|
-
"hidden": "
|
|
5
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___context___tECG8C",
|
|
6
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___ad___epeH4O",
|
|
7
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___hoc___2kFnSt",
|
|
8
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___container___lV5ZyX",
|
|
9
|
+
"label": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___label___7qDPW1",
|
|
10
|
+
"textarea": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___textarea___gkaNJJ",
|
|
11
|
+
"error": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___error___ObwtG4",
|
|
12
|
+
"errorMessage": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___errorMessage___ikIw0x",
|
|
13
|
+
"hidden": "-dr-pogodin-react-utils___build-web-shared-components-TextArea-style___hidden___-UyujK"
|
|
14
14
|
};
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const TextArea = t0 => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
const defaultTheme = {
|
|
4
|
-
"context": "
|
|
5
|
-
"ad": "
|
|
6
|
-
"hoc": "
|
|
7
|
-
"bouncing": "
|
|
8
|
-
"container": "
|
|
9
|
-
"circle": "
|
|
4
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___context___eVCJf-",
|
|
5
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___ad___CU2B6H",
|
|
6
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___hoc___1V5iVx",
|
|
7
|
+
"bouncing": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___bouncing___h6ZYmQ",
|
|
8
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___container___VDVI-X",
|
|
9
|
+
"circle": "-dr-pogodin-react-utils___build-web-shared-components-Throbber-theme___circle___Y2rzbL"
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
12
12
|
* Throbber is an "action in progress" indicator, which renders
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
import Tooltip, { PLACEMENTS } from "./Tooltip.js";
|
|
4
4
|
const defaultTheme = {
|
|
5
|
-
"ad": "
|
|
6
|
-
"hoc": "
|
|
7
|
-
"context": "
|
|
8
|
-
"appearance": "
|
|
9
|
-
"arrow": "
|
|
10
|
-
"container": "
|
|
11
|
-
"wrapper": "
|
|
5
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___ad___n6OiU9",
|
|
6
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___hoc___zwsjGc",
|
|
7
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___context___JVJPcU",
|
|
8
|
+
"appearance": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___appearance___9U4YiR",
|
|
9
|
+
"arrow": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___arrow___9n65k-",
|
|
10
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___container___uA1tHZ",
|
|
11
|
+
"wrapper": "-dr-pogodin-react-utils___build-web-shared-components-WithTooltip-default-theme___wrapper___JFVmGf"
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
14
14
|
* Implements a simple to use and themeable tooltip component, _e.g._
|
|
@@ -3,17 +3,17 @@ import qs from "qs";
|
|
|
3
3
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
4
4
|
import Throbber from "../Throbber/index.js";
|
|
5
5
|
const defaultTheme = {
|
|
6
|
-
"context": "
|
|
7
|
-
"ad": "
|
|
8
|
-
"hoc": "
|
|
9
|
-
"container": "
|
|
10
|
-
"video": "
|
|
6
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-base___context___Pa7GiX",
|
|
7
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-base___ad___NikZ57",
|
|
8
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-base___hoc___FydyFQ",
|
|
9
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-base___container___pQTzJV",
|
|
10
|
+
"video": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-base___video___iFTALT"
|
|
11
11
|
};
|
|
12
12
|
const throbberTheme = {
|
|
13
|
-
"context": "
|
|
14
|
-
"ad": "
|
|
15
|
-
"hoc": "
|
|
16
|
-
"container": "
|
|
13
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-throbber___context___0Piy3R",
|
|
14
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-throbber___ad___GD-lgk",
|
|
15
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-throbber___hoc___T5TGzT",
|
|
16
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-YouTubeVideo-throbber___container___IgN6Uf"
|
|
17
17
|
};
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /**
|
|
19
19
|
* A component for embeding a YouTube video.
|
|
@@ -4,7 +4,7 @@ import { useImperativeHandle, useRef } from "react";
|
|
|
4
4
|
import { BaseModal } from "../../../Modal/index.js";
|
|
5
5
|
import { optionValueName } from "../../common.js";
|
|
6
6
|
const S = {
|
|
7
|
-
"overlay": "
|
|
7
|
+
"overlay": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-Options-style___overlay___ntZ5My"
|
|
8
8
|
};
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
export function areEqual(a, b) {
|
|
@@ -4,17 +4,17 @@ import { useTheme } from "@dr.pogodin/react-themes";
|
|
|
4
4
|
import { optionValueName } from "../common.js";
|
|
5
5
|
import Options, { areEqual } from "./Options/index.js";
|
|
6
6
|
const defaultTheme = {
|
|
7
|
-
"context": "
|
|
8
|
-
"ad": "
|
|
9
|
-
"hoc": "
|
|
10
|
-
"container": "
|
|
11
|
-
"label": "
|
|
12
|
-
"dropdown": "
|
|
13
|
-
"option": "
|
|
14
|
-
"select": "
|
|
15
|
-
"arrow": "
|
|
16
|
-
"active": "
|
|
17
|
-
"upward": "
|
|
7
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___context___SNj3wp",
|
|
8
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___ad___T6eOJ-",
|
|
9
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___hoc___KG-OKN",
|
|
10
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___container___SzHHPE",
|
|
11
|
+
"label": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___label___KTG4ai",
|
|
12
|
+
"dropdown": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___dropdown___xdotm7",
|
|
13
|
+
"option": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___option___y-WCDM",
|
|
14
|
+
"select": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___select___PP5Siy",
|
|
15
|
+
"arrow": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___arrow___7-A7Lh",
|
|
16
|
+
"active": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___active___RoOAZK",
|
|
17
|
+
"upward": "-dr-pogodin-react-utils___build-web-shared-components-selectors-CustomDropdown-theme___upward___--5Xpy"
|
|
18
18
|
};
|
|
19
19
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
const CustomDropdown = t0 => {
|
|
@@ -2,18 +2,18 @@ import _pushInstanceProperty from "core-js-pure/stable/instance/push.js"; // Imp
|
|
|
2
2
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
3
3
|
import { optionValueName } from "../common.js";
|
|
4
4
|
const defaultTheme = {
|
|
5
|
-
"context": "
|
|
6
|
-
"ad": "
|
|
7
|
-
"hoc": "
|
|
8
|
-
"dropdown": "
|
|
9
|
-
"arrow": "
|
|
10
|
-
"container": "
|
|
11
|
-
"active": "
|
|
12
|
-
"label": "
|
|
13
|
-
"option": "
|
|
14
|
-
"hiddenOption": "
|
|
15
|
-
"select": "
|
|
16
|
-
"invalid": "
|
|
5
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___context___WbwY1Y",
|
|
6
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___ad___AP5hsY",
|
|
7
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___hoc___ODAJeW",
|
|
8
|
+
"dropdown": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___dropdown___wabw76",
|
|
9
|
+
"arrow": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___arrow___WFSB9z",
|
|
10
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___container___vE9M8Z",
|
|
11
|
+
"active": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___active___sfLSJA",
|
|
12
|
+
"label": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___label___bQLBhS",
|
|
13
|
+
"option": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___option___wgCtdC",
|
|
14
|
+
"hiddenOption": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___hiddenOption___ty19C2",
|
|
15
|
+
"select": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___select___ntbzPR",
|
|
16
|
+
"invalid": "-dr-pogodin-react-utils___build-web-shared-components-selectors-NativeDropdown-theme___invalid___3CzMM4"
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Implements a themeable dropdown list. Internally it is rendered with help of
|
|
@@ -3,13 +3,13 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
3
3
|
import { useTheme } from "@dr.pogodin/react-themes";
|
|
4
4
|
import { optionValueName } from "../common.js";
|
|
5
5
|
const defaultTheme = {
|
|
6
|
-
"context": "
|
|
7
|
-
"ad": "
|
|
8
|
-
"hoc": "
|
|
9
|
-
"container": "
|
|
10
|
-
"option": "
|
|
11
|
-
"selected": "
|
|
12
|
-
"options": "
|
|
6
|
+
"context": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___context___akD3dQ",
|
|
7
|
+
"ad": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___ad___xcXtdE",
|
|
8
|
+
"hoc": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___hoc___N3iziJ",
|
|
9
|
+
"container": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___container___BYeWyJ",
|
|
10
|
+
"option": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___option___7MFXEN",
|
|
11
|
+
"selected": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___selected___CDbWAd",
|
|
12
|
+
"options": "-dr-pogodin-react-utils___build-web-shared-components-selectors-Switch-theme___options___9-eOZo"
|
|
13
13
|
};
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
export const Switch = t0 => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{c as _c}from"react/compiler-runtime";// The <Button> component implements a standard button / button-like link.
|
|
2
|
-
import{useTheme}from"@dr.pogodin/react-themes";import Link from"../Link.js";const defaultTheme={"context":"
|
|
2
|
+
import{useTheme}from"@dr.pogodin/react-themes";import Link from"../Link.js";const defaultTheme={"context":"_0S7CYa","ad":"YFXz0-","hoc":"BElFuo","button":"hXiBOw","active":"biX-UA","disabled":"_-6CH9q"};import{jsx as _jsx}from"react/jsx-runtime";export const BaseButton=t0=>{const $=_c(32);const{active,children,disabled,enforceA,keepScrollPosition,onClick,onKeyDown:onKeyDownProp,onKeyUp,onMouseDown,onMouseUp,onPointerDown,onPointerUp,openNewTab,replace,testId,theme,to}=t0;let className=theme.button;if(active&&theme.active){className=className+` ${theme.active}`;}if(disabled){if(theme.disabled){className=className+` ${theme.disabled}`;}const t1=process.env.NODE_ENV==="production"?undefined:testId;let t2;if($[0]!==children||$[1]!==className||$[2]!==t1){t2=/*#__PURE__*/_jsx("div",{className:className,"data-testid":t1,children:children});$[0]=children;$[1]=className;$[2]=t1;$[3]=t2;}else{t2=$[3];}return t2;}let onKeyDown=onKeyDownProp;if(!onKeyDown&&onClick){let t1;if($[4]!==onClick){t1=e=>{if(e.key==="Enter"){onClick(e);}};$[4]=onClick;$[5]=t1;}else{t1=$[5];}onKeyDown=t1;}if(to){const t1=process.env.NODE_ENV==="production"?undefined:testId;let t2;if($[6]!==children||$[7]!==className||$[8]!==enforceA||$[9]!==keepScrollPosition||$[10]!==onClick||$[11]!==onKeyUp||$[12]!==onMouseDown||$[13]!==onMouseUp||$[14]!==onPointerDown||$[15]!==onPointerUp||$[16]!==openNewTab||$[17]!==replace||$[18]!==t1||$[19]!==to){t2=/*#__PURE__*/_jsx(Link,{className:className,"data-testid":t1,enforceA:enforceA,keepScrollPosition:keepScrollPosition,onClick:onClick,onKeyUp:onKeyUp,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onPointerDown:onPointerDown,onPointerUp:onPointerUp,openNewTab:openNewTab,replace:replace,to:to,children:children});$[6]=children;$[7]=className;$[8]=enforceA;$[9]=keepScrollPosition;$[10]=onClick;$[11]=onKeyUp;$[12]=onMouseDown;$[13]=onMouseUp;$[14]=onPointerDown;$[15]=onPointerUp;$[16]=openNewTab;$[17]=replace;$[18]=t1;$[19]=to;$[20]=t2;}else{t2=$[20];}return t2;}const t1=process.env.NODE_ENV==="production"?undefined:testId;let t2;if($[21]!==children||$[22]!==className||$[23]!==onClick||$[24]!==onKeyDown||$[25]!==onKeyUp||$[26]!==onMouseDown||$[27]!==onMouseUp||$[28]!==onPointerDown||$[29]!==onPointerUp||$[30]!==t1){t2=/*#__PURE__*/_jsx("div",{className:className,"data-testid":t1,onClick:onClick,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onPointerDown:onPointerDown,onPointerUp:onPointerUp,role:"button",tabIndex:0,children:children});$[21]=children;$[22]=className;$[23]=onClick;$[24]=onKeyDown;$[25]=onKeyUp;$[26]=onMouseDown;$[27]=onMouseUp;$[28]=onPointerDown;$[29]=onPointerUp;$[30]=t1;$[31]=t2;}else{t2=$[31];}return t2;};const Button=t0=>{const $=_c(6);let rest;let theme;if($[0]!==t0){({theme,...rest}=t0);$[0]=t0;$[1]=rest;$[2]=theme;}else{rest=$[1];theme=$[2];}const composed=useTheme("Button",defaultTheme,theme);let t1;if($[3]!==composed||$[4]!==rest){t1=/*#__PURE__*/_jsx(BaseButton,{...rest,theme:composed});$[3]=composed;$[4]=rest;$[5]=t1;}else{t1=$[5];}return t1;};export default Button;
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Button/index.tsx"],"sourcesContent":["// The <Button> component implements a standard button / button-like link.\n\nimport type {\n FunctionComponent,\n KeyboardEventHandler,\n MouseEventHandler,\n PointerEventHandler,\n ReactNode,\n} from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport Link from 'components/Link';\n\nimport defaultTheme from './style.scss';\n\ntype ThemeT = Theme<'active' | 'button' | 'disabled'>;\n\ntype PropsT = {\n active?: boolean;\n children?: ReactNode;\n disabled?: boolean;\n enforceA?: boolean;\n keepScrollPosition?: boolean;\n onClick?: KeyboardEventHandler & MouseEventHandler;\n onKeyDown?: KeyboardEventHandler;\n onKeyUp?: KeyboardEventHandler;\n onMouseDown?: MouseEventHandler;\n onMouseUp?: MouseEventHandler;\n onPointerDown?: PointerEventHandler;\n onPointerUp?: PointerEventHandler;\n openNewTab?: boolean;\n replace?: boolean;\n testId?: string;\n theme: ThemeT;\n\n // TODO: It needs a more precise typing of the object option.\n to?: object | string;\n};\n\nexport const BaseButton: FunctionComponent<PropsT> = ({\n active,\n children,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onKeyDown: onKeyDownProp,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onPointerDown,\n onPointerUp,\n openNewTab,\n replace,\n testId,\n theme,\n to,\n}) => {\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return (\n <div\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n >\n {children}\n </div>\n );\n }\n\n let onKeyDown = onKeyDownProp;\n if (!onKeyDown && onClick) {\n onKeyDown = (e) => {\n if (e.key === 'Enter') onClick(e);\n };\n }\n\n if (to) {\n return (\n <Link\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n enforceA={enforceA}\n\n // TODO: This was exposed as a hotifx... however, I guess we better want\n // to check if the `to` URL contains an anchor (#), and if it does we should\n // automatically opt to keep the position here; and enforce <a> (as\n // react-router link does not seem to respect the hash tag either,\n // at least not without some additional settings).\n keepScrollPosition={keepScrollPosition}\n\n onClick={onClick}\n\n // TODO: For now, the `onKeyDown` handler is not passed to the <Link>,\n // as <Link> component does not call it anyway, presumably due to\n // the inner implementation details. We should look into supporting it:\n // https://github.com/birdofpreyru/react-utils/issues/444\n // onKeyDown={onKeyDown}\n\n onKeyUp={onKeyUp}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onPointerDown={onPointerDown}\n onPointerUp={onPointerUp}\n openNewTab={openNewTab}\n replace={replace}\n to={to}\n >\n {children}\n </Link>\n );\n }\n\n return (\n <div\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onPointerDown={onPointerDown}\n onPointerUp={onPointerUp}\n role=\"button\"\n tabIndex={0}\n >\n {children}\n </div>\n );\n};\n\nconst Button: FunctionComponent<\n Omit<PropsT, 'theme'> & { theme?: ThemeT }\n> = ({ theme, ...rest }) => {\n const composed = useTheme('Button', defaultTheme, theme);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <BaseButton {...rest} theme={composed} />;\n};\n\nexport default Button;\n"],"mappings":"4CAAA;AAUA,OAAqB,QAAQ,KAAQ,0BAA0B,CAAC,MAEzD,KAAI,kBAEX,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Button/index.tsx"],"sourcesContent":["// The <Button> component implements a standard button / button-like link.\n\nimport type {\n FunctionComponent,\n KeyboardEventHandler,\n MouseEventHandler,\n PointerEventHandler,\n ReactNode,\n} from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport Link from 'components/Link';\n\nimport defaultTheme from './style.scss';\n\ntype ThemeT = Theme<'active' | 'button' | 'disabled'>;\n\ntype PropsT = {\n active?: boolean;\n children?: ReactNode;\n disabled?: boolean;\n enforceA?: boolean;\n keepScrollPosition?: boolean;\n onClick?: KeyboardEventHandler & MouseEventHandler;\n onKeyDown?: KeyboardEventHandler;\n onKeyUp?: KeyboardEventHandler;\n onMouseDown?: MouseEventHandler;\n onMouseUp?: MouseEventHandler;\n onPointerDown?: PointerEventHandler;\n onPointerUp?: PointerEventHandler;\n openNewTab?: boolean;\n replace?: boolean;\n testId?: string;\n theme: ThemeT;\n\n // TODO: It needs a more precise typing of the object option.\n to?: object | string;\n};\n\nexport const BaseButton: FunctionComponent<PropsT> = ({\n active,\n children,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onKeyDown: onKeyDownProp,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onPointerDown,\n onPointerUp,\n openNewTab,\n replace,\n testId,\n theme,\n to,\n}) => {\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return (\n <div\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n >\n {children}\n </div>\n );\n }\n\n let onKeyDown = onKeyDownProp;\n if (!onKeyDown && onClick) {\n onKeyDown = (e) => {\n if (e.key === 'Enter') onClick(e);\n };\n }\n\n if (to) {\n return (\n <Link\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n enforceA={enforceA}\n\n // TODO: This was exposed as a hotifx... however, I guess we better want\n // to check if the `to` URL contains an anchor (#), and if it does we should\n // automatically opt to keep the position here; and enforce <a> (as\n // react-router link does not seem to respect the hash tag either,\n // at least not without some additional settings).\n keepScrollPosition={keepScrollPosition}\n\n onClick={onClick}\n\n // TODO: For now, the `onKeyDown` handler is not passed to the <Link>,\n // as <Link> component does not call it anyway, presumably due to\n // the inner implementation details. We should look into supporting it:\n // https://github.com/birdofpreyru/react-utils/issues/444\n // onKeyDown={onKeyDown}\n\n onKeyUp={onKeyUp}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onPointerDown={onPointerDown}\n onPointerUp={onPointerUp}\n openNewTab={openNewTab}\n replace={replace}\n to={to}\n >\n {children}\n </Link>\n );\n }\n\n return (\n <div\n className={className}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n onPointerDown={onPointerDown}\n onPointerUp={onPointerUp}\n role=\"button\"\n tabIndex={0}\n >\n {children}\n </div>\n );\n};\n\nconst Button: FunctionComponent<\n Omit<PropsT, 'theme'> & { theme?: ThemeT }\n> = ({ theme, ...rest }) => {\n const composed = useTheme('Button', defaultTheme, theme);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <BaseButton {...rest} theme={composed} />;\n};\n\nexport default Button;\n"],"mappings":"4CAAA;AAUA,OAAqB,QAAQ,KAAQ,0BAA0B,CAAC,MAEzD,KAAI,kBAEX,+HAAwC,2CA0BxC,MAAO,MAAM,WAAqC,CAAG,oBAAC,yLAkBrD,CACC,cAAgB,KAAK,OAAO,CAC5B,GAAI,MAAsB,EAAZ,KAAK,OAAO,EAAE,mBAAS,CAAI,IAAI,KAAK,OAAO,EAAE,EAC3D,GAAI,QAAQ,EACV,GAAI,KAAK,SAAS,EAAE,mBAAS,CAAI,IAAI,KAAK,SAAS,EAAE,EAIpC,gBAAO,IAAI,SAAS,GAAK,YAAiC,CAA1D,SAA0D,CAA1D,MAA0D,yDAFzE,4BACa,SAAS,CAAT,SAAS,CACP,gBAA0D,UAEtE,QAAQ,CACN,CAAC,mEALN,GAKM,EAIV,cAAgB,aAAa,CAC7B,GAAI,CAAC,SAAoB,EAArB,OAAqB,4BACX,OACV,GAAI,CAAC,IAAI,GAAK,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAC,CACnC,qCAFD,UAAY,EAEX,CAFQ,CAKX,GAAI,EAAE,EAIa,gBAAO,IAAI,SAAS,GAAK,YAAiC,CAA1D,SAA0D,CAA1D,MAA0D,6QAFzE,qBAAC,IAAI,EACQ,SAAS,CAAT,SAAS,CACP,gBAA0D,CAC7D,QAAQ,CAAR,QAAQ,CAOE,kBAAkB,CAAlB,kBAAkB,CAE7B,OAAO,CAAP,OAAO,CAQP,OAAO,CAAP,OAAO,CACH,WAAW,CAAX,WAAW,CACb,SAAS,CAAT,SAAS,CACL,aAAa,CAAb,aAAa,CACf,WAAW,CAAX,WAAW,CACZ,UAAU,CAAV,UAAU,CACb,OAAO,CAAP,OAAO,CACZ,EAAE,CAAF,EAAE,UAEL,QAAQ,CACL,CAAC,wPA9BP,GA8BO,EAOM,gBAAO,IAAI,SAAS,GAAK,YAAiC,CAA1D,SAA0D,CAA1D,MAA0D,qMAFzE,4BACa,SAAS,CAAT,SAAS,CACP,gBAA0D,CAC9D,OAAO,CAAP,OAAO,CACL,SAAS,CAAT,SAAS,CACX,OAAO,CAAP,OAAO,CACH,WAAW,CAAX,WAAW,CACb,SAAS,CAAT,SAAS,CACL,aAAa,CAAb,aAAa,CACf,WAAW,CAAX,WAAW,CACnB,IAAQ,CAAR,QAAQ,CACH,QAAC,CAAD,CAAC,UAEV,QAAQ,CACN,CAAC,4LAdN,GAcM,EAET,CAED,KAAM,OAEL,CAAG,oDAAC,mBAAkB,2DACrB,eAAiB,QAAQ,CAAC,QAAQ,CAAE,YAAY,CAAE,KAAK,CAAC,CAAC,wCAGlD,qBAAC,UAAU,KAAK,IAAI,CAAS,KAAQ,CAAR,QAAQ,CAAG,CAAC,sDAAzC,GAAyC,EACjD,CAED,cAAe,OAAM","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"_08mmmo","ad":"Hc06MV","hoc":"toOtOd","checkbox":"v4DmWM","indeterminate":"ckSC8W","container":"g7wee9","label":"XQ57WS","error":"foaF-C","errorMessage":"WC9mi1","disabled":"baVvQA"};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Checkbox=t0=>{const $=_c(17);const{checked,disabled,error,label,onChange,testId,theme}=t0;const composed=useTheme("Checkbox",defaultTheme,theme);let containerClassName=composed.container;if(disabled){containerClassName=containerClassName+` ${composed.disabled}`;}let checkboxClassName=composed.checkbox;if(checked==="indeterminate"){checkboxClassName=checkboxClassName+` ${composed.indeterminate}`;}if(error){containerClassName=containerClassName+` ${composed.error}`;}let t1;if($[0]!==composed.label||$[1]!==label){t1=label===undefined?null:/*#__PURE__*/_jsx("div",{className:composed.label,children:label});$[0]=composed.label;$[1]=label;$[2]=t1;}else{t1=$[2];}const t2=checked===undefined?undefined:checked===true;const t3=process.env.NODE_ENV==="production"?undefined:testId;let t4;if($[3]!==checkboxClassName||$[4]!==disabled||$[5]!==onChange||$[6]!==t2||$[7]!==t3){t4=/*#__PURE__*/_jsx("input",{checked:t2,className:checkboxClassName,"data-testid":t3,disabled:disabled,onChange:onChange,onClick:_temp,type:"checkbox"});$[3]=checkboxClassName;$[4]=disabled;$[5]=onChange;$[6]=t2;$[7]=t3;$[8]=t4;}else{t4=$[8];}let t5;if($[9]!==composed.errorMessage||$[10]!==error){t5=error&&error!==true?/*#__PURE__*/_jsx("div",{className:composed.errorMessage,children:error}):null;$[9]=composed.errorMessage;$[10]=error;$[11]=t5;}else{t5=$[11];}let t6;if($[12]!==containerClassName||$[13]!==t1||$[14]!==t4||$[15]!==t5){t6=/*#__PURE__*/_jsxs("div",{className:containerClassName,children:[t1,t4,t5]});$[12]=containerClassName;$[13]=t1;$[14]=t4;$[15]=t5;$[16]=t6;}else{t6=$[16];}return t6;};export default Checkbox;function _temp(e){e.stopPropagation();}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Checkbox/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype PropT<ValueT> = {\n checked?: ValueT;\n disabled?: boolean;\n error?: ReactNode;\n label?: React.ReactNode;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n testId?: string;\n theme?: Theme<\n | 'checkbox'\n | 'container'\n | 'disabled'\n | 'error'\n | 'errorMessage'\n | 'indeterminate'\n | 'label'\n >;\n};\n\nconst Checkbox = <ValueT extends 'indeterminate' | boolean = boolean>({\n checked,\n disabled,\n error,\n label,\n onChange,\n testId,\n theme,\n}: PropT<ValueT>): ReactNode => {\n const composed = useTheme('Checkbox', defaultTheme, theme);\n\n let containerClassName = composed.container;\n if (disabled) containerClassName += ` ${composed.disabled}`;\n\n let checkboxClassName = composed.checkbox;\n if (checked === 'indeterminate') checkboxClassName += ` ${composed.indeterminate}`;\n\n if (error) containerClassName += ` ${composed.error}`;\n\n return (\n <div className={containerClassName}>\n { label === undefined\n ? null : <div className={composed.label}>{label}</div> }\n <input\n checked={checked === undefined ? undefined : checked === true}\n className={checkboxClassName}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n disabled={disabled}\n onChange={onChange}\n onClick={(e) => {\n e.stopPropagation();\n }}\n type=\"checkbox\"\n />\n {error && error !== true\n ? <div className={composed.errorMessage}>{error}</div>\n : null}\n </div>\n );\n};\n\nexport default Checkbox;\n"],"mappings":"4CAEA,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Checkbox/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype PropT<ValueT> = {\n checked?: ValueT;\n disabled?: boolean;\n error?: ReactNode;\n label?: React.ReactNode;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n testId?: string;\n theme?: Theme<\n | 'checkbox'\n | 'container'\n | 'disabled'\n | 'error'\n | 'errorMessage'\n | 'indeterminate'\n | 'label'\n >;\n};\n\nconst Checkbox = <ValueT extends 'indeterminate' | boolean = boolean>({\n checked,\n disabled,\n error,\n label,\n onChange,\n testId,\n theme,\n}: PropT<ValueT>): ReactNode => {\n const composed = useTheme('Checkbox', defaultTheme, theme);\n\n let containerClassName = composed.container;\n if (disabled) containerClassName += ` ${composed.disabled}`;\n\n let checkboxClassName = composed.checkbox;\n if (checked === 'indeterminate') checkboxClassName += ` ${composed.indeterminate}`;\n\n if (error) containerClassName += ` ${composed.error}`;\n\n return (\n <div className={containerClassName}>\n { label === undefined\n ? null : <div className={composed.label}>{label}</div> }\n <input\n checked={checked === undefined ? undefined : checked === true}\n className={checkboxClassName}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n disabled={disabled}\n onChange={onChange}\n onClick={(e) => {\n e.stopPropagation();\n }}\n type=\"checkbox\"\n />\n {error && error !== true\n ? <div className={composed.errorMessage}>{error}</div>\n : null}\n </div>\n );\n};\n\nexport default Checkbox;\n"],"mappings":"4CAEA,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,sNAAwC,yDAoBxC,KAAM,SAAQ,CAAG,oBAAqD,4DAQtD,CACd,eAAiB,QAAQ,CAAC,UAAU,CAAE,YAAY,CAAE,KAAK,CAAC,CAE1D,uBAAyB,QAAQ,UAAU,CAC3C,GAAI,QAAQ,EAAE,qCAAkB,CAAI,IAAI,QAAQ,SAAS,EAAE,EAE3D,sBAAwB,QAAQ,SAAS,CACzC,GAAI,OAAO,GAAK,eAAe,EAAE,mCAAiB,CAAI,IAAI,QAAQ,cAAc,EAAE,EAElF,GAAI,KAAK,EAAE,qCAAkB,CAAI,IAAI,QAAQ,MAAM,EAAE,EAAC,+CAIhD,QAAK,GAAK,SAC4C,CADtD,IACsD,cADtD,YACyB,SAAc,CAAd,QAAQ,MAAM,UAAG,KAAK,CAAM,CAAC,uDAE7C,gBAAO,GAAK,SAAwC,CAApD,SAAoD,CAAhB,OAAO,GAAK,IAAI,CAEhD,gBAAO,IAAI,SAAS,GAAK,YAAiC,CAA1D,SAA0D,CAA1D,MAA0D,6FAHzE,8BACW,OAAoD,CAApD,EAAoD,CAClD,SAAiB,CAAjB,iBAAiB,CACf,gBAA0D,CAC7D,QAAQ,CAAR,QAAQ,CACR,QAAQ,CAAR,QAAQ,CACT,OAER,CAFQ,KAER,CACI,IAAU,CAAV,UAAU,CAChB,CAAC,kJACD,QAAuB,EAAd,KAAK,GAAK,IAEZ,cAFP,YACmB,SAAqB,CAArB,QAAQ,aAAa,UAAG,KAAK,CAC1C,CAAC,CAFP,IAEO,2IAhBV,6BAAgB,SAAkB,CAAlB,kBAAkB,WAC9B,EACsD,CACxD,EAUE,CACD,EAEO,EACL,CAAC,oFAjBN,GAiBM,EAET,CAED,cAAe,SAAQ,CAzCN,kBA8BP,CAAC,gBAAgB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";const S={"link":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";const S={"link":"hXmkf-"};import{jsx as _jsx}from"react/jsx-runtime";/**
|
|
2
2
|
* The `<Link>` component, and almost identical `<NavLink>` component, are
|
|
3
3
|
* auxiliary wrappers around
|
|
4
4
|
* [React Router](https://github.com/ReactTraining/react-router)'s
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{useRef,useState}from"react";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{useRef,useState}from"react";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"-Jj9Dp","ad":"IOZUc8","hoc":"nSzLXc","container":"wW08uK","children":"hCuQWP","input":"oYQ-Uo","label":"OTmX5n","error":"_7jrZ-X","errorMessage":"qjYbwz"};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";/**
|
|
2
2
|
* Themeable input field, based on the standard HTML `<input>` element.
|
|
3
3
|
* @param [props.label] Input label.
|
|
4
4
|
* @param [props.theme] _Ad hoc_ theme.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{useEffect,useMemo,useRef}from"react";import{createPortal}from"react-dom";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{useEffect,useMemo,useRef}from"react";import{createPortal}from"react-dom";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"sCYXfW","ad":"e0BH-f","hoc":"vqUuSP","overlay":"uAH4as","container":"zqpc6q"};const S={"scrollingDisabledByModal":"yfvOIZ"};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";/**
|
|
2
2
|
* The `<Modal>` component implements a simple themeable modal window, wrapped
|
|
3
3
|
* into the default theme. `<BaseModal>` exposes the base non-themed component.
|
|
4
4
|
* **Children:** Component children are rendered as the modal content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type FunctionComponent,\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype ThemeT = Theme<'container' | 'overlay'>;\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n overlayStyle?: CSSProperties;\n style?: CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: ThemeT;\n\n /** @deprecated */\n containerStyle?: CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n overlayStyle,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current!.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n (elems[i] as HTMLElement).focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n // TODO: Have a look at this later.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n ), []);\n\n return createPortal(\n (\n <div>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n style={overlayStyle}\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n }\n <div // eslint-disable-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => {\n e.stopPropagation();\n }}\n onWheel={(event) => {\n event.stopPropagation();\n }}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n // TODO: Have a look at this later.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n {focusLast}\n </div>\n ),\n document.body,\n );\n};\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n\nconst Modal: FunctionComponent<\n Omit<PropsT, 'theme'> & { theme?: ThemeT }\n> = ({ theme, ...rest }) => {\n const composed = useTheme('Modal', defaultTheme, theme);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <BaseModal {...rest} theme={composed} />;\n};\n\nexport default Modal;\n"],"mappings":"4CAAA,OAIE,SAAS,CACT,OAAO,CACP,MAAM,KACD,OAAO,CAEd,OAAS,YAAY,KAAQ,WAAW,CAExC,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type FunctionComponent,\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype ThemeT = Theme<'container' | 'overlay'>;\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n overlayStyle?: CSSProperties;\n style?: CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: ThemeT;\n\n /** @deprecated */\n containerStyle?: CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n overlayStyle,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current!.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n (elems[i] as HTMLElement).focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n // TODO: Have a look at this later.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n ), []);\n\n return createPortal(\n (\n <div>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n style={overlayStyle}\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n }\n <div // eslint-disable-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => {\n e.stopPropagation();\n }}\n onWheel={(event) => {\n event.stopPropagation();\n }}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n // TODO: Have a look at this later.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n {focusLast}\n </div>\n ),\n document.body,\n );\n};\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n\nconst Modal: FunctionComponent<\n Omit<PropsT, 'theme'> & { theme?: ThemeT }\n> = ({ theme, ...rest }) => {\n const composed = useTheme('Modal', defaultTheme, theme);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <BaseModal {...rest} theme={composed} />;\n};\n\nexport default Modal;\n"],"mappings":"4CAAA,OAIE,SAAS,CACT,OAAO,CACP,MAAM,KACD,OAAO,CAEd,OAAS,YAAY,KAAQ,WAAW,CAExC,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,2JAC8B,yDAmB9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,UAAoC,CAAG,oBAAC,kIAW7C,CACC,mBAAqB,MAAM,CAAwB,IAAI,CAAC,CACxD,iBAAmB,MAAM,CAAwB,IAAI,CAAC,CAAC,4DAG7C,QACR,GAAI,iBAA6B,EAA7B,QAA6B,EAC/B,MAAM,iBAAiB,CAAC,QAAQ,CAAE,QAAQ,CAAC,CAC3C,MAAM,iBAAiB,CAAC,OAAO,CAAE,QAAQ,CAAC,EAC3C,MACM,KACL,GAAI,iBAA6B,EAA7B,QAA6B,EAC/B,MAAM,oBAAoB,CAAC,QAAQ,CAAE,QAAQ,CAAC,CAC9C,MAAM,oBAAoB,CAAC,OAAO,CAAE,QAAQ,CAAC,EAC9C,CACF,EACF,CAAE,IAAC,iBAAiB,CAAE,QAAQ,CAAC,6EAXhC,SAAS,CAAC,EAWT,CAAE,EAA6B,CAAC,+CAGvB,QACR,GAAI,CAAC,oBAAoB,EACvB,QAAQ,KAAK,UAAU,IAAI,CAAC,CAAC,yBAAyB,CAAC,EACxD,MACM,KACL,GAAI,CAAC,oBAAoB,EACvB,QAAQ,KAAK,UAAU,OAAO,CAAC,CAAC,yBAAyB,CAAC,EAC3D,CACF,EACF,CAAE,IAAC,oBAAoB,CAAC,kEATzB,SAAS,CAAC,EAST,CAAE,EAAsB,CAAC,2DAGxB,4BACW,OAOR,CAPQ,KACP,YAAc,YAAY,QAAQ,iBAAkB,CAAC,GAAG,CAAC,CACzD,UAAa,KAAK,OAAO,CAAG,CAAC,CAAE,CAAC,EAAI,CAGnC,CAHsC,EAAE,CAAC,EACvC,KAAK,CAAC,CAAC,CAAC,MAAsB,CAAC,CAAC,CACjC,GAAI,QAAQ,cAAc,GAAK,KAAK,CAAC,CAAC,CAAC,UAAS,CAElD,UAAU,QAAe,OAAE,CAAD,CAAC,EAC5B,CAGS,QAAC,CAAD,CAAC,CACZ,CAAC,wBAbJ,gBACE,EAYE,CAWM,gBAAO,IAAI,SAAS,GAAK,YACO,CADhC,SACgC,CADhC,gBACgC,mCAEzB,OACP,GAAI,QAAQ,EACV,QAAQ,CAAC,CAAC,CACV,CAAC,gBAAgB,CAAC,CAAC,EACpB,CACF,CACU,SACT,GAAI,GAAC,IAAI,GAAK,QAAoB,EAA9B,QAA8B,EAChC,QAAQ,CAAC,CAAC,CACV,GAAC,gBAAgB,CAAC,CAAC,EACpB,CACF,mHACI,UACH,GAAI,IAAmC,EAA3B,IAAI,GAAK,UAAU,QAAQ,EACrC,UAAU,SAAW,IAAH,CAClB,IAAI,MAAM,CAAC,CAAC,EACb,CACF,sHAxBH,6BACa,qBAAQ,CACR,SAAa,CAAb,KAAK,QAAQ,CAEtB,gBACgC,CAEzB,OAKR,CALQ,EAKR,CACU,SAKV,CALU,EAKV,CACI,GAKJ,CALI,EAKJ,CACI,IAAQ,CAAR,QAAQ,CACN,KAAY,CAAZ,YAAY,CACT,QAAC,CAAD,CAAC,CACZ,CAAC,8FAea,iBAAO,IAAI,SAAS,GAAK,YAAiC,CAA1D,SAA0D,CAA1D,MAA0D,CAShE,eAAuB,EAAvB,cAAuB,iFAZhC,6BACa,mBAAM,CACN,SAAe,CAAf,KAAK,UAAU,CACb,iBAA0D,CAC9D,OAER,CAFQ,KAER,CACQ,OAER,CAFQ,MAER,CACI,GAAY,CAAZ,YAAY,CACZ,IAAQ,CAAR,QAAQ,CACN,KAAuB,CAAvB,GAAuB,UAE7B,QAAQ,CACN,CAAC,iJACN,6BACW,OAER,CAFQ,KACP,UAAU,QAAe,OAAE,CAAD,CAAC,EAC5B,CAGS,QAAC,CAAD,CAAC,CACZ,CAAC,iEAnED,6BAAY,cAEf,uBACG,SAAS,CACV,GA4BE,CAYF,GAeM,CACN,GAOE,CACD,SAAS,EACP,CAAC,CAER,QAAQ,KACV,CAAC,sDAxEM,IAwEN,EACF,CAED,sCACA,OAAS,SAAS,EAElB,KAAM,MAEL,CAAG,oDAAC,mBAAkB,2DACrB,eAAiB,QAAQ,CAAC,OAAO,CAAE,YAAY,CAAE,KAAK,CAAC,CAAC,wCAGjD,qBAAC,SAAS,KAAK,IAAI,CAAS,KAAQ,CAAR,QAAQ,CAAG,CAAC,sDAAxC,GAAwC,EAChD,CAED,cAAe,MAAK,CAhJyB,oBA0GjC,GAAC,gBAAgB,CAAC,CAAC,EA1Gc,uBA6GjC,KAAK,gBAAgB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{useTheme}from"@dr.pogodin/react-themes";const baseTheme={"context":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{useTheme}from"@dr.pogodin/react-themes";const baseTheme={"context":"zv9tdn","ad":"yr8hbI","hoc":"_01Mz0J","container":"blPmpk","mainPanel":"zPoY0u","sidePanel":"mRD159"};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";/**
|
|
2
2
|
* Simple and themeable page layout. It keeps the main content centered in
|
|
3
3
|
* a column of limited width, which fills entire viewport on small screens
|
|
4
4
|
* (under `$screen-md = 1024px` size). At larger screens the column keeps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/PageLayout/index.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\n\ntype ThemeKeyT = 'container' | 'leftSidePanel' | 'mainPanel' | 'rightSidePanel'\n | 'sidePanel';\n\ntype PropsT = {\n children?: ReactNode;\n leftSidePanelContent?: ReactNode;\n rightSidePanelContent?: ReactNode;\n theme?: Theme<ThemeKeyT>;\n};\n\n/**\n * Simple and themeable page layout. It keeps the main content centered in\n * a column of limited width, which fills entire viewport on small screens\n * (under `$screen-md = 1024px` size). At larger screens the column keeps\n * `$screen-md` size, and it is centered at the page, surrounded by side\n * panels, where additional content can be displayed.\n *\n * **Children:** Component children are rendered as the content of main panel.\n * @param {object} [props] Component properties.\n * @param {Node} [props.leftSidePanelContent] The content for left side panel.\n * @param {Node} [props.rightSidePanelContent] The content for right side panel.\n * @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst PageLayout: FunctionComponent<PropsT> = ({\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme,\n}) => {\n const composed = useTheme('PageLayout', baseTheme, theme);\n return (\n <div className={composed.container}>\n <div className={[composed.sidePanel, composed.leftSidePanel].join(' ')}>\n {leftSidePanelContent}\n </div>\n <div className={composed.mainPanel}>\n {children}\n </div>\n <div className={[composed.sidePanel, composed.rightSidePanel].join(' ')}>\n {rightSidePanelContent}\n </div>\n </div>\n );\n};\n\nexport default PageLayout;\n"],"mappings":"4CAEA,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/shared/components/PageLayout/index.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\n\nimport { type Theme, useTheme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\n\ntype ThemeKeyT = 'container' | 'leftSidePanel' | 'mainPanel' | 'rightSidePanel'\n | 'sidePanel';\n\ntype PropsT = {\n children?: ReactNode;\n leftSidePanelContent?: ReactNode;\n rightSidePanelContent?: ReactNode;\n theme?: Theme<ThemeKeyT>;\n};\n\n/**\n * Simple and themeable page layout. It keeps the main content centered in\n * a column of limited width, which fills entire viewport on small screens\n * (under `$screen-md = 1024px` size). At larger screens the column keeps\n * `$screen-md` size, and it is centered at the page, surrounded by side\n * panels, where additional content can be displayed.\n *\n * **Children:** Component children are rendered as the content of main panel.\n * @param {object} [props] Component properties.\n * @param {Node} [props.leftSidePanelContent] The content for left side panel.\n * @param {Node} [props.rightSidePanelContent] The content for right side panel.\n * @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst PageLayout: FunctionComponent<PropsT> = ({\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme,\n}) => {\n const composed = useTheme('PageLayout', baseTheme, theme);\n return (\n <div className={composed.container}>\n <div className={[composed.sidePanel, composed.leftSidePanel].join(' ')}>\n {leftSidePanelContent}\n </div>\n <div className={composed.mainPanel}>\n {children}\n </div>\n <div className={[composed.sidePanel, composed.rightSidePanel].join(' ')}>\n {rightSidePanelContent}\n </div>\n </div>\n );\n};\n\nexport default PageLayout;\n"],"mappings":"4CAEA,OAAqB,QAAQ,KAAQ,0BAA0B,CAE/D,kIAA0C,yDAY1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,WAAqC,CAAG,oBAAC,mEAK9C,CACC,eAAiB,QAAQ,CAAC,YAAY,CAAE,SAAS,CAAE,KAAK,CAAC,CAEvC,iBAAQ,UAAU,qEAChB,IAAC,QAAQ,UAAU,CAAE,QAAQ,cAAc,CAAC,4EAA5C,WAA4C,KAAK,CAAC,GAAG,CAAC,mDAAtE,4BAAgB,SAAsD,CAAtD,EAAsD,UACnE,oBAAoB,CAClB,CAAC,gHACN,4BAAgB,SAAkB,CAAlB,QAAQ,UAAU,UAC/B,QAAQ,CACN,CAAC,oIACU,IAAC,QAAQ,UAAU,CAAE,QAAQ,eAAe,CAAC,gFAA7C,WAA6C,KAAK,CAAC,GAAG,CAAC,sDAAvE,4BAAgB,SAAuD,CAAvD,EAAuD,UACpE,qBAAqB,CACnB,CAAC,yIATR,6BAAgB,SAAkB,CAAlB,EAAkB,WAChC,EAEM,CACN,EAEM,CACN,EAEM,EACH,CAAC,oFAVN,GAUM,EAET,CAED,cAAe,WAAU","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{useEffect,useLayoutEffect,useRef,useState}from"react";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{useEffect,useLayoutEffect,useRef,useState}from"react";import{useTheme}from"@dr.pogodin/react-themes";const defaultTheme={"context":"tECG8C","ad":"epeH4O","hoc":"_2kFnSt","container":"lV5ZyX","label":"_7qDPW1","textarea":"gkaNJJ","error":"ObwtG4","errorMessage":"ikIw0x","hidden":"-UyujK"};import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const TextArea=t0=>{const $=_c(39);const{disabled,error,label,onBlur,onChange,onKeyDown,placeholder,ref,testId,theme,value}=t0;const custom=useTheme("TextArea",defaultTheme,theme);const hiddenAreaRef=useRef(null);const[height,setHeight]=useState();const textAreaRef=useRef(null);const[localValue,setLocalValue]=useState(value??"");if(value!==undefined&&localValue!==value){setLocalValue(value);}let t1;let t2;if($[0]===Symbol.for("react.memo_cache_sentinel")){t1=()=>{const el=hiddenAreaRef.current;if(!el){return;}const cb=()=>{setHeight(el.scrollHeight);};const observer=new ResizeObserver(cb);observer.observe(el);return()=>{observer.disconnect();};};t2=[];$[0]=t1;$[1]=t2;}else{t1=$[0];t2=$[1];}useEffect(t1,t2);let t3;if($[2]===Symbol.for("react.memo_cache_sentinel")){t3=()=>{const el_0=hiddenAreaRef.current;if(el_0){setHeight(el_0.scrollHeight);}};$[2]=t3;}else{t3=$[2];}let t4;if($[3]!==localValue){t4=[localValue];$[3]=localValue;$[4]=t4;}else{t4=$[4];}useLayoutEffect(t3,t4);let containerClassName=custom.container;if(error){containerClassName=containerClassName+` ${custom.error}`;}let t5;if($[5]===Symbol.for("react.memo_cache_sentinel")){t5=()=>{textAreaRef.current?.focus();};$[5]=t5;}else{t5=$[5];}let t6;if($[6]!==custom.label||$[7]!==label){t6=label===undefined?null:/*#__PURE__*/_jsx("div",{className:custom.label,children:label});$[6]=custom.label;$[7]=label;$[8]=t6;}else{t6=$[8];}const t7=`${custom.textarea} ${custom.hidden}`;const t8=localValue||" ";let t9;if($[9]!==t7||$[10]!==t8){t9=/*#__PURE__*/_jsx("textarea",{className:t7,readOnly:true,ref:hiddenAreaRef,tabIndex:-1,value:t8});$[9]=t7;$[10]=t8;$[11]=t9;}else{t9=$[11];}const t10=process.env.NODE_ENV==="production"?undefined:testId;let t11;if($[12]!==onChange||$[13]!==value){t11=value===undefined?e=>{setLocalValue(e.target.value);}:onChange;$[12]=onChange;$[13]=value;$[14]=t11;}else{t11=$[14];}let t12;if($[15]!==ref){t12=node=>{textAreaRef.current=node;if(typeof ref==="function"){ref(node);}else{if(ref){ref.current=node;}}};$[15]=ref;$[16]=t12;}else{t12=$[16];}let t13;if($[17]!==height){t13={height};$[17]=height;$[18]=t13;}else{t13=$[18];}let t14;if($[19]!==custom.textarea||$[20]!==disabled||$[21]!==localValue||$[22]!==onBlur||$[23]!==onKeyDown||$[24]!==placeholder||$[25]!==t10||$[26]!==t11||$[27]!==t12||$[28]!==t13){t14=/*#__PURE__*/_jsx("textarea",{className:custom.textarea,"data-testid":t10,disabled:disabled,onBlur:onBlur,onChange:t11,onKeyDown:onKeyDown,placeholder:placeholder,ref:t12,style:t13,value:localValue});$[19]=custom.textarea;$[20]=disabled;$[21]=localValue;$[22]=onBlur;$[23]=onKeyDown;$[24]=placeholder;$[25]=t10;$[26]=t11;$[27]=t12;$[28]=t13;$[29]=t14;}else{t14=$[29];}let t15;if($[30]!==custom.errorMessage||$[31]!==error){t15=error&&error!==true?/*#__PURE__*/_jsx("div",{className:custom.errorMessage,children:error}):null;$[30]=custom.errorMessage;$[31]=error;$[32]=t15;}else{t15=$[32];}let t16;if($[33]!==containerClassName||$[34]!==t14||$[35]!==t15||$[36]!==t6||$[37]!==t9){t16=/*#__PURE__*/_jsxs("div",{className:containerClassName,onFocus:t5,children:[t6,t9,t14,t15]});$[33]=containerClassName;$[34]=t14;$[35]=t15;$[36]=t6;$[37]=t9;$[38]=t16;}else{t16=$[38];}return t16;};export default TextArea;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|