@xwadex/fesd-next 0.3.4-8 → 0.3.4-9

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 (182) hide show
  1. package/dist/components/index.d.ts +186 -5
  2. package/dist/components/index.js +9561 -5
  3. package/dist/components/index.js.map +1 -0
  4. package/dist/hooks/index.d.ts +68 -10
  5. package/dist/hooks/index.js +9243 -10
  6. package/dist/hooks/index.js.map +1 -0
  7. package/dist/index.d.ts +55 -5
  8. package/dist/index.js +36374 -5
  9. package/dist/index.js.map +1 -0
  10. package/dist/shadcns/index.d.ts +490 -48
  11. package/dist/shadcns/index.js +32495 -48
  12. package/dist/shadcns/index.js.map +1 -0
  13. package/dist/types/index.d.ts +17 -2
  14. package/dist/types/index.js +3 -2
  15. package/dist/types/index.js.map +1 -0
  16. package/dist/useAnchors-BzgJT2J9.d.ts +78 -0
  17. package/dist/utils/index.d.ts +12 -10
  18. package/dist/utils/index.js +56 -63
  19. package/dist/utils/index.js.map +1 -0
  20. package/package.json +9 -7
  21. package/dist/components/anchors/anchors.d.ts +0 -14
  22. package/dist/components/anchors/anchors.js +0 -23
  23. package/dist/components/anchors/index.d.ts +0 -1
  24. package/dist/components/anchors/index.js +0 -1
  25. package/dist/components/embla-carousels/embla-carousels-hooks.d.ts +0 -36
  26. package/dist/components/embla-carousels/embla-carousels-hooks.js +0 -83
  27. package/dist/components/embla-carousels/embla-carousels.d.ts +0 -23
  28. package/dist/components/embla-carousels/embla-carousels.js +0 -58
  29. package/dist/components/embla-carousels/index.d.ts +0 -2
  30. package/dist/components/embla-carousels/index.js +0 -2
  31. package/dist/components/emblas/embla-container.d.ts +0 -8
  32. package/dist/components/emblas/embla-container.js +0 -12
  33. package/dist/components/emblas/embla-context.d.ts +0 -21
  34. package/dist/components/emblas/embla-context.js +0 -12
  35. package/dist/components/emblas/embla.d.ts +0 -20
  36. package/dist/components/emblas/embla.js +0 -124
  37. package/dist/components/emblas/emblas-pagination.d.ts +0 -11
  38. package/dist/components/emblas/emblas-pagination.js +0 -89
  39. package/dist/components/emblas/index.d.ts +0 -4
  40. package/dist/components/emblas/index.js +0 -4
  41. package/dist/components/scroll-containers/index.d.ts +0 -3
  42. package/dist/components/scroll-containers/index.js +0 -3
  43. package/dist/components/scroll-containers/lenis-scroll.d.ts +0 -20
  44. package/dist/components/scroll-containers/lenis-scroll.js +0 -65
  45. package/dist/components/scroll-containers/native-scroll.d.ts +0 -6
  46. package/dist/components/scroll-containers/native-scroll.js +0 -23
  47. package/dist/components/scroll-containers/scroll-containers.d.ts +0 -25
  48. package/dist/components/scroll-containers/scroll-containers.js +0 -46
  49. package/dist/components/tests/index.d.ts +0 -1
  50. package/dist/components/tests/index.js +0 -1
  51. package/dist/components/tests/tests.d.ts +0 -4
  52. package/dist/components/tests/tests.js +0 -9
  53. package/dist/hooks/useAnchors.d.ts +0 -73
  54. package/dist/hooks/useAnchors.js +0 -203
  55. package/dist/hooks/useAsyncFetcher.d.ts +0 -11
  56. package/dist/hooks/useAsyncFetcher.js +0 -39
  57. package/dist/hooks/useCookies.d.ts +0 -6
  58. package/dist/hooks/useCookies.js +0 -42
  59. package/dist/hooks/useDebounce.d.ts +0 -7
  60. package/dist/hooks/useDebounce.js +0 -15
  61. package/dist/hooks/useDebounceValue.d.ts +0 -1
  62. package/dist/hooks/useDebounceValue.js +0 -16
  63. package/dist/hooks/useDragResize.d.ts +0 -22
  64. package/dist/hooks/useDragResize.js +0 -74
  65. package/dist/hooks/useEffectLeave.d.ts +0 -1
  66. package/dist/hooks/useEffectLeave.js +0 -11
  67. package/dist/hooks/useEffectOne.d.ts +0 -1
  68. package/dist/hooks/useEffectOne.js +0 -11
  69. package/dist/hooks/useHash.d.ts +0 -1
  70. package/dist/hooks/useHash.js +0 -18
  71. package/dist/hooks/useLocations.d.ts +0 -13
  72. package/dist/hooks/useLocations.js +0 -24
  73. package/dist/hooks/useMounted.d.ts +0 -3
  74. package/dist/hooks/useMounted.js +0 -6
  75. package/dist/shadcns/components/ui/accordion.d.ts +0 -7
  76. package/dist/shadcns/components/ui/accordion.js +0 -18
  77. package/dist/shadcns/components/ui/alert-dialog.d.ts +0 -14
  78. package/dist/shadcns/components/ui/alert-dialog.js +0 -38
  79. package/dist/shadcns/components/ui/alert.d.ts +0 -9
  80. package/dist/shadcns/components/ui/alert.js +0 -25
  81. package/dist/shadcns/components/ui/aspect-ratio.d.ts +0 -3
  82. package/dist/shadcns/components/ui/aspect-ratio.js +0 -7
  83. package/dist/shadcns/components/ui/avatar.d.ts +0 -6
  84. package/dist/shadcns/components/ui/avatar.js +0 -14
  85. package/dist/shadcns/components/ui/badge.d.ts +0 -9
  86. package/dist/shadcns/components/ui/badge.js +0 -23
  87. package/dist/shadcns/components/ui/breadcrumb.d.ts +0 -11
  88. package/dist/shadcns/components/ui/breadcrumb.js +0 -27
  89. package/dist/shadcns/components/ui/button-group.d.ts +0 -11
  90. package/dist/shadcns/components/ui/button-group.js +0 -26
  91. package/dist/shadcns/components/ui/button.d.ts +0 -10
  92. package/dist/shadcns/components/ui/button.js +0 -31
  93. package/dist/shadcns/components/ui/calendar.d.ts +0 -8
  94. package/dist/shadcns/components/ui/calendar.js +0 -73
  95. package/dist/shadcns/components/ui/card.d.ts +0 -9
  96. package/dist/shadcns/components/ui/card.js +0 -25
  97. package/dist/shadcns/components/ui/carousel.d.ts +0 -19
  98. package/dist/shadcns/components/ui/carousel.js +0 -91
  99. package/dist/shadcns/components/ui/chart.d.ts +0 -40
  100. package/dist/shadcns/components/ui/chart.js +0 -114
  101. package/dist/shadcns/components/ui/checkbox.d.ts +0 -4
  102. package/dist/shadcns/components/ui/checkbox.js +0 -9
  103. package/dist/shadcns/components/ui/collapsible.d.ts +0 -5
  104. package/dist/shadcns/components/ui/collapsible.js +0 -13
  105. package/dist/shadcns/components/ui/command.d.ts +0 -18
  106. package/dist/shadcns/components/ui/command.js +0 -33
  107. package/dist/shadcns/components/ui/context-menu.d.ts +0 -25
  108. package/dist/shadcns/components/ui/context-menu.js +0 -51
  109. package/dist/shadcns/components/ui/dialog.d.ts +0 -15
  110. package/dist/shadcns/components/ui/dialog.js +0 -36
  111. package/dist/shadcns/components/ui/drawer.d.ts +0 -13
  112. package/dist/shadcns/components/ui/drawer.js +0 -35
  113. package/dist/shadcns/components/ui/dropdown-menu.d.ts +0 -25
  114. package/dist/shadcns/components/ui/dropdown-menu.js +0 -51
  115. package/dist/shadcns/components/ui/field.d.ts +0 -24
  116. package/dist/shadcns/components/ui/field.js +0 -75
  117. package/dist/shadcns/components/ui/form.d.ts +0 -24
  118. package/dist/shadcns/components/ui/form.js +0 -56
  119. package/dist/shadcns/components/ui/hover-card.d.ts +0 -6
  120. package/dist/shadcns/components/ui/hover-card.js +0 -14
  121. package/dist/shadcns/components/ui/input-otp.d.ts +0 -11
  122. package/dist/shadcns/components/ui/input-otp.js +0 -21
  123. package/dist/shadcns/components/ui/input.d.ts +0 -3
  124. package/dist/shadcns/components/ui/input.js +0 -6
  125. package/dist/shadcns/components/ui/item.d.ts +0 -23
  126. package/dist/shadcns/components/ui/item.js +0 -65
  127. package/dist/shadcns/components/ui/label.d.ts +0 -4
  128. package/dist/shadcns/components/ui/label.js +0 -8
  129. package/dist/shadcns/components/ui/menubar.d.ts +0 -26
  130. package/dist/shadcns/components/ui/menubar.js +0 -54
  131. package/dist/shadcns/components/ui/native-select.d.ts +0 -7
  132. package/dist/shadcns/components/ui/native-select.js +0 -13
  133. package/dist/shadcns/components/ui/navigation-menu.d.ts +0 -14
  134. package/dist/shadcns/components/ui/navigation-menu.js +0 -31
  135. package/dist/shadcns/components/ui/pagination.d.ts +0 -13
  136. package/dist/shadcns/components/ui/pagination.js +0 -28
  137. package/dist/shadcns/components/ui/popover.d.ts +0 -7
  138. package/dist/shadcns/components/ui/popover.js +0 -17
  139. package/dist/shadcns/components/ui/progress.d.ts +0 -4
  140. package/dist/shadcns/components/ui/progress.js +0 -8
  141. package/dist/shadcns/components/ui/radio-group.d.ts +0 -5
  142. package/dist/shadcns/components/ui/radio-group.js +0 -12
  143. package/dist/shadcns/components/ui/resizable.d.ts +0 -8
  144. package/dist/shadcns/components/ui/resizable.js +0 -15
  145. package/dist/shadcns/components/ui/scroll-area.d.ts +0 -5
  146. package/dist/shadcns/components/ui/scroll-area.js +0 -11
  147. package/dist/shadcns/components/ui/select.d.ts +0 -15
  148. package/dist/shadcns/components/ui/select.js +0 -38
  149. package/dist/shadcns/components/ui/separator.d.ts +0 -4
  150. package/dist/shadcns/components/ui/separator.js +0 -8
  151. package/dist/shadcns/components/ui/sheet.d.ts +0 -13
  152. package/dist/shadcns/components/ui/sheet.js +0 -40
  153. package/dist/shadcns/components/ui/sidebar.d.ts +0 -66
  154. package/dist/shadcns/components/ui/sidebar.js +0 -204
  155. package/dist/shadcns/components/ui/skeleton.d.ts +0 -2
  156. package/dist/shadcns/components/ui/skeleton.js +0 -6
  157. package/dist/shadcns/components/ui/slider.d.ts +0 -4
  158. package/dist/shadcns/components/ui/slider.js +0 -10
  159. package/dist/shadcns/components/ui/sonner.d.ts +0 -3
  160. package/dist/shadcns/components/ui/sonner.js +0 -13
  161. package/dist/shadcns/components/ui/switch.d.ts +0 -4
  162. package/dist/shadcns/components/ui/switch.js +0 -8
  163. package/dist/shadcns/components/ui/table.d.ts +0 -10
  164. package/dist/shadcns/components/ui/table.js +0 -28
  165. package/dist/shadcns/components/ui/tabs.d.ts +0 -7
  166. package/dist/shadcns/components/ui/tabs.js +0 -17
  167. package/dist/shadcns/components/ui/textarea.d.ts +0 -3
  168. package/dist/shadcns/components/ui/textarea.js +0 -6
  169. package/dist/shadcns/components/ui/toggle-group.d.ts +0 -7
  170. package/dist/shadcns/components/ui/toggle-group.js +0 -20
  171. package/dist/shadcns/components/ui/toggle.d.ts +0 -9
  172. package/dist/shadcns/components/ui/toggle.js +0 -26
  173. package/dist/shadcns/components/ui/tooltip.d.ts +0 -7
  174. package/dist/shadcns/components/ui/tooltip.js +0 -17
  175. package/dist/shadcns/hooks/use-mobile.d.ts +0 -1
  176. package/dist/shadcns/hooks/use-mobile.js +0 -15
  177. package/dist/shadcns/lib/utils.d.ts +0 -2
  178. package/dist/shadcns/lib/utils.js +0 -5
  179. package/dist/types/components.type.d.ts +0 -9
  180. package/dist/types/components.type.js +0 -1
  181. package/dist/types/shadcns.type.d.ts +0 -6
  182. package/dist/types/shadcns.type.js +0 -2
@@ -1,25 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cva } from 'class-variance-authority';
4
- import { cn } from '../../index.js';
5
- const alertVariants = cva('relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', {
6
- variants: {
7
- variant: {
8
- default: 'bg-card text-card-foreground',
9
- destructive: 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
10
- },
11
- },
12
- defaultVariants: {
13
- variant: 'default',
14
- },
15
- });
16
- function Alert({ className, variant, ...props }) {
17
- return (_jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
18
- }
19
- function AlertTitle({ className, ...props }) {
20
- return (_jsx("div", { "data-slot": "alert-title", className: cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className), ...props }));
21
- }
22
- function AlertDescription({ className, ...props }) {
23
- return (_jsx("div", { "data-slot": "alert-description", className: cn('text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed', className), ...props }));
24
- }
25
- export { Alert, AlertTitle, AlertDescription };
@@ -1,3 +0,0 @@
1
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
2
- declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
- export { AspectRatio };
@@ -1,7 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
4
- function AspectRatio({ ...props }) {
5
- return _jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
6
- }
7
- export { AspectRatio };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
- declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
- declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
6
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
4
- import { cn } from '../../index.js';
5
- function Avatar({ className, ...props }) {
6
- return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className), ...props }));
7
- }
8
- function AvatarImage({ className, ...props }) {
9
- return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
10
- }
11
- function AvatarFallback({ className, ...props }) {
12
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
13
- }
14
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- declare const badgeVariants: (props?: ({
4
- variant?: "default" | "outline" | "destructive" | "secondary" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
- asChild?: boolean;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- export { Badge, badgeVariants };
@@ -1,23 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Slot } from '@radix-ui/react-slot';
4
- import { cva } from 'class-variance-authority';
5
- import { cn } from '../../index.js';
6
- const badgeVariants = cva('inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
7
- variants: {
8
- variant: {
9
- default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
10
- secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
11
- destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
12
- outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
13
- },
14
- },
15
- defaultVariants: {
16
- variant: 'default',
17
- },
18
- });
19
- function Badge({ className, variant, asChild = false, ...props }) {
20
- const Comp = asChild ? Slot : 'span';
21
- return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props }));
22
- }
23
- export { Badge, badgeVariants };
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): import("react/jsx-runtime").JSX.Element;
3
- declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): import("react/jsx-runtime").JSX.Element;
4
- declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
5
- declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<'a'> & {
6
- asChild?: boolean;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
9
- declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
10
- declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
11
- export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Slot } from '@radix-ui/react-slot';
3
- import { ChevronRight, MoreHorizontal } from 'lucide-react';
4
- import { cn } from '../../index.js';
5
- function Breadcrumb({ ...props }) {
6
- return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
7
- }
8
- function BreadcrumbList({ className, ...props }) {
9
- return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', className), ...props }));
10
- }
11
- function BreadcrumbItem({ className, ...props }) {
12
- return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn('inline-flex items-center gap-1.5', className), ...props }));
13
- }
14
- function BreadcrumbLink({ asChild, className, ...props }) {
15
- const Comp = asChild ? Slot : 'a';
16
- return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn('hover:text-foreground transition-colors', className), ...props }));
17
- }
18
- function BreadcrumbPage({ className, ...props }) {
19
- return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('text-foreground font-normal', className), ...props }));
20
- }
21
- function BreadcrumbSeparator({ children, className, ...props }) {
22
- return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
23
- }
24
- function BreadcrumbEllipsis({ className, ...props }) {
25
- return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn('flex size-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
26
- }
27
- export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -1,11 +0,0 @@
1
- import { type VariantProps } from "class-variance-authority";
2
- import { Separator } from "../../index.js";
3
- declare const buttonGroupVariants: (props?: ({
4
- orientation?: "horizontal" | "vertical" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react/jsx-runtime").JSX.Element;
7
- declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
8
- asChild?: boolean;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
11
- export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Slot } from "@radix-ui/react-slot";
3
- import { cva } from "class-variance-authority";
4
- import { cn, Separator } from "../../index.js";
5
- const buttonGroupVariants = cva("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2", {
6
- variants: {
7
- orientation: {
8
- horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
9
- vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
10
- },
11
- },
12
- defaultVariants: {
13
- orientation: "horizontal",
14
- },
15
- });
16
- function ButtonGroup({ className, orientation, ...props }) {
17
- return (_jsx("div", { role: "group", "data-slot": "button-group", "data-orientation": orientation, className: cn(buttonGroupVariants({ orientation }), className), ...props }));
18
- }
19
- function ButtonGroupText({ className, asChild = false, ...props }) {
20
- const Comp = asChild ? Slot : "div";
21
- return (_jsx(Comp, { className: cn("bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
22
- }
23
- function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
24
- return (_jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className), ...props }));
25
- }
26
- export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- declare const buttonVariants: (props?: ({
4
- variant?: "default" | "outline" | "link" | "destructive" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
- asChild?: boolean;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export { Button, buttonVariants };
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Slot } from '@radix-ui/react-slot';
3
- import { cva } from 'class-variance-authority';
4
- import { cn } from '../../index.js';
5
- const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
6
- variants: {
7
- variant: {
8
- default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
9
- destructive: 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
10
- outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
11
- secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
12
- ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
13
- link: 'text-primary underline-offset-4 hover:underline',
14
- },
15
- size: {
16
- default: 'h-9 px-4 py-2 has-[>svg]:px-3',
17
- sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
18
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
19
- icon: 'size-9',
20
- },
21
- },
22
- defaultVariants: {
23
- variant: 'default',
24
- size: 'default',
25
- },
26
- });
27
- function Button({ className, variant, size, asChild = false, ...props }) {
28
- const Comp = asChild ? Slot : 'button';
29
- return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
30
- }
31
- export { Button, buttonVariants };
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { DayButton, DayPicker } from 'react-day-picker';
3
- import { Button } from '../../index.js';
4
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
5
- buttonVariant?: React.ComponentProps<typeof Button>['variant'];
6
- }): import("react/jsx-runtime").JSX.Element;
7
- declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
8
- export { Calendar, CalendarDayButton };
@@ -1,73 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
5
- import { DayPicker, getDefaultClassNames } from 'react-day-picker';
6
- import { cn, Button, buttonVariants } from '../../index.js';
7
- function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }) {
8
- const defaultClassNames = getDefaultClassNames();
9
- return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
10
- formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
11
- ...formatters,
12
- }, classNames: {
13
- root: cn('w-fit', defaultClassNames.root),
14
- months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
15
- month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
16
- nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
17
- button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
18
- button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
19
- month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
20
- dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
21
- dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root),
22
- dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),
23
- caption_label: cn('select-none font-medium', captionLayout === 'label'
24
- ? 'text-sm'
25
- : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
26
- table: 'w-full border-collapse',
27
- weekdays: cn('flex', defaultClassNames.weekdays),
28
- weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
29
- week: cn('flex w-full mt-2', defaultClassNames.week),
30
- week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
31
- week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
32
- day: cn('relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', defaultClassNames.day),
33
- range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
34
- range_middle: cn('rounded-none', defaultClassNames.range_middle),
35
- range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
36
- today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
37
- outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
38
- disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
39
- hidden: cn('invisible', defaultClassNames.hidden),
40
- ...classNames,
41
- }, components: {
42
- Root: ({ className, rootRef, ...props }) => {
43
- return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
44
- },
45
- Chevron: ({ className, orientation, ...props }) => {
46
- if (orientation === 'left') {
47
- return _jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props });
48
- }
49
- if (orientation === 'right') {
50
- return _jsx(ChevronRightIcon, { className: cn('size-4', className), ...props });
51
- }
52
- return _jsx(ChevronDownIcon, { className: cn('size-4', className), ...props });
53
- },
54
- DayButton: CalendarDayButton,
55
- WeekNumber: ({ children, ...props }) => {
56
- return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
57
- },
58
- ...components,
59
- }, ...props }));
60
- }
61
- function CalendarDayButton({ className, day, modifiers, ...props }) {
62
- const defaultClassNames = getDefaultClassNames();
63
- const ref = React.useRef(null);
64
- React.useEffect(() => {
65
- if (modifiers.focused)
66
- ref.current?.focus();
67
- }, [modifiers.focused]);
68
- return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
69
- !modifiers.range_start &&
70
- !modifiers.range_end &&
71
- !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal 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 [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
72
- }
73
- export { Calendar, CalendarDayButton };
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- declare function Card({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
3
- declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
4
- declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
5
- declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
6
- declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
7
- declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
- declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -1,25 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '../../index.js';
4
- function Card({ className, ...props }) {
5
- return (_jsx("div", { "data-slot": "card", className: cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className), ...props }));
6
- }
7
- function CardHeader({ className, ...props }) {
8
- return (_jsx("div", { "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', className), ...props }));
9
- }
10
- function CardTitle({ className, ...props }) {
11
- return (_jsx("div", { "data-slot": "card-title", className: cn('leading-none font-semibold', className), ...props }));
12
- }
13
- function CardDescription({ className, ...props }) {
14
- return (_jsx("div", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
15
- }
16
- function CardAction({ className, ...props }) {
17
- return (_jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
18
- }
19
- function CardContent({ className, ...props }) {
20
- return _jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props });
21
- }
22
- function CardFooter({ className, ...props }) {
23
- return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
24
- }
25
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
3
- import { Button } from '../../index.js';
4
- type CarouselApi = UseEmblaCarouselType[1];
5
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
- type CarouselOptions = UseCarouselParameters[0];
7
- type CarouselPlugin = UseCarouselParameters[1];
8
- type CarouselProps = {
9
- opts?: CarouselOptions;
10
- plugins?: CarouselPlugin;
11
- orientation?: 'horizontal' | 'vertical';
12
- setApi?: (api: CarouselApi) => void;
13
- };
14
- declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps): import("react/jsx-runtime").JSX.Element;
15
- declare function CarouselContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
16
- declare function CarouselItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
17
- declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
18
- declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
19
- export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
@@ -1,91 +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 useEmblaCarousel from 'embla-carousel-react';
5
- import { ArrowLeft, ArrowRight } from 'lucide-react';
6
- import { cn } from '../../index.js';
7
- import { Button } from '../../index.js';
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
- function Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }) {
17
- const [carouselRef, api] = useEmblaCarousel({
18
- ...opts,
19
- axis: orientation === 'horizontal' ? 'x' : 'y',
20
- }, plugins);
21
- const [canScrollPrev, setCanScrollPrev] = React.useState(false);
22
- const [canScrollNext, setCanScrollNext] = React.useState(false);
23
- const onSelect = React.useCallback((api) => {
24
- if (!api)
25
- return;
26
- setCanScrollPrev(api.canScrollPrev());
27
- setCanScrollNext(api.canScrollNext());
28
- }, []);
29
- const scrollPrev = React.useCallback(() => {
30
- api?.scrollPrev();
31
- }, [api]);
32
- const scrollNext = React.useCallback(() => {
33
- api?.scrollNext();
34
- }, [api]);
35
- const handleKeyDown = React.useCallback((event) => {
36
- if (event.key === 'ArrowLeft') {
37
- event.preventDefault();
38
- scrollPrev();
39
- }
40
- else if (event.key === 'ArrowRight') {
41
- event.preventDefault();
42
- scrollNext();
43
- }
44
- }, [scrollPrev, scrollNext]);
45
- React.useEffect(() => {
46
- if (!api || !setApi)
47
- return;
48
- setApi(api);
49
- }, [api, setApi]);
50
- React.useEffect(() => {
51
- if (!api)
52
- return;
53
- onSelect(api);
54
- api.on('reInit', onSelect);
55
- api.on('select', onSelect);
56
- return () => {
57
- api?.off('select', onSelect);
58
- };
59
- }, [api, onSelect]);
60
- return (_jsx(CarouselContext.Provider, { value: {
61
- carouselRef,
62
- api: api,
63
- opts,
64
- orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
65
- scrollPrev,
66
- scrollNext,
67
- canScrollPrev,
68
- canScrollNext,
69
- }, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn('relative', className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
70
- }
71
- function CarouselContent({ className, ...props }) {
72
- const { carouselRef, orientation } = useCarousel();
73
- return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className), ...props }) }));
74
- }
75
- function CarouselItem({ className, ...props }) {
76
- const { orientation } = useCarousel();
77
- return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className), ...props }));
78
- }
79
- function CarouselPrevious({ className, variant = 'outline', size = 'icon', ...props }) {
80
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
81
- return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
82
- ? 'top-1/2 -left-12 -translate-y-1/2'
83
- : '-top-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ArrowLeft, {}), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
84
- }
85
- function CarouselNext({ className, variant = 'outline', size = 'icon', ...props }) {
86
- const { orientation, scrollNext, canScrollNext } = useCarousel();
87
- return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
88
- ? 'top-1/2 -right-12 -translate-y-1/2'
89
- : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ArrowRight, {}), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
90
- }
91
- export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
@@ -1,40 +0,0 @@
1
- import * as React from 'react';
2
- import * as RechartsPrimitive from 'recharts';
3
- declare const THEMES: {
4
- readonly light: "";
5
- readonly dark: ".dark";
6
- };
7
- export type ChartConfig = {
8
- [k in string]: {
9
- label?: React.ReactNode;
10
- icon?: React.ComponentType;
11
- } & ({
12
- color?: string;
13
- theme?: never;
14
- } | {
15
- color?: never;
16
- theme: Record<keyof typeof THEMES, string>;
17
- });
18
- };
19
- declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<'div'> & {
20
- config: ChartConfig;
21
- children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
22
- }): import("react/jsx-runtime").JSX.Element;
23
- declare const ChartStyle: ({ id, config }: {
24
- id: string;
25
- config: ChartConfig;
26
- }) => import("react/jsx-runtime").JSX.Element | null;
27
- declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
28
- declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
29
- hideLabel?: boolean;
30
- hideIndicator?: boolean;
31
- indicator?: 'line' | 'dot' | 'dashed';
32
- nameKey?: string;
33
- labelKey?: string;
34
- }): import("react/jsx-runtime").JSX.Element | null;
35
- declare const ChartLegend: typeof RechartsPrimitive.Legend;
36
- declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
37
- hideIcon?: boolean;
38
- nameKey?: string;
39
- }): import("react/jsx-runtime").JSX.Element | null;
40
- export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
@@ -1,114 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import * as RechartsPrimitive from 'recharts';
5
- import { cn } from '../../index.js';
6
- // Format: { THEME_NAME: CSS_SELECTOR }
7
- const THEMES = { light: '', dark: '.dark' };
8
- const ChartContext = React.createContext(null);
9
- function useChart() {
10
- const context = React.useContext(ChartContext);
11
- if (!context) {
12
- throw new Error('useChart must be used within a <ChartContainer />');
13
- }
14
- return context;
15
- }
16
- function ChartContainer({ id, className, children, config, ...props }) {
17
- const uniqueId = React.useId();
18
- const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
19
- return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
20
- }
21
- const ChartStyle = ({ id, config }) => {
22
- const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
23
- if (!colorConfig.length) {
24
- return null;
25
- }
26
- return (_jsx("style", { dangerouslySetInnerHTML: {
27
- __html: Object.entries(THEMES)
28
- .map(([theme, prefix]) => `
29
- ${prefix} [data-chart=${id}] {
30
- ${colorConfig
31
- .map(([key, itemConfig]) => {
32
- const color = itemConfig.theme?.[theme] || itemConfig.color;
33
- return color ? ` --color-${key}: ${color};` : null;
34
- })
35
- .join('\n')}
36
- }
37
- `)
38
- .join('\n'),
39
- } }));
40
- };
41
- const ChartTooltip = RechartsPrimitive.Tooltip;
42
- function ChartTooltipContent({ active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
43
- const { config } = useChart();
44
- const tooltipLabel = React.useMemo(() => {
45
- if (hideLabel || !payload?.length) {
46
- return null;
47
- }
48
- const [item] = payload;
49
- const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
50
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
51
- const value = !labelKey && typeof label === 'string'
52
- ? config[label]?.label || label
53
- : itemConfig?.label;
54
- if (labelFormatter) {
55
- return (_jsx("div", { className: cn('font-medium', labelClassName), children: labelFormatter(value, payload) }));
56
- }
57
- if (!value) {
58
- return null;
59
- }
60
- return _jsx("div", { className: cn('font-medium', labelClassName), children: value });
61
- }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
62
- if (!active || !payload?.length) {
63
- return null;
64
- }
65
- const nestLabel = payload.length === 1 && indicator !== 'dot';
66
- return (_jsxs("div", { className: cn('border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
67
- const key = `${nameKey || item.name || item.dataKey || 'value'}`;
68
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
69
- const indicatorColor = color || item.payload.fill || item.color;
70
- return (_jsx("div", { className: cn('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', indicator === 'dot' && 'items-center'), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {
71
- 'h-2.5 w-2.5': indicator === 'dot',
72
- 'w-1': indicator === 'line',
73
- 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
74
- 'my-0.5': nestLabel && indicator === 'dashed',
75
- }), style: {
76
- '--color-bg': indicatorColor,
77
- '--color-border': indicatorColor,
78
- } }))), _jsxs("div", { className: cn('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })] }), item.value && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
79
- }) })] }));
80
- }
81
- const ChartLegend = RechartsPrimitive.Legend;
82
- function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey, }) {
83
- const { config } = useChart();
84
- if (!payload?.length) {
85
- return null;
86
- }
87
- return (_jsx("div", { className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload.map((item) => {
88
- const key = `${nameKey || item.dataKey || 'value'}`;
89
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
90
- return (_jsxs("div", { className: cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
91
- backgroundColor: item.color,
92
- } })), itemConfig?.label] }, item.value));
93
- }) }));
94
- }
95
- // Helper to extract item config from a payload.
96
- function getPayloadConfigFromPayload(config, payload, key) {
97
- if (typeof payload !== 'object' || payload === null) {
98
- return undefined;
99
- }
100
- const payloadPayload = 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null
101
- ? payload.payload
102
- : undefined;
103
- let configLabelKey = key;
104
- if (key in payload && typeof payload[key] === 'string') {
105
- configLabelKey = payload[key];
106
- }
107
- else if (payloadPayload &&
108
- key in payloadPayload &&
109
- typeof payloadPayload[key] === 'string') {
110
- configLabelKey = payloadPayload[key];
111
- }
112
- return configLabelKey in config ? config[configLabelKey] : config[key];
113
- }
114
- export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };