@usethrottle/auth 0.8.0 → 0.9.0

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.
@@ -303,6 +303,12 @@ declare const enUS: {
303
303
  viewSubscription: string;
304
304
  payButton: string;
305
305
  billedTo: string;
306
+ /** Shown when an invoice bills less than the order, matching the PDF. */
307
+ orderTotal: string;
308
+ amountPaid: string;
309
+ waived: string;
310
+ amountDue: string;
311
+ balanceDue: string;
306
312
  /** Display copy for `invoice.status` — the wire values are paid|open|void. */
307
313
  statusLabels: {
308
314
  paid: string;
@@ -303,6 +303,12 @@ declare const enUS: {
303
303
  viewSubscription: string;
304
304
  payButton: string;
305
305
  billedTo: string;
306
+ /** Shown when an invoice bills less than the order, matching the PDF. */
307
+ orderTotal: string;
308
+ amountPaid: string;
309
+ waived: string;
310
+ amountDue: string;
311
+ balanceDue: string;
306
312
  /** Display copy for `invoice.status` — the wire values are paid|open|void. */
307
313
  statusLabels: {
308
314
  paid: string;
@@ -655,6 +655,12 @@ var enUS = {
655
655
  viewSubscription: "View subscription",
656
656
  payButton: "Pay this invoice",
657
657
  billedTo: "Billed to",
658
+ /** Shown when an invoice bills less than the order, matching the PDF. */
659
+ orderTotal: "Order total",
660
+ amountPaid: "Amount paid",
661
+ waived: "Waived",
662
+ amountDue: "Amount due",
663
+ balanceDue: "Balance due",
658
664
  /** Display copy for `invoice.status` — the wire values are paid|open|void. */
659
665
  statusLabels: { paid: "Paid", open: "Open", void: "Void" },
660
666
  downloadUnavailable: "This invoice is not available to download right now."
@@ -3547,6 +3553,9 @@ function InvoiceDetail(props) {
3547
3553
  /* @__PURE__ */ jsx40(PanelState, { resource, isEmpty: (i) => i === null, emptyTitle: t.invoices.empty, skeletonRows: 4, children: (invoice) => {
3548
3554
  const money = (v) => formatMoney(v, invoice.currency, locale);
3549
3555
  const lines = invoice.lineItems ?? [];
3556
+ const partOfOrder = invoice.orderTotal != null;
3557
+ const isDepositReceipt = partOfOrder && invoice.balanceDue != null;
3558
+ const headlineLabel = !partOfOrder ? t.invoices.total : isDepositReceipt ? t.invoices.amountPaid : t.invoices.amountDue;
3550
3559
  return /* @__PURE__ */ jsxs30("div", { ...a.el("invoiceDetail.layout", "throttle-detail"), children: [
3551
3560
  /* @__PURE__ */ jsxs30("div", { ...a.el("invoiceDetail.main", "throttle-detail__main"), children: [
3552
3561
  /* @__PURE__ */ jsxs30("div", { className: "throttle-detail__section", children: [
@@ -3580,10 +3589,14 @@ function InvoiceDetail(props) {
3580
3589
  ] }),
3581
3590
  /* @__PURE__ */ jsxs30("aside", { ...a.el("invoiceDetail.rail", "throttle-detail__rail"), children: [
3582
3591
  /* @__PURE__ */ jsxs30("div", { className: "throttle-detail__section", children: [
3583
- /* @__PURE__ */ jsx40("span", { className: "throttle-detail__label", children: t.invoices.total }),
3592
+ /* @__PURE__ */ jsx40("span", { className: "throttle-detail__label", children: headlineLabel }),
3584
3593
  /* @__PURE__ */ jsx40("span", { className: "throttle-detail__headline", children: money(invoice.total) })
3585
3594
  ] }),
3586
3595
  /* @__PURE__ */ jsxs30("div", { ...a.el("invoiceDetail.totals", "throttle-totals"), children: [
3596
+ partOfOrder ? /* @__PURE__ */ jsx40(Line2, { label: t.invoices.orderTotal, value: money(invoice.orderTotal) }) : null,
3597
+ partOfOrder && invoice.amountPaid ? /* @__PURE__ */ jsx40(Line2, { label: t.invoices.amountPaid, value: `-${money(invoice.amountPaid)}` }) : null,
3598
+ partOfOrder && invoice.compWaived ? /* @__PURE__ */ jsx40(Line2, { label: t.invoices.waived, value: `-${money(invoice.compWaived)}` }) : null,
3599
+ isDepositReceipt && invoice.balanceDue ? /* @__PURE__ */ jsx40(Line2, { label: t.invoices.balanceDue, value: money(invoice.balanceDue) }) : null,
3587
3600
  invoice.dueAt ? /* @__PURE__ */ jsx40(Line2, { label: t.invoices.due, value: formatDate(invoice.dueAt, locale) }) : null,
3588
3601
  invoice.periodStart && invoice.periodEnd ? /* @__PURE__ */ jsx40(
3589
3602
  Line2,