@xsolla/xui-b2b-stepper 0.147.1

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,942 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.tsx
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Stepper: () => Stepper
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/Stepper.tsx
28
+ var import_react4 = require("react");
29
+
30
+ // ../../foundation/primitives-native/src/Box.tsx
31
+ var import_react_native = require("react-native");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var Box = ({
34
+ children,
35
+ onPress,
36
+ onLayout,
37
+ onMoveShouldSetResponder,
38
+ onResponderGrant,
39
+ onResponderMove,
40
+ onResponderRelease,
41
+ onResponderTerminate,
42
+ backgroundColor,
43
+ borderColor,
44
+ borderWidth,
45
+ borderBottomWidth,
46
+ borderBottomColor,
47
+ borderTopWidth,
48
+ borderTopColor,
49
+ borderLeftWidth,
50
+ borderLeftColor,
51
+ borderRightWidth,
52
+ borderRightColor,
53
+ borderRadius,
54
+ borderStyle,
55
+ height,
56
+ padding,
57
+ paddingHorizontal,
58
+ paddingVertical,
59
+ margin,
60
+ marginTop,
61
+ marginBottom,
62
+ marginLeft,
63
+ marginRight,
64
+ flexDirection,
65
+ alignItems,
66
+ justifyContent,
67
+ position,
68
+ top,
69
+ bottom,
70
+ left,
71
+ right,
72
+ width,
73
+ minWidth,
74
+ minHeight,
75
+ maxWidth,
76
+ maxHeight,
77
+ flex,
78
+ overflow,
79
+ zIndex,
80
+ hoverStyle,
81
+ pressStyle,
82
+ style,
83
+ "data-testid": dataTestId,
84
+ testID,
85
+ as,
86
+ src,
87
+ alt,
88
+ ...rest
89
+ }) => {
90
+ const getContainerStyle = (pressed) => ({
91
+ backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
92
+ borderColor,
93
+ borderWidth,
94
+ borderBottomWidth,
95
+ borderBottomColor,
96
+ borderTopWidth,
97
+ borderTopColor,
98
+ borderLeftWidth,
99
+ borderLeftColor,
100
+ borderRightWidth,
101
+ borderRightColor,
102
+ borderRadius,
103
+ borderStyle,
104
+ overflow,
105
+ zIndex,
106
+ height,
107
+ width,
108
+ minWidth,
109
+ minHeight,
110
+ maxWidth,
111
+ maxHeight,
112
+ padding,
113
+ paddingHorizontal,
114
+ paddingVertical,
115
+ margin,
116
+ marginTop,
117
+ marginBottom,
118
+ marginLeft,
119
+ marginRight,
120
+ flexDirection,
121
+ alignItems,
122
+ justifyContent,
123
+ position,
124
+ top,
125
+ bottom,
126
+ left,
127
+ right,
128
+ flex,
129
+ ...style
130
+ });
131
+ const finalTestID = dataTestId || testID;
132
+ const {
133
+ role,
134
+ tabIndex,
135
+ onKeyDown,
136
+ onKeyUp,
137
+ "aria-label": _ariaLabel,
138
+ "aria-labelledby": _ariaLabelledBy,
139
+ "aria-current": _ariaCurrent,
140
+ "aria-disabled": _ariaDisabled,
141
+ "aria-live": _ariaLive,
142
+ className,
143
+ "data-testid": _dataTestId,
144
+ ...nativeRest
145
+ } = rest;
146
+ if (as === "img" && src) {
147
+ const imageStyle = {
148
+ width,
149
+ height,
150
+ borderRadius,
151
+ position,
152
+ top,
153
+ bottom,
154
+ left,
155
+ right,
156
+ ...style
157
+ };
158
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
+ import_react_native.Image,
160
+ {
161
+ source: { uri: src },
162
+ style: imageStyle,
163
+ testID: finalTestID,
164
+ resizeMode: "cover",
165
+ ...nativeRest
166
+ }
167
+ );
168
+ }
169
+ if (onPress) {
170
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
+ import_react_native.Pressable,
172
+ {
173
+ onPress,
174
+ onLayout,
175
+ onMoveShouldSetResponder,
176
+ onResponderGrant,
177
+ onResponderMove,
178
+ onResponderRelease,
179
+ onResponderTerminate,
180
+ style: ({ pressed }) => getContainerStyle(pressed),
181
+ testID: finalTestID,
182
+ ...nativeRest,
183
+ children
184
+ }
185
+ );
186
+ }
187
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
188
+ import_react_native.View,
189
+ {
190
+ style: getContainerStyle(),
191
+ testID: finalTestID,
192
+ onLayout,
193
+ onMoveShouldSetResponder,
194
+ onResponderGrant,
195
+ onResponderMove,
196
+ onResponderRelease,
197
+ onResponderTerminate,
198
+ ...nativeRest,
199
+ children
200
+ }
201
+ );
202
+ };
203
+
204
+ // ../../foundation/primitives-native/src/Text.tsx
205
+ var import_react_native2 = require("react-native");
206
+ var import_jsx_runtime2 = require("react/jsx-runtime");
207
+ var roleMap = {
208
+ alert: "alert",
209
+ heading: "header",
210
+ button: "button",
211
+ link: "link",
212
+ text: "text"
213
+ };
214
+ var parseNumericValue = (value) => {
215
+ if (value === void 0) return void 0;
216
+ if (typeof value === "number") return value;
217
+ const parsed = parseFloat(value);
218
+ return isNaN(parsed) ? void 0 : parsed;
219
+ };
220
+ var Text = ({
221
+ children,
222
+ color,
223
+ fontSize,
224
+ fontWeight,
225
+ fontFamily,
226
+ textAlign,
227
+ lineHeight,
228
+ numberOfLines,
229
+ id,
230
+ role,
231
+ style: styleProp,
232
+ ...props
233
+ }) => {
234
+ let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
235
+ if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
236
+ resolvedFontFamily = void 0;
237
+ }
238
+ const incomingStyle = import_react_native2.StyleSheet.flatten(styleProp);
239
+ const baseStyle = {
240
+ color: color ?? incomingStyle?.color,
241
+ fontSize: typeof fontSize === "number" ? fontSize : void 0,
242
+ fontWeight,
243
+ fontFamily: resolvedFontFamily,
244
+ textDecorationLine: props.textDecoration,
245
+ textAlign: textAlign ?? incomingStyle?.textAlign,
246
+ lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
247
+ marginTop: parseNumericValue(
248
+ incomingStyle?.marginTop
249
+ ),
250
+ marginBottom: parseNumericValue(
251
+ incomingStyle?.marginBottom
252
+ )
253
+ };
254
+ const accessibilityRole = role ? roleMap[role] : void 0;
255
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
256
+ import_react_native2.Text,
257
+ {
258
+ style: baseStyle,
259
+ numberOfLines,
260
+ testID: id,
261
+ accessibilityRole,
262
+ children
263
+ }
264
+ );
265
+ };
266
+
267
+ // ../../foundation/primitives-native/src/Spinner.tsx
268
+ var import_react_native3 = require("react-native");
269
+ var import_jsx_runtime3 = require("react/jsx-runtime");
270
+ var Spinner = ({
271
+ color,
272
+ size,
273
+ role,
274
+ "aria-label": ariaLabel,
275
+ "aria-live": ariaLive,
276
+ testID
277
+ }) => {
278
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
279
+ import_react_native3.View,
280
+ {
281
+ accessible: true,
282
+ accessibilityRole: role === "status" ? "none" : void 0,
283
+ accessibilityLabel: ariaLabel,
284
+ accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
285
+ testID,
286
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
287
+ import_react_native3.ActivityIndicator,
288
+ {
289
+ color,
290
+ size: typeof size === "number" ? size : "small"
291
+ }
292
+ )
293
+ }
294
+ );
295
+ };
296
+ Spinner.displayName = "Spinner";
297
+
298
+ // src/Stepper.tsx
299
+ var import_xui_core = require("@xsolla/xui-core");
300
+
301
+ // src/Step.tsx
302
+ var import_react3 = require("react");
303
+
304
+ // src/StepChip.tsx
305
+ var import_react = require("react");
306
+ var import_xui_icons_base = require("@xsolla/xui-icons-base");
307
+ var import_jsx_runtime4 = require("react/jsx-runtime");
308
+ var getChipBackground = (state, theme) => {
309
+ switch (state) {
310
+ case "current":
311
+ return theme.colors.background.brand.secondary;
312
+ case "loading":
313
+ return theme.colors.overlay.brand;
314
+ case "complete":
315
+ return theme.colors.background.success.secondary;
316
+ case "warning":
317
+ return theme.colors.background.warning.secondary;
318
+ case "alert":
319
+ return theme.colors.background.alert.secondary;
320
+ case "incomplete":
321
+ default:
322
+ return theme.colors.overlay.mono;
323
+ }
324
+ };
325
+ var StepChip = (0, import_react.memo)(
326
+ ({ state, stepNumber, sizing, theme }) => {
327
+ const numberColor = theme.colors.content.primary;
328
+ const bg = getChipBackground(state, theme);
329
+ const renderContent = () => {
330
+ switch (state) {
331
+ case "loading":
332
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
333
+ Spinner,
334
+ {
335
+ size: sizing.chipIconSize,
336
+ color: theme.colors.content.brand.primary,
337
+ strokeWidth: 2
338
+ }
339
+ );
340
+ case "complete":
341
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
342
+ import_xui_icons_base.Check,
343
+ {
344
+ size: sizing.chipIconSize,
345
+ color: theme.colors.content.success.primary
346
+ }
347
+ );
348
+ case "warning":
349
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
350
+ import_xui_icons_base.InfoCr,
351
+ {
352
+ size: sizing.chipIconSize,
353
+ color: theme.colors.content.warning.primary
354
+ }
355
+ );
356
+ case "alert":
357
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
358
+ import_xui_icons_base.Remove,
359
+ {
360
+ size: sizing.chipIconSize,
361
+ color: theme.colors.content.alert.primary
362
+ }
363
+ );
364
+ case "current":
365
+ case "incomplete":
366
+ default:
367
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
368
+ Text,
369
+ {
370
+ color: numberColor,
371
+ fontSize: sizing.numberFontSize,
372
+ lineHeight: sizing.numberLineHeight,
373
+ fontWeight: "500",
374
+ textAlign: "center",
375
+ children: stepNumber
376
+ }
377
+ );
378
+ }
379
+ };
380
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
381
+ Box,
382
+ {
383
+ width: sizing.chipSize,
384
+ height: sizing.chipSize,
385
+ borderRadius: sizing.chipRadius,
386
+ backgroundColor: bg,
387
+ alignItems: "center",
388
+ justifyContent: "center",
389
+ flexShrink: 0,
390
+ style: {
391
+ paddingTop: sizing.chipPaddingTop,
392
+ paddingBottom: sizing.chipPaddingBottom,
393
+ paddingLeft: sizing.chipPaddingX,
394
+ paddingRight: sizing.chipPaddingX
395
+ },
396
+ children: renderContent()
397
+ }
398
+ );
399
+ }
400
+ );
401
+ StepChip.displayName = "StepChip";
402
+
403
+ // src/StepConnector.tsx
404
+ var import_react2 = require("react");
405
+ var import_jsx_runtime5 = require("react/jsx-runtime");
406
+ var StepConnector = (0, import_react2.memo)(
407
+ ({ direction, color, length }) => {
408
+ if (direction === "vertical") {
409
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
410
+ Box,
411
+ {
412
+ style: {
413
+ width: 1,
414
+ height: length ?? 48,
415
+ backgroundColor: color,
416
+ flexShrink: 0
417
+ }
418
+ }
419
+ );
420
+ }
421
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
422
+ Box,
423
+ {
424
+ style: {
425
+ height: 1,
426
+ flex: 1,
427
+ minWidth: length ?? 24,
428
+ backgroundColor: color,
429
+ alignSelf: "center"
430
+ }
431
+ }
432
+ );
433
+ }
434
+ );
435
+ StepConnector.displayName = "StepConnector";
436
+
437
+ // src/Step.tsx
438
+ var import_jsx_runtime6 = require("react/jsx-runtime");
439
+ var ACTIVE_CARD_STATES = [
440
+ "current",
441
+ "loading",
442
+ "warning",
443
+ "alert"
444
+ ];
445
+ var Step = ({
446
+ step,
447
+ stepNumber,
448
+ isLast,
449
+ isFirst,
450
+ direction,
451
+ simple = false,
452
+ overlapBottom = 0,
453
+ zIndex,
454
+ onClick,
455
+ sizing,
456
+ theme
457
+ }) => {
458
+ const {
459
+ title,
460
+ description,
461
+ caption,
462
+ state = "incomplete",
463
+ disabled = false,
464
+ noClick = false
465
+ } = step;
466
+ const isHorizontal = direction === "horizontal";
467
+ const isActive = ACTIVE_CARD_STATES.includes(state);
468
+ const isCurrent = state === "current";
469
+ const isInteractive = !!onClick && !disabled && !noClick;
470
+ const handleClick = (0, import_react3.useCallback)(() => {
471
+ if (isInteractive) {
472
+ onClick({ number: stepNumber, step });
473
+ }
474
+ }, [isInteractive, onClick, stepNumber, step]);
475
+ const handleKeyDown = (0, import_react3.useCallback)(
476
+ (event) => {
477
+ if (!isInteractive) return;
478
+ if (event.key === "Enter") {
479
+ event.preventDefault();
480
+ handleClick();
481
+ } else if (event.key === " ") {
482
+ event.preventDefault();
483
+ }
484
+ },
485
+ [isInteractive, handleClick]
486
+ );
487
+ const handleKeyUp = (0, import_react3.useCallback)(
488
+ (event) => {
489
+ if (!isInteractive) return;
490
+ if (event.key === " ") {
491
+ event.preventDefault();
492
+ handleClick();
493
+ }
494
+ },
495
+ [isInteractive, handleClick]
496
+ );
497
+ const ariaLabel = (0, import_react3.useMemo)(() => {
498
+ const titleText = typeof title === "string" ? title : `Step ${stepNumber}`;
499
+ const descText = typeof description === "string" ? `, ${description}` : "";
500
+ return `Step ${stepNumber}: ${titleText}${descText}, ${state}`;
501
+ }, [stepNumber, title, description, state]);
502
+ const interactiveProps = isInteractive ? {
503
+ role: "button",
504
+ tabIndex: 0,
505
+ onClick: handleClick,
506
+ onKeyDown: handleKeyDown,
507
+ onKeyUp: handleKeyUp,
508
+ style: { cursor: "pointer" }
509
+ } : {
510
+ "aria-disabled": disabled || noClick ? true : void 0
511
+ };
512
+ const textBlockSizing = isHorizontal ? { flex: 1, minWidth: 0 } : { width: sizing.contentWidth, flexShrink: 0 };
513
+ const textBlock = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
514
+ Box,
515
+ {
516
+ flexDirection: "column",
517
+ alignItems: "flex-start",
518
+ justifyContent: "center",
519
+ style: {
520
+ gap: sizing.contentGap,
521
+ minHeight: sizing.contentMinHeight,
522
+ ...textBlockSizing
523
+ },
524
+ children: [
525
+ caption !== null && (typeof caption === "string" || typeof caption === "number" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
526
+ Text,
527
+ {
528
+ color: theme.colors.content.tertiary,
529
+ fontSize: sizing.captionFontSize,
530
+ lineHeight: sizing.captionLineHeight,
531
+ fontWeight: "400",
532
+ children: caption
533
+ }
534
+ ) : caption),
535
+ typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
536
+ Text,
537
+ {
538
+ color: theme.colors.content.primary,
539
+ fontSize: sizing.titleFontSize,
540
+ lineHeight: sizing.titleLineHeight,
541
+ fontWeight: "500",
542
+ children: title
543
+ }
544
+ ) : title,
545
+ description !== null && (typeof description === "string" || typeof description === "number" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
546
+ Text,
547
+ {
548
+ color: theme.colors.content.tertiary,
549
+ fontSize: sizing.descriptionFontSize,
550
+ lineHeight: sizing.descriptionLineHeight,
551
+ fontWeight: "400",
552
+ children: description
553
+ }
554
+ ) : description)
555
+ ]
556
+ }
557
+ );
558
+ if (simple) {
559
+ if (isHorizontal) {
560
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
561
+ Box,
562
+ {
563
+ flexDirection: "row",
564
+ alignItems: "center",
565
+ flex: isLast ? void 0 : 1,
566
+ "data-testid": "step",
567
+ "data-step-state": state,
568
+ "aria-current": isCurrent ? "step" : void 0,
569
+ "aria-label": ariaLabel,
570
+ ...interactiveProps,
571
+ children: [
572
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
573
+ Box,
574
+ {
575
+ flexDirection: "row",
576
+ alignItems: "center",
577
+ justifyContent: "center",
578
+ backgroundColor: isActive ? theme.colors.background.primary : void 0,
579
+ borderRadius: isActive ? sizing.simpleCardRadius : void 0,
580
+ style: {
581
+ padding: sizing.simpleCardPadding,
582
+ gap: sizing.simpleCardGap,
583
+ flexShrink: 0
584
+ },
585
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
586
+ StepChip,
587
+ {
588
+ state,
589
+ stepNumber,
590
+ sizing,
591
+ theme
592
+ }
593
+ )
594
+ }
595
+ ),
596
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
597
+ Box,
598
+ {
599
+ flexDirection: "row",
600
+ alignItems: "center",
601
+ style: { flex: 1, minWidth: sizing.simpleHorizontalCellWidth },
602
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
603
+ Box,
604
+ {
605
+ style: {
606
+ flex: 1,
607
+ height: 1,
608
+ backgroundColor: theme.colors.border.secondary
609
+ }
610
+ }
611
+ )
612
+ }
613
+ )
614
+ ]
615
+ }
616
+ );
617
+ }
618
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
619
+ Box,
620
+ {
621
+ flexDirection: "column",
622
+ alignItems: "flex-start",
623
+ "data-testid": "step",
624
+ "data-step-state": state,
625
+ "aria-current": isCurrent ? "step" : void 0,
626
+ "aria-label": ariaLabel,
627
+ ...interactiveProps,
628
+ style: {
629
+ ...isInteractive ? { cursor: "pointer" } : {},
630
+ gap: sizing.simpleItemGap
631
+ },
632
+ children: [
633
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
634
+ Box,
635
+ {
636
+ flexDirection: "column",
637
+ alignItems: "center",
638
+ justifyContent: "center",
639
+ backgroundColor: isActive ? theme.colors.background.primary : void 0,
640
+ borderRadius: isActive ? sizing.simpleCardRadius : void 0,
641
+ style: {
642
+ padding: sizing.simpleCardPadding,
643
+ gap: sizing.simpleCardGap
644
+ },
645
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
646
+ StepChip,
647
+ {
648
+ state,
649
+ stepNumber,
650
+ sizing,
651
+ theme
652
+ }
653
+ )
654
+ }
655
+ ),
656
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
657
+ Box,
658
+ {
659
+ style: {
660
+ marginLeft: sizing.simpleCardPadding + sizing.chipSize / 2 - 0.5
661
+ },
662
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
663
+ StepConnector,
664
+ {
665
+ direction: "vertical",
666
+ color: theme.colors.border.secondary,
667
+ length: sizing.connectorCellHeight
668
+ }
669
+ )
670
+ }
671
+ )
672
+ ]
673
+ }
674
+ );
675
+ }
676
+ if (isHorizontal) {
677
+ const cardBackground = isActive ? theme.colors.background.primary : void 0;
678
+ const cardWidth = isFirst ? sizing.horizontalFirstItemWidth : sizing.horizontalItemWidth;
679
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
680
+ Box,
681
+ {
682
+ flexDirection: "row",
683
+ alignItems: "center",
684
+ flex: 1,
685
+ "data-testid": "step",
686
+ "data-step-state": state,
687
+ "aria-current": isCurrent ? "step" : void 0,
688
+ "aria-label": ariaLabel,
689
+ ...interactiveProps,
690
+ children: [
691
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
692
+ Box,
693
+ {
694
+ flexDirection: "row",
695
+ alignItems: "center",
696
+ backgroundColor: cardBackground,
697
+ borderRadius: isActive ? sizing.activeCardRadiusHorizontal : void 0,
698
+ style: {
699
+ gap: sizing.activeCardGapHorizontal,
700
+ width: cardWidth,
701
+ flexShrink: 0,
702
+ paddingTop: sizing.activeCardPaddingYHorizontal,
703
+ paddingBottom: sizing.activeCardPaddingYHorizontal,
704
+ paddingLeft: sizing.activeCardPaddingLeftHorizontal,
705
+ paddingRight: 0
706
+ },
707
+ children: [
708
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
709
+ Box,
710
+ {
711
+ flexDirection: "row",
712
+ alignItems: "flex-start",
713
+ style: {
714
+ gap: sizing.itemGap,
715
+ flex: 1,
716
+ minWidth: 0
717
+ },
718
+ children: [
719
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
720
+ StepChip,
721
+ {
722
+ state,
723
+ stepNumber,
724
+ sizing,
725
+ theme
726
+ }
727
+ ),
728
+ textBlock
729
+ ]
730
+ }
731
+ ),
732
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
733
+ Box,
734
+ {
735
+ flexDirection: "row",
736
+ alignItems: "center",
737
+ style: { flexShrink: 0 },
738
+ children: [
739
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
740
+ Box,
741
+ {
742
+ style: {
743
+ width: sizing.horizontalConnectorSegment,
744
+ height: 1,
745
+ backgroundColor: theme.colors.border.secondary
746
+ }
747
+ }
748
+ ),
749
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
750
+ Box,
751
+ {
752
+ style: {
753
+ width: sizing.horizontalConnectorGap,
754
+ height: 1,
755
+ backgroundColor: theme.colors.border.secondary
756
+ }
757
+ }
758
+ )
759
+ ]
760
+ }
761
+ )
762
+ ]
763
+ }
764
+ ),
765
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
766
+ StepConnector,
767
+ {
768
+ direction: "horizontal",
769
+ color: theme.colors.border.secondary
770
+ }
771
+ )
772
+ ]
773
+ }
774
+ );
775
+ }
776
+ const innerConnectorOffset = sizing.activeCardPaddingX + sizing.chipSize / 2 - 0.5;
777
+ const verticalContainerStyle = {
778
+ ...interactiveProps.style,
779
+ marginBottom: overlapBottom ? -overlapBottom : void 0,
780
+ position: zIndex !== void 0 ? "relative" : void 0,
781
+ zIndex
782
+ };
783
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
784
+ Box,
785
+ {
786
+ flexDirection: "column",
787
+ alignItems: "flex-start",
788
+ "data-testid": "step",
789
+ "data-step-state": state,
790
+ "aria-current": isCurrent ? "step" : void 0,
791
+ "aria-label": ariaLabel,
792
+ ...interactiveProps,
793
+ style: verticalContainerStyle,
794
+ children: [
795
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
796
+ Box,
797
+ {
798
+ flexDirection: "row",
799
+ alignItems: "flex-start",
800
+ gap: sizing.itemGap,
801
+ style: {
802
+ paddingTop: sizing.activeCardPaddingTop,
803
+ paddingLeft: sizing.activeCardPaddingX,
804
+ paddingRight: sizing.activeCardPaddingX,
805
+ paddingBottom: 0,
806
+ backgroundColor: isActive ? theme.colors.background.primary : void 0,
807
+ borderRadius: isActive ? sizing.activeCardRadiusVertical : void 0
808
+ },
809
+ children: [
810
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
811
+ Box,
812
+ {
813
+ flexDirection: "column",
814
+ alignItems: "center",
815
+ gap: 8,
816
+ style: { flexShrink: 0 },
817
+ children: [
818
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
819
+ StepChip,
820
+ {
821
+ state,
822
+ stepNumber,
823
+ sizing,
824
+ theme
825
+ }
826
+ ),
827
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
828
+ Box,
829
+ {
830
+ style: { visibility: isLast ? "hidden" : "visible" },
831
+ "aria-hidden": isLast ? "true" : void 0,
832
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
833
+ StepConnector,
834
+ {
835
+ direction: "vertical",
836
+ color: theme.colors.border.secondary,
837
+ length: sizing.innerConnectorLength
838
+ }
839
+ )
840
+ }
841
+ )
842
+ ]
843
+ }
844
+ ),
845
+ textBlock
846
+ ]
847
+ }
848
+ ),
849
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
850
+ Box,
851
+ {
852
+ alignItems: "flex-start",
853
+ justifyContent: "flex-start",
854
+ style: {
855
+ height: sizing.connectorCellHeight,
856
+ width: sizing.connectorCellWidth,
857
+ paddingLeft: innerConnectorOffset,
858
+ flexShrink: 0
859
+ },
860
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
861
+ StepConnector,
862
+ {
863
+ direction: "vertical",
864
+ color: theme.colors.border.secondary,
865
+ length: sizing.connectorCellHeight
866
+ }
867
+ )
868
+ }
869
+ )
870
+ ]
871
+ }
872
+ );
873
+ };
874
+ Step.displayName = "Step";
875
+
876
+ // src/Stepper.tsx
877
+ var import_jsx_runtime7 = require("react/jsx-runtime");
878
+ var Stepper = (0, import_react4.forwardRef)(
879
+ ({
880
+ steps,
881
+ direction = "vertical",
882
+ surface = false,
883
+ simple = false,
884
+ onClick,
885
+ className,
886
+ "aria-label": ariaLabel,
887
+ themeMode,
888
+ themeProductContext,
889
+ ...rest
890
+ }, ref) => {
891
+ const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
892
+ const sizing = theme.sizing.stepperB2b();
893
+ const isHorizontal = direction === "horizontal";
894
+ const isSurface = surface;
895
+ const defaultAriaLabel = `Stepper with ${steps.length} step${steps.length === 1 ? "" : "s"}`;
896
+ const surfaceBackground = isSurface ? `linear-gradient(0deg, ${theme.colors.overlay.mono} 0%, ${theme.colors.overlay.mono} 100%), ${theme.colors.background.secondary}` : void 0;
897
+ const useOverlap = !isHorizontal && !simple;
898
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
899
+ Box,
900
+ {
901
+ ref,
902
+ role: "navigation",
903
+ "aria-label": ariaLabel ?? defaultAriaLabel,
904
+ className,
905
+ flexDirection: isHorizontal ? "row" : "column",
906
+ alignItems: isHorizontal ? "flex-start" : "stretch",
907
+ borderRadius: isSurface ? sizing.surfaceRadius : void 0,
908
+ style: {
909
+ background: surfaceBackground,
910
+ padding: isSurface ? isHorizontal ? sizing.surfacePaddingHorizontal : sizing.surfacePaddingVertical : 0,
911
+ gap: isHorizontal ? sizing.horizontalItemGap : 0,
912
+ width: isHorizontal ? "100%" : void 0,
913
+ isolation: useOverlap ? "isolate" : void 0
914
+ },
915
+ ...rest,
916
+ children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
917
+ Step,
918
+ {
919
+ step,
920
+ stepNumber: i + 1,
921
+ isFirst: i === 0,
922
+ isLast: i === steps.length - 1,
923
+ direction,
924
+ simple,
925
+ onClick,
926
+ sizing,
927
+ theme,
928
+ zIndex: useOverlap ? steps.length - i : void 0,
929
+ overlapBottom: useOverlap && i < steps.length - 1 ? 16 : 0
930
+ },
931
+ step.key ?? `stepper-${i}`
932
+ ))
933
+ }
934
+ );
935
+ }
936
+ );
937
+ Stepper.displayName = "Stepper";
938
+ // Annotate the CommonJS export names for ESM import in node:
939
+ 0 && (module.exports = {
940
+ Stepper
941
+ });
942
+ //# sourceMappingURL=index.js.map