@burdenoff/microfe-billing 2026.1114.9 → 2026.1115.1

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.
@@ -1,35 +1,36 @@
1
- import { useBillingNavigate as e } from "../../hooks/useBillingNavigate.js";
2
- import { getBillingHistoryTabs as t } from "./historyTabs.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { useI18n as r } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
1
+ import { useGetBillingAccountsByOrgQuery as e } from "../../../generated/global-operations.js";
2
+ import { useBillingNavigate as t } from "../../hooks/useBillingNavigate.js";
3
+ import { getBillingHistoryTabs as n } from "./historyTabs.js";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
6
  // src/billing/shared/components/BillingHistoryTabs.tsx
6
- var i = ({ active: i, billingAccountId: a }) => {
7
- let { t: o } = r(), s = e(), c = (e, t) => {
8
- let n = o(e);
7
+ var a = ({ active: a, billingAccountId: o }) => {
8
+ let { t: s } = i(), c = t(), { data: l } = e({ fetchPolicy: "cache-first" }), u = l?.getBillingAccountsByOrg ?? [], d = o ?? (u.find((e) => e.isDefault) ?? u[0])?.id, f = (e, t) => {
9
+ let n = s(e);
9
10
  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")
11
+ }, p = {
12
+ invoices: f("billing.history.invoices", "Invoices"),
13
+ payments: f("billing.history.payments", "Payments"),
14
+ credits: f("billing.history.credits", "Credit history"),
15
+ refunds: f("billing.history.refunds", "Refunds")
15
16
  };
16
- return /* @__PURE__ */ n("nav", {
17
- "aria-label": c("billing.history.label", "Billing history"),
17
+ return /* @__PURE__ */ r("nav", {
18
+ "aria-label": f("billing.history.label", "Billing history"),
18
19
  className: "flex max-w-full flex-wrap items-center gap-1 rounded-card border border-border-subtle bg-bg-surface p-1",
19
- children: t(a).map((e) => {
20
- let t = e.id === i;
21
- return /* @__PURE__ */ n("button", {
20
+ children: n(d).map((e) => {
21
+ let t = e.id === a;
22
+ return /* @__PURE__ */ r("button", {
22
23
  type: "button",
23
24
  "aria-current": t ? "page" : void 0,
24
25
  onClick: () => {
25
- t || s(e.path);
26
+ t || c(e.path);
26
27
  },
27
28
  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"}`,
28
- children: l[e.id]
29
+ children: p[e.id]
29
30
  }, e.id);
30
31
  })
31
32
  });
32
33
  };
33
- export { i as BillingHistoryTabs };
34
+ export { a as BillingHistoryTabs };
34
35
 
35
36
  //# sourceMappingURL=BillingHistoryTabs.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"BillingHistoryTabs.js","names":["BillingHistoryTabs","useI18n","navigateTo","useBillingNavigate","accountsData","useGetBillingAccountsByOrgQuery","accounts","accountId","billingAccountId","a","tr","translated","t","key","fallback","labels","getBillingHistoryTabs","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 { useGetBillingAccountsByOrgQuery } from '../../../generated/global-operations';\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 // The page's own account wins; otherwise use the default account, so every\n // page in the strip shows the same tabs.\n const { data: accountsData } = useGetBillingAccountsByOrgQuery({ fetchPolicy: 'cache-first' });\n type Account = NonNullable<typeof accountsData>['getBillingAccountsByOrg'][number];\n const accounts: Account[] = accountsData?.getBillingAccountsByOrg ?? [];\n const accountId = billingAccountId ?? (accounts.find((a) => a.isDefault) ?? accounts[0])?.id;\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(accountId).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":";;;;;;AAaA,IAAaA,KAAmD,EAAE,WAAQ,0BAAuB;CAC/F,IAAM,EAAE,SAAMC,EAAQ,GAChBC,IAAaC,EAAmB,GAGhC,EAAE,MAAMC,MAAiBC,EAAgC,EAAE,aAAa,cAAc,CAAC,GAEvFC,IAAsBF,GAAc,2BAA2B,CAAC,GAChEG,IAAYC,MAAqBF,EAAS,MAAM,MAAMG,EAAE,SAAS,KAAKH,EAAS,GAAA,EAAK,IACpFI,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,EAAsBT,CAAS,CAAC,CAAC,KAAK,MAAQ;GAC7C,IAAMU,IAAWC,EAAI,OAAOC;GAC5B,OACE,kBAAC,UAAD;IAEE,MAAK;IACL,gBAAcF,IAAW,SAAS,KAAA;IAClC,eAAe;KACb,AAAKA,KAAUf,EAAWgB,EAAI,IAAI;IACpC;IACA,WAAW,0EACTD,IACI,+CACA;IAGL,UAAAF,EAAOG,EAAI;GACN,GAbDA,EAAI,EAaH;EAEZ,CAAC;CACE,CAAA;AAET"}