@salutejs/plasma-new-hope 0.322.0-canary.1944.14660891986.0 → 0.322.0-canary.1947.14664713311.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/emotion/cjs/components/PaginationDots/PaginationDots.js +321 -0
- package/emotion/cjs/components/PaginationDots/PaginationDots.styles.js +44 -0
- package/emotion/cjs/components/PaginationDots/PaginationDots.template-doc.mdx +95 -0
- package/emotion/cjs/components/PaginationDots/PaginationDots.tokens.js +30 -0
- package/emotion/cjs/components/PaginationDots/PaginationDots.types.js +5 -0
- package/emotion/cjs/components/PaginationDots/hooks/useAnimation.js +108 -0
- package/emotion/cjs/components/PaginationDots/index.js +31 -0
- package/emotion/cjs/components/PaginationDots/utils/getDotSize.js +46 -0
- package/emotion/cjs/components/PaginationDots/variations/_size/base.js +8 -0
- package/emotion/cjs/components/PaginationDots/variations/_size/tokens.json +1 -0
- package/emotion/cjs/components/PaginationDots/variations/_view/base.js +8 -0
- package/emotion/cjs/components/PaginationDots/variations/_view/tokens.json +1 -0
- package/emotion/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.config.js +23 -0
- package/emotion/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.stories.tsx +87 -0
- package/emotion/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.config.js +24 -0
- package/emotion/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.stories.tsx +68 -0
- package/emotion/es/components/PaginationDots/PaginationDots.js +311 -0
- package/emotion/es/components/PaginationDots/PaginationDots.styles.js +37 -0
- package/emotion/es/components/PaginationDots/PaginationDots.template-doc.mdx +95 -0
- package/emotion/es/components/PaginationDots/PaginationDots.tokens.js +24 -0
- package/emotion/es/components/PaginationDots/PaginationDots.types.js +1 -0
- package/emotion/es/components/PaginationDots/hooks/useAnimation.js +102 -0
- package/emotion/es/components/PaginationDots/index.js +2 -0
- package/emotion/es/components/PaginationDots/utils/getDotSize.js +40 -0
- package/emotion/es/components/PaginationDots/variations/_size/base.js +2 -0
- package/emotion/es/components/PaginationDots/variations/_size/tokens.json +1 -0
- package/emotion/es/components/PaginationDots/variations/_view/base.js +2 -0
- package/emotion/es/components/PaginationDots/variations/_view/tokens.json +1 -0
- package/emotion/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.config.js +17 -0
- package/emotion/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.stories.tsx +87 -0
- package/emotion/es/examples/plasma_web/components/PaginationDots/PaginationDots.config.js +18 -0
- package/emotion/es/examples/plasma_web/components/PaginationDots/PaginationDots.js +5 -0
- package/emotion/es/examples/plasma_web/components/PaginationDots/PaginationDots.stories.tsx +68 -0
- package/package.json +4 -4
- package/styled-components/cjs/components/PaginationDots/PaginationDots.js +321 -0
- package/styled-components/cjs/components/PaginationDots/PaginationDots.styles.js +26 -0
- package/styled-components/cjs/components/PaginationDots/PaginationDots.template-doc.mdx +95 -0
- package/styled-components/cjs/components/PaginationDots/PaginationDots.tokens.js +30 -0
- package/styled-components/cjs/components/PaginationDots/PaginationDots.types.js +5 -0
- package/styled-components/cjs/components/PaginationDots/hooks/useAnimation.js +108 -0
- package/styled-components/cjs/components/PaginationDots/index.js +31 -0
- package/styled-components/cjs/components/PaginationDots/utils/getDotSize.js +46 -0
- package/styled-components/cjs/components/PaginationDots/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/PaginationDots/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/PaginationDots/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/PaginationDots/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.config.js +23 -0
- package/styled-components/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/PaginationDots/PaginationDots.stories.tsx +87 -0
- package/styled-components/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.config.js +24 -0
- package/styled-components/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/PaginationDots/PaginationDots.stories.tsx +68 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.js +311 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.styles.js +18 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.template-doc.mdx +95 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.tokens.js +24 -0
- package/styled-components/es/components/PaginationDots/PaginationDots.types.js +1 -0
- package/styled-components/es/components/PaginationDots/hooks/useAnimation.js +102 -0
- package/styled-components/es/components/PaginationDots/index.js +2 -0
- package/styled-components/es/components/PaginationDots/utils/getDotSize.js +40 -0
- package/styled-components/es/components/PaginationDots/variations/_size/base.js +2 -0
- package/styled-components/es/components/PaginationDots/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/PaginationDots/variations/_view/base.js +2 -0
- package/styled-components/es/components/PaginationDots/variations/_view/tokens.json +1 -0
- package/styled-components/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.config.js +17 -0
- package/styled-components/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/PaginationDots/PaginationDots.stories.tsx +87 -0
- package/styled-components/es/examples/plasma_web/components/PaginationDots/PaginationDots.config.js +18 -0
- package/styled-components/es/examples/plasma_web/components/PaginationDots/PaginationDots.js +5 -0
- package/styled-components/es/examples/plasma_web/components/PaginationDots/PaginationDots.stories.tsx +68 -0
- package/types/components/PaginationDots/PaginationDots.d.ts +31 -0
- package/types/components/PaginationDots/PaginationDots.d.ts.map +1 -0
- package/types/components/PaginationDots/PaginationDots.styles.d.ts +9 -0
- package/types/components/PaginationDots/PaginationDots.styles.d.ts.map +1 -0
- package/types/components/PaginationDots/PaginationDots.tokens.d.ts +25 -0
- package/types/components/PaginationDots/PaginationDots.tokens.d.ts.map +1 -0
- package/types/components/PaginationDots/PaginationDots.types.d.ts +46 -0
- package/types/components/PaginationDots/PaginationDots.types.d.ts.map +1 -0
- package/types/components/PaginationDots/hooks/useAnimation.d.ts +23 -0
- package/types/components/PaginationDots/hooks/useAnimation.d.ts.map +1 -0
- package/types/components/PaginationDots/index.d.ts +4 -0
- package/types/components/PaginationDots/index.d.ts.map +1 -0
- package/types/components/PaginationDots/utils/getDotSize.d.ts +2 -0
- package/types/components/PaginationDots/utils/getDotSize.d.ts.map +1 -0
- package/types/components/PaginationDots/variations/_size/base.d.ts +2 -0
- package/types/components/PaginationDots/variations/_size/base.d.ts.map +1 -0
- package/types/components/PaginationDots/variations/_view/base.d.ts +2 -0
- package/types/components/PaginationDots/variations/_view/base.d.ts.map +1 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useAnimation = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("react");
|
8
|
+
var _PaginationDots = /*#__PURE__*/require("../PaginationDots");
|
9
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
10
|
+
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."); }
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
13
|
+
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; } }
|
14
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
15
|
+
var useAnimation = exports.useAnimation = function useAnimation(_ref) {
|
16
|
+
var isVertical = _ref.isVertical,
|
17
|
+
onAnimationEnd = _ref.onAnimationEnd,
|
18
|
+
activeElementRef = _ref.activeElementRef,
|
19
|
+
animatedDotsWrapperRef = _ref.animatedDotsWrapperRef,
|
20
|
+
canScrollForward = _ref.canScrollForward,
|
21
|
+
canScrollBackward = _ref.canScrollBackward,
|
22
|
+
dots = _ref.dots,
|
23
|
+
prevDots = _ref.prevDots,
|
24
|
+
innerViewIndex = _ref.innerViewIndex;
|
25
|
+
var isAnimationRunningRef = (0, _react.useRef)(false);
|
26
|
+
var _useState = (0, _react.useState)(true),
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
28
|
+
skipAnimation = _useState2[0],
|
29
|
+
setSkipAnimation = _useState2[1];
|
30
|
+
var _useState3 = (0, _react.useState)(false),
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
32
|
+
hasForwardAnimation = _useState4[0],
|
33
|
+
setHasForwardAnimation = _useState4[1];
|
34
|
+
var _useState5 = (0, _react.useState)(false),
|
35
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
36
|
+
hasBackwardAnimation = _useState6[0],
|
37
|
+
setHasBackwardAnimation = _useState6[1];
|
38
|
+
var hasAnimation = hasForwardAnimation || hasBackwardAnimation;
|
39
|
+
var handleAnimationEnd = function handleAnimationEnd() {
|
40
|
+
if (isAnimationRunningRef.current) {
|
41
|
+
isAnimationRunningRef.current = false;
|
42
|
+
onAnimationEnd();
|
43
|
+
}
|
44
|
+
setHasForwardAnimation(false);
|
45
|
+
setHasBackwardAnimation(false);
|
46
|
+
};
|
47
|
+
(0, _react.useLayoutEffect)(function () {
|
48
|
+
var _activeElementRef$cur, _activeElementRef$cur2;
|
49
|
+
var animatedEl = animatedDotsWrapperRef.current;
|
50
|
+
if (!animatedEl || !hasForwardAnimation && !hasBackwardAnimation) {
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
var before = (0, _PaginationDots.getVisualOffsets)(prevDots, innerViewIndex);
|
54
|
+
var after = (0, _PaginationDots.getVisualOffsets)(dots, innerViewIndex);
|
55
|
+
var diff = before - after;
|
56
|
+
var _ref2 = activeElementRef.current,
|
57
|
+
activeWidth = _ref2.offsetWidth,
|
58
|
+
activeHeight = _ref2.offsetHeight;
|
59
|
+
var _ref3 = (hasBackwardAnimation ? (_activeElementRef$cur = activeElementRef.current) === null || _activeElementRef$cur === void 0 ? void 0 : _activeElementRef$cur.previousSibling : (_activeElementRef$cur2 = activeElementRef.current) === null || _activeElementRef$cur2 === void 0 ? void 0 : _activeElementRef$cur2.nextSibling) || {},
|
60
|
+
width = _ref3.offsetWidth,
|
61
|
+
height = _ref3.offsetHeight;
|
62
|
+
animatedEl.style.transition = 'none';
|
63
|
+
if (hasForwardAnimation) {
|
64
|
+
if (canScrollForward) {
|
65
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(height, "px)") : "translateX(".concat(width, "px)");
|
66
|
+
} else {
|
67
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(height - activeHeight, "px)") : "translateX(".concat(width - activeWidth, "px)");
|
68
|
+
}
|
69
|
+
requestAnimationFrame(function () {
|
70
|
+
animatedEl.style.transition = 'transform 0.3s linear';
|
71
|
+
if (canScrollForward) {
|
72
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(-diff, "px)") : "translateX(".concat(-diff, "px)");
|
73
|
+
} else {
|
74
|
+
animatedEl.style.transform = isVertical ? "translateY(-".concat(activeHeight, "px)") : "translateX(-".concat(activeWidth, "px)");
|
75
|
+
}
|
76
|
+
isAnimationRunningRef.current = true;
|
77
|
+
});
|
78
|
+
}
|
79
|
+
if (hasBackwardAnimation) {
|
80
|
+
if (canScrollBackward) {
|
81
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(-height, "px)") : "translateX(".concat(-width, "px)");
|
82
|
+
} else {
|
83
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(-height + activeHeight, "px)") : "translateX(".concat(-width + activeWidth, "px)");
|
84
|
+
}
|
85
|
+
requestAnimationFrame(function () {
|
86
|
+
if (animatedEl) {
|
87
|
+
animatedEl.style.transition = 'transform 0.3s linear';
|
88
|
+
if (canScrollBackward) {
|
89
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(-diff, "px)") : "translateX(".concat(-diff, "px)");
|
90
|
+
} else {
|
91
|
+
animatedEl.style.transform = isVertical ? "translateY(".concat(activeHeight, "px)") : "translateX(".concat(activeWidth, "px)");
|
92
|
+
}
|
93
|
+
isAnimationRunningRef.current = true;
|
94
|
+
}
|
95
|
+
});
|
96
|
+
}
|
97
|
+
}, [isVertical, innerViewIndex, hasForwardAnimation, hasBackwardAnimation]);
|
98
|
+
return {
|
99
|
+
skipAnimation: skipAnimation,
|
100
|
+
hasAnimation: hasAnimation,
|
101
|
+
hasBackwardAnimation: hasBackwardAnimation,
|
102
|
+
hasForwardAnimation: hasForwardAnimation,
|
103
|
+
setSkipAnimation: setSkipAnimation,
|
104
|
+
setHasForwardAnimation: setHasForwardAnimation,
|
105
|
+
setHasBackwardAnimation: setHasBackwardAnimation,
|
106
|
+
handleAnimationEnd: handleAnimationEnd
|
107
|
+
};
|
108
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "paginationDotsClasses", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _PaginationDots2.classes;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "paginationDotsConfig", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _PaginationDots.paginationDotsConfig;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "paginationDotsRoot", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _PaginationDots.paginationDotsRoot;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "paginationDotsTokens", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _PaginationDots2.tokens;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
var _PaginationDots = /*#__PURE__*/require("./PaginationDots");
|
31
|
+
var _PaginationDots2 = /*#__PURE__*/require("./PaginationDots.tokens");
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getDotSize = void 0;
|
7
|
+
var getDotSize = exports.getDotSize = function getDotSize(size, index, offset, count, visibleCount) {
|
8
|
+
var innerViewValue = index - offset;
|
9
|
+
var toEnd = count - (visibleCount + offset);
|
10
|
+
var canScrollBackward = Boolean(offset);
|
11
|
+
var canScrollForward = Boolean(toEnd);
|
12
|
+
var isFirst = innerViewValue === 0;
|
13
|
+
var isSecond = innerViewValue === 1;
|
14
|
+
var isSecondLast = innerViewValue === visibleCount - 2;
|
15
|
+
var isLast = innerViewValue === visibleCount - 1;
|
16
|
+
if (size === 's') {
|
17
|
+
if (isFirst && canScrollBackward || isLast && canScrollForward) {
|
18
|
+
return 'xs';
|
19
|
+
}
|
20
|
+
return 's';
|
21
|
+
}
|
22
|
+
if (canScrollBackward) {
|
23
|
+
// (m) m m s xs
|
24
|
+
// m (m) m s xs
|
25
|
+
// m m (m) s xs
|
26
|
+
// s m (m) s xs
|
27
|
+
// xs s m (m) s
|
28
|
+
// xs s m (m) s
|
29
|
+
// xs s m m (m)
|
30
|
+
if (isFirst) {
|
31
|
+
return offset === 1 ? 's' : 'xs';
|
32
|
+
}
|
33
|
+
if (isSecond && offset > 1) {
|
34
|
+
return 's';
|
35
|
+
}
|
36
|
+
}
|
37
|
+
if (canScrollForward) {
|
38
|
+
if (isLast) {
|
39
|
+
return toEnd === 1 ? 's' : 'xs';
|
40
|
+
}
|
41
|
+
if (isSecondLast && toEnd > 1) {
|
42
|
+
return 's';
|
43
|
+
}
|
44
|
+
}
|
45
|
+
return 'm';
|
46
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.base = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var base = exports.base = /*#__PURE__*/(0, _react.css)(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvdmFyaWF0aW9ucy9fc2l6ZS9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzL3ZhcmlhdGlvbnMvX3NpemUvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.base = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var base = exports.base = /*#__PURE__*/(0, _react.css)(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvdmFyaWF0aW9ucy9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzL3ZhcmlhdGlvbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var _PaginationDots = /*#__PURE__*/require("../../../../components/PaginationDots");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'm'
|
13
|
+
},
|
14
|
+
variations: {
|
15
|
+
view: {
|
16
|
+
"default": /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.itemBackground, ":#0808081f;", _PaginationDots.paginationDotsTokens.activeItemBackground, ":#080808;;label:plasma-new-hope__default;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBV3dCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IHBhZ2luYXRpb25Eb3RzVG9rZW5zIGFzIHRva2VucyB9IGZyb20gJy4uLy4uLy4uLy4uL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMnO1xuXG5leHBvcnQgY29uc3QgY29uZmlnID0ge1xuICAgIGRlZmF1bHRzOiB7XG4gICAgICAgIHZpZXc6ICdkZWZhdWx0JyxcbiAgICAgICAgc2l6ZTogJ20nLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuaXRlbUJhY2tncm91bmR9OiAjMDgwODA4MWY7XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuYWN0aXZlSXRlbUJhY2tncm91bmR9OiAjMDgwODA4O1xuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFBhZGRpbmd9OiAwIDAuMzc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsRG90UGFkZGluZ306IDAuMzc1cmVtIDA7XG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplTX06IDAuNzVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVN9OiAwLjVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVhTfTogMC4zNzVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90Qm9yZGVyUmFkaXVzfTogNTAlO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZVdpZHRofTogMnJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lSGVpZ2h0fTogMC41cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVCb3JkZXJSYWRpdXN9OiAwLjM3NXJlbTtcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZVdpZHRofTogMC41cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZUhlaWdodH06IDJyZW07XG4gICAgICAgICAgICBgLFxuICAgICAgICAgICAgbTogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFBhZGRpbmd9OiAwIDAuMzc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsRG90UGFkZGluZ306IDAuMzc1cmVtIDA7XG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RCb3JkZXJSYWRpdXN9OiA1MCU7XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAwLjc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogMC41cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVYU306IDAuMzc1cmVtO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZVdpZHRofTogM3JlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lSGVpZ2h0fTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lQm9yZGVyUmFkaXVzfTogMC4zNzVyZW07XG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06IDAuNzVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxMaW5lSGVpZ2h0fTogM3JlbTtcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgfSxcbn07XG4iXX0= */"))
|
17
|
+
},
|
18
|
+
size: {
|
19
|
+
s: /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.dotPadding, ":0 0.375rem;", _PaginationDots.paginationDotsTokens.verticalDotPadding, ":0.375rem 0;", _PaginationDots.paginationDotsTokens.dotSizeM, ":0.75rem;", _PaginationDots.paginationDotsTokens.dotSizeS, ":0.5rem;", _PaginationDots.paginationDotsTokens.dotSizeXS, ":0.375rem;", _PaginationDots.paginationDotsTokens.dotBorderRadius, ":50%;", _PaginationDots.paginationDotsTokens.lineWidth, ":2rem;", _PaginationDots.paginationDotsTokens.lineHeight, ":0.5rem;", _PaginationDots.paginationDotsTokens.lineBorderRadius, ":0.375rem;", _PaginationDots.paginationDotsTokens.verticalLineWidth, ":0.5rem;", _PaginationDots.paginationDotsTokens.verticalLineHeight, ":2rem;;label:plasma-new-hope__s;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUJrQiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvUGFnaW5hdGlvbkRvdHMuY29uZmlnLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBwYWdpbmF0aW9uRG90c1Rva2VucyBhcyB0b2tlbnMgfSBmcm9tICcuLi8uLi8uLi8uLi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnZGVmYXVsdCcsXG4gICAgICAgIHNpemU6ICdtJyxcbiAgICB9LFxuICAgIHZhcmlhdGlvbnM6IHtcbiAgICAgICAgdmlldzoge1xuICAgICAgICAgICAgZGVmYXVsdDogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLml0ZW1CYWNrZ3JvdW5kfTogIzA4MDgwODFmO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmFjdGl2ZUl0ZW1CYWNrZ3JvdW5kfTogIzA4MDgwODtcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgICAgIHNpemU6IHtcbiAgICAgICAgICAgIHM6IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogMCAwLjM3NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbERvdFBhZGRpbmd9OiAwLjM3NXJlbSAwO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAwLjc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogMC41cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVYU306IDAuMzc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdEJvcmRlclJhZGl1c306IDUwJTtcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVXaWR0aH06IDJyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lQm9yZGVyUmFkaXVzfTogMC4zNzVyZW07XG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAycmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgICAgIG06IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogMCAwLjM3NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbERvdFBhZGRpbmd9OiAwLjM3NXJlbSAwO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90Qm9yZGVyUmFkaXVzfTogNTAlO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVNfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplU306IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplWFN9OiAwLjM3NXJlbTtcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVXaWR0aH06IDNyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06IDAuNzVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUJvcmRlclJhZGl1c306IDAuMzc1cmVtO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxMaW5lV2lkdGh9OiAwLjc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZUhlaWdodH06IDNyZW07XG4gICAgICAgICAgICBgLFxuICAgICAgICB9LFxuICAgIH0sXG59O1xuIl19 */")),
|
20
|
+
m: /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.dotPadding, ":0 0.375rem;", _PaginationDots.paginationDotsTokens.verticalDotPadding, ":0.375rem 0;", _PaginationDots.paginationDotsTokens.dotBorderRadius, ":50%;", _PaginationDots.paginationDotsTokens.dotSizeM, ":0.75rem;", _PaginationDots.paginationDotsTokens.dotSizeS, ":0.5rem;", _PaginationDots.paginationDotsTokens.dotSizeXS, ":0.375rem;", _PaginationDots.paginationDotsTokens.lineWidth, ":3rem;", _PaginationDots.paginationDotsTokens.lineHeight, ":0.75rem;", _PaginationDots.paginationDotsTokens.lineBorderRadius, ":0.375rem;", _PaginationDots.paginationDotsTokens.verticalLineWidth, ":0.75rem;", _PaginationDots.paginationDotsTokens.verticalLineHeight, ":3rem;;label:plasma-new-hope__m;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUNrQiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfYjJjL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvUGFnaW5hdGlvbkRvdHMuY29uZmlnLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBwYWdpbmF0aW9uRG90c1Rva2VucyBhcyB0b2tlbnMgfSBmcm9tICcuLi8uLi8uLi8uLi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnZGVmYXVsdCcsXG4gICAgICAgIHNpemU6ICdtJyxcbiAgICB9LFxuICAgIHZhcmlhdGlvbnM6IHtcbiAgICAgICAgdmlldzoge1xuICAgICAgICAgICAgZGVmYXVsdDogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLml0ZW1CYWNrZ3JvdW5kfTogIzA4MDgwODFmO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmFjdGl2ZUl0ZW1CYWNrZ3JvdW5kfTogIzA4MDgwODtcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgICAgIHNpemU6IHtcbiAgICAgICAgICAgIHM6IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogMCAwLjM3NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbERvdFBhZGRpbmd9OiAwLjM3NXJlbSAwO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAwLjc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogMC41cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVYU306IDAuMzc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdEJvcmRlclJhZGl1c306IDUwJTtcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVXaWR0aH06IDJyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lQm9yZGVyUmFkaXVzfTogMC4zNzVyZW07XG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAycmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgICAgIG06IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogMCAwLjM3NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbERvdFBhZGRpbmd9OiAwLjM3NXJlbSAwO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90Qm9yZGVyUmFkaXVzfTogNTAlO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVNfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplU306IDAuNXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplWFN9OiAwLjM3NXJlbTtcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVXaWR0aH06IDNyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06IDAuNzVyZW07XG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUJvcmRlclJhZGl1c306IDAuMzc1cmVtO1xuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxMaW5lV2lkdGh9OiAwLjc1cmVtO1xuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZUhlaWdodH06IDNyZW07XG4gICAgICAgICAgICBgLFxuICAgICAgICB9LFxuICAgIH0sXG59O1xuIl19 */"))
|
21
|
+
}
|
22
|
+
}
|
23
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PaginationDots = void 0;
|
7
|
+
var _PaginationDots = /*#__PURE__*/require("../../../../components/PaginationDots");
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _PaginationDots2 = /*#__PURE__*/require("./PaginationDots.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_PaginationDots.paginationDotsConfig, _PaginationDots2.config);
|
11
|
+
var PaginationDots = exports.PaginationDots = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { ComponentProps, useState } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import { disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { PaginationDots } from './PaginationDots';
|
9
|
+
import { config } from './PaginationDots.config';
|
10
|
+
|
11
|
+
const { views, sizes } = getConfigVariations(config);
|
12
|
+
const orientations: Array<string> = ['vertical', 'horizontal'];
|
13
|
+
|
14
|
+
const meta: Meta<typeof PaginationDots> = {
|
15
|
+
title: 'b2c/Data Entry/PaginationDots',
|
16
|
+
decorators: [WithTheme],
|
17
|
+
component: PaginationDots,
|
18
|
+
args: {
|
19
|
+
view: 'default',
|
20
|
+
size: 'm',
|
21
|
+
},
|
22
|
+
argTypes: {
|
23
|
+
view: {
|
24
|
+
options: views,
|
25
|
+
control: {
|
26
|
+
type: 'select',
|
27
|
+
},
|
28
|
+
},
|
29
|
+
size: {
|
30
|
+
options: sizes,
|
31
|
+
control: {
|
32
|
+
type: 'inline-radio',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
dotType: {
|
36
|
+
options: ['dot', 'line'],
|
37
|
+
control: {
|
38
|
+
type: 'inline-radio',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
orientation: {
|
42
|
+
options: orientations,
|
43
|
+
control: {
|
44
|
+
type: 'inline-radio',
|
45
|
+
},
|
46
|
+
},
|
47
|
+
count: {
|
48
|
+
control: {
|
49
|
+
type: 'number',
|
50
|
+
},
|
51
|
+
},
|
52
|
+
visibleCount: {
|
53
|
+
control: {
|
54
|
+
type: 'number',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
...disableProps(['value', 'focused', 'pin']),
|
58
|
+
},
|
59
|
+
};
|
60
|
+
|
61
|
+
export default meta;
|
62
|
+
|
63
|
+
type StoryPropsDefault = ComponentProps<typeof PaginationDots> & {
|
64
|
+
currentDot: string;
|
65
|
+
};
|
66
|
+
|
67
|
+
const StoryDefault = ({ dotType, ...rest }: StoryPropsDefault) => {
|
68
|
+
const [value, setValue] = useState(0);
|
69
|
+
|
70
|
+
return (
|
71
|
+
<div style={{ width: '400px', height: '400px' }}>
|
72
|
+
<PaginationDots value={value} activeElementView={dotType} onChange={setValue} {...rest} />
|
73
|
+
</div>
|
74
|
+
);
|
75
|
+
};
|
76
|
+
|
77
|
+
export const Default: StoryObj<StoryPropsDefault> = {
|
78
|
+
args: {
|
79
|
+
size: 'm',
|
80
|
+
dotType: 'dot',
|
81
|
+
orientation: 'horizontal',
|
82
|
+
centered: false,
|
83
|
+
count: 9,
|
84
|
+
visibleCount: 9,
|
85
|
+
},
|
86
|
+
render: (args) => <StoryDefault {...args} />,
|
87
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
+
var _PaginationDots = /*#__PURE__*/require("../../../../components/PaginationDots");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
focused: 'true',
|
13
|
+
size: 'm'
|
14
|
+
},
|
15
|
+
variations: {
|
16
|
+
view: {
|
17
|
+
"default": /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.itemBackground, ":'#0808081f',", _PaginationDots.paginationDotsTokens.activeItemBackground, ":'#080808',;;label:plasma-new-hope__default;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWXdCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IHBhZ2luYXRpb25Eb3RzVG9rZW5zIGFzIHRva2VucyB9IGZyb20gJy4uLy4uLy4uLy4uL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMnO1xuXG5leHBvcnQgY29uc3QgY29uZmlnID0ge1xuICAgIGRlZmF1bHRzOiB7XG4gICAgICAgIHZpZXc6ICdkZWZhdWx0JyxcbiAgICAgICAgZm9jdXNlZDogJ3RydWUnLFxuICAgICAgICBzaXplOiAnbScsXG4gICAgfSxcbiAgICB2YXJpYXRpb25zOiB7XG4gICAgICAgIHZpZXc6IHtcbiAgICAgICAgICAgIGRlZmF1bHQ6IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5pdGVtQmFja2dyb3VuZH06ICcjMDgwODA4MWYnLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmFjdGl2ZUl0ZW1CYWNrZ3JvdW5kfTogJyMwODA4MDgnLFxuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFBhZGRpbmd9OiAnMCAwLjM3NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxEb3RQYWRkaW5nfTogJzAuMzc1cmVtIDAnLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAnMC4zNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogJzAuNXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVhTfTogJzAuNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdEJvcmRlclJhZGl1c306ICc1MCUnLFxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVXaWR0aH06ICcycmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lSGVpZ2h0fTogJzAuNXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUJvcmRlclJhZGl1c306ICcwLjM3NXJlbScsXG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06ICcwLjVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZUhlaWdodH06ICcycmVtJyxcbiAgICAgICAgICAgIGAsXG4gICAgICAgICAgICBtOiBjc3NgXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90UGFkZGluZ306ICcwIDAuMzc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbERvdFBhZGRpbmd9OiAnMC4zNzVyZW0gMCcsXG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RCb3JkZXJSYWRpdXN9OiAnNTAlJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplTX06ICcwLjM3NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVN9OiAnMC41cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplWFN9OiAnMC43NXJlbScsXG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lV2lkdGh9OiAnM3JlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06ICcwLjc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lQm9yZGVyUmFkaXVzfTogJzAuMzc1cmVtJyxcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZVdpZHRofTogJzAuNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsTGluZUhlaWdodH06ICczcmVtJyxcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgfSxcbn07XG4iXX0= */"))
|
18
|
+
},
|
19
|
+
size: {
|
20
|
+
s: /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.dotPadding, ":'0 0.375rem',", _PaginationDots.paginationDotsTokens.verticalDotPadding, ":'0.375rem 0',", _PaginationDots.paginationDotsTokens.dotSizeM, ":'0.375rem',", _PaginationDots.paginationDotsTokens.dotSizeS, ":'0.5rem',", _PaginationDots.paginationDotsTokens.dotSizeXS, ":'0.75rem',", _PaginationDots.paginationDotsTokens.dotBorderRadius, ":'50%',", _PaginationDots.paginationDotsTokens.lineWidth, ":'2rem',", _PaginationDots.paginationDotsTokens.lineHeight, ":'0.5rem',", _PaginationDots.paginationDotsTokens.lineBorderRadius, ":'0.375rem',", _PaginationDots.paginationDotsTokens.verticalLineWidth, ":'0.5rem',", _PaginationDots.paginationDotsTokens.verticalLineHeight, ":'2rem',;;label:plasma-new-hope__s;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0JrQiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvUGFnaW5hdGlvbkRvdHMuY29uZmlnLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBwYWdpbmF0aW9uRG90c1Rva2VucyBhcyB0b2tlbnMgfSBmcm9tICcuLi8uLi8uLi8uLi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnZGVmYXVsdCcsXG4gICAgICAgIGZvY3VzZWQ6ICd0cnVlJyxcbiAgICAgICAgc2l6ZTogJ20nLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuaXRlbUJhY2tncm91bmR9OiAnIzA4MDgwODFmJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5hY3RpdmVJdGVtQmFja2dyb3VuZH06ICcjMDgwODA4JyxcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgICAgIHNpemU6IHtcbiAgICAgICAgICAgIHM6IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogJzAgMC4zNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsRG90UGFkZGluZ306ICcwLjM3NXJlbSAwJyxcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVNfTogJzAuMzc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplU306ICcwLjVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVYU306ICcwLjc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RCb3JkZXJSYWRpdXN9OiAnNTAlJyxcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lV2lkdGh9OiAnMnJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06ICcwLjVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVCb3JkZXJSYWRpdXN9OiAnMC4zNzVyZW0nLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxMaW5lV2lkdGh9OiAnMC41cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAnMnJlbScsXG4gICAgICAgICAgICBgLFxuICAgICAgICAgICAgbTogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFBhZGRpbmd9OiAnMCAwLjM3NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxEb3RQYWRkaW5nfTogJzAuMzc1cmVtIDAnLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90Qm9yZGVyUmFkaXVzfTogJzUwJScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAnMC4zNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogJzAuNXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVhTfTogJzAuNzVyZW0nLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZVdpZHRofTogJzNyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVIZWlnaHR9OiAnMC43NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUJvcmRlclJhZGl1c306ICcwLjM3NXJlbScsXG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06ICcwLjc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAnM3JlbScsXG4gICAgICAgICAgICBgLFxuICAgICAgICB9LFxuICAgIH0sXG59O1xuIl19 */")),
|
21
|
+
m: /*#__PURE__*/(0, _react.css)(_PaginationDots.paginationDotsTokens.dotPadding, ":'0 0.375rem',", _PaginationDots.paginationDotsTokens.verticalDotPadding, ":'0.375rem 0',", _PaginationDots.paginationDotsTokens.dotBorderRadius, ":'50%',", _PaginationDots.paginationDotsTokens.dotSizeM, ":'0.375rem',", _PaginationDots.paginationDotsTokens.dotSizeS, ":'0.5rem',", _PaginationDots.paginationDotsTokens.dotSizeXS, ":'0.75rem',", _PaginationDots.paginationDotsTokens.lineWidth, ":'3rem',", _PaginationDots.paginationDotsTokens.lineHeight, ":'0.75rem',", _PaginationDots.paginationDotsTokens.lineBorderRadius, ":'0.375rem',", _PaginationDots.paginationDotsTokens.verticalLineWidth, ":'0.75rem',", _PaginationDots.paginationDotsTokens.verticalLineHeight, ":'3rem',;;label:plasma-new-hope__m;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9QYWdpbmF0aW9uRG90cy9QYWdpbmF0aW9uRG90cy5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0NrQiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9leGFtcGxlcy9wbGFzbWFfd2ViL2NvbXBvbmVudHMvUGFnaW5hdGlvbkRvdHMvUGFnaW5hdGlvbkRvdHMuY29uZmlnLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBwYWdpbmF0aW9uRG90c1Rva2VucyBhcyB0b2tlbnMgfSBmcm9tICcuLi8uLi8uLi8uLi9jb21wb25lbnRzL1BhZ2luYXRpb25Eb3RzJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnZGVmYXVsdCcsXG4gICAgICAgIGZvY3VzZWQ6ICd0cnVlJyxcbiAgICAgICAgc2l6ZTogJ20nLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuaXRlbUJhY2tncm91bmR9OiAnIzA4MDgwODFmJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5hY3RpdmVJdGVtQmFja2dyb3VuZH06ICcjMDgwODA4JyxcbiAgICAgICAgICAgIGAsXG4gICAgICAgIH0sXG4gICAgICAgIHNpemU6IHtcbiAgICAgICAgICAgIHM6IGNzc2BcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RQYWRkaW5nfTogJzAgMC4zNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLnZlcnRpY2FsRG90UGFkZGluZ306ICcwLjM3NXJlbSAwJyxcblxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVNfTogJzAuMzc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RTaXplU306ICcwLjVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVYU306ICcwLjc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5kb3RCb3JkZXJSYWRpdXN9OiAnNTAlJyxcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5saW5lV2lkdGh9OiAnMnJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUhlaWdodH06ICcwLjVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVCb3JkZXJSYWRpdXN9OiAnMC4zNzVyZW0nLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxMaW5lV2lkdGh9OiAnMC41cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAnMnJlbScsXG4gICAgICAgICAgICBgLFxuICAgICAgICAgICAgbTogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFBhZGRpbmd9OiAnMCAwLjM3NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMudmVydGljYWxEb3RQYWRkaW5nfTogJzAuMzc1cmVtIDAnLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90Qm9yZGVyUmFkaXVzfTogJzUwJScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZU19OiAnMC4zNzVyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmRvdFNpemVTfTogJzAuNXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMuZG90U2l6ZVhTfTogJzAuNzVyZW0nLFxuXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZVdpZHRofTogJzNyZW0nLFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmxpbmVIZWlnaHR9OiAnMC43NXJlbScsXG4gICAgICAgICAgICAgICAgJHt0b2tlbnMubGluZUJvcmRlclJhZGl1c306ICcwLjM3NXJlbScsXG5cbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVXaWR0aH06ICcwLjc1cmVtJyxcbiAgICAgICAgICAgICAgICAke3Rva2Vucy52ZXJ0aWNhbExpbmVIZWlnaHR9OiAnM3JlbScsXG4gICAgICAgICAgICBgLFxuICAgICAgICB9LFxuICAgIH0sXG59O1xuIl19 */"))
|
22
|
+
}
|
23
|
+
}
|
24
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PaginationDots = void 0;
|
7
|
+
var _PaginationDots = /*#__PURE__*/require("../../../../components/PaginationDots");
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _PaginationDots2 = /*#__PURE__*/require("./PaginationDots.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_PaginationDots.paginationDotsConfig, _PaginationDots2.config);
|
11
|
+
var PaginationDots = exports.PaginationDots = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import { disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { PaginationDots } from './PaginationDots';
|
9
|
+
import { config } from './PaginationDots.config';
|
10
|
+
|
11
|
+
const { views, sizes } = getConfigVariations(config);
|
12
|
+
const orientations: Array<string> = ['vertical', 'horizontal'];
|
13
|
+
|
14
|
+
const meta: Meta<typeof PaginationDots> = {
|
15
|
+
title: 'web/Data Entry/PaginationDots',
|
16
|
+
decorators: [WithTheme],
|
17
|
+
component: PaginationDots,
|
18
|
+
args: {
|
19
|
+
view: 'default',
|
20
|
+
size: 'm',
|
21
|
+
},
|
22
|
+
argTypes: {
|
23
|
+
view: {
|
24
|
+
options: views,
|
25
|
+
control: {
|
26
|
+
type: 'select',
|
27
|
+
},
|
28
|
+
},
|
29
|
+
size: {
|
30
|
+
options: sizes,
|
31
|
+
control: {
|
32
|
+
type: 'inner-radio',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
orientation: {
|
36
|
+
options: orientations,
|
37
|
+
control: {
|
38
|
+
type: 'inline-radio',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
activeDotCentered: {
|
42
|
+
control: {
|
43
|
+
type: 'boolean',
|
44
|
+
},
|
45
|
+
},
|
46
|
+
...disableProps(['value', 'focused', 'pin']),
|
47
|
+
},
|
48
|
+
};
|
49
|
+
|
50
|
+
export default meta;
|
51
|
+
|
52
|
+
type StoryPropsDefault = ComponentProps<typeof PaginationDots> & {
|
53
|
+
enableContentLeft: boolean;
|
54
|
+
enableContentRight: boolean;
|
55
|
+
};
|
56
|
+
|
57
|
+
const StoryDefault = ({ size, ...rest }: StoryPropsDefault) => {
|
58
|
+
return <PaginationDots size={size} value={0} count={9} {...rest} />;
|
59
|
+
};
|
60
|
+
|
61
|
+
export const Default: StoryObj<StoryPropsDefault> = {
|
62
|
+
args: {
|
63
|
+
orientation: 'horizontal',
|
64
|
+
stretched: true,
|
65
|
+
currentDot: 'first',
|
66
|
+
},
|
67
|
+
render: (args) => <StoryDefault {...args} />,
|
68
|
+
};
|