modula-ui 1.0.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 +36 -0
- package/bin/run.js +86 -0
- package/package.json +71 -0
- package/public/avatars/avatar1.png +0 -0
- package/public/avatars/avatar2.png +0 -0
- package/public/avatars/avatar3.png +0 -0
- package/public/avatars/avatar4.png +0 -0
- package/public/avatars/sources.md +34 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/registry.json +12 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +126 -0
- package/src/app/layout.js +29 -0
- package/src/app/page.js +50 -0
- package/src/app/patterns/page.js +50 -0
- package/src/components/CodeCard.jsx +16 -0
- package/src/components/CopyButton.jsx +31 -0
- package/src/components/Header.jsx +24 -0
- package/src/components/Logo.jsx +64 -0
- package/src/components/MobileOverlay.jsx +10 -0
- package/src/components/PreviewCard.jsx +98 -0
- package/src/components/Sidebar.jsx +47 -0
- package/src/components/ui/avatar.jsx +47 -0
- package/src/components/ui/badge.jsx +44 -0
- package/src/components/ui/button.jsx +56 -0
- package/src/components/ui/calendar.jsx +178 -0
- package/src/components/ui/card.jsx +101 -0
- package/src/components/ui/chart.jsx +314 -0
- package/src/components/ui/checkbox.jsx +30 -0
- package/src/components/ui/dropdown-menu.jsx +223 -0
- package/src/components/ui/input.jsx +24 -0
- package/src/components/ui/navigation-menu.jsx +152 -0
- package/src/components/ui/popover.jsx +47 -0
- package/src/components/ui/progress.jsx +29 -0
- package/src/components/ui/scroll-area.jsx +51 -0
- package/src/components/ui/select.jsx +168 -0
- package/src/components/ui/separator.jsx +27 -0
- package/src/components/ui/sheet.jsx +140 -0
- package/src/components/ui/sidebar.jsx +682 -0
- package/src/components/ui/skeleton.jsx +15 -0
- package/src/components/ui/slider.jsx +56 -0
- package/src/components/ui/tooltip.jsx +55 -0
- package/src/data/componentData.js +12 -0
- package/src/hooks/use-mobile.js +19 -0
- package/src/lib/utils.js +6 -0
- package/src/library/components/Alert.jsx +27 -0
- package/src/library/components/Badge.jsx +19 -0
- package/src/library/components/Button.jsx +31 -0
- package/src/library/components/Card.jsx +25 -0
- package/src/library/components/Input.jsx +35 -0
- package/src/library/components/Modal.jsx +26 -0
- package/src/library/components/Textarea.jsx +15 -0
- package/src/library/components/Toggle.jsx +16 -0
- package/src/library/pages/FitnessPage/FitnessPage.jsx +519 -0
- package/src/library/pages/FitnessPage/index.jsx +12 -0
- package/src/library/pages/GroupChat/GroupChat.jsx +275 -0
- package/src/library/pages/GroupChat/data.js +203 -0
- package/src/library/pages/GroupChat/index.jsx +12 -0
- package/src/library/pages/ReservationsOverview/ReservationsOverviewPage.jsx +225 -0
- package/src/library/pages/ReservationsOverview/index.jsx +12 -0
- package/src/library/pages/VideoConference/VideoConferencePage.jsx +334 -0
- package/src/library/pages/VideoConference/index.jsx +12 -0
|
@@ -0,0 +1,314 @@
|
|
|
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({
|
|
26
|
+
id,
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
config,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
const uniqueId = React.useId()
|
|
33
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<ChartContext.Provider value={{ config }}>
|
|
37
|
+
<div
|
|
38
|
+
data-slot="chart"
|
|
39
|
+
data-chart={chartId}
|
|
40
|
+
className={cn(
|
|
41
|
+
"[&_.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",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
{...props}>
|
|
45
|
+
<ChartStyle id={chartId} config={config} />
|
|
46
|
+
<RechartsPrimitive.ResponsiveContainer>
|
|
47
|
+
{children}
|
|
48
|
+
</RechartsPrimitive.ResponsiveContainer>
|
|
49
|
+
</div>
|
|
50
|
+
</ChartContext.Provider>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const ChartStyle = ({
|
|
55
|
+
id,
|
|
56
|
+
config
|
|
57
|
+
}) => {
|
|
58
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)
|
|
59
|
+
|
|
60
|
+
if (!colorConfig.length) {
|
|
61
|
+
return null
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<style
|
|
66
|
+
dangerouslySetInnerHTML={{
|
|
67
|
+
__html: Object.entries(THEMES)
|
|
68
|
+
.map(([theme, prefix]) => `
|
|
69
|
+
${prefix} [data-chart=${id}] {
|
|
70
|
+
${colorConfig
|
|
71
|
+
.map(([key, itemConfig]) => {
|
|
72
|
+
const color =
|
|
73
|
+
itemConfig.theme?.[theme] ||
|
|
74
|
+
itemConfig.color
|
|
75
|
+
return color ? ` --color-${key}: ${color};` : null
|
|
76
|
+
})
|
|
77
|
+
.join("\n")}
|
|
78
|
+
}
|
|
79
|
+
`)
|
|
80
|
+
.join("\n"),
|
|
81
|
+
}} />
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
86
|
+
|
|
87
|
+
function ChartTooltipContent({
|
|
88
|
+
active,
|
|
89
|
+
payload,
|
|
90
|
+
className,
|
|
91
|
+
indicator = "dot",
|
|
92
|
+
hideLabel = false,
|
|
93
|
+
hideIndicator = false,
|
|
94
|
+
label,
|
|
95
|
+
labelFormatter,
|
|
96
|
+
labelClassName,
|
|
97
|
+
formatter,
|
|
98
|
+
color,
|
|
99
|
+
nameKey,
|
|
100
|
+
labelKey
|
|
101
|
+
}) {
|
|
102
|
+
const { config } = useChart()
|
|
103
|
+
|
|
104
|
+
const tooltipLabel = React.useMemo(() => {
|
|
105
|
+
if (hideLabel || !payload?.length) {
|
|
106
|
+
return null
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const [item] = payload
|
|
110
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`
|
|
111
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
112
|
+
const value =
|
|
113
|
+
!labelKey && typeof label === "string"
|
|
114
|
+
? config[label]?.label || label
|
|
115
|
+
: itemConfig?.label
|
|
116
|
+
|
|
117
|
+
if (labelFormatter) {
|
|
118
|
+
return (
|
|
119
|
+
<div className={cn("font-medium", labelClassName)}>
|
|
120
|
+
{labelFormatter(value, payload)}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!value) {
|
|
126
|
+
return null
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return <div className={cn("font-medium", labelClassName)}>{value}</div>;
|
|
130
|
+
}, [
|
|
131
|
+
label,
|
|
132
|
+
labelFormatter,
|
|
133
|
+
payload,
|
|
134
|
+
hideLabel,
|
|
135
|
+
labelClassName,
|
|
136
|
+
config,
|
|
137
|
+
labelKey,
|
|
138
|
+
])
|
|
139
|
+
|
|
140
|
+
if (!active || !payload?.length) {
|
|
141
|
+
return null
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const nestLabel = payload.length === 1 && indicator !== "dot"
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<div
|
|
148
|
+
className={cn(
|
|
149
|
+
"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",
|
|
150
|
+
className
|
|
151
|
+
)}>
|
|
152
|
+
{!nestLabel ? tooltipLabel : null}
|
|
153
|
+
<div className="grid gap-1.5">
|
|
154
|
+
{payload
|
|
155
|
+
.filter((item) => item.type !== "none")
|
|
156
|
+
.map((item, index) => {
|
|
157
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`
|
|
158
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
159
|
+
const indicatorColor = color || item.payload.fill || item.color
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<div
|
|
163
|
+
key={item.dataKey}
|
|
164
|
+
className={cn(
|
|
165
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
166
|
+
indicator === "dot" && "items-center"
|
|
167
|
+
)}>
|
|
168
|
+
{formatter && item?.value !== undefined && item.name ? (
|
|
169
|
+
formatter(item.value, item.name, item, index, item.payload)
|
|
170
|
+
) : (
|
|
171
|
+
<>
|
|
172
|
+
{itemConfig?.icon ? (
|
|
173
|
+
<itemConfig.icon />
|
|
174
|
+
) : (
|
|
175
|
+
!hideIndicator && (
|
|
176
|
+
<div
|
|
177
|
+
className={cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
178
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
179
|
+
"w-1": indicator === "line",
|
|
180
|
+
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
181
|
+
indicator === "dashed",
|
|
182
|
+
"my-0.5": nestLabel && indicator === "dashed",
|
|
183
|
+
})}
|
|
184
|
+
style={
|
|
185
|
+
{
|
|
186
|
+
"--color-bg": indicatorColor,
|
|
187
|
+
"--color-border": indicatorColor
|
|
188
|
+
}
|
|
189
|
+
} />
|
|
190
|
+
)
|
|
191
|
+
)}
|
|
192
|
+
<div
|
|
193
|
+
className={cn(
|
|
194
|
+
"flex flex-1 justify-between leading-none",
|
|
195
|
+
nestLabel ? "items-end" : "items-center"
|
|
196
|
+
)}>
|
|
197
|
+
<div className="grid gap-1.5">
|
|
198
|
+
{nestLabel ? tooltipLabel : null}
|
|
199
|
+
<span className="text-muted-foreground">
|
|
200
|
+
{itemConfig?.label || item.name}
|
|
201
|
+
</span>
|
|
202
|
+
</div>
|
|
203
|
+
{item.value && (
|
|
204
|
+
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
205
|
+
{item.value.toLocaleString()}
|
|
206
|
+
</span>
|
|
207
|
+
)}
|
|
208
|
+
</div>
|
|
209
|
+
</>
|
|
210
|
+
)}
|
|
211
|
+
</div>
|
|
212
|
+
);
|
|
213
|
+
})}
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const ChartLegend = RechartsPrimitive.Legend
|
|
220
|
+
|
|
221
|
+
function ChartLegendContent({
|
|
222
|
+
className,
|
|
223
|
+
hideIcon = false,
|
|
224
|
+
payload,
|
|
225
|
+
verticalAlign = "bottom",
|
|
226
|
+
nameKey
|
|
227
|
+
}) {
|
|
228
|
+
const { config } = useChart()
|
|
229
|
+
|
|
230
|
+
if (!payload?.length) {
|
|
231
|
+
return null
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<div
|
|
236
|
+
className={cn(
|
|
237
|
+
"flex items-center justify-center gap-4",
|
|
238
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
239
|
+
className
|
|
240
|
+
)}>
|
|
241
|
+
{payload
|
|
242
|
+
.filter((item) => item.type !== "none")
|
|
243
|
+
.map((item) => {
|
|
244
|
+
const key = `${nameKey || item.dataKey || "value"}`
|
|
245
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<div
|
|
249
|
+
key={item.value}
|
|
250
|
+
className={cn(
|
|
251
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
252
|
+
)}>
|
|
253
|
+
{itemConfig?.icon && !hideIcon ? (
|
|
254
|
+
<itemConfig.icon />
|
|
255
|
+
) : (
|
|
256
|
+
<div
|
|
257
|
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
258
|
+
style={{
|
|
259
|
+
backgroundColor: item.color,
|
|
260
|
+
}} />
|
|
261
|
+
)}
|
|
262
|
+
{itemConfig?.label}
|
|
263
|
+
</div>
|
|
264
|
+
);
|
|
265
|
+
})}
|
|
266
|
+
</div>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Helper to extract item config from a payload.
|
|
271
|
+
function getPayloadConfigFromPayload(
|
|
272
|
+
config,
|
|
273
|
+
payload,
|
|
274
|
+
key
|
|
275
|
+
) {
|
|
276
|
+
if (typeof payload !== "object" || payload === null) {
|
|
277
|
+
return undefined
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const payloadPayload =
|
|
281
|
+
"payload" in payload &&
|
|
282
|
+
typeof payload.payload === "object" &&
|
|
283
|
+
payload.payload !== null
|
|
284
|
+
? payload.payload
|
|
285
|
+
: undefined
|
|
286
|
+
|
|
287
|
+
let configLabelKey = key
|
|
288
|
+
|
|
289
|
+
if (
|
|
290
|
+
key in payload &&
|
|
291
|
+
typeof payload[key] === "string"
|
|
292
|
+
) {
|
|
293
|
+
configLabelKey = payload[key]
|
|
294
|
+
} else if (
|
|
295
|
+
payloadPayload &&
|
|
296
|
+
key in payloadPayload &&
|
|
297
|
+
typeof payloadPayload[key] === "string"
|
|
298
|
+
) {
|
|
299
|
+
configLabelKey = payloadPayload[key]
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return configLabelKey in config
|
|
303
|
+
? config[configLabelKey]
|
|
304
|
+
: config[key];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export {
|
|
308
|
+
ChartContainer,
|
|
309
|
+
ChartTooltip,
|
|
310
|
+
ChartTooltipContent,
|
|
311
|
+
ChartLegend,
|
|
312
|
+
ChartLegendContent,
|
|
313
|
+
ChartStyle,
|
|
314
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<CheckboxPrimitive.Root
|
|
15
|
+
data-slot="checkbox"
|
|
16
|
+
className={cn(
|
|
17
|
+
"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",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}>
|
|
21
|
+
<CheckboxPrimitive.Indicator
|
|
22
|
+
data-slot="checkbox-indicator"
|
|
23
|
+
className="grid place-content-center text-current transition-none">
|
|
24
|
+
<CheckIcon className="size-3.5" />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
26
|
+
</CheckboxPrimitive.Root>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Checkbox }
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
function DropdownMenu({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function DropdownMenuPortal({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return (<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function DropdownMenuTrigger({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return (<DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function DropdownMenuContent({
|
|
28
|
+
className,
|
|
29
|
+
sideOffset = 4,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
<DropdownMenuPrimitive.Portal>
|
|
34
|
+
<DropdownMenuPrimitive.Content
|
|
35
|
+
data-slot="dropdown-menu-content"
|
|
36
|
+
sideOffset={sideOffset}
|
|
37
|
+
className={cn(
|
|
38
|
+
"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-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props} />
|
|
42
|
+
</DropdownMenuPrimitive.Portal>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function DropdownMenuGroup({
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
return (<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function DropdownMenuItem({
|
|
53
|
+
className,
|
|
54
|
+
inset,
|
|
55
|
+
variant = "default",
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
return (
|
|
59
|
+
<DropdownMenuPrimitive.Item
|
|
60
|
+
data-slot="dropdown-menu-item"
|
|
61
|
+
data-inset={inset}
|
|
62
|
+
data-variant={variant}
|
|
63
|
+
className={cn(
|
|
64
|
+
"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",
|
|
65
|
+
className
|
|
66
|
+
)}
|
|
67
|
+
{...props} />
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function DropdownMenuCheckboxItem({
|
|
72
|
+
className,
|
|
73
|
+
children,
|
|
74
|
+
checked,
|
|
75
|
+
...props
|
|
76
|
+
}) {
|
|
77
|
+
return (
|
|
78
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
79
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
80
|
+
className={cn(
|
|
81
|
+
"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",
|
|
82
|
+
className
|
|
83
|
+
)}
|
|
84
|
+
checked={checked}
|
|
85
|
+
{...props}>
|
|
86
|
+
<span
|
|
87
|
+
className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
88
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
89
|
+
<CheckIcon className="size-4" />
|
|
90
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
91
|
+
</span>
|
|
92
|
+
{children}
|
|
93
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function DropdownMenuRadioGroup({
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return (<DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function DropdownMenuRadioItem({
|
|
104
|
+
className,
|
|
105
|
+
children,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
return (
|
|
109
|
+
<DropdownMenuPrimitive.RadioItem
|
|
110
|
+
data-slot="dropdown-menu-radio-item"
|
|
111
|
+
className={cn(
|
|
112
|
+
"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",
|
|
113
|
+
className
|
|
114
|
+
)}
|
|
115
|
+
{...props}>
|
|
116
|
+
<span
|
|
117
|
+
className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
118
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
119
|
+
<CircleIcon className="size-2 fill-current" />
|
|
120
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
121
|
+
</span>
|
|
122
|
+
{children}
|
|
123
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function DropdownMenuLabel({
|
|
128
|
+
className,
|
|
129
|
+
inset,
|
|
130
|
+
...props
|
|
131
|
+
}) {
|
|
132
|
+
return (
|
|
133
|
+
<DropdownMenuPrimitive.Label
|
|
134
|
+
data-slot="dropdown-menu-label"
|
|
135
|
+
data-inset={inset}
|
|
136
|
+
className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)}
|
|
137
|
+
{...props} />
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function DropdownMenuSeparator({
|
|
142
|
+
className,
|
|
143
|
+
...props
|
|
144
|
+
}) {
|
|
145
|
+
return (
|
|
146
|
+
<DropdownMenuPrimitive.Separator
|
|
147
|
+
data-slot="dropdown-menu-separator"
|
|
148
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
149
|
+
{...props} />
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function DropdownMenuShortcut({
|
|
154
|
+
className,
|
|
155
|
+
...props
|
|
156
|
+
}) {
|
|
157
|
+
return (
|
|
158
|
+
<span
|
|
159
|
+
data-slot="dropdown-menu-shortcut"
|
|
160
|
+
className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)}
|
|
161
|
+
{...props} />
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function DropdownMenuSub({
|
|
166
|
+
...props
|
|
167
|
+
}) {
|
|
168
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function DropdownMenuSubTrigger({
|
|
172
|
+
className,
|
|
173
|
+
inset,
|
|
174
|
+
children,
|
|
175
|
+
...props
|
|
176
|
+
}) {
|
|
177
|
+
return (
|
|
178
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
179
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
180
|
+
data-inset={inset}
|
|
181
|
+
className={cn(
|
|
182
|
+
"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",
|
|
183
|
+
className
|
|
184
|
+
)}
|
|
185
|
+
{...props}>
|
|
186
|
+
{children}
|
|
187
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
188
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function DropdownMenuSubContent({
|
|
193
|
+
className,
|
|
194
|
+
...props
|
|
195
|
+
}) {
|
|
196
|
+
return (
|
|
197
|
+
<DropdownMenuPrimitive.SubContent
|
|
198
|
+
data-slot="dropdown-menu-sub-content"
|
|
199
|
+
className={cn(
|
|
200
|
+
"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-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
201
|
+
className
|
|
202
|
+
)}
|
|
203
|
+
{...props} />
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export {
|
|
208
|
+
DropdownMenu,
|
|
209
|
+
DropdownMenuPortal,
|
|
210
|
+
DropdownMenuTrigger,
|
|
211
|
+
DropdownMenuContent,
|
|
212
|
+
DropdownMenuGroup,
|
|
213
|
+
DropdownMenuLabel,
|
|
214
|
+
DropdownMenuItem,
|
|
215
|
+
DropdownMenuCheckboxItem,
|
|
216
|
+
DropdownMenuRadioGroup,
|
|
217
|
+
DropdownMenuRadioItem,
|
|
218
|
+
DropdownMenuSeparator,
|
|
219
|
+
DropdownMenuShortcut,
|
|
220
|
+
DropdownMenuSub,
|
|
221
|
+
DropdownMenuSubTrigger,
|
|
222
|
+
DropdownMenuSubContent,
|
|
223
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
function Input({
|
|
6
|
+
className,
|
|
7
|
+
type,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<input
|
|
12
|
+
type={type}
|
|
13
|
+
data-slot="input"
|
|
14
|
+
className={cn(
|
|
15
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
16
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
17
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props} />
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { Input }
|