@semcore/progress-bar 17.0.0 → 17.0.2-prerelease.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 +13 -0
- package/lib/cjs/ProgressBar.js +15 -15
- package/lib/cjs/ProgressBar.js.map +1 -1
- package/lib/cjs/ProgressBar.type.js.map +1 -1
- package/lib/es6/ProgressBar.js +15 -15
- package/lib/es6/ProgressBar.js.map +1 -1
- package/lib/es6/ProgressBar.type.js.map +1 -1
- package/lib/esm/ProgressBar.mjs +17 -16
- package/lib/types/ProgressBar.d.ts +2 -2
- package/lib/types/ProgressBar.type.d.ts +46 -36
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [17.0.2] - 2026-04-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Deprecated atomic types. Atomic parts are part of `NSProgressBar`
|
|
10
|
+
namespace.
|
|
11
|
+
|
|
12
|
+
## [17.0.1] - 2026-04-16
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Build processing to correct extract styles.
|
|
17
|
+
|
|
5
18
|
## [17.0.0] - 2026-04-15
|
|
6
19
|
|
|
7
20
|
### BREAK
|
package/lib/cjs/ProgressBar.js
CHANGED
|
@@ -11,23 +11,23 @@ var _baseComponents = require("@semcore/base-components");
|
|
|
11
11
|
var _resolveColorEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/resolveColorEnhance"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
/*!__reshadow-styles__:"./style/progress-bar.shadow.css"*/
|
|
14
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
14
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes loading_mhngj{0%{background-position:0 0}to{background-position:60px 0}}.___SProgressBar_mhngj_gg_{position:relative;width:100%;overflow:hidden;background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_._theme_dark_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg-invert, rgba(255, 255, 255, 0.2))}.___SValue_mhngj_gg_{position:absolute;top:0;left:0;background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-value-gradient,\n linear-gradient(-45deg, rgba(0, 159, 129, 0.9) 25%, rgba(0, 159, 129, 1) 0%, rgba(0, 159, 129, 1) 50%, rgba(0, 159, 129, 0.9) 0%, rgba(0, 159, 129, 0.9) 75%, rgba(0, 159, 129, 1) 0%));overflow:hidden;animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;transition-property:width;transition-timing-function:linear;width:var(--width_mhngj);animation-duration:var(--duration_mhngj);transition-duration:var(--duration_mhngj)}.___SValue_mhngj_gg_.__theme_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}.___SProgressBar_mhngj_gg_._size_s_mhngj_gg_,.___SValue_mhngj_gg_._size_s_mhngj_gg_{height:4px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:8px 8px}.___SProgressBar_mhngj_gg_._size_m_mhngj_gg_,.___SValue_mhngj_gg_._size_m_mhngj_gg_{height:8px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:12px 12px}.___SProgressBar_mhngj_gg_._size_l_mhngj_gg_,.___SValue_mhngj_gg_._size_l_mhngj_gg_{height:12px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:16px 16px}.___SProgressBar_mhngj_gg_._theme_invert_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_{background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-pattern-gradient,\n linear-gradient(-45deg, rgba(224, 225, 233, 0.9) 25%, rgba(224, 225, 233, 1) 0%, rgba(224, 225, 233, 1) 50%, rgba(224, 225, 233, 0.9) 0%, rgba(224, 225, 233, 0.9) 75%, rgba(224, 225, 233, 1) 0%));animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;animation-duration:var(--duration_mhngj)}.___SProgressBar_mhngj_gg_._theme_custom_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}@media (prefers-reduced-motion){.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_,.___SValue_mhngj_gg_{animation-name:none}}", /*__inner_css_end__*/"mhngj_gg_"),
|
|
15
15
|
/*__reshadow_css_end__*/
|
|
16
16
|
{
|
|
17
|
-
"__SProgressBar": "
|
|
18
|
-
"_theme_dark": "
|
|
19
|
-
"__SValue": "
|
|
20
|
-
"--width": "--
|
|
21
|
-
"--duration": "--
|
|
22
|
-
"_theme": "
|
|
23
|
-
"--colorBg": "--
|
|
24
|
-
"_size_s": "
|
|
25
|
-
"_size_m": "
|
|
26
|
-
"_size_l": "
|
|
27
|
-
"_theme_invert": "
|
|
28
|
-
"@loading": "
|
|
29
|
-
"_animation": "
|
|
30
|
-
"_theme_custom": "
|
|
17
|
+
"__SProgressBar": "___SProgressBar_mhngj_gg_",
|
|
18
|
+
"_theme_dark": "_theme_dark_mhngj_gg_",
|
|
19
|
+
"__SValue": "___SValue_mhngj_gg_",
|
|
20
|
+
"--width": "--width_mhngj",
|
|
21
|
+
"--duration": "--duration_mhngj",
|
|
22
|
+
"_theme": "__theme_mhngj_gg_",
|
|
23
|
+
"--colorBg": "--colorBg_mhngj",
|
|
24
|
+
"_size_s": "_size_s_mhngj_gg_",
|
|
25
|
+
"_size_m": "_size_m_mhngj_gg_",
|
|
26
|
+
"_size_l": "_size_l_mhngj_gg_",
|
|
27
|
+
"_theme_invert": "_theme_invert_mhngj_gg_",
|
|
28
|
+
"@loading": "loading_mhngj",
|
|
29
|
+
"_animation": "__animation_mhngj_gg_",
|
|
30
|
+
"_theme_custom": "_theme_custom_mhngj_gg_"
|
|
31
31
|
});
|
|
32
32
|
function isCustomTheme(theme) {
|
|
33
33
|
if (!theme) return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","names":["_core","require","_baseComponents","_resolveColorEnhance","_interopRequireDefault","_react","style","sstyled","insert","isCustomTheme","theme","includes","ProgressBarRoot","Component","getValueProps","value","duration","size","resolveColor","asProps","render","_ref","_ref3","SProgressBar","Box","Children","styles","useTheme","default","createElement","cn","assignProps","_defineProperty2","resolveColorEnhance","children","ProgressBar","Value","props","_ref2","arguments[0]","_ref4","SValue","width","createComponent","_default","exports"],"sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","names":["_core","require","_baseComponents","_resolveColorEnhance","_interopRequireDefault","_react","style","sstyled","insert","isCustomTheme","theme","includes","ProgressBarRoot","Component","getValueProps","value","duration","size","resolveColor","asProps","render","_ref","_ref3","SProgressBar","Box","Children","styles","useTheme","default","createElement","cn","assignProps","_defineProperty2","resolveColorEnhance","children","ProgressBar","Value","props","_ref2","arguments[0]","_ref4","SValue","width","createComponent","_default","exports"],"sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type { NSProgressBar } from './ProgressBar.type';\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme?: string) {\n if (!theme) return false;\n\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSProgressBar.Component>,\n typeof ProgressBarRoot.enhance\n> {\n static displayName = 'ProgressBar';\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\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, resolveColor } = this.asProps;\n return {\n value,\n duration,\n size,\n resolveColor,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value, resolveColor } = 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(\n props: Intergalactic.InternalTypings.InferChildComponentProps<\n NSProgressBar.Value.Component,\n typeof ProgressBarRoot,\n 'Value'\n >,\n) {\n const SValue = Root;\n const { styles, value, theme, duration, resolveColor } = 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}) as NSProgressBar.Component;\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AAGA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0B;AAAA,MAAAK,KAAA,8BAAAN,KAAA,CAAAO,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA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
1
|
-
{"version":3,"file":"ProgressBar.type.js","names":[],"sources":["../../src/ProgressBar.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\n\
|
|
1
|
+
{"version":3,"file":"ProgressBar.type.js","names":[],"sources":["../../src/ProgressBar.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\n\ndeclare namespace NSProgressBar {\n type Props = BoxProps & {\n /**\n * Progress bar theme\n * @default invert\n */\n theme?: 'dark' | 'invert' | string;\n /**\n * Progress bar size\n * @default m\n */\n size?: 's' | 'm' | 'l';\n /** Value as a percentage */\n value?: number;\n /** Duration of animation, ms\n * @default 1000\n */\n duration?: number;\n };\n\n type Ctx = {\n getValueProps: PropGetterFn;\n };\n\n namespace Value {\n type Props = BoxProps & {\n /** Controls the size of the value bar */\n size?: 's' | 'm' | 'l';\n /** Progress value */\n value?: number;\n /** Animation diration in milliseconds for transitions */\n duration?: number;\n /** Color theme */\n theme?: string;\n };\n\n type Component = Intergalactic.Component<'div', Props>;\n }\n\n type Component = Intergalactic.Component<'div', Props, Ctx> & {\n Value: Value.Component;\n };\n}\n\n/** @deprecated It will be removed in v18. */\nexport type ProgressBarProps = NSProgressBar.Props;\n/** @deprecated It will be removed in v18. */\nexport type ValueProps = NSProgressBar.Value.Props;\n/** @deprecated It will be removed in v18. */\nexport type ProgressBarCxt = NSProgressBar.Ctx;\n\nexport type { NSProgressBar };\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/ProgressBar.js
CHANGED
|
@@ -7,23 +7,23 @@ import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
|
7
7
|
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
/*!__reshadow-styles__:"./style/progress-bar.shadow.css"*/
|
|
10
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
10
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes loading_mhngj{0%{background-position:0 0}to{background-position:60px 0}}.___SProgressBar_mhngj_gg_{position:relative;width:100%;overflow:hidden;background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_._theme_dark_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg-invert, rgba(255, 255, 255, 0.2))}.___SValue_mhngj_gg_{position:absolute;top:0;left:0;background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-value-gradient,\n linear-gradient(-45deg, rgba(0, 159, 129, 0.9) 25%, rgba(0, 159, 129, 1) 0%, rgba(0, 159, 129, 1) 50%, rgba(0, 159, 129, 0.9) 0%, rgba(0, 159, 129, 0.9) 75%, rgba(0, 159, 129, 1) 0%));overflow:hidden;animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;transition-property:width;transition-timing-function:linear;width:var(--width_mhngj);animation-duration:var(--duration_mhngj);transition-duration:var(--duration_mhngj)}.___SValue_mhngj_gg_.__theme_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}.___SProgressBar_mhngj_gg_._size_s_mhngj_gg_,.___SValue_mhngj_gg_._size_s_mhngj_gg_{height:4px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:8px 8px}.___SProgressBar_mhngj_gg_._size_m_mhngj_gg_,.___SValue_mhngj_gg_._size_m_mhngj_gg_{height:8px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:12px 12px}.___SProgressBar_mhngj_gg_._size_l_mhngj_gg_,.___SValue_mhngj_gg_._size_l_mhngj_gg_{height:12px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:16px 16px}.___SProgressBar_mhngj_gg_._theme_invert_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_{background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-pattern-gradient,\n linear-gradient(-45deg, rgba(224, 225, 233, 0.9) 25%, rgba(224, 225, 233, 1) 0%, rgba(224, 225, 233, 1) 50%, rgba(224, 225, 233, 0.9) 0%, rgba(224, 225, 233, 0.9) 75%, rgba(224, 225, 233, 1) 0%));animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;animation-duration:var(--duration_mhngj)}.___SProgressBar_mhngj_gg_._theme_custom_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}@media (prefers-reduced-motion){.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_,.___SValue_mhngj_gg_{animation-name:none}}", /*__inner_css_end__*/"mhngj_gg_"),
|
|
11
11
|
/*__reshadow_css_end__*/
|
|
12
12
|
{
|
|
13
|
-
"__SProgressBar": "
|
|
14
|
-
"_theme_dark": "
|
|
15
|
-
"__SValue": "
|
|
16
|
-
"--width": "--
|
|
17
|
-
"--duration": "--
|
|
18
|
-
"_theme": "
|
|
19
|
-
"--colorBg": "--
|
|
20
|
-
"_size_s": "
|
|
21
|
-
"_size_m": "
|
|
22
|
-
"_size_l": "
|
|
23
|
-
"_theme_invert": "
|
|
24
|
-
"@loading": "
|
|
25
|
-
"_animation": "
|
|
26
|
-
"_theme_custom": "
|
|
13
|
+
"__SProgressBar": "___SProgressBar_mhngj_gg_",
|
|
14
|
+
"_theme_dark": "_theme_dark_mhngj_gg_",
|
|
15
|
+
"__SValue": "___SValue_mhngj_gg_",
|
|
16
|
+
"--width": "--width_mhngj",
|
|
17
|
+
"--duration": "--duration_mhngj",
|
|
18
|
+
"_theme": "__theme_mhngj_gg_",
|
|
19
|
+
"--colorBg": "--colorBg_mhngj",
|
|
20
|
+
"_size_s": "_size_s_mhngj_gg_",
|
|
21
|
+
"_size_m": "_size_m_mhngj_gg_",
|
|
22
|
+
"_size_l": "_size_l_mhngj_gg_",
|
|
23
|
+
"_theme_invert": "_theme_invert_mhngj_gg_",
|
|
24
|
+
"@loading": "loading_mhngj",
|
|
25
|
+
"_animation": "__animation_mhngj_gg_",
|
|
26
|
+
"_theme_custom": "_theme_custom_mhngj_gg_"
|
|
27
27
|
});
|
|
28
28
|
function isCustomTheme(theme) {
|
|
29
29
|
if (!theme) return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","names":["Box","createComponent","Component","sstyled","Root","resolveColorEnhance","React","style","_sstyled","insert","isCustomTheme","theme","includes","ProgressBarRoot","getValueProps","value","duration","size","resolveColor","asProps","render","_ref","_ref3","SProgressBar","Children","styles","useTheme","createElement","cn","_assignProps","_defineProperty","children","ProgressBar","Value","props","_ref2","arguments[0]","_ref4","SValue","width","_assignProps2"],"sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","names":["Box","createComponent","Component","sstyled","Root","resolveColorEnhance","React","style","_sstyled","insert","isCustomTheme","theme","includes","ProgressBarRoot","getValueProps","value","duration","size","resolveColor","asProps","render","_ref","_ref3","SProgressBar","Children","styles","useTheme","createElement","cn","_assignProps","_defineProperty","children","ProgressBar","Value","props","_ref2","arguments[0]","_ref4","SValue","width","_assignProps2"],"sources":["../../src/ProgressBar.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type { NSProgressBar } from './ProgressBar.type';\nimport style from './style/progress-bar.shadow.css';\n\nfunction isCustomTheme(theme?: string) {\n if (!theme) return false;\n\n return !['dark', 'invert'].includes(theme);\n}\n\nclass ProgressBarRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSProgressBar.Component>,\n typeof ProgressBarRoot.enhance\n> {\n static displayName = 'ProgressBar';\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\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, resolveColor } = this.asProps;\n return {\n value,\n duration,\n size,\n resolveColor,\n };\n }\n\n render() {\n const SProgressBar = Root;\n const { Children, styles, duration, theme, value, resolveColor } = 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(\n props: Intergalactic.InternalTypings.InferChildComponentProps<\n NSProgressBar.Value.Component,\n typeof ProgressBarRoot,\n 'Value'\n >,\n) {\n const SValue = Root;\n const { styles, value, theme, duration, resolveColor } = 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}) as NSProgressBar.Component;\n\nexport default ProgressBar;\n"],"mappings":";;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAA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;AAAAuB,eAAA,CALhBjB,eAAe,aAMF,CAACR,mBAAmB,CAAC,CAAC,CAAC;AAAAyB,eAAA,CANpCjB,eAAe,kBAOG,OAAO;EAC3BG,QAAQ,EAAE,IAAI;EACdC,IAAI,EAAE,GAAG;EACTN,KAAK,EAAE,QAAQ;EACfoB,QAAQ,eAAEzB,KAAA,CAAAqB,aAAA,CAACK,WAAW,CAACC,KAAK,MAAE;AAChC,CAAC,CAAC;AAiCJ,SAASA,KAAKA,CACZC,KAIC,EACD;EAAA,IAAAC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACA,MAAMC,MAAM,GAMAtC,GAAG;EALf,MAAM;IAAEyB,MAAM;IAAEV,KAAK;IAAEJ,KAAK;IAAEK,QAAQ;IAAEE;EAAa,CAAC,GAAGgB,KAAK;EAC9D,MAAMK,KAAK,GAAG,GAAGxB,KAAK,GAAG;EAEzB,OAAAsB,KAAA,GAAOlC,OAAO,CAACsB,MAAM,CAAC,eACpBnB,KAAA,CAAAqB,aAAA,CAACW,MAAM,EAAAD,KAAA,CAAAT,EAAA;IAAA,GAAAY,aAAA;MAAA,aAEMD,KAAK;MAAA,gBACF,GAAGvB,QAAQ,IAAI;MAAA,WACpBE,YAAY,CAACP,KAAK;IAAC,GAAAwB,KAAA;EAAA,EAC7B,CAAC;AAEN;AAEA,MAAMH,WAAW,GAAG/B,eAAe,CAACY,eAAe,EAAE;EACnDoB;AACF,CAAC,CAA4B;AAE7B,eAAeD,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.type.js","names":[],"sources":["../../src/ProgressBar.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\n\
|
|
1
|
+
{"version":3,"file":"ProgressBar.type.js","names":[],"sources":["../../src/ProgressBar.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\n\ndeclare namespace NSProgressBar {\n type Props = BoxProps & {\n /**\n * Progress bar theme\n * @default invert\n */\n theme?: 'dark' | 'invert' | string;\n /**\n * Progress bar size\n * @default m\n */\n size?: 's' | 'm' | 'l';\n /** Value as a percentage */\n value?: number;\n /** Duration of animation, ms\n * @default 1000\n */\n duration?: number;\n };\n\n type Ctx = {\n getValueProps: PropGetterFn;\n };\n\n namespace Value {\n type Props = BoxProps & {\n /** Controls the size of the value bar */\n size?: 's' | 'm' | 'l';\n /** Progress value */\n value?: number;\n /** Animation diration in milliseconds for transitions */\n duration?: number;\n /** Color theme */\n theme?: string;\n };\n\n type Component = Intergalactic.Component<'div', Props>;\n }\n\n type Component = Intergalactic.Component<'div', Props, Ctx> & {\n Value: Value.Component;\n };\n}\n\n/** @deprecated It will be removed in v18. */\nexport type ProgressBarProps = NSProgressBar.Props;\n/** @deprecated It will be removed in v18. */\nexport type ValueProps = NSProgressBar.Value.Props;\n/** @deprecated It will be removed in v18. */\nexport type ProgressBarCxt = NSProgressBar.Ctx;\n\nexport type { NSProgressBar };\n"],"mappings":"","ignoreList":[]}
|
package/lib/esm/ProgressBar.mjs
CHANGED
|
@@ -3,29 +3,30 @@ import { sstyled, Component, assignProps, createComponent } from "@semcore/core"
|
|
|
3
3
|
import { Box } from "@semcore/base-components";
|
|
4
4
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
5
5
|
import React from "react";
|
|
6
|
+
/*!__reshadow-styles__:"./style/progress-bar.shadow.css"*/
|
|
6
7
|
const style = (
|
|
7
8
|
/*__reshadow_css_start__*/
|
|
8
9
|
(sstyled.insert(
|
|
9
10
|
/*__inner_css_start__*/
|
|
10
|
-
"@keyframes
|
|
11
|
+
"@keyframes loading_mhngj{0%{background-position:0 0}to{background-position:60px 0}}.___SProgressBar_mhngj_gg_{position:relative;width:100%;overflow:hidden;background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_._theme_dark_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg-invert, rgba(255, 255, 255, 0.2))}.___SValue_mhngj_gg_{position:absolute;top:0;left:0;background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-value-gradient,\n linear-gradient(-45deg, rgba(0, 159, 129, 0.9) 25%, rgba(0, 159, 129, 1) 0%, rgba(0, 159, 129, 1) 50%, rgba(0, 159, 129, 0.9) 0%, rgba(0, 159, 129, 0.9) 75%, rgba(0, 159, 129, 1) 0%));overflow:hidden;animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;transition-property:width;transition-timing-function:linear;width:var(--width_mhngj);animation-duration:var(--duration_mhngj);transition-duration:var(--duration_mhngj)}.___SValue_mhngj_gg_.__theme_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}.___SProgressBar_mhngj_gg_._size_s_mhngj_gg_,.___SValue_mhngj_gg_._size_s_mhngj_gg_{height:4px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:8px 8px}.___SProgressBar_mhngj_gg_._size_m_mhngj_gg_,.___SValue_mhngj_gg_._size_m_mhngj_gg_{height:8px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:12px 12px}.___SProgressBar_mhngj_gg_._size_l_mhngj_gg_,.___SValue_mhngj_gg_._size_l_mhngj_gg_{height:12px;border-radius:var(--intergalactic-progress-bar-rounded, 6px);background-size:16px 16px}.___SProgressBar_mhngj_gg_._theme_invert_mhngj_gg_{background-color:var(--intergalactic-progress-bar-bg, #e0e1e9)}.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_{background-color:var(--intergalactic-progress-bar-value-bg, #000000);background-image:var(--intergalactic-progress-bar-pattern-gradient,\n linear-gradient(-45deg, rgba(224, 225, 233, 0.9) 25%, rgba(224, 225, 233, 1) 0%, rgba(224, 225, 233, 1) 50%, rgba(224, 225, 233, 0.9) 0%, rgba(224, 225, 233, 0.9) 75%, rgba(224, 225, 233, 1) 0%));animation-name:loading_mhngj;animation-timing-function:linear;animation-iteration-count:infinite;animation-duration:var(--duration_mhngj)}.___SProgressBar_mhngj_gg_._theme_custom_mhngj_gg_{background-color:var(--colorBg_mhngj);background-image:var(--colorBg_mhngj)}@media (prefers-reduced-motion){.___SProgressBar_mhngj_gg_.__animation_mhngj_gg_,.___SValue_mhngj_gg_{animation-name:none}}",
|
|
11
12
|
/*__inner_css_end__*/
|
|
12
|
-
"
|
|
13
|
+
"mhngj_gg_"
|
|
13
14
|
), /*__reshadow_css_end__*/
|
|
14
15
|
{
|
|
15
|
-
"__SProgressBar": "
|
|
16
|
-
"_theme_dark": "
|
|
17
|
-
"__SValue": "
|
|
18
|
-
"--width": "--
|
|
19
|
-
"--duration": "--
|
|
20
|
-
"_theme": "
|
|
21
|
-
"--colorBg": "--
|
|
22
|
-
"_size_s": "
|
|
23
|
-
"_size_m": "
|
|
24
|
-
"_size_l": "
|
|
25
|
-
"_theme_invert": "
|
|
26
|
-
"@loading": "
|
|
27
|
-
"_animation": "
|
|
28
|
-
"_theme_custom": "
|
|
16
|
+
"__SProgressBar": "___SProgressBar_mhngj_gg_",
|
|
17
|
+
"_theme_dark": "_theme_dark_mhngj_gg_",
|
|
18
|
+
"__SValue": "___SValue_mhngj_gg_",
|
|
19
|
+
"--width": "--width_mhngj",
|
|
20
|
+
"--duration": "--duration_mhngj",
|
|
21
|
+
"_theme": "__theme_mhngj_gg_",
|
|
22
|
+
"--colorBg": "--colorBg_mhngj",
|
|
23
|
+
"_size_s": "_size_s_mhngj_gg_",
|
|
24
|
+
"_size_m": "_size_m_mhngj_gg_",
|
|
25
|
+
"_size_l": "_size_l_mhngj_gg_",
|
|
26
|
+
"_theme_invert": "_theme_invert_mhngj_gg_",
|
|
27
|
+
"@loading": "loading_mhngj",
|
|
28
|
+
"_animation": "__animation_mhngj_gg_",
|
|
29
|
+
"_theme_custom": "_theme_custom_mhngj_gg_"
|
|
29
30
|
})
|
|
30
31
|
);
|
|
31
32
|
function isCustomTheme(theme) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const ProgressBar:
|
|
1
|
+
import type { NSProgressBar } from './ProgressBar.type';
|
|
2
|
+
declare const ProgressBar: NSProgressBar.Component;
|
|
3
3
|
export default ProgressBar;
|
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
import type { BoxProps } from '@semcore/base-components';
|
|
2
2
|
import type { PropGetterFn, Intergalactic } from '@semcore/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
declare namespace NSProgressBar {
|
|
4
|
+
type Props = BoxProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Progress bar theme
|
|
7
|
+
* @default invert
|
|
8
|
+
*/
|
|
9
|
+
theme?: 'dark' | 'invert' | string;
|
|
10
|
+
/**
|
|
11
|
+
* Progress bar size
|
|
12
|
+
* @default m
|
|
13
|
+
*/
|
|
14
|
+
size?: 's' | 'm' | 'l';
|
|
15
|
+
/** Value as a percentage */
|
|
16
|
+
value?: number;
|
|
17
|
+
/** Duration of animation, ms
|
|
18
|
+
* @default 1000
|
|
19
|
+
*/
|
|
20
|
+
duration?: number;
|
|
21
|
+
};
|
|
22
|
+
type Ctx = {
|
|
23
|
+
getValueProps: PropGetterFn;
|
|
24
|
+
};
|
|
25
|
+
namespace Value {
|
|
26
|
+
type Props = BoxProps & {
|
|
27
|
+
/** Controls the size of the value bar */
|
|
28
|
+
size?: 's' | 'm' | 'l';
|
|
29
|
+
/** Progress value */
|
|
30
|
+
value?: number;
|
|
31
|
+
/** Animation diration in milliseconds for transitions */
|
|
32
|
+
duration?: number;
|
|
33
|
+
/** Color theme */
|
|
34
|
+
theme?: string;
|
|
35
|
+
};
|
|
36
|
+
type Component = Intergalactic.Component<'div', Props>;
|
|
37
|
+
}
|
|
38
|
+
type Component = Intergalactic.Component<'div', Props, Ctx> & {
|
|
39
|
+
Value: Value.Component;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** @deprecated It will be removed in v18. */
|
|
43
|
+
export type ProgressBarProps = NSProgressBar.Props;
|
|
44
|
+
/** @deprecated It will be removed in v18. */
|
|
45
|
+
export type ValueProps = NSProgressBar.Value.Props;
|
|
46
|
+
/** @deprecated It will be removed in v18. */
|
|
47
|
+
export type ProgressBarCxt = NSProgressBar.Ctx;
|
|
48
|
+
export type { NSProgressBar };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/progress-bar",
|
|
3
3
|
"description": "Semrush ProgressBar Component",
|
|
4
|
-
"version": "17.0.0",
|
|
4
|
+
"version": "17.0.2-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@semcore/base-components": "^17.0.
|
|
17
|
+
"@semcore/base-components": "^17.0.2"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"directory": "semcore/progress-bar"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@semcore/core": "17.0.
|
|
26
|
-
"@semcore/base-components": "17.0.0",
|
|
25
|
+
"@semcore/core": "17.0.1",
|
|
26
|
+
"@semcore/base-components": "17.0.2-prerelease.0",
|
|
27
27
|
"@semcore/testing-utils": "1.0.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|