@abyss-project/commons-front-core 9.5.1 → 9.6.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.
- package/README.md +15 -0
- package/dist/{AbyssCookieConsentProvider-jMv5bvVK.js → AbyssCookieConsentProvider-D-HRRYCd.js} +778 -680
- package/dist/{CookieConsentSettings.component-B6i65LtJ.js → CookieConsentSettings.component-iG_abYsq.js} +1 -1
- package/dist/components/data/InvoiceDetailView/InvoiceDetailView.d.ts +37 -0
- package/dist/components/data/InvoiceDetailView/InvoiceDetailView.spec.d.ts +1 -0
- package/dist/components/data/InvoiceDetailView/InvoiceStatusBadge.d.ts +15 -0
- package/dist/components/data/InvoiceDetailView/invoice-display.d.ts +11 -0
- package/dist/components/data/InvoiceDetailView/invoice-line-label.d.ts +13 -0
- package/dist/components/data/InvoiceDetailView/invoice-line-label.spec.d.ts +1 -0
- package/dist/components/data/index.d.ts +3 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-CykIb-Gz.js → design-theme-Cz9YXXYF.js} +400 -400
- package/dist/hooks/theme-transition/bubble-field.d.ts +35 -0
- package/dist/hooks/theme-transition/bubble-field.spec.d.ts +1 -0
- package/dist/hooks/theme-transition/bubble-overlay.d.ts +19 -0
- package/dist/hooks/use-rich-intl.hook.d.ts +122 -0
- package/dist/hooks/use-theme-transition.hook.d.ts +7 -4
- package/dist/hooks/use-theme-transition.hook.spec.d.ts +1 -0
- package/dist/{index-BS7CgEyj.js → index-122nruW2.js} +2 -2
- package/dist/{index-BveBtqZP.js → index-71ZKDT76.js} +4 -4
- package/dist/{index-Bd0oB0x3.js → index-B1LNfIcu.js} +2 -2
- package/dist/{index-mNiLojvx.js → index-BGjmUj-Y.js} +4 -4
- package/dist/{index-f_oWcs8w.js → index-BmNsW-7e.js} +4 -4
- package/dist/{index-B9kzX70T.js → index-Bx3HHL-R.js} +2 -2
- package/dist/{index-IhTCIvj6.js → index-C4zd0qai.js} +3 -3
- package/dist/{index-Cy8fNdNL.js → index-CfMACXTF.js} +2 -2
- package/dist/{index-CLxMgDwa.js → index-ClFFE5ao.js} +2 -2
- package/dist/{index-_nt9c97v.js → index-CtIh_DWT.js} +3 -3
- package/dist/{index-7S_OHK4f.js → index-D-Sa8nQo.js} +3 -3
- package/dist/{index-Cqn_LfL2.js → index-D4RSXnjv.js} +2 -2
- package/dist/{index-Bgrp5kC3.js → index-D5lR_Znk.js} +2 -2
- package/dist/{index-BOm9JgH7.js → index-DIW1zdfO.js} +2 -2
- package/dist/{index-Lub7dhvT.js → index-DNe1tEo2.js} +28 -28
- package/dist/{index-B4xjMC7O.js → index-DP-wuPBm.js} +2 -2
- package/dist/{index-rfJiqJxI.js → index-Dodsh0PI.js} +3 -3
- package/dist/{index-CKD84DUx.js → index-XQsb7DVh.js} +1 -1
- package/dist/{index-BEQgBOwt.js → index-hmLJVQI5.js} +2 -2
- package/dist/{index-DebUlRoE.js → index-ri1JKKHf.js} +2 -2
- package/dist/{index-DXYvHlFM.js → index-uctTt51v.js} +2 -2
- package/dist/{index-BPGHypMd.js → index-y2047KCu.js} +2 -2
- package/dist/index.js +6635 -6167
- package/dist/legacy.js +11 -11
- package/dist/theme/components/shared.d.ts +6 -0
- package/dist/translations/en.d.ts +49 -0
- package/dist/translations/fr.d.ts +49 -0
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useEffect as C } from "react";
|
|
3
3
|
import { Card as v, CardContent as b, Stack as u, Typography as o, FormControlLabel as l, Box as r, Checkbox as d, Button as M } from "@mui/material";
|
|
4
|
-
import { g as R, u as x } from "./AbyssCookieConsentProvider-
|
|
4
|
+
import { g as R, u as x } from "./AbyssCookieConsentProvider-D-HRRYCd.js";
|
|
5
5
|
const B = () => {
|
|
6
6
|
const t = R(), { consent: i, save: y } = x(), [h, g] = m((i == null ? void 0 : i.analytics) ?? !1), [k, f] = m((i == null ? void 0 : i.marketing) ?? !1), c = i == null ? void 0 : i.analytics, n = i == null ? void 0 : i.marketing;
|
|
7
7
|
return C(() => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CommercialGestureDestination, ICreditNote, ICustomerCommercialGesture, IFundingInvoiceCoverage, IInvoice, IInvoiceAmounts, IInvoiceLine } from '@abyss-project/main';
|
|
3
|
+
/** The fields of the invoice the body reads. */
|
|
4
|
+
export type InvoiceDetailViewInvoice = Pick<IInvoice, 'type' | 'status' | 'periodStart' | 'periodEnd' | 'dueDate' | 'paidAt'>;
|
|
5
|
+
export interface InvoiceDetailViewProps {
|
|
6
|
+
invoice: InvoiceDetailViewInvoice;
|
|
7
|
+
lines: IInvoiceLine[];
|
|
8
|
+
/** The commercial gestures to show: the APPLIED ones. */
|
|
9
|
+
gestures: ICustomerCommercialGesture[];
|
|
10
|
+
/** The credit notes of the invoice: a gesture names the one it issued. */
|
|
11
|
+
creditNotes: ICreditNote[];
|
|
12
|
+
/** Every amount shown, as the server computed them (`computeInvoiceAmounts`): never recomputed here. */
|
|
13
|
+
amounts: IInvoiceAmounts;
|
|
14
|
+
/** What the programmes covered of the invoice; empty when none. */
|
|
15
|
+
fundingCoverage: IFundingInvoiceCoverage[];
|
|
16
|
+
/** The link to the programme of a coverage line, rendered under it; the host owns route and wording. */
|
|
17
|
+
renderCoverageLink?: (coverage: IFundingInvoiceCoverage) => ReactNode;
|
|
18
|
+
/** Last four digits of the card on file, for the debit notice of an overage invoice. */
|
|
19
|
+
cardLast4?: string | null;
|
|
20
|
+
/** The host's own zone under the totals: requests, links, anything the host acts on. */
|
|
21
|
+
actions?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Where a gesture's money went, in the host's words. Without it, the customer's wording
|
|
24
|
+
* (« Crédité sur votre solde… »); the back office passes a neutral one.
|
|
25
|
+
*/
|
|
26
|
+
gestureDestinationLabel?: (destination: CommercialGestureDestination) => string;
|
|
27
|
+
/** The interface locale (`fr`, `en`): language of the line labels, format of the unit prices. */
|
|
28
|
+
locale: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The body of an invoice detail, presentational: status and period, the debit notice of an
|
|
32
|
+
* overage invoice, its lines, deductions and commercial gestures, what the programmes covered,
|
|
33
|
+
* and the totals. Shared by the customer's billing spaces and the back-office so that both read
|
|
34
|
+
* the same invoice. It calls no API and reads no route: the data and the host's own zone
|
|
35
|
+
* (`actions`) come as props.
|
|
36
|
+
*/
|
|
37
|
+
export declare const InvoiceDetailView: ({ invoice, lines, gestures, creditNotes, amounts, fundingCoverage, renderCoverageLink, cardLast4, actions, gestureDestinationLabel, locale, }: InvoiceDetailViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IInvoice } from '@abyss-project/main';
|
|
2
|
+
type StatusFields = Pick<IInvoice, 'type' | 'status' | 'dueDate'>;
|
|
3
|
+
/**
|
|
4
|
+
* The status of an invoice as its customer reads it: an overage invoice waiting for its debit
|
|
5
|
+
* shows the debit date instead of a bare "pending" status.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useInvoiceStatusLabel: () => ((invoice: StatusFields) => string);
|
|
8
|
+
export interface InvoiceStatusBadgeProps {
|
|
9
|
+
invoice: StatusFields;
|
|
10
|
+
/** Test id set on the badge's wrapper. */
|
|
11
|
+
testId: string;
|
|
12
|
+
}
|
|
13
|
+
/** The status badge of an invoice (see `useInvoiceStatusLabel`). */
|
|
14
|
+
export declare const InvoiceStatusBadge: ({ invoice, testId, }: InvoiceStatusBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IInvoice, IInvoiceLine } from '@abyss-project/main';
|
|
2
|
+
/**
|
|
3
|
+
* The date an overage invoice will be debited, while it still waits for it: an OVERAGE invoice
|
|
4
|
+
* is issued apart and collected after a notice (ADR-0147). `null` for any other invoice, and for
|
|
5
|
+
* an overage invoice already paid, voided or uncollectible.
|
|
6
|
+
*/
|
|
7
|
+
export declare const overageDebitDate: (invoice: Pick<IInvoice, "type" | "status" | "dueDate">) => Date | null;
|
|
8
|
+
/** The lines that bill something, in the order the invoice shows them. */
|
|
9
|
+
export declare const billedLines: (lines: IInvoiceLine[]) => IInvoiceLine[];
|
|
10
|
+
/** The credits and prepaid balance taken off the invoice, in the order the invoice shows them. */
|
|
11
|
+
export declare const deductionLines: (lines: IInvoiceLine[]) => IInvoiceLine[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IInvoiceLine } from '@abyss-project/main';
|
|
2
|
+
import { IntlShape } from 'react-intl';
|
|
3
|
+
/**
|
|
4
|
+
* The label an invoice line is shown under, in the interface language, built from its structured
|
|
5
|
+
* fields, never from its stored label or a Stripe description:
|
|
6
|
+
* - an overage line from its metric and service (`formatOverageLineName`, the SDK tables the
|
|
7
|
+
* back-office reads too, so the same line carries the same name on both);
|
|
8
|
+
* - a subscription, plan-change or module line from its plan, module, period and proration flag
|
|
9
|
+
* (`formatPlanLineLabel`);
|
|
10
|
+
* - a deduction line by what it took off.
|
|
11
|
+
* Any other line (a top-up, a one-shot module) keeps the label the server stored.
|
|
12
|
+
*/
|
|
13
|
+
export declare const invoiceLineLabel: (intl: IntlShape, locale: string, line: IInvoiceLine) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,3 +9,6 @@ export * from './LineChart/LineChart';
|
|
|
9
9
|
export * from './BarChart/BarChart';
|
|
10
10
|
export * from './chart-series-tone';
|
|
11
11
|
export * from './FacetPanel/FacetPanel';
|
|
12
|
+
export * from './InvoiceDetailView/InvoiceDetailView';
|
|
13
|
+
export * from './InvoiceDetailView/InvoiceStatusBadge';
|
|
14
|
+
export { overageDebitDate } from './InvoiceDetailView/invoice-display';
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-
|
|
2
|
-
import { C as E } from "./CookieConsentSettings.component-
|
|
1
|
+
import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-D-HRRYCd.js";
|
|
2
|
+
import { C as E } from "./CookieConsentSettings.component-iG_abYsq.js";
|
|
3
3
|
export {
|
|
4
4
|
e as AbyssCookieConsentProvider,
|
|
5
5
|
a as COOKIE_NAME,
|