docthub-core-components 3.3.12 → 3.3.15

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.
@@ -193,7 +193,7 @@ const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
193
193
  d
194
194
  ] }), e[15] = $, e[16] = x, e[17] = y, e[18] = i, e[19] = d, e[20] = C) : C = e[20], C;
195
195
  }, Ze = ke.getCountries(), et = (r) => {
196
- if (!r || r.length === 0)
196
+ if (r === void 0)
197
197
  return Ze.map((t) => ({
198
198
  value: t,
199
199
  label: new Intl.DisplayNames(["en"], {
@@ -201,6 +201,8 @@ const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
201
201
  }).of(t) ?? t,
202
202
  countryCode: `+${q(t)}`
203
203
  }));
204
+ if (r.length === 0)
205
+ return [];
204
206
  const e = r[0];
205
207
  return e && typeof e == "object" && "countryId" in e ? r.map((t) => ({
206
208
  value: t,
@@ -0,0 +1,303 @@
1
+ "use client";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { c as k } from "react-compiler-runtime";
4
+ import { useState as J, Children as Y, useRef as Z, useEffect as ee, useMemo as te, useContext as O, isValidElement as se, createContext as Q } from "react";
5
+ import { cn as I } from "../../lib/utils.js";
6
+ const W = Q(void 0), X = Q(void 0);
7
+ function C() {
8
+ const o = O(W);
9
+ if (!o)
10
+ throw new Error("useStepper must be used within a Stepper");
11
+ return o;
12
+ }
13
+ function L() {
14
+ const o = O(X);
15
+ if (!o)
16
+ throw new Error("useStepItem must be used within a StepperItem");
17
+ return o;
18
+ }
19
+ function ne(o) {
20
+ const e = k(52);
21
+ let i, a, n, t, s, l, r, c;
22
+ e[0] !== o ? ({
23
+ defaultValue: s,
24
+ value: c,
25
+ onValueChange: n,
26
+ orientation: l,
27
+ className: a,
28
+ children: i,
29
+ indicators: r,
30
+ ...t
31
+ } = o, e[0] = o, e[1] = i, e[2] = a, e[3] = n, e[4] = t, e[5] = s, e[6] = l, e[7] = r, e[8] = c) : (i = e[1], a = e[2], n = e[3], t = e[4], s = e[5], l = e[6], r = e[7], c = e[8]);
32
+ const p = s === void 0 ? 1 : s, f = l === void 0 ? "horizontal" : l;
33
+ let N;
34
+ e[9] !== r ? (N = r === void 0 ? {} : r, e[9] = r, e[10] = N) : N = e[10];
35
+ const $ = N, [x, y] = J(p);
36
+ let u;
37
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (u = [], e[11] = u) : u = e[11];
38
+ const [d, w] = J(u);
39
+ let g;
40
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (g = (h) => {
41
+ h && w((G) => G.includes(h) ? G : [...G, h]);
42
+ }, e[12] = g) : g = e[12];
43
+ const D = g;
44
+ let v;
45
+ e[13] !== n || e[14] !== c ? (v = (h) => {
46
+ c === void 0 && y(h), n == null || n(h);
47
+ }, e[13] = n, e[14] = c, e[15] = v) : v = e[15];
48
+ const A = v, P = c ?? x;
49
+ let S;
50
+ e[16] !== d ? (S = (h) => {
51
+ d[h] && d[h].focus();
52
+ }, e[16] = d, e[17] = S) : S = e[17];
53
+ const b = S;
54
+ let _;
55
+ e[18] !== b || e[19] !== d.length ? (_ = (h) => {
56
+ d.length && b((h + 1) % d.length);
57
+ }, e[18] = b, e[19] = d.length, e[20] = _) : _ = e[20];
58
+ const M = _;
59
+ let j;
60
+ e[21] !== b || e[22] !== d.length ? (j = (h) => {
61
+ d.length && b((h - 1 + d.length) % d.length);
62
+ }, e[21] = b, e[22] = d.length, e[23] = j) : j = e[23];
63
+ const H = j;
64
+ let R;
65
+ e[24] !== b ? (R = () => b(0), e[24] = b, e[25] = R) : R = e[25];
66
+ const U = R;
67
+ let V;
68
+ e[26] !== b || e[27] !== d.length ? (V = () => b(d.length - 1), e[26] = b, e[27] = d.length, e[28] = V) : V = e[28];
69
+ const q = V;
70
+ let T;
71
+ e[29] !== i ? (T = Y.toArray(i).filter(ae), e[29] = i, e[30] = T) : T = e[30];
72
+ let F;
73
+ e[31] !== P || e[32] !== U || e[33] !== q || e[34] !== M || e[35] !== H || e[36] !== A || e[37] !== $ || e[38] !== f || e[39] !== T.length || e[40] !== d ? (F = {
74
+ activeStep: P,
75
+ setActiveStep: A,
76
+ stepsCount: T.length,
77
+ orientation: f,
78
+ registerTrigger: D,
79
+ focusNext: M,
80
+ focusPrev: H,
81
+ focusFirst: U,
82
+ focusLast: q,
83
+ triggerNodes: d,
84
+ indicators: $
85
+ }, e[31] = P, e[32] = U, e[33] = q, e[34] = M, e[35] = H, e[36] = A, e[37] = $, e[38] = f, e[39] = T.length, e[40] = d, e[41] = F) : F = e[41];
86
+ const B = F;
87
+ let z;
88
+ e[42] !== a ? (z = I("w-full", a), e[42] = a, e[43] = z) : z = e[43];
89
+ let E;
90
+ e[44] !== i || e[45] !== f || e[46] !== t || e[47] !== z ? (E = /* @__PURE__ */ m("div", { role: "tablist", "aria-orientation": f, "data-slot": "stepper", className: z, "data-orientation": f, ...t, children: i }), e[44] = i, e[45] = f, e[46] = t, e[47] = z, e[48] = E) : E = e[48];
91
+ let K;
92
+ return e[49] !== B || e[50] !== E ? (K = /* @__PURE__ */ m(W.Provider, { value: B, children: E }), e[49] = B, e[50] = E, e[51] = K) : K = e[51], K;
93
+ }
94
+ function ae(o) {
95
+ return se(o) && o.type.displayName === "StepperItem";
96
+ }
97
+ function ie(o) {
98
+ const e = k(27);
99
+ let i, a, n, t, s, l, r;
100
+ e[0] !== o ? ({
101
+ step: t,
102
+ completed: s,
103
+ disabled: l,
104
+ loading: r,
105
+ className: a,
106
+ children: i,
107
+ ...n
108
+ } = o, e[0] = o, e[1] = i, e[2] = a, e[3] = n, e[4] = t, e[5] = s, e[6] = l, e[7] = r) : (i = e[1], a = e[2], n = e[3], t = e[4], s = e[5], l = e[6], r = e[7]);
109
+ const c = s === void 0 ? !1 : s, p = l === void 0 ? !1 : l, f = r === void 0 ? !1 : r, {
110
+ activeStep: N,
111
+ orientation: $
112
+ } = C(), x = c || t < N ? "completed" : N === t ? "active" : "inactive", y = f && t === N;
113
+ let u;
114
+ e[8] !== p || e[9] !== y || e[10] !== x || e[11] !== t ? (u = {
115
+ step: t,
116
+ state: x,
117
+ isDisabled: p,
118
+ isLoading: y
119
+ }, e[8] = p, e[9] = y, e[10] = x, e[11] = t, e[12] = u) : u = e[12];
120
+ const d = $ === "horizontal" ? "flex-row" : "flex-col";
121
+ let w;
122
+ e[13] !== a || e[14] !== d ? (w = I("group/step flex items-center justify-center [&:not(:last-child)]:flex-1", d, a), e[13] = a, e[14] = d, e[15] = w) : w = e[15];
123
+ let g;
124
+ e[16] !== y ? (g = y ? {
125
+ "data-loading": !0
126
+ } : {}, e[16] = y, e[17] = g) : g = e[17];
127
+ let D;
128
+ e[18] !== i || e[19] !== n || e[20] !== x || e[21] !== w || e[22] !== g ? (D = /* @__PURE__ */ m("div", { "data-slot": "stepper-item", className: w, "data-state": x, ...g, ...n, children: i }), e[18] = i, e[19] = n, e[20] = x, e[21] = w, e[22] = g, e[23] = D) : D = e[23];
129
+ let v;
130
+ return e[24] !== u || e[25] !== D ? (v = /* @__PURE__ */ m(X.Provider, { value: u, children: D }), e[24] = u, e[25] = D, e[26] = v) : v = e[26], v;
131
+ }
132
+ function le({
133
+ asChild: o = !1,
134
+ className: e,
135
+ children: i,
136
+ tabIndex: a,
137
+ ...n
138
+ }) {
139
+ const {
140
+ state: t,
141
+ isLoading: s
142
+ } = L(), l = C(), {
143
+ setActiveStep: r,
144
+ activeStep: c,
145
+ registerTrigger: p,
146
+ triggerNodes: f,
147
+ focusNext: N,
148
+ focusPrev: $,
149
+ focusFirst: x,
150
+ focusLast: y
151
+ } = l, {
152
+ step: u,
153
+ isDisabled: d
154
+ } = L(), w = c === u, g = `stepper-tab-${u}`, D = `stepper-panel-${u}`, v = Z(null);
155
+ ee(() => {
156
+ p(v.current);
157
+ }, [p]);
158
+ const A = te(() => f.findIndex((S) => S === v.current), [f]), P = (S) => {
159
+ switch (S.key) {
160
+ case "ArrowRight":
161
+ case "ArrowDown":
162
+ S.preventDefault(), A !== -1 && N && N(A);
163
+ break;
164
+ case "ArrowLeft":
165
+ case "ArrowUp":
166
+ S.preventDefault(), A !== -1 && $ && $(A);
167
+ break;
168
+ case "Home":
169
+ S.preventDefault(), x && x();
170
+ break;
171
+ case "End":
172
+ S.preventDefault(), y && y();
173
+ break;
174
+ case "Enter":
175
+ case " ":
176
+ S.preventDefault(), r(u);
177
+ break;
178
+ }
179
+ };
180
+ return o ? /* @__PURE__ */ m("span", { "data-slot": "stepper-trigger", "data-state": t, className: e, children: i }) : /* @__PURE__ */ m("button", { ref: v, role: "tab", id: g, "aria-selected": w, "aria-controls": D, tabIndex: typeof a == "number" ? a : w ? 0 : -1, "data-slot": "stepper-trigger", "data-state": t, "data-loading": s, className: I("focus-visible:border-ring focus-visible:ring-ring/50 inline-flex cursor-pointer items-center outline-none focus-visible:z-10 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-60", "gap-2.5 rounded-full", e), onClick: () => r(u), onKeyDown: P, disabled: d, ...n, children: i });
181
+ }
182
+ function oe(o) {
183
+ const e = k(8), {
184
+ children: i,
185
+ className: a
186
+ } = o, {
187
+ state: n,
188
+ isLoading: t
189
+ } = L(), {
190
+ indicators: s
191
+ } = C();
192
+ let l;
193
+ e[0] !== a ? (l = I("border-background bg-muted text-muted-foreground data-[state=completed]:bg-foreground data-[state=completed]:text-background data-[state=active]:bg-foreground data-[state=active]:text-background relative flex size-6 shrink-0 items-center justify-center overflow-hidden", "rounded-full text-xs", a), e[0] = a, e[1] = l) : l = e[1];
194
+ const r = s && (t && s.loading || n === "completed" && s.completed || n === "active" && s.active || n === "inactive" && s.inactive) ? t && s.loading || n === "completed" && s.completed || n === "active" && s.active || n === "inactive" && s.inactive : i;
195
+ let c;
196
+ e[2] !== r ? (c = /* @__PURE__ */ m("div", { className: "absolute", children: r }), e[2] = r, e[3] = c) : c = e[3];
197
+ let p;
198
+ return e[4] !== n || e[5] !== l || e[6] !== c ? (p = /* @__PURE__ */ m("div", { "data-slot": "stepper-indicator", "data-state": n, className: l, children: c }), e[4] = n, e[5] = l, e[6] = c, e[7] = p) : p = e[7], p;
199
+ }
200
+ function re(o) {
201
+ const e = k(6), {
202
+ className: i
203
+ } = o, {
204
+ state: a
205
+ } = L(), {
206
+ orientation: n
207
+ } = C(), t = n === "horizontal" ? "h-0.5 flex-1" : "h-12 w-0.5";
208
+ let s;
209
+ e[0] !== i || e[1] !== t ? (s = I("bg-muted data-[state=completed]:bg-foreground rounded-sm m-0.5", t, i), e[0] = i, e[1] = t, e[2] = s) : s = e[2];
210
+ let l;
211
+ return e[3] !== a || e[4] !== s ? (l = /* @__PURE__ */ m("div", { "data-slot": "stepper-separator", "data-state": a, className: s }), e[3] = a, e[4] = s, e[5] = l) : l = e[5], l;
212
+ }
213
+ function ce(o) {
214
+ const e = k(6), {
215
+ children: i,
216
+ className: a
217
+ } = o, {
218
+ state: n
219
+ } = L();
220
+ let t;
221
+ e[0] !== a ? (t = I("text-sm leading-none font-medium", a), e[0] = a, e[1] = t) : t = e[1];
222
+ let s;
223
+ return e[2] !== i || e[3] !== n || e[4] !== t ? (s = /* @__PURE__ */ m("h3", { "data-slot": "stepper-title", "data-state": n, className: t, children: i }), e[2] = i, e[3] = n, e[4] = t, e[5] = s) : s = e[5], s;
224
+ }
225
+ function de(o) {
226
+ const e = k(6), {
227
+ children: i,
228
+ className: a
229
+ } = o, {
230
+ state: n
231
+ } = L();
232
+ let t;
233
+ e[0] !== a ? (t = I("text-muted-foreground text-sm", a), e[0] = a, e[1] = t) : t = e[1];
234
+ let s;
235
+ return e[2] !== i || e[3] !== n || e[4] !== t ? (s = /* @__PURE__ */ m("div", { "data-slot": "stepper-description", "data-state": n, className: t, children: i }), e[2] = i, e[3] = n, e[4] = t, e[5] = s) : s = e[5], s;
236
+ }
237
+ function pe(o) {
238
+ const e = k(8), {
239
+ children: i,
240
+ className: a
241
+ } = o, {
242
+ activeStep: n,
243
+ orientation: t
244
+ } = C(), s = t === "horizontal" ? "w-full flex-row" : "flex-col";
245
+ let l;
246
+ e[0] !== a || e[1] !== s ? (l = I("group/stepper-nav inline-flex", s, a), e[0] = a, e[1] = s, e[2] = l) : l = e[2];
247
+ let r;
248
+ return e[3] !== n || e[4] !== i || e[5] !== t || e[6] !== l ? (r = /* @__PURE__ */ m("nav", { "data-slot": "stepper-nav", "data-state": n, "data-orientation": t, className: l, children: i }), e[3] = n, e[4] = i, e[5] = t, e[6] = l, e[7] = r) : r = e[7], r;
249
+ }
250
+ function fe(o) {
251
+ const e = k(6), {
252
+ children: i,
253
+ className: a
254
+ } = o, {
255
+ activeStep: n
256
+ } = C();
257
+ let t;
258
+ e[0] !== a ? (t = I("w-full", a), e[0] = a, e[1] = t) : t = e[1];
259
+ let s;
260
+ return e[2] !== n || e[3] !== i || e[4] !== t ? (s = /* @__PURE__ */ m("div", { "data-slot": "stepper-panel", "data-state": n, className: t, children: i }), e[2] = n, e[3] = i, e[4] = t, e[5] = s) : s = e[5], s;
261
+ }
262
+ function ue(o) {
263
+ const e = k(8), {
264
+ value: i,
265
+ forceMount: a,
266
+ children: n,
267
+ className: t
268
+ } = o, {
269
+ activeStep: s
270
+ } = C(), l = i === s;
271
+ if (!a && !l)
272
+ return null;
273
+ const r = !l && a && "hidden";
274
+ let c;
275
+ e[0] !== t || e[1] !== r ? (c = I("w-full", t, r), e[0] = t, e[1] = r, e[2] = c) : c = e[2];
276
+ const p = !l && a;
277
+ let f;
278
+ return e[3] !== s || e[4] !== n || e[5] !== c || e[6] !== p ? (f = /* @__PURE__ */ m("div", { "data-slot": "stepper-content", "data-state": s, className: c, hidden: p, children: n }), e[3] = s, e[4] = n, e[5] = c, e[6] = p, e[7] = f) : f = e[7], f;
279
+ }
280
+ ne.displayName = "Stepper";
281
+ ie.displayName = "StepperItem";
282
+ le.displayName = "StepperTrigger";
283
+ oe.displayName = "StepperIndicator";
284
+ re.displayName = "StepperSeparator";
285
+ ce.displayName = "StepperTitle";
286
+ de.displayName = "StepperDescription";
287
+ pe.displayName = "StepperNav";
288
+ fe.displayName = "StepperPanel";
289
+ ue.displayName = "StepperContent";
290
+ export {
291
+ ne as Stepper,
292
+ ue as StepperContent,
293
+ de as StepperDescription,
294
+ oe as StepperIndicator,
295
+ ie as StepperItem,
296
+ pe as StepperNav,
297
+ fe as StepperPanel,
298
+ re as StepperSeparator,
299
+ ce as StepperTitle,
300
+ le as StepperTrigger,
301
+ L as useStepItem,
302
+ C as useStepper
303
+ };
@@ -0,0 +1,353 @@
1
+ "use client";
2
+ import { jsx as y } from "react/jsx-runtime";
3
+ import { c as L } from "react-compiler-runtime";
4
+ import { forwardRef as A, useId as oe, useState as K, useRef as ne, useEffect as ae, useMemo as le, useContext as _, createContext as ee } from "react";
5
+ import { Slot as re } from "../../lib/slot.js";
6
+ import { cn as k } from "../../lib/utils.js";
7
+ const te = ee(void 0), se = ee(void 0);
8
+ function F() {
9
+ const g = _(te);
10
+ if (!g)
11
+ throw new Error("useStepper must be used within a Stepper");
12
+ return g;
13
+ }
14
+ function G() {
15
+ const g = _(se);
16
+ if (!g)
17
+ throw new Error("useStepItem must be used within a StepperItem");
18
+ return g;
19
+ }
20
+ function ce(...g) {
21
+ return (c) => {
22
+ for (const l of g)
23
+ typeof l == "function" ? l(c) : l && typeof l == "object" && (l.current = c);
24
+ };
25
+ }
26
+ function de(g) {
27
+ return [...g].sort((e, s) => {
28
+ if (e === s) return 0;
29
+ const t = e.compareDocumentPosition(s);
30
+ return t & 4 ? -1 : t & 2 ? 1 : 0;
31
+ });
32
+ }
33
+ const pe = A(function(c, l) {
34
+ const e = L(53);
35
+ let s, t, i, o, a, d, n, r, u;
36
+ e[0] !== c ? ({
37
+ defaultValue: d,
38
+ value: u,
39
+ onValueChange: o,
40
+ orientation: n,
41
+ className: t,
42
+ children: s,
43
+ indicators: r,
44
+ id: i,
45
+ ...a
46
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i, e[4] = o, e[5] = a, e[6] = d, e[7] = n, e[8] = r, e[9] = u) : (s = e[1], t = e[2], i = e[3], o = e[4], a = e[5], d = e[6], n = e[7], r = e[8], u = e[9]);
47
+ const x = d === void 0 ? 1 : d, f = n === void 0 ? "horizontal" : n;
48
+ let v;
49
+ e[10] !== r ? (v = r === void 0 ? {} : r, e[10] = r, e[11] = v) : v = e[11];
50
+ const m = v, I = oe(), S = i ?? I, [z, P] = K(x);
51
+ let $;
52
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? ($ = [], e[12] = $) : $ = e[12];
53
+ const [p, R] = K($);
54
+ let D;
55
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (D = (w) => w ? (R((j) => j.includes(w) ? j : de([...j, w])), () => {
56
+ R((j) => j.filter((ie) => ie !== w));
57
+ }) : xe, e[13] = D) : D = e[13];
58
+ const C = D;
59
+ let b;
60
+ e[14] !== o || e[15] !== u ? (b = (w) => {
61
+ u === void 0 && P(w), o == null || o(w);
62
+ }, e[14] = o, e[15] = u, e[16] = b) : b = e[16];
63
+ const T = b, U = u ?? z;
64
+ let B;
65
+ e[17] !== p ? (B = (w) => {
66
+ var j;
67
+ (j = p[w]) == null || j.focus();
68
+ }, e[17] = p, e[18] = B) : B = e[18];
69
+ const h = B;
70
+ let M;
71
+ e[19] !== h || e[20] !== p.length ? (M = (w) => {
72
+ p.length && h((w + 1) % p.length);
73
+ }, e[19] = h, e[20] = p.length, e[21] = M) : M = e[21];
74
+ const E = M;
75
+ let V;
76
+ e[22] !== h || e[23] !== p.length ? (V = (w) => {
77
+ p.length && h((w - 1 + p.length) % p.length);
78
+ }, e[22] = h, e[23] = p.length, e[24] = V) : V = e[24];
79
+ const q = V;
80
+ let N;
81
+ e[25] !== h ? (N = () => h(0), e[25] = h, e[26] = N) : N = e[26];
82
+ const X = N;
83
+ let J;
84
+ e[27] !== h || e[28] !== p.length ? (J = () => h(p.length - 1), e[27] = h, e[28] = p.length, e[29] = J) : J = e[29];
85
+ const Y = J;
86
+ let Q;
87
+ e[30] !== S || e[31] !== U || e[32] !== X || e[33] !== Y || e[34] !== E || e[35] !== q || e[36] !== T || e[37] !== m || e[38] !== f || e[39] !== p ? (Q = {
88
+ activeStep: U,
89
+ setActiveStep: T,
90
+ stepsCount: p.length,
91
+ orientation: f,
92
+ baseId: S,
93
+ registerTrigger: C,
94
+ focusNext: E,
95
+ focusPrev: q,
96
+ focusFirst: X,
97
+ focusLast: Y,
98
+ triggerNodes: p,
99
+ indicators: m
100
+ }, e[30] = S, e[31] = U, e[32] = X, e[33] = Y, e[34] = E, e[35] = q, e[36] = T, e[37] = m, e[38] = f, e[39] = p, e[40] = Q) : Q = e[40];
101
+ const Z = Q;
102
+ let H;
103
+ e[41] !== t ? (H = k("w-full", t), e[41] = t, e[42] = H) : H = e[42];
104
+ let O;
105
+ e[43] !== s || e[44] !== i || e[45] !== f || e[46] !== a || e[47] !== l || e[48] !== H ? (O = /* @__PURE__ */ y("div", { id: i, ref: l, "data-slot": "stepper", className: H, "data-orientation": f, ...a, children: s }), e[43] = s, e[44] = i, e[45] = f, e[46] = a, e[47] = l, e[48] = H, e[49] = O) : O = e[49];
106
+ let W;
107
+ return e[50] !== Z || e[51] !== O ? (W = /* @__PURE__ */ y(te.Provider, { value: Z, children: O }), e[50] = Z, e[51] = O, e[52] = W) : W = e[52], W;
108
+ }), fe = A(function(c, l) {
109
+ const e = L(30);
110
+ let s, t, i, o, a, d, n, r;
111
+ e[0] !== c ? ({
112
+ step: o,
113
+ completed: a,
114
+ disabled: d,
115
+ invalid: n,
116
+ loading: r,
117
+ className: t,
118
+ children: s,
119
+ ...i
120
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i, e[4] = o, e[5] = a, e[6] = d, e[7] = n, e[8] = r) : (s = e[1], t = e[2], i = e[3], o = e[4], a = e[5], d = e[6], n = e[7], r = e[8]);
121
+ const u = a === void 0 ? !1 : a, x = d === void 0 ? !1 : d, f = n === void 0 ? !1 : n, v = r === void 0 ? !1 : r, {
122
+ activeStep: m,
123
+ orientation: I
124
+ } = F(), S = f ? "invalid" : u || o < m ? "completed" : m === o ? "active" : "inactive", z = v && o === m;
125
+ let P;
126
+ e[9] !== x || e[10] !== f || e[11] !== z || e[12] !== S || e[13] !== o ? (P = {
127
+ step: o,
128
+ state: S,
129
+ isDisabled: x,
130
+ isInvalid: f,
131
+ isLoading: z
132
+ }, e[9] = x, e[10] = f, e[11] = z, e[12] = S, e[13] = o, e[14] = P) : P = e[14];
133
+ const $ = I === "horizontal" ? "flex-row" : "flex-col";
134
+ let p;
135
+ e[15] !== t || e[16] !== $ ? (p = k("group/step flex items-center justify-center [&:not(:last-child)]:flex-1", $, t), e[15] = t, e[16] = $, e[17] = p) : p = e[17];
136
+ const R = x || void 0, D = f || void 0, C = z || void 0;
137
+ let b;
138
+ e[18] !== s || e[19] !== i || e[20] !== l || e[21] !== S || e[22] !== C || e[23] !== p || e[24] !== R || e[25] !== D ? (b = /* @__PURE__ */ y("div", { ref: l, "data-slot": "stepper-item", className: p, "data-state": S, "data-disabled": R, "data-invalid": D, "data-loading": C, ...i, children: s }), e[18] = s, e[19] = i, e[20] = l, e[21] = S, e[22] = C, e[23] = p, e[24] = R, e[25] = D, e[26] = b) : b = e[26];
139
+ let T;
140
+ return e[27] !== b || e[28] !== P ? (T = /* @__PURE__ */ y(se.Provider, { value: P, children: b }), e[27] = b, e[28] = P, e[29] = T) : T = e[29], T;
141
+ }), ue = A(function({
142
+ asChild: c = !1,
143
+ className: l,
144
+ children: e,
145
+ disabled: s,
146
+ onClick: t,
147
+ onKeyDown: i,
148
+ tabIndex: o,
149
+ type: a,
150
+ ...d
151
+ }, n) {
152
+ const {
153
+ state: r,
154
+ isDisabled: u,
155
+ isInvalid: x,
156
+ isLoading: f,
157
+ step: v
158
+ } = G(), {
159
+ setActiveStep: m,
160
+ activeStep: I,
161
+ baseId: S,
162
+ registerTrigger: z,
163
+ triggerNodes: P,
164
+ focusNext: $,
165
+ focusPrev: p,
166
+ focusFirst: R,
167
+ focusLast: D
168
+ } = F(), C = I === v, b = u || !!s, T = `${S}-tab-${v}`, U = `${S}-panel-${v}`, B = c ? re : "button", h = ne(null), M = ce(h, n);
169
+ ae(() => z(h.current), [z]);
170
+ const E = le(() => h.current ? P.indexOf(h.current) : -1, [P]), V = (N) => {
171
+ if (b) {
172
+ N.preventDefault();
173
+ return;
174
+ }
175
+ t == null || t(N), N.defaultPrevented || m(v);
176
+ }, q = (N) => {
177
+ if (i == null || i(N), !(N.defaultPrevented || b))
178
+ switch (N.key) {
179
+ case "ArrowRight":
180
+ case "ArrowDown":
181
+ N.preventDefault(), E !== -1 && $(E);
182
+ break;
183
+ case "ArrowLeft":
184
+ case "ArrowUp":
185
+ N.preventDefault(), E !== -1 && p(E);
186
+ break;
187
+ case "Home":
188
+ N.preventDefault(), R();
189
+ break;
190
+ case "End":
191
+ N.preventDefault(), D();
192
+ break;
193
+ case "Enter":
194
+ case " ":
195
+ N.preventDefault(), m(v);
196
+ break;
197
+ }
198
+ };
199
+ return /* @__PURE__ */ y(B, { ref: M, role: "tab", id: T, "aria-selected": C, "aria-controls": U, "aria-disabled": b || void 0, tabIndex: typeof o == "number" ? o : C ? 0 : -1, "data-slot": "stepper-trigger", "data-state": r, "data-disabled": b || void 0, "data-invalid": x || void 0, "data-loading": f || void 0, className: k("focus-visible:border-ring focus-visible:ring-ring/50 inline-flex cursor-pointer items-center outline-none focus-visible:z-10 focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-60", "gap-2.5 rounded-full", l), onClick: V, onKeyDown: q, ...c ? {} : {
200
+ disabled: b,
201
+ type: a ?? "button"
202
+ }, ...d, children: e });
203
+ }), me = A(function(c, l) {
204
+ const e = L(16);
205
+ let s, t, i;
206
+ e[0] !== c ? ({
207
+ children: s,
208
+ className: t,
209
+ ...i
210
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i) : (s = e[1], t = e[2], i = e[3]);
211
+ const {
212
+ state: o,
213
+ isInvalid: a,
214
+ isLoading: d
215
+ } = G(), {
216
+ indicators: n
217
+ } = F(), r = d && n.loading || a && n.invalid || o === "completed" && n.completed || o === "active" && n.active || o === "inactive" && n.inactive, u = a || void 0, x = d || void 0;
218
+ let f;
219
+ e[4] !== t ? (f = k("border-background bg-muted text-muted-foreground data-[state=completed]:bg-foreground data-[state=completed]:text-background data-[state=active]:bg-foreground data-[state=active]:text-background relative flex size-6 shrink-0 items-center justify-center overflow-hidden", "rounded-full text-xs", t), e[4] = t, e[5] = f) : f = e[5];
220
+ const v = r || s;
221
+ let m;
222
+ e[6] !== v ? (m = /* @__PURE__ */ y("div", { className: "absolute", children: v }), e[6] = v, e[7] = m) : m = e[7];
223
+ let I;
224
+ return e[8] !== i || e[9] !== l || e[10] !== o || e[11] !== u || e[12] !== x || e[13] !== f || e[14] !== m ? (I = /* @__PURE__ */ y("div", { ref: l, "data-slot": "stepper-indicator", "data-state": o, "data-invalid": u, "data-loading": x, className: f, ...i, children: m }), e[8] = i, e[9] = l, e[10] = o, e[11] = u, e[12] = x, e[13] = f, e[14] = m, e[15] = I) : I = e[15], I;
225
+ }), ve = A(function(c, l) {
226
+ const e = L(12);
227
+ let s, t;
228
+ e[0] !== c ? ({
229
+ className: s,
230
+ ...t
231
+ } = c, e[0] = c, e[1] = s, e[2] = t) : (s = e[1], t = e[2]);
232
+ const {
233
+ state: i,
234
+ isInvalid: o
235
+ } = G(), {
236
+ orientation: a
237
+ } = F(), d = o || void 0, n = a === "horizontal" ? "h-0.5 flex-1" : "h-12 w-0.5";
238
+ let r;
239
+ e[3] !== s || e[4] !== n ? (r = k("bg-muted data-[state=completed]:bg-foreground rounded-sm m-0.5", n, s), e[3] = s, e[4] = n, e[5] = r) : r = e[5];
240
+ let u;
241
+ return e[6] !== t || e[7] !== l || e[8] !== i || e[9] !== d || e[10] !== r ? (u = /* @__PURE__ */ y("div", { ref: l, "data-slot": "stepper-separator", "data-state": i, "data-invalid": d, className: r, ...t }), e[6] = t, e[7] = l, e[8] = i, e[9] = d, e[10] = r, e[11] = u) : u = e[11], u;
242
+ }), ge = A(function(c, l) {
243
+ const e = L(13);
244
+ let s, t, i;
245
+ e[0] !== c ? ({
246
+ children: s,
247
+ className: t,
248
+ ...i
249
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i) : (s = e[1], t = e[2], i = e[3]);
250
+ const {
251
+ state: o,
252
+ isInvalid: a
253
+ } = G(), d = a || void 0;
254
+ let n;
255
+ e[4] !== t ? (n = k("text-sm leading-none font-medium", t), e[4] = t, e[5] = n) : n = e[5];
256
+ let r;
257
+ return e[6] !== s || e[7] !== i || e[8] !== l || e[9] !== o || e[10] !== d || e[11] !== n ? (r = /* @__PURE__ */ y("h3", { ref: l, "data-slot": "stepper-title", "data-state": o, "data-invalid": d, className: n, ...i, children: s }), e[6] = s, e[7] = i, e[8] = l, e[9] = o, e[10] = d, e[11] = n, e[12] = r) : r = e[12], r;
258
+ }), Se = A(function(c, l) {
259
+ const e = L(13);
260
+ let s, t, i;
261
+ e[0] !== c ? ({
262
+ children: s,
263
+ className: t,
264
+ ...i
265
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i) : (s = e[1], t = e[2], i = e[3]);
266
+ const {
267
+ state: o,
268
+ isInvalid: a
269
+ } = G(), d = a || void 0;
270
+ let n;
271
+ e[4] !== t ? (n = k("text-muted-foreground text-sm", t), e[4] = t, e[5] = n) : n = e[5];
272
+ let r;
273
+ return e[6] !== s || e[7] !== i || e[8] !== l || e[9] !== o || e[10] !== d || e[11] !== n ? (r = /* @__PURE__ */ y("div", { ref: l, "data-slot": "stepper-description", "data-state": o, "data-invalid": d, className: n, ...i, children: s }), e[6] = s, e[7] = i, e[8] = l, e[9] = o, e[10] = d, e[11] = n, e[12] = r) : r = e[12], r;
274
+ }), be = A(function(c, l) {
275
+ const e = L(14);
276
+ let s, t, i;
277
+ e[0] !== c ? ({
278
+ children: s,
279
+ className: t,
280
+ ...i
281
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i) : (s = e[1], t = e[2], i = e[3]);
282
+ const {
283
+ activeStep: o,
284
+ orientation: a
285
+ } = F(), d = a === "horizontal" ? "flex w-full flex-row" : "inline-flex flex-col";
286
+ let n;
287
+ e[4] !== t || e[5] !== d ? (n = k("group/stepper-nav", d, t), e[4] = t, e[5] = d, e[6] = n) : n = e[6];
288
+ let r;
289
+ return e[7] !== o || e[8] !== s || e[9] !== a || e[10] !== i || e[11] !== l || e[12] !== n ? (r = /* @__PURE__ */ y("div", { ref: l, role: "tablist", "aria-orientation": a, "data-slot": "stepper-nav", "data-state": o, "data-orientation": a, className: n, ...i, children: s }), e[7] = o, e[8] = s, e[9] = a, e[10] = i, e[11] = l, e[12] = n, e[13] = r) : r = e[13], r;
290
+ }), he = A(function(c, l) {
291
+ const e = L(12);
292
+ let s, t, i;
293
+ e[0] !== c ? ({
294
+ children: s,
295
+ className: t,
296
+ ...i
297
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i) : (s = e[1], t = e[2], i = e[3]);
298
+ const {
299
+ activeStep: o
300
+ } = F();
301
+ let a;
302
+ e[4] !== t ? (a = k("w-full", t), e[4] = t, e[5] = a) : a = e[5];
303
+ let d;
304
+ return e[6] !== o || e[7] !== s || e[8] !== i || e[9] !== l || e[10] !== a ? (d = /* @__PURE__ */ y("div", { ref: l, "data-slot": "stepper-panel", "data-state": o, className: a, ...i, children: s }), e[6] = o, e[7] = s, e[8] = i, e[9] = l, e[10] = a, e[11] = d) : d = e[11], d;
305
+ }), Ne = A(function(c, l) {
306
+ const e = L(19);
307
+ let s, t, i, o, a;
308
+ e[0] !== c ? ({
309
+ value: a,
310
+ forceMount: i,
311
+ children: s,
312
+ className: t,
313
+ ...o
314
+ } = c, e[0] = c, e[1] = s, e[2] = t, e[3] = i, e[4] = o, e[5] = a) : (s = e[1], t = e[2], i = e[3], o = e[4], a = e[5]);
315
+ const {
316
+ activeStep: d,
317
+ baseId: n
318
+ } = F(), r = a === d;
319
+ if (!i && !r)
320
+ return null;
321
+ const u = `${n}-panel-${a}`, x = `${n}-tab-${a}`, f = r ? "active" : "inactive", v = !r && i && "hidden";
322
+ let m;
323
+ e[6] !== t || e[7] !== v ? (m = k("w-full", t, v), e[6] = t, e[7] = v, e[8] = m) : m = e[8];
324
+ const I = !r && i;
325
+ let S;
326
+ return e[9] !== s || e[10] !== o || e[11] !== l || e[12] !== u || e[13] !== x || e[14] !== f || e[15] !== m || e[16] !== I || e[17] !== a ? (S = /* @__PURE__ */ y("div", { ref: l, role: "tabpanel", id: u, "aria-labelledby": x, "data-slot": "stepper-content", "data-state": f, "data-value": a, className: m, hidden: I, ...o, children: s }), e[9] = s, e[10] = o, e[11] = l, e[12] = u, e[13] = x, e[14] = f, e[15] = m, e[16] = I, e[17] = a, e[18] = S) : S = e[18], S;
327
+ });
328
+ pe.displayName = "Stepper";
329
+ fe.displayName = "StepperItem";
330
+ ue.displayName = "StepperTrigger";
331
+ me.displayName = "StepperIndicator";
332
+ ve.displayName = "StepperSeparator";
333
+ ge.displayName = "StepperTitle";
334
+ Se.displayName = "StepperDescription";
335
+ be.displayName = "StepperNav";
336
+ he.displayName = "StepperPanel";
337
+ Ne.displayName = "StepperContent";
338
+ function xe() {
339
+ }
340
+ export {
341
+ pe as Stepper,
342
+ Ne as StepperContent,
343
+ Se as StepperDescription,
344
+ me as StepperIndicator,
345
+ fe as StepperItem,
346
+ be as StepperNav,
347
+ he as StepperPanel,
348
+ ve as StepperSeparator,
349
+ ge as StepperTitle,
350
+ ue as StepperTrigger,
351
+ G as useStepItem,
352
+ F as useStepper
353
+ };