@alfadocs/ui-kit-debug 0.77.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/_chunks/document-preview-nwfulDEs.js +290 -0
  2. package/dist/_chunks/document-preview-nwfulDEs.js.map +1 -0
  3. package/dist/agent-catalog.json +1 -1
  4. package/dist/components/document-preview/document-preview.d.ts +10 -0
  5. package/dist/components/document-preview/document-preview.d.ts.map +1 -1
  6. package/dist/components/document-preview/index.js +1 -1
  7. package/dist/i18n/locales/ar.d.ts +6 -0
  8. package/dist/i18n/locales/ar.d.ts.map +1 -1
  9. package/dist/i18n/locales/ar.js +6 -0
  10. package/dist/i18n/locales/ar.js.map +1 -1
  11. package/dist/i18n/locales/de.d.ts +6 -0
  12. package/dist/i18n/locales/de.d.ts.map +1 -1
  13. package/dist/i18n/locales/de.js +6 -0
  14. package/dist/i18n/locales/de.js.map +1 -1
  15. package/dist/i18n/locales/el.d.ts +6 -0
  16. package/dist/i18n/locales/el.d.ts.map +1 -1
  17. package/dist/i18n/locales/el.js +6 -0
  18. package/dist/i18n/locales/el.js.map +1 -1
  19. package/dist/i18n/locales/en.d.ts +6 -0
  20. package/dist/i18n/locales/en.d.ts.map +1 -1
  21. package/dist/i18n/locales/en.js +6 -0
  22. package/dist/i18n/locales/en.js.map +1 -1
  23. package/dist/i18n/locales/es.d.ts +6 -0
  24. package/dist/i18n/locales/es.d.ts.map +1 -1
  25. package/dist/i18n/locales/es.js +6 -0
  26. package/dist/i18n/locales/es.js.map +1 -1
  27. package/dist/i18n/locales/fr.d.ts +6 -0
  28. package/dist/i18n/locales/fr.d.ts.map +1 -1
  29. package/dist/i18n/locales/fr.js +6 -0
  30. package/dist/i18n/locales/fr.js.map +1 -1
  31. package/dist/i18n/locales/hi.d.ts +6 -0
  32. package/dist/i18n/locales/hi.d.ts.map +1 -1
  33. package/dist/i18n/locales/hi.js +6 -0
  34. package/dist/i18n/locales/hi.js.map +1 -1
  35. package/dist/i18n/locales/it.d.ts +6 -0
  36. package/dist/i18n/locales/it.d.ts.map +1 -1
  37. package/dist/i18n/locales/it.js +6 -0
  38. package/dist/i18n/locales/it.js.map +1 -1
  39. package/dist/i18n/locales/ja.d.ts +6 -0
  40. package/dist/i18n/locales/ja.d.ts.map +1 -1
  41. package/dist/i18n/locales/ja.js +6 -0
  42. package/dist/i18n/locales/ja.js.map +1 -1
  43. package/dist/i18n/locales/nl.d.ts +6 -0
  44. package/dist/i18n/locales/nl.d.ts.map +1 -1
  45. package/dist/i18n/locales/nl.js +6 -0
  46. package/dist/i18n/locales/nl.js.map +1 -1
  47. package/dist/i18n/locales/pl.d.ts +6 -0
  48. package/dist/i18n/locales/pl.d.ts.map +1 -1
  49. package/dist/i18n/locales/pl.js +6 -0
  50. package/dist/i18n/locales/pl.js.map +1 -1
  51. package/dist/i18n/locales/pt.d.ts +6 -0
  52. package/dist/i18n/locales/pt.d.ts.map +1 -1
  53. package/dist/i18n/locales/pt.js +6 -0
  54. package/dist/i18n/locales/pt.js.map +1 -1
  55. package/dist/i18n/locales/ro.d.ts +6 -0
  56. package/dist/i18n/locales/ro.d.ts.map +1 -1
  57. package/dist/i18n/locales/ro.js +6 -0
  58. package/dist/i18n/locales/ro.js.map +1 -1
  59. package/dist/i18n/locales/ru.d.ts +6 -0
  60. package/dist/i18n/locales/ru.d.ts.map +1 -1
  61. package/dist/i18n/locales/ru.js +6 -0
  62. package/dist/i18n/locales/ru.js.map +1 -1
  63. package/dist/i18n/locales/sq.d.ts +6 -0
  64. package/dist/i18n/locales/sq.d.ts.map +1 -1
  65. package/dist/i18n/locales/sq.js +6 -0
  66. package/dist/i18n/locales/sq.js.map +1 -1
  67. package/dist/i18n/locales/sv.d.ts +6 -0
  68. package/dist/i18n/locales/sv.d.ts.map +1 -1
  69. package/dist/i18n/locales/sv.js +6 -0
  70. package/dist/i18n/locales/sv.js.map +1 -1
  71. package/dist/i18n/locales/tr.d.ts +6 -0
  72. package/dist/i18n/locales/tr.d.ts.map +1 -1
  73. package/dist/i18n/locales/tr.js +6 -0
  74. package/dist/i18n/locales/tr.js.map +1 -1
  75. package/dist/i18n/locales/zh.d.ts +6 -0
  76. package/dist/i18n/locales/zh.d.ts.map +1 -1
  77. package/dist/i18n/locales/zh.js +6 -0
  78. package/dist/i18n/locales/zh.js.map +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/locales/ar.json +6 -0
  81. package/dist/locales/de.json +6 -0
  82. package/dist/locales/el.json +6 -0
  83. package/dist/locales/en.json +6 -0
  84. package/dist/locales/es.json +6 -0
  85. package/dist/locales/fr.json +6 -0
  86. package/dist/locales/hi.json +6 -0
  87. package/dist/locales/it.json +6 -0
  88. package/dist/locales/ja.json +6 -0
  89. package/dist/locales/nl.json +6 -0
  90. package/dist/locales/pl.json +6 -0
  91. package/dist/locales/pt.json +6 -0
  92. package/dist/locales/ro.json +6 -0
  93. package/dist/locales/ru.json +6 -0
  94. package/dist/locales/sq.json +6 -0
  95. package/dist/locales/sv.json +6 -0
  96. package/dist/locales/tr.json +6 -0
  97. package/dist/locales/zh.json +6 -0
  98. package/dist/tokens.css +1 -0
  99. package/package.json +1 -1
  100. package/dist/_chunks/document-preview-CvHnHf6T.js +0 -243
  101. package/dist/_chunks/document-preview-CvHnHf6T.js.map +0 -1
package/dist/index.js CHANGED
@@ -215,7 +215,7 @@ import { A as Xg, a as qg, b as zg, c as jg } from "./_chunks/alia-sidebar-w6B0T
215
215
  import { C as Jg, M as Zg, P as $g } from "./_chunks/marketplace-app-shell-Bxq1PYAj.js";
216
216
  import { S as eC } from "./_chunks/signature-request-C-mskXwi.js";
217
217
  import { D as sC, d as oC } from "./_chunks/dependent-selector-DyFpdzZV.js";
218
- import { D as nC, d as iC } from "./_chunks/document-preview-CvHnHf6T.js";
218
+ import { D as nC, d as iC } from "./_chunks/document-preview-nwfulDEs.js";
219
219
  import { D as mC, d as lC } from "./_chunks/document-scanner-B6h1Ir56.js";
220
220
  import { F as AC, c as cC, a as fC, b as gC, f as CC, w as SC, i as xC } from "./_chunks/fiscal-code-input-DWA6C8x8.js";
221
221
  import { Q as uC, c as PC, q as IC, s as EC } from "./_chunks/qr-code-CPkEs5mG.js";
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "معاينة {{name}}",
985
985
  "noPreview": "المعاينة غير متاحة.",
986
986
  "clinical": "سريري",
987
+ "detailsTitle": "التفاصيل",
987
988
  "fields": {
988
989
  "size": "الحجم",
989
990
  "modified": "آخر تعديل",
991
+ "createdBy": "أنشأه",
992
+ "created": "تاريخ الإنشاء",
993
+ "signatureRequested": "طُلب التوقيع",
994
+ "signed": "موقَّع",
995
+ "sharedWithPatient": "تمت مشاركته مع المريض",
990
996
  "expires": "تنتهي الصلاحية"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Vorschau von {{name}}",
985
985
  "noPreview": "Keine Vorschau verfügbar.",
986
986
  "clinical": "Klinisch",
987
+ "detailsTitle": "Details",
987
988
  "fields": {
988
989
  "size": "Größe",
989
990
  "modified": "Geändert",
991
+ "createdBy": "Erstellt von",
992
+ "created": "Erstellt",
993
+ "signatureRequested": "Signatur angefordert",
994
+ "signed": "Signiert",
995
+ "sharedWithPatient": "Mit Patient geteilt",
990
996
  "expires": "Läuft ab"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Προεπισκόπηση του {{name}}",
985
985
  "noPreview": "Δεν υπάρχει διαθέσιμη προεπισκόπηση.",
986
986
  "clinical": "Κλινικό",
987
+ "detailsTitle": "Λεπτομέρειες",
987
988
  "fields": {
988
989
  "size": "Μέγεθος",
989
990
  "modified": "Τροποποιήθηκε",
991
+ "createdBy": "Δημιουργήθηκε από",
992
+ "created": "Δημιουργήθηκε",
993
+ "signatureRequested": "Ζητήθηκε υπογραφή",
994
+ "signed": "Υπογράφηκε",
995
+ "sharedWithPatient": "Κοινοποιήθηκε στον ασθενή",
990
996
  "expires": "Λήγει"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Preview of {{name}}",
985
985
  "noPreview": "No preview available.",
986
986
  "clinical": "Clinical",
987
+ "detailsTitle": "Details",
987
988
  "fields": {
988
989
  "size": "Size",
989
990
  "modified": "Modified",
991
+ "createdBy": "Created by",
992
+ "created": "Created",
993
+ "signatureRequested": "Signature requested",
994
+ "signed": "Signed",
995
+ "sharedWithPatient": "Shared with patient",
990
996
  "expires": "Expires"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Vista previa de {{name}}",
985
985
  "noPreview": "Vista previa no disponible.",
986
986
  "clinical": "Clínico",
987
+ "detailsTitle": "Detalles",
987
988
  "fields": {
988
989
  "size": "Tamaño",
989
990
  "modified": "Modificado",
991
+ "createdBy": "Creado por",
992
+ "created": "Creado",
993
+ "signatureRequested": "Firma solicitada",
994
+ "signed": "Firmado",
995
+ "sharedWithPatient": "Compartido con el paciente",
990
996
  "expires": "Caduca"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Aperçu de {{name}}",
985
985
  "noPreview": "Aperçu non disponible.",
986
986
  "clinical": "Clinique",
987
+ "detailsTitle": "Détails",
987
988
  "fields": {
988
989
  "size": "Taille",
989
990
  "modified": "Modifié",
991
+ "createdBy": "Créé par",
992
+ "created": "Créé",
993
+ "signatureRequested": "Signature demandée",
994
+ "signed": "Signé",
995
+ "sharedWithPatient": "Partagé avec le patient",
990
996
  "expires": "Expiration"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "{{name}} का पूर्वावलोकन",
985
985
  "noPreview": "कोई पूर्वावलोकन उपलब्ध नहीं।",
986
986
  "clinical": "नैदानिक",
987
+ "detailsTitle": "विवरण",
987
988
  "fields": {
988
989
  "size": "आकार",
989
990
  "modified": "संशोधित",
991
+ "createdBy": "द्वारा बनाया गया",
992
+ "created": "बनाया गया",
993
+ "signatureRequested": "हस्ताक्षर का अनुरोध",
994
+ "signed": "हस्ताक्षरित",
995
+ "sharedWithPatient": "रोगी के साथ साझा किया गया",
990
996
  "expires": "समाप्ति"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Anteprima di {{name}}",
985
985
  "noPreview": "Anteprima non disponibile.",
986
986
  "clinical": "Clinico",
987
+ "detailsTitle": "Dettagli",
987
988
  "fields": {
988
989
  "size": "Dimensione",
989
990
  "modified": "Modificato",
991
+ "createdBy": "Creato da",
992
+ "created": "Creato",
993
+ "signatureRequested": "Firma richiesta",
994
+ "signed": "Firmato",
995
+ "sharedWithPatient": "Condiviso con il paziente",
990
996
  "expires": "Scadenza"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "{{name}} のプレビュー",
985
985
  "noPreview": "プレビューを利用できません。",
986
986
  "clinical": "臨床",
987
+ "detailsTitle": "詳細",
987
988
  "fields": {
988
989
  "size": "サイズ",
989
990
  "modified": "更新日時",
991
+ "createdBy": "作成者",
992
+ "created": "作成日",
993
+ "signatureRequested": "署名を依頼済み",
994
+ "signed": "署名済み",
995
+ "sharedWithPatient": "患者と共有済み",
990
996
  "expires": "有効期限"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Voorbeeld van {{name}}",
985
985
  "noPreview": "Geen voorbeeld beschikbaar.",
986
986
  "clinical": "Klinisch",
987
+ "detailsTitle": "Details",
987
988
  "fields": {
988
989
  "size": "Grootte",
989
990
  "modified": "Gewijzigd",
991
+ "createdBy": "Gemaakt door",
992
+ "created": "Gemaakt",
993
+ "signatureRequested": "Handtekening aangevraagd",
994
+ "signed": "Ondertekend",
995
+ "sharedWithPatient": "Gedeeld met patiënt",
990
996
  "expires": "Verloopt"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Podgląd {{name}}",
985
985
  "noPreview": "Podgląd niedostępny.",
986
986
  "clinical": "Kliniczny",
987
+ "detailsTitle": "Szczegóły",
987
988
  "fields": {
988
989
  "size": "Rozmiar",
989
990
  "modified": "Zmodyfikowano",
991
+ "createdBy": "Utworzone przez",
992
+ "created": "Utworzono",
993
+ "signatureRequested": "Prośba o podpis",
994
+ "signed": "Podpisano",
995
+ "sharedWithPatient": "Udostępniono pacjentowi",
990
996
  "expires": "Wygasa"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Pré-visualização de {{name}}",
985
985
  "noPreview": "Pré-visualização não disponível.",
986
986
  "clinical": "Clínico",
987
+ "detailsTitle": "Detalhes",
987
988
  "fields": {
988
989
  "size": "Tamanho",
989
990
  "modified": "Modificado",
991
+ "createdBy": "Criado por",
992
+ "created": "Criado",
993
+ "signatureRequested": "Assinatura solicitada",
994
+ "signed": "Assinado",
995
+ "sharedWithPatient": "Partilhado com o paciente",
990
996
  "expires": "Expira"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Previzualizare pentru {{name}}",
985
985
  "noPreview": "Previzualizare indisponibilă.",
986
986
  "clinical": "Clinic",
987
+ "detailsTitle": "Detalii",
987
988
  "fields": {
988
989
  "size": "Dimensiune",
989
990
  "modified": "Modificat",
991
+ "createdBy": "Creat de",
992
+ "created": "Creat",
993
+ "signatureRequested": "Semnătură solicitată",
994
+ "signed": "Semnat",
995
+ "sharedWithPatient": "Partajat cu pacientul",
990
996
  "expires": "Expiră"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Предпросмотр {{name}}",
985
985
  "noPreview": "Предпросмотр недоступен.",
986
986
  "clinical": "Клинический",
987
+ "detailsTitle": "Сведения",
987
988
  "fields": {
988
989
  "size": "Размер",
989
990
  "modified": "Изменён",
991
+ "createdBy": "Кем создан",
992
+ "created": "Создано",
993
+ "signatureRequested": "Запрошена подпись",
994
+ "signed": "Подписано",
995
+ "sharedWithPatient": "Отправлено пациенту",
990
996
  "expires": "Истекает"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Parapamje e {{name}}",
985
985
  "noPreview": "Parapamja nuk është e disponueshme.",
986
986
  "clinical": "Klinik",
987
+ "detailsTitle": "Detajet",
987
988
  "fields": {
988
989
  "size": "Madhësia",
989
990
  "modified": "Modifikuar",
991
+ "createdBy": "Krijuar nga",
992
+ "created": "Krijuar",
993
+ "signatureRequested": "Nënshkrimi u kërkua",
994
+ "signed": "Nënshkruar",
995
+ "sharedWithPatient": "Ndarë me pacientin",
990
996
  "expires": "Skadon"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "Förhandsgranskning av {{name}}",
985
985
  "noPreview": "Ingen förhandsgranskning tillgänglig.",
986
986
  "clinical": "Klinisk",
987
+ "detailsTitle": "Detaljer",
987
988
  "fields": {
988
989
  "size": "Storlek",
989
990
  "modified": "Ändrad",
991
+ "createdBy": "Skapad av",
992
+ "created": "Skapad",
993
+ "signatureRequested": "Signatur begärd",
994
+ "signed": "Signerad",
995
+ "sharedWithPatient": "Delad med patient",
990
996
  "expires": "Upphör"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "{{name}} önizlemesi",
985
985
  "noPreview": "Önizleme kullanılamıyor.",
986
986
  "clinical": "Klinik",
987
+ "detailsTitle": "Ayrıntılar",
987
988
  "fields": {
988
989
  "size": "Boyut",
989
990
  "modified": "Değiştirilme",
991
+ "createdBy": "Oluşturan",
992
+ "created": "Oluşturulma",
993
+ "signatureRequested": "İmza istendi",
994
+ "signed": "İmzalandı",
995
+ "sharedWithPatient": "Hastayla paylaşıldı",
990
996
  "expires": "Sona eriyor"
991
997
  },
992
998
  "signature": {
@@ -984,9 +984,15 @@
984
984
  "imageAlt": "{{name}} 的预览",
985
985
  "noPreview": "无可用预览。",
986
986
  "clinical": "临床",
987
+ "detailsTitle": "详情",
987
988
  "fields": {
988
989
  "size": "大小",
989
990
  "modified": "修改时间",
991
+ "createdBy": "创建者",
992
+ "created": "创建时间",
993
+ "signatureRequested": "已请求签名",
994
+ "signed": "已签名",
995
+ "sharedWithPatient": "已与患者共享",
990
996
  "expires": "到期"
991
997
  },
992
998
  "signature": {
package/dist/tokens.css CHANGED
@@ -1353,6 +1353,7 @@ button.ag-side-button-button:focus{box-shadow:none}
1353
1353
  .ag-theme-alfadocs .ag-cell{display:flex;align-items:center;line-height:var(--line-height-base, 1.5);font-feature-settings:"tnum";letter-spacing:0}
1354
1354
  .ag-theme-alfadocs .ag-cell.ag-row-group{align-items:flex-start}
1355
1355
  .ag-theme-alfadocs .ag-cell-wrapper.ag-row-group .ag-group-value{align-self:stretch;display:flex;align-items:center}
1356
+ .ag-theme-alfadocs .ag-cell-value,.ag-theme-alfadocs .ag-cell-wrapper,.ag-theme-alfadocs .ag-cell-wrapper .ag-group-value{min-inline-size:0}
1356
1357
  .ag-theme-alfadocs .ag-cell:focus-within{outline:var(--focus-ring-width) solid var(--ring);outline-offset:-1px}
1357
1358
  .ag-theme-alfadocs .data-table-row-success{background-color:color-mix(in srgb,var(--success) 8%,transparent);border-block-end:var(--border-width-sm) solid color-mix(in srgb,var(--border) 50%,transparent)}
1358
1359
  .ag-theme-alfadocs .data-table-row-warning{background-color:color-mix(in srgb,var(--warning) 8%,transparent);border-block-end:var(--border-width-sm) solid color-mix(in srgb,var(--border) 50%,transparent)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit-debug",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe. (debug build — identical runtime to @alfadocs/ui-kit, ships source maps for symbolication).",
6
6
  "license": "BUSL-1.1",
@@ -1,243 +0,0 @@
1
- import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as j, useMemo as S, useState as C, useImperativeHandle as W } from "react";
3
- import { c as U } from "./index-D2ZczOXr.js";
4
- import { useTranslation as $ } from "react-i18next";
5
- import { B as h } from "./badge-DCOqV9mI.js";
6
- import { E as G } from "./empty-state-CrLsi0XI.js";
7
- import { P as Y } from "./panel-header-D313n_9-.js";
8
- import { P as q } from "./pdf-viewer-DF3VMaPo.js";
9
- import { T as J, b as O, c as Q, a as X } from "./tabs-CVTukWRD.js";
10
- import { u as Z } from "./registry-DvAUVLHh.js";
11
- import { F as ee, a as te } from "./file-Cwe9VC1A.js";
12
- import { F as ae } from "./file-text-5yv6r2ls.js";
13
- import { c as ie } from "./createLucideIcon-DhHxpK9K.js";
14
- /**
15
- * @license lucide-react v1.22.0 - ISC
16
- *
17
- * This source code is licensed under the ISC license.
18
- * See the LICENSE file in the root directory of this source tree.
19
- */
20
- const ne = [
21
- ["path", { d: "M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8", key: "14sh0y" }],
22
- [
23
- "path",
24
- {
25
- d: "M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",
26
- key: "1970lx"
27
- }
28
- ],
29
- ["path", { d: "M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1", key: "l4dndm" }]
30
- ], se = ie("files", ne), re = {
31
- id: "document-preview",
32
- capabilities: [],
33
- state: {
34
- kind: {
35
- type: "'pdf' | 'image' | 'metadata' | 'empty'",
36
- descriptionKey: "ui.agent.documentPreview.state.kind",
37
- description: "Which render branch is active: pdf, image, metadata (no inline preview), or empty (no document). Structural — never the document name.",
38
- read: (i) => i.getKind()
39
- }
40
- },
41
- actions: {
42
- get_name: {
43
- // phi (not read): resolves the document display name, which can identify
44
- // patients. PRS §26 — phi outranks read so the host gates it behind
45
- // stricter confirm + audit. The always-on kind slot stays name-free.
46
- safety: "phi",
47
- returns: "string | undefined",
48
- returnsSchema: { type: ["string", "null"] },
49
- idempotent: !0,
50
- descriptionKey: "ui.agent.documentPreview.actions.getName",
51
- description: "Read the display name of the previewed document. May identify a patient (PHI).",
52
- invoke: (i) => i.getName()
53
- }
54
- },
55
- domHooks: {
56
- root: {
57
- attr: "data-component",
58
- value: "document-preview",
59
- description: "Marks the DocumentPreview region."
60
- },
61
- instanceId: {
62
- attr: "data-component-id",
63
- sourceProp: "id",
64
- description: "Sourced from the id prop."
65
- }
66
- }
67
- }, de = U(
68
- [
69
- "ds:flex ds:h-full ds:min-h-0 ds:min-w-0 ds:flex-col ds:overflow-auto",
70
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
71
- "ds:focus-visible:outline-solid",
72
- "ds:focus-visible:outline-ring"
73
- ].join(" ")
74
- ), me = {
75
- signed: "success",
76
- pending: "warning"
77
- };
78
- function k(i, n, l) {
79
- if (!i) return "empty";
80
- const r = n ?? "";
81
- return r === "application/pdf" && l ? "pdf" : r.startsWith("image/") && l ? "image" : "metadata";
82
- }
83
- function B(i) {
84
- const n = i ?? "";
85
- return n.startsWith("image/") ? ee : n === "application/pdf" || n.startsWith("text/") || n.includes("word") ? ae : te;
86
- }
87
- const oe = [
88
- "documentPreview.units.bytes",
89
- "documentPreview.units.kilobytes",
90
- "documentPreview.units.megabytes",
91
- "documentPreview.units.gigabytes"
92
- ], M = ["B", "KB", "MB", "GB"];
93
- function le(i, n, l) {
94
- let r = i, m = 0;
95
- for (; r >= 1024 && m < M.length - 1; )
96
- r /= 1024, m++;
97
- return `${new Intl.NumberFormat(n, {
98
- maximumFractionDigits: m === 0 ? 0 : 1
99
- }).format(r)} ${l(oe[m], M[m])}`;
100
- }
101
- const ce = j(({ id: i, name: n, mimeType: l, src: r, metadata: m, documents: u, className: K }, D) => {
102
- const { t: s, i18n: v } = $(), o = S(() => u && u.length > 0 ? u : n ? [{ id: i ?? n, name: n, mimeType: l, src: r, metadata: m }] : [], [u, i, n, l, r, m]), w = o.length > 1, [L, _] = C(void 0), a = o.find((e) => e.id === L) ?? o[0], y = S(
103
- () => ({
104
- getKind: () => a ? k(a.name, a.mimeType, a.src) : "empty",
105
- getName: () => a == null ? void 0 : a.name
106
- }),
107
- [a]
108
- );
109
- W(D, () => y, [y]), Z(re, y, i);
110
- const b = (e) => {
111
- var N, P, x, T, I, z, A, F;
112
- const f = k(e.name, e.mimeType, e.src);
113
- if (f === "pdf" && e.src)
114
- return /* @__PURE__ */ t(
115
- q,
116
- {
117
- src: e.src,
118
- toolbarVariant: "minimal",
119
- ariaLabel: e.name,
120
- className: "ds:h-full"
121
- }
122
- );
123
- if (f === "image" && e.src)
124
- return /* @__PURE__ */ t(
125
- "img",
126
- {
127
- src: e.src,
128
- alt: s("documentPreview.imageAlt", "Preview of {{name}}", {
129
- name: e.name
130
- }),
131
- className: "ds:max-h-full ds:max-w-full ds:ms-auto ds:me-auto ds:object-contain"
132
- }
133
- );
134
- const c = (N = e.metadata) == null ? void 0 : N.signatureStatus, R = !!((P = e.metadata) != null && P.documentType) || !!((x = e.metadata) != null && x.clinical) || c !== void 0 && c !== "none";
135
- return /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
136
- R && /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
137
- ((T = e.metadata) == null ? void 0 : T.documentType) && /* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: e.metadata.documentType }),
138
- ((I = e.metadata) == null ? void 0 : I.clinical) && /* @__PURE__ */ t(h, { variant: "info", size: "sm", children: s("documentPreview.clinical", "Clinical") }),
139
- c && c !== "none" && /* @__PURE__ */ t(h, { variant: me[c], size: "sm", withDot: !0, children: s(`documentPreview.signature.${c}`, c) })
140
- ] }),
141
- /* @__PURE__ */ d("dl", { className: "ds:grid ds:grid-cols-[auto_1fr] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] type-body-sm", children: [
142
- ((z = e.metadata) == null ? void 0 : z.size) !== void 0 && /* @__PURE__ */ d(g, { children: [
143
- /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.size", "Size") }),
144
- /* @__PURE__ */ t("dd", { className: "ds:m-0", children: le(e.metadata.size, v.language, s) })
145
- ] }),
146
- ((A = e.metadata) == null ? void 0 : A.updatedAt) && /* @__PURE__ */ d(g, { children: [
147
- /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.modified", "Modified") }),
148
- /* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
149
- dateStyle: "medium"
150
- }).format(new Date(e.metadata.updatedAt)) })
151
- ] }),
152
- ((F = e.metadata) == null ? void 0 : F.expiresAt) && /* @__PURE__ */ d(g, { children: [
153
- /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.expires", "Expires") }),
154
- /* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
155
- dateStyle: "medium"
156
- }).format(new Date(e.metadata.expiresAt)) })
157
- ] })
158
- ] }),
159
- /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-muted-foreground", children: s("documentPreview.noPreview", "No preview available.") })
160
- ] });
161
- }, V = B(a == null ? void 0 : a.mimeType), E = w ? /* @__PURE__ */ t(se, { "aria-hidden": "true" }) : /* @__PURE__ */ t(V, { "aria-hidden": "true" }), H = w ? /* @__PURE__ */ d(g, { children: [
162
- s("documentPreview.multiTitle", "Documents"),
163
- /* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: o.length })
164
- ] }) : a == null ? void 0 : a.name;
165
- let p;
166
- return o.length === 0 ? p = /* @__PURE__ */ t(
167
- G,
168
- {
169
- variant: "first-use",
170
- size: "sm",
171
- title: s("documentPreview.emptyTitle", "No document selected"),
172
- description: s(
173
- "documentPreview.emptyDescription",
174
- "Select a document to preview it here."
175
- )
176
- }
177
- ) : w ? p = /* @__PURE__ */ d(
178
- J,
179
- {
180
- value: (a == null ? void 0 : a.id) ?? "",
181
- onValueChange: _,
182
- variant: "underlined",
183
- size: "sm",
184
- className: "ds:min-h-0 ds:flex-1 ds:pt-[var(--spacing-sm)]",
185
- children: [
186
- /* @__PURE__ */ t(
187
- O,
188
- {
189
- "aria-label": s("documentPreview.tabsLabel", "Selected documents"),
190
- className: "ds:gap-[var(--spacing-sm)]",
191
- children: o.map((e) => {
192
- const f = B(e.mimeType);
193
- return /* @__PURE__ */ t(
194
- Q,
195
- {
196
- value: e.id,
197
- icon: /* @__PURE__ */ t(
198
- f,
199
- {
200
- "aria-hidden": "true",
201
- className: "ds:size-4 ds:text-[color:var(--accent)]"
202
- }
203
- ),
204
- className: "ds:[min-inline-size:0]",
205
- children: /* @__PURE__ */ t("span", { className: "ds:block ds:truncate ds:[min-inline-size:0]", children: e.name })
206
- },
207
- e.id
208
- );
209
- })
210
- }
211
- ),
212
- o.map((e) => /* @__PURE__ */ t(
213
- X,
214
- {
215
- value: e.id,
216
- className: "ds:min-h-0 ds:flex-1",
217
- children: b(e)
218
- },
219
- e.id
220
- ))
221
- ]
222
- }
223
- ) : p = b(a), /* @__PURE__ */ d(
224
- "section",
225
- {
226
- "data-component": "document-preview",
227
- "data-component-id": i,
228
- tabIndex: 0,
229
- "aria-label": s("documentPreview.regionLabel", "Document preview"),
230
- className: de({ className: K }),
231
- children: [
232
- o.length > 0 && /* @__PURE__ */ t(Y, { sticky: !0, icon: E, title: H }),
233
- p
234
- ]
235
- }
236
- );
237
- });
238
- ce.displayName = "DocumentPreview";
239
- export {
240
- ce as D,
241
- re as d
242
- };
243
- //# sourceMappingURL=document-preview-CvHnHf6T.js.map