harebear-ui 0.0.0-stage → 0.2.2

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 (198) hide show
  1. package/AGENTS.md +66 -0
  2. package/LICENSE +21 -0
  3. package/README.md +92 -2
  4. package/bin/harebear-ui.mjs +125 -0
  5. package/dist/components/admin/activity-feed.d.ts +15 -0
  6. package/dist/components/admin/activity-feed.js +50 -0
  7. package/dist/components/admin/app-shell.d.ts +47 -0
  8. package/dist/components/admin/app-shell.js +108 -0
  9. package/dist/components/admin/callout.d.ts +7 -0
  10. package/dist/components/admin/callout.js +18 -0
  11. package/dist/components/admin/key-value-grid.d.ts +11 -0
  12. package/dist/components/admin/key-value-grid.js +23 -0
  13. package/dist/components/admin/link-tile.d.ts +17 -0
  14. package/dist/components/admin/link-tile.js +36 -0
  15. package/dist/components/admin/page-header.d.ts +14 -0
  16. package/dist/components/admin/page-header.js +41 -0
  17. package/dist/components/admin/search-input.d.ts +12 -0
  18. package/dist/components/admin/search-input.js +32 -0
  19. package/dist/components/admin/stat-card.d.ts +20 -0
  20. package/dist/components/admin/stat-card.js +53 -0
  21. package/dist/components/admin/status.d.ts +12 -0
  22. package/dist/components/admin/status.js +32 -0
  23. package/dist/components/admin/timeline.d.ts +13 -0
  24. package/dist/components/admin/timeline.js +36 -0
  25. package/dist/components/admin/usage-meter.d.ts +17 -0
  26. package/dist/components/admin/usage-meter.js +43 -0
  27. package/dist/components/admin/user-chip.d.ts +14 -0
  28. package/dist/components/admin/user-chip.js +38 -0
  29. package/dist/components/ai/chat.d.ts +44 -0
  30. package/dist/components/ai/chat.js +151 -0
  31. package/dist/components/ai/code-block.d.ts +27 -0
  32. package/dist/components/ai/code-block.js +63 -0
  33. package/dist/components/ai/conversation-list.d.ts +18 -0
  34. package/dist/components/ai/conversation-list.js +30 -0
  35. package/dist/components/ai/model-picker.d.ts +21 -0
  36. package/dist/components/ai/model-picker.js +55 -0
  37. package/dist/components/ai/prompt-input.d.ts +27 -0
  38. package/dist/components/ai/prompt-input.js +99 -0
  39. package/dist/components/auth/auth.d.ts +85 -0
  40. package/dist/components/auth/auth.js +325 -0
  41. package/dist/components/data/bar-list.d.ts +14 -0
  42. package/dist/components/data/bar-list.js +27 -0
  43. package/dist/components/data/data-table.d.ts +70 -0
  44. package/dist/components/data/data-table.js +208 -0
  45. package/dist/components/data/sparkline.d.ts +16 -0
  46. package/dist/components/data/sparkline.js +72 -0
  47. package/dist/components/data/status-bars.d.ts +17 -0
  48. package/dist/components/data/status-bars.js +37 -0
  49. package/dist/components/data/trend-chart.d.ts +31 -0
  50. package/dist/components/data/trend-chart.js +136 -0
  51. package/dist/components/theme/theme-provider.d.ts +42 -0
  52. package/dist/components/theme/theme-provider.js +110 -0
  53. package/dist/components/theme/theme-toggle.d.ts +5 -0
  54. package/dist/components/theme/theme-toggle.js +21 -0
  55. package/dist/components/ui/accordion.d.ts +7 -0
  56. package/dist/components/ui/accordion.js +53 -0
  57. package/dist/components/ui/alert-dialog.d.ts +18 -0
  58. package/dist/components/ui/alert-dialog.js +99 -0
  59. package/dist/components/ui/alert.d.ts +10 -0
  60. package/dist/components/ui/alert.js +42 -0
  61. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  62. package/dist/components/ui/aspect-ratio.js +11 -0
  63. package/dist/components/ui/attachment.d.ts +24 -0
  64. package/dist/components/ui/attachment.js +100 -0
  65. package/dist/components/ui/avatar.d.ts +11 -0
  66. package/dist/components/ui/avatar.js +49 -0
  67. package/dist/components/ui/badge.d.ts +9 -0
  68. package/dist/components/ui/badge.js +30 -0
  69. package/dist/components/ui/breadcrumb.d.ts +11 -0
  70. package/dist/components/ui/breadcrumb.js +70 -0
  71. package/dist/components/ui/bubble.d.ts +17 -0
  72. package/dist/components/ui/bubble.js +71 -0
  73. package/dist/components/ui/button-group.d.ts +11 -0
  74. package/dist/components/ui/button-group.js +39 -0
  75. package/dist/components/ui/button.d.ts +11 -0
  76. package/dist/components/ui/button.js +55 -0
  77. package/dist/components/ui/calendar.d.ts +10 -0
  78. package/dist/components/ui/calendar.js +108 -0
  79. package/dist/components/ui/card.d.ts +11 -0
  80. package/dist/components/ui/card.js +55 -0
  81. package/dist/components/ui/carousel.d.ts +28 -0
  82. package/dist/components/ui/carousel.js +131 -0
  83. package/dist/components/ui/chart.d.ts +44 -0
  84. package/dist/components/ui/chart.js +148 -0
  85. package/dist/components/ui/checkbox.d.ts +4 -0
  86. package/dist/components/ui/checkbox.js +19 -0
  87. package/dist/components/ui/code-block.d.ts +26 -0
  88. package/dist/components/ui/code-block.js +123 -0
  89. package/dist/components/ui/collapsible.d.ts +5 -0
  90. package/dist/components/ui/collapsible.js +23 -0
  91. package/dist/components/ui/combobox.d.ts +24 -0
  92. package/dist/components/ui/combobox.js +162 -0
  93. package/dist/components/ui/command.d.ts +18 -0
  94. package/dist/components/ui/command.js +86 -0
  95. package/dist/components/ui/context-menu.d.ts +31 -0
  96. package/dist/components/ui/context-menu.js +123 -0
  97. package/dist/components/ui/dialog.d.ts +17 -0
  98. package/dist/components/ui/dialog.js +94 -0
  99. package/dist/components/ui/direction.d.ts +7 -0
  100. package/dist/components/ui/direction.js +12 -0
  101. package/dist/components/ui/drawer.d.ts +13 -0
  102. package/dist/components/ui/drawer.js +76 -0
  103. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  104. package/dist/components/ui/dropdown-menu.js +126 -0
  105. package/dist/components/ui/empty.d.ts +11 -0
  106. package/dist/components/ui/empty.js +59 -0
  107. package/dist/components/ui/field.d.ts +24 -0
  108. package/dist/components/ui/field.js +109 -0
  109. package/dist/components/ui/hover-card.d.ts +6 -0
  110. package/dist/components/ui/hover-card.js +30 -0
  111. package/dist/components/ui/input-group.d.ts +16 -0
  112. package/dist/components/ui/input-group.js +77 -0
  113. package/dist/components/ui/input-otp.d.ts +11 -0
  114. package/dist/components/ui/input-otp.js +46 -0
  115. package/dist/components/ui/input.d.ts +3 -0
  116. package/dist/components/ui/input.js +13 -0
  117. package/dist/components/ui/item.d.ts +23 -0
  118. package/dist/components/ui/item.js +117 -0
  119. package/dist/components/ui/kbd.d.ts +3 -0
  120. package/dist/components/ui/kbd.js +19 -0
  121. package/dist/components/ui/label.d.ts +4 -0
  122. package/dist/components/ui/label.js +13 -0
  123. package/dist/components/ui/marker.d.ts +11 -0
  124. package/dist/components/ui/marker.js +39 -0
  125. package/dist/components/ui/menubar.d.ts +30 -0
  126. package/dist/components/ui/menubar.js +133 -0
  127. package/dist/components/ui/message-scroller.d.ts +10 -0
  128. package/dist/components/ui/message-scroller.js +59 -0
  129. package/dist/components/ui/message.d.ts +10 -0
  130. package/dist/components/ui/message.js +48 -0
  131. package/dist/components/ui/native-select.d.ts +8 -0
  132. package/dist/components/ui/native-select.js +37 -0
  133. package/dist/components/ui/navigation-menu.d.ts +14 -0
  134. package/dist/components/ui/navigation-menu.js +79 -0
  135. package/dist/components/ui/pagination.d.ts +17 -0
  136. package/dist/components/ui/pagination.js +79 -0
  137. package/dist/components/ui/popover.d.ts +10 -0
  138. package/dist/components/ui/popover.js +54 -0
  139. package/dist/components/ui/progress.d.ts +4 -0
  140. package/dist/components/ui/progress.js +18 -0
  141. package/dist/components/ui/questionnaire.d.ts +19 -0
  142. package/dist/components/ui/questionnaire.js +168 -0
  143. package/dist/components/ui/radio-group.d.ts +5 -0
  144. package/dist/components/ui/radio-group.js +25 -0
  145. package/dist/components/ui/resizable.d.ts +7 -0
  146. package/dist/components/ui/resizable.js +27 -0
  147. package/dist/components/ui/scroll-area.d.ts +5 -0
  148. package/dist/components/ui/scroll-area.js +35 -0
  149. package/dist/components/ui/select.d.ts +15 -0
  150. package/dist/components/ui/select.js +98 -0
  151. package/dist/components/ui/separator.d.ts +4 -0
  152. package/dist/components/ui/separator.js +15 -0
  153. package/dist/components/ui/sheet.d.ts +14 -0
  154. package/dist/components/ui/sheet.js +88 -0
  155. package/dist/components/ui/sidebar.d.ts +69 -0
  156. package/dist/components/ui/sidebar.js +377 -0
  157. package/dist/components/ui/skeleton.d.ts +2 -0
  158. package/dist/components/ui/skeleton.js +12 -0
  159. package/dist/components/ui/slider.d.ts +4 -0
  160. package/dist/components/ui/slider.js +35 -0
  161. package/dist/components/ui/sonner.d.ts +3 -0
  162. package/dist/components/ui/sonner.js +29 -0
  163. package/dist/components/ui/spinner.d.ts +2 -0
  164. package/dist/components/ui/spinner.js +15 -0
  165. package/dist/components/ui/switch.d.ts +6 -0
  166. package/dist/components/ui/switch.js +18 -0
  167. package/dist/components/ui/table.d.ts +10 -0
  168. package/dist/components/ui/table.js +65 -0
  169. package/dist/components/ui/tabs.d.ts +11 -0
  170. package/dist/components/ui/tabs.js +45 -0
  171. package/dist/components/ui/textarea.d.ts +3 -0
  172. package/dist/components/ui/textarea.js +12 -0
  173. package/dist/components/ui/toggle-group.d.ts +10 -0
  174. package/dist/components/ui/toggle-group.js +50 -0
  175. package/dist/components/ui/toggle.d.ts +9 -0
  176. package/dist/components/ui/toggle.js +35 -0
  177. package/dist/components/ui/tooltip.d.ts +7 -0
  178. package/dist/components/ui/tooltip.js +34 -0
  179. package/dist/components/ui/trace.d.ts +18 -0
  180. package/dist/components/ui/trace.js +74 -0
  181. package/dist/hooks/use-copy-to-clipboard.d.ts +5 -0
  182. package/dist/hooks/use-copy-to-clipboard.js +24 -0
  183. package/dist/hooks/use-highlighted-code.d.ts +2 -0
  184. package/dist/hooks/use-highlighted-code.js +54 -0
  185. package/dist/hooks/use-mobile.d.ts +1 -0
  186. package/dist/hooks/use-mobile.js +17 -0
  187. package/dist/index.d.ts +94 -0
  188. package/dist/index.js +94 -0
  189. package/dist/lib/highlighter.d.ts +9 -0
  190. package/dist/lib/highlighter.js +77 -0
  191. package/dist/lib/utils.d.ts +3 -0
  192. package/dist/lib/utils.js +8 -0
  193. package/dist/shadcn-base.css +638 -0
  194. package/dist/styles.css +188 -0
  195. package/docs/COMPONENTS.md +405 -0
  196. package/llms.txt +36 -0
  197. package/package.json +119 -4
  198. package/skills/harebear-ui/SKILL.md +34 -0
@@ -0,0 +1,108 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { Button, buttonVariants } from "./button.js";
4
+ import * as React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
7
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
8
+ // src/components/ui/calendar.tsx
9
+ function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
10
+ const defaultClassNames = getDefaultClassNames();
11
+ return /* @__PURE__ */ jsx(DayPicker, {
12
+ showOutsideDays,
13
+ className: cn("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-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),
14
+ captionLayout,
15
+ locale,
16
+ formatters: {
17
+ formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
18
+ ...formatters
19
+ },
20
+ classNames: {
21
+ root: cn("w-fit", defaultClassNames.root),
22
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
23
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
24
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
25
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
26
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
27
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
28
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
29
+ dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
30
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
31
+ caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
32
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
33
+ weekdays: cn("flex", defaultClassNames.weekdays),
34
+ weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
35
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
36
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
37
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
38
+ day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
39
+ range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
40
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
41
+ range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
42
+ today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
43
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
44
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
45
+ hidden: cn("invisible", defaultClassNames.hidden),
46
+ ...classNames
47
+ },
48
+ components: {
49
+ Root: ({ className, rootRef, ...props }) => {
50
+ return /* @__PURE__ */ jsx("div", {
51
+ "data-slot": "calendar",
52
+ ref: rootRef,
53
+ className: cn(className),
54
+ ...props
55
+ });
56
+ },
57
+ Chevron: ({ className, orientation, ...props }) => {
58
+ if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
59
+ className: cn("size-4", className),
60
+ ...props
61
+ });
62
+ if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
63
+ className: cn("size-4", className),
64
+ ...props
65
+ });
66
+ return /* @__PURE__ */ jsx(ChevronDownIcon, {
67
+ className: cn("size-4", className),
68
+ ...props
69
+ });
70
+ },
71
+ DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
72
+ locale,
73
+ ...props
74
+ }),
75
+ WeekNumber: ({ children, ...props }) => {
76
+ return /* @__PURE__ */ jsx("td", {
77
+ ...props,
78
+ children: /* @__PURE__ */ jsx("div", {
79
+ className: "flex size-(--cell-size) items-center justify-center text-center",
80
+ children
81
+ })
82
+ });
83
+ },
84
+ ...components
85
+ },
86
+ ...props
87
+ });
88
+ }
89
+ function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
90
+ const defaultClassNames = getDefaultClassNames();
91
+ const ref = React.useRef(null);
92
+ React.useEffect(() => {
93
+ if (modifiers.focused) ref.current?.focus();
94
+ }, [modifiers.focused]);
95
+ return /* @__PURE__ */ jsx(Button, {
96
+ ref,
97
+ variant: "ghost",
98
+ size: "icon",
99
+ "data-day": day.date.toLocaleDateString(locale?.code),
100
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
101
+ "data-range-start": modifiers.range_start,
102
+ "data-range-end": modifiers.range_end,
103
+ "data-range-middle": modifiers.range_middle,
104
+ className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
105
+ ...props
106
+ });
107
+ }
108
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
3
+ size?: "default" | "sm";
4
+ }): React.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/ui/card.tsx
5
+ function Card({ className, size = "default", ...props }) {
6
+ return /* @__PURE__ */ jsx("div", {
7
+ "data-slot": "card",
8
+ "data-size": size,
9
+ className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl border bg-card py-(--card-spacing) text-sm text-card-foreground shadow-card [--card-spacing:--spacing(6)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
10
+ ...props
11
+ });
12
+ }
13
+ function CardHeader({ className, ...props }) {
14
+ return /* @__PURE__ */ jsx("div", {
15
+ "data-slot": "card-header",
16
+ className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
17
+ ...props
18
+ });
19
+ }
20
+ function CardTitle({ className, ...props }) {
21
+ return /* @__PURE__ */ jsx("div", {
22
+ "data-slot": "card-title",
23
+ className: cn("text-base leading-snug font-semibold group-data-[size=sm]/card:text-sm", className),
24
+ ...props
25
+ });
26
+ }
27
+ function CardDescription({ className, ...props }) {
28
+ return /* @__PURE__ */ jsx("div", {
29
+ "data-slot": "card-description",
30
+ className: cn("text-[13px] text-muted-foreground", className),
31
+ ...props
32
+ });
33
+ }
34
+ function CardAction({ className, ...props }) {
35
+ return /* @__PURE__ */ jsx("div", {
36
+ "data-slot": "card-action",
37
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
38
+ ...props
39
+ });
40
+ }
41
+ function CardContent({ className, ...props }) {
42
+ return /* @__PURE__ */ jsx("div", {
43
+ "data-slot": "card-content",
44
+ className: cn("px-(--card-spacing)", className),
45
+ ...props
46
+ });
47
+ }
48
+ function CardFooter({ className, ...props }) {
49
+ return /* @__PURE__ */ jsx("div", {
50
+ "data-slot": "card-footer",
51
+ className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", className),
52
+ ...props
53
+ });
54
+ }
55
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,28 @@
1
+ import { Button } from "./button.js";
2
+ import * as React from "react";
3
+ import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
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
+ type CarouselContextProps = {
15
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
16
+ api: ReturnType<typeof useEmblaCarousel>[1];
17
+ scrollPrev: () => void;
18
+ scrollNext: () => void;
19
+ canScrollPrev: boolean;
20
+ canScrollNext: boolean;
21
+ } & CarouselProps;
22
+ declare function useCarousel(): CarouselContextProps;
23
+ declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
24
+ declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
25
+ declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
26
+ declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
27
+ declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
28
+ export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
@@ -0,0 +1,131 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { Button } from "./button.js";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
7
+ import useEmblaCarousel from "embla-carousel-react";
8
+ // src/components/ui/carousel.tsx
9
+ const CarouselContext = React.createContext(null);
10
+ function useCarousel() {
11
+ const context = React.useContext(CarouselContext);
12
+ if (!context) throw new Error("useCarousel must be used within a <Carousel />");
13
+ return context;
14
+ }
15
+ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
16
+ const [carouselRef, api] = useEmblaCarousel({
17
+ ...opts,
18
+ axis: orientation === "horizontal" ? "x" : "y"
19
+ }, plugins);
20
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
21
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
22
+ const onSelect = React.useCallback((api) => {
23
+ if (!api) return;
24
+ setCanScrollPrev(api.canScrollPrev());
25
+ setCanScrollNext(api.canScrollNext());
26
+ }, []);
27
+ const scrollPrev = React.useCallback(() => {
28
+ api?.scrollPrev();
29
+ }, [api]);
30
+ const scrollNext = React.useCallback(() => {
31
+ api?.scrollNext();
32
+ }, [api]);
33
+ const handleKeyDown = React.useCallback((event) => {
34
+ if (event.key === "ArrowLeft") {
35
+ event.preventDefault();
36
+ scrollPrev();
37
+ } else if (event.key === "ArrowRight") {
38
+ event.preventDefault();
39
+ scrollNext();
40
+ }
41
+ }, [scrollPrev, scrollNext]);
42
+ React.useEffect(() => {
43
+ if (!api || !setApi) return;
44
+ setApi(api);
45
+ }, [api, setApi]);
46
+ React.useEffect(() => {
47
+ if (!api) return;
48
+ onSelect(api);
49
+ api.on("reInit", onSelect);
50
+ api.on("select", onSelect);
51
+ return () => {
52
+ api?.off("select", onSelect);
53
+ };
54
+ }, [api, onSelect]);
55
+ return /* @__PURE__ */ jsx(CarouselContext.Provider, {
56
+ value: {
57
+ carouselRef,
58
+ api,
59
+ opts,
60
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
61
+ scrollPrev,
62
+ scrollNext,
63
+ canScrollPrev,
64
+ canScrollNext
65
+ },
66
+ children: /* @__PURE__ */ jsx("div", {
67
+ onKeyDownCapture: handleKeyDown,
68
+ className: cn("relative", className),
69
+ role: "region",
70
+ "aria-roledescription": "carousel",
71
+ "data-slot": "carousel",
72
+ ...props,
73
+ children
74
+ })
75
+ });
76
+ }
77
+ function CarouselContent({ className, ...props }) {
78
+ const { carouselRef, orientation } = useCarousel();
79
+ return /* @__PURE__ */ jsx("div", {
80
+ ref: carouselRef,
81
+ className: "overflow-hidden",
82
+ "data-slot": "carousel-content",
83
+ children: /* @__PURE__ */ jsx("div", {
84
+ className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
85
+ ...props
86
+ })
87
+ });
88
+ }
89
+ function CarouselItem({ className, ...props }) {
90
+ const { orientation } = useCarousel();
91
+ return /* @__PURE__ */ jsx("div", {
92
+ role: "group",
93
+ "aria-roledescription": "slide",
94
+ "data-slot": "carousel-item",
95
+ className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
96
+ ...props
97
+ });
98
+ }
99
+ function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
100
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
101
+ return /* @__PURE__ */ jsxs(Button, {
102
+ "data-slot": "carousel-previous",
103
+ variant,
104
+ size,
105
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
106
+ disabled: !canScrollPrev,
107
+ onClick: scrollPrev,
108
+ ...props,
109
+ children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
110
+ className: "sr-only",
111
+ children: "Previous slide"
112
+ })]
113
+ });
114
+ }
115
+ function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
116
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
117
+ return /* @__PURE__ */ jsxs(Button, {
118
+ "data-slot": "carousel-next",
119
+ variant,
120
+ size,
121
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
122
+ disabled: !canScrollNext,
123
+ onClick: scrollNext,
124
+ ...props,
125
+ children: [/* @__PURE__ */ jsx(ChevronRightIcon, {}), /* @__PURE__ */ jsx("span", {
126
+ className: "sr-only",
127
+ children: "Next slide"
128
+ })]
129
+ });
130
+ }
131
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import * as RechartsPrimitive from "recharts";
3
+ import { TooltipValueType } from "recharts";
4
+ declare const THEMES: {
5
+ readonly light: "";
6
+ readonly dark: ".dark";
7
+ };
8
+ type TooltipNameType = number | string;
9
+ export type ChartConfig = Record<string, {
10
+ label?: React.ReactNode;
11
+ icon?: React.ComponentType;
12
+ } & ({
13
+ color?: string;
14
+ theme?: never;
15
+ } | {
16
+ color?: never;
17
+ theme: Record<keyof typeof THEMES, string>;
18
+ })>;
19
+ declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
20
+ config: ChartConfig;
21
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
22
+ initialDimension?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ }): React.JSX.Element;
27
+ declare const ChartStyle: ({ id, config }: {
28
+ id: string;
29
+ config: ChartConfig;
30
+ }) => React.JSX.Element | null;
31
+ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
32
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
33
+ hideLabel?: boolean;
34
+ hideIndicator?: boolean;
35
+ indicator?: "line" | "dot" | "dashed";
36
+ nameKey?: string;
37
+ labelKey?: string;
38
+ } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
39
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
40
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey }: React.ComponentProps<"div"> & {
41
+ hideIcon?: boolean;
42
+ nameKey?: string;
43
+ } & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
44
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import * as React from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import * as RechartsPrimitive from "recharts";
6
+ // src/components/ui/chart.tsx
7
+ const THEMES = {
8
+ light: "",
9
+ dark: ".dark"
10
+ };
11
+ const INITIAL_DIMENSION = {
12
+ width: 320,
13
+ height: 200
14
+ };
15
+ const ChartContext = React.createContext(null);
16
+ function useChart() {
17
+ const context = React.useContext(ChartContext);
18
+ if (!context) throw new Error("useChart must be used within a <ChartContainer />");
19
+ return context;
20
+ }
21
+ function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
22
+ const uniqueId = React.useId();
23
+ const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
24
+ return /* @__PURE__ */ jsx(ChartContext.Provider, {
25
+ value: { config },
26
+ children: /* @__PURE__ */ jsxs("div", {
27
+ "data-slot": "chart",
28
+ "data-chart": chartId,
29
+ className: cn("flex aspect-video justify-center text-xs [&_.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-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.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 [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
30
+ ...props,
31
+ children: [/* @__PURE__ */ jsx(ChartStyle, {
32
+ id: chartId,
33
+ config
34
+ }), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, {
35
+ initialDimension,
36
+ children
37
+ })]
38
+ })
39
+ });
40
+ }
41
+ const ChartStyle = ({ id, config }) => {
42
+ const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);
43
+ if (!colorConfig.length) return null;
44
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
45
+ ${prefix} [data-chart=${id}] {
46
+ ${colorConfig.map(([key, itemConfig]) => {
47
+ const color = itemConfig.theme?.[theme] ?? itemConfig.color;
48
+ return color ? ` --color-${key}: ${color};` : null;
49
+ }).join("\n")}
50
+ }
51
+ `).join("\n") } });
52
+ };
53
+ const ChartTooltip = RechartsPrimitive.Tooltip;
54
+ function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }) {
55
+ const { config } = useChart();
56
+ const tooltipLabel = React.useMemo(() => {
57
+ if (hideLabel || !payload?.length) return null;
58
+ const [item] = payload;
59
+ const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
60
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
61
+ const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
62
+ if (labelFormatter) return /* @__PURE__ */ jsx("div", {
63
+ className: cn("font-medium", labelClassName),
64
+ children: labelFormatter(value, payload)
65
+ });
66
+ if (!value) return null;
67
+ return /* @__PURE__ */ jsx("div", {
68
+ className: cn("font-medium", labelClassName),
69
+ children: value
70
+ });
71
+ }, [
72
+ label,
73
+ labelFormatter,
74
+ payload,
75
+ hideLabel,
76
+ labelClassName,
77
+ config,
78
+ labelKey
79
+ ]);
80
+ if (!active || !payload?.length) return null;
81
+ const nestLabel = payload.length === 1 && indicator !== "dot";
82
+ return /* @__PURE__ */ jsxs("div", {
83
+ className: cn("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className),
84
+ children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
85
+ className: "grid gap-1.5",
86
+ children: payload.filter((item) => item.type !== "none").map((item, index) => {
87
+ const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
88
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
89
+ const indicatorColor = color ?? item.payload?.fill ?? item.color;
90
+ return /* @__PURE__ */ jsx("div", {
91
+ className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"),
92
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
93
+ className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
94
+ "h-2.5 w-2.5": indicator === "dot",
95
+ "w-1": indicator === "line",
96
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
97
+ "my-0.5": nestLabel && indicator === "dashed"
98
+ }),
99
+ style: {
100
+ "--color-bg": indicatorColor,
101
+ "--color-border": indicatorColor
102
+ }
103
+ }), /* @__PURE__ */ jsxs("div", {
104
+ className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
105
+ children: [/* @__PURE__ */ jsxs("div", {
106
+ className: "grid gap-1.5",
107
+ children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
108
+ className: "text-muted-foreground",
109
+ children: itemConfig?.label ?? item.name
110
+ })]
111
+ }), item.value != null && /* @__PURE__ */ jsx("span", {
112
+ className: "font-mono font-medium text-foreground tabular-nums",
113
+ children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value)
114
+ })]
115
+ })] })
116
+ }, index);
117
+ })
118
+ })]
119
+ });
120
+ }
121
+ const ChartLegend = RechartsPrimitive.Legend;
122
+ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }) {
123
+ const { config } = useChart();
124
+ if (!payload?.length) return null;
125
+ return /* @__PURE__ */ jsx("div", {
126
+ className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
127
+ children: payload.filter((item) => item.type !== "none").map((item, index) => {
128
+ const key = `${nameKey ?? item.dataKey ?? "value"}`;
129
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
130
+ return /* @__PURE__ */ jsxs("div", {
131
+ className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
132
+ children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
133
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
134
+ style: { backgroundColor: item.color }
135
+ }), itemConfig?.label]
136
+ }, index);
137
+ })
138
+ });
139
+ }
140
+ function getPayloadConfigFromPayload(config, payload, key) {
141
+ if (typeof payload !== "object" || payload === null) return;
142
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
143
+ let configLabelKey = key;
144
+ if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
145
+ else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
146
+ return configLabelKey in config ? config[configLabelKey] : config[key];
147
+ }
148
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Checkbox as Checkbox$1 } from "radix-ui";
3
+ declare function Checkbox({ className, ...props }: React.ComponentProps<typeof Checkbox$1.Root>): React.JSX.Element;
4
+ export { Checkbox };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { CheckIcon } from "lucide-react";
5
+ import { Checkbox as Checkbox$1 } from "radix-ui";
6
+ // src/components/ui/checkbox.tsx
7
+ function Checkbox({ className, ...props }) {
8
+ return /* @__PURE__ */ jsx(Checkbox$1.Root, {
9
+ "data-slot": "checkbox",
10
+ className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", className),
11
+ ...props,
12
+ children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
13
+ "data-slot": "checkbox-indicator",
14
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
15
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
16
+ })
17
+ });
18
+ }
19
+ export { Checkbox };
@@ -0,0 +1,26 @@
1
+ import { Button } from "./button.js";
2
+ import * as React from "react";
3
+ import { VariantProps } from "class-variance-authority";
4
+ declare const codeBlockVariants: (props?: ({
5
+ variant?: "default" | "destructive" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function CodeBlock({ className, variant, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof codeBlockVariants> & {
8
+ size?: "default" | "sm";
9
+ }): React.JSX.Element;
10
+ declare function CodeBlockHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function CodeBlockTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function CodeBlockActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function CodeBlockCopyButton({ value, variant, size, type, className, onClick, ...props }: React.ComponentProps<typeof Button> & {
14
+ value: string;
15
+ }): React.JSX.Element;
16
+ declare function CodeBlockContent({ className, children, style, wrap, lineNumbers, startLine, ...props }: React.ComponentProps<"pre"> & {
17
+ wrap?: boolean;
18
+ lineNumbers?: boolean;
19
+ startLine?: number;
20
+ }): React.JSX.Element;
21
+ declare const codeBlockLineVariants: (props?: ({
22
+ variant?: "added" | "default" | "highlighted" | "removed" | null | undefined;
23
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
+ declare function CodeBlockLine({ className, variant, children, ...props }: React.ComponentProps<"span"> & VariantProps<typeof codeBlockLineVariants>): React.JSX.Element;
25
+ declare function CodeBlockFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
26
+ export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };