@dapplelight/signet-lib 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +233 -2
- package/dist/analytics/index.d.ts +35 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +104 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/api/client.d.ts +24 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +123 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/codes.d.ts +4 -0
- package/dist/api/codes.d.ts.map +1 -0
- package/dist/api/codes.js +24 -0
- package/dist/api/codes.js.map +1 -0
- package/dist/api/contract.d.ts +12 -0
- package/dist/api/contract.d.ts.map +1 -0
- package/dist/api/contract.js +7 -0
- package/dist/api/contract.js.map +1 -0
- package/dist/api/copy.d.ts +13 -0
- package/dist/api/copy.d.ts.map +1 -0
- package/dist/api/copy.js +87 -0
- package/dist/api/copy.js.map +1 -0
- package/dist/api/errors.d.ts +20 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +33 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/query-client.d.ts +19 -0
- package/dist/api/query-client.d.ts.map +1 -0
- package/dist/api/query-client.js +52 -0
- package/dist/api/query-client.js.map +1 -0
- package/dist/crypto/index.d.ts +10 -0
- package/dist/crypto/index.d.ts.map +1 -0
- package/dist/crypto/index.js +85 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/form/index.d.ts +26 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +73 -0
- package/dist/form/index.js.map +1 -0
- package/dist/format/date.d.ts +14 -0
- package/dist/format/date.d.ts.map +1 -0
- package/dist/format/date.js +109 -0
- package/dist/format/date.js.map +1 -0
- package/dist/format/index.d.ts +10 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +113 -0
- package/dist/format/index.js.map +1 -0
- package/package.json +79 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Amount = number | string;
|
|
2
|
+
export declare function createCurrencyFormatter(currency?: string, locale?: string): (amount: Amount, exact?: boolean) => string;
|
|
3
|
+
export declare function createCompactCurrencyFormatter(currency?: string, locale?: string, decimals?: number): (amount: Amount) => string;
|
|
4
|
+
export declare function formatPercent(value: Amount, decimals?: number): string;
|
|
5
|
+
export declare function createDateFormatter(locale?: string): (date: string | Date | number) => string;
|
|
6
|
+
export declare function createDateShortFormatter(locale?: string): (date: string | Date | number) => string;
|
|
7
|
+
export declare function createDateTimeFormatter(locale?: string): (date: string | Date | number) => string;
|
|
8
|
+
export declare function createRelativeTimeFormatter(locale?: string): (date: string | Date | number, now?: Date) => string;
|
|
9
|
+
export { addDays, addMonths, type DateInput, differenceInCalendarDays, endOfMonth, isSameDay, isSameMonth, parseDateOnly, startOfDay, startOfMonth, startOfYear, toDateOnly, } from "./date.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAQpC,wBAAgB,uBAAuB,CAAC,QAAQ,SAAQ,EAAE,MAAM,SAAU,YAaxD,MAAM,sBAAkB,MAAM,CAK/C;AAWD,wBAAgB,8BAA8B,CAAC,QAAQ,SAAQ,EAAE,MAAM,SAAU,EAAE,QAAQ,SAAI,YAS3E,MAAM,KAAG,MAAM,CAqBlC;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAIjE;AAQD,wBAAgB,mBAAmB,CAAC,MAAM,SAAU,UAEpC,MAAM,GAAG,IAAI,GAAG,MAAM,KAAG,MAAM,CAI9C;AAGD,wBAAgB,wBAAwB,CAAC,MAAM,SAAU,UAEzC,MAAM,GAAG,IAAI,GAAG,MAAM,KAAG,MAAM,CAI9C;AAED,wBAAgB,uBAAuB,CAAC,MAAM,SAAU,UAQxC,MAAM,GAAG,IAAI,GAAG,MAAM,KAAG,MAAM,CAI9C;AAGD,wBAAgB,2BAA2B,CAAC,MAAM,SAAU,UAW5C,MAAM,GAAG,IAAI,GAAG,MAAM,QAAO,IAAI,KAAgB,MAAM,CAWtE;AAED,OAAO,EACL,OAAO,EACP,SAAS,EACT,KAAK,SAAS,EACd,wBAAwB,EACxB,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { toDate } from "./date.js";
|
|
2
|
+
const toNumber = (v) => (typeof v === "string" ? Number.parseFloat(v) : v);
|
|
3
|
+
export function createCurrencyFormatter(currency = "INR", locale = "en-IN") {
|
|
4
|
+
const whole = new Intl.NumberFormat(locale, {
|
|
5
|
+
style: "currency",
|
|
6
|
+
currency,
|
|
7
|
+
minimumFractionDigits: 0,
|
|
8
|
+
maximumFractionDigits: 0,
|
|
9
|
+
});
|
|
10
|
+
const precise = new Intl.NumberFormat(locale, {
|
|
11
|
+
style: "currency",
|
|
12
|
+
currency,
|
|
13
|
+
minimumFractionDigits: 2,
|
|
14
|
+
maximumFractionDigits: 2,
|
|
15
|
+
});
|
|
16
|
+
return (amount, exact = false) => {
|
|
17
|
+
const n = toNumber(amount);
|
|
18
|
+
if (!Number.isFinite(n))
|
|
19
|
+
return (exact ? precise : whole).format(0);
|
|
20
|
+
return (exact ? precise : whole).format(n);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const trim = (n, decimals) => n.toFixed(decimals).replace(/\.?0+$/, "");
|
|
24
|
+
export function createCompactCurrencyFormatter(currency = "INR", locale = "en-IN", decimals = 1) {
|
|
25
|
+
const full = createCurrencyFormatter(currency, locale);
|
|
26
|
+
const usesLakhCrore = /^(en-IN|hi|bn|ta|te|mr|gu|kn|ml|pa)\b/.test(locale);
|
|
27
|
+
if (usesLakhCrore) {
|
|
28
|
+
const symbol = new Intl.NumberFormat(locale, { style: "currency", currency })
|
|
29
|
+
.formatToParts(0)
|
|
30
|
+
.find((p) => p.type === "currency")?.value ?? "";
|
|
31
|
+
return (amount) => {
|
|
32
|
+
const n = toNumber(amount);
|
|
33
|
+
if (!Number.isFinite(n))
|
|
34
|
+
return full(0);
|
|
35
|
+
const sign = n < 0 ? "-" : "";
|
|
36
|
+
const abs = Math.abs(n);
|
|
37
|
+
if (abs >= 1e7)
|
|
38
|
+
return `${sign}${symbol}${trim(abs / 1e7, decimals)}Cr`;
|
|
39
|
+
if (abs >= 1e5)
|
|
40
|
+
return `${sign}${symbol}${trim(abs / 1e5, decimals)}L`;
|
|
41
|
+
return full(n);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const fmt = new Intl.NumberFormat(locale, {
|
|
45
|
+
style: "currency",
|
|
46
|
+
currency,
|
|
47
|
+
notation: "compact",
|
|
48
|
+
maximumFractionDigits: decimals,
|
|
49
|
+
});
|
|
50
|
+
return (amount) => {
|
|
51
|
+
const n = toNumber(amount);
|
|
52
|
+
return Number.isFinite(n) ? fmt.format(n) : fmt.format(0);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function formatPercent(value, decimals = 1) {
|
|
56
|
+
const n = toNumber(value);
|
|
57
|
+
if (!Number.isFinite(n))
|
|
58
|
+
return "0%";
|
|
59
|
+
return `${n >= 0 ? "+" : ""}${n.toFixed(decimals)}%`;
|
|
60
|
+
}
|
|
61
|
+
export function createDateFormatter(locale = "en-IN") {
|
|
62
|
+
const fmt = new Intl.DateTimeFormat(locale, { day: "numeric", month: "short", year: "numeric" });
|
|
63
|
+
return (date) => {
|
|
64
|
+
const d = toDate(date);
|
|
65
|
+
return Number.isNaN(d.getTime()) ? "" : fmt.format(d);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function createDateShortFormatter(locale = "en-IN") {
|
|
69
|
+
const fmt = new Intl.DateTimeFormat(locale, { day: "numeric", month: "short" });
|
|
70
|
+
return (date) => {
|
|
71
|
+
const d = toDate(date);
|
|
72
|
+
return Number.isNaN(d.getTime()) ? "" : fmt.format(d);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function createDateTimeFormatter(locale = "en-IN") {
|
|
76
|
+
const fmt = new Intl.DateTimeFormat(locale, {
|
|
77
|
+
day: "numeric",
|
|
78
|
+
month: "short",
|
|
79
|
+
year: "numeric",
|
|
80
|
+
hour: "numeric",
|
|
81
|
+
minute: "2-digit",
|
|
82
|
+
});
|
|
83
|
+
return (date) => {
|
|
84
|
+
const d = toDate(date);
|
|
85
|
+
return Number.isNaN(d.getTime()) ? "" : fmt.format(d);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export function createRelativeTimeFormatter(locale = "en-IN") {
|
|
89
|
+
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
|
|
90
|
+
const units = [
|
|
91
|
+
["year", 31_536_000_000],
|
|
92
|
+
["month", 2_592_000_000],
|
|
93
|
+
["week", 604_800_000],
|
|
94
|
+
["day", 86_400_000],
|
|
95
|
+
["hour", 3_600_000],
|
|
96
|
+
["minute", 60_000],
|
|
97
|
+
["second", 1000],
|
|
98
|
+
];
|
|
99
|
+
return (date, now = new Date()) => {
|
|
100
|
+
const d = toDate(date);
|
|
101
|
+
if (Number.isNaN(d.getTime()))
|
|
102
|
+
return "";
|
|
103
|
+
const diff = d.getTime() - now.getTime();
|
|
104
|
+
for (const [unit, ms] of units) {
|
|
105
|
+
if (Math.abs(diff) >= ms || unit === "second") {
|
|
106
|
+
return rtf.format(Math.round(diff / ms), unit);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return "";
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export { addDays, addMonths, differenceInCalendarDays, endOfMonth, isSameDay, isSameMonth, parseDateOnly, startOfDay, startOfMonth, startOfYear, toDateOnly, } from "./date.js";
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAIlC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAM1F,MAAM,UAAU,uBAAuB,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAM,GAAG,OAAO;IACxE,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QAC1C,KAAK,EAAE,UAAU;QACjB,QAAQ;QACR,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;KACzB,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QAC5C,KAAK,EAAE,UAAU;QACjB,QAAQ;QACR,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;KACzB,CAAC,CAAA;IACF,OAAO,CAAC,MAAc,EAAE,KAAK,GAAG,KAAK,EAAU,EAAE;QAC/C,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACnE,OAAO,CAAC,KAAK,C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U,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dapplelight/signet-lib",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Signet client primitives. API client and the wire contract.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"signet",
|
|
8
|
+
"api-client",
|
|
9
|
+
"fetch",
|
|
10
|
+
"format",
|
|
11
|
+
"react-query"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://dapplelight.github.io/signet/",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/dapplelight/signet.git",
|
|
17
|
+
"directory": "packages/lib"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/dapplelight/signet/issues"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"exports": {
|
|
25
|
+
"./api": {
|
|
26
|
+
"types": "./dist/api/index.d.ts",
|
|
27
|
+
"import": "./dist/api/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./api/query-client": {
|
|
30
|
+
"types": "./dist/api/query-client.d.ts",
|
|
31
|
+
"import": "./dist/api/query-client.js"
|
|
32
|
+
},
|
|
33
|
+
"./format": {
|
|
34
|
+
"types": "./dist/format/index.d.ts",
|
|
35
|
+
"import": "./dist/format/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./analytics": {
|
|
38
|
+
"types": "./dist/analytics/index.d.ts",
|
|
39
|
+
"import": "./dist/analytics/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./crypto": {
|
|
42
|
+
"types": "./dist/crypto/index.d.ts",
|
|
43
|
+
"import": "./dist/crypto/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./form": {
|
|
46
|
+
"types": "./dist/form/index.d.ts",
|
|
47
|
+
"import": "./dist/form/index.js"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
|
|
52
|
+
"test": "bun run test/smoke.ts && bun run test/format.ts && bun run test/date.ts && bun run test/date-only.ts America/Los_Angeles && bun run test/date-only.ts Asia/Kolkata && bun run test/analytics.ts && bun run test/form.ts && bun run test/copy.ts && bun run test/crypto.ts",
|
|
53
|
+
"build": "tsc -p tsconfig.build.json",
|
|
54
|
+
"prepublishOnly": "bun run build"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
58
|
+
"@tanstack/react-form": ">=1.0.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"@tanstack/react-query": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"@tanstack/react-form": {
|
|
65
|
+
"optional": true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@tanstack/react-form": "^1.33.5",
|
|
70
|
+
"@tanstack/react-query": "^5.103.2",
|
|
71
|
+
"@types/node": "^26.6.2",
|
|
72
|
+
"typescript": "^7.0.2",
|
|
73
|
+
"zod": "^4.6.5"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"access": "public"
|
|
77
|
+
},
|
|
78
|
+
"files": [
|
|
79
|
+
"dist"
|
|
80
|
+
]
|
|
81
|
+
}
|