banhaten 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/README.md +86 -309
- package/banhaten.config.example.json +1 -1
- package/docs/design-system/README.md +11 -0
- package/docs/design-system/appearance-presets.md +184 -0
- package/docs/design-system/appearances/default.md +94 -0
- package/docs/design-system/appearances/rounded.md +95 -0
- package/docs/design-system/appearances/sharp.md +95 -0
- package/docs/design-system/component-showcase-consistency-report.md +217 -0
- package/docs/design-system/component-token-consistency-audit.md +163 -0
- package/docs/design-system/components/README.md +74 -0
- package/docs/design-system/components/accordion.md +51 -0
- package/docs/design-system/components/activity-feed.md +92 -0
- package/docs/design-system/components/alert-dialog.md +70 -0
- package/docs/design-system/components/alert.md +79 -0
- package/docs/design-system/components/aspect-ratio.md +44 -0
- package/docs/design-system/components/attribute.md +87 -0
- package/docs/design-system/components/autocomplete.md +74 -0
- package/docs/design-system/components/avatar.md +52 -0
- package/docs/design-system/components/badge.md +53 -0
- package/docs/design-system/components/banner.md +85 -0
- package/docs/design-system/components/breadcrumbs.md +174 -0
- package/docs/design-system/components/button-group.md +83 -0
- package/docs/design-system/components/button.md +77 -0
- package/docs/design-system/components/card.md +78 -0
- package/docs/design-system/components/carousel.md +44 -0
- package/docs/design-system/components/catalog-components.md +45 -0
- package/docs/design-system/components/chart.md +43 -0
- package/docs/design-system/components/checkbox.md +52 -0
- package/docs/design-system/components/collapsible.md +48 -0
- package/docs/design-system/components/command-bar.md +57 -0
- package/docs/design-system/components/command.md +60 -0
- package/docs/design-system/components/context-menu.md +44 -0
- package/docs/design-system/components/date-picker.md +77 -0
- package/docs/design-system/components/divider.md +101 -0
- package/docs/design-system/components/empty-state.md +55 -0
- package/docs/design-system/components/field.md +69 -0
- package/docs/design-system/components/file-upload.md +185 -0
- package/docs/design-system/components/hover-card.md +46 -0
- package/docs/design-system/components/icons.md +48 -0
- package/docs/design-system/components/input-group.md +56 -0
- package/docs/design-system/components/input-otp.md +55 -0
- package/docs/design-system/components/input.md +48 -0
- package/docs/design-system/components/kbd.md +44 -0
- package/docs/design-system/components/label.md +48 -0
- package/docs/design-system/components/menu.md +59 -0
- package/docs/design-system/components/menubar.md +45 -0
- package/docs/design-system/components/modal.md +98 -0
- package/docs/design-system/components/native-select.md +52 -0
- package/docs/design-system/components/navigation-menu.md +48 -0
- package/docs/design-system/components/onboarding-step-list-item.md +80 -0
- package/docs/design-system/components/page-header.md +84 -0
- package/docs/design-system/components/pagination.md +49 -0
- package/docs/design-system/components/popover.md +58 -0
- package/docs/design-system/components/progress-slider.md +48 -0
- package/docs/design-system/components/progress.md +75 -0
- package/docs/design-system/components/radio-card.md +49 -0
- package/docs/design-system/components/radio-group.md +55 -0
- package/docs/design-system/components/resizable.md +42 -0
- package/docs/design-system/components/scroll-area.md +45 -0
- package/docs/design-system/components/select.md +50 -0
- package/docs/design-system/components/sheet.md +65 -0
- package/docs/design-system/components/sidebar.md +68 -0
- package/docs/design-system/components/skeleton.md +73 -0
- package/docs/design-system/components/slideout.md +63 -0
- package/docs/design-system/components/slider.md +61 -0
- package/docs/design-system/components/social-button.md +47 -0
- package/docs/design-system/components/spinner.md +61 -0
- package/docs/design-system/components/steps.md +63 -0
- package/docs/design-system/components/table.md +397 -0
- package/docs/design-system/components/tabs.md +52 -0
- package/docs/design-system/components/tag.md +78 -0
- package/docs/design-system/components/textarea.md +48 -0
- package/docs/design-system/components/timeline.md +81 -0
- package/docs/design-system/components/toast.md +56 -0
- package/docs/design-system/components/toggle.md +79 -0
- package/docs/design-system/components/toolbar.md +85 -0
- package/docs/design-system/components/tooltip.md +90 -0
- package/docs/design-system/components/typography.md +18 -0
- package/docs/design-system/design-system-test-missing-items.md +368 -0
- package/docs/design-system/icons.md +69 -0
- package/docs/design-system/registry-and-cli.md +41 -0
- package/docs/design-system/tabs.md +53 -0
- package/docs/design-system/token-governance.md +38 -0
- package/package.json +83 -59
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- package/registry/components/autocomplete.tsx +637 -0
- package/registry/components/avatar.tsx +258 -22
- package/registry/components/badge.tsx +97 -35
- package/registry/components/carousel.tsx +234 -0
- package/registry/components/chart.tsx +170 -0
- package/registry/components/collapsible.tsx +69 -0
- package/registry/components/command.tsx +174 -0
- package/registry/components/context-menu.tsx +236 -0
- package/registry/components/date-picker-state.ts +253 -0
- package/registry/components/date-picker.tsx +116 -159
- package/registry/components/expanded/EmptyState.tsx +155 -0
- package/registry/components/expanded/PageHeader.tsx +1 -1
- package/registry/components/expanded/breadcrumbs.css +139 -139
- package/registry/components/expanded/catalogComponentsShowcase.css +83 -83
- package/registry/components/expanded/emptyState.css +111 -0
- package/registry/components/expanded/slideout.css +1 -0
- package/registry/components/expanded/steps.css +274 -274
- package/registry/components/expanded/table.css +1 -0
- package/registry/components/expanded/timeline.css +264 -264
- package/registry/components/field.tsx +230 -0
- package/registry/components/hover-card.tsx +48 -0
- package/registry/components/input-group.tsx +130 -0
- package/registry/components/input-otp.tsx +574 -0
- package/registry/components/input.tsx +22 -12
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +373 -8
- package/registry/components/menubar.tsx +226 -0
- package/registry/components/modal.tsx +109 -76
- package/registry/components/native-select.tsx +205 -0
- package/registry/components/navigation-menu.tsx +171 -0
- package/registry/components/popover.tsx +840 -0
- package/registry/components/radio-group.tsx +1 -1
- package/registry/components/resizable.tsx +74 -0
- package/registry/components/scroll-area.tsx +67 -0
- package/registry/components/select.tsx +6 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/skeleton.css +57 -0
- package/registry/components/skeleton.tsx +482 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/spinner.tsx +79 -11
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +2 -2
- package/registry/components/toast.tsx +131 -0
- package/registry/components/tooltip.tsx +4 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -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/carousel-demo.tsx +25 -0
- package/registry/examples/chart-demo.tsx +33 -0
- package/registry/examples/collapsible-demo.tsx +16 -0
- package/registry/examples/command-demo.tsx +42 -0
- package/registry/examples/context-menu-demo.tsx +29 -0
- package/registry/examples/expanded/command-bar-demo.tsx +236 -0
- package/registry/examples/expanded/empty-state-demo.tsx +39 -0
- package/registry/examples/expanded/tabs-demo.tsx +1 -1
- package/registry/examples/field-demo.tsx +51 -0
- package/registry/examples/hover-card-demo.tsx +23 -0
- package/registry/examples/input-demo.tsx +1 -1
- package/registry/examples/input-group-demo.tsx +16 -0
- package/registry/examples/input-otp-demo.tsx +72 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- package/registry/examples/menu-demo.tsx +101 -88
- package/registry/examples/menubar-demo.tsx +34 -0
- package/registry/examples/native-select-demo.tsx +16 -0
- package/registry/examples/navigation-menu-demo.tsx +29 -0
- package/registry/examples/popover-demo.tsx +546 -0
- package/registry/examples/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/select-demo.tsx +1 -1
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/skeleton-demo.tsx +56 -0
- package/registry/examples/spinner-demo.tsx +23 -1
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/textarea-demo.tsx +1 -1
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +895 -19
- package/registry/styles/globals.css +4733 -4602
- package/registry.json +1612 -0
- package/schema/config.schema.json +48 -0
- package/schema/registry.schema.json +85 -0
- package/schema/tokens.schema.json +63 -0
- package/src/cli/index.js +1413 -184
- package/tokens/banhaten.tokens.json +1 -1
- package/registry/assets/avatars/avatar-02.jpg +0 -0
- package/registry/assets/avatars/avatar-03.jpg +0 -0
- package/registry/assets/avatars/avatar-04.jpg +0 -0
- package/registry/assets/avatars/avatar-05.jpg +0 -0
- package/registry/assets/avatars/avatar-06.jpg +0 -0
- package/registry/assets/avatars/avatar-07.jpg +0 -0
- package/registry/assets/avatars/avatar-08.jpg +0 -0
- package/registry/assets/avatars/avatar-09.jpg +0 -0
- package/registry/assets/avatars/avatar-10.jpg +0 -0
- package/registry/assets/avatars/avatar-11.jpg +0 -0
- package/registry/assets/avatars/avatar-12.jpg +0 -0
- package/registry/assets/avatars/avatar-13.jpg +0 -0
- package/registry/assets/avatars/avatar-14.jpg +0 -0
- package/registry/assets/avatars/avatar-15.jpg +0 -0
- package/registry/assets/avatars/avatar-16.jpg +0 -0
- package/registry/assets/avatars/avatar-17.jpg +0 -0
- package/registry/assets/avatars/avatar-18.jpg +0 -0
- package/registry/assets/avatars/avatar-19.jpg +0 -0
- package/registry/assets/avatars/avatar-20.jpg +0 -0
- package/registry/assets/avatars/avatar-21.jpg +0 -0
- package/registry/assets/avatars/avatar-22.jpg +0 -0
- package/registry/assets/avatars/avatar-23.jpg +0 -0
- package/registry/assets/avatars/avatar-24.jpg +0 -0
- package/registry/assets/avatars/avatar-25.jpg +0 -0
- package/registry/assets/avatars/avatar-26.jpg +0 -0
- package/registry/assets/avatars/avatar-27.jpg +0 -0
- package/registry/assets/avatars/avatar-28.jpg +0 -0
- package/registry/assets/avatars/avatar-29.jpg +0 -0
- package/registry/assets/avatars/avatar-30.jpg +0 -0
- package/registry/assets/avatars/avatar-31.jpg +0 -0
- package/registry/assets/avatars/avatar-32.jpg +0 -0
- package/registry/assets/avatars/avatar-33.jpg +0 -0
- package/registry/assets/avatars/avatar-34.jpg +0 -0
- package/registry/assets/avatars/avatar-35.jpg +0 -0
- package/registry/assets/image-assets.json +0 -744
- package/registry/assets/images/art-02.jpg +0 -0
- package/registry/assets/images/art-03.jpg +0 -0
- package/registry/assets/images/art-04.jpg +0 -0
- package/registry/assets/images/art-05.jpg +0 -0
- package/registry/assets/images/art-06.jpg +0 -0
- package/registry/assets/images/art-07.jpg +0 -0
- package/registry/assets/images/art-08.jpg +0 -0
- package/registry/assets/images/art-09.jpg +0 -0
- package/registry/assets/images/art-10.jpg +0 -0
- package/registry/assets/images/art-11.jpg +0 -0
- package/registry/assets/images/art-12.jpg +0 -0
- package/registry/assets/images/art-13.jpg +0 -0
- package/registry/assets/images/art-14.jpg +0 -0
- package/registry/assets/images/art-15.jpg +0 -0
- package/registry/assets/images/art-16.jpg +0 -0
- package/registry/assets/images/art-17.jpg +0 -0
- package/registry/assets/images/art-18.jpg +0 -0
- package/registry/assets/images/art-19.jpg +0 -0
- package/registry/assets/images/art-20.jpg +0 -0
- package/registry/assets/images/art-21.jpg +0 -0
- package/registry/assets/images/art-22.jpg +0 -0
- package/registry/assets/images/art-23.jpg +0 -0
- package/registry/assets/images/art-24.jpg +0 -0
- package/registry/assets/images/art-25.jpg +0 -0
- package/registry/assets/images/art-26.jpg +0 -0
- package/registry/assets/images/art-27.jpg +0 -0
- package/registry/assets/images/nature-01.jpg +0 -0
- package/registry/assets/images/nature-02.jpg +0 -0
- package/registry/assets/images/nature-03.jpg +0 -0
- package/registry/assets/images/nature-04.jpg +0 -0
- package/registry/assets/images/nature-05.jpg +0 -0
- package/registry/assets/images/nature-06.jpg +0 -0
- package/registry/assets/images/nature-07.jpg +0 -0
- package/registry/assets/images/nature-08.jpg +0 -0
- package/registry/assets/images/nature-09.jpg +0 -0
- package/registry/assets/images/nature-10.jpg +0 -0
- package/registry/assets/images/nature-11.jpg +0 -0
- package/registry/assets/images/nature-12.jpg +0 -0
- package/registry/assets/images/nature-13.jpg +0 -0
- package/registry/assets/images/nature-14.jpg +0 -0
- package/registry/assets/images/nature-15.jpg +0 -0
- package/registry/assets/images/nature-16.jpg +0 -0
- package/registry/assets/images/nature-17.jpg +0 -0
- package/registry/assets/images/nature-18.jpg +0 -0
- package/registry/assets/images/nature-19.jpg +0 -0
- package/registry/assets/images/nature-20.jpg +0 -0
- package/registry/components/expanded/Tabs.tsx +0 -86
|
@@ -1,5 +1,101 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import {
|
|
3
|
+
BoxIcon,
|
|
4
|
+
CheckIcon,
|
|
5
|
+
CloudIcon,
|
|
6
|
+
EyeIcon,
|
|
7
|
+
FileTextIcon,
|
|
8
|
+
GitPullRequestIcon,
|
|
9
|
+
LayoutGridIcon,
|
|
10
|
+
MessageSquareIcon,
|
|
11
|
+
PencilIcon,
|
|
12
|
+
RefreshCcwIcon,
|
|
13
|
+
SearchIcon,
|
|
14
|
+
Settings2Icon,
|
|
15
|
+
ShieldCheckIcon,
|
|
16
|
+
WorkflowIcon,
|
|
17
|
+
XIcon,
|
|
18
|
+
} from "lucide-react"
|
|
19
|
+
|
|
20
|
+
import { Avatar, AvatarIcon, AvatarStatus } from "@/components/ui/avatar"
|
|
21
|
+
import { Badge } from "@/components/ui/badge"
|
|
22
|
+
import { Button } from "@/components/ui/button"
|
|
23
|
+
import {
|
|
24
|
+
Menu,
|
|
25
|
+
MenuItem,
|
|
26
|
+
MenuItemDescription,
|
|
27
|
+
MenuItemText,
|
|
28
|
+
MenuItemTitle,
|
|
29
|
+
} from "@/components/ui/menu"
|
|
30
|
+
import { ModalBody, ModalHeader, ModalSurface } from "@/components/ui/modal"
|
|
31
|
+
import {
|
|
32
|
+
Toolbar,
|
|
33
|
+
ToolbarButton,
|
|
34
|
+
ToolbarSearch,
|
|
35
|
+
ToolbarSection,
|
|
36
|
+
} from "@/components/ui/toolbar"
|
|
1
37
|
import { CommandBar } from "@/components/ui/expanded/CommandBar"
|
|
2
38
|
|
|
39
|
+
type ToolTone = "neutral" | "blue" | "green" | "amber" | "purple" | "sky"
|
|
40
|
+
type ToolIcon = React.ComponentType<React.SVGProps<SVGSVGElement>>
|
|
41
|
+
|
|
42
|
+
type ToolItem = {
|
|
43
|
+
added?: boolean
|
|
44
|
+
description?: string
|
|
45
|
+
icon: ToolIcon
|
|
46
|
+
title: string
|
|
47
|
+
tone?: ToolTone
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const popularTools: ToolItem[] = [
|
|
51
|
+
{
|
|
52
|
+
added: true,
|
|
53
|
+
icon: EyeIcon,
|
|
54
|
+
title: "View repositories & issues",
|
|
55
|
+
tone: "green",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
description: "Create, comment, update issues",
|
|
59
|
+
icon: PencilIcon,
|
|
60
|
+
title: "Create & update issues",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
description: "Use commit and repo activity",
|
|
64
|
+
icon: RefreshCcwIcon,
|
|
65
|
+
title: "Sync commits and activity",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
description: "Review and update pull requests",
|
|
69
|
+
icon: GitPullRequestIcon,
|
|
70
|
+
title: "Manage pull requests",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
description: "Run GitHub workflows",
|
|
74
|
+
icon: WorkflowIcon,
|
|
75
|
+
title: "Trigger workflows & automations",
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
const serverTools: ToolItem[] = [
|
|
80
|
+
{ icon: BoxIcon, title: "Box", tone: "blue" },
|
|
81
|
+
{ icon: CloudIcon, title: "Google Drive", tone: "green" },
|
|
82
|
+
{ icon: Settings2Icon, title: "Hubspot", tone: "amber" },
|
|
83
|
+
{ icon: MessageSquareIcon, title: "Intercom", tone: "sky" },
|
|
84
|
+
{ icon: WorkflowIcon, title: "Jira", tone: "blue" },
|
|
85
|
+
{ icon: FileTextIcon, title: "Notion" },
|
|
86
|
+
{ icon: ShieldCheckIcon, title: "Okta" },
|
|
87
|
+
{ icon: CloudIcon, title: "Salesforce", tone: "sky" },
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
const toolToneClassNames: Record<ToolTone, string> = {
|
|
91
|
+
amber: "text-[var(--bh-content-accent-amber-default)]",
|
|
92
|
+
blue: "text-[var(--bh-content-accent-blue-default)]",
|
|
93
|
+
green: "text-[var(--bh-content-accent-green-default)]",
|
|
94
|
+
neutral: "text-[var(--bh-content-subtle)]",
|
|
95
|
+
purple: "text-[var(--bh-content-accent-purple-default)]",
|
|
96
|
+
sky: "text-[var(--bh-content-accent-sky-default)]",
|
|
97
|
+
}
|
|
98
|
+
|
|
3
99
|
export function CommandBarDemo() {
|
|
4
100
|
return (
|
|
5
101
|
<div className="grid gap-6">
|
|
@@ -8,3 +104,143 @@ export function CommandBarDemo() {
|
|
|
8
104
|
</div>
|
|
9
105
|
)
|
|
10
106
|
}
|
|
107
|
+
|
|
108
|
+
export function AddToolPickerExample() {
|
|
109
|
+
return (
|
|
110
|
+
<ModalSurface
|
|
111
|
+
aria-label="Add tool command example"
|
|
112
|
+
className={[
|
|
113
|
+
"[--bh-modal-width:calc(var(--bh-space-19xl-384)+var(--bh-space-18xl-320)+var(--bh-space-8xl-48))]",
|
|
114
|
+
"rounded-[var(--bh-radius-6xl-28)]",
|
|
115
|
+
].join(" ")}
|
|
116
|
+
size="lg"
|
|
117
|
+
>
|
|
118
|
+
<ModalHeader className="items-start justify-between px-[var(--bh-space-5xl-24)] pb-[var(--bh-space-lg-10)] pe-[var(--bh-space-5xl-24)] pt-[var(--bh-space-5xl-24)]">
|
|
119
|
+
<h2 className="min-w-0 flex-1 text-start text-[length:var(--bh-text-heading-sm-semibold-font-size)] font-[var(--bh-text-heading-sm-semibold-font-weight)] leading-[var(--bh-text-heading-sm-semibold-line-height)] tracking-[var(--bh-text-heading-sm-semibold-letter-spacing)] text-[var(--bh-content-default)]">
|
|
120
|
+
Add tool
|
|
121
|
+
</h2>
|
|
122
|
+
<Button aria-label="Close add tool" size="icon" type="button" variant="ghost">
|
|
123
|
+
<XIcon aria-hidden="true" />
|
|
124
|
+
</Button>
|
|
125
|
+
</ModalHeader>
|
|
126
|
+
|
|
127
|
+
<ModalBody className="grid w-full gap-[var(--bh-space-4xl-20)] px-[var(--bh-space-5xl-24)] pb-[var(--bh-space-6xl-32)] pt-0">
|
|
128
|
+
<ToolbarSearch
|
|
129
|
+
aria-label="Search tools"
|
|
130
|
+
icon={<SearchIcon aria-hidden="true" />}
|
|
131
|
+
placeholder="Search..."
|
|
132
|
+
width="full"
|
|
133
|
+
/>
|
|
134
|
+
|
|
135
|
+
<Toolbar aria-label="Tool source filters" className="overflow-x-auto" wrap>
|
|
136
|
+
<ToolbarSection wrap>
|
|
137
|
+
<ToolCategory icon={Settings2Icon}>All</ToolCategory>
|
|
138
|
+
<ToolCategory icon={LayoutGridIcon}>Apps</ToolCategory>
|
|
139
|
+
<ToolCategory active icon={LayoutGridIcon}>
|
|
140
|
+
MCP
|
|
141
|
+
</ToolCategory>
|
|
142
|
+
</ToolbarSection>
|
|
143
|
+
</Toolbar>
|
|
144
|
+
|
|
145
|
+
<ToolSection items={popularTools} title="Popular" />
|
|
146
|
+
<ToolSection items={serverTools} title="Servers" />
|
|
147
|
+
</ModalBody>
|
|
148
|
+
</ModalSurface>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function ToolCategory({
|
|
153
|
+
active = false,
|
|
154
|
+
children,
|
|
155
|
+
icon: Icon,
|
|
156
|
+
}: {
|
|
157
|
+
active?: boolean
|
|
158
|
+
children: React.ReactNode
|
|
159
|
+
icon: ToolIcon
|
|
160
|
+
}) {
|
|
161
|
+
return (
|
|
162
|
+
<ToolbarButton
|
|
163
|
+
aria-pressed={active}
|
|
164
|
+
className={[
|
|
165
|
+
"rounded-[var(--bh-radius-none)] border-b-[length:var(--bh-border-width-strong)] px-[var(--bh-space-xs-4)]",
|
|
166
|
+
active
|
|
167
|
+
? "border-b-[var(--bh-border-accent-purple-strong)] text-[var(--bh-content-accent-purple-default)]"
|
|
168
|
+
: "border-b-transparent text-[var(--bh-content-subtle)]",
|
|
169
|
+
].join(" ")}
|
|
170
|
+
size="sm"
|
|
171
|
+
type="button"
|
|
172
|
+
variant="ghost"
|
|
173
|
+
>
|
|
174
|
+
<Icon aria-hidden="true" data-icon="inline-start" />
|
|
175
|
+
{children}
|
|
176
|
+
</ToolbarButton>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function ToolSection({ items, title }: { items: ToolItem[]; title: string }) {
|
|
181
|
+
return (
|
|
182
|
+
<section className="grid gap-[var(--bh-space-xl-12)]" aria-label={title}>
|
|
183
|
+
<h3 className="text-start text-[length:var(--bh-text-body-md-medium-font-size)] font-[var(--bh-text-body-md-medium-font-weight)] leading-[var(--bh-text-body-md-medium-line-height)] tracking-[var(--bh-text-body-md-medium-letter-spacing)] text-[var(--bh-content-subtle)]">
|
|
184
|
+
{title}
|
|
185
|
+
</h3>
|
|
186
|
+
<div className="grid gap-[var(--bh-space-md-8)] sm:grid-cols-2">
|
|
187
|
+
{items.map((item) => (
|
|
188
|
+
<ToolRow item={item} key={item.title} />
|
|
189
|
+
))}
|
|
190
|
+
</div>
|
|
191
|
+
</section>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function ToolRow({ item }: { item: ToolItem }) {
|
|
196
|
+
const Icon = item.icon
|
|
197
|
+
const tone = item.tone ?? "neutral"
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<Menu
|
|
201
|
+
aria-label={`${item.title} tool action`}
|
|
202
|
+
className="w-full bg-transparent p-0 shadow-none"
|
|
203
|
+
width="auto"
|
|
204
|
+
>
|
|
205
|
+
<MenuItem
|
|
206
|
+
aria-label={item.title}
|
|
207
|
+
className="min-h-[var(--bh-space-8xl-48)] px-[var(--bh-space-xs-4)] py-[var(--bh-space-xxs-2)]"
|
|
208
|
+
kind="multiline"
|
|
209
|
+
role="menuitem"
|
|
210
|
+
>
|
|
211
|
+
<Avatar shape="rounded" size="lg">
|
|
212
|
+
<AvatarIcon
|
|
213
|
+
className={[
|
|
214
|
+
"border border-[var(--bh-border-subtle)]",
|
|
215
|
+
"[&_svg]:size-[var(--bh-space-4xl-20)]",
|
|
216
|
+
toolToneClassNames[tone],
|
|
217
|
+
].join(" ")}
|
|
218
|
+
size="lg"
|
|
219
|
+
>
|
|
220
|
+
<Icon aria-hidden="true" strokeWidth={2} />
|
|
221
|
+
</AvatarIcon>
|
|
222
|
+
{item.added ? <AvatarStatus size="small" status="available" /> : null}
|
|
223
|
+
</Avatar>
|
|
224
|
+
<MenuItemText>
|
|
225
|
+
<MenuItemTitle className="font-[var(--bh-text-body-md-medium-font-weight)]">
|
|
226
|
+
{item.title}
|
|
227
|
+
</MenuItemTitle>
|
|
228
|
+
{item.added ? (
|
|
229
|
+
<Badge
|
|
230
|
+
badgeStyle="light"
|
|
231
|
+
className="self-start"
|
|
232
|
+
color="green"
|
|
233
|
+
size="sm"
|
|
234
|
+
type="leading-icon"
|
|
235
|
+
>
|
|
236
|
+
<CheckIcon aria-hidden="true" />
|
|
237
|
+
Added
|
|
238
|
+
</Badge>
|
|
239
|
+
) : item.description ? (
|
|
240
|
+
<MenuItemDescription>{item.description}</MenuItemDescription>
|
|
241
|
+
) : null}
|
|
242
|
+
</MenuItemText>
|
|
243
|
+
</MenuItem>
|
|
244
|
+
</Menu>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InboxIcon, PlusIcon, SearchIcon } from "lucide-react"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
EmptyState,
|
|
5
|
+
type EmptyStateAction,
|
|
6
|
+
} from "@/components/ui/expanded/EmptyState"
|
|
7
|
+
|
|
8
|
+
const searchActions: EmptyStateAction[] = [
|
|
9
|
+
{ label: "Reset filters", variant: "secondary" },
|
|
10
|
+
{ label: "Create item" },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
const inboxActions: EmptyStateAction[] = [
|
|
14
|
+
{
|
|
15
|
+
icon: <PlusIcon data-icon="inline-start" />,
|
|
16
|
+
label: "Add record",
|
|
17
|
+
},
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
export function EmptyStateDemo() {
|
|
21
|
+
return (
|
|
22
|
+
<div className="grid gap-6">
|
|
23
|
+
<EmptyState
|
|
24
|
+
actions={searchActions}
|
|
25
|
+
description="Try adjusting your search or filters"
|
|
26
|
+
icon={<SearchIcon />}
|
|
27
|
+
title="No results found"
|
|
28
|
+
/>
|
|
29
|
+
<EmptyState
|
|
30
|
+
actions={inboxActions}
|
|
31
|
+
align="start"
|
|
32
|
+
description="Create a record to start tracking this workflow."
|
|
33
|
+
icon={<InboxIcon />}
|
|
34
|
+
size="compact"
|
|
35
|
+
title="Nothing here yet"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Button } from "@/components/ui/button"
|
|
2
|
+
import {
|
|
3
|
+
Field,
|
|
4
|
+
FieldContent,
|
|
5
|
+
FieldControl,
|
|
6
|
+
FieldDescription,
|
|
7
|
+
FieldError,
|
|
8
|
+
FieldGroup,
|
|
9
|
+
FieldLabel,
|
|
10
|
+
FieldLegend,
|
|
11
|
+
FieldSet,
|
|
12
|
+
} from "@/components/ui/field"
|
|
13
|
+
import { Input } from "@/components/ui/input"
|
|
14
|
+
import { Textarea } from "@/components/ui/textarea"
|
|
15
|
+
|
|
16
|
+
export function FieldDemo() {
|
|
17
|
+
return (
|
|
18
|
+
<FieldSet>
|
|
19
|
+
<FieldLegend>Account details</FieldLegend>
|
|
20
|
+
<FieldGroup>
|
|
21
|
+
<Field>
|
|
22
|
+
<FieldLabel>Email</FieldLabel>
|
|
23
|
+
<FieldControl>
|
|
24
|
+
<Input placeholder="name@example.com" />
|
|
25
|
+
</FieldControl>
|
|
26
|
+
<FieldDescription>Use your work email for team access.</FieldDescription>
|
|
27
|
+
</Field>
|
|
28
|
+
|
|
29
|
+
<Field invalid>
|
|
30
|
+
<FieldLabel>Workspace</FieldLabel>
|
|
31
|
+
<FieldControl>
|
|
32
|
+
<Input state="error" valueText="Banhaten" />
|
|
33
|
+
</FieldControl>
|
|
34
|
+
<FieldError>Workspace name is already taken.</FieldError>
|
|
35
|
+
</Field>
|
|
36
|
+
|
|
37
|
+
<Field orientation="responsive">
|
|
38
|
+
<FieldContent>
|
|
39
|
+
<FieldLabel>Notes</FieldLabel>
|
|
40
|
+
<FieldDescription>Visible to workspace administrators.</FieldDescription>
|
|
41
|
+
</FieldContent>
|
|
42
|
+
<FieldControl>
|
|
43
|
+
<Textarea placeholder="Add setup notes..." />
|
|
44
|
+
</FieldControl>
|
|
45
|
+
</Field>
|
|
46
|
+
|
|
47
|
+
<Button size="sm">Save details</Button>
|
|
48
|
+
</FieldGroup>
|
|
49
|
+
</FieldSet>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HoverCard,
|
|
3
|
+
HoverCardContent,
|
|
4
|
+
HoverCardTrigger,
|
|
5
|
+
} from "@/components/ui/hover-card"
|
|
6
|
+
|
|
7
|
+
export function HoverCardDemo() {
|
|
8
|
+
return (
|
|
9
|
+
<HoverCard>
|
|
10
|
+
<HoverCardTrigger className="underline underline-offset-4">
|
|
11
|
+
Workspace profile
|
|
12
|
+
</HoverCardTrigger>
|
|
13
|
+
<HoverCardContent>
|
|
14
|
+
<div className="grid gap-1">
|
|
15
|
+
<strong>Design System</strong>
|
|
16
|
+
<span className="text-sm text-[var(--bh-content-subtle)]">
|
|
17
|
+
Tokens, components, and RTL-ready examples.
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
</HoverCardContent>
|
|
21
|
+
</HoverCard>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -26,7 +26,7 @@ const demoRtlInputProps = {
|
|
|
26
26
|
...demoInputProps,
|
|
27
27
|
errorMessage: "\u0631\u0633\u0627\u0644\u0629 \u062e\u0637\u0623",
|
|
28
28
|
label: "\u0645\u0644\u0635\u0642",
|
|
29
|
-
message: "\
|
|
29
|
+
message: "\u0646\u0635 \u062a\u0648\u0636\u064a\u062d\u064a",
|
|
30
30
|
optionalText: "(\u062e\u064a\u0627\u0631\u064a)",
|
|
31
31
|
placeholder: "\u0627\u0644\u0646\u0635",
|
|
32
32
|
valueText: "\u0646\u0635 \u0647\u0646\u0627",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputGroup,
|
|
3
|
+
InputGroupAddon,
|
|
4
|
+
InputGroupButton,
|
|
5
|
+
InputGroupInput,
|
|
6
|
+
} from "@/components/ui/input-group"
|
|
7
|
+
|
|
8
|
+
export function InputGroupDemo() {
|
|
9
|
+
return (
|
|
10
|
+
<InputGroup>
|
|
11
|
+
<InputGroupAddon>https://</InputGroupAddon>
|
|
12
|
+
<InputGroupInput aria-label="Workspace URL" defaultValue="banhaten.design" />
|
|
13
|
+
<InputGroupButton>Save</InputGroupButton>
|
|
14
|
+
</InputGroup>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { InputOTP } from "@/components/ui/input-otp"
|
|
2
|
+
|
|
3
|
+
export function InputOTPDemo() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="grid gap-6">
|
|
6
|
+
<div className="flex flex-wrap items-start gap-6">
|
|
7
|
+
<InputOTP
|
|
8
|
+
label="Verification code"
|
|
9
|
+
message="Enter the code from your authenticator."
|
|
10
|
+
name="verification-code"
|
|
11
|
+
/>
|
|
12
|
+
<InputOTP
|
|
13
|
+
defaultValue="482159"
|
|
14
|
+
label="Filled code"
|
|
15
|
+
state="filled"
|
|
16
|
+
/>
|
|
17
|
+
<InputOTP
|
|
18
|
+
defaultValue="482"
|
|
19
|
+
errorMessage="The code is incomplete."
|
|
20
|
+
label="Recovery code"
|
|
21
|
+
state="error"
|
|
22
|
+
/>
|
|
23
|
+
<InputOTP
|
|
24
|
+
defaultValue="482159"
|
|
25
|
+
label="Disabled code"
|
|
26
|
+
state="disabled"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div className="flex flex-wrap items-start gap-6">
|
|
31
|
+
<InputOTP
|
|
32
|
+
defaultValue="482159"
|
|
33
|
+
label="Masked code"
|
|
34
|
+
mask
|
|
35
|
+
state="filled"
|
|
36
|
+
/>
|
|
37
|
+
<InputOTP
|
|
38
|
+
defaultValue="4821"
|
|
39
|
+
groupSize={2}
|
|
40
|
+
label="Four digit code"
|
|
41
|
+
length={4}
|
|
42
|
+
size="md"
|
|
43
|
+
state="filled"
|
|
44
|
+
variant="soft"
|
|
45
|
+
/>
|
|
46
|
+
<InputOTP
|
|
47
|
+
defaultValue="48215983"
|
|
48
|
+
groupSize={4}
|
|
49
|
+
label="Backup code"
|
|
50
|
+
length={8}
|
|
51
|
+
state="filled"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div dir="rtl" className="flex flex-wrap items-start gap-6">
|
|
56
|
+
<InputOTP
|
|
57
|
+
defaultValue="482159"
|
|
58
|
+
dir="rtl"
|
|
59
|
+
label="رمز التحقق"
|
|
60
|
+
message="أدخل الرمز المرسل إليك."
|
|
61
|
+
state="filled"
|
|
62
|
+
/>
|
|
63
|
+
<InputOTP
|
|
64
|
+
dir="rtl"
|
|
65
|
+
errorMessage="الرمز غير مكتمل."
|
|
66
|
+
label="رمز الأمان"
|
|
67
|
+
state="error"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Checkbox } from "@/components/ui/checkbox"
|
|
2
|
+
import { Label } from "@/components/ui/label"
|
|
3
|
+
|
|
4
|
+
export function LabelDemo() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="grid gap-4">
|
|
7
|
+
<div className="flex items-center gap-[var(--bh-space-md-8)]">
|
|
8
|
+
<Checkbox id="terms" />
|
|
9
|
+
<Label htmlFor="terms">Accept terms and conditions</Label>
|
|
10
|
+
</div>
|
|
11
|
+
<Label optionalText="(Optional)">Project name</Label>
|
|
12
|
+
<div dir="rtl" className="flex items-center gap-[var(--bh-space-md-8)]">
|
|
13
|
+
<Checkbox id="terms-rtl" />
|
|
14
|
+
<Label htmlFor="terms-rtl" required>
|
|
15
|
+
قبول الشروط والأحكام
|
|
16
|
+
</Label>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|