@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.
- package/dist/components/hooks/index.js +1 -1
- package/dist/components/hooks/index.js.map +1 -1
- package/dist/components/hooks/index.mjs +1 -1
- package/dist/components/hooks/index.mjs.map +1 -1
- package/dist/components/molecules/index.d.mts +15 -2
- package/dist/components/molecules/index.d.ts +15 -2
- package/dist/components/molecules/index.js +837 -725
- package/dist/components/molecules/index.js.map +1 -1
- package/dist/components/molecules/index.mjs +819 -707
- package/dist/components/molecules/index.mjs.map +1 -1
- package/dist/components/organisms/index.js +260 -149
- package/dist/components/organisms/index.js.map +1 -1
- package/dist/components/organisms/index.mjs +258 -147
- package/dist/components/organisms/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +265 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +263 -151
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -32
- package/src/components/atoms/index.ts +32 -0
- package/src/components/atoms/ui/alert.tsx +59 -0
- package/src/components/atoms/ui/aspect-ratio.tsx +7 -0
- package/src/components/atoms/ui/avatar.tsx +50 -0
- package/src/components/atoms/ui/badge.tsx +36 -0
- package/src/components/atoms/ui/breadcrumb.tsx +120 -0
- package/src/components/atoms/ui/button.tsx +56 -0
- package/src/components/atoms/ui/card.tsx +87 -0
- package/src/components/atoms/ui/checkbox.tsx +31 -0
- package/src/components/atoms/ui/command.tsx +155 -0
- package/src/components/atoms/ui/dialog.tsx +125 -0
- package/src/components/atoms/ui/drawer.tsx +119 -0
- package/src/components/atoms/ui/input.tsx +26 -0
- package/src/components/atoms/ui/label.tsx +26 -0
- package/src/components/atoms/ui/loader.tsx +52 -0
- package/src/components/atoms/ui/popover.tsx +31 -0
- package/src/components/atoms/ui/rich-text.tsx +19 -0
- package/src/components/atoms/ui/scroll-area.tsx +48 -0
- package/src/components/atoms/ui/select.tsx +160 -0
- package/src/components/atoms/ui/skeleton.tsx +15 -0
- package/src/components/atoms/ui/slider.tsx +29 -0
- package/src/components/atoms/ui/switch.tsx +30 -0
- package/src/components/atoms/ui/table.tsx +118 -0
- package/src/components/atoms/ui/tabs.tsx +56 -0
- package/src/components/atoms/ui/text-area/index.tsx +24 -0
- package/src/components/atoms/ui/textarea.tsx +25 -0
- package/src/components/atoms/ui/think-indicator.tsx +103 -0
- package/src/components/atoms/ui/toast.tsx +129 -0
- package/src/components/atoms/ui/toaster.tsx +38 -0
- package/src/components/atoms/ui/toggle.tsx +45 -0
- package/src/components/atoms/ui/typography/index.tsx +30 -0
- package/src/components/hooks/index.ts +4 -0
- package/src/components/hooks/use-document.tsx +44 -0
- package/src/components/hooks/use-resize-observer.ts +28 -0
- package/src/components/hooks/use-text-streaming.ts +63 -0
- package/src/components/hooks/use-toast.ts +194 -0
- package/src/components/index.ts +1 -0
- package/src/components/molecules/alert-dialog.tsx +141 -0
- package/src/components/molecules/assistant-button.tsx +148 -0
- package/src/components/molecules/call-out.tsx +163 -0
- package/src/components/molecules/carousel.tsx +262 -0
- package/src/components/molecules/documents/document-selector.tsx +79 -0
- package/src/components/molecules/documents/document-viewer.tsx +85 -0
- package/src/components/molecules/documents/index.ts +2 -0
- package/src/components/molecules/index.ts +11 -0
- package/src/components/molecules/navigation-menu.tsx +128 -0
- package/src/components/molecules/page-container.tsx +17 -0
- package/src/components/molecules/rating-comment.tsx +93 -0
- package/src/components/molecules/rating-stars.tsx +136 -0
- package/src/components/molecules/rating-thumbs.tsx +90 -0
- package/src/components/molecules/sidebar.tsx +107 -0
- package/src/components/molecules/sonner.tsx +30 -0
- package/src/components/molecules/viewers/index.ts +2 -0
- package/src/components/molecules/viewers/pdf-viewer.tsx +138 -0
- package/src/components/molecules/viewers/plain-text-viewer.tsx +40 -0
- package/src/components/organisms/assistant.tsx +271 -0
- package/src/components/organisms/index.ts +6 -0
- package/src/components/organisms/rating-dialog.tsx +104 -0
- package/src/components/organisms/speechToText.tsx +92 -0
- package/src/components/organisms/whisper.tsx +106 -0
- package/src/components/templates/cards/index.ts +2 -0
- package/src/components/templates/cards/with-image-heading-description-avatar.tsx +94 -0
- package/src/components/templates/cards/with-image-heading-description.tsx +63 -0
- package/src/components/templates/hero/index.tsx +39 -0
- package/src/components/templates/index.ts +4 -0
- package/src/components/templates/messages-window.tsx +15 -0
- package/src/components/templates/query-box.tsx +13 -0
- package/src/components/ui/input.tsx +25 -0
- package/src/components/ui/select.tsx +163 -0
- package/src/index.ts +7 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/utils.ts +34 -0
- package/src/styles/call-out.css +153 -0
- package/src/styles/drawer.css +28 -0
- package/src/styles/globals.css +69 -0
- package/src/styles/prose.css +51 -0
- package/src/styles/ratings.css +27 -0
- package/src/styles/themes/base-alquimia.css +95 -0
- package/src/styles/themes/base-nordic.css +83 -0
- package/src/styles/themes/base-primary.css +85 -0
- package/src/styles/themes/base.css +8 -0
- package/src/types/index.ts +1 -0
- package/src/types/type.ts +76 -0
|
@@ -162,8 +162,8 @@ function SpeechToText({
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// src/components/organisms/assistant.tsx
|
|
165
|
-
import * as
|
|
166
|
-
import { useEffect as
|
|
165
|
+
import * as React33 from "react";
|
|
166
|
+
import { useEffect as useEffect11 } from "react";
|
|
167
167
|
|
|
168
168
|
// src/components/atoms/ui/button.tsx
|
|
169
169
|
import * as React from "react";
|
|
@@ -1692,20 +1692,131 @@ var PageContainer = forwardRef26(
|
|
|
1692
1692
|
);
|
|
1693
1693
|
PageContainer.displayName = "PageContainer";
|
|
1694
1694
|
|
|
1695
|
-
// src/components/molecules/
|
|
1695
|
+
// src/components/molecules/assistant-button.tsx
|
|
1696
1696
|
import * as React25 from "react";
|
|
1697
|
+
import { useState as useState5 } from "react";
|
|
1698
|
+
import { jsx as jsx33, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1699
|
+
var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, className }, ref) => {
|
|
1700
|
+
return /* @__PURE__ */ jsx33(
|
|
1701
|
+
"div",
|
|
1702
|
+
{
|
|
1703
|
+
ref,
|
|
1704
|
+
className: cn(
|
|
1705
|
+
"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container",
|
|
1706
|
+
"transition-all duration-300",
|
|
1707
|
+
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4",
|
|
1708
|
+
className
|
|
1709
|
+
),
|
|
1710
|
+
children: /* @__PURE__ */ jsx33("div", { className: "rounded-lg p-2 pr-0 w-64", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs12(
|
|
1711
|
+
"button",
|
|
1712
|
+
{
|
|
1713
|
+
onClick: () => suggestion.action?.(),
|
|
1714
|
+
style: {
|
|
1715
|
+
transitionDelay: showSuggestions ? `${index * 50}ms` : "0ms"
|
|
1716
|
+
},
|
|
1717
|
+
className: cn(
|
|
1718
|
+
"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto",
|
|
1719
|
+
"text-primary hover:bg-secondary",
|
|
1720
|
+
"transition-all duration-100",
|
|
1721
|
+
"origin-bottom w-fit",
|
|
1722
|
+
"alq--assistant-suggestion",
|
|
1723
|
+
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
|
|
1724
|
+
),
|
|
1725
|
+
children: [
|
|
1726
|
+
/* @__PURE__ */ jsx33(suggestion.icon, { className: "w-5 h-5 text-primary" }),
|
|
1727
|
+
/* @__PURE__ */ jsx33("span", { className: "text-xs whitespace-nowrap font-normal", children: suggestion.label })
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1730
|
+
index
|
|
1731
|
+
)) })
|
|
1732
|
+
}
|
|
1733
|
+
);
|
|
1734
|
+
});
|
|
1735
|
+
AssistantSuggestions.displayName = "Suggestions";
|
|
1736
|
+
var AssistantButton = React25.forwardRef(
|
|
1737
|
+
({
|
|
1738
|
+
icon: Icon2,
|
|
1739
|
+
clickAction,
|
|
1740
|
+
className,
|
|
1741
|
+
suggestions = []
|
|
1742
|
+
}, ref) => {
|
|
1743
|
+
const [isVisible, setIsVisible] = useState5(false);
|
|
1744
|
+
const [showSuggestions, setShowSuggestions] = useState5(false);
|
|
1745
|
+
const handleMouseEnter = () => {
|
|
1746
|
+
setIsVisible(true);
|
|
1747
|
+
requestAnimationFrame(() => {
|
|
1748
|
+
requestAnimationFrame(() => {
|
|
1749
|
+
setShowSuggestions(true);
|
|
1750
|
+
});
|
|
1751
|
+
});
|
|
1752
|
+
};
|
|
1753
|
+
const handleMouseLeave = () => {
|
|
1754
|
+
setShowSuggestions(false);
|
|
1755
|
+
setTimeout(() => setIsVisible(false), 300);
|
|
1756
|
+
};
|
|
1757
|
+
return /* @__PURE__ */ jsx33(
|
|
1758
|
+
"div",
|
|
1759
|
+
{
|
|
1760
|
+
ref,
|
|
1761
|
+
className: cn(
|
|
1762
|
+
"fixed bottom-8 right-4 z-50",
|
|
1763
|
+
"alq--assistant-button-container",
|
|
1764
|
+
className
|
|
1765
|
+
),
|
|
1766
|
+
onMouseEnter: handleMouseEnter,
|
|
1767
|
+
onMouseLeave: handleMouseLeave,
|
|
1768
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "relative group", children: [
|
|
1769
|
+
isVisible && suggestions.length > 0 && /* @__PURE__ */ jsx33(
|
|
1770
|
+
AssistantSuggestions,
|
|
1771
|
+
{
|
|
1772
|
+
suggestions,
|
|
1773
|
+
showSuggestions
|
|
1774
|
+
}
|
|
1775
|
+
),
|
|
1776
|
+
/* @__PURE__ */ jsx33(
|
|
1777
|
+
Button,
|
|
1778
|
+
{
|
|
1779
|
+
variant: "outline",
|
|
1780
|
+
size: "sm",
|
|
1781
|
+
className: cn(
|
|
1782
|
+
"fixed hover:bg-opacity-70 transition-all duration-300",
|
|
1783
|
+
"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2",
|
|
1784
|
+
"shadow-md",
|
|
1785
|
+
"hover:shadow-lg",
|
|
1786
|
+
showSuggestions ? "scale-110" : "hover:scale-105",
|
|
1787
|
+
"alq--assistant-button"
|
|
1788
|
+
),
|
|
1789
|
+
onClick: clickAction,
|
|
1790
|
+
children: /* @__PURE__ */ jsx33(
|
|
1791
|
+
Icon2,
|
|
1792
|
+
{
|
|
1793
|
+
style: { width: "22px", height: "22px" },
|
|
1794
|
+
className: "text-primary"
|
|
1795
|
+
}
|
|
1796
|
+
)
|
|
1797
|
+
}
|
|
1798
|
+
)
|
|
1799
|
+
] })
|
|
1800
|
+
}
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1803
|
+
);
|
|
1804
|
+
AssistantButton.displayName = "AssistantButton";
|
|
1805
|
+
|
|
1806
|
+
// src/components/molecules/carousel.tsx
|
|
1807
|
+
import * as React26 from "react";
|
|
1697
1808
|
import useEmblaCarousel from "embla-carousel-react";
|
|
1698
1809
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
1699
|
-
import { jsx as
|
|
1700
|
-
var CarouselContext =
|
|
1810
|
+
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1811
|
+
var CarouselContext = React26.createContext(null);
|
|
1701
1812
|
function useCarousel() {
|
|
1702
|
-
const context =
|
|
1813
|
+
const context = React26.useContext(CarouselContext);
|
|
1703
1814
|
if (!context) {
|
|
1704
1815
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1705
1816
|
}
|
|
1706
1817
|
return context;
|
|
1707
1818
|
}
|
|
1708
|
-
var Carousel =
|
|
1819
|
+
var Carousel = React26.forwardRef(
|
|
1709
1820
|
({
|
|
1710
1821
|
orientation = "horizontal",
|
|
1711
1822
|
opts,
|
|
@@ -1722,22 +1833,22 @@ var Carousel = React25.forwardRef(
|
|
|
1722
1833
|
},
|
|
1723
1834
|
plugins
|
|
1724
1835
|
);
|
|
1725
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1726
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1727
|
-
const onSelect =
|
|
1836
|
+
const [canScrollPrev, setCanScrollPrev] = React26.useState(false);
|
|
1837
|
+
const [canScrollNext, setCanScrollNext] = React26.useState(false);
|
|
1838
|
+
const onSelect = React26.useCallback((api2) => {
|
|
1728
1839
|
if (!api2) {
|
|
1729
1840
|
return;
|
|
1730
1841
|
}
|
|
1731
1842
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1732
1843
|
setCanScrollNext(api2.canScrollNext());
|
|
1733
1844
|
}, []);
|
|
1734
|
-
const scrollPrev =
|
|
1845
|
+
const scrollPrev = React26.useCallback(() => {
|
|
1735
1846
|
api?.scrollPrev();
|
|
1736
1847
|
}, [api]);
|
|
1737
|
-
const scrollNext =
|
|
1848
|
+
const scrollNext = React26.useCallback(() => {
|
|
1738
1849
|
api?.scrollNext();
|
|
1739
1850
|
}, [api]);
|
|
1740
|
-
const handleKeyDown =
|
|
1851
|
+
const handleKeyDown = React26.useCallback(
|
|
1741
1852
|
(event) => {
|
|
1742
1853
|
if (event.key === "ArrowLeft") {
|
|
1743
1854
|
event.preventDefault();
|
|
@@ -1749,13 +1860,13 @@ var Carousel = React25.forwardRef(
|
|
|
1749
1860
|
},
|
|
1750
1861
|
[scrollPrev, scrollNext]
|
|
1751
1862
|
);
|
|
1752
|
-
|
|
1863
|
+
React26.useEffect(() => {
|
|
1753
1864
|
if (!api || !setApi) {
|
|
1754
1865
|
return;
|
|
1755
1866
|
}
|
|
1756
1867
|
setApi(api);
|
|
1757
1868
|
}, [api, setApi]);
|
|
1758
|
-
|
|
1869
|
+
React26.useEffect(() => {
|
|
1759
1870
|
if (!api) {
|
|
1760
1871
|
return;
|
|
1761
1872
|
}
|
|
@@ -1766,7 +1877,7 @@ var Carousel = React25.forwardRef(
|
|
|
1766
1877
|
api?.off("select", onSelect);
|
|
1767
1878
|
};
|
|
1768
1879
|
}, [api, onSelect]);
|
|
1769
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsx34(
|
|
1770
1881
|
CarouselContext.Provider,
|
|
1771
1882
|
{
|
|
1772
1883
|
value: {
|
|
@@ -1779,7 +1890,7 @@ var Carousel = React25.forwardRef(
|
|
|
1779
1890
|
canScrollPrev,
|
|
1780
1891
|
canScrollNext
|
|
1781
1892
|
},
|
|
1782
|
-
children: /* @__PURE__ */
|
|
1893
|
+
children: /* @__PURE__ */ jsx34(
|
|
1783
1894
|
"div",
|
|
1784
1895
|
{
|
|
1785
1896
|
ref,
|
|
@@ -1796,9 +1907,9 @@ var Carousel = React25.forwardRef(
|
|
|
1796
1907
|
}
|
|
1797
1908
|
);
|
|
1798
1909
|
Carousel.displayName = "Carousel";
|
|
1799
|
-
var CarouselContent =
|
|
1910
|
+
var CarouselContent = React26.forwardRef(({ className, ...props }, ref) => {
|
|
1800
1911
|
const { carouselRef, orientation } = useCarousel();
|
|
1801
|
-
return /* @__PURE__ */
|
|
1912
|
+
return /* @__PURE__ */ jsx34("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx34(
|
|
1802
1913
|
"div",
|
|
1803
1914
|
{
|
|
1804
1915
|
ref,
|
|
@@ -1812,9 +1923,9 @@ var CarouselContent = React25.forwardRef(({ className, ...props }, ref) => {
|
|
|
1812
1923
|
) });
|
|
1813
1924
|
});
|
|
1814
1925
|
CarouselContent.displayName = "CarouselContent";
|
|
1815
|
-
var CarouselItem =
|
|
1926
|
+
var CarouselItem = React26.forwardRef(({ className, ...props }, ref) => {
|
|
1816
1927
|
const { orientation } = useCarousel();
|
|
1817
|
-
return /* @__PURE__ */
|
|
1928
|
+
return /* @__PURE__ */ jsx34(
|
|
1818
1929
|
"div",
|
|
1819
1930
|
{
|
|
1820
1931
|
ref,
|
|
@@ -1830,9 +1941,9 @@ var CarouselItem = React25.forwardRef(({ className, ...props }, ref) => {
|
|
|
1830
1941
|
);
|
|
1831
1942
|
});
|
|
1832
1943
|
CarouselItem.displayName = "CarouselItem";
|
|
1833
|
-
var CarouselPrevious =
|
|
1944
|
+
var CarouselPrevious = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
1834
1945
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
1835
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsxs13(
|
|
1836
1947
|
Button,
|
|
1837
1948
|
{
|
|
1838
1949
|
ref,
|
|
@@ -1847,16 +1958,16 @@ var CarouselPrevious = React25.forwardRef(({ className, variant = "outline", siz
|
|
|
1847
1958
|
onClick: scrollPrev,
|
|
1848
1959
|
...props,
|
|
1849
1960
|
children: [
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ jsx34(ArrowLeft, { className: "h-4 w-4" }),
|
|
1962
|
+
/* @__PURE__ */ jsx34("span", { className: "sr-only", children: "Previous slide" })
|
|
1852
1963
|
]
|
|
1853
1964
|
}
|
|
1854
1965
|
);
|
|
1855
1966
|
});
|
|
1856
1967
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
1857
|
-
var CarouselNext =
|
|
1968
|
+
var CarouselNext = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
1858
1969
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
1859
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ jsxs13(
|
|
1860
1971
|
Button,
|
|
1861
1972
|
{
|
|
1862
1973
|
ref,
|
|
@@ -1871,8 +1982,8 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
|
|
|
1871
1982
|
onClick: scrollNext,
|
|
1872
1983
|
...props,
|
|
1873
1984
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ jsx34(ArrowRight, { className: "h-4 w-4" }),
|
|
1986
|
+
/* @__PURE__ */ jsx34("span", { className: "sr-only", children: "Next slide" })
|
|
1876
1987
|
]
|
|
1877
1988
|
}
|
|
1878
1989
|
);
|
|
@@ -1880,12 +1991,12 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
|
|
|
1880
1991
|
CarouselNext.displayName = "CarouselNext";
|
|
1881
1992
|
|
|
1882
1993
|
// src/components/molecules/navigation-menu.tsx
|
|
1883
|
-
import * as
|
|
1994
|
+
import * as React27 from "react";
|
|
1884
1995
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
1885
1996
|
import { cva as cva9 } from "class-variance-authority";
|
|
1886
1997
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
1887
|
-
import { jsx as
|
|
1888
|
-
var NavigationMenu =
|
|
1998
|
+
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1999
|
+
var NavigationMenu = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(
|
|
1889
2000
|
NavigationMenuPrimitive.Root,
|
|
1890
2001
|
{
|
|
1891
2002
|
ref,
|
|
@@ -1896,12 +2007,12 @@ var NavigationMenu = React26.forwardRef(({ className, children, ...props }, ref)
|
|
|
1896
2007
|
...props,
|
|
1897
2008
|
children: [
|
|
1898
2009
|
children,
|
|
1899
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ jsx35(NavigationMenuViewport, {})
|
|
1900
2011
|
]
|
|
1901
2012
|
}
|
|
1902
2013
|
));
|
|
1903
2014
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
1904
|
-
var NavigationMenuList =
|
|
2015
|
+
var NavigationMenuList = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1905
2016
|
NavigationMenuPrimitive.List,
|
|
1906
2017
|
{
|
|
1907
2018
|
ref,
|
|
@@ -1916,7 +2027,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
|
1916
2027
|
var navigationMenuTriggerStyle = cva9(
|
|
1917
2028
|
"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"
|
|
1918
2029
|
);
|
|
1919
|
-
var NavigationMenuTrigger =
|
|
2030
|
+
var NavigationMenuTrigger = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(
|
|
1920
2031
|
NavigationMenuPrimitive.Trigger,
|
|
1921
2032
|
{
|
|
1922
2033
|
ref,
|
|
@@ -1925,7 +2036,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
|
|
|
1925
2036
|
children: [
|
|
1926
2037
|
children,
|
|
1927
2038
|
" ",
|
|
1928
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ jsx35(
|
|
1929
2040
|
ChevronDown2,
|
|
1930
2041
|
{
|
|
1931
2042
|
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
@@ -1936,7 +2047,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
|
|
|
1936
2047
|
}
|
|
1937
2048
|
));
|
|
1938
2049
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
1939
|
-
var NavigationMenuContent =
|
|
2050
|
+
var NavigationMenuContent = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1940
2051
|
NavigationMenuPrimitive.Content,
|
|
1941
2052
|
{
|
|
1942
2053
|
ref,
|
|
@@ -1948,7 +2059,7 @@ var NavigationMenuContent = React26.forwardRef(({ className, ...props }, ref) =>
|
|
|
1948
2059
|
}
|
|
1949
2060
|
));
|
|
1950
2061
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
1951
|
-
var NavigationMenuViewport =
|
|
2062
|
+
var NavigationMenuViewport = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx35(
|
|
1952
2063
|
NavigationMenuPrimitive.Viewport,
|
|
1953
2064
|
{
|
|
1954
2065
|
className: cn(
|
|
@@ -1960,7 +2071,7 @@ var NavigationMenuViewport = React26.forwardRef(({ className, ...props }, ref) =
|
|
|
1960
2071
|
}
|
|
1961
2072
|
) }));
|
|
1962
2073
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
1963
|
-
var NavigationMenuIndicator =
|
|
2074
|
+
var NavigationMenuIndicator = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1964
2075
|
NavigationMenuPrimitive.Indicator,
|
|
1965
2076
|
{
|
|
1966
2077
|
ref,
|
|
@@ -1969,15 +2080,15 @@ var NavigationMenuIndicator = React26.forwardRef(({ className, ...props }, ref)
|
|
|
1969
2080
|
className
|
|
1970
2081
|
),
|
|
1971
2082
|
...props,
|
|
1972
|
-
children: /* @__PURE__ */
|
|
2083
|
+
children: /* @__PURE__ */ jsx35("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
1973
2084
|
}
|
|
1974
2085
|
));
|
|
1975
2086
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
1976
2087
|
|
|
1977
2088
|
// src/components/molecules/sidebar.tsx
|
|
1978
|
-
import * as
|
|
2089
|
+
import * as React28 from "react";
|
|
1979
2090
|
import { cva as cva10 } from "class-variance-authority";
|
|
1980
|
-
import { jsx as
|
|
2091
|
+
import { jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1981
2092
|
var sidebarVariants = cva10(
|
|
1982
2093
|
"flex flex-col border-r",
|
|
1983
2094
|
{
|
|
@@ -1993,7 +2104,7 @@ var sidebarVariants = cva10(
|
|
|
1993
2104
|
}
|
|
1994
2105
|
}
|
|
1995
2106
|
);
|
|
1996
|
-
var SidebarFooter =
|
|
2107
|
+
var SidebarFooter = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
1997
2108
|
"div",
|
|
1998
2109
|
{
|
|
1999
2110
|
ref,
|
|
@@ -2003,7 +2114,7 @@ var SidebarFooter = React27.forwardRef(({ className, children, ...props }, ref)
|
|
|
2003
2114
|
}
|
|
2004
2115
|
));
|
|
2005
2116
|
SidebarFooter.displayName = "SidebarFooter";
|
|
2006
|
-
var Sidebar =
|
|
2117
|
+
var Sidebar = React28.forwardRef(
|
|
2007
2118
|
({
|
|
2008
2119
|
className,
|
|
2009
2120
|
items,
|
|
@@ -2016,8 +2127,8 @@ var Sidebar = React27.forwardRef(
|
|
|
2016
2127
|
buttonClassName,
|
|
2017
2128
|
...props
|
|
2018
2129
|
}, ref) => {
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2130
|
+
return /* @__PURE__ */ jsx36("div", { className: cn(className, "alq--navigation-sidebar h-full"), ref, ...props, children: /* @__PURE__ */ jsxs15("aside", { className: cn(sidebarVariants({ size }), "h-full"), children: [
|
|
2131
|
+
/* @__PURE__ */ jsx36(ScrollArea, { className: "flex-grow justify-between", children: /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-2 p-4", children: items.map((item) => /* @__PURE__ */ jsxs15(
|
|
2021
2132
|
Button,
|
|
2022
2133
|
{
|
|
2023
2134
|
variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,
|
|
@@ -2029,13 +2140,13 @@ var Sidebar = React27.forwardRef(
|
|
|
2029
2140
|
}
|
|
2030
2141
|
},
|
|
2031
2142
|
children: [
|
|
2032
|
-
item.icon && /* @__PURE__ */
|
|
2143
|
+
item.icon && /* @__PURE__ */ jsx36(item.icon, { className: "mr-2 h-4 w-4" }),
|
|
2033
2144
|
item.name
|
|
2034
2145
|
]
|
|
2035
2146
|
},
|
|
2036
2147
|
item.name
|
|
2037
2148
|
)) }) }),
|
|
2038
|
-
footerContent && /* @__PURE__ */
|
|
2149
|
+
footerContent && /* @__PURE__ */ jsx36(SidebarFooter, { children: footerContent })
|
|
2039
2150
|
] }) });
|
|
2040
2151
|
}
|
|
2041
2152
|
);
|
|
@@ -2043,17 +2154,17 @@ var Sidebar = React27.forwardRef(
|
|
|
2043
2154
|
// src/components/molecules/sonner.tsx
|
|
2044
2155
|
import { useTheme } from "next-themes";
|
|
2045
2156
|
import { Toaster as Sonner } from "sonner";
|
|
2046
|
-
import { jsx as
|
|
2157
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2047
2158
|
|
|
2048
2159
|
// src/components/molecules/rating-stars.tsx
|
|
2049
|
-
import * as
|
|
2160
|
+
import * as React29 from "react";
|
|
2050
2161
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2051
2162
|
import { Star } from "lucide-react";
|
|
2052
|
-
import { jsx as
|
|
2163
|
+
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2053
2164
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2054
2165
|
var Tooltip = TooltipPrimitive.Root;
|
|
2055
2166
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2056
|
-
var TooltipContent =
|
|
2167
|
+
var TooltipContent = React29.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
2057
2168
|
TooltipPrimitive.Content,
|
|
2058
2169
|
{
|
|
2059
2170
|
ref,
|
|
@@ -2066,14 +2177,14 @@ var TooltipContent = React28.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
2066
2177
|
}
|
|
2067
2178
|
));
|
|
2068
2179
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2069
|
-
var StarRating =
|
|
2180
|
+
var StarRating = React29.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ jsx38("div", { ref, className: "flex", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx38(
|
|
2070
2181
|
Button,
|
|
2071
2182
|
{
|
|
2072
2183
|
onClick: () => onRate(star),
|
|
2073
2184
|
variant: "link",
|
|
2074
2185
|
className: "p-1 transition-colors [&_svg]:size-5 h-5",
|
|
2075
2186
|
"aria-label": `Rate ${star} star${star !== 1 ? "s" : ""}`,
|
|
2076
|
-
children: /* @__PURE__ */
|
|
2187
|
+
children: /* @__PURE__ */ jsx38(
|
|
2077
2188
|
Star,
|
|
2078
2189
|
{
|
|
2079
2190
|
className: cn(
|
|
@@ -2086,19 +2197,19 @@ var StarRating = React28.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */
|
|
|
2086
2197
|
star
|
|
2087
2198
|
)) }));
|
|
2088
2199
|
StarRating.displayName = "StarRating";
|
|
2089
|
-
var RatingStars =
|
|
2200
|
+
var RatingStars = React29.forwardRef(({
|
|
2090
2201
|
currentRating = 0,
|
|
2091
2202
|
onRate,
|
|
2092
2203
|
className,
|
|
2093
2204
|
isLoading
|
|
2094
2205
|
}, ref) => {
|
|
2095
|
-
const [open, setOpen] =
|
|
2096
|
-
const [animate, setAnimate] =
|
|
2206
|
+
const [open, setOpen] = React29.useState(false);
|
|
2207
|
+
const [animate, setAnimate] = React29.useState(false);
|
|
2097
2208
|
const handleRate = (rating) => {
|
|
2098
2209
|
onRate(rating);
|
|
2099
2210
|
setOpen(false);
|
|
2100
2211
|
};
|
|
2101
|
-
|
|
2212
|
+
React29.useEffect(() => {
|
|
2102
2213
|
if (currentRating > 0) {
|
|
2103
2214
|
setAnimate(true);
|
|
2104
2215
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
@@ -2106,8 +2217,8 @@ var RatingStars = React28.forwardRef(({
|
|
|
2106
2217
|
}
|
|
2107
2218
|
}, [currentRating]);
|
|
2108
2219
|
const hasRated = currentRating > 0;
|
|
2109
|
-
return /* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2220
|
+
return /* @__PURE__ */ jsx38(TooltipProvider, { children: /* @__PURE__ */ jsxs16(Tooltip, { open, onOpenChange: setOpen, children: [
|
|
2221
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
2111
2222
|
Button,
|
|
2112
2223
|
{
|
|
2113
2224
|
ref,
|
|
@@ -2118,7 +2229,7 @@ var RatingStars = React28.forwardRef(({
|
|
|
2118
2229
|
),
|
|
2119
2230
|
disabled: isLoading,
|
|
2120
2231
|
onClick: () => setOpen(!open),
|
|
2121
|
-
children: /* @__PURE__ */
|
|
2232
|
+
children: /* @__PURE__ */ jsx38(
|
|
2122
2233
|
Star,
|
|
2123
2234
|
{
|
|
2124
2235
|
className: cn(
|
|
@@ -2131,7 +2242,7 @@ var RatingStars = React28.forwardRef(({
|
|
|
2131
2242
|
)
|
|
2132
2243
|
}
|
|
2133
2244
|
) }),
|
|
2134
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx38(TooltipContent, { side: "top", align: "center", className: "p-0", children: /* @__PURE__ */ jsx38("div", { className: "p-2 bg-background", children: /* @__PURE__ */ jsx38(
|
|
2135
2246
|
StarRating,
|
|
2136
2247
|
{
|
|
2137
2248
|
rating: currentRating,
|
|
@@ -2143,10 +2254,10 @@ var RatingStars = React28.forwardRef(({
|
|
|
2143
2254
|
RatingStars.displayName = "RatingStars";
|
|
2144
2255
|
|
|
2145
2256
|
// src/components/molecules/rating-thumbs.tsx
|
|
2146
|
-
import * as
|
|
2257
|
+
import * as React30 from "react";
|
|
2147
2258
|
import { ThumbsUp, ThumbsDown } from "lucide-react";
|
|
2148
|
-
import { jsx as
|
|
2149
|
-
var RatingThumbs =
|
|
2259
|
+
import { jsx as jsx39, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2260
|
+
var RatingThumbs = React30.forwardRef(
|
|
2150
2261
|
({
|
|
2151
2262
|
currentRating,
|
|
2152
2263
|
onRate,
|
|
@@ -2154,15 +2265,15 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2154
2265
|
className,
|
|
2155
2266
|
isLoading
|
|
2156
2267
|
}, ref) => {
|
|
2157
|
-
const [animate, setAnimate] =
|
|
2158
|
-
|
|
2268
|
+
const [animate, setAnimate] = React30.useState(false);
|
|
2269
|
+
React30.useEffect(() => {
|
|
2159
2270
|
if (currentRating) {
|
|
2160
2271
|
setAnimate(true);
|
|
2161
2272
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2162
2273
|
return () => clearTimeout(timer);
|
|
2163
2274
|
}
|
|
2164
2275
|
}, [currentRating]);
|
|
2165
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ jsxs17(
|
|
2166
2277
|
"div",
|
|
2167
2278
|
{
|
|
2168
2279
|
ref,
|
|
@@ -2173,7 +2284,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2173
2284
|
className
|
|
2174
2285
|
),
|
|
2175
2286
|
children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ jsx39(
|
|
2177
2288
|
Button,
|
|
2178
2289
|
{
|
|
2179
2290
|
variant: "link",
|
|
@@ -2184,7 +2295,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2184
2295
|
),
|
|
2185
2296
|
"aria-label": "Thumbs up",
|
|
2186
2297
|
disabled: isLoading,
|
|
2187
|
-
children: /* @__PURE__ */
|
|
2298
|
+
children: /* @__PURE__ */ jsx39(
|
|
2188
2299
|
ThumbsUp,
|
|
2189
2300
|
{
|
|
2190
2301
|
className: cn(
|
|
@@ -2197,7 +2308,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2197
2308
|
)
|
|
2198
2309
|
}
|
|
2199
2310
|
),
|
|
2200
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsx39(
|
|
2201
2312
|
Button,
|
|
2202
2313
|
{
|
|
2203
2314
|
variant: "link",
|
|
@@ -2208,7 +2319,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2208
2319
|
),
|
|
2209
2320
|
"aria-label": "Thumbs down",
|
|
2210
2321
|
disabled: isLoading,
|
|
2211
|
-
children: /* @__PURE__ */
|
|
2322
|
+
children: /* @__PURE__ */ jsx39(
|
|
2212
2323
|
ThumbsDown,
|
|
2213
2324
|
{
|
|
2214
2325
|
className: cn(
|
|
@@ -2229,30 +2340,30 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2229
2340
|
RatingThumbs.displayName = "RatingThumbs";
|
|
2230
2341
|
|
|
2231
2342
|
// src/components/molecules/rating-comment.tsx
|
|
2232
|
-
import * as
|
|
2343
|
+
import * as React31 from "react";
|
|
2233
2344
|
import { Book } from "lucide-react";
|
|
2234
|
-
import { jsx as
|
|
2235
|
-
var RatingComment =
|
|
2345
|
+
import { jsx as jsx40, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2346
|
+
var RatingComment = React31.forwardRef(
|
|
2236
2347
|
({ currentRating, onRate, className, isLoading }, ref) => {
|
|
2237
|
-
const [open, setOpen] =
|
|
2238
|
-
const [comment, setComment] =
|
|
2239
|
-
const [animate, setAnimate] =
|
|
2348
|
+
const [open, setOpen] = React31.useState(false);
|
|
2349
|
+
const [comment, setComment] = React31.useState("");
|
|
2350
|
+
const [animate, setAnimate] = React31.useState(false);
|
|
2240
2351
|
const handleRate = () => {
|
|
2241
2352
|
onRate(comment);
|
|
2242
2353
|
setOpen(false);
|
|
2243
2354
|
};
|
|
2244
|
-
|
|
2355
|
+
React31.useEffect(() => {
|
|
2245
2356
|
if (currentRating) {
|
|
2246
2357
|
setAnimate(true);
|
|
2247
2358
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2248
2359
|
return () => clearTimeout(timer);
|
|
2249
2360
|
}
|
|
2250
2361
|
}, [currentRating]);
|
|
2251
|
-
|
|
2362
|
+
React31.useEffect(() => {
|
|
2252
2363
|
setComment("");
|
|
2253
2364
|
}, [open]);
|
|
2254
|
-
return /* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2365
|
+
return /* @__PURE__ */ jsxs18(Dialog, { open, onOpenChange: setOpen, children: [
|
|
2366
|
+
/* @__PURE__ */ jsx40(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(
|
|
2256
2367
|
Button,
|
|
2257
2368
|
{
|
|
2258
2369
|
ref,
|
|
@@ -2263,7 +2374,7 @@ var RatingComment = React30.forwardRef(
|
|
|
2263
2374
|
className
|
|
2264
2375
|
),
|
|
2265
2376
|
disabled: isLoading,
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2377
|
+
children: /* @__PURE__ */ jsx40(
|
|
2267
2378
|
Book,
|
|
2268
2379
|
{
|
|
2269
2380
|
className: cn(
|
|
@@ -2276,10 +2387,10 @@ var RatingComment = React30.forwardRef(
|
|
|
2276
2387
|
)
|
|
2277
2388
|
}
|
|
2278
2389
|
) }),
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx40(DialogOverlay, { className: "fixed inset-0 bg-black bg-opacity-50" }),
|
|
2391
|
+
/* @__PURE__ */ jsxs18(DialogContent, { "aria-describedby": void 0, children: [
|
|
2392
|
+
/* @__PURE__ */ jsx40(DialogTitle, { className: "text-lg font-medium", children: "Deja un comentario" }),
|
|
2393
|
+
/* @__PURE__ */ jsx40(
|
|
2283
2394
|
"textarea",
|
|
2284
2395
|
{
|
|
2285
2396
|
className: "mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",
|
|
@@ -2288,7 +2399,7 @@ var RatingComment = React30.forwardRef(
|
|
|
2288
2399
|
onChange: (e) => setComment(e.target.value)
|
|
2289
2400
|
}
|
|
2290
2401
|
),
|
|
2291
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx40("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ jsx40(
|
|
2292
2403
|
Button,
|
|
2293
2404
|
{
|
|
2294
2405
|
onClick: handleRate,
|
|
@@ -2303,27 +2414,27 @@ var RatingComment = React30.forwardRef(
|
|
|
2303
2414
|
RatingComment.displayName = "RatingComment";
|
|
2304
2415
|
|
|
2305
2416
|
// src/components/molecules/call-out.tsx
|
|
2306
|
-
import * as
|
|
2417
|
+
import * as React32 from "react";
|
|
2307
2418
|
|
|
2308
2419
|
// src/components/hooks/use-text-streaming.ts
|
|
2309
|
-
import { useEffect as
|
|
2420
|
+
import { useEffect as useEffect10, useRef, useState as useState10 } from "react";
|
|
2310
2421
|
var CHAR_DELAY = 25;
|
|
2311
2422
|
var PUNCTUATION_DELAY = 200;
|
|
2312
2423
|
var PUNCTUATION_MARKS = [".", "!", "?", ";", ":"];
|
|
2313
2424
|
function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
2314
|
-
const [displayedContent, setDisplayedContent] =
|
|
2425
|
+
const [displayedContent, setDisplayedContent] = useState10("");
|
|
2315
2426
|
const timeoutId = useRef(null);
|
|
2316
2427
|
const hasStartedStreaming = useRef(false);
|
|
2317
2428
|
const getDelayForChar = (text, position) => {
|
|
2318
2429
|
if (position === 0) return CHAR_DELAY;
|
|
2319
|
-
const previousChar = text[position - 1];
|
|
2430
|
+
const previousChar = text[position - 1] || "";
|
|
2320
2431
|
const isEllipsis = text.slice(position - 1, position + 2) === "...";
|
|
2321
2432
|
if (isEllipsis) {
|
|
2322
2433
|
return CHAR_DELAY;
|
|
2323
2434
|
}
|
|
2324
2435
|
return PUNCTUATION_MARKS.includes(previousChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
|
|
2325
2436
|
};
|
|
2326
|
-
|
|
2437
|
+
useEffect10(() => {
|
|
2327
2438
|
if (!shouldStream && !hasStartedStreaming.current) {
|
|
2328
2439
|
setDisplayedContent(content);
|
|
2329
2440
|
handleIsTextStreaming?.(false);
|
|
@@ -2353,9 +2464,9 @@ function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
|
2353
2464
|
}
|
|
2354
2465
|
|
|
2355
2466
|
// src/components/molecules/call-out.tsx
|
|
2356
|
-
import { jsx as
|
|
2357
|
-
var CallOut =
|
|
2358
|
-
return /* @__PURE__ */
|
|
2467
|
+
import { jsx as jsx41, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2468
|
+
var CallOut = React32.forwardRef(({ className, children, role, ...props }, ref) => {
|
|
2469
|
+
return /* @__PURE__ */ jsx41(
|
|
2359
2470
|
"div",
|
|
2360
2471
|
{
|
|
2361
2472
|
ref,
|
|
@@ -2366,8 +2477,8 @@ var CallOut = React31.forwardRef(({ className, children, role, ...props }, ref)
|
|
|
2366
2477
|
}
|
|
2367
2478
|
);
|
|
2368
2479
|
});
|
|
2369
|
-
var CallOutDate =
|
|
2370
|
-
return /* @__PURE__ */
|
|
2480
|
+
var CallOutDate = React32.forwardRef(({ className, children, ...props }, ref) => {
|
|
2481
|
+
return /* @__PURE__ */ jsx41(
|
|
2371
2482
|
"div",
|
|
2372
2483
|
{
|
|
2373
2484
|
ref,
|
|
@@ -2381,13 +2492,13 @@ var CallOutDate = React31.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2381
2492
|
}
|
|
2382
2493
|
);
|
|
2383
2494
|
});
|
|
2384
|
-
var CallOutActions =
|
|
2385
|
-
const [isLoading, setIsLoading] =
|
|
2386
|
-
const [isClicked, setIsClicked] =
|
|
2495
|
+
var CallOutActions = React32.forwardRef(({ className, actions, role, message, ...props }, ref) => {
|
|
2496
|
+
const [isLoading, setIsLoading] = React32.useState(false);
|
|
2497
|
+
const [isClicked, setIsClicked] = React32.useState(false);
|
|
2387
2498
|
if (role === "user") {
|
|
2388
2499
|
return null;
|
|
2389
2500
|
}
|
|
2390
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsx41("div", { ref, className: cn("alq--callout-actions", className), ...props, children: actions.map((action) => /* @__PURE__ */ jsxs19(
|
|
2391
2502
|
"button",
|
|
2392
2503
|
{
|
|
2393
2504
|
className: cn(
|
|
@@ -2409,7 +2520,7 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
|
|
|
2409
2520
|
});
|
|
2410
2521
|
},
|
|
2411
2522
|
children: [
|
|
2412
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx41(
|
|
2413
2524
|
"span",
|
|
2414
2525
|
{
|
|
2415
2526
|
className: cn("alq-action-icon-wrapper", {
|
|
@@ -2418,18 +2529,18 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
|
|
|
2418
2529
|
children: action.icon
|
|
2419
2530
|
}
|
|
2420
2531
|
),
|
|
2421
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ jsx41("label", { children: action.label })
|
|
2422
2533
|
]
|
|
2423
2534
|
},
|
|
2424
2535
|
action.label
|
|
2425
2536
|
)) });
|
|
2426
2537
|
});
|
|
2427
|
-
var CallOutResponse =
|
|
2538
|
+
var CallOutResponse = React32.forwardRef(
|
|
2428
2539
|
({ className, children, role, additionalInfo, isStreaming, handleIsTextStreaming, ...props }, ref) => {
|
|
2429
2540
|
const content = String(children || "");
|
|
2430
2541
|
const shouldStream = role === "assistant" && isStreaming;
|
|
2431
2542
|
const displayedContent = useTextStreaming(content, shouldStream ?? false, handleIsTextStreaming);
|
|
2432
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ jsxs19(
|
|
2433
2544
|
"div",
|
|
2434
2545
|
{
|
|
2435
2546
|
ref,
|
|
@@ -2442,8 +2553,8 @@ var CallOutResponse = React31.forwardRef(
|
|
|
2442
2553
|
),
|
|
2443
2554
|
...props,
|
|
2444
2555
|
children: [
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
additionalInfo && /* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx41(RichText, { content: displayedContent }),
|
|
2557
|
+
additionalInfo && /* @__PURE__ */ jsx41(
|
|
2447
2558
|
"div",
|
|
2448
2559
|
{
|
|
2449
2560
|
className: cn(
|
|
@@ -2466,19 +2577,19 @@ CallOutResponse.displayName = "CallOutResponse";
|
|
|
2466
2577
|
|
|
2467
2578
|
// src/components/organisms/assistant.tsx
|
|
2468
2579
|
import { Send } from "lucide-react";
|
|
2469
|
-
import { jsx as
|
|
2470
|
-
var Assistant =
|
|
2580
|
+
import { jsx as jsx42, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2581
|
+
var Assistant = React33.forwardRef(
|
|
2471
2582
|
({ className, sdk, title, description, children, ...props }, ref) => {
|
|
2472
|
-
return /* @__PURE__ */
|
|
2583
|
+
return /* @__PURE__ */ jsxs20(
|
|
2473
2584
|
"div",
|
|
2474
2585
|
{
|
|
2475
2586
|
ref,
|
|
2476
2587
|
className: cn("flex flex-col h-full bg-background text-foreground", className),
|
|
2477
2588
|
...props,
|
|
2478
2589
|
children: [
|
|
2479
|
-
(title || description) && /* @__PURE__ */
|
|
2480
|
-
title && /* @__PURE__ */
|
|
2481
|
-
description && /* @__PURE__ */
|
|
2590
|
+
(title || description) && /* @__PURE__ */ jsxs20(AssistantHeader, { children: [
|
|
2591
|
+
title && /* @__PURE__ */ jsx42(AssistantTitle, { title }),
|
|
2592
|
+
description && /* @__PURE__ */ jsx42(AssistantDescription, { description })
|
|
2482
2593
|
] }),
|
|
2483
2594
|
children
|
|
2484
2595
|
]
|
|
@@ -2487,14 +2598,14 @@ var Assistant = React32.forwardRef(
|
|
|
2487
2598
|
}
|
|
2488
2599
|
);
|
|
2489
2600
|
Assistant.displayName = "Assistant";
|
|
2490
|
-
var AssistantTitle =
|
|
2491
|
-
({ className, title, ...props }, ref) => /* @__PURE__ */
|
|
2601
|
+
var AssistantTitle = React33.forwardRef(
|
|
2602
|
+
({ className, title, ...props }, ref) => /* @__PURE__ */ jsx42("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ jsx42(Typography, { typeStyle: "heading1", as: "h1", children: title }) })
|
|
2492
2603
|
);
|
|
2493
2604
|
AssistantTitle.displayName = "AssistantTitle";
|
|
2494
|
-
var AssistantDescription =
|
|
2605
|
+
var AssistantDescription = React33.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ jsx42("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ jsx42(Typography, { typeStyle: "display", as: "p", children: description }) }));
|
|
2495
2606
|
AssistantDescription.displayName = "AssistantDescription";
|
|
2496
|
-
var AssistantHeader =
|
|
2497
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
2607
|
+
var AssistantHeader = React33.forwardRef(
|
|
2608
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
2498
2609
|
"div",
|
|
2499
2610
|
{
|
|
2500
2611
|
ref,
|
|
@@ -2505,7 +2616,7 @@ var AssistantHeader = React32.forwardRef(
|
|
|
2505
2616
|
)
|
|
2506
2617
|
);
|
|
2507
2618
|
AssistantHeader.displayName = "AssistantHeader";
|
|
2508
|
-
var AssistantMessageArea =
|
|
2619
|
+
var AssistantMessageArea = React33.forwardRef(
|
|
2509
2620
|
({
|
|
2510
2621
|
className,
|
|
2511
2622
|
messages,
|
|
@@ -2516,23 +2627,23 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2516
2627
|
handleIsTextStreaming,
|
|
2517
2628
|
...props
|
|
2518
2629
|
}, ref) => {
|
|
2519
|
-
|
|
2630
|
+
useEffect11(() => {
|
|
2520
2631
|
messagesEndRef.current?.scrollIntoView({ behavior: "instant" });
|
|
2521
2632
|
}, []);
|
|
2522
|
-
return /* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ jsxs20(
|
|
2523
2634
|
"div",
|
|
2524
2635
|
{
|
|
2525
2636
|
ref,
|
|
2526
2637
|
className: cn("p-6 overflow-y-auto flex-grow bg-background", className),
|
|
2527
2638
|
...props,
|
|
2528
2639
|
children: [
|
|
2529
|
-
messages.map((message) => /* @__PURE__ */
|
|
2640
|
+
messages.map((message) => /* @__PURE__ */ jsx42("div", { children: /* @__PURE__ */ jsxs20(
|
|
2530
2641
|
CallOut,
|
|
2531
2642
|
{
|
|
2532
2643
|
role: message.role,
|
|
2533
2644
|
message,
|
|
2534
2645
|
children: [
|
|
2535
|
-
message.created_at && /* @__PURE__ */
|
|
2646
|
+
message.created_at && /* @__PURE__ */ jsx42("div", { className: "text-xs text-muted-foreground/80 pb-1", children: new Date(Number(message.created_at)).toLocaleString("es-ES", {
|
|
2536
2647
|
day: "2-digit",
|
|
2537
2648
|
month: "2-digit",
|
|
2538
2649
|
year: "numeric",
|
|
@@ -2541,8 +2652,8 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2541
2652
|
second: "2-digit",
|
|
2542
2653
|
hour12: false
|
|
2543
2654
|
}) }),
|
|
2544
|
-
message.loading && /* @__PURE__ */
|
|
2545
|
-
message.error_code && /* @__PURE__ */
|
|
2655
|
+
message.loading && /* @__PURE__ */ jsx42("div", { children: thinkIndicator ?? /* @__PURE__ */ jsx42(ThinkIndicator, {}) }),
|
|
2656
|
+
message.error_code && /* @__PURE__ */ jsx42(
|
|
2546
2657
|
CallOutResponse,
|
|
2547
2658
|
{
|
|
2548
2659
|
role: "assistant",
|
|
@@ -2550,7 +2661,7 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2550
2661
|
children: "We have an internal error, please try again later."
|
|
2551
2662
|
}
|
|
2552
2663
|
),
|
|
2553
|
-
message.content && /* @__PURE__ */
|
|
2664
|
+
message.content && /* @__PURE__ */ jsx42(
|
|
2554
2665
|
CallOutResponse,
|
|
2555
2666
|
{
|
|
2556
2667
|
role: message.role,
|
|
@@ -2560,7 +2671,7 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2560
2671
|
children: message.content
|
|
2561
2672
|
}
|
|
2562
2673
|
),
|
|
2563
|
-
actions && streamingMessageId !== message.id && /* @__PURE__ */
|
|
2674
|
+
actions && streamingMessageId !== message.id && /* @__PURE__ */ jsx42(
|
|
2564
2675
|
CallOutActions,
|
|
2565
2676
|
{
|
|
2566
2677
|
actions,
|
|
@@ -2573,14 +2684,14 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2573
2684
|
},
|
|
2574
2685
|
message.id
|
|
2575
2686
|
) }, message.id)),
|
|
2576
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx42("div", { ref: messagesEndRef })
|
|
2577
2688
|
]
|
|
2578
2689
|
}
|
|
2579
2690
|
);
|
|
2580
2691
|
}
|
|
2581
2692
|
);
|
|
2582
2693
|
AssistantMessageArea.displayName = "AssistantMessageArea";
|
|
2583
|
-
var AssistantInput =
|
|
2694
|
+
var AssistantInput = React33.forwardRef(
|
|
2584
2695
|
({
|
|
2585
2696
|
className,
|
|
2586
2697
|
sendMessageFunc,
|
|
@@ -2590,7 +2701,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2590
2701
|
isMessageStreaming,
|
|
2591
2702
|
...props
|
|
2592
2703
|
}, ref) => {
|
|
2593
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ jsxs20(
|
|
2594
2705
|
"form",
|
|
2595
2706
|
{
|
|
2596
2707
|
onSubmit: sendMessageFunc,
|
|
@@ -2598,7 +2709,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2598
2709
|
ref,
|
|
2599
2710
|
...props,
|
|
2600
2711
|
children: [
|
|
2601
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx42(
|
|
2602
2713
|
"input",
|
|
2603
2714
|
{
|
|
2604
2715
|
type: "text",
|
|
@@ -2615,7 +2726,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2615
2726
|
)
|
|
2616
2727
|
}
|
|
2617
2728
|
),
|
|
2618
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ jsx42(
|
|
2619
2730
|
"button",
|
|
2620
2731
|
{
|
|
2621
2732
|
type: "submit",
|
|
@@ -2624,7 +2735,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2624
2735
|
"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send",
|
|
2625
2736
|
isButtonDisabled ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
2626
2737
|
),
|
|
2627
|
-
children: /* @__PURE__ */
|
|
2738
|
+
children: /* @__PURE__ */ jsx42(Send, { className: "w-5 h-5" })
|
|
2628
2739
|
}
|
|
2629
2740
|
)
|
|
2630
2741
|
]
|
|
@@ -2638,13 +2749,13 @@ AssistantInput.displayName = "AssistantInput";
|
|
|
2638
2749
|
import { useRatings } from "@alquimia-ai/tools/hooks";
|
|
2639
2750
|
|
|
2640
2751
|
// src/components/hooks/use-document.tsx
|
|
2641
|
-
import { useState as
|
|
2752
|
+
import { useState as useState12 } from "react";
|
|
2642
2753
|
|
|
2643
2754
|
// src/components/hooks/use-resize-observer.ts
|
|
2644
|
-
import { useEffect as
|
|
2755
|
+
import { useEffect as useEffect12, useRef as useRef2 } from "react";
|
|
2645
2756
|
|
|
2646
2757
|
// src/components/organisms/rating-dialog.tsx
|
|
2647
|
-
import { jsx as
|
|
2758
|
+
import { jsx as jsx43, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2648
2759
|
function RatingDialog({
|
|
2649
2760
|
sendRating,
|
|
2650
2761
|
topicId,
|
|
@@ -2660,20 +2771,20 @@ function RatingDialog({
|
|
|
2660
2771
|
success ? setHasRatedTopic(true) : toast2({
|
|
2661
2772
|
title: "Error",
|
|
2662
2773
|
description: `Hubo un error al enviar la calificaci\xF3n`,
|
|
2663
|
-
action: /* @__PURE__ */
|
|
2774
|
+
action: /* @__PURE__ */ jsx43(ToastAction, { altText: "Goto schedule to undo", children: "Cerrar" })
|
|
2664
2775
|
});
|
|
2665
2776
|
};
|
|
2666
2777
|
const handleCancelRate = () => {
|
|
2667
2778
|
setHasRatedTopic(true);
|
|
2668
2779
|
onOpenChange(false);
|
|
2669
2780
|
};
|
|
2670
|
-
return /* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2781
|
+
return /* @__PURE__ */ jsx43(Dialog, { open: isOpen, onOpenChange, children: /* @__PURE__ */ jsxs21(DialogContent, { className: "sm:max-w-md", children: [
|
|
2782
|
+
/* @__PURE__ */ jsxs21(DialogHeader, { children: [
|
|
2783
|
+
/* @__PURE__ */ jsx43(DialogTitle, { children: "Calific\xE1 esta conversaci\xF3n" }),
|
|
2784
|
+
/* @__PURE__ */ jsx43(DialogDescription, { children: "Por favor, compart\xED tu opini\xF3n sobre el asistente." })
|
|
2674
2785
|
] }),
|
|
2675
|
-
/* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2786
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-row justify-center gap-4 py-4", children: [
|
|
2787
|
+
/* @__PURE__ */ jsx43(
|
|
2677
2788
|
RatingStars,
|
|
2678
2789
|
{
|
|
2679
2790
|
currentRating: ratingStars,
|
|
@@ -2682,7 +2793,7 @@ function RatingDialog({
|
|
|
2682
2793
|
className: "p-2 rounded"
|
|
2683
2794
|
}
|
|
2684
2795
|
),
|
|
2685
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ jsx43(
|
|
2686
2797
|
RatingThumbs,
|
|
2687
2798
|
{
|
|
2688
2799
|
currentRating: ratingComment,
|
|
@@ -2691,7 +2802,7 @@ function RatingDialog({
|
|
|
2691
2802
|
isLoading
|
|
2692
2803
|
}
|
|
2693
2804
|
),
|
|
2694
|
-
/* @__PURE__ */
|
|
2805
|
+
/* @__PURE__ */ jsx43(
|
|
2695
2806
|
RatingComment,
|
|
2696
2807
|
{
|
|
2697
2808
|
currentRating: ratingComment,
|
|
@@ -2700,7 +2811,7 @@ function RatingDialog({
|
|
|
2700
2811
|
}
|
|
2701
2812
|
)
|
|
2702
2813
|
] }),
|
|
2703
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx43("div", { className: "flex flex-row justify-center gap-4", children: /* @__PURE__ */ jsx43(Button, { onClick: handleCancelRate, variant: "secondary", children: /* @__PURE__ */ jsx43(Typography, { as: "p", typeStyle: "tiny", children: "No, gracias." }) }) })
|
|
2704
2815
|
] }) });
|
|
2705
2816
|
}
|
|
2706
2817
|
export {
|