@incodetech/prizma-core-screens 0.2.20 → 0.2.22

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.
@@ -11,6 +11,20 @@ import { PrizmaScreenShell } from './ScreenShell';
11
11
  import './ScreenLayout.css';
12
12
  import './ViewfinderScreen.css';
13
13
  import './IdCaptureLayout.css';
14
+ /**
15
+ * The manual-mode instruction, in the shape the strings table gives it: a list
16
+ * of steps becomes a real `<ol>` on the Tooltip's content slot (screen readers
17
+ * announce "list, 2 items"); a plain string goes through `tooltipText` and
18
+ * keeps its own line breaks. Nothing set, no bubble.
19
+ */
20
+ const manualTooltipProps = (copy) => {
21
+ if (Array.isArray(copy)) {
22
+ return {
23
+ tooltip: (_jsx("ol", { children: copy.map((step, index) => (_jsx("li", { children: step }, index))) })),
24
+ };
25
+ }
26
+ return { tooltipText: copy };
27
+ };
14
28
  /**
15
29
  * Purple stage state → Core `PrizmaIdCapture` state. The mapping is 1:1 except
16
30
  * `flash`, which Figma spells "flash" and Core spells `photo-flash`.
@@ -118,7 +132,7 @@ export const IdCaptureStageScreen = forwardRef(({ strings, documentType = 'id',
118
132
  overrides?.align === 'left' ? 'prizma-viewfinder__content--left' : '',
119
133
  ]
120
134
  .filter(Boolean)
121
- .join(' '), children: [_jsx("div", { className: "id-capture-band id-capture-band--top", children: pillKind && pillCopy ? (_jsx("div", { className: "id-capture-stage__feedback", children: _jsx(PrizmaCaptureFeedback, { feedback: pillKind, title: pillCopy.title, subtitle: pillCopy.subtitle }) })) : (_jsxs(_Fragment, { children: [_jsx("h2", { className: "prizma-viewfinder__title", children: slice.title }), slice.instruction && !manual ? (_jsx("p", { className: "prizma-viewfinder__instruction", children: slice.instruction })) : null] })) }), _jsx(PrizmaIdCapture, { type: documentType, state: CAPTURE_STATE[state], isVertical: vertical, mode: "overlay", scrim: true, countdownValue: countdownValue, encryptedLabel: strings.encryptedLabel, announcement: strings.stage.stateLabels?.[state], still: still }), _jsx("div", { className: "id-capture-band", children: band ? _jsx("div", { className: "id-capture-stage__notice", children: band }) : null })] }), _jsx("div", { className: "prizma-screen-layout__capture-strip", children: _jsx(PrizmaCaptureManual, { className: "id-capture-stage__manual", variant: "id-capture", showButton: manual, showTooltip: manual, showHelpIcon: true, tooltipText: manual ? strings.stage.manualTooltip : undefined, ariaLabel: strings.stage.captureLabel, helpLabel: strings.stage.helpLabel, onCapture: () => onAction?.({ type: 'cta', screenId }), onHelp: () => onAction?.({ type: 'help', screenId }) }) }), _jsx("div", { className: "prizma-screen-layout__footer", children: _jsx(PrizmaTag, { label: strings.verifiedLabel }) })] }));
135
+ .join(' '), children: [_jsx("div", { className: "id-capture-band id-capture-band--top", children: pillKind && pillCopy ? (_jsx("div", { className: "id-capture-stage__feedback", children: _jsx(PrizmaCaptureFeedback, { feedback: pillKind, title: pillCopy.title, subtitle: pillCopy.subtitle }) })) : (_jsxs(_Fragment, { children: [_jsx("h2", { className: "prizma-viewfinder__title", children: slice.title }), slice.instruction && !manual ? (_jsx("p", { className: "prizma-viewfinder__instruction", children: slice.instruction })) : null] })) }), _jsx(PrizmaIdCapture, { type: documentType, state: CAPTURE_STATE[state], isVertical: vertical, mode: "overlay", scrim: true, countdownValue: countdownValue, encryptedLabel: strings.encryptedLabel, announcement: strings.stage.stateLabels?.[state], still: still }), _jsx("div", { className: "id-capture-band", children: band ? _jsx("div", { className: "id-capture-stage__notice", children: band }) : null })] }), _jsx("div", { className: "prizma-screen-layout__capture-strip", children: _jsx(PrizmaCaptureManual, { className: "id-capture-stage__manual", variant: "id-capture", showButton: manual, showTooltip: manual, showHelpIcon: true, ...manualTooltipProps(manual ? strings.stage.manualTooltip : undefined), ariaLabel: strings.stage.captureLabel, helpLabel: strings.stage.helpLabel, onCapture: () => onAction?.({ type: 'cta', screenId }), onHelp: () => onAction?.({ type: 'help', screenId }) }) }), _jsx("div", { className: "prizma-screen-layout__footer", children: _jsx(PrizmaTag, { label: strings.verifiedLabel }) })] }));
122
136
  });
123
137
  IdCaptureStageScreen.displayName = 'IdCaptureStageScreen';
124
138
  export default IdCaptureStageScreen;
@@ -92,9 +92,11 @@ export interface IdCaptureStrings {
92
92
  title: string;
93
93
  instruction?: string;
94
94
  };
95
- /** Manual mode — the tooltip bubble above the shutter
96
- * ("1. Fill the frame with your ID / 2. Press the button"). */
97
- manualTooltip?: string;
95
+ /** Manual mode — the tooltip bubble above the shutter. A list of steps
96
+ * renders as a numbered list (`["Fill the frame with your ID", "Press
97
+ * the button"]`), which keeps the list semantics for screen readers; a
98
+ * plain string renders as is, with `\n` breaking the line. */
99
+ manualTooltip?: string | string[];
98
100
  /** Accessible name of the shutter button (manual mode). */
99
101
  captureLabel?: string;
100
102
  /** Accessible name of the "?" help control. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/prizma-core-screens",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Prizma Design System — SDK module screens: composed, responsive, brand-themeable React screens built from @incodetech/prizma-core-web.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -847,8 +847,8 @@
847
847
  },
848
848
  "dependencies": {
849
849
  "@incodetech/prizma-core-icons": "^0.4.0",
850
- "@incodetech/prizma-core-tokens": "^0.18.0",
851
- "@incodetech/prizma-core-web": "^0.18.0"
850
+ "@incodetech/prizma-core-tokens": "^0.19.0",
851
+ "@incodetech/prizma-core-web": "^0.19.0"
852
852
  },
853
853
  "devDependencies": {
854
854
  "@types/react": "^18.3.12",
@@ -21,6 +21,29 @@ import './ScreenLayout.css';
21
21
  import './ViewfinderScreen.css';
22
22
  import './IdCaptureLayout.css';
23
23
 
24
+ /**
25
+ * The manual-mode instruction, in the shape the strings table gives it: a list
26
+ * of steps becomes a real `<ol>` on the Tooltip's content slot (screen readers
27
+ * announce "list, 2 items"); a plain string goes through `tooltipText` and
28
+ * keeps its own line breaks. Nothing set, no bubble.
29
+ */
30
+ const manualTooltipProps = (
31
+ copy: string | string[] | undefined,
32
+ ): Pick<React.ComponentProps<typeof PrizmaCaptureManual>, 'tooltip' | 'tooltipText'> => {
33
+ if (Array.isArray(copy)) {
34
+ return {
35
+ tooltip: (
36
+ <ol>
37
+ {copy.map((step, index) => (
38
+ <li key={index}>{step}</li>
39
+ ))}
40
+ </ol>
41
+ ),
42
+ };
43
+ }
44
+ return { tooltipText: copy };
45
+ };
46
+
24
47
  /**
25
48
  * Purple stage state → Core `PrizmaIdCapture` state. The mapping is 1:1 except
26
49
  * `flash`, which Figma spells "flash" and Core spells `photo-flash`.
@@ -297,7 +320,7 @@ export const IdCaptureStageScreen = forwardRef<HTMLDivElement, IdCaptureStageScr
297
320
  showButton={manual}
298
321
  showTooltip={manual}
299
322
  showHelpIcon
300
- tooltipText={manual ? strings.stage.manualTooltip : undefined}
323
+ {...manualTooltipProps(manual ? strings.stage.manualTooltip : undefined)}
301
324
  ariaLabel={strings.stage.captureLabel}
302
325
  helpLabel={strings.stage.helpLabel}
303
326
  onCapture={() => onAction?.({ type: 'cta', screenId })}
@@ -116,9 +116,11 @@ export interface IdCaptureStrings {
116
116
  front: { title: string; instruction?: string };
117
117
  back: { title: string; instruction?: string };
118
118
  passport: { title: string; instruction?: string };
119
- /** Manual mode — the tooltip bubble above the shutter
120
- * ("1. Fill the frame with your ID / 2. Press the button"). */
121
- manualTooltip?: string;
119
+ /** Manual mode — the tooltip bubble above the shutter. A list of steps
120
+ * renders as a numbered list (`["Fill the frame with your ID", "Press
121
+ * the button"]`), which keeps the list semantics for screen readers; a
122
+ * plain string renders as is, with `\n` breaking the line. */
123
+ manualTooltip?: string | string[];
122
124
  /** Accessible name of the shutter button (manual mode). */
123
125
  captureLabel?: string;
124
126
  /** Accessible name of the "?" help control. */