@pradip1995/segment-login-template 0.5.25 → 0.5.27

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 (38) hide show
  1. package/package.json +2 -2
  2. package/src/account-addresses.tsx +287 -287
  3. package/src/account-guest-orders.tsx +98 -98
  4. package/src/account-orders.tsx +260 -260
  5. package/src/account-overview.tsx +133 -133
  6. package/src/account-payment-methods.tsx +328 -328
  7. package/src/account-profile-logic.ts +282 -282
  8. package/src/account-profile.tsx +111 -111
  9. package/src/account-theme.ts +91 -91
  10. package/src/account-utils.ts +20 -20
  11. package/src/auth-server.ts +442 -442
  12. package/src/commerce-auth-otp-modal.css +125 -125
  13. package/src/commerce-auth-otp-modal.tsx +121 -121
  14. package/src/forgot-password-form.tsx +109 -109
  15. package/src/google-auth-section.tsx +22 -22
  16. package/src/google-sign-in-section.tsx +67 -67
  17. package/src/guest-order-modal.tsx +215 -215
  18. package/src/index.ts +7 -7
  19. package/src/is-next-redirect.ts +60 -60
  20. package/src/login-brand-panel.tsx +6 -5
  21. package/src/login-form.tsx +469 -469
  22. package/src/manifest.ts +11 -11
  23. package/src/order-history-status.test.ts +224 -224
  24. package/src/order-history-status.ts +244 -244
  25. package/src/otp-component.ts +14 -14
  26. package/src/otp-input.tsx +46 -46
  27. package/src/otp-unified-form.tsx +333 -333
  28. package/src/otp-verification-modal.tsx +112 -112
  29. package/src/payment-methods-actions.ts +243 -243
  30. package/src/profile-email-field.tsx +116 -116
  31. package/src/profile-email.test.ts +182 -182
  32. package/src/profile-email.ts +54 -54
  33. package/src/profile-phone-field.tsx +119 -119
  34. package/src/register-form.tsx +339 -339
  35. package/src/reorder-checkout-address.ts +101 -101
  36. package/src/reset-password-form.tsx +103 -103
  37. package/src/reset-password-page.tsx +12 -12
  38. package/src/segment.tsx +272 -272
@@ -1,111 +1,111 @@
1
- "use client"
2
-
3
- import type { HttpTypes } from "@medusajs/types"
4
- import type { OtpVerificationComponent } from "./otp-component"
5
- import OtpVerificationModal from "./otp-verification-modal"
6
- import { useAccountProfileLogic } from "./account-profile-logic"
7
- import ProfilePhoneField from "./profile-phone-field"
8
- import ProfileEmailField from "./profile-email-field"
9
- import { acct } from "./account-theme"
10
-
11
- export default function AccountProfile({
12
- customer,
13
- countryCode,
14
- OtpComponent = OtpVerificationModal,
15
- }: {
16
- customer: HttpTypes.StoreCustomer
17
- countryCode: string
18
- OtpComponent?: OtpVerificationComponent
19
- }) {
20
- const profile = useAccountProfileLogic(customer, countryCode)
21
-
22
- return (
23
- <div className="space-y-8">
24
- <div>
25
- <h2 className={acct.title}>Account details</h2>
26
- <p className={`text-sm ${acct.muted}`}>Update your name and contact information.</p>
27
- </div>
28
-
29
- <form action={profile.formAction} className={`${acct.card} p-6 space-y-4`}>
30
- <Field label="Full name" name="full_name" defaultValue={profile.fullName} />
31
- <ProfileEmailField
32
- email={profile.email}
33
- onEmailChange={profile.handleEmailChange}
34
- emailVerified={profile.emailVerified}
35
- emailError={profile.emailError}
36
- verifyPending={profile.otpPending}
37
- onVerify={() => profile.sendVerifyOtp("email_verification")}
38
- verifyButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
39
- editButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
40
- />
41
-
42
- <ProfilePhoneField
43
- phone={profile.phone}
44
- onPhoneChange={profile.handlePhoneChange}
45
- phoneVerified={profile.phoneVerified}
46
- phoneReady={profile.phoneReady}
47
- phoneError={profile.phoneError}
48
- verifyPending={profile.otpPending}
49
- onVerify={() => profile.sendVerifyOtp("phone_verification")}
50
- verifyButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
51
- editButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
52
- />
53
-
54
- {(profile.state.error || profile.message) && (
55
- <p
56
- className={`text-sm ${profile.state.ok || profile.message ? "text-green-600" : "text-red-600"}`}
57
- >
58
- {profile.message || profile.state.error}
59
- </p>
60
- )}
61
-
62
- <button type="submit" disabled={profile.pending} className={acct.btnPrimary}>
63
- {profile.pending ? "Saving…" : "Save changes"}
64
- </button>
65
- </form>
66
-
67
- <OtpComponent
68
- open={profile.otpOpen}
69
- title={
70
- profile.otpType === "email_verification"
71
- ? "Verify your email"
72
- : "Verify your phone"
73
- }
74
- description={`Enter the code sent to your ${profile.otpType === "email_verification" ? profile.email || "email" : "phone"}.`}
75
- otp={profile.otp}
76
- onOtpChange={profile.setOtp}
77
- error={profile.otpError}
78
- pending={profile.otpPending}
79
- onVerify={profile.verifyOtp}
80
- onResend={() => profile.sendVerifyOtp(profile.otpType)}
81
- onClose={() => profile.setOtpOpen(false)}
82
- />
83
- </div>
84
- )
85
- }
86
-
87
- function Field({
88
- label,
89
- name,
90
- type = "text",
91
- defaultValue,
92
- }: {
93
- label: string
94
- name: string
95
- type?: string
96
- defaultValue?: string
97
- }) {
98
- return (
99
- <label className="block">
100
- <span className="text-xs font-semibold uppercase tracking-wider text-muted mb-1.5 block">
101
- {label}
102
- </span>
103
- <input
104
- name={name}
105
- type={type}
106
- defaultValue={defaultValue}
107
- className="w-full border border-cart-border rounded-none px-3 py-2.5 text-sm bg-surface text-heading focus:outline-none focus:border-brand-accent"
108
- />
109
- </label>
110
- )
111
- }
1
+ "use client"
2
+
3
+ import type { HttpTypes } from "@medusajs/types"
4
+ import type { OtpVerificationComponent } from "./otp-component"
5
+ import OtpVerificationModal from "./otp-verification-modal"
6
+ import { useAccountProfileLogic } from "./account-profile-logic"
7
+ import ProfilePhoneField from "./profile-phone-field"
8
+ import ProfileEmailField from "./profile-email-field"
9
+ import { acct } from "./account-theme"
10
+
11
+ export default function AccountProfile({
12
+ customer,
13
+ countryCode,
14
+ OtpComponent = OtpVerificationModal,
15
+ }: {
16
+ customer: HttpTypes.StoreCustomer
17
+ countryCode: string
18
+ OtpComponent?: OtpVerificationComponent
19
+ }) {
20
+ const profile = useAccountProfileLogic(customer, countryCode)
21
+
22
+ return (
23
+ <div className="space-y-8">
24
+ <div>
25
+ <h2 className={acct.title}>Account details</h2>
26
+ <p className={`text-sm ${acct.muted}`}>Update your name and contact information.</p>
27
+ </div>
28
+
29
+ <form action={profile.formAction} className={`${acct.card} p-6 space-y-4`}>
30
+ <Field label="Full name" name="full_name" defaultValue={profile.fullName} />
31
+ <ProfileEmailField
32
+ email={profile.email}
33
+ onEmailChange={profile.handleEmailChange}
34
+ emailVerified={profile.emailVerified}
35
+ emailError={profile.emailError}
36
+ verifyPending={profile.otpPending}
37
+ onVerify={() => profile.sendVerifyOtp("email_verification")}
38
+ verifyButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
39
+ editButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
40
+ />
41
+
42
+ <ProfilePhoneField
43
+ phone={profile.phone}
44
+ onPhoneChange={profile.handlePhoneChange}
45
+ phoneVerified={profile.phoneVerified}
46
+ phoneReady={profile.phoneReady}
47
+ phoneError={profile.phoneError}
48
+ verifyPending={profile.otpPending}
49
+ onVerify={() => profile.sendVerifyOtp("phone_verification")}
50
+ verifyButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
51
+ editButtonClassName={`${acct.btnOutline} !py-2 !px-3`}
52
+ />
53
+
54
+ {(profile.state.error || profile.message) && (
55
+ <p
56
+ className={`text-sm ${profile.state.ok || profile.message ? "text-green-600" : "text-red-600"}`}
57
+ >
58
+ {profile.message || profile.state.error}
59
+ </p>
60
+ )}
61
+
62
+ <button type="submit" disabled={profile.pending} className={acct.btnPrimary}>
63
+ {profile.pending ? "Saving…" : "Save changes"}
64
+ </button>
65
+ </form>
66
+
67
+ <OtpComponent
68
+ open={profile.otpOpen}
69
+ title={
70
+ profile.otpType === "email_verification"
71
+ ? "Verify your email"
72
+ : "Verify your phone"
73
+ }
74
+ description={`Enter the code sent to your ${profile.otpType === "email_verification" ? profile.email || "email" : "phone"}.`}
75
+ otp={profile.otp}
76
+ onOtpChange={profile.setOtp}
77
+ error={profile.otpError}
78
+ pending={profile.otpPending}
79
+ onVerify={profile.verifyOtp}
80
+ onResend={() => profile.sendVerifyOtp(profile.otpType)}
81
+ onClose={() => profile.setOtpOpen(false)}
82
+ />
83
+ </div>
84
+ )
85
+ }
86
+
87
+ function Field({
88
+ label,
89
+ name,
90
+ type = "text",
91
+ defaultValue,
92
+ }: {
93
+ label: string
94
+ name: string
95
+ type?: string
96
+ defaultValue?: string
97
+ }) {
98
+ return (
99
+ <label className="block">
100
+ <span className="text-xs font-semibold uppercase tracking-wider text-muted mb-1.5 block">
101
+ {label}
102
+ </span>
103
+ <input
104
+ name={name}
105
+ type={type}
106
+ defaultValue={defaultValue}
107
+ className="w-full border border-cart-border rounded-none px-3 py-2.5 text-sm bg-surface text-heading focus:outline-none focus:border-brand-accent"
108
+ />
109
+ </label>
110
+ )
111
+ }
@@ -1,91 +1,91 @@
1
- /** Logged-in account visual tokens — maps to segment-tokens CSS variables */
2
- export const acct = {
3
- pageBg: "bg-page-bg",
4
- card: "bg-surface border border-cart-border rounded-none shadow-card",
5
- cardMuted: "bg-surface-muted border border-cart-border rounded-none",
6
- title:
7
- "font-heading text-2xl sm:text-3xl font-extrabold tracking-tight text-heading",
8
- sectionTitle:
9
- "text-base sm:text-lg font-bold uppercase tracking-wider text-heading",
10
- subsection: "text-sm font-semibold uppercase tracking-wider text-muted",
11
- accent: "text-brand-accent",
12
- muted: "text-muted",
13
- heading: "text-heading",
14
- body: "text-sm text-body",
15
- border: "border-cart-border",
16
- btnPrimary:
17
- "inline-flex items-center justify-center bg-brand-primary hover:bg-brand-accent text-inverse rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest transition-all disabled:opacity-50",
18
- btnAccent:
19
- "inline-flex items-center justify-center bg-brand-accent hover:bg-brand-accent-hover text-inverse rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest transition-all disabled:opacity-50",
20
- btnOutline:
21
- "inline-flex items-center justify-center border border-cart-border text-brand-accent rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest hover:bg-surface-muted transition-all disabled:opacity-50",
22
- input:
23
- "w-full border border-cart-border rounded-none px-3 py-2.5 text-sm bg-surface text-heading focus:outline-none focus:border-brand-accent",
24
- label:
25
- "block text-xs font-semibold uppercase tracking-wider text-muted mb-1.5",
26
- badge:
27
- "inline-flex items-center px-3 py-1 text-xs font-semibold border rounded-none",
28
- } as const
29
-
30
- /** Auth / login visual tokens — maps to segment-tokens CSS variables (theme-safe) */
31
- export const auth = {
32
- viewport:
33
- "w-full flex flex-col lg:flex-row overflow-hidden min-h-[calc(100svh-6.25rem)] lg:h-[calc(100svh-6.25rem)] lg:max-h-[calc(100svh-6.25rem)] bg-page-bg",
34
- formColumn: "relative flex flex-1 flex-col min-h-0 w-full lg:w-1/2 bg-page-bg",
35
- formWash:
36
- "pointer-events-none absolute inset-y-0 -left-20 w-40 bg-gradient-to-r from-transparent to-page-bg hidden lg:block z-[1]",
37
- formGlow:
38
- "pointer-events-none absolute inset-0 bg-gradient-to-l from-brand-primary/[0.03] via-transparent to-transparent hidden lg:block",
39
- formInner:
40
- "relative z-[2] flex flex-1 flex-col justify-center min-h-0 overflow-y-auto overscroll-contain px-5 sm:px-10 md:px-12 lg:px-14 xl:px-20 py-5 sm:py-6 lg:py-8",
41
- formCard:
42
- "relative w-full max-w-[440px] shrink-0 border border-cart-border/60 bg-surface shadow-[0_10px_40px_-16px_rgba(0,0,0,0.12)] p-7 sm:p-8",
43
- desktopHeader: "hidden lg:block mb-6 max-w-[440px] shrink-0",
44
- title:
45
- "font-heading text-2xl xl:text-[32px] font-bold text-heading uppercase tracking-[0.08em] leading-tight",
46
- subtitle: "mt-2 text-[11px] font-medium text-muted uppercase tracking-[0.28em]",
47
- mobileTitle:
48
- "font-heading text-base font-bold text-heading uppercase tracking-[0.16em] lg:hidden",
49
- fieldLabel:
50
- "text-[10px] font-semibold text-heading/80 uppercase tracking-[0.22em]",
51
- input:
52
- "w-full px-0 py-3 text-sm text-heading bg-transparent border-0 border-b-2 border-cart-border rounded-none placeholder:text-muted/50 focus:outline-none focus:border-brand-primary focus:ring-0 transition-colors duration-200",
53
- btnPrimary:
54
- "group relative w-full inline-flex items-center justify-center py-3.5 bg-brand-primary text-inverse text-[11px] font-bold uppercase tracking-[0.28em] shadow-[0_8px_28px_-6px_rgba(0,0,0,0.25)] hover:bg-brand-accent hover:shadow-[0_12px_32px_-6px_rgba(0,0,0,0.3)] transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed overflow-hidden active:scale-[0.98]",
55
- btnShine:
56
- "before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/15 before:to-transparent before:-translate-x-full hover:before:translate-x-full before:transition-transform before:duration-700",
57
- btnOutline:
58
- "w-full flex items-center justify-center gap-2.5 py-3 border border-brand-primary/15 bg-surface/80 hover:bg-page-bg hover:border-brand-primary/35 shadow-sm transition-all duration-200 disabled:opacity-50",
59
- guestCta:
60
- "w-full py-3 border border-brand-primary/20 bg-gradient-to-r from-surface to-page-bg text-heading text-[10px] font-bold uppercase tracking-[0.18em] hover:border-brand-accent hover:shadow-[0_4px_16px_-4px_rgba(0,0,0,0.15)] transition-all duration-300 flex items-center justify-center gap-2 disabled:opacity-50 active:scale-[0.98]",
61
- tabActive:
62
- "pb-3 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] border-b-2 -mb-px border-brand-accent text-brand-accent transition-colors duration-200",
63
- tabIdle:
64
- "pb-3 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] border-b-2 -mb-px border-transparent text-muted hover:text-heading transition-colors duration-200",
65
- modeActive:
66
- "flex-1 py-2 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] rounded-md bg-surface text-heading shadow-sm transition-colors duration-200",
67
- modeIdle:
68
- "flex-1 py-2 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] rounded-md text-muted hover:text-heading transition-colors duration-200",
69
- chipActive:
70
- "px-3 py-1.5 text-xs font-medium border border-brand-accent text-brand-accent bg-brand-accent/5 transition-colors duration-200",
71
- chipIdle:
72
- "px-3 py-1.5 text-xs font-medium border border-cart-border text-muted hover:text-heading transition-colors duration-200",
73
- } as const
74
-
75
- export type BrandFeatureCard = {
76
- imageSrc?: string | null
77
- title: string
78
- text: string
79
- }
80
-
81
- export type BrandPanelConfig = {
82
- image?: string | null
83
- logo?: string | null
84
- eyebrow?: string | null
85
- headline?: string | null
86
- /** Sahsha alias for headline */
87
- title?: string | null
88
- description?: string | null
89
- featuresLabel?: string | null
90
- featureCards?: BrandFeatureCard[] | null
91
- }
1
+ /** Logged-in account visual tokens — maps to segment-tokens CSS variables */
2
+ export const acct = {
3
+ pageBg: "bg-page-bg",
4
+ card: "bg-surface border border-cart-border rounded-none shadow-card",
5
+ cardMuted: "bg-surface-muted border border-cart-border rounded-none",
6
+ title:
7
+ "font-heading text-2xl sm:text-3xl font-extrabold tracking-tight text-heading",
8
+ sectionTitle:
9
+ "text-base sm:text-lg font-bold uppercase tracking-wider text-heading",
10
+ subsection: "text-sm font-semibold uppercase tracking-wider text-muted",
11
+ accent: "text-brand-accent",
12
+ muted: "text-muted",
13
+ heading: "text-heading",
14
+ body: "text-sm text-body",
15
+ border: "border-cart-border",
16
+ btnPrimary:
17
+ "inline-flex items-center justify-center bg-brand-primary hover:bg-brand-accent text-inverse rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest transition-all disabled:opacity-50",
18
+ btnAccent:
19
+ "inline-flex items-center justify-center bg-brand-accent hover:bg-brand-accent-hover text-inverse rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest transition-all disabled:opacity-50",
20
+ btnOutline:
21
+ "inline-flex items-center justify-center border border-cart-border text-brand-accent rounded-none px-6 py-3 font-bold text-xs uppercase tracking-widest hover:bg-surface-muted transition-all disabled:opacity-50",
22
+ input:
23
+ "w-full border border-cart-border rounded-none px-3 py-2.5 text-sm bg-surface text-heading focus:outline-none focus:border-brand-accent",
24
+ label:
25
+ "block text-xs font-semibold uppercase tracking-wider text-muted mb-1.5",
26
+ badge:
27
+ "inline-flex items-center px-3 py-1 text-xs font-semibold border rounded-none",
28
+ } as const
29
+
30
+ /** Auth / login visual tokens — maps to segment-tokens CSS variables (theme-safe) */
31
+ export const auth = {
32
+ viewport:
33
+ "w-full flex flex-col lg:flex-row overflow-hidden min-h-[calc(100svh-6.25rem)] lg:h-[calc(100svh-6.25rem)] lg:max-h-[calc(100svh-6.25rem)] bg-page-bg",
34
+ formColumn: "relative flex flex-1 flex-col min-h-0 w-full lg:w-1/2 bg-page-bg",
35
+ formWash:
36
+ "pointer-events-none absolute inset-y-0 -left-20 w-40 bg-gradient-to-r from-transparent to-page-bg hidden lg:block z-[1]",
37
+ formGlow:
38
+ "pointer-events-none absolute inset-0 bg-gradient-to-l from-brand-primary/[0.03] via-transparent to-transparent hidden lg:block",
39
+ formInner:
40
+ "relative z-[2] flex flex-1 flex-col justify-center min-h-0 overflow-y-auto overscroll-contain px-5 sm:px-10 md:px-12 lg:px-14 xl:px-20 py-5 sm:py-6 lg:py-8",
41
+ formCard:
42
+ "relative w-full max-w-[440px] shrink-0 border border-cart-border/60 bg-surface shadow-[0_10px_40px_-16px_rgba(0,0,0,0.12)] p-7 sm:p-8",
43
+ desktopHeader: "hidden lg:block mb-6 max-w-[440px] shrink-0",
44
+ title:
45
+ "font-heading text-2xl xl:text-[32px] font-bold text-heading uppercase tracking-[0.08em] leading-tight",
46
+ subtitle: "mt-2 text-[11px] font-medium text-muted uppercase tracking-[0.28em]",
47
+ mobileTitle:
48
+ "font-heading text-base font-bold text-heading uppercase tracking-[0.16em] lg:hidden",
49
+ fieldLabel:
50
+ "text-[10px] font-semibold text-heading/80 uppercase tracking-[0.22em]",
51
+ input:
52
+ "w-full px-0 py-3 text-sm text-heading bg-transparent border-0 border-b-2 border-cart-border rounded-none placeholder:text-muted/50 focus:outline-none focus:border-brand-primary focus:ring-0 transition-colors duration-200",
53
+ btnPrimary:
54
+ "group relative w-full inline-flex items-center justify-center py-3.5 bg-brand-primary text-inverse text-[11px] font-bold uppercase tracking-[0.28em] shadow-[0_8px_28px_-6px_rgba(0,0,0,0.25)] hover:bg-brand-accent hover:shadow-[0_12px_32px_-6px_rgba(0,0,0,0.3)] transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed overflow-hidden active:scale-[0.98]",
55
+ btnShine:
56
+ "before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/15 before:to-transparent before:-translate-x-full hover:before:translate-x-full before:transition-transform before:duration-700",
57
+ btnOutline:
58
+ "w-full flex items-center justify-center gap-2.5 py-3 border border-brand-primary/15 bg-surface/80 hover:bg-page-bg hover:border-brand-primary/35 shadow-sm transition-all duration-200 disabled:opacity-50",
59
+ guestCta:
60
+ "w-full py-3 border border-brand-primary/20 bg-gradient-to-r from-surface to-page-bg text-heading text-[10px] font-bold uppercase tracking-[0.18em] hover:border-brand-accent hover:shadow-[0_4px_16px_-4px_rgba(0,0,0,0.15)] transition-all duration-300 flex items-center justify-center gap-2 disabled:opacity-50 active:scale-[0.98]",
61
+ tabActive:
62
+ "pb-3 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] border-b-2 -mb-px border-brand-accent text-brand-accent transition-colors duration-200",
63
+ tabIdle:
64
+ "pb-3 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] border-b-2 -mb-px border-transparent text-muted hover:text-heading transition-colors duration-200",
65
+ modeActive:
66
+ "flex-1 py-2 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] rounded-md bg-surface text-heading shadow-sm transition-colors duration-200",
67
+ modeIdle:
68
+ "flex-1 py-2 text-xs font-semibold uppercase tracking-[var(--letter-spacing-nav)] rounded-md text-muted hover:text-heading transition-colors duration-200",
69
+ chipActive:
70
+ "px-3 py-1.5 text-xs font-medium border border-brand-accent text-brand-accent bg-brand-accent/5 transition-colors duration-200",
71
+ chipIdle:
72
+ "px-3 py-1.5 text-xs font-medium border border-cart-border text-muted hover:text-heading transition-colors duration-200",
73
+ } as const
74
+
75
+ export type BrandFeatureCard = {
76
+ imageSrc?: string | null
77
+ title: string
78
+ text: string
79
+ }
80
+
81
+ export type BrandPanelConfig = {
82
+ image?: string | null
83
+ logo?: string | null
84
+ eyebrow?: string | null
85
+ headline?: string | null
86
+ /** Sahsha alias for headline */
87
+ title?: string | null
88
+ description?: string | null
89
+ featuresLabel?: string | null
90
+ featureCards?: BrandFeatureCard[] | null
91
+ }
@@ -1,20 +1,20 @@
1
- import type { HttpTypes } from "@medusajs/types"
2
-
3
- export function getProfileCompletion(customer: HttpTypes.StoreCustomer): number {
4
- let score = 0
5
- if (customer.first_name?.trim()) score += 25
6
- if (customer.last_name?.trim()) score += 25
7
- if (customer.email?.trim()) score += 25
8
- if (customer.phone?.trim()) score += 25
9
- return score
10
- }
11
-
12
- export function customerDisplayName(customer: HttpTypes.StoreCustomer): string {
13
- return [customer.first_name, customer.last_name].filter(Boolean).join(" ") || customer.email || "Account"
14
- }
15
-
16
- export function accountSectionPath(path?: string): string {
17
- if (!path || path === "login") return "overview"
18
- const base = path.split("/")[0]
19
- return base || "overview"
20
- }
1
+ import type { HttpTypes } from "@medusajs/types"
2
+
3
+ export function getProfileCompletion(customer: HttpTypes.StoreCustomer): number {
4
+ let score = 0
5
+ if (customer.first_name?.trim()) score += 25
6
+ if (customer.last_name?.trim()) score += 25
7
+ if (customer.email?.trim()) score += 25
8
+ if (customer.phone?.trim()) score += 25
9
+ return score
10
+ }
11
+
12
+ export function customerDisplayName(customer: HttpTypes.StoreCustomer): string {
13
+ return [customer.first_name, customer.last_name].filter(Boolean).join(" ") || customer.email || "Account"
14
+ }
15
+
16
+ export function accountSectionPath(path?: string): string {
17
+ if (!path || path === "login") return "overview"
18
+ const base = path.split("/")[0]
19
+ return base || "overview"
20
+ }