@baack-software/baack-ts-crm 0.0.0-stage → 0.0.3
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/LICENSE +201 -0
- package/README.md +74 -2
- package/dist/account.d.ts +36 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/account.js +48 -0
- package/dist/account.js.map +1 -0
- package/dist/backend.d.ts +104 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +328 -0
- package/dist/backend.js.map +1 -0
- package/dist/crm-client.d.ts +164 -0
- package/dist/crm-client.d.ts.map +1 -0
- package/dist/crm-client.js +252 -0
- package/dist/crm-client.js.map +1 -0
- package/dist/deal-order.d.ts +42 -0
- package/dist/deal-order.d.ts.map +1 -0
- package/dist/deal-order.js +80 -0
- package/dist/deal-order.js.map +1 -0
- package/dist/errors.d.ts +21 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +33 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/invoices.d.ts +53 -0
- package/dist/invoices.d.ts.map +1 -0
- package/dist/invoices.js +155 -0
- package/dist/invoices.js.map +1 -0
- package/dist/leads.d.ts +29 -0
- package/dist/leads.d.ts.map +1 -0
- package/dist/leads.js +56 -0
- package/dist/leads.js.map +1 -0
- package/dist/mock/index.d.ts +43 -0
- package/dist/mock/index.d.ts.map +1 -0
- package/dist/mock/index.js +303 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/money.d.ts +29 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +82 -0
- package/dist/money.js.map +1 -0
- package/dist/period.d.ts +30 -0
- package/dist/period.d.ts.map +1 -0
- package/dist/period.js +49 -0
- package/dist/period.js.map +1 -0
- package/dist/pipeline.d.ts +36 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +58 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/react/Charts.d.ts +19 -0
- package/dist/react/Charts.d.ts.map +1 -0
- package/dist/react/Charts.js +38 -0
- package/dist/react/Charts.js.map +1 -0
- package/dist/react/ChoiceCombobox.d.ts +36 -0
- package/dist/react/ChoiceCombobox.d.ts.map +1 -0
- package/dist/react/ChoiceCombobox.js +105 -0
- package/dist/react/ChoiceCombobox.js.map +1 -0
- package/dist/react/CompanyAccountView.d.ts +21 -0
- package/dist/react/CompanyAccountView.d.ts.map +1 -0
- package/dist/react/CompanyAccountView.js +27 -0
- package/dist/react/CompanyAccountView.js.map +1 -0
- package/dist/react/DashboardCards.d.ts +32 -0
- package/dist/react/DashboardCards.d.ts.map +1 -0
- package/dist/react/DashboardCards.js +38 -0
- package/dist/react/DashboardCards.js.map +1 -0
- package/dist/react/DealsBoard.d.ts +49 -0
- package/dist/react/DealsBoard.d.ts.map +1 -0
- package/dist/react/DealsBoard.js +82 -0
- package/dist/react/DealsBoard.js.map +1 -0
- package/dist/react/Details.d.ts +85 -0
- package/dist/react/Details.d.ts.map +1 -0
- package/dist/react/Details.js +268 -0
- package/dist/react/Details.js.map +1 -0
- package/dist/react/Forms.d.ts +190 -0
- package/dist/react/Forms.d.ts.map +1 -0
- package/dist/react/Forms.js +494 -0
- package/dist/react/Forms.js.map +1 -0
- package/dist/react/LeadsTable.d.ts +22 -0
- package/dist/react/LeadsTable.d.ts.map +1 -0
- package/dist/react/LeadsTable.js +79 -0
- package/dist/react/LeadsTable.js.map +1 -0
- package/dist/react/Sales.d.ts +68 -0
- package/dist/react/Sales.d.ts.map +1 -0
- package/dist/react/Sales.js +270 -0
- package/dist/react/Sales.js.map +1 -0
- package/dist/react/SidePanel.d.ts +31 -0
- package/dist/react/SidePanel.d.ts.map +1 -0
- package/dist/react/SidePanel.js +49 -0
- package/dist/react/SidePanel.js.map +1 -0
- package/dist/react/format.d.ts +28 -0
- package/dist/react/format.d.ts.map +1 -0
- package/dist/react/format.js +30 -0
- package/dist/react/format.js.map +1 -0
- package/dist/react/index.d.ts +15 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +15 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/parts.d.ts +55 -0
- package/dist/react/parts.d.ts.map +1 -0
- package/dist/react/parts.js +82 -0
- package/dist/react/parts.js.map +1 -0
- package/dist/react/pipeline-choice.d.ts +19 -0
- package/dist/react/pipeline-choice.d.ts.map +1 -0
- package/dist/react/pipeline-choice.js +39 -0
- package/dist/react/pipeline-choice.js.map +1 -0
- package/dist/react/text.d.ts +232 -0
- package/dist/react/text.d.ts.map +1 -0
- package/dist/react/text.js +229 -0
- package/dist/react/text.js.map +1 -0
- package/dist/react/ui/alert.d.ts +11 -0
- package/dist/react/ui/alert.d.ts.map +1 -0
- package/dist/react/ui/alert.js +29 -0
- package/dist/react/ui/alert.js.map +1 -0
- package/dist/react/ui/badge.d.ts +10 -0
- package/dist/react/ui/badge.d.ts.map +1 -0
- package/dist/react/ui/badge.js +26 -0
- package/dist/react/ui/badge.js.map +1 -0
- package/dist/react/ui/button.d.ts +11 -0
- package/dist/react/ui/button.d.ts.map +1 -0
- package/dist/react/ui/button.js +37 -0
- package/dist/react/ui/button.js.map +1 -0
- package/dist/react/ui/card.d.ts +12 -0
- package/dist/react/ui/card.d.ts.map +1 -0
- package/dist/react/ui/card.js +26 -0
- package/dist/react/ui/card.js.map +1 -0
- package/dist/react/ui/chart.d.ts +45 -0
- package/dist/react/ui/chart.d.ts.map +1 -0
- package/dist/react/ui/chart.js +116 -0
- package/dist/react/ui/chart.js.map +1 -0
- package/dist/react/ui/input.d.ts +4 -0
- package/dist/react/ui/input.d.ts.map +1 -0
- package/dist/react/ui/input.js +8 -0
- package/dist/react/ui/input.js.map +1 -0
- package/dist/react/ui/label.d.ts +5 -0
- package/dist/react/ui/label.d.ts.map +1 -0
- package/dist/react/ui/label.js +10 -0
- package/dist/react/ui/label.js.map +1 -0
- package/dist/react/ui/progress.d.ts +5 -0
- package/dist/react/ui/progress.d.ts.map +1 -0
- package/dist/react/ui/progress.js +10 -0
- package/dist/react/ui/progress.js.map +1 -0
- package/dist/react/ui/select.d.ts +16 -0
- package/dist/react/ui/select.d.ts.map +1 -0
- package/dist/react/ui/select.js +37 -0
- package/dist/react/ui/select.js.map +1 -0
- package/dist/react/ui/separator.d.ts +5 -0
- package/dist/react/ui/separator.d.ts.map +1 -0
- package/dist/react/ui/separator.js +10 -0
- package/dist/react/ui/separator.js.map +1 -0
- package/dist/react/ui/sheet.d.ts +15 -0
- package/dist/react/ui/sheet.d.ts.map +1 -0
- package/dist/react/ui/sheet.js +38 -0
- package/dist/react/ui/sheet.js.map +1 -0
- package/dist/react/ui/skeleton.d.ts +3 -0
- package/dist/react/ui/skeleton.d.ts.map +1 -0
- package/dist/react/ui/skeleton.js +7 -0
- package/dist/react/ui/skeleton.js.map +1 -0
- package/dist/react/ui/table.d.ts +11 -0
- package/dist/react/ui/table.d.ts.map +1 -0
- package/dist/react/ui/table.js +29 -0
- package/dist/react/ui/table.js.map +1 -0
- package/dist/react/ui/tabs.d.ts +12 -0
- package/dist/react/ui/tabs.d.ts.map +1 -0
- package/dist/react/ui/tabs.js +31 -0
- package/dist/react/ui/tabs.js.map +1 -0
- package/dist/react/views.d.ts +82 -0
- package/dist/react/views.d.ts.map +1 -0
- package/dist/react/views.js +241 -0
- package/dist/react/views.js.map +1 -0
- package/dist/sales.d.ts +82 -0
- package/dist/sales.d.ts.map +1 -0
- package/dist/sales.js +87 -0
- package/dist/sales.js.map +1 -0
- package/dist/store.d.ts +159 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +305 -0
- package/dist/store.js.map +1 -0
- package/dist/target.d.ts +22 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +40 -0
- package/dist/target.js.map +1 -0
- package/dist/types.d.ts +204 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +100 -4
- package/src/account.ts +79 -0
- package/src/backend.ts +501 -0
- package/src/crm-client.ts +393 -0
- package/src/deal-order.ts +116 -0
- package/src/errors.ts +34 -0
- package/src/index.ts +13 -0
- package/src/invoices.ts +177 -0
- package/src/leads.ts +78 -0
- package/src/mock/index.ts +398 -0
- package/src/money.ts +104 -0
- package/src/period.ts +71 -0
- package/src/pipeline.ts +82 -0
- package/src/react/Charts.tsx +143 -0
- package/src/react/ChoiceCombobox.tsx +227 -0
- package/src/react/CompanyAccountView.tsx +198 -0
- package/src/react/DashboardCards.tsx +171 -0
- package/src/react/DealsBoard.tsx +344 -0
- package/src/react/Details.tsx +870 -0
- package/src/react/Forms.tsx +1486 -0
- package/src/react/LeadsTable.tsx +234 -0
- package/src/react/Sales.tsx +827 -0
- package/src/react/SidePanel.tsx +104 -0
- package/src/react/format.ts +53 -0
- package/src/react/index.ts +14 -0
- package/src/react/parts.tsx +183 -0
- package/src/react/pipeline-choice.ts +54 -0
- package/src/react/text.ts +232 -0
- package/src/react/ui/README.md +6 -0
- package/src/react/ui/alert.tsx +75 -0
- package/src/react/ui/badge.tsx +48 -0
- package/src/react/ui/button.tsx +66 -0
- package/src/react/ui/card.tsx +102 -0
- package/src/react/ui/chart.tsx +304 -0
- package/src/react/ui/input.tsx +18 -0
- package/src/react/ui/label.tsx +23 -0
- package/src/react/ui/progress.tsx +30 -0
- package/src/react/ui/select.tsx +189 -0
- package/src/react/ui/separator.tsx +27 -0
- package/src/react/ui/sheet.tsx +145 -0
- package/src/react/ui/skeleton.tsx +13 -0
- package/src/react/ui/table.tsx +113 -0
- package/src/react/ui/tabs.tsx +89 -0
- package/src/react/views.tsx +633 -0
- package/src/sales.ts +167 -0
- package/src/store.ts +528 -0
- package/src/target.ts +54 -0
- package/src/types.ts +230 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from 'cn';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
import { createContext, useCallback, useContext, useSyncExternalStore } from 'react';
|
|
5
|
+
import { withText } from "./text.js";
|
|
6
|
+
import { Button } from "./ui/button.js";
|
|
7
|
+
import { Sheet, SheetContent, SheetTitle } from "./ui/sheet.js";
|
|
8
|
+
/** Whether a media query matches, following changes. True where there is no `matchMedia`, such as on the server. */
|
|
9
|
+
export function useMediaQuery(query) {
|
|
10
|
+
const subscribe = useCallback((onChange) => {
|
|
11
|
+
if (typeof matchMedia !== 'function')
|
|
12
|
+
return () => undefined;
|
|
13
|
+
const list = matchMedia(query);
|
|
14
|
+
list.addEventListener('change', onChange);
|
|
15
|
+
return () => list.removeEventListener('change', onChange);
|
|
16
|
+
}, [query]);
|
|
17
|
+
const matches = () => typeof matchMedia !== 'function' || matchMedia(query).matches;
|
|
18
|
+
return useSyncExternalStore(subscribe, matches, () => true);
|
|
19
|
+
}
|
|
20
|
+
/** The id of a record's card or row, so closing its panel can put focus back on it. */
|
|
21
|
+
export const recordItemId = (urn) => `crm-item-${urn}`;
|
|
22
|
+
/** The open panel's close action, for the card or form heading it holds to show beside its title. */
|
|
23
|
+
export const PanelClose = createContext(undefined);
|
|
24
|
+
/**
|
|
25
|
+
* Closes the side panel this is in, beside a card's or form's title so it lines up with it. Nothing outside a panel.
|
|
26
|
+
* A card shows it once: it clears the context for what it holds (see `CrmCard`).
|
|
27
|
+
*/
|
|
28
|
+
export function PanelCloseButton() {
|
|
29
|
+
const panel = useContext(PanelClose);
|
|
30
|
+
if (!panel)
|
|
31
|
+
return null;
|
|
32
|
+
return (_jsx(Button, { variant: "ghost", size: "icon-sm", onClick: panel.close, "aria-label": panel.label, children: _jsx(X, { "aria-hidden": "true" }) }));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A list or board with the open record beside it, as baack-ts-tasks' task view does: a sticky panel to the right on
|
|
36
|
+
* wide screens, a sheet from the right on narrow ones. Closing puts focus back on the record's card or row.
|
|
37
|
+
*/
|
|
38
|
+
export function SidePanelLayout({ open, title, onClose, children, panel, text, }) {
|
|
39
|
+
const words = withText(text);
|
|
40
|
+
const wide = useMediaQuery('(min-width: 64rem)');
|
|
41
|
+
const close = () => {
|
|
42
|
+
onClose();
|
|
43
|
+
if (open)
|
|
44
|
+
requestAnimationFrame(() => document.getElementById(recordItemId(open))?.focus());
|
|
45
|
+
};
|
|
46
|
+
const content = (_jsx(PanelClose.Provider, { value: { close, label: `${words.close}: ${title}` }, children: panel }));
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn('grid grid-cols-1 items-start gap-4', open && wide && 'grid-cols-[minmax(0,1fr)_minmax(22rem,28rem)]'), children: [_jsx("div", { className: "min-w-0", children: children }), open && wide && (_jsx("aside", { "aria-label": title, className: "sticky top-4 max-h-[calc(100vh-2rem)] overflow-y-auto p-px", children: content }))] }), !wide && (_jsx(Sheet, { open: open !== undefined, onOpenChange: (isOpen) => !isOpen && close(), children: _jsxs(SheetContent, { side: "right", showCloseButton: false, "aria-describedby": undefined, className: "w-full overflow-y-auto p-4 sm:max-w-md", onCloseAutoFocus: (event) => event.preventDefault(), children: [_jsx(SheetTitle, { className: "sr-only", children: title }), content] }) }))] }));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=SidePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../src/react/SidePanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAkB,MAAM,OAAO,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAgB,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,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AAS,EAAC,SAAS,YAAE,KAAK,GAAc,EACnD,OAAO,IACK,GACT,CACT,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type MoneyTotals } from '../money.ts';
|
|
2
|
+
import type { Money } from '../types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Names for the companies and people records point at. The CRM records hold references only; the host knows the
|
|
5
|
+
* names (from the identity and company reads it already makes).
|
|
6
|
+
*/
|
|
7
|
+
export interface CrmNames {
|
|
8
|
+
company?: (urn: string) => string | undefined;
|
|
9
|
+
person?: (urn: string) => string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare const companyNameOf: (names: CrmNames | undefined, urn: string | undefined) => string | undefined;
|
|
12
|
+
export declare const personNameOf: (names: CrmNames | undefined, urn: string | undefined) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Totals in each currency, joined with "and", such as "GBP 1,250.00 and EUR 300.00" written with symbols. An empty
|
|
15
|
+
* total reads as zero in `fallbackCurrency`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatTotals(totals: MoneyTotals, fallbackCurrency?: string, locale?: string): string;
|
|
18
|
+
/** Money, or a dash when there's none. */
|
|
19
|
+
export declare const formatMaybeMoney: (money: Money | null | undefined, locale?: string) => string;
|
|
20
|
+
/** A short date such as "24 Oct 2026", or a dash. */
|
|
21
|
+
export declare function formatDate(timestamp: string | null | undefined, locale?: string): string;
|
|
22
|
+
/** A fraction as a percentage: 0.104 is "10.4%". */
|
|
23
|
+
export declare const formatPercent: (fraction: number, locale?: string) => string;
|
|
24
|
+
/** A change with its sign: "+10.4%" or "-0.8%". */
|
|
25
|
+
export declare const formatChange: (fraction: number, locale?: string) => string;
|
|
26
|
+
/** An enum value as words: `BANK_TRANSFER` is "Bank transfer". */
|
|
27
|
+
export declare const enumLabel: (value: string) => string;
|
|
28
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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
|
2
|
+
import { formatMoney, totalsToMoney } from "../money.js";
|
|
3
|
+
export const companyNameOf = (names, urn) => urn ? names?.company?.(urn) : undefined;
|
|
4
|
+
export const personNameOf = (names, urn) => urn ? names?.person?.(urn) : undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Totals in each currency, joined with "and", such as "GBP 1,250.00 and EUR 300.00" written with symbols. An empty
|
|
7
|
+
* total reads as zero in `fallbackCurrency`.
|
|
8
|
+
*/
|
|
9
|
+
export function formatTotals(totals, fallbackCurrency = 'GBP', locale = 'en-GB') {
|
|
10
|
+
const money = totalsToMoney(totals);
|
|
11
|
+
if (money.length === 0)
|
|
12
|
+
return formatMoney({ unitValue: 0, currencyCode: fallbackCurrency }, locale);
|
|
13
|
+
return money.map((value) => formatMoney(value, locale)).join(' and ');
|
|
14
|
+
}
|
|
15
|
+
/** Money, or a dash when there's none. */
|
|
16
|
+
export const formatMaybeMoney = (money, locale = 'en-GB') => money ? formatMoney(money, locale) : '-';
|
|
17
|
+
/** A short date such as "24 Oct 2026", or a dash. */
|
|
18
|
+
export function formatDate(timestamp, locale = 'en-GB') {
|
|
19
|
+
const date = parseTimestamp(timestamp);
|
|
20
|
+
return date
|
|
21
|
+
? date.toLocaleDateString(locale, { day: 'numeric', month: 'short', year: 'numeric', timeZone: 'UTC' })
|
|
22
|
+
: '-';
|
|
23
|
+
}
|
|
24
|
+
/** A fraction as a percentage: 0.104 is "10.4%". */
|
|
25
|
+
export const formatPercent = (fraction, locale = 'en-GB') => new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(fraction);
|
|
26
|
+
/** A change with its sign: "+10.4%" or "-0.8%". */
|
|
27
|
+
export const formatChange = (fraction, locale = 'en-GB') => new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1, signDisplay: 'exceptZero' }).format(fraction);
|
|
28
|
+
/** An enum value as words: `BANK_TRANSFER` is "Bank transfer". */
|
|
29
|
+
export const enumLabel = (value) => value.charAt(0) + value.slice(1).toLowerCase().replaceAll('_', ' ');
|
|
30
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/react/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAC;AAY3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAA2B,EAAE,GAAuB,EAAE,EAAE,CACpF,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAA2B,EAAE,GAAuB,EAAE,EAAE,CACnF,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAAmB,EAAE,gBAAgB,GAAG,KAAK,EAAE,MAAM,GAAG,OAAO;IAC1F,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,MAAM,CAAC,CAAC;IACrG,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC;AAED,0CAA0C;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA+B,EAAE,MAAM,GAAG,OAAO,EAAE,EAAE,CACpF,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK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
3
|
+
export * from './parts.tsx';
|
|
4
|
+
export * from './DashboardCards.tsx';
|
|
5
|
+
export * from './Charts.tsx';
|
|
6
|
+
export * from './LeadsTable.tsx';
|
|
7
|
+
export * from './DealsBoard.tsx';
|
|
8
|
+
export * from './Details.tsx';
|
|
9
|
+
export * from './CompanyAccountView.tsx';
|
|
10
|
+
export * from './Sales.tsx';
|
|
11
|
+
export * from './Forms.tsx';
|
|
12
|
+
export * from './ChoiceCombobox.tsx';
|
|
13
|
+
export * from './SidePanel.tsx';
|
|
14
|
+
export * from './views.tsx';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./text.js";
|
|
2
|
+
export * from "./format.js";
|
|
3
|
+
export * from "./parts.js";
|
|
4
|
+
export * from "./DashboardCards.js";
|
|
5
|
+
export * from "./Charts.js";
|
|
6
|
+
export * from "./LeadsTable.js";
|
|
7
|
+
export * from "./DealsBoard.js";
|
|
8
|
+
export * from "./Details.js";
|
|
9
|
+
export * from "./CompanyAccountView.js";
|
|
10
|
+
export * from "./Sales.js";
|
|
11
|
+
export * from "./Forms.js";
|
|
12
|
+
export * from "./ChoiceCombobox.js";
|
|
13
|
+
export * from "./SidePanel.js";
|
|
14
|
+
export * from "./views.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,qBAAsB,CAAC;AACrC,cAAc,aAAc,CAAC;AAC7B,cAAc,iBAAkB,CAAC;AACjC,cAAc,iBAAkB,CAAC;AACjC,cAAc,cAAe,CAAC;AAC9B,cAAc,yBAA0B,CAAC;AACzC,cAAc,YAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,qBAAsB,CAAC;AACrC,cAAc,gBAAiB,CAAC;AAChC,cAAc,YAAa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ReportingPeriod } from '../period.ts';
|
|
3
|
+
import type { DealOutcome, InvoiceStatus, Lead } from '../types.ts';
|
|
4
|
+
import { type CrmText } from './text.ts';
|
|
5
|
+
/** Marks a view or card whose records come from sample data, so nobody takes them for real ones. */
|
|
6
|
+
export declare function SampleDataBadge({ text }: {
|
|
7
|
+
text?: Partial<CrmText> | undefined;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Says once, above a view, which of its concepts come from sample data, rather than a badge on every card.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SampleDataNotice({ concepts, text, }: {
|
|
13
|
+
concepts: readonly string[];
|
|
14
|
+
text?: Partial<CrmText> | undefined;
|
|
15
|
+
}): import("react").JSX.Element | null;
|
|
16
|
+
/**
|
|
17
|
+
* A titled card for the CRM views. `sample` adds the sample data badge; `action` sits at the top right. In a side
|
|
18
|
+
* panel, the panel's close button sits there too, in line with the title; cards inside this one don't repeat it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CrmCard({ title, description, sample, action, text, className, children, }: {
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
sample?: boolean | undefined;
|
|
24
|
+
action?: ReactNode;
|
|
25
|
+
text?: Partial<CrmText> | undefined;
|
|
26
|
+
className?: string;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
/** A rise or fall against the previous period, in words and an icon, not colour alone. */
|
|
30
|
+
export declare function ChangeIndicator({ change, text }: {
|
|
31
|
+
change: number | undefined;
|
|
32
|
+
text?: Partial<CrmText> | undefined;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
/** Where a lead stands: how it ended once closed (converted, unqualified), otherwise its status. */
|
|
35
|
+
export declare function LeadStatusBadge({ lead }: {
|
|
36
|
+
lead: Lead;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
/** How a deal stands, in words. Lost is outlined rather than red, which lacks contrast on tinted board columns. */
|
|
39
|
+
export declare function OutcomeBadge({ outcome, label }: {
|
|
40
|
+
outcome: DealOutcome;
|
|
41
|
+
label: string;
|
|
42
|
+
}): import("react").JSX.Element;
|
|
43
|
+
export declare function InvoiceStatusBadge({ status, overdue }: {
|
|
44
|
+
status: InvoiceStatus;
|
|
45
|
+
overdue?: boolean;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
47
|
+
/** The words for figures in `period`: what each change is against. */
|
|
48
|
+
export declare const periodText: (period: ReportingPeriod, text?: Partial<CrmText>) => Partial<CrmText>;
|
|
49
|
+
/** Picks the reporting period a view's figures are for. */
|
|
50
|
+
export declare function PeriodSelect({ value, onChange, text, }: {
|
|
51
|
+
value: ReportingPeriod;
|
|
52
|
+
onChange: (period: ReportingPeriod) => void;
|
|
53
|
+
text?: Partial<CrmText> | undefined;
|
|
54
|
+
}): import("react").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","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CAAA;CAAE,+BAUpH;AAUD,oGAAoG;AACpG,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,+BAGvD;AAED,mHAAmH;AACnH,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAEvF;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,+BASnG;AAQD,sEAAsE;AACtE,eAAO,MAAM,UAAU,GAAI,QAAQ,eAAe,EAAE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAG,OAAO,CAAC,OAAO,CAG3F,CAAC;AAEH,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACrC,+BAoBA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FlaskConical, TrendingDown, TrendingUp } from 'lucide-react';
|
|
3
|
+
import { cn } from 'cn';
|
|
4
|
+
import { useContext, useId } from 'react';
|
|
5
|
+
import { INVOICE_STATUS_LABELS } from "../invoices.js";
|
|
6
|
+
import { LEAD_STATE_LABELS, leadState } from "../leads.js";
|
|
7
|
+
import { REPORTING_PERIODS } from "../period.js";
|
|
8
|
+
import { formatChange } from "./format.js";
|
|
9
|
+
import { PanelClose, PanelCloseButton } from "./SidePanel.js";
|
|
10
|
+
import { withText } from "./text.js";
|
|
11
|
+
import { Badge } from "./ui/badge.js";
|
|
12
|
+
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card.js";
|
|
13
|
+
import { Label } from "./ui/label.js";
|
|
14
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select.js";
|
|
15
|
+
/** Marks a view or card whose records come from sample data, so nobody takes them for real ones. */
|
|
16
|
+
export function SampleDataBadge({ text }) {
|
|
17
|
+
const words = withText(text);
|
|
18
|
+
return (_jsxs(Badge, { variant: "outline", title: words.sampleDataHint, className: "gap-1 border-dashed", children: [_jsx(FlaskConical, { "aria-hidden": "true" }), words.sampleData] }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Says once, above a view, which of its concepts come from sample data, rather than a badge on every card.
|
|
22
|
+
*/
|
|
23
|
+
export function SampleDataNotice({ concepts, text, }) {
|
|
24
|
+
const words = withText(text);
|
|
25
|
+
if (concepts.length === 0)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsxs("p", { className: cn('bg-muted/50 text-muted-foreground flex flex-wrap items-center gap-2', 'rounded-lg border border-dashed px-3 py-2 text-sm'), children: [_jsx(FlaskConical, { "aria-hidden": "true", className: "size-4 shrink-0" }), _jsxs("span", { children: [_jsxs("span", { className: "text-foreground font-medium", children: [words.sampleData, ":"] }), " ", concepts.join(', '), ".", ' ', words.sampleDataHint] })] }));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A titled card for the CRM views. `sample` adds the sample data badge; `action` sits at the top right. In a side
|
|
31
|
+
* panel, the panel's close button sits there too, in line with the title; cards inside this one don't repeat it.
|
|
32
|
+
*/
|
|
33
|
+
export function CrmCard({ title, description, sample, action, text, className, children, }) {
|
|
34
|
+
const inPanel = useContext(PanelClose) !== undefined;
|
|
35
|
+
return (_jsxs(Card, { className: className, children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: _jsx("h2", { className: "text-base font-semibold", children: title }) }), description && _jsx(CardDescription, { children: description }), (sample || action || inPanel) && (_jsxs(CardAction, { className: "flex items-center gap-2", children: [sample && _jsx(SampleDataBadge, { text: text }), action, _jsx(PanelCloseButton, {})] }))] }), _jsx(CardContent, { children: _jsx(PanelClose.Provider, { value: undefined, children: children }) })] }));
|
|
36
|
+
}
|
|
37
|
+
/** A rise or fall against the previous period, in words and an icon, not colour alone. */
|
|
38
|
+
export function ChangeIndicator({ change, text }) {
|
|
39
|
+
const words = withText(text);
|
|
40
|
+
if (change === undefined)
|
|
41
|
+
return _jsx("span", { className: "text-muted-foreground text-xs", children: words.noChange });
|
|
42
|
+
const Icon = change < 0 ? TrendingDown : TrendingUp;
|
|
43
|
+
return (_jsxs("span", { className: "text-muted-foreground inline-flex items-center gap-1 text-xs", children: [_jsx(Icon, { "aria-hidden": "true", className: cn('size-3.5', change < 0 ? 'text-destructive' : 'text-primary') }), _jsx("span", { className: "text-foreground font-medium", children: formatChange(change) }), " ", words.vsPrevious] }));
|
|
44
|
+
}
|
|
45
|
+
const LEAD_VARIANT = {
|
|
46
|
+
NEW: 'default',
|
|
47
|
+
CONTACTED: 'secondary',
|
|
48
|
+
QUALIFIED: 'secondary',
|
|
49
|
+
CLOSED: 'outline',
|
|
50
|
+
CONVERTED: 'outline',
|
|
51
|
+
};
|
|
52
|
+
/** Where a lead stands: how it ended once closed (converted, unqualified), otherwise its status. */
|
|
53
|
+
export function LeadStatusBadge({ lead }) {
|
|
54
|
+
const state = leadState(lead);
|
|
55
|
+
return _jsx(Badge, { variant: LEAD_VARIANT[state], children: LEAD_STATE_LABELS[state] });
|
|
56
|
+
}
|
|
57
|
+
/** How a deal stands, in words. Lost is outlined rather than red, which lacks contrast on tinted board columns. */
|
|
58
|
+
export function OutcomeBadge({ outcome, label }) {
|
|
59
|
+
return _jsx(Badge, { variant: outcome === 'WON' ? 'default' : outcome === 'LOST' ? 'outline' : 'secondary', children: label });
|
|
60
|
+
}
|
|
61
|
+
export function InvoiceStatusBadge({ status, overdue }) {
|
|
62
|
+
if (overdue)
|
|
63
|
+
return _jsx(Badge, { variant: "destructive", children: "Overdue" });
|
|
64
|
+
return (_jsx(Badge, { variant: status === 'PAID' ? 'default' : status === 'DRAFT' || status === 'VOIDED' ? 'outline' : 'secondary', children: INVOICE_STATUS_LABELS[status] }));
|
|
65
|
+
}
|
|
66
|
+
const PERIOD_WORDS = {
|
|
67
|
+
last30: { label: 'periodLast30', versus: 'vsPrevious30' },
|
|
68
|
+
quarter: { label: 'periodQuarter', versus: 'vsLastQuarter' },
|
|
69
|
+
year: { label: 'periodYear', versus: 'vsLastYear' },
|
|
70
|
+
};
|
|
71
|
+
/** The words for figures in `period`: what each change is against. */
|
|
72
|
+
export const periodText = (period, text) => ({
|
|
73
|
+
...text,
|
|
74
|
+
vsPrevious: withText(text)[PERIOD_WORDS[period].versus],
|
|
75
|
+
});
|
|
76
|
+
/** Picks the reporting period a view's figures are for. */
|
|
77
|
+
export function PeriodSelect({ value, onChange, text, }) {
|
|
78
|
+
const words = withText(text);
|
|
79
|
+
const id = useId();
|
|
80
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Label, { htmlFor: id, children: words.period }), _jsxs(Select, { value: value, onValueChange: (next) => onChange(next), children: [_jsx(SelectTrigger, { id: id, className: "w-40", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: REPORTING_PERIODS.map((period) => (_jsx(SelectItem, { value: period, children: words[PERIOD_WORDS[period].label] }, period))) })] })] }));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/react/parts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAkB,MAAM,OA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M,YACrC,KAAC,WAAW,KAAG,GACD,EAChB,KAAC,aAAa,cACX,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACjC,KAAC,UAAU,IAAc,KAAK,EAAE,MAAM,YACnC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IADnB,MAAM,CAEV,CACd,CAAC,GACY,IACT,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Deal, Pipeline } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* What this user last chose in the deals, per company, kept in the browser: the workflow they work in (shared by the
|
|
4
|
+
* dashboard, converting leads and the deals board) and the board's order. One record, so each writer keeps the other's.
|
|
5
|
+
*/
|
|
6
|
+
export interface DealsMemory {
|
|
7
|
+
pipeline?: string | undefined;
|
|
8
|
+
order?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function recallDeals(owner: string): DealsMemory;
|
|
11
|
+
/** Keeps `changes`, merged into what's stored, so a change to one field never puts back an old value of another. */
|
|
12
|
+
export declare function rememberDeals(owner: string, changes: DealsMemory): void;
|
|
13
|
+
/**
|
|
14
|
+
* The pipeline this user works in, for the company `owner`: the one they last chose (their team may work in a
|
|
15
|
+
* different workflow from other users'), else the default (`defaultPipeline`: the workflow with the most deals).
|
|
16
|
+
* Choosing one remembers it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePipeline(owner: string, pipelines: readonly Pipeline[], deals: readonly Deal[]): [Pipeline | undefined, (urn: string) => void];
|
|
19
|
+
//# sourceMappingURL=pipeline-choice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-choice.d.ts","sourceRoot":"","sources":["../../src/react/pipeline-choice.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAWtD;AAED,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAMvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,KAAK,EAAE,SAAS,IAAI,EAAE,GACrB,CAAC,QAAQ,GAAG,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,CAO/C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { defaultPipeline } from "../pipeline.js";
|
|
3
|
+
const memoryKey = (owner) => `baack-crm:deals-board:${owner}`;
|
|
4
|
+
export function recallDeals(owner) {
|
|
5
|
+
try {
|
|
6
|
+
const saved = JSON.parse(localStorage.getItem(memoryKey(owner)) ?? '{}');
|
|
7
|
+
return {
|
|
8
|
+
pipeline: typeof saved.pipeline === 'string' ? saved.pipeline : undefined,
|
|
9
|
+
order: typeof saved.order === 'string' ? saved.order : undefined,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// No storage (private browsing, blocked, or no browser): start afresh.
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** Keeps `changes`, merged into what's stored, so a change to one field never puts back an old value of another. */
|
|
18
|
+
export function rememberDeals(owner, changes) {
|
|
19
|
+
try {
|
|
20
|
+
localStorage.setItem(memoryKey(owner), JSON.stringify({ ...recallDeals(owner), ...changes }));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Not kept; the views still work.
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The pipeline this user works in, for the company `owner`: the one they last chose (their team may work in a
|
|
28
|
+
* different workflow from other users'), else the default (`defaultPipeline`: the workflow with the most deals).
|
|
29
|
+
* Choosing one remembers it.
|
|
30
|
+
*/
|
|
31
|
+
export function usePipeline(owner, pipelines, deals) {
|
|
32
|
+
const [chosen, setChosen] = useState(() => recallDeals(owner).pipeline);
|
|
33
|
+
const choose = (urn) => {
|
|
34
|
+
setChosen(urn);
|
|
35
|
+
rememberDeals(owner, { pipeline: urn });
|
|
36
|
+
};
|
|
37
|
+
return [defaultPipeline(pipelines, deals, chosen), choose];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=pipeline-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-choice.js","sourceRoot":"","sources":["../../src/react/pipeline-choice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAYjD,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,yBAAyB,KAAK,EAAE,CAAC;AAEtE,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAA4C,CAAC;QACpH,OAAO;YACL,QAAQ,EAAE,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACzE,KAAK,EAAE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SACjE,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;QACvE,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,OAAoB;IAC/D,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IAAC,MAAM,CAAC;QACP,kCAAkC;IACpC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACzB,KAAa,EACb,SAA8B,EAC9B,KAAsB;IAEtB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE;QAC7B,SAAS,CAAC,GAAG,CAAC,CAAC;QACf,aAAa,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC;IACF,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the CRM components show, in en-GB. Each composition takes `text` to replace any of them, so a host can
|
|
3
|
+
* supply its own copy (later from Baack content).
|
|
4
|
+
*/
|
|
5
|
+
export declare const CRM_TEXT: {
|
|
6
|
+
readonly sampleData: "Sample data";
|
|
7
|
+
readonly sampleDataHint: "Not yet in the Baack API: shown from sample data so the view can be reviewed.";
|
|
8
|
+
readonly unavailable: "Not available yet";
|
|
9
|
+
readonly loading: "Loading";
|
|
10
|
+
readonly noChange: "No earlier figures";
|
|
11
|
+
readonly vsPrevious: "vs previous period";
|
|
12
|
+
readonly vsPrevious30: "vs the 30 days before";
|
|
13
|
+
readonly vsLastQuarter: "vs the same time last quarter";
|
|
14
|
+
readonly vsLastYear: "vs the same time last year";
|
|
15
|
+
readonly customers: "Customers";
|
|
16
|
+
readonly customersHint: "Companies with a won deal";
|
|
17
|
+
readonly openDeals: "Open deals";
|
|
18
|
+
readonly revenue: "Revenue";
|
|
19
|
+
readonly revenueHint: "Payments received less refunds";
|
|
20
|
+
readonly revenueOverTime: "Revenue over time";
|
|
21
|
+
readonly newLeads: "New leads";
|
|
22
|
+
readonly target: "Sales target";
|
|
23
|
+
readonly targetSummary: "Payments received on deals against the value of leads and deals";
|
|
24
|
+
readonly targetReceived: "received of";
|
|
25
|
+
readonly leadsBySource: "Leads by source";
|
|
26
|
+
readonly pipeline: "Sales pipeline";
|
|
27
|
+
readonly stage: "Stage";
|
|
28
|
+
readonly workflow: "Workflow";
|
|
29
|
+
readonly deals: "Deals";
|
|
30
|
+
readonly value: "Value";
|
|
31
|
+
readonly weighted: "Weighted";
|
|
32
|
+
readonly share: "Share";
|
|
33
|
+
readonly leads: "Leads";
|
|
34
|
+
readonly lead: "Lead";
|
|
35
|
+
readonly company: "Company";
|
|
36
|
+
readonly contact: "Contact";
|
|
37
|
+
readonly source: "Source";
|
|
38
|
+
readonly status: "Status";
|
|
39
|
+
readonly date: "Date";
|
|
40
|
+
readonly assignee: "Assignee";
|
|
41
|
+
readonly filterLeads: "Filter leads";
|
|
42
|
+
readonly allStatuses: "All statuses";
|
|
43
|
+
readonly allSources: "All sources";
|
|
44
|
+
readonly export: "Export CSV";
|
|
45
|
+
readonly previous: "Previous";
|
|
46
|
+
readonly next: "Next";
|
|
47
|
+
readonly noLeads: "No leads match.";
|
|
48
|
+
readonly of: "of";
|
|
49
|
+
readonly open: "Open";
|
|
50
|
+
readonly close: "Close";
|
|
51
|
+
readonly moveTo: "Move to stage";
|
|
52
|
+
readonly expectedClose: "Expected close";
|
|
53
|
+
readonly closed: "Closed";
|
|
54
|
+
readonly lostReason: "Lost reason";
|
|
55
|
+
readonly outcome: "Outcome";
|
|
56
|
+
readonly outcomeOpen: "Open";
|
|
57
|
+
readonly outcomeWon: "Won";
|
|
58
|
+
readonly outcomeLost: "Lost";
|
|
59
|
+
readonly markLost: "Mark as lost";
|
|
60
|
+
readonly markUnqualified: "Mark unqualified";
|
|
61
|
+
readonly unqualifiedReason: "Why it was unqualified";
|
|
62
|
+
readonly reopen: "Reopen";
|
|
63
|
+
readonly cancel: "Cancel";
|
|
64
|
+
readonly probability: "Probability";
|
|
65
|
+
readonly convert: "Convert to deal";
|
|
66
|
+
readonly converting: "Converting";
|
|
67
|
+
readonly convertSummary: "Qualify the lead: it becomes a deal at the first stage of the pipeline.";
|
|
68
|
+
readonly companyName: "Company name";
|
|
69
|
+
readonly companyNameHint: "Creates the client company. Leave it empty for a person buying for themselves.";
|
|
70
|
+
readonly convertedTo: "Converted to";
|
|
71
|
+
readonly created: "Created";
|
|
72
|
+
readonly noDeals: "No deals here.";
|
|
73
|
+
readonly account: "Account";
|
|
74
|
+
readonly openValue: "Open deals";
|
|
75
|
+
readonly wonValue: "Won";
|
|
76
|
+
readonly outstanding: "Outstanding";
|
|
77
|
+
readonly overdue: "Overdue";
|
|
78
|
+
readonly received: "Received";
|
|
79
|
+
readonly invoices: "Invoices";
|
|
80
|
+
readonly invoice: "Invoice";
|
|
81
|
+
readonly total: "Total";
|
|
82
|
+
readonly due: "Due";
|
|
83
|
+
readonly paid: "Paid";
|
|
84
|
+
readonly payments: "Payments";
|
|
85
|
+
readonly method: "Method";
|
|
86
|
+
readonly reference: "Reference";
|
|
87
|
+
readonly amount: "Amount";
|
|
88
|
+
readonly noInvoices: "No invoices.";
|
|
89
|
+
readonly noPayments: "No payments.";
|
|
90
|
+
readonly openLeads: "Open leads";
|
|
91
|
+
readonly people: "People";
|
|
92
|
+
readonly sales: "Sales";
|
|
93
|
+
readonly invoiced: "Invoiced";
|
|
94
|
+
readonly invoicedHint: "Invoices issued in the period";
|
|
95
|
+
readonly salesTax: "Sales tax";
|
|
96
|
+
readonly salesTaxHint: "On invoices issued in the period";
|
|
97
|
+
readonly outstandingHint: "Still to pay on invoices sent";
|
|
98
|
+
readonly outstandingByAge: "Outstanding by age";
|
|
99
|
+
readonly paymentMethods: "Payments by method";
|
|
100
|
+
readonly customer: "Customer";
|
|
101
|
+
readonly issued: "Issued";
|
|
102
|
+
readonly filterInvoices: "Filter invoices";
|
|
103
|
+
readonly allInvoices: "All invoices";
|
|
104
|
+
readonly awaitingPayment: "Awaiting payment";
|
|
105
|
+
readonly noMatchingInvoices: "No invoices match.";
|
|
106
|
+
readonly recordPayment: "Record payment";
|
|
107
|
+
readonly recording: "Recording";
|
|
108
|
+
readonly paymentRecorded: "Payment recorded.";
|
|
109
|
+
readonly invalidAmount: "Enter an amount above zero, such as 120.00.";
|
|
110
|
+
readonly tasks: "Tasks";
|
|
111
|
+
readonly none: "None";
|
|
112
|
+
readonly unnamed: "Unnamed";
|
|
113
|
+
readonly newLead: "New lead";
|
|
114
|
+
readonly newDeal: "New deal";
|
|
115
|
+
readonly newInvoice: "New invoice";
|
|
116
|
+
readonly title: "Title";
|
|
117
|
+
readonly titleRequired: "Enter a title.";
|
|
118
|
+
readonly noCompany: "No company";
|
|
119
|
+
readonly newCompany: "New company";
|
|
120
|
+
readonly newCompanyHint: "Makes the client company, owned by yours, when the lead is saved.";
|
|
121
|
+
readonly addCompany: "Add a new company";
|
|
122
|
+
readonly companyNameRequired: "Enter the company name.";
|
|
123
|
+
readonly noContact: "No contact";
|
|
124
|
+
readonly newContact: "New contact";
|
|
125
|
+
readonly newContactHint: "Makes a person owned by your company when the lead is saved, linked to the lead's company when it has one.";
|
|
126
|
+
readonly addContact: "Add a new person";
|
|
127
|
+
readonly addPerson: "Add a person";
|
|
128
|
+
readonly givenName: "Given name";
|
|
129
|
+
readonly familyName: "Family name";
|
|
130
|
+
readonly email: "Email";
|
|
131
|
+
readonly givenNameRequired: "Enter a given name.";
|
|
132
|
+
readonly telephone: "Telephone";
|
|
133
|
+
readonly contactDetails: "Contact's details";
|
|
134
|
+
readonly contactEmail: "Contact's email";
|
|
135
|
+
readonly contactTelephone: "Contact's telephone";
|
|
136
|
+
readonly contactDetailsUnavailable: "The contact's email and telephone couldn't be read.";
|
|
137
|
+
readonly unassigned: "Unassigned";
|
|
138
|
+
readonly toBeCreated: "new";
|
|
139
|
+
readonly useThis: "Use this";
|
|
140
|
+
readonly saving: "Saving";
|
|
141
|
+
readonly back: "Back";
|
|
142
|
+
readonly saveFailed: "The change couldn't be saved.";
|
|
143
|
+
readonly createLead: "Create lead";
|
|
144
|
+
readonly createDeal: "Create deal";
|
|
145
|
+
readonly createInvoice: "Create invoice";
|
|
146
|
+
readonly creating: "Creating";
|
|
147
|
+
readonly currency: "Currency";
|
|
148
|
+
readonly issuedOn: "Issued on";
|
|
149
|
+
readonly dueOn: "Due on";
|
|
150
|
+
readonly forDeal: "For deal";
|
|
151
|
+
readonly noDeal: "No deal";
|
|
152
|
+
readonly lines: "Lines";
|
|
153
|
+
readonly description: "Description";
|
|
154
|
+
readonly quantity: "Quantity";
|
|
155
|
+
readonly unitPrice: "Unit price";
|
|
156
|
+
readonly addLine: "Add a line";
|
|
157
|
+
readonly removeLine: "Remove line";
|
|
158
|
+
readonly taxRate: "Tax rate (%)";
|
|
159
|
+
readonly subTotal: "Subtotal";
|
|
160
|
+
readonly tax: "Tax";
|
|
161
|
+
readonly customerRequired: "Choose the customer.";
|
|
162
|
+
readonly amountAs: "Amount as";
|
|
163
|
+
readonly amountAsLines: "Line items";
|
|
164
|
+
readonly amountAsTotal: "A total";
|
|
165
|
+
readonly totalWithTax: "Total, including tax";
|
|
166
|
+
readonly totalHint: "The subtotal and tax are worked out from it at the tax rate.";
|
|
167
|
+
readonly totalRequired: "Enter the total, above zero, such as 1,200.00.";
|
|
168
|
+
readonly linesRequired: "Give each line a description, a quantity and a unit price above zero.";
|
|
169
|
+
readonly invalidRate: "Enter a tax rate from 0 to 100.";
|
|
170
|
+
readonly invalidProbability: "Enter a probability from 0 to 100.";
|
|
171
|
+
readonly companies: "Companies";
|
|
172
|
+
readonly contacts: "Contacts";
|
|
173
|
+
readonly searchCompanies: "Search companies by name";
|
|
174
|
+
readonly searchContacts: "Search people by name, email or telephone";
|
|
175
|
+
readonly chosen: "Chosen";
|
|
176
|
+
readonly remove: "Remove";
|
|
177
|
+
readonly noMatches: "No matches.";
|
|
178
|
+
readonly filterDeals: "Filter deals";
|
|
179
|
+
readonly allOutcomes: "All outcomes";
|
|
180
|
+
readonly anyone: "Anyone";
|
|
181
|
+
readonly allCompanies: "All companies";
|
|
182
|
+
readonly clearFilters: "Clear filters";
|
|
183
|
+
readonly sortBy: "Sort by";
|
|
184
|
+
readonly orderWeighted: "Weighted";
|
|
185
|
+
readonly orderSize: "Deal size";
|
|
186
|
+
readonly orderUrgency: "Urgency";
|
|
187
|
+
readonly dealsShown: "deals shown";
|
|
188
|
+
readonly remitter: "Remitter: who pays";
|
|
189
|
+
readonly remitterCompany: "Company that pays";
|
|
190
|
+
readonly remitterPerson: "Person who pays";
|
|
191
|
+
readonly recipient: "Recipient: who is paid";
|
|
192
|
+
readonly recipientCompany: "Company paid";
|
|
193
|
+
readonly recipientPerson: "Person who is paid";
|
|
194
|
+
readonly recipientHint: "Usually your company, or one of its companies; another company for an invoice you pay.";
|
|
195
|
+
readonly remitterRequired: "Choose the company or person who pays.";
|
|
196
|
+
readonly recipientRequired: "Choose the company or person who is paid.";
|
|
197
|
+
readonly searchPeople: "Search people by name, email or telephone";
|
|
198
|
+
readonly noPerson: "No person";
|
|
199
|
+
readonly line: "Line";
|
|
200
|
+
readonly lineDetails: "All fields";
|
|
201
|
+
readonly itemCode: "Item code";
|
|
202
|
+
readonly discountRate: "Discount (%)";
|
|
203
|
+
readonly taxability: "Tax treatment";
|
|
204
|
+
readonly taxName: "Tax name";
|
|
205
|
+
readonly price: "Price";
|
|
206
|
+
readonly done: "Done";
|
|
207
|
+
readonly invalidDiscount: "Enter a discount from 0 to 100.";
|
|
208
|
+
readonly costs: "Costs";
|
|
209
|
+
readonly costsHint: "Invoices you pay, issued in the period";
|
|
210
|
+
readonly toPay: "To pay";
|
|
211
|
+
readonly party: "Customer or supplier";
|
|
212
|
+
readonly paidBy: "Paid by";
|
|
213
|
+
readonly paidTo: "Paid to";
|
|
214
|
+
readonly allKinds: "Sales and costs";
|
|
215
|
+
readonly salesOnly: "Sales";
|
|
216
|
+
readonly costsOnly: "Costs";
|
|
217
|
+
readonly cost: "Cost";
|
|
218
|
+
readonly drafts: "Drafts";
|
|
219
|
+
readonly draftsHint: "Not yet sent, so not counted above";
|
|
220
|
+
readonly draftInvoice: "draft invoice";
|
|
221
|
+
readonly draftInvoices: "draft invoices";
|
|
222
|
+
readonly period: "Period";
|
|
223
|
+
readonly periodLast30: "Last 30 days";
|
|
224
|
+
readonly periodQuarter: "This quarter";
|
|
225
|
+
readonly periodYear: "This year";
|
|
226
|
+
};
|
|
227
|
+
export type CrmText = {
|
|
228
|
+
readonly [K in keyof typeof CRM_TEXT]: string;
|
|
229
|
+
};
|
|
230
|
+
/** The default words with a host's replacements. */
|
|
231
|
+
export declare const withText: (text?: Partial<CrmText>) => CrmText;
|
|
232
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/react/text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8NX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,MAAM;CAAE,CAAC;AAExE,oDAAoD;AACpD,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,CAAC,OAAO,CAAC,KAAG,OAAuD,CAAC"}
|