@devslab/site-kit 0.30.0 → 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 +52 -1
- package/README.md +52 -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/package.json +38 -10
- package/src/core/locales.d.mts +10 -0
- package/src/core/locales.mjs +18 -0
- package/styles.css +4 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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": [
|
|
@@ -57,6 +57,20 @@
|
|
|
57
57
|
"browser": "./dist/solid.js",
|
|
58
58
|
"default": "./dist/solid.js"
|
|
59
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
|
+
},
|
|
60
74
|
"./tanstack-start": {
|
|
61
75
|
"types": "./src/tanstack-start.d.mts",
|
|
62
76
|
"import": "./src/tanstack-start.mjs"
|
|
@@ -72,12 +86,14 @@
|
|
|
72
86
|
}
|
|
73
87
|
},
|
|
74
88
|
"dependencies": {
|
|
75
|
-
"@devslab/dds-solid": "0.
|
|
89
|
+
"@devslab/dds-solid": "0.31.0",
|
|
90
|
+
"@devslab/dds-icons": "0.31.0"
|
|
76
91
|
},
|
|
77
92
|
"peerDependencies": {
|
|
78
93
|
"@tanstack/solid-router": "1.170.30",
|
|
79
94
|
"@tanstack/solid-start": "1.168.47",
|
|
80
|
-
"solid-js": "1.9.15"
|
|
95
|
+
"solid-js": "1.9.15",
|
|
96
|
+
"react": "^18.3.0 || ^19.0.0"
|
|
81
97
|
},
|
|
82
98
|
"peerDependenciesMeta": {
|
|
83
99
|
"@tanstack/solid-router": {
|
|
@@ -85,16 +101,27 @@
|
|
|
85
101
|
},
|
|
86
102
|
"@tanstack/solid-start": {
|
|
87
103
|
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"solid-js": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"react": {
|
|
109
|
+
"optional": true
|
|
88
110
|
}
|
|
89
111
|
},
|
|
90
112
|
"devDependencies": {
|
|
91
|
-
"@types/node": "26.3.0",
|
|
92
113
|
"@tanstack/solid-router": "1.170.30",
|
|
93
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",
|
|
94
120
|
"axe-core": "4.13.0",
|
|
95
121
|
"jsdom": "30.0.1",
|
|
122
|
+
"react": "19.3.0",
|
|
123
|
+
"react-dom": "19.3.0",
|
|
96
124
|
"solid-js": "1.9.15",
|
|
97
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
98
125
|
"typescript": "7.0.2",
|
|
99
126
|
"vite": "8.2.1",
|
|
100
127
|
"vite-plugin-solid": "2.11.14",
|
|
@@ -107,16 +134,17 @@
|
|
|
107
134
|
},
|
|
108
135
|
"keywords": [
|
|
109
136
|
"solidjs",
|
|
137
|
+
"react",
|
|
110
138
|
"i18n",
|
|
111
139
|
"seo",
|
|
112
140
|
"design-system",
|
|
113
141
|
"devslab"
|
|
114
142
|
],
|
|
115
143
|
"scripts": {
|
|
116
|
-
"build": "vite build && vite build --config vite.server.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
117
|
-
"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",
|
|
118
|
-
"test": "vitest run --config vitest.config.ts && vitest run --config vitest.ssr.config.ts",
|
|
119
|
-
"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",
|
|
120
148
|
"test:worker": "wrangler deploy --dry-run --config fixtures/worker/wrangler.jsonc --outdir dist-worker"
|
|
121
149
|
}
|
|
122
150
|
}
|
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; }
|