@suryapamenang/ui 0.1.0
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/README.md +81 -0
- package/dist/components/basic-blocks-base-kit.d.ts +6 -0
- package/dist/components/basic-blocks-base-kit.d.ts.map +1 -0
- package/dist/components/basic-blocks-base-kit.js +17 -0
- package/dist/components/basic-blocks-kit.d.ts +6 -0
- package/dist/components/basic-blocks-kit.d.ts.map +1 -0
- package/dist/components/basic-blocks-kit.js +68 -0
- package/dist/components/basic-marks-base-kit.d.ts +20 -0
- package/dist/components/basic-marks-base-kit.d.ts.map +1 -0
- package/dist/components/basic-marks-base-kit.js +15 -0
- package/dist/components/basic-marks-kit.d.ts +20 -0
- package/dist/components/basic-marks-kit.d.ts.map +1 -0
- package/dist/components/basic-marks-kit.js +27 -0
- package/dist/components/basic-nodes-kit.d.ts +24 -0
- package/dist/components/basic-nodes-kit.d.ts.map +1 -0
- package/dist/components/basic-nodes-kit.js +3 -0
- package/dist/components/file-upload.d.ts +15 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +29 -0
- package/dist/components/multi-step-viewer.d.ts +23 -0
- package/dist/components/multi-step-viewer.d.ts.map +1 -0
- package/dist/components/multi-step-viewer.js +73 -0
- package/dist/components/plate-editor.d.ts +2 -0
- package/dist/components/plate-editor.d.ts.map +1 -0
- package/dist/components/plate-editor.js +44 -0
- package/dist/hooks/use-file-upload.d.ts +46 -0
- package/dist/hooks/use-file-upload.d.ts.map +1 -0
- package/dist/hooks/use-file-upload.js +228 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/hooks/use-multi-step-viewer.d.ts +30 -0
- package/dist/hooks/use-multi-step-viewer.d.ts.map +1 -0
- package/dist/hooks/use-multi-step-viewer.js +72 -0
- package/dist/index.css +3645 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/primitives/accordion.d.ts +8 -0
- package/dist/primitives/accordion.d.ts.map +1 -0
- package/dist/primitives/accordion.js +17 -0
- package/dist/primitives/alert-dialog.d.ts +15 -0
- package/dist/primitives/alert-dialog.d.ts.map +1 -0
- package/dist/primitives/alert-dialog.js +38 -0
- package/dist/primitives/avatar.d.ts +7 -0
- package/dist/primitives/avatar.d.ts.map +1 -0
- package/dist/primitives/avatar.js +13 -0
- package/dist/primitives/badge.d.ts +10 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +22 -0
- package/dist/primitives/blockquote-node-static.d.ts +3 -0
- package/dist/primitives/blockquote-node-static.d.ts.map +1 -0
- package/dist/primitives/blockquote-node-static.js +5 -0
- package/dist/primitives/blockquote-node.d.ts +3 -0
- package/dist/primitives/blockquote-node.d.ts.map +1 -0
- package/dist/primitives/blockquote-node.js +5 -0
- package/dist/primitives/breadcrumb.d.ts +14 -0
- package/dist/primitives/breadcrumb.d.ts.map +1 -0
- package/dist/primitives/breadcrumb.js +29 -0
- package/dist/primitives/button.d.ts +11 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +33 -0
- package/dist/primitives/calendar.d.ts +9 -0
- package/dist/primitives/calendar.d.ts.map +1 -0
- package/dist/primitives/calendar.js +73 -0
- package/dist/primitives/card.d.ts +10 -0
- package/dist/primitives/card.d.ts.map +1 -0
- package/dist/primitives/card.js +24 -0
- package/dist/primitives/chart.d.ts +42 -0
- package/dist/primitives/chart.d.ts.map +1 -0
- package/dist/primitives/chart.js +132 -0
- package/dist/primitives/checkbox.d.ts +5 -0
- package/dist/primitives/checkbox.d.ts.map +1 -0
- package/dist/primitives/checkbox.js +8 -0
- package/dist/primitives/code-node-static.d.ts +3 -0
- package/dist/primitives/code-node-static.d.ts.map +1 -0
- package/dist/primitives/code-node-static.js +5 -0
- package/dist/primitives/code-node.d.ts +3 -0
- package/dist/primitives/code-node.d.ts.map +1 -0
- package/dist/primitives/code-node.js +5 -0
- package/dist/primitives/command.d.ts +19 -0
- package/dist/primitives/command.d.ts.map +1 -0
- package/dist/primitives/command.js +33 -0
- package/dist/primitives/datepicker.d.ts +8 -0
- package/dist/primitives/datepicker.d.ts.map +1 -0
- package/dist/primitives/datepicker.js +42 -0
- package/dist/primitives/datepicker2.d.ts +8 -0
- package/dist/primitives/datepicker2.d.ts.map +1 -0
- package/dist/primitives/datepicker2.js +13 -0
- package/dist/primitives/dialog.d.ts +16 -0
- package/dist/primitives/dialog.d.ts.map +1 -0
- package/dist/primitives/dialog.js +35 -0
- package/dist/primitives/drawer.d.ts +14 -0
- package/dist/primitives/drawer.d.ts.map +1 -0
- package/dist/primitives/drawer.js +34 -0
- package/dist/primitives/dropdown-menu.d.ts +26 -0
- package/dist/primitives/dropdown-menu.d.ts.map +1 -0
- package/dist/primitives/dropdown-menu.js +50 -0
- package/dist/primitives/dropzone.d.ts +12 -0
- package/dist/primitives/dropzone.d.ts.map +1 -0
- package/dist/primitives/dropzone.js +7 -0
- package/dist/primitives/editor-static.d.ts +9 -0
- package/dist/primitives/editor-static.d.ts.map +1 -0
- package/dist/primitives/editor-static.js +29 -0
- package/dist/primitives/editor.d.ts +29 -0
- package/dist/primitives/editor.d.ts.map +1 -0
- package/dist/primitives/editor.js +56 -0
- package/dist/primitives/field.d.ts +27 -0
- package/dist/primitives/field.d.ts.map +1 -0
- package/dist/primitives/field.js +77 -0
- package/dist/primitives/fixed-toolbar.d.ts +3 -0
- package/dist/primitives/fixed-toolbar.d.ts.map +1 -0
- package/dist/primitives/fixed-toolbar.js +6 -0
- package/dist/primitives/form.d.ts +24 -0
- package/dist/primitives/form.d.ts.map +1 -0
- package/dist/primitives/form.js +58 -0
- package/dist/primitives/heading-node-static.d.ts +15 -0
- package/dist/primitives/heading-node-static.d.ts.map +1 -0
- package/dist/primitives/heading-node-static.js +37 -0
- package/dist/primitives/heading-node.d.ts +15 -0
- package/dist/primitives/heading-node.d.ts.map +1 -0
- package/dist/primitives/heading-node.js +37 -0
- package/dist/primitives/highlight-node-static.d.ts +3 -0
- package/dist/primitives/highlight-node-static.d.ts.map +1 -0
- package/dist/primitives/highlight-node-static.js +5 -0
- package/dist/primitives/highlight-node.d.ts +3 -0
- package/dist/primitives/highlight-node.d.ts.map +1 -0
- package/dist/primitives/highlight-node.js +5 -0
- package/dist/primitives/hr-node-static.d.ts +3 -0
- package/dist/primitives/hr-node-static.d.ts.map +1 -0
- package/dist/primitives/hr-node-static.js +6 -0
- package/dist/primitives/hr-node.d.ts +3 -0
- package/dist/primitives/hr-node.d.ts.map +1 -0
- package/dist/primitives/hr-node.js +9 -0
- package/dist/primitives/input.d.ts +4 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +6 -0
- package/dist/primitives/kbd-node-static.d.ts +3 -0
- package/dist/primitives/kbd-node-static.d.ts.map +1 -0
- package/dist/primitives/kbd-node-static.js +5 -0
- package/dist/primitives/kbd-node.d.ts +3 -0
- package/dist/primitives/kbd-node.d.ts.map +1 -0
- package/dist/primitives/kbd-node.js +5 -0
- package/dist/primitives/kbd.d.ts +4 -0
- package/dist/primitives/kbd.d.ts.map +1 -0
- package/dist/primitives/kbd.js +9 -0
- package/dist/primitives/label.d.ts +5 -0
- package/dist/primitives/label.d.ts.map +1 -0
- package/dist/primitives/label.js +7 -0
- package/dist/primitives/mark-toolbar-button.d.ts +7 -0
- package/dist/primitives/mark-toolbar-button.d.ts.map +1 -0
- package/dist/primitives/mark-toolbar-button.js +8 -0
- package/dist/primitives/pagination.d.ts +14 -0
- package/dist/primitives/pagination.d.ts.map +1 -0
- package/dist/primitives/pagination.js +29 -0
- package/dist/primitives/paragraph-node-static.d.ts +3 -0
- package/dist/primitives/paragraph-node-static.d.ts.map +1 -0
- package/dist/primitives/paragraph-node-static.js +6 -0
- package/dist/primitives/paragraph-node.d.ts +3 -0
- package/dist/primitives/paragraph-node.d.ts.map +1 -0
- package/dist/primitives/paragraph-node.js +6 -0
- package/dist/primitives/popover.d.ts +8 -0
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/primitives/popover.js +16 -0
- package/dist/primitives/progress.d.ts +5 -0
- package/dist/primitives/progress.d.ts.map +1 -0
- package/dist/primitives/progress.js +7 -0
- package/dist/primitives/radio-group.d.ts +6 -0
- package/dist/primitives/radio-group.d.ts.map +1 -0
- package/dist/primitives/radio-group.js +11 -0
- package/dist/primitives/scroll-area.d.ts +6 -0
- package/dist/primitives/scroll-area.d.ts.map +1 -0
- package/dist/primitives/scroll-area.js +12 -0
- package/dist/primitives/select.d.ts +16 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +37 -0
- package/dist/primitives/separator.d.ts +5 -0
- package/dist/primitives/separator.d.ts.map +1 -0
- package/dist/primitives/separator.js +7 -0
- package/dist/primitives/sheet.d.ts +14 -0
- package/dist/primitives/sheet.d.ts.map +1 -0
- package/dist/primitives/sheet.js +39 -0
- package/dist/primitives/sidebar.d.ts +71 -0
- package/dist/primitives/sidebar.d.ts.map +1 -0
- package/dist/primitives/sidebar.js +212 -0
- package/dist/primitives/skeleton.d.ts +3 -0
- package/dist/primitives/skeleton.d.ts.map +1 -0
- package/dist/primitives/skeleton.js +6 -0
- package/dist/primitives/sonner.d.ts +4 -0
- package/dist/primitives/sonner.d.ts.map +1 -0
- package/dist/primitives/sonner.js +20 -0
- package/dist/primitives/spinner.d.ts +3 -0
- package/dist/primitives/spinner.d.ts.map +1 -0
- package/dist/primitives/spinner.js +7 -0
- package/dist/primitives/table.d.ts +11 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/table.js +27 -0
- package/dist/primitives/tabs.d.ts +8 -0
- package/dist/primitives/tabs.d.ts.map +1 -0
- package/dist/primitives/tabs.js +16 -0
- package/dist/primitives/textarea.d.ts +4 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +6 -0
- package/dist/primitives/toggle-group.d.ts +10 -0
- package/dist/primitives/toggle-group.d.ts.map +1 -0
- package/dist/primitives/toggle-group.js +21 -0
- package/dist/primitives/toggle.d.ts +10 -0
- package/dist/primitives/toggle.d.ts.map +1 -0
- package/dist/primitives/toggle.js +25 -0
- package/dist/primitives/toolbar.d.ts +43 -0
- package/dist/primitives/toolbar.d.ts.map +1 -0
- package/dist/primitives/toolbar.js +110 -0
- package/dist/primitives/tooltip.d.ts +8 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip.js +16 -0
- package/package.json +88 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/** biome-ignore-all lint/security/noDangerouslySetInnerHtml: native shadcn component */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as RechartsPrimitive from "recharts";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
+
const THEMES = { light: "", dark: ".dark" };
|
|
8
|
+
const ChartContext = React.createContext(null);
|
|
9
|
+
function useChart() {
|
|
10
|
+
const context = React.useContext(ChartContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function ChartContainer({ id, className, children, config, ...props }) {
|
|
17
|
+
const uniqueId = React.useId();
|
|
18
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
19
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.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-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 flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
|
+
}
|
|
21
|
+
const ChartStyle = ({ id, config }) => {
|
|
22
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
23
|
+
if (!colorConfig.length) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
27
|
+
__html: Object.entries(THEMES)
|
|
28
|
+
.map(([theme, prefix]) => `
|
|
29
|
+
${prefix} [data-chart=${id}] {
|
|
30
|
+
${colorConfig
|
|
31
|
+
.map(([key, itemConfig]) => {
|
|
32
|
+
const color = itemConfig.theme?.[theme] ||
|
|
33
|
+
itemConfig.color;
|
|
34
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
35
|
+
})
|
|
36
|
+
.join("\n")}
|
|
37
|
+
}
|
|
38
|
+
`)
|
|
39
|
+
.join("\n"),
|
|
40
|
+
} }));
|
|
41
|
+
};
|
|
42
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
43
|
+
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
|
44
|
+
const { config } = useChart();
|
|
45
|
+
const tooltipLabel = React.useMemo(() => {
|
|
46
|
+
if (hideLabel || !payload?.length) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const [item] = payload;
|
|
50
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
51
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
52
|
+
const value = !labelKey && typeof label === "string"
|
|
53
|
+
? config[label]?.label || label
|
|
54
|
+
: itemConfig?.label;
|
|
55
|
+
if (labelFormatter) {
|
|
56
|
+
return (_jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) }));
|
|
57
|
+
}
|
|
58
|
+
if (!value) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
|
|
62
|
+
}, [
|
|
63
|
+
label,
|
|
64
|
+
labelFormatter,
|
|
65
|
+
payload,
|
|
66
|
+
hideLabel,
|
|
67
|
+
labelClassName,
|
|
68
|
+
config,
|
|
69
|
+
labelKey,
|
|
70
|
+
]);
|
|
71
|
+
if (!active || !payload?.length) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
75
|
+
return (_jsxs("div", { className: cn("border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
|
|
76
|
+
.filter((item) => item.type !== "none")
|
|
77
|
+
.map((item, index) => {
|
|
78
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
79
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
80
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
81
|
+
return (_jsx("div", { className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
82
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
83
|
+
"w-1": indicator === "line",
|
|
84
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
85
|
+
"my-0.5": nestLabel && indicator === "dashed",
|
|
86
|
+
}), style: {
|
|
87
|
+
"--color-bg": indicatorColor,
|
|
88
|
+
"--color-border": indicatorColor,
|
|
89
|
+
} }))), _jsxs("div", { className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })] }), item.value && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
90
|
+
}) })] }));
|
|
91
|
+
}
|
|
92
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
93
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
|
|
94
|
+
const { config } = useChart();
|
|
95
|
+
if (!payload?.length) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return (_jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload
|
|
99
|
+
.filter((item) => item.type !== "none")
|
|
100
|
+
.map((item) => {
|
|
101
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
102
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
103
|
+
return (_jsxs("div", { className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
104
|
+
backgroundColor: item.color,
|
|
105
|
+
} })), itemConfig?.label] }, item.value));
|
|
106
|
+
}) }));
|
|
107
|
+
}
|
|
108
|
+
// Helper to extract item config from a payload.
|
|
109
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
110
|
+
if (typeof payload !== "object" || payload === null) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const payloadPayload = "payload" in payload &&
|
|
114
|
+
typeof payload.payload === "object" &&
|
|
115
|
+
payload.payload !== null
|
|
116
|
+
? payload.payload
|
|
117
|
+
: undefined;
|
|
118
|
+
let configLabelKey = key;
|
|
119
|
+
if (key in payload &&
|
|
120
|
+
typeof payload[key] === "string") {
|
|
121
|
+
configLabelKey = payload[key];
|
|
122
|
+
}
|
|
123
|
+
else if (payloadPayload &&
|
|
124
|
+
key in payloadPayload &&
|
|
125
|
+
typeof payloadPayload[key] === "string") {
|
|
126
|
+
configLabelKey = payloadPayload[key];
|
|
127
|
+
}
|
|
128
|
+
return configLabelKey in config
|
|
129
|
+
? config[configLabelKey]
|
|
130
|
+
: config[key];
|
|
131
|
+
}
|
|
132
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export { Checkbox };
|
|
5
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/primitives/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,qBAkBrD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon } from "lucide-react";
|
|
3
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Checkbox({ className, ...props }) {
|
|
6
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current transition-none", children: _jsx(CheckIcon, { className: "size-3.5" }) }) }));
|
|
7
|
+
}
|
|
8
|
+
export { Checkbox };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-node-static.d.ts","sourceRoot":"","sources":["../../src/primitives/code-node-static.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,+BAUnD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SlateLeaf } from "platejs/static";
|
|
3
|
+
export function CodeLeafStatic(props) {
|
|
4
|
+
return (_jsx(SlateLeaf, { ...props, as: "code", className: "rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm whitespace-pre-wrap", children: props.children }));
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-node.d.ts","sourceRoot":"","sources":["../../src/primitives/code-node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,+BAU7C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PlateLeaf } from "platejs/react";
|
|
3
|
+
export function CodeLeaf(props) {
|
|
4
|
+
return (_jsx(PlateLeaf, { ...props, as: "code", className: "rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm whitespace-pre-wrap", children: props.children }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import { Dialog } from "../primitives/dialog";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
19
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/primitives/command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,EACL,MAAM,EAKP,MAAM,sBAAsB,CAAC;AAE9B,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,qBAW/C;AAED,iBAAS,aAAa,CAAC,EACrB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,qBAiBA;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAiBrD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAWpD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAQrD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAWrD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,qBAQzD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAWpD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { SearchIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "../primitives/dialog";
|
|
6
|
+
function Command({ className, ...props }) {
|
|
7
|
+
return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
|
10
|
+
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
11
|
+
}
|
|
12
|
+
function CommandInput({ className, ...props }) {
|
|
13
|
+
return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] }));
|
|
14
|
+
}
|
|
15
|
+
function CommandList({ className, ...props }) {
|
|
16
|
+
return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function CommandEmpty({ ...props }) {
|
|
19
|
+
return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
|
|
20
|
+
}
|
|
21
|
+
function CommandGroup({ className, ...props }) {
|
|
22
|
+
return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function CommandSeparator({ className, ...props }) {
|
|
25
|
+
return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("bg-border -mx-1 h-px", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
function CommandItem({ className, ...props }) {
|
|
28
|
+
return (_jsx(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function CommandShortcut({ className, ...props }) {
|
|
31
|
+
return (_jsx("span", { "data-slot": "command-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type DatePickerProps = {
|
|
3
|
+
value?: Date;
|
|
4
|
+
onChange?: (date: Date | undefined) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function DatePicker({ value, onChange }: DatePickerProps): React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=datepicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker.d.ts","sourceRoot":"","sources":["../../src/primitives/datepicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,eAAe,qBAyD9D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CalendarIcon } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
import { Calendar } from "./calendar";
|
|
6
|
+
import { Input } from "./input";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
8
|
+
function formatDate(date) {
|
|
9
|
+
if (!date) {
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
return date.toLocaleDateString("en-US", {
|
|
13
|
+
day: "2-digit",
|
|
14
|
+
month: "long",
|
|
15
|
+
year: "numeric",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function isValidDate(date) {
|
|
19
|
+
if (!date) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return !Number.isNaN(date.getTime());
|
|
23
|
+
}
|
|
24
|
+
export function DatePicker({ value, onChange }) {
|
|
25
|
+
const [open, setOpen] = React.useState(false);
|
|
26
|
+
const [month, setMonth] = React.useState(value);
|
|
27
|
+
return (_jsxs("div", { className: "relative mt-1 flex", children: [_jsx(Input, { id: "date", value: value ? formatDate(value) : "", placeholder: "June 01, 2025", className: "bg-background pr-10", onChange: (e) => {
|
|
28
|
+
const date = new Date(e.target.value);
|
|
29
|
+
if (isValidDate(date)) {
|
|
30
|
+
onChange?.(date);
|
|
31
|
+
setMonth(date);
|
|
32
|
+
}
|
|
33
|
+
}, onKeyDown: (e) => {
|
|
34
|
+
if (e.key === "ArrowDown") {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
setOpen(true);
|
|
37
|
+
}
|
|
38
|
+
} }), _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { id: "date-picker", variant: "ghost", className: "absolute top-1/2 right-2 size-6 -translate-y-1/2", children: [_jsx(CalendarIcon, { className: "size-3.5" }), _jsx("span", { className: "sr-only", children: "Select date" })] }) }), _jsx(PopoverContent, { className: "w-auto overflow-hidden p-0", align: "end", alignOffset: -8, sideOffset: 10, children: _jsx(Calendar, { mode: "single", selected: value, captionLayout: "dropdown", month: month, onMonthChange: setMonth, onSelect: (date) => {
|
|
39
|
+
onChange?.(date);
|
|
40
|
+
setOpen(false);
|
|
41
|
+
} }) })] })] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type DatePicker2Props = {
|
|
3
|
+
value?: Date;
|
|
4
|
+
onChange?: (date: Date | undefined) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function DatePicker2({ value, onChange }: DatePicker2Props): React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=datepicker2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datepicker2.d.ts","sourceRoot":"","sources":["../../src/primitives/datepicker2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gBAAgB,qBA8BhE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
import { Calendar } from "./calendar";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
7
|
+
export function DatePicker2({ value, onChange }) {
|
|
8
|
+
const [open, setOpen] = React.useState(false);
|
|
9
|
+
return (_jsx("div", { className: "mt-1 flex flex-col gap-3", children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", id: "date", className: "w-48 justify-between font-normal", children: [value ? value.toLocaleDateString() : "Select date", _jsx(ChevronDownIcon, {})] }) }), _jsx(PopoverContent, { className: "w-auto overflow-hidden p-0", align: "start", children: _jsx(Calendar, { mode: "single", selected: value, captionLayout: "dropdown", onSelect: (date) => {
|
|
10
|
+
onChange?.(date);
|
|
11
|
+
setOpen(false);
|
|
12
|
+
} }) })] }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
16
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/primitives/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,qBAyBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { XIcon } from "lucide-react";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Dialog({ ...props }) {
|
|
6
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DialogTrigger({ ...props }) {
|
|
9
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DialogPortal({ ...props }) {
|
|
12
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DialogClose({ ...props }) {
|
|
15
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DialogOverlay({ className, ...props }) {
|
|
18
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
21
|
+
return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
22
|
+
}
|
|
23
|
+
function DialogHeader({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function DialogFooter({ className, ...props }) {
|
|
27
|
+
return (_jsx("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DialogTitle({ className, ...props }) {
|
|
30
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function DialogDescription({ className, ...props }) {
|
|
33
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-muted-foreground text-sm", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
|
|
9
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
|
|
12
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
|
|
13
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
14
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/primitives/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AAIjD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAqBtD;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
function Drawer({ ...props }) {
|
|
5
|
+
return _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
|
|
6
|
+
}
|
|
7
|
+
function DrawerTrigger({ ...props }) {
|
|
8
|
+
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
9
|
+
}
|
|
10
|
+
function DrawerPortal({ ...props }) {
|
|
11
|
+
return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
12
|
+
}
|
|
13
|
+
function DrawerClose({ ...props }) {
|
|
14
|
+
return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
15
|
+
}
|
|
16
|
+
function DrawerOverlay({ className, ...props }) {
|
|
17
|
+
return (_jsx(DrawerPrimitive.Overlay, { "data-slot": "drawer-overlay", className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function DrawerContent({ className, children, ...props }) {
|
|
20
|
+
return (_jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className), ...props, children: [_jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children] })] }));
|
|
21
|
+
}
|
|
22
|
+
function DrawerHeader({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { "data-slot": "drawer-header", className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function DrawerFooter({ className, ...props }) {
|
|
26
|
+
return (_jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function DrawerTitle({ className, ...props }) {
|
|
29
|
+
return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("text-foreground font-semibold", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function DrawerDescription({ className, ...props }) {
|
|
32
|
+
return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-muted-foreground text-sm", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
26
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/primitives/dropdown-menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAEzD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,qBAI3D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAO5D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAc5D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,qBAI1D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC,qBAaA;AAED,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,YAAY,CAAC,qBAmBjE;AAED,iBAAS,sBAAsB,CAAC,EAC9B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAO/D;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,qBAkB9D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,qBAYA;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,qBAQ9D;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,iBAAS,eAAe,CAAC,EACvB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,qBAExD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,qBAeA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAW/D;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
3
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function DropdownMenu({ ...props }) {
|
|
6
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DropdownMenuPortal({ ...props }) {
|
|
9
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props }));
|
|
10
|
+
}
|
|
11
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
12
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
15
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className), ...props }) }));
|
|
16
|
+
}
|
|
17
|
+
function DropdownMenuGroup({ ...props }) {
|
|
18
|
+
return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
21
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
24
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
27
|
+
return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
30
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
31
|
+
}
|
|
32
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
33
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
36
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
39
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuSub({ ...props }) {
|
|
42
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
43
|
+
}
|
|
44
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
45
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
46
|
+
}
|
|
47
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
48
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { RefObject } from "react";
|
|
3
|
+
interface FileDropzoneProps {
|
|
4
|
+
fileInputRef: RefObject<HTMLInputElement | null>;
|
|
5
|
+
handleBoxClick: () => void;
|
|
6
|
+
handleDragOver: (e: React.DragEvent) => void;
|
|
7
|
+
handleDrop: (e: React.DragEvent) => void;
|
|
8
|
+
handleFileSelect: (files: FileList | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function FileDropzone({ fileInputRef, handleBoxClick, handleDragOver, handleDrop, handleFileSelect, }: FileDropzoneProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=dropzone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropzone.d.ts","sourceRoot":"","sources":["../../src/primitives/dropzone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,iBAAiB;IACzB,YAAY,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACjD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACzC,gBAAgB,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,GACjB,EAAE,iBAAiB,qBAqCnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** biome-ignore-all lint/a11y/noStaticElementInteractions: 3rd party copy paste component */
|
|
3
|
+
/** biome-ignore-all lint/a11y/useKeyWithClickEvents: 3rd party copy paste compoennt */
|
|
4
|
+
import { Upload } from "lucide-react";
|
|
5
|
+
export function FileDropzone({ fileInputRef, handleBoxClick, handleDragOver, handleDrop, handleFileSelect, }) {
|
|
6
|
+
return (_jsx("div", { className: "px-6", children: _jsxs("div", { className: "border-border flex cursor-pointer flex-col items-center justify-center rounded-md border-2 border-dashed p-8 text-center", onClick: handleBoxClick, onDragOver: handleDragOver, onDrop: handleDrop, children: [_jsx("div", { className: "bg-muted mb-2 rounded-full p-3", children: _jsx(Upload, { className: "text-muted-foreground h-5 w-5" }) }), _jsx("p", { className: "text-foreground text-sm font-medium", children: "Upload a project image" }), _jsxs("p", { className: "text-muted-foreground mt-1 text-sm", children: ["or,", " ", _jsx("label", { htmlFor: "fileUpload", className: "cursor-pointer font-medium text-primary hover:text-primary/90", onClick: (e) => e.stopPropagation(), children: "click to browse" }), " ", "(4MB max)"] }), _jsx("input", { type: "file", id: "fileUpload", ref: fileInputRef, className: "hidden", accept: "image/*", onChange: (e) => handleFileSelect(e.target.files) })] }) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type PlateStaticProps } from "platejs/static";
|
|
3
|
+
export declare const editorVariants: (props?: ({
|
|
4
|
+
disabled?: boolean | null | undefined;
|
|
5
|
+
focused?: boolean | null | undefined;
|
|
6
|
+
variant?: "select" | "default" | "none" | "demo" | "ai" | "aiChat" | "fullWidth" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare function EditorStatic({ className, variant, ...props }: PlateStaticProps & VariantProps<typeof editorVariants>): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=editor-static.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-static.d.ts","sourceRoot":"","sources":["../../src/primitives/editor-static.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIpE,eAAO,MAAM,cAAc;;;;8EAgC1B,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,+BAOxD"}
|