@burdenoff/microfe-billing 2026.1114.7 → 2026.1114.8
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/dist/billing/shared/components/BillingHistoryTabs.js +6 -1
- package/dist/billing/shared/components/BillingHistoryTabs.js.map +1 -1
- package/dist/billing/shared/components/historyTabs.d.ts +0 -3
- package/dist/billing/shared/components/historyTabs.js +0 -8
- package/dist/billing/shared/components/historyTabs.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,11 @@ var i = ({ active: i, billingAccountId: a }) => {
|
|
|
7
7
|
let { t: o } = r(), s = e(), c = (e, t) => {
|
|
8
8
|
let n = o(e);
|
|
9
9
|
return n === e ? t : n;
|
|
10
|
+
}, l = {
|
|
11
|
+
invoices: c("billing.history.invoices", "Invoices"),
|
|
12
|
+
payments: c("billing.history.payments", "Payments"),
|
|
13
|
+
credits: c("billing.history.credits", "Credit history"),
|
|
14
|
+
refunds: c("billing.history.refunds", "Refunds")
|
|
10
15
|
};
|
|
11
16
|
return /* @__PURE__ */ n("nav", {
|
|
12
17
|
"aria-label": c("billing.history.label", "Billing history"),
|
|
@@ -20,7 +25,7 @@ var i = ({ active: i, billingAccountId: a }) => {
|
|
|
20
25
|
t || s(e.path);
|
|
21
26
|
},
|
|
22
27
|
className: `whitespace-nowrap rounded-button px-3 py-1.5 text-sm transition-colors ${t ? "bg-bg-sunken font-medium text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
23
|
-
children:
|
|
28
|
+
children: l[e.id]
|
|
24
29
|
}, e.id);
|
|
25
30
|
})
|
|
26
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BillingHistoryTabs.js","names":["BillingHistoryTabs","useI18n","navigateTo","useBillingNavigate","tr","translated","t","key","fallback","getBillingHistoryTabs","billingAccountId","isActive","tab","active"],"sources":["../../../../src/billing/shared/components/BillingHistoryTabs.tsx"],"sourcesContent":["import { type FC } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\nimport { useBillingNavigate } from '../../hooks/useBillingNavigate';\nimport { getBillingHistoryTabs, type BillingHistoryTabId } from './historyTabs';\n\ninterface BillingHistoryTabsProps {\n active: BillingHistoryTabId;\n billingAccountId?: string | null;\n}\n\n/** Tab strip shared by Invoices, Payments, Credit history and Refunds (FluidGrids only). */\nexport const BillingHistoryTabs: FC<BillingHistoryTabsProps> = ({ active, billingAccountId }) => {\n const { t } = useI18n();\n const navigateTo = useBillingNavigate();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n return (\n <nav\n aria-label={tr('billing.history.label', 'Billing history')}\n className=\"flex max-w-full flex-wrap items-center gap-1 rounded-card border border-border-subtle bg-bg-surface p-1\"\n >\n {getBillingHistoryTabs(billingAccountId).map((tab) => {\n const isActive = tab.id === active;\n return (\n <button\n key={tab.id}\n type=\"button\"\n aria-current={isActive ? 'page' : undefined}\n onClick={() => {\n if (!isActive) navigateTo(tab.path);\n }}\n className={`whitespace-nowrap rounded-button px-3 py-1.5 text-sm transition-colors ${\n isActive\n ? 'bg-bg-sunken font-medium text-text-primary'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n >\n {
|
|
1
|
+
{"version":3,"file":"BillingHistoryTabs.js","names":["BillingHistoryTabs","useI18n","navigateTo","useBillingNavigate","tr","translated","t","key","fallback","labels","getBillingHistoryTabs","billingAccountId","isActive","tab","active"],"sources":["../../../../src/billing/shared/components/BillingHistoryTabs.tsx"],"sourcesContent":["import { type FC } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\nimport { useBillingNavigate } from '../../hooks/useBillingNavigate';\nimport { getBillingHistoryTabs, type BillingHistoryTabId } from './historyTabs';\n\ninterface BillingHistoryTabsProps {\n active: BillingHistoryTabId;\n billingAccountId?: string | null;\n}\n\n/** Tab strip shared by Invoices, Payments, Credit history and Refunds (FluidGrids only). */\nexport const BillingHistoryTabs: FC<BillingHistoryTabsProps> = ({ active, billingAccountId }) => {\n const { t } = useI18n();\n const navigateTo = useBillingNavigate();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n // Literal keys so the i18n extractor picks every label up.\n const labels: Record<BillingHistoryTabId, string> = {\n invoices: tr('billing.history.invoices', 'Invoices'),\n payments: tr('billing.history.payments', 'Payments'),\n credits: tr('billing.history.credits', 'Credit history'),\n refunds: tr('billing.history.refunds', 'Refunds'),\n };\n\n return (\n <nav\n aria-label={tr('billing.history.label', 'Billing history')}\n className=\"flex max-w-full flex-wrap items-center gap-1 rounded-card border border-border-subtle bg-bg-surface p-1\"\n >\n {getBillingHistoryTabs(billingAccountId).map((tab) => {\n const isActive = tab.id === active;\n return (\n <button\n key={tab.id}\n type=\"button\"\n aria-current={isActive ? 'page' : undefined}\n onClick={() => {\n if (!isActive) navigateTo(tab.path);\n }}\n className={`whitespace-nowrap rounded-button px-3 py-1.5 text-sm transition-colors ${\n isActive\n ? 'bg-bg-sunken font-medium text-text-primary'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n >\n {labels[tab.id]}\n </button>\n );\n })}\n </nav>\n );\n};\n"],"mappings":";;;;;AAYA,IAAaA,KAAmD,EAAE,WAAQ,0BAAuB;CAC/F,IAAM,EAAE,SAAMC,EAAQ,GAChBC,IAAaC,EAAmB,GAChCC,KAAM,GAAa,MAA6B;EACpD,IAAMC,IAAaC,EAAEC,CAAG;EACxB,OAAOF,MAAeE,IAAMC,IAAWH;CACzC,GAGMI,IAA8C;EAClD,UAAUL,EAAG,4BAA4B,UAAU;EACnD,UAAUA,EAAG,4BAA4B,UAAU;EACnD,SAASA,EAAG,2BAA2B,gBAAgB;EACvD,SAASA,EAAG,2BAA2B,SAAS;CAClD;CAEA,OACE,kBAAC,OAAD;EACE,cAAYA,EAAG,yBAAyB,iBAAiB;EACzD,WAAU;EAET,UAAAM,EAAsBC,CAAgB,CAAC,CAAC,KAAK,MAAQ;GACpD,IAAMC,IAAWC,EAAI,OAAOC;GAC5B,OACE,kBAAC,UAAD;IAEE,MAAK;IACL,gBAAcF,IAAW,SAAS,KAAA;IAClC,eAAe;KACb,AAAKA,KAAUV,EAAWW,EAAI,IAAI;IACpC;IACA,WAAW,0EACTD,IACI,+CACA;IAGL,UAAAH,EAAOI,EAAI;GACN,GAbDA,EAAI,EAaH;EAEZ,CAAC;CACE,CAAA;AAET"}
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
export type BillingHistoryTabId = 'invoices' | 'payments' | 'credits' | 'refunds';
|
|
7
7
|
export interface BillingHistoryTabDef {
|
|
8
8
|
id: BillingHistoryTabId;
|
|
9
|
-
/** i18n key */
|
|
10
|
-
labelKey: string;
|
|
11
|
-
fallbackLabel: string;
|
|
12
9
|
/** Path relative to the billing base path. */
|
|
13
10
|
path: string;
|
|
14
11
|
}
|
|
@@ -2,28 +2,20 @@
|
|
|
2
2
|
function e(e) {
|
|
3
3
|
let t = [{
|
|
4
4
|
id: "invoices",
|
|
5
|
-
labelKey: "billing.history.invoices",
|
|
6
|
-
fallbackLabel: "Invoices",
|
|
7
5
|
path: "/invoices"
|
|
8
6
|
}];
|
|
9
7
|
if (e) {
|
|
10
8
|
let n = encodeURIComponent(e);
|
|
11
9
|
t.push({
|
|
12
10
|
id: "payments",
|
|
13
|
-
labelKey: "billing.history.payments",
|
|
14
|
-
fallbackLabel: "Payments",
|
|
15
11
|
path: `/transactions/${n}`
|
|
16
12
|
}, {
|
|
17
13
|
id: "credits",
|
|
18
|
-
labelKey: "billing.history.credits",
|
|
19
|
-
fallbackLabel: "Credit history",
|
|
20
14
|
path: `/creditTransactions/${n}`
|
|
21
15
|
});
|
|
22
16
|
}
|
|
23
17
|
return t.push({
|
|
24
18
|
id: "refunds",
|
|
25
|
-
labelKey: "billing.history.refunds",
|
|
26
|
-
fallbackLabel: "Refunds",
|
|
27
19
|
path: "/refunds"
|
|
28
20
|
}), t;
|
|
29
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historyTabs.js","names":["getBillingHistoryTabs","tabs","billingAccountId","id"],"sources":["../../../../src/billing/shared/components/historyTabs.ts"],"sourcesContent":["/**\n * Billing history (BOFF-11860, FluidGrids variant): invoices, payments, credit\n * history and refunds answer one question, \"what did I pay?\", so the four pages\n * share one tab strip. Each page keeps its own route and behaviour.\n */\n\nexport type BillingHistoryTabId = 'invoices' | 'payments' | 'credits' | 'refunds';\n\nexport interface BillingHistoryTabDef {\n id: BillingHistoryTabId;\n /**
|
|
1
|
+
{"version":3,"file":"historyTabs.js","names":["getBillingHistoryTabs","tabs","billingAccountId","id"],"sources":["../../../../src/billing/shared/components/historyTabs.ts"],"sourcesContent":["/**\n * Billing history (BOFF-11860, FluidGrids variant): invoices, payments, credit\n * history and refunds answer one question, \"what did I pay?\", so the four pages\n * share one tab strip. Each page keeps its own route and behaviour.\n */\n\nexport type BillingHistoryTabId = 'invoices' | 'payments' | 'credits' | 'refunds';\n\nexport interface BillingHistoryTabDef {\n id: BillingHistoryTabId;\n /** Path relative to the billing base path. */\n path: string;\n}\n\n/**\n * The tabs to show. Payments and Credits history are per billing account, so\n * they appear only once an account is known; Invoices and Refunds always do.\n */\nexport function getBillingHistoryTabs(\n billingAccountId: string | null | undefined\n): BillingHistoryTabDef[] {\n const tabs: BillingHistoryTabDef[] = [\n {\n id: 'invoices',\n path: '/invoices',\n },\n ];\n if (billingAccountId) {\n const id = encodeURIComponent(billingAccountId);\n tabs.push(\n {\n id: 'payments',\n path: `/transactions/${id}`,\n },\n {\n id: 'credits',\n path: `/creditTransactions/${id}`,\n }\n );\n }\n tabs.push({\n id: 'refunds',\n path: '/refunds',\n });\n return tabs;\n}\n"],"mappings":";AAkBA,SAAgBA,EACd,GACwB;CACxB,IAAMC,IAA+B,CACnC;EACE,IAAI;EACJ,MAAM;CACR,CACF;CACA,IAAIC,GAAkB;EACpB,IAAMC,IAAK,mBAAmBD,CAAgB;EAC9C,EAAK,KACH;GACE,IAAI;GACJ,MAAM,iBAAiBC;EACzB,GACA;GACE,IAAI;GACJ,MAAM,uBAAuBA;EAC/B,CACF;CACF;CAKA,OAJAF,EAAK,KAAK;EACR,IAAI;EACJ,MAAM;CACR,CAAC,GACMA;AACT"}
|