react-lib-tools 0.0.30 → 0.0.32

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.
Files changed (42) hide show
  1. package/dist/CommonQuestionsRoute-DmRskZnY.js +30 -0
  2. package/dist/{CommonQuestionsRoute-CgAJzTXe.js.map → CommonQuestionsRoute-DmRskZnY.js.map} +1 -1
  3. package/dist/CommonQuestionsRoute-woOvTCB7.cjs +2 -0
  4. package/dist/{CommonQuestionsRoute-n_iD3lwr.cjs.map → CommonQuestionsRoute-woOvTCB7.cjs.map} +1 -1
  5. package/dist/GettingStartedRoute-Bo5SxNiA.cjs +2 -0
  6. package/dist/{GettingStartedRoute-BQd7IviG.cjs.map → GettingStartedRoute-Bo5SxNiA.cjs.map} +1 -1
  7. package/dist/{GettingStartedRoute-Dxm39bWR.js → GettingStartedRoute-BwCE2V2M.js} +6 -7
  8. package/dist/{GettingStartedRoute-Dxm39bWR.js.map → GettingStartedRoute-BwCE2V2M.js.map} +1 -1
  9. package/dist/{PageNotFound-53YK_X9b.js → PageNotFound-Do-frKwc.js} +8 -9
  10. package/dist/{PageNotFound-53YK_X9b.js.map → PageNotFound-Do-frKwc.js.map} +1 -1
  11. package/dist/PageNotFound-yp0rd76-.cjs +2 -0
  12. package/dist/{PageNotFound-CDk6JhhB.cjs.map → PageNotFound-yp0rd76-.cjs.map} +1 -1
  13. package/dist/{SupportRoute-DqIjoOuN.js → SupportRoute-DEqnIuv0.js} +4 -5
  14. package/dist/{SupportRoute-DqIjoOuN.js.map → SupportRoute-DEqnIuv0.js.map} +1 -1
  15. package/dist/SupportRoute-Q9tiVrsw.cjs +2 -0
  16. package/dist/{SupportRoute-CubM7tub.cjs.map → SupportRoute-Q9tiVrsw.cjs.map} +1 -1
  17. package/dist/{VersionsRoute-CU6kCScw.js → VersionsRoute-CQdZrZ85.js} +25 -32
  18. package/dist/{VersionsRoute-CU6kCScw.js.map → VersionsRoute-CQdZrZ85.js.map} +1 -1
  19. package/dist/VersionsRoute-DJ7l0bVC.cjs +2 -0
  20. package/dist/{VersionsRoute-DhLe3vGU.cjs.map → VersionsRoute-DJ7l0bVC.cjs.map} +1 -1
  21. package/dist/{index-CplpUoHk.cjs → index-8LP1ujuh.cjs} +5 -5
  22. package/dist/index-8LP1ujuh.cjs.map +1 -0
  23. package/dist/{index-CmGluDif.js → index-BeyKcpAG.js} +1066 -1056
  24. package/dist/index-BeyKcpAG.js.map +1 -0
  25. package/dist/react-lib-tools.cjs +1 -1
  26. package/dist/react-lib-tools.d.ts +5 -5
  27. package/dist/react-lib-tools.js +6 -6
  28. package/package.json +1 -1
  29. package/scripts/utils/docs/compileComponents.ts +1 -1
  30. package/scripts/utils/docs/insertPropsMarkdown.ts +3 -1
  31. package/dist/CommonQuestionsRoute-CgAJzTXe.js +0 -31
  32. package/dist/CommonQuestionsRoute-n_iD3lwr.cjs +0 -2
  33. package/dist/GettingStartedRoute-BQd7IviG.cjs +0 -2
  34. package/dist/PageNotFound-CDk6JhhB.cjs +0 -2
  35. package/dist/SupportRoute-CubM7tub.cjs +0 -2
  36. package/dist/VersionsRoute-DhLe3vGU.cjs +0 -2
  37. package/dist/index-CmGluDif.js.map +0 -1
  38. package/dist/index-CplpUoHk.cjs.map +0 -1
  39. package/dist/useLibraryContext-BL7MB9JL.cjs +0 -2
  40. package/dist/useLibraryContext-BL7MB9JL.cjs.map +0 -1
  41. package/dist/useLibraryContext-C15B6XV-.js +0 -10
  42. package/dist/useLibraryContext-C15B6XV-.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CplpUoHk.cjs");exports.AppRoot=o.AppRoot;exports.Block=o.Block;exports.Box=o.Box;exports.Button=o.Button;exports.Callout=o.Callout;exports.Checkbox=o.Checkbox;exports.Code=o.Code;exports.ComponentProps=o.ComponentProps;exports.ComponentPropsSection=o.ComponentPropsSection;exports.DocsSection=o.DocsSection;exports.ErrorBoundary=o.ErrorBoundary;exports.ExternalLink=o.ExternalLink;exports.Header=o.Header;exports.ImperativeHandle=o.ImperativeHandle;exports.Input=o.Input;exports.Link=o.Link;exports.LoadingSpinner=o.LoadingSpinner;exports.NavLink=o.NavLink;exports.NavSection=o.NavSection;exports.Radio=o.Radio;exports.Select=o.Select;exports.Tooltip=o.Tooltip;exports.assert=o.assert;exports.cn=o.cn;exports.getIntentClassNames=o.getIntentClassNames;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-8LP1ujuh.cjs");exports.AppRoot=o.AppRoot;exports.Block=o.Block;exports.Box=o.Box;exports.Button=o.Button;exports.Callout=o.Callout;exports.Checkbox=o.Checkbox;exports.Code=o.Code;exports.ComponentProps=o.ComponentProps;exports.ComponentPropsSection=o.ComponentPropsSection;exports.DocsSection=o.DocsSection;exports.ErrorBoundary=o.ErrorBoundary;exports.ExternalLink=o.ExternalLink;exports.Header=o.Header;exports.ImperativeHandle=o.ImperativeHandle;exports.Input=o.Input;exports.Link=o.Link;exports.LoadingSpinner=o.LoadingSpinner;exports.NavLink=o.NavLink;exports.NavSection=o.NavSection;exports.Radio=o.Radio;exports.Select=o.Select;exports.Tooltip=o.Tooltip;exports.assert=o.assert;exports.cn=o.cn;exports.getIntentClassNames=o.getIntentClassNames;
2
2
  //# sourceMappingURL=react-lib-tools.cjs.map
@@ -14,12 +14,13 @@ import { ReactNode } from 'react';
14
14
  /**
15
15
  * Displays an application shell with desktop and mobile layouts.
16
16
  */
17
- export declare function AppRoot({ commonQuestions, navLinks, overview, packageDescription, packageName, routes, showOpenCollectLink, versions }: {
17
+ export declare function AppRoot({ commonQuestions, navLinks, overview, packageDescription, packageName, repositoryUrl, routes, showOpenCollectLink, versions }: {
18
18
  commonQuestions?: CommonQuestion[];
19
19
  navLinks: ReactNode;
20
20
  overview?: ReactNode | undefined;
21
21
  packageDescription: string;
22
22
  packageName: string;
23
+ repositoryUrl: string;
23
24
  routes: Record<string, LazyExoticComponent<ComponentType<unknown>>>;
24
25
  showOpenCollectLink?: boolean | undefined;
25
26
  versions?: Versions | undefined;
@@ -122,8 +123,9 @@ export declare function getIntentClassNames(intent: Intent, minimal?: boolean):
122
123
 
123
124
  declare function GettingStartedRoute(): JSX.Element;
124
125
 
125
- export declare function Header({ section, title }: {
126
+ export declare function Header({ section, sourceCodePath, title }: {
126
127
  section?: string;
128
+ sourceCodePath?: string;
127
129
  title: string;
128
130
  }): JSX.Element;
129
131
 
@@ -225,9 +227,7 @@ export declare function Tooltip({ children, className, content, showOnFocus, sho
225
227
  }>): JSX.Element;
226
228
 
227
229
  declare type Versions = {
228
- [major: string]: {
229
- [fullVersion: string]: string;
230
- };
230
+ [fullVersion: string]: string;
231
231
  };
232
232
 
233
233
  declare function VersionsRoute(): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { A as o, b as e, B as n, c as t, C as r, d as i, e as p, k as c, l, D as d, f as C, E as k, H as m, I as B, g as S, h as u, i as x, N as I, j as L, R as N, m as g, T as v, a as E, n as H, o as R } from "./index-CmGluDif.js";
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, T as v, l as E, m as H, n as R } from "./index-BeyKcpAG.js";
2
2
  export {
3
3
  o as AppRoot,
4
4
  e as Block,
@@ -14,11 +14,11 @@ export {
14
14
  k as ExternalLink,
15
15
  m as Header,
16
16
  B as ImperativeHandle,
17
- S as Input,
18
- u as Link,
19
- x as LoadingSpinner,
20
- I as NavLink,
21
- L as NavSection,
17
+ L as Input,
18
+ S as Link,
19
+ u as LoadingSpinner,
20
+ x as NavLink,
21
+ I as NavSection,
22
22
  N as Radio,
23
23
  g as Select,
24
24
  v as Tooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-lib-tools",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
6
6
  "contributors": [
@@ -27,7 +27,7 @@ export async function compileComponents({
27
27
  fileExtensions: [".ts", ".tsx"],
28
28
  fileFilter: (file) =>
29
29
  componentNames.some((componentName) =>
30
- file.includes(`${componentName}.ts`)
30
+ file.includes(`/${componentName}.ts`)
31
31
  ),
32
32
  inputPath: ["lib", "components"],
33
33
  outputPath
@@ -16,7 +16,9 @@ export function insertPropsMarkdown({
16
16
  const startIndex = markdown.indexOf(startToken) + startToken.length;
17
17
  const stopIndex = markdown.indexOf(stopToken);
18
18
  if (startIndex < 0 || stopIndex < 0) {
19
- throw Error("Parsing README failed");
19
+ console.warn(`README tokens not found for component ${componentName}`);
20
+
21
+ return markdown;
20
22
  }
21
23
 
22
24
  return (
@@ -1,31 +0,0 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { Fragment as s } from "react";
3
- import { u as i } from "./useLibraryContext-C15B6XV-.js";
4
- import { B as r, H as m } from "./index-CmGluDif.js";
5
- function a({ children: t }) {
6
- return /* @__PURE__ */ e("dd", { className: "mt-2 flex flex-col gap-2", children: t });
7
- }
8
- function l({ children: t, id: o }) {
9
- return /* @__PURE__ */ e("dt", { className: "pt-4", id: o, children: /* @__PURE__ */ e(
10
- "a",
11
- {
12
- className: "text-lg text-common-question-header! font-bold",
13
- href: `#${o}`,
14
- children: t
15
- }
16
- ) });
17
- }
18
- function p() {
19
- const { commonQuestions: t = [] } = i();
20
- return /* @__PURE__ */ n(r, { direction: "column", gap: 4, children: [
21
- /* @__PURE__ */ e(m, { title: "Common questions" }),
22
- /* @__PURE__ */ e("dl", { children: t.map((o) => /* @__PURE__ */ n(s, { children: [
23
- /* @__PURE__ */ e(l, { id: o.id, children: o.question }),
24
- /* @__PURE__ */ e(a, { children: o.answer })
25
- ] }, o.id)) })
26
- ] });
27
- }
28
- export {
29
- p as default
30
- };
31
- //# sourceMappingURL=CommonQuestionsRoute-CgAJzTXe.js.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),i=require("./useLibraryContext-BL7MB9JL.cjs"),s=require("./index-CplpUoHk.cjs");function r({children:n}){return e.jsx("dd",{className:"mt-2 flex flex-col gap-2",children:n})}function c({children:n,id:t}){return e.jsx("dt",{className:"pt-4",id:t,children:e.jsx("a",{className:"text-lg text-common-question-header! font-bold",href:`#${t}`,children:n})})}function u(){const{commonQuestions:n=[]}=i.useLibraryContext();return e.jsxs(s.Box,{direction:"column",gap:4,children:[e.jsx(s.Header,{title:"Common questions"}),e.jsx("dl",{children:n.map(t=>e.jsxs(o.Fragment,{children:[e.jsx(c,{id:t.id,children:t.question}),e.jsx(r,{children:t.answer})]},t.id))})]})}exports.default=u;
2
- //# sourceMappingURL=CommonQuestionsRoute-n_iD3lwr.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./useLibraryContext-BL7MB9JL.cjs"),t=require("./index-CplpUoHk.cjs");function l(){const{overview:i,packageName:s,showOpenCollectLink:r}=n.useLibraryContext();return e.jsxs(t.Box,{direction:"column",gap:4,children:[e.jsx(t.Header,{title:`Getting started with ${s}`}),i,i&&e.jsx("div",{className:"text-xl mt-4",children:"Installation"}),e.jsx("div",{children:"Begin by installing the library from NPM:"}),e.jsxs("code",{className:"grow text-xs md:text-sm block text-left whitespace-pre-wrap rounded-md p-3 bg-black text-white!",children:["npm install ",e.jsx("span",{className:"tok-keyword",children:s})]}),e.jsxs(t.Callout,{intent:"primary",children:["TypeScript definitions are included within the published"," ",e.jsx("code",{children:"dist"})," folder."]}),e.jsx("div",{className:"text-xl mt-4",children:"Support"}),e.jsx("div",{children:"Here are some ways to support this project:"}),e.jsxs("ul",{className:"pl-8",children:[e.jsx("li",{className:"list-disc",children:e.jsx(t.ExternalLink,{href:"https://github.com/sponsors/bvaughn/",children:"Become a GitHub sponsor"})}),r&&e.jsx("li",{className:"list-disc",children:e.jsx(t.ExternalLink,{href:`https://opencollective.com/${s}#sponsor`,children:"Become an Open Collective sponsor"})}),e.jsx("li",{className:"list-disc",children:e.jsx(t.ExternalLink,{href:"http://givebrian.coffee/",children:"Buy me a coffee"})})]})]})}exports.default=l;
2
- //# sourceMappingURL=GettingStartedRoute-BQd7IviG.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./useLibraryContext-BL7MB9JL.cjs"),t=require("./index-CplpUoHk.cjs");function i(){const{packageName:n}=r.useLibraryContext();return e.jsxs(t.Box,{direction:"column",gap:4,children:[e.jsx(t.Header,{title:"Page not found"}),e.jsxs(t.Callout,{intent:"danger",children:["The URL you requested can't be found. If you think this is an error,"," ",e.jsx(t.ExternalLink,{href:`https://github.com/bvaughn/${n}/issues/new`,children:"please file a GitHub issue"}),"."]})]})}exports.default=i;
2
- //# sourceMappingURL=PageNotFound-CDk6JhhB.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./useLibraryContext-BL7MB9JL.cjs"),t=require("./index-CplpUoHk.cjs");function n(){const{packageName:s}=i.useLibraryContext();return e.jsxs(t.Box,{direction:"column",gap:4,children:[e.jsx(t.Header,{title:"Support"}),e.jsxs("div",{children:[e.jsx(t.ExternalLink,{href:`https://github.com/bvaughn/${s}`,children:"GitHub"})," ","is the easiest place to look for help, but it's probably not the fastest. This project is maintained by a single developer so there is limited bandwidth for answering questions."]}),e.jsxs("div",{children:["I recommend asking questions on"," ",e.jsx(t.ExternalLink,{href:`https://stackoverflow.com/search?q=${s}`,children:"Stack Overflow"})," ","or"," ",e.jsx(t.ExternalLink,{href:"https://reddit.com/r/reactjs",children:"Reddit"})," ","to start with. Both sites have active communities who often respond quickly. If you don't find an answer there you can try opening a GitHub issue- but please take a moment first to see if your question has"," ",e.jsx(t.ExternalLink,{href:`https://github.com/bvaughn/${s}/issues?q=is%3Aissue%20state%3Aclosed`,children:"has already been answered"})," ","before opening a new one."]})]})}exports.default=n;
2
- //# sourceMappingURL=SupportRoute-CubM7tub.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("./useLibraryContext-BL7MB9JL.cjs"),a=require("./index-CplpUoHk.cjs"),c=require("react");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const i=u(c);function C(t,e="Assertion error"){if(!t)throw console.error(e),Error(e)}const m=t=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",...t},i.createElement("path",{d:"M119.7 263.7L150.6 294.6C156.6 300.6 164.7 304 173.2 304L194.7 304C203.2 304 211.3 307.4 217.3 313.4L246.6 342.7C252.6 348.7 256 356.8 256 365.3L256 402.8C256 411.3 259.4 419.4 265.4 425.4L278.7 438.7C284.7 444.7 288.1 452.8 288.1 461.3L288.1 480C288.1 497.7 302.4 512 320.1 512C337.8 512 352.1 497.7 352.1 480L352.1 477.3C352.1 468.8 355.5 460.7 361.5 454.7L406.8 409.4C412.8 403.4 416.2 395.3 416.2 386.8L416.2 352.1C416.2 334.4 401.9 320.1 384.2 320.1L301.5 320.1C293 320.1 284.9 316.7 278.9 310.7L262.9 294.7C258.7 290.5 256.3 284.7 256.3 278.7C256.3 266.2 266.4 256.1 278.9 256.1L313.6 256.1C326.1 256.1 336.2 246 336.2 233.5C336.2 227.5 333.8 221.7 329.6 217.5L309.9 197.8C306 194 304 189.1 304 184C304 178.9 306 174 309.7 170.3L327 153C332.8 147.2 336.1 139.3 336.1 131.1C336.1 123.9 333.7 117.4 329.7 112.2C326.5 112.1 323.3 112 320.1 112C224.7 112 144.4 176.2 119.8 263.7zM528 320C528 285.4 519.6 252.8 504.6 224.2C498.2 225.1 491.9 228.1 486.7 233.3L473.3 246.7C467.3 252.7 463.9 260.8 463.9 269.3L463.9 304C463.9 321.7 478.2 336 495.9 336L520 336C522.5 336 525 335.7 527.3 335.2C527.7 330.2 527.8 325.1 527.8 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z"}));function d({url:t,version:e}){const{packageName:s}=l.useLibraryContext();return r.jsxs("li",{className:"list-disc",children:[e.split(".").slice(0,2).join("."),r.jsx("span",{className:"text-slate-400",children:".x"}),t&&r.jsxs(a.ExternalLink,{"aria-label":`Documentation for version ${e}`,className:"ml-4",href:t,children:[r.jsx(m,{className:"inline w-4 h-4 text-teal-200"})," documentation"]}),r.jsxs(a.ExternalLink,{"aria-label":`GitHub tag for version ${e}`,className:"ml-4",href:`https://github.com/bvaughn/${s}/releases/tag/${e}`,children:[r.jsx(a.SvgTags,{className:"inline w-4 h-4 text-teal-200"})," source code"]})]})}function x(){const{versions:t}=l.useLibraryContext();return C(t!==void 0),r.jsxs(a.Box,{direction:"column",gap:2,children:[r.jsx(a.Header,{title:"Previous releases"}),r.jsx("div",{children:"Click below to view documentation for past releases."}),Object.entries(t).sort((e,s)=>s[0].localeCompare(e[0])).map(([e,s])=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"text-lg mt-2",children:["Version ",e]}),r.jsx("ul",{className:"pl-8",children:Object.entries(s).sort((n,o)=>o[0].localeCompare(n[0])).map(([n,o])=>r.jsx(d,{url:o,version:n},n))})]},e))]})}exports.default=x;
2
- //# sourceMappingURL=VersionsRoute-DhLe3vGU.cjs.map