@alfadocs/ui-kit-debug 1.54.1 → 1.54.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-fields-1pD-8hML.js → address-fields-BaClzQLM.js} +5 -5
- package/dist/_chunks/{address-fields-1pD-8hML.js.map → address-fields-BaClzQLM.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BMjSBqhS.js → anamnesis-summary-rows-Brru7JrH.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-BMjSBqhS.js.map → anamnesis-summary-rows-Brru7JrH.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-BDX1Krdv.js → balance-badge-cell-C5hmahoB.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-BDX1Krdv.js.map → balance-badge-cell-C5hmahoB.js.map} +1 -1
- package/dist/_chunks/{bishop-score-CGAVpIWL.js → bishop-score-BzvVol-u.js} +2 -2
- package/dist/_chunks/{bishop-score-CGAVpIWL.js.map → bishop-score-BzvVol-u.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-g_wjo4nq.js → bmi-calculator-CDmQk0b5.js} +2 -2
- package/dist/_chunks/{bmi-calculator-g_wjo4nq.js.map → bmi-calculator-CDmQk0b5.js.map} +1 -1
- package/dist/_chunks/{booking-BN7TXe27.js → booking-BGY3LUi8.js} +5 -5
- package/dist/_chunks/{booking-BN7TXe27.js.map → booking-BGY3LUi8.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-BbZIx2PT.js → calendar-workspace-BJPhMb2c.js} +8 -8
- package/dist/_chunks/{calendar-workspace-BbZIx2PT.js.map → calendar-workspace-BJPhMb2c.js.map} +1 -1
- package/dist/_chunks/{city-input-DyxVWSRQ.js → city-input-BL5WsGJ3.js} +2 -2
- package/dist/_chunks/{city-input-DyxVWSRQ.js.map → city-input-BL5WsGJ3.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-CwDEdmda.js → cycle-calculator-LjsQd9Gl.js} +2 -2
- package/dist/_chunks/{cycle-calculator-CwDEdmda.js.map → cycle-calculator-LjsQd9Gl.js.map} +1 -1
- package/dist/_chunks/{data-table-DeUoJzNn.js → data-table-BErtJzaT.js} +2 -2
- package/dist/_chunks/{data-table-DeUoJzNn.js.map → data-table-BErtJzaT.js.map} +1 -1
- package/dist/_chunks/{data-table-tabs-BfEmXvUk.js → data-table-tabs-D5nFZKxg.js} +2 -2
- package/dist/_chunks/{data-table-tabs-BfEmXvUk.js.map → data-table-tabs-D5nFZKxg.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-_0Dz_d7n.js → due-date-calculator-mDvGKmRV.js} +2 -2
- package/dist/_chunks/{due-date-calculator-_0Dz_d7n.js.map → due-date-calculator-mDvGKmRV.js.map} +1 -1
- package/dist/_chunks/{email-input-Cmeo4zdT.js → email-input-DQixfopu.js} +2 -2
- package/dist/_chunks/{email-input-Cmeo4zdT.js.map → email-input-DQixfopu.js.map} +1 -1
- package/dist/_chunks/error-page-C15GfNEj.js +312 -0
- package/dist/_chunks/error-page-C15GfNEj.js.map +1 -0
- package/dist/_chunks/{error-page-illustration-QGJAvuFB.js → error-page-illustration-bFti0VEc.js} +73 -56
- package/dist/_chunks/error-page-illustration-bFti0VEc.js.map +1 -0
- package/dist/_chunks/{face-scheme-pZgT26gB.js → face-scheme-Doodi6A6.js} +2 -2
- package/dist/_chunks/{face-scheme-pZgT26gB.js.map → face-scheme-Doodi6A6.js.map} +1 -1
- package/dist/_chunks/{fetal-weight-CbE61Uyk.js → fetal-weight-DBgEaMoJ.js} +2 -2
- package/dist/_chunks/{fetal-weight-CbE61Uyk.js.map → fetal-weight-DBgEaMoJ.js.map} +1 -1
- package/dist/_chunks/{file-manager-DdsAd4TQ.js → file-manager-BDNSnr7f.js} +3 -3
- package/dist/_chunks/{file-manager-DdsAd4TQ.js.map → file-manager-BDNSnr7f.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-DVVOBEGj.js → forgot-password-form-Duu3pZDU.js} +3 -3
- package/dist/_chunks/{forgot-password-form-DVVOBEGj.js.map → forgot-password-form-Duu3pZDU.js.map} +1 -1
- package/dist/_chunks/{form-field-D9WfDpYB.js → form-field-Db0liyI8.js} +72 -63
- package/dist/_chunks/form-field-Db0liyI8.js.map +1 -0
- package/dist/_chunks/form-field-context-DtiROUJV.js.map +1 -1
- package/dist/_chunks/{gestational-age-calculator-BMkoLJGR.js → gestational-age-calculator-BVBz_5dm.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-BMkoLJGR.js.map → gestational-age-calculator-BVBz_5dm.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-BtW2pBJX.js → hcg-doubling-BECrAUu3.js} +2 -2
- package/dist/_chunks/{hcg-doubling-BtW2pBJX.js.map → hcg-doubling-BECrAUu3.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-Cy-iO5AU.js → help-me-write-templates-B4Y8dBv1.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-Cy-iO5AU.js.map → help-me-write-templates-B4Y8dBv1.js.map} +1 -1
- package/dist/_chunks/{icon-picker-CSViTQL9.js → icon-picker-JZzs1ol_.js} +2 -2
- package/dist/_chunks/{icon-picker-CSViTQL9.js.map → icon-picker-JZzs1ol_.js.map} +1 -1
- package/dist/_chunks/{kit-extensions-Kca1tkfP.js → kit-extensions-GQHKTLWI.js} +6 -6
- package/dist/_chunks/{kit-extensions-Kca1tkfP.js.map → kit-extensions-GQHKTLWI.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-C7wo-Hv1.js → login-dev-card-DletSsX3.js} +5 -5
- package/dist/_chunks/{login-dev-card-C7wo-Hv1.js.map → login-dev-card-DletSsX3.js.map} +1 -1
- package/dist/_chunks/{notes-panel-BPb-2ZnJ.js → notes-panel-DWJY3WV8.js} +2 -2
- package/dist/_chunks/{notes-panel-BPb-2ZnJ.js.map → notes-panel-DWJY3WV8.js.map} +1 -1
- package/dist/_chunks/{password-input-B7pQTk7l.js → password-input-6Yl6x1IO.js} +2 -2
- package/dist/_chunks/{password-input-B7pQTk7l.js.map → password-input-6Yl6x1IO.js.map} +1 -1
- package/dist/_chunks/{patient-details-BP9r_lNS.js → patient-details-D7QlsGK1.js} +2 -2
- package/dist/_chunks/{patient-details-BP9r_lNS.js.map → patient-details-D7QlsGK1.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BK9JjbzA.js → patient-field-row-Dr-ndtG8.js} +5 -5
- package/dist/_chunks/{patient-field-row-BK9JjbzA.js.map → patient-field-row-Dr-ndtG8.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DGbRLzF1.js → patient-summary-card-A3WhxFwp.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DGbRLzF1.js.map → patient-summary-card-A3WhxFwp.js.map} +1 -1
- package/dist/_chunks/{postal-code-input-BmbqjkfD.js → postal-code-input-lCk8me6K.js} +2 -2
- package/dist/_chunks/{postal-code-input-BmbqjkfD.js.map → postal-code-input-lCk8me6K.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-DV3o2PPl.js → pregnancy-dating-BEmsMys4.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-DV3o2PPl.js.map → pregnancy-dating-BEmsMys4.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-BLjWgtS9.js → pregnancy-weight-gain-DMVPvM3a.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BLjWgtS9.js.map → pregnancy-weight-gain-DMVPvM3a.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-C4j6eoQn.js → radiograph-panel.agent-rS3Tegx6.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-C4j6eoQn.js.map → radiograph-panel.agent-rS3Tegx6.js.map} +1 -1
- package/dist/_chunks/{registration-form-CBDeXzlk.js → registration-form-Lz9iKrKo.js} +246 -235
- package/dist/_chunks/registration-form-Lz9iKrKo.js.map +1 -0
- package/dist/_chunks/{rich-text-editor-CCCSEPlG.js → rich-text-editor-DmnWavgl.js} +2 -2
- package/dist/_chunks/{rich-text-editor-CCCSEPlG.js.map → rich-text-editor-DmnWavgl.js.map} +1 -1
- package/dist/_chunks/{search-bar-D695TCDH.js → search-bar-ORcfuK9A.js} +2 -2
- package/dist/_chunks/{search-bar-D695TCDH.js.map → search-bar-ORcfuK9A.js.map} +1 -1
- package/dist/_chunks/{search-input-Tl-RkS5x.js → search-input-6SoR2Rf4.js} +2 -2
- package/dist/_chunks/{search-input-Tl-RkS5x.js.map → search-input-6SoR2Rf4.js.map} +1 -1
- package/dist/_chunks/{task-editor-Dl27rI3J.js → task-editor-i-juLk76.js} +3 -3
- package/dist/_chunks/{task-editor-Dl27rI3J.js.map → task-editor-i-juLk76.js.map} +1 -1
- package/dist/_chunks/{text-input-lZ2-t-p2.js → text-input-rzLEKhRU.js} +145 -97
- package/dist/_chunks/text-input-rzLEKhRU.js.map +1 -0
- package/dist/_chunks/{transcript-panel-CLgtyVbR.js → transcript-panel-jOCW4Ycl.js} +2 -2
- package/dist/_chunks/{transcript-panel-CLgtyVbR.js.map → transcript-panel-jOCW4Ycl.js.map} +1 -1
- package/dist/_chunks/{unit-converter-CXNr5P4J.js → unit-converter-Bvhj9r3m.js} +2 -2
- package/dist/_chunks/{unit-converter-CXNr5P4J.js.map → unit-converter-Bvhj9r3m.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-BEbLseXW.js → use-appointment-details-read-B6dBBgDa.js} +3 -3
- package/dist/_chunks/{use-appointment-details-read-BEbLseXW.js.map → use-appointment-details-read-B6dBBgDa.js.map} +1 -1
- package/dist/_chunks/use-field-match-pdbEnKvO.js.map +1 -1
- package/dist/_chunks/{widget-picker-BCbwD5Z1.js → widget-picker-Ck8HTsil.js} +2 -2
- package/dist/_chunks/{widget-picker-BCbwD5Z1.js.map → widget-picker-Ck8HTsil.js.map} +1 -1
- package/dist/agent-catalog.json +5 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/form-field/form-field-context.d.ts +5 -0
- package/dist/components/form-field/form-field-context.d.ts.map +1 -1
- package/dist/components/form-field/form-field.d.ts.map +1 -1
- package/dist/components/form-field/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/postal-code-input/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/text-input/text-input.d.ts +13 -0
- package/dist/components/text-input/text-input.d.ts.map +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/hooks/use-field-match.d.ts +3 -2
- package/dist/hooks/use-field-match.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +4 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +4 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +4 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +4 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +4 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +4 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +4 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +4 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +4 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +4 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +4 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +4 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +4 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +4 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +4 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +167 -165
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +4 -0
- package/dist/locales/de.json +4 -0
- package/dist/locales/el.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/es.json +4 -0
- package/dist/locales/fr.json +4 -0
- package/dist/locales/hi.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/locales/ja.json +4 -0
- package/dist/locales/nl.json +4 -0
- package/dist/locales/pl.json +4 -0
- package/dist/locales/pt.json +4 -0
- package/dist/locales/ro.json +4 -0
- package/dist/locales/ru.json +4 -0
- package/dist/locales/sq.json +4 -0
- package/dist/locales/sv.json +4 -0
- package/dist/locales/tr.json +4 -0
- package/dist/locales/zh.json +4 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/error-page/error-page-illustration.d.ts +3 -1
- package/dist/patterns/error-page/error-page-illustration.d.ts.map +1 -1
- package/dist/patterns/error-page/error-page.d.ts +34 -2
- package/dist/patterns/error-page/error-page.d.ts.map +1 -1
- package/dist/patterns/error-page/index.d.ts +2 -1
- package/dist/patterns/error-page/index.d.ts.map +1 -1
- package/dist/patterns/error-page/index.js +7 -5
- package/dist/patterns/error-page/index.js.map +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/registration-form/index.d.ts +1 -1
- package/dist/patterns/registration-form/index.d.ts.map +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/registration-form/registration-form.d.ts +16 -0
- package/dist/patterns/registration-form/registration-form.d.ts.map +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/error-page-CKFJlekz.js +0 -275
- package/dist/_chunks/error-page-CKFJlekz.js.map +0 -1
- package/dist/_chunks/error-page-illustration-QGJAvuFB.js.map +0 -1
- package/dist/_chunks/form-field-D9WfDpYB.js.map +0 -1
- package/dist/_chunks/registration-form-CBDeXzlk.js.map +0 -1
- package/dist/_chunks/text-input-lZ2-t-p2.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as xe, useContext as ke, useId as Ie, useRef as M, useState as m, useEffect as Ne, useCallback as d, useMemo as P } from "react";
|
|
3
3
|
import { c as N } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as Ee } from "react-i18next";
|
|
5
|
-
import { T as Te } from "./text-input-
|
|
5
|
+
import { T as Te } from "./text-input-rzLEKhRU.js";
|
|
6
6
|
import { u as Ve, F as Se } from "./form-field-context-DtiROUJV.js";
|
|
7
7
|
import { c as Le } from "./compose-refs-C0k0tdqF.js";
|
|
8
8
|
import { u as ze } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
@@ -444,4 +444,4 @@ We.displayName = "PasswordInput";
|
|
|
444
444
|
export {
|
|
445
445
|
We as P
|
|
446
446
|
};
|
|
447
|
-
//# sourceMappingURL=password-input-
|
|
447
|
+
//# sourceMappingURL=password-input-6Yl6x1IO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input-B7pQTk7l.js","sources":["../../src/components/password-input/password-input.agent.ts","../../src/components/password-input/password-input.tsx"],"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: ['set_value'],\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 argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'New password. Sensitive — never log or persist off-device.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\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 idempotent: true,\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 idempotent: true,\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 // Pure ephemeral UI state — flips the mask on/off, no data change.\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 useContext,\n useEffect,\n useId,\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 { TriangleAlert, Check, Circle, Eye, EyeOff } from 'lucide-react';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport {\n FormFieldContext,\n useFormField,\n} from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\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// Sits between a rule and its state in the text a screen reader is given.\nconst REQUIREMENT_STATE_SEPARATOR = ' \\u2014 ';\n\n/** A rule whose state the user's last edit changed. */\ninterface RequirementChange {\n id: string;\n label: string;\n met: boolean;\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\"`. The rule labels describe the input\n * (`aria-describedby`), so the rules are read on focus. When typing\n * changes a rule, a polite live region announces that whole row, rule\n * and state; nothing is announced on mount or when the value changes\n * from outside (the host or an agent). A controlled field is checked\n * against the `value` the host commits.\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 'aria-describedby': describedByProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n const effectiveDisabled = ctx.disabled || disabled;\n const requirementsId = useId();\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 value internally so the requirements checklist can\n // re-evaluate its predicates without forcing consumers to lift the\n // input into controlled state. A controlled caller's `value` wins: the\n // rules are checked against what the host committed, not what was\n // typed, so a host that rejects or rewrites an edit stays in step.\n const [internalValue, setInternalValue] = useState<string>(() =>\n typeof defaultValue === 'string' ? defaultValue : '',\n );\n const currentValue = typeof value === 'string' ? value : internalValue;\n\n // `edit` gets a new identity on each real edit. The effect below\n // announces the rules that edit changed; a value that changes any\n // other way (the host, an agent) empties the announcer instead, and\n // removals are not announced.\n const [edit, setEdit] = useState<object | null>(null);\n const handledEditRef = useRef(edit);\n const checkedValueRef = useRef(currentValue);\n const [changes, setChanges] = useState<ReadonlyArray<RequirementChange>>(\n [],\n );\n\n useEffect(() => {\n const typed = edit !== handledEditRef.current;\n handledEditRef.current = edit;\n const previous = checkedValueRef.current;\n if (currentValue === previous) return;\n checkedValueRef.current = currentValue;\n if (!typed) {\n setChanges((prev) => (prev.length > 0 ? [] : prev));\n return;\n }\n const changed = (requirements ?? []).flatMap((req) => {\n const met = req.test(currentValue);\n return met === req.test(previous)\n ? []\n : [{ id: req.id, label: req.label, met }];\n });\n if (changed.length > 0) setChanges(changed);\n }, [currentValue, edit, requirements]);\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 // A person's edit is an InputEvent; an agent or script write\n // dispatches a bare Event, which is not announced.\n if ('inputType' in event.nativeEvent) setEdit({});\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 // Leave nothing stale behind for a reader browsing the page.\n setChanges((prev) => (prev.length > 0 ? [] : prev));\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 // The id the input really has, for the toggle's `aria-controls`: read\n // from the DOM, because outside a FormField and with no `id` TextInput\n // makes its own. The known id covers the first render.\n const [renderedInputId, setRenderedInputId] = useState<string>();\n useIsomorphicLayoutEffect(() => {\n setRenderedInputId(innerInputRef.current?.id || undefined);\n });\n const inputId = renderedInputId ?? id ?? (inFormField ? ctx.id : undefined);\n\n const requirementStateText = (met: boolean) =>\n met\n ? t('inputs.password.requirements.met', 'met')\n : t('inputs.password.requirements.unmet', 'not yet met');\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(currentValue),\n })) ?? null,\n [requirements, currentValue],\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 const hasRequirements = Boolean(requirementResults?.length);\n // The input is described by the rule labels only, never their state:\n // NVDA re-reads a focused field's whole description when it changes.\n const requirementLabelId = (index: number) => `${requirementsId}-${index}`;\n // TextInput spreads props last, so a bare `aria-describedby` would\n // replace the FormField's help and error ids: merge them here.\n const describedBy =\n [\n ...new Set(\n [\n ctx.describedBy,\n describedByProp,\n ...(requirementResults ?? []).map((_, index) =>\n requirementLabelId(index),\n ),\n ]\n .join(' ')\n .split(' ')\n .filter(Boolean),\n ),\n ].join(' ') || undefined;\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 aria-describedby={describedBy}\n />\n <button\n type=\"button\"\n aria-pressed={revealed}\n aria-label={toggleLabel}\n // Two password fields give two \"Show password\" buttons: the\n // field's label tells them apart.\n aria-describedby={inFormField ? `${ctx.id}-label` : undefined}\n aria-controls={inputId}\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 // Not a live region. Each label describes the input; the\n // `.ds:sr-only` suffix gives the row's state when the list is\n // read. Changes are announced by the status element below.\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <ul\n role=\"list\"\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, index) => (\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 id={requirementLabelId(index)}>{req.label}</span>\n <span className=\"ds:sr-only\">\n {REQUIREMENT_STATE_SEPARATOR}\n {requirementStateText(req.met)}\n </span>\n </li>\n ))}\n </ul>\n ) : null}\n\n {hasRequirements ? (\n // Announces the rows the user's last edit changed, each as a\n // whole: one text node per row, so a flip re-reads the rule\n // with its state. Empty until the user types.\n <div\n aria-live=\"polite\"\n data-slot=\"password-requirements-status\"\n className=\"ds:sr-only\"\n >\n {changes.map((change) => (\n <span key={change.id} aria-atomic=\"true\" className=\"ds:block\">\n {`${change.label}${REQUIREMENT_STATE_SEPARATOR}${requirementStateText(change.met)}`}\n </span>\n ))}\n </div>\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 <TriangleAlert 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"],"names":["passwordInputAgent","handle","args","iconSizeClassBySize","toggleVariants","cva","strengthTrackVariants","strengthBarVariants","strengthLabelByLevel","requirementRowVariants","REQUIREMENT_STATE_SEPARATOR","PasswordInput","forwardRef","onRevealChange","showStrength","strength","requirements","deriveStrength","autoComplete","size","disabled","name","id","onKeyDown","onKeyUp","onBlur","onInput","defaultValue","value","className","describedByProp","rest","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","effectiveDisabled","requirementsId","useId","innerInputRef","useRef","composedRef","composeRefs","revealed","setRevealed","useState","capsLock","setCapsLock","internalValue","setInternalValue","currentValue","edit","setEdit","handledEditRef","checkedValueRef","changes","setChanges","useEffect","typed","previous","prev","changed","req","met","handleInput","useCallback","event","writeValueToInput","next","node","prototype","setter","_a","handleToggle","detectCaps","handleKeyDown","handleKeyUp","handleBlur","agentHandle","useMemo","useAgentRegistration","iconSizeClass","toggleLabel","renderedInputId","setRenderedInputId","useIsomorphicLayoutEffect","inputId","requirementStateText","requirementResults","derivedStrength","satisfied","r","total","effectiveStrength","strengthKey","strengthText","hasRequirements","requirementLabelId","index","describedBy","_","jsxs","jsx","TextInput","EyeOff","Eye","Check","Circle","change","TriangleAlert"],"mappings":";;;;;;;;;;;;;;AASO,MAAMA,KAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,C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wBACX,QAAA,EAAqB,eAAY,QAAO,WAAU,YAChD,UAAA,GAAGA,EAAO,KAAK,GAAGtG,CAA2B,GAAGiF,EAAqBqB,EAAO,GAAG,CAAC,MADxEA,EAAO,EAElB,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,cAED;AAAA,UAEH9D,KACC,gBAAAuD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,aAAU;AAAA,cACV,WAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAAC,EAACO,IAAA,EAAc,eAAY,QAAO,WAAU,eAAc;AAAA,gBACzDhF,EAAE,4BAA4B,iBAAiB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,IAEhD;AAAA,UAEHnB,IACC,gBAAA2F,EAAC,OAAA,EAAI,WAAU,kDACb,UAAA;AAAA,YAAA,gBAAAC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,iBAAeT;AAAA,gBACf,iBAAe;AAAA,gBACf,iBAAe;AAAA,gBACf,cAAYhE;AAAA,kBACV;AAAA,kBACA;AAAA,gBAAA;AAAA,gBAEF,kBAAgBkE;AAAA,gBAChB,WAAW7F,GAAA;AAAA,gBAEX,UAAA,gBAAAoG;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWnG,GAAoB,EAAE,OAAO0F,GAAmB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAC7D;AAAA,YAAA;AAAA,YAEF,gBAAAS;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,eAAY;AAAA,gBACZ,WAAU;AAAA,gBAET,UAAAP;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CACF,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAxF,GAAc,cAAc;"}
|
|
1
|
+
{"version":3,"file":"password-input-6Yl6x1IO.js","sources":["../../src/components/password-input/password-input.agent.ts","../../src/components/password-input/password-input.tsx"],"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: ['set_value'],\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 argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'New password. Sensitive — never log or persist off-device.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\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 idempotent: true,\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 idempotent: true,\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 // Pure ephemeral UI state — flips the mask on/off, no data change.\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 useContext,\n useEffect,\n useId,\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 { TriangleAlert, Check, Circle, Eye, EyeOff } from 'lucide-react';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport {\n FormFieldContext,\n useFormField,\n} from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\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// Sits between a rule and its state in the text a screen reader is given.\nconst REQUIREMENT_STATE_SEPARATOR = ' \\u2014 ';\n\n/** A rule whose state the user's last edit changed. */\ninterface RequirementChange {\n id: string;\n label: string;\n met: boolean;\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\"`. The rule labels describe the input\n * (`aria-describedby`), so the rules are read on focus. When typing\n * changes a rule, a polite live region announces that whole row, rule\n * and state; nothing is announced on mount or when the value changes\n * from outside (the host or an agent). A controlled field is checked\n * against the `value` the host commits.\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 'aria-describedby': describedByProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n const effectiveDisabled = ctx.disabled || disabled;\n const requirementsId = useId();\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 value internally so the requirements checklist can\n // re-evaluate its predicates without forcing consumers to lift the\n // input into controlled state. A controlled caller's `value` wins: the\n // rules are checked against what the host committed, not what was\n // typed, so a host that rejects or rewrites an edit stays in step.\n const [internalValue, setInternalValue] = useState<string>(() =>\n typeof defaultValue === 'string' ? defaultValue : '',\n );\n const currentValue = typeof value === 'string' ? value : internalValue;\n\n // `edit` gets a new identity on each real edit. The effect below\n // announces the rules that edit changed; a value that changes any\n // other way (the host, an agent) empties the announcer instead, and\n // removals are not announced.\n const [edit, setEdit] = useState<object | null>(null);\n const handledEditRef = useRef(edit);\n const checkedValueRef = useRef(currentValue);\n const [changes, setChanges] = useState<ReadonlyArray<RequirementChange>>(\n [],\n );\n\n useEffect(() => {\n const typed = edit !== handledEditRef.current;\n handledEditRef.current = edit;\n const previous = checkedValueRef.current;\n if (currentValue === previous) return;\n checkedValueRef.current = currentValue;\n if (!typed) {\n setChanges((prev) => (prev.length > 0 ? [] : prev));\n return;\n }\n const changed = (requirements ?? []).flatMap((req) => {\n const met = req.test(currentValue);\n return met === req.test(previous)\n ? []\n : [{ id: req.id, label: req.label, met }];\n });\n if (changed.length > 0) setChanges(changed);\n }, [currentValue, edit, requirements]);\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 // A person's edit is an InputEvent; an agent or script write\n // dispatches a bare Event, which is not announced.\n if ('inputType' in event.nativeEvent) setEdit({});\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 // Leave nothing stale behind for a reader browsing the page.\n setChanges((prev) => (prev.length > 0 ? [] : prev));\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 // The id the input really has, for the toggle's `aria-controls`: read\n // from the DOM, because outside a FormField and with no `id` TextInput\n // makes its own. The known id covers the first render.\n const [renderedInputId, setRenderedInputId] = useState<string>();\n useIsomorphicLayoutEffect(() => {\n setRenderedInputId(innerInputRef.current?.id || undefined);\n });\n const inputId = renderedInputId ?? id ?? (inFormField ? ctx.id : undefined);\n\n const requirementStateText = (met: boolean) =>\n met\n ? t('inputs.password.requirements.met', 'met')\n : t('inputs.password.requirements.unmet', 'not yet met');\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(currentValue),\n })) ?? null,\n [requirements, currentValue],\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 const hasRequirements = Boolean(requirementResults?.length);\n // The input is described by the rule labels only, never their state:\n // NVDA re-reads a focused field's whole description when it changes.\n const requirementLabelId = (index: number) => `${requirementsId}-${index}`;\n // TextInput spreads props last, so a bare `aria-describedby` would\n // replace the FormField's help and error ids: merge them here.\n const describedBy =\n [\n ...new Set(\n [\n ctx.describedBy,\n describedByProp,\n ...(requirementResults ?? []).map((_, index) =>\n requirementLabelId(index),\n ),\n ]\n .join(' ')\n .split(' ')\n .filter(Boolean),\n ),\n ].join(' ') || undefined;\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 aria-describedby={describedBy}\n />\n <button\n type=\"button\"\n aria-pressed={revealed}\n aria-label={toggleLabel}\n // Two password fields give two \"Show password\" buttons: the\n // field's label tells them apart.\n aria-describedby={inFormField ? `${ctx.id}-label` : undefined}\n aria-controls={inputId}\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 // Not a live region. Each label describes the input; the\n // `.ds:sr-only` suffix gives the row's state when the list is\n // read. Changes are announced by the status element below.\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <ul\n role=\"list\"\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, index) => (\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 id={requirementLabelId(index)}>{req.label}</span>\n <span className=\"ds:sr-only\">\n {REQUIREMENT_STATE_SEPARATOR}\n {requirementStateText(req.met)}\n </span>\n </li>\n ))}\n </ul>\n ) : null}\n\n {hasRequirements ? (\n // Announces the rows the user's last edit changed, each as a\n // whole: one text node per row, so a flip re-reads the rule\n // with its state. Empty until the user types.\n <div\n aria-live=\"polite\"\n data-slot=\"password-requirements-status\"\n className=\"ds:sr-only\"\n >\n {changes.map((change) => (\n <span key={change.id} aria-atomic=\"true\" className=\"ds:block\">\n {`${change.label}${REQUIREMENT_STATE_SEPARATOR}${requirementStateText(change.met)}`}\n </span>\n ))}\n </div>\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 <TriangleAlert 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"],"names":["passwordInputAgent","handle","args","iconSizeClassBySize","toggleVariants","cva","strengthTrackVariants","strengthBarVariants","strengthLabelByLevel","requirementRowVariants","REQUIREMENT_STATE_SEPARATOR","PasswordInput","forwardRef","onRevealChange","showStrength","strength","requirements","deriveStrength","autoComplete","size","disabled","name","id","onKeyDown","onKeyUp","onBlur","onInput","defaultValue","value","className","describedByProp","rest","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","effectiveDisabled","requirementsId","useId","innerInputRef","useRef","composedRef","composeRefs","revealed","setRevealed","useState","capsLock","setCapsLock","internalValue","setInternalValue","currentValue","edit","setEdit","handledEditRef","checkedValueRef","changes","setChanges","useEffect","typed","previous","prev","changed","req","met","handleInput","useCallback","event","writeValueToInput","next","node","prototype","setter","_a","handleToggle","detectCaps","handleKeyDown","handleKeyUp","handleBlur","agentHandle","useMemo","useAgentRegistration","iconSizeClass","toggleLabel","renderedInputId","setRenderedInputId","useIsomorphicLayoutEffect","inputId","requirementStateText","requirementResults","derivedStrength","satisfied","r","total","effectiveStrength","strengthKey","strengthText","hasRequirements","requirementLabelId","index","describedBy","_","jsxs","jsx","TextInput","EyeOff","Eye","Check","Circle","change","TriangleAlert"],"mappings":";;;;;;;;;;;;;;AASO,MAAMA,KAAwD;AAAA,EACnE,IAAI;AAAA,EACJ,cAAc,CAAC,WAAW;AAAA,EAC1B,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,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM;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nB,IACC,gBAAA2F,EAAC,OAAA,EAAI,WAAU,kDACb,UAAA;AAAA,YAAA,gBAAAC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,iBAAeT;AAAA,gBACf,iBAAe;AAAA,gBACf,iBAAe;AAAA,gBACf,cAAYhE;AAAA,kBACV;AAAA,kBACA;AAAA,gBAAA;AAAA,gBAEF,kBAAgBkE;AAAA,gBAChB,WAAW7F,GAAA;AAAA,gBAEX,UAAA,gBAAAoG;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWnG,GAAoB,EAAE,OAAO0F,GAAmB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAC7D;AAAA,YAAA;AAAA,YAEF,gBAAAS;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,eAAY;AAAA,gBACZ,WAAU;AAAA,gBAET,UAAAP;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CACF,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAxF,GAAc,cAAc;"}
|
|
@@ -8,7 +8,7 @@ import { C as ie, b as te, a as se } from "./collapsible-CTjxzGuF.js";
|
|
|
8
8
|
import { D as ae } from "./description-list-BKQMUiXv.js";
|
|
9
9
|
import { P as de } from "./panel-header-D_mTdhUp.js";
|
|
10
10
|
import { u as re } from "./registry-DvAUVLHh.js";
|
|
11
|
-
import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-
|
|
11
|
+
import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-Dr-ndtG8.js";
|
|
12
12
|
import { C as pe } from "./clipboard-list-rSzfIYZB.js";
|
|
13
13
|
const me = {
|
|
14
14
|
id: "patient-details",
|
|
@@ -368,4 +368,4 @@ export {
|
|
|
368
368
|
ue as P,
|
|
369
369
|
me as p
|
|
370
370
|
};
|
|
371
|
-
//# sourceMappingURL=patient-details-
|
|
371
|
+
//# sourceMappingURL=patient-details-D7QlsGK1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-details-BP9r_lNS.js","sources":["../../src/components/patient-details/patient-details.agent.ts","../../src/components/patient-details/patient-details.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { PatientDetailsHandle } from './patient-details';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientDetails */\n/* */\n/* Exposes the patient panel to a future MCP runtime: */\n/* - VIEW CONFIG (safety: write) — show/hide + reorder the visible */\n/* field set. These mutate the user's view, not the patient record. */\n/* - PHI WRITE (safety: phi) — `update_field` writes a patient field */\n/* value. It is the ONLY PHI mutation and routes through the same */\n/* `onFieldSave` path as a human inline edit, so the consumer's */\n/* permission + validation + audit are the single write authority. */\n/* `phi` (not `write`) forces the runtime's confirm-before-act gate. */\n/* */\n/* STATE exposes only field KEYS (`visibleFieldOrder`) and an opaque */\n/* `patientId` — never a field value or patient identity (PRS §Security, */\n/* 26-agent-readiness §6.1/§7). */\n/* -------------------------------------------------------------------- */\n\nexport const patientDetailsAgent: AgentAdapter<PatientDetailsHandle> = {\n id: 'patient-details',\n // `view_change` backs the view-config actions (show/hide + reorder are both\n // view reconfigurations); `set_value` backs the single-value `update_field`\n // (not `edit_inline`, which is for granular free-text/formatting edits).\n capabilities: ['view_change', 'set_value'],\n state: {\n visibleFieldOrder: {\n type: 'string[]',\n descriptionKey: 'ui.agent.patientDetails.state.visibleFieldOrder',\n description:\n 'Ordered list of visible field KEYS (e.g. \"fiscalCode\"). Never a field value.',\n read: (handle) => handle.getVisibleFieldOrder(),\n },\n patientId: {\n type: 'string | undefined',\n descriptionKey: 'ui.agent.patientDetails.state.patientId',\n description:\n 'Opaque patient id the panel is bound to. No patient-identifiable data.',\n read: (handle) => handle.getPatientId(),\n },\n },\n actions: {\n set_visible_fields: {\n safety: 'write',\n argsType: '{ fieldIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['fieldIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setVisibleFields',\n description:\n 'Set which fields are visible (and their order). Unknown ids are ignored.',\n examples: [\n {\n args: { fieldIds: ['lastName', 'firstName', 'phone', 'email'] },\n note: 'Show only name + contact fields.',\n },\n ],\n invoke: (handle, args: { fieldIds: string[] }) => {\n handle.setVisibleFields(args.fieldIds);\n },\n },\n set_field_order: {\n safety: 'write',\n argsType: '{ orderedIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n orderedIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['orderedIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setFieldOrder',\n description:\n 'Reorder the visible fields. Order within a section is honoured; sections stay fixed.',\n invoke: (handle, args: { orderedIds: string[] }) => {\n handle.setFieldOrder(args.orderedIds);\n },\n },\n update_field: {\n // PHI: mutates a patient-identifiable value. NOT `write` — the runtime\n // must confirm + audit. Routes through `onFieldSave` (server write).\n safety: 'phi',\n openWorld: true,\n argsType: '{ fieldId: string; value: unknown }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldId: { type: 'string' },\n value: {},\n },\n required: ['fieldId', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.updateField',\n description:\n \"Write a patient field value via the consumer's audited save path. Subject to the same permissions and validation as a human edit.\",\n errors: ['no-save-handler', 'validation-failed', 'permission-denied'],\n examples: [\n {\n args: { fieldId: 'job', value: 'Architect' },\n note: 'Update the patient’s occupation.',\n },\n ],\n invoke: (handle, args: { fieldId: string; value: unknown }) =>\n handle.updateField(args.fieldId, args.value),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-details',\n description: 'Marks the PatientDetails root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific panel.',\n },\n item: {\n attr: 'data-field-id',\n description:\n 'Stable field KEY on each row. Never the field value (no PHI in the DOM hook).',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useId,\n useMemo,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ClipboardList } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Card } from '../card/card';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { DescriptionList } from '../description-list/description-list';\nimport { PanelHeader } from '../panel-header/panel-header';\nimport { useAgentRegistration } from '../../agent/registry';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldEditType,\n type PatientFieldEditValue,\n type PatientFieldOption,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport { PatientFieldRow } from '../_shared/patient-field-row';\nimport { patientDetailsAgent } from './patient-details.agent';\n\n/* -------------------------------------------------------------------- */\n/* PatientDetails */\n/* */\n/* The customizable, inline-editable patient record panel — the kit's */\n/* replacement for platform's hardcoded, per-user-identical patient */\n/* \"scheda paziente\" table. Mounts as a CONTEXTUAL tool in the Control */\n/* Room rail (a separate tool from EntitySummary, the AI brief). */\n/* */\n/* Boundaries (PRS §Security + 26-agent-readiness §PHI): */\n/* - DATA-IN for values: the consumer maps DoctorPatient → sections. */\n/* The kit owns the layout, the cog field-picker, i18n & theming. */\n/* - PERSISTENCE-OUT: the cog emits `onVisibleFieldsChange`; the */\n/* consumer persists the user's chosen ordered field set (platform: */\n/* a per-user × per-practice JSON column). */\n/* - WRITE-OUT: inline edits AND the agent's `update_field` BOTH route */\n/* through the single `onFieldSave` callback, so platform's */\n/* permission + validation + audit path is the only write channel. */\n/* - DOM hooks + agent state carry only field KEYS and an opaque */\n/* `patientId` — never a field VALUE / patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:flex ds:flex-col ds:text-[color:var(--foreground)]',\n {\n variants: {\n // `compact` (default) suits the narrow rail panel; `comfortable`\n // relaxes spacing for a wider host (a full-width profile page).\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n },\n);\n\n// The scrolling body sits BELOW the shared PanelHeader (which owns the title\n// row + divider + its own top/side padding). The header is full-bleed at the\n// top of the scroll region; the body carries the panel's content padding.\nconst bodyVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-md)]', {\n variants: {\n density: {\n comfortable: 'ds:p-[var(--spacing-md)]',\n compact: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* */\n/* The field model is the shared `_shared/patient-fields` vocabulary, so */\n/* PatientDetails and PatientSummaryCard speak ONE field language. The */\n/* visible set + order are a PER-CONTEXT preference the consumer owns and */\n/* wires per placement — never a single value synced across surfaces. The */\n/* `PatientDetails*` names below are kept as aliases for back-compat. */\n/* -------------------------------------------------------------------- */\n\nexport type {\n PatientField,\n PatientFieldSection,\n PatientFieldOption,\n PatientFieldEditType,\n PatientFieldEditValue,\n} from '../_shared/patient-fields';\n\n/** A label→value patient field. Alias of the shared {@link PatientField}. */\nexport type PatientDetailsField = PatientField;\n/** A labelled, collapsible group of fields. Alias of {@link PatientFieldSection}. */\nexport type PatientDetailsSection = PatientFieldSection;\n/** Alias of the shared {@link PatientFieldOption}. */\nexport type PatientDetailsFieldOption = PatientFieldOption;\n/** Alias of the shared {@link PatientFieldEditType}. */\nexport type PatientDetailsEditType = PatientFieldEditType;\n/** Alias of the shared {@link PatientFieldEditValue}. */\nexport type PatientDetailsEditValue = PatientFieldEditValue;\n\n/**\n * Imperative handle the agent adapter drives. Exposes only field KEYS and\n * an opaque `patientId` for reads; `updateField` routes writes through the\n * same `onFieldSave` path as a human inline edit (no second channel).\n */\nexport interface PatientDetailsHandle {\n /** The current ordered list of visible field ids. */\n getVisibleFieldOrder: () => string[];\n /** Opaque patient id (no PHI). */\n getPatientId: () => string | undefined;\n /** Replace the visible set, preserving the given order (filtered to known fields). */\n setVisibleFields: (fieldIds: string[]) => void;\n /** Replace the full ordered visible list (filtered to known fields). */\n setFieldOrder: (orderedIds: string[]) => void;\n /** Write a field value — delegates to `onFieldSave`. Rejects if no handler. */\n updateField: (fieldId: string, value: unknown) => Promise<void>;\n}\n\nexport interface PatientDetailsProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /** Patient display name — the panel heading. */\n title: ReactNode;\n /** The sectioned field catalogue (consumer-mapped from DoctorPatient). */\n sections: PatientDetailsSection[];\n /**\n * Header avatar photo / initials override. The panel always fronts the name\n * with an Avatar — initials derive from a string `title` by default; pass\n * `src` for a photo, or `name` to override the initials source.\n */\n avatar?: { src?: string; name?: string };\n /** At-a-glance chips under the name (consumer-composed Badge/Tag/Chip row). */\n headerChips?: ReactNode;\n\n /* ----- inline editing (kit-owned controls, consumer-owned write) ----- */\n\n /**\n * Frame the identity header and each section in its own elevated `Card`,\n * for a \"control-room\" rail that reads as a stack of cards rather than one\n * flat panel. Default `false` (the flat panel with a header rule + eyebrow\n * section headings). When framed, the header rule is dropped — the cards\n * provide the separation.\n */\n framed?: boolean;\n /** Master switch — show edit affordances on `editable` fields. */\n editable?: boolean;\n /**\n * Persist a field edit. Resolve ⇒ committed; reject(Error) ⇒ the message\n * is shown inline and the row stays in edit mode. Also the single channel\n * the agent's `update_field` uses.\n */\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n /** Domain validation — return an error message, or `null` when valid. */\n validate?: (fieldId: string, value: unknown) => string | null;\n\n /* ----- customization (the cog; controlled OR uncontrolled) ----- */\n\n /**\n * Controlled ordered list of visible field ids. `undefined` ⇒ every field\n * visible; an explicit `[]` ⇒ none (a panel that starts collapsed).\n */\n visibleFieldOrder?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field visible, in declaration order. */\n defaultVisibleFieldOrder?: string[];\n /** Fired whenever the user shows/hides/reorders fields via the cog. */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- states ----- */\n\n /** Render the loading skeleton. */\n loading?: boolean;\n /** Shown when there are no sections / no patient. Defaults to a localised hint. */\n emptyState?: ReactNode;\n\n /* ----- agent / a11y ----- */\n\n /** Opaque patient id — emitted as `data-patient-id` + agent stateRead. No PHI. */\n patientId?: string;\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /** BCP-47 locale override (currency / number editors). */\n locale?: string;\n /** Override the cog trigger's accessible name. */\n cogLabel?: string;\n /**\n * Visible panel-chrome heading (the sticky PanelHeader title). Defaults\n * to the kit's localised \"Patient details\". Pass an app-translated\n * string when the panel fronts a different record built from the same\n * chrome — \"Appointment details\", \"Task details\" — so the header names\n * what is actually shown. Also the `aria-label` fallback.\n */\n panelTitle?: string;\n /** Override the panel region's accessible name (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientDetails = forwardRef<HTMLElement, PatientDetailsProps>(\n function PatientDetails(\n {\n title,\n sections,\n avatar,\n headerChips,\n framed = false,\n editable = false,\n onFieldSave,\n validate,\n visibleFieldOrder,\n defaultVisibleFieldOrder,\n onVisibleFieldsChange,\n loading = false,\n emptyState,\n patientId,\n id,\n locale,\n cogLabel,\n panelTitle: panelTitleProp,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const headingId = useId();\n\n // Per-context field visibility + ordering. The order is a per-INSTANCE\n // preference the kit never persists — the consumer wires its own\n // value/onChange, so the same field vocabulary can render differently in\n // different parts of the app (see usePatientFieldVisibility).\n const {\n visible,\n catalogueIds,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset: resetToDefaults,\n } = usePatientFieldVisibility(sections, {\n value: visibleFieldOrder,\n defaultValue: defaultVisibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n /* ---- imperative handle (agent) ------------------------------- */\n\n const handle = useMemo<PatientDetailsHandle>(\n () => ({\n getVisibleFieldOrder: () => visible,\n getPatientId: () => patientId,\n setVisibleFields: (fieldIds) => setOrder(fieldIds),\n setFieldOrder: (orderedIds) => setOrder(orderedIds),\n updateField: (fieldId, value) => {\n if (!onFieldSave) {\n return Promise.reject(\n new Error('PatientDetails: no onFieldSave handler is wired.'),\n );\n }\n return onFieldSave(fieldId, value);\n },\n }),\n [visible, patientId, setOrder, onFieldSave],\n );\n useAgentRegistration(patientDetailsAgent, handle, id);\n\n /* ---- region accessible name ---------------------------------- */\n\n const panelTitle =\n panelTitleProp ??\n t('patientDetails.regionLabel', {\n defaultValue: 'Patient details',\n });\n const resolvedAriaLabel = ariaLabel ?? panelTitle;\n\n /* ---- header avatar ------------------------------------------- */\n // Parity with the card: the panel fronts the name with an Avatar (photo via\n // `avatar.src`, else initials from the name). Omitted only when `title` is a\n // non-string node and no `avatar.name` is given (nothing to derive from).\n const avatarName =\n avatar?.name ?? (typeof title === 'string' ? title : undefined);\n const showAvatar = Boolean(avatar?.src || avatarName);\n\n /* ---- loading / empty ----------------------------------------- */\n\n const hasVisible = catalogueIds.some((cid) => visible.includes(cid));\n\n if (loading) {\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-label={resolvedAriaLabel}\n aria-busy=\"true\"\n className={rootVariants({ className })}\n {...rest}\n >\n <div className={bodyVariants()}>\n <PatientDetailsSkeleton />\n </div>\n </section>\n );\n }\n\n const isEmpty = sections.length === 0 || !hasVisible;\n\n // The identity card (avatar + name + chips) is now the FIRST block of the\n // scrolling body — the shared PanelHeader owns the panel title row. The\n // name demotes to <h3> (the PanelHeader title is the <h2>).\n const identityBlock = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n {showAvatar ? (\n <Avatar\n size=\"md\"\n name={avatarName}\n src={avatar?.src}\n className=\"ds:shrink-0\"\n />\n ) : null}\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3 className=\"ds:m-0 type-title-item ds:text-[color:var(--foreground)]\">\n {title}\n </h3>\n {/* Chips sit under the NAME (not the avatar) — same column shape\n as the card's identity line. */}\n {headerChips ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {headerChips}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel ?? undefined}\n className={rootVariants({ className })}\n {...rest}\n >\n {/* The shared rail-panel header: panel title + the field-picker cog as\n its panel-owned action; the rail injects favourite/close after it.\n Sticky + divider so the title stays as the body scrolls. */}\n <PanelHeader\n title={panelTitle}\n icon={<ClipboardList aria-hidden=\"true\" />}\n headingId={headingId}\n sticky\n divider\n actions={\n <FieldVisibilityCog\n sections={sections}\n visible={visible}\n onToggleField={toggleField}\n onToggleSection={toggleSection}\n onMoveFieldOnto={moveFieldOnto}\n onReset={resetToDefaults}\n label={cogLabel}\n />\n }\n />\n\n <div className={bodyVariants()}>\n {/* Identity card — first block of the body; framed wraps it in its\n own elevated card alongside each section. */}\n {framed ? (\n <Card variant=\"elevated\">\n <Card.Body>{identityBlock}</Card.Body>\n </Card>\n ) : (\n identityBlock\n )}\n\n {/* Body — one card per section when framed, otherwise a flat stack. */}\n {isEmpty ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {emptyState ??\n t('patientDetails.empty', {\n defaultValue: 'No patient selected.',\n })}\n </p>\n ) : (\n resolveVisibleFields(sections, visible)\n // A section whose fields are all hidden drops out entirely —\n // no empty card / \"No fields shown.\" placeholder. (The field\n // picker still lists it, so hidden fields can be re-added.)\n .filter(({ fields }) => fields.length > 0)\n .map(({ section, fields }) => {\n const block = (\n <SectionBlock\n section={section}\n fields={fields}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n );\n return framed ? (\n <Card key={section.id} variant=\"elevated\">\n <Card.Body>{block}</Card.Body>\n </Card>\n ) : (\n <Fragment key={section.id}>{block}</Fragment>\n );\n })\n )}\n </div>\n </section>\n );\n },\n);\n\nPatientDetails.displayName = 'PatientDetails';\n\n/* -------------------------------------------------------------------- */\n/* SectionBlock — one collapsible group */\n/* -------------------------------------------------------------------- */\n\nfunction SectionBlock({\n section,\n fields,\n editable,\n onFieldSave,\n validate,\n locale,\n}: {\n section: PatientDetailsSection;\n fields: PatientDetailsField[];\n editable: boolean;\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n validate?: (fieldId: string, value: unknown) => string | null;\n locale?: string;\n}): ReactNode {\n const { t } = useTranslation('ui');\n const headingId = useId();\n const collapsible = section.collapsible ?? true;\n\n // The empty hint must be a SIBLING of the <dl>, never a child — a <p> is\n // not a valid direct child of <dl> (axe `definition-list`).\n const rows =\n fields.length === 0 ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('patientDetails.section.empty', {\n defaultValue: 'No fields shown.',\n })}\n </p>\n ) : (\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n divider=\"none\"\n // Label icons paint in the accent (the slot's recolour hook); no row rules.\n className=\"ds:[--description-list-icon-color:var(--accent)]\"\n >\n {fields.map((field) => (\n <PatientFieldRow\n key={field.id}\n field={field}\n // Surface the icon on the direct child: DescriptionList reserves its\n // icon column by inspecting direct children only, so the FieldRow\n // wrapper must carry it (not just the nested Row).\n icon={field.icon ?? null}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n ))}\n </DescriptionList>\n );\n\n if (!collapsible) {\n return (\n <section\n aria-labelledby={headingId}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h3\n id={headingId}\n className=\"ds:m-0 type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </h3>\n {rows}\n </section>\n );\n }\n\n return (\n <Collapsible\n defaultOpen={section.defaultOpen ?? true}\n variant=\"minimal\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n {/* Real <h3> so collapsible sections appear in the heading outline\n (the non-collapsible branch is an <h3> too); the WAI-ARIA accordion\n pattern is a heading wrapping the disclosure button. */}\n <h3 className=\"ds:m-0\">\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={headingId}\n className=\"ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)] ds:bg-transparent ds:border-0 ds:p-0 ds:text-start ds:cursor-pointer ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText] type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </button>\n </CollapsibleTrigger>\n </h3>\n <CollapsibleContent aria-labelledby={headingId}>\n {rows}\n </CollapsibleContent>\n </Collapsible>\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Skeleton */\n/* -------------------------------------------------------------------- */\n\nfunction PatientDetailsSkeleton(): ReactNode {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:size-10 ds:shrink-0 ds:rounded-full ds:bg-[color:var(--muted)]\" />\n <span className=\"ds:h-4 ds:w-1/2 ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\" />\n </div>\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"ds:h-4 ds:w-full ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\"\n />\n ))}\n </div>\n );\n}\n\n/** Density variant union re-exported for downstream typing. */\nexport type PatientDetailsDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["patientDetailsAgent","handle","args","rootVariants","cva","bodyVariants","PatientDetails","forwardRef","title","sections","avatar","headerChips","framed","editable","onFieldSave","validate","visibleFieldOrder","defaultVisibleFieldOrder","onVisibleFieldsChange","loading","emptyState","patientId","id","locale","cogLabel","panelTitleProp","ariaLabel","className","rest","ref","t","useTranslation","headingId","useId","visible","catalogueIds","setOrder","toggleField","toggleSection","moveFieldOnto","resetToDefaults","usePatientFieldVisibility","useMemo","fieldIds","orderedIds","fieldId","value","useAgentRegistration","panelTitle","resolvedAriaLabel","avatarName","showAvatar","hasVisible","cid","jsx","PatientDetailsSkeleton","isEmpty","identityBlock","jsxs","Avatar","PanelHeader","ClipboardList","FieldVisibilityCog","Card","resolveVisibleFields","fields","section","block","SectionBlock","Fragment","collapsible","rows","DescriptionList","field","PatientFieldRow","Collapsible","CollapsibleTrigger","CollapsibleContent"],"mappings":";;;;;;;;;;;;AAoBO,MAAMA,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,eAAe,WAAW;AAAA,EACzC,OAAO;AAAA,IACL,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,qBAAA;AAAA,IAAqB;AAAA,IAEhD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,EACxC;AAAA,EAEF,SAAS;AAAA,IACP,oBAAoB;AAAA,MAClB,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,UAAU,EAAE,MAAM,SAAS,OAAO,EAAE,MAAM,WAA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AA,YACC,IAAItB;AAAA,YACJ,WAAU;AAAA,YAET,UAAAkC,EAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEVK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AA8BT;AAMA,SAAShB,KAAoC;AAC3C,SACE,gBAAAG,EAAC,OAAA,EAAI,WAAU,kDACb,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,sDACb,UAAA;AAAA,MAAA,gBAAAJ,EAAC,QAAA,EAAK,WAAU,oEAAA,CAAoE;AAAA,MACpF,gBAAAA,EAAC,QAAA,EAAK,WAAU,2EAAA,CAA2E;AAAA,IAAA,GAC7F;AAAA,IACC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MACd,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAU;AAAA,MAAA;AAAA,MADL;AAAA,IAAA,CAGR;AAAA,EAAA,GACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"patient-details-D7QlsGK1.js","sources":["../../src/components/patient-details/patient-details.agent.ts","../../src/components/patient-details/patient-details.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { PatientDetailsHandle } from './patient-details';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — PatientDetails */\n/* */\n/* Exposes the patient panel to a future MCP runtime: */\n/* - VIEW CONFIG (safety: write) — show/hide + reorder the visible */\n/* field set. These mutate the user's view, not the patient record. */\n/* - PHI WRITE (safety: phi) — `update_field` writes a patient field */\n/* value. It is the ONLY PHI mutation and routes through the same */\n/* `onFieldSave` path as a human inline edit, so the consumer's */\n/* permission + validation + audit are the single write authority. */\n/* `phi` (not `write`) forces the runtime's confirm-before-act gate. */\n/* */\n/* STATE exposes only field KEYS (`visibleFieldOrder`) and an opaque */\n/* `patientId` — never a field value or patient identity (PRS §Security, */\n/* 26-agent-readiness §6.1/§7). */\n/* -------------------------------------------------------------------- */\n\nexport const patientDetailsAgent: AgentAdapter<PatientDetailsHandle> = {\n id: 'patient-details',\n // `view_change` backs the view-config actions (show/hide + reorder are both\n // view reconfigurations); `set_value` backs the single-value `update_field`\n // (not `edit_inline`, which is for granular free-text/formatting edits).\n capabilities: ['view_change', 'set_value'],\n state: {\n visibleFieldOrder: {\n type: 'string[]',\n descriptionKey: 'ui.agent.patientDetails.state.visibleFieldOrder',\n description:\n 'Ordered list of visible field KEYS (e.g. \"fiscalCode\"). Never a field value.',\n read: (handle) => handle.getVisibleFieldOrder(),\n },\n patientId: {\n type: 'string | undefined',\n descriptionKey: 'ui.agent.patientDetails.state.patientId',\n description:\n 'Opaque patient id the panel is bound to. No patient-identifiable data.',\n read: (handle) => handle.getPatientId(),\n },\n },\n actions: {\n set_visible_fields: {\n safety: 'write',\n argsType: '{ fieldIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['fieldIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setVisibleFields',\n description:\n 'Set which fields are visible (and their order). Unknown ids are ignored.',\n examples: [\n {\n args: { fieldIds: ['lastName', 'firstName', 'phone', 'email'] },\n note: 'Show only name + contact fields.',\n },\n ],\n invoke: (handle, args: { fieldIds: string[] }) => {\n handle.setVisibleFields(args.fieldIds);\n },\n },\n set_field_order: {\n safety: 'write',\n argsType: '{ orderedIds: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n orderedIds: { type: 'array', items: { type: 'string' } },\n },\n required: ['orderedIds'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.setFieldOrder',\n description:\n 'Reorder the visible fields. Order within a section is honoured; sections stay fixed.',\n invoke: (handle, args: { orderedIds: string[] }) => {\n handle.setFieldOrder(args.orderedIds);\n },\n },\n update_field: {\n // PHI: mutates a patient-identifiable value. NOT `write` — the runtime\n // must confirm + audit. Routes through `onFieldSave` (server write).\n safety: 'phi',\n openWorld: true,\n argsType: '{ fieldId: string; value: unknown }',\n argsSchema: {\n type: 'object',\n properties: {\n fieldId: { type: 'string' },\n value: {},\n },\n required: ['fieldId', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.patientDetails.actions.updateField',\n description:\n \"Write a patient field value via the consumer's audited save path. Subject to the same permissions and validation as a human edit.\",\n errors: ['no-save-handler', 'validation-failed', 'permission-denied'],\n examples: [\n {\n args: { fieldId: 'job', value: 'Architect' },\n note: 'Update the patient’s occupation.',\n },\n ],\n invoke: (handle, args: { fieldId: string; value: unknown }) =>\n handle.updateField(args.fieldId, args.value),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'patient-details',\n description: 'Marks the PatientDetails root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop. Addresses a specific panel.',\n },\n item: {\n attr: 'data-field-id',\n description:\n 'Stable field KEY on each row. Never the field value (no PHI in the DOM hook).',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useId,\n useMemo,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ClipboardList } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Card } from '../card/card';\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '../collapsible/collapsible';\nimport { DescriptionList } from '../description-list/description-list';\nimport { PanelHeader } from '../panel-header/panel-header';\nimport { useAgentRegistration } from '../../agent/registry';\nimport {\n resolveVisibleFields,\n type PatientField,\n type PatientFieldEditType,\n type PatientFieldEditValue,\n type PatientFieldOption,\n type PatientFieldSection,\n} from '../_shared/patient-fields';\nimport { usePatientFieldVisibility } from '../_shared/field-visibility';\nimport { FieldVisibilityCog } from '../_shared/field-visibility-cog';\nimport { PatientFieldRow } from '../_shared/patient-field-row';\nimport { patientDetailsAgent } from './patient-details.agent';\n\n/* -------------------------------------------------------------------- */\n/* PatientDetails */\n/* */\n/* The customizable, inline-editable patient record panel — the kit's */\n/* replacement for platform's hardcoded, per-user-identical patient */\n/* \"scheda paziente\" table. Mounts as a CONTEXTUAL tool in the Control */\n/* Room rail (a separate tool from EntitySummary, the AI brief). */\n/* */\n/* Boundaries (PRS §Security + 26-agent-readiness §PHI): */\n/* - DATA-IN for values: the consumer maps DoctorPatient → sections. */\n/* The kit owns the layout, the cog field-picker, i18n & theming. */\n/* - PERSISTENCE-OUT: the cog emits `onVisibleFieldsChange`; the */\n/* consumer persists the user's chosen ordered field set (platform: */\n/* a per-user × per-practice JSON column). */\n/* - WRITE-OUT: inline edits AND the agent's `update_field` BOTH route */\n/* through the single `onFieldSave` callback, so platform's */\n/* permission + validation + audit path is the only write channel. */\n/* - DOM hooks + agent state carry only field KEYS and an opaque */\n/* `patientId` — never a field VALUE / patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:flex ds:flex-col ds:text-[color:var(--foreground)]',\n {\n variants: {\n // `compact` (default) suits the narrow rail panel; `comfortable`\n // relaxes spacing for a wider host (a full-width profile page).\n density: {\n comfortable: '',\n compact: '',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n },\n);\n\n// The scrolling body sits BELOW the shared PanelHeader (which owns the title\n// row + divider + its own top/side padding). The header is full-bleed at the\n// top of the scroll region; the body carries the panel's content padding.\nconst bodyVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-md)]', {\n variants: {\n density: {\n comfortable: 'ds:p-[var(--spacing-md)]',\n compact: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n density: 'compact',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* */\n/* The field model is the shared `_shared/patient-fields` vocabulary, so */\n/* PatientDetails and PatientSummaryCard speak ONE field language. The */\n/* visible set + order are a PER-CONTEXT preference the consumer owns and */\n/* wires per placement — never a single value synced across surfaces. The */\n/* `PatientDetails*` names below are kept as aliases for back-compat. */\n/* -------------------------------------------------------------------- */\n\nexport type {\n PatientField,\n PatientFieldSection,\n PatientFieldOption,\n PatientFieldEditType,\n PatientFieldEditValue,\n} from '../_shared/patient-fields';\n\n/** A label→value patient field. Alias of the shared {@link PatientField}. */\nexport type PatientDetailsField = PatientField;\n/** A labelled, collapsible group of fields. Alias of {@link PatientFieldSection}. */\nexport type PatientDetailsSection = PatientFieldSection;\n/** Alias of the shared {@link PatientFieldOption}. */\nexport type PatientDetailsFieldOption = PatientFieldOption;\n/** Alias of the shared {@link PatientFieldEditType}. */\nexport type PatientDetailsEditType = PatientFieldEditType;\n/** Alias of the shared {@link PatientFieldEditValue}. */\nexport type PatientDetailsEditValue = PatientFieldEditValue;\n\n/**\n * Imperative handle the agent adapter drives. Exposes only field KEYS and\n * an opaque `patientId` for reads; `updateField` routes writes through the\n * same `onFieldSave` path as a human inline edit (no second channel).\n */\nexport interface PatientDetailsHandle {\n /** The current ordered list of visible field ids. */\n getVisibleFieldOrder: () => string[];\n /** Opaque patient id (no PHI). */\n getPatientId: () => string | undefined;\n /** Replace the visible set, preserving the given order (filtered to known fields). */\n setVisibleFields: (fieldIds: string[]) => void;\n /** Replace the full ordered visible list (filtered to known fields). */\n setFieldOrder: (orderedIds: string[]) => void;\n /** Write a field value — delegates to `onFieldSave`. Rejects if no handler. */\n updateField: (fieldId: string, value: unknown) => Promise<void>;\n}\n\nexport interface PatientDetailsProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /** Patient display name — the panel heading. */\n title: ReactNode;\n /** The sectioned field catalogue (consumer-mapped from DoctorPatient). */\n sections: PatientDetailsSection[];\n /**\n * Header avatar photo / initials override. The panel always fronts the name\n * with an Avatar — initials derive from a string `title` by default; pass\n * `src` for a photo, or `name` to override the initials source.\n */\n avatar?: { src?: string; name?: string };\n /** At-a-glance chips under the name (consumer-composed Badge/Tag/Chip row). */\n headerChips?: ReactNode;\n\n /* ----- inline editing (kit-owned controls, consumer-owned write) ----- */\n\n /**\n * Frame the identity header and each section in its own elevated `Card`,\n * for a \"control-room\" rail that reads as a stack of cards rather than one\n * flat panel. Default `false` (the flat panel with a header rule + eyebrow\n * section headings). When framed, the header rule is dropped — the cards\n * provide the separation.\n */\n framed?: boolean;\n /** Master switch — show edit affordances on `editable` fields. */\n editable?: boolean;\n /**\n * Persist a field edit. Resolve ⇒ committed; reject(Error) ⇒ the message\n * is shown inline and the row stays in edit mode. Also the single channel\n * the agent's `update_field` uses.\n */\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n /** Domain validation — return an error message, or `null` when valid. */\n validate?: (fieldId: string, value: unknown) => string | null;\n\n /* ----- customization (the cog; controlled OR uncontrolled) ----- */\n\n /**\n * Controlled ordered list of visible field ids. `undefined` ⇒ every field\n * visible; an explicit `[]` ⇒ none (a panel that starts collapsed).\n */\n visibleFieldOrder?: string[];\n /** Uncontrolled initial order. Omit both ⇒ every field visible, in declaration order. */\n defaultVisibleFieldOrder?: string[];\n /** Fired whenever the user shows/hides/reorders fields via the cog. */\n onVisibleFieldsChange?: (orderedIds: string[]) => void;\n\n /* ----- states ----- */\n\n /** Render the loading skeleton. */\n loading?: boolean;\n /** Shown when there are no sections / no patient. Defaults to a localised hint. */\n emptyState?: ReactNode;\n\n /* ----- agent / a11y ----- */\n\n /** Opaque patient id — emitted as `data-patient-id` + agent stateRead. No PHI. */\n patientId?: string;\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /** BCP-47 locale override (currency / number editors). */\n locale?: string;\n /** Override the cog trigger's accessible name. */\n cogLabel?: string;\n /**\n * Visible panel-chrome heading (the sticky PanelHeader title). Defaults\n * to the kit's localised \"Patient details\". Pass an app-translated\n * string when the panel fronts a different record built from the same\n * chrome — \"Appointment details\", \"Task details\" — so the header names\n * what is actually shown. Also the `aria-label` fallback.\n */\n panelTitle?: string;\n /** Override the panel region's accessible name (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PatientDetails = forwardRef<HTMLElement, PatientDetailsProps>(\n function PatientDetails(\n {\n title,\n sections,\n avatar,\n headerChips,\n framed = false,\n editable = false,\n onFieldSave,\n validate,\n visibleFieldOrder,\n defaultVisibleFieldOrder,\n onVisibleFieldsChange,\n loading = false,\n emptyState,\n patientId,\n id,\n locale,\n cogLabel,\n panelTitle: panelTitleProp,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const headingId = useId();\n\n // Per-context field visibility + ordering. The order is a per-INSTANCE\n // preference the kit never persists — the consumer wires its own\n // value/onChange, so the same field vocabulary can render differently in\n // different parts of the app (see usePatientFieldVisibility).\n const {\n visible,\n catalogueIds,\n setOrder,\n toggleField,\n toggleSection,\n moveFieldOnto,\n reset: resetToDefaults,\n } = usePatientFieldVisibility(sections, {\n value: visibleFieldOrder,\n defaultValue: defaultVisibleFieldOrder,\n onChange: onVisibleFieldsChange,\n });\n\n /* ---- imperative handle (agent) ------------------------------- */\n\n const handle = useMemo<PatientDetailsHandle>(\n () => ({\n getVisibleFieldOrder: () => visible,\n getPatientId: () => patientId,\n setVisibleFields: (fieldIds) => setOrder(fieldIds),\n setFieldOrder: (orderedIds) => setOrder(orderedIds),\n updateField: (fieldId, value) => {\n if (!onFieldSave) {\n return Promise.reject(\n new Error('PatientDetails: no onFieldSave handler is wired.'),\n );\n }\n return onFieldSave(fieldId, value);\n },\n }),\n [visible, patientId, setOrder, onFieldSave],\n );\n useAgentRegistration(patientDetailsAgent, handle, id);\n\n /* ---- region accessible name ---------------------------------- */\n\n const panelTitle =\n panelTitleProp ??\n t('patientDetails.regionLabel', {\n defaultValue: 'Patient details',\n });\n const resolvedAriaLabel = ariaLabel ?? panelTitle;\n\n /* ---- header avatar ------------------------------------------- */\n // Parity with the card: the panel fronts the name with an Avatar (photo via\n // `avatar.src`, else initials from the name). Omitted only when `title` is a\n // non-string node and no `avatar.name` is given (nothing to derive from).\n const avatarName =\n avatar?.name ?? (typeof title === 'string' ? title : undefined);\n const showAvatar = Boolean(avatar?.src || avatarName);\n\n /* ---- loading / empty ----------------------------------------- */\n\n const hasVisible = catalogueIds.some((cid) => visible.includes(cid));\n\n if (loading) {\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-label={resolvedAriaLabel}\n aria-busy=\"true\"\n className={rootVariants({ className })}\n {...rest}\n >\n <div className={bodyVariants()}>\n <PatientDetailsSkeleton />\n </div>\n </section>\n );\n }\n\n const isEmpty = sections.length === 0 || !hasVisible;\n\n // The identity card (avatar + name + chips) is now the FIRST block of the\n // scrolling body — the shared PanelHeader owns the panel title row. The\n // name demotes to <h3> (the PanelHeader title is the <h2>).\n const identityBlock = (\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n {showAvatar ? (\n <Avatar\n size=\"md\"\n name={avatarName}\n src={avatar?.src}\n className=\"ds:shrink-0\"\n />\n ) : null}\n <div className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h3 className=\"ds:m-0 type-title-item ds:text-[color:var(--foreground)]\">\n {title}\n </h3>\n {/* Chips sit under the NAME (not the avatar) — same column shape\n as the card's identity line. */}\n {headerChips ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {headerChips}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <section\n ref={ref}\n data-component=\"patient-details\"\n data-component-id={id}\n data-patient-id={patientId}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel ?? undefined}\n className={rootVariants({ className })}\n {...rest}\n >\n {/* The shared rail-panel header: panel title + the field-picker cog as\n its panel-owned action; the rail injects favourite/close after it.\n Sticky + divider so the title stays as the body scrolls. */}\n <PanelHeader\n title={panelTitle}\n icon={<ClipboardList aria-hidden=\"true\" />}\n headingId={headingId}\n sticky\n divider\n actions={\n <FieldVisibilityCog\n sections={sections}\n visible={visible}\n onToggleField={toggleField}\n onToggleSection={toggleSection}\n onMoveFieldOnto={moveFieldOnto}\n onReset={resetToDefaults}\n label={cogLabel}\n />\n }\n />\n\n <div className={bodyVariants()}>\n {/* Identity card — first block of the body; framed wraps it in its\n own elevated card alongside each section. */}\n {framed ? (\n <Card variant=\"elevated\">\n <Card.Body>{identityBlock}</Card.Body>\n </Card>\n ) : (\n identityBlock\n )}\n\n {/* Body — one card per section when framed, otherwise a flat stack. */}\n {isEmpty ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {emptyState ??\n t('patientDetails.empty', {\n defaultValue: 'No patient selected.',\n })}\n </p>\n ) : (\n resolveVisibleFields(sections, visible)\n // A section whose fields are all hidden drops out entirely —\n // no empty card / \"No fields shown.\" placeholder. (The field\n // picker still lists it, so hidden fields can be re-added.)\n .filter(({ fields }) => fields.length > 0)\n .map(({ section, fields }) => {\n const block = (\n <SectionBlock\n section={section}\n fields={fields}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n );\n return framed ? (\n <Card key={section.id} variant=\"elevated\">\n <Card.Body>{block}</Card.Body>\n </Card>\n ) : (\n <Fragment key={section.id}>{block}</Fragment>\n );\n })\n )}\n </div>\n </section>\n );\n },\n);\n\nPatientDetails.displayName = 'PatientDetails';\n\n/* -------------------------------------------------------------------- */\n/* SectionBlock — one collapsible group */\n/* -------------------------------------------------------------------- */\n\nfunction SectionBlock({\n section,\n fields,\n editable,\n onFieldSave,\n validate,\n locale,\n}: {\n section: PatientDetailsSection;\n fields: PatientDetailsField[];\n editable: boolean;\n onFieldSave?: (fieldId: string, value: unknown) => Promise<void>;\n validate?: (fieldId: string, value: unknown) => string | null;\n locale?: string;\n}): ReactNode {\n const { t } = useTranslation('ui');\n const headingId = useId();\n const collapsible = section.collapsible ?? true;\n\n // The empty hint must be a SIBLING of the <dl>, never a child — a <p> is\n // not a valid direct child of <dl> (axe `definition-list`).\n const rows =\n fields.length === 0 ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('patientDetails.section.empty', {\n defaultValue: 'No fields shown.',\n })}\n </p>\n ) : (\n <DescriptionList\n layout=\"inline\"\n density=\"compact\"\n divider=\"none\"\n // Label icons paint in the accent (the slot's recolour hook); no row rules.\n className=\"ds:[--description-list-icon-color:var(--accent)]\"\n >\n {fields.map((field) => (\n <PatientFieldRow\n key={field.id}\n field={field}\n // Surface the icon on the direct child: DescriptionList reserves its\n // icon column by inspecting direct children only, so the FieldRow\n // wrapper must carry it (not just the nested Row).\n icon={field.icon ?? null}\n editable={editable}\n onFieldSave={onFieldSave}\n validate={validate}\n locale={locale}\n />\n ))}\n </DescriptionList>\n );\n\n if (!collapsible) {\n return (\n <section\n aria-labelledby={headingId}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <h3\n id={headingId}\n className=\"ds:m-0 type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </h3>\n {rows}\n </section>\n );\n }\n\n return (\n <Collapsible\n defaultOpen={section.defaultOpen ?? true}\n variant=\"minimal\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n {/* Real <h3> so collapsible sections appear in the heading outline\n (the non-collapsible branch is an <h3> too); the WAI-ARIA accordion\n pattern is a heading wrapping the disclosure button. */}\n <h3 className=\"ds:m-0\">\n <CollapsibleTrigger asChild>\n <button\n type=\"button\"\n id={headingId}\n className=\"ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)] ds:bg-transparent ds:border-0 ds:p-0 ds:text-start ds:cursor-pointer ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText] type-eyebrow ds:text-[color:var(--foreground)]\"\n >\n {section.heading}\n </button>\n </CollapsibleTrigger>\n </h3>\n <CollapsibleContent aria-labelledby={headingId}>\n {rows}\n </CollapsibleContent>\n </Collapsible>\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Skeleton */\n/* -------------------------------------------------------------------- */\n\nfunction PatientDetailsSkeleton(): ReactNode {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:size-10 ds:shrink-0 ds:rounded-full ds:bg-[color:var(--muted)]\" />\n <span className=\"ds:h-4 ds:w-1/2 ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\" />\n </div>\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"ds:h-4 ds:w-full ds:rounded-[var(--radius-sm)] ds:bg-[color:var(--muted)]\"\n />\n ))}\n </div>\n );\n}\n\n/** Density variant union re-exported for downstream typing. */\nexport type PatientDetailsDensity = NonNullable<\n VariantProps<typeof rootVariants>['density']\n>;\n"],"names":["patientDetailsAgent","handle","args","rootVariants","cva","bodyVariants","PatientDetails","forwardRef","title","sections","avatar","headerChips","framed","editable","onFieldSave","validate","visibleFieldOrder","defaultVisibleFieldOrder","onVisibleFieldsChange","loading","emptyState","patientId","id","locale","cogLabel","panelTitleProp","ariaLabel","className","rest","ref","t","useTranslation","headingId","useId","visible","catalogueIds","setOrder","toggleField","toggleSection","moveFieldOnto","resetToDefaults","usePatientFieldVisibility","useMemo","fieldIds","orderedIds","fieldId","value","useAgentRegistration","panelTitle","resolvedAriaLabel","avatarName","showAvatar","hasVisible","cid","jsx","PatientDetailsSkeleton","isEmpty","identityBlock","jsxs","Avatar","PanelHeader","ClipboardList","FieldVisibilityCog","Card","resolveVisibleFields","fields","section","block","SectionBlock","Fragment","collapsible","rows","DescriptionList","field","PatientFieldRow","Collapsible","CollapsibleTrigger","CollapsibleContent"],"mappings":";;;;;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as oe } from "./calendar-days-BGWklvE-.js";
|
|
18
18
|
import { c as R } from "./createLucideIcon-DhHxpK9K.js";
|
|
19
19
|
import { U as le } from "./user-B12p7bVF.js";
|
|
20
|
-
import { C as ce } from "./city-input-
|
|
20
|
+
import { C as ce } from "./city-input-BL5WsGJ3.js";
|
|
21
21
|
import { C as de } from "./country-select-r3QC7cVA.js";
|
|
22
22
|
import { D as ue } from "./date-picker-BnhBmcH6.js";
|
|
23
|
-
import { E as me } from "./email-input-
|
|
23
|
+
import { E as me } from "./email-input-DQixfopu.js";
|
|
24
24
|
import { F as pe } from "./fiscal-code-input-DNA_SbQx.js";
|
|
25
25
|
import { N as fe } from "./number-input-DRDRYZJg.js";
|
|
26
26
|
import { P as ge } from "./phone-input-BzeUr49H.js";
|
|
27
|
-
import { P as he } from "./postal-code-input-
|
|
27
|
+
import { P as he } from "./postal-code-input-lCk8me6K.js";
|
|
28
28
|
import { P as ye } from "./province-select-DtF2ukoC.js";
|
|
29
29
|
import { S as be } from "./select-DHPmASkG.js";
|
|
30
30
|
import { S as ve } from "./switch-D--x7n6h.js";
|
|
31
31
|
import { T as xe } from "./text-area-CDuItrvL.js";
|
|
32
|
-
import { T as ke } from "./text-input-
|
|
32
|
+
import { T as ke } from "./text-input-rzLEKhRU.js";
|
|
33
33
|
import { C as K } from "./check-DrFSN__t.js";
|
|
34
34
|
import { X as Ce } from "./x-B5YnXwCz.js";
|
|
35
35
|
import { P as Ve } from "./pencil-B1sKKyuT.js";
|
|
@@ -825,4 +825,4 @@ export {
|
|
|
825
825
|
Nt as r,
|
|
826
826
|
wt as u
|
|
827
827
|
};
|
|
828
|
-
//# sourceMappingURL=patient-field-row-
|
|
828
|
+
//# sourceMappingURL=patient-field-row-Dr-ndtG8.js.map
|