@alfadocs/ui-kit-debug 1.12.5 → 1.13.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 (138) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js → actions-cell-renderer-ReurEy5i.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js.map → actions-cell-renderer-ReurEy5i.js.map} +1 -1
  3. package/dist/_chunks/{address-fields-CZP4Wncx.js → address-fields-CZ0pEdEI.js} +4 -4
  4. package/dist/_chunks/{address-fields-CZP4Wncx.js.map → address-fields-CZ0pEdEI.js.map} +1 -1
  5. package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js → ai-prompt-input-CrHr-5H8.js} +2 -2
  6. package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js.map → ai-prompt-input-CrHr-5H8.js.map} +1 -1
  7. package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js → anamnesis-summary-rows-CRWO8x8g.js} +4 -4
  8. package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js.map → anamnesis-summary-rows-CRWO8x8g.js.map} +1 -1
  9. package/dist/_chunks/{audio-recorder-EWBCNIsd.js → audio-recorder-DXG6LTtO.js} +2 -2
  10. package/dist/_chunks/{audio-recorder-EWBCNIsd.js.map → audio-recorder-DXG6LTtO.js.map} +1 -1
  11. package/dist/_chunks/{autocomplete-BrONKN8l.js → autocomplete-MpBhz-fG.js} +86 -74
  12. package/dist/_chunks/{autocomplete-BrONKN8l.js.map → autocomplete-MpBhz-fG.js.map} +1 -1
  13. package/dist/_chunks/{balance-badge-cell-7L6nzB29.js → balance-badge-cell--iQ_gtmi.js} +4 -4
  14. package/dist/_chunks/{balance-badge-cell-7L6nzB29.js.map → balance-badge-cell--iQ_gtmi.js.map} +1 -1
  15. package/dist/_chunks/{bishop-score-Cnu0xs-z.js → bishop-score-CJUVBfAu.js} +2 -2
  16. package/dist/_chunks/{bishop-score-Cnu0xs-z.js.map → bishop-score-CJUVBfAu.js.map} +1 -1
  17. package/dist/_chunks/{booking-CBHKdsZl.js → booking-DQbo6mQF.js} +609 -591
  18. package/dist/_chunks/booking-DQbo6mQF.js.map +1 -0
  19. package/dist/_chunks/{care-plan-card-aDN4oem9.js → care-plan-card-D-FMfDKH.js} +2 -2
  20. package/dist/_chunks/{care-plan-card-aDN4oem9.js.map → care-plan-card-D-FMfDKH.js.map} +1 -1
  21. package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js → care-plan-entry-card-Bvw_9T-d.js} +2 -2
  22. package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js.map → care-plan-entry-card-Bvw_9T-d.js.map} +1 -1
  23. package/dist/_chunks/{care-plan-header-CkpPyQqG.js → care-plan-header-B5CBE0zu.js} +2 -2
  24. package/dist/_chunks/{care-plan-header-CkpPyQqG.js.map → care-plan-header-B5CBE0zu.js.map} +1 -1
  25. package/dist/_chunks/{city-input-towzBenY.js → city-input-DaQc-Hbj.js} +2 -2
  26. package/dist/_chunks/{city-input-towzBenY.js.map → city-input-DaQc-Hbj.js.map} +1 -1
  27. package/dist/_chunks/{combobox-DiMLItyu.js → combobox-D7_NLE2Z.js} +89 -81
  28. package/dist/_chunks/{combobox-DiMLItyu.js.map → combobox-D7_NLE2Z.js.map} +1 -1
  29. package/dist/_chunks/{contact-profile-card-BMIBr5s9.js → contact-profile-card-BZqi8Hck.js} +38 -36
  30. package/dist/_chunks/{contact-profile-card-BMIBr5s9.js.map → contact-profile-card-BZqi8Hck.js.map} +1 -1
  31. package/dist/_chunks/{country-select-UEF9BEeQ.js → country-select-DzbPFktV.js} +2 -2
  32. package/dist/_chunks/{country-select-UEF9BEeQ.js.map → country-select-DzbPFktV.js.map} +1 -1
  33. package/dist/_chunks/{document-preview-oyx9RhCo.js → document-preview-CDb-n_W7.js} +2 -2
  34. package/dist/_chunks/{document-preview-oyx9RhCo.js.map → document-preview-CDb-n_W7.js.map} +1 -1
  35. package/dist/_chunks/{face-scheme-CZaKm6fG.js → face-scheme-DA2vjqaM.js} +2 -2
  36. package/dist/_chunks/{face-scheme-CZaKm6fG.js.map → face-scheme-DA2vjqaM.js.map} +1 -1
  37. package/dist/_chunks/{file-manager-C0y7HBAN.js → file-manager-UsD8e_AB.js} +2 -2
  38. package/dist/_chunks/{file-manager-C0y7HBAN.js.map → file-manager-UsD8e_AB.js.map} +1 -1
  39. package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js → gestational-age-calculator-CiOQjzgx.js} +2 -2
  40. package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js.map → gestational-age-calculator-CiOQjzgx.js.map} +1 -1
  41. package/dist/_chunks/key-value-pair-BIBdZBLg.js +188 -0
  42. package/dist/_chunks/key-value-pair-BIBdZBLg.js.map +1 -0
  43. package/dist/_chunks/{link-cell-renderer-CenJx-_7.js → link-cell-renderer-CIASXsVM.js} +4 -4
  44. package/dist/_chunks/{link-cell-renderer-CenJx-_7.js.map → link-cell-renderer-CIASXsVM.js.map} +1 -1
  45. package/dist/_chunks/{multi-select-DqL4o0qV.js → multi-select-DYOvx2SJ.js} +56 -48
  46. package/dist/_chunks/{multi-select-DqL4o0qV.js.map → multi-select-DYOvx2SJ.js.map} +1 -1
  47. package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js → muscle-scheme-BSJsI4-I.js} +2 -2
  48. package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js.map → muscle-scheme-BSJsI4-I.js.map} +1 -1
  49. package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js → optical-prescription-BvwuqTpl.js} +2 -2
  50. package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js.map → optical-prescription-BvwuqTpl.js.map} +1 -1
  51. package/dist/_chunks/{patient-details-xrqe13az.js → patient-details-BQaUzPqp.js} +5 -5
  52. package/dist/_chunks/{patient-details-xrqe13az.js.map → patient-details-BQaUzPqp.js.map} +1 -1
  53. package/dist/_chunks/{patient-search-D5ufYoRc.js → patient-search-HeEUB-_X.js} +2 -2
  54. package/dist/_chunks/{patient-search-D5ufYoRc.js.map → patient-search-HeEUB-_X.js.map} +1 -1
  55. package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js → patient-summary-card-CvDxhbBR.js} +2 -2
  56. package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js.map → patient-summary-card-CvDxhbBR.js.map} +1 -1
  57. package/dist/_chunks/{payment-request-card-YVCcCZ25.js → payment-request-card-lmKLwsDs.js} +2 -2
  58. package/dist/_chunks/{payment-request-card-YVCcCZ25.js.map → payment-request-card-lmKLwsDs.js.map} +1 -1
  59. package/dist/_chunks/{periodontal-chart-BatZEFar.js → periodontal-chart-B9fphroR.js} +2 -2
  60. package/dist/_chunks/{periodontal-chart-BatZEFar.js.map → periodontal-chart-B9fphroR.js.map} +1 -1
  61. package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js → periodontal-chart-card-qEZPXj83.js} +2 -2
  62. package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js.map → periodontal-chart-card-qEZPXj83.js.map} +1 -1
  63. package/dist/_chunks/{pregnancy-dating-DtToyMyc.js → pregnancy-dating-D2wchD11.js} +2 -2
  64. package/dist/_chunks/{pregnancy-dating-DtToyMyc.js.map → pregnancy-dating-D2wchD11.js.map} +1 -1
  65. package/dist/_chunks/{province-select-BDywtmL-.js → province-select-BBc7s7vR.js} +2 -2
  66. package/dist/_chunks/{province-select-BDywtmL-.js.map → province-select-BBc7s7vR.js.map} +1 -1
  67. package/dist/_chunks/{select-BW5ecXlX.js → select-Bi8zril7.js} +165 -136
  68. package/dist/_chunks/select-Bi8zril7.js.map +1 -0
  69. package/dist/_chunks/{signature-request-DVDTKLjM.js → signature-request-CUe903hj.js} +2 -2
  70. package/dist/_chunks/{signature-request-DVDTKLjM.js.map → signature-request-CUe903hj.js.map} +1 -1
  71. package/dist/_chunks/{tabs-CBb2AidH.js → tabs-DqKtTIjZ.js} +2 -2
  72. package/dist/_chunks/{tabs-CBb2AidH.js.map → tabs-DqKtTIjZ.js.map} +1 -1
  73. package/dist/_chunks/{tasks-panel-Do5SFp-j.js → tasks-panel-DPCNaRko.js} +2 -2
  74. package/dist/_chunks/{tasks-panel-Do5SFp-j.js.map → tasks-panel-DPCNaRko.js.map} +1 -1
  75. package/dist/_chunks/{tooth-scheme-WdyVymQ1.js → tooth-scheme-2IsmbE6w.js} +2 -2
  76. package/dist/_chunks/{tooth-scheme-WdyVymQ1.js.map → tooth-scheme-2IsmbE6w.js.map} +1 -1
  77. package/dist/_chunks/{unit-converter-BPumXMA6.js → unit-converter-C6jMjqL9.js} +2 -2
  78. package/dist/_chunks/{unit-converter-BPumXMA6.js.map → unit-converter-C6jMjqL9.js.map} +1 -1
  79. package/dist/_chunks/{workflow-map-DE_ribRM.js → workflow-map-wcw3t6g4.js} +2 -2
  80. package/dist/_chunks/{workflow-map-DE_ribRM.js.map → workflow-map-wcw3t6g4.js.map} +1 -1
  81. package/dist/agent-catalog.json +1 -1
  82. package/dist/components/_shared/option.d.ts +1 -0
  83. package/dist/components/_shared/option.d.ts.map +1 -1
  84. package/dist/components/address-fields/index.js +1 -1
  85. package/dist/components/ai-prompt-input/index.js +1 -1
  86. package/dist/components/audio-recorder/index.js +1 -1
  87. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  88. package/dist/components/autocomplete/index.js +1 -1
  89. package/dist/components/bishop-score/index.js +1 -1
  90. package/dist/components/booking/booking.d.ts.map +1 -1
  91. package/dist/components/booking/index.js +1 -1
  92. package/dist/components/care-plan-card/index.js +1 -1
  93. package/dist/components/care-plan-entry-card/index.js +1 -1
  94. package/dist/components/care-plan-header/index.js +1 -1
  95. package/dist/components/city-input/index.js +1 -1
  96. package/dist/components/combobox/combobox.d.ts.map +1 -1
  97. package/dist/components/combobox/index.js +1 -1
  98. package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
  99. package/dist/components/contact-profile-card/index.js +1 -1
  100. package/dist/components/country-select/index.js +1 -1
  101. package/dist/components/data-table/index.js +2 -2
  102. package/dist/components/document-preview/index.js +1 -1
  103. package/dist/components/face-scheme/index.js +1 -1
  104. package/dist/components/file-manager/index.js +1 -1
  105. package/dist/components/gestational-age-calculator/index.js +1 -1
  106. package/dist/components/key-value-pair/index.js +1 -1
  107. package/dist/components/key-value-pair/key-value-pair.d.ts +16 -0
  108. package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
  109. package/dist/components/multi-select/index.js +1 -1
  110. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  111. package/dist/components/muscle-scheme/index.js +1 -1
  112. package/dist/components/optical-prescription/index.js +1 -1
  113. package/dist/components/patient-details/index.js +1 -1
  114. package/dist/components/patient-search/index.js +1 -1
  115. package/dist/components/patient-summary-card/index.js +1 -1
  116. package/dist/components/patient-table/index.js +1 -1
  117. package/dist/components/payment-card/index.js +1 -1
  118. package/dist/components/periodontal-chart/index.js +1 -1
  119. package/dist/components/periodontal-chart-card/index.js +1 -1
  120. package/dist/components/pregnancy-dating/index.js +1 -1
  121. package/dist/components/province-select/index.js +1 -1
  122. package/dist/components/select/index.js +1 -1
  123. package/dist/components/select/select.d.ts +24 -0
  124. package/dist/components/select/select.d.ts.map +1 -1
  125. package/dist/components/skeleton-scheme/index.js +1 -1
  126. package/dist/components/tabs/index.js +1 -1
  127. package/dist/components/tasks-panel/index.js +1 -1
  128. package/dist/components/tooth-scheme/index.js +1 -1
  129. package/dist/components/unit-converter/index.js +1 -1
  130. package/dist/components/workflow/index.js +1 -1
  131. package/dist/index.js +40 -40
  132. package/dist/patterns/anamnesis/index.js +1 -1
  133. package/dist/patterns/signature-request/index.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/_chunks/booking-CBHKdsZl.js.map +0 -1
  136. package/dist/_chunks/key-value-pair-BubG4fUa.js +0 -144
  137. package/dist/_chunks/key-value-pair-BubG4fUa.js.map +0 -1
  138. package/dist/_chunks/select-BW5ecXlX.js.map +0 -1
@@ -5,7 +5,7 @@ import { useTranslation as M } from "react-i18next";
5
5
  import { u as Y } from "./registry-DvAUVLHh.js";
6
6
  import { F as C } from "./form-field-CahJzTxp.js";
7
7
  import { N as B } from "./number-input-Cgu2TtA8.js";
8
- import { S } from "./select-BW5ecXlX.js";
8
+ import { S } from "./select-Bi8zril7.js";
9
9
  import { I as D } from "./insert-result-LCNTskNJ.js";
10
10
  const L = [
11
11
  "weight",
@@ -334,4 +334,4 @@ export {
334
334
  ee as b,
335
335
  Q as c
336
336
  };
337
- //# sourceMappingURL=unit-converter-BPumXMA6.js.map
337
+ //# sourceMappingURL=unit-converter-C6jMjqL9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unit-converter-BPumXMA6.js","sources":["../../src/components/unit-converter/unit-converter.agent.ts","../../src/components/unit-converter/units.ts","../../src/components/unit-converter/unit-converter.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — UnitConverter. */\n/* */\n/* Generic clinical/everyday unit conversion. The agent-relevant surface */\n/* is the read-only converted result plus the structural inputs (category, */\n/* source value, from-unit, to-unit) and `set_value` actions to drive */\n/* them. Values are plain measurements — no patient identity. The handle */\n/* is the curated `UnitConverterHandle`. See `src/docs/26-agent-readiness`.*/\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { UnitConverterHandle } from './unit-converter';\nimport type { UnitCategory } from './units';\n\n/**\n * Measurement families, mirrored from `./units`'s `CATEGORIES`. Inlined as a\n * literal (rather than runtime-imported) so the ESM catalog build can load this\n * pure module without TS path resolution; `satisfies` keeps it in lockstep with\n * the `UnitCategory` union at compile time.\n */\nconst CATEGORIES = [\n 'weight',\n 'length',\n 'temperature',\n 'glucose',\n] as const satisfies readonly UnitCategory[];\n\nexport const unitConverterAgent: AgentAdapter<UnitConverterHandle> = {\n id: 'unit-converter',\n capabilities: ['set_value', 'view_change'],\n state: {\n category: {\n type: \"'weight' | 'length' | 'temperature' | 'glucose'\",\n descriptionKey: 'ui.agent.unitConverter.state.category',\n description:\n 'Active measurement family. Determines which from/to units are selectable.',\n read: (handle) => handle.getCategory(),\n },\n inputs: {\n type: '{ value: number | null, fromId: string, toId: string }',\n descriptionKey: 'ui.agent.unitConverter.state.inputs',\n description:\n 'Source value plus the from-unit and to-unit ids within the active category.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: 'number | null',\n descriptionKey: 'ui.agent.unitConverter.state.result',\n description:\n 'Converted value in the to-unit, or null when the source value is empty.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['number', 'null'],\n description: 'Source value to convert, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setValue',\n description: 'Set the source value to convert.',\n examples: [{ args: { value: 70 }, note: 'Convert 70 of the from-unit.' }],\n invoke: (handle, args: { value: number | null }) => {\n handle.setValue(args.value);\n },\n },\n set_units: {\n safety: 'read',\n argsType: '{ fromId?: string, toId?: string }',\n argsSchema: {\n type: 'object',\n properties: {\n fromId: {\n type: 'string',\n description: 'Source unit id within the active category.',\n },\n toId: {\n type: 'string',\n description: 'Target unit id within the active category.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setUnits',\n description:\n 'Set the from-unit and/or to-unit. Ids outside the active category are ignored.',\n examples: [\n { args: { fromId: 'kg', toId: 'lb' }, note: 'Convert kg → lb.' },\n ],\n invoke: (handle, args: { fromId?: string; toId?: string }) => {\n handle.setUnits(args);\n },\n },\n set_category: {\n safety: 'read',\n argsType: \"{ category: 'weight' | 'length' | 'temperature' | 'glucose' }\",\n argsSchema: {\n type: 'object',\n properties: {\n category: {\n enum: [...CATEGORIES],\n description: 'Measurement family to switch to.',\n },\n },\n required: ['category'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setCategory',\n description:\n 'Switch the measurement family. Resets the from/to units to that category defaults.',\n invoke: (\n handle,\n args: {\n category: 'weight' | 'length' | 'temperature' | 'glucose';\n },\n ) => {\n handle.setCategory(args.category);\n },\n },\n get_result: {\n safety: 'read',\n returns: 'number | null',\n returnsSchema: { type: ['number', 'null'] },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.getResult',\n description:\n 'Return the converted value in the to-unit, or null when no source value is set.',\n invoke: (handle) => handle.getResult(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'unit-converter',\n description: 'Marks the UnitConverter wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific converter instance.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Generic unit conversion — pure, framework-free, unit-testable. */\n/* */\n/* Every unit is described by an affine map to its category's base */\n/* unit: base = value * factor + offset. Conversion is base-in then */\n/* base-out, so the same code handles linear scales (weight, length, */\n/* glucose) and offset scales (temperature) uniformly. */\n/* ------------------------------------------------------------------ */\n\nexport type UnitCategory = 'weight' | 'length' | 'temperature' | 'glucose';\n\nexport interface UnitDef {\n id: string;\n category: UnitCategory;\n /** Multiplier to the category base unit. */\n factor: number;\n /** Additive offset to the base unit (non-zero only for temperature). */\n offset: number;\n}\n\n/* Base units: kg, cm, °C, mmol/L. */\nexport const UNITS: Record<string, UnitDef> = {\n // weight → base kg\n kg: { id: 'kg', category: 'weight', factor: 1, offset: 0 },\n g: { id: 'g', category: 'weight', factor: 0.001, offset: 0 },\n lb: { id: 'lb', category: 'weight', factor: 0.45359237, offset: 0 },\n oz: { id: 'oz', category: 'weight', factor: 0.028349523125, offset: 0 },\n // length → base cm\n cm: { id: 'cm', category: 'length', factor: 1, offset: 0 },\n m: { id: 'm', category: 'length', factor: 100, offset: 0 },\n in: { id: 'in', category: 'length', factor: 2.54, offset: 0 },\n ft: { id: 'ft', category: 'length', factor: 30.48, offset: 0 },\n // temperature → base °C (affine: °C = °F·5/9 − 32·5/9)\n c: { id: 'c', category: 'temperature', factor: 1, offset: 0 },\n f: { id: 'f', category: 'temperature', factor: 5 / 9, offset: (-32 * 5) / 9 },\n // glucose → base mmol/L (1 mg/dL = 1/18.0156 mmol/L)\n mmol_l: { id: 'mmol_l', category: 'glucose', factor: 1, offset: 0 },\n mg_dl: { id: 'mg_dl', category: 'glucose', factor: 1 / 18.0156, offset: 0 },\n};\n\nexport const UNITS_BY_CATEGORY: Record<UnitCategory, string[]> = {\n weight: ['kg', 'g', 'lb', 'oz'],\n length: ['cm', 'm', 'in', 'ft'],\n temperature: ['c', 'f'],\n glucose: ['mmol_l', 'mg_dl'],\n};\n\nexport const CATEGORIES: UnitCategory[] = [\n 'weight',\n 'length',\n 'temperature',\n 'glucose',\n];\n\n/**\n * Convert `value` from one unit to another. Both ids must belong to the same\n * category; mismatched categories throw (a programming error, not user input).\n */\nexport function convertUnits(\n value: number,\n fromId: string,\n toId: string,\n): number {\n const from = UNITS[fromId];\n const to = UNITS[toId];\n if (!from || !to) throw new Error(`Unknown unit: ${fromId} → ${toId}`);\n if (from.category !== to.category) {\n throw new Error(\n `Cannot convert across categories: ${from.category} → ${to.category}`,\n );\n }\n const base = value * from.factor + from.offset;\n return (base - to.offset) / to.factor;\n}\n","/* ------------------------------------------------------------------ */\n/* UnitConverter — generic clinical/everyday unit conversion across */\n/* weight, length, temperature and glucose. */\n/* */\n/* Maths lives in `./units` (pure, separately tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { unitConverterAgent } from './unit-converter.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { Select } from '../select';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type UnitCategory,\n CATEGORIES,\n UNITS_BY_CATEGORY,\n convertUnits,\n} from './units';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/**\n * DS token NAME backing the result-card category chip, one per measurement\n * family. The converter shows no on-screen badge, but the inserted card carries\n * a category chip so the reader can tell at a glance which family the figure\n * belongs to; each token is a closed-palette semantic alias resolved to a\n * concrete colour at raster time by `InsertButton`.\n */\nconst CATEGORY_HIGHLIGHT_TOKEN: Record<UnitCategory, string> = {\n weight: '--info',\n length: '--success',\n temperature: '--warning-readable',\n glucose: '--accent',\n};\n\n/**\n * Category chip token. The `temperature` family resolves to `--warning-readable`,\n * which the result card's colour probe resolves in the live themed DOM: orange-600\n * in light, non-accessible mode (where bare `--warning` yellow only reaches\n * ~3.2:1 on the white card) and `--warning` elsewhere, whose deepened ramp already\n * clears contrast. Resolving the token NAME at the card means the choice tracks\n * the live theme regardless of where the theme class lives. Other families are\n * unchanged.\n */\nfunction categoryHighlightToken(category: UnitCategory): string {\n return CATEGORY_HIGHLIGHT_TOKEN[category];\n}\n\nexport interface UnitConverterProps extends VariantProps<typeof rootVariants> {\n /** Initial category. Defaults to `'weight'`. */\n defaultCategory?: UnitCategory;\n /** Fires with the converted value (and `null` when input is empty). */\n onResultChange?: (value: number | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads/writes the\n * structural inputs (category, value, from/to units) and the converted result.\n * No patient identity. Consumed by the `unit-converter.agent.ts` adapter; the\n * public `ref` stays the DOM element.\n */\nexport interface UnitConverterHandle {\n /** Active measurement family. */\n getCategory: () => UnitCategory;\n /** Switch the measurement family (resets from/to units to that category). */\n setCategory: (next: UnitCategory) => void;\n /** Source value + from/to unit ids. */\n getInputs: () => { value: number | null; fromId: string; toId: string };\n /** Set the source value to convert. */\n setValue: (value: number | null) => void;\n /** Set from-unit and/or to-unit (ids outside the active category are ignored). */\n setUnits: (next: { fromId?: string; toId?: string }) => void;\n /** Converted value in the to-unit, or null when no source value is set. */\n getResult: () => number | null;\n}\n\nexport const UnitConverter = forwardRef<HTMLDivElement, UnitConverterProps>(\n (\n {\n defaultCategory = 'weight',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [category, setCategory] = useState<UnitCategory>(defaultCategory);\n const [value, setValue] = useState<number | null>(null);\n const [fromId, setFromId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][0],\n );\n const [toId, setToId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][1],\n );\n\n const handleCategoryChange = (next: string): void => {\n const cat = next as UnitCategory;\n const units = UNITS_BY_CATEGORY[cat];\n setCategory(cat);\n setFromId(units[0]);\n setToId(units[1] ?? units[0]);\n };\n\n const converted = useMemo(\n () => (value === null ? null : convertUnits(value, fromId, toId)),\n [value, fromId, toId],\n );\n\n const numberFmt = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 3 }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(converted);\n }, [converted, onResultChange]);\n\n // Live refs so the once-built agent handle reads/writes current state\n // without re-creating on every keystroke. Public `ref` stays the DOM node.\n const liveRef = useRef({ category, value, fromId, toId, converted });\n liveRef.current = { category, value, fromId, toId, converted };\n const agentHandle = useMemo<UnitConverterHandle>(\n () => ({\n getCategory: () => liveRef.current.category,\n setCategory: (next) => handleCategoryChange(next),\n getInputs: () => ({\n value: liveRef.current.value,\n fromId: liveRef.current.fromId,\n toId: liveRef.current.toId,\n }),\n setValue: (next) => setValue(next),\n setUnits: (next) => {\n const units = UNITS_BY_CATEGORY[liveRef.current.category];\n if (next.fromId !== undefined && units.includes(next.fromId)) {\n setFromId(next.fromId);\n }\n if (next.toId !== undefined && units.includes(next.toId)) {\n setToId(next.toId);\n }\n },\n getResult: () => liveRef.current.converted,\n }),\n [],\n );\n useAgentRegistration(unitConverterAgent, agentHandle, id);\n\n const categoryOptions = CATEGORIES.map((c) => ({\n value: c,\n label: t(`unitConverter.category.${c}`),\n }));\n const unitOptions = UNITS_BY_CATEGORY[category].map((u) => ({\n value: u,\n label: t(`unitConverter.units.${u}`),\n }));\n\n return (\n <div\n ref={ref}\n data-component=\"unit-converter\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <FormField label={t('unitConverter.categoryLabel')}>\n <Select\n options={categoryOptions}\n value={category}\n onValueChange={handleCategoryChange}\n />\n </FormField>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <FormField label={t('unitConverter.value')}>\n <NumberInput mode=\"decimal\" value={value} onChange={setValue} />\n </FormField>\n <FormField label={t('unitConverter.from')}>\n <Select\n options={unitOptions}\n value={fromId}\n onValueChange={setFromId}\n />\n </FormField>\n <FormField label={t('unitConverter.to')}>\n <Select\n options={unitOptions}\n value={toId}\n onValueChange={setToId}\n />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {converted !== null\n ? `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )} = ${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`\n : ''}\n </p>\n\n {converted !== null ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-muted-foreground\">\n {t('unitConverter.result')}\n </span>\n <span className=\"type-metric ds:text-foreground\">\n {numberFmt.format(converted)} {t(`unitConverter.units.${toId}`)}\n </span>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.unitConverter'),\n icon: 'ruler',\n highlight: t(`unitConverter.category.${category}`),\n // Chip tints by measurement family so the inserted card\n // signals the category at a glance — with the contrast-safe\n // orange override for the `--warning` temperature family.\n highlightToken: categoryHighlightToken(category),\n brand: insertBrand,\n fields: [\n {\n // Source measurement → ruler glyph (matches the header).\n icon: 'ruler',\n label: t('unitConverter.from'),\n value: `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )}`,\n },\n {\n // Converted result → trending-up (arrow) glyph signals the\n // conversion direction to the output value.\n icon: 'trending-up',\n label: t('unitConverter.to'),\n value: `${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`,\n },\n ],\n }}\n />\n ) : null}\n </div>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('unitConverter.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nUnitConverter.displayName = 'UnitConverter';\n"],"names":["CATEGORIES","unitConverterAgent","handle","args","UNITS","UNITS_BY_CATEGORY","convertUnits","value","fromId","toId","from","to","rootVariants","cva","CATEGORY_HIGHLIGHT_TOKEN","categoryHighlightToken","category","UnitConverter","forwardRef","defaultCategory","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","i18n","useTranslation","setCategory","useState","setValue","setFromId","setToId","handleCategoryChange","next","cat","units","converted","useMemo","numberFmt","useEffect","liveRef","useRef","agentHandle","useAgentRegistration","categoryOptions","c","unitOptions","u","jsxs","jsx","FormField","Select","NumberInput","InsertButton"],"mappings":";;;;;;;;;AAoBA,MAAMA,IAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa,aAAa;AAAA,EACzC,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,IAEvC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM,CAAC,UAAU,MAAM;AAAA,YACvB,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,MAAM,gCAAgC;AAAA,MACxE,QAAQ,CAACA,GAAQC,MAAmC;AAClD,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA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AA,kBAIjD,gBAAgBD,EAAuBC,CAAQ;AAAA,kBAC/C,OAAOS;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA;AAAA,sBAEE,MAAM;AAAA,sBACN,OAAOK,EAAE,oBAAoB;AAAA,sBAC7B,OAAO,GAAGc,EAAU,OAAOrC,KAAS,CAAC,CAAC,IAAIuB;AAAA,wBACxC,uBAAuBtB,CAAM;AAAA,sBAAA,CAC9B;AAAA,oBAAA;AAAA,oBAEH;AAAA;AAAA;AAAA,sBAGE,MAAM;AAAA,sBACN,OAAOsB,EAAE,kBAAkB;AAAA,sBAC3B,OAAO,GAAGc,EAAU,OAAOF,CAAS,CAAC,IAAIZ;AAAA,wBACvC,uBAAuBrB,CAAI;AAAA,sBAAA,CAC5B;AAAA,oBAAA;AAAA,kBACH;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,GACN,IAEA,gBAAA8C,EAAC,KAAA,EAAE,WAAU,sCACV,UAAAzB,EAAE,qBAAqB,EAAA,CAC1B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAb,GAAc,cAAc;"}
1
+ {"version":3,"file":"unit-converter-C6jMjqL9.js","sources":["../../src/components/unit-converter/unit-converter.agent.ts","../../src/components/unit-converter/units.ts","../../src/components/unit-converter/unit-converter.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — UnitConverter. */\n/* */\n/* Generic clinical/everyday unit conversion. The agent-relevant surface */\n/* is the read-only converted result plus the structural inputs (category, */\n/* source value, from-unit, to-unit) and `set_value` actions to drive */\n/* them. Values are plain measurements — no patient identity. The handle */\n/* is the curated `UnitConverterHandle`. See `src/docs/26-agent-readiness`.*/\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { UnitConverterHandle } from './unit-converter';\nimport type { UnitCategory } from './units';\n\n/**\n * Measurement families, mirrored from `./units`'s `CATEGORIES`. Inlined as a\n * literal (rather than runtime-imported) so the ESM catalog build can load this\n * pure module without TS path resolution; `satisfies` keeps it in lockstep with\n * the `UnitCategory` union at compile time.\n */\nconst CATEGORIES = [\n 'weight',\n 'length',\n 'temperature',\n 'glucose',\n] as const satisfies readonly UnitCategory[];\n\nexport const unitConverterAgent: AgentAdapter<UnitConverterHandle> = {\n id: 'unit-converter',\n capabilities: ['set_value', 'view_change'],\n state: {\n category: {\n type: \"'weight' | 'length' | 'temperature' | 'glucose'\",\n descriptionKey: 'ui.agent.unitConverter.state.category',\n description:\n 'Active measurement family. Determines which from/to units are selectable.',\n read: (handle) => handle.getCategory(),\n },\n inputs: {\n type: '{ value: number | null, fromId: string, toId: string }',\n descriptionKey: 'ui.agent.unitConverter.state.inputs',\n description:\n 'Source value plus the from-unit and to-unit ids within the active category.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: 'number | null',\n descriptionKey: 'ui.agent.unitConverter.state.result',\n description:\n 'Converted value in the to-unit, or null when the source value is empty.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: number | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['number', 'null'],\n description: 'Source value to convert, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setValue',\n description: 'Set the source value to convert.',\n examples: [{ args: { value: 70 }, note: 'Convert 70 of the from-unit.' }],\n invoke: (handle, args: { value: number | null }) => {\n handle.setValue(args.value);\n },\n },\n set_units: {\n safety: 'read',\n argsType: '{ fromId?: string, toId?: string }',\n argsSchema: {\n type: 'object',\n properties: {\n fromId: {\n type: 'string',\n description: 'Source unit id within the active category.',\n },\n toId: {\n type: 'string',\n description: 'Target unit id within the active category.',\n },\n },\n additionalProperties: false,\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setUnits',\n description:\n 'Set the from-unit and/or to-unit. Ids outside the active category are ignored.',\n examples: [\n { args: { fromId: 'kg', toId: 'lb' }, note: 'Convert kg → lb.' },\n ],\n invoke: (handle, args: { fromId?: string; toId?: string }) => {\n handle.setUnits(args);\n },\n },\n set_category: {\n safety: 'read',\n argsType: \"{ category: 'weight' | 'length' | 'temperature' | 'glucose' }\",\n argsSchema: {\n type: 'object',\n properties: {\n category: {\n enum: [...CATEGORIES],\n description: 'Measurement family to switch to.',\n },\n },\n required: ['category'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.setCategory',\n description:\n 'Switch the measurement family. Resets the from/to units to that category defaults.',\n invoke: (\n handle,\n args: {\n category: 'weight' | 'length' | 'temperature' | 'glucose';\n },\n ) => {\n handle.setCategory(args.category);\n },\n },\n get_result: {\n safety: 'read',\n returns: 'number | null',\n returnsSchema: { type: ['number', 'null'] },\n idempotent: true,\n descriptionKey: 'ui.agent.unitConverter.actions.getResult',\n description:\n 'Return the converted value in the to-unit, or null when no source value is set.',\n invoke: (handle) => handle.getResult(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'unit-converter',\n description: 'Marks the UnitConverter wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific converter instance.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Generic unit conversion — pure, framework-free, unit-testable. */\n/* */\n/* Every unit is described by an affine map to its category's base */\n/* unit: base = value * factor + offset. Conversion is base-in then */\n/* base-out, so the same code handles linear scales (weight, length, */\n/* glucose) and offset scales (temperature) uniformly. */\n/* ------------------------------------------------------------------ */\n\nexport type UnitCategory = 'weight' | 'length' | 'temperature' | 'glucose';\n\nexport interface UnitDef {\n id: string;\n category: UnitCategory;\n /** Multiplier to the category base unit. */\n factor: number;\n /** Additive offset to the base unit (non-zero only for temperature). */\n offset: number;\n}\n\n/* Base units: kg, cm, °C, mmol/L. */\nexport const UNITS: Record<string, UnitDef> = {\n // weight → base kg\n kg: { id: 'kg', category: 'weight', factor: 1, offset: 0 },\n g: { id: 'g', category: 'weight', factor: 0.001, offset: 0 },\n lb: { id: 'lb', category: 'weight', factor: 0.45359237, offset: 0 },\n oz: { id: 'oz', category: 'weight', factor: 0.028349523125, offset: 0 },\n // length → base cm\n cm: { id: 'cm', category: 'length', factor: 1, offset: 0 },\n m: { id: 'm', category: 'length', factor: 100, offset: 0 },\n in: { id: 'in', category: 'length', factor: 2.54, offset: 0 },\n ft: { id: 'ft', category: 'length', factor: 30.48, offset: 0 },\n // temperature → base °C (affine: °C = °F·5/9 − 32·5/9)\n c: { id: 'c', category: 'temperature', factor: 1, offset: 0 },\n f: { id: 'f', category: 'temperature', factor: 5 / 9, offset: (-32 * 5) / 9 },\n // glucose → base mmol/L (1 mg/dL = 1/18.0156 mmol/L)\n mmol_l: { id: 'mmol_l', category: 'glucose', factor: 1, offset: 0 },\n mg_dl: { id: 'mg_dl', category: 'glucose', factor: 1 / 18.0156, offset: 0 },\n};\n\nexport const UNITS_BY_CATEGORY: Record<UnitCategory, string[]> = {\n weight: ['kg', 'g', 'lb', 'oz'],\n length: ['cm', 'm', 'in', 'ft'],\n temperature: ['c', 'f'],\n glucose: ['mmol_l', 'mg_dl'],\n};\n\nexport const CATEGORIES: UnitCategory[] = [\n 'weight',\n 'length',\n 'temperature',\n 'glucose',\n];\n\n/**\n * Convert `value` from one unit to another. Both ids must belong to the same\n * category; mismatched categories throw (a programming error, not user input).\n */\nexport function convertUnits(\n value: number,\n fromId: string,\n toId: string,\n): number {\n const from = UNITS[fromId];\n const to = UNITS[toId];\n if (!from || !to) throw new Error(`Unknown unit: ${fromId} → ${toId}`);\n if (from.category !== to.category) {\n throw new Error(\n `Cannot convert across categories: ${from.category} → ${to.category}`,\n );\n }\n const base = value * from.factor + from.offset;\n return (base - to.offset) / to.factor;\n}\n","/* ------------------------------------------------------------------ */\n/* UnitConverter — generic clinical/everyday unit conversion across */\n/* weight, length, temperature and glucose. */\n/* */\n/* Maths lives in `./units` (pure, separately tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { unitConverterAgent } from './unit-converter.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { Select } from '../select';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type UnitCategory,\n CATEGORIES,\n UNITS_BY_CATEGORY,\n convertUnits,\n} from './units';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/**\n * DS token NAME backing the result-card category chip, one per measurement\n * family. The converter shows no on-screen badge, but the inserted card carries\n * a category chip so the reader can tell at a glance which family the figure\n * belongs to; each token is a closed-palette semantic alias resolved to a\n * concrete colour at raster time by `InsertButton`.\n */\nconst CATEGORY_HIGHLIGHT_TOKEN: Record<UnitCategory, string> = {\n weight: '--info',\n length: '--success',\n temperature: '--warning-readable',\n glucose: '--accent',\n};\n\n/**\n * Category chip token. The `temperature` family resolves to `--warning-readable`,\n * which the result card's colour probe resolves in the live themed DOM: orange-600\n * in light, non-accessible mode (where bare `--warning` yellow only reaches\n * ~3.2:1 on the white card) and `--warning` elsewhere, whose deepened ramp already\n * clears contrast. Resolving the token NAME at the card means the choice tracks\n * the live theme regardless of where the theme class lives. Other families are\n * unchanged.\n */\nfunction categoryHighlightToken(category: UnitCategory): string {\n return CATEGORY_HIGHLIGHT_TOKEN[category];\n}\n\nexport interface UnitConverterProps extends VariantProps<typeof rootVariants> {\n /** Initial category. Defaults to `'weight'`. */\n defaultCategory?: UnitCategory;\n /** Fires with the converted value (and `null` when input is empty). */\n onResultChange?: (value: number | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads/writes the\n * structural inputs (category, value, from/to units) and the converted result.\n * No patient identity. Consumed by the `unit-converter.agent.ts` adapter; the\n * public `ref` stays the DOM element.\n */\nexport interface UnitConverterHandle {\n /** Active measurement family. */\n getCategory: () => UnitCategory;\n /** Switch the measurement family (resets from/to units to that category). */\n setCategory: (next: UnitCategory) => void;\n /** Source value + from/to unit ids. */\n getInputs: () => { value: number | null; fromId: string; toId: string };\n /** Set the source value to convert. */\n setValue: (value: number | null) => void;\n /** Set from-unit and/or to-unit (ids outside the active category are ignored). */\n setUnits: (next: { fromId?: string; toId?: string }) => void;\n /** Converted value in the to-unit, or null when no source value is set. */\n getResult: () => number | null;\n}\n\nexport const UnitConverter = forwardRef<HTMLDivElement, UnitConverterProps>(\n (\n {\n defaultCategory = 'weight',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [category, setCategory] = useState<UnitCategory>(defaultCategory);\n const [value, setValue] = useState<number | null>(null);\n const [fromId, setFromId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][0],\n );\n const [toId, setToId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][1],\n );\n\n const handleCategoryChange = (next: string): void => {\n const cat = next as UnitCategory;\n const units = UNITS_BY_CATEGORY[cat];\n setCategory(cat);\n setFromId(units[0]);\n setToId(units[1] ?? units[0]);\n };\n\n const converted = useMemo(\n () => (value === null ? null : convertUnits(value, fromId, toId)),\n [value, fromId, toId],\n );\n\n const numberFmt = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 3 }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(converted);\n }, [converted, onResultChange]);\n\n // Live refs so the once-built agent handle reads/writes current state\n // without re-creating on every keystroke. Public `ref` stays the DOM node.\n const liveRef = useRef({ category, value, fromId, toId, converted });\n liveRef.current = { category, value, fromId, toId, converted };\n const agentHandle = useMemo<UnitConverterHandle>(\n () => ({\n getCategory: () => liveRef.current.category,\n setCategory: (next) => handleCategoryChange(next),\n getInputs: () => ({\n value: liveRef.current.value,\n fromId: liveRef.current.fromId,\n toId: liveRef.current.toId,\n }),\n setValue: (next) => setValue(next),\n setUnits: (next) => {\n const units = UNITS_BY_CATEGORY[liveRef.current.category];\n if (next.fromId !== undefined && units.includes(next.fromId)) {\n setFromId(next.fromId);\n }\n if (next.toId !== undefined && units.includes(next.toId)) {\n setToId(next.toId);\n }\n },\n getResult: () => liveRef.current.converted,\n }),\n [],\n );\n useAgentRegistration(unitConverterAgent, agentHandle, id);\n\n const categoryOptions = CATEGORIES.map((c) => ({\n value: c,\n label: t(`unitConverter.category.${c}`),\n }));\n const unitOptions = UNITS_BY_CATEGORY[category].map((u) => ({\n value: u,\n label: t(`unitConverter.units.${u}`),\n }));\n\n return (\n <div\n ref={ref}\n data-component=\"unit-converter\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <FormField label={t('unitConverter.categoryLabel')}>\n <Select\n options={categoryOptions}\n value={category}\n onValueChange={handleCategoryChange}\n />\n </FormField>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <FormField label={t('unitConverter.value')}>\n <NumberInput mode=\"decimal\" value={value} onChange={setValue} />\n </FormField>\n <FormField label={t('unitConverter.from')}>\n <Select\n options={unitOptions}\n value={fromId}\n onValueChange={setFromId}\n />\n </FormField>\n <FormField label={t('unitConverter.to')}>\n <Select\n options={unitOptions}\n value={toId}\n onValueChange={setToId}\n />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {converted !== null\n ? `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )} = ${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`\n : ''}\n </p>\n\n {converted !== null ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-muted-foreground\">\n {t('unitConverter.result')}\n </span>\n <span className=\"type-metric ds:text-foreground\">\n {numberFmt.format(converted)} {t(`unitConverter.units.${toId}`)}\n </span>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.unitConverter'),\n icon: 'ruler',\n highlight: t(`unitConverter.category.${category}`),\n // Chip tints by measurement family so the inserted card\n // signals the category at a glance — with the contrast-safe\n // orange override for the `--warning` temperature family.\n highlightToken: categoryHighlightToken(category),\n brand: insertBrand,\n fields: [\n {\n // Source measurement → ruler glyph (matches the header).\n icon: 'ruler',\n label: t('unitConverter.from'),\n value: `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )}`,\n },\n {\n // Converted result → trending-up (arrow) glyph signals the\n // conversion direction to the output value.\n icon: 'trending-up',\n label: t('unitConverter.to'),\n value: `${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`,\n },\n ],\n }}\n />\n ) : null}\n </div>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('unitConverter.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nUnitConverter.displayName = 'UnitConverter';\n"],"names":["CATEGORIES","unitConverterAgent","handle","args","UNITS","UNITS_BY_CATEGORY","convertUnits","value","fromId","toId","from","to","rootVariants","cva","CATEGORY_HIGHLIGHT_TOKEN","categoryHighlightToken","category","UnitConverter","forwardRef","defaultCategory","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","i18n","useTranslation","setCategory","useState","setValue","setFromId","setToId","handleCategoryChange","next","cat","units","converted","useMemo","numberFmt","useEffect","liveRef","useRef","agentHandle","useAgentRegistration","categoryOptions","c","unitOptions","u","jsxs","jsx","FormField","Select","NumberInput","InsertButton"],"mappings":";;;;;;;;;AAoBA,MAAMA,IAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,aAAa,aAAa;AAAA,EACzC,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,IAEvC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM,CAAC,UAAU,MAAM;AAAA,YACvB,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YA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rB,CAAI,EAAE;AAAA,YAAA,GAChE;AAAA,YACCa,MAAkB,UAAUD,IAC3B,gBAAAkC;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,SAASrC;AAAA,gBACT,UAAAD;AAAA,gBACA,QAAAE;AAAA,gBACA,SAAAC;AAAA,gBACA,MAAM;AAAA,kBACJ,OAAOM,EAAE,4BAA4B;AAAA,kBACrC,MAAM;AAAA,kBACN,WAAWA,EAAE,0BAA0Bd,CAAQ,EAAE;AAAA;AAAA;AAAA;AAAA,kBAIjD,gBAAgBD,EAAuBC,CAAQ;AAAA,kBAC/C,OAAOS;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA;AAAA,sBAEE,MAAM;AAAA,sBACN,OAAOK,EAAE,oBAAoB;AAAA,sBAC7B,OAAO,GAAGc,EAAU,OAAOrC,KAAS,CAAC,CAAC,IAAIuB;AAAA,wBACxC,uBAAuBtB,CAAM;AAAA,sBAAA,CAC9B;AAAA,oBAAA;AAAA,oBAEH;AAAA;AAAA;AAAA,sBAGE,MAAM;AAAA,sBACN,OAAOsB,EAAE,kBAAkB;AAAA,sBAC3B,OAAO,GAAGc,EAAU,OAAOF,CAAS,CAAC,IAAIZ;AAAA,wBACvC,uBAAuBrB,CAAI;AAAA,sBAAA,CAC5B;AAAA,oBAAA;AAAA,kBACH;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,GACN,IAEA,gBAAA8C,EAAC,KAAA,EAAE,WAAU,sCACV,UAAAzB,EAAE,qBAAqB,EAAA,CAC1B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAb,GAAc,cAAc;"}
@@ -4,7 +4,7 @@ import { c as j } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as M } from "react-i18next";
5
5
  import { C } from "./card-DPmk26CL.js";
6
6
  import { B as ye } from "./badge-sTusUqZD.js";
7
- import { a as Z } from "./key-value-pair-BubG4fUa.js";
7
+ import { a as Z } from "./key-value-pair-BIBdZBLg.js";
8
8
  import { T as xe } from "./timestamp-BV2lC-wV.js";
9
9
  import { I as S } from "./icon-button-DA2CAGHZ.js";
10
10
  import { P as U } from "./pencil-B1sKKyuT.js";
@@ -1353,4 +1353,4 @@ export {
1353
1353
  ee as r,
1354
1354
  L as w
1355
1355
  };
1356
- //# sourceMappingURL=workflow-map-DE_ribRM.js.map
1356
+ //# sourceMappingURL=workflow-map-wcw3t6g4.js.map