@dr.pogodin/react-utils 1.25.6 → 1.26.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/babel.config.js +3 -1
- package/bin/build.js +18 -4
- package/build/development/client/getInj.js +9 -8
- package/build/development/client/getInj.js.map +1 -1
- package/build/development/client/index.js +6 -3
- package/build/development/client/index.js.map +1 -1
- package/build/development/client/init.js +4 -0
- package/build/development/client/init.js.map +1 -1
- package/build/development/index.js +166 -38
- package/build/development/index.js.map +1 -1
- package/build/development/server/Cache.js +13 -13
- package/build/development/server/Cache.js.map +1 -1
- package/build/development/server/index.js +16 -23
- package/build/development/server/index.js.map +1 -1
- package/build/development/server/renderer.js +56 -43
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/server/server.js +9 -5
- package/build/development/server/server.js.map +1 -1
- package/build/development/server/utils/errors.js +12 -9
- package/build/development/server/utils/errors.js.map +1 -1
- package/build/development/server/utils/index.js +2 -2
- package/build/development/server/utils/index.js.map +1 -1
- package/build/development/shared/components/Button/index.js +7 -5
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/Checkbox/index.js +24 -26
- package/build/development/shared/components/Checkbox/index.js.map +1 -1
- package/build/development/shared/components/Dropdown/index.js +24 -17
- package/build/development/shared/components/Dropdown/index.js.map +1 -1
- package/build/development/shared/components/GenericLink/index.js +44 -37
- package/build/development/shared/components/GenericLink/index.js.map +1 -1
- package/build/development/shared/components/Input/index.js +7 -7
- package/build/development/shared/components/Input/index.js.map +1 -1
- package/build/development/shared/components/Link.js +10 -9
- package/build/development/shared/components/Link.js.map +1 -1
- package/build/development/shared/components/MetaTags.js +22 -18
- package/build/development/shared/components/MetaTags.js.map +1 -1
- package/build/development/shared/components/Modal/index.js +16 -16
- package/build/development/shared/components/Modal/index.js.map +1 -1
- package/build/development/shared/components/NavLink.js +10 -9
- package/build/development/shared/components/NavLink.js.map +1 -1
- package/build/development/shared/components/PageLayout/index.js +16 -18
- package/build/development/shared/components/PageLayout/index.js.map +1 -1
- package/build/development/shared/components/ScalableRect/index.js +27 -7
- package/build/development/shared/components/ScalableRect/index.js.map +1 -1
- package/build/development/shared/components/Throbber/index.js +14 -22
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/shared/components/WithTooltip/Tooltip.js +19 -21
- package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/development/shared/components/WithTooltip/index.js +11 -10
- package/build/development/shared/components/WithTooltip/index.js.map +1 -1
- package/build/development/shared/components/YouTubeVideo/index.js +15 -13
- package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/development/shared/components/index.js +2 -2
- package/build/development/shared/components/index.js.map +1 -1
- package/build/development/shared/utils/config.js.map +1 -1
- package/build/development/shared/utils/globalState.js +15 -0
- package/build/development/shared/utils/globalState.js.map +1 -0
- package/build/development/shared/utils/index.js +13 -10
- package/build/development/shared/utils/index.js.map +1 -1
- package/build/development/shared/utils/isomorphy/buildInfo.js +7 -3
- package/build/development/shared/utils/isomorphy/buildInfo.js.map +1 -1
- package/build/development/shared/utils/isomorphy/environment-check.js.map +1 -1
- package/build/development/shared/utils/isomorphy/index.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js +35 -28
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/shared/utils/jest/global.js +17 -0
- package/build/development/shared/utils/jest/global.js.map +1 -0
- package/build/development/shared/utils/jest/index.js +17 -9
- package/build/development/shared/utils/jest/index.js.map +1 -1
- package/build/development/shared/utils/splitComponent.js +25 -34
- package/build/development/shared/utils/splitComponent.js.map +1 -1
- package/build/development/shared/utils/time.js +16 -12
- package/build/development/shared/utils/time.js.map +1 -1
- package/build/development/shared/utils/webpack.js +3 -3
- package/build/development/shared/utils/webpack.js.map +1 -1
- package/build/development/web.bundle.js +92 -82
- package/build/production/client/getInj.js +1 -1
- package/build/production/client/getInj.js.map +1 -1
- package/build/production/client/index.js +4 -4
- package/build/production/client/index.js.map +1 -1
- package/build/production/client/init.js +3 -1
- package/build/production/client/init.js.map +1 -1
- package/build/production/index.js +1 -1
- package/build/production/index.js.map +1 -1
- package/build/production/server/Cache.js +7 -8
- package/build/production/server/Cache.js.map +1 -1
- package/build/production/server/index.js +5 -4
- package/build/production/server/index.js.map +1 -1
- package/build/production/server/renderer.js +32 -30
- package/build/production/server/renderer.js.map +1 -1
- package/build/production/server/server.js +7 -5
- package/build/production/server/server.js.map +1 -1
- package/build/production/server/utils/errors.js +9 -10
- package/build/production/server/utils/errors.js.map +1 -1
- package/build/production/server/utils/index.js +1 -1
- package/build/production/server/utils/index.js.map +1 -1
- package/build/production/shared/components/Button/index.js +3 -3
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/Checkbox/index.js +11 -11
- package/build/production/shared/components/Checkbox/index.js.map +1 -1
- package/build/production/shared/components/Dropdown/index.js +11 -11
- package/build/production/shared/components/Dropdown/index.js.map +1 -1
- package/build/production/shared/components/GenericLink/index.js +25 -20
- package/build/production/shared/components/GenericLink/index.js.map +1 -1
- package/build/production/shared/components/Input/index.js +7 -7
- package/build/production/shared/components/Input/index.js.map +1 -1
- package/build/production/shared/components/Link.js +2 -2
- package/build/production/shared/components/Link.js.map +1 -1
- package/build/production/shared/components/MetaTags.js +10 -10
- package/build/production/shared/components/MetaTags.js.map +1 -1
- package/build/production/shared/components/Modal/index.js +2 -2
- package/build/production/shared/components/Modal/index.js.map +1 -1
- package/build/production/shared/components/NavLink.js +1 -1
- package/build/production/shared/components/NavLink.js.map +1 -1
- package/build/production/shared/components/PageLayout/index.js +2 -2
- package/build/production/shared/components/PageLayout/index.js.map +1 -1
- package/build/production/shared/components/ScalableRect/index.js +7 -3
- package/build/production/shared/components/ScalableRect/index.js.map +1 -1
- package/build/production/shared/components/Throbber/index.js +2 -2
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/shared/components/WithTooltip/Tooltip.js +13 -13
- package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
- package/build/production/shared/components/WithTooltip/index.js +3 -3
- package/build/production/shared/components/WithTooltip/index.js.map +1 -1
- package/build/production/shared/components/YouTubeVideo/index.js +7 -7
- package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
- package/build/production/shared/components/index.js +1 -1
- package/build/production/shared/components/index.js.map +1 -1
- package/build/production/shared/utils/config.js.map +1 -1
- package/build/production/shared/utils/globalState.js +3 -0
- package/build/production/shared/utils/globalState.js.map +1 -0
- package/build/production/shared/utils/index.js +2 -2
- package/build/production/shared/utils/index.js.map +1 -1
- package/build/production/shared/utils/isomorphy/buildInfo.js +7 -4
- package/build/production/shared/utils/isomorphy/buildInfo.js.map +1 -1
- package/build/production/shared/utils/isomorphy/environment-check.js.map +1 -1
- package/build/production/shared/utils/isomorphy/index.js.map +1 -1
- package/build/production/shared/utils/jest/E2eSsrEnv.js +9 -9
- package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/production/shared/utils/jest/global.js +2 -0
- package/build/production/shared/utils/jest/global.js.map +1 -0
- package/build/production/shared/utils/jest/index.js +5 -5
- package/build/production/shared/utils/jest/index.js.map +1 -1
- package/build/production/shared/utils/splitComponent.js +16 -16
- package/build/production/shared/utils/splitComponent.js.map +1 -1
- package/build/production/shared/utils/time.js +12 -8
- package/build/production/shared/utils/time.js.map +1 -1
- package/build/production/shared/utils/webpack.js +3 -3
- package/build/production/shared/utils/webpack.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/client/getInj.d.ts +3 -0
- package/build/types-code/client/index.d.ts +11 -0
- package/build/types-code/client/init.d.ts +9 -0
- package/build/types-code/index.d.ts +10 -0
- package/build/types-code/server/Cache.d.ts +37 -0
- package/build/types-code/server/index.d.ts +145 -0
- package/build/types-code/server/renderer.d.ts +106 -0
- package/build/types-code/server/server.d.ts +41 -0
- package/build/types-code/server/utils/errors.d.ts +104 -0
- package/build/types-code/server/utils/index.d.ts +1 -0
- package/build/types-code/shared/components/Button/index.d.ts +27 -0
- package/build/types-code/shared/components/Checkbox/index.d.ts +21 -0
- package/build/types-code/shared/components/Dropdown/index.d.ts +23 -0
- package/build/types-code/shared/components/GenericLink/index.d.ts +61 -0
- package/build/types-code/shared/components/Input/index.d.ts +11 -0
- package/build/types-code/shared/components/Link.d.ts +12 -0
- package/build/types-code/shared/components/MetaTags.d.ts +68 -0
- package/build/types-code/shared/components/Modal/index.d.ts +26 -0
- package/build/types-code/shared/components/NavLink.d.ts +5 -0
- package/build/types-code/shared/components/PageLayout/index.d.ts +16 -0
- package/build/types-code/shared/components/ScalableRect/index.d.ts +19 -0
- package/build/types-code/shared/components/Throbber/index.d.ts +9 -0
- package/build/types-code/shared/components/WithTooltip/Tooltip.d.ts +23 -0
- package/build/types-code/shared/components/WithTooltip/index.d.ts +17 -0
- package/build/types-code/shared/components/YouTubeVideo/index.d.ts +13 -0
- package/build/types-code/shared/components/index.d.ts +16 -0
- package/build/types-code/shared/utils/config.d.ts +2 -0
- package/build/types-code/shared/utils/globalState.d.ts +20 -0
- package/build/types-code/shared/utils/index.d.ts +52 -0
- package/build/types-code/shared/utils/isomorphy/buildInfo.d.ts +23 -0
- package/build/types-code/shared/utils/isomorphy/environment-check.d.ts +11 -0
- package/build/types-code/shared/utils/isomorphy/index.d.ts +20 -0
- package/build/types-code/shared/utils/jest/E2eSsrEnv.d.ts +31 -0
- package/build/types-code/shared/utils/jest/global.d.ts +12 -0
- package/build/types-code/shared/utils/jest/index.d.ts +85 -0
- package/build/types-code/shared/utils/splitComponent.d.ts +41 -0
- package/build/types-code/shared/utils/time.d.ts +62 -0
- package/build/types-code/shared/utils/webpack.d.ts +18 -0
- package/build/types-scss/__tests__/js/config/publicPath support/__assets__/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/MockPackageA/TestComponent/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/MockPackageB/TestComponent/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/shared/components/NavLink/styles.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentA/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentB/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentC/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/config/publicPath support/__assets__/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/MockPackageA/TestComponent/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/MockPackageB/TestComponent/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/shared/components/NavLink/styles.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentA/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentB/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentC/style.scss.d.ts +1 -0
- package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/style.scss.d.ts +1 -0
- package/build/types-scss/src/shared/components/Button/style.scss.d.ts +6 -0
- package/build/types-scss/src/shared/components/Checkbox/theme.scss.d.ts +6 -0
- package/build/types-scss/src/shared/components/Dropdown/theme.scss.d.ts +9 -0
- package/build/types-scss/src/shared/components/GenericLink/style.scss.d.ts +1 -0
- package/build/types-scss/src/shared/components/Input/theme.scss.d.ts +6 -0
- package/build/types-scss/src/shared/components/Modal/base-theme.scss.d.ts +5 -0
- package/build/types-scss/src/shared/components/PageLayout/base-theme.scss.d.ts +6 -0
- package/build/types-scss/src/shared/components/ScalableRect/style.scss.d.ts +2 -0
- package/build/types-scss/src/shared/components/Throbber/theme.scss.d.ts +6 -0
- package/build/types-scss/src/shared/components/WithTooltip/default-theme.scss.d.ts +7 -0
- package/build/types-scss/src/shared/components/YouTubeVideo/base.scss.d.ts +5 -0
- package/build/types-scss/src/shared/components/YouTubeVideo/throbber.scss.d.ts +4 -0
- package/config/eslint/jest.json +3 -2
- package/config/eslint/typescript.js +34 -0
- package/config/jest/default.js +3 -3
- package/package.json +74 -32
- package/src/client/getInj.ts +43 -0
- package/src/client/index.tsx +40 -0
- package/src/client/init.ts +47 -0
- package/src/index.ts +58 -0
- package/src/server/Cache.ts +68 -0
- package/src/server/index.ts +230 -0
- package/src/server/renderer.tsx +604 -0
- package/src/server/server.ts +309 -0
- package/src/server/utils/errors.ts +135 -0
- package/src/server/utils/index.ts +3 -0
- package/src/shared/components/Button/index.tsx +146 -0
- package/src/shared/components/Button/style.scss +53 -0
- package/src/shared/components/Checkbox/index.tsx +71 -0
- package/src/shared/components/Checkbox/theme.scss +43 -0
- package/src/shared/components/Dropdown/index.tsx +144 -0
- package/src/shared/components/Dropdown/theme.scss +63 -0
- package/src/shared/components/GenericLink/index.tsx +157 -0
- package/src/shared/components/GenericLink/style.scss +3 -0
- package/src/shared/components/Input/index.tsx +59 -0
- package/src/shared/components/Input/theme.scss +27 -0
- package/src/shared/components/Link.tsx +21 -0
- package/src/shared/components/MetaTags.tsx +170 -0
- package/src/shared/components/Modal/base-theme.scss +38 -0
- package/src/shared/components/Modal/index.tsx +144 -0
- package/src/shared/components/Modal/styles.scss +5 -0
- package/src/shared/components/NavLink.tsx +13 -0
- package/src/shared/components/PageLayout/base-theme.scss +30 -0
- package/src/shared/components/PageLayout/index.tsx +76 -0
- package/src/shared/components/ScalableRect/index.tsx +84 -0
- package/src/shared/components/ScalableRect/style.scss +10 -0
- package/src/shared/components/Throbber/index.tsx +43 -0
- package/src/shared/components/Throbber/theme.scss +26 -0
- package/src/shared/components/WithTooltip/Tooltip.tsx +353 -0
- package/src/shared/components/WithTooltip/default-theme.scss +36 -0
- package/src/shared/components/WithTooltip/index.tsx +204 -0
- package/src/shared/components/YouTubeVideo/base.scss +13 -0
- package/src/shared/components/YouTubeVideo/index.tsx +96 -0
- package/src/shared/components/YouTubeVideo/throbber.scss +11 -0
- package/src/shared/components/index.ts +17 -0
- package/src/shared/utils/config.ts +21 -0
- package/src/shared/utils/globalState.ts +29 -0
- package/src/shared/utils/index.ts +105 -0
- package/src/shared/utils/isomorphy/buildInfo.ts +54 -0
- package/src/shared/utils/isomorphy/environment-check.ts +18 -0
- package/src/shared/utils/isomorphy/index.ts +38 -0
- package/src/shared/utils/jest/E2eSsrEnv.ts +250 -0
- package/src/shared/utils/jest/global.ts +19 -0
- package/src/shared/utils/jest/index.tsx +157 -0
- package/src/shared/utils/splitComponent.tsx +255 -0
- package/src/shared/utils/time.ts +118 -0
- package/src/shared/utils/webpack.ts +45 -0
- package/src/styles/_global/reset.css +52 -0
- package/src/styles/global.scss +11 -0
- package/tsconfig.configs.json +18 -0
- package/tsconfig.json +27 -0
- package/tsconfig.types.json +53 -0
- package/typed-scss-modules.config.ts +9 -0
- package/types.d.ts +37 -0
- package/{webpack.config.js → webpack.config.ts} +7 -3
- package/config/babel/node-ssr.js +0 -85
- package/config/babel/webpack.js +0 -123
- package/config/webpack/app-base.js +0 -330
- package/config/webpack/app-development.js +0 -80
- package/config/webpack/app-production.js +0 -60
- package/config/webpack/lib-base.js +0 -155
- package/config/webpack/lib-development.js +0 -45
- package/config/webpack/lib-production.js +0 -44
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import PT from 'prop-types';
|
|
2
|
+
import { type ReactNode, createContext, useMemo } from 'react';
|
|
3
|
+
import { Helmet } from 'react-helmet';
|
|
4
|
+
|
|
5
|
+
type PropsT = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
description: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
siteName?: string;
|
|
10
|
+
socialDescription?: string;
|
|
11
|
+
socialTitle?: string;
|
|
12
|
+
title: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Context = createContext<PropsT>({
|
|
17
|
+
description: '',
|
|
18
|
+
title: '',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The `<MetaTags>` component is an auxiliary wrapper around `react-helmet`,
|
|
23
|
+
* which helps to inject meta tags (page title, a brief content description,
|
|
24
|
+
* and social media thumbnails) into generated pages.
|
|
25
|
+
*
|
|
26
|
+
* When `<MetaTags>` are nested within the app's component tree, meta tags
|
|
27
|
+
* content injected by components encountered down the tree overrides tags
|
|
28
|
+
* injected by previously encountered `<MetaTags>` components.
|
|
29
|
+
*
|
|
30
|
+
* **Children:** `<MetaTags>` children, if any, are rendered at the component's
|
|
31
|
+
* location. The context passes down all meta tag properties of parent
|
|
32
|
+
* `<MetaTag>` instances. These properties can fetched within children
|
|
33
|
+
* hierarchy in the following way, thus facilitating tags modification by
|
|
34
|
+
* children:
|
|
35
|
+
* ```jsx
|
|
36
|
+
* import { useContext } from 'react';
|
|
37
|
+
* import { MetaTags } from '@dr.pogodin/react-utils';
|
|
38
|
+
* export default function SampleComponent() {
|
|
39
|
+
* const { title, description, ...rest } = useContext(MetaTags.Context);
|
|
40
|
+
* // Do something with these props here, e.g. prefix the page title with
|
|
41
|
+
* // the component name:
|
|
42
|
+
* return (
|
|
43
|
+
* <MetaTags title={`Sample component - ${title}`} />
|
|
44
|
+
* );
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
* @param [props]
|
|
48
|
+
* @param [props.description] Page description to use in
|
|
49
|
+
* the `description` meta tag, and as a default description of Open Graph Tags.
|
|
50
|
+
* @param [props.image] The absolute URL of thumbnail image to use
|
|
51
|
+
* in Open Graph Tags (`twitter:image`, and `og:image`). By default these tags
|
|
52
|
+
* are not injected.
|
|
53
|
+
*
|
|
54
|
+
* **BEWARE:** It must be a complete, absolute URL, including the correct
|
|
55
|
+
* website domain and HTTP schema.
|
|
56
|
+
*
|
|
57
|
+
* @param [props.siteName]: The site name to use in `twitter:site`,
|
|
58
|
+
* and `og:sitename` tags. By default these tags are not injected.
|
|
59
|
+
*
|
|
60
|
+
* @param [props.socialDescription] The site description to use in
|
|
61
|
+
* `twitter:description` and `og:description` meta tags. By default the value of
|
|
62
|
+
* `description` prop is used.
|
|
63
|
+
* @param [props.socialTitle] The page title to use in
|
|
64
|
+
* `twitter:title`, `og:title`, and `og:image:alt` tags. By default the value of
|
|
65
|
+
* `title` prop is used. Also the `og:image:alt` tag is only injected if `image`
|
|
66
|
+
* prop is present.
|
|
67
|
+
*
|
|
68
|
+
* @param props.title: The page name to use in the `<title>` tag.
|
|
69
|
+
* It is also used as the default value of `socialTitle` prop.
|
|
70
|
+
*
|
|
71
|
+
* @param [props.url] The page URL to use in `og:url` tag.
|
|
72
|
+
* By default the tag is not injected.
|
|
73
|
+
*/
|
|
74
|
+
const MetaTags: React.FunctionComponent<PropsT> & {
|
|
75
|
+
Context: React.Context<PropsT>;
|
|
76
|
+
} = ({
|
|
77
|
+
children,
|
|
78
|
+
description,
|
|
79
|
+
image,
|
|
80
|
+
siteName,
|
|
81
|
+
socialDescription,
|
|
82
|
+
socialTitle,
|
|
83
|
+
title,
|
|
84
|
+
url,
|
|
85
|
+
}) => {
|
|
86
|
+
const socTitle = socialTitle || title;
|
|
87
|
+
const socDesc = socialDescription || description;
|
|
88
|
+
|
|
89
|
+
const context = useMemo(() => ({
|
|
90
|
+
description,
|
|
91
|
+
image,
|
|
92
|
+
siteName,
|
|
93
|
+
socialDescription,
|
|
94
|
+
socialTitle,
|
|
95
|
+
title,
|
|
96
|
+
url,
|
|
97
|
+
}), [
|
|
98
|
+
description,
|
|
99
|
+
image,
|
|
100
|
+
siteName,
|
|
101
|
+
socialDescription,
|
|
102
|
+
socialTitle,
|
|
103
|
+
title,
|
|
104
|
+
url,
|
|
105
|
+
]);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<Helmet>
|
|
110
|
+
{/* General tags. */}
|
|
111
|
+
<title>
|
|
112
|
+
{title}
|
|
113
|
+
</title>
|
|
114
|
+
<meta name="description" content={description} />
|
|
115
|
+
|
|
116
|
+
{/* Twitter cards. */}
|
|
117
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
118
|
+
<meta name="twitter:title" content={socTitle} />
|
|
119
|
+
<meta name="twitter:description" content={socDesc} />
|
|
120
|
+
{ image ? <meta name="twitter:image" content={image} /> : null }
|
|
121
|
+
{
|
|
122
|
+
siteName ? (
|
|
123
|
+
<meta name="twitter:site" content={`@${siteName}`} />
|
|
124
|
+
) : null
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
{/* Open Graph data. */}
|
|
128
|
+
<meta name="og:title" content={socTitle} />
|
|
129
|
+
{ image ? <meta name="og:image" content={image} /> : null }
|
|
130
|
+
{ image ? <meta name="og:image:alt" content={socTitle} /> : null }
|
|
131
|
+
<meta name="og:description" content={socDesc} />
|
|
132
|
+
{
|
|
133
|
+
siteName ? (<meta name="og:sitename" content={siteName} />) : null
|
|
134
|
+
}
|
|
135
|
+
{ url ? (<meta name="og:url" content={url} />) : null }
|
|
136
|
+
</Helmet>
|
|
137
|
+
{
|
|
138
|
+
children ? (
|
|
139
|
+
<Context.Provider value={context}>
|
|
140
|
+
{children}
|
|
141
|
+
</Context.Provider>
|
|
142
|
+
) : null
|
|
143
|
+
}
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
MetaTags.Context = Context;
|
|
149
|
+
|
|
150
|
+
MetaTags.defaultProps = {
|
|
151
|
+
children: null,
|
|
152
|
+
image: '',
|
|
153
|
+
siteName: '',
|
|
154
|
+
socialDescription: '',
|
|
155
|
+
socialTitle: '',
|
|
156
|
+
url: '',
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
MetaTags.propTypes = {
|
|
160
|
+
children: PT.node,
|
|
161
|
+
description: PT.string.isRequired,
|
|
162
|
+
image: PT.string,
|
|
163
|
+
siteName: PT.string,
|
|
164
|
+
socialDescription: PT.string,
|
|
165
|
+
socialTitle: PT.string,
|
|
166
|
+
title: PT.string.isRequired,
|
|
167
|
+
url: PT.string,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default MetaTags;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import "styles/mixins";
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
.context,
|
|
5
|
+
.ad.hoc {
|
|
6
|
+
&.overlay {
|
|
7
|
+
background: #eee;
|
|
8
|
+
height: 100%;
|
|
9
|
+
left: 0;
|
|
10
|
+
opacity: 0.8;
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
width: 100%;
|
|
14
|
+
z-index: 998;
|
|
15
|
+
|
|
16
|
+
&:focus { outline: none; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.container {
|
|
20
|
+
background: #fff;
|
|
21
|
+
box-shadow: 0 0 14px 1px rgba(38 38 40 / 15%);
|
|
22
|
+
border-radius: 4;
|
|
23
|
+
max-height: 95vh;
|
|
24
|
+
max-width: $screen-md;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
padding: 0.6em 1.2em;
|
|
27
|
+
width: 480px;
|
|
28
|
+
position: fixed;
|
|
29
|
+
top: 50%;
|
|
30
|
+
left: 50%;
|
|
31
|
+
transform: translate(-50%, -50%);
|
|
32
|
+
z-index: 999;
|
|
33
|
+
|
|
34
|
+
@include xs-to-lg {
|
|
35
|
+
max-width: 95vw;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* global document */
|
|
2
|
+
|
|
3
|
+
import { noop } from 'lodash';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type ReactNode,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'react';
|
|
12
|
+
|
|
13
|
+
import ReactDom from 'react-dom';
|
|
14
|
+
import PT from 'prop-types';
|
|
15
|
+
import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
16
|
+
|
|
17
|
+
import baseTheme from './base-theme.scss';
|
|
18
|
+
import './styles.scss';
|
|
19
|
+
|
|
20
|
+
type PropsT = {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
onCancel?: () => void;
|
|
23
|
+
theme: Theme & {
|
|
24
|
+
container?: string;
|
|
25
|
+
overlay?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The `<Modal>` component implements a simple themeable modal window, wrapped
|
|
31
|
+
* into the default theme. `<BaseModal>` exposes the base non-themed component.
|
|
32
|
+
* **Children:** Component children are rendered as the modal content.
|
|
33
|
+
* @param {object} props Component properties. Beside props documented below,
|
|
34
|
+
* [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.
|
|
35
|
+
* @param {function} [props.onCancel] The callback to trigger when user
|
|
36
|
+
* clicks outside the modal, or presses Escape. It is expected to hide the
|
|
37
|
+
* modal.
|
|
38
|
+
* @param {ModalTheme} [props.theme] _Ad hoc_ theme.
|
|
39
|
+
*/
|
|
40
|
+
const BaseModal: React.FunctionComponent<PropsT> = ({
|
|
41
|
+
children,
|
|
42
|
+
onCancel,
|
|
43
|
+
theme,
|
|
44
|
+
}) => {
|
|
45
|
+
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
46
|
+
const overlayRef = useRef<HTMLDivElement | null>(null);
|
|
47
|
+
const [portal, setPortal] = useState<HTMLDivElement>();
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const p = document.createElement('div');
|
|
51
|
+
document.body.classList.add('scrolling-disabled-by-modal');
|
|
52
|
+
document.body.appendChild(p);
|
|
53
|
+
setPortal(p);
|
|
54
|
+
return () => {
|
|
55
|
+
document.body.classList.remove('scrolling-disabled-by-modal');
|
|
56
|
+
document.body.removeChild(p);
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
const focusLast = useMemo(() => (
|
|
61
|
+
<div
|
|
62
|
+
onFocus={() => {
|
|
63
|
+
const elems = containerRef.current?.querySelectorAll('*') as NodeListOf<HTMLElement>;
|
|
64
|
+
for (let i = elems.length - 1; i >= 0; --i) {
|
|
65
|
+
elems[i].focus();
|
|
66
|
+
if (document.activeElement === elems[i]) return;
|
|
67
|
+
}
|
|
68
|
+
overlayRef.current?.focus();
|
|
69
|
+
}}
|
|
70
|
+
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
71
|
+
tabIndex={0}
|
|
72
|
+
/* eslint-enable jsx-a11y/no-noninteractive-tabindex */
|
|
73
|
+
/>
|
|
74
|
+
), []);
|
|
75
|
+
|
|
76
|
+
return portal ? ReactDom.createPortal(
|
|
77
|
+
(
|
|
78
|
+
<>
|
|
79
|
+
{focusLast}
|
|
80
|
+
<div
|
|
81
|
+
aria-label="Cancel"
|
|
82
|
+
className={theme.overlay}
|
|
83
|
+
onClick={() => onCancel && onCancel()}
|
|
84
|
+
onKeyDown={(e) => {
|
|
85
|
+
if (e.key === 'Escape' && onCancel) onCancel();
|
|
86
|
+
}}
|
|
87
|
+
ref={(node) => {
|
|
88
|
+
if (node && node !== overlayRef.current) {
|
|
89
|
+
overlayRef.current = node;
|
|
90
|
+
node.focus();
|
|
91
|
+
}
|
|
92
|
+
}}
|
|
93
|
+
role="button"
|
|
94
|
+
tabIndex={0}
|
|
95
|
+
/>
|
|
96
|
+
<div
|
|
97
|
+
aria-modal="true"
|
|
98
|
+
className={theme.container}
|
|
99
|
+
onWheel={(event) => event.stopPropagation()}
|
|
100
|
+
ref={containerRef}
|
|
101
|
+
role="dialog"
|
|
102
|
+
>
|
|
103
|
+
{children}
|
|
104
|
+
</div>
|
|
105
|
+
<div
|
|
106
|
+
onFocus={() => {
|
|
107
|
+
overlayRef.current?.focus();
|
|
108
|
+
}}
|
|
109
|
+
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
110
|
+
tabIndex={0}
|
|
111
|
+
/* eslint-enable jsx-a11y/no-noninteractive-tabindex */
|
|
112
|
+
/>
|
|
113
|
+
{focusLast}
|
|
114
|
+
</>
|
|
115
|
+
),
|
|
116
|
+
portal,
|
|
117
|
+
) : null;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const ThemedModal = themed(
|
|
121
|
+
BaseModal,
|
|
122
|
+
'Modal',
|
|
123
|
+
[
|
|
124
|
+
'container',
|
|
125
|
+
'overlay',
|
|
126
|
+
],
|
|
127
|
+
baseTheme,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
BaseModal.propTypes = {
|
|
131
|
+
onCancel: PT.func,
|
|
132
|
+
children: PT.node,
|
|
133
|
+
theme: ThemedModal.themeType.isRequired,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
BaseModal.defaultProps = {
|
|
137
|
+
onCancel: noop,
|
|
138
|
+
children: null,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default ThemedModal;
|
|
142
|
+
|
|
143
|
+
/* Non-themed version of the Modal. */
|
|
144
|
+
export { BaseModal };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NavLink as RrNavLink } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
import GenericLink, { type PropsT as GenericLinkPropsT } from './GenericLink';
|
|
4
|
+
|
|
5
|
+
type PropsT = Omit<GenericLinkPropsT, 'routerLinkType'>;
|
|
6
|
+
|
|
7
|
+
const NavLink: React.FunctionComponent<PropsT> = (props) => (
|
|
8
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
|
9
|
+
<GenericLink {...props} routerLinkType={RrNavLink} />
|
|
10
|
+
/* eslint-enable react/jsx-props-no-spreading */
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default NavLink;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base theme: symmetric 3-columns layout, with the center column occupying all
|
|
3
|
+
* screen up to mid screen size. For larger screen sizes the main column is
|
|
4
|
+
* limited by the mid screen size, and the free space is filled with side
|
|
5
|
+
* columns on left and right.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@import "styles/mixins";
|
|
9
|
+
|
|
10
|
+
*,
|
|
11
|
+
.context,
|
|
12
|
+
.ad.hoc {
|
|
13
|
+
&.container {
|
|
14
|
+
display: flex;
|
|
15
|
+
min-height: 100vh;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.mainPanel {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
padding: 1.2em;
|
|
23
|
+
width: $screen-md;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.sidePanel {
|
|
27
|
+
flex: 1;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import PT from 'prop-types';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
5
|
+
|
|
6
|
+
import baseTheme from './base-theme.scss';
|
|
7
|
+
|
|
8
|
+
type PropsT = {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
leftSidePanelContent?: ReactNode;
|
|
11
|
+
rightSidePanelContent?: ReactNode;
|
|
12
|
+
theme: Theme & {
|
|
13
|
+
container?: string;
|
|
14
|
+
mainPanel?: string;
|
|
15
|
+
sidePanel?: string;
|
|
16
|
+
leftSidePanel?: string;
|
|
17
|
+
rightSidePanel?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Simple and themeable page layout. It keeps the main content centered in
|
|
23
|
+
* a column of limited width, which fills entire viewport on small screens
|
|
24
|
+
* (under `$screen-md = 1024px` size). At larger screens the column keeps
|
|
25
|
+
* `$screen-md` size, and it is centered at the page, surrounded by side
|
|
26
|
+
* panels, where additional content can be displayed.
|
|
27
|
+
*
|
|
28
|
+
* **Children:** Component children are rendered as the content of main panel.
|
|
29
|
+
* @param {object} [props] Component properties.
|
|
30
|
+
* @param {Node} [props.leftSidePanelContent] The content for left side panel.
|
|
31
|
+
* @param {Node} [props.rightSidePanelContent] The content for right side panel.
|
|
32
|
+
* @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.
|
|
33
|
+
* @param {...any} [props....]
|
|
34
|
+
* [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
|
|
35
|
+
*/
|
|
36
|
+
const PageLayout: React.FunctionComponent<PropsT> = ({
|
|
37
|
+
children,
|
|
38
|
+
leftSidePanelContent,
|
|
39
|
+
rightSidePanelContent,
|
|
40
|
+
theme,
|
|
41
|
+
}) => (
|
|
42
|
+
<div className={theme.container}>
|
|
43
|
+
<div className={[theme.sidePanel, theme.leftSidePanel].join(' ')}>
|
|
44
|
+
{leftSidePanelContent}
|
|
45
|
+
</div>
|
|
46
|
+
<div className={theme.mainPanel}>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
<div className={[theme.sidePanel, theme.rightSidePanel].join(' ')}>
|
|
50
|
+
{rightSidePanelContent}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const ThemedPageLayout = themed(PageLayout, 'PageLayout', [
|
|
56
|
+
'container',
|
|
57
|
+
'leftSidePanel',
|
|
58
|
+
'mainPanel',
|
|
59
|
+
'rightSidePanel',
|
|
60
|
+
'sidePanel',
|
|
61
|
+
], baseTheme);
|
|
62
|
+
|
|
63
|
+
PageLayout.propTypes = {
|
|
64
|
+
children: PT.node,
|
|
65
|
+
leftSidePanelContent: PT.node,
|
|
66
|
+
rightSidePanelContent: PT.node,
|
|
67
|
+
theme: ThemedPageLayout.themeType.isRequired,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
PageLayout.defaultProps = {
|
|
71
|
+
children: null,
|
|
72
|
+
leftSidePanelContent: null,
|
|
73
|
+
rightSidePanelContent: null,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default ThemedPageLayout;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import PT from 'prop-types';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import './style.scss';
|
|
5
|
+
|
|
6
|
+
type PropsT = {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
ratio?: `${number}:${number}`,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The `<ScalableRect>` component implements container keeping given aspect
|
|
14
|
+
* ratio, while its width is altered.
|
|
15
|
+
*
|
|
16
|
+
* **Children:** Component children are rendered as the component's content.
|
|
17
|
+
* @param {object} props
|
|
18
|
+
* @param {string} [props.className] CSS class for component container.
|
|
19
|
+
* @param {string} [props.ratio=1:1] Ratio of the rendered rectangle sides,
|
|
20
|
+
* in `W:H` form.
|
|
21
|
+
*/
|
|
22
|
+
const ScalableRect: React.FunctionComponent<PropsT> = ({
|
|
23
|
+
children,
|
|
24
|
+
className,
|
|
25
|
+
ratio,
|
|
26
|
+
}) => {
|
|
27
|
+
const aux = ratio!.split(':');
|
|
28
|
+
const paddingBottom = `${(100 * parseFloat(aux[1])) / parseFloat(aux[0])}%`;
|
|
29
|
+
|
|
30
|
+
/* NOTE: In case the following code looks strange to you, mind that we want to
|
|
31
|
+
* allow the user to set custom styles on this component. If user passes in a
|
|
32
|
+
* "className" prop (possibly "styleName", but that one is converted to
|
|
33
|
+
* "className" by Babel just before being passed into this component), it
|
|
34
|
+
* should not interfere with the sizing behavior, thus we need an extra <div>
|
|
35
|
+
* level in this component; however, if user does not need a custom styling,
|
|
36
|
+
* we can save one level of HTML code, so we do it. */
|
|
37
|
+
const rect = (
|
|
38
|
+
<div
|
|
39
|
+
style={{ paddingBottom }}
|
|
40
|
+
styleName="container"
|
|
41
|
+
>
|
|
42
|
+
<div styleName="wrapper">
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
return className ? (
|
|
48
|
+
<div className={className}>
|
|
49
|
+
{rect}
|
|
50
|
+
</div>
|
|
51
|
+
) : rect;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
ScalableRect.defaultProps = {
|
|
55
|
+
children: null,
|
|
56
|
+
className: undefined,
|
|
57
|
+
ratio: '1:1',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
ScalableRect.propTypes = {
|
|
61
|
+
children: PT.node,
|
|
62
|
+
className: PT.string,
|
|
63
|
+
ratio: (props, name) => {
|
|
64
|
+
const ratio = props[name];
|
|
65
|
+
|
|
66
|
+
// "ratio" prop is not required (defaults "1:1").
|
|
67
|
+
if (ratio === undefined) return null;
|
|
68
|
+
|
|
69
|
+
// If given, "ratio" must be a string.
|
|
70
|
+
if (typeof ratio !== 'string') {
|
|
71
|
+
return Error('"ratio" prop must be a string');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// If given, "ratio" must have "H:W" format.
|
|
75
|
+
if (!ratio.match(/\d\.\d+/)) {
|
|
76
|
+
return Error('"ratio" prop must have "H:W" format');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Everything looks right.
|
|
80
|
+
return null;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default ScalableRect;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import themed, { type Theme } from '@dr.pogodin/react-themes';
|
|
2
|
+
|
|
3
|
+
import defaultTheme from './theme.scss';
|
|
4
|
+
|
|
5
|
+
type PropsT = {
|
|
6
|
+
theme: Theme & {
|
|
7
|
+
container?: string;
|
|
8
|
+
circle?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Throbber is an "action in progress" indicator, which renders
|
|
14
|
+
* three bouncing circles as a simple pending activity indicator,
|
|
15
|
+
* and can be further themed to a certain degree.
|
|
16
|
+
* @param {object} [props] Component properties.
|
|
17
|
+
* @param {ThrobberTheme} [props.theme] _Ad hoc_ theme.
|
|
18
|
+
* @param {...any} [props....]
|
|
19
|
+
* [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
|
|
20
|
+
*/
|
|
21
|
+
const Throbber: React.FunctionComponent<PropsT> = ({ theme }) => (
|
|
22
|
+
<span className={theme.container} styleName="container">
|
|
23
|
+
<span className={theme.circle} styleName="circle" />
|
|
24
|
+
<span className={theme.circle} styleName="circle" />
|
|
25
|
+
<span className={theme.circle} styleName="circle" />
|
|
26
|
+
</span>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const ThemedThrobber = themed(
|
|
30
|
+
Throbber,
|
|
31
|
+
'Throbber',
|
|
32
|
+
[
|
|
33
|
+
'circle',
|
|
34
|
+
'container',
|
|
35
|
+
],
|
|
36
|
+
defaultTheme,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
Throbber.propTypes = {
|
|
40
|
+
theme: ThemedThrobber.themeType.isRequired,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default ThemedThrobber;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
*,
|
|
2
|
+
.context,
|
|
3
|
+
.ad.hoc {
|
|
4
|
+
&.container {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&.circle {
|
|
9
|
+
@keyframes bouncing {
|
|
10
|
+
from { top: -0.3em; }
|
|
11
|
+
to { top: 0.3em; }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
animation: bouncing 0.4s ease-in infinite alternate;
|
|
15
|
+
background: black;
|
|
16
|
+
border-radius: 0.3em;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
height: 0.6em;
|
|
19
|
+
margin: 0 0.1em;
|
|
20
|
+
position: relative;
|
|
21
|
+
width: 0.6em;
|
|
22
|
+
|
|
23
|
+
&:first-child { animation-delay: -0.2s; }
|
|
24
|
+
&:last-child { animation-delay: 0.2s; }
|
|
25
|
+
}
|
|
26
|
+
}
|