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