banhaten 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +4 -4
- package/docs/design-system/component-implementation-ownership-audit.md +2 -1
- package/docs/design-system/component-quality-audit-2026-08-20.md +4 -2
- package/docs/design-system/components/alert-dialog.md +1 -1
- package/docs/design-system/components/alert.md +2 -2
- package/docs/design-system/components/attribute.md +1 -1
- package/docs/design-system/components/avatar.md +2 -2
- package/docs/design-system/components/banner.md +2 -2
- package/docs/design-system/components/breadcrumbs.md +2 -2
- package/docs/design-system/components/button-group.md +2 -2
- package/docs/design-system/components/button.md +2 -2
- package/docs/design-system/components/date-picker.md +3 -1
- package/docs/design-system/components/file-upload.md +1 -1
- package/docs/design-system/components/input.md +8 -6
- package/docs/design-system/components/item.md +3 -1
- package/docs/design-system/components/kbd.md +11 -8
- package/docs/design-system/components/menu.md +2 -2
- package/docs/design-system/components/modal.md +1 -1
- package/docs/design-system/components/onboarding-step-list-item.md +2 -2
- package/docs/design-system/components/pagination.md +2 -2
- package/docs/design-system/components/radio-card.md +1 -1
- package/docs/design-system/components/select.md +1 -1
- package/docs/design-system/components/sidebar.md +59 -19
- package/docs/design-system/components/table.md +1 -1
- package/docs/design-system/components/tag.md +3 -3
- package/docs/design-system/components/toolbar.md +1 -1
- package/docs/design-system/density-and-elevation.md +16 -12
- package/docs/design-system/icons.md +6 -1
- package/docs/design-system/installation.md +1 -1
- package/docs/design-system/token-governance.md +7 -8
- package/package.json +1 -1
- package/registry/components/alert-dialog.tsx +1 -1
- package/registry/components/alert.tsx +3 -3
- package/registry/components/attribute.tsx +8 -2
- package/registry/components/avatar.tsx +21 -17
- package/registry/components/button-group.tsx +1 -1
- package/registry/components/button.tsx +1 -1
- package/registry/components/date-picker.tsx +16 -4
- package/registry/components/expanded/OnboardingStepListItem.tsx +6 -5
- package/registry/components/expanded/banner.css +10 -5
- package/registry/components/expanded/breadcrumbs.css +4 -4
- package/registry/components/expanded/fileUpload.css +3 -3
- package/registry/components/expanded/onboardingStepListItem.css +14 -5
- package/registry/components/expanded/table.css +5 -2
- package/registry/components/input.tsx +12 -5
- package/registry/components/item.tsx +1 -1
- package/registry/components/kbd.tsx +109 -15
- package/registry/components/menu.tsx +1 -1
- package/registry/components/modal.tsx +1 -1
- package/registry/components/pagination.tsx +12 -7
- package/registry/components/radio-card.tsx +1 -2
- package/registry/components/select.tsx +1 -1
- package/registry/components/sidebar.tsx +929 -57
- package/registry/components/tag.tsx +1 -1
- package/registry/components/toolbar.tsx +1 -1
- package/registry/examples/attribute-demo.tsx +1 -1
- package/registry/examples/command-palette-demo.tsx +0 -1
- package/registry/examples/kbd-demo.tsx +2 -1
- package/registry/examples/sidebar-demo.tsx +60 -16
- package/registry/guidance/USAGE.md +1 -1
- package/registry/index.json +233 -31
- package/registry/styles/globals.css +152 -118
- package/registry.json +4 -3
- package/tokens/banhaten.tokens.json +169 -49
|
@@ -367,7 +367,7 @@ function TagIcon({
|
|
|
367
367
|
<span
|
|
368
368
|
data-slot="tag-icon"
|
|
369
369
|
className={cn(
|
|
370
|
-
"flex size-[var(--bh-
|
|
370
|
+
"flex size-[var(--bh-icon-slot-size-default)] shrink-0 items-center justify-center text-current [&_svg]:size-[var(--bh-icon-size-default)] [&_svg]:shrink-0",
|
|
371
371
|
className
|
|
372
372
|
)}
|
|
373
373
|
{...props}
|
|
@@ -71,7 +71,7 @@ const toolbarSectionVariants = cva(
|
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
const toolbarButtonVariants = cva(
|
|
74
|
-
"group/toolbar-button inline-flex min-w-0 items-center justify-center whitespace-nowrap rounded-[var(--bh-control-default)] text-[length:var(--bh-text-button-font-size)] font-[var(--bh-text-button-font-weight)] leading-[var(--bh-text-button-line-height)] tracking-[var(--bh-text-button-letter-spacing)] outline-none transition-[background-color,border-color,color,box-shadow] focus-visible:shadow-[var(--shadow-button-focus)] disabled:pointer-events-none disabled:shadow-none aria-invalid:border-[length:var(--bh-border-width-default)] aria-invalid:border-[var(--bh-border-danger-strong)] aria-invalid:shadow-[var(--shadow-button-danger-focus)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[var(--bh-button-icon-size)] [&_svg[data-icon='inline-start']]:ms-[var(--bh-button-icon-offset)] [&_svg[data-icon='inline-end']]:me-[var(--bh-button-icon-offset)] rtl:[&_svg[data-rtl-flip='true']]:-scale-x-100",
|
|
74
|
+
"group/toolbar-button inline-flex min-w-0 items-center justify-center whitespace-nowrap rounded-[var(--bh-control-default)] text-[length:var(--bh-text-button-font-size)] font-[var(--bh-text-button-font-weight)] leading-[var(--bh-text-button-line-height)] tracking-[var(--bh-text-button-letter-spacing)] outline-none transition-[background-color,border-color,color,box-shadow] focus-visible:shadow-[var(--shadow-button-focus)] disabled:pointer-events-none disabled:shadow-none aria-invalid:border-[length:var(--bh-border-width-default)] aria-invalid:border-[var(--bh-border-danger-strong)] aria-invalid:shadow-[var(--shadow-button-danger-focus)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[var(--bh-button-icon-size)] [&_svg:not([class*='size-'])]:m-[calc((var(--bh-button-icon-slot-size)-var(--bh-button-icon-size))/2)] [&_svg[data-icon='inline-start']]:ms-[calc(var(--bh-button-icon-offset)+(var(--bh-button-icon-slot-size)-var(--bh-button-icon-size))/2)] [&_svg[data-icon='inline-end']]:me-[calc(var(--bh-button-icon-offset)+(var(--bh-button-icon-slot-size)-var(--bh-button-icon-size))/2)] rtl:[&_svg[data-rtl-flip='true']]:-scale-x-100",
|
|
75
75
|
{
|
|
76
76
|
variants: {
|
|
77
77
|
variant: {
|
|
@@ -54,7 +54,7 @@ export function AttributeDemo() {
|
|
|
54
54
|
</AttributeItem>
|
|
55
55
|
<AttributeItem label="Invoice">
|
|
56
56
|
<span className="inline-flex min-w-0 items-center gap-[var(--bh-space-md-8)]">
|
|
57
|
-
<PaperclipIcon className="size-[var(--bh-
|
|
57
|
+
<PaperclipIcon className="m-[var(--bh-icon-slot-inset-default)] size-[var(--bh-icon-size-default)] shrink-0 text-[var(--bh-content-muted)]" />
|
|
58
58
|
INV-2024-00123.pdf
|
|
59
59
|
</span>
|
|
60
60
|
</AttributeItem>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kbd } from "@/components/ui/kbd"
|
|
1
|
+
import { Kbd, Shortcut } from "@/components/ui/kbd"
|
|
2
2
|
|
|
3
3
|
export function KbdDemo() {
|
|
4
4
|
return (
|
|
@@ -6,6 +6,7 @@ export function KbdDemo() {
|
|
|
6
6
|
<Kbd>⌘</Kbd>
|
|
7
7
|
<Kbd>K</Kbd>
|
|
8
8
|
<Kbd size="md">Shift</Kbd>
|
|
9
|
+
<Shortcut keys={["Mod", "K"]} />
|
|
9
10
|
</div>
|
|
10
11
|
)
|
|
11
12
|
}
|
|
@@ -1,41 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
CreditCardIcon,
|
|
3
|
+
InboxIcon,
|
|
4
|
+
LayoutGridIcon,
|
|
5
|
+
SettingsIcon,
|
|
6
|
+
UsersIcon,
|
|
7
|
+
} from "lucide-react"
|
|
2
8
|
|
|
9
|
+
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
|
|
3
10
|
import {
|
|
4
11
|
Sidebar,
|
|
5
12
|
SidebarBody,
|
|
6
13
|
SidebarFooter,
|
|
14
|
+
SidebarFooterUser,
|
|
7
15
|
SidebarGroup,
|
|
8
|
-
SidebarGroupLabel,
|
|
9
16
|
SidebarHeader,
|
|
17
|
+
SidebarHeaderWorkspaceSwitch,
|
|
10
18
|
SidebarInset,
|
|
11
19
|
SidebarMenu,
|
|
20
|
+
SidebarMenuBadge,
|
|
12
21
|
SidebarMenuButton,
|
|
13
22
|
SidebarMenuItem,
|
|
23
|
+
SidebarMenuSub,
|
|
24
|
+
SidebarMenuSubButton,
|
|
14
25
|
SidebarProvider,
|
|
15
|
-
SidebarTrigger,
|
|
16
26
|
} from "@/components/ui/sidebar"
|
|
17
27
|
|
|
18
28
|
export function SidebarDemo() {
|
|
19
29
|
return (
|
|
20
|
-
<SidebarProvider className="flex h-[var(--bh-space-
|
|
30
|
+
<SidebarProvider className="flex h-[var(--bh-space-19xl-384)]">
|
|
21
31
|
<Sidebar>
|
|
22
32
|
<SidebarHeader>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
<SidebarHeaderWorkspaceSwitch
|
|
34
|
+
image={
|
|
35
|
+
<span className="grid size-full place-items-center bg-[var(--bh-bg-brand-default)] text-xs font-semibold text-[var(--bh-content-on-brand)]">
|
|
36
|
+
AC
|
|
37
|
+
</span>
|
|
38
|
+
}
|
|
39
|
+
label="Acme Inc"
|
|
40
|
+
/>
|
|
27
41
|
</SidebarHeader>
|
|
28
42
|
<SidebarBody>
|
|
29
43
|
<SidebarGroup>
|
|
30
|
-
<SidebarGroupLabel>Workspace</SidebarGroupLabel>
|
|
31
44
|
<SidebarMenu>
|
|
32
45
|
<SidebarMenuItem>
|
|
33
|
-
<SidebarMenuButton
|
|
46
|
+
<SidebarMenuButton icon={<LayoutGridIcon />}>
|
|
34
47
|
Overview
|
|
35
48
|
</SidebarMenuButton>
|
|
36
49
|
</SidebarMenuItem>
|
|
37
50
|
<SidebarMenuItem>
|
|
38
|
-
<SidebarMenuButton icon={<
|
|
51
|
+
<SidebarMenuButton icon={<CreditCardIcon />}>
|
|
52
|
+
Transactions
|
|
53
|
+
</SidebarMenuButton>
|
|
54
|
+
<SidebarMenuSub>
|
|
55
|
+
<SidebarMenuItem>
|
|
56
|
+
<SidebarMenuSubButton showLine>
|
|
57
|
+
Payments
|
|
58
|
+
</SidebarMenuSubButton>
|
|
59
|
+
</SidebarMenuItem>
|
|
60
|
+
<SidebarMenuItem>
|
|
61
|
+
<SidebarMenuSubButton active showLine>
|
|
62
|
+
Refunds
|
|
63
|
+
</SidebarMenuSubButton>
|
|
64
|
+
</SidebarMenuItem>
|
|
65
|
+
</SidebarMenuSub>
|
|
66
|
+
</SidebarMenuItem>
|
|
67
|
+
<SidebarMenuItem>
|
|
68
|
+
<SidebarMenuButton
|
|
69
|
+
badge={<SidebarMenuBadge>12</SidebarMenuBadge>}
|
|
70
|
+
icon={<InboxIcon />}
|
|
71
|
+
>
|
|
72
|
+
Inbox
|
|
73
|
+
</SidebarMenuButton>
|
|
74
|
+
</SidebarMenuItem>
|
|
75
|
+
<SidebarMenuItem>
|
|
76
|
+
<SidebarMenuButton icon={<UsersIcon />}>Customers</SidebarMenuButton>
|
|
39
77
|
</SidebarMenuItem>
|
|
40
78
|
<SidebarMenuItem>
|
|
41
79
|
<SidebarMenuButton icon={<SettingsIcon />}>Settings</SidebarMenuButton>
|
|
@@ -44,13 +82,19 @@ export function SidebarDemo() {
|
|
|
44
82
|
</SidebarGroup>
|
|
45
83
|
</SidebarBody>
|
|
46
84
|
<SidebarFooter>
|
|
47
|
-
<
|
|
85
|
+
<SidebarFooterUser
|
|
86
|
+
avatar={
|
|
87
|
+
<Avatar aria-label="Olivia Rhye" className="size-full" size="sm">
|
|
88
|
+
<AvatarFallback size="sm">OR</AvatarFallback>
|
|
89
|
+
</Avatar>
|
|
90
|
+
}
|
|
91
|
+
name="Olivia Rhye"
|
|
92
|
+
supportText="olivia@acme.com"
|
|
93
|
+
/>
|
|
48
94
|
</SidebarFooter>
|
|
49
95
|
</Sidebar>
|
|
50
|
-
<SidebarInset
|
|
51
|
-
|
|
52
|
-
App content
|
|
53
|
-
</div>
|
|
96
|
+
<SidebarInset className="grid min-w-0 place-items-center bg-[var(--bh-bg-subtle)] p-[var(--bh-space-4xl-20)] text-sm text-[var(--bh-content-subtle)]">
|
|
97
|
+
App content
|
|
54
98
|
</SidebarInset>
|
|
55
99
|
</SidebarProvider>
|
|
56
100
|
)
|
|
@@ -15,7 +15,7 @@ This project uses the Banhaten design system. Treat the installed component API
|
|
|
15
15
|
- Do not align Banhaten controls with raw height, padding, radius, or font-size utilities. Width and responsive layout utilities are allowed.
|
|
16
16
|
- Use `DatePicker` or `DateRangePicker` for dates. Do not simulate calendar fields with `Input` or native date inputs.
|
|
17
17
|
- Pass explicit `leadingIcon` and `trailingIcon` nodes. Use `showAtSign` or `showInfo` only for those exact semantic affordances. The legacy `hasLeadingIcon` and `hasInformationIcon` flags are deprecated.
|
|
18
|
-
- Use `shortcutKeys={["Mod", "K"]}` or `KbdShortcut`
|
|
18
|
+
- Use `shortcutKeys={["Mod", "K"]}` on search inputs, `Shortcut` for one compact combined hint, or `KbdShortcut` when each physical key needs its own keycap. Never hard-code a single Command glyph for every platform.
|
|
19
19
|
- Use `SegmentedControl` for small mutually exclusive view, density, period, or numeric choices. Do not rebuild joined numeric buttons locally.
|
|
20
20
|
- Use functional `Select` for option menus. `ToolbarSelect` is only a trigger-shaped toolbar primitive.
|
|
21
21
|
- Preserve inherited `dir`; use logical spacing and alignment utilities for RTL-safe composition.
|