@salutejs/plasma-new-hope 0.157.1-canary.1412.11127658499.0 → 0.158.0-canary.1443.11125700749.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Drawer/Drawer.css +3 -4
- package/cjs/components/Drawer/Drawer.js +1 -1
- package/cjs/components/Drawer/Drawer.styles.js +0 -3
- package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
- package/cjs/components/Drawer/hooks/useDrawer.js +1 -1
- package/cjs/components/Modal/Modal.css +3 -4
- package/cjs/components/Modal/hooks/useModal.js +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +3 -4
- package/cjs/components/Popup/Popup.css +3 -0
- package/cjs/components/Popup/Popup.js +41 -29
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Popup/Popup.styles.js +27 -55
- package/cjs/components/Popup/Popup.styles.js.map +1 -1
- package/cjs/components/Popup/Popup.styles_141jyqa.css +3 -0
- package/cjs/components/Popup/PopupContext.js +10 -30
- package/cjs/components/Popup/PopupContext.js.map +1 -1
- package/cjs/components/Popup/PopupRoot.js +1 -1
- package/cjs/components/Popup/PopupRoot.js.map +1 -1
- package/cjs/components/Popup/hooks/usePopup.js +3 -6
- package/cjs/components/Popup/hooks/usePopup.js.map +1 -1
- package/cjs/components/Steps/Steps.css +18 -0
- package/cjs/components/Steps/Steps.js +118 -0
- package/cjs/components/Steps/Steps.js.map +1 -0
- package/cjs/components/Steps/Steps.styles.js +9 -0
- package/cjs/components/Steps/Steps.styles.js.map +1 -0
- package/cjs/components/Steps/Steps.styles_1qandre.css +1 -0
- package/cjs/components/Steps/Steps.tokens.js +81 -0
- package/cjs/components/Steps/Steps.tokens.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.css +16 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.js +117 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +83 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles_1nnkvta.css +9 -0
- package/cjs/components/Steps/variations/_size/base.js +9 -0
- package/cjs/components/Steps/variations/_size/base.js.map +1 -0
- package/cjs/components/Steps/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Steps/variations/_view/base.js +9 -0
- package/cjs/components/Steps/variations/_view/base.js.map +1 -0
- package/cjs/components/Steps/variations/_view/base_x642ct.css +1 -0
- package/cjs/index.css +15 -4
- package/cjs/index.js +5 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Popup/Popup.js +41 -29
- package/emotion/cjs/components/Popup/Popup.styles.js +17 -35
- package/emotion/cjs/components/Popup/PopupContext.js +10 -30
- package/emotion/cjs/components/Popup/PopupRoot.js +3 -1
- package/emotion/cjs/components/Popup/hooks/usePopup.js +3 -6
- package/emotion/cjs/components/Steps/Steps.js +130 -0
- package/emotion/cjs/components/Steps/Steps.review-doc.mdx +304 -0
- package/emotion/cjs/components/Steps/Steps.styles.js +9 -0
- package/emotion/cjs/components/Steps/Steps.template-doc.mdx +78 -0
- package/emotion/cjs/components/Steps/Steps.tokens.js +79 -0
- package/emotion/cjs/components/Steps/Steps.types.js +5 -0
- package/emotion/cjs/components/Steps/index.js +25 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.js +127 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +52 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.types.js +5 -0
- package/emotion/cjs/components/Steps/ui/StepItem/index.js +12 -0
- package/emotion/cjs/components/Steps/ui/index.js +16 -0
- package/emotion/cjs/components/Steps/variations/_size/base.js +8 -0
- package/emotion/cjs/components/Steps/variations/_size/tokens.json +1 -0
- package/emotion/cjs/components/Steps/variations/_view/base.js +8 -0
- package/emotion/cjs/components/Steps/variations/_view/tokens.json +1 -0
- package/emotion/cjs/examples/plasma_b2c/components/Modal/Modal.stories.tsx +0 -3
- package/emotion/cjs/examples/plasma_b2c/components/Popup/Popup.stories.tsx +0 -3
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +25 -0
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.js +13 -0
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/cjs/examples/plasma_web/components/Modal/Modal.stories.tsx +0 -3
- package/emotion/cjs/examples/plasma_web/components/Popup/Popup.stories.tsx +0 -3
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Popup/Popup.js +43 -30
- package/emotion/es/components/Popup/Popup.styles.js +16 -34
- package/emotion/es/components/Popup/PopupContext.js +11 -30
- package/emotion/es/components/Popup/PopupRoot.js +3 -1
- package/emotion/es/components/Popup/hooks/usePopup.js +3 -6
- package/emotion/es/components/Steps/Steps.js +121 -0
- package/emotion/es/components/Steps/Steps.review-doc.mdx +304 -0
- package/emotion/es/components/Steps/Steps.styles.js +3 -0
- package/emotion/es/components/Steps/Steps.template-doc.mdx +78 -0
- package/emotion/es/components/Steps/Steps.tokens.js +73 -0
- package/emotion/es/components/Steps/Steps.types.js +1 -0
- package/emotion/es/components/Steps/index.js +2 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.js +118 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +45 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.types.js +1 -0
- package/emotion/es/components/Steps/ui/StepItem/index.js +1 -0
- package/emotion/es/components/Steps/ui/index.js +1 -0
- package/emotion/es/components/Steps/variations/_size/base.js +2 -0
- package/emotion/es/components/Steps/variations/_size/tokens.json +1 -0
- package/emotion/es/components/Steps/variations/_view/base.js +2 -0
- package/emotion/es/components/Steps/variations/_view/tokens.json +1 -0
- package/emotion/es/examples/plasma_b2c/components/Modal/Modal.stories.tsx +0 -3
- package/emotion/es/examples/plasma_b2c/components/Popup/Popup.stories.tsx +0 -3
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +19 -0
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.js +9 -0
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/es/examples/plasma_web/components/Modal/Modal.stories.tsx +0 -3
- package/emotion/es/examples/plasma_web/components/Popup/Popup.stories.tsx +0 -3
- package/emotion/es/index.js +1 -0
- package/es/components/Drawer/Drawer.css +3 -4
- package/es/components/Drawer/Drawer.js +1 -1
- package/es/components/Drawer/Drawer.styles.js +0 -3
- package/es/components/Drawer/Drawer.styles.js.map +1 -1
- package/es/components/Drawer/hooks/useDrawer.js +1 -1
- package/es/components/Modal/Modal.css +3 -4
- package/es/components/Modal/hooks/useModal.js +1 -1
- package/es/components/Notification/NotificationsProvider.css +3 -4
- package/es/components/Popup/Popup.css +3 -0
- package/es/components/Popup/Popup.js +43 -31
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Popup/Popup.styles.js +28 -54
- package/es/components/Popup/Popup.styles.js.map +1 -1
- package/es/components/Popup/Popup.styles_141jyqa.css +3 -0
- package/es/components/Popup/PopupContext.js +11 -31
- package/es/components/Popup/PopupContext.js.map +1 -1
- package/es/components/Popup/PopupRoot.js +1 -1
- package/es/components/Popup/PopupRoot.js.map +1 -1
- package/es/components/Popup/hooks/usePopup.js +3 -6
- package/es/components/Popup/hooks/usePopup.js.map +1 -1
- package/es/components/Steps/Steps.css +18 -0
- package/es/components/Steps/Steps.js +113 -0
- package/es/components/Steps/Steps.js.map +1 -0
- package/es/components/Steps/Steps.styles.js +5 -0
- package/es/components/Steps/Steps.styles.js.map +1 -0
- package/es/components/Steps/Steps.styles_1qandre.css +1 -0
- package/es/components/Steps/Steps.tokens.js +76 -0
- package/es/components/Steps/Steps.tokens.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.css +16 -0
- package/es/components/Steps/ui/StepItem/StepItem.js +113 -0
- package/es/components/Steps/ui/StepItem/StepItem.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles.js +71 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles_1nnkvta.css +9 -0
- package/es/components/Steps/variations/_size/base.js +5 -0
- package/es/components/Steps/variations/_size/base.js.map +1 -0
- package/es/components/Steps/variations/_size/base_x642ct.css +1 -0
- package/es/components/Steps/variations/_view/base.js +5 -0
- package/es/components/Steps/variations/_view/base.js.map +1 -0
- package/es/components/Steps/variations/_view/base_x642ct.css +1 -0
- package/es/index.css +15 -4
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Popup/Popup.js +41 -29
- package/styled-components/cjs/components/Popup/Popup.styles.js +14 -23
- package/styled-components/cjs/components/Popup/PopupContext.js +10 -30
- package/styled-components/cjs/components/Popup/PopupRoot.js +3 -1
- package/styled-components/cjs/components/Popup/hooks/usePopup.js +3 -6
- package/styled-components/cjs/components/Steps/Steps.js +130 -0
- package/styled-components/cjs/components/Steps/Steps.review-doc.mdx +304 -0
- package/styled-components/cjs/components/Steps/Steps.styles.js +9 -0
- package/styled-components/cjs/components/Steps/Steps.template-doc.mdx +78 -0
- package/styled-components/cjs/components/Steps/Steps.tokens.js +79 -0
- package/styled-components/cjs/components/Steps/Steps.types.js +5 -0
- package/styled-components/cjs/components/Steps/index.js +25 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.js +127 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +43 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.types.js +5 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/index.js +12 -0
- package/styled-components/cjs/components/Steps/ui/index.js +16 -0
- package/styled-components/cjs/components/Steps/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Steps/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Steps/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Steps/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Modal/Modal.stories.tsx +0 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Popup/Popup.stories.tsx +0 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +25 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/cjs/examples/plasma_web/components/Modal/Modal.stories.tsx +0 -3
- package/styled-components/cjs/examples/plasma_web/components/Popup/Popup.stories.tsx +0 -3
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Popup/Popup.js +43 -30
- package/styled-components/es/components/Popup/Popup.styles.js +13 -22
- package/styled-components/es/components/Popup/PopupContext.js +11 -30
- package/styled-components/es/components/Popup/PopupRoot.js +3 -1
- package/styled-components/es/components/Popup/hooks/usePopup.js +3 -6
- package/styled-components/es/components/Steps/Steps.js +121 -0
- package/styled-components/es/components/Steps/Steps.review-doc.mdx +304 -0
- package/styled-components/es/components/Steps/Steps.styles.js +3 -0
- package/styled-components/es/components/Steps/Steps.template-doc.mdx +78 -0
- package/styled-components/es/components/Steps/Steps.tokens.js +73 -0
- package/styled-components/es/components/Steps/Steps.types.js +1 -0
- package/styled-components/es/components/Steps/index.js +2 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.js +118 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +36 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.types.js +1 -0
- package/styled-components/es/components/Steps/ui/StepItem/index.js +1 -0
- package/styled-components/es/components/Steps/ui/index.js +1 -0
- package/styled-components/es/components/Steps/variations/_size/base.js +2 -0
- package/styled-components/es/components/Steps/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Steps/variations/_view/base.js +2 -0
- package/styled-components/es/components/Steps/variations/_view/tokens.json +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Modal/Modal.stories.tsx +0 -3
- package/styled-components/es/examples/plasma_b2c/components/Popup/Popup.stories.tsx +0 -3
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +19 -0
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.js +9 -0
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/es/examples/plasma_web/components/Modal/Modal.stories.tsx +0 -3
- package/styled-components/es/examples/plasma_web/components/Popup/Popup.stories.tsx +0 -3
- package/styled-components/es/index.js +1 -0
- package/types/components/Popup/Popup.d.ts +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Popup/Popup.styles.d.ts +1 -4
- package/types/components/Popup/Popup.styles.d.ts.map +1 -1
- package/types/components/Popup/Popup.types.d.ts +0 -3
- package/types/components/Popup/Popup.types.d.ts.map +1 -1
- package/types/components/Popup/PopupContext.d.ts.map +1 -1
- package/types/components/Popup/hooks/usePopup.d.ts +1 -2
- package/types/components/Popup/hooks/usePopup.d.ts.map +1 -1
- package/types/components/Steps/Steps.d.ts +23 -0
- package/types/components/Steps/Steps.d.ts.map +1 -0
- package/types/components/Steps/Steps.styles.d.ts +2 -0
- package/types/components/Steps/Steps.styles.d.ts.map +1 -0
- package/types/components/Steps/Steps.tokens.d.ts +74 -0
- package/types/components/Steps/Steps.tokens.d.ts.map +1 -0
- package/types/components/Steps/Steps.types.d.ts +55 -0
- package/types/components/Steps/Steps.types.d.ts.map +1 -0
- package/types/components/Steps/index.d.ts +4 -0
- package/types/components/Steps/index.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.d.ts +17 -0
- package/types/components/Steps/ui/StepItem/StepItem.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts +20 -0
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.types.d.ts +35 -0
- package/types/components/Steps/ui/StepItem/StepItem.types.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/index.d.ts +3 -0
- package/types/components/Steps/ui/StepItem/index.d.ts.map +1 -0
- package/types/components/Steps/ui/index.d.ts +2 -0
- package/types/components/Steps/ui/index.d.ts.map +1 -0
- package/types/components/Steps/variations/_size/base.d.ts +2 -0
- package/types/components/Steps/variations/_size/base.d.ts.map +1 -0
- package/types/components/Steps/variations/_view/base.d.ts +2 -0
- package/types/components/Steps/variations/_view/base.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts +18 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.d.ts +35 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/cjs/components/Popup/Popup.styles_1uw5px0.css +0 -4
- package/cjs/components/Popup/PopupContext.css +0 -4
- package/es/components/Popup/Popup.styles_1uw5px0.css +0 -4
- package/es/components/Popup/PopupContext.css +0 -4
@@ -2,27 +2,9 @@ import _styled from "@emotion/styled/base";
|
|
2
2
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
3
3
|
import { DEFAULT_Z_INDEX } from './utils';
|
4
4
|
export var StyledPortal = /*#__PURE__*/_styled("div", {
|
5
|
-
target: "eaqy7mk3",
|
6
|
-
label: "plasma-new-hope__StyledPortal"
|
7
|
-
})("position:fixed;top:0;left:0;right:0;bottom:0;z-index:", DEFAULT_Z_INDEX, ";width:", function (_ref) {
|
8
|
-
var hasContent = _ref.hasContent;
|
9
|
-
return hasContent ? 'auto' : '0';
|
10
|
-
}, ";pointer-events:", function (_ref2) {
|
11
|
-
var hasContent = _ref2.hasContent;
|
12
|
-
return hasContent ? 'auto' : 'none';
|
13
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application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ByZWxhdGl2ZTtcbiAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb3B1cFJvb3RDb250YWluZXIgPSBzdHlsZWQuZGl2PFBvcHVwUm9vdENvbnRhaW5lclByb3BzPmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgei1pbmRleDogJHsoeyB6SW5kZXggfSkgPT4gekluZGV4IHx8IERFRkFVTFRfWl9JTkRFWH07XG4gICAgbGVmdDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5sZWZ0IHx8ICcnfTtcbiAgICByaWdodDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5yaWdodCB8fCAnJ307XG4gICAgdG9wOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRvcCB8fCAnJ307XG4gICAgYm90dG9tOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLmJvdHRvbSB8fCAnJ307XG4gICAgdHJhbnNmb3JtOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRyYW5zZm9ybSB8fCAnJ307XG5gO1xuIl19 */"));
|
14
|
-
export var StyledPortalContainer = /*#__PURE__*/_styled("div", {
|
15
5
|
target: "eaqy7mk2",
|
16
|
-
label: "plasma-new-
|
17
|
-
})(process.env.NODE_ENV === "production" ?
|
18
|
-
name: "k2uqvh",
|
19
|
-
styles: "width:0"
|
20
|
-
} : {
|
21
|
-
name: "k2uqvh",
|
22
|
-
styles: "width:0",
|
23
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUG9wdXAvUG9wdXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCK0MiLC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9wcz5gXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleCB8fCBERUZBVUxUX1pfSU5ERVh9O1xuICAgIGxlZnQ6ICR7KHsgcG9zaXRpb24gfSkgPT4gcG9zaXRpb24ubGVmdCB8fCAnJ307XG4gICAgcmlnaHQ6ICR7KHsgcG9zaXRpb24gfSkgPT4gcG9zaXRpb24ucmlnaHQgfHwgJyd9O1xuICAgIHRvcDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi50b3AgfHwgJyd9O1xuICAgIGJvdHRvbTogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5ib3R0b20gfHwgJyd9O1xuICAgIHRyYW5zZm9ybTogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi50cmFuc2Zvcm0gfHwgJyd9O1xuYDtcbiJdfQ== */",
|
24
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
25
|
-
});
|
6
|
+
label: "plasma-new-hope__StyledPortal"
|
7
|
+
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUG9wdXAvUG9wdXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtzQyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1BvcHVwL1BvcHVwLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW1wb3J0IHR5cGUgeyBQb3B1cFJvb3RDb250YWluZXJQcm9wcyB9IGZyb20gJy4vUG9wdXAudHlwZXMnO1xuaW1wb3J0IHsgREVGQVVMVF9aX0lOREVYIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRQb3J0YWwgPSBzdHlsZWQuZGl2YGA7XG5cbmV4cG9ydCBjb25zdCBQb3B1cFZpZXcgPSBzdHlsZWQuZGl2YFxuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb3B1cFJvb3RDb250YWluZXIgPSBzdHlsZWQuZGl2PFBvcHVwUm9vdENvbnRhaW5lclByb3BzPmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgei1pbmRleDogJHsoeyB6SW5kZXggfSkgPT4gekluZGV4IHx8IERFRkFVTFRfWl9JTkRFWH07XG4gICAgbGVmdDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5sZWZ0IHx8ICcnfTtcbiAgICByaWdodDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5yaWdodCB8fCAnJ307XG4gICAgdG9wOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRvcCB8fCAnJ307XG4gICAgYm90dG9tOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLmJvdHRvbSB8fCAnJ307XG4gICAgdHJhbnNmb3JtOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRyYW5zZm9ybSB8fCAnJ307XG5gO1xuIl19 */");
|
26
8
|
export var PopupView = /*#__PURE__*/_styled("div", {
|
27
9
|
target: "eaqy7mk1",
|
28
10
|
label: "plasma-new-hope__PopupView"
|
@@ -32,28 +14,28 @@ export var PopupView = /*#__PURE__*/_styled("div", {
|
|
32
14
|
} : {
|
33
15
|
name: "1m82nn4",
|
34
16
|
styles: "position:relative;max-width:100%;pointer-events:all",
|
35
|
-
map: "/*# sourceMappingURL=data:application/json;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CAnJ307XG4gICAgdG9wOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRvcCB8fCAnJ307XG4gICAgYm90dG9tOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLmJvdHRvbSB8fCAnJ307XG4gICAgdHJhbnNmb3JtOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRyYW5zZm9ybSB8fCAnJ307XG5gO1xuIl19 */",
|
36
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
37
19
|
});
|
38
20
|
export var PopupRootContainer = /*#__PURE__*/_styled("div", {
|
39
21
|
target: "eaqy7mk0",
|
40
22
|
label: "plasma-new-hope__PopupRootContainer"
|
41
|
-
})("position:absolute;z-index:", function (
|
42
|
-
var zIndex =
|
23
|
+
})("position:absolute;z-index:", function (_ref) {
|
24
|
+
var zIndex = _ref.zIndex;
|
43
25
|
return zIndex || DEFAULT_Z_INDEX;
|
44
|
-
}, ";left:", function (
|
45
|
-
var position =
|
26
|
+
}, ";left:", function (_ref2) {
|
27
|
+
var position = _ref2.position;
|
46
28
|
return position.left || '';
|
47
|
-
}, ";right:", function (
|
48
|
-
var position =
|
29
|
+
}, ";right:", function (_ref3) {
|
30
|
+
var position = _ref3.position;
|
49
31
|
return position.right || '';
|
50
|
-
}, ";top:", function (
|
51
|
-
var position =
|
32
|
+
}, ";top:", function (_ref4) {
|
33
|
+
var position = _ref4.position;
|
52
34
|
return position.top || '';
|
53
|
-
}, ";bottom:", function (
|
54
|
-
var position =
|
35
|
+
}, ";bottom:", function (_ref5) {
|
36
|
+
var position = _ref5.position;
|
55
37
|
return position.bottom || '';
|
56
|
-
}, ";transform:", function (
|
57
|
-
var position =
|
38
|
+
}, ";transform:", function (_ref6) {
|
39
|
+
var position = _ref6.position;
|
58
40
|
return position.transform || '';
|
59
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
41
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUG9wdXAvUG9wdXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFxRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1BvcHVwL1BvcHVwLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW1wb3J0IHR5cGUgeyBQb3B1cFJvb3RDb250YWluZXJQcm9wcyB9IGZyb20gJy4vUG9wdXAudHlwZXMnO1xuaW1wb3J0IHsgREVGQVVMVF9aX0lOREVYIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRQb3J0YWwgPSBzdHlsZWQuZGl2YGA7XG5cbmV4cG9ydCBjb25zdCBQb3B1cFZpZXcgPSBzdHlsZWQuZGl2YFxuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb3B1cFJvb3RDb250YWluZXIgPSBzdHlsZWQuZGl2PFBvcHVwUm9vdENvbnRhaW5lclByb3BzPmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgei1pbmRleDogJHsoeyB6SW5kZXggfSkgPT4gekluZGV4IHx8IERFRkFVTFRfWl9JTkRFWH07XG4gICAgbGVmdDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5sZWZ0IHx8ICcnfTtcbiAgICByaWdodDogJHsoeyBwb3NpdGlvbiB9KSA9PiBwb3NpdGlvbi5yaWdodCB8fCAnJ307XG4gICAgdG9wOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRvcCB8fCAnJ307XG4gICAgYm90dG9tOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLmJvdHRvbSB8fCAnJ307XG4gICAgdHJhbnNmb3JtOiAkeyh7IHBvc2l0aW9uIH0pID0+IHBvc2l0aW9uLnRyYW5zZm9ybSB8fCAnJ307XG5gO1xuIl19 */"));
|
@@ -8,21 +8,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
11
|
-
import React, { createContext, useState, useContext, useRef } from 'react';
|
12
|
-
import ReactDOM from 'react-dom';
|
11
|
+
import React, { createContext, useEffect, useState, useContext, useRef } from 'react';
|
13
12
|
import { hasModals } from '../Modal/ModalContext';
|
14
|
-
import { canUseDOM, safeUseId } from '../../utils';
|
15
|
-
import { StyledPortal } from './Popup.styles';
|
16
13
|
export var POPUP_PORTAL_ID = 'plasma-popup-root';
|
17
14
|
var items = [];
|
18
15
|
var PopupContext = /*#__PURE__*/createContext({
|
19
16
|
items: items,
|
20
|
-
rootId: POPUP_PORTAL_ID,
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
22
17
|
register: function register(_info) {
|
23
18
|
throw new Error('Function not implemented. Add PopupProvider');
|
24
19
|
},
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
26
20
|
unregister: function unregister(_id) {
|
27
21
|
throw new Error('Function not implemented. Add PopupProvider');
|
28
22
|
}
|
@@ -32,46 +26,29 @@ export var usePopupContext = function usePopupContext() {
|
|
32
26
|
};
|
33
27
|
export var PopupProvider = function PopupProvider(_ref) {
|
34
28
|
var children = _ref.children;
|
35
|
-
var
|
36
|
-
var prevBodyOverflowY = useRef(canUseDOM ? document.body.style.overflowY : '');
|
37
|
-
// eslint-disable-next-line no-shadow
|
29
|
+
var prevBodyOverflowY = useRef(typeof document !== 'undefined' ? document.body.style.overflowY : '');
|
38
30
|
var _useState = useState([]),
|
39
31
|
_useState2 = _slicedToArray(_useState, 2),
|
40
32
|
items = _useState2[0],
|
41
33
|
setItems = _useState2[1];
|
42
|
-
var uuid = safeUseId();
|
43
|
-
var rootId = "".concat(POPUP_PORTAL_ID, "-").concat(uuid);
|
44
34
|
var register = function register(info) {
|
45
|
-
if (!canUseDOM) {
|
46
|
-
return;
|
47
|
-
}
|
48
35
|
setItems(function (prevItems) {
|
49
36
|
var _info$info;
|
50
37
|
if ((_info$info = info.info) !== null && _info$info !== void 0 && _info$info.isModal && !hasModals(prevItems)) {
|
51
38
|
prevBodyOverflowY.current = document.body.style.overflowY;
|
52
39
|
document.body.style.overflowY = 'hidden';
|
53
40
|
}
|
54
|
-
if (info.isGlobalPopup) {
|
55
|
-
globalItemsCount.current += 1;
|
56
|
-
}
|
57
41
|
return [].concat(_toConsumableArray(prevItems), [info]);
|
58
42
|
});
|
59
43
|
};
|
60
44
|
var unregister = function unregister(id) {
|
61
|
-
if (!canUseDOM) {
|
62
|
-
return;
|
63
|
-
}
|
64
45
|
setItems(function (prevItems) {
|
65
|
-
var _prevItems$index;
|
66
46
|
var index = prevItems.findIndex(function (item) {
|
67
47
|
return id === item.id;
|
68
48
|
});
|
69
49
|
if (index === -1) {
|
70
50
|
return prevItems;
|
71
51
|
}
|
72
|
-
if (prevItems !== null && prevItems !== void 0 && (_prevItems$index = prevItems[index]) !== null && _prevItems$index !== void 0 && _prevItems$index.isGlobalPopup) {
|
73
|
-
globalItemsCount.current -= 1;
|
74
|
-
}
|
75
52
|
var prevHasModals = hasModals(prevItems);
|
76
53
|
prevItems.splice(index, 1);
|
77
54
|
if (prevHasModals && !hasModals(prevItems)) {
|
@@ -84,14 +61,18 @@ export var PopupProvider = function PopupProvider(_ref) {
|
|
84
61
|
};
|
85
62
|
var context = {
|
86
63
|
items: items,
|
87
|
-
rootId: rootId,
|
88
64
|
register: register,
|
89
65
|
unregister: unregister
|
90
66
|
};
|
67
|
+
useEffect(function () {
|
68
|
+
return function () {
|
69
|
+
var portal = document.createElement('div');
|
70
|
+
if (portal && document.body.contains(portal)) {
|
71
|
+
document.body.removeChild(portal);
|
72
|
+
}
|
73
|
+
};
|
74
|
+
}, []);
|
91
75
|
return /*#__PURE__*/React.createElement(PopupContext.Provider, {
|
92
76
|
value: context
|
93
|
-
}, children
|
94
|
-
id: rootId,
|
95
|
-
hasContent: globalItemsCount.current > 0
|
96
|
-
}), document.body));
|
77
|
+
}, children);
|
97
78
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["id", "placement", "offset", "setVisible", "children", "role", "zIndex", "animationInfo"];
|
1
|
+
var _excluded = ["id", "placement", "offset", "frame", "setVisible", "children", "role", "zIndex", "animationInfo", "className"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -16,11 +16,13 @@ export var PopupRoot = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
16
|
var id = _ref.id,
|
17
17
|
placement = _ref.placement,
|
18
18
|
offset = _ref.offset,
|
19
|
+
frame = _ref.frame,
|
19
20
|
setVisible = _ref.setVisible,
|
20
21
|
children = _ref.children,
|
21
22
|
role = _ref.role,
|
22
23
|
zIndex = _ref.zIndex,
|
23
24
|
animationInfo = _ref.animationInfo,
|
25
|
+
className = _ref.className,
|
24
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
25
27
|
var contentRef = useRef(null);
|
26
28
|
var innerRef = useForkRef(contentRef, ref);
|
@@ -13,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { useEffect, useState } from 'react';
|
14
14
|
import { usePopupContext } from '../PopupContext';
|
15
15
|
|
16
|
-
// Хук для
|
16
|
+
// Хук для поключения анимации
|
17
17
|
var usePopupAnimation = function usePopupAnimation() {
|
18
18
|
var _useState = useState(false),
|
19
19
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -35,7 +35,6 @@ var usePopupAnimation = function usePopupAnimation() {
|
|
35
35
|
export var usePopup = function usePopup(_ref) {
|
36
36
|
var isOpen = _ref.isOpen,
|
37
37
|
id = _ref.id,
|
38
|
-
isGlobalPopup = _ref.isGlobalPopup,
|
39
38
|
popupInfo = _ref.popupInfo,
|
40
39
|
withAnimation = _ref.withAnimation;
|
41
40
|
var _useState5 = useState(false),
|
@@ -57,8 +56,7 @@ export var usePopup = function usePopup(_ref) {
|
|
57
56
|
// при первом открытии
|
58
57
|
if (isOpen && !isVisible) {
|
59
58
|
popupController.register(_objectSpread({
|
60
|
-
id: id
|
61
|
-
isGlobalPopup: isGlobalPopup
|
59
|
+
id: id
|
62
60
|
}, popupInfo));
|
63
61
|
setVisible(true);
|
64
62
|
animationInfo.setEndAnimation(false);
|
@@ -87,7 +85,6 @@ export var usePopup = function usePopup(_ref) {
|
|
87
85
|
isVisible: isVisible,
|
88
86
|
setVisible: setVisible,
|
89
87
|
animationInfo: animationInfo,
|
90
|
-
withAnimation: withAnimation
|
91
|
-
rootId: popupController.rootId
|
88
|
+
withAnimation: withAnimation
|
92
89
|
};
|
93
90
|
};
|
@@ -0,0 +1,121 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["size", "orientation", "contentAlign", "hasLine", "hasContent", "hasLoader", "items", "onChange", "current", "status"];
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
15
|
+
import React, { forwardRef, useState, useEffect } from 'react';
|
16
|
+
import cls from 'classnames';
|
17
|
+
import { classes } from './Steps.tokens';
|
18
|
+
import { base } from './Steps.styles';
|
19
|
+
import { StepItem } from './ui';
|
20
|
+
import { base as sizeCSS } from './variations/_size/base';
|
21
|
+
import { base as viewCSS } from './variations/_view/base';
|
22
|
+
export var stepsRoot = function stepsRoot(Root) {
|
23
|
+
return /*#__PURE__*/forwardRef(function (props, outerRef) {
|
24
|
+
var _props$size = props.size,
|
25
|
+
size = _props$size === void 0 ? 's' : _props$size,
|
26
|
+
_props$orientation = props.orientation,
|
27
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
28
|
+
_props$contentAlign = props.contentAlign,
|
29
|
+
contentAlign = _props$contentAlign === void 0 ? 'left' : _props$contentAlign,
|
30
|
+
_props$hasLine = props.hasLine,
|
31
|
+
hasLine = _props$hasLine === void 0 ? true : _props$hasLine,
|
32
|
+
_props$hasContent = props.hasContent,
|
33
|
+
hasContent = _props$hasContent === void 0 ? 'all' : _props$hasContent,
|
34
|
+
hasLoader = props.hasLoader,
|
35
|
+
_props$items = props.items,
|
36
|
+
items = _props$items === void 0 ? [] : _props$items,
|
37
|
+
onChange = props.onChange,
|
38
|
+
current = props.current,
|
39
|
+
status = props.status,
|
40
|
+
rest = _objectWithoutProperties(props, _excluded);
|
41
|
+
var _useState = useState(),
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
43
|
+
prevIndex = _useState2[0],
|
44
|
+
setPrevIndex = _useState2[1];
|
45
|
+
var isUncontrolled = current !== undefined;
|
46
|
+
var hasIndicator = items.some(function (item) {
|
47
|
+
return item.indicator != null;
|
48
|
+
});
|
49
|
+
var isSimple = items.every(function (item) {
|
50
|
+
return !item.title && !item.content;
|
51
|
+
});
|
52
|
+
useEffect(function () {
|
53
|
+
return function () {
|
54
|
+
if (current !== undefined) {
|
55
|
+
setPrevIndex(current);
|
56
|
+
} else {
|
57
|
+
var index = items.findIndex(function (item) {
|
58
|
+
return item.status === 'active';
|
59
|
+
});
|
60
|
+
setPrevIndex(index !== -1 ? index : undefined);
|
61
|
+
}
|
62
|
+
};
|
63
|
+
}, [current, items]);
|
64
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
65
|
+
size: size,
|
66
|
+
view: "default",
|
67
|
+
ref: outerRef,
|
68
|
+
className: cls(_defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, orientation === 'vertical'), classes.simple, isSimple), classes.hasIndicator, hasIndicator))
|
69
|
+
}, rest), items.map(function (item, index) {
|
70
|
+
var itemStatus = 'inactive';
|
71
|
+
if (isUncontrolled) {
|
72
|
+
if (current > index) {
|
73
|
+
itemStatus = 'completed';
|
74
|
+
} else if (current === index) {
|
75
|
+
itemStatus = status || 'active';
|
76
|
+
}
|
77
|
+
} else {
|
78
|
+
itemStatus = status || item.status || 'inactive';
|
79
|
+
}
|
80
|
+
if (item.disabled) {
|
81
|
+
itemStatus = 'inactive';
|
82
|
+
}
|
83
|
+
var isActive = itemStatus === 'active';
|
84
|
+
var content = item.content;
|
85
|
+
if (hasContent === 'active' && !isActive || hasContent === 'none') {
|
86
|
+
content = '';
|
87
|
+
}
|
88
|
+
return /*#__PURE__*/React.createElement(StepItem, {
|
89
|
+
key: index,
|
90
|
+
index: index,
|
91
|
+
title: item.title,
|
92
|
+
content: content,
|
93
|
+
indicator: item.indicator,
|
94
|
+
status: itemStatus,
|
95
|
+
size: size,
|
96
|
+
orientation: orientation,
|
97
|
+
contentAlign: orientation === 'horizontal' ? contentAlign : 'left',
|
98
|
+
hasLine: hasLine,
|
99
|
+
hasLoader: hasLoader && isActive,
|
100
|
+
onClick: onChange ? function () {
|
101
|
+
return onChange(item, index, prevIndex);
|
102
|
+
} : undefined,
|
103
|
+
items: items
|
104
|
+
});
|
105
|
+
}));
|
106
|
+
});
|
107
|
+
};
|
108
|
+
export var stepsConfig = {
|
109
|
+
name: 'Steps',
|
110
|
+
tag: 'div',
|
111
|
+
layout: stepsRoot,
|
112
|
+
base: base,
|
113
|
+
variations: {
|
114
|
+
size: sizeCSS,
|
115
|
+
view: viewCSS
|
116
|
+
},
|
117
|
+
defaults: {
|
118
|
+
view: 'default',
|
119
|
+
size: 's'
|
120
|
+
}
|
121
|
+
};
|
@@ -0,0 +1,304 @@
|
|
1
|
+
---
|
2
|
+
id: steps
|
3
|
+
title: Steps
|
4
|
+
---
|
5
|
+
|
6
|
+
# Steps
|
7
|
+
Шаги могут отображаться в нескольких размерах, в упрощенном виде и в горизонтальной/вертикальной ориентации
|
8
|
+
|
9
|
+
```tsx live
|
10
|
+
import { ReactNode } from 'react';
|
11
|
+
|
12
|
+
export type StepStatus = 'active' | 'inactive' | 'completed';
|
13
|
+
|
14
|
+
export interface StepItemProps {
|
15
|
+
/**
|
16
|
+
* Заголовок
|
17
|
+
*/
|
18
|
+
title?: string;
|
19
|
+
/**
|
20
|
+
* Контент, может быть как React компонентом, так и функцией
|
21
|
+
*/
|
22
|
+
content?: string | ReactNode | ((status: StepStatus, index: number, items: StepItemProps[]) => ReactNode);
|
23
|
+
/**
|
24
|
+
* Индикатор шага, может быть как React компонентом, так и функцией
|
25
|
+
*/
|
26
|
+
indicator?: number | string | ReactNode | ((status: StepStatus, item: StepItemProps) => ReactNode | null);
|
27
|
+
/**
|
28
|
+
* Статус шага: активный, инактивный, завершенный
|
29
|
+
* @description
|
30
|
+
* active - активный шаг
|
31
|
+
* inactive - не пройденный шаг
|
32
|
+
* completed - пройденный шаг
|
33
|
+
*/
|
34
|
+
status?: StepStatus;
|
35
|
+
/**
|
36
|
+
* Отключенный шаг
|
37
|
+
* @default false
|
38
|
+
*/
|
39
|
+
disabled?: boolean;
|
40
|
+
}
|
41
|
+
|
42
|
+
interface BaseSteps {
|
43
|
+
/**
|
44
|
+
* Ориентация компонента
|
45
|
+
* @default 'horizontal'
|
46
|
+
*/
|
47
|
+
orientation?: 'horizontal' | 'vertical';
|
48
|
+
/**
|
49
|
+
* Выравнивание контента в шагах
|
50
|
+
* @default 'left'
|
51
|
+
*/
|
52
|
+
contentAlign?: 'left' | 'center';
|
53
|
+
/**
|
54
|
+
* Включает разделительную линию
|
55
|
+
* @default true
|
56
|
+
*/
|
57
|
+
hasLine?: boolean;
|
58
|
+
/**
|
59
|
+
* Индекс текущего шага, для uncontrolled компонента
|
60
|
+
*/
|
61
|
+
current?: number;
|
62
|
+
/**
|
63
|
+
* Статус текущего шага, имеет приоритет над item.status
|
64
|
+
*/
|
65
|
+
status?: StepStatus;
|
66
|
+
/**
|
67
|
+
* Обработчик изменения шага, делает индикаторы и заголовки шагов кликабельными
|
68
|
+
*/
|
69
|
+
onChange?: (item: StepItemProps, index: number, prevIndex?: number) => void;
|
70
|
+
/**
|
71
|
+
* Массив шагов
|
72
|
+
*/
|
73
|
+
items: StepItemProps[];
|
74
|
+
}
|
75
|
+
|
76
|
+
type IndicatorSizeSimple = 8 | 16;
|
77
|
+
type IndicatorSize = 24 | 36;
|
78
|
+
|
79
|
+
export type Steps = BaseSteps & {
|
80
|
+
/**
|
81
|
+
* Размер шага
|
82
|
+
*/
|
83
|
+
size: 'xs' | 's';
|
84
|
+
indicatorSize: never;
|
85
|
+
} & {
|
86
|
+
/**
|
87
|
+
* Размер шага
|
88
|
+
*/
|
89
|
+
size: 'm' | 'l';
|
90
|
+
/**
|
91
|
+
* Размер индикатора
|
92
|
+
*/
|
93
|
+
indicatorSize: IndicatorSize | IndicatorSizeSimple;
|
94
|
+
};
|
95
|
+
|
96
|
+
```
|
97
|
+
|
98
|
+
примеры использования https://codesandbox.io/p/devbox/crzql2?file=%2Fsrc%2FDemo.tsx%3A23%2C1
|
99
|
+
|
100
|
+
```
|
101
|
+
import React, { useState } from 'react';
|
102
|
+
import { fullItems } from './App.data.tsx';
|
103
|
+
import { Steps } from './Steps/Steps.tsx';
|
104
|
+
import { StepItemProps, StepStatus } from './Steps/Steps.types';
|
105
|
+
|
106
|
+
const DemoContent: React.FC<{ onClick: () => void; status: string; index?: number; current?: number }> = ({
|
107
|
+
onClick,
|
108
|
+
status,
|
109
|
+
index,
|
110
|
+
current = 0,
|
111
|
+
children,
|
112
|
+
}) => {
|
113
|
+
return (
|
114
|
+
<>
|
115
|
+
<div>Content</div>
|
116
|
+
<button onClick={onClick} disabled={index !== (current || 0)}>
|
117
|
+
{children}
|
118
|
+
</button>
|
119
|
+
</>
|
120
|
+
);
|
121
|
+
};
|
122
|
+
|
123
|
+
export const DemoWithExternalControl = () => {
|
124
|
+
const items = [
|
125
|
+
{
|
126
|
+
title: 'Title',
|
127
|
+
indicator: '1',
|
128
|
+
content: 'Content',
|
129
|
+
},
|
130
|
+
{
|
131
|
+
title: 'Title',
|
132
|
+
indicator: '2',
|
133
|
+
content: 'Content',
|
134
|
+
},
|
135
|
+
{
|
136
|
+
title: 'Title',
|
137
|
+
indicator: '3',
|
138
|
+
content: 'Content',
|
139
|
+
},
|
140
|
+
{
|
141
|
+
title: 'Title',
|
142
|
+
indicator: '4',
|
143
|
+
content: 'Content',
|
144
|
+
},
|
145
|
+
];
|
146
|
+
|
147
|
+
const [current, setCurrent] = useState(1);
|
148
|
+
const [status, setStatus] = useState('active');
|
149
|
+
|
150
|
+
const isLast = current === items.length - 1;
|
151
|
+
|
152
|
+
const onClick = () => {
|
153
|
+
if (isLast) {
|
154
|
+
setStatus('completed');
|
155
|
+
} else {
|
156
|
+
setCurrent(current + 1);
|
157
|
+
}
|
158
|
+
};
|
159
|
+
|
160
|
+
return (
|
161
|
+
<>
|
162
|
+
<Steps style={{ width: '1000px' }} current={current} status={status} items={items} />
|
163
|
+
<br />
|
164
|
+
<div>
|
165
|
+
External control:{' '}
|
166
|
+
<button onClick={onClick} style={{ width: '5rem' }}>
|
167
|
+
{isLast ? 'complete' : 'next'}
|
168
|
+
</button>
|
169
|
+
</div>
|
170
|
+
<hr />
|
171
|
+
</>
|
172
|
+
);
|
173
|
+
};
|
174
|
+
|
175
|
+
export const DemoWithInternalControls = () => {
|
176
|
+
const [current, setCurrent] = useState(undefined);
|
177
|
+
const [status, setStatus] = useState<StepStatus | undefined>();
|
178
|
+
|
179
|
+
const renderContent = (status, index, items) => {
|
180
|
+
const isFirst = index === 0 && current === undefined;
|
181
|
+
const isLast = index === items.length - 1;
|
182
|
+
|
183
|
+
const onNext = () => setCurrent((current) => (current === undefined ? 0 : current + 1));
|
184
|
+
const onComplete = () => {
|
185
|
+
setStatus('completed');
|
186
|
+
};
|
187
|
+
|
188
|
+
return (
|
189
|
+
<DemoContent onClick={isLast ? onComplete : onNext} index={index} status={status} current={current}>
|
190
|
+
{isFirst && 'go'}
|
191
|
+
{isLast && 'complete'}
|
192
|
+
{!isFirst && !isLast && 'next'}
|
193
|
+
</DemoContent>
|
194
|
+
);
|
195
|
+
};
|
196
|
+
|
197
|
+
return (
|
198
|
+
<Steps
|
199
|
+
current={current}
|
200
|
+
status={status}
|
201
|
+
items={[
|
202
|
+
{
|
203
|
+
title: 'Title',
|
204
|
+
indicator: '1',
|
205
|
+
content: renderContent,
|
206
|
+
},
|
207
|
+
{
|
208
|
+
title: 'Title',
|
209
|
+
indicator: '2',
|
210
|
+
content: renderContent,
|
211
|
+
},
|
212
|
+
{
|
213
|
+
title: 'Title',
|
214
|
+
indicator: '3',
|
215
|
+
content: renderContent,
|
216
|
+
},
|
217
|
+
{
|
218
|
+
title: 'Title',
|
219
|
+
indicator: '4',
|
220
|
+
content: renderContent,
|
221
|
+
},
|
222
|
+
]}
|
223
|
+
/>
|
224
|
+
);
|
225
|
+
};
|
226
|
+
|
227
|
+
export const DemoWithControlledUsage = () => {
|
228
|
+
const [exampleItems, setExampleItems] = useState<StepItemProps[]>(() =>
|
229
|
+
fullItems.map((item) => ({ ...item, status: 'inactive' }))
|
230
|
+
);
|
231
|
+
|
232
|
+
return (
|
233
|
+
<Steps
|
234
|
+
style={{ width: '1000px' }}
|
235
|
+
onChange={(item, index) => {
|
236
|
+
setExampleItems(
|
237
|
+
exampleItems.map((item, itemIndex) => {
|
238
|
+
if (index > itemIndex) {
|
239
|
+
return { ...item, status: 'completed' };
|
240
|
+
}
|
241
|
+
|
242
|
+
if (index === itemIndex) {
|
243
|
+
return { ...item, status: 'active' };
|
244
|
+
}
|
245
|
+
|
246
|
+
return { ...item, status: 'inactive' };
|
247
|
+
})
|
248
|
+
);
|
249
|
+
}}
|
250
|
+
items={exampleItems}
|
251
|
+
/>
|
252
|
+
);
|
253
|
+
};
|
254
|
+
|
255
|
+
export const DemoWithControlledFreeUsage = () => {
|
256
|
+
const [items, setItems] = useState<StepItemProps[]>(() => fullItems.map((item) => ({ ...item, status: 'inactive' })));
|
257
|
+
|
258
|
+
return (
|
259
|
+
<Steps
|
260
|
+
style={{ width: '1000px' }}
|
261
|
+
onChange={(item, index, prevIndex) => {
|
262
|
+
console.log('!!! onChange', index, prevIndex);
|
263
|
+
|
264
|
+
const newItems = [...items];
|
265
|
+
if (prevIndex !== undefined) {
|
266
|
+
newItems[prevIndex].status = 'completed';
|
267
|
+
}
|
268
|
+
newItems[index].status = 'active';
|
269
|
+
|
270
|
+
setItems(newItems);
|
271
|
+
}}
|
272
|
+
items={items}
|
273
|
+
/>
|
274
|
+
);
|
275
|
+
};
|
276
|
+
|
277
|
+
export const DemoControlledWithStatus = () => {
|
278
|
+
const [items, setItems] = useState<StepItemProps[]>(() => fullItems.map(({ status, ...item }) => ({ ...item })));
|
279
|
+
return (
|
280
|
+
<Steps
|
281
|
+
style={{ width: '1000px' }}
|
282
|
+
current={2}
|
283
|
+
status="active"
|
284
|
+
onClick={(item, index) => {
|
285
|
+
setItems(
|
286
|
+
items.map((item, itemIndex) => {
|
287
|
+
if (index > itemIndex) {
|
288
|
+
return { ...item, status: 'completed' };
|
289
|
+
}
|
290
|
+
|
291
|
+
if (index === itemIndex) {
|
292
|
+
return { ...item, status: 'active' };
|
293
|
+
}
|
294
|
+
|
295
|
+
return { ...item, status: 'inactive' };
|
296
|
+
})
|
297
|
+
);
|
298
|
+
}}
|
299
|
+
items={items}
|
300
|
+
/>
|
301
|
+
);
|
302
|
+
};
|
303
|
+
|
304
|
+
```
|