@websolutespa/ask-ui 1.0.3 → 1.0.4
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.d.mts +25 -0
- package/dist/components/accordion.mjs +55 -0
- package/dist/components/ai-elements/attachments.d.mts +94 -0
- package/dist/components/ai-elements/attachments.mjs +174 -0
- package/dist/components/ai-elements/conversation.d.mts +51 -0
- package/dist/components/ai-elements/conversation.mjs +85 -0
- package/dist/components/ai-elements/message.d.mts +89 -0
- package/dist/components/ai-elements/message.mjs +175 -0
- package/dist/components/ai-elements/prompt-input.d.mts +277 -0
- package/dist/components/ai-elements/prompt-input.mjs +703 -0
- package/dist/components/ai-elements/speech-input.d.mts +64 -0
- package/dist/components/ai-elements/speech-input.mjs +153 -0
- package/dist/components/alert-dialog.d.mts +60 -0
- package/dist/components/alert-dialog.mjs +101 -0
- package/dist/components/alert.d.mts +28 -0
- package/dist/components/alert.mjs +43 -0
- package/dist/components/aspect-ratio.d.mts +9 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +34 -0
- package/dist/components/avatar.mjs +51 -0
- package/dist/components/badge.d.mts +19 -0
- package/dist/components/badge.mjs +27 -0
- package/dist/components/breadcrumb.d.mts +38 -0
- package/dist/components/breadcrumb.mjs +70 -0
- package/dist/components/button-group.d.mts +28 -0
- package/dist/components/button-group.mjs +38 -0
- package/dist/components/button.d.mts +21 -0
- package/dist/components/button.mjs +47 -0
- package/dist/components/calendar.d.mts +30 -0
- package/dist/components/calendar.mjs +109 -0
- package/dist/components/card.d.mts +37 -0
- package/dist/components/card.mjs +56 -0
- package/dist/components/carousel.d.mts +56 -0
- package/dist/components/carousel.mjs +132 -0
- package/dist/components/chart.d.mts +78 -0
- package/dist/components/chart.mjs +146 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +21 -0
- package/dist/components/collapsible.d.mts +15 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/combobox.d.mts +81 -0
- package/dist/components/combobox.mjs +163 -0
- package/dist/components/command.d.mts +54 -0
- package/dist/components/command.mjs +88 -0
- package/dist/components/context-menu.d.mts +85 -0
- package/dist/components/context-menu.mjs +125 -0
- package/dist/components/dialog.d.mts +51 -0
- package/dist/components/dialog.mjs +96 -0
- package/dist/components/direction.d.mts +15 -0
- package/dist/components/direction.mjs +14 -0
- package/dist/components/drawer.d.mts +47 -0
- package/dist/components/drawer.mjs +79 -0
- package/dist/components/dropdown-menu.d.mts +87 -0
- package/dist/components/dropdown-menu.mjs +131 -0
- package/dist/components/empty.d.mts +35 -0
- package/dist/components/empty.mjs +59 -0
- package/dist/components/field.d.mts +64 -0
- package/dist/components/field.mjs +110 -0
- package/dist/components/hover-card.d.mts +22 -0
- package/dist/components/hover-card.mjs +33 -0
- package/dist/components/input-group.d.mts +43 -0
- package/dist/components/input-group.mjs +79 -0
- package/dist/components/input-otp.d.mts +28 -0
- package/dist/components/input-otp.mjs +47 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +62 -0
- package/dist/components/item.mjs +117 -0
- package/dist/components/kbd.d.mts +13 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +15 -0
- package/dist/components/menubar.d.mts +90 -0
- package/dist/components/menubar.mjs +135 -0
- package/dist/components/native-select.d.mts +21 -0
- package/dist/components/native-select.mjs +37 -0
- package/dist/components/navigation-menu.d.mts +46 -0
- package/dist/components/navigation-menu.mjs +80 -0
- package/dist/components/pagination.d.mts +45 -0
- package/dist/components/pagination.mjs +80 -0
- package/dist/components/popover.d.mts +34 -0
- package/dist/components/popover.mjs +56 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +20 -0
- package/dist/components/radio-group.d.mts +15 -0
- package/dist/components/radio-group.mjs +27 -0
- package/dist/components/resizable.d.mts +20 -0
- package/dist/components/resizable.mjs +28 -0
- package/dist/components/scroll-area.d.mts +17 -0
- package/dist/components/scroll-area.mjs +37 -0
- package/dist/components/select.d.mts +53 -0
- package/dist/components/select.mjs +100 -0
- package/dist/components/separator.d.mts +13 -0
- package/dist/components/separator.mjs +17 -0
- package/dist/components/sheet.d.mts +42 -0
- package/dist/components/sheet.mjs +90 -0
- package/dist/components/sidebar.d.mts +167 -0
- package/dist/components/sidebar.mjs +374 -0
- package/dist/components/skeleton.d.mts +9 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +36 -0
- package/dist/components/sonner.d.mts +9 -0
- package/dist/components/sonner.mjs +30 -0
- package/dist/components/spinner.d.mts +9 -0
- package/dist/components/spinner.mjs +14 -0
- package/dist/components/switch.d.mts +14 -0
- package/dist/components/switch.mjs +20 -0
- package/dist/components/table.d.mts +38 -0
- package/dist/components/table.mjs +67 -0
- package/dist/components/tabs.d.mts +30 -0
- package/dist/components/tabs.mjs +46 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +13 -0
- package/dist/components/toggle-group.d.mts +28 -0
- package/dist/components/toggle-group.mjs +51 -0
- package/dist/components/toggle.d.mts +19 -0
- package/dist/components/toggle.mjs +37 -0
- package/dist/components/tooltip.d.mts +23 -0
- package/dist/components/tooltip.mjs +36 -0
- package/dist/exports/components.d.mts +61 -0
- package/dist/exports/components.mjs +61 -0
- package/dist/exports/hooks.d.mts +2 -0
- package/dist/exports/hooks.mjs +2 -0
- package/dist/exports/lib.d.mts +2 -0
- package/dist/exports/lib.mjs +2 -0
- package/dist/hooks/use-mobile.d.mts +4 -0
- package/dist/hooks/use-mobile.mjs +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
import { TooltipValueType } from "recharts";
|
|
5
|
+
|
|
6
|
+
//#region src/components/chart.d.ts
|
|
7
|
+
declare const THEMES: {
|
|
8
|
+
readonly light: "";
|
|
9
|
+
readonly dark: ".dark";
|
|
10
|
+
};
|
|
11
|
+
type TooltipNameType = number | string;
|
|
12
|
+
type ChartConfig = Record<string, {
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
icon?: React.ComponentType;
|
|
15
|
+
} & ({
|
|
16
|
+
color?: string;
|
|
17
|
+
theme?: never;
|
|
18
|
+
} | {
|
|
19
|
+
color?: never;
|
|
20
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
21
|
+
})>;
|
|
22
|
+
declare function ChartContainer({
|
|
23
|
+
id,
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
config,
|
|
27
|
+
initialDimension,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<"div"> & {
|
|
30
|
+
config: ChartConfig;
|
|
31
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
32
|
+
initialDimension?: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
37
|
+
declare const ChartStyle: ({
|
|
38
|
+
id,
|
|
39
|
+
config
|
|
40
|
+
}: {
|
|
41
|
+
id: string;
|
|
42
|
+
config: ChartConfig;
|
|
43
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
44
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
45
|
+
declare function ChartTooltipContent({
|
|
46
|
+
active,
|
|
47
|
+
payload,
|
|
48
|
+
className,
|
|
49
|
+
indicator,
|
|
50
|
+
hideLabel,
|
|
51
|
+
hideIndicator,
|
|
52
|
+
label,
|
|
53
|
+
labelFormatter,
|
|
54
|
+
labelClassName,
|
|
55
|
+
formatter,
|
|
56
|
+
color,
|
|
57
|
+
nameKey,
|
|
58
|
+
labelKey
|
|
59
|
+
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
60
|
+
hideLabel?: boolean;
|
|
61
|
+
hideIndicator?: boolean;
|
|
62
|
+
indicator?: "line" | "dot" | "dashed";
|
|
63
|
+
nameKey?: string;
|
|
64
|
+
labelKey?: string;
|
|
65
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): _$react_jsx_runtime0.JSX.Element | null;
|
|
66
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
67
|
+
declare function ChartLegendContent({
|
|
68
|
+
className,
|
|
69
|
+
hideIcon,
|
|
70
|
+
payload,
|
|
71
|
+
verticalAlign,
|
|
72
|
+
nameKey
|
|
73
|
+
}: React.ComponentProps<"div"> & {
|
|
74
|
+
hideIcon?: boolean;
|
|
75
|
+
nameKey?: string;
|
|
76
|
+
} & RechartsPrimitive.DefaultLegendContentProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as RechartsPrimitive from "recharts";
|
|
6
|
+
//#region src/components/chart.tsx
|
|
7
|
+
const THEMES = {
|
|
8
|
+
light: "",
|
|
9
|
+
dark: ".dark"
|
|
10
|
+
};
|
|
11
|
+
const INITIAL_DIMENSION = {
|
|
12
|
+
width: 320,
|
|
13
|
+
height: 200
|
|
14
|
+
};
|
|
15
|
+
const ChartContext = React.createContext(null);
|
|
16
|
+
function useChart() {
|
|
17
|
+
const context = React.useContext(ChartContext);
|
|
18
|
+
if (!context) throw new Error("useChart must be used within a <ChartContainer />");
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
22
|
+
const uniqueId = React.useId();
|
|
23
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
24
|
+
return /* @__PURE__ */ jsx(ChartContext.Provider, {
|
|
25
|
+
value: { config },
|
|
26
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
"data-slot": "chart",
|
|
28
|
+
"data-chart": chartId,
|
|
29
|
+
className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
30
|
+
...props,
|
|
31
|
+
children: [/* @__PURE__ */ jsx(ChartStyle, {
|
|
32
|
+
id: chartId,
|
|
33
|
+
config
|
|
34
|
+
}), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, {
|
|
35
|
+
initialDimension,
|
|
36
|
+
children
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const ChartStyle = ({ id, config }) => {
|
|
42
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);
|
|
43
|
+
if (!colorConfig.length) return null;
|
|
44
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
|
|
45
|
+
${prefix} [data-chart=${id}] {
|
|
46
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
47
|
+
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
48
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
49
|
+
}).join("\n")}
|
|
50
|
+
}
|
|
51
|
+
`).join("\n") } });
|
|
52
|
+
};
|
|
53
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
54
|
+
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }) {
|
|
55
|
+
const { config } = useChart();
|
|
56
|
+
const tooltipLabel = React.useMemo(() => {
|
|
57
|
+
if (hideLabel || !payload?.length) return null;
|
|
58
|
+
const [item] = payload;
|
|
59
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`);
|
|
60
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
|
|
61
|
+
if (labelFormatter) return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: cn("font-medium", labelClassName),
|
|
63
|
+
children: labelFormatter(value, payload)
|
|
64
|
+
});
|
|
65
|
+
if (!value) return null;
|
|
66
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: cn("font-medium", labelClassName),
|
|
68
|
+
children: value
|
|
69
|
+
});
|
|
70
|
+
}, [
|
|
71
|
+
label,
|
|
72
|
+
labelFormatter,
|
|
73
|
+
payload,
|
|
74
|
+
hideLabel,
|
|
75
|
+
labelClassName,
|
|
76
|
+
config,
|
|
77
|
+
labelKey
|
|
78
|
+
]);
|
|
79
|
+
if (!active || !payload?.length) return null;
|
|
80
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
81
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
82
|
+
className: cn("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
83
|
+
children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: "grid gap-1.5",
|
|
85
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
86
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.name ?? item.dataKey ?? "value"}`);
|
|
87
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color;
|
|
88
|
+
return /* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"),
|
|
90
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
|
|
91
|
+
className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
92
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
93
|
+
"w-1": indicator === "line",
|
|
94
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
95
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
96
|
+
}),
|
|
97
|
+
style: {
|
|
98
|
+
"--color-bg": indicatorColor,
|
|
99
|
+
"--color-border": indicatorColor
|
|
100
|
+
}
|
|
101
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
103
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
104
|
+
className: "grid gap-1.5",
|
|
105
|
+
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "text-muted-foreground",
|
|
107
|
+
children: itemConfig?.label ?? item.name
|
|
108
|
+
})]
|
|
109
|
+
}), item.value != null && /* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
111
|
+
children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value)
|
|
112
|
+
})]
|
|
113
|
+
})] })
|
|
114
|
+
}, index);
|
|
115
|
+
})
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
120
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }) {
|
|
121
|
+
const { config } = useChart();
|
|
122
|
+
if (!payload?.length) return null;
|
|
123
|
+
return /* @__PURE__ */ jsx("div", {
|
|
124
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
125
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
126
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.dataKey ?? "value"}`);
|
|
127
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
128
|
+
className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
129
|
+
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
131
|
+
style: { backgroundColor: item.color }
|
|
132
|
+
}), itemConfig?.label]
|
|
133
|
+
}, index);
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
138
|
+
if (typeof payload !== "object" || payload === null) return;
|
|
139
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
140
|
+
let configLabelKey = key;
|
|
141
|
+
if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
|
|
142
|
+
else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
|
|
143
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Checkbox } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/checkbox.d.ts
|
|
6
|
+
declare function Checkbox$1({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof Checkbox.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Checkbox$1 as Checkbox };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { CheckIcon } from "lucide-react";
|
|
4
|
+
import { Checkbox } from "radix-ui";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/checkbox.tsx
|
|
8
|
+
function Checkbox$1({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
10
|
+
"data-slot": "checkbox",
|
|
11
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
12
|
+
...props,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
14
|
+
"data-slot": "checkbox-indicator",
|
|
15
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
16
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Checkbox$1 as Checkbox };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Collapsible } from "radix-ui";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/collapsible.d.ts
|
|
5
|
+
declare function Collapsible$1({
|
|
6
|
+
...props
|
|
7
|
+
}: React.ComponentProps<typeof Collapsible.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
+
declare function CollapsibleTrigger({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof Collapsible.CollapsibleTrigger>): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function CollapsibleContent({
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof Collapsible.CollapsibleContent>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Collapsible } from "radix-ui";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/collapsible.tsx
|
|
5
|
+
function Collapsible$1({ ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
7
|
+
"data-slot": "collapsible",
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function CollapsibleTrigger({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Collapsible.CollapsibleTrigger, {
|
|
13
|
+
"data-slot": "collapsible-trigger",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function CollapsibleContent({ ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Collapsible.CollapsibleContent, {
|
|
19
|
+
"data-slot": "collapsible-content",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Combobox } from "@base-ui/react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/combobox.d.ts
|
|
6
|
+
declare const Combobox$1: typeof Combobox.Root;
|
|
7
|
+
declare function ComboboxValue({
|
|
8
|
+
...props
|
|
9
|
+
}: Combobox.Value.Props): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
declare function ComboboxTrigger({
|
|
11
|
+
className,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}: Combobox.Trigger.Props): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function ComboboxInput({
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
disabled,
|
|
19
|
+
showTrigger,
|
|
20
|
+
showClear,
|
|
21
|
+
...props
|
|
22
|
+
}: Combobox.Input.Props & {
|
|
23
|
+
showTrigger?: boolean;
|
|
24
|
+
showClear?: boolean;
|
|
25
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function ComboboxContent({
|
|
27
|
+
className,
|
|
28
|
+
side,
|
|
29
|
+
sideOffset,
|
|
30
|
+
align,
|
|
31
|
+
alignOffset,
|
|
32
|
+
anchor,
|
|
33
|
+
...props
|
|
34
|
+
}: Combobox.Popup.Props & Pick<Combobox.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>): _$react_jsx_runtime0.JSX.Element;
|
|
35
|
+
declare function ComboboxList({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: Combobox.List.Props): _$react_jsx_runtime0.JSX.Element;
|
|
39
|
+
declare function ComboboxItem({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}: Combobox.Item.Props): _$react_jsx_runtime0.JSX.Element;
|
|
44
|
+
declare function ComboboxGroup({
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}: Combobox.Group.Props): _$react_jsx_runtime0.JSX.Element;
|
|
48
|
+
declare function ComboboxLabel({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: Combobox.GroupLabel.Props): _$react_jsx_runtime0.JSX.Element;
|
|
52
|
+
declare function ComboboxCollection({
|
|
53
|
+
...props
|
|
54
|
+
}: Combobox.Collection.Props): _$react_jsx_runtime0.JSX.Element;
|
|
55
|
+
declare function ComboboxEmpty({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: Combobox.Empty.Props): _$react_jsx_runtime0.JSX.Element;
|
|
59
|
+
declare function ComboboxSeparator({
|
|
60
|
+
className,
|
|
61
|
+
...props
|
|
62
|
+
}: Combobox.Separator.Props): _$react_jsx_runtime0.JSX.Element;
|
|
63
|
+
declare function ComboboxChips({
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentPropsWithRef<typeof Combobox.Chips> & Combobox.Chips.Props): _$react_jsx_runtime0.JSX.Element;
|
|
67
|
+
declare function ComboboxChip({
|
|
68
|
+
className,
|
|
69
|
+
children,
|
|
70
|
+
showRemove,
|
|
71
|
+
...props
|
|
72
|
+
}: Combobox.Chip.Props & {
|
|
73
|
+
showRemove?: boolean;
|
|
74
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
75
|
+
declare function ComboboxChipsInput({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}: Combobox.Input.Props): _$react_jsx_runtime0.JSX.Element;
|
|
79
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
80
|
+
//#endregion
|
|
81
|
+
export { Combobox$1 as Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Button } from "./button.mjs";
|
|
4
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.mjs";
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Combobox } from "@base-ui/react";
|
|
9
|
+
//#region src/components/combobox.tsx
|
|
10
|
+
const Combobox$1 = Combobox.Root;
|
|
11
|
+
function ComboboxValue({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Combobox.Value, {
|
|
13
|
+
"data-slot": "combobox-value",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function ComboboxTrigger({ className, children, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
19
|
+
"data-slot": "combobox-trigger",
|
|
20
|
+
className: cn("[&_svg:not([class*='size-'])]:size-4", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function ComboboxClear({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Combobox.Clear, {
|
|
27
|
+
"data-slot": "combobox-clear",
|
|
28
|
+
render: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
size: "icon-xs"
|
|
31
|
+
}),
|
|
32
|
+
className: cn(className),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
39
|
+
className: cn("w-auto", className),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Combobox.Input, {
|
|
42
|
+
render: /* @__PURE__ */ jsx(InputGroupInput, { disabled }),
|
|
43
|
+
...props
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, {
|
|
46
|
+
align: "inline-end",
|
|
47
|
+
children: [showTrigger && /* @__PURE__ */ jsx(InputGroupButton, {
|
|
48
|
+
size: "icon-xs",
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
asChild: true,
|
|
51
|
+
"data-slot": "input-group-button",
|
|
52
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
53
|
+
disabled,
|
|
54
|
+
children: /* @__PURE__ */ jsx(ComboboxTrigger, {})
|
|
55
|
+
}), showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled })]
|
|
56
|
+
}),
|
|
57
|
+
children
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
63
|
+
side,
|
|
64
|
+
sideOffset,
|
|
65
|
+
align,
|
|
66
|
+
alignOffset,
|
|
67
|
+
anchor,
|
|
68
|
+
className: "isolate z-50",
|
|
69
|
+
children: /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
70
|
+
"data-slot": "combobox-content",
|
|
71
|
+
"data-chips": !!anchor,
|
|
72
|
+
className: cn("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
73
|
+
...props
|
|
74
|
+
})
|
|
75
|
+
}) });
|
|
76
|
+
}
|
|
77
|
+
function ComboboxList({ className, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
79
|
+
"data-slot": "combobox-list",
|
|
80
|
+
className: cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function ComboboxItem({ className, children, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
86
|
+
"data-slot": "combobox-item",
|
|
87
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
88
|
+
...props,
|
|
89
|
+
children: [children, /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
90
|
+
render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
91
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function ComboboxGroup({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(Combobox.Group, {
|
|
97
|
+
"data-slot": "combobox-group",
|
|
98
|
+
className: cn(className),
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function ComboboxLabel({ className, ...props }) {
|
|
103
|
+
return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
104
|
+
"data-slot": "combobox-label",
|
|
105
|
+
className: cn("px-2 py-1.5 text-xs text-muted-foreground", className),
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function ComboboxCollection({ ...props }) {
|
|
110
|
+
return /* @__PURE__ */ jsx(Combobox.Collection, {
|
|
111
|
+
"data-slot": "combobox-collection",
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
117
|
+
"data-slot": "combobox-empty",
|
|
118
|
+
className: cn("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className),
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx(Combobox.Separator, {
|
|
124
|
+
"data-slot": "combobox-separator",
|
|
125
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
126
|
+
...props
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function ComboboxChips({ className, ...props }) {
|
|
130
|
+
return /* @__PURE__ */ jsx(Combobox.Chips, {
|
|
131
|
+
"data-slot": "combobox-chips",
|
|
132
|
+
className: cn("flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", className),
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
137
|
+
return /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
138
|
+
"data-slot": "combobox-chip",
|
|
139
|
+
className: cn("flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", className),
|
|
140
|
+
...props,
|
|
141
|
+
children: [children, showRemove && /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
142
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
size: "icon-xs"
|
|
145
|
+
}),
|
|
146
|
+
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
147
|
+
"data-slot": "combobox-chip-remove",
|
|
148
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function ComboboxChipsInput({ className, ...props }) {
|
|
153
|
+
return /* @__PURE__ */ jsx(Combobox.Input, {
|
|
154
|
+
"data-slot": "combobox-chip-input",
|
|
155
|
+
className: cn("min-w-16 flex-1 outline-none", className),
|
|
156
|
+
...props
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function useComboboxAnchor() {
|
|
160
|
+
return React.useRef(null);
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { Combobox$1 as Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Dialog } from "./dialog.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { Command } from "cmdk";
|
|
5
|
+
|
|
6
|
+
//#region src/components/command.d.ts
|
|
7
|
+
declare function Command$1({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof Command>): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function CommandDialog({
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
showCloseButton,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function CommandInput({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof Command.Input>): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
declare function CommandList({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof Command.List>): _$react_jsx_runtime0.JSX.Element;
|
|
32
|
+
declare function CommandEmpty({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof Command.Empty>): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
+
declare function CommandGroup({
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof Command.Group>): _$react_jsx_runtime0.JSX.Element;
|
|
40
|
+
declare function CommandSeparator({
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<typeof Command.Separator>): _$react_jsx_runtime0.JSX.Element;
|
|
44
|
+
declare function CommandItem({
|
|
45
|
+
className,
|
|
46
|
+
children,
|
|
47
|
+
...props
|
|
48
|
+
}: React.ComponentProps<typeof Command.Item>): _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
declare function CommandShortcut({
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<'span'>): _$react_jsx_runtime0.JSX.Element;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { Command$1 as Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|