analytica-frontend-lib 1.0.80 → 1.0.81

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.
@@ -1705,6 +1705,166 @@ var CardTest = forwardRef(
1705
1705
  );
1706
1706
  }
1707
1707
  );
1708
+ var SIMULATION_TYPE_STYLES = {
1709
+ enem: {
1710
+ background: "bg-exam-1",
1711
+ badge: "exam1",
1712
+ text: "Enem"
1713
+ },
1714
+ prova: {
1715
+ background: "bg-exam-2",
1716
+ badge: "exam2",
1717
+ text: "Prova"
1718
+ },
1719
+ simulado: {
1720
+ background: "bg-exam-3",
1721
+ badge: "exam3",
1722
+ text: "Simulado"
1723
+ },
1724
+ vestibular: {
1725
+ background: "bg-exam-4",
1726
+ badge: "exam4",
1727
+ text: "Vestibular"
1728
+ }
1729
+ };
1730
+ var CardSimulationHistory = forwardRef(
1731
+ ({
1732
+ title = "Simulados",
1733
+ activeTab = "history",
1734
+ data,
1735
+ onTabChange,
1736
+ onSimulationClick,
1737
+ className,
1738
+ ...props
1739
+ }, ref) => {
1740
+ return /* @__PURE__ */ jsxs4(
1741
+ "div",
1742
+ {
1743
+ ref,
1744
+ className: `w-full max-w-[992px] h-auto ${className}`,
1745
+ ...props,
1746
+ children: [
1747
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-row items-end justify-between gap-4 mb-4", children: [
1748
+ /* @__PURE__ */ jsx5(Text_default, { size: "2xl", weight: "bold", className: "text-text-950 flex-1", children: title }),
1749
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-row gap-2", children: [
1750
+ /* @__PURE__ */ jsxs4(
1751
+ "button",
1752
+ {
1753
+ type: "button",
1754
+ onClick: () => onTabChange?.("create"),
1755
+ className: `
1756
+ flex flex-row justify-center items-center px-4 py-3 gap-2 rounded-md relative
1757
+ ${activeTab === "create" ? "text-text-950" : "text-text-950 hover:bg-background-50"}
1758
+ `,
1759
+ children: [
1760
+ /* @__PURE__ */ jsx5(Text_default, { size: "xs", weight: "bold", className: "leading-4 tracking-wide", children: "Criar Simulado" }),
1761
+ activeTab === "create" && /* @__PURE__ */ jsx5("div", { className: "absolute bottom-0 left-2 right-2 h-1 bg-primary-950 rounded-lg" })
1762
+ ]
1763
+ }
1764
+ ),
1765
+ /* @__PURE__ */ jsxs4(
1766
+ "button",
1767
+ {
1768
+ type: "button",
1769
+ onClick: () => onTabChange?.("history"),
1770
+ className: `
1771
+ flex flex-row justify-center items-center px-4 py-3 gap-2 rounded-md relative
1772
+ ${activeTab === "history" ? "text-text-950" : "text-text-950 hover:bg-background-50"}
1773
+ `,
1774
+ children: [
1775
+ /* @__PURE__ */ jsx5(Text_default, { size: "xs", weight: "bold", className: "leading-4 tracking-wide", children: "Hist\xF3rico" }),
1776
+ activeTab === "history" && /* @__PURE__ */ jsx5("div", { className: "absolute bottom-0 left-2 right-2 h-1 bg-primary-950 rounded-lg" })
1777
+ ]
1778
+ }
1779
+ )
1780
+ ] })
1781
+ ] }),
1782
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-0", children: [
1783
+ data.map((section, sectionIndex) => /* @__PURE__ */ jsx5("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs4(
1784
+ "div",
1785
+ {
1786
+ className: `
1787
+ flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white
1788
+ ${sectionIndex === 0 ? "rounded-t-3xl" : ""}
1789
+ `,
1790
+ children: [
1791
+ /* @__PURE__ */ jsx5(
1792
+ Text_default,
1793
+ {
1794
+ size: "xs",
1795
+ weight: "bold",
1796
+ className: "text-text-800 w-11 flex-shrink-0",
1797
+ children: section.date
1798
+ }
1799
+ ),
1800
+ /* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
1801
+ const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
1802
+ return /* @__PURE__ */ jsx5(
1803
+ CardBase,
1804
+ {
1805
+ layout: "horizontal",
1806
+ padding: "medium",
1807
+ minHeight: "none",
1808
+ cursor: "pointer",
1809
+ className: `
1810
+ ${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
1811
+ transition-shadow duration-200 h-auto min-h-[61px]
1812
+ `,
1813
+ onClick: () => onSimulationClick?.(simulation),
1814
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex justify-between items-center w-full gap-2", children: [
1815
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
1816
+ /* @__PURE__ */ jsx5(
1817
+ Text_default,
1818
+ {
1819
+ size: "lg",
1820
+ weight: "bold",
1821
+ className: "text-text-950 truncate",
1822
+ children: simulation.title
1823
+ }
1824
+ ),
1825
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
1826
+ /* @__PURE__ */ jsx5(
1827
+ Badge_default,
1828
+ {
1829
+ variant: "examsOutlined",
1830
+ action: typeStyles.badge,
1831
+ size: "medium",
1832
+ children: typeStyles.text
1833
+ }
1834
+ ),
1835
+ /* @__PURE__ */ jsx5(
1836
+ Text_default,
1837
+ {
1838
+ size: "sm",
1839
+ className: "text-text-800 truncate",
1840
+ children: simulation.info
1841
+ }
1842
+ )
1843
+ ] })
1844
+ ] }),
1845
+ /* @__PURE__ */ jsx5(
1846
+ CaretRight,
1847
+ {
1848
+ size: 24,
1849
+ className: "text-text-800 flex-shrink-0",
1850
+ "data-testid": "caret-icon"
1851
+ }
1852
+ )
1853
+ ] })
1854
+ },
1855
+ simulation.id
1856
+ );
1857
+ }) })
1858
+ ]
1859
+ }
1860
+ ) }, section.date)),
1861
+ data.length > 0 && /* @__PURE__ */ jsx5("div", { className: "w-full h-6 bg-white rounded-b-3xl" })
1862
+ ] })
1863
+ ]
1864
+ }
1865
+ );
1866
+ }
1867
+ );
1708
1868
 
1709
1869
  // src/components/Accordation/Accordation.tsx
1710
1870
  import { CaretRight as CaretRight2 } from "phosphor-react";