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,364 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { AlertTriangle, AppWindow, Check, Copy, MapPin, MessageSquare, ShieldCheck, User, WifiOff } from "lucide-react";
|
|
5
|
-
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogAction, DialogItem } from "@/components/ui/dialog";
|
|
6
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card";
|
|
7
|
-
import { Badge } from "@/components/ui/badge";
|
|
8
|
-
import { Button } from "@/components/ui/button";
|
|
9
|
-
import { Tooltip } from "@/components/ui/tooltip";
|
|
10
|
-
import {
|
|
11
|
-
DocsAccessibility,
|
|
12
|
-
DocsApiSection,
|
|
13
|
-
DocsApiTable,
|
|
14
|
-
DocsPage,
|
|
15
|
-
DocsPageHeader,
|
|
16
|
-
DocsSection,
|
|
17
|
-
DocsSectionGrid,
|
|
18
|
-
} from "@/components/docs/docs-page";
|
|
19
|
-
import { cn } from "@/lib/cn";
|
|
20
|
-
|
|
21
|
-
const DIALOG_API_ROWS = [
|
|
22
|
-
{ prop: "children", type: "ReactNode", default: "—", description: "A DialogTrigger and DialogContent pair" },
|
|
23
|
-
{ prop: "open", type: "boolean", default: "—", description: "Controlled open state" },
|
|
24
|
-
{ prop: "onOpenChange", type: "(open: boolean) => void", default: "—", description: "Callback fired when open state changes" },
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const CONTENT_API_ROWS = [
|
|
28
|
-
{ prop: "children", type: "ReactNode", default: "—", description: "Dialog body — typically DialogHeader and DialogFooter" },
|
|
29
|
-
{ prop: "className", type: "string", default: "—", description: "Additional CSS classes for the dialog card" },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
const HEADER_API_ROWS = [
|
|
33
|
-
{ prop: "title", type: "string", default: "—", description: "Bold heading describing the dialog's purpose" },
|
|
34
|
-
{ prop: "description", type: "string", default: "—", description: "Supporting copy shown beneath the title" },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const ACTION_API_ROWS = [
|
|
38
|
-
{ prop: "label", type: "string", default: "—", description: "Button text" },
|
|
39
|
-
{ prop: "onClick", type: "() => void", default: "—", description: "Called before the dialog closes" },
|
|
40
|
-
{ prop: "variant", type: '"primary" | "destructive"', default: '"primary"', description: "Neutral or red styling for irreversible actions" },
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const ITEM_API_ROWS = [
|
|
44
|
-
{ prop: "label", type: "string", default: "—", description: "Row text, e.g. an account email" },
|
|
45
|
-
{ prop: "icon", type: "ReactNode", default: "—", description: "Custom icon — falls back to a variant default" },
|
|
46
|
-
{ prop: "onClick", type: "() => void", default: "—", description: "Called before the dialog closes" },
|
|
47
|
-
{ prop: "variant", type: '"account" | "action"', default: '"account"', description: "Tinted avatar circle vs. neutral action circle" },
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
const ACCESSIBILITY_ITEMS = [
|
|
51
|
-
"DialogContent renders with role=\"dialog\" and aria-modal=\"true\" for assistive tech.",
|
|
52
|
-
"Pressing Escape closes the dialog, matching platform conventions.",
|
|
53
|
-
"Clicking the backdrop dismisses the dialog; clicks inside the card never bubble up to it.",
|
|
54
|
-
"Body scroll locks while a dialog is open, so background content can't scroll underneath it.",
|
|
55
|
-
"Pair the destructive DialogAction variant with an explicit label — \"Delete\", not \"OK\".",
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
function codeFor(withDescription: boolean, destructive: boolean) {
|
|
59
|
-
const headerProps = [
|
|
60
|
-
`title="Delete this project?"`,
|
|
61
|
-
withDescription && `description="This will permanently remove the project and all of its data. This action cannot be undone."`,
|
|
62
|
-
]
|
|
63
|
-
.filter(Boolean)
|
|
64
|
-
.join("\n ");
|
|
65
|
-
|
|
66
|
-
return `<Dialog>
|
|
67
|
-
<DialogTrigger>
|
|
68
|
-
<Button variant="outline">Open dialog</Button>
|
|
69
|
-
</DialogTrigger>
|
|
70
|
-
<DialogContent>
|
|
71
|
-
<DialogHeader
|
|
72
|
-
${headerProps}
|
|
73
|
-
/>
|
|
74
|
-
<DialogFooter>
|
|
75
|
-
<DialogAction label="Cancel" />
|
|
76
|
-
<DialogAction label="Delete"${destructive ? ' variant="destructive"' : ""} />
|
|
77
|
-
</DialogFooter>
|
|
78
|
-
</DialogContent>
|
|
79
|
-
</Dialog>`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function DialogDocPage() {
|
|
83
|
-
const [withDescription, setWithDescription] = useState(true);
|
|
84
|
-
const [destructive, setDestructive] = useState(true);
|
|
85
|
-
const [copied, setCopied] = useState(false);
|
|
86
|
-
|
|
87
|
-
const snippet = codeFor(withDescription, destructive);
|
|
88
|
-
|
|
89
|
-
function copySnippet() {
|
|
90
|
-
navigator.clipboard.writeText(snippet).catch(() => {});
|
|
91
|
-
setCopied(true);
|
|
92
|
-
setTimeout(() => setCopied(false), 1200);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<DocsPage>
|
|
97
|
-
<DocsPageHeader
|
|
98
|
-
icon={AppWindow}
|
|
99
|
-
title="Dialog"
|
|
100
|
-
description="Overlay components for confirmations, account selection, forms, and system alerts."
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
<DocsSection
|
|
104
|
-
first
|
|
105
|
-
title="Playground"
|
|
106
|
-
description="Open the dialog to preview it live, toggle the description and destructive action, and copy the exact markup."
|
|
107
|
-
>
|
|
108
|
-
<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)]">
|
|
109
|
-
<div className="relative flex min-h-[11rem] items-center justify-center overflow-hidden bg-zinc-50 p-6 dark:bg-zinc-900/40">
|
|
110
|
-
<div
|
|
111
|
-
aria-hidden
|
|
112
|
-
className="pointer-events-none absolute inset-0 opacity-[0.4] dark:opacity-[0.15]"
|
|
113
|
-
style={{
|
|
114
|
-
backgroundImage:
|
|
115
|
-
"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)",
|
|
116
|
-
backgroundSize: "24px 24px",
|
|
117
|
-
}}
|
|
118
|
-
/>
|
|
119
|
-
<div className="relative">
|
|
120
|
-
<Dialog>
|
|
121
|
-
<DialogTrigger>
|
|
122
|
-
<Button variant="outline">Open dialog</Button>
|
|
123
|
-
</DialogTrigger>
|
|
124
|
-
<DialogContent>
|
|
125
|
-
<DialogHeader
|
|
126
|
-
title="Delete this project?"
|
|
127
|
-
description={
|
|
128
|
-
withDescription
|
|
129
|
-
? "This will permanently remove the project and all of its data. This action cannot be undone."
|
|
130
|
-
: undefined
|
|
131
|
-
}
|
|
132
|
-
/>
|
|
133
|
-
<DialogFooter>
|
|
134
|
-
<DialogAction label="Cancel" />
|
|
135
|
-
<DialogAction label="Delete" variant={destructive ? "destructive" : "primary"} />
|
|
136
|
-
</DialogFooter>
|
|
137
|
-
</DialogContent>
|
|
138
|
-
</Dialog>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<div className="flex flex-col gap-5 border-t border-zinc-200 p-5 dark:border-zinc-800">
|
|
143
|
-
<div className="flex flex-wrap items-start justify-between gap-6">
|
|
144
|
-
<div>
|
|
145
|
-
<p className="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400 dark:text-zinc-500">
|
|
146
|
-
Description
|
|
147
|
-
</p>
|
|
148
|
-
<button
|
|
149
|
-
type="button"
|
|
150
|
-
onClick={() => setWithDescription((v) => !v)}
|
|
151
|
-
className={cn(
|
|
152
|
-
"flex h-[2.125rem] items-center gap-2 rounded-lg border px-3 text-xs font-medium transition-colors",
|
|
153
|
-
withDescription
|
|
154
|
-
? "border-zinc-900 bg-zinc-900 text-white dark:border-white dark:bg-white dark:text-zinc-900"
|
|
155
|
-
: "border-zinc-200 text-zinc-500 hover:border-zinc-300 dark:border-zinc-700 dark:text-zinc-400"
|
|
156
|
-
)}
|
|
157
|
-
>
|
|
158
|
-
{withDescription ? "On" : "Off"}
|
|
159
|
-
</button>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
<div>
|
|
163
|
-
<p className="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400 dark:text-zinc-500">
|
|
164
|
-
Destructive action
|
|
165
|
-
</p>
|
|
166
|
-
<button
|
|
167
|
-
type="button"
|
|
168
|
-
onClick={() => setDestructive((v) => !v)}
|
|
169
|
-
className={cn(
|
|
170
|
-
"flex h-[2.125rem] items-center gap-2 rounded-lg border px-3 text-xs font-medium transition-colors",
|
|
171
|
-
destructive
|
|
172
|
-
? "border-zinc-900 bg-zinc-900 text-white dark:border-white dark:bg-white dark:text-zinc-900"
|
|
173
|
-
: "border-zinc-200 text-zinc-500 hover:border-zinc-300 dark:border-zinc-700 dark:text-zinc-400"
|
|
174
|
-
)}
|
|
175
|
-
>
|
|
176
|
-
{destructive ? "On" : "Off"}
|
|
177
|
-
</button>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div className="flex items-center justify-between gap-3 rounded-xl bg-zinc-900 px-4 py-3 dark:bg-black">
|
|
182
|
-
<pre className="overflow-x-auto font-mono text-[13px] leading-relaxed text-zinc-100">
|
|
183
|
-
<code>{snippet}</code>
|
|
184
|
-
</pre>
|
|
185
|
-
<Tooltip content={copied ? "Copied!" : "Copy code"}>
|
|
186
|
-
<button
|
|
187
|
-
type="button"
|
|
188
|
-
onClick={copySnippet}
|
|
189
|
-
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"
|
|
190
|
-
>
|
|
191
|
-
{copied ? <Check className="h-4 w-4 text-emerald-400" /> : <Copy className="h-4 w-4" />}
|
|
192
|
-
</button>
|
|
193
|
-
</Tooltip>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
</DocsSection>
|
|
198
|
-
|
|
199
|
-
<DocsSection title="Default" description="A focused confirmation — trigger it, decide, and it's gone.">
|
|
200
|
-
<Card className="max-w-2xl">
|
|
201
|
-
<CardHeader className="border-b border-zinc-100 dark:border-zinc-800">
|
|
202
|
-
<div className="flex items-center justify-between gap-4">
|
|
203
|
-
<div>
|
|
204
|
-
<CardTitle>Location permissions</CardTitle>
|
|
205
|
-
<CardDescription>Ask before sharing device data with third parties.</CardDescription>
|
|
206
|
-
</div>
|
|
207
|
-
<Badge variant="outline">Interactive</Badge>
|
|
208
|
-
</div>
|
|
209
|
-
</CardHeader>
|
|
210
|
-
<CardContent className="flex flex-wrap items-center gap-3 pt-6">
|
|
211
|
-
<Dialog>
|
|
212
|
-
<DialogTrigger>
|
|
213
|
-
<Button variant="outline">
|
|
214
|
-
<MapPin className="h-4 w-4" />
|
|
215
|
-
Location Service
|
|
216
|
-
</Button>
|
|
217
|
-
</DialogTrigger>
|
|
218
|
-
<DialogContent>
|
|
219
|
-
<DialogHeader
|
|
220
|
-
title="Use Google's location service?"
|
|
221
|
-
description="Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running."
|
|
222
|
-
/>
|
|
223
|
-
<DialogFooter>
|
|
224
|
-
<DialogAction label="Disagree" />
|
|
225
|
-
<DialogAction label="Agree" />
|
|
226
|
-
</DialogFooter>
|
|
227
|
-
</DialogContent>
|
|
228
|
-
</Dialog>
|
|
229
|
-
<Button variant="ghost" size="sm">Learn more</Button>
|
|
230
|
-
</CardContent>
|
|
231
|
-
</Card>
|
|
232
|
-
</DocsSection>
|
|
233
|
-
|
|
234
|
-
<DocsSection title="Common Patterns" description="Every dialog shares the same building blocks — trigger, header, footer.">
|
|
235
|
-
<DocsSectionGrid>
|
|
236
|
-
<Card>
|
|
237
|
-
<CardHeader>
|
|
238
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-xl bg-[#0070BA]/10 text-[#0070BA] dark:bg-[#0070BA]/20 dark:text-[#4DA3E0]">
|
|
239
|
-
<User className="h-4 w-4" />
|
|
240
|
-
</div>
|
|
241
|
-
<CardTitle className="mt-3 text-base">Account picker</CardTitle>
|
|
242
|
-
<CardDescription>A compact list dialog with no footer actions.</CardDescription>
|
|
243
|
-
</CardHeader>
|
|
244
|
-
<CardContent>
|
|
245
|
-
<Dialog>
|
|
246
|
-
<DialogTrigger><Button variant="outline" size="sm">Select Account</Button></DialogTrigger>
|
|
247
|
-
<DialogContent className="max-w-[320px] p-0 overflow-hidden">
|
|
248
|
-
<div className="px-5 pb-2 pt-5">
|
|
249
|
-
<h2 className="text-[17px] font-semibold leading-snug tracking-tight text-zinc-900 dark:text-white">Set backup account</h2>
|
|
250
|
-
</div>
|
|
251
|
-
<div className="px-2 pb-3">
|
|
252
|
-
<DialogItem label="username01@gmail.com" />
|
|
253
|
-
<DialogItem label="username02@gmail.com" />
|
|
254
|
-
<DialogItem label="Add account" variant="action" />
|
|
255
|
-
</div>
|
|
256
|
-
</DialogContent>
|
|
257
|
-
</Dialog>
|
|
258
|
-
</CardContent>
|
|
259
|
-
</Card>
|
|
260
|
-
|
|
261
|
-
<Card>
|
|
262
|
-
<CardHeader>
|
|
263
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-xl bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300">
|
|
264
|
-
<MessageSquare className="h-4 w-4" />
|
|
265
|
-
</div>
|
|
266
|
-
<CardTitle className="mt-3 text-base">Form dialog</CardTitle>
|
|
267
|
-
<CardDescription>Collects input before an action is confirmed.</CardDescription>
|
|
268
|
-
</CardHeader>
|
|
269
|
-
<CardContent>
|
|
270
|
-
<Dialog>
|
|
271
|
-
<DialogTrigger><Button variant="outline" size="sm">Feedback</Button></DialogTrigger>
|
|
272
|
-
<DialogContent>
|
|
273
|
-
<DialogHeader title="Send feedback" description="Tell us what you think about our new interface." />
|
|
274
|
-
<textarea
|
|
275
|
-
className="w-full rounded-xl border border-zinc-200 bg-white p-3 text-sm text-zinc-900 outline-none transition-colors placeholder:text-zinc-400 focus:border-zinc-900 focus:ring-2 focus:ring-zinc-900/10 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-zinc-400 dark:focus:ring-zinc-400/15"
|
|
276
|
-
rows={4}
|
|
277
|
-
placeholder="Write something..."
|
|
278
|
-
/>
|
|
279
|
-
<DialogFooter>
|
|
280
|
-
<DialogAction label="Cancel" />
|
|
281
|
-
<DialogAction label="Send" />
|
|
282
|
-
</DialogFooter>
|
|
283
|
-
</DialogContent>
|
|
284
|
-
</Dialog>
|
|
285
|
-
</CardContent>
|
|
286
|
-
</Card>
|
|
287
|
-
|
|
288
|
-
<Card>
|
|
289
|
-
<CardHeader>
|
|
290
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-xl bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300">
|
|
291
|
-
<ShieldCheck className="h-4 w-4" />
|
|
292
|
-
</div>
|
|
293
|
-
<CardTitle className="mt-3 text-base">Information</CardTitle>
|
|
294
|
-
<CardDescription>A single acknowledgement action, nothing to decide.</CardDescription>
|
|
295
|
-
</CardHeader>
|
|
296
|
-
<CardContent>
|
|
297
|
-
<Dialog>
|
|
298
|
-
<DialogTrigger><Button variant="outline" size="sm">Privacy Policy</Button></DialogTrigger>
|
|
299
|
-
<DialogContent>
|
|
300
|
-
<DialogHeader title="Policy updates" description="We have updated our terms of service to better protect your data and privacy." />
|
|
301
|
-
<DialogFooter>
|
|
302
|
-
<DialogAction label="Got it" />
|
|
303
|
-
</DialogFooter>
|
|
304
|
-
</DialogContent>
|
|
305
|
-
</Dialog>
|
|
306
|
-
</CardContent>
|
|
307
|
-
</Card>
|
|
308
|
-
|
|
309
|
-
<Card>
|
|
310
|
-
<CardHeader>
|
|
311
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-xl bg-red-50 text-red-600 dark:bg-red-950/50 dark:text-red-400">
|
|
312
|
-
<AlertTriangle className="h-4 w-4" />
|
|
313
|
-
</div>
|
|
314
|
-
<CardTitle className="mt-3 text-base">Destructive action</CardTitle>
|
|
315
|
-
<CardDescription>Irreversible actions need a deliberate second step.</CardDescription>
|
|
316
|
-
</CardHeader>
|
|
317
|
-
<CardContent>
|
|
318
|
-
<Dialog>
|
|
319
|
-
<DialogTrigger><Button variant="outline" size="sm" className="border-red-300 text-red-600 hover:border-red-400 dark:border-red-900 dark:text-red-400">Delete Account</Button></DialogTrigger>
|
|
320
|
-
<DialogContent>
|
|
321
|
-
<DialogHeader title="Delete your account?" description="This action is permanent and cannot be undone. All your data will be removed immediately." />
|
|
322
|
-
<DialogFooter>
|
|
323
|
-
<DialogAction label="Cancel" />
|
|
324
|
-
<DialogAction label="Delete" variant="destructive" />
|
|
325
|
-
</DialogFooter>
|
|
326
|
-
</DialogContent>
|
|
327
|
-
</Dialog>
|
|
328
|
-
</CardContent>
|
|
329
|
-
</Card>
|
|
330
|
-
|
|
331
|
-
<Card>
|
|
332
|
-
<CardHeader>
|
|
333
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-xl bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300">
|
|
334
|
-
<WifiOff className="h-4 w-4" />
|
|
335
|
-
</div>
|
|
336
|
-
<CardTitle className="mt-3 text-base">Simple alert</CardTitle>
|
|
337
|
-
<CardDescription>System-level notices with a single dismiss.</CardDescription>
|
|
338
|
-
</CardHeader>
|
|
339
|
-
<CardContent>
|
|
340
|
-
<Dialog>
|
|
341
|
-
<DialogTrigger><Button variant="outline" size="sm">Connection Error</Button></DialogTrigger>
|
|
342
|
-
<DialogContent>
|
|
343
|
-
<DialogHeader title="No internet" description="You are currently offline. Check your connection and try again." />
|
|
344
|
-
<DialogFooter>
|
|
345
|
-
<DialogAction label="Dismiss" />
|
|
346
|
-
</DialogFooter>
|
|
347
|
-
</DialogContent>
|
|
348
|
-
</Dialog>
|
|
349
|
-
</CardContent>
|
|
350
|
-
</Card>
|
|
351
|
-
</DocsSectionGrid>
|
|
352
|
-
</DocsSection>
|
|
353
|
-
|
|
354
|
-
<DocsApiSection>
|
|
355
|
-
<DocsApiTable title="API Reference — Dialog" rows={DIALOG_API_ROWS} />
|
|
356
|
-
<DocsApiTable title="API Reference — DialogContent" rows={CONTENT_API_ROWS} />
|
|
357
|
-
<DocsApiTable title="API Reference — DialogHeader" rows={HEADER_API_ROWS} />
|
|
358
|
-
<DocsApiTable title="API Reference — DialogAction" rows={ACTION_API_ROWS} />
|
|
359
|
-
<DocsApiTable title="API Reference — DialogItem" rows={ITEM_API_ROWS} />
|
|
360
|
-
<DocsAccessibility items={ACCESSIBILITY_ITEMS} />
|
|
361
|
-
</DocsApiSection>
|
|
362
|
-
</DocsPage>
|
|
363
|
-
);
|
|
364
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function DocsFooter() {
|
|
2
|
-
return (
|
|
3
|
-
<footer className="mt-4 flex flex-col gap-2 border-t border-zinc-200/70 bg-gradient-to-b from-transparent to-zinc-50/40 px-1 py-8 text-sm text-zinc-500 dark:border-zinc-800/70 dark:to-zinc-900/20 dark:text-zinc-400 sm:flex-row sm:items-center sm:justify-between">
|
|
4
|
-
<p>© 2026 ruler.ui. All rights reserved.</p>
|
|
5
|
-
<p>
|
|
6
|
-
Documented with <span className="text-zinc-700 dark:text-zinc-300">♥</span> by
|
|
7
|
-
ruler.ui team
|
|
8
|
-
</p>
|
|
9
|
-
</footer>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Menu } from "lucide-react";
|
|
4
|
-
import { useDocsMobileNav } from "@/components/docs/docs-mobile-nav-context";
|
|
5
|
-
|
|
6
|
-
export function DocsMobileMenuBar() {
|
|
7
|
-
const { open, setOpen } = useDocsMobileNav();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<div className="sticky top-16 z-30 flex justify-left ml-4 border-b border-zinc-200 bg-white/80 py-2.5 backdrop-blur-md dark:border-zinc-800 dark:bg-zinc-950/80 lg:hidden">
|
|
11
|
-
<button
|
|
12
|
-
type="button"
|
|
13
|
-
onClick={() => setOpen(!open)}
|
|
14
|
-
aria-label={open ? "Close component menu" : "Open component menu"}
|
|
15
|
-
aria-expanded={open}
|
|
16
|
-
className="flex h-9 w-9 items-center justify-center rounded-lg border border-zinc-200 bg-white text-zinc-600 shadow-[0_1px_2px_rgba(0,0,0,0.03)] transition-colors hover:border-zinc-300 hover:bg-zinc-50 hover:text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400 dark:hover:border-zinc-700 dark:hover:bg-zinc-800/70 dark:hover:text-zinc-100"
|
|
17
|
-
>
|
|
18
|
-
<Menu className="h-4 w-4" />
|
|
19
|
-
</button>
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
interface DocsMobileNavContextValue {
|
|
6
|
-
open: boolean;
|
|
7
|
-
setOpen: (open: boolean) => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const DocsMobileNavContext = React.createContext<DocsMobileNavContextValue | null>(null);
|
|
11
|
-
|
|
12
|
-
export function DocsMobileNavProvider({ children }: { children: React.ReactNode }) {
|
|
13
|
-
const [open, setOpen] = React.useState(false);
|
|
14
|
-
return (
|
|
15
|
-
<DocsMobileNavContext.Provider value={{ open, setOpen }}>
|
|
16
|
-
{children}
|
|
17
|
-
</DocsMobileNavContext.Provider>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function useDocsMobileNav() {
|
|
22
|
-
const context = React.useContext(DocsMobileNavContext);
|
|
23
|
-
if (!context) {
|
|
24
|
-
throw new Error("useDocsMobileNav must be used within DocsMobileNavProvider");
|
|
25
|
-
}
|
|
26
|
-
return context;
|
|
27
|
-
}
|