@hanzo/ui 3.0.18 → 3.1.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/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/carousel.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
-
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'
|
|
5
|
-
import Autoplay from
|
|
4
|
+
import useEmblaCarousel, { type UseEmblaCarouselType, type EmblaOptionsType } from 'embla-carousel-react'
|
|
5
|
+
import Autoplay from 'embla-carousel-autoplay'
|
|
6
6
|
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
7
7
|
|
|
8
8
|
import { cn } from '../util'
|
|
@@ -254,6 +254,7 @@ CarouselNext.displayName = 'CarouselNext'
|
|
|
254
254
|
|
|
255
255
|
export {
|
|
256
256
|
type CarouselApi,
|
|
257
|
+
type EmblaOptionsType as CarouselOptionsType,
|
|
257
258
|
Carousel,
|
|
258
259
|
CarouselContent,
|
|
259
260
|
CarouselItem,
|
package/primitives/drawer.tsx
CHANGED
|
@@ -42,12 +42,12 @@ const DrawerContent = React.forwardRef<
|
|
|
42
42
|
<DrawerPrimitive.Content
|
|
43
43
|
ref={ref}
|
|
44
44
|
className={cn('fixed left-0 right-0 bottom-0 ',
|
|
45
|
-
'mt-24 flex h-[80%]
|
|
45
|
+
'mt-24 flex flex-col h-[80%] rounded-t-[10px] pt-6 border bg-background',
|
|
46
46
|
className
|
|
47
47
|
)}
|
|
48
48
|
{...props}
|
|
49
49
|
>
|
|
50
|
-
<div className='mx-auto
|
|
50
|
+
<div className='absolute left-0 right-0 mx-auto top-2 h-2 w-[100px] rounded-full bg-level-2 shrink-0' />
|
|
51
51
|
{children}
|
|
52
52
|
</DrawerPrimitive.Content>
|
|
53
53
|
</DrawerPortal>
|
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,
|
|
@@ -137,6 +147,7 @@ export {
|
|
|
137
147
|
|
|
138
148
|
export {
|
|
139
149
|
type CarouselApi,
|
|
150
|
+
type CarouselOptionsType,
|
|
140
151
|
Carousel,
|
|
141
152
|
CarouselContent,
|
|
142
153
|
CarouselItem,
|
|
@@ -112,13 +112,13 @@ export default {
|
|
|
112
112
|
sm: "calc(var(--radius) - 4px)",
|
|
113
113
|
*/
|
|
114
114
|
none: '0px',
|
|
115
|
-
sm: '0.
|
|
116
|
-
DEFAULT: '0.
|
|
117
|
-
md: '0.
|
|
118
|
-
lg: '0.
|
|
119
|
-
xl: '
|
|
120
|
-
'2xl': '
|
|
121
|
-
'3xl': '
|
|
115
|
+
sm: '0.25rem',
|
|
116
|
+
DEFAULT: '0.5rem',
|
|
117
|
+
md: '0.5rem',
|
|
118
|
+
lg: '0.75rem',
|
|
119
|
+
xl: '1rem',
|
|
120
|
+
'2xl': '1.5rem',
|
|
121
|
+
'3xl': '2rem',
|
|
122
122
|
full: '9999px',
|
|
123
123
|
},
|
|
124
124
|
borderSpacing: spacing,
|