react-lib-tools 0.0.21 → 0.0.23
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 +22 -3
- package/dist/{GettingStartedRoute-DmHalwMP.js → GettingStartedRoute-BqKgSm4z.js} +2 -2
- package/dist/{GettingStartedRoute-DmHalwMP.js.map → GettingStartedRoute-BqKgSm4z.js.map} +1 -1
- package/dist/{GettingStartedRoute-LGDNviy5.cjs → GettingStartedRoute-DSaANTOy.cjs} +2 -2
- package/dist/{GettingStartedRoute-LGDNviy5.cjs.map → GettingStartedRoute-DSaANTOy.cjs.map} +1 -1
- package/dist/{PageNotFound-DuD7brn5.js → PageNotFound-BOtcH9tJ.js} +2 -2
- package/dist/{PageNotFound-DuD7brn5.js.map → PageNotFound-BOtcH9tJ.js.map} +1 -1
- package/dist/{PageNotFound-DIt5wQ4x.cjs → PageNotFound-BPGCzBKX.cjs} +2 -2
- package/dist/{PageNotFound-DIt5wQ4x.cjs.map → PageNotFound-BPGCzBKX.cjs.map} +1 -1
- package/dist/{SupportRoute-B9n9OCoW.js → SupportRoute-D2h0cvHw.js} +2 -2
- package/dist/{SupportRoute-B9n9OCoW.js.map → SupportRoute-D2h0cvHw.js.map} +1 -1
- package/dist/{SupportRoute-DWEe-0A7.cjs → SupportRoute-DPwM7VJl.cjs} +2 -2
- package/dist/{SupportRoute-DWEe-0A7.cjs.map → SupportRoute-DPwM7VJl.cjs.map} +1 -1
- package/dist/{VersionsRoute-Br6RZivR.cjs → VersionsRoute-DTaE8zr5.cjs} +2 -2
- package/dist/{VersionsRoute-Br6RZivR.cjs.map → VersionsRoute-DTaE8zr5.cjs.map} +1 -1
- package/dist/{VersionsRoute-DOa8Yrmb.js → VersionsRoute-UBlVDqMh.js} +2 -2
- package/dist/{VersionsRoute-DOa8Yrmb.js.map → VersionsRoute-UBlVDqMh.js.map} +1 -1
- package/dist/{index-DleNtYr0.cjs → index-BFh5cQOB.cjs} +2 -2
- package/dist/index-BFh5cQOB.cjs.map +1 -0
- package/dist/{index-D1Hn63kY.js → index-Bh6LXsao.js} +412 -400
- package/dist/index-Bh6LXsao.js.map +1 -0
- package/dist/react-lib-tools.cjs +1 -1
- package/dist/react-lib-tools.d.ts +4 -3
- package/dist/react-lib-tools.js +1 -1
- package/package.json +7 -2
- package/scripts/compress-og-image.ts +38 -0
- package/dist/index-D1Hn63kY.js.map +0 -1
- package/dist/index-DleNtYr0.cjs.map +0 -1
package/dist/react-lib-tools.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BFh5cQOB.cjs");exports.AppRoot=e.AppRoot;exports.Block=e.Block;exports.Box=e.Box;exports.Button=e.Button;exports.Callout=e.Callout;exports.Checkbox=e.Checkbox;exports.Code=e.Code;exports.ComponentProps=e.ComponentProps;exports.ComponentPropsSection=e.ComponentPropsSection;exports.DocsSection=e.DocsSection;exports.ErrorBoundary=e.ErrorBoundary;exports.ExternalLink=e.ExternalLink;exports.Header=e.Header;exports.ImperativeHandle=e.ImperativeHandle;exports.Input=e.Input;exports.Link=e.Link;exports.LoadingSpinner=e.LoadingSpinner;exports.NavLink=e.NavLink;exports.NavSection=e.NavSection;exports.Radio=e.Radio;exports.Select=e.Select;exports.assert=e.assert;exports.cn=e.cn;exports.getIntentClassNames=e.getIntentClassNames;
|
|
2
2
|
//# sourceMappingURL=react-lib-tools.cjs.map
|
|
@@ -14,13 +14,14 @@ import { ReactNode } from 'react';
|
|
|
14
14
|
/**
|
|
15
15
|
* Displays an application shell with desktop and mobile layouts.
|
|
16
16
|
*/
|
|
17
|
-
export declare function AppRoot({ navLinks, overview, packageDescription, packageName, routes, showOpenCollectLink, versions }: {
|
|
17
|
+
export declare function AppRoot({ navLinks, overview, packageDescription, packageName, routes, showOpenCollectLink, url, versions }: {
|
|
18
18
|
navLinks: ReactNode;
|
|
19
19
|
overview?: ReactNode | undefined;
|
|
20
|
-
packageDescription:
|
|
20
|
+
packageDescription: string;
|
|
21
21
|
packageName: string;
|
|
22
22
|
routes: Record<string, LazyExoticComponent<ComponentType<unknown>>>;
|
|
23
23
|
showOpenCollectLink?: boolean | undefined;
|
|
24
|
+
url: string;
|
|
24
25
|
versions?: Versions | undefined;
|
|
25
26
|
}): JSX.Element;
|
|
26
27
|
|
|
@@ -113,7 +114,7 @@ export declare function getIntentClassNames(intent: Intent, minimal?: boolean):
|
|
|
113
114
|
|
|
114
115
|
declare function GettingStartedRoute(): JSX.Element;
|
|
115
116
|
|
|
116
|
-
export declare function Header({ section, title }: {
|
|
117
|
+
export declare function Header({ section, title: titleProp }: {
|
|
117
118
|
section?: string;
|
|
118
119
|
title: string;
|
|
119
120
|
}): JSX.Element;
|
package/dist/react-lib-tools.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-
|
|
1
|
+
import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-Bh6LXsao.js";
|
|
2
2
|
export {
|
|
3
3
|
o as AppRoot,
|
|
4
4
|
e as Block,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lib-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
|
|
6
6
|
"contributors": [
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@csstools/postcss-oklab-function": "^4.0.11",
|
|
57
57
|
"@eslint/js": "^9.30.1",
|
|
58
|
+
"@floating-ui/react": "^0.27.16",
|
|
58
59
|
"@headlessui/react": "^2.2.4",
|
|
59
60
|
"@headlessui/tailwindcss": "^0.2.2",
|
|
60
61
|
"@heroicons/react": "^2.2.0",
|
|
@@ -63,13 +64,16 @@
|
|
|
63
64
|
"@testing-library/jest-dom": "^6.6.4",
|
|
64
65
|
"@testing-library/react": "^16.3.0",
|
|
65
66
|
"@testing-library/user-event": "^14.6.1",
|
|
67
|
+
"@types/bytes": "^3.1.5",
|
|
66
68
|
"@types/compression": "^1.8.1",
|
|
67
69
|
"@types/express": "^5.0.5",
|
|
68
70
|
"@types/markdown-it": "^14.1.2",
|
|
69
71
|
"@types/node": "^24.2.0",
|
|
70
72
|
"@types/react": "^19.1.8",
|
|
71
73
|
"@types/react-dom": "^19.2.3",
|
|
74
|
+
"@types/sharp": "^0.32.0",
|
|
72
75
|
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
76
|
+
"bytes": "^3.1.2",
|
|
73
77
|
"clsx": "^2.1.1",
|
|
74
78
|
"compression": "^1.8.1",
|
|
75
79
|
"csstype": "^3.1.3",
|
|
@@ -94,6 +98,7 @@
|
|
|
94
98
|
"rollup-plugin-terser": "^7.0.2",
|
|
95
99
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
96
100
|
"rollup-preserve-directives": "^1.1.3",
|
|
101
|
+
"sharp": "^0.34.5",
|
|
97
102
|
"sirv": "^3.0.2",
|
|
98
103
|
"tailwind-merge": "^3.3.1",
|
|
99
104
|
"tailwindcss": "^4.1.11",
|
|
@@ -104,10 +109,10 @@
|
|
|
104
109
|
"typescript-eslint": "^8.35.1",
|
|
105
110
|
"typescript-json-schema": "^0.65.1",
|
|
106
111
|
"vite": "^7.0.4",
|
|
107
|
-
"vitest-fail-on-console": "^0.10.1",
|
|
108
112
|
"vite-plugin-dts": "^4.5.4",
|
|
109
113
|
"vite-plugin-svgr": "^4.3.0",
|
|
110
114
|
"vitest": "^3.2.4",
|
|
115
|
+
"vitest-fail-on-console": "^0.10.1",
|
|
111
116
|
"zustand": "^5.0.7"
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import bytes from "bytes";
|
|
2
|
+
import { stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { cwd } from "node:process";
|
|
5
|
+
import sharp from "sharp";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Compress og:image.
|
|
9
|
+
*/
|
|
10
|
+
export async function compressOgImage({
|
|
11
|
+
inputPath = ["public", "og.png"],
|
|
12
|
+
outputPath = ["public", "og.png"]
|
|
13
|
+
}: {
|
|
14
|
+
inputPath?: string[] | undefined;
|
|
15
|
+
outputPath?: string[] | undefined;
|
|
16
|
+
} = {}) {
|
|
17
|
+
const input = join(cwd(), ...inputPath);
|
|
18
|
+
const statsBefore = await stat(input);
|
|
19
|
+
|
|
20
|
+
const png = sharp(input).png({
|
|
21
|
+
quality: 100,
|
|
22
|
+
compressionLevel: 9
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const output = join(cwd(), ...outputPath);
|
|
26
|
+
const buffer = await png.toBuffer();
|
|
27
|
+
await writeFile(output, buffer, {
|
|
28
|
+
encoding: "base64"
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const statsAfter = await stat(output);
|
|
32
|
+
|
|
33
|
+
console.log(
|
|
34
|
+
"Compressed image:\n before: %s\n after: %s",
|
|
35
|
+
bytes(statsBefore.size),
|
|
36
|
+
bytes(statsAfter.size)
|
|
37
|
+
);
|
|
38
|
+
}
|