analytica-frontend-lib 1.1.60 → 1.1.61

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.
@@ -69,6 +69,6 @@ declare const CheckBox: react.ForwardRefExoticComponent<{
69
69
  className?: string;
70
70
  /** Label CSS classes */
71
71
  labelClassName?: string;
72
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & react.RefAttributes<HTMLInputElement>>;
72
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
73
73
 
74
74
  export { type CheckBoxProps, CheckBox as default };
@@ -69,6 +69,6 @@ declare const CheckBox: react.ForwardRefExoticComponent<{
69
69
  className?: string;
70
70
  /** Label CSS classes */
71
71
  labelClassName?: string;
72
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & react.RefAttributes<HTMLInputElement>>;
72
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
73
73
 
74
74
  export { type CheckBoxProps, CheckBox as default };
@@ -1,3 +1,3 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { j as LegacyNotificationCard, L as LegacyNotificationCardProps, i as NotificationCardProps, b as NotificationGroup, f as NotificationItem, e as default } from '../NotificationCard-DpSGkWEa.mjs';
3
+ export { j as LegacyNotificationCard, L as LegacyNotificationCardProps, i as NotificationCardProps, b as NotificationGroup, f as NotificationItem, e as default } from '../NotificationCard-4GgB0Nsf.mjs';
@@ -1,3 +1,3 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { j as LegacyNotificationCard, L as LegacyNotificationCardProps, i as NotificationCardProps, b as NotificationGroup, f as NotificationItem, e as default } from '../NotificationCard-DpSGkWEa.js';
3
+ export { j as LegacyNotificationCard, L as LegacyNotificationCardProps, i as NotificationCardProps, b as NotificationGroup, f as NotificationItem, e as default } from '../NotificationCard-4GgB0Nsf.js';
@@ -1658,6 +1658,7 @@ var NotificationCenter = ({
1658
1658
  getActionLabel,
1659
1659
  onFetchNotifications,
1660
1660
  onMarkAllAsRead,
1661
+ onOpenChange,
1661
1662
  emptyStateImage,
1662
1663
  emptyStateTitle,
1663
1664
  emptyStateDescription,
@@ -1673,6 +1674,13 @@ var NotificationCenter = ({
1673
1674
  const handleDesktopClick = () => {
1674
1675
  onToggleActive?.();
1675
1676
  };
1677
+ const handleOpenChange = (open) => {
1678
+ const controlledByParent = typeof isActive === "boolean" && typeof onToggleActive === "function";
1679
+ onOpenChange?.(open);
1680
+ if (controlledByParent && !onOpenChange && !open && isActive) {
1681
+ onToggleActive?.();
1682
+ }
1683
+ };
1676
1684
  (0, import_react9.useEffect)(() => {
1677
1685
  if (isActive) {
1678
1686
  onFetchNotifications?.();
@@ -1750,72 +1758,78 @@ var NotificationCenter = ({
1750
1758
  ] });
1751
1759
  }
1752
1760
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1753
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DropdownMenu_default, { children: [
1754
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1755
- IconButton_default,
1756
- {
1757
- active: isActive,
1758
- onClick: handleDesktopClick,
1759
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1760
- import_phosphor_react5.Bell,
1761
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1762
+ DropdownMenu_default,
1763
+ {
1764
+ ...typeof isActive === "boolean" ? { open: isActive, onOpenChange: handleOpenChange } : { onOpenChange: handleOpenChange },
1765
+ children: [
1766
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1767
+ IconButton_default,
1761
1768
  {
1762
- size: 24,
1763
- className: isActive ? "text-primary-950" : "text-primary"
1764
- }
1765
- ),
1766
- className
1767
- }
1768
- ) }),
1769
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1770
- DropdownMenuContent,
1771
- {
1772
- className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
1773
- side: "bottom",
1774
- align: "end",
1775
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
1776
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-b border-border-200", children: [
1777
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1778
- NotificationHeader,
1769
+ active: isActive,
1770
+ onClick: handleDesktopClick,
1771
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1772
+ import_phosphor_react5.Bell,
1779
1773
  {
1780
- unreadCount,
1781
- variant: "dropdown"
1774
+ size: 24,
1775
+ className: isActive ? "text-primary-950" : "text-primary"
1782
1776
  }
1783
1777
  ),
1784
- unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1785
- "button",
1786
- {
1787
- type: "button",
1788
- onClick: onMarkAllAsRead,
1789
- className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
1790
- children: "Marcar todas como lidas"
1791
- }
1792
- )
1793
- ] }),
1794
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1795
- NotificationList,
1796
- {
1797
- groupedNotifications,
1798
- loading,
1799
- error,
1800
- onRetry,
1801
- onMarkAsReadById,
1802
- onDeleteById,
1803
- onNavigateById,
1804
- onGlobalNotificationClick: (notification) => {
1805
- setGlobalNotificationModal({
1806
- isOpen: true,
1807
- notification
1808
- });
1809
- },
1810
- getActionLabel,
1811
- renderEmpty: renderEmptyState,
1812
- emptyStateImage
1813
- }
1814
- ) })
1815
- ] })
1816
- }
1817
- )
1818
- ] }),
1778
+ className
1779
+ }
1780
+ ) }),
1781
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1782
+ DropdownMenuContent,
1783
+ {
1784
+ className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
1785
+ side: "bottom",
1786
+ align: "end",
1787
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
1788
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-b border-border-200", children: [
1789
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1790
+ NotificationHeader,
1791
+ {
1792
+ unreadCount,
1793
+ variant: "dropdown"
1794
+ }
1795
+ ),
1796
+ unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1797
+ "button",
1798
+ {
1799
+ type: "button",
1800
+ onClick: onMarkAllAsRead,
1801
+ className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
1802
+ children: "Marcar todas como lidas"
1803
+ }
1804
+ )
1805
+ ] }),
1806
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1807
+ NotificationList,
1808
+ {
1809
+ groupedNotifications,
1810
+ loading,
1811
+ error,
1812
+ onRetry,
1813
+ onMarkAsReadById,
1814
+ onDeleteById,
1815
+ onNavigateById,
1816
+ onGlobalNotificationClick: (notification) => {
1817
+ setGlobalNotificationModal({
1818
+ isOpen: true,
1819
+ notification
1820
+ });
1821
+ },
1822
+ getActionLabel,
1823
+ renderEmpty: renderEmptyState,
1824
+ emptyStateImage
1825
+ }
1826
+ ) })
1827
+ ] })
1828
+ }
1829
+ )
1830
+ ]
1831
+ }
1832
+ ),
1819
1833
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1820
1834
  Modal_default,
1821
1835
  {