@reliability-design/web 1.0.2
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/rel-accordion/rel-accordion.stories.ts +313 -0
- package/dist/components/rel-accordion/rel-accordion.ts +114 -0
- package/dist/components/rel-alert/rel-alert.stories.ts +412 -0
- package/dist/components/rel-alert/rel-alert.ts +194 -0
- package/dist/components/rel-avatar/rel-avatar.stories.ts +327 -0
- package/dist/components/rel-avatar/rel-avatar.ts +100 -0
- package/dist/components/rel-badge/rel-badge.stories.ts +350 -0
- package/dist/components/rel-badge/rel-badge.ts +70 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +306 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +97 -0
- package/dist/components/rel-button/rel-button.stories.ts +356 -0
- package/dist/components/rel-button/rel-button.ts +204 -0
- package/dist/components/rel-card/rel-card.stories.ts +299 -0
- package/dist/components/rel-card/rel-card.ts +33 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +368 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +80 -0
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +414 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +164 -0
- package/dist/components/rel-chip/rel-chip.stories.ts +552 -0
- package/dist/components/rel-chip/rel-chip.ts +261 -0
- package/dist/components/rel-container/rel-container.stories.ts +239 -0
- package/dist/components/rel-container/rel-container.ts +74 -0
- package/dist/components/rel-divider/rel-divider.stories.ts +229 -0
- package/dist/components/rel-divider/rel-divider.ts +44 -0
- package/dist/components/rel-layout/rel-layout.stories.ts +713 -0
- package/dist/components/rel-layout/rel-layout.ts +60 -0
- package/dist/components/rel-menu/rel-menu.stories.ts +910 -0
- package/dist/components/rel-menu/rel-menu.ts +319 -0
- package/dist/components/rel-progress/rel-progress.stories.ts +817 -0
- package/dist/components/rel-progress/rel-progress.ts +182 -0
- package/dist/components/rel-radio/rel-radio.stories.ts +1048 -0
- package/dist/components/rel-radio/rel-radio.ts +187 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +1079 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +150 -0
- package/dist/components/rel-select/rel-select.stories.ts +1201 -0
- package/dist/components/rel-select/rel-select.ts +261 -0
- package/dist/components/rel-slider/rel-slider.stories.ts +730 -0
- package/dist/components/rel-slider/rel-slider.ts +440 -0
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +808 -0
- package/dist/components/rel-snackbar/rel-snackbar.ts +212 -0
- package/dist/components/rel-stepper/rel-stepper.stories.ts +752 -0
- package/dist/components/rel-stepper/rel-stepper.ts +425 -0
- package/dist/components/rel-switch/rel-switch.stories.ts +441 -0
- package/dist/components/rel-switch/rel-switch.ts +161 -0
- package/dist/components/rel-tab/rel-tab.stories.ts +492 -0
- package/dist/components/rel-tab/rel-tab.ts +145 -0
- package/dist/components/rel-textfield/rel-textfield.stories.ts +710 -0
- package/dist/components/rel-textfield/rel-textfield.ts +224 -0
- package/dist/components/rel-toast/rel-toast.stories.ts +394 -0
- package/dist/components/rel-toast/rel-toast.ts +154 -0
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +364 -0
- package/dist/components/rel-tooltip/rel-tooltip.ts +80 -0
- package/dist/index.d.mts +372 -0
- package/dist/index.d.ts +372 -0
- package/dist/index.js +4593 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4544 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/vars.css +184 -0
- package/package.json +32 -0
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
+
import { html } from "lit";
|
|
3
|
+
import "./rel-stepper";
|
|
4
|
+
import type { Step } from "./rel-stepper";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Stepper component displays progress through a sequence of logical and numbered steps.
|
|
8
|
+
* Built with Lit web components for framework-agnostic usage with full token support.
|
|
9
|
+
*
|
|
10
|
+
* ## Features
|
|
11
|
+
* - **Multiple Orientations**: Horizontal or vertical layout
|
|
12
|
+
* - **Text Alignment**: Text below or to the right of indicators
|
|
13
|
+
* - **Size Variants**: Small or large connector spacing
|
|
14
|
+
* - **Step States**: Done (with checkmark), in progress, or disabled
|
|
15
|
+
* - **Customizable Steps**: Define your own step titles and statuses
|
|
16
|
+
* - **Token-Based Styling**: Uses design system tokens
|
|
17
|
+
* - **Accessible**: Semantic HTML structure
|
|
18
|
+
*/
|
|
19
|
+
const meta: Meta = {
|
|
20
|
+
title: "Components/Stepper",
|
|
21
|
+
tags: ["autodocs"],
|
|
22
|
+
component: "rel-stepper",
|
|
23
|
+
argTypes: {
|
|
24
|
+
orientation: {
|
|
25
|
+
control: { type: "select" },
|
|
26
|
+
options: ["horizontal", "vertical"],
|
|
27
|
+
description: "Layout orientation",
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: { summary: "horizontal" },
|
|
30
|
+
type: { summary: "horizontal | vertical" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
textAlign: {
|
|
34
|
+
control: { type: "select" },
|
|
35
|
+
options: ["below", "right"],
|
|
36
|
+
description: "Text alignment relative to step indicator",
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: { summary: "below" },
|
|
39
|
+
type: { summary: "below | right" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
control: { type: "select" },
|
|
44
|
+
options: ["small", "large"],
|
|
45
|
+
description: "Connector line spacing",
|
|
46
|
+
table: {
|
|
47
|
+
defaultValue: { summary: "large" },
|
|
48
|
+
type: { summary: "small | large" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
type Story = StoryObj;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Default horizontal stepper with large spacing
|
|
59
|
+
*/
|
|
60
|
+
export const Default: Story = {
|
|
61
|
+
render: () => {
|
|
62
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
63
|
+
stepper.steps = [
|
|
64
|
+
{ title: "Select campaign settings", status: "done" },
|
|
65
|
+
{ title: "Create an ad group", status: "progress" },
|
|
66
|
+
{ title: "Create an ad", status: "disabled" },
|
|
67
|
+
];
|
|
68
|
+
return stepper;
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Horizontal stepper with small spacing
|
|
74
|
+
*/
|
|
75
|
+
export const HorizontalSmall: Story = {
|
|
76
|
+
render: () => {
|
|
77
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
78
|
+
stepper.steps = [
|
|
79
|
+
{ title: "Select campaign settings", status: "done" },
|
|
80
|
+
{ title: "Create an ad group", status: "progress" },
|
|
81
|
+
{ title: "Create an ad", status: "disabled" },
|
|
82
|
+
];
|
|
83
|
+
stepper.size = "small";
|
|
84
|
+
return stepper;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Vertical stepper with text to the right
|
|
90
|
+
*/
|
|
91
|
+
export const VerticalTextRight: Story = {
|
|
92
|
+
render: () => {
|
|
93
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
94
|
+
stepper.steps = [
|
|
95
|
+
{ title: "Select campaign settings", status: "done" },
|
|
96
|
+
{ title: "Create an ad group", status: "progress" },
|
|
97
|
+
{ title: "Create an ad", status: "disabled" },
|
|
98
|
+
];
|
|
99
|
+
stepper.orientation = "vertical";
|
|
100
|
+
stepper.textAlign = "right";
|
|
101
|
+
return stepper;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Vertical stepper with text below
|
|
107
|
+
*/
|
|
108
|
+
export const VerticalTextBelow: Story = {
|
|
109
|
+
render: () => {
|
|
110
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
111
|
+
stepper.steps = [
|
|
112
|
+
{ title: "Select campaign settings", status: "done" },
|
|
113
|
+
{ title: "Create an ad group", status: "progress" },
|
|
114
|
+
{ title: "Create an ad", status: "disabled" },
|
|
115
|
+
];
|
|
116
|
+
stepper.orientation = "vertical";
|
|
117
|
+
stepper.textAlign = "below";
|
|
118
|
+
return stepper;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Vertical stepper with small spacing
|
|
124
|
+
*/
|
|
125
|
+
export const VerticalSmall: Story = {
|
|
126
|
+
render: () => {
|
|
127
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
128
|
+
stepper.steps = [
|
|
129
|
+
{ title: "Select campaign settings", status: "done" },
|
|
130
|
+
{ title: "Create an ad group", status: "progress" },
|
|
131
|
+
{ title: "Create an ad", status: "disabled" },
|
|
132
|
+
];
|
|
133
|
+
stepper.orientation = "vertical";
|
|
134
|
+
stepper.textAlign = "right";
|
|
135
|
+
stepper.size = "small";
|
|
136
|
+
return stepper;
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* All steps completed
|
|
142
|
+
*/
|
|
143
|
+
export const AllCompleted: Story = {
|
|
144
|
+
render: () => {
|
|
145
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
146
|
+
stepper.steps = [
|
|
147
|
+
{ title: "Account created", status: "done" },
|
|
148
|
+
{ title: "Email verified", status: "done" },
|
|
149
|
+
{ title: "Profile completed", status: "done" },
|
|
150
|
+
{ title: "Payment added", status: "done" },
|
|
151
|
+
];
|
|
152
|
+
return stepper;
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* First step in progress
|
|
158
|
+
*/
|
|
159
|
+
export const FirstStepActive: Story = {
|
|
160
|
+
render: () => {
|
|
161
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
162
|
+
stepper.steps = [
|
|
163
|
+
{ title: "Personal info", status: "progress" },
|
|
164
|
+
{ title: "Address", status: "disabled" },
|
|
165
|
+
{ title: "Payment", status: "disabled" },
|
|
166
|
+
{ title: "Review", status: "disabled" },
|
|
167
|
+
];
|
|
168
|
+
return stepper;
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Last step in progress
|
|
174
|
+
*/
|
|
175
|
+
export const LastStepActive: Story = {
|
|
176
|
+
render: () => {
|
|
177
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
178
|
+
stepper.steps = [
|
|
179
|
+
{ title: "Cart", status: "done" },
|
|
180
|
+
{ title: "Shipping", status: "done" },
|
|
181
|
+
{ title: "Payment", status: "done" },
|
|
182
|
+
{ title: "Confirmation", status: "progress" },
|
|
183
|
+
];
|
|
184
|
+
return stepper;
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Two steps only
|
|
190
|
+
*/
|
|
191
|
+
export const TwoSteps: Story = {
|
|
192
|
+
render: () => {
|
|
193
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
194
|
+
stepper.steps = [
|
|
195
|
+
{ title: "Basic info", status: "done" },
|
|
196
|
+
{ title: "Review", status: "progress" },
|
|
197
|
+
];
|
|
198
|
+
return stepper;
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Five steps workflow
|
|
204
|
+
*/
|
|
205
|
+
export const FiveSteps: Story = {
|
|
206
|
+
render: () => {
|
|
207
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
208
|
+
stepper.steps = [
|
|
209
|
+
{ title: "Step 1", status: "done" },
|
|
210
|
+
{ title: "Step 2", status: "done" },
|
|
211
|
+
{ title: "Step 3", status: "progress" },
|
|
212
|
+
{ title: "Step 4", status: "disabled" },
|
|
213
|
+
{ title: "Step 5", status: "disabled" },
|
|
214
|
+
];
|
|
215
|
+
return stepper;
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Onboarding flow
|
|
221
|
+
*/
|
|
222
|
+
export const OnboardingFlow: Story = {
|
|
223
|
+
render: () => {
|
|
224
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
225
|
+
stepper.steps = [
|
|
226
|
+
{ title: "Welcome", status: "done" },
|
|
227
|
+
{ title: "Profile setup", status: "done" },
|
|
228
|
+
{ title: "Preferences", status: "progress" },
|
|
229
|
+
{ title: "Finish", status: "disabled" },
|
|
230
|
+
];
|
|
231
|
+
stepper.orientation = "vertical";
|
|
232
|
+
stepper.textAlign = "right";
|
|
233
|
+
return stepper;
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Checkout process
|
|
239
|
+
*/
|
|
240
|
+
export const CheckoutProcess: Story = {
|
|
241
|
+
render: () => {
|
|
242
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
243
|
+
stepper.steps = [
|
|
244
|
+
{ title: "Shopping cart", status: "done" },
|
|
245
|
+
{ title: "Shipping info", status: "done" },
|
|
246
|
+
{ title: "Payment", status: "progress" },
|
|
247
|
+
{ title: "Confirm order", status: "disabled" },
|
|
248
|
+
];
|
|
249
|
+
return stepper;
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Registration wizard
|
|
255
|
+
*/
|
|
256
|
+
export const RegistrationWizard: Story = {
|
|
257
|
+
render: () => {
|
|
258
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
259
|
+
stepper.steps = [
|
|
260
|
+
{ title: "Account details", status: "done" },
|
|
261
|
+
{ title: "Personal info", status: "progress" },
|
|
262
|
+
{ title: "Verification", status: "disabled" },
|
|
263
|
+
];
|
|
264
|
+
stepper.orientation = "vertical";
|
|
265
|
+
stepper.textAlign = "right";
|
|
266
|
+
stepper.size = "small";
|
|
267
|
+
return stepper;
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Interactive stepper demo
|
|
273
|
+
*/
|
|
274
|
+
export const Interactive: Story = {
|
|
275
|
+
render: () => {
|
|
276
|
+
const steps: Step[] = [
|
|
277
|
+
{ title: "Step 1", status: "progress" },
|
|
278
|
+
{ title: "Step 2", status: "disabled" },
|
|
279
|
+
{ title: "Step 3", status: "disabled" },
|
|
280
|
+
{ title: "Step 4", status: "disabled" },
|
|
281
|
+
];
|
|
282
|
+
|
|
283
|
+
let currentStep = 0;
|
|
284
|
+
|
|
285
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
286
|
+
stepper.steps = [...steps];
|
|
287
|
+
|
|
288
|
+
const nextButton = document.createElement("button");
|
|
289
|
+
nextButton.textContent = "Next Step";
|
|
290
|
+
nextButton.style.cssText = `
|
|
291
|
+
margin-top: 24px;
|
|
292
|
+
padding: 12px 24px;
|
|
293
|
+
background: var(--rel-colors-black);
|
|
294
|
+
color: white;
|
|
295
|
+
border: none;
|
|
296
|
+
border-radius: 6px;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
299
|
+
font-size: var(--rel-fontSizes-sm);
|
|
300
|
+
`;
|
|
301
|
+
|
|
302
|
+
const prevButton = document.createElement("button");
|
|
303
|
+
prevButton.textContent = "Previous Step";
|
|
304
|
+
prevButton.style.cssText = `
|
|
305
|
+
margin-top: 24px;
|
|
306
|
+
margin-right: 12px;
|
|
307
|
+
padding: 12px 24px;
|
|
308
|
+
background: white;
|
|
309
|
+
color: var(--rel-colors-black);
|
|
310
|
+
border: 1px solid var(--rel-colors-gray-border);
|
|
311
|
+
border-radius: 6px;
|
|
312
|
+
cursor: pointer;
|
|
313
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
314
|
+
font-size: var(--rel-fontSizes-sm);
|
|
315
|
+
`;
|
|
316
|
+
prevButton.disabled = true;
|
|
317
|
+
prevButton.style.opacity = "0.5";
|
|
318
|
+
|
|
319
|
+
const updateButtons = () => {
|
|
320
|
+
prevButton.disabled = currentStep === 0;
|
|
321
|
+
prevButton.style.opacity = currentStep === 0 ? "0.5" : "1";
|
|
322
|
+
prevButton.style.cursor = currentStep === 0 ? "not-allowed" : "pointer";
|
|
323
|
+
|
|
324
|
+
nextButton.disabled = currentStep === steps.length - 1;
|
|
325
|
+
nextButton.style.opacity = currentStep === steps.length - 1 ? "0.5" : "1";
|
|
326
|
+
nextButton.style.cursor =
|
|
327
|
+
currentStep === steps.length - 1 ? "not-allowed" : "pointer";
|
|
328
|
+
|
|
329
|
+
if (currentStep === steps.length - 1) {
|
|
330
|
+
nextButton.textContent = "Completed!";
|
|
331
|
+
} else {
|
|
332
|
+
nextButton.textContent = "Next Step";
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
nextButton.addEventListener("click", () => {
|
|
337
|
+
if (currentStep < steps.length - 1) {
|
|
338
|
+
steps[currentStep].status = "done";
|
|
339
|
+
currentStep++;
|
|
340
|
+
steps[currentStep].status = "progress";
|
|
341
|
+
stepper.steps = [...steps];
|
|
342
|
+
updateButtons();
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
prevButton.addEventListener("click", () => {
|
|
347
|
+
if (currentStep > 0) {
|
|
348
|
+
steps[currentStep].status = "disabled";
|
|
349
|
+
currentStep--;
|
|
350
|
+
steps[currentStep].status = "progress";
|
|
351
|
+
stepper.steps = [...steps];
|
|
352
|
+
updateButtons();
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const container = document.createElement("div");
|
|
357
|
+
container.appendChild(stepper);
|
|
358
|
+
const buttonContainer = document.createElement("div");
|
|
359
|
+
buttonContainer.appendChild(prevButton);
|
|
360
|
+
buttonContainer.appendChild(nextButton);
|
|
361
|
+
container.appendChild(buttonContainer);
|
|
362
|
+
|
|
363
|
+
return container;
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Horizontal layout with text to the right and large spacing
|
|
369
|
+
*/
|
|
370
|
+
export const HorizontalTextRightLarge: Story = {
|
|
371
|
+
render: () => {
|
|
372
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
373
|
+
stepper.steps = [
|
|
374
|
+
{ title: "Select products", status: "done" },
|
|
375
|
+
{ title: "Configure options", status: "progress" },
|
|
376
|
+
{ title: "Review", status: "disabled" },
|
|
377
|
+
];
|
|
378
|
+
stepper.orientation = "horizontal";
|
|
379
|
+
stepper.textAlign = "right";
|
|
380
|
+
stepper.size = "large";
|
|
381
|
+
return stepper;
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Horizontal layout with text to the right and small spacing
|
|
387
|
+
*/
|
|
388
|
+
export const HorizontalTextRightSmall: Story = {
|
|
389
|
+
render: () => {
|
|
390
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
391
|
+
stepper.steps = [
|
|
392
|
+
{ title: "Select products", status: "done" },
|
|
393
|
+
{ title: "Configure options", status: "progress" },
|
|
394
|
+
{ title: "Review", status: "disabled" },
|
|
395
|
+
];
|
|
396
|
+
stepper.orientation = "horizontal";
|
|
397
|
+
stepper.textAlign = "right";
|
|
398
|
+
stepper.size = "small";
|
|
399
|
+
return stepper;
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Horizontal layout with text below and large spacing
|
|
405
|
+
*/
|
|
406
|
+
export const HorizontalTextBelowLarge: Story = {
|
|
407
|
+
render: () => {
|
|
408
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
409
|
+
stepper.steps = [
|
|
410
|
+
{ title: "Choose plan", status: "done" },
|
|
411
|
+
{ title: "Billing details", status: "progress" },
|
|
412
|
+
{ title: "Confirmation", status: "disabled" },
|
|
413
|
+
];
|
|
414
|
+
stepper.orientation = "horizontal";
|
|
415
|
+
stepper.textAlign = "below";
|
|
416
|
+
stepper.size = "large";
|
|
417
|
+
return stepper;
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Horizontal layout with text below and small spacing
|
|
423
|
+
*/
|
|
424
|
+
export const HorizontalTextBelowSmall: Story = {
|
|
425
|
+
render: () => {
|
|
426
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
427
|
+
stepper.steps = [
|
|
428
|
+
{ title: "Choose plan", status: "done" },
|
|
429
|
+
{ title: "Billing details", status: "progress" },
|
|
430
|
+
{ title: "Confirmation", status: "disabled" },
|
|
431
|
+
];
|
|
432
|
+
stepper.orientation = "horizontal";
|
|
433
|
+
stepper.textAlign = "below";
|
|
434
|
+
stepper.size = "small";
|
|
435
|
+
return stepper;
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Vertical layout with text to the right and large spacing
|
|
441
|
+
*/
|
|
442
|
+
export const VerticalTextRightLarge: Story = {
|
|
443
|
+
render: () => {
|
|
444
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
445
|
+
stepper.steps = [
|
|
446
|
+
{ title: "Create account", status: "done" },
|
|
447
|
+
{ title: "Verify email", status: "progress" },
|
|
448
|
+
{ title: "Complete profile", status: "disabled" },
|
|
449
|
+
];
|
|
450
|
+
stepper.orientation = "vertical";
|
|
451
|
+
stepper.textAlign = "right";
|
|
452
|
+
stepper.size = "large";
|
|
453
|
+
return stepper;
|
|
454
|
+
},
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Vertical layout with text to the right and small spacing
|
|
459
|
+
*/
|
|
460
|
+
export const VerticalTextRightSmall: Story = {
|
|
461
|
+
render: () => {
|
|
462
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
463
|
+
stepper.steps = [
|
|
464
|
+
{ title: "Create account", status: "done" },
|
|
465
|
+
{ title: "Verify email", status: "progress" },
|
|
466
|
+
{ title: "Complete profile", status: "disabled" },
|
|
467
|
+
];
|
|
468
|
+
stepper.orientation = "vertical";
|
|
469
|
+
stepper.textAlign = "right";
|
|
470
|
+
stepper.size = "small";
|
|
471
|
+
return stepper;
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Vertical layout with text below and large spacing
|
|
477
|
+
*/
|
|
478
|
+
export const VerticalTextBelowLarge: Story = {
|
|
479
|
+
render: () => {
|
|
480
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
481
|
+
stepper.steps = [
|
|
482
|
+
{ title: "Upload files", status: "done" },
|
|
483
|
+
{ title: "Configure settings", status: "progress" },
|
|
484
|
+
{ title: "Process", status: "disabled" },
|
|
485
|
+
];
|
|
486
|
+
stepper.orientation = "vertical";
|
|
487
|
+
stepper.textAlign = "below";
|
|
488
|
+
stepper.size = "large";
|
|
489
|
+
return stepper;
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Vertical layout with text below and small spacing
|
|
495
|
+
*/
|
|
496
|
+
export const VerticalTextBelowSmall: Story = {
|
|
497
|
+
render: () => {
|
|
498
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
499
|
+
stepper.steps = [
|
|
500
|
+
{ title: "Upload files", status: "done" },
|
|
501
|
+
{ title: "Configure settings", status: "progress" },
|
|
502
|
+
{ title: "Process", status: "disabled" },
|
|
503
|
+
];
|
|
504
|
+
stepper.orientation = "vertical";
|
|
505
|
+
stepper.textAlign = "below";
|
|
506
|
+
stepper.size = "small";
|
|
507
|
+
return stepper;
|
|
508
|
+
},
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* All steps disabled (not started)
|
|
513
|
+
*/
|
|
514
|
+
export const AllDisabled: Story = {
|
|
515
|
+
render: () => {
|
|
516
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
517
|
+
stepper.steps = [
|
|
518
|
+
{ title: "Personal info", status: "disabled" },
|
|
519
|
+
{ title: "Contact details", status: "disabled" },
|
|
520
|
+
{ title: "Preferences", status: "disabled" },
|
|
521
|
+
{ title: "Review", status: "disabled" },
|
|
522
|
+
];
|
|
523
|
+
return stepper;
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Multi-step e-commerce checkout flow
|
|
529
|
+
*/
|
|
530
|
+
export const EcommerceCheckout: Story = {
|
|
531
|
+
render: () => {
|
|
532
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
533
|
+
stepper.steps = [
|
|
534
|
+
{ title: "Shopping cart", status: "done" },
|
|
535
|
+
{ title: "Shipping address", status: "done" },
|
|
536
|
+
{ title: "Delivery method", status: "progress" },
|
|
537
|
+
{ title: "Payment details", status: "disabled" },
|
|
538
|
+
{ title: "Order review", status: "disabled" },
|
|
539
|
+
];
|
|
540
|
+
stepper.size = "large";
|
|
541
|
+
return stepper;
|
|
542
|
+
},
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Form wizard with multiple sections
|
|
547
|
+
*/
|
|
548
|
+
export const FormWizard: Story = {
|
|
549
|
+
render: () => {
|
|
550
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
551
|
+
stepper.steps = [
|
|
552
|
+
{ title: "Company info", status: "done" },
|
|
553
|
+
{ title: "Team members", status: "done" },
|
|
554
|
+
{ title: "Billing setup", status: "progress" },
|
|
555
|
+
{ title: "Integration", status: "disabled" },
|
|
556
|
+
{ title: "Launch", status: "disabled" },
|
|
557
|
+
];
|
|
558
|
+
stepper.orientation = "vertical";
|
|
559
|
+
stepper.textAlign = "right";
|
|
560
|
+
return stepper;
|
|
561
|
+
},
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* User onboarding with 6 steps
|
|
566
|
+
*/
|
|
567
|
+
export const ExtendedOnboarding: Story = {
|
|
568
|
+
render: () => {
|
|
569
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
570
|
+
stepper.steps = [
|
|
571
|
+
{ title: "Welcome", status: "done" },
|
|
572
|
+
{ title: "Account setup", status: "done" },
|
|
573
|
+
{ title: "Profile picture", status: "done" },
|
|
574
|
+
{ title: "Preferences", status: "progress" },
|
|
575
|
+
{ title: "Connect apps", status: "disabled" },
|
|
576
|
+
{ title: "Start tour", status: "disabled" },
|
|
577
|
+
];
|
|
578
|
+
stepper.orientation = "vertical";
|
|
579
|
+
stepper.textAlign = "right";
|
|
580
|
+
stepper.size = "small";
|
|
581
|
+
return stepper;
|
|
582
|
+
},
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Project setup workflow
|
|
587
|
+
*/
|
|
588
|
+
export const ProjectSetup: Story = {
|
|
589
|
+
render: () => {
|
|
590
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
591
|
+
stepper.steps = [
|
|
592
|
+
{ title: "Choose template", status: "done" },
|
|
593
|
+
{ title: "Configure project", status: "done" },
|
|
594
|
+
{ title: "Add team members", status: "progress" },
|
|
595
|
+
{ title: "Set permissions", status: "disabled" },
|
|
596
|
+
];
|
|
597
|
+
return stepper;
|
|
598
|
+
},
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Simple two-step process
|
|
603
|
+
*/
|
|
604
|
+
export const TwoStepVerification: Story = {
|
|
605
|
+
render: () => {
|
|
606
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
607
|
+
stepper.steps = [
|
|
608
|
+
{ title: "Enter code", status: "progress" },
|
|
609
|
+
{ title: "Verified", status: "disabled" },
|
|
610
|
+
];
|
|
611
|
+
stepper.size = "small";
|
|
612
|
+
return stepper;
|
|
613
|
+
},
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Document approval workflow with 5 steps
|
|
618
|
+
*/
|
|
619
|
+
export const DocumentApproval: Story = {
|
|
620
|
+
render: () => {
|
|
621
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
622
|
+
stepper.steps = [
|
|
623
|
+
{ title: "Draft", status: "done" },
|
|
624
|
+
{ title: "Review", status: "done" },
|
|
625
|
+
{ title: "Legal approval", status: "done" },
|
|
626
|
+
{ title: "Manager approval", status: "progress" },
|
|
627
|
+
{ title: "Published", status: "disabled" },
|
|
628
|
+
];
|
|
629
|
+
stepper.orientation = "vertical";
|
|
630
|
+
stepper.textAlign = "right";
|
|
631
|
+
stepper.size = "large";
|
|
632
|
+
return stepper;
|
|
633
|
+
},
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Subscription upgrade flow
|
|
638
|
+
*/
|
|
639
|
+
export const SubscriptionUpgrade: Story = {
|
|
640
|
+
render: () => {
|
|
641
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
642
|
+
stepper.steps = [
|
|
643
|
+
{ title: "Select new plan", status: "done" },
|
|
644
|
+
{ title: "Add payment method", status: "progress" },
|
|
645
|
+
{ title: "Confirm upgrade", status: "disabled" },
|
|
646
|
+
];
|
|
647
|
+
stepper.textAlign = "below";
|
|
648
|
+
return stepper;
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Course enrollment process
|
|
654
|
+
*/
|
|
655
|
+
export const CourseEnrollment: Story = {
|
|
656
|
+
render: () => {
|
|
657
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
658
|
+
stepper.steps = [
|
|
659
|
+
{ title: "Browse courses", status: "done" },
|
|
660
|
+
{ title: "Choose course", status: "done" },
|
|
661
|
+
{ title: "Select schedule", status: "done" },
|
|
662
|
+
{ title: "Payment", status: "progress" },
|
|
663
|
+
{ title: "Enrollment complete", status: "disabled" },
|
|
664
|
+
];
|
|
665
|
+
stepper.orientation = "horizontal";
|
|
666
|
+
stepper.textAlign = "below";
|
|
667
|
+
stepper.size = "small";
|
|
668
|
+
return stepper;
|
|
669
|
+
},
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* All variants showcase
|
|
674
|
+
*/
|
|
675
|
+
export const AllVariants: Story = {
|
|
676
|
+
render: () => html`
|
|
677
|
+
<div style="display: flex; flex-direction: column; gap: 48px;">
|
|
678
|
+
<div>
|
|
679
|
+
<h4
|
|
680
|
+
style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;"
|
|
681
|
+
>
|
|
682
|
+
Horizontal Large
|
|
683
|
+
</h4>
|
|
684
|
+
${(() => {
|
|
685
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
686
|
+
stepper.steps = [
|
|
687
|
+
{ title: "Step 1", status: "done" },
|
|
688
|
+
{ title: "Step 2", status: "progress" },
|
|
689
|
+
{ title: "Step 3", status: "disabled" },
|
|
690
|
+
];
|
|
691
|
+
return stepper;
|
|
692
|
+
})()}
|
|
693
|
+
</div>
|
|
694
|
+
|
|
695
|
+
<div>
|
|
696
|
+
<h4
|
|
697
|
+
style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;"
|
|
698
|
+
>
|
|
699
|
+
Horizontal Small
|
|
700
|
+
</h4>
|
|
701
|
+
${(() => {
|
|
702
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
703
|
+
stepper.steps = [
|
|
704
|
+
{ title: "Step 1", status: "done" },
|
|
705
|
+
{ title: "Step 2", status: "progress" },
|
|
706
|
+
{ title: "Step 3", status: "disabled" },
|
|
707
|
+
];
|
|
708
|
+
stepper.size = "small";
|
|
709
|
+
return stepper;
|
|
710
|
+
})()}
|
|
711
|
+
</div>
|
|
712
|
+
|
|
713
|
+
<div>
|
|
714
|
+
<h4
|
|
715
|
+
style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;"
|
|
716
|
+
>
|
|
717
|
+
Vertical Text Right
|
|
718
|
+
</h4>
|
|
719
|
+
${(() => {
|
|
720
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
721
|
+
stepper.steps = [
|
|
722
|
+
{ title: "Step 1", status: "done" },
|
|
723
|
+
{ title: "Step 2", status: "progress" },
|
|
724
|
+
{ title: "Step 3", status: "disabled" },
|
|
725
|
+
];
|
|
726
|
+
stepper.orientation = "vertical";
|
|
727
|
+
stepper.textAlign = "right";
|
|
728
|
+
return stepper;
|
|
729
|
+
})()}
|
|
730
|
+
</div>
|
|
731
|
+
|
|
732
|
+
<div>
|
|
733
|
+
<h4
|
|
734
|
+
style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;"
|
|
735
|
+
>
|
|
736
|
+
Vertical Text Below
|
|
737
|
+
</h4>
|
|
738
|
+
${(() => {
|
|
739
|
+
const stepper = document.createElement("rel-stepper") as any;
|
|
740
|
+
stepper.steps = [
|
|
741
|
+
{ title: "Step 1", status: "done" },
|
|
742
|
+
{ title: "Step 2", status: "progress" },
|
|
743
|
+
{ title: "Step 3", status: "disabled" },
|
|
744
|
+
];
|
|
745
|
+
stepper.orientation = "vertical";
|
|
746
|
+
stepper.textAlign = "below";
|
|
747
|
+
return stepper;
|
|
748
|
+
})()}
|
|
749
|
+
</div>
|
|
750
|
+
</div>
|
|
751
|
+
`,
|
|
752
|
+
};
|