frontile 0.18.0-beta.2 → 0.18.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (518) hide show
  1. package/declarations/-private/control-blur.d.ts +1 -0
  2. package/declarations/-private/control-blur.d.ts.map +1 -0
  3. package/declarations/-private/deprecated-args.d.ts +1 -0
  4. package/declarations/-private/deprecated-args.d.ts.map +1 -0
  5. package/declarations/-private/dialog.d.ts +1 -0
  6. package/declarations/-private/dialog.d.ts.map +1 -0
  7. package/declarations/-private/dom.d.ts +1 -0
  8. package/declarations/-private/dom.d.ts.map +1 -0
  9. package/declarations/-private/get-config.d.ts +1 -0
  10. package/declarations/-private/get-config.d.ts.map +1 -0
  11. package/declarations/-private/icons.d.ts +23 -0
  12. package/declarations/-private/icons.d.ts.map +1 -0
  13. package/declarations/-private/manager.d.ts +1 -0
  14. package/declarations/-private/manager.d.ts.map +1 -0
  15. package/declarations/-private/notification-stack.d.ts +1 -0
  16. package/declarations/-private/notification-stack.d.ts.map +1 -0
  17. package/declarations/-private/notification.d.ts +1 -0
  18. package/declarations/-private/notification.d.ts.map +1 -0
  19. package/declarations/-private/timer.d.ts +1 -0
  20. package/declarations/-private/timer.d.ts.map +1 -0
  21. package/declarations/-private/types.d.ts +1 -0
  22. package/declarations/-private/types.d.ts.map +1 -0
  23. package/declarations/buttons.d.ts +1 -0
  24. package/declarations/buttons.d.ts.map +1 -0
  25. package/declarations/collections.d.ts +1 -0
  26. package/declarations/collections.d.ts.map +1 -0
  27. package/declarations/components/buttons/button-group.d.ts +1 -0
  28. package/declarations/components/buttons/button-group.d.ts.map +1 -0
  29. package/declarations/components/buttons/button.d.ts +1 -0
  30. package/declarations/components/buttons/button.d.ts.map +1 -0
  31. package/declarations/components/buttons/chip.d.ts +1 -0
  32. package/declarations/components/buttons/chip.d.ts.map +1 -0
  33. package/declarations/components/buttons/close-button.d.ts +1 -0
  34. package/declarations/components/buttons/close-button.d.ts.map +1 -0
  35. package/declarations/components/buttons/index.d.ts +1 -0
  36. package/declarations/components/buttons/index.d.ts.map +1 -0
  37. package/declarations/components/buttons/segmented-control/item.d.ts +1 -0
  38. package/declarations/components/buttons/segmented-control/item.d.ts.map +1 -0
  39. package/declarations/components/buttons/segmented-control/segmented-control.d.ts +12 -1
  40. package/declarations/components/buttons/segmented-control/segmented-control.d.ts.map +1 -0
  41. package/declarations/components/buttons/segmented-control.d.ts +1 -0
  42. package/declarations/components/buttons/segmented-control.d.ts.map +1 -0
  43. package/declarations/components/buttons/toggle-button.d.ts +1 -0
  44. package/declarations/components/buttons/toggle-button.d.ts.map +1 -0
  45. package/declarations/components/collections/calendar/calendar.d.ts +9 -12
  46. package/declarations/components/collections/calendar/calendar.d.ts.map +1 -0
  47. package/declarations/components/collections/calendar/day-cell.d.ts +1 -0
  48. package/declarations/components/collections/calendar/day-cell.d.ts.map +1 -0
  49. package/declarations/components/collections/calendar/header.d.ts +1 -0
  50. package/declarations/components/collections/calendar/header.d.ts.map +1 -0
  51. package/declarations/components/collections/calendar/month-grid.d.ts +1 -0
  52. package/declarations/components/collections/calendar/month-grid.d.ts.map +1 -0
  53. package/declarations/components/collections/calendar/types.d.ts +1 -0
  54. package/declarations/components/collections/calendar/types.d.ts.map +1 -0
  55. package/declarations/components/collections/calendar/utils.d.ts +1 -0
  56. package/declarations/components/collections/calendar/utils.d.ts.map +1 -0
  57. package/declarations/components/collections/calendar/year-grid.d.ts +1 -0
  58. package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -0
  59. package/declarations/components/collections/calendar.d.ts +1 -0
  60. package/declarations/components/collections/calendar.d.ts.map +1 -0
  61. package/declarations/components/collections/command/command.d.ts +2 -11
  62. package/declarations/components/collections/command/command.d.ts.map +1 -0
  63. package/declarations/components/collections/command/dialog.d.ts +1 -0
  64. package/declarations/components/collections/command/dialog.d.ts.map +1 -0
  65. package/declarations/components/collections/command/footer.d.ts +1 -0
  66. package/declarations/components/collections/command/footer.d.ts.map +1 -0
  67. package/declarations/components/collections/command/index.d.ts +1 -0
  68. package/declarations/components/collections/command/index.d.ts.map +1 -0
  69. package/declarations/components/collections/command/input.d.ts +7 -1
  70. package/declarations/components/collections/command/input.d.ts.map +1 -0
  71. package/declarations/components/collections/command/list.d.ts +4 -0
  72. package/declarations/components/collections/command/list.d.ts.map +1 -0
  73. package/declarations/components/collections/command.d.ts +1 -0
  74. package/declarations/components/collections/command.d.ts.map +1 -0
  75. package/declarations/components/collections/dropdown/dropdown.d.ts +61 -2
  76. package/declarations/components/collections/dropdown/dropdown.d.ts.map +1 -0
  77. package/declarations/components/collections/dropdown/menu-context.d.ts +34 -7
  78. package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -0
  79. package/declarations/components/collections/dropdown/sub.d.ts +4 -8
  80. package/declarations/components/collections/dropdown/sub.d.ts.map +1 -0
  81. package/declarations/components/collections/dropdown.d.ts +1 -0
  82. package/declarations/components/collections/dropdown.d.ts.map +1 -0
  83. package/declarations/components/collections/index.d.ts +1 -0
  84. package/declarations/components/collections/index.d.ts.map +1 -0
  85. package/declarations/components/collections/listbox/group.d.ts +1 -0
  86. package/declarations/components/collections/listbox/group.d.ts.map +1 -0
  87. package/declarations/components/collections/listbox/item.d.ts +22 -1
  88. package/declarations/components/collections/listbox/item.d.ts.map +1 -0
  89. package/declarations/components/collections/listbox/listbox.d.ts +1 -0
  90. package/declarations/components/collections/listbox/listbox.d.ts.map +1 -0
  91. package/declarations/components/collections/listbox.d.ts +1 -0
  92. package/declarations/components/collections/listbox.d.ts.map +1 -0
  93. package/declarations/components/collections/simple-table/body.d.ts +50 -35
  94. package/declarations/components/collections/simple-table/body.d.ts.map +1 -0
  95. package/declarations/components/collections/simple-table/cell.d.ts +50 -35
  96. package/declarations/components/collections/simple-table/cell.d.ts.map +1 -0
  97. package/declarations/components/collections/simple-table/column.d.ts +50 -35
  98. package/declarations/components/collections/simple-table/column.d.ts.map +1 -0
  99. package/declarations/components/collections/simple-table/footer.d.ts +50 -35
  100. package/declarations/components/collections/simple-table/footer.d.ts.map +1 -0
  101. package/declarations/components/collections/simple-table/header.d.ts +50 -35
  102. package/declarations/components/collections/simple-table/header.d.ts.map +1 -0
  103. package/declarations/components/collections/simple-table/index.d.ts +50 -35
  104. package/declarations/components/collections/simple-table/index.d.ts.map +1 -0
  105. package/declarations/components/collections/simple-table/row.d.ts +50 -35
  106. package/declarations/components/collections/simple-table/row.d.ts.map +1 -0
  107. package/declarations/components/collections/table/cell-default.d.ts +1 -0
  108. package/declarations/components/collections/table/cell-default.d.ts.map +1 -0
  109. package/declarations/components/collections/table/cell-for.d.ts +1 -0
  110. package/declarations/components/collections/table/cell-for.d.ts.map +1 -0
  111. package/declarations/components/collections/table/cell-rendering-context.d.ts +1 -0
  112. package/declarations/components/collections/table/cell-rendering-context.d.ts.map +1 -0
  113. package/declarations/components/collections/table/checkbox.d.ts +6 -1
  114. package/declarations/components/collections/table/checkbox.d.ts.map +1 -0
  115. package/declarations/components/collections/table/column-visibility.d.ts +51 -36
  116. package/declarations/components/collections/table/column-visibility.d.ts.map +1 -0
  117. package/declarations/components/collections/table/index.d.ts +1 -0
  118. package/declarations/components/collections/table/index.d.ts.map +1 -0
  119. package/declarations/components/collections/table/sort-button.d.ts +50 -35
  120. package/declarations/components/collections/table/sort-button.d.ts.map +1 -0
  121. package/declarations/components/collections/table/table.d.ts +50 -35
  122. package/declarations/components/collections/table/table.d.ts.map +1 -0
  123. package/declarations/components/collections/table/types.d.ts +1 -0
  124. package/declarations/components/collections/table/types.d.ts.map +1 -0
  125. package/declarations/components/collections/table/utils.d.ts +1 -0
  126. package/declarations/components/collections/table/utils.d.ts.map +1 -0
  127. package/declarations/components/collections/table.d.ts +1 -0
  128. package/declarations/components/collections/table.d.ts.map +1 -0
  129. package/declarations/components/disclosure/accordion/accordion.d.ts +8 -1
  130. package/declarations/components/disclosure/accordion/accordion.d.ts.map +1 -0
  131. package/declarations/components/disclosure/accordion/item.d.ts +1 -0
  132. package/declarations/components/disclosure/accordion/item.d.ts.map +1 -0
  133. package/declarations/components/disclosure/accordion.d.ts +1 -0
  134. package/declarations/components/disclosure/accordion.d.ts.map +1 -0
  135. package/declarations/components/disclosure/index.d.ts +1 -0
  136. package/declarations/components/disclosure/index.d.ts.map +1 -0
  137. package/declarations/components/forms/autocomplete.d.ts +13 -23
  138. package/declarations/components/forms/autocomplete.d.ts.map +1 -0
  139. package/declarations/components/forms/checkbox-group.d.ts +8 -1
  140. package/declarations/components/forms/checkbox-group.d.ts.map +1 -0
  141. package/declarations/components/forms/checkbox.d.ts +6 -1
  142. package/declarations/components/forms/checkbox.d.ts.map +1 -0
  143. package/declarations/components/forms/date-picker/date-picker.d.ts +13 -23
  144. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -0
  145. package/declarations/components/forms/date-picker/end-content.d.ts +1 -0
  146. package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -0
  147. package/declarations/components/forms/date-picker/trigger.d.ts +1 -0
  148. package/declarations/components/forms/date-picker/trigger.d.ts.map +1 -0
  149. package/declarations/components/forms/date-picker/types.d.ts +1 -0
  150. package/declarations/components/forms/date-picker/types.d.ts.map +1 -0
  151. package/declarations/components/forms/date-picker/value.d.ts +1 -0
  152. package/declarations/components/forms/date-picker/value.d.ts.map +1 -0
  153. package/declarations/components/forms/date-picker.d.ts +1 -0
  154. package/declarations/components/forms/date-picker.d.ts.map +1 -0
  155. package/declarations/components/forms/field-types.d.ts +2 -1
  156. package/declarations/components/forms/field-types.d.ts.map +1 -0
  157. package/declarations/components/forms/field.d.ts +1 -0
  158. package/declarations/components/forms/field.d.ts.map +1 -0
  159. package/declarations/components/forms/form-control.d.ts +1 -0
  160. package/declarations/components/forms/form-control.d.ts.map +1 -0
  161. package/declarations/components/forms/form-description.d.ts +1 -0
  162. package/declarations/components/forms/form-description.d.ts.map +1 -0
  163. package/declarations/components/forms/form-feedback.d.ts +1 -0
  164. package/declarations/components/forms/form-feedback.d.ts.map +1 -0
  165. package/declarations/components/forms/form.d.ts +2 -11
  166. package/declarations/components/forms/form.d.ts.map +1 -0
  167. package/declarations/components/forms/index.d.ts +1 -0
  168. package/declarations/components/forms/index.d.ts.map +1 -0
  169. package/declarations/components/forms/input-otp.d.ts +10 -12
  170. package/declarations/components/forms/input-otp.d.ts.map +1 -0
  171. package/declarations/components/forms/input.d.ts +12 -12
  172. package/declarations/components/forms/input.d.ts.map +1 -0
  173. package/declarations/components/forms/label.d.ts +6 -1
  174. package/declarations/components/forms/label.d.ts.map +1 -0
  175. package/declarations/components/forms/native-select.d.ts +11 -1
  176. package/declarations/components/forms/native-select.d.ts.map +1 -0
  177. package/declarations/components/forms/radio-group.d.ts +8 -1
  178. package/declarations/components/forms/radio-group.d.ts.map +1 -0
  179. package/declarations/components/forms/radio.d.ts +6 -1
  180. package/declarations/components/forms/radio.d.ts.map +1 -0
  181. package/declarations/components/forms/select/end-content.d.ts +1 -0
  182. package/declarations/components/forms/select/end-content.d.ts.map +1 -0
  183. package/declarations/components/forms/select/native-mirror.d.ts +1 -0
  184. package/declarations/components/forms/select/native-mirror.d.ts.map +1 -0
  185. package/declarations/components/forms/select/select.d.ts +15 -34
  186. package/declarations/components/forms/select/select.d.ts.map +1 -0
  187. package/declarations/components/forms/select/selected-items.d.ts +1 -0
  188. package/declarations/components/forms/select/selected-items.d.ts.map +1 -0
  189. package/declarations/components/forms/select/trigger.d.ts +1 -0
  190. package/declarations/components/forms/select/trigger.d.ts.map +1 -0
  191. package/declarations/components/forms/select/types.d.ts +1 -0
  192. package/declarations/components/forms/select/types.d.ts.map +1 -0
  193. package/declarations/components/forms/select.d.ts +1 -0
  194. package/declarations/components/forms/select.d.ts.map +1 -0
  195. package/declarations/components/forms/switch.d.ts +8 -1
  196. package/declarations/components/forms/switch.d.ts.map +1 -0
  197. package/declarations/components/forms/textarea.d.ts +11 -1
  198. package/declarations/components/forms/textarea.d.ts.map +1 -0
  199. package/declarations/components/navigation/external-link.d.ts +2 -1
  200. package/declarations/components/navigation/external-link.d.ts.map +1 -0
  201. package/declarations/components/navigation/index.d.ts +1 -0
  202. package/declarations/components/navigation/index.d.ts.map +1 -0
  203. package/declarations/components/navigation/pagination/pagination.d.ts +8 -1
  204. package/declarations/components/navigation/pagination/pagination.d.ts.map +1 -0
  205. package/declarations/components/navigation/pagination/range.d.ts +1 -0
  206. package/declarations/components/navigation/pagination/range.d.ts.map +1 -0
  207. package/declarations/components/navigation/pagination.d.ts +1 -0
  208. package/declarations/components/navigation/pagination.d.ts.map +1 -0
  209. package/declarations/components/navigation/tab-nav/item.d.ts +1 -0
  210. package/declarations/components/navigation/tab-nav/item.d.ts.map +1 -0
  211. package/declarations/components/navigation/tab-nav/tab-nav.d.ts +11 -1
  212. package/declarations/components/navigation/tab-nav/tab-nav.d.ts.map +1 -0
  213. package/declarations/components/navigation/tab-nav.d.ts +1 -0
  214. package/declarations/components/navigation/tab-nav.d.ts.map +1 -0
  215. package/declarations/components/navigation/tabs/panel.d.ts +1 -0
  216. package/declarations/components/navigation/tabs/panel.d.ts.map +1 -0
  217. package/declarations/components/navigation/tabs/tab.d.ts +1 -0
  218. package/declarations/components/navigation/tabs/tab.d.ts.map +1 -0
  219. package/declarations/components/navigation/tabs/tabs.d.ts +11 -1
  220. package/declarations/components/navigation/tabs/tabs.d.ts.map +1 -0
  221. package/declarations/components/navigation/tabs.d.ts +1 -0
  222. package/declarations/components/navigation/tabs.d.ts.map +1 -0
  223. package/declarations/components/notifications/index.d.ts +1 -0
  224. package/declarations/components/notifications/index.d.ts.map +1 -0
  225. package/declarations/components/notifications/notification-card.d.ts +2 -3
  226. package/declarations/components/notifications/notification-card.d.ts.map +1 -0
  227. package/declarations/components/notifications/notifications-container.d.ts +1 -0
  228. package/declarations/components/notifications/notifications-container.d.ts.map +1 -0
  229. package/declarations/components/overlays/backdrop.d.ts +1 -0
  230. package/declarations/components/overlays/backdrop.d.ts.map +1 -0
  231. package/declarations/components/overlays/drawer/body.d.ts +1 -0
  232. package/declarations/components/overlays/drawer/body.d.ts.map +1 -0
  233. package/declarations/components/overlays/drawer/drag-handle.d.ts +1 -0
  234. package/declarations/components/overlays/drawer/drag-handle.d.ts.map +1 -0
  235. package/declarations/components/overlays/drawer/footer.d.ts +1 -0
  236. package/declarations/components/overlays/drawer/footer.d.ts.map +1 -0
  237. package/declarations/components/overlays/drawer/header.d.ts +1 -0
  238. package/declarations/components/overlays/drawer/header.d.ts.map +1 -0
  239. package/declarations/components/overlays/drawer/selectors.d.ts +1 -0
  240. package/declarations/components/overlays/drawer/selectors.d.ts.map +1 -0
  241. package/declarations/components/overlays/drawer.d.ts +62 -54
  242. package/declarations/components/overlays/drawer.d.ts.map +1 -0
  243. package/declarations/components/overlays/index.d.ts +1 -0
  244. package/declarations/components/overlays/index.d.ts.map +1 -0
  245. package/declarations/components/overlays/modal/body.d.ts +1 -0
  246. package/declarations/components/overlays/modal/body.d.ts.map +1 -0
  247. package/declarations/components/overlays/modal/footer.d.ts +1 -0
  248. package/declarations/components/overlays/modal/footer.d.ts.map +1 -0
  249. package/declarations/components/overlays/modal/header.d.ts +1 -0
  250. package/declarations/components/overlays/modal/header.d.ts.map +1 -0
  251. package/declarations/components/overlays/modal.d.ts +18 -12
  252. package/declarations/components/overlays/modal.d.ts.map +1 -0
  253. package/declarations/components/overlays/mount-animation.d.ts +1 -0
  254. package/declarations/components/overlays/mount-animation.d.ts.map +1 -0
  255. package/declarations/components/overlays/overlay.d.ts +14 -0
  256. package/declarations/components/overlays/overlay.d.ts.map +1 -0
  257. package/declarations/components/overlays/popover.d.ts +1 -0
  258. package/declarations/components/overlays/popover.d.ts.map +1 -0
  259. package/declarations/components/overlays/portal-target.d.ts +1 -0
  260. package/declarations/components/overlays/portal-target.d.ts.map +1 -0
  261. package/declarations/components/overlays/portal.d.ts +1 -0
  262. package/declarations/components/overlays/portal.d.ts.map +1 -0
  263. package/declarations/components/overlays/tooltip.d.ts +1 -0
  264. package/declarations/components/overlays/tooltip.d.ts.map +1 -0
  265. package/declarations/components/status/alert.d.ts +2 -3
  266. package/declarations/components/status/alert.d.ts.map +1 -0
  267. package/declarations/components/status/index.d.ts +1 -0
  268. package/declarations/components/status/index.d.ts.map +1 -0
  269. package/declarations/components/status/progress-bar.d.ts +1 -0
  270. package/declarations/components/status/progress-bar.d.ts.map +1 -0
  271. package/declarations/components/utilities/avatar.d.ts +13 -7
  272. package/declarations/components/utilities/avatar.d.ts.map +1 -0
  273. package/declarations/components/utilities/collapsible.d.ts +1 -0
  274. package/declarations/components/utilities/collapsible.d.ts.map +1 -0
  275. package/declarations/components/utilities/divider.d.ts +12 -0
  276. package/declarations/components/utilities/divider.d.ts.map +1 -0
  277. package/declarations/components/utilities/index.d.ts +1 -0
  278. package/declarations/components/utilities/index.d.ts.map +1 -0
  279. package/declarations/components/utilities/kbd.d.ts +1 -0
  280. package/declarations/components/utilities/kbd.d.ts.map +1 -0
  281. package/declarations/components/utilities/skeleton.d.ts +1 -0
  282. package/declarations/components/utilities/skeleton.d.ts.map +1 -0
  283. package/declarations/components/utilities/spinner.d.ts +1 -0
  284. package/declarations/components/utilities/spinner.d.ts.map +1 -0
  285. package/declarations/components/utilities/visually-hidden.d.ts +1 -0
  286. package/declarations/components/utilities/visually-hidden.d.ts.map +1 -0
  287. package/declarations/disclosure.d.ts +1 -0
  288. package/declarations/disclosure.d.ts.map +1 -0
  289. package/declarations/forms.d.ts +1 -0
  290. package/declarations/forms.d.ts.map +1 -0
  291. package/declarations/index.d.ts +1 -0
  292. package/declarations/index.d.ts.map +1 -0
  293. package/declarations/modifiers/drag-to-dismiss.d.ts +1 -0
  294. package/declarations/modifiers/drag-to-dismiss.d.ts.map +1 -0
  295. package/declarations/modifiers/press.d.ts +1 -0
  296. package/declarations/modifiers/press.d.ts.map +1 -0
  297. package/declarations/navigation.d.ts +1 -0
  298. package/declarations/navigation.d.ts.map +1 -0
  299. package/declarations/notifications.d.ts +1 -0
  300. package/declarations/notifications.d.ts.map +1 -0
  301. package/declarations/overlays.d.ts +1 -0
  302. package/declarations/overlays.d.ts.map +1 -0
  303. package/declarations/services/notifications.d.ts +1 -0
  304. package/declarations/services/notifications.d.ts.map +1 -0
  305. package/declarations/status.d.ts +1 -0
  306. package/declarations/status.d.ts.map +1 -0
  307. package/declarations/test-support.d.ts +1 -0
  308. package/declarations/test-support.d.ts.map +1 -0
  309. package/declarations/utilities.d.ts +1 -0
  310. package/declarations/utilities.d.ts.map +1 -0
  311. package/declarations/utils/deferred-work.d.ts +1 -0
  312. package/declarations/utils/deferred-work.d.ts.map +1 -0
  313. package/declarations/utils/filter.d.ts +1 -0
  314. package/declarations/utils/filter.d.ts.map +1 -0
  315. package/declarations/utils/forms-utils-index.d.ts +1 -0
  316. package/declarations/utils/forms-utils-index.d.ts.map +1 -0
  317. package/declarations/utils/keys.d.ts +1 -0
  318. package/declarations/utils/keys.d.ts.map +1 -0
  319. package/declarations/utils/listManager.d.ts +22 -0
  320. package/declarations/utils/listManager.d.ts.map +1 -0
  321. package/declarations/utils/nested-data.d.ts +1 -0
  322. package/declarations/utils/nested-data.d.ts.map +1 -0
  323. package/declarations/utils/prefers-reduced-motion.d.ts +1 -0
  324. package/declarations/utils/prefers-reduced-motion.d.ts.map +1 -0
  325. package/declarations/utils/ref.d.ts +2 -1
  326. package/declarations/utils/ref.d.ts.map +1 -0
  327. package/declarations/utils/roving-focus.d.ts +1 -0
  328. package/declarations/utils/roving-focus.d.ts.map +1 -0
  329. package/declarations/utils/safe-area.d.ts +1 -0
  330. package/declarations/utils/safe-area.d.ts.map +1 -0
  331. package/declarations/utils/safe-styles.d.ts +1 -0
  332. package/declarations/utils/safe-styles.d.ts.map +1 -0
  333. package/declarations/utils/selection-indicator.d.ts +1 -0
  334. package/declarations/utils/selection-indicator.d.ts.map +1 -0
  335. package/declarations/utils/standard-validator.d.ts +1 -0
  336. package/declarations/utils/standard-validator.d.ts.map +1 -0
  337. package/declarations/utils/toggle.d.ts +1 -0
  338. package/declarations/utils/toggle.d.ts.map +1 -0
  339. package/dist/components/buttons/button-group.js.map +1 -1
  340. package/dist/components/buttons/button.js.map +1 -1
  341. package/dist/components/buttons/chip.js.map +1 -1
  342. package/dist/components/buttons/close-button.js +1 -1
  343. package/dist/components/buttons/close-button.js.map +1 -1
  344. package/dist/components/buttons/segmented-control/item.js.map +1 -1
  345. package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -1
  346. package/dist/components/buttons/toggle-button.js.map +1 -1
  347. package/dist/components/collections/calendar/calendar.js.map +1 -1
  348. package/dist/components/collections/calendar/day-cell.js.map +1 -1
  349. package/dist/components/collections/calendar/header.js +1 -2
  350. package/dist/components/collections/calendar/header.js.map +1 -1
  351. package/dist/components/collections/calendar/month-grid.js.map +1 -1
  352. package/dist/components/collections/calendar/utils.js.map +1 -1
  353. package/dist/components/collections/calendar/year-grid.js.map +1 -1
  354. package/dist/components/collections/command/command.js.map +1 -1
  355. package/dist/components/collections/command/dialog.js +0 -1
  356. package/dist/components/collections/command/dialog.js.map +1 -1
  357. package/dist/components/collections/command/footer.js.map +1 -1
  358. package/dist/components/collections/command/input.js.map +1 -1
  359. package/dist/components/collections/command/list.js.map +1 -1
  360. package/dist/components/collections/dropdown/dropdown.js +72 -7
  361. package/dist/components/collections/dropdown/dropdown.js.map +1 -1
  362. package/dist/components/collections/dropdown/menu-context.js +52 -1
  363. package/dist/components/collections/dropdown/menu-context.js.map +1 -1
  364. package/dist/components/collections/dropdown/sub.js +2 -9
  365. package/dist/components/collections/dropdown/sub.js.map +1 -1
  366. package/dist/components/collections/listbox/group.js.map +1 -1
  367. package/dist/components/collections/listbox/item.js +32 -6
  368. package/dist/components/collections/listbox/item.js.map +1 -1
  369. package/dist/components/collections/listbox/listbox.js.map +1 -1
  370. package/dist/components/collections/simple-table/body.js.map +1 -1
  371. package/dist/components/collections/simple-table/cell.js.map +1 -1
  372. package/dist/components/collections/simple-table/column.js.map +1 -1
  373. package/dist/components/collections/simple-table/footer.js.map +1 -1
  374. package/dist/components/collections/simple-table/header.js.map +1 -1
  375. package/dist/components/collections/simple-table/index.js.map +1 -1
  376. package/dist/components/collections/simple-table/row.js.map +1 -1
  377. package/dist/components/collections/table/cell-default.js.map +1 -1
  378. package/dist/components/collections/table/cell-for.js.map +1 -1
  379. package/dist/components/collections/table/cell-rendering-context.js.map +1 -1
  380. package/dist/components/collections/table/checkbox.js.map +1 -1
  381. package/dist/components/collections/table/column-visibility.js +1 -1
  382. package/dist/components/collections/table/column-visibility.js.map +1 -1
  383. package/dist/components/collections/table/sort-button.js +1 -1
  384. package/dist/components/collections/table/sort-button.js.map +1 -1
  385. package/dist/components/collections/table/table.js +1 -2
  386. package/dist/components/collections/table/table.js.map +1 -1
  387. package/dist/components/collections/table/utils.js.map +1 -1
  388. package/dist/components/disclosure/accordion/accordion.js.map +1 -1
  389. package/dist/components/disclosure/accordion/item.js +1 -1
  390. package/dist/components/disclosure/accordion/item.js.map +1 -1
  391. package/dist/components/forms/autocomplete.js +1 -1
  392. package/dist/components/forms/autocomplete.js.map +1 -1
  393. package/dist/components/forms/checkbox-group.js.map +1 -1
  394. package/dist/components/forms/checkbox.js.map +1 -1
  395. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  396. package/dist/components/forms/date-picker/end-content.js +1 -1
  397. package/dist/components/forms/date-picker/end-content.js.map +1 -1
  398. package/dist/components/forms/date-picker/trigger.js.map +1 -1
  399. package/dist/components/forms/date-picker/value.js.map +1 -1
  400. package/dist/components/forms/field.js.map +1 -1
  401. package/dist/components/forms/form-control.js.map +1 -1
  402. package/dist/components/forms/form-description.js.map +1 -1
  403. package/dist/components/forms/form-feedback.js.map +1 -1
  404. package/dist/components/forms/form.js.map +1 -1
  405. package/dist/components/forms/input-otp.js.map +1 -1
  406. package/dist/components/forms/input.js.map +1 -1
  407. package/dist/components/forms/label.js.map +1 -1
  408. package/dist/components/forms/native-select.js +2 -2
  409. package/dist/components/forms/native-select.js.map +1 -1
  410. package/dist/components/forms/radio-group.js.map +1 -1
  411. package/dist/components/forms/radio.js.map +1 -1
  412. package/dist/components/forms/select/end-content.js +1 -1
  413. package/dist/components/forms/select/end-content.js.map +1 -1
  414. package/dist/components/forms/select/native-mirror.js.map +1 -1
  415. package/dist/components/forms/select/select.js.map +1 -1
  416. package/dist/components/forms/select/selected-items.js.map +1 -1
  417. package/dist/components/forms/select/trigger.js.map +1 -1
  418. package/dist/components/forms/switch.js.map +1 -1
  419. package/dist/components/forms/textarea.js.map +1 -1
  420. package/dist/components/navigation/external-link.js.map +1 -1
  421. package/dist/components/navigation/pagination/pagination.js +1 -1
  422. package/dist/components/navigation/pagination/pagination.js.map +1 -1
  423. package/dist/components/navigation/pagination/range.js.map +1 -1
  424. package/dist/components/navigation/tab-nav/item.js.map +1 -1
  425. package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -1
  426. package/dist/components/navigation/tabs/panel.js.map +1 -1
  427. package/dist/components/navigation/tabs/tab.js.map +1 -1
  428. package/dist/components/navigation/tabs/tabs.js.map +1 -1
  429. package/dist/components/notifications/index.js +2 -2
  430. package/dist/components/notifications/notification-card.js +2 -2
  431. package/dist/components/notifications/notifications-container.js +1 -1
  432. package/dist/components/notifications/notifications-container.js.map +1 -1
  433. package/dist/components/overlays/backdrop.js +1 -1
  434. package/dist/components/overlays/backdrop.js.map +1 -1
  435. package/dist/components/overlays/drawer/body.js.map +1 -1
  436. package/dist/components/overlays/drawer/drag-handle.js.map +1 -1
  437. package/dist/components/overlays/drawer/footer.js.map +1 -1
  438. package/dist/components/overlays/drawer/header.js.map +1 -1
  439. package/dist/components/overlays/drawer/selectors.js.map +1 -1
  440. package/dist/components/overlays/drawer.js +1 -1
  441. package/dist/components/overlays/drawer.js.map +1 -1
  442. package/dist/components/overlays/modal/body.js.map +1 -1
  443. package/dist/components/overlays/modal/footer.js.map +1 -1
  444. package/dist/components/overlays/modal/header.js.map +1 -1
  445. package/dist/components/overlays/modal.js +1 -1
  446. package/dist/components/overlays/modal.js.map +1 -1
  447. package/dist/components/overlays/mount-animation.js.map +1 -1
  448. package/dist/components/overlays/overlay.js +52 -3
  449. package/dist/components/overlays/overlay.js.map +1 -1
  450. package/dist/components/overlays/popover.js +2 -2
  451. package/dist/components/overlays/popover.js.map +1 -1
  452. package/dist/components/overlays/portal-target.js.map +1 -1
  453. package/dist/components/overlays/portal.js.map +1 -1
  454. package/dist/components/overlays/tooltip.js.map +1 -1
  455. package/dist/components/status/alert.js +11 -6
  456. package/dist/components/status/alert.js.map +1 -1
  457. package/dist/components/status/progress-bar.js.map +1 -1
  458. package/dist/components/utilities/avatar.js.map +1 -1
  459. package/dist/components/utilities/collapsible.js.map +1 -1
  460. package/dist/components/utilities/divider.js +1 -1
  461. package/dist/components/utilities/divider.js.map +1 -1
  462. package/dist/components/utilities/index.js +1 -1
  463. package/dist/components/utilities/kbd.js.map +1 -1
  464. package/dist/components/utilities/skeleton.js.map +1 -1
  465. package/dist/components/utilities/spinner.js.map +1 -1
  466. package/dist/components/utilities/visually-hidden.js.map +1 -1
  467. package/dist/control-blur-C8OnSQR5.js.map +1 -1
  468. package/dist/deprecated-args-BIUjLA8y.js.map +1 -1
  469. package/dist/dialog-CreV7aPQ.js.map +1 -1
  470. package/dist/dom-cKWVvtkd.js.map +1 -1
  471. package/dist/icons-DZ61nCzv.js +51 -0
  472. package/dist/icons-DZ61nCzv.js.map +1 -0
  473. package/dist/index.js +3 -3
  474. package/dist/{manager-B-PnYqDs.js → manager-jDaRVZ5o.js} +1 -3
  475. package/dist/manager-jDaRVZ5o.js.map +1 -0
  476. package/dist/modifiers/drag-to-dismiss.js.map +1 -1
  477. package/dist/modifiers/press.js.map +1 -1
  478. package/dist/{notification-card-CYmWQ35W.js → notification-card-dz-eE6z9.js} +2 -2
  479. package/dist/notification-card-dz-eE6z9.js.map +1 -0
  480. package/dist/notifications.js +2 -2
  481. package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -1
  482. package/dist/services/notifications.js +1 -1
  483. package/dist/services/notifications.js.map +1 -1
  484. package/dist/test-support.js.map +1 -1
  485. package/dist/utilities.js +1 -1
  486. package/dist/utils/deferred-work.js.map +1 -1
  487. package/dist/utils/filter.js.map +1 -1
  488. package/dist/utils/forms-utils-index.js.map +1 -1
  489. package/dist/utils/keys.js.map +1 -1
  490. package/dist/utils/listManager.js +34 -4
  491. package/dist/utils/listManager.js.map +1 -1
  492. package/dist/utils/nested-data.js.map +1 -1
  493. package/dist/utils/prefers-reduced-motion.js.map +1 -1
  494. package/dist/utils/ref.js +1 -1
  495. package/dist/utils/ref.js.map +1 -1
  496. package/dist/utils/roving-focus.js.map +1 -1
  497. package/dist/utils/safe-area.js.map +1 -1
  498. package/dist/utils/safe-styles.js.map +1 -1
  499. package/dist/utils/selection-indicator.js.map +1 -1
  500. package/dist/utils/standard-validator.js.map +1 -1
  501. package/dist/utils/toggle.js.map +1 -1
  502. package/package.json +23 -24
  503. package/dist/components/collections/calendar/icons.js +0 -23
  504. package/dist/components/collections/calendar/icons.js.map +0 -1
  505. package/dist/components/collections/table/icons.js +0 -19
  506. package/dist/components/collections/table/icons.js.map +0 -1
  507. package/dist/components/disclosure/icons.js +0 -13
  508. package/dist/components/disclosure/icons.js.map +0 -1
  509. package/dist/components/forms/icons.js +0 -16
  510. package/dist/components/forms/icons.js.map +0 -1
  511. package/dist/components/navigation/pagination/icons.js +0 -23
  512. package/dist/components/navigation/pagination/icons.js.map +0 -1
  513. package/dist/intent-icons-DpEViO8C.js +0 -19
  514. package/dist/intent-icons-DpEViO8C.js.map +0 -1
  515. package/dist/manager-B-PnYqDs.js.map +0 -1
  516. package/dist/notification-card-CYmWQ35W.js.map +0 -1
  517. package/dist/template-registry.js +0 -2
  518. package/dist/template-registry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sources":["../../../src/components/overlays/tooltip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\n/* eslint-disable ember/no-runloop */\nimport { next, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { useStyles } from '@frontile/theme';\nimport { Popover, type PopoverSignature } from './popover';\nimport type {\n TooltipVariants,\n TooltipSlots,\n SlotsToClasses\n} from '@frontile/theme';\nimport type { ModifierLike, WithBoundArgs } from '@glint/template';\nimport type Owner from '@ember/owner';\n\n/**\n * The type of `Popover`'s yielded `Content`, already bound to its internal\n * wiring (`loop`, `isOpen`, `id`, ...). Reusing this instead of\n * `ComponentLike<ContentSignature>` matters: the latter is the *unbound*\n * signature, so invoking it in a template would again require every one of\n * those internal args -- exactly what `WithBoundArgs` exists to avoid.\n */\ntype BoundPopoverContent = PopoverSignature['Blocks']['default'][0]['Content'];\n\n/**\n * The concrete function signature backing `PopoverTriggerModifier`. Glint's\n * `ModifierLike` is deliberately opaque -- it exists to keep a modifier from\n * being invoked as a plain function in application code -- so there is no\n * type-safe way to call through to it. This narrow, well-understood cast is\n * the exception: `modifier()` from `ember-modifier` returns the exact\n * function it was given. `ember-modifier`'s `dist/index.js` ends `modifier()`\n * with `return setModifierManager(() => MANAGER, fn);`. Its own comment there\n * calls the declared return type \"a *lie*\" -- that is about the TYPE, not the\n * runtime: `setModifierManager` delegates to `@glimmer/manager`'s\n * `setInternalModifierManager`, whose body is `map.set(obj, manager), obj`,\n * so it really does hand back the same `fn`. At runtime `p.trigger` *is*\n * that function. `(el, positional, named) => teardown` is how\n * `Popover`'s own `trigger` is declared.\n *\n * WARNING FOR A FUTURE UPGRADER: this cast is verified against\n * `ember-modifier@4.3.0`'s *function-based* modifier manager, whose\n * `createModifier`/`updateModifier`/`installModifier` call the given function\n * directly as `instance(element, positional, named)` -- i.e. the manager adds\n * no wrapping of its own, so invoking `p.trigger`/`p.anchor` here as plain\n * functions is genuinely calling the same code the manager would call.\n * `ModifierLike` has no call signature *by design* (it exists specifically to\n * stop application code from doing this), so there is no type-safe\n * alternative to the cast. A major `ember-modifier` upgrade could change the\n * manager's calling convention (or start wrapping the function) with no\n * compiler signal at this cast site -- re-verify against the new\n * `dist/index.js` before assuming this still holds. The runtime `assert`\n * calls at the call sites below exist so a break here fails loudly (a thrown\n * dev-mode assertion) instead of silently (a tooltip that never opens).\n */\ntype PopoverTriggerFn = (\n element: HTMLElement,\n positional: ['hover'],\n named: { aria: 'describedby' }\n) => void | (() => void);\n\n/**\n * `p.anchor` (`Velcro`'s `hook`) needs the same runtime call-through as\n * `p.trigger` above -- it is what makes `velcro.loop`/`p.Content`'s `@loop`\n * resolve at all. A consumer normally applies `{{p.anchor}}` and\n * `{{p.trigger}}` as two separate modifiers on the trigger element (see\n * `popover-test.gts`); a tooltip's single yielded `t.trigger` has to install\n * both. Same upgrade warning as `PopoverTriggerFn` above: `ember-velcro`'s\n * `hook` is built with the identical `setModifierManager(() => MANAGER, fn)`\n * pattern, so the same function-based-modifier assumption applies here too.\n */\ntype PopoverAnchorFn = (\n element: HTMLElement | SVGElement\n) => void | (() => void);\n\n/**\n * A modifier value that will be invoked directly as a function rather than\n * applied in a template. See `PopoverTriggerFn` for why that is sound and\n * what has to be re-verified on an `ember-modifier` upgrade. Stands in for\n * `p.anchor`/`p.trigger` wherever this file only needs to cache and compare\n * their identity (not call them) -- the actual call sites still narrow to\n * `PopoverAnchorFn`/`PopoverTriggerFn` via the existing documented casts.\n */\ntype CallableModifier = object;\n\ninterface TooltipSignature {\n Args: {\n /**\n * The tooltip's text. A shorthand for the common case; pass a `Content`\n * block instead when the tooltip needs markup. Passing both asserts.\n */\n content?: string;\n\n /**\n * The requested placement of the tooltip relative to its trigger. This is\n * a preference, not a guarantee: the flip middleware may resolve it to\n * the opposite side when there is no room for it in the requested spot.\n *\n * @defaultValue 'top'\n */\n placement?: PopoverSignature['Args']['placement'];\n\n /**\n * Renders an arrow pointing at the trigger.\n *\n * @defaultValue false\n */\n arrow?: boolean;\n\n /**\n * The tooltip's size, which scales its padding and label text.\n *\n * @defaultValue 'md'\n */\n size?: TooltipVariants['size'];\n\n /**\n * The tooltip's semantic color role. The arrow inherits the body's\n * background, so it follows the chosen intent automatically.\n *\n * @defaultValue 'neutral'\n */\n color?: TooltipVariants['color'];\n\n /**\n * Milliseconds before opening on hover or keyboard focus.\n *\n * @defaultValue 200\n */\n openDelay?: number;\n\n /**\n * Milliseconds before closing. Also the window the pointer has to cross\n * the gap into the tooltip, so a very small value makes the tooltip\n * effectively non-interactive.\n *\n * @defaultValue 150\n */\n closeDelay?: number;\n\n /**\n * Closes as soon as the pointer leaves the trigger, rather than letting it\n * move onto the tooltip.\n *\n * @defaultValue false\n */\n disableInteractive?: boolean;\n\n /**\n * Installs the trigger but never opens. For a tooltip whose text is\n * conditionally irrelevant.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /**\n * Whether the tooltip is open. Pair with `onOpenChange` to control it;\n * leave it unset to let the tooltip manage its own state. Passing\n * `isOpen` alone, without `onOpenChange`, falls back to uncontrolled\n * behavior.\n */\n isOpen?: boolean;\n\n /**\n * Callback when the tooltip opens or closes, receiving the new state.\n */\n onOpenChange?: (isOpen: boolean) => void;\n\n /**\n * Callback when closing has finished, including any exit transition.\n */\n didClose?: () => void;\n\n /**\n * The gap, in pixels, between the trigger and the tooltip. The default\n * leaves room for the arrow when `@arrow` is enabled.\n *\n * @defaultValue 8\n */\n offsetOptions?: PopoverSignature['Args']['offsetOptions'];\n\n /**\n * Options for the floating-ui flip middleware, which moves the tooltip\n * to the opposite side when it would overflow the viewport. Forwarded\n * to the underlying `Popover`.\n */\n flipOptions?: PopoverSignature['Args']['flipOptions'];\n\n /**\n * Options for the floating-ui shift middleware, which nudges the\n * tooltip along its axis to keep it in view. Forwarded to the\n * underlying `Popover`.\n */\n shiftOptions?: PopoverSignature['Args']['shiftOptions'];\n\n /**\n * Additional floating-ui middleware, for positioning behavior beyond\n * what `placement`, `offsetOptions`, `flipOptions`, and `shiftOptions`\n * cover. Forwarded to the underlying `Popover`.\n */\n middleware?: PopoverSignature['Args']['middleware'];\n\n /**\n * The CSS positioning strategy, forwarded to the underlying\n * `Popover`/floating-ui.\n *\n * @defaultValue 'absolute'\n */\n strategy?: PopoverSignature['Args']['strategy'];\n\n /**\n * Custom class for the tooltip, merged with the theme's using Tailwind\n * Merge.\n */\n class?: string;\n\n /**\n * Class names for each slot, merged with the theme's.\n */\n classes?: SlotsToClasses<TooltipSlots>;\n };\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n /**\n * The modifier to apply to the element the tooltip describes. Installs\n * the hover/focus listeners that open and close the tooltip, and keeps\n * `aria-describedby` in sync while it does.\n */\n trigger: ModifierLike<{ Element: HTMLElement }>;\n Content: WithBoundArgs<\n typeof TooltipContent,\n | 'PopoverContent'\n | 'classNames'\n | 'arrow'\n | 'disableInteractive'\n | 'hasContentArg'\n >;\n\n /**\n * Whether the tooltip is currently open.\n */\n isOpen: boolean;\n\n /**\n * Opens the tooltip.\n */\n open: () => void;\n\n /**\n * Closes the tooltip.\n */\n close: () => void;\n }\n ];\n };\n}\n\nclass Tooltip extends Component<TooltipSignature> {\n get classNames() {\n const { tooltip } = useStyles();\n\n const { base, arrow } = tooltip({\n size: this.args.size,\n color: this.args.color\n });\n\n return {\n base: base({ class: [this.args.classes?.base, this.args.class] }),\n arrow: arrow({ class: this.args.classes?.arrow })\n };\n }\n\n get placement(): PopoverSignature['Args']['placement'] {\n return this.args.placement ?? 'top';\n }\n\n get offsetOptions() {\n return this.args.offsetOptions ?? 8;\n }\n\n get openDelay(): number {\n return typeof this.args.openDelay === 'number' ? this.args.openDelay : 200;\n }\n\n get closeDelay(): number {\n return typeof this.args.closeDelay === 'number'\n ? this.args.closeDelay\n : 150;\n }\n\n /**\n * `p.trigger` cannot be curried in a `.gts` template with the template's\n * `(modifier ...)` keyword: even binding a single positional argument onto\n * a wrapper modifier -- whatever its declared type -- makes Glint's\n * `--declaration` pass fail with \"Type instantiation is excessively deep\n * and possibly infinite\" (reproduces the same way typed as `unknown`).\n * Applying a modifier directly (`{{this.someModifier someArg}}`) type-checks\n * fine; it is specifically the currying keyword's overload resolution that\n * Glint chokes on, matching the brief's anticipated fallback: build the\n * bound modifier value from plain JS instead of templated currying.\n *\n * `modifier()` from `ember-modifier` returns the exact function it is\n * given, with only a modifier manager attached out of band (see its\n * `dist/index.js`: `setModifierManager(() => MANAGER, fn); return fn;`),\n * and `ember-velcro`'s `hook` (`p.anchor`) is built the same way. So both\n * `p.anchor` and `p.trigger` are, at runtime, genuinely just those\n * functions -- calling them directly from plain JS is well-defined, even\n * though Glint's opaque `ModifierLike` intentionally exposes no call\n * signature for either.\n *\n * `t.trigger` has to install *both*: a tooltip's trigger element is also\n * its `Velcro` anchor. A normal `Popover` consumer applies `{{p.anchor}}`\n * and `{{p.trigger}}` as two separate modifiers on the same element (see\n * `popover-test.gts`); missing the anchor doesn't fail loudly by itself --\n * it just leaves `velcro.loop` (and so `p.Content`'s `@loop`) undefined,\n * which then asserts inside `Content`.\n *\n * Memoized on the `(anchor, trigger)` pair's identity (both stable for a\n * given `Popover` instance, since `Popover`/`Velcro` each assign their\n * fields once) so `t.trigger` keeps a stable identity across re-renders\n * instead of tearing down and reinstalling on every one.\n *\n * `@isDisabled` is read *inside* the installed function below, rather than\n * baked into this cache -- deliberately. `modifier()`'s function autotracks:\n * reading `this.args.isDisabled` there is what makes ember-modifier tear\n * down and reinstall the trigger's listeners when it changes, without\n * needing a new outer modifier identity (so the element itself is never\n * remounted). The brief's sketch instead made `@isDisabled` an unreachable\n * `openDelay` (`Number.MAX_SAFE_INTEGER`) passed through to `Popover`. That\n * does not work: `@ember/test-helpers`' `settled()` -- which every\n * `await triggerEvent(...)` calls internally -- waits on\n * `backburner.hasTimers()`, which is true for *any* pending `later()` call\n * no matter how far in the future, so a `mouseenter` scheduling an\n * effectively-infinite open left every subsequent `await` hanging until\n * the QUnit test timeout (confirmed: the test hung at exactly 60000ms).\n * Skipping the hover installation entirely while disabled avoids ever\n * scheduling that timer in the first place.\n *\n * ANCHOR CHURN GUARD: the wrapper function below reads `this.isOpen`\n * *transitively* -- not directly, but through `trigger`'s own autotracking\n * of `aria-describedby` -- so `ember-modifier` tears the whole wrapper down\n * and reinstalls it on every open/close. Without a guard, that would call\n * `anchor(element)` again on every cycle, and `Velcro`'s `hook` reassigns\n * its own `@tracked hook` field each time it runs, which tears down and\n * restarts floating-ui's `autoUpdate` positioning loop for no reason -- a\n * normal `Popover` consumer never pays this cost, because there `anchor`\n * and `trigger` are two separate modifiers and `anchor`'s body reads\n * nothing tracked, so it installs once and never re-runs.\n *\n * The fix keys the anchor's lifecycle on the *element* in instance state\n * (`anchoredElement`/`anchorTeardown`), not on the wrapper modifier's own\n * re-run: `ensureAnchor` below only calls `anchor(element)` when the\n * element actually changes. The wrapper's own destructor -- called by\n * `ember-modifier` before *every* re-run, same-element re-runs included --\n * therefore does not tear the anchor down synchronously; it only tears\n * down `trigger` immediately (the half that legitimately needs to re-run on\n * every open/close -- that's what keeps `aria-describedby` in sync, and\n * Task 5 documented it as required for controlled mode) and *defers* the\n * anchor decision via `scheduleAnchorTeardownCheck`.\n *\n * FIX ROUND 2 -- the leak this guard introduced, and why a deferred check:\n * `ember-modifier` gives the destructor no way to tell \"about to re-run for\n * the same element\" apart from \"genuinely destroyed\" -- both call the same\n * returned closure. Guarding the anchor by comparing `element` identity (as\n * fix round 1 did) is correct for the re-run case but has no destructor\n * path left for the case where `element` is removed entirely while\n * `Tooltip` itself keeps living (e.g. `{{#if this.show}}<button\n * {{t.trigger}}>{{/if}}`) -- nothing ever calls `ensureAnchor` again to\n * notice the change, and `willDestroy` only runs when `Tooltip` itself is\n * torn down. `scheduleAnchorTeardownCheck`/`confirmAnchorTeardown` resolve\n * the ambiguity by deferring one runloop turn (`@ember/runloop`'s `next`):\n * if the wrapper re-runs for the same element, `ensureAnchor` cancels the\n * pending check synchronously, before it fires; if `element` was genuinely\n * removed, nothing cancels it and the anchor is torn down for real one turn\n * later. The anchor is therefore torn down in exactly three places:\n * `ensureAnchor` (a different element arrived), `confirmAnchorTeardown`\n * (the deferred check fired unchallenged), and `willDestroy` (the component\n * itself is destroyed) -- never synchronously inside the wrapper's own\n * destructor.\n */\n cachedTrigger?: {\n anchor: CallableModifier;\n trigger: CallableModifier;\n modifier: ModifierLike<{ Element: HTMLElement }>;\n };\n\n /**\n * The element the anchor is currently installed on, and the teardown\n * `anchor(element)` handed back for it. Lives on the component instance\n * (not in the modifier's own closure) so it survives every open/close\n * re-run of the wrapper modifier -- see the churn-guard note above.\n */\n anchoredElement?: HTMLElement | SVGElement;\n anchorTeardown?: () => void;\n\n /**\n * A scheduled-but-not-yet-confirmed anchor teardown, set by the wrapper\n * modifier's destructor (see `makeTrigger`) and cancelled by `ensureAnchor`\n * if the wrapper turns out to have just re-run for the same element.\n *\n * WHY THIS EXISTS: `ember-modifier` calls the wrapper's destructor before\n * *every* re-run (same-element open/close churn included) as well as on\n * genuine removal, and does not tell us which. So the destructor alone\n * cannot decide whether to tear the anchor down. Deferring the decision by\n * one runloop turn resolves the ambiguity: if the wrapper is only\n * re-running, `ensureAnchor` runs synchronously afterwards (same tick,\n * before the deferred check fires) and cancels this; if the element was\n * genuinely removed, nothing calls `ensureAnchor` again, so the deferred\n * check fires and the anchor is torn down for real.\n *\n * Scheduled with `@ember/runloop`'s `next`/`cancel`, like the rest of this\n * codebase's timer usage (see `popover.gts`'s `hoverTimer`), rather than a\n * bespoke `setTimeout`.\n */\n pendingAnchorTeardown?: {\n element: HTMLElement | SVGElement;\n timer: EmberTimer;\n };\n\n /**\n * Installs `anchor` on `element` only if it is not already installed\n * there. Called on every wrapper re-run (every open/close), but is a no-op\n * on all but the first call and any call where the element genuinely\n * changed.\n *\n * Declared as a regular (prototype) method rather than an arrow-function\n * class field -- unlike `makeTrigger`, it is only ever called as\n * `this.ensureAnchor(...)`, never passed by reference, so it doesn't need\n * per-instance `this`-binding. Living on the prototype also makes it the\n * one seam the test suite can wrap to count real anchor installations\n * (see `tooltip-test.gts`'s anchor-churn-guard test).\n */\n ensureAnchor(anchor: CallableModifier, element: HTMLElement | SVGElement) {\n // The wrapper modifier re-ran for this same element -- any anchor\n // teardown its destructor speculatively scheduled (see\n // `scheduleAnchorTeardownCheck`) is stale: the element didn't actually go\n // away, so cancel the pending check before it can fire.\n if (\n this.pendingAnchorTeardown &&\n this.pendingAnchorTeardown.element === element\n ) {\n cancel(this.pendingAnchorTeardown.timer);\n this.pendingAnchorTeardown = undefined;\n }\n\n if (this.anchoredElement === element) {\n return;\n }\n\n // A different element arrived (or this is the first install for this\n // wrapper): tear down whatever anchor is currently installed before\n // installing the new one, so we never leak a stale `autoUpdate` loop.\n this.anchorTeardown?.();\n\n assert(\n \"Expected `p.anchor` to be a callable function (ember-velcro's `hook`, built the same way `ember-modifier`'s `modifier()` builds a callable function-based modifier). If this fires, an `ember-modifier` or `ember-velcro` upgrade likely changed how modifier values are constructed -- see the `PopoverAnchorFn`/`PopoverTriggerFn` comments above.\",\n typeof anchor === 'function'\n );\n\n const teardown = (anchor as unknown as PopoverAnchorFn)(element);\n\n this.anchoredElement = element;\n this.anchorTeardown = teardown ?? undefined;\n }\n\n /**\n * Called from the wrapper modifier's destructor -- i.e. on *every*\n * re-run of the wrapper, not only on genuine removal of `element`. Defers\n * the decision by one runloop turn: schedules `confirmAnchorTeardown` via\n * `next()`, which only actually tears the anchor down if nothing cancels\n * it first. `ensureAnchor` (above) is what cancels it, synchronously,\n * within the same runloop turn, if the wrapper turns out to have simply\n * re-run for the same element.\n */\n scheduleAnchorTeardownCheck(element: HTMLElement | SVGElement) {\n // Superseding an earlier pending check for a different element should\n // not normally happen (a new one would already have been resolved by an\n // intervening `ensureAnchor` call), but cancel defensively rather than\n // leak the earlier timer.\n if (this.pendingAnchorTeardown) {\n cancel(this.pendingAnchorTeardown.timer);\n }\n\n const timer = next(() => this.confirmAnchorTeardown(element));\n this.pendingAnchorTeardown = { element, timer };\n }\n\n /**\n * Runs one runloop turn after the wrapper modifier's destructor scheduled\n * it. If it gets here at all (i.e. `ensureAnchor` did not cancel it in the\n * meantime), the wrapper never re-ran for `element` -- the element was\n * genuinely removed -- so the anchor installed on it is torn down for\n * real.\n */\n confirmAnchorTeardown(element: HTMLElement | SVGElement) {\n if (\n !this.pendingAnchorTeardown ||\n this.pendingAnchorTeardown.element !== element\n ) {\n // Already superseded/cancelled (or, in principle, stale) -- nothing to\n // do.\n return;\n }\n\n this.pendingAnchorTeardown = undefined;\n\n if (this.anchoredElement === element) {\n this.anchorTeardown?.();\n this.anchoredElement = undefined;\n this.anchorTeardown = undefined;\n }\n }\n\n willDestroy() {\n super.willDestroy();\n if (this.pendingAnchorTeardown) {\n cancel(this.pendingAnchorTeardown.timer);\n this.pendingAnchorTeardown = undefined;\n }\n this.anchorTeardown?.();\n this.anchoredElement = undefined;\n this.anchorTeardown = undefined;\n }\n\n makeTrigger = (\n anchor: CallableModifier,\n trigger: CallableModifier\n ): ModifierLike<{ Element: HTMLElement }> => {\n if (\n !this.cachedTrigger ||\n this.cachedTrigger.anchor !== anchor ||\n this.cachedTrigger.trigger !== trigger\n ) {\n this.cachedTrigger = {\n anchor,\n trigger,\n modifier: modifier((element: HTMLElement) => {\n this.ensureAnchor(anchor, element);\n\n if (this.args.isDisabled) {\n return undefined;\n }\n\n assert(\n \"Expected `p.trigger` to be a callable function (a modifier built by `ember-modifier`'s `modifier()`). If this fires, an `ember-modifier` upgrade likely changed how function-based modifiers are constructed -- see the `PopoverTriggerFn` comment above.\",\n typeof trigger === 'function'\n );\n\n const teardownTrigger = (trigger as unknown as PopoverTriggerFn)(\n element,\n ['hover'],\n { aria: 'describedby' }\n );\n\n // `ember-modifier` calls this destructor before *every* re-run --\n // including a same-element re-run driven by `this.isOpen` churn --\n // and on genuine removal of `element`, with no way to tell which\n // from here. The trigger half always tears down and reinstalls\n // (that's what keeps `aria-describedby` in sync). The anchor half\n // cannot follow the same rule -- unconditionally tearing it down\n // here would reintroduce the churn this guard exists to prevent --\n // so it's handled by deferred confirmation: `scheduleAnchorTeardownCheck`\n // only *actually* tears the anchor down one runloop turn later, and\n // only if `ensureAnchor` doesn't cancel it first because the\n // wrapper turned out to just be re-running for the same element.\n // See the doc comments on `pendingAnchorTeardown` /\n // `scheduleAnchorTeardownCheck` / `confirmAnchorTeardown` above.\n return () => {\n teardownTrigger?.();\n this.scheduleAnchorTeardownCheck(element);\n };\n }) as unknown as ModifierLike<{ Element: HTMLElement }>\n };\n }\n\n return this.cachedTrigger.modifier;\n };\n\n <template>\n <Popover\n @placement={{this.placement}}\n @offsetOptions={{this.offsetOptions}}\n @flipOptions={{@flipOptions}}\n @shiftOptions={{@shiftOptions}}\n @middleware={{@middleware}}\n @strategy={{@strategy}}\n @openDelay={{this.openDelay}}\n @closeDelay={{this.closeDelay}}\n @isOpen={{@isOpen}}\n @onOpenChange={{@onOpenChange}}\n @didClose={{@didClose}}\n as |p|\n >\n {{yield\n (hash\n trigger=(this.makeTrigger p.anchor p.trigger)\n isOpen=p.isOpen\n open=p.open\n close=p.close\n Content=(component\n TooltipContent\n PopoverContent=p.Content\n classNames=this.classNames\n arrow=@arrow\n disableInteractive=@disableInteractive\n hasContentArg=(if @content true false)\n )\n )\n }}\n\n {{#if @content}}\n <TooltipContent\n @PopoverContent={{p.Content}}\n @classNames={{this.classNames}}\n @arrow={{@arrow}}\n @disableInteractive={{@disableInteractive}}\n ...attributes\n >\n {{@content}}\n </TooltipContent>\n {{/if}}\n </Popover>\n </template>\n}\n\ninterface TooltipContentSignature {\n Args: {\n /**\n * @internal\n */\n PopoverContent: BoundPopoverContent;\n\n /**\n * @internal\n */\n classNames: { base: string; arrow: string };\n\n /**\n * @internal\n */\n arrow?: boolean;\n\n /**\n * @internal\n */\n disableInteractive?: boolean;\n\n /**\n * @internal\n * Set only on the bound `Content` yielded to the consumer. Lets this\n * component assert when it renders while `@content` is also in use --\n * a `Tooltip` cannot otherwise tell whether the consumer invoked the\n * yielded `Content` block.\n */\n hasContentArg?: boolean;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n/**\n * The tooltip's content. Configures `Popover.Content` for a tooltip: no focus\n * trap, no autofocus, no scroll lock, `role=\"tooltip\"`, and `tabindex=\"-1\"` so\n * it is never a tab stop -- `Overlay` sets `tabindex=\"0\"` but spreads\n * `...attributes` after it, so this wins.\n *\n * Its constructor also asserts that `@content` and a `<t.Content>` block are\n * never used together: `hasContentArg` is set only on the bound `Content`\n * yielded to the consumer (see `TooltipContentSignature['Args']`), so this\n * component renders with it `true` exactly when the consumer both passed\n * `@content` to `Tooltip` *and* invoked the yielded `Content` block. The\n * check has to live here, on the content side, rather than on `Tooltip`\n * itself, because a Glimmer component has no way to observe whether a\n * consumer invoked one of its yielded blocks -- `Tooltip` cannot tell\n * `<t.Content>` was used at all until this component actually renders.\n */\nclass TooltipContent extends Component<TooltipContentSignature> {\n constructor(owner: Owner, args: TooltipContentSignature['Args']) {\n super(owner, args);\n\n assert(\n '<Tooltip> received both @content and a <t.Content> block. Use one or the other.',\n !this.args.hasContentArg\n );\n }\n\n /**\n * `data-component`/`data-part` below are written before ...attributes, so\n * they flow through Popover.Content's own ...attributes forwarding onto\n * Overlay's rendered div and override its default data-component=\"overlay\"\n * -- the standard splattributes-override pattern Overlay's own template is\n * written to support (its literal data-component=\"overlay\" is likewise\n * placed before its own ...attributes). Tooltip has no element of its own:\n * its \"base\"/\"arrow\" slots render on the exact same portaled div\n * Overlay/Popover.Content own, so this is the only way to mark it\n * data-component=\"tooltip\" without touching overlay.gts/popover.gts, which\n * are out of scope for this migration.\n */\n <template>\n <@PopoverContent\n @class={{@classNames.base}}\n @arrowClass={{@classNames.arrow}}\n @arrow={{@arrow}}\n @disableInteractive={{@disableInteractive}}\n @transition={{hash name=\"overlay-transition--tooltip\"}}\n @blockScroll={{false}}\n @backdrop=\"none\"\n role=\"tooltip\"\n tabindex=\"-1\"\n data-component=\"tooltip\"\n data-part=\"base\"\n ...attributes\n >\n {{yield}}\n </@PopoverContent>\n </template>\n}\n\nexport { Tooltip, type TooltipSignature };\nexport default Tooltip;\n"],"names":["Tooltip","Component","classNames","tooltip","useStyles","base","arrow","size","args","color","class","classes","placement","offsetOptions","openDelay","closeDelay","cachedTrigger","anchoredElement","anchorTeardown","pendingAnchorTeardown","ensureAnchor","anchor","element","cancel","timer","undefined","assert","teardown","scheduleAnchorTeardownCheck","next","confirmAnchorTeardown","willDestroy","makeTrigger","trigger","modifier","isDisabled","teardownTrigger","aria","setComponentTemplate","precompileTemplate","strictMode","scope","Popover","hash","TooltipContent","constructor","owner","hasContentArg"],"mappings":";;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BC;AAOD;;;;;;;;;AASC;AAKD;;;;;;;AAOC;AAkLD,MAAMA,gBAAgBC,SAAA,CAAU;EAC9B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAS,GAAGC,SAAA,EAAA;IAEpB,MAAM;MAAEC,IAAI;AAAEC,MAAAA;KAAO,GAAGH,OAAA,CAAQ;AAC9BI,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AACnB,KAAA,CAAA;IAEA,OAAO;MACLJ,IAAA,EAAMA,IAAA,CAAK;AAAEK,QAAAA,KAAA,EAAO,CAAC,IAAI,CAACF,IAAI,CAACG,OAAO,EAAEN,IAAA,EAAM,IAAI,CAACG,IAAI,CAACE,KAAK;AAAE,OAAA,CAAA;MAC/DJ,KAAA,EAAOA,KAAA,CAAM;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAACF,IAAI,CAACG,OAAO,EAAEL;OAAM;KACjD;AACF,EAAA;EAEA,IAAIM,SAAAA,GAAmD;AACrD,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,SAAS,IAAI,KAAA;AAChC,EAAA;EAEA,IAAIC,aAAAA,GAAgB;AAClB,IAAA,OAAO,IAAI,CAACL,IAAI,CAACK,aAAa,IAAI,CAAA;AACpC,EAAA;EAEA,IAAIC,SAAAA,GAAoB;AACtB,IAAA,OAAO,OAAO,IAAI,CAACN,IAAI,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,MAAAA,KAAA,EAAAA,OAAA;AAAAE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"tooltip.js","sources":["../../../src/components/overlays/tooltip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\n\nimport { next, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { useStyles } from '@frontile/theme';\nimport { Popover, type PopoverSignature } from './popover';\nimport type {\n TooltipVariants,\n TooltipSlots,\n SlotsToClasses\n} from '@frontile/theme';\nimport type { ModifierLike, WithBoundArgs } from '@glint/template';\nimport type Owner from '@ember/owner';\n\n/**\n * The type of `Popover`'s yielded `Content`, already bound to its internal\n * wiring (`loop`, `isOpen`, `id`, ...). Reusing this instead of\n * `ComponentLike<ContentSignature>` matters: the latter is the *unbound*\n * signature, so invoking it in a template would again require every one of\n * those internal args -- exactly what `WithBoundArgs` exists to avoid.\n */\ntype BoundPopoverContent = PopoverSignature['Blocks']['default'][0]['Content'];\n\n/**\n * The concrete function signature backing `PopoverTriggerModifier`. Glint's\n * `ModifierLike` is deliberately opaque -- it exists to keep a modifier from\n * being invoked as a plain function in application code -- so there is no\n * type-safe way to call through to it. This narrow, well-understood cast is\n * the exception: `modifier()` from `ember-modifier` returns the exact\n * function it was given. `ember-modifier`'s `dist/index.js` ends `modifier()`\n * with `return setModifierManager(() => MANAGER, fn);`. Its own comment there\n * calls the declared return type \"a *lie*\" -- that is about the TYPE, not the\n * runtime: `setModifierManager` delegates to `@glimmer/manager`'s\n * `setInternalModifierManager`, whose body is `map.set(obj, manager), obj`,\n * so it really does hand back the same `fn`. At runtime `p.trigger` *is*\n * that function. `(el, positional, named) => teardown` is how\n * `Popover`'s own `trigger` is declared.\n *\n * WARNING FOR A FUTURE UPGRADER: this cast is verified against\n * `ember-modifier@4.3.0`'s *function-based* modifier manager, whose\n * `createModifier`/`updateModifier`/`installModifier` call the given function\n * directly as `instance(element, positional, named)` -- i.e. the manager adds\n * no wrapping of its own, so invoking `p.trigger`/`p.anchor` here as plain\n * functions is genuinely calling the same code the manager would call.\n * `ModifierLike` has no call signature *by design* (it exists specifically to\n * stop application code from doing this), so there is no type-safe\n * alternative to the cast. A major `ember-modifier` upgrade could change the\n * manager's calling convention (or start wrapping the function) with no\n * compiler signal at this cast site -- re-verify against the new\n * `dist/index.js` before assuming this still holds. The runtime `assert`\n * calls at the call sites below exist so a break here fails loudly (a thrown\n * dev-mode assertion) instead of silently (a tooltip that never opens).\n */\ntype PopoverTriggerFn = (\n element: HTMLElement,\n positional: ['hover'],\n named: { aria: 'describedby' }\n) => void | (() => void);\n\n/**\n * `p.anchor` (`Velcro`'s `hook`) needs the same runtime call-through as\n * `p.trigger` above -- it is what makes `velcro.loop`/`p.Content`'s `@loop`\n * resolve at all. A consumer normally applies `{{p.anchor}}` and\n * `{{p.trigger}}` as two separate modifiers on the trigger element (see\n * `popover-test.gts`); a tooltip's single yielded `t.trigger` has to install\n * both. Same upgrade warning as `PopoverTriggerFn` above: `ember-velcro`'s\n * `hook` is built with the identical `setModifierManager(() => MANAGER, fn)`\n * pattern, so the same function-based-modifier assumption applies here too.\n */\ntype PopoverAnchorFn = (\n element: HTMLElement | SVGElement\n) => void | (() => void);\n\n/**\n * A modifier value that will be invoked directly as a function rather than\n * applied in a template. See `PopoverTriggerFn` for why that is sound and\n * what has to be re-verified on an `ember-modifier` upgrade. Stands in for\n * `p.anchor`/`p.trigger` wherever this file only needs to cache and compare\n * their identity (not call them) -- the actual call sites still narrow to\n * `PopoverAnchorFn`/`PopoverTriggerFn` via the existing documented casts.\n */\ntype CallableModifier = object;\n\ninterface TooltipSignature {\n Args: {\n /**\n * The tooltip's text. A shorthand for the common case; pass a `Content`\n * block instead when the tooltip needs markup. Passing both asserts.\n */\n content?: string;\n\n /**\n * The requested placement of the tooltip relative to its trigger. This is\n * a preference, not a guarantee: the flip middleware may resolve it to\n * the opposite side when there is no room for it in the requested spot.\n *\n * @defaultValue 'top'\n */\n placement?: PopoverSignature['Args']['placement'];\n\n /**\n * Renders an arrow pointing at the trigger.\n *\n * @defaultValue false\n */\n arrow?: boolean;\n\n /**\n * The tooltip's size, which scales its padding and label text.\n *\n * @defaultValue 'md'\n */\n size?: TooltipVariants['size'];\n\n /**\n * The tooltip's semantic color role. The arrow inherits the body's\n * background, so it follows the chosen intent automatically.\n *\n * @defaultValue 'neutral'\n */\n color?: TooltipVariants['color'];\n\n /**\n * Milliseconds before opening on hover or keyboard focus.\n *\n * @defaultValue 200\n */\n openDelay?: number;\n\n /**\n * Milliseconds before closing. Also the window the pointer has to cross\n * the gap into the tooltip, so a very small value makes the tooltip\n * effectively non-interactive.\n *\n * @defaultValue 150\n */\n closeDelay?: number;\n\n /**\n * Closes as soon as the pointer leaves the trigger, rather than letting it\n * move onto the tooltip.\n *\n * @defaultValue false\n */\n disableInteractive?: boolean;\n\n /**\n * Installs the trigger but never opens. For a tooltip whose text is\n * conditionally irrelevant.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /**\n * Whether the tooltip is open. Pair with `onOpenChange` to control it;\n * leave it unset to let the tooltip manage its own state. Passing\n * `isOpen` alone, without `onOpenChange`, falls back to uncontrolled\n * behavior.\n */\n isOpen?: boolean;\n\n /**\n * Callback when the tooltip opens or closes, receiving the new state.\n */\n onOpenChange?: (isOpen: boolean) => void;\n\n /**\n * Callback when closing has finished, including any exit transition.\n */\n didClose?: () => void;\n\n /**\n * The gap, in pixels, between the trigger and the tooltip. The default\n * leaves room for the arrow when `@arrow` is enabled.\n *\n * @defaultValue 8\n */\n offsetOptions?: PopoverSignature['Args']['offsetOptions'];\n\n /**\n * Options for the floating-ui flip middleware, which moves the tooltip\n * to the opposite side when it would overflow the viewport. Forwarded\n * to the underlying `Popover`.\n */\n flipOptions?: PopoverSignature['Args']['flipOptions'];\n\n /**\n * Options for the floating-ui shift middleware, which nudges the\n * tooltip along its axis to keep it in view. Forwarded to the\n * underlying `Popover`.\n */\n shiftOptions?: PopoverSignature['Args']['shiftOptions'];\n\n /**\n * Additional floating-ui middleware, for positioning behavior beyond\n * what `placement`, `offsetOptions`, `flipOptions`, and `shiftOptions`\n * cover. Forwarded to the underlying `Popover`.\n */\n middleware?: PopoverSignature['Args']['middleware'];\n\n /**\n * The CSS positioning strategy, forwarded to the underlying\n * `Popover`/floating-ui.\n *\n * @defaultValue 'absolute'\n */\n strategy?: PopoverSignature['Args']['strategy'];\n\n /**\n * Custom class for the tooltip, merged with the theme's using Tailwind\n * Merge.\n */\n class?: string;\n\n /**\n * Class names for each slot, merged with the theme's.\n */\n classes?: SlotsToClasses<TooltipSlots>;\n };\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n /**\n * The modifier to apply to the element the tooltip describes. Installs\n * the hover/focus listeners that open and close the tooltip, and keeps\n * `aria-describedby` in sync while it does.\n */\n trigger: ModifierLike<{ Element: HTMLElement }>;\n Content: WithBoundArgs<\n typeof TooltipContent,\n | 'PopoverContent'\n | 'classNames'\n | 'arrow'\n | 'disableInteractive'\n | 'hasContentArg'\n >;\n\n /**\n * Whether the tooltip is currently open.\n */\n isOpen: boolean;\n\n /**\n * Opens the tooltip.\n */\n open: () => void;\n\n /**\n * Closes the tooltip.\n */\n close: () => void;\n }\n ];\n };\n}\n\nclass Tooltip extends Component<TooltipSignature> {\n get classNames() {\n const { tooltip } = useStyles();\n\n const { base, arrow } = tooltip({\n size: this.args.size,\n color: this.args.color\n });\n\n return {\n base: base({ class: [this.args.classes?.base, this.args.class] }),\n arrow: arrow({ class: this.args.classes?.arrow })\n };\n }\n\n get placement(): PopoverSignature['Args']['placement'] {\n return this.args.placement ?? 'top';\n }\n\n get offsetOptions() {\n return this.args.offsetOptions ?? 8;\n }\n\n get openDelay(): number {\n return typeof this.args.openDelay === 'number' ? this.args.openDelay : 200;\n }\n\n get closeDelay(): number {\n return typeof this.args.closeDelay === 'number'\n ? this.args.closeDelay\n : 150;\n }\n\n /**\n * `p.trigger` cannot be curried in a `.gts` template with the template's\n * `(modifier ...)` keyword: even binding a single positional argument onto\n * a wrapper modifier -- whatever its declared type -- makes Glint's\n * `--declaration` pass fail with \"Type instantiation is excessively deep\n * and possibly infinite\" (reproduces the same way typed as `unknown`).\n * Applying a modifier directly (`{{this.someModifier someArg}}`) type-checks\n * fine; it is specifically the currying keyword's overload resolution that\n * Glint chokes on, matching the brief's anticipated fallback: build the\n * bound modifier value from plain JS instead of templated currying.\n *\n * `modifier()` from `ember-modifier` returns the exact function it is\n * given, with only a modifier manager attached out of band (see its\n * `dist/index.js`: `setModifierManager(() => MANAGER, fn); return fn;`),\n * and `ember-velcro`'s `hook` (`p.anchor`) is built the same way. So both\n * `p.anchor` and `p.trigger` are, at runtime, genuinely just those\n * functions -- calling them directly from plain JS is well-defined, even\n * though Glint's opaque `ModifierLike` intentionally exposes no call\n * signature for either.\n *\n * `t.trigger` has to install *both*: a tooltip's trigger element is also\n * its `Velcro` anchor. A normal `Popover` consumer applies `{{p.anchor}}`\n * and `{{p.trigger}}` as two separate modifiers on the same element (see\n * `popover-test.gts`); missing the anchor doesn't fail loudly by itself --\n * it just leaves `velcro.loop` (and so `p.Content`'s `@loop`) undefined,\n * which then asserts inside `Content`.\n *\n * Memoized on the `(anchor, trigger)` pair's identity (both stable for a\n * given `Popover` instance, since `Popover`/`Velcro` each assign their\n * fields once) so `t.trigger` keeps a stable identity across re-renders\n * instead of tearing down and reinstalling on every one.\n *\n * `@isDisabled` is read *inside* the installed function below, rather than\n * baked into this cache -- deliberately. `modifier()`'s function autotracks:\n * reading `this.args.isDisabled` there is what makes ember-modifier tear\n * down and reinstall the trigger's listeners when it changes, without\n * needing a new outer modifier identity (so the element itself is never\n * remounted). The brief's sketch instead made `@isDisabled` an unreachable\n * `openDelay` (`Number.MAX_SAFE_INTEGER`) passed through to `Popover`. That\n * does not work: `@ember/test-helpers`' `settled()` -- which every\n * `await triggerEvent(...)` calls internally -- waits on\n * `backburner.hasTimers()`, which is true for *any* pending `later()` call\n * no matter how far in the future, so a `mouseenter` scheduling an\n * effectively-infinite open left every subsequent `await` hanging until\n * the QUnit test timeout (confirmed: the test hung at exactly 60000ms).\n * Skipping the hover installation entirely while disabled avoids ever\n * scheduling that timer in the first place.\n *\n * ANCHOR CHURN GUARD: the wrapper function below reads `this.isOpen`\n * *transitively* -- not directly, but through `trigger`'s own autotracking\n * of `aria-describedby` -- so `ember-modifier` tears the whole wrapper down\n * and reinstalls it on every open/close. Without a guard, that would call\n * `anchor(element)` again on every cycle, and `Velcro`'s `hook` reassigns\n * its own `@tracked hook` field each time it runs, which tears down and\n * restarts floating-ui's `autoUpdate` positioning loop for no reason -- a\n * normal `Popover` consumer never pays this cost, because there `anchor`\n * and `trigger` are two separate modifiers and `anchor`'s body reads\n * nothing tracked, so it installs once and never re-runs.\n *\n * The fix keys the anchor's lifecycle on the *element* in instance state\n * (`anchoredElement`/`anchorTeardown`), not on the wrapper modifier's own\n * re-run: `ensureAnchor` below only calls `anchor(element)` when the\n * element actually changes. The wrapper's own destructor -- called by\n * `ember-modifier` before *every* re-run, same-element re-runs included --\n * therefore does not tear the anchor down synchronously; it only tears\n * down `trigger` immediately (the half that legitimately needs to re-run on\n * every open/close -- that's what keeps `aria-describedby` in sync, and\n * Task 5 documented it as required for controlled mode) and *defers* the\n * anchor decision via `scheduleAnchorTeardownCheck`.\n *\n * FIX ROUND 2 -- the leak this guard introduced, and why a deferred check:\n * `ember-modifier` gives the destructor no way to tell \"about to re-run for\n * the same element\" apart from \"genuinely destroyed\" -- both call the same\n * returned closure. Guarding the anchor by comparing `element` identity (as\n * fix round 1 did) is correct for the re-run case but has no destructor\n * path left for the case where `element` is removed entirely while\n * `Tooltip` itself keeps living (e.g. `{{#if this.show}}<button\n * {{t.trigger}}>{{/if}}`) -- nothing ever calls `ensureAnchor` again to\n * notice the change, and `willDestroy` only runs when `Tooltip` itself is\n * torn down. `scheduleAnchorTeardownCheck`/`confirmAnchorTeardown` resolve\n * the ambiguity by deferring one runloop turn (`@ember/runloop`'s `next`):\n * if the wrapper re-runs for the same element, `ensureAnchor` cancels the\n * pending check synchronously, before it fires; if `element` was genuinely\n * removed, nothing cancels it and the anchor is torn down for real one turn\n * later. The anchor is therefore torn down in exactly three places:\n * `ensureAnchor` (a different element arrived), `confirmAnchorTeardown`\n * (the deferred check fired unchallenged), and `willDestroy` (the component\n * itself is destroyed) -- never synchronously inside the wrapper's own\n * destructor.\n */\n cachedTrigger?: {\n anchor: CallableModifier;\n trigger: CallableModifier;\n modifier: ModifierLike<{ Element: HTMLElement }>;\n };\n\n /**\n * The element the anchor is currently installed on, and the teardown\n * `anchor(element)` handed back for it. Lives on the component instance\n * (not in the modifier's own closure) so it survives every open/close\n * re-run of the wrapper modifier -- see the churn-guard note above.\n */\n anchoredElement?: HTMLElement | SVGElement;\n anchorTeardown?: () => void;\n\n /**\n * A scheduled-but-not-yet-confirmed anchor teardown, set by the wrapper\n * modifier's destructor (see `makeTrigger`) and cancelled by `ensureAnchor`\n * if the wrapper turns out to have just re-run for the same element.\n *\n * WHY THIS EXISTS: `ember-modifier` calls the wrapper's destructor before\n * *every* re-run (same-element open/close churn included) as well as on\n * genuine removal, and does not tell us which. So the destructor alone\n * cannot decide whether to tear the anchor down. Deferring the decision by\n * one runloop turn resolves the ambiguity: if the wrapper is only\n * re-running, `ensureAnchor` runs synchronously afterwards (same tick,\n * before the deferred check fires) and cancels this; if the element was\n * genuinely removed, nothing calls `ensureAnchor` again, so the deferred\n * check fires and the anchor is torn down for real.\n *\n * Scheduled with `@ember/runloop`'s `next`/`cancel`, like the rest of this\n * codebase's timer usage (see `popover.gts`'s `hoverTimer`), rather than a\n * bespoke `setTimeout`.\n */\n pendingAnchorTeardown?: {\n element: HTMLElement | SVGElement;\n timer: EmberTimer;\n };\n\n /**\n * Installs `anchor` on `element` only if it is not already installed\n * there. Called on every wrapper re-run (every open/close), but is a no-op\n * on all but the first call and any call where the element genuinely\n * changed.\n *\n * Declared as a regular (prototype) method rather than an arrow-function\n * class field -- unlike `makeTrigger`, it is only ever called as\n * `this.ensureAnchor(...)`, never passed by reference, so it doesn't need\n * per-instance `this`-binding. Living on the prototype also makes it the\n * one seam the test suite can wrap to count real anchor installations\n * (see `tooltip-test.gts`'s anchor-churn-guard test).\n */\n ensureAnchor(anchor: CallableModifier, element: HTMLElement | SVGElement) {\n // The wrapper modifier re-ran for this same element -- any anchor\n // teardown its destructor speculatively scheduled (see\n // `scheduleAnchorTeardownCheck`) is stale: the element didn't actually go\n // away, so cancel the pending check before it can fire.\n if (\n this.pendingAnchorTeardown &&\n this.pendingAnchorTeardown.element === element\n ) {\n cancel(this.pendingAnchorTeardown.timer);\n this.pendingAnchorTeardown = undefined;\n }\n\n if (this.anchoredElement === element) {\n return;\n }\n\n // A different element arrived (or this is the first install for this\n // wrapper): tear down whatever anchor is currently installed before\n // installing the new one, so we never leak a stale `autoUpdate` loop.\n this.anchorTeardown?.();\n\n assert(\n \"Expected `p.anchor` to be a callable function (ember-velcro's `hook`, built the same way `ember-modifier`'s `modifier()` builds a callable function-based modifier). If this fires, an `ember-modifier` or `ember-velcro` upgrade likely changed how modifier values are constructed -- see the `PopoverAnchorFn`/`PopoverTriggerFn` comments above.\",\n typeof anchor === 'function'\n );\n\n const teardown = (anchor as unknown as PopoverAnchorFn)(element);\n\n this.anchoredElement = element;\n this.anchorTeardown = teardown ?? undefined;\n }\n\n /**\n * Called from the wrapper modifier's destructor -- i.e. on *every*\n * re-run of the wrapper, not only on genuine removal of `element`. Defers\n * the decision by one runloop turn: schedules `confirmAnchorTeardown` via\n * `next()`, which only actually tears the anchor down if nothing cancels\n * it first. `ensureAnchor` (above) is what cancels it, synchronously,\n * within the same runloop turn, if the wrapper turns out to have simply\n * re-run for the same element.\n */\n scheduleAnchorTeardownCheck(element: HTMLElement | SVGElement) {\n // Superseding an earlier pending check for a different element should\n // not normally happen (a new one would already have been resolved by an\n // intervening `ensureAnchor` call), but cancel defensively rather than\n // leak the earlier timer.\n if (this.pendingAnchorTeardown) {\n cancel(this.pendingAnchorTeardown.timer);\n }\n\n const timer = next(() => this.confirmAnchorTeardown(element));\n this.pendingAnchorTeardown = { element, timer };\n }\n\n /**\n * Runs one runloop turn after the wrapper modifier's destructor scheduled\n * it. If it gets here at all (i.e. `ensureAnchor` did not cancel it in the\n * meantime), the wrapper never re-ran for `element` -- the element was\n * genuinely removed -- so the anchor installed on it is torn down for\n * real.\n */\n confirmAnchorTeardown(element: HTMLElement | SVGElement) {\n if (\n !this.pendingAnchorTeardown ||\n this.pendingAnchorTeardown.element !== element\n ) {\n // Already superseded/cancelled (or, in principle, stale) -- nothing to\n // do.\n return;\n }\n\n this.pendingAnchorTeardown = undefined;\n\n if (this.anchoredElement === element) {\n this.anchorTeardown?.();\n this.anchoredElement = undefined;\n this.anchorTeardown = undefined;\n }\n }\n\n willDestroy() {\n super.willDestroy();\n if (this.pendingAnchorTeardown) {\n cancel(this.pendingAnchorTeardown.timer);\n this.pendingAnchorTeardown = undefined;\n }\n this.anchorTeardown?.();\n this.anchoredElement = undefined;\n this.anchorTeardown = undefined;\n }\n\n makeTrigger = (\n anchor: CallableModifier,\n trigger: CallableModifier\n ): ModifierLike<{ Element: HTMLElement }> => {\n if (\n !this.cachedTrigger ||\n this.cachedTrigger.anchor !== anchor ||\n this.cachedTrigger.trigger !== trigger\n ) {\n this.cachedTrigger = {\n anchor,\n trigger,\n modifier: modifier((element: HTMLElement) => {\n this.ensureAnchor(anchor, element);\n\n if (this.args.isDisabled) {\n return undefined;\n }\n\n assert(\n \"Expected `p.trigger` to be a callable function (a modifier built by `ember-modifier`'s `modifier()`). If this fires, an `ember-modifier` upgrade likely changed how function-based modifiers are constructed -- see the `PopoverTriggerFn` comment above.\",\n typeof trigger === 'function'\n );\n\n const teardownTrigger = (trigger as unknown as PopoverTriggerFn)(\n element,\n ['hover'],\n { aria: 'describedby' }\n );\n\n // `ember-modifier` calls this destructor before *every* re-run --\n // including a same-element re-run driven by `this.isOpen` churn --\n // and on genuine removal of `element`, with no way to tell which\n // from here. The trigger half always tears down and reinstalls\n // (that's what keeps `aria-describedby` in sync). The anchor half\n // cannot follow the same rule -- unconditionally tearing it down\n // here would reintroduce the churn this guard exists to prevent --\n // so it's handled by deferred confirmation: `scheduleAnchorTeardownCheck`\n // only *actually* tears the anchor down one runloop turn later, and\n // only if `ensureAnchor` doesn't cancel it first because the\n // wrapper turned out to just be re-running for the same element.\n // See the doc comments on `pendingAnchorTeardown` /\n // `scheduleAnchorTeardownCheck` / `confirmAnchorTeardown` above.\n return () => {\n teardownTrigger?.();\n this.scheduleAnchorTeardownCheck(element);\n };\n }) as unknown as ModifierLike<{ Element: HTMLElement }>\n };\n }\n\n return this.cachedTrigger.modifier;\n };\n\n <template>\n <Popover\n @placement={{this.placement}}\n @offsetOptions={{this.offsetOptions}}\n @flipOptions={{@flipOptions}}\n @shiftOptions={{@shiftOptions}}\n @middleware={{@middleware}}\n @strategy={{@strategy}}\n @openDelay={{this.openDelay}}\n @closeDelay={{this.closeDelay}}\n @isOpen={{@isOpen}}\n @onOpenChange={{@onOpenChange}}\n @didClose={{@didClose}}\n as |p|\n >\n {{yield\n (hash\n trigger=(this.makeTrigger p.anchor p.trigger)\n isOpen=p.isOpen\n open=p.open\n close=p.close\n Content=(component\n TooltipContent\n PopoverContent=p.Content\n classNames=this.classNames\n arrow=@arrow\n disableInteractive=@disableInteractive\n hasContentArg=(if @content true false)\n )\n )\n }}\n\n {{#if @content}}\n <TooltipContent\n @PopoverContent={{p.Content}}\n @classNames={{this.classNames}}\n @arrow={{@arrow}}\n @disableInteractive={{@disableInteractive}}\n ...attributes\n >\n {{@content}}\n </TooltipContent>\n {{/if}}\n </Popover>\n </template>\n}\n\ninterface TooltipContentSignature {\n Args: {\n /**\n * @internal\n */\n PopoverContent: BoundPopoverContent;\n\n /**\n * @internal\n */\n classNames: { base: string; arrow: string };\n\n /**\n * @internal\n */\n arrow?: boolean;\n\n /**\n * @internal\n */\n disableInteractive?: boolean;\n\n /**\n * @internal\n * Set only on the bound `Content` yielded to the consumer. Lets this\n * component assert when it renders while `@content` is also in use --\n * a `Tooltip` cannot otherwise tell whether the consumer invoked the\n * yielded `Content` block.\n */\n hasContentArg?: boolean;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n/**\n * The tooltip's content. Configures `Popover.Content` for a tooltip: no focus\n * trap, no autofocus, no scroll lock, `role=\"tooltip\"`, and `tabindex=\"-1\"` so\n * it is never a tab stop -- `Overlay` sets `tabindex=\"0\"` but spreads\n * `...attributes` after it, so this wins.\n *\n * Its constructor also asserts that `@content` and a `<t.Content>` block are\n * never used together: `hasContentArg` is set only on the bound `Content`\n * yielded to the consumer (see `TooltipContentSignature['Args']`), so this\n * component renders with it `true` exactly when the consumer both passed\n * `@content` to `Tooltip` *and* invoked the yielded `Content` block. The\n * check has to live here, on the content side, rather than on `Tooltip`\n * itself, because a Glimmer component has no way to observe whether a\n * consumer invoked one of its yielded blocks -- `Tooltip` cannot tell\n * `<t.Content>` was used at all until this component actually renders.\n */\nclass TooltipContent extends Component<TooltipContentSignature> {\n constructor(owner: Owner, args: TooltipContentSignature['Args']) {\n super(owner, args);\n\n assert(\n '<Tooltip> received both @content and a <t.Content> block. Use one or the other.',\n !this.args.hasContentArg\n );\n }\n\n /**\n * `data-component`/`data-part` below are written before ...attributes, so\n * they flow through Popover.Content's own ...attributes forwarding onto\n * Overlay's rendered div and override its default data-component=\"overlay\"\n * -- the standard splattributes-override pattern Overlay's own template is\n * written to support (its literal data-component=\"overlay\" is likewise\n * placed before its own ...attributes). Tooltip has no element of its own:\n * its \"base\"/\"arrow\" slots render on the exact same portaled div\n * Overlay/Popover.Content own, so this is the only way to mark it\n * data-component=\"tooltip\" without touching overlay.gts/popover.gts, which\n * are out of scope for this migration.\n */\n <template>\n <@PopoverContent\n @class={{@classNames.base}}\n @arrowClass={{@classNames.arrow}}\n @arrow={{@arrow}}\n @disableInteractive={{@disableInteractive}}\n @transition={{hash name=\"overlay-transition--tooltip\"}}\n @blockScroll={{false}}\n @backdrop=\"none\"\n role=\"tooltip\"\n tabindex=\"-1\"\n data-component=\"tooltip\"\n data-part=\"base\"\n ...attributes\n >\n {{yield}}\n </@PopoverContent>\n </template>\n}\n\nexport { Tooltip, type TooltipSignature };\nexport default Tooltip;\n"],"names":["Tooltip","Component","classNames","tooltip","useStyles","base","arrow","size","args","color","class","classes","placement","offsetOptions","openDelay","closeDelay","cachedTrigger","anchoredElement","anchorTeardown","pendingAnchorTeardown","ensureAnchor","anchor","element","cancel","timer","undefined","assert","teardown","scheduleAnchorTeardownCheck","next","confirmAnchorTeardown","willDestroy","makeTrigger","trigger","modifier","isDisabled","teardownTrigger","aria","setComponentTemplate","precompileTemplate","strictMode","scope","Popover","hash","TooltipContent","constructor","owner","hasContentArg"],"mappings":";;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BC;AAOD;;;;;;;;;AASC;AAKD;;;;;;;AAOC;AAkLD,MAAMA,gBAAgBC,SAAA,CAAU;EAC9B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAS,GAAGC,SAAA,EAAA;IAEpB,MAAM;MAAEC,IAAI;AAAEC,MAAAA;KAAO,GAAGH,OAAA,CAAQ;AAC9BI,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AACnB,KAAA,CAAA;IAEA,OAAO;MACLJ,IAAA,EAAMA,IAAA,CAAK;AAAEK,QAAAA,KAAA,EAAO,CAAC,IAAI,CAACF,IAAI,CAACG,OAAO,EAAEN,IAAA,EAAM,IAAI,CAACG,IAAI,CAACE,KAAK;AAAE,OAAA,CAAA;MAC/DJ,KAAA,EAAOA,KAAA,CAAM;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAACF,IAAI,CAACG,OAAO,EAAEL;OAAM;KACjD;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C,KAAY,EAAEtC,IAAqC,EAAE;AAC/D,IAAA,KAAK,CAACsC,KAAA,EAAOtC,IAAA,CAAA;IAEbkB,MAAA,CACE,mFACA,CAAC,IAAI,CAAClB,IAAI,CAACuC,aAAa,CAAA;AAE5B,EAAA;AAEA;;;;;;;;;;;AAWC;AACD,EAAA;IAAAT,oBAAA,CAAAC,kBAAA,CAAA,iXAAA,EAiBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { useStyles } from '@frontile/theme';
3
- import { I as IconDanger, a as IconWarning, b as IconSuccess, c as IconInfo } from '../../intent-icons-DpEViO8C.js';
3
+ import { h as IconDanger, i as IconWarning, j as IconSuccess, k as IconInfo } from '../../icons-DZ61nCzv.js';
4
4
  import { CloseButton } from '../buttons/close-button.js';
5
5
  import { precompileTemplate } from '@ember/template-compilation';
6
6
  import { setComponentTemplate } from '@ember/component';
@@ -46,10 +46,15 @@ const STATUS_CONFIG = {
46
46
  };
47
47
  /**
48
48
  * `true` when either half of a content pair is present. Used for
49
- * `(or @description (has-block "description"))` in the template, since
50
- * `has-block` is a template-only keyword and cannot be read from JS.
49
+ * `(hasEither @description (has-block "description"))` in the template,
50
+ * since `has-block` is a template-only keyword and cannot be read from JS.
51
+ *
52
+ * Named to avoid `ember-source`'s built-in `{{or}}` keyword, which always
53
+ * shadows a same-named local identifier in curly-parens position and would
54
+ * otherwise silently take over the call, returning `string | boolean`
55
+ * instead of the strict `boolean` `classNames` requires.
51
56
  */
52
- function or(arg1, arg2) {
57
+ function hasEither(arg1, arg2) {
53
58
  return !!(arg1 || arg2);
54
59
  }
55
60
  /**
@@ -136,10 +141,10 @@ class Alert extends Component {
136
141
  };
137
142
  };
138
143
  static {
139
- setComponentTemplate(precompileTemplate("{{#let (or @description (has-block \"description\")) as |hasDescription|}}\n {{#let (this.classNames hasDescription) as |classNames|}}\n <div class={{classNames.base}} role={{this.role}} data-component=\"alert\" data-part=\"base\" data-test-status={{this.status}} ...attributes>\n <div class={{classNames.inner}} data-part=\"inner\">\n {{#unless @hideIcon}}\n {{#if (has-block \"icon\")}}\n <span class={{classNames.icon}} data-part=\"icon\">\n {{yield to=\"icon\"}}\n </span>\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon class={{classNames.icon}} data-part=\"icon\" />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div class={{classNames.content}} data-part=\"content\">\n {{#if (has-block \"title\")}}\n <div class={{classNames.title}} data-part=\"title\">\n {{yield to=\"title\"}}\n </div>\n {{else if @title}}\n <div class={{classNames.title}} data-part=\"title\">\n {{@title}}\n </div>\n {{/if}}\n\n {{#if (has-block \"description\")}}\n <div class={{classNames.description}} data-part=\"description\">\n {{yield to=\"description\"}}\n </div>\n {{else if @description}}\n <div class={{classNames.description}} data-part=\"description\">\n {{@description}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"actions\")}}\n <div class={{classNames.actions}} data-part=\"actions\">\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @onClose}}\n <CloseButton @onPress={{@onClose}} @size=\"sm\" @title={{@closeButtonTitle}} @class={{classNames.closeButton}} data-part=\"close-button\" />\n {{/if}}\n </div>\n </div>\n {{/let}}\n{{/let}}", {
144
+ setComponentTemplate(precompileTemplate("{{#let (hasEither @description (has-block \"description\")) as |hasDescription|}}\n {{#let (this.classNames hasDescription) as |classNames|}}\n <div class={{classNames.base}} role={{this.role}} data-component=\"alert\" data-part=\"base\" data-test-status={{this.status}} ...attributes>\n <div class={{classNames.inner}} data-part=\"inner\">\n {{#unless @hideIcon}}\n {{#if (has-block \"icon\")}}\n <span class={{classNames.icon}} data-part=\"icon\">\n {{yield to=\"icon\"}}\n </span>\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon class={{classNames.icon}} data-part=\"icon\" />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div class={{classNames.content}} data-part=\"content\">\n {{#if (has-block \"title\")}}\n <div class={{classNames.title}} data-part=\"title\">\n {{yield to=\"title\"}}\n </div>\n {{else if @title}}\n <div class={{classNames.title}} data-part=\"title\">\n {{@title}}\n </div>\n {{/if}}\n\n {{#if (has-block \"description\")}}\n <div class={{classNames.description}} data-part=\"description\">\n {{yield to=\"description\"}}\n </div>\n {{else if @description}}\n <div class={{classNames.description}} data-part=\"description\">\n {{@description}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"actions\")}}\n <div class={{classNames.actions}} data-part=\"actions\">\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @onClose}}\n <CloseButton @onPress={{@onClose}} @size=\"sm\" @title={{@closeButtonTitle}} @class={{classNames.closeButton}} data-part=\"close-button\" />\n {{/if}}\n </div>\n </div>\n {{/let}}\n{{/let}}", {
140
145
  strictMode: true,
141
146
  scope: () => ({
142
- or,
147
+ hasEither,
143
148
  CloseButton
144
149
  })
145
150
  }), this);
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sources":["../../../src/components/status/alert.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport type { AlertSlots, SlotsToClasses } from '@frontile/theme';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/intent-icons';\nimport { CloseButton } from '../buttons/close-button';\n\ntype AlertStatus = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n\n/**\n * Everything about an status that this component decides, keyed in one place\n * — the same shape NotificationCard's own table uses — so the icon map and\n * the role cascade cannot drift apart.\n *\n * Colour is deliberately not here: it belongs to the `alert` recipe in\n * `@frontile/theme`, whose `status` variant and compound variants carry it.\n * So a new status means a row here *and* rows there; neither table can be\n * derived from the other, since one holds components and the other holds\n * Tailwind classes.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This is why the prop is\n // `@status` and not `@color`: the value picks an ARIA role, not\n // just a colour.\n role: 'status'\n },\n // Formerly `info`, which painted `primary`'s classes already. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n role: 'alert'\n }\n} as const satisfies Record<\n AlertStatus,\n {\n icon: unknown;\n role: 'status' | 'alert';\n }\n>;\n\n/**\n * `true` when either half of a content pair is present. Used for\n * `(or @description (has-block \"description\"))` in the template, since\n * `has-block` is a template-only keyword and cannot be read from JS.\n */\nfunction or(arg1: unknown, arg2: unknown): boolean {\n return !!(arg1 || arg2);\n}\n\ninterface AlertSignature {\n Args: {\n /**\n * The alert's heading. Ignored when a `title` block is passed.\n */\n title?: string;\n\n /**\n * The supporting copy under the title. Ignored when a `description`\n * block is passed — use the block for anything that needs markup, such\n * as a list or a link.\n */\n description?: string;\n\n /**\n * The status of the alert, which drives its colour, its default icon,\n * and its default ARIA role.\n *\n * @defaultValue 'default'\n */\n status?: AlertStatus;\n\n /**\n * The visual style of the alert.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * `banner` drops the radius and border and centres the content, for a\n * full-bleed announcement bar spanning its container — a notice under a\n * Drawer's header, say.\n *\n * Width is not what this controls: an Alert is `w-full` in either layout.\n * A banner's close button is pinned to the trailing edge rather than sitting\n * in the row, so the centred text does not shift when it is present.\n *\n * @defaultValue 'inline'\n */\n layout?: 'inline' | 'banner';\n\n /**\n * Removes the icon. Wins over the `icon` block if both are supplied.\n *\n * @defaultValue false\n */\n hideIcon?: boolean;\n\n /**\n * Called when the close button is pressed. Passing this argument is what\n * reveals the close button.\n *\n * Alert does not hide itself — the consumer removes it from the DOM, so\n * showing it again, animating it out, or persisting the dismissal are all\n * the application's to decide.\n */\n onClose?: () => void;\n\n /**\n * The accessible name of the close button. Worth setting when several\n * alerts sit together, since every close button would otherwise be\n * announced as just \"Close\" without saying what is being dismissed.\n *\n * @defaultValue 'Close'\n */\n closeButtonTitle?: string;\n\n /**\n * Overrides the ARIA role, which otherwise comes from `@status`:\n * `warning` and `danger` render `role=\"alert\"`, every other status\n * renders `role=\"status\"`.\n *\n * That default suits an alert *inserted* in response to an event. Use\n * `'none'` for one present in the DOM at first paint, where a live\n * region announces nothing useful and `alert` can interrupt a screen\n * reader mid-page.\n */\n role?: 'alert' | 'status' | 'none';\n\n /**\n * Custom class name, it will override the default ones using Tailwind\n * Merge library.\n */\n class?: string;\n\n /**\n * Custom CSS classes for styling the individual slots.\n */\n classes?: SlotsToClasses<AlertSlots>;\n };\n Blocks: {\n /** Replaces the default status glyph. Ignored when `@hideIcon` is set. */\n icon: [];\n\n /** Overrides `@title`. */\n title: [];\n\n /** Overrides `@description`. Takes markup. */\n description: [];\n\n /**\n * Buttons, rendered in a row between the content and the close button.\n */\n actions: [];\n };\n Element: HTMLDivElement;\n}\n\n/**\n * Displays an important message inline in the page.\n *\n * The static counterpart to `NotificationCard`: same statuses and visual\n * recipes, but rendered as part of the page rather than pushed through the\n * notifications service.\n */\nclass Alert extends Component<AlertSignature> {\n get status(): AlertStatus {\n return this.args.status ?? 'neutral';\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n /**\n * `undefined` for `'none'`, which makes Glimmer omit the attribute rather\n * than render `role=\"none\"` — an actual ARIA role meaning \"presentational\",\n * which is not what is wanted here.\n */\n get role(): 'alert' | 'status' | undefined {\n const { role } = this.args;\n\n if (role === 'none') {\n return undefined;\n }\n\n return role ?? STATUS_CONFIG[this.status].role;\n }\n\n /**\n * A method rather than a getter because `hasDescription` can only be\n * determined in the template — `has-block` is a template keyword with no\n * JS equivalent — and it drives the icon's optical alignment.\n */\n classNames = (hasDescription: boolean) => {\n const { alert } = useStyles();\n const { classes } = this.args;\n\n const {\n base,\n inner,\n icon,\n content,\n title,\n description,\n actions,\n closeButton\n } = alert({\n status: this.status,\n variant: this.args.variant ?? 'surface',\n layout: this.args.layout ?? 'inline',\n hasDescription,\n hasCloseButton: !!this.args.onClose\n });\n\n return {\n base: base({ class: [classes?.base, this.args.class] }),\n inner: inner({ class: classes?.inner }),\n icon: icon({ class: classes?.icon }),\n content: content({ class: classes?.content }),\n title: title({ class: classes?.title }),\n description: description({ class: classes?.description }),\n actions: actions({ class: classes?.actions }),\n closeButton: closeButton({ class: classes?.closeButton })\n };\n };\n\n <template>\n {{#let (or @description (has-block \"description\")) as |hasDescription|}}\n {{#let (this.classNames hasDescription) as |classNames|}}\n <div\n class={{classNames.base}}\n role={{this.role}}\n data-component=\"alert\"\n data-part=\"base\"\n data-test-status={{this.status}}\n ...attributes\n >\n <div class={{classNames.inner}} data-part=\"inner\">\n {{#unless @hideIcon}}\n {{#if (has-block \"icon\")}}\n <span class={{classNames.icon}} data-part=\"icon\">\n {{yield to=\"icon\"}}\n </span>\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon class={{classNames.icon}} data-part=\"icon\" />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div class={{classNames.content}} data-part=\"content\">\n {{#if (has-block \"title\")}}\n <div class={{classNames.title}} data-part=\"title\">\n {{yield to=\"title\"}}\n </div>\n {{else if @title}}\n <div class={{classNames.title}} data-part=\"title\">\n {{@title}}\n </div>\n {{/if}}\n\n {{#if (has-block \"description\")}}\n <div class={{classNames.description}} data-part=\"description\">\n {{yield to=\"description\"}}\n </div>\n {{else if @description}}\n <div class={{classNames.description}} data-part=\"description\">\n {{@description}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"actions\")}}\n <div class={{classNames.actions}} data-part=\"actions\">\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @onClose}}\n <CloseButton\n @onPress={{@onClose}}\n @size=\"sm\"\n @title={{@closeButtonTitle}}\n @class={{classNames.closeButton}}\n data-part=\"close-button\"\n />\n {{/if}}\n </div>\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n\nexport { Alert, type AlertSignature };\nexport default Alert;\n"],"names":["STATUS_CONFIG","neutral","icon","IconInfo","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","or","arg1","arg2","Alert","Component","status","args","undefined","classNames","hasDescription","alert","useStyles","classes","base","inner","content","title","description","actions","closeButton","variant","layout","hasCloseButton","onClose","class","setComponentTemplate","precompileTemplate","strictMode","scope","CloseButton"],"mappings":";;;;;;;AAaA;;;;;;;;;;AAUC;AACD,MAAMA,aAAA,GAAgB;AACpBC,EAAAA,OAAA,EAAS;AACPC,IAAAA,IAAA,EAAMC,QAAA;AACN;AACA;AACA;AACA;AACAC,IAAAA,IAAA,EAAM;GACR;AACA;AACA;AACAC,EAAAA,OAAA,EAAS;AACPH,IAAAA,IAAA,EAAMC,QAAA;AACNC,IAAAA,IAAA,EAAM;GACR;AACAE,EAAAA,OAAA,EAAS;AACPJ,IAAAA,IAAA,EAAMK,WAAA;AACNH,IAAAA,IAAA,EAAM;GACR;AACAI,EAAAA,OAAA,EAAS;AACPN,IAAAA,IAAA,EAAMO,WAAA;AACNL,IAAAA,IAAA,EAAM;GACR;AACAM,EAAAA,MAAA,EAAQ;AACNR,IAAAA,IAAA,EAAMS,UAAA;AACNP,IAAAA,IAAA,EAAM;AACR;AACF;AAQA;;;;;AAKA,SAASQ,GAAGC,IAAa,EAAEC,IAAa,EAAU;AAChD,EAAA,OAAO,CAAC,EAAED,IAAA,IAAQC,IAAI,CAAA;AACxB;AA+GA;;;;;;;AAOA,MAAMC,cAAcC,SAAA,CAAU;EAC5B,IAAIC,SAAsB;AACxB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC7B,EAAA;EAEA,IAAIf,IAAAA,GAAO;AACT,IAAA,OAAOF,aAAa,CAAC,IAAI,CAACiB,MAAM,CAAC,CAACf,IAAI;AACxC,EAAA;AAEA;;;;AAIC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KAAA,CAAM;QAAEQ,KAAA,EAAOZ,OAAA,EAASI;AAAM,OAAA,CAAA;MACrCC,WAAA,EAAaA,WAAA,CAAY;QAAEO,KAAA,EAAOZ,OAAA,EAASK;AAAY,OAAA,CAAA;MACvDC,OAAA,EAASA,OAAA,CAAQ;QAAEM,KAAA,EAAOZ,OAAA,EAASM;AAAQ,OAAA,CAAA;MAC3CC,WAAA,EAAaA,WAAA,CAAY;QAAEK,KAAA,EAAOZ,OAAA,EAASO;OAAY;KACzD;EACF,CAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,05DAAA,EAiEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAA5B,EAAA;AAAA6B,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"alert.js","sources":["../../../src/components/status/alert.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport type { AlertSlots, SlotsToClasses } from '@frontile/theme';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/icons';\nimport { CloseButton } from '../buttons/close-button';\n\ntype AlertStatus = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n\n/**\n * Everything about an status that this component decides, keyed in one place\n * — the same shape NotificationCard's own table uses — so the icon map and\n * the role cascade cannot drift apart.\n *\n * Colour is deliberately not here: it belongs to the `alert` recipe in\n * `@frontile/theme`, whose `status` variant and compound variants carry it.\n * So a new status means a row here *and* rows there; neither table can be\n * derived from the other, since one holds components and the other holds\n * Tailwind classes.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This is why the prop is\n // `@status` and not `@color`: the value picks an ARIA role, not\n // just a colour.\n role: 'status'\n },\n // Formerly `info`, which painted `primary`'s classes already. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n role: 'alert'\n }\n} as const satisfies Record<\n AlertStatus,\n {\n icon: unknown;\n role: 'status' | 'alert';\n }\n>;\n\n/**\n * `true` when either half of a content pair is present. Used for\n * `(hasEither @description (has-block \"description\"))` in the template,\n * since `has-block` is a template-only keyword and cannot be read from JS.\n *\n * Named to avoid `ember-source`'s built-in `{{or}}` keyword, which always\n * shadows a same-named local identifier in curly-parens position and would\n * otherwise silently take over the call, returning `string | boolean`\n * instead of the strict `boolean` `classNames` requires.\n */\nfunction hasEither(arg1: unknown, arg2: unknown): boolean {\n return !!(arg1 || arg2);\n}\n\ninterface AlertSignature {\n Args: {\n /**\n * The alert's heading. Ignored when a `title` block is passed.\n */\n title?: string;\n\n /**\n * The supporting copy under the title. Ignored when a `description`\n * block is passed — use the block for anything that needs markup, such\n * as a list or a link.\n */\n description?: string;\n\n /**\n * The status of the alert, which drives its colour, its default icon,\n * and its default ARIA role.\n *\n * @defaultValue 'default'\n */\n status?: AlertStatus;\n\n /**\n * The visual style of the alert.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * `banner` drops the radius and border and centres the content, for a\n * full-bleed announcement bar spanning its container — a notice under a\n * Drawer's header, say.\n *\n * Width is not what this controls: an Alert is `w-full` in either layout.\n * A banner's close button is pinned to the trailing edge rather than sitting\n * in the row, so the centred text does not shift when it is present.\n *\n * @defaultValue 'inline'\n */\n layout?: 'inline' | 'banner';\n\n /**\n * Removes the icon. Wins over the `icon` block if both are supplied.\n *\n * @defaultValue false\n */\n hideIcon?: boolean;\n\n /**\n * Called when the close button is pressed. Passing this argument is what\n * reveals the close button.\n *\n * Alert does not hide itself — the consumer removes it from the DOM, so\n * showing it again, animating it out, or persisting the dismissal are all\n * the application's to decide.\n */\n onClose?: () => void;\n\n /**\n * The accessible name of the close button. Worth setting when several\n * alerts sit together, since every close button would otherwise be\n * announced as just \"Close\" without saying what is being dismissed.\n *\n * @defaultValue 'Close'\n */\n closeButtonTitle?: string;\n\n /**\n * Overrides the ARIA role, which otherwise comes from `@status`:\n * `warning` and `danger` render `role=\"alert\"`, every other status\n * renders `role=\"status\"`.\n *\n * That default suits an alert *inserted* in response to an event. Use\n * `'none'` for one present in the DOM at first paint, where a live\n * region announces nothing useful and `alert` can interrupt a screen\n * reader mid-page.\n */\n role?: 'alert' | 'status' | 'none';\n\n /**\n * Custom class name, it will override the default ones using Tailwind\n * Merge library.\n */\n class?: string;\n\n /**\n * Custom CSS classes for styling the individual slots.\n */\n classes?: SlotsToClasses<AlertSlots>;\n };\n Blocks: {\n /** Replaces the default status glyph. Ignored when `@hideIcon` is set. */\n icon: [];\n\n /** Overrides `@title`. */\n title: [];\n\n /** Overrides `@description`. Takes markup. */\n description: [];\n\n /**\n * Buttons, rendered in a row between the content and the close button.\n */\n actions: [];\n };\n Element: HTMLDivElement;\n}\n\n/**\n * Displays an important message inline in the page.\n *\n * The static counterpart to `NotificationCard`: same statuses and visual\n * recipes, but rendered as part of the page rather than pushed through the\n * notifications service.\n */\nclass Alert extends Component<AlertSignature> {\n get status(): AlertStatus {\n return this.args.status ?? 'neutral';\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n /**\n * `undefined` for `'none'`, which makes Glimmer omit the attribute rather\n * than render `role=\"none\"` — an actual ARIA role meaning \"presentational\",\n * which is not what is wanted here.\n */\n get role(): 'alert' | 'status' | undefined {\n const { role } = this.args;\n\n if (role === 'none') {\n return undefined;\n }\n\n return role ?? STATUS_CONFIG[this.status].role;\n }\n\n /**\n * A method rather than a getter because `hasDescription` can only be\n * determined in the template — `has-block` is a template keyword with no\n * JS equivalent — and it drives the icon's optical alignment.\n */\n classNames = (hasDescription: boolean) => {\n const { alert } = useStyles();\n const { classes } = this.args;\n\n const {\n base,\n inner,\n icon,\n content,\n title,\n description,\n actions,\n closeButton\n } = alert({\n status: this.status,\n variant: this.args.variant ?? 'surface',\n layout: this.args.layout ?? 'inline',\n hasDescription,\n hasCloseButton: !!this.args.onClose\n });\n\n return {\n base: base({ class: [classes?.base, this.args.class] }),\n inner: inner({ class: classes?.inner }),\n icon: icon({ class: classes?.icon }),\n content: content({ class: classes?.content }),\n title: title({ class: classes?.title }),\n description: description({ class: classes?.description }),\n actions: actions({ class: classes?.actions }),\n closeButton: closeButton({ class: classes?.closeButton })\n };\n };\n\n <template>\n {{#let\n (hasEither @description (has-block \"description\"))\n as |hasDescription|\n }}\n {{#let (this.classNames hasDescription) as |classNames|}}\n <div\n class={{classNames.base}}\n role={{this.role}}\n data-component=\"alert\"\n data-part=\"base\"\n data-test-status={{this.status}}\n ...attributes\n >\n <div class={{classNames.inner}} data-part=\"inner\">\n {{#unless @hideIcon}}\n {{#if (has-block \"icon\")}}\n <span class={{classNames.icon}} data-part=\"icon\">\n {{yield to=\"icon\"}}\n </span>\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon class={{classNames.icon}} data-part=\"icon\" />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div class={{classNames.content}} data-part=\"content\">\n {{#if (has-block \"title\")}}\n <div class={{classNames.title}} data-part=\"title\">\n {{yield to=\"title\"}}\n </div>\n {{else if @title}}\n <div class={{classNames.title}} data-part=\"title\">\n {{@title}}\n </div>\n {{/if}}\n\n {{#if (has-block \"description\")}}\n <div class={{classNames.description}} data-part=\"description\">\n {{yield to=\"description\"}}\n </div>\n {{else if @description}}\n <div class={{classNames.description}} data-part=\"description\">\n {{@description}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"actions\")}}\n <div class={{classNames.actions}} data-part=\"actions\">\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @onClose}}\n <CloseButton\n @onPress={{@onClose}}\n @size=\"sm\"\n @title={{@closeButtonTitle}}\n @class={{classNames.closeButton}}\n data-part=\"close-button\"\n />\n {{/if}}\n </div>\n </div>\n {{/let}}\n {{/let}}\n </template>\n}\n\nexport { Alert, type AlertSignature };\nexport default Alert;\n"],"names":["STATUS_CONFIG","neutral","icon","IconInfo","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","hasEither","arg1","arg2","Alert","Component","status","args","undefined","classNames","hasDescription","alert","useStyles","classes","base","inner","content","title","description","actions","closeButton","variant","layout","hasCloseButton","onClose","class","setComponentTemplate","precompileTemplate","strictMode","scope","CloseButton"],"mappings":";;;;;;;AAaA;;;;;;;;;;AAUC;AACD,MAAMA,aAAA,GAAgB;AACpBC,EAAAA,OAAA,EAAS;AACPC,IAAAA,IAAA,EAAMC,QAAA;AACN;AACA;AACA;AACA;AACAC,IAAAA,IAAA,EAAM;GACR;AACA;AACA;AACAC,EAAAA,OAAA,EAAS;AACPH,IAAAA,IAAA,EAAMC,QAAA;AACNC,IAAAA,IAAA,EAAM;GACR;AACAE,EAAAA,OAAA,EAAS;AACPJ,IAAAA,IAAA,EAAMK,WAAA;AACNH,IAAAA,IAAA,EAAM;GACR;AACAI,EAAAA,OAAA,EAAS;AACPN,IAAAA,IAAA,EAAMO,WAAA;AACNL,IAAAA,IAAA,EAAM;GACR;AACAM,EAAAA,MAAA,EAAQ;AACNR,IAAAA,IAAA,EAAMS,UAAA;AACNP,IAAAA,IAAA,EAAM;AACR;AACF;AAQA;;;;;;;;;;AAUA,SAASQ,UAAUC,IAAa,EAAEC,IAAa,EAAU;AACvD,EAAA,OAAO,CAAC,EAAED,IAAA,IAAQC,IAAI,CAAA;AACxB;AA+GA;;;;;;;AAOA,MAAMC,cAAcC,SAAA,CAAU;EAC5B,IAAIC,SAAsB;AACxB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC7B,EAAA;EAEA,IAAIf,IAAAA,GAAO;AACT,IAAA,OAAOF,aAAa,CAAC,IAAI,CAACiB,MAAM,CAAC,CAACf,IAAI;AACxC,EAAA;AAEA;;;;AAIC;E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AA,CAAM;QAAEQ,KAAA,EAAOZ,OAAA,EAASI;AAAM,OAAA,CAAA;MACrCC,WAAA,EAAaA,WAAA,CAAY;QAAEO,KAAA,EAAOZ,OAAA,EAASK;AAAY,OAAA,CAAA;MACvDC,OAAA,EAASA,OAAA,CAAQ;QAAEM,KAAA,EAAOZ,OAAA,EAASM;AAAQ,OAAA,CAAA;MAC3CC,WAAA,EAAaA,WAAA,CAAY;QAAEK,KAAA,EAAOZ,OAAA,EAASO;OAAY;KACzD;EACF,CAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,i6DAAA,EAoEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAA5B,SAAA;AAAA6B,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.js","sources":["../../../src/components/status/progress-bar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { htmlSafe } from '@ember/template';\nimport type { SafeString } from '@ember/template';\nimport { guidFor } from '@ember/object/internals';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface ProgressBarSignature {\n Args: {\n /**\n * The color of the progress bar\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the progress bar\n */\n size?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * The radius the progress bar\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * The current progress value\n */\n progress?: number;\n\n /**\n *\n * The smallest value allowed for the input\n *\n * @defaultValue 0\n */\n minValue?: number;\n\n /**\n *\n * The largest value allowed for the input\n *\n *@defaultValue 100\n */\n maxValue?: number;\n\n /**\n * Whether presentation is indeterminate when progress isn't known.\n *\n * @defaultValue false\n */\n isIndeterminate?: boolean;\n\n /**\n * The content to display as the label.\n */\n label?: string;\n\n /**\n * The content to display as the value's label (e.g. 1 of 4).\n */\n valueLabel?: string;\n\n /**\n * Whether the value's label is displayed.\n * True by default if there's a label, false by default if not.\n */\n showValueLabel?: boolean;\n\n /**\n * The display format of the value, passed to `Intl.NumberFormat`.\n *\n * A `percent` style formats the position on the min/max scale as a\n * fraction; every other style formats the raw `progress` value. With no\n * format options, the value is displayed as a whole percentage.\n */\n formatOptions?: Intl.NumberFormatOptions;\n\n /**\n * The content to display as the description.\n */\n description?: string;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nclass ProgressBar extends Component<ProgressBarSignature> {\n id = guidFor(this);\n\n get classNames() {\n const { progressBar } = useStyles();\n\n const { base, progress, label, description } = progressBar({\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'ProgressBar',\n from: 'intent',\n to: 'color',\n id: 'frontile.progress-bar.intent'\n }\n ) || 'neutral',\n size: this.args.size,\n radius: this.args.radius,\n isIndeterminate: this.args.isIndeterminate\n });\n\n return {\n base: base({ class: this.args.class }),\n progress: progress(),\n label: label(),\n description: description()\n };\n }\n\n get minValue(): number {\n return this.args.minValue ?? 0;\n }\n\n get maxValue(): number {\n return this.args.maxValue ?? 100;\n }\n\n /**\n * `@progress={{0}}` is a legitimate value, so this falls back to `minValue`\n * only when nothing was passed — a truthiness check would report the bar as\n * already at the bottom of the scale instead of at zero.\n */\n get progress(): number {\n return this.args.progress ?? this.minValue;\n }\n\n /**\n * The position on the scale as 0–100. Clamped, because the result drives an\n * inline `width` — an out-of-range or `NaN` percentage is dropped by the CSS\n * parser, which renders as a silently empty bar rather than as an error.\n * A non-positive range has no meaningful position, so it reports 0.\n */\n get percentage(): number {\n const range = this.maxValue - this.minValue;\n if (range <= 0) {\n return 0;\n }\n\n const percentage = ((this.progress - this.minValue) / range) * 100;\n\n return Math.min(100, Math.max(0, percentage));\n }\n\n get showValueLabel(): boolean {\n if (typeof this.args.showValueLabel !== 'undefined') {\n return this.args.showValueLabel;\n }\n\n return !!this.args.label;\n }\n\n get formattedValueLabel(): string {\n // check if the value label should not be shown\n if (!this.showValueLabel || this.args.isIndeterminate) {\n return '';\n }\n\n // if @labelValue is provided use it\n if (this.args.valueLabel) {\n return this.args.valueLabel;\n }\n\n // if format options are provided\n if (this.args.formatOptions) {\n const options: Intl.NumberFormatOptions = {\n ...(this.args.formatOptions || {})\n };\n\n // `Intl` scales a `percent` style by 100 itself, so it has to be handed\n // the fraction of the min–max range — passing the already-scaled\n // percentage announces `@progress={{50}}` as \"5,000%\". Every other style\n // (`decimal`, `currency`, `unit`) formats the raw value on its own scale.\n const value =\n options.style === 'percent' ? this.percentage / 100 : this.progress;\n\n // `navigator` is a browser global with no counterpart in Node, so a bare\n // `navigator?.language` is a hard `ReferenceError` rather than\n // `undefined` when a ProgressBar is server-rendered.\n const locale =\n typeof navigator !== 'undefined' ? navigator.language : undefined;\n\n return new Intl.NumberFormat(locale || 'en-US', options).format(value);\n }\n\n return this.percentage.toFixed(0) + '%';\n }\n\n /**\n * ARIA requires aria-valuenow to be absent when the value is unknown —\n * reporting a number would announce \"0%\" rather than \"amount unknown\".\n *\n * Otherwise it is clamped to the scale, because assistive technology\n * announces a percentage computed from valuenow/valuemin/valuemax. Reporting\n * a raw 150 on a 0–100 scale would say \"150%\" to a screen-reader user while\n * the bar sits pinned at 100% for everyone else — the people who cannot see\n * the bar would be the only ones given the wrong number.\n */\n get ariaValueNow(): number | undefined {\n if (this.args.isIndeterminate) {\n return undefined;\n }\n\n return Math.min(this.maxValue, Math.max(this.minValue, this.progress));\n }\n\n get progressWidth(): SafeString {\n let percentage = this.percentage;\n if (this.args.isIndeterminate) {\n percentage = 50;\n }\n return htmlSafe(`width: ${percentage}%`);\n }\n\n <template>\n <div data-component=\"progress-bar\" ...attributes>\n {{#if @label}}\n <div data-part=\"label\" class={{this.classNames.label}}>\n <label id={{this.id}}>\n {{@label}}\n </label>\n {{#if this.showValueLabel}}\n <div>\n {{this.formattedValueLabel}}\n </div>\n {{/if}}\n </div>\n {{/if}}\n {{#if @description}}\n <div data-part=\"description\" class={{this.classNames.description}}>\n {{@description}}\n </div>\n {{/if}}\n <div data-part=\"base\" class={{this.classNames.base}}>\n <div\n role=\"progressbar\"\n data-part=\"progress\"\n aria-labelledby={{if @label this.id}}\n aria-valuenow={{this.ariaValueNow}}\n aria-valuemin={{this.minValue}}\n aria-valuemax={{this.maxValue}}\n class={{this.classNames.progress}}\n style={{this.progressWidth}}\n ></div>\n </div>\n </div>\n </template>\n}\n\nexport { ProgressBar, type ProgressBarSignature };\nexport default ProgressBar;\n"],"names":["ProgressBar","Component","id","guidFor","classNames","progressBar","useStyles","base","progress","label","description","color","renamedArgValue","args","intent","default","component","from","to","size","radius","isIndeterminate","class","minValue","maxValue","percentage","range","Math","min","max","showValueLabel","formattedValueLabel","valueLabel","formatOptions","options","value","style","locale","navigator","language","undefined","Intl","NumberFormat","format","toFixed","ariaValueNow","progressWidth","htmlSafe","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;;AAgHA,MAAMA,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,EAAA,GAAKC,OAAA,CAAQ,IAAI,CAAA;EAEjB,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAAK;AAAEC,MAAAA;KAAa,GAAGL,WAAA,CAAY;AACzDM,MAAAA,KAAA,EACEC,eAAA,CACE,IAAI,CAACC,IAAI,CAACF,KAAK,EACf,IAAI,CAACE,IAAI,CAACC,MAAM,EAChB;AAAEC,QAAAA,OAAA,EAAS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A,IAAI,IAAI,CAAChC,IAAI,CAACQ,eAAe,EAAE;AAC7B,MAAA,OAAOmB,SAAA;AACT,IAAA;IAEA,OAAOb,KAAKC,GAAG,CAAC,IAAI,CAACJ,QAAQ,EAAEG,IAAA,CAAKE,GAAG,CAAC,IAAI,CAACN,QAAQ,EAAE,IAAI,CAACf,QAAQ,CAAA,CAAA;AACtE,EAAA;EAEA,IAAIsC,gBAA4B;AAC9B,IAAA,IAAIrB,UAAA,GAAa,IAAI,CAACA,UAAU;AAChC,IAAA,IAAI,IAAI,CAACZ,IAAI,CAACQ,eAAe,EAAE;AAC7BI,MAAAA,UAAA,GAAa,EAAA;AACf,IAAA;AACA,IAAA,OAAOsB,SAAS,CAAA,OAAA,EAAUtB,UAAA,GAAa,CAAA;AACzC,EAAA;AAEA,EAAA;IAAAuB,oBAAA,CAAAC,kBAAA,CAAA,8zBAAA,EAgCA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"progress-bar.js","sources":["../../../src/components/status/progress-bar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { htmlSafe } from '@ember/template';\nimport type { SafeString } from '@ember/template';\nimport { guidFor } from '@ember/object/internals';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface ProgressBarSignature {\n Args: {\n /**\n * The color of the progress bar\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the progress bar\n */\n size?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * The radius the progress bar\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * The current progress value\n */\n progress?: number;\n\n /**\n *\n * The smallest value allowed for the input\n *\n * @defaultValue 0\n */\n minValue?: number;\n\n /**\n *\n * The largest value allowed for the input\n *\n *@defaultValue 100\n */\n maxValue?: number;\n\n /**\n * Whether presentation is indeterminate when progress isn't known.\n *\n * @defaultValue false\n */\n isIndeterminate?: boolean;\n\n /**\n * The content to display as the label.\n */\n label?: string;\n\n /**\n * The content to display as the value's label (e.g. 1 of 4).\n */\n valueLabel?: string;\n\n /**\n * Whether the value's label is displayed.\n * True by default if there's a label, false by default if not.\n */\n showValueLabel?: boolean;\n\n /**\n * The display format of the value, passed to `Intl.NumberFormat`.\n *\n * A `percent` style formats the position on the min/max scale as a\n * fraction; every other style formats the raw `progress` value. With no\n * format options, the value is displayed as a whole percentage.\n */\n formatOptions?: Intl.NumberFormatOptions;\n\n /**\n * The content to display as the description.\n */\n description?: string;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nclass ProgressBar extends Component<ProgressBarSignature> {\n id = guidFor(this);\n\n get classNames() {\n const { progressBar } = useStyles();\n\n const { base, progress, label, description } = progressBar({\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'ProgressBar',\n from: 'intent',\n to: 'color',\n id: 'frontile.progress-bar.intent'\n }\n ) || 'neutral',\n size: this.args.size,\n radius: this.args.radius,\n isIndeterminate: this.args.isIndeterminate\n });\n\n return {\n base: base({ class: this.args.class }),\n progress: progress(),\n label: label(),\n description: description()\n };\n }\n\n get minValue(): number {\n return this.args.minValue ?? 0;\n }\n\n get maxValue(): number {\n return this.args.maxValue ?? 100;\n }\n\n /**\n * `@progress={{0}}` is a legitimate value, so this falls back to `minValue`\n * only when nothing was passed — a truthiness check would report the bar as\n * already at the bottom of the scale instead of at zero.\n */\n get progress(): number {\n return this.args.progress ?? this.minValue;\n }\n\n /**\n * The position on the scale as 0–100. Clamped, because the result drives an\n * inline `width` — an out-of-range or `NaN` percentage is dropped by the CSS\n * parser, which renders as a silently empty bar rather than as an error.\n * A non-positive range has no meaningful position, so it reports 0.\n */\n get percentage(): number {\n const range = this.maxValue - this.minValue;\n if (range <= 0) {\n return 0;\n }\n\n const percentage = ((this.progress - this.minValue) / range) * 100;\n\n return Math.min(100, Math.max(0, percentage));\n }\n\n get showValueLabel(): boolean {\n if (typeof this.args.showValueLabel !== 'undefined') {\n return this.args.showValueLabel;\n }\n\n return !!this.args.label;\n }\n\n get formattedValueLabel(): string {\n // check if the value label should not be shown\n if (!this.showValueLabel || this.args.isIndeterminate) {\n return '';\n }\n\n // if @labelValue is provided use it\n if (this.args.valueLabel) {\n return this.args.valueLabel;\n }\n\n // if format options are provided\n if (this.args.formatOptions) {\n const options: Intl.NumberFormatOptions = {\n ...(this.args.formatOptions || {})\n };\n\n // `Intl` scales a `percent` style by 100 itself, so it has to be handed\n // the fraction of the min–max range — passing the already-scaled\n // percentage announces `@progress={{50}}` as \"5,000%\". Every other style\n // (`decimal`, `currency`, `unit`) formats the raw value on its own scale.\n const value =\n options.style === 'percent' ? this.percentage / 100 : this.progress;\n\n // `navigator` is a browser global with no counterpart in Node, so a bare\n // `navigator?.language` is a hard `ReferenceError` rather than\n // `undefined` when a ProgressBar is server-rendered.\n const locale =\n typeof navigator !== 'undefined' ? navigator.language : undefined;\n\n return new Intl.NumberFormat(locale || 'en-US', options).format(value);\n }\n\n return this.percentage.toFixed(0) + '%';\n }\n\n /**\n * ARIA requires aria-valuenow to be absent when the value is unknown —\n * reporting a number would announce \"0%\" rather than \"amount unknown\".\n *\n * Otherwise it is clamped to the scale, because assistive technology\n * announces a percentage computed from valuenow/valuemin/valuemax. Reporting\n * a raw 150 on a 0–100 scale would say \"150%\" to a screen-reader user while\n * the bar sits pinned at 100% for everyone else — the people who cannot see\n * the bar would be the only ones given the wrong number.\n */\n get ariaValueNow(): number | undefined {\n if (this.args.isIndeterminate) {\n return undefined;\n }\n\n return Math.min(this.maxValue, Math.max(this.minValue, this.progress));\n }\n\n get progressWidth(): SafeString {\n let percentage = this.percentage;\n if (this.args.isIndeterminate) {\n percentage = 50;\n }\n return htmlSafe(`width: ${percentage}%`);\n }\n\n <template>\n <div data-component=\"progress-bar\" ...attributes>\n {{#if @label}}\n <div data-part=\"label\" class={{this.classNames.label}}>\n <label id={{this.id}}>\n {{@label}}\n </label>\n {{#if this.showValueLabel}}\n <div>\n {{this.formattedValueLabel}}\n </div>\n {{/if}}\n </div>\n {{/if}}\n {{#if @description}}\n <div data-part=\"description\" class={{this.classNames.description}}>\n {{@description}}\n </div>\n {{/if}}\n <div data-part=\"base\" class={{this.classNames.base}}>\n <div\n role=\"progressbar\"\n data-part=\"progress\"\n aria-labelledby={{if @label this.id}}\n aria-valuenow={{this.ariaValueNow}}\n aria-valuemin={{this.minValue}}\n aria-valuemax={{this.maxValue}}\n class={{this.classNames.progress}}\n style={{this.progressWidth}}\n ></div>\n </div>\n </div>\n </template>\n}\n\nexport { ProgressBar, type ProgressBarSignature };\nexport default ProgressBar;\n"],"names":["ProgressBar","Component","id","guidFor","classNames","progressBar","useStyles","base","progress","label","description","color","renamedArgValue","args","intent","default","component","from","to","size","radius","isIndeterminate","class","minValue","maxValue","percentage","range","Math","min","max","showValueLabel","formattedValueLabel","valueLabel","formatOptions","options","value","style","locale","navigator","language","undefined","Intl","NumberFormat","format","toFixed","ariaValueNow","progressWidth","htmlSafe","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;;AAgHA,MAAMA,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,EAAA,GAAKC,OAAA,CAAQ,IAAI,CAAA;EAEjB,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAAK;AAAEC,MAAAA;KAAa,GAAGL,WAAA,CAAY;AACzDM,MAAAA,KAAA,EACEC,eAAA,CACE,IAAI,CAACC,IAAI,C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K,GAAA;AACtC,EAAA;AAEA;;;;;;;;;AASC;EACD,IAAIC,YAAAA,GAAmC;AACrC,IAAA,IAAI,IAAI,CAAChC,IAAI,CAACQ,eAAe,EAAE;AAC7B,MAAA,OAAOmB,SAAA;AACT,IAAA;IAEA,OAAOb,KAAKC,GAAG,CAAC,IAAI,CAACJ,QAAQ,EAAEG,IAAA,CAAKE,GAAG,CAAC,IAAI,CAACN,QAAQ,EAAE,IAAI,CAACf,QAAQ,CAAA,CAAA;AACtE,EAAA;EAEA,IAAIsC,gBAA4B;AAC9B,IAAA,IAAIrB,UAAA,GAAa,IAAI,CAACA,UAAU;AAChC,IAAA,IAAI,IAAI,CAACZ,IAAI,CAACQ,eAAe,EAAE;AAC7BI,MAAAA,UAAA,GAAa,EAAA;AACf,IAAA;AACA,IAAA,OAAOsB,SAAS,CAAA,OAAA,EAAUtB,UAAA,GAAa,CAAA;AACzC,EAAA;AAEA,EAAA;IAAAuB,oBAAA,CAAAC,kBAAA,CAAA,8zBAAA,EAgCA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../../../src/components/utilities/avatar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport {\n useStyles,\n type AvatarVariants,\n type AvatarSlots,\n type SlotsToClasses\n} from '@frontile/theme';\n\ninterface AvatarSignature {\n Args: {\n /**\n * Controls the size of the avatar.\n *\n * @defaultValue 'md'\n */\n size?: AvatarVariants['size'];\n\n /**\n * Defines the shape of the avatar.\n *\n * @defaultValue 'circle'\n */\n shape?: AvatarVariants['shape'];\n\n /**\n * URL of the image to be displayed in the avatar.\n * If provided, the image will be used instead of initials.\n *\n */\n src?: string | null;\n\n /**\n * Full name of the user, used to generate initials.\n * If `@firstName` and `@lastName` are not provided, initials will be\n * derived from this property.\n */\n name?: string;\n\n /**\n * First name of the user, used to generate initials.\n * If `@name` is not provided, initials will be generated from\n * `@firstName` and `@lastName`.\n */\n firstName?: string;\n\n /**\n * Last name of the user, used to generate initials.\n * If `@name` is not provided, initials will be generated from\n * `@firstName` and `@lastName`.\n */\n lastName?: string;\n\n /**\n * Alternative text for accessibility.\n * If `@src` is provided, this text will be used as the `alt`\n * attribute for the image.\n * If only initials are displayed, this text will be read by screen readers.\n */\n alt?: string;\n\n /**\n * Custom CSS classes for styling different slots within the avatar component.\n */\n classes?: SlotsToClasses<AvatarSlots>;\n };\n\n /**\n * The root element of the avatar component, which is an HTML `<span>` tag.\n */\n Element: HTMLSpanElement;\n}\n\nclass Avatar extends Component<AvatarSignature> {\n get classes() {\n const { avatar } = useStyles();\n return avatar({\n size: this.args.size,\n shape: this.args.shape\n });\n }\n\n get initials() {\n const { name, firstName, lastName } = this.args;\n\n if (name) {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n }\n\n const initials = [firstName?.charAt(0), lastName?.charAt(0)]\n .filter(Boolean)\n .join('')\n .toUpperCase();\n\n return initials;\n }\n\n get shouldShowInitials() {\n const { src, name, firstName, lastName } = this.args;\n if (src) {\n return false;\n }\n\n return Boolean(name || firstName || lastName);\n }\n\n <template>\n <span\n class={{this.classes.base class=@classes.base}}\n data-component=\"avatar\"\n data-part=\"base\"\n ...attributes\n >\n {{#if this.shouldShowInitials}}\n {{! role=\"img\" makes the contents presentational, so the initials stop\n being read. Only claim the role when there is an @alt to name it with;\n otherwise leave the letters as plain text. }}\n <span\n aria-label={{@alt}}\n class={{this.classes.name class=@classes.name}}\n data-part=\"name\"\n role={{if @alt \"img\"}}\n >\n {{this.initials}}\n </span>\n {{/if}}\n {{#if @src}}\n {{! An omitted alt makes screen readers fall back to the URL. An empty\n one marks the image decorative, which is right beside a visible name. }}\n <img\n class={{this.classes.img class=@classes.img}}\n data-part=\"img\"\n src={{@src}}\n alt={{if @alt @alt \"\"}}\n />\n {{/if}}\n </span>\n </template>\n}\n\nexport { Avatar };\nexport default Avatar;\n"],"names":["Avatar","Component","classes","avatar","useStyles","size","args","shape","initials","name","firstName","lastName","trim","split","slice","map","word","charAt","join","toUpperCase","filter","Boolean","shouldShowInitials","src","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAwEA,MAAMA,eAAeC,SAAA,CAAU;EAC7B,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AACnB,IAAA,OAAOD,MAAA,CAAO;AACZE,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,QAAAA,GAAW;IACb,MAAM;MAAEC,IAAI;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACL,IAAI;AAE/C,IAAA,IAAIG,IAAA,EAAM;AACR,MAAA,OAAOA,IAAA,CACJG,IAAI,EAAA,CACJC,KAAK,CAAC,KAAA,CAAA,CACNC,KAAK,CAAC,CAAA,EAAG,CAAA,CAAA,CACTC,GAAG,CAAEC,QAASA,IAAA,CAAKC,MAAM,CAAC,CAAA,CAAA,CAAA,CAC1BC,IAAI,CAAC,EAAA,CAAA,CACLC,WAAW,EAAA;AAChB,IAAA;AAEA,IAAA,MAAMX,QAAA,GAAW,CAACE,SAAA,EAAWO,MAAA,CAAO,CAAA,CAAA,EAAIN,QAAA,EAAUM,MAAA,CAAO,CAAA,CAAA,CAAG,CACzDG,MAAM,CAACC,OAAA,CAAA,CACPH,IAAI,CAAC,IACLC,WAAW,EAAA;AAEd,IAAA,OAAOX,QAAA;AACT,EAAA;EAEA,IAAIc,kBAAAA,GAAqB;IACvB,MAAM;MAAEC,GAAG;MAAEd,IAAI;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACL,IAAI;AACpD,IAAA,IAAIiB,GAAA,EAAK;AACP,MAAA,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,OAAOF,OAAA,CAAQZ,QAAQC,SAAA,IAAaC,QAAA,CAAA;AACtC,EAAA;AAEA,EAAA;IAAAa,oBAAA,CAAAC,kBAAA,CAAA,00BAAA,EA+BA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"avatar.js","sources":["../../../src/components/utilities/avatar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport {\n useStyles,\n type AvatarVariants,\n type AvatarSlots,\n type SlotsToClasses\n} from '@frontile/theme';\n\ninterface AvatarSignature {\n Args: {\n /**\n * Controls the size of the avatar.\n *\n * @defaultValue 'md'\n */\n size?: AvatarVariants['size'];\n\n /**\n * Defines the shape of the avatar.\n *\n * @defaultValue 'circle'\n */\n shape?: AvatarVariants['shape'];\n\n /**\n * URL of the image to be displayed in the avatar.\n * If provided, the image will be used instead of initials.\n *\n */\n src?: string | null;\n\n /**\n * Full name of the user, used to generate initials.\n * If `@firstName` and `@lastName` are not provided, initials will be\n * derived from this property.\n */\n name?: string;\n\n /**\n * First name of the user, used to generate initials.\n * If `@name` is not provided, initials will be generated from\n * `@firstName` and `@lastName`.\n */\n firstName?: string;\n\n /**\n * Last name of the user, used to generate initials.\n * If `@name` is not provided, initials will be generated from\n * `@firstName` and `@lastName`.\n */\n lastName?: string;\n\n /**\n * Alternative text for accessibility.\n * If `@src` is provided, this text will be used as the `alt`\n * attribute for the image.\n * If only initials are displayed, this text will be read by screen readers.\n */\n alt?: string;\n\n /**\n * Custom CSS classes for styling different slots within the avatar component.\n */\n classes?: SlotsToClasses<AvatarSlots>;\n };\n\n /**\n * The root element of the avatar component, which is an HTML `<span>` tag.\n */\n Element: HTMLSpanElement;\n}\n\nclass Avatar extends Component<AvatarSignature> {\n get classes() {\n const { avatar } = useStyles();\n return avatar({\n size: this.args.size,\n shape: this.args.shape\n });\n }\n\n get initials() {\n const { name, firstName, lastName } = this.args;\n\n if (name) {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n }\n\n const initials = [firstName?.charAt(0), lastName?.charAt(0)]\n .filter(Boolean)\n .join('')\n .toUpperCase();\n\n return initials;\n }\n\n get shouldShowInitials() {\n const { src, name, firstName, lastName } = this.args;\n if (src) {\n return false;\n }\n\n return Boolean(name || firstName || lastName);\n }\n\n <template>\n <span\n class={{this.classes.base class=@classes.base}}\n data-component=\"avatar\"\n data-part=\"base\"\n ...attributes\n >\n {{#if this.shouldShowInitials}}\n {{! role=\"img\" makes the contents presentational, so the initials stop\n being read. Only claim the role when there is an @alt to name it with;\n otherwise leave the letters as plain text. }}\n <span\n aria-label={{@alt}}\n class={{this.classes.name class=@classes.name}}\n data-part=\"name\"\n role={{if @alt \"img\"}}\n >\n {{this.initials}}\n </span>\n {{/if}}\n {{#if @src}}\n {{! An omitted alt makes screen readers fall back to the URL. An empty\n one marks the image decorative, which is right beside a visible name. }}\n <img\n class={{this.classes.img class=@classes.img}}\n data-part=\"img\"\n src={{@src}}\n alt={{if @alt @alt \"\"}}\n />\n {{/if}}\n </span>\n </template>\n}\n\nexport { Avatar };\nexport default Avatar;\n"],"names":["Avatar","Component","classes","avatar","useStyles","size","args","shape","initials","name","firstName","lastName","trim","split","slice","map","word","charAt","join","toUpperCase","filter","Boolean","shouldShowInitials","src","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAwEA,MAAMA,eAAeC,SAAA,CAAU;EAC7B,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AACnB,IAAA,OAAOD,MAAA,CAAO;AACZE,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,QAAAA,GAAW;IACb,MAAM;MAAEC,IAAI;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACL,IAAI;AAE/C,IAAA,IAAIG,IAAA,EAAM;AACR,MAAA,OAAOA,IAAA,CACJG,IAAI,EAAA,CACJC,KAAK,CAAC,KAAA,CAAA,CACNC,KAAK,CAAC,CAAA,EAAG,CAAA,CAAA,CACTC,GAAG,CAAEC,QAASA,IAAA,CAAKC,MAAM,CAAC,CAAA,CAAA,CAAA,CAC1BC,IAAI,CAAC,EAAA,CAAA,CACLC,WAAW,EAAA;AAChB,IAAA;AAEA,IAAA,MAAMX,QAAA,GAAW,CAACE,SAAA,EAAWO,MAAA,CAAO,CAAA,CAAA,EAAIN,QAAA,EAAUM,MAAA,CAAO,CAAA,CAAA,CAAG,CACzDG,MAAM,CAACC,OAAA,CAAA,CACPH,IAAI,CAAC,IACLC,WAAW,EAAA;AAEd,IAAA,OAAOX,QAAA;AACT,EAAA;EAEA,IAAIc,kBAAAA,GAAqB;IACvB,MAAM;MAAEC,GAAG;MAAEd,IAAI;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACL,IAAI;AACpD,IAAA,IAAIiB,GAAA,EAAK;AACP,MAAA,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,OAAOF,OAAA,CAAQZ,QAAQC,SAAA,IAAaC,QAAA,CAAA;AACtC,EAAA;AAEA,EAAA;IAAAa,oBAAA,CAAAC,kBAAA,CAAA,00BAAA,EA+BA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.js","sources":["../../../src/components/utilities/collapsible.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { buildWaiter } from '@ember/test-waiters';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport safeStyles from '../../utils/safe-styles';\nimport { prefersReducedMotion } from '../../utils/prefers-reduced-motion';\nimport type Owner from '@ember/owner';\n\nconst waiter = buildWaiter('frontile:collapsible');\n\n/**\n * Runs a caller-supplied height through the browser's own CSS parser.\n *\n * `@initialHeight` ends up in an inline `style` attribute, so a value such as\n * `10px; position: fixed` would otherwise smuggle in a second declaration.\n * Assigning it to a detached element's `style.height` lets the CSSOM decide:\n * it accepts every real height (`10px`, `2rem`, `50%`, `0`,\n * `calc(1rem + 2px)`, `var(--x)`, …) and drops anything it cannot parse as a\n * single height value — a trailing declaration included. Returns the parsed\n * value, or `undefined` when the input is unusable.\n */\nfunction parseHeight(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n\n // Reject anything that could terminate the declaration up front. The CSSOM\n // check below catches this too, but the explicit test keeps the guarantee\n // even where `document` has no real CSS parser (SSR / prerender).\n if (/[;}]/.test(value)) {\n return undefined;\n }\n\n if (typeof document === 'undefined') {\n return value;\n }\n\n const probe = document.createElement('div');\n probe.style.height = value;\n\n return probe.style.height || undefined;\n}\n\ninterface CollapsibleArgs {\n /**\n * If true, the content will be visible\n */\n isOpen: boolean;\n\n /**\n * The height for the content in it's collapsed state.\n * The unit of the value should be included, eg. '10px'. Any CSS height is\n * accepted (`2rem`, `50%`, `calc(1rem + 2px)`, …); a value the CSS parser\n * rejects is ignored and the content collapses to `0`.\n *\n * @defaultValue 0\n */\n initialHeight?: string;\n}\n\ninterface CollapsibleSignature {\n Args: CollapsibleArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Collapsible extends Component<CollapsibleSignature> {\n isInitiallyOpen = false;\n waiterToken?: unknown;\n isCurrentlyOpen = false; // Internal value to track if open or not\n\n constructor(owner: Owner, args: CollapsibleArgs) {\n super(owner, args);\n\n if (this.args.isOpen) {\n this.isInitiallyOpen = true;\n this.isCurrentlyOpen = true;\n }\n }\n\n /**\n * `@initialHeight`, validated by the CSS parser. `undefined` when it was not\n * given or could not be parsed as a height, in which case the collapsed\n * state falls back to `0`.\n */\n get initialHeight(): string | undefined {\n return parseHeight(this.args.initialHeight);\n }\n\n get styles(): ReturnType<typeof safeStyles> {\n let styles: Record<string, string | number> = {};\n const initialHeight = this.initialHeight;\n\n if (!this.isInitiallyOpen) {\n styles = {\n ...styles,\n height: initialHeight || 0,\n opacity: initialHeight ? '1' : '0'\n };\n }\n\n if (initialHeight || !this.isInitiallyOpen) {\n styles = {\n ...styles,\n overflow: 'hidden'\n };\n }\n\n return safeStyles(styles);\n }\n\n hasSetupUpdate = false;\n update = modifier((element: HTMLElement, [isOpen]: boolean[]) => {\n // do not run update on the initial setup of modifier\n if (!this.hasSetupUpdate) {\n this.hasSetupUpdate = true;\n return;\n }\n\n if (this.isCurrentlyOpen !== !!isOpen) {\n // A previous transition may still be in flight; end its token first so\n // toggling faster than the animation cannot leak a test waiter.\n this.endWaiter();\n this.waiterToken = waiter.beginAsync();\n }\n\n if (isOpen) {\n this.expand(element);\n } else {\n this.contract(element);\n }\n });\n\n endWaiter(): void {\n if (this.waiterToken) {\n const token = this.waiterToken;\n // Clear before ending so the same token can never be ended twice.\n this.waiterToken = undefined;\n waiter.endAsync(token);\n }\n }\n\n willDestroy(): void {\n super.willDestroy();\n // Do not leave a waiter pending if we are torn down mid-transition.\n this.endWaiter();\n }\n\n onTransitionEnd = (event: TransitionEvent) => {\n // `transitionend` bubbles, so ignore transitions of our own descendants.\n // Otherwise any child that animates height/opacity would get our inline\n // styles stamped onto it.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n const element = event.currentTarget as HTMLElement;\n\n if (\n (event.propertyName === 'height' || event.propertyName == 'opacity') &&\n this.args.isOpen\n ) {\n element.style.height = 'auto';\n element.style.overflow = '';\n }\n if (this.waiterToken) {\n // when is opened, wait for height transition to finish\n // when is opened, wait for opacity transition to finish at 1\n // when closed, wait for opacity transition to finish at 0\n // when closed and has initialHeight, wait for height transition to finish\n if (\n (this.args.isOpen && event.propertyName === 'height') ||\n (!this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '0') ||\n (this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '1') ||\n (!this.args.isOpen &&\n this.initialHeight &&\n event.propertyName === 'height')\n ) {\n this.endWaiter();\n }\n }\n };\n\n heightTransition(duration: number): string {\n return `height ${duration}s cubic-bezier(0.4, 0, 0.2, 1) 0ms`;\n }\n\n opacityTransition(duration: number): string {\n return `opacity ${duration}s ease-in-out 0ms`;\n }\n\n expand(element: HTMLElement): void {\n this.isCurrentlyOpen = true;\n\n // The transition is written as an inline style, so a\n // `motion-reduce:transition-none` class could never beat it. The check has\n // to happen here.\n //\n // Height, overflow and opacity below land where `onTransitionEnd` leaves\n // them at the end of a normal expand. `transition` is the one property\n // that differs: the animated path never clears it, so an element that has\n // animated keeps an inline `transition` at rest while this path clears it.\n // Nothing reads that property between runs, so the asymmetry is harmless\n // -- but it is why this is not, strictly, the same terminal state.\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = '';\n element.style.opacity = '1';\n element.style.height = 'auto';\n this.endWaiter();\n return;\n }\n\n element.style.transition = [\n this.heightTransition(0.4),\n this.opacityTransition(0.3)\n ].join(', ');\n element.style.overflow = 'hidden';\n\n const height = element.scrollHeight;\n window.requestAnimationFrame(() => {\n element.style.opacity = '1';\n element.style.height = `${height}px`;\n });\n }\n\n /**\n * The geometry a collapsed panel ends at.\n *\n * Shared by the animated path's final frame and the reduced-motion early\n * return. Extracted rather than written twice: these two have to agree\n * about what \"closed\" means, and a second copy is only a way for them to\n * drift apart.\n */\n applyClosedState(element: HTMLElement): void {\n const initialHeight = this.initialHeight;\n\n if (!initialHeight) {\n element.style.opacity = '0';\n }\n element.style.height = initialHeight || '0';\n }\n\n contract(element: HTMLElement): void {\n this.isCurrentlyOpen = false;\n\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = 'hidden';\n this.applyClosedState(element);\n this.endWaiter();\n return;\n }\n\n const height = element.scrollHeight;\n element.style.transition = '';\n element.style.overflow = 'hidden';\n\n window.requestAnimationFrame(() => {\n element.style.height = `${height}px`;\n element.style.transition = [\n this.heightTransition(0.2),\n this.opacityTransition(0.3)\n ].join(', ');\n\n window.requestAnimationFrame(() => {\n this.applyClosedState(element);\n });\n });\n }\n\n <template>\n <div\n style={{this.styles}}\n ...attributes\n {{this.update @isOpen}}\n {{on \"transitionend\" this.onTransitionEnd}}\n >\n {{yield}}\n </div>\n </template>\n}\n\nexport { Collapsible, type CollapsibleSignature };\nexport default Collapsible;\n"],"names":["waiter","buildWaiter","parseHeight","value","undefined","test","document","probe","createElement","style","height","Collapsible","Component","isInitiallyOpen","waiterToken","isCurrentlyOpen","constructor","owner","args","isOpen","initialHeight","styles","opacity","overflow","safeStyles","hasSetupUpdate","update","modifier","element","endWaiter","beginAsync","expand","contract","token","endAsync","willDestroy","onTransitionEnd","event","target","currentTarget","propertyName","heightTransition","duration","opacityTransition","prefersReducedMotion","transition","join","scrollHeight","window","requestAnimationFrame","applyClosedState","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAQA,MAAMA,SAASC,WAAA,CAAY,sBAAA,CAAA;AAE3B;;;;;;;;;;;AAWA,SAASC,YAAYC,KAAyB,EAAqB;EACjE,IAAI,CAACA,KAAA,EAAO;AACV,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA;AACA;AACA;AACA,EAAA,IAAI,MAAA,CAAOC,IAAI,CAACF,KAAA,CAAA,EAAQ;AACtB,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA,EAAA,IAAI,OAAOE,aAAa,WAAA,EAAa;AACnC,IAAA,OAAOH,KAAA;AACT,EAAA;AAEA,EAAA,MAAMI,KAAA,GAAQD,QAAA,CAASE,aAAa,CAAC,KAAA,CAAA;AACrCD,EAAAA,KAAA,CAAME,KAAK,CAACC,MAAM,GAAGP,KAAA;AAErB,EAAA,OAAOI,KAAA,CAAME,KAAK,CAACC,MAAM,IAAIN,SAAA;AAC/B;AA2BA,MAAMO,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,eAAA,GAAkB,KAAA;EAClBC,WAAA;A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C3BrB,MAAAA,OAAA,CAAQnB,KAAK,CAACC,MAAM,GAAG,CAAA,EAAGA,MAAA,CAAA,EAAA,CAAU;MACpCkB,OAAA,CAAQnB,KAAK,CAACoC,UAAU,GAAG,CACzB,IAAI,CAACJ,gBAAgB,CAAC,GAAA,CAAA,EACtB,IAAI,CAACE,iBAAiB,CAAC,GAAA,CAAA,CACxB,CAACG,IAAI,CAAC,IAAA,CAAA;MAEPE,MAAA,CAAOC,qBAAqB,CAAC,MAAA;AAC3B,QAAA,IAAI,CAACC,gBAAgB,CAACtB,OAAA,CAAA;AACxB,MAAA,CAAA,CAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAuB,oBAAA,CAAAC,kBAAA,CAAA,sIAAA,EASA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"collapsible.js","sources":["../../../src/components/utilities/collapsible.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { buildWaiter } from '@ember/test-waiters';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport safeStyles from '../../utils/safe-styles';\nimport { prefersReducedMotion } from '../../utils/prefers-reduced-motion';\nimport type Owner from '@ember/owner';\n\nconst waiter = buildWaiter('frontile:collapsible');\n\n/**\n * Runs a caller-supplied height through the browser's own CSS parser.\n *\n * `@initialHeight` ends up in an inline `style` attribute, so a value such as\n * `10px; position: fixed` would otherwise smuggle in a second declaration.\n * Assigning it to a detached element's `style.height` lets the CSSOM decide:\n * it accepts every real height (`10px`, `2rem`, `50%`, `0`,\n * `calc(1rem + 2px)`, `var(--x)`, …) and drops anything it cannot parse as a\n * single height value — a trailing declaration included. Returns the parsed\n * value, or `undefined` when the input is unusable.\n */\nfunction parseHeight(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n\n // Reject anything that could terminate the declaration up front. The CSSOM\n // check below catches this too, but the explicit test keeps the guarantee\n // even where `document` has no real CSS parser (SSR / prerender).\n if (/[;}]/.test(value)) {\n return undefined;\n }\n\n if (typeof document === 'undefined') {\n return value;\n }\n\n const probe = document.createElement('div');\n probe.style.height = value;\n\n return probe.style.height || undefined;\n}\n\ninterface CollapsibleArgs {\n /**\n * If true, the content will be visible\n */\n isOpen: boolean;\n\n /**\n * The height for the content in it's collapsed state.\n * The unit of the value should be included, eg. '10px'. Any CSS height is\n * accepted (`2rem`, `50%`, `calc(1rem + 2px)`, …); a value the CSS parser\n * rejects is ignored and the content collapses to `0`.\n *\n * @defaultValue 0\n */\n initialHeight?: string;\n}\n\ninterface CollapsibleSignature {\n Args: CollapsibleArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Collapsible extends Component<CollapsibleSignature> {\n isInitiallyOpen = false;\n waiterToken?: unknown;\n isCurrentlyOpen = false; // Internal value to track if open or not\n\n constructor(owner: Owner, args: CollapsibleArgs) {\n super(owner, args);\n\n if (this.args.isOpen) {\n this.isInitiallyOpen = true;\n this.isCurrentlyOpen = true;\n }\n }\n\n /**\n * `@initialHeight`, validated by the CSS parser. `undefined` when it was not\n * given or could not be parsed as a height, in which case the collapsed\n * state falls back to `0`.\n */\n get initialHeight(): string | undefined {\n return parseHeight(this.args.initialHeight);\n }\n\n get styles(): ReturnType<typeof safeStyles> {\n let styles: Record<string, string | number> = {};\n const initialHeight = this.initialHeight;\n\n if (!this.isInitiallyOpen) {\n styles = {\n ...styles,\n height: initialHeight || 0,\n opacity: initialHeight ? '1' : '0'\n };\n }\n\n if (initialHeight || !this.isInitiallyOpen) {\n styles = {\n ...styles,\n overflow: 'hidden'\n };\n }\n\n return safeStyles(styles);\n }\n\n hasSetupUpdate = false;\n update = modifier((element: HTMLElement, [isOpen]: boolean[]) => {\n // do not run update on the initial setup of modifier\n if (!this.hasSetupUpdate) {\n this.hasSetupUpdate = true;\n return;\n }\n\n if (this.isCurrentlyOpen !== !!isOpen) {\n // A previous transition may still be in flight; end its token first so\n // toggling faster than the animation cannot leak a test waiter.\n this.endWaiter();\n this.waiterToken = waiter.beginAsync();\n }\n\n if (isOpen) {\n this.expand(element);\n } else {\n this.contract(element);\n }\n });\n\n endWaiter(): void {\n if (this.waiterToken) {\n const token = this.waiterToken;\n // Clear before ending so the same token can never be ended twice.\n this.waiterToken = undefined;\n waiter.endAsync(token);\n }\n }\n\n willDestroy(): void {\n super.willDestroy();\n // Do not leave a waiter pending if we are torn down mid-transition.\n this.endWaiter();\n }\n\n onTransitionEnd = (event: TransitionEvent) => {\n // `transitionend` bubbles, so ignore transitions of our own descendants.\n // Otherwise any child that animates height/opacity would get our inline\n // styles stamped onto it.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n const element = event.currentTarget as HTMLElement;\n\n if (\n (event.propertyName === 'height' || event.propertyName == 'opacity') &&\n this.args.isOpen\n ) {\n element.style.height = 'auto';\n element.style.overflow = '';\n }\n if (this.waiterToken) {\n // when is opened, wait for height transition to finish\n // when is opened, wait for opacity transition to finish at 1\n // when closed, wait for opacity transition to finish at 0\n // when closed and has initialHeight, wait for height transition to finish\n if (\n (this.args.isOpen && event.propertyName === 'height') ||\n (!this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '0') ||\n (this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '1') ||\n (!this.args.isOpen &&\n this.initialHeight &&\n event.propertyName === 'height')\n ) {\n this.endWaiter();\n }\n }\n };\n\n heightTransition(duration: number): string {\n return `height ${duration}s cubic-bezier(0.4, 0, 0.2, 1) 0ms`;\n }\n\n opacityTransition(duration: number): string {\n return `opacity ${duration}s ease-in-out 0ms`;\n }\n\n expand(element: HTMLElement): void {\n this.isCurrentlyOpen = true;\n\n // The transition is written as an inline style, so a\n // `motion-reduce:transition-none` class could never beat it. The check has\n // to happen here.\n //\n // Height, overflow and opacity below land where `onTransitionEnd` leaves\n // them at the end of a normal expand. `transition` is the one property\n // that differs: the animated path never clears it, so an element that has\n // animated keeps an inline `transition` at rest while this path clears it.\n // Nothing reads that property between runs, so the asymmetry is harmless\n // -- but it is why this is not, strictly, the same terminal state.\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = '';\n element.style.opacity = '1';\n element.style.height = 'auto';\n this.endWaiter();\n return;\n }\n\n element.style.transition = [\n this.heightTransition(0.4),\n this.opacityTransition(0.3)\n ].join(', ');\n element.style.overflow = 'hidden';\n\n const height = element.scrollHeight;\n window.requestAnimationFrame(() => {\n element.style.opacity = '1';\n element.style.height = `${height}px`;\n });\n }\n\n /**\n * The geometry a collapsed panel ends at.\n *\n * Shared by the animated path's final frame and the reduced-motion early\n * return. Extracted rather than written twice: these two have to agree\n * about what \"closed\" means, and a second copy is only a way for them to\n * drift apart.\n */\n applyClosedState(element: HTMLElement): void {\n const initialHeight = this.initialHeight;\n\n if (!initialHeight) {\n element.style.opacity = '0';\n }\n element.style.height = initialHeight || '0';\n }\n\n contract(element: HTMLElement): void {\n this.isCurrentlyOpen = false;\n\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = 'hidden';\n this.applyClosedState(element);\n this.endWaiter();\n return;\n }\n\n const height = element.scrollHeight;\n element.style.transition = '';\n element.style.overflow = 'hidden';\n\n window.requestAnimationFrame(() => {\n element.style.height = `${height}px`;\n element.style.transition = [\n this.heightTransition(0.2),\n this.opacityTransition(0.3)\n ].join(', ');\n\n window.requestAnimationFrame(() => {\n this.applyClosedState(element);\n });\n });\n }\n\n <template>\n <div\n style={{this.styles}}\n ...attributes\n {{this.update @isOpen}}\n {{on \"transitionend\" this.onTransitionEnd}}\n >\n {{yield}}\n </div>\n </template>\n}\n\nexport { Collapsible, type CollapsibleSignature };\nexport default Collapsible;\n"],"names":["waiter","buildWaiter","parseHeight","value","undefined","test","document","probe","createElement","style","height","Collapsible","Component","isInitiallyOpen","waiterToken","isCurrentlyOpen","constructor","owner","args","isOpen","initialHeight","styles","opacity","overflow","safeStyles","hasSetupUpdate","update","modifier","element","endWaiter","beginAsync","expand","contract","token","endAsync","willDestroy","onTransitionEnd","event","target","currentTarget","propertyName","heightTransition","duration","opacityTransition","prefersReducedMotion","transition","join","scrollHeight","window","requestAnimationFrame","applyClosedState","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAQA,MAAMA,SAASC,WAAA,CAAY,sBAAA,CAAA;AAE3B;;;;;;;;;;;AAWA,SAASC,YAAYC,KAAyB,EAAqB;EACjE,IAAI,CAACA,KAAA,EAAO;AACV,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA;AACA;AACA;AACA,EAAA,IAAI,MAAA,CAAOC,IAAI,CAACF,KAAA,CAAA,EAAQ;AACtB,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA,EAAA,IAAI,OAAOE,aAAa,WAAA,EAAa;AACnC,IAAA,OAAOH,KAAA;AACT,EAAA;AAEA,EAAA,MAAMI,KAAA,GAAQD,QAAA,CAASE,aAAa,CAAC,KAAA,CAAA;AACrCD,EAAAA,KAAA,CAAME,KAAK,CAACC,MAAM,GAAGP,KAAA;AAErB,EAAA,OAAOI,KAAA,CAAME,KAAK,CAACC,MAAM,IAAIN,SAAA;AAC/B;AA2BA,MAAMO,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,eAAA,GAAkB,KAAA;EAClBC,WAAA;AACAC,EAAAA,eAAA,GAAkB,KAAA;AAElBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAqB,EAAE;AAC/C,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;AAEb,IAAA,IAAI,IAAI,CAACA,IAAI,CAACC,MAAM,EAAE;MACpB,IAAI,CAACN,eAAe,GAAG,IAAA;MACvB,IAAI,CAACE,eAAe,GAAG,IAAA;AACzB,IAAA;AACF,EAAA;AAEA;;;;AAIC;EACD,IAAIK,aAAAA,GAAoC;AACtC,IAAA,OAAOlB,WAAA,CAAY,IAAI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AAA,CAAA,CAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAuB,oBAAA,CAAAC,kBAAA,CAAA,sIAAA,EASA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -22,7 +22,7 @@ function isVertical(orientation) {
22
22
  const {
23
23
  divider
24
24
  } = useStyles();
25
- const Divider = setComponentTemplate(precompileTemplate("{{#let (element (getTag @orientation @as)) as |Tag|}}\n <Tag class={{divider (hash class=@class orientation=@orientation)}} role=\"separator\" aria-orientation={{if (isVertical @orientation) \"vertical\"}} data-component=\"divider\" data-part=\"base\" ...attributes />\n{{/let}}", {
25
+ const Divider = setComponentTemplate(precompileTemplate("{{#let (element (getTag @orientation @as)) as |Tag|}}\n <Tag class={{divider (hash class=@class orientation=@orientation variant=@variant)}} role=\"separator\" aria-orientation={{if (isVertical @orientation) \"vertical\"}} data-component=\"divider\" data-part=\"base\" ...attributes />\n{{/let}}", {
26
26
  strictMode: true,
27
27
  scope: () => ({
28
28
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"divider.js","sources":["../../../src/components/utilities/divider.gts"],"sourcesContent":["import { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { element } from 'ember-element-helper';\nimport type { TOC } from '@ember/component/template-only';\n\nfunction getTag(\n orientation: string | undefined,\n as?: string | undefined\n): string {\n if (as) {\n return as;\n }\n\n if (orientation === 'vertical') {\n return 'div';\n }\n return 'hr';\n}\n\n// The separator role is horizontal by default, so only the vertical case needs\n// stating. `<hr>` carries its orientation implicitly and needs neither.\nfunction isVertical(orientation: string | undefined): boolean {\n return orientation === 'vertical';\n}\n\nconst { divider } = useStyles();\n\nconst Divider: TOC<{\n Args: {\n /**\n * Which way the divider runs. A horizontal divider renders an `<hr>`; a\n * vertical one renders a `<div>`, since `<hr>` cannot express that.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n\n /**\n * The tag to render instead of the one the orientation would choose — for\n * example `li` when the divider sits between list items.\n */\n as?: string;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library.\n */\n class?: string;\n };\n Element: Element;\n}> = <template>\n {{#let (element (getTag @orientation @as)) as |Tag|}}\n <Tag\n class={{divider (hash class=@class orientation=@orientation)}}\n role=\"separator\"\n aria-orientation={{if (isVertical @orientation) \"vertical\"}}\n data-component=\"divider\"\n data-part=\"base\"\n ...attributes\n />\n {{/let}}\n</template>;\n\nexport { Divider };\nexport default Divider;\n"],"names":["getTag","orientation","as","isVertical","divider","useStyles","Divider","setComponentTemplate","precompileTemplate","strictMode","scope","element","hash","templateOnly"],"mappings":";;;;;;;AAKA,SAASA,MAAAA,CACPC,WAA+B,EAC/BC,EAAuB,EAChB;AACP,EAAA,IAAIA,EAAA,EAAI;AACN,IAAA,OAAOA,EAAA;AACT,EAAA;EAEA,IAAID,gBAAgB,UAAA,EAAY;AAC9B,IAAA,OAAO,KAAA;AACT,EAAA;AACA,EAAA,OAAO,IAAA;AACT;AAEA;AACA;AACA,SAASE,WAAWF,WAA+B,EAAU;EAC3D,OAAOA,WAAA,KAAgB,UAAA;AACzB;AAEA,MAAM;AAAEG,EAAAA;AAAO,CAAE,GAAGC,SAAA,EAAA;AAEpB,MAAMC,OAuBD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,yRAAA,EAWL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAX,MAAA;IAAAI,OAAA;IAAAQ,IAAA;AAAAT,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAU,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"divider.js","sources":["../../../src/components/utilities/divider.gts"],"sourcesContent":["import { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { element } from 'ember-element-helper';\nimport type { TOC } from '@ember/component/template-only';\n\nfunction getTag(\n orientation: string | undefined,\n as?: string | undefined\n): string {\n if (as) {\n return as;\n }\n\n if (orientation === 'vertical') {\n return 'div';\n }\n return 'hr';\n}\n\n// The separator role is horizontal by default, so only the vertical case needs\n// stating. `<hr>` carries its orientation implicitly and needs neither.\nfunction isVertical(orientation: string | undefined): boolean {\n return orientation === 'vertical';\n}\n\nconst { divider } = useStyles();\n\nconst Divider: TOC<{\n Args: {\n /**\n * Which way the divider runs. A horizontal divider renders an `<hr>`; a\n * vertical one renders a `<div>`, since `<hr>` cannot express that.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n\n /**\n * The tag to render instead of the one the orientation would choose — for\n * example `li` when the divider sits between list items.\n */\n as?: string;\n\n /**\n * The divider's visual treatment. `sketch` renders the hand-drawn rule in\n * place of the flat line.\n *\n * Horizontal only — the artwork is a near-horizontal ribbon and cannot be\n * squashed into a vertical rule, so a vertical divider ignores this and\n * renders a plain line.\n *\n * @defaultValue 'solid'\n */\n variant?: 'solid' | 'sketch';\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library.\n */\n class?: string;\n };\n Element: Element;\n}> = <template>\n {{#let (element (getTag @orientation @as)) as |Tag|}}\n <Tag\n class={{divider\n (hash class=@class orientation=@orientation variant=@variant)\n }}\n role=\"separator\"\n aria-orientation={{if (isVertical @orientation) \"vertical\"}}\n data-component=\"divider\"\n data-part=\"base\"\n ...attributes\n />\n {{/let}}\n</template>;\n\nexport { Divider };\nexport default Divider;\n"],"names":["getTag","orientation","as","isVertical","divider","useStyles","Divider","setComponentTemplate","precompileTemplate","strictMode","scope","element","hash","templateOnly"],"mappings":";;;;;;;AAKA,SAASA,MAAAA,CACPC,WAA+B,EAC/BC,EAAuB,EAChB;AACP,EAAA,IAAIA,EAAA,EAAI;AACN,IAAA,OAAOA,EAAA;AACT,EAAA;EAEA,IAAID,gBAAgB,UAAA,EAAY;AAC9B,IAAA,OAAO,KAAA;AACT,EAAA;AACA,EAAA,OAAO,IAAA;AACT;AAEA;AACA;AACA,SAASE,WAAWF,WAA+B,EAAU;EAC3D,OAAOA,WAAA,KAAgB,UAAA;AACzB;AAEA,MAAM;AAAEG,EAAAA;AAAO,CAAE,GAAGC,SAAA,EAAA;AAEpB,MAAMC,OAmCD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,0SAAA,EAaL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAX,MAAA;IAAAI,OAAA;IAAAQ,IAAA;AAAAT,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAU,YAAA,EAAA;;"}
@@ -7,7 +7,7 @@ export { Kbd } from './kbd.js';
7
7
  export { isApplePlatform, parseKeys, resolveKbdPlatform, setKbdPlatform } from '../../utils/keys.js';
8
8
  export { Skeleton } from './skeleton.js';
9
9
  export { Spinner } from './spinner.js';
10
- export { ref } from '../../utils/ref.js';
10
+ export { Ref, ref } from '../../utils/ref.js';
11
11
  export { toggleState } from '../../utils/toggle.js';
12
12
  export { READY_ATTRIBUTE, selectionIndicator } from '../../utils/selection-indicator.js';
13
13
  export { rovingFocus } from '../../utils/roving-focus.js';
@@ -1 +1 @@
1
- {"version":3,"file":"kbd.js","sources":["../../../src/components/utilities/kbd.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { useStyles } from '@frontile/theme';\nimport { parseKeys } from '../../utils/keys';\nimport type { KbdKey, KbdPlatform } from '../../utils/keys';\nimport type { KbdSlots, SlotsToClasses } from '@frontile/theme';\n\nexport interface KbdSignature {\n Args: {\n /**\n * The shortcut to render, as `+`-separated keys: `\"mod+shift+p\"`.\n *\n * Named keys resolve to glyphs (`mod`, `shift`, `enter`, `esc`, `up`, …);\n * anything else renders verbatim, with a single letter capitalised. Use\n * `plus` for a literal `+`. A string with no `+` is one key, rendered as\n * given.\n *\n * Ignored when a block is passed.\n */\n keys?: string;\n\n /**\n * `split` gives each key its own cap; `merged` puts every glyph in one.\n *\n * @defaultValue 'split'\n */\n display?: 'split' | 'merged';\n\n /**\n * Rendered between caps, e.g. `\"+\"`. Only applies when `@display` is\n * `split`.\n */\n separator?: string;\n\n /**\n * @defaultValue 'md'\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * @defaultValue 'neutral'\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * `inherit` follows the colour it sits on, for keycaps on a filled row.\n * `plain` drops the box entirely, for quiet trailing shortcuts.\n *\n * @defaultValue 'solid'\n */\n variant?: 'solid' | 'outline' | 'subtle' | 'inherit' | 'plain';\n\n /**\n * Overrides the platform for this keycap only. Prefer `setKbdPlatform` to\n * set it once for the whole app.\n */\n platform?: KbdPlatform;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library.\n */\n class?: string;\n\n /**\n * Custom CSS classes for styling the individual slots: `base` for the\n * wrapper, `key` for each cap, `separator` for the character between caps.\n */\n classes?: SlotsToClasses<KbdSlots>;\n };\n Element: HTMLElement;\n Blocks: {\n /** Replaces `@keys` with arbitrary content, rendered as a single cap. */\n default: [];\n };\n}\n\n/**\n * Renders keyboard keys and shortcuts.\n *\n * A wrapper `<kbd>` holds one child `<kbd>` per key, which is the HTML\n * specification's own idiom for a key combination.\n */\nclass Kbd extends Component<KbdSignature> {\n get isMerged(): boolean {\n return this.args.display === 'merged';\n }\n\n @cached\n get keys(): KbdKey[] {\n return parseKeys(this.args.keys, this.args.platform);\n }\n\n get mergedGlyph(): string {\n return this.keys.map((key) => key.glyph).join('');\n }\n\n /**\n * The merged cap is read out as its key names, since a run of glyphs like\n * `⌘⇧P` is unintelligible to a screen reader.\n *\n * Undefined when no key in the run needs one, so a merged `esc` is not\n * announced \"Esc Escape\" — the same rule the split branch applies per key.\n */\n get mergedLabel(): string | undefined {\n if (!this.keys.some((key) => key.needsSpokenLabel)) {\n return undefined;\n }\n\n return this.keys.map((key) => key.name ?? key.glyph).join(' ');\n }\n\n /** The merged cap names its keys on hover, as each split cap does. */\n get mergedTitle(): string | undefined {\n const named = this.keys.filter((key) => key.name);\n\n return named.length ? named.map((key) => key.name).join(' ') : undefined;\n }\n\n // Cached because the template reads these once per key, and each read\n // otherwise re-resolves every compound variant in the theme.\n @cached\n get classNames() {\n const { kbd } = useStyles();\n const { classes } = this.args;\n\n const { base, key, separator } = kbd({\n size: this.args.size,\n color: this.args.color,\n variant: this.args.variant,\n isMerged: this.isMerged\n });\n\n return {\n base: base({ class: [classes?.base, this.args.class] }),\n key: key({ class: classes?.key }),\n separator: separator({ class: classes?.separator })\n };\n }\n\n <template>\n <kbd\n class={{this.classNames.base}}\n data-component=\"kbd\"\n data-part=\"base\"\n ...attributes\n >\n {{#if (has-block)}}\n <kbd class={{this.classNames.key}} data-part=\"key\">{{yield}}</kbd>\n {{else if this.isMerged}}\n <kbd\n class={{this.classNames.key}}\n data-part=\"key\"\n title={{this.mergedTitle}}\n >\n {{#if this.mergedLabel}}\n <span aria-hidden=\"true\">{{this.mergedGlyph}}</span>\n <span class=\"sr-only\">{{this.mergedLabel}}</span>\n {{else}}\n {{this.mergedGlyph}}\n {{/if}}\n </kbd>\n {{else}}\n {{#each this.keys as |key index|}}\n {{! index is 0 for the first key, so a separator falls between. }}\n {{#if index}}\n {{#if @separator}}\n <span\n class={{this.classNames.separator}}\n aria-hidden=\"true\"\n data-part=\"separator\"\n >{{@separator}}</span>\n {{/if}}\n {{/if}}\n\n <kbd class={{this.classNames.key}} data-part=\"key\" title={{key.name}}>\n {{#if key.needsSpokenLabel}}\n <span aria-hidden=\"true\">{{key.glyph}}</span>\n <span class=\"sr-only\">{{key.name}}</span>\n {{else}}\n {{key.glyph}}\n {{/if}}\n </kbd>\n {{/each}}\n {{/if}}\n </kbd>\n </template>\n}\n\nexport { Kbd };\nexport default Kbd;\n"],"names":["Kbd","Component","isMerged","args","display","keys","parseKeys","platform","n","prototype","cached","mergedGlyph","map","key","glyph","join","mergedLabel","some","needsSpokenLabel","undefined","name","mergedTitle","named","filter","length","classNames","kbd","useStyles","classes","base","separator","size","color","variant","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;;AAoFA;;;;;;AAMA,MAAMA,YAAYC,SAAA,CAAU;EAC1B,IAAIC,QAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,KAAK,QAAA;AAC/B,EAAA;EAEA,IACIC,OAAiB;AACnB,IAAA,OAAOC,SAAA,CAAU,IAAI,CAACH,IAAI,CAACE,IAAI,EAAE,IAAI,CAACF,IAAI,CAACI,QAAQ,CAAA;AACrD,EAAA;AAAA,EAAA;IAAAC,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,MAAA,EAAA,CAHCC,MAAA,CAAA,CAAA;AAAA;EAKD,IAAIC,WAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACO,GAAG,CAAEC,GAAA,IAAQA,GAAA,CAAIC,KAAK,CAAA,CAAEC,IAAI,CAAC,EAAA,CAAA;AAChD,EAAA;AAEA;;;;;;AAMC;EACD,IAAIC,WAAAA,GAAkC;AACpC,IAAA,IAAI,CAAC,IAAI,CAACX,IAAI,CAACY,IAAI,CAAEJ,GAAA,IAAQA,GAAA,CAAIK,gBAAgB,CAAA,EAAG;AAClD,MAAA,OAAOC,SAAA;AACT,IAAA;IAEA,OAAO,IAAI,CAACd,IAAI,CAACO,GAAG,CAAEC,GAAA,IAAQA,GAAA,CAAIO,IAAI,IAAIP,GAAA,CAAIC,KAAK,CAAA,CAAEC,IAAI,CAAC,GAAA,CAAA;AAC5D,EAAA;AAEA;EACA,IAAIM,WAAAA,GAAkC;AACpC,IAAA,MAAMC,KAAA,GAAQ,IAAI,CAACjB,IAAI,CAACkB,MAAM,CAAEV,GAAA,IAAQA,GAAA,CAAIO,IAAI,CAAA;IAEhD,OAAOE,KAAA,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immer/component';\nimport { cached } from '@glimmer/tracking';\nimport { useStyles } from '@frontile/theme';\nimport { parseKeys } from '../../utils/keys';\nimport type { KbdKey, KbdPlatform } from '../../utils/keys';\nimport type { KbdSlots, SlotsToClasses } from '@frontile/theme';\n\nexport interface KbdSignature {\n Args: {\n /**\n * The shortcut to render, as `+`-separated keys: `\"mod+shift+p\"`.\n *\n * Named keys resolve to glyphs (`mod`, `shift`, `enter`, `esc`, `up`, …);\n * anything else renders verbatim, with a single letter capitalised. Use\n * `plus` for a literal `+`. A string with no `+` is one key, rendered as\n * given.\n *\n * Ignored when a block is passed.\n */\n keys?: string;\n\n /**\n * `split` gives each key its own cap; `merged` puts every glyph in one.\n *\n * @defaultValue 'split'\n */\n display?: 'split' | 'merged';\n\n /**\n * Rendered between caps, e.g. `\"+\"`. Only applies when `@display` is\n * `split`.\n */\n separator?: string;\n\n /**\n * @defaultValue 'md'\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * @defaultValue 'neutral'\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * `inherit` follows the colour it sits on, for keycaps on a filled row.\n * `plain` drops the box entirely, for quiet trailing shortcuts.\n *\n * @defaultValue 'solid'\n */\n variant?: 'solid' | 'outline' | 'subtle' | 'inherit' | 'plain';\n\n /**\n * Overrides the platform for this keycap only. Prefer `setKbdPlatform` to\n * set it once for the whole app.\n */\n platform?: KbdPlatform;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library.\n */\n class?: string;\n\n /**\n * Custom CSS classes for styling the individual slots: `base` for the\n * wrapper, `key` for each cap, `separator` for the character between caps.\n */\n classes?: SlotsToClasses<KbdSlots>;\n };\n Element: HTMLElement;\n Blocks: {\n /** Replaces `@keys` with arbitrary content, rendered as a single cap. */\n default: [];\n };\n}\n\n/**\n * Renders keyboard keys and shortcuts.\n *\n * A wrapper `<kbd>` holds one child `<kbd>` per key, which is the HTML\n * specification's own idiom for a key combination.\n */\nclass Kbd extends Component<KbdSignature> {\n get isMerged(): boolean {\n return this.args.display === 'merged';\n }\n\n @cached\n get keys(): KbdKey[] {\n return parseKeys(this.args.keys, this.args.platform);\n }\n\n get mergedGlyph(): string {\n return this.keys.map((key) => key.glyph).join('');\n }\n\n /**\n * The merged cap is read out as its key names, since a run of glyphs like\n * `⌘⇧P` is unintelligible to a screen reader.\n *\n * Undefined when no key in the run needs one, so a merged `esc` is not\n * announced \"Esc Escape\" — the same rule the split branch applies per key.\n */\n get mergedLabel(): string | undefined {\n if (!this.keys.some((key) => key.needsSpokenLabel)) {\n return undefined;\n }\n\n return this.keys.map((key) => key.name ?? key.glyph).join(' ');\n }\n\n /** The merged cap names its keys on hover, as each split cap does. */\n get mergedTitle(): string | undefined {\n const named = this.keys.filter((key) => key.name);\n\n return named.length ? named.map((key) => key.name).join(' ') : undefined;\n }\n\n // Cached because the template reads these once per key, and each read\n // otherwise re-resolves every compound variant in the theme.\n @cached\n get classNames() {\n const { kbd } = useStyles();\n const { classes } = this.args;\n\n const { base, key, separator } = kbd({\n size: this.args.size,\n color: this.args.color,\n variant: this.args.variant,\n isMerged: this.isMerged\n });\n\n return {\n base: base({ class: [classes?.base, this.args.class] }),\n key: key({ class: classes?.key }),\n separator: separator({ class: classes?.separator })\n };\n }\n\n <template>\n <kbd\n class={{this.classNames.base}}\n data-component=\"kbd\"\n data-part=\"base\"\n ...attributes\n >\n {{#if (has-block)}}\n <kbd class={{this.classNames.key}} data-part=\"key\">{{yield}}</kbd>\n {{else if this.isMerged}}\n <kbd\n class={{this.classNames.key}}\n data-part=\"key\"\n title={{this.mergedTitle}}\n >\n {{#if this.mergedLabel}}\n <span aria-hidden=\"true\">{{this.mergedGlyph}}</span>\n <span class=\"sr-only\">{{this.mergedLabel}}</span>\n {{else}}\n {{this.mergedGlyph}}\n {{/if}}\n </kbd>\n {{else}}\n {{#each this.keys as |key index|}}\n {{! index is 0 for the first key, so a separator falls between. }}\n {{#if index}}\n {{#if @separator}}\n <span\n class={{this.classNames.separator}}\n aria-hidden=\"true\"\n data-part=\"separator\"\n >{{@separator}}</span>\n {{/if}}\n {{/if}}\n\n <kbd class={{this.classNames.key}} data-part=\"key\" title={{key.name}}>\n {{#if key.needsSpokenLabel}}\n <span aria-hidden=\"true\">{{key.glyph}}</span>\n <span class=\"sr-only\">{{key.name}}</span>\n {{else}}\n {{key.glyph}}\n {{/if}}\n </kbd>\n {{/each}}\n {{/if}}\n </kbd>\n </template>\n}\n\nexport { Kbd };\nexport default Kbd;\n"],"names":["Kbd","Component","isMerged","args","display","keys","parseKeys","platform","n","prototype","cached","mergedGlyph","map","key","glyph","join","mergedLabel","some","needsSpokenLabel","undefined","name","mergedTitle","named","filter","length","classNames","kbd","useStyles","classes","base","separator","size","color","variant","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;;AAoFA;;;;;;AAMA,MAAMA,YAAYC,SAAA,CAAU;EAC1B,IAAIC,QAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,KAAK,QAAA;AAC/B,EAAA;EAEA,IACIC,OAAiB;AACnB,IAAA,OAAOC,SAAA,CAAU,IAAI,CAACH,IAAI,CAACE,IAAI,EAAE,IAAI,CAACF,IAAI,CAACI,QAAQ,CAAA;AACrD,EAAA;AAAA,EAAA;IAAAC,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,MAAA,EAAA,CAHCC,MAAA,CAAA,CAAA;AAAA;EAKD,IAAIC,WAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACO,GAAG,CAAEC,GAAA,IAAQA,GAAA,CAAIC,KAAK,CAAA,CAAEC,IAAI,CAAC,EAAA,CAAA;AAChD,EAAA;AAEA;;;;;;AAMC;EACD,IAAIC,WAAAA,GAAkC;AACpC,IAAA,IAAI,CAAC,IAAI,CAACX,IAAI,CAACY,IAAI,CAAEJ,GAAA,IAAQA,GAAA,CAAIK,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AWA,SAAA,CAAU;QAAEI,KAAA,EAAON,OAAA,EAASE;OAAU;KACnD;AACF,EAAA;AAAA,EAAA;IAAAtB,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,YAAA,EAAA,CAjBCC,MAAA,CAAA,CAAA;AAAA;AAmBD,EAAA;IAAAyB,oBAAA,CAAAC,kBAAA,CAAA,yrCAAA,EA8CA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.js","sources":["../../../src/components/utilities/skeleton.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\nimport { useStyles, type SkeletonVariants } from '@frontile/theme';\n\nconst Skeleton: TOC<{\n Args: {\n class?: string;\n /**\n * Shape preset. `text` fills its container at text height; `circle` and\n * `square` are equal-sided and match Avatar's radii; `rounded` and `rect`\n * fill their container for image and card placeholders.\n *\n * @defaultValue 'text'\n */\n shape?: SkeletonVariants['shape'];\n /**\n * Size preset. For `circle` and `square` this sets both dimensions from\n * Avatar's scale; for the other shapes it sets the height.\n *\n * @defaultValue 'md'\n */\n size?: SkeletonVariants['size'];\n /**\n * Animation style for the placeholder.\n *\n * @defaultValue 'shimmer'\n */\n animation?: SkeletonVariants['animation'];\n };\n Element: HTMLDivElement;\n}> = <template>\n {{#let (useStyles) as |styles|}}\n <div\n class={{styles.skeleton\n class=@class\n shape=@shape\n size=@size\n animation=@animation\n }}\n aria-hidden=\"true\"\n data-component=\"skeleton\"\n data-part=\"base\"\n ...attributes\n ></div>\n {{/let}}\n</template>;\n\nexport { Skeleton };\nexport default Skeleton;\n"],"names":["Skeleton","setComponentTemplate","precompileTemplate","strictMode","scope","useStyles","templateOnly"],"mappings":";;;;;AAGA,MAAMA,QA0BD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,iOAAA,EAeL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
1
+ {"version":3,"file":"skeleton.js","sources":["../../../src/components/utilities/skeleton.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\nimport { useStyles, type SkeletonVariants } from '@frontile/theme';\n\nconst Skeleton: TOC<{\n Args: {\n class?: string;\n /**\n * Shape preset. `text` fills its container at text height; `circle` and\n * `square` are equal-sided and match Avatar's radii; `rounded` and `rect`\n * fill their container for image and card placeholders.\n *\n * @defaultValue 'text'\n */\n shape?: SkeletonVariants['shape'];\n /**\n * Size preset. For `circle` and `square` this sets both dimensions from\n * Avatar's scale; for the other shapes it sets the height.\n *\n * @defaultValue 'md'\n */\n size?: SkeletonVariants['size'];\n /**\n * Animation style for the placeholder.\n *\n * @defaultValue 'shimmer'\n */\n animation?: SkeletonVariants['animation'];\n };\n Element: HTMLDivElement;\n}> = <template>\n {{#let (useStyles) as |styles|}}\n <div\n class={{styles.skeleton\n class=@class\n shape=@shape\n size=@size\n animation=@animation\n }}\n aria-hidden=\"true\"\n data-component=\"skeleton\"\n data-part=\"base\"\n ...attributes\n ></div>\n {{/let}}\n</template>;\n\nexport { Skeleton };\nexport default Skeleton;\n"],"names":["Skeleton","setComponentTemplate","precompileTemplate","strictMode","scope","useStyles","templateOnly"],"mappings":";;;;;AAGA,MAAMA,QA0BD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,iOAAA,EAeL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sources":["../../../src/components/utilities/spinner.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, type SpinnerVariants } from '@frontile/theme';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface SpinnerSignature {\n Args: {\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library. Use `fill-*` for the highlighted arc and `text-*` for the track.\n */\n class?: string;\n\n /**\n * The size of the spinner.\n *\n * @defaultValue 'md'\n */\n size?: SpinnerVariants['size'];\n\n /**\n * The color of the spinner.\n *\n * @defaultValue 'neutral'\n */\n color?: SpinnerVariants['color'];\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n };\n Element: SVGElement;\n}\n\nclass Spinner extends Component<SpinnerSignature> {\n get classNames() {\n const { spinner } = useStyles();\n\n return spinner({\n class: this.args.class,\n size: this.args.size,\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Spinner',\n from: 'intent',\n to: 'color',\n id: 'frontile.spinner.intent'\n }\n ) || 'neutral'\n });\n }\n\n <template>\n {{! A spinner is decorative: the loading state belongs on the region that\n is loading, not on the graphic. Hidden by default so it is not announced as\n an unnamed image; attributes are applied last, so a caller that really wants\n it announced can pass its own aria-hidden and label. }}\n <svg\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n data-component=\"spinner\"\n data-part=\"base\"\n class={{this.classNames}}\n ...attributes\n >\n <path\n d=\"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8z\"\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n\n <path\n d=\"M7.25.75A.75.75 0 018 0a8 8 0 018 8 .75.75 0 01-1.5 0A6.5 6.5 0 008 1.5a.75.75 0 01-.75-.75z\"\n fill=\"currentFill\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </template>\n}\n\nexport { Spinner, type SpinnerSignature };\nexport default Spinner;\n"],"names":["Spinner","Component","classNames","spinner","useStyles","class","args","size","color","renamedArgValue","intent","default","component","from","to","id","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAyCA,MAAMA,gBAAgBC,SAAA,CAAU;EAC9B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAS,GAAGC,SAAA,EAAA;AAEpB,IAAA,OAAOD,OAAA,CAAQ;AACbE,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD,KAAK;AACtBE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,KAAA,EACEC,eAAA,CACE,IAAI,CAACH,IAAI,CAACE,KAAK,EACf,IAAI,CAACF,IAAI,CAACI,MAAM,EAChB;AAAEC,QAAAA,OAAA,EAAS;AAAU,OAAA,EACrB;AACEC,QAAAA,SAAA,EAAW,SAAA;AACXC,QAAAA,IAAA,EAAM,QAAA;AACNC,QAAAA,EAAA,EAAI,OAAA;AACJC,QAAAA,EAAA,EAAI;AACN,OAAA,CAAA,IACG;AACT,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,syBAAA,EA4BA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"spinner.js","sources":["../../../src/components/utilities/spinner.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, type SpinnerVariants } from '@frontile/theme';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface SpinnerSignature {\n Args: {\n /**\n * Custom class name, it will override the default ones using Tailwind Merge\n * library. Use `fill-*` for the highlighted arc and `text-*` for the track.\n */\n class?: string;\n\n /**\n * The size of the spinner.\n *\n * @defaultValue 'md'\n */\n size?: SpinnerVariants['size'];\n\n /**\n * The color of the spinner.\n *\n * @defaultValue 'neutral'\n */\n color?: SpinnerVariants['color'];\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n };\n Element: SVGElement;\n}\n\nclass Spinner extends Component<SpinnerSignature> {\n get classNames() {\n const { spinner } = useStyles();\n\n return spinner({\n class: this.args.class,\n size: this.args.size,\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Spinner',\n from: 'intent',\n to: 'color',\n id: 'frontile.spinner.intent'\n }\n ) || 'neutral'\n });\n }\n\n <template>\n {{! A spinner is decorative: the loading state belongs on the region that\n is loading, not on the graphic. Hidden by default so it is not announced as\n an unnamed image; attributes are applied last, so a caller that really wants\n it announced can pass its own aria-hidden and label. }}\n <svg\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n data-component=\"spinner\"\n data-part=\"base\"\n class={{this.classNames}}\n ...attributes\n >\n <path\n d=\"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8z\"\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n\n <path\n d=\"M7.25.75A.75.75 0 018 0a8 8 0 018 8 .75.75 0 01-1.5 0A6.5 6.5 0 008 1.5a.75.75 0 01-.75-.75z\"\n fill=\"currentFill\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n </template>\n}\n\nexport { Spinner, type SpinnerSignature };\nexport default Spinner;\n"],"names":["Spinner","Component","classNames","spinner","useStyles","class","args","size","color","renamedArgValue","intent","default","component","from","to","id","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAyCA,MAAMA,gBAAgBC,SAAA,CAAU;EAC9B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAS,GAAGC,SAAA,EAAA;AAEpB,IAAA,OAAOD,OAAA,CAAQ;AACbE,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD,KAAK;AACtBE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,KAAA,EACEC,eAAA,CACE,IAAI,CAACH,IAAI,CAACE,KAAK,EACf,IAAI,CAACF,IAAI,CAACI,MAAM,EAChB;AAAEC,QAAAA,OAAA,EAAS;AAAU,OAAA,EACrB;AACEC,QAAAA,SAAA,EAAW,SAAA;AACXC,QAAAA,IAAA,EAAM,QAAA;AACNC,QAAAA,EAAA,EAAI,OAAA;AACJC,QAAAA,EAAA,EAAI;AACN,OAAA,CAAA,IACG;AACT,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,syBAAA,EA4BA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}