@semcore/progress-bar 3.0.9 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/ProgressBar.js +19 -17
- package/lib/cjs/ProgressBar.js.map +1 -1
- package/lib/es6/ProgressBar.js +19 -17
- package/lib/es6/ProgressBar.js.map +1 -1
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
package/lib/cjs/ProgressBar.js
CHANGED
|
@@ -46,25 +46,25 @@ var style = (
|
|
|
46
46
|
/*__reshadow_css_start__*/
|
|
47
47
|
_core.sstyled.insert(
|
|
48
48
|
/*__inner_css_start__*/
|
|
49
|
-
".
|
|
49
|
+
".___SProgressBar_1rubn_gg_{position:relative;width:100%;overflow:hidden}.___SValue_1rubn_gg_{position:absolute;top:0;left:0;background-image:linear-gradient(-45deg,#008f74 25%,#009f81 0,#009f81 50%,#008f74 0,#008f74 76%,#009f81 0);overflow:hidden;-webkit-animation-name:loading_1rubn;animation-name:loading_1rubn;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;transition-property:width;transition-timing-function:linear;transition-duration:1s}.___SProgressBar_1rubn_gg_._size_s_1rubn_gg_,.___SValue_1rubn_gg_._size_s_1rubn_gg_{height:4px;border-radius:6px;background-size:8px 8px}.___SProgressBar_1rubn_gg_._size_m_1rubn_gg_,.___SValue_1rubn_gg_._size_m_1rubn_gg_{height:8px;border-radius:6px;background-size:12px 12px}.___SProgressBar_1rubn_gg_._size_l_1rubn_gg_,.___SValue_1rubn_gg_._size_l_1rubn_gg_{height:12px;border-radius:6px;background-size:16px 16px}.___SProgressBar_1rubn_gg_._theme_dark_1rubn_gg_{background-color:hsla(0,0%,100%,.2)}.___SProgressBar_1rubn_gg_._theme_invert_1rubn_gg_{background-color:#e0e1e9}@-webkit-keyframes loading_1rubn{0%{background-position:0 0}to{background-position:60px 0}}@keyframes loading_1rubn{0%{background-position:0 0}to{background-position:60px 0}}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{background-image:linear-gradient(-45deg,#cacbd2 25%,#e0e1e9 0,#e0e1e9 50%,#cacbd2 0,#cacbd2 76%,#e0e1e9 0);-webkit-animation-name:loading_1rubn;animation-name:loading_1rubn;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.___SProgressBar_1rubn_gg_._theme_custom_1rubn_gg_{background-color:var(--colorBg_1rubn);background-image:var(--colorBg_1rubn)}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{-webkit-animation-duration:var(--duration_1rubn);animation-duration:var(--duration_1rubn)}.___SValue_1rubn_gg_{width:var(--width_1rubn);-webkit-animation-duration:var(--duration_1rubn);animation-duration:var(--duration_1rubn)}.___SValue_1rubn_gg_.__theme_1rubn_gg_{background-color:var(--colorBg_1rubn);background-image:var(--colorBg_1rubn)}@media (prefers-reduced-motion){.___SValue_1rubn_gg_{-webkit-animation-name:none;animation-name:none}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{-webkit-animation-name:none;animation-name:none}}"
|
|
50
50
|
/*__inner_css_end__*/
|
|
51
|
-
, "
|
|
51
|
+
, "1rubn_gg_")
|
|
52
52
|
/*__reshadow_css_end__*/
|
|
53
53
|
, {
|
|
54
|
-
"__SProgressBar": "
|
|
55
|
-
"__SValue": "
|
|
56
|
-
"_size_s": "
|
|
57
|
-
"_size_m": "
|
|
58
|
-
"_size_l": "
|
|
59
|
-
"_theme_dark": "
|
|
60
|
-
"_theme_invert": "
|
|
61
|
-
"@loading": "
|
|
62
|
-
"_animation": "
|
|
63
|
-
"_theme_custom": "
|
|
64
|
-
"--colorBg": "--
|
|
65
|
-
"--duration": "--
|
|
66
|
-
"--width": "--
|
|
67
|
-
"_theme": "
|
|
54
|
+
"__SProgressBar": "___SProgressBar_1rubn_gg_",
|
|
55
|
+
"__SValue": "___SValue_1rubn_gg_",
|
|
56
|
+
"_size_s": "_size_s_1rubn_gg_",
|
|
57
|
+
"_size_m": "_size_m_1rubn_gg_",
|
|
58
|
+
"_size_l": "_size_l_1rubn_gg_",
|
|
59
|
+
"_theme_dark": "_theme_dark_1rubn_gg_",
|
|
60
|
+
"_theme_invert": "_theme_invert_1rubn_gg_",
|
|
61
|
+
"@loading": "loading_1rubn",
|
|
62
|
+
"_animation": "__animation_1rubn_gg_",
|
|
63
|
+
"_theme_custom": "_theme_custom_1rubn_gg_",
|
|
64
|
+
"--colorBg": "--colorBg_1rubn",
|
|
65
|
+
"--duration": "--duration_1rubn",
|
|
66
|
+
"--width": "--width_1rubn",
|
|
67
|
+
"_theme": "__theme_1rubn_gg_"
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
function isCustomTheme(theme) {
|
|
@@ -112,7 +112,9 @@ var ProgressBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
112
112
|
"use:theme": useTheme,
|
|
113
113
|
"use:animation": !value,
|
|
114
114
|
"use:duration": "".concat(duration, "ms"),
|
|
115
|
-
"colorBg": (0, _color["default"])(theme)
|
|
115
|
+
"colorBg": (0, _color["default"])(theme),
|
|
116
|
+
"role": "progressbar",
|
|
117
|
+
"aria-valuenow": value
|
|
116
118
|
}, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref3.cn("Children", {})));
|
|
117
119
|
}
|
|
118
120
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","names":["isCustomTheme","theme","includes","ProgressBarRoot","asProps","value","duration","size","SProgressBar","Box","Children","styles","useTheme","sstyled","resolveColor","Component","style","children","Value","props","SValue","width","ProgressBar","createComponent"],"sources":["../../src/ProgressBar.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor from '@semcore/utils/lib/color';\n\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component {\n static displayName = 'ProgressBar';\n static style = style;\n static defaultProps = () => ({\n duration: 1000,\n size: 'm',\n theme: 'invert',\n children: <ProgressBar.Value />,\n });\n\n getValueProps() {\n const { value, duration, size } = this.asProps;\n return {\n value,\n duration,\n size,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value } = this.asProps;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n return sstyled(styles)(\n <SProgressBar\n render={Box}\n use:theme={useTheme}\n use:animation={!value}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n >\n <Children />\n </SProgressBar>,\n );\n }\n}\n\nfunction Value(props) {\n const SValue = Root;\n const { styles, value, theme, duration } = props;\n const width = `${value}%`;\n\n return sstyled(styles)(\n <SValue\n render={Box}\n use:width={width}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n />,\n );\n}\n\nconst ProgressBar = createComponent(ProgressBarRoot, {\n Value,\n});\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,MAAD,EAAS,QAAT,EAAmBC,QAAnB,CAA4BD,KAA5B,CAAR;AACD;;IAEKE,e;;;;;;;;;;;;WAUJ,yBAAgB;MACd,oBAAkC,KAAKC,OAAvC;MAAA,IAAQC,KAAR,iBAAQA,KAAR;MAAA,IAAeC,QAAf,iBAAeA,QAAf;MAAA,IAAyBC,IAAzB,iBAAyBA,IAAzB;MACA,OAAO;QACLF,KAAK,EAALA,KADK;QAELC,QAAQ,EAARA,QAFK;QAGLC,IAAI,EAAJA;MAHK,CAAP;IAKD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAMC,YAAY,GAMNC,YANZ;MACA,qBAAqD,KAAKL,OAA1D;MAAA,IAAQM,QAAR,kBAAQA,QAAR;MAAA,IAAkBC,MAAlB,kBAAkBA,MAAlB;MAAA,IAA0BL,QAA1B,kBAA0BA,QAA1B;MAAA,IAAoCL,KAApC,kBAAoCA,KAApC;MAAA,IAA2CI,KAA3C,kBAA2CA,KAA3C;MACA,IAAMO,QAAQ,GAAGZ,aAAa,CAACC,KAAD,CAAb,GAAuB,QAAvB,GAAkCA,KAAnD;MAEA,eAAO,IAAAY,aAAA,EAAQF,MAAR,CAAP,eACE,gCAAC,YAAD;QAAA,aAEaC,QAFb;QAAA,iBAGiB,CAACP,KAHlB;QAAA,0BAImBC,QAJnB;QAAA,WAKW,IAAAQ,iBAAA,EAAab,KAAb;
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","names":["isCustomTheme","theme","includes","ProgressBarRoot","asProps","value","duration","size","SProgressBar","Box","Children","styles","useTheme","sstyled","resolveColor","Component","style","children","Value","props","SValue","width","ProgressBar","createComponent"],"sources":["../../src/ProgressBar.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor from '@semcore/utils/lib/color';\n\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component {\n static displayName = 'ProgressBar';\n static style = style;\n static defaultProps = () => ({\n duration: 1000,\n size: 'm',\n theme: 'invert',\n children: <ProgressBar.Value />,\n });\n\n getValueProps() {\n const { value, duration, size } = this.asProps;\n return {\n value,\n duration,\n size,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value } = this.asProps;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n return sstyled(styles)(\n <SProgressBar\n render={Box}\n use:theme={useTheme}\n use:animation={!value}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n role=\"progressbar\"\n aria-valuenow={value}\n >\n <Children />\n </SProgressBar>,\n );\n }\n}\n\nfunction Value(props) {\n const SValue = Root;\n const { styles, value, theme, duration } = props;\n const width = `${value}%`;\n\n return sstyled(styles)(\n <SValue\n render={Box}\n use:width={width}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n />,\n );\n}\n\nconst ProgressBar = createComponent(ProgressBarRoot, {\n Value,\n});\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,MAAD,EAAS,QAAT,EAAmBC,QAAnB,CAA4BD,KAA5B,CAAR;AACD;;IAEKE,e;;;;;;;;;;;;WAUJ,yBAAgB;MACd,oBAAkC,KAAKC,OAAvC;MAAA,IAAQC,KAAR,iBAAQA,KAAR;MAAA,IAAeC,QAAf,iBAAeA,QAAf;MAAA,IAAyBC,IAAzB,iBAAyBA,IAAzB;MACA,OAAO;QACLF,KAAK,EAALA,KADK;QAELC,QAAQ,EAARA,QAFK;QAGLC,IAAI,EAAJA;MAHK,CAAP;IAKD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAMC,YAAY,GAMNC,YANZ;MACA,qBAAqD,KAAKL,OAA1D;MAAA,IAAQM,QAAR,kBAAQA,QAAR;MAAA,IAAkBC,MAAlB,kBAAkBA,MAAlB;MAAA,IAA0BL,QAA1B,kBAA0BA,QAA1B;MAAA,IAAoCL,KAApC,kBAAoCA,KAApC;MAAA,IAA2CI,KAA3C,kBAA2CA,KAA3C;MACA,IAAMO,QAAQ,GAAGZ,aAAa,CAACC,KAAD,CAAb,GAAuB,QAAvB,GAAkCA,KAAnD;MAEA,eAAO,IAAAY,aAAA,EAAQF,MAAR,CAAP,eACE,gCAAC,YAAD;QAAA,aAEaC,QAFb;QAAA,iBAGiB,CAACP,KAHlB;QAAA,0BAImBC,QAJnB;QAAA,WAKW,IAAAQ,iBAAA,EAAab,KAAb,CALX;QAAA,QAMO,aANP;QAAA,iBAOiBI;MAPjB,yBASE,gCAAC,QAAD,2BATF,CADF;IAaD;;;EArC2BU,e;;iCAAxBZ,e,iBACiB,a;iCADjBA,e,WAEWa,K;iCAFXb,e,kBAGkB;EAAA,OAAO;IAC3BG,QAAQ,EAAE,IADiB;IAE3BC,IAAI,EAAE,GAFqB;IAG3BN,KAAK,EAAE,QAHoB;IAI3BgB,QAAQ,eAAE,gCAAC,WAAD,CAAa,KAAb;EAJiB,CAAP;AAAA,C;;AAqCxB,SAASC,KAAT,CAAeC,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAMC,MAAM,GAMAX,YANZ;EACA,IAAQE,MAAR,GAA2CQ,KAA3C,CAAQR,MAAR;EAAA,IAAgBN,KAAhB,GAA2Cc,KAA3C,CAAgBd,KAAhB;EAAA,IAAuBJ,KAAvB,GAA2CkB,KAA3C,CAAuBlB,KAAvB;EAAA,IAA8BK,QAA9B,GAA2Ca,KAA3C,CAA8Bb,QAA9B;EACA,IAAMe,KAAK,aAAMhB,KAAN,MAAX;EAEA,eAAO,IAAAQ,aAAA,EAAQF,MAAR,CAAP,eACE,gCAAC,MAAD;IAAA,aAEaU,KAFb;IAAA,0BAGmBf,QAHnB;IAAA,WAIW,IAAAQ,iBAAA,EAAab,KAAb;EAJX,YADF;AAQD;;AAED,IAAMqB,WAAW,GAAG,IAAAC,gBAAA,EAAgBpB,eAAhB,EAAiC;EACnDe,KAAK,EAALA;AADmD,CAAjC,CAApB;eAIeI,W"}
|
package/lib/es6/ProgressBar.js
CHANGED
|
@@ -26,25 +26,25 @@ var style = (
|
|
|
26
26
|
/*__reshadow_css_start__*/
|
|
27
27
|
_sstyled.insert(
|
|
28
28
|
/*__inner_css_start__*/
|
|
29
|
-
".
|
|
29
|
+
".___SProgressBar_1rubn_gg_{position:relative;width:100%;overflow:hidden}.___SValue_1rubn_gg_{position:absolute;top:0;left:0;background-image:linear-gradient(-45deg,#008f74 25%,#009f81 0,#009f81 50%,#008f74 0,#008f74 76%,#009f81 0);overflow:hidden;-webkit-animation-name:loading_1rubn;animation-name:loading_1rubn;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;transition-property:width;transition-timing-function:linear;transition-duration:1s}.___SProgressBar_1rubn_gg_._size_s_1rubn_gg_,.___SValue_1rubn_gg_._size_s_1rubn_gg_{height:4px;border-radius:6px;background-size:8px 8px}.___SProgressBar_1rubn_gg_._size_m_1rubn_gg_,.___SValue_1rubn_gg_._size_m_1rubn_gg_{height:8px;border-radius:6px;background-size:12px 12px}.___SProgressBar_1rubn_gg_._size_l_1rubn_gg_,.___SValue_1rubn_gg_._size_l_1rubn_gg_{height:12px;border-radius:6px;background-size:16px 16px}.___SProgressBar_1rubn_gg_._theme_dark_1rubn_gg_{background-color:hsla(0,0%,100%,.2)}.___SProgressBar_1rubn_gg_._theme_invert_1rubn_gg_{background-color:#e0e1e9}@-webkit-keyframes loading_1rubn{0%{background-position:0 0}to{background-position:60px 0}}@keyframes loading_1rubn{0%{background-position:0 0}to{background-position:60px 0}}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{background-image:linear-gradient(-45deg,#cacbd2 25%,#e0e1e9 0,#e0e1e9 50%,#cacbd2 0,#cacbd2 76%,#e0e1e9 0);-webkit-animation-name:loading_1rubn;animation-name:loading_1rubn;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.___SProgressBar_1rubn_gg_._theme_custom_1rubn_gg_{background-color:var(--colorBg_1rubn);background-image:var(--colorBg_1rubn)}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{-webkit-animation-duration:var(--duration_1rubn);animation-duration:var(--duration_1rubn)}.___SValue_1rubn_gg_{width:var(--width_1rubn);-webkit-animation-duration:var(--duration_1rubn);animation-duration:var(--duration_1rubn)}.___SValue_1rubn_gg_.__theme_1rubn_gg_{background-color:var(--colorBg_1rubn);background-image:var(--colorBg_1rubn)}@media (prefers-reduced-motion){.___SValue_1rubn_gg_{-webkit-animation-name:none;animation-name:none}.___SProgressBar_1rubn_gg_.__animation_1rubn_gg_{-webkit-animation-name:none;animation-name:none}}"
|
|
30
30
|
/*__inner_css_end__*/
|
|
31
|
-
, "
|
|
31
|
+
, "1rubn_gg_")
|
|
32
32
|
/*__reshadow_css_end__*/
|
|
33
33
|
, {
|
|
34
|
-
"__SProgressBar": "
|
|
35
|
-
"__SValue": "
|
|
36
|
-
"_size_s": "
|
|
37
|
-
"_size_m": "
|
|
38
|
-
"_size_l": "
|
|
39
|
-
"_theme_dark": "
|
|
40
|
-
"_theme_invert": "
|
|
41
|
-
"@loading": "
|
|
42
|
-
"_animation": "
|
|
43
|
-
"_theme_custom": "
|
|
44
|
-
"--colorBg": "--
|
|
45
|
-
"--duration": "--
|
|
46
|
-
"--width": "--
|
|
47
|
-
"_theme": "
|
|
34
|
+
"__SProgressBar": "___SProgressBar_1rubn_gg_",
|
|
35
|
+
"__SValue": "___SValue_1rubn_gg_",
|
|
36
|
+
"_size_s": "_size_s_1rubn_gg_",
|
|
37
|
+
"_size_m": "_size_m_1rubn_gg_",
|
|
38
|
+
"_size_l": "_size_l_1rubn_gg_",
|
|
39
|
+
"_theme_dark": "_theme_dark_1rubn_gg_",
|
|
40
|
+
"_theme_invert": "_theme_invert_1rubn_gg_",
|
|
41
|
+
"@loading": "loading_1rubn",
|
|
42
|
+
"_animation": "__animation_1rubn_gg_",
|
|
43
|
+
"_theme_custom": "_theme_custom_1rubn_gg_",
|
|
44
|
+
"--colorBg": "--colorBg_1rubn",
|
|
45
|
+
"--duration": "--duration_1rubn",
|
|
46
|
+
"--width": "--width_1rubn",
|
|
47
|
+
"_theme": "__theme_1rubn_gg_"
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
function isCustomTheme(theme) {
|
|
@@ -93,7 +93,9 @@ var ProgressBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
93
93
|
"use:theme": useTheme,
|
|
94
94
|
"use:animation": !value,
|
|
95
95
|
"use:duration": "".concat(duration, "ms"),
|
|
96
|
-
"colorBg": resolveColor(theme)
|
|
96
|
+
"colorBg": resolveColor(theme),
|
|
97
|
+
"role": "progressbar",
|
|
98
|
+
"aria-valuenow": value
|
|
97
99
|
}, _ref))), /*#__PURE__*/React.createElement(Children, _ref3.cn("Children", {})));
|
|
98
100
|
}
|
|
99
101
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","names":["React","createComponent","Component","sstyled","Root","Box","resolveColor","isCustomTheme","theme","includes","ProgressBarRoot","asProps","value","duration","size","SProgressBar","Children","styles","useTheme","style","children","Value","props","SValue","width","ProgressBar"],"sources":["../../src/ProgressBar.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor from '@semcore/utils/lib/color';\n\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component {\n static displayName = 'ProgressBar';\n static style = style;\n static defaultProps = () => ({\n duration: 1000,\n size: 'm',\n theme: 'invert',\n children: <ProgressBar.Value />,\n });\n\n getValueProps() {\n const { value, duration, size } = this.asProps;\n return {\n value,\n duration,\n size,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value } = this.asProps;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n return sstyled(styles)(\n <SProgressBar\n render={Box}\n use:theme={useTheme}\n use:animation={!value}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n >\n <Children />\n </SProgressBar>,\n );\n }\n}\n\nfunction Value(props) {\n const SValue = Root;\n const { styles, value, theme, duration } = props;\n const width = `${value}%`;\n\n return sstyled(styles)(\n <SValue\n render={Box}\n use:width={width}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n />,\n );\n}\n\nconst ProgressBar = createComponent(ProgressBarRoot, {\n Value,\n});\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,YAAP,MAAyB,0BAAzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASC,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,MAAD,EAAS,QAAT,EAAmBC,QAAnB,CAA4BD,KAA5B,CAAR;AACD;;IAEKE,e;;;;;;;;;;;;;WAUJ,yBAAgB;MACd,oBAAkC,KAAKC,OAAvC;MAAA,IAAQC,KAAR,iBAAQA,KAAR;MAAA,IAAeC,QAAf,iBAAeA,QAAf;MAAA,IAAyBC,IAAzB,iBAAyBA,IAAzB;MACA,OAAO;QACLF,KAAK,EAALA,KADK;QAELC,QAAQ,EAARA,QAFK;QAGLC,IAAI,EAAJA;MAHK,CAAP;IAKD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAMC,YAAY,GAMNV,GANZ;MACA,qBAAqD,KAAKM,OAA1D;MAAA,IAAQK,QAAR,kBAAQA,QAAR;MAAA,IAAkBC,MAAlB,kBAAkBA,MAAlB;MAAA,IAA0BJ,QAA1B,kBAA0BA,QAA1B;MAAA,IAAoCL,KAApC,kBAAoCA,KAApC;MAAA,IAA2CI,KAA3C,kBAA2CA,KAA3C;MACA,IAAMM,QAAQ,GAAGX,aAAa,CAACC,KAAD,CAAb,GAAuB,QAAvB,GAAkCA,KAAnD;MAEA,eAAOL,OAAO,CAACc,MAAD,CAAd,eACE,oBAAC,YAAD;QAAA,aAEaC,QAFb;QAAA,iBAGiB,CAACN,KAHlB;QAAA,0BAImBC,QAJnB;QAAA,WAKWP,YAAY,CAACE,KAAD;
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","names":["React","createComponent","Component","sstyled","Root","Box","resolveColor","isCustomTheme","theme","includes","ProgressBarRoot","asProps","value","duration","size","SProgressBar","Children","styles","useTheme","style","children","Value","props","SValue","width","ProgressBar"],"sources":["../../src/ProgressBar.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor from '@semcore/utils/lib/color';\n\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme) {\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component {\n static displayName = 'ProgressBar';\n static style = style;\n static defaultProps = () => ({\n duration: 1000,\n size: 'm',\n theme: 'invert',\n children: <ProgressBar.Value />,\n });\n\n getValueProps() {\n const { value, duration, size } = this.asProps;\n return {\n value,\n duration,\n size,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value } = this.asProps;\n const useTheme = isCustomTheme(theme) ? 'custom' : theme;\n\n return sstyled(styles)(\n <SProgressBar\n render={Box}\n use:theme={useTheme}\n use:animation={!value}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n role=\"progressbar\"\n aria-valuenow={value}\n >\n <Children />\n </SProgressBar>,\n );\n }\n}\n\nfunction Value(props) {\n const SValue = Root;\n const { styles, value, theme, duration } = props;\n const width = `${value}%`;\n\n return sstyled(styles)(\n <SValue\n render={Box}\n use:width={width}\n use:duration={`${duration}ms`}\n colorBg={resolveColor(theme)}\n />,\n );\n}\n\nconst ProgressBar = createComponent(ProgressBarRoot, {\n Value,\n});\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,YAAP,MAAyB,0BAAzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASC,aAAT,CAAuBC,KAAvB,EAA8B;EAC5B,OAAO,CAAC,CAAC,MAAD,EAAS,QAAT,EAAmBC,QAAnB,CAA4BD,KAA5B,CAAR;AACD;;IAEKE,e;;;;;;;;;;;;;WAUJ,yBAAgB;MACd,oBAAkC,KAAKC,OAAvC;MAAA,IAAQC,KAAR,iBAAQA,KAAR;MAAA,IAAeC,QAAf,iBAAeA,QAAf;MAAA,IAAyBC,IAAzB,iBAAyBA,IAAzB;MACA,OAAO;QACLF,KAAK,EAALA,KADK;QAELC,QAAQ,EAARA,QAFK;QAGLC,IAAI,EAAJA;MAHK,CAAP;IAKD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAMC,YAAY,GAMNV,GANZ;MACA,qBAAqD,KAAKM,OAA1D;MAAA,IAAQK,QAAR,kBAAQA,QAAR;MAAA,IAAkBC,MAAlB,kBAAkBA,MAAlB;MAAA,IAA0BJ,QAA1B,kBAA0BA,QAA1B;MAAA,IAAoCL,KAApC,kBAAoCA,KAApC;MAAA,IAA2CI,KAA3C,kBAA2CA,KAA3C;MACA,IAAMM,QAAQ,GAAGX,aAAa,CAACC,KAAD,CAAb,GAAuB,QAAvB,GAAkCA,KAAnD;MAEA,eAAOL,OAAO,CAACc,MAAD,CAAd,eACE,oBAAC,YAAD;QAAA,aAEaC,QAFb;QAAA,iBAGiB,CAACN,KAHlB;QAAA,0BAImBC,QAJnB;QAAA,WAKWP,YAAY,CAACE,KAAD,CALvB;QAAA,QAMO,aANP;QAAA,iBAOiBI;MAPjB,yBASE,oBAAC,QAAD,2BATF,CADF;IAaD;;;;EArC2BV,S;;gBAAxBQ,e,iBACiB,a;;gBADjBA,e,WAEWS,K;;gBAFXT,e,kBAGkB;EAAA,OAAO;IAC3BG,QAAQ,EAAE,IADiB;IAE3BC,IAAI,EAAE,GAFqB;IAG3BN,KAAK,EAAE,QAHoB;IAI3BY,QAAQ,eAAE,oBAAC,WAAD,CAAa,KAAb;EAJiB,CAAP;AAAA,C;;AAqCxB,SAASC,KAAT,CAAeC,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAMC,MAAM,GAMAlB,GANZ;EACA,IAAQY,MAAR,GAA2CK,KAA3C,CAAQL,MAAR;EAAA,IAAgBL,KAAhB,GAA2CU,KAA3C,CAAgBV,KAAhB;EAAA,IAAuBJ,KAAvB,GAA2Cc,KAA3C,CAAuBd,KAAvB;EAAA,IAA8BK,QAA9B,GAA2CS,KAA3C,CAA8BT,QAA9B;EACA,IAAMW,KAAK,aAAMZ,KAAN,MAAX;EAEA,eAAOT,OAAO,CAACc,MAAD,CAAd,eACE,oBAAC,MAAD;IAAA,aAEaO,KAFb;IAAA,0BAGmBX,QAHnB;IAAA,WAIWP,YAAY,CAACE,KAAD;EAJvB,YADF;AAQD;;AAED,IAAMiB,WAAW,GAAGxB,eAAe,CAACS,eAAD,EAAkB;EACnDW,KAAK,EAALA;AADmD,CAAlB,CAAnC;AAIA,eAAeI,WAAf"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/progress-bar",
|
|
3
3
|
"description": "Semrush ProgressBar Component",
|
|
4
|
-
"version": "3.0
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@semcore/
|
|
17
|
-
"@semcore/
|
|
16
|
+
"@semcore/flex-box": "^4",
|
|
17
|
+
"@semcore/utils": "^3.15"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@semcore/core": "^1.11",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"directory": "semcore/progress-bar"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@guidepup/playwright": "0.6.1",
|
|
33
|
+
"@playwright/test": "1.25.1",
|
|
32
34
|
"@semcore/jest-preset-ui": "1.0.0"
|
|
33
35
|
}
|
|
34
36
|
}
|