@alfadocs/ui-kit 0.63.0 → 0.64.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.
Files changed (90) hide show
  1. package/dist/_chunks/{ai-prompt-input-C6sCr1Vi.js → ai-prompt-input-Dx8eXoPm.js} +2 -2
  2. package/dist/_chunks/{audio-recorder-D6OVfNiZ.js → audio-recorder-CdXuT9ln.js} +2 -2
  3. package/dist/_chunks/{bishop-score-B9tvgoIq.js → bishop-score-CzjSx-dm.js} +2 -2
  4. package/dist/_chunks/{booking-BUV9fspj.js → booking-ChfvWy3P.js} +2 -2
  5. package/dist/_chunks/{care-plan-card-QmNpGggC.js → care-plan-card-DhZNoXs4.js} +2 -2
  6. package/dist/_chunks/{care-plan-entry-card-Cnra7vUc.js → care-plan-entry-card-DW70yBOD.js} +2 -2
  7. package/dist/_chunks/{editable-currency-cell-renderer-D5C5tCfu.js → editable-currency-cell-renderer-BQgaKFCz.js} +2 -2
  8. package/dist/_chunks/{gestational-age-calculator-AkNFfZYs.js → gestational-age-calculator-D85E8lGN.js} +2 -2
  9. package/dist/_chunks/{pregnancy-dating-Dg6dTe1p.js → pregnancy-dating-7NUaAfob.js} +2 -2
  10. package/dist/_chunks/{select-hsCaJSX3.js → select-CEtRcon5.js} +46 -45
  11. package/dist/_chunks/{tabs-BpPYVme_.js → tabs-BIQ0ew1T.js} +2 -2
  12. package/dist/_chunks/tooth-scheme-CiphQaON.js +1257 -0
  13. package/dist/_chunks/{unit-converter-3sINXO3m.js → unit-converter-BIbXHIQA.js} +2 -2
  14. package/dist/agent-catalog.json +41 -4
  15. package/dist/components/ai-prompt-input/index.js +1 -1
  16. package/dist/components/audio-recorder/index.js +1 -1
  17. package/dist/components/bishop-score/index.js +1 -1
  18. package/dist/components/booking/index.js +1 -1
  19. package/dist/components/care-plan-card/index.js +1 -1
  20. package/dist/components/care-plan-entry-card/index.js +1 -1
  21. package/dist/components/data-table/index.js +1 -1
  22. package/dist/components/gestational-age-calculator/index.js +1 -1
  23. package/dist/components/pregnancy-dating/index.js +1 -1
  24. package/dist/components/select/index.js +1 -1
  25. package/dist/components/select/select.d.ts +8 -0
  26. package/dist/components/tabs/index.js +1 -1
  27. package/dist/components/tooth-scheme/index.d.ts +2 -2
  28. package/dist/components/tooth-scheme/index.js +22 -15
  29. package/dist/components/tooth-scheme/tooth-data.d.ts +79 -18
  30. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -0
  31. package/dist/components/tooth-scheme/tooth-scheme.d.ts +48 -1
  32. package/dist/components/unit-converter/index.js +1 -1
  33. package/dist/i18n/locales/ar.d.ts +17 -0
  34. package/dist/i18n/locales/ar.js +18 -1
  35. package/dist/i18n/locales/de.d.ts +17 -0
  36. package/dist/i18n/locales/de.js +18 -1
  37. package/dist/i18n/locales/el.d.ts +17 -0
  38. package/dist/i18n/locales/el.js +18 -1
  39. package/dist/i18n/locales/en.d.ts +17 -0
  40. package/dist/i18n/locales/en.js +18 -1
  41. package/dist/i18n/locales/es.d.ts +17 -0
  42. package/dist/i18n/locales/es.js +18 -1
  43. package/dist/i18n/locales/fr.d.ts +17 -0
  44. package/dist/i18n/locales/fr.js +18 -1
  45. package/dist/i18n/locales/hi.d.ts +17 -0
  46. package/dist/i18n/locales/hi.js +18 -1
  47. package/dist/i18n/locales/it.d.ts +17 -0
  48. package/dist/i18n/locales/it.js +18 -1
  49. package/dist/i18n/locales/ja.d.ts +17 -0
  50. package/dist/i18n/locales/ja.js +18 -1
  51. package/dist/i18n/locales/nl.d.ts +17 -0
  52. package/dist/i18n/locales/nl.js +18 -1
  53. package/dist/i18n/locales/pl.d.ts +17 -0
  54. package/dist/i18n/locales/pl.js +18 -1
  55. package/dist/i18n/locales/pt.d.ts +17 -0
  56. package/dist/i18n/locales/pt.js +18 -1
  57. package/dist/i18n/locales/ro.d.ts +17 -0
  58. package/dist/i18n/locales/ro.js +18 -1
  59. package/dist/i18n/locales/ru.d.ts +17 -0
  60. package/dist/i18n/locales/ru.js +18 -1
  61. package/dist/i18n/locales/sq.d.ts +17 -0
  62. package/dist/i18n/locales/sq.js +18 -1
  63. package/dist/i18n/locales/sv.d.ts +17 -0
  64. package/dist/i18n/locales/sv.js +18 -1
  65. package/dist/i18n/locales/tr.d.ts +17 -0
  66. package/dist/i18n/locales/tr.js +18 -1
  67. package/dist/i18n/locales/zh.d.ts +17 -0
  68. package/dist/i18n/locales/zh.js +18 -1
  69. package/dist/index.js +180 -173
  70. package/dist/locales/ar.json +18 -1
  71. package/dist/locales/de.json +18 -1
  72. package/dist/locales/el.json +18 -1
  73. package/dist/locales/en.json +18 -1
  74. package/dist/locales/es.json +18 -1
  75. package/dist/locales/fr.json +18 -1
  76. package/dist/locales/hi.json +18 -1
  77. package/dist/locales/it.json +18 -1
  78. package/dist/locales/ja.json +18 -1
  79. package/dist/locales/nl.json +18 -1
  80. package/dist/locales/pl.json +18 -1
  81. package/dist/locales/pt.json +18 -1
  82. package/dist/locales/ro.json +18 -1
  83. package/dist/locales/ru.json +18 -1
  84. package/dist/locales/sq.json +18 -1
  85. package/dist/locales/sv.json +18 -1
  86. package/dist/locales/tr.json +18 -1
  87. package/dist/locales/zh.json +18 -1
  88. package/dist/tokens.css +1 -1
  89. package/package.json +1 -1
  90. package/dist/_chunks/tooth-scheme-CxlsLjfN.js +0 -753
@@ -4,7 +4,7 @@ import { c as Y } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as j } from "react-i18next";
5
5
  import { F as v } from "./form-field-BOm9hK35.js";
6
6
  import { N as B } from "./number-input-Dj5L3pXK.js";
7
- import { S as C } from "./select-hsCaJSX3.js";
7
+ import { S as C } from "./select-CEtRcon5.js";
8
8
  import { I as L } from "./insert-result-C1SYdueh.js";
9
9
  const _ = {
10
10
  // weight → base kg
@@ -193,4 +193,4 @@ export {
193
193
  P as b,
194
194
  K as c
195
195
  };
196
- //# sourceMappingURL=unit-converter-3sINXO3m.js.map
196
+ //# sourceMappingURL=unit-converter-BIbXHIQA.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.63.0",
3
+ "packageVersion": "0.64.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -4836,13 +4836,20 @@
4836
4836
  "kind": "component",
4837
4837
  "id": "tooth-scheme",
4838
4838
  "capabilities": [
4839
- "pick"
4839
+ "pick",
4840
+ "edit_inline",
4841
+ "view_change"
4840
4842
  ],
4841
4843
  "state": [
4842
4844
  {
4843
4845
  "name": "chart",
4844
4846
  "type": "object",
4845
- "description": "Current dental chart state tooth conditions keyed by FDI id."
4847
+ "description": "Current dental chart — findings (and marked surfaces) keyed by FDI id."
4848
+ },
4849
+ {
4850
+ "name": "chartedTeeth",
4851
+ "type": "string[]",
4852
+ "description": "FDI ids of every tooth carrying at least one finding."
4846
4853
  }
4847
4854
  ],
4848
4855
  "actions": [
@@ -4851,6 +4858,36 @@
4851
4858
  "safety": "read",
4852
4859
  "argsType": "{ id: FdiId }",
4853
4860
  "description": "Move focus to a specific tooth by FDI id."
4861
+ },
4862
+ {
4863
+ "name": "get_tooth",
4864
+ "safety": "read",
4865
+ "argsType": "{ id: FdiId }",
4866
+ "description": "Read the findings recorded on one tooth (FDI id)."
4867
+ },
4868
+ {
4869
+ "name": "teeth_with",
4870
+ "safety": "read",
4871
+ "argsType": "{ condition: ToothCondition }",
4872
+ "description": "List the FDI ids of every tooth carrying a given finding (e.g. all teeth with caries)."
4873
+ },
4874
+ {
4875
+ "name": "set_finding",
4876
+ "safety": "write",
4877
+ "argsType": "{ id: FdiId; condition: ToothCondition; surfaces?: Surface[] }",
4878
+ "description": "Record a finding on a tooth (crown, implant, root canal, caries, …). Optionally mark the affected surfaces for a surface finding."
4879
+ },
4880
+ {
4881
+ "name": "remove_finding",
4882
+ "safety": "write",
4883
+ "argsType": "{ id: FdiId; condition: ToothCondition }",
4884
+ "description": "Remove a single finding from a tooth."
4885
+ },
4886
+ {
4887
+ "name": "clear_tooth",
4888
+ "safety": "destructive",
4889
+ "argsType": "{ id: FdiId }",
4890
+ "description": "Clear every finding from a tooth."
4854
4891
  }
4855
4892
  ],
4856
4893
  "domHooks": {
@@ -4865,7 +4902,7 @@
4865
4902
  },
4866
4903
  "item": {
4867
4904
  "attr": "data-fdi",
4868
- "description": "Each rendered tooth `<g>` carries its FDI id as `data-fdi`. Tests still use `data-testid=\"tooth-<fdi>\"` separately."
4905
+ "description": "Each rendered tooth `<g>` carries its FDI id as `data-fdi`. The `data-projection` attribute on the root exposes the side/plan view."
4869
4906
  }
4870
4907
  }
4871
4908
  },
@@ -1,4 +1,4 @@
1
- import { A as a, a as o } from "../../_chunks/ai-prompt-input-C6sCr1Vi.js";
1
+ import { A as a, a as o } from "../../_chunks/ai-prompt-input-Dx8eXoPm.js";
2
2
  export {
3
3
  a as AIPromptInput,
4
4
  o as aiPromptInputAgent
@@ -1,4 +1,4 @@
1
- import { A as r, a } from "../../_chunks/audio-recorder-D6OVfNiZ.js";
1
+ import { A as r, a } from "../../_chunks/audio-recorder-CdXuT9ln.js";
2
2
  export {
3
3
  r as AudioRecorder,
4
4
  a as audioRecorderAgent
@@ -1,4 +1,4 @@
1
- import { B as O, a as S, b as o, c as B, d as P, e } from "../../_chunks/bishop-score-B9tvgoIq.js";
1
+ import { B as O, a as S, b as o, c as B, d as P, e } from "../../_chunks/bishop-score-CzjSx-dm.js";
2
2
  export {
3
3
  O as BISHOP_COMPONENTS,
4
4
  S as BISHOP_MAX_SCORE,
@@ -1,4 +1,4 @@
1
- import { B as A, C as R, O as a, b as s } from "../../_chunks/booking-BUV9fspj.js";
1
+ import { B as A, C as R, O as a, b as s } from "../../_chunks/booking-ChfvWy3P.js";
2
2
  export {
3
3
  A as Booking,
4
4
  R as CONFIRMATION_CHANNEL_ORDER,
@@ -1,4 +1,4 @@
1
- import { C as e, c as C } from "../../_chunks/care-plan-card-QmNpGggC.js";
1
+ import { C as e, c as C } from "../../_chunks/care-plan-card-DhZNoXs4.js";
2
2
  export {
3
3
  e as CarePlanCard,
4
4
  C as carePlanCardAgent
@@ -1,4 +1,4 @@
1
- import { C as n, c as e } from "../../_chunks/care-plan-entry-card-Cnra7vUc.js";
1
+ import { C as n, c as e } from "../../_chunks/care-plan-entry-card-DW70yBOD.js";
2
2
  export {
3
3
  n as CarePlanEntryCard,
4
4
  e as carePlanEntryCardAgent
@@ -1,4 +1,4 @@
1
- import { A as l, B as r, C as t, a as s, D as n, b as d, c as i, d as o, E as C, e as R, I as F, L as g, N as T, f as b, S as u, g as c, h as D, T as m, i as p, j as x, k as f, l as y, m as E, n as S, o as h, U as A, p as L, q as N, u as k } from "../../_chunks/editable-currency-cell-renderer-D5C5tCfu.js";
1
+ import { A as l, B as r, C as t, a as s, D as n, b as d, c as i, d as o, E as C, e as R, I as F, L as g, N as T, f as b, S as u, g as c, h as D, T as m, i as p, j as x, k as f, l as y, m as E, n as S, o as h, U as A, p as L, q as N, u as k } from "../../_chunks/editable-currency-cell-renderer-BQgaKFCz.js";
2
2
  export {
3
3
  l as ActionsCellRenderer,
4
4
  r as BalanceCellRenderer,
@@ -1,4 +1,4 @@
1
- import { G as t } from "../../_chunks/gestational-age-calculator-AkNFfZYs.js";
1
+ import { G as t } from "../../_chunks/gestational-age-calculator-D85E8lGN.js";
2
2
  export {
3
3
  t as GestationalAgeCalculator
4
4
  };
@@ -1,4 +1,4 @@
1
- import { P as r } from "../../_chunks/pregnancy-dating-Dg6dTe1p.js";
1
+ import { P as r } from "../../_chunks/pregnancy-dating-7NUaAfob.js";
2
2
  export {
3
3
  r as PregnancyDating
4
4
  };
@@ -1,4 +1,4 @@
1
- import { S as a, a as l, b as S, c, d as s, e as o, f as r, g as p, h as g, i, j as m } from "../../_chunks/select-hsCaJSX3.js";
1
+ import { S as a, a as l, b as S, c, d as s, e as o, f as r, g as p, h as g, i, j as m } from "../../_chunks/select-CEtRcon5.js";
2
2
  export {
3
3
  a as Select,
4
4
  l as SelectContent,
@@ -62,6 +62,14 @@ export interface SelectProps<T extends string = string> {
62
62
  tone?: 'default' | 'error';
63
63
  'aria-label'?: string;
64
64
  className?: string;
65
+ /**
66
+ * Portal target for the listbox. Defaults to `document.body`. Set this to a
67
+ * parent overlay's content element (e.g. a Popover) when the Select is nested
68
+ * inside one, so the listbox shares that stacking context and renders above
69
+ * it instead of behind it (the global z-scale puts `--z-dropdown` below
70
+ * `--z-popover`).
71
+ */
72
+ container?: HTMLElement | null;
65
73
  }
66
74
  interface SelectComponent {
67
75
  <T extends string = string>(props: SelectProps<T> & {
@@ -1,4 +1,4 @@
1
- import { T as t, a as b, b as T, c as e, t as r } from "../../_chunks/tabs-BpPYVme_.js";
1
+ import { T as t, a as b, b as T, c as e, t as r } from "../../_chunks/tabs-BIQ0ew1T.js";
2
2
  export {
3
3
  t as Tabs,
4
4
  b as TabsContent,
@@ -1,5 +1,5 @@
1
1
  export * from './tooth-scheme';
2
- export { FDI_TO_META, FDI_TO_UNIVERSAL, FDI_TO_PALMER, CONDITION_COLORS, CONDITION_TOKENS, CONDITION_PATTERNS, TOOTH_SHAPES, chartFromConditions, emptyChart, labelFor, layoutTeeth, } from './tooth-data';
3
- export type { Anatomy, Arch, Quadrant, Side, Surface, ToothMeta, ToothShape, PositionedTooth, } from './tooth-data';
2
+ export { FDI_TO_META, FDI_TO_UNIVERSAL, FDI_TO_PALMER, CONDITION_COLORS, CONDITION_TOKENS, CONDITION_SIDE_SYMBOL, CONDITION_PLAN_FOLDER, SURFACE_ASSET_NAME, toothImageUrl, conditionSymbolUrl, surfaceSymbolUrl, zonesForTooth, zoneSurface, zonePath, chartFromConditions, emptyChart, labelFor, layoutTeeth, } from './tooth-data';
3
+ export type { Anatomy, Arch, Quadrant, Side, Surface, SurfaceZone, Projection, SideSymbolSpec, ToothMeta, PositionedTooth, } from './tooth-data';
4
4
  export { toothSchemeAgent } from './tooth-scheme.agent';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,20 +1,27 @@
1
- import { C as s, a as t, b as O, F as e, c as o, d as E, P as _, e as I, T as N, f as h, g as S, h as r, l as A, i as C, t as R, r as m } from "../../_chunks/tooth-scheme-CxlsLjfN.js";
1
+ import { C as o, a as t, b as e, c as T, F as O, d as _, e as E, P as I, f as S, S as r, T as N, g as h, h as m, i as n, l as A, j as l, s as C, t as D, k as F, r as c, z as R, m as i, n as L } from "../../_chunks/tooth-scheme-CiphQaON.js";
2
2
  export {
3
- s as CONDITION_COLORS,
4
- t as CONDITION_PATTERNS,
5
- O as CONDITION_TOKENS,
6
- e as FDI_TO_META,
7
- o as FDI_TO_PALMER,
3
+ o as CONDITION_COLORS,
4
+ t as CONDITION_PLAN_FOLDER,
5
+ e as CONDITION_SIDE_SYMBOL,
6
+ T as CONDITION_TOKENS,
7
+ O as FDI_TO_META,
8
+ _ as FDI_TO_PALMER,
8
9
  E as FDI_TO_UNIVERSAL,
9
- _ as PERMANENT_TEETH,
10
- I as PRIMARY_TEETH,
11
- N as TOOTH_SHAPES,
12
- h as ToothScheme,
13
- S as chartFromConditions,
14
- r as emptyChart,
10
+ I as PERMANENT_TEETH,
11
+ S as PRIMARY_TEETH,
12
+ r as SURFACE_ASSET_NAME,
13
+ N as ToothScheme,
14
+ h as chartFromConditions,
15
+ m as conditionSymbolUrl,
16
+ n as emptyChart,
15
17
  A as labelFor,
16
- C as layoutTeeth,
17
- R as toothSchemeAgent,
18
- m as toothSchemeVariants
18
+ l as layoutTeeth,
19
+ C as surfaceSymbolUrl,
20
+ D as toothImageUrl,
21
+ F as toothSchemeAgent,
22
+ c as toothSchemeVariants,
23
+ R as zonePath,
24
+ i as zoneSurface,
25
+ L as zonesForTooth
19
26
  };
20
27
  //# sourceMappingURL=index.js.map
@@ -3,7 +3,7 @@ export type Dentition = 'permanent' | 'primary' | 'mixed';
3
3
  export type Numbering = 'fdi' | 'universal' | 'palmer';
4
4
  export type ToothMode = 'interactive' | 'display';
5
5
  export type Surface = 'mesial' | 'distal' | 'occlusal' | 'buccal' | 'lingual';
6
- export type ToothCondition = 'caries' | 'filled' | 'crowned' | 'missing' | 'implant' | 'rootCanal';
6
+ export type ToothCondition = 'caries' | 'filled' | 'crowned' | 'temporaryCrown' | 'bridge' | 'missing' | 'implant' | 'implantExtraction' | 'stub' | 'destroyed' | 'rootCanal';
7
7
  export interface ToothState {
8
8
  conditions: ToothCondition[];
9
9
  surfaces: Surface[];
@@ -43,33 +43,94 @@ export declare const PRIMARY_TEETH: FdiId[];
43
43
  export declare const FDI_TO_META: Record<FdiId, ToothMeta>;
44
44
  export declare const FDI_TO_UNIVERSAL: Record<FdiId, string>;
45
45
  export declare const FDI_TO_PALMER: Record<FdiId, string>;
46
+ /**
47
+ * FDI used to resolve a tooth's RENDER. There are no separate deciduous
48
+ * renders — primary teeth reuse the permanent image of the same position
49
+ * (quadrant 5→1, 6→2, 7→3, 8→4; position digit unchanged), scaled down by
50
+ * the renderer. Permanent teeth resolve to themselves.
51
+ */
52
+ export declare function assetFdi(meta: ToothMeta): FdiId;
53
+ /** Render scale applied to a tooth image (primary teeth are smaller). */
54
+ export declare const PRIMARY_TOOTH_SCALE = 0.72;
46
55
  /** CSS variable name (without the leading `var(...)`) that drives a condition's colour. */
47
56
  export declare const CONDITION_TOKENS: Record<ToothCondition, string>;
48
57
  /**
49
58
  * Convenience: the `fill="var(--destructive)"` string ready to paste onto
50
- * an SVG attribute. Kept in sync with `CONDITION_TOKENS`.
59
+ * an SVG attribute. Kept in sync with `CONDITION_TOKENS`. Used for the legend
60
+ * swatch + the surface-condition ring; whole-tooth conditions render a
61
+ * distinct symbol image (the glyph is the colour-independent channel).
51
62
  */
52
63
  export declare const CONDITION_COLORS: Record<ToothCondition, string>;
53
- /** SVG `<pattern>` ids declared in `<defs>`. `missing` renders an X glyph instead of a pattern. */
54
- export declare const CONDITION_PATTERNS: Record<ToothCondition, string>;
55
- export interface ToothShape {
56
- /** Visual width inside the enclosing `<g>`. */
57
- width: number;
58
- /** Visual height inside the enclosing `<g>`. */
59
- height: number;
60
- /** SVG `d` attribute for the crown outline. */
61
- path: string;
62
- /** Optional inner decorative path (occlusal surface on molars, etc.). */
63
- innerPath?: string;
64
+ export interface SideSymbolSpec {
65
+ /** Asset folder under `side/`. */
66
+ folder: string;
67
+ /** How the file resolves inside `{folder}/{view}/`. */
68
+ resolve: 'per-fdi' | 'general' | 'rct';
64
69
  }
65
- export declare const TOOTH_SHAPES: Record<Anatomy, ToothShape>;
66
- export declare const TOOTH_GAP = 4;
67
- export declare const TOOTH_ROW_GAP = 24;
70
+ export declare const CONDITION_SIDE_SYMBOL: Partial<Record<ToothCondition, SideSymbolSpec>>;
71
+ /** Resolve the side-view symbol overlay URL for a condition on a tooth. */
72
+ export declare function conditionSymbolUrl(meta: ToothMeta, assetBaseUrl: string, spec: SideSymbolSpec): string;
73
+ export type Projection = 'side' | 'plan';
74
+ /** The user-selectable view: a single projection, or both stacked together. */
75
+ export type ViewMode = Projection | 'both';
76
+ /** Map the clinical `Surface` enum to the asset surface filename token. */
77
+ export declare const SURFACE_ASSET_NAME: Record<Surface, string>;
78
+ /** Conditions that render as per-surface fills in the plan view. */
79
+ export declare const CONDITION_PLAN_FOLDER: Partial<Record<ToothCondition, string>>;
80
+ /** Resolve a per-surface plan-view overlay URL (e.g. caries on the distal). */
81
+ export declare function surfaceSymbolUrl(meta: ToothMeta, assetBaseUrl: string, folder: string, surface: Surface): string;
82
+ /**
83
+ * Clickable surface regions of a plan-view tooth, named by SCREEN position.
84
+ * `zoneSurface()` resolves each to the anatomical `Surface` per quadrant.
85
+ */
86
+ export type SurfaceZone = 'top' | 'bottom' | 'left' | 'right' | 'center';
87
+ /**
88
+ * Which zones a tooth exposes. Molars & premolars have a central occlusal
89
+ * table (5 zones); incisors & canines have no occlusal surface to mark, so
90
+ * their crown splits into 4 directional zones.
91
+ */
92
+ export declare function zonesForTooth(meta: ToothMeta): SurfaceZone[];
93
+ /**
94
+ * Map a screen zone to the anatomical surface, QUADRANT-AWARE. Two flips make
95
+ * this non-trivial (ported from the platform odontogram's `_getAreaBySide`, so
96
+ * a finding always lands on the correct surface wherever the tooth sits):
97
+ *
98
+ * - mesial / distal (left & right zones) flip between the patient's right
99
+ * quadrants {1,4} and left quadrants {2,3} — "toward the midline" reverses.
100
+ * - buccal(vestibular) / lingual(oral) (top & bottom zones) flip between the
101
+ * upper and lower arch.
102
+ * - centre is always occlusal.
103
+ *
104
+ * Primary quadrants (5-8) normalise to their permanent counterpart (1-4).
105
+ */
106
+ export declare function zoneSurface(meta: ToothMeta, zone: SurfaceZone): Surface;
107
+ /**
108
+ * SVG `d` path for a clickable surface zone within a tooth's local box.
109
+ * 5-zone teeth frame a central occlusal rect with four edge trapezoids;
110
+ * 4-zone teeth split the box along both diagonals into four triangles meeting
111
+ * at the centre.
112
+ */
113
+ export declare function zonePath(zone: SurfaceZone, rect: {
114
+ x: number;
115
+ y: number;
116
+ w: number;
117
+ h: number;
118
+ }, hasCenter: boolean): string;
119
+ export declare const TOOTH_GAP = 5;
120
+ export declare const TOOTH_ROW_GAP = 40;
68
121
  export declare const TOOTH_HIT_PAD = 4;
122
+ export declare const TOOTH_SLOT_WIDTH = 36;
123
+ /** Facial-view slot block-size; the plan/occlusal view uses a shorter slot. */
124
+ export declare const TOOTH_SLOT_HEIGHT = 62;
125
+ /**
126
+ * Resolve a tooth render URL. `view` follows the arch (`top` = upper,
127
+ * `bottom` = lower); `symbol` selects the artwork layer (`default` is the
128
+ * healthy tooth; condition/finding overlays use their symbol folder).
129
+ */
130
+ export declare function toothImageUrl(meta: ToothMeta, assetBaseUrl: string, symbol?: string, projection?: 'side' | 'plan'): string;
69
131
  export interface PositionedTooth {
70
132
  fdi: FdiId;
71
133
  meta: ToothMeta;
72
- shape: ToothShape;
73
134
  x: number;
74
135
  y: number;
75
136
  }
@@ -80,7 +141,7 @@ export interface PositionedTooth {
80
141
  * is preserved: the patient's right sits on the viewer's left in both
81
142
  * arches, regardless of document direction.
82
143
  */
83
- export declare function layoutTeeth(dentition: Dentition): {
144
+ export declare function layoutTeeth(dentition: Dentition, slotHeight?: number): {
84
145
  teeth: PositionedTooth[];
85
146
  width: number;
86
147
  height: number;
@@ -1,4 +1,6 @@
1
1
  import type { AgentAdapter } from '../../agent/types';
2
2
  import type { ToothSchemeHandle } from './tooth-scheme';
3
+ import type { Surface, ToothCondition } from './tooth-data';
3
4
  export declare const toothSchemeAgent: AgentAdapter<ToothSchemeHandle>;
5
+ export type { Surface, ToothCondition };
4
6
  //# sourceMappingURL=tooth-scheme.agent.d.ts.map
@@ -1,4 +1,4 @@
1
- import { PERMANENT_TEETH, PRIMARY_TEETH, type Dentition, type FdiId, type Numbering, type ToothChart, type ToothCondition, type ToothMode } from './tooth-data';
1
+ import { PERMANENT_TEETH, PRIMARY_TEETH, type ViewMode, type Dentition, type FdiId, type Numbering, type Surface, type ToothChart, type ToothCondition, type ToothMode } from './tooth-data';
2
2
  export interface ToothSchemeProps {
3
3
  /** Opaque instance id — emitted as `data-component-id` for the agent registry. */
4
4
  id?: string;
@@ -8,6 +8,13 @@ export interface ToothSchemeProps {
8
8
  numbering?: Numbering;
9
9
  /** `'interactive'` enables selection + keyboard nav; `'display'` is read-only. Default `'interactive'`. */
10
10
  mode?: ToothMode;
11
+ /**
12
+ * `'side'` shows the facial view (whole-tooth findings); `'plan'` shows the
13
+ * occlusal view (per-surface caries / fillings); `'both'` stacks the side
14
+ * chart above an interactive occlusal companion that shares the chart data.
15
+ * Default `'side'`.
16
+ */
17
+ projection?: ViewMode;
11
18
  /** Controlled chart state — the full `Record<FdiId, ToothState>`. */
12
19
  value?: ToothChart;
13
20
  /** Uncontrolled initial chart state. */
@@ -18,6 +25,36 @@ export interface ToothSchemeProps {
18
25
  onSelect?: (toothId: FdiId) => void;
19
26
  /** Shortcut for pre-populating conditions: `{ '16': ['caries'], '36': ['filled'] }`. */
20
27
  conditions?: Partial<Record<FdiId, ToothCondition[]>>;
28
+ /**
29
+ * The finding a tooth-click applies in interactive mode (the selected
30
+ * tool in a Findings / "Stato dentale" panel). Clicking a tooth toggles
31
+ * this condition. When unset, clicking cycles caries on/off.
32
+ */
33
+ activeCondition?: ToothCondition;
34
+ /**
35
+ * Base URL the photoreal tooth renders are served from. Resolves to
36
+ * `${assetBaseUrl}/{side|plan}/{symbol}/{top|bottom}/{fdi}.webp`. Defaults
37
+ * to the kit's bundled static path; host the `toothscheme/teeth` set
38
+ * elsewhere (CDN) by overriding this. Trusted developer-controlled value —
39
+ * interpolated into an SVG `<image href>` (which cannot execute scripts),
40
+ * not user input; intentionally not runtime-validated.
41
+ */
42
+ assetBaseUrl?: string;
43
+ /**
44
+ * Show the finding-colour legend below the chart. Default `false` — findings
45
+ * render as distinct symbol glyphs (self-describing) + tooltips, so the
46
+ * colour key is opt-in; a consuming "Stato dentale" surface uses a
47
+ * finding-type panel as its key instead.
48
+ */
49
+ legend?: boolean;
50
+ /**
51
+ * Render a built-in options affordance: a gear button that opens a popover
52
+ * letting the END USER toggle the legend and switch dentition / numbering /
53
+ * projection. Opt-in — when on, those four become user-overridable (seeded
54
+ * from the props); when off, the props drive the chart directly. Default
55
+ * `false`.
56
+ */
57
+ controls?: boolean;
21
58
  /** Accessible label override for the chart region. */
22
59
  ariaLabel?: string;
23
60
  /** Extra class names on the wrapper. */
@@ -28,6 +65,16 @@ export interface ToothSchemeHandle {
28
65
  focusTooth: (id: FdiId) => void;
29
66
  /** Read the current chart state. */
30
67
  getChart: () => ToothChart;
68
+ /** Read the findings recorded on one tooth (empty array if none). */
69
+ getTooth: (id: FdiId) => ToothCondition[];
70
+ /** Read the FDI ids of every tooth carrying a given finding. */
71
+ teethWith: (condition: ToothCondition) => FdiId[];
72
+ /** Add a finding to a tooth (no-op if already present). Optionally mark surfaces. */
73
+ setFinding: (id: FdiId, condition: ToothCondition, surfaces?: Surface[]) => void;
74
+ /** Remove a finding from a tooth (no-op if absent). */
75
+ removeFinding: (id: FdiId, condition: ToothCondition) => void;
76
+ /** Clear every finding from a tooth. */
77
+ clearTooth: (id: FdiId) => void;
31
78
  }
32
79
  declare const rootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
33
80
  export declare const ToothScheme: import("react").ForwardRefExoticComponent<ToothSchemeProps & import("react").RefAttributes<ToothSchemeHandle>>;
@@ -1,4 +1,4 @@
1
- import { C as r, U as t, a as U, b as e, c as n } from "../../_chunks/unit-converter-3sINXO3m.js";
1
+ import { C as r, U as t, a as U, b as e, c as n } from "../../_chunks/unit-converter-BIbXHIQA.js";
2
2
  export {
3
3
  r as CATEGORIES,
4
4
  t as UNITS,
@@ -1923,11 +1923,23 @@ export declare const arUi: {
1923
1923
  readonly toothScheme: {
1924
1924
  readonly ariaLabel: "مخطط الأسنان";
1925
1925
  readonly legendLabel: "دليل الحالات";
1926
+ readonly view: {
1927
+ readonly side: "عرض جانبي";
1928
+ readonly occlusal: "عرض إطباقي";
1929
+ readonly both: "كلا العرضين";
1930
+ };
1926
1931
  readonly dentition: {
1927
1932
  readonly permanent: "أسنان دائمة";
1928
1933
  readonly primary: "أسنان لبنية";
1929
1934
  readonly mixed: "تسنين مختلط";
1930
1935
  };
1936
+ readonly options: {
1937
+ readonly label: "خيارات المخطط";
1938
+ readonly legend: "مفتاح";
1939
+ readonly dentition: "الأسنان";
1940
+ readonly numbering: "الترقيم";
1941
+ readonly view: "العرض";
1942
+ };
1931
1943
  readonly anatomy: {
1932
1944
  readonly incisor: "قاطعة";
1933
1945
  readonly canine: "ناب";
@@ -1941,6 +1953,11 @@ export declare const arUi: {
1941
1953
  readonly missing: "مفقود";
1942
1954
  readonly implant: "زرعة";
1943
1955
  readonly rootCanal: "علاج جذر";
1956
+ readonly temporaryCrown: "تاج مؤقت";
1957
+ readonly bridge: "جسر";
1958
+ readonly destroyed: "مُهدَّم";
1959
+ readonly implantExtraction: "إزالة زرعة";
1960
+ readonly stub: "جذر متبقٍ";
1944
1961
  };
1945
1962
  readonly surface: {
1946
1963
  readonly mesial: "وسطاني";
@@ -1906,11 +1906,23 @@ const e = {
1906
1906
  toothScheme: {
1907
1907
  ariaLabel: "مخطط الأسنان",
1908
1908
  legendLabel: "دليل الحالات",
1909
+ view: {
1910
+ side: "عرض جانبي",
1911
+ occlusal: "عرض إطباقي",
1912
+ both: "كلا العرضين"
1913
+ },
1909
1914
  dentition: {
1910
1915
  permanent: "أسنان دائمة",
1911
1916
  primary: "أسنان لبنية",
1912
1917
  mixed: "تسنين مختلط"
1913
1918
  },
1919
+ options: {
1920
+ label: "خيارات المخطط",
1921
+ legend: "مفتاح",
1922
+ dentition: "الأسنان",
1923
+ numbering: "الترقيم",
1924
+ view: "العرض"
1925
+ },
1914
1926
  anatomy: {
1915
1927
  incisor: "قاطعة",
1916
1928
  canine: "ناب",
@@ -1923,7 +1935,12 @@ const e = {
1923
1935
  crowned: "مُتوَّج",
1924
1936
  missing: "مفقود",
1925
1937
  implant: "زرعة",
1926
- rootCanal: "علاج جذر"
1938
+ rootCanal: "علاج جذر",
1939
+ temporaryCrown: "تاج مؤقت",
1940
+ bridge: "جسر",
1941
+ destroyed: "مُهدَّم",
1942
+ implantExtraction: "إزالة زرعة",
1943
+ stub: "جذر متبقٍ"
1927
1944
  },
1928
1945
  surface: {
1929
1946
  mesial: "وسطاني",
@@ -1923,11 +1923,23 @@ export declare const deUi: {
1923
1923
  readonly toothScheme: {
1924
1924
  readonly ariaLabel: "Zahnschema";
1925
1925
  readonly legendLabel: "Legende der Zustände";
1926
+ readonly view: {
1927
+ readonly side: "Seitenansicht";
1928
+ readonly occlusal: "Okklusalansicht";
1929
+ readonly both: "Beide Ansichten";
1930
+ };
1926
1931
  readonly dentition: {
1927
1932
  readonly permanent: "Bleibendes Gebiss";
1928
1933
  readonly primary: "Milchgebiss";
1929
1934
  readonly mixed: "Wechselgebiss";
1930
1935
  };
1936
+ readonly options: {
1937
+ readonly label: "Diagrammoptionen";
1938
+ readonly legend: "Legende";
1939
+ readonly dentition: "Zähne";
1940
+ readonly numbering: "Nummerierung";
1941
+ readonly view: "Ansicht";
1942
+ };
1931
1943
  readonly anatomy: {
1932
1944
  readonly incisor: "Schneidezahn";
1933
1945
  readonly canine: "Eckzahn";
@@ -1941,6 +1953,11 @@ export declare const deUi: {
1941
1953
  readonly missing: "Fehlend";
1942
1954
  readonly implant: "Implantat";
1943
1955
  readonly rootCanal: "Wurzelkanalbehandlung";
1956
+ readonly temporaryCrown: "Provisorische Krone";
1957
+ readonly bridge: "Brücke";
1958
+ readonly destroyed: "Zerstört";
1959
+ readonly implantExtraction: "Explantation";
1960
+ readonly stub: "Wurzelrest";
1944
1961
  };
1945
1962
  readonly surface: {
1946
1963
  readonly mesial: "Mesial";
@@ -1905,11 +1905,23 @@ const e = {
1905
1905
  toothScheme: {
1906
1906
  ariaLabel: "Zahnschema",
1907
1907
  legendLabel: "Legende der Zustände",
1908
+ view: {
1909
+ side: "Seitenansicht",
1910
+ occlusal: "Okklusalansicht",
1911
+ both: "Beide Ansichten"
1912
+ },
1908
1913
  dentition: {
1909
1914
  permanent: "Bleibendes Gebiss",
1910
1915
  primary: "Milchgebiss",
1911
1916
  mixed: "Wechselgebiss"
1912
1917
  },
1918
+ options: {
1919
+ label: "Diagrammoptionen",
1920
+ legend: "Legende",
1921
+ dentition: "Zähne",
1922
+ numbering: "Nummerierung",
1923
+ view: "Ansicht"
1924
+ },
1913
1925
  anatomy: {
1914
1926
  incisor: "Schneidezahn",
1915
1927
  canine: "Eckzahn",
@@ -1922,7 +1934,12 @@ const e = {
1922
1934
  crowned: "Überkront",
1923
1935
  missing: "Fehlend",
1924
1936
  implant: "Implantat",
1925
- rootCanal: "Wurzelkanalbehandlung"
1937
+ rootCanal: "Wurzelkanalbehandlung",
1938
+ temporaryCrown: "Provisorische Krone",
1939
+ bridge: "Brücke",
1940
+ destroyed: "Zerstört",
1941
+ implantExtraction: "Explantation",
1942
+ stub: "Wurzelrest"
1926
1943
  },
1927
1944
  surface: {
1928
1945
  mesial: "Mesial",
@@ -1920,11 +1920,23 @@ export declare const elUi: {
1920
1920
  readonly toothScheme: {
1921
1921
  readonly ariaLabel: "Οδοντόγραμμα";
1922
1922
  readonly legendLabel: "Υπόμνημα καταστάσεων";
1923
+ readonly view: {
1924
+ readonly side: "Πλάγια όψη";
1925
+ readonly occlusal: "Ωκλουσιακή όψη";
1926
+ readonly both: "Και οι δύο όψεις";
1927
+ };
1923
1928
  readonly dentition: {
1924
1929
  readonly permanent: "Μόνιμη οδοντοφυΐα";
1925
1930
  readonly primary: "Νηπιακή οδοντοφυΐα";
1926
1931
  readonly mixed: "Μικτή οδοντοφυΐα";
1927
1932
  };
1933
+ readonly options: {
1934
+ readonly label: "Επιλογές διαγράμματος";
1935
+ readonly legend: "Υπόμνημα";
1936
+ readonly dentition: "Δόντια";
1937
+ readonly numbering: "Αρίθμηση";
1938
+ readonly view: "Προβολή";
1939
+ };
1928
1940
  readonly anatomy: {
1929
1941
  readonly incisor: "Τομέας";
1930
1942
  readonly canine: "Κυνόδοντας";
@@ -1938,6 +1950,11 @@ export declare const elUi: {
1938
1950
  readonly missing: "Ελλείπον";
1939
1951
  readonly implant: "Εμφύτευμα";
1940
1952
  readonly rootCanal: "Ενδοδοντική θεραπεία";
1953
+ readonly temporaryCrown: "Προσωρινή στεφάνη";
1954
+ readonly bridge: "Γέφυρα";
1955
+ readonly destroyed: "Κατεστραμμένο";
1956
+ readonly implantExtraction: "Αφαίρεση εμφυτεύματος";
1957
+ readonly stub: "Κολόβωμα";
1941
1958
  };
1942
1959
  readonly surface: {
1943
1960
  readonly mesial: "Μεσιαία";