@humain/ui 2.1.63 → 2.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/ai/AIToolCall/AIToolCall.d.ts +9 -3
- package/dist/components/organisms/ai/AIToolRun/index.d.ts +1 -1
- package/dist/components/organisms/ai/AIToolRun/validation.d.ts +24 -3
- package/dist/components/organisms/ai/_shared/format-ai-duration.d.ts +1 -0
- package/dist/components/organisms/ai/_shared/workflow-step-renderer.d.ts +1 -0
- package/dist/index.js +52 -52
- package/dist/index151.js +1 -1
- package/dist/index174.js +7 -339
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +310 -137
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +148 -174
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +186 -78
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +74 -124
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +133 -1
- package/dist/index179.js.map +1 -0
- package/dist/index180.js +2 -201
- package/dist/index181.js +201 -0
- package/dist/{index180.js.map → index181.js.map} +1 -1
- package/dist/index183.js +130 -166
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +195 -983
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +1069 -369
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +395 -197
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +198 -243
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +263 -3
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +3 -209
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +190 -777
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +771 -252
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +250 -65
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +72 -523
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +537 -144
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +139 -720
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +707 -167
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +175 -151
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +152 -487
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +472 -225
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +236 -260
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +265 -215
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +207 -307
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +302 -135
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +140 -271
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +263 -253
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +244 -137
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +100 -238
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +278 -74
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +56 -97
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +142 -47
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +38 -84
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +72 -252
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +274 -26
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +29 -94
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +98 -25
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +20 -565
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +564 -17
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +20 -23
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +20 -95
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +92 -88
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +97 -29
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +24 -470
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +446 -196
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +199 -729
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +750 -61
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +58 -181
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +175 -259
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +246 -172
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +195 -32
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +12 -40
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +23 -26
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +45 -22
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +27 -48
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +52 -26
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +40 -225
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +217 -39
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +50 -0
- package/dist/index237.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/wc/AIToolCall.js +218 -0
- package/dist/wc/AIToolCall.js.map +1 -0
- package/dist/wc/hf-ai-tool-call.js +34 -219
- package/dist/wc/hf-ai-tool-call.js.map +1 -1
- package/dist/wc/hf-ai-tool-run.js +673 -576
- package/dist/wc/hf-ai-tool-run.js.map +1 -1
- package/dist/wc/workflow-step-renderer.js +79 -78
- package/dist/wc/workflow-step-renderer.js.map +1 -1
- package/dist/wc-react/AIToolCall.js +218 -0
- package/dist/wc-react/AIToolCall.js.map +1 -0
- package/dist/wc-react/hf-ai-tool-call.js +32 -217
- package/dist/wc-react/hf-ai-tool-call.js.map +1 -1
- package/dist/wc-react/hf-ai-tool-run.js +698 -601
- package/dist/wc-react/hf-ai-tool-run.js.map +1 -1
- package/dist/wc-react/workflow-step-renderer.js +58 -57
- package/dist/wc-react/workflow-step-renderer.js.map +1 -1
- package/package.json +1 -1
- package/skills/humain-ui/SKILL.md +1 -1
- package/skills/humain-ui-wc/SKILL.md +1 -1
- package/skills/humain-ui-wc.skill +0 -0
- package/skills/humain-ui.skill +0 -0
- package/dist/index182.js +0 -143
- package/dist/index182.js.map +0 -1
- package/dist/wc/wrench.js +0 -10
- package/dist/wc/wrench.js.map +0 -1
- package/dist/wc-react/wrench.js +0 -10
- package/dist/wc-react/wrench.js.map +0 -1
package/dist/index202.js
CHANGED
|
@@ -1,332 +1,232 @@
|
|
|
1
|
-
import { cn } from "./index2.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Separator } from "./index51.js";
|
|
4
|
-
import { Avatar } from "./index70.js";
|
|
5
|
-
import { Kbd } from "./index106.js";
|
|
6
|
-
import { Breadcrumb as BreadcrumbCompound, BreadcrumbEllipsis, BreadcrumbHomeLink, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./index131.js";
|
|
7
|
-
import { DropdownMenu } from "./index191.js";
|
|
1
|
+
import { cn, extractText } from "./index2.js";
|
|
2
|
+
import { createSafeContext } from "./index21.js";
|
|
8
3
|
import { cva } from "class-variance-authority";
|
|
9
|
-
import {
|
|
4
|
+
import { Check } from "lucide-react";
|
|
10
5
|
import * as React from "react";
|
|
11
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
//#region src/components/organisms/
|
|
13
|
-
var
|
|
14
|
-
variants: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
//#region src/components/organisms/content/Steps/Steps.tsx
|
|
8
|
+
var stepIndicatorVariants = cva("flex items-center justify-center shrink-0 size-[38px] font-medium text-lg transition-all duration-200 ease-out motion-reduce:transition-none", {
|
|
9
|
+
variants: {
|
|
10
|
+
shape: {
|
|
11
|
+
rounded: "rounded-lg",
|
|
12
|
+
round: "rounded-full"
|
|
13
|
+
},
|
|
14
|
+
status: {
|
|
15
|
+
complete: "bg-primary text-primary-foreground shadow-sm",
|
|
16
|
+
active: "bg-primary-foreground border-2 border-primary text-primary shadow-sm",
|
|
17
|
+
incomplete: "bg-accent text-muted-foreground"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
shape: "rounded",
|
|
22
|
+
status: "incomplete"
|
|
23
|
+
}
|
|
23
24
|
});
|
|
24
|
-
var
|
|
25
|
-
variants: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
var stepConnectorVariants = cva("shrink-0 transition-colors duration-200 ease-out motion-reduce:transition-none", {
|
|
26
|
+
variants: {
|
|
27
|
+
orientation: {
|
|
28
|
+
horizontal: "h-0.5 flex-1 min-w-4 mx-2 mt-[18px]",
|
|
29
|
+
vertical: "w-0.5 h-[30px] my-1 ml-[18px]"
|
|
30
|
+
},
|
|
31
|
+
status: {
|
|
32
|
+
complete: "bg-primary",
|
|
33
|
+
incomplete: "bg-border"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
orientation: "horizontal",
|
|
38
|
+
status: "incomplete"
|
|
39
|
+
}
|
|
34
40
|
});
|
|
35
|
-
var
|
|
36
|
-
variants: {
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
var stepLabelVariants = cva("text-base leading-6", {
|
|
42
|
+
variants: { status: {
|
|
43
|
+
complete: "text-card-foreground",
|
|
44
|
+
active: "text-card-foreground",
|
|
45
|
+
incomplete: "text-muted-foreground"
|
|
39
46
|
} },
|
|
40
|
-
defaultVariants: {
|
|
47
|
+
defaultVariants: { status: "incomplete" }
|
|
41
48
|
});
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
var stepSubtextVariants = cva("text-sm leading-5 text-muted-foreground");
|
|
50
|
+
var [StepsContext, useStepsContext] = createSafeContext("Steps");
|
|
51
|
+
/** Per-item index context — injected by Steps parent via Children.map or flat API */
|
|
52
|
+
var StepIndexContext = React.createContext(0);
|
|
53
|
+
function StepIndicatorContent({ index, status, shape, bulletType }) {
|
|
54
|
+
if (bulletType === "icon") {
|
|
55
|
+
if (status === "complete") return /* @__PURE__ */ jsx(Check, { className: "size-[22px] delight-check-draw" });
|
|
56
|
+
if (status === "active") return /* @__PURE__ */ jsx("div", { className: cn("size-5 bg-primary", shape === "rounded" ? "rounded-sm" : "rounded-full") });
|
|
57
|
+
return /* @__PURE__ */ jsx("div", { className: "size-1.5 rounded-full bg-current" });
|
|
58
|
+
}
|
|
59
|
+
return index + 1;
|
|
45
60
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
visibleActions: defaultVisibleActions,
|
|
61
|
-
overflowActions: indexedActions.slice(MAX_VISIBLE_HEADER_ACTIONS)
|
|
62
|
-
};
|
|
63
|
-
const priorityAction = [...indexedActions].reverse().find((action) => isPriorityHeaderAction(action, indexedActions.length));
|
|
64
|
-
if (!priorityAction) return {
|
|
65
|
-
visibleActions: defaultVisibleActions,
|
|
66
|
-
overflowActions: indexedActions.slice(MAX_VISIBLE_HEADER_ACTIONS)
|
|
67
|
-
};
|
|
68
|
-
const visibleActions = [indexedActions[0], priorityAction].sort((left, right) => left.originalIndex - right.originalIndex);
|
|
69
|
-
const visibleIndexes = new Set(visibleActions.map((action) => action.originalIndex));
|
|
70
|
-
return {
|
|
71
|
-
visibleActions,
|
|
72
|
-
overflowActions: indexedActions.filter((action) => !visibleIndexes.has(action.originalIndex))
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function getOverflowActionItemProps(action) {
|
|
76
|
-
const disabled = Boolean(action.overflowProps?.disabled || action.buttonProps?.disabled || action.buttonProps?.loading);
|
|
77
|
-
return {
|
|
78
|
-
...action.overflowProps,
|
|
79
|
-
disabled
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function PageHeaderBreadcrumbs({ breadcrumbs }) {
|
|
83
|
-
if (!breadcrumbs || breadcrumbs.length === 0) return null;
|
|
84
|
-
return /* @__PURE__ */ jsx(BreadcrumbCompound, {
|
|
85
|
-
className: "hidden md:flex delight-fade-in motion-reduce:!animate-none",
|
|
86
|
-
children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbHomeLink, { href: "/" }) }), breadcrumbs.map((item, index) => {
|
|
87
|
-
const isLast = index === breadcrumbs.length - 1;
|
|
88
|
-
const hasEllipsis = breadcrumbs.length > 3;
|
|
89
|
-
if (hasEllipsis && index === 1) return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbEllipsis, {}) })] }, `ellipsis-${index}`);
|
|
90
|
-
if (hasEllipsis && index > 1 && !isLast) return null;
|
|
91
|
-
return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: isLast || item.isCurrent ? /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
92
|
-
href: item.href,
|
|
93
|
-
children: item.label
|
|
94
|
-
}) })] }, item.label);
|
|
95
|
-
})] })
|
|
61
|
+
function StepIndicator({ index, status, shape, bulletType }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
"data-slot": "steps-indicator",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: cn(stepIndicatorVariants({
|
|
66
|
+
shape,
|
|
67
|
+
status
|
|
68
|
+
}), status === "complete" && "delight-check-bounce", status === "active" && "delight-pulse-once"),
|
|
69
|
+
children: /* @__PURE__ */ jsx(StepIndicatorContent, {
|
|
70
|
+
index,
|
|
71
|
+
status,
|
|
72
|
+
shape,
|
|
73
|
+
bulletType
|
|
74
|
+
})
|
|
96
75
|
});
|
|
97
76
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return /* @__PURE__ */ jsx(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
className: "md:hidden text-secondary-foreground px-0 hover:no-underline",
|
|
108
|
-
children: backLabel
|
|
77
|
+
StepIndicator.displayName = "StepIndicator";
|
|
78
|
+
function StepConnector({ orientation, isComplete }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("div", {
|
|
80
|
+
"data-slot": "steps-connector",
|
|
81
|
+
"aria-hidden": "true",
|
|
82
|
+
className: cn(stepConnectorVariants({
|
|
83
|
+
orientation,
|
|
84
|
+
status: isComplete ? "complete" : "incomplete"
|
|
85
|
+
}), isComplete && "delight-connector-fill")
|
|
109
86
|
});
|
|
110
87
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
className:
|
|
116
|
-
|
|
117
|
-
children: [visibleActions.map((action) => /* @__PURE__ */ jsx(Button, {
|
|
118
|
-
variant: action.variant ?? getPageHeaderActionVariant(action, action.originalIndex, actions.length),
|
|
119
|
-
onClick: action.onClick,
|
|
120
|
-
...action.buttonProps,
|
|
121
|
-
children: action.label
|
|
122
|
-
}, `${action.label}-${action.originalIndex}`)), overflowActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
123
|
-
appearance: "ghost",
|
|
124
|
-
size: "icon",
|
|
125
|
-
"aria-label": "More actions",
|
|
126
|
-
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-5" })
|
|
127
|
-
}) }), /* @__PURE__ */ jsx(DropdownMenu.Popup, {
|
|
128
|
-
align: "end",
|
|
129
|
-
sideOffset: 4,
|
|
130
|
-
children: /* @__PURE__ */ jsx(DropdownMenu.Items, { children: overflowActions.map((action) => /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
131
|
-
...getOverflowActionItemProps(action),
|
|
132
|
-
onClick: action.onClick,
|
|
133
|
-
variant: action.variant === "destructive" ? "destructive" : "default",
|
|
134
|
-
children: action.label
|
|
135
|
-
}, `${action.label}-${action.originalIndex}`)) })
|
|
136
|
-
})] })]
|
|
88
|
+
StepConnector.displayName = "StepConnector";
|
|
89
|
+
function StepsSubtext({ children, className }) {
|
|
90
|
+
return /* @__PURE__ */ jsx("span", {
|
|
91
|
+
"data-slot": "steps-subtext",
|
|
92
|
+
className: cn(stepSubtextVariants(), className),
|
|
93
|
+
children
|
|
137
94
|
});
|
|
138
95
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */ jsx("input", {
|
|
152
|
-
id: searchId,
|
|
153
|
-
type: "text",
|
|
154
|
-
placeholder: searchPlaceholder,
|
|
155
|
-
"aria-label": searchPlaceholder,
|
|
156
|
-
onChange: (e) => onSearch?.(e.target.value),
|
|
157
|
-
className: cn("peer w-full rounded-lg border border-border bg-background py-2.5 pe-10 ps-10", "text-base text-foreground placeholder:text-muted-foreground", "shadow-xs transition-[border-color,box-shadow] duration-150 motion-reduce:transition-none", "focus-visible:border-primary focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary")
|
|
158
|
-
}),
|
|
159
|
-
searchShortcut && /* @__PURE__ */ jsx(Kbd, {
|
|
160
|
-
variant: "outline",
|
|
161
|
-
size: "xs",
|
|
162
|
-
className: "absolute end-3 top-1/2 -translate-y-1/2 transition-opacity duration-150 peer-focus-visible:opacity-0 motion-reduce:transition-none",
|
|
163
|
-
"aria-hidden": "true",
|
|
164
|
-
children: searchShortcut
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
})
|
|
96
|
+
StepsSubtext.displayName = "Steps.Subtext";
|
|
97
|
+
function StepsItem({ status: statusOverride, onClick, children, className }) {
|
|
98
|
+
const ctx = useStepsContext();
|
|
99
|
+
const index = React.useContext(StepIndexContext);
|
|
100
|
+
const status = statusOverride ?? ctx.getStepStatus(index);
|
|
101
|
+
const isFirst = index === 0;
|
|
102
|
+
const handleClick = onClick ?? (ctx.onStepClick ? () => ctx.onStepClick?.(index) : void 0);
|
|
103
|
+
let label = null;
|
|
104
|
+
let subtext = null;
|
|
105
|
+
React.Children.forEach(children, (child) => {
|
|
106
|
+
if (React.isValidElement(child) && child.type === StepsSubtext) subtext = child;
|
|
107
|
+
else if (child != null && child !== false) label = child;
|
|
168
108
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (words.length >= 2) return `${words[0][0]}${words[1][0]}`.toUpperCase();
|
|
174
|
-
return name.slice(0, 2).toUpperCase();
|
|
175
|
-
}
|
|
176
|
-
function PageHeaderAvatar({ hasAvatar, isBanner, avatarSrc, avatarFallback, avatarStatusIcon }) {
|
|
177
|
-
if (!hasAvatar) return null;
|
|
178
|
-
if (isBanner) return /* @__PURE__ */ jsxs("div", {
|
|
179
|
-
className: cn("relative shrink-0 rounded-full ring-4 ring-bg-primary shadow-lg", "size-24 md:size-40", "delight-fade-in motion-reduce:!animate-none"),
|
|
180
|
-
children: [avatarSrc ? /* @__PURE__ */ jsx("img", {
|
|
181
|
-
src: avatarSrc,
|
|
182
|
-
alt: avatarFallback || "",
|
|
183
|
-
className: "size-full rounded-full object-cover"
|
|
184
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
185
|
-
className: "flex size-full items-center justify-center rounded-full bg-accent text-2xl font-semibold text-muted-foreground md:text-4xl",
|
|
186
|
-
children: getPageHeaderInitials(avatarFallback)
|
|
187
|
-
}), avatarStatusIcon === "verified" && /* @__PURE__ */ jsx("div", {
|
|
188
|
-
className: "absolute bottom-0 end-0 flex size-6 items-center justify-center rounded-full border-2 border-primary bg-primary/10 md:size-10",
|
|
189
|
-
children: /* @__PURE__ */ jsxs("svg", {
|
|
190
|
-
className: "size-3 text-primary md:size-5",
|
|
191
|
-
fill: "currentColor",
|
|
192
|
-
viewBox: "0 0 20 20",
|
|
193
|
-
"aria-hidden": "true",
|
|
194
|
-
children: [/* @__PURE__ */ jsx("title", { children: "Verified" }), /* @__PURE__ */ jsx("path", {
|
|
195
|
-
fillRule: "evenodd",
|
|
196
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
197
|
-
clipRule: "evenodd"
|
|
198
|
-
})]
|
|
199
|
-
})
|
|
200
|
-
})]
|
|
109
|
+
const prevStepStatus = !isFirst ? ctx.getStepStatus(index - 1) : void 0;
|
|
110
|
+
const connector = !isFirst && /* @__PURE__ */ jsx(StepConnector, {
|
|
111
|
+
orientation: ctx.orientation,
|
|
112
|
+
isComplete: prevStepStatus === "complete"
|
|
201
113
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
114
|
+
const isHorizontal = ctx.orientation === "horizontal";
|
|
115
|
+
const indicator = /* @__PURE__ */ jsx(StepIndicator, {
|
|
116
|
+
index,
|
|
117
|
+
status,
|
|
118
|
+
shape: ctx.shape,
|
|
119
|
+
bulletType: ctx.bulletType
|
|
208
120
|
});
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
121
|
+
const labelElement = /* @__PURE__ */ jsxs("div", {
|
|
122
|
+
"data-slot": "steps-label",
|
|
123
|
+
className: cn("flex flex-col", isHorizontal ? "items-center gap-0.5 text-center w-0 whitespace-nowrap" : "items-start gap-0.5 ml-2.5"),
|
|
124
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: stepLabelVariants({ status }),
|
|
126
|
+
children: label
|
|
127
|
+
}), subtext]
|
|
128
|
+
});
|
|
129
|
+
const content = isHorizontal ? /* @__PURE__ */ jsxs("div", {
|
|
130
|
+
className: "flex w-full items-start",
|
|
131
|
+
children: [connector, /* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: "flex flex-col items-center",
|
|
133
|
+
children: [indicator, labelElement]
|
|
134
|
+
})]
|
|
135
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
136
|
+
className: "flex flex-col items-start",
|
|
137
|
+
children: [connector, /* @__PURE__ */ jsxs("div", {
|
|
138
|
+
className: "flex items-center",
|
|
139
|
+
children: [indicator, labelElement]
|
|
221
140
|
})]
|
|
222
141
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
238
|
-
className: bannerVariants({ variant: isCentered ? "centered" : "default" }),
|
|
239
|
-
"aria-hidden": "true"
|
|
240
|
-
}), hasAvatar && /* @__PURE__ */ jsx("div", {
|
|
241
|
-
className: cn("absolute inset-x-0 px-4 md:px-8", "-bottom-12 md:-bottom-20", isCentered && "flex justify-center"),
|
|
242
|
-
children: /* @__PURE__ */ jsx(PageHeaderAvatar, {
|
|
243
|
-
hasAvatar,
|
|
244
|
-
isBanner,
|
|
245
|
-
avatarSrc,
|
|
246
|
-
avatarFallback,
|
|
247
|
-
avatarStatusIcon
|
|
248
|
-
})
|
|
249
|
-
})]
|
|
250
|
-
}),
|
|
251
|
-
/* @__PURE__ */ jsxs("div", {
|
|
252
|
-
className: cn("px-4 md:px-8", hasAvatar ? "pt-16 md:pt-24" : "pt-6", isCentered && "flex flex-col items-center"),
|
|
253
|
-
children: [
|
|
254
|
-
/* @__PURE__ */ jsx("div", {
|
|
255
|
-
className: "md:hidden mb-4",
|
|
256
|
-
children: /* @__PURE__ */ jsx(PageHeaderBackButton, {
|
|
257
|
-
breadcrumbs,
|
|
258
|
-
onBackClick,
|
|
259
|
-
backLabel
|
|
260
|
-
})
|
|
261
|
-
}),
|
|
262
|
-
!isCentered && /* @__PURE__ */ jsx("div", {
|
|
263
|
-
className: "hidden md:block",
|
|
264
|
-
children: /* @__PURE__ */ jsx(PageHeaderBreadcrumbs, { breadcrumbs })
|
|
265
|
-
}),
|
|
266
|
-
/* @__PURE__ */ jsxs("div", {
|
|
267
|
-
className: cn(contentVariants({ variant: resolvedVariant }), "mt-4 md:mt-6"),
|
|
268
|
-
children: [
|
|
269
|
-
/* @__PURE__ */ jsx(PageHeaderTextContent, {
|
|
270
|
-
title,
|
|
271
|
-
supportingText,
|
|
272
|
-
isCentered
|
|
273
|
-
}),
|
|
274
|
-
/* @__PURE__ */ jsx(PageHeaderActions, { actions }),
|
|
275
|
-
/* @__PURE__ */ jsx(PageHeaderSearch, {
|
|
276
|
-
searchId,
|
|
277
|
-
searchPlaceholder,
|
|
278
|
-
searchShortcut,
|
|
279
|
-
onSearch
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
})
|
|
283
|
-
]
|
|
284
|
-
}),
|
|
285
|
-
showDivider && /* @__PURE__ */ jsx(Separator, { className: "mt-5 delight-connector-fill motion-reduce:!animate-none" })
|
|
286
|
-
]
|
|
142
|
+
const labelText = React.useMemo(() => extractText(label), [label]);
|
|
143
|
+
const statusSuffix = status === "complete" ? ", completed" : status === "active" ? ", current" : "";
|
|
144
|
+
return /* @__PURE__ */ jsx("li", {
|
|
145
|
+
"data-slot": "steps-item",
|
|
146
|
+
"aria-current": status === "active" ? "step" : void 0,
|
|
147
|
+
"aria-label": !handleClick && labelText ? `Step ${index + 1}: ${labelText}${statusSuffix}` : void 0,
|
|
148
|
+
className: cn(isHorizontal && !isFirst && "flex-1", !handleClick && className),
|
|
149
|
+
children: handleClick ? /* @__PURE__ */ jsx("button", {
|
|
150
|
+
type: "button",
|
|
151
|
+
onClick: handleClick,
|
|
152
|
+
"aria-label": `Step ${index + 1}: ${labelText || ""}${statusSuffix}`,
|
|
153
|
+
className: cn("cursor-pointer", isHorizontal && "w-full", className, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm"),
|
|
154
|
+
children: content
|
|
155
|
+
}) : content
|
|
287
156
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
157
|
+
}
|
|
158
|
+
StepsItem.displayName = "Steps.Item";
|
|
159
|
+
/**
|
|
160
|
+
* Steps displays a multi-step progress indicator for wizards and workflows.
|
|
161
|
+
* Supports horizontal/vertical orientation, numbered or icon bullets, and clickable steps.
|
|
162
|
+
*
|
|
163
|
+
* @llms Wizard/workflow progress with horizontal/vertical layout, numbered or icon steps
|
|
164
|
+
* @example
|
|
165
|
+
* ```tsx
|
|
166
|
+
* <Steps
|
|
167
|
+
* steps={[{ label: 'Details' }, { label: 'Payment' }, { label: 'Confirm' }]}
|
|
168
|
+
* currentStep={1}
|
|
169
|
+
* orientation="horizontal"
|
|
170
|
+
* />
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
function Steps({ steps, currentStep = 0, orientation = "horizontal", shape = "rounded", bulletType = "text", onStepClick, children, className }) {
|
|
174
|
+
const getStepStatus = React.useCallback((index) => {
|
|
175
|
+
if (index < currentStep) return "complete";
|
|
176
|
+
if (index === currentStep) return "active";
|
|
177
|
+
return "incomplete";
|
|
178
|
+
}, [currentStep]);
|
|
179
|
+
const contextValue = React.useMemo(() => ({
|
|
180
|
+
orientation,
|
|
181
|
+
shape,
|
|
182
|
+
bulletType,
|
|
183
|
+
onStepClick,
|
|
184
|
+
getStepStatus
|
|
185
|
+
}), [
|
|
186
|
+
orientation,
|
|
187
|
+
shape,
|
|
188
|
+
bulletType,
|
|
189
|
+
onStepClick,
|
|
190
|
+
getStepStatus
|
|
191
|
+
]);
|
|
192
|
+
const useCompoundAPI = !steps && React.Children.count(children) > 0;
|
|
193
|
+
const renderFlatAPI = () => {
|
|
194
|
+
if (!steps || steps.length === 0) return null;
|
|
195
|
+
return steps.map((step, index) => /* @__PURE__ */ jsx(StepIndexContext.Provider, {
|
|
196
|
+
value: index,
|
|
197
|
+
children: /* @__PURE__ */ jsxs(StepsItem, { children: [step.label, step.subtext && /* @__PURE__ */ jsx(StepsSubtext, { children: step.subtext })] })
|
|
198
|
+
}, `${index}-${step.label}`));
|
|
199
|
+
};
|
|
200
|
+
const renderCompoundAPI = () => {
|
|
201
|
+
return React.Children.map(children, (child, index) => /* @__PURE__ */ jsx(StepIndexContext.Provider, {
|
|
202
|
+
value: index,
|
|
203
|
+
children: child
|
|
204
|
+
}));
|
|
205
|
+
};
|
|
206
|
+
return /* @__PURE__ */ jsx(StepsContext.Provider, {
|
|
207
|
+
value: contextValue,
|
|
208
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
209
|
+
"aria-label": "Progress steps",
|
|
210
|
+
"data-slot": "steps",
|
|
211
|
+
tabIndex: 0,
|
|
212
|
+
className: cn("overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
213
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
214
|
+
"data-slot": "steps-list",
|
|
215
|
+
className: cn("flex", orientation === "horizontal" ? "flex-row items-start" : "flex-col items-start"),
|
|
216
|
+
children: useCompoundAPI ? renderCompoundAPI() : renderFlatAPI()
|
|
217
|
+
})
|
|
218
|
+
})
|
|
326
219
|
});
|
|
220
|
+
}
|
|
221
|
+
Steps.displayName = "Steps";
|
|
222
|
+
/**
|
|
223
|
+
* @llms Wizard/workflow progress with horizontal/vertical layout, numbered or icon steps
|
|
224
|
+
*/
|
|
225
|
+
var StepsCompound = Object.assign(Steps, {
|
|
226
|
+
Item: StepsItem,
|
|
227
|
+
Subtext: StepsSubtext
|
|
327
228
|
});
|
|
328
|
-
PageHeader.displayName = "PageHeader";
|
|
329
229
|
//#endregion
|
|
330
|
-
export {
|
|
230
|
+
export { StepsCompound as Steps, StepsCompound, StepsItem, StepsSubtext, stepConnectorVariants, stepIndicatorVariants, stepLabelVariants, stepSubtextVariants };
|
|
331
231
|
|
|
332
232
|
//# sourceMappingURL=index202.js.map
|