@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.
Files changed (54) hide show
  1. package/dist/components/atoms/index.d.mts +4 -1
  2. package/dist/components/atoms/index.d.ts +4 -1
  3. package/dist/components/atoms/index.js +39 -17
  4. package/dist/components/atoms/index.js.map +1 -1
  5. package/dist/components/atoms/index.mjs +35 -13
  6. package/dist/components/atoms/index.mjs.map +1 -1
  7. package/dist/components/hooks/index.js +41 -32
  8. package/dist/components/hooks/index.js.map +1 -1
  9. package/dist/components/hooks/index.mjs +42 -33
  10. package/dist/components/hooks/index.mjs.map +1 -1
  11. package/dist/components/index.d.mts +2 -1
  12. package/dist/components/index.d.ts +2 -1
  13. package/dist/components/index.js +39 -17
  14. package/dist/components/index.js.map +1 -1
  15. package/dist/components/index.mjs +35 -13
  16. package/dist/components/index.mjs.map +1 -1
  17. package/dist/components/molecules/documents/index.js +82 -52
  18. package/dist/components/molecules/documents/index.js.map +1 -1
  19. package/dist/components/molecules/documents/index.mjs +67 -37
  20. package/dist/components/molecules/documents/index.mjs.map +1 -1
  21. package/dist/components/molecules/index.js +186 -156
  22. package/dist/components/molecules/index.js.map +1 -1
  23. package/dist/components/molecules/index.mjs +179 -149
  24. package/dist/components/molecules/index.mjs.map +1 -1
  25. package/dist/components/molecules/viewers/index.js +31 -10
  26. package/dist/components/molecules/viewers/index.js.map +1 -1
  27. package/dist/components/molecules/viewers/index.mjs +30 -9
  28. package/dist/components/molecules/viewers/index.mjs.map +1 -1
  29. package/dist/components/organisms/index.d.mts +3 -1
  30. package/dist/components/organisms/index.d.ts +3 -1
  31. package/dist/components/organisms/index.js +228 -196
  32. package/dist/components/organisms/index.js.map +1 -1
  33. package/dist/components/organisms/index.mjs +217 -185
  34. package/dist/components/organisms/index.mjs.map +1 -1
  35. package/dist/components/templates/cards/index.js +57 -36
  36. package/dist/components/templates/cards/index.js.map +1 -1
  37. package/dist/components/templates/cards/index.mjs +45 -24
  38. package/dist/components/templates/cards/index.mjs.map +1 -1
  39. package/dist/components/templates/index.js +57 -36
  40. package/dist/components/templates/index.js.map +1 -1
  41. package/dist/components/templates/index.mjs +45 -24
  42. package/dist/components/templates/index.mjs.map +1 -1
  43. package/dist/index.d.mts +3 -2
  44. package/dist/index.d.ts +3 -2
  45. package/dist/index.js +283 -250
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +262 -229
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/package.json +137 -0
  50. package/dist/types/index.d.mts +12 -1
  51. package/dist/types/index.d.ts +12 -1
  52. package/dist/types/index.js.map +1 -1
  53. package/dist/types/index.mjs.map +1 -1
  54. package/package.json +21 -3
@@ -1529,8 +1529,37 @@ var init_loader = __esm({
1529
1529
  }
1530
1530
  });
1531
1531
 
1532
- // src/components/hooks/use-toast.ts
1532
+ // src/components/atoms/ui/separator.tsx
1533
1533
  import * as React23 from "react";
1534
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
1535
+ import { jsx as jsx28 } from "react/jsx-runtime";
1536
+ var Separator2;
1537
+ var init_separator = __esm({
1538
+ "src/components/atoms/ui/separator.tsx"() {
1539
+ "use strict";
1540
+ "use client";
1541
+ init_utils();
1542
+ Separator2 = React23.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx28(
1543
+ SeparatorPrimitive.Root,
1544
+ {
1545
+ ref,
1546
+ decorative,
1547
+ orientation,
1548
+ className: cn(
1549
+ "shrink-0 bg-border",
1550
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
1551
+ className,
1552
+ "alq--separator"
1553
+ ),
1554
+ ...props
1555
+ }
1556
+ ));
1557
+ Separator2.displayName = SeparatorPrimitive.Root.displayName;
1558
+ }
1559
+ });
1560
+
1561
+ // src/components/hooks/use-toast.ts
1562
+ import * as React24 from "react";
1534
1563
  var init_use_toast = __esm({
1535
1564
  "src/components/hooks/use-toast.ts"() {
1536
1565
  "use strict";
@@ -1539,7 +1568,7 @@ var init_use_toast = __esm({
1539
1568
  });
1540
1569
 
1541
1570
  // src/components/atoms/ui/toaster.tsx
1542
- import { jsx as jsx28, jsxs as jsxs9 } from "react/jsx-runtime";
1571
+ import { jsx as jsx29, jsxs as jsxs9 } from "react/jsx-runtime";
1543
1572
  var init_toaster = __esm({
1544
1573
  "src/components/atoms/ui/toaster.tsx"() {
1545
1574
  "use strict";
@@ -1550,10 +1579,10 @@ var init_toaster = __esm({
1550
1579
  });
1551
1580
 
1552
1581
  // src/components/atoms/ui/think-indicator.tsx
1553
- import * as React24 from "react";
1582
+ import * as React25 from "react";
1554
1583
  import { useState as useState2, useEffect as useEffect2 } from "react";
1555
1584
  import { cva as cva8 } from "class-variance-authority";
1556
- import { jsx as jsx29, jsxs as jsxs10 } from "react/jsx-runtime";
1585
+ import { jsx as jsx30, jsxs as jsxs10 } from "react/jsx-runtime";
1557
1586
  var thinkIndicatorVariants, ThinkIndicator;
1558
1587
  var init_think_indicator = __esm({
1559
1588
  "src/components/atoms/ui/think-indicator.tsx"() {
@@ -1582,7 +1611,7 @@ var init_think_indicator = __esm({
1582
1611
  }
1583
1612
  }
1584
1613
  );
1585
- ThinkIndicator = React24.forwardRef(
1614
+ ThinkIndicator = React25.forwardRef(
1586
1615
  ({
1587
1616
  className,
1588
1617
  variant,
@@ -1620,7 +1649,7 @@ var init_think_indicator = __esm({
1620
1649
  className: cn(thinkIndicatorVariants({ variant, size }), className, "alq--think-indicator"),
1621
1650
  ...props,
1622
1651
  children: [
1623
- loader || /* @__PURE__ */ jsx29(
1652
+ loader || /* @__PURE__ */ jsx30(
1624
1653
  Loader,
1625
1654
  {
1626
1655
  className: cn(
@@ -1628,7 +1657,7 @@ var init_think_indicator = __esm({
1628
1657
  )
1629
1658
  }
1630
1659
  ),
1631
- /* @__PURE__ */ jsx29(
1660
+ /* @__PURE__ */ jsx30(
1632
1661
  "div",
1633
1662
  {
1634
1663
  className: cn(
@@ -1682,6 +1711,7 @@ var init_atoms = __esm({
1682
1711
  init_dialog();
1683
1712
  init_toast();
1684
1713
  init_loader();
1714
+ init_separator();
1685
1715
  init_toaster();
1686
1716
  init_think_indicator();
1687
1717
  }
@@ -1718,7 +1748,7 @@ import { ChevronLeft, ChevronRight as ChevronRight2, ZoomIn, ZoomOut } from "luc
1718
1748
  import { pdfjs, Document, Page } from "react-pdf";
1719
1749
  import "react-pdf/dist/esm/Page/AnnotationLayer.css";
1720
1750
  import "react-pdf/dist/esm/Page/TextLayer.css";
1721
- import { Fragment, jsx as jsx30, jsxs as jsxs11 } from "react/jsx-runtime";
1751
+ import { Fragment, jsx as jsx31, jsxs as jsxs11 } from "react/jsx-runtime";
1722
1752
  function PdfViewer({ doc, docId }) {
1723
1753
  const [numPages, setNumPages] = useState4(0);
1724
1754
  const [pageNumber, setPageNumber] = useState4(1);
@@ -1768,12 +1798,12 @@ function PdfViewer({ doc, docId }) {
1768
1798
  return /* @__PURE__ */ jsxs11(Fragment, { children: [
1769
1799
  /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center p-4 border-b border-border", children: [
1770
1800
  /* @__PURE__ */ jsxs11("div", { children: [
1771
- /* @__PURE__ */ jsx30(
1801
+ /* @__PURE__ */ jsx31(
1772
1802
  Button,
1773
1803
  {
1774
1804
  onClick: handlePrevPage,
1775
1805
  disabled: pageNumber <= 1,
1776
- children: /* @__PURE__ */ jsx30(ChevronLeft, { className: "h-4 w-4" })
1806
+ children: /* @__PURE__ */ jsx31(ChevronLeft, { className: "h-4 w-4" })
1777
1807
  }
1778
1808
  ),
1779
1809
  /* @__PURE__ */ jsxs11("span", { className: "mx-2", children: [
@@ -1782,32 +1812,32 @@ function PdfViewer({ doc, docId }) {
1782
1812
  " of ",
1783
1813
  numPages
1784
1814
  ] }),
1785
- /* @__PURE__ */ jsx30(
1815
+ /* @__PURE__ */ jsx31(
1786
1816
  Button,
1787
1817
  {
1788
1818
  onClick: handleNextPage,
1789
1819
  disabled: pageNumber >= numPages,
1790
- children: /* @__PURE__ */ jsx30(ChevronRight2, { className: "h-4 w-4" })
1820
+ children: /* @__PURE__ */ jsx31(ChevronRight2, { className: "h-4 w-4" })
1791
1821
  }
1792
1822
  )
1793
1823
  ] }),
1794
1824
  /* @__PURE__ */ jsxs11("div", { children: [
1795
- /* @__PURE__ */ jsx30(Button, { onClick: handleZoomOut, children: /* @__PURE__ */ jsx30(ZoomOut, { className: "h-4 w-4" }) }),
1825
+ /* @__PURE__ */ jsx31(Button, { onClick: handleZoomOut, children: /* @__PURE__ */ jsx31(ZoomOut, { className: "h-4 w-4" }) }),
1796
1826
  /* @__PURE__ */ jsxs11("span", { className: "mx-2", children: [
1797
1827
  (scale * 100).toFixed(0),
1798
1828
  "%"
1799
1829
  ] }),
1800
- /* @__PURE__ */ jsx30(Button, { onClick: handleZoomIn, children: /* @__PURE__ */ jsx30(ZoomIn, { className: "h-4 w-4" }) })
1830
+ /* @__PURE__ */ jsx31(Button, { onClick: handleZoomIn, children: /* @__PURE__ */ jsx31(ZoomIn, { className: "h-4 w-4" }) })
1801
1831
  ] })
1802
1832
  ] }),
1803
- /* @__PURE__ */ jsx30("div", { ref: setContainerRef, className: "overflow-auto", children: /* @__PURE__ */ jsx30(
1833
+ /* @__PURE__ */ jsx31("div", { ref: setContainerRef, className: "overflow-auto", children: /* @__PURE__ */ jsx31(
1804
1834
  Document,
1805
1835
  {
1806
1836
  file: doc,
1807
1837
  onLoadSuccess: onDocumentLoadSuccess,
1808
1838
  options,
1809
- loading: /* @__PURE__ */ jsx30(Loader, { size: "xl", colorVariant: "destructive" }),
1810
- children: /* @__PURE__ */ jsx30(
1839
+ loading: /* @__PURE__ */ jsx31(Loader, { size: "xl", colorVariant: "destructive" }),
1840
+ children: /* @__PURE__ */ jsx31(
1811
1841
  Page,
1812
1842
  {
1813
1843
  pageNumber,
@@ -1843,7 +1873,7 @@ __export(plain_text_viewer_exports, {
1843
1873
  default: () => PlainTextViewer
1844
1874
  });
1845
1875
  import { useState as useState5, useEffect as useEffect5 } from "react";
1846
- import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs12 } from "react/jsx-runtime";
1876
+ import { Fragment as Fragment2, jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
1847
1877
  function PlainTextViewer({ doc }) {
1848
1878
  const [content, setContent] = useState5(null);
1849
1879
  const [loading, setLoading] = useState5(true);
@@ -1862,9 +1892,9 @@ function PlainTextViewer({ doc }) {
1862
1892
  }
1863
1893
  parseDocument();
1864
1894
  }, [doc]);
1865
- return /* @__PURE__ */ jsx31(Fragment2, { children: /* @__PURE__ */ jsxs12("div", { className: "relative w-full h-full max-h-[80vh] overflow-y-auto p-8 alq--prose", children: [
1866
- loading && /* @__PURE__ */ jsx31(Loader, {}),
1867
- !loading && /* @__PURE__ */ jsx31(RichText, { content: content || "" })
1895
+ return /* @__PURE__ */ jsx32(Fragment2, { children: /* @__PURE__ */ jsxs12("div", { className: "relative w-full h-full max-h-[80vh] overflow-y-auto p-8 alq--prose", children: [
1896
+ loading && /* @__PURE__ */ jsx32(Loader, {}),
1897
+ !loading && /* @__PURE__ */ jsx32(RichText, { content: content || "" })
1868
1898
  ] }) });
1869
1899
  }
1870
1900
  var init_plain_text_viewer = __esm({
@@ -1920,7 +1950,7 @@ var useDocumentReader = (url, getDocument) => {
1920
1950
 
1921
1951
  // src/components/molecules/documents/document-viewer.tsx
1922
1952
  import dynamic from "next/dynamic";
1923
- import { jsx as jsx32, jsxs as jsxs13 } from "react/jsx-runtime";
1953
+ import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
1924
1954
  var PdfViewer2 = dynamic(() => Promise.resolve().then(() => (init_pdf_viewer(), pdf_viewer_exports)), { ssr: false });
1925
1955
  var PlainTextViewer2 = dynamic(() => Promise.resolve().then(() => (init_plain_text_viewer(), plain_text_viewer_exports)), { ssr: false });
1926
1956
  var DocumentViewer = ({
@@ -1937,15 +1967,15 @@ var DocumentViewer = ({
1937
1967
  fetchDocument();
1938
1968
  }
1939
1969
  }, [isOpen]);
1940
- const documentRender = document2 && !error ? /* @__PURE__ */ jsx32(DocumentFactory, { document: document2, docId: doc.id }) : /* @__PURE__ */ jsx32("div", { className: "flex flex-col items-center justify-center h-full w-full text-center p-4", children: /* @__PURE__ */ jsx32("div", { className: "text-primary font-medium", children: error }) });
1941
- return /* @__PURE__ */ jsx32(Dialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs13(
1970
+ const documentRender = document2 && !error ? /* @__PURE__ */ jsx33(DocumentFactory, { document: document2, docId: doc.id }) : /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center h-full w-full text-center p-4", children: /* @__PURE__ */ jsx33("div", { className: "text-primary font-medium", children: error }) });
1971
+ return /* @__PURE__ */ jsx33(Dialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs13(
1942
1972
  DialogContent,
1943
1973
  {
1944
1974
  "aria-describedby": document2 ? "document-description" : void 0,
1945
1975
  className: "h-[90%] max-w-[90%] gap-0 flex flex-col focus:outline-none",
1946
1976
  children: [
1947
- /* @__PURE__ */ jsx32(DialogHeader, { className: "border-b border-border pb-2", children: /* @__PURE__ */ jsx32(DialogTitle, { children: doc.name }) }),
1948
- !document2 && loading ? /* @__PURE__ */ jsx32(Loader, { size: "xl", colorVariant: "destructive" }) : documentRender
1977
+ /* @__PURE__ */ jsx33(DialogHeader, { className: "border-b border-border pb-2", children: /* @__PURE__ */ jsx33(DialogTitle, { children: doc.name }) }),
1978
+ !document2 && loading ? /* @__PURE__ */ jsx33(Loader, { size: "xl", colorVariant: "destructive" }) : documentRender
1949
1979
  ]
1950
1980
  }
1951
1981
  ) });
@@ -1953,16 +1983,16 @@ var DocumentViewer = ({
1953
1983
  var DocumentFactory = ({ document: document2, docId }) => {
1954
1984
  switch (document2 && document2.type) {
1955
1985
  case "application/pdf":
1956
- return /* @__PURE__ */ jsx32(PdfViewer2, { doc: document2, docId });
1986
+ return /* @__PURE__ */ jsx33(PdfViewer2, { doc: document2, docId });
1957
1987
  case "text/plain":
1958
- return /* @__PURE__ */ jsx32(PlainTextViewer2, { doc: document2, docId });
1988
+ return /* @__PURE__ */ jsx33(PlainTextViewer2, { doc: document2, docId });
1959
1989
  default:
1960
- return /* @__PURE__ */ jsx32("div", { children: "Unsupported file type" });
1990
+ return /* @__PURE__ */ jsx33("div", { children: "Unsupported file type" });
1961
1991
  }
1962
1992
  };
1963
1993
 
1964
1994
  // src/components/molecules/documents/document-selector.tsx
1965
- import { jsx as jsx33, jsxs as jsxs14 } from "react/jsx-runtime";
1995
+ import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
1966
1996
  var DocumentSelector = ({ documents, getDocument, logInfoMessage }) => {
1967
1997
  const [selectedDocName, setSelectedDocName] = useState6(void 0);
1968
1998
  const [selectedDoc, setSelectedDoc] = useState6(null);
@@ -1981,24 +2011,24 @@ var DocumentSelector = ({ documents, getDocument, logInfoMessage }) => {
1981
2011
  };
1982
2012
  return /* @__PURE__ */ jsxs14("div", { className: "w-full md:w-4/6 alq--document-selector", children: [
1983
2013
  /* @__PURE__ */ jsxs14(Select, { value: selectedDocName, onValueChange: setSelectedDocName, children: [
1984
- /* @__PURE__ */ jsx33(SelectTrigger, { "aria-label": "Documentos", children: /* @__PURE__ */ jsx33(SelectValue, { placeholder: "Documentos" }) }),
1985
- /* @__PURE__ */ jsx33(SelectContent, { children: /* @__PURE__ */ jsxs14(SelectGroup, { children: [
1986
- /* @__PURE__ */ jsx33(SelectLabel, { children: "Documents" }),
2014
+ /* @__PURE__ */ jsx34(SelectTrigger, { "aria-label": "Documentos", children: /* @__PURE__ */ jsx34(SelectValue, { placeholder: "Documentos" }) }),
2015
+ /* @__PURE__ */ jsx34(SelectContent, { children: /* @__PURE__ */ jsxs14(SelectGroup, { children: [
2016
+ /* @__PURE__ */ jsx34(SelectLabel, { children: "Documents" }),
1987
2017
  documents.map((doc) => /* @__PURE__ */ jsxs14("div", { className: "w-full flex relative", children: [
1988
- /* @__PURE__ */ jsx33(SelectItem, { className: "w-full", value: doc.id, children: /* @__PURE__ */ jsx33("div", { className: "flex justify-between w-full", children: /* @__PURE__ */ jsx33("p", { className: "h-4 truncate mr-5", children: doc.name }) }) }, doc.id),
1989
- /* @__PURE__ */ jsx33(
2018
+ /* @__PURE__ */ jsx34(SelectItem, { className: "w-full", value: doc.id, children: /* @__PURE__ */ jsx34("div", { className: "flex justify-between w-full", children: /* @__PURE__ */ jsx34("p", { className: "h-4 truncate mr-5", children: doc.name }) }) }, doc.id),
2019
+ /* @__PURE__ */ jsx34(
1990
2020
  "div",
1991
2021
  {
1992
2022
  onClick: (event) => handleDocumentClick(doc, event),
1993
2023
  className: "bflex items-center text-gray-400 hover:text-gray-500 absolute right-0 mt-2",
1994
2024
  "aria-label": `Open ${doc.name}`,
1995
- children: /* @__PURE__ */ jsx33(ExternalLink, { className: "h-4 w-4 mx-2" })
2025
+ children: /* @__PURE__ */ jsx34(ExternalLink, { className: "h-4 w-4 mx-2" })
1996
2026
  }
1997
2027
  )
1998
2028
  ] }, doc.id))
1999
2029
  ] }) })
2000
2030
  ] }),
2001
- selectedDoc && /* @__PURE__ */ jsx33(
2031
+ selectedDoc && /* @__PURE__ */ jsx34(
2002
2032
  DocumentViewer,
2003
2033
  {
2004
2034
  doc: selectedDoc,