laif-ds 0.2.20 → 0.2.21
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/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-stepper.js +212 -0
- package/dist/components/ui/stepper.js +387 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +30 -28
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +70 -69
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +24 -25
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +22 -23
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +28 -29
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +1 -2
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +49 -50
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +22 -23
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +6 -7
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +31 -32
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -7
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +20 -21
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +5 -6
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +17 -18
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +39 -40
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +13 -14
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +20 -21
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +8 -9
- package/dist/node_modules/cmdk/dist/index.js +2 -2
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/vaul/dist/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +3 -2
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +0 -255
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +0 -258
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { Stepper as g, StepperNav as z, StepperItem as V, StepperTrigger as S, StepperIndicator as b, StepperTitle as N, StepperSeparator as w, StepperPanel as C, StepperContent as I } from "./stepper.js";
|
|
4
|
+
import { cva as e } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
const T = e("", {
|
|
6
|
+
variants: {
|
|
7
|
+
align: {
|
|
8
|
+
horizontal: "flex w-full flex-col",
|
|
9
|
+
vertical: "flex items-start gap-8"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
align: "horizontal"
|
|
14
|
+
}
|
|
15
|
+
}), j = e(
|
|
16
|
+
"rounded-lg p-6 shadow w-full max-w-6xl",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
align: {
|
|
20
|
+
horizontal: "mt-6",
|
|
21
|
+
vertical: "mt-1"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
align: "horizontal"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
), k = e("", {
|
|
29
|
+
variants: {
|
|
30
|
+
align: {
|
|
31
|
+
horizontal: "flex flex-col gap-3",
|
|
32
|
+
vertical: "flex flex-row gap-3 items-center"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
align: "horizontal"
|
|
37
|
+
}
|
|
38
|
+
}), y = e("relative", {
|
|
39
|
+
variants: {
|
|
40
|
+
align: {
|
|
41
|
+
horizontal: "flex-1 items-start",
|
|
42
|
+
vertical: "flex items-start"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
align: "horizontal"
|
|
47
|
+
}
|
|
48
|
+
}), A = e("", {
|
|
49
|
+
variants: {
|
|
50
|
+
align: {
|
|
51
|
+
horizontal: "w-full",
|
|
52
|
+
vertical: "relative flex flex-col py-2"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
align: "horizontal"
|
|
57
|
+
}
|
|
58
|
+
}), W = e("", {
|
|
59
|
+
variants: {
|
|
60
|
+
size: {
|
|
61
|
+
sm: "w-6 h-6 text-sm font-medium",
|
|
62
|
+
md: "w-8 h-8 text-base font-bold"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
size: "sm"
|
|
67
|
+
}
|
|
68
|
+
}), q = e("", {
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
sm: "text-sm font-medium",
|
|
72
|
+
md: "text-base font-bold"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
defaultVariants: {
|
|
76
|
+
size: "sm"
|
|
77
|
+
}
|
|
78
|
+
}), B = e(
|
|
79
|
+
"group-data-[state=completed]/step:bg-d-primary",
|
|
80
|
+
{
|
|
81
|
+
variants: {
|
|
82
|
+
align: {
|
|
83
|
+
horizontal: "absolute left-1/2 h-0.5",
|
|
84
|
+
vertical: "!w-0.5"
|
|
85
|
+
},
|
|
86
|
+
size: {
|
|
87
|
+
sm: "top-2.5 ml-2 w-[calc(100%-1rem)]",
|
|
88
|
+
md: "top-3.5 ml-4 w-[calc(100%-2rem)]"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
compoundVariants: [
|
|
92
|
+
{
|
|
93
|
+
align: "vertical",
|
|
94
|
+
size: "sm",
|
|
95
|
+
class: "ml-2.5"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
align: "vertical",
|
|
99
|
+
size: "md",
|
|
100
|
+
class: "ml-3.5"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
align: "horizontal",
|
|
105
|
+
size: "sm"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
), D = e("flex flex-1", {
|
|
109
|
+
variants: {
|
|
110
|
+
align: {
|
|
111
|
+
horizontal: "justify-center",
|
|
112
|
+
vertical: "flex-grow"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
defaultVariants: {
|
|
116
|
+
align: "horizontal"
|
|
117
|
+
}
|
|
118
|
+
}), E = e("flex flex-1 flex-col", {
|
|
119
|
+
variants: {
|
|
120
|
+
align: {
|
|
121
|
+
horizontal: "items-center",
|
|
122
|
+
vertical: ""
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
align: "horizontal"
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
function J({
|
|
130
|
+
steps: r,
|
|
131
|
+
align: t = "horizontal",
|
|
132
|
+
size: n = "sm",
|
|
133
|
+
showSeparators: f = !0,
|
|
134
|
+
defaultStep: u,
|
|
135
|
+
allowStepNavigation: c = !0,
|
|
136
|
+
allowClickOnlyCompleted: p = !1,
|
|
137
|
+
onStepClick: d,
|
|
138
|
+
indicators: h,
|
|
139
|
+
...o
|
|
140
|
+
}) {
|
|
141
|
+
const v = (a, i) => {
|
|
142
|
+
if (d) {
|
|
143
|
+
d(a, i);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
c && !a.disabled && (!p || a.completed) && o.onValueChange?.(a.id);
|
|
147
|
+
}, x = o.value ?? u ?? r[0]?.id;
|
|
148
|
+
return /* @__PURE__ */ l(
|
|
149
|
+
g,
|
|
150
|
+
{
|
|
151
|
+
...o,
|
|
152
|
+
value: x,
|
|
153
|
+
orientation: t,
|
|
154
|
+
indicators: h,
|
|
155
|
+
children: /* @__PURE__ */ s("div", { className: T({ align: t }), children: [
|
|
156
|
+
/* @__PURE__ */ l(z, { className: A({ align: t }), children: r.map((a, i) => {
|
|
157
|
+
const m = c && !a.disabled && (!p || a.completed);
|
|
158
|
+
return /* @__PURE__ */ s(
|
|
159
|
+
V,
|
|
160
|
+
{
|
|
161
|
+
step: a.id,
|
|
162
|
+
completed: a.completed,
|
|
163
|
+
disabled: a.disabled,
|
|
164
|
+
loading: a.loading,
|
|
165
|
+
className: y({ align: t }),
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ s(
|
|
168
|
+
S,
|
|
169
|
+
{
|
|
170
|
+
className: k({ align: t }),
|
|
171
|
+
onClick: () => v(a, i),
|
|
172
|
+
style: { cursor: m ? "pointer" : "default" },
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ l(
|
|
175
|
+
b,
|
|
176
|
+
{
|
|
177
|
+
className: W({ size: n }),
|
|
178
|
+
children: a.id
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ l(N, { className: q({ size: n }), children: a.label })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
f && i < r.length - 1 && /* @__PURE__ */ l(
|
|
186
|
+
w,
|
|
187
|
+
{
|
|
188
|
+
className: B({ align: t, size: n })
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
a.id
|
|
194
|
+
);
|
|
195
|
+
}) }),
|
|
196
|
+
/* @__PURE__ */ l(C, { className: D({ align: t }), children: r.map((a) => /* @__PURE__ */ l(
|
|
197
|
+
I,
|
|
198
|
+
{
|
|
199
|
+
value: a.id,
|
|
200
|
+
className: E({ align: t }),
|
|
201
|
+
children: /* @__PURE__ */ l("div", { className: j({ align: t }), children: a.component })
|
|
202
|
+
},
|
|
203
|
+
a.id
|
|
204
|
+
)) })
|
|
205
|
+
] })
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
J as AppStepper,
|
|
211
|
+
J as default
|
|
212
|
+
};
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { cn as d } from "../../lib/utils.js";
|
|
4
|
+
import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import * as p from "react";
|
|
6
|
+
import { createContext as T, useContext as P } from "react";
|
|
7
|
+
const E = T(
|
|
8
|
+
void 0
|
|
9
|
+
), L = T(
|
|
10
|
+
void 0
|
|
11
|
+
), R = g("w-full max-w-6xl", {
|
|
12
|
+
variants: {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: "flex flex-row items-center",
|
|
15
|
+
vertical: "flex flex-col items-start"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
orientation: "horizontal"
|
|
20
|
+
}
|
|
21
|
+
}), O = g("group/step relative", {
|
|
22
|
+
variants: {
|
|
23
|
+
orientation: {
|
|
24
|
+
horizontal: "flex flex-row items-center justify-center not-last:flex-1",
|
|
25
|
+
vertical: "flex flex-col items-start justify-start"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
orientation: "horizontal"
|
|
30
|
+
}
|
|
31
|
+
}), F = g(
|
|
32
|
+
"focus-visible:ring-ring/50 focus-visible:border-d-ring inline-flex cursor-pointer items-center gap-3 rounded-full outline-none focus-visible:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-60",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
sm: "gap-2",
|
|
37
|
+
default: "gap-3",
|
|
38
|
+
lg: "gap-4"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
size: "default"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
), K = g(
|
|
46
|
+
"border-secondary bg-secondary text-bodyPrimary data-[state=active]:bg-d-primary data-[state=completed]:bg-d-primary data-[state=active]:text-bodyPrimary data-[state=completed]:text-onAccent relative flex shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
size: {
|
|
50
|
+
sm: "size-5 text-xs",
|
|
51
|
+
default: "size-6 text-xs",
|
|
52
|
+
lg: "size-8 text-sm"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
size: "default"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
), $ = g("bg-secondary m-0.5 rounded-full", {
|
|
60
|
+
variants: {
|
|
61
|
+
orientation: {
|
|
62
|
+
horizontal: "h-0.5 flex-1",
|
|
63
|
+
vertical: "h-12 w-0.5"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
orientation: "horizontal"
|
|
68
|
+
}
|
|
69
|
+
}), H = g("text-sm leading-none font-medium", {
|
|
70
|
+
variants: {
|
|
71
|
+
size: {
|
|
72
|
+
sm: "text-xs",
|
|
73
|
+
default: "text-sm",
|
|
74
|
+
lg: "text-base"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
size: "default"
|
|
79
|
+
}
|
|
80
|
+
}), U = g("inline-flex", {
|
|
81
|
+
variants: {
|
|
82
|
+
orientation: {
|
|
83
|
+
horizontal: "w-full flex-row",
|
|
84
|
+
vertical: "flex-col"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
defaultVariants: {
|
|
88
|
+
orientation: "horizontal"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
function x() {
|
|
92
|
+
const t = P(E);
|
|
93
|
+
if (!t) throw new Error("useStepper must be used within a Stepper");
|
|
94
|
+
return t;
|
|
95
|
+
}
|
|
96
|
+
function I() {
|
|
97
|
+
const t = P(L);
|
|
98
|
+
if (!t) throw new Error("useStepItem must be used within a StepperItem");
|
|
99
|
+
return t;
|
|
100
|
+
}
|
|
101
|
+
function M({
|
|
102
|
+
defaultValue: t = 1,
|
|
103
|
+
value: a,
|
|
104
|
+
onValueChange: n,
|
|
105
|
+
orientation: e = "horizontal",
|
|
106
|
+
className: i,
|
|
107
|
+
children: r,
|
|
108
|
+
indicators: S = {},
|
|
109
|
+
...y
|
|
110
|
+
}) {
|
|
111
|
+
const [f, b] = p.useState(t), [o, h] = p.useState(
|
|
112
|
+
[]
|
|
113
|
+
), z = p.useCallback(
|
|
114
|
+
(s) => {
|
|
115
|
+
h((l) => s && !l.includes(s) ? [...l, s] : !s && l.includes(s) ? l.filter((w) => w !== s) : l);
|
|
116
|
+
},
|
|
117
|
+
[]
|
|
118
|
+
), N = p.useCallback(
|
|
119
|
+
(s) => {
|
|
120
|
+
a === void 0 && b(s), n?.(s);
|
|
121
|
+
},
|
|
122
|
+
[a, n]
|
|
123
|
+
), V = a ?? f, m = (s) => {
|
|
124
|
+
o[s] && o[s].focus();
|
|
125
|
+
}, A = (s) => m((s + 1) % o.length), v = (s) => m((s - 1 + o.length) % o.length), C = () => m(0), k = () => m(o.length - 1), D = p.useMemo(
|
|
126
|
+
() => ({
|
|
127
|
+
activeStep: V,
|
|
128
|
+
setActiveStep: N,
|
|
129
|
+
stepsCount: p.Children.toArray(r).filter(
|
|
130
|
+
(s) => p.isValidElement(s) && s.type.displayName === "StepperItem"
|
|
131
|
+
).length,
|
|
132
|
+
orientation: e,
|
|
133
|
+
registerTrigger: z,
|
|
134
|
+
focusNext: A,
|
|
135
|
+
focusPrev: v,
|
|
136
|
+
focusFirst: C,
|
|
137
|
+
focusLast: k,
|
|
138
|
+
triggerNodes: o,
|
|
139
|
+
indicators: S
|
|
140
|
+
}),
|
|
141
|
+
[
|
|
142
|
+
V,
|
|
143
|
+
N,
|
|
144
|
+
r,
|
|
145
|
+
e,
|
|
146
|
+
z,
|
|
147
|
+
o
|
|
148
|
+
]
|
|
149
|
+
);
|
|
150
|
+
return /* @__PURE__ */ c(E.Provider, { value: D, children: /* @__PURE__ */ c(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
role: "tablist",
|
|
154
|
+
"aria-orientation": e,
|
|
155
|
+
"data-slot": "stepper",
|
|
156
|
+
className: d(R({ orientation: e }), i),
|
|
157
|
+
"data-orientation": e,
|
|
158
|
+
...y,
|
|
159
|
+
children: r
|
|
160
|
+
}
|
|
161
|
+
) });
|
|
162
|
+
}
|
|
163
|
+
function Q({
|
|
164
|
+
step: t,
|
|
165
|
+
completed: a = !1,
|
|
166
|
+
disabled: n = !1,
|
|
167
|
+
loading: e = !1,
|
|
168
|
+
orientation: i,
|
|
169
|
+
className: r,
|
|
170
|
+
children: S,
|
|
171
|
+
...y
|
|
172
|
+
}) {
|
|
173
|
+
const { activeStep: f, orientation: b } = x(), o = a || t < f ? "completed" : f === t ? "active" : "inactive", h = e && t === f;
|
|
174
|
+
return /* @__PURE__ */ c(
|
|
175
|
+
L.Provider,
|
|
176
|
+
{
|
|
177
|
+
value: { step: t, state: o, isDisabled: n, isLoading: h },
|
|
178
|
+
children: /* @__PURE__ */ c(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
"data-slot": "stepper-item",
|
|
182
|
+
className: d(
|
|
183
|
+
O({
|
|
184
|
+
orientation: i || b
|
|
185
|
+
}),
|
|
186
|
+
r
|
|
187
|
+
),
|
|
188
|
+
"data-state": o,
|
|
189
|
+
...h ? { "data-loading": !0 } : {},
|
|
190
|
+
...y,
|
|
191
|
+
children: S
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function W({
|
|
198
|
+
asChild: t = !1,
|
|
199
|
+
size: a,
|
|
200
|
+
className: n,
|
|
201
|
+
children: e,
|
|
202
|
+
tabIndex: i,
|
|
203
|
+
...r
|
|
204
|
+
}) {
|
|
205
|
+
const { state: S, isLoading: y } = I(), f = x(), {
|
|
206
|
+
setActiveStep: b,
|
|
207
|
+
activeStep: o,
|
|
208
|
+
registerTrigger: h,
|
|
209
|
+
triggerNodes: z,
|
|
210
|
+
focusNext: N,
|
|
211
|
+
focusPrev: V,
|
|
212
|
+
focusFirst: m,
|
|
213
|
+
focusLast: A
|
|
214
|
+
} = f, { step: v, isDisabled: C } = I(), k = o === v, D = `stepper-tab-${v}`, s = `stepper-panel-${v}`, l = p.useRef(null);
|
|
215
|
+
p.useEffect(() => {
|
|
216
|
+
l.current && h(l.current);
|
|
217
|
+
}, [l.current]);
|
|
218
|
+
const w = p.useMemo(
|
|
219
|
+
() => z.findIndex((u) => u === l.current),
|
|
220
|
+
[z, l.current]
|
|
221
|
+
), j = (u) => {
|
|
222
|
+
switch (u.key) {
|
|
223
|
+
case "ArrowRight":
|
|
224
|
+
case "ArrowDown":
|
|
225
|
+
u.preventDefault(), w !== -1 && N && N(w);
|
|
226
|
+
break;
|
|
227
|
+
case "ArrowLeft":
|
|
228
|
+
case "ArrowUp":
|
|
229
|
+
u.preventDefault(), w !== -1 && V && V(w);
|
|
230
|
+
break;
|
|
231
|
+
case "Home":
|
|
232
|
+
u.preventDefault(), m && m();
|
|
233
|
+
break;
|
|
234
|
+
case "End":
|
|
235
|
+
u.preventDefault(), A && A();
|
|
236
|
+
break;
|
|
237
|
+
case "Enter":
|
|
238
|
+
case " ":
|
|
239
|
+
u.preventDefault(), b(v);
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
return t ? /* @__PURE__ */ c(
|
|
244
|
+
"span",
|
|
245
|
+
{
|
|
246
|
+
"data-slot": "stepper-trigger",
|
|
247
|
+
"data-state": S,
|
|
248
|
+
className: n,
|
|
249
|
+
children: e
|
|
250
|
+
}
|
|
251
|
+
) : /* @__PURE__ */ c(
|
|
252
|
+
"button",
|
|
253
|
+
{
|
|
254
|
+
ref: l,
|
|
255
|
+
role: "tab",
|
|
256
|
+
id: D,
|
|
257
|
+
"aria-selected": k,
|
|
258
|
+
"aria-controls": s,
|
|
259
|
+
tabIndex: typeof i == "number" ? i : k ? 0 : -1,
|
|
260
|
+
"data-slot": "stepper-trigger",
|
|
261
|
+
"data-state": S,
|
|
262
|
+
"data-loading": y,
|
|
263
|
+
className: d(F({ size: a }), n),
|
|
264
|
+
onClick: () => b(v),
|
|
265
|
+
onKeyDown: j,
|
|
266
|
+
disabled: C,
|
|
267
|
+
...r,
|
|
268
|
+
children: e
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
function X({
|
|
273
|
+
children: t,
|
|
274
|
+
size: a,
|
|
275
|
+
className: n
|
|
276
|
+
}) {
|
|
277
|
+
const { state: e, isLoading: i } = I(), { indicators: r } = x();
|
|
278
|
+
return /* @__PURE__ */ c(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
"data-slot": "stepper-indicator",
|
|
282
|
+
"data-state": e,
|
|
283
|
+
className: d(K({ size: a }), n),
|
|
284
|
+
children: /* @__PURE__ */ c("div", { className: "absolute", children: r && (i && r.loading || e === "completed" && r.completed || e === "active" && r.active || e === "inactive" && r.inactive) ? i && r.loading || e === "completed" && r.completed || e === "active" && r.active || e === "inactive" && r.inactive : t })
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
function Y({
|
|
289
|
+
orientation: t,
|
|
290
|
+
className: a
|
|
291
|
+
}) {
|
|
292
|
+
const { state: n } = I(), { orientation: e } = x();
|
|
293
|
+
return /* @__PURE__ */ c(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
"data-slot": "stepper-separator",
|
|
297
|
+
"data-state": n,
|
|
298
|
+
className: d(
|
|
299
|
+
$({
|
|
300
|
+
orientation: t || e
|
|
301
|
+
}),
|
|
302
|
+
a
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function Z({
|
|
308
|
+
children: t,
|
|
309
|
+
size: a,
|
|
310
|
+
className: n
|
|
311
|
+
}) {
|
|
312
|
+
const { state: e } = I();
|
|
313
|
+
return /* @__PURE__ */ c(
|
|
314
|
+
"h3",
|
|
315
|
+
{
|
|
316
|
+
"data-slot": "stepper-title",
|
|
317
|
+
"data-state": e,
|
|
318
|
+
className: d(H({ size: a }), n),
|
|
319
|
+
children: t
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
function _({
|
|
324
|
+
children: t,
|
|
325
|
+
orientation: a,
|
|
326
|
+
className: n
|
|
327
|
+
}) {
|
|
328
|
+
const { activeStep: e, orientation: i } = x();
|
|
329
|
+
return /* @__PURE__ */ c(
|
|
330
|
+
"nav",
|
|
331
|
+
{
|
|
332
|
+
"data-slot": "stepper-nav",
|
|
333
|
+
"data-state": e,
|
|
334
|
+
"data-orientation": a || i,
|
|
335
|
+
className: d(
|
|
336
|
+
U({
|
|
337
|
+
orientation: a || i
|
|
338
|
+
}),
|
|
339
|
+
n
|
|
340
|
+
),
|
|
341
|
+
children: t
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
function tt({ children: t, className: a }) {
|
|
346
|
+
const { activeStep: n } = x();
|
|
347
|
+
return /* @__PURE__ */ c(
|
|
348
|
+
"div",
|
|
349
|
+
{
|
|
350
|
+
"data-slot": "stepper-panel",
|
|
351
|
+
"data-state": n,
|
|
352
|
+
className: d("w-full", a),
|
|
353
|
+
children: t
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
function et({
|
|
358
|
+
value: t,
|
|
359
|
+
forceMount: a,
|
|
360
|
+
children: n,
|
|
361
|
+
className: e
|
|
362
|
+
}) {
|
|
363
|
+
const { activeStep: i } = x(), r = t === i;
|
|
364
|
+
return !a && !r ? null : /* @__PURE__ */ c(
|
|
365
|
+
"div",
|
|
366
|
+
{
|
|
367
|
+
"data-slot": "stepper-content",
|
|
368
|
+
"data-state": i,
|
|
369
|
+
className: d("w-full", e, !r && a && "hidden"),
|
|
370
|
+
hidden: !r && a,
|
|
371
|
+
children: n
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
export {
|
|
376
|
+
M as Stepper,
|
|
377
|
+
et as StepperContent,
|
|
378
|
+
X as StepperIndicator,
|
|
379
|
+
Q as StepperItem,
|
|
380
|
+
_ as StepperNav,
|
|
381
|
+
tt as StepperPanel,
|
|
382
|
+
Y as StepperSeparator,
|
|
383
|
+
Z as StepperTitle,
|
|
384
|
+
W as StepperTrigger,
|
|
385
|
+
I as useStepItem,
|
|
386
|
+
x as useStepper
|
|
387
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -180,6 +180,29 @@ declare interface AppSidebarProps extends React_2.ComponentProps<typeof Sidebar>
|
|
|
180
180
|
linkProps?: Record<string, any>;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
declare interface AppStep {
|
|
184
|
+
id: number;
|
|
185
|
+
label: React_2.ReactNode;
|
|
186
|
+
component: React_2.ReactNode;
|
|
187
|
+
completed?: boolean;
|
|
188
|
+
disabled?: boolean;
|
|
189
|
+
loading?: boolean;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export declare function AppStepper({ steps, align, size, showSeparators, defaultStep, allowStepNavigation, allowClickOnlyCompleted, onStepClick, indicators, ...stepperProps }: AppStepperProps): JSX.Element;
|
|
193
|
+
|
|
194
|
+
declare interface AppStepperProps extends Omit<StepperProps, "children"> {
|
|
195
|
+
steps: AppStep[];
|
|
196
|
+
align?: "horizontal" | "vertical";
|
|
197
|
+
size?: "sm" | "md";
|
|
198
|
+
showSeparators?: boolean;
|
|
199
|
+
defaultStep?: number;
|
|
200
|
+
allowStepNavigation?: boolean;
|
|
201
|
+
allowClickOnlyCompleted?: boolean;
|
|
202
|
+
onStepClick?: (step: AppStep, index: number) => void;
|
|
203
|
+
indicators?: StepIndicators_2;
|
|
204
|
+
}
|
|
205
|
+
|
|
183
206
|
export declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element;
|
|
184
207
|
|
|
185
208
|
declare type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
@@ -1715,6 +1738,34 @@ declare interface SourcePart {
|
|
|
1715
1738
|
type: "source";
|
|
1716
1739
|
}
|
|
1717
1740
|
|
|
1741
|
+
declare type StepIndicators = {
|
|
1742
|
+
active?: React_2.ReactNode;
|
|
1743
|
+
completed?: React_2.ReactNode;
|
|
1744
|
+
inactive?: React_2.ReactNode;
|
|
1745
|
+
loading?: React_2.ReactNode;
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
declare type StepIndicators_2 = {
|
|
1749
|
+
active?: React_2.ReactNode;
|
|
1750
|
+
completed?: React_2.ReactNode;
|
|
1751
|
+
inactive?: React_2.ReactNode;
|
|
1752
|
+
loading?: React_2.ReactNode;
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1755
|
+
declare type StepperOrientation = "horizontal" | "vertical";
|
|
1756
|
+
|
|
1757
|
+
declare interface StepperProps extends React_2.HTMLAttributes<HTMLDivElement>, VariantProps<typeof stepperVariants> {
|
|
1758
|
+
defaultValue?: number;
|
|
1759
|
+
value?: number;
|
|
1760
|
+
onValueChange?: (value: number) => void;
|
|
1761
|
+
orientation?: StepperOrientation;
|
|
1762
|
+
indicators?: StepIndicators;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
declare const stepperVariants: (props?: ({
|
|
1766
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
1767
|
+
} & ClassProp) | undefined) => string;
|
|
1768
|
+
|
|
1718
1769
|
export declare const stringToHexColor: (str: string) => string;
|
|
1719
1770
|
|
|
1720
1771
|
export declare function Switch({ className, ...props }: React_2.ComponentProps<typeof SwitchPrimitive.Root>): JSX.Element;
|