@cosmicdrift/kumiko-renderer 0.93.0 → 0.95.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-renderer",
3
- "version": "0.93.0",
3
+ "version": "0.95.0",
4
4
  "description": "Platform-agnostic React renderer for Kumiko screens. Contains the shared logic — primitives-contract, hooks, KumikoScreen, navigation & SSE abstractions — that any platform-specific renderer (web, native) composes. No DOM, no EventSource, no react-dom.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -15,8 +15,8 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "@cosmicdrift/kumiko-framework": "0.93.0",
19
- "@cosmicdrift/kumiko-headless": "0.93.0",
18
+ "@cosmicdrift/kumiko-framework": "0.95.0",
19
+ "@cosmicdrift/kumiko-headless": "0.95.0",
20
20
  "react": "^19.2.6"
21
21
  },
22
22
  "devDependencies": {
@@ -271,6 +271,18 @@ function renderInput({
271
271
  {...(field.max !== undefined && { max: field.max })}
272
272
  />
273
273
  );
274
+ case "locatedTimestamp":
275
+ return (
276
+ <Input
277
+ kind="locatedTimestamp"
278
+ {...common}
279
+ value={locatedValue(field.value)}
280
+ onChange={(v) => onChange(v)}
281
+ locale={field.dateLocale ?? appLocale}
282
+ {...(field.min !== undefined && { min: field.min })}
283
+ {...(field.max !== undefined && { max: field.max })}
284
+ />
285
+ );
274
286
  case "select": {
275
287
  // Translated Option-Labels kommen aus dem ViewModel-Builder
276
288
  // (computeEditViewModel, Convention-Key
@@ -346,3 +358,17 @@ function numberValue(v: unknown): number | "" {
346
358
  if (v === undefined || v === null || v === "") return "";
347
359
  return typeof v === "number" ? v : Number(v);
348
360
  }
361
+
362
+ // locatedTimestamp-Feldwert: das Read-Wrapper liefert `{ at, tz, utc }`; leer
363
+ // (noch nicht gesetzt) → "" als Empty-Sentinel, analog money/timestamp.
364
+ function locatedValue(v: unknown): { at: string; tz: string; utc?: string } | "" {
365
+ if (v !== null && typeof v === "object" && "at" in v && "tz" in v) {
366
+ const o = v as { at?: unknown; tz?: unknown; utc?: unknown };
367
+ return {
368
+ at: typeof o.at === "string" ? o.at : "",
369
+ tz: typeof o.tz === "string" ? o.tz : "",
370
+ ...(typeof o.utc === "string" && { utc: o.utc }),
371
+ };
372
+ }
373
+ return "";
374
+ }
@@ -30,6 +30,8 @@ export const kumikoDefaultTranslations: TranslationsByLocale = {
30
30
  // Field — aria-Labels der Date/Timestamp-Primitives.
31
31
  "kumiko.field.open-calendar": "Kalender öffnen",
32
32
  "kumiko.field.time": "Uhrzeit",
33
+ "kumiko.field.timezone": "Zeitzone",
34
+ "kumiko.field.locatedTzHint": "Zeit lokal am angegebenen Ort",
33
35
 
34
36
  // List — DataTable Toolbar, Empty-State, Search.
35
37
  "kumiko.list.search-placeholder": "Suchen…",
@@ -134,6 +136,8 @@ export const kumikoDefaultTranslations: TranslationsByLocale = {
134
136
 
135
137
  "kumiko.field.open-calendar": "Open calendar",
136
138
  "kumiko.field.time": "Time",
139
+ "kumiko.field.timezone": "Time zone",
140
+ "kumiko.field.locatedTzHint": "Time local to the given location",
137
141
 
138
142
  "kumiko.list.search-placeholder": "Search…",
139
143
  "kumiko.list.empty.title": "No entries yet.",
@@ -312,6 +312,24 @@ export type InputProps =
312
312
  readonly required?: boolean;
313
313
  readonly hasError?: boolean;
314
314
  }
315
+ | {
316
+ readonly kind: "locatedTimestamp";
317
+ readonly id: string;
318
+ readonly name: string;
319
+ /** Located-Timestamp-Wert: Wall-Clock `at` (ohne Offset) + IANA-`tz`.
320
+ * `utc` ist beim Read da (server-berechnet) und wird beim Write
321
+ * ignoriert. Empty-State = `""`. onChange emittiert `{ at, tz }`. */
322
+ readonly value: { readonly at: string; readonly tz: string; readonly utc?: string } | "";
323
+ readonly onChange: (v: { readonly at: string; readonly tz: string } | undefined) => void;
324
+ /** Locale für den Datums-Teil. Default = Browser-Locale. */
325
+ readonly locale?: string;
326
+ /** Datumsgrenzen als ISO-Datetime — begrenzen den Kalender. */
327
+ readonly min?: string;
328
+ readonly max?: string;
329
+ readonly disabled?: boolean;
330
+ readonly required?: boolean;
331
+ readonly hasError?: boolean;
332
+ }
315
333
  | {
316
334
  readonly kind: "textarea";
317
335
  readonly id: string;