@arobo/react 1.1.1 → 1.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.
@@ -19,8 +19,8 @@ declare function CarouselContent({ className, ...props }: CarouselContentProps):
19
19
  type CarouselItemProps = React.ComponentProps<"div">;
20
20
  declare function CarouselItem({ className, ...props }: CarouselItemProps): import("react/jsx-runtime").JSX.Element;
21
21
  type CarouselPreviousProps = React.ComponentProps<typeof Button>;
22
- declare function CarouselPrevious({ className, size, variant, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
22
+ declare function CarouselPrevious({ className, size, variant, children, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
23
23
  type CarouselNextProps = React.ComponentProps<typeof Button>;
24
- declare function CarouselNext({ className, size, variant, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
24
+ declare function CarouselNext({ className, size, variant, children, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
25
25
  export { Carousel as CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
26
26
  export type { CarouselProps as CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, };
@@ -3,7 +3,7 @@ import { ArrowRight, ArrowLeft } from 'lucide-react';
3
3
  import * as React from 'react';
4
4
  import { cn } from 'tailwind-variants';
5
5
  import { Button } from '../button/index.js';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { jsx } from 'react/jsx-runtime';
7
7
 
8
8
  const CarouselContext = /*#__PURE__*/React.createContext(null);
9
9
  function useCarousel() {
@@ -120,6 +120,7 @@ function CarouselPrevious({
120
120
  className,
121
121
  size = "md",
122
122
  variant = "outline",
123
+ children,
123
124
  ...props
124
125
  }) {
125
126
  const {
@@ -127,7 +128,7 @@ function CarouselPrevious({
127
128
  scrollPrev,
128
129
  canScrollPrev
129
130
  } = useCarousel();
130
- return /*#__PURE__*/jsxs(Button, {
131
+ return /*#__PURE__*/jsx(Button, {
131
132
  "data-slot": "carousel-previous",
132
133
  isDisabled: !canScrollPrev,
133
134
  size: size,
@@ -135,16 +136,14 @@ function CarouselPrevious({
135
136
  className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
136
137
  onClick: scrollPrev,
137
138
  ...props,
138
- children: [/*#__PURE__*/jsx(ArrowLeft, {}), /*#__PURE__*/jsx("span", {
139
- className: "sr-only",
140
- children: "Previous slide"
141
- })]
139
+ children: children ? children : /*#__PURE__*/jsx(ArrowLeft, {})
142
140
  });
143
141
  }
144
142
  function CarouselNext({
145
143
  className,
146
144
  size = "md",
147
145
  variant = "outline",
146
+ children,
148
147
  ...props
149
148
  }) {
150
149
  const {
@@ -152,7 +151,7 @@ function CarouselNext({
152
151
  scrollNext,
153
152
  canScrollNext
154
153
  } = useCarousel();
155
- return /*#__PURE__*/jsxs(Button, {
154
+ return /*#__PURE__*/jsx(Button, {
156
155
  "data-slot": "carousel-next",
157
156
  isDisabled: !canScrollNext,
158
157
  size: size,
@@ -160,10 +159,7 @@ function CarouselNext({
160
159
  className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
161
160
  onClick: scrollNext,
162
161
  ...props,
163
- children: [/*#__PURE__*/jsx(ArrowRight, {}), /*#__PURE__*/jsx("span", {
164
- className: "sr-only",
165
- children: "Next slide"
166
- })]
162
+ children: children ? children : /*#__PURE__*/jsx(ArrowRight, {})
167
163
  });
168
164
  }
169
165
 
@@ -1,33 +1,24 @@
1
1
  import * as React from "react";
2
2
  import { Drawer as DrawerPrimitive } from "vaul";
3
- export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
3
+ type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
4
4
  declare function Drawer({ ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
5
- export type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;
5
+ type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;
6
6
  declare function DrawerTrigger({ ...props }: DrawerTriggerProps): import("react/jsx-runtime").JSX.Element;
7
- export type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>;
7
+ type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>;
8
8
  declare function DrawerPortal({ ...props }: DrawerPortalProps): import("react/jsx-runtime").JSX.Element;
9
- export type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;
9
+ type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;
10
10
  declare function DrawerClose({ ...props }: DrawerCloseProps): import("react/jsx-runtime").JSX.Element;
11
- export type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>;
11
+ type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>;
12
12
  declare function DrawerOverlay({ className, ...props }: DrawerOverlayProps): import("react/jsx-runtime").JSX.Element;
13
- export type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content>;
13
+ type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content>;
14
14
  declare function DrawerContent({ className, children, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
15
- export type DrawerHeaderProps = React.ComponentProps<"div">;
15
+ type DrawerHeaderProps = React.ComponentProps<"div">;
16
16
  declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
17
- export type DrawerFooterProps = React.ComponentProps<"div">;
17
+ type DrawerFooterProps = React.ComponentProps<"div">;
18
18
  declare function DrawerFooter({ className, ...props }: DrawerFooterProps): import("react/jsx-runtime").JSX.Element;
19
+ type DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>;
19
20
  declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
20
- export type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>;
21
+ type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>;
21
22
  declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): import("react/jsx-runtime").JSX.Element;
22
- declare const _default: typeof Drawer & {
23
- Trigger: typeof DrawerTrigger;
24
- Portal: typeof DrawerPortal;
25
- Close: typeof DrawerClose;
26
- Overlay: typeof DrawerOverlay;
27
- Content: typeof DrawerContent;
28
- Header: typeof DrawerHeader;
29
- Footer: typeof DrawerFooter;
30
- Title: typeof DrawerTitle;
31
- Description: typeof DrawerDescription;
32
- };
33
- export default _default;
23
+ export { Drawer as DrawerRoot, DrawerTrigger, DrawerPortal, DrawerClose, DrawerOverlay, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
24
+ export type { DrawerProps, DrawerTriggerProps, DrawerPortalProps, DrawerCloseProps, DrawerOverlayProps, DrawerContentProps, DrawerHeaderProps, DrawerFooterProps, DrawerTitleProps, DrawerDescriptionProps, };
@@ -0,0 +1,115 @@
1
+ import { cn } from 'tailwind-variants';
2
+ import { Drawer as Drawer$1 } from 'vaul';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+
5
+ function Drawer({
6
+ ...props
7
+ }) {
8
+ return /*#__PURE__*/jsx(Drawer$1.Root, {
9
+ "data-slot": "drawer",
10
+ ...props
11
+ });
12
+ }
13
+ function DrawerTrigger({
14
+ ...props
15
+ }) {
16
+ return /*#__PURE__*/jsx(Drawer$1.Trigger, {
17
+ "data-slot": "drawer-trigger",
18
+ ...props
19
+ });
20
+ }
21
+ function DrawerPortal({
22
+ ...props
23
+ }) {
24
+ return /*#__PURE__*/jsx(Drawer$1.Portal, {
25
+ "data-slot": "drawer-portal",
26
+ ...props
27
+ });
28
+ }
29
+ function DrawerClose({
30
+ ...props
31
+ }) {
32
+ return /*#__PURE__*/jsx(Drawer$1.Close, {
33
+ "data-slot": "drawer-close",
34
+ ...props
35
+ });
36
+ }
37
+ function DrawerOverlay({
38
+ className,
39
+ ...props
40
+ }) {
41
+ return /*#__PURE__*/jsx(Drawer$1.Overlay, {
42
+ "data-slot": "drawer-overlay",
43
+ className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
44
+ ...props
45
+ });
46
+ }
47
+ function DrawerContent({
48
+ className,
49
+ children,
50
+ ...props
51
+ }) {
52
+ return /*#__PURE__*/jsxs(DrawerPortal, {
53
+ "data-slot": "drawer-portal",
54
+ children: [/*#__PURE__*/jsx(DrawerOverlay, {}), /*#__PURE__*/jsxs(Drawer$1.Content, {
55
+ "data-slot": "drawer-content",
56
+ className: cn(
57
+ // Background: #FFFFFF (--popover), Border: #F3F4F6 (--popover-border)
58
+ "group/drawer-content bg-popover text-popover-foreground fixed z-50 flex h-auto flex-col border border-popover-border shadow-lg",
59
+ // Top drawer: 16px rounded bottom corners
60
+ "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=top]:border-t-0",
61
+ // Bottom drawer: 16px rounded top corners (matches Figma)
62
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=bottom]:border-b-0",
63
+ // Right drawer
64
+ "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-2xl data-[vaul-drawer-direction=right]:border-r-0 data-[vaul-drawer-direction=right]:sm:max-w-sm",
65
+ // Left drawer
66
+ "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-2xl data-[vaul-drawer-direction=left]:border-l-0 data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
67
+ ...props,
68
+ children: [/*#__PURE__*/jsx("div", {
69
+ className: "mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-gray-400 group-data-[vaul-drawer-direction=bottom]/drawer-content:block"
70
+ }), children]
71
+ })]
72
+ });
73
+ }
74
+ function DrawerHeader({
75
+ className,
76
+ ...props
77
+ }) {
78
+ return /*#__PURE__*/jsx("div", {
79
+ "data-slot": "drawer-header",
80
+ className: cn("flex flex-col gap-2 px-5 py-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center sm:text-left border-b border-gray-200", className),
81
+ ...props
82
+ });
83
+ }
84
+ function DrawerFooter({
85
+ className,
86
+ ...props
87
+ }) {
88
+ return /*#__PURE__*/jsx("div", {
89
+ "data-slot": "drawer-footer",
90
+ className: cn("mt-auto flex flex-col-reverse gap-3 px-5 py-4 sm:flex-row sm:justify-end border-t border-gray-200", className),
91
+ ...props
92
+ });
93
+ }
94
+ function DrawerTitle({
95
+ className,
96
+ ...props
97
+ }) {
98
+ return /*#__PURE__*/jsx(Drawer$1.Title, {
99
+ className: cn("text-foreground text-base font-medium", className),
100
+ "data-slot": "drawer-title",
101
+ ...props
102
+ });
103
+ }
104
+ function DrawerDescription({
105
+ className,
106
+ ...props
107
+ }) {
108
+ return /*#__PURE__*/jsx(Drawer$1.Description, {
109
+ className: cn("text-muted-foreground text-sm", className),
110
+ "data-slot": "drawer-description",
111
+ ...props
112
+ });
113
+ }
114
+
115
+ export { DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, Drawer as DrawerRoot, DrawerTitle, DrawerTrigger };
@@ -1 +1,28 @@
1
- export * from "./drawer";
1
+ import type { DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerFooterProps, DrawerHeaderProps, DrawerOverlayProps, DrawerPortalProps, DrawerProps, DrawerTitleProps, DrawerTriggerProps } from "./drawer";
2
+ import { DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger } from "./drawer";
3
+ export declare const Drawer: typeof DrawerRoot & {
4
+ Trigger: typeof DrawerTrigger;
5
+ Portal: typeof DrawerPortal;
6
+ Close: typeof DrawerClose;
7
+ Overlay: typeof DrawerOverlay;
8
+ Content: typeof DrawerContent;
9
+ Header: typeof DrawerHeader;
10
+ Footer: typeof DrawerFooter;
11
+ Title: typeof DrawerTitle;
12
+ Description: typeof DrawerDescription;
13
+ };
14
+ export type Drawer = {
15
+ Props: React.ComponentProps<typeof DrawerRoot>;
16
+ RootProps: React.ComponentProps<typeof DrawerRoot>;
17
+ TriggerProps: React.ComponentProps<typeof DrawerTrigger>;
18
+ PortalProps: React.ComponentProps<typeof DrawerPortal>;
19
+ CloseProps: React.ComponentProps<typeof DrawerClose>;
20
+ OverlayProps: React.ComponentProps<typeof DrawerOverlay>;
21
+ ContentProps: React.ComponentProps<typeof DrawerContent>;
22
+ HeaderProps: React.ComponentProps<typeof DrawerHeader>;
23
+ FooterProps: React.ComponentProps<typeof DrawerFooter>;
24
+ TitleProps: React.ComponentProps<typeof DrawerTitle>;
25
+ DescriptionProps: React.ComponentProps<typeof DrawerDescription>;
26
+ };
27
+ export { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerClose, DrawerOverlay, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
28
+ export type { DrawerProps, DrawerTriggerProps, DrawerPortalProps, DrawerCloseProps, DrawerOverlayProps, DrawerContentProps, DrawerHeaderProps, DrawerFooterProps, DrawerTitleProps, DrawerDescriptionProps, };
@@ -1 +1,19 @@
1
+ import { DrawerRoot as Drawer$1, DrawerDescription, DrawerTitle, DrawerFooter, DrawerHeader, DrawerContent, DrawerOverlay, DrawerClose, DrawerPortal, DrawerTrigger } from './drawer.js';
1
2
 
3
+ /* -------------------------------------------------------------------------------------------------
4
+ * Compound Component
5
+ * -----------------------------------------------------------------------------------------------*/
6
+
7
+ const Drawer = Object.assign(Drawer$1, {
8
+ Trigger: DrawerTrigger,
9
+ Portal: DrawerPortal,
10
+ Close: DrawerClose,
11
+ Overlay: DrawerOverlay,
12
+ Content: DrawerContent,
13
+ Header: DrawerHeader,
14
+ Footer: DrawerFooter,
15
+ Title: DrawerTitle,
16
+ Description: DrawerDescription
17
+ });
18
+
19
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, Drawer$1 as DrawerRoot, DrawerTitle, DrawerTrigger };
@@ -18,4 +18,4 @@ export type ListBox = {
18
18
  SectionProps: ComponentProps<typeof ListBoxSection>;
19
19
  };
20
20
  export { ListBoxRoot };
21
- export type { ListBoxRootProps, ListBoxRootProps as ListBoxProps } from "./listbox";
21
+ export type { ListBoxRootProps, ListBoxRootProps as ListBoxProps, } from "./listbox";
@@ -8,4 +8,4 @@ export type RadioGroup = {
8
8
  RootProps: ComponentProps<typeof RadioGroupRoot>;
9
9
  };
10
10
  export { RadioGroupRoot };
11
- export type { RadioGroupRootProps, RadioGroupRootProps as RadioGroupProps } from "./radio-group";
11
+ export type { RadioGroupRootProps, RadioGroupRootProps as RadioGroupProps, } from "./radio-group";
package/dist/index.js CHANGED
@@ -136,6 +136,8 @@ export { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Carousel
136
136
  export { useScrollShadow } from './components/scroll-shadow/use-scroll-shadow.js';
137
137
  export { ScrollShadow } from './components/scroll-shadow/index.js';
138
138
  export { ScrollShadowRoot } from './components/scroll-shadow/scroll-shadow.js';
139
+ export { Drawer } from './components/drawer/index.js';
140
+ export { DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger } from './components/drawer/drawer.js';
139
141
  export { popoverVariants } from './packages/styles/src/components/popover/popover.styles.js';
140
142
  export { Popover } from './components/popover/index.js';
141
143
  export { PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger } from './components/popover/popover.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arobo/react",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [