analytica-frontend-lib 1.0.72 → 1.0.73

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.
@@ -1576,6 +1576,125 @@ var CardSimulado = forwardRef(
1576
1576
  );
1577
1577
  }
1578
1578
  );
1579
+ var CardTest = forwardRef(
1580
+ ({
1581
+ title,
1582
+ duration,
1583
+ questionsCount,
1584
+ additionalInfo,
1585
+ selected = false,
1586
+ onSelect,
1587
+ className = "",
1588
+ ...props
1589
+ }, ref) => {
1590
+ const handleClick = () => {
1591
+ if (onSelect) {
1592
+ onSelect(!selected);
1593
+ }
1594
+ };
1595
+ const handleKeyDown = (event) => {
1596
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
1597
+ event.preventDefault();
1598
+ onSelect(!selected);
1599
+ }
1600
+ };
1601
+ const isSelectable = !!onSelect;
1602
+ const getQuestionsText = (count) => {
1603
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
1604
+ return `${count} ${singular}`;
1605
+ };
1606
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
1607
+ const baseClasses = "flex flex-row items-center p-4 gap-2 w-full max-w-full bg-background shadow-soft-shadow-1 rounded-xl isolate border-0 text-left";
1608
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
1609
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
1610
+ if (isSelectable) {
1611
+ return /* @__PURE__ */ jsx5(
1612
+ "button",
1613
+ {
1614
+ ref,
1615
+ type: "button",
1616
+ className: `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim(),
1617
+ onClick: handleClick,
1618
+ onKeyDown: handleKeyDown,
1619
+ "aria-pressed": selected,
1620
+ ...props,
1621
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
1622
+ /* @__PURE__ */ jsx5(
1623
+ Text_default,
1624
+ {
1625
+ size: "md",
1626
+ weight: "bold",
1627
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
1628
+ children: title
1629
+ }
1630
+ ),
1631
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
1632
+ duration && /* @__PURE__ */ jsxs4("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
1633
+ /* @__PURE__ */ jsx5(Clock, { size: 16, className: "text-text-700" }),
1634
+ /* @__PURE__ */ jsx5(
1635
+ Text_default,
1636
+ {
1637
+ size: "sm",
1638
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
1639
+ children: duration
1640
+ }
1641
+ )
1642
+ ] }),
1643
+ /* @__PURE__ */ jsx5(
1644
+ Text_default,
1645
+ {
1646
+ size: "sm",
1647
+ className: "text-text-700 leading-[21px] flex-grow truncate",
1648
+ children: displayInfo
1649
+ }
1650
+ )
1651
+ ] })
1652
+ ] })
1653
+ }
1654
+ );
1655
+ }
1656
+ return /* @__PURE__ */ jsx5(
1657
+ "div",
1658
+ {
1659
+ ref,
1660
+ className: `${baseClasses} ${className}`.trim(),
1661
+ ...props,
1662
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
1663
+ /* @__PURE__ */ jsx5(
1664
+ Text_default,
1665
+ {
1666
+ size: "md",
1667
+ weight: "bold",
1668
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
1669
+ children: title
1670
+ }
1671
+ ),
1672
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
1673
+ duration && /* @__PURE__ */ jsxs4("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
1674
+ /* @__PURE__ */ jsx5(Clock, { size: 16, className: "text-text-700" }),
1675
+ /* @__PURE__ */ jsx5(
1676
+ Text_default,
1677
+ {
1678
+ size: "sm",
1679
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
1680
+ children: duration
1681
+ }
1682
+ )
1683
+ ] }),
1684
+ /* @__PURE__ */ jsx5(
1685
+ Text_default,
1686
+ {
1687
+ size: "sm",
1688
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
1689
+ children: displayInfo
1690
+ }
1691
+ )
1692
+ ] })
1693
+ ] })
1694
+ }
1695
+ );
1696
+ }
1697
+ );
1579
1698
 
1580
1699
  // src/components/Accordation/Accordation.tsx
1581
1700
  import { CaretRight as CaretRight2 } from "phosphor-react";