@greatapps/common 1.1.163 → 1.1.164

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.
@@ -24,10 +24,10 @@ function CancelledSubscriptionBanner({ onReactivate }) {
24
24
  const daysSinceCancellation = daysBetween(new Date(cancellationDate), today);
25
25
  if (daysSinceCancellation < 0 || daysSinceCancellation > 5) return null;
26
26
  const daysRemaining = Math.max(0, 5 - daysSinceCancellation);
27
- return /* @__PURE__ */ jsx("div", { className: "fixed top-[72px] md:top-0 lg:left-[273px] left-0 right-0 z-50 flex justify-center pointer-events-none px-4 lg:px-0", children: /* @__PURE__ */ jsxs(
27
+ return /* @__PURE__ */ jsx("div", { className: "fixed top-[80px] md:top-0 lg:left-[273px] left-0 right-0 z-[60] flex justify-center pointer-events-none px-4 lg:px-0", children: /* @__PURE__ */ jsxs(
28
28
  "div",
29
29
  {
30
- className: `flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? "translate-y-0 md:translate-y-10" : "-translate-y-full"}`,
30
+ className: `flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? "translate-y-0 md:translate-y-9" : "-translate-y-full"}`,
31
31
  children: [
32
32
  daysRemaining > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-1 w-full sm:w-auto", children: [
33
33
  /* @__PURE__ */ jsx(IconAlertOctagon, { size: 16, className: "text-white shrink-0" }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/navigation/CancelledSubscriptionBanner.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { IconAlertOctagon, IconX } from '@tabler/icons-react';\nimport { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';\n\nfunction daysBetween(a: Date, b: Date): number {\n const msPerDay = 24 * 60 * 60 * 1000;\n const da = new Date(a.getFullYear(), a.getMonth(), a.getDate());\n const db = new Date(b.getFullYear(), b.getMonth(), b.getDate());\n return Math.round((db.getTime() - da.getTime()) / msPerDay);\n}\n\ninterface CancelledSubscriptionBannerProps {\n onReactivate?: () => void;\n}\n\nexport function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscriptionBannerProps) {\n const { data: { data: [subscription] = [] } = {} } = useActiveSubscription();\n const [visible, setVisible] = useState(true);\n const [animated, setAnimated] = useState(false);\n\n useEffect(() => {\n const timer = setTimeout(() => setAnimated(true), 50);\n return () => clearTimeout(timer);\n }, []);\n\n const dismiss = useCallback(() => setVisible(false), []);\n\n const cancellationDate = subscription?.date_cancellation;\n if (!cancellationDate || !visible) return null;\n\n const today = new Date();\n const daysSinceCancellation = daysBetween(new Date(cancellationDate), today);\n if (daysSinceCancellation < 0 || daysSinceCancellation > 5) return null;\n\n const daysRemaining = Math.max(0, 5 - daysSinceCancellation);\n\n return (\n <div className=\"fixed top-[72px] md:top-0 lg:left-[273px] left-0 right-0 z-50 flex justify-center pointer-events-none px-4 lg:px-0\">\n <div\n className={`flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? 'translate-y-0 md:translate-y-10' : '-translate-y-full'}`}\n >\n {daysRemaining > 0 && (\n <div className=\"flex items-center gap-2 flex-1 w-full sm:w-auto\">\n <IconAlertOctagon size={16} className=\"text-white shrink-0\" />\n <span className=\"paragraph-xsmall-semibold text-white\">\n Assinatura cancelada! Em {daysRemaining} dias suas páginas serão tiradas do ar!\n </span>\n </div>\n )}\n <div className=\"flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start\">\n <button\n type=\"button\"\n className=\"flex items-center justify-center p-1.5 cursor-pointer\"\n onClick={onReactivate}\n >\n <span className=\"paragraph-xsmall-semibold text-white underline\">\n Reativar assinatura\n </span>\n </button>\n <button type=\"button\" className=\"cursor-pointer shrink-0\" onClick={dismiss}>\n <IconX size={18} className=\"text-red-200\" />\n </button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AA6CY,cACA,YADA;AA3CZ,SAAS,UAAU,WAAW,mBAAmB;AACjD,SAAS,kBAAkB,aAAa;AACxC,SAAS,6BAA6B;AAEtC,SAAS,YAAY,GAAS,GAAiB;AAC7C,QAAM,WAAW,KAAK,KAAK,KAAK;AAChC,QAAM,KAAK,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,CAAC;AAC9D,QAAM,KAAK,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,CAAC;AAC9D,SAAO,KAAK,OAAO,GAAG,QAAQ,IAAI,GAAG,QAAQ,KAAK,QAAQ;AAC5D;AAMO,SAAS,4BAA4B,EAAE,aAAa,GAAqC;AAC9F,QAAM,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,sBAAsB;AAC3E,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,IAAI;AAC3C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,YAAU,MAAM;AACd,UAAM,QAAQ,WAAW,MAAM,YAAY,IAAI,GAAG,EAAE;AACpD,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,YAAY,MAAM,WAAW,KAAK,GAAG,CAAC,CAAC;AAEvD,QAAM,mBAAmB,cAAc;AACvC,MAAI,CAAC,oBAAoB,CAAC,QAAS,QAAO;AAE1C,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,wBAAwB,YAAY,IAAI,KAAK,gBAAgB,GAAG,KAAK;AAC3E,MAAI,wBAAwB,KAAK,wBAAwB,EAAG,QAAO;AAEnE,QAAM,gBAAgB,KAAK,IAAI,GAAG,IAAI,qBAAqB;AAE3D,SACE,oBAAC,SAAI,WAAU,sHACb;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,8NAA8N,WAAW,oCAAoC,mBAAmB;AAAA,MAE1S;AAAA,wBAAgB,KACf,qBAAC,SAAI,WAAU,mDACb;AAAA,8BAAC,oBAAiB,MAAM,IAAI,WAAU,uBAAsB;AAAA,UAC5D,qBAAC,UAAK,WAAU,wCAAuC;AAAA;AAAA,YAC3B;AAAA,YAAc;AAAA,aAC1C;AAAA,WACF;AAAA,QAEF,qBAAC,SAAI,WAAU,+EACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,cAET,8BAAC,UAAK,WAAU,kDAAiD,iCAEjE;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,YAAO,MAAK,UAAS,WAAU,2BAA0B,SAAS,SACjE,8BAAC,SAAM,MAAM,IAAI,WAAU,gBAAe,GAC5C;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/navigation/CancelledSubscriptionBanner.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { IconAlertOctagon, IconX } from '@tabler/icons-react';\nimport { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';\n\nfunction daysBetween(a: Date, b: Date): number {\n const msPerDay = 24 * 60 * 60 * 1000;\n const da = new Date(a.getFullYear(), a.getMonth(), a.getDate());\n const db = new Date(b.getFullYear(), b.getMonth(), b.getDate());\n return Math.round((db.getTime() - da.getTime()) / msPerDay);\n}\n\ninterface CancelledSubscriptionBannerProps {\n onReactivate?: () => void;\n}\n\nexport function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscriptionBannerProps) {\n const { data: { data: [subscription] = [] } = {} } = useActiveSubscription();\n const [visible, setVisible] = useState(true);\n const [animated, setAnimated] = useState(false);\n\n useEffect(() => {\n const timer = setTimeout(() => setAnimated(true), 50);\n return () => clearTimeout(timer);\n }, []);\n\n const dismiss = useCallback(() => setVisible(false), []);\n\n const cancellationDate = subscription?.date_cancellation;\n if (!cancellationDate || !visible) return null;\n\n const today = new Date();\n const daysSinceCancellation = daysBetween(new Date(cancellationDate), today);\n if (daysSinceCancellation < 0 || daysSinceCancellation > 5) return null;\n\n const daysRemaining = Math.max(0, 5 - daysSinceCancellation);\n\n return (\n <div className=\"fixed top-[80px] md:top-0 lg:left-[273px] left-0 right-0 z-[60] flex justify-center pointer-events-none px-4 lg:px-0\">\n <div\n className={`flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? 'translate-y-0 md:translate-y-9' : '-translate-y-full'}`}\n >\n {daysRemaining > 0 && (\n <div className=\"flex items-center gap-2 flex-1 w-full sm:w-auto\">\n <IconAlertOctagon size={16} className=\"text-white shrink-0\" />\n <span className=\"paragraph-xsmall-semibold text-white\">\n Assinatura cancelada! Em {daysRemaining} dias suas páginas serão tiradas do ar!\n </span>\n </div>\n )}\n <div className=\"flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start\">\n <button\n type=\"button\"\n className=\"flex items-center justify-center p-1.5 cursor-pointer\"\n onClick={onReactivate}\n >\n <span className=\"paragraph-xsmall-semibold text-white underline\">\n Reativar assinatura\n </span>\n </button>\n <button type=\"button\" className=\"cursor-pointer shrink-0\" onClick={dismiss}>\n <IconX size={18} className=\"text-red-200\" />\n </button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AA6CY,cACA,YADA;AA3CZ,SAAS,UAAU,WAAW,mBAAmB;AACjD,SAAS,kBAAkB,aAAa;AACxC,SAAS,6BAA6B;AAEtC,SAAS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AAC,UAAK,WAAU,wCAAuC;AAAA;AAAA,YAC3B;AAAA,YAAc;AAAA,aAC1C;AAAA,WACF;AAAA,QAEF,qBAAC,SAAI,WAAU,+EACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,cAET,8BAAC,UAAK,WAAU,kDAAiD,iCAEjE;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,YAAO,MAAK,UAAS,WAAU,2BAA0B,SAAS,SACjE,8BAAC,SAAM,MAAM,IAAI,WAAU,gBAAe,GAC5C;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/common",
3
- "version": "1.1.163",
3
+ "version": "1.1.164",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -37,9 +37,9 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
37
37
  const daysRemaining = Math.max(0, 5 - daysSinceCancellation);
38
38
 
39
39
  return (
40
- <div className="fixed top-[72px] md:top-0 lg:left-[273px] left-0 right-0 z-50 flex justify-center pointer-events-none px-4 lg:px-0">
40
+ <div className="fixed top-[80px] md:top-0 lg:left-[273px] left-0 right-0 z-[60] flex justify-center pointer-events-none px-4 lg:px-0">
41
41
  <div
42
- className={`flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? 'translate-y-0 md:translate-y-10' : '-translate-y-full'}`}
42
+ className={`flex flex-col sm:flex-row items-start sm:items-center justify-between bg-red-500 rounded-lg px-3 py-2 sm:py-1 w-full lg:w-[805px] max-w-full pointer-events-auto transition-transform duration-500 ease-out gap-2 sm:gap-0 ${animated ? 'translate-y-0 md:translate-y-9' : '-translate-y-full'}`}
43
43
  >
44
44
  {daysRemaining > 0 && (
45
45
  <div className="flex items-center gap-2 flex-1 w-full sm:w-auto">