@hanzo/ui 3.0.19 → 3.1.1
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/package.json
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from '../util'
|
|
6
|
+
|
|
7
|
+
const Breadcrumb = React.forwardRef<
|
|
8
|
+
HTMLElement,
|
|
9
|
+
React.ComponentPropsWithoutRef<"nav"> & {
|
|
10
|
+
separator?: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
13
|
+
Breadcrumb.displayName = "Breadcrumb"
|
|
14
|
+
|
|
15
|
+
const BreadcrumbList = React.forwardRef<
|
|
16
|
+
HTMLOListElement,
|
|
17
|
+
React.ComponentPropsWithoutRef<"ol">
|
|
18
|
+
>(({ className, ...props }, ref) => (
|
|
19
|
+
<ol
|
|
20
|
+
ref={ref}
|
|
21
|
+
className={cn(
|
|
22
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-2 sm:gap-2.5",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
))
|
|
28
|
+
BreadcrumbList.displayName = "BreadcrumbList"
|
|
29
|
+
|
|
30
|
+
const BreadcrumbItem = React.forwardRef<
|
|
31
|
+
HTMLLIElement,
|
|
32
|
+
React.ComponentPropsWithoutRef<"li">
|
|
33
|
+
>(({ className, ...props }, ref) => (
|
|
34
|
+
<li
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn("inline-flex items-center gap-1.5", className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
))
|
|
40
|
+
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
41
|
+
|
|
42
|
+
const BreadcrumbLink = React.forwardRef<
|
|
43
|
+
HTMLAnchorElement,
|
|
44
|
+
React.ComponentPropsWithoutRef<"a"> & {
|
|
45
|
+
asChild?: boolean
|
|
46
|
+
}
|
|
47
|
+
>(({ asChild, className, ...props }, ref) => {
|
|
48
|
+
const Comp = asChild ? Slot : "a"
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Comp
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn("transition-colors hover:text-foreground", className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
59
|
+
|
|
60
|
+
const BreadcrumbPage = React.forwardRef<
|
|
61
|
+
HTMLSpanElement,
|
|
62
|
+
React.ComponentPropsWithoutRef<"span">
|
|
63
|
+
>(({ className, ...props }, ref) => (
|
|
64
|
+
<span
|
|
65
|
+
ref={ref}
|
|
66
|
+
role="link"
|
|
67
|
+
aria-disabled="true"
|
|
68
|
+
aria-current="page"
|
|
69
|
+
className={cn("font-normal text-foreground", className)}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
))
|
|
73
|
+
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
74
|
+
|
|
75
|
+
const BreadcrumbSeparator = ({
|
|
76
|
+
children,
|
|
77
|
+
className,
|
|
78
|
+
...props
|
|
79
|
+
}: React.ComponentProps<"li">) => (
|
|
80
|
+
<li
|
|
81
|
+
role="presentation"
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
className={cn("[&>svg]:size-3.5", className)}
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
{children ?? <ChevronRight />}
|
|
87
|
+
</li>
|
|
88
|
+
)
|
|
89
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
90
|
+
|
|
91
|
+
const BreadcrumbEllipsis = ({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}: React.ComponentProps<"span">) => (
|
|
95
|
+
<span
|
|
96
|
+
role="presentation"
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
99
|
+
{...props}
|
|
100
|
+
>
|
|
101
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
102
|
+
<span className="sr-only">More</span>
|
|
103
|
+
</span>
|
|
104
|
+
)
|
|
105
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
Breadcrumb,
|
|
109
|
+
BreadcrumbList,
|
|
110
|
+
BreadcrumbItem,
|
|
111
|
+
BreadcrumbLink,
|
|
112
|
+
BreadcrumbPage,
|
|
113
|
+
BreadcrumbSeparator,
|
|
114
|
+
BreadcrumbEllipsis,
|
|
115
|
+
}
|
package/primitives/drawer.tsx
CHANGED
|
@@ -34,11 +34,13 @@ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
|
|
|
34
34
|
|
|
35
35
|
const DrawerContent = React.forwardRef<
|
|
36
36
|
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
37
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
38
|
-
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
38
|
+
overlayClx?: string
|
|
39
|
+
}
|
|
40
|
+
>(({ className, children, overlayClx='', ...props }, ref) => (
|
|
39
41
|
<DrawerPortal>
|
|
40
42
|
{/* If no or same z index, overlay should precede content */}
|
|
41
|
-
<DrawerOverlay />
|
|
43
|
+
<DrawerOverlay className={overlayClx}/>
|
|
42
44
|
<DrawerPrimitive.Content
|
|
43
45
|
ref={ref}
|
|
44
46
|
className={cn('fixed left-0 right-0 bottom-0 ',
|
package/primitives/index.ts
CHANGED
|
@@ -55,6 +55,16 @@ export { default as Label } from './label'
|
|
|
55
55
|
export { default as LinkElement } from './link-element'
|
|
56
56
|
export { default as MDXLink } from './mdx-link'
|
|
57
57
|
|
|
58
|
+
export {
|
|
59
|
+
Breadcrumb,
|
|
60
|
+
BreadcrumbList,
|
|
61
|
+
BreadcrumbItem,
|
|
62
|
+
BreadcrumbLink,
|
|
63
|
+
BreadcrumbPage,
|
|
64
|
+
BreadcrumbSeparator,
|
|
65
|
+
BreadcrumbEllipsis,
|
|
66
|
+
} from './breadcrumb'
|
|
67
|
+
|
|
58
68
|
export {
|
|
59
69
|
Sheet,
|
|
60
70
|
SheetPortal,
|
package/primitives/list-box.tsx
CHANGED
|
@@ -41,7 +41,7 @@ function ListBox<T>({
|
|
|
41
41
|
onValueChange,
|
|
42
42
|
value,
|
|
43
43
|
isEqual,
|
|
44
|
-
|
|
44
|
+
clx = '',
|
|
45
45
|
itemClx = ''
|
|
46
46
|
}:{
|
|
47
47
|
values: T[]
|
|
@@ -49,12 +49,12 @@ function ListBox<T>({
|
|
|
49
49
|
onValueChange: (val: T) => void
|
|
50
50
|
value: T | undefined
|
|
51
51
|
isEqual: (v1: T, v2: T) => boolean
|
|
52
|
-
|
|
52
|
+
clx?: string
|
|
53
53
|
itemClx?: string
|
|
54
54
|
}): JSX.Element {
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
|
-
<div className={cn('border rounded-md select-none',
|
|
57
|
+
<div className={cn('border rounded-md select-none', clx)} >
|
|
58
58
|
{values.map((val, i) => (
|
|
59
59
|
<Item<T>
|
|
60
60
|
value={val}
|