nextjs-starter-kit 0.1.1
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/.github/PR_REQUEST_TEMPLATE.md +18 -0
- package/.github/workflows/pr_check.yml +38 -0
- package/.husky/pre-commit +1 -0
- package/.prettierignore +7 -0
- package/.prettierrc +9 -0
- package/README.md +165 -0
- package/components.json +21 -0
- package/eslint.config.mjs +42 -0
- package/jsconfig.json +7 -0
- package/lint-staged.config.js +6 -0
- package/next.config.mjs +6 -0
- package/package.json +72 -0
- package/postcss.config.mjs +5 -0
- package/src/animations/loader.js +81 -0
- package/src/app/(routes)/(home)/page.jsx +7 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/layout.js +81 -0
- package/src/app/not-found.jsx +19 -0
- package/src/app/robots.js +10 -0
- package/src/app/sitemap.js +10 -0
- package/src/assets/Logos/index.js +3 -0
- package/src/assets/index.js +5 -0
- package/src/components/ui/accordion.jsx +53 -0
- package/src/components/ui/alert-dialog.jsx +136 -0
- package/src/components/ui/alert.jsx +59 -0
- package/src/components/ui/avatar.jsx +44 -0
- package/src/components/ui/badge.jsx +40 -0
- package/src/components/ui/breadcrumb.jsx +96 -0
- package/src/components/ui/button.jsx +49 -0
- package/src/components/ui/calendar.jsx +221 -0
- package/src/components/ui/card.jsx +92 -0
- package/src/components/ui/carousel.jsx +217 -0
- package/src/components/ui/chart.jsx +332 -0
- package/src/components/ui/checkbox.jsx +29 -0
- package/src/components/ui/collapsible.jsx +27 -0
- package/src/components/ui/command.jsx +156 -0
- package/src/components/ui/container.jsx +18 -0
- package/src/components/ui/dialog.jsx +127 -0
- package/src/components/ui/drawer.jsx +114 -0
- package/src/components/ui/dropdown-menu.jsx +210 -0
- package/src/components/ui/form.jsx +140 -0
- package/src/components/ui/headings.jsx +34 -0
- package/src/components/ui/image.jsx +21 -0
- package/src/components/ui/input-otp.jsx +66 -0
- package/src/components/ui/input.jsx +21 -0
- package/src/components/ui/label.jsx +21 -0
- package/src/components/ui/pagination.jsx +105 -0
- package/src/components/ui/popover.jsx +42 -0
- package/src/components/ui/progress.jsx +27 -0
- package/src/components/ui/select.jsx +157 -0
- package/src/components/ui/separator.jsx +28 -0
- package/src/components/ui/sheet.jsx +117 -0
- package/src/components/ui/skeleton.jsx +13 -0
- package/src/components/ui/slider.jsx +63 -0
- package/src/components/ui/sonner.jsx +23 -0
- package/src/components/ui/switch.jsx +28 -0
- package/src/components/ui/table.jsx +113 -0
- package/src/components/ui/tabs.jsx +54 -0
- package/src/components/ui/textarea.jsx +18 -0
- package/src/components/ui/tooltip.jsx +49 -0
- package/src/lib/axios.js +8 -0
- package/src/lib/queryClient.js +11 -0
- package/src/lib/utils.js +6 -0
- package/src/providers/QueryProvider.jsx +15 -0
- package/src/shared/icons.js +308 -0
- package/src/styles/fonts.js +30 -0
- package/src/styles/globals.css +124 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
8
|
+
const THEMES = {
|
|
9
|
+
light: "",
|
|
10
|
+
dark: ".dark",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const ChartContext = React.createContext(null);
|
|
14
|
+
|
|
15
|
+
function useChart() {
|
|
16
|
+
const context = React.useContext(ChartContext);
|
|
17
|
+
|
|
18
|
+
if (!context) {
|
|
19
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return context;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ChartContainer({ id, className, children, config, ...props }) {
|
|
26
|
+
const uniqueId = React.useId();
|
|
27
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ChartContext.Provider value={{ config }}>
|
|
31
|
+
<div
|
|
32
|
+
data-slot="chart"
|
|
33
|
+
data-chart={chartId}
|
|
34
|
+
className={cn(
|
|
35
|
+
"[&_.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",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
<ChartStyle id={chartId} config={config} />
|
|
41
|
+
<RechartsPrimitive.ResponsiveContainer>
|
|
42
|
+
{children}
|
|
43
|
+
</RechartsPrimitive.ResponsiveContainer>
|
|
44
|
+
</div>
|
|
45
|
+
</ChartContext.Provider>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ChartStyle = ({ id, config }) => {
|
|
50
|
+
const colorConfig = Object.entries(config).filter(
|
|
51
|
+
([, config]) => config.theme || config.color
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (!colorConfig.length) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<style
|
|
60
|
+
dangerouslySetInnerHTML={{
|
|
61
|
+
__html: Object.entries(THEMES)
|
|
62
|
+
.map(
|
|
63
|
+
([theme, prefix]) => `
|
|
64
|
+
${prefix} [data-chart=${id}] {
|
|
65
|
+
${colorConfig
|
|
66
|
+
.map(([key, itemConfig]) => {
|
|
67
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
68
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
69
|
+
})
|
|
70
|
+
.join("\n")}
|
|
71
|
+
}
|
|
72
|
+
`
|
|
73
|
+
)
|
|
74
|
+
.join("\n"),
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
81
|
+
|
|
82
|
+
function ChartTooltipContent({
|
|
83
|
+
active,
|
|
84
|
+
payload,
|
|
85
|
+
className,
|
|
86
|
+
indicator = "dot",
|
|
87
|
+
hideLabel = false,
|
|
88
|
+
hideIndicator = false,
|
|
89
|
+
label,
|
|
90
|
+
labelFormatter,
|
|
91
|
+
labelClassName,
|
|
92
|
+
formatter,
|
|
93
|
+
color,
|
|
94
|
+
nameKey,
|
|
95
|
+
labelKey,
|
|
96
|
+
}) {
|
|
97
|
+
const { config } = useChart();
|
|
98
|
+
|
|
99
|
+
const tooltipLabel = React.useMemo(() => {
|
|
100
|
+
if (hideLabel || !payload?.length) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const [item] = payload;
|
|
105
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
106
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
107
|
+
const value =
|
|
108
|
+
!labelKey && typeof label === "string"
|
|
109
|
+
? config[label]?.label || label
|
|
110
|
+
: itemConfig?.label;
|
|
111
|
+
|
|
112
|
+
if (labelFormatter) {
|
|
113
|
+
return (
|
|
114
|
+
<div className={cn("font-medium", labelClassName)}>
|
|
115
|
+
{labelFormatter(value, payload)}
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!value) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return <div className={cn("font-medium", labelClassName)}>{value}</div>;
|
|
125
|
+
}, [
|
|
126
|
+
label,
|
|
127
|
+
labelFormatter,
|
|
128
|
+
payload,
|
|
129
|
+
hideLabel,
|
|
130
|
+
labelClassName,
|
|
131
|
+
config,
|
|
132
|
+
labelKey,
|
|
133
|
+
]);
|
|
134
|
+
|
|
135
|
+
if (!active || !payload?.length) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<div
|
|
143
|
+
className={cn(
|
|
144
|
+
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
145
|
+
className
|
|
146
|
+
)}
|
|
147
|
+
>
|
|
148
|
+
{!nestLabel ? tooltipLabel : null}
|
|
149
|
+
<div className="grid gap-1.5">
|
|
150
|
+
{payload.map((item, index) => {
|
|
151
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
152
|
+
const itemConfig = getPayloadConfigFromPayload(
|
|
153
|
+
config,
|
|
154
|
+
item,
|
|
155
|
+
key
|
|
156
|
+
);
|
|
157
|
+
const indicatorColor =
|
|
158
|
+
color || item.payload.fill || item.color;
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div
|
|
162
|
+
key={item.dataKey}
|
|
163
|
+
className={cn(
|
|
164
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
165
|
+
indicator === "dot" && "items-center"
|
|
166
|
+
)}
|
|
167
|
+
>
|
|
168
|
+
{formatter &&
|
|
169
|
+
item?.value !== undefined &&
|
|
170
|
+
item.name ? (
|
|
171
|
+
formatter(
|
|
172
|
+
item.value,
|
|
173
|
+
item.name,
|
|
174
|
+
item,
|
|
175
|
+
index,
|
|
176
|
+
item.payload
|
|
177
|
+
)
|
|
178
|
+
) : (
|
|
179
|
+
<>
|
|
180
|
+
{itemConfig?.icon ? (
|
|
181
|
+
<itemConfig.icon />
|
|
182
|
+
) : (
|
|
183
|
+
!hideIndicator && (
|
|
184
|
+
<div
|
|
185
|
+
className={cn(
|
|
186
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
187
|
+
{
|
|
188
|
+
"h-2.5 w-2.5":
|
|
189
|
+
indicator === "dot",
|
|
190
|
+
"w-1":
|
|
191
|
+
indicator ===
|
|
192
|
+
"line",
|
|
193
|
+
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
194
|
+
indicator ===
|
|
195
|
+
"dashed",
|
|
196
|
+
"my-0.5":
|
|
197
|
+
nestLabel &&
|
|
198
|
+
indicator ===
|
|
199
|
+
"dashed",
|
|
200
|
+
}
|
|
201
|
+
)}
|
|
202
|
+
style={{
|
|
203
|
+
"--color-bg":
|
|
204
|
+
indicatorColor,
|
|
205
|
+
"--color-border":
|
|
206
|
+
indicatorColor,
|
|
207
|
+
}}
|
|
208
|
+
/>
|
|
209
|
+
)
|
|
210
|
+
)}
|
|
211
|
+
<div
|
|
212
|
+
className={cn(
|
|
213
|
+
"flex flex-1 justify-between leading-none",
|
|
214
|
+
nestLabel
|
|
215
|
+
? "items-end"
|
|
216
|
+
: "items-center"
|
|
217
|
+
)}
|
|
218
|
+
>
|
|
219
|
+
<div className="grid gap-1.5">
|
|
220
|
+
{nestLabel ? tooltipLabel : null}
|
|
221
|
+
<span className="text-muted-foreground">
|
|
222
|
+
{itemConfig?.label || item.name}
|
|
223
|
+
</span>
|
|
224
|
+
</div>
|
|
225
|
+
{item.value && (
|
|
226
|
+
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
227
|
+
{item.value.toLocaleString()}
|
|
228
|
+
</span>
|
|
229
|
+
)}
|
|
230
|
+
</div>
|
|
231
|
+
</>
|
|
232
|
+
)}
|
|
233
|
+
</div>
|
|
234
|
+
);
|
|
235
|
+
})}
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
242
|
+
|
|
243
|
+
function ChartLegendContent({
|
|
244
|
+
className,
|
|
245
|
+
hideIcon = false,
|
|
246
|
+
payload,
|
|
247
|
+
verticalAlign = "bottom",
|
|
248
|
+
nameKey,
|
|
249
|
+
}) {
|
|
250
|
+
const { config } = useChart();
|
|
251
|
+
|
|
252
|
+
if (!payload?.length) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div
|
|
258
|
+
className={cn(
|
|
259
|
+
"flex items-center justify-center gap-4",
|
|
260
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
261
|
+
className
|
|
262
|
+
)}
|
|
263
|
+
>
|
|
264
|
+
{payload.map((item) => {
|
|
265
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
266
|
+
const itemConfig = getPayloadConfigFromPayload(
|
|
267
|
+
config,
|
|
268
|
+
item,
|
|
269
|
+
key
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<div
|
|
274
|
+
key={item.value}
|
|
275
|
+
className={cn(
|
|
276
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
277
|
+
)}
|
|
278
|
+
>
|
|
279
|
+
{itemConfig?.icon && !hideIcon ? (
|
|
280
|
+
<itemConfig.icon />
|
|
281
|
+
) : (
|
|
282
|
+
<div
|
|
283
|
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
284
|
+
style={{
|
|
285
|
+
backgroundColor: item.color,
|
|
286
|
+
}}
|
|
287
|
+
/>
|
|
288
|
+
)}
|
|
289
|
+
{itemConfig?.label}
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
})}
|
|
293
|
+
</div>
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Helper to extract item config from a payload.
|
|
298
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
299
|
+
if (typeof payload !== "object" || payload === null) {
|
|
300
|
+
return undefined;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const payloadPayload =
|
|
304
|
+
"payload" in payload &&
|
|
305
|
+
typeof payload.payload === "object" &&
|
|
306
|
+
payload.payload !== null
|
|
307
|
+
? payload.payload
|
|
308
|
+
: undefined;
|
|
309
|
+
|
|
310
|
+
let configLabelKey = key;
|
|
311
|
+
|
|
312
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
313
|
+
configLabelKey = payload[key];
|
|
314
|
+
} else if (
|
|
315
|
+
payloadPayload &&
|
|
316
|
+
key in payloadPayload &&
|
|
317
|
+
typeof payloadPayload[key] === "string"
|
|
318
|
+
) {
|
|
319
|
+
configLabelKey = payloadPayload[key];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export {
|
|
326
|
+
ChartContainer,
|
|
327
|
+
ChartTooltip,
|
|
328
|
+
ChartTooltipContent,
|
|
329
|
+
ChartLegend,
|
|
330
|
+
ChartLegendContent,
|
|
331
|
+
ChartStyle,
|
|
332
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
|
|
9
|
+
function Checkbox({ className, ...props }) {
|
|
10
|
+
return (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
data-slot="checkbox"
|
|
13
|
+
className={cn(
|
|
14
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<CheckboxPrimitive.Indicator
|
|
20
|
+
data-slot="checkbox-indicator"
|
|
21
|
+
className="flex items-center justify-center text-current transition-none"
|
|
22
|
+
>
|
|
23
|
+
<CheckIcon className="size-3.5" />
|
|
24
|
+
</CheckboxPrimitive.Indicator>
|
|
25
|
+
</CheckboxPrimitive.Root>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Checkbox };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
4
|
+
|
|
5
|
+
function Collapsible({ ...props }) {
|
|
6
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function CollapsibleTrigger({ ...props }) {
|
|
10
|
+
return (
|
|
11
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
12
|
+
data-slot="collapsible-trigger"
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function CollapsibleContent({ ...props }) {
|
|
19
|
+
return (
|
|
20
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
21
|
+
data-slot="collapsible-content"
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
+
import { SearchIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
import {
|
|
9
|
+
Dialog,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
DialogHeader,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
} from "@/components/ui/dialog";
|
|
15
|
+
|
|
16
|
+
function Command({ className, ...props }) {
|
|
17
|
+
return (
|
|
18
|
+
<CommandPrimitive
|
|
19
|
+
data-slot="command"
|
|
20
|
+
className={cn(
|
|
21
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function CommandDialog({
|
|
30
|
+
title = "Command Palette",
|
|
31
|
+
description = "Search for a command to run...",
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
showCloseButton = true,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<Dialog {...props}>
|
|
39
|
+
<DialogHeader className="sr-only">
|
|
40
|
+
<DialogTitle>{title}</DialogTitle>
|
|
41
|
+
<DialogDescription>{description}</DialogDescription>
|
|
42
|
+
</DialogHeader>
|
|
43
|
+
<DialogContent
|
|
44
|
+
className={cn("overflow-hidden p-0", className)}
|
|
45
|
+
showCloseButton={showCloseButton}
|
|
46
|
+
>
|
|
47
|
+
<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">
|
|
48
|
+
{children}
|
|
49
|
+
</Command>
|
|
50
|
+
</DialogContent>
|
|
51
|
+
</Dialog>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function CommandInput({ className, ...props }) {
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
data-slot="command-input-wrapper"
|
|
59
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
60
|
+
>
|
|
61
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
62
|
+
<CommandPrimitive.Input
|
|
63
|
+
data-slot="command-input"
|
|
64
|
+
className={cn(
|
|
65
|
+
"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",
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function CommandList({ className, ...props }) {
|
|
75
|
+
return (
|
|
76
|
+
<CommandPrimitive.List
|
|
77
|
+
data-slot="command-list"
|
|
78
|
+
className={cn(
|
|
79
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
80
|
+
className
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function CommandEmpty({ ...props }) {
|
|
88
|
+
return (
|
|
89
|
+
<CommandPrimitive.Empty
|
|
90
|
+
data-slot="command-empty"
|
|
91
|
+
className="py-6 text-center text-sm"
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function CommandGroup({ className, ...props }) {
|
|
98
|
+
return (
|
|
99
|
+
<CommandPrimitive.Group
|
|
100
|
+
data-slot="command-group"
|
|
101
|
+
className={cn(
|
|
102
|
+
"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",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function CommandSeparator({ className, ...props }) {
|
|
111
|
+
return (
|
|
112
|
+
<CommandPrimitive.Separator
|
|
113
|
+
data-slot="command-separator"
|
|
114
|
+
className={cn("bg-border -mx-1 h-px", className)}
|
|
115
|
+
{...props}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function CommandItem({ className, ...props }) {
|
|
121
|
+
return (
|
|
122
|
+
<CommandPrimitive.Item
|
|
123
|
+
data-slot="command-item"
|
|
124
|
+
className={cn(
|
|
125
|
+
"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",
|
|
126
|
+
className
|
|
127
|
+
)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function CommandShortcut({ className, ...props }) {
|
|
134
|
+
return (
|
|
135
|
+
<span
|
|
136
|
+
data-slot="command-shortcut"
|
|
137
|
+
className={cn(
|
|
138
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
139
|
+
className
|
|
140
|
+
)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Command,
|
|
148
|
+
CommandDialog,
|
|
149
|
+
CommandInput,
|
|
150
|
+
CommandList,
|
|
151
|
+
CommandEmpty,
|
|
152
|
+
CommandGroup,
|
|
153
|
+
CommandItem,
|
|
154
|
+
CommandShortcut,
|
|
155
|
+
CommandSeparator,
|
|
156
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
function Container({ children, className, ref }) {
|
|
5
|
+
return (
|
|
6
|
+
<section
|
|
7
|
+
className={cn(
|
|
8
|
+
className,
|
|
9
|
+
"3xl:w-2/3 relative z-10 mx-auto w-11/12 2xl:w-3/4"
|
|
10
|
+
)}
|
|
11
|
+
ref={ref}
|
|
12
|
+
>
|
|
13
|
+
{children}
|
|
14
|
+
</section>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default Container;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
|
|
9
|
+
function Dialog({ ...props }) {
|
|
10
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DialogTrigger({ ...props }) {
|
|
14
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function DialogPortal({ ...props }) {
|
|
18
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function DialogClose({ ...props }) {
|
|
22
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function DialogOverlay({ className, ...props }) {
|
|
26
|
+
return (
|
|
27
|
+
<DialogPrimitive.Overlay
|
|
28
|
+
data-slot="dialog-overlay"
|
|
29
|
+
className={cn(
|
|
30
|
+
"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",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function DialogContent({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
showCloseButton = true,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
return (
|
|
45
|
+
<DialogPortal data-slot="dialog-portal">
|
|
46
|
+
<DialogOverlay />
|
|
47
|
+
<DialogPrimitive.Content
|
|
48
|
+
data-slot="dialog-content"
|
|
49
|
+
className={cn(
|
|
50
|
+
"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",
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
{showCloseButton && (
|
|
57
|
+
<DialogPrimitive.Close
|
|
58
|
+
data-slot="dialog-close"
|
|
59
|
+
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"
|
|
60
|
+
>
|
|
61
|
+
<XIcon />
|
|
62
|
+
<span className="sr-only">Close</span>
|
|
63
|
+
</DialogPrimitive.Close>
|
|
64
|
+
)}
|
|
65
|
+
</DialogPrimitive.Content>
|
|
66
|
+
</DialogPortal>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function DialogHeader({ className, ...props }) {
|
|
71
|
+
return (
|
|
72
|
+
<div
|
|
73
|
+
data-slot="dialog-header"
|
|
74
|
+
className={cn(
|
|
75
|
+
"flex flex-col gap-2 text-center sm:text-left",
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function DialogFooter({ className, ...props }) {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
data-slot="dialog-footer"
|
|
87
|
+
className={cn(
|
|
88
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
89
|
+
className
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function DialogTitle({ className, ...props }) {
|
|
97
|
+
return (
|
|
98
|
+
<DialogPrimitive.Title
|
|
99
|
+
data-slot="dialog-title"
|
|
100
|
+
className={cn("text-lg leading-none font-semibold", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function DialogDescription({ className, ...props }) {
|
|
107
|
+
return (
|
|
108
|
+
<DialogPrimitive.Description
|
|
109
|
+
data-slot="dialog-description"
|
|
110
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
Dialog,
|
|
118
|
+
DialogClose,
|
|
119
|
+
DialogContent,
|
|
120
|
+
DialogDescription,
|
|
121
|
+
DialogFooter,
|
|
122
|
+
DialogHeader,
|
|
123
|
+
DialogOverlay,
|
|
124
|
+
DialogPortal,
|
|
125
|
+
DialogTitle,
|
|
126
|
+
DialogTrigger,
|
|
127
|
+
};
|