funda-ui 4.6.399 → 4.7.103
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/README.md +1 -2
- package/Stepper/index.css +243 -0
- package/Stepper/index.d.ts +26 -0
- package/Stepper/index.js +556 -0
- package/Table/index.css +4 -4
- package/all.d.ts +1 -0
- package/all.js +1 -0
- package/lib/cjs/Stepper/index.d.ts +26 -0
- package/lib/cjs/Stepper/index.js +556 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/css/Stepper/index.css +243 -0
- package/lib/css/Table/index.css +4 -4
- package/lib/esm/Stepper/index.scss +306 -0
- package/lib/esm/Stepper/index.tsx +312 -0
- package/lib/esm/Table/index.scss +2 -2
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,8 +59,7 @@ Here is a table of the components and their status.
|
|
|
59
59
|
| [Event Calendar ✅🔥](packages/EventCalendar/README.md) | | | | |
|
|
60
60
|
| [Event Calendar Timeline ✅🔥](packages/EventCalendarTimeline/README.md) | | | | |
|
|
61
61
|
| [Chatbox ✅🔥🤖](packages/Chatbox/README.md) | | | | |
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
| [Stepper ✅](packages/Stepper/README.md) | | | | |
|
|
64
63
|
|
|
65
64
|
|
|
66
65
|
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/* ======================================================
|
|
2
|
+
<!-- Stepper -->
|
|
3
|
+
/* ====================================================== */
|
|
4
|
+
.stepper-container {
|
|
5
|
+
--stepper-color-default: #333;
|
|
6
|
+
--stepper-color-active: white;
|
|
7
|
+
--stepper-color-complete: #2563eb;
|
|
8
|
+
--stepper-indicator-default: white;
|
|
9
|
+
--stepper-indicator-active: #2563eb;
|
|
10
|
+
--stepper-indicator-complete: #22c55e;
|
|
11
|
+
--stepper-border-default: #ccc;
|
|
12
|
+
--stepper-border-active: #2563eb;
|
|
13
|
+
--stepper-border-complete: #22c55e;
|
|
14
|
+
--stepper-line-default: #dfdfdf;
|
|
15
|
+
--stepper-line-active: #2563eb;
|
|
16
|
+
--stepper-line-complete: #22c55e;
|
|
17
|
+
--stepper-indicator-size: 0.875rem;
|
|
18
|
+
--stepper-indicator-offset: 100px;
|
|
19
|
+
--stepper-title-size: 0.875rem;
|
|
20
|
+
position: relative;
|
|
21
|
+
/* Navigation Header (only horizontal) */
|
|
22
|
+
/* Main Navigation - Each step item (with circle + title) */
|
|
23
|
+
/* Line */
|
|
24
|
+
/* Indicator */
|
|
25
|
+
/* Title */
|
|
26
|
+
/* Panels Area */
|
|
27
|
+
/* Buttons */
|
|
28
|
+
/* Panel */
|
|
29
|
+
}
|
|
30
|
+
.stepper-container .stepper-header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
margin-bottom: 1.5rem;
|
|
34
|
+
flex-wrap: nowrap;
|
|
35
|
+
position: relative;
|
|
36
|
+
/* background line */
|
|
37
|
+
}
|
|
38
|
+
.stepper-container .stepper-header::before {
|
|
39
|
+
content: "";
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: calc(50% - 0.875rem); /* Subtract the height of the title */
|
|
42
|
+
left: 14px;
|
|
43
|
+
right: 0;
|
|
44
|
+
height: 2px;
|
|
45
|
+
background-color: var(--stepper-line-default);
|
|
46
|
+
z-index: 1;
|
|
47
|
+
width: calc(100% - var(--stepper-indicator-offset) / 2);
|
|
48
|
+
}
|
|
49
|
+
.stepper-container .stepper-header::after {
|
|
50
|
+
content: "";
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: calc(50% - 0.875rem); /* Subtract the height of the title */
|
|
53
|
+
left: 14px;
|
|
54
|
+
height: 2px;
|
|
55
|
+
background-color: var(--stepper-line-complete);
|
|
56
|
+
z-index: 2;
|
|
57
|
+
transition: width 0.3s ease-in-out;
|
|
58
|
+
width: 0;
|
|
59
|
+
}
|
|
60
|
+
.stepper-container .stepper-header::after {
|
|
61
|
+
width: var(--stepper-progress-width, 0%);
|
|
62
|
+
max-width: calc(100% - var(--stepper-indicator-offset) / 2);
|
|
63
|
+
}
|
|
64
|
+
.stepper-container .step-item {
|
|
65
|
+
flex: none;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
max-width: var(--stepper-indicator-offset);
|
|
70
|
+
position: relative;
|
|
71
|
+
z-index: 3;
|
|
72
|
+
}
|
|
73
|
+
.stepper-container .step-item.step-item--clickable {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
.stepper-container .step-line {
|
|
77
|
+
flex: 1;
|
|
78
|
+
height: 2px;
|
|
79
|
+
background-color: var(--stepper-line-default);
|
|
80
|
+
margin: 0 4px;
|
|
81
|
+
position: relative;
|
|
82
|
+
top: -10px;
|
|
83
|
+
z-index: 0;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
opacity: 0;
|
|
86
|
+
}
|
|
87
|
+
.stepper-container .step-line--active {
|
|
88
|
+
background-color: var(--stepper-line-default);
|
|
89
|
+
}
|
|
90
|
+
.stepper-container .step-line--complete {
|
|
91
|
+
background-color: var(--stepper-line-default);
|
|
92
|
+
}
|
|
93
|
+
.stepper-container .step-line::after {
|
|
94
|
+
content: "";
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 100%;
|
|
100
|
+
background-color: var(--stepper-line-complete);
|
|
101
|
+
transform: scaleX(0);
|
|
102
|
+
transform-origin: left;
|
|
103
|
+
transition: transform 0.3s ease-in-out;
|
|
104
|
+
}
|
|
105
|
+
.stepper-container .step-line--active::after, .stepper-container .step-line--complete::after {
|
|
106
|
+
transform: scaleX(1);
|
|
107
|
+
}
|
|
108
|
+
.stepper-container .step-indicator {
|
|
109
|
+
width: 32px;
|
|
110
|
+
height: 32px;
|
|
111
|
+
margin: 0 auto 0.25rem;
|
|
112
|
+
border-radius: 9999px;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
border: 2px solid #ccc;
|
|
117
|
+
font-size: var(--stepper-indicator-size);
|
|
118
|
+
/* default */
|
|
119
|
+
background-color: var(--stepper-indicator-default);
|
|
120
|
+
color: var(--stepper-color-default);
|
|
121
|
+
border-color: var(--stepper-border-default);
|
|
122
|
+
}
|
|
123
|
+
.stepper-container .step-indicator--active {
|
|
124
|
+
background-color: var(--stepper-indicator-active);
|
|
125
|
+
color: var(--stepper-color-active);
|
|
126
|
+
border-color: var(--stepper-border-active);
|
|
127
|
+
}
|
|
128
|
+
.stepper-container .step-indicator--complete {
|
|
129
|
+
background-color: var(--stepper-indicator-complete);
|
|
130
|
+
color: var(--stepper-color-active);
|
|
131
|
+
border-color: var(--stepper-border-complete);
|
|
132
|
+
}
|
|
133
|
+
.stepper-container .step-title {
|
|
134
|
+
font-size: var(--stepper-title-size);
|
|
135
|
+
/* default */
|
|
136
|
+
color: var(--stepper-color-default);
|
|
137
|
+
}
|
|
138
|
+
.stepper-container .step-title--active {
|
|
139
|
+
font-weight: bold;
|
|
140
|
+
}
|
|
141
|
+
.stepper-container .stepper-buttons {
|
|
142
|
+
display: flex;
|
|
143
|
+
justify-content: space-between;
|
|
144
|
+
margin-top: 1rem;
|
|
145
|
+
}
|
|
146
|
+
.stepper-container .stepper-panel {
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
149
|
+
.stepper-container .stepper-panel-header {
|
|
150
|
+
font-size: 1.25rem;
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
margin-bottom: 1rem;
|
|
153
|
+
display: none;
|
|
154
|
+
}
|
|
155
|
+
.stepper-container .stepper-panel-content {
|
|
156
|
+
width: 100%;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/*------ Verticle ------*/
|
|
160
|
+
.stepper-container.stepper-container--vertical {
|
|
161
|
+
--stepper-indicator-offset: 50px;
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: 1rem; /* line length */
|
|
165
|
+
/* background line */
|
|
166
|
+
/* Layout */
|
|
167
|
+
/* Title */
|
|
168
|
+
/* Panel */
|
|
169
|
+
/* Line */
|
|
170
|
+
}
|
|
171
|
+
.stepper-container.stepper-container--vertical::before {
|
|
172
|
+
content: "";
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: 20px;
|
|
175
|
+
left: 24px;
|
|
176
|
+
width: 2px;
|
|
177
|
+
height: calc(100% - var(--stepper-indicator-offset));
|
|
178
|
+
background-color: var(--stepper-line-default);
|
|
179
|
+
z-index: 1;
|
|
180
|
+
}
|
|
181
|
+
.stepper-container.stepper-container--vertical::after {
|
|
182
|
+
content: "";
|
|
183
|
+
position: absolute;
|
|
184
|
+
top: 20px;
|
|
185
|
+
left: 24px;
|
|
186
|
+
width: 2px;
|
|
187
|
+
background-color: var(--stepper-line-complete);
|
|
188
|
+
z-index: 2;
|
|
189
|
+
transition: height 0.3s ease-in-out;
|
|
190
|
+
height: 0;
|
|
191
|
+
}
|
|
192
|
+
.stepper-container.stepper-container--vertical::after {
|
|
193
|
+
height: var(--stepper-progress-height, 0%);
|
|
194
|
+
max-height: calc(100% - var(--stepper-indicator-offset));
|
|
195
|
+
}
|
|
196
|
+
.stepper-container.stepper-container--vertical .vertical-step-row {
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: flex-start;
|
|
199
|
+
}
|
|
200
|
+
.stepper-container.stepper-container--vertical .vertical-step-left {
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
width: var(--stepper-indicator-offset);
|
|
203
|
+
position: relative;
|
|
204
|
+
/* Main Navigation - Each step item (with circle + title) */
|
|
205
|
+
/* Line */
|
|
206
|
+
}
|
|
207
|
+
.stepper-container.stepper-container--vertical .vertical-step-left .step-item {
|
|
208
|
+
margin-top: 20px;
|
|
209
|
+
}
|
|
210
|
+
.stepper-container.stepper-container--vertical .vertical-step-left .step-line {
|
|
211
|
+
position: absolute;
|
|
212
|
+
left: 20px;
|
|
213
|
+
opacity: 0;
|
|
214
|
+
}
|
|
215
|
+
.stepper-container.stepper-container--vertical .vertical-step-right {
|
|
216
|
+
flex: 1;
|
|
217
|
+
left: 70px;
|
|
218
|
+
width: calc(100% - 70px);
|
|
219
|
+
position: absolute;
|
|
220
|
+
top: 1.5rem;
|
|
221
|
+
}
|
|
222
|
+
.stepper-container.stepper-container--vertical .step-title {
|
|
223
|
+
display: none;
|
|
224
|
+
margin-left: 0.3rem;
|
|
225
|
+
}
|
|
226
|
+
.stepper-container.stepper-container--vertical .stepper-panel-header {
|
|
227
|
+
display: block;
|
|
228
|
+
}
|
|
229
|
+
.stepper-container.stepper-container--vertical .step-line {
|
|
230
|
+
flex: auto;
|
|
231
|
+
width: 2px;
|
|
232
|
+
height: 40px;
|
|
233
|
+
margin-top: 4px;
|
|
234
|
+
top: auto;
|
|
235
|
+
left: -24px;
|
|
236
|
+
}
|
|
237
|
+
.stepper-container.stepper-container--vertical .step-line::after {
|
|
238
|
+
transform-origin: top;
|
|
239
|
+
transform: scaleY(0);
|
|
240
|
+
}
|
|
241
|
+
.stepper-container.stepper-container--vertical .step-line--active::after, .stepper-container.stepper-container--vertical .step-line--complete::after {
|
|
242
|
+
transform: scaleY(1);
|
|
243
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface StepperPanelProps {
|
|
3
|
+
header: React.ReactNode;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
interface StepperProps {
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
indicatorClickAllowed?: boolean;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
initialStep?: number;
|
|
12
|
+
layout?: 'horizontal' | 'vertical';
|
|
13
|
+
completeIcon?: React.ReactNode;
|
|
14
|
+
disableCompleteIcon?: boolean;
|
|
15
|
+
onChange?: (index: number, isLastStepComplete: boolean) => void;
|
|
16
|
+
children: React.ReactElement<StepperPanelProps>[];
|
|
17
|
+
}
|
|
18
|
+
interface StepperRef {
|
|
19
|
+
goto: (index: number) => void;
|
|
20
|
+
next: () => void;
|
|
21
|
+
prev: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const StepperPanel: React.FC<StepperPanelProps>;
|
|
24
|
+
declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>>;
|
|
25
|
+
export { Stepper, StepperPanel };
|
|
26
|
+
export type { StepperProps, StepperPanelProps, StepperRef };
|