@net-advantage/jo-ui-logo 1.1.6 → 1.2.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 CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  JourneyOf wordmark. `journey` uses Inter. The accent `of..` uses Caveat. A dotted curve sits under the word.
4
4
 
5
- The logo follows a strict MVVM split. The model owns defaults and the font address. The view-model projects presentation values and requests the font faces. The view only renders the view-model.
5
+ The logo follows a strict MVVM split. The model owns defaults. The view-model projects presentation values. The view only renders the view-model. Inter and Caveat are self-hosted by `@net-advantage/jo-ui-theme`.
6
6
 
7
7
  ## MVVM
8
8
 
9
9
  ```mermaid
10
10
  flowchart LR
11
11
  Props["LogoProps"] --> ViewModel["useLogoViewModel"]
12
- Model["logo.model.ts<br/>defaults and font address"] --> ViewModel
12
+ Model["logo.model.ts<br/>defaults and class name"] --> ViewModel
13
13
  ViewModel --> View["Logo.tsx"]
14
14
  ```
15
15
 
16
16
  | Layer | File | Responsibility |
17
17
  | --- | --- | --- |
18
18
  | Contract | [logo.types.ts](src/logo.types.ts) | Props and view-model |
19
- | Model | [logo.model.ts](src/logo.model.ts) | Default colors, curve size, class name, and font address |
20
- | View-model | [logo.view-model.ts](src/logo.view-model.ts) | Project colors, curve size, width, and font families; request font faces |
19
+ | Model | [logo.model.ts](src/logo.model.ts) | Default colors, curve size, and class name |
20
+ | View-model | [logo.view-model.ts](src/logo.view-model.ts) | Project colors, curve size, width, and font families |
21
21
  | View | [Logo.tsx](src/Logo.tsx) | Render the wordmark and dotted curve |
22
22
 
23
23
  ## Models
@@ -26,7 +26,6 @@ flowchart LR
26
26
  flowchart TD
27
27
  Defaults["LOGO_DEFAULTS"] --> ViewModel["LogoViewModel"]
28
28
  Props["LogoProps"] --> ViewModel
29
- Font["LOGO_FONT_HREF"] --> Link["font stylesheet link"]
30
29
  ViewModel --> Word["journey"]
31
30
  ViewModel --> Accent["of.."]
32
31
  ViewModel --> Curve["dotted curve"]
@@ -35,7 +34,7 @@ flowchart TD
35
34
  - `primaryColor` colors `journey` and the curve's end dot. It defaults to `#14224a`.
36
35
  - `accentColor` colors `of..` and the curve. It defaults to `#6495ed`.
37
36
  - `curveWidth` defaults to `80`. `curveHeight` defaults to `10`.
38
- - The font request lives in the view-model. The model only names the address.
37
+ - Font families stay `Inter` and `Caveat`. Load them with `import '@net-advantage/jo-ui-theme/style.css'`. The logo does not request Google Fonts.
39
38
 
40
39
  ## Structure
41
40
 
@@ -43,11 +42,13 @@ flowchart TD
43
42
 
44
43
  ## Fonts
45
44
 
46
- The module requests Inter and Caveat from Google Fonts as soon as it loads. It adds one `preconnect` to `fonts.gstatic.com` and one stylesheet link marked `data-jo-ui-logo-fonts`. A second import does not add another link.
45
+ Inter (including weight 800) and Caveat 600 ship in `@net-advantage/jo-ui-theme`. Import that stylesheet once:
47
46
 
48
- Do not request these faces with a CSS `@import` inside `logo.css`. A component stylesheet is often injected after other rules, and the browser then ignores the import. That is why the accent face could look wrong until another screen loaded the font first.
47
+ ```ts
48
+ import '@net-advantage/jo-ui-theme/style.css';
49
+ ```
49
50
 
50
- The first paint may still use the fallback face until the font files arrive. `display=swap` replaces it with Caveat when the face is ready.
51
+ The faces use `font-display: swap` and are licensed under the SIL Open Font License. The logo package does not add a Google Fonts `<link>` or CSS `@import`.
51
52
 
52
53
  ## Props
53
54
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);let t=require("react");var n=`https://fonts.googleapis.com/css2?family=Inter:wght@800&family=Caveat:wght@600&display=swap`,r={primaryColor:`#14224a`,accentColor:`#6495ed`,curveWidth:80,curveHeight:10};function i(e){return[`jo-ui-logo`,e??``].filter(Boolean).join(` `)}function a(e){return e===void 0?null:{width:e}}function o(){if(typeof document>`u`||document.querySelector(`link[data-jo-ui-logo-fonts]`))return;let e=document.createElement(`link`);e.rel=`preconnect`,e.href=`https://fonts.gstatic.com`,e.crossOrigin=`anonymous`,document.head.appendChild(e);let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=n,t.dataset.joUiLogoFonts=`true`,document.head.appendChild(t)}function s(e){let{className:n,primaryColor:s=r.primaryColor,accentColor:c=r.accentColor,width:l,curveWidth:u=r.curveWidth,curveHeight:d=r.curveHeight,rootProps:f}=e;return(0,t.useEffect)(()=>{o()},[]),(0,t.useMemo)(()=>({className:i(n),primaryColor:s,accentColor:c,curveWidth:u,curveHeight:d,widthStyle:a(l),mainFontFamily:`Inter, 'Segoe UI', system-ui, sans-serif`,accentFontFamily:`'Caveat', cursive`,rootProps:f}),[c,n,d,u,s,f,l])}var c=e((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),l=e(((e,t)=>{t.exports=c()}))();function u(e){let t=s(e);return(0,l.jsxs)(`div`,{...t.rootProps,className:t.className,style:t.widthStyle??void 0,"aria-label":`JourneyOf`,children:[(0,l.jsxs)(`p`,{children:[(0,l.jsx)(`span`,{style:{fontFamily:t.mainFontFamily,fontWeight:800,fontSize:22,color:t.primaryColor},children:`journey`}),(0,l.jsx)(`span`,{style:{fontFamily:t.accentFontFamily,fontWeight:600,fontSize:24,color:t.accentColor},children:`of..`})]}),(0,l.jsxs)(`svg`,{width:t.curveWidth,height:t.curveHeight,viewBox:`0 0 100 15`,"aria-hidden":`true`,focusable:`false`,children:[(0,l.jsx)(`path`,{d:`M2 4 C 16 11, 31 -1, 45 7 S 74 13, 90 3`,fill:`none`,stroke:t.accentColor,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`0.2 6`,opacity:`0.9`}),(0,l.jsx)(`circle`,{cx:`2`,cy:`4`,r:`2.2`,fill:t.accentColor}),(0,l.jsx)(`circle`,{cx:`90`,cy:`3`,r:`2.2`,fill:t.primaryColor})]})]})}exports.Logo=u;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);let t=require("react");var n={primaryColor:`#14224a`,accentColor:`#6495ed`,curveWidth:80,curveHeight:10};function r(e){return[`jo-ui-logo`,e??``].filter(Boolean).join(` `)}function i(e){return e===void 0?null:{width:e}}function a(e){let{className:a,primaryColor:o=n.primaryColor,accentColor:s=n.accentColor,width:c,curveWidth:l=n.curveWidth,curveHeight:u=n.curveHeight,rootProps:d}=e;return(0,t.useMemo)(()=>({className:r(a),primaryColor:o,accentColor:s,curveWidth:l,curveHeight:u,widthStyle:i(c),mainFontFamily:`Inter, 'Segoe UI', system-ui, sans-serif`,accentFontFamily:`'Caveat', cursive`,rootProps:d}),[s,a,u,l,o,d,c])}var o=e((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),s=e(((e,t)=>{t.exports=o()}))();function c(e){let t=a(e);return(0,s.jsxs)(`div`,{...t.rootProps,className:t.className,style:t.widthStyle??void 0,"aria-label":`JourneyOf`,children:[(0,s.jsxs)(`p`,{children:[(0,s.jsx)(`span`,{style:{fontFamily:t.mainFontFamily,fontWeight:800,fontSize:22,color:t.primaryColor},children:`journey`}),(0,s.jsx)(`span`,{style:{fontFamily:t.accentFontFamily,fontWeight:600,fontSize:24,color:t.accentColor},children:`of..`})]}),(0,s.jsxs)(`svg`,{width:t.curveWidth,height:t.curveHeight,viewBox:`0 0 100 15`,"aria-hidden":`true`,focusable:`false`,children:[(0,s.jsx)(`path`,{d:`M2 4 C 16 11, 31 -1, 45 7 S 74 13, 90 3`,fill:`none`,stroke:t.accentColor,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`0.2 6`,opacity:`0.9`}),(0,s.jsx)(`circle`,{cx:`2`,cy:`4`,r:`2.2`,fill:t.accentColor}),(0,s.jsx)(`circle`,{cx:`90`,cy:`3`,r:`2.2`,fill:t.primaryColor})]})]})}exports.Logo=c;
package/dist/index.js CHANGED
@@ -1,54 +1,45 @@
1
1
  import "./jo-ui-logo.css";
2
- import { useEffect as e, useMemo as t } from "react";
2
+ import { useMemo as e } from "react";
3
3
  //#region \0rolldown/runtime.js
4
- var n = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), r = "https://fonts.googleapis.com/css2?family=Inter:wght@800&family=Caveat:wght@600&display=swap", i = {
4
+ var t = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), n = {
5
5
  primaryColor: "#14224a",
6
6
  accentColor: "#6495ed",
7
7
  curveWidth: 80,
8
8
  curveHeight: 10
9
9
  };
10
- function a(e) {
10
+ function r(e) {
11
11
  return ["jo-ui-logo", e ?? ""].filter(Boolean).join(" ");
12
12
  }
13
- function o(e) {
13
+ function i(e) {
14
14
  return e === void 0 ? null : { width: e };
15
15
  }
16
16
  //#endregion
17
17
  //#region src/logo.view-model.ts
18
- function s() {
19
- if (typeof document > "u" || document.querySelector("link[data-jo-ui-logo-fonts]")) return;
20
- let e = document.createElement("link");
21
- e.rel = "preconnect", e.href = "https://fonts.gstatic.com", e.crossOrigin = "anonymous", document.head.appendChild(e);
22
- let t = document.createElement("link");
23
- t.rel = "stylesheet", t.href = r, t.dataset.joUiLogoFonts = "true", document.head.appendChild(t);
24
- }
25
- function c(n) {
26
- let { className: r, primaryColor: c = i.primaryColor, accentColor: l = i.accentColor, width: u, curveWidth: d = i.curveWidth, curveHeight: f = i.curveHeight, rootProps: p } = n;
27
- return e(() => {
28
- s();
29
- }, []), t(() => ({
30
- className: a(r),
31
- primaryColor: c,
32
- accentColor: l,
33
- curveWidth: d,
34
- curveHeight: f,
35
- widthStyle: o(u),
18
+ function a(t) {
19
+ let { className: a, primaryColor: o = n.primaryColor, accentColor: s = n.accentColor, width: c, curveWidth: l = n.curveWidth, curveHeight: u = n.curveHeight, rootProps: d } = t;
20
+ return e(() => ({
21
+ className: r(a),
22
+ primaryColor: o,
23
+ accentColor: s,
24
+ curveWidth: l,
25
+ curveHeight: u,
26
+ widthStyle: i(c),
36
27
  mainFontFamily: "Inter, 'Segoe UI', system-ui, sans-serif",
37
28
  accentFontFamily: "'Caveat', cursive",
38
- rootProps: p
29
+ rootProps: d
39
30
  }), [
31
+ s,
32
+ a,
33
+ u,
40
34
  l,
41
- r,
42
- f,
35
+ o,
43
36
  d,
44
- c,
45
- p,
46
- u
37
+ c
47
38
  ]);
48
39
  }
49
40
  //#endregion
50
41
  //#region ../../node_modules/.pnpm/react@19.3.0/node_modules/react/cjs/react-jsx-runtime.production.js
51
- var l = /* @__PURE__ */ n(((e) => {
42
+ var o = /* @__PURE__ */ t(((e) => {
52
43
  var t = Symbol.for("react.transitional.element");
53
44
  function n(e, n, r) {
54
45
  var i = null;
@@ -63,17 +54,17 @@ var l = /* @__PURE__ */ n(((e) => {
63
54
  };
64
55
  }
65
56
  e.jsx = n, e.jsxs = n;
66
- })), u = (/* @__PURE__ */ n(((e, t) => {
67
- t.exports = l();
57
+ })), s = (/* @__PURE__ */ t(((e, t) => {
58
+ t.exports = o();
68
59
  })))();
69
- function d(e) {
70
- let t = c(e);
71
- return /* @__PURE__ */ (0, u.jsxs)("div", {
60
+ function c(e) {
61
+ let t = a(e);
62
+ return /* @__PURE__ */ (0, s.jsxs)("div", {
72
63
  ...t.rootProps,
73
64
  className: t.className,
74
65
  style: t.widthStyle ?? void 0,
75
66
  "aria-label": "JourneyOf",
76
- children: [/* @__PURE__ */ (0, u.jsxs)("p", { children: [/* @__PURE__ */ (0, u.jsx)("span", {
67
+ children: [/* @__PURE__ */ (0, s.jsxs)("p", { children: [/* @__PURE__ */ (0, s.jsx)("span", {
77
68
  style: {
78
69
  fontFamily: t.mainFontFamily,
79
70
  fontWeight: 800,
@@ -81,7 +72,7 @@ function d(e) {
81
72
  color: t.primaryColor
82
73
  },
83
74
  children: "journey"
84
- }), /* @__PURE__ */ (0, u.jsx)("span", {
75
+ }), /* @__PURE__ */ (0, s.jsx)("span", {
85
76
  style: {
86
77
  fontFamily: t.accentFontFamily,
87
78
  fontWeight: 600,
@@ -89,14 +80,14 @@ function d(e) {
89
80
  color: t.accentColor
90
81
  },
91
82
  children: "of.."
92
- })] }), /* @__PURE__ */ (0, u.jsxs)("svg", {
83
+ })] }), /* @__PURE__ */ (0, s.jsxs)("svg", {
93
84
  width: t.curveWidth,
94
85
  height: t.curveHeight,
95
86
  viewBox: "0 0 100 15",
96
87
  "aria-hidden": "true",
97
88
  focusable: "false",
98
89
  children: [
99
- /* @__PURE__ */ (0, u.jsx)("path", {
90
+ /* @__PURE__ */ (0, s.jsx)("path", {
100
91
  d: "M2 4 C 16 11, 31 -1, 45 7 S 74 13, 90 3",
101
92
  fill: "none",
102
93
  stroke: t.accentColor,
@@ -105,13 +96,13 @@ function d(e) {
105
96
  strokeDasharray: "0.2 6",
106
97
  opacity: "0.9"
107
98
  }),
108
- /* @__PURE__ */ (0, u.jsx)("circle", {
99
+ /* @__PURE__ */ (0, s.jsx)("circle", {
109
100
  cx: "2",
110
101
  cy: "4",
111
102
  r: "2.2",
112
103
  fill: t.accentColor
113
104
  }),
114
- /* @__PURE__ */ (0, u.jsx)("circle", {
105
+ /* @__PURE__ */ (0, s.jsx)("circle", {
115
106
  cx: "90",
116
107
  cy: "3",
117
108
  r: "2.2",
@@ -122,4 +113,4 @@ function d(e) {
122
113
  });
123
114
  }
124
115
  //#endregion
125
- export { d as Logo };
116
+ export { c as Logo };
@@ -1,4 +1,3 @@
1
- export declare const LOGO_FONT_HREF = "https://fonts.googleapis.com/css2?family=Inter:wght@800&family=Caveat:wght@600&display=swap";
2
1
  export declare const LOGO_DEFAULTS: {
3
2
  readonly primaryColor: "#14224a";
4
3
  readonly accentColor: "#6495ed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@net-advantage/jo-ui-logo",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",