@a2v2ai/uikit 0.0.36 → 0.0.38

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.
Files changed (185) hide show
  1. package/Alert/Alert.stories.tsx +121 -0
  2. package/Alert/Alert.tsx +71 -0
  3. package/AlertDialog/AlertDialog.stories.tsx +665 -0
  4. package/AlertDialog/AlertDialog.tsx +241 -0
  5. package/Avatar/Avatar.stories.tsx +128 -0
  6. package/Avatar/Avatar.tsx +71 -0
  7. package/Badge/Badge.stories.tsx +76 -0
  8. package/Badge/Badge.tsx +39 -0
  9. package/Breadcrumb/Breadcrumb.stories.tsx +231 -0
  10. package/Breadcrumb/Breadcrumb.tsx +114 -0
  11. package/Button/Button.stories.tsx +684 -0
  12. package/Button/Button.tsx +107 -0
  13. package/Calendar/Calendar.stories.tsx +291 -0
  14. package/Calendar/Calendar.tsx +246 -0
  15. package/Card/Card.stories.tsx +136 -0
  16. package/Card/Card.tsx +96 -0
  17. package/Carousel/Carousel.stories.tsx +256 -0
  18. package/Carousel/Carousel.tsx +301 -0
  19. package/ChatBubble/ChatBubble.stories.tsx +339 -0
  20. package/ChatBubble/ChatBubble.tsx +179 -0
  21. package/Checkbox/Checkbox.stories.tsx +137 -0
  22. package/Checkbox/Checkbox.tsx +53 -0
  23. package/DataTable/DataTable.stories.tsx +400 -0
  24. package/DataTable/DataTable.tsx +207 -0
  25. package/Drawer/Drawer.stories.tsx +721 -0
  26. package/Drawer/Drawer.tsx +201 -0
  27. package/DropdownMenu/DropdownMenu.stories.tsx +251 -0
  28. package/DropdownMenu/DropdownMenu.tsx +199 -0
  29. package/ErrorMessage/ErrorMessage.stories.tsx +159 -0
  30. package/ErrorMessage/ErrorMessage.tsx +55 -0
  31. package/Flex/Flex.stories.tsx +390 -0
  32. package/Flex/Flex.tsx +102 -0
  33. package/IconButton/IconButton.stories.tsx +566 -0
  34. package/IconButton/IconButton.tsx +95 -0
  35. package/Input/Input.stories.tsx +566 -0
  36. package/Input/Input.tsx +168 -0
  37. package/InputOTP/InputOTP.stories.tsx +246 -0
  38. package/InputOTP/InputOTP.tsx +127 -0
  39. package/Label/Label.stories.tsx +110 -0
  40. package/Label/Label.tsx +44 -0
  41. package/Loader/Loader.stories.tsx +170 -0
  42. package/Loader/Loader.tsx +62 -0
  43. package/Menubar/Menubar.stories.tsx +382 -0
  44. package/Menubar/Menubar.tsx +274 -0
  45. package/Menubar/index.ts +18 -0
  46. package/Pagination/Pagination.stories.tsx +196 -0
  47. package/Pagination/Pagination.tsx +122 -0
  48. package/Popover/Popover.stories.tsx +133 -0
  49. package/Popover/Popover.tsx +31 -0
  50. package/Progress/Progress.stories.tsx +146 -0
  51. package/Progress/Progress.tsx +67 -0
  52. package/RadioGroup/RadioGroup.stories.tsx +159 -0
  53. package/RadioGroup/RadioGroup.tsx +68 -0
  54. package/ScrollArea/ScrollArea.stories.tsx +136 -0
  55. package/ScrollArea/ScrollArea.tsx +46 -0
  56. package/Select/Select.stories.tsx +378 -0
  57. package/Select/Select.tsx +230 -0
  58. package/Separator/Separator.stories.tsx +110 -0
  59. package/Separator/Separator.tsx +29 -0
  60. package/Sidebar/Sidebar.stories.tsx +340 -0
  61. package/Sidebar/Sidebar.tsx +414 -0
  62. package/Sidebar/index.ts +28 -0
  63. package/Skeleton/Skeleton.stories.tsx +117 -0
  64. package/Skeleton/Skeleton.tsx +16 -0
  65. package/Slider/Slider.stories.tsx +216 -0
  66. package/Slider/Slider.tsx +29 -0
  67. package/Spinner/Spinner.stories.tsx +210 -0
  68. package/Spinner/Spinner.tsx +78 -0
  69. package/Switch/Switch.stories.tsx +146 -0
  70. package/Switch/Switch.tsx +59 -0
  71. package/Table/Table.stories.tsx +510 -0
  72. package/Table/Table.tsx +114 -0
  73. package/Tabs/Tabs.stories.tsx +197 -0
  74. package/Tabs/Tabs.tsx +74 -0
  75. package/Textarea/Textarea.stories.tsx +187 -0
  76. package/Textarea/Textarea.tsx +73 -0
  77. package/Toast/Toast.stories.tsx +285 -0
  78. package/Toast/Toast.tsx +59 -0
  79. package/Tooltip/Tooltip.stories.tsx +463 -0
  80. package/Tooltip/Tooltip.tsx +96 -0
  81. package/Typography/Typography.stories.tsx +425 -0
  82. package/Typography/Typography.tsx +106 -0
  83. package/helpers.ts +5 -0
  84. package/{icons.js → icons.ts} +1 -1
  85. package/index.ts +217 -0
  86. package/lib/typography-types.ts +223 -0
  87. package/lib/utils.ts +15 -0
  88. package/package.json +36 -33
  89. package/tsconfig.json +22 -0
  90. package/Alert/Alert.d.ts +0 -13
  91. package/Alert/Alert.js +0 -25
  92. package/AlertDialog/AlertDialog.d.ts +0 -43
  93. package/AlertDialog/AlertDialog.js +0 -71
  94. package/Avatar/Avatar.d.ts +0 -14
  95. package/Avatar/Avatar.js +0 -25
  96. package/Badge/Badge.d.ts +0 -11
  97. package/Badge/Badge.js +0 -23
  98. package/Breadcrumb/Breadcrumb.d.ts +0 -19
  99. package/Breadcrumb/Breadcrumb.js +0 -23
  100. package/Button/Button.d.ts +0 -23
  101. package/Button/Button.js +0 -52
  102. package/Calendar/Calendar.d.ts +0 -20
  103. package/Calendar/Calendar.js +0 -78
  104. package/Card/Card.d.ts +0 -16
  105. package/Card/Card.js +0 -28
  106. package/Carousel/Carousel.d.ts +0 -37
  107. package/Carousel/Carousel.js +0 -132
  108. package/ChatBubble/ChatBubble.d.ts +0 -33
  109. package/ChatBubble/ChatBubble.js +0 -107
  110. package/Checkbox/Checkbox.d.ts +0 -12
  111. package/Checkbox/Checkbox.js +0 -20
  112. package/DataTable/DataTable.d.ts +0 -35
  113. package/DataTable/DataTable.js +0 -51
  114. package/Dialog/Dialog.d.ts +0 -35
  115. package/Dialog/Dialog.js +0 -130
  116. package/Drawer/Drawer.d.ts +0 -33
  117. package/Drawer/Drawer.js +0 -55
  118. package/DropdownMenu/DropdownMenu.d.ts +0 -27
  119. package/DropdownMenu/DropdownMenu.js +0 -35
  120. package/ErrorMessage/ErrorMessage.d.ts +0 -27
  121. package/ErrorMessage/ErrorMessage.js +0 -14
  122. package/Flex/Flex.d.ts +0 -31
  123. package/Flex/Flex.js +0 -64
  124. package/IconButton/IconButton.d.ts +0 -23
  125. package/IconButton/IconButton.js +0 -48
  126. package/Input/Input.d.ts +0 -27
  127. package/Input/Input.js +0 -42
  128. package/InputOTP/InputOTP.d.ts +0 -20
  129. package/InputOTP/InputOTP.js +0 -44
  130. package/Label/Label.d.ts +0 -13
  131. package/Label/Label.js +0 -19
  132. package/Loader/Loader.d.ts +0 -21
  133. package/Loader/Loader.js +0 -30
  134. package/Menubar/Menubar.d.ts +0 -26
  135. package/Menubar/Menubar.js +0 -54
  136. package/Menubar/index.d.ts +0 -1
  137. package/Menubar/index.js +0 -1
  138. package/Pagination/Pagination.d.ts +0 -35
  139. package/Pagination/Pagination.js +0 -37
  140. package/Popover/Popover.d.ts +0 -7
  141. package/Popover/Popover.js +0 -10
  142. package/Progress/Progress.d.ts +0 -17
  143. package/Progress/Progress.js +0 -33
  144. package/RadioGroup/RadioGroup.d.ts +0 -13
  145. package/RadioGroup/RadioGroup.js +0 -26
  146. package/ScrollArea/ScrollArea.d.ts +0 -5
  147. package/ScrollArea/ScrollArea.js +0 -11
  148. package/Select/Select.d.ts +0 -29
  149. package/Select/Select.js +0 -50
  150. package/Separator/Separator.d.ts +0 -4
  151. package/Separator/Separator.js +0 -7
  152. package/Sidebar/Sidebar.d.ts +0 -48
  153. package/Sidebar/Sidebar.js +0 -116
  154. package/Sidebar/index.d.ts +0 -2
  155. package/Sidebar/index.js +0 -1
  156. package/Skeleton/Skeleton.d.ts +0 -4
  157. package/Skeleton/Skeleton.js +0 -7
  158. package/Slider/Slider.d.ts +0 -6
  159. package/Slider/Slider.js +0 -7
  160. package/Spinner/Spinner.d.ts +0 -19
  161. package/Spinner/Spinner.js +0 -31
  162. package/Switch/Switch.d.ts +0 -12
  163. package/Switch/Switch.js +0 -30
  164. package/Table/Table.d.ts +0 -10
  165. package/Table/Table.js +0 -20
  166. package/Tabs/Tabs.d.ts +0 -15
  167. package/Tabs/Tabs.js +0 -24
  168. package/Textarea/Textarea.d.ts +0 -19
  169. package/Textarea/Textarea.js +0 -31
  170. package/Toast/Toast.d.ts +0 -12
  171. package/Toast/Toast.js +0 -25
  172. package/Tooltip/Tooltip.d.ts +0 -17
  173. package/Tooltip/Tooltip.js +0 -29
  174. package/Typography/Typography.d.ts +0 -20
  175. package/Typography/Typography.js +0 -43
  176. package/helpers.d.ts +0 -4
  177. package/helpers.js +0 -5
  178. package/icons.d.ts +0 -1
  179. package/index.d.ts +0 -42
  180. package/index.js +0 -45
  181. package/lib/typography-types.d.ts +0 -4
  182. package/lib/typography-types.js +0 -90
  183. package/lib/utils.d.ts +0 -3
  184. package/lib/utils.js +0 -14
  185. package/tmpclaude-2407-cwd +0 -1
@@ -1,71 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
4
- import { X, Loader2 } from "lucide-react";
5
- import { cva } from "class-variance-authority";
6
- import { Button } from "../Button/Button";
7
- import { cn } from "../lib/utils";
8
- const AlertDialog = AlertDialogPrimitive.Root;
9
- const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
10
- const AlertDialogPortal = AlertDialogPrimitive.Portal;
11
- const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
12
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
13
- const alertDialogContentVariants = cva("fixed z-50 grid gap-4 bg-white border border-grey-200 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", {
14
- variants: {
15
- type: {
16
- desktop: "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] w-full max-w-[640px] rounded-lg",
17
- mobile: "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] w-full max-w-[320px] rounded-lg",
18
- },
19
- scrollable: {
20
- true: "max-h-[80vh] overflow-y-auto",
21
- false: "",
22
- },
23
- },
24
- defaultVariants: {
25
- type: "desktop",
26
- scrollable: false,
27
- },
28
- });
29
- const AlertDialogContent = React.forwardRef(({ className, children, type, scrollable, showCloseButton = true, closeButtonVariant = "default", loading = false, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsxs(AlertDialogPrimitive.Content, { ref: ref, className: cn(alertDialogContentVariants({ type, scrollable, className })), ...props, children: [loading && (_jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/80 rounded-lg", children: _jsx(Loader2, { className: "size-8 text-main-600 animate-spin" }) })), children, showCloseButton && closeButtonVariant === "default" && !loading && (_jsxs(AlertDialogPrimitive.Cancel, { className: "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:shadow-[0_0_0_3px_#d4d4d4] disabled:pointer-events-none cursor-pointer", children: [_jsx(X, { className: "size-4 text-grey-600" }), _jsx("span", { className: "sr-only", children: "Close" })] })), showCloseButton && closeButtonVariant === "icon-button" && !loading && (_jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "small", className: "absolute right-2 top-2 size-9 p-0", children: [_jsx(X, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] })));
30
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
31
- const alertDialogHeaderVariants = cva("flex p-4", {
32
- variants: {
33
- type: {
34
- header: "flex-row items-center justify-between",
35
- "close-only": "flex-col items-end",
36
- "icon-button-close": "flex-col items-end justify-center pr-0",
37
- },
38
- },
39
- defaultVariants: {
40
- type: "header",
41
- },
42
- });
43
- const AlertDialogHeader = React.forwardRef(({ className, type, ...props }, ref) => (_jsx("div", { ref: ref, className: cn(alertDialogHeaderVariants({ type, className })), ...props })));
44
- AlertDialogHeader.displayName = "AlertDialogHeader";
45
- const alertDialogFooterVariants = cva("flex gap-2 p-4", {
46
- variants: {
47
- type: {
48
- "buttons-right": "flex-row items-center justify-end",
49
- "full-width": "flex-row items-start",
50
- "single-full-width": "flex-row items-start",
51
- },
52
- },
53
- defaultVariants: {
54
- type: "buttons-right",
55
- },
56
- });
57
- const AlertDialogFooter = React.forwardRef(({ className, type, children, ...props }, ref) => (_jsx("div", { ref: ref, className: cn(alertDialogFooterVariants({ type, className })), ...props, children: type === "full-width" || type === "single-full-width" ? (_jsx("div", { className: "flex gap-2 w-full", children: React.Children.map(children, (child) => React.isValidElement(child)
58
- ? React.cloneElement(child, {
59
- className: cn("flex-1", child.props.className),
60
- })
61
- : child) })) : (children) })));
62
- AlertDialogFooter.displayName = "AlertDialogFooter";
63
- const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-2xl font-bold leading-[1.2] tracking-tight text-main-950 font-display", className), ...props })));
64
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
65
- const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-grey-600", className), ...props })));
66
- AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
67
- const AlertDialogBody = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex-1 px-4 py-2", className), ...props })));
68
- AlertDialogBody.displayName = "AlertDialogBody";
69
- const AlertDialogAction = AlertDialogPrimitive.Action;
70
- const AlertDialogCancel = AlertDialogPrimitive.Cancel;
71
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogBody, AlertDialogAction, AlertDialogCancel, alertDialogContentVariants, alertDialogHeaderVariants, alertDialogFooterVariants, };
@@ -1,14 +0,0 @@
1
- import * as React from "react";
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
- type AvatarSize = "small" | "regular" | "large" | "xlarge";
4
- declare const avatarVariants: (props?: ({
5
- size?: "small" | "regular" | "large" | "xlarge" | null | undefined;
6
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {
8
- size?: AvatarSize;
9
- }
10
- declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
11
- declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
12
- declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
13
- export { Avatar, AvatarImage, AvatarFallback, avatarVariants };
14
- export type { AvatarSize };
package/Avatar/Avatar.js DELETED
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
4
- import { cva } from "class-variance-authority";
5
- import { cn } from "../lib/utils";
6
- const avatarVariants = cva("relative flex shrink-0 overflow-hidden rounded-full", {
7
- variants: {
8
- size: {
9
- small: "size-8",
10
- regular: "size-10",
11
- large: "size-12",
12
- xlarge: "size-16",
13
- },
14
- },
15
- defaultVariants: {
16
- size: "regular",
17
- },
18
- });
19
- const Avatar = React.forwardRef(({ className, size, ...props }, ref) => (_jsx(AvatarPrimitive.Root, { ref: ref, className: cn(avatarVariants({ size }), className), ...props })));
20
- Avatar.displayName = AvatarPrimitive.Root.displayName;
21
- const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Image, { ref: ref, className: cn("aspect-square h-full w-full", className), ...props })));
22
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
23
- const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Fallback, { ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-grey-100 text-grey-600 font-medium", className), ...props })));
24
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
25
- export { Avatar, AvatarImage, AvatarFallback, avatarVariants };
package/Badge/Badge.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
- type BadgeVariant = "default" | "secondary" | "outline" | "destructive" | "success" | "warning";
3
- declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "success" | "warning" | "secondary" | "outline" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
7
- variant?: BadgeVariant;
8
- }
9
- declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
10
- export { Badge, badgeVariants };
11
- export type { BadgeVariant };
package/Badge/Badge.js DELETED
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { cva } from "class-variance-authority";
4
- import { cn } from "../lib/utils";
5
- const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-accent-600 focus:ring-offset-2", {
6
- variants: {
7
- variant: {
8
- default: "border-transparent bg-accent-600 text-white",
9
- secondary: "border-transparent bg-grey-100 text-main-950",
10
- outline: "border-grey-300 text-main-950",
11
- destructive: "border-transparent bg-error-600 text-white",
12
- success: "border-transparent bg-success-600 text-white",
13
- warning: "border-transparent bg-warning-500 text-white",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- });
20
- function Badge({ className, variant, ...props }) {
21
- return (_jsx("div", { className: cn(badgeVariants({ variant }), className), ...props }));
22
- }
23
- export { Badge, badgeVariants };
@@ -1,19 +0,0 @@
1
- import * as React from "react";
2
- declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
3
- separator?: React.ReactNode;
4
- } & React.RefAttributes<HTMLElement>>;
5
- declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
6
- declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
7
- declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
8
- asChild?: boolean;
9
- } & React.RefAttributes<HTMLAnchorElement>>;
10
- declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
11
- declare const BreadcrumbSeparator: {
12
- ({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
13
- displayName: string;
14
- };
15
- declare const BreadcrumbEllipsis: {
16
- ({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import { ChevronRight, MoreHorizontal } from "lucide-react";
5
- import { cn } from "../lib/utils";
6
- const Breadcrumb = React.forwardRef(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
7
- Breadcrumb.displayName = "Breadcrumb";
8
- const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-grey-500 sm:gap-2.5", className), ...props })));
9
- BreadcrumbList.displayName = "BreadcrumbList";
10
- const BreadcrumbItem = React.forwardRef(({ className, ...props }, ref) => (_jsx("li", { ref: ref, className: cn("inline-flex items-center gap-1.5", className), ...props })));
11
- BreadcrumbItem.displayName = "BreadcrumbItem";
12
- const BreadcrumbLink = React.forwardRef(({ asChild, className, ...props }, ref) => {
13
- const Comp = asChild ? Slot : "a";
14
- return (_jsx(Comp, { ref: ref, className: cn("transition-colors hover:text-main-950", className), ...props }));
15
- });
16
- BreadcrumbLink.displayName = "BreadcrumbLink";
17
- const BreadcrumbPage = React.forwardRef(({ className, ...props }, ref) => (_jsx("span", { ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-main-950", className), ...props })));
18
- BreadcrumbPage.displayName = "BreadcrumbPage";
19
- const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
20
- BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
21
- const BreadcrumbEllipsis = ({ className, ...props }) => (_jsxs("span", { role: "presentation", "aria-hidden": "true", className: cn("flex h-9 w-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
22
- BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
23
- export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
- type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "ghost-muted" | "destructive";
3
- type ButtonSize = "mini" | "small" | "regular" | "large";
4
- type ButtonRoundness = "default" | "round";
5
- type ButtonTextVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "body3" | "caption";
6
- declare const buttonVariants: (props?: ({
7
- variant?: "destructive" | "secondary" | "outline" | "primary" | "ghost" | "ghost-muted" | null | undefined;
8
- size?: "small" | "regular" | "large" | "mini" | null | undefined;
9
- roundness?: "default" | "round" | null | undefined;
10
- textVariant?: "h5" | "h2" | "h3" | "caption" | "h1" | "h4" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "body3" | null | undefined;
11
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13
- variant?: ButtonVariant;
14
- size?: ButtonSize;
15
- roundness?: ButtonRoundness;
16
- textVariant?: ButtonTextVariant;
17
- asChild?: boolean;
18
- leftIcon?: React.ReactNode;
19
- rightIcon?: React.ReactNode;
20
- }
21
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
- export { Button, buttonVariants };
23
- export type { ButtonVariant, ButtonSize, ButtonRoundness, ButtonTextVariant };
package/Button/Button.js DELETED
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import { cva } from "class-variance-authority";
5
- import { cn } from "../lib/utils";
6
- const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap font-normal font-sans cursor-pointer transition-colors focus-visible:outline-none focus-visible:shadow-[0_0_0_3px_#d4d4d4] disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0", {
7
- variants: {
8
- variant: {
9
- primary: "bg-accent-600 text-white hover:bg-accent-700",
10
- secondary: "bg-main-100 text-main-950 hover:bg-main-200",
11
- outline: "border border-main-300 bg-transparent text-main-950 hover:bg-main-100",
12
- ghost: "bg-transparent text-main-600 hover:bg-main-100 hover:text-main-950",
13
- "ghost-muted": "bg-transparent text-main-400 hover:bg-main-100 hover:text-main-600",
14
- destructive: "bg-error-600 text-white hover:bg-error-700",
15
- },
16
- size: {
17
- mini: "h-6 px-3 text-xs rounded-md [&_svg]:size-3",
18
- small: "h-8 px-3 text-sm rounded-md [&_svg]:size-3.5",
19
- regular: "h-9 px-4 text-sm rounded-lg [&_svg]:size-4",
20
- large: "h-10 px-4 text-base rounded-lg [&_svg]:size-5",
21
- },
22
- roundness: {
23
- default: "",
24
- round: "!rounded-full",
25
- },
26
- textVariant: {
27
- h1: "text-[64px] font-extrabold",
28
- h2: "text-[48px] font-bold",
29
- h3: "text-[32px] font-bold",
30
- h4: "text-[24px] font-bold",
31
- h5: "text-[20px] font-bold",
32
- h6: "text-[20px] font-semibold",
33
- subtitle1: "text-[20px] font-semibold",
34
- subtitle2: "text-[18px] font-semibold",
35
- body1: "text-[16px] font-normal",
36
- body2: "text-[14px] font-normal",
37
- body3: "text-[12px] font-normal",
38
- caption: "text-[12px] font-light",
39
- },
40
- },
41
- defaultVariants: {
42
- variant: "primary",
43
- size: "regular",
44
- roundness: "default",
45
- },
46
- });
47
- const Button = React.forwardRef(({ className, variant, size, roundness, textVariant, asChild = false, leftIcon, rightIcon, children, ...props }, ref) => {
48
- const Comp = asChild ? Slot : "button";
49
- return (_jsxs(Comp, { className: cn(buttonVariants({ variant, size, roundness, textVariant, className })), ref: ref, ...props, children: [leftIcon && _jsx("span", { className: "shrink-0", children: leftIcon }), children, rightIcon && _jsx("span", { className: "shrink-0", children: rightIcon })] }));
50
- });
51
- Button.displayName = "Button";
52
- export { Button, buttonVariants };
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
- import { DayButton, DayPicker } from "react-day-picker";
3
- import { Button } from "../Button/Button";
4
- export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
5
- /**
6
- * Variant for navigation buttons
7
- * @default "ghost"
8
- */
9
- buttonVariant?: React.ComponentProps<typeof Button>["variant"];
10
- /**
11
- * Error message to display below the calendar
12
- */
13
- error?: string;
14
- };
15
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, error, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
16
- declare namespace Calendar {
17
- var displayName: string;
18
- }
19
- declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
20
- export { Calendar, CalendarDayButton };
@@ -1,78 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-react";
5
- import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker";
6
- import { cn } from "../lib/utils";
7
- import { Button, buttonVariants } from "../Button/Button";
8
- import { Typography } from "../Typography/Typography";
9
- function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, error, ...props }) {
10
- const defaultClassNames = getDefaultClassNames();
11
- return (_jsxs("div", { className: "flex flex-col w-fit", children: [_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("bg-white group/calendar p-3 rounded-lg border", error ? "border-error-500" : "border-grey-200", className), captionLayout: captionLayout, formatters: {
12
- formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
13
- ...formatters,
14
- }, classNames: {
15
- root: cn("w-fit", defaultClassNames.root),
16
- months: cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
17
- month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
18
- nav: cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
19
- button_previous: cn(buttonVariants({ variant: buttonVariant, size: "small" }), "size-8 aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
20
- button_next: cn(buttonVariants({ variant: buttonVariant, size: "small" }), "size-8 aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
21
- month_caption: cn("flex items-center justify-center h-8 w-full px-8", defaultClassNames.month_caption),
22
- dropdowns: cn("w-full flex items-center text-sm font-medium justify-center h-8 gap-1.5", defaultClassNames.dropdowns),
23
- dropdown_root: cn("relative has-focus:border-grey-400 border border-grey-300 shadow-xs has-focus:ring-grey-300/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
24
- dropdown: cn("absolute bg-white inset-0 opacity-0", defaultClassNames.dropdown),
25
- caption_label: cn("select-none font-medium text-main-900", captionLayout === "label"
26
- ? "text-sm"
27
- : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-main-400 [&>svg]:size-3.5", defaultClassNames.caption_label),
28
- table: "w-full border-collapse",
29
- weekdays: cn("flex", defaultClassNames.weekdays),
30
- weekday: cn("text-main-500 rounded-md flex-1 font-normal text-[0.8rem] select-none w-8 h-8 flex items-center justify-center", defaultClassNames.weekday),
31
- week: cn("flex w-full mt-2", defaultClassNames.week),
32
- week_number_header: cn("select-none w-8", defaultClassNames.week_number_header),
33
- week_number: cn("text-[0.8rem] select-none text-main-400", defaultClassNames.week_number),
34
- day: cn("relative w-8 h-8 p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day select-none", props.showWeekNumber
35
- ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
36
- : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
37
- range_start: cn("rounded-l-md bg-main-100", defaultClassNames.range_start),
38
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
39
- range_end: cn("rounded-r-md bg-main-100", defaultClassNames.range_end),
40
- today: cn("bg-main-100 text-main-900 rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
41
- outside: cn("text-main-300 aria-selected:text-main-400", defaultClassNames.outside),
42
- disabled: cn("text-main-300 opacity-50", defaultClassNames.disabled),
43
- hidden: cn("invisible", defaultClassNames.hidden),
44
- ...classNames,
45
- }, components: {
46
- Root: ({ className, rootRef, ...props }) => {
47
- return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
48
- },
49
- Chevron: ({ className, orientation, ...props }) => {
50
- if (orientation === "left") {
51
- return (_jsx(ChevronLeftIcon, { className: cn("size-4", className), ...props }));
52
- }
53
- if (orientation === "right") {
54
- return (_jsx(ChevronRightIcon, { className: cn("size-4", className), ...props }));
55
- }
56
- return (_jsx(ChevronDownIcon, { className: cn("size-4", className), ...props }));
57
- },
58
- DayButton: CalendarDayButton,
59
- WeekNumber: ({ children, ...props }) => {
60
- return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-8 items-center justify-center text-center", children: children }) }));
61
- },
62
- ...components,
63
- }, ...props }), error && (_jsx(Typography, { variant: "caption", color: "error-600", className: "mt-1", children: error }))] }));
64
- }
65
- function CalendarDayButton({ className, day, modifiers, ...props }) {
66
- const defaultClassNames = getDefaultClassNames();
67
- const ref = React.useRef(null);
68
- React.useEffect(() => {
69
- if (modifiers.focused)
70
- ref.current?.focus();
71
- }, [modifiers.focused]);
72
- return (_jsx(Button, { ref: ref, variant: "ghost", size: "small", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
73
- !modifiers.range_start &&
74
- !modifiers.range_end &&
75
- !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("size-8 p-0 font-normal", "data-[selected-single=true]:bg-main-900 data-[selected-single=true]:text-white", "data-[range-middle=true]:bg-main-100 data-[range-middle=true]:text-main-900", "data-[range-start=true]:bg-main-900 data-[range-start=true]:text-white", "data-[range-end=true]:bg-main-900 data-[range-end=true]:text-white", "group-data-[focused=true]/day:border-grey-400 group-data-[focused=true]/day:ring-grey-300/50", "hover:bg-main-100 hover:text-main-900", "group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px]", "data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md", "data-[range-middle=true]:rounded-none", "data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md", defaultClassNames.day, className), ...props }));
76
- }
77
- Calendar.displayName = "Calendar";
78
- export { Calendar, CalendarDayButton };
package/Card/Card.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import * as React from "react";
2
- type CardVariant = "default" | "outline";
3
- declare const cardVariants: (props?: ({
4
- variant?: "default" | "outline" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
7
- variant?: CardVariant;
8
- }
9
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
10
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
11
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
12
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
13
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, cardVariants };
16
- export type { CardVariant };
package/Card/Card.js DELETED
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { cva } from "class-variance-authority";
4
- import { cn } from "../lib/utils";
5
- const cardVariants = cva("rounded-xl border bg-white text-main-950 shadow-sm", {
6
- variants: {
7
- variant: {
8
- default: "border-grey-200",
9
- outline: "border-grey-300 shadow-none",
10
- },
11
- },
12
- defaultVariants: {
13
- variant: "default",
14
- },
15
- });
16
- const Card = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx("div", { ref: ref, className: cn(cardVariants({ variant }), className), ...props })));
17
- Card.displayName = "Card";
18
- const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
19
- CardHeader.displayName = "CardHeader";
20
- const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("font-semibold leading-none tracking-tight", className), ...props })));
21
- CardTitle.displayName = "CardTitle";
22
- const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm text-grey-500", className), ...props })));
23
- CardDescription.displayName = "CardDescription";
24
- const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
25
- CardContent.displayName = "CardContent";
26
- const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
27
- CardFooter.displayName = "CardFooter";
28
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, cardVariants };
@@ -1,37 +0,0 @@
1
- import * as React from "react";
2
- import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
3
- type CarouselApi = UseEmblaCarouselType[1];
4
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
5
- type CarouselOptions = UseCarouselParameters[0];
6
- type CarouselPlugin = UseCarouselParameters[1];
7
- type CarouselOrientation = "horizontal" | "vertical";
8
- type CarouselContextProps = {
9
- carouselRef: ReturnType<typeof useEmblaCarousel>[0];
10
- api: ReturnType<typeof useEmblaCarousel>[1];
11
- scrollPrev: () => void;
12
- scrollNext: () => void;
13
- canScrollPrev: boolean;
14
- canScrollNext: boolean;
15
- } & CarouselProps;
16
- declare function useCarousel(): CarouselContextProps;
17
- declare const carouselVariants: (props?: ({
18
- orientation?: "horizontal" | "vertical" | null | undefined;
19
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
20
- declare const carouselContentVariants: (props?: ({
21
- orientation?: "horizontal" | "vertical" | null | undefined;
22
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
- declare const carouselItemVariants: (props?: ({
24
- orientation?: "horizontal" | "vertical" | null | undefined;
25
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
26
- interface CarouselProps {
27
- opts?: CarouselOptions;
28
- plugins?: CarouselPlugin;
29
- orientation?: CarouselOrientation;
30
- setApi?: (api: CarouselApi) => void;
31
- }
32
- declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
33
- declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
34
- declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
35
- declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("..").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
36
- declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("..").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
37
- export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, carouselVariants, carouselContentVariants, carouselItemVariants, useCarousel, type CarouselApi, type CarouselProps, type CarouselOptions, type CarouselPlugin, type CarouselOrientation, };
@@ -1,132 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import useEmblaCarousel, {} from "embla-carousel-react";
4
- import { cva } from "class-variance-authority";
5
- import { ArrowLeft, ArrowRight } from "lucide-react";
6
- import { cn } from "../lib/utils";
7
- import { Button } from "../Button/Button";
8
- const CarouselContext = React.createContext(null);
9
- function useCarousel() {
10
- const context = React.useContext(CarouselContext);
11
- if (!context) {
12
- throw new Error("useCarousel must be used within a <Carousel />");
13
- }
14
- return context;
15
- }
16
- const carouselVariants = cva("relative", {
17
- variants: {
18
- orientation: {
19
- horizontal: "",
20
- vertical: "",
21
- },
22
- },
23
- defaultVariants: {
24
- orientation: "horizontal",
25
- },
26
- });
27
- const carouselContentVariants = cva("flex", {
28
- variants: {
29
- orientation: {
30
- horizontal: "-ml-4",
31
- vertical: "-mt-4 flex-col",
32
- },
33
- },
34
- defaultVariants: {
35
- orientation: "horizontal",
36
- },
37
- });
38
- const carouselItemVariants = cva("min-w-0 shrink-0 grow-0 basis-full", {
39
- variants: {
40
- orientation: {
41
- horizontal: "pl-4",
42
- vertical: "pt-4",
43
- },
44
- },
45
- defaultVariants: {
46
- orientation: "horizontal",
47
- },
48
- });
49
- const Carousel = React.forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref) => {
50
- const [carouselRef, api] = useEmblaCarousel({
51
- ...opts,
52
- axis: orientation === "horizontal" ? "x" : "y",
53
- }, plugins);
54
- const [canScrollPrev, setCanScrollPrev] = React.useState(false);
55
- const [canScrollNext, setCanScrollNext] = React.useState(false);
56
- const onSelect = React.useCallback((api) => {
57
- if (!api) {
58
- return;
59
- }
60
- setCanScrollPrev(api.canScrollPrev());
61
- setCanScrollNext(api.canScrollNext());
62
- }, []);
63
- const scrollPrev = React.useCallback(() => {
64
- api?.scrollPrev();
65
- }, [api]);
66
- const scrollNext = React.useCallback(() => {
67
- api?.scrollNext();
68
- }, [api]);
69
- const handleKeyDown = React.useCallback((event) => {
70
- if (event.key === "ArrowLeft") {
71
- event.preventDefault();
72
- scrollPrev();
73
- }
74
- else if (event.key === "ArrowRight") {
75
- event.preventDefault();
76
- scrollNext();
77
- }
78
- }, [scrollPrev, scrollNext]);
79
- React.useEffect(() => {
80
- if (!api || !setApi) {
81
- return;
82
- }
83
- setApi(api);
84
- }, [api, setApi]);
85
- React.useEffect(() => {
86
- if (!api) {
87
- return;
88
- }
89
- onSelect(api);
90
- api.on("reInit", onSelect);
91
- api.on("select", onSelect);
92
- return () => {
93
- api?.off("select", onSelect);
94
- };
95
- }, [api, onSelect]);
96
- return (_jsx(CarouselContext.Provider, { value: {
97
- carouselRef,
98
- api: api,
99
- opts,
100
- orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
101
- scrollPrev,
102
- scrollNext,
103
- canScrollPrev,
104
- canScrollNext,
105
- }, children: _jsx("div", { ref: ref, onKeyDownCapture: handleKeyDown, className: cn(carouselVariants({ orientation }), className), role: "region", "aria-roledescription": "carousel", ...props, children: children }) }));
106
- });
107
- Carousel.displayName = "Carousel";
108
- const CarouselContent = React.forwardRef(({ className, ...props }, ref) => {
109
- const { carouselRef, orientation } = useCarousel();
110
- return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", children: _jsx("div", { ref: ref, className: cn(carouselContentVariants({ orientation }), className), ...props }) }));
111
- });
112
- CarouselContent.displayName = "CarouselContent";
113
- const CarouselItem = React.forwardRef(({ className, ...props }, ref) => {
114
- const { orientation } = useCarousel();
115
- return (_jsx("div", { ref: ref, role: "group", "aria-roledescription": "slide", className: cn(carouselItemVariants({ orientation }), className), ...props }));
116
- });
117
- CarouselItem.displayName = "CarouselItem";
118
- const CarouselPrevious = React.forwardRef(({ className, variant = "outline", size = "small", ...props }, ref) => {
119
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
120
- return (_jsxs(Button, { ref: ref, variant: variant, size: size, roundness: "round", className: cn("absolute h-8 w-8 p-0", orientation === "horizontal"
121
- ? "-left-12 top-1/2 -translate-y-1/2"
122
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ArrowLeft, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
123
- });
124
- CarouselPrevious.displayName = "CarouselPrevious";
125
- const CarouselNext = React.forwardRef(({ className, variant = "outline", size = "small", ...props }, ref) => {
126
- const { orientation, scrollNext, canScrollNext } = useCarousel();
127
- return (_jsxs(Button, { ref: ref, variant: variant, size: size, roundness: "round", className: cn("absolute h-8 w-8 p-0", orientation === "horizontal"
128
- ? "-right-12 top-1/2 -translate-y-1/2"
129
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ArrowRight, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
130
- });
131
- CarouselNext.displayName = "CarouselNext";
132
- export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, carouselVariants, carouselContentVariants, carouselItemVariants, useCarousel, };
@@ -1,33 +0,0 @@
1
- import * as React from "react";
2
- type ChatBubbleSide = "left" | "right";
3
- type ChatBubbleColor = "blue" | "grey" | "green" | "lightGrey";
4
- type ChatBubbleTheme = "dark" | "light";
5
- type ChatBubbleSize = "small" | "medium" | "large" | "xlarge";
6
- declare const chatBubbleVariants: (props?: ({
7
- side?: "left" | "right" | null | undefined;
8
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
- declare const bubbleContentVariants: (props?: ({
10
- color?: "blue" | "grey" | "green" | "lightGrey" | null | undefined;
11
- theme?: "dark" | "light" | null | undefined;
12
- side?: "left" | "right" | null | undefined;
13
- size?: "small" | "large" | "xlarge" | "medium" | null | undefined;
14
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
- export interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
16
- /** The side of the chat bubble (left for received, right for sent) */
17
- side?: ChatBubbleSide;
18
- /** The color variant of the bubble */
19
- color?: ChatBubbleColor;
20
- /** The theme variant */
21
- theme?: ChatBubbleTheme;
22
- /** The text size of the bubble */
23
- size?: ChatBubbleSize;
24
- /** The message content */
25
- children: React.ReactNode;
26
- /** Optional label shown above the bubble (e.g., sender name) */
27
- label?: string;
28
- /** Whether to show the label */
29
- showLabel?: boolean;
30
- }
31
- declare const ChatBubble: React.ForwardRefExoticComponent<ChatBubbleProps & React.RefAttributes<HTMLDivElement>>;
32
- export { ChatBubble, chatBubbleVariants, bubbleContentVariants };
33
- export type { ChatBubbleSide, ChatBubbleColor, ChatBubbleTheme, ChatBubbleSize };