@donotdev/templates 0.0.9 → 0.0.10

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 (56) hide show
  1. package/dist/AdminLandingTemplate.d.ts +0 -1
  2. package/dist/AdminLandingTemplate.d.ts.map +1 -1
  3. package/dist/AdminLandingTemplate.js +1 -1
  4. package/dist/DashboardTemplate.d.ts.map +1 -1
  5. package/dist/DashboardTemplate.js +1 -1
  6. package/dist/LoginTemplate.d.ts.map +1 -1
  7. package/dist/LoginTemplate.js +1 -1
  8. package/dist/ProfileTemplate.d.ts.map +1 -1
  9. package/dist/ProfileTemplate.js +1 -1
  10. package/dist/WhatsNewTemplate.d.ts.map +1 -1
  11. package/dist/WhatsNewTemplate.js +1 -1
  12. package/dist/billing/BillingSuccessTemplate.d.ts +1 -3
  13. package/dist/billing/BillingSuccessTemplate.d.ts.map +1 -1
  14. package/dist/billing/BillingSuccessTemplate.js +1 -1
  15. package/dist/billing/CheckoutTemplate.d.ts +1 -2
  16. package/dist/billing/CheckoutTemplate.d.ts.map +1 -1
  17. package/dist/billing/CheckoutTemplate.js +1 -1
  18. package/dist/billing/PaymentTemplate.d.ts +2 -3
  19. package/dist/billing/PaymentTemplate.d.ts.map +1 -1
  20. package/dist/billing/PaymentTemplate.js +1 -1
  21. package/dist/billing/SubscriptionTemplate.d.ts +2 -3
  22. package/dist/billing/SubscriptionTemplate.d.ts.map +1 -1
  23. package/dist/billing/SubscriptionTemplate.js +1 -1
  24. package/dist/blog/BlogList.d.ts +1 -1
  25. package/dist/blog/BlogList.d.ts.map +1 -1
  26. package/dist/blog/BlogList.js +1 -1
  27. package/dist/blog/BlogPost.d.ts +1 -1
  28. package/dist/blog/BlogPost.d.ts.map +1 -1
  29. package/dist/components/MarkdownViewer.d.ts +0 -1
  30. package/dist/components/MarkdownViewer.d.ts.map +1 -1
  31. package/dist/components/MarkdownViewer.js +1 -1
  32. package/dist/crud/CarCardListTemplate.d.ts +0 -1
  33. package/dist/crud/CarCardListTemplate.d.ts.map +1 -1
  34. package/dist/crud/CarCardListTemplate.js +1 -1
  35. package/dist/crud/CarDetailTemplate.d.ts +0 -1
  36. package/dist/crud/CarDetailTemplate.d.ts.map +1 -1
  37. package/dist/crud/CarDetailTemplate.js +1 -1
  38. package/dist/crud/InquiryAdminTemplate.d.ts +1 -2
  39. package/dist/crud/InquiryAdminTemplate.d.ts.map +1 -1
  40. package/dist/crud/InquiryAdminTemplate.js +1 -1
  41. package/dist/crud/InquiryFormTemplate.d.ts +0 -1
  42. package/dist/crud/InquiryFormTemplate.d.ts.map +1 -1
  43. package/dist/crud/InquiryFormTemplate.js +1 -1
  44. package/dist/crud/ProductCardListTemplate.d.ts +0 -1
  45. package/dist/crud/ProductCardListTemplate.d.ts.map +1 -1
  46. package/dist/crud/ProductCardListTemplate.js +1 -40
  47. package/dist/legal/LegalNoticeTemplate.d.ts +10 -1
  48. package/dist/legal/LegalNoticeTemplate.d.ts.map +1 -1
  49. package/dist/legal/LegalNoticeTemplate.js +1 -1
  50. package/dist/legal/PrivacyPolicyTemplate.d.ts +10 -2
  51. package/dist/legal/PrivacyPolicyTemplate.d.ts.map +1 -1
  52. package/dist/legal/PrivacyPolicyTemplate.js +1 -1
  53. package/dist/legal/TermsOfServiceTemplate.d.ts +10 -2
  54. package/dist/legal/TermsOfServiceTemplate.d.ts.map +1 -1
  55. package/dist/legal/TermsOfServiceTemplate.js +1 -1
  56. package/package.json +12 -12
@@ -47,5 +47,4 @@ export interface AdminLandingTemplateProps {
47
47
 
48
48
  */
49
49
  export declare function AdminLandingTemplate({ title, subtitle, message, supportLink, publicWebsiteLink, redirectConfig, children, }: AdminLandingTemplateProps): import("react/jsx-runtime").JSX.Element | null;
50
- export default AdminLandingTemplate;
51
50
  //# sourceMappingURL=AdminLandingTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminLandingTemplate.d.ts","sourceRoot":"","sources":["../src/AdminLandingTemplate.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IAEvC,KAAK,EAAE,MAAM,CAAC;IAEd,oEAAoE;IAEpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,6CAA6C;IAE7C,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QAEd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,yCAAyC;IAEzC,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,wCAAwC;IAExC,iBAAiB,CAAC,EAAE;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,6BAA6B;IAE7B,cAAc,CAAC,EAAE;QACf,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;QAElC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,wDAAwD;IAExD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EAEL,QAAQ,EAER,OAAO,EAEP,WAAW,EAEX,iBAAiB,EAEjB,cAAc,EAEd,QAAQ,GACT,EAAE,yBAAyB,kDAmG3B;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"AdminLandingTemplate.d.ts","sourceRoot":"","sources":["../src/AdminLandingTemplate.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IAEvC,KAAK,EAAE,MAAM,CAAC;IAEd,oEAAoE;IAEpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,6CAA6C;IAE7C,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QAEd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,yCAAyC;IAEzC,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,wCAAwC;IAExC,iBAAiB,CAAC,EAAE;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,6BAA6B;IAE7B,cAAc,CAAC,EAAE;QACf,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;QAElC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,wDAAwD;IAExD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EAEL,QAAQ,EAER,OAAO,EAEP,WAAW,EAEX,iBAAiB,EAEjB,cAAc,EAEd,QAAQ,GACT,EAAE,yBAAyB,kDAmG3B"}
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as x,jsxs as a}from"react/jsx-runtime";import{useEffect as P}from"react";import{MultipleAuthProviders as y}from"@donotdev/auth";import{HeroSection as z,Section as L,Text as T,Stack as j}from"@donotdev/components";import{useTranslation as A,useAppConfig as C,getPlatformEnvVar as _}from"@donotdev/core";import{PageContainer as R,useNavigate as W,useRedirectGuard as k,Loader as E,Link as u}from"@donotdev/ui";function F({title:f,subtitle:m,message:i,supportLink:s,publicWebsiteLink:c,redirectConfig:l,children:h}){const{t:d}=A("dndev"),p=W(),g=C("app"),{shouldRedirect:n,redirectTo:e,isChecking:v}=k({condition:l?.condition,redirectTo:l?.redirectTo});if(P(()=>{n&&e&&p(e,{replace:!0})},[n,e,p]),v)return t(E,{});if(n&&e)return null;const o=s?.path||g?.links?.support,r=c?.path||_("APP_URL"),b=s?.label||d("adminLanding.contactSupport","Contact Support"),S=c?.label||d("adminLanding.visitWebsite","Visit Website");return a(R,{children:[t(z,{title:f,subtitle:m,variant:"primary"}),i&&t(L,{title:i.title,align:"center",children:t(T,{as:"p",level:"body",children:i.content})}),t(y,{}),h,(o||r)&&a(j,{direction:"row",gap:"tight",justify:"center",align:"center",children:[o&&a(x,{children:[t(u,{path:o,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:b}),r&&t("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:" | "})]}),r&&t(u,{path:r,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:S})]})]})}var U=F;export{F as AdminLandingTemplate,U as default};
1
+ "use client";import{jsx as t,Fragment as P,jsxs as a}from"react/jsx-runtime";import{useEffect as x}from"react";import{MultipleAuthProviders as y}from"@donotdev/auth";import{HeroSection as z,Section as L,Text as T,Stack as j}from"@donotdev/components";import{useTranslation as A,useAppConfig as C,getPlatformEnvVar as _}from"@donotdev/core";import{PageContainer as R,useNavigate as W,useRedirectGuard as k,Loader as E,Link as u}from"@donotdev/ui";function N({title:f,subtitle:m,message:i,supportLink:s,publicWebsiteLink:c,redirectConfig:l,children:h}){const{t:d}=A("dndev"),p=W(),g=C("app"),{shouldRedirect:n,redirectTo:e,isChecking:v}=k({condition:l?.condition,redirectTo:l?.redirectTo});if(x(()=>{n&&e&&p(e,{replace:!0})},[n,e,p]),v)return t(E,{});if(n&&e)return null;const o=s?.path||g?.links?.support,r=c?.path||_("APP_URL"),b=s?.label||d("adminLanding.contactSupport","Contact Support"),S=c?.label||d("adminLanding.visitWebsite","Visit Website");return a(R,{children:[t(z,{title:f,subtitle:m,variant:"primary"}),i&&t(L,{title:i.title,align:"center",children:t(T,{as:"p",level:"body",children:i.content})}),t(y,{}),h,(o||r)&&a(j,{direction:"row",gap:"tight",justify:"center",align:"center",children:[o&&a(P,{children:[t(u,{path:o,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:b}),r&&t("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:" | "})]}),r&&t(u,{path:r,style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:S})]})]})}export{N as AdminLandingTemplate};
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardTemplate.d.ts","sourceRoot":"","sources":["../src/DashboardTemplate.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAY/B,CAAC"}
1
+ {"version":3,"file":"DashboardTemplate.d.ts","sourceRoot":"","sources":["../src/DashboardTemplate.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAY/B,CAAC"}
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e}from"react/jsx-runtime";import{Stack as r}from"@donotdev/components";const t=()=>e(r,{gap:"large",children:[o("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700},children:"Dashboard"}),o("p",{style:{color:"var(--muted-foreground)"},children:"Dashboard template coming soon. This is a placeholder for the full dashboard implementation."})]});export{t as DashboardTemplate};
1
+ "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Stack as r}from"@donotdev/components";const t=()=>o(r,{gap:"large",children:[e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700},children:"Dashboard"}),e("p",{style:{color:"var(--muted-foreground)"},children:"Dashboard template coming soon. This is a placeholder for the full dashboard implementation."})]});export{t as DashboardTemplate};
@@ -1 +1 @@
1
- {"version":3,"file":"LoginTemplate.d.ts","sourceRoot":"","sources":["../src/LoginTemplate.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAsGhD,CAAC"}
1
+ {"version":3,"file":"LoginTemplate.d.ts","sourceRoot":"","sources":["../src/LoginTemplate.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAsGhD,CAAC"}
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import"lucide-react";import{Card as t,Stack as n}from"@donotdev/components";import{useTranslation as g}from"@donotdev/core";import{useAuthVisibility as u}from"@donotdev/ui";const b=({title:r,subtitle:e,redirectTo:a})=>{const{shouldHide:l,isLoading:s,isReady:d}=u(),{t:i}=g("login");return l?o(t,{subtitle:e||i("login.description","Sign in to your account"),children:o("div",{className:"dndev-surface","data-variant":"destructive",style:{borderRadius:"var(--radius-lg)",border:"1px solid var(--destructive)",backgroundColor:"color-mix(in oklab, var(--destructive) 10%, transparent)",padding:"var(--gap-md)"},children:o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--destructive-foreground)"},children:i("login.authNotAvailable","Authentication is not available. Please contact support if you believe this is an error.")})})}):s||!d?o(t,{title:r||i("login.title","Login"),subtitle:e||i("login.description","Sign in to your account"),children:o(n,{align:"center",justify:"center",style:{paddingTop:"var(--gap-lg)",paddingBottom:"var(--gap-lg)"},children:o("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.loading","Loading authentication...")})})}):o(t,{title:r||i("login.title","Login"),subtitle:e||i("login.description","Sign in to your account"),children:c(n,{children:[o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.comingSoon","Login template coming soon. Redirect: {redirectTo}",{redirectTo:a||"/"})}),o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.placeholder","This is a placeholder for the full login implementation with Firebase Auth integration.")})]})})};export{b as LoginTemplate};
1
+ "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import{Card as t,Stack as n}from"@donotdev/components";import{useTranslation as g}from"@donotdev/core";import{useAuthVisibility as u}from"@donotdev/ui";const h=({title:r,subtitle:e,redirectTo:a})=>{const{shouldHide:l,isLoading:s,isReady:d}=u(),{t:i}=g("login");return l?o(t,{subtitle:e||i("login.description","Sign in to your account"),children:o("div",{className:"dndev-surface","data-variant":"destructive",style:{borderRadius:"var(--radius-lg)",border:"1px solid var(--destructive)",backgroundColor:"color-mix(in oklab, var(--destructive) 10%, transparent)",padding:"var(--gap-md)"},children:o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--destructive-foreground)"},children:i("login.authNotAvailable","Authentication is not available. Please contact support if you believe this is an error.")})})}):s||!d?o(t,{title:r||i("login.title","Login"),subtitle:e||i("login.description","Sign in to your account"),children:o(n,{align:"center",justify:"center",style:{paddingTop:"var(--gap-lg)",paddingBottom:"var(--gap-lg)"},children:o("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.loading","Loading authentication...")})})}):o(t,{title:r||i("login.title","Login"),subtitle:e||i("login.description","Sign in to your account"),children:c(n,{children:[o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.comingSoon","Login template coming soon. Redirect: {redirectTo}",{redirectTo:a||"/"})}),o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i("login.placeholder","This is a placeholder for the full login implementation with Firebase Auth integration.")})]})})};export{h as LoginTemplate};
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileTemplate.d.ts","sourceRoot":"","sources":["../src/ProfileTemplate.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAsBpD,CAAC"}
1
+ {"version":3,"file":"ProfileTemplate.d.ts","sourceRoot":"","sources":["../src/ProfileTemplate.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAsBpD,CAAC"}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Stack as i}from"@donotdev/components";const s=({customClaims:t})=>r(i,{gap:"large",children:[e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700},children:"Profile"}),e("p",{style:{color:"var(--muted-foreground)"},children:"Profile template coming soon. This is a placeholder for the full profile management implementation."}),t&&t.length>0&&r("div",{style:{fontSize:"var(--font-size-sm)"},children:[e("p",{style:{fontWeight:500},children:"Custom claims tracked:"}),e("ul",{style:{listStyleType:"disc",paddingInlineStart:"2.5rem"},children:t.map(l=>e("li",{children:l},l))})]})]});export{s as ProfileTemplate};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Stack as i}from"@donotdev/components";const s=({customClaims:t})=>r(i,{gap:"large",children:[e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700},children:"Profile"}),e("p",{style:{color:"var(--muted-foreground)"},children:"Profile template coming soon. This is a placeholder for the full profile management implementation."}),t&&t.length>0&&r("div",{style:{fontSize:"var(--font-size-sm)"},children:[e("p",{style:{fontWeight:500},children:"Custom claims tracked:"}),e("ul",{style:{listStyleType:"disc",paddingInlineStart:"2.5rem"},children:t.map(l=>e("li",{children:l},l))})]})]});export{s as ProfileTemplate};
@@ -1 +1 @@
1
- {"version":3,"file":"WhatsNewTemplate.d.ts","sourceRoot":"","sources":["../src/WhatsNewTemplate.tsx"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACP,IAAI,EACA,OAAO,GACP,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,GACP,UAAU,GACV,aAAa,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,EAAE,CAAC;IACJ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,EACT,cAAqB,EACrB,iBAAwB,EACxB,UAAU,EACV,eAAe,GAChB,EAAE,qBAAqB,2CAmbvB"}
1
+ {"version":3,"file":"WhatsNewTemplate.d.ts","sourceRoot":"","sources":["../src/WhatsNewTemplate.tsx"],"names":[],"mappings":"AAkCA;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACP,IAAI,EACA,OAAO,GACP,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,GACP,UAAU,GACV,aAAa,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,EAAE,CAAC;IACJ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,EACT,cAAqB,EACrB,iBAAwB,EACxB,UAAU,EACV,eAAe,GAChB,EAAE,qBAAqB,2CAuavB"}
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useState as m,useEffect as N}from"react";import{cn as W,Badge as s,BADGE_VARIANT as d,Card as f,Stack as i,Grid as p}from"@donotdev/components";function L({changelog:o,className:h,showNavigation:y=!0,showVersionBadges:c=!0,maxEntries:l,onVersionSelect:w}){const[v,z]=m(null),[u,b]=m([]);N(()=>{let e=o;l&&(e=o.slice(0,l)),b(e)},[o,l]);const g=e=>{switch(e){case"major":return{backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)"};case"minor":return{backgroundColor:"var(--primary)",color:"var(--primary-foreground)"};case"patch":return{backgroundColor:"var(--success)",color:"var(--success-foreground)"};case"preview":return{backgroundColor:"var(--accent)",color:"var(--accent-foreground)"};case"beta":return{backgroundColor:"var(--warning)",color:"var(--warning-foreground)"};default:return{backgroundColor:"var(--muted)",color:"var(--muted-foreground)"}}},C=e=>{switch(e){case"added":return"\u{1F7E2}";case"changed":return"\u{1F7E1}";case"deprecated":return"\u{1F7E0}";case"removed":return"\u{1F534}";case"fixed":return"\u{1F527}";case"security":return"\u{1F512}";case"performance":return"\u26A1";default:return"\u2022"}},S=e=>{switch(e){case"added":return"var(--success)";case"changed":return"var(--warning)";case"deprecated":return"var(--warning)";case"removed":return"var(--destructive)";case"fixed":return"var(--primary)";case"security":return"var(--accent)";case"performance":return"var(--primary)";default:return"var(--muted-foreground)"}},x=e=>{z(e),w?.(e)},t=v?o.find(e=>e.version===v):u[0];return n("div",{className:W("dndev-w-full dndev-mx-auto",h),style:{maxWidth:"72rem"},children:[n("div",{className:"dndev-text-center",style:{marginBottom:"var(--gap-lg)"},children:[r("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,color:"var(--foreground)",marginBottom:"var(--gap-md)"},children:"What's New in DnDev"}),r("p",{className:"dndev-mx-auto",style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",maxWidth:"42rem"},children:"Stay up to date with the latest features, improvements, and fixes in the DoNotDev Framework"})]}),n(p,{cols:4,gap:"large",className:"dndev-grid-responsive-1-4",children:[y&&r("div",{style:{gridColumn:"span 1"},children:r(f,{title:r(i,{direction:"row",align:"center",gap:"tight",children:"\u{1F33F} Versions"}),children:r(i,{gap:"tight",children:u.map(e=>n("button",{onClick:()=>x(e.version),className:"dndev-w-full dndev-text-left dndev-surface","data-variant":t?.version===e.version?"accent":"default",style:{padding:"var(--gap-md)",borderLeft:t?.version===e.version?"2px solid var(--primary)":void 0,transition:"background-color 0.2s"},children:[n(i,{direction:"row",align:"center",justify:"between",style:{marginBottom:"var(--gap-sm)"},children:[r("span",{style:{fontFamily:"monospace",fontSize:"var(--font-size-sm)",fontWeight:500},children:e.version}),c&&r(s,{variant:d.SECONDARY,style:{fontSize:"var(--font-size-xs)",...g(e.type)},children:e.type})]}),n(i,{direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:["\u{1F4C5} ",new Date(e.date).toLocaleDateString()]}),r("div",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,marginTop:"var(--gap-sm)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title})]},e.version))})})}),r("div",{style:{gridColumn:"span 3"},children:t&&r(f,{title:r(i,{direction:"row",align:"start",justify:"between",children:n("div",{children:[n(i,{direction:"row",align:"center",style:{marginBottom:"var(--gap-sm)"},children:[r("h2",{style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--foreground)"},children:t.title}),c&&r(s,{variant:d.SECONDARY,style:{fontSize:"var(--font-size-sm)",...g(t.type)},children:t.type})]}),n(i,{direction:"row",align:"center",style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:[n(i,{direction:"row",align:"center",gap:"tight",children:["\u{1F3F7}\uFE0F"," ",r("span",{style:{fontFamily:"monospace"},children:t.version})]}),n(i,{direction:"row",align:"center",gap:"tight",children:["\u{1F4C5} ",new Date(t.date).toLocaleDateString()]})]})]})}),subtitle:t.description,children:n(i,{children:[t.changes.map((e,a)=>n(i,{children:[r("h3",{className:"dndev-flex dndev-items-center dndev-gap-sm",style:{fontSize:"var(--font-size-lg)",fontWeight:600,color:S(e.type)},children:n(i,{direction:"row",align:"center",gap:"tight",as:"span",children:[r("span",{children:C(e.type)}),r("span",{children:e.type.charAt(0).toUpperCase()+e.type.slice(1)})]})}),r(i,{as:"ul",gap:"tight",style:{marginLeft:"1.5rem"},children:e.items.map((D,k)=>r("li",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:D},k))})]},a)),t.breaking&&t.breaking.length>0&&n("div",{style:{borderLeft:"4px solid var(--destructive)",paddingLeft:"var(--gap-md)",paddingTop:"var(--gap-sm)",paddingBottom:"var(--gap-sm)",backgroundColor:"color-mix(in oklab, var(--destructive) 10%, transparent)"},children:[r("h3",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,color:"var(--destructive-foreground)",marginBottom:"var(--gap-sm)"},children:"\u26A0\uFE0F Breaking Changes"}),r(i,{as:"ul",gap:"tight",children:t.breaking.map((e,a)=>r("li",{style:{fontSize:"var(--font-size-sm)",color:"var(--destructive-foreground)"},children:e},a))})]}),(t.contributors||t.pullRequests)&&r("div",{style:{paddingTop:"var(--gap-md)",borderTop:"1px solid var(--border)"},children:n(p,{cols:2,className:"dndev-grid-responsive-1-2",children:[t.contributors&&n("div",{children:[r("h4",{style:{fontWeight:500,fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",marginBottom:"var(--gap-sm)"},children:"Contributors"}),r(i,{direction:"row",wrap:"wrap",gap:"tight",children:t.contributors.map((e,a)=>r(s,{variant:d.OUTLINE,style:{fontSize:"var(--font-size-xs)"},children:e},a))})]}),t.pullRequests&&n("div",{children:[r("h4",{style:{fontWeight:500,fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",marginBottom:"var(--gap-sm)"},children:"Pull Requests"}),r(i,{direction:"row",wrap:"wrap",gap:"tight",children:t.pullRequests.map((e,a)=>n(s,{variant:d.OUTLINE,style:{fontSize:"var(--font-size-xs)"},children:["#",e]},a))})]})]})})]})})})]})]})}export{L as WhatsNewTemplate};
1
+ "use client";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useState as x,useMemo as D}from"react";import{cn as k,Badge as o,BADGE_VARIANT as s,Card as p,Stack as i,Grid as f}from"@donotdev/components";import{useTranslation as N}from"@donotdev/core";function I({changelog:a,className:h,showNavigation:y=!0,showVersionBadges:l=!0,maxEntries:d,onVersionSelect:w}){const{t:c}=N("whatsNew"),[v,z]=x(null),u=D(()=>d?a.slice(0,d):a,[a,d]),g=e=>{switch(e){case"major":return{backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)"};case"minor":return{backgroundColor:"var(--primary)",color:"var(--primary-foreground)"};case"patch":return{backgroundColor:"var(--success)",color:"var(--success-foreground)"};case"preview":return{backgroundColor:"var(--accent)",color:"var(--accent-foreground)"};case"beta":return{backgroundColor:"var(--warning)",color:"var(--warning-foreground)"};default:return{backgroundColor:"var(--muted)",color:"var(--muted-foreground)"}}},S=e=>{switch(e){case"added":return"\u{1F7E2}";case"changed":return"\u{1F7E1}";case"deprecated":return"\u{1F7E0}";case"removed":return"\u{1F534}";case"fixed":return"\u{1F527}";case"security":return"\u{1F512}";case"performance":return"\u26A1";default:return"\u2022"}},b=e=>{switch(e){case"added":return"var(--success)";case"changed":return"var(--warning)";case"deprecated":return"var(--warning)";case"removed":return"var(--destructive)";case"fixed":return"var(--primary)";case"security":return"var(--accent)";case"performance":return"var(--primary)";default:return"var(--muted-foreground)"}},C=e=>{z(e),w?.(e)},t=v?a.find(e=>e.version===v):u[0];return n("div",{className:k("dndev-w-full dndev-mx-auto",h),style:{maxWidth:"72rem"},children:[n("div",{className:"dndev-text-center",style:{marginBottom:"var(--gap-lg)"},children:[r("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,color:"var(--foreground)",marginBottom:"var(--gap-md)"},children:c("title","What's New in DnDev")}),r("p",{className:"dndev-mx-auto",style:{fontSize:"var(--font-size-lg)",color:"var(--muted-foreground)",maxWidth:"42rem"},children:c("subtitle","Stay up to date with the latest features, improvements, and fixes in the DoNotDev Framework")})]}),n(f,{cols:4,gap:"large",className:"dndev-grid-responsive-1-4",children:[y&&r("div",{style:{gridColumn:"span 1"},children:r(p,{title:r(i,{direction:"row",align:"center",gap:"tight",children:"\u{1F33F} Versions"}),children:r(i,{gap:"tight",children:u.map(e=>n("button",{onClick:()=>C(e.version),className:"dndev-w-full dndev-text-left dndev-surface","data-variant":t?.version===e.version?"accent":"default",style:{padding:"var(--gap-md)",borderInlineStart:t?.version===e.version?"2px solid var(--primary)":void 0,transition:"background-color 0.2s"},children:[n(i,{direction:"row",align:"center",justify:"between",style:{marginBottom:"var(--gap-sm)"},children:[r("span",{style:{fontFamily:"monospace",fontSize:"var(--font-size-sm)",fontWeight:500},children:e.version}),l&&r(o,{variant:s.SECONDARY,style:{fontSize:"var(--font-size-xs)",...g(e.type)},children:e.type})]}),n(i,{direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:["\u{1F4C5} ",new Date(e.date).toLocaleDateString()]}),r("div",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,marginTop:"var(--gap-sm)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title})]},e.version))})})}),r("div",{style:{gridColumn:"span 3"},children:t&&r(p,{title:r(i,{direction:"row",align:"start",justify:"between",children:n("div",{children:[n(i,{direction:"row",align:"center",style:{marginBottom:"var(--gap-sm)"},children:[r("h2",{style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--foreground)"},children:t.title}),l&&r(o,{variant:s.SECONDARY,style:{fontSize:"var(--font-size-sm)",...g(t.type)},children:t.type})]}),n(i,{direction:"row",align:"center",style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:[n(i,{direction:"row",align:"center",gap:"tight",children:["\u{1F3F7}\uFE0F"," ",r("span",{style:{fontFamily:"monospace"},children:t.version})]}),n(i,{direction:"row",align:"center",gap:"tight",children:["\u{1F4C5} ",new Date(t.date).toLocaleDateString()]})]})]})}),subtitle:t.description,children:n(i,{children:[t.changes.map(e=>n(i,{children:[r("h3",{className:"dndev-flex dndev-items-center dndev-gap-sm",style:{fontSize:"var(--font-size-lg)",fontWeight:600,color:b(e.type)},children:n(i,{direction:"row",align:"center",gap:"tight",as:"span",children:[r("span",{children:S(e.type)}),r("span",{children:e.type.charAt(0).toUpperCase()+e.type.slice(1)})]})}),r(i,{as:"ul",gap:"tight",style:{marginInlineStart:"1.5rem"},children:e.items.map(m=>r("li",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:m},m))})]},e.type)),t.breaking&&t.breaking.length>0&&n("div",{style:{borderInlineStart:"4px solid var(--destructive)",paddingInlineStart:"var(--gap-md)",paddingTop:"var(--gap-sm)",paddingBottom:"var(--gap-sm)",backgroundColor:"color-mix(in oklab, var(--destructive) 10%, transparent)"},children:[r("h3",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,color:"var(--destructive-foreground)",marginBottom:"var(--gap-sm)"},children:"\u26A0\uFE0F Breaking Changes"}),r(i,{as:"ul",gap:"tight",children:t.breaking.map(e=>r("li",{style:{fontSize:"var(--font-size-sm)",color:"var(--destructive-foreground)"},children:e},e))})]}),(t.contributors||t.pullRequests)&&r("div",{style:{paddingTop:"var(--gap-md)",borderTop:"1px solid var(--border)"},children:n(f,{cols:2,className:"dndev-grid-responsive-1-2",children:[t.contributors&&n("div",{children:[r("h4",{style:{fontWeight:500,fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",marginBottom:"var(--gap-sm)"},children:"Contributors"}),r(i,{direction:"row",wrap:"wrap",gap:"tight",children:t.contributors.map(e=>r(o,{variant:s.OUTLINE,style:{fontSize:"var(--font-size-xs)"},children:e},e))})]}),t.pullRequests&&n("div",{children:[r("h4",{style:{fontWeight:500,fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",marginBottom:"var(--gap-sm)"},children:"Pull Requests"}),r(i,{direction:"row",wrap:"wrap",gap:"tight",children:t.pullRequests.map(e=>n(o,{variant:s.OUTLINE,style:{fontSize:"var(--font-size-xs)"},children:["#",e]},e))})]})]})})]})})})]})]})}export{I as WhatsNewTemplate};
@@ -1,7 +1,5 @@
1
- import type { PageMeta } from '@donotdev/core';
2
1
  export interface BillingSuccessTemplateProps {
3
2
  namespace: string;
4
- meta: PageMeta;
5
3
  title?: string;
6
4
  subtitle?: string;
7
5
  nextSteps?: Array<{
@@ -22,5 +20,5 @@ export interface BillingSuccessTemplateProps {
22
20
  * @since 0.0.1
23
21
  * @author AMBROISE PARK Consulting
24
22
  */
25
- export declare function BillingSuccessTemplate({ namespace, meta, title, subtitle, nextSteps, supportEmail, }: BillingSuccessTemplateProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function BillingSuccessTemplate({ namespace, title, subtitle, nextSteps, supportEmail, }: BillingSuccessTemplateProps): import("react/jsx-runtime").JSX.Element;
26
24
  //# sourceMappingURL=BillingSuccessTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BillingSuccessTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/BillingSuccessTemplate.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAS/C,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,SAAc,EACd,YAAoC,GACrC,EAAE,2BAA2B,2CA2P7B"}
1
+ {"version":3,"file":"BillingSuccessTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/BillingSuccessTemplate.tsx"],"names":[],"mappings":"AAqCA,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAc,EACd,YAAoC,GACrC,EAAE,2BAA2B,2CA8P7B"}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CheckCircle as d,AlertCircle as b,ExternalLink as z}from"lucide-react";import{Card as a,Button as m,BUTTON_VARIANT as x,Stack as l,Grid as T}from"@donotdev/components";import{useTranslation as B}from"@donotdev/core";import{PageContainer as h,useNavigate as N,useAuthSafe as k,useBillingVisibility as C,FeatureDisabled as w}from"@donotdev/ui";function P({namespace:u,meta:W,title:s,subtitle:g,nextSteps:c=[],supportEmail:o="support@example.com"}){const{shouldHide:v}=C(),{t:n}=B([u,"billing"]),p=k("userSubscription"),f=N();if(v)return e(h,{variant:"docs",children:e(w,{featureName:"Billing Success",title:s||n("billing:templates.success.title","Payment Successful!"),description:n("billing:templates.success.notAvailable","Billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,supportEmail:o})});const i=p,y=i?.status==="active";return e(h,{variant:"docs",children:t("div",{children:[t("div",{className:"dndev-text-center",style:{marginBottom:"var(--gap-lg)"},children:[e(l,{align:"center",justify:"center",style:{marginBottom:"var(--gap-md)"},children:y?e(d,{style:{width:"4rem",height:"4rem",color:"var(--success)"}}):e(b,{style:{width:"4rem",height:"4rem",color:"var(--warning)"}})}),e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"var(--gap-md)"},children:s||n("billing:templates.success.title","Payment Successful!")}),e("p",{style:{fontSize:"var(--font-size-xl)",color:"var(--muted-foreground)"},children:g||n("billing:templates.success.subtitle","Thank you for your purchase")})]}),i&&e(a,{style:{marginBottom:"var(--gap-lg)"},children:t("div",{children:[e("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,marginBottom:"var(--gap-md)"},children:"Subscription Details"}),e(l,{children:t(T,{cols:2,className:"dndev-grid-responsive-1-2",children:[t("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"Plan"}),e("p",{style:{fontWeight:600,textTransform:"capitalize"},children:i.tier})]}),t("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"Status"}),e("p",{style:{fontWeight:600,textTransform:"capitalize"},children:i.status})]}),i.subscriptionEnd&&t("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:i.status==="active"?"Valid Until":"Ended On"}),e("p",{style:{fontWeight:600},children:i.subscriptionEnd===null?"Lifetime":new Date(i.subscriptionEnd).toLocaleDateString()})]})]})})]})}),c.length>0&&e(a,{style:{marginBottom:"var(--gap-lg)"},children:t("div",{children:[e("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,marginBottom:"var(--gap-md)"},children:"What's Next?"}),e(l,{as:"ul",children:c.map((r,S)=>t(l,{as:"li",direction:"row",align:"start",children:[e(d,{className:"dndev-size-md",style:{color:"var(--success)",marginRight:"var(--gap-md)",marginTop:"0.125rem",flexShrink:0}}),t("div",{className:"dndev-flex-1",children:[e("p",{style:{fontWeight:600},children:r.title}),e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:r.description}),r.link&&e(m,{variant:x.LINK,style:{padding:0,height:"auto",marginTop:"var(--gap-sm)"},onClick:()=>window.open(r.link,"_blank"),icon:z,children:r.linkText||"Learn more"})]})]},S))})]})}),e(a,{children:e("div",{className:"dndev-text-center",style:{paddingTop:"var(--gap-lg)"},children:t("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["Need help? Contact us at"," ",e("a",{href:`mailto:${o}`,style:{color:"var(--primary)",textDecoration:"underline"},onMouseEnter:r=>{r.currentTarget.style.textDecoration="underline"},children:o})]})})}),e("div",{className:"dndev-text-center",style:{marginTop:"var(--gap-lg)"},children:e(m,{onClick:()=>f("/"),children:"Go to Dashboard"})})]})})}export{P as BillingSuccessTemplate};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{CheckCircle as m,AlertCircle as S,ExternalLink as z}from"lucide-react";import{Card as a,Button as u,BUTTON_VARIANT as x,Stack as r,Grid as N}from"@donotdev/components";import{useTranslation as T}from"@donotdev/core";import{PageContainer as g,useNavigate as B,useAuthSafe as k,useBillingVisibility as w,FeatureDisabled as C}from"@donotdev/ui";function E({namespace:h,title:o,subtitle:p,nextSteps:c=[],supportEmail:s="support@example.com"}){const{shouldHide:v}=w(),{t}=T([h,"billing"]),f=k("userSubscription"),b=B();if(v)return e(g,{variant:"docs",children:e(C,{featureName:"Billing Success",title:o||t("billing:templates.success.title","Payment Successful!"),description:t("billing:templates.success.notAvailable","Billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,supportEmail:s})});const n=f,y=n?.status==="active";return e(g,{variant:"docs",children:i("div",{children:[i("div",{className:"dndev-text-center",style:{marginBottom:"var(--gap-lg)"},children:[e(r,{align:"center",justify:"center",style:{marginBottom:"var(--gap-md)"},children:y?e(m,{style:{width:"4rem",height:"4rem",color:"var(--success)"}}):e(S,{style:{width:"4rem",height:"4rem",color:"var(--warning)"}})}),e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"var(--gap-md)"},children:o||t("billing:templates.success.title","Payment Successful!")}),e("p",{style:{fontSize:"var(--font-size-xl)",color:"var(--muted-foreground)"},children:p||t("billing:templates.success.subtitle","Thank you for your purchase")})]}),n&&e(a,{style:{marginBottom:"var(--gap-lg)"},children:i("div",{children:[e("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,marginBottom:"var(--gap-md)"},children:t("billing:templates.success.subscriptionDetails","Subscription Details")}),e(r,{children:i(N,{cols:2,className:"dndev-grid-responsive-1-2",children:[i("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:t("billing:templates.success.plan","Plan")}),e("p",{style:{fontWeight:600,textTransform:"capitalize"},children:n.tier})]}),i("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:t("billing:templates.success.status","Status")}),e("p",{style:{fontWeight:600,textTransform:"capitalize"},children:n.status})]}),n.subscriptionEnd&&i("div",{children:[e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:n.status==="active"?t("billing:templates.success.validUntil","Valid Until"):t("billing:templates.success.endedOn","Ended On")}),e("p",{style:{fontWeight:600},children:n.subscriptionEnd===null?t("billing:templates.success.lifetime","Lifetime"):new Date(n.subscriptionEnd).toLocaleDateString()})]})]})})]})}),c.length>0&&e(a,{style:{marginBottom:"var(--gap-lg)"},children:i("div",{children:[e("h2",{style:{fontSize:"var(--font-size-lg)",fontWeight:600,marginBottom:"var(--gap-md)"},children:t("billing:templates.success.whatsNext","What's Next?")}),e(r,{as:"ul",children:c.map(l=>i(r,{as:"li",direction:"row",align:"start",children:[e(m,{className:"dndev-size-md",style:{color:"var(--success)",marginInlineEnd:"var(--gap-md)",marginTop:"0.125rem",flexShrink:0}}),i("div",{className:"dndev-flex-1",children:[e("p",{style:{fontWeight:600},children:l.title}),e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:l.description}),l.link&&e(u,{variant:x.LINK,style:{padding:0,height:"auto",marginTop:"var(--gap-sm)"},onClick:()=>{try{const d=new URL(l.link,window.location.origin);(d.protocol==="http:"||d.protocol==="https:")&&window.open(l.link,"_blank","noopener,noreferrer")}catch{}},icon:z,children:l.linkText||t("billing:templates.success.learnMore","Learn more")})]})]},l.title))})]})}),e(a,{children:e("div",{className:"dndev-text-center",style:{paddingTop:"var(--gap-lg)"},children:i("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:[t("billing:templates.success.needHelp","Need help? Contact us at")," ",e("a",{href:`mailto:${s}`,style:{color:"var(--primary)",textDecoration:"underline"},children:s})]})})}),e("div",{className:"dndev-text-center",style:{marginTop:"var(--gap-lg)"},children:e(u,{onClick:()=>b("/"),children:t("billing:templates.success.goToDashboard","Go to Dashboard")})})]})})}export{E as BillingSuccessTemplate};
@@ -1,6 +1,6 @@
1
1
  import type { CheckoutMode } from '@donotdev/core';
2
2
  import type { ReactNode } from 'react';
3
- interface CheckoutPageTemplateProps {
3
+ export interface CheckoutPageTemplateProps {
4
4
  children?: ReactNode;
5
5
  priceId?: string;
6
6
  mode?: CheckoutMode;
@@ -32,5 +32,4 @@ interface CheckoutPageTemplateProps {
32
32
  * @author AMBROISE PARK Consulting
33
33
  */
34
34
  export declare function CheckoutPageTemplate({ children, priceId, mode, title, description, onSuccess, onCancel, successMessage, cancelMessage, successRedirect, cancelRedirect, showToast, billingOptions, }: CheckoutPageTemplateProps): import("react/jsx-runtime").JSX.Element;
35
- export {};
36
35
  //# sourceMappingURL=CheckoutTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/CheckoutTemplate.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,yBAAyB;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,OAAO,EACP,IAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,SAAgB,EAChB,cAAc,GACf,EAAE,yBAAyB,2CA0G3B"}
1
+ {"version":3,"file":"CheckoutTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/CheckoutTemplate.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,OAAO,EACP,IAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,SAAgB,EAChB,cAAc,GACf,EAAE,yBAAyB,2CA0G3B"}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{StripeCheckoutButton as N}from"@donotdev/billing";import{Card as f,BUTTON_VARIANT as C,useToast as T,Stack as S}from"@donotdev/components";import{useTranslation as b}from"@donotdev/core";import{useNavigate as w,useBillingVisibility as U,FeatureDisabled as P}from"@donotdev/ui";function D({children:l,priceId:n,mode:s="payment",title:c,description:v,onSuccess:g,onCancel:k,successMessage:d,cancelMessage:m,successRedirect:a,cancelRedirect:r,showToast:u=!0,billingOptions:o}){const{shouldHide:y,isLoading:x}=U(),{t}=b("billing"),{toast:h}=T(),p=w(),j=()=>{u&&d&&h("success",d),a&&p(a),g?.()},A=()=>{u&&m&&h("info",m),r&&p(r),k?.()};return y?e(P,{featureName:"Checkout",title:c||t("templates.checkout.title"),description:t("templates.checkout.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>window.location.reload()}):x?e(f,{className:"dndev-mx-auto",style:{maxWidth:"42rem"},children:e("div",{className:"dndev-text-center",style:{paddingTop:"var(--gap-lg)"},children:e("p",{style:{color:"var(--muted-foreground)"},children:t("templates.checkout.loading","Loading checkout...")})})}):e("div",{children:i(f,{className:"dndev-mx-auto",style:{maxWidth:"42rem"},children:[i("div",{className:"dndev-text-center",children:[e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"var(--gap-md)"},children:c||t("templates.checkout.title")}),e("p",{style:{color:"var(--muted-foreground)"},children:v||t("templates.checkout.description")})]}),i(S,{gap:"large",style:{marginTop:"var(--gap-lg)"},children:[l&&e("div",{children:l}),n&&e("div",{children:e(N,{priceId:n,mode:s,successUrl:o?.successUrl||a||"/billing/success",cancelUrl:o?.cancelUrl||r||"/checkout",metadata:o?.metadata,allowPromotionCodes:o?.allowPromotionCodes,variant:C.DEFAULT,className:"dndev-w-full",children:t(s==="payment"?"templates.checkout.completePurchase":"templates.checkout.startSubscription")})})]})]})})}export{D as CheckoutPageTemplate};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{StripeCheckoutButton as N}from"@donotdev/billing";import{Card as f,BUTTON_VARIANT as C,useToast as T,Stack as S}from"@donotdev/components";import{useTranslation as b}from"@donotdev/core";import{useNavigate as w,useBillingVisibility as U,FeatureDisabled as P}from"@donotdev/ui";function D({children:l,priceId:n,mode:s="payment",title:c,description:v,onSuccess:g,onCancel:k,successMessage:d,cancelMessage:m,successRedirect:a,cancelRedirect:r,showToast:u=!0,billingOptions:o}){const{shouldHide:y,isLoading:x}=U(),{t}=b("billing"),{toast:h}=T(),p=w(),j=()=>{u&&d&&h("success",d),a&&p(a),g?.()},A=()=>{u&&m&&h("info",m),r&&p(r),k?.()};return y?e(P,{featureName:"Checkout",title:c||t("templates.checkout.title"),description:t("templates.checkout.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>{window.location.reload()}}):x?e(f,{className:"dndev-mx-auto",style:{maxWidth:"42rem"},children:e("div",{className:"dndev-text-center",style:{paddingTop:"var(--gap-lg)"},children:e("p",{style:{color:"var(--muted-foreground)"},children:t("templates.checkout.loading","Loading checkout...")})})}):e("div",{children:i(f,{className:"dndev-mx-auto",style:{maxWidth:"42rem"},children:[i("div",{className:"dndev-text-center",children:[e("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"var(--gap-md)"},children:c||t("templates.checkout.title")}),e("p",{style:{color:"var(--muted-foreground)"},children:v||t("templates.checkout.description")})]}),i(S,{gap:"large",style:{marginTop:"var(--gap-lg)"},children:[l&&e("div",{children:l}),n&&e("div",{children:e(N,{priceId:n,mode:s,successUrl:o?.successUrl||a||"/billing/success",cancelUrl:o?.cancelUrl||r||"/checkout",metadata:o?.metadata,allowPromotionCodes:o?.allowPromotionCodes,variant:C.DEFAULT,className:"dndev-w-full",children:t(s==="payment"?"templates.checkout.completePurchase":"templates.checkout.startSubscription")})})]})]})})}export{D as CheckoutPageTemplate};
@@ -1,7 +1,6 @@
1
- import type { PageMeta, StripeFrontConfig } from '@donotdev/core';
1
+ import type { StripeFrontConfig } from '@donotdev/core';
2
2
  export interface PaymentTemplateProps {
3
3
  namespace: string;
4
- meta: PageMeta;
5
4
  billing: StripeFrontConfig;
6
5
  successUrl?: string;
7
6
  cancelUrl?: string;
@@ -22,5 +21,5 @@ export interface PaymentTemplateProps {
22
21
  * @since 0.0.1
23
22
  * @author AMBROISE PARK Consulting
24
23
  */
25
- export declare function PaymentTemplate({ namespace, meta, billing, successUrl, cancelUrl, title, subtitle, layout, }: PaymentTemplateProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function PaymentTemplate({ namespace, billing, successUrl, cancelUrl, title, subtitle, layout, }: PaymentTemplateProps): import("react/jsx-runtime").JSX.Element;
26
25
  //# sourceMappingURL=PaymentTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/PaymentTemplate.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAclE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,IAAI,EACJ,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAe,GAChB,EAAE,oBAAoB,2CAoGtB"}
1
+ {"version":3,"file":"PaymentTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/PaymentTemplate.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAcxD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAe,GAChB,EAAE,oBAAoB,2CAoGtB"}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as u}from"react/jsx-runtime";import{lazy as m,Suspense as j}from"react";import{Stack as n,Grid as w,Text as l,Section as x}from"@donotdev/components";import{useTranslation as T,maybeTranslate as h}from"@donotdev/core";import{PageContainer as o,useBillingVisibility as L,FeatureDisabled as N}from"@donotdev/ui";const _=m(()=>import("@donotdev/billing").then(i=>({default:i.ProductCard}))),B=m(()=>import("@donotdev/billing").then(i=>({default:i.SecurityNotice})));function A({namespace:i,meta:I,billing:s,successUrl:g,cancelUrl:b,title:c,subtitle:d,layout:y="grid"}){const{shouldHide:f,isLoading:v}=L(),{t:r}=T([i,"billing"]),p=c?h(r,c):r("billing:templates.purchase.title"),C=d?h(r,d):r("billing:templates.purchase.subtitle");if(f)return e(o,{variant:"standard",children:e(N,{featureName:"Billing",title:p,description:r("billing:templates.purchase.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>window.location.reload()})});if(v)return e(o,{variant:"standard",children:e(n,{align:"center",children:e(l,{variant:"muted",children:r("billing:templates.purchase.loading","Loading billing...")})})});const S=Object.keys(s).length,P=y==="grid"?S===2?2:3:void 0;return e(o,{variant:"standard",children:e(j,{fallback:e(n,{align:"center",children:e(l,{variant:"muted",children:"Loading..."})}),children:u(n,{gap:"large",align:"center",children:[u(n,{align:"center",children:[e(l,{as:"h1",level:"h1",children:p}),e(l,{as:"h2",level:"h2",variant:"muted",children:C})]}),e(x,{children:e(w,{cols:P,gap:"large",children:Object.entries(s).map(([a,t])=>e(_,{namespace:i,configKey:a,id:a,name:t.name,price:t.price,currency:t.currency,description:t.description||"",features:t.features||[],mode:"payment",priceId:t.priceId,allowPromotionCodes:t.allowPromotionCodes??!0,metadata:{billingConfigKey:a,productType:"payment",source:"payment_template"},successUrl:g,cancelUrl:b},a))})}),e(B,{})]})})})}export{A as PaymentTemplate};
1
+ "use client";import{jsx as e,jsxs as u}from"react/jsx-runtime";import{lazy as m,Suspense as j}from"react";import{Stack as n,Grid as w,Text as l,Section as x}from"@donotdev/components";import{useTranslation as T,maybeTranslate as h}from"@donotdev/core";import{PageContainer as o,useBillingVisibility as L,FeatureDisabled as N}from"@donotdev/ui";const _=m(()=>import("@donotdev/billing").then(i=>({default:i.ProductCard}))),B=m(()=>import("@donotdev/billing").then(i=>({default:i.SecurityNotice})));function z({namespace:i,billing:s,successUrl:g,cancelUrl:b,title:c,subtitle:d,layout:y="grid"}){const{shouldHide:f,isLoading:v}=L(),{t:r}=T([i,"billing"]),p=c?h(r,c):r("billing:templates.purchase.title"),C=d?h(r,d):r("billing:templates.purchase.subtitle");if(f)return e(o,{variant:"standard",children:e(N,{featureName:"Billing",title:p,description:r("billing:templates.purchase.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>{window.location.reload()}})});if(v)return e(o,{variant:"standard",children:e(n,{align:"center",children:e(l,{variant:"muted",children:r("billing:templates.purchase.loading","Loading billing...")})})});const S=Object.keys(s).length,P=y==="grid"?S===2?2:3:void 0;return e(o,{variant:"standard",children:e(j,{fallback:e(n,{align:"center",children:e(l,{variant:"muted",children:"Loading..."})}),children:u(n,{gap:"large",align:"center",children:[u(n,{align:"center",children:[e(l,{as:"h1",level:"h1",children:p}),e(l,{as:"h2",level:"h2",variant:"muted",children:C})]}),e(x,{children:e(w,{cols:P,gap:"large",children:Object.entries(s).map(([a,t])=>e(_,{namespace:i,configKey:a,id:a,name:t.name,price:t.price,currency:t.currency,description:t.description||"",features:t.features||[],mode:"payment",priceId:t.priceId,allowPromotionCodes:t.allowPromotionCodes??!0,metadata:{billingConfigKey:a,productType:"payment",source:"payment_template"},successUrl:g,cancelUrl:b},a))})}),e(B,{})]})})})}export{z as PaymentTemplate};
@@ -1,4 +1,4 @@
1
- import type { PageMeta, StripeFrontConfig } from '@donotdev/core';
1
+ import type { StripeFrontConfig } from '@donotdev/core';
2
2
  /**
3
3
  * Subscription plan type
4
4
  * Extends StripeFrontConfig product structure with subscription-specific fields
@@ -22,7 +22,6 @@ export type SubscriptionPlan = StripeFrontConfig[string] & {
22
22
  */
23
23
  export interface SubscriptionTemplateProps {
24
24
  namespace: string;
25
- meta: PageMeta;
26
25
  plans: SubscriptionPlan[];
27
26
  successUrl?: string;
28
27
  cancelUrl?: string;
@@ -58,5 +57,5 @@ export interface SubscriptionTemplateProps {
58
57
  * @since 0.0.1
59
58
  * @author AMBROISE PARK Consulting
60
59
  */
61
- export declare function SubscriptionTemplate({ namespace, meta, plans, successUrl, cancelUrl, title, subtitle, }: SubscriptionTemplateProps): import("react/jsx-runtime").JSX.Element;
60
+ export declare function SubscriptionTemplate({ namespace, plans, successUrl, cancelUrl, title, subtitle, }: SubscriptionTemplateProps): import("react/jsx-runtime").JSX.Element;
62
61
  //# sourceMappingURL=SubscriptionTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/SubscriptionTemplate.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOlE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,IAAI,EACJ,KAAK,EACL,UAA+B,EAC/B,SAA2B,EAC3B,KAAK,EACL,QAAQ,GACT,EAAE,yBAAyB,2CAgN3B"}
1
+ {"version":3,"file":"SubscriptionTemplate.d.ts","sourceRoot":"","sources":["../../src/billing/SubscriptionTemplate.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,KAAK,EACL,UAA+B,EAC/B,SAA2B,EAC3B,KAAK,EACL,QAAQ,GACT,EAAE,yBAAyB,2CA+M3B"}
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useState as h}from"react";import{ProductCard as y}from"@donotdev/billing";import{Button as x,BUTTON_VARIANT as N,Badge as w,BADGE_VARIANT as S,Stack as T,Grid as B}from"@donotdev/components";import{useTranslation as I}from"@donotdev/core";import{PageContainer as s,useBillingVisibility as C,FeatureDisabled as z}from"@donotdev/ui";function D({namespace:a,meta:A,plans:c,successUrl:m="/billing/success",cancelUrl:u="/subscription",title:l,subtitle:g}){const{shouldHide:p,isLoading:v}=C(),{t}=I([a,"billing"]),[n,b]=h("year");if(p)return r(s,{variant:"standard",children:r(z,{featureName:"Subscriptions",title:l||t("billing:templates.subscription.title"),description:t("billing:templates.subscription.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>window.location.reload()})});if(v)return r(s,{variant:"standard",children:r("div",{className:"dndev-text-center",style:{paddingTop:"3rem",paddingBottom:"3rem"},children:r("p",{style:{color:"var(--muted-foreground)"},children:t("billing:templates.subscription.loading","Loading subscriptions...")})})});const d=c.filter(i=>i.interval===n),f=()=>{const i=d.length;return i===1?{cols:1,className:"dndev-max-w-md dndev-mx-auto"}:i===2?{cols:2,className:"dndev-max-w-4xl dndev-mx-auto dndev-grid-responsive-1-2"}:i===3?{cols:3,className:"dndev-grid-responsive-1-3"}:i===4?{cols:4,className:"dndev-grid-responsive-1-2-4"}:{cols:4,className:"dndev-grid-responsive-1-2-3-4"}};return r(s,{variant:"standard",children:o("div",{children:[o("div",{className:"dndev-text-center",style:{marginBottom:"3rem"},children:[r("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"1rem"},children:l||t("billing:templates.subscription.title")}),r("p",{style:{fontSize:"var(--font-size-xl)",color:"var(--muted-foreground)",marginBottom:"2rem"},children:g||t("billing:templates.subscription.subtitle")}),o(T,{direction:"row",align:"center",justify:"center",children:[r("span",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:n==="month"?"var(--primary)":"var(--muted-foreground)"},children:t("billing:templates.subscription.billingToggle.monthly")}),r(x,{variant:N.OUTLINE,onClick:()=>b(n==="month"?"year":"month"),className:"dndev-relative",children:r("div",{style:{width:"3rem",height:"1.5rem",backgroundColor:n==="year"?"var(--primary)":"rgb(229, 231, 235)",borderRadius:"9999px",transition:"background-color 0.2s"},children:r("div",{style:{width:"1.25rem",height:"1.25rem",backgroundColor:"white",borderRadius:"9999px",boxShadow:"var(--shadow-sm)",transform:n==="year"?"translateX(1.5rem)":"translateX(0.125rem)",marginTop:"0.125rem",transition:"transform 0.2s"}})})}),o("span",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:n==="year"?"var(--primary)":"var(--muted-foreground)"},children:[t("billing:templates.subscription.billingToggle.yearly"),r(w,{variant:S.SECONDARY,style:{marginInlineStart:"0.5rem"},children:t("billing:templates.subscription.billingToggle.save20")})]})]})]}),(()=>{const i=f();return r(B,{cols:i.cols,className:i.className,children:d.map(e=>r(y,{namespace:a,configKey:e.id,id:e.id,name:e.name,price:e.price,currency:e.currency,description:e.description??"",features:e.features??[],popular:e.popular,mode:"subscription",priceId:e.priceId,metadata:{billingConfigKey:e.id,planId:e.id,planName:e.name,billingInterval:e.interval,productType:"subscription",source:"subscription_template",...e.metadata},successUrl:m,cancelUrl:u,allowPromotionCodes:!0},e.id))})})()]})})}export{D as SubscriptionTemplate};
1
+ "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useState as h}from"react";import{ProductCard as y}from"@donotdev/billing";import{Button as x,BUTTON_VARIANT as N,Badge as T,BADGE_VARIANT as w,Stack as S,Grid as B}from"@donotdev/components";import{useTranslation as I}from"@donotdev/core";import{PageContainer as s,useBillingVisibility as C,FeatureDisabled as z}from"@donotdev/ui";function L({namespace:a,plans:c,successUrl:m="/billing/success",cancelUrl:u="/subscription",title:l,subtitle:g}){const{shouldHide:p,isLoading:b}=C(),{t:i}=I([a,"billing"]),[n,v]=h("year");if(p)return r(s,{variant:"standard",children:r(z,{featureName:"Subscriptions",title:l||i("billing:templates.subscription.title"),description:i("billing:templates.subscription.notAvailable","Stripe billing is not configured or available. Please contact support if you believe this is an error."),showContactSupport:!0,showRetry:!0,onRetry:()=>{window.location.reload()}})});if(b)return r(s,{variant:"standard",children:r("div",{className:"dndev-text-center",style:{paddingTop:"3rem",paddingBottom:"3rem"},children:r("p",{style:{color:"var(--muted-foreground)"},children:i("billing:templates.subscription.loading","Loading subscriptions...")})})});const d=c.filter(t=>t.interval===n),f=()=>{const t=d.length;return t===1?{cols:1,className:"dndev-max-w-md dndev-mx-auto"}:t===2?{cols:2,className:"dndev-max-w-4xl dndev-mx-auto dndev-grid-responsive-1-2"}:t===3?{cols:3,className:"dndev-grid-responsive-1-3"}:t===4?{cols:4,className:"dndev-grid-responsive-1-2-4"}:{cols:4,className:"dndev-grid-responsive-1-2-3-4"}};return r(s,{variant:"standard",children:o("div",{children:[o("div",{className:"dndev-text-center",style:{marginBottom:"3rem"},children:[r("h1",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,marginBottom:"1rem"},children:l||i("billing:templates.subscription.title")}),r("p",{style:{fontSize:"var(--font-size-xl)",color:"var(--muted-foreground)",marginBottom:"2rem"},children:g||i("billing:templates.subscription.subtitle")}),o(S,{direction:"row",align:"center",justify:"center",children:[r("span",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:n==="month"?"var(--primary)":"var(--muted-foreground)"},children:i("billing:templates.subscription.billingToggle.monthly")}),r(x,{variant:N.OUTLINE,onClick:()=>v(n==="month"?"year":"month"),className:"dndev-relative",role:"switch","aria-checked":n==="year","aria-label":i("billing:templates.subscription.billingToggle.ariaLabel","Toggle billing interval"),children:r("div",{style:{width:"3rem",height:"1.5rem",backgroundColor:n==="year"?"var(--primary)":"rgb(229, 231, 235)",borderRadius:"9999px",transition:"background-color 0.2s"},children:r("div",{style:{width:"1.25rem",height:"1.25rem",backgroundColor:"var(--background)",borderRadius:"9999px",boxShadow:"var(--shadow-sm)",transform:n==="year"?"translateX(1.5rem)":"translateX(0.125rem)",marginTop:"0.125rem",transition:"transform 0.2s"}})})}),o("span",{style:{fontSize:"var(--font-size-sm)",fontWeight:500,color:n==="year"?"var(--primary)":"var(--muted-foreground)"},children:[i("billing:templates.subscription.billingToggle.yearly"),r(T,{variant:w.SECONDARY,style:{marginInlineStart:"0.5rem"},children:i("billing:templates.subscription.billingToggle.save20")})]})]})]}),(()=>{const t=f();return r(B,{cols:t.cols,className:t.className,children:d.map(e=>r(y,{namespace:a,configKey:e.id,id:e.id,name:e.name,price:e.price,currency:e.currency,description:e.description??"",features:e.features??[],popular:e.popular,mode:"subscription",priceId:e.priceId,metadata:{billingConfigKey:e.id,planId:e.id,planName:e.name,billingInterval:e.interval,productType:"subscription",source:"subscription_template",...e.metadata},successUrl:m,cancelUrl:u,allowPromotionCodes:!0},e.id))})})()]})})}export{L as SubscriptionTemplate};
@@ -24,5 +24,5 @@ export interface BlogListProps {
24
24
  *
25
25
  * @version 0.0.4
26
26
  */
27
- export declare function BlogList({ posts, emptyState, }: BlogListProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
27
+ export declare function BlogList({ posts, emptyState }: BlogListProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
28
28
  //# sourceMappingURL=BlogList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlogList.d.ts","sourceRoot":"","sources":["../../src/blog/BlogList.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AA+BD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,UAAU,GACX,EAAE,aAAa,qTAwIf"}
1
+ {"version":3,"file":"BlogList.d.ts","sourceRoot":"","sources":["../../src/blog/BlogList.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAwBD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,aAAa,qTAwI5D"}
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as n,Fragment as g}from"react/jsx-runtime";import{useState as j}from"react";import{Card as u,Grid as x,Stack as h,Tag as p,Text as c}from"@donotdev/components";import{useTranslation as y}from"@donotdev/core";import{Link as f}from"@donotdev/ui";function v({post:i,readMoreLabel:o}){return n("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},children:[i.tags.length>0&&t(c,{as:"span",level:"caption",variant:"muted",children:i.tags.join(" \xB7 ")}),n(c,{as:"span",level:"small",variant:"accent",children:[o," \u2192"]})]})}function F({posts:i,emptyState:o}){const{t:r}=y("blog"),[l,d]=j(null);if(i.length===0)return o||t(c,{as:"p",variant:"muted",align:"center",children:r("empty")});const m=[...new Set(i.flatMap(e=>e.tags))].sort(),b=l?i.filter(e=>e.tags.includes(l)):i,[a,...s]=b;return n(h,{gap:"large",children:[m.length>0&&n(h,{direction:"row",gap:"tight",wrap:"wrap",justify:"center",children:[t(p,{interactive:!0,variant:l===null?"accent":"outline",onClick:()=>d(null),size:"sm",children:r("all")}),m.map(e=>t(p,{interactive:!0,variant:l===e?"accent":"outline",onClick:()=>d(e===l?null:e),size:"sm",children:e},e))]}),a&&t(f,{path:`/blog/${a.slug}`,children:t(u,{clickable:!0,title:a.meta.title,subtitle:[a.meta.date,`${a.readingTime} ${r("minuteRead")}`].filter(Boolean).join(" \xB7 "),content:n(g,{children:[a.meta.image&&t("img",{src:a.meta.image,alt:a.meta.title,loading:"eager",decoding:"async",style:{width:"100%",maxHeight:"360px",objectFit:"cover",borderRadius:"var(--radius-md)",marginBottom:"var(--gap-md)"}}),t(c,{as:"p",children:a.meta.description})]}),footer:t(v,{post:a,readMoreLabel:r("readMore")})})}),s.length>0&&t(x,{cols:[1,1,2,3],gap:"medium",children:s.map(e=>t(f,{path:`/blog/${e.slug}`,children:t(u,{clickable:!0,title:e.meta.title,subtitle:[e.meta.date,`${e.readingTime} ${r("minuteRead")}`].filter(Boolean).join(" \xB7 "),content:n(g,{children:[e.meta.image&&t("img",{src:e.meta.image,alt:e.meta.title,loading:"lazy",decoding:"async",style:{width:"100%",maxHeight:"180px",objectFit:"cover",borderRadius:"var(--radius-md)",marginBottom:"var(--gap-sm)"}}),t(c,{as:"p",level:"small",children:e.meta.description})]}),footer:t(v,{post:e,readMoreLabel:r("readMore")})})},e.slug))})]})}export{F as BlogList};
1
+ "use client";import{jsx as t,jsxs as n,Fragment as u}from"react/jsx-runtime";import{useState as j}from"react";import{Card as h,Grid as x,Stack as d,Tag as f,Text as c}from"@donotdev/components";import{useTranslation as w}from"@donotdev/core";import{Link as v}from"@donotdev/ui";function p({post:i,readMoreLabel:o}){return n(d,{direction:"row",justify:"between",align:"center",style:{width:"100%"},children:[i.tags.length>0&&t(c,{as:"span",level:"caption",variant:"muted",children:i.tags.join(" \xB7 ")}),n(c,{as:"span",level:"small",variant:"accent",children:[o," \u2192"]})]})}function F({posts:i,emptyState:o}){const{t:r}=w("blog"),[l,m]=j(null);if(i.length===0)return o||t(c,{as:"p",variant:"muted",align:"center",children:r("empty")});const s=[...new Set(i.flatMap(e=>e.tags))].sort(),b=l?i.filter(e=>e.tags.includes(l)):i,[a,...g]=b;return n(d,{gap:"large",children:[s.length>0&&n(d,{direction:"row",gap:"tight",wrap:"wrap",justify:"center",children:[t(f,{interactive:!0,variant:l===null?"accent":"outline",onClick:()=>m(null),size:"sm",children:r("all")}),s.map(e=>t(f,{interactive:!0,variant:l===e?"accent":"outline",onClick:()=>m(e===l?null:e),size:"sm",children:e},e))]}),a&&t(v,{path:`/blog/${a.slug}`,children:t(h,{clickable:!0,title:a.meta.title,subtitle:[a.meta.date,`${a.readingTime} ${r("minuteRead")}`].filter(Boolean).join(" \xB7 "),content:n(u,{children:[a.meta.image&&t("img",{src:a.meta.image,alt:a.meta.title,loading:"eager",decoding:"async",style:{width:"100%",maxHeight:"360px",objectFit:"cover",borderRadius:"var(--radius-md)",marginBottom:"var(--gap-md)"}}),t(c,{as:"p",children:a.meta.description})]}),footer:t(p,{post:a,readMoreLabel:r("readMore")})})}),g.length>0&&t(x,{cols:[1,1,2,3],children:g.map(e=>t(v,{path:`/blog/${e.slug}`,children:t(h,{clickable:!0,title:e.meta.title,subtitle:[e.meta.date,`${e.readingTime} ${r("minuteRead")}`].filter(Boolean).join(" \xB7 "),content:n(u,{children:[e.meta.image&&t("img",{src:e.meta.image,alt:e.meta.title,loading:"lazy",decoding:"async",style:{width:"100%",maxHeight:"180px",objectFit:"cover",borderRadius:"var(--radius-md)",marginBottom:"var(--gap-sm)"}}),t(c,{as:"p",level:"small",children:e.meta.description})]}),footer:t(p,{post:e,readMoreLabel:r("readMore")})})},e.slug))})]})}export{F as BlogList};
@@ -25,5 +25,5 @@ export interface BlogPostProps {
25
25
  *
26
26
  * @version 0.0.3
27
27
  */
28
- export declare function BlogPostView({ post, }: BlogPostProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function BlogPostView({ post }: BlogPostProps): import("react/jsx-runtime").JSX.Element;
29
29
  //# sourceMappingURL=BlogPost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlogPost.d.ts","sourceRoot":"","sources":["../../src/blog/BlogPost.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,GACL,EAAE,aAAa,2CA8Df"}
1
+ {"version":3,"file":"BlogPost.d.ts","sourceRoot":"","sources":["../../src/blog/BlogPost.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,aAAa,2CA8DnD"}
@@ -5,5 +5,4 @@ export interface MarkdownViewerProps {
5
5
  className?: string;
6
6
  }
7
7
  export declare const MarkdownViewer: import("react").NamedExoticComponent<MarkdownViewerProps>;
8
- export default MarkdownViewer;
9
8
  //# sourceMappingURL=MarkdownViewer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownViewer.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownViewer.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyFD,eAAO,MAAM,cAAc,2DAA2B,CAAC;AACvD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"MarkdownViewer.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownViewer.tsx"],"names":[],"mappings":"AAmDA,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyFD,eAAO,MAAM,cAAc,2DAA2B,CAAC"}
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import u,{domToReact as p,Element as c}from"html-react-parser";import{marked as g}from"marked";import{memo as h,useMemo as x}from"react";import{Code as k,cn as w}from"@donotdev/components";import{Link as y}from"@donotdev/ui";function m(n){let a="";for(const e of n.children)e.type==="text"?a+=e.data:e instanceof c&&(a+=m(e));return a}const b=({content:n,className:a})=>{const e=x(()=>{if(!n)return null;const d=g.parse(n,{async:!1,gfm:!0,breaks:!0});return u(d,{replace(l){if(!(l instanceof c))return;const{name:i,attribs:s,children:f}=l;if(i==="pre"){const r=f.find(t=>t instanceof c&&t.name==="code");if(r){const t=/language-(\w+)/.exec(r.attribs?.class||"")?.[1]||"text";return o(k,{language:t,children:m(r).replace(/\n$/,"")})}}if(i==="a"){const r=s?.href||"";return o(y,{path:r,children:p(f)})}if(i==="img"){const r=s?.src||"",t=s?.alt||"";return o("img",{src:r,alt:t,loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto"}})}}})},[n]);return e?o("div",{className:w("prose",a),children:e}):null},M=h(b);var B=M;export{M as MarkdownViewer,B as default};
1
+ "use client";import{jsx as c}from"react/jsx-runtime";import g,{domToReact as u,Element as o}from"html-react-parser";import{marked as E}from"marked";import{memo as R,useMemo as h}from"react";import{Code as _,cn as x}from"@donotdev/components";import{Link as S}from"@donotdev/ui";const w=/<script[\s\S]*?<\/script>/gi,b=/<iframe[\s\S]*?(?:<\/iframe>|\/?>)/gi,j=/<object[\s\S]*?(?:<\/object>|\/?>)/gi,k=/<embed[\s\S]*?(?:\/?>)/gi,T=/<svg[^>]*\s+on\w+[\s\S]*?(?:<\/svg>|\/?>)/gi,v=/\s+on\w+\s*=\s*["'][^"']*["']/gi,y=/\s+(?:xlink:)?href\s*=\s*["']\s*(?:javascript:|&#\d+;|&#x[0-9a-f]+;)[^"']*["']/gi,M=/\s+src\s*=\s*["']\s*(?:javascript:|&#\d+;|&#x[0-9a-f]+;)[^"']*["']/gi;function V(e){return e.replace(w,"").replace(b,"").replace(j,"").replace(k,"").replace(T,"").replace(v,"").replace(y,"").replace(M,"")}function m(e){let n="";for(const r of e.children)r.type==="text"?n+=r.data:r instanceof o&&(n+=m(r));return n}const C=({content:e,className:n})=>{const r=h(()=>{if(!e)return null;const p=E.parse(e,{async:!1,gfm:!0,breaks:!0}),d=V(p);return g(d,{replace(l){if(!(l instanceof o))return;const{name:a,attribs:i,children:f}=l;if(a==="pre"){const t=f.find(s=>s instanceof o&&s.name==="code");if(t){const s=/language-(\w+)/.exec(t.attribs?.class||"")?.[1]||"text";return c(_,{language:s,children:m(t).replace(/\n$/,"")})}}if(a==="a"){const t=i?.href||"";return c(S,{path:t,children:u(f)})}if(a==="img"){const t=i?.src||"",s=i?.alt||"";return c("img",{src:t,alt:s,loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto"}})}}})},[e]);return r?c("div",{className:x("prose",n),children:r}):null},D=R(C);export{D as MarkdownViewer};
@@ -46,5 +46,4 @@ export interface CarCardListTemplateProps extends Omit<EntityCardListProps, 'col
46
46
  * @returns React component
47
47
  */
48
48
  export declare function CarCardListTemplate({ entity, title, description, basePath, onClick, cols, staleTime, filter, hideFilters, makeField, modelField, imageField, mileageField, yearField, transmissionField, fuelTypeField, priceField, subtitleField, locale, imageAspectRatio, hideSection, }: CarCardListTemplateProps): import("react/jsx-runtime").JSX.Element;
49
- export default CarCardListTemplate;
50
49
  //# sourceMappingURL=CarCardListTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CarCardListTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/CarCardListTemplate.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAY1D,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,mBAAmB,EACnB,MAAM,CACP;IACC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8GAA8G;IAC9G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAC1B,MAAM,EACN,WAAmB,EACnB,SAAkB,EAClB,UAAoB,EACpB,UAAqB,EACrB,YAAwB,EACxB,SAAkB,EAClB,iBAAkC,EAClC,aAA0B,EAC1B,UAAoB,EACpB,aAAyB,EACzB,MAAM,EACN,gBAAyB,EACzB,WAAmB,GACpB,EAAE,wBAAwB,2CA0Y1B;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CarCardListTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/CarCardListTemplate.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAY1D,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,mBAAmB,EACnB,MAAM,CACP;IACC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8GAA8G;IAC9G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAC1B,MAAM,EACN,WAAmB,EACnB,SAAkB,EAClB,UAAoB,EACpB,UAAqB,EACrB,YAAwB,EACxB,SAAkB,EAClB,iBAAkC,EAClC,aAA0B,EAC1B,UAAoB,EACpB,aAAyB,EACzB,MAAM,EACN,gBAAyB,EACzB,WAAmB,GACpB,EAAE,wBAAwB,2CA+Y1B"}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i,Fragment as he}from"react/jsx-runtime";import{useMemo as ve,useCallback as P}from"react";import{Heart as q,Calendar as ye,Gauge as we,Fuel as Fe,Sliders as Ce}from"lucide-react";import{Grid as be,Card as Ve,Stack as n,Text as a,Section as J,Button as xe,Spinner as Se}from"@donotdev/components";import{useTranslation as K}from"@donotdev/core";import{useNavigate as ke}from"@donotdev/ui";import{useCrudCardList as je,useCrudFilters as Q,EntityFilters as Te,matchesFilter as Ne,useEntityFavorites as $e,formatValue as T}from"@donotdev/crud";function ze({entity:r,title:Oe,description:Ae,basePath:W,onClick:p,cols:X=[1,2,3,4],staleTime:Y=1e3*60*30,filter:h,hideFilters:Z=!1,makeField:ee="make",modelField:te="model",imageField:le="images",mileageField:re="mileage",yearField:ie="year",transmissionField:N="transmission",fuelTypeField:$="fuelType",priceField:z="price",subtitleField:ne="variant",locale:oe,imageAspectRatio:ae="16/9",hideSection:se=!1}){const O=ke(),A=W??`/${r.collection}`,v=r.collection,{t:f,i18n:ce}=K([r.namespace,"crud"]),{t:o}=K("crud"),de=oe||ce?.language?.replace("_","-")||"en-US",{data:ue,loading:L}=je(r,{staleTime:Y}),y=ue?.items||[],{isFavorite:fe,toggleFavorite:ge,favoritesFilter:D}=$e({collection:v}),{showFavoritesOnly:d,setShowFavoritesOnly:me}=Q({collection:v}),{filters:w}=Q({collection:v}),_=P(l=>Object.keys(w).length===0?!0:Object.entries(w).every(([t,g])=>{const m=l[t],C=r.fields[t]?.type||"text";return Ne(m,g,C)}),[w,r.fields]),u=ve(()=>{let l=y;return l=l.filter(_),d&&(l=l.filter(D)),h&&(l=l.filter(h)),l},[y,_,d,D,h]),pe=P(l=>{p?p(l):O(`${A}/${l}`)},[A,O,p]),F=f("name",{defaultValue:r.name});return i(he,{children:[!Z&&e(J,{title:o("filters.title",{entity:F,defaultValue:`Browse ${F} - Filters`}),collapsible:!0,defaultOpen:!0,children:i(n,{direction:"column",children:[e(xe,{variant:d?"primary":"outline",icon:e(q,{size:18}),onClick:()=>me(!d),children:d?o("favorites.showAll",{defaultValue:"Show All"}):o("favorites.showFavorites",{defaultValue:"Show Favorites"})}),e(Te,{entity:r,data:y,fieldsToFilter:r.listCardFields})]})}),(()=>{const l=L?e(n,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)"},children:e(Se,{})}):u.length===0?i(n,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},children:[e(a,{level:"h3",style:{color:"var(--muted-foreground)"},children:o("emptyState.title",{defaultValue:`No ${r.name.toLowerCase()} found`})}),e(a,{style:{color:"var(--muted-foreground)"},children:o("emptyState.description",{defaultValue:`No ${r.name.toLowerCase()} available at this time.`})})]}):e(be,{cols:X,children:u.map(t=>{if(t==null)return null;const g=t[le],m=typeof g=="string"?g:null,B=t[ee],C=t[te],c=t[re],b=t[ie],I=t[N],R=t[$],E=t[z],G=r.fields[z]??void 0,U=t[ne??"variant"],V=fe(t.id),H=r.fields[N],M=r.fields[$],x=H&&I!=null?T(I,H,f,{compact:!0}):null,S=M&&R!=null?T(R,M,f,{compact:!0}):null,k=[B,C].filter(Boolean).join(" ");return i(Ve,{clickable:!0,onClick:()=>pe(t.id),elevated:!0,style:{position:"relative",padding:0,overflow:"hidden"},children:[e(q,{fill:V?"#ef4444":"#ffffff",stroke:V?"#ef4444":"var(--muted-foreground)",onClick:s=>{s.stopPropagation(),ge(t.id)},style:{position:"absolute",top:"var(--gap-sm)",right:"var(--gap-sm)",zIndex:10,cursor:"pointer",width:"var(--icon-md)",height:"var(--icon-md)",transition:"fill 0.2s, stroke 0.2s"},"aria-label":V?o("favorites.remove",{defaultValue:"Remove from favorites"}):o("favorites.add",{defaultValue:"Add to favorites"})}),m&&e("div",{style:{width:"100%",aspectRatio:ae,overflow:"hidden"},children:e("img",{src:m,alt:k||F,style:{width:"100%",height:"100%",objectFit:"cover"}})}),i(n,{direction:"column",gap:"tight",style:{padding:"var(--gap-md)"},children:[k&&e(a,{level:"h4",weight:"semibold",children:k}),U&&e(a,{variant:"muted",level:"small",children:U}),E!=null&&G!=null&&(()=>{const s=G;if(!s)return null;const j=T(E,s,f,{compact:!0});return e("div",{style:{marginTop:"var(--gap-xs)",textAlign:"end"},children:typeof j=="string"?e(a,{variant:"accent",align:"end",weight:"bold",children:j}):j})})(),i(n,{direction:"column",gap:"tight",style:{marginTop:"var(--gap-sm)"},children:[(b||c)&&i(n,{direction:"row",gap:"tight",align:"center",children:[b&&i(n,{direction:"row",gap:"tight",align:"center",children:[e(ye,{size:16,style:{color:"var(--muted-foreground)"}}),e(a,{level:"small",children:b})]}),c&&i(n,{direction:"row",gap:"tight",align:"center",children:[e(we,{size:16,style:{color:"var(--muted-foreground)"}}),e(a,{level:"small",children:(()=>{const s=typeof c=="number"?c:Number(c);if(isNaN(s))return String(c)+" km";try{return new Intl.NumberFormat(de).format(s)+" km"}catch{return String(s)+" km"}})()})]})]}),(S||x)&&i(n,{direction:"row",gap:"tight",align:"center",children:[S&&i(n,{direction:"row",gap:"tight",align:"center",children:[e(Fe,{size:16,style:{color:"var(--muted-foreground)"}}),e(a,{level:"small",children:S})]}),x&&i(n,{direction:"row",gap:"tight",align:"center",children:[e(Ce,{size:16,style:{color:"var(--muted-foreground)"}}),e(a,{level:"small",children:x})]})]})]})]})]},t.id)})});return se?l:e(J,{title:L?o("results.title.fetching",{defaultValue:"Fetching..."}):o("results.title.count",{count:u.length,defaultValue:u.length===1?"Found 1 item":`Found ${u.length} items`}),collapsible:!0,defaultOpen:!0,children:l})})()]})}var Ue=ze;export{ze as CarCardListTemplate,Ue as default};
1
+ "use client";import{jsx as e,jsxs as n,Fragment as pe}from"react/jsx-runtime";import{useMemo as he,useCallback as P}from"react";import{Heart as q,Calendar as ve,Gauge as ye,Fuel as we,Sliders as Fe}from"lucide-react";import{Grid as be,Card as Ce,Stack as i,Text as o,Section as J,Button as xe,Spinner as Ve}from"@donotdev/components";import{useTranslation as K,getListCardFieldNames as ke}from"@donotdev/core";import{useNavigate as Se}from"@donotdev/ui";import{useCrudCardList as je,useCrudFilters as Te,EntityFilters as Ne,matchesFilter as $e,useEntityFavorites as ze,formatValue as j}from"@donotdev/crud";function Ue({entity:l,title:Le,description:Oe,basePath:Q,onClick:p,cols:W=[1,2,3,4],staleTime:X=1e3*60*30,filter:h,hideFilters:Y=!1,makeField:Z="make",modelField:ee="model",imageField:te="images",mileageField:re="mileage",yearField:le="year",transmissionField:T="transmission",fuelTypeField:N="fuelType",priceField:$="price",subtitleField:ne="variant",locale:ie,imageAspectRatio:ae="16/9",hideSection:oe=!1}){const z=Se(),L=Q??`/${l.collection}`,O=l.collection,{t:g,i18n:se}=K([l.namespace,"crud"]),{t:a}=K("crud"),ce=ie||se?.language?.replace("_","-")||"en-US",{data:de,loading:A}=je(l,{staleTime:X}),v=de?.items||[],{isFavorite:ue,toggleFavorite:ge,favoritesFilter:I}=ze({collection:O}),{showFavoritesOnly:d,setShowFavoritesOnly:fe,filters:y}=Te({collection:O}),D=P(r=>Object.keys(y).length===0?!0:Object.entries(y).every(([t,f])=>{const m=r[t],F=l.fields[t]?.type||"text";return $e(m,f,F)}),[y,l.fields]),u=he(()=>{let r=v;return r=r.filter(D),d&&(r=r.filter(I)),h&&(r=r.filter(h)),r},[v,D,d,I,h]),me=P(r=>{p?p(r):z(`${L}/${r}`)},[L,z,p]),w=g("name",{defaultValue:l.name});return n(pe,{children:[!Y&&e(J,{title:a("filters.title",{entity:w,defaultValue:`Browse ${w} - Filters`}),collapsible:!0,defaultOpen:!0,children:n(i,{direction:"column",children:[e(xe,{variant:d?"primary":"outline",icon:e(q,{size:18}),onClick:()=>fe(!d),children:d?a("favorites.showAll",{defaultValue:"Show All"}):a("favorites.showFavorites",{defaultValue:"Show Favorites"})}),e(Ne,{entity:l,data:v,fieldsToFilter:ke(l)})]})}),(()=>{const r=A?e(i,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)"},children:e(Ve,{})}):u.length===0?n(i,{align:"center",justify:"center",style:{padding:"var(--gap-3xl)",textAlign:"center"},children:[e(o,{level:"h3",style:{color:"var(--muted-foreground)"},children:a("emptyState.title",{defaultValue:`No ${l.name.toLowerCase()} found`})}),e(o,{style:{color:"var(--muted-foreground)"},children:a("emptyState.description",{defaultValue:`No ${l.name.toLowerCase()} available at this time.`})})]}):e(be,{cols:W,children:u.map(t=>{if(t==null)return null;const f=t[te],m=typeof f=="string"?f:null,R=t[Z],F=t[ee],c=t[re],b=t[le],_=t[T],B=t[N],E=t[$],G=l.fields[$]??void 0,U=t[ne??"variant"],C=ue(t.id),H=l.fields[T],M=l.fields[N],x=H&&_!=null?j(_,H,g,{compact:!0}):null,V=M&&B!=null?j(B,M,g,{compact:!0}):null,k=[R,F].filter(Boolean).join(" ");return n(Ce,{clickable:!0,onClick:()=>me(t.id),elevated:!0,style:{position:"relative",padding:0,overflow:"hidden"},children:[e("button",{type:"button",onClick:s=>{s.stopPropagation(),ge(t.id)},style:{position:"absolute",top:"var(--gap-sm)",insetInlineEnd:"var(--gap-sm)",zIndex:10,cursor:"pointer",padding:"var(--gap-xs)",borderRadius:"var(--radius-full)",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},"aria-label":C?a("favorites.remove",{defaultValue:"Remove from favorites"}):a("favorites.add",{defaultValue:"Add to favorites"}),children:e(q,{fill:C?"#ef4444":"#ffffff",stroke:C?"#ef4444":"var(--muted-foreground)",style:{width:"var(--icon-md)",height:"var(--icon-md)",transition:"fill 0.2s, stroke 0.2s"}})}),m&&e("div",{style:{width:"100%",aspectRatio:ae,overflow:"hidden"},children:e("img",{src:m,alt:k||w,style:{width:"100%",height:"100%",objectFit:"cover"}})}),n(i,{direction:"column",gap:"tight",style:{padding:"var(--gap-md)"},children:[k&&e(o,{level:"h4",weight:"semibold",children:k}),U&&e(o,{variant:"muted",level:"small",children:U}),E!=null&&G!=null&&(()=>{const s=G;if(!s)return null;const S=j(E,s,g,{compact:!0});return e("div",{style:{marginTop:"var(--gap-xs)",textAlign:"end"},children:typeof S=="string"?e(o,{variant:"accent",align:"end",weight:"bold",children:S}):S})})(),n(i,{direction:"column",gap:"tight",style:{marginTop:"var(--gap-sm)"},children:[(b||c)&&n(i,{direction:"row",gap:"tight",align:"center",children:[b&&n(i,{direction:"row",gap:"tight",align:"center",children:[e(ve,{size:16,style:{color:"var(--muted-foreground)"}}),e(o,{level:"small",children:b})]}),c&&n(i,{direction:"row",gap:"tight",align:"center",children:[e(ye,{size:16,style:{color:"var(--muted-foreground)"}}),e(o,{level:"small",children:(()=>{const s=typeof c=="number"?c:Number(c);if(isNaN(s))return String(c)+" km";try{return new Intl.NumberFormat(ce).format(s)+" km"}catch{return String(s)+" km"}})()})]})]}),(V||x)&&n(i,{direction:"row",gap:"tight",align:"center",children:[V&&n(i,{direction:"row",gap:"tight",align:"center",children:[e(we,{size:16,style:{color:"var(--muted-foreground)"}}),e(o,{level:"small",children:V})]}),x&&n(i,{direction:"row",gap:"tight",align:"center",children:[e(Fe,{size:16,style:{color:"var(--muted-foreground)"}}),e(o,{level:"small",children:x})]})]})]})]})]},t.id)})});return oe?r:e(J,{title:A?a("results.title.fetching",{defaultValue:"Fetching..."}):a("results.title.count",{count:u.length,defaultValue:u.length===1?"Found 1 item":`Found ${u.length} items`}),collapsible:!0,defaultOpen:!0,children:r})})()]})}export{Ue as CarCardListTemplate};
@@ -34,5 +34,4 @@ export interface CarDetailTemplateProps {
34
34
  * CarDetailTemplate - Full vehicle detail page
35
35
  */
36
36
  export declare function CarDetailTemplate({ entity, id: propId, customerEntity, inquiryEntity, relatedFields, locale, makeField, modelField, variantField, yearField, mileageField, fuelTypeField, transmissionField, priceField, imagesField, descriptionField, contextField, pageNamespace, }: CarDetailTemplateProps): ReactElement;
37
- export default CarDetailTemplate;
38
37
  //# sourceMappingURL=CarDetailTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CarDetailTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/CarDetailTemplate.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAOD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,EAAE,EAAE,MAAM,EACV,cAAc,EACd,aAAa,EACb,aAAiC,EACjC,MAAM,EACN,SAAkB,EAClB,UAAoB,EACpB,YAAwB,EACxB,SAAkB,EAClB,YAAwB,EACxB,aAA0B,EAC1B,iBAAkC,EAClC,UAAoB,EACpB,WAAsB,EACtB,gBAAgB,EAChB,YAAsB,EACtB,aAAa,GACd,EAAE,sBAAsB,GAAG,YAAY,CAwfvC;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"CarDetailTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/CarDetailTemplate.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAOD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,EAAE,EAAE,MAAM,EACV,cAAc,EACd,aAAa,EACb,aAAiC,EACjC,MAAM,EACN,SAAkB,EAClB,UAAoB,EACpB,YAAwB,EACxB,SAAkB,EAClB,YAAwB,EACxB,aAA0B,EAC1B,iBAAkC,EAClC,UAAoB,EACpB,WAAsB,EACtB,gBAAgB,EAChB,YAAsB,EACtB,aAAa,GACd,EAAE,sBAAsB,GAAG,YAAY,CAigBvC"}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as Y,useEffect as ft,useMemo as y,useCallback as gt}from"react";import{Share2 as pt,Heart as mt}from"lucide-react";import{Grid as B,Card as z,Stack as h,Text as s,Section as N,Button as k,ImageGallery as vt,Spinner as St}from"@donotdev/components";import{PageContainer as L,Link as bt,useRouteParam as xt,useNavigate as yt}from"@donotdev/ui";import{useTranslation as M}from"@donotdev/core";import{useCrud as Ct,useCrudCardList as wt,formatValue as D,useRelatedItems as It,useEntityFavorites as Ut}from"@donotdev/crud";import{InquiryFormTemplate as kt}from"./InquiryFormTemplate";function Dt({entity:i,id:Z,customerEntity:R,inquiryEntity:T,relatedFields:F=["make","price"],locale:tt,makeField:p="make",modelField:m="model",variantField:W="variant",yearField:f="year",mileageField:v="mileage",fuelTypeField:C="fuelType",transmissionField:w="transmission",priceField:u="price",imagesField:$="images",descriptionField:A,contextField:et="carId",pageNamespace:rt}){const nt=xt("id"),S=Z||nt||"",it=yt(),ot=i.namespace||`entity-${i.name.toLowerCase()}`,{t:a,i18n:at}=M([ot,"crud"]),ct=rt||i.collection,{t:o}=M(ct),{t:Vt}=M("crud"),V=tt||at?.language?.replace("_","-")||"en-US",{get:_}=Ct(i,{backend:"functions"}),[r,lt]=Y(null),[q,I]=Y("pending"),{data:st}=wt(i,{staleTime:1e3*60*30}),{isFavorite:ut,toggleFavorite:dt}=Ut({collection:i.collection}),G=ut(S),U=y(()=>i.fields[u],[i.fields,u]),j=gt(t=>t==null?"\u2014":new Intl.NumberFormat(V).format(t)+" km",[V]),H=y(()=>{if(A)return A;const t=`description_${V}`;return i.fields[t]?t:i.fields.description?"description":null},[A,V,i.fields]),E=y(()=>{const t=r?.[$];return t?Array.isArray(t)?t.map(n=>typeof n=="object"&&n&&"fullUrl"in n?{fullUrl:n.fullUrl,thumbUrl:n.thumbUrl}:{fullUrl:n,thumbUrl:n}):[{fullUrl:t,thumbUrl:t}]:[]},[r,$]),g=y(()=>{if(!r)return"";const t=r[p]||"",n=r[m]||"",c=r[W]||"";return[t,n,c].filter(Boolean).join(" ")},[r,p,m,W]),J=y(()=>{if(!r)return[];const t=[],n=r[f];n!=null&&t.push({label:a(f),value:String(n)});const c=r[v];c!=null&&t.push({label:a(v),value:j(c)});const b=r[C];if(b&&i.fields[C]){const d=D(b,i.fields[C],a,{compact:!0});t.push({label:a(C),value:typeof d=="string"?d:String(b)})}const x=r[w];if(x&&i.fields[w]){const d=D(x,i.fields[w],a,{compact:!0});t.push({label:a(w),value:typeof d=="string"?d:String(x)})}return t},[r,f,v,C,w,i.fields,a,j]),{items:K}=It(i,r,st?.items||[],F,{limit:3,tolerance:.3}),O=y(()=>{if(!r)return g;const t=[];if(r[p]&&t.push(String(r[p])),r[m]&&t.push(String(r[m])),r[f]&&t.push(String(r[f])),r[v]&&t.push(j(r[v])),r[u]&&U){const n=r[u],c=D(n,U,a,{asString:!0});t.push(typeof c=="string"?c:String(r[u]))}return t.length>0?t.join(" \u2022 "):g},[r,p,m,f,v,u,U,j,a,g]);ft(()=>{if(!S){I("error");return}I("pending"),_(S).then(t=>{t?(lt(t),I("success")):I("error")}).catch(()=>{I("error")})},[S,_]);const ht=async()=>{navigator.share?await navigator.share({title:g,url:window.location.href}):await navigator.clipboard.writeText(window.location.href)},Q=H&&r?r[H]:null;return q==="pending"?e(L,{children:e(St,{overlay:!0})}):q==="error"||!r?e(L,{children:l(h,{direction:"column",gap:"large",style:{padding:"var(--gap-xl) 0",textAlign:"center"},children:[e(s,{level:"h2",children:o("notFound","Vehicle not found")}),e(bt,{path:"/",children:e(k,{variant:"primary",children:o("backToHome","Back to home")})})]})}):l(L,{children:[e(N,{children:l(B,{cols:[1,1,2,2],gap:"large",children:[e("div",{children:E.length>0?e(vt,{images:E,altPrefix:g}):e("div",{style:{width:"100%",aspectRatio:"16/9",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--muted)",borderRadius:"var(--radius-lg)"},children:e(s,{variant:"muted",children:o("noImages","No images")})})}),l(h,{direction:"column",gap:"large",children:[l(h,{direction:"column",gap:"tight",children:[e(h,{direction:"row",gap:"tight",align:"center",children:e(s,{level:"h1",style:{margin:0},children:g})}),e("div",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,color:"var(--accent)"},children:(()=>{const t=r[u];if(t==null||!U)return null;const n=D(t,U,a,{});return typeof n=="string"?e(s,{variant:"accent",weight:"bold",style:{fontSize:"var(--font-size-3xl)"},children:n}):n})()})]}),J.length>0&&e(z,{variant:"glass",children:e(B,{cols:2,children:J.map(({label:t,value:n})=>l(h,{direction:"column",gap:"tight",children:[e(s,{variant:"muted",style:{fontSize:"var(--font-size-sm)"},children:t}),e(s,{style:{fontWeight:500},children:n})]},t))})}),l(h,{direction:"row",children:[R&&T?e(k,{variant:"primary",style:{flex:1},onClick:()=>{const t=document.getElementById("inquiry-form");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:o("contactUs","Contact us")}):e(k,{variant:"primary",style:{flex:1},disabled:!0,children:o("contactUs","Contact us")}),e(k,{variant:"outline",icon:e(pt,{size:18}),onClick:ht,children:o("share","Share")}),e(k,{variant:G?"primary":"outline",icon:e(mt,{size:18}),onClick:()=>dt(S),children:G?o("saved","Saved"):o("save","Save")})]})]})]})}),Q&&e(N,{title:o("description","Description"),children:e(z,{variant:"glass",children:e(s,{style:{whiteSpace:"pre-wrap",lineHeight:1.7},children:Q})})}),R&&T&&e(N,{id:"inquiry-form",title:o("interested","Interested?"),children:e(z,{variant:"glass",title:o("getInTouch","Get in touch"),children:e(kt,{customerEntity:R,inquiryEntity:T,contextId:S,contextName:g,contextDetails:O,messagePlaceholder:O,contextField:et})})}),K.length>0&&e(N,{title:o("similarVehicles","Similar Vehicles"),children:e(B,{cols:[1,2,3,3],children:K.map(t=>{const n=t[$],c=n?typeof n=="string"?n:Array.isArray(n)?n[0]?.thumbUrl||n[0]?.fullUrl||n[0]:null:null,b=t[p]||"",x=t[m]||"";return e(z,{clickable:!0,onClick:()=>it(`/${i.collection}/${t.id}`),elevated:!0,children:l(h,{direction:"column",children:[c&&e("div",{style:{width:"100%",aspectRatio:"16/9",borderRadius:"var(--radius-md)",overflow:"hidden",backgroundColor:"var(--muted)"},children:e("img",{src:c,alt:`${b} ${x}`,style:{width:"100%",height:"100%",objectFit:"cover"}})}),l(h,{direction:"column",gap:"tight",children:[l(s,{level:"h4",style:{margin:0},children:[b," ",x]}),e(s,{variant:"muted",children:t[f]}),(()=>{const d=t[u],X=i.fields[u];if(d==null||!X)return null;const P=D(d,X,a,{compact:!0});return typeof P=="string"?e(s,{style:{fontWeight:700,color:"var(--accent)"},children:P}):e("div",{style:{fontWeight:700,color:"var(--accent)"},children:P})})()]})]})},t.id)})})})]})}var Bt=Dt;export{Dt as CarDetailTemplate,Bt as default};
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as Y,useEffect as ft,useMemo as C,useCallback as gt}from"react";import{Share2 as pt,Heart as mt}from"lucide-react";import{Grid as P,Card as z,Stack as d,Text as s,Section as N,Button as D,ImageGallery as vt,Spinner as St}from"@donotdev/components";import{PageContainer as _,Link as bt,useRouteParam as yt,useNavigate as Ct}from"@donotdev/ui";import{useTranslation as B}from"@donotdev/core";import{useCrud as wt,useCrudCardList as xt,formatValue as k,useRelatedItems as It,useEntityFavorites as Ut}from"@donotdev/crud";import{InquiryFormTemplate as Dt}from"./InquiryFormTemplate";function $t({entity:i,id:Z,customerEntity:A,inquiryEntity:E,relatedFields:F=["make","price"],locale:tt,makeField:p="make",modelField:m="model",variantField:L="variant",yearField:f="year",mileageField:v="mileage",fuelTypeField:w="fuelType",transmissionField:x="transmission",priceField:u="price",imagesField:R="images",descriptionField:T,contextField:et="carId",pageNamespace:rt}){const nt=yt("id"),S=Z||nt||"",it=Ct(),ot=i.namespace||`entity-${i.name.toLowerCase()}`,{t:a,i18n:at}=B([ot,"crud"]),ct=rt||i.collection,{t:o}=B(ct),{t:kt}=B("crud"),V=tt||at?.language?.replace("_","-")||"en-US",{get:M}=wt(i),[r,lt]=Y(null),[W,I]=Y("pending"),{data:st}=xt(i,{staleTime:1e3*60*30}),{isFavorite:ut,toggleFavorite:ht}=Ut({collection:i.collection}),q=ut(S),U=C(()=>i.fields[u],[i.fields,u]),j=gt(t=>t==null?"\u2014":new Intl.NumberFormat(V).format(t)+" km",[V]),G=C(()=>{if(T)return T;const t=`description_${V}`;return i.fields[t]?t:i.fields.description?"description":null},[T,V,i.fields]),H=C(()=>{const t=r?.[R];return t?Array.isArray(t)?t.map(n=>typeof n=="object"&&n&&"fullUrl"in n?{fullUrl:n.fullUrl,thumbUrl:n.thumbUrl}:{fullUrl:n,thumbUrl:n}):[{fullUrl:t,thumbUrl:t}]:[]},[r,R]),g=C(()=>{if(!r)return"";const t=r[p]||"",n=r[m]||"",c=r[L]||"";return[t,n,c].filter(Boolean).join(" ")},[r,p,m,L]),O=C(()=>{if(!r)return[];const t=[],n=r[f];n!=null&&t.push({label:a(f),value:String(n)});const c=r[v];c!=null&&t.push({label:a(v),value:j(c)});const b=r[w];if(b&&i.fields[w]){const h=k(b,i.fields[w],a,{compact:!0});t.push({label:a(w),value:typeof h=="string"?h:String(b)})}const y=r[x];if(y&&i.fields[x]){const h=k(y,i.fields[x],a,{compact:!0});t.push({label:a(x),value:typeof h=="string"?h:String(y)})}return t},[r,f,v,w,x,i.fields,a,j]),{items:J}=It(i,r,st?.items||[],F,{limit:3,tolerance:.3}),K=C(()=>{if(!r)return g;const t=[];if(r[p]&&t.push(String(r[p])),r[m]&&t.push(String(r[m])),r[f]&&t.push(String(r[f])),r[v]&&t.push(j(r[v])),r[u]&&U){const n=r[u],c=k(n,U,a,{asString:!0});t.push(typeof c=="string"?c:String(r[u]))}return t.length>0?t.join(" \u2022 "):g},[r,p,m,f,v,u,U,j,a,g]);ft(()=>{if(!S){I("error");return}I("pending"),M(S).then(t=>{t?(lt(t),I("success")):I("error")}).catch(()=>{I("error")})},[S,M]);const dt=async()=>{try{navigator.share?await navigator.share({title:g,url:window.location.href}):await navigator.clipboard.writeText(window.location.href)}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},Q=G&&r?r[G]:null;return W==="pending"?e(_,{children:e(St,{overlay:!0})}):W==="error"||!r?e(_,{children:l(d,{direction:"column",gap:"large",style:{padding:"var(--gap-xl) 0",textAlign:"center"},children:[e(s,{level:"h2",children:o("notFound","Vehicle not found")}),e(bt,{path:"/",children:e(D,{variant:"primary",children:o("backToHome","Back to home")})})]})}):l(_,{children:[e(N,{children:l(P,{cols:[1,1,2,2],gap:"large",children:[e("div",{children:H.length>0?e(vt,{images:H,altPrefix:g}):e("div",{style:{width:"100%",aspectRatio:"16/9",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--muted)",borderRadius:"var(--radius-lg)"},children:e(s,{variant:"muted",children:o("noImages","No images")})})}),l(d,{direction:"column",gap:"large",children:[l(d,{direction:"column",gap:"tight",children:[e(d,{direction:"row",gap:"tight",align:"center",children:e(s,{level:"h1",style:{margin:0},children:g})}),e("div",{style:{fontSize:"var(--font-size-3xl)",fontWeight:700,color:"var(--accent)"},children:(()=>{const t=r[u];if(t==null||!U)return null;const n=k(t,U,a,{});return typeof n=="string"?e(s,{variant:"accent",weight:"bold",style:{fontSize:"var(--font-size-3xl)"},children:n}):n})()})]}),O.length>0&&e(z,{variant:"glass",children:e(P,{cols:2,children:O.map(({label:t,value:n})=>l(d,{direction:"column",gap:"tight",children:[e(s,{variant:"muted",style:{fontSize:"var(--font-size-sm)"},children:t}),e(s,{style:{fontWeight:500},children:n})]},t))})}),l(d,{direction:"row",children:[A&&E?e(D,{variant:"primary",style:{flex:1},onClick:()=>{const t=document.getElementById("inquiry-form");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:o("contactUs","Contact us")}):e(D,{variant:"primary",style:{flex:1},disabled:!0,children:o("contactUs","Contact us")}),e(D,{variant:"outline",icon:e(pt,{size:18}),onClick:dt,children:o("share","Share")}),e(D,{variant:q?"primary":"outline",icon:e(mt,{size:18}),onClick:()=>ht(S),children:q?o("saved","Saved"):o("save","Save")})]})]})]})}),Q&&e(N,{title:o("description","Description"),children:e(z,{variant:"glass",children:e(s,{style:{whiteSpace:"pre-wrap",lineHeight:1.7},children:Q})})}),A&&E&&e(N,{id:"inquiry-form",title:o("interested","Interested?"),children:e(z,{variant:"glass",title:o("getInTouch","Get in touch"),children:e(Dt,{customerEntity:A,inquiryEntity:E,contextId:S,contextName:g,contextDetails:K,messagePlaceholder:K,contextField:et})})}),J.length>0&&e(N,{title:o("similarVehicles","Similar Vehicles"),children:e(P,{cols:[1,2,3,3],children:J.map(t=>{const n=t[R],c=n?typeof n=="string"?n:Array.isArray(n)?n[0]?.thumbUrl||n[0]?.fullUrl||n[0]:null:null,b=t[p]||"",y=t[m]||"";return e(z,{clickable:!0,onClick:()=>it(`/${i.collection}/${t.id}`),elevated:!0,children:l(d,{direction:"column",children:[c&&e("div",{style:{width:"100%",aspectRatio:"16/9",borderRadius:"var(--radius-md)",overflow:"hidden",backgroundColor:"var(--muted)"},children:e("img",{src:c,alt:`${b} ${y}`,style:{width:"100%",height:"100%",objectFit:"cover"}})}),l(d,{direction:"column",gap:"tight",children:[l(s,{level:"h4",style:{margin:0},children:[b," ",y]}),e(s,{variant:"muted",children:t[f]}),(()=>{const h=t[u],X=i.fields[u];if(h==null||!X)return null;const $=k(h,X,a,{compact:!0});return typeof $=="string"?e(s,{style:{fontWeight:700,color:"var(--accent)"},children:$}):e("div",{style:{fontWeight:700,color:"var(--accent)"},children:$})})()]})]})},t.id)})})})]})}export{$t as CarDetailTemplate};
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { Entity } from '@donotdev/core';
3
- interface InquiryAdminTemplateProps {
3
+ export interface InquiryAdminTemplateProps {
4
4
  /** Customer entity definition (linked via customerId) */
5
5
  customerEntity: Entity;
6
6
  /** Inquiry entity definition */
@@ -19,5 +19,4 @@ interface InquiryAdminTemplateProps {
19
19
  title?: string;
20
20
  }
21
21
  export declare function InquiryAdminTemplate({ customerEntity, inquiryEntity, customerBasePath, collapsible, defaultOpen, open, onOpenChange, title, }: InquiryAdminTemplateProps): ReactElement;
22
- export {};
23
22
  //# sourceMappingURL=InquiryAdminTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InquiryAdminTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/InquiryAdminTemplate.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAe1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAS7C,UAAU,yBAAyB;IACjC,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,cAAc,EACd,aAAa,EACb,gBAA+B,EAC/B,WAAmB,EACnB,WAAmB,EACnB,IAAI,EACJ,YAAY,EACZ,KAAK,GACN,EAAE,yBAAyB,GAAG,YAAY,CAqS1C"}
1
+ {"version":3,"file":"InquiryAdminTemplate.d.ts","sourceRoot":"","sources":["../../src/crud/InquiryAdminTemplate.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAe1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,WAAW,yBAAyB;IACxC,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,cAAc,EACd,aAAa,EACb,gBAA+B,EAC/B,WAAmB,EACnB,WAAmB,EACnB,IAAI,EACJ,YAAY,EACZ,KAAK,GACN,EAAE,yBAAyB,GAAG,YAAY,CAmS1C"}
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as o,Fragment as Y}from"react/jsx-runtime";import{useMemo as D,useCallback as H}from"react";import{Mail as J,Phone as K,User as Q,CheckCircle2 as P,Clock as X}from"lucide-react";import{Button as k,Card as V,Section as M,Stack as i,Text as c,Badge as Z,Grid as q,Spinner as ee}from"@donotdev/components";import{useTranslation as S,formatDate as te}from"@donotdev/core";import{Link as b}from"@donotdev/ui";import{useCrud as ae,useCrudList as L,translateLabel as ne}from"@donotdev/crud";function me({customerEntity:R,inquiryEntity:m,customerBasePath:T="/customers",collapsible:z=!1,defaultOpen:B=!1,open:W,onOpenChange:_,title:y}){const{t:f}=S(`entity-${m.name.toLowerCase()}`),{t:r}=S("crud"),F=y||f("name"),{items:p,loading:O,refresh:se}=L(m,{backend:"functions"}),{items:N}=L(R,{backend:"functions"}),U=D(()=>{const e=new Map;return N?.forEach(n=>{n.id&&e.set(n.id,n)}),e},[N]),{update:I}=ae(m,{backend:"functions"}),E=H(async e=>{await I(e,{status:"available"})},[I]),w=D(()=>p?[...p].filter(e=>(typeof e.status=="string"?e.status:"draft")==="draft").sort((e,n)=>{const a=(typeof e.createdAt=="string"?e.createdAt:typeof e.date=="string"?e.date:"")||"";return((typeof n.createdAt=="string"?n.createdAt:typeof n.date=="string"?n.date:"")||"").localeCompare(a)}):[],[p]);if(O)return t(M,{title:f("name"),children:t(ee,{})});const $=t(Y,{children:w.length===0?t(c,{variant:"muted",children:r("noInquiries",{defaultValue:"No inquiries found."})}):t(q,{cols:[1,1,2,2],children:w.map(e=>{const n=typeof e.customerId=="string"?e.customerId:void 0,a=n?U.get(n):void 0,h=typeof e.status=="string"?e.status:"draft",g=h==="available",d=typeof a?.email=="string"?a.email:void 0,u=typeof a?.phone=="string"?a.phone:void 0,G=a&&(a.firstName||a.lastName)?[a.firstName,a.lastName].filter(Boolean).join(" "):void 0,j=typeof e.message=="string"&&e.message?e.message.length>150?`${e.message.substring(0,150)}...`:e.message:"",x=typeof e.date=="string"?e.date:typeof e.createdAt=="string"?e.createdAt:void 0,A=o(i,{children:[o(i,{direction:"row",gap:"tight",align:"center",justify:"between",children:[t(Z,{variant:g?"secondary":"outline",children:o(i,{direction:"row",gap:"tight",align:"center",children:[g?t(P,{size:12}):t(X,{size:12}),ne(`status.${h}`,f)]})}),x&&t(c,{variant:"muted",level:"small",children:te(x)})]}),a?o(i,{gap:"tight",children:[o(i,{direction:"row",gap:"tight",align:"center",children:[t(Q,{size:14}),t(c,{weight:"medium",level:"small",children:G||r("customer",{defaultValue:"Customer"})})]}),d&&t(c,{level:"small",variant:"muted",children:d}),u&&t(c,{level:"small",variant:"muted",children:u})]}):t(c,{variant:"muted",level:"small",children:r("noCustomer",{defaultValue:"No customer linked"})}),j&&t(c,{level:"small",children:j}),o(i,{gap:"tight",children:[(d||u)&&o(i,{direction:"row",gap:"tight",children:[d&&t(k,{variant:"outline",icon:J,fullWidth:!0,className:"dndev-flex-1",render:({children:s,className:l,...v})=>t(b,{path:`mailto:${d}${typeof e.carId=="string"&&e.carId?`?subject=${encodeURIComponent(r("actions.replySubject",{defaultValue:"Re: Your inquiry"}))}`:""}`,className:l,onClick:C=>C.stopPropagation(),...v,children:s}),children:r("actions.email",{defaultValue:"Email"})}),u&&t(k,{variant:"outline",icon:K,fullWidth:!0,className:"dndev-flex-1",render:({children:s,className:l,...v})=>t(b,{path:`tel:${u}`,className:l,onClick:C=>C.stopPropagation(),...v,children:s}),children:r("actions.call",{defaultValue:"Call"})})]}),!g&&t(k,{variant:"outline",icon:P,fullWidth:!0,onClick:s=>{s.preventDefault(),s.stopPropagation(),E(e.id)},children:r("actions.markResponded",{defaultValue:"Mark responded"})})]})]});return a?.id?t(b,{path:`${T}/${a.id}`,className:"dndev-block dndev-h-full",onClick:s=>{const l=s.target;(l.closest("button")||l.closest('a[href^="mailto:"]')||l.closest('a[href^="tel:"]'))&&(s.preventDefault(),s.stopPropagation())},children:t(V,{clickable:!0,children:A})},e.id):t(V,{children:A},e.id)})})});return z?t(M,{title:F,collapsible:!0,defaultOpen:B,open:W,onOpenChange:_,children:$}):$}export{me as InquiryAdminTemplate};
1
+ "use client";import{jsx as t,jsxs as o,Fragment as Y}from"react/jsx-runtime";import{useMemo as D,useCallback as H}from"react";import{Mail as J,Phone as K,User as Q,CheckCircle2 as P,Clock as X}from"lucide-react";import{Button as k,Card as V,Section as M,Stack as i,Text as d,Badge as Z,Grid as q,Spinner as ee}from"@donotdev/components";import{useTranslation as S,formatDate as te}from"@donotdev/core";import{Link as N}from"@donotdev/ui";import{useCrud as ae,useCrudList as L,translateLabel as ne}from"@donotdev/crud";function ue({customerEntity:R,inquiryEntity:m,customerBasePath:T="/customers",collapsible:z=!1,defaultOpen:B=!1,open:W,onOpenChange:_,title:y}){const{t:f}=S(`entity-${m.name.toLowerCase()}`),{t:r}=S("crud"),F=y||f("name"),{items:p,loading:O}=L(m),{items:b}=L(R),U=D(()=>{const e=new Map;return b?.forEach(n=>{n.id&&e.set(n.id,n)}),e},[b]),{update:I}=ae(m),E=H(async e=>{await I(e,{status:"responded"})},[I]),w=D(()=>p?[...p].filter(e=>(typeof e.status=="string"?e.status:"draft")==="draft").sort((e,n)=>{const a=(typeof e.createdAt=="string"?e.createdAt:typeof e.date=="string"?e.date:"")||"";return((typeof n.createdAt=="string"?n.createdAt:typeof n.date=="string"?n.date:"")||"").localeCompare(a)}):[],[p]);if(O)return t(M,{title:f("name"),children:t(ee,{})});const $=t(Y,{children:w.length===0?t(d,{variant:"muted",children:r("noInquiries",{defaultValue:"No inquiries found."})}):t(q,{cols:[1,1,2,2],children:w.map(e=>{const n=typeof e.customerId=="string"?e.customerId:void 0,a=n?U.get(n):void 0,h=typeof e.status=="string"?e.status:"draft",g=h==="available",c=typeof a?.email=="string"?a.email:void 0,u=typeof a?.phone=="string"?a.phone:void 0,G=a&&(a.firstName||a.lastName)?[a.firstName,a.lastName].filter(Boolean).join(" "):void 0,j=typeof e.message=="string"&&e.message?e.message.length>150?`${e.message.substring(0,150)}...`:e.message:"",x=typeof e.date=="string"?e.date:typeof e.createdAt=="string"?e.createdAt:void 0,A=o(i,{children:[o(i,{direction:"row",gap:"tight",align:"center",justify:"between",children:[t(Z,{variant:g?"secondary":"outline",children:o(i,{direction:"row",gap:"tight",align:"center",children:[g?t(P,{size:12}):t(X,{size:12}),ne(`status.${h}`,f)]})}),x&&t(d,{variant:"muted",level:"small",children:te(x)})]}),a?o(i,{gap:"tight",children:[o(i,{direction:"row",gap:"tight",align:"center",children:[t(Q,{size:14}),t(d,{weight:"medium",level:"small",children:G||r("customer",{defaultValue:"Customer"})})]}),c&&t(d,{level:"small",variant:"muted",children:c}),u&&t(d,{level:"small",variant:"muted",children:u})]}):t(d,{variant:"muted",level:"small",children:r("noCustomer",{defaultValue:"No customer linked"})}),j&&t(d,{level:"small",children:j}),o(i,{gap:"tight",children:[(c||u)&&o(i,{direction:"row",gap:"tight",children:[c&&t(k,{variant:"outline",icon:J,fullWidth:!0,className:"dndev-flex-1",render:({children:s,className:l,...v})=>t(N,{path:`mailto:${c}${typeof e.carId=="string"&&e.carId?`?subject=${encodeURIComponent(r("actions.replySubject",{defaultValue:"Re: Your inquiry"}))}`:""}`,className:l,onClick:C=>C.stopPropagation(),...v,children:s}),children:r("actions.email",{defaultValue:"Email"})}),u&&t(k,{variant:"outline",icon:K,fullWidth:!0,className:"dndev-flex-1",render:({children:s,className:l,...v})=>t(N,{path:`tel:${u}`,className:l,onClick:C=>C.stopPropagation(),...v,children:s}),children:r("actions.call",{defaultValue:"Call"})})]}),!g&&t(k,{variant:"outline",icon:P,fullWidth:!0,onClick:s=>{s.preventDefault(),s.stopPropagation(),E(e.id)},children:r("actions.markResponded",{defaultValue:"Mark responded"})})]})]});return a?.id?t(N,{path:`${T}/${a.id}`,className:"dndev-block dndev-h-full",onClick:s=>{const l=s.target;(l.closest("button")||l.closest('a[href^="mailto:"]')||l.closest('a[href^="tel:"]'))&&(s.preventDefault(),s.stopPropagation())},children:t(V,{clickable:!0,children:A})},e.id):t(V,{children:A},e.id)})})});return z?t(M,{title:F,collapsible:!0,defaultOpen:B,open:W,onOpenChange:_,children:$}):$}export{ue as InquiryAdminTemplate};
@@ -43,5 +43,4 @@ export interface InquiryFormTemplateProps {
43
43
  * ```
44
44
  */
45
45
  export declare function InquiryFormTemplate({ customerEntity, inquiryEntity, contextId, contextName, contextDetails, messagePlaceholder, contextField, customerFields, messageField, consentField, onSuccess, onError, }: InquiryFormTemplateProps): ReactElement;
46
- export default InquiryFormTemplate;
47
46
  //# sourceMappingURL=InquiryFormTemplate.d.ts.map