mood-ui 0.10.0 → 0.12.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 (351) hide show
  1. package/dist/components/data-display/Chart.cjs +6 -0
  2. package/dist/components/data-display/Chart.cjs.map +1 -0
  3. package/dist/components/data-display/Chart.mjs +7 -0
  4. package/dist/components/data-display/Chart.mjs.map +1 -0
  5. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs +48 -0
  6. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  7. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs +47 -0
  8. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  9. package/dist/components/data-display/Stat.cjs.map +1 -1
  10. package/dist/components/data-display/Stat.mjs.map +1 -1
  11. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs +88 -75
  12. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  13. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs +90 -77
  14. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  15. package/dist/components/data-display/calendar/AgendaView.cjs.map +1 -1
  16. package/dist/components/data-display/calendar/AgendaView.mjs.map +1 -1
  17. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs +4 -1
  18. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  19. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +4 -1
  20. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  21. package/dist/components/data-display/calendar/DayView.cjs.map +1 -1
  22. package/dist/components/data-display/calendar/DayView.mjs.map +1 -1
  23. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  24. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  25. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  26. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  27. package/dist/components/data-display/calendar/MonthView.cjs +1 -1
  28. package/dist/components/data-display/calendar/MonthView.cjs.map +1 -1
  29. package/dist/components/data-display/calendar/MonthView.mjs +1 -1
  30. package/dist/components/data-display/calendar/MonthView.mjs.map +1 -1
  31. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs +8 -12
  32. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  33. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +8 -12
  34. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  35. package/dist/components/data-display/calendar/Scheduler.cjs.map +1 -1
  36. package/dist/components/data-display/calendar/Scheduler.mjs.map +1 -1
  37. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs +7 -4
  38. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  39. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -4
  40. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  41. package/dist/components/data-display/calendar/WeekView.cjs.map +1 -1
  42. package/dist/components/data-display/calendar/WeekView.mjs.map +1 -1
  43. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  44. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  45. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  46. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  47. package/dist/components/data-display/chart/Cartesian.cjs +6 -0
  48. package/dist/components/data-display/chart/Cartesian.cjs.map +1 -0
  49. package/dist/components/data-display/chart/Cartesian.mjs +7 -0
  50. package/dist/components/data-display/chart/Cartesian.mjs.map +1 -0
  51. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs +573 -0
  52. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  53. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs +572 -0
  54. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  55. package/dist/components/data-display/chart/Heatmap.cjs +6 -0
  56. package/dist/components/data-display/chart/Heatmap.cjs.map +1 -0
  57. package/dist/components/data-display/chart/Heatmap.mjs +7 -0
  58. package/dist/components/data-display/chart/Heatmap.mjs.map +1 -0
  59. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs +332 -0
  60. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  61. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs +331 -0
  62. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  63. package/dist/components/data-display/chart/Polar.cjs +6 -0
  64. package/dist/components/data-display/chart/Polar.cjs.map +1 -0
  65. package/dist/components/data-display/chart/Polar.mjs +7 -0
  66. package/dist/components/data-display/chart/Polar.mjs.map +1 -0
  67. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs +361 -0
  68. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  69. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs +360 -0
  70. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  71. package/dist/components/data-display/chart/Radar.cjs +6 -0
  72. package/dist/components/data-display/chart/Radar.cjs.map +1 -0
  73. package/dist/components/data-display/chart/Radar.mjs +7 -0
  74. package/dist/components/data-display/chart/Radar.mjs.map +1 -0
  75. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs +347 -0
  76. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  77. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs +346 -0
  78. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  79. package/dist/components/data-display/chart/Sparkline.cjs +6 -0
  80. package/dist/components/data-display/chart/Sparkline.cjs.map +1 -0
  81. package/dist/components/data-display/chart/Sparkline.mjs +7 -0
  82. package/dist/components/data-display/chart/Sparkline.mjs.map +1 -0
  83. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs +293 -0
  84. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  85. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs +292 -0
  86. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  87. package/dist/components/data-display/chart/useChart.cjs +189 -0
  88. package/dist/components/data-display/chart/useChart.cjs.map +1 -0
  89. package/dist/components/data-display/chart/useChart.mjs +182 -0
  90. package/dist/components/data-display/chart/useChart.mjs.map +1 -0
  91. package/dist/components/data-display/date-picker/DateRangePicker.cjs.map +1 -1
  92. package/dist/components/data-display/date-picker/DateRangePicker.mjs.map +1 -1
  93. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs +1 -7
  94. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  95. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +1 -7
  96. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  97. package/dist/components/data-display/date-picker/DateTimePicker.cjs.map +1 -1
  98. package/dist/components/data-display/date-picker/DateTimePicker.mjs.map +1 -1
  99. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
  100. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  101. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  102. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  103. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs +1 -1
  104. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs +1 -1
  105. package/dist/components/feedback/Drawer.cjs.map +1 -1
  106. package/dist/components/feedback/Drawer.mjs.map +1 -1
  107. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +4 -9
  108. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  109. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +4 -9
  110. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  111. package/dist/components/feedback/Modal.cjs.map +1 -1
  112. package/dist/components/feedback/Modal.mjs.map +1 -1
  113. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +4 -9
  114. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  115. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +4 -9
  116. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  117. package/dist/components/feedback/Tooltip.cjs.map +1 -1
  118. package/dist/components/feedback/Tooltip.mjs.map +1 -1
  119. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs +64 -20
  120. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  121. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs +64 -20
  122. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  123. package/dist/components/forms/Button.cjs +1 -1
  124. package/dist/components/forms/Button.cjs.map +1 -1
  125. package/dist/components/forms/Button.mjs +1 -1
  126. package/dist/components/forms/Button.mjs.map +1 -1
  127. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs +76 -63
  128. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  129. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs +77 -64
  130. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  131. package/dist/components/forms/ButtonGroup.cjs +1 -1
  132. package/dist/components/forms/ButtonGroup.cjs.map +1 -1
  133. package/dist/components/forms/ButtonGroup.mjs +1 -1
  134. package/dist/components/forms/ButtonGroup.mjs.map +1 -1
  135. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs +2 -2
  136. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  137. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs +2 -2
  138. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  139. package/dist/components/forms/Checkbox.cjs +1 -1
  140. package/dist/components/forms/Checkbox.cjs.map +1 -1
  141. package/dist/components/forms/Checkbox.mjs +1 -1
  142. package/dist/components/forms/Checkbox.mjs.map +1 -1
  143. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs +7 -7
  144. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  145. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs +7 -7
  146. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  147. package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
  148. package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  149. package/dist/components/forms/Combobox.cjs.map +1 -1
  150. package/dist/components/forms/Combobox.mjs.map +1 -1
  151. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs +4 -4
  152. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  153. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs +4 -4
  154. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  155. package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  156. package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  157. package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  158. package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  159. package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  160. package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  161. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  162. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  163. package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.cjs +1 -1
  164. package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.mjs +1 -1
  165. package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.cjs +1 -1
  166. package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.mjs +1 -1
  167. package/dist/components/forms/MenuButton.cjs +6 -0
  168. package/dist/components/forms/MenuButton.cjs.map +1 -0
  169. package/dist/components/forms/MenuButton.mjs +7 -0
  170. package/dist/components/forms/MenuButton.mjs.map +1 -0
  171. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs +270 -0
  172. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  173. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs +269 -0
  174. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  175. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs +2 -2
  176. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs +2 -2
  177. package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  178. package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  179. package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  180. package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  181. package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  182. package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  183. package/dist/components/forms/PhoneInput.cjs.map +1 -1
  184. package/dist/components/forms/PhoneInput.mjs.map +1 -1
  185. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs +8 -3
  186. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  187. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs +8 -3
  188. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  189. package/dist/components/forms/Radio.cjs +1 -1
  190. package/dist/components/forms/Radio.cjs.map +1 -1
  191. package/dist/components/forms/Radio.mjs +1 -1
  192. package/dist/components/forms/Radio.mjs.map +1 -1
  193. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs +6 -6
  194. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  195. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs +6 -6
  196. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  197. package/dist/components/forms/RangeSlider.cjs.map +1 -1
  198. package/dist/components/forms/RangeSlider.mjs.map +1 -1
  199. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs +6 -6
  200. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  201. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs +6 -6
  202. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  203. package/dist/components/forms/SearchInput.cjs.map +1 -1
  204. package/dist/components/forms/SearchInput.mjs.map +1 -1
  205. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs +230 -23
  206. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  207. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs +232 -25
  208. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  209. package/dist/components/forms/Segmented.cjs +1 -1
  210. package/dist/components/forms/Segmented.cjs.map +1 -1
  211. package/dist/components/forms/Segmented.mjs +1 -1
  212. package/dist/components/forms/Segmented.mjs.map +1 -1
  213. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs +4 -12
  214. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  215. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs +4 -12
  216. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  217. package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.cjs +2 -2
  218. package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.mjs +2 -2
  219. package/dist/components/forms/Slider.cjs.map +1 -1
  220. package/dist/components/forms/Slider.mjs.map +1 -1
  221. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs +6 -6
  222. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  223. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs +6 -6
  224. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  225. package/dist/components/forms/Switch.cjs +1 -1
  226. package/dist/components/forms/Switch.cjs.map +1 -1
  227. package/dist/components/forms/Switch.mjs +1 -1
  228. package/dist/components/forms/Switch.mjs.map +1 -1
  229. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs +7 -7
  230. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  231. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs +7 -7
  232. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  233. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
  234. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs +1 -1
  235. package/dist/components/layout/AppShell.cjs.map +1 -1
  236. package/dist/components/layout/AppShell.mjs.map +1 -1
  237. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs +8 -8
  238. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  239. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs +8 -8
  240. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  241. package/dist/components/layout/PopoverPanel.cjs +1 -1
  242. package/dist/components/layout/PopoverPanel.cjs.map +1 -1
  243. package/dist/components/layout/PopoverPanel.mjs +1 -1
  244. package/dist/components/layout/PopoverPanel.mjs.map +1 -1
  245. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +2 -2
  246. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  247. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +2 -2
  248. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  249. package/dist/components/layout/Sidebar.cjs.map +1 -1
  250. package/dist/components/layout/Sidebar.mjs.map +1 -1
  251. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs +36 -21
  252. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  253. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs +36 -21
  254. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  255. package/dist/components/layout/Topbar.cjs.map +1 -1
  256. package/dist/components/layout/Topbar.mjs.map +1 -1
  257. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs +2 -2
  258. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  259. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs +2 -2
  260. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  261. package/dist/components/navigation/Switcher.cjs.map +1 -1
  262. package/dist/components/navigation/Switcher.mjs.map +1 -1
  263. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +42 -44
  264. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  265. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +42 -44
  266. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  267. package/dist/components/navigation/Tabs.cjs +1 -1
  268. package/dist/components/navigation/Tabs.cjs.map +1 -1
  269. package/dist/components/navigation/Tabs.mjs +1 -1
  270. package/dist/components/navigation/Tabs.mjs.map +1 -1
  271. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs +1 -9
  272. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  273. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs +1 -9
  274. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  275. package/dist/composables/eventColors.cjs +51 -27
  276. package/dist/composables/eventColors.cjs.map +1 -1
  277. package/dist/composables/eventColors.mjs +51 -27
  278. package/dist/composables/eventColors.mjs.map +1 -1
  279. package/dist/composables/useBodyScrollLock.cjs +44 -0
  280. package/dist/composables/useBodyScrollLock.cjs.map +1 -0
  281. package/dist/composables/useBodyScrollLock.mjs +43 -0
  282. package/dist/composables/useBodyScrollLock.mjs.map +1 -0
  283. package/dist/composables/useCalendarTheme.cjs +29 -8
  284. package/dist/composables/useCalendarTheme.cjs.map +1 -1
  285. package/dist/composables/useCalendarTheme.mjs +29 -8
  286. package/dist/composables/useCalendarTheme.mjs.map +1 -1
  287. package/dist/composables/useField.cjs +21 -23
  288. package/dist/composables/useField.cjs.map +1 -1
  289. package/dist/composables/useField.mjs +21 -24
  290. package/dist/composables/useField.mjs.map +1 -1
  291. package/dist/composables/usePopover.cjs +49 -13
  292. package/dist/composables/usePopover.cjs.map +1 -1
  293. package/dist/composables/usePopover.mjs +49 -13
  294. package/dist/composables/usePopover.mjs.map +1 -1
  295. package/dist/index.cjs +5 -1
  296. package/dist/index.mjs +4 -2
  297. package/dist/mood-ui.css +116 -482
  298. package/dist/types/components/data-display/Chart.vue.d.ts +8 -0
  299. package/dist/types/components/data-display/Stat.vue.d.ts +12 -2
  300. package/dist/types/components/data-display/chart/Cartesian.vue.d.ts +17 -0
  301. package/dist/types/components/data-display/chart/Heatmap.vue.d.ts +10 -0
  302. package/dist/types/components/data-display/chart/Polar.vue.d.ts +9 -0
  303. package/dist/types/components/data-display/chart/Radar.vue.d.ts +10 -0
  304. package/dist/types/components/data-display/chart/Sparkline.vue.d.ts +13 -0
  305. package/dist/types/components/data-display/chart/useChart.d.ts +49 -0
  306. package/dist/types/components/feedback/Drawer.vue.d.ts +2 -2
  307. package/dist/types/components/feedback/Modal.vue.d.ts +2 -2
  308. package/dist/types/components/feedback/Tooltip.vue.d.ts +1 -1
  309. package/dist/types/components/forms/Button.vue.d.ts +3 -2
  310. package/dist/types/components/forms/Combobox.vue.d.ts +3 -3
  311. package/dist/types/components/forms/DateField.vue.d.ts +3 -3
  312. package/dist/types/components/forms/DateRangeField.vue.d.ts +3 -3
  313. package/dist/types/components/forms/DateTimeField.vue.d.ts +3 -3
  314. package/dist/types/components/forms/MenuButton.vue.d.ts +23 -0
  315. package/dist/types/components/forms/MultiSelect.vue.d.ts +3 -3
  316. package/dist/types/components/forms/SearchInput.vue.d.ts +33 -2
  317. package/dist/types/components/forms/Select.vue.d.ts +2 -2
  318. package/dist/types/components/layout/AppShell.vue.d.ts +1 -1
  319. package/dist/types/components/layout/PageHeader.vue.d.ts +1 -1
  320. package/dist/types/components/layout/Sidebar.vue.d.ts +4 -4
  321. package/dist/types/components/layout/Stack.vue.d.ts +1 -1
  322. package/dist/types/components/layout/Topbar.vue.d.ts +1 -1
  323. package/dist/types/components/navigation/Breadcrumbs.vue.d.ts +1 -1
  324. package/dist/types/components/navigation/Switcher.vue.d.ts +3 -3
  325. package/dist/types/composables/eventColors.d.ts +2 -2
  326. package/dist/types/composables/useBodyScrollLock.d.ts +19 -0
  327. package/dist/types/composables/useCalendarTheme.d.ts +2 -0
  328. package/dist/types/composables/useField.d.ts +10 -0
  329. package/dist/types/composables/usePopover.d.ts +7 -0
  330. package/dist/types/index.d.ts +4 -0
  331. package/dist/types/interfaces/data-display/Chart.interface.d.ts +97 -0
  332. package/dist/types/interfaces/data-display/Stat.interface.d.ts +17 -6
  333. package/dist/types/interfaces/data-display/calendar/AgendaView.interface.d.ts +5 -0
  334. package/dist/types/interfaces/data-display/calendar/DayView.interface.d.ts +5 -0
  335. package/dist/types/interfaces/data-display/calendar/MonthView.interface.d.ts +5 -0
  336. package/dist/types/interfaces/data-display/calendar/Scheduler.interface.d.ts +5 -0
  337. package/dist/types/interfaces/data-display/calendar/WeekView.interface.d.ts +5 -0
  338. package/dist/types/interfaces/feedback/Tooltip.interface.d.ts +11 -0
  339. package/dist/types/interfaces/forms/MenuButton.interface.d.ts +38 -0
  340. package/dist/types/interfaces/forms/SearchInput.interface.d.ts +36 -0
  341. package/dist/types/utils/cssLength.d.ts +5 -0
  342. package/dist/types/utils/tooltipArrow.d.ts +34 -0
  343. package/dist/utils/cssLength.cjs +13 -0
  344. package/dist/utils/cssLength.cjs.map +1 -0
  345. package/dist/utils/cssLength.mjs +13 -0
  346. package/dist/utils/cssLength.mjs.map +1 -0
  347. package/dist/utils/tooltipArrow.cjs +37 -0
  348. package/dist/utils/tooltipArrow.cjs.map +1 -0
  349. package/dist/utils/tooltipArrow.mjs +36 -0
  350. package/dist/utils/tooltipArrow.mjs.map +1 -0
  351. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ //#region src/composables/useBodyScrollLock.ts
2
+ /**
3
+ * Reference-counted `<body>` scroll lock, shared by every overlay that needs
4
+ * one (Modal, Drawer, …).
5
+ *
6
+ * Each overlay used to save and restore `body.style.overflow` on its own. That
7
+ * breaks as soon as two overlays are open at once: the second one saves the
8
+ * *locked* value (`'hidden'`) as the thing to restore, so whichever releases
9
+ * last writes `overflow: hidden` back onto <body> and the page can never
10
+ * scroll again. Counting holders here means the original values are captured
11
+ * once, by the first lock, and restored once, by the last release.
12
+ *
13
+ * Callers must pair every `lockBodyScroll()` with exactly one
14
+ * `unlockBodyScroll()` — components track that with an instance-level flag so
15
+ * a double release cannot drop the count below zero.
16
+ */
17
+ var holders = 0;
18
+ var previousOverflow = "";
19
+ var previousPaddingRight = "";
20
+ function lockBodyScroll() {
21
+ if (typeof document === "undefined") return;
22
+ if (holders === 0) {
23
+ const scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;
24
+ previousOverflow = document.body.style.overflow;
25
+ previousPaddingRight = document.body.style.paddingRight;
26
+ document.body.style.overflow = "hidden";
27
+ if (scrollBarWidth > 0) document.body.style.paddingRight = `${scrollBarWidth}px`;
28
+ }
29
+ holders += 1;
30
+ }
31
+ function unlockBodyScroll() {
32
+ if (typeof document === "undefined" || holders === 0) return;
33
+ holders -= 1;
34
+ if (holders > 0) return;
35
+ document.body.style.overflow = previousOverflow;
36
+ document.body.style.paddingRight = previousPaddingRight;
37
+ previousOverflow = "";
38
+ previousPaddingRight = "";
39
+ }
40
+ //#endregion
41
+ export { lockBodyScroll, unlockBodyScroll };
42
+
43
+ //# sourceMappingURL=useBodyScrollLock.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBodyScrollLock.mjs","names":[],"sources":["../../src/composables/useBodyScrollLock.ts"],"sourcesContent":["/**\n * Reference-counted `<body>` scroll lock, shared by every overlay that needs\n * one (Modal, Drawer, …).\n *\n * Each overlay used to save and restore `body.style.overflow` on its own. That\n * breaks as soon as two overlays are open at once: the second one saves the\n * *locked* value (`'hidden'`) as the thing to restore, so whichever releases\n * last writes `overflow: hidden` back onto <body> and the page can never\n * scroll again. Counting holders here means the original values are captured\n * once, by the first lock, and restored once, by the last release.\n *\n * Callers must pair every `lockBodyScroll()` with exactly one\n * `unlockBodyScroll()` — components track that with an instance-level flag so\n * a double release cannot drop the count below zero.\n */\n\nlet holders = 0;\nlet previousOverflow = '';\nlet previousPaddingRight = '';\n\nexport function lockBodyScroll(): void {\n if (typeof document === 'undefined') return;\n\n if (holders === 0) {\n // Compensate for the scrollbar the lock is about to remove, so the\n // page underneath doesn't shift sideways.\n const scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;\n previousOverflow = document.body.style.overflow;\n previousPaddingRight = document.body.style.paddingRight;\n document.body.style.overflow = 'hidden';\n if (scrollBarWidth > 0) {\n document.body.style.paddingRight = `${scrollBarWidth}px`;\n }\n }\n\n holders += 1;\n}\n\nexport function unlockBodyScroll(): void {\n if (typeof document === 'undefined' || holders === 0) return;\n\n holders -= 1;\n if (holders > 0) return;\n\n document.body.style.overflow = previousOverflow;\n document.body.style.paddingRight = previousPaddingRight;\n previousOverflow = '';\n previousPaddingRight = '';\n}\n\n/** Test-only escape hatch so specs can start from a known state. */\nexport function __resetBodyScrollLock(): void {\n holders = 0;\n previousOverflow = '';\n previousPaddingRight = '';\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAI,UAAU;AACd,IAAI,mBAAmB;AACvB,IAAI,uBAAuB;AAE3B,SAAgB,iBAAuB;CACnC,IAAI,OAAO,aAAa,aAAa;CAErC,IAAI,YAAY,GAAG;EAGf,MAAM,iBAAiB,OAAO,aAAa,SAAS,gBAAgB;EACpE,mBAAmB,SAAS,KAAK,MAAM;EACvC,uBAAuB,SAAS,KAAK,MAAM;EAC3C,SAAS,KAAK,MAAM,WAAW;EAC/B,IAAI,iBAAiB,GACjB,SAAS,KAAK,MAAM,eAAe,GAAG,eAAe;;CAI7D,WAAW;;AAGf,SAAgB,mBAAyB;CACrC,IAAI,OAAO,aAAa,eAAe,YAAY,GAAG;CAEtD,WAAW;CACX,IAAI,UAAU,GAAG;CAEjB,SAAS,KAAK,MAAM,WAAW;CAC/B,SAAS,KAAK,MAAM,eAAe;CACnC,mBAAmB;CACnB,uBAAuB"}
@@ -58,6 +58,18 @@ var PILL = {
58
58
  large: "rounded-full",
59
59
  full: "rounded-full"
60
60
  };
61
+ /**
62
+ * Radii at which an event still has enough straight left edge to carry the
63
+ * colour rule. Past these, `border-radius` sweeps the one-sided border around
64
+ * the corner arc and it renders as a crescent hugging the side of the event
65
+ * instead of a bar; the translucent fill and the text colour carry the event
66
+ * colour on their own there.
67
+ */
68
+ var EVENT_ACCENT_RADII = [
69
+ "none",
70
+ "small",
71
+ "medium"
72
+ ];
61
73
  var DAY_NAME_CASE = {
62
74
  upper: "uppercase",
63
75
  lower: "lowercase",
@@ -74,15 +86,24 @@ function useCalendarTheme(input) {
74
86
  const resolvedRadius = (0, vue.computed)(() => {
75
87
  return input.radius() ?? cfg?.value.radius ?? "medium";
76
88
  });
89
+ const todayTextClass = (0, vue.computed)(() => TEXT[resolvedColor.value] ?? TEXT.default);
90
+ const todayBgClass = (0, vue.computed)(() => BG[resolvedColor.value] ?? BG.default);
91
+ const rangeSelectClass = (0, vue.computed)(() => RANGE[resolvedColor.value] ?? RANGE.default);
92
+ const focusRingColorClass = (0, vue.computed)(() => RING[resolvedColor.value] ?? RING.default);
93
+ const highlightDotClass = (0, vue.computed)(() => DOT[resolvedColor.value] ?? DOT.default);
94
+ const containerRadiusClass = (0, vue.computed)(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large);
95
+ const eventRadiusClass = (0, vue.computed)(() => EVENT[resolvedRadius.value] ?? EVENT.small);
96
+ const pillRadiusClass = (0, vue.computed)(() => PILL[resolvedRadius.value] ?? PILL.full);
77
97
  return {
78
- todayTextClass: (0, vue.computed)(() => TEXT[resolvedColor.value] ?? TEXT.default),
79
- todayBgClass: (0, vue.computed)(() => BG[resolvedColor.value] ?? BG.default),
80
- rangeSelectClass: (0, vue.computed)(() => RANGE[resolvedColor.value] ?? RANGE.default),
81
- focusRingColorClass: (0, vue.computed)(() => RING[resolvedColor.value] ?? RING.default),
82
- highlightDotClass: (0, vue.computed)(() => DOT[resolvedColor.value] ?? DOT.default),
83
- containerRadiusClass: (0, vue.computed)(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large),
84
- eventRadiusClass: (0, vue.computed)(() => EVENT[resolvedRadius.value] ?? EVENT.small),
85
- pillRadiusClass: (0, vue.computed)(() => PILL[resolvedRadius.value] ?? PILL.full),
98
+ todayTextClass,
99
+ todayBgClass,
100
+ rangeSelectClass,
101
+ focusRingColorClass,
102
+ highlightDotClass,
103
+ containerRadiusClass,
104
+ eventRadiusClass,
105
+ showEventAccent: (0, vue.computed)(() => EVENT_ACCENT_RADII.includes(resolvedRadius.value)),
106
+ pillRadiusClass,
86
107
  dayNameCaseClass: (0, vue.computed)(() => DAY_NAME_CASE[input.dayNameCase?.() ?? "upper"] ?? DAY_NAME_CASE.upper),
87
108
  resolvedColor
88
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useCalendarTheme.cjs","names":[],"sources":["../../src/composables/useCalendarTheme.ts"],"sourcesContent":["import { computed, type ComputedRef } from 'vue'; \nimport { useModoConfig } from './useModoConfig'; \n \nexport type CalendarColor = 'default' | 'primary' | 'danger' | 'success' | 'warning'; \nexport type CalendarRadius = 'none' | 'small' | 'medium' | 'large' | 'full'; \nexport type DayNameCase = 'upper' | 'lower' | 'capitalize' | 'normal'; \n \nexport interface CalendarThemeInput { \n color: () => CalendarColor | undefined; \n radius: () => CalendarRadius | undefined; \n dayNameCase?: () => DayNameCase; \n} \n \nexport interface CalendarTheme { \n todayTextClass: ComputedRef<string>; \n todayBgClass: ComputedRef<string>; \n rangeSelectClass: ComputedRef<string>; \n focusRingColorClass: ComputedRef<string>; \n highlightDotClass: ComputedRef<string>; \n containerRadiusClass: ComputedRef<string>; \n eventRadiusClass: ComputedRef<string>; \n pillRadiusClass: ComputedRef<string>; \n dayNameCaseClass: ComputedRef<string>; \n resolvedColor: ComputedRef<CalendarColor>; \n} \n \nconst TEXT: Record<CalendarColor, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \n \nconst BG: Record<CalendarColor, string> = { \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}; \n \nconst RANGE: Record<CalendarColor, string> = { \n default: 'border-foreground/40 bg-foreground/10', \n primary: 'border-primary/50 bg-primary/10', \n danger: 'border-destructive/50 bg-destructive/10', \n success: 'border-success/50 bg-success/10', \n warning: 'border-warning/50 bg-warning/10', \n}; \n \nconst RING: Record<CalendarColor, string> = { \n default: 'ring-ring', \n primary: 'ring-primary', \n danger: 'ring-destructive', \n success: 'ring-success', \n warning: 'ring-warning', \n}; \n \nconst DOT: Record<CalendarColor, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst CONTAINER: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded', \n medium: 'rounded-md', \n large: 'rounded-xl', \n full: 'rounded-3xl', \n}; \n \nconst EVENT: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded', \n large: 'rounded-md', \n full: 'rounded-xl', \n}; \n \nconst PILL: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-full', \n full: 'rounded-full', \n}; \n \nconst DAY_NAME_CASE: Record<DayNameCase, string> = { \n upper: 'uppercase', \n lower: 'lowercase', \n capitalize: 'capitalize', \n normal: 'normal-case', \n}; \n \nexport function useCalendarTheme(input: CalendarThemeInput): CalendarTheme { \n const cfg = useModoConfig(); \n const resolvedColor = computed<CalendarColor>(() => { \n const local = input.color(); \n if (local && local !== 'default') return local; \n return (cfg?.value.color as CalendarColor) ?? 'default'; \n }); \n const resolvedRadius = computed<CalendarRadius>(() => { \n const local = input.radius(); \n return local ?? (cfg?.value.radius as CalendarRadius) ?? 'medium'; \n }); \n \n const todayTextClass = computed(() => TEXT[resolvedColor.value] ?? TEXT.default); \n const todayBgClass = computed(() => BG[resolvedColor.value] ?? BG.default); \n const rangeSelectClass = computed(() => RANGE[resolvedColor.value] ?? RANGE.default); \n const focusRingColorClass = computed(() => RING[resolvedColor.value] ?? RING.default); \n const highlightDotClass = computed(() => DOT[resolvedColor.value] ?? DOT.default); \n const containerRadiusClass = computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large); \n const eventRadiusClass = computed(() => EVENT[resolvedRadius.value] ?? EVENT.small); \n const pillRadiusClass = computed(() => PILL[resolvedRadius.value] ?? PILL.full); \n const dayNameCaseClass = computed(() => DAY_NAME_CASE[input.dayNameCase?.() ?? 'upper'] ?? DAY_NAME_CASE.upper); \n \n return { \n todayTextClass, \n todayBgClass, \n rangeSelectClass, \n focusRingColorClass, \n highlightDotClass, \n containerRadiusClass, \n eventRadiusClass, \n pillRadiusClass, \n dayNameCaseClass, \n resolvedColor, \n }; \n}\n"],"mappings":";;;;AA0BA,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,KAAoC;CACtC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,QAAuC;CACzC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,MAAqC;CACvC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,YAA4C;CAC9C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,QAAwC;CAC1C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,OAAuC;CACzC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,gBAA6C;CAC/C,OAAO;CACP,OAAO;CACP,YAAY;CACZ,QAAQ;CACX;AAED,SAAgB,iBAAiB,OAA0C;CACvE,MAAM,MAAM,sBAAA,eAAe;CAC3B,MAAM,iBAAA,GAAA,IAAA,gBAA8C;EAChD,MAAM,QAAQ,MAAM,OAAO;EAC3B,IAAI,SAAS,UAAU,WAAW,OAAO;EACzC,OAAQ,KAAK,MAAM,SAA2B;GAChD;CACF,MAAM,kBAAA,GAAA,IAAA,gBAAgD;EAElD,OADc,MAAM,QACb,IAAU,KAAK,MAAM,UAA6B;GAC3D;CAYF,OAAO;EACH,iBAAA,GAAA,IAAA,gBAXkC,KAAK,cAAc,UAAU,KAAK,QAWpE;EACA,eAAA,GAAA,IAAA,gBAXgC,GAAG,cAAc,UAAU,GAAG,QAW9D;EACA,mBAAA,GAAA,IAAA,gBAXoC,MAAM,cAAc,UAAU,MAAM,QAWxE;EACA,sBAAA,GAAA,IAAA,gBAXuC,KAAK,cAAc,UAAU,KAAK,QAWzE;EACA,oBAAA,GAAA,IAAA,gBAXqC,IAAI,cAAc,UAAU,IAAI,QAWrE;EACA,uBAAA,GAAA,IAAA,gBAXwC,UAAU,eAAe,UAAU,UAAU,MAWrF;EACA,mBAAA,GAAA,IAAA,gBAXoC,MAAM,eAAe,UAAU,MAAM,MAWzE;EACA,kBAAA,GAAA,IAAA,gBAXmC,KAAK,eAAe,UAAU,KAAK,KAWtE;EACA,mBAAA,GAAA,IAAA,gBAXoC,cAAc,MAAM,eAAe,IAAI,YAAY,cAAc,MAWrG;EACA;EACH"}
1
+ {"version":3,"file":"useCalendarTheme.cjs","names":[],"sources":["../../src/composables/useCalendarTheme.ts"],"sourcesContent":["import { computed, type ComputedRef } from 'vue'; \nimport { useModoConfig } from './useModoConfig'; \n \nexport type CalendarColor = 'default' | 'primary' | 'danger' | 'success' | 'warning'; \nexport type CalendarRadius = 'none' | 'small' | 'medium' | 'large' | 'full'; \nexport type DayNameCase = 'upper' | 'lower' | 'capitalize' | 'normal'; \n \nexport interface CalendarThemeInput { \n color: () => CalendarColor | undefined; \n radius: () => CalendarRadius | undefined; \n dayNameCase?: () => DayNameCase; \n} \n \nexport interface CalendarTheme { \n todayTextClass: ComputedRef<string>; \n todayBgClass: ComputedRef<string>; \n rangeSelectClass: ComputedRef<string>; \n focusRingColorClass: ComputedRef<string>; \n highlightDotClass: ComputedRef<string>; \n containerRadiusClass: ComputedRef<string>; \n eventRadiusClass: ComputedRef<string>;\n /** Whether an event's left colour rule reads as a bar at the current radius. */\n showEventAccent: ComputedRef<boolean>;\n pillRadiusClass: ComputedRef<string>;\n dayNameCaseClass: ComputedRef<string>; \n resolvedColor: ComputedRef<CalendarColor>; \n} \n \nconst TEXT: Record<CalendarColor, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \n \nconst BG: Record<CalendarColor, string> = { \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}; \n \nconst RANGE: Record<CalendarColor, string> = { \n default: 'border-foreground/40 bg-foreground/10', \n primary: 'border-primary/50 bg-primary/10', \n danger: 'border-destructive/50 bg-destructive/10', \n success: 'border-success/50 bg-success/10', \n warning: 'border-warning/50 bg-warning/10', \n}; \n \nconst RING: Record<CalendarColor, string> = { \n default: 'ring-ring', \n primary: 'ring-primary', \n danger: 'ring-destructive', \n success: 'ring-success', \n warning: 'ring-warning', \n}; \n \nconst DOT: Record<CalendarColor, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst CONTAINER: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded', \n medium: 'rounded-md', \n large: 'rounded-xl', \n full: 'rounded-3xl', \n}; \n \nconst EVENT: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded', \n large: 'rounded-md', \n full: 'rounded-xl', \n}; \n \nconst PILL: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-full', \n full: 'rounded-full', \n}; \n \n/**\n * Radii at which an event still has enough straight left edge to carry the\n * colour rule. Past these, `border-radius` sweeps the one-sided border around\n * the corner arc and it renders as a crescent hugging the side of the event\n * instead of a bar; the translucent fill and the text colour carry the event\n * colour on their own there.\n */\nconst EVENT_ACCENT_RADII: CalendarRadius[] = ['none', 'small', 'medium'];\n\nconst DAY_NAME_CASE: Record<DayNameCase, string> = {\n upper: 'uppercase', \n lower: 'lowercase', \n capitalize: 'capitalize', \n normal: 'normal-case', \n}; \n \nexport function useCalendarTheme(input: CalendarThemeInput): CalendarTheme { \n const cfg = useModoConfig(); \n const resolvedColor = computed<CalendarColor>(() => { \n const local = input.color(); \n if (local && local !== 'default') return local; \n return (cfg?.value.color as CalendarColor) ?? 'default'; \n }); \n const resolvedRadius = computed<CalendarRadius>(() => { \n const local = input.radius(); \n return local ?? (cfg?.value.radius as CalendarRadius) ?? 'medium'; \n }); \n \n const todayTextClass = computed(() => TEXT[resolvedColor.value] ?? TEXT.default); \n const todayBgClass = computed(() => BG[resolvedColor.value] ?? BG.default); \n const rangeSelectClass = computed(() => RANGE[resolvedColor.value] ?? RANGE.default); \n const focusRingColorClass = computed(() => RING[resolvedColor.value] ?? RING.default); \n const highlightDotClass = computed(() => DOT[resolvedColor.value] ?? DOT.default); \n const containerRadiusClass = computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large); \n const eventRadiusClass = computed(() => EVENT[resolvedRadius.value] ?? EVENT.small); \n const pillRadiusClass = computed(() => PILL[resolvedRadius.value] ?? PILL.full);\n const showEventAccent = computed(() => EVENT_ACCENT_RADII.includes(resolvedRadius.value));\n const dayNameCaseClass = computed(() => DAY_NAME_CASE[input.dayNameCase?.() ?? 'upper'] ?? DAY_NAME_CASE.upper); \n \n return { \n todayTextClass, \n todayBgClass, \n rangeSelectClass, \n focusRingColorClass, \n highlightDotClass, \n containerRadiusClass,\n eventRadiusClass,\n showEventAccent,\n pillRadiusClass,\n dayNameCaseClass, \n resolvedColor, \n }; \n}\n"],"mappings":";;;;AA4BA,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,KAAoC;CACtC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,QAAuC;CACzC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;A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e,UAAU,UAAU,MAAM;CAC/F,MAAM,oBAAA,GAAA,IAAA,gBAAkC,MAAM,eAAe,UAAU,MAAM,MAAM;CACnF,MAAM,mBAAA,GAAA,IAAA,gBAAiC,KAAK,eAAe,UAAU,KAAK,KAAK;CAI/E,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAAA,GAAA,IAAA,gBAXmC,mBAAmB,SAAS,eAAe,MAAM,CAWpF;EACA;EACA,mBAAA,GAAA,IAAA,gBAZoC,cAAc,MAAM,eAAe,IAAI,YAAY,cAAc,MAYrG;EACA;EACH"}
@@ -57,6 +57,18 @@ var PILL = {
57
57
  large: "rounded-full",
58
58
  full: "rounded-full"
59
59
  };
60
+ /**
61
+ * Radii at which an event still has enough straight left edge to carry the
62
+ * colour rule. Past these, `border-radius` sweeps the one-sided border around
63
+ * the corner arc and it renders as a crescent hugging the side of the event
64
+ * instead of a bar; the translucent fill and the text colour carry the event
65
+ * colour on their own there.
66
+ */
67
+ var EVENT_ACCENT_RADII = [
68
+ "none",
69
+ "small",
70
+ "medium"
71
+ ];
60
72
  var DAY_NAME_CASE = {
61
73
  upper: "uppercase",
62
74
  lower: "lowercase",
@@ -73,15 +85,24 @@ function useCalendarTheme(input) {
73
85
  const resolvedRadius = computed(() => {
74
86
  return input.radius() ?? cfg?.value.radius ?? "medium";
75
87
  });
88
+ const todayTextClass = computed(() => TEXT[resolvedColor.value] ?? TEXT.default);
89
+ const todayBgClass = computed(() => BG[resolvedColor.value] ?? BG.default);
90
+ const rangeSelectClass = computed(() => RANGE[resolvedColor.value] ?? RANGE.default);
91
+ const focusRingColorClass = computed(() => RING[resolvedColor.value] ?? RING.default);
92
+ const highlightDotClass = computed(() => DOT[resolvedColor.value] ?? DOT.default);
93
+ const containerRadiusClass = computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large);
94
+ const eventRadiusClass = computed(() => EVENT[resolvedRadius.value] ?? EVENT.small);
95
+ const pillRadiusClass = computed(() => PILL[resolvedRadius.value] ?? PILL.full);
76
96
  return {
77
- todayTextClass: computed(() => TEXT[resolvedColor.value] ?? TEXT.default),
78
- todayBgClass: computed(() => BG[resolvedColor.value] ?? BG.default),
79
- rangeSelectClass: computed(() => RANGE[resolvedColor.value] ?? RANGE.default),
80
- focusRingColorClass: computed(() => RING[resolvedColor.value] ?? RING.default),
81
- highlightDotClass: computed(() => DOT[resolvedColor.value] ?? DOT.default),
82
- containerRadiusClass: computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large),
83
- eventRadiusClass: computed(() => EVENT[resolvedRadius.value] ?? EVENT.small),
84
- pillRadiusClass: computed(() => PILL[resolvedRadius.value] ?? PILL.full),
97
+ todayTextClass,
98
+ todayBgClass,
99
+ rangeSelectClass,
100
+ focusRingColorClass,
101
+ highlightDotClass,
102
+ containerRadiusClass,
103
+ eventRadiusClass,
104
+ showEventAccent: computed(() => EVENT_ACCENT_RADII.includes(resolvedRadius.value)),
105
+ pillRadiusClass,
85
106
  dayNameCaseClass: computed(() => DAY_NAME_CASE[input.dayNameCase?.() ?? "upper"] ?? DAY_NAME_CASE.upper),
86
107
  resolvedColor
87
108
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useCalendarTheme.mjs","names":[],"sources":["../../src/composables/useCalendarTheme.ts"],"sourcesContent":["import { computed, type ComputedRef } from 'vue'; \nimport { useModoConfig } from './useModoConfig'; \n \nexport type CalendarColor = 'default' | 'primary' | 'danger' | 'success' | 'warning'; \nexport type CalendarRadius = 'none' | 'small' | 'medium' | 'large' | 'full'; \nexport type DayNameCase = 'upper' | 'lower' | 'capitalize' | 'normal'; \n \nexport interface CalendarThemeInput { \n color: () => CalendarColor | undefined; \n radius: () => CalendarRadius | undefined; \n dayNameCase?: () => DayNameCase; \n} \n \nexport interface CalendarTheme { \n todayTextClass: ComputedRef<string>; \n todayBgClass: ComputedRef<string>; \n rangeSelectClass: ComputedRef<string>; \n focusRingColorClass: ComputedRef<string>; \n highlightDotClass: ComputedRef<string>; \n containerRadiusClass: ComputedRef<string>; \n eventRadiusClass: ComputedRef<string>; \n pillRadiusClass: ComputedRef<string>; \n dayNameCaseClass: ComputedRef<string>; \n resolvedColor: ComputedRef<CalendarColor>; \n} \n \nconst TEXT: Record<CalendarColor, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \n \nconst BG: Record<CalendarColor, string> = { \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}; \n \nconst RANGE: Record<CalendarColor, string> = { \n default: 'border-foreground/40 bg-foreground/10', \n primary: 'border-primary/50 bg-primary/10', \n danger: 'border-destructive/50 bg-destructive/10', \n success: 'border-success/50 bg-success/10', \n warning: 'border-warning/50 bg-warning/10', \n}; \n \nconst RING: Record<CalendarColor, string> = { \n default: 'ring-ring', \n primary: 'ring-primary', \n danger: 'ring-destructive', \n success: 'ring-success', \n warning: 'ring-warning', \n}; \n \nconst DOT: Record<CalendarColor, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst CONTAINER: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded', \n medium: 'rounded-md', \n large: 'rounded-xl', \n full: 'rounded-3xl', \n}; \n \nconst EVENT: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded', \n large: 'rounded-md', \n full: 'rounded-xl', \n}; \n \nconst PILL: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-full', \n full: 'rounded-full', \n}; \n \nconst DAY_NAME_CASE: Record<DayNameCase, string> = { \n upper: 'uppercase', \n lower: 'lowercase', \n capitalize: 'capitalize', \n normal: 'normal-case', \n}; \n \nexport function useCalendarTheme(input: CalendarThemeInput): CalendarTheme { \n const cfg = useModoConfig(); \n const resolvedColor = computed<CalendarColor>(() => { \n const local = input.color(); \n if (local && local !== 'default') return local; \n return (cfg?.value.color as CalendarColor) ?? 'default'; \n }); \n const resolvedRadius = computed<CalendarRadius>(() => { \n const local = input.radius(); \n return local ?? (cfg?.value.radius as CalendarRadius) ?? 'medium'; \n }); \n \n const todayTextClass = computed(() => TEXT[resolvedColor.value] ?? TEXT.default); \n const todayBgClass = computed(() => BG[resolvedColor.value] ?? BG.default); \n const rangeSelectClass = computed(() => RANGE[resolvedColor.value] ?? RANGE.default); \n const focusRingColorClass = computed(() => RING[resolvedColor.value] ?? RING.default); \n const highlightDotClass = computed(() => DOT[resolvedColor.value] ?? DOT.default); \n const containerRadiusClass = computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large); \n const eventRadiusClass = computed(() => EVENT[resolvedRadius.value] ?? EVENT.small); \n const pillRadiusClass = computed(() => PILL[resolvedRadius.value] ?? PILL.full); \n const dayNameCaseClass = computed(() => DAY_NAME_CASE[input.dayNameCase?.() ?? 'upper'] ?? DAY_NAME_CASE.upper); \n \n return { \n todayTextClass, \n todayBgClass, \n rangeSelectClass, \n focusRingColorClass, \n highlightDotClass, \n containerRadiusClass, \n eventRadiusClass, \n pillRadiusClass, \n dayNameCaseClass, \n resolvedColor, \n }; \n}\n"],"mappings":";;;AA0BA,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,KAAoC;CACtC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,QAAuC;CACzC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,MAAqC;CACvC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,YAA4C;CAC9C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,QAAwC;CAC1C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,OAAuC;CACzC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,gBAA6C;CAC/C,OAAO;CACP,OAAO;CACP,YAAY;CACZ,QAAQ;CACX;AAED,SAAgB,iBAAiB,OAA0C;CACvE,MAAM,MAAM,eAAe;CAC3B,MAAM,gBAAgB,eAA8B;EAChD,MAAM,QAAQ,MAAM,OAAO;EAC3B,IAAI,SAAS,UAAU,WAAW,OAAO;EACzC,OAAQ,KAAK,MAAM,SAA2B;GAChD;CACF,MAAM,iBAAiB,eAA+B;EAElD,OADc,MAAM,QACb,IAAU,KAAK,MAAM,UAA6B;GAC3D;CAYF,OAAO;EACH,gBAXmB,eAAe,KAAK,cAAc,UAAU,KAAK,QAWpE;EACA,cAXiB,eAAe,GAAG,cAAc,UAAU,GAAG,QAW9D;EACA,kBAXqB,eAAe,MAAM,cAAc,UAAU,MAAM,QAWxE;EACA,qBAXwB,eAAe,KAAK,cAAc,UAAU,KAAK,QAWzE;EACA,mBAXsB,eAAe,IAAI,cAAc,UAAU,IAAI,QAWrE;EACA,sBAXyB,eAAe,UAAU,eAAe,UAAU,UAAU,MAWrF;EACA,kBAXqB,eAAe,MAAM,eAAe,UAAU,MAAM,MAWzE;EACA,iBAXoB,eAAe,KAAK,eAAe,UAAU,KAAK,KAWtE;EACA,kBAXqB,eAAe,cAAc,MAAM,eAAe,IAAI,YAAY,cAAc,MAWrG;EACA;EACH"}
1
+ {"version":3,"file":"useCalendarTheme.mjs","names":[],"sources":["../../src/composables/useCalendarTheme.ts"],"sourcesContent":["import { computed, type ComputedRef } from 'vue'; \nimport { useModoConfig } from './useModoConfig'; \n \nexport type CalendarColor = 'default' | 'primary' | 'danger' | 'success' | 'warning'; \nexport type CalendarRadius = 'none' | 'small' | 'medium' | 'large' | 'full'; \nexport type DayNameCase = 'upper' | 'lower' | 'capitalize' | 'normal'; \n \nexport interface CalendarThemeInput { \n color: () => CalendarColor | undefined; \n radius: () => CalendarRadius | undefined; \n dayNameCase?: () => DayNameCase; \n} \n \nexport interface CalendarTheme { \n todayTextClass: ComputedRef<string>; \n todayBgClass: ComputedRef<string>; \n rangeSelectClass: ComputedRef<string>; \n focusRingColorClass: ComputedRef<string>; \n highlightDotClass: ComputedRef<string>; \n containerRadiusClass: ComputedRef<string>; \n eventRadiusClass: ComputedRef<string>;\n /** Whether an event's left colour rule reads as a bar at the current radius. */\n showEventAccent: ComputedRef<boolean>;\n pillRadiusClass: ComputedRef<string>;\n dayNameCaseClass: ComputedRef<string>; \n resolvedColor: ComputedRef<CalendarColor>; \n} \n \nconst TEXT: Record<CalendarColor, string> = { \n default: 'text-foreground', \n primary: 'text-primary', \n danger: 'text-destructive', \n success: 'text-success', \n warning: 'text-warning', \n}; \n \nconst BG: Record<CalendarColor, string> = { \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}; \n \nconst RANGE: Record<CalendarColor, string> = { \n default: 'border-foreground/40 bg-foreground/10', \n primary: 'border-primary/50 bg-primary/10', \n danger: 'border-destructive/50 bg-destructive/10', \n success: 'border-success/50 bg-success/10', \n warning: 'border-warning/50 bg-warning/10', \n}; \n \nconst RING: Record<CalendarColor, string> = { \n default: 'ring-ring', \n primary: 'ring-primary', \n danger: 'ring-destructive', \n success: 'ring-success', \n warning: 'ring-warning', \n}; \n \nconst DOT: Record<CalendarColor, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \n \nconst CONTAINER: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded', \n medium: 'rounded-md', \n large: 'rounded-xl', \n full: 'rounded-3xl', \n}; \n \nconst EVENT: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded', \n large: 'rounded-md', \n full: 'rounded-xl', \n}; \n \nconst PILL: Record<CalendarRadius, string> = { \n none: 'rounded-none', \n small: 'rounded-sm', \n medium: 'rounded-md', \n large: 'rounded-full', \n full: 'rounded-full', \n}; \n \n/**\n * Radii at which an event still has enough straight left edge to carry the\n * colour rule. Past these, `border-radius` sweeps the one-sided border around\n * the corner arc and it renders as a crescent hugging the side of the event\n * instead of a bar; the translucent fill and the text colour carry the event\n * colour on their own there.\n */\nconst EVENT_ACCENT_RADII: CalendarRadius[] = ['none', 'small', 'medium'];\n\nconst DAY_NAME_CASE: Record<DayNameCase, string> = {\n upper: 'uppercase', \n lower: 'lowercase', \n capitalize: 'capitalize', \n normal: 'normal-case', \n}; \n \nexport function useCalendarTheme(input: CalendarThemeInput): CalendarTheme { \n const cfg = useModoConfig(); \n const resolvedColor = computed<CalendarColor>(() => { \n const local = input.color(); \n if (local && local !== 'default') return local; \n return (cfg?.value.color as CalendarColor) ?? 'default'; \n }); \n const resolvedRadius = computed<CalendarRadius>(() => { \n const local = input.radius(); \n return local ?? (cfg?.value.radius as CalendarRadius) ?? 'medium'; \n }); \n \n const todayTextClass = computed(() => TEXT[resolvedColor.value] ?? TEXT.default); \n const todayBgClass = computed(() => BG[resolvedColor.value] ?? BG.default); \n const rangeSelectClass = computed(() => RANGE[resolvedColor.value] ?? RANGE.default); \n const focusRingColorClass = computed(() => RING[resolvedColor.value] ?? RING.default); \n const highlightDotClass = computed(() => DOT[resolvedColor.value] ?? DOT.default); \n const containerRadiusClass = computed(() => CONTAINER[resolvedRadius.value] ?? CONTAINER.large); \n const eventRadiusClass = computed(() => EVENT[resolvedRadius.value] ?? EVENT.small); \n const pillRadiusClass = computed(() => PILL[resolvedRadius.value] ?? PILL.full);\n const showEventAccent = computed(() => EVENT_ACCENT_RADII.includes(resolvedRadius.value));\n const dayNameCaseClass = computed(() => DAY_NAME_CASE[input.dayNameCase?.() ?? 'upper'] ?? DAY_NAME_CASE.upper); \n \n return { \n todayTextClass, \n todayBgClass, \n rangeSelectClass, \n focusRingColorClass, \n highlightDotClass, \n containerRadiusClass,\n eventRadiusClass,\n showEventAccent,\n pillRadiusClass,\n dayNameCaseClass, \n resolvedColor, \n }; \n}\n"],"mappings":";;;AA4BA,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,KAAoC;CACtC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,QAAuC;CACzC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,OAAsC;CACxC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,MAAqC;CACvC,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACZ;AAED,IAAM,YAA4C;CAC9C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,QAAwC;CAC1C,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;AAED,IAAM,OAAuC;CACzC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACT;;;;;;;;AASD,IAAM,qBAAuC;CAAC;CAAQ;CAAS;CAAS;AAExE,IAAM,gBAA6C;CAC/C,OAAO;CACP,OAAO;CACP,YAAY;CACZ,QAAQ;CACX;AAED,SAAgB,iBAAiB,OAA0C;CACvE,MAAM,MAAM,eAAe;CAC3B,MAAM,gBAAgB,eAA8B;EAChD,MAAM,QAAQ,MAAM,OAAO;EAC3B,IAAI,SAAS,UAAU,WAAW,OAAO;EACzC,OAAQ,KAAK,MAAM,SAA2B;GAChD;CACF,MAAM,iBAAiB,eAA+B;EAElD,OADc,MAAM,QACb,IAAU,KAAK,MAAM,UAA6B;GAC3D;CAEF,MAAM,iBAAiB,eAAe,KAAK,cAAc,UAAU,KAAK,QAAQ;CAChF,MAAM,eAAe,eAAe,GAAG,cAAc,UAAU,GAAG,QAAQ;CAC1E,MAAM,mBAAmB,eAAe,MAAM,cAAc,UAAU,MAAM,QAAQ;CACpF,MAAM,sBAAsB,eAAe,KAAK,cAAc,UAAU,KAAK,QAAQ;CACrF,MAAM,oBAAoB,eAAe,IAAI,cAAc,UAAU,IAAI,QAAQ;CACjF,MAAM,uBAAuB,eAAe,UAAU,eAAe,UAAU,UAAU,MAAM;CAC/F,MAAM,mBAAmB,eAAe,MAAM,eAAe,UAAU,MAAM,MAAM;CACnF,MAAM,kBAAkB,eAAe,KAAK,eAAe,UAAU,KAAK,KAAK;CAI/E,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAXoB,eAAe,mBAAmB,SAAS,eAAe,MAAM,CAWpF;EACA;EACA,kBAZqB,eAAe,cAAc,MAAM,eAAe,IAAI,YAAY,cAAc,MAYrG;EACA;EACH"}
@@ -76,20 +76,6 @@ var FIELD_AFFORDANCE_ACTION_BY_COLOR = {
76
76
  success: "modo-affordance-action",
77
77
  warning: "modo-affordance-action"
78
78
  };
79
- var FOCUS_RING_BY_COLOR = {
80
- default: "focus-within:ring-ring/10",
81
- primary: "focus-within:ring-primary/12",
82
- danger: "focus-within:ring-destructive/12",
83
- success: "focus-within:ring-success/12",
84
- warning: "focus-within:ring-warning/12"
85
- };
86
- var FORCED_RING_BY_COLOR = {
87
- default: "ring-ring/10",
88
- primary: "ring-primary/12",
89
- danger: "ring-destructive/12",
90
- success: "ring-success/12",
91
- warning: "ring-warning/12"
92
- };
93
79
  var FOCUS_BORDER_BY_COLOR = {
94
80
  default: "focus-within:border-foreground/50",
95
81
  primary: "focus-within:border-primary/60",
@@ -104,9 +90,19 @@ var FORCED_BORDER_BY_COLOR = {
104
90
  success: "border-success/60",
105
91
  warning: "border-warning/60"
106
92
  };
107
- /**
108
- * Resuelve las clases de wrapper (variante + halo + error) y el radius
109
- * para cualquier campo de formulario que siga el patrón Input/Textarea.
93
+ /**
94
+ * THE single focus indicator for the whole system. Every interactive component
95
+ * uses this exact ring so tabbing through a form/toolbar shows one consistent
96
+ * focus — a soft ring, no offset gap. `FIELD_FOCUS_RING` is the `focus-within`
97
+ * variant for field wrappers; `CONTROL_FOCUS_RING` is the `focus-visible`
98
+ * variant for buttons and other single-element controls.
99
+ */
100
+ var MODO_FOCUS_RING = "ring-2 ring-ring/60";
101
+ var FIELD_FOCUS_RING = "focus-within:ring-2 focus-within:ring-ring/60";
102
+ var CONTROL_FOCUS_RING = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60";
103
+ /**
104
+ * Resuelve las clases de wrapper (variante + halo + error) y el radius
105
+ * para cualquier campo de formulario que siga el patrón Input/Textarea.
110
106
  */
111
107
  function useFieldClasses(source) {
112
108
  const resolvedHalo = require_useModoConfig.useResolvedHalo(() => {
@@ -120,21 +116,20 @@ function useFieldClasses(source) {
120
116
  const forceFocus = source.forceFocus ? (0, vue.toValue)(source.forceFocus) : false;
121
117
  const halo = resolvedHalo.value;
122
118
  const errBorder = hasError ? "border-destructive" : "";
123
- const focusRing = halo === "neutral" ? "focus-within:ring-ring/12" : FOCUS_RING_BY_COLOR[stateColor];
124
119
  const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor];
125
- const forcedRing = forceFocus ? halo === "neutral" ? "ring-ring/12" : FORCED_RING_BY_COLOR[stateColor] : "";
126
120
  const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : "";
127
121
  const forcedBg = forceFocus ? "bg-background" : "";
128
122
  const idleRing = halo === "off" ? "" : "ring-4 ring-border/25";
129
- const focusRingUtil = halo === "off" ? "focus-within:ring-4 focus-within:ring-ring/15" : `focus-within:ring-4 ${focusRing}`;
130
- const forcedRingUtil = halo === "off" ? forceFocus ? "ring-4 ring-ring/15" : "" : forceFocus ? `ring-4 ${forcedRing}` : "";
123
+ const focusRingUtil = FIELD_FOCUS_RING;
124
+ const forcedRingUtil = forceFocus ? MODO_FOCUS_RING : "";
131
125
  switch (variant) {
132
126
  case "filled": return [
133
127
  "bg-muted border border-transparent",
134
128
  idleRing,
135
129
  "focus-within:bg-background",
130
+ focusBorder,
136
131
  focusRingUtil,
137
- forceFocus ? `${forcedRingUtil} ${forcedBg}` : forcedBg,
132
+ forceFocus ? `${forcedRingUtil} ${forcedBorder} ${forcedBg}` : forcedBg,
138
133
  errBorder
139
134
  ].join(" ");
140
135
  case "ghost": return [
@@ -146,8 +141,10 @@ function useFieldClasses(source) {
146
141
  default: return [
147
142
  "bg-background border border-input",
148
143
  idleRing,
144
+ focusBorder,
149
145
  focusRingUtil,
150
146
  forcedRingUtil,
147
+ forcedBorder,
151
148
  errBorder
152
149
  ].join(" ");
153
150
  }
@@ -158,13 +155,14 @@ function useFieldClasses(source) {
158
155
  case "none": return "rounded-none";
159
156
  case "small": return "rounded-sm";
160
157
  case "large": return "rounded-xl";
161
- case "full": return source.fullRadiusClass ?? "rounded-full";
158
+ case "full": return source.fullRadiusClass ?? "rounded-[999px]";
162
159
  default: return "rounded-md";
163
160
  }
164
161
  })
165
162
  };
166
163
  }
167
164
  //#endregion
165
+ exports.CONTROL_FOCUS_RING = CONTROL_FOCUS_RING;
168
166
  exports.FIELD_AFFORDANCE_ACTION_BY_COLOR = FIELD_AFFORDANCE_ACTION_BY_COLOR;
169
167
  exports.FIELD_AFFORDANCE_ICON_BY_COLOR = FIELD_AFFORDANCE_ICON_BY_COLOR;
170
168
  exports.FORM_FIELD_ID_KEY = FORM_FIELD_ID_KEY;
@@ -1 +1 @@
1
- {"version":3,"file":"useField.cjs","names":[],"sources":["../../src/composables/useField.ts"],"sourcesContent":["import { computed, inject, useId, toValue, type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref } from 'vue';\nimport { useResolvedHalo } from './useModoConfig';\nimport type { ModoHalo } from '../config/ModoConfig';\nimport { useResolvedColor, useResolvedRadius } from './useModoConfig';\n\n/**\n * Injection key provided by FormField so child form controls can:\n * 1. Use the FormField's id as their own (connecting `<label for=\"...\">` automatically).\n * 2. Suppress the \"no label\" a11y warning — the FormField already renders a visible label.\n */\nexport const FORM_FIELD_ID_KEY: InjectionKey<Ref<string>> = Symbol('FormFieldId');\n \n/** \n * Props del campo de formulario que necesita `useFieldState`. \n * Se definen aquí para que cualquier componente (Input, Textarea, Password…) \n * pueda extenderlas y pasar su reactive `props` directamente. \n */ \nexport interface FieldStateSource { \n modelValue?: unknown; \n id?: string; \n label?: string; \n ariaLabel?: string; \n color?: 'default' | 'primary' | 'danger' | 'success' | 'warning'; \n radius?: 'none' | 'small' | 'medium' | 'large' | 'full'; \n errorText?: string; \n helperText?: string; \n /** Cuando es true, fuerza estado inválido sin renderizar errorText. Útil al envolver con FormField. */ \n invalid?: boolean; \n /** IDs adicionales para concatenar en aria-describedby (ej. provistos por un wrapper). */ \n ariaDescribedBy?: string; \n maxLength?: number; \n showCounter?: boolean; \n disabled?: boolean; \n loading?: boolean; \n} \n \nexport interface UseFieldStateOptions { \n /** Nombre del componente para el warning DEV. */ \n componentName: string; \n /** Prefijo para el id autogenerado (ej. 'modo-input'). */ \n idPrefix: string; \n} \n \n/** \n * Estado compartido entre campos de formulario (Input, Textarea, Password…). \n * \n * Resuelve: \n * - `fieldId` (prop.id o autogenerado). \n * - Color/radius resueltos desde el provider. \n * - `stateColor` (danger si hay error, si no el color resuelto). \n * - `describedBy` con los IDs de helper/error/counter. \n * - Contador y flags derivadas. \n * - Warning DEV cuando falta label/ariaLabel. \n */ \nexport function useFieldState(\n props: FieldStateSource,\n options: UseFieldStateOptions,\n) {\n const autoId = useId();\n // If a parent FormField provides its id, use it — this connects the FormField's\n // `<label for=\"...\">` to this input automatically without needing v-slot binding.\n const formFieldId = inject(FORM_FIELD_ID_KEY, null);\n const fieldId = computed(() => props.id ?? formFieldId?.value ?? `${options.idPrefix}-${autoId}`);\n \n const color = useResolvedColor(() => props.color); \n const radius = useResolvedRadius(() => props.radius); \n \n const hasError = computed(() => !!props.errorText || !!props.invalid); \n const isDisabled = computed(() => !!props.disabled || !!props.loading); \n \n const stateColor = computed(() => \n hasError.value ? 'danger' : color.value, \n ) as ComputedRef<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n \n const hasValue = computed(() => { \n const v = props.modelValue; \n return v !== null && v !== undefined && String(v).length > 0; \n }); \n \n const currentLength = computed(() => String(props.modelValue ?? '').length); \n const showCounterEffective = computed( \n () => !!props.showCounter && !!props.maxLength, \n ); \n const counterOverflow = computed( \n () => !!props.maxLength && currentLength.value >= props.maxLength, \n ); \n \n const errorId = computed(() => `${fieldId.value}-error`); \n const helperId = computed(() => `${fieldId.value}-helper`); \n const counterId = computed(() => `${fieldId.value}-counter`); \n \n const describedBy = computed(() => { \n const ids: string[] = []; \n if (hasError.value && props.errorText) ids.push(errorId.value); \n else if (props.helperText) ids.push(helperId.value); \n if (showCounterEffective.value) ids.push(counterId.value); \n if (props.ariaDescribedBy) ids.push(props.ariaDescribedBy); \n return ids.length ? ids.join(' ') : undefined; \n }); \n \n // Warn only when there is genuinely no accessible label: no label/ariaLabel prop\n // AND no parent FormField providing one (detected via injection key).\n if (import.meta.env.DEV && !props.label && !props.ariaLabel && !props.id && !formFieldId) {\n console.warn(\n `[mood-ui ${options.componentName}] Se requiere \\`label\\` o \\`ariaLabel\\` para accesibilidad.`,\n );\n }\n \n return { \n fieldId, \n color, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n }; \n} \n \nexport type FieldVariant = 'outline' | 'filled' | 'ghost'; \n \nexport interface UseFieldClassesSource { \n variant: MaybeRefOrGetter<FieldVariant>; \n stateColor: MaybeRefOrGetter<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n hasError: MaybeRefOrGetter<boolean>; \n radius: MaybeRefOrGetter<'none' | 'small' | 'medium' | 'large' | 'full'>; \n /** radius utility para 'full' (Input usa 'full', Textarea usa '2xl'). */ \n fullRadiusClass?: string; \n /** \n * Cuando es true, fuerza los estilos de focus (halo + borde) aunque \n * el foco esté fuera del wrapper. Útil para Select/Combobox cuando \n * el popover teleportado roba el foco pero el campo sigue \"activo\". \n */ \n forceFocus?: MaybeRefOrGetter<boolean>; \n /** \n * Estilo del halo del campo. Si no se pasa, se usa el valor resuelto \n * vía ModoProvider/useResolvedHalo. \n * - `'tinted'`: tintado al color (default) \n * - `'neutral'`: siempre gris \n * - `'off'`: sin halo persistente (solo focus-visible ring a11y) \n */ \n halo?: MaybeRefOrGetter<ModoHalo | undefined>; \n} \n\nexport const FIELD_AFFORDANCE_ICON_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-icon',\n primary: 'modo-affordance-icon',\n danger: 'text-destructive/85',\n success: 'modo-affordance-icon',\n warning: 'modo-affordance-icon',\n};\n\nexport const FIELD_AFFORDANCE_ACTION_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-action',\n primary: 'modo-affordance-action',\n danger: 'text-destructive/80 hover:text-destructive',\n success: 'modo-affordance-action',\n warning: 'modo-affordance-action',\n};\n \nconst FOCUS_RING_BY_COLOR: Record<string, string> = { \n default: 'focus-within:ring-ring/10', \n primary: 'focus-within:ring-primary/12', \n danger: 'focus-within:ring-destructive/12', \n success: 'focus-within:ring-success/12', \n warning: 'focus-within:ring-warning/12', \n}; \n \nconst FORCED_RING_BY_COLOR: Record<string, string> = { \n default: 'ring-ring/10', \n primary: 'ring-primary/12', \n danger: 'ring-destructive/12', \n success: 'ring-success/12', \n warning: 'ring-warning/12', \n}; \n \nconst FOCUS_BORDER_BY_COLOR: Record<string, string> = { \n default: 'focus-within:border-foreground/50', \n primary: 'focus-within:border-primary/60', \n danger: 'focus-within:border-destructive/60', \n success: 'focus-within:border-success/60', \n warning: 'focus-within:border-warning/60', \n}; \n \nconst FORCED_BORDER_BY_COLOR: Record<string, string> = { \n default: 'border-foreground/50', \n primary: 'border-primary/60', \n danger: 'border-destructive/60', \n success: 'border-success/60', \n warning: 'border-warning/60', \n}; \n \n/** \n * Resuelve las clases de wrapper (variante + halo + error) y el radius \n * para cualquier campo de formulario que siga el patrón Input/Textarea. \n */ \nexport function useFieldClasses(source: UseFieldClassesSource) { \n const resolvedHalo = useResolvedHalo(() => { \n const local = source.halo ? toValue(source.halo) : undefined; \n return local; \n }); \n \n const wrapperVariantClasses = computed(() => { \n const variant = toValue(source.variant); \n const stateColor = toValue(source.stateColor); \n const hasError = toValue(source.hasError); \n const forceFocus = source.forceFocus ? toValue(source.forceFocus) : false; \n const halo = resolvedHalo.value; \n const errBorder = hasError ? 'border-destructive' : ''; \n // En modo `neutral` el focus también queda gris; en `tinted` toma color. \n const focusRing = halo === 'neutral' ? 'focus-within:ring-ring/12' : FOCUS_RING_BY_COLOR[stateColor]; \n const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor]; \n const forcedRing = forceFocus \n ? (halo === 'neutral' ? 'ring-ring/12' : FORCED_RING_BY_COLOR[stateColor]) \n : ''; \n const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : ''; \n const forcedBg = forceFocus ? 'bg-background' : ''; \n \n // Halo persistente (ring idle) — se omite cuando halo === 'off'. \n // En 'off' aparece solo en focus-within, neutro (no tintado al color). \n const idleRing = halo === 'off' ? '' : 'ring-4 ring-border/25'; \n const offFocusRingUtil = 'focus-within:ring-4 focus-within:ring-ring/15'; \n const focusRingUtil = halo === 'off' ? offFocusRingUtil : `focus-within:ring-4 ${focusRing}`; \n const offForcedRing = 'ring-4 ring-ring/15'; \n const forcedRingUtil = halo === 'off' \n ? (forceFocus ? offForcedRing : '') \n : (forceFocus ? `ring-4 ${forcedRing}` : ''); \n \n switch (variant) { \n case 'filled': \n return [ \n 'bg-muted border border-transparent', \n idleRing, \n 'focus-within:bg-background', \n focusRingUtil, \n forceFocus ? `${forcedRingUtil} ${forcedBg}` : forcedBg, \n errBorder, \n ].join(' '); \n case 'ghost': \n return [ \n 'bg-transparent border-b border-border rounded-none', \n focusBorder, \n forcedBorder, \n hasError ? 'border-destructive' : '', \n ].join(' '); \n case 'outline': \n default: \n return [ \n 'bg-background border border-input', \n idleRing, \n focusRingUtil, \n forcedRingUtil, \n errBorder, \n ].join(' '); \n } \n }); \n \n const radiusClasses = computed(() => { \n const variant = toValue(source.variant); \n if (variant === 'ghost') return ''; \n const radius = toValue(source.radius); \n switch (radius) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return source.fullRadiusClass ?? 'rounded-full'; \n case 'medium': \n default: return 'rounded-md'; \n } \n }); \n \n return { wrapperVariantClasses, radiusClasses }; \n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,oBAA+C,OAAO,cAAc;;;;;;;;;;;;AA4CjF,SAAgB,cACZ,OACA,SACF;CACE,MAAM,UAAA,GAAA,IAAA,QAAgB;CAGtB,MAAM,eAAA,GAAA,IAAA,QAAqB,mBAAmB,KAAK;CACnD,MAAM,WAAA,GAAA,IAAA,gBAAyB,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ,SAAS,GAAG,SAAS;CAEjG,MAAM,QAAQ,sBAAA,uBAAuB,MAAM,MAAM;CACjD,MAAM,SAAS,sBAAA,wBAAwB,MAAM,OAAO;CAEpD,MAAM,YAAA,GAAA,IAAA,gBAA0B,CAAC,CAAC,MAAM,aAAa,CAAC,CAAC,MAAM,QAAQ;CACrE,MAAM,cAAA,GAAA,IAAA,gBAA4B,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,MAAM,QAAQ;CAEtE,MAAM,cAAA,GAAA,IAAA,gBACF,SAAS,QAAQ,WAAW,MAAM,MACrC;CAED,MAAM,YAAA,GAAA,IAAA,gBAA0B;EAC5B,MAAM,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,KAAK,IAAI;IAEf,SACI,OAAO;KACH;KACA;KACA;KACA;KACA;KACH,CAAC,KAAK,IAAI;;IAkBd;EAAuB,gBAAA,GAAA,IAAA,gBAdK;GAEjC,KAAA,GAAA,IAAA,SADwB,OAAO,QAC3B,KAAY,SAAS,OAAO;GAEhC,SAAA,GAAA,IAAA,SADuB,OAAO,OACtB,EAAR;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IACrB,KAAK,QAAQ,OAAO,OAAO,mBAAmB;IAE9C,SAAS,OAAO;;IAIQ;EAAe"}
1
+ {"version":3,"file":"useField.cjs","names":[],"sources":["../../src/composables/useField.ts"],"sourcesContent":["import { computed, inject, useId, toValue, type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref } from 'vue';\nimport { useResolvedHalo } from './useModoConfig';\nimport type { ModoHalo } from '../config/ModoConfig';\nimport { useResolvedColor, useResolvedRadius } from './useModoConfig';\n\n/**\n * Injection key provided by FormField so child form controls can:\n * 1. Use the FormField's id as their own (connecting `<label for=\"...\">` automatically).\n * 2. Suppress the \"no label\" a11y warning — the FormField already renders a visible label.\n */\nexport const FORM_FIELD_ID_KEY: InjectionKey<Ref<string>> = Symbol('FormFieldId');\n \n/** \n * Props del campo de formulario que necesita `useFieldState`. \n * Se definen aquí para que cualquier componente (Input, Textarea, Password…) \n * pueda extenderlas y pasar su reactive `props` directamente. \n */ \nexport interface FieldStateSource { \n modelValue?: unknown; \n id?: string; \n label?: string; \n ariaLabel?: string; \n color?: 'default' | 'primary' | 'danger' | 'success' | 'warning'; \n radius?: 'none' | 'small' | 'medium' | 'large' | 'full'; \n errorText?: string; \n helperText?: string; \n /** Cuando es true, fuerza estado inválido sin renderizar errorText. Útil al envolver con FormField. */ \n invalid?: boolean; \n /** IDs adicionales para concatenar en aria-describedby (ej. provistos por un wrapper). */ \n ariaDescribedBy?: string; \n maxLength?: number; \n showCounter?: boolean; \n disabled?: boolean; \n loading?: boolean; \n} \n \nexport interface UseFieldStateOptions { \n /** Nombre del componente para el warning DEV. */ \n componentName: string; \n /** Prefijo para el id autogenerado (ej. 'modo-input'). */ \n idPrefix: string; \n} \n \n/** \n * Estado compartido entre campos de formulario (Input, Textarea, Password…). \n * \n * Resuelve: \n * - `fieldId` (prop.id o autogenerado). \n * - Color/radius resueltos desde el provider. \n * - `stateColor` (danger si hay error, si no el color resuelto). \n * - `describedBy` con los IDs de helper/error/counter. \n * - Contador y flags derivadas. \n * - Warning DEV cuando falta label/ariaLabel. \n */ \nexport function useFieldState(\n props: FieldStateSource,\n options: UseFieldStateOptions,\n) {\n const autoId = useId();\n // If a parent FormField provides its id, use it — this connects the FormField's\n // `<label for=\"...\">` to this input automatically without needing v-slot binding.\n const formFieldId = inject(FORM_FIELD_ID_KEY, null);\n const fieldId = computed(() => props.id ?? formFieldId?.value ?? `${options.idPrefix}-${autoId}`);\n \n const color = useResolvedColor(() => props.color); \n const radius = useResolvedRadius(() => props.radius); \n \n const hasError = computed(() => !!props.errorText || !!props.invalid); \n const isDisabled = computed(() => !!props.disabled || !!props.loading); \n \n const stateColor = computed(() => \n hasError.value ? 'danger' : color.value, \n ) as ComputedRef<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n \n const hasValue = computed(() => { \n const v = props.modelValue; \n return v !== null && v !== undefined && String(v).length > 0; \n }); \n \n const currentLength = computed(() => String(props.modelValue ?? '').length); \n const showCounterEffective = computed( \n () => !!props.showCounter && !!props.maxLength, \n ); \n const counterOverflow = computed( \n () => !!props.maxLength && currentLength.value >= props.maxLength, \n ); \n \n const errorId = computed(() => `${fieldId.value}-error`); \n const helperId = computed(() => `${fieldId.value}-helper`); \n const counterId = computed(() => `${fieldId.value}-counter`); \n \n const describedBy = computed(() => { \n const ids: string[] = []; \n if (hasError.value && props.errorText) ids.push(errorId.value); \n else if (props.helperText) ids.push(helperId.value); \n if (showCounterEffective.value) ids.push(counterId.value); \n if (props.ariaDescribedBy) ids.push(props.ariaDescribedBy); \n return ids.length ? ids.join(' ') : undefined; \n }); \n \n // Warn only when there is genuinely no accessible label: no label/ariaLabel prop\n // AND no parent FormField providing one (detected via injection key).\n if (import.meta.env.DEV && !props.label && !props.ariaLabel && !props.id && !formFieldId) {\n console.warn(\n `[mood-ui ${options.componentName}] Se requiere \\`label\\` o \\`ariaLabel\\` para accesibilidad.`,\n );\n }\n \n return { \n fieldId, \n color, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n }; \n} \n \nexport type FieldVariant = 'outline' | 'filled' | 'ghost'; \n \nexport interface UseFieldClassesSource { \n variant: MaybeRefOrGetter<FieldVariant>; \n stateColor: MaybeRefOrGetter<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n hasError: MaybeRefOrGetter<boolean>; \n radius: MaybeRefOrGetter<'none' | 'small' | 'medium' | 'large' | 'full'>; \n /** radius utility para 'full' (Input usa 'full', Textarea usa '2xl'). */ \n fullRadiusClass?: string; \n /** \n * Cuando es true, fuerza los estilos de focus (halo + borde) aunque \n * el foco esté fuera del wrapper. Útil para Select/Combobox cuando \n * el popover teleportado roba el foco pero el campo sigue \"activo\". \n */ \n forceFocus?: MaybeRefOrGetter<boolean>; \n /** \n * Estilo del halo del campo. Si no se pasa, se usa el valor resuelto \n * vía ModoProvider/useResolvedHalo. \n * - `'tinted'`: tintado al color (default) \n * - `'neutral'`: siempre gris \n * - `'off'`: sin halo persistente (solo focus-visible ring a11y) \n */ \n halo?: MaybeRefOrGetter<ModoHalo | undefined>; \n} \n\nexport const FIELD_AFFORDANCE_ICON_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-icon',\n primary: 'modo-affordance-icon',\n danger: 'text-destructive/85',\n success: 'modo-affordance-icon',\n warning: 'modo-affordance-icon',\n};\n\nexport const FIELD_AFFORDANCE_ACTION_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-action',\n primary: 'modo-affordance-action',\n danger: 'text-destructive/80 hover:text-destructive',\n success: 'modo-affordance-action',\n warning: 'modo-affordance-action',\n};\n \nconst FOCUS_BORDER_BY_COLOR: Record<string, string> = { \n default: 'focus-within:border-foreground/50', \n primary: 'focus-within:border-primary/60', \n danger: 'focus-within:border-destructive/60', \n success: 'focus-within:border-success/60', \n warning: 'focus-within:border-warning/60', \n}; \n \nconst FORCED_BORDER_BY_COLOR: Record<string, string> = { \n default: 'border-foreground/50', \n primary: 'border-primary/60', \n danger: 'border-destructive/60', \n success: 'border-success/60', \n warning: 'border-warning/60', \n}; \n \n/**\n * THE single focus indicator for the whole system. Every interactive component\n * uses this exact ring so tabbing through a form/toolbar shows one consistent\n * focus — a soft ring, no offset gap. `FIELD_FOCUS_RING` is the `focus-within`\n * variant for field wrappers; `CONTROL_FOCUS_RING` is the `focus-visible`\n * variant for buttons and other single-element controls.\n */\nexport const MODO_FOCUS_RING = 'ring-2 ring-ring/60';\nexport const FIELD_FOCUS_RING = 'focus-within:ring-2 focus-within:ring-ring/60';\nexport const CONTROL_FOCUS_RING =\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60';\n\n/**\n * Resuelve las clases de wrapper (variante + halo + error) y el radius\n * para cualquier campo de formulario que siga el patrón Input/Textarea.\n */\nexport function useFieldClasses(source: UseFieldClassesSource) {\n const resolvedHalo = useResolvedHalo(() => { \n const local = source.halo ? toValue(source.halo) : undefined; \n return local; \n }); \n \n const wrapperVariantClasses = computed(() => {\n const variant = toValue(source.variant);\n const stateColor = toValue(source.stateColor);\n const hasError = toValue(source.hasError);\n const forceFocus = source.forceFocus ? toValue(source.forceFocus) : false;\n const halo = resolvedHalo.value;\n const errBorder = hasError ? 'border-destructive' : '';\n const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor];\n const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : '';\n const forcedBg = forceFocus ? 'bg-background' : '';\n\n // The persistent halo (idle ring) is opt-in via `neutral`/`tinted`.\n // The FOCUS ring is the SAME everywhere (see MODO_FOCUS_RING) so a field\n // and a button show an identical indicator when you tab to them.\n const idleRing = halo === 'off' ? '' : 'ring-4 ring-border/25';\n const focusRingUtil = FIELD_FOCUS_RING;\n const forcedRingUtil = forceFocus ? MODO_FOCUS_RING : '';\n\n switch (variant) {\n case 'filled':\n return [\n 'bg-muted border border-transparent',\n idleRing,\n 'focus-within:bg-background',\n focusBorder,\n focusRingUtil,\n forceFocus ? `${forcedRingUtil} ${forcedBorder} ${forcedBg}` : forcedBg,\n errBorder,\n ].join(' ');\n case 'ghost':\n return [\n 'bg-transparent border-b border-border rounded-none',\n focusBorder,\n forcedBorder,\n hasError ? 'border-destructive' : '',\n ].join(' ');\n case 'outline':\n default:\n return [\n 'bg-background border border-input',\n idleRing,\n focusBorder,\n focusRingUtil,\n forcedRingUtil,\n forcedBorder,\n errBorder,\n ].join(' ');\n }\n });\n \n const radiusClasses = computed(() => { \n const variant = toValue(source.variant); \n if (variant === 'ghost') return ''; \n const radius = toValue(source.radius); \n switch (radius) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // `rounded-full` compiles to an effectively-infinite radius which\n // Chrome clamps differently for box-shadows than for the border,\n // making any ring render boxy corners. A large *finite* radius is a\n // visually-identical pill that shadows follow correctly.\n case 'full': return source.fullRadiusClass ?? 'rounded-[999px]';\n case 'medium': \n default: return 'rounded-md'; \n } \n }); \n \n return { wrapperVariantClasses, radiusClasses }; \n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,oBAA+C,OAAO,cAAc;;;;;;;;;;;;AA4CjF,SAAgB,cACZ,OACA,SACF;CACE,MAAM,UAAA,GAAA,IAAA,QAAgB;CAGtB,MAAM,eAAA,GAAA,IAAA,QAAqB,mBAAmB,KAAK;CACnD,MAAM,WAAA,GAAA,IAAA,gBAAyB,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ,SAAS,GAAG,SAAS;CAEjG,MAAM,QA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AAG,aAAa,GAAG,aAAa;KAC/D;KACH,CAAC,KAAK,IAAI;IACf,KAAK,SACD,OAAO;KACH;KACA;KACA;KACA,WAAW,uBAAuB;KACrC,CAAC,KAAK,IAAI;IAEf,SACI,OAAO;KACH;KACA;KACA;KACA;KACA;KACA;KACA;KACH,CAAC,KAAK,IAAI;;IAsBd;EAAuB,gBAAA,GAAA,IAAA,gBAlBK;GAEjC,KAAA,GAAA,IAAA,SADwB,OAAO,QAC3B,KAAY,SAAS,OAAO;GAEhC,SAAA,GAAA,IAAA,SADuB,OAAO,OACtB,EAAR;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IAKrB,KAAK,QAAQ,OAAO,OAAO,mBAAmB;IAE9C,SAAS,OAAO;;IAIQ;EAAe"}
@@ -75,20 +75,6 @@ var FIELD_AFFORDANCE_ACTION_BY_COLOR = {
75
75
  success: "modo-affordance-action",
76
76
  warning: "modo-affordance-action"
77
77
  };
78
- var FOCUS_RING_BY_COLOR = {
79
- default: "focus-within:ring-ring/10",
80
- primary: "focus-within:ring-primary/12",
81
- danger: "focus-within:ring-destructive/12",
82
- success: "focus-within:ring-success/12",
83
- warning: "focus-within:ring-warning/12"
84
- };
85
- var FORCED_RING_BY_COLOR = {
86
- default: "ring-ring/10",
87
- primary: "ring-primary/12",
88
- danger: "ring-destructive/12",
89
- success: "ring-success/12",
90
- warning: "ring-warning/12"
91
- };
92
78
  var FOCUS_BORDER_BY_COLOR = {
93
79
  default: "focus-within:border-foreground/50",
94
80
  primary: "focus-within:border-primary/60",
@@ -103,9 +89,19 @@ var FORCED_BORDER_BY_COLOR = {
103
89
  success: "border-success/60",
104
90
  warning: "border-warning/60"
105
91
  };
106
- /**
107
- * Resuelve las clases de wrapper (variante + halo + error) y el radius
108
- * para cualquier campo de formulario que siga el patrón Input/Textarea.
92
+ /**
93
+ * THE single focus indicator for the whole system. Every interactive component
94
+ * uses this exact ring so tabbing through a form/toolbar shows one consistent
95
+ * focus — a soft ring, no offset gap. `FIELD_FOCUS_RING` is the `focus-within`
96
+ * variant for field wrappers; `CONTROL_FOCUS_RING` is the `focus-visible`
97
+ * variant for buttons and other single-element controls.
98
+ */
99
+ var MODO_FOCUS_RING = "ring-2 ring-ring/60";
100
+ var FIELD_FOCUS_RING = "focus-within:ring-2 focus-within:ring-ring/60";
101
+ var CONTROL_FOCUS_RING = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60";
102
+ /**
103
+ * Resuelve las clases de wrapper (variante + halo + error) y el radius
104
+ * para cualquier campo de formulario que siga el patrón Input/Textarea.
109
105
  */
110
106
  function useFieldClasses(source) {
111
107
  const resolvedHalo = useResolvedHalo(() => {
@@ -119,21 +115,20 @@ function useFieldClasses(source) {
119
115
  const forceFocus = source.forceFocus ? toValue(source.forceFocus) : false;
120
116
  const halo = resolvedHalo.value;
121
117
  const errBorder = hasError ? "border-destructive" : "";
122
- const focusRing = halo === "neutral" ? "focus-within:ring-ring/12" : FOCUS_RING_BY_COLOR[stateColor];
123
118
  const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor];
124
- const forcedRing = forceFocus ? halo === "neutral" ? "ring-ring/12" : FORCED_RING_BY_COLOR[stateColor] : "";
125
119
  const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : "";
126
120
  const forcedBg = forceFocus ? "bg-background" : "";
127
121
  const idleRing = halo === "off" ? "" : "ring-4 ring-border/25";
128
- const focusRingUtil = halo === "off" ? "focus-within:ring-4 focus-within:ring-ring/15" : `focus-within:ring-4 ${focusRing}`;
129
- const forcedRingUtil = halo === "off" ? forceFocus ? "ring-4 ring-ring/15" : "" : forceFocus ? `ring-4 ${forcedRing}` : "";
122
+ const focusRingUtil = FIELD_FOCUS_RING;
123
+ const forcedRingUtil = forceFocus ? MODO_FOCUS_RING : "";
130
124
  switch (variant) {
131
125
  case "filled": return [
132
126
  "bg-muted border border-transparent",
133
127
  idleRing,
134
128
  "focus-within:bg-background",
129
+ focusBorder,
135
130
  focusRingUtil,
136
- forceFocus ? `${forcedRingUtil} ${forcedBg}` : forcedBg,
131
+ forceFocus ? `${forcedRingUtil} ${forcedBorder} ${forcedBg}` : forcedBg,
137
132
  errBorder
138
133
  ].join(" ");
139
134
  case "ghost": return [
@@ -145,8 +140,10 @@ function useFieldClasses(source) {
145
140
  default: return [
146
141
  "bg-background border border-input",
147
142
  idleRing,
143
+ focusBorder,
148
144
  focusRingUtil,
149
145
  forcedRingUtil,
146
+ forcedBorder,
150
147
  errBorder
151
148
  ].join(" ");
152
149
  }
@@ -157,13 +154,13 @@ function useFieldClasses(source) {
157
154
  case "none": return "rounded-none";
158
155
  case "small": return "rounded-sm";
159
156
  case "large": return "rounded-xl";
160
- case "full": return source.fullRadiusClass ?? "rounded-full";
157
+ case "full": return source.fullRadiusClass ?? "rounded-[999px]";
161
158
  default: return "rounded-md";
162
159
  }
163
160
  })
164
161
  };
165
162
  }
166
163
  //#endregion
167
- export { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, FORM_FIELD_ID_KEY, useFieldClasses, useFieldState };
164
+ export { CONTROL_FOCUS_RING, FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, FORM_FIELD_ID_KEY, useFieldClasses, useFieldState };
168
165
 
169
166
  //# sourceMappingURL=useField.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useField.mjs","names":[],"sources":["../../src/composables/useField.ts"],"sourcesContent":["import { computed, inject, useId, toValue, type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref } from 'vue';\nimport { useResolvedHalo } from './useModoConfig';\nimport type { ModoHalo } from '../config/ModoConfig';\nimport { useResolvedColor, useResolvedRadius } from './useModoConfig';\n\n/**\n * Injection key provided by FormField so child form controls can:\n * 1. Use the FormField's id as their own (connecting `<label for=\"...\">` automatically).\n * 2. Suppress the \"no label\" a11y warning — the FormField already renders a visible label.\n */\nexport const FORM_FIELD_ID_KEY: InjectionKey<Ref<string>> = Symbol('FormFieldId');\n \n/** \n * Props del campo de formulario que necesita `useFieldState`. \n * Se definen aquí para que cualquier componente (Input, Textarea, Password…) \n * pueda extenderlas y pasar su reactive `props` directamente. \n */ \nexport interface FieldStateSource { \n modelValue?: unknown; \n id?: string; \n label?: string; \n ariaLabel?: string; \n color?: 'default' | 'primary' | 'danger' | 'success' | 'warning'; \n radius?: 'none' | 'small' | 'medium' | 'large' | 'full'; \n errorText?: string; \n helperText?: string; \n /** Cuando es true, fuerza estado inválido sin renderizar errorText. Útil al envolver con FormField. */ \n invalid?: boolean; \n /** IDs adicionales para concatenar en aria-describedby (ej. provistos por un wrapper). */ \n ariaDescribedBy?: string; \n maxLength?: number; \n showCounter?: boolean; \n disabled?: boolean; \n loading?: boolean; \n} \n \nexport interface UseFieldStateOptions { \n /** Nombre del componente para el warning DEV. */ \n componentName: string; \n /** Prefijo para el id autogenerado (ej. 'modo-input'). */ \n idPrefix: string; \n} \n \n/** \n * Estado compartido entre campos de formulario (Input, Textarea, Password…). \n * \n * Resuelve: \n * - `fieldId` (prop.id o autogenerado). \n * - Color/radius resueltos desde el provider. \n * - `stateColor` (danger si hay error, si no el color resuelto). \n * - `describedBy` con los IDs de helper/error/counter. \n * - Contador y flags derivadas. \n * - Warning DEV cuando falta label/ariaLabel. \n */ \nexport function useFieldState(\n props: FieldStateSource,\n options: UseFieldStateOptions,\n) {\n const autoId = useId();\n // If a parent FormField provides its id, use it — this connects the FormField's\n // `<label for=\"...\">` to this input automatically without needing v-slot binding.\n const formFieldId = inject(FORM_FIELD_ID_KEY, null);\n const fieldId = computed(() => props.id ?? formFieldId?.value ?? `${options.idPrefix}-${autoId}`);\n \n const color = useResolvedColor(() => props.color); \n const radius = useResolvedRadius(() => props.radius); \n \n const hasError = computed(() => !!props.errorText || !!props.invalid); \n const isDisabled = computed(() => !!props.disabled || !!props.loading); \n \n const stateColor = computed(() => \n hasError.value ? 'danger' : color.value, \n ) as ComputedRef<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n \n const hasValue = computed(() => { \n const v = props.modelValue; \n return v !== null && v !== undefined && String(v).length > 0; \n }); \n \n const currentLength = computed(() => String(props.modelValue ?? '').length); \n const showCounterEffective = computed( \n () => !!props.showCounter && !!props.maxLength, \n ); \n const counterOverflow = computed( \n () => !!props.maxLength && currentLength.value >= props.maxLength, \n ); \n \n const errorId = computed(() => `${fieldId.value}-error`); \n const helperId = computed(() => `${fieldId.value}-helper`); \n const counterId = computed(() => `${fieldId.value}-counter`); \n \n const describedBy = computed(() => { \n const ids: string[] = []; \n if (hasError.value && props.errorText) ids.push(errorId.value); \n else if (props.helperText) ids.push(helperId.value); \n if (showCounterEffective.value) ids.push(counterId.value); \n if (props.ariaDescribedBy) ids.push(props.ariaDescribedBy); \n return ids.length ? ids.join(' ') : undefined; \n }); \n \n // Warn only when there is genuinely no accessible label: no label/ariaLabel prop\n // AND no parent FormField providing one (detected via injection key).\n if (import.meta.env.DEV && !props.label && !props.ariaLabel && !props.id && !formFieldId) {\n console.warn(\n `[mood-ui ${options.componentName}] Se requiere \\`label\\` o \\`ariaLabel\\` para accesibilidad.`,\n );\n }\n \n return { \n fieldId, \n color, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n }; \n} \n \nexport type FieldVariant = 'outline' | 'filled' | 'ghost'; \n \nexport interface UseFieldClassesSource { \n variant: MaybeRefOrGetter<FieldVariant>; \n stateColor: MaybeRefOrGetter<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n hasError: MaybeRefOrGetter<boolean>; \n radius: MaybeRefOrGetter<'none' | 'small' | 'medium' | 'large' | 'full'>; \n /** radius utility para 'full' (Input usa 'full', Textarea usa '2xl'). */ \n fullRadiusClass?: string; \n /** \n * Cuando es true, fuerza los estilos de focus (halo + borde) aunque \n * el foco esté fuera del wrapper. Útil para Select/Combobox cuando \n * el popover teleportado roba el foco pero el campo sigue \"activo\". \n */ \n forceFocus?: MaybeRefOrGetter<boolean>; \n /** \n * Estilo del halo del campo. Si no se pasa, se usa el valor resuelto \n * vía ModoProvider/useResolvedHalo. \n * - `'tinted'`: tintado al color (default) \n * - `'neutral'`: siempre gris \n * - `'off'`: sin halo persistente (solo focus-visible ring a11y) \n */ \n halo?: MaybeRefOrGetter<ModoHalo | undefined>; \n} \n\nexport const FIELD_AFFORDANCE_ICON_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-icon',\n primary: 'modo-affordance-icon',\n danger: 'text-destructive/85',\n success: 'modo-affordance-icon',\n warning: 'modo-affordance-icon',\n};\n\nexport const FIELD_AFFORDANCE_ACTION_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-action',\n primary: 'modo-affordance-action',\n danger: 'text-destructive/80 hover:text-destructive',\n success: 'modo-affordance-action',\n warning: 'modo-affordance-action',\n};\n \nconst FOCUS_RING_BY_COLOR: Record<string, string> = { \n default: 'focus-within:ring-ring/10', \n primary: 'focus-within:ring-primary/12', \n danger: 'focus-within:ring-destructive/12', \n success: 'focus-within:ring-success/12', \n warning: 'focus-within:ring-warning/12', \n}; \n \nconst FORCED_RING_BY_COLOR: Record<string, string> = { \n default: 'ring-ring/10', \n primary: 'ring-primary/12', \n danger: 'ring-destructive/12', \n success: 'ring-success/12', \n warning: 'ring-warning/12', \n}; \n \nconst FOCUS_BORDER_BY_COLOR: Record<string, string> = { \n default: 'focus-within:border-foreground/50', \n primary: 'focus-within:border-primary/60', \n danger: 'focus-within:border-destructive/60', \n success: 'focus-within:border-success/60', \n warning: 'focus-within:border-warning/60', \n}; \n \nconst FORCED_BORDER_BY_COLOR: Record<string, string> = { \n default: 'border-foreground/50', \n primary: 'border-primary/60', \n danger: 'border-destructive/60', \n success: 'border-success/60', \n warning: 'border-warning/60', \n}; \n \n/** \n * Resuelve las clases de wrapper (variante + halo + error) y el radius \n * para cualquier campo de formulario que siga el patrón Input/Textarea. \n */ \nexport function useFieldClasses(source: UseFieldClassesSource) { \n const resolvedHalo = useResolvedHalo(() => { \n const local = source.halo ? toValue(source.halo) : undefined; \n return local; \n }); \n \n const wrapperVariantClasses = computed(() => { \n const variant = toValue(source.variant); \n const stateColor = toValue(source.stateColor); \n const hasError = toValue(source.hasError); \n const forceFocus = source.forceFocus ? toValue(source.forceFocus) : false; \n const halo = resolvedHalo.value; \n const errBorder = hasError ? 'border-destructive' : ''; \n // En modo `neutral` el focus también queda gris; en `tinted` toma color. \n const focusRing = halo === 'neutral' ? 'focus-within:ring-ring/12' : FOCUS_RING_BY_COLOR[stateColor]; \n const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor]; \n const forcedRing = forceFocus \n ? (halo === 'neutral' ? 'ring-ring/12' : FORCED_RING_BY_COLOR[stateColor]) \n : ''; \n const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : ''; \n const forcedBg = forceFocus ? 'bg-background' : ''; \n \n // Halo persistente (ring idle) — se omite cuando halo === 'off'. \n // En 'off' aparece solo en focus-within, neutro (no tintado al color). \n const idleRing = halo === 'off' ? '' : 'ring-4 ring-border/25'; \n const offFocusRingUtil = 'focus-within:ring-4 focus-within:ring-ring/15'; \n const focusRingUtil = halo === 'off' ? offFocusRingUtil : `focus-within:ring-4 ${focusRing}`; \n const offForcedRing = 'ring-4 ring-ring/15'; \n const forcedRingUtil = halo === 'off' \n ? (forceFocus ? offForcedRing : '') \n : (forceFocus ? `ring-4 ${forcedRing}` : ''); \n \n switch (variant) { \n case 'filled': \n return [ \n 'bg-muted border border-transparent', \n idleRing, \n 'focus-within:bg-background', \n focusRingUtil, \n forceFocus ? `${forcedRingUtil} ${forcedBg}` : forcedBg, \n errBorder, \n ].join(' '); \n case 'ghost': \n return [ \n 'bg-transparent border-b border-border rounded-none', \n focusBorder, \n forcedBorder, \n hasError ? 'border-destructive' : '', \n ].join(' '); \n case 'outline': \n default: \n return [ \n 'bg-background border border-input', \n idleRing, \n focusRingUtil, \n forcedRingUtil, \n errBorder, \n ].join(' '); \n } \n }); \n \n const radiusClasses = computed(() => { \n const variant = toValue(source.variant); \n if (variant === 'ghost') return ''; \n const radius = toValue(source.radius); \n switch (radius) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n case 'full': return source.fullRadiusClass ?? 'rounded-full'; \n case 'medium': \n default: return 'rounded-md'; \n } \n }); \n \n return { wrapperVariantClasses, radiusClasses }; \n}\n"],"mappings":";;;;;;;;AAUA,IAAa,oBAA+C,OAAO,cAAc;;;;;;;;;;;;AA4CjF,SAAgB,cACZ,OACA,SACF;CACE,MAAM,SAAS,OAAO;CAGtB,MAAM,cAAc,OAAO,mBAAmB,KAAK;CACnD,MAAM,UAAU,eAAe,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ,SAAS,GAAG,SAAS;CAEjG,MAAM,QAAQ,uBAAuB,MAAM,MAAM;CACjD,MAAM,SAAS,wBAAwB,MAAM,OAAO;CAEpD,MAAM,WAAW,eAAe,CAAC,CAAC,MAAM,aAAa,CAAC,CAAC,MAAM,QAAQ;CACrE,MAAM,aAAa,eAAe,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,MAAM,QAAQ;CAEtE,MAAM,aAAa,eACf,SAAS,QAAQ,WAAW,MAAM,MACrC;CAED,MAAM,WAAW,eAAe;EAC5B,MAAM,IAAI,MAAM;EAChB,OAAO,MAAM,QAAQ,MAAM,KAAA,KAAa,OAAO,EAAE,CAAC,SAAS;GAC7D;CAEF,MAAM,gBAAgB,eAAe,OAAO,MAAM,cAAc,GAAG,CAAC,OAAO;CAC3E,MAAM,uBAAuB,eACnB,CAAC,CAAC,MAAM,eAAe,CAAC,CAAC,MAAM,UACxC;CACD,MAAM,kBAAkB,eACd,CAAC,CAAC,MAAM,aAAa,cAAc,SAAS,MAAM,UAC3D;CAED,MAAM,UAAU,eAAe,GAAG,QAAQ,MAAM,QAAQ;CACxD,MAAM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,WAAW,QAAQ,OAAO,SAAS;GACzC,MAAM,aAAa,OAAO,aAAa,QAAQ,OAAO,WAAW,GAAG;GACpE,MAAM,OAAO,aAAa;GAC1B,MAAM,YAAY,WAAW,uBAAuB;GAEpD,MAAM,YAAY,SAAS,YAAY,8BAA8B,oBAAoB;GACzF,MAAM,cAAc,sBAAsB;GAC1C,MAAM,aAAa,aACZ,SAAS,YAAY,iBAAiB,qBAAqB,cAC5D;GACN,MAAM,eAAe,aAAa,uBAAuB,cAAc;GACvE,MAAM,WAAW,aAAa,kBAAkB;GAIhD,MAAM,WAAW,SAAS,QAAQ,KAAK;GAEvC,MAAM,gBAAgB,SAAS,QAAQ,kDAAmB,uBAAuB;GAEjF,MAAM,iBAAiB,SAAS,QACzB,aAAa,wBAAgB,KAC7B,aAAa,UAAU,eAAe;GAE7C,QAAQ,SAAR;IACI,KAAK,UACD,OAAO;KACH;KACA;KACA;KACA;KACA,aAAa,GAAG,eAAe,GAAG,aAAa;KAC/C;KACH,CAAC,KAAK,IAAI;IACf,KAAK,SACD,OAAO;KACH;KACA;KACA;KACA,WAAW,uBAAuB;KACrC,CAAC,KAAK,IAAI;IAEf,SACI,OAAO;KACH;KACA;KACA;KACA;KACA;KACH,CAAC,KAAK,IAAI;;IAkBd;EAAuB,eAdV,eAAe;GAEjC,IADgB,QAAQ,OAAO,QAC3B,KAAY,SAAS,OAAO;GAEhC,QADe,QAAQ,OAAO,OACtB,EAAR;IACI,KAAK,QAAQ,OAAO;IACpB,KAAK,SAAS,OAAO;IACrB,KAAK,SAAS,OAAO;IACrB,KAAK,QAAQ,OAAO,OAAO,mBAAmB;IAE9C,SAAS,OAAO;;IAIQ;EAAe"}
1
+ {"version":3,"file":"useField.mjs","names":[],"sources":["../../src/composables/useField.ts"],"sourcesContent":["import { computed, inject, useId, toValue, type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref } from 'vue';\nimport { useResolvedHalo } from './useModoConfig';\nimport type { ModoHalo } from '../config/ModoConfig';\nimport { useResolvedColor, useResolvedRadius } from './useModoConfig';\n\n/**\n * Injection key provided by FormField so child form controls can:\n * 1. Use the FormField's id as their own (connecting `<label for=\"...\">` automatically).\n * 2. Suppress the \"no label\" a11y warning — the FormField already renders a visible label.\n */\nexport const FORM_FIELD_ID_KEY: InjectionKey<Ref<string>> = Symbol('FormFieldId');\n \n/** \n * Props del campo de formulario que necesita `useFieldState`. \n * Se definen aquí para que cualquier componente (Input, Textarea, Password…) \n * pueda extenderlas y pasar su reactive `props` directamente. \n */ \nexport interface FieldStateSource { \n modelValue?: unknown; \n id?: string; \n label?: string; \n ariaLabel?: string; \n color?: 'default' | 'primary' | 'danger' | 'success' | 'warning'; \n radius?: 'none' | 'small' | 'medium' | 'large' | 'full'; \n errorText?: string; \n helperText?: string; \n /** Cuando es true, fuerza estado inválido sin renderizar errorText. Útil al envolver con FormField. */ \n invalid?: boolean; \n /** IDs adicionales para concatenar en aria-describedby (ej. provistos por un wrapper). */ \n ariaDescribedBy?: string; \n maxLength?: number; \n showCounter?: boolean; \n disabled?: boolean; \n loading?: boolean; \n} \n \nexport interface UseFieldStateOptions { \n /** Nombre del componente para el warning DEV. */ \n componentName: string; \n /** Prefijo para el id autogenerado (ej. 'modo-input'). */ \n idPrefix: string; \n} \n \n/** \n * Estado compartido entre campos de formulario (Input, Textarea, Password…). \n * \n * Resuelve: \n * - `fieldId` (prop.id o autogenerado). \n * - Color/radius resueltos desde el provider. \n * - `stateColor` (danger si hay error, si no el color resuelto). \n * - `describedBy` con los IDs de helper/error/counter. \n * - Contador y flags derivadas. \n * - Warning DEV cuando falta label/ariaLabel. \n */ \nexport function useFieldState(\n props: FieldStateSource,\n options: UseFieldStateOptions,\n) {\n const autoId = useId();\n // If a parent FormField provides its id, use it — this connects the FormField's\n // `<label for=\"...\">` to this input automatically without needing v-slot binding.\n const formFieldId = inject(FORM_FIELD_ID_KEY, null);\n const fieldId = computed(() => props.id ?? formFieldId?.value ?? `${options.idPrefix}-${autoId}`);\n \n const color = useResolvedColor(() => props.color); \n const radius = useResolvedRadius(() => props.radius); \n \n const hasError = computed(() => !!props.errorText || !!props.invalid); \n const isDisabled = computed(() => !!props.disabled || !!props.loading); \n \n const stateColor = computed(() => \n hasError.value ? 'danger' : color.value, \n ) as ComputedRef<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n \n const hasValue = computed(() => { \n const v = props.modelValue; \n return v !== null && v !== undefined && String(v).length > 0; \n }); \n \n const currentLength = computed(() => String(props.modelValue ?? '').length); \n const showCounterEffective = computed( \n () => !!props.showCounter && !!props.maxLength, \n ); \n const counterOverflow = computed( \n () => !!props.maxLength && currentLength.value >= props.maxLength, \n ); \n \n const errorId = computed(() => `${fieldId.value}-error`); \n const helperId = computed(() => `${fieldId.value}-helper`); \n const counterId = computed(() => `${fieldId.value}-counter`); \n \n const describedBy = computed(() => { \n const ids: string[] = []; \n if (hasError.value && props.errorText) ids.push(errorId.value); \n else if (props.helperText) ids.push(helperId.value); \n if (showCounterEffective.value) ids.push(counterId.value); \n if (props.ariaDescribedBy) ids.push(props.ariaDescribedBy); \n return ids.length ? ids.join(' ') : undefined; \n }); \n \n // Warn only when there is genuinely no accessible label: no label/ariaLabel prop\n // AND no parent FormField providing one (detected via injection key).\n if (import.meta.env.DEV && !props.label && !props.ariaLabel && !props.id && !formFieldId) {\n console.warn(\n `[mood-ui ${options.componentName}] Se requiere \\`label\\` o \\`ariaLabel\\` para accesibilidad.`,\n );\n }\n \n return { \n fieldId, \n color, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n }; \n} \n \nexport type FieldVariant = 'outline' | 'filled' | 'ghost'; \n \nexport interface UseFieldClassesSource { \n variant: MaybeRefOrGetter<FieldVariant>; \n stateColor: MaybeRefOrGetter<'default' | 'primary' | 'danger' | 'success' | 'warning'>; \n hasError: MaybeRefOrGetter<boolean>; \n radius: MaybeRefOrGetter<'none' | 'small' | 'medium' | 'large' | 'full'>; \n /** radius utility para 'full' (Input usa 'full', Textarea usa '2xl'). */ \n fullRadiusClass?: string; \n /** \n * Cuando es true, fuerza los estilos de focus (halo + borde) aunque \n * el foco esté fuera del wrapper. Útil para Select/Combobox cuando \n * el popover teleportado roba el foco pero el campo sigue \"activo\". \n */ \n forceFocus?: MaybeRefOrGetter<boolean>; \n /** \n * Estilo del halo del campo. Si no se pasa, se usa el valor resuelto \n * vía ModoProvider/useResolvedHalo. \n * - `'tinted'`: tintado al color (default) \n * - `'neutral'`: siempre gris \n * - `'off'`: sin halo persistente (solo focus-visible ring a11y) \n */ \n halo?: MaybeRefOrGetter<ModoHalo | undefined>; \n} \n\nexport const FIELD_AFFORDANCE_ICON_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-icon',\n primary: 'modo-affordance-icon',\n danger: 'text-destructive/85',\n success: 'modo-affordance-icon',\n warning: 'modo-affordance-icon',\n};\n\nexport const FIELD_AFFORDANCE_ACTION_BY_COLOR: Record<string, string> = {\n default: 'modo-affordance-action',\n primary: 'modo-affordance-action',\n danger: 'text-destructive/80 hover:text-destructive',\n success: 'modo-affordance-action',\n warning: 'modo-affordance-action',\n};\n \nconst FOCUS_BORDER_BY_COLOR: Record<string, string> = { \n default: 'focus-within:border-foreground/50', \n primary: 'focus-within:border-primary/60', \n danger: 'focus-within:border-destructive/60', \n success: 'focus-within:border-success/60', \n warning: 'focus-within:border-warning/60', \n}; \n \nconst FORCED_BORDER_BY_COLOR: Record<string, string> = { \n default: 'border-foreground/50', \n primary: 'border-primary/60', \n danger: 'border-destructive/60', \n success: 'border-success/60', \n warning: 'border-warning/60', \n}; \n \n/**\n * THE single focus indicator for the whole system. Every interactive component\n * uses this exact ring so tabbing through a form/toolbar shows one consistent\n * focus — a soft ring, no offset gap. `FIELD_FOCUS_RING` is the `focus-within`\n * variant for field wrappers; `CONTROL_FOCUS_RING` is the `focus-visible`\n * variant for buttons and other single-element controls.\n */\nexport const MODO_FOCUS_RING = 'ring-2 ring-ring/60';\nexport const FIELD_FOCUS_RING = 'focus-within:ring-2 focus-within:ring-ring/60';\nexport const CONTROL_FOCUS_RING =\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60';\n\n/**\n * Resuelve las clases de wrapper (variante + halo + error) y el radius\n * para cualquier campo de formulario que siga el patrón Input/Textarea.\n */\nexport function useFieldClasses(source: UseFieldClassesSource) {\n const resolvedHalo = useResolvedHalo(() => { \n const local = source.halo ? toValue(source.halo) : undefined; \n return local; \n }); \n \n const wrapperVariantClasses = computed(() => {\n const variant = toValue(source.variant);\n const stateColor = toValue(source.stateColor);\n const hasError = toValue(source.hasError);\n const forceFocus = source.forceFocus ? toValue(source.forceFocus) : false;\n const halo = resolvedHalo.value;\n const errBorder = hasError ? 'border-destructive' : '';\n const focusBorder = FOCUS_BORDER_BY_COLOR[stateColor];\n const forcedBorder = forceFocus ? FORCED_BORDER_BY_COLOR[stateColor] : '';\n const forcedBg = forceFocus ? 'bg-background' : '';\n\n // The persistent halo (idle ring) is opt-in via `neutral`/`tinted`.\n // The FOCUS ring is the SAME everywhere (see MODO_FOCUS_RING) so a field\n // and a button show an identical indicator when you tab to them.\n const idleRing = halo === 'off' ? '' : 'ring-4 ring-border/25';\n const focusRingUtil = FIELD_FOCUS_RING;\n const forcedRingUtil = forceFocus ? MODO_FOCUS_RING : '';\n\n switch (variant) {\n case 'filled':\n return [\n 'bg-muted border border-transparent',\n idleRing,\n 'focus-within:bg-background',\n focusBorder,\n focusRingUtil,\n forceFocus ? `${forcedRingUtil} ${forcedBorder} ${forcedBg}` : forcedBg,\n errBorder,\n ].join(' ');\n case 'ghost':\n return [\n 'bg-transparent border-b border-border rounded-none',\n focusBorder,\n forcedBorder,\n hasError ? 'border-destructive' : '',\n ].join(' ');\n case 'outline':\n default:\n return [\n 'bg-background border border-input',\n idleRing,\n focusBorder,\n focusRingUtil,\n forcedRingUtil,\n forcedBorder,\n errBorder,\n ].join(' ');\n }\n });\n \n const radiusClasses = computed(() => { \n const variant = toValue(source.variant); \n if (variant === 'ghost') return ''; \n const radius = toValue(source.radius); \n switch (radius) { \n case 'none': return 'rounded-none'; \n case 'small': return 'rounded-sm'; \n case 'large': return 'rounded-xl'; \n // `rounded-full` compiles to an effectively-infinite radius which\n // Chrome clamps differently for box-shadows than for the border,\n // making any ring render boxy corners. A large *finite* radius is a\n // visually-identical pill that shadows follow correctly.\n case 'full': return source.fullRadiusClass ?? 'rounded-[999px]';\n case 'medium': \n default: return 'rounded-md'; \n } \n }); \n \n return { wrapperVariantClasses, radiusClasses }; \n}\n"],"mappings":";;;;;;;;AAUA,IAAa,oBAA+C,OAAO,cAAc;;;;;;;;;;;;AA4CjF,SAAgB,cACZ,OACA,SACF;CACE,MAAM,SAAS,OAAO;CAGtB,MAAM,cAAc,OAAO,mBAAmB,KAAK;CACnD,MAAM,UAAU,eAAe,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ,SAAS,GAAG,SAAS;CAEjG,MAAM,QAAQ,uBAAuB,MAAM,MAAM;CACjD,MAAM,SAAS,wBAAwB,MAAM,OAAO;CAEpD,MAAM,WAAW,eAAe,CAAC,CAAC,MAAM,aAAa,CAAC,CAAC,MAAM,QAAQ;CACrE,MAAM,aAAa,eAAe,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,MAAM,QAAQ;CAEtE,MAAM,aAAa,eACf,SAAS,QAAQ,WAAW,MAAM,MACrC;CAED,MAAM,WAAW,eAAe;EAC5B,MAAM,IAAI,MAAM;EAChB,OAAO,MAAM,QAAQ,MAAM,KAAA,KAAa,OAAO,EAAE,CAAC,SAAS;GAC7D;CAEF,MAAM,gBAAgB,eAAe,OAAO,MAAM,cAAc,GAAG,CAAC,OAAO;CAC3E,MAAM,uBAAuB,eACnB,CAAC,CAAC,MAAM,eAAe,CAAC,CAAC,MAAM,UACxC;CACD,MAAM,kBAAkB,eACd,CAAC,CAAC,MAAM,aAAa,cAAc,SAAS,MAAM,UAC3D;CAED,MAA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