blodemd 0.0.15 → 0.2.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 +26 -1
- package/dist/cli.mjs +217 -217
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -36
- package/dev-server/app/[[...slug]]/page.tsx +0 -140
- package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
- package/dev-server/app/blodemd-dev/version/route.ts +0 -14
- package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
- package/dev-server/app/error.tsx +0 -24
- package/dev-server/app/favicon.ico +0 -0
- package/dev-server/app/globals.css +0 -4
- package/dev-server/app/layout.tsx +0 -38
- package/dev-server/app/not-found.tsx +0 -18
- package/dev-server/app/search/route.ts +0 -17
- package/dev-server/components/dev-reload-script.tsx +0 -86
- package/dev-server/components/providers.tsx +0 -15
- package/dev-server/lib/dev-state.ts +0 -8
- package/dev-server/lib/local-content-source.ts +0 -103
- package/dev-server/lib/local-runtime.tsx +0 -555
- package/dev-server/next-env.d.ts +0 -5
- package/dev-server/next.config.js +0 -54
- package/dev-server/package.json +0 -61
- package/dev-server/postcss.config.mjs +0 -7
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +0 -50
- package/docs/app/globals.css +0 -471
- package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
- package/docs/components/api/api-playground.tsx +0 -467
- package/docs/components/api/api-reference.tsx +0 -157
- package/docs/components/content/collection-index.tsx +0 -114
- package/docs/components/docs/contextual-menu.tsx +0 -495
- package/docs/components/docs/copy-page-menu.tsx +0 -364
- package/docs/components/docs/doc-header.tsx +0 -223
- package/docs/components/docs/doc-shell.tsx +0 -355
- package/docs/components/docs/doc-sidebar.tsx +0 -256
- package/docs/components/docs/doc-toc.tsx +0 -46
- package/docs/components/docs/mobile-nav.tsx +0 -195
- package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
- package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
- package/docs/components/git/repo-picker.tsx +0 -529
- package/docs/components/icons/doc-icon.tsx +0 -96
- package/docs/components/mdx/accordion.tsx +0 -83
- package/docs/components/mdx/agent-instructions.tsx +0 -17
- package/docs/components/mdx/badge.tsx +0 -79
- package/docs/components/mdx/callout.tsx +0 -88
- package/docs/components/mdx/card.tsx +0 -110
- package/docs/components/mdx/code-block.tsx +0 -80
- package/docs/components/mdx/code-group.tsx +0 -203
- package/docs/components/mdx/color.tsx +0 -87
- package/docs/components/mdx/columns.tsx +0 -25
- package/docs/components/mdx/expandable.tsx +0 -45
- package/docs/components/mdx/field-layout.tsx +0 -77
- package/docs/components/mdx/frame.tsx +0 -23
- package/docs/components/mdx/get-text-content.ts +0 -18
- package/docs/components/mdx/icon.tsx +0 -12
- package/docs/components/mdx/iframe.tsx +0 -62
- package/docs/components/mdx/index.tsx +0 -121
- package/docs/components/mdx/installer.tsx +0 -20
- package/docs/components/mdx/panel.tsx +0 -11
- package/docs/components/mdx/param-field.tsx +0 -56
- package/docs/components/mdx/preview.tsx +0 -36
- package/docs/components/mdx/prompt.tsx +0 -63
- package/docs/components/mdx/request-example.tsx +0 -27
- package/docs/components/mdx/response-field.tsx +0 -42
- package/docs/components/mdx/steps.tsx +0 -92
- package/docs/components/mdx/tabs.tsx +0 -193
- package/docs/components/mdx/tile.tsx +0 -43
- package/docs/components/mdx/tooltip.tsx +0 -71
- package/docs/components/mdx/tree.tsx +0 -120
- package/docs/components/mdx/type-table.tsx +0 -71
- package/docs/components/mdx/update.tsx +0 -44
- package/docs/components/mdx/video.tsx +0 -45
- package/docs/components/mdx/view.tsx +0 -66
- package/docs/components/posthog-provider.tsx +0 -42
- package/docs/components/providers.tsx +0 -15
- package/docs/components/tenant-analytics.tsx +0 -49
- package/docs/components/third-parties.tsx +0 -32
- package/docs/components/ui/badge.tsx +0 -61
- package/docs/components/ui/breadcrumb.tsx +0 -112
- package/docs/components/ui/button-group.tsx +0 -83
- package/docs/components/ui/button.tsx +0 -65
- package/docs/components/ui/card.tsx +0 -92
- package/docs/components/ui/command.tsx +0 -167
- package/docs/components/ui/copy-button.tsx +0 -129
- package/docs/components/ui/dialog.tsx +0 -146
- package/docs/components/ui/field.tsx +0 -237
- package/docs/components/ui/input.tsx +0 -23
- package/docs/components/ui/kbd.tsx +0 -98
- package/docs/components/ui/label.tsx +0 -22
- package/docs/components/ui/morph-icon.tsx +0 -79
- package/docs/components/ui/popover.tsx +0 -267
- package/docs/components/ui/search-dialog.tsx +0 -431
- package/docs/components/ui/search.tsx +0 -101
- package/docs/components/ui/separator.tsx +0 -26
- package/docs/components/ui/sheet.tsx +0 -133
- package/docs/components/ui/sidebar.tsx +0 -758
- package/docs/components/ui/skeleton.tsx +0 -11
- package/docs/components/ui/switch.tsx +0 -32
- package/docs/components/ui/tabs.tsx +0 -138
- package/docs/components/ui/theme-toggle.tsx +0 -62
- package/docs/components/ui/tooltip.tsx +0 -53
- package/docs/components/web-mcp.tsx +0 -115
- package/docs/lib/agent-skills.ts +0 -48
- package/docs/lib/api-client.ts +0 -72
- package/docs/lib/config.ts +0 -6
- package/docs/lib/content-root.ts +0 -33
- package/docs/lib/content-source.ts +0 -70
- package/docs/lib/contextual-options.ts +0 -222
- package/docs/lib/dashboard-session.ts +0 -167
- package/docs/lib/db.ts +0 -13
- package/docs/lib/docs-collection.ts +0 -7
- package/docs/lib/docs-runtime.tsx +0 -745
- package/docs/lib/edge-config.ts +0 -95
- package/docs/lib/env.ts +0 -23
- package/docs/lib/etag.ts +0 -22
- package/docs/lib/github-install.ts +0 -33
- package/docs/lib/llms-full.ts +0 -82
- package/docs/lib/marketing-markdown.ts +0 -79
- package/docs/lib/marketing-site.ts +0 -31
- package/docs/lib/mdx.ts +0 -98
- package/docs/lib/navigation.ts +0 -288
- package/docs/lib/openapi-proxy.ts +0 -88
- package/docs/lib/openapi.ts +0 -158
- package/docs/lib/platform-config.ts +0 -6
- package/docs/lib/project-authz.ts +0 -46
- package/docs/lib/routes.ts +0 -103
- package/docs/lib/server-cache.ts +0 -83
- package/docs/lib/shiki.ts +0 -44
- package/docs/lib/supabase.ts +0 -37
- package/docs/lib/tenancy.ts +0 -364
- package/docs/lib/tenant-headers.ts +0 -43
- package/docs/lib/tenant-static.ts +0 -705
- package/docs/lib/tenant-utility-context.ts +0 -62
- package/docs/lib/tenants.ts +0 -72
- package/docs/lib/theme.ts +0 -29
- package/docs/lib/time-ago.ts +0 -24
- package/docs/lib/toc.ts +0 -2
- package/docs/lib/use-mobile.ts +0 -19
- package/docs/lib/use-tab-observer.ts +0 -71
- package/docs/lib/utils.ts +0 -5
- package/packages/@repo/common/dist/index.d.ts +0 -16
- package/packages/@repo/common/dist/index.d.ts.map +0 -1
- package/packages/@repo/common/dist/index.js +0 -84
- package/packages/@repo/common/package.json +0 -34
- package/packages/@repo/common/src/index.ts +0 -101
- package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
- package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/analytics.js +0 -18
- package/packages/@repo/contracts/dist/dates.d.ts +0 -4
- package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/dates.js +0 -2
- package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
- package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/deployment.js +0 -46
- package/packages/@repo/contracts/dist/domain.d.ts +0 -94
- package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/domain.js +0 -36
- package/packages/@repo/contracts/dist/git.d.ts +0 -28
- package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/git.js +0 -24
- package/packages/@repo/contracts/dist/ids.d.ts +0 -14
- package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/ids.js +0 -11
- package/packages/@repo/contracts/dist/index.d.ts +0 -11
- package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/index.js +0 -12
- package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
- package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/pagination.js +0 -15
- package/packages/@repo/contracts/dist/project.d.ts +0 -42
- package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/project.js +0 -25
- package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
- package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/tenant.js +0 -58
- package/packages/@repo/contracts/dist/user.d.ts +0 -9
- package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/user.js +0 -9
- package/packages/@repo/contracts/package.json +0 -37
- package/packages/@repo/contracts/src/analytics.ts +0 -33
- package/packages/@repo/contracts/src/dates.ts +0 -4
- package/packages/@repo/contracts/src/deployment.ts +0 -73
- package/packages/@repo/contracts/src/domain.ts +0 -51
- package/packages/@repo/contracts/src/git.ts +0 -31
- package/packages/@repo/contracts/src/ids.ts +0 -23
- package/packages/@repo/contracts/src/index.ts +0 -12
- package/packages/@repo/contracts/src/pagination.ts +0 -21
- package/packages/@repo/contracts/src/project.ts +0 -32
- package/packages/@repo/contracts/src/tenant.ts +0 -94
- package/packages/@repo/contracts/src/user.ts +0 -12
- package/packages/@repo/models/dist/docs-config.d.ts +0 -961
- package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
- package/packages/@repo/models/dist/docs-config.js +0 -531
- package/packages/@repo/models/dist/index.d.ts +0 -3
- package/packages/@repo/models/dist/index.d.ts.map +0 -1
- package/packages/@repo/models/dist/index.js +0 -3
- package/packages/@repo/models/dist/tenant.d.ts +0 -37
- package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/models/dist/tenant.js +0 -1
- package/packages/@repo/models/package.json +0 -37
- package/packages/@repo/models/src/docs-config.ts +0 -629
- package/packages/@repo/models/src/index.ts +0 -3
- package/packages/@repo/models/src/tenant.ts +0 -44
- package/packages/@repo/prebuild/dist/index.d.ts +0 -2
- package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/index.js +0 -2
- package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/openapi.js +0 -86
- package/packages/@repo/prebuild/package.json +0 -39
- package/packages/@repo/prebuild/src/index.ts +0 -2
- package/packages/@repo/prebuild/src/openapi.ts +0 -154
- package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/blob-source.js +0 -128
- package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
- package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/config-loader.js +0 -231
- package/packages/@repo/previewing/dist/constants.d.ts +0 -15
- package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/constants.js +0 -14
- package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-index.js +0 -291
- package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
- package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-source.js +0 -1
- package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/fs-source.js +0 -71
- package/packages/@repo/previewing/dist/index.d.ts +0 -16
- package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/index.js +0 -13
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
- package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
- package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/format.js +0 -43
- package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/links.js +0 -31
- package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
- package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
- package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
- package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/search-index.js +0 -23
- package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
- package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/serialization.js +0 -108
- package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
- package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/toc-index.js +0 -53
- package/packages/@repo/previewing/dist/types.d.ts +0 -92
- package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/types.js +0 -1
- package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/utility-index.js +0 -201
- package/packages/@repo/previewing/package.json +0 -41
- package/packages/@repo/previewing/src/blob-source.ts +0 -185
- package/packages/@repo/previewing/src/config-loader.ts +0 -316
- package/packages/@repo/previewing/src/constants.ts +0 -16
- package/packages/@repo/previewing/src/content-index.ts +0 -384
- package/packages/@repo/previewing/src/content-source.ts +0 -12
- package/packages/@repo/previewing/src/fs-source.ts +0 -103
- package/packages/@repo/previewing/src/index.ts +0 -71
- package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
- package/packages/@repo/previewing/src/markdown/format.ts +0 -63
- package/packages/@repo/previewing/src/markdown/links.ts +0 -46
- package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
- package/packages/@repo/previewing/src/search-index.ts +0 -38
- package/packages/@repo/previewing/src/serialization.ts +0 -191
- package/packages/@repo/previewing/src/toc-index.ts +0 -72
- package/packages/@repo/previewing/src/types.ts +0 -105
- package/packages/@repo/previewing/src/utility-index.ts +0 -304
- package/packages/@repo/validation/dist/index.d.ts +0 -12
- package/packages/@repo/validation/dist/index.d.ts.map +0 -1
- package/packages/@repo/validation/dist/index.js +0 -30
- package/packages/@repo/validation/package.json +0 -38
- package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
- package/packages/@repo/validation/src/index.ts +0 -59
- package/scripts/prepare-package.mjs +0 -53
- package/scripts/repo-packages.mjs +0 -8
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { SearchIcon } from "blode-icons-react";
|
|
4
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
-
import type * as React from "react";
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Dialog,
|
|
9
|
-
DialogContent,
|
|
10
|
-
DialogDescription,
|
|
11
|
-
DialogHeader,
|
|
12
|
-
DialogTitle,
|
|
13
|
-
} from "@/components/ui/dialog";
|
|
14
|
-
import { cn } from "@/lib/utils";
|
|
15
|
-
|
|
16
|
-
const Command = ({
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: React.ComponentProps<typeof CommandPrimitive>) => (
|
|
20
|
-
<CommandPrimitive
|
|
21
|
-
className={cn(
|
|
22
|
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
data-slot="command"
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const CommandDialog = ({
|
|
31
|
-
title = "Command Palette",
|
|
32
|
-
description = "Search for a command to run...",
|
|
33
|
-
children,
|
|
34
|
-
className,
|
|
35
|
-
showCloseButton = true,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
38
|
-
title?: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
children?: React.ReactNode;
|
|
41
|
-
className?: string;
|
|
42
|
-
showCloseButton?: boolean;
|
|
43
|
-
} & Omit<React.ComponentProps<typeof Dialog>, "children">) => (
|
|
44
|
-
<Dialog {...props}>
|
|
45
|
-
<DialogHeader className="sr-only">
|
|
46
|
-
<DialogTitle>{title}</DialogTitle>
|
|
47
|
-
<DialogDescription>{description}</DialogDescription>
|
|
48
|
-
</DialogHeader>
|
|
49
|
-
<DialogContent
|
|
50
|
-
className={cn("overflow-hidden p-0", className)}
|
|
51
|
-
showCloseButton={showCloseButton}
|
|
52
|
-
>
|
|
53
|
-
<Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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">
|
|
54
|
-
{children}
|
|
55
|
-
</Command>
|
|
56
|
-
</DialogContent>
|
|
57
|
-
</Dialog>
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const CommandInput = ({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>) => (
|
|
64
|
-
<div
|
|
65
|
-
className="flex h-9 items-center gap-2 border-b px-3"
|
|
66
|
-
data-slot="command-input-wrapper"
|
|
67
|
-
>
|
|
68
|
-
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
69
|
-
<CommandPrimitive.Input
|
|
70
|
-
className={cn(
|
|
71
|
-
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
72
|
-
className
|
|
73
|
-
)}
|
|
74
|
-
data-slot="command-input"
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const CommandList = ({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<typeof CommandPrimitive.List>) => (
|
|
84
|
-
<CommandPrimitive.List
|
|
85
|
-
className={cn(
|
|
86
|
-
"max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",
|
|
87
|
-
className
|
|
88
|
-
)}
|
|
89
|
-
data-slot="command-list"
|
|
90
|
-
{...props}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const CommandEmpty = ({
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<typeof CommandPrimitive.Empty>) => (
|
|
97
|
-
<CommandPrimitive.Empty
|
|
98
|
-
className="py-6 text-center text-sm"
|
|
99
|
-
data-slot="command-empty"
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
const CommandGroup = ({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof CommandPrimitive.Group>) => (
|
|
108
|
-
<CommandPrimitive.Group
|
|
109
|
-
className={cn(
|
|
110
|
-
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
|
|
111
|
-
className
|
|
112
|
-
)}
|
|
113
|
-
data-slot="command-group"
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const CommandSeparator = ({
|
|
119
|
-
className,
|
|
120
|
-
...props
|
|
121
|
-
}: React.ComponentProps<typeof CommandPrimitive.Separator>) => (
|
|
122
|
-
<CommandPrimitive.Separator
|
|
123
|
-
className={cn("-mx-1 h-px bg-border", className)}
|
|
124
|
-
data-slot="command-separator"
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
const CommandItem = ({
|
|
130
|
-
className,
|
|
131
|
-
...props
|
|
132
|
-
}: React.ComponentProps<typeof CommandPrimitive.Item>) => (
|
|
133
|
-
<CommandPrimitive.Item
|
|
134
|
-
className={cn(
|
|
135
|
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
136
|
-
className
|
|
137
|
-
)}
|
|
138
|
-
data-slot="command-item"
|
|
139
|
-
{...props}
|
|
140
|
-
/>
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
const CommandShortcut = ({
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}: React.ComponentProps<"span">) => (
|
|
147
|
-
<span
|
|
148
|
-
className={cn(
|
|
149
|
-
"ml-auto text-muted-foreground text-xs tracking-widest",
|
|
150
|
-
className
|
|
151
|
-
)}
|
|
152
|
-
data-slot="command-shortcut"
|
|
153
|
-
{...props}
|
|
154
|
-
/>
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
export {
|
|
158
|
-
Command,
|
|
159
|
-
CommandDialog,
|
|
160
|
-
CommandInput,
|
|
161
|
-
CommandList,
|
|
162
|
-
CommandEmpty,
|
|
163
|
-
CommandGroup,
|
|
164
|
-
CommandItem,
|
|
165
|
-
CommandShortcut,
|
|
166
|
-
CommandSeparator,
|
|
167
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Checkmark1Icon as CheckIcon,
|
|
5
|
-
CopySimpleIcon as CopyIcon,
|
|
6
|
-
} from "blode-icons-react";
|
|
7
|
-
import { cva } from "class-variance-authority";
|
|
8
|
-
import type { VariantProps } from "class-variance-authority";
|
|
9
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
10
|
-
import type { MouseEvent } from "react";
|
|
11
|
-
|
|
12
|
-
import { Button as ButtonPrimitive } from "@/components/animate-ui/primitives/buttons/button";
|
|
13
|
-
import type { ButtonProps as ButtonPrimitiveProps } from "@/components/animate-ui/primitives/buttons/button";
|
|
14
|
-
import { useControlledState } from "@/hooks/use-controlled-state";
|
|
15
|
-
import { cn } from "@/lib/utils";
|
|
16
|
-
|
|
17
|
-
const buttonVariants = cva(
|
|
18
|
-
"flex shrink-0 items-center justify-center rounded-md outline-none transition-[box-shadow,_color,_background-color,_border-color,_outline-color,_text-decoration-color,_fill,_stroke] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
19
|
-
{
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
size: "default",
|
|
22
|
-
variant: "default",
|
|
23
|
-
},
|
|
24
|
-
variants: {
|
|
25
|
-
size: {
|
|
26
|
-
default: "size-9",
|
|
27
|
-
lg: "size-10 rounded-md",
|
|
28
|
-
sm: "size-8 rounded-md",
|
|
29
|
-
xs: "size-7 rounded-md [&_svg:not([class*='size-'])]:size-3.5",
|
|
30
|
-
},
|
|
31
|
-
variant: {
|
|
32
|
-
accent: "bg-accent text-accent-foreground hover:bg-accent/90",
|
|
33
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
34
|
-
destructive:
|
|
35
|
-
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
36
|
-
ghost:
|
|
37
|
-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
38
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
39
|
-
outline:
|
|
40
|
-
"border bg-background hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
41
|
-
secondary:
|
|
42
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
type CopyButtonProps = Omit<ButtonPrimitiveProps, "children"> &
|
|
49
|
-
VariantProps<typeof buttonVariants> & {
|
|
50
|
-
content: string;
|
|
51
|
-
copied?: boolean;
|
|
52
|
-
delay?: number;
|
|
53
|
-
onCopiedChange?: (copied: boolean, content?: string) => void;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const CopyButton = ({
|
|
57
|
-
className,
|
|
58
|
-
content,
|
|
59
|
-
copied,
|
|
60
|
-
onCopiedChange,
|
|
61
|
-
onClick,
|
|
62
|
-
variant,
|
|
63
|
-
size,
|
|
64
|
-
delay = 3000,
|
|
65
|
-
...props
|
|
66
|
-
}: CopyButtonProps) => {
|
|
67
|
-
const [isCopied, setIsCopied] = useControlledState({
|
|
68
|
-
onChange: onCopiedChange,
|
|
69
|
-
value: copied,
|
|
70
|
-
});
|
|
71
|
-
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
72
|
-
|
|
73
|
-
useEffect(
|
|
74
|
-
() => () => {
|
|
75
|
-
if (timeoutRef.current) {
|
|
76
|
-
clearTimeout(timeoutRef.current);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[]
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
const handleCopy = useCallback(
|
|
83
|
-
async (e: MouseEvent<HTMLButtonElement>) => {
|
|
84
|
-
onClick?.(e);
|
|
85
|
-
if (copied) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (content) {
|
|
89
|
-
try {
|
|
90
|
-
await navigator.clipboard.writeText(content);
|
|
91
|
-
setIsCopied(true);
|
|
92
|
-
onCopiedChange?.(true, content);
|
|
93
|
-
if (timeoutRef.current) {
|
|
94
|
-
clearTimeout(timeoutRef.current);
|
|
95
|
-
}
|
|
96
|
-
timeoutRef.current = setTimeout(() => {
|
|
97
|
-
setIsCopied(false);
|
|
98
|
-
onCopiedChange?.(false);
|
|
99
|
-
}, delay);
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.error("Error copying command", error);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
[onClick, copied, content, setIsCopied, onCopiedChange, delay]
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<ButtonPrimitive
|
|
112
|
-
className={cn(buttonVariants({ className, size, variant }))}
|
|
113
|
-
data-slot="copy-button"
|
|
114
|
-
onClick={handleCopy}
|
|
115
|
-
{...props}
|
|
116
|
-
>
|
|
117
|
-
<span
|
|
118
|
-
aria-hidden="true"
|
|
119
|
-
className="inline-flex animate-in fade-in-0 zoom-in-95 duration-200 motion-reduce:animate-none"
|
|
120
|
-
data-slot="copy-button-icon"
|
|
121
|
-
key={isCopied ? "check" : "copy"}
|
|
122
|
-
>
|
|
123
|
-
<Icon />
|
|
124
|
-
</span>
|
|
125
|
-
</ButtonPrimitive>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export { CopyButton };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { XIcon } from "blode-icons-react";
|
|
4
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
|
|
7
|
-
import { Button } from "@/components/ui/button";
|
|
8
|
-
import { cn } from "@/lib/utils";
|
|
9
|
-
|
|
10
|
-
const Dialog = ({
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof DialogPrimitive.Root>) => (
|
|
13
|
-
<DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const DialogTrigger = ({
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) => (
|
|
19
|
-
<DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const DialogPortal = ({
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<typeof DialogPrimitive.Portal>) => (
|
|
25
|
-
<DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const DialogClose = ({
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof DialogPrimitive.Close>) => (
|
|
31
|
-
<DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const DialogOverlay = ({
|
|
35
|
-
className,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) => (
|
|
38
|
-
<DialogPrimitive.Overlay
|
|
39
|
-
data-slot="dialog-overlay"
|
|
40
|
-
className={cn(
|
|
41
|
-
"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const DialogContent = ({
|
|
49
|
-
className,
|
|
50
|
-
children,
|
|
51
|
-
showCloseButton = true,
|
|
52
|
-
...props
|
|
53
|
-
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
54
|
-
showCloseButton?: boolean;
|
|
55
|
-
}) => (
|
|
56
|
-
<DialogPortal data-slot="dialog-portal">
|
|
57
|
-
<DialogOverlay />
|
|
58
|
-
<DialogPrimitive.Content
|
|
59
|
-
data-slot="dialog-content"
|
|
60
|
-
className={cn(
|
|
61
|
-
"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 bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
{showCloseButton && (
|
|
68
|
-
<DialogPrimitive.Close
|
|
69
|
-
data-slot="dialog-close"
|
|
70
|
-
className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
71
|
-
>
|
|
72
|
-
<XIcon />
|
|
73
|
-
<span className="sr-only">Close</span>
|
|
74
|
-
</DialogPrimitive.Close>
|
|
75
|
-
)}
|
|
76
|
-
</DialogPrimitive.Content>
|
|
77
|
-
</DialogPortal>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const DialogHeader = ({ className, ...props }: React.ComponentProps<"div">) => (
|
|
81
|
-
<div
|
|
82
|
-
data-slot="dialog-header"
|
|
83
|
-
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const DialogFooter = ({
|
|
89
|
-
className,
|
|
90
|
-
showCloseButton = false,
|
|
91
|
-
children,
|
|
92
|
-
...props
|
|
93
|
-
}: React.ComponentProps<"div"> & {
|
|
94
|
-
showCloseButton?: boolean;
|
|
95
|
-
}) => (
|
|
96
|
-
<div
|
|
97
|
-
data-slot="dialog-footer"
|
|
98
|
-
className={cn(
|
|
99
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
100
|
-
className
|
|
101
|
-
)}
|
|
102
|
-
{...props}
|
|
103
|
-
>
|
|
104
|
-
{children}
|
|
105
|
-
{showCloseButton && (
|
|
106
|
-
<DialogPrimitive.Close asChild>
|
|
107
|
-
<Button variant="outline">Close</Button>
|
|
108
|
-
</DialogPrimitive.Close>
|
|
109
|
-
)}
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const DialogTitle = ({
|
|
114
|
-
className,
|
|
115
|
-
...props
|
|
116
|
-
}: React.ComponentProps<typeof DialogPrimitive.Title>) => (
|
|
117
|
-
<DialogPrimitive.Title
|
|
118
|
-
data-slot="dialog-title"
|
|
119
|
-
className={cn("text-lg leading-none font-semibold", className)}
|
|
120
|
-
{...props}
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
const DialogDescription = ({
|
|
125
|
-
className,
|
|
126
|
-
...props
|
|
127
|
-
}: React.ComponentProps<typeof DialogPrimitive.Description>) => (
|
|
128
|
-
<DialogPrimitive.Description
|
|
129
|
-
data-slot="dialog-description"
|
|
130
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
131
|
-
{...props}
|
|
132
|
-
/>
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
export {
|
|
136
|
-
Dialog,
|
|
137
|
-
DialogClose,
|
|
138
|
-
DialogContent,
|
|
139
|
-
DialogDescription,
|
|
140
|
-
DialogFooter,
|
|
141
|
-
DialogHeader,
|
|
142
|
-
DialogOverlay,
|
|
143
|
-
DialogPortal,
|
|
144
|
-
DialogTitle,
|
|
145
|
-
DialogTrigger,
|
|
146
|
-
};
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import type { VariantProps } from "class-variance-authority";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
|
|
7
|
-
import { Label } from "@/components/ui/label";
|
|
8
|
-
import { Separator } from "@/components/ui/separator";
|
|
9
|
-
import { cn } from "@/lib/utils";
|
|
10
|
-
|
|
11
|
-
const FieldSet = ({
|
|
12
|
-
className,
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<"fieldset">) => (
|
|
15
|
-
<fieldset
|
|
16
|
-
className={cn(
|
|
17
|
-
"flex flex-col gap-6",
|
|
18
|
-
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
19
|
-
className
|
|
20
|
-
)}
|
|
21
|
-
data-slot="field-set"
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const FieldLegend = ({
|
|
27
|
-
className,
|
|
28
|
-
variant = "legend",
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) => (
|
|
31
|
-
<legend
|
|
32
|
-
className={cn(
|
|
33
|
-
"mb-3 font-medium",
|
|
34
|
-
"data-[variant=legend]:text-base",
|
|
35
|
-
"data-[variant=label]:text-sm",
|
|
36
|
-
className
|
|
37
|
-
)}
|
|
38
|
-
data-slot="field-legend"
|
|
39
|
-
data-variant={variant}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const FieldGroup = ({ className, ...props }: React.ComponentProps<"div">) => (
|
|
45
|
-
<div
|
|
46
|
-
className={cn(
|
|
47
|
-
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
48
|
-
className
|
|
49
|
-
)}
|
|
50
|
-
data-slot="field-group"
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const fieldVariants = cva(
|
|
56
|
-
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
57
|
-
{
|
|
58
|
-
defaultVariants: {
|
|
59
|
-
orientation: "vertical",
|
|
60
|
-
},
|
|
61
|
-
variants: {
|
|
62
|
-
orientation: {
|
|
63
|
-
horizontal: [
|
|
64
|
-
"flex-row items-center",
|
|
65
|
-
"[&>[data-slot=field-label]]:flex-auto",
|
|
66
|
-
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
67
|
-
],
|
|
68
|
-
responsive: [
|
|
69
|
-
"@md/field-group:flex-row flex-col @md/field-group:items-center @md/field-group:[&>*]:w-auto [&>*]:w-full [&>.sr-only]:w-auto",
|
|
70
|
-
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
71
|
-
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
72
|
-
],
|
|
73
|
-
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const Field = ({
|
|
80
|
-
className,
|
|
81
|
-
orientation = "vertical",
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) => (
|
|
84
|
-
<div
|
|
85
|
-
className={cn(fieldVariants({ orientation }), className)}
|
|
86
|
-
data-orientation={orientation}
|
|
87
|
-
data-slot="field"
|
|
88
|
-
role="group"
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
const FieldContent = ({ className, ...props }: React.ComponentProps<"div">) => (
|
|
94
|
-
<div
|
|
95
|
-
className={cn(
|
|
96
|
-
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
97
|
-
className
|
|
98
|
-
)}
|
|
99
|
-
data-slot="field-content"
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
const FieldLabel = ({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof Label>) => (
|
|
108
|
-
<Label
|
|
109
|
-
className={cn(
|
|
110
|
-
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
111
|
-
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
|
|
112
|
-
"has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",
|
|
113
|
-
className
|
|
114
|
-
)}
|
|
115
|
-
data-slot="field-label"
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
const FieldTitle = ({ className, ...props }: React.ComponentProps<"div">) => (
|
|
121
|
-
<div
|
|
122
|
-
className={cn(
|
|
123
|
-
"flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
124
|
-
className
|
|
125
|
-
)}
|
|
126
|
-
data-slot="field-label"
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
const FieldDescription = ({
|
|
132
|
-
className,
|
|
133
|
-
...props
|
|
134
|
-
}: React.ComponentProps<"p">) => (
|
|
135
|
-
<p
|
|
136
|
-
className={cn(
|
|
137
|
-
"font-normal text-muted-foreground text-sm leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
138
|
-
"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
|
|
139
|
-
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
140
|
-
className
|
|
141
|
-
)}
|
|
142
|
-
data-slot="field-description"
|
|
143
|
-
{...props}
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const FieldSeparator = ({
|
|
148
|
-
children,
|
|
149
|
-
className,
|
|
150
|
-
...props
|
|
151
|
-
}: React.ComponentProps<"div"> & {
|
|
152
|
-
children?: React.ReactNode;
|
|
153
|
-
}) => (
|
|
154
|
-
<div
|
|
155
|
-
className={cn(
|
|
156
|
-
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
157
|
-
className
|
|
158
|
-
)}
|
|
159
|
-
data-content={!!children}
|
|
160
|
-
data-slot="field-separator"
|
|
161
|
-
{...props}
|
|
162
|
-
>
|
|
163
|
-
<Separator className="absolute inset-0 top-1/2" />
|
|
164
|
-
{children && (
|
|
165
|
-
<span
|
|
166
|
-
className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"
|
|
167
|
-
data-slot="field-separator-content"
|
|
168
|
-
>
|
|
169
|
-
{children}
|
|
170
|
-
</span>
|
|
171
|
-
)}
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
const FieldError = ({
|
|
176
|
-
className,
|
|
177
|
-
children,
|
|
178
|
-
errors,
|
|
179
|
-
...props
|
|
180
|
-
}: React.ComponentProps<"div"> & {
|
|
181
|
-
errors?: ({ message?: string } | undefined)[];
|
|
182
|
-
}) => {
|
|
183
|
-
const content = useMemo(() => {
|
|
184
|
-
if (children) {
|
|
185
|
-
return children;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (!errors?.length) {
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const uniqueErrors = [
|
|
193
|
-
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
194
|
-
];
|
|
195
|
-
|
|
196
|
-
if (uniqueErrors?.length === 1) {
|
|
197
|
-
return uniqueErrors[0]?.message;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return (
|
|
201
|
-
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
202
|
-
{uniqueErrors.map(
|
|
203
|
-
(error) =>
|
|
204
|
-
error?.message && <li key={error.message}>{error.message}</li>
|
|
205
|
-
)}
|
|
206
|
-
</ul>
|
|
207
|
-
);
|
|
208
|
-
}, [children, errors]);
|
|
209
|
-
|
|
210
|
-
if (!content) {
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return (
|
|
215
|
-
<div
|
|
216
|
-
className={cn("font-normal text-destructive text-sm", className)}
|
|
217
|
-
data-slot="field-error"
|
|
218
|
-
role="alert"
|
|
219
|
-
{...props}
|
|
220
|
-
>
|
|
221
|
-
{content}
|
|
222
|
-
</div>
|
|
223
|
-
);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
export {
|
|
227
|
-
Field,
|
|
228
|
-
FieldLabel,
|
|
229
|
-
FieldDescription,
|
|
230
|
-
FieldError,
|
|
231
|
-
FieldGroup,
|
|
232
|
-
FieldLegend,
|
|
233
|
-
FieldSeparator,
|
|
234
|
-
FieldSet,
|
|
235
|
-
FieldContent,
|
|
236
|
-
FieldTitle,
|
|
237
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
const Input = ({
|
|
6
|
-
className,
|
|
7
|
-
type,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<"input">) => (
|
|
10
|
-
<input
|
|
11
|
-
type={type}
|
|
12
|
-
data-slot="input"
|
|
13
|
-
className={cn(
|
|
14
|
-
"h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
|
|
15
|
-
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
16
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export { Input };
|