@goliapkg/gds 1.6.0 → 1.6.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/README.md +2 -1
- package/dist/l1-systems/index.d.ts +1 -0
- package/dist/l1-systems/index.d.ts.map +1 -1
- package/dist/l1-systems/index.js +19 -1
- package/dist/l1-systems/index.js.map +1 -0
- package/dist/l1-systems/use-fonts.d.ts +3 -0
- package/dist/l1-systems/use-fonts.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,10 +67,11 @@ bun add @goliapkg/gds
|
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
69
|
import { Provider } from 'jotai'
|
|
70
|
-
import { useThemeEffect } from '@goliapkg/gds/systems'
|
|
70
|
+
import { useFonts, useThemeEffect } from '@goliapkg/gds/systems'
|
|
71
71
|
|
|
72
72
|
function ThemeInit() {
|
|
73
73
|
useThemeEffect()
|
|
74
|
+
useFonts() // auto-inject CJK fonts (Noto Sans SC/JP/KR) from Google Fonts CDN
|
|
74
75
|
return null
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { ThemeColorOverrides, ThemeMode, ThemeState } from './theme';
|
|
2
2
|
export { DEFAULT_THEME, resolvedModeAtom, resolveThemeCssVars, themeAtom } from './theme';
|
|
3
3
|
export { configureTheme, useResetTheme, useResolvedMode, useSetThemeColors, useSetThemeDensity, useSetThemeElevation, useSetThemeGlass, useSetThemeMode, useSetThemeMotion, useSetThemePreset, useSetThemePrimaryColor, useSetThemeShape, useTheme, useThemeEffect, } from './use-theme';
|
|
4
|
+
export { useFonts } from './use-fonts';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/l1-systems/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,QAAQ,EACR,cAAc,GACf,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/l1-systems/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,QAAQ,EACR,cAAc,GACf,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/l1-systems/index.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "../use-theme-C0aWVw70.js";
|
|
2
|
-
|
|
2
|
+
import { useEffect as v } from "react";
|
|
3
|
+
//#region src/l1-systems/use-fonts.ts
|
|
4
|
+
var y = "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap", b = ["https://fonts.googleapis.com", "https://fonts.gstatic.com"], x = "gds-cjk-fonts";
|
|
5
|
+
function S() {
|
|
6
|
+
v(() => {
|
|
7
|
+
if (typeof document > "u" || document.getElementById(x) !== null) return;
|
|
8
|
+
let e = document.head;
|
|
9
|
+
for (let t of b) {
|
|
10
|
+
let n = document.createElement("link");
|
|
11
|
+
n.rel = "preconnect", n.href = t, t.includes("gstatic") && (n.crossOrigin = "anonymous"), n.setAttribute("data-gds", "font-preconnect"), e.appendChild(n);
|
|
12
|
+
}
|
|
13
|
+
let t = document.createElement("link");
|
|
14
|
+
t.id = x, t.rel = "stylesheet", t.href = y, t.setAttribute("data-gds", "cjk-fonts"), e.appendChild(t);
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { o as DEFAULT_THEME, h as configureTheme, a as resolveThemeCssVars, e as resolvedModeAtom, _ as themeAtom, S as useFonts, u as useResetTheme, p as useResolvedMode, s as useSetThemeColors, t as useSetThemeDensity, d as useSetThemeElevation, m as useSetThemeGlass, n as useSetThemeMode, c as useSetThemeMotion, g as useSetThemePreset, r as useSetThemePrimaryColor, i as useSetThemeShape, f as useTheme, l as useThemeEffect };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/l1-systems/use-fonts.ts"],"sourcesContent":["// use-fonts — auto-inject CJK font links into document head\n// call once in app root to enable full CJK support (SC, JP, KR)\n// latin fonts are loaded via fonts.css (self-hosted woff2)\n\nimport { useEffect } from 'react'\n\nconst GOOGLE_FONTS_URL =\n 'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap'\n\nconst PRECONNECT_URLS = [\n 'https://fonts.googleapis.com',\n 'https://fonts.gstatic.com',\n]\n\nconst MARKER_ID = 'gds-cjk-fonts'\n\n/** Auto-inject CJK font <link> tags. Call once at app root alongside useThemeEffect(). */\nexport function useFonts(): void {\n useEffect(() => {\n if (typeof document === 'undefined') return\n // skip if already injected\n if (document.getElementById(MARKER_ID) !== null) return\n\n const head = document.head\n\n // preconnect links\n for (const url of PRECONNECT_URLS) {\n const link = document.createElement('link')\n link.rel = 'preconnect'\n link.href = url\n if (url.includes('gstatic')) {\n link.crossOrigin = 'anonymous'\n }\n link.setAttribute('data-gds', 'font-preconnect')\n head.appendChild(link)\n }\n\n // stylesheet link\n const stylesheet = document.createElement('link')\n stylesheet.id = MARKER_ID\n stylesheet.rel = 'stylesheet'\n stylesheet.href = GOOGLE_FONTS_URL\n stylesheet.setAttribute('data-gds', 'cjk-fonts')\n head.appendChild(stylesheet)\n }, [])\n}\n"],"mappings":";;;AAMA,IAAM,IACJ,yLAEI,IAAkB,CACtB,gCACA,4BACD,EAEK,IAAY;AAGlB,SAAgB,IAAiB;AAC/B,SAAgB;AAGd,MAFI,OAAO,WAAa,OAEpB,SAAS,eAAe,EAAU,KAAK,KAAM;EAEjD,IAAM,IAAO,SAAS;AAGtB,OAAK,IAAM,KAAO,GAAiB;GACjC,IAAM,IAAO,SAAS,cAAc,OAAO;AAO3C,GANA,EAAK,MAAM,cACX,EAAK,OAAO,GACR,EAAI,SAAS,UAAU,KACzB,EAAK,cAAc,cAErB,EAAK,aAAa,YAAY,kBAAkB,EAChD,EAAK,YAAY,EAAK;;EAIxB,IAAM,IAAa,SAAS,cAAc,OAAO;AAKjD,EAJA,EAAW,KAAK,GAChB,EAAW,MAAM,cACjB,EAAW,OAAO,GAClB,EAAW,aAAa,YAAY,YAAY,EAChD,EAAK,YAAY,EAAW;IAC3B,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fonts.d.ts","sourceRoot":"","sources":["../../src/l1-systems/use-fonts.ts"],"names":[],"mappings":"AAgBA,0FAA0F;AAC1F,wBAAgB,QAAQ,IAAI,IAAI,CA4B/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/gds",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "GOLIA Design System — enterprise-grade UI component library with contextual depth, glass materials, AI-native structure, and 10 design principles",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|