@hh.ru/magritte-ui-progress-bar 3.1.3

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.
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { ProgressBarProps } from './types';
3
+ export declare const ProgressBarComponent: FC<ProgressBarProps>;
4
+ export declare const ProgressBar: import("@hh.ru/magritte-ui-skeleton").ComponentWithSkeleton<ProgressBarProps>;
package/ProgressBar.js ADDED
@@ -0,0 +1,18 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { SegmentedProgressBar } from './SegmentedProgressBar.js';
4
+ import { SingleProgressBar } from './SingleProgressBar.js';
5
+ import { ProgressBarSkeleton } from './Skeleton.js';
6
+ import { enrichWithSkeleton } from '@hh.ru/magritte-ui-skeleton';
7
+ import 'react';
8
+ import 'classnames';
9
+ import './progress-bar-a4e354ad.js';
10
+
11
+ const ProgressBarComponent = (props) => {
12
+ const isSegmented = props.segments !== undefined;
13
+ return isSegmented ? jsx(SegmentedProgressBar, { ...props }) : jsx(SingleProgressBar, { ...props });
14
+ };
15
+ const ProgressBar = enrichWithSkeleton(ProgressBarComponent, ProgressBarSkeleton);
16
+
17
+ export { ProgressBar, ProgressBarComponent };
18
+ //# sourceMappingURL=ProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBar.js","sources":["../src/ProgressBar.tsx"],"sourcesContent":["import { FC } from 'react';\n\nimport { SegmentedProgressBar } from '@hh.ru/magritte-ui-progress-bar/SegmentedProgressBar';\nimport { SingleProgressBar } from '@hh.ru/magritte-ui-progress-bar/SingleProgressBar';\nimport { ProgressBarSkeleton } from '@hh.ru/magritte-ui-progress-bar/Skeleton';\nimport { ProgressBarProps } from '@hh.ru/magritte-ui-progress-bar/types';\nimport { enrichWithSkeleton } from '@hh.ru/magritte-ui-skeleton';\n\nexport const ProgressBarComponent: FC<ProgressBarProps> = (props) => {\n const isSegmented = props.segments !== undefined;\n return isSegmented ? <SegmentedProgressBar {...props} /> : <SingleProgressBar {...props} />;\n};\n\nexport const ProgressBar = enrichWithSkeleton(ProgressBarComponent, ProgressBarSkeleton);\n"],"names":["_jsx"],"mappings":";;;;;;;;;AAQa,MAAA,oBAAoB,GAAyB,CAAC,KAAK,KAAI;AAChE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;AACjD,IAAA,OAAO,WAAW,GAAGA,GAAA,CAAC,oBAAoB,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA,GAAGA,GAAA,CAAC,iBAAiB,EAAK,EAAA,GAAA,KAAK,GAAI,CAAC;AAChG,EAAE;AAEW,MAAA,WAAW,GAAG,kBAAkB,CAAC,oBAAoB,EAAE,mBAAmB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ProgressBarSegmentedProps } from './types';
3
+ export declare const SegmentedProgressBar: FC<ProgressBarSegmentedProps>;
@@ -0,0 +1,46 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useRef, useState, useEffect, useLayoutEffect } from 'react';
4
+ import classnames from 'classnames';
5
+ import { s as styles } from './progress-bar-a4e354ad.js';
6
+
7
+ const STYLE_TO_CSS = {
8
+ accent: styles.segmentedContainerStyleAccent,
9
+ positive: styles.segmentedContainerStylePositive,
10
+ special: styles.segmentedContainerStyleSpecial,
11
+ };
12
+ const SegmentedProgressBar = ({ segments, progress, style = 'accent', 'data-qa': dataQA = 'progress', ariaLabel, }) => {
13
+ const prevProgress = useRef(progress);
14
+ const [animationTimeout, setAnimationTimeout] = useState(0);
15
+ useEffect(() => {
16
+ prevProgress.current = progress;
17
+ }, [progress]);
18
+ useLayoutEffect(() => {
19
+ const animationTimeoutElement = document.createElement('div');
20
+ animationTimeoutElement.classList.add(styles.progressAnimationTimeout);
21
+ document.body.appendChild(animationTimeoutElement);
22
+ const style = window.getComputedStyle(animationTimeoutElement);
23
+ const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);
24
+ if (Number.isInteger(animationTimeout)) {
25
+ setAnimationTimeout(animationTimeout);
26
+ }
27
+ document.body.removeChild(animationTimeoutElement);
28
+ }, []);
29
+ return (jsx("div", { className: classnames(styles.segmentedContainer, STYLE_TO_CSS[style]), "data-qa": dataQA, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": segments, "aria-valuenow": progress, "aria-label": ariaLabel, children: [...Array(segments).keys()].map((_, i) => {
30
+ let delay = 0;
31
+ const direction = progress - prevProgress.current >= 0 ? 0 : -1;
32
+ const startSelection = prevProgress.current + direction;
33
+ if (i === startSelection) {
34
+ delay = 0;
35
+ }
36
+ else {
37
+ delay = Math.abs(i - startSelection) * animationTimeout;
38
+ }
39
+ return (jsx("div", { className: classnames(styles.segment, {
40
+ [styles.filled]: i < progress,
41
+ }), style: { transitionDelay: `${delay}ms` }, "data-qa": "progress-segment" }, i));
42
+ }) }));
43
+ };
44
+
45
+ export { SegmentedProgressBar };
46
+ //# sourceMappingURL=SegmentedProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentedProgressBar.js","sources":["../src/SegmentedProgressBar.tsx"],"sourcesContent":["import { FC, useRef, useEffect, useLayoutEffect, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { ProgressBarSegmentedProps } from '@hh.ru/magritte-ui-progress-bar/types';\n\nimport styles from './progress-bar.less';\n\nconst STYLE_TO_CSS = {\n accent: styles.segmentedContainerStyleAccent,\n positive: styles.segmentedContainerStylePositive,\n special: styles.segmentedContainerStyleSpecial,\n};\nexport const SegmentedProgressBar: FC<ProgressBarSegmentedProps> = ({\n segments,\n progress,\n style = 'accent',\n 'data-qa': dataQA = 'progress',\n ariaLabel,\n}) => {\n const prevProgress = useRef(progress);\n const [animationTimeout, setAnimationTimeout] = useState(0);\n useEffect(() => {\n prevProgress.current = progress;\n }, [progress]);\n\n useLayoutEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.progressAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n return (\n <div\n className={classnames(styles.segmentedContainer, STYLE_TO_CSS[style])}\n data-qa={dataQA}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={segments}\n aria-valuenow={progress}\n aria-label={ariaLabel}\n >\n {[...Array(segments).keys()].map((_, i) => {\n let delay = 0;\n const direction = progress - prevProgress.current >= 0 ? 0 : -1;\n const startSelection = prevProgress.current + direction;\n if (i === startSelection) {\n delay = 0;\n } else {\n delay = Math.abs(i - startSelection) * animationTimeout;\n }\n return (\n <div\n key={i}\n className={classnames(styles.segment, {\n [styles.filled]: i < progress,\n })}\n style={{ transitionDelay: `${delay}ms` }}\n data-qa=\"progress-segment\"\n />\n );\n })}\n </div>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAOA,MAAM,YAAY,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC,+BAA+B;IAChD,OAAO,EAAE,MAAM,CAAC,8BAA8B;CACjD,CAAC;MACW,oBAAoB,GAAkC,CAAC,EAChE,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,QAAQ,EAChB,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,SAAS,GACZ,KAAI;AACD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5D,SAAS,CAAC,MAAK;AACX,QAAA,YAAY,CAAC,OAAO,GAAG,QAAQ,CAAC;AACpC,KAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,eAAe,CAAC,MAAK;QACjB,MAAM,uBAAuB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9D,uBAAuB,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;AACvE,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;AAC/D,QAAA,MAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAsB,oBAAA,CAAA,CAAC,EAAE,EAAE,CAAC,CAAC;AACtF,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE;YACpC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AACzC,SAAA;AACD,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;KACtD,EAAE,EAAE,CAAC,CAAC;IAEP,QACIA,aACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAC5D,SAAA,EAAA,MAAM,EACf,IAAI,EAAC,aAAa,EAAA,eAAA,EACH,CAAC,EAAA,eAAA,EACD,QAAQ,EACR,eAAA,EAAA,QAAQ,gBACX,SAAS,EAAA,QAAA,EAEpB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAI;YACtC,IAAI,KAAK,GAAG,CAAC,CAAC;AACd,YAAA,MAAM,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,YAAA,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;YACxD,IAAI,CAAC,KAAK,cAAc,EAAE;gBACtB,KAAK,GAAG,CAAC,CAAC;AACb,aAAA;AAAM,iBAAA;gBACH,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,GAAG,gBAAgB,CAAC;AAC3D,aAAA;YACD,QACIA,aAEI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,oBAAA,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ;AAChC,iBAAA,CAAC,EACF,KAAK,EAAE,EAAE,eAAe,EAAE,CAAG,EAAA,KAAK,CAAI,EAAA,CAAA,EAAE,aAChC,kBAAkB,EAAA,EALrB,CAAC,CAMR,EACJ;SACL,CAAC,EACA,CAAA,EACR;AACN;;;;"}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ProgressBarSingleProps } from './types';
3
+ export declare const SingleProgressBar: FC<ProgressBarSingleProps>;
@@ -0,0 +1,17 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import classnames from 'classnames';
4
+ import { s as styles } from './progress-bar-a4e354ad.js';
5
+
6
+ const STYLE_TO_CSS = {
7
+ accent: styles.progressStyleAccent,
8
+ positive: styles.progressStylePositive,
9
+ special: styles.progressStyleSpecial,
10
+ };
11
+ const SingleProgressBar = ({ max = 100, progress, style = 'accent', 'data-qa': dataQA = 'progress', ariaLabel, }) => {
12
+ const width = (progress / max) * 100;
13
+ return (jsx("div", { className: classnames(styles.progress, STYLE_TO_CSS[style]), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": progress, "aria-label": ariaLabel, "data-qa": dataQA, children: jsx("div", { className: styles.progressValue, "data-qa": "progress-value", style: { width: `${width}%` } }) }));
14
+ };
15
+
16
+ export { SingleProgressBar };
17
+ //# sourceMappingURL=SingleProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleProgressBar.js","sources":["../src/SingleProgressBar.tsx"],"sourcesContent":["import { FC } from 'react';\nimport classnames from 'classnames';\n\nimport { ProgressBarSingleProps } from '@hh.ru/magritte-ui-progress-bar/types';\n\nimport styles from './progress-bar.less';\n\nconst STYLE_TO_CSS = {\n accent: styles.progressStyleAccent,\n positive: styles.progressStylePositive,\n special: styles.progressStyleSpecial,\n};\n\nexport const SingleProgressBar: FC<ProgressBarSingleProps> = ({\n max = 100,\n progress,\n style = 'accent',\n 'data-qa': dataQA = 'progress',\n ariaLabel,\n}) => {\n const width = (progress / max) * 100;\n return (\n <div\n className={classnames(styles.progress, STYLE_TO_CSS[style])}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={progress}\n aria-label={ariaLabel}\n data-qa={dataQA}\n >\n <div className={styles.progressValue} data-qa=\"progress-value\" style={{ width: `${width}%` }} />\n </div>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;AAOA,MAAM,YAAY,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC,qBAAqB;IACtC,OAAO,EAAE,MAAM,CAAC,oBAAoB;CACvC,CAAC;AAEW,MAAA,iBAAiB,GAA+B,CAAC,EAC1D,GAAG,GAAG,GAAG,EACT,QAAQ,EACR,KAAK,GAAG,QAAQ,EAChB,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,SAAS,GACZ,KAAI;IACD,MAAM,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,GAAG,CAAC;IACrC,QACIA,aACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAC3D,IAAI,EAAC,aAAa,EACH,eAAA,EAAA,CAAC,EACD,eAAA,EAAA,GAAG,EACH,eAAA,EAAA,QAAQ,gBACX,SAAS,EAAA,SAAA,EACZ,MAAM,EAAA,QAAA,EAEfA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,aAAa,EAAA,SAAA,EAAU,gBAAgB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAG,EAAA,KAAK,GAAG,EAAE,EAAA,CAAI,EAC9F,CAAA,EACR;AACN;;;;"}
package/Skeleton.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { ProgressBarProps } from './types';
2
+ import { IncompleteSkeletonComponent } from '@hh.ru/magritte-ui-skeleton';
3
+ export declare const ProgressBarSkeleton: IncompleteSkeletonComponent<ProgressBarProps>;
package/Skeleton.js ADDED
@@ -0,0 +1,11 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Skeleton } from '@hh.ru/magritte-ui-skeleton';
4
+ import { s as styles } from './progress-bar-a4e354ad.js';
5
+
6
+ const ProgressBarSkeleton = ({ Component: ProgressBar,
7
+ // skeleton props
8
+ width, height, borderRadius, inline, additionalClass, loading, ...progressBarProps }) => (jsx(Skeleton, { loading: loading, additionalClass: styles.progressSkeleton, children: jsx(ProgressBar, { ...progressBarProps }) }));
9
+
10
+ export { ProgressBarSkeleton };
11
+ //# sourceMappingURL=Skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton.js","sources":["../src/Skeleton.tsx"],"sourcesContent":["import { ProgressBarProps } from '@hh.ru/magritte-ui-progress-bar/types';\nimport { IncompleteSkeletonComponent, Skeleton } from '@hh.ru/magritte-ui-skeleton';\n\nimport styles from './progress-bar.less';\n\nexport const ProgressBarSkeleton: IncompleteSkeletonComponent<ProgressBarProps> = ({\n Component: ProgressBar,\n\n // skeleton props\n width,\n height,\n borderRadius,\n inline,\n additionalClass,\n loading,\n\n ...progressBarProps\n}) => (\n <Skeleton loading={loading} additionalClass={styles.progressSkeleton}>\n <ProgressBar {...progressBarProps} />\n </Skeleton>\n);\n"],"names":["_jsx"],"mappings":";;;;MAKa,mBAAmB,GAAkD,CAAC,EAC/E,SAAS,EAAE,WAAW;AAEtB;AACA,KAAK,EACL,MAAM,EACN,YAAY,EACZ,MAAM,EACN,eAAe,EACf,OAAO,EAEP,GAAG,gBAAgB,EACtB,MACGA,GAAA,CAAC,QAAQ,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,gBAAgB,EAAA,QAAA,EAChEA,IAAC,WAAW,EAAA,EAAA,GAAK,gBAAgB,EAAI,CAAA,EAAA,CAC9B;;;;"}
package/index.css ADDED
@@ -0,0 +1,92 @@
1
+ :root{
2
+ --magritte-color-component-progress-bar-background-content-v18-1-1:#DCE3EB;
3
+ --magritte-color-component-progress-bar-foreground-accent-v18-1-1:#0070ff;
4
+ --magritte-color-component-progress-bar-foreground-positive-v18-1-1:#0dc267;
5
+ --magritte-color-component-progress-bar-foreground-special-v18-1-1:#883be9;
6
+ }
7
+ :root{
8
+ --magritte-semantic-animation-ease-in-out-100-timing-function-v18-1-1:cubic-bezier(0.25, 0.1, 0.25, 1);
9
+ --magritte-semantic-animation-ease-in-out-100-duration-v18-1-1:100ms;
10
+ }
11
+ .magritte-night-theme{
12
+ --magritte-color-component-progress-bar-background-content-v18-1-1:#262626;
13
+ --magritte-color-component-progress-bar-foreground-accent-v18-1-1:#0058cc;
14
+ --magritte-color-component-progress-bar-foreground-positive-v18-1-1:#026d36;
15
+ --magritte-color-component-progress-bar-foreground-special-v18-1-1:#6a2eb7;
16
+ }
17
+ .magritte-progress___pKPf-_3-1-3,
18
+ .magritte-segment___uKhLD_3-1-3,
19
+ .magritte-progress-animation-timeout___BeyxU_3-1-3{
20
+ --animation-duration:0;
21
+ }
22
+ @media (prefers-reduced-motion: no-preference){
23
+ .magritte-progress___pKPf-_3-1-3,
24
+ .magritte-segment___uKhLD_3-1-3,
25
+ .magritte-progress-animation-timeout___BeyxU_3-1-3{
26
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v18-1-1);
27
+ }
28
+ }
29
+ .magritte-progress___pKPf-_3-1-3{
30
+ position:relative;
31
+ width:100%;
32
+ border-radius:50vh;
33
+ height:var(--magritte-ui-progress-height-override, 8px);
34
+ --magritte-ui-progress-background-color:var(--magritte-ui-progress-background-color-override, var(--magritte-color-component-progress-bar-background-content-v18-1-1));
35
+ background-color:var(--magritte-ui-progress-background-color);
36
+ user-select:none;
37
+ overflow:hidden;
38
+ }
39
+ .magritte-progress-skeleton___cGz4D_3-1-3{
40
+ height:var(--magritte-ui-progress-height-override, 8px);
41
+ border-radius:50vh;
42
+ }
43
+ .magritte-progress-value___ffPrp_3-1-3{
44
+ position:absolute;
45
+ height:var(--magritte-ui-progress-height-override, 8px);
46
+ left:0;
47
+ bottom:0;
48
+ border-radius:50vh;
49
+ background:var(--magritte-ui-progress-value-color);
50
+ transition-property:width;
51
+ transition-duration:var(--animation-duration);
52
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v18-1-1);
53
+ }
54
+ .magritte-segmented-container___O5xuJ_3-1-3{
55
+ display:flex;
56
+ gap:var(--magritte-ui-progress-segments-margin-override, 4px);
57
+ user-select:none;
58
+ }
59
+ .magritte-segment___uKhLD_3-1-3{
60
+ flex:1 1 auto;
61
+ height:var(--magritte-ui-progress-height-override, 8px);
62
+ border-radius:50vh;
63
+ transition-property:background-position;
64
+ transition-duration:var(--animation-duration);
65
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v18-1-1);
66
+ --magritte-ui-progress-background-color:var(--magritte-ui-progress-background-color-override, var(--magritte-color-component-progress-bar-background-content-v18-1-1));
67
+ background:linear-gradient(to right, var(--magritte-ui-progress-value-color) 50%, var(--magritte-ui-progress-background-color) 50%);
68
+ background-size:calc(200% + 1px) 100%;
69
+ background-position:right bottom;
70
+ background-repeat:no-repeat;
71
+ }
72
+ .magritte-filled___QH18N_3-1-3{
73
+ background-position:left bottom;
74
+ }
75
+ .magritte-segmented-container_style-accent___MRcsm_3-1-3 .magritte-segment___uKhLD_3-1-3{
76
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-accent-v18-1-1));
77
+ }
78
+ .magritte-progress_style-accent___0qJEN_3-1-3{
79
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-accent-v18-1-1));
80
+ }
81
+ .magritte-segmented-container_style-positive___ItaIH_3-1-3 .magritte-segment___uKhLD_3-1-3{
82
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-positive-v18-1-1));
83
+ }
84
+ .magritte-progress_style-positive___EAtvB_3-1-3{
85
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-positive-v18-1-1));
86
+ }
87
+ .magritte-segmented-container_style-special___m0PxE_3-1-3 .magritte-segment___uKhLD_3-1-3{
88
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-special-v18-1-1));
89
+ }
90
+ .magritte-progress_style-special___v8LNJ_3-1-3{
91
+ --magritte-ui-progress-value-color:var(--magritte-ui-progress-value-color-override, var(--magritte-color-component-progress-bar-foreground-special-v18-1-1));
92
+ }
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from '@hh.ru/magritte-ui-theme-provider';
2
+ export { ProgressBar } from './ProgressBar';
3
+ export { type ProgressBarProps, type ProgressBarSingleProps, type ProgressBarSegmentedProps, type ProgressBarStyle, } from './types';
package/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import './index.css';
2
+ export * from '@hh.ru/magritte-ui-theme-provider';
3
+ export { ProgressBar } from './ProgressBar.js';
4
+ import 'react/jsx-runtime';
5
+ import './SegmentedProgressBar.js';
6
+ import 'react';
7
+ import 'classnames';
8
+ import './progress-bar-a4e354ad.js';
9
+ import './SingleProgressBar.js';
10
+ import './Skeleton.js';
11
+ import '@hh.ru/magritte-ui-skeleton';
12
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ import { ForwardRefExoticComponent } from 'react';
2
+ export { type ProgressBarProps, type ProgressBarStyle } from './types';
3
+ declare const ThemeProvider: any;
4
+ export { ThemeProvider };
5
+ export declare const ProgressBar: ForwardRefExoticComponent<Record<string, unknown>>;
package/index.mock.js ADDED
@@ -0,0 +1,9 @@
1
+ import './index.css';
2
+ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5
+ const { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');
6
+ const ProgressBar = mockComponent('ProgressBar');
7
+
8
+ export { ProgressBar, ThemeProvider };
9
+ //# sourceMappingURL=index.mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type ProgressBarProps, type ProgressBarStyle } from '@hh.ru/magritte-ui-progress-bar/types';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');\n\nexport { ThemeProvider };\n\nexport const ProgressBar: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('ProgressBar');\n"],"names":[],"mappings":";;AAMA;AACM,MAAA,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,yCAAyC,EAAE;MAI3E,WAAW,GAAuD,aAAa,CAAC,aAAa;;;;"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@hh.ru/magritte-ui-progress-bar",
3
+ "version": "3.1.3",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "index.css"
8
+ ],
9
+ "scripts": {
10
+ "build": "yarn root:build $(pwd)",
11
+ "build-test-branch": "yarn root:build-test-branch $(pwd)",
12
+ "changelog": "yarn root:changelog $(pwd)",
13
+ "prepack": "yarn root:prepack $(pwd)",
14
+ "postpublish": "yarn root:postpublish $(pwd)",
15
+ "stylelint-test": "yarn root:stylelint-test $(pwd)",
16
+ "eslint-test": "yarn root:eslint-test $(pwd)",
17
+ "ts-config": "yarn root:ts-config $(pwd)",
18
+ "ts-check": "yarn root:ts-check $(pwd)",
19
+ "test": "yarn root:test $(pwd)"
20
+ },
21
+ "dependencies": {
22
+ "@hh.ru/magritte-design-tokens": "18.1.1",
23
+ "@hh.ru/magritte-ui-mock-component": "1.0.10",
24
+ "@hh.ru/magritte-ui-skeleton": "2.1.2",
25
+ "@hh.ru/magritte-ui-theme-provider": "1.1.21"
26
+ },
27
+ "peerDependencies": {
28
+ "classnames": ">=2.3.2",
29
+ "react": ">=18.2.0"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "gitHead": "b660dd64fca3eaad5ec44ea9a73f92bb0d9694aa"
35
+ }
@@ -0,0 +1,5 @@
1
+ import './index.css';
2
+ var styles = {"progress":"magritte-progress___pKPf-_3-1-3","segment":"magritte-segment___uKhLD_3-1-3","progress-animation-timeout":"magritte-progress-animation-timeout___BeyxU_3-1-3","progressAnimationTimeout":"magritte-progress-animation-timeout___BeyxU_3-1-3","progress-skeleton":"magritte-progress-skeleton___cGz4D_3-1-3","progressSkeleton":"magritte-progress-skeleton___cGz4D_3-1-3","progress-value":"magritte-progress-value___ffPrp_3-1-3","progressValue":"magritte-progress-value___ffPrp_3-1-3","segmented-container":"magritte-segmented-container___O5xuJ_3-1-3","segmentedContainer":"magritte-segmented-container___O5xuJ_3-1-3","filled":"magritte-filled___QH18N_3-1-3","segmented-container_style-accent":"magritte-segmented-container_style-accent___MRcsm_3-1-3","segmentedContainerStyleAccent":"magritte-segmented-container_style-accent___MRcsm_3-1-3","progress_style-accent":"magritte-progress_style-accent___0qJEN_3-1-3","progressStyleAccent":"magritte-progress_style-accent___0qJEN_3-1-3","segmented-container_style-positive":"magritte-segmented-container_style-positive___ItaIH_3-1-3","segmentedContainerStylePositive":"magritte-segmented-container_style-positive___ItaIH_3-1-3","progress_style-positive":"magritte-progress_style-positive___EAtvB_3-1-3","progressStylePositive":"magritte-progress_style-positive___EAtvB_3-1-3","segmented-container_style-special":"magritte-segmented-container_style-special___m0PxE_3-1-3","segmentedContainerStyleSpecial":"magritte-segmented-container_style-special___m0PxE_3-1-3","progress_style-special":"magritte-progress_style-special___v8LNJ_3-1-3","progressStyleSpecial":"magritte-progress_style-special___v8LNJ_3-1-3"};
3
+
4
+ export { styles as s };
5
+ //# sourceMappingURL=progress-bar-a4e354ad.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bar-a4e354ad.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/types.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ export type ProgressBarStyle = 'accent' | 'positive' | 'special';
2
+ type ProgressBarCommonProps = {
3
+ /** Текущее значение прогресса */
4
+ progress: number;
5
+ /** Cтиль прогресс-бара */
6
+ style?: ProgressBarStyle;
7
+ ariaLabel?: string;
8
+ 'data-qa'?: string;
9
+ };
10
+ export type ProgressBarSingleProps = ProgressBarCommonProps & {
11
+ /** Максимальное значение прогресс-бара */
12
+ max?: number;
13
+ segments?: never;
14
+ };
15
+ export type ProgressBarSegmentedProps = ProgressBarCommonProps & {
16
+ max?: never;
17
+ /** Общее кол-во сегментов */
18
+ segments: number;
19
+ };
20
+ export type ProgressBarProps = ProgressBarSingleProps | ProgressBarSegmentedProps;
21
+ export {};
package/types.js ADDED
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+
3
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}