ui-soxo-bootstrap-core 2.4.26 → 2.5.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.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * TimelinePanel Component
3
+ *
4
+ * - Displays a vertical timeline for a multi-step process.
5
+ * - Highlights active and completed steps visually.
6
+ * - Allows direct navigation by clicking on timeline steps.
7
+ * - Supports collapsing and expanding the timeline view.
8
+ * - Shows a loading skeleton while step data is being fetched.
9
+ *
10
+ * Used as a visual step navigator within a step-based workflow.
11
+ */
12
+
13
+ import React from 'react';
14
+ import { Skeleton } from 'antd';
15
+ import { LeftOutlined, RightOutlined } from '@ant-design/icons';
16
+ import { Card } from '../../lib';
17
+
18
+ export default function TimelinePanel({ loading, steps, activeStep, timelineCollapsed, handleTimelineClick, setTimelineCollapsed }) {
19
+ return (
20
+ <Card className="timeline-card">
21
+ {loading ? (
22
+ <Skeleton active />
23
+ ) : (
24
+ <div className={`timeline-sidebar ${timelineCollapsed ? 'collapsed' : ''}`}>
25
+ {steps.map((step, index) => (
26
+ <div
27
+ key={step.step_id}
28
+ className={`timeline-step
29
+ ${index === activeStep ? 'active' : ''}
30
+ ${index < activeStep ? 'completed' : ''}`}
31
+ onClick={() => handleTimelineClick(index)}
32
+ >
33
+ <div className="step-marker">
34
+ <div className="step-number">{index + 1}</div>
35
+ {index < steps.length - 1 && <div className="vertical-line"></div>}
36
+ </div>
37
+
38
+ {!timelineCollapsed && (
39
+ <div className="step-info">
40
+ <div className="step-title">Step {index + 1}</div>
41
+ <div className="step-main">{step.step_name}</div>
42
+ </div>
43
+ )}
44
+ </div>
45
+ ))}
46
+
47
+ <div className="toggle-arrow" onClick={() => setTimelineCollapsed(!timelineCollapsed)}>
48
+ {timelineCollapsed ? <RightOutlined /> : <LeftOutlined />}
49
+ </div>
50
+ </div>
51
+ )}
52
+ </Card>
53
+ );
54
+ }
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ testEnvironment: 'jsdom',
3
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
4
+ transform: {
5
+ '^.+\\.js$': 'babel-jest',
6
+ '\\.(css|scss)$': 'jest-transform-stub',
7
+ },
8
+ };
package/jest.setup.js ADDED
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.4.26",
3
+ "version": "2.5.0",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"
@@ -13,7 +13,7 @@
13
13
  "main": "index.js",
14
14
  "scripts": {
15
15
  "size": "size-limit",
16
- "test": "echo \"Error: no test specified\" && exit 1",
16
+ "test": "jest",
17
17
  "start": "webpack-dev-server --mode development",
18
18
  "transpile": "babel / -d build --copy-files",
19
19
  "build": "webpack --mode production",
@@ -82,10 +82,13 @@
82
82
  "devDependencies": {
83
83
  "@babel/core": "^7.16.5",
84
84
  "@babel/plugin-proposal-class-properties": "^7.10.4",
85
- "@babel/preset-env": "^7.10.4",
86
- "@babel/preset-react": "^7.10.4",
85
+ "@babel/preset-env": "^7.28.5",
86
+ "@babel/preset-react": "^7.28.5",
87
87
  "@eslint/compat": "^1.1.1",
88
88
  "@eslint/js": "^9.9.1",
89
+ "@testing-library/jest-dom": "^6.9.1",
90
+ "@testing-library/react": "^12.1.5",
91
+ "babel-jest": "^27.5.1",
89
92
  "babel-loader": "^8.3.0",
90
93
  "babel-plugin-transform-class-properties": "^6.24.1",
91
94
  "babel-plugin-transform-object-rest-spread": "^6.26.0",
@@ -100,6 +103,8 @@
100
103
  "eslint-plugin-unicorn": "^55.0.0",
101
104
  "globals": "^15.9.0",
102
105
  "husky": "^9.1.5",
106
+ "jest": "^27.5.1",
107
+ "jest-transform-stub": "^2.0.0",
103
108
  "prettier": "^3.3.3",
104
109
  "sass-loader": "^10.5.2",
105
110
  "style-loader": "^1.3.0",