banhaten 0.1.2 → 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 +93 -328
- 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 -65
- package/registry/components/alert-dialog.tsx +297 -0
- package/registry/components/aspect-ratio.tsx +30 -0
- 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.tsx +1 -1
- 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/steps.css +274 -274
- 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.tsx +2 -2
- package/registry/components/kbd.tsx +44 -0
- package/registry/components/label.tsx +78 -0
- package/registry/components/menu.tsx +3 -1
- 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/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 +2 -4
- package/registry/components/sheet.tsx +305 -0
- package/registry/components/sidebar.tsx +352 -0
- package/registry/components/social-button.tsx +74 -10
- package/registry/components/{expanded/tabs.css → tabs.css} +127 -106
- package/registry/components/tabs.tsx +242 -0
- package/registry/components/textarea.tsx +1 -1
- package/registry/components/toast.tsx +131 -0
- package/registry/examples/alert-dialog-demo.tsx +42 -0
- package/registry/examples/aspect-ratio-demo.tsx +11 -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/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-group-demo.tsx +16 -0
- package/registry/examples/kbd-demo.tsx +11 -0
- package/registry/examples/label-demo.tsx +20 -0
- 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/resizable-demo.tsx +22 -0
- package/registry/examples/scroll-area-demo.tsx +15 -0
- package/registry/examples/sheet-demo.tsx +47 -0
- package/registry/examples/sidebar-demo.tsx +55 -0
- package/registry/examples/tabs-demo.tsx +13 -0
- package/registry/examples/toast-demo.tsx +35 -0
- package/registry/index.json +655 -11
- package/registry/styles/globals.css +4733 -4690
- 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 +312 -18
- 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
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
+
import { ChevronDownIcon, InfoIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { Label } from "@/components/ui/label"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
|
|
10
|
+
type NativeSelectSize = "md" | "lg"
|
|
11
|
+
type NativeSelectState = "default" | "filled" | "error" | "disabled"
|
|
12
|
+
type NativeSelectVariant = "default" | "soft"
|
|
13
|
+
|
|
14
|
+
type NativeSelectOption = {
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
label: React.ReactNode
|
|
17
|
+
value: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type NativeSelectProps = Omit<
|
|
21
|
+
React.ComponentProps<"select">,
|
|
22
|
+
"children" | "className" | "dir" | "size"
|
|
23
|
+
> &
|
|
24
|
+
VariantProps<typeof nativeSelectControlVariants> & {
|
|
25
|
+
children?: React.ReactNode
|
|
26
|
+
className?: string
|
|
27
|
+
errorMessage?: React.ReactNode
|
|
28
|
+
hasHelperText?: boolean
|
|
29
|
+
helperText?: React.ReactNode
|
|
30
|
+
isOptional?: boolean
|
|
31
|
+
isRequired?: boolean
|
|
32
|
+
label?: React.ReactNode
|
|
33
|
+
options?: NativeSelectOption[]
|
|
34
|
+
optionalText?: React.ReactNode
|
|
35
|
+
rootClassName?: string
|
|
36
|
+
selectClassName?: string
|
|
37
|
+
state?: NativeSelectState
|
|
38
|
+
triggerId?: string
|
|
39
|
+
dir?: "ltr" | "rtl" | "auto"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const nativeSelectRootVariants = cva(
|
|
43
|
+
"grid w-[var(--bh-select-width)] max-w-full gap-[var(--bh-select-field-gap)]"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
const nativeSelectControlVariants = cva(
|
|
47
|
+
[
|
|
48
|
+
"relative grid w-full rounded-[var(--bh-select-trigger-radius)]",
|
|
49
|
+
"[--bh-select-trigger-border-current:var(--bh-select-trigger-border)] [--shadow-select-trigger:inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-select-trigger-border-current,var(--bh-select-trigger-border)),var(--shadow-component-default)]",
|
|
50
|
+
"bg-[var(--bh-select-trigger-bg)] shadow-[var(--shadow-select-trigger)] transition-[background-color,box-shadow]",
|
|
51
|
+
"focus-within:[--bh-select-trigger-border-current:var(--bh-select-trigger-border-focus)] focus-within:shadow-[var(--shadow-select-focus-ring)]",
|
|
52
|
+
],
|
|
53
|
+
{
|
|
54
|
+
variants: {
|
|
55
|
+
size: {
|
|
56
|
+
lg: "min-h-[var(--bh-input-lg-height)]",
|
|
57
|
+
md: "min-h-[var(--bh-input-md-height)]",
|
|
58
|
+
},
|
|
59
|
+
state: {
|
|
60
|
+
default: "",
|
|
61
|
+
filled: "",
|
|
62
|
+
error:
|
|
63
|
+
"[--bh-select-trigger-border-current:var(--bh-select-trigger-border-error)] shadow-[var(--shadow-select-trigger)] focus-within:shadow-[var(--shadow-select-danger-focus-ring)]",
|
|
64
|
+
disabled:
|
|
65
|
+
"pointer-events-none bg-[var(--bh-select-trigger-bg-disabled)] shadow-[inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-select-trigger-border-disabled)]",
|
|
66
|
+
},
|
|
67
|
+
variant: {
|
|
68
|
+
default: "",
|
|
69
|
+
soft: "bg-[var(--bh-select-trigger-bg-soft)] shadow-none",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
size: "lg",
|
|
74
|
+
state: "default",
|
|
75
|
+
variant: "default",
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
const NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(
|
|
81
|
+
function NativeSelect(
|
|
82
|
+
{
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
disabled,
|
|
86
|
+
errorMessage,
|
|
87
|
+
hasHelperText,
|
|
88
|
+
helperText,
|
|
89
|
+
isOptional = false,
|
|
90
|
+
isRequired = false,
|
|
91
|
+
label,
|
|
92
|
+
options,
|
|
93
|
+
optionalText,
|
|
94
|
+
rootClassName,
|
|
95
|
+
selectClassName,
|
|
96
|
+
size = "lg",
|
|
97
|
+
state = "default",
|
|
98
|
+
triggerId,
|
|
99
|
+
variant = "default",
|
|
100
|
+
dir,
|
|
101
|
+
...props
|
|
102
|
+
},
|
|
103
|
+
ref
|
|
104
|
+
) {
|
|
105
|
+
const generatedId = React.useId()
|
|
106
|
+
const selectId = triggerId ?? generatedId
|
|
107
|
+
const helperId = `${selectId}-helper`
|
|
108
|
+
const visualState = disabled ? "disabled" : state
|
|
109
|
+
const helper = visualState === "error" ? errorMessage : helperText
|
|
110
|
+
const shouldRenderHelper = hasHelperText ?? Boolean(helper)
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
data-slot="native-select-root"
|
|
115
|
+
dir={dir}
|
|
116
|
+
className={cn(nativeSelectRootVariants({ className: rootClassName }))}
|
|
117
|
+
>
|
|
118
|
+
{label ? (
|
|
119
|
+
<Label
|
|
120
|
+
htmlFor={selectId}
|
|
121
|
+
optionalText={optionalText}
|
|
122
|
+
required={isRequired}
|
|
123
|
+
data-optional={isOptional ? "true" : undefined}
|
|
124
|
+
>
|
|
125
|
+
{label}
|
|
126
|
+
</Label>
|
|
127
|
+
) : null}
|
|
128
|
+
<div
|
|
129
|
+
data-slot="native-select-control"
|
|
130
|
+
className={cn(
|
|
131
|
+
nativeSelectControlVariants({
|
|
132
|
+
size,
|
|
133
|
+
state: visualState,
|
|
134
|
+
variant,
|
|
135
|
+
className,
|
|
136
|
+
})
|
|
137
|
+
)}
|
|
138
|
+
>
|
|
139
|
+
<select
|
|
140
|
+
aria-describedby={shouldRenderHelper ? helperId : undefined}
|
|
141
|
+
aria-invalid={visualState === "error" || undefined}
|
|
142
|
+
data-slot="native-select"
|
|
143
|
+
disabled={disabled}
|
|
144
|
+
id={selectId}
|
|
145
|
+
ref={ref}
|
|
146
|
+
className={cn(
|
|
147
|
+
"min-h-[inherit] w-full appearance-none border-0 bg-transparent py-[var(--bh-space-sm-6)] ps-[var(--bh-select-trigger-padding-x)] pe-[var(--bh-space-8xl-48)] text-start text-[length:var(--bh-text-body-md-regular-font-size)] font-[var(--bh-text-body-md-regular-font-weight)] leading-[var(--bh-text-body-md-regular-line-height)] tracking-[var(--bh-text-body-md-regular-letter-spacing)] text-[var(--bh-content-default)] outline-none disabled:cursor-not-allowed disabled:text-[var(--bh-content-disabled)]",
|
|
148
|
+
selectClassName
|
|
149
|
+
)}
|
|
150
|
+
{...props}
|
|
151
|
+
>
|
|
152
|
+
{options?.map((option) => (
|
|
153
|
+
<option
|
|
154
|
+
disabled={option.disabled}
|
|
155
|
+
key={option.value}
|
|
156
|
+
value={option.value}
|
|
157
|
+
>
|
|
158
|
+
{option.label}
|
|
159
|
+
</option>
|
|
160
|
+
))}
|
|
161
|
+
{children}
|
|
162
|
+
</select>
|
|
163
|
+
<ChevronDownIcon
|
|
164
|
+
aria-hidden="true"
|
|
165
|
+
className="pointer-events-none absolute end-[var(--bh-select-trigger-padding-x)] top-1/2 size-[var(--bh-space-3xl-16)] -translate-y-1/2 text-[var(--bh-select-trigger-icon-color)]"
|
|
166
|
+
strokeWidth={2}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
{shouldRenderHelper ? (
|
|
170
|
+
<p
|
|
171
|
+
data-slot="native-select-helper"
|
|
172
|
+
dir="auto"
|
|
173
|
+
id={helperId}
|
|
174
|
+
className={cn(
|
|
175
|
+
"m-0 inline-flex items-center gap-[var(--bh-space-xs-4)] 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)]",
|
|
176
|
+
visualState === "error"
|
|
177
|
+
? "text-[var(--bh-content-danger-default)]"
|
|
178
|
+
: "text-[var(--bh-content-subtle)]"
|
|
179
|
+
)}
|
|
180
|
+
>
|
|
181
|
+
<InfoIcon
|
|
182
|
+
aria-hidden="true"
|
|
183
|
+
className="size-[var(--bh-space-3xl-16)] shrink-0"
|
|
184
|
+
strokeWidth={2}
|
|
185
|
+
/>
|
|
186
|
+
{helper}
|
|
187
|
+
</p>
|
|
188
|
+
) : null}
|
|
189
|
+
</div>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
export {
|
|
195
|
+
NativeSelect,
|
|
196
|
+
nativeSelectControlVariants,
|
|
197
|
+
nativeSelectRootVariants,
|
|
198
|
+
}
|
|
199
|
+
export type {
|
|
200
|
+
NativeSelectOption,
|
|
201
|
+
NativeSelectProps,
|
|
202
|
+
NativeSelectSize,
|
|
203
|
+
NativeSelectState,
|
|
204
|
+
NativeSelectVariant,
|
|
205
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
type NavigationMenuProps = React.ComponentProps<
|
|
10
|
+
typeof NavigationMenuPrimitive.Root
|
|
11
|
+
>
|
|
12
|
+
type NavigationMenuListProps = React.ComponentPropsWithoutRef<
|
|
13
|
+
typeof NavigationMenuPrimitive.List
|
|
14
|
+
>
|
|
15
|
+
type NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<
|
|
16
|
+
typeof NavigationMenuPrimitive.Trigger
|
|
17
|
+
>
|
|
18
|
+
type NavigationMenuContentProps = React.ComponentPropsWithoutRef<
|
|
19
|
+
typeof NavigationMenuPrimitive.Content
|
|
20
|
+
>
|
|
21
|
+
type NavigationMenuLinkProps = React.ComponentPropsWithoutRef<
|
|
22
|
+
typeof NavigationMenuPrimitive.Link
|
|
23
|
+
>
|
|
24
|
+
type NavigationMenuViewportProps = React.ComponentPropsWithoutRef<
|
|
25
|
+
typeof NavigationMenuPrimitive.Viewport
|
|
26
|
+
>
|
|
27
|
+
type NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<
|
|
28
|
+
typeof NavigationMenuPrimitive.Indicator
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
const NavigationMenu = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
33
|
+
NavigationMenuProps
|
|
34
|
+
>(function NavigationMenu({ className, ...props }, ref) {
|
|
35
|
+
return (
|
|
36
|
+
<NavigationMenuPrimitive.Root
|
|
37
|
+
data-slot="navigation-menu"
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn("relative z-[var(--bh-z-raised)] flex max-w-max flex-1 items-center justify-center", className)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const NavigationMenuList = React.forwardRef<
|
|
46
|
+
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
47
|
+
NavigationMenuListProps
|
|
48
|
+
>(function NavigationMenuList({ className, ...props }, ref) {
|
|
49
|
+
return (
|
|
50
|
+
<NavigationMenuPrimitive.List
|
|
51
|
+
data-slot="navigation-menu-list"
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn("group flex flex-1 list-none items-center justify-center gap-[var(--bh-space-xs-4)]", className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
60
|
+
|
|
61
|
+
const NavigationMenuTrigger = React.forwardRef<
|
|
62
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
63
|
+
NavigationMenuTriggerProps
|
|
64
|
+
>(function NavigationMenuTrigger({ children, className, ...props }, ref) {
|
|
65
|
+
return (
|
|
66
|
+
<NavigationMenuPrimitive.Trigger
|
|
67
|
+
data-slot="navigation-menu-trigger"
|
|
68
|
+
ref={ref}
|
|
69
|
+
className={cn(
|
|
70
|
+
"group inline-flex h-[var(--bh-space-7xl-40)] items-center justify-center gap-[var(--bh-space-xs-4)] rounded-[var(--bh-radius-lg-8)] bg-transparent px-[var(--bh-space-xl-12)] 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-default)] outline-none transition-colors hover:bg-[var(--bh-interactive-ghost-hover)] focus:bg-[var(--bh-interactive-ghost-hover)] disabled:pointer-events-none disabled:text-[var(--bh-content-disabled)] data-[state=open]:bg-[var(--bh-interactive-soft-default)]",
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
{children}
|
|
76
|
+
<ChevronDownIcon
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
className="size-[var(--bh-space-3xl-16)] transition-transform group-data-[state=open]:rotate-180"
|
|
79
|
+
/>
|
|
80
|
+
</NavigationMenuPrimitive.Trigger>
|
|
81
|
+
)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const NavigationMenuContent = React.forwardRef<
|
|
85
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
86
|
+
NavigationMenuContentProps
|
|
87
|
+
>(function NavigationMenuContent({ className, ...props }, ref) {
|
|
88
|
+
return (
|
|
89
|
+
<NavigationMenuPrimitive.Content
|
|
90
|
+
data-slot="navigation-menu-content"
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={cn(
|
|
93
|
+
"start-0 top-0 w-full rounded-[var(--bh-radius-2xl-12)] bg-[var(--bh-bg-raised)] p-[var(--bh-space-3xl-16)] text-[var(--bh-content-default)] shadow-[var(--shadow-popover)] md:absolute md:w-[var(--bh-space-19xl-384)]",
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const NavigationMenuLink = React.forwardRef<
|
|
102
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Link>,
|
|
103
|
+
NavigationMenuLinkProps
|
|
104
|
+
>(function NavigationMenuLink({ className, ...props }, ref) {
|
|
105
|
+
return (
|
|
106
|
+
<NavigationMenuPrimitive.Link
|
|
107
|
+
data-slot="navigation-menu-link"
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={cn(
|
|
110
|
+
"block rounded-[var(--bh-radius-lg-8)] p-[var(--bh-space-xl-12)] text-start text-[length:var(--bh-text-body-sm-regular-font-size)] font-[var(--bh-text-body-sm-regular-font-weight)] leading-[var(--bh-text-body-sm-regular-line-height)] tracking-[var(--bh-text-body-sm-regular-letter-spacing)] text-[var(--bh-content-default)] outline-none transition-colors hover:bg-[var(--bh-interactive-ghost-hover)] focus:bg-[var(--bh-interactive-ghost-hover)]",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const NavigationMenuViewport = React.forwardRef<
|
|
119
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
120
|
+
NavigationMenuViewportProps
|
|
121
|
+
>(function NavigationMenuViewport({ className, ...props }, ref) {
|
|
122
|
+
return (
|
|
123
|
+
<div className="absolute start-0 top-full flex justify-center">
|
|
124
|
+
<NavigationMenuPrimitive.Viewport
|
|
125
|
+
data-slot="navigation-menu-viewport"
|
|
126
|
+
ref={ref}
|
|
127
|
+
className={cn(
|
|
128
|
+
"origin-top-center relative mt-[var(--bh-space-xs-4)] h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-[var(--bh-radius-2xl-12)] bg-[var(--bh-bg-raised)] shadow-[var(--shadow-popover)] md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
129
|
+
className
|
|
130
|
+
)}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
const NavigationMenuIndicator = React.forwardRef<
|
|
138
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
139
|
+
NavigationMenuIndicatorProps
|
|
140
|
+
>(function NavigationMenuIndicator({ className, ...props }, ref) {
|
|
141
|
+
return (
|
|
142
|
+
<NavigationMenuPrimitive.Indicator
|
|
143
|
+
data-slot="navigation-menu-indicator"
|
|
144
|
+
ref={ref}
|
|
145
|
+
className={cn("top-full z-[var(--bh-z-popover)] flex h-[var(--bh-space-lg-10)] items-end justify-center overflow-hidden", className)}
|
|
146
|
+
{...props}
|
|
147
|
+
>
|
|
148
|
+
<div className="relative top-[var(--bh-space-xs-4)] size-[var(--bh-space-lg-10)] rotate-45 rounded-tl-[var(--bh-radius-sm-4)] bg-[var(--bh-bg-raised)] shadow-[var(--shadow-popover)]" />
|
|
149
|
+
</NavigationMenuPrimitive.Indicator>
|
|
150
|
+
)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
NavigationMenu,
|
|
155
|
+
NavigationMenuContent,
|
|
156
|
+
NavigationMenuIndicator,
|
|
157
|
+
NavigationMenuItem,
|
|
158
|
+
NavigationMenuLink,
|
|
159
|
+
NavigationMenuList,
|
|
160
|
+
NavigationMenuTrigger,
|
|
161
|
+
NavigationMenuViewport,
|
|
162
|
+
}
|
|
163
|
+
export type {
|
|
164
|
+
NavigationMenuContentProps,
|
|
165
|
+
NavigationMenuIndicatorProps,
|
|
166
|
+
NavigationMenuLinkProps,
|
|
167
|
+
NavigationMenuListProps,
|
|
168
|
+
NavigationMenuProps,
|
|
169
|
+
NavigationMenuTriggerProps,
|
|
170
|
+
NavigationMenuViewportProps,
|
|
171
|
+
}
|
|
@@ -100,7 +100,7 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(function Radio({
|
|
|
100
100
|
ref={ref}
|
|
101
101
|
type="radio"
|
|
102
102
|
className={cn(
|
|
103
|
-
"peer absolute inset-0 z-[var(--bh-z-raised)] m-0 size-full cursor-pointer appearance-none rounded-[var(--bh-radius-full)] opacity-0 outline-none disabled:cursor-not-allowed",
|
|
103
|
+
"peer absolute inset-0 z-[var(--bh-z-raised)] m-0 size-full cursor-pointer appearance-none rounded-[var(--bh-radius-full)] opacity-[var(--bh-opacity-0)] outline-none disabled:cursor-not-allowed",
|
|
104
104
|
inputClassName
|
|
105
105
|
)}
|
|
106
106
|
{...props}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { GripVerticalIcon } from "lucide-react"
|
|
5
|
+
import {
|
|
6
|
+
Group,
|
|
7
|
+
Panel,
|
|
8
|
+
Separator,
|
|
9
|
+
type GroupProps,
|
|
10
|
+
type Orientation,
|
|
11
|
+
type PanelProps,
|
|
12
|
+
type SeparatorProps,
|
|
13
|
+
} from "react-resizable-panels"
|
|
14
|
+
|
|
15
|
+
import { cn } from "@/lib/utils"
|
|
16
|
+
|
|
17
|
+
type ResizablePanelGroupProps = Omit<GroupProps, "orientation"> & {
|
|
18
|
+
direction?: Orientation
|
|
19
|
+
}
|
|
20
|
+
type ResizablePanelProps = PanelProps
|
|
21
|
+
type ResizableHandleProps = SeparatorProps & {
|
|
22
|
+
withHandle?: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ResizablePanelGroup({
|
|
26
|
+
className,
|
|
27
|
+
direction = "horizontal",
|
|
28
|
+
...props
|
|
29
|
+
}: ResizablePanelGroupProps) {
|
|
30
|
+
return (
|
|
31
|
+
<Group
|
|
32
|
+
data-panel-group-direction={direction}
|
|
33
|
+
data-slot="resizable-panel-group"
|
|
34
|
+
className={cn(
|
|
35
|
+
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
orientation={direction}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const ResizablePanel = Panel
|
|
45
|
+
|
|
46
|
+
function ResizableHandle({
|
|
47
|
+
className,
|
|
48
|
+
withHandle = false,
|
|
49
|
+
...props
|
|
50
|
+
}: ResizableHandleProps) {
|
|
51
|
+
return (
|
|
52
|
+
<Separator
|
|
53
|
+
data-slot="resizable-handle"
|
|
54
|
+
className={cn(
|
|
55
|
+
"relative flex w-[var(--bh-border-width-default)] items-center justify-center bg-[var(--bh-border-subtle)] outline-none transition-[background-color,box-shadow] after:absolute after:inset-y-0 after:start-1/2 after:w-[var(--bh-space-5xl-24)] after:-translate-x-1/2 focus-visible:shadow-[var(--shadow-button-focus)] aria-[orientation=horizontal]:h-[var(--bh-border-width-default)] aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-[var(--bh-space-5xl-24)] aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{withHandle ? (
|
|
61
|
+
<div className="z-[var(--bh-z-raised)] flex h-[var(--bh-space-6xl-32)] w-[var(--bh-space-4xl-20)] items-center justify-center rounded-[var(--bh-radius-full)] border border-[var(--bh-border-subtle)] bg-[var(--bh-bg-raised)]">
|
|
62
|
+
<GripVerticalIcon className="size-[var(--bh-space-3xl-16)] text-[var(--bh-content-muted)]" />
|
|
63
|
+
</div>
|
|
64
|
+
) : null}
|
|
65
|
+
</Separator>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
|
|
70
|
+
export type {
|
|
71
|
+
ResizableHandleProps,
|
|
72
|
+
ResizablePanelGroupProps,
|
|
73
|
+
ResizablePanelProps,
|
|
74
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
type ScrollAreaProps = React.ComponentPropsWithoutRef<
|
|
9
|
+
typeof ScrollAreaPrimitive.Root
|
|
10
|
+
>
|
|
11
|
+
type ScrollBarProps = React.ComponentPropsWithoutRef<
|
|
12
|
+
typeof ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
13
|
+
>
|
|
14
|
+
|
|
15
|
+
const ScrollArea = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
17
|
+
ScrollAreaProps
|
|
18
|
+
>(function ScrollArea({ children, className, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<ScrollAreaPrimitive.Root
|
|
21
|
+
data-slot="scroll-area"
|
|
22
|
+
ref={ref}
|
|
23
|
+
className={cn("relative overflow-hidden", className)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
<ScrollAreaPrimitive.Viewport
|
|
27
|
+
data-slot="scroll-area-viewport"
|
|
28
|
+
className="size-full rounded-[inherit]"
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</ScrollAreaPrimitive.Viewport>
|
|
32
|
+
<ScrollBar />
|
|
33
|
+
<ScrollAreaPrimitive.Corner />
|
|
34
|
+
</ScrollAreaPrimitive.Root>
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const ScrollBar = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
40
|
+
ScrollBarProps
|
|
41
|
+
>(function ScrollBar({ className, orientation = "vertical", ...props }, ref) {
|
|
42
|
+
return (
|
|
43
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
44
|
+
data-orientation={orientation}
|
|
45
|
+
data-slot="scroll-area-scrollbar"
|
|
46
|
+
orientation={orientation}
|
|
47
|
+
ref={ref}
|
|
48
|
+
className={cn(
|
|
49
|
+
"flex touch-none select-none bg-transparent p-[var(--bh-space-xxs-2)] transition-colors",
|
|
50
|
+
orientation === "vertical" &&
|
|
51
|
+
"h-full w-[var(--bh-space-lg-10)] border-s border-s-transparent",
|
|
52
|
+
orientation === "horizontal" &&
|
|
53
|
+
"h-[var(--bh-space-lg-10)] flex-col border-t border-t-transparent",
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
59
|
+
data-slot="scroll-area-thumb"
|
|
60
|
+
className="relative flex-1 rounded-[var(--bh-radius-full)] bg-[var(--bh-border-default)]"
|
|
61
|
+
/>
|
|
62
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
63
|
+
)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
export { ScrollArea, ScrollBar }
|
|
67
|
+
export type { ScrollAreaProps, ScrollBarProps }
|
|
@@ -31,9 +31,7 @@ const selectTrigger = cva(
|
|
|
31
31
|
"select-none px-[var(--bh-select-trigger-padding-x)] text-start outline-none",
|
|
32
32
|
"transition-[background-color,box-shadow]",
|
|
33
33
|
"[--bh-select-trigger-border-current:var(--bh-select-trigger-border)] [--shadow-select-trigger:inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-select-trigger-border-current,var(--bh-select-trigger-border)),var(--shadow-component-default)]",
|
|
34
|
-
"[--bh-select-
|
|
35
|
-
"after:pointer-events-none after:absolute after:inset-[calc(var(--bh-focus-ring-width)*-1)] after:rounded-[calc(var(--bh-select-trigger-radius)+var(--bh-focus-ring-width))] after:border-[length:var(--bh-focus-ring-width)] after:border-solid after:border-transparent after:content-['']",
|
|
36
|
-
"focus-visible:[--bh-select-trigger-border-current:var(--bh-select-trigger-border-focus)] focus-visible:[box-shadow:var(--shadow-select-focus-border)] focus-visible:after:border-[var(--bh-select-focus-ring-color)]",
|
|
34
|
+
"focus-visible:[--bh-select-trigger-border-current:var(--bh-select-trigger-border-focus)] focus-visible:shadow-[var(--shadow-select-focus-ring)]",
|
|
37
35
|
"aria-invalid:[--bh-select-trigger-border-current:var(--bh-select-trigger-border-error)]",
|
|
38
36
|
"disabled:pointer-events-none disabled:bg-[var(--bh-select-trigger-bg-disabled)] disabled:shadow-[inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-select-trigger-border-disabled)]",
|
|
39
37
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
@@ -54,7 +52,7 @@ const selectTrigger = cva(
|
|
|
54
52
|
default: "",
|
|
55
53
|
filled: "",
|
|
56
54
|
error:
|
|
57
|
-
"[--bh-select-trigger-border-current:var(--bh-select-trigger-border-error)]
|
|
55
|
+
"[--bh-select-trigger-border-current:var(--bh-select-trigger-border-error)] shadow-[var(--shadow-select-trigger)] focus-visible:shadow-[var(--shadow-select-danger-focus-ring)]",
|
|
58
56
|
disabled:
|
|
59
57
|
"pointer-events-none bg-[var(--bh-select-trigger-bg-disabled)] shadow-[inset_0px_0px_0px_var(--bh-border-width-default)_var(--bh-select-trigger-border-disabled)]",
|
|
60
58
|
},
|