@devslab/site-kit 0.29.2 → 0.31.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.ko.md +65 -1
- package/README.md +69 -1
- package/dist/react/chrome.d.ts +66 -0
- package/dist/react/chrome.d.ts.map +1 -0
- package/dist/react/chunks/flag-bodies.js +84 -0
- package/dist/react/chunks/flag-bodies.js.map +1 -0
- package/dist/react/consent.d.ts +15 -0
- package/dist/react/consent.d.ts.map +1 -0
- package/dist/react/flag-bodies.d.ts +21 -0
- package/dist/react/flag-bodies.d.ts.map +1 -0
- package/dist/react/flag-bodies.js +6 -0
- package/dist/react/flag-bodies.js.map +1 -0
- package/dist/react/flag-bodies.server.d.ts +4 -0
- package/dist/react/flag-bodies.server.d.ts.map +1 -0
- package/dist/react/flag-bodies.server.js +7 -0
- package/dist/react/flag-bodies.server.js.map +1 -0
- package/dist/react/index.d.ts +29 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +817 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/layouts.d.ts +51 -0
- package/dist/react/layouts.d.ts.map +1 -0
- package/dist/react/locale-menu.d.ts +24 -0
- package/dist/react/locale-menu.d.ts.map +1 -0
- package/dist/react/locale-state.d.ts +10 -0
- package/dist/react/locale-state.d.ts.map +1 -0
- package/dist/react/oss-product-mark.d.ts +9 -0
- package/dist/react/oss-product-mark.d.ts.map +1 -0
- package/dist/react/primitives.d.ts +18 -0
- package/dist/react/primitives.d.ts.map +1 -0
- package/dist/react/sections.d.ts +63 -0
- package/dist/react/sections.d.ts.map +1 -0
- package/dist/react/types.d.ts +82 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/solid.js.map +1 -1
- package/dist/solid.server.js.map +1 -1
- package/fonts/manifest.json +7 -1
- package/fonts/pretendard/PretendardVariable.woff2 +0 -0
- package/fonts-atomic.css +116 -0
- package/package.json +48 -13
- package/src/core/fonts.d.mts +5 -0
- package/src/core/fonts.mjs +5 -0
- package/src/core/locales.d.mts +10 -0
- package/src/core/locales.mjs +18 -0
- package/styles.css +4 -0
package/README.ko.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# @devslab/site-kit
|
|
2
2
|
|
|
3
|
-
DevsLab 제품의 공개 웹사이트를 위한 공개 인프라 패키지다. 가족 로케일에 대한 엄격한 카탈로그(제품별 확장 가능), 로케일 협상, SEO/GEO 문서 생성기, 접근 가능한 SolidJS 2 사이트 셸을 제공한다. 제품명·주장·내비게이션·번역 문구는 항상 소비 앱이 소유한다.
|
|
3
|
+
DevsLab 제품의 공개 웹사이트를 위한 공개 인프라 패키지다. 가족 로케일에 대한 엄격한 카탈로그(제품별 확장 가능), 로케일 협상, SEO/GEO 문서 생성기, 접근 가능한 SolidJS 2·React 사이트 셸을 제공한다. 제품명·주장·내비게이션·번역 문구는 항상 소비 앱이 소유한다.
|
|
4
4
|
|
|
5
5
|
## 진입점
|
|
6
6
|
|
|
7
7
|
- `@devslab/site-kit` — 런타임 중립 로케일·카탈로그·SEO·사이트맵·robots·검증된 사실·Google Tag Manager·분석 동의 유틸리티
|
|
8
8
|
- `@devslab/site-kit/solid` — 헤더·푸터·언어/테마 컨트롤·마케팅/법률/상태/오류 레이아웃·접근 요청 폼·동의 바
|
|
9
|
+
- `@devslab/site-kit/react` — React·Next.js용 같은 헤더·푸터·언어/테마 컨트롤·레이아웃·섹션 원시. [React·Next.js](#reactnextjs) 참고
|
|
9
10
|
- `@devslab/site-kit/tanstack-start` — 중립 메타데이터를 TanStack Start head descriptor로 변환(브랜드 아이콘과 동의 게이트를 거친 Tag Manager 로더는 옵트인)
|
|
10
11
|
- `@devslab/site-kit/styles.css` — 논리 속성과 RTL을 지원하는 공통 사이트 스타일. 페이지 뿌리에 가족 서체(`:where(html) { font-family: var(--dds-font-family-sans) }`)도 주어 맨 제목·문단이 브라우저 세리프로 남지 않는다. 명시도가 0이라 제품이 `html`·`:root`·`body`·`:lang()`에 둔 규칙이 이긴다.
|
|
11
12
|
- `@devslab/site-kit/fonts.css` — 가족 서체(Geist·Geist Mono·Pretendard)를 토큰의 패밀리 이름으로 등록한 자체 호스팅 woff2. [가족 서체](#가족-서체) 참고
|
|
@@ -24,6 +25,56 @@ claim leaf가 검증된 사실 레지스트리를 참조하도록 강제한다.
|
|
|
24
25
|
|
|
25
26
|
헤더와 푸터는 `brand`(푸터는 `details`도)를 스스로 한 번만 읽는다. 그래서 셸 밖에서도 인라인으로 만든 로고·details 블록이 서버와 브라우저에서 각각 한 번씩만 만들어진다(D-029).
|
|
26
27
|
|
|
28
|
+
## React·Next.js
|
|
29
|
+
|
|
30
|
+
`@devslab/site-kit/react`는 React 18.3+/19 제품을 위한 같은 크롬이다(D-045): `LocaleMenu`(`variant="flag"` 또는 기본 select)·`SiteHeader`·`SiteFooter`·`ThemeToggle`·`MarketingShell`·`LegalLayout`·`StatusBanner`·`NotFoundLayout`·`ErrorLayout`·섹션 원시·`OssProductMark`·`ConsentSettingsButton`. `./solid`와 prop 이름이 같고(Solid의 `JSX.Element` 자리가 `ReactNode`) 클래스·마크업도 같다 — 같은 props로 둘을 렌더해 비교하는 테스트가 있다. Solid 제품처럼 `@devslab/site-kit/styles.css`(원시를 쓰면 `site-sections.css`도)를 import한다. `react`는 선택 피어이고, 이 진입점은 `@devslab/dds-react`에 의존하지 않는다. 패키지를 설치하면 `@devslab/dds-solid`(와 `solid-js`)는 여전히 함께 깔리지만(`styles.css`가 그 스타일시트를 import), React 앱의 브라우저 번들에는 들어가지 않는다.
|
|
31
|
+
|
|
32
|
+
파일 첫 줄이 `"use client"`라 Next.js 서버 컴포넌트가 크롬을 렌더하면서 데이터와 서버에서 렌더한 children을 넘길 수 있다. 함수와 메서드 든 객체는 클라이언트 컴포넌트로 넘어가지 못하므로 서버 컴포넌트에서는:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { defineLocaleRegistry, localeHrefs } from "@devslab/site-kit";
|
|
36
|
+
import { MarketingShell } from "@devslab/site-kit/react";
|
|
37
|
+
|
|
38
|
+
const registry = defineLocaleRegistry({ only: ["ko", "en", "ja", "zh-TW"] });
|
|
39
|
+
const state = { locale, hrefs: localeHrefs(registry, (code) => `/${code}`) }; // hrefForLocale 대신
|
|
40
|
+
const locales = { LOCALES: registry.LOCALES }; // 레지스트리 대신
|
|
41
|
+
|
|
42
|
+
<MarketingShell
|
|
43
|
+
messages={messages}
|
|
44
|
+
header={{
|
|
45
|
+
brand: { name: "", href: `/${locale}`, label: "쿠루 홈", logo: <span className="site-brand__lockup"><Mark /><span>쿠루</span></span> },
|
|
46
|
+
navigation, locale: state, localeVariant: "flag", localeRegistry: locales, theme: {}, messages,
|
|
47
|
+
}}
|
|
48
|
+
footer={{ brand, links, copyright, locale: state, localeRegistry: locales, messages }}
|
|
49
|
+
>{children}</MarketingShell>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
클라이언트 컴포넌트에서는 Solid와 같은 형태(`hrefForLocale`, 레지스트리, `onLocaleChange`)도 된다. `.site-brand__lockup`은 마크와 워드마크를 한 중심선에 놓는다. 없으면 브랜드 링크가 인라인이라 텍스트가 기준선에 붙는다.
|
|
53
|
+
|
|
54
|
+
국기 아트워크: 진입점은 `@devslab/site-kit/react/flag-bodies`를 import하고 package.json이 export 조건마다 답한다 — `react-server`·`edge-light`·`workerd`·`worker`·`node`는 본문, `browser`는 스텁. 서버가 스프라이트를 쓰고 하이드레이션은 그대로 넘겨받으며, 서버 HTML 없이 렌더할 때만 본문을 별도 청크로 가져온다. `scripts/check-react-client-bundle.mjs`가 브라우저 번들에 본문이 들어오지 않게 지킨다.
|
|
55
|
+
|
|
56
|
+
`LocaleMenu`는 `SiteHeader`가 조립하는 바로 그 컴포넌트이고 혼자 쓸 수 있다 — 푸터에서, 또는 설정 페이지 같은 앱 화면에서. 문자열 하나면 된다:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
"use client";
|
|
60
|
+
import { defineLocaleRegistry } from "@devslab/site-kit";
|
|
61
|
+
import { LocaleMenu } from "@devslab/site-kit/react";
|
|
62
|
+
|
|
63
|
+
const registry = defineLocaleRegistry({ only: ["ko", "en", "ja", "zh-TW"] });
|
|
64
|
+
|
|
65
|
+
export function LanguageSetting({ locale, onChange }) {
|
|
66
|
+
return <LocaleMenu variant="flag" registry={registry} messages={{ localeLabel: "언어" }}
|
|
67
|
+
state={{ locale, hrefForLocale: (code) => `?lang=${code}` }}
|
|
68
|
+
onLocaleChange={(code) => onChange(code)} />;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`onLocaleChange`가 없으면 각 항목은 브라우저가 따라가는 평범한 링크다. 국기 변형은 일부러 `<details>` 디스클로저다: 하이드레이션 전에도, JavaScript 없이도 서버 HTML만으로 열리고 `hreflang` 링크가 동작하며, Solid 메뉴와 같은 마크업을 쓴다(D-045).
|
|
73
|
+
|
|
74
|
+
법률 링크: `SiteFooter`의 `links`는 admin.devslab.kr(정책 v3) 기반의 제품 약관·개인정보처리방침 페이지를 가리키고, 개인정보처리방침에 `emphasis: true`(D-029). 공용 v3 클라이언트와 `PolicyDocument` 렌더러는 다음 단계다(D-045).
|
|
75
|
+
|
|
76
|
+
React 진입점에 아직 없는 것: `ConsentBanner`(포커스를 가두는 대화상자가 필요)와 `RequestAccessForm`.
|
|
77
|
+
|
|
27
78
|
## 헤더·푸터 옵션
|
|
28
79
|
|
|
29
80
|
한 언어만 쓰는 제품과, 사업자 정보를 바닥에 적어야 하는 제품을 위한 옵션(D-029). props는 모두 선택이고, 아무것도 넘기지 않는 제품은 전과 같은 마크업을 받는다. 다만 모든 제품에 적용되는 기본값 몇 가지가 있다(옵션 목록 뒤).
|
|
@@ -511,3 +562,16 @@ import하는 소비자는 kit 전체로 클라이언트 JS ~150 KB가 아니라
|
|
|
511
562
|
`pnpm check`가 최소 소비자(`fixtures/bundle-probe`)를 빌드해 국기 본문이 메인
|
|
512
563
|
청크로 되돌아오면 실패시킨다. 본문은 서버 렌더 HTML에는 여전히 실린다 —
|
|
513
564
|
가져오는 파일로 옮기는 것은 별도 결정이다.
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
### Atomic UI font opt-in
|
|
568
|
+
|
|
569
|
+
Keep legacy fonts.css for consumers that require its subset-and-swap behavior. Products that need stable first-paint UI text can replace that import with @devslab/site-kit/fonts-atomic.css. Import one stylesheet, not both. The opt-in keeps the same DDS family names and fallback token stack. It uses one complete unmodified Pretendard 1.3.9 WOFF2 without unicode-range/local(), and optional display for Geist, Geist Mono and Pretendard. A slow first visit may retain system fallback for that page; it does not promise that every visit uses the custom font.
|
|
570
|
+
|
|
571
|
+
Use the pure ESM @devslab/site-kit/fonts subpath and fontPreloadLinks([geistLatinUrl, fullKoreanUrl]) in the initial HTML/head. Vite application imports use @devslab/site-kit/fonts/geist/geist-latin-wght-normal.woff2?url and @devslab/site-kit/fonts/pretendard/PretendardVariable.woff2?url, so preload and CSS refer to identical content-hashed files. FAMILY_FONT_PRELOAD_FILE is the existing Latin path; FAMILY_FONT_ATOMIC_FILE is the complete Korean path; FAMILY_FONT_MONO_FILE is available when the initial screen uses mono text. Plain HTML/Vite consumers may generate head links from final emitted asset URLs in their HTML build step. Late client-side JS is not an early preload.
|
|
572
|
+
|
|
573
|
+
fontPreloadLinks still accepts only same-origin absolute WOFF2 URLs and supplies type font/woff2 plus anonymous CORS mode. The CSS keeps external same-origin URLs; no inline/data font or CSP expansion is required. Content-hashed public WOFF2 caching belongs to the consuming application asset response. Do not change HTML, API or account cache policy as part of a font cache rule.
|
|
574
|
+
|
|
575
|
+
Both stylesheets and the complete font are generated/verified from fonts/manifest.json. The full font is 2,057,688 bytes, SHA256 9599f12fd42fc0bce1cd50b47a0c022e108d7aa64dd0d1bb0ed44f3282d900b4, from pretendard@1.3.9 dist/web/variable/woff2/PretendardVariable.woff2. It shares the packaged OFL-1.1 license with the preserved upstream subsets. This opt-in does not copy application-specific inline critical fonts or calibrated local font metrics; consumers must verify real first-paint glyphs/layout under cold, warm and delayed font loading.
|
|
576
|
+
|
|
577
|
+
The atomic stylesheet also overrides only the sans token’s Korean entry with the CSS alias `DDS Pretendard Atomic`. Keep this stylesheet after the token stylesheet. The original font bytes, all other fallback entries, and the legacy `fonts.css` remain unchanged; an installed `Pretendard` face cannot enter the optional fallback later.
|
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# @devslab/site-kit
|
|
2
2
|
|
|
3
|
-
Public product-site infrastructure for DevsLab products. It provides strict catalogs over the family locales (extensible per product), locale negotiation, SEO/GEO document builders, and accessible SolidJS 2 site shells. Product names, claims, navigation, and translated copy always remain in the consuming application.
|
|
3
|
+
Public product-site infrastructure for DevsLab products. It provides strict catalogs over the family locales (extensible per product), locale negotiation, SEO/GEO document builders, and accessible SolidJS 2 and React site shells. Product names, claims, navigation, and translated copy always remain in the consuming application.
|
|
4
4
|
|
|
5
5
|
## Entry points
|
|
6
6
|
|
|
7
7
|
- `@devslab/site-kit` — runtime-neutral locale, catalog, SEO, sitemap, robots, verified-fact, Google Tag Manager and analytics-consent utilities.
|
|
8
8
|
- `@devslab/site-kit/solid` — header, footer, locale/theme controls, marketing/legal/status/error layouts, request-access form, and the consent bar.
|
|
9
|
+
- `@devslab/site-kit/react` — the same header, footer, locale/theme controls, layouts and section primitives for React and Next.js; see [React and Next.js](#react-and-nextjs).
|
|
9
10
|
- `@devslab/site-kit/tanstack-start` — conversion of neutral metadata to TanStack Start head descriptors (with opt-in brand icons and the consent-gated Tag Manager loader).
|
|
10
11
|
- `@devslab/site-kit/styles.css` — logical-property, RTL-aware shared site styles. It also gives the page root the family face (`:where(html) { font-family: var(--dds-font-family-sans) }`), so bare headings and paragraphs are not left in the browser's serif. The rule has zero specificity: a product's own rule on `html`, `:root`, `body` or `:lang()` wins.
|
|
11
12
|
- `@devslab/site-kit/fonts.css` — the family font (Geist, Geist Mono, Pretendard) as self-hosted woff2 under the token's family names; see [Family font](#family-font).
|
|
@@ -24,6 +25,56 @@ control search indexing, citation crawlers, and model-training crawlers.
|
|
|
24
25
|
|
|
25
26
|
The header and footer read `brand` (and the footer its `details`) once themselves, so a logo or details block built inline stays one build per side even outside the shell (D-029).
|
|
26
27
|
|
|
28
|
+
## React and Next.js
|
|
29
|
+
|
|
30
|
+
`@devslab/site-kit/react` is the same chrome for React 18.3+/19 products (D-045): `LocaleMenu` (`variant="flag"` or the default select), `SiteHeader`, `SiteFooter`, `ThemeToggle`, `MarketingShell`, `LegalLayout`, `StatusBanner`, `NotFoundLayout`, `ErrorLayout`, the section primitives, `OssProductMark` and `ConsentSettingsButton`. Same prop names as `./solid` (`ReactNode` where Solid takes `JSX.Element`), same classes, same markup — a test renders both from the same props and compares them. Import `@devslab/site-kit/styles.css` (and `site-sections.css` for the primitives) as a Solid product does. `react` is an optional peer; the entry does not depend on `@devslab/dds-react`. Installing the package still installs `@devslab/dds-solid` (and `solid-js`) — `styles.css` imports its stylesheet — but none of it reaches a React app's browser bundle.
|
|
31
|
+
|
|
32
|
+
The file starts with `"use client"`, so a Next.js Server Component can render the chrome and hand it data and server-rendered children. Functions and objects with methods cannot cross into a Client Component, so from a Server Component:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { defineLocaleRegistry, localeHrefs } from "@devslab/site-kit";
|
|
36
|
+
import { MarketingShell } from "@devslab/site-kit/react";
|
|
37
|
+
|
|
38
|
+
const registry = defineLocaleRegistry({ only: ["ko", "en", "ja", "zh-TW"] });
|
|
39
|
+
const state = { locale, hrefs: localeHrefs(registry, (code) => `/${code}`) }; // not hrefForLocale
|
|
40
|
+
const locales = { LOCALES: registry.LOCALES }; // not the registry
|
|
41
|
+
|
|
42
|
+
<MarketingShell
|
|
43
|
+
messages={messages}
|
|
44
|
+
header={{
|
|
45
|
+
brand: { name: "", href: `/${locale}`, label: "쿠루 홈", logo: <span className="site-brand__lockup"><Mark /><span>쿠루</span></span> },
|
|
46
|
+
navigation, locale: state, localeVariant: "flag", localeRegistry: locales, theme: {}, messages,
|
|
47
|
+
}}
|
|
48
|
+
footer={{ brand, links, copyright, locale: state, localeRegistry: locales, messages }}
|
|
49
|
+
>{children}</MarketingShell>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
From a Client Component the Solid forms work too (`hrefForLocale`, a registry, `onLocaleChange`). `.site-brand__lockup` puts a mark and a wordmark on one centre line; without it the brand link is inline and text sits on its baseline.
|
|
53
|
+
|
|
54
|
+
Flag artwork: the entry imports `@devslab/site-kit/react/flag-bodies`, which package.json resolves per export condition — `react-server`, `edge-light`, `workerd`, `worker` and `node` get the bodies, `browser` gets a stub. The server writes the sprite; hydration adopts it as written; only a render with no server HTML fetches the bodies as their own chunk. `scripts/check-react-client-bundle.mjs` keeps them out of the browser bundle.
|
|
55
|
+
|
|
56
|
+
`LocaleMenu` is the same component `SiteHeader` composes, and it stands alone — in a footer, or on an app screen such as a settings page. It needs one string:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
"use client";
|
|
60
|
+
import { defineLocaleRegistry } from "@devslab/site-kit";
|
|
61
|
+
import { LocaleMenu } from "@devslab/site-kit/react";
|
|
62
|
+
|
|
63
|
+
const registry = defineLocaleRegistry({ only: ["ko", "en", "ja", "zh-TW"] });
|
|
64
|
+
|
|
65
|
+
export function LanguageSetting({ locale, onChange }) {
|
|
66
|
+
return <LocaleMenu variant="flag" registry={registry} messages={{ localeLabel: "언어" }}
|
|
67
|
+
state={{ locale, hrefForLocale: (code) => `?lang=${code}` }}
|
|
68
|
+
onLocaleChange={(code) => onChange(code)} />;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Without `onLocaleChange` each entry is a plain link the browser follows. The flag variant is a `<details>` disclosure on purpose: it opens and its `hreflang` links work from server HTML alone, before hydration and without JavaScript, and it writes the same markup as the Solid menu (D-045).
|
|
73
|
+
|
|
74
|
+
Legal links: point `SiteFooter`'s `links` at the product's terms and privacy pages backed by admin.devslab.kr (policy v3), with `emphasis: true` on the privacy policy (D-029). A shared v3 client and `PolicyDocument` renderer are the next step (D-045).
|
|
75
|
+
|
|
76
|
+
Not in the React entry yet: `ConsentBanner` (it needs a focus-trapping dialog) and `RequestAccessForm`.
|
|
77
|
+
|
|
27
78
|
## Header and footer options
|
|
28
79
|
|
|
29
80
|
For a single-language product, and for a footer that has to print business details (D-029). The props are optional; a product that passes none of them gets the same markup. A few defaults apply to every product (listed after the options).
|
|
@@ -490,3 +541,20 @@ does not exist.
|
|
|
490
541
|
`LocaleMenu` renders a native `<select>` by default. `variant="flag"` renders a `<details>` disclosure whose trigger is the current locale's flag and whose rows are flag + native-name links — it works without JavaScript; Solid adds Escape-to-close and the `onLocaleChange(locale, href)` callback. `SiteHeader` forwards `localeVariant`. Flag data (`FLAG_COUNTRY`, `LOCALE_FLAGS`, `flagFor`, `flagCountryFor`) is exported from `@devslab/site-kit/flags`, a dedicated subpath — not the runtime-neutral `.` entry — because the vendored artwork is ~110 KB of SVG and most consumers never render a flag menu.
|
|
491
542
|
|
|
492
543
|
The flag menu keeps that artwork out of the browser bundle too. Each menu renders one `<symbol>` sprite (one body per country) and every flag is an `<svg><use href="#…">` of it, so a locale change on the client only swaps an `href`. The sprite's markup is written by the server build; hydration adopts it, and the browser build reaches the bodies only through a dynamic `import()` — its own chunk, `dist/flag-bodies.js` — taken when a flag menu renders with no server HTML (a client-only app, a jsdom test). A consumer that imports `SiteHeader` therefore ships ~40 KB of client JS for the whole kit rather than ~150 KB; `pnpm check` builds a minimal consumer (`fixtures/bundle-probe`) and fails if a flag body ever returns to the main chunk. The bodies still sit in the server-rendered HTML — moving them to fetched files is a separate decision. The artwork is vendored from flag-icons (MIT, `flags/LICENSE-flag-icons.txt`). Flags are site-kit data, not `dds-icons` entries, because the icon set's contract requires single-colour `currentColor` strokes.
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
### Atomic UI font opt-in
|
|
547
|
+
|
|
548
|
+
Keep legacy fonts.css for consumers that require its subset-and-swap behavior. Products that need stable first-paint UI text can replace that import with @devslab/site-kit/fonts-atomic.css. Import one stylesheet, not both. The opt-in uses the DDS Pretendard Atomic CSS alias and preserves the remaining token fallback order. It uses one complete unmodified Pretendard 1.3.9 WOFF2 without unicode-range/local(), and optional display for Geist, Geist Mono and Pretendard. A slow first visit may retain system fallback for that page; it does not promise that every visit uses the custom font.
|
|
549
|
+
|
|
550
|
+
Use the pure ESM @devslab/site-kit/fonts subpath and fontPreloadLinks([geistLatinUrl, fullKoreanUrl]) in the initial HTML/head. Vite application imports use @devslab/site-kit/fonts/geist/geist-latin-wght-normal.woff2?url and @devslab/site-kit/fonts/pretendard/PretendardVariable.woff2?url, so preload and CSS refer to identical content-hashed files. FAMILY_FONT_PRELOAD_FILE is the existing Latin path; FAMILY_FONT_ATOMIC_FILE is the complete Korean path; FAMILY_FONT_MONO_FILE is available when the initial screen uses mono text. Plain HTML/Vite consumers may generate head links from final emitted asset URLs in their HTML build step. Late client-side JS is not an early preload.
|
|
551
|
+
|
|
552
|
+
fontPreloadLinks still accepts only same-origin absolute WOFF2 URLs and supplies type font/woff2 plus anonymous CORS mode. The CSS keeps external same-origin URLs; no inline/data font or CSP expansion is required. The generated private family-font artifact owns content-hashed WOFF2 cache policy; consuming applications apply its descriptors or response helper. Do not change HTML, API or account cache policy as part of a font cache rule.
|
|
553
|
+
|
|
554
|
+
Both stylesheets and the complete font are generated/verified from fonts/manifest.json. The full font is 2,057,688 bytes, SHA256 9599f12fd42fc0bce1cd50b47a0c022e108d7aa64dd0d1bb0ed44f3282d900b4, from pretendard@1.3.9 dist/web/variable/woff2/PretendardVariable.woff2. It shares the packaged OFL-1.1 license with the preserved upstream subsets. This opt-in does not copy application-specific inline critical fonts or calibrated local font metrics; consumers must verify real first-paint glyphs/layout under cold, warm and delayed font loading.
|
|
555
|
+
|
|
556
|
+
The atomic stylesheet also overrides only the sans token’s Korean entry with the CSS alias `DDS Pretendard Atomic`. Keep this stylesheet after the token stylesheet. The original font bytes, all other fallback entries, and the legacy `fonts.css` remain unchanged; an installed `Pretendard` face cannot enter the optional fallback later.
|
|
557
|
+
|
|
558
|
+
### Generated private family-font artifact
|
|
559
|
+
|
|
560
|
+
The runtime-neutral UI font artifact is generated from this package, the canonical token foundations and the pinned font manifest. It is private, carries no runtime or peer dependencies or install lifecycle, and is consumed by file/SRI pin; it is not published to npm. See [the source contract](src/family-fonts/README.md). Applications retain their component versions and use this one artifact for UI font CSS, paths, fallback roles, preload selection and cache rules.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type LocaleMenuProps, type LocaleMenuVariant } from "./locale-menu";
|
|
3
|
+
import type { ConsentManager } from "@devslab/site-kit";
|
|
4
|
+
import type { LocaleList, LocaleState, SiteBrand, SiteLink, SiteMessages, ThemePreference } from "./types";
|
|
5
|
+
export type { LocaleMenuProps };
|
|
6
|
+
export interface ThemeToggleProps {
|
|
7
|
+
messages: SiteMessages;
|
|
8
|
+
value?: ThemePreference;
|
|
9
|
+
defaultValue?: ThemePreference;
|
|
10
|
+
onValueChange?: (theme: ThemePreference) => void;
|
|
11
|
+
storageKey?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Two states on screen, three in storage — the Solid ThemeToggle, line for
|
|
15
|
+
* line. The server cannot know the visitor's theme, so the first render (on
|
|
16
|
+
* the server and in hydration) always shows the "switch to dark" icon; the
|
|
17
|
+
* stored preference is applied after mount, which is the same moment on both
|
|
18
|
+
* sides and so cannot drift.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ThemeToggle(props: ThemeToggleProps): import("react").JSX.Element;
|
|
21
|
+
export interface SiteHeaderProps {
|
|
22
|
+
brand: SiteBrand;
|
|
23
|
+
navigation: SiteLink[];
|
|
24
|
+
/**
|
|
25
|
+
* The language picker's state. Omit it and no picker is rendered — a
|
|
26
|
+
* single-language product has nothing to pick, and a picker with one entry
|
|
27
|
+
* reads as broken.
|
|
28
|
+
*/
|
|
29
|
+
locale?: LocaleState;
|
|
30
|
+
messages: SiteMessages;
|
|
31
|
+
theme?: Omit<ThemeToggleProps, "messages">;
|
|
32
|
+
onLocaleChange?: LocaleMenuProps["onLocaleChange"];
|
|
33
|
+
localeVariant?: LocaleMenuVariant;
|
|
34
|
+
/** The languages the picker offers. Defaults to the family's fourteen. See LocaleList. */
|
|
35
|
+
localeRegistry?: LocaleList;
|
|
36
|
+
actions?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare function SiteHeader(props: SiteHeaderProps): import("react").JSX.Element;
|
|
39
|
+
export interface SiteFooterProps {
|
|
40
|
+
brand: SiteBrand;
|
|
41
|
+
links: SiteLink[];
|
|
42
|
+
copyright: string;
|
|
43
|
+
/** Wraps the copyright in a link — the family site, usually. */
|
|
44
|
+
copyrightHref?: string;
|
|
45
|
+
messages: SiteMessages;
|
|
46
|
+
/** The language row. Omit it and no row is rendered. */
|
|
47
|
+
locale?: LocaleState;
|
|
48
|
+
/** The languages the row lists. Defaults to the family's fourteen. See LocaleList. */
|
|
49
|
+
localeRegistry?: LocaleList;
|
|
50
|
+
/** Called with the picked code before the browser follows the link. */
|
|
51
|
+
onLocaleSelect?: (locale: string) => void;
|
|
52
|
+
/** Links after the brand name, middot-separated: the family line, the operator. */
|
|
53
|
+
family?: SiteLink[];
|
|
54
|
+
/** A block under the brand line: business registration, address. */
|
|
55
|
+
details?: ReactNode;
|
|
56
|
+
/** Names the link list as its own `<nav>` landmark. Without it, a plain list. */
|
|
57
|
+
linksLabel?: string;
|
|
58
|
+
/** A "쿠키 설정" button that re-opens the consent settings (D-034). */
|
|
59
|
+
consentSettings?: {
|
|
60
|
+
controller: ConsentManager;
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** The family footer: a language row, then the brand and its family links, then the page's links and the copyright. */
|
|
65
|
+
export declare function SiteFooter(props: SiteFooterProps): import("react").JSX.Element;
|
|
66
|
+
//# sourceMappingURL=chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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