@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
package/dist/index.mjs
CHANGED
|
@@ -1860,8 +1860,8 @@ function SpeechToText({
|
|
|
1860
1860
|
}
|
|
1861
1861
|
|
|
1862
1862
|
// src/components/organisms/assistant.tsx
|
|
1863
|
-
import * as
|
|
1864
|
-
import { useEffect as
|
|
1863
|
+
import * as React33 from "react";
|
|
1864
|
+
import { useEffect as useEffect11 } from "react";
|
|
1865
1865
|
|
|
1866
1866
|
// src/components/molecules/page-container.tsx
|
|
1867
1867
|
import { forwardRef as forwardRef29 } from "react";
|
|
@@ -1880,20 +1880,131 @@ var PageContainer = forwardRef29(
|
|
|
1880
1880
|
);
|
|
1881
1881
|
PageContainer.displayName = "PageContainer";
|
|
1882
1882
|
|
|
1883
|
-
// src/components/molecules/
|
|
1883
|
+
// src/components/molecules/assistant-button.tsx
|
|
1884
1884
|
import * as React25 from "react";
|
|
1885
|
+
import { useState as useState5 } from "react";
|
|
1886
|
+
import { jsx as jsx38, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1887
|
+
var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, className }, ref) => {
|
|
1888
|
+
return /* @__PURE__ */ jsx38(
|
|
1889
|
+
"div",
|
|
1890
|
+
{
|
|
1891
|
+
ref,
|
|
1892
|
+
className: cn(
|
|
1893
|
+
"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container",
|
|
1894
|
+
"transition-all duration-300",
|
|
1895
|
+
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4",
|
|
1896
|
+
className
|
|
1897
|
+
),
|
|
1898
|
+
children: /* @__PURE__ */ jsx38("div", { className: "rounded-lg p-2 pr-0 w-64", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs14(
|
|
1899
|
+
"button",
|
|
1900
|
+
{
|
|
1901
|
+
onClick: () => suggestion.action?.(),
|
|
1902
|
+
style: {
|
|
1903
|
+
transitionDelay: showSuggestions ? `${index * 50}ms` : "0ms"
|
|
1904
|
+
},
|
|
1905
|
+
className: cn(
|
|
1906
|
+
"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto",
|
|
1907
|
+
"text-primary hover:bg-secondary",
|
|
1908
|
+
"transition-all duration-100",
|
|
1909
|
+
"origin-bottom w-fit",
|
|
1910
|
+
"alq--assistant-suggestion",
|
|
1911
|
+
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
|
|
1912
|
+
),
|
|
1913
|
+
children: [
|
|
1914
|
+
/* @__PURE__ */ jsx38(suggestion.icon, { className: "w-5 h-5 text-primary" }),
|
|
1915
|
+
/* @__PURE__ */ jsx38("span", { className: "text-xs whitespace-nowrap font-normal", children: suggestion.label })
|
|
1916
|
+
]
|
|
1917
|
+
},
|
|
1918
|
+
index
|
|
1919
|
+
)) })
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
});
|
|
1923
|
+
AssistantSuggestions.displayName = "Suggestions";
|
|
1924
|
+
var AssistantButton = React25.forwardRef(
|
|
1925
|
+
({
|
|
1926
|
+
icon: Icon2,
|
|
1927
|
+
clickAction,
|
|
1928
|
+
className,
|
|
1929
|
+
suggestions = []
|
|
1930
|
+
}, ref) => {
|
|
1931
|
+
const [isVisible, setIsVisible] = useState5(false);
|
|
1932
|
+
const [showSuggestions, setShowSuggestions] = useState5(false);
|
|
1933
|
+
const handleMouseEnter = () => {
|
|
1934
|
+
setIsVisible(true);
|
|
1935
|
+
requestAnimationFrame(() => {
|
|
1936
|
+
requestAnimationFrame(() => {
|
|
1937
|
+
setShowSuggestions(true);
|
|
1938
|
+
});
|
|
1939
|
+
});
|
|
1940
|
+
};
|
|
1941
|
+
const handleMouseLeave = () => {
|
|
1942
|
+
setShowSuggestions(false);
|
|
1943
|
+
setTimeout(() => setIsVisible(false), 300);
|
|
1944
|
+
};
|
|
1945
|
+
return /* @__PURE__ */ jsx38(
|
|
1946
|
+
"div",
|
|
1947
|
+
{
|
|
1948
|
+
ref,
|
|
1949
|
+
className: cn(
|
|
1950
|
+
"fixed bottom-8 right-4 z-50",
|
|
1951
|
+
"alq--assistant-button-container",
|
|
1952
|
+
className
|
|
1953
|
+
),
|
|
1954
|
+
onMouseEnter: handleMouseEnter,
|
|
1955
|
+
onMouseLeave: handleMouseLeave,
|
|
1956
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "relative group", children: [
|
|
1957
|
+
isVisible && suggestions.length > 0 && /* @__PURE__ */ jsx38(
|
|
1958
|
+
AssistantSuggestions,
|
|
1959
|
+
{
|
|
1960
|
+
suggestions,
|
|
1961
|
+
showSuggestions
|
|
1962
|
+
}
|
|
1963
|
+
),
|
|
1964
|
+
/* @__PURE__ */ jsx38(
|
|
1965
|
+
Button,
|
|
1966
|
+
{
|
|
1967
|
+
variant: "outline",
|
|
1968
|
+
size: "sm",
|
|
1969
|
+
className: cn(
|
|
1970
|
+
"fixed hover:bg-opacity-70 transition-all duration-300",
|
|
1971
|
+
"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2",
|
|
1972
|
+
"shadow-md",
|
|
1973
|
+
"hover:shadow-lg",
|
|
1974
|
+
showSuggestions ? "scale-110" : "hover:scale-105",
|
|
1975
|
+
"alq--assistant-button"
|
|
1976
|
+
),
|
|
1977
|
+
onClick: clickAction,
|
|
1978
|
+
children: /* @__PURE__ */ jsx38(
|
|
1979
|
+
Icon2,
|
|
1980
|
+
{
|
|
1981
|
+
style: { width: "22px", height: "22px" },
|
|
1982
|
+
className: "text-primary"
|
|
1983
|
+
}
|
|
1984
|
+
)
|
|
1985
|
+
}
|
|
1986
|
+
)
|
|
1987
|
+
] })
|
|
1988
|
+
}
|
|
1989
|
+
);
|
|
1990
|
+
}
|
|
1991
|
+
);
|
|
1992
|
+
AssistantButton.displayName = "AssistantButton";
|
|
1993
|
+
|
|
1994
|
+
// src/components/molecules/carousel.tsx
|
|
1995
|
+
import * as React26 from "react";
|
|
1885
1996
|
import useEmblaCarousel from "embla-carousel-react";
|
|
1886
1997
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
1887
|
-
import { jsx as
|
|
1888
|
-
var CarouselContext =
|
|
1998
|
+
import { jsx as jsx39, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1999
|
+
var CarouselContext = React26.createContext(null);
|
|
1889
2000
|
function useCarousel() {
|
|
1890
|
-
const context =
|
|
2001
|
+
const context = React26.useContext(CarouselContext);
|
|
1891
2002
|
if (!context) {
|
|
1892
2003
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1893
2004
|
}
|
|
1894
2005
|
return context;
|
|
1895
2006
|
}
|
|
1896
|
-
var Carousel =
|
|
2007
|
+
var Carousel = React26.forwardRef(
|
|
1897
2008
|
({
|
|
1898
2009
|
orientation = "horizontal",
|
|
1899
2010
|
opts,
|
|
@@ -1910,22 +2021,22 @@ var Carousel = React25.forwardRef(
|
|
|
1910
2021
|
},
|
|
1911
2022
|
plugins
|
|
1912
2023
|
);
|
|
1913
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1914
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1915
|
-
const onSelect =
|
|
2024
|
+
const [canScrollPrev, setCanScrollPrev] = React26.useState(false);
|
|
2025
|
+
const [canScrollNext, setCanScrollNext] = React26.useState(false);
|
|
2026
|
+
const onSelect = React26.useCallback((api2) => {
|
|
1916
2027
|
if (!api2) {
|
|
1917
2028
|
return;
|
|
1918
2029
|
}
|
|
1919
2030
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1920
2031
|
setCanScrollNext(api2.canScrollNext());
|
|
1921
2032
|
}, []);
|
|
1922
|
-
const scrollPrev =
|
|
2033
|
+
const scrollPrev = React26.useCallback(() => {
|
|
1923
2034
|
api?.scrollPrev();
|
|
1924
2035
|
}, [api]);
|
|
1925
|
-
const scrollNext =
|
|
2036
|
+
const scrollNext = React26.useCallback(() => {
|
|
1926
2037
|
api?.scrollNext();
|
|
1927
2038
|
}, [api]);
|
|
1928
|
-
const handleKeyDown =
|
|
2039
|
+
const handleKeyDown = React26.useCallback(
|
|
1929
2040
|
(event) => {
|
|
1930
2041
|
if (event.key === "ArrowLeft") {
|
|
1931
2042
|
event.preventDefault();
|
|
@@ -1937,13 +2048,13 @@ var Carousel = React25.forwardRef(
|
|
|
1937
2048
|
},
|
|
1938
2049
|
[scrollPrev, scrollNext]
|
|
1939
2050
|
);
|
|
1940
|
-
|
|
2051
|
+
React26.useEffect(() => {
|
|
1941
2052
|
if (!api || !setApi) {
|
|
1942
2053
|
return;
|
|
1943
2054
|
}
|
|
1944
2055
|
setApi(api);
|
|
1945
2056
|
}, [api, setApi]);
|
|
1946
|
-
|
|
2057
|
+
React26.useEffect(() => {
|
|
1947
2058
|
if (!api) {
|
|
1948
2059
|
return;
|
|
1949
2060
|
}
|
|
@@ -1954,7 +2065,7 @@ var Carousel = React25.forwardRef(
|
|
|
1954
2065
|
api?.off("select", onSelect);
|
|
1955
2066
|
};
|
|
1956
2067
|
}, [api, onSelect]);
|
|
1957
|
-
return /* @__PURE__ */
|
|
2068
|
+
return /* @__PURE__ */ jsx39(
|
|
1958
2069
|
CarouselContext.Provider,
|
|
1959
2070
|
{
|
|
1960
2071
|
value: {
|
|
@@ -1967,7 +2078,7 @@ var Carousel = React25.forwardRef(
|
|
|
1967
2078
|
canScrollPrev,
|
|
1968
2079
|
canScrollNext
|
|
1969
2080
|
},
|
|
1970
|
-
children: /* @__PURE__ */
|
|
2081
|
+
children: /* @__PURE__ */ jsx39(
|
|
1971
2082
|
"div",
|
|
1972
2083
|
{
|
|
1973
2084
|
ref,
|
|
@@ -1984,9 +2095,9 @@ var Carousel = React25.forwardRef(
|
|
|
1984
2095
|
}
|
|
1985
2096
|
);
|
|
1986
2097
|
Carousel.displayName = "Carousel";
|
|
1987
|
-
var CarouselContent =
|
|
2098
|
+
var CarouselContent = React26.forwardRef(({ className, ...props }, ref) => {
|
|
1988
2099
|
const { carouselRef, orientation } = useCarousel();
|
|
1989
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ jsx39("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx39(
|
|
1990
2101
|
"div",
|
|
1991
2102
|
{
|
|
1992
2103
|
ref,
|
|
@@ -2000,9 +2111,9 @@ var CarouselContent = React25.forwardRef(({ className, ...props }, ref) => {
|
|
|
2000
2111
|
) });
|
|
2001
2112
|
});
|
|
2002
2113
|
CarouselContent.displayName = "CarouselContent";
|
|
2003
|
-
var CarouselItem =
|
|
2114
|
+
var CarouselItem = React26.forwardRef(({ className, ...props }, ref) => {
|
|
2004
2115
|
const { orientation } = useCarousel();
|
|
2005
|
-
return /* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ jsx39(
|
|
2006
2117
|
"div",
|
|
2007
2118
|
{
|
|
2008
2119
|
ref,
|
|
@@ -2018,9 +2129,9 @@ var CarouselItem = React25.forwardRef(({ className, ...props }, ref) => {
|
|
|
2018
2129
|
);
|
|
2019
2130
|
});
|
|
2020
2131
|
CarouselItem.displayName = "CarouselItem";
|
|
2021
|
-
var CarouselPrevious =
|
|
2132
|
+
var CarouselPrevious = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
2022
2133
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
2023
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ jsxs15(
|
|
2024
2135
|
Button,
|
|
2025
2136
|
{
|
|
2026
2137
|
ref,
|
|
@@ -2035,16 +2146,16 @@ var CarouselPrevious = React25.forwardRef(({ className, variant = "outline", siz
|
|
|
2035
2146
|
onClick: scrollPrev,
|
|
2036
2147
|
...props,
|
|
2037
2148
|
children: [
|
|
2038
|
-
/* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ jsx39(ArrowLeft, { className: "h-4 w-4" }),
|
|
2150
|
+
/* @__PURE__ */ jsx39("span", { className: "sr-only", children: "Previous slide" })
|
|
2040
2151
|
]
|
|
2041
2152
|
}
|
|
2042
2153
|
);
|
|
2043
2154
|
});
|
|
2044
2155
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
2045
|
-
var CarouselNext =
|
|
2156
|
+
var CarouselNext = React26.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
2046
2157
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
2047
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ jsxs15(
|
|
2048
2159
|
Button,
|
|
2049
2160
|
{
|
|
2050
2161
|
ref,
|
|
@@ -2059,8 +2170,8 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
|
|
|
2059
2170
|
onClick: scrollNext,
|
|
2060
2171
|
...props,
|
|
2061
2172
|
children: [
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx39(ArrowRight, { className: "h-4 w-4" }),
|
|
2174
|
+
/* @__PURE__ */ jsx39("span", { className: "sr-only", children: "Next slide" })
|
|
2064
2175
|
]
|
|
2065
2176
|
}
|
|
2066
2177
|
);
|
|
@@ -2068,12 +2179,12 @@ var CarouselNext = React25.forwardRef(({ className, variant = "outline", size =
|
|
|
2068
2179
|
CarouselNext.displayName = "CarouselNext";
|
|
2069
2180
|
|
|
2070
2181
|
// src/components/molecules/navigation-menu.tsx
|
|
2071
|
-
import * as
|
|
2182
|
+
import * as React27 from "react";
|
|
2072
2183
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
2073
2184
|
import { cva as cva9 } from "class-variance-authority";
|
|
2074
2185
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
2075
|
-
import { jsx as
|
|
2076
|
-
var NavigationMenu =
|
|
2186
|
+
import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2187
|
+
var NavigationMenu = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
2077
2188
|
NavigationMenuPrimitive.Root,
|
|
2078
2189
|
{
|
|
2079
2190
|
ref,
|
|
@@ -2084,12 +2195,12 @@ var NavigationMenu = React26.forwardRef(({ className, children, ...props }, ref)
|
|
|
2084
2195
|
...props,
|
|
2085
2196
|
children: [
|
|
2086
2197
|
children,
|
|
2087
|
-
/* @__PURE__ */
|
|
2198
|
+
/* @__PURE__ */ jsx40(NavigationMenuViewport, {})
|
|
2088
2199
|
]
|
|
2089
2200
|
}
|
|
2090
2201
|
));
|
|
2091
2202
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
2092
|
-
var NavigationMenuList =
|
|
2203
|
+
var NavigationMenuList = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
2093
2204
|
NavigationMenuPrimitive.List,
|
|
2094
2205
|
{
|
|
2095
2206
|
ref,
|
|
@@ -2105,7 +2216,7 @@ var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
|
2105
2216
|
var navigationMenuTriggerStyle = cva9(
|
|
2106
2217
|
"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"
|
|
2107
2218
|
);
|
|
2108
|
-
var NavigationMenuTrigger =
|
|
2219
|
+
var NavigationMenuTrigger = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
2109
2220
|
NavigationMenuPrimitive.Trigger,
|
|
2110
2221
|
{
|
|
2111
2222
|
ref,
|
|
@@ -2114,7 +2225,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
|
|
|
2114
2225
|
children: [
|
|
2115
2226
|
children,
|
|
2116
2227
|
" ",
|
|
2117
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsx40(
|
|
2118
2229
|
ChevronDown2,
|
|
2119
2230
|
{
|
|
2120
2231
|
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
@@ -2125,7 +2236,7 @@ var NavigationMenuTrigger = React26.forwardRef(({ className, children, ...props
|
|
|
2125
2236
|
}
|
|
2126
2237
|
));
|
|
2127
2238
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
2128
|
-
var NavigationMenuContent =
|
|
2239
|
+
var NavigationMenuContent = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
2129
2240
|
NavigationMenuPrimitive.Content,
|
|
2130
2241
|
{
|
|
2131
2242
|
ref,
|
|
@@ -2138,7 +2249,7 @@ var NavigationMenuContent = React26.forwardRef(({ className, ...props }, ref) =>
|
|
|
2138
2249
|
));
|
|
2139
2250
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
2140
2251
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
2141
|
-
var NavigationMenuViewport =
|
|
2252
|
+
var NavigationMenuViewport = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx40(
|
|
2142
2253
|
NavigationMenuPrimitive.Viewport,
|
|
2143
2254
|
{
|
|
2144
2255
|
className: cn(
|
|
@@ -2150,7 +2261,7 @@ var NavigationMenuViewport = React26.forwardRef(({ className, ...props }, ref) =
|
|
|
2150
2261
|
}
|
|
2151
2262
|
) }));
|
|
2152
2263
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
2153
|
-
var NavigationMenuIndicator =
|
|
2264
|
+
var NavigationMenuIndicator = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
2154
2265
|
NavigationMenuPrimitive.Indicator,
|
|
2155
2266
|
{
|
|
2156
2267
|
ref,
|
|
@@ -2159,15 +2270,15 @@ var NavigationMenuIndicator = React26.forwardRef(({ className, ...props }, ref)
|
|
|
2159
2270
|
className
|
|
2160
2271
|
),
|
|
2161
2272
|
...props,
|
|
2162
|
-
children: /* @__PURE__ */
|
|
2273
|
+
children: /* @__PURE__ */ jsx40("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
2163
2274
|
}
|
|
2164
2275
|
));
|
|
2165
2276
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
2166
2277
|
|
|
2167
2278
|
// src/components/molecules/sidebar.tsx
|
|
2168
|
-
import * as
|
|
2279
|
+
import * as React28 from "react";
|
|
2169
2280
|
import { cva as cva10 } from "class-variance-authority";
|
|
2170
|
-
import { jsx as
|
|
2281
|
+
import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2171
2282
|
var sidebarVariants = cva10(
|
|
2172
2283
|
"flex flex-col border-r",
|
|
2173
2284
|
{
|
|
@@ -2183,7 +2294,7 @@ var sidebarVariants = cva10(
|
|
|
2183
2294
|
}
|
|
2184
2295
|
}
|
|
2185
2296
|
);
|
|
2186
|
-
var SidebarFooter =
|
|
2297
|
+
var SidebarFooter = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
2187
2298
|
"div",
|
|
2188
2299
|
{
|
|
2189
2300
|
ref,
|
|
@@ -2193,7 +2304,7 @@ var SidebarFooter = React27.forwardRef(({ className, children, ...props }, ref)
|
|
|
2193
2304
|
}
|
|
2194
2305
|
));
|
|
2195
2306
|
SidebarFooter.displayName = "SidebarFooter";
|
|
2196
|
-
var Sidebar =
|
|
2307
|
+
var Sidebar = React28.forwardRef(
|
|
2197
2308
|
({
|
|
2198
2309
|
className,
|
|
2199
2310
|
items,
|
|
@@ -2206,8 +2317,8 @@ var Sidebar = React27.forwardRef(
|
|
|
2206
2317
|
buttonClassName,
|
|
2207
2318
|
...props
|
|
2208
2319
|
}, ref) => {
|
|
2209
|
-
return /* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ jsx41("div", { className: cn(className, "alq--navigation-sidebar h-full"), ref, ...props, children: /* @__PURE__ */ jsxs17("aside", { className: cn(sidebarVariants({ size }), "h-full"), children: [
|
|
2321
|
+
/* @__PURE__ */ jsx41(ScrollArea, { className: "flex-grow justify-between", children: /* @__PURE__ */ jsx41("div", { className: "flex flex-col gap-2 p-4", children: items.map((item) => /* @__PURE__ */ jsxs17(
|
|
2211
2322
|
Button,
|
|
2212
2323
|
{
|
|
2213
2324
|
variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,
|
|
@@ -2219,13 +2330,13 @@ var Sidebar = React27.forwardRef(
|
|
|
2219
2330
|
}
|
|
2220
2331
|
},
|
|
2221
2332
|
children: [
|
|
2222
|
-
item.icon && /* @__PURE__ */
|
|
2333
|
+
item.icon && /* @__PURE__ */ jsx41(item.icon, { className: "mr-2 h-4 w-4" }),
|
|
2223
2334
|
item.name
|
|
2224
2335
|
]
|
|
2225
2336
|
},
|
|
2226
2337
|
item.name
|
|
2227
2338
|
)) }) }),
|
|
2228
|
-
footerContent && /* @__PURE__ */
|
|
2339
|
+
footerContent && /* @__PURE__ */ jsx41(SidebarFooter, { children: footerContent })
|
|
2229
2340
|
] }) });
|
|
2230
2341
|
}
|
|
2231
2342
|
);
|
|
@@ -2233,10 +2344,10 @@ var Sidebar = React27.forwardRef(
|
|
|
2233
2344
|
// src/components/molecules/sonner.tsx
|
|
2234
2345
|
import { useTheme } from "next-themes";
|
|
2235
2346
|
import { Toaster as Sonner } from "sonner";
|
|
2236
|
-
import { jsx as
|
|
2347
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2237
2348
|
var Toaster2 = ({ ...props }) => {
|
|
2238
2349
|
const { theme = "system" } = useTheme();
|
|
2239
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx42(
|
|
2240
2351
|
Sonner,
|
|
2241
2352
|
{
|
|
2242
2353
|
theme,
|
|
@@ -2255,14 +2366,14 @@ var Toaster2 = ({ ...props }) => {
|
|
|
2255
2366
|
};
|
|
2256
2367
|
|
|
2257
2368
|
// src/components/molecules/rating-stars.tsx
|
|
2258
|
-
import * as
|
|
2369
|
+
import * as React29 from "react";
|
|
2259
2370
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2260
2371
|
import { Star } from "lucide-react";
|
|
2261
|
-
import { jsx as
|
|
2372
|
+
import { jsx as jsx43, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2262
2373
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2263
2374
|
var Tooltip = TooltipPrimitive.Root;
|
|
2264
2375
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2265
|
-
var TooltipContent =
|
|
2376
|
+
var TooltipContent = React29.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
2266
2377
|
TooltipPrimitive.Content,
|
|
2267
2378
|
{
|
|
2268
2379
|
ref,
|
|
@@ -2275,14 +2386,14 @@ var TooltipContent = React28.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
2275
2386
|
}
|
|
2276
2387
|
));
|
|
2277
2388
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2278
|
-
var StarRating =
|
|
2389
|
+
var StarRating = React29.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ jsx43("div", { ref, className: "flex", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx43(
|
|
2279
2390
|
Button,
|
|
2280
2391
|
{
|
|
2281
2392
|
onClick: () => onRate(star),
|
|
2282
2393
|
variant: "link",
|
|
2283
2394
|
className: "p-1 transition-colors [&_svg]:size-5 h-5",
|
|
2284
2395
|
"aria-label": `Rate ${star} star${star !== 1 ? "s" : ""}`,
|
|
2285
|
-
children: /* @__PURE__ */
|
|
2396
|
+
children: /* @__PURE__ */ jsx43(
|
|
2286
2397
|
Star,
|
|
2287
2398
|
{
|
|
2288
2399
|
className: cn(
|
|
@@ -2295,19 +2406,19 @@ var StarRating = React28.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */
|
|
|
2295
2406
|
star
|
|
2296
2407
|
)) }));
|
|
2297
2408
|
StarRating.displayName = "StarRating";
|
|
2298
|
-
var RatingStars =
|
|
2409
|
+
var RatingStars = React29.forwardRef(({
|
|
2299
2410
|
currentRating = 0,
|
|
2300
2411
|
onRate,
|
|
2301
2412
|
className,
|
|
2302
2413
|
isLoading
|
|
2303
2414
|
}, ref) => {
|
|
2304
|
-
const [open, setOpen] =
|
|
2305
|
-
const [animate, setAnimate] =
|
|
2415
|
+
const [open, setOpen] = React29.useState(false);
|
|
2416
|
+
const [animate, setAnimate] = React29.useState(false);
|
|
2306
2417
|
const handleRate = (rating) => {
|
|
2307
2418
|
onRate(rating);
|
|
2308
2419
|
setOpen(false);
|
|
2309
2420
|
};
|
|
2310
|
-
|
|
2421
|
+
React29.useEffect(() => {
|
|
2311
2422
|
if (currentRating > 0) {
|
|
2312
2423
|
setAnimate(true);
|
|
2313
2424
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
@@ -2315,8 +2426,8 @@ var RatingStars = React28.forwardRef(({
|
|
|
2315
2426
|
}
|
|
2316
2427
|
}, [currentRating]);
|
|
2317
2428
|
const hasRated = currentRating > 0;
|
|
2318
|
-
return /* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ jsx43(TooltipProvider, { children: /* @__PURE__ */ jsxs18(Tooltip, { open, onOpenChange: setOpen, children: [
|
|
2430
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(
|
|
2320
2431
|
Button,
|
|
2321
2432
|
{
|
|
2322
2433
|
ref,
|
|
@@ -2327,7 +2438,7 @@ var RatingStars = React28.forwardRef(({
|
|
|
2327
2438
|
),
|
|
2328
2439
|
disabled: isLoading,
|
|
2329
2440
|
onClick: () => setOpen(!open),
|
|
2330
|
-
children: /* @__PURE__ */
|
|
2441
|
+
children: /* @__PURE__ */ jsx43(
|
|
2331
2442
|
Star,
|
|
2332
2443
|
{
|
|
2333
2444
|
className: cn(
|
|
@@ -2340,7 +2451,7 @@ var RatingStars = React28.forwardRef(({
|
|
|
2340
2451
|
)
|
|
2341
2452
|
}
|
|
2342
2453
|
) }),
|
|
2343
|
-
/* @__PURE__ */
|
|
2454
|
+
/* @__PURE__ */ jsx43(TooltipContent, { side: "top", align: "center", className: "p-0", children: /* @__PURE__ */ jsx43("div", { className: "p-2 bg-background", children: /* @__PURE__ */ jsx43(
|
|
2344
2455
|
StarRating,
|
|
2345
2456
|
{
|
|
2346
2457
|
rating: currentRating,
|
|
@@ -2352,10 +2463,10 @@ var RatingStars = React28.forwardRef(({
|
|
|
2352
2463
|
RatingStars.displayName = "RatingStars";
|
|
2353
2464
|
|
|
2354
2465
|
// src/components/molecules/rating-thumbs.tsx
|
|
2355
|
-
import * as
|
|
2466
|
+
import * as React30 from "react";
|
|
2356
2467
|
import { ThumbsUp, ThumbsDown } from "lucide-react";
|
|
2357
|
-
import { jsx as
|
|
2358
|
-
var RatingThumbs =
|
|
2468
|
+
import { jsx as jsx44, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2469
|
+
var RatingThumbs = React30.forwardRef(
|
|
2359
2470
|
({
|
|
2360
2471
|
currentRating,
|
|
2361
2472
|
onRate,
|
|
@@ -2363,15 +2474,15 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2363
2474
|
className,
|
|
2364
2475
|
isLoading
|
|
2365
2476
|
}, ref) => {
|
|
2366
|
-
const [animate, setAnimate] =
|
|
2367
|
-
|
|
2477
|
+
const [animate, setAnimate] = React30.useState(false);
|
|
2478
|
+
React30.useEffect(() => {
|
|
2368
2479
|
if (currentRating) {
|
|
2369
2480
|
setAnimate(true);
|
|
2370
2481
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2371
2482
|
return () => clearTimeout(timer);
|
|
2372
2483
|
}
|
|
2373
2484
|
}, [currentRating]);
|
|
2374
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsxs19(
|
|
2375
2486
|
"div",
|
|
2376
2487
|
{
|
|
2377
2488
|
ref,
|
|
@@ -2382,7 +2493,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2382
2493
|
className
|
|
2383
2494
|
),
|
|
2384
2495
|
children: [
|
|
2385
|
-
/* @__PURE__ */
|
|
2496
|
+
/* @__PURE__ */ jsx44(
|
|
2386
2497
|
Button,
|
|
2387
2498
|
{
|
|
2388
2499
|
variant: "link",
|
|
@@ -2393,7 +2504,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2393
2504
|
),
|
|
2394
2505
|
"aria-label": "Thumbs up",
|
|
2395
2506
|
disabled: isLoading,
|
|
2396
|
-
children: /* @__PURE__ */
|
|
2507
|
+
children: /* @__PURE__ */ jsx44(
|
|
2397
2508
|
ThumbsUp,
|
|
2398
2509
|
{
|
|
2399
2510
|
className: cn(
|
|
@@ -2406,7 +2517,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2406
2517
|
)
|
|
2407
2518
|
}
|
|
2408
2519
|
),
|
|
2409
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx44(
|
|
2410
2521
|
Button,
|
|
2411
2522
|
{
|
|
2412
2523
|
variant: "link",
|
|
@@ -2417,7 +2528,7 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2417
2528
|
),
|
|
2418
2529
|
"aria-label": "Thumbs down",
|
|
2419
2530
|
disabled: isLoading,
|
|
2420
|
-
children: /* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ jsx44(
|
|
2421
2532
|
ThumbsDown,
|
|
2422
2533
|
{
|
|
2423
2534
|
className: cn(
|
|
@@ -2438,30 +2549,30 @@ var RatingThumbs = React29.forwardRef(
|
|
|
2438
2549
|
RatingThumbs.displayName = "RatingThumbs";
|
|
2439
2550
|
|
|
2440
2551
|
// src/components/molecules/rating-comment.tsx
|
|
2441
|
-
import * as
|
|
2552
|
+
import * as React31 from "react";
|
|
2442
2553
|
import { Book } from "lucide-react";
|
|
2443
|
-
import { jsx as
|
|
2444
|
-
var RatingComment =
|
|
2554
|
+
import { jsx as jsx45, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2555
|
+
var RatingComment = React31.forwardRef(
|
|
2445
2556
|
({ currentRating, onRate, className, isLoading }, ref) => {
|
|
2446
|
-
const [open, setOpen] =
|
|
2447
|
-
const [comment, setComment] =
|
|
2448
|
-
const [animate, setAnimate] =
|
|
2557
|
+
const [open, setOpen] = React31.useState(false);
|
|
2558
|
+
const [comment, setComment] = React31.useState("");
|
|
2559
|
+
const [animate, setAnimate] = React31.useState(false);
|
|
2449
2560
|
const handleRate = () => {
|
|
2450
2561
|
onRate(comment);
|
|
2451
2562
|
setOpen(false);
|
|
2452
2563
|
};
|
|
2453
|
-
|
|
2564
|
+
React31.useEffect(() => {
|
|
2454
2565
|
if (currentRating) {
|
|
2455
2566
|
setAnimate(true);
|
|
2456
2567
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2457
2568
|
return () => clearTimeout(timer);
|
|
2458
2569
|
}
|
|
2459
2570
|
}, [currentRating]);
|
|
2460
|
-
|
|
2571
|
+
React31.useEffect(() => {
|
|
2461
2572
|
setComment("");
|
|
2462
2573
|
}, [open]);
|
|
2463
|
-
return /* @__PURE__ */
|
|
2464
|
-
/* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ jsxs20(Dialog, { open, onOpenChange: setOpen, children: [
|
|
2575
|
+
/* @__PURE__ */ jsx45(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
2465
2576
|
Button,
|
|
2466
2577
|
{
|
|
2467
2578
|
ref,
|
|
@@ -2472,7 +2583,7 @@ var RatingComment = React30.forwardRef(
|
|
|
2472
2583
|
className
|
|
2473
2584
|
),
|
|
2474
2585
|
disabled: isLoading,
|
|
2475
|
-
children: /* @__PURE__ */
|
|
2586
|
+
children: /* @__PURE__ */ jsx45(
|
|
2476
2587
|
Book,
|
|
2477
2588
|
{
|
|
2478
2589
|
className: cn(
|
|
@@ -2485,10 +2596,10 @@ var RatingComment = React30.forwardRef(
|
|
|
2485
2596
|
)
|
|
2486
2597
|
}
|
|
2487
2598
|
) }),
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
/* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ jsx45(DialogOverlay, { className: "fixed inset-0 bg-black bg-opacity-50" }),
|
|
2600
|
+
/* @__PURE__ */ jsxs20(DialogContent, { "aria-describedby": void 0, children: [
|
|
2601
|
+
/* @__PURE__ */ jsx45(DialogTitle, { className: "text-lg font-medium", children: "Deja un comentario" }),
|
|
2602
|
+
/* @__PURE__ */ jsx45(
|
|
2492
2603
|
"textarea",
|
|
2493
2604
|
{
|
|
2494
2605
|
className: "mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",
|
|
@@ -2497,7 +2608,7 @@ var RatingComment = React30.forwardRef(
|
|
|
2497
2608
|
onChange: (e) => setComment(e.target.value)
|
|
2498
2609
|
}
|
|
2499
2610
|
),
|
|
2500
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsx45("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ jsx45(
|
|
2501
2612
|
Button,
|
|
2502
2613
|
{
|
|
2503
2614
|
onClick: handleRate,
|
|
@@ -2512,27 +2623,27 @@ var RatingComment = React30.forwardRef(
|
|
|
2512
2623
|
RatingComment.displayName = "RatingComment";
|
|
2513
2624
|
|
|
2514
2625
|
// src/components/molecules/call-out.tsx
|
|
2515
|
-
import * as
|
|
2626
|
+
import * as React32 from "react";
|
|
2516
2627
|
|
|
2517
2628
|
// src/components/hooks/use-text-streaming.ts
|
|
2518
|
-
import { useEffect as
|
|
2629
|
+
import { useEffect as useEffect10, useRef, useState as useState10 } from "react";
|
|
2519
2630
|
var CHAR_DELAY = 25;
|
|
2520
2631
|
var PUNCTUATION_DELAY = 200;
|
|
2521
2632
|
var PUNCTUATION_MARKS = [".", "!", "?", ";", ":"];
|
|
2522
2633
|
function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
2523
|
-
const [displayedContent, setDisplayedContent] =
|
|
2634
|
+
const [displayedContent, setDisplayedContent] = useState10("");
|
|
2524
2635
|
const timeoutId = useRef(null);
|
|
2525
2636
|
const hasStartedStreaming = useRef(false);
|
|
2526
2637
|
const getDelayForChar = (text, position) => {
|
|
2527
2638
|
if (position === 0) return CHAR_DELAY;
|
|
2528
|
-
const previousChar = text[position - 1];
|
|
2639
|
+
const previousChar = text[position - 1] || "";
|
|
2529
2640
|
const isEllipsis = text.slice(position - 1, position + 2) === "...";
|
|
2530
2641
|
if (isEllipsis) {
|
|
2531
2642
|
return CHAR_DELAY;
|
|
2532
2643
|
}
|
|
2533
2644
|
return PUNCTUATION_MARKS.includes(previousChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
|
|
2534
2645
|
};
|
|
2535
|
-
|
|
2646
|
+
useEffect10(() => {
|
|
2536
2647
|
if (!shouldStream && !hasStartedStreaming.current) {
|
|
2537
2648
|
setDisplayedContent(content);
|
|
2538
2649
|
handleIsTextStreaming?.(false);
|
|
@@ -2562,9 +2673,9 @@ function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
|
2562
2673
|
}
|
|
2563
2674
|
|
|
2564
2675
|
// src/components/molecules/call-out.tsx
|
|
2565
|
-
import { jsx as
|
|
2566
|
-
var CallOut =
|
|
2567
|
-
return /* @__PURE__ */
|
|
2676
|
+
import { jsx as jsx46, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2677
|
+
var CallOut = React32.forwardRef(({ className, children, role, ...props }, ref) => {
|
|
2678
|
+
return /* @__PURE__ */ jsx46(
|
|
2568
2679
|
"div",
|
|
2569
2680
|
{
|
|
2570
2681
|
ref,
|
|
@@ -2575,8 +2686,8 @@ var CallOut = React31.forwardRef(({ className, children, role, ...props }, ref)
|
|
|
2575
2686
|
}
|
|
2576
2687
|
);
|
|
2577
2688
|
});
|
|
2578
|
-
var CallOutDate =
|
|
2579
|
-
return /* @__PURE__ */
|
|
2689
|
+
var CallOutDate = React32.forwardRef(({ className, children, ...props }, ref) => {
|
|
2690
|
+
return /* @__PURE__ */ jsx46(
|
|
2580
2691
|
"div",
|
|
2581
2692
|
{
|
|
2582
2693
|
ref,
|
|
@@ -2590,13 +2701,13 @@ var CallOutDate = React31.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2590
2701
|
}
|
|
2591
2702
|
);
|
|
2592
2703
|
});
|
|
2593
|
-
var CallOutActions =
|
|
2594
|
-
const [isLoading, setIsLoading] =
|
|
2595
|
-
const [isClicked, setIsClicked] =
|
|
2704
|
+
var CallOutActions = React32.forwardRef(({ className, actions, role, message, ...props }, ref) => {
|
|
2705
|
+
const [isLoading, setIsLoading] = React32.useState(false);
|
|
2706
|
+
const [isClicked, setIsClicked] = React32.useState(false);
|
|
2596
2707
|
if (role === "user") {
|
|
2597
2708
|
return null;
|
|
2598
2709
|
}
|
|
2599
|
-
return /* @__PURE__ */
|
|
2710
|
+
return /* @__PURE__ */ jsx46("div", { ref, className: cn("alq--callout-actions", className), ...props, children: actions.map((action) => /* @__PURE__ */ jsxs21(
|
|
2600
2711
|
"button",
|
|
2601
2712
|
{
|
|
2602
2713
|
className: cn(
|
|
@@ -2618,7 +2729,7 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
|
|
|
2618
2729
|
});
|
|
2619
2730
|
},
|
|
2620
2731
|
children: [
|
|
2621
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsx46(
|
|
2622
2733
|
"span",
|
|
2623
2734
|
{
|
|
2624
2735
|
className: cn("alq-action-icon-wrapper", {
|
|
@@ -2627,18 +2738,18 @@ var CallOutActions = React31.forwardRef(({ className, actions, role, message, ..
|
|
|
2627
2738
|
children: action.icon
|
|
2628
2739
|
}
|
|
2629
2740
|
),
|
|
2630
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ jsx46("label", { children: action.label })
|
|
2631
2742
|
]
|
|
2632
2743
|
},
|
|
2633
2744
|
action.label
|
|
2634
2745
|
)) });
|
|
2635
2746
|
});
|
|
2636
|
-
var CallOutResponse =
|
|
2747
|
+
var CallOutResponse = React32.forwardRef(
|
|
2637
2748
|
({ className, children, role, additionalInfo, isStreaming, handleIsTextStreaming, ...props }, ref) => {
|
|
2638
2749
|
const content = String(children || "");
|
|
2639
2750
|
const shouldStream = role === "assistant" && isStreaming;
|
|
2640
2751
|
const displayedContent = useTextStreaming(content, shouldStream ?? false, handleIsTextStreaming);
|
|
2641
|
-
return /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ jsxs21(
|
|
2642
2753
|
"div",
|
|
2643
2754
|
{
|
|
2644
2755
|
ref,
|
|
@@ -2651,8 +2762,8 @@ var CallOutResponse = React31.forwardRef(
|
|
|
2651
2762
|
),
|
|
2652
2763
|
...props,
|
|
2653
2764
|
children: [
|
|
2654
|
-
/* @__PURE__ */
|
|
2655
|
-
additionalInfo && /* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ jsx46(RichText, { content: displayedContent }),
|
|
2766
|
+
additionalInfo && /* @__PURE__ */ jsx46(
|
|
2656
2767
|
"div",
|
|
2657
2768
|
{
|
|
2658
2769
|
className: cn(
|
|
@@ -2675,19 +2786,19 @@ CallOutResponse.displayName = "CallOutResponse";
|
|
|
2675
2786
|
|
|
2676
2787
|
// src/components/organisms/assistant.tsx
|
|
2677
2788
|
import { Send } from "lucide-react";
|
|
2678
|
-
import { jsx as
|
|
2679
|
-
var Assistant =
|
|
2789
|
+
import { jsx as jsx47, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2790
|
+
var Assistant = React33.forwardRef(
|
|
2680
2791
|
({ className, sdk, title, description, children, ...props }, ref) => {
|
|
2681
|
-
return /* @__PURE__ */
|
|
2792
|
+
return /* @__PURE__ */ jsxs22(
|
|
2682
2793
|
"div",
|
|
2683
2794
|
{
|
|
2684
2795
|
ref,
|
|
2685
2796
|
className: cn("flex flex-col h-full bg-background text-foreground", className),
|
|
2686
2797
|
...props,
|
|
2687
2798
|
children: [
|
|
2688
|
-
(title || description) && /* @__PURE__ */
|
|
2689
|
-
title && /* @__PURE__ */
|
|
2690
|
-
description && /* @__PURE__ */
|
|
2799
|
+
(title || description) && /* @__PURE__ */ jsxs22(AssistantHeader, { children: [
|
|
2800
|
+
title && /* @__PURE__ */ jsx47(AssistantTitle, { title }),
|
|
2801
|
+
description && /* @__PURE__ */ jsx47(AssistantDescription, { description })
|
|
2691
2802
|
] }),
|
|
2692
2803
|
children
|
|
2693
2804
|
]
|
|
@@ -2696,14 +2807,14 @@ var Assistant = React32.forwardRef(
|
|
|
2696
2807
|
}
|
|
2697
2808
|
);
|
|
2698
2809
|
Assistant.displayName = "Assistant";
|
|
2699
|
-
var AssistantTitle =
|
|
2700
|
-
({ className, title, ...props }, ref) => /* @__PURE__ */
|
|
2810
|
+
var AssistantTitle = React33.forwardRef(
|
|
2811
|
+
({ className, title, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ jsx47(Typography, { typeStyle: "heading1", as: "h1", children: title }) })
|
|
2701
2812
|
);
|
|
2702
2813
|
AssistantTitle.displayName = "AssistantTitle";
|
|
2703
|
-
var AssistantDescription =
|
|
2814
|
+
var AssistantDescription = React33.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("text-foreground", className), ...props, children: /* @__PURE__ */ jsx47(Typography, { typeStyle: "display", as: "p", children: description }) }));
|
|
2704
2815
|
AssistantDescription.displayName = "AssistantDescription";
|
|
2705
|
-
var AssistantHeader =
|
|
2706
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
2816
|
+
var AssistantHeader = React33.forwardRef(
|
|
2817
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
2707
2818
|
"div",
|
|
2708
2819
|
{
|
|
2709
2820
|
ref,
|
|
@@ -2714,7 +2825,7 @@ var AssistantHeader = React32.forwardRef(
|
|
|
2714
2825
|
)
|
|
2715
2826
|
);
|
|
2716
2827
|
AssistantHeader.displayName = "AssistantHeader";
|
|
2717
|
-
var AssistantMessageArea =
|
|
2828
|
+
var AssistantMessageArea = React33.forwardRef(
|
|
2718
2829
|
({
|
|
2719
2830
|
className,
|
|
2720
2831
|
messages,
|
|
@@ -2725,23 +2836,23 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2725
2836
|
handleIsTextStreaming,
|
|
2726
2837
|
...props
|
|
2727
2838
|
}, ref) => {
|
|
2728
|
-
|
|
2839
|
+
useEffect11(() => {
|
|
2729
2840
|
messagesEndRef.current?.scrollIntoView({ behavior: "instant" });
|
|
2730
2841
|
}, []);
|
|
2731
|
-
return /* @__PURE__ */
|
|
2842
|
+
return /* @__PURE__ */ jsxs22(
|
|
2732
2843
|
"div",
|
|
2733
2844
|
{
|
|
2734
2845
|
ref,
|
|
2735
2846
|
className: cn("p-6 overflow-y-auto flex-grow bg-background", className),
|
|
2736
2847
|
...props,
|
|
2737
2848
|
children: [
|
|
2738
|
-
messages.map((message) => /* @__PURE__ */
|
|
2849
|
+
messages.map((message) => /* @__PURE__ */ jsx47("div", { children: /* @__PURE__ */ jsxs22(
|
|
2739
2850
|
CallOut,
|
|
2740
2851
|
{
|
|
2741
2852
|
role: message.role,
|
|
2742
2853
|
message,
|
|
2743
2854
|
children: [
|
|
2744
|
-
message.created_at && /* @__PURE__ */
|
|
2855
|
+
message.created_at && /* @__PURE__ */ jsx47("div", { className: "text-xs text-muted-foreground/80 pb-1", children: new Date(Number(message.created_at)).toLocaleString("es-ES", {
|
|
2745
2856
|
day: "2-digit",
|
|
2746
2857
|
month: "2-digit",
|
|
2747
2858
|
year: "numeric",
|
|
@@ -2750,8 +2861,8 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2750
2861
|
second: "2-digit",
|
|
2751
2862
|
hour12: false
|
|
2752
2863
|
}) }),
|
|
2753
|
-
message.loading && /* @__PURE__ */
|
|
2754
|
-
message.error_code && /* @__PURE__ */
|
|
2864
|
+
message.loading && /* @__PURE__ */ jsx47("div", { children: thinkIndicator ?? /* @__PURE__ */ jsx47(ThinkIndicator, {}) }),
|
|
2865
|
+
message.error_code && /* @__PURE__ */ jsx47(
|
|
2755
2866
|
CallOutResponse,
|
|
2756
2867
|
{
|
|
2757
2868
|
role: "assistant",
|
|
@@ -2759,7 +2870,7 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2759
2870
|
children: "We have an internal error, please try again later."
|
|
2760
2871
|
}
|
|
2761
2872
|
),
|
|
2762
|
-
message.content && /* @__PURE__ */
|
|
2873
|
+
message.content && /* @__PURE__ */ jsx47(
|
|
2763
2874
|
CallOutResponse,
|
|
2764
2875
|
{
|
|
2765
2876
|
role: message.role,
|
|
@@ -2769,7 +2880,7 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2769
2880
|
children: message.content
|
|
2770
2881
|
}
|
|
2771
2882
|
),
|
|
2772
|
-
actions && streamingMessageId !== message.id && /* @__PURE__ */
|
|
2883
|
+
actions && streamingMessageId !== message.id && /* @__PURE__ */ jsx47(
|
|
2773
2884
|
CallOutActions,
|
|
2774
2885
|
{
|
|
2775
2886
|
actions,
|
|
@@ -2782,14 +2893,14 @@ var AssistantMessageArea = React32.forwardRef(
|
|
|
2782
2893
|
},
|
|
2783
2894
|
message.id
|
|
2784
2895
|
) }, message.id)),
|
|
2785
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ jsx47("div", { ref: messagesEndRef })
|
|
2786
2897
|
]
|
|
2787
2898
|
}
|
|
2788
2899
|
);
|
|
2789
2900
|
}
|
|
2790
2901
|
);
|
|
2791
2902
|
AssistantMessageArea.displayName = "AssistantMessageArea";
|
|
2792
|
-
var AssistantInput =
|
|
2903
|
+
var AssistantInput = React33.forwardRef(
|
|
2793
2904
|
({
|
|
2794
2905
|
className,
|
|
2795
2906
|
sendMessageFunc,
|
|
@@ -2799,7 +2910,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2799
2910
|
isMessageStreaming,
|
|
2800
2911
|
...props
|
|
2801
2912
|
}, ref) => {
|
|
2802
|
-
return /* @__PURE__ */
|
|
2913
|
+
return /* @__PURE__ */ jsxs22(
|
|
2803
2914
|
"form",
|
|
2804
2915
|
{
|
|
2805
2916
|
onSubmit: sendMessageFunc,
|
|
@@ -2807,7 +2918,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2807
2918
|
ref,
|
|
2808
2919
|
...props,
|
|
2809
2920
|
children: [
|
|
2810
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsx47(
|
|
2811
2922
|
"input",
|
|
2812
2923
|
{
|
|
2813
2924
|
type: "text",
|
|
@@ -2824,7 +2935,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2824
2935
|
)
|
|
2825
2936
|
}
|
|
2826
2937
|
),
|
|
2827
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ jsx47(
|
|
2828
2939
|
"button",
|
|
2829
2940
|
{
|
|
2830
2941
|
type: "submit",
|
|
@@ -2833,7 +2944,7 @@ var AssistantInput = React32.forwardRef(
|
|
|
2833
2944
|
"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send",
|
|
2834
2945
|
isButtonDisabled ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
2835
2946
|
),
|
|
2836
|
-
children: /* @__PURE__ */
|
|
2947
|
+
children: /* @__PURE__ */ jsx47(Send, { className: "w-5 h-5" })
|
|
2837
2948
|
}
|
|
2838
2949
|
)
|
|
2839
2950
|
]
|
|
@@ -2847,11 +2958,11 @@ AssistantInput.displayName = "AssistantInput";
|
|
|
2847
2958
|
import { useRatings } from "@alquimia-ai/tools/hooks";
|
|
2848
2959
|
|
|
2849
2960
|
// src/components/hooks/use-document.tsx
|
|
2850
|
-
import { useState as
|
|
2961
|
+
import { useState as useState12 } from "react";
|
|
2851
2962
|
var useDocumentReader = (url, getDocument) => {
|
|
2852
|
-
const [loading, setLoading] =
|
|
2853
|
-
const [error, setError] =
|
|
2854
|
-
const [document2, setDocument] =
|
|
2963
|
+
const [loading, setLoading] = useState12(true);
|
|
2964
|
+
const [error, setError] = useState12(null);
|
|
2965
|
+
const [document2, setDocument] = useState12(null);
|
|
2855
2966
|
const handleDocumentError = (error2) => {
|
|
2856
2967
|
const errorMessage = "Hubo un error al obtener el documento. Por favor ponganse en contacto con el administrador.";
|
|
2857
2968
|
setError(errorMessage);
|
|
@@ -2881,10 +2992,10 @@ var useDocumentReader = (url, getDocument) => {
|
|
|
2881
2992
|
};
|
|
2882
2993
|
|
|
2883
2994
|
// src/components/hooks/use-resize-observer.ts
|
|
2884
|
-
import { useEffect as
|
|
2995
|
+
import { useEffect as useEffect12, useRef as useRef2 } from "react";
|
|
2885
2996
|
|
|
2886
2997
|
// src/components/organisms/rating-dialog.tsx
|
|
2887
|
-
import { jsx as
|
|
2998
|
+
import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2888
2999
|
function RatingDialog({
|
|
2889
3000
|
sendRating,
|
|
2890
3001
|
topicId,
|
|
@@ -2900,20 +3011,20 @@ function RatingDialog({
|
|
|
2900
3011
|
success ? setHasRatedTopic(true) : toast2({
|
|
2901
3012
|
title: "Error",
|
|
2902
3013
|
description: `Hubo un error al enviar la calificaci\xF3n`,
|
|
2903
|
-
action: /* @__PURE__ */
|
|
3014
|
+
action: /* @__PURE__ */ jsx48(ToastAction, { altText: "Goto schedule to undo", children: "Cerrar" })
|
|
2904
3015
|
});
|
|
2905
3016
|
};
|
|
2906
3017
|
const handleCancelRate = () => {
|
|
2907
3018
|
setHasRatedTopic(true);
|
|
2908
3019
|
onOpenChange(false);
|
|
2909
3020
|
};
|
|
2910
|
-
return /* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
/* @__PURE__ */
|
|
3021
|
+
return /* @__PURE__ */ jsx48(Dialog, { open: isOpen, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent, { className: "sm:max-w-md", children: [
|
|
3022
|
+
/* @__PURE__ */ jsxs23(DialogHeader, { children: [
|
|
3023
|
+
/* @__PURE__ */ jsx48(DialogTitle, { children: "Calific\xE1 esta conversaci\xF3n" }),
|
|
3024
|
+
/* @__PURE__ */ jsx48(DialogDescription, { children: "Por favor, compart\xED tu opini\xF3n sobre el asistente." })
|
|
2914
3025
|
] }),
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-row justify-center gap-4 py-4", children: [
|
|
3027
|
+
/* @__PURE__ */ jsx48(
|
|
2917
3028
|
RatingStars,
|
|
2918
3029
|
{
|
|
2919
3030
|
currentRating: ratingStars,
|
|
@@ -2922,7 +3033,7 @@ function RatingDialog({
|
|
|
2922
3033
|
className: "p-2 rounded"
|
|
2923
3034
|
}
|
|
2924
3035
|
),
|
|
2925
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsx48(
|
|
2926
3037
|
RatingThumbs,
|
|
2927
3038
|
{
|
|
2928
3039
|
currentRating: ratingComment,
|
|
@@ -2931,7 +3042,7 @@ function RatingDialog({
|
|
|
2931
3042
|
isLoading
|
|
2932
3043
|
}
|
|
2933
3044
|
),
|
|
2934
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx48(
|
|
2935
3046
|
RatingComment,
|
|
2936
3047
|
{
|
|
2937
3048
|
currentRating: ratingComment,
|
|
@@ -2940,7 +3051,7 @@ function RatingDialog({
|
|
|
2940
3051
|
}
|
|
2941
3052
|
)
|
|
2942
3053
|
] }),
|
|
2943
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ jsx48("div", { className: "flex flex-row justify-center gap-4", children: /* @__PURE__ */ jsx48(Button, { onClick: handleCancelRate, variant: "secondary", children: /* @__PURE__ */ jsx48(Typography, { as: "p", typeStyle: "tiny", children: "No, gracias." }) }) })
|
|
2944
3055
|
] }) });
|
|
2945
3056
|
}
|
|
2946
3057
|
|
|
@@ -2967,6 +3078,7 @@ export {
|
|
|
2967
3078
|
AlertTitle,
|
|
2968
3079
|
AspectRatio,
|
|
2969
3080
|
Assistant,
|
|
3081
|
+
AssistantButton,
|
|
2970
3082
|
AssistantInput,
|
|
2971
3083
|
AssistantMessageArea,
|
|
2972
3084
|
Avatar,
|