@hanzo/ui 3.4.2 → 3.4.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "3.4.2",
3
+ "version": "3.4.4",
4
4
  "description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -3,7 +3,7 @@
3
3
 
4
4
  import * as React from "react"
5
5
  import * as AccordionPrimitive from "@radix-ui/react-accordion"
6
- import { ChevronDown } from "lucide-react"
6
+ import { ChevronUp } from "lucide-react"
7
7
 
8
8
  import { cn } from "../util"
9
9
 
@@ -21,20 +21,25 @@ const AccordionItem = React.forwardRef<
21
21
  ))
22
22
  AccordionItem.displayName = "AccordionItem"
23
23
 
24
+ type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> & {
25
+ showChevron?: boolean;
26
+ }
27
+
24
28
  const AccordionTrigger = React.forwardRef<
25
29
  React.ElementRef<typeof AccordionPrimitive.Trigger>,
26
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
27
- >(({ className, children, ...props }, ref) => (
30
+ AccordionTriggerProps
31
+ >(({ showChevron, className, children, ...props }, ref) => (
28
32
  <AccordionPrimitive.Header className="flex">
29
33
  <AccordionPrimitive.Trigger
30
34
  ref={ref}
31
35
  className={cn(
32
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline ",
36
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:-rotate-180",
33
37
  className
34
38
  )}
35
39
  {...props}
36
40
  >
37
41
  {children}
42
+ {showChevron && <ChevronUp className="shrink-0 transition-transform duration-200" />}
38
43
  </AccordionPrimitive.Trigger>
39
44
  </AccordionPrimitive.Header>
40
45
  ))
@@ -18,7 +18,7 @@ type CarouselProps = {
18
18
  plugins?: CarouselPlugins
19
19
  orientation?: 'horizontal' | 'vertical'
20
20
  setApi?: (api: CarouselApi) => void
21
- onSelect?: (api: CarouselApi) => void
21
+ onCarouselSelect?: (api: CarouselApi) => void
22
22
  }
23
23
 
24
24
  type CarouselContextProps = {
@@ -57,7 +57,7 @@ const Carousel = React.forwardRef<
57
57
  plugins,
58
58
  className,
59
59
  children,
60
- onSelect: _onSelect,
60
+ onCarouselSelect,
61
61
  ...props
62
62
  },
63
63
  ref
@@ -79,8 +79,8 @@ const Carousel = React.forwardRef<
79
79
 
80
80
  setCanScrollPrev(api.canScrollPrev())
81
81
  setCanScrollNext(api.canScrollNext())
82
- if (_onSelect) {
83
- _onSelect(api)
82
+ if (onCarouselSelect) {
83
+ onCarouselSelect(api)
84
84
  }
85
85
  }, [])
86
86