banhaten 0.1.1 → 0.1.2
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 +20 -8
- package/package.json +8 -2
- package/registry/components/autocomplete.tsx +637 -0
- package/registry/components/avatar.tsx +258 -22
- package/registry/components/badge.tsx +97 -35
- package/registry/components/date-picker-state.ts +253 -0
- package/registry/components/date-picker.tsx +115 -158
- package/registry/components/expanded/EmptyState.tsx +155 -0
- package/registry/components/expanded/emptyState.css +111 -0
- package/registry/components/expanded/slideout.css +1 -0
- package/registry/components/expanded/table.css +1 -0
- package/registry/components/input-otp.tsx +574 -0
- package/registry/components/input.tsx +21 -11
- package/registry/components/menu.tsx +371 -8
- package/registry/components/popover.tsx +840 -0
- package/registry/components/select.tsx +4 -0
- package/registry/components/skeleton.css +57 -0
- package/registry/components/skeleton.tsx +482 -0
- package/registry/components/spinner.tsx +79 -11
- package/registry/components/textarea.tsx +1 -1
- package/registry/components/tooltip.tsx +4 -0
- package/registry/examples/autocomplete-demo.tsx +109 -0
- package/registry/examples/avatar-demo.tsx +102 -47
- package/registry/examples/badge-demo.tsx +16 -0
- package/registry/examples/expanded/command-bar-demo.tsx +236 -0
- package/registry/examples/expanded/empty-state-demo.tsx +39 -0
- package/registry/examples/input-demo.tsx +1 -1
- package/registry/examples/input-otp-demo.tsx +72 -0
- package/registry/examples/menu-demo.tsx +101 -88
- package/registry/examples/popover-demo.tsx +546 -0
- package/registry/examples/select-demo.tsx +1 -1
- package/registry/examples/skeleton-demo.tsx +56 -0
- package/registry/examples/spinner-demo.tsx +23 -1
- package/registry/examples/textarea-demo.tsx +1 -1
- package/registry/index.json +240 -8
- package/registry/styles/globals.css +88 -0
- package/src/cli/index.js +997 -62
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BellIcon,
|
|
3
|
+
ChevronDownIcon,
|
|
4
|
+
ChevronRightIcon,
|
|
5
|
+
DownloadIcon,
|
|
6
|
+
InfoIcon,
|
|
7
|
+
MoreVerticalIcon,
|
|
8
|
+
PrinterIcon,
|
|
9
|
+
SearchIcon,
|
|
10
|
+
SettingsIcon,
|
|
11
|
+
Share2Icon,
|
|
12
|
+
SlidersHorizontalIcon,
|
|
13
|
+
Trash2Icon,
|
|
14
|
+
} from "lucide-react"
|
|
15
|
+
|
|
16
|
+
import { Badge } from "@/components/ui/badge"
|
|
17
|
+
import { Button } from "@/components/ui/button"
|
|
18
|
+
import { Checkbox } from "@/components/ui/checkbox"
|
|
19
|
+
import { Input } from "@/components/ui/input"
|
|
20
|
+
import { cn } from "@/lib/utils"
|
|
21
|
+
import {
|
|
22
|
+
Menu,
|
|
23
|
+
MenuItem,
|
|
24
|
+
MenuItemIcon,
|
|
25
|
+
MenuItemText,
|
|
26
|
+
MenuItemTitle,
|
|
27
|
+
MenuSeparator,
|
|
28
|
+
} from "@/components/ui/menu"
|
|
29
|
+
import {
|
|
30
|
+
Popover,
|
|
31
|
+
PopoverBody,
|
|
32
|
+
PopoverClose,
|
|
33
|
+
PopoverContent,
|
|
34
|
+
PopoverDescription,
|
|
35
|
+
PopoverFooter,
|
|
36
|
+
PopoverHeader,
|
|
37
|
+
PopoverTitle,
|
|
38
|
+
PopoverTrigger,
|
|
39
|
+
} from "@/components/ui/popover"
|
|
40
|
+
import { Select } from "@/components/ui/select"
|
|
41
|
+
import { ToggleField } from "@/components/ui/toggle"
|
|
42
|
+
|
|
43
|
+
const filterOptions = ["All", "Active", "Paused", "Archived"]
|
|
44
|
+
const rtlTitle = "عنوان المنبثق"
|
|
45
|
+
const rtlDescription = "يظهر هذا المحتوى في الاتجاه من اليمين إلى اليسار."
|
|
46
|
+
|
|
47
|
+
export function PopoverDemo() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="grid min-w-0 gap-4">
|
|
50
|
+
<div className="grid gap-4 xl:grid-cols-2 2xl:grid-cols-3">
|
|
51
|
+
<PopoverExample title="Basic Bottom">
|
|
52
|
+
<Popover defaultOpen>
|
|
53
|
+
<PopoverTrigger asChild>
|
|
54
|
+
<Button size="sm" variant="outline">
|
|
55
|
+
Open popover
|
|
56
|
+
<InfoIcon aria-hidden="true" />
|
|
57
|
+
</Button>
|
|
58
|
+
</PopoverTrigger>
|
|
59
|
+
<PopoverContent align="center" size="sm">
|
|
60
|
+
<BasicPopoverContent />
|
|
61
|
+
</PopoverContent>
|
|
62
|
+
</Popover>
|
|
63
|
+
</PopoverExample>
|
|
64
|
+
|
|
65
|
+
<PopoverExample placement="top" title="Top">
|
|
66
|
+
<Popover defaultOpen>
|
|
67
|
+
<PopoverTrigger asChild>
|
|
68
|
+
<Button size="sm" variant="outline">
|
|
69
|
+
Open popover
|
|
70
|
+
<InfoIcon aria-hidden="true" />
|
|
71
|
+
</Button>
|
|
72
|
+
</PopoverTrigger>
|
|
73
|
+
<PopoverContent align="center" side="top" size="sm">
|
|
74
|
+
<BasicPopoverContent />
|
|
75
|
+
</PopoverContent>
|
|
76
|
+
</Popover>
|
|
77
|
+
</PopoverExample>
|
|
78
|
+
|
|
79
|
+
<PopoverExample placement="left" title="Left">
|
|
80
|
+
<Popover defaultOpen>
|
|
81
|
+
<PopoverTrigger asChild>
|
|
82
|
+
<Button size="sm" variant="outline">
|
|
83
|
+
Open popover
|
|
84
|
+
<InfoIcon aria-hidden="true" />
|
|
85
|
+
</Button>
|
|
86
|
+
</PopoverTrigger>
|
|
87
|
+
<PopoverContent align="center" side="left" size="sm">
|
|
88
|
+
<BasicPopoverContent />
|
|
89
|
+
</PopoverContent>
|
|
90
|
+
</Popover>
|
|
91
|
+
</PopoverExample>
|
|
92
|
+
|
|
93
|
+
<PopoverExample placement="right" title="Right">
|
|
94
|
+
<Popover defaultOpen>
|
|
95
|
+
<PopoverTrigger asChild>
|
|
96
|
+
<Button size="sm" variant="outline">
|
|
97
|
+
Open popover
|
|
98
|
+
<InfoIcon aria-hidden="true" />
|
|
99
|
+
</Button>
|
|
100
|
+
</PopoverTrigger>
|
|
101
|
+
<PopoverContent align="center" side="right" size="sm">
|
|
102
|
+
<BasicPopoverContent />
|
|
103
|
+
</PopoverContent>
|
|
104
|
+
</Popover>
|
|
105
|
+
</PopoverExample>
|
|
106
|
+
|
|
107
|
+
<PopoverExample title="Focus Trigger">
|
|
108
|
+
<Popover defaultOpen>
|
|
109
|
+
<PopoverTrigger asChild openOnFocus>
|
|
110
|
+
<Button size="sm" variant="secondary">
|
|
111
|
+
Focus me
|
|
112
|
+
<InfoIcon aria-hidden="true" />
|
|
113
|
+
</Button>
|
|
114
|
+
</PopoverTrigger>
|
|
115
|
+
<PopoverContent align="center" size="sm">
|
|
116
|
+
<PopoverTitle>Focused trigger</PopoverTitle>
|
|
117
|
+
<PopoverDescription>
|
|
118
|
+
Opens when keyboard focus reaches the trigger.
|
|
119
|
+
</PopoverDescription>
|
|
120
|
+
</PopoverContent>
|
|
121
|
+
</Popover>
|
|
122
|
+
</PopoverExample>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div className="grid gap-4 xl:grid-cols-2 2xl:grid-cols-3">
|
|
126
|
+
<PopoverExample title="Icon Button Trigger">
|
|
127
|
+
<Popover defaultOpen>
|
|
128
|
+
<PopoverTrigger asChild>
|
|
129
|
+
<Button aria-label="Open actions" size="icon-sm" variant="outline">
|
|
130
|
+
<MoreVerticalIcon aria-hidden="true" />
|
|
131
|
+
</Button>
|
|
132
|
+
</PopoverTrigger>
|
|
133
|
+
<PopoverContent align="center" size="auto">
|
|
134
|
+
<ActionsContent />
|
|
135
|
+
</PopoverContent>
|
|
136
|
+
</Popover>
|
|
137
|
+
</PopoverExample>
|
|
138
|
+
|
|
139
|
+
<PopoverExample title="Text Link Trigger">
|
|
140
|
+
<Popover defaultOpen>
|
|
141
|
+
<PopoverTrigger className="text-[length:var(--bh-text-body-sm-medium-font-size)] font-[var(--bh-text-body-sm-medium-font-weight)] leading-[var(--bh-text-body-sm-medium-line-height)] tracking-[var(--bh-text-body-sm-medium-letter-spacing)] text-[var(--bh-content-brand-default)] hover:text-[var(--bh-content-brand-strong)]">
|
|
142
|
+
Learn more
|
|
143
|
+
<ChevronDownIcon aria-hidden="true" />
|
|
144
|
+
</PopoverTrigger>
|
|
145
|
+
<PopoverContent size="sm">
|
|
146
|
+
<PopoverTitle>Text link trigger</PopoverTitle>
|
|
147
|
+
<PopoverDescription>
|
|
148
|
+
Use a text trigger when the popover adds contextual detail.
|
|
149
|
+
</PopoverDescription>
|
|
150
|
+
</PopoverContent>
|
|
151
|
+
</Popover>
|
|
152
|
+
</PopoverExample>
|
|
153
|
+
|
|
154
|
+
<PopoverExample title="Disabled Trigger">
|
|
155
|
+
<Popover>
|
|
156
|
+
<PopoverTrigger asChild disabled>
|
|
157
|
+
<Button disabled size="sm" variant="secondary">
|
|
158
|
+
Disabled
|
|
159
|
+
<InfoIcon aria-hidden="true" />
|
|
160
|
+
</Button>
|
|
161
|
+
</PopoverTrigger>
|
|
162
|
+
<PopoverContent size="sm">
|
|
163
|
+
<BasicPopoverContent />
|
|
164
|
+
</PopoverContent>
|
|
165
|
+
</Popover>
|
|
166
|
+
</PopoverExample>
|
|
167
|
+
|
|
168
|
+
<PopoverExample title="Small Content">
|
|
169
|
+
<Popover defaultOpen>
|
|
170
|
+
<PopoverTrigger asChild>
|
|
171
|
+
<Button aria-label="Info" size="icon-sm" variant="secondary">
|
|
172
|
+
<InfoIcon aria-hidden="true" />
|
|
173
|
+
</Button>
|
|
174
|
+
</PopoverTrigger>
|
|
175
|
+
<PopoverContent align="center" size="sm">
|
|
176
|
+
<PopoverTitle>Info</PopoverTitle>
|
|
177
|
+
<PopoverDescription>
|
|
178
|
+
Small popover with brief information.
|
|
179
|
+
</PopoverDescription>
|
|
180
|
+
</PopoverContent>
|
|
181
|
+
</Popover>
|
|
182
|
+
</PopoverExample>
|
|
183
|
+
|
|
184
|
+
<PopoverExample title="No Arrow">
|
|
185
|
+
<Popover defaultOpen>
|
|
186
|
+
<PopoverTrigger asChild>
|
|
187
|
+
<Button size="sm" variant="outline">
|
|
188
|
+
Open popover
|
|
189
|
+
<InfoIcon aria-hidden="true" />
|
|
190
|
+
</Button>
|
|
191
|
+
</PopoverTrigger>
|
|
192
|
+
<PopoverContent align="center" showArrow={false} size="sm">
|
|
193
|
+
<PopoverTitle>No arrow</PopoverTitle>
|
|
194
|
+
<PopoverDescription>
|
|
195
|
+
Use a clean edge when the trigger relationship is obvious.
|
|
196
|
+
</PopoverDescription>
|
|
197
|
+
</PopoverContent>
|
|
198
|
+
</Popover>
|
|
199
|
+
</PopoverExample>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div className="grid gap-4 2xl:grid-cols-2">
|
|
203
|
+
<PopoverExample density="large" title="Large Content">
|
|
204
|
+
<Popover defaultOpen>
|
|
205
|
+
<PopoverTrigger asChild>
|
|
206
|
+
<Button aria-label="Open details" size="icon-sm" variant="outline">
|
|
207
|
+
<InfoIcon aria-hidden="true" />
|
|
208
|
+
</Button>
|
|
209
|
+
</PopoverTrigger>
|
|
210
|
+
<PopoverContent align="center" size="lg">
|
|
211
|
+
<LargeContent />
|
|
212
|
+
</PopoverContent>
|
|
213
|
+
</Popover>
|
|
214
|
+
</PopoverExample>
|
|
215
|
+
|
|
216
|
+
<PopoverExample density="large" title="Filter Popover">
|
|
217
|
+
<Popover defaultOpen>
|
|
218
|
+
<PopoverTrigger asChild>
|
|
219
|
+
<Button size="sm" variant="outline">
|
|
220
|
+
<SlidersHorizontalIcon aria-hidden="true" />
|
|
221
|
+
Filters
|
|
222
|
+
<ChevronDownIcon aria-hidden="true" />
|
|
223
|
+
</Button>
|
|
224
|
+
</PopoverTrigger>
|
|
225
|
+
<PopoverContent align="center" size="md">
|
|
226
|
+
<FilterContent />
|
|
227
|
+
</PopoverContent>
|
|
228
|
+
</Popover>
|
|
229
|
+
</PopoverExample>
|
|
230
|
+
|
|
231
|
+
<PopoverExample density="large" title="Settings Popover">
|
|
232
|
+
<Popover defaultOpen>
|
|
233
|
+
<PopoverTrigger asChild>
|
|
234
|
+
<Button aria-label="Open settings" size="icon-sm" variant="outline">
|
|
235
|
+
<SettingsIcon aria-hidden="true" />
|
|
236
|
+
</Button>
|
|
237
|
+
</PopoverTrigger>
|
|
238
|
+
<PopoverContent align="center" size="md">
|
|
239
|
+
<SettingsContent />
|
|
240
|
+
</PopoverContent>
|
|
241
|
+
</Popover>
|
|
242
|
+
</PopoverExample>
|
|
243
|
+
|
|
244
|
+
<PopoverExample density="large" title="Actions Popover">
|
|
245
|
+
<Popover defaultOpen>
|
|
246
|
+
<PopoverTrigger asChild>
|
|
247
|
+
<Button size="sm" variant="secondary">
|
|
248
|
+
More actions
|
|
249
|
+
<ChevronDownIcon aria-hidden="true" />
|
|
250
|
+
</Button>
|
|
251
|
+
</PopoverTrigger>
|
|
252
|
+
<PopoverContent align="center" size="auto">
|
|
253
|
+
<ActionsContent />
|
|
254
|
+
</PopoverContent>
|
|
255
|
+
</Popover>
|
|
256
|
+
</PopoverExample>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<div className="grid gap-4 2xl:grid-cols-2">
|
|
260
|
+
<PopoverExample density="matrix" title="Arrow Alignment">
|
|
261
|
+
<div className="grid min-w-[calc(var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-space-18xl-320))] grid-cols-3 place-items-start gap-[var(--bh-space-6xl-32)]">
|
|
262
|
+
{(["start", "center", "end"] as const).map((align) => (
|
|
263
|
+
<Popover defaultOpen key={align}>
|
|
264
|
+
<PopoverTrigger asChild>
|
|
265
|
+
<Button size="xs" variant="outline">
|
|
266
|
+
{align}
|
|
267
|
+
</Button>
|
|
268
|
+
</PopoverTrigger>
|
|
269
|
+
<PopoverContent align={align} size="sm">
|
|
270
|
+
<PopoverTitle>{align}</PopoverTitle>
|
|
271
|
+
<PopoverDescription>Arrow follows alignment.</PopoverDescription>
|
|
272
|
+
</PopoverContent>
|
|
273
|
+
</Popover>
|
|
274
|
+
))}
|
|
275
|
+
</div>
|
|
276
|
+
</PopoverExample>
|
|
277
|
+
|
|
278
|
+
<PopoverExample density="matrix" title="Offset / Spacing">
|
|
279
|
+
<div className="grid min-w-[calc(var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-space-18xl-320))] grid-cols-3 place-items-start gap-[var(--bh-space-6xl-32)]">
|
|
280
|
+
{(["tight", "default", "loose"] as const).map((offset) => (
|
|
281
|
+
<Popover defaultOpen key={offset}>
|
|
282
|
+
<PopoverTrigger asChild>
|
|
283
|
+
<Button size="xs" variant="outline">
|
|
284
|
+
{offset}
|
|
285
|
+
</Button>
|
|
286
|
+
</PopoverTrigger>
|
|
287
|
+
<PopoverContent align="center" offset={offset} size="sm">
|
|
288
|
+
<PopoverTitle>{offset}</PopoverTitle>
|
|
289
|
+
<PopoverDescription>Spacing uses popover tokens.</PopoverDescription>
|
|
290
|
+
</PopoverContent>
|
|
291
|
+
</Popover>
|
|
292
|
+
))}
|
|
293
|
+
</div>
|
|
294
|
+
</PopoverExample>
|
|
295
|
+
|
|
296
|
+
<PopoverExample density="large" placement="right" title="RTL">
|
|
297
|
+
<div dir="ltr">
|
|
298
|
+
<Popover defaultOpen>
|
|
299
|
+
<PopoverTrigger asChild>
|
|
300
|
+
<Button dir="rtl" size="sm" variant="outline">
|
|
301
|
+
افتح المنبثق
|
|
302
|
+
<InfoIcon aria-hidden="true" />
|
|
303
|
+
</Button>
|
|
304
|
+
</PopoverTrigger>
|
|
305
|
+
<PopoverContent align="start" dir="rtl" side="right" size="md">
|
|
306
|
+
<PopoverHeader>
|
|
307
|
+
<div className="grid min-w-0 gap-1">
|
|
308
|
+
<PopoverTitle>{rtlTitle}</PopoverTitle>
|
|
309
|
+
<PopoverDescription>{rtlDescription}</PopoverDescription>
|
|
310
|
+
</div>
|
|
311
|
+
<PopoverClose />
|
|
312
|
+
</PopoverHeader>
|
|
313
|
+
</PopoverContent>
|
|
314
|
+
</Popover>
|
|
315
|
+
</div>
|
|
316
|
+
</PopoverExample>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
type PopoverExampleDensity = "standard" | "large" | "matrix"
|
|
323
|
+
type PopoverExamplePlacement = "bottom" | "top" | "left" | "right" | "center"
|
|
324
|
+
|
|
325
|
+
function PopoverExample({
|
|
326
|
+
children,
|
|
327
|
+
density = "standard",
|
|
328
|
+
placement = "bottom",
|
|
329
|
+
title,
|
|
330
|
+
}: {
|
|
331
|
+
children: React.ReactNode
|
|
332
|
+
density?: PopoverExampleDensity
|
|
333
|
+
placement?: PopoverExamplePlacement
|
|
334
|
+
title: string
|
|
335
|
+
}) {
|
|
336
|
+
return (
|
|
337
|
+
<div
|
|
338
|
+
data-popover-example={title}
|
|
339
|
+
className={cn(
|
|
340
|
+
"rounded-md border border-border bg-background p-4",
|
|
341
|
+
popoverExampleWidthClasses[density]
|
|
342
|
+
)}
|
|
343
|
+
>
|
|
344
|
+
<p className="text-xs font-semibold text-muted-foreground">{title}</p>
|
|
345
|
+
<div
|
|
346
|
+
className={cn(
|
|
347
|
+
"mt-4 flex overflow-visible",
|
|
348
|
+
popoverExampleStageHeightClasses[density],
|
|
349
|
+
popoverExamplePlacementClasses[placement]
|
|
350
|
+
)}
|
|
351
|
+
>
|
|
352
|
+
{children}
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const popoverExampleWidthClasses: Record<PopoverExampleDensity, string> = {
|
|
359
|
+
standard: "min-w-[calc(var(--bh-space-18xl-320)+var(--bh-popover-sm-width))]",
|
|
360
|
+
large: "min-w-[calc(var(--bh-popover-lg-width)+var(--bh-space-19xl-384))]",
|
|
361
|
+
matrix:
|
|
362
|
+
"min-w-[calc(var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-popover-sm-width)+var(--bh-space-18xl-320))]",
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const popoverExampleStageHeightClasses: Record<PopoverExampleDensity, string> = {
|
|
366
|
+
standard: "min-h-[calc(var(--bh-popover-sm-width)+var(--bh-space-13xl-160))]",
|
|
367
|
+
large: "min-h-[calc(var(--bh-popover-lg-width)+var(--bh-space-13xl-160))]",
|
|
368
|
+
matrix: "min-h-[calc(var(--bh-popover-sm-width)+var(--bh-space-13xl-160))]",
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const popoverExamplePlacementClasses: Record<PopoverExamplePlacement, string> = {
|
|
372
|
+
bottom: "items-start justify-center pt-[var(--bh-space-6xl-32)]",
|
|
373
|
+
center: "items-center justify-center",
|
|
374
|
+
left: "items-center justify-end",
|
|
375
|
+
right: "items-center justify-start",
|
|
376
|
+
top: "items-end justify-center pb-[var(--bh-space-6xl-32)]",
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function BasicPopoverContent() {
|
|
380
|
+
return (
|
|
381
|
+
<>
|
|
382
|
+
<PopoverTitle>Popover title</PopoverTitle>
|
|
383
|
+
<PopoverDescription>
|
|
384
|
+
This is a popover with some helpful content.
|
|
385
|
+
</PopoverDescription>
|
|
386
|
+
</>
|
|
387
|
+
)
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function LargeContent() {
|
|
391
|
+
return (
|
|
392
|
+
<>
|
|
393
|
+
<PopoverHeader>
|
|
394
|
+
<div className="grid min-w-0 gap-1">
|
|
395
|
+
<PopoverTitle>Details</PopoverTitle>
|
|
396
|
+
<PopoverDescription>
|
|
397
|
+
Larger content can hold explanations, lists, images, and actions.
|
|
398
|
+
</PopoverDescription>
|
|
399
|
+
</div>
|
|
400
|
+
<PopoverClose />
|
|
401
|
+
</PopoverHeader>
|
|
402
|
+
<PopoverBody>
|
|
403
|
+
<div className="grid gap-3 rounded-[var(--bh-radius-lg-8)] bg-[var(--bh-bg-neutral-subtle)] p-3">
|
|
404
|
+
<div className="h-16 rounded-[var(--bh-radius-md-6)] bg-[var(--bh-bg-raised)]" />
|
|
405
|
+
<div className="flex flex-wrap gap-2">
|
|
406
|
+
<Badge color="green" type="dot">
|
|
407
|
+
Ready
|
|
408
|
+
</Badge>
|
|
409
|
+
<Badge color="blue">Analytics</Badge>
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
</PopoverBody>
|
|
413
|
+
<PopoverFooter>
|
|
414
|
+
<Button size="xs" variant="ghost">
|
|
415
|
+
Dismiss
|
|
416
|
+
</Button>
|
|
417
|
+
<Button size="xs">Review</Button>
|
|
418
|
+
</PopoverFooter>
|
|
419
|
+
</>
|
|
420
|
+
)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function FilterContent() {
|
|
424
|
+
return (
|
|
425
|
+
<>
|
|
426
|
+
<PopoverHeader>
|
|
427
|
+
<div className="grid min-w-0 gap-1">
|
|
428
|
+
<PopoverTitle>Status</PopoverTitle>
|
|
429
|
+
<PopoverDescription>Narrow the table results.</PopoverDescription>
|
|
430
|
+
</div>
|
|
431
|
+
<PopoverClose />
|
|
432
|
+
</PopoverHeader>
|
|
433
|
+
<PopoverBody>
|
|
434
|
+
<Input
|
|
435
|
+
className="[--bh-input-width:100%]"
|
|
436
|
+
hasInformationIcon={false}
|
|
437
|
+
leadingIcon={<SearchIcon aria-hidden="true" />}
|
|
438
|
+
placeholder="Search filters"
|
|
439
|
+
size="md"
|
|
440
|
+
/>
|
|
441
|
+
<div className="grid gap-2">
|
|
442
|
+
{filterOptions.map((option, index) => (
|
|
443
|
+
<label
|
|
444
|
+
className="flex items-center gap-2 text-[length:var(--bh-text-body-xs-regular-font-size)] font-[var(--bh-text-body-xs-regular-font-weight)] leading-[var(--bh-text-body-xs-regular-line-height)] tracking-[var(--bh-text-body-xs-regular-letter-spacing)] text-[var(--bh-content-default)]"
|
|
445
|
+
key={option}
|
|
446
|
+
>
|
|
447
|
+
<Checkbox defaultChecked={index === 0} />
|
|
448
|
+
<span>{option}</span>
|
|
449
|
+
</label>
|
|
450
|
+
))}
|
|
451
|
+
</div>
|
|
452
|
+
<Select
|
|
453
|
+
className="[--bh-select-width:100%]"
|
|
454
|
+
expandIcon={<ChevronDownIcon aria-hidden="true" />}
|
|
455
|
+
hasLabel={false}
|
|
456
|
+
leadingIcon={<BellIcon aria-hidden="true" />}
|
|
457
|
+
size="md"
|
|
458
|
+
value="Last 30 days"
|
|
459
|
+
/>
|
|
460
|
+
</PopoverBody>
|
|
461
|
+
<PopoverFooter>
|
|
462
|
+
<Button size="xs" variant="ghost">
|
|
463
|
+
Reset
|
|
464
|
+
</Button>
|
|
465
|
+
<Button size="xs">Apply</Button>
|
|
466
|
+
</PopoverFooter>
|
|
467
|
+
</>
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function SettingsContent() {
|
|
472
|
+
return (
|
|
473
|
+
<>
|
|
474
|
+
<PopoverHeader>
|
|
475
|
+
<div className="grid min-w-0 gap-1">
|
|
476
|
+
<PopoverTitle>Settings</PopoverTitle>
|
|
477
|
+
<PopoverDescription>Update notification preferences.</PopoverDescription>
|
|
478
|
+
</div>
|
|
479
|
+
<PopoverClose />
|
|
480
|
+
</PopoverHeader>
|
|
481
|
+
<PopoverBody>
|
|
482
|
+
<ToggleField controlPosition="end" defaultChecked label="Email notifications" />
|
|
483
|
+
<ToggleField controlPosition="end" defaultChecked label="Push notifications" />
|
|
484
|
+
<ToggleField controlPosition="end" label="Dark mode" />
|
|
485
|
+
<Select
|
|
486
|
+
className="[--bh-select-width:100%]"
|
|
487
|
+
expandIcon={<ChevronDownIcon aria-hidden="true" />}
|
|
488
|
+
hasLabel
|
|
489
|
+
label="Language"
|
|
490
|
+
size="md"
|
|
491
|
+
value="English"
|
|
492
|
+
/>
|
|
493
|
+
<Button className="justify-between" size="sm" variant="ghost">
|
|
494
|
+
Preferences
|
|
495
|
+
<ChevronRightIcon aria-hidden="true" data-rtl-flip="true" />
|
|
496
|
+
</Button>
|
|
497
|
+
</PopoverBody>
|
|
498
|
+
</>
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function ActionsContent() {
|
|
503
|
+
return (
|
|
504
|
+
<Menu
|
|
505
|
+
aria-label="Popover actions"
|
|
506
|
+
className="w-[var(--bh-popover-action-width,var(--bh-menu-width))] bg-transparent py-0 shadow-none"
|
|
507
|
+
width="auto"
|
|
508
|
+
>
|
|
509
|
+
<MenuItem>
|
|
510
|
+
<MenuItemIcon>
|
|
511
|
+
<Share2Icon aria-hidden="true" />
|
|
512
|
+
</MenuItemIcon>
|
|
513
|
+
<MenuItemText>
|
|
514
|
+
<MenuItemTitle>Share</MenuItemTitle>
|
|
515
|
+
</MenuItemText>
|
|
516
|
+
</MenuItem>
|
|
517
|
+
<MenuItem>
|
|
518
|
+
<MenuItemIcon>
|
|
519
|
+
<DownloadIcon aria-hidden="true" />
|
|
520
|
+
</MenuItemIcon>
|
|
521
|
+
<MenuItemText>
|
|
522
|
+
<MenuItemTitle>Export</MenuItemTitle>
|
|
523
|
+
</MenuItemText>
|
|
524
|
+
</MenuItem>
|
|
525
|
+
<MenuItem>
|
|
526
|
+
<MenuItemIcon>
|
|
527
|
+
<PrinterIcon aria-hidden="true" />
|
|
528
|
+
</MenuItemIcon>
|
|
529
|
+
<MenuItemText>
|
|
530
|
+
<MenuItemTitle>Print</MenuItemTitle>
|
|
531
|
+
</MenuItemText>
|
|
532
|
+
</MenuItem>
|
|
533
|
+
<MenuSeparator />
|
|
534
|
+
<MenuItem>
|
|
535
|
+
<MenuItemIcon className="text-[var(--bh-content-danger-default)]">
|
|
536
|
+
<Trash2Icon aria-hidden="true" />
|
|
537
|
+
</MenuItemIcon>
|
|
538
|
+
<MenuItemText>
|
|
539
|
+
<MenuItemTitle className="text-[var(--bh-content-danger-default)]">
|
|
540
|
+
Delete
|
|
541
|
+
</MenuItemTitle>
|
|
542
|
+
</MenuItemText>
|
|
543
|
+
</MenuItem>
|
|
544
|
+
</Menu>
|
|
545
|
+
)
|
|
546
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Skeleton,
|
|
3
|
+
SkeletonAvatar,
|
|
4
|
+
SkeletonButton,
|
|
5
|
+
SkeletonCard,
|
|
6
|
+
SkeletonForm,
|
|
7
|
+
SkeletonInput,
|
|
8
|
+
SkeletonList,
|
|
9
|
+
SkeletonTable,
|
|
10
|
+
SkeletonText,
|
|
11
|
+
} from "@/components/ui/skeleton"
|
|
12
|
+
|
|
13
|
+
export function SkeletonDemo() {
|
|
14
|
+
return (
|
|
15
|
+
<div className="grid w-full max-w-5xl gap-[var(--bh-space-5xl-24)]">
|
|
16
|
+
<div className="grid gap-[var(--bh-space-4xl-20)] lg:grid-cols-2">
|
|
17
|
+
<div className="grid gap-[var(--bh-space-4xl-20)] rounded-[var(--bh-radius-lg-8)] border border-[var(--bh-border-default)] bg-[var(--bh-bg-raised)] p-[var(--bh-space-5xl-24)]">
|
|
18
|
+
<div className="flex items-start gap-[var(--bh-space-xl-12)]">
|
|
19
|
+
<SkeletonAvatar />
|
|
20
|
+
<SkeletonText
|
|
21
|
+
className="flex-1"
|
|
22
|
+
lineCount={3}
|
|
23
|
+
widths={["76%", "92%", "52%"]}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<div className="flex flex-wrap gap-[var(--bh-space-md-8)]">
|
|
27
|
+
<SkeletonButton size="sm" />
|
|
28
|
+
<SkeletonButton size="icon" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<SkeletonForm fields={3} />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div className="grid gap-[var(--bh-space-4xl-20)] xl:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]">
|
|
36
|
+
<SkeletonCard />
|
|
37
|
+
<SkeletonTable columns={4} rows={4} />
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div className="grid gap-[var(--bh-space-4xl-20)] lg:grid-cols-2">
|
|
41
|
+
<SkeletonList rows={4} />
|
|
42
|
+
<div
|
|
43
|
+
dir="rtl"
|
|
44
|
+
className="grid gap-[var(--bh-space-4xl-20)] rounded-[var(--bh-radius-lg-8)] border border-[var(--bh-border-default)] bg-[var(--bh-bg-raised)] p-[var(--bh-space-5xl-24)]"
|
|
45
|
+
>
|
|
46
|
+
<SkeletonInput />
|
|
47
|
+
<div className="flex flex-wrap gap-[var(--bh-space-md-8)]">
|
|
48
|
+
<SkeletonButton />
|
|
49
|
+
<SkeletonButton size="sm" tone="brand" />
|
|
50
|
+
</div>
|
|
51
|
+
<Skeleton className="rounded-[var(--bh-radius-full)]" tone="brand" />
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { Spinner } from "@/components/ui/spinner"
|
|
3
|
+
import { DynamicSpinner, Spinner } from "@/components/ui/spinner"
|
|
4
4
|
|
|
5
5
|
export function SpinnerDemo() {
|
|
6
6
|
return (
|
|
@@ -18,6 +18,18 @@ export function SpinnerDemo() {
|
|
|
18
18
|
className="text-danger"
|
|
19
19
|
style={{ "--bh-spinner-size": "24px" } as React.CSSProperties}
|
|
20
20
|
/>
|
|
21
|
+
<DynamicSpinner
|
|
22
|
+
className="text-primary"
|
|
23
|
+
style={{ "--bh-spinner-size": "16px" } as React.CSSProperties}
|
|
24
|
+
/>
|
|
25
|
+
<DynamicSpinner
|
|
26
|
+
className="text-success"
|
|
27
|
+
style={{ "--bh-spinner-size": "20px" } as React.CSSProperties}
|
|
28
|
+
/>
|
|
29
|
+
<DynamicSpinner
|
|
30
|
+
className="text-danger"
|
|
31
|
+
style={{ "--bh-spinner-size": "24px" } as React.CSSProperties}
|
|
32
|
+
/>
|
|
21
33
|
</div>
|
|
22
34
|
|
|
23
35
|
<div className="flex flex-wrap items-center gap-3">
|
|
@@ -31,6 +43,16 @@ export function SpinnerDemo() {
|
|
|
31
43
|
/>
|
|
32
44
|
Loading
|
|
33
45
|
</div>
|
|
46
|
+
<div
|
|
47
|
+
className="inline-flex items-center gap-2 text-sm text-muted-foreground"
|
|
48
|
+
role="status"
|
|
49
|
+
>
|
|
50
|
+
<DynamicSpinner
|
|
51
|
+
className="text-current"
|
|
52
|
+
style={{ "--bh-spinner-size": "18px" } as React.CSSProperties}
|
|
53
|
+
/>
|
|
54
|
+
Syncing
|
|
55
|
+
</div>
|
|
34
56
|
</div>
|
|
35
57
|
</div>
|
|
36
58
|
)
|
|
@@ -24,7 +24,7 @@ const demoRtlTextareaProps = {
|
|
|
24
24
|
"\u062a\u0648\u0641\u0631 \u0628\u0646\u064a\u062a\u0646\u0627 \u0627\u0644\u062a\u062d\u062a\u064a\u0629 \u0627\u0644\u0645\u062a\u0642\u062f\u0645\u0629 \u0644\u0644\u0625\u0633\u062a\u062f\u0644\u0627\u0644 \u0623\u0648\u0642\u0627\u062a \u0627\u0633\u062a\u062c\u0627\u0628\u0629 \u0642\u0635\u064a\u0631\u0629 \u0644\u0644\u063a\u0627\u064a\u0629.",
|
|
25
25
|
errorMessage: "\u0631\u0633\u0627\u0644\u0629 \u062e\u0637\u0623",
|
|
26
26
|
label: "\u0645\u0644\u0635\u0642",
|
|
27
|
-
message: "\
|
|
27
|
+
message: "\u0646\u0635 \u062a\u0648\u0636\u064a\u062d\u064a",
|
|
28
28
|
optionalText: "(\u062e\u064a\u0627\u0631\u064a)",
|
|
29
29
|
tagInputText: "\u0628\u0631\u0627\u0646\u062f\u0648...",
|
|
30
30
|
}
|