create-bluecopa-react-app 1.0.41 → 1.0.43
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 +7 -5
- package/package.json +1 -1
- package/templates/latest/.claude/settings.local.json +56 -0
- package/templates/latest/.env.example +8 -0
- package/templates/latest/Agent.md +598 -775
- package/templates/latest/CLAUDE.md +759 -0
- package/templates/latest/README.md +11 -2
- package/templates/latest/app/app.css +292 -85
- package/templates/latest/app/app.tsx +48 -39
- package/templates/latest/app/components/bluecopa-logo.tsx +20 -0
- package/templates/latest/app/components/charts/bar-chart.tsx +132 -0
- package/templates/latest/app/components/charts/base-chart.tsx +149 -0
- package/templates/latest/app/components/charts/chart-provider.tsx +71 -0
- package/templates/latest/app/components/charts/chart-theme.ts +262 -0
- package/templates/latest/app/components/charts/chart-utils.ts +142 -0
- package/templates/latest/app/components/charts/donut-chart.tsx +110 -0
- package/templates/latest/app/components/charts/index.ts +5 -0
- package/templates/latest/app/components/layouts/app-layout.tsx +22 -0
- package/templates/latest/app/components/layouts/app-sidebar.tsx +88 -0
- package/templates/latest/app/components/layouts/nav-main.tsx +50 -0
- package/templates/latest/app/components/layouts/nav-user.tsx +38 -0
- package/templates/latest/app/components/layouts/site-header.tsx +93 -0
- package/templates/latest/app/components/loading-screen.tsx +41 -0
- package/templates/latest/app/components/ui/ag-grid-table.tsx +79 -0
- package/templates/latest/app/components/ui/button.tsx +23 -23
- package/templates/latest/app/components/ui/card.tsx +20 -20
- package/templates/latest/app/components/ui/dropdown-menu.tsx +54 -49
- package/templates/latest/app/components/ui/input.tsx +8 -8
- package/templates/latest/app/components/ui/label.tsx +8 -8
- package/templates/latest/app/components/ui/separator.tsx +7 -7
- package/templates/latest/app/components/ui/sheet.tsx +43 -32
- package/templates/latest/app/components/ui/sidebar.tsx +240 -235
- package/templates/latest/app/components/ui/skeleton.tsx +4 -4
- package/templates/latest/app/components/ui/sonner.tsx +6 -9
- package/templates/latest/app/components/ui/tabs.tsx +15 -15
- package/templates/latest/app/components/ui/tooltip.tsx +18 -12
- package/templates/latest/app/constants/index.ts +31 -0
- package/templates/latest/app/contexts/app-context.tsx +201 -0
- package/templates/latest/app/hooks/use-mobile.ts +13 -12
- package/templates/latest/app/main.tsx +1 -1
- package/templates/latest/app/pages/dashboard.tsx +246 -0
- package/templates/latest/app/pages/payments.tsx +182 -0
- package/templates/latest/app/pages/settings.tsx +128 -0
- package/templates/latest/app/routes/index.tsx +19 -0
- package/templates/latest/app/single-spa.tsx +69 -186
- package/templates/latest/app/types/index.ts +37 -0
- package/templates/latest/app/utils/ag-grid-datasource.ts +63 -0
- package/templates/latest/app/utils/ag-grid-license.ts +12 -0
- package/templates/latest/app/utils/ag-grid-theme.ts +9 -0
- package/templates/latest/app/utils/component-style.ts +7 -0
- package/templates/latest/app/utils/style-drivers.ts +24 -0
- package/templates/latest/app/utils/utils.ts +10 -0
- package/templates/latest/components.json +3 -3
- package/templates/latest/index.html +30 -2
- package/templates/latest/package-lock.json +2717 -955
- package/templates/latest/package.json +19 -21
- package/templates/latest/preview/index.html +125 -285
- package/templates/latest/public/favicon.svg +1 -0
- package/templates/latest/vite.config.ts +2 -8
- package/templates/latest/app/components/app-sidebar.tsx +0 -182
- package/templates/latest/app/components/chart-area-interactive.tsx +0 -290
- package/templates/latest/app/components/data-table.tsx +0 -807
- package/templates/latest/app/components/nav-documents.tsx +0 -92
- package/templates/latest/app/components/nav-main.tsx +0 -40
- package/templates/latest/app/components/nav-secondary.tsx +0 -42
- package/templates/latest/app/components/nav-user.tsx +0 -111
- package/templates/latest/app/components/section-cards.tsx +0 -102
- package/templates/latest/app/components/site-header.tsx +0 -28
- package/templates/latest/app/components/ui/avatar.tsx +0 -53
- package/templates/latest/app/components/ui/badge.tsx +0 -46
- package/templates/latest/app/components/ui/breadcrumb.tsx +0 -109
- package/templates/latest/app/components/ui/chart.tsx +0 -352
- package/templates/latest/app/components/ui/checkbox.tsx +0 -30
- package/templates/latest/app/components/ui/drawer.tsx +0 -139
- package/templates/latest/app/components/ui/select.tsx +0 -183
- package/templates/latest/app/components/ui/table.tsx +0 -117
- package/templates/latest/app/components/ui/toggle-group.tsx +0 -73
- package/templates/latest/app/components/ui/toggle.tsx +0 -47
- package/templates/latest/app/data/data.json +0 -614
- package/templates/latest/app/data/mock-payments.json +0 -122
- package/templates/latest/app/data/mock-transactions.json +0 -128
- package/templates/latest/app/hooks/use-bluecopa-user.ts +0 -37
- package/templates/latest/app/lib/utils.ts +0 -6
- package/templates/latest/app/routes/apitest.tsx +0 -2118
- package/templates/latest/app/routes/comments.tsx +0 -588
- package/templates/latest/app/routes/dashboard.tsx +0 -36
- package/templates/latest/app/routes/payments.tsx +0 -342
- package/templates/latest/app/routes/statements.tsx +0 -493
- package/templates/latest/app/routes/websocket.tsx +0 -450
- package/templates/latest/app/routes.tsx +0 -22
- package/templates/latest/dist/assets/__federation_expose_App-D-lv9y21.js +0 -161
- package/templates/latest/dist/assets/__federation_fn_import-CzfA7kmP.js +0 -438
- package/templates/latest/dist/assets/__federation_shared_react-Bp6HVBS4.js +0 -16
- package/templates/latest/dist/assets/__federation_shared_react-dom-BCcRGiYp.js +0 -17
- package/templates/latest/dist/assets/client-Dms8K6Dw.js +0 -78879
- package/templates/latest/dist/assets/index-BrhXrqF7.js +0 -60
- package/templates/latest/dist/assets/index-BzNimew1.js +0 -69
- package/templates/latest/dist/assets/index-DMFtQdNS.js +0 -412
- package/templates/latest/dist/assets/remoteEntry.css +0 -3996
- package/templates/latest/dist/assets/remoteEntry.js +0 -88
- package/templates/latest/dist/favicon.ico +0 -0
- package/templates/latest/dist/index.html +0 -19
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as RechartsPrimitive from "recharts"
|
|
3
|
-
|
|
4
|
-
import { cn } from "~/lib/utils"
|
|
5
|
-
|
|
6
|
-
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
-
const THEMES = { light: "", dark: ".dark" } as const
|
|
8
|
-
|
|
9
|
-
type ChartConfig = {
|
|
10
|
-
[k in string]: {
|
|
11
|
-
label?: React.ReactNode
|
|
12
|
-
icon?: React.ComponentType
|
|
13
|
-
} & (
|
|
14
|
-
| { color?: string; theme?: never }
|
|
15
|
-
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type ChartContextProps = {
|
|
20
|
-
config: ChartConfig
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const ChartContext = React.createContext<ChartContextProps | null>(null)
|
|
24
|
-
|
|
25
|
-
function useChart() {
|
|
26
|
-
const context = React.useContext(ChartContext)
|
|
27
|
-
|
|
28
|
-
if (!context) {
|
|
29
|
-
throw new Error("useChart must be used within a <ChartContainer />")
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return context
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function ChartContainer({
|
|
36
|
-
id,
|
|
37
|
-
className,
|
|
38
|
-
children,
|
|
39
|
-
config,
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<"div"> & {
|
|
42
|
-
config: ChartConfig
|
|
43
|
-
children: React.ComponentProps<
|
|
44
|
-
typeof RechartsPrimitive.ResponsiveContainer
|
|
45
|
-
>["children"]
|
|
46
|
-
}) {
|
|
47
|
-
const uniqueId = React.useId()
|
|
48
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<ChartContext.Provider value={{ config }}>
|
|
52
|
-
<div
|
|
53
|
-
data-slot="chart"
|
|
54
|
-
data-chart={chartId}
|
|
55
|
-
className={cn(
|
|
56
|
-
"[&_.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",
|
|
57
|
-
className
|
|
58
|
-
)}
|
|
59
|
-
{...props}
|
|
60
|
-
>
|
|
61
|
-
<ChartStyle id={chartId} config={config} />
|
|
62
|
-
<RechartsPrimitive.ResponsiveContainer>
|
|
63
|
-
{children}
|
|
64
|
-
</RechartsPrimitive.ResponsiveContainer>
|
|
65
|
-
</div>
|
|
66
|
-
</ChartContext.Provider>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
71
|
-
const colorConfig = Object.entries(config).filter(
|
|
72
|
-
([, config]) => config.theme || config.color
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
if (!colorConfig.length) {
|
|
76
|
-
return null
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<style
|
|
81
|
-
dangerouslySetInnerHTML={{
|
|
82
|
-
__html: Object.entries(THEMES)
|
|
83
|
-
.map(
|
|
84
|
-
([theme, prefix]) => `
|
|
85
|
-
${prefix} [data-chart=${id}] {
|
|
86
|
-
${colorConfig
|
|
87
|
-
.map(([key, itemConfig]) => {
|
|
88
|
-
const color =
|
|
89
|
-
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
90
|
-
itemConfig.color
|
|
91
|
-
return color ? ` --color-${key}: ${color};` : null
|
|
92
|
-
})
|
|
93
|
-
.join("\n")}
|
|
94
|
-
}
|
|
95
|
-
`
|
|
96
|
-
)
|
|
97
|
-
.join("\n"),
|
|
98
|
-
}}
|
|
99
|
-
/>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
104
|
-
|
|
105
|
-
function ChartTooltipContent({
|
|
106
|
-
active,
|
|
107
|
-
payload,
|
|
108
|
-
className,
|
|
109
|
-
indicator = "dot",
|
|
110
|
-
hideLabel = false,
|
|
111
|
-
hideIndicator = false,
|
|
112
|
-
label,
|
|
113
|
-
labelFormatter,
|
|
114
|
-
labelClassName,
|
|
115
|
-
formatter,
|
|
116
|
-
color,
|
|
117
|
-
nameKey,
|
|
118
|
-
labelKey,
|
|
119
|
-
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
|
120
|
-
React.ComponentProps<"div"> & {
|
|
121
|
-
hideLabel?: boolean
|
|
122
|
-
hideIndicator?: boolean
|
|
123
|
-
indicator?: "line" | "dot" | "dashed"
|
|
124
|
-
nameKey?: string
|
|
125
|
-
labelKey?: string
|
|
126
|
-
}) {
|
|
127
|
-
const { config } = useChart()
|
|
128
|
-
|
|
129
|
-
const tooltipLabel = React.useMemo(() => {
|
|
130
|
-
if (hideLabel || !payload?.length) {
|
|
131
|
-
return null
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const [item] = payload
|
|
135
|
-
const key = `${labelKey || item?.dataKey || item?.name || "value"}`
|
|
136
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
137
|
-
const value =
|
|
138
|
-
!labelKey && typeof label === "string"
|
|
139
|
-
? config[label as keyof typeof config]?.label || label
|
|
140
|
-
: itemConfig?.label
|
|
141
|
-
|
|
142
|
-
if (labelFormatter) {
|
|
143
|
-
return (
|
|
144
|
-
<div className={cn("font-medium", labelClassName)}>
|
|
145
|
-
{labelFormatter(value, payload)}
|
|
146
|
-
</div>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!value) {
|
|
151
|
-
return null
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return <div className={cn("font-medium", labelClassName)}>{value}</div>
|
|
155
|
-
}, [
|
|
156
|
-
label,
|
|
157
|
-
labelFormatter,
|
|
158
|
-
payload,
|
|
159
|
-
hideLabel,
|
|
160
|
-
labelClassName,
|
|
161
|
-
config,
|
|
162
|
-
labelKey,
|
|
163
|
-
])
|
|
164
|
-
|
|
165
|
-
if (!active || !payload?.length) {
|
|
166
|
-
return null
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const nestLabel = payload.length === 1 && indicator !== "dot"
|
|
170
|
-
|
|
171
|
-
return (
|
|
172
|
-
<div
|
|
173
|
-
className={cn(
|
|
174
|
-
"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",
|
|
175
|
-
className
|
|
176
|
-
)}
|
|
177
|
-
>
|
|
178
|
-
{!nestLabel ? tooltipLabel : null}
|
|
179
|
-
<div className="grid gap-1.5">
|
|
180
|
-
{payload.map((item, index) => {
|
|
181
|
-
const key = `${nameKey || item.name || item.dataKey || "value"}`
|
|
182
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
183
|
-
const indicatorColor = color || item.payload.fill || item.color
|
|
184
|
-
|
|
185
|
-
return (
|
|
186
|
-
<div
|
|
187
|
-
key={item.dataKey}
|
|
188
|
-
className={cn(
|
|
189
|
-
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
190
|
-
indicator === "dot" && "items-center"
|
|
191
|
-
)}
|
|
192
|
-
>
|
|
193
|
-
{formatter && item?.value !== undefined && item.name ? (
|
|
194
|
-
formatter(item.value, item.name, item, index, item.payload)
|
|
195
|
-
) : (
|
|
196
|
-
<>
|
|
197
|
-
{itemConfig?.icon ? (
|
|
198
|
-
<itemConfig.icon />
|
|
199
|
-
) : (
|
|
200
|
-
!hideIndicator && (
|
|
201
|
-
<div
|
|
202
|
-
className={cn(
|
|
203
|
-
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
204
|
-
{
|
|
205
|
-
"h-2.5 w-2.5": indicator === "dot",
|
|
206
|
-
"w-1": indicator === "line",
|
|
207
|
-
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
208
|
-
indicator === "dashed",
|
|
209
|
-
"my-0.5": nestLabel && indicator === "dashed",
|
|
210
|
-
}
|
|
211
|
-
)}
|
|
212
|
-
style={
|
|
213
|
-
{
|
|
214
|
-
"--color-bg": indicatorColor,
|
|
215
|
-
"--color-border": indicatorColor,
|
|
216
|
-
} as React.CSSProperties
|
|
217
|
-
}
|
|
218
|
-
/>
|
|
219
|
-
)
|
|
220
|
-
)}
|
|
221
|
-
<div
|
|
222
|
-
className={cn(
|
|
223
|
-
"flex flex-1 justify-between leading-none",
|
|
224
|
-
nestLabel ? "items-end" : "items-center"
|
|
225
|
-
)}
|
|
226
|
-
>
|
|
227
|
-
<div className="grid gap-1.5">
|
|
228
|
-
{nestLabel ? tooltipLabel : null}
|
|
229
|
-
<span className="text-muted-foreground">
|
|
230
|
-
{itemConfig?.label || item.name}
|
|
231
|
-
</span>
|
|
232
|
-
</div>
|
|
233
|
-
{item.value && (
|
|
234
|
-
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
235
|
-
{item.value.toLocaleString()}
|
|
236
|
-
</span>
|
|
237
|
-
)}
|
|
238
|
-
</div>
|
|
239
|
-
</>
|
|
240
|
-
)}
|
|
241
|
-
</div>
|
|
242
|
-
)
|
|
243
|
-
})}
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
)
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const ChartLegend = RechartsPrimitive.Legend
|
|
250
|
-
|
|
251
|
-
function ChartLegendContent({
|
|
252
|
-
className,
|
|
253
|
-
hideIcon = false,
|
|
254
|
-
payload,
|
|
255
|
-
verticalAlign = "bottom",
|
|
256
|
-
nameKey,
|
|
257
|
-
}: React.ComponentProps<"div"> &
|
|
258
|
-
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
259
|
-
hideIcon?: boolean
|
|
260
|
-
nameKey?: string
|
|
261
|
-
}) {
|
|
262
|
-
const { config } = useChart()
|
|
263
|
-
|
|
264
|
-
if (!payload?.length) {
|
|
265
|
-
return null
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
return (
|
|
269
|
-
<div
|
|
270
|
-
className={cn(
|
|
271
|
-
"flex items-center justify-center gap-4",
|
|
272
|
-
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
273
|
-
className
|
|
274
|
-
)}
|
|
275
|
-
>
|
|
276
|
-
{payload.map((item) => {
|
|
277
|
-
const key = `${nameKey || item.dataKey || "value"}`
|
|
278
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
279
|
-
|
|
280
|
-
return (
|
|
281
|
-
<div
|
|
282
|
-
key={item.value}
|
|
283
|
-
className={cn(
|
|
284
|
-
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
285
|
-
)}
|
|
286
|
-
>
|
|
287
|
-
{itemConfig?.icon && !hideIcon ? (
|
|
288
|
-
<itemConfig.icon />
|
|
289
|
-
) : (
|
|
290
|
-
<div
|
|
291
|
-
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
292
|
-
style={{
|
|
293
|
-
backgroundColor: item.color,
|
|
294
|
-
}}
|
|
295
|
-
/>
|
|
296
|
-
)}
|
|
297
|
-
{itemConfig?.label}
|
|
298
|
-
</div>
|
|
299
|
-
)
|
|
300
|
-
})}
|
|
301
|
-
</div>
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Helper to extract item config from a payload.
|
|
306
|
-
function getPayloadConfigFromPayload(
|
|
307
|
-
config: ChartConfig,
|
|
308
|
-
payload: unknown,
|
|
309
|
-
key: string
|
|
310
|
-
) {
|
|
311
|
-
if (typeof payload !== "object" || payload === null) {
|
|
312
|
-
return undefined
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const payloadPayload =
|
|
316
|
-
"payload" in payload &&
|
|
317
|
-
typeof payload.payload === "object" &&
|
|
318
|
-
payload.payload !== null
|
|
319
|
-
? payload.payload
|
|
320
|
-
: undefined
|
|
321
|
-
|
|
322
|
-
let configLabelKey: string = key
|
|
323
|
-
|
|
324
|
-
if (
|
|
325
|
-
key in payload &&
|
|
326
|
-
typeof payload[key as keyof typeof payload] === "string"
|
|
327
|
-
) {
|
|
328
|
-
configLabelKey = payload[key as keyof typeof payload] as string
|
|
329
|
-
} else if (
|
|
330
|
-
payloadPayload &&
|
|
331
|
-
key in payloadPayload &&
|
|
332
|
-
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
|
|
333
|
-
) {
|
|
334
|
-
configLabelKey = payloadPayload[
|
|
335
|
-
key as keyof typeof payloadPayload
|
|
336
|
-
] as string
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
return configLabelKey in config
|
|
340
|
-
? config[configLabelKey]
|
|
341
|
-
: config[key as keyof typeof config]
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export type { ChartConfig }
|
|
345
|
-
export {
|
|
346
|
-
ChartContainer,
|
|
347
|
-
ChartTooltip,
|
|
348
|
-
ChartTooltipContent,
|
|
349
|
-
ChartLegend,
|
|
350
|
-
ChartLegendContent,
|
|
351
|
-
ChartStyle,
|
|
352
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
3
|
-
import { CheckIcon } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "~/lib/utils"
|
|
6
|
-
|
|
7
|
-
function Checkbox({
|
|
8
|
-
className,
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
11
|
-
return (
|
|
12
|
-
<CheckboxPrimitive.Root
|
|
13
|
-
data-slot="checkbox"
|
|
14
|
-
className={cn(
|
|
15
|
-
"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",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<CheckboxPrimitive.Indicator
|
|
21
|
-
data-slot="checkbox-indicator"
|
|
22
|
-
className="flex items-center justify-center text-current transition-none"
|
|
23
|
-
>
|
|
24
|
-
<CheckIcon className="size-3.5" />
|
|
25
|
-
</CheckboxPrimitive.Indicator>
|
|
26
|
-
</CheckboxPrimitive.Root>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { Checkbox }
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Drawer as DrawerPrimitive } from "vaul"
|
|
3
|
-
|
|
4
|
-
import { cn } from "~/lib/utils"
|
|
5
|
-
|
|
6
|
-
function Drawer({
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
9
|
-
return <DrawerPrimitive.Root data-slot="drawer" {...props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const DrawerTrigger = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof DrawerPrimitive.Trigger>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>
|
|
15
|
-
>(({ ...props }, ref) => (
|
|
16
|
-
<DrawerPrimitive.Trigger
|
|
17
|
-
ref={ref}
|
|
18
|
-
data-slot="drawer-trigger"
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
))
|
|
22
|
-
DrawerTrigger.displayName = "DrawerTrigger"
|
|
23
|
-
|
|
24
|
-
function DrawerPortal({
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
27
|
-
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function DrawerClose({
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
33
|
-
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const DrawerOverlay = React.forwardRef<
|
|
37
|
-
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
39
|
-
>(({ className, ...props }, ref) => (
|
|
40
|
-
<DrawerPrimitive.Overlay
|
|
41
|
-
ref={ref}
|
|
42
|
-
data-slot="drawer-overlay"
|
|
43
|
-
className={cn(
|
|
44
|
-
"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",
|
|
45
|
-
className
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
))
|
|
50
|
-
DrawerOverlay.displayName = "DrawerOverlay"
|
|
51
|
-
|
|
52
|
-
function DrawerContent({
|
|
53
|
-
className,
|
|
54
|
-
children,
|
|
55
|
-
...props
|
|
56
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
|
57
|
-
return (
|
|
58
|
-
<DrawerPortal data-slot="drawer-portal">
|
|
59
|
-
<DrawerOverlay />
|
|
60
|
-
<DrawerPrimitive.Content
|
|
61
|
-
data-slot="drawer-content"
|
|
62
|
-
className={cn(
|
|
63
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
64
|
-
"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",
|
|
65
|
-
"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",
|
|
66
|
-
"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",
|
|
67
|
-
"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",
|
|
68
|
-
className
|
|
69
|
-
)}
|
|
70
|
-
{...props}
|
|
71
|
-
>
|
|
72
|
-
<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" />
|
|
73
|
-
{children}
|
|
74
|
-
</DrawerPrimitive.Content>
|
|
75
|
-
</DrawerPortal>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
80
|
-
return (
|
|
81
|
-
<div
|
|
82
|
-
data-slot="drawer-header"
|
|
83
|
-
className={cn(
|
|
84
|
-
"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",
|
|
85
|
-
className
|
|
86
|
-
)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
93
|
-
return (
|
|
94
|
-
<div
|
|
95
|
-
data-slot="drawer-footer"
|
|
96
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
97
|
-
{...props}
|
|
98
|
-
/>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function DrawerTitle({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
106
|
-
return (
|
|
107
|
-
<DrawerPrimitive.Title
|
|
108
|
-
data-slot="drawer-title"
|
|
109
|
-
className={cn("text-foreground font-semibold", className)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function DrawerDescription({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
|
119
|
-
return (
|
|
120
|
-
<DrawerPrimitive.Description
|
|
121
|
-
data-slot="drawer-description"
|
|
122
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
123
|
-
{...props}
|
|
124
|
-
/>
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export {
|
|
129
|
-
Drawer,
|
|
130
|
-
DrawerPortal,
|
|
131
|
-
DrawerOverlay,
|
|
132
|
-
DrawerTrigger,
|
|
133
|
-
DrawerClose,
|
|
134
|
-
DrawerContent,
|
|
135
|
-
DrawerHeader,
|
|
136
|
-
DrawerFooter,
|
|
137
|
-
DrawerTitle,
|
|
138
|
-
DrawerDescription,
|
|
139
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
3
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "~/lib/utils"
|
|
6
|
-
|
|
7
|
-
function Select({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SelectGroup({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
16
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function SelectValue({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
22
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function SelectTrigger({
|
|
26
|
-
className,
|
|
27
|
-
size = "default",
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
31
|
-
size?: "sm" | "default"
|
|
32
|
-
}) {
|
|
33
|
-
return (
|
|
34
|
-
<SelectPrimitive.Trigger
|
|
35
|
-
data-slot="select-trigger"
|
|
36
|
-
data-size={size}
|
|
37
|
-
className={cn(
|
|
38
|
-
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
<SelectPrimitive.Icon asChild>
|
|
45
|
-
<ChevronDownIcon className="size-4 opacity-50" />
|
|
46
|
-
</SelectPrimitive.Icon>
|
|
47
|
-
</SelectPrimitive.Trigger>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function SelectContent({
|
|
52
|
-
className,
|
|
53
|
-
children,
|
|
54
|
-
position = "popper",
|
|
55
|
-
...props
|
|
56
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
57
|
-
return (
|
|
58
|
-
<SelectPrimitive.Portal>
|
|
59
|
-
<SelectPrimitive.Content
|
|
60
|
-
data-slot="select-content"
|
|
61
|
-
className={cn(
|
|
62
|
-
"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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
63
|
-
position === "popper" &&
|
|
64
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
65
|
-
className
|
|
66
|
-
)}
|
|
67
|
-
position={position}
|
|
68
|
-
{...props}
|
|
69
|
-
>
|
|
70
|
-
<SelectScrollUpButton />
|
|
71
|
-
<SelectPrimitive.Viewport
|
|
72
|
-
className={cn(
|
|
73
|
-
"p-1",
|
|
74
|
-
position === "popper" &&
|
|
75
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
76
|
-
)}
|
|
77
|
-
>
|
|
78
|
-
{children}
|
|
79
|
-
</SelectPrimitive.Viewport>
|
|
80
|
-
<SelectScrollDownButton />
|
|
81
|
-
</SelectPrimitive.Content>
|
|
82
|
-
</SelectPrimitive.Portal>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function SelectLabel({
|
|
87
|
-
className,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
90
|
-
return (
|
|
91
|
-
<SelectPrimitive.Label
|
|
92
|
-
data-slot="select-label"
|
|
93
|
-
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
94
|
-
{...props}
|
|
95
|
-
/>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function SelectItem({
|
|
100
|
-
className,
|
|
101
|
-
children,
|
|
102
|
-
...props
|
|
103
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
104
|
-
return (
|
|
105
|
-
<SelectPrimitive.Item
|
|
106
|
-
data-slot="select-item"
|
|
107
|
-
className={cn(
|
|
108
|
-
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
109
|
-
className
|
|
110
|
-
)}
|
|
111
|
-
{...props}
|
|
112
|
-
>
|
|
113
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
114
|
-
<SelectPrimitive.ItemIndicator>
|
|
115
|
-
<CheckIcon className="size-4" />
|
|
116
|
-
</SelectPrimitive.ItemIndicator>
|
|
117
|
-
</span>
|
|
118
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
119
|
-
</SelectPrimitive.Item>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function SelectSeparator({
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
127
|
-
return (
|
|
128
|
-
<SelectPrimitive.Separator
|
|
129
|
-
data-slot="select-separator"
|
|
130
|
-
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
131
|
-
{...props}
|
|
132
|
-
/>
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function SelectScrollUpButton({
|
|
137
|
-
className,
|
|
138
|
-
...props
|
|
139
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
140
|
-
return (
|
|
141
|
-
<SelectPrimitive.ScrollUpButton
|
|
142
|
-
data-slot="select-scroll-up-button"
|
|
143
|
-
className={cn(
|
|
144
|
-
"flex cursor-default items-center justify-center py-1",
|
|
145
|
-
className
|
|
146
|
-
)}
|
|
147
|
-
{...props}
|
|
148
|
-
>
|
|
149
|
-
<ChevronUpIcon className="size-4" />
|
|
150
|
-
</SelectPrimitive.ScrollUpButton>
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function SelectScrollDownButton({
|
|
155
|
-
className,
|
|
156
|
-
...props
|
|
157
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
158
|
-
return (
|
|
159
|
-
<SelectPrimitive.ScrollDownButton
|
|
160
|
-
data-slot="select-scroll-down-button"
|
|
161
|
-
className={cn(
|
|
162
|
-
"flex cursor-default items-center justify-center py-1",
|
|
163
|
-
className
|
|
164
|
-
)}
|
|
165
|
-
{...props}
|
|
166
|
-
>
|
|
167
|
-
<ChevronDownIcon className="size-4" />
|
|
168
|
-
</SelectPrimitive.ScrollDownButton>
|
|
169
|
-
)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export {
|
|
173
|
-
Select,
|
|
174
|
-
SelectContent,
|
|
175
|
-
SelectGroup,
|
|
176
|
-
SelectItem,
|
|
177
|
-
SelectLabel,
|
|
178
|
-
SelectScrollDownButton,
|
|
179
|
-
SelectScrollUpButton,
|
|
180
|
-
SelectSeparator,
|
|
181
|
-
SelectTrigger,
|
|
182
|
-
SelectValue,
|
|
183
|
-
}
|