@slyxup/ui 2.5.3 → 2.5.4

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.
package/README.md CHANGED
@@ -184,9 +184,20 @@ import {
184
184
  <CurrentPlanCard
185
185
  subscription={subscription} // null = free tier empty state
186
186
  onCancel={cancelSubscription}
187
+ onResume={resumeSubscription} // shown when cancellation is scheduled
187
188
  theme={{ accent: 'emerald' }}
188
189
  />
189
190
 
191
+ // subscription display fields (status required, rest optional):
192
+ // { planName?, status, currentPeriodEnd, currentPeriodStart?,
193
+ // cancelAtPeriodEnd, amount? (cents), currency?, interval?,
194
+ // paymentMethod? ("Visa •••• 4242") }
195
+ // → price line, days-left progress, renew/billed meta, trial note,
196
+ // scheduled-cancellation warning + Resume render automatically.
197
+
198
+ // Invoices with paid total + status pills:
199
+ <InvoicesTable invoices={invoices} showTotal /> // null when empty
200
+
190
201
  // Fully custom pricing section:
191
202
  {plans.map((p) => (
192
203
  <PlanCard
@@ -4,11 +4,25 @@ export interface CurrentPlanSubscription {
4
4
  planName?: string | null;
5
5
  status: string;
6
6
  currentPeriodEnd: string | null;
7
+ /** Period start — enables the "days left" progress bar. */
8
+ currentPeriodStart?: string | null;
7
9
  cancelAtPeriodEnd: boolean;
10
+ /** Minor units (cents). Shows the price line when present. */
11
+ amount?: number | null;
12
+ currency?: string | null;
13
+ interval?: 'month' | 'year' | string | null;
14
+ /** Rendered under the price, e.g. "Visa •••• 4242". */
15
+ paymentMethod?: string | null;
8
16
  }
9
17
  export interface CurrentPlanCardLabels {
10
18
  title?: string;
11
19
  cancel?: string;
20
+ resume?: string;
21
+ renews?: string;
22
+ billed?: string;
23
+ daysLeft?: string;
24
+ cancelTitle?: string;
25
+ cancelText?: string;
12
26
  emptyTitle?: string;
13
27
  emptyText?: string;
14
28
  }
@@ -16,6 +30,7 @@ export interface CurrentPlanCardProps {
16
30
  /** Null = free tier / no subscription (renders the empty state). */
17
31
  subscription: CurrentPlanSubscription | null;
18
32
  onCancel?: () => void;
33
+ onResume?: () => void;
19
34
  labels?: CurrentPlanCardLabels;
20
35
  /** Per-component theme (accent, mode, radius…) — scoped, never global. */
21
36
  theme?: SlyxUpTheme;
@@ -23,8 +38,9 @@ export interface CurrentPlanCardProps {
23
38
  className?: string;
24
39
  }
25
40
  /**
26
- * Standalone "your plan" card — drop it anywhere without mounting a full
27
- * profile/portal. Shows status, renewal date and cancel action.
41
+ * Rich "your plan" card — price, status, period progress, renewal meta,
42
+ * cancel/resume actions and a scheduled-cancellation warning. Drop it
43
+ * anywhere without mounting a full profile/portal.
28
44
  */
29
- export declare function CurrentPlanCard({ subscription, onCancel, labels, theme, style, className, }: CurrentPlanCardProps): import("react").JSX.Element;
45
+ export declare function CurrentPlanCard({ subscription, onCancel, onResume, labels, theme, style, className, }: CurrentPlanCardProps): import("react").JSX.Element;
30
46
  //# sourceMappingURL=CurrentPlanCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentPlanCard.d.ts","sourceRoot":"","sources":["../../../src/components/CurrentPlanCard/CurrentPlanCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,YAAY,EAAE,uBAAu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MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,oBAAoB,+BAyQtB"}
@@ -3,36 +3,142 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useScopedTheme } from '../../lib/scoped-theme';
4
4
  import { injectStyles } from '../../styles';
5
5
  import { SubscriptionStatus } from '../SubscriptionStatus/SubscriptionStatus';
6
+ const DAY_MS = 86_400_000;
7
+ function daysLeft(endIso) {
8
+ if (!endIso)
9
+ return null;
10
+ const ms = new Date(endIso).getTime() - Date.now();
11
+ if (Number.isNaN(ms))
12
+ return null;
13
+ return Math.max(0, Math.ceil(ms / DAY_MS));
14
+ }
15
+ function periodProgress(startIso, endIso) {
16
+ if (!startIso || !endIso)
17
+ return null;
18
+ const start = new Date(startIso).getTime();
19
+ const end = new Date(endIso).getTime();
20
+ if (Number.isNaN(start) || Number.isNaN(end) || end <= start)
21
+ return null;
22
+ const pct = ((Date.now() - start) / (end - start)) * 100;
23
+ return Math.min(100, Math.max(0, Math.round(pct)));
24
+ }
25
+ function formatDate(iso) {
26
+ const d = new Date(iso);
27
+ return Number.isNaN(d.getTime())
28
+ ? iso
29
+ : d.toLocaleDateString(undefined, {
30
+ month: 'short',
31
+ day: 'numeric',
32
+ year: 'numeric',
33
+ });
34
+ }
6
35
  /**
7
- * Standalone "your plan" card — drop it anywhere without mounting a full
8
- * profile/portal. Shows status, renewal date and cancel action.
36
+ * Rich "your plan" card — price, status, period progress, renewal meta,
37
+ * cancel/resume actions and a scheduled-cancellation warning. Drop it
38
+ * anywhere without mounting a full profile/portal.
9
39
  */
10
- export function CurrentPlanCard({ subscription, onCancel, labels, theme, style, className, }) {
40
+ export function CurrentPlanCard({ subscription, onCancel, onResume, labels, theme, style, className, }) {
11
41
  injectStyles();
12
42
  const ref = useScopedTheme(theme);
13
43
  if (!subscription) {
14
44
  return (_jsxs("div", { ref: ref, className: `slx-card ${className ?? ''}`, style: style, children: [_jsx("h3", { style: { fontSize: 16, fontWeight: 600 }, children: labels?.emptyTitle ?? 'No active subscription' }), _jsx("p", { style: { fontSize: 13.5, color: 'var(--slx-muted)', marginTop: 6 }, children: labels?.emptyText ??
15
45
  "You don't have a subscription yet. Choose a plan to get started." })] }));
16
46
  }
17
- return (_jsx("div", { ref: ref, className: `slx-card ${className ?? ''}`, style: style, children: _jsxs("div", { style: {
18
- display: 'flex',
19
- justifyContent: 'space-between',
20
- alignItems: 'center',
21
- }, children: [_jsxs("div", { children: [_jsxs("h3", { style: { fontSize: 15, fontWeight: 600 }, children: [labels?.title ?? 'Current plan', subscription.planName ? ` — ${subscription.planName}` : ''] }), _jsxs("p", { style: { fontSize: 13, color: 'var(--slx-muted)', marginTop: 4 }, children: ["Status: ", _jsx(SubscriptionStatus, { status: subscription.status })] }), subscription.currentPeriodEnd && (_jsxs("p", { style: {
22
- fontSize: 12.5,
23
- color: 'var(--slx-muted)',
24
- marginTop: 4,
25
- }, children: ["Renews", ' ', new Date(subscription.currentPeriodEnd).toLocaleDateString(), subscription.cancelAtPeriodEnd ? ' (cancels at period end)' : ''] }))] }), subscription.status !== 'canceled' &&
26
- !subscription.cancelAtPeriodEnd &&
27
- onCancel && (_jsx("button", { type: "button", onClick: onCancel, style: {
28
- fontSize: 13,
29
- fontWeight: 550,
30
- background: 'transparent',
31
- border: '1px solid var(--slx-border)',
32
- borderRadius: 'var(--slx-radius)',
33
- padding: '8px 14px',
34
- cursor: 'pointer',
35
- color: 'var(--slx-danger)',
36
- }, children: labels?.cancel ?? 'Cancel' }))] }) }));
47
+ const left = daysLeft(subscription.currentPeriodEnd);
48
+ const progress = periodProgress(subscription.currentPeriodStart, subscription.currentPeriodEnd);
49
+ const showPrice = typeof subscription.amount === 'number' && subscription.amount >= 0;
50
+ const scheduled = subscription.cancelAtPeriodEnd;
51
+ const trialing = subscription.status === 'trialing';
52
+ return (_jsxs("div", { ref: ref, className: `slx-card ${className ?? ''}`, style: style, children: [_jsxs("div", { style: {
53
+ display: 'flex',
54
+ justifyContent: 'space-between',
55
+ alignItems: 'flex-start',
56
+ gap: 12,
57
+ }, children: [_jsxs("div", { children: [_jsx("p", { style: {
58
+ fontSize: 11.5,
59
+ fontWeight: 700,
60
+ letterSpacing: '.08em',
61
+ textTransform: 'uppercase',
62
+ color: 'var(--slx-muted)',
63
+ margin: '0 0 4px',
64
+ }, children: labels?.title ?? 'Current plan' }), _jsx("h3", { style: {
65
+ fontSize: 22,
66
+ fontWeight: 750,
67
+ letterSpacing: '-0.02em',
68
+ fontFamily: 'var(--slx-display)',
69
+ margin: 0,
70
+ }, children: subscription.planName ?? 'Subscription' })] }), _jsx(SubscriptionStatus, { status: subscription.status })] }), showPrice && (_jsxs("div", { style: { marginTop: 10 }, children: [_jsxs("span", { className: "slx-price", style: { fontSize: 30 }, children: ["$", (subscription.amount / 100).toFixed(subscription.amount % 100 === 0 ? 0 : 2)] }), ' ', _jsxs("span", { style: { fontSize: 13, color: 'var(--slx-muted)' }, children: [subscription.currency ?? '', "/", subscription.interval === 'year' ? 'year' : 'month'] }), subscription.paymentMethod && (_jsx("p", { style: {
71
+ fontSize: 12.5,
72
+ color: 'var(--slx-muted)',
73
+ margin: '4px 0 0',
74
+ }, children: subscription.paymentMethod }))] })), progress !== null && left !== null && (_jsxs("div", { style: { marginTop: 16 }, children: [_jsx("div", { style: {
75
+ height: 6,
76
+ borderRadius: 999,
77
+ background: 'color-mix(in srgb, var(--slx-ink) 8%, transparent)',
78
+ overflow: 'hidden',
79
+ }, children: _jsx("div", { style: {
80
+ height: '100%',
81
+ width: `${progress}%`,
82
+ borderRadius: 999,
83
+ background: 'linear-gradient(90deg, var(--slx-accent), var(--slx-accent-2))',
84
+ transition: 'width .4s ease',
85
+ } }) }), _jsx("p", { style: {
86
+ fontSize: 12,
87
+ color: 'var(--slx-muted)',
88
+ margin: '6px 0 0',
89
+ }, children: left === 0
90
+ ? 'Renews today'
91
+ : `${left} day${left === 1 ? '' : 's'} left in this period` })] })), _jsxs("div", { style: {
92
+ display: 'flex',
93
+ flexWrap: 'wrap',
94
+ gap: '8px 24px',
95
+ marginTop: 16,
96
+ paddingTop: 14,
97
+ borderTop: '1px solid var(--slx-border)',
98
+ }, children: [subscription.currentPeriodEnd && (_jsxs("div", { children: [_jsx("p", { style: {
99
+ fontSize: 11,
100
+ fontWeight: 600,
101
+ textTransform: 'uppercase',
102
+ letterSpacing: '.06em',
103
+ color: 'var(--slx-muted)',
104
+ margin: '0 0 2px',
105
+ }, children: scheduled ? 'Ends' : (labels?.renews ?? 'Renews') }), _jsx("p", { style: { fontSize: 13.5, fontWeight: 600, margin: 0 }, children: formatDate(subscription.currentPeriodEnd) })] })), subscription.interval && (_jsxs("div", { children: [_jsx("p", { style: {
106
+ fontSize: 11,
107
+ fontWeight: 600,
108
+ textTransform: 'uppercase',
109
+ letterSpacing: '.06em',
110
+ color: 'var(--slx-muted)',
111
+ margin: '0 0 2px',
112
+ }, children: labels?.billed ?? 'Billed' }), _jsx("p", { style: {
113
+ fontSize: 13.5,
114
+ fontWeight: 600,
115
+ margin: 0,
116
+ textTransform: 'capitalize',
117
+ }, children: subscription.interval === 'year' ? 'Yearly' : 'Monthly' })] })), trialing && (_jsxs("div", { children: [_jsx("p", { style: {
118
+ fontSize: 11,
119
+ fontWeight: 600,
120
+ textTransform: 'uppercase',
121
+ letterSpacing: '.06em',
122
+ color: 'var(--slx-muted)',
123
+ margin: '0 0 2px',
124
+ }, children: "Trial" }), _jsx("p", { style: { fontSize: 13.5, fontWeight: 600, margin: 0 }, children: "Convert to paid on renewal" })] }))] }), scheduled && (_jsxs("div", { style: {
125
+ marginTop: 14,
126
+ borderRadius: 'var(--slx-radius)',
127
+ border: '1px solid color-mix(in srgb, var(--slx-danger) 30%, transparent)',
128
+ background: 'color-mix(in srgb, var(--slx-danger) 7%, transparent)',
129
+ padding: '10px 12px',
130
+ fontSize: 12.5,
131
+ lineHeight: 1.5,
132
+ }, children: [_jsx("strong", { children: labels?.cancelTitle ?? 'Cancellation scheduled' }), _jsx("br", {}), _jsx("span", { style: { color: 'var(--slx-muted)' }, children: labels?.cancelText ??
133
+ 'You keep access until the end date above, then move to the free tier.' })] })), (onResume && scheduled) || (onCancel && !scheduled) ? (_jsxs("div", { style: { display: 'flex', gap: 8, marginTop: 14 }, children: [onResume && scheduled && (_jsx("button", { type: "button", onClick: onResume, className: "slx-btn", style: { width: 'auto', flex: 1 }, children: labels?.resume ?? 'Resume plan' })), onCancel && !scheduled && (_jsx("button", { type: "button", onClick: onCancel, style: {
134
+ fontSize: 13,
135
+ fontWeight: 550,
136
+ background: 'transparent',
137
+ border: '1px solid var(--slx-border)',
138
+ borderRadius: 'var(--slx-radius)',
139
+ padding: '8px 14px',
140
+ cursor: 'pointer',
141
+ color: 'var(--slx-danger)',
142
+ }, children: labels?.cancel ?? 'Cancel' }))] })) : null] }));
37
143
  }
38
144
  //# sourceMappingURL=CurrentPlanCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentPlanCard.js","sourceRoot":"","sources":["../../../src/components/CurrentPlanCard/CurrentPlanCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AA2B9E;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACY;IACrB,YAAY,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,cAAc,CAAiB,KAAK,CAAC,CAAC;IAElD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,CACL,eAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,SAAS,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,aACnE,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YACzC,MAAM,EAAE,UAAU,IAAI,wBAAwB,GAC5C,EACL,YAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC,EAAE,YAClE,MAAM,EAAE,SAAS;wBAChB,kEAAkE,GAClE,IACA,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,SAAS,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,YACnE,eACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,cAAc,EAAE,eAAe;gBAC/B,UAAU,EAAE,QAAQ;aACrB,aAED,0BACE,cAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,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EAAE,mBAAmB;4BACjC,OAAO,EAAE,UAAU;4BACnB,MAAM,EAAE,SAAS;4BACjB,KAAK,EAAE,mBAAmB;yBAC3B,YAEA,MAAM,EAAE,MAAM,IAAI,QAAQ,GACpB,CACV,IACG,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -10,11 +10,13 @@ export interface InvoiceRow {
10
10
  export interface InvoicesTableProps {
11
11
  invoices: InvoiceRow[];
12
12
  title?: string;
13
+ /** Show a "Total paid" footer row. Default true. */
14
+ showTotal?: boolean;
13
15
  /** Per-component theme (accent, mode, radius…) — scoped, never global. */
14
16
  theme?: SlyxUpTheme;
15
17
  style?: CSSProperties;
16
18
  className?: string;
17
19
  }
18
- /** Invoice history table. Renders nothing when there are no invoices. */
19
- export declare function InvoicesTable({ invoices, title, theme, style, className, }: InvoicesTableProps): import("react").JSX.Element | null;
20
+ /** Invoice history table with status pills + paid total. Renders nothing when empty. */
21
+ export declare function InvoicesTable({ invoices, title, showTotal, theme, style, className, }: InvoicesTableProps): import("react").JSX.Element | null;
20
22
  //# sourceMappingURL=InvoicesTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InvoicesTable.d.ts","sourceRoot":"","sources":["../../../src/components/InvoicesTable/InvoicesTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACpD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAkB,EAClB,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,kBAAkB,sCAqEpB"}
1
+ {"version":3,"file":"InvoicesTable.d.ts","sourceRoot":"","sources":["../../../src/components/InvoicesTable/InvoicesTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACpD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAkB,EAClB,SAAgB,EAChB,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,kBAAkB,sCAiFpB"}
@@ -2,32 +2,34 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useScopedTheme } from '../../lib/scoped-theme';
4
4
  import { injectStyles } from '../../styles';
5
- /** Invoice history table. Renders nothing when there are no invoices. */
6
- export function InvoicesTable({ invoices, title = 'Invoices', theme, style, className, }) {
5
+ import { SubscriptionStatus } from '../SubscriptionStatus/SubscriptionStatus';
6
+ /** Invoice history table with status pills + paid total. Renders nothing when empty. */
7
+ export function InvoicesTable({ invoices, title = 'Invoices', showTotal = true, theme, style, className, }) {
7
8
  injectStyles();
8
9
  const ref = useScopedTheme(theme);
9
10
  if (invoices.length === 0)
10
11
  return null;
12
+ const paidTotal = invoices
13
+ .filter((inv) => inv.status === 'paid')
14
+ .reduce((sum, inv) => sum + inv.amount, 0);
15
+ const currency = invoices[0]?.currency ?? 'USD';
11
16
  return (_jsxs("div", { ref: ref, className: `slx-card ${className ?? ''}`, style: style, children: [_jsx("h3", { style: { fontSize: 15, fontWeight: 600, marginBottom: 12 }, children: title }), _jsxs("table", { style: { width: '100%', fontSize: 13, borderCollapse: 'collapse' }, children: [_jsx("thead", { children: _jsxs("tr", { style: {
12
17
  borderBottom: '1px solid var(--slx-border)',
13
18
  textAlign: 'left',
14
19
  }, children: [_jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Date" }), _jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Amount" }), _jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Status" })] }) }), _jsx("tbody", { children: invoices.map((inv) => (_jsxs("tr", { className: "slx-row-hover", style: { borderBottom: '1px solid var(--slx-border)' }, children: [_jsx("td", { style: { padding: '8px 0' }, children: inv.billedAt
15
20
  ? new Date(inv.billedAt).toLocaleDateString()
16
- : '—' }), _jsxs("td", { style: { padding: '8px 0' }, children: ["$", (inv.amount / 100).toFixed(2), " ", inv.currency] }), _jsx("td", { style: { padding: '8px 0' }, children: _jsx("span", { style: {
17
- fontSize: 11.5,
18
- fontWeight: 600,
19
- padding: '2px 8px',
20
- borderRadius: 999,
21
- background: inv.status === 'paid'
22
- ? 'rgba(52,211,153,.1)'
23
- : inv.status === 'overdue'
24
- ? 'rgba(214,69,80,.1)'
25
- : 'rgba(108,108,232,.08)',
26
- color: inv.status === 'paid'
27
- ? '#34d399'
28
- : inv.status === 'overdue'
29
- ? 'var(--slx-danger)'
30
- : 'var(--slx-accent)',
31
- }, children: inv.status }) })] }, inv.id))) })] })] }));
21
+ : '—' }), _jsxs("td", { style: { padding: '8px 0' }, children: ["$", (inv.amount / 100).toFixed(2), " ", inv.currency] }), _jsx("td", { style: { padding: '8px 0' }, children: _jsx(SubscriptionStatus, { status: inv.status }) })] }, inv.id))) }), showTotal && paidTotal > 0 && (_jsx("tfoot", { children: _jsxs("tr", { children: [_jsx("td", { colSpan: 2, style: {
22
+ padding: '10px 0 2px',
23
+ fontSize: 12,
24
+ fontWeight: 600,
25
+ textTransform: 'uppercase',
26
+ letterSpacing: '.06em',
27
+ color: 'var(--slx-muted)',
28
+ }, children: "Total paid" }), _jsxs("td", { style: {
29
+ padding: '10px 0 2px',
30
+ fontSize: 14,
31
+ fontWeight: 750,
32
+ fontFamily: 'var(--slx-display)',
33
+ }, children: ["$", (paidTotal / 100).toFixed(2), " ", currency] })] }) }))] })] }));
32
34
  }
33
35
  //# sourceMappingURL=InvoicesTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InvoicesTable.js","sourceRoot":"","sources":["../../../src/components/InvoicesTable/InvoicesTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAoB5C,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,GAAG,UAAU,EAClB,KAAK,EACL,KAAK,EACL,SAAS,GACU;IACnB,YAAY,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,cAAc,CAAiB,KAAK,CAAC,CAAC;IAClD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAA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ACL,aAAI,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,YAC7B,eACE,KAAK,EAAE;4CACL,QAAQ,EAAE,IAAI;4CACd,UAAU,EAAE,GAAG;4CACf,OAAO,EAAE,SAAS;4CAClB,YAAY,EAAE,GAAG;4CACjB,UAAU,EACR,GAAG,CAAC,MAAM,KAAK,MAAM;gDACnB,CAAC,CAAC,qBAAqB;gDACvB,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS;oDACxB,CAAC,CAAC,oBAAoB;oDACtB,CAAC,CAAC,uBAAuB;4CAC/B,KAAK,EACH,GAAG,CAAC,MAAM,KAAK,MAAM;gDACnB,CAAC,CAAC,SAAS;gDACX,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS;oDACxB,CAAC,CAAC,mBAAmB;oDACrB,CAAC,CAAC,mBAAmB;yCAC5B,YAEA,GAAG,CAAC,MAAM,GACN,GACJ,KAnCA,GAAG,CAAC,EAAE,CAoCR,CACN,CAAC,GACI,IACF,IACJ,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"InvoicesTable.js","sourceRoot":"","sources":["../../../src/components/InvoicesTable/InvoicesTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAqB9E,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,GAAG,UAAU,EAClB,SAAS,GAAG,IAAI,EAChB,KAAK,EACL,KAAK,EACL,SAAS,GACU;IACnB,YAAY,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,cAAc,CAAiB,KAAK,CAAC,CAAC;IAClD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,SAA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,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,kBAAkB,EAAE;wCAC7C,CAAC,CAAC,GAAG,GACJ,EACL,cAAI,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,kBAC3B,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAG,GAAG,CAAC,QAAQ,IAC3C,EACL,aAAI,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,YAC7B,KAAC,kBAAkB,IAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAI,GACvC,KAdA,GAAG,CAAC,EAAE,CAeR,CACN,CAAC,GACI,EACP,SAAS,IAAI,SAAS,GAAG,CAAC,IAAI,CAC7B,0BACE,yBACE,aACE,OAAO,EAAE,CAAC,EACV,KAAK,EAAE;wCACL,OAAO,EAAE,YAAY;wCACrB,QAAQ,EAAE,EAAE;wCACZ,UAAU,EAAE,GAAG;wCACf,aAAa,EAAE,WAAW;wCAC1B,aAAa,EAAE,OAAO;wCACtB,KAAK,EAAE,kBAAkB;qCAC1B,2BAGE,EACL,cACE,KAAK,EAAE;wCACL,OAAO,EAAE,YAAY;wCACrB,QAAQ,EAAE,EAAE;wCACZ,UAAU,EAAE,GAAG;wCACf,UAAU,EAAE,oBAAoB;qCACjC,kBAEC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAG,QAAQ,IACtC,IACF,GACC,CACT,IACK,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionStatus.d.ts","sourceRoot":"","sources":["../../../src/components/SubscriptionStatus/SubscriptionStatus.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8BD,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,uBAAuB,+BAsBzB"}
1
+ {"version":3,"file":"SubscriptionStatus.d.ts","sourceRoot":"","sources":["../../../src/components/SubscriptionStatus/SubscriptionStatus.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4CD,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,uBAAuB,+BAsBzB"}
@@ -11,12 +11,26 @@ function toneFor(status) {
11
11
  color: '#34d399',
12
12
  live: true,
13
13
  };
14
+ case 'paid':
15
+ return {
16
+ background: 'rgba(52,211,153,.12)',
17
+ color: '#34d399',
18
+ live: false,
19
+ };
14
20
  case 'past_due':
21
+ case 'overdue':
22
+ case 'failed':
15
23
  return {
16
24
  background: 'rgba(214,69,80,.1)',
17
25
  color: 'var(--slx-danger)',
18
26
  live: false,
19
27
  };
28
+ case 'pending':
29
+ return {
30
+ background: 'rgba(217,119,6,.12)',
31
+ color: '#d97706',
32
+ live: false,
33
+ };
20
34
  default:
21
35
  return {
22
36
  background: 'var(--slx-accent-soft)',
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionStatus.js","sourceRoot":"","sources":["../../../src/components/SubscriptionStatus/SubscriptionStatus.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAW5C,SAAS,OAAO,CAAC,MAAc;IAK7B,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,UAAU;YACb,OAAO;gBACL,UAAU,EAAE,sBAAsB;gBAClC,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,IAAI;aACX,CAAC;QACJ,KAAK,UAAU;YACb,OAAO;gBACL,UAAU,EAAE,oBAAoB;gBAChC,KAAK,EAAE,mBAAmB;gBAC1B,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ;YACE,OAAO;gBACL,UAAU,EAAE,wBAAwB;gBACpC,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,KAAK;aACZ,CAAC;IACN,CAAC;AACH,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,kBAAkB,CAAC,EACjC,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACe;IACxB,YAAY,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,cAAc,CAAkB,KAAK,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE;YACL,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,UAAU;YACnB,YAAY,EAAE,GAAG;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,KAAK;SACT,aAED,eAAM,SAAS,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,EAChE,MAAM,IACF,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"SubscriptionStatus.js","sourceRoot":"","sources":["../../../src/components/SubscriptionStatus/SubscriptionStatus.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAW5C,SAAS,OAAO,CAAC,MAAc;IAK7B,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,UAAU;YACb,OAAO;gBACL,UAAU,EAAE,sBAAsB;gBAClC,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,IAAI;aACX,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,UAAU,EAAE,sBAAsB;gBAClC,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO;gBACL,UAAU,EAAE,oBAAoB;gBAChC,KAAK,EAAE,mBAAmB;gBAC1B,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,KAAK,SAAS;YACZ,OAAO;gBACL,UAAU,EAAE,qBAAqB;gBACjC,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ;YACE,OAAO;gBACL,UAAU,EAAE,wBAAwB;gBACpC,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,KAAK;aACZ,CAAC;IACN,CAAC;AACH,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,kBAAkB,CAAC,EACjC,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,GACe;IACxB,YAAY,EAAE,CAAC;IACf,MAAM,GAAG,GAAG,cAAc,CAAkB,KAAK,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE;YACL,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,UAAU;YACnB,YAAY,EAAE,GAAG;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,KAAK;SACT,aAED,eAAM,SAAS,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,EAChE,MAAM,IACF,CACR,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slyxup/ui",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "SlyxUp UI components — auth, billing, Paddle checkout",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",