@locusgraph/components 0.0.0-stage → 0.1.1

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/LICENSE +21 -0
  2. package/README.md +51 -2
  3. package/dist/action/button-group.d.ts +11 -0
  4. package/dist/action/button-group.js +27 -0
  5. package/dist/action/button.d.ts +10 -0
  6. package/dist/action/button.js +35 -0
  7. package/dist/action/toggle-group.d.ts +9 -0
  8. package/dist/action/toggle-group.js +22 -0
  9. package/dist/action/toggle.d.ts +9 -0
  10. package/dist/action/toggle.js +26 -0
  11. package/dist/display/avatar.d.ts +6 -0
  12. package/dist/display/avatar.js +14 -0
  13. package/dist/display/badge.d.ts +9 -0
  14. package/dist/display/badge.js +24 -0
  15. package/dist/display/chart/chart-container.d.ts +43 -0
  16. package/dist/display/chart/chart-container.js +59 -0
  17. package/dist/display/chart/chart-legend.d.ts +8 -0
  18. package/dist/display/chart/chart-legend.js +22 -0
  19. package/dist/display/chart/chart-tooltip.d.ts +13 -0
  20. package/dist/display/chart/chart-tooltip.js +49 -0
  21. package/dist/display/chat/attachment/attachment-parts.d.ts +10 -0
  22. package/dist/display/chat/attachment/attachment-parts.js +21 -0
  23. package/dist/display/chat/attachment/attachment.d.ts +16 -0
  24. package/dist/display/chat/attachment/attachment.js +40 -0
  25. package/dist/display/chat/bubble.d.ts +17 -0
  26. package/dist/display/chat/bubble.js +50 -0
  27. package/dist/display/chat/marker.d.ts +11 -0
  28. package/dist/display/chat/marker.js +24 -0
  29. package/dist/display/chat/message-scroller.d.ts +10 -0
  30. package/dist/display/chat/message-scroller.js +25 -0
  31. package/dist/display/chat/message.d.ts +10 -0
  32. package/dist/display/chat/message.js +21 -0
  33. package/dist/display/content/item.d.ts +23 -0
  34. package/dist/display/content/item.js +66 -0
  35. package/dist/display/content/kbd.d.ts +3 -0
  36. package/dist/display/content/kbd.js +9 -0
  37. package/dist/display/media/aspect-ratio.d.ts +3 -0
  38. package/dist/display/media/aspect-ratio.js +7 -0
  39. package/dist/display/media/carousel-controls.d.ts +5 -0
  40. package/dist/display/media/carousel-controls.js +19 -0
  41. package/dist/display/media/carousel.d.ts +25 -0
  42. package/dist/display/media/carousel.js +77 -0
  43. package/dist/display/rule-grid/rule-grid.d.ts +14 -0
  44. package/dist/display/rule-grid/rule-grid.js +35 -0
  45. package/dist/display/separator.d.ts +4 -0
  46. package/dist/display/separator.js +8 -0
  47. package/dist/display/status/alert.d.ts +9 -0
  48. package/dist/display/status/alert.js +24 -0
  49. package/dist/display/status/empty.d.ts +11 -0
  50. package/dist/display/status/empty.js +33 -0
  51. package/dist/display/status/progress.d.ts +4 -0
  52. package/dist/display/status/progress.js +8 -0
  53. package/dist/display/status/skeleton.d.ts +2 -0
  54. package/dist/display/status/skeleton.js +6 -0
  55. package/dist/display/status/spinner.d.ts +2 -0
  56. package/dist/display/status/spinner.js +7 -0
  57. package/dist/display/table.d.ts +10 -0
  58. package/dist/display/table.js +27 -0
  59. package/dist/feedback/toaster.d.ts +5 -0
  60. package/dist/feedback/toaster.js +32 -0
  61. package/dist/form/advanced/calendar-day-button.d.ts +4 -0
  62. package/dist/form/advanced/calendar-day-button.js +19 -0
  63. package/dist/form/advanced/calendar.d.ts +7 -0
  64. package/dist/form/advanced/calendar.js +64 -0
  65. package/dist/form/advanced/combobox/combobox-chips.d.ts +9 -0
  66. package/dist/form/advanced/combobox/combobox-chips.js +20 -0
  67. package/dist/form/advanced/combobox/combobox-items.d.ts +8 -0
  68. package/dist/form/advanced/combobox/combobox-items.js +24 -0
  69. package/dist/form/advanced/combobox/combobox.d.ts +11 -0
  70. package/dist/form/advanced/combobox/combobox.js +26 -0
  71. package/dist/form/advanced/input-otp.d.ts +11 -0
  72. package/dist/form/advanced/input-otp.js +21 -0
  73. package/dist/form/choice/checkbox.d.ts +4 -0
  74. package/dist/form/choice/checkbox.js +9 -0
  75. package/dist/form/choice/radio-group.d.ts +5 -0
  76. package/dist/form/choice/radio-group.js +12 -0
  77. package/dist/form/choice/select.d.ts +15 -0
  78. package/dist/form/choice/select.js +38 -0
  79. package/dist/form/choice/slider.d.ts +4 -0
  80. package/dist/form/choice/slider.js +10 -0
  81. package/dist/form/choice/switch.d.ts +4 -0
  82. package/dist/form/choice/switch.js +8 -0
  83. package/dist/form/field/field-error.d.ts +8 -0
  84. package/dist/form/field/field-error.js +20 -0
  85. package/dist/form/field/field-separator.d.ts +3 -0
  86. package/dist/form/field/field-separator.js +7 -0
  87. package/dist/form/field/field-set.d.ts +6 -0
  88. package/dist/form/field/field-set.js +9 -0
  89. package/dist/form/field/field-text.d.ts +6 -0
  90. package/dist/form/field/field-text.js +13 -0
  91. package/dist/form/field/field.d.ts +9 -0
  92. package/dist/form/field/field.js +33 -0
  93. package/dist/form/hook-form/form.d.ts +24 -0
  94. package/dist/form/hook-form/form.js +57 -0
  95. package/dist/form/input-group.d.ts +16 -0
  96. package/dist/form/input-group.js +65 -0
  97. package/dist/form/input.d.ts +3 -0
  98. package/dist/form/input.js +6 -0
  99. package/dist/form/label.d.ts +4 -0
  100. package/dist/form/label.js +8 -0
  101. package/dist/form/native-select.d.ts +7 -0
  102. package/dist/form/native-select.js +13 -0
  103. package/dist/form/textarea.d.ts +3 -0
  104. package/dist/form/textarea.js +6 -0
  105. package/dist/index.d.ts +96 -0
  106. package/dist/index.js +95 -0
  107. package/dist/layout/accordion.d.ts +7 -0
  108. package/dist/layout/accordion.js +18 -0
  109. package/dist/layout/collapsible.d.ts +5 -0
  110. package/dist/layout/collapsible.js +13 -0
  111. package/dist/layout/resizable.d.ts +7 -0
  112. package/dist/layout/resizable.js +15 -0
  113. package/dist/layout/scroll/direction.d.ts +7 -0
  114. package/dist/layout/scroll/direction.js +8 -0
  115. package/dist/layout/scroll/scroll-area.d.ts +5 -0
  116. package/dist/layout/scroll/scroll-area.js +11 -0
  117. package/dist/layout/sidebar/sidebar-context.d.ts +19 -0
  118. package/dist/layout/sidebar/sidebar-context.js +72 -0
  119. package/dist/layout/sidebar/sidebar-menu-sub.d.ts +12 -0
  120. package/dist/layout/sidebar/sidebar-menu-sub.js +26 -0
  121. package/dist/layout/sidebar/sidebar-menu.d.ts +20 -0
  122. package/dist/layout/sidebar/sidebar-menu.js +53 -0
  123. package/dist/layout/sidebar/sidebar-sections.d.ts +17 -0
  124. package/dist/layout/sidebar/sidebar-sections.js +37 -0
  125. package/dist/layout/sidebar/sidebar.d.ts +11 -0
  126. package/dist/layout/sidebar/sidebar.js +40 -0
  127. package/dist/layout/tabs.d.ts +11 -0
  128. package/dist/layout/tabs.js +30 -0
  129. package/dist/layout/use-mobile.d.ts +1 -0
  130. package/dist/layout/use-mobile.js +15 -0
  131. package/dist/navigation/breadcrumb.d.ts +11 -0
  132. package/dist/navigation/breadcrumb.js +27 -0
  133. package/dist/navigation/menubar/menubar-items.d.ts +15 -0
  134. package/dist/navigation/menubar/menubar-items.js +27 -0
  135. package/dist/navigation/menubar/menubar-sub.d.ts +8 -0
  136. package/dist/navigation/menubar/menubar-sub.js +15 -0
  137. package/dist/navigation/menubar/menubar.d.ts +9 -0
  138. package/dist/navigation/menubar/menubar.js +23 -0
  139. package/dist/navigation/navigation-menu.d.ts +14 -0
  140. package/dist/navigation/navigation-menu.js +31 -0
  141. package/dist/navigation/pagination.d.ts +13 -0
  142. package/dist/navigation/pagination.js +29 -0
  143. package/dist/overlay/alert-dialog.d.ts +18 -0
  144. package/dist/overlay/alert-dialog.js +42 -0
  145. package/dist/overlay/context-menu/context-menu-items.d.ts +15 -0
  146. package/dist/overlay/context-menu/context-menu-items.js +27 -0
  147. package/dist/overlay/context-menu/context-menu-sub.d.ts +8 -0
  148. package/dist/overlay/context-menu/context-menu-sub.js +15 -0
  149. package/dist/overlay/context-menu/context-menu.d.ts +8 -0
  150. package/dist/overlay/context-menu/context-menu.js +20 -0
  151. package/dist/overlay/dialog.d.ts +16 -0
  152. package/dist/overlay/dialog.js +40 -0
  153. package/dist/overlay/floating/command.d.ts +18 -0
  154. package/dist/overlay/floating/command.js +34 -0
  155. package/dist/overlay/floating/drawer.d.ts +13 -0
  156. package/dist/overlay/floating/drawer.js +35 -0
  157. package/dist/overlay/floating/hover-card.d.ts +6 -0
  158. package/dist/overlay/floating/hover-card.js +14 -0
  159. package/dist/overlay/menu/dropdown-menu-choice.d.ts +6 -0
  160. package/dist/overlay/menu/dropdown-menu-choice.js +15 -0
  161. package/dist/overlay/menu/dropdown-menu-item.d.ts +12 -0
  162. package/dist/overlay/menu/dropdown-menu-item.js +17 -0
  163. package/dist/overlay/menu/dropdown-menu-sub.d.ts +8 -0
  164. package/dist/overlay/menu/dropdown-menu-sub.js +15 -0
  165. package/dist/overlay/menu/dropdown-menu.d.ts +8 -0
  166. package/dist/overlay/menu/dropdown-menu.js +20 -0
  167. package/dist/overlay/popover.d.ts +6 -0
  168. package/dist/overlay/popover.js +14 -0
  169. package/dist/overlay/sheet.d.ts +14 -0
  170. package/dist/overlay/sheet.js +40 -0
  171. package/dist/overlay/tooltip.d.ts +7 -0
  172. package/dist/overlay/tooltip.js +17 -0
  173. package/dist/shell/app-header.d.ts +11 -0
  174. package/dist/shell/app-header.js +10 -0
  175. package/dist/shell/app-shell.d.ts +10 -0
  176. package/dist/shell/app-shell.js +8 -0
  177. package/dist/shell/breadcrumbs.d.ts +12 -0
  178. package/dist/shell/breadcrumbs.js +18 -0
  179. package/dist/shell/docs/docs-header.d.ts +22 -0
  180. package/dist/shell/docs/docs-header.js +20 -0
  181. package/dist/shell/docs/docs-shell.d.ts +9 -0
  182. package/dist/shell/docs/docs-shell.js +7 -0
  183. package/dist/shell/docs/docs-sidebar.d.ts +17 -0
  184. package/dist/shell/docs/docs-sidebar.js +12 -0
  185. package/dist/shell/docs/on-this-page.d.ts +11 -0
  186. package/dist/shell/docs/on-this-page.js +12 -0
  187. package/dist/shell/docs/use-active-section.d.ts +2 -0
  188. package/dist/shell/docs/use-active-section.js +54 -0
  189. package/dist/shell/link.d.ts +4 -0
  190. package/dist/shell/link.js +1 -0
  191. package/dist/shell/navigation/app-sidebar.d.ts +19 -0
  192. package/dist/shell/navigation/app-sidebar.js +12 -0
  193. package/dist/shell/navigation/nav-group.d.ts +23 -0
  194. package/dist/shell/navigation/nav-group.js +17 -0
  195. package/dist/shell/theme-toggle.d.ts +7 -0
  196. package/dist/shell/theme-toggle.js +9 -0
  197. package/dist/styles/theme.css +4 -0
  198. package/package.json +65 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LocusGraph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @locusgraph/components
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The LocusGraph design system: React components on Radix, the App and Docs shells, and the theme
4
+ (`theme.css`) every LocusGraph app uses. See every component with a live playground in
5
+ `apps/design` (`pnpm --filter @locusgraph/design dev`, port 5180).
6
+
7
+ ## Use it in an app
8
+
9
+ Needs React 19 and Tailwind CSS 4.
10
+
11
+ ```bash
12
+ pnpm add @locusgraph/components
13
+ ```
14
+
15
+ In the app's main stylesheet, after Tailwind:
16
+
17
+ ```css
18
+ @import "tailwindcss";
19
+ @import "@locusgraph/components/theme.css";
20
+ ```
21
+
22
+ The theme brings the fonts, the colour tokens (light and dark), and tells Tailwind to scan this
23
+ package, so the classes the components use are generated in your app. Then:
24
+
25
+ ```tsx
26
+ import { Button, AppShell, AppSidebar, AppHeader } from "@locusgraph/components";
27
+ ```
28
+
29
+ Moving an app from its own shadcn copies: replace `@/components/ui/<name>` imports with
30
+ `@locusgraph/components` one component at a time, and delete the local copy once nothing imports
31
+ it. Keep app-specific components in the app; move one here only when a second app needs it.
32
+
33
+ ## Change it
34
+
35
+ Fix or improve a component in this repo, never in a copy inside an app, so every app gets the change.
36
+
37
+ 1. Change the component in `src/`, its demo in `apps/design/src/demos/`, and its test.
38
+ 2. `pnpm --filter @locusgraph/components typecheck && pnpm --filter @locusgraph/components test`.
39
+ 3. Bump `version` in this `package.json` (semver: a fix is a patch, a new component or prop a
40
+ minor, a removed or renamed export, prop or token a major; while the version is 0.x, a
41
+ breaking change is a minor).
42
+ 4. Merge, then push the tag `components-v<version>`. The `publish-components` workflow tests,
43
+ builds and publishes to npm.
44
+
45
+ ## Update an app to a new version
46
+
47
+ ```bash
48
+ pnpm up @locusgraph/components
49
+ ```
50
+
51
+ A patch or minor release needs no change in the app. Read the release's commits before a major
52
+ (or a 0.x minor), and check the app's pages after updating.
@@ -0,0 +1,11 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { Separator } from "../display/separator.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.Element;
7
+ declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
8
+ asChild?: boolean;
9
+ }): import("react").JSX.Element;
10
+ declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
11
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import * as Slot from "radix-ui/slot";
5
+ import { Separator } from "../display/separator.js";
6
+ const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
7
+ variants: {
8
+ orientation: {
9
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
10
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ orientation: "horizontal",
15
+ },
16
+ });
17
+ function ButtonGroup({ className, orientation, ...props }) {
18
+ return (_jsx("div", { role: "group", "data-slot": "button-group", "data-orientation": orientation, className: cn(buttonGroupVariants({ orientation }), className), ...props }));
19
+ }
20
+ function ButtonGroupText({ className, asChild = false, ...props }) {
21
+ const Comp = asChild ? Slot.Root : "div";
22
+ return (_jsx(Comp, { className: cn("flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
23
+ }
24
+ function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
25
+ return (_jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("relative m-0! self-stretch bg-input data-[orientation=vertical]:h-auto", className), ...props }));
26
+ }
27
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
@@ -0,0 +1,10 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
5
+ size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | 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
+ }): React.JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import * as Slot from "radix-ui/slot";
5
+ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-full text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] duration-150 ease-out outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground shadow-[0_1px_2px_rgb(0_0_0/0.12),inset_0_1px_0_rgb(255_255_255/0.14)] hover:bg-primary/90",
9
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
10
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
11
+ secondary: "bg-secondary text-secondary-foreground 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
+ xs: "h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
18
+ sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
19
+ lg: "h-10 px-6 has-[>svg]:px-4",
20
+ icon: "size-9",
21
+ "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
22
+ "icon-sm": "size-8",
23
+ "icon-lg": "size-10",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default",
29
+ },
30
+ });
31
+ function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
32
+ const Comp = asChild ? Slot.Root : "button";
33
+ return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
34
+ }
35
+ export { Button, buttonVariants };
@@ -0,0 +1,9 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as ToggleGroupPrimitive from "radix-ui/toggle-group";
3
+ import * as React from "react";
4
+ import { toggleVariants } from "./toggle.js";
5
+ declare function ToggleGroup({ className, variant, size, spacing, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
6
+ spacing?: number;
7
+ }): React.JSX.Element;
8
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
9
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "cn";
4
+ import * as ToggleGroupPrimitive from "radix-ui/toggle-group";
5
+ import * as React from "react";
6
+ import { toggleVariants } from "./toggle.js";
7
+ const ToggleGroupContext = React.createContext({
8
+ size: "default",
9
+ variant: "default",
10
+ spacing: 0,
11
+ });
12
+ function ToggleGroup({ className, variant, size, spacing = 0, children, ...props }) {
13
+ return (_jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, style: { "--gap": spacing }, className: cn("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs", className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children: children }) }));
14
+ }
15
+ function ToggleGroupItem({ className, children, variant, size, ...props }) {
16
+ const context = React.useContext(ToggleGroupContext);
17
+ return (_jsx(ToggleGroupPrimitive.Item, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, "data-spacing": context.spacing, className: cn(toggleVariants({
18
+ variant: context.variant || variant,
19
+ size: context.size || size,
20
+ }), "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10", "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l", className), ...props, children: children }));
21
+ }
22
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,9 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as TogglePrimitive from "radix-ui/toggle";
3
+ import * as React from "react";
4
+ declare const toggleVariants: (props?: ({
5
+ variant?: "default" | "outline" | null | undefined;
6
+ size?: "default" | "lg" | "sm" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): React.JSX.Element;
9
+ export { Toggle, toggleVariants };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "cn";
5
+ import * as TogglePrimitive from "radix-ui/toggle";
6
+ const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-transparent",
10
+ outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
11
+ },
12
+ size: {
13
+ default: "h-9 min-w-9 px-2",
14
+ sm: "h-8 min-w-8 px-1.5",
15
+ lg: "h-10 min-w-10 px-2.5",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ variant: "default",
20
+ size: "default",
21
+ },
22
+ });
23
+ function Toggle({ className, variant, size, ...props }) {
24
+ return (_jsx(TogglePrimitive.Root, { "data-slot": "toggle", className: cn(toggleVariants({ variant, size, className })), ...props }));
25
+ }
26
+ export { Toggle, toggleVariants };
@@ -0,0 +1,6 @@
1
+ import * as AvatarPrimitive from "radix-ui/avatar";
2
+ import * as React from "react";
3
+ declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): React.JSX.Element;
4
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
5
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
6
+ export { Avatar, AvatarFallback, AvatarImage };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "cn";
4
+ import * as AvatarPrimitive from "radix-ui/avatar";
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("flex size-full items-center justify-center rounded-full bg-ghost text-xs font-medium uppercase", className), ...props }));
13
+ }
14
+ export { Avatar, AvatarFallback, AvatarImage };
@@ -0,0 +1,9 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "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
+ }): React.JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import * as Slot from "radix-ui/slot";
5
+ const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
9
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
10
+ destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
11
+ outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
12
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
13
+ link: "text-primary underline-offset-4 [a&]:hover:underline",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ });
20
+ function Badge({ className, variant = "default", asChild = false, ...props }) {
21
+ const Comp = asChild ? Slot.Root : "span";
22
+ return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
23
+ }
24
+ export { Badge, badgeVariants };
@@ -0,0 +1,43 @@
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 = Record<string, {
8
+ label?: React.ReactNode;
9
+ icon?: React.ComponentType;
10
+ } & ({
11
+ color?: string;
12
+ theme?: never;
13
+ } | {
14
+ color?: never;
15
+ theme: Record<keyof typeof THEMES, string>;
16
+ })>;
17
+ type ChartContextProps = {
18
+ config: ChartConfig;
19
+ };
20
+ declare function useChart(): ChartContextProps;
21
+ declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
22
+ config: ChartConfig;
23
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
24
+ initialDimension?: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ }): React.JSX.Element;
29
+ declare const ChartStyle: ({ id, config }: {
30
+ id: string;
31
+ config: ChartConfig;
32
+ }) => React.JSX.Element | null;
33
+ declare function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ({
34
+ label?: React.ReactNode;
35
+ icon?: React.ComponentType;
36
+ } & ({
37
+ color?: string;
38
+ theme?: never;
39
+ } | {
40
+ color?: never;
41
+ theme: Record<keyof typeof THEMES, string>;
42
+ })) | undefined;
43
+ export { ChartContainer, ChartStyle, getPayloadConfigFromPayload, useChart };
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "cn";
4
+ import * as React from "react";
5
+ import * as RechartsPrimitive from "recharts";
6
+ const THEMES = { light: "", dark: ".dark" };
7
+ const INITIAL_DIMENSION = { width: 320, height: 200 };
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, initialDimension = INITIAL_DIMENSION, ...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("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), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { initialDimension: initialDimension, 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
+ function getPayloadConfigFromPayload(config, payload, key) {
42
+ if (typeof payload !== "object" || payload === null) {
43
+ return undefined;
44
+ }
45
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null
46
+ ? payload.payload
47
+ : undefined;
48
+ let configLabelKey = key;
49
+ if (key in payload && typeof payload[key] === "string") {
50
+ configLabelKey = payload[key];
51
+ }
52
+ else if (payloadPayload &&
53
+ key in payloadPayload &&
54
+ typeof payloadPayload[key] === "string") {
55
+ configLabelKey = payloadPayload[key];
56
+ }
57
+ return configLabelKey in config ? config[configLabelKey] : config[key];
58
+ }
59
+ export { ChartContainer, ChartStyle, getPayloadConfigFromPayload, useChart };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import * as RechartsPrimitive from "recharts";
3
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
4
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
5
+ hideIcon?: boolean;
6
+ nameKey?: string;
7
+ } & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
8
+ export { ChartLegend, ChartLegendContent };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "cn";
4
+ import * as RechartsPrimitive from "recharts";
5
+ import { getPayloadConfigFromPayload, useChart } from "./chart-container.js";
6
+ const ChartLegend = RechartsPrimitive.Legend;
7
+ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
8
+ const { config } = useChart();
9
+ if (!payload?.length) {
10
+ return null;
11
+ }
12
+ return (_jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload
13
+ .filter((item) => item.type !== "none")
14
+ .map((item) => {
15
+ const key = `${nameKey ?? item.dataKey ?? "value"}`;
16
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
17
+ return (_jsxs("div", { className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
18
+ backgroundColor: item.color,
19
+ } })), itemConfig?.label] }, key));
20
+ }) }));
21
+ }
22
+ export { ChartLegend, ChartLegendContent };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import type { TooltipValueType } from "recharts";
3
+ import * as RechartsPrimitive from "recharts";
4
+ type TooltipNameType = number | string;
5
+ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
6
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
7
+ hideLabel?: boolean;
8
+ hideIndicator?: boolean;
9
+ indicator?: "line" | "dot" | "dashed";
10
+ nameKey?: string;
11
+ labelKey?: string;
12
+ } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
13
+ export { ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "cn";
4
+ import * as React from "react";
5
+ import * as RechartsPrimitive from "recharts";
6
+ import { getPayloadConfigFromPayload, useChart } from "./chart-container.js";
7
+ const ChartTooltip = RechartsPrimitive.Tooltip;
8
+ function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
9
+ const { config } = useChart();
10
+ const tooltipLabel = React.useMemo(() => {
11
+ if (hideLabel || !payload?.length) {
12
+ return null;
13
+ }
14
+ const [item] = payload;
15
+ const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
16
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
17
+ const value = !labelKey && typeof label === "string" ? (config[label]?.label ?? label) : itemConfig?.label;
18
+ if (labelFormatter) {
19
+ return (_jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) }));
20
+ }
21
+ if (!value) {
22
+ return null;
23
+ }
24
+ return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
25
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
26
+ if (!active || !payload?.length) {
27
+ return null;
28
+ }
29
+ const nestLabel = payload.length === 1 && indicator !== "dot";
30
+ return (_jsxs("div", { className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
31
+ .filter((item) => item.type !== "none")
32
+ .map((item, index) => {
33
+ const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
34
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
35
+ const indicatorColor = color ?? item.payload?.fill ?? item.color;
36
+ return (_jsx("div", { 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"), 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)", {
37
+ "h-2.5 w-2.5": indicator === "dot",
38
+ "w-1": indicator === "line",
39
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
40
+ "my-0.5": nestLabel && indicator === "dashed",
41
+ }), style: {
42
+ "--color-bg": indicatorColor,
43
+ "--color-border": indicatorColor,
44
+ } }))), _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 != null && (_jsx("span", { className: "font-mono font-medium text-foreground tabular-nums", children: typeof item.value === "number"
45
+ ? item.value.toLocaleString()
46
+ : String(item.value) }))] })] })) }, key));
47
+ }) })] }));
48
+ }
49
+ export { ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { Button } from "../../../action/button.js";
3
+ declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
4
+ declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
5
+ declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
7
+ declare function AttachmentTrigger({ className, asChild, type, ...props }: React.ComponentProps<"button"> & {
8
+ asChild?: boolean;
9
+ }): React.JSX.Element;
10
+ export { AttachmentAction, AttachmentActions, AttachmentDescription, AttachmentTitle, AttachmentTrigger, };
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "cn";
3
+ import * as Slot from "radix-ui/slot";
4
+ import { Button } from "../../../action/button.js";
5
+ function AttachmentTitle({ className, ...props }) {
6
+ return (_jsx("span", { "data-slot": "attachment-title", className: cn("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer", className), ...props }));
7
+ }
8
+ function AttachmentDescription({ className, ...props }) {
9
+ return (_jsx("span", { "data-slot": "attachment-description", className: cn("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", "max-w-full", className), ...props }));
10
+ }
11
+ function AttachmentActions({ className, ...props }) {
12
+ return (_jsx("div", { "data-slot": "attachment-actions", className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", className), ...props }));
13
+ }
14
+ function AttachmentAction({ className, variant, size = "icon-xs", ...props }) {
15
+ return (_jsx(Button, { "data-slot": "attachment-action", variant: variant ?? "ghost", size: size, className: cn(className), ...props }));
16
+ }
17
+ function AttachmentTrigger({ className, asChild = false, type, ...props }) {
18
+ const Comp = asChild ? Slot.Root : "button";
19
+ return (_jsx(Comp, { "data-slot": "attachment-trigger", type: asChild ? undefined : (type ?? "button"), className: cn("absolute inset-0 z-10 outline-none", className), ...props }));
20
+ }
21
+ export { AttachmentAction, AttachmentActions, AttachmentDescription, AttachmentTitle, AttachmentTrigger, };
@@ -0,0 +1,16 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const attachmentVariants: (props?: ({
4
+ size?: "default" | "sm" | "xs" | null | undefined;
5
+ orientation?: "horizontal" | "vertical" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
8
+ state?: "idle" | "uploading" | "processing" | "error" | "done";
9
+ }): React.JSX.Element;
10
+ declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare const attachmentMediaVariants: (props?: ({
12
+ variant?: "icon" | "image" | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
+ declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React.JSX.Element;
15
+ declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
16
+ export { Attachment, AttachmentContent, AttachmentGroup, AttachmentMedia };
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
5
+ variants: {
6
+ size: {
7
+ default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
8
+ sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
9
+ xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1",
10
+ },
11
+ orientation: {
12
+ horizontal: "min-w-40 items-center",
13
+ vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30",
14
+ },
15
+ },
16
+ });
17
+ function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
18
+ return (_jsx("div", { "data-slot": "attachment", "data-state": state, "data-size": size, "data-orientation": orientation, className: cn(attachmentVariants({ size, orientation }), className), ...props }));
19
+ }
20
+ function AttachmentGroup({ className, ...props }) {
21
+ return (_jsx("div", { "data-slot": "attachment-group", className: cn("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className), ...props }));
22
+ }
23
+ const attachmentMediaVariants = cva("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
24
+ variants: {
25
+ variant: {
26
+ icon: "",
27
+ image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover",
28
+ },
29
+ },
30
+ defaultVariants: {
31
+ variant: "icon",
32
+ },
33
+ });
34
+ function AttachmentMedia({ className, variant = "icon", ...props }) {
35
+ return (_jsx("div", { "data-slot": "attachment-media", "data-variant": variant, className: cn(attachmentMediaVariants({ variant }), className), ...props }));
36
+ }
37
+ function AttachmentContent({ className, ...props }) {
38
+ return (_jsx("div", { "data-slot": "attachment-content", className: cn("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className), ...props }));
39
+ }
40
+ export { Attachment, AttachmentContent, AttachmentGroup, AttachmentMedia };
@@ -0,0 +1,17 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
4
+ declare const bubbleVariants: (props?: ({
5
+ variant?: "default" | "destructive" | "ghost" | "muted" | "outline" | "secondary" | "tinted" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
8
+ align?: "start" | "end";
9
+ }): React.JSX.Element;
10
+ declare function BubbleContent({ asChild, className, ...props }: React.ComponentProps<"div"> & {
11
+ asChild?: boolean;
12
+ }): React.JSX.Element;
13
+ declare function BubbleReactions({ side, align, className, ...props }: React.ComponentProps<"div"> & {
14
+ align?: "start" | "end";
15
+ side?: "top" | "bottom";
16
+ }): React.JSX.Element;
17
+ export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };