@cosmicdrift/kumiko-renderer 0.189.0 → 0.191.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.189.0",
3
+ "version": "0.191.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.189.0",
19
- "@cosmicdrift/kumiko-headless": "0.189.0",
18
+ "@cosmicdrift/kumiko-framework": "0.191.0",
19
+ "@cosmicdrift/kumiko-headless": "0.191.0",
20
20
  "react": "^19.2.6",
21
21
  "temporal-polyfill": "^0.3.2",
22
22
  "zod": "^4.4.3"
@@ -362,7 +362,8 @@ export function RenderEdit<TValues extends FormValues, TCtx = unknown>(
362
362
  const [extensionErrorKey, setExtensionErrorKey] = useState<string | null>(null);
363
363
  const { registry: extensionFormRegistry, runAll: runExtensionSubmits } =
364
364
  useExtensionFormHost(setExtensionDirty);
365
- const { Button, Banner, Dialog, Form, Section, Grid, GridCell, Text, Progress } = usePrimitives();
365
+ const { Button, Banner, Dialog, Form, Section, Grid, GridCell, Text, Progress, StepBar } =
366
+ usePrimitives();
366
367
 
367
368
  const fields = useMemo(() => deriveFormFields<TValues, TCtx>(screen), [screen]);
368
369
 
@@ -926,12 +927,40 @@ export function RenderEdit<TValues extends FormValues, TCtx = unknown>(
926
927
  testId="render-edit-wizard-progress"
927
928
  />
928
929
  )}
929
- <Text variant="small" testId="render-edit-wizard-step-label">
930
- {translate("kumiko.wizard.step", {
931
- current: currentStep + 1,
932
- total: lastStepIndex + 1,
933
- })}
934
- </Text>
930
+ {(() => {
931
+ const currentTitle = filteredSections[currentStep]?.title;
932
+ const compactLabel =
933
+ currentTitle !== undefined
934
+ ? translate("kumiko.wizard.step-with-title", {
935
+ current: currentStep + 1,
936
+ total: lastStepIndex + 1,
937
+ title: currentTitle,
938
+ })
939
+ : translate("kumiko.wizard.step", {
940
+ current: currentStep + 1,
941
+ total: lastStepIndex + 1,
942
+ });
943
+ // No StepBar registered → keep the plain label RenderEdit
944
+ // always had (additive rollout, see CorePrimitives.StepBar).
945
+ if (StepBar === undefined) {
946
+ return (
947
+ <Text variant="small" testId="render-edit-wizard-step-label">
948
+ {compactLabel}
949
+ </Text>
950
+ );
951
+ }
952
+ return (
953
+ <StepBar
954
+ steps={filteredSections.map(
955
+ (section, sectionIndex) => section.title ?? String(sectionIndex + 1),
956
+ )}
957
+ currentIndex={currentStep}
958
+ compactLabel={compactLabel}
959
+ testId="render-edit-wizard-steps"
960
+ compactTestId="render-edit-wizard-step-label"
961
+ />
962
+ );
963
+ })()}
935
964
  </>
936
965
  )}
937
966
  {(isWizard ? filteredSections.filter((_, i) => i === currentStep) : filteredSections).map(
@@ -28,6 +28,10 @@ export const kumikoDefaultTranslations: TranslationsByLocale = {
28
28
 
29
29
  // Wizard step chrome (RenderEdit layout.mode="wizard").
30
30
  "kumiko.wizard.step": "Schritt {current} von {total}",
31
+ "kumiko.wizard.step-with-title": "Schritt {current} von {total} · {title}",
32
+
33
+ // StepBar widget (renderer-web) — screen-reader text for completed steps whose number is visually replaced by a checkmark.
34
+ "kumiko.widget.stepBar.done": "Erledigt",
31
35
 
32
36
  // Version — Update-Awareness-Banner (UpdateChecker).
33
37
  "kumiko.version.update-available": "Eine neue Version ist verfügbar.",
@@ -205,6 +209,9 @@ export const kumikoDefaultTranslations: TranslationsByLocale = {
205
209
  "kumiko.actions.finish": "Finish",
206
210
 
207
211
  "kumiko.wizard.step": "Step {current} of {total}",
212
+ "kumiko.wizard.step-with-title": "Step {current} of {total} · {title}",
213
+
214
+ "kumiko.widget.stepBar.done": "Done",
208
215
 
209
216
  "kumiko.version.update-available": "A new version is available.",
210
217
 
package/src/index.ts CHANGED
@@ -178,6 +178,7 @@ export type {
178
178
  ProgressProps,
179
179
  RuntimeRenderer,
180
180
  SectionProps,
181
+ StepBarProps,
181
182
  TextProps,
182
183
  } from "./primitives";
183
184
  export { PrimitivesProvider, usePrimitives } from "./primitives";
@@ -883,6 +883,21 @@ export type ProgressProps = {
883
883
  readonly testId?: string;
884
884
  };
885
885
 
886
+ /** Wizard step overview — numbered chips, one per step label, with the
887
+ * active step highlighted. Not clickable (step-jump validation is a
888
+ * separate concern, kumiko-framework#1966). Implementations render a
889
+ * narrow-viewport fallback showing `compactLabel` instead (caller
890
+ * supplies it pre-translated, e.g. "Step 2 of 5 · Industry") — which of
891
+ * the two is visible is a responsive layout choice owned by the
892
+ * implementation, not this contract. */
893
+ export type StepBarProps = {
894
+ readonly steps: readonly string[];
895
+ readonly currentIndex: number;
896
+ readonly compactLabel: string;
897
+ readonly testId?: string;
898
+ readonly compactTestId?: string;
899
+ };
900
+
886
901
  // ---- Core-Registry (Kumiko-eigene Primitives) ----
887
902
 
888
903
  export type CorePrimitives = {
@@ -912,6 +927,10 @@ export type CorePrimitives = {
912
927
  * CorePrimitives mocks in tests keep compiling — additive rollout of
913
928
  * a new primitive shouldn't force every test double to grow a stub. */
914
929
  readonly Progress?: ComponentType<ProgressProps>;
930
+ /** Optional (unlike the other Core-Primitives) so existing partial
931
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
932
+ * a new primitive shouldn't force every test double to grow a stub. */
933
+ readonly StepBar?: ComponentType<StepBarProps>;
915
934
  };
916
935
 
917
936
  /** Offene Extension-Zone für App-eigene Primitives. Devs erweitern