@chayns-components/core 5.0.19 → 5.0.24

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.
@@ -16,7 +16,24 @@ const StyledGroupedImage = exports.StyledGroupedImage = _styledComponents.defaul
16
16
  $height
17
17
  }) => $height}px;
18
18
  `;
19
- const StyledGroupImageElement = exports.StyledGroupImageElement = _styledComponents.default.div`
19
+ const StyledGroupImageElement = exports.StyledGroupImageElement = _styledComponents.default.div.attrs(({
20
+ $isSecondImage,
21
+ $hasMultipleImages,
22
+ $hasCornerImage,
23
+ $uuid
24
+ }) => {
25
+ let clipPath;
26
+ if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
27
+ clipPath = `url(#care-of-mask--${$uuid})`;
28
+ } else if (!$isSecondImage && $hasMultipleImages) {
29
+ clipPath = `url(#second-image-mask--${$uuid})`;
30
+ }
31
+ return {
32
+ style: {
33
+ clipPath
34
+ }
35
+ };
36
+ })`
20
37
  aspect-ratio: 1;
21
38
  border-radius: ${({
22
39
  $shouldShowRoundImage
@@ -53,25 +70,6 @@ const StyledGroupImageElement = exports.StyledGroupImageElement = _styledCompone
53
70
  left: 0;
54
71
  `}
55
72
 
56
- ${({
57
- $isSecondImage,
58
- $hasMultipleImages,
59
- $hasCornerImage,
60
- $uuid
61
- }) => {
62
- if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
63
- return (0, _styledComponents.css)`
64
- clip-path: url(${`#care-of-mask--${$uuid}`});
65
- `;
66
- }
67
- if (!$isSecondImage && $hasMultipleImages) {
68
- return (0, _styledComponents.css)`
69
- clip-path: url(${`#second-image-mask--${$uuid}`});
70
- `;
71
- }
72
- return '';
73
- }}
74
-
75
73
  ${({
76
74
  $background,
77
75
  $shouldPreventBackground,
@@ -1 +1 @@
1
- {"version":3,"file":"GroupedImage.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledGroupedImage","exports","styled","div","$height","StyledGroupImageElement","$shouldShowRoundImage","$hasMultipleImages","$isSecondImage","css","$hasCornerImage","$uuid","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div<StyledImageProps>`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n return css`\n clip-path: url(${`#care-of-mask--${$uuid}`});\n `;\n }\n\n if (!$isSecondImage && $hasMultipleImages) {\n return css`\n clip-path: url(${`#second-image-mask--${$uuid}`});\n `;\n }\n\n return '';\n }}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,u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AO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAEM,MAAMG,mBAAmB,GAAAhB,OAAA,CAAAgB,mBAAA,GAAGf,yBAAM,CAACgB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"GroupedImage.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledGroupedImage","exports","styled","div","$height","StyledGroupImageElement","attrs","$isSecondImage","$hasMultipleImages","$hasCornerImage","$uuid","clipPath","style","$shouldShowRoundImage","css","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div.attrs<StyledImageProps>(\n ({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n let clipPath: string | undefined;\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n clipPath = `url(#care-of-mask--${$uuid})`;\n } else if (!$isSecondImage && $hasMultipleImages) {\n clipPath = `url(#second-image-mask--${$uuid})`;\n }\n\n return {\n style: {\n clipPath,\n },\n };\n },\n)`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAA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CAAC;AAQM,MAAMC,iBAAiB,GAAAjB,OAAA,CAAAiB,iBAAA,GAAGhB,yBAAM,CAACiB,GAA2B;AACnE;AACA;AACA,cAAc,CAAC;EAAEX;AAAmB,CAAC,KAAMA,kBAAkB,GAAG,KAAK,GAAG,KAAM;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEO,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzB,IAAAF,qBAAG;AACX,0BAA0BC,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAEM,MAAMG,mBAAmB,GAAAnB,OAAA,CAAAmB,mBAAA,GAAGlB,yBAAM,CAACmB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -4,92 +4,207 @@ 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");
11
+ var _popup = require("../../types/popup");
12
+ var _styledComponents = require("styled-components");
13
+ var _Popup = _interopRequireDefault(require("../popup/Popup"));
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
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); }
11
- const ProgressBar = ({
12
- percentage,
13
- label,
14
- shouldHideProgress = false,
15
- shouldShowLabelInline = false,
16
- steps,
17
- colors
18
- }) => {
19
- const [internalPercentage, setInternalPercentage] = (0, _react.useState)(0);
16
+ const ProgressBar = t0 => {
17
+ "use memo";
18
+
19
+ const $ = (0, _reactCompilerRuntime.c)(29);
20
+ const {
21
+ percentage,
22
+ label,
23
+ shouldHideProgress: t1,
24
+ shouldShowLabelInline: t2,
25
+ steps,
26
+ colors,
27
+ thumbLabel,
28
+ showShine: t3
29
+ } = t0;
30
+ const shouldHideProgress = t1 === undefined ? false : t1;
31
+ const shouldShowLabelInline = t2 === undefined ? false : t2;
32
+ const showShine = t3 === undefined ? false : t3;
20
33
  const uuid = (0, _uuid.useUuid)();
21
- (0, _react.useEffect)(() => {
22
- if (typeof percentage !== 'number') {
23
- return;
34
+ const popupRef = (0, _react.useRef)(null);
35
+ const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
36
+ let t4;
37
+ bb0: {
38
+ if (!showShine || percentage === undefined) {
39
+ t4 = null;
40
+ break bb0;
24
41
  }
25
- if (percentage >= 0 && percentage <= 100) {
26
- setInternalPercentage(percentage);
42
+ const shineCount = Math.ceil(6 * (percentage / 100));
43
+ const speed = 5 * (percentage / 100);
44
+ let t5;
45
+ if ($[0] !== shineCount) {
46
+ t5 = Array.from({
47
+ length: shineCount
48
+ });
49
+ $[0] = shineCount;
50
+ $[1] = t5;
51
+ } else {
52
+ t5 = $[1];
27
53
  }
28
- }, [percentage]);
29
- const progressBar = (0, _react.useMemo)(() => {
30
- if (shouldHideProgress) {
31
- return null;
54
+ let t6;
55
+ if ($[2] !== shineCount || $[3] !== speed || $[4] !== t5) {
56
+ t6 = t5.map((_, index) => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarShine, {
57
+ key: `progress-bar-shine__${shineCount}__${index}`,
58
+ $speed: speed,
59
+ $delay: 5 / shineCount * index
60
+ }));
61
+ $[2] = shineCount;
62
+ $[3] = speed;
63
+ $[4] = t5;
64
+ $[5] = t6;
65
+ } else {
66
+ t6 = $[5];
32
67
  }
33
- if (typeof percentage !== 'number') {
34
- return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
35
- key: `progress-bar-loop__${uuid}`,
68
+ t4 = t6;
69
+ }
70
+ const shineEffect = t4;
71
+ let t5;
72
+ if ($[6] !== (colors === null || colors === void 0 ? void 0 : colors.backgroundColor) || $[7] !== (colors === null || colors === void 0 ? void 0 : colors.primaryTextColor) || $[8] !== (colors === null || colors === void 0 ? void 0 : colors.progressColor) || $[9] !== (colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor) || $[10] !== (colors === null || colors === void 0 ? void 0 : colors.stepColor) || $[11] !== label || $[12] !== percentage || $[13] !== shineEffect || $[14] !== shouldHideProgress || $[15] !== shouldShowLabelInline || $[16] !== showShine || $[17] !== steps || $[18] !== theme || $[19] !== thumbLabel || $[20] !== uuid) {
73
+ colors === null || colors === void 0 || colors.backgroundColor;
74
+ colors === null || colors === void 0 || colors.primaryTextColor;
75
+ colors === null || colors === void 0 || colors.progressColor;
76
+ colors === null || colors === void 0 || colors.secondaryTextColor;
77
+ colors === null || colors === void 0 || colors.stepColor;
78
+ t5 = (() => {
79
+ if (shouldHideProgress) {
80
+ return null;
81
+ }
82
+ if (percentage === undefined) {
83
+ return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, null, /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
84
+ key: `progress-bar-loop__${uuid}`,
85
+ $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
86
+ initial: {
87
+ width: "200px",
88
+ left: "-200px"
89
+ },
90
+ animate: {
91
+ width: "200px",
92
+ left: "100%"
93
+ },
94
+ exit: {
95
+ width: "200px",
96
+ left: "100%"
97
+ },
98
+ transition: {
99
+ type: "tween",
100
+ repeat: Infinity,
101
+ repeatDelay: 0,
102
+ duration: 1
103
+ }
104
+ }), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
105
+ $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
106
+ }));
107
+ }
108
+ return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, {
109
+ $isBig: shouldShowLabelInline
110
+ }, !!(steps !== null && steps !== void 0 && steps.length) && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStep, {
111
+ $position: step,
112
+ key: `progress-step-${step}`,
113
+ $color: colors === null || colors === void 0 ? void 0 : colors.stepColor
114
+ }))), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
36
115
  $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
116
+ key: `progress-bar__${uuid}`,
37
117
  initial: {
38
- width: '200px',
39
- left: '-200px'
118
+ width: "0%"
40
119
  },
41
120
  animate: {
42
- width: '200px',
43
- left: '100%'
121
+ width: `${percentage}%`
44
122
  },
45
123
  exit: {
46
- width: '200px',
47
- left: '100%'
124
+ width: "0%"
48
125
  },
49
126
  transition: {
50
- type: 'tween',
51
- repeat: Infinity,
52
- repeatDelay: 0,
53
- duration: 1
127
+ type: "tween"
128
+ },
129
+ onUpdate: () => {
130
+ var _popupRef$current;
131
+ return (_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 ? void 0 : _popupRef$current.show();
132
+ },
133
+ onAnimationComplete: () => {
134
+ var _popupRef$current2;
135
+ return (_popupRef$current2 = popupRef.current) === null || _popupRef$current2 === void 0 ? void 0 : _popupRef$current2.show();
136
+ }
137
+ }, showShine && shineEffect, thumbLabel && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarThumbLabel, {
138
+ onClick: _temp
139
+ }, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
140
+ theme: {
141
+ "000": (colors === null || colors === void 0 ? void 0 : colors.backgroundColor) ?? (theme === null || theme === void 0 ? void 0 : theme["104"]),
142
+ text: (colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor) ?? (theme === null || theme === void 0 ? void 0 : theme["300"])
143
+ }
144
+ }, /*#__PURE__*/_react.default.createElement(_Popup.default, {
145
+ ref: popupRef,
146
+ content: thumbLabel,
147
+ alignment: _popup.PopupAlignment.TopCenter,
148
+ onHide: () => {
149
+ var _popupRef$current3;
150
+ return (_popupRef$current3 = popupRef.current) === null || _popupRef$current3 === void 0 ? void 0 : _popupRef$current3.show();
54
151
  }
55
- }), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
152
+ })))), shouldShowLabelInline && label && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
153
+ $shouldShowLabelInline: shouldShowLabelInline,
154
+ $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor,
155
+ $secondaryColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
156
+ $colorSplitPosition: percentage
157
+ }, label), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
56
158
  $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
57
159
  }));
58
- }
59
- return /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarProgressWrapper, {
60
- $isBig: shouldShowLabelInline
61
- }, !!(steps !== null && steps !== void 0 && steps.length) && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarStep, {
62
- $position: step,
63
- key: `progress-step-${step}`,
64
- $color: colors === null || colors === void 0 ? void 0 : colors.stepColor
65
- }))), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledMotionProgressBarProgress, {
66
- $color: colors === null || colors === void 0 ? void 0 : colors.progressColor,
67
- key: `progress-bar__${uuid}`,
68
- initial: {
69
- width: '0%'
70
- },
71
- animate: {
72
- width: `${internalPercentage}%`
73
- },
74
- exit: {
75
- width: '0%'
76
- },
77
- transition: {
78
- type: 'tween'
79
- }
80
- }), shouldShowLabelInline && label && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
81
- $shouldShowLabelInline: shouldShowLabelInline,
82
- $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor,
83
- $secondaryColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
84
- $colorSplitPosition: internalPercentage
85
- }, label), /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarBackground, {
86
- $color: colors === null || colors === void 0 ? void 0 : colors.backgroundColor
87
- }));
88
- }, [colors, internalPercentage, label, percentage, shouldHideProgress, shouldShowLabelInline, steps, uuid]);
89
- return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBar, null, progressBar, label && !shouldShowLabelInline && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
90
- $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor
91
- }, label)), [progressBar, label, shouldShowLabelInline, colors === null || colors === void 0 ? void 0 : colors.primaryTextColor, colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor]);
160
+ })();
161
+ $[6] = colors === null || colors === void 0 ? void 0 : colors.backgroundColor;
162
+ $[7] = colors === null || colors === void 0 ? void 0 : colors.primaryTextColor;
163
+ $[8] = colors === null || colors === void 0 ? void 0 : colors.progressColor;
164
+ $[9] = colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor;
165
+ $[10] = colors === null || colors === void 0 ? void 0 : colors.stepColor;
166
+ $[11] = label;
167
+ $[12] = percentage;
168
+ $[13] = shineEffect;
169
+ $[14] = shouldHideProgress;
170
+ $[15] = shouldShowLabelInline;
171
+ $[16] = showShine;
172
+ $[17] = steps;
173
+ $[18] = theme;
174
+ $[19] = thumbLabel;
175
+ $[20] = uuid;
176
+ $[21] = t5;
177
+ } else {
178
+ t5 = $[21];
179
+ }
180
+ const progressBar = t5;
181
+ colors === null || colors === void 0 || colors.primaryTextColor;
182
+ let t6;
183
+ if ($[22] !== (colors === null || colors === void 0 ? void 0 : colors.primaryTextColor) || $[23] !== label || $[24] !== shouldShowLabelInline) {
184
+ t6 = label && !shouldShowLabelInline && /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBarLabel, {
185
+ $primaryColor: colors === null || colors === void 0 ? void 0 : colors.primaryTextColor
186
+ }, label);
187
+ $[22] = colors === null || colors === void 0 ? void 0 : colors.primaryTextColor;
188
+ $[23] = label;
189
+ $[24] = shouldShowLabelInline;
190
+ $[25] = t6;
191
+ } else {
192
+ t6 = $[25];
193
+ }
194
+ let t7;
195
+ if ($[26] !== progressBar || $[27] !== t6) {
196
+ t7 = /*#__PURE__*/_react.default.createElement(_ProgressBar.StyledProgressBar, null, progressBar, t6);
197
+ $[26] = progressBar;
198
+ $[27] = t6;
199
+ $[28] = t7;
200
+ } else {
201
+ t7 = $[28];
202
+ }
203
+ return t7;
92
204
  };
93
205
  ProgressBar.displayName = 'ProgressBar';
94
206
  var _default = exports.default = ProgressBar;
207
+ function _temp(event) {
208
+ return event.stopPropagation();
209
+ }
95
210
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":["_react","_interopRequireWildcard","require","_uuid","_ProgressBar","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProgressBar","percentage","label","shouldHideProgress","shouldShowLabelInline","steps","colors","internalPercentage","setInternalPercentage","useState","uuid","useUuid","useEffect","progressBar","useMemo","createElement","StyledProgressBarProgressWrapper","StyledMotionProgressBarProgress","key","$color","progressColor","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","StyledProgressBarBackground","backgroundColor","$isBig","length","StyledProgressBarStepWrapper","map","step","StyledProgressBarStep","$position","stepColor","StyledProgressBarLabel","$shouldShowLabelInline","$primaryColor","primaryTextColor","$secondaryColor","secondaryTextColor","$colorSplitPosition","StyledProgressBar","displayName","_default","exports"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n} from './ProgressBar.styles';\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\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n}) => {\n const [internalPercentage, setInternalPercentage] = useState(0);\n const uuid = useUuid();\n\n useEffect(() => {\n if (typeof percentage !== 'number') {\n return;\n }\n\n if (percentage >= 0 && percentage <= 100) {\n setInternalPercentage(percentage);\n }\n }, [percentage]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (typeof percentage !== 'number') {\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 <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline}>\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: `${internalPercentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n />\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={internalPercentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }, [\n colors,\n internalPercentage,\n label,\n percentage,\n shouldHideProgress,\n shouldShowLabelInline,\n steps,\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 [\n progressBar,\n label,\n shouldShowLabel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AAEvC,qBAAsB;MAC9CwC,aAAa,EAAEtC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEuC,gBAAiB;MACxCC,eAAe,EAAExC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEyC,kBAAmB;MAC5CC,mBAAmB,EAAEzC;IAAmB,GAEvCL,KACmB,CAC3B,eACD1B,MAAA,CAAAe,OAAA,CAAAwB,aAAA,CAACnC,YAAA,CAAAoD,2BAA2B;MAACb,MAAM,EAAEb,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE2B;IAAgB,CAAE,CACjC,CAAC;EAE3C,CAAC,EAAE,CACC3B,MAAM,EACNC,kBAAkB,EAClBL,KAAK,EACLD,UAAU,EACVE,kBAAkB,EAClBC,qBAAqB,EACrBC,KAAK,EACLK,IAAI,CACP,CAAC;EAEF,OAAO,IAAAI,cAAO,EACV,mBACItC,MAAA,CAAAe,OAAA,CAAAwB,aAAA,CAACnC,YAAA,CAAAqE,iBAAiB,QACbpC,WAAW,EACXX,KAAK,IAAI,CAACE,qBAAqB,iBAC5B5B,MAAA,CAAAe,OAAA,CAAAwB,aAAA,CAACnC,YAAA,CAAA8D,sBAAsB;IAACE,aAAa,EAAEtC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEuC;EAAiB,GAC3D3C,KACmB,CAEb,CACtB,EACD,CACIW,WAAW,EACXX,KAAK,EACLE,qBAAqB,EACrBE,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEuC,gBAAgB,EACxBvC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEyC,kBAAkB,CAElC,CAAC;AACL,CAAC;AAED/C,WAAW,CAACkD,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7D,OAAA,GAEzBS,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","undefined","uuid","useUuid","popupRef","useRef","theme","useContext","ThemeContext","t4","bb0","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","StyledProgressBarShine","key","$delay","shineEffect","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","StyledProgressBarProgressWrapper","StyledMotionProgressBarProgress","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","StyledProgressBarBackground","StyledProgressBarStepWrapper","step","StyledProgressBarStep","onUpdate","_popupRef$current","current","show","onAnimationComplete","_popupRef$current2","StyledProgressBarThumbLabel","onClick","_temp","ThemeProvider","text","alignment","PopupAlignment","TopCenter","onHide","_popupRef$current3","StyledProgressBarLabel","$primaryColor","$secondaryColor","progressBar","t7","StyledProgressBar","displayName","_default","exports","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useMemo, useRef } 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\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const popupRef = useRef<PopupRef | 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 FULL_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * (percentage / 100));\n const speed = FULL_ANIMATION_LENGTH * (percentage / 100);\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={(FULL_ANIMATION_LENGTH / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\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 <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline}>\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 onClick={(event) => event.stopPropagation()}>\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 >\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 );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\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,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CA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AAA0E,MAAAiB,KAAA;EAAA,OAqF+BA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledProgressBarStepWrapper = exports.StyledProgressBarStep = exports.StyledProgressBarProgressWrapper = exports.StyledProgressBarLabel = exports.StyledProgressBarBackground = exports.StyledProgressBar = exports.StyledMotionProgressBarProgress = void 0;
6
+ exports.StyledProgressBarThumbLabel = exports.StyledProgressBarStepWrapper = exports.StyledProgressBarStep = exports.StyledProgressBarShine = exports.StyledProgressBarProgressWrapper = exports.StyledProgressBarLabel = exports.StyledProgressBarBackground = exports.StyledProgressBar = exports.StyledMotionProgressBarProgress = void 0;
7
7
  var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  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); }
@@ -29,11 +29,42 @@ const StyledProgressBarProgressWrapper = exports.StyledProgressBarProgressWrappe
29
29
  $isBig
30
30
  }) => $isBig ? 20 : 2}px;
31
31
  `;
32
+ const shineMove = (0, _styledComponents.keyframes)`
33
+ from {
34
+ transform: translateX(-150%);
35
+ }
36
+ to {
37
+ transform: translateX(150%);
38
+ }
39
+ `;
40
+ const StyledProgressBarShine = exports.StyledProgressBarShine = _styledComponents.default.div.attrs(({
41
+ $delay
42
+ }) => ({
43
+ style: {
44
+ animationDelay: `${$delay ?? 0}s`
45
+ }
46
+ }))`
47
+ position: absolute;
48
+ width: 100%;
49
+ height: 100%;
50
+ background: linear-gradient(
51
+ 90deg,
52
+ rgba(255, 255, 255, 0) 33%,
53
+ rgba(255, 255, 255, 0.5) 50%,
54
+ rgba(255, 255, 255, 0) 66%
55
+ );
56
+ transform: translateX(-150%);
57
+ animation: ${shineMove} ${({
58
+ $speed = 5
59
+ }) => `${$speed}s`} linear infinite;
60
+ opacity: 0.95;
61
+ `;
32
62
  const StyledMotionProgressBarProgress = exports.StyledMotionProgressBarProgress = (0, _styledComponents.default)(_react.motion.div)`
33
63
  height: 100%;
34
64
  position: absolute;
35
65
  top: 0;
36
66
  left: 0;
67
+ overflow: hidden;
37
68
  z-index: 2;
38
69
  display: flex;
39
70
  align-items: center;
@@ -97,4 +128,8 @@ const StyledProgressBarStep = exports.StyledProgressBarStep = _styledComponents.
97
128
  $position
98
129
  }) => $position}%;
99
130
  `;
131
+ const StyledProgressBarThumbLabel = exports.StyledProgressBarThumbLabel = _styledComponents.default.div`
132
+ position: absolute;
133
+ right: 0;
134
+ `;
100
135
  //# 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","$isBig","StyledMotionProgressBarProgress","motion","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","css","StyledProgressBarStepWrapper","StyledProgressBarStep","$position"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } 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}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $isBig }) => ($isBig ? 20 : 10)}px;\n border-radius: ${({ $isBig }) => ($isBig ? 20 : 2)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\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"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,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,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBF,aAAa,IAAIV,KAAK,CAAC,KAAK,CAAC,IAAIS,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIX,KAAK,CAAC,KAAK,CAAC,IAAIS,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAEM,MAAMI,4BAA4B,GAAAjB,OAAA,CAAAiB,4BAAA,GAAGhB,yBAAM,CAACC,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOM,MAAMgB,qBAAqB,GAAAlB,OAAA,CAAAkB,qBAAA,GAAGjB,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;EAAEe;AAAsC,CAAC,KAAKA,SAAS;AACpE,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","$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}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $isBig }) => ($isBig ? 20 : 10)}px;\n border-radius: ${({ $isBig }) => ($isBig ? 20 : 2)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-150%);\n }\n to {\n transform: translateX(150%);\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,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,G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AC;AAOM,MAAMwB,qBAAqB,GAAA1B,OAAA,CAAA0B,qBAAA,GAAGzB,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;EAAEuB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAEM,MAAMC,2BAA2B,GAAA5B,OAAA,CAAA4B,2BAAA,GAAG3B,yBAAM,CAACC,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
@@ -9,7 +9,24 @@ export const StyledGroupedImage = styled.div`
9
9
  $height
10
10
  }) => $height}px;
11
11
  `;
12
- export const StyledGroupImageElement = styled.div`
12
+ export const StyledGroupImageElement = styled.div.attrs(({
13
+ $isSecondImage,
14
+ $hasMultipleImages,
15
+ $hasCornerImage,
16
+ $uuid
17
+ }) => {
18
+ let clipPath;
19
+ if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
20
+ clipPath = `url(#care-of-mask--${$uuid})`;
21
+ } else if (!$isSecondImage && $hasMultipleImages) {
22
+ clipPath = `url(#second-image-mask--${$uuid})`;
23
+ }
24
+ return {
25
+ style: {
26
+ clipPath
27
+ }
28
+ };
29
+ })`
13
30
  aspect-ratio: 1;
14
31
  border-radius: ${({
15
32
  $shouldShowRoundImage
@@ -46,25 +63,6 @@ export const StyledGroupImageElement = styled.div`
46
63
  left: 0;
47
64
  `}
48
65
 
49
- ${({
50
- $isSecondImage,
51
- $hasMultipleImages,
52
- $hasCornerImage,
53
- $uuid
54
- }) => {
55
- if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
56
- return css`
57
- clip-path: url(${`#care-of-mask--${$uuid}`});
58
- `;
59
- }
60
- if (!$isSecondImage && $hasMultipleImages) {
61
- return css`
62
- clip-path: url(${`#second-image-mask--${$uuid}`});
63
- `;
64
- }
65
- return '';
66
- }}
67
-
68
66
  ${({
69
67
  $background,
70
68
  $shouldPreventBackground,
@@ -1 +1 @@
1
- {"version":3,"file":"GroupedImage.styles.js","names":["styled","css","StyledGroupedImage","div","$height","StyledGroupImageElement","$shouldShowRoundImage","$hasMultipleImages","$isSecondImage","$hasCornerImage","$uuid","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div<StyledImageProps>`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n return css`\n clip-path: url(${`#care-of-mask--${$uuid}`});\n `;\n }\n\n if (!$isSecondImage && $hasMultipleImages) {\n return css`\n clip-path: url(${`#second-image-mask--${$uuid}`});\n `;\n }\n\n return '';\n }}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAA4B;AACrE;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC;AACA,aAAa,CAAC;EAAEA;AAAQ,CAAC,KAAKA,OAAO;AACrC,CAAC;AAYD,OAAO,MAAMC,uBAAuB,GAAGL,MAAM,CAACG,GAAqB;AACnE;AACA,qBAAqB,CAAC;EAAEG;AAAsB,CAA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M;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEI,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBX,GAAG;AACX,0BAA0BU,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,mBAAmB,GAAGhB,MAAM,CAACiB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"GroupedImage.styles.js","names":["styled","css","StyledGroupedImage","div","$height","StyledGroupImageElement","attrs","$isSecondImage","$hasMultipleImages","$hasCornerImage","$uuid","clipPath","style","$shouldShowRoundImage","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div.attrs<StyledImageProps>(\n ({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n let clipPath: string | undefined;\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n clipPath = `url(#care-of-mask--${$uuid})`;\n } else if (!$isSecondImage && $hasMultipleImages) {\n clipPath = `url(#second-image-mask--${$uuid})`;\n }\n\n return {\n style: {\n clipPath,\n },\n };\n },\n)`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block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EC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBd,GAAG;AACX,0BAA0Ba,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAQD,OAAO,MAAMC,iBAAiB,GAAGjB,MAAM,CAACkB,GAA2B;AACnE;AACA;AACA,cAAc,CAAC;EAAEV;AAAmB,CAAC,KAAMA,kBAAkB,GAAG,KAAK,GAAG,KAAM;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEM,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBd,GAAG;AACX,0BAA0Ba,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,mBAAmB,GAAGnB,MAAM,CAACoB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,88 +1,193 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
1
+ import { c as _c } from "react-compiler-runtime";
2
+ import React, { useContext, useMemo, useRef } from 'react';
2
3
  import { useUuid } from '../../hooks/uuid';
3
- import { StyledMotionProgressBarProgress, StyledProgressBar, StyledProgressBarBackground, StyledProgressBarLabel, StyledProgressBarProgressWrapper, StyledProgressBarStep, StyledProgressBarStepWrapper } from './ProgressBar.styles';
4
- const ProgressBar = ({
5
- percentage,
6
- label,
7
- shouldHideProgress = false,
8
- shouldShowLabelInline = false,
9
- steps,
10
- colors
11
- }) => {
12
- const [internalPercentage, setInternalPercentage] = useState(0);
4
+ import { StyledMotionProgressBarProgress, StyledProgressBar, StyledProgressBarBackground, StyledProgressBarLabel, StyledProgressBarProgressWrapper, StyledProgressBarShine, StyledProgressBarStep, StyledProgressBarStepWrapper, StyledProgressBarThumbLabel } from './ProgressBar.styles';
5
+ import { PopupAlignment } from '../../types/popup';
6
+ import { ThemeContext, ThemeProvider } from 'styled-components';
7
+ import Popup from '../popup/Popup';
8
+ const ProgressBar = t0 => {
9
+ "use memo";
10
+
11
+ const $ = _c(29);
12
+ const {
13
+ percentage,
14
+ label,
15
+ shouldHideProgress: t1,
16
+ shouldShowLabelInline: t2,
17
+ steps,
18
+ colors,
19
+ thumbLabel,
20
+ showShine: t3
21
+ } = t0;
22
+ const shouldHideProgress = t1 === undefined ? false : t1;
23
+ const shouldShowLabelInline = t2 === undefined ? false : t2;
24
+ const showShine = t3 === undefined ? false : t3;
13
25
  const uuid = useUuid();
14
- useEffect(() => {
15
- if (typeof percentage !== 'number') {
16
- return;
26
+ const popupRef = useRef(null);
27
+ const theme = useContext(ThemeContext);
28
+ let t4;
29
+ bb0: {
30
+ if (!showShine || percentage === undefined) {
31
+ t4 = null;
32
+ break bb0;
17
33
  }
18
- if (percentage >= 0 && percentage <= 100) {
19
- setInternalPercentage(percentage);
34
+ const shineCount = Math.ceil(6 * (percentage / 100));
35
+ const speed = 5 * (percentage / 100);
36
+ let t5;
37
+ if ($[0] !== shineCount) {
38
+ t5 = Array.from({
39
+ length: shineCount
40
+ });
41
+ $[0] = shineCount;
42
+ $[1] = t5;
43
+ } else {
44
+ t5 = $[1];
20
45
  }
21
- }, [percentage]);
22
- const progressBar = useMemo(() => {
23
- if (shouldHideProgress) {
24
- return null;
46
+ let t6;
47
+ if ($[2] !== shineCount || $[3] !== speed || $[4] !== t5) {
48
+ t6 = t5.map((_, index) => /*#__PURE__*/React.createElement(StyledProgressBarShine, {
49
+ key: `progress-bar-shine__${shineCount}__${index}`,
50
+ $speed: speed,
51
+ $delay: 5 / shineCount * index
52
+ }));
53
+ $[2] = shineCount;
54
+ $[3] = speed;
55
+ $[4] = t5;
56
+ $[5] = t6;
57
+ } else {
58
+ t6 = $[5];
25
59
  }
26
- if (typeof percentage !== 'number') {
27
- return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, null, /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
28
- key: `progress-bar-loop__${uuid}`,
60
+ t4 = t6;
61
+ }
62
+ const shineEffect = t4;
63
+ let t5;
64
+ if ($[6] !== colors?.backgroundColor || $[7] !== colors?.primaryTextColor || $[8] !== colors?.progressColor || $[9] !== colors?.secondaryTextColor || $[10] !== colors?.stepColor || $[11] !== label || $[12] !== percentage || $[13] !== shineEffect || $[14] !== shouldHideProgress || $[15] !== shouldShowLabelInline || $[16] !== showShine || $[17] !== steps || $[18] !== theme || $[19] !== thumbLabel || $[20] !== uuid) {
65
+ colors?.backgroundColor;
66
+ colors?.primaryTextColor;
67
+ colors?.progressColor;
68
+ colors?.secondaryTextColor;
69
+ colors?.stepColor;
70
+ t5 = (() => {
71
+ if (shouldHideProgress) {
72
+ return null;
73
+ }
74
+ if (percentage === undefined) {
75
+ return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, null, /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
76
+ key: `progress-bar-loop__${uuid}`,
77
+ $color: colors?.progressColor,
78
+ initial: {
79
+ width: "200px",
80
+ left: "-200px"
81
+ },
82
+ animate: {
83
+ width: "200px",
84
+ left: "100%"
85
+ },
86
+ exit: {
87
+ width: "200px",
88
+ left: "100%"
89
+ },
90
+ transition: {
91
+ type: "tween",
92
+ repeat: Infinity,
93
+ repeatDelay: 0,
94
+ duration: 1
95
+ }
96
+ }), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
97
+ $color: colors?.backgroundColor
98
+ }));
99
+ }
100
+ return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, {
101
+ $isBig: shouldShowLabelInline
102
+ }, !!steps?.length && /*#__PURE__*/React.createElement(StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/React.createElement(StyledProgressBarStep, {
103
+ $position: step,
104
+ key: `progress-step-${step}`,
105
+ $color: colors?.stepColor
106
+ }))), /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
29
107
  $color: colors?.progressColor,
108
+ key: `progress-bar__${uuid}`,
30
109
  initial: {
31
- width: '200px',
32
- left: '-200px'
110
+ width: "0%"
33
111
  },
34
112
  animate: {
35
- width: '200px',
36
- left: '100%'
113
+ width: `${percentage}%`
37
114
  },
38
115
  exit: {
39
- width: '200px',
40
- left: '100%'
116
+ width: "0%"
41
117
  },
42
118
  transition: {
43
- type: 'tween',
44
- repeat: Infinity,
45
- repeatDelay: 0,
46
- duration: 1
119
+ type: "tween"
120
+ },
121
+ onUpdate: () => popupRef.current?.show(),
122
+ onAnimationComplete: () => popupRef.current?.show()
123
+ }, showShine && shineEffect, thumbLabel && /*#__PURE__*/React.createElement(StyledProgressBarThumbLabel, {
124
+ onClick: _temp
125
+ }, /*#__PURE__*/React.createElement(ThemeProvider, {
126
+ theme: {
127
+ "000": colors?.backgroundColor ?? theme?.["104"],
128
+ text: colors?.secondaryTextColor ?? theme?.["300"]
47
129
  }
48
- }), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
130
+ }, /*#__PURE__*/React.createElement(Popup, {
131
+ ref: popupRef,
132
+ content: thumbLabel,
133
+ alignment: PopupAlignment.TopCenter,
134
+ onHide: () => popupRef.current?.show()
135
+ })))), shouldShowLabelInline && label && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
136
+ $shouldShowLabelInline: shouldShowLabelInline,
137
+ $primaryColor: colors?.primaryTextColor,
138
+ $secondaryColor: colors?.secondaryTextColor,
139
+ $colorSplitPosition: percentage
140
+ }, label), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
49
141
  $color: colors?.backgroundColor
50
142
  }));
51
- }
52
- return /*#__PURE__*/React.createElement(StyledProgressBarProgressWrapper, {
53
- $isBig: shouldShowLabelInline
54
- }, !!steps?.length && /*#__PURE__*/React.createElement(StyledProgressBarStepWrapper, null, steps.map(step => /*#__PURE__*/React.createElement(StyledProgressBarStep, {
55
- $position: step,
56
- key: `progress-step-${step}`,
57
- $color: colors?.stepColor
58
- }))), /*#__PURE__*/React.createElement(StyledMotionProgressBarProgress, {
59
- $color: colors?.progressColor,
60
- key: `progress-bar__${uuid}`,
61
- initial: {
62
- width: '0%'
63
- },
64
- animate: {
65
- width: `${internalPercentage}%`
66
- },
67
- exit: {
68
- width: '0%'
69
- },
70
- transition: {
71
- type: 'tween'
72
- }
73
- }), shouldShowLabelInline && label && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
74
- $shouldShowLabelInline: shouldShowLabelInline,
75
- $primaryColor: colors?.primaryTextColor,
76
- $secondaryColor: colors?.secondaryTextColor,
77
- $colorSplitPosition: internalPercentage
78
- }, label), /*#__PURE__*/React.createElement(StyledProgressBarBackground, {
79
- $color: colors?.backgroundColor
80
- }));
81
- }, [colors, internalPercentage, label, percentage, shouldHideProgress, shouldShowLabelInline, steps, uuid]);
82
- return useMemo(() => /*#__PURE__*/React.createElement(StyledProgressBar, null, progressBar, label && !shouldShowLabelInline && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
83
- $primaryColor: colors?.primaryTextColor
84
- }, label)), [progressBar, label, shouldShowLabelInline, colors?.primaryTextColor, colors?.secondaryTextColor]);
143
+ })();
144
+ $[6] = colors?.backgroundColor;
145
+ $[7] = colors?.primaryTextColor;
146
+ $[8] = colors?.progressColor;
147
+ $[9] = colors?.secondaryTextColor;
148
+ $[10] = colors?.stepColor;
149
+ $[11] = label;
150
+ $[12] = percentage;
151
+ $[13] = shineEffect;
152
+ $[14] = shouldHideProgress;
153
+ $[15] = shouldShowLabelInline;
154
+ $[16] = showShine;
155
+ $[17] = steps;
156
+ $[18] = theme;
157
+ $[19] = thumbLabel;
158
+ $[20] = uuid;
159
+ $[21] = t5;
160
+ } else {
161
+ t5 = $[21];
162
+ }
163
+ const progressBar = t5;
164
+ colors?.primaryTextColor;
165
+ let t6;
166
+ if ($[22] !== colors?.primaryTextColor || $[23] !== label || $[24] !== shouldShowLabelInline) {
167
+ t6 = label && !shouldShowLabelInline && /*#__PURE__*/React.createElement(StyledProgressBarLabel, {
168
+ $primaryColor: colors?.primaryTextColor
169
+ }, label);
170
+ $[22] = colors?.primaryTextColor;
171
+ $[23] = label;
172
+ $[24] = shouldShowLabelInline;
173
+ $[25] = t6;
174
+ } else {
175
+ t6 = $[25];
176
+ }
177
+ let t7;
178
+ if ($[26] !== progressBar || $[27] !== t6) {
179
+ t7 = /*#__PURE__*/React.createElement(StyledProgressBar, null, progressBar, t6);
180
+ $[26] = progressBar;
181
+ $[27] = t6;
182
+ $[28] = t7;
183
+ } else {
184
+ t7 = $[28];
185
+ }
186
+ return t7;
85
187
  };
86
188
  ProgressBar.displayName = 'ProgressBar';
87
189
  export default ProgressBar;
190
+ function _temp(event) {
191
+ return event.stopPropagation();
192
+ }
88
193
  //# sourceMappingURL=ProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":["React","useEffect","useMemo","useState","useUuid","StyledMotionProgressBarProgress","StyledProgressBar","StyledProgressBarBackground","StyledProgressBarLabel","StyledProgressBarProgressWrapper","StyledProgressBarStep","StyledProgressBarStepWrapper","ProgressBar","percentage","label","shouldHideProgress","shouldShowLabelInline","steps","colors","internalPercentage","setInternalPercentage","uuid","progressBar","createElement","key","$color","progressColor","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","backgroundColor","$isBig","length","map","step","$position","stepColor","$shouldShowLabelInline","$primaryColor","primaryTextColor","$secondaryColor","secondaryTextColor","$colorSplitPosition","displayName"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useState } from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport {\n StyledMotionProgressBarProgress,\n StyledProgressBar,\n StyledProgressBarBackground,\n StyledProgressBarLabel,\n StyledProgressBarProgressWrapper,\n StyledProgressBarStep,\n StyledProgressBarStepWrapper,\n} from './ProgressBar.styles';\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\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n}) => {\n const [internalPercentage, setInternalPercentage] = useState(0);\n const uuid = useUuid();\n\n useEffect(() => {\n if (typeof percentage !== 'number') {\n return;\n }\n\n if (percentage >= 0 && percentage <= 100) {\n setInternalPercentage(percentage);\n }\n }, [percentage]);\n\n const progressBar = useMemo(() => {\n if (shouldHideProgress) {\n return null;\n }\n\n if (typeof percentage !== 'number') {\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 <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline}>\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: `${internalPercentage}%` }}\n exit={{ width: '0%' }}\n transition={{ type: 'tween' }}\n />\n {shouldShowLabelInline && label && (\n <StyledProgressBarLabel\n $shouldShowLabelInline={shouldShowLabelInline}\n $primaryColor={colors?.primaryTextColor}\n $secondaryColor={colors?.secondaryTextColor}\n $colorSplitPosition={internalPercentage}\n >\n {label}\n </StyledProgressBarLabel>\n )}\n <StyledProgressBarBackground $color={colors?.backgroundColor} />\n </StyledProgressBarProgressWrapper>\n );\n }, [\n colors,\n internalPercentage,\n label,\n percentage,\n shouldHideProgress,\n shouldShowLabelInline,\n steps,\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 [\n progressBar,\n label,\n shouldShowLabelInline,\n colors?.primaryTextColor,\n colors?.secondaryTextColor,\n ],\n );\n};\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SACIC,+BAA+B,EAC/BC,iBAAiB,EACjBC,2BAA2B,EAC3BC,sBAAsB,EACtBC,gCAAgC,EAChCC,qBAAqB,EACrBC,4BAA4B,QACzB,sBAAsB;AA2C7B,MAAMC,WAAiC,GAAGA,CAAC;EACvCC,UAAU;EACVC,KAAK;EACLC,kBAA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AAI,CACP,CAAC;EAEF,OAAOnB,OAAO,CACV,mBACIF,KAAA,CAAAuB,aAAA,CAACjB,iBAAiB,QACbgB,WAAW,EACXR,KAAK,IAAI,CAACE,qBAAqB,iBAC5BhB,KAAA,CAAAuB,aAAA,CAACf,sBAAsB;IAACsC,aAAa,EAAE5B,MAAM,EAAE6B;EAAiB,GAC3DjC,KACmB,CAEb,CACtB,EACD,CACIQ,WAAW,EACXR,KAAK,EACLE,qBAAqB,EACrBE,MAAM,EAAE6B,gBAAgB,EACxB7B,MAAM,EAAE+B,kBAAkB,CAElC,CAAC;AACL,CAAC;AAEDrC,WAAW,CAACuC,WAAW,GAAG,aAAa;AAEvC,eAAevC,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.js","names":["React","useContext","useMemo","useRef","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","undefined","uuid","popupRef","theme","t4","bb0","shineCount","Math","ceil","speed","t5","Array","from","length","t6","map","_","index","createElement","key","$delay","shineEffect","backgroundColor","primaryTextColor","progressColor","secondaryTextColor","stepColor","$color","initial","width","left","animate","exit","transition","type","repeat","Infinity","repeatDelay","duration","step","onUpdate","current","show","onAnimationComplete","onClick","_temp","text","alignment","TopCenter","onHide","$primaryColor","$secondaryColor","progressBar","t7","displayName","event","stopPropagation"],"sources":["../../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import React, { FC, useContext, useMemo, useRef } 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\nconst ProgressBar: FC<ProgressBarProps> = ({\n percentage,\n label,\n shouldHideProgress = false,\n shouldShowLabelInline = false,\n steps,\n colors,\n thumbLabel,\n showShine = false,\n}) => {\n 'use memo';\n\n const uuid = useUuid();\n const popupRef = useRef<PopupRef | 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 FULL_ANIMATION_LENGTH = 5;\n const MAX_SHINE_COUNT = 6;\n\n const shineCount = Math.ceil(MAX_SHINE_COUNT * (percentage / 100));\n const speed = FULL_ANIMATION_LENGTH * (percentage / 100);\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={(FULL_ANIMATION_LENGTH / shineCount) * index}\n />\n ));\n }, [percentage, showShine]);\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 <StyledProgressBarProgressWrapper $isBig={shouldShowLabelInline}>\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 onClick={(event) => event.stopPropagation()}>\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 >\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 );\n }, [\n colors?.backgroundColor,\n colors?.primaryTextColor,\n colors?.progressColor,\n colors?.secondaryTextColor,\n colors?.stepColor,\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,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC9D,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;AAmDlC,MAAMC,WAAiC,GAAGC,EAAA;EAAA;;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAC;IAAAC,UAAA;IAAAC,KAAA;IAAAC,k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AAiE,WAAA,IAAAjE,CAAA,SAAA2B,EAAA;IANLuC,EAAA,gBAAAtF,KAAA,CAAAmD,aAAA,CAAC7C,iBAAiB,QACb+E,WAAW,EACXtC,EAKc,CAAC;IAAA3B,CAAA,OAAAiE,WAAA;IAAAjE,CAAA,OAAA2B,EAAA;IAAA3B,CAAA,OAAAkE,EAAA;EAAA;IAAAA,EAAA,GAAAlE,CAAA;EAAA;EAAA,OAPpBkE,EAOoB;AAAA,CAI/B;AAEDpE,WAAW,CAACqE,WAAW,GAAG,aAAa;AAEvC,eAAerE,WAAW;AA1JgB,SAAA4D,MAAAU,KAAA;EAAA,OAqF+BA,KAAK,CAAAC,eAAgB,CAAC,CAAC;AAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { motion } from 'motion/react';
2
- import styled, { css } from 'styled-components';
2
+ import styled, { css, keyframes } from 'styled-components';
3
3
  export const StyledProgressBar = styled.div`
4
4
  position: relative;
5
5
  `;
@@ -22,11 +22,42 @@ export const StyledProgressBarProgressWrapper = styled.div`
22
22
  $isBig
23
23
  }) => $isBig ? 20 : 2}px;
24
24
  `;
25
+ const shineMove = keyframes`
26
+ from {
27
+ transform: translateX(-150%);
28
+ }
29
+ to {
30
+ transform: translateX(150%);
31
+ }
32
+ `;
33
+ export const StyledProgressBarShine = styled.div.attrs(({
34
+ $delay
35
+ }) => ({
36
+ style: {
37
+ animationDelay: `${$delay ?? 0}s`
38
+ }
39
+ }))`
40
+ position: absolute;
41
+ width: 100%;
42
+ height: 100%;
43
+ background: linear-gradient(
44
+ 90deg,
45
+ rgba(255, 255, 255, 0) 33%,
46
+ rgba(255, 255, 255, 0.5) 50%,
47
+ rgba(255, 255, 255, 0) 66%
48
+ );
49
+ transform: translateX(-150%);
50
+ animation: ${shineMove} ${({
51
+ $speed = 5
52
+ }) => `${$speed}s`} linear infinite;
53
+ opacity: 0.95;
54
+ `;
25
55
  export const StyledMotionProgressBarProgress = styled(motion.div)`
26
56
  height: 100%;
27
57
  position: absolute;
28
58
  top: 0;
29
59
  left: 0;
60
+ overflow: hidden;
30
61
  z-index: 2;
31
62
  display: flex;
32
63
  align-items: center;
@@ -90,4 +121,8 @@ export const StyledProgressBarStep = styled.div`
90
121
  $position
91
122
  }) => $position}%;
92
123
  `;
124
+ export const StyledProgressBarThumbLabel = styled.div`
125
+ position: absolute;
126
+ right: 0;
127
+ `;
93
128
  //# sourceMappingURL=ProgressBar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$isBig","StyledMotionProgressBarProgress","headline","StyledProgressBarLabel","$shouldShowLabelInline","$colorSplitPosition","$primaryColor","$secondaryColor","StyledProgressBarStepWrapper","StyledProgressBarStep","$position"],"sources":["../../../../src/components/progress-bar/ProgressBar.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } 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}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $isBig }) => ($isBig ? 20 : 10)}px;\n border-radius: ${({ $isBig }) => ($isBig ? 20 : 2)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nexport const StyledMotionProgressBarProgress = styled(motion.div)<StyledProgressBarProgressProps>`\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\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"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,OAAO,MAAMC,iBAAiB,GAAGF,MAAM,CAACG,GAAG;AAC3C;AACA,CAAC;AAID,OAAO,MAAMC,2BAA2B,GAAGJ,MAAM,CAACG,GAAqC;AACvF;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAyC,CA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AEC;AAAmC,CAAC,KAAKA,MAAM,IAAID,KAAK,CAAC,KAAK,CAAC;AACjG;AACA;AACA;AACA;AACA,YAAY,CAAC;EAAEa;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ProgressBar.styles.js","names":["motion","styled","css","keyframes","StyledProgressBar","div","StyledProgressBarBackground","theme","$color","StyledProgressBarProgressWrapper","$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}>;\n\nexport const StyledProgressBarProgressWrapper = styled.div<StyledProgressBarProgressWrapperProps>`\n overflow: hidden;\n position: relative;\n width: 100%;\n height: ${({ $isBig }) => ($isBig ? 20 : 10)}px;\n border-radius: ${({ $isBig }) => ($isBig ? 20 : 2)}px;\n`;\n\ntype StyledProgressBarProgressProps = WithTheme<{ $color?: string }>;\n\nconst shineMove = keyframes`\n from {\n transform: translateX(-150%);\n }\n to {\n transform: translateX(150%);\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;AAMD,OAAO,MAAME,gCAAgC,GAAGR,MAAM,CAACI,GAA0C;AACjG;AACA;AACA;AACA,cAAc,CAAC;EAAEK;AAAO,CAAC,KAAMA,MAAM,GAAG,EAAE,GAAG,EAAG;AAChD,qBAAqB,CAAC;EAAEA;AAAO,CAAC,KAAMA,MAAM,GAAG,EAAE,GAAG,CAAE;AACtD,CAAC;AAID,MAAMC,SAAS,GAAGR,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMS,sBAAsB,GAAGX,MAAM,CAACI,GAAG,CAACQ,KAAK,CAClD,CAAC;EAAEC;AAAO,CAAC,MAAM;EACbC,KAAK,EAAE;IAAEC,cAAc,EAAE,GAAGF,MAAM,IAAI,CAAC;EAAI;AAC/C,CAAC,CACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBH,SAAS,IAAI,CAAC;EAAEM,MAAM,GAAG;AAAE,CAAC,KAAK,GAAGA,MAAM,GAAG;AAC9D;AACA,CAAC;AAED,OAAO,MAAMC,+BAA+B,GAAGjB,MAAM,CAACD,MAAM,CAACK,GAAG,CAAiC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,CAAC;EAAEE,KAAK;EAAEC;AAAuC,CAAC,KAClEA,MAAM,IAAID,KAAK,CAACY,QAAQ;AAChC,CAAC;AASD,OAAO,MAAMC,sBAAsB,GAAGnB,MAAM,CAACI,GAAgC;AAC7E;AACA,aAAa,CAAC;EAAEE,KAAK;EAAEc;AAAoD,CAAC,KACpEA,sBAAsB,GAAGd,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAACY,QAAQ;AAC9D;AACA;AACA,MAAM,CAAC;EAAEG,mBAAmB;EAAEC,aAAa;EAAEC,eAAe;EAAEjB;AAAM,CAAC,KAC7De,mBAAmB,IACnBpB,GAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBqB,aAAa,IAAIhB,KAAK,CAAC,KAAK,CAAC,IAAIe,mBAAmB;AACtE,kBAAkBE,eAAe,IAAIjB,KAAK,CAAC,KAAK,CAAC,IAAIe,mBAAmB;AACxE;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,4BAA4B,GAAGxB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMqB,qBAAqB,GAAGzB,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;EAAEoB;AAAsC,CAAC,KAAKA,SAAS;AACpE,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG3B,MAAM,CAACI,GAAG;AACrD;AACA;AACA,CAAC","ignoreList":[]}
@@ -13,7 +13,9 @@ type StyledImageProps = WithTheme<{
13
13
  $hasMultipleImages: boolean;
14
14
  $uuid: string;
15
15
  }>;
16
- export declare const StyledGroupImageElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledImageProps>> & string;
16
+ export declare const StyledGroupImageElement: 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"> & {
17
+ 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;
18
+ }>, StyledImageProps>, never>> & string;
17
19
  type StyledCornerImageProps = WithTheme<{
18
20
  $background?: CSSProperties['background'];
19
21
  $shouldPreventBackground?: boolean;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
3
3
  type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
4
4
  interface Colors {
@@ -33,6 +33,14 @@ export type ProgressBarProps = {
33
33
  * Visual marked steps.
34
34
  */
35
35
  steps?: Range<0, 101>[];
36
+ /**
37
+ * The label that should be displayed on the thumb of the progress bar.
38
+ */
39
+ thumbLabel?: React.ReactNode;
40
+ /**
41
+ * Whether a shine animation should be shown on the progress bar. The amount of shine is based on the percentage value.
42
+ */
43
+ showShine?: boolean;
36
44
  };
37
45
  declare const ProgressBar: FC<ProgressBarProps>;
38
46
  export default ProgressBar;
@@ -11,6 +11,12 @@ export declare const StyledProgressBarProgressWrapper: import("styled-components
11
11
  type StyledProgressBarProgressProps = WithTheme<{
12
12
  $color?: string;
13
13
  }>;
14
+ 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"> & {
15
+ 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;
16
+ }>, {
17
+ $speed?: number;
18
+ $delay?: number;
19
+ }>, never>> & string;
14
20
  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"> & {
15
21
  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;
16
22
  }, StyledProgressBarProgressProps>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof React.Component<any, {}, any>>;
@@ -27,4 +33,5 @@ type StyledProgressBarStepProps = WithTheme<{
27
33
  $color?: string;
28
34
  }>;
29
35
  export declare const StyledProgressBarStep: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProgressBarStepProps>> & string;
36
+ export declare const StyledProgressBarThumbLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
30
37
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.19",
3
+ "version": "5.0.24",
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": "669f559b26f9c2f94a6ed7d6c586f388502ddd65"
89
+ "gitHead": "b9ab91825d63be8a824757ec2f50632d289276b9"
90
90
  }