@alfadocs/ui-kit-debug 0.35.0 → 0.36.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.
@@ -1 +1 @@
1
- {"version":3,"file":"tooth-scheme-CxlsLjfN.js","sources":["../../src/components/tooth-scheme/tooth-scheme.agent.ts","../../src/components/tooth-scheme/tooth-data.ts","../../src/components/tooth-scheme/tooth-scheme.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ToothSchemeHandle } from './tooth-scheme';\n\nexport const toothSchemeAgent: AgentAdapter<ToothSchemeHandle> = {\n id: 'tooth-scheme',\n capabilities: ['pick'],\n state: {\n chart: {\n type: 'object',\n description:\n 'Current dental chart state — tooth conditions keyed by FDI id.',\n read: (handle) => handle.getChart(),\n },\n },\n actions: {\n focus_tooth: {\n safety: 'read',\n argsType: '{ id: FdiId }',\n description: 'Move focus to a specific tooth by FDI id.',\n invoke: (\n handle,\n args: { id: Parameters<ToothSchemeHandle['focusTooth']>[0] },\n ) => {\n handle.focusTooth(args.id);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'tooth-scheme' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-fdi',\n description:\n 'Each rendered tooth `<g>` carries its FDI id as `data-fdi`. Tests still use `data-testid=\"tooth-<fdi>\"` separately.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* ToothScheme — data model + lookup tables. */\n/* */\n/* FDI ISO 3950 is the canonical internal id. This module exposes */\n/* conversion tables to Universal (ADA) and a simplified Palmer-style */\n/* quadrant+position string so consuming UIs can toggle numbering. */\n/* */\n/* Why simplified Palmer? True Palmer notation uses quadrant bracket */\n/* glyphs (\"⌐\", \"¬\", \"L\", \"J\") that do not render reliably in every */\n/* browser/font combination. We emit a readable `UR3` / `LL6` form */\n/* instead and document the deviation in the component MDX. */\n/* ------------------------------------------------------------------ */\n\n/* ------------------------------------------------------------------ */\n/* Core types */\n/* ------------------------------------------------------------------ */\n\nexport type FdiId = string; // '11'–'48' permanent, '51'–'85' primary\n\nexport type Dentition = 'permanent' | 'primary' | 'mixed';\nexport type Numbering = 'fdi' | 'universal' | 'palmer';\nexport type ToothMode = 'interactive' | 'display';\nexport type Surface = 'mesial' | 'distal' | 'occlusal' | 'buccal' | 'lingual';\nexport type ToothCondition =\n | 'caries'\n | 'filled'\n | 'crowned'\n | 'missing'\n | 'implant'\n | 'rootCanal';\n\nexport interface ToothState {\n conditions: ToothCondition[];\n surfaces: Surface[];\n notes?: string;\n}\n\nexport type ToothChart = Record<FdiId, ToothState>;\n\nexport type Anatomy = 'incisor' | 'canine' | 'premolar' | 'molar';\nexport type Arch = 'upper' | 'lower';\nexport type Side = 'right' | 'left'; // patient's side (NOT viewer's)\nexport type Quadrant = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n\nexport interface ToothMeta {\n fdi: FdiId;\n /** '1'–'32' for permanent, 'A'–'T' for primary. */\n universal: string;\n /** Simplified Palmer quadrant-and-position string, e.g. 'UR3', 'LL6'. */\n palmer: string;\n quadrant: Quadrant;\n /** 1–8 (permanent) or 1–5 (primary), counted from the midline outward. */\n positionInQuadrant: number;\n anatomy: Anatomy;\n arch: Arch;\n side: Side;\n dentition: 'permanent' | 'primary';\n}\n\n/* ------------------------------------------------------------------ */\n/* Layout orders */\n/* */\n/* Layout reads from the viewer's perspective, top-left to bottom- */\n/* right. The chart is FIXED in clinical convention: the patient's */\n/* right side sits on the viewer's left, regardless of document `dir`. */\n/* ------------------------------------------------------------------ */\n\n/**\n * 32 permanent teeth in visual layout order:\n * upper row: 18..11 (patient upper-right, outermost → midline), then 21..28 (upper-left, midline → outermost)\n * lower row: 48..41 (patient lower-right, outermost → midline), then 31..38 (lower-left, midline → outermost)\n */\nexport const PERMANENT_TEETH: FdiId[] = [\n // upper\n '18',\n '17',\n '16',\n '15',\n '14',\n '13',\n '12',\n '11',\n '21',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n // lower\n '48',\n '47',\n '46',\n '45',\n '44',\n '43',\n '42',\n '41',\n '31',\n '32',\n '33',\n '34',\n '35',\n '36',\n '37',\n '38',\n];\n\n/**\n * 20 primary teeth in visual layout order:\n * upper row: 55..51 (upper-right outermost → midline), then 61..65\n * lower row: 85..81, then 71..75\n */\nexport const PRIMARY_TEETH: FdiId[] = [\n // upper\n '55',\n '54',\n '53',\n '52',\n '51',\n '61',\n '62',\n '63',\n '64',\n '65',\n // lower\n '85',\n '84',\n '83',\n '82',\n '81',\n '71',\n '72',\n '73',\n '74',\n '75',\n];\n\n/* ------------------------------------------------------------------ */\n/* Anatomy by position */\n/* ------------------------------------------------------------------ */\n\nfunction permanentAnatomy(positionInQuadrant: number): Anatomy {\n if (positionInQuadrant <= 2) return 'incisor';\n if (positionInQuadrant === 3) return 'canine';\n if (positionInQuadrant <= 5) return 'premolar';\n return 'molar';\n}\n\nfunction primaryAnatomy(positionInQuadrant: number): Anatomy {\n if (positionInQuadrant <= 2) return 'incisor';\n if (positionInQuadrant === 3) return 'canine';\n // Primary dentition has no premolars — positions 4 & 5 are molars.\n return 'molar';\n}\n\n/* ------------------------------------------------------------------ */\n/* Palmer helper */\n/* ------------------------------------------------------------------ */\n\nfunction palmerCode(quadrant: Quadrant, position: number): string {\n // Permanent: 1=UR, 2=UL, 3=LL, 4=LR. Primary: 5=UR, 6=UL, 7=LL, 8=LR.\n // Mapping is identical within each dentition ring; the number is what\n // changes, so we fold 5→1, 6→2, 7→3, 8→4 to derive the quadrant code.\n const normalised = ((quadrant - 1) % 4) + 1;\n const code =\n normalised === 1\n ? 'UR'\n : normalised === 2\n ? 'UL'\n : normalised === 3\n ? 'LL'\n : 'LR';\n return `${code}${position}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Universal (ADA) conversion */\n/* */\n/* Permanent — Universal numbers 1..32 run clockwise from the */\n/* patient's upper-right 3rd molar (FDI 18 = Universal 1), across */\n/* the upper arch (18→11 = 1→8, 21→28 = 9→16), then down the left */\n/* lower arch (38→31 = 17→24) and across the right lower (41→48 = */\n/* 25→32). */\n/* */\n/* Primary — Universal letters A..T walk the same path: */\n/* 55→51 = A→E, 61→65 = F→J, 75→71 = K→O, 81→85 = P→T. */\n/* ------------------------------------------------------------------ */\n\nfunction permanentUniversal(quadrant: Quadrant, position: number): string {\n switch (quadrant) {\n case 1:\n // 18→1, 17→2, …, 11→8\n return String(1 + (8 - position));\n case 2:\n // 21→9, 22→10, …, 28→16\n return String(8 + position);\n case 3:\n // 38→17, 37→18, …, 31→24\n return String(17 + (8 - position));\n case 4:\n // 41→25, 42→26, …, 48→32\n return String(24 + position);\n default:\n return '';\n }\n}\n\nfunction primaryUniversal(quadrant: Quadrant, position: number): string {\n const letters = 'ABCDEFGHIJKLMNOPQRST';\n let index = -1;\n switch (quadrant) {\n case 5:\n // 55→A, 54→B, 53→C, 52→D, 51→E\n index = 0 + (5 - position);\n break;\n case 6:\n // 61→F, 62→G, 63→H, 64→I, 65→J\n index = 5 + (position - 1);\n break;\n case 7:\n // 75→K, 74→L, 73→M, 72→N, 71→O\n index = 10 + (5 - position);\n break;\n case 8:\n // 81→P, 82→Q, 83→R, 84→S, 85→T\n index = 15 + (position - 1);\n break;\n default:\n index = -1;\n }\n return index >= 0 ? letters[index] : '';\n}\n\n/* ------------------------------------------------------------------ */\n/* Meta builder */\n/* ------------------------------------------------------------------ */\n\nfunction buildMeta(fdi: FdiId): ToothMeta {\n const quadrant = Number(fdi[0]) as Quadrant;\n const position = Number(fdi[1]);\n const isPrimary = quadrant >= 5;\n const anatomy = isPrimary\n ? primaryAnatomy(position)\n : permanentAnatomy(position);\n const arch: Arch =\n quadrant === 1 || quadrant === 2 || quadrant === 5 || quadrant === 6\n ? 'upper'\n : 'lower';\n const side: Side =\n quadrant === 1 || quadrant === 4 || quadrant === 5 || quadrant === 8\n ? 'right'\n : 'left';\n const universal = isPrimary\n ? primaryUniversal(quadrant, position)\n : permanentUniversal(quadrant, position);\n const palmer = palmerCode(quadrant, position);\n return {\n fdi,\n universal,\n palmer,\n quadrant,\n positionInQuadrant: position,\n anatomy,\n arch,\n side,\n dentition: isPrimary ? 'primary' : 'permanent',\n };\n}\n\nexport const FDI_TO_META: Record<FdiId, ToothMeta> = [\n ...PERMANENT_TEETH,\n ...PRIMARY_TEETH,\n].reduce<Record<FdiId, ToothMeta>>((acc, fdi) => {\n acc[fdi] = buildMeta(fdi);\n return acc;\n}, {});\n\nexport const FDI_TO_UNIVERSAL: Record<FdiId, string> = Object.fromEntries(\n Object.entries(FDI_TO_META).map(([fdi, meta]) => [fdi, meta.universal]),\n);\n\nexport const FDI_TO_PALMER: Record<FdiId, string> = Object.fromEntries(\n Object.entries(FDI_TO_META).map(([fdi, meta]) => [fdi, meta.palmer]),\n);\n\n/* ------------------------------------------------------------------ */\n/* Condition → token + pattern */\n/* */\n/* Every condition carries BOTH a colour AND a fill pattern so */\n/* colour-blind clinicians can distinguish states in the SVG (and in */\n/* black-and-white prints) — colour is never the sole channel. */\n/* ------------------------------------------------------------------ */\n\n/** CSS variable name (without the leading `var(...)`) that drives a condition's colour. */\nexport const CONDITION_TOKENS: Record<ToothCondition, string> = {\n caries: '--destructive',\n filled: '--info',\n crowned: '--warning',\n missing: '--muted-foreground',\n implant: '--accent',\n rootCanal: '--primary',\n};\n\n/**\n * Convenience: the `fill=\"var(--destructive)\"` string ready to paste onto\n * an SVG attribute. Kept in sync with `CONDITION_TOKENS`.\n */\nexport const CONDITION_COLORS: Record<ToothCondition, string> = {\n caries: 'var(--destructive)',\n filled: 'var(--info)',\n crowned: 'var(--warning)',\n missing: 'var(--muted-foreground)',\n implant: 'var(--accent)',\n rootCanal: 'var(--primary)',\n};\n\n/** SVG `<pattern>` ids declared in `<defs>`. `missing` renders an X glyph instead of a pattern. */\nexport const CONDITION_PATTERNS: Record<ToothCondition, string> = {\n caries: 'tooth-scheme-pattern-diagonal',\n filled: 'tooth-scheme-pattern-dots',\n crowned: 'tooth-scheme-pattern-crosshatch',\n missing: 'tooth-scheme-pattern-blank',\n implant: 'tooth-scheme-pattern-vertical',\n rootCanal: 'tooth-scheme-pattern-horizontal',\n};\n\n/* ------------------------------------------------------------------ */\n/* SVG shape paths — one per anatomy class */\n/* */\n/* Artistry is deliberately minimal for this first pass: each tooth is */\n/* a rounded rectangle with a small anatomy cue (cusp notch for */\n/* molars, pointed tip for canines, narrower body for incisors). The */\n/* shapes accept a `translate(x, y)` on the enclosing `<g>` and draw */\n/* within a 30×50 bounding box (22×50 for incisors). */\n/* ------------------------------------------------------------------ */\n\nexport interface ToothShape {\n /** Visual width inside the enclosing `<g>`. */\n width: number;\n /** Visual height inside the enclosing `<g>`. */\n height: number;\n /** SVG `d` attribute for the crown outline. */\n path: string;\n /** Optional inner decorative path (occlusal surface on molars, etc.). */\n innerPath?: string;\n}\n\nexport const TOOTH_SHAPES: Record<Anatomy, ToothShape> = {\n incisor: {\n width: 22,\n height: 50,\n // Narrow rounded rectangle — slightly wider at the occlusal/biting edge.\n path: 'M4 4 C4 2 6 0 8 0 L14 0 C16 0 18 2 18 4 L20 44 C20 47 18 50 14 50 L8 50 C4 50 2 47 2 44 Z',\n },\n canine: {\n width: 26,\n height: 50,\n // Pointed cusp at the bottom — canines present a single prominent cusp.\n path: 'M4 4 C4 2 6 0 8 0 L18 0 C20 0 22 2 22 4 L24 40 L13 50 L2 40 Z',\n },\n premolar: {\n width: 28,\n height: 50,\n // Wider rounded rectangle with a subtle horizontal notch hinting at two cusps.\n path: 'M4 4 C4 2 6 0 8 0 L20 0 C22 0 24 2 24 4 L26 44 C26 47 24 50 20 50 L8 50 C4 50 2 47 2 44 Z',\n innerPath: 'M6 34 L22 34',\n },\n molar: {\n width: 32,\n height: 50,\n // Widest rounded rectangle with a cross-notch hinting at the occlusal fissure pattern.\n path: 'M4 4 C4 2 6 0 8 0 L24 0 C26 0 28 2 28 4 L30 44 C30 47 28 50 24 50 L8 50 C4 50 2 47 2 44 Z',\n innerPath: 'M6 32 L26 32 M16 22 L16 42',\n },\n};\n\n/* ------------------------------------------------------------------ */\n/* Viewport layout helpers */\n/* ------------------------------------------------------------------ */\n\nexport const TOOTH_GAP = 4;\nexport const TOOTH_ROW_GAP = 24;\nexport const TOOTH_HIT_PAD = 4;\n\nexport interface PositionedTooth {\n fdi: FdiId;\n meta: ToothMeta;\n shape: ToothShape;\n x: number;\n y: number;\n}\n\n/**\n * Produce the positioned list of teeth for a given dentition. The layout\n * is a two-row grid reading viewer-left-to-right across the upper arch,\n * then viewer-left-to-right across the lower arch. Clinical convention\n * is preserved: the patient's right sits on the viewer's left in both\n * arches, regardless of document direction.\n */\nexport function layoutTeeth(dentition: Dentition): {\n teeth: PositionedTooth[];\n width: number;\n height: number;\n} {\n const ids: FdiId[] =\n dentition === 'primary'\n ? PRIMARY_TEETH\n : dentition === 'mixed'\n ? [...PERMANENT_TEETH, ...PRIMARY_TEETH]\n : PERMANENT_TEETH;\n\n // Upper / lower partition is inferred from meta.arch.\n const upper: FdiId[] = [];\n const lower: FdiId[] = [];\n for (const id of ids) {\n const meta = FDI_TO_META[id];\n if (meta.arch === 'upper') upper.push(id);\n else lower.push(id);\n }\n\n const rowHeight = 50;\n const maxPerRow = Math.max(upper.length, lower.length);\n\n // Centre each row on the widest one.\n function positionRow(row: FdiId[], yOffset: number): PositionedTooth[] {\n const rowWidth = row.reduce((acc, id) => {\n const shape = TOOTH_SHAPES[FDI_TO_META[id].anatomy];\n return acc + shape.width + TOOTH_GAP;\n }, 0);\n const fullRowWidth = row.length > 0 ? rowWidth - TOOTH_GAP : 0;\n\n const maxRowWidth = (function computeMax(): number {\n const bigger = upper.length >= lower.length ? upper : lower;\n const biggerWidth = bigger.reduce((acc, id) => {\n const shape = TOOTH_SHAPES[FDI_TO_META[id].anatomy];\n return acc + shape.width + TOOTH_GAP;\n }, 0);\n return biggerWidth - TOOTH_GAP;\n })();\n\n const startX = (maxRowWidth - fullRowWidth) / 2;\n let cursor = startX;\n return row.map((id) => {\n const meta = FDI_TO_META[id];\n const shape = TOOTH_SHAPES[meta.anatomy];\n const tooth: PositionedTooth = {\n fdi: id,\n meta,\n shape,\n x: cursor,\n y: yOffset,\n };\n cursor += shape.width + TOOTH_GAP;\n return tooth;\n });\n }\n\n const upperRow = positionRow(upper, 0);\n const lowerRow = positionRow(lower, rowHeight + TOOTH_ROW_GAP);\n\n // Compute the true content width / height for the viewBox.\n const maxRowWidth = Math.max(\n upperRow.reduce((acc, t) => Math.max(acc, t.x + t.shape.width), 0),\n lowerRow.reduce((acc, t) => Math.max(acc, t.x + t.shape.width), 0),\n );\n\n // Fall back to a reasonable default if a row is empty.\n const width = maxRowWidth > 0 ? maxRowWidth : maxPerRow * 30;\n const height = rowHeight * 2 + TOOTH_ROW_GAP;\n\n return { teeth: [...upperRow, ...lowerRow], width, height };\n}\n\n/* ------------------------------------------------------------------ */\n/* Labels by numbering */\n/* ------------------------------------------------------------------ */\n\nexport function labelFor(id: FdiId, numbering: Numbering): string {\n switch (numbering) {\n case 'universal':\n return FDI_TO_UNIVERSAL[id] ?? id;\n case 'palmer':\n return FDI_TO_PALMER[id] ?? id;\n case 'fdi':\n default:\n return id;\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Chart helpers */\n/* ------------------------------------------------------------------ */\n\nexport function emptyChart(): ToothChart {\n return {};\n}\n\nexport function chartFromConditions(\n conditions: Partial<Record<FdiId, ToothCondition[]>>,\n): ToothChart {\n const chart: ToothChart = {};\n for (const [id, list] of Object.entries(conditions)) {\n if (!list || list.length === 0) continue;\n chart[id] = { conditions: list, surfaces: [] };\n }\n return chart;\n}\n","/* ------------------------------------------------------------------ */\n/* ToothScheme — in-house SVG dental chart. */\n/* */\n/* - The ONLY Domain-Specific component without a third-party engine. */\n/* No DentalChart.js, no toothchart, no canvas — `src/docs/08-third- */\n/* party.mdx §Dental chart` flags every candidate as rejected (jQuery */\n/* dependency, abandoned, poor a11y), so we draw SVG ourselves. */\n/* */\n/* - Colour-not-alone: each `ToothCondition` has a translated label, a */\n/* token colour AND a `<pattern>` fill. Pattern ids live in */\n/* `CONDITION_PATTERNS`; the six `<pattern>` nodes live once per */\n/* mounted chart inside a single `<defs>` block. */\n/* */\n/* - Chart orientation is FIXED to clinical convention: the patient's */\n/* right side sits on the viewer's left in both upper and lower */\n/* arches, regardless of document `dir`. RTL mirrors the surrounding */\n/* chrome (labels, controls) but NEVER the anatomy — a mirrored */\n/* chart would invert every diagnosis recorded against it. */\n/* */\n/* TODO: */\n/* - SVG artistry is deliberately minimal (rounded-rect crowns with */\n/* anatomy cues). A future pass should replace each `<path>` with */\n/* a clinically-correct crown outline from the dental design team. */\n/* - Surface selection sub-control (mesial / distal / occlusal / …) */\n/* is stubbed via the data model only; the interactive surface */\n/* picker will land in a follow-up. */\n/* - Condition editing is a single-step cycle on Space/Enter — good */\n/* enough for demos and stories; a richer picker belongs in a */\n/* popover and will reuse Radix Popover when it's wired in. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n} from 'react';\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { toothSchemeAgent } from './tooth-scheme.agent';\n\nimport {\n CONDITION_COLORS,\n CONDITION_PATTERNS,\n CONDITION_TOKENS,\n FDI_TO_META,\n PERMANENT_TEETH,\n PRIMARY_TEETH,\n TOOTH_HIT_PAD,\n chartFromConditions,\n labelFor,\n layoutTeeth,\n type Dentition,\n type FdiId,\n type Numbering,\n type ToothChart,\n type ToothCondition,\n type ToothMode,\n type ToothState,\n} from './tooth-data';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface ToothSchemeProps {\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** Which teeth to render. Default `'permanent'`. */\n dentition?: Dentition;\n /** Numbering system shown on each tooth label. Default `'fdi'`. */\n numbering?: Numbering;\n /** `'interactive'` enables selection + keyboard nav; `'display'` is read-only. Default `'interactive'`. */\n mode?: ToothMode;\n /** Controlled chart state — the full `Record<FdiId, ToothState>`. */\n value?: ToothChart;\n /** Uncontrolled initial chart state. */\n defaultValue?: ToothChart;\n /** Fired whenever the chart changes — always emits FDI ids. */\n onChange?: (next: ToothChart) => void;\n /** Fired when a tooth is focused or clicked. */\n onSelect?: (toothId: FdiId) => void;\n /** Shortcut for pre-populating conditions: `{ '16': ['caries'], '36': ['filled'] }`. */\n conditions?: Partial<Record<FdiId, ToothCondition[]>>;\n /** Accessible label override for the chart region. */\n ariaLabel?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface ToothSchemeHandle {\n /** Programmatically focus a tooth by FDI id. */\n focusTooth: (id: FdiId) => void;\n /** Read the current chart state. */\n getChart: () => ToothChart;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:tooth-scheme-alfadocs',\n 'ds:inline-flex ds:flex-col',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n ].join(' '),\n);\n\nconst svgVariants = cva(\n ['ds:block ds:max-w-full ds:h-auto', 'ds:text-[var(--foreground)]'].join(' '),\n);\n\n// `group` here is load-bearing — the focus-ring <rect> below uses\n// `group-focus-visible:opacity-100` to appear when the parent <g> takes\n// focus. Without this class the selector never fires and keyboard users\n// see no focus indicator (a11y-critical-fixes.mdx).\nconst toothGroupVariants = cva(\n [\n 'ds:group ds:cursor-pointer',\n 'ds:focus:outline-none',\n 'ds:transition-[fill,stroke,opacity] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n ].join(' '),\n);\n\nconst legendVariants = cva(\n [\n 'ds:flex ds:flex-wrap ds:items-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'type-meta ds:text-[var(--muted-foreground)]',\n ].join(' '),\n);\n\nconst legendItemVariants = cva(\n ['ds:inline-flex ds:items-center', 'ds:gap-[var(--spacing-xs)]'].join(' '),\n);\n\nconst legendSwatchVariants = cva(\n [\n 'ds:inline-block',\n 'ds:inline-size-[0.75rem] ds:block-size-[0.75rem]',\n 'ds:rounded-[var(--radius-xs)]',\n 'ds:border ds:border-[color:var(--border)]',\n ].join(' '),\n);\n\nconst liveRegionVariants = cva(['ds:sr-only'].join(' '));\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction isControlled(props: Pick<ToothSchemeProps, 'value'>): boolean {\n return props.value !== undefined;\n}\n\nfunction emptyState(): ToothState {\n return { conditions: [], surfaces: [] };\n}\n\nfunction cycleCondition(\n current: ToothCondition[] | undefined,\n): ToothCondition[] {\n if (!current || current.length === 0) return ['caries'];\n return [];\n}\n\nfunction sanitiseIdSuffix(raw: string): string {\n return raw.replace(/[^a-zA-Z0-9-_]/g, '');\n}\n\n/* ------------------------------------------------------------------ */\n/* Patterns <defs> */\n/* ------------------------------------------------------------------ */\n\ninterface PatternDefsProps {\n idPrefix: string;\n}\n\nfunction PatternDefs({ idPrefix }: PatternDefsProps): JSX.Element {\n // We namespace pattern ids per-instance so multiple ToothScheme charts\n // on a page don't collide. References inside the component use\n // `${idPrefix}-${CONDITION_PATTERNS[condition]}`.\n const pid = (id: string): string => `${idPrefix}-${id}`;\n return (\n <defs>\n <pattern\n id={pid(CONDITION_PATTERNS.caries)}\n patternUnits=\"userSpaceOnUse\"\n width=\"6\"\n height=\"6\"\n patternTransform=\"rotate(45)\"\n >\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"6\"\n stroke={CONDITION_COLORS.caries}\n strokeWidth=\"2\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.filled)}\n patternUnits=\"userSpaceOnUse\"\n width=\"5\"\n height=\"5\"\n >\n <circle cx=\"2.5\" cy=\"2.5\" r=\"1\" fill={CONDITION_COLORS.filled} />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.crowned)}\n patternUnits=\"userSpaceOnUse\"\n width=\"6\"\n height=\"6\"\n >\n <path\n d=\"M0 0 L6 6 M6 0 L0 6\"\n stroke={CONDITION_COLORS.crowned}\n strokeWidth=\"1\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.implant)}\n patternUnits=\"userSpaceOnUse\"\n width=\"4\"\n height=\"4\"\n >\n <line\n x1=\"1\"\n y1=\"0\"\n x2=\"1\"\n y2=\"4\"\n stroke={CONDITION_COLORS.implant}\n strokeWidth=\"1\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.rootCanal)}\n patternUnits=\"userSpaceOnUse\"\n width=\"4\"\n height=\"4\"\n >\n <line\n x1=\"0\"\n y1=\"1\"\n x2=\"4\"\n y2=\"1\"\n stroke={CONDITION_COLORS.rootCanal}\n strokeWidth=\"1\"\n />\n </pattern>\n {/* `missing` does not need a pattern — the renderer draws an X glyph. */}\n </defs>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Legend */\n/* ------------------------------------------------------------------ */\n\nconst ALL_CONDITIONS: ToothCondition[] = [\n 'caries',\n 'filled',\n 'crowned',\n 'missing',\n 'implant',\n 'rootCanal',\n];\n\ninterface LegendProps {\n idPrefix: string;\n}\n\nfunction Legend({ idPrefix: _idPrefix }: LegendProps): JSX.Element {\n const { t } = useTranslation();\n return (\n <ul\n className={legendVariants()}\n data-testid=\"tooth-scheme-legend\"\n aria-label={t('toothScheme.legendLabel')}\n >\n {ALL_CONDITIONS.map((condition) => (\n <li key={condition} className={legendItemVariants()}>\n <span\n className={legendSwatchVariants()}\n aria-hidden=\"true\"\n data-condition={condition}\n data-token={CONDITION_TOKENS[condition]}\n data-testid={`tooth-scheme-legend-swatch-${condition}`}\n />\n <span>{t(`toothScheme.condition.${condition}`)}</span>\n </li>\n ))}\n </ul>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const ToothScheme = forwardRef<ToothSchemeHandle, ToothSchemeProps>(\n (\n {\n id,\n dentition = 'permanent',\n numbering = 'fdi',\n mode = 'interactive',\n value,\n defaultValue,\n onChange,\n onSelect,\n conditions,\n ariaLabel,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const rawId = useId();\n const idPrefix = useMemo(() => `ts-${sanitiseIdSuffix(rawId)}`, [rawId]);\n\n // Chart state — controlled / uncontrolled.\n const [internalChart, setInternalChart] = useState<ToothChart>(() => {\n if (value !== undefined) return value;\n if (defaultValue !== undefined) return defaultValue;\n if (conditions) return chartFromConditions(conditions);\n return {};\n });\n\n const chart: ToothChart = isControlled({ value })\n ? (value as ToothChart)\n : internalChart;\n\n // Keep uncontrolled chart in sync when `conditions` shortcut updates.\n useEffect(() => {\n if (isControlled({ value })) return;\n if (conditions === undefined) return;\n setInternalChart(chartFromConditions(conditions));\n // Intentionally depend on a stable key — swapping the entire prop\n // snapshot is the consumer's signal to reset.\n }, [conditions, value]);\n\n // Layout.\n const layout = useMemo(() => layoutTeeth(dentition), [dentition]);\n const visibleIds = useMemo(() => layout.teeth.map((t) => t.fdi), [layout]);\n\n // Roving tabindex: which tooth owns `tabindex=\"0\"`.\n const firstId: FdiId | undefined = visibleIds[0];\n const [focusedId, setFocusedId] = useState<FdiId | undefined>(firstId);\n useEffect(() => {\n if (!focusedId || !visibleIds.includes(focusedId)) {\n setFocusedId(firstId);\n }\n }, [firstId, focusedId, visibleIds]);\n\n // Live-region announcement text.\n const [announcement, setAnnouncement] = useState<string>('');\n\n const svgRef = useRef<SVGSVGElement>(null);\n\n const commitChart = useCallback(\n (next: ToothChart) => {\n if (!isControlled({ value })) {\n setInternalChart(next);\n }\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const focusToothById = useCallback((id: FdiId) => {\n const svg = svgRef.current;\n if (!svg) return;\n const node = svg.querySelector<SVGGElement>(`g[data-fdi=\"${id}\"]`);\n if (node) {\n node.focus();\n setFocusedId(id);\n }\n }, []);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const agentHandle = useMemo<ToothSchemeHandle>(\n () => ({\n focusTooth: (id: FdiId) => {\n focusToothById(id);\n },\n getChart: () => chart,\n }),\n [chart, focusToothById],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(toothSchemeAgent, agentHandle, id);\n\n /* ------------------------------------------------------------- */\n /* Keyboard navigation */\n /* ------------------------------------------------------------- */\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<SVGGElement>, id: FdiId) => {\n if (mode !== 'interactive') return;\n const meta = FDI_TO_META[id];\n if (!meta) return;\n\n // Resolve the ordered list of visible ids for Left/Right.\n const order = visibleIds;\n const currentIndex = order.indexOf(id);\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault();\n const nextIndex = Math.min(order.length - 1, currentIndex + 1);\n focusToothById(order[nextIndex]);\n return;\n }\n case 'ArrowLeft': {\n event.preventDefault();\n const nextIndex = Math.max(0, currentIndex - 1);\n focusToothById(order[nextIndex]);\n return;\n }\n case 'ArrowUp':\n case 'ArrowDown': {\n event.preventDefault();\n // Map to the opposing arch, same FDI position where possible.\n // Permanent: 1 ↔ 4, 2 ↔ 3. Primary: 5 ↔ 8, 6 ↔ 7.\n const quadrantMap: Record<number, number> = {\n 1: 4,\n 4: 1,\n 2: 3,\n 3: 2,\n 5: 8,\n 8: 5,\n 6: 7,\n 7: 6,\n };\n const targetQuadrant = quadrantMap[meta.quadrant];\n if (!targetQuadrant) return;\n const candidate = `${targetQuadrant}${meta.positionInQuadrant}`;\n if (order.includes(candidate)) {\n focusToothById(candidate);\n }\n return;\n }\n case 'Home': {\n event.preventDefault();\n // First tooth in the same quadrant (visible).\n const inQuadrant = order.filter(\n (other) => FDI_TO_META[other].quadrant === meta.quadrant,\n );\n if (inQuadrant.length > 0) {\n focusToothById(inQuadrant[0]);\n }\n return;\n }\n case 'End': {\n event.preventDefault();\n const inQuadrant = order.filter(\n (other) => FDI_TO_META[other].quadrant === meta.quadrant,\n );\n if (inQuadrant.length > 0) {\n focusToothById(inQuadrant[inQuadrant.length - 1]);\n }\n return;\n }\n case ' ':\n case 'Enter': {\n event.preventDefault();\n const prev = chart[id]?.conditions;\n const nextConditions = cycleCondition(prev);\n const next: ToothChart = { ...chart };\n if (nextConditions.length === 0) {\n delete next[id];\n setAnnouncement(t('toothScheme.deselected', { id }));\n } else {\n next[id] = {\n ...(chart[id] ?? emptyState()),\n conditions: nextConditions,\n };\n setAnnouncement(\n t('toothScheme.selected', {\n id,\n conditions: nextConditions\n .map((c) => t(`toothScheme.condition.${c}`))\n .join(', '),\n }),\n );\n }\n commitChart(next);\n onSelect?.(id);\n return;\n }\n default:\n return;\n }\n },\n [chart, commitChart, focusToothById, mode, onSelect, t, visibleIds],\n );\n\n const handleClick = useCallback(\n (id: FdiId) => {\n if (mode !== 'interactive') return;\n setFocusedId(id);\n const prev = chart[id]?.conditions;\n const nextConditions = cycleCondition(prev);\n const next: ToothChart = { ...chart };\n if (nextConditions.length === 0) {\n delete next[id];\n setAnnouncement(t('toothScheme.deselected', { id }));\n } else {\n next[id] = {\n ...(chart[id] ?? emptyState()),\n conditions: nextConditions,\n };\n setAnnouncement(\n t('toothScheme.selected', {\n id,\n conditions: nextConditions\n .map((c) => t(`toothScheme.condition.${c}`))\n .join(', '),\n }),\n );\n }\n commitChart(next);\n onSelect?.(id);\n },\n [chart, commitChart, mode, onSelect, t],\n );\n\n /* ------------------------------------------------------------- */\n /* Rendering */\n /* ------------------------------------------------------------- */\n\n const viewBoxWidth = layout.width + 4; // small padding for stroke\n const viewBoxHeight = layout.height + 4;\n\n const regionLabel = ariaLabel ?? t('toothScheme.ariaLabel');\n\n return (\n <RadixTooltip.Provider delayDuration={200}>\n <div\n ref={rootRef}\n role=\"region\"\n aria-label={regionLabel}\n className={[rootVariants(), className].filter(Boolean).join(' ')}\n data-component=\"tooth-scheme\"\n data-component-id={id}\n data-testid=\"tooth-scheme-root\"\n data-dentition={dentition}\n data-numbering={numbering}\n data-mode={mode}\n >\n <svg\n ref={svgRef}\n viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}\n className={svgVariants()}\n role=\"group\"\n aria-label={regionLabel}\n data-testid=\"tooth-scheme-svg\"\n focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <PatternDefs idPrefix={idPrefix} />\n\n {layout.teeth.map((tooth) => {\n const state = chart[tooth.fdi];\n const primaryCondition: ToothCondition | undefined =\n state?.conditions?.[0];\n\n const anatomyLabel = t(\n `toothScheme.anatomy.${tooth.meta.anatomy}`,\n );\n const conditionSuffix = primaryCondition\n ? `, ${t(`toothScheme.condition.${primaryCondition}`)}`\n : '';\n const label = t('toothScheme.toothLabel', {\n id: labelFor(tooth.fdi, numbering),\n anatomy: anatomyLabel,\n conditionSuffix,\n });\n\n const tabIndex =\n mode === 'interactive'\n ? tooth.fdi === focusedId\n ? 0\n : -1\n : undefined;\n\n const fillColour: string =\n primaryCondition && primaryCondition !== 'missing'\n ? `url(#${idPrefix}-${CONDITION_PATTERNS[primaryCondition]})`\n : 'var(--muted)';\n\n const strokeColour: string =\n primaryCondition && primaryCondition !== 'missing'\n ? CONDITION_COLORS[primaryCondition]\n : 'var(--border)';\n\n const tooltipContent = primaryCondition\n ? `${anatomyLabel} · ${t(`toothScheme.condition.${primaryCondition}`)}`\n : anatomyLabel;\n\n const labelText = labelFor(tooth.fdi, numbering);\n\n return (\n <RadixTooltip.Root key={tooth.fdi}>\n <RadixTooltip.Trigger asChild>\n <g\n data-fdi={tooth.fdi}\n data-anatomy={tooth.meta.anatomy}\n data-arch={tooth.meta.arch}\n data-side={tooth.meta.side}\n data-quadrant={tooth.meta.quadrant}\n data-condition={primaryCondition ?? 'none'}\n data-testid={`tooth-${tooth.fdi}`}\n transform={`translate(${tooth.x}, ${tooth.y})`}\n tabIndex={tabIndex}\n // SVG `<g>` has no implicit role, so `aria-label`\n // would be rejected by axe's `aria-prohibited-attr`\n // rule. Give it an explicit role: `button` in\n // interactive mode, `img` in display mode (the\n // group reads as a single labelled tooth glyph).\n role={mode === 'interactive' ? 'button' : 'img'}\n aria-label={label}\n aria-pressed={\n mode === 'interactive'\n ? primaryCondition !== undefined\n : undefined\n }\n className={toothGroupVariants()}\n onClick={\n mode === 'interactive'\n ? () => handleClick(tooth.fdi)\n : undefined\n }\n onFocus={() => setFocusedId(tooth.fdi)}\n onKeyDown={(event) => handleKeyDown(event, tooth.fdi)}\n >\n {/* Invisible ≥44px hit target (WCAG 2.5.5). */}\n <rect\n x={-TOOTH_HIT_PAD}\n y={-TOOTH_HIT_PAD}\n width={tooth.shape.width + TOOTH_HIT_PAD * 2}\n height={tooth.shape.height + TOOTH_HIT_PAD * 2}\n fill=\"transparent\"\n />\n {/* Crown outline. */}\n <path\n d={tooth.shape.path}\n fill={fillColour}\n stroke={strokeColour}\n strokeWidth=\"1.5\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {tooth.shape.innerPath ? (\n <path\n d={tooth.shape.innerPath}\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"0.75\"\n vectorEffect=\"non-scaling-stroke\"\n />\n ) : null}\n {/* Focus ring — drawn as a rect so it tracks the hit\n area. `group` on the parent <g> makes this\n group-focus-visible selector fire when a keyboard\n user focuses the tooth. In forced-colors mode the\n ring falls back to `CanvasText` so it stays visible\n when `var(--ring)` is remapped. */}\n <rect\n x={-TOOTH_HIT_PAD}\n y={-TOOTH_HIT_PAD}\n width={tooth.shape.width + TOOTH_HIT_PAD * 2}\n height={tooth.shape.height + TOOTH_HIT_PAD * 2}\n fill=\"none\"\n stroke=\"var(--ring)\"\n strokeWidth=\"var(--focus-ring-width)\"\n className={[\n 'ds:opacity-0',\n 'ds:group-focus-visible:opacity-100',\n 'ds:forced-colors:stroke-[CanvasText]',\n ].join(' ')}\n data-testid={`tooth-${tooth.fdi}-focus-ring`}\n pointerEvents=\"none\"\n rx=\"4\"\n />\n {/* Missing-tooth X glyph. */}\n {primaryCondition === 'missing' ? (\n <path\n d={`M2 2 L${tooth.shape.width - 2} ${tooth.shape.height - 2} M${tooth.shape.width - 2} 2 L2 ${tooth.shape.height - 2}`}\n stroke={CONDITION_COLORS.missing}\n strokeWidth=\"2\"\n fill=\"none\"\n />\n ) : null}\n {/* Tooth number label — sits below (upper arch) or above (lower) the crown. */}\n <text\n x={tooth.shape.width / 2}\n y={\n tooth.meta.arch === 'upper'\n ? tooth.shape.height + 12\n : -4\n }\n textAnchor=\"middle\"\n fontSize=\"10\"\n fill=\"var(--muted-foreground)\"\n className=\"ds:select-none\"\n aria-hidden=\"true\"\n >\n {labelText}\n </text>\n </g>\n </RadixTooltip.Trigger>\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n side=\"top\"\n sideOffset={6}\n className=\"ds:z-[var(--z-tooltip)] ds:rounded-[var(--radius-sm)] ds:bg-[var(--foreground)] ds:text-[var(--background)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[calc(var(--spacing-xs)/2)] ds:pb-[calc(var(--spacing-xs)/2)] ds:text-[length:var(--font-size-xs)]\"\n >\n {tooltipContent}\n <RadixTooltip.Arrow className=\"ds:fill-[var(--foreground)]\" />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n </RadixTooltip.Root>\n );\n })}\n </svg>\n\n <Legend idPrefix={idPrefix} />\n\n <div\n className={liveRegionVariants()}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"tooth-scheme-live\"\n >\n {announcement}\n </div>\n </div>\n </RadixTooltip.Provider>\n );\n },\n);\n\nToothScheme.displayName = 'ToothScheme';\n\n/* ------------------------------------------------------------------ */\n/* Re-exports */\n/* ------------------------------------------------------------------ */\n\nexport { rootVariants as toothSchemeVariants, PERMANENT_TEETH, PRIMARY_TEETH };\nexport type {\n Dentition,\n FdiId,\n Numbering,\n ToothChart,\n ToothCondition,\n ToothMode,\n ToothState,\n} from './tooth-data';\n"],"names":["toothSchemeAgent","handle","args","PERMANENT_TEETH","PRIMARY_TEETH","permanentAnatomy","positionInQuadrant","primaryAnatomy","palmerCode","quadrant","position","normalised","permanentUniversal","primaryUniversal","letters","index","buildMeta","fdi","isPrimary","anatomy","arch","side","universal","palmer","FDI_TO_META","acc","FDI_TO_UNIVERSAL","meta","FDI_TO_PALMER","CONDITION_TOKENS","CONDITION_COLORS","CONDITION_PATTERNS","TOOTH_SHAPES","TOOTH_GAP","TOOTH_ROW_GAP","TOOTH_HIT_PAD","layoutTeeth","dentition","ids","upper","lower","id","rowHeight","maxPerRow","positionRow","row","yOffset","rowWidth","shape","fullRowWidth","cursor","tooth","upperRow","lowerRow","maxRowWidth","t","width","height","labelFor","numbering","emptyChart","chartFromConditions","conditions","chart","list","rootVariants","cva","svgVariants","toothGroupVariants","legendVariants","legendItemVariants","legendSwatchVariants","liveRegionVariants","isControlled","props","emptyState","cycleCondition","current","sanitiseIdSuffix","raw","PatternDefs","idPrefix","pid","jsx","ALL_CONDITIONS","Legend","_idPrefix","useTranslation","condition","ToothScheme","forwardRef","mode","value","defaultValue","onChange","onSelect","ariaLabel","className","ref","rawId","useId","useMemo","internalChart","setInternalChart","useState","useEffect","layout","visibleIds","firstId","focusedId","setFocusedId","announcement","setAnnouncement","svgRef","useRef","commitChart","useCallback","next","focusToothById","svg","node","rootRef","agentHandle","useImperativeHandle","useAgentRegistration","handleKeyDown","event","order","currentIndex","nextIndex","targetQuadrant","candidate","inQuadrant","other","prev","_a","nextConditions","c","handleClick","viewBoxWidth","viewBoxHeight","regionLabel","RadixTooltip","jsxs","state","primaryCondition","anatomyLabel","conditionSuffix","label","tabIndex","fillColour","strokeColour","tooltipContent","labelText"],"mappings":";;;;;;AAGO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAC,MAAM;AAAA,EACrB,OAAO;AAAA,IACL,OAAO;AAAA,MACL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BACzB,aAAY;AAAA,8BACZ,MAAK;AAAA,4BAAA;AAAA,0BAAA,IAEL;AAAA,0BAEJ,gBAAAqD;AAAA,4BAAC;AAAA,4BAAA;AAAA,8BACC,GAAGhC,EAAM,MAAM,QAAQ;AAAA,8BACvB,GACEA,EAAM,KAAK,SAAS,UAChBA,EAAM,MAAM,SAAS,KACrB;AAAA,8BAEN,YAAW;AAAA,8BACX,UAAS;AAAA,8BACT,MAAK;AAAA,8BACL,WAAU;AAAA,8BACV,eAAY;AAAA,8BAEX,UAAAsG;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACH;AAAA,sBAAA;AAAA,oBAAA,GAEJ;AAAA,oBACA,gBAAAtE,EAAC2D,EAAa,QAAb,EACC,UAAA,gBAAAC;AAAA,sBAACD,EAAa;AAAA,sBAAb;AAAA,wBACC,MAAK;AAAA,wBACL,YAAY;AAAA,wBACZ,WAAU;AAAA,wBAET,UAAA;AAAA,0BAAAU;AAAA,0BACD,gBAAArE,EAAC2D,EAAa,OAAb,EAAmB,WAAU,8BAAA,CAA8B;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBAAA,EAC9D,CACF;AAAA,kBAAA,EAAA,GArHsB3F,EAAM,GAsH9B;AAAA,gBAEJ,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGH,gBAAAgC,EAACE,MAAO,UAAAJ,GAAoB;AAAA,UAE5B,gBAAAE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWX,GAAA;AAAA,cACX,aAAU;AAAA,cACV,eAAY;AAAA,cACZ,eAAY;AAAA,cAEX,UAAAuC;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEAtB,GAAY,cAAc;"}
1
+ {"version":3,"file":"tooth-scheme-CxlsLjfN.js","sources":["../../src/components/tooth-scheme/tooth-scheme.agent.ts","../../src/components/tooth-scheme/tooth-data.ts","../../src/components/tooth-scheme/tooth-scheme.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ToothSchemeHandle } from './tooth-scheme';\n\nexport const toothSchemeAgent: AgentAdapter<ToothSchemeHandle> = {\n id: 'tooth-scheme',\n capabilities: ['pick'],\n state: {\n chart: {\n type: 'object',\n description:\n 'Current dental chart state — tooth conditions keyed by FDI id.',\n read: (handle) => handle.getChart(),\n },\n },\n actions: {\n focus_tooth: {\n safety: 'read',\n argsType: '{ id: FdiId }',\n description: 'Move focus to a specific tooth by FDI id.',\n invoke: (\n handle,\n args: { id: Parameters<ToothSchemeHandle['focusTooth']>[0] },\n ) => {\n handle.focusTooth(args.id);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'tooth-scheme' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-fdi',\n description:\n 'Each rendered tooth `<g>` carries its FDI id as `data-fdi`. Tests still use `data-testid=\"tooth-<fdi>\"` separately.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* ToothScheme — data model + lookup tables. */\n/* */\n/* FDI ISO 3950 is the canonical internal id. This module exposes */\n/* conversion tables to Universal (ADA) and a simplified Palmer-style */\n/* quadrant+position string so consuming UIs can toggle numbering. */\n/* */\n/* Why simplified Palmer? True Palmer notation uses quadrant bracket */\n/* glyphs (\"⌐\", \"¬\", \"L\", \"J\") that do not render reliably in every */\n/* browser/font combination. We emit a readable `UR3` / `LL6` form */\n/* instead and document the deviation in the component MDX. */\n/* ------------------------------------------------------------------ */\n\n/* ------------------------------------------------------------------ */\n/* Core types */\n/* ------------------------------------------------------------------ */\n\nexport type FdiId = string; // '11'–'48' permanent, '51'–'85' primary\n\nexport type Dentition = 'permanent' | 'primary' | 'mixed';\nexport type Numbering = 'fdi' | 'universal' | 'palmer';\nexport type ToothMode = 'interactive' | 'display';\nexport type Surface = 'mesial' | 'distal' | 'occlusal' | 'buccal' | 'lingual';\nexport type ToothCondition =\n | 'caries'\n | 'filled'\n | 'crowned'\n | 'missing'\n | 'implant'\n | 'rootCanal';\n\nexport interface ToothState {\n conditions: ToothCondition[];\n surfaces: Surface[];\n notes?: string;\n}\n\nexport type ToothChart = Record<FdiId, ToothState>;\n\nexport type Anatomy = 'incisor' | 'canine' | 'premolar' | 'molar';\nexport type Arch = 'upper' | 'lower';\nexport type Side = 'right' | 'left'; // patient's side (NOT viewer's)\nexport type Quadrant = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n\nexport interface ToothMeta {\n fdi: FdiId;\n /** '1'–'32' for permanent, 'A'–'T' for primary. */\n universal: string;\n /** Simplified Palmer quadrant-and-position string, e.g. 'UR3', 'LL6'. */\n palmer: string;\n quadrant: Quadrant;\n /** 1–8 (permanent) or 1–5 (primary), counted from the midline outward. */\n positionInQuadrant: number;\n anatomy: Anatomy;\n arch: Arch;\n side: Side;\n dentition: 'permanent' | 'primary';\n}\n\n/* ------------------------------------------------------------------ */\n/* Layout orders */\n/* */\n/* Layout reads from the viewer's perspective, top-left to bottom- */\n/* right. The chart is FIXED in clinical convention: the patient's */\n/* right side sits on the viewer's left, regardless of document `dir`. */\n/* ------------------------------------------------------------------ */\n\n/**\n * 32 permanent teeth in visual layout order:\n * upper row: 18..11 (patient upper-right, outermost → midline), then 21..28 (upper-left, midline → outermost)\n * lower row: 48..41 (patient lower-right, outermost → midline), then 31..38 (lower-left, midline → outermost)\n */\nexport const PERMANENT_TEETH: FdiId[] = [\n // upper\n '18',\n '17',\n '16',\n '15',\n '14',\n '13',\n '12',\n '11',\n '21',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n // lower\n '48',\n '47',\n '46',\n '45',\n '44',\n '43',\n '42',\n '41',\n '31',\n '32',\n '33',\n '34',\n '35',\n '36',\n '37',\n '38',\n];\n\n/**\n * 20 primary teeth in visual layout order:\n * upper row: 55..51 (upper-right outermost → midline), then 61..65\n * lower row: 85..81, then 71..75\n */\nexport const PRIMARY_TEETH: FdiId[] = [\n // upper\n '55',\n '54',\n '53',\n '52',\n '51',\n '61',\n '62',\n '63',\n '64',\n '65',\n // lower\n '85',\n '84',\n '83',\n '82',\n '81',\n '71',\n '72',\n '73',\n '74',\n '75',\n];\n\n/* ------------------------------------------------------------------ */\n/* Anatomy by position */\n/* ------------------------------------------------------------------ */\n\nfunction permanentAnatomy(positionInQuadrant: number): Anatomy {\n if (positionInQuadrant <= 2) return 'incisor';\n if (positionInQuadrant === 3) return 'canine';\n if (positionInQuadrant <= 5) return 'premolar';\n return 'molar';\n}\n\nfunction primaryAnatomy(positionInQuadrant: number): Anatomy {\n if (positionInQuadrant <= 2) return 'incisor';\n if (positionInQuadrant === 3) return 'canine';\n // Primary dentition has no premolars — positions 4 & 5 are molars.\n return 'molar';\n}\n\n/* ------------------------------------------------------------------ */\n/* Palmer helper */\n/* ------------------------------------------------------------------ */\n\nfunction palmerCode(quadrant: Quadrant, position: number): string {\n // Permanent: 1=UR, 2=UL, 3=LL, 4=LR. Primary: 5=UR, 6=UL, 7=LL, 8=LR.\n // Mapping is identical within each dentition ring; the number is what\n // changes, so we fold 5→1, 6→2, 7→3, 8→4 to derive the quadrant code.\n const normalised = ((quadrant - 1) % 4) + 1;\n const code =\n normalised === 1\n ? 'UR'\n : normalised === 2\n ? 'UL'\n : normalised === 3\n ? 'LL'\n : 'LR';\n return `${code}${position}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Universal (ADA) conversion */\n/* */\n/* Permanent — Universal numbers 1..32 run clockwise from the */\n/* patient's upper-right 3rd molar (FDI 18 = Universal 1), across */\n/* the upper arch (18→11 = 1→8, 21→28 = 9→16), then down the left */\n/* lower arch (38→31 = 17→24) and across the right lower (41→48 = */\n/* 25→32). */\n/* */\n/* Primary — Universal letters A..T walk the same path: */\n/* 55→51 = A→E, 61→65 = F→J, 75→71 = K→O, 81→85 = P→T. */\n/* ------------------------------------------------------------------ */\n\nfunction permanentUniversal(quadrant: Quadrant, position: number): string {\n switch (quadrant) {\n case 1:\n // 18→1, 17→2, …, 11→8\n return String(1 + (8 - position));\n case 2:\n // 21→9, 22→10, …, 28→16\n return String(8 + position);\n case 3:\n // 38→17, 37→18, …, 31→24\n return String(17 + (8 - position));\n case 4:\n // 41→25, 42→26, …, 48→32\n return String(24 + position);\n default:\n return '';\n }\n}\n\nfunction primaryUniversal(quadrant: Quadrant, position: number): string {\n const letters = 'ABCDEFGHIJKLMNOPQRST';\n let index = -1;\n switch (quadrant) {\n case 5:\n // 55→A, 54→B, 53→C, 52→D, 51→E\n index = 0 + (5 - position);\n break;\n case 6:\n // 61→F, 62→G, 63→H, 64→I, 65→J\n index = 5 + (position - 1);\n break;\n case 7:\n // 75→K, 74→L, 73→M, 72→N, 71→O\n index = 10 + (5 - position);\n break;\n case 8:\n // 81→P, 82→Q, 83→R, 84→S, 85→T\n index = 15 + (position - 1);\n break;\n default:\n index = -1;\n }\n return index >= 0 ? letters[index] : '';\n}\n\n/* ------------------------------------------------------------------ */\n/* Meta builder */\n/* ------------------------------------------------------------------ */\n\nfunction buildMeta(fdi: FdiId): ToothMeta {\n const quadrant = Number(fdi[0]) as Quadrant;\n const position = Number(fdi[1]);\n const isPrimary = quadrant >= 5;\n const anatomy = isPrimary\n ? primaryAnatomy(position)\n : permanentAnatomy(position);\n const arch: Arch =\n quadrant === 1 || quadrant === 2 || quadrant === 5 || quadrant === 6\n ? 'upper'\n : 'lower';\n const side: Side =\n quadrant === 1 || quadrant === 4 || quadrant === 5 || quadrant === 8\n ? 'right'\n : 'left';\n const universal = isPrimary\n ? primaryUniversal(quadrant, position)\n : permanentUniversal(quadrant, position);\n const palmer = palmerCode(quadrant, position);\n return {\n fdi,\n universal,\n palmer,\n quadrant,\n positionInQuadrant: position,\n anatomy,\n arch,\n side,\n dentition: isPrimary ? 'primary' : 'permanent',\n };\n}\n\nexport const FDI_TO_META: Record<FdiId, ToothMeta> = [\n ...PERMANENT_TEETH,\n ...PRIMARY_TEETH,\n].reduce<Record<FdiId, ToothMeta>>((acc, fdi) => {\n acc[fdi] = buildMeta(fdi);\n return acc;\n}, {});\n\nexport const FDI_TO_UNIVERSAL: Record<FdiId, string> = Object.fromEntries(\n Object.entries(FDI_TO_META).map(([fdi, meta]) => [fdi, meta.universal]),\n);\n\nexport const FDI_TO_PALMER: Record<FdiId, string> = Object.fromEntries(\n Object.entries(FDI_TO_META).map(([fdi, meta]) => [fdi, meta.palmer]),\n);\n\n/* ------------------------------------------------------------------ */\n/* Condition → token + pattern */\n/* */\n/* Every condition carries BOTH a colour AND a fill pattern so */\n/* colour-blind clinicians can distinguish states in the SVG (and in */\n/* black-and-white prints) — colour is never the sole channel. */\n/* ------------------------------------------------------------------ */\n\n/** CSS variable name (without the leading `var(...)`) that drives a condition's colour. */\nexport const CONDITION_TOKENS: Record<ToothCondition, string> = {\n caries: '--destructive',\n filled: '--info',\n crowned: '--warning',\n missing: '--muted-foreground',\n implant: '--accent',\n rootCanal: '--primary',\n};\n\n/**\n * Convenience: the `fill=\"var(--destructive)\"` string ready to paste onto\n * an SVG attribute. Kept in sync with `CONDITION_TOKENS`.\n */\nexport const CONDITION_COLORS: Record<ToothCondition, string> = {\n caries: 'var(--destructive)',\n filled: 'var(--info)',\n crowned: 'var(--warning)',\n missing: 'var(--muted-foreground)',\n implant: 'var(--accent)',\n rootCanal: 'var(--primary)',\n};\n\n/** SVG `<pattern>` ids declared in `<defs>`. `missing` renders an X glyph instead of a pattern. */\nexport const CONDITION_PATTERNS: Record<ToothCondition, string> = {\n caries: 'tooth-scheme-pattern-diagonal',\n filled: 'tooth-scheme-pattern-dots',\n crowned: 'tooth-scheme-pattern-crosshatch',\n missing: 'tooth-scheme-pattern-blank',\n implant: 'tooth-scheme-pattern-vertical',\n rootCanal: 'tooth-scheme-pattern-horizontal',\n};\n\n/* ------------------------------------------------------------------ */\n/* SVG shape paths — one per anatomy class */\n/* */\n/* Artistry is deliberately minimal for this first pass: each tooth is */\n/* a rounded rectangle with a small anatomy cue (cusp notch for */\n/* molars, pointed tip for canines, narrower body for incisors). The */\n/* shapes accept a `translate(x, y)` on the enclosing `<g>` and draw */\n/* within a 30×50 bounding box (22×50 for incisors). */\n/* ------------------------------------------------------------------ */\n\nexport interface ToothShape {\n /** Visual width inside the enclosing `<g>`. */\n width: number;\n /** Visual height inside the enclosing `<g>`. */\n height: number;\n /** SVG `d` attribute for the crown outline. */\n path: string;\n /** Optional inner decorative path (occlusal surface on molars, etc.). */\n innerPath?: string;\n}\n\nexport const TOOTH_SHAPES: Record<Anatomy, ToothShape> = {\n incisor: {\n width: 22,\n height: 50,\n // Narrow rounded rectangle — slightly wider at the occlusal/biting edge.\n path: 'M4 4 C4 2 6 0 8 0 L14 0 C16 0 18 2 18 4 L20 44 C20 47 18 50 14 50 L8 50 C4 50 2 47 2 44 Z',\n },\n canine: {\n width: 26,\n height: 50,\n // Pointed cusp at the bottom — canines present a single prominent cusp.\n path: 'M4 4 C4 2 6 0 8 0 L18 0 C20 0 22 2 22 4 L24 40 L13 50 L2 40 Z',\n },\n premolar: {\n width: 28,\n height: 50,\n // Wider rounded rectangle with a subtle horizontal notch hinting at two cusps.\n path: 'M4 4 C4 2 6 0 8 0 L20 0 C22 0 24 2 24 4 L26 44 C26 47 24 50 20 50 L8 50 C4 50 2 47 2 44 Z',\n innerPath: 'M6 34 L22 34',\n },\n molar: {\n width: 32,\n height: 50,\n // Widest rounded rectangle with a cross-notch hinting at the occlusal fissure pattern.\n path: 'M4 4 C4 2 6 0 8 0 L24 0 C26 0 28 2 28 4 L30 44 C30 47 28 50 24 50 L8 50 C4 50 2 47 2 44 Z',\n innerPath: 'M6 32 L26 32 M16 22 L16 42',\n },\n};\n\n/* ------------------------------------------------------------------ */\n/* Viewport layout helpers */\n/* ------------------------------------------------------------------ */\n\nexport const TOOTH_GAP = 4;\nexport const TOOTH_ROW_GAP = 24;\nexport const TOOTH_HIT_PAD = 4;\n\nexport interface PositionedTooth {\n fdi: FdiId;\n meta: ToothMeta;\n shape: ToothShape;\n x: number;\n y: number;\n}\n\n/**\n * Produce the positioned list of teeth for a given dentition. The layout\n * is a two-row grid reading viewer-left-to-right across the upper arch,\n * then viewer-left-to-right across the lower arch. Clinical convention\n * is preserved: the patient's right sits on the viewer's left in both\n * arches, regardless of document direction.\n */\nexport function layoutTeeth(dentition: Dentition): {\n teeth: PositionedTooth[];\n width: number;\n height: number;\n} {\n const ids: FdiId[] =\n dentition === 'primary'\n ? PRIMARY_TEETH\n : dentition === 'mixed'\n ? [...PERMANENT_TEETH, ...PRIMARY_TEETH]\n : PERMANENT_TEETH;\n\n // Upper / lower partition is inferred from meta.arch.\n const upper: FdiId[] = [];\n const lower: FdiId[] = [];\n for (const id of ids) {\n const meta = FDI_TO_META[id];\n if (meta.arch === 'upper') upper.push(id);\n else lower.push(id);\n }\n\n const rowHeight = 50;\n const maxPerRow = Math.max(upper.length, lower.length);\n\n // Centre each row on the widest one.\n function positionRow(row: FdiId[], yOffset: number): PositionedTooth[] {\n const rowWidth = row.reduce((acc, id) => {\n const shape = TOOTH_SHAPES[FDI_TO_META[id].anatomy];\n return acc + shape.width + TOOTH_GAP;\n }, 0);\n const fullRowWidth = row.length > 0 ? rowWidth - TOOTH_GAP : 0;\n\n const maxRowWidth = (function computeMax(): number {\n const bigger = upper.length >= lower.length ? upper : lower;\n const biggerWidth = bigger.reduce((acc, id) => {\n const shape = TOOTH_SHAPES[FDI_TO_META[id].anatomy];\n return acc + shape.width + TOOTH_GAP;\n }, 0);\n return biggerWidth - TOOTH_GAP;\n })();\n\n const startX = (maxRowWidth - fullRowWidth) / 2;\n let cursor = startX;\n return row.map((id) => {\n const meta = FDI_TO_META[id];\n const shape = TOOTH_SHAPES[meta.anatomy];\n const tooth: PositionedTooth = {\n fdi: id,\n meta,\n shape,\n x: cursor,\n y: yOffset,\n };\n cursor += shape.width + TOOTH_GAP;\n return tooth;\n });\n }\n\n const upperRow = positionRow(upper, 0);\n const lowerRow = positionRow(lower, rowHeight + TOOTH_ROW_GAP);\n\n // Compute the true content width / height for the viewBox.\n const maxRowWidth = Math.max(\n upperRow.reduce((acc, t) => Math.max(acc, t.x + t.shape.width), 0),\n lowerRow.reduce((acc, t) => Math.max(acc, t.x + t.shape.width), 0),\n );\n\n // Fall back to a reasonable default if a row is empty.\n const width = maxRowWidth > 0 ? maxRowWidth : maxPerRow * 30;\n const height = rowHeight * 2 + TOOTH_ROW_GAP;\n\n return { teeth: [...upperRow, ...lowerRow], width, height };\n}\n\n/* ------------------------------------------------------------------ */\n/* Labels by numbering */\n/* ------------------------------------------------------------------ */\n\nexport function labelFor(id: FdiId, numbering: Numbering): string {\n switch (numbering) {\n case 'universal':\n return FDI_TO_UNIVERSAL[id] ?? id;\n case 'palmer':\n return FDI_TO_PALMER[id] ?? id;\n case 'fdi':\n default:\n return id;\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Chart helpers */\n/* ------------------------------------------------------------------ */\n\nexport function emptyChart(): ToothChart {\n return {};\n}\n\nexport function chartFromConditions(\n conditions: Partial<Record<FdiId, ToothCondition[]>>,\n): ToothChart {\n const chart: ToothChart = {};\n for (const [id, list] of Object.entries(conditions)) {\n if (!list || list.length === 0) continue;\n chart[id] = { conditions: list, surfaces: [] };\n }\n return chart;\n}\n","/* ------------------------------------------------------------------ */\n/* ToothScheme — in-house SVG dental chart. */\n/* */\n/* - The ONLY Domain-Specific component without a third-party engine. */\n/* No DentalChart.js, no toothchart, no canvas — `src/docs/08-third- */\n/* party.mdx §Dental chart` flags every candidate as rejected (jQuery */\n/* dependency, abandoned, poor a11y), so we draw SVG ourselves. */\n/* */\n/* - Colour-not-alone: each `ToothCondition` has a translated label, a */\n/* token colour AND a `<pattern>` fill. Pattern ids live in */\n/* `CONDITION_PATTERNS`; the six `<pattern>` nodes live once per */\n/* mounted chart inside a single `<defs>` block. */\n/* */\n/* - Chart orientation is FIXED to clinical convention: the patient's */\n/* right side sits on the viewer's left in both upper and lower */\n/* arches, regardless of document `dir`. RTL mirrors the surrounding */\n/* chrome (labels, controls) but NEVER the anatomy — a mirrored */\n/* chart would invert every diagnosis recorded against it. */\n/* */\n/* TODO: */\n/* - SVG artistry is deliberately minimal (rounded-rect crowns with */\n/* anatomy cues). A future pass should replace each `<path>` with */\n/* a clinically-correct crown outline from the dental design team. */\n/* - Surface selection sub-control (mesial / distal / occlusal / …) */\n/* is stubbed via the data model only; the interactive surface */\n/* picker will land in a follow-up. */\n/* - Condition editing is a single-step cycle on Space/Enter — good */\n/* enough for demos and stories; a richer picker belongs in a */\n/* popover and will reuse Radix Popover when it's wired in. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactElement,\n} from 'react';\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { toothSchemeAgent } from './tooth-scheme.agent';\n\nimport {\n CONDITION_COLORS,\n CONDITION_PATTERNS,\n CONDITION_TOKENS,\n FDI_TO_META,\n PERMANENT_TEETH,\n PRIMARY_TEETH,\n TOOTH_HIT_PAD,\n chartFromConditions,\n labelFor,\n layoutTeeth,\n type Dentition,\n type FdiId,\n type Numbering,\n type ToothChart,\n type ToothCondition,\n type ToothMode,\n type ToothState,\n} from './tooth-data';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface ToothSchemeProps {\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** Which teeth to render. Default `'permanent'`. */\n dentition?: Dentition;\n /** Numbering system shown on each tooth label. Default `'fdi'`. */\n numbering?: Numbering;\n /** `'interactive'` enables selection + keyboard nav; `'display'` is read-only. Default `'interactive'`. */\n mode?: ToothMode;\n /** Controlled chart state — the full `Record<FdiId, ToothState>`. */\n value?: ToothChart;\n /** Uncontrolled initial chart state. */\n defaultValue?: ToothChart;\n /** Fired whenever the chart changes — always emits FDI ids. */\n onChange?: (next: ToothChart) => void;\n /** Fired when a tooth is focused or clicked. */\n onSelect?: (toothId: FdiId) => void;\n /** Shortcut for pre-populating conditions: `{ '16': ['caries'], '36': ['filled'] }`. */\n conditions?: Partial<Record<FdiId, ToothCondition[]>>;\n /** Accessible label override for the chart region. */\n ariaLabel?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface ToothSchemeHandle {\n /** Programmatically focus a tooth by FDI id. */\n focusTooth: (id: FdiId) => void;\n /** Read the current chart state. */\n getChart: () => ToothChart;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:tooth-scheme-alfadocs',\n 'ds:inline-flex ds:flex-col',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n ].join(' '),\n);\n\nconst svgVariants = cva(\n ['ds:block ds:max-w-full ds:h-auto', 'ds:text-[var(--foreground)]'].join(' '),\n);\n\n// `group` here is load-bearing — the focus-ring <rect> below uses\n// `group-focus-visible:opacity-100` to appear when the parent <g> takes\n// focus. Without this class the selector never fires and keyboard users\n// see no focus indicator (a11y-critical-fixes.mdx).\nconst toothGroupVariants = cva(\n [\n 'ds:group ds:cursor-pointer',\n 'ds:focus:outline-none',\n 'ds:transition-[fill,stroke,opacity] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n ].join(' '),\n);\n\nconst legendVariants = cva(\n [\n 'ds:flex ds:flex-wrap ds:items-center',\n 'ds:gap-[var(--spacing-sm)]',\n 'type-meta ds:text-[var(--muted-foreground)]',\n ].join(' '),\n);\n\nconst legendItemVariants = cva(\n ['ds:inline-flex ds:items-center', 'ds:gap-[var(--spacing-xs)]'].join(' '),\n);\n\nconst legendSwatchVariants = cva(\n [\n 'ds:inline-block',\n 'ds:inline-size-[0.75rem] ds:block-size-[0.75rem]',\n 'ds:rounded-[var(--radius-xs)]',\n 'ds:border ds:border-[color:var(--border)]',\n ].join(' '),\n);\n\nconst liveRegionVariants = cva(['ds:sr-only'].join(' '));\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction isControlled(props: Pick<ToothSchemeProps, 'value'>): boolean {\n return props.value !== undefined;\n}\n\nfunction emptyState(): ToothState {\n return { conditions: [], surfaces: [] };\n}\n\nfunction cycleCondition(\n current: ToothCondition[] | undefined,\n): ToothCondition[] {\n if (!current || current.length === 0) return ['caries'];\n return [];\n}\n\nfunction sanitiseIdSuffix(raw: string): string {\n return raw.replace(/[^a-zA-Z0-9-_]/g, '');\n}\n\n/* ------------------------------------------------------------------ */\n/* Patterns <defs> */\n/* ------------------------------------------------------------------ */\n\ninterface PatternDefsProps {\n idPrefix: string;\n}\n\nfunction PatternDefs({ idPrefix }: PatternDefsProps): ReactElement {\n // We namespace pattern ids per-instance so multiple ToothScheme charts\n // on a page don't collide. References inside the component use\n // `${idPrefix}-${CONDITION_PATTERNS[condition]}`.\n const pid = (id: string): string => `${idPrefix}-${id}`;\n return (\n <defs>\n <pattern\n id={pid(CONDITION_PATTERNS.caries)}\n patternUnits=\"userSpaceOnUse\"\n width=\"6\"\n height=\"6\"\n patternTransform=\"rotate(45)\"\n >\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"6\"\n stroke={CONDITION_COLORS.caries}\n strokeWidth=\"2\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.filled)}\n patternUnits=\"userSpaceOnUse\"\n width=\"5\"\n height=\"5\"\n >\n <circle cx=\"2.5\" cy=\"2.5\" r=\"1\" fill={CONDITION_COLORS.filled} />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.crowned)}\n patternUnits=\"userSpaceOnUse\"\n width=\"6\"\n height=\"6\"\n >\n <path\n d=\"M0 0 L6 6 M6 0 L0 6\"\n stroke={CONDITION_COLORS.crowned}\n strokeWidth=\"1\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.implant)}\n patternUnits=\"userSpaceOnUse\"\n width=\"4\"\n height=\"4\"\n >\n <line\n x1=\"1\"\n y1=\"0\"\n x2=\"1\"\n y2=\"4\"\n stroke={CONDITION_COLORS.implant}\n strokeWidth=\"1\"\n />\n </pattern>\n <pattern\n id={pid(CONDITION_PATTERNS.rootCanal)}\n patternUnits=\"userSpaceOnUse\"\n width=\"4\"\n height=\"4\"\n >\n <line\n x1=\"0\"\n y1=\"1\"\n x2=\"4\"\n y2=\"1\"\n stroke={CONDITION_COLORS.rootCanal}\n strokeWidth=\"1\"\n />\n </pattern>\n {/* `missing` does not need a pattern — the renderer draws an X glyph. */}\n </defs>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Legend */\n/* ------------------------------------------------------------------ */\n\nconst ALL_CONDITIONS: ToothCondition[] = [\n 'caries',\n 'filled',\n 'crowned',\n 'missing',\n 'implant',\n 'rootCanal',\n];\n\ninterface LegendProps {\n idPrefix: string;\n}\n\nfunction Legend({ idPrefix: _idPrefix }: LegendProps): ReactElement {\n const { t } = useTranslation();\n return (\n <ul\n className={legendVariants()}\n data-testid=\"tooth-scheme-legend\"\n aria-label={t('toothScheme.legendLabel')}\n >\n {ALL_CONDITIONS.map((condition) => (\n <li key={condition} className={legendItemVariants()}>\n <span\n className={legendSwatchVariants()}\n aria-hidden=\"true\"\n data-condition={condition}\n data-token={CONDITION_TOKENS[condition]}\n data-testid={`tooth-scheme-legend-swatch-${condition}`}\n />\n <span>{t(`toothScheme.condition.${condition}`)}</span>\n </li>\n ))}\n </ul>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const ToothScheme = forwardRef<ToothSchemeHandle, ToothSchemeProps>(\n (\n {\n id,\n dentition = 'permanent',\n numbering = 'fdi',\n mode = 'interactive',\n value,\n defaultValue,\n onChange,\n onSelect,\n conditions,\n ariaLabel,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const rawId = useId();\n const idPrefix = useMemo(() => `ts-${sanitiseIdSuffix(rawId)}`, [rawId]);\n\n // Chart state — controlled / uncontrolled.\n const [internalChart, setInternalChart] = useState<ToothChart>(() => {\n if (value !== undefined) return value;\n if (defaultValue !== undefined) return defaultValue;\n if (conditions) return chartFromConditions(conditions);\n return {};\n });\n\n const chart: ToothChart = isControlled({ value })\n ? (value as ToothChart)\n : internalChart;\n\n // Keep uncontrolled chart in sync when `conditions` shortcut updates.\n useEffect(() => {\n if (isControlled({ value })) return;\n if (conditions === undefined) return;\n setInternalChart(chartFromConditions(conditions));\n // Intentionally depend on a stable key — swapping the entire prop\n // snapshot is the consumer's signal to reset.\n }, [conditions, value]);\n\n // Layout.\n const layout = useMemo(() => layoutTeeth(dentition), [dentition]);\n const visibleIds = useMemo(() => layout.teeth.map((t) => t.fdi), [layout]);\n\n // Roving tabindex: which tooth owns `tabindex=\"0\"`.\n const firstId: FdiId | undefined = visibleIds[0];\n const [focusedId, setFocusedId] = useState<FdiId | undefined>(firstId);\n useEffect(() => {\n if (!focusedId || !visibleIds.includes(focusedId)) {\n setFocusedId(firstId);\n }\n }, [firstId, focusedId, visibleIds]);\n\n // Live-region announcement text.\n const [announcement, setAnnouncement] = useState<string>('');\n\n const svgRef = useRef<SVGSVGElement>(null);\n\n const commitChart = useCallback(\n (next: ToothChart) => {\n if (!isControlled({ value })) {\n setInternalChart(next);\n }\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const focusToothById = useCallback((id: FdiId) => {\n const svg = svgRef.current;\n if (!svg) return;\n const node = svg.querySelector<SVGGElement>(`g[data-fdi=\"${id}\"]`);\n if (node) {\n node.focus();\n setFocusedId(id);\n }\n }, []);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const agentHandle = useMemo<ToothSchemeHandle>(\n () => ({\n focusTooth: (id: FdiId) => {\n focusToothById(id);\n },\n getChart: () => chart,\n }),\n [chart, focusToothById],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(toothSchemeAgent, agentHandle, id);\n\n /* ------------------------------------------------------------- */\n /* Keyboard navigation */\n /* ------------------------------------------------------------- */\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<SVGGElement>, id: FdiId) => {\n if (mode !== 'interactive') return;\n const meta = FDI_TO_META[id];\n if (!meta) return;\n\n // Resolve the ordered list of visible ids for Left/Right.\n const order = visibleIds;\n const currentIndex = order.indexOf(id);\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault();\n const nextIndex = Math.min(order.length - 1, currentIndex + 1);\n focusToothById(order[nextIndex]);\n return;\n }\n case 'ArrowLeft': {\n event.preventDefault();\n const nextIndex = Math.max(0, currentIndex - 1);\n focusToothById(order[nextIndex]);\n return;\n }\n case 'ArrowUp':\n case 'ArrowDown': {\n event.preventDefault();\n // Map to the opposing arch, same FDI position where possible.\n // Permanent: 1 ↔ 4, 2 ↔ 3. Primary: 5 ↔ 8, 6 ↔ 7.\n const quadrantMap: Record<number, number> = {\n 1: 4,\n 4: 1,\n 2: 3,\n 3: 2,\n 5: 8,\n 8: 5,\n 6: 7,\n 7: 6,\n };\n const targetQuadrant = quadrantMap[meta.quadrant];\n if (!targetQuadrant) return;\n const candidate = `${targetQuadrant}${meta.positionInQuadrant}`;\n if (order.includes(candidate)) {\n focusToothById(candidate);\n }\n return;\n }\n case 'Home': {\n event.preventDefault();\n // First tooth in the same quadrant (visible).\n const inQuadrant = order.filter(\n (other) => FDI_TO_META[other].quadrant === meta.quadrant,\n );\n if (inQuadrant.length > 0) {\n focusToothById(inQuadrant[0]);\n }\n return;\n }\n case 'End': {\n event.preventDefault();\n const inQuadrant = order.filter(\n (other) => FDI_TO_META[other].quadrant === meta.quadrant,\n );\n if (inQuadrant.length > 0) {\n focusToothById(inQuadrant[inQuadrant.length - 1]);\n }\n return;\n }\n case ' ':\n case 'Enter': {\n event.preventDefault();\n const prev = chart[id]?.conditions;\n const nextConditions = cycleCondition(prev);\n const next: ToothChart = { ...chart };\n if (nextConditions.length === 0) {\n delete next[id];\n setAnnouncement(t('toothScheme.deselected', { id }));\n } else {\n next[id] = {\n ...(chart[id] ?? emptyState()),\n conditions: nextConditions,\n };\n setAnnouncement(\n t('toothScheme.selected', {\n id,\n conditions: nextConditions\n .map((c) => t(`toothScheme.condition.${c}`))\n .join(', '),\n }),\n );\n }\n commitChart(next);\n onSelect?.(id);\n return;\n }\n default:\n return;\n }\n },\n [chart, commitChart, focusToothById, mode, onSelect, t, visibleIds],\n );\n\n const handleClick = useCallback(\n (id: FdiId) => {\n if (mode !== 'interactive') return;\n setFocusedId(id);\n const prev = chart[id]?.conditions;\n const nextConditions = cycleCondition(prev);\n const next: ToothChart = { ...chart };\n if (nextConditions.length === 0) {\n delete next[id];\n setAnnouncement(t('toothScheme.deselected', { id }));\n } else {\n next[id] = {\n ...(chart[id] ?? emptyState()),\n conditions: nextConditions,\n };\n setAnnouncement(\n t('toothScheme.selected', {\n id,\n conditions: nextConditions\n .map((c) => t(`toothScheme.condition.${c}`))\n .join(', '),\n }),\n );\n }\n commitChart(next);\n onSelect?.(id);\n },\n [chart, commitChart, mode, onSelect, t],\n );\n\n /* ------------------------------------------------------------- */\n /* Rendering */\n /* ------------------------------------------------------------- */\n\n const viewBoxWidth = layout.width + 4; // small padding for stroke\n const viewBoxHeight = layout.height + 4;\n\n const regionLabel = ariaLabel ?? t('toothScheme.ariaLabel');\n\n return (\n <RadixTooltip.Provider delayDuration={200}>\n <div\n ref={rootRef}\n role=\"region\"\n aria-label={regionLabel}\n className={[rootVariants(), className].filter(Boolean).join(' ')}\n data-component=\"tooth-scheme\"\n data-component-id={id}\n data-testid=\"tooth-scheme-root\"\n data-dentition={dentition}\n data-numbering={numbering}\n data-mode={mode}\n >\n <svg\n ref={svgRef}\n viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}\n className={svgVariants()}\n role=\"group\"\n aria-label={regionLabel}\n data-testid=\"tooth-scheme-svg\"\n focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <PatternDefs idPrefix={idPrefix} />\n\n {layout.teeth.map((tooth) => {\n const state = chart[tooth.fdi];\n const primaryCondition: ToothCondition | undefined =\n state?.conditions?.[0];\n\n const anatomyLabel = t(\n `toothScheme.anatomy.${tooth.meta.anatomy}`,\n );\n const conditionSuffix = primaryCondition\n ? `, ${t(`toothScheme.condition.${primaryCondition}`)}`\n : '';\n const label = t('toothScheme.toothLabel', {\n id: labelFor(tooth.fdi, numbering),\n anatomy: anatomyLabel,\n conditionSuffix,\n });\n\n const tabIndex =\n mode === 'interactive'\n ? tooth.fdi === focusedId\n ? 0\n : -1\n : undefined;\n\n const fillColour: string =\n primaryCondition && primaryCondition !== 'missing'\n ? `url(#${idPrefix}-${CONDITION_PATTERNS[primaryCondition]})`\n : 'var(--muted)';\n\n const strokeColour: string =\n primaryCondition && primaryCondition !== 'missing'\n ? CONDITION_COLORS[primaryCondition]\n : 'var(--border)';\n\n const tooltipContent = primaryCondition\n ? `${anatomyLabel} · ${t(`toothScheme.condition.${primaryCondition}`)}`\n : anatomyLabel;\n\n const labelText = labelFor(tooth.fdi, numbering);\n\n return (\n <RadixTooltip.Root key={tooth.fdi}>\n <RadixTooltip.Trigger asChild>\n <g\n data-fdi={tooth.fdi}\n data-anatomy={tooth.meta.anatomy}\n data-arch={tooth.meta.arch}\n data-side={tooth.meta.side}\n data-quadrant={tooth.meta.quadrant}\n data-condition={primaryCondition ?? 'none'}\n data-testid={`tooth-${tooth.fdi}`}\n transform={`translate(${tooth.x}, ${tooth.y})`}\n tabIndex={tabIndex}\n // SVG `<g>` has no implicit role, so `aria-label`\n // would be rejected by axe's `aria-prohibited-attr`\n // rule. Give it an explicit role: `button` in\n // interactive mode, `img` in display mode (the\n // group reads as a single labelled tooth glyph).\n role={mode === 'interactive' ? 'button' : 'img'}\n aria-label={label}\n aria-pressed={\n mode === 'interactive'\n ? primaryCondition !== undefined\n : undefined\n }\n className={toothGroupVariants()}\n onClick={\n mode === 'interactive'\n ? () => handleClick(tooth.fdi)\n : undefined\n }\n onFocus={() => setFocusedId(tooth.fdi)}\n onKeyDown={(event) => handleKeyDown(event, tooth.fdi)}\n >\n {/* Invisible ≥44px hit target (WCAG 2.5.5). */}\n <rect\n x={-TOOTH_HIT_PAD}\n y={-TOOTH_HIT_PAD}\n width={tooth.shape.width + TOOTH_HIT_PAD * 2}\n height={tooth.shape.height + TOOTH_HIT_PAD * 2}\n fill=\"transparent\"\n />\n {/* Crown outline. */}\n <path\n d={tooth.shape.path}\n fill={fillColour}\n stroke={strokeColour}\n strokeWidth=\"1.5\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {tooth.shape.innerPath ? (\n <path\n d={tooth.shape.innerPath}\n fill=\"none\"\n stroke=\"var(--muted-foreground)\"\n strokeWidth=\"0.75\"\n vectorEffect=\"non-scaling-stroke\"\n />\n ) : null}\n {/* Focus ring — drawn as a rect so it tracks the hit\n area. `group` on the parent <g> makes this\n group-focus-visible selector fire when a keyboard\n user focuses the tooth. In forced-colors mode the\n ring falls back to `CanvasText` so it stays visible\n when `var(--ring)` is remapped. */}\n <rect\n x={-TOOTH_HIT_PAD}\n y={-TOOTH_HIT_PAD}\n width={tooth.shape.width + TOOTH_HIT_PAD * 2}\n height={tooth.shape.height + TOOTH_HIT_PAD * 2}\n fill=\"none\"\n stroke=\"var(--ring)\"\n strokeWidth=\"var(--focus-ring-width)\"\n className={[\n 'ds:opacity-0',\n 'ds:group-focus-visible:opacity-100',\n 'ds:forced-colors:stroke-[CanvasText]',\n ].join(' ')}\n data-testid={`tooth-${tooth.fdi}-focus-ring`}\n pointerEvents=\"none\"\n rx=\"4\"\n />\n {/* Missing-tooth X glyph. */}\n {primaryCondition === 'missing' ? (\n <path\n d={`M2 2 L${tooth.shape.width - 2} ${tooth.shape.height - 2} M${tooth.shape.width - 2} 2 L2 ${tooth.shape.height - 2}`}\n stroke={CONDITION_COLORS.missing}\n strokeWidth=\"2\"\n fill=\"none\"\n />\n ) : null}\n {/* Tooth number label — sits below (upper arch) or above (lower) the crown. */}\n <text\n x={tooth.shape.width / 2}\n y={\n tooth.meta.arch === 'upper'\n ? tooth.shape.height + 12\n : -4\n }\n textAnchor=\"middle\"\n fontSize=\"10\"\n fill=\"var(--muted-foreground)\"\n className=\"ds:select-none\"\n aria-hidden=\"true\"\n >\n {labelText}\n </text>\n </g>\n </RadixTooltip.Trigger>\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n side=\"top\"\n sideOffset={6}\n className=\"ds:z-[var(--z-tooltip)] ds:rounded-[var(--radius-sm)] ds:bg-[var(--foreground)] ds:text-[var(--background)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[calc(var(--spacing-xs)/2)] ds:pb-[calc(var(--spacing-xs)/2)] ds:text-[length:var(--font-size-xs)]\"\n >\n {tooltipContent}\n <RadixTooltip.Arrow className=\"ds:fill-[var(--foreground)]\" />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n </RadixTooltip.Root>\n );\n })}\n </svg>\n\n <Legend idPrefix={idPrefix} />\n\n <div\n className={liveRegionVariants()}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"tooth-scheme-live\"\n >\n {announcement}\n </div>\n </div>\n </RadixTooltip.Provider>\n );\n },\n);\n\nToothScheme.displayName = 'ToothScheme';\n\n/* ------------------------------------------------------------------ */\n/* Re-exports */\n/* ------------------------------------------------------------------ */\n\nexport { rootVariants as toothSchemeVariants, PERMANENT_TEETH, PRIMARY_TEETH };\nexport type {\n Dentition,\n FdiId,\n Numbering,\n ToothChart,\n ToothCondition,\n ToothMode,\n ToothState,\n} from './tooth-data';\n"],"names":["toothSchemeAgent","handle","args","PERMANENT_TEETH","PRIMARY_TEETH","permanentAnatomy","positionInQuadrant","primaryAnatomy","palmerCode","quadrant","position","normalised","permanentUniversal","primaryUniversal","letters","index","buildMeta","fdi","isPrimary","anatomy","arch","side","universal","palmer","FDI_TO_META","acc","FDI_TO_UNIVERSAL","meta","FDI_TO_PALMER","CONDITION_TOKENS","CONDITION_COLORS","CONDITION_PATTERNS","TOOTH_SHAPES","TOOTH_GAP","TOOTH_ROW_GAP","TOOTH_HIT_PAD","layoutTeeth","dentition","ids","upper","lower","id","rowHeight","maxPerRow","positionRow","row","yOffset","rowWidth","shape","fullRowWidth","cursor","tooth","upperRow","lowerRow","maxRowWidth","t","width","height","labelFor","numbering","emptyChart","chartFromConditions","conditions","chart","list","rootVariants","cva","svgVariants","toothGroupVariants","legendVariants","legendItemVariants","legendSwatchVariants","liveRegionVariants","isControlled","props","emptyState","cycleCondition","current","sanitiseIdSuffix","raw","PatternDefs","idPrefix","pid","jsx","ALL_CONDITIONS","Legend","_idPrefix","useTranslation","condition","ToothScheme","forwardRef","mode","value","defaultValue","onChange","onSelect","ariaLabel","className","ref","rawId","useId","useMemo","internalChart","setInternalChart","useState","useEffect","layout","visibleIds","firstId","focusedId","setFocusedId","announcement","setAnnouncement","svgRef","useRef","commitChart","useCallback","next","focusToothById","svg","node","rootRef","agentHandle","useImperativeHandle","useAgentRegistration","handleKeyDown","event","order","currentIndex","nextIndex","targetQuadrant","candidate","inQuadrant","other","prev","_a","nextConditions","c","handleClick","viewBoxWidth","viewBoxHeight","regionLabel","RadixTooltip","jsxs","state","primaryCondition","anatomyLabel","conditionSuffix","label","tabIndex","fillColour","strokeColour","tooltipContent","labelText"],"mappings":";;;;;;AAGO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAC,MAAM;AAAA,EACrB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MACb,QAAQ,CACNA,GACAC,MACG;AACH,QAAAD,EAAO,WAAWC,EAAK,EAAE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A,8BACX,UAAS;AAAA,8BACT,MAAK;AAAA,8BACL,WAAU;AAAA,8BACV,eAAY;AAAA,8BAEX,UAAAsG;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACH;AAAA,sBAAA;AAAA,oBAAA,GAEJ;AAAA,oBACA,gBAAAtE,EAAC2D,EAAa,QAAb,EACC,UAAA,gBAAAC;AAAA,sBAACD,EAAa;AAAA,sBAAb;AAAA,wBACC,MAAK;AAAA,wBACL,YAAY;AAAA,wBACZ,WAAU;AAAA,wBAET,UAAA;AAAA,0BAAAU;AAAA,0BACD,gBAAArE,EAAC2D,EAAa,OAAb,EAAmB,WAAU,8BAAA,CAA8B;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBAAA,EAC9D,CACF;AAAA,kBAAA,EAAA,GArHsB3F,EAAM,GAsH9B;AAAA,gBAEJ,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGH,gBAAAgC,EAACE,MAAO,UAAAJ,GAAoB;AAAA,UAE5B,gBAAAE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWX,GAAA;AAAA,cACX,aAAU;AAAA,cACV,eAAY;AAAA,cACZ,eAAY;AAAA,cAEX,UAAAuC;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEAtB,GAAY,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-password-requirements-DsgduV1x.js","sources":["../../src/components/password-input/password-input.agent.ts","../../src/components/password-input/password-input.tsx","../../src/components/password-input/use-password-requirements.ts"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PasswordInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PasswordInputHandle } from './password-input';\n\nexport const passwordInputAgent: AgentAdapter<PasswordInputHandle> = {\n id: 'password-input',\n capabilities: ['edit_inline'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.passwordInput.state.value',\n description:\n 'Current password value. Never log or persist this off-device.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.passwordInput.state.isEmpty',\n description: 'Whether the input has no value.',\n read: (handle) => handle.getValue() === '',\n },\n isRevealed: {\n type: 'boolean',\n descriptionKey: 'ui.agent.passwordInput.state.isRevealed',\n description: 'Whether the password is currently shown in plain text.',\n read: (handle) => handle.isRevealed(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.passwordInput.actions.setValue',\n description: 'Replace the password value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n descriptionKey: 'ui.agent.passwordInput.actions.clear',\n description: 'Empty the input. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.passwordInput.actions.focus',\n description: 'Move keyboard focus to the input.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n toggle_visibility: {\n safety: 'read',\n descriptionKey: 'ui.agent.passwordInput.actions.toggleVisibility',\n description: 'Toggle between masked and plain-text display.',\n invoke: (handle) => {\n handle.toggleVisibility();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'password-input',\n description: 'Marks the PasswordInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type FormEvent,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { AlertTriangle, Check, Circle, Eye, EyeOff } from 'lucide-react';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport { useFormField } from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { passwordInputAgent } from './password-input.agent';\n\n/** Agent-readiness curated handle for PasswordInput. */\nexport interface PasswordInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n isRevealed: () => boolean;\n toggleVisibility: () => void;\n}\n\ntype Strength = 0 | 1 | 2 | 3;\n\ntype SizeKey = NonNullable<TextInputProps['size']>;\n\nconst iconSizeClassBySize: Record<SizeKey, string> = {\n sm: 'ds:size-4',\n md: 'ds:size-[18px]',\n lg: 'ds:size-5',\n};\n\nconst toggleVariants = cva(\n [\n 'ds:absolute ds:inset-y-0 ds:end-0 ds:ps-2 ds:pe-3',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:bg-transparent ds:border-0 ds:cursor-pointer',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:min-w-[var(--min-target-size)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n);\n\nconst strengthTrackVariants = cva(\n 'ds:h-1 ds:w-full ds:overflow-hidden ds:rounded-[var(--radius-full)] ds:bg-muted',\n);\n\nconst strengthBarVariants = cva(\n [\n 'ds:h-full ds:rounded-[var(--radius-full)]',\n 'ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n ].join(' '),\n {\n variants: {\n level: {\n 0: 'ds:w-1/4 ds:bg-destructive',\n 1: 'ds:w-1/2 ds:bg-warning',\n 2: 'ds:w-3/4 ds:bg-success',\n 3: 'ds:w-full ds:bg-success',\n },\n },\n defaultVariants: { level: 0 },\n },\n);\n\nconst strengthLabelByLevel: Record<\n Strength,\n 'weak' | 'fair' | 'good' | 'strong'\n> = {\n 0: 'weak',\n 1: 'fair',\n 2: 'good',\n 3: 'strong',\n};\n\nconst requirementRowVariants = cva(\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta',\n {\n variants: {\n met: {\n true: 'ds:text-success',\n false: 'ds:text-muted-foreground',\n },\n },\n defaultVariants: { met: false },\n },\n);\n\n/**\n * One row in the live requirements checklist. Consumers either build\n * these inline or pull a pre-built set from `usePasswordRequirements`.\n */\nexport interface PasswordRequirement {\n /** Stable id — keyed render + a11y. */\n id: string;\n /** Already-translated label. The consumer owns the wording. */\n label: string;\n /** Predicate against the current value. Pure, runs on every keystroke. */\n test: (value: string) => boolean;\n}\n\nexport interface PasswordInputProps\n extends\n Omit<TextInputProps, 'type' | 'endAdornment' | 'startAdornment'>,\n VariantProps<typeof strengthBarVariants> {\n /** Callback when reveal state changes (for analytics). */\n onRevealChange?: (revealed: boolean) => void;\n /** Show the strength meter below the input. */\n showStrength?: boolean;\n /** Strength score: 0 = weak, 1 = fair, 2 = good, 3 = strong. */\n strength?: Strength;\n /**\n * Live requirements checklist rendered between the input and the\n * strength meter / caps-lock notice. Each row's predicate runs on\n * every keystroke and the row's `data-state` flips between `\"met\"`\n * and `\"unmet\"`. Backed by `aria-live=\"polite\"` so screen readers\n * announce each transition as a visually-hidden suffix span flips\n * between localised \"met\" / \"not yet met\" copy.\n *\n * Tip: hoist or `useMemo` the array — inlining it in JSX makes the\n * predicate-results memo bust every render. The kit's\n * `usePasswordRequirements` helper already does this.\n */\n requirements?: ReadonlyArray<PasswordRequirement>;\n /**\n * When `true` AND `strength` is not provided, derive a 0–3 score\n * from the proportion of `requirements` satisfied. Lets consumers\n * get the strength bar \"for free\" once they declare requirements.\n */\n deriveStrength?: boolean;\n /**\n * Autocomplete hint. Defaults to 'current-password'.\n * Use 'new-password' for registration/change-password forms.\n */\n autoComplete?: 'current-password' | 'new-password' | (string & {});\n}\n\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (\n {\n onRevealChange,\n showStrength = false,\n strength,\n requirements,\n deriveStrength = false,\n autoComplete,\n size = 'md',\n disabled,\n name,\n id,\n onKeyDown,\n onKeyUp,\n onBlur,\n onInput,\n defaultValue,\n value,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const ctx = useFormField();\n const effectiveDisabled = ctx.disabled || disabled;\n\n const innerInputRef = useRef<HTMLInputElement | null>(null);\n const composedRef = composeRefs(ref, innerInputRef);\n\n const [revealed, setRevealed] = useState(false);\n const [capsLock, setCapsLock] = useState(false);\n\n // Track the current value internally so the requirements checklist\n // can re-evaluate predicates without forcing consumers to lift the\n // input into a controlled state. The seed is whichever of\n // `value` / `defaultValue` was passed; the `input` listener then\n // keeps it in sync on every keystroke (covers both controlled and\n // uncontrolled callers — for controlled callers we resync to the\n // incoming `value` prop in the effect below).\n const [internalValue, setInternalValue] = useState<string>(() => {\n if (typeof value === 'string') return value;\n if (typeof defaultValue === 'string') return defaultValue;\n return '';\n });\n\n useEffect(() => {\n if (typeof value === 'string') setInternalValue(value);\n }, [value]);\n\n const handleInput = useCallback(\n (event: FormEvent<HTMLInputElement>) => {\n setInternalValue(event.currentTarget.value);\n onInput?.(event);\n },\n [onInput],\n );\n\n const writeValueToInput = useCallback((next: string) => {\n const node = innerInputRef.current;\n if (!node) return;\n const prototype = Object.getPrototypeOf(node) as HTMLInputElement;\n const setter = Object.getOwnPropertyDescriptor(prototype, 'value')?.set;\n setter?.call(node, next);\n node.dispatchEvent(new Event('input', { bubbles: true }));\n node.dispatchEvent(new Event('change', { bubbles: true }));\n }, []);\n\n const handleToggle = useCallback(() => {\n setRevealed((prev) => {\n const next = !prev;\n onRevealChange?.(next);\n return next;\n });\n }, [onRevealChange]);\n\n const detectCaps = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n if (typeof event.getModifierState === 'function') {\n setCapsLock(event.getModifierState('CapsLock'));\n }\n }, []);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n detectCaps(event);\n onKeyDown?.(event);\n },\n [detectCaps, onKeyDown],\n );\n\n const handleKeyUp = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n detectCaps(event);\n onKeyUp?.(event);\n },\n [detectCaps, onKeyUp],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setCapsLock(false);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const agentHandle = useMemo<PasswordInputHandle>(\n () => ({\n getValue: () => innerInputRef.current?.value ?? '',\n setValue: (next) => writeValueToInput(next),\n clear: () => writeValueToInput(''),\n focus: () => innerInputRef.current?.focus(),\n isRevealed: () => revealed,\n toggleVisibility: () => {\n setRevealed((prev) => {\n const next = !prev;\n onRevealChange?.(next);\n return next;\n });\n },\n }),\n [onRevealChange, revealed, writeValueToInput],\n );\n useAgentRegistration(passwordInputAgent, agentHandle, id);\n\n const iconSizeClass = iconSizeClassBySize[size];\n const toggleLabel = t(\n revealed ? 'inputs.password.toggleHide' : 'inputs.password.toggleShow',\n revealed ? 'Hide password' : 'Show password',\n );\n\n // Evaluate each requirement against the current value. Cheap by\n // construction — predicates are pure regex/length checks supplied\n // by the consumer; the kit doesn't memoise per-row because the\n // map is O(n) over a handful of rules and React would re-render\n // the row anyway when its `data-state` flips.\n const requirementResults = useMemo(\n () =>\n requirements?.map((req) => ({\n ...req,\n met: req.test(internalValue),\n })) ?? null,\n [requirements, internalValue],\n );\n\n // Derive a 0–3 score from the satisfied proportion when the\n // consumer hasn't supplied an explicit `strength`. Formula:\n // `floor((satisfied / total) * 4)`, clamped to 3 so a fully-met\n // checklist matches the explicit \"strong\" level. With zero\n // requirements we fall back to 0 — meaningless on its own but\n // never displayed since `showStrength` is what controls the bar.\n const derivedStrength: Strength = useMemo(() => {\n if (!deriveStrength || !requirementResults?.length) return 0;\n const satisfied = requirementResults.filter((r) => r.met).length;\n const total = requirementResults.length;\n return Math.min(3, Math.floor((satisfied / total) * 4)) as Strength;\n }, [deriveStrength, requirementResults]);\n\n const effectiveStrength: Strength =\n strength !== undefined ? strength : deriveStrength ? derivedStrength : 0;\n const strengthKey = strengthLabelByLevel[effectiveStrength];\n const strengthText = t(\n `inputs.password.strength.${strengthKey}`,\n strengthKey.charAt(0).toUpperCase() + strengthKey.slice(1),\n );\n\n return (\n <div\n data-component=\"password-input\"\n data-component-id={id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <div className=\"ds:relative\">\n <TextInput\n ref={composedRef}\n id={id}\n type={revealed ? 'text' : 'password'}\n autoComplete={autoComplete ?? 'current-password'}\n name={name ?? 'password'}\n spellCheck={false}\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n size={size}\n disabled={effectiveDisabled}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onBlur={handleBlur}\n onInput={handleInput}\n value={value}\n defaultValue={defaultValue}\n endAdornment={\n <span aria-hidden=\"true\" className=\"ds:block ds:size-4\" />\n }\n className={className}\n {...rest}\n />\n <button\n type=\"button\"\n aria-pressed={revealed}\n aria-label={toggleLabel}\n disabled={effectiveDisabled}\n onClick={handleToggle}\n className={toggleVariants()}\n >\n {revealed ? (\n <EyeOff aria-hidden=\"true\" className={iconSizeClass} />\n ) : (\n <Eye aria-hidden=\"true\" className={iconSizeClass} />\n )}\n </button>\n </div>\n\n {requirementResults && requirementResults.length > 0 ? (\n // `role=\"list\"` / `role=\"listitem\"` are set explicitly even\n // though they're the implicit roles on <ul>/<li> — Safari\n // VoiceOver strips the implicit list role when CSS sets\n // `list-style: none` (which `ds:list-none` does), so the\n // redundancy is load-bearing for AT, not a lint nit.\n //\n // aria-live=\"polite\" announces transitions as the per-row\n // `.ds:sr-only` state suffix flips between \"met\" / \"not yet\n // met\". aria-live observes text-content mutations, not\n // attribute or class changes, so the data-state attribute\n // alone wouldn't trigger an announcement — the sr-only span\n // is the load-bearing piece for AT users.\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <ul\n role=\"list\"\n aria-live=\"polite\"\n data-component=\"password-requirements\"\n className=\"ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {requirementResults.map((req) => (\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <li\n key={req.id}\n role=\"listitem\"\n data-state={req.met ? 'met' : 'unmet'}\n className={requirementRowVariants({ met: req.met })}\n >\n {req.met ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-3.5 ds:text-success ds:shrink-0\"\n />\n ) : (\n <Circle\n aria-hidden=\"true\"\n className=\"ds:size-3.5 ds:shrink-0\"\n />\n )}\n <span>{req.label}</span>\n <span className=\"ds:sr-only\">\n {' — '}\n {req.met\n ? t('inputs.password.requirements.met', 'met')\n : t('inputs.password.requirements.unmet', 'not yet met')}\n </span>\n </li>\n ))}\n </ul>\n ) : null}\n\n {capsLock ? (\n <span\n role=\"status\"\n aria-live=\"polite\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta ds:text-warning\"\n >\n <AlertTriangle aria-hidden=\"true\" className=\"ds:size-3.5\" />\n {t('inputs.password.capsLock', 'Caps Lock is on')}\n </span>\n ) : null}\n\n {showStrength ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div\n role=\"progressbar\"\n aria-valuenow={effectiveStrength}\n aria-valuemin={0}\n aria-valuemax={3}\n aria-label={t(\n 'inputs.password.strengthLabel',\n 'Password strength',\n )}\n aria-valuetext={strengthText}\n className={strengthTrackVariants()}\n >\n <div\n className={strengthBarVariants({ level: effectiveStrength })}\n />\n </div>\n <span\n aria-hidden=\"true\"\n className=\"type-meta ds:text-muted-foreground\"\n >\n {strengthText}\n </span>\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nPasswordInput.displayName = 'PasswordInput';\n","import { useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { PasswordRequirement } from './password-input';\n\nexport interface UsePasswordRequirementsOptions {\n /**\n * Minimum password length. When set, adds a \"length\" requirement.\n * Pass `12` (or whatever the server-side regex enforces) so the\n * inline checklist tells users the same rule they'll bounce off\n * server-side. When omitted, no length row is rendered.\n */\n minLength?: number;\n /** Adds an \"uppercase letter\" requirement when true. */\n uppercase?: boolean;\n /** Adds a \"lowercase letter\" requirement when true. */\n lowercase?: boolean;\n /** Adds a \"digit\" requirement when true. */\n digit?: boolean;\n /** Adds a \"symbol\" requirement when true. Matches anything outside `[A-Za-z0-9\\s]`. */\n symbol?: boolean;\n /**\n * Adds a \"no spaces\" requirement when true. Fails if the value\n * contains any whitespace character (space, tab, non-breaking space,\n * narrow no-break space, etc.). Useful to catch paste-time stray\n * whitespace from credential managers.\n */\n noSpaces?: boolean;\n}\n\n/**\n * Builds the common set of password requirements with i18n-resolved\n * labels. Designed for the AlfaDocs platform's patient-registration\n * server-side regex (`/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{12,}$/`) but\n * generic enough for any consumer.\n *\n * Each opt-in flag adds one row to the returned array, in a stable\n * visual order (length → uppercase → lowercase → digit → symbol → noSpaces).\n * Predicates are pure and run on every keystroke.\n *\n * @example\n * const requirements = usePasswordRequirements({\n * minLength: 12,\n * uppercase: true,\n * lowercase: true,\n * digit: true,\n * noSpaces: true,\n * });\n * <PasswordInput requirements={requirements} deriveStrength />\n */\nexport function usePasswordRequirements(\n opts: UsePasswordRequirementsOptions = {},\n): PasswordRequirement[] {\n const { t } = useTranslation();\n const { minLength, uppercase, lowercase, digit, symbol, noSpaces } = opts;\n\n return useMemo(() => {\n const list: PasswordRequirement[] = [];\n\n if (typeof minLength === 'number' && minLength > 0) {\n list.push({\n id: 'length',\n label: t('inputs.password.requirements.length', {\n count: minLength,\n defaultValue: `At least ${minLength} characters`,\n }),\n test: (v) => v.length >= minLength,\n });\n }\n\n if (uppercase) {\n list.push({\n id: 'uppercase',\n label: t(\n 'inputs.password.requirements.uppercase',\n 'One uppercase letter',\n ),\n test: (v) => /\\p{Lu}/u.test(v),\n });\n }\n\n if (lowercase) {\n list.push({\n id: 'lowercase',\n label: t(\n 'inputs.password.requirements.lowercase',\n 'One lowercase letter',\n ),\n test: (v) => /\\p{Ll}/u.test(v),\n });\n }\n\n if (digit) {\n list.push({\n id: 'digit',\n label: t('inputs.password.requirements.digit', 'One number'),\n test: (v) => /\\p{Nd}/u.test(v),\n });\n }\n\n if (symbol) {\n list.push({\n id: 'symbol',\n label: t('inputs.password.requirements.symbol', 'One symbol'),\n // Anything that isn't a letter, number, or whitespace counts.\n // `\\p{L}` + `\\p{N}` keep this Unicode-aware so non-Latin\n // alphabets (Arabic, Chinese, …) aren't mis-classified as\n // symbols.\n test: (v) => /[^\\p{L}\\p{N}\\s]/u.test(v),\n });\n }\n\n if (noSpaces) {\n list.push({\n id: 'no-spaces',\n label: t('inputs.password.requirements.noSpaces', 'No spaces'),\n // `\\s` covers ASCII space + tab + newline. The explicit\n // U+00A0 (non-breaking space) and U+202F (narrow no-break\n // space) catch the two paste-time characters credential\n // managers and rich-text editors most often inject without\n // the user noticing — those are NOT always in `\\s`.\n // Authored via hex escapes (not literal characters) so the\n // source file passes `no-irregular-whitespace`.\n test: (v) => !/[\\s\\u00A0\\u202F]/.test(v),\n });\n }\n\n return list;\n }, [t, minLength, uppercase, lowercase, digit, symbol, noSpaces]);\n}\n"],"names":["passwordInputAgent","handle","args","iconSizeClassBySize","toggleVariants","cva","strengthTrackVariants","strengthBarVariants","strengthLabelByLevel","requirementRowVariants","PasswordInput","forwardRef","onRevealChange","showStrength","strength","requirements","deriveStrength","autoComplete","size","disabled","name","id","onKeyDown","onKeyUp","onBlur","onInput","defaultValue","value","className","rest","ref","t","useTranslation","effectiveDisabled","useFormField","innerInputRef","useRef","composedRef","composeRefs","revealed","setRevealed","useState","capsLock","setCapsLock","internalValue","setInternalValue","useEffect","handleInput","useCallback","event","writeValueToInput","next","node","prototype","setter","_a","handleToggle","prev","detectCaps","handleKeyDown","handleKeyUp","handleBlur","agentHandle","useMemo","useAgentRegistration","iconSizeClass","toggleLabel","requirementResults","req","derivedStrength","satisfied","r","total","effectiveStrength","strengthKey","strengthText","jsxs","jsx","TextInput","EyeOff","Eye","Check","Circle","AlertTriangle","usePasswordRequirements","opts","minLength","uppercase","lowercase","digit","symbol","noSpaces","list","v"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,KAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,eAAe;AAAA,IAAA;AAAA,IAE1C,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,WAAA;AAAA,IAAW;AAAA,EACtC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,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AAAA,QACL;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,MAAM,CAAC8D,MAAM,WAAA,WAAA,GAAA,EAAU,KAAKA,CAAC;AAAA,IAAA,CAC9B,GAGCJ,KACFG,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,sCAAsC,YAAY;AAAA,MAC3D,MAAM,CAAC8D,MAAM,WAAA,WAAA,GAAA,EAAU,KAAKA,CAAC;AAAA,IAAA,CAC9B,GAGCH,KACFE,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,uCAAuC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,MAK5D,MAAM,CAAC8D,MAAM,mBAAmB,KAAKA,CAAC;AAAA,IAAA,CACvC,GAGCF,KACFC,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,yCAAyC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQ7D,MAAM,CAAC8D,MAAM,CAAC,mBAAmB,KAAKA,CAAC;AAAA,IAAA,CACxC,GAGID;AAAA,EACT,GAAG,CAAC7D,GAAGuD,GAAWC,GAAWC,GAAWC,GAAOC,GAAQC,CAAQ,CAAC;AAClE;"}
1
+ {"version":3,"file":"use-password-requirements-DsgduV1x.js","sources":["../../src/components/password-input/password-input.agent.ts","../../src/components/password-input/password-input.tsx","../../src/components/password-input/use-password-requirements.ts"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PasswordInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PasswordInputHandle } from './password-input';\n\nexport const passwordInputAgent: AgentAdapter<PasswordInputHandle> = {\n id: 'password-input',\n capabilities: ['edit_inline'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.passwordInput.state.value',\n description:\n 'Current password value. Never log or persist this off-device.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.passwordInput.state.isEmpty',\n description: 'Whether the input has no value.',\n read: (handle) => handle.getValue() === '',\n },\n isRevealed: {\n type: 'boolean',\n descriptionKey: 'ui.agent.passwordInput.state.isRevealed',\n description: 'Whether the password is currently shown in plain text.',\n read: (handle) => handle.isRevealed(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.passwordInput.actions.setValue',\n description: 'Replace the password value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n descriptionKey: 'ui.agent.passwordInput.actions.clear',\n description: 'Empty the input. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.passwordInput.actions.focus',\n description: 'Move keyboard focus to the input.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n toggle_visibility: {\n safety: 'read',\n descriptionKey: 'ui.agent.passwordInput.actions.toggleVisibility',\n description: 'Toggle between masked and plain-text display.',\n invoke: (handle) => {\n handle.toggleVisibility();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'password-input',\n description: 'Marks the PasswordInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { AlertTriangle, Check, Circle, Eye, EyeOff } from 'lucide-react';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport { useFormField } from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { passwordInputAgent } from './password-input.agent';\n\n/** Agent-readiness curated handle for PasswordInput. */\nexport interface PasswordInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n isRevealed: () => boolean;\n toggleVisibility: () => void;\n}\n\ntype Strength = 0 | 1 | 2 | 3;\n\ntype SizeKey = NonNullable<TextInputProps['size']>;\n\nconst iconSizeClassBySize: Record<SizeKey, string> = {\n sm: 'ds:size-4',\n md: 'ds:size-[18px]',\n lg: 'ds:size-5',\n};\n\nconst toggleVariants = cva(\n [\n 'ds:absolute ds:inset-y-0 ds:end-0 ds:ps-2 ds:pe-3',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:bg-transparent ds:border-0 ds:cursor-pointer',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:min-w-[var(--min-target-size)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n);\n\nconst strengthTrackVariants = cva(\n 'ds:h-1 ds:w-full ds:overflow-hidden ds:rounded-[var(--radius-full)] ds:bg-muted',\n);\n\nconst strengthBarVariants = cva(\n [\n 'ds:h-full ds:rounded-[var(--radius-full)]',\n 'ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n ].join(' '),\n {\n variants: {\n level: {\n 0: 'ds:w-1/4 ds:bg-destructive',\n 1: 'ds:w-1/2 ds:bg-warning',\n 2: 'ds:w-3/4 ds:bg-success',\n 3: 'ds:w-full ds:bg-success',\n },\n },\n defaultVariants: { level: 0 },\n },\n);\n\nconst strengthLabelByLevel: Record<\n Strength,\n 'weak' | 'fair' | 'good' | 'strong'\n> = {\n 0: 'weak',\n 1: 'fair',\n 2: 'good',\n 3: 'strong',\n};\n\nconst requirementRowVariants = cva(\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta',\n {\n variants: {\n met: {\n true: 'ds:text-success',\n false: 'ds:text-muted-foreground',\n },\n },\n defaultVariants: { met: false },\n },\n);\n\n/**\n * One row in the live requirements checklist. Consumers either build\n * these inline or pull a pre-built set from `usePasswordRequirements`.\n */\nexport interface PasswordRequirement {\n /** Stable id — keyed render + a11y. */\n id: string;\n /** Already-translated label. The consumer owns the wording. */\n label: string;\n /** Predicate against the current value. Pure, runs on every keystroke. */\n test: (value: string) => boolean;\n}\n\nexport interface PasswordInputProps\n extends\n Omit<TextInputProps, 'type' | 'endAdornment' | 'startAdornment'>,\n VariantProps<typeof strengthBarVariants> {\n /** Callback when reveal state changes (for analytics). */\n onRevealChange?: (revealed: boolean) => void;\n /** Show the strength meter below the input. */\n showStrength?: boolean;\n /** Strength score: 0 = weak, 1 = fair, 2 = good, 3 = strong. */\n strength?: Strength;\n /**\n * Live requirements checklist rendered between the input and the\n * strength meter / caps-lock notice. Each row's predicate runs on\n * every keystroke and the row's `data-state` flips between `\"met\"`\n * and `\"unmet\"`. Backed by `aria-live=\"polite\"` so screen readers\n * announce each transition as a visually-hidden suffix span flips\n * between localised \"met\" / \"not yet met\" copy.\n *\n * Tip: hoist or `useMemo` the array — inlining it in JSX makes the\n * predicate-results memo bust every render. The kit's\n * `usePasswordRequirements` helper already does this.\n */\n requirements?: ReadonlyArray<PasswordRequirement>;\n /**\n * When `true` AND `strength` is not provided, derive a 0–3 score\n * from the proportion of `requirements` satisfied. Lets consumers\n * get the strength bar \"for free\" once they declare requirements.\n */\n deriveStrength?: boolean;\n /**\n * Autocomplete hint. Defaults to 'current-password'.\n * Use 'new-password' for registration/change-password forms.\n */\n autoComplete?: 'current-password' | 'new-password' | (string & {});\n}\n\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (\n {\n onRevealChange,\n showStrength = false,\n strength,\n requirements,\n deriveStrength = false,\n autoComplete,\n size = 'md',\n disabled,\n name,\n id,\n onKeyDown,\n onKeyUp,\n onBlur,\n onInput,\n defaultValue,\n value,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const ctx = useFormField();\n const effectiveDisabled = ctx.disabled || disabled;\n\n const innerInputRef = useRef<HTMLInputElement | null>(null);\n const composedRef = composeRefs(ref, innerInputRef);\n\n const [revealed, setRevealed] = useState(false);\n const [capsLock, setCapsLock] = useState(false);\n\n // Track the current value internally so the requirements checklist\n // can re-evaluate predicates without forcing consumers to lift the\n // input into a controlled state. The seed is whichever of\n // `value` / `defaultValue` was passed; the `input` listener then\n // keeps it in sync on every keystroke (covers both controlled and\n // uncontrolled callers — for controlled callers we resync to the\n // incoming `value` prop in the effect below).\n const [internalValue, setInternalValue] = useState<string>(() => {\n if (typeof value === 'string') return value;\n if (typeof defaultValue === 'string') return defaultValue;\n return '';\n });\n\n useEffect(() => {\n if (typeof value === 'string') setInternalValue(value);\n }, [value]);\n\n // Derive the event type from the `onInput` prop itself so the handler\n // typechecks under both React 18 (`FormEvent`) and React 19 (`InputEvent`)\n // type definitions without pinning to either.\n const handleInput = useCallback(\n (event: Parameters<NonNullable<typeof onInput>>[0]) => {\n setInternalValue(event.currentTarget.value);\n onInput?.(event);\n },\n [onInput],\n );\n\n const writeValueToInput = useCallback((next: string) => {\n const node = innerInputRef.current;\n if (!node) return;\n const prototype = Object.getPrototypeOf(node) as HTMLInputElement;\n const setter = Object.getOwnPropertyDescriptor(prototype, 'value')?.set;\n setter?.call(node, next);\n node.dispatchEvent(new Event('input', { bubbles: true }));\n node.dispatchEvent(new Event('change', { bubbles: true }));\n }, []);\n\n const handleToggle = useCallback(() => {\n setRevealed((prev) => {\n const next = !prev;\n onRevealChange?.(next);\n return next;\n });\n }, [onRevealChange]);\n\n const detectCaps = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n if (typeof event.getModifierState === 'function') {\n setCapsLock(event.getModifierState('CapsLock'));\n }\n }, []);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n detectCaps(event);\n onKeyDown?.(event);\n },\n [detectCaps, onKeyDown],\n );\n\n const handleKeyUp = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n detectCaps(event);\n onKeyUp?.(event);\n },\n [detectCaps, onKeyUp],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setCapsLock(false);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const agentHandle = useMemo<PasswordInputHandle>(\n () => ({\n getValue: () => innerInputRef.current?.value ?? '',\n setValue: (next) => writeValueToInput(next),\n clear: () => writeValueToInput(''),\n focus: () => innerInputRef.current?.focus(),\n isRevealed: () => revealed,\n toggleVisibility: () => {\n setRevealed((prev) => {\n const next = !prev;\n onRevealChange?.(next);\n return next;\n });\n },\n }),\n [onRevealChange, revealed, writeValueToInput],\n );\n useAgentRegistration(passwordInputAgent, agentHandle, id);\n\n const iconSizeClass = iconSizeClassBySize[size];\n const toggleLabel = t(\n revealed ? 'inputs.password.toggleHide' : 'inputs.password.toggleShow',\n revealed ? 'Hide password' : 'Show password',\n );\n\n // Evaluate each requirement against the current value. Cheap by\n // construction — predicates are pure regex/length checks supplied\n // by the consumer; the kit doesn't memoise per-row because the\n // map is O(n) over a handful of rules and React would re-render\n // the row anyway when its `data-state` flips.\n const requirementResults = useMemo(\n () =>\n requirements?.map((req) => ({\n ...req,\n met: req.test(internalValue),\n })) ?? null,\n [requirements, internalValue],\n );\n\n // Derive a 0–3 score from the satisfied proportion when the\n // consumer hasn't supplied an explicit `strength`. Formula:\n // `floor((satisfied / total) * 4)`, clamped to 3 so a fully-met\n // checklist matches the explicit \"strong\" level. With zero\n // requirements we fall back to 0 — meaningless on its own but\n // never displayed since `showStrength` is what controls the bar.\n const derivedStrength: Strength = useMemo(() => {\n if (!deriveStrength || !requirementResults?.length) return 0;\n const satisfied = requirementResults.filter((r) => r.met).length;\n const total = requirementResults.length;\n return Math.min(3, Math.floor((satisfied / total) * 4)) as Strength;\n }, [deriveStrength, requirementResults]);\n\n const effectiveStrength: Strength =\n strength !== undefined ? strength : deriveStrength ? derivedStrength : 0;\n const strengthKey = strengthLabelByLevel[effectiveStrength];\n const strengthText = t(\n `inputs.password.strength.${strengthKey}`,\n strengthKey.charAt(0).toUpperCase() + strengthKey.slice(1),\n );\n\n return (\n <div\n data-component=\"password-input\"\n data-component-id={id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <div className=\"ds:relative\">\n <TextInput\n ref={composedRef}\n id={id}\n type={revealed ? 'text' : 'password'}\n autoComplete={autoComplete ?? 'current-password'}\n name={name ?? 'password'}\n spellCheck={false}\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n size={size}\n disabled={effectiveDisabled}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onBlur={handleBlur}\n onInput={handleInput}\n value={value}\n defaultValue={defaultValue}\n endAdornment={\n <span aria-hidden=\"true\" className=\"ds:block ds:size-4\" />\n }\n className={className}\n {...rest}\n />\n <button\n type=\"button\"\n aria-pressed={revealed}\n aria-label={toggleLabel}\n disabled={effectiveDisabled}\n onClick={handleToggle}\n className={toggleVariants()}\n >\n {revealed ? (\n <EyeOff aria-hidden=\"true\" className={iconSizeClass} />\n ) : (\n <Eye aria-hidden=\"true\" className={iconSizeClass} />\n )}\n </button>\n </div>\n\n {requirementResults && requirementResults.length > 0 ? (\n // `role=\"list\"` / `role=\"listitem\"` are set explicitly even\n // though they're the implicit roles on <ul>/<li> — Safari\n // VoiceOver strips the implicit list role when CSS sets\n // `list-style: none` (which `ds:list-none` does), so the\n // redundancy is load-bearing for AT, not a lint nit.\n //\n // aria-live=\"polite\" announces transitions as the per-row\n // `.ds:sr-only` state suffix flips between \"met\" / \"not yet\n // met\". aria-live observes text-content mutations, not\n // attribute or class changes, so the data-state attribute\n // alone wouldn't trigger an announcement — the sr-only span\n // is the load-bearing piece for AT users.\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <ul\n role=\"list\"\n aria-live=\"polite\"\n data-component=\"password-requirements\"\n className=\"ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\"\n >\n {requirementResults.map((req) => (\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <li\n key={req.id}\n role=\"listitem\"\n data-state={req.met ? 'met' : 'unmet'}\n className={requirementRowVariants({ met: req.met })}\n >\n {req.met ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-3.5 ds:text-success ds:shrink-0\"\n />\n ) : (\n <Circle\n aria-hidden=\"true\"\n className=\"ds:size-3.5 ds:shrink-0\"\n />\n )}\n <span>{req.label}</span>\n <span className=\"ds:sr-only\">\n {' — '}\n {req.met\n ? t('inputs.password.requirements.met', 'met')\n : t('inputs.password.requirements.unmet', 'not yet met')}\n </span>\n </li>\n ))}\n </ul>\n ) : null}\n\n {capsLock ? (\n <span\n role=\"status\"\n aria-live=\"polite\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta ds:text-warning\"\n >\n <AlertTriangle aria-hidden=\"true\" className=\"ds:size-3.5\" />\n {t('inputs.password.capsLock', 'Caps Lock is on')}\n </span>\n ) : null}\n\n {showStrength ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div\n role=\"progressbar\"\n aria-valuenow={effectiveStrength}\n aria-valuemin={0}\n aria-valuemax={3}\n aria-label={t(\n 'inputs.password.strengthLabel',\n 'Password strength',\n )}\n aria-valuetext={strengthText}\n className={strengthTrackVariants()}\n >\n <div\n className={strengthBarVariants({ level: effectiveStrength })}\n />\n </div>\n <span\n aria-hidden=\"true\"\n className=\"type-meta ds:text-muted-foreground\"\n >\n {strengthText}\n </span>\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nPasswordInput.displayName = 'PasswordInput';\n","import { useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { PasswordRequirement } from './password-input';\n\nexport interface UsePasswordRequirementsOptions {\n /**\n * Minimum password length. When set, adds a \"length\" requirement.\n * Pass `12` (or whatever the server-side regex enforces) so the\n * inline checklist tells users the same rule they'll bounce off\n * server-side. When omitted, no length row is rendered.\n */\n minLength?: number;\n /** Adds an \"uppercase letter\" requirement when true. */\n uppercase?: boolean;\n /** Adds a \"lowercase letter\" requirement when true. */\n lowercase?: boolean;\n /** Adds a \"digit\" requirement when true. */\n digit?: boolean;\n /** Adds a \"symbol\" requirement when true. Matches anything outside `[A-Za-z0-9\\s]`. */\n symbol?: boolean;\n /**\n * Adds a \"no spaces\" requirement when true. Fails if the value\n * contains any whitespace character (space, tab, non-breaking space,\n * narrow no-break space, etc.). Useful to catch paste-time stray\n * whitespace from credential managers.\n */\n noSpaces?: boolean;\n}\n\n/**\n * Builds the common set of password requirements with i18n-resolved\n * labels. Designed for the AlfaDocs platform's patient-registration\n * server-side regex (`/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{12,}$/`) but\n * generic enough for any consumer.\n *\n * Each opt-in flag adds one row to the returned array, in a stable\n * visual order (length → uppercase → lowercase → digit → symbol → noSpaces).\n * Predicates are pure and run on every keystroke.\n *\n * @example\n * const requirements = usePasswordRequirements({\n * minLength: 12,\n * uppercase: true,\n * lowercase: true,\n * digit: true,\n * noSpaces: true,\n * });\n * <PasswordInput requirements={requirements} deriveStrength />\n */\nexport function usePasswordRequirements(\n opts: UsePasswordRequirementsOptions = {},\n): PasswordRequirement[] {\n const { t } = useTranslation();\n const { minLength, uppercase, lowercase, digit, symbol, noSpaces } = opts;\n\n return useMemo(() => {\n const list: PasswordRequirement[] = [];\n\n if (typeof minLength === 'number' && minLength > 0) {\n list.push({\n id: 'length',\n label: t('inputs.password.requirements.length', {\n count: minLength,\n defaultValue: `At least ${minLength} characters`,\n }),\n test: (v) => v.length >= minLength,\n });\n }\n\n if (uppercase) {\n list.push({\n id: 'uppercase',\n label: t(\n 'inputs.password.requirements.uppercase',\n 'One uppercase letter',\n ),\n test: (v) => /\\p{Lu}/u.test(v),\n });\n }\n\n if (lowercase) {\n list.push({\n id: 'lowercase',\n label: t(\n 'inputs.password.requirements.lowercase',\n 'One lowercase letter',\n ),\n test: (v) => /\\p{Ll}/u.test(v),\n });\n }\n\n if (digit) {\n list.push({\n id: 'digit',\n label: t('inputs.password.requirements.digit', 'One number'),\n test: (v) => /\\p{Nd}/u.test(v),\n });\n }\n\n if (symbol) {\n list.push({\n id: 'symbol',\n label: t('inputs.password.requirements.symbol', 'One symbol'),\n // Anything that isn't a letter, number, or whitespace counts.\n // `\\p{L}` + `\\p{N}` keep this Unicode-aware so non-Latin\n // alphabets (Arabic, Chinese, …) aren't mis-classified as\n // symbols.\n test: (v) => /[^\\p{L}\\p{N}\\s]/u.test(v),\n });\n }\n\n if (noSpaces) {\n list.push({\n id: 'no-spaces',\n label: t('inputs.password.requirements.noSpaces', 'No spaces'),\n // `\\s` covers ASCII space + tab + newline. The explicit\n // U+00A0 (non-breaking space) and U+202F (narrow no-break\n // space) catch the two paste-time characters credential\n // managers and rich-text editors most often inject without\n // the user noticing — those are NOT always in `\\s`.\n // Authored via hex escapes (not literal characters) so the\n // source file passes `no-irregular-whitespace`.\n test: (v) => !/[\\s\\u00A0\\u202F]/.test(v),\n });\n }\n\n return list;\n }, [t, minLength, uppercase, lowercase, digit, symbol, noSpaces]);\n}\n"],"names":["passwordInputAgent","handle","args","iconSizeClassBySize","toggleVariants","cva","strengthTrackVariants","strengthBarVariants","strengthLabelByLevel","requirementRowVariants","PasswordInput","forwardRef","onRevealChange","showStrength","strength","requirements","deriveStrength","autoComplete","size","disabled","name","id","onKeyDown","onKeyUp","onBlur","onInput","defaultValue","value","className","rest","ref","t","useTranslation","effectiveDisabled","useFormField","innerInputRef","useRef","composedRef","composeRefs","revealed","setRevealed","useState","capsLock","setCapsLock","internalValue","setInternalValue","useEffect","handleInput","useCallback","event","writeValueToInput","next","node","prototype","setter","_a","handleToggle","prev","detectCaps","handleKeyDown","handleKeyUp","handleBlur","agentHandle","useMemo","useAgentRegistration","iconSizeClass","toggleLabel","requirementResults","req","derivedStrength","satisfied","r","total","effectiveStrength","strengthKey","strengthText","jsxs","jsx","TextInput","EyeOff","Eye","Check","Circle","AlertTriangle","usePasswordRequirements","opts","minLength","uppercase","lowercase","digit","symbol","noSpaces","list","v"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,KAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa;AAAA,EAC5B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,eAAe;AAAA,IAAA;AAAA,IAE1C,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,WAAA;AAAA,IAAW;AAAA,EACtC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,MAAA;AA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L;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,MAAM,CAAC8D,MAAM,WAAA,WAAA,GAAA,EAAU,KAAKA,CAAC;AAAA,IAAA,CAC9B,GAGCJ,KACFG,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,sCAAsC,YAAY;AAAA,MAC3D,MAAM,CAAC8D,MAAM,WAAA,WAAA,GAAA,EAAU,KAAKA,CAAC;AAAA,IAAA,CAC9B,GAGCH,KACFE,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,uCAAuC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,MAK5D,MAAM,CAAC8D,MAAM,mBAAmB,KAAKA,CAAC;AAAA,IAAA,CACvC,GAGCF,KACFC,EAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,OAAO7D,EAAE,yCAAyC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQ7D,MAAM,CAAC8D,MAAM,CAAC,mBAAmB,KAAKA,CAAC;AAAA,IAAA,CACxC,GAGID;AAAA,EACT,GAAG,CAAC7D,GAAGuD,GAAWC,GAAWC,GAAWC,GAAOC,GAAQC,CAAQ,CAAC;AAClE;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.35.0",
3
+ "packageVersion": "0.36.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -134,4 +134,5 @@ export * from './whatsapp-button';
134
134
  export * from './workflow';
135
135
  export * from '../patterns/alia-assistant';
136
136
  export * from '../patterns/patient-shell';
137
+ export * from '../patterns/marketplace-app-shell';
137
138
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,YAAY,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AAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAO3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/password-input.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/D,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AA8B9B,QAAA,MAAM,mBAAmB;;8EAgBxB,CAAC;AAyBF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,kBACf,SACE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc,GAAG,gBAAgB,CAAC,EAChE,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAC1C,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,+CAA+C;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,kBAAkB,GAAG,cAAc,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,aAAa,iHAgTzB,CAAC"}
1
+ {"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/password-input.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/D,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AA8B9B,QAAA,MAAM,mBAAmB;;8EAgBxB,CAAC;AAyBF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,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AA2B,GACpD,CAAC"}
1
+ {"version":3,"file":"payment-form.d.ts","sourceRoot":"","sources":["../../../src/components/payment-form/payment-form.tsx"],"names":[],"mappings":"AA+CA,OAAO,EAEL,KAAK,MAAM,EAGZ,MAAM,mBAAmB,CAAC;AAoB3B,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,QAAQ,EAAE,eAAe,CAAC;IAC1B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gFAAgF;IAChF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,mEAAmE;IACnE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AA+BD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM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AAK,IAAI,CAAC;IACtC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IACtD,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,UAAU,CAAC;CAC5B;AAMD,QAAA,MAAM,YAAY,oFAOjB,CAAC;AAoMF,eAAO,MAAM,WAAW,gHA2bvB,CAAC;AAQF,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC/E,YAAY,EACV,SAAS,EACT,KAAK,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"tooth-scheme.d.ts","sourceRoot":"","sources":["../../../src/components/tooth-scheme/tooth-scheme.tsx"],"names":[],"mappings":"AAiDA,OAAO,EAKL,eAAe,EACf,aAAa,EAKb,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mEAAmE;IACnE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2GAA2G;IAC3G,IAAI,CAAC,EAAE,SAAS,CAAC;IACj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