@alquimia-ai/ui 1.2.0 → 1.2.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 (104) hide show
  1. package/dist/components/hooks/index.js +1 -1
  2. package/dist/components/hooks/index.js.map +1 -1
  3. package/dist/components/hooks/index.mjs +1 -1
  4. package/dist/components/hooks/index.mjs.map +1 -1
  5. package/dist/components/molecules/index.d.mts +15 -2
  6. package/dist/components/molecules/index.d.ts +15 -2
  7. package/dist/components/molecules/index.js +837 -725
  8. package/dist/components/molecules/index.js.map +1 -1
  9. package/dist/components/molecules/index.mjs +819 -707
  10. package/dist/components/molecules/index.mjs.map +1 -1
  11. package/dist/components/organisms/index.js +260 -149
  12. package/dist/components/organisms/index.js.map +1 -1
  13. package/dist/components/organisms/index.mjs +258 -147
  14. package/dist/components/organisms/index.mjs.map +1 -1
  15. package/dist/index.d.mts +2 -2
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.js +265 -153
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +263 -151
  20. package/dist/index.mjs.map +1 -1
  21. package/package.json +52 -32
  22. package/src/components/atoms/index.ts +32 -0
  23. package/src/components/atoms/ui/alert.tsx +59 -0
  24. package/src/components/atoms/ui/aspect-ratio.tsx +7 -0
  25. package/src/components/atoms/ui/avatar.tsx +50 -0
  26. package/src/components/atoms/ui/badge.tsx +36 -0
  27. package/src/components/atoms/ui/breadcrumb.tsx +120 -0
  28. package/src/components/atoms/ui/button.tsx +56 -0
  29. package/src/components/atoms/ui/card.tsx +87 -0
  30. package/src/components/atoms/ui/checkbox.tsx +31 -0
  31. package/src/components/atoms/ui/command.tsx +155 -0
  32. package/src/components/atoms/ui/dialog.tsx +125 -0
  33. package/src/components/atoms/ui/drawer.tsx +119 -0
  34. package/src/components/atoms/ui/input.tsx +26 -0
  35. package/src/components/atoms/ui/label.tsx +26 -0
  36. package/src/components/atoms/ui/loader.tsx +52 -0
  37. package/src/components/atoms/ui/popover.tsx +31 -0
  38. package/src/components/atoms/ui/rich-text.tsx +19 -0
  39. package/src/components/atoms/ui/scroll-area.tsx +48 -0
  40. package/src/components/atoms/ui/select.tsx +160 -0
  41. package/src/components/atoms/ui/skeleton.tsx +15 -0
  42. package/src/components/atoms/ui/slider.tsx +29 -0
  43. package/src/components/atoms/ui/switch.tsx +30 -0
  44. package/src/components/atoms/ui/table.tsx +118 -0
  45. package/src/components/atoms/ui/tabs.tsx +56 -0
  46. package/src/components/atoms/ui/text-area/index.tsx +24 -0
  47. package/src/components/atoms/ui/textarea.tsx +25 -0
  48. package/src/components/atoms/ui/think-indicator.tsx +103 -0
  49. package/src/components/atoms/ui/toast.tsx +129 -0
  50. package/src/components/atoms/ui/toaster.tsx +38 -0
  51. package/src/components/atoms/ui/toggle.tsx +45 -0
  52. package/src/components/atoms/ui/typography/index.tsx +30 -0
  53. package/src/components/hooks/index.ts +4 -0
  54. package/src/components/hooks/use-document.tsx +44 -0
  55. package/src/components/hooks/use-resize-observer.ts +28 -0
  56. package/src/components/hooks/use-text-streaming.ts +63 -0
  57. package/src/components/hooks/use-toast.ts +194 -0
  58. package/src/components/index.ts +1 -0
  59. package/src/components/molecules/alert-dialog.tsx +141 -0
  60. package/src/components/molecules/assistant-button.tsx +148 -0
  61. package/src/components/molecules/call-out.tsx +163 -0
  62. package/src/components/molecules/carousel.tsx +262 -0
  63. package/src/components/molecules/documents/document-selector.tsx +79 -0
  64. package/src/components/molecules/documents/document-viewer.tsx +85 -0
  65. package/src/components/molecules/documents/index.ts +2 -0
  66. package/src/components/molecules/index.ts +11 -0
  67. package/src/components/molecules/navigation-menu.tsx +128 -0
  68. package/src/components/molecules/page-container.tsx +17 -0
  69. package/src/components/molecules/rating-comment.tsx +93 -0
  70. package/src/components/molecules/rating-stars.tsx +136 -0
  71. package/src/components/molecules/rating-thumbs.tsx +90 -0
  72. package/src/components/molecules/sidebar.tsx +107 -0
  73. package/src/components/molecules/sonner.tsx +30 -0
  74. package/src/components/molecules/viewers/index.ts +2 -0
  75. package/src/components/molecules/viewers/pdf-viewer.tsx +138 -0
  76. package/src/components/molecules/viewers/plain-text-viewer.tsx +40 -0
  77. package/src/components/organisms/assistant.tsx +271 -0
  78. package/src/components/organisms/index.ts +6 -0
  79. package/src/components/organisms/rating-dialog.tsx +104 -0
  80. package/src/components/organisms/speechToText.tsx +92 -0
  81. package/src/components/organisms/whisper.tsx +106 -0
  82. package/src/components/templates/cards/index.ts +2 -0
  83. package/src/components/templates/cards/with-image-heading-description-avatar.tsx +94 -0
  84. package/src/components/templates/cards/with-image-heading-description.tsx +63 -0
  85. package/src/components/templates/hero/index.tsx +39 -0
  86. package/src/components/templates/index.ts +4 -0
  87. package/src/components/templates/messages-window.tsx +15 -0
  88. package/src/components/templates/query-box.tsx +13 -0
  89. package/src/components/ui/input.tsx +25 -0
  90. package/src/components/ui/select.tsx +163 -0
  91. package/src/index.ts +7 -0
  92. package/src/lib/index.ts +1 -0
  93. package/src/lib/utils.ts +34 -0
  94. package/src/styles/call-out.css +153 -0
  95. package/src/styles/drawer.css +28 -0
  96. package/src/styles/globals.css +69 -0
  97. package/src/styles/prose.css +51 -0
  98. package/src/styles/ratings.css +27 -0
  99. package/src/styles/themes/base-alquimia.css +95 -0
  100. package/src/styles/themes/base-nordic.css +83 -0
  101. package/src/styles/themes/base-primary.css +85 -0
  102. package/src/styles/themes/base.css +8 -0
  103. package/src/types/index.ts +1 -0
  104. package/src/types/type.ts +76 -0
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ __export(index_exports, {
46
46
  AlertTitle: () => AlertTitle,
47
47
  AspectRatio: () => AspectRatio,
48
48
  Assistant: () => Assistant,
49
+ AssistantButton: () => AssistantButton,
49
50
  AssistantInput: () => AssistantInput,
50
51
  AssistantMessageArea: () => AssistantMessageArea,
51
52
  Avatar: () => Avatar,
@@ -2058,8 +2059,8 @@ function SpeechToText({
2058
2059
  }
2059
2060
 
2060
2061
  // src/components/organisms/assistant.tsx
2061
- var React32 = __toESM(require("react"));
2062
- var import_react11 = require("react");
2062
+ var React33 = __toESM(require("react"));
2063
+ var import_react12 = require("react");
2063
2064
 
2064
2065
  // src/components/molecules/page-container.tsx
2065
2066
  var import_react9 = require("react");
@@ -2078,20 +2079,131 @@ var PageContainer = (0, import_react9.forwardRef)(
2078
2079
  );
2079
2080
  PageContainer.displayName = "PageContainer";
2080
2081
 
2081
- // src/components/molecules/carousel.tsx
2082
+ // src/components/molecules/assistant-button.tsx
2082
2083
  var React25 = __toESM(require("react"));
2084
+ var import_react10 = require("react");
2085
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2086
+ var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, className }, ref) => {
2087
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2088
+ "div",
2089
+ {
2090
+ ref,
2091
+ className: cn(
2092
+ "absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container",
2093
+ "transition-all duration-300",
2094
+ showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4",
2095
+ className
2096
+ ),
2097
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "rounded-lg p-2 pr-0 w-64", children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2098
+ "button",
2099
+ {
2100
+ onClick: () => suggestion.action?.(),
2101
+ style: {
2102
+ transitionDelay: showSuggestions ? `${index * 50}ms` : "0ms"
2103
+ },
2104
+ className: cn(
2105
+ "bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto",
2106
+ "text-primary hover:bg-secondary",
2107
+ "transition-all duration-100",
2108
+ "origin-bottom w-fit",
2109
+ "alq--assistant-suggestion",
2110
+ showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
2111
+ ),
2112
+ children: [
2113
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(suggestion.icon, { className: "w-5 h-5 text-primary" }),
2114
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-xs whitespace-nowrap font-normal", children: suggestion.label })
2115
+ ]
2116
+ },
2117
+ index
2118
+ )) })
2119
+ }
2120
+ );
2121
+ });
2122
+ AssistantSuggestions.displayName = "Suggestions";
2123
+ var AssistantButton = React25.forwardRef(
2124
+ ({
2125
+ icon: Icon2,
2126
+ clickAction,
2127
+ className,
2128
+ suggestions = []
2129
+ }, ref) => {
2130
+ const [isVisible, setIsVisible] = (0, import_react10.useState)(false);
2131
+ const [showSuggestions, setShowSuggestions] = (0, import_react10.useState)(false);
2132
+ const handleMouseEnter = () => {
2133
+ setIsVisible(true);
2134
+ requestAnimationFrame(() => {
2135
+ requestAnimationFrame(() => {
2136
+ setShowSuggestions(true);
2137
+ });
2138
+ });
2139
+ };
2140
+ const handleMouseLeave = () => {
2141
+ setShowSuggestions(false);
2142
+ setTimeout(() => setIsVisible(false), 300);
2143
+ };
2144
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2145
+ "div",
2146
+ {
2147
+ ref,
2148
+ className: cn(
2149
+ "fixed bottom-8 right-4 z-50",
2150
+ "alq--assistant-button-container",
2151
+ className
2152
+ ),
2153
+ onMouseEnter: handleMouseEnter,
2154
+ onMouseLeave: handleMouseLeave,
2155
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative group", children: [
2156
+ isVisible && suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2157
+ AssistantSuggestions,
2158
+ {
2159
+ suggestions,
2160
+ showSuggestions
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2164
+ Button,
2165
+ {
2166
+ variant: "outline",
2167
+ size: "sm",
2168
+ className: cn(
2169
+ "fixed hover:bg-opacity-70 transition-all duration-300",
2170
+ "bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2",
2171
+ "shadow-md",
2172
+ "hover:shadow-lg",
2173
+ showSuggestions ? "scale-110" : "hover:scale-105",
2174
+ "alq--assistant-button"
2175
+ ),
2176
+ onClick: clickAction,
2177
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2178
+ Icon2,
2179
+ {
2180
+ style: { width: "22px", height: "22px" },
2181
+ className: "text-primary"
2182
+ }
2183
+ )
2184
+ }
2185
+ )
2186
+ ] })
2187
+ }
2188
+ );
2189
+ }
2190
+ );
2191
+ AssistantButton.displayName = "AssistantButton";
2192
+
2193
+ // src/components/molecules/carousel.tsx
2194
+ var React26 = __toESM(require("react"));
2083
2195
  var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
2084
2196
  var import_lucide_react9 = require("lucide-react");
2085
- var import_jsx_runtime38 = require("react/jsx-runtime");
2086
- var CarouselContext = React25.createContext(null);
2197
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2198
+ var CarouselContext = React26.createContext(null);
2087
2199
  function useCarousel() {
2088
- const context = React25.useContext(CarouselContext);
2200
+ const context = React26.useContext(CarouselContext);
2089
2201
  if (!context) {
2090
2202
  throw new Error("useCarousel must be used within a <Carousel />");
2091
2203
  }
2092
2204
  return context;
2093
2205
  }
2094
- var Carousel = React25.forwardRef(
2206
+ var Carousel = React26.forwardRef(
2095
2207
  ({
2096
2208
  orientation = "horizontal",
2097
2209
  opts,
@@ -2108,22 +2220,22 @@ var Carousel = React25.forwardRef(
2108
2220
  },
2109
2221
  plugins
2110
2222
  );
2111
- const [canScrollPrev, setCanScrollPrev] = React25.useState(false);
2112
- const [canScrollNext, setCanScrollNext] = React25.useState(false);
2113
- const onSelect = React25.useCallback((api2) => {
2223
+ const [canScrollPrev, setCanScrollPrev] = React26.useState(false);
2224
+ const [canScrollNext, setCanScrollNext] = React26.useState(false);
2225
+ const onSelect = React26.useCallback((api2) => {
2114
2226
  if (!api2) {
2115
2227
  return;
2116
2228
  }
2117
2229
  setCanScrollPrev(api2.canScrollPrev());
2118
2230
  setCanScrollNext(api2.canScrollNext());
2119
2231
  }, []);
2120
- const scrollPrev = React25.useCallback(() => {
2232
+ const scrollPrev = React26.useCallback(() => {
2121
2233
  api?.scrollPrev();
2122
2234
  }, [api]);
2123
- const scrollNext = React25.useCallback(() => {
2235
+ const scrollNext = React26.useCallback(() => {
2124
2236
  api?.scrollNext();
2125
2237
  }, [api]);
2126
- const handleKeyDown = React25.useCallback(
2238
+ const handleKeyDown = React26.useCallback(
2127
2239
  (event) => {
2128
2240
  if (event.key === "ArrowLeft") {
2129
2241
  event.preventDefault();
@@ -2135,13 +2247,13 @@ var Carousel = React25.forwardRef(
2135
2247
  },
2136
2248
  [scrollPrev, scrollNext]
2137
2249
  );
2138
- React25.useEffect(() => {
2250
+ React26.useEffect(() => {
2139
2251
  if (!api || !setApi) {
2140
2252
  return;
2141
2253
  }
2142
2254
  setApi(api);
2143
2255
  }, [api, setApi]);
2144
- React25.useEffect(() => {
2256
+ React26.useEffect(() => {
2145
2257
  if (!api) {
2146
2258
  return;
2147
2259
  }
@@ -2152,7 +2264,7 @@ var Carousel = React25.forwardRef(
2152
2264
  api?.off("select", onSelect);
2153
2265
  };
2154
2266
  }, [api, onSelect]);
2155
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2267
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2156
2268
  CarouselContext.Provider,
2157
2269
  {
2158
2270
  value: {
@@ -2165,7 +2277,7 @@ var Carousel = React25.forwardRef(
2165
2277
  canScrollPrev,
2166
2278
  canScrollNext
2167
2279
  },
2168
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2280
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2169
2281
  "div",
2170
2282
  {
2171
2283
  ref,
@@ -2182,9 +2294,9 @@ var Carousel = React25.forwardRef(
2182
2294
  }
2183
2295
  );
2184
2296
  Carousel.displayName = "Carousel";
2185
- var CarouselContent = React25.forwardRef(({ className, ...props }, ref) => {
2297
+ var CarouselContent = React26.forwardRef(({ className, ...props }, ref) => {
2186
2298
  const { carouselRef, orientation } = useCarousel();
2187
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2299
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2188
2300
  "div",
2189
2301
  {
2190
2302
  ref,
@@ -2198,9 +2310,9 @@ var CarouselContent = React25.forwardRef(({ className, ...props }, ref) => {
2198
2310
  ) });
2199
2311
  });
2200
2312
  CarouselContent.displayName = "CarouselContent";
2201
- var CarouselItem = React25.forwardRef(({ className, ...props }, ref) => {
2313
+ var CarouselItem = React26.forwardRef(({ className, ...props }, ref) => {
2202
2314
  const { orientation } = useCarousel();
2203
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2315
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2204
2316
  "div",
2205
2317
  {
2206
2318
  ref,
@@ -2216,9 +2328,9 @@ var CarouselItem = React25.forwardRef(({ className, ...props }, ref) => {
2216
2328
  );
2217
2329
  });
2218
2330
  CarouselItem.displayName = "CarouselItem";
2219
- var CarouselPrevious = React25.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
2331
+ var CarouselPrevious = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
2220
2332
  const { orientation, scrollPrev, canScrollPrev } = useCarousel();
2221
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2333
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2222
2334
  Button,
2223
2335
  {
2224
2336
  ref,
@@ -2233,16 +2345,16 @@ var CarouselPrevious = React25.forwardRef(({ className, variant = "outline", siz
2233
2345
  onClick: scrollPrev,
2234
2346
  ...props,
2235
2347
  children: [
2236
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react9.ArrowLeft, { className: "h-4 w-4" }),
2237
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", children: "Previous slide" })
2348
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react9.ArrowLeft, { className: "h-4 w-4" }),
2349
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: "Previous slide" })
2238
2350
  ]
2239
2351
  }
2240
2352
  );
2241
2353
  });
2242
2354
  CarouselPrevious.displayName = "CarouselPrevious";
2243
- var CarouselNext = React25.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
2355
+ var CarouselNext = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
2244
2356
  const { orientation, scrollNext, canScrollNext } = useCarousel();
2245
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2357
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2246
2358
  Button,
2247
2359
  {
2248
2360
  ref,
@@ -2257,8 +2369,8 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
2257
2369
  onClick: scrollNext,
2258
2370
  ...props,
2259
2371
  children: [
2260
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react9.ArrowRight, { className: "h-4 w-4" }),
2261
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", children: "Next slide" })
2372
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react9.ArrowRight, { className: "h-4 w-4" }),
2373
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: "Next slide" })
2262
2374
  ]
2263
2375
  }
2264
2376
  );
@@ -2266,12 +2378,12 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
2266
2378
  CarouselNext.displayName = "CarouselNext";
2267
2379
 
2268
2380
  // src/components/molecules/navigation-menu.tsx
2269
- var React26 = __toESM(require("react"));
2381
+ var React27 = __toESM(require("react"));
2270
2382
  var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
2271
2383
  var import_class_variance_authority9 = require("class-variance-authority");
2272
2384
  var import_lucide_react10 = require("lucide-react");
2273
- var import_jsx_runtime39 = require("react/jsx-runtime");
2274
- var NavigationMenu = React26.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2385
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2386
+ var NavigationMenu = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2275
2387
  NavigationMenuPrimitive.Root,
2276
2388
  {
2277
2389
  ref,
@@ -2282,12 +2394,12 @@ var NavigationMenu = React26.forwardRef(({ className, children, ...props }, ref)
2282
2394
  ...props,
2283
2395
  children: [
2284
2396
  children,
2285
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(NavigationMenuViewport, {})
2397
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(NavigationMenuViewport, {})
2286
2398
  ]
2287
2399
  }
2288
2400
  ));
2289
2401
  NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
2290
- var NavigationMenuList = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2402
+ var NavigationMenuList = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2291
2403
  NavigationMenuPrimitive.List,
2292
2404
  {
2293
2405
  ref,
@@ -2303,7 +2415,7 @@ var NavigationMenuItem = NavigationMenuPrimitive.Item;
2303
2415
  var navigationMenuTriggerStyle = (0, import_class_variance_authority9.cva)(
2304
2416
  "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
2305
2417
  );
2306
- var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2418
+ var NavigationMenuTrigger = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2307
2419
  NavigationMenuPrimitive.Trigger,
2308
2420
  {
2309
2421
  ref,
@@ -2312,7 +2424,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
2312
2424
  children: [
2313
2425
  children,
2314
2426
  " ",
2315
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2427
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2316
2428
  import_lucide_react10.ChevronDown,
2317
2429
  {
2318
2430
  className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
@@ -2323,7 +2435,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
2323
2435
  }
2324
2436
  ));
2325
2437
  NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
2326
- var NavigationMenuContent = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2438
+ var NavigationMenuContent = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2327
2439
  NavigationMenuPrimitive.Content,
2328
2440
  {
2329
2441
  ref,
@@ -2336,7 +2448,7 @@ var NavigationMenuContent = React26.forwardRef(({ className, ...props }, ref) =>
2336
2448
  ));
2337
2449
  NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
2338
2450
  var NavigationMenuLink = NavigationMenuPrimitive.Link;
2339
- var NavigationMenuViewport = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2451
+ var NavigationMenuViewport = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2340
2452
  NavigationMenuPrimitive.Viewport,
2341
2453
  {
2342
2454
  className: cn(
@@ -2348,7 +2460,7 @@ var NavigationMenuViewport = React26.forwardRef(({ className, ...props }, ref) =
2348
2460
  }
2349
2461
  ) }));
2350
2462
  NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
2351
- var NavigationMenuIndicator = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2463
+ var NavigationMenuIndicator = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2352
2464
  NavigationMenuPrimitive.Indicator,
2353
2465
  {
2354
2466
  ref,
@@ -2357,15 +2469,15 @@ var NavigationMenuIndicator = React26.forwardRef(({ className, ...props }, ref)
2357
2469
  className
2358
2470
  ),
2359
2471
  ...props,
2360
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
2472
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
2361
2473
  }
2362
2474
  ));
2363
2475
  NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
2364
2476
 
2365
2477
  // src/components/molecules/sidebar.tsx
2366
- var React27 = __toESM(require("react"));
2478
+ var React28 = __toESM(require("react"));
2367
2479
  var import_class_variance_authority10 = require("class-variance-authority");
2368
- var import_jsx_runtime40 = require("react/jsx-runtime");
2480
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2369
2481
  var sidebarVariants = (0, import_class_variance_authority10.cva)(
2370
2482
  "flex flex-col border-r",
2371
2483
  {
@@ -2381,7 +2493,7 @@ var sidebarVariants = (0, import_class_variance_authority10.cva)(
2381
2493
  }
2382
2494
  }
2383
2495
  );
2384
- var SidebarFooter = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2496
+ var SidebarFooter = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2385
2497
  "div",
2386
2498
  {
2387
2499
  ref,
@@ -2391,7 +2503,7 @@ var SidebarFooter = React27.forwardRef(({ className, children, ...props }, ref)
2391
2503
  }
2392
2504
  ));
2393
2505
  SidebarFooter.displayName = "SidebarFooter";
2394
- var Sidebar = React27.forwardRef(
2506
+ var Sidebar = React28.forwardRef(
2395
2507
  ({
2396
2508
  className,
2397
2509
  items,
@@ -2404,8 +2516,8 @@ var Sidebar = React27.forwardRef(
2404
2516
  buttonClassName,
2405
2517
  ...props
2406
2518
  }, ref) => {
2407
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn(className, "alq--navigation-sidebar h-full"), ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("aside", { className: cn(sidebarVariants({ size }), "h-full"), children: [
2408
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ScrollArea, { className: "flex-grow justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col gap-2 p-4", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2519
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn(className, "alq--navigation-sidebar h-full"), ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("aside", { className: cn(sidebarVariants({ size }), "h-full"), children: [
2520
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ScrollArea, { className: "flex-grow justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex flex-col gap-2 p-4", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2409
2521
  Button,
2410
2522
  {
2411
2523
  variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,
@@ -2417,13 +2529,13 @@ var Sidebar = React27.forwardRef(
2417
2529
  }
2418
2530
  },
2419
2531
  children: [
2420
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(item.icon, { className: "mr-2 h-4 w-4" }),
2532
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(item.icon, { className: "mr-2 h-4 w-4" }),
2421
2533
  item.name
2422
2534
  ]
2423
2535
  },
2424
2536
  item.name
2425
2537
  )) }) }),
2426
- footerContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SidebarFooter, { children: footerContent })
2538
+ footerContent && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SidebarFooter, { children: footerContent })
2427
2539
  ] }) });
2428
2540
  }
2429
2541
  );
@@ -2431,10 +2543,10 @@ var Sidebar = React27.forwardRef(
2431
2543
  // src/components/molecules/sonner.tsx
2432
2544
  var import_next_themes = require("next-themes");
2433
2545
  var import_sonner = require("sonner");
2434
- var import_jsx_runtime41 = require("react/jsx-runtime");
2546
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2435
2547
  var Toaster2 = ({ ...props }) => {
2436
2548
  const { theme = "system" } = (0, import_next_themes.useTheme)();
2437
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2549
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2438
2550
  import_sonner.Toaster,
2439
2551
  {
2440
2552
  theme,
@@ -2453,14 +2565,14 @@ var Toaster2 = ({ ...props }) => {
2453
2565
  };
2454
2566
 
2455
2567
  // src/components/molecules/rating-stars.tsx
2456
- var React28 = __toESM(require("react"));
2568
+ var React29 = __toESM(require("react"));
2457
2569
  var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
2458
2570
  var import_lucide_react11 = require("lucide-react");
2459
- var import_jsx_runtime42 = require("react/jsx-runtime");
2571
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2460
2572
  var TooltipProvider = TooltipPrimitive.Provider;
2461
2573
  var Tooltip = TooltipPrimitive.Root;
2462
2574
  var TooltipTrigger = TooltipPrimitive.Trigger;
2463
- var TooltipContent = React28.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2575
+ var TooltipContent = React29.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2464
2576
  TooltipPrimitive.Content,
2465
2577
  {
2466
2578
  ref,
@@ -2473,14 +2585,14 @@ var TooltipContent = React28.forwardRef(({ className, sideOffset = 4, ...props }
2473
2585
  }
2474
2586
  ));
2475
2587
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
2476
- var StarRating = React28.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, className: "flex", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2588
+ var StarRating = React29.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { ref, className: "flex", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2477
2589
  Button,
2478
2590
  {
2479
2591
  onClick: () => onRate(star),
2480
2592
  variant: "link",
2481
2593
  className: "p-1 transition-colors [&_svg]:size-5 h-5",
2482
2594
  "aria-label": `Rate ${star} star${star !== 1 ? "s" : ""}`,
2483
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2595
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2484
2596
  import_lucide_react11.Star,
2485
2597
  {
2486
2598
  className: cn(
@@ -2493,19 +2605,19 @@ var StarRating = React28.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */
2493
2605
  star
2494
2606
  )) }));
2495
2607
  StarRating.displayName = "StarRating";
2496
- var RatingStars = React28.forwardRef(({
2608
+ var RatingStars = React29.forwardRef(({
2497
2609
  currentRating = 0,
2498
2610
  onRate,
2499
2611
  className,
2500
2612
  isLoading
2501
2613
  }, ref) => {
2502
- const [open, setOpen] = React28.useState(false);
2503
- const [animate, setAnimate] = React28.useState(false);
2614
+ const [open, setOpen] = React29.useState(false);
2615
+ const [animate, setAnimate] = React29.useState(false);
2504
2616
  const handleRate = (rating) => {
2505
2617
  onRate(rating);
2506
2618
  setOpen(false);
2507
2619
  };
2508
- React28.useEffect(() => {
2620
+ React29.useEffect(() => {
2509
2621
  if (currentRating > 0) {
2510
2622
  setAnimate(true);
2511
2623
  const timer = setTimeout(() => setAnimate(false), 150);
@@ -2513,8 +2625,8 @@ var RatingStars = React28.forwardRef(({
2513
2625
  }
2514
2626
  }, [currentRating]);
2515
2627
  const hasRated = currentRating > 0;
2516
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Tooltip, { open, onOpenChange: setOpen, children: [
2517
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2628
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { open, onOpenChange: setOpen, children: [
2629
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2518
2630
  Button,
2519
2631
  {
2520
2632
  ref,
@@ -2525,7 +2637,7 @@ var RatingStars = React28.forwardRef(({
2525
2637
  ),
2526
2638
  disabled: isLoading,
2527
2639
  onClick: () => setOpen(!open),
2528
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2640
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2529
2641
  import_lucide_react11.Star,
2530
2642
  {
2531
2643
  className: cn(
@@ -2538,7 +2650,7 @@ var RatingStars = React28.forwardRef(({
2538
2650
  )
2539
2651
  }
2540
2652
  ) }),
2541
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipContent, { side: "top", align: "center", className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2653
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipContent, { side: "top", align: "center", className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-2 bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2542
2654
  StarRating,
2543
2655
  {
2544
2656
  rating: currentRating,
@@ -2550,10 +2662,10 @@ var RatingStars = React28.forwardRef(({
2550
2662
  RatingStars.displayName = "RatingStars";
2551
2663
 
2552
2664
  // src/components/molecules/rating-thumbs.tsx
2553
- var React29 = __toESM(require("react"));
2665
+ var React30 = __toESM(require("react"));
2554
2666
  var import_lucide_react12 = require("lucide-react");
2555
- var import_jsx_runtime43 = require("react/jsx-runtime");
2556
- var RatingThumbs = React29.forwardRef(
2667
+ var import_jsx_runtime44 = require("react/jsx-runtime");
2668
+ var RatingThumbs = React30.forwardRef(
2557
2669
  ({
2558
2670
  currentRating,
2559
2671
  onRate,
@@ -2561,15 +2673,15 @@ var RatingThumbs = React29.forwardRef(
2561
2673
  className,
2562
2674
  isLoading
2563
2675
  }, ref) => {
2564
- const [animate, setAnimate] = React29.useState(false);
2565
- React29.useEffect(() => {
2676
+ const [animate, setAnimate] = React30.useState(false);
2677
+ React30.useEffect(() => {
2566
2678
  if (currentRating) {
2567
2679
  setAnimate(true);
2568
2680
  const timer = setTimeout(() => setAnimate(false), 150);
2569
2681
  return () => clearTimeout(timer);
2570
2682
  }
2571
2683
  }, [currentRating]);
2572
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2684
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2573
2685
  "div",
2574
2686
  {
2575
2687
  ref,
@@ -2580,7 +2692,7 @@ var RatingThumbs = React29.forwardRef(
2580
2692
  className
2581
2693
  ),
2582
2694
  children: [
2583
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2695
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2584
2696
  Button,
2585
2697
  {
2586
2698
  variant: "link",
@@ -2591,7 +2703,7 @@ var RatingThumbs = React29.forwardRef(
2591
2703
  ),
2592
2704
  "aria-label": "Thumbs up",
2593
2705
  disabled: isLoading,
2594
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2706
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2595
2707
  import_lucide_react12.ThumbsUp,
2596
2708
  {
2597
2709
  className: cn(
@@ -2604,7 +2716,7 @@ var RatingThumbs = React29.forwardRef(
2604
2716
  )
2605
2717
  }
2606
2718
  ),
2607
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2719
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2608
2720
  Button,
2609
2721
  {
2610
2722
  variant: "link",
@@ -2615,7 +2727,7 @@ var RatingThumbs = React29.forwardRef(
2615
2727
  ),
2616
2728
  "aria-label": "Thumbs down",
2617
2729
  disabled: isLoading,
2618
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2730
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2619
2731
  import_lucide_react12.ThumbsDown,
2620
2732
  {
2621
2733
  className: cn(
@@ -2636,30 +2748,30 @@ var RatingThumbs = React29.forwardRef(
2636
2748
  RatingThumbs.displayName = "RatingThumbs";
2637
2749
 
2638
2750
  // src/components/molecules/rating-comment.tsx
2639
- var React30 = __toESM(require("react"));
2751
+ var React31 = __toESM(require("react"));
2640
2752
  var import_lucide_react13 = require("lucide-react");
2641
- var import_jsx_runtime44 = require("react/jsx-runtime");
2642
- var RatingComment = React30.forwardRef(
2753
+ var import_jsx_runtime45 = require("react/jsx-runtime");
2754
+ var RatingComment = React31.forwardRef(
2643
2755
  ({ currentRating, onRate, className, isLoading }, ref) => {
2644
- const [open, setOpen] = React30.useState(false);
2645
- const [comment, setComment] = React30.useState("");
2646
- const [animate, setAnimate] = React30.useState(false);
2756
+ const [open, setOpen] = React31.useState(false);
2757
+ const [comment, setComment] = React31.useState("");
2758
+ const [animate, setAnimate] = React31.useState(false);
2647
2759
  const handleRate = () => {
2648
2760
  onRate(comment);
2649
2761
  setOpen(false);
2650
2762
  };
2651
- React30.useEffect(() => {
2763
+ React31.useEffect(() => {
2652
2764
  if (currentRating) {
2653
2765
  setAnimate(true);
2654
2766
  const timer = setTimeout(() => setAnimate(false), 150);
2655
2767
  return () => clearTimeout(timer);
2656
2768
  }
2657
2769
  }, [currentRating]);
2658
- React30.useEffect(() => {
2770
+ React31.useEffect(() => {
2659
2771
  setComment("");
2660
2772
  }, [open]);
2661
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
2662
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2773
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
2774
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2663
2775
  Button,
2664
2776
  {
2665
2777
  ref,
@@ -2670,7 +2782,7 @@ var RatingComment = React30.forwardRef(
2670
2782
  className
2671
2783
  ),
2672
2784
  disabled: isLoading,
2673
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2785
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2674
2786
  import_lucide_react13.Book,
2675
2787
  {
2676
2788
  className: cn(
@@ -2683,10 +2795,10 @@ var RatingComment = React30.forwardRef(
2683
2795
  )
2684
2796
  }
2685
2797
  ) }),
2686
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DialogOverlay, { className: "fixed inset-0 bg-black bg-opacity-50" }),
2687
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(DialogContent, { "aria-describedby": void 0, children: [
2688
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DialogTitle, { className: "text-lg font-medium", children: "Deja un comentario" }),
2689
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2798
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogOverlay, { className: "fixed inset-0 bg-black bg-opacity-50" }),
2799
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogContent, { "aria-describedby": void 0, children: [
2800
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogTitle, { className: "text-lg font-medium", children: "Deja un comentario" }),
2801
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2690
2802
  "textarea",
2691
2803
  {
2692
2804
  className: "mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",
@@ -2695,7 +2807,7 @@ var RatingComment = React30.forwardRef(
2695
2807
  onChange: (e) => setComment(e.target.value)
2696
2808
  }
2697
2809
  ),
2698
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2810
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2699
2811
  Button,
2700
2812
  {
2701
2813
  onClick: handleRate,
@@ -2710,27 +2822,27 @@ var RatingComment = React30.forwardRef(
2710
2822
  RatingComment.displayName = "RatingComment";
2711
2823
 
2712
2824
  // src/components/molecules/call-out.tsx
2713
- var React31 = __toESM(require("react"));
2825
+ var React32 = __toESM(require("react"));
2714
2826
 
2715
2827
  // src/components/hooks/use-text-streaming.ts
2716
- var import_react10 = require("react");
2828
+ var import_react11 = require("react");
2717
2829
  var CHAR_DELAY = 25;
2718
2830
  var PUNCTUATION_DELAY = 200;
2719
2831
  var PUNCTUATION_MARKS = [".", "!", "?", ";", ":"];
2720
2832
  function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
2721
- const [displayedContent, setDisplayedContent] = (0, import_react10.useState)("");
2722
- const timeoutId = (0, import_react10.useRef)(null);
2723
- const hasStartedStreaming = (0, import_react10.useRef)(false);
2833
+ const [displayedContent, setDisplayedContent] = (0, import_react11.useState)("");
2834
+ const timeoutId = (0, import_react11.useRef)(null);
2835
+ const hasStartedStreaming = (0, import_react11.useRef)(false);
2724
2836
  const getDelayForChar = (text, position) => {
2725
2837
  if (position === 0) return CHAR_DELAY;
2726
- const previousChar = text[position - 1];
2838
+ const previousChar = text[position - 1] || "";
2727
2839
  const isEllipsis = text.slice(position - 1, position + 2) === "...";
2728
2840
  if (isEllipsis) {
2729
2841
  return CHAR_DELAY;
2730
2842
  }
2731
2843
  return PUNCTUATION_MARKS.includes(previousChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
2732
2844
  };
2733
- (0, import_react10.useEffect)(() => {
2845
+ (0, import_react11.useEffect)(() => {
2734
2846
  if (!shouldStream && !hasStartedStreaming.current) {
2735
2847
  setDisplayedContent(content);
2736
2848
  handleIsTextStreaming?.(false);
@@ -2760,9 +2872,9 @@ function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
2760
2872
  }
2761
2873
 
2762
2874
  // src/components/molecules/call-out.tsx
2763
- var import_jsx_runtime45 = require("react/jsx-runtime");
2764
- var CallOut = React31.forwardRef(({ className, children, role, ...props }, ref) => {
2765
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2875
+ var import_jsx_runtime46 = require("react/jsx-runtime");
2876
+ var CallOut = React32.forwardRef(({ className, children, role, ...props }, ref) => {
2877
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2766
2878
  "div",
2767
2879
  {
2768
2880
  ref,
@@ -2773,8 +2885,8 @@ var CallOut = React31.forwardRef(({ className, children, role, ...props }, ref)
2773
2885
  }
2774
2886
  );
2775
2887
  });
2776
- var CallOutDate = React31.forwardRef(({ className, children, ...props }, ref) => {
2777
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2888
+ var CallOutDate = React32.forwardRef(({ className, children, ...props }, ref) => {
2889
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2778
2890
  "div",
2779
2891
  {
2780
2892
  ref,
@@ -2788,13 +2900,13 @@ var CallOutDate = React31.forwardRef(({ className, children, ...props }, ref) =>
2788
2900
  }
2789
2901
  );
2790
2902
  });
2791
- var CallOutActions = React31.forwardRef(({ className, actions, role, message, ...props }, ref) => {
2792
- const [isLoading, setIsLoading] = React31.useState(false);
2793
- const [isClicked, setIsClicked] = React31.useState(false);
2903
+ var CallOutActions = React32.forwardRef(({ className, actions, role, message, ...props }, ref) => {
2904
+ const [isLoading, setIsLoading] = React32.useState(false);
2905
+ const [isClicked, setIsClicked] = React32.useState(false);
2794
2906
  if (role === "user") {
2795
2907
  return null;
2796
2908
  }
2797
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref, className: cn("alq--callout-actions", className), ...props, children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
2909
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref, className: cn("alq--callout-actions", className), ...props, children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2798
2910
  "button",
2799
2911
  {
2800
2912
  className: cn(
@@ -2816,7 +2928,7 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
2816
2928
  });
2817
2929
  },
2818
2930
  children: [
2819
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2931
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2820
2932
  "span",
2821
2933
  {
2822
2934
  className: cn("alq-action-icon-wrapper", {
@@ -2825,18 +2937,18 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
2825
2937
  children: action.icon
2826
2938
  }
2827
2939
  ),
2828
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("label", { children: action.label })
2940
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { children: action.label })
2829
2941
  ]
2830
2942
  },
2831
2943
  action.label
2832
2944
  )) });
2833
2945
  });
2834
- var CallOutResponse = React31.forwardRef(
2946
+ var CallOutResponse = React32.forwardRef(
2835
2947
  ({ className, children, role, additionalInfo, isStreaming, handleIsTextStreaming, ...props }, ref) => {
2836
2948
  const content = String(children || "");
2837
2949
  const shouldStream = role === "assistant" && isStreaming;
2838
2950
  const displayedContent = useTextStreaming(content, shouldStream ?? false, handleIsTextStreaming);
2839
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
2951
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2840
2952
  "div",
2841
2953
  {
2842
2954
  ref,
@@ -2849,8 +2961,8 @@ var CallOutResponse = React31.forwardRef(
2849
2961
  ),
2850
2962
  ...props,
2851
2963
  children: [
2852
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RichText, { content: displayedContent }),
2853
- additionalInfo && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2964
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RichText, { content: displayedContent }),
2965
+ additionalInfo && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2854
2966
  "div",
2855
2967
  {
2856
2968
  className: cn(
@@ -2873,19 +2985,19 @@ CallOutResponse.displayName = "CallOutResponse";
2873
2985
 
2874
2986
  // src/components/organisms/assistant.tsx
2875
2987
  var import_lucide_react14 = require("lucide-react");
2876
- var import_jsx_runtime46 = require("react/jsx-runtime");
2877
- var Assistant = React32.forwardRef(
2988
+ var import_jsx_runtime47 = require("react/jsx-runtime");
2989
+ var Assistant = React33.forwardRef(
2878
2990
  ({ className, sdk, title, description, children, ...props }, ref) => {
2879
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2991
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
2880
2992
  "div",
2881
2993
  {
2882
2994
  ref,
2883
2995
  className: cn("flex flex-col h-full bg-background text-foreground", className),
2884
2996
  ...props,
2885
2997
  children: [
2886
- (title || description) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AssistantHeader, { children: [
2887
- title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AssistantTitle, { title }),
2888
- description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AssistantDescription, { description })
2998
+ (title || description) && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AssistantHeader, { children: [
2999
+ title && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AssistantTitle, { title }),
3000
+ description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AssistantDescription, { description })
2889
3001
  ] }),
2890
3002
  children
2891
3003
  ]
@@ -2894,14 +3006,14 @@ var Assistant = React32.forwardRef(
2894
3006
  }
2895
3007
  );
2896
3008
  Assistant.displayName = "Assistant";
2897
- var AssistantTitle = React32.forwardRef(
2898
- ({ className, title, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Typography, { typeStyle: "heading1", as: "h1", children: title }) })
3009
+ var AssistantTitle = React33.forwardRef(
3010
+ ({ className, title, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Typography, { typeStyle: "heading1", as: "h1", children: title }) })
2899
3011
  );
2900
3012
  AssistantTitle.displayName = "AssistantTitle";
2901
- var AssistantDescription = React32.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Typography, { typeStyle: "display", as: "p", children: description }) }));
3013
+ var AssistantDescription = React33.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Typography, { typeStyle: "display", as: "p", children: description }) }));
2902
3014
  AssistantDescription.displayName = "AssistantDescription";
2903
- var AssistantHeader = React32.forwardRef(
2904
- ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3015
+ var AssistantHeader = React33.forwardRef(
3016
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2905
3017
  "div",
2906
3018
  {
2907
3019
  ref,
@@ -2912,7 +3024,7 @@ var AssistantHeader = React32.forwardRef(
2912
3024
  )
2913
3025
  );
2914
3026
  AssistantHeader.displayName = "AssistantHeader";
2915
- var AssistantMessageArea = React32.forwardRef(
3027
+ var AssistantMessageArea = React33.forwardRef(
2916
3028
  ({
2917
3029
  className,
2918
3030
  messages,
@@ -2923,23 +3035,23 @@ var AssistantMessageArea = React32.forwardRef(
2923
3035
  handleIsTextStreaming,
2924
3036
  ...props
2925
3037
  }, ref) => {
2926
- (0, import_react11.useEffect)(() => {
3038
+ (0, import_react12.useEffect)(() => {
2927
3039
  messagesEndRef.current?.scrollIntoView({ behavior: "instant" });
2928
3040
  }, []);
2929
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3041
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
2930
3042
  "div",
2931
3043
  {
2932
3044
  ref,
2933
3045
  className: cn("p-6 overflow-y-auto flex-grow bg-background", className),
2934
3046
  ...props,
2935
3047
  children: [
2936
- messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3048
+ messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
2937
3049
  CallOut,
2938
3050
  {
2939
3051
  role: message.role,
2940
3052
  message,
2941
3053
  children: [
2942
- message.created_at && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-xs text-muted-foreground/80 pb-1", children: new Date(Number(message.created_at)).toLocaleString("es-ES", {
3054
+ message.created_at && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-xs text-muted-foreground/80 pb-1", children: new Date(Number(message.created_at)).toLocaleString("es-ES", {
2943
3055
  day: "2-digit",
2944
3056
  month: "2-digit",
2945
3057
  year: "numeric",
@@ -2948,8 +3060,8 @@ var AssistantMessageArea = React32.forwardRef(
2948
3060
  second: "2-digit",
2949
3061
  hour12: false
2950
3062
  }) }),
2951
- message.loading && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: thinkIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ThinkIndicator, {}) }),
2952
- message.error_code && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3063
+ message.loading && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: thinkIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ThinkIndicator, {}) }),
3064
+ message.error_code && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2953
3065
  CallOutResponse,
2954
3066
  {
2955
3067
  role: "assistant",
@@ -2957,7 +3069,7 @@ var AssistantMessageArea = React32.forwardRef(
2957
3069
  children: "We have an internal error, please try again later."
2958
3070
  }
2959
3071
  ),
2960
- message.content && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3072
+ message.content && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2961
3073
  CallOutResponse,
2962
3074
  {
2963
3075
  role: message.role,
@@ -2967,7 +3079,7 @@ var AssistantMessageArea = React32.forwardRef(
2967
3079
  children: message.content
2968
3080
  }
2969
3081
  ),
2970
- actions && streamingMessageId !== message.id && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3082
+ actions && streamingMessageId !== message.id && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2971
3083
  CallOutActions,
2972
3084
  {
2973
3085
  actions,
@@ -2980,14 +3092,14 @@ var AssistantMessageArea = React32.forwardRef(
2980
3092
  },
2981
3093
  message.id
2982
3094
  ) }, message.id)),
2983
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref: messagesEndRef })
3095
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref: messagesEndRef })
2984
3096
  ]
2985
3097
  }
2986
3098
  );
2987
3099
  }
2988
3100
  );
2989
3101
  AssistantMessageArea.displayName = "AssistantMessageArea";
2990
- var AssistantInput = React32.forwardRef(
3102
+ var AssistantInput = React33.forwardRef(
2991
3103
  ({
2992
3104
  className,
2993
3105
  sendMessageFunc,
@@ -2997,7 +3109,7 @@ var AssistantInput = React32.forwardRef(
2997
3109
  isMessageStreaming,
2998
3110
  ...props
2999
3111
  }, ref) => {
3000
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3112
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
3001
3113
  "form",
3002
3114
  {
3003
3115
  onSubmit: sendMessageFunc,
@@ -3005,7 +3117,7 @@ var AssistantInput = React32.forwardRef(
3005
3117
  ref,
3006
3118
  ...props,
3007
3119
  children: [
3008
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3120
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3009
3121
  "input",
3010
3122
  {
3011
3123
  type: "text",
@@ -3022,7 +3134,7 @@ var AssistantInput = React32.forwardRef(
3022
3134
  )
3023
3135
  }
3024
3136
  ),
3025
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3137
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3026
3138
  "button",
3027
3139
  {
3028
3140
  type: "submit",
@@ -3031,7 +3143,7 @@ var AssistantInput = React32.forwardRef(
3031
3143
  "w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send",
3032
3144
  isButtonDisabled ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
3033
3145
  ),
3034
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.Send, { className: "w-5 h-5" })
3146
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react14.Send, { className: "w-5 h-5" })
3035
3147
  }
3036
3148
  )
3037
3149
  ]
@@ -3045,11 +3157,11 @@ AssistantInput.displayName = "AssistantInput";
3045
3157
  var import_hooks = require("@alquimia-ai/tools/hooks");
3046
3158
 
3047
3159
  // src/components/hooks/use-document.tsx
3048
- var import_react12 = require("react");
3160
+ var import_react13 = require("react");
3049
3161
  var useDocumentReader = (url, getDocument) => {
3050
- const [loading, setLoading] = (0, import_react12.useState)(true);
3051
- const [error, setError] = (0, import_react12.useState)(null);
3052
- const [document2, setDocument] = (0, import_react12.useState)(null);
3162
+ const [loading, setLoading] = (0, import_react13.useState)(true);
3163
+ const [error, setError] = (0, import_react13.useState)(null);
3164
+ const [document2, setDocument] = (0, import_react13.useState)(null);
3053
3165
  const handleDocumentError = (error2) => {
3054
3166
  const errorMessage = "Hubo un error al obtener el documento. Por favor ponganse en contacto con el administrador.";
3055
3167
  setError(errorMessage);
@@ -3079,10 +3191,10 @@ var useDocumentReader = (url, getDocument) => {
3079
3191
  };
3080
3192
 
3081
3193
  // src/components/hooks/use-resize-observer.ts
3082
- var import_react13 = require("react");
3194
+ var import_react14 = require("react");
3083
3195
 
3084
3196
  // src/components/organisms/rating-dialog.tsx
3085
- var import_jsx_runtime47 = require("react/jsx-runtime");
3197
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3086
3198
  function RatingDialog({
3087
3199
  sendRating,
3088
3200
  topicId,
@@ -3098,20 +3210,20 @@ function RatingDialog({
3098
3210
  success ? setHasRatedTopic(true) : toast2({
3099
3211
  title: "Error",
3100
3212
  description: `Hubo un error al enviar la calificaci\xF3n`,
3101
- action: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToastAction, { altText: "Goto schedule to undo", children: "Cerrar" })
3213
+ action: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastAction, { altText: "Goto schedule to undo", children: "Cerrar" })
3102
3214
  });
3103
3215
  };
3104
3216
  const handleCancelRate = () => {
3105
3217
  setHasRatedTopic(true);
3106
3218
  onOpenChange(false);
3107
3219
  };
3108
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Dialog, { open: isOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(DialogContent, { className: "sm:max-w-md", children: [
3109
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(DialogHeader, { children: [
3110
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogTitle, { children: "Calific\xE1 esta conversaci\xF3n" }),
3111
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogDescription, { children: "Por favor, compart\xED tu opini\xF3n sobre el asistente." })
3220
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Dialog, { open: isOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DialogContent, { className: "sm:max-w-md", children: [
3221
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DialogHeader, { children: [
3222
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogTitle, { children: "Calific\xE1 esta conversaci\xF3n" }),
3223
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogDescription, { children: "Por favor, compart\xED tu opini\xF3n sobre el asistente." })
3112
3224
  ] }),
3113
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-row justify-center gap-4 py-4", children: [
3114
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3225
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-row justify-center gap-4 py-4", children: [
3226
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3115
3227
  RatingStars,
3116
3228
  {
3117
3229
  currentRating: ratingStars,
@@ -3120,7 +3232,7 @@ function RatingDialog({
3120
3232
  className: "p-2 rounded"
3121
3233
  }
3122
3234
  ),
3123
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3235
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3124
3236
  RatingThumbs,
3125
3237
  {
3126
3238
  currentRating: ratingComment,
@@ -3129,7 +3241,7 @@ function RatingDialog({
3129
3241
  isLoading
3130
3242
  }
3131
3243
  ),
3132
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3244
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3133
3245
  RatingComment,
3134
3246
  {
3135
3247
  currentRating: ratingComment,
@@ -3138,7 +3250,7 @@ function RatingDialog({
3138
3250
  }
3139
3251
  )
3140
3252
  ] }),
3141
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex flex-row justify-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Button, { onClick: handleCancelRate, variant: "secondary", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Typography, { as: "p", typeStyle: "tiny", children: "No, gracias." }) }) })
3253
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex flex-row justify-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, { onClick: handleCancelRate, variant: "secondary", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Typography, { as: "p", typeStyle: "tiny", children: "No, gracias." }) }) })
3142
3254
  ] }) });
3143
3255
  }
3144
3256