@ultimat3/ui 27.3.0 → 27.5.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 +5 -1
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/ui-catalog.ts +14 -0
package/README.md
CHANGED
|
@@ -493,7 +493,11 @@ catalog — so every built-in string in the tree renders its key: `<Dialog>`'s c
|
|
|
493
493
|
`⟦ui.close⟧`, `<Field>`'s marker `⟦ui.required⟧`. The keys are `UI_KEYS`, and they live in the
|
|
494
494
|
framework catalog the SERVER has registered; a browser chunk has none, which is why
|
|
495
495
|
`translatorFor(locale)` on the client is the same empty answer wearing a better name. Send the
|
|
496
|
-
subset
|
|
496
|
+
subset and build the translator from it — the framework's two halves (`As of 2026-10`, #710):
|
|
497
|
+
the page passes `ui={uiCatalog(t)}` (every `UI_KEYS` template in the request's locale, plurals
|
|
498
|
+
included) and the island renders `<UiProvider t={subsetTranslator(props.ui)}>`, with
|
|
499
|
+
`subsetTranslator` from `@ultimat3/i18n/subset` — an entry that carries no framework catalog, so
|
|
500
|
+
only an island that imports it pays for the lookup. `t` itself — `@ultimat3/i18n`'s bare
|
|
497
501
|
exported function — is not a `Translator` and is `TS2739` in this position.
|
|
498
502
|
|
|
499
503
|
An island's own copy is a different thing and stays a plain prop: it arrives already translated,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/ui",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.5.0",
|
|
4
4
|
"description": "SolidJS design system: semantic design tokens, dark/RTL-ready SCSS modules, a11y primitives",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"icons": "bun run src/icons/build-icons.ts"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@ultimat3/core": "27.
|
|
53
|
-
"@ultimat3/i18n": "27.
|
|
54
|
-
"@ultimat3/money": "27.
|
|
55
|
-
"@ultimat3/time": "27.
|
|
52
|
+
"@ultimat3/core": "27.5.0",
|
|
53
|
+
"@ultimat3/i18n": "27.5.0",
|
|
54
|
+
"@ultimat3/money": "27.5.0",
|
|
55
|
+
"@ultimat3/time": "27.5.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"solid-js": "^1.9.0"
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The design system's own strings, ready to cross into an island. `@ultimat3/ui` resolves every
|
|
2
|
+
// `ui.*` key through the provider's translator, and a translator cannot be an island's prop — so
|
|
3
|
+
// the server resolves all of them once (`uiCatalog(t)`) and the island hands
|
|
4
|
+
// `<UiProvider t={subsetTranslator(props.ui)}>` a translator over them (`@ultimat3/i18n/subset`:
|
|
5
|
+
// only an island that imports it pays for the lookup). The whole namespace, never a per-component pick: which keys a
|
|
6
|
+
// component reads is the design system's business, and an app that listed them guessed.
|
|
7
|
+
|
|
8
|
+
import type { CatalogSubset, RawTranslator } from '@ultimat3/i18n/subset';
|
|
9
|
+
import { catalogSubset } from '@ultimat3/i18n/subset';
|
|
10
|
+
import { UI_KEYS } from './i18n-keys';
|
|
11
|
+
|
|
12
|
+
/** Every `ui.*` template in the request's locale, as JSON an island's props can carry. */
|
|
13
|
+
export const uiCatalog = (t: RawTranslator): CatalogSubset =>
|
|
14
|
+
catalogSubset(t, Object.values(UI_KEYS));
|