@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/fonts/manifest.json
CHANGED
|
@@ -668,7 +668,13 @@
|
|
|
668
668
|
"sha256": "fc9fcd1bea9c8f43f97136a1e89bfa6e34db85f820f86538288647b4c24c5b06",
|
|
669
669
|
"unicodeRange": "U+20-22, U+27-2a, U+2c-39, U+3a-3b, U+3f, U+41-4e, U+4f-5d, U+61-7b, U+7d, U+a0-a1, U+ab, U+ad-ae, U+b7, U+bb, U+bf, U+2013-2014, U+201c-201d, U+2122, U+ac00, U+ace0, U+ae30, U+b2e4, U+b85c, U+b9ac, U+c0ac, U+c2a4, U+c2dc, U+c774, U+c778, U+c9c0, U+d558"
|
|
670
670
|
}
|
|
671
|
-
]
|
|
671
|
+
],
|
|
672
|
+
"atomicFace": {
|
|
673
|
+
"file": "PretendardVariable.woff2",
|
|
674
|
+
"bytes": 2057688,
|
|
675
|
+
"sha256": "9599f12fd42fc0bce1cd50b47a0c022e108d7aa64dd0d1bb0ed44f3282d900b4",
|
|
676
|
+
"sourcePath": "dist/web/variable/woff2/PretendardVariable.woff2"
|
|
677
|
+
}
|
|
672
678
|
}
|
|
673
679
|
]
|
|
674
680
|
}
|
|
Binary file
|
package/fonts-atomic.css
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* Generated atomic opt-in by scripts/build-fonts.mjs. Legacy fonts.css is unchanged.
|
|
2
|
+
* Full Pretendard uses a distinct CSS alias and one optional loading decision.
|
|
3
|
+
* Only the opt-in sans token alias changes; installed Pretendard cannot become a late fallback.
|
|
4
|
+
* Same-origin relative WOFF2 URLs preserve font-src 'self'; no local() or inline data fonts.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--dds-font-family-sans: Geist, "DDS Pretendard Atomic", -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: "Geist";
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 100 900;
|
|
15
|
+
font-display: optional;
|
|
16
|
+
src: url("./fonts/geist/geist-cyrillic-ext-wght-normal.woff2") format("woff2");
|
|
17
|
+
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: "Geist";
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: 100 900;
|
|
24
|
+
font-display: optional;
|
|
25
|
+
src: url("./fonts/geist/geist-cyrillic-wght-normal.woff2") format("woff2");
|
|
26
|
+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "Geist";
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 100 900;
|
|
33
|
+
font-display: optional;
|
|
34
|
+
src: url("./fonts/geist/geist-vietnamese-wght-normal.woff2") format("woff2");
|
|
35
|
+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: "Geist";
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 100 900;
|
|
42
|
+
font-display: optional;
|
|
43
|
+
src: url("./fonts/geist/geist-latin-ext-wght-normal.woff2") format("woff2");
|
|
44
|
+
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@font-face {
|
|
48
|
+
font-family: "Geist";
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-weight: 100 900;
|
|
51
|
+
font-display: optional;
|
|
52
|
+
src: url("./fonts/geist/geist-latin-wght-normal.woff2") format("woff2");
|
|
53
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: "Geist Mono";
|
|
58
|
+
font-style: normal;
|
|
59
|
+
font-weight: 100 900;
|
|
60
|
+
font-display: optional;
|
|
61
|
+
src: url("./fonts/geist-mono/geist-mono-cyrillic-ext-wght-normal.woff2") format("woff2");
|
|
62
|
+
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@font-face {
|
|
66
|
+
font-family: "Geist Mono";
|
|
67
|
+
font-style: normal;
|
|
68
|
+
font-weight: 100 900;
|
|
69
|
+
font-display: optional;
|
|
70
|
+
src: url("./fonts/geist-mono/geist-mono-cyrillic-wght-normal.woff2") format("woff2");
|
|
71
|
+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@font-face {
|
|
75
|
+
font-family: "Geist Mono";
|
|
76
|
+
font-style: normal;
|
|
77
|
+
font-weight: 100 900;
|
|
78
|
+
font-display: optional;
|
|
79
|
+
src: url("./fonts/geist-mono/geist-mono-symbols2-wght-normal.woff2") format("woff2");
|
|
80
|
+
unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@font-face {
|
|
84
|
+
font-family: "Geist Mono";
|
|
85
|
+
font-style: normal;
|
|
86
|
+
font-weight: 100 900;
|
|
87
|
+
font-display: optional;
|
|
88
|
+
src: url("./fonts/geist-mono/geist-mono-vietnamese-wght-normal.woff2") format("woff2");
|
|
89
|
+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@font-face {
|
|
93
|
+
font-family: "Geist Mono";
|
|
94
|
+
font-style: normal;
|
|
95
|
+
font-weight: 100 900;
|
|
96
|
+
font-display: optional;
|
|
97
|
+
src: url("./fonts/geist-mono/geist-mono-latin-ext-wght-normal.woff2") format("woff2");
|
|
98
|
+
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@font-face {
|
|
102
|
+
font-family: "Geist Mono";
|
|
103
|
+
font-style: normal;
|
|
104
|
+
font-weight: 100 900;
|
|
105
|
+
font-display: optional;
|
|
106
|
+
src: url("./fonts/geist-mono/geist-mono-latin-wght-normal.woff2") format("woff2");
|
|
107
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@font-face {
|
|
111
|
+
font-family: "DDS Pretendard Atomic";
|
|
112
|
+
font-style: normal;
|
|
113
|
+
font-weight: 45 920;
|
|
114
|
+
font-display: optional;
|
|
115
|
+
src: url("./fonts/pretendard/PretendardVariable.woff2") format("woff2");
|
|
116
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devslab/site-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Strict i18n, SEO/GEO, and Solid public-site shells for DevsLab products",
|
|
3
|
+
"version": "0.31.0",
|
|
4
|
+
"description": "Strict i18n, SEO/GEO, and Solid and React public-site shells for DevsLab products",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"sideEffects": [
|
|
8
8
|
"./styles.css",
|
|
9
9
|
"./site-sections.css",
|
|
10
|
-
"./fonts.css"
|
|
10
|
+
"./fonts.css",
|
|
11
|
+
"./fonts-atomic.css"
|
|
11
12
|
],
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
@@ -30,7 +31,8 @@
|
|
|
30
31
|
"site-sections.css",
|
|
31
32
|
"fonts.css",
|
|
32
33
|
"README.md",
|
|
33
|
-
"README.ko.md"
|
|
34
|
+
"README.ko.md",
|
|
35
|
+
"fonts-atomic.css"
|
|
34
36
|
],
|
|
35
37
|
"main": "./src/core/index.mjs",
|
|
36
38
|
"types": "./src/core/index.d.mts",
|
|
@@ -55,6 +57,20 @@
|
|
|
55
57
|
"browser": "./dist/solid.js",
|
|
56
58
|
"default": "./dist/solid.js"
|
|
57
59
|
},
|
|
60
|
+
"./react": {
|
|
61
|
+
"types": "./dist/react/index.d.ts",
|
|
62
|
+
"default": "./dist/react/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./react/flag-bodies": {
|
|
65
|
+
"types": "./dist/react/flag-bodies.d.ts",
|
|
66
|
+
"react-server": "./dist/react/flag-bodies.server.js",
|
|
67
|
+
"edge-light": "./dist/react/flag-bodies.server.js",
|
|
68
|
+
"workerd": "./dist/react/flag-bodies.server.js",
|
|
69
|
+
"browser": "./dist/react/flag-bodies.js",
|
|
70
|
+
"worker": "./dist/react/flag-bodies.server.js",
|
|
71
|
+
"node": "./dist/react/flag-bodies.server.js",
|
|
72
|
+
"default": "./dist/react/flag-bodies.js"
|
|
73
|
+
},
|
|
58
74
|
"./tanstack-start": {
|
|
59
75
|
"types": "./src/tanstack-start.d.mts",
|
|
60
76
|
"import": "./src/tanstack-start.mjs"
|
|
@@ -62,15 +78,22 @@
|
|
|
62
78
|
"./styles.css": "./styles.css",
|
|
63
79
|
"./site-sections.css": "./site-sections.css",
|
|
64
80
|
"./fonts.css": "./fonts.css",
|
|
65
|
-
"./fonts/*": "./fonts/*"
|
|
81
|
+
"./fonts/*": "./fonts/*",
|
|
82
|
+
"./fonts-atomic.css": "./fonts-atomic.css",
|
|
83
|
+
"./fonts": {
|
|
84
|
+
"types": "./src/core/fonts.d.mts",
|
|
85
|
+
"import": "./src/core/fonts.mjs"
|
|
86
|
+
}
|
|
66
87
|
},
|
|
67
88
|
"dependencies": {
|
|
68
|
-
"@devslab/dds-solid": "0.
|
|
89
|
+
"@devslab/dds-solid": "0.31.0",
|
|
90
|
+
"@devslab/dds-icons": "0.31.0"
|
|
69
91
|
},
|
|
70
92
|
"peerDependencies": {
|
|
71
93
|
"@tanstack/solid-router": "1.170.30",
|
|
72
94
|
"@tanstack/solid-start": "1.168.47",
|
|
73
|
-
"solid-js": "1.9.15"
|
|
95
|
+
"solid-js": "1.9.15",
|
|
96
|
+
"react": "^18.3.0 || ^19.0.0"
|
|
74
97
|
},
|
|
75
98
|
"peerDependenciesMeta": {
|
|
76
99
|
"@tanstack/solid-router": {
|
|
@@ -78,16 +101,27 @@
|
|
|
78
101
|
},
|
|
79
102
|
"@tanstack/solid-start": {
|
|
80
103
|
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"solid-js": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"react": {
|
|
109
|
+
"optional": true
|
|
81
110
|
}
|
|
82
111
|
},
|
|
83
112
|
"devDependencies": {
|
|
84
|
-
"@types/node": "26.3.0",
|
|
85
113
|
"@tanstack/solid-router": "1.170.30",
|
|
86
114
|
"@tanstack/solid-start": "1.168.47",
|
|
115
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
116
|
+
"@testing-library/react": "16.3.2",
|
|
117
|
+
"@types/node": "26.3.0",
|
|
118
|
+
"@types/react": "19.3.0",
|
|
119
|
+
"@types/react-dom": "19.3.0",
|
|
87
120
|
"axe-core": "4.13.0",
|
|
88
121
|
"jsdom": "30.0.1",
|
|
122
|
+
"react": "19.3.0",
|
|
123
|
+
"react-dom": "19.3.0",
|
|
89
124
|
"solid-js": "1.9.15",
|
|
90
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
91
125
|
"typescript": "7.0.2",
|
|
92
126
|
"vite": "8.2.1",
|
|
93
127
|
"vite-plugin-solid": "2.11.14",
|
|
@@ -100,16 +134,17 @@
|
|
|
100
134
|
},
|
|
101
135
|
"keywords": [
|
|
102
136
|
"solidjs",
|
|
137
|
+
"react",
|
|
103
138
|
"i18n",
|
|
104
139
|
"seo",
|
|
105
140
|
"design-system",
|
|
106
141
|
"devslab"
|
|
107
142
|
],
|
|
108
143
|
"scripts": {
|
|
109
|
-
"build": "vite build && vite build --config vite.server.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
110
|
-
"check": "node scripts/build-flags.mjs --check && node scripts/build-fonts.mjs --check && tsc -p tsconfig.json --noEmit && tsc -p fixtures/bundle-probe/tsconfig.json && node scripts/check-client-bundle.mjs",
|
|
111
|
-
"test": "vitest run --config vitest.config.ts && vitest run --config vitest.ssr.config.ts",
|
|
112
|
-
"test:a11y": "vitest run --config vitest.config.ts src/solid/__tests__/a11y.test.tsx",
|
|
144
|
+
"build": "vite build && vite build --config vite.server.config.ts && vite build --config vite.react.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly && tsc -p tsconfig.react.build.json",
|
|
145
|
+
"check": "node scripts/build-flags.mjs --check && node scripts/build-fonts.mjs --check && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.react.json --noEmit && tsc -p fixtures/bundle-probe/tsconfig.json && node scripts/check-client-bundle.mjs && node scripts/check-react-client-bundle.mjs",
|
|
146
|
+
"test": "vitest run --config vitest.config.ts && vitest run --config vitest.ssr.config.ts && vitest run --config vitest.react.config.ts && vitest run --config vitest.react.ssr.config.ts",
|
|
147
|
+
"test:a11y": "vitest run --config vitest.config.ts src/solid/__tests__/a11y.test.tsx && vitest run --config vitest.react.config.ts src/react/__tests__/a11y.test.tsx",
|
|
113
148
|
"test:worker": "wrangler deploy --dry-run --config fixtures/worker/wrangler.jsonc --outdir dist-worker"
|
|
114
149
|
}
|
|
115
150
|
}
|
package/src/core/fonts.d.mts
CHANGED
|
@@ -3,3 +3,8 @@ export declare const FAMILY_FONT_PRELOAD_FILE: "fonts/geist/geist-latin-wght-nor
|
|
|
3
3
|
export interface FontPreloadLink { rel: "preload"; href: string; as: "font"; type: "font/woff2"; crossorigin: "anonymous" }
|
|
4
4
|
/** `<link rel="preload" as="font">` descriptors. Each href is a same-origin path ending in .woff2; anything else throws RangeError. */
|
|
5
5
|
export declare function fontPreloadLinks(hrefs: string | readonly string[]): FontPreloadLink[];
|
|
6
|
+
|
|
7
|
+
/** Complete unmodified Korean face for fonts-atomic.css. */
|
|
8
|
+
export declare const FAMILY_FONT_ATOMIC_FILE: "fonts/pretendard/PretendardVariable.woff2";
|
|
9
|
+
/** Optional preload path when the initial screen includes monospace text. */
|
|
10
|
+
export declare const FAMILY_FONT_MONO_FILE: "fonts/geist-mono/geist-mono-latin-wght-normal.woff2";
|
package/src/core/fonts.mjs
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export const FAMILY_FONT_PRELOAD_FILE = "fonts/geist/geist-latin-wght-normal.woff2";
|
|
18
18
|
|
|
19
|
+
/** Complete unmodified Korean face for the atomic opt-in stylesheet. */
|
|
20
|
+
export const FAMILY_FONT_ATOMIC_FILE = "fonts/pretendard/PretendardVariable.woff2";
|
|
21
|
+
/** Preload this only when the initial screen has monospaced UI text. */
|
|
22
|
+
export const FAMILY_FONT_MONO_FILE = "fonts/geist-mono/geist-mono-latin-wght-normal.woff2";
|
|
23
|
+
|
|
19
24
|
const SAME_ORIGIN_PATH = /^\/(?!\/)/;
|
|
20
25
|
|
|
21
26
|
/**
|
package/src/core/locales.d.mts
CHANGED
|
@@ -41,3 +41,13 @@ export declare const FAMILY_LOCALES: LocaleRegistry<SiteLocale>;
|
|
|
41
41
|
export declare function canonicalLocale(candidate: string | undefined | null): SiteLocale | undefined;
|
|
42
42
|
export declare function localeAttributes(locale: string): { lang: SiteLocale; dir: TextDirection };
|
|
43
43
|
export declare function resolveLocale(input: { pathname?: string; cookie?: string; acceptLanguage?: string; defaultLocale: SiteLocale }): { locale: SiteLocale; source: "route" | "cookie" | "accept-language" | "default" };
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Every language's href as plain data, for a React Server Component that
|
|
47
|
+
* passes `{ locale, hrefs }` to the `@devslab/site-kit/react` chrome — a
|
|
48
|
+
* function cannot cross from a Server Component to a Client Component.
|
|
49
|
+
*/
|
|
50
|
+
export declare function localeHrefs<Code extends string>(
|
|
51
|
+
registry: LocaleRegistry<Code>,
|
|
52
|
+
hrefForLocale: (locale: Code) => string,
|
|
53
|
+
): Record<Code, string>;
|
package/src/core/locales.mjs
CHANGED
|
@@ -139,3 +139,21 @@ function acceptedLocales(header, canonicalLocale) {
|
|
|
139
139
|
export const FAMILY_LOCALES = defineLocaleRegistry();
|
|
140
140
|
|
|
141
141
|
export const { canonicalLocale, localeAttributes, resolveLocale } = FAMILY_LOCALES;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Every language's href as plain data: `{ ko: "/ko", en: "/en", … }`.
|
|
145
|
+
*
|
|
146
|
+
* For a React Server Component that renders the `@devslab/site-kit/react`
|
|
147
|
+
* chrome. A function cannot cross from a Server Component to a Client
|
|
148
|
+
* Component, so the locale state goes over as `{ locale, hrefs }` instead of
|
|
149
|
+
* `{ locale, hrefForLocale }`. It lives here, in the framework-free entry, and
|
|
150
|
+
* not in `./react`: everything exported from a "use client" module is a client
|
|
151
|
+
* reference on the server, which a Server Component can render but not call.
|
|
152
|
+
*
|
|
153
|
+
* @param {{ LOCALES: ReadonlyArray<{ code: string }> }} registry
|
|
154
|
+
* @param {(locale: string) => string} hrefForLocale
|
|
155
|
+
* @returns {Record<string, string>}
|
|
156
|
+
*/
|
|
157
|
+
export function localeHrefs(registry, hrefForLocale) {
|
|
158
|
+
return Object.fromEntries(registry.LOCALES.map((entry) => [entry.code, hrefForLocale(entry.code)]));
|
|
159
|
+
}
|
package/styles.css
CHANGED
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
anywhere, so its min-content is a single letter. */
|
|
29
29
|
.site-header__inner { min-block-size: var(--site-header-block-size, 64px); inline-size: min(100% - var(--dds-space-32), 1120px); margin-inline: auto; display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: var(--dds-space-16); }
|
|
30
30
|
.site-brand { justify-self: start; color: var(--dds-color-text-primary); font-weight: 700; text-decoration: none; }
|
|
31
|
+
/* Opt-in: a mark and a wordmark side by side inside the brand link (a logo plus "쿠루" / "クル").
|
|
32
|
+
The brand link itself stays inline, so the logos products already ship keep their geometry;
|
|
33
|
+
wrap the pair in this and they share one centre line instead of the text's baseline. */
|
|
34
|
+
.site-brand__lockup { display: inline-flex; align-items: center; gap: var(--dds-space-8); }
|
|
31
35
|
.site-nav { grid-column: 2; justify-self: center; min-inline-size: 0; }
|
|
32
36
|
.site-nav__list, .site-footer__links { display: flex; flex-wrap: wrap; gap: var(--dds-space-16); padding: 0; margin: 0; list-style: none; }
|
|
33
37
|
.site-nav__list a, .site-footer__links a { color: var(--dds-color-text-secondary); text-decoration: none; }
|