@alquimia-ai/ui 1.2.3 → 1.3.0
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/atoms/index.d.mts +4 -1
- package/dist/components/atoms/index.d.ts +4 -1
- package/dist/components/atoms/index.js +39 -17
- package/dist/components/atoms/index.js.map +1 -1
- package/dist/components/atoms/index.mjs +35 -13
- package/dist/components/atoms/index.mjs.map +1 -1
- package/dist/components/hooks/index.js +41 -32
- package/dist/components/hooks/index.js.map +1 -1
- package/dist/components/hooks/index.mjs +42 -33
- package/dist/components/hooks/index.mjs.map +1 -1
- package/dist/components/index.d.mts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +39 -17
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +35 -13
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/molecules/documents/index.js +82 -52
- package/dist/components/molecules/documents/index.js.map +1 -1
- package/dist/components/molecules/documents/index.mjs +67 -37
- package/dist/components/molecules/documents/index.mjs.map +1 -1
- package/dist/components/molecules/index.js +186 -156
- package/dist/components/molecules/index.js.map +1 -1
- package/dist/components/molecules/index.mjs +179 -149
- package/dist/components/molecules/index.mjs.map +1 -1
- package/dist/components/molecules/viewers/index.js +31 -10
- package/dist/components/molecules/viewers/index.js.map +1 -1
- package/dist/components/molecules/viewers/index.mjs +30 -9
- package/dist/components/molecules/viewers/index.mjs.map +1 -1
- package/dist/components/organisms/index.d.mts +3 -1
- package/dist/components/organisms/index.d.ts +3 -1
- package/dist/components/organisms/index.js +228 -196
- package/dist/components/organisms/index.js.map +1 -1
- package/dist/components/organisms/index.mjs +217 -185
- package/dist/components/organisms/index.mjs.map +1 -1
- package/dist/components/templates/cards/index.js +57 -36
- package/dist/components/templates/cards/index.js.map +1 -1
- package/dist/components/templates/cards/index.mjs +45 -24
- package/dist/components/templates/cards/index.mjs.map +1 -1
- package/dist/components/templates/index.js +57 -36
- package/dist/components/templates/index.js.map +1 -1
- package/dist/components/templates/index.mjs +45 -24
- package/dist/components/templates/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +283 -250
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +262 -229
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +137 -0
- package/dist/types/index.d.mts +12 -1
- package/dist/types/index.d.ts +12 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/package.json +21 -3
|
@@ -251,7 +251,7 @@ var AlertDialogCancel = React2.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
251
251
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
252
252
|
|
|
253
253
|
// src/components/molecules/assistant-button.tsx
|
|
254
|
-
var
|
|
254
|
+
var React26 = __toESM(require("react"));
|
|
255
255
|
var import_react5 = require("react");
|
|
256
256
|
|
|
257
257
|
// src/components/atoms/ui/textarea.tsx
|
|
@@ -1406,17 +1406,38 @@ var Loader = React22.forwardRef(
|
|
|
1406
1406
|
);
|
|
1407
1407
|
Loader.displayName = "Loader";
|
|
1408
1408
|
|
|
1409
|
-
// src/components/
|
|
1409
|
+
// src/components/atoms/ui/separator.tsx
|
|
1410
1410
|
var React23 = __toESM(require("react"));
|
|
1411
|
+
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
1412
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1413
|
+
var Separator2 = React23.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1414
|
+
SeparatorPrimitive.Root,
|
|
1415
|
+
{
|
|
1416
|
+
ref,
|
|
1417
|
+
decorative,
|
|
1418
|
+
orientation,
|
|
1419
|
+
className: cn(
|
|
1420
|
+
"shrink-0 bg-border",
|
|
1421
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
1422
|
+
className,
|
|
1423
|
+
"alq--separator"
|
|
1424
|
+
),
|
|
1425
|
+
...props
|
|
1426
|
+
}
|
|
1427
|
+
));
|
|
1428
|
+
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
1429
|
+
|
|
1430
|
+
// src/components/hooks/use-toast.ts
|
|
1431
|
+
var React24 = __toESM(require("react"));
|
|
1411
1432
|
|
|
1412
1433
|
// src/components/atoms/ui/toaster.tsx
|
|
1413
|
-
var
|
|
1434
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1414
1435
|
|
|
1415
1436
|
// src/components/atoms/ui/think-indicator.tsx
|
|
1416
|
-
var
|
|
1437
|
+
var React25 = __toESM(require("react"));
|
|
1417
1438
|
var import_react4 = require("react");
|
|
1418
1439
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1419
|
-
var
|
|
1440
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1420
1441
|
var thinkIndicatorVariants = (0, import_class_variance_authority8.cva)(
|
|
1421
1442
|
"flex items-center gap-3",
|
|
1422
1443
|
{
|
|
@@ -1438,7 +1459,7 @@ var thinkIndicatorVariants = (0, import_class_variance_authority8.cva)(
|
|
|
1438
1459
|
}
|
|
1439
1460
|
}
|
|
1440
1461
|
);
|
|
1441
|
-
var ThinkIndicator =
|
|
1462
|
+
var ThinkIndicator = React25.forwardRef(
|
|
1442
1463
|
({
|
|
1443
1464
|
className,
|
|
1444
1465
|
variant,
|
|
@@ -1469,14 +1490,14 @@ var ThinkIndicator = React24.forwardRef(
|
|
|
1469
1490
|
}
|
|
1470
1491
|
return () => clearInterval(timer);
|
|
1471
1492
|
}, [thoughts, interval, currentThoughtIndex]);
|
|
1472
|
-
return /* @__PURE__ */ (0,
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1473
1494
|
"div",
|
|
1474
1495
|
{
|
|
1475
1496
|
ref,
|
|
1476
1497
|
className: cn(thinkIndicatorVariants({ variant, size }), className, "alq--think-indicator"),
|
|
1477
1498
|
...props,
|
|
1478
1499
|
children: [
|
|
1479
|
-
loader || /* @__PURE__ */ (0,
|
|
1500
|
+
loader || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1480
1501
|
Loader,
|
|
1481
1502
|
{
|
|
1482
1503
|
className: cn(
|
|
@@ -1484,7 +1505,7 @@ var ThinkIndicator = React24.forwardRef(
|
|
|
1484
1505
|
)
|
|
1485
1506
|
}
|
|
1486
1507
|
),
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1488
1509
|
"div",
|
|
1489
1510
|
{
|
|
1490
1511
|
className: cn(
|
|
@@ -1503,9 +1524,9 @@ var ThinkIndicator = React24.forwardRef(
|
|
|
1503
1524
|
ThinkIndicator.displayName = "ThinkIndicator";
|
|
1504
1525
|
|
|
1505
1526
|
// src/components/molecules/assistant-button.tsx
|
|
1506
|
-
var
|
|
1507
|
-
var AssistantSuggestions =
|
|
1508
|
-
return /* @__PURE__ */ (0,
|
|
1527
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1528
|
+
var AssistantSuggestions = React26.forwardRef(({ suggestions, showSuggestions, className }, ref) => {
|
|
1529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1509
1530
|
"div",
|
|
1510
1531
|
{
|
|
1511
1532
|
ref,
|
|
@@ -1515,7 +1536,7 @@ var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, c
|
|
|
1515
1536
|
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4",
|
|
1516
1537
|
className
|
|
1517
1538
|
),
|
|
1518
|
-
children: /* @__PURE__ */ (0,
|
|
1539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "rounded-lg p-2 pr-0 w-64", children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1519
1540
|
"button",
|
|
1520
1541
|
{
|
|
1521
1542
|
onClick: () => suggestion.action?.(),
|
|
@@ -1531,8 +1552,8 @@ var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, c
|
|
|
1531
1552
|
showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
|
|
1532
1553
|
),
|
|
1533
1554
|
children: [
|
|
1534
|
-
/* @__PURE__ */ (0,
|
|
1535
|
-
/* @__PURE__ */ (0,
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(suggestion.icon, { className: "w-5 h-5 text-primary" }),
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs whitespace-nowrap font-normal", children: suggestion.label })
|
|
1536
1557
|
]
|
|
1537
1558
|
},
|
|
1538
1559
|
index
|
|
@@ -1541,7 +1562,7 @@ var AssistantSuggestions = React25.forwardRef(({ suggestions, showSuggestions, c
|
|
|
1541
1562
|
);
|
|
1542
1563
|
});
|
|
1543
1564
|
AssistantSuggestions.displayName = "Suggestions";
|
|
1544
|
-
var AssistantButton =
|
|
1565
|
+
var AssistantButton = React26.forwardRef(
|
|
1545
1566
|
({
|
|
1546
1567
|
icon: Icon2,
|
|
1547
1568
|
clickAction,
|
|
@@ -1562,7 +1583,7 @@ var AssistantButton = React25.forwardRef(
|
|
|
1562
1583
|
setShowSuggestions(false);
|
|
1563
1584
|
setTimeout(() => setIsVisible(false), 300);
|
|
1564
1585
|
};
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1566
1587
|
"div",
|
|
1567
1588
|
{
|
|
1568
1589
|
ref,
|
|
@@ -1573,15 +1594,15 @@ var AssistantButton = React25.forwardRef(
|
|
|
1573
1594
|
),
|
|
1574
1595
|
onMouseEnter: handleMouseEnter,
|
|
1575
1596
|
onMouseLeave: handleMouseLeave,
|
|
1576
|
-
children: /* @__PURE__ */ (0,
|
|
1577
|
-
isVisible && suggestions.length > 0 && /* @__PURE__ */ (0,
|
|
1597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative group", children: [
|
|
1598
|
+
isVisible && suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1578
1599
|
AssistantSuggestions,
|
|
1579
1600
|
{
|
|
1580
1601
|
suggestions,
|
|
1581
1602
|
showSuggestions
|
|
1582
1603
|
}
|
|
1583
1604
|
),
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1585
1606
|
Button,
|
|
1586
1607
|
{
|
|
1587
1608
|
variant: "outline",
|
|
@@ -1595,7 +1616,7 @@ var AssistantButton = React25.forwardRef(
|
|
|
1595
1616
|
"alq--assistant-button"
|
|
1596
1617
|
),
|
|
1597
1618
|
onClick: clickAction,
|
|
1598
|
-
children: /* @__PURE__ */ (0,
|
|
1619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1599
1620
|
Icon2,
|
|
1600
1621
|
{
|
|
1601
1622
|
style: { width: "22px", height: "22px" },
|
|
@@ -1612,19 +1633,19 @@ var AssistantButton = React25.forwardRef(
|
|
|
1612
1633
|
AssistantButton.displayName = "AssistantButton";
|
|
1613
1634
|
|
|
1614
1635
|
// src/components/molecules/carousel.tsx
|
|
1615
|
-
var
|
|
1636
|
+
var React27 = __toESM(require("react"));
|
|
1616
1637
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
1617
1638
|
var import_lucide_react8 = require("lucide-react");
|
|
1618
|
-
var
|
|
1619
|
-
var CarouselContext =
|
|
1639
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1640
|
+
var CarouselContext = React27.createContext(null);
|
|
1620
1641
|
function useCarousel() {
|
|
1621
|
-
const context =
|
|
1642
|
+
const context = React27.useContext(CarouselContext);
|
|
1622
1643
|
if (!context) {
|
|
1623
1644
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1624
1645
|
}
|
|
1625
1646
|
return context;
|
|
1626
1647
|
}
|
|
1627
|
-
var Carousel =
|
|
1648
|
+
var Carousel = React27.forwardRef(
|
|
1628
1649
|
({
|
|
1629
1650
|
orientation = "horizontal",
|
|
1630
1651
|
opts,
|
|
@@ -1641,22 +1662,22 @@ var Carousel = React26.forwardRef(
|
|
|
1641
1662
|
},
|
|
1642
1663
|
plugins
|
|
1643
1664
|
);
|
|
1644
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1645
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1646
|
-
const onSelect =
|
|
1665
|
+
const [canScrollPrev, setCanScrollPrev] = React27.useState(false);
|
|
1666
|
+
const [canScrollNext, setCanScrollNext] = React27.useState(false);
|
|
1667
|
+
const onSelect = React27.useCallback((api2) => {
|
|
1647
1668
|
if (!api2) {
|
|
1648
1669
|
return;
|
|
1649
1670
|
}
|
|
1650
1671
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1651
1672
|
setCanScrollNext(api2.canScrollNext());
|
|
1652
1673
|
}, []);
|
|
1653
|
-
const scrollPrev =
|
|
1674
|
+
const scrollPrev = React27.useCallback(() => {
|
|
1654
1675
|
api?.scrollPrev();
|
|
1655
1676
|
}, [api]);
|
|
1656
|
-
const scrollNext =
|
|
1677
|
+
const scrollNext = React27.useCallback(() => {
|
|
1657
1678
|
api?.scrollNext();
|
|
1658
1679
|
}, [api]);
|
|
1659
|
-
const handleKeyDown =
|
|
1680
|
+
const handleKeyDown = React27.useCallback(
|
|
1660
1681
|
(event) => {
|
|
1661
1682
|
if (event.key === "ArrowLeft") {
|
|
1662
1683
|
event.preventDefault();
|
|
@@ -1668,13 +1689,13 @@ var Carousel = React26.forwardRef(
|
|
|
1668
1689
|
},
|
|
1669
1690
|
[scrollPrev, scrollNext]
|
|
1670
1691
|
);
|
|
1671
|
-
|
|
1692
|
+
React27.useEffect(() => {
|
|
1672
1693
|
if (!api || !setApi) {
|
|
1673
1694
|
return;
|
|
1674
1695
|
}
|
|
1675
1696
|
setApi(api);
|
|
1676
1697
|
}, [api, setApi]);
|
|
1677
|
-
|
|
1698
|
+
React27.useEffect(() => {
|
|
1678
1699
|
if (!api) {
|
|
1679
1700
|
return;
|
|
1680
1701
|
}
|
|
@@ -1685,7 +1706,7 @@ var Carousel = React26.forwardRef(
|
|
|
1685
1706
|
api?.off("select", onSelect);
|
|
1686
1707
|
};
|
|
1687
1708
|
}, [api, onSelect]);
|
|
1688
|
-
return /* @__PURE__ */ (0,
|
|
1709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1689
1710
|
CarouselContext.Provider,
|
|
1690
1711
|
{
|
|
1691
1712
|
value: {
|
|
@@ -1698,7 +1719,7 @@ var Carousel = React26.forwardRef(
|
|
|
1698
1719
|
canScrollPrev,
|
|
1699
1720
|
canScrollNext
|
|
1700
1721
|
},
|
|
1701
|
-
children: /* @__PURE__ */ (0,
|
|
1722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1702
1723
|
"div",
|
|
1703
1724
|
{
|
|
1704
1725
|
ref,
|
|
@@ -1715,9 +1736,9 @@ var Carousel = React26.forwardRef(
|
|
|
1715
1736
|
}
|
|
1716
1737
|
);
|
|
1717
1738
|
Carousel.displayName = "Carousel";
|
|
1718
|
-
var CarouselContent =
|
|
1739
|
+
var CarouselContent = React27.forwardRef(({ className, ...props }, ref) => {
|
|
1719
1740
|
const { carouselRef, orientation } = useCarousel();
|
|
1720
|
-
return /* @__PURE__ */ (0,
|
|
1741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1721
1742
|
"div",
|
|
1722
1743
|
{
|
|
1723
1744
|
ref,
|
|
@@ -1731,9 +1752,9 @@ var CarouselContent = React26.forwardRef(({ className, ...props }, ref) => {
|
|
|
1731
1752
|
) });
|
|
1732
1753
|
});
|
|
1733
1754
|
CarouselContent.displayName = "CarouselContent";
|
|
1734
|
-
var CarouselItem =
|
|
1755
|
+
var CarouselItem = React27.forwardRef(({ className, ...props }, ref) => {
|
|
1735
1756
|
const { orientation } = useCarousel();
|
|
1736
|
-
return /* @__PURE__ */ (0,
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1737
1758
|
"div",
|
|
1738
1759
|
{
|
|
1739
1760
|
ref,
|
|
@@ -1749,9 +1770,9 @@ var CarouselItem = React26.forwardRef(({ className, ...props }, ref) => {
|
|
|
1749
1770
|
);
|
|
1750
1771
|
});
|
|
1751
1772
|
CarouselItem.displayName = "CarouselItem";
|
|
1752
|
-
var CarouselPrevious =
|
|
1773
|
+
var CarouselPrevious = React27.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
1753
1774
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
1775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1755
1776
|
Button,
|
|
1756
1777
|
{
|
|
1757
1778
|
ref,
|
|
@@ -1766,16 +1787,16 @@ var CarouselPrevious = React26.forwardRef(({ className, variant = "outline", siz
|
|
|
1766
1787
|
onClick: scrollPrev,
|
|
1767
1788
|
...props,
|
|
1768
1789
|
children: [
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react8.ArrowLeft, { className: "h-4 w-4" }),
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
1771
1792
|
]
|
|
1772
1793
|
}
|
|
1773
1794
|
);
|
|
1774
1795
|
});
|
|
1775
1796
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
1776
|
-
var CarouselNext =
|
|
1797
|
+
var CarouselNext = React27.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
1777
1798
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
1778
|
-
return /* @__PURE__ */ (0,
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1779
1800
|
Button,
|
|
1780
1801
|
{
|
|
1781
1802
|
ref,
|
|
@@ -1790,8 +1811,8 @@ var CarouselNext = React26.forwardRef(({ className, variant = "outline", size =
|
|
|
1790
1811
|
onClick: scrollNext,
|
|
1791
1812
|
...props,
|
|
1792
1813
|
children: [
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react8.ArrowRight, { className: "h-4 w-4" }),
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
1795
1816
|
]
|
|
1796
1817
|
}
|
|
1797
1818
|
);
|
|
@@ -1799,12 +1820,12 @@ var CarouselNext = React26.forwardRef(({ className, variant = "outline", size =
|
|
|
1799
1820
|
CarouselNext.displayName = "CarouselNext";
|
|
1800
1821
|
|
|
1801
1822
|
// src/components/molecules/navigation-menu.tsx
|
|
1802
|
-
var
|
|
1823
|
+
var React28 = __toESM(require("react"));
|
|
1803
1824
|
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
1804
1825
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1805
1826
|
var import_lucide_react9 = require("lucide-react");
|
|
1806
|
-
var
|
|
1807
|
-
var NavigationMenu =
|
|
1827
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1828
|
+
var NavigationMenu = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1808
1829
|
NavigationMenuPrimitive.Root,
|
|
1809
1830
|
{
|
|
1810
1831
|
ref,
|
|
@@ -1815,12 +1836,12 @@ var NavigationMenu = React27.forwardRef(({ className, children, ...props }, ref)
|
|
|
1815
1836
|
...props,
|
|
1816
1837
|
children: [
|
|
1817
1838
|
children,
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(NavigationMenuViewport, {})
|
|
1819
1840
|
]
|
|
1820
1841
|
}
|
|
1821
1842
|
));
|
|
1822
1843
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
1823
|
-
var NavigationMenuList =
|
|
1844
|
+
var NavigationMenuList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1824
1845
|
NavigationMenuPrimitive.List,
|
|
1825
1846
|
{
|
|
1826
1847
|
ref,
|
|
@@ -1836,7 +1857,7 @@ var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
|
1836
1857
|
var navigationMenuTriggerStyle = (0, import_class_variance_authority9.cva)(
|
|
1837
1858
|
"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"
|
|
1838
1859
|
);
|
|
1839
|
-
var NavigationMenuTrigger =
|
|
1860
|
+
var NavigationMenuTrigger = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1840
1861
|
NavigationMenuPrimitive.Trigger,
|
|
1841
1862
|
{
|
|
1842
1863
|
ref,
|
|
@@ -1845,7 +1866,7 @@ var NavigationMenuTrigger = React27.forwardRef(({ className, children, ...props
|
|
|
1845
1866
|
children: [
|
|
1846
1867
|
children,
|
|
1847
1868
|
" ",
|
|
1848
|
-
/* @__PURE__ */ (0,
|
|
1869
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1849
1870
|
import_lucide_react9.ChevronDown,
|
|
1850
1871
|
{
|
|
1851
1872
|
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
@@ -1856,7 +1877,7 @@ var NavigationMenuTrigger = React27.forwardRef(({ className, children, ...props
|
|
|
1856
1877
|
}
|
|
1857
1878
|
));
|
|
1858
1879
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
1859
|
-
var NavigationMenuContent =
|
|
1880
|
+
var NavigationMenuContent = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1860
1881
|
NavigationMenuPrimitive.Content,
|
|
1861
1882
|
{
|
|
1862
1883
|
ref,
|
|
@@ -1869,7 +1890,7 @@ var NavigationMenuContent = React27.forwardRef(({ className, ...props }, ref) =>
|
|
|
1869
1890
|
));
|
|
1870
1891
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
1871
1892
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
1872
|
-
var NavigationMenuViewport =
|
|
1893
|
+
var NavigationMenuViewport = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1873
1894
|
NavigationMenuPrimitive.Viewport,
|
|
1874
1895
|
{
|
|
1875
1896
|
className: cn(
|
|
@@ -1881,7 +1902,7 @@ var NavigationMenuViewport = React27.forwardRef(({ className, ...props }, ref) =
|
|
|
1881
1902
|
}
|
|
1882
1903
|
) }));
|
|
1883
1904
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
1884
|
-
var NavigationMenuIndicator =
|
|
1905
|
+
var NavigationMenuIndicator = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1885
1906
|
NavigationMenuPrimitive.Indicator,
|
|
1886
1907
|
{
|
|
1887
1908
|
ref,
|
|
@@ -1890,15 +1911,15 @@ var NavigationMenuIndicator = React27.forwardRef(({ className, ...props }, ref)
|
|
|
1890
1911
|
className
|
|
1891
1912
|
),
|
|
1892
1913
|
...props,
|
|
1893
|
-
children: /* @__PURE__ */ (0,
|
|
1914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
1894
1915
|
}
|
|
1895
1916
|
));
|
|
1896
1917
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
1897
1918
|
|
|
1898
1919
|
// src/components/molecules/sidebar.tsx
|
|
1899
|
-
var
|
|
1920
|
+
var React29 = __toESM(require("react"));
|
|
1900
1921
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
1901
|
-
var
|
|
1922
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1902
1923
|
var sidebarVariants = (0, import_class_variance_authority10.cva)(
|
|
1903
1924
|
"flex flex-col border-r",
|
|
1904
1925
|
{
|
|
@@ -1914,7 +1935,7 @@ var sidebarVariants = (0, import_class_variance_authority10.cva)(
|
|
|
1914
1935
|
}
|
|
1915
1936
|
}
|
|
1916
1937
|
);
|
|
1917
|
-
var SidebarFooter =
|
|
1938
|
+
var SidebarFooter = React29.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1918
1939
|
"div",
|
|
1919
1940
|
{
|
|
1920
1941
|
ref,
|
|
@@ -1924,7 +1945,7 @@ var SidebarFooter = React28.forwardRef(({ className, children, ...props }, ref)
|
|
|
1924
1945
|
}
|
|
1925
1946
|
));
|
|
1926
1947
|
SidebarFooter.displayName = "SidebarFooter";
|
|
1927
|
-
var Sidebar =
|
|
1948
|
+
var Sidebar = React29.forwardRef(
|
|
1928
1949
|
({
|
|
1929
1950
|
className,
|
|
1930
1951
|
items,
|
|
@@ -1937,8 +1958,8 @@ var Sidebar = React28.forwardRef(
|
|
|
1937
1958
|
buttonClassName,
|
|
1938
1959
|
...props
|
|
1939
1960
|
}, ref) => {
|
|
1940
|
-
return /* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn(className, "alq--navigation-sidebar h-full"), ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("aside", { className: cn(sidebarVariants({ size }), "h-full"), children: [
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ScrollArea, { className: "flex-grow justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col gap-2 p-4", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1942
1963
|
Button,
|
|
1943
1964
|
{
|
|
1944
1965
|
variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,
|
|
@@ -1950,13 +1971,13 @@ var Sidebar = React28.forwardRef(
|
|
|
1950
1971
|
}
|
|
1951
1972
|
},
|
|
1952
1973
|
children: [
|
|
1953
|
-
item.icon && /* @__PURE__ */ (0,
|
|
1974
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(item.icon, { className: "mr-2 h-4 w-4" }),
|
|
1954
1975
|
item.name
|
|
1955
1976
|
]
|
|
1956
1977
|
},
|
|
1957
1978
|
item.name
|
|
1958
1979
|
)) }) }),
|
|
1959
|
-
footerContent && /* @__PURE__ */ (0,
|
|
1980
|
+
footerContent && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SidebarFooter, { children: footerContent })
|
|
1960
1981
|
] }) });
|
|
1961
1982
|
}
|
|
1962
1983
|
);
|
|
@@ -1964,10 +1985,10 @@ var Sidebar = React28.forwardRef(
|
|
|
1964
1985
|
// src/components/molecules/sonner.tsx
|
|
1965
1986
|
var import_next_themes = require("next-themes");
|
|
1966
1987
|
var import_sonner = require("sonner");
|
|
1967
|
-
var
|
|
1988
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1968
1989
|
var Toaster = ({ ...props }) => {
|
|
1969
1990
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
1970
|
-
return /* @__PURE__ */ (0,
|
|
1991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1971
1992
|
import_sonner.Toaster,
|
|
1972
1993
|
{
|
|
1973
1994
|
theme,
|
|
@@ -1986,14 +2007,14 @@ var Toaster = ({ ...props }) => {
|
|
|
1986
2007
|
};
|
|
1987
2008
|
|
|
1988
2009
|
// src/components/molecules/rating-stars.tsx
|
|
1989
|
-
var
|
|
2010
|
+
var React30 = __toESM(require("react"));
|
|
1990
2011
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1991
2012
|
var import_lucide_react10 = require("lucide-react");
|
|
1992
|
-
var
|
|
2013
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1993
2014
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1994
2015
|
var Tooltip = TooltipPrimitive.Root;
|
|
1995
2016
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1996
|
-
var TooltipContent =
|
|
2017
|
+
var TooltipContent = React30.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1997
2018
|
TooltipPrimitive.Content,
|
|
1998
2019
|
{
|
|
1999
2020
|
ref,
|
|
@@ -2006,14 +2027,14 @@ var TooltipContent = React29.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
2006
2027
|
}
|
|
2007
2028
|
));
|
|
2008
2029
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2009
|
-
var StarRating =
|
|
2030
|
+
var StarRating = React30.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref, className: "flex", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2010
2031
|
Button,
|
|
2011
2032
|
{
|
|
2012
2033
|
onClick: () => onRate(star),
|
|
2013
2034
|
variant: "link",
|
|
2014
2035
|
className: "p-1 transition-colors [&_svg]:size-5 h-5",
|
|
2015
2036
|
"aria-label": `Rate ${star} star${star !== 1 ? "s" : ""}`,
|
|
2016
|
-
children: /* @__PURE__ */ (0,
|
|
2037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2017
2038
|
import_lucide_react10.Star,
|
|
2018
2039
|
{
|
|
2019
2040
|
className: cn(
|
|
@@ -2026,19 +2047,19 @@ var StarRating = React29.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */
|
|
|
2026
2047
|
star
|
|
2027
2048
|
)) }));
|
|
2028
2049
|
StarRating.displayName = "StarRating";
|
|
2029
|
-
var RatingStars =
|
|
2050
|
+
var RatingStars = React30.forwardRef(({
|
|
2030
2051
|
currentRating = 0,
|
|
2031
2052
|
onRate,
|
|
2032
2053
|
className,
|
|
2033
2054
|
isLoading
|
|
2034
2055
|
}, ref) => {
|
|
2035
|
-
const [open, setOpen] =
|
|
2036
|
-
const [animate, setAnimate] =
|
|
2056
|
+
const [open, setOpen] = React30.useState(false);
|
|
2057
|
+
const [animate, setAnimate] = React30.useState(false);
|
|
2037
2058
|
const handleRate = (rating) => {
|
|
2038
2059
|
onRate(rating);
|
|
2039
2060
|
setOpen(false);
|
|
2040
2061
|
};
|
|
2041
|
-
|
|
2062
|
+
React30.useEffect(() => {
|
|
2042
2063
|
if (currentRating > 0) {
|
|
2043
2064
|
setAnimate(true);
|
|
2044
2065
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
@@ -2046,8 +2067,8 @@ var RatingStars = React29.forwardRef(({
|
|
|
2046
2067
|
}
|
|
2047
2068
|
}, [currentRating]);
|
|
2048
2069
|
const hasRated = currentRating > 0;
|
|
2049
|
-
return /* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Tooltip, { open, onOpenChange: setOpen, children: [
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2051
2072
|
Button,
|
|
2052
2073
|
{
|
|
2053
2074
|
ref,
|
|
@@ -2058,7 +2079,7 @@ var RatingStars = React29.forwardRef(({
|
|
|
2058
2079
|
),
|
|
2059
2080
|
disabled: isLoading,
|
|
2060
2081
|
onClick: () => setOpen(!open),
|
|
2061
|
-
children: /* @__PURE__ */ (0,
|
|
2082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2062
2083
|
import_lucide_react10.Star,
|
|
2063
2084
|
{
|
|
2064
2085
|
className: cn(
|
|
@@ -2071,7 +2092,7 @@ var RatingStars = React29.forwardRef(({
|
|
|
2071
2092
|
)
|
|
2072
2093
|
}
|
|
2073
2094
|
) }),
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipContent, { side: "top", align: "center", className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "p-2 bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2075
2096
|
StarRating,
|
|
2076
2097
|
{
|
|
2077
2098
|
rating: currentRating,
|
|
@@ -2083,10 +2104,10 @@ var RatingStars = React29.forwardRef(({
|
|
|
2083
2104
|
RatingStars.displayName = "RatingStars";
|
|
2084
2105
|
|
|
2085
2106
|
// src/components/molecules/rating-thumbs.tsx
|
|
2086
|
-
var
|
|
2107
|
+
var React31 = __toESM(require("react"));
|
|
2087
2108
|
var import_lucide_react11 = require("lucide-react");
|
|
2088
|
-
var
|
|
2089
|
-
var RatingThumbs =
|
|
2109
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2110
|
+
var RatingThumbs = React31.forwardRef(
|
|
2090
2111
|
({
|
|
2091
2112
|
currentRating,
|
|
2092
2113
|
onRate,
|
|
@@ -2094,15 +2115,15 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2094
2115
|
className,
|
|
2095
2116
|
isLoading
|
|
2096
2117
|
}, ref) => {
|
|
2097
|
-
const [animate, setAnimate] =
|
|
2098
|
-
|
|
2118
|
+
const [animate, setAnimate] = React31.useState(false);
|
|
2119
|
+
React31.useEffect(() => {
|
|
2099
2120
|
if (currentRating) {
|
|
2100
2121
|
setAnimate(true);
|
|
2101
2122
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2102
2123
|
return () => clearTimeout(timer);
|
|
2103
2124
|
}
|
|
2104
2125
|
}, [currentRating]);
|
|
2105
|
-
return /* @__PURE__ */ (0,
|
|
2126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2106
2127
|
"div",
|
|
2107
2128
|
{
|
|
2108
2129
|
ref,
|
|
@@ -2113,7 +2134,7 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2113
2134
|
className
|
|
2114
2135
|
),
|
|
2115
2136
|
children: [
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2117
2138
|
Button,
|
|
2118
2139
|
{
|
|
2119
2140
|
variant: "link",
|
|
@@ -2124,7 +2145,7 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2124
2145
|
),
|
|
2125
2146
|
"aria-label": "Thumbs up",
|
|
2126
2147
|
disabled: isLoading,
|
|
2127
|
-
children: /* @__PURE__ */ (0,
|
|
2148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2128
2149
|
import_lucide_react11.ThumbsUp,
|
|
2129
2150
|
{
|
|
2130
2151
|
className: cn(
|
|
@@ -2137,7 +2158,7 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2137
2158
|
)
|
|
2138
2159
|
}
|
|
2139
2160
|
),
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2141
2162
|
Button,
|
|
2142
2163
|
{
|
|
2143
2164
|
variant: "link",
|
|
@@ -2148,7 +2169,7 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2148
2169
|
),
|
|
2149
2170
|
"aria-label": "Thumbs down",
|
|
2150
2171
|
disabled: isLoading,
|
|
2151
|
-
children: /* @__PURE__ */ (0,
|
|
2172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2152
2173
|
import_lucide_react11.ThumbsDown,
|
|
2153
2174
|
{
|
|
2154
2175
|
className: cn(
|
|
@@ -2169,30 +2190,30 @@ var RatingThumbs = React30.forwardRef(
|
|
|
2169
2190
|
RatingThumbs.displayName = "RatingThumbs";
|
|
2170
2191
|
|
|
2171
2192
|
// src/components/molecules/rating-comment.tsx
|
|
2172
|
-
var
|
|
2193
|
+
var React32 = __toESM(require("react"));
|
|
2173
2194
|
var import_lucide_react12 = require("lucide-react");
|
|
2174
|
-
var
|
|
2175
|
-
var RatingComment =
|
|
2195
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2196
|
+
var RatingComment = React32.forwardRef(
|
|
2176
2197
|
({ currentRating, onRate, className, isLoading }, ref) => {
|
|
2177
|
-
const [open, setOpen] =
|
|
2178
|
-
const [comment, setComment] =
|
|
2179
|
-
const [animate, setAnimate] =
|
|
2198
|
+
const [open, setOpen] = React32.useState(false);
|
|
2199
|
+
const [comment, setComment] = React32.useState("");
|
|
2200
|
+
const [animate, setAnimate] = React32.useState(false);
|
|
2180
2201
|
const handleRate = () => {
|
|
2181
2202
|
onRate(comment);
|
|
2182
2203
|
setOpen(false);
|
|
2183
2204
|
};
|
|
2184
|
-
|
|
2205
|
+
React32.useEffect(() => {
|
|
2185
2206
|
if (currentRating) {
|
|
2186
2207
|
setAnimate(true);
|
|
2187
2208
|
const timer = setTimeout(() => setAnimate(false), 150);
|
|
2188
2209
|
return () => clearTimeout(timer);
|
|
2189
2210
|
}
|
|
2190
2211
|
}, [currentRating]);
|
|
2191
|
-
|
|
2212
|
+
React32.useEffect(() => {
|
|
2192
2213
|
setComment("");
|
|
2193
2214
|
}, [open]);
|
|
2194
|
-
return /* @__PURE__ */ (0,
|
|
2195
|
-
/* @__PURE__ */ (0,
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
|
|
2216
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2196
2217
|
Button,
|
|
2197
2218
|
{
|
|
2198
2219
|
ref,
|
|
@@ -2203,7 +2224,7 @@ var RatingComment = React31.forwardRef(
|
|
|
2203
2224
|
className
|
|
2204
2225
|
),
|
|
2205
2226
|
disabled: isLoading,
|
|
2206
|
-
children: /* @__PURE__ */ (0,
|
|
2227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2207
2228
|
import_lucide_react12.Book,
|
|
2208
2229
|
{
|
|
2209
2230
|
className: cn(
|
|
@@ -2216,10 +2237,10 @@ var RatingComment = React31.forwardRef(
|
|
|
2216
2237
|
)
|
|
2217
2238
|
}
|
|
2218
2239
|
) }),
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogOverlay, { className: "fixed inset-0 bg-black bg-opacity-50" }),
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(DialogContent, { "aria-describedby": void 0, children: [
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DialogTitle, { className: "text-lg font-medium", children: "Deja un comentario" }),
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2223
2244
|
"textarea",
|
|
2224
2245
|
{
|
|
2225
2246
|
className: "mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",
|
|
@@ -2228,7 +2249,7 @@ var RatingComment = React31.forwardRef(
|
|
|
2228
2249
|
onChange: (e) => setComment(e.target.value)
|
|
2229
2250
|
}
|
|
2230
2251
|
),
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2232
2253
|
Button,
|
|
2233
2254
|
{
|
|
2234
2255
|
onClick: handleRate,
|
|
@@ -2243,59 +2264,68 @@ var RatingComment = React31.forwardRef(
|
|
|
2243
2264
|
RatingComment.displayName = "RatingComment";
|
|
2244
2265
|
|
|
2245
2266
|
// src/components/molecules/call-out.tsx
|
|
2246
|
-
var
|
|
2267
|
+
var React33 = __toESM(require("react"));
|
|
2247
2268
|
|
|
2248
2269
|
// src/components/hooks/use-text-streaming.ts
|
|
2249
2270
|
var import_react6 = require("react");
|
|
2250
2271
|
var CHAR_DELAY = 25;
|
|
2251
|
-
var PUNCTUATION_DELAY =
|
|
2252
|
-
var PUNCTUATION_MARKS = [".", "!", "?", ";", ":"];
|
|
2272
|
+
var PUNCTUATION_DELAY = 400;
|
|
2253
2273
|
function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
2254
|
-
const [
|
|
2255
|
-
const
|
|
2274
|
+
const [displayedText, setDisplayedText] = (0, import_react6.useState)("");
|
|
2275
|
+
const contentRef = (0, import_react6.useRef)(content);
|
|
2276
|
+
const indexRef = (0, import_react6.useRef)(0);
|
|
2277
|
+
const timerRef = (0, import_react6.useRef)(null);
|
|
2256
2278
|
const hasStartedStreaming = (0, import_react6.useRef)(false);
|
|
2257
|
-
const getDelayForChar = (text, position) => {
|
|
2258
|
-
if (position === 0) return CHAR_DELAY;
|
|
2259
|
-
const previousChar = text[position - 1] || "";
|
|
2260
|
-
const isEllipsis = text.slice(position - 1, position + 2) === "...";
|
|
2261
|
-
if (isEllipsis) {
|
|
2262
|
-
return CHAR_DELAY;
|
|
2263
|
-
}
|
|
2264
|
-
return PUNCTUATION_MARKS.includes(previousChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
|
|
2265
|
-
};
|
|
2266
2279
|
(0, import_react6.useEffect)(() => {
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
return;
|
|
2280
|
+
contentRef.current = content;
|
|
2281
|
+
if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {
|
|
2282
|
+
typeNext();
|
|
2271
2283
|
}
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
if (
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2284
|
+
}, [content]);
|
|
2285
|
+
const typeNext = (0, import_react6.useCallback)(() => {
|
|
2286
|
+
if (indexRef.current < contentRef.current.length) {
|
|
2287
|
+
const nextChar = contentRef.current.charAt(indexRef.current);
|
|
2288
|
+
setDisplayedText((prev) => prev + nextChar);
|
|
2289
|
+
indexRef.current++;
|
|
2290
|
+
const delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
|
|
2291
|
+
timerRef.current = setTimeout(() => {
|
|
2292
|
+
timerRef.current = null;
|
|
2293
|
+
typeNext();
|
|
2278
2294
|
}, delay);
|
|
2279
2295
|
} else {
|
|
2280
2296
|
handleIsTextStreaming?.(false);
|
|
2281
2297
|
}
|
|
2298
|
+
}, []);
|
|
2299
|
+
(0, import_react6.useEffect)(() => {
|
|
2300
|
+
if (!shouldStream && !hasStartedStreaming.current) {
|
|
2301
|
+
setDisplayedText(contentRef.current);
|
|
2302
|
+
indexRef.current = contentRef.current.length;
|
|
2303
|
+
if (timerRef.current) {
|
|
2304
|
+
clearTimeout(timerRef.current);
|
|
2305
|
+
timerRef.current = null;
|
|
2306
|
+
}
|
|
2307
|
+
handleIsTextStreaming?.(false);
|
|
2308
|
+
} else {
|
|
2309
|
+
if (indexRef.current < contentRef.current.length && !timerRef.current) {
|
|
2310
|
+
handleIsTextStreaming?.(true);
|
|
2311
|
+
hasStartedStreaming.current = true;
|
|
2312
|
+
typeNext();
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2282
2315
|
return () => {
|
|
2283
|
-
if (
|
|
2316
|
+
if (timerRef.current) {
|
|
2317
|
+
clearTimeout(timerRef.current);
|
|
2318
|
+
timerRef.current = null;
|
|
2319
|
+
}
|
|
2284
2320
|
};
|
|
2285
|
-
}, [
|
|
2286
|
-
|
|
2287
|
-
displayedContent,
|
|
2288
|
-
shouldStream,
|
|
2289
|
-
getDelayForChar,
|
|
2290
|
-
handleIsTextStreaming
|
|
2291
|
-
]);
|
|
2292
|
-
return displayedContent;
|
|
2321
|
+
}, [shouldStream, typeNext]);
|
|
2322
|
+
return displayedText;
|
|
2293
2323
|
}
|
|
2294
2324
|
|
|
2295
2325
|
// src/components/molecules/call-out.tsx
|
|
2296
|
-
var
|
|
2297
|
-
var CallOut =
|
|
2298
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2327
|
+
var CallOut = React33.forwardRef(({ className, children, role, ...props }, ref) => {
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2299
2329
|
"div",
|
|
2300
2330
|
{
|
|
2301
2331
|
ref,
|
|
@@ -2306,8 +2336,8 @@ var CallOut = React32.forwardRef(({ className, children, role, ...props }, ref)
|
|
|
2306
2336
|
}
|
|
2307
2337
|
);
|
|
2308
2338
|
});
|
|
2309
|
-
var CallOutDate =
|
|
2310
|
-
return /* @__PURE__ */ (0,
|
|
2339
|
+
var CallOutDate = React33.forwardRef(({ className, children, ...props }, ref) => {
|
|
2340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2311
2341
|
"div",
|
|
2312
2342
|
{
|
|
2313
2343
|
ref,
|
|
@@ -2321,13 +2351,13 @@ var CallOutDate = React32.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2321
2351
|
}
|
|
2322
2352
|
);
|
|
2323
2353
|
});
|
|
2324
|
-
var CallOutActions =
|
|
2325
|
-
const [isLoading, setIsLoading] =
|
|
2326
|
-
const [isClicked, setIsClicked] =
|
|
2354
|
+
var CallOutActions = React33.forwardRef(({ className, actions, role, message, ...props }, ref) => {
|
|
2355
|
+
const [isLoading, setIsLoading] = React33.useState(false);
|
|
2356
|
+
const [isClicked, setIsClicked] = React33.useState(false);
|
|
2327
2357
|
if (role === "user") {
|
|
2328
2358
|
return null;
|
|
2329
2359
|
}
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("alq--callout-actions", className), ...props, children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2331
2361
|
"button",
|
|
2332
2362
|
{
|
|
2333
2363
|
className: cn(
|
|
@@ -2349,7 +2379,7 @@ var CallOutActions = React32.forwardRef(({ className, actions, role, message, ..
|
|
|
2349
2379
|
});
|
|
2350
2380
|
},
|
|
2351
2381
|
children: [
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2382
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2353
2383
|
"span",
|
|
2354
2384
|
{
|
|
2355
2385
|
className: cn("alq-action-icon-wrapper", {
|
|
@@ -2358,18 +2388,18 @@ var CallOutActions = React32.forwardRef(({ className, actions, role, message, ..
|
|
|
2358
2388
|
children: action.icon
|
|
2359
2389
|
}
|
|
2360
2390
|
),
|
|
2361
|
-
/* @__PURE__ */ (0,
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("label", { children: action.label })
|
|
2362
2392
|
]
|
|
2363
2393
|
},
|
|
2364
2394
|
action.label
|
|
2365
2395
|
)) });
|
|
2366
2396
|
});
|
|
2367
|
-
var CallOutResponse =
|
|
2397
|
+
var CallOutResponse = React33.forwardRef(
|
|
2368
2398
|
({ className, children, role, additionalInfo, isStreaming, handleIsTextStreaming, ...props }, ref) => {
|
|
2369
2399
|
const content = String(children || "");
|
|
2370
2400
|
const shouldStream = role === "assistant" && isStreaming;
|
|
2371
2401
|
const displayedContent = useTextStreaming(content, shouldStream ?? false, handleIsTextStreaming);
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2373
2403
|
"div",
|
|
2374
2404
|
{
|
|
2375
2405
|
ref,
|
|
@@ -2382,8 +2412,8 @@ var CallOutResponse = React32.forwardRef(
|
|
|
2382
2412
|
),
|
|
2383
2413
|
...props,
|
|
2384
2414
|
children: [
|
|
2385
|
-
/* @__PURE__ */ (0,
|
|
2386
|
-
additionalInfo && /* @__PURE__ */ (0,
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(RichText, { content: displayedContent }),
|
|
2416
|
+
additionalInfo && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2387
2417
|
"div",
|
|
2388
2418
|
{
|
|
2389
2419
|
className: cn(
|