ruler-components 0.1.1 → 0.1.3
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/dist/index.d.mts +458 -0
- package/dist/index.d.ts +458 -0
- package/dist/index.js +3618 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3467 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -2
- package/AGENTS.md +0 -9
- package/CLAUDE.md +0 -1
- package/app/docs/[slug]/page.tsx +0 -147
- package/app/docs/layout.tsx +0 -26
- package/app/docs/page.tsx +0 -148
- package/app/favicon.ico +0 -0
- package/app/globals.css +0 -168
- package/app/icon.png +0 -0
- package/app/layout.tsx +0 -90
- package/app/opengraph-image.tsx +0 -10
- package/app/page.tsx +0 -34
- package/app/twitter-image.tsx +0 -10
- package/components/docs/accordion-doc-page.tsx +0 -352
- package/components/docs/alert-doc-page.tsx +0 -293
- package/components/docs/allinput-doc-page.tsx +0 -183
- package/components/docs/avatar-doc-page.tsx +0 -424
- package/components/docs/badge-doc-page.tsx +0 -363
- package/components/docs/button-doc-page.tsx +0 -406
- package/components/docs/card-doc-page.tsx +0 -364
- package/components/docs/checkbox-doc-page.tsx +0 -277
- package/components/docs/colors-doc-page.tsx +0 -430
- package/components/docs/dialog-doc-page.tsx +0 -364
- package/components/docs/docs-footer.tsx +0 -11
- package/components/docs/docs-mobile-menu-bar.tsx +0 -22
- package/components/docs/docs-mobile-nav-context.tsx +0 -27
- package/components/docs/docs-page.tsx +0 -263
- package/components/docs/docs-search.tsx +0 -303
- package/components/docs/docs-sidebar.tsx +0 -165
- package/components/docs/docs-topbar.tsx +0 -32
- package/components/docs/dropdown-doc-page.tsx +0 -522
- package/components/docs/getting-started-doc-page.tsx +0 -205
- package/components/docs/label-doc-page.tsx +0 -173
- package/components/docs/loaders-doc-page.tsx +0 -244
- package/components/docs/menu-doc-page.tsx +0 -373
- package/components/docs/modal-doc-page.tsx +0 -436
- package/components/docs/next-steps.tsx +0 -53
- package/components/docs/pagination-doc-page.tsx +0 -316
- package/components/docs/progress-doc-page.tsx +0 -387
- package/components/docs/radio-doc-page.tsx +0 -270
- package/components/docs/skeleton-doc-page.tsx +0 -230
- package/components/docs/stepper-doc-page.tsx +0 -309
- package/components/docs/switch-doc-page.tsx +0 -264
- package/components/docs/table-doc-page.tsx +0 -689
- package/components/docs/tabs-doc-page.tsx +0 -359
- package/components/docs/theming-doc-page.tsx +0 -243
- package/components/docs/tooltip-doc-page.tsx +0 -357
- package/components/docs/usage-section.tsx +0 -21
- package/components/icons/discord.tsx +0 -9
- package/components/icons/github.tsx +0 -9
- package/components/icons/x.tsx +0 -9
- package/components/installation-section.tsx +0 -34
- package/components/landing/feature-highlights.tsx +0 -105
- package/components/landing/footer-strip.tsx +0 -45
- package/components/landing/hero-card.tsx +0 -14
- package/components/landing/hero-spotlight.tsx +0 -126
- package/components/landing/hero.tsx +0 -64
- package/components/landing/navbar.tsx +0 -44
- package/components/landing/quick-start-section.tsx +0 -59
- package/components/landing/site-footer.tsx +0 -55
- package/components/theme-provider.tsx +0 -60
- package/components/ui/accordion.tsx +0 -174
- package/components/ui/alert.tsx +0 -103
- package/components/ui/allinput.tsx +0 -210
- package/components/ui/avatar.tsx +0 -179
- package/components/ui/badge.tsx +0 -52
- package/components/ui/button.tsx +0 -75
- package/components/ui/card.tsx +0 -105
- package/components/ui/checkbox.tsx +0 -130
- package/components/ui/code-block.tsx +0 -60
- package/components/ui/data-table.tsx +0 -235
- package/components/ui/dialog.tsx +0 -173
- package/components/ui/dropdown.tsx +0 -78
- package/components/ui/feature-card.tsx +0 -38
- package/components/ui/input.tsx +0 -44
- package/components/ui/label.tsx +0 -110
- package/components/ui/loaders.tsx +0 -139
- package/components/ui/menu.tsx +0 -118
- package/components/ui/modal.tsx +0 -399
- package/components/ui/package-manager-tabs.tsx +0 -40
- package/components/ui/pagination.tsx +0 -200
- package/components/ui/progress.tsx +0 -134
- package/components/ui/radio.tsx +0 -262
- package/components/ui/skeleton.tsx +0 -102
- package/components/ui/steppers.tsx +0 -309
- package/components/ui/switch.tsx +0 -153
- package/components/ui/table.tsx +0 -58
- package/components/ui/tabs.tsx +0 -166
- package/components/ui/theme-toggle.tsx +0 -60
- package/components/ui/tooltip.tsx +0 -238
- package/data/color-palette.ts +0 -35
- package/data/docs-nav.ts +0 -84
- package/eslint.config.mjs +0 -18
- package/index.ts +0 -8
- package/lib/cn.ts +0 -4
- package/lib/color.ts +0 -85
- package/lib/og-image.tsx +0 -138
- package/lib/theme.ts +0 -33
- package/next.config.ts +0 -7
- package/postcss.config.mjs +0 -7
- package/public/dark.png +0 -0
- package/public/dark1.png +0 -0
- package/public/dark2.png +0 -0
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/light.png +0 -0
- package/public/light1.png +0 -0
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/video/hero-demo.mp4 +0 -0
- package/public/window.svg +0 -1
- package/tsconfig.json +0 -34
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import {
|
|
5
|
-
AlertTriangle,
|
|
6
|
-
Check,
|
|
7
|
-
Copy,
|
|
8
|
-
Layers,
|
|
9
|
-
Mail,
|
|
10
|
-
UserPlus,
|
|
11
|
-
} from "lucide-react";
|
|
12
|
-
import { Button } from "@/components/ui/button";
|
|
13
|
-
import { Badge } from "@/components/ui/badge";
|
|
14
|
-
import { Input } from "@/components/ui/input";
|
|
15
|
-
import { Tooltip } from "@/components/ui/tooltip";
|
|
16
|
-
import {
|
|
17
|
-
Card,
|
|
18
|
-
CardContent,
|
|
19
|
-
CardDescription,
|
|
20
|
-
CardHeader,
|
|
21
|
-
CardTitle,
|
|
22
|
-
} from "@/components/ui/card";
|
|
23
|
-
import {
|
|
24
|
-
DocsAccessibility,
|
|
25
|
-
DocsApiSection,
|
|
26
|
-
DocsApiTable,
|
|
27
|
-
DocsDemoPanel,
|
|
28
|
-
DocsPage,
|
|
29
|
-
DocsPageHeader,
|
|
30
|
-
DocsSection,
|
|
31
|
-
DocsSectionGrid,
|
|
32
|
-
} from "@/components/docs/docs-page";
|
|
33
|
-
import {
|
|
34
|
-
Modal,
|
|
35
|
-
ModalBody,
|
|
36
|
-
ModalClose,
|
|
37
|
-
ModalContent,
|
|
38
|
-
ModalDescription,
|
|
39
|
-
ModalFooter,
|
|
40
|
-
ModalHeader,
|
|
41
|
-
ModalOption,
|
|
42
|
-
ModalTitle,
|
|
43
|
-
ModalTrigger,
|
|
44
|
-
} from "@/components/ui/modal";
|
|
45
|
-
import { cn } from "@/lib/cn";
|
|
46
|
-
|
|
47
|
-
const API_ROWS = [
|
|
48
|
-
{ prop: "open", type: "boolean", default: "—", description: "Controlled open state" },
|
|
49
|
-
{ prop: "onOpenChange", type: "(open: boolean) => void", default: "—", description: "Callback when open state changes" },
|
|
50
|
-
{ prop: "defaultOpen", type: "boolean", default: "false", description: "Uncontrolled initial open state" },
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const CONTENT_API_ROWS = [
|
|
54
|
-
{ prop: "size", type: '"sm" | "md" | "lg" | "xl"', default: '"md"', description: "Maximum width of the modal" },
|
|
55
|
-
{ prop: "showCloseButton", type: "boolean", default: "true", description: "Shows the top-right close button" },
|
|
56
|
-
{ prop: "onClose", type: "() => void", default: "—", description: "Callback fired when modal closes" },
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
const ACCESSIBILITY_ITEMS = [
|
|
60
|
-
"Uses role=\"dialog\" and aria-modal for screen readers.",
|
|
61
|
-
"Closes on Escape key and backdrop click.",
|
|
62
|
-
"Focus moves into the modal when opened.",
|
|
63
|
-
"Provide a clear title and description for context.",
|
|
64
|
-
"Destructive actions should use explicit confirmation labels.",
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
type PlaygroundSize = "sm" | "md" | "lg" | "xl";
|
|
68
|
-
|
|
69
|
-
const PLAYGROUND_SIZES: PlaygroundSize[] = ["sm", "md", "lg", "xl"];
|
|
70
|
-
|
|
71
|
-
function codeFor(size: PlaygroundSize, showCloseButton: boolean) {
|
|
72
|
-
const props = [size !== "md" && `size="${size}"`, !showCloseButton && "showCloseButton={false}"]
|
|
73
|
-
.filter(Boolean)
|
|
74
|
-
.join(" ");
|
|
75
|
-
const open = props ? `<ModalContent ${props}>` : "<ModalContent>";
|
|
76
|
-
return `<Modal>
|
|
77
|
-
<ModalTrigger asChild>
|
|
78
|
-
<Button>Open modal</Button>
|
|
79
|
-
</ModalTrigger>
|
|
80
|
-
${open}
|
|
81
|
-
<ModalHeader>
|
|
82
|
-
<ModalTitle>Publish changes?</ModalTitle>
|
|
83
|
-
<ModalDescription>
|
|
84
|
-
Your updates will be visible to everyone on the live site.
|
|
85
|
-
</ModalDescription>
|
|
86
|
-
</ModalHeader>
|
|
87
|
-
<ModalBody>
|
|
88
|
-
<p>Review your changes before publishing.</p>
|
|
89
|
-
</ModalBody>
|
|
90
|
-
<ModalFooter>
|
|
91
|
-
<ModalClose asChild>
|
|
92
|
-
<Button variant="ghost" size="sm">Cancel</Button>
|
|
93
|
-
</ModalClose>
|
|
94
|
-
<Button size="sm">Publish</Button>
|
|
95
|
-
</ModalFooter>
|
|
96
|
-
</ModalContent>
|
|
97
|
-
</Modal>`;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function ModalDocPage() {
|
|
101
|
-
const [inviteOpen, setInviteOpen] = React.useState(false);
|
|
102
|
-
const [deleteOpen, setDeleteOpen] = React.useState(false);
|
|
103
|
-
const [playgroundOpen, setPlaygroundOpen] = React.useState(false);
|
|
104
|
-
const [size, setSize] = React.useState<PlaygroundSize>("md");
|
|
105
|
-
const [showCloseButton, setShowCloseButton] = React.useState(true);
|
|
106
|
-
const [copied, setCopied] = React.useState(false);
|
|
107
|
-
|
|
108
|
-
const snippet = codeFor(size, showCloseButton);
|
|
109
|
-
|
|
110
|
-
function copySnippet() {
|
|
111
|
-
navigator.clipboard.writeText(snippet).catch(() => {});
|
|
112
|
-
setCopied(true);
|
|
113
|
-
setTimeout(() => setCopied(false), 1200);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<DocsPage>
|
|
118
|
-
<DocsPageHeader
|
|
119
|
-
icon={Layers}
|
|
120
|
-
title="Modal"
|
|
121
|
-
description="Focuses attention on a task or decision — overlays the page with a dismissible dialog surface."
|
|
122
|
-
/>
|
|
123
|
-
|
|
124
|
-
<DocsSection
|
|
125
|
-
first
|
|
126
|
-
title="Playground"
|
|
127
|
-
description="Open the modal and try every size and close-button combination — with the exact markup to match."
|
|
128
|
-
>
|
|
129
|
-
<div className="overflow-hidden rounded-2xl border border-zinc-200 shadow-[0_2px_8px_rgba(0,0,0,0.04)] dark:border-zinc-800 dark:shadow-[0_2px_8px_rgba(0,0,0,0.2)]">
|
|
130
|
-
<div className="relative flex min-h-[11rem] items-center justify-center overflow-hidden bg-zinc-50 p-6 dark:bg-zinc-900/40">
|
|
131
|
-
<div
|
|
132
|
-
aria-hidden
|
|
133
|
-
className="pointer-events-none absolute inset-0 opacity-[0.4] dark:opacity-[0.15]"
|
|
134
|
-
style={{
|
|
135
|
-
backgroundImage:
|
|
136
|
-
"linear-gradient(to right, rgb(161 161 170 / 0.35) 1px, transparent 1px), linear-gradient(to bottom, rgb(161 161 170 / 0.35) 1px, transparent 1px)",
|
|
137
|
-
backgroundSize: "24px 24px",
|
|
138
|
-
}}
|
|
139
|
-
/>
|
|
140
|
-
<div className="relative">
|
|
141
|
-
<Modal open={playgroundOpen} onOpenChange={setPlaygroundOpen}>
|
|
142
|
-
<ModalTrigger asChild>
|
|
143
|
-
<Button>Open modal</Button>
|
|
144
|
-
</ModalTrigger>
|
|
145
|
-
<ModalContent size={size} showCloseButton={showCloseButton}>
|
|
146
|
-
<ModalHeader>
|
|
147
|
-
<ModalTitle>Publish changes?</ModalTitle>
|
|
148
|
-
<ModalDescription>
|
|
149
|
-
Your updates will be visible to everyone on the live site.
|
|
150
|
-
</ModalDescription>
|
|
151
|
-
</ModalHeader>
|
|
152
|
-
<ModalBody>
|
|
153
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-300">
|
|
154
|
-
Review your changes before publishing.
|
|
155
|
-
</p>
|
|
156
|
-
</ModalBody>
|
|
157
|
-
<ModalFooter>
|
|
158
|
-
<ModalClose asChild>
|
|
159
|
-
<Button variant="ghost" size="sm">Cancel</Button>
|
|
160
|
-
</ModalClose>
|
|
161
|
-
<ModalClose asChild>
|
|
162
|
-
<Button size="sm">Publish</Button>
|
|
163
|
-
</ModalClose>
|
|
164
|
-
</ModalFooter>
|
|
165
|
-
</ModalContent>
|
|
166
|
-
</Modal>
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<div className="flex flex-col gap-5 border-t border-zinc-200 p-5 dark:border-zinc-800">
|
|
171
|
-
<div className="flex flex-wrap items-start justify-between gap-6">
|
|
172
|
-
<div>
|
|
173
|
-
<p className="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400 dark:text-zinc-500">
|
|
174
|
-
Size
|
|
175
|
-
</p>
|
|
176
|
-
<div className="flex flex-wrap items-center gap-1 rounded-lg border border-zinc-200 bg-zinc-50 p-1 dark:border-zinc-800 dark:bg-zinc-900/60">
|
|
177
|
-
{PLAYGROUND_SIZES.map((s) => (
|
|
178
|
-
<button
|
|
179
|
-
key={s}
|
|
180
|
-
type="button"
|
|
181
|
-
onClick={() => setSize(s)}
|
|
182
|
-
className={cn(
|
|
183
|
-
"rounded-md px-3 py-1.5 text-xs font-medium uppercase tracking-wide transition-colors",
|
|
184
|
-
size === s
|
|
185
|
-
? "bg-white text-zinc-900 shadow-sm dark:bg-zinc-800 dark:text-white"
|
|
186
|
-
: "text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200"
|
|
187
|
-
)}
|
|
188
|
-
>
|
|
189
|
-
{s}
|
|
190
|
-
</button>
|
|
191
|
-
))}
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<div>
|
|
196
|
-
<p className="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400 dark:text-zinc-500">
|
|
197
|
-
Close button
|
|
198
|
-
</p>
|
|
199
|
-
<button
|
|
200
|
-
type="button"
|
|
201
|
-
onClick={() => setShowCloseButton((v) => !v)}
|
|
202
|
-
className={cn(
|
|
203
|
-
"flex h-[2.125rem] items-center gap-2 rounded-lg border px-3 text-xs font-medium transition-colors",
|
|
204
|
-
showCloseButton
|
|
205
|
-
? "border-zinc-900 bg-zinc-900 text-white dark:border-white dark:bg-white dark:text-zinc-900"
|
|
206
|
-
: "border-zinc-200 text-zinc-500 hover:border-zinc-300 dark:border-zinc-700 dark:text-zinc-400"
|
|
207
|
-
)}
|
|
208
|
-
>
|
|
209
|
-
{showCloseButton ? "On" : "Off"}
|
|
210
|
-
</button>
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
<div className="flex items-center justify-between gap-3 rounded-xl bg-zinc-900 px-4 py-3 dark:bg-black">
|
|
215
|
-
<pre className="overflow-x-auto font-mono text-[13px] leading-relaxed text-zinc-100">
|
|
216
|
-
<code>{snippet}</code>
|
|
217
|
-
</pre>
|
|
218
|
-
<Tooltip content={copied ? "Copied!" : "Copy code"}>
|
|
219
|
-
<button
|
|
220
|
-
type="button"
|
|
221
|
-
onClick={copySnippet}
|
|
222
|
-
className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-zinc-400 transition-colors hover:bg-white/10 hover:text-white"
|
|
223
|
-
>
|
|
224
|
-
{copied ? <Check className="h-4 w-4 text-emerald-400" /> : <Copy className="h-4 w-4" />}
|
|
225
|
-
</button>
|
|
226
|
-
</Tooltip>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
</DocsSection>
|
|
231
|
-
|
|
232
|
-
<DocsSection
|
|
233
|
-
title="Default"
|
|
234
|
-
description="Click to open — closes via backdrop, Escape, or the close button."
|
|
235
|
-
>
|
|
236
|
-
<Card className="max-w-2xl">
|
|
237
|
-
<CardHeader className="border-b border-zinc-100 dark:border-zinc-800">
|
|
238
|
-
<div className="flex items-center justify-between gap-4">
|
|
239
|
-
<div>
|
|
240
|
-
<CardTitle>Team workspace</CardTitle>
|
|
241
|
-
<CardDescription>Manage members and invitations.</CardDescription>
|
|
242
|
-
</div>
|
|
243
|
-
<Badge variant="outline">Interactive</Badge>
|
|
244
|
-
</div>
|
|
245
|
-
</CardHeader>
|
|
246
|
-
<CardContent className="flex flex-wrap items-center gap-3 pt-6">
|
|
247
|
-
<Modal>
|
|
248
|
-
<ModalTrigger asChild>
|
|
249
|
-
<Button size="sm">
|
|
250
|
-
<UserPlus className="h-4 w-4" />
|
|
251
|
-
Invite member
|
|
252
|
-
</Button>
|
|
253
|
-
</ModalTrigger>
|
|
254
|
-
<ModalContent>
|
|
255
|
-
<ModalHeader>
|
|
256
|
-
<ModalTitle>Invite a teammate</ModalTitle>
|
|
257
|
-
<ModalDescription>
|
|
258
|
-
Send an invitation link to add someone to your workspace.
|
|
259
|
-
</ModalDescription>
|
|
260
|
-
</ModalHeader>
|
|
261
|
-
<ModalBody>
|
|
262
|
-
|
|
263
|
-
<ModalOption
|
|
264
|
-
icon={<Mail className="h-4 w-4" />}
|
|
265
|
-
title="Editor access"
|
|
266
|
-
description="Can edit projects and invite others."
|
|
267
|
-
/>
|
|
268
|
-
</ModalBody>
|
|
269
|
-
<ModalFooter>
|
|
270
|
-
<ModalClose asChild>
|
|
271
|
-
<Button variant="ghost" size="sm">Cancel</Button>
|
|
272
|
-
</ModalClose>
|
|
273
|
-
<ModalClose asChild>
|
|
274
|
-
<Button size="sm">Send invitation</Button>
|
|
275
|
-
</ModalClose>
|
|
276
|
-
</ModalFooter>
|
|
277
|
-
</ModalContent>
|
|
278
|
-
</Modal>
|
|
279
|
-
<Button variant="ghost" size="sm">View members</Button>
|
|
280
|
-
</CardContent>
|
|
281
|
-
</Card>
|
|
282
|
-
</DocsSection>
|
|
283
|
-
|
|
284
|
-
<DocsSection>
|
|
285
|
-
<DocsSectionGrid className="lg:grid-cols-2">
|
|
286
|
-
<Card>
|
|
287
|
-
<CardHeader>
|
|
288
|
-
<CardTitle className="text-base">Confirmation</CardTitle>
|
|
289
|
-
<CardDescription>Destructive actions need a deliberate second step.</CardDescription>
|
|
290
|
-
</CardHeader>
|
|
291
|
-
<CardContent>
|
|
292
|
-
<Modal open={deleteOpen} onOpenChange={setDeleteOpen}>
|
|
293
|
-
<Button
|
|
294
|
-
size="sm"
|
|
295
|
-
variant="ghost"
|
|
296
|
-
className="text-red-600 hover:text-red-700 dark:text-red-400"
|
|
297
|
-
onClick={() => setDeleteOpen(true)}
|
|
298
|
-
>
|
|
299
|
-
Delete account
|
|
300
|
-
</Button>
|
|
301
|
-
<ModalContent size="sm" showCloseButton>
|
|
302
|
-
<ModalHeader>
|
|
303
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-red-50 text-red-600 dark:bg-red-950/50 dark:text-red-400">
|
|
304
|
-
<AlertTriangle className="h-5 w-5" />
|
|
305
|
-
</div>
|
|
306
|
-
<ModalTitle className="mt-3">Delete account?</ModalTitle>
|
|
307
|
-
<ModalDescription>
|
|
308
|
-
This permanently removes your profile, projects, and billing history. This cannot be undone.
|
|
309
|
-
</ModalDescription>
|
|
310
|
-
</ModalHeader>
|
|
311
|
-
<ModalFooter>
|
|
312
|
-
<Button variant="ghost" size="sm" onClick={() => setDeleteOpen(false)}>
|
|
313
|
-
Keep account
|
|
314
|
-
</Button>
|
|
315
|
-
<Button
|
|
316
|
-
size="sm"
|
|
317
|
-
className="bg-red-600 text-white hover:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500"
|
|
318
|
-
onClick={() => setDeleteOpen(false)}
|
|
319
|
-
>
|
|
320
|
-
Yes, delete
|
|
321
|
-
</Button>
|
|
322
|
-
</ModalFooter>
|
|
323
|
-
</ModalContent>
|
|
324
|
-
</Modal>
|
|
325
|
-
</CardContent>
|
|
326
|
-
</Card>
|
|
327
|
-
|
|
328
|
-
<Card>
|
|
329
|
-
<CardHeader>
|
|
330
|
-
<CardTitle className="text-base">Controlled State</CardTitle>
|
|
331
|
-
<CardDescription>Open and close programmatically with state.</CardDescription>
|
|
332
|
-
</CardHeader>
|
|
333
|
-
<CardContent className="space-y-3">
|
|
334
|
-
<Modal open={inviteOpen} onOpenChange={setInviteOpen}>
|
|
335
|
-
<div className="flex flex-wrap gap-2">
|
|
336
|
-
<Button size="sm" onClick={() => setInviteOpen(true)}>Open modal</Button>
|
|
337
|
-
<Button variant="ghost" size="sm" onClick={() => setInviteOpen(false)}>Close modal</Button>
|
|
338
|
-
</div>
|
|
339
|
-
<ModalContent size="md">
|
|
340
|
-
<ModalHeader>
|
|
341
|
-
<ModalTitle>Controlled modal</ModalTitle>
|
|
342
|
-
<ModalDescription>
|
|
343
|
-
The parent component owns the open state via <code className="text-xs">open</code> and{" "}
|
|
344
|
-
<code className="text-xs">onOpenChange</code>.
|
|
345
|
-
</ModalDescription>
|
|
346
|
-
</ModalHeader>
|
|
347
|
-
<ModalBody>
|
|
348
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-300">
|
|
349
|
-
Useful for multi-step flows, form validation, or syncing with URL parameters.
|
|
350
|
-
</p>
|
|
351
|
-
</ModalBody>
|
|
352
|
-
<ModalFooter>
|
|
353
|
-
<Button variant="ghost" size="sm" onClick={() => setInviteOpen(false)}>Done</Button>
|
|
354
|
-
</ModalFooter>
|
|
355
|
-
</ModalContent>
|
|
356
|
-
</Modal>
|
|
357
|
-
</CardContent>
|
|
358
|
-
</Card>
|
|
359
|
-
</DocsSectionGrid>
|
|
360
|
-
</DocsSection>
|
|
361
|
-
|
|
362
|
-
<DocsSection
|
|
363
|
-
title="Sizes"
|
|
364
|
-
description="Pick a width that matches the content — from quick alerts to detailed forms."
|
|
365
|
-
contentClassName="grid gap-4 sm:grid-cols-2 xl:grid-cols-4"
|
|
366
|
-
>
|
|
367
|
-
{(["sm", "md", "lg", "xl"] as const).map((size) => (
|
|
368
|
-
<Card key={size} className="overflow-hidden">
|
|
369
|
-
<CardHeader className="pb-3">
|
|
370
|
-
<CardTitle className="text-sm font-medium capitalize">{size}</CardTitle>
|
|
371
|
-
<CardDescription className="text-xs">
|
|
372
|
-
{size === "sm" && "Quick confirmations"}
|
|
373
|
-
{size === "md" && "Standard dialogs"}
|
|
374
|
-
{size === "lg" && "Forms & settings"}
|
|
375
|
-
{size === "xl" && "Rich content"}
|
|
376
|
-
</CardDescription>
|
|
377
|
-
</CardHeader>
|
|
378
|
-
<CardContent>
|
|
379
|
-
<Modal>
|
|
380
|
-
<ModalTrigger asChild>
|
|
381
|
-
<Button variant="ghost" size="sm" className="w-full">Preview</Button>
|
|
382
|
-
</ModalTrigger>
|
|
383
|
-
<ModalContent size={size}>
|
|
384
|
-
<ModalHeader>
|
|
385
|
-
<ModalTitle>{size.toUpperCase()} modal</ModalTitle>
|
|
386
|
-
<ModalDescription>
|
|
387
|
-
Example content at the {size} breakpoint.
|
|
388
|
-
</ModalDescription>
|
|
389
|
-
</ModalHeader>
|
|
390
|
-
<ModalFooter>
|
|
391
|
-
<ModalClose asChild>
|
|
392
|
-
<Button size="sm" variant="ghost">Close</Button>
|
|
393
|
-
</ModalClose>
|
|
394
|
-
</ModalFooter>
|
|
395
|
-
</ModalContent>
|
|
396
|
-
</Modal>
|
|
397
|
-
</CardContent>
|
|
398
|
-
</Card>
|
|
399
|
-
))}
|
|
400
|
-
</DocsSection>
|
|
401
|
-
|
|
402
|
-
<DocsSection
|
|
403
|
-
title="Live Preview"
|
|
404
|
-
description="Modal with a dimmed overlay and smooth enter animation."
|
|
405
|
-
>
|
|
406
|
-
<DocsDemoPanel className="!py-0">
|
|
407
|
-
<div className="relative flex min-h-[320px] w-full items-center justify-center py-16">
|
|
408
|
-
<div className="w-full max-w-sm rounded-2xl border border-zinc-200/90 bg-white shadow-[0_20px_60px_rgba(0,0,0,0.12)] dark:border-zinc-800 dark:bg-zinc-950 dark:shadow-[0_20px_60px_rgba(0,0,0,0.45)]">
|
|
409
|
-
<div className="space-y-1 px-6 pt-6">
|
|
410
|
-
<h3 className="text-[15px] font-semibold tracking-tight text-zinc-900 dark:text-white">
|
|
411
|
-
Publish changes?
|
|
412
|
-
</h3>
|
|
413
|
-
<p className="text-[13px] leading-relaxed text-zinc-500 dark:text-zinc-400">
|
|
414
|
-
Your updates will be visible to everyone on the live site.
|
|
415
|
-
</p>
|
|
416
|
-
</div>
|
|
417
|
-
<div className="px-6 pt-5 pb-6">
|
|
418
|
-
<Badge variant="success">Ready to publish</Badge>
|
|
419
|
-
</div>
|
|
420
|
-
<div className="flex items-center justify-end gap-2 border-t border-zinc-200/90 px-6 py-4 dark:border-zinc-800">
|
|
421
|
-
<Button variant="ghost" size="sm">Review</Button>
|
|
422
|
-
<Button size="sm">Publish now</Button>
|
|
423
|
-
</div>
|
|
424
|
-
</div>
|
|
425
|
-
</div>
|
|
426
|
-
</DocsDemoPanel>
|
|
427
|
-
</DocsSection>
|
|
428
|
-
|
|
429
|
-
<DocsApiSection>
|
|
430
|
-
<DocsApiTable title="API Reference — Modal" rows={API_ROWS} />
|
|
431
|
-
<DocsApiTable title="API Reference — ModalContent" rows={CONTENT_API_ROWS} />
|
|
432
|
-
<DocsAccessibility items={ACCESSIBILITY_ITEMS} />
|
|
433
|
-
</DocsApiSection>
|
|
434
|
-
</DocsPage>
|
|
435
|
-
);
|
|
436
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import Link from "next/link";
|
|
2
|
-
import { ArrowRight, Compass, Palette, Puzzle } from "lucide-react";
|
|
3
|
-
import { DocsSection } from "@/components/docs/docs-page";
|
|
4
|
-
|
|
5
|
-
const STEPS = [
|
|
6
|
-
{
|
|
7
|
-
icon: Puzzle,
|
|
8
|
-
title: "Components",
|
|
9
|
-
description: "Browse all components and their usage.",
|
|
10
|
-
href: "/docs/button",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
icon: Palette,
|
|
14
|
-
title: "Theming",
|
|
15
|
-
description: "Customize the theme to match your brand.",
|
|
16
|
-
href: "/docs/theming",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
icon: Compass,
|
|
20
|
-
title: "Examples",
|
|
21
|
-
description: "Check out real-world examples and templates.",
|
|
22
|
-
href: "/docs",
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
export function NextSteps() {
|
|
27
|
-
return (
|
|
28
|
-
<DocsSection
|
|
29
|
-
title="Next Steps"
|
|
30
|
-
description="Explore the documentation to learn more about the components and how to use them."
|
|
31
|
-
contentClassName="grid gap-4 sm:grid-cols-3"
|
|
32
|
-
>
|
|
33
|
-
{STEPS.map((step) => (
|
|
34
|
-
<Link
|
|
35
|
-
key={step.title}
|
|
36
|
-
href={step.href}
|
|
37
|
-
className="group rounded-xl border border-zinc-200/70 p-5 shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:-translate-y-0.5 hover:border-zinc-300 hover:shadow-[0_8px_24px_rgba(0,0,0,0.08)] dark:border-zinc-800/80 dark:shadow-[0_2px_8px_rgba(0,0,0,0.2)] dark:hover:border-zinc-700 dark:hover:shadow-[0_8px_24px_rgba(0,0,0,0.35)]"
|
|
38
|
-
>
|
|
39
|
-
<span className="flex h-9 w-9 items-center justify-center rounded-lg border border-zinc-200 bg-zinc-50 text-zinc-900 dark:border-white/10 dark:bg-white/[0.06] dark:text-zinc-100">
|
|
40
|
-
<step.icon className="h-4 w-4" />
|
|
41
|
-
</span>
|
|
42
|
-
<div className="mt-3.5 flex items-center justify-between">
|
|
43
|
-
<h3 className="text-sm font-semibold text-zinc-900 dark:text-zinc-50">{step.title}</h3>
|
|
44
|
-
<ArrowRight className="h-4 w-4 text-zinc-400 transition-transform group-hover:translate-x-0.5 group-hover:text-zinc-900 dark:group-hover:text-zinc-50" />
|
|
45
|
-
</div>
|
|
46
|
-
<p className="mt-1.5 text-sm leading-relaxed text-zinc-500 dark:text-zinc-400">
|
|
47
|
-
{step.description}
|
|
48
|
-
</p>
|
|
49
|
-
</Link>
|
|
50
|
-
))}
|
|
51
|
-
</DocsSection>
|
|
52
|
-
);
|
|
53
|
-
}
|