@pallasoft/ps-core-components 2.7.0 → 2.8.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/dist/components/ps-step-progress.d.ts +7 -0
- package/dist/components/ps-step-progress.js +13 -0
- package/dist/constants/ps-step-progress-config.d.ts +5 -0
- package/dist/constants/ps-step-progress-config.js +8 -0
- package/dist/esm/components/ps-step-progress.js +9 -0
- package/dist/esm/constants/ps-step-progress-config.js +5 -0
- package/dist/esm/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsStepProgress = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ps_design_system_1 = require("@pallasoft/ps-design-system");
|
|
6
|
+
const ps_step_progress_config_1 = require("../constants/ps-step-progress-config");
|
|
7
|
+
const PsStepProgress = ({ className, label = ps_step_progress_config_1.PsStepProgressConfig.defaultLabel, total, value, }) => {
|
|
8
|
+
const steps = Math.max(total, ps_step_progress_config_1.PsStepProgressConfig.minimumTotal);
|
|
9
|
+
const done = Math.min(Math.max(value, 0), steps);
|
|
10
|
+
const percent = (done / steps) * ps_step_progress_config_1.PsStepProgressConfig.fullPercent;
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", { "aria-label": label, "aria-valuemax": steps, "aria-valuemin": 0, "aria-valuenow": done, className: ps_design_system_1.PallasoftClassNameService.merge('h-1 w-full overflow-hidden rounded-full bg-mist', className), role: 'progressbar', children: (0, jsx_runtime_1.jsx)("span", { className: 'block h-full rounded-full bg-primary transition-[width] duration-500 ease-out', style: { width: `${percent}%` } }) }));
|
|
12
|
+
};
|
|
13
|
+
exports.PsStepProgress = PsStepProgress;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PallasoftClassNameService } from '@pallasoft/ps-design-system';
|
|
3
|
+
import { PsStepProgressConfig } from '../constants/ps-step-progress-config';
|
|
4
|
+
export const PsStepProgress = ({ className, label = PsStepProgressConfig.defaultLabel, total, value, }) => {
|
|
5
|
+
const steps = Math.max(total, PsStepProgressConfig.minimumTotal);
|
|
6
|
+
const done = Math.min(Math.max(value, 0), steps);
|
|
7
|
+
const percent = (done / steps) * PsStepProgressConfig.fullPercent;
|
|
8
|
+
return (_jsx("div", { "aria-label": label, "aria-valuemax": steps, "aria-valuemin": 0, "aria-valuenow": done, className: PallasoftClassNameService.merge('h-1 w-full overflow-hidden rounded-full bg-mist', className), role: 'progressbar', children: _jsx("span", { className: 'block h-full rounded-full bg-primary transition-[width] duration-500 ease-out', style: { width: `${percent}%` } }) }));
|
|
9
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './components/ps-pill';
|
|
|
15
15
|
export * from './components/ps-portable-text';
|
|
16
16
|
export * from './components/ps-reflective-app-shell';
|
|
17
17
|
export * from './components/ps-navigation-progress';
|
|
18
|
+
export * from './components/ps-step-progress';
|
|
18
19
|
export * from './components/ps-section-header';
|
|
19
20
|
export * from './components/ps-site-header';
|
|
20
21
|
export * from './components/ps-skeleton';
|
|
@@ -41,3 +42,4 @@ export * from './hooks/use-ps-navigation-progress';
|
|
|
41
42
|
export * from './models/ps-draggable-grid';
|
|
42
43
|
export * from './constants/ps-draggable-grid';
|
|
43
44
|
export * from './constants/ps-navigation-progress-config';
|
|
45
|
+
export * from './constants/ps-step-progress-config';
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './components/ps-pill';
|
|
|
15
15
|
export * from './components/ps-portable-text';
|
|
16
16
|
export * from './components/ps-reflective-app-shell';
|
|
17
17
|
export * from './components/ps-navigation-progress';
|
|
18
|
+
export * from './components/ps-step-progress';
|
|
18
19
|
export * from './components/ps-section-header';
|
|
19
20
|
export * from './components/ps-site-header';
|
|
20
21
|
export * from './components/ps-skeleton';
|
|
@@ -41,3 +42,4 @@ export * from './hooks/use-ps-navigation-progress';
|
|
|
41
42
|
export * from './models/ps-draggable-grid';
|
|
42
43
|
export * from './constants/ps-draggable-grid';
|
|
43
44
|
export * from './constants/ps-navigation-progress-config';
|
|
45
|
+
export * from './constants/ps-step-progress-config';
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __exportStar(require("./components/ps-pill"), exports);
|
|
|
31
31
|
__exportStar(require("./components/ps-portable-text"), exports);
|
|
32
32
|
__exportStar(require("./components/ps-reflective-app-shell"), exports);
|
|
33
33
|
__exportStar(require("./components/ps-navigation-progress"), exports);
|
|
34
|
+
__exportStar(require("./components/ps-step-progress"), exports);
|
|
34
35
|
__exportStar(require("./components/ps-section-header"), exports);
|
|
35
36
|
__exportStar(require("./components/ps-site-header"), exports);
|
|
36
37
|
__exportStar(require("./components/ps-skeleton"), exports);
|
|
@@ -57,3 +58,4 @@ __exportStar(require("./hooks/use-ps-navigation-progress"), exports);
|
|
|
57
58
|
__exportStar(require("./models/ps-draggable-grid"), exports);
|
|
58
59
|
__exportStar(require("./constants/ps-draggable-grid"), exports);
|
|
59
60
|
__exportStar(require("./constants/ps-navigation-progress-config"), exports);
|
|
61
|
+
__exportStar(require("./constants/ps-step-progress-config"), exports);
|