@alpic-ai/ui 0.0.0-dev.fffc79a → 0.0.0-dev.g00dcac1
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/accordion-card.d.mts +5 -6
- package/dist/components/accordion.d.mts +5 -6
- package/dist/components/alert.d.mts +9 -11
- package/dist/components/attachment-tile.d.mts +1 -3
- package/dist/components/avatar.d.mts +8 -10
- package/dist/components/badge.d.mts +2 -4
- package/dist/components/breadcrumb.d.mts +10 -11
- package/dist/components/button.d.mts +6 -8
- package/dist/components/card.d.mts +9 -10
- package/dist/components/checkbox.d.mts +2 -3
- package/dist/components/collapsible.d.mts +4 -5
- package/dist/components/combobox.d.mts +12 -11
- package/dist/components/combobox.mjs +7 -4
- package/dist/components/command.d.mts +9 -10
- package/dist/components/copyable.d.mts +2 -3
- package/dist/components/description-list.d.mts +5 -6
- package/dist/components/dialog.d.mts +15 -17
- package/dist/components/dropdown-menu.d.mts +18 -20
- package/dist/components/form.d.mts +71 -19
- package/dist/components/form.mjs +120 -10
- package/dist/components/github-button.d.mts +1 -2
- package/dist/components/input-group.d.mts +5 -7
- package/dist/components/input.d.mts +4 -5
- package/dist/components/input.mjs +2 -2
- package/dist/components/label.d.mts +2 -3
- package/dist/components/page-loader.d.mts +1 -3
- package/dist/components/pagination.d.mts +3 -4
- package/dist/components/popover.d.mts +5 -6
- package/dist/components/radio-group.d.mts +3 -4
- package/dist/components/scroll-area.d.mts +3 -4
- package/dist/components/select-trigger-variants.d.mts +1 -3
- package/dist/components/select.d.mts +9 -10
- package/dist/components/separator.d.mts +2 -3
- package/dist/components/sheet.d.mts +11 -12
- package/dist/components/shimmer-text.d.mts +12 -0
- package/dist/components/shimmer-text.mjs +22 -0
- package/dist/components/sidebar.d.mts +34 -36
- package/dist/components/sidebar.mjs +10 -10
- package/dist/components/skeleton.d.mts +2 -4
- package/dist/components/sonner.d.mts +5 -6
- package/dist/components/spinner.d.mts +3 -5
- package/dist/components/status-dot.d.mts +2 -4
- package/dist/components/switch.d.mts +2 -3
- package/dist/components/table.d.mts +10 -11
- package/dist/components/table.mjs +3 -3
- package/dist/components/tabs.d.mts +12 -14
- package/dist/components/tabs.mjs +4 -4
- package/dist/components/tag.d.mts +3 -5
- package/dist/components/task-progress.d.mts +25 -0
- package/dist/components/task-progress.mjs +66 -0
- package/dist/components/textarea.d.mts +3 -4
- package/dist/components/textarea.mjs +2 -2
- package/dist/components/toggle-group.d.mts +4 -6
- package/dist/components/toggle-group.mjs +3 -3
- package/dist/components/tooltip-icon-button.d.mts +1 -2
- package/dist/components/tooltip.d.mts +5 -6
- package/dist/components/tooltip.mjs +1 -1
- package/dist/components/typography.d.mts +4 -5
- package/dist/components/wizard.d.mts +33 -0
- package/dist/components/wizard.mjs +46 -0
- package/dist/hooks/use-mobile.mjs +3 -3
- package/package.json +30 -30
- package/src/components/combobox.tsx +9 -2
- package/src/components/form.tsx +164 -3
- package/src/components/shimmer-text.tsx +23 -0
- package/src/components/table.tsx +2 -3
- package/src/components/tabs.tsx +4 -4
- package/src/components/task-progress.tsx +107 -0
- package/src/components/tooltip.tsx +1 -1
- package/src/components/wizard.tsx +69 -0
- package/src/stories/form.stories.tsx +64 -2
- package/src/stories/tabs.stories.tsx +4 -2
- package/src/stories/task-progress.stories.tsx +81 -0
- package/src/stories/wizard.stories.tsx +64 -0
- package/src/styles/tokens.css +11 -4
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/components/table.d.ts
|
|
5
4
|
declare function Table({
|
|
6
5
|
className,
|
|
7
6
|
...props
|
|
8
|
-
}: React.ComponentProps<"table">):
|
|
7
|
+
}: React$1.ComponentProps<"table">): React$1.JSX.Element;
|
|
9
8
|
declare function TableHeader({
|
|
10
9
|
className,
|
|
11
10
|
...props
|
|
12
|
-
}: React.ComponentProps<"thead">):
|
|
11
|
+
}: React$1.ComponentProps<"thead">): React$1.JSX.Element;
|
|
13
12
|
declare function TableBody({
|
|
14
13
|
className,
|
|
15
14
|
...props
|
|
16
|
-
}: React.ComponentProps<"tbody">):
|
|
15
|
+
}: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
|
|
17
16
|
declare function TableFooter({
|
|
18
17
|
className,
|
|
19
18
|
...props
|
|
20
|
-
}: React.ComponentProps<"tfoot">):
|
|
19
|
+
}: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
|
|
21
20
|
declare function TableRow({
|
|
22
21
|
className,
|
|
23
22
|
...props
|
|
24
|
-
}: React.ComponentProps<"tr">):
|
|
23
|
+
}: React$1.ComponentProps<"tr">): React$1.JSX.Element;
|
|
25
24
|
declare function TableHead({
|
|
26
25
|
className,
|
|
27
26
|
...props
|
|
28
|
-
}: React.ComponentProps<"th">):
|
|
29
|
-
interface TableCellProps extends React.ComponentProps<"td"> {
|
|
27
|
+
}: React$1.ComponentProps<"th">): React$1.JSX.Element;
|
|
28
|
+
interface TableCellProps extends React$1.ComponentProps<"td"> {
|
|
30
29
|
/**
|
|
31
30
|
* When true, the cell renders edge-to-edge so the child can act as the
|
|
32
31
|
* interactive surface (e.g. a button or popover trigger filling the cell).
|
|
@@ -38,10 +37,10 @@ declare function TableCell({
|
|
|
38
37
|
className,
|
|
39
38
|
interactive,
|
|
40
39
|
...props
|
|
41
|
-
}: TableCellProps):
|
|
40
|
+
}: TableCellProps): React$1.JSX.Element;
|
|
42
41
|
declare function TableCaption({
|
|
43
42
|
className,
|
|
44
43
|
...props
|
|
45
|
-
}: React.ComponentProps<"caption">):
|
|
44
|
+
}: React$1.ComponentProps<"caption">): React$1.JSX.Element;
|
|
46
45
|
//#endregion
|
|
47
46
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -36,21 +36,21 @@ function TableFooter({ className, ...props }) {
|
|
|
36
36
|
function TableRow({ className, ...props }) {
|
|
37
37
|
return /* @__PURE__ */ jsx("tr", {
|
|
38
38
|
"data-slot": "table-row",
|
|
39
|
-
className: cn("border-b border-border-secondary transition-colors", "data-[state=selected]:bg-muted", "[@media(hover:hover)]:hover:bg-background-hover dark:[@media(hover:hover)]:hover:bg-muted",
|
|
39
|
+
className: cn("border-b border-border-secondary transition-colors", "data-[state=selected]:bg-muted", "[@media(hover:hover)]:hover:bg-background-hover dark:[@media(hover:hover)]:hover:bg-muted", className),
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
function TableHead({ className, ...props }) {
|
|
44
44
|
return /* @__PURE__ */ jsx("th", {
|
|
45
45
|
"data-slot": "table-head",
|
|
46
|
-
className: cn("h-11 px-6 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:
|
|
46
|
+
className: cn("h-11 px-6 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
47
47
|
...props
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function TableCell({ className, interactive = false, ...props }) {
|
|
51
51
|
return /* @__PURE__ */ jsx("td", {
|
|
52
52
|
"data-slot": "table-cell",
|
|
53
|
-
className: cn("align-middle", interactive ? "h-px p-0" : "px-6 py-2", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:
|
|
53
|
+
className: cn("align-middle", interactive ? "h-px p-0" : "px-6 py-2", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
54
54
|
...props
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
2
|
+
import * as React$1 from "react";
|
|
4
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
4
|
|
|
7
5
|
//#region src/components/tabs.d.ts
|
|
8
6
|
declare const tabsTriggerVariants: (props?: ({
|
|
9
7
|
variant?: "default" | "pill" | "line" | null | undefined;
|
|
10
|
-
} &
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
9
|
declare function Tabs({
|
|
12
10
|
className,
|
|
13
11
|
orientation,
|
|
14
12
|
...props
|
|
15
|
-
}: React.ComponentProps<typeof TabsPrimitive.Root>):
|
|
13
|
+
}: React$1.ComponentProps<typeof TabsPrimitive.Root>): React$1.JSX.Element;
|
|
16
14
|
declare const tabsListVariants: (props?: ({
|
|
17
15
|
variant?: "default" | "line" | null | undefined;
|
|
18
|
-
} &
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
17
|
declare function TabsList({
|
|
20
18
|
className,
|
|
21
19
|
variant,
|
|
22
20
|
...props
|
|
23
|
-
}: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>):
|
|
21
|
+
}: React$1.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React$1.JSX.Element;
|
|
24
22
|
declare function TabsTrigger({
|
|
25
23
|
className,
|
|
26
24
|
...props
|
|
27
|
-
}: React.ComponentProps<typeof TabsPrimitive.Trigger>):
|
|
25
|
+
}: React$1.ComponentProps<typeof TabsPrimitive.Trigger>): React$1.JSX.Element;
|
|
28
26
|
declare function TabsContent({
|
|
29
27
|
className,
|
|
30
28
|
...props
|
|
31
|
-
}: React.ComponentProps<typeof TabsPrimitive.Content>):
|
|
29
|
+
}: React$1.ComponentProps<typeof TabsPrimitive.Content>): React$1.JSX.Element;
|
|
32
30
|
type TabsNavVariant = "line" | "pill";
|
|
33
31
|
type TabsNavOrientation = "horizontal" | "vertical";
|
|
34
32
|
declare function TabsNav({
|
|
@@ -36,23 +34,23 @@ declare function TabsNav({
|
|
|
36
34
|
variant,
|
|
37
35
|
className,
|
|
38
36
|
...props
|
|
39
|
-
}: React.ComponentProps<"nav"> & {
|
|
37
|
+
}: React$1.ComponentProps<"nav"> & {
|
|
40
38
|
orientation?: TabsNavOrientation;
|
|
41
39
|
variant?: TabsNavVariant;
|
|
42
|
-
}):
|
|
40
|
+
}): React$1.JSX.Element;
|
|
43
41
|
declare function TabsNavList({
|
|
44
42
|
className,
|
|
45
43
|
...props
|
|
46
|
-
}: React.ComponentProps<"ul">):
|
|
44
|
+
}: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
47
45
|
declare function TabsNavTrigger({
|
|
48
46
|
className,
|
|
49
47
|
active,
|
|
50
48
|
asChild,
|
|
51
49
|
children,
|
|
52
50
|
...props
|
|
53
|
-
}: React.ComponentProps<"a"> & {
|
|
51
|
+
}: React$1.ComponentProps<"a"> & {
|
|
54
52
|
active?: boolean;
|
|
55
53
|
asChild?: boolean;
|
|
56
|
-
}):
|
|
54
|
+
}): React$1.JSX.Element;
|
|
57
55
|
//#endregion
|
|
58
56
|
export { Tabs, TabsContent, TabsList, TabsNav, TabsNavList, TabsNavTrigger, TabsTrigger, tabsListVariants, tabsTriggerVariants };
|
package/dist/components/tabs.mjs
CHANGED
|
@@ -21,10 +21,10 @@ const tabsTriggerVariants = cva([
|
|
|
21
21
|
"data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:text-foreground"
|
|
22
22
|
],
|
|
23
23
|
pill: [
|
|
24
|
-
"rounded-
|
|
25
|
-
"text-
|
|
26
|
-
"[@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-
|
|
27
|
-
"data-[state=active]:bg-accent data-[state=active]:text-
|
|
24
|
+
"rounded-md px-2 py-1.5",
|
|
25
|
+
"text-quaternary-foreground",
|
|
26
|
+
"[@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-muted-foreground",
|
|
27
|
+
"data-[state=active]:bg-accent data-[state=active]:text-muted-foreground"
|
|
28
28
|
]
|
|
29
29
|
} },
|
|
30
30
|
defaultVariants: { variant: "default" }
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/components/tag.d.ts
|
|
4
2
|
interface TagBaseProps {
|
|
5
3
|
icon?: React.ReactNode;
|
|
@@ -10,7 +8,7 @@ declare function Tag({
|
|
|
10
8
|
icon,
|
|
11
9
|
children,
|
|
12
10
|
...props
|
|
13
|
-
}: TagProps):
|
|
11
|
+
}: TagProps): import("react").JSX.Element;
|
|
14
12
|
interface TagDismissibleProps extends React.ComponentProps<"span">, TagBaseProps {
|
|
15
13
|
onDismiss?: () => void;
|
|
16
14
|
}
|
|
@@ -20,7 +18,7 @@ declare function TagDismissible({
|
|
|
20
18
|
children,
|
|
21
19
|
onDismiss,
|
|
22
20
|
...props
|
|
23
|
-
}: TagDismissibleProps):
|
|
21
|
+
}: TagDismissibleProps): import("react").JSX.Element;
|
|
24
22
|
interface TagCountProps extends React.ComponentProps<"span">, TagBaseProps {
|
|
25
23
|
count: number;
|
|
26
24
|
}
|
|
@@ -30,6 +28,6 @@ declare function TagCount({
|
|
|
30
28
|
children,
|
|
31
29
|
count,
|
|
32
30
|
...props
|
|
33
|
-
}: TagCountProps):
|
|
31
|
+
}: TagCountProps): import("react").JSX.Element;
|
|
34
32
|
//#endregion
|
|
35
33
|
export { Tag, TagCount, TagDismissible };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/components/task-progress.d.ts
|
|
2
|
+
type TaskProgressStatus = "pending" | "running" | "done";
|
|
3
|
+
interface TaskProgressStep {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
status: TaskProgressStatus;
|
|
7
|
+
}
|
|
8
|
+
interface TaskProgressProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
9
|
+
steps: readonly TaskProgressStep[];
|
|
10
|
+
trailingLabel?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional mount-time stagger: each row fades + slides in with `animation-delay = index × stepRevealDelayMs`.
|
|
13
|
+
* Pure CSS, runs once on mount. Omit for no animation.
|
|
14
|
+
*/
|
|
15
|
+
stepRevealDelayMs?: number;
|
|
16
|
+
}
|
|
17
|
+
declare function TaskProgress({
|
|
18
|
+
steps,
|
|
19
|
+
trailingLabel,
|
|
20
|
+
stepRevealDelayMs,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: TaskProgressProps): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TaskProgress, type TaskProgressStatus, type TaskProgressStep };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { Separator } from "./separator.mjs";
|
|
4
|
+
import { CheckIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/task-progress.tsx
|
|
7
|
+
const REVEAL_CLASSES = "animate-in fade-in slide-in-from-bottom-2 duration-300";
|
|
8
|
+
function TaskProgress({ steps, trailingLabel, stepRevealDelayMs, className, ...props }) {
|
|
9
|
+
const total = steps.length;
|
|
10
|
+
const doneCount = steps.filter((step) => step.status === "done").length;
|
|
11
|
+
const percent = total > 0 ? Math.round(doneCount / total * 100) : 0;
|
|
12
|
+
const stagger = stepRevealDelayMs != null;
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: cn("flex flex-col gap-4", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "bg-muted h-2 w-full overflow-hidden rounded-full",
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: "h-full rounded-full bg-success transition-all duration-500",
|
|
20
|
+
style: { width: `${percent}%` }
|
|
21
|
+
})
|
|
22
|
+
}), /* @__PURE__ */ jsxs("div", { children: [steps.map((step, idx) => /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: stagger ? REVEAL_CLASSES : void 0,
|
|
24
|
+
style: stagger ? {
|
|
25
|
+
animationDelay: `${idx * (stepRevealDelayMs ?? 0)}ms`,
|
|
26
|
+
animationFillMode: "both"
|
|
27
|
+
} : void 0,
|
|
28
|
+
children: [/* @__PURE__ */ jsx(TaskProgressRow, {
|
|
29
|
+
label: step.label,
|
|
30
|
+
status: step.status
|
|
31
|
+
}), idx < steps.length - 1 && /* @__PURE__ */ jsx(Separator, {})]
|
|
32
|
+
}, step.id)), trailingLabel && /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: stagger ? REVEAL_CLASSES : void 0,
|
|
34
|
+
children: [/* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsx(TaskProgressRow, {
|
|
35
|
+
label: trailingLabel,
|
|
36
|
+
status: "running",
|
|
37
|
+
muted: true
|
|
38
|
+
})]
|
|
39
|
+
})] })]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function TaskProgressRow({ label, status, muted }) {
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: "flex items-center justify-between py-2",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: cn("type-text-sm", muted && "text-muted-foreground"),
|
|
48
|
+
children: label
|
|
49
|
+
}),
|
|
50
|
+
status === "done" && /* @__PURE__ */ jsxs("span", {
|
|
51
|
+
className: "flex items-center gap-1 type-text-sm text-success",
|
|
52
|
+
children: [/* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" }), /* @__PURE__ */ jsx("span", { children: "done" })]
|
|
53
|
+
}),
|
|
54
|
+
status === "running" && /* @__PURE__ */ jsxs("span", {
|
|
55
|
+
className: "flex items-center gap-1.5 type-text-sm text-warning",
|
|
56
|
+
children: [/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-warning" }), /* @__PURE__ */ jsx("span", { children: "running…" })]
|
|
57
|
+
}),
|
|
58
|
+
status === "pending" && /* @__PURE__ */ jsxs("span", {
|
|
59
|
+
className: "flex items-center gap-1.5 type-text-sm text-muted-foreground",
|
|
60
|
+
children: [/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full border border-muted-foreground" }), /* @__PURE__ */ jsx("span", { children: "pending" })]
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { TaskProgress };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/components/textarea.d.ts
|
|
5
|
-
interface TextareaProps extends React.ComponentProps<"textarea"> {
|
|
4
|
+
interface TextareaProps extends React$1.ComponentProps<"textarea"> {
|
|
6
5
|
label?: string;
|
|
7
6
|
required?: boolean;
|
|
8
7
|
hint?: string;
|
|
@@ -18,6 +17,6 @@ declare function Textarea({
|
|
|
18
17
|
error,
|
|
19
18
|
tooltip,
|
|
20
19
|
...props
|
|
21
|
-
}: TextareaProps):
|
|
20
|
+
}: TextareaProps): React$1.JSX.Element;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { Textarea, type TextareaProps };
|
|
@@ -4,10 +4,10 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
|
|
|
4
4
|
import { Label } from "./label.mjs";
|
|
5
5
|
import { Info } from "lucide-react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import * as React from "react";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
8
|
//#region src/components/textarea.tsx
|
|
9
9
|
function Textarea({ className, id, label, required, hint, error, tooltip, ...props }) {
|
|
10
|
-
const generatedId = React.useId();
|
|
10
|
+
const generatedId = React$1.useId();
|
|
11
11
|
const fieldId = id ?? generatedId;
|
|
12
12
|
const textarea = /* @__PURE__ */ jsx("textarea", {
|
|
13
13
|
id: fieldId,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
2
|
+
import * as React$1 from "react";
|
|
4
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
4
|
|
|
7
5
|
//#region src/components/toggle-group.d.ts
|
|
8
6
|
declare const toggleGroupItemVariants: (props?: ({
|
|
9
7
|
variant?: "default" | "outline" | null | undefined;
|
|
10
8
|
size?: "default" | "sm" | null | undefined;
|
|
11
|
-
} &
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
10
|
type ToggleGroupContextValue = VariantProps<typeof toggleGroupItemVariants>;
|
|
13
11
|
declare function ToggleGroup({
|
|
14
12
|
className,
|
|
@@ -16,13 +14,13 @@ declare function ToggleGroup({
|
|
|
16
14
|
size,
|
|
17
15
|
children,
|
|
18
16
|
...props
|
|
19
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleGroupContextValue):
|
|
17
|
+
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleGroupContextValue): React$1.JSX.Element;
|
|
20
18
|
declare function ToggleGroupItem({
|
|
21
19
|
className,
|
|
22
20
|
children,
|
|
23
21
|
variant,
|
|
24
22
|
size,
|
|
25
23
|
...props
|
|
26
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleGroupItemVariants>):
|
|
24
|
+
}: React$1.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleGroupItemVariants>): React$1.JSX.Element;
|
|
27
25
|
//#endregion
|
|
28
26
|
export { ToggleGroup, ToggleGroupItem, toggleGroupItemVariants };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import * as React from "react";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
6
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
7
7
|
//#region src/components/toggle-group.tsx
|
|
8
8
|
const toggleGroupItemVariants = cva([
|
|
@@ -36,7 +36,7 @@ const toggleGroupItemVariants = cva([
|
|
|
36
36
|
size: "default"
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
const ToggleGroupContext = React.createContext({
|
|
39
|
+
const ToggleGroupContext = React$1.createContext({
|
|
40
40
|
size: "default",
|
|
41
41
|
variant: "default"
|
|
42
42
|
});
|
|
@@ -55,7 +55,7 @@ function ToggleGroup({ className, variant, size, children, ...props }) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
58
|
-
const context = React.useContext(ToggleGroupContext);
|
|
58
|
+
const context = React$1.useContext(ToggleGroupContext);
|
|
59
59
|
const resolvedVariant = context.variant ?? variant;
|
|
60
60
|
const resolvedSize = context.size ?? size;
|
|
61
61
|
return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Item, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Button } from "./button.mjs";
|
|
2
|
-
import * as _$react from "react";
|
|
3
2
|
import { ComponentPropsWithRef } from "react";
|
|
4
3
|
|
|
5
4
|
//#region src/components/tooltip-icon-button.d.ts
|
|
@@ -7,6 +6,6 @@ type TooltipIconButtonProps = ComponentPropsWithRef<typeof Button> & {
|
|
|
7
6
|
tooltip: string;
|
|
8
7
|
side?: "top" | "bottom" | "left" | "right";
|
|
9
8
|
};
|
|
10
|
-
declare const TooltipIconButton:
|
|
9
|
+
declare const TooltipIconButton: import("react").ForwardRefExoticComponent<Omit<TooltipIconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
10
|
//#endregion
|
|
12
11
|
export { TooltipIconButton, type TooltipIconButtonProps };
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
3
|
|
|
5
4
|
//#region src/components/tooltip.d.ts
|
|
6
5
|
declare function TooltipProvider({
|
|
7
6
|
delayDuration,
|
|
8
7
|
...props
|
|
9
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>):
|
|
8
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Provider>): React$1.JSX.Element;
|
|
10
9
|
declare function Tooltip({
|
|
11
10
|
...props
|
|
12
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>):
|
|
11
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Root>): React$1.JSX.Element;
|
|
13
12
|
declare function TooltipTrigger({
|
|
14
13
|
...props
|
|
15
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>):
|
|
14
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Trigger>): React$1.JSX.Element;
|
|
16
15
|
declare function TooltipContent({
|
|
17
16
|
className,
|
|
18
17
|
sideOffset,
|
|
19
18
|
children,
|
|
20
19
|
...props
|
|
21
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>):
|
|
20
|
+
}: React$1.ComponentProps<typeof TooltipPrimitive.Content>): React$1.JSX.Element;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -26,7 +26,7 @@ function TooltipContent({ className, sideOffset = 6, children, ...props }) {
|
|
|
26
26
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Content, {
|
|
27
27
|
"data-slot": "tooltip-content",
|
|
28
28
|
sideOffset,
|
|
29
|
-
className: cn("bg-inverted text-inverted-foreground dark:bg-subtle dark:text-foreground", "z-50 w-fit rounded-md px-3 py-2 shadow-lg dark:shadow-none dark:drop-shadow-[0_0_0.5px_var(--color-border)]", "type-text-xs font-semibold text-balance text-center", "animate-in fade-in-0 zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", "origin-(--radix-tooltip-content-transform-origin)", className),
|
|
29
|
+
className: cn("bg-inverted text-inverted-foreground dark:bg-subtle dark:text-foreground", "z-50 w-fit rounded-md px-3 py-2 shadow-lg dark:shadow-none dark:drop-shadow-[0_0_0.5px_var(--color-border)]", "type-text-xs font-semibold text-balance text-center whitespace-pre-line", "animate-in fade-in-0 zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", "origin-(--radix-tooltip-content-transform-origin)", className),
|
|
30
30
|
...props,
|
|
31
31
|
children: [children, /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-inverted fill-inverted dark:bg-subtle dark:fill-subtle z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
|
|
32
32
|
}) });
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/components/typography.d.ts
|
|
@@ -8,27 +7,27 @@ declare function H1({
|
|
|
8
7
|
}: {
|
|
9
8
|
children: ReactNode;
|
|
10
9
|
className?: string;
|
|
11
|
-
}):
|
|
10
|
+
}): import("react").JSX.Element;
|
|
12
11
|
declare function H2({
|
|
13
12
|
children,
|
|
14
13
|
className
|
|
15
14
|
}: {
|
|
16
15
|
children: ReactNode;
|
|
17
16
|
className?: string;
|
|
18
|
-
}):
|
|
17
|
+
}): import("react").JSX.Element;
|
|
19
18
|
declare function H3({
|
|
20
19
|
children,
|
|
21
20
|
className
|
|
22
21
|
}: {
|
|
23
22
|
children: ReactNode;
|
|
24
23
|
className?: string;
|
|
25
|
-
}):
|
|
24
|
+
}): import("react").JSX.Element;
|
|
26
25
|
declare function H4({
|
|
27
26
|
children,
|
|
28
27
|
className
|
|
29
28
|
}: {
|
|
30
29
|
children: ReactNode;
|
|
31
30
|
className?: string;
|
|
32
|
-
}):
|
|
31
|
+
}): import("react").JSX.Element;
|
|
33
32
|
//#endregion
|
|
34
33
|
export { H1, H2, H3, H4 };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/wizard.d.ts
|
|
4
|
+
interface WizardStep {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
interface WizardStepsProps {
|
|
9
|
+
steps: readonly WizardStep[];
|
|
10
|
+
activeIdx: number;
|
|
11
|
+
onSelect: (idx: number) => void;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function WizardSteps({
|
|
16
|
+
steps,
|
|
17
|
+
activeIdx,
|
|
18
|
+
onSelect,
|
|
19
|
+
ariaLabel,
|
|
20
|
+
className
|
|
21
|
+
}: WizardStepsProps): React$1.JSX.Element;
|
|
22
|
+
interface WizardProgressProps extends React$1.ComponentProps<"div"> {
|
|
23
|
+
current: number;
|
|
24
|
+
total: number;
|
|
25
|
+
}
|
|
26
|
+
declare function WizardProgress({
|
|
27
|
+
current,
|
|
28
|
+
total,
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: WizardProgressProps): React$1.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { WizardProgress, type WizardStep, WizardSteps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { TabsNav, TabsNavList, TabsNavTrigger } from "./tabs.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/wizard.tsx
|
|
6
|
+
function WizardSteps({ steps, activeIdx, onSelect, ariaLabel = "Wizard steps", className }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(TabsNav, {
|
|
8
|
+
orientation: "vertical",
|
|
9
|
+
"aria-label": ariaLabel,
|
|
10
|
+
className,
|
|
11
|
+
children: /* @__PURE__ */ jsx(TabsNavList, { children: steps.map((step, idx) => /* @__PURE__ */ jsx(TabsNavTrigger, {
|
|
12
|
+
active: idx === activeIdx,
|
|
13
|
+
asChild: true,
|
|
14
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
onClick: () => onSelect(idx),
|
|
17
|
+
className: "w-full justify-start text-left",
|
|
18
|
+
children: step.label
|
|
19
|
+
})
|
|
20
|
+
}, step.id)) })
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function WizardProgress({ current, total, className, ...props }) {
|
|
24
|
+
const percent = total > 0 ? Math.round(current / total * 100) : 0;
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: cn("flex flex-col gap-1.5 px-2", className),
|
|
27
|
+
...props,
|
|
28
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "text-muted-foreground flex items-center justify-between text-xs",
|
|
30
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
31
|
+
"Step ",
|
|
32
|
+
current,
|
|
33
|
+
"/",
|
|
34
|
+
total
|
|
35
|
+
] }), /* @__PURE__ */ jsxs("span", { children: [percent, "%"] })]
|
|
36
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: "bg-muted h-1.5 overflow-hidden rounded-full",
|
|
38
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: "bg-primary h-full transition-all",
|
|
40
|
+
style: { width: `${percent}%` }
|
|
41
|
+
})
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { WizardProgress, WizardSteps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
//#region src/hooks/use-mobile.ts
|
|
3
3
|
const MOBILE_BREAKPOINT = 768;
|
|
4
4
|
function useIsMobile() {
|
|
5
|
-
const [isMobile, setIsMobile] = React.useState(void 0);
|
|
6
|
-
React.useEffect(() => {
|
|
5
|
+
const [isMobile, setIsMobile] = React$1.useState(void 0);
|
|
6
|
+
React$1.useEffect(() => {
|
|
7
7
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
8
8
|
const onChange = () => setIsMobile(mql.matches);
|
|
9
9
|
mql.addEventListener("change", onChange);
|