@alfalab/core-components-page-indicator 3.0.3 → 3.0.4-alfasans
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/components/bullet/Component.js +4 -4
- package/components/bullet/Component.js.map +1 -1
- package/components/bullet/default.css +2 -2
- package/components/bullet/default.module.css.js +1 -1
- package/components/bullet/index.css +7 -9
- package/components/bullet/index.module.css.js +1 -1
- package/components/bullet/index.module.css.js.map +1 -1
- package/components/bullet/inverted.css +2 -2
- package/components/bullet/inverted.module.css.js +1 -1
- package/components/bullet/static-inverted.css +2 -2
- package/components/bullet/static-inverted.module.css.js +1 -1
- package/components/bullet/static.css +2 -2
- package/components/bullet/static.module.css.js +1 -1
- package/components/dynamic/Component.js +3 -3
- package/components/dynamic/Component.js.map +1 -1
- package/components/dynamic/default.css +3 -3
- package/components/dynamic/default.module.css.js +1 -1
- package/components/dynamic/index.css +6 -8
- package/components/dynamic/index.module.css.js +1 -1
- package/components/dynamic/index.module.css.js.map +1 -1
- package/components/dynamic/inverted.css +3 -3
- package/components/dynamic/inverted.module.css.js +1 -1
- package/components/dynamic/static-inverted.css +3 -3
- package/components/dynamic/static-inverted.module.css.js +1 -1
- package/components/dynamic/static.css +3 -3
- package/components/dynamic/static.module.css.js +1 -1
- package/components/runner/Component.js +2 -2
- package/components/runner/Component.js.map +1 -1
- package/components/runner/default.css +2 -2
- package/components/runner/default.module.css.js +1 -1
- package/components/runner/index.css +4 -1
- package/components/runner/index.module.css.js +1 -1
- package/components/runner/index.module.css.js.map +1 -1
- package/components/runner/inverted.css +2 -2
- package/components/runner/inverted.module.css.js +1 -1
- package/components/runner/static-inverted.css +2 -2
- package/components/runner/static-inverted.module.css.js +1 -1
- package/components/runner/static.css +2 -2
- package/components/runner/static.module.css.js +1 -1
- package/components/step/Component.js +3 -3
- package/components/step/Component.js.map +1 -1
- package/components/step/default.css +2 -2
- package/components/step/default.module.css.js +1 -1
- package/components/step/index.css +3 -4
- package/components/step/index.module.css.js +1 -1
- package/components/step/index.module.css.js.map +1 -1
- package/components/step/inverted.css +2 -2
- package/components/step/inverted.module.css.js +1 -1
- package/components/step/static-inverted.css +2 -2
- package/components/step/static-inverted.module.css.js +1 -1
- package/components/step/static.css +2 -2
- package/components/step/static.module.css.js +1 -1
- package/cssm/components/bullet/Component.js +4 -4
- package/cssm/components/bullet/Component.js.map +1 -1
- package/cssm/components/bullet/index.module.css +0 -2
- package/cssm/components/dynamic/Component.js +3 -3
- package/cssm/components/dynamic/Component.js.map +1 -1
- package/cssm/components/dynamic/index.module.css +0 -2
- package/cssm/components/runner/Component.js +2 -2
- package/cssm/components/runner/Component.js.map +1 -1
- package/cssm/components/runner/index.module.css +3 -0
- package/cssm/components/step/Component.js +3 -3
- package/cssm/components/step/Component.js.map +1 -1
- package/cssm/components/step/index.module.css +1 -2
- package/cssm/types.d.ts +15 -35
- package/esm/components/bullet/Component.js +4 -4
- package/esm/components/bullet/Component.js.map +1 -1
- package/esm/components/bullet/default.css +2 -2
- package/esm/components/bullet/default.module.css.js +1 -1
- package/esm/components/bullet/index.css +7 -9
- package/esm/components/bullet/index.module.css.js +1 -1
- package/esm/components/bullet/index.module.css.js.map +1 -1
- package/esm/components/bullet/inverted.css +2 -2
- package/esm/components/bullet/inverted.module.css.js +1 -1
- package/esm/components/bullet/static-inverted.css +2 -2
- package/esm/components/bullet/static-inverted.module.css.js +1 -1
- package/esm/components/bullet/static.css +2 -2
- package/esm/components/bullet/static.module.css.js +1 -1
- package/esm/components/dynamic/Component.js +3 -3
- package/esm/components/dynamic/Component.js.map +1 -1
- package/esm/components/dynamic/default.css +3 -3
- package/esm/components/dynamic/default.module.css.js +1 -1
- package/esm/components/dynamic/index.css +6 -8
- package/esm/components/dynamic/index.module.css.js +1 -1
- package/esm/components/dynamic/index.module.css.js.map +1 -1
- package/esm/components/dynamic/inverted.css +3 -3
- package/esm/components/dynamic/inverted.module.css.js +1 -1
- package/esm/components/dynamic/static-inverted.css +3 -3
- package/esm/components/dynamic/static-inverted.module.css.js +1 -1
- package/esm/components/dynamic/static.css +3 -3
- package/esm/components/dynamic/static.module.css.js +1 -1
- package/esm/components/runner/Component.js +2 -2
- package/esm/components/runner/Component.js.map +1 -1
- package/esm/components/runner/default.css +2 -2
- package/esm/components/runner/default.module.css.js +1 -1
- package/esm/components/runner/index.css +4 -1
- package/esm/components/runner/index.module.css.js +1 -1
- package/esm/components/runner/index.module.css.js.map +1 -1
- package/esm/components/runner/inverted.css +2 -2
- package/esm/components/runner/inverted.module.css.js +1 -1
- package/esm/components/runner/static-inverted.css +2 -2
- package/esm/components/runner/static-inverted.module.css.js +1 -1
- package/esm/components/runner/static.css +2 -2
- package/esm/components/runner/static.module.css.js +1 -1
- package/esm/components/step/Component.js +3 -3
- package/esm/components/step/Component.js.map +1 -1
- package/esm/components/step/default.css +2 -2
- package/esm/components/step/default.module.css.js +1 -1
- package/esm/components/step/index.css +3 -4
- package/esm/components/step/index.module.css.js +1 -1
- package/esm/components/step/index.module.css.js.map +1 -1
- package/esm/components/step/inverted.css +2 -2
- package/esm/components/step/inverted.module.css.js +1 -1
- package/esm/components/step/static-inverted.css +2 -2
- package/esm/components/step/static-inverted.module.css.js +1 -1
- package/esm/components/step/static.css +2 -2
- package/esm/components/step/static.module.css.js +1 -1
- package/esm/types.d.ts +15 -35
- package/modern/components/bullet/Component.js +4 -4
- package/modern/components/bullet/Component.js.map +1 -1
- package/modern/components/bullet/default.css +2 -2
- package/modern/components/bullet/default.module.css.js +1 -1
- package/modern/components/bullet/index.css +7 -9
- package/modern/components/bullet/index.module.css.js +1 -1
- package/modern/components/bullet/index.module.css.js.map +1 -1
- package/modern/components/bullet/inverted.css +2 -2
- package/modern/components/bullet/inverted.module.css.js +1 -1
- package/modern/components/bullet/static-inverted.css +2 -2
- package/modern/components/bullet/static-inverted.module.css.js +1 -1
- package/modern/components/bullet/static.css +2 -2
- package/modern/components/bullet/static.module.css.js +1 -1
- package/modern/components/dynamic/Component.js +3 -3
- package/modern/components/dynamic/Component.js.map +1 -1
- package/modern/components/dynamic/default.css +3 -3
- package/modern/components/dynamic/default.module.css.js +1 -1
- package/modern/components/dynamic/index.css +6 -8
- package/modern/components/dynamic/index.module.css.js +1 -1
- package/modern/components/dynamic/index.module.css.js.map +1 -1
- package/modern/components/dynamic/inverted.css +3 -3
- package/modern/components/dynamic/inverted.module.css.js +1 -1
- package/modern/components/dynamic/static-inverted.css +3 -3
- package/modern/components/dynamic/static-inverted.module.css.js +1 -1
- package/modern/components/dynamic/static.css +3 -3
- package/modern/components/dynamic/static.module.css.js +1 -1
- package/modern/components/runner/Component.js +1 -1
- package/modern/components/runner/Component.js.map +1 -1
- package/modern/components/runner/default.css +2 -2
- package/modern/components/runner/default.module.css.js +1 -1
- package/modern/components/runner/index.css +4 -1
- package/modern/components/runner/index.module.css.js +1 -1
- package/modern/components/runner/index.module.css.js.map +1 -1
- package/modern/components/runner/inverted.css +2 -2
- package/modern/components/runner/inverted.module.css.js +1 -1
- package/modern/components/runner/static-inverted.css +2 -2
- package/modern/components/runner/static-inverted.module.css.js +1 -1
- package/modern/components/runner/static.css +2 -2
- package/modern/components/runner/static.module.css.js +1 -1
- package/modern/components/step/Component.js +1 -1
- package/modern/components/step/Component.js.map +1 -1
- package/modern/components/step/default.css +2 -2
- package/modern/components/step/default.module.css.js +1 -1
- package/modern/components/step/index.css +3 -4
- package/modern/components/step/index.module.css.js +1 -1
- package/modern/components/step/index.module.css.js.map +1 -1
- package/modern/components/step/inverted.css +2 -2
- package/modern/components/step/inverted.module.css.js +1 -1
- package/modern/components/step/static-inverted.css +2 -2
- package/modern/components/step/static-inverted.module.css.js +1 -1
- package/modern/components/step/static.css +2 -2
- package/modern/components/step/static.module.css.js +1 -1
- package/modern/types.d.ts +15 -35
- package/moderncssm/components/bullet/Component.js +4 -4
- package/moderncssm/components/bullet/Component.js.map +1 -1
- package/moderncssm/components/bullet/index.module.css +0 -2
- package/moderncssm/components/dynamic/Component.js +3 -3
- package/moderncssm/components/dynamic/Component.js.map +1 -1
- package/moderncssm/components/dynamic/index.module.css +0 -2
- package/moderncssm/components/runner/Component.js +1 -1
- package/moderncssm/components/runner/Component.js.map +1 -1
- package/moderncssm/components/runner/index.module.css +4 -0
- package/moderncssm/components/step/Component.js +1 -1
- package/moderncssm/components/step/Component.js.map +1 -1
- package/moderncssm/components/step/index.module.css +1 -2
- package/moderncssm/types.d.ts +15 -35
- package/package.json +7 -4
- package/src/components/bullet/Component.tsx +9 -5
- package/src/components/bullet/index.module.css +0 -2
- package/src/components/dynamic/Component.tsx +5 -4
- package/src/components/dynamic/index.module.css +0 -2
- package/src/components/runner/Component.tsx +2 -1
- package/src/components/runner/index.module.css +4 -0
- package/src/components/step/Component.tsx +4 -3
- package/src/components/step/index.module.css +1 -2
- package/src/types.ts +15 -35
- package/types.d.ts +15 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './inverted.css';
|
|
2
2
|
|
|
3
|
-
var invertedColors = {"element":"page-
|
|
3
|
+
var invertedColors = {"element":"page-indicator__element_7acin","active":"page-indicator__active_7acin"};
|
|
4
4
|
|
|
5
5
|
export { invertedColors as default };
|
|
6
6
|
//# sourceMappingURL=inverted.module.css.js.map
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
|
|
7
7
|
--page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_13iar {
|
|
10
10
|
background: var(--page-indicator-color-static-inverted);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_13iar.page-indicator__active_13iar {
|
|
13
13
|
background: var(--page-indicator-active-color-static-inverted);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static-inverted.css';
|
|
2
2
|
|
|
3
|
-
var staticInvertedColors = {"element":"page-
|
|
3
|
+
var staticInvertedColors = {"element":"page-indicator__element_13iar","active":"page-indicator__active_13iar"};
|
|
4
4
|
|
|
5
5
|
export { staticInvertedColors as default };
|
|
6
6
|
//# sourceMappingURL=static-inverted.module.css.js.map
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color-static: var(--color-static-neutral-translucent-300);
|
|
7
7
|
--page-indicator-active-color-static: var(--color-static-neutral-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_r31gi {
|
|
10
10
|
background: var(--page-indicator-color-static);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_r31gi.page-indicator__active_r31gi {
|
|
13
13
|
background: var(--page-indicator-active-color-static);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static.css';
|
|
2
2
|
|
|
3
|
-
var staticColors = {"element":"page-
|
|
3
|
+
var staticColors = {"element":"page-indicator__element_r31gi","active":"page-indicator__active_r31gi"};
|
|
4
4
|
|
|
5
5
|
export { staticColors as default };
|
|
6
6
|
//# sourceMappingURL=static.module.css.js.map
|
package/esm/types.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
interface BasePageIndicatorProps {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @default 0
|
|
3
|
+
* Имя класса
|
|
5
4
|
*/
|
|
6
|
-
|
|
5
|
+
className?: string;
|
|
7
6
|
/**
|
|
8
7
|
* Индекс выбранного элемента
|
|
9
8
|
*/
|
|
10
|
-
activeElement
|
|
9
|
+
activeElement: number;
|
|
11
10
|
/**
|
|
12
11
|
* Количество элементов (минимум 2)
|
|
13
12
|
* @default 10
|
|
14
13
|
*/
|
|
15
14
|
elements?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PageIndicatorDynamicProps extends BasePageIndicatorProps {
|
|
17
|
+
/**
|
|
18
|
+
* Индекс выбранного элемента по-умолчанию
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
defaultActiveElement?: number;
|
|
16
22
|
/**
|
|
17
23
|
* Высота компонента
|
|
18
24
|
* @default 8
|
|
@@ -53,16 +59,7 @@ export interface PageIndicatorDynamicProps {
|
|
|
53
59
|
*/
|
|
54
60
|
colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
|
|
55
61
|
}
|
|
56
|
-
export interface PageIndicatorBulletProps {
|
|
57
|
-
/**
|
|
58
|
-
* Индекс выбранного элемента
|
|
59
|
-
*/
|
|
60
|
-
activeElement: number;
|
|
61
|
-
/**
|
|
62
|
-
* Количество элементов (минимум 2)
|
|
63
|
-
* @default 10
|
|
64
|
-
*/
|
|
65
|
-
elements?: number;
|
|
62
|
+
export interface PageIndicatorBulletProps extends BasePageIndicatorProps {
|
|
66
63
|
/**
|
|
67
64
|
* Высота компонента
|
|
68
65
|
* @default 8
|
|
@@ -79,16 +76,7 @@ export interface PageIndicatorBulletProps {
|
|
|
79
76
|
*/
|
|
80
77
|
colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
|
|
81
78
|
}
|
|
82
|
-
export interface PageIndicatorStepProps {
|
|
83
|
-
/**
|
|
84
|
-
* Индекс выбранного элемента
|
|
85
|
-
*/
|
|
86
|
-
activeElement: number;
|
|
87
|
-
/**
|
|
88
|
-
* Количество элементов (минимум 2)
|
|
89
|
-
* @default 10
|
|
90
|
-
*/
|
|
91
|
-
elements?: number;
|
|
79
|
+
export interface PageIndicatorStepProps extends BasePageIndicatorProps {
|
|
92
80
|
/**
|
|
93
81
|
* Высота компонента
|
|
94
82
|
* @default 4
|
|
@@ -105,16 +93,7 @@ export interface PageIndicatorStepProps {
|
|
|
105
93
|
*/
|
|
106
94
|
colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
|
|
107
95
|
}
|
|
108
|
-
export interface PageIndicatorRunnerProps {
|
|
109
|
-
/**
|
|
110
|
-
* Индекс выбранного элемента
|
|
111
|
-
*/
|
|
112
|
-
activeElement: number;
|
|
113
|
-
/**
|
|
114
|
-
* Количество элементов (минимум 2)
|
|
115
|
-
* @default 10
|
|
116
|
-
*/
|
|
117
|
-
elements?: number;
|
|
96
|
+
export interface PageIndicatorRunnerProps extends BasePageIndicatorProps {
|
|
118
97
|
/**
|
|
119
98
|
* Высота компонента
|
|
120
99
|
* @default 4
|
|
@@ -126,3 +105,4 @@ export interface PageIndicatorRunnerProps {
|
|
|
126
105
|
*/
|
|
127
106
|
colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
|
|
128
107
|
}
|
|
108
|
+
export {};
|
|
@@ -15,11 +15,11 @@ const colorsStyle = {
|
|
|
15
15
|
'static-inverted': staticInvertedColors,
|
|
16
16
|
};
|
|
17
17
|
const transitionClassess = {};
|
|
18
|
-
const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElementIndex, size = 8, gap = 8, colors = 'default', }) => {
|
|
18
|
+
const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElementIndex, size = 8, gap = 8, colors = 'default', className, }) => {
|
|
19
19
|
const refs = useMemo(() => Array.from({ length: count }, () => createRef()), [count]);
|
|
20
20
|
const [height, width, offset, elementSize, firstVisibleElementIndex, lastVisibleElementIndex] = useMemo(() => calcParams(size, gap, activeElementIndex, count), [activeElementIndex, count, gap, size]);
|
|
21
|
-
return (React.createElement("div", { className: cn(styles.pageIndicator, styles.bullet), style: { height, width } },
|
|
22
|
-
React.createElement("
|
|
21
|
+
return (React.createElement("div", { className: cn(styles.pageIndicator, styles.bullet, className), style: { height, width } },
|
|
22
|
+
React.createElement("div", { className: styles.elementsList, style: { gap, transform: `translate(${offset}px)` } }, refs.map((ref, index) => {
|
|
23
23
|
const sizeOfElement = elementSize(index);
|
|
24
24
|
const isActive = activeElementIndex === index;
|
|
25
25
|
const isVisible = firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;
|
|
@@ -33,7 +33,7 @@ const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElemen
|
|
|
33
33
|
// eslint-disable-next-line react/no-array-index-key
|
|
34
34
|
key: index, nodeRef: ref, addEndListener: addListTransitionEndListener, in: isVisible,
|
|
35
35
|
// passed empty object so any classes aren't added
|
|
36
|
-
classNames: transitionClassess }, (status) => (React.createElement("
|
|
36
|
+
classNames: transitionClassess }, (status) => (React.createElement("div", { ref: ref, "data-index": index, className: cn(styles.element, colorsStyle[colors].element, { [colorsStyle[colors].active]: isActive }, styles[status]), style: { height: sizeOfElement, width: sizeOfElement } }))));
|
|
37
37
|
}))));
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/bullet/Component.tsx"],"sourcesContent":["import React, { createRef, type FC, useMemo } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport cn from 'classnames';\n\nimport { type PageIndicatorBulletProps } from '../../types';\n\nimport { calcParams } from './utils';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst transitionClassess = {} as const;\n\nexport const PageIndicatorBullet: FC<PageIndicatorBulletProps> = ({\n elements: count = 10,\n activeElement: activeElementIndex,\n size = 8,\n gap = 8,\n colors = 'default',\n}) => {\n const refs = useMemo(\n () => Array.from({ length: count }, () => createRef<
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/bullet/Component.tsx"],"sourcesContent":["import React, { createRef, type FC, useMemo } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport cn from 'classnames';\n\nimport { type PageIndicatorBulletProps } from '../../types';\n\nimport { calcParams } from './utils';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst transitionClassess = {} as const;\n\nexport const PageIndicatorBullet: FC<PageIndicatorBulletProps> = ({\n elements: count = 10,\n activeElement: activeElementIndex,\n size = 8,\n gap = 8,\n colors = 'default',\n className,\n}) => {\n const refs = useMemo(\n () => Array.from({ length: count }, () => createRef<HTMLDivElement>()),\n [count],\n );\n const [height, width, offset, elementSize, firstVisibleElementIndex, lastVisibleElementIndex] =\n useMemo(\n () => calcParams(size, gap, activeElementIndex, count),\n [activeElementIndex, count, gap, size],\n );\n\n return (\n <div\n className={cn(styles.pageIndicator, styles.bullet, className)}\n style={{ height, width }}\n >\n <div\n className={styles.elementsList}\n style={{ gap, transform: `translate(${offset}px)` }}\n >\n {refs.map((ref, index) => {\n const sizeOfElement = elementSize(index);\n const isActive = activeElementIndex === index;\n const isVisible =\n firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;\n const addListTransitionEndListener = (done: () => void) => {\n const parentElement = ref.current?.parentElement;\n\n parentElement?.addEventListener('transitionend', done, { once: true });\n };\n\n return (\n <CSSTransition\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n nodeRef={ref}\n addEndListener={addListTransitionEndListener}\n in={isVisible}\n // passed empty object so any classes aren't added\n classNames={transitionClassess}\n >\n {(status) => (\n <div\n ref={ref}\n data-index={index}\n className={cn(\n styles.element,\n colorsStyle[colors].element,\n { [colorsStyle[colors].active]: isActive },\n styles[status],\n )}\n style={{ height: sizeOfElement, width: sizeOfElement }}\n />\n )}\n </CSSTransition>\n );\n })}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAcA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEV,MAAM,kBAAkB,GAAG,EAAW;AAE/B,MAAM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AA,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,EAAE,aAAa;AAEhD,gBAAA,aAAa,EAAE,gBAAgB,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1E,aAAC;YAED,QACI,oBAAC;;;;AAEG,gBAAA,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,4BAA4B,EAC5C,EAAE,EAAE,SAAS;;AAEb,gBAAA,UAAU,EAAE,kBAAkB,EAE7B,EAAA,CAAC,MAAM,MACJ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACI,YAAA,EAAA,KAAK,EACjB,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,OAAO,EACd,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAC3B,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,QAAQ,EAAE,EAC1C,MAAM,CAAC,MAAM,CAAC,CACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,CACxD,CACL,CACW;AAExB,SAAC,CAAC,CACA,CACJ;AAEd;;;;"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color: var(--color-light-neutral-translucent-300);
|
|
7
7
|
--page-indicator-active-color: var(--color-light-neutral-translucent-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_p30ls {
|
|
10
10
|
background: var(--page-indicator-color);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_p30ls.page-indicator__active_p30ls {
|
|
13
13
|
background: var(--page-indicator-active-color);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './default.css';
|
|
2
2
|
|
|
3
|
-
const defaultColors = {"element":"page-
|
|
3
|
+
const defaultColors = {"element":"page-indicator__element_p30ls","active":"page-indicator__active_p30ls"};
|
|
4
4
|
|
|
5
5
|
export { defaultColors as default };
|
|
6
6
|
//# sourceMappingURL=default.module.css.js.map
|
|
@@ -5,29 +5,27 @@
|
|
|
5
5
|
--page-indicator-animation-duration: 0.2s;
|
|
6
6
|
--page-indicator-animation-timing-function: ease-in-out;
|
|
7
7
|
}
|
|
8
|
-
.page-
|
|
8
|
+
.page-indicator__pageIndicator_wp2vf.page-indicator__bullet_wp2vf {
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
}
|
|
11
|
-
.page-
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
11
|
+
.page-indicator__elementsList_wp2vf {
|
|
14
12
|
display: flex;
|
|
15
13
|
align-items: center;
|
|
16
14
|
will-change: transform;
|
|
17
15
|
transition: transform var(--page-indicator-animation-duration)
|
|
18
16
|
var(--page-indicator-animation-timing-function);
|
|
19
17
|
}
|
|
20
|
-
.page-
|
|
18
|
+
.page-indicator__element_wp2vf {
|
|
21
19
|
list-style-type: none;
|
|
22
20
|
flex-shrink: 0;
|
|
23
21
|
transition: background var(--page-indicator-animation-duration)
|
|
24
22
|
var(--page-indicator-animation-timing-function);
|
|
25
23
|
border-radius: var(--border-radius-circle);
|
|
26
24
|
}
|
|
27
|
-
.page-
|
|
25
|
+
.page-indicator__element_wp2vf.page-indicator__entering_wp2vf {
|
|
28
26
|
opacity: 0;
|
|
29
27
|
}
|
|
30
|
-
.page-
|
|
28
|
+
.page-indicator__element_wp2vf.page-indicator__entered_wp2vf {
|
|
31
29
|
opacity: 1;
|
|
32
30
|
transition:
|
|
33
31
|
background var(--page-indicator-animation-duration)
|
|
@@ -35,9 +33,9 @@
|
|
|
35
33
|
opacity var(--page-indicator-animation-duration)
|
|
36
34
|
var(--page-indicator-animation-timing-function);
|
|
37
35
|
}
|
|
38
|
-
.page-
|
|
36
|
+
.page-indicator__element_wp2vf.page-indicator__exiting_wp2vf {
|
|
39
37
|
opacity: 0;
|
|
40
38
|
}
|
|
41
|
-
.page-
|
|
39
|
+
.page-indicator__element_wp2vf.page-indicator__exited_wp2vf {
|
|
42
40
|
opacity: 0;
|
|
43
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"pageIndicator":"page-
|
|
3
|
+
const styles = {"pageIndicator":"page-indicator__pageIndicator_wp2vf","bullet":"page-indicator__bullet_wp2vf","elementsList":"page-indicator__elementsList_wp2vf","element":"page-indicator__element_wp2vf","entering":"page-indicator__entering_wp2vf","entered":"page-indicator__entered_wp2vf","exiting":"page-indicator__exiting_wp2vf","exited":"page-indicator__exited_wp2vf"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/bullet/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n &.bullet {\n overflow: hidden;\n }\n}\n\n.elementsList {\n
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/bullet/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n &.bullet {\n overflow: hidden;\n }\n}\n\n.elementsList {\n display: flex;\n align-items: center;\n will-change: transform;\n transition: transform var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n}\n\n.element {\n list-style-type: none;\n flex-shrink: 0;\n transition: background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n border-radius: var(--border-radius-circle);\n\n &.entering {\n opacity: 0;\n }\n &.entered {\n opacity: 1;\n transition:\n background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function),\n opacity var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n }\n &.exiting {\n opacity: 0;\n }\n &.exited {\n opacity: 0;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,QAAQ,CAAC,8BAA8B,CAAC,cAAc,CAAC,oCAAoC,CAAC,SAAS,CAAC,+BAA+B,CAAC,UAAU,CAAC,gCAAgC,CAAC,SAAS,CAAC,+BAA+B,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC;;;;"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color-inverted: var(--color-light-neutral-translucent-300-inverted);
|
|
7
7
|
--page-indicator-active-color-inverted: var(--color-light-neutral-translucent-1300-inverted);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_jrt7t {
|
|
10
10
|
background: var(--page-indicator-color-inverted);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_jrt7t.page-indicator__active_jrt7t {
|
|
13
13
|
background: var(--page-indicator-active-color-inverted);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './inverted.css';
|
|
2
2
|
|
|
3
|
-
const invertedColors = {"element":"page-
|
|
3
|
+
const invertedColors = {"element":"page-indicator__element_jrt7t","active":"page-indicator__active_jrt7t"};
|
|
4
4
|
|
|
5
5
|
export { invertedColors as default };
|
|
6
6
|
//# sourceMappingURL=inverted.module.css.js.map
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
|
|
7
7
|
--page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_l4x8q {
|
|
10
10
|
background: var(--page-indicator-color-static-inverted);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_l4x8q.page-indicator__active_l4x8q {
|
|
13
13
|
background: var(--page-indicator-active-color-static-inverted);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static-inverted.css';
|
|
2
2
|
|
|
3
|
-
const staticInvertedColors = {"element":"page-
|
|
3
|
+
const staticInvertedColors = {"element":"page-indicator__element_l4x8q","active":"page-indicator__active_l4x8q"};
|
|
4
4
|
|
|
5
5
|
export { staticInvertedColors as default };
|
|
6
6
|
//# sourceMappingURL=static-inverted.module.css.js.map
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color-static: var(--color-static-neutral-translucent-300);
|
|
7
7
|
--page-indicator-active-color-static: var(--color-static-neutral-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_1fl6e {
|
|
10
10
|
background: var(--page-indicator-color-static);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_1fl6e.page-indicator__active_1fl6e {
|
|
13
13
|
background: var(--page-indicator-active-color-static);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static.css';
|
|
2
2
|
|
|
3
|
-
const staticColors = {"element":"page-
|
|
3
|
+
const staticColors = {"element":"page-indicator__element_1fl6e","active":"page-indicator__active_1fl6e"};
|
|
4
4
|
|
|
5
5
|
export { staticColors as default };
|
|
6
6
|
//# sourceMappingURL=static.module.css.js.map
|
|
@@ -15,7 +15,7 @@ const colorsStyle = {
|
|
|
15
15
|
};
|
|
16
16
|
const FULL_PROGRESS = 100;
|
|
17
17
|
const PageIndicatorDynamic = (props) => {
|
|
18
|
-
const { size: height = 8, gap = 8, activeElementWidth = height * 7, elements: count = 10, activeElement: indexFromProps, onActiveElementChange, defaultActiveElement: defaultIndex = 0, active = true, duration: durationFromProps = 3000, cycle = false, colors = 'default', } = props;
|
|
18
|
+
const { size: height = 8, gap = 8, activeElementWidth = height * 7, elements: count = 10, activeElement: indexFromProps, onActiveElementChange, defaultActiveElement: defaultIndex = 0, active = true, duration: durationFromProps = 3000, cycle = false, colors = 'default', className, } = props;
|
|
19
19
|
const [activeIndex, setActiveIndex] = useState(indexFromProps ?? defaultIndex);
|
|
20
20
|
const [progress, setProgress] = useState(0);
|
|
21
21
|
const inProgress = progress < FULL_PROGRESS;
|
|
@@ -53,7 +53,7 @@ const PageIndicatorDynamic = (props) => {
|
|
|
53
53
|
setActiveIndex(nextActiveIndex);
|
|
54
54
|
setProgress(0);
|
|
55
55
|
}, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);
|
|
56
|
-
return (React.createElement("
|
|
56
|
+
return (React.createElement("div", { className: cn(styles.pageIndicator, className), style: { height, gap } }, Array.from({ length: count }, (_, index) => {
|
|
57
57
|
const isActive = index === activeIndex;
|
|
58
58
|
const style = {
|
|
59
59
|
width: isActive ? activeElementWidth : height,
|
|
@@ -62,7 +62,7 @@ const PageIndicatorDynamic = (props) => {
|
|
|
62
62
|
const progressStyle = isActive
|
|
63
63
|
? { transform: `translateX(${progress - FULL_PROGRESS}%)` }
|
|
64
64
|
: undefined;
|
|
65
|
-
return (React.createElement("
|
|
65
|
+
return (React.createElement("div", { key: index, style: style, className: cn(styles.element, colorsStyle[colors].element, {
|
|
66
66
|
[styles.active]: isActive,
|
|
67
67
|
[colorsStyle[colors].active]: isActive,
|
|
68
68
|
}) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/dynamic/Component.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n hasOwnProperty,\n isFn,\n isNonNullable,\n isNullable,\n noop,\n} from '@alfalab/core-components-shared';\n\nimport { type PageIndicatorDynamicProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst FULL_PROGRESS = 100;\n\nexport const PageIndicatorDynamic: React.FC<PageIndicatorDynamicProps> = (props) => {\n const {\n size: height = 8,\n gap = 8,\n activeElementWidth = height * 7,\n elements: count = 10,\n activeElement: indexFromProps,\n onActiveElementChange,\n defaultActiveElement: defaultIndex = 0,\n active = true,\n duration: durationFromProps = 3000,\n cycle = false,\n colors = 'default',\n } = props;\n const [activeIndex, setActiveIndex] = useState<number | undefined>(\n indexFromProps ?? defaultIndex,\n );\n const [progress, setProgress] = useState(0);\n const inProgress = progress < FULL_PROGRESS;\n const activeIndexInProps = hasOwnProperty(props, 'activeElement');\n let duration: number;\n\n if (active && isNonNullable(activeIndex) && inProgress) {\n duration = isFn(durationFromProps) ? durationFromProps(activeIndex) : durationFromProps;\n } else {\n duration = -1;\n }\n\n // getDerivedStateFromProps\n if (activeIndexInProps && !(activeIndex === indexFromProps)) {\n setActiveIndex(indexFromProps);\n setProgress(0);\n }\n\n useEffect(() => {\n if (duration === -1) {\n return noop;\n }\n\n const interval = duration / FULL_PROGRESS;\n const timer = setInterval(\n () => setProgress((prevProgress) => Math.min(prevProgress + 1, FULL_PROGRESS)),\n interval,\n );\n\n return () => clearInterval(timer);\n }, [duration]);\n\n useEffect(() => {\n const isLast = activeIndex === count - 1;\n\n if (inProgress || isNullable(activeIndex) || (isLast && !cycle)) {\n return;\n }\n\n const nextActiveIndex = isLast && cycle ? 0 : activeIndex + 1;\n\n onActiveElementChange?.(nextActiveIndex);\n\n if (activeIndexInProps) {\n return;\n }\n\n setActiveIndex(nextActiveIndex);\n setProgress(0);\n }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/dynamic/Component.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n hasOwnProperty,\n isFn,\n isNonNullable,\n isNullable,\n noop,\n} from '@alfalab/core-components-shared';\n\nimport { type PageIndicatorDynamicProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst FULL_PROGRESS = 100;\n\nexport const PageIndicatorDynamic: React.FC<PageIndicatorDynamicProps> = (props) => {\n const {\n size: height = 8,\n gap = 8,\n activeElementWidth = height * 7,\n elements: count = 10,\n activeElement: indexFromProps,\n onActiveElementChange,\n defaultActiveElement: defaultIndex = 0,\n active = true,\n duration: durationFromProps = 3000,\n cycle = false,\n colors = 'default',\n className,\n } = props;\n const [activeIndex, setActiveIndex] = useState<number | undefined>(\n indexFromProps ?? defaultIndex,\n );\n const [progress, setProgress] = useState(0);\n const inProgress = progress < FULL_PROGRESS;\n const activeIndexInProps = hasOwnProperty(props, 'activeElement');\n let duration: number;\n\n if (active && isNonNullable(activeIndex) && inProgress) {\n duration = isFn(durationFromProps) ? durationFromProps(activeIndex) : durationFromProps;\n } else {\n duration = -1;\n }\n\n // getDerivedStateFromProps\n if (activeIndexInProps && !(activeIndex === indexFromProps)) {\n setActiveIndex(indexFromProps);\n setProgress(0);\n }\n\n useEffect(() => {\n if (duration === -1) {\n return noop;\n }\n\n const interval = duration / FULL_PROGRESS;\n const timer = setInterval(\n () => setProgress((prevProgress) => Math.min(prevProgress + 1, FULL_PROGRESS)),\n interval,\n );\n\n return () => clearInterval(timer);\n }, [duration]);\n\n useEffect(() => {\n const isLast = activeIndex === count - 1;\n\n if (inProgress || isNullable(activeIndex) || (isLast && !cycle)) {\n return;\n }\n\n const nextActiveIndex = isLast && cycle ? 0 : activeIndex + 1;\n\n onActiveElementChange?.(nextActiveIndex);\n\n if (activeIndexInProps) {\n return;\n }\n\n setActiveIndex(nextActiveIndex);\n setProgress(0);\n }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);\n\n return (\n <div className={cn(styles.pageIndicator, className)} style={{ height, gap }}>\n {Array.from({ length: count }, (_, index) => {\n const isActive = index === activeIndex;\n const style: React.CSSProperties = {\n width: isActive ? activeElementWidth : height,\n borderRadius: height / 2,\n };\n const progressStyle: React.CSSProperties | undefined = isActive\n ? { transform: `translateX(${progress - FULL_PROGRESS}%)` }\n : undefined;\n\n return (\n <div\n key={index}\n style={style}\n className={cn(styles.element, colorsStyle[colors].element, {\n [styles.active]: isActive,\n [colorsStyle[colors].active]: isActive,\n })}\n >\n <div\n style={progressStyle}\n className={cn(styles.progress, colorsStyle[colors].progress)}\n />\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAmBA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEV,MAAM,aAAa,GAAG,GAAG;AAEZ,MAAA,oBAAoB,GAAwC,CAAC,KAAK,KAAI;IAC/E,MAAM,EACF,IAAI,EAAE,MAAM,GAAG,CAAC,EAChB,GAAG,GAAG,CAAC,EACP,kBAAkB,GAAG,MAAM,GAAG,CAAC,EAC/B,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,aAAa,EAAE,cAAc,EAC7B,qBAAqB,EACrB,oBAAoB,EAAE,YAAY,GAAG,CAAC,EACtC,MAAM,GAAG,IAAI,EACb,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAClC,KAAK,GAAG,KAAK,EACb,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,GAAG,KAAK;AACT,IAAA,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAC1C,cAAc,IAAI,YAAY,CACjC;IACD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3C,IAAA,MAAM,UAAU,GAAG,QAAQ,GAAG,aAAa;IAC3C,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAA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-light-neutral-translucent-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_o4ub7 {
|
|
10
10
|
background: var(--page-indicator-color);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
13
|
-
.page-
|
|
12
|
+
.page-indicator__element_o4ub7.page-indicator__active_o4ub7 {
|
|
13
|
+
.page-indicator__progress_o4ub7 {
|
|
14
14
|
background: var(--page-indicator-active-color);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './default.css';
|
|
2
2
|
|
|
3
|
-
const defaultColors = {"element":"page-
|
|
3
|
+
const defaultColors = {"element":"page-indicator__element_o4ub7","active":"page-indicator__active_o4ub7","progress":"page-indicator__progress_o4ub7"};
|
|
4
4
|
|
|
5
5
|
export { defaultColors as default };
|
|
6
6
|
//# sourceMappingURL=default.module.css.js.map
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--page-indicator-animation-duration: 0.2s;
|
|
3
3
|
}
|
|
4
|
-
.page-
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
4
|
+
.page-indicator__pageIndicator_h7ekc {
|
|
7
5
|
display: flex;
|
|
8
6
|
}
|
|
9
|
-
.page-
|
|
7
|
+
.page-indicator__element_h7ekc {
|
|
10
8
|
list-style-type: none;
|
|
11
9
|
overflow: hidden;
|
|
12
10
|
transition: width var(--page-indicator-animation-duration) linear;
|
|
13
11
|
}
|
|
14
|
-
.page-
|
|
15
|
-
.page-
|
|
12
|
+
.page-indicator__element_h7ekc:not(.page-indicator__active_h7ekc) {
|
|
13
|
+
.page-indicator__progress_h7ekc {
|
|
16
14
|
display: none;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
|
-
.page-
|
|
17
|
+
.page-indicator__element_h7ekc {
|
|
20
18
|
|
|
21
|
-
.page-
|
|
19
|
+
.page-indicator__progress_h7ekc {
|
|
22
20
|
width: 100%;
|
|
23
21
|
height: 100%;
|
|
24
22
|
will-change: transform;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"pageIndicator":"page-
|
|
3
|
+
const styles = {"pageIndicator":"page-indicator__pageIndicator_h7ekc","element":"page-indicator__element_h7ekc","active":"page-indicator__active_h7ekc","progress":"page-indicator__progress_h7ekc"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/dynamic/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/dynamic/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n display: flex;\n}\n\n.element {\n list-style-type: none;\n overflow: hidden;\n transition: width var(--page-indicator-animation-duration) linear;\n\n &:not(.active) {\n .progress {\n display: none;\n }\n }\n\n .progress {\n width: 100%;\n height: 100%;\n will-change: transform;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC,UAAU,CAAC,gCAAgC,CAAC;;;;"}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
--page-indicator-color-inverted: var(--color-light-neutral-translucent-300-inverted);
|
|
7
7
|
--page-indicator-active-color-inverted: var(--color-light-neutral-translucent-1300-inverted);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_mqocy {
|
|
10
10
|
background: var(--page-indicator-color-inverted);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
13
|
-
.page-
|
|
12
|
+
.page-indicator__element_mqocy.page-indicator__active_mqocy {
|
|
13
|
+
.page-indicator__progress_mqocy {
|
|
14
14
|
background: var(--page-indicator-active-color-inverted);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './inverted.css';
|
|
2
2
|
|
|
3
|
-
const invertedColors = {"element":"page-
|
|
3
|
+
const invertedColors = {"element":"page-indicator__element_mqocy","active":"page-indicator__active_mqocy","progress":"page-indicator__progress_mqocy"};
|
|
4
4
|
|
|
5
5
|
export { invertedColors as default };
|
|
6
6
|
//# sourceMappingURL=inverted.module.css.js.map
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
--page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
|
|
7
7
|
--page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_6rxth {
|
|
10
10
|
background: var(--page-indicator-color-static-inverted);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
13
|
-
.page-
|
|
12
|
+
.page-indicator__element_6rxth.page-indicator__active_6rxth {
|
|
13
|
+
.page-indicator__progress_6rxth {
|
|
14
14
|
background: var(--page-indicator-active-color-static-inverted);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static-inverted.css';
|
|
2
2
|
|
|
3
|
-
const staticInvertedColors = {"element":"page-
|
|
3
|
+
const staticInvertedColors = {"element":"page-indicator__element_6rxth","active":"page-indicator__active_6rxth","progress":"page-indicator__progress_6rxth"};
|
|
4
4
|
|
|
5
5
|
export { staticInvertedColors as default };
|
|
6
6
|
//# sourceMappingURL=static-inverted.module.css.js.map
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
--page-indicator-color-static: var(--color-static-neutral-translucent-300);
|
|
7
7
|
--page-indicator-active-color-static: var(--color-static-neutral-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__element_1u5rb {
|
|
10
10
|
background: var(--page-indicator-color-static);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
13
|
-
.page-
|
|
12
|
+
.page-indicator__element_1u5rb.page-indicator__active_1u5rb {
|
|
13
|
+
.page-indicator__progress_1u5rb {
|
|
14
14
|
background: var(--page-indicator-active-color-static);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './static.css';
|
|
2
2
|
|
|
3
|
-
const staticColors = {"element":"page-
|
|
3
|
+
const staticColors = {"element":"page-indicator__element_1u5rb","active":"page-indicator__active_1u5rb","progress":"page-indicator__progress_1u5rb"};
|
|
4
4
|
|
|
5
5
|
export { staticColors as default };
|
|
6
6
|
//# sourceMappingURL=static.module.css.js.map
|
|
@@ -12,7 +12,7 @@ const colorsStyle = {
|
|
|
12
12
|
static: staticColors,
|
|
13
13
|
'static-inverted': staticInvertedColors,
|
|
14
14
|
};
|
|
15
|
-
const PageIndicatorRunner = ({ activeElement, elements: count = 10, size = 4, colors = 'default', }) => (React.createElement("div", { className: cn(styles.pageIndicator, colorsStyle[colors].pageIndicator), style: { height: size, borderRadius: size / 2 } },
|
|
15
|
+
const PageIndicatorRunner = ({ activeElement, elements: count = 10, size = 4, colors = 'default', className, }) => (React.createElement("div", { className: cn(styles.pageIndicator, colorsStyle[colors].pageIndicator, className), style: { height: size, borderRadius: size / 2 } },
|
|
16
16
|
React.createElement("div", { style: {
|
|
17
17
|
transform: `translate(${activeElement * 100}%, 0)`,
|
|
18
18
|
height: size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/runner/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorRunnerProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nexport const PageIndicatorRunner: React.FC<PageIndicatorRunnerProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n colors = 'default',\n}) => (\n <div\n className={cn(styles.pageIndicator, colorsStyle[colors].pageIndicator)}\n style={{ height: size, borderRadius: size / 2 }}\n >\n <div\n style={{\n transform: `translate(${activeElement * 100}%, 0)`,\n height: size,\n width: `${100 / count}%`,\n borderRadius: size / 2,\n }}\n className={cn(styles.element, colorsStyle[colors].element)}\n />\n </div>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEG,MAAA,mBAAmB,GAAuC,CAAC,EACpE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/runner/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorRunnerProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nexport const PageIndicatorRunner: React.FC<PageIndicatorRunnerProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n colors = 'default',\n className,\n}) => (\n <div\n className={cn(styles.pageIndicator, colorsStyle[colors].pageIndicator, className)}\n style={{ height: size, borderRadius: size / 2 }}\n >\n <div\n style={{\n transform: `translate(${activeElement * 100}%, 0)`,\n height: size,\n width: `${100 / count}%`,\n borderRadius: size / 2,\n }}\n className={cn(styles.element, colorsStyle[colors].element)}\n />\n </div>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEG,MAAA,mBAAmB,GAAuC,CAAC,EACpE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,MACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,EACjF,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAAA;AAE/C,IAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,YAAA,SAAS,EAAE,CAAA,UAAA,EAAa,aAAa,GAAG,GAAG,CAAO,KAAA,CAAA;AAClD,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,KAAK,EAAE,CAAA,EAAG,GAAG,GAAG,KAAK,CAAG,CAAA,CAAA;YACxB,YAAY,EAAE,IAAI,GAAG,CAAC;AACzB,SAAA,EACD,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC5D,CAAA,CACA;;;;"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
--page-indicator-color: var(--color-light-neutral-translucent-300);
|
|
7
7
|
--page-indicator-active-color: var(--color-light-neutral-translucent-1300);
|
|
8
8
|
}
|
|
9
|
-
.page-
|
|
9
|
+
.page-indicator__pageIndicator_wiz49 {
|
|
10
10
|
background: var(--page-indicator-color);
|
|
11
11
|
}
|
|
12
|
-
.page-
|
|
12
|
+
.page-indicator__element_wiz49 {
|
|
13
13
|
background: var(--page-indicator-active-color);
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './default.css';
|
|
2
2
|
|
|
3
|
-
const defaultColors = {"pageIndicator":"page-
|
|
3
|
+
const defaultColors = {"pageIndicator":"page-indicator__pageIndicator_wiz49","element":"page-indicator__element_wiz49"};
|
|
4
4
|
|
|
5
5
|
export { defaultColors as default };
|
|
6
6
|
//# sourceMappingURL=default.module.css.js.map
|