@alfadocs/ui-kit-debug 1.7.0 → 1.8.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 (234) hide show
  1. package/dist/_chunks/{anamnesis-summary-rows-F-cCmFAn.js → anamnesis-summary-rows-d44s_whc.js} +2 -2
  2. package/dist/_chunks/{anamnesis-summary-rows-F-cCmFAn.js.map → anamnesis-summary-rows-d44s_whc.js.map} +1 -1
  3. package/dist/_chunks/{antenatal-schedule-timeline-BjlF2rTz.js → antenatal-schedule-timeline-B1k8QkA6.js} +3 -3
  4. package/dist/_chunks/{antenatal-schedule-timeline-BjlF2rTz.js.map → antenatal-schedule-timeline-B1k8QkA6.js.map} +1 -1
  5. package/dist/_chunks/{appointment-card-BhcPJpXh.js → appointment-card-Dzr3GeVz.js} +73 -90
  6. package/dist/_chunks/appointment-card-Dzr3GeVz.js.map +1 -0
  7. package/dist/_chunks/{appointment-timeline-CMPvzlGZ.js → appointment-timeline-0mwtpErq.js} +3 -3
  8. package/dist/_chunks/{appointment-timeline-CMPvzlGZ.js.map → appointment-timeline-0mwtpErq.js.map} +1 -1
  9. package/dist/_chunks/{appointment-tray-3c_FLxXJ.js → appointment-tray-4FUu_5NX.js} +2 -2
  10. package/dist/_chunks/{appointment-tray-3c_FLxXJ.js.map → appointment-tray-4FUu_5NX.js.map} +1 -1
  11. package/dist/_chunks/armchair-BaLDW6Hz.js +23 -0
  12. package/dist/_chunks/armchair-BaLDW6Hz.js.map +1 -0
  13. package/dist/_chunks/{booking-CQMJUFG-.js → booking-DHkKcUIl.js} +4 -4
  14. package/dist/_chunks/{booking-CQMJUFG-.js.map → booking-DHkKcUIl.js.map} +1 -1
  15. package/dist/_chunks/{calendar-4dXTvsCz.js → calendar-B4Gnyu1C.js} +553 -437
  16. package/dist/_chunks/calendar-B4Gnyu1C.js.map +1 -0
  17. package/dist/_chunks/calendar-event-card-Bjdbik8G.js +425 -0
  18. package/dist/_chunks/calendar-event-card-Bjdbik8G.js.map +1 -0
  19. package/dist/_chunks/{care-plan-card-DQjVRDxO.js → care-plan-card-aDN4oem9.js} +3 -3
  20. package/dist/_chunks/{care-plan-card-DQjVRDxO.js.map → care-plan-card-aDN4oem9.js.map} +1 -1
  21. package/dist/_chunks/{care-plan-entry-card-CMpoeNkb.js → care-plan-entry-card-BEhANdBE.js} +2 -2
  22. package/dist/_chunks/{care-plan-entry-card-CMpoeNkb.js.map → care-plan-entry-card-BEhANdBE.js.map} +1 -1
  23. package/dist/_chunks/{care-plan-header-CxYoq23f.js → care-plan-header-CkpPyQqG.js} +2 -2
  24. package/dist/_chunks/{care-plan-header-CxYoq23f.js.map → care-plan-header-CkpPyQqG.js.map} +1 -1
  25. package/dist/_chunks/{color-picker-D-tUwxxT.js → color-picker-oZ6zYks8.js} +164 -151
  26. package/dist/_chunks/color-picker-oZ6zYks8.js.map +1 -0
  27. package/dist/_chunks/control-room-rail-Cj2iX9h_.js +337 -0
  28. package/dist/_chunks/control-room-rail-Cj2iX9h_.js.map +1 -0
  29. package/dist/_chunks/{cycle-calculator-DzgO1vzP.js → cycle-calculator-DmtYGhqq.js} +3 -3
  30. package/dist/_chunks/{cycle-calculator-DzgO1vzP.js.map → cycle-calculator-DmtYGhqq.js.map} +1 -1
  31. package/dist/_chunks/{date-picker-Bp64zk2p.js → date-picker-CepI_oI2.js} +77 -74
  32. package/dist/_chunks/date-picker-CepI_oI2.js.map +1 -0
  33. package/dist/_chunks/{date-picker-variants-pKAJfnWr.js → date-picker-variants-DfuooXEK.js} +7 -2
  34. package/dist/_chunks/{date-picker-variants-pKAJfnWr.js.map → date-picker-variants-DfuooXEK.js.map} +1 -1
  35. package/dist/_chunks/{date-range-picker-CDrZ8Zh0.js → date-range-picker-BD8P_rJq.js} +46 -45
  36. package/dist/_chunks/{date-range-picker-CDrZ8Zh0.js.map → date-range-picker-BD8P_rJq.js.map} +1 -1
  37. package/dist/_chunks/{date-time-picker-DVETwpzc.js → date-time-picker-3I2vVKGV.js} +2 -2
  38. package/dist/_chunks/{date-time-picker-DVETwpzc.js.map → date-time-picker-3I2vVKGV.js.map} +1 -1
  39. package/dist/_chunks/{due-date-calculator-wK8Tajzz.js → due-date-calculator-BF_Ikofx.js} +4 -4
  40. package/dist/_chunks/{due-date-calculator-wK8Tajzz.js.map → due-date-calculator-BF_Ikofx.js.map} +1 -1
  41. package/dist/_chunks/{entity-card-9_62gY7l.js → entity-card-DmrgYSEX.js} +4 -4
  42. package/dist/_chunks/{entity-card-9_62gY7l.js.map → entity-card-DmrgYSEX.js.map} +1 -1
  43. package/dist/_chunks/{gestational-age-calculator-C_uDAeP_.js → gestational-age-calculator-CxZelpu2.js} +5 -5
  44. package/dist/_chunks/{gestational-age-calculator-C_uDAeP_.js.map → gestational-age-calculator-CxZelpu2.js.map} +1 -1
  45. package/dist/_chunks/{hcg-doubling-BaXkJhT-.js → hcg-doubling-CpU7H5rQ.js} +3 -3
  46. package/dist/_chunks/{hcg-doubling-BaXkJhT-.js.map → hcg-doubling-CpU7H5rQ.js.map} +1 -1
  47. package/dist/_chunks/{link-cell-renderer-DH4JYpKU.js → link-cell-renderer-BZQtsuFz.js} +2 -2
  48. package/dist/_chunks/{link-cell-renderer-DH4JYpKU.js.map → link-cell-renderer-BZQtsuFz.js.map} +1 -1
  49. package/dist/_chunks/{notes-panel-DlnENphf.js → notes-panel-e9cJWVRg.js} +2 -2
  50. package/dist/_chunks/{notes-panel-DlnENphf.js.map → notes-panel-e9cJWVRg.js.map} +1 -1
  51. package/dist/_chunks/{operator-hero-CCDnIa1S.js → operator-hero-BnFv-Uef.js} +2 -2
  52. package/dist/_chunks/{operator-hero-CCDnIa1S.js.map → operator-hero-BnFv-Uef.js.map} +1 -1
  53. package/dist/_chunks/{parse-JqixfsU0.js → parse-MN9bGkrY.js} +2 -2
  54. package/dist/_chunks/{parse-JqixfsU0.js.map → parse-MN9bGkrY.js.map} +1 -1
  55. package/dist/_chunks/{patient-details-qnsqYBGQ.js → patient-details-xrqe13az.js} +160 -159
  56. package/dist/_chunks/patient-details-xrqe13az.js.map +1 -0
  57. package/dist/_chunks/{patient-table-DwshfVsQ.js → patient-table-BqYomX50.js} +2 -2
  58. package/dist/_chunks/{patient-table-DwshfVsQ.js.map → patient-table-BqYomX50.js.map} +1 -1
  59. package/dist/_chunks/{payment-automation-upsell-BBIG7NFL.js → payment-automation-upsell-DwQW2fRp.js} +52 -63
  60. package/dist/_chunks/payment-automation-upsell-DwQW2fRp.js.map +1 -0
  61. package/dist/_chunks/{payment-request-card-BjjBMdsp.js → payment-request-card-YVCcCZ25.js} +2 -2
  62. package/dist/_chunks/{payment-request-card-BjjBMdsp.js.map → payment-request-card-YVCcCZ25.js.map} +1 -1
  63. package/dist/_chunks/{pregnancy-dating-BVS_9YU2.js → pregnancy-dating-DtToyMyc.js} +5 -5
  64. package/dist/_chunks/{pregnancy-dating-BVS_9YU2.js.map → pregnancy-dating-DtToyMyc.js.map} +1 -1
  65. package/dist/_chunks/{radiograph-panel.agent-CiHwgISa.js → radiograph-panel.agent-C3trfWqB.js} +3 -3
  66. package/dist/_chunks/{radiograph-panel.agent-CiHwgISa.js.map → radiograph-panel.agent-C3trfWqB.js.map} +1 -1
  67. package/dist/_chunks/repeat-CvQa5rZt.js +17 -0
  68. package/dist/_chunks/repeat-CvQa5rZt.js.map +1 -0
  69. package/dist/_chunks/resource-chip-DYTG0IQQ.js +83 -0
  70. package/dist/_chunks/resource-chip-DYTG0IQQ.js.map +1 -0
  71. package/dist/_chunks/{rich-text-editor-DARnq_6N.js → rich-text-editor-BDfFtK4H.js} +2 -2
  72. package/dist/_chunks/{rich-text-editor-DARnq_6N.js.map → rich-text-editor-BDfFtK4H.js.map} +1 -1
  73. package/dist/_chunks/subDays-BLl3y3pd.js +8 -0
  74. package/dist/_chunks/{subDays-CAUv47M1.js.map → subDays-BLl3y3pd.js.map} +1 -1
  75. package/dist/agent-catalog.json +2 -2
  76. package/dist/components/_shared/date-picker-variants.d.ts.map +1 -1
  77. package/dist/components/appointment-card/index.js +2 -2
  78. package/dist/components/appointment-timeline/index.js +1 -1
  79. package/dist/components/booking/index.js +1 -1
  80. package/dist/components/calendar/calendar.agent.d.ts.map +1 -1
  81. package/dist/components/calendar/calendar.d.ts +138 -12
  82. package/dist/components/calendar/calendar.d.ts.map +1 -1
  83. package/dist/components/calendar/index.js +1 -1
  84. package/dist/components/calendar-event-card/calendar-event-card.d.ts +48 -11
  85. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  86. package/dist/components/calendar-event-card/index.js +1 -1
  87. package/dist/components/care-plan-card/index.js +1 -1
  88. package/dist/components/care-plan-entry-card/index.js +1 -1
  89. package/dist/components/care-plan-header/index.js +1 -1
  90. package/dist/components/color-picker/index.d.ts +1 -1
  91. package/dist/components/color-picker/index.d.ts.map +1 -1
  92. package/dist/components/color-picker/index.js +4 -3
  93. package/dist/components/color-picker/palettes.d.ts +10 -0
  94. package/dist/components/color-picker/palettes.d.ts.map +1 -1
  95. package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
  96. package/dist/components/control-room-rail/control-room-rail.d.ts.map +1 -1
  97. package/dist/components/control-room-rail/index.js +1 -1
  98. package/dist/components/cycle-calculator/index.js +1 -1
  99. package/dist/components/data-table/index.js +1 -1
  100. package/dist/components/date-picker/date-picker.d.ts +11 -0
  101. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  102. package/dist/components/date-picker/index.js +1 -1
  103. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
  104. package/dist/components/date-range-picker/index.js +1 -1
  105. package/dist/components/date-time-picker/index.js +1 -1
  106. package/dist/components/due-date-calculator/index.js +2 -2
  107. package/dist/components/gestational-age-calculator/index.js +1 -1
  108. package/dist/components/hcg-doubling/index.js +1 -1
  109. package/dist/components/index.d.ts +1 -0
  110. package/dist/components/index.d.ts.map +1 -1
  111. package/dist/components/notes-panel/index.js +1 -1
  112. package/dist/components/operator-hero/index.js +1 -1
  113. package/dist/components/patient-details/index.js +1 -1
  114. package/dist/components/patient-details/patient-details.d.ts +8 -0
  115. package/dist/components/patient-details/patient-details.d.ts.map +1 -1
  116. package/dist/components/patient-table/index.js +1 -1
  117. package/dist/components/payment-card/index.js +1 -1
  118. package/dist/components/pregnancy-dating/index.js +1 -1
  119. package/dist/components/radiograph-panel/index.js +1 -1
  120. package/dist/components/resource-chip/index.d.ts +3 -0
  121. package/dist/components/resource-chip/index.d.ts.map +1 -0
  122. package/dist/components/resource-chip/index.js +5 -0
  123. package/dist/components/resource-chip/index.js.map +1 -0
  124. package/dist/components/resource-chip/resource-chip.d.ts +26 -0
  125. package/dist/components/resource-chip/resource-chip.d.ts.map +1 -0
  126. package/dist/components/rich-text-editor/index.js +1 -1
  127. package/dist/host-compat.css +7 -1
  128. package/dist/i18n/locales/ar.d.ts +4 -0
  129. package/dist/i18n/locales/ar.d.ts.map +1 -1
  130. package/dist/i18n/locales/ar.js +4 -0
  131. package/dist/i18n/locales/ar.js.map +1 -1
  132. package/dist/i18n/locales/de.d.ts +4 -0
  133. package/dist/i18n/locales/de.d.ts.map +1 -1
  134. package/dist/i18n/locales/de.js +4 -0
  135. package/dist/i18n/locales/de.js.map +1 -1
  136. package/dist/i18n/locales/el.d.ts +4 -0
  137. package/dist/i18n/locales/el.d.ts.map +1 -1
  138. package/dist/i18n/locales/el.js +4 -0
  139. package/dist/i18n/locales/el.js.map +1 -1
  140. package/dist/i18n/locales/en.d.ts +4 -0
  141. package/dist/i18n/locales/en.d.ts.map +1 -1
  142. package/dist/i18n/locales/en.js +4 -0
  143. package/dist/i18n/locales/en.js.map +1 -1
  144. package/dist/i18n/locales/es.d.ts +4 -0
  145. package/dist/i18n/locales/es.d.ts.map +1 -1
  146. package/dist/i18n/locales/es.js +4 -0
  147. package/dist/i18n/locales/es.js.map +1 -1
  148. package/dist/i18n/locales/fr.d.ts +4 -0
  149. package/dist/i18n/locales/fr.d.ts.map +1 -1
  150. package/dist/i18n/locales/fr.js +4 -0
  151. package/dist/i18n/locales/fr.js.map +1 -1
  152. package/dist/i18n/locales/hi.d.ts +4 -0
  153. package/dist/i18n/locales/hi.d.ts.map +1 -1
  154. package/dist/i18n/locales/hi.js +4 -0
  155. package/dist/i18n/locales/hi.js.map +1 -1
  156. package/dist/i18n/locales/it.d.ts +4 -0
  157. package/dist/i18n/locales/it.d.ts.map +1 -1
  158. package/dist/i18n/locales/it.js +4 -0
  159. package/dist/i18n/locales/it.js.map +1 -1
  160. package/dist/i18n/locales/ja.d.ts +4 -0
  161. package/dist/i18n/locales/ja.d.ts.map +1 -1
  162. package/dist/i18n/locales/ja.js +4 -0
  163. package/dist/i18n/locales/ja.js.map +1 -1
  164. package/dist/i18n/locales/nl.d.ts +4 -0
  165. package/dist/i18n/locales/nl.d.ts.map +1 -1
  166. package/dist/i18n/locales/nl.js +4 -0
  167. package/dist/i18n/locales/nl.js.map +1 -1
  168. package/dist/i18n/locales/pl.d.ts +4 -0
  169. package/dist/i18n/locales/pl.d.ts.map +1 -1
  170. package/dist/i18n/locales/pl.js +4 -0
  171. package/dist/i18n/locales/pl.js.map +1 -1
  172. package/dist/i18n/locales/pt.d.ts +4 -0
  173. package/dist/i18n/locales/pt.d.ts.map +1 -1
  174. package/dist/i18n/locales/pt.js +4 -0
  175. package/dist/i18n/locales/pt.js.map +1 -1
  176. package/dist/i18n/locales/ro.d.ts +4 -0
  177. package/dist/i18n/locales/ro.d.ts.map +1 -1
  178. package/dist/i18n/locales/ro.js +4 -0
  179. package/dist/i18n/locales/ro.js.map +1 -1
  180. package/dist/i18n/locales/ru.d.ts +4 -0
  181. package/dist/i18n/locales/ru.d.ts.map +1 -1
  182. package/dist/i18n/locales/ru.js +4 -0
  183. package/dist/i18n/locales/ru.js.map +1 -1
  184. package/dist/i18n/locales/sq.d.ts +4 -0
  185. package/dist/i18n/locales/sq.d.ts.map +1 -1
  186. package/dist/i18n/locales/sq.js +4 -0
  187. package/dist/i18n/locales/sq.js.map +1 -1
  188. package/dist/i18n/locales/sv.d.ts +4 -0
  189. package/dist/i18n/locales/sv.d.ts.map +1 -1
  190. package/dist/i18n/locales/sv.js +4 -0
  191. package/dist/i18n/locales/sv.js.map +1 -1
  192. package/dist/i18n/locales/tr.d.ts +4 -0
  193. package/dist/i18n/locales/tr.d.ts.map +1 -1
  194. package/dist/i18n/locales/tr.js +4 -0
  195. package/dist/i18n/locales/tr.js.map +1 -1
  196. package/dist/i18n/locales/zh.d.ts +4 -0
  197. package/dist/i18n/locales/zh.d.ts.map +1 -1
  198. package/dist/i18n/locales/zh.js +4 -0
  199. package/dist/i18n/locales/zh.js.map +1 -1
  200. package/dist/index.js +961 -958
  201. package/dist/index.js.map +1 -1
  202. package/dist/locales/ar.json +4 -0
  203. package/dist/locales/de.json +4 -0
  204. package/dist/locales/el.json +4 -0
  205. package/dist/locales/en.json +4 -0
  206. package/dist/locales/es.json +4 -0
  207. package/dist/locales/fr.json +4 -0
  208. package/dist/locales/hi.json +4 -0
  209. package/dist/locales/it.json +4 -0
  210. package/dist/locales/ja.json +4 -0
  211. package/dist/locales/nl.json +4 -0
  212. package/dist/locales/pl.json +4 -0
  213. package/dist/locales/pt.json +4 -0
  214. package/dist/locales/ro.json +4 -0
  215. package/dist/locales/ru.json +4 -0
  216. package/dist/locales/sq.json +4 -0
  217. package/dist/locales/sv.json +4 -0
  218. package/dist/locales/tr.json +4 -0
  219. package/dist/locales/zh.json +4 -0
  220. package/dist/patterns/anamnesis/index.js +1 -1
  221. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  222. package/dist/tokens.css +40 -24
  223. package/package.json +5 -1
  224. package/dist/_chunks/appointment-card-BhcPJpXh.js.map +0 -1
  225. package/dist/_chunks/calendar-4dXTvsCz.js.map +0 -1
  226. package/dist/_chunks/calendar-event-card-C6qGtywL.js +0 -257
  227. package/dist/_chunks/calendar-event-card-C6qGtywL.js.map +0 -1
  228. package/dist/_chunks/color-picker-D-tUwxxT.js.map +0 -1
  229. package/dist/_chunks/control-room-rail-IH1eBjrK.js +0 -333
  230. package/dist/_chunks/control-room-rail-IH1eBjrK.js.map +0 -1
  231. package/dist/_chunks/date-picker-Bp64zk2p.js.map +0 -1
  232. package/dist/_chunks/patient-details-qnsqYBGQ.js.map +0 -1
  233. package/dist/_chunks/payment-automation-upsell-BBIG7NFL.js.map +0 -1
  234. package/dist/_chunks/subDays-CAUv47M1.js +0 -8
@@ -1,257 +0,0 @@
1
- import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as H } from "react";
3
- import { useTranslation as T } from "react-i18next";
4
- import { c as h } from "./index-D2ZczOXr.js";
5
- import { c as d } from "./createLucideIcon-DhHxpK9K.js";
6
- import { C as V } from "./check-DrFSN__t.js";
7
- import { S as $ } from "./stethoscope-sZXGC43m.js";
8
- import { C as O } from "./clock-Drd4Wtis.js";
9
- import { G as C } from "./globe-sHBW1JN5.js";
10
- import { T as U } from "./triangle-alert-CBnO6nq_.js";
11
- import { H as q } from "./heart-pulse-BCppJyN2.js";
12
- import { V as B } from "./video-BheNGvsu.js";
13
- /**
14
- * @license lucide-react v1.22.0 - ISC
15
- *
16
- * This source code is licensed under the ISC license.
17
- * See the LICENSE file in the root directory of this source tree.
18
- */
19
- const G = [
20
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
21
- ["path", { d: "M4.929 4.929 19.07 19.071", key: "196cmz" }]
22
- ], Z = d("ban", G);
23
- /**
24
- * @license lucide-react v1.22.0 - ISC
25
- *
26
- * This source code is licensed under the ISC license.
27
- * See the LICENSE file in the root directory of this source tree.
28
- */
29
- const K = [
30
- ["path", { d: "M4 10h12", key: "1y6xl8" }],
31
- ["path", { d: "M4 14h9", key: "1loblj" }],
32
- [
33
- "path",
34
- {
35
- d: "M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",
36
- key: "1j6lzo"
37
- }
38
- ]
39
- ], P = d("euro", K);
40
- /**
41
- * @license lucide-react v1.22.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */
46
- const R = [
47
- [
48
- "path",
49
- {
50
- d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",
51
- key: "emmmcr"
52
- }
53
- ],
54
- ["path", { d: "M7 10v12", key: "1qc93n" }]
55
- ], W = d("thumbs-up", R);
56
- /**
57
- * @license lucide-react v1.22.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */
62
- const Y = [
63
- [
64
- "path",
65
- {
66
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
67
- key: "1xq2db"
68
- }
69
- ]
70
- ], D = d("zap", Y);
71
- function F(t) {
72
- if (typeof t != "string") return null;
73
- const n = t.trim();
74
- if (!n.startsWith("#")) return null;
75
- const e = n.slice(1);
76
- let s, o, a;
77
- if (e.length === 3) {
78
- if (!/^[0-9a-f]{3}$/i.test(e)) return null;
79
- s = parseInt(e[0] + e[0], 16), o = parseInt(e[1] + e[1], 16), a = parseInt(e[2] + e[2], 16);
80
- } else if (e.length === 6) {
81
- if (!/^[0-9a-f]{6}$/i.test(e)) return null;
82
- s = parseInt(e.slice(0, 2), 16), o = parseInt(e.slice(2, 4), 16), a = parseInt(e.slice(4, 6), 16);
83
- } else
84
- return null;
85
- return [s / 255, o / 255, a / 255];
86
- }
87
- function J([t, n, e]) {
88
- const s = (o) => o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
89
- return 0.2126 * s(t) + 0.7152 * s(n) + 0.0722 * s(e);
90
- }
91
- function ge(t, n, e) {
92
- }
93
- function Q(t) {
94
- const n = F(t);
95
- return n ? J(n) > 0.1791 ? "on-light" : "on-dark" : null;
96
- }
97
- const X = {
98
- confirmed: W,
99
- waiting: O,
100
- in_care: $,
101
- done: V,
102
- cancelled: Z,
103
- absent: D
104
- }, ee = {
105
- confirmed: "calendar.status.confirmed",
106
- waiting: "calendar.status.waiting",
107
- in_care: "calendar.status.inCare",
108
- done: "calendar.status.done",
109
- cancelled: "calendar.status.cancelled",
110
- absent: "calendar.status.absent"
111
- }, ae = h(
112
- [
113
- // layout — verbatim from the Calendar's former eventCardVariants base,
114
- // plus ds:relative for the accent bar's positioning context
115
- "ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
116
- "ds:w-full ds:h-full",
117
- "ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]",
118
- "ds:rounded-[var(--radius-sm)]",
119
- "ds:text-[length:var(--font-size-sm)]",
120
- "ds:font-[var(--font-weight-medium)]",
121
- "ds:overflow-hidden",
122
- // kept verbatim from the former base (inert on a non-focusable div
123
- // inside FC; harmless)
124
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
125
- "ds:focus-visible:outline-[var(--ring)]",
126
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
127
- // SINGLE PAINTED SURFACE — always present, never conditional. One
128
- // declaration per paint channel; value chain = "caller custom prop,
129
- // else token". This structurally eliminates the CVA-vs-override
130
- // specificity race (the old double-paint bug) — stylesheet order
131
- // becomes irrelevant.
132
- "ds:[background-color:var(--calendar-event-bg,var(--primary))]",
133
- "ds:[color:var(--calendar-event-text,var(--primary-foreground))]",
134
- "ds:border ds:[border-color:var(--calendar-event-border,transparent)]"
135
- ].join(" "),
136
- {
137
- variants: {
138
- // Do not add colour classes to this axis — status is icon + accent
139
- // + aria only; a unit test asserts identical computed background
140
- // across all six statuses.
141
- status: {
142
- none: "",
143
- confirmed: "",
144
- waiting: "",
145
- in_care: "",
146
- done: "",
147
- cancelled: "ds:line-through",
148
- absent: ""
149
- },
150
- bookedOnline: {
151
- // class name kept as a stable inert DOM hook; the stripe paint
152
- // lives here (moved from fullcalendar-theme.css) so it works in
153
- // the card's own stories, outside .fc-theme-alfadocs.
154
- // currentcolor = resolved ink, so stripes stay visible over any
155
- // picker colour.
156
- true: "event-booked-online ds:bg-[image:repeating-linear-gradient(45deg,transparent,transparent_4px,color-mix(in_srgb,currentcolor_10%,transparent)_4px,color-mix(in_srgb,currentcolor_10%,transparent)_8px)]",
157
- false: ""
158
- }
159
- },
160
- defaultVariants: { status: "none", bookedOnline: !1 }
161
- }
162
- ), ne = h(
163
- "ds:absolute ds:inset-y-0 ds:start-0 ds:w-[3px]",
164
- {
165
- variants: {
166
- status: {
167
- confirmed: "ds:[background-color:var(--success)]",
168
- waiting: "ds:[background-color:var(--info)]",
169
- in_care: "ds:[background-color:var(--primary)]",
170
- done: "ds:[background-color:var(--success)]",
171
- cancelled: "ds:[background-color:var(--destructive)]",
172
- absent: "ds:[background-color:var(--warning)]"
173
- }
174
- }
175
- }
176
- ), te = H(
177
- ({
178
- title: t,
179
- suffix: n,
180
- rangeText: e,
181
- showTime: s = !0,
182
- allDay: o = !1,
183
- status: a,
184
- statusAccent: b = !0,
185
- backgroundColor: i,
186
- textColor: l,
187
- borderColor: c,
188
- isBookedOnline: f = !1,
189
- hasUnassignedPatient: x,
190
- hasHighlightedAnamnesis: k,
191
- hasBillableAmount: _,
192
- isTelehealth: y,
193
- resourceLabel: w,
194
- eventId: z,
195
- className: N,
196
- style: m,
197
- "aria-label": I,
198
- ...A
199
- }, L) => {
200
- const { t: S } = T(), p = a ? X[a] : null, M = a ? S(ee[a]) : void 0, j = I ?? [t, e, w, M].filter(Boolean).join(", "), u = !l && i ? Q(i) : null, v = i || l || c ? {
201
- ...i ? { "--calendar-event-bg": i } : {},
202
- ...l ? { "--calendar-event-text": l } : u === "on-light" ? { "--calendar-event-text": "var(--event-ink-on-light)" } : u === "on-dark" ? { "--calendar-event-text": "var(--event-ink-on-dark)" } : {},
203
- ...c ? { "--calendar-event-border": c } : {}
204
- } : void 0, E = m || v ? { ...m, ...v } : void 0;
205
- return /* @__PURE__ */ g(
206
- "div",
207
- {
208
- ref: L,
209
- ...A,
210
- className: ae({
211
- status: a ?? "none",
212
- bookedOnline: f,
213
- className: N
214
- }),
215
- style: E,
216
- "aria-label": j,
217
- "data-component": "calendar-event-card",
218
- "data-event-id": z,
219
- "data-status": a ?? "none",
220
- "data-contrast": l ? "custom" : u ?? "default",
221
- children: [
222
- a && b ? /* @__PURE__ */ r(
223
- "span",
224
- {
225
- "aria-hidden": "true",
226
- "data-slot": "status-accent",
227
- className: ne({ status: a })
228
- }
229
- ) : null,
230
- /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-end", children: [
231
- p ? /* @__PURE__ */ r(p, { size: 14, "aria-hidden": "true" }) : null,
232
- f ? /* @__PURE__ */ r(C, { size: 12, "aria-hidden": "true" }) : null,
233
- x ? /* @__PURE__ */ r(U, { size: 12, "aria-hidden": "true" }) : null,
234
- k ? /* @__PURE__ */ r(q, { size: 12, "aria-hidden": "true" }) : null,
235
- _ ? /* @__PURE__ */ r(P, { size: 12, "aria-hidden": "true" }) : null,
236
- y ? /* @__PURE__ */ r(B, { size: 12, "aria-hidden": "true" }) : null
237
- ] }),
238
- s && !o && e ? (
239
- // No opacity here — composing 70% over saturated bgs drops
240
- // effective contrast below WCAG AA. The smaller font-size-xs vs
241
- // the title's font-weight-semibold provides sufficient visual
242
- // hierarchy.
243
- /* @__PURE__ */ r("span", { className: "ds:text-[length:var(--font-size-xs)]", children: e })
244
- ) : null,
245
- /* @__PURE__ */ r("span", { className: "ds:font-[var(--font-weight-semibold)] ds:truncate ds:text-start", children: t }),
246
- n ? /* @__PURE__ */ r("span", { className: "ds:truncate ds:text-start ds:text-[length:var(--font-size-xs)]", children: n }) : null
247
- ]
248
- }
249
- );
250
- }
251
- );
252
- te.displayName = "CalendarEventCard";
253
- export {
254
- te as C,
255
- ge as w
256
- };
257
- //# sourceMappingURL=calendar-event-card-C6qGtywL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendar-event-card-C6qGtywL.js","sources":["../../node_modules/lucide-react/dist/esm/icons/ban.mjs","../../node_modules/lucide-react/dist/esm/icons/euro.mjs","../../node_modules/lucide-react/dist/esm/icons/thumbs-up.mjs","../../node_modules/lucide-react/dist/esm/icons/zap.mjs","../../src/components/_shared/contrast-warning.ts","../../src/components/calendar-event-card/calendar-event-card.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M4.929 4.929 19.07 19.071\", key: \"196cmz\" }]\n];\nconst Ban = createLucideIcon(\"ban\", __iconNode);\n\nexport { __iconNode, Ban as default };\n//# sourceMappingURL=ban.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M4 10h12\", key: \"1y6xl8\" }],\n [\"path\", { d: \"M4 14h9\", key: \"1loblj\" }],\n [\n \"path\",\n {\n d: \"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2\",\n key: \"1j6lzo\"\n }\n ]\n];\nconst Euro = createLucideIcon(\"euro\", __iconNode);\n\nexport { __iconNode, Euro as default };\n//# sourceMappingURL=euro.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\",\n key: \"emmmcr\"\n }\n ],\n [\"path\", { d: \"M7 10v12\", key: \"1qc93n\" }]\n];\nconst ThumbsUp = createLucideIcon(\"thumbs-up\", __iconNode);\n\nexport { __iconNode, ThumbsUp as default };\n//# sourceMappingURL=thumbs-up.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n key: \"1xq2db\"\n }\n ]\n];\nconst Zap = createLucideIcon(\"zap\", __iconNode);\n\nexport { __iconNode, Zap as default };\n//# sourceMappingURL=zap.mjs.map\n","/* ------------------------------------------------------------------ */\n/* Shared contrast guardrail — Calendar + CalendarEventCard */\n/* */\n/* The consuming app supplies runtime hex pairs at several surfaces: */\n/* - event.backgroundColor / event.textColor (+ event.borderColor) */\n/* - modeBannerColor / modeBannerTextColor */\n/* - resource.color / resource.shortTitleTextColor */\n/* */\n/* When the text half of the pair is also a hex (i.e. both halves come */\n/* from the caller), we can validate them synchronously and warn the */\n/* consuming-app developer during DEV if the pair fails WCAG AA normal */\n/* text (4.5:1). When only the background half is supplied, */\n/* `resolveInk` derives a provably AA-safe black/white ink for it. */\n/* Every helper is a no-op in production builds. */\n/* ------------------------------------------------------------------ */\n\n/* Module-level dedup set — keyed on the (bg, fg, context) tuple so the\n same bad pair moving around the calendar only warns once per session.\n Exposed via `resetContrastWarnings()` for test isolation. */\nconst warnedTuples = new Set<string>();\n\n/** Reset the dedup set — intended for use between tests. */\nexport function resetContrastWarnings(): void {\n warnedTuples.clear();\n}\n\n/**\n * Parse a 3-char or 6-char `#RRGGBB` hex string into a linear sRGB\n * triple in the [0,1] range. Returns `null` for any input the caller\n * can't parse (malformed prefix, bad length, non-hex characters) —\n * the helper stays silent in that case rather than emitting noise.\n */\nfunction parseHex(hex: string): [number, number, number] | null {\n if (typeof hex !== 'string') return null;\n const trimmed = hex.trim();\n if (!trimmed.startsWith('#')) return null;\n const body = trimmed.slice(1);\n let r: number;\n let g: number;\n let b: number;\n if (body.length === 3) {\n if (!/^[0-9a-f]{3}$/i.test(body)) return null;\n r = parseInt(body[0] + body[0], 16);\n g = parseInt(body[1] + body[1], 16);\n b = parseInt(body[2] + body[2], 16);\n } else if (body.length === 6) {\n if (!/^[0-9a-f]{6}$/i.test(body)) return null;\n r = parseInt(body.slice(0, 2), 16);\n g = parseInt(body.slice(2, 4), 16);\n b = parseInt(body.slice(4, 6), 16);\n } else {\n return null;\n }\n return [r / 255, g / 255, b / 255];\n}\n\n/**\n * WCAG 2.1 relative luminance. Each channel is gamma-corrected then\n * weighted against the CIE photopic sensitivity of the human eye.\n * https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n */\nfunction relativeLuminance([r, g, b]: [number, number, number]): number {\n const lin = (c: number): number =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);\n}\n\n/**\n * WCAG 2.1 contrast ratio. Always returns a value in [1, 21]; the\n * relative-luminance lighter-over-darker convention is applied here.\n */\nfunction contrastRatio(\n bg: [number, number, number],\n fg: [number, number, number],\n): number {\n const l1 = relativeLuminance(bg);\n const l2 = relativeLuminance(fg);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * DEV-only WCAG AA guardrail for caller-supplied hex pairs.\n *\n * - No-op when `import.meta.env.DEV` is false.\n * - No-op when either half of the pair is missing (the \"fg missing →\n * inherits DS token\" case is a docs concern; the DS token isn't a\n * hex at runtime so we can't check it here).\n * - No-op when either hex can't be parsed (silent — not the helper's\n * concern to police malformed input).\n * - Deduplicated by `(bgHex, fgHex, contextLabel)` tuple so moving a\n * ratio-bad event around the calendar doesn't spam the console.\n *\n * @param bgHex - Caller-supplied background hex (e.g. `'#c2185b'`)\n * @param fgHex - Caller-supplied foreground hex (e.g. `'#ffffff'`)\n * @param contextLabel - Short description for the warning (e.g. `'event e1'`).\n */\nexport function warnLowContrast(\n bgHex: string | undefined,\n fgHex: string | undefined,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (!bgHex || !fgHex) return;\n\n const bg = parseHex(bgHex);\n const fg = parseHex(fgHex);\n if (!bg || !fg) return;\n\n const ratio = contrastRatio(bg, fg);\n if (ratio >= 4.5) return;\n\n const key = `${bgHex}|${fgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n /* `bg` parsed successfully above, so `resolveInk(bgHex)` is guaranteed\n to produce a compliant ink — the omit-textColor hint is always valid\n at this point. */\n console.warn(\n `[Calendar] Low contrast on ${contextLabel}: ${bgHex} / ${fgHex} (ratio ${ratio.toFixed(\n 2,\n )}, target 4.5). Pass a matching textColor/fgHex, pick a higher-contrast background, or omit textColor to let the kit choose a compliant ink.`,\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Ink derivation — bg-only caller colours */\n/* ------------------------------------------------------------------ */\n\nexport type EventInk = 'on-light' | 'on-dark';\n\n/**\n * Pick the ink for an arbitrary opaque bg hex. Returns `null` when the\n * input can't be parsed (`#rgb` / `#rrggbb` only).\n *\n * The threshold 0.1791 is the relative luminance at which\n * `contrast(bg, #fff) === contrast(bg, #000)`; the better of the two\n * always yields ≥ 4.58:1 (the minimum, at a mid-grey ≈ `#757575`) —\n * provably WCAG AA-safe for any opaque background.\n */\nexport function resolveInk(bgHex: string): EventInk | null {\n const bg = parseHex(bgHex);\n if (!bg) return null;\n // threshold where contrast(bg, #fff) === contrast(bg, #000)\n return relativeLuminance(bg) > 0.1791 ? 'on-light' : 'on-dark';\n}\n\n/**\n * DEV-only, one-shot warning for a caller `backgroundColor` the kit can't\n * parse (`rgb(…)`, keywords, malformed hex). The browser can still paint\n * it, but the text falls back to the token default and contrast can't be\n * verified. Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnUnparseableBackground(\n bgHex: string,\n contextLabel: string,\n): void {\n if (!import.meta.env.DEV) return;\n if (parseHex(bgHex)) return;\n\n const key = `unparseable|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Unparseable backgroundColor on ${contextLabel}: \"${bgHex}\". ` +\n `Expected #rgb or #rrggbb — contrast cannot be verified and the text ` +\n `colour falls back to the token default.`,\n );\n}\n\n/**\n * DEV-only, one-shot warning for a near-white `backgroundColor`\n * (relative luminance > 0.9) supplied without a `borderColor` — the\n * event may be invisible against the calendar grid. The kit warns, it\n * does not repaint (delineation is decorative under WCAG 1.4.11 and the\n * consumer owns the picker colour). Deduplicated by `(bgHex, contextLabel)`.\n */\nexport function warnLowDelineation(bgHex: string, contextLabel: string): void {\n if (!import.meta.env.DEV) return;\n\n const bg = parseHex(bgHex);\n if (!bg) return;\n if (relativeLuminance(bg) <= 0.9) return;\n\n const key = `delineation|${bgHex}|${contextLabel}`;\n if (warnedTuples.has(key)) return;\n warnedTuples.add(key);\n\n console.warn(\n `[Calendar] Light backgroundColor without borderColor on ${contextLabel}: ` +\n `${bgHex} may be invisible against the grid — pass a borderColor ` +\n `(the platform convention sends a light-grey border for white backgrounds).`,\n );\n}\n","/* ------------------------------------------------------------------ */\n/* CalendarEventCard — the single painted surface of a calendar event. */\n/* */\n/* Colour model (platform parity): the caller's picker hex */\n/* (backgroundColor / textColor / borderColor) is the ONLY thing that */\n/* paints the card. `status` never paints the surface — it selects an */\n/* icon, an optional decorative accent bar, and (for `cancelled`) a */\n/* line-through. When no picker colour is supplied the surface falls */\n/* back to the theme's --primary / --primary-foreground pair. */\n/* */\n/* Non-interactive by design: inside FullCalendar the outer harness */\n/* anchor owns click/drag/focus; standalone consumers wrap the card in */\n/* their own button/link. No onClick in the contract. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef } from 'react';\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n ThumbsUp,\n Clock,\n Stethoscope,\n Check,\n Ban,\n Zap,\n Globe,\n TriangleAlert,\n HeartPulse,\n Euro,\n Video,\n type LucideIcon,\n} from 'lucide-react';\n// Type-only import — erased at build, no runtime cycle with calendar.tsx's\n// runtime import of this card. Do NOT convert to a value import.\nimport type { CalendarEventStatus } from '../calendar/calendar';\nimport {\n warnLowContrast,\n resolveInk,\n warnUnparseableBackground,\n warnLowDelineation,\n} from '../_shared/contrast-warning';\n\n/* ------------------------------------------------------------------ */\n/* Status lookups */\n/* ------------------------------------------------------------------ */\n\nconst STATUS_ICON: Record<CalendarEventStatus, LucideIcon> = {\n confirmed: ThumbsUp,\n waiting: Clock,\n in_care: Stethoscope,\n done: Check,\n cancelled: Ban,\n absent: Zap,\n};\n\n/* Status → i18n key lookup. Kept as a literal object (not a template)\n so static-analysis extractors can find every key. Keys already exist\n in all 18 locale bundles — do not add new ones here. */\nconst STATUS_LABEL_KEYS: Record<CalendarEventStatus, string> = {\n confirmed: 'calendar.status.confirmed',\n waiting: 'calendar.status.waiting',\n in_care: 'calendar.status.inCare',\n done: 'calendar.status.done',\n cancelled: 'calendar.status.cancelled',\n absent: 'calendar.status.absent',\n};\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst calendarEventCardVariants = cva(\n [\n // layout — verbatim from the Calendar's former eventCardVariants base,\n // plus ds:relative for the accent bar's positioning context\n 'ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n 'ds:w-full ds:h-full',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[length:var(--font-size-sm)]',\n 'ds:font-[var(--font-weight-medium)]',\n 'ds:overflow-hidden',\n // kept verbatim from the former base (inert on a non-focusable div\n // inside FC; harmless)\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // SINGLE PAINTED SURFACE — always present, never conditional. One\n // declaration per paint channel; value chain = \"caller custom prop,\n // else token\". This structurally eliminates the CVA-vs-override\n // specificity race (the old double-paint bug) — stylesheet order\n // becomes irrelevant.\n 'ds:[background-color:var(--calendar-event-bg,var(--primary))]',\n 'ds:[color:var(--calendar-event-text,var(--primary-foreground))]',\n 'ds:border ds:[border-color:var(--calendar-event-border,transparent)]',\n ].join(' '),\n {\n variants: {\n // Do not add colour classes to this axis — status is icon + accent\n // + aria only; a unit test asserts identical computed background\n // across all six statuses.\n status: {\n none: '',\n confirmed: '',\n waiting: '',\n in_care: '',\n done: '',\n cancelled: 'ds:line-through',\n absent: '',\n },\n bookedOnline: {\n // class name kept as a stable inert DOM hook; the stripe paint\n // lives here (moved from fullcalendar-theme.css) so it works in\n // the card's own stories, outside .fc-theme-alfadocs.\n // currentcolor = resolved ink, so stripes stay visible over any\n // picker colour.\n true: 'event-booked-online ds:bg-[image:repeating-linear-gradient(45deg,transparent,transparent_4px,color-mix(in_srgb,currentcolor_10%,transparent)_4px,color-mix(in_srgb,currentcolor_10%,transparent)_8px)]',\n false: '',\n },\n },\n defaultVariants: { status: 'none', bookedOnline: false },\n },\n);\n\n/* Status accent — a SEPARATE absolutely-positioned decorative element,\n not a border, so it can never collide with the caller's borderColor on\n the inline-start edge. The 3px width literal is the same\n decorative-geometry category as the former done-variant border-s-[3px]. */\nconst statusAccentVariants = cva(\n 'ds:absolute ds:inset-y-0 ds:start-0 ds:w-[3px]',\n {\n variants: {\n status: {\n confirmed: 'ds:[background-color:var(--success)]',\n waiting: 'ds:[background-color:var(--info)]',\n in_care: 'ds:[background-color:var(--primary)]',\n done: 'ds:[background-color:var(--success)]',\n cancelled: 'ds:[background-color:var(--destructive)]',\n absent: 'ds:[background-color:var(--warning)]',\n },\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\n/**\n * The single painted surface of a calendar event.\n *\n * Colour model (platform parity): the caller's picker hex\n * (`backgroundColor` / `textColor` / `borderColor`) is the ONLY thing that\n * paints the card. `status` never paints the surface — it selects an icon,\n * an optional decorative accent bar, and (for `cancelled`) a line-through.\n *\n * Non-interactive by design: inside FullCalendar the outer harness anchor\n * owns click/drag/focus; standalone consumers wrap the card in their own\n * button/link. No onClick in the contract.\n */\nexport interface CalendarEventCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /**\n * Primary line. Pass the ALREADY-MASKED title when privacy applies — the\n * card never receives a name it must not render, so it cannot leak it\n * (visually or via the composed aria-label).\n */\n title: string;\n /**\n * Secondary description line, normal weight, truncated. Note: the\n * Calendar's privacy mode does NOT mask the suffix (current behaviour,\n * preserved deliberately).\n */\n suffix?: string;\n /**\n * Pre-formatted, localised time range (e.g. \"09:00 – 09:45\"). The\n * Calendar adapter computes it via Intl.DateTimeFormat.formatRange.\n * Included in the composed aria-label whenever present (even when the\n * visual time line is suppressed via showTime/allDay — matches today's\n * Calendar behaviour byte-for-byte).\n */\n rangeText?: string;\n /**\n * Gates the VISUAL time line only (aria keeps rangeText). Mirrors\n * CalendarProps.showTime. @default true\n */\n showTime?: boolean;\n /**\n * All-day events suppress the visual time line (aria keeps rangeText).\n * @default false\n */\n allDay?: boolean;\n\n /**\n * Lifecycle state (6-state, matches the platform DoctorAppointment\n * lifecycle) → status icon + optional accent bar + line-through for\n * `cancelled` + localised label in the aria-label. NEVER paints the\n * card surface.\n */\n status?: CalendarEventStatus;\n /**\n * Render the 3px inline-start accent bar in the status's semantic token\n * colour. Purely decorative (aria-hidden) — the icon and aria-label carry\n * status regardless. The platform (colour = picker, status = icons only)\n * passes false via CalendarProps.eventStatusAccent. @default true\n */\n statusAccent?: boolean;\n\n /**\n * Runtime hex (#rgb or #rrggbb) from the consumer's colour picker — THE\n * painted surface. Injected as `--calendar-event-bg` via the sanctioned\n * inline custom-property pattern (23-constraints §inline-style exception).\n */\n backgroundColor?: string;\n /**\n * Runtime hex paired with backgroundColor. When omitted while\n * backgroundColor is set, the card auto-derives black/white ink by\n * luminance (provably WCAG AA ≥ 4.58:1 for any opaque colour).\n */\n textColor?: string;\n /**\n * Runtime hex border for delineating light surfaces. The platform sends\n * '#cccccc' when backgroundColor is '#ffffff' and omits it otherwise.\n * Falls back to transparent; border-width is constant (1px always\n * rendered), so toggling never shifts layout and event boundaries\n * survive forced-colors / Windows High Contrast for free.\n */\n borderColor?: string;\n\n /* Indicator icons — names identical to CalendarEvent fields (1:1 map). */\n /** Globe icon + diagonal stripe overlay. */\n isBookedOnline?: boolean;\n /** AlertTriangle icon. */\n hasUnassignedPatient?: boolean;\n /** HeartPulse icon. */\n hasHighlightedAnamnesis?: boolean;\n /** Euro icon. */\n hasBillableAmount?: boolean;\n /** Video icon. */\n isTelehealth?: boolean;\n\n /**\n * Resource title (chair/operator) woven into the composed aria-label\n * only — never rendered visually. The Calendar adapter resolves\n * resourceId → title before passing it.\n */\n resourceLabel?: string;\n /**\n * Stable event id → emitted as `data-event-id` (Calendar.focusEvent\n * targets it) and used as the contrast-warning dedup context.\n */\n eventId?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const CalendarEventCard = forwardRef<\n HTMLDivElement,\n CalendarEventCardProps\n>(\n (\n {\n title,\n suffix,\n rangeText,\n showTime = true,\n allDay = false,\n status,\n statusAccent = true,\n backgroundColor,\n textColor,\n borderColor,\n isBookedOnline = false,\n hasUnassignedPatient,\n hasHighlightedAnamnesis,\n hasBillableAmount,\n isTelehealth,\n resourceLabel,\n eventId,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const StatusIcon = status ? STATUS_ICON[status] : null;\n const statusLabel = status ? t(STATUS_LABEL_KEYS[status]) : undefined;\n\n /* Accessible name — exactly the Calendar's historical composition.\n An explicit consumer-supplied aria-label wins. rangeText is always\n included when present, even when the visual time line is hidden. */\n const ariaLabel =\n ariaLabelProp ??\n [title, rangeText, resourceLabel, statusLabel].filter(Boolean).join(', ');\n\n /* Ink derivation — only when the caller paints the surface without\n pairing a text colour. */\n const ink =\n !textColor && backgroundColor ? resolveInk(backgroundColor) : null;\n\n /* DEV-only guardrails — every helper no-ops in production and dedupes\n per session, so calling during render is safe. */\n const warnContext = eventId ? `event ${eventId}` : 'calendar-event-card';\n warnLowContrast(backgroundColor, textColor, warnContext);\n if (backgroundColor && !textColor) {\n // no-ops when the hex is parseable (i.e. when resolveInk succeeded)\n warnUnparseableBackground(backgroundColor, warnContext);\n }\n if (backgroundColor && !borderColor) {\n // no-ops unless the background is near-white (luminance > 0.9)\n warnLowDelineation(backgroundColor, warnContext);\n }\n\n /* Per-event colour override: the consuming app passes runtime hex from\n its colour picker. 23-constraints permits inline `style` only as a\n CSS custom-property setter for runtime values that can't be\n enumerated at build time — the consuming background-color / color /\n border-color declarations live in the CVA base as Tailwind arbitrary\n values with token fallbacks. */\n const colourOverrides: CSSProperties | undefined =\n backgroundColor || textColor || borderColor\n ? ({\n ...(backgroundColor\n ? { '--calendar-event-bg': backgroundColor }\n : {}),\n ...(textColor\n ? { '--calendar-event-text': textColor }\n : ink === 'on-light'\n ? { '--calendar-event-text': 'var(--event-ink-on-light)' }\n : ink === 'on-dark'\n ? { '--calendar-event-text': 'var(--event-ink-on-dark)' }\n : {}),\n ...(borderColor ? { '--calendar-event-border': borderColor } : {}),\n } as CSSProperties)\n : undefined;\n\n const mergedStyle: CSSProperties | undefined =\n style || colourOverrides ? { ...style, ...colourOverrides } : undefined;\n\n return (\n <div\n ref={ref}\n {...rest}\n className={calendarEventCardVariants({\n status: status ?? 'none',\n bookedOnline: isBookedOnline,\n className,\n })}\n // eslint-disable-next-line react/forbid-dom-props -- caller-supplied event bg/text/border hex injected via CSS variables (23-constraints §inline-style exception)\n style={mergedStyle}\n aria-label={ariaLabel}\n data-component=\"calendar-event-card\"\n data-event-id={eventId}\n data-status={status ?? 'none'}\n data-contrast={textColor ? 'custom' : (ink ?? 'default')}\n >\n {status && statusAccent ? (\n <span\n aria-hidden=\"true\"\n data-slot=\"status-accent\"\n className={statusAccentVariants({ status })}\n />\n ) : null}\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-end\">\n {/* All icons render in currentcolor — they inherit the resolved\n ink, so the ≥ 4.5:1 text guarantee makes every icon exceed the\n 3:1 graphics minimum (WCAG 1.4.11) on any picker surface.\n Never tint icons with status colours. */}\n {StatusIcon ? <StatusIcon size={14} aria-hidden=\"true\" /> : null}\n {isBookedOnline ? <Globe size={12} aria-hidden=\"true\" /> : null}\n {hasUnassignedPatient ? (\n <TriangleAlert size={12} aria-hidden=\"true\" />\n ) : null}\n {hasHighlightedAnamnesis ? (\n <HeartPulse size={12} aria-hidden=\"true\" />\n ) : null}\n {hasBillableAmount ? <Euro size={12} aria-hidden=\"true\" /> : null}\n {isTelehealth ? <Video size={12} aria-hidden=\"true\" /> : null}\n </div>\n {showTime && !allDay && rangeText ? (\n // No opacity here — composing 70% over saturated bgs drops\n // effective contrast below WCAG AA. The smaller font-size-xs vs\n // the title's font-weight-semibold provides sufficient visual\n // hierarchy.\n <span className=\"ds:text-[length:var(--font-size-xs)]\">\n {rangeText}\n </span>\n ) : null}\n <span className=\"ds:font-[var(--font-weight-semibold)] ds:truncate ds:text-start\">\n {title}\n </span>\n {suffix ? (\n <span className=\"ds:truncate ds:text-start ds:text-[length:var(--font-size-xs)]\">\n {suffix}\n </span>\n ) : null}\n </div>\n );\n },\n);\nCalendarEventCard.displayName = 'CalendarEventCard';\n"],"names":["__iconNode","Ban","createLucideIcon","Euro","ThumbsUp","Zap","parseHex","hex","trimmed","body","r","g","b","relativeLuminance","lin","c","warnLowContrast","bgHex","fgHex","contextLabel","resolveInk","bg","STATUS_ICON","Clock","Stethoscope","Check","STATUS_LABEL_KEYS","calendarEventCardVariants","cva","statusAccentVariants","CalendarEventCard","forwardRef","title","suffix","rangeText","showTime","allDay","status","statusAccent","backgroundColor","textColor","borderColor","isBookedOnline","hasUnassignedPatient","hasHighlightedAnamnesis","hasBillableAmount","isTelehealth","resourceLabel","eventId","className","style","ariaLabelProp","rest","ref","t","useTranslation","StatusIcon","statusLabel","ariaLabel","ink","colourOverrides","mergedStyle","jsxs","jsx","Globe","TriangleAlert","HeartPulse","Video"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,MAAM,KAAK,UAAU;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAC5D,GACMC,IAAMC,EAAiB,OAAOF,CAAU;ACb9C;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMG,IAAOD,EAAiB,QAAQF,CAA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EAACI,GAAA,EAAM,MAAM,IAAI,eAAY,QAAO,IAAK;AAAA,UAAA,GAC3D;AAAA,UACChC,KAAY,CAACC,KAAUF;AAAA;AAAA;AAAA;AAAA;AAAA,YAKtB,gBAAA6B,EAAC,QAAA,EAAK,WAAU,wCACb,UAAA7B,EAAA,CACH;AAAA,cACE;AAAA,UACJ,gBAAA6B,EAAC,QAAA,EAAK,WAAU,mEACb,UAAA/B,GACH;AAAA,UACCC,IACC,gBAAA8B,EAAC,QAAA,EAAK,WAAU,kEACb,aACH,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACAjC,GAAkB,cAAc;","x_google_ignoreList":[0,1,2,3]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"color-picker-D-tUwxxT.js","sources":["../../src/components/color-picker/color-picker.agent.ts","../../src/components/color-picker/color-utils.ts","../../src/components/color-picker/palettes.ts","../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ColorPicker. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ColorPickerHandle } from './color-picker';\n\nexport const colorPickerAgent: AgentAdapter<ColorPickerHandle> = {\n id: 'color-picker',\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.colorPicker.state.value',\n description: 'Currently picked colour as a hex string (e.g. \"#3b82f6\").',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ hex: string }',\n argsSchema: {\n type: 'object',\n properties: {\n hex: {\n type: 'string',\n description: 'Hex colour string, e.g. \"#3b82f6\".',\n },\n },\n required: ['hex'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.colorPicker.actions.setValue',\n description: 'Set the picked colour from a hex string.',\n examples: [{ args: { hex: '#3b82f6' }, note: 'Set to brand blue.' }],\n invoke: (handle, args: { hex: string }) => {\n handle.setValue(args.hex);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'color-picker',\n description:\n 'Marks the ColorPicker wrapper (inline) or trigger (popover variant).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/**\n * Pure colour-conversion utilities for the ColorPicker component.\n *\n * This is the ONLY file where hex/rgb literals are permitted (for conversion\n * math). The component file (`color-picker.tsx`) must not contain hex/rgb\n * literals — it references `var(--…)` tokens for its own UI.\n */\n\nexport interface HSLA {\n h: number; // 0–360\n s: number; // 0–100\n l: number; // 0–100\n a: number; // 0–1\n}\n\n/* ------------------------------------------------------------------ */\n/* Hex ↔ HSL */\n/* ------------------------------------------------------------------ */\n\n/** Parse a hex string (#rgb, #rrggbb, #rrggbbaa) into HSLA. */\nexport function hexToHsl(hex: string): HSLA {\n let h = hex.startsWith('#') ? hex.slice(1) : hex;\n\n // Expand shorthand (#rgb → #rrggbb, #rgba → #rrggbbaa)\n if (h.length === 3 || h.length === 4) {\n h = h\n .split('')\n .map((c) => c + c)\n .join('');\n }\n\n const r = parseInt(h.slice(0, 2), 16) / 255;\n const g = parseInt(h.slice(2, 4), 16) / 255;\n const b = parseInt(h.slice(4, 6), 16) / 255;\n const a = h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1;\n\n return rgbToHsl(r, g, b, a);\n}\n\n/** Convert normalised RGB (0–1) + alpha to HSLA. */\nfunction rgbToHsl(r: number, g: number, b: number, a: number): HSLA {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let hue = 0;\n let sat = 0;\n\n if (max !== min) {\n const d = max - min;\n sat = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) {\n hue = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n } else if (max === g) {\n hue = ((b - r) / d + 2) / 6;\n } else {\n hue = ((r - g) / d + 4) / 6;\n }\n }\n\n return {\n h: Math.round(hue * 360),\n s: Math.round(sat * 100),\n l: Math.round(l * 100),\n a: Math.round(a * 100) / 100,\n };\n}\n\n/** Convert HSLA to a hex string (#rrggbb or #rrggbbaa when a < 1). */\nexport function hslToHex(hsl: HSLA): string {\n const { r, g, b } = hslToRgbComponents(hsl);\n const toHex = (n: number) =>\n Math.round(n * 255)\n .toString(16)\n .padStart(2, '0');\n\n const base = `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n if (hsl.a < 1) {\n return `${base}${toHex(hsl.a)}`;\n }\n return base;\n}\n\n/** Convert HSLA to an rgba() string. */\nexport function hslToRgba(hsl: HSLA): string {\n const { r, g, b } = hslToRgbComponents(hsl);\n const ri = Math.round(r * 255);\n const gi = Math.round(g * 255);\n const bi = Math.round(b * 255);\n\n if (hsl.a < 1) {\n return `rgba(${ri}, ${gi}, ${bi}, ${hsl.a})`;\n }\n return `rgba(${ri}, ${gi}, ${bi}, 1)`;\n}\n\n/** Internal: convert HSLA to normalised RGB components (0–1). */\nfunction hslToRgbComponents(hsl: HSLA): {\n r: number;\n g: number;\n b: number;\n} {\n const h = hsl.h / 360;\n const s = hsl.s / 100;\n const l = hsl.l / 100;\n\n if (s === 0) {\n return { r: l, g: l, b: l };\n }\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n return {\n r: hueToRgb(p, q, h + 1 / 3),\n g: hueToRgb(p, q, h),\n b: hueToRgb(p, q, h - 1 / 3),\n };\n}\n\nfunction hueToRgb(p: number, q: number, t: number): number {\n let tt = t;\n if (tt < 0) tt += 1;\n if (tt > 1) tt -= 1;\n if (tt < 1 / 6) return p + (q - p) * 6 * tt;\n if (tt < 1 / 2) return q;\n if (tt < 2 / 3) return p + (q - p) * (2 / 3 - tt) * 6;\n return p;\n}\n\n/* ------------------------------------------------------------------ */\n/* Format / Parse */\n/* ------------------------------------------------------------------ */\n\n/** Format an HSLA value to the specified output format. */\nexport function formatOutput(\n hsl: HSLA,\n format: 'hex' | 'hsl' | 'rgba',\n): string {\n switch (format) {\n case 'hex':\n return hslToHex(hsl);\n case 'hsl':\n if (hsl.a < 1) {\n return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${hsl.a})`;\n }\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n case 'rgba':\n return hslToRgba(hsl);\n }\n}\n\n/** Parse any supported colour string into HSLA. Returns null on failure. */\nexport function parseInput(value: string): HSLA | null {\n const trimmed = value.trim();\n if (!trimmed) return null;\n\n // Hex: #rgb, #rrggbb, #rrggbbaa\n if (trimmed.startsWith('#')) {\n const body = trimmed.slice(1);\n if (!/^[0-9a-fA-F]{3,8}$/.test(body)) return null;\n if (![3, 4, 6, 8].includes(body.length)) return null;\n return hexToHsl(trimmed);\n }\n\n // hsla(h, s%, l%, a) or hsl(h, s%, l%)\n const hslaMatch = trimmed.match(\n /^hsla?\\(\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)%?\\s*[,/]\\s*([\\d.]+)%?\\s*(?:[,/]\\s*([\\d.]+))?\\s*\\)$/,\n );\n if (hslaMatch) {\n return {\n h: Math.round(parseFloat(hslaMatch[1])) % 360,\n s: Math.round(parseFloat(hslaMatch[2])),\n l: Math.round(parseFloat(hslaMatch[3])),\n a: hslaMatch[4] !== undefined ? parseFloat(hslaMatch[4]) : 1,\n };\n }\n\n // rgba(r, g, b, a) or rgb(r, g, b)\n const rgbaMatch = trimmed.match(\n /^rgba?\\(\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)\\s*(?:[,/]\\s*([\\d.]+))?\\s*\\)$/,\n );\n if (rgbaMatch) {\n const r = parseFloat(rgbaMatch[1]) / 255;\n const g = parseFloat(rgbaMatch[2]) / 255;\n const b = parseFloat(rgbaMatch[3]) / 255;\n const a = rgbaMatch[4] !== undefined ? parseFloat(rgbaMatch[4]) : 1;\n return rgbToHsl(r, g, b, a);\n }\n\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Contrast — WCAG 2.x relative luminance */\n/* ------------------------------------------------------------------ */\n\n/** Relative luminance per WCAG 2.x (0 = black, 1 = white). */\nexport function relativeLuminance(hsl: HSLA): number {\n const { r, g, b } = hslToRgbComponents(hsl);\n const linearise = (c: number) =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * linearise(r) + 0.7152 * linearise(g) + 0.0722 * linearise(b);\n}\n\n/** WCAG 2.x contrast ratio between two colours. */\nexport function contrastRatio(fg: HSLA, bg: HSLA): number {\n const lum1 = relativeLuminance(fg);\n const lum2 = relativeLuminance(bg);\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n return Math.round(((lighter + 0.05) / (darker + 0.05)) * 100) / 100;\n}\n\n/** Meets WCAG AA for normal text (≥ 4.5:1). */\nexport function meetsAA(ratio: number): boolean {\n return ratio >= 4.5;\n}\n\n/** Meets WCAG AAA for normal text (≥ 7:1). */\nexport function meetsAAA(ratio: number): boolean {\n return ratio >= 7;\n}\n","export interface PaletteSwatch {\n name: string;\n hex: string;\n /** Recommended text colour for contrast. */\n textColor?: '#000000' | '#ffffff';\n}\n\n/**\n * Material Design appointment colours — mirrors the platform's `DoctorColor`\n * entity. Pink 500 is first because it's the default appointment colour;\n * remaining dark (white-text) colours follow alphabetically, then light\n * (black-text) colours alphabetically.\n */\nexport const APPOINTMENT_PALETTE: PaletteSwatch[] = [\n { name: 'Pink 500', hex: '#e91e63', textColor: '#ffffff' },\n { name: 'Black', hex: '#000000', textColor: '#ffffff' },\n { name: 'Blue 500', hex: '#2196f3', textColor: '#ffffff' },\n { name: 'Blue 900', hex: '#0d47a1', textColor: '#ffffff' },\n { name: 'Blue Grey 500', hex: '#607d8b', textColor: '#ffffff' },\n { name: 'Blue Grey 800', hex: '#37474f', textColor: '#ffffff' },\n { name: 'Brown 500', hex: '#795548', textColor: '#ffffff' },\n { name: 'Deep Orange 500', hex: '#ff5722', textColor: '#ffffff' },\n { name: 'Deep Purple 500', hex: '#673ab7', textColor: '#ffffff' },\n { name: 'Green 500', hex: '#4caf50', textColor: '#ffffff' },\n { name: 'Green 900', hex: '#1b5e20', textColor: '#ffffff' },\n { name: 'Indigo 500', hex: '#3f51b5', textColor: '#ffffff' },\n { name: 'Indigo 900', hex: '#1a237e', textColor: '#ffffff' },\n { name: 'Pink 900', hex: '#880e4f', textColor: '#ffffff' },\n { name: 'Purple 500', hex: '#9c27b0', textColor: '#ffffff' },\n { name: 'Purple 900', hex: '#4a148c', textColor: '#ffffff' },\n { name: 'Red 500', hex: '#f44336', textColor: '#ffffff' },\n { name: 'Red 900', hex: '#b71c1c', textColor: '#ffffff' },\n { name: 'Teal 500', hex: '#009688', textColor: '#ffffff' },\n { name: 'Teal 900', hex: '#004d40', textColor: '#ffffff' },\n { name: 'Amber 500', hex: '#ffc107', textColor: '#000000' },\n { name: 'Cyan 500', hex: '#00bcd4', textColor: '#000000' },\n { name: 'Grey 500', hex: '#9e9e9e', textColor: '#000000' },\n { name: 'Light Blue 500', hex: '#03a9f4', textColor: '#000000' },\n { name: 'Light Green 500', hex: '#8bc34a', textColor: '#000000' },\n { name: 'Lime 500', hex: '#cddc39', textColor: '#000000' },\n { name: 'Orange 500', hex: '#ff9800', textColor: '#000000' },\n { name: 'Orange 900', hex: '#e65100', textColor: '#000000' },\n { name: 'White', hex: '#ffffff', textColor: '#000000' },\n { name: 'Yellow 500', hex: '#ffeb3b', textColor: '#000000' },\n];\n\n/** Alfadocs brand palette — the six brand families × 3 shades (300/500/700). */\nexport const BRAND_PALETTE: PaletteSwatch[] = [\n { name: 'Blue 300', hex: '#70738c' },\n { name: 'Blue 500', hex: '#292e53' },\n { name: 'Blue 700', hex: '#1d213b' },\n { name: 'Violet 300', hex: '#9995ee' },\n { name: 'Violet 500', hex: '#6761e5' },\n { name: 'Violet 700', hex: '#4945a3' },\n { name: 'Purple 300', hex: '#ccaafa' },\n { name: 'Purple 500', hex: '#b380f8' },\n { name: 'Purple 700', hex: '#7f5bb0' },\n { name: 'Magenta 300', hex: '#ea7ffc' },\n { name: 'Magenta 500', hex: '#e040fb' },\n { name: 'Magenta 700', hex: '#9f2db2' },\n { name: 'Fuchsia 300', hex: '#fa76fc' },\n { name: 'Fuchsia 500', hex: '#f732fb' },\n { name: 'Fuchsia 700', hex: '#af24b2' },\n { name: 'Grey 300', hex: '#f9f6f3' },\n { name: 'Grey 500', hex: '#f6f1ed' },\n { name: 'Grey 700', hex: '#afaba8' },\n];\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { cva } from 'class-variance-authority';\nimport { Check, X } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useFormField } from '../form-field/form-field-context';\nimport { Slider } from '../slider/slider';\nimport { useAgentRegistration } from '../../agent';\nimport { colorPickerAgent } from './color-picker.agent';\n\n/** Agent-readiness curated handle for ColorPicker. */\nexport interface ColorPickerHandle {\n getValue: () => string;\n setValue: (hex: string) => void;\n}\nimport {\n contrastRatio,\n formatOutput,\n hslToHex,\n meetsAA,\n meetsAAA,\n parseInput,\n type HSLA,\n} from './color-utils';\nimport { APPOINTMENT_PALETTE, type PaletteSwatch } from './palettes';\n\nconst COLS = 6;\n\nconst triggerVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\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-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)] ds:ps-3 ds:pe-3',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)] ds:ps-3 ds:pe-3',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)] ds:ps-4 ds:pe-4',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst swatchVariants = cva(\n [\n 'ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer',\n 'ds:transition-[transform,box-shadow] 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-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:hover:scale-110',\n // The swatch background is the user-picked colour — set as a CSS custom\n // property via inline `style` per 23-constraints §Runtime-computed\n // dimensions (CSS custom property setter; the bg rule lives on the class).\n 'ds:bg-[var(--swatch-bg)]',\n ].join(' '),\n {\n variants: {\n selected: {\n true: 'ds:border-[var(--primary)] ds:shadow-[var(--shadow-md)]',\n false: 'ds:border-transparent',\n },\n // Swatch footprint. md/lg honour --min-target-size (44/48px) for touch.\n // sm is a denser 28px swatch for toolbar/inline use — comfortably above\n // the WCAG 2.5.8 (AA) 24px minimum, with the grid gap providing spacing.\n // sm intentionally does NOT take the accessible-theme --min-target-size\n // bump (48px) — a dense colour grid is opt-in and the full roving-tabindex\n // keyboard path is the mitigation for the sub-AAA pointer target.\n size: {\n // sm = 28px: clears WCAG 2.5.8 (AA, 24px) but intentionally opts out of\n // the accessible-theme 48px min-target bump — a conscious, signed-off\n // trade-off (dense opt-in grid; keyboard roving-tabindex is the mitigation).\n sm: 'ds:min-w-7 ds:min-h-7',\n md: 'ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]',\n lg: 'ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]',\n },\n },\n defaultVariants: { selected: false, size: 'md' },\n },\n);\n\nconst PANEL_CLASSES = [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:p-[var(--spacing-md)]',\n].join(' ');\n\n// Checkerboard under the opacity track — static geometry, so expressed as\n// Tailwind arbitrary values rather than inline `style`. `grey-700` comes\n// from the closed palette so the tile colour still tracks the token ramp.\nconst OPACITY_CHECKER_CLASSES = [\n 'ds:bg-[image:repeating-conic-gradient(var(--color-grey-700)_0%_25%,transparent_0%_50%)]',\n 'ds:bg-[size:8px_8px]',\n].join(' ');\n\nconst PANEL_COMPACT_CLASSES = [\n 'ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:p-[var(--spacing-sm)]',\n].join(' ');\n\n// Tighter padding for the dense (sm) swatch-only panel — toolbar/inline use.\nconst PANEL_COMPACT_SM_CLASSES = [\n 'ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:p-[var(--spacing-xs)]',\n].join(' ');\n\nconst POPOVER_CONTENT_CLASSES = [\n 'ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:shadow-[var(--shadow-lg)]',\n 'ds:w-72',\n 'ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2 ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2',\n].join(' ');\n\nconst HEX_INPUT_CLASSES = [\n 'ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\n// Makes the Slider track/range transparent so the gradient behind shows through\nconst TRANSPARENT_SLIDER =\n 'ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent';\n\nexport interface ColorPickerProps {\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n format?: 'hex' | 'hsl' | 'rgba';\n allowOpacity?: boolean;\n palette?: (string | PaletteSwatch)[];\n against?: string;\n size?: 'sm' | 'md' | 'lg';\n disabled?: boolean;\n variant?: 'inline' | 'popover';\n /** Show only the swatch grid without sliders, hex input, or contrast readout */\n compact?: boolean;\n className?: string;\n}\n\nexport const ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(\n (props, ref) => {\n const {\n value,\n defaultValue,\n onChange,\n format = 'hex',\n allowOpacity = false,\n palette,\n against,\n size = 'md',\n disabled = false,\n variant = 'inline',\n compact = true,\n className,\n } = props;\n\n const { t } = useTranslation();\n const ctx = useFormField();\n const generatedId = useId();\n const pickerId = ctx.id || generatedId;\n const effectiveDisabled = ctx.disabled || disabled;\n\n const isControlled = value !== undefined;\n const [internalHsl, setInternalHsl] = useState<HSLA>(() => {\n const initial = value ?? defaultValue;\n if (initial) {\n const parsed = parseInput(initial);\n if (parsed) return parsed;\n }\n return { h: 0, s: 100, l: 50, a: 1 };\n });\n\n const currentHsl: HSLA = useMemo(() => {\n if (isControlled && value) {\n const parsed = parseInput(value);\n if (parsed) return parsed;\n }\n return internalHsl;\n }, [isControlled, value, internalHsl]);\n\n const emitChange = useCallback(\n (hsl: HSLA) => {\n const finalHsl = allowOpacity ? hsl : { ...hsl, a: 1 };\n if (!isControlled) setInternalHsl(finalHsl);\n onChange?.(formatOutput(finalHsl, format));\n },\n [allowOpacity, format, isControlled, onChange],\n );\n\n const [hexInput, setHexInput] = useState(() => hslToHex(currentHsl));\n const [hexError, setHexError] = useState(false);\n const revertTimerRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const currentHslRef = useRef(currentHsl);\n currentHslRef.current = currentHsl;\n\n useEffect(() => {\n setHexInput(hslToHex(currentHsl));\n setHexError(false);\n if (revertTimerRef.current !== undefined) {\n clearTimeout(revertTimerRef.current);\n revertTimerRef.current = undefined;\n }\n }, [currentHsl]);\n\n useEffect(() => {\n return () => {\n if (revertTimerRef.current !== undefined) {\n clearTimeout(revertTimerRef.current);\n }\n };\n }, []);\n\n const handleHexBlur = () => {\n const parsed = parseInput(hexInput);\n if (parsed) {\n setHexError(false);\n emitChange(parsed);\n } else {\n setHexError(true);\n revertTimerRef.current = setTimeout(() => {\n revertTimerRef.current = undefined;\n setHexError(false);\n setHexInput(hslToHex(currentHslRef.current));\n }, 800);\n }\n };\n\n const swatches: PaletteSwatch[] = useMemo(() => {\n if (!palette) return APPOINTMENT_PALETTE;\n return palette.map((item) =>\n typeof item === 'string'\n ? { name: item.toUpperCase(), hex: item }\n : item,\n );\n }, [palette]);\n\n const currentHex = hslToHex(currentHsl);\n // Normalise palette entries through parseInput so swatches declared as\n // rgb()/hsl()/shorthand hex still match — raw `s.hex` comparison misses\n // any non-literal-hex representation.\n const swatchCanonicalHexes = useMemo(\n () =>\n swatches.map((s) => {\n const parsed = parseInput(s.hex);\n return parsed ? hslToHex(parsed).toLowerCase() : null;\n }),\n [swatches],\n );\n const selectedSwatchIndex = swatchCanonicalHexes.findIndex(\n (hex) => hex !== null && hex === currentHex.toLowerCase(),\n );\n\n const gridRef = useRef<HTMLDivElement>(null);\n const [focusedIndex, setFocusedIndex] = useState(\n selectedSwatchIndex >= 0 ? selectedSwatchIndex : 0,\n );\n\n const focusSwatch = (index: number) => {\n const cells =\n gridRef.current?.querySelectorAll<HTMLElement>('[role=\"gridcell\"]');\n if (cells?.[index]) {\n cells[index].focus();\n setFocusedIndex(index);\n }\n };\n\n const handleGridKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (effectiveDisabled) return;\n const total = swatches.length;\n let next = focusedIndex;\n\n // The grid (grid-cols-6) mirrors under dir=\"rtl\", so the physical\n // ArrowRight/ArrowLeft keys must map to the inverse logical delta to keep\n // keyboard navigation following the visual reading order. Resolve the\n // effective direction from the element's computed style.\n const isRtl =\n typeof window !== 'undefined' && gridRef.current\n ? window.getComputedStyle(gridRef.current).direction === 'rtl'\n : false;\n const forward = isRtl ? -1 : 1;\n\n switch (event.key) {\n case 'ArrowRight':\n next = (focusedIndex + forward + total) % total;\n break;\n case 'ArrowLeft':\n next = (focusedIndex - forward + total) % total;\n break;\n case 'ArrowDown':\n next = Math.min(focusedIndex + COLS, total - 1);\n break;\n case 'ArrowUp':\n next = Math.max(focusedIndex - COLS, 0);\n break;\n case 'Home':\n next = Math.floor(focusedIndex / COLS) * COLS;\n break;\n case 'End':\n next = Math.min(\n Math.floor(focusedIndex / COLS) * COLS + COLS - 1,\n total - 1,\n );\n break;\n case 'PageUp':\n next = focusedIndex % COLS;\n break;\n case 'PageDown': {\n const lastRowStart = Math.floor((total - 1) / COLS) * COLS;\n next = Math.min(lastRowStart + (focusedIndex % COLS), total - 1);\n break;\n }\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const parsed = parseInput(swatches[focusedIndex].hex);\n if (parsed) emitChange(parsed);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n focusSwatch(next);\n };\n\n const [open, setOpen] = useState(false);\n\n const agentHandle = useMemo<ColorPickerHandle>(\n () => ({\n getValue: () => hslToHex(currentHslRef.current),\n setValue: (hex) => {\n const parsed = parseInput(hex);\n if (parsed) emitChange(parsed);\n },\n }),\n [emitChange],\n );\n useAgentRegistration(colorPickerAgent, agentHandle, pickerId);\n\n const contrastInfo = useMemo(() => {\n if (!against) return null;\n const bgHsl = parseInput(against);\n if (!bgHsl) return null;\n const ratio = contrastRatio(currentHsl, bgHsl);\n return { ratio, aa: meetsAA(ratio), aaa: meetsAAA(ratio) };\n }, [against, currentHsl]);\n\n const swatchGrid = (\n // eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={t('inputs.colorPicker.paletteLabel', 'Colour palette')}\n onKeyDown={handleGridKeyDown}\n className=\"ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]\"\n >\n {swatches.map((_swatch, i) => {\n const rowStart = Math.floor(i / COLS) * COLS;\n const isFirstInRow = i === rowStart;\n return isFirstInRow ? (\n <div key={i} role=\"row\" className=\"ds:contents\">\n {swatches.slice(rowStart, rowStart + COLS).map((s, j) => {\n const idx = rowStart + j;\n const sel = idx === selectedSwatchIndex;\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown\n <div\n key={s.hex}\n role=\"gridcell\"\n aria-selected={sel}\n aria-label={t('inputs.colorPicker.swatchLabel', {\n name: s.name,\n hex: s.hex,\n })}\n tabIndex={idx === focusedIndex ? 0 : -1}\n onClick={() => {\n if (effectiveDisabled) return;\n const parsed = parseInput(s.hex);\n if (parsed) emitChange(parsed);\n setFocusedIndex(idx);\n }}\n className={swatchVariants({ selected: sel, size })}\n // eslint-disable-next-line react/forbid-dom-props -- user-picked swatch hex injected via --swatch-bg CSS variable\n style={{ ['--swatch-bg' as string]: s.hex }}\n >\n {sel ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:absolute ds:inset-0 ds:m-auto ds:size-4 ds:text-[var(--background)] ds:mix-blend-difference\"\n />\n ) : null}\n </div>\n );\n })}\n </div>\n ) : null;\n })}\n </div>\n );\n\n const fullControls = compact ? null : (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label\n htmlFor={`${pickerId}-hex`}\n className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\"\n >\n {t('inputs.colorPicker.hex', 'Hex')}\n </label>\n <bdi dir=\"ltr\">\n <input\n id={`${pickerId}-hex`}\n type=\"text\"\n value={hexInput}\n disabled={effectiveDisabled}\n onChange={(e) => setHexInput(e.target.value)}\n onBlur={handleHexBlur}\n className={`${HEX_INPUT_CLASSES} ${hexError ? 'ds:border-[var(--destructive)]' : 'ds:border-[color:var(--border)]'}`}\n />\n </bdi>\n </div>\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <SliderWithGradient\n label={t('inputs.colorPicker.hue', 'Hue')}\n gradient=\"linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))\"\n min={0}\n max={360}\n value={currentHsl.h}\n onChange={(h) => emitChange({ ...currentHsl, h })}\n formatValue={(v) => `H ${v}°`}\n disabled={effectiveDisabled}\n />\n <SliderWithGradient\n label={t('inputs.colorPicker.saturation', 'Saturation')}\n gradient={`linear-gradient(to right, hsl(${currentHsl.h},0%,${currentHsl.l}%), hsl(${currentHsl.h},100%,${currentHsl.l}%))`}\n min={0}\n max={100}\n value={currentHsl.s}\n onChange={(s) => emitChange({ ...currentHsl, s })}\n formatValue={(v) => `S ${v}%`}\n disabled={effectiveDisabled}\n />\n <SliderWithGradient\n label={t('inputs.colorPicker.lightness', 'Lightness')}\n gradient={`linear-gradient(to right, hsl(${currentHsl.h},${currentHsl.s}%,0%), hsl(${currentHsl.h},${currentHsl.s}%,50%), hsl(${currentHsl.h},${currentHsl.s}%,100%))`}\n min={0}\n max={100}\n value={currentHsl.l}\n onChange={(l) => emitChange({ ...currentHsl, l })}\n formatValue={(v) => `L ${v}%`}\n disabled={effectiveDisabled}\n />\n {allowOpacity ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\">\n {t('inputs.colorPicker.opacity', 'Opacity')}\n </label>\n <div className=\"ds:relative\">\n <div\n className={`ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${OPACITY_CHECKER_CLASSES}`}\n aria-hidden=\"true\"\n />\n <div\n className=\"ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--opacity-gradient)]\"\n // eslint-disable-next-line react/forbid-dom-props -- opacity-track gradient derived from live HSL, no token equivalent\n style={{\n ['--opacity-gradient' as string]: `linear-gradient(to right, hsla(${currentHsl.h},${currentHsl.s}%,${currentHsl.l}%,0), hsl(${currentHsl.h},${currentHsl.s}%,${currentHsl.l}%))`,\n }}\n aria-hidden=\"true\"\n />\n <Slider\n min={0}\n max={100}\n step={1}\n value={[Math.round(currentHsl.a * 100)]}\n onValueChange={([v]) =>\n emitChange({ ...currentHsl, a: v / 100 })\n }\n aria-label={t('inputs.colorPicker.opacity', 'Opacity')}\n formatValue={(v) => `${v}%`}\n disabled={effectiveDisabled}\n className={TRANSPARENT_SLIDER}\n />\n </div>\n </div>\n ) : null}\n </div>\n\n {contrastInfo ? (\n <div\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <span className=\"ds:tabular-nums\">\n {t('inputs.colorPicker.contrastRatio', {\n ratio: contrastInfo.ratio.toFixed(1),\n })}\n </span>\n <ContrastBadge level=\"AA\" passes={contrastInfo.aa} t={t} />\n <ContrastBadge level=\"AAA\" passes={contrastInfo.aaa} t={t} />\n </div>\n ) : null}\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <div\n className=\"ds:size-8 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--swatch-bg)]\"\n // eslint-disable-next-line react/forbid-dom-props -- live picked colour injected via --swatch-bg CSS variable\n style={{ ['--swatch-bg' as string]: hslToHex(currentHsl) }}\n aria-hidden=\"true\"\n />\n <span className=\"ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums\">\n {formatOutput(currentHsl, format)}\n </span>\n </div>\n </>\n );\n\n const panelContent = (\n <div\n className={\n compact\n ? size === 'sm'\n ? PANEL_COMPACT_SM_CLASSES\n : PANEL_COMPACT_CLASSES\n : PANEL_CLASSES\n }\n >\n {swatchGrid}\n {fullControls}\n </div>\n );\n\n if (variant === 'inline') {\n return (\n <div\n ref={ref}\n id={pickerId}\n className={className}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n aria-disabled={effectiveDisabled || undefined}\n data-component=\"color-picker\"\n data-component-id={pickerId}\n data-testid=\"color-picker\"\n >\n {panelContent}\n </div>\n );\n }\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild disabled={effectiveDisabled}>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- FormField propagates invalid state to its trigger; users rely on this for validation announcements */}\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n id={pickerId}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n // In compact mode the trigger only renders the swatch (which is\n // aria-hidden). Provide a fallback name so the button is named\n // for AT regardless of variant. The current value is announced\n // separately via the hex/HSL output inside the popover.\n aria-label={\n compact\n ? t('inputs.colorPicker.triggerLabel', 'Choose colour')\n : undefined\n }\n className={triggerVariants({ size, className })}\n data-component=\"color-picker\"\n data-component-id={pickerId}\n data-testid=\"color-picker-trigger\"\n >\n <span\n className={`ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${compact ? '' : ' ds:me-[var(--spacing-sm)]'}`}\n aria-hidden=\"true\"\n // eslint-disable-next-line react/forbid-dom-props -- trigger preview swatch shows current picked colour via --swatch-bg\n style={{ ['--swatch-bg' as string]: hslToHex(currentHsl) }}\n />\n {compact ? null : (\n <span className=\"ds:text-start ds:truncate ds:tabular-nums\">\n {formatOutput(currentHsl, format)}\n </span>\n )}\n </button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n align=\"start\"\n className={POPOVER_CONTENT_CLASSES}\n >\n {panelContent}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n },\n);\n\nColorPicker.displayName = 'ColorPicker';\n\nfunction ContrastBadge({\n level,\n passes,\n t,\n}: {\n level: string;\n passes: boolean;\n t: (key: string, fallback: string) => string;\n}) {\n return (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <abbr\n title={`Web Content Accessibility Guidelines Level ${level}`}\n className=\"ds:no-underline ds:font-medium\"\n >\n {level}\n </abbr>\n {passes ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-[var(--success)]\"\n />\n ) : (\n <X\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-[var(--destructive)]\"\n />\n )}\n <span className=\"ds:sr-only\">\n {passes\n ? t('inputs.colorPicker.contrastPass', 'Pass')\n : t('inputs.colorPicker.contrastFail', 'Fail')}\n </span>\n </span>\n );\n}\n\nfunction SliderWithGradient({\n label,\n gradient,\n min,\n max,\n value,\n onChange,\n formatValue,\n disabled,\n}: {\n label: string;\n gradient: string;\n min: number;\n max: number;\n value: number;\n onChange: (v: number) => void;\n formatValue: (v: number) => string;\n disabled: boolean;\n}) {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\">\n {label}\n </label>\n <div className=\"ds:relative\">\n <div\n className=\"ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--slider-gradient)]\"\n // eslint-disable-next-line react/forbid-dom-props -- hue/saturation/lightness gradient derived from live HSL, no token equivalent\n style={{ ['--slider-gradient' as string]: gradient }}\n aria-hidden=\"true\"\n />\n <Slider\n min={min}\n max={max}\n step={1}\n value={[value]}\n onValueChange={([v]) => onChange(v)}\n aria-label={label}\n formatValue={formatValue}\n disabled={disabled}\n className={TRANSPARENT_SLIDER}\n />\n </div>\n </div>\n );\n}\n"],"names":["colorPickerAgent","handle","args","hexToHsl","hex","h","g","b","a","rgbToHsl","r","max","min","l","hue","sat","d","hslToHex","hsl","hslToRgbComponents","toHex","n","base","hslToRgba","ri","gi","bi","s","q","p","hueToRgb","t","tt","formatOutput","format","parseInput","value","trimmed","body","hslaMatch","rgbaMatch","relativeLuminance","linearise","c","contrastRatio","fg","bg","lum1","lum2","lighter","darker","meetsAA","ratio","meetsAAA","APPOINTMENT_PALETTE","BRAND_PALETTE","COLS","triggerVariants","cva","swatchVariants","PANEL_CLASSES","OPACITY_CHECKER_CLASSES","PANEL_COMPACT_CLASSES","PANEL_COMPACT_SM_CLASSES","POPOVER_CONTENT_CLASSES","HEX_INPUT_CLASSES","TRANSPARENT_SLIDER","ColorPicker","forwardRef","props","ref","defaultValue","onChange","allowOpacity","palette","against","size","disabled","variant","compact","className","useTranslation","ctx","useFormField","generatedId","useId","pickerId","effectiveDisabled","isControlled","internalHsl","setInternalHsl","useState","initial","parsed","currentHsl","useMemo","emitChange","useCallback","finalHsl","hexInput","setHexInput","hexError","setHexError","revertTimerRef","useRef","currentHslRef","useEffect","handleHexBlur","swatches","item","currentHex","selectedSwatchIndex","gridRef","focusedIndex","setFocusedIndex","focusSwatch","index","cells","_a","handleGridKeyDown","event","total","next","forward","lastRowStart","open","setOpen","agentHandle","useAgentRegistration","contrastInfo","bgHsl","swatchGrid","jsx","_swatch","rowStart","j","idx","sel","Check","fullControls","jsxs","Fragment","e","SliderWithGradient","v","Slider","ContrastBadge","panelContent","Popover","level","passes","X","label","gradient","formatValue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