@chayns-components/core 5.0.28 → 5.0.29

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.
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _reactCompilerRuntime = require("react-compiler-runtime");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
9
  var _uuid = require("../../hooks/uuid");
9
10
  var _ProgressBar = require("./ProgressBar.styles");
@@ -12,140 +13,251 @@ var _styledComponents = require("styled-components");
12
13
  var _Popup = _interopRequireDefault(require("../popup/Popup"));
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
- const ProgressBar = ({
16
- percentage,
17
- label,
18
- shouldHideProgress = false,
19
- shouldShowLabelInline = false,
20
- steps,
21
- colors,
22
- thumbLabel,
23
- showShine = false,
24
- height
25
- }) => {
26
- 'use memo';
16
+ const ProgressBar = t0 => {
17
+ "use memo";
27
18
 
19
+ const $ = (0, _reactCompilerRuntime.c)(39);
20
+ const {
21
+ percentage,
22
+ label,
23
+ shouldHideProgress: t1,
24
+ shouldShowLabelInline: t2,
25
+ steps,
26
+ colors,
27
+ thumbLabel,
28
+ showShine: t3,
29
+ height
30
+ } = t0;
31
+ const shouldHideProgress = t1 === undefined ? false : t1;
32
+ const shouldShowLabelInline = t2 === undefined ? false : t2;
33
+ const showShine = t3 === undefined ? false : t3;
28
34
  const uuid = (0, _uuid.useUuid)();
29
35
  const [coordinates, setCoordinates] = (0, _react.useState)();
30
36
  const popupRef = (0, _react.useRef)(null);
31
- const hostContainerRef = (0, _react.useRef)(null);
37
+ const [hostContainer, setHostContainer] = (0, _react.useState)(null);
32
38
  const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
33
- const shineEffect = (0, _react.useMemo)(() => {
34
- if (!showShine || percentage === undefined) return null;
35
- const MIN_ANIMATION_LENGTH = 1;
36
- const MAX_ANIMATION_LENGTH = 5;
37
- const MAX_SHINE_COUNT = 6;
39
+ let t4;
40
+ bb0: {
41
+ if (!showShine || percentage === undefined) {
42
+ t4 = null;
43
+ break bb0;
44
+ }
38
45
  const t = percentage / 100;
39
- const shineCount = Math.ceil(MAX_SHINE_COUNT * t);
40
- const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;
41
- return Array.from({
42
- length: shineCount
43
- }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarShine
44
- /* eslint-disable-next-line react/no-array-index-key */, {
45
- key: `progress-bar-shine__${shineCount}__${index}`,
46
- $speed: speed,
47
- $delay: -(speed / shineCount) * index
48
- }));
49
- }, [percentage, showShine]);
50
- (0, _react.useEffect)(() => {
51
- var _hostContainerRef$cur;
52
- if (thumbLabel) setCoordinates((_hostContainerRef$cur = hostContainerRef.current) === null || _hostContainerRef$cur === void 0 ? void 0 : _hostContainerRef$cur.getBoundingClientRect());
53
- }, [thumbLabel]);
54
- (0, _react.useEffect)(() => {
55
- var _popupRef$current;
56
- if (coordinates) (_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || _popupRef$current.show();
57
- }, [coordinates]);
58
- const progressBar = (0, _react.useMemo)(() => {
59
- if (shouldHideProgress) {
60
- return null;
46
+ const shineCount = Math.ceil(6 * t);
47
+ const speed = 1 + 4 * t;
48
+ let t5;
49
+ if ($[0] !== shineCount) {
50
+ t5 = Array.from({
51
+ length: shineCount
52
+ });
53
+ $[0] = shineCount;
54
+ $[1] = t5;
55
+ } else {
56
+ t5 = $[1];
57
+ }
58
+ let t6;
59
+ if ($[2] !== shineCount || $[3] !== speed || $[4] !== t5) {
60
+ t6 = t5.map((_, index) => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarShine, {
61
+ key: `progress-bar-shine__${shineCount}__${index}`,
62
+ $speed: speed,
63
+ $delay: -(speed / shineCount) * index
64
+ }));
65
+ $[2] = shineCount;
66
+ $[3] = speed;
67
+ $[4] = t5;
68
+ $[5] = t6;
69
+ } else {
70
+ t6 = $[5];
61
71
  }
62
- if (percentage === undefined) {
63
- return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
64
- key: `progress-bar-loop__${uuid}`,
72
+ t4 = t6;
73
+ }
74
+ const shineEffect = t4;
75
+ let t5;
76
+ let t6;
77
+ if ($[6] !== hostContainer || $[7] !== thumbLabel) {
78
+ t5 = () => {
79
+ if (thumbLabel) {
80
+ setCoordinates(hostContainer === null || hostContainer === void 0 ? void 0 : hostContainer.getBoundingClientRect());
81
+ }
82
+ };
83
+ t6 = [hostContainer, thumbLabel];
84
+ $[6] = hostContainer;
85
+ $[7] = thumbLabel;
86
+ $[8] = t5;
87
+ $[9] = t6;
88
+ } else {
89
+ t5 = $[8];
90
+ t6 = $[9];
91
+ }
92
+ (0, _react.useEffect)(t5, t6);
93
+ let t7;
94
+ let t8;
95
+ if ($[10] !== coordinates) {
96
+ t7 = () => {
97
+ if (coordinates) {
98
+ var _popupRef$current;
99
+ (_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || _popupRef$current.show();
100
+ }
101
+ };
102
+ t8 = [coordinates];
103
+ $[10] = coordinates;
104
+ $[11] = t7;
105
+ $[12] = t8;
106
+ } else {
107
+ t7 = $[11];
108
+ t8 = $[12];
109
+ }
110
+ (0, _react.useEffect)(t7, t8);
111
+ let t9;
112
+ if ($[13] !== (colors === null || colors === void 0 ? void 0 : colors.backgroundColor) || $[14] !== (colors === null || colors === void 0 ? void 0 : colors.primaryTextColor) || $[15] !== (colors === null || colors === void 0 ? void 0 : colors.progressColor) || $[16] !== (colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor) || $[17] !== (colors === null || colors === void 0 ? void 0 : colors.stepColor) || $[18] !== (colors === null || colors === void 0 ? void 0 : colors.thumbLabelColor) || $[19] !== height || $[20] !== hostContainer || $[21] !== label || $[22] !== percentage || $[23] !== shineEffect || $[24] !== shouldHideProgress || $[25] !== shouldShowLabelInline || $[26] !== showShine || $[27] !== steps || $[28] !== theme || $[29] !== thumbLabel || $[30] !== uuid) {
113
+ colors === null || colors === void 0 || colors.backgroundColor;
114
+ colors === null || colors === void 0 || colors.primaryTextColor;
115
+ colors === null || colors === void 0 || colors.progressColor;
116
+ colors === null || colors === void 0 || colors.secondaryTextColor;
117
+ colors === null || colors === void 0 || colors.stepColor;
118
+ colors === null || colors === void 0 || colors.thumbLabelColor;
119
+ t9 = (() => {
120
+ if (shouldHideProgress) {
121
+ return null;
122
+ }
123
+ if (percentage === undefined) {
124
+ return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
125
+ key: `progress-bar-loop__${uuid}`,
126
+ $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
127
+ initial: {
128
+ width: "200px",
129
+ left: "-200px"
130
+ },
131
+ animate: {
132
+ width: "200px",
133
+ left: "100%"
134
+ },
135
+ exit: {
136
+ width: "200px",
137
+ left: "100%"
138
+ },
139
+ transition: {
140
+ type: "tween",
141
+ repeat: Infinity,
142
+ repeatDelay: 0,
143
+ duration: 1
144
+ }
145
+ }), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
146
+ $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
147
+ }));
148
+ }
149
+ return /*#__PURE__*/_react.default.createElement("div", {
150
+ ref: instance => setHostContainer(instance),
151
+ style: {
152
+ border: 0
153
+ }
154
+ }, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, {
155
+ $isBig: shouldShowLabelInline,
156
+ $height: height
157
+ }, !!(steps !== null && steps !== void 0 && steps.length) && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStep, {
158
+ $position: step,
159
+ key: `progress-step-${step}`,
160
+ $color: colors === null || colors === void 0 ? void 0 : colors.stepColor
161
+ }))), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
162
+ $height: height,
65
163
  $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
164
+ key: `progress-bar__${uuid}`,
66
165
  initial: {
67
- width: '200px',
68
- left: '-200px'
166
+ width: "0%"
69
167
  },
70
168
  animate: {
71
- width: '200px',
72
- left: '100%'
169
+ width: `${percentage}%`
73
170
  },
74
171
  exit: {
75
- width: '200px',
76
- left: '100%'
172
+ width: "0%"
77
173
  },
78
174
  transition: {
79
- type: 'tween',
80
- repeat: Infinity,
81
- repeatDelay: 0,
82
- duration: 1
175
+ type: "tween"
176
+ },
177
+ onUpdate: () => {
178
+ var _popupRef$current2;
179
+ return (_popupRef$current2 = popupRef.current) === null || _popupRef$current2 === void 0 ? void 0 : _popupRef$current2.show();
180
+ },
181
+ onAnimationComplete: () => {
182
+ var _popupRef$current3;
183
+ return (_popupRef$current3 = popupRef.current) === null || _popupRef$current3 === void 0 ? void 0 : _popupRef$current3.show();
83
184
  }
84
- }), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
185
+ }, showShine && shineEffect, thumbLabel && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarThumbLabel, {
186
+ onClick: _temp
187
+ }, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
188
+ theme: {
189
+ "000": (colors === null || colors === void 0 ? void 0 : colors.thumbLabelColor) ?? (theme === null || theme === void 0 ? void 0 : theme["104"]),
190
+ text: (colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor) ?? (theme === null || theme === void 0 ? void 0 : theme["300"])
191
+ }
192
+ }, /*#__PURE__*/_react.default.createElement(_Popup.default, {
193
+ ref: popupRef,
194
+ content: thumbLabel,
195
+ alignment: _popup.PopupAlignment.TopCenter,
196
+ onHide: () => {
197
+ var _popupRef$current4;
198
+ return (_popupRef$current4 = popupRef.current) === null || _popupRef$current4 === void 0 ? void 0 : _popupRef$current4.show();
199
+ },
200
+ container: hostContainer ?? undefined,
201
+ shouldUseChildrenWidth: true
202
+ })))), shouldShowLabelInline && label && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
203
+ $shouldShowLabelInline: shouldShowLabelInline,
204
+ $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor,
205
+ $secondaryColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
206
+ $colorSplitPosition: percentage
207
+ }, label), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
85
208
  $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
86
- }));
87
- }
88
- return /*#__PURE__*/_react.default.createElement("div", {
89
- ref: hostContainerRef
90
- }, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, {
91
- $isBig: shouldShowLabelInline,
92
- $height: height
93
- }, !!(steps !== null && steps !== void 0 && steps.length) && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStep, {
94
- $position: step,
95
- key: `progress-step-${step}`,
96
- $color: colors === null || colors === void 0 ? void 0 : colors.stepColor
97
- }))), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
98
- $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
99
- key: `progress-bar__${uuid}`,
100
- initial: {
101
- width: '0%'
102
- },
103
- animate: {
104
- width: `${percentage}%`
105
- },
106
- exit: {
107
- width: '0%'
108
- },
109
- transition: {
110
- type: 'tween'
111
- },
112
- onUpdate: () => {
113
- var _popupRef$current2;
114
- return (_popupRef$current2 = popupRef.current) === null || _popupRef$current2 === void 0 ? void 0 : _popupRef$current2.show();
115
- },
116
- onAnimationComplete: () => {
117
- var _popupRef$current3;
118
- return (_popupRef$current3 = popupRef.current) === null || _popupRef$current3 === void 0 ? void 0 : _popupRef$current3.show();
119
- }
120
- }, showShine && shineEffect, thumbLabel && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarThumbLabel, {
121
- onClick: event => event.stopPropagation()
122
- }, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
123
- theme: {
124
- '000': (colors === null || colors === void 0 ? void 0 : colors.backgroundColor) ?? (theme === null || theme === void 0 ? void 0 : theme['104']),
125
- text: (colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor) ?? (theme === null || theme === void 0 ? void 0 : theme['300'])
126
- }
127
- }, /*#__PURE__*/_react.default.createElement(_Popup.default, {
128
- ref: popupRef,
129
- content: thumbLabel,
130
- alignment: _popup.PopupAlignment.TopCenter,
131
- onHide: () => {
132
- var _popupRef$current4;
133
- return (_popupRef$current4 = popupRef.current) === null || _popupRef$current4 === void 0 ? void 0 : _popupRef$current4.show();
134
- },
135
- container: hostContainerRef.current ?? undefined
136
- })))), shouldShowLabelInline && label && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
137
- $shouldShowLabelInline: shouldShowLabelInline,
138
- $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor,
139
- $secondaryColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
140
- $colorSplitPosition: percentage
141
- }, label), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
142
- $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
143
- })));
144
- }, [colors === null || colors === void 0 ? void 0 : colors.backgroundColor, colors === null || colors === void 0 ? void 0 : colors.primaryTextColor, colors === null || colors === void 0 ? void 0 : colors.progressColor, colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor, colors === null || colors === void 0 ? void 0 : colors.stepColor, height, label, percentage, shineEffect, shouldHideProgress, shouldShowLabelInline, showShine, steps, theme, thumbLabel, uuid]);
145
- return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBar, null, progressBar, label && !shouldShowLabelInline && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
146
- $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor
147
- }, label)), [colors === null || colors === void 0 ? void 0 : colors.primaryTextColor, label, progressBar, shouldShowLabelInline]);
209
+ })));
210
+ })();
211
+ $[13] = colors === null || colors === void 0 ? void 0 : colors.backgroundColor;
212
+ $[14] = colors === null || colors === void 0 ? void 0 : colors.primaryTextColor;
213
+ $[15] = colors === null || colors === void 0 ? void 0 : colors.progressColor;
214
+ $[16] = colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor;
215
+ $[17] = colors === null || colors === void 0 ? void 0 : colors.stepColor;
216
+ $[18] = colors === null || colors === void 0 ? void 0 : colors.thumbLabelColor;
217
+ $[19] = height;
218
+ $[20] = hostContainer;
219
+ $[21] = label;
220
+ $[22] = percentage;
221
+ $[23] = shineEffect;
222
+ $[24] = shouldHideProgress;
223
+ $[25] = shouldShowLabelInline;
224
+ $[26] = showShine;
225
+ $[27] = steps;
226
+ $[28] = theme;
227
+ $[29] = thumbLabel;
228
+ $[30] = uuid;
229
+ $[31] = t9;
230
+ } else {
231
+ t9 = $[31];
232
+ }
233
+ const progressBar = t9;
234
+ colors === null || colors === void 0 || colors.primaryTextColor;
235
+ let t10;
236
+ if ($[32] !== (colors === null || colors === void 0 ? void 0 : colors.primaryTextColor) || $[33] !== label || $[34] !== shouldShowLabelInline) {
237
+ t10 = label && !shouldShowLabelInline && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
238
+ $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor
239
+ }, label);
240
+ $[32] = colors === null || colors === void 0 ? void 0 : colors.primaryTextColor;
241
+ $[33] = label;
242
+ $[34] = shouldShowLabelInline;
243
+ $[35] = t10;
244
+ } else {
245
+ t10 = $[35];
246
+ }
247
+ let t11;
248
+ if ($[36] !== progressBar || $[37] !== t10) {
249
+ t11 = /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBar, null, progressBar, t10);
250
+ $[36] = progressBar;
251
+ $[37] = t10;
252
+ $[38] = t11;
253
+ } else {
254
+ t11 = $[38];
255
+ }
256
+ return t11;
148
257
  };
149
258
  ProgressBar.displayName = 'ProgressBar';
150
259
  var _default = exports.default = ProgressBar;
260
+ function _temp(event) {
261
+ return event.stopPropagation();
262
+ }
151
263
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":["_react","_interopRequireWildcard","require","_uuid","_ProgressBar","_popup","_styledComponents","_Popup","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProgressBar","percentage","label","shouldHideProgress","shouldShowLabelInline","steps","colors","thumbLabel","showShine","height","uuid","useUuid","coordinates","setCoordinates","useState","popupRef","useRef","hostContainerRef","theme","useContext","ThemeContext","shineEffect","useMemo","undefined","MIN_ANIMATION_LENGTH","MAX_ANIMATION_LENGTH","MAX_SHINE_COUNT","shineCount","Math","ceil","speed","Array","from","length","map","_","index","createElement","StyledProgressBarShine","key","$speed","$delay","useEffect","_hostContainerRef$cur","current","getBoundingClientRect","_popupRef$current","show","progressBar","StyledProgressBarProgressWrapper","StyledMotionProgressBarProgress","$color","progressColor","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","StyledProgressBarBackground","backgroundColor","ref","$isBig","$height","StyledProgressBarStepWrapper","step","StyledProgressBarStep","$position","stepColor","onUpdate","_popupRef$current2","onAnimationComplete","_popupRef$current3","StyledProgressBarThumbLabel","onClick","event","stopPropagation","ThemeProvider","text","secondaryTextColor","content","alignment","PopupAlignment","TopCenter","onHide","_popupRef$current4","container","StyledProgressBarLabel","$shouldShowLabelInline","$primaryColor","primaryTextColor","$secondaryColor","$colorSplitPosition","StyledProgressBar","displayName","_default","exports"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n /**\n * The height of the progress bar in pixels. If not provided, it will be 10px if shouldShowLabelInline is false and 20px if shouldShowLabelInline is true.\n */\n height?: number;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n height,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const [coordinates, setCoordinates] = useState<{ x: number; y: number }>();\n const popupRef = useRef<PopupRef | null>(null);\n const hostContainerRef = useRef<HTMLDivElement | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const MIN_ANIMATION_LENGTH = 1;\n const MAX_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n const t = percentage / 100;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * t);\n\n const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;\n\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={-(speed / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n useEffect(() => {\n if (thumbLabel) setCoordinates(hostContainerRef.current?.getBoundingClientRect());\n }, [thumbLabel]);\n\n useEffect(() => {\n if (coordinates) popupRef.current?.show();\n }, [coordinates]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <div ref={hostContainerRef}>\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline} $height={height}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel\n onClick={(event) => event.stopPropagation()}\n >\n <ThemeProvider\n theme={{\n '000': colors?.backgroundColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n container={hostContainerRef.current ?? undefined}\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n </div>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n height,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAmC,SAAAM,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAQ,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ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ANA,MAAM,uBAANA,MAAM,CAAE2D;IAAgB,CAAE,CACjC,CACjC,CAAC;EAEd,CAAC,EAAE,CACC3D,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE2D,eAAe,EACvB3D,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEyF,gBAAgB,EACxBzF,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE8C,aAAa,EACrB9C,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE8E,kBAAkB,EAC1B9E,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEmE,SAAS,EACjBhE,MAAM,EACNP,KAAK,EACLD,UAAU,EACVoB,WAAW,EACXlB,kBAAkB,EAClBC,qBAAqB,EACrBI,SAAS,EACTH,KAAK,EACLa,KAAK,EACLX,UAAU,EACVG,IAAI,CACP,CAAC;EAEF,OAAO,IAAAY,cAAO,EACV,mBACIlD,MAAA,CAAAW,OAAA,CAAAsD,aAAA,CAAC7D,YAAA,CAAA0H,iBAAiB,QACblD,WAAW,EACX9C,KAAK,IAAI,CAACE,qBAAqB,iBAC5BhC,MAAA,CAAAW,OAAA,CAAAsD,aAAA,CAAC7D,YAAA,CAAAoH,sBAAsB;IAACE,aAAa,EAAExF,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEyF;EAAiB,GAC3D7F,KACmB,CAEb,CACtB,EACD,CAACI,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEyF,gBAAgB,EAAE7F,KAAK,EAAE8C,WAAW,EAAE5C,qBAAqB,CACxE,CAAC;AACL,CAAC;AAEDJ,WAAW,CAACmG,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtH,OAAA,GAEzBiB,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.js","names":["_react","_interopRequireWildcard","require","_uuid","_ProgressBar","_popup","_styledComponents","_Popup","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProgressBar","t0","$","_reactCompilerRuntime","c","percentage","label","shouldHideProgress","t1","shouldShowLabelInline","t2","steps","colors","thumbLabel","showShine","t3","height","undefined","uuid","useUuid","coordinates","setCoordinates","useState","popupRef","useRef","hostContainer","setHostContainer","theme","useContext","ThemeContext","t4","bb0","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","StyledProgressBarShine","key","$delay","shineEffect","getBoundingClientRect","useEffect","t7","t8","_popupRef$current","current","show","t9","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","thumbLabelColor","StyledProgressBarProgressWrapper","StyledMotionProgressBarProgress","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","StyledProgressBarBackground","ref","instance","style","border","StyledProgressBarStepWrapper","step","StyledProgressBarStep","onUpdate","_popupRef$current2","onAnimationComplete","_popupRef$current3","StyledProgressBarThumbLabel","onClick","_temp","ThemeProvider","text","alignment","PopupAlignment","TopCenter","onHide","_popupRef$current4","container","shouldUseChildrenWidth","StyledProgressBarLabel","$primaryColor","$secondaryColor","progressBar","t10","t11","StyledProgressBar","displayName","_default","exports","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n thumbLabelColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n /**\n * The height of the progress bar in pixels. If not provided, it will be 10px if shouldShowLabelInline is false and 20px if shouldShowLabelInline is true.\n */\n height?: number;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n height,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const [coordinates, setCoordinates] = useState<{ x: number; y: number }>();\n const popupRef = useRef<PopupRef | null>(null);\n const [hostContainer, setHostContainer] = useState<HTMLDivElement | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const MIN_ANIMATION_LENGTH = 1;\n const MAX_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n const t = percentage / 100;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * t);\n\n const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;\n\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={-(speed / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n useEffect(() => {\n if (thumbLabel) setCoordinates(hostContainer?.getBoundingClientRect());\n }, [hostContainer, thumbLabel]);\n\n useEffect(() => {\n if (coordinates) popupRef.current?.show();\n }, [coordinates]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <div ref={(instance) => setHostContainer(instance)} style={{ border: 0 }}>\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline} $height={height}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $height={height}\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel\n onClick={(event) => event.stopPropagation()}\n >\n <ThemeProvider\n theme={{\n '000': colors?.thumbLabelColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n container={hostContainer ?? undefined}\n shouldUseChildrenWidth\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n </div>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n colors?.thumbLabelColor,\n height,\n hostContainer,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAmC,SAAAM,uBAAAC,CAAA,WAAAA,CAAA,IAA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AAAoB,KAAA;EAAA,OAuGUA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -29,7 +29,7 @@ const StyledProgressBarProgressWrapper = exports.StyledProgressBarProgressWrappe
29
29
  border-radius: ${({
30
30
  $height,
31
31
  $isBig
32
- }) => $isBig ? $height ?? 20 : ($height ?? 10) / 5}px;
32
+ }) => $height || ($isBig ? 20 : 10)}px;
33
33
  `;
34
34
  const shineMove = (0, _styledComponents.keyframes)`
35
35
  from {
@@ -75,6 +75,10 @@ const StyledMotionProgressBarProgress = exports.StyledMotionProgressBarProgress
75
75
  theme,
76
76
  $color
77
77
  }) => $color ?? theme.headline};
78
+ border-radius: ${({
79
+ $height,
80
+ $isBig
81
+ }) => $height || ($isBig ? 20 : 10)}px;
78
82
  `;
79
83
  const StyledProgressBarLabel = exports.StyledProgressBarLabel = _styledComponents.default.div`
80
84
  font-size: 85%;
@@ -133,5 +137,6 @@ const StyledProgressBarStep = exports.StyledProgressBarStep = _styledComponents.
133
137
  const StyledProgressBarThumbLabel = exports.StyledProgressBarThumbLabel = _styledComponents.default.div`
134
138
  position: absolute;
135
139
  right: 0;
140
+ height: 100%;
136
141
  `;
137
142
  //# sourceMappingURL=ProgressBar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledProgressBar","exports","styled","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$height","$isBig","shineMove","keyframes","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","motion","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","css","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n $height?: number;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n border-radius: ${({ $height, $isBig }) => ($isBig ? ($height ?? 20) : ($height ?? 10) / 5)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA2D,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBF,aAAa,IAAInB,KAAK,CAAC,KAAK,CAAC,IAAIkB,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIpB,KAAK,CAAC,KAAK,CAAC,IAAIkB,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAEM,MAAMI,4BAA4B,GAAA1B,OAAA,CAAA0B,4BAAA,GAAGzB,yBAAM,CAACC,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOM,MAAMyB,qBAAqB,GAAA3B,OAAA,CAAA2B,qBAAA,GAAG1B,yBAAM,CAACC,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEwB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAEM,MAAMC,2BAA2B,GAAA7B,OAAA,CAAA6B,2BAAA,GAAG5B,yBAAM,CAACC,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledProgressBar","exports","styled","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$height","$isBig","shineMove","keyframes","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","motion","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","css","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n $height?: number;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n border-radius: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n`;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }> & {\n $height?: number;\n $isBig?: boolean;\n};\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n border-radius: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n height: 100%;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA2D,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAA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IACnB,IAAAG,qBAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBF,aAAa,IAAInB,KAAK,CAAC,KAAK,CAAC,IAAIkB,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIpB,KAAK,CAAC,KAAK,CAAC,IAAIkB,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAEM,MAAMI,4BAA4B,GAAA1B,OAAA,CAAA0B,4BAAA,GAAGzB,yBAAM,CAACC,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOM,MAAMyB,qBAAqB,GAAA3B,OAAA,CAAA2B,qBAAA,GAAG1B,yBAAM,CAACC,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEwB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAEM,MAAMC,2BAA2B,GAAA7B,OAAA,CAAA6B,2BAAA,GAAG5B,yBAAM,CAACC,GAAG;AACrD;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,132 +1,245 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
2
3
  import { useUuid } from '../../hooks/uuid';
3
4
  import { StyledMotionProgressBarProgress, StyledProgressBar, StyledProgressBarBackground, StyledProgressBarLabel, StyledProgressBarProgressWrapper, StyledProgressBarShine, StyledProgressBarStep, StyledProgressBarStepWrapper, StyledProgressBarThumbLabel } from './ProgressBar.styles';
4
5
  import { PopupAlignment } from '../../types/popup';
5
6
  import { ThemeContext, ThemeProvider } from 'styled-components';
6
7
  import Popup from '../popup/Popup';
7
- const ProgressBar = ({
8
- percentage,
9
- label,
10
- shouldHideProgress = false,
11
- shouldShowLabelInline = false,
12
- steps,
13
- colors,
14
- thumbLabel,
15
- showShine = false,
16
- height
17
- }) => {
18
- 'use memo';
8
+ const ProgressBar = t0 => {
9
+ "use memo";
19
10
 
11
+ const $ = _c(39);
12
+ const {
13
+ percentage,
14
+ label,
15
+ shouldHideProgress: t1,
16
+ shouldShowLabelInline: t2,
17
+ steps,
18
+ colors,
19
+ thumbLabel,
20
+ showShine: t3,
21
+ height
22
+ } = t0;
23
+ const shouldHideProgress = t1 === undefined ? false : t1;
24
+ const shouldShowLabelInline = t2 === undefined ? false : t2;
25
+ const showShine = t3 === undefined ? false : t3;
20
26
  const uuid = useUuid();
21
27
  const [coordinates, setCoordinates] = useState();
22
28
  const popupRef = useRef(null);
23
- const hostContainerRef = useRef(null);
29
+ const [hostContainer, setHostContainer] = useState(null);
24
30
  const theme = useContext(ThemeContext);
25
- const shineEffect = useMemo(() => {
26
- if (!showShine || percentage === undefined) return null;
27
- const MIN_ANIMATION_LENGTH = 1;
28
- const MAX_ANIMATION_LENGTH = 5;
29
- const MAX_SHINE_COUNT = 6;
31
+ let t4;
32
+ bb0: {
33
+ if (!showShine || percentage === undefined) {
34
+ t4 = null;
35
+ break bb0;
36
+ }
30
37
  const t = percentage / 100;
31
- const shineCount = Math.ceil(MAX_SHINE_COUNT * t);
32
- const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;
33
- return Array.from({
34
- length: shineCount
35
- }).map((_, index) => /*#__PURE__*/React.createElement(StyledProgressBarShine
36
- /* eslint-disable-next-line react/no-array-index-key */, {
37
- key: `progress-bar-shine__${shineCount}__${index}`,
38
- $speed: speed,
39
- $delay: -(speed / shineCount) * index
40
- }));
41
- }, [percentage, showShine]);
42
- useEffect(() => {
43
- if (thumbLabel) setCoordinates(hostContainerRef.current?.getBoundingClientRect());
44
- }, [thumbLabel]);
45
- useEffect(() => {
46
- if (coordinates) popupRef.current?.show();
47
- }, [coordinates]);
48
- const progressBar = useMemo(() => {
49
- if (shouldHideProgress) {
50
- return null;
38
+ const shineCount = Math.ceil(6 * t);
39
+ const speed = 1 + 4 * t;
40
+ let t5;
41
+ if ($[0] !== shineCount) {
42
+ t5 = Array.from({
43
+ length: shineCount
44
+ });
45
+ $[0] = shineCount;
46
+ $[1] = t5;
47
+ } else {
48
+ t5 = $[1];
49
+ }
50
+ let t6;
51
+ if ($[2] !== shineCount || $[3] !== speed || $[4] !== t5) {
52
+ t6 = t5.map((_, index) => /*#__PURE__*/React.createElement(StyledProgressBarShine, {
53
+ key: `progress-bar-shine__${shineCount}__${index}`,
54
+ $speed: speed,
55
+ $delay: -(speed / shineCount) * index
56
+ }));
57
+ $[2] = shineCount;
58
+ $[3] = speed;
59
+ $[4] = t5;
60
+ $[5] = t6;
61
+ } else {
62
+ t6 = $[5];
51
63
  }
52
- if (percentage === undefined) {
53
- return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, null, /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
54
- key: `progress-bar-loop__${uuid}`,
64
+ t4 = t6;
65
+ }
66
+ const shineEffect = t4;
67
+ let t5;
68
+ let t6;
69
+ if ($[6] !== hostContainer || $[7] !== thumbLabel) {
70
+ t5 = () => {
71
+ if (thumbLabel) {
72
+ setCoordinates(hostContainer?.getBoundingClientRect());
73
+ }
74
+ };
75
+ t6 = [hostContainer, thumbLabel];
76
+ $[6] = hostContainer;
77
+ $[7] = thumbLabel;
78
+ $[8] = t5;
79
+ $[9] = t6;
80
+ } else {
81
+ t5 = $[8];
82
+ t6 = $[9];
83
+ }
84
+ useEffect(t5, t6);
85
+ let t7;
86
+ let t8;
87
+ if ($[10] !== coordinates) {
88
+ t7 = () => {
89
+ if (coordinates) {
90
+ popupRef.current?.show();
91
+ }
92
+ };
93
+ t8 = [coordinates];
94
+ $[10] = coordinates;
95
+ $[11] = t7;
96
+ $[12] = t8;
97
+ } else {
98
+ t7 = $[11];
99
+ t8 = $[12];
100
+ }
101
+ useEffect(t7, t8);
102
+ let t9;
103
+ if ($[13] !== colors?.backgroundColor || $[14] !== colors?.primaryTextColor || $[15] !== colors?.progressColor || $[16] !== colors?.secondaryTextColor || $[17] !== colors?.stepColor || $[18] !== colors?.thumbLabelColor || $[19] !== height || $[20] !== hostContainer || $[21] !== label || $[22] !== percentage || $[23] !== shineEffect || $[24] !== shouldHideProgress || $[25] !== shouldShowLabelInline || $[26] !== showShine || $[27] !== steps || $[28] !== theme || $[29] !== thumbLabel || $[30] !== uuid) {
104
+ colors?.backgroundColor;
105
+ colors?.primaryTextColor;
106
+ colors?.progressColor;
107
+ colors?.secondaryTextColor;
108
+ colors?.stepColor;
109
+ colors?.thumbLabelColor;
110
+ t9 = (() => {
111
+ if (shouldHideProgress) {
112
+ return null;
113
+ }
114
+ if (percentage === undefined) {
115
+ return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, null, /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
116
+ key: `progress-bar-loop__${uuid}`,
117
+ $color: colors?.progressColor,
118
+ initial: {
119
+ width: "200px",
120
+ left: "-200px"
121
+ },
122
+ animate: {
123
+ width: "200px",
124
+ left: "100%"
125
+ },
126
+ exit: {
127
+ width: "200px",
128
+ left: "100%"
129
+ },
130
+ transition: {
131
+ type: "tween",
132
+ repeat: Infinity,
133
+ repeatDelay: 0,
134
+ duration: 1
135
+ }
136
+ }), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
137
+ $color: colors?.backgroundColor
138
+ }));
139
+ }
140
+ return /*#__PURE__*/React.createElement("div", {
141
+ ref: instance => setHostContainer(instance),
142
+ style: {
143
+ border: 0
144
+ }
145
+ }, /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, {
146
+ $isBig: shouldShowLabelInline,
147
+ $height: height
148
+ }, !!steps?.length && /*#__PURE__*/React.createElement(StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/React.createElement(StyledProgressBarStep, {
149
+ $position: step,
150
+ key: `progress-step-${step}`,
151
+ $color: colors?.stepColor
152
+ }))), /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
153
+ $height: height,
55
154
  $color: colors?.progressColor,
155
+ key: `progress-bar__${uuid}`,
56
156
  initial: {
57
- width: '200px',
58
- left: '-200px'
157
+ width: "0%"
59
158
  },
60
159
  animate: {
61
- width: '200px',
62
- left: '100%'
160
+ width: `${percentage}%`
63
161
  },
64
162
  exit: {
65
- width: '200px',
66
- left: '100%'
163
+ width: "0%"
67
164
  },
68
165
  transition: {
69
- type: 'tween',
70
- repeat: Infinity,
71
- repeatDelay: 0,
72
- duration: 1
166
+ type: "tween"
167
+ },
168
+ onUpdate: () => popupRef.current?.show(),
169
+ onAnimationComplete: () => popupRef.current?.show()
170
+ }, showShine && shineEffect, thumbLabel && /*#__PURE__*/React.createElement(StyledProgressBarThumbLabel, {
171
+ onClick: _temp
172
+ }, /*#__PURE__*/React.createElement(ThemeProvider, {
173
+ theme: {
174
+ "000": colors?.thumbLabelColor ?? theme?.["104"],
175
+ text: colors?.secondaryTextColor ?? theme?.["300"]
73
176
  }
74
- }), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
177
+ }, /*#__PURE__*/React.createElement(Popup, {
178
+ ref: popupRef,
179
+ content: thumbLabel,
180
+ alignment: PopupAlignment.TopCenter,
181
+ onHide: () => popupRef.current?.show(),
182
+ container: hostContainer ?? undefined,
183
+ shouldUseChildrenWidth: true
184
+ })))), shouldShowLabelInline && label && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
185
+ $shouldShowLabelInline: shouldShowLabelInline,
186
+ $primaryColor: colors?.primaryTextColor,
187
+ $secondaryColor: colors?.secondaryTextColor,
188
+ $colorSplitPosition: percentage
189
+ }, label), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
75
190
  $color: colors?.backgroundColor
76
- }));
77
- }
78
- return /*#__PURE__*/React.createElement("div", {
79
- ref: hostContainerRef
80
- }, /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, {
81
- $isBig: shouldShowLabelInline,
82
- $height: height
83
- }, !!steps?.length && /*#__PURE__*/React.createElement(StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/React.createElement(StyledProgressBarStep, {
84
- $position: step,
85
- key: `progress-step-${step}`,
86
- $color: colors?.stepColor
87
- }))), /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
88
- $color: colors?.progressColor,
89
- key: `progress-bar__${uuid}`,
90
- initial: {
91
- width: '0%'
92
- },
93
- animate: {
94
- width: `${percentage}%`
95
- },
96
- exit: {
97
- width: '0%'
98
- },
99
- transition: {
100
- type: 'tween'
101
- },
102
- onUpdate: () => popupRef.current?.show(),
103
- onAnimationComplete: () => popupRef.current?.show()
104
- }, showShine && shineEffect, thumbLabel && /*#__PURE__*/React.createElement(StyledProgressBarThumbLabel, {
105
- onClick: event => event.stopPropagation()
106
- }, /*#__PURE__*/React.createElement(ThemeProvider, {
107
- theme: {
108
- '000': colors?.backgroundColor ?? theme?.['104'],
109
- text: colors?.secondaryTextColor ?? theme?.['300']
110
- }
111
- }, /*#__PURE__*/React.createElement(Popup, {
112
- ref: popupRef,
113
- content: thumbLabel,
114
- alignment: PopupAlignment.TopCenter,
115
- onHide: () => popupRef.current?.show(),
116
- container: hostContainerRef.current ?? undefined
117
- })))), shouldShowLabelInline && label && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
118
- $shouldShowLabelInline: shouldShowLabelInline,
119
- $primaryColor: colors?.primaryTextColor,
120
- $secondaryColor: colors?.secondaryTextColor,
121
- $colorSplitPosition: percentage
122
- }, label), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
123
- $color: colors?.backgroundColor
124
- })));
125
- }, [colors?.backgroundColor, colors?.primaryTextColor, colors?.progressColor, colors?.secondaryTextColor, colors?.stepColor, height, label, percentage, shineEffect, shouldHideProgress, shouldShowLabelInline, showShine, steps, theme, thumbLabel, uuid]);
126
- return useMemo(() => /*#__PURE__*/React.createElement(StyledProgressBar, null, progressBar, label && !shouldShowLabelInline && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
127
- $primaryColor: colors?.primaryTextColor
128
- }, label)), [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline]);
191
+ })));
192
+ })();
193
+ $[13] = colors?.backgroundColor;
194
+ $[14] = colors?.primaryTextColor;
195
+ $[15] = colors?.progressColor;
196
+ $[16] = colors?.secondaryTextColor;
197
+ $[17] = colors?.stepColor;
198
+ $[18] = colors?.thumbLabelColor;
199
+ $[19] = height;
200
+ $[20] = hostContainer;
201
+ $[21] = label;
202
+ $[22] = percentage;
203
+ $[23] = shineEffect;
204
+ $[24] = shouldHideProgress;
205
+ $[25] = shouldShowLabelInline;
206
+ $[26] = showShine;
207
+ $[27] = steps;
208
+ $[28] = theme;
209
+ $[29] = thumbLabel;
210
+ $[30] = uuid;
211
+ $[31] = t9;
212
+ } else {
213
+ t9 = $[31];
214
+ }
215
+ const progressBar = t9;
216
+ colors?.primaryTextColor;
217
+ let t10;
218
+ if ($[32] !== colors?.primaryTextColor || $[33] !== label || $[34] !== shouldShowLabelInline) {
219
+ t10 = label && !shouldShowLabelInline && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
220
+ $primaryColor: colors?.primaryTextColor
221
+ }, label);
222
+ $[32] = colors?.primaryTextColor;
223
+ $[33] = label;
224
+ $[34] = shouldShowLabelInline;
225
+ $[35] = t10;
226
+ } else {
227
+ t10 = $[35];
228
+ }
229
+ let t11;
230
+ if ($[36] !== progressBar || $[37] !== t10) {
231
+ t11 = /*#__PURE__*/React.createElement(StyledProgressBar, null, progressBar, t10);
232
+ $[36] = progressBar;
233
+ $[37] = t10;
234
+ $[38] = t11;
235
+ } else {
236
+ t11 = $[38];
237
+ }
238
+ return t11;
129
239
  };
130
240
  ProgressBar.displayName = 'ProgressBar';
131
241
  export default ProgressBar;
242
+ function _temp(event) {
243
+ return event.stopPropagation();
244
+ }
132
245
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":["React","useContext","useEffect","useMemo","useRef","useState","useUuid","StyledMotionProgressBarProgress","StyledProgressBar","StyledProgressBarBackground","StyledProgressBarLabel","StyledProgressBarProgressWrapper","StyledProgressBarShine","StyledProgressBarStep","StyledProgressBarStepWrapper","StyledProgressBarThumbLabel","PopupAlignment","ThemeContext","ThemeProvider","Popup","ProgressBar","percentage","label","shouldHideProgress","shouldShowLabelInline","steps","colors","thumbLabel","showShine","height","uuid","coordinates","setCoordinates","popupRef","hostContainerRef","theme","shineEffect","undefined","MIN_ANIMATION_LENGTH","MAX_ANIMATION_LENGTH","MAX_SHINE_COUNT","t","shineCount","Math","ceil","speed","Array","from","length","map","_","index","createElement","key","$speed","$delay","current","getBoundingClientRect","show","progressBar","$color","progressColor","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","backgroundColor","ref","$isBig","$height","step","$position","stepColor","onUpdate","onAnimationComplete","onClick","event","stopPropagation","text","secondaryTextColor","content","alignment","TopCenter","onHide","container","$shouldShowLabelInline","$primaryColor","primaryTextColor","$secondaryColor","$colorSplitPosition","displayName"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n /**\n * The height of the progress bar in pixels. If not provided, it will be 10px if shouldShowLabelInline is false and 20px if shouldShowLabelInline is true.\n */\n height?: number;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n height,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const [coordinates, setCoordinates] = useState<{ x: number; y: number }>();\n const popupRef = useRef<PopupRef | null>(null);\n const hostContainerRef = useRef<HTMLDivElement | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const MIN_ANIMATION_LENGTH = 1;\n const MAX_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n const t = percentage / 100;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * t);\n\n const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;\n\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={-(speed / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n useEffect(() => {\n if (thumbLabel) setCoordinates(hostContainerRef.current?.getBoundingClientRect());\n }, [thumbLabel]);\n\n useEffect(() => {\n if (coordinates) popupRef.current?.show();\n }, [coordinates]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <div ref={hostContainerRef}>\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline} $height={height}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel\n onClick={(event) => event.stopPropagation()}\n >\n <ThemeProvider\n theme={{\n '000': colors?.backgroundColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n container={hostContainerRef.current ?? undefined}\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n </div>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n height,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnF,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SACIC,+BAA+B,EAC/BC,iBAAiB,EACjBC,2BAA2B,EAC3BC,sBAAsB,EACtBC,gCAAgC,EAChCC,sBAAsB,EACtBC,qBAAqB,EACrBC,4BAA4B,EAC5BC,2BAA2B,QACxB,sBAAsB;AAC7B,SAASC,cAAc,QAAkB,mBAAmB;AAC5D,SAASC,YAAY,EAAEC,aAAa,QAAQ,mBAAmB;AAE/D,OAAOC,KAAK,MAAM,gBAAgB;AAuDlC,MAAMC,WAAiC,GAAGA,CAAC;EACvCC,UAAU;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AEnE,MAAM,EAAEoE;EAAiB,GAC3DxE,KACmB,CAEb,CACtB,EACD,CAACI,MAAM,EAAEoE,gBAAgB,EAAExE,KAAK,EAAEqC,WAAW,EAAEnC,qBAAqB,CACxE,CAAC;AACL,CAAC;AAEDJ,WAAW,CAAC6E,WAAW,GAAG,aAAa;AAEvC,eAAe7E,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.js","names":["React","useContext","useEffect","useMemo","useRef","useState","useUuid","StyledMotionProgressBarProgress","StyledProgressBar","StyledProgressBarBackground","StyledProgressBarLabel","StyledProgressBarProgressWrapper","StyledProgressBarShine","StyledProgressBarStep","StyledProgressBarStepWrapper","StyledProgressBarThumbLabel","PopupAlignment","ThemeContext","ThemeProvider","Popup","ProgressBar","t0","$","_c","percentage","label","shouldHideProgress","t1","shouldShowLabelInline","t2","steps","colors","thumbLabel","showShine","t3","height","undefined","uuid","coordinates","setCoordinates","popupRef","hostContainer","setHostContainer","theme","t4","bb0","t","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","key","$delay","shineEffect","getBoundingClientRect","t7","t8","current","show","t9","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","thumbLabelColor","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","ref","instance","style","border","step","onUpdate","onAnimationComplete","onClick","_temp","text","alignment","TopCenter","onHide","container","shouldUseChildrenWidth","$primaryColor","$secondaryColor","progressBar","t10","t11","displayName","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarShine,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n StyledProgressBarThumbLabel,\n} from './ProgressBar.styles';\nimport { PopupAlignment, PopupRef } from '../../types/popup';\nimport { ThemeContext, ThemeProvider } from 'styled-components';\nimport { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Popup from '../popup/Popup';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\ninterface Colors {\n backgroundColor?: string;\n progressColor?: string;\n stepColor?: string;\n primaryTextColor?: string;\n secondaryTextColor?: string;\n thumbLabelColor?: string;\n}\n\nexport type ProgressBarProps = {\n /**\n * The colors of the ProgressBar.\n */\n colors?: Colors;\n /**\n * The label that should be displayed under the progressbar.\n */\n label?: string;\n /**\n * The percentage of the progress. Number between 0 and 100.\n */\n percentage?: Range<0, 101>;\n /**\n * Whether the progress should be hide and just display the label.\n */\n shouldHideProgress?: boolean;\n /**\n * Whether the label should be displayed inside the ProgressBar.\n */\n shouldShowLabelInline?: boolean;\n /**\n * Visual marked steps.\n */\n steps?: Range<0, 101>[];\n /**\n * The label that should be displayed on the thumb of the progress bar.\n */\n thumbLabel?: React.ReactNode;\n /**\n * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.\n */\n showShine?: boolean;\n /**\n * The height of the progress bar in pixels. If not provided, it will be 10px if shouldShowLabelInline is false and 20px if shouldShowLabelInline is true.\n */\n height?: number;\n};\n\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n height,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const [coordinates, setCoordinates] = useState<{ x: number; y: number }>();\n const popupRef = useRef<PopupRef | null>(null);\n const [hostContainer, setHostContainer] = useState<HTMLDivElement | null>(null);\n\n const theme = useContext(ThemeContext) as Theme | undefined;\n\n const shineEffect = useMemo(() => {\n if (!showShine || percentage === undefined) return null;\n const MIN_ANIMATION_LENGTH = 1;\n const MAX_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n const t = percentage / 100;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * t);\n\n const speed = MIN_ANIMATION_LENGTH + (MAX_ANIMATION_LENGTH - MIN_ANIMATION_LENGTH) * t;\n\n return Array.from({ length: shineCount }).map((_, index) => (\n <StyledProgressBarShine\n /* eslint-disable-next-line react/no-array-index-key */\n key={`progress-bar-shine__${shineCount}__${index}`}\n $speed={speed}\n $delay={-(speed / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\n\n useEffect(() => {\n if (thumbLabel) setCoordinates(hostContainer?.getBoundingClientRect());\n }, [hostContainer, thumbLabel]);\n\n useEffect(() => {\n if (coordinates) popupRef.current?.show();\n }, [coordinates]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (percentage === undefined) {\n return (\n <StyledProgressBarProgressWrapper>\n <StyledMotionProgressBarProgress\n key={`progress-bar-loop__${uuid}`}\n $color={colors?.progressColor}\n initial={{ width: '200px', left: '-200px' }}\n animate={{ width: '200px', left: '100%' }}\n exit={{ width: '200px', left: '100%' }}\n transition={{\n type: 'tween',\n repeat: Infinity,\n repeatDelay: 0,\n duration: 1,\n }}\n />\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }\n\n return (\n <div ref={(instance) => setHostContainer(instance)} style={{ border: 0 }}>\n <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline} $height={height}>\n {!!steps?.length && (\n <StyledProgressBarStepWrapper>\n {steps.map((step) => (\n <StyledProgressBarStep\n $position={step}\n key={`progress-step-${step}`}\n $color={colors?.stepColor}\n />\n ))}\n </StyledProgressBarStepWrapper>\n )}\n <StyledMotionProgressBarProgress\n $height={height}\n $color={colors?.progressColor}\n key={`progress-bar__${uuid}`}\n initial={{ width: '0%' }}\n animate={{ width: `${percentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n onUpdate={() => popupRef.current?.show()}\n onAnimationComplete={() => popupRef.current?.show()}\n >\n {showShine && shineEffect}\n {thumbLabel && (\n <StyledProgressBarThumbLabel\n onClick={(event) => event.stopPropagation()}\n >\n <ThemeProvider\n theme={{\n '000': colors?.thumbLabelColor ?? theme?.['104'],\n text: colors?.secondaryTextColor ?? theme?.['300'],\n }}\n >\n <Popup\n ref={popupRef}\n content={thumbLabel}\n alignment={PopupAlignment.TopCenter}\n onHide={() => popupRef.current?.show()}\n container={hostContainer ?? undefined}\n shouldUseChildrenWidth\n >\n {}\n </Popup>\n </ThemeProvider>\n </StyledProgressBarThumbLabel>\n )}\n </StyledMotionProgressBarProgress>\n\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={percentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n </div>\n );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\n colors?.thumbLabelColor,\n height,\n hostContainer,\n label,\n percentage,\n shineEffect,\n shouldHideProgress,\n shouldShowLabelInline,\n showShine,\n steps,\n theme,\n thumbLabel,\n uuid,\n ]);\n\n return useMemo(\n () => (\n <StyledProgressBar>\n {progressBar}\n {label && !shouldShowLabelInline && (\n <StyledProgressBarLabel $primaryColor={colors?.primaryTextColor}>\n {label}\n </StyledProgressBarLabel>\n )}\n </StyledProgressBar>\n ),\n [colors?.primaryTextColor, label, progressBar, shouldShowLabelInline],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ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AA,OAuGUA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -22,7 +22,7 @@ export const StyledProgressBarProgressWrapper = styled.div`
22
22
  border-radius: ${({
23
23
  $height,
24
24
  $isBig
25
- }) => $isBig ? $height ?? 20 : ($height ?? 10) / 5}px;
25
+ }) => $height || ($isBig ? 20 : 10)}px;
26
26
  `;
27
27
  const shineMove = keyframes`
28
28
  from {
@@ -68,6 +68,10 @@ export const StyledMotionProgressBarProgress = styled(motion.div)`
68
68
  theme,
69
69
  $color
70
70
  }) => $color ?? theme.headline};
71
+ border-radius: ${({
72
+ $height,
73
+ $isBig
74
+ }) => $height || ($isBig ? 20 : 10)}px;
71
75
  `;
72
76
  export const StyledProgressBarLabel = styled.div`
73
77
  font-size: 85%;
@@ -126,5 +130,6 @@ export const StyledProgressBarStep = styled.div`
126
130
  export const StyledProgressBarThumbLabel = styled.div`
127
131
  position: absolute;
128
132
  right: 0;
133
+ height: 100%;
129
134
  `;
130
135
  //# sourceMappingURL=ProgressBar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","keyframes","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$height","$isBig","shineMove","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n $height?: number;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n border-radius: ${({ $height, $isBig }) => ($isBig ? ($height ?? 20) : ($height ?? 10) / 5)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,EAAEC,SAAS,QAAQ,mBAAmB;AAG1D,OAAO,MAAMC,iBAAiB,GAAGH,MAAM,CAACI,GAAG;AAC3C;AACA,CAAC;AAID,OAAO,MAAMC,2BAA2B,GAAGL,MAAM,CAACI,GAAqC;AACvF;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAyC,CAAC,KACpEA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AAC9B,CAAC;AAOD,OAAO,MAAME,gCAAgC,GAAGR,MAAM,CAACI,GAA0C;AACjG;AACA;AACA;AACA,cAAc,CAAC;EAAEK,OAAO;EAAEC;AAAO,CAAC,KAAKD,OAAO,KAAKC,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC;AACpE,qBAAqB,CAAC;EAAED,O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BE,eAAe,IAAIlB,KAAK,CAAC,KAAK,CAAC,IAAIgB,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,4BAA4B,GAAGzB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMsB,qBAAqB,GAAG1B,MAAM,CAACI,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEqB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG5B,MAAM,CAACI,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","keyframes","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$height","$isBig","shineMove","StyledProgressBarShine","attrs","$delay","style","animationDelay","$speed","StyledMotionProgressBarProgress","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","StyledProgressBarStepWrapper","StyledProgressBarStep","$position","StyledProgressBarThumbLabel"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledProgressBar = styled.div`\n position: relative;\n`;\n\ntype StyledProgressBarBackgroundProps = WithTheme<{ $color?: string }>;\n\nexport const StyledProgressBarBackground = styled.div<StyledProgressBarBackgroundProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ theme, $color }: StyledProgressBarBackgroundProps) =>\n $color ?? theme['104']};\n`;\n\ntype StyledProgressBarProgressWrapperProps = WithTheme<{\n $isBig?: boolean;\n $height?: number;\n}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n border-radius: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n`;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n`;\n\nexport const StyledProgressBarShine = styled.div.attrs<{ $speed?: number; $delay?: number }>(\n ({ $delay }) => ({\n style: { animationDelay: `${$delay ?? 0}s` },\n }),\n)`\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 33%,\n rgba(255, 255, 255, 0.5) 50%,\n rgba(255, 255, 255, 0) 66%\n );\n transform: translateX(-150%);\n animation: ${shineMove} ${({ $speed = 5 }) => `${$speed}s`} linear infinite;\n opacity: 0.95;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }> & {\n $height?: number;\n $isBig?: boolean;\n};\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n z-index: 2;\n display: flex;\n align-items: center;\n padding-left: 12px;\n background-color: ${({ theme, $color }: StyledProgressBarProgressProps) =>\n $color ?? theme.headline};\n border-radius: ${({ $height, $isBig }) => $height || ($isBig ? 20 : 10)}px;\n`;\n\ntype StyledProgressBarLabelProps = WithTheme<{\n $shouldShowLabelInline?: boolean;\n $primaryColor?: string;\n $secondaryColor?: string;\n $colorSplitPosition?: number;\n}>;\n\nexport const StyledProgressBarLabel = styled.div<StyledProgressBarLabelProps>`\n font-size: 85%;\n color: ${({ theme, $shouldShowLabelInline }: StyledProgressBarLabelProps) =>\n $shouldShowLabelInline ? theme['100'] : theme.headline};\n white-space: nowrap;\n\n ${({ $colorSplitPosition, $primaryColor, $secondaryColor, theme }) =>\n $colorSplitPosition &&\n css`\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n\n padding-left: 8px;\n\n font-weight: bold;\n\n -webkit-background-clip: text;\n\n color: transparent;\n background-image: linear-gradient(\n 90deg,\n ${$primaryColor ?? theme['100']} ${$colorSplitPosition}%,\n ${$secondaryColor ?? theme['300']} ${$colorSplitPosition}%\n );\n `}\n`;\n\nexport const StyledProgressBarStepWrapper = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n`;\n\ntype StyledProgressBarStepProps = WithTheme<{\n $position: number;\n $color?: string;\n}>;\n\nexport const StyledProgressBarStep = styled.div<StyledProgressBarStepProps>`\n background-color: ${({ theme, $color }: StyledProgressBarStepProps) => $color ?? theme['102']};\n height: 100%;\n width: 2px;\n position: absolute;\n top: 0;\n left: ${({ $position }: StyledProgressBarStepProps) => $position}%;\n`;\n\nexport const StyledProgressBarThumbLabel = styled.div`\n position: absolute;\n right: 0;\n height: 100%;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,EAAEC,SAAS,QAAQ,mBAAmB;AAG1D,OAAO,MAAMC,iBAAiB,GAAGH,MAAM,CAACI,GAAG;AAC3C;AACA,CAAC;AAID,OAAO,MAAMC,2BAA2B,GAAGL,MAAM,CAACI,GAAqC;AACvF;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAyC,CAAC,KACpEA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AAC9B,CAAC;AAOD,OAAO,MAAME,gCAAgC,GAAGR,MAAM,CAACI,GAA0C;AACjG;AACA;AACA;AACA,cAAc,CAAC;EAAEK,OAAO;EAAEC;AAAO,CAAC,KAAKD,OAAO,KAAKC,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC;AACpE,qBAAqB,CAAC;EAAED,OAAO;EAAEC;AAAO,CAAC,KAAKD,OAAO,KAAKC,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC;AAC3E,CAAC;AAED,MAA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AIlB,KAAK,CAAC,KAAK,CAAC,IAAIgB,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,4BAA4B,GAAGzB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMsB,qBAAqB,GAAG1B,MAAM,CAACI,GAA+B;AAC3E,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEqB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG5B,MAAM,CAACI,GAAG;AACrD;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -7,6 +7,7 @@ interface Colors {
7
7
  stepColor?: string;
8
8
  primaryTextColor?: string;
9
9
  secondaryTextColor?: string;
10
+ thumbLabelColor?: string;
10
11
  }
11
12
  export type ProgressBarProps = {
12
13
  /**
@@ -9,15 +9,18 @@ type StyledProgressBarProgressWrapperProps = WithTheme<{
9
9
  $height?: number;
10
10
  }>;
11
11
  export declare const StyledProgressBarProgressWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProgressBarProgressWrapperProps>> & string;
12
- type StyledProgressBarProgressProps = WithTheme<{
13
- $color?: string;
14
- }>;
15
12
  export declare const StyledProgressBarShine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
13
  ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
17
14
  }>, {
18
15
  $speed?: number;
19
16
  $delay?: number;
20
17
  }>, never>> & string;
18
+ type StyledProgressBarProgressProps = WithTheme<{
19
+ $color?: string;
20
+ }> & {
21
+ $height?: number;
22
+ $isBig?: boolean;
23
+ };
21
24
  export declare const StyledMotionProgressBarProgress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
25
  ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
23
26
  }, StyledProgressBarProgressProps>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof React.Component<any, {}, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.28",
3
+ "version": "5.0.29",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "73767c299ffefdadd9a7aeace40f43fc0181fee7"
89
+ "gitHead": "6955eed6feaa62919964be9c1b1fc3982b7a03a1"
90
90
  }