@elizaos/ui 2.0.0-alpha.73 → 2.0.0-alpha.76

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 (171) hide show
  1. package/components/ui/badge.d.ts +10 -0
  2. package/components/ui/badge.d.ts.map +1 -0
  3. package/components/ui/badge.js +20 -0
  4. package/components/ui/banner.d.ts +18 -0
  5. package/components/ui/banner.d.ts.map +1 -0
  6. package/components/ui/banner.js +27 -0
  7. package/components/ui/button.d.ts +12 -0
  8. package/components/ui/button.d.ts.map +1 -0
  9. package/components/ui/button.js +37 -0
  10. package/components/ui/card.d.ts +9 -0
  11. package/components/ui/card.d.ts.map +1 -0
  12. package/components/ui/card.js +16 -0
  13. package/components/ui/chat-atoms.d.ts +26 -0
  14. package/components/ui/chat-atoms.d.ts.map +1 -0
  15. package/components/ui/chat-atoms.js +17 -0
  16. package/components/ui/checkbox.d.ts +5 -0
  17. package/components/ui/checkbox.d.ts.map +1 -0
  18. package/components/ui/checkbox.js +8 -0
  19. package/components/ui/confirm-delete.d.ts +12 -0
  20. package/components/ui/confirm-delete.d.ts.map +1 -0
  21. package/components/ui/confirm-delete.js +13 -0
  22. package/components/ui/confirm-dialog.d.ts +24 -0
  23. package/components/ui/confirm-dialog.d.ts.map +1 -0
  24. package/components/ui/confirm-dialog.js +55 -0
  25. package/components/ui/connection-status.d.ts +9 -0
  26. package/components/ui/connection-status.d.ts.map +1 -0
  27. package/components/ui/connection-status.js +25 -0
  28. package/components/ui/copy-button.d.ts +13 -0
  29. package/components/ui/copy-button.d.ts.map +1 -0
  30. package/components/ui/copy-button.js +14 -0
  31. package/components/ui/dialog.d.ts +20 -0
  32. package/components/ui/dialog.d.ts.map +1 -0
  33. package/components/ui/dialog.js +22 -0
  34. package/components/ui/dropdown-menu.d.ts +28 -0
  35. package/components/ui/dropdown-menu.d.ts.map +1 -0
  36. package/components/ui/dropdown-menu.js +35 -0
  37. package/components/ui/empty-state.d.ts +13 -0
  38. package/components/ui/empty-state.d.ts.map +1 -0
  39. package/components/ui/empty-state.js +5 -0
  40. package/components/ui/error-boundary.d.ts +18 -0
  41. package/components/ui/error-boundary.d.ts.map +1 -0
  42. package/components/ui/error-boundary.js +27 -0
  43. package/components/ui/grid.d.ts +11 -0
  44. package/components/ui/grid.d.ts.map +1 -0
  45. package/components/ui/grid.js +30 -0
  46. package/components/ui/input.d.ts +6 -0
  47. package/components/ui/input.d.ts.map +1 -0
  48. package/components/ui/input.js +8 -0
  49. package/components/ui/label.d.ts +6 -0
  50. package/components/ui/label.d.ts.map +1 -0
  51. package/components/ui/label.js +9 -0
  52. package/components/ui/popover.d.ts +7 -0
  53. package/components/ui/popover.d.ts.map +1 -0
  54. package/components/ui/popover.js +9 -0
  55. package/components/ui/save-footer.d.ts +13 -0
  56. package/components/ui/save-footer.d.ts.map +1 -0
  57. package/components/ui/save-footer.js +9 -0
  58. package/components/ui/search-bar.d.ts +17 -0
  59. package/components/ui/search-bar.d.ts.map +1 -0
  60. package/components/ui/search-bar.js +19 -0
  61. package/components/ui/search-input.d.ts +11 -0
  62. package/components/ui/search-input.d.ts.map +1 -0
  63. package/components/ui/search-input.js +9 -0
  64. package/components/ui/section-card.d.ts +15 -0
  65. package/components/ui/section-card.d.ts.map +1 -0
  66. package/components/ui/section-card.js +9 -0
  67. package/components/ui/select.d.ts +14 -0
  68. package/components/ui/select.d.ts.map +1 -0
  69. package/components/ui/select.js +26 -0
  70. package/components/ui/separator.d.ts +5 -0
  71. package/components/ui/separator.d.ts.map +1 -0
  72. package/components/ui/separator.js +7 -0
  73. package/components/ui/skeleton.d.ts +17 -0
  74. package/components/ui/skeleton.d.ts.map +1 -0
  75. package/components/ui/skeleton.js +25 -0
  76. package/components/ui/slider.d.ts +5 -0
  77. package/components/ui/slider.d.ts.map +1 -0
  78. package/components/ui/slider.js +7 -0
  79. package/components/ui/sonner.d.ts +5 -0
  80. package/components/ui/sonner.d.ts.map +1 -0
  81. package/components/ui/sonner.js +15 -0
  82. package/components/ui/spinner.d.ts +6 -0
  83. package/components/ui/spinner.d.ts.map +1 -0
  84. package/components/ui/spinner.js +8 -0
  85. package/components/ui/stack.d.ts +13 -0
  86. package/components/ui/stack.d.ts.map +1 -0
  87. package/components/ui/stack.js +39 -0
  88. package/components/ui/status-badge.d.ts +20 -0
  89. package/components/ui/status-badge.d.ts.map +1 -0
  90. package/components/ui/status-badge.js +41 -0
  91. package/components/ui/switch.d.ts +5 -0
  92. package/components/ui/switch.d.ts.map +1 -0
  93. package/components/ui/switch.js +7 -0
  94. package/components/ui/tabs.d.ts +8 -0
  95. package/components/ui/tabs.d.ts.map +1 -0
  96. package/components/ui/tabs.js +12 -0
  97. package/components/ui/tag-editor.d.ts +24 -0
  98. package/components/ui/tag-editor.d.ts.map +1 -0
  99. package/components/ui/tag-editor.js +32 -0
  100. package/components/ui/tag-input.d.ts +19 -0
  101. package/components/ui/tag-input.d.ts.map +1 -0
  102. package/components/ui/tag-input.js +28 -0
  103. package/components/ui/textarea.d.ts +6 -0
  104. package/components/ui/textarea.d.ts.map +1 -0
  105. package/components/ui/textarea.js +8 -0
  106. package/components/ui/themed-select.d.ts +27 -0
  107. package/components/ui/themed-select.d.ts.map +1 -0
  108. package/components/ui/themed-select.js +57 -0
  109. package/components/ui/tooltip-extended.d.ts +76 -0
  110. package/components/ui/tooltip-extended.d.ts.map +1 -0
  111. package/components/ui/tooltip-extended.js +128 -0
  112. package/components/ui/tooltip.d.ts +8 -0
  113. package/components/ui/tooltip.d.ts.map +1 -0
  114. package/components/ui/tooltip.js +10 -0
  115. package/components/ui/typography.d.ts +17 -0
  116. package/components/ui/typography.d.ts.map +1 -0
  117. package/components/ui/typography.js +44 -0
  118. package/index.d.ts +42 -0
  119. package/index.d.ts.map +1 -0
  120. package/{src/index.ts → index.js} +0 -1
  121. package/lib/button-styles.d.ts +12 -0
  122. package/lib/button-styles.d.ts.map +1 -0
  123. package/lib/button-styles.js +11 -0
  124. package/lib/utils.d.ts +6 -0
  125. package/lib/utils.d.ts.map +1 -0
  126. package/{src/lib/utils.ts → lib/utils.js} +3 -4
  127. package/package.json +16 -18
  128. package/README.md +0 -6
  129. package/src/components/ui/badge.tsx +0 -35
  130. package/src/components/ui/banner.tsx +0 -81
  131. package/src/components/ui/button.tsx +0 -56
  132. package/src/components/ui/card.tsx +0 -79
  133. package/src/components/ui/chat-atoms.tsx +0 -129
  134. package/src/components/ui/checkbox.tsx +0 -28
  135. package/src/components/ui/confirm-delete.tsx +0 -67
  136. package/src/components/ui/confirm-dialog.tsx +0 -142
  137. package/src/components/ui/connection-status.tsx +0 -54
  138. package/src/components/ui/copy-button.tsx +0 -60
  139. package/src/components/ui/dialog.tsx +0 -120
  140. package/src/components/ui/dropdown-menu.tsx +0 -198
  141. package/src/components/ui/empty-state.tsx +0 -42
  142. package/src/components/ui/error-boundary.tsx +0 -63
  143. package/src/components/ui/grid.tsx +0 -43
  144. package/src/components/ui/input.tsx +0 -25
  145. package/src/components/ui/label.tsx +0 -24
  146. package/src/components/ui/popover.tsx +0 -29
  147. package/src/components/ui/save-footer.tsx +0 -58
  148. package/src/components/ui/search-bar.tsx +0 -61
  149. package/src/components/ui/search-input.tsx +0 -56
  150. package/src/components/ui/section-card.tsx +0 -85
  151. package/src/components/ui/select.tsx +0 -158
  152. package/src/components/ui/separator.tsx +0 -29
  153. package/src/components/ui/skeleton.tsx +0 -115
  154. package/src/components/ui/slider.tsx +0 -26
  155. package/src/components/ui/sonner.tsx +0 -28
  156. package/src/components/ui/spinner.tsx +0 -21
  157. package/src/components/ui/stack.tsx +0 -55
  158. package/src/components/ui/status-badge.tsx +0 -128
  159. package/src/components/ui/switch.tsx +0 -27
  160. package/src/components/ui/tabs.tsx +0 -53
  161. package/src/components/ui/tag-editor.tsx +0 -111
  162. package/src/components/ui/tag-input.tsx +0 -108
  163. package/src/components/ui/textarea.tsx +0 -24
  164. package/src/components/ui/themed-select.tsx +0 -141
  165. package/src/components/ui/tooltip-extended.tsx +0 -340
  166. package/src/components/ui/tooltip.tsx +0 -28
  167. package/src/components/ui/typography.tsx +0 -74
  168. package/src/lib/button-styles.ts +0 -19
  169. package/tsconfig.build.json +0 -18
  170. package/tsconfig.json +0 -32
  171. /package/{src/styles → styles}/theme.css +0 -0
package/index.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ export * from "./components/ui/badge";
2
+ export * from "./components/ui/banner";
3
+ export * from "./components/ui/button";
4
+ export * from "./components/ui/card";
5
+ export * from "./components/ui/chat-atoms";
6
+ export * from "./components/ui/checkbox";
7
+ export * from "./components/ui/confirm-delete";
8
+ export * from "./components/ui/confirm-dialog";
9
+ export * from "./components/ui/connection-status";
10
+ export * from "./components/ui/copy-button";
11
+ export * from "./components/ui/dialog";
12
+ export * from "./components/ui/dropdown-menu";
13
+ export * from "./components/ui/empty-state";
14
+ export * from "./components/ui/error-boundary";
15
+ export * from "./components/ui/grid";
16
+ export * from "./components/ui/input";
17
+ export * from "./components/ui/label";
18
+ export * from "./components/ui/popover";
19
+ export * from "./components/ui/save-footer";
20
+ export * from "./components/ui/search-bar";
21
+ export * from "./components/ui/search-input";
22
+ export * from "./components/ui/section-card";
23
+ export * from "./components/ui/select";
24
+ export * from "./components/ui/separator";
25
+ export * from "./components/ui/skeleton";
26
+ export * from "./components/ui/slider";
27
+ export * from "./components/ui/sonner";
28
+ export * from "./components/ui/spinner";
29
+ export * from "./components/ui/stack";
30
+ export * from "./components/ui/status-badge";
31
+ export * from "./components/ui/switch";
32
+ export * from "./components/ui/tabs";
33
+ export * from "./components/ui/tag-editor";
34
+ export * from "./components/ui/tag-input";
35
+ export * from "./components/ui/textarea";
36
+ export * from "./components/ui/themed-select";
37
+ export * from "./components/ui/tooltip";
38
+ export * from "./components/ui/tooltip-extended";
39
+ export * from "./components/ui/typography";
40
+ export * from "./lib/button-styles";
41
+ export * from "./lib/utils";
42
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export * from "./components/ui/badge";
2
2
  export * from "./components/ui/banner";
3
-
4
3
  // Atoms
5
4
  export * from "./components/ui/button";
6
5
  // Molecules
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Shared button class strings for consistent styling across views.
3
+ *
4
+ * These CSS class strings complement the `Button` component for cases where
5
+ * a plain HTML `button` element is used or Tailwind class composition is
6
+ * preferred over the variant prop.
7
+ */
8
+ export declare const btnPrimary = "px-4 py-2 text-sm font-medium bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border border-[var(--accent)] cursor-pointer hover:opacity-90 transition-opacity disabled:opacity-40 disabled:cursor-default rounded-lg";
9
+ export declare const btnGhost = "px-3 py-1.5 text-xs bg-transparent text-[var(--muted)] border border-[var(--border)] cursor-pointer hover:text-[var(--txt)] hover:border-[var(--txt)] transition-colors disabled:opacity-40 disabled:cursor-default rounded-lg";
10
+ export declare const btnDanger = "px-3 py-1.5 text-xs bg-transparent text-[var(--danger,#e74c3c)] border border-[var(--danger,#e74c3c)] cursor-pointer hover:bg-[var(--danger,#e74c3c)] hover:text-white transition-colors disabled:opacity-40 disabled:cursor-default rounded-lg";
11
+ export declare const inputCls = "flex-1 px-3 py-2 text-sm bg-[var(--card)] border border-[var(--border)] text-[var(--txt)] focus:border-[var(--accent)] focus:outline-none transition-colors rounded-lg";
12
+ //# sourceMappingURL=button-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-styles.d.ts","sourceRoot":"","sources":["../../src/lib/button-styles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,UAAU,qOAC6M,CAAC;AAErO,eAAO,MAAM,QAAQ,mOAC6M,CAAC;AAEnO,eAAO,MAAM,SAAS,oPAC6N,CAAC;AAEpP,eAAO,MAAM,QAAQ,2KACqJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared button class strings for consistent styling across views.
3
+ *
4
+ * These CSS class strings complement the `Button` component for cases where
5
+ * a plain HTML `button` element is used or Tailwind class composition is
6
+ * preferred over the variant prop.
7
+ */
8
+ export const btnPrimary = "px-4 py-2 text-sm font-medium bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border border-[var(--accent)] cursor-pointer hover:opacity-90 transition-opacity disabled:opacity-40 disabled:cursor-default rounded-lg";
9
+ export const btnGhost = "px-3 py-1.5 text-xs bg-transparent text-[var(--muted)] border border-[var(--border)] cursor-pointer hover:text-[var(--txt)] hover:border-[var(--txt)] transition-colors disabled:opacity-40 disabled:cursor-default rounded-lg";
10
+ export const btnDanger = "px-3 py-1.5 text-xs bg-transparent text-[var(--danger,#e74c3c)] border border-[var(--danger,#e74c3c)] cursor-pointer hover:bg-[var(--danger,#e74c3c)] hover:text-white transition-colors disabled:opacity-40 disabled:cursor-default rounded-lg";
11
+ export const inputCls = "flex-1 px-3 py-2 text-sm bg-[var(--card)] border border-[var(--border)] text-[var(--txt)] focus:border-[var(--accent)] focus:outline-none transition-colors rounded-lg";
package/lib/utils.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { type ClassValue } from "clsx";
2
+ /**
3
+ * Utility function to merge tailwind classes with conditional class names.
4
+ */
5
+ export declare function cn(...inputs: ClassValue[]): string;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -1,9 +1,8 @@
1
- import { type ClassValue, clsx } from "clsx";
1
+ import { clsx } from "clsx";
2
2
  import { twMerge } from "tailwind-merge";
3
-
4
3
  /**
5
4
  * Utility function to merge tailwind classes with conditional class names.
6
5
  */
7
- export function cn(...inputs: ClassValue[]) {
8
- return twMerge(clsx(inputs));
6
+ export function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
9
8
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@elizaos/ui",
3
- "version": "2.0.0-alpha.73",
3
+ "version": "2.0.0-alpha.76",
4
4
  "description": "Reusable UI primitives and components for Milady applications.",
5
5
  "type": "module",
6
- "main": "src/index.ts",
6
+ "main": "./index.js",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/milady-ai/milady",
9
9
  "repository": {
@@ -17,14 +17,18 @@
17
17
  "react",
18
18
  "components"
19
19
  ],
20
- "scripts": {
21
- "clean": "rimraf dist",
22
- "build:dist": "rimraf dist && tsc -p tsconfig.build.json && node ../../scripts/copy-package-assets.mjs packages/ui src/styles && node ../../scripts/prepare-package-dist.mjs packages/ui",
23
- "pack:dry-run": "cd dist && npm pack --dry-run"
24
- },
25
20
  "exports": {
26
- ".": "./src/index.ts",
27
- "./utils": "./src/lib/utils.ts"
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "import": "./index.js",
24
+ "default": "./index.js"
25
+ },
26
+ "./utils": {
27
+ "types": "./lib/utils.d.ts",
28
+ "import": "./lib/utils.js",
29
+ "default": "./lib/utils.js"
30
+ },
31
+ "./package.json": "./package.json"
28
32
  },
29
33
  "peerDependencies": {
30
34
  "react": "^19.0.0",
@@ -51,14 +55,8 @@
51
55
  "tailwind-merge": "^2.6.0"
52
56
  },
53
57
  "publishConfig": {
54
- "access": "public"
55
- },
56
- "devDependencies": {
57
- "@tailwindcss/vite": "^4.2.1",
58
- "@types/react": "^19.0.0",
59
- "@types/react-dom": "^19.0.0",
60
- "tailwindcss": "^4.1.18",
61
- "typescript": "^5.9.3"
58
+ "access": "public",
59
+ "directory": "dist"
62
60
  },
63
- "gitHead": "036d15051d6c06cca03eb0f4e3c65a18801d8360"
61
+ "types": "./index.d.ts"
64
62
  }
package/README.md DELETED
@@ -1,6 +0,0 @@
1
- # @elizaos/ui
2
-
3
- Reusable React UI primitives for ElizaOS applications.
4
-
5
- This package contains shared buttons, inputs, dialogs, badges, layout helpers,
6
- and related component utilities used by app shells built on top of ElizaOS.
@@ -1,35 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import type * as React from "react";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const badgeVariants = cva(
7
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "border-transparent bg-primary text-primary-fg hover:bg-primary/80",
13
- secondary: "border-transparent bg-bg-accent text-txt hover:bg-bg-hover",
14
- destructive:
15
- "border-transparent bg-destructive text-destructive-fg hover:bg-destructive/80",
16
- outline: "text-txt border-border",
17
- },
18
- },
19
- defaultVariants: {
20
- variant: "default",
21
- },
22
- },
23
- );
24
-
25
- export interface BadgeProps
26
- extends React.HTMLAttributes<HTMLDivElement>,
27
- VariantProps<typeof badgeVariants> {}
28
-
29
- function Badge({ className, variant, ...props }: BadgeProps) {
30
- return (
31
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
32
- );
33
- }
34
-
35
- export { Badge, badgeVariants };
@@ -1,81 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { AlertTriangle, Info, X, XCircle } from "lucide-react";
3
- import * as React from "react";
4
- import { cn } from "../../lib/utils";
5
-
6
- const bannerVariants = cva(
7
- "flex items-center gap-3 border px-4 py-2.5 text-xs",
8
- {
9
- variants: {
10
- variant: {
11
- error: "border-destructive/30 bg-destructive/10 text-destructive",
12
- warning: "border-warn/30 bg-warn/10 text-warn",
13
- info: "border-accent/30 bg-accent/10 text-accent",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "info",
18
- },
19
- },
20
- );
21
-
22
- const ICONS: Record<string, React.ElementType> = {
23
- error: XCircle,
24
- warning: AlertTriangle,
25
- info: Info,
26
- };
27
-
28
- export interface BannerProps
29
- extends React.HTMLAttributes<HTMLDivElement>,
30
- VariantProps<typeof bannerVariants> {
31
- /** Optional action element (button, link) */
32
- action?: React.ReactNode;
33
- /** Show dismiss button */
34
- dismissible?: boolean;
35
- /** Called when dismiss is clicked */
36
- onDismiss?: () => void;
37
- /** Aria-label for dismiss button */
38
- dismissLabel?: string;
39
- }
40
-
41
- export const Banner = React.forwardRef<HTMLDivElement, BannerProps>(
42
- (
43
- {
44
- variant = "info",
45
- action,
46
- dismissible,
47
- onDismiss,
48
- dismissLabel = "Dismiss",
49
- className,
50
- children,
51
- ...props
52
- },
53
- ref,
54
- ) => {
55
- const Icon = ICONS[variant ?? "info"];
56
-
57
- return (
58
- <div
59
- ref={ref}
60
- className={cn(bannerVariants({ variant }), className)}
61
- role="alert"
62
- {...props}
63
- >
64
- <Icon className="h-4 w-4 shrink-0" />
65
- <span className="flex-1">{children}</span>
66
- {action}
67
- {dismissible && (
68
- <button
69
- type="button"
70
- onClick={onDismiss}
71
- className="rounded-sm p-0.5 opacity-70 hover:opacity-100 transition-opacity"
72
- aria-label={dismissLabel}
73
- >
74
- <X className="h-3.5 w-3.5" />
75
- </button>
76
- )}
77
- </div>
78
- );
79
- },
80
- );
81
- Banner.displayName = "Banner";
@@ -1,56 +0,0 @@
1
- import { Slot } from "@radix-ui/react-slot";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
- import * as React from "react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-bg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "bg-primary text-[var(--primary-foreground,#1a1f26)] hover:bg-primary/90 hover:text-[var(--primary-foreground,#1a1f26)]",
14
- destructive:
15
- "bg-destructive text-destructive-fg hover:bg-destructive/90",
16
- outline:
17
- "border border-input bg-bg hover:bg-bg-accent hover:text-accent-fg",
18
- secondary: "bg-secondary text-secondary-fg hover:bg-secondary/80",
19
- ghost: "hover:bg-bg-accent hover:text-accent-fg",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default: "h-10 px-4 py-2",
24
- sm: "h-9 rounded-md px-3 py-1.5",
25
- lg: "h-11 rounded-md px-8 py-2.5",
26
- icon: "h-10 w-10",
27
- },
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default",
32
- },
33
- },
34
- );
35
-
36
- export interface ButtonProps
37
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
- VariantProps<typeof buttonVariants> {
39
- asChild?: boolean;
40
- }
41
-
42
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
- ({ className, variant, size, asChild = false, ...props }, ref) => {
44
- const Comp = asChild ? Slot : "button";
45
- return (
46
- <Comp
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- ref={ref}
49
- {...props}
50
- />
51
- );
52
- },
53
- );
54
- Button.displayName = "Button";
55
-
56
- export { Button, buttonVariants };
@@ -1,79 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../../lib/utils";
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- "rounded-xl border border-border bg-card text-card-fg shadow-sm",
13
- className,
14
- )}
15
- {...props}
16
- />
17
- ));
18
- Card.displayName = "Card";
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn("flex flex-col space-y-1.5 p-6", className)}
27
- {...props}
28
- />
29
- ));
30
- CardHeader.displayName = "CardHeader";
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLParagraphElement,
34
- React.HTMLAttributes<HTMLHeadingElement>
35
- >(({ className, ...props }, ref) => (
36
- <h3
37
- ref={ref}
38
- className={cn("font-semibold leading-none tracking-tight", className)}
39
- {...props}
40
- />
41
- ));
42
- CardTitle.displayName = "CardTitle";
43
-
44
- const CardDescription = React.forwardRef<
45
- HTMLParagraphElement,
46
- React.HTMLAttributes<HTMLParagraphElement>
47
- >(({ className, ...props }, ref) => (
48
- <p ref={ref} className={cn("text-sm text-muted", className)} {...props} />
49
- ));
50
- CardDescription.displayName = "CardDescription";
51
-
52
- const CardContent = React.forwardRef<
53
- HTMLDivElement,
54
- React.HTMLAttributes<HTMLDivElement>
55
- >(({ className, ...props }, ref) => (
56
- <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
57
- ));
58
- CardContent.displayName = "CardContent";
59
-
60
- const CardFooter = React.forwardRef<
61
- HTMLDivElement,
62
- React.HTMLAttributes<HTMLDivElement>
63
- >(({ className, ...props }, ref) => (
64
- <div
65
- ref={ref}
66
- className={cn("flex items-center p-6 pt-0", className)}
67
- {...props}
68
- />
69
- ));
70
- CardFooter.displayName = "CardFooter";
71
-
72
- export {
73
- Card,
74
- CardContent,
75
- CardDescription,
76
- CardFooter,
77
- CardHeader,
78
- CardTitle,
79
- };
@@ -1,129 +0,0 @@
1
- /**
2
- * Chat sub-components that have no app-level context dependency.
3
- *
4
- * These complement the full `ChatMessage` component (which stays in
5
- * `apps/app` because it uses `useApp()` for i18n and the `MessageContent`
6
- * renderer). Extracted here so they can be reused by any app.
7
- */
8
-
9
- import { Button } from "./button";
10
-
11
- /* ── TypingIndicator ─────────────────────────────────────────────────── */
12
-
13
- export function TypingIndicator({
14
- agentName,
15
- agentAvatarSrc,
16
- }: {
17
- agentName: string;
18
- agentAvatarSrc?: string | null;
19
- }) {
20
- const agentInitial = agentName.trim().charAt(0).toUpperCase() || "A";
21
-
22
- return (
23
- <div className="flex items-start gap-2 sm:gap-3 mt-4">
24
- <div className="w-8 h-8 shrink-0 rounded-full overflow-hidden border border-border bg-bg-hover shadow-sm">
25
- {agentAvatarSrc ? (
26
- <img
27
- src={agentAvatarSrc}
28
- alt={`${agentName} avatar`}
29
- className="w-full h-full object-cover"
30
- />
31
- ) : (
32
- <div className="w-full h-full flex items-center justify-center text-[11px] font-bold text-accent bg-accent-subtle">
33
- {agentInitial}
34
- </div>
35
- )}
36
- </div>
37
-
38
- <div className="max-w-[88%] sm:max-w-[80%] min-w-0">
39
- <div className="text-[12px] font-semibold text-accent mb-1">
40
- {agentName}
41
- </div>
42
- <div className="px-4 py-3 bg-bg-accent border border-border rounded-2xl rounded-bl-md">
43
- <div className="flex gap-1">
44
- <span
45
- className="w-2 h-2 rounded-full bg-muted-strong animate-[typing-bounce_1.2s_ease-in-out_infinite]"
46
- style={{ animationDelay: "0ms" }}
47
- />
48
- <span
49
- className="w-2 h-2 rounded-full bg-muted-strong animate-[typing-bounce_1.2s_ease-in-out_infinite]"
50
- style={{ animationDelay: "200ms" }}
51
- />
52
- <span
53
- className="w-2 h-2 rounded-full bg-muted-strong animate-[typing-bounce_1.2s_ease-in-out_infinite]"
54
- style={{ animationDelay: "400ms" }}
55
- />
56
- </div>
57
- </div>
58
- </div>
59
- </div>
60
- );
61
- }
62
-
63
- /* ── ChatEmptyState ──────────────────────────────────────────────────── */
64
-
65
- export interface ChatEmptyStateProps {
66
- agentName: string;
67
- /** Starter suggestions shown as quick-reply chips. */
68
- suggestions?: string[];
69
- onSuggestionClick?: (suggestion: string) => void;
70
- /** i18n labels — all have sensible English defaults. */
71
- labels?: {
72
- startConversation?: string;
73
- sendMessageTo?: string;
74
- toBeginChatting?: string;
75
- chatIconLabel?: string;
76
- };
77
- }
78
-
79
- export function ChatEmptyState({
80
- agentName,
81
- suggestions = ["Hello!", "How are you?", "Tell me a joke", "Help me with..."],
82
- onSuggestionClick,
83
- labels = {},
84
- }: ChatEmptyStateProps) {
85
- return (
86
- <div className="flex-1 flex flex-col items-center justify-center text-center p-6">
87
- <div className="w-16 h-16 rounded-2xl bg-accent-subtle flex items-center justify-center mb-4">
88
- <svg
89
- width="32"
90
- height="32"
91
- viewBox="0 0 24 24"
92
- fill="none"
93
- stroke="currentColor"
94
- strokeWidth="2"
95
- strokeLinecap="round"
96
- strokeLinejoin="round"
97
- className="text-accent"
98
- aria-label={labels.chatIconLabel ?? "Chat icon"}
99
- >
100
- <title>{labels.chatIconLabel ?? "Chat"}</title>
101
- <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
102
- </svg>
103
- </div>
104
- <h3 className="text-lg font-semibold text-txt-strong mb-2">
105
- {labels.startConversation ?? "Start a Conversation"}
106
- </h3>
107
- <p
108
- className="text-sm text-muted max-w-sm mb-6"
109
- style={{ fontFamily: "var(--font-chat)" }}
110
- >
111
- {labels.sendMessageTo ?? "Send a message to"} {agentName}{" "}
112
- {labels.toBeginChatting ?? "to begin chatting."}
113
- </p>
114
- <div className="flex flex-wrap justify-center gap-2">
115
- {suggestions.map((suggestion) => (
116
- <Button
117
- key={suggestion}
118
- variant="outline"
119
- size="sm"
120
- className="px-3 py-1.5 h-7 text-xs rounded-full text-muted border-border bg-bg hover:border-accent hover:text-accent transition-colors"
121
- onClick={() => onSuggestionClick?.(suggestion)}
122
- >
123
- {suggestion}
124
- </Button>
125
- ))}
126
- </div>
127
- </div>
128
- );
129
- }
@@ -1,28 +0,0 @@
1
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
2
- import { Check } from "lucide-react";
3
- import * as React from "react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const Checkbox = React.forwardRef<
8
- React.ElementRef<typeof CheckboxPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
10
- >(({ className, ...props }, ref) => (
11
- <CheckboxPrimitive.Root
12
- ref={ref}
13
- className={cn(
14
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-fg",
15
- className,
16
- )}
17
- {...props}
18
- >
19
- <CheckboxPrimitive.Indicator
20
- className={cn("flex items-center justify-center text-current")}
21
- >
22
- <Check className="h-4 w-4" />
23
- </CheckboxPrimitive.Indicator>
24
- </CheckboxPrimitive.Root>
25
- ));
26
- Checkbox.displayName = CheckboxPrimitive.Root.displayName;
27
-
28
- export { Checkbox };
@@ -1,67 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "../../lib/utils";
3
-
4
- export interface ConfirmDeleteProps {
5
- onConfirm: () => void;
6
- disabled?: boolean;
7
- triggerLabel?: string;
8
- confirmLabel?: string;
9
- cancelLabel?: string;
10
- busyLabel?: string;
11
- promptText?: string;
12
- className?: string;
13
- }
14
-
15
- export function ConfirmDelete({
16
- onConfirm,
17
- disabled = false,
18
- triggerLabel = "Delete",
19
- confirmLabel = "Confirm",
20
- cancelLabel = "Cancel",
21
- busyLabel,
22
- promptText = "Delete?",
23
- className,
24
- }: ConfirmDeleteProps) {
25
- const [confirming, setConfirming] = React.useState(false);
26
-
27
- if (!confirming) {
28
- return (
29
- <button
30
- type="button"
31
- className={cn(
32
- "rounded-md border border-border px-2 py-1 text-xs text-muted transition-colors hover:border-destructive hover:text-destructive",
33
- className,
34
- )}
35
- onClick={() => setConfirming(true)}
36
- disabled={disabled}
37
- >
38
- {triggerLabel}
39
- </button>
40
- );
41
- }
42
-
43
- return (
44
- <span className={cn("inline-flex items-center gap-1.5", className)}>
45
- <span className="text-[11px] text-destructive">{promptText}</span>
46
- <button
47
- type="button"
48
- className="rounded-md border border-destructive bg-destructive px-2 py-0.5 text-[10px] font-medium text-destructive-fg transition-opacity hover:opacity-90 disabled:opacity-50"
49
- onClick={() => {
50
- onConfirm();
51
- setConfirming(false);
52
- }}
53
- disabled={disabled}
54
- >
55
- {disabled && busyLabel ? busyLabel : confirmLabel}
56
- </button>
57
- <button
58
- type="button"
59
- className="rounded-md border border-border px-2 py-0.5 text-[10px] text-muted transition-colors hover:border-accent hover:text-accent disabled:opacity-50"
60
- onClick={() => setConfirming(false)}
61
- disabled={disabled}
62
- >
63
- {cancelLabel}
64
- </button>
65
- </span>
66
- );
67
- }