frontile 0.18.0-alpha.2 → 0.18.0-alpha.20

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 (499) hide show
  1. package/declarations/-private/control-blur.d.ts +63 -0
  2. package/declarations/-private/dialog.d.ts +15 -0
  3. package/declarations/-private/dom.d.ts +3 -0
  4. package/declarations/-private/get-config.d.ts +2 -0
  5. package/declarations/-private/intent-icons.d.ts +9 -0
  6. package/declarations/-private/manager.d.ts +20 -0
  7. package/declarations/-private/notification-stack.d.ts +76 -0
  8. package/declarations/-private/notification.d.ts +40 -0
  9. package/declarations/-private/timer.d.ts +12 -0
  10. package/declarations/-private/types.d.ts +126 -0
  11. package/declarations/buttons.d.ts +1 -0
  12. package/declarations/collections.d.ts +1 -0
  13. package/declarations/components/buttons/button-group.d.ts +24 -0
  14. package/declarations/components/buttons/button.d.ts +88 -0
  15. package/declarations/components/buttons/chip.d.ts +85 -0
  16. package/declarations/components/buttons/close-button.d.ts +55 -0
  17. package/declarations/components/buttons/index.d.ts +6 -0
  18. package/declarations/components/buttons/segmented-control/item.d.ts +50 -0
  19. package/declarations/components/buttons/segmented-control/segmented-control.d.ts +210 -0
  20. package/declarations/components/buttons/segmented-control.d.ts +3 -0
  21. package/declarations/components/buttons/toggle-button.d.ts +28 -0
  22. package/declarations/components/collections/calendar/calendar.d.ts +585 -0
  23. package/declarations/components/collections/calendar/day-cell.d.ts +19 -0
  24. package/declarations/components/collections/calendar/header.d.ts +56 -0
  25. package/declarations/components/collections/calendar/icons.d.ts +14 -0
  26. package/declarations/components/collections/calendar/month-grid.d.ts +36 -0
  27. package/declarations/components/collections/calendar/types.d.ts +94 -0
  28. package/declarations/components/collections/calendar/utils.d.ts +51 -0
  29. package/declarations/components/collections/calendar/year-grid.d.ts +32 -0
  30. package/declarations/components/collections/calendar.d.ts +3 -0
  31. package/declarations/components/collections/command/command.d.ts +195 -0
  32. package/declarations/components/collections/command/dialog.d.ts +44 -0
  33. package/declarations/components/collections/command/footer.d.ts +61 -0
  34. package/declarations/components/collections/command/index.d.ts +6 -0
  35. package/declarations/components/collections/command/input.d.ts +131 -0
  36. package/declarations/components/collections/command/list.d.ts +135 -0
  37. package/declarations/components/collections/command.d.ts +2 -0
  38. package/declarations/components/collections/dropdown/dropdown.d.ts +190 -0
  39. package/declarations/components/collections/dropdown/menu-context.d.ts +64 -0
  40. package/declarations/components/collections/dropdown/sub.d.ts +195 -0
  41. package/declarations/components/collections/dropdown.d.ts +2 -0
  42. package/declarations/components/collections/index.d.ts +5 -0
  43. package/declarations/components/collections/listbox/group.d.ts +62 -0
  44. package/declarations/components/collections/listbox/item.d.ts +140 -0
  45. package/declarations/components/collections/listbox/listbox.d.ts +102 -0
  46. package/declarations/components/collections/listbox.d.ts +2 -0
  47. package/declarations/components/collections/simple-table/body.d.ts +481 -0
  48. package/declarations/components/collections/simple-table/cell.d.ts +479 -0
  49. package/declarations/components/collections/simple-table/column.d.ts +471 -0
  50. package/declarations/components/collections/simple-table/footer.d.ts +482 -0
  51. package/declarations/components/collections/simple-table/header.d.ts +482 -0
  52. package/declarations/components/collections/simple-table/index.d.ts +498 -0
  53. package/declarations/components/collections/simple-table/row.d.ts +483 -0
  54. package/declarations/components/collections/table/cell-default.d.ts +43 -0
  55. package/declarations/components/collections/table/cell-for.d.ts +38 -0
  56. package/declarations/components/collections/table/cell-rendering-context.d.ts +24 -0
  57. package/declarations/components/collections/table/checkbox.d.ts +50 -0
  58. package/declarations/components/collections/table/column-visibility.d.ts +468 -0
  59. package/declarations/components/collections/table/icons.d.ts +11 -0
  60. package/declarations/components/collections/table/index.d.ts +4 -0
  61. package/declarations/components/collections/table/sort-button.d.ts +465 -0
  62. package/declarations/components/collections/table/table.d.ts +627 -0
  63. package/declarations/components/collections/table/types.d.ts +58 -0
  64. package/declarations/components/collections/table/utils.d.ts +6 -0
  65. package/declarations/components/collections/table.d.ts +2 -0
  66. package/declarations/components/disclosure/accordion/accordion.d.ts +247 -0
  67. package/declarations/components/disclosure/accordion/item.d.ts +96 -0
  68. package/declarations/components/disclosure/accordion.d.ts +3 -0
  69. package/declarations/components/disclosure/icons.d.ts +9 -0
  70. package/declarations/components/disclosure/index.d.ts +1 -0
  71. package/declarations/components/forms/autocomplete.d.ts +446 -0
  72. package/declarations/components/forms/checkbox-group.d.ts +62 -0
  73. package/declarations/components/forms/checkbox.d.ts +62 -0
  74. package/declarations/components/forms/field-types.d.ts +14 -0
  75. package/declarations/components/forms/field.d.ts +87 -0
  76. package/declarations/components/forms/form-control.d.ts +101 -0
  77. package/declarations/components/forms/form-description.d.ts +30 -0
  78. package/declarations/components/forms/form-feedback.d.ts +64 -0
  79. package/declarations/components/forms/form.d.ts +255 -0
  80. package/declarations/components/forms/icons.d.ts +7 -0
  81. package/declarations/components/forms/index.d.ts +20 -0
  82. package/declarations/components/forms/input-otp.d.ts +321 -0
  83. package/declarations/components/forms/input.d.ts +188 -0
  84. package/declarations/components/forms/label.d.ts +53 -0
  85. package/declarations/components/forms/native-select.d.ts +251 -0
  86. package/declarations/components/forms/radio-group.d.ts +64 -0
  87. package/declarations/components/forms/radio.d.ts +68 -0
  88. package/declarations/components/forms/select/end-content.d.ts +31 -0
  89. package/declarations/components/forms/select/native-mirror.d.ts +44 -0
  90. package/declarations/components/forms/select/select.d.ts +454 -0
  91. package/declarations/components/forms/select/selected-items.d.ts +80 -0
  92. package/declarations/components/forms/select/trigger.d.ts +81 -0
  93. package/declarations/components/forms/select/types.d.ts +431 -0
  94. package/declarations/components/forms/select.d.ts +2 -0
  95. package/declarations/components/forms/switch.d.ts +152 -0
  96. package/declarations/components/forms/textarea.d.ts +104 -0
  97. package/declarations/components/navigation/external-link.d.ts +94 -0
  98. package/declarations/components/navigation/index.d.ts +4 -0
  99. package/declarations/components/navigation/pagination/icons.d.ts +13 -0
  100. package/declarations/components/navigation/pagination/pagination.d.ts +279 -0
  101. package/declarations/components/navigation/pagination/range.d.ts +34 -0
  102. package/declarations/components/navigation/pagination.d.ts +3 -0
  103. package/declarations/components/navigation/tab-nav/item.d.ts +79 -0
  104. package/declarations/components/navigation/tab-nav/tab-nav.d.ts +165 -0
  105. package/declarations/components/navigation/tab-nav.d.ts +3 -0
  106. package/declarations/components/navigation/tabs/panel.d.ts +28 -0
  107. package/declarations/components/navigation/tabs/tab.d.ts +46 -0
  108. package/declarations/components/navigation/tabs/tabs.d.ts +227 -0
  109. package/declarations/components/navigation/tabs.d.ts +4 -0
  110. package/declarations/components/notifications/icons.d.ts +9 -0
  111. package/declarations/components/notifications/index.d.ts +12 -0
  112. package/declarations/components/notifications/notification-card.d.ts +100 -0
  113. package/declarations/components/notifications/notifications-container.d.ts +148 -0
  114. package/declarations/components/overlays/backdrop.d.ts +39 -0
  115. package/declarations/components/overlays/drawer/body.d.ts +17 -0
  116. package/declarations/components/overlays/drawer/drag-handle.d.ts +26 -0
  117. package/declarations/components/overlays/drawer/footer.d.ts +17 -0
  118. package/declarations/components/overlays/drawer/header.d.ts +140 -0
  119. package/declarations/components/overlays/drawer/selectors.d.ts +22 -0
  120. package/declarations/components/overlays/drawer.d.ts +293 -0
  121. package/declarations/components/overlays/index.d.ts +14 -0
  122. package/declarations/components/overlays/modal/body.d.ts +17 -0
  123. package/declarations/components/overlays/modal/footer.d.ts +17 -0
  124. package/declarations/components/overlays/modal/header.d.ts +35 -0
  125. package/declarations/components/overlays/modal.d.ts +146 -0
  126. package/declarations/components/overlays/mount-animation.d.ts +81 -0
  127. package/declarations/components/overlays/overlay.d.ts +218 -0
  128. package/declarations/components/overlays/popover.d.ts +452 -0
  129. package/declarations/components/overlays/portal-target.d.ts +19 -0
  130. package/declarations/components/overlays/portal.d.ts +38 -0
  131. package/declarations/components/overlays/tooltip.d.ts +401 -0
  132. package/declarations/components/status/alert.d.ts +134 -0
  133. package/declarations/components/status/index.d.ts +2 -0
  134. package/declarations/components/status/progress-bar.d.ts +115 -0
  135. package/declarations/components/utilities/avatar.d.ts +90 -0
  136. package/declarations/components/utilities/collapsible.d.ts +64 -0
  137. package/declarations/components/utilities/divider.d.ts +25 -0
  138. package/declarations/components/utilities/index.d.ts +15 -0
  139. package/declarations/components/utilities/kbd.d.ts +92 -0
  140. package/declarations/components/utilities/skeleton.d.ts +31 -0
  141. package/declarations/components/utilities/spinner.d.ts +26 -0
  142. package/declarations/components/utilities/visually-hidden.d.ts +9 -0
  143. package/declarations/disclosure.d.ts +1 -0
  144. package/declarations/forms.d.ts +1 -0
  145. package/declarations/index.d.ts +9 -7
  146. package/declarations/modifiers/drag-to-dismiss.d.ts +22 -0
  147. package/declarations/modifiers/press.d.ts +55 -0
  148. package/declarations/navigation.d.ts +1 -0
  149. package/declarations/notifications.d.ts +1 -0
  150. package/declarations/overlays.d.ts +1 -0
  151. package/declarations/services/notifications.d.ts +20 -0
  152. package/declarations/status.d.ts +1 -0
  153. package/declarations/template-registry.d.ts +55 -2
  154. package/declarations/test-support.d.ts +3 -0
  155. package/declarations/utilities.d.ts +1 -0
  156. package/declarations/utils/deferred-work.d.ts +24 -0
  157. package/declarations/utils/filter.d.ts +87 -0
  158. package/declarations/utils/forms-utils-index.d.ts +3 -0
  159. package/declarations/utils/keys.d.ts +52 -0
  160. package/declarations/utils/listManager.d.ts +158 -0
  161. package/declarations/utils/nested-data.d.ts +44 -0
  162. package/declarations/utils/prefers-reduced-motion.d.ts +3 -0
  163. package/declarations/utils/ref.d.ts +14 -0
  164. package/declarations/utils/roving-focus.d.ts +66 -0
  165. package/declarations/utils/safe-area.d.ts +52 -0
  166. package/declarations/utils/safe-styles.d.ts +2 -0
  167. package/declarations/utils/selection-indicator.d.ts +65 -0
  168. package/declarations/utils/standard-validator.d.ts +176 -0
  169. package/declarations/utils/toggle.d.ts +9 -0
  170. package/dist/_app_/services/notifications.js +1 -0
  171. package/dist/buttons.js +8 -0
  172. package/dist/buttons.js.map +1 -0
  173. package/dist/collections.js +13 -0
  174. package/dist/collections.js.map +1 -0
  175. package/dist/components/buttons/button-group.js +31 -0
  176. package/dist/components/buttons/button-group.js.map +1 -0
  177. package/dist/components/buttons/button.js +120 -0
  178. package/dist/components/buttons/button.js.map +1 -0
  179. package/dist/components/buttons/chip.js +44 -0
  180. package/dist/components/buttons/chip.js.map +1 -0
  181. package/dist/components/buttons/close-button.js +84 -0
  182. package/dist/components/buttons/close-button.js.map +1 -0
  183. package/dist/components/buttons/index.js +8 -0
  184. package/dist/components/buttons/index.js.map +1 -0
  185. package/dist/components/buttons/segmented-control/item.js +55 -0
  186. package/dist/components/buttons/segmented-control/item.js.map +1 -0
  187. package/dist/components/buttons/segmented-control/segmented-control.js +175 -0
  188. package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -0
  189. package/dist/components/buttons/segmented-control.js +3 -0
  190. package/dist/components/buttons/segmented-control.js.map +1 -0
  191. package/dist/components/buttons/toggle-button.js +40 -0
  192. package/dist/components/buttons/toggle-button.js.map +1 -0
  193. package/dist/components/collections/calendar/calendar.js +808 -0
  194. package/dist/components/collections/calendar/calendar.js.map +1 -0
  195. package/dist/components/collections/calendar/day-cell.js +16 -0
  196. package/dist/components/collections/calendar/day-cell.js.map +1 -0
  197. package/dist/components/collections/calendar/header.js +48 -0
  198. package/dist/components/collections/calendar/header.js.map +1 -0
  199. package/dist/components/collections/calendar/icons.js +23 -0
  200. package/dist/components/collections/calendar/icons.js.map +1 -0
  201. package/dist/components/collections/calendar/month-grid.js +14 -0
  202. package/dist/components/collections/calendar/month-grid.js.map +1 -0
  203. package/dist/components/collections/calendar/types.js +2 -0
  204. package/dist/components/collections/calendar/types.js.map +1 -0
  205. package/dist/components/collections/calendar/utils.js +199 -0
  206. package/dist/components/collections/calendar/utils.js.map +1 -0
  207. package/dist/components/collections/calendar/year-grid.js +117 -0
  208. package/dist/components/collections/calendar/year-grid.js.map +1 -0
  209. package/dist/components/collections/calendar.js +2 -0
  210. package/dist/components/collections/calendar.js.map +1 -0
  211. package/dist/components/collections/command/command.js +263 -0
  212. package/dist/components/collections/command/command.js.map +1 -0
  213. package/dist/components/collections/command/dialog.js +100 -0
  214. package/dist/components/collections/command/dialog.js.map +1 -0
  215. package/dist/components/collections/command/footer.js +60 -0
  216. package/dist/components/collections/command/footer.js.map +1 -0
  217. package/dist/components/collections/command/index.js +6 -0
  218. package/dist/components/collections/command/index.js.map +1 -0
  219. package/dist/components/collections/command/input.js +45 -0
  220. package/dist/components/collections/command/input.js.map +1 -0
  221. package/dist/components/collections/command/list.js +70 -0
  222. package/dist/components/collections/command/list.js.map +1 -0
  223. package/dist/components/collections/command.js +6 -0
  224. package/dist/components/collections/command.js.map +1 -0
  225. package/dist/components/collections/dropdown/dropdown.js +206 -0
  226. package/dist/components/collections/dropdown/dropdown.js.map +1 -0
  227. package/dist/components/collections/dropdown/menu-context.js +62 -0
  228. package/dist/components/collections/dropdown/menu-context.js.map +1 -0
  229. package/dist/components/collections/dropdown/sub.js +256 -0
  230. package/dist/components/collections/dropdown/sub.js.map +1 -0
  231. package/dist/components/collections/dropdown.js +2 -0
  232. package/dist/components/collections/dropdown.js.map +1 -0
  233. package/dist/components/collections/index.js +13 -0
  234. package/dist/components/collections/index.js.map +1 -0
  235. package/dist/components/collections/listbox/group.js +60 -0
  236. package/dist/components/collections/listbox/group.js.map +1 -0
  237. package/dist/components/collections/listbox/item.js +197 -0
  238. package/dist/components/collections/listbox/item.js.map +1 -0
  239. package/dist/components/collections/listbox/listbox.js +187 -0
  240. package/dist/components/collections/listbox/listbox.js.map +1 -0
  241. package/dist/components/collections/listbox.js +4 -0
  242. package/dist/components/collections/listbox.js.map +1 -0
  243. package/dist/components/collections/simple-table/body.js +32 -0
  244. package/dist/components/collections/simple-table/body.js.map +1 -0
  245. package/dist/components/collections/simple-table/cell.js +27 -0
  246. package/dist/components/collections/simple-table/cell.js.map +1 -0
  247. package/dist/components/collections/simple-table/column.js +26 -0
  248. package/dist/components/collections/simple-table/column.js.map +1 -0
  249. package/dist/components/collections/simple-table/footer.js +44 -0
  250. package/dist/components/collections/simple-table/footer.js.map +1 -0
  251. package/dist/components/collections/simple-table/header.js +44 -0
  252. package/dist/components/collections/simple-table/header.js.map +1 -0
  253. package/dist/components/collections/simple-table/index.js +60 -0
  254. package/dist/components/collections/simple-table/index.js.map +1 -0
  255. package/dist/components/collections/simple-table/row.js +33 -0
  256. package/dist/components/collections/simple-table/row.js.map +1 -0
  257. package/dist/components/collections/table/cell-default.js +39 -0
  258. package/dist/components/collections/table/cell-default.js.map +1 -0
  259. package/dist/components/collections/table/cell-for.js +34 -0
  260. package/dist/components/collections/table/cell-for.js.map +1 -0
  261. package/dist/components/collections/table/cell-rendering-context.js +39 -0
  262. package/dist/components/collections/table/cell-rendering-context.js.map +1 -0
  263. package/dist/components/collections/table/checkbox.js +53 -0
  264. package/dist/components/collections/table/checkbox.js.map +1 -0
  265. package/dist/components/collections/table/column-visibility.js +58 -0
  266. package/dist/components/collections/table/column-visibility.js.map +1 -0
  267. package/dist/components/collections/table/icons.js +19 -0
  268. package/dist/components/collections/table/icons.js.map +1 -0
  269. package/dist/components/collections/table/index.js +3 -0
  270. package/dist/components/collections/table/index.js.map +1 -0
  271. package/dist/components/collections/table/sort-button.js +32 -0
  272. package/dist/components/collections/table/sort-button.js.map +1 -0
  273. package/dist/components/collections/table/table.js +488 -0
  274. package/dist/components/collections/table/table.js.map +1 -0
  275. package/dist/components/collections/table/types.js +2 -0
  276. package/dist/components/collections/table/types.js.map +1 -0
  277. package/dist/components/collections/table/utils.js +19 -0
  278. package/dist/components/collections/table/utils.js.map +1 -0
  279. package/dist/components/collections/table.js +3 -0
  280. package/dist/components/collections/table.js.map +1 -0
  281. package/dist/components/disclosure/accordion/accordion.js +225 -0
  282. package/dist/components/disclosure/accordion/accordion.js.map +1 -0
  283. package/dist/components/disclosure/accordion/item.js +86 -0
  284. package/dist/components/disclosure/accordion/item.js.map +1 -0
  285. package/dist/components/disclosure/accordion.js +3 -0
  286. package/dist/components/disclosure/accordion.js.map +1 -0
  287. package/dist/components/disclosure/icons.js +13 -0
  288. package/dist/components/disclosure/icons.js.map +1 -0
  289. package/dist/components/disclosure/index.js +3 -0
  290. package/dist/components/disclosure/index.js.map +1 -0
  291. package/dist/components/forms/autocomplete.js +351 -0
  292. package/dist/components/forms/autocomplete.js.map +1 -0
  293. package/dist/components/forms/checkbox-group.js +29 -0
  294. package/dist/components/forms/checkbox-group.js.map +1 -0
  295. package/dist/components/forms/checkbox.js +50 -0
  296. package/dist/components/forms/checkbox.js.map +1 -0
  297. package/dist/components/forms/field-types.js +2 -0
  298. package/dist/components/forms/field-types.js.map +1 -0
  299. package/dist/components/forms/field.js +105 -0
  300. package/dist/components/forms/field.js.map +1 -0
  301. package/dist/components/forms/form-control.js +70 -0
  302. package/dist/components/forms/form-control.js.map +1 -0
  303. package/dist/components/forms/form-description.js +24 -0
  304. package/dist/components/forms/form-description.js.map +1 -0
  305. package/dist/components/forms/form-feedback.js +53 -0
  306. package/dist/components/forms/form-feedback.js.map +1 -0
  307. package/dist/components/forms/form.js +397 -0
  308. package/dist/components/forms/form.js.map +1 -0
  309. package/dist/components/forms/icons.js +13 -0
  310. package/dist/components/forms/icons.js.map +1 -0
  311. package/dist/components/forms/index.js +20 -0
  312. package/dist/components/forms/index.js.map +1 -0
  313. package/dist/components/forms/input-otp.js +407 -0
  314. package/dist/components/forms/input-otp.js.map +1 -0
  315. package/dist/components/forms/input.js +137 -0
  316. package/dist/components/forms/input.js.map +1 -0
  317. package/dist/components/forms/label.js +23 -0
  318. package/dist/components/forms/label.js.map +1 -0
  319. package/dist/components/forms/native-select.js +134 -0
  320. package/dist/components/forms/native-select.js.map +1 -0
  321. package/dist/components/forms/radio-group.js +29 -0
  322. package/dist/components/forms/radio-group.js.map +1 -0
  323. package/dist/components/forms/radio.js +49 -0
  324. package/dist/components/forms/radio.js.map +1 -0
  325. package/dist/components/forms/select/end-content.js +24 -0
  326. package/dist/components/forms/select/end-content.js.map +1 -0
  327. package/dist/components/forms/select/native-mirror.js +29 -0
  328. package/dist/components/forms/select/native-mirror.js.map +1 -0
  329. package/dist/components/forms/select/select.js +629 -0
  330. package/dist/components/forms/select/select.js.map +1 -0
  331. package/dist/components/forms/select/selected-items.js +63 -0
  332. package/dist/components/forms/select/selected-items.js.map +1 -0
  333. package/dist/components/forms/select/trigger.js +30 -0
  334. package/dist/components/forms/select/trigger.js.map +1 -0
  335. package/dist/components/forms/select/types.js +2 -0
  336. package/dist/components/forms/select/types.js.map +1 -0
  337. package/dist/components/forms/select.js +2 -0
  338. package/dist/components/forms/select.js.map +1 -0
  339. package/dist/components/forms/switch.js +63 -0
  340. package/dist/components/forms/switch.js.map +1 -0
  341. package/dist/components/forms/textarea.js +53 -0
  342. package/dist/components/forms/textarea.js.map +1 -0
  343. package/dist/components/navigation/external-link.js +107 -0
  344. package/dist/components/navigation/external-link.js.map +1 -0
  345. package/dist/components/navigation/index.js +9 -0
  346. package/dist/components/navigation/index.js.map +1 -0
  347. package/dist/components/navigation/pagination/icons.js +23 -0
  348. package/dist/components/navigation/pagination/icons.js.map +1 -0
  349. package/dist/components/navigation/pagination/pagination.js +216 -0
  350. package/dist/components/navigation/pagination/pagination.js.map +1 -0
  351. package/dist/components/navigation/pagination/range.js +58 -0
  352. package/dist/components/navigation/pagination/range.js.map +1 -0
  353. package/dist/components/navigation/pagination.js +3 -0
  354. package/dist/components/navigation/pagination.js.map +1 -0
  355. package/dist/components/navigation/tab-nav/item.js +90 -0
  356. package/dist/components/navigation/tab-nav/item.js.map +1 -0
  357. package/dist/components/navigation/tab-nav/tab-nav.js +79 -0
  358. package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -0
  359. package/dist/components/navigation/tab-nav.js +3 -0
  360. package/dist/components/navigation/tab-nav.js.map +1 -0
  361. package/dist/components/navigation/tabs/panel.js +23 -0
  362. package/dist/components/navigation/tabs/panel.js.map +1 -0
  363. package/dist/components/navigation/tabs/tab.js +45 -0
  364. package/dist/components/navigation/tabs/tab.js.map +1 -0
  365. package/dist/components/navigation/tabs/tabs.js +156 -0
  366. package/dist/components/navigation/tabs/tabs.js.map +1 -0
  367. package/dist/components/navigation/tabs.js +4 -0
  368. package/dist/components/navigation/tabs.js.map +1 -0
  369. package/dist/components/notifications/index.js +5 -0
  370. package/dist/components/notifications/index.js.map +1 -0
  371. package/dist/components/notifications/notification-card.js +16 -0
  372. package/dist/components/notifications/notification-card.js.map +1 -0
  373. package/dist/components/notifications/notifications-container.js +269 -0
  374. package/dist/components/notifications/notifications-container.js.map +1 -0
  375. package/dist/components/overlays/backdrop.js +44 -0
  376. package/dist/components/overlays/backdrop.js.map +1 -0
  377. package/dist/components/overlays/drawer/body.js +18 -0
  378. package/dist/components/overlays/drawer/body.js.map +1 -0
  379. package/dist/components/overlays/drawer/drag-handle.js +18 -0
  380. package/dist/components/overlays/drawer/drag-handle.js.map +1 -0
  381. package/dist/components/overlays/drawer/footer.js +18 -0
  382. package/dist/components/overlays/drawer/footer.js.map +1 -0
  383. package/dist/components/overlays/drawer/header.js +61 -0
  384. package/dist/components/overlays/drawer/header.js.map +1 -0
  385. package/dist/components/overlays/drawer/selectors.js +29 -0
  386. package/dist/components/overlays/drawer/selectors.js.map +1 -0
  387. package/dist/components/overlays/drawer.js +175 -0
  388. package/dist/components/overlays/drawer.js.map +1 -0
  389. package/dist/components/overlays/index.js +15 -0
  390. package/dist/components/overlays/index.js.map +1 -0
  391. package/dist/components/overlays/modal/body.js +18 -0
  392. package/dist/components/overlays/modal/body.js.map +1 -0
  393. package/dist/components/overlays/modal/footer.js +18 -0
  394. package/dist/components/overlays/modal/footer.js.map +1 -0
  395. package/dist/components/overlays/modal/header.js +25 -0
  396. package/dist/components/overlays/modal/header.js.map +1 -0
  397. package/dist/components/overlays/modal.js +129 -0
  398. package/dist/components/overlays/modal.js.map +1 -0
  399. package/dist/components/overlays/mount-animation.js +146 -0
  400. package/dist/components/overlays/mount-animation.js.map +1 -0
  401. package/dist/components/overlays/overlay.js +321 -0
  402. package/dist/components/overlays/overlay.js.map +1 -0
  403. package/dist/components/overlays/popover.js +647 -0
  404. package/dist/components/overlays/popover.js.map +1 -0
  405. package/dist/components/overlays/portal-target.js +10 -0
  406. package/dist/components/overlays/portal-target.js.map +1 -0
  407. package/dist/components/overlays/portal.js +111 -0
  408. package/dist/components/overlays/portal.js.map +1 -0
  409. package/dist/components/overlays/tooltip.js +377 -0
  410. package/dist/components/overlays/tooltip.js.map +1 -0
  411. package/dist/components/status/alert.js +146 -0
  412. package/dist/components/status/alert.js.map +1 -0
  413. package/dist/components/status/index.js +3 -0
  414. package/dist/components/status/index.js.map +1 -0
  415. package/dist/components/status/progress-bar.js +126 -0
  416. package/dist/components/status/progress-bar.js.map +1 -0
  417. package/dist/components/utilities/avatar.js +48 -0
  418. package/dist/components/utilities/avatar.js.map +1 -0
  419. package/dist/components/utilities/collapsible.js +210 -0
  420. package/dist/components/utilities/collapsible.js.map +1 -0
  421. package/dist/components/utilities/divider.js +37 -0
  422. package/dist/components/utilities/divider.js.map +1 -0
  423. package/dist/components/utilities/index.js +16 -0
  424. package/dist/components/utilities/index.js.map +1 -0
  425. package/dist/components/utilities/kbd.js +88 -0
  426. package/dist/components/utilities/kbd.js.map +1 -0
  427. package/dist/components/utilities/skeleton.js +14 -0
  428. package/dist/components/utilities/skeleton.js.map +1 -0
  429. package/dist/components/utilities/spinner.js +14 -0
  430. package/dist/components/utilities/spinner.js.map +1 -0
  431. package/dist/components/utilities/visually-hidden.js +10 -0
  432. package/dist/components/utilities/visually-hidden.js.map +1 -0
  433. package/dist/control-blur-C8OnSQR5.js +124 -0
  434. package/dist/control-blur-C8OnSQR5.js.map +1 -0
  435. package/dist/dialog-CreV7aPQ.js +27 -0
  436. package/dist/dialog-CreV7aPQ.js.map +1 -0
  437. package/dist/disclosure.js +3 -0
  438. package/dist/disclosure.js.map +1 -0
  439. package/dist/dom-cKWVvtkd.js +116 -0
  440. package/dist/dom-cKWVvtkd.js.map +1 -0
  441. package/dist/forms.js +20 -0
  442. package/dist/forms.js.map +1 -0
  443. package/dist/index.js +83 -7
  444. package/dist/index.js.map +1 -1
  445. package/dist/intent-icons-DpEViO8C.js +19 -0
  446. package/dist/intent-icons-DpEViO8C.js.map +1 -0
  447. package/dist/manager-CDIZzrQ9.js +388 -0
  448. package/dist/manager-CDIZzrQ9.js.map +1 -0
  449. package/dist/modifiers/drag-to-dismiss.js +392 -0
  450. package/dist/modifiers/drag-to-dismiss.js.map +1 -0
  451. package/dist/modifiers/press.js +321 -0
  452. package/dist/modifiers/press.js.map +1 -0
  453. package/dist/navigation.js +9 -0
  454. package/dist/navigation.js.map +1 -0
  455. package/dist/notification-card-D5fd-Sxa.js +330 -0
  456. package/dist/notification-card-D5fd-Sxa.js.map +1 -0
  457. package/dist/notifications.js +5 -0
  458. package/dist/notifications.js.map +1 -0
  459. package/dist/overlays.js +15 -0
  460. package/dist/overlays.js.map +1 -0
  461. package/dist/runtime--fcdnjmJ-BOdRhmsS.js +67 -0
  462. package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -0
  463. package/dist/services/notifications.js +38 -0
  464. package/dist/services/notifications.js.map +1 -0
  465. package/dist/status.js +3 -0
  466. package/dist/status.js.map +1 -0
  467. package/dist/test-support.js +1316 -0
  468. package/dist/test-support.js.map +1 -0
  469. package/dist/utilities.js +16 -0
  470. package/dist/utilities.js.map +1 -0
  471. package/dist/utils/deferred-work.js +66 -0
  472. package/dist/utils/deferred-work.js.map +1 -0
  473. package/dist/utils/filter.js +166 -0
  474. package/dist/utils/filter.js.map +1 -0
  475. package/dist/utils/forms-utils-index.js +24 -0
  476. package/dist/utils/forms-utils-index.js.map +1 -0
  477. package/dist/utils/keys.js +259 -0
  478. package/dist/utils/keys.js.map +1 -0
  479. package/dist/utils/listManager.js +759 -0
  480. package/dist/utils/listManager.js.map +1 -0
  481. package/dist/utils/nested-data.js +196 -0
  482. package/dist/utils/nested-data.js.map +1 -0
  483. package/dist/utils/prefers-reduced-motion.js +21 -0
  484. package/dist/utils/prefers-reduced-motion.js.map +1 -0
  485. package/dist/utils/ref.js +32 -0
  486. package/dist/utils/ref.js.map +1 -0
  487. package/dist/utils/roving-focus.js +206 -0
  488. package/dist/utils/roving-focus.js.map +1 -0
  489. package/dist/utils/safe-area.js +133 -0
  490. package/dist/utils/safe-area.js.map +1 -0
  491. package/dist/utils/safe-styles.js +15 -0
  492. package/dist/utils/safe-styles.js.map +1 -0
  493. package/dist/utils/selection-indicator.js +189 -0
  494. package/dist/utils/selection-indicator.js.map +1 -0
  495. package/dist/utils/standard-validator.js +232 -0
  496. package/dist/utils/standard-validator.js.map +1 -0
  497. package/dist/utils/toggle.js +46 -0
  498. package/dist/utils/toggle.js.map +1 -0
  499. package/package.json +77 -21
@@ -0,0 +1,176 @@
1
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
2
+ /**
3
+ * The issues collection returned by a Standard Schema validation failure.
4
+ */
5
+ export type Issues = readonly StandardSchemaV1.Issue[];
6
+ /**
7
+ * The return type of a validator function.
8
+ * Resolves to the issues (when validation fails) or undefined
9
+ * (when it succeeds).
10
+ */
11
+ export type ValidatorReturn = Promise<Issues | undefined>;
12
+ /**
13
+ * StandardSchemaV1 issues as either a promise or synchronous. If there are
14
+ * no issues, `undefined` is returned.
15
+ */
16
+ export type CustomValidatorReturn = ValidatorReturn | Issues | undefined;
17
+ /**
18
+ * A custom validator function.
19
+ * If there are errors, they are returned by the validator as
20
+ * StandardSchemaV1 issues. If there are no errors, nothing is returned.
21
+ */
22
+ export type CustomValidatorFn<Input = unknown> = (input: Input) => CustomValidatorReturn;
23
+ /**
24
+ * Extracts the comparable keys from a Standard Schema issue path.
25
+ *
26
+ * Path segments may be plain keys or `{ key }` objects. Keys are coerced to
27
+ * strings so numeric array indexes (including `0`) survive and line up with
28
+ * the dotted field name a consumer writes as `@name` (e.g. `items.0.name`).
29
+ *
30
+ * This is the single source of truth for that format: both
31
+ * `StandardValidator.filterFieldIssues` and the form component's
32
+ * `FormErrors` conversion go through it, so field lookup and error keys
33
+ * cannot disagree.
34
+ *
35
+ * @param path The issue path to extract keys from.
36
+ * @returns The path keys as strings, with null/undefined segments dropped.
37
+ */
38
+ declare function issuePathKeys(path: StandardSchemaV1.Issue['path']): string[];
39
+ /**
40
+ * Builds the dotted field name for a Standard Schema issue, matching the
41
+ * `@name` a consumer gives a field (e.g. `items.0.name`).
42
+ *
43
+ * @param issue The issue to build the field name for.
44
+ * @returns The dotted field name, or an empty string when the issue has no
45
+ * path.
46
+ */
47
+ declare function issuePathToFieldName(issue: StandardSchemaV1.Issue): string;
48
+ /**
49
+ * Provides convenience methods for validating data using Standard Schema.
50
+ * Also supports custom validator functions that return issues in the
51
+ * Standard Schema format.
52
+ *
53
+ * Most of the time you should use `validateAll` or `validateFieldAll` to
54
+ * validate data. Schema and custom validation are optional arguments
55
+ * to these methods. This is useful because schema and custom validation
56
+ * must both be optional in the form component, which is the primary use
57
+ * case for this class.
58
+ *
59
+ * Note: all methods are static, so you do not need to instantiate
60
+ * this class.
61
+ *
62
+ * @see https://standardschema.dev/
63
+ */
64
+ declare class StandardValidator {
65
+ private constructor();
66
+ /**
67
+ * Validates data against the provided standard schema.
68
+ * If there are errors, they are returned. Otherwise, nothing is returned.
69
+ * This provides a boolean indication of outcome: if there is a return
70
+ * value, validation failed. Otherwise, validation succeeded.
71
+ * @see https://standardschema.dev/
72
+ *
73
+ * @example
74
+ * const input = …; // your data to validate
75
+ * const schema = …; // your standard schema
76
+ * const issues = await StandardValidator.validate(input, schema);
77
+ *
78
+ * @param input The input to validate.
79
+ * @param schema The standard schema to validate against.
80
+ * @return The issues if validation failed, otherwise undefined.
81
+ */
82
+ static validate<I, O>(input: I, schema: StandardSchemaV1<I, O>): ValidatorReturn;
83
+ /**
84
+ * Validates a single field within the input data using the provided
85
+ * standard schema. If there are issues related to the specified field,
86
+ * they are returned. Otherwise, nothing is returned.
87
+ *
88
+ * Note: because standard schema does not provide a way to validate
89
+ * individual fields, this method filters the issues returned by the
90
+ * schema validation to find those related to the specified field.
91
+ * @see https://standardschema.dev/
92
+ *
93
+ * @param input The input data to validate.
94
+ * @param fieldName The name of the field to validate.
95
+ * @param schema The standard schema to validate against.
96
+ * @returns The issues related to the specified field if validation failed,
97
+ * otherwise undefined.
98
+ */
99
+ static validateField<I, O>(input: I, fieldName: string, schema: StandardSchemaV1<I, O>): ValidatorReturn;
100
+ /**
101
+ * Validates input using a custom validator function.
102
+ * If there are errors, they are returned by the validator as
103
+ * StandardSchemaV1 issues. If there are no errors, nothing is returned.
104
+ * @see https://standardschema.dev/
105
+ *
106
+ * @param input The input data to validate.
107
+ * @param customValidator The custom validator function to use.
108
+ * @returns The issues if validation failed, otherwise undefined.
109
+ */
110
+ static validateCustom<I>(input: I, customValidator: CustomValidatorFn<I>): ValidatorReturn;
111
+ /**
112
+ * Validates a single field within the input data using a custom validator
113
+ * function. If there are issues related to the specified field, they are
114
+ * returned. Otherwise, nothing is returned.
115
+ *
116
+ * Note: because custom validators may return issues for multiple fields,
117
+ * this method filters the issues returned by the custom validator to find
118
+ * those related to the specified field.
119
+ * @see https://standardschema.dev/
120
+ *
121
+ * @param input The input data to validate.
122
+ * @param fieldName The name of the field to validate.
123
+ * @param customValidator The custom validator function to use.
124
+ * @returns The issues related to the specified field if validation failed,
125
+ * otherwise undefined.
126
+ */
127
+ static validateFieldCustom<I>(input: I, fieldName: string, customValidator: CustomValidatorFn<I>): ValidatorReturn;
128
+ /**
129
+ * Validates input data using both a standard schema and a custom validator
130
+ * function, merging any issues found by either method. If there are issues,
131
+ * they are returned. Otherwise, nothing is returned. This method runs both
132
+ * validations in parallel.
133
+ *
134
+ * Note: `schema` and `customValidator` are both optional. If either the
135
+ * schema or custom validator is not provided, that validation is skipped.
136
+ * @see https://standardschema.dev/
137
+ *
138
+ * @param input The input data to validate.
139
+ * @param schema Optional standard schema to validate against.
140
+ * @param customValidator Optional custom validator function to use.
141
+ * @returns issues if validation failed, otherwise undefined.
142
+ */
143
+ static validateAll<I, O>(input: I, schema?: StandardSchemaV1<I, O>, customValidator?: CustomValidatorFn<I>): ValidatorReturn;
144
+ /**
145
+ * Validates a single field within the input data using both a standard
146
+ * schema and a custom validator function, merging any issues found by
147
+ * either method. If there are issues related to the specified field,
148
+ * they are returned. Otherwise, nothing is returned. This method runs
149
+ * both validations in parallel.
150
+ *
151
+ * Note: `schema` and `customValidator` are both optional. If either the
152
+ * schema or custom validator is not provided, that validation is skipped.
153
+ * @see https://standardschema.dev/
154
+ *
155
+ * @param input The input data to validate.
156
+ * @param fieldName The name of the field to validate.
157
+ * @param schema Optional standard schema to validate against.
158
+ * @param customValidator Optional custom validator function to use.
159
+ * @returns The issues related to the specified field if validation failed,
160
+ * otherwise undefined.
161
+ */
162
+ static validateFieldAll<I, O>(input: I, fieldName: string, schema?: StandardSchemaV1<I, O>, customValidator?: CustomValidatorFn<I>): ValidatorReturn;
163
+ /**
164
+ * Filters issues to those related to the specified field name.
165
+ * Supports both simple field names and dotted notation for nested fields.
166
+ *
167
+ * @param issues The issues to filter.
168
+ * @param fieldName The name of the field to filter by (e.g., "email",
169
+ * "profile.contact.email" or "items.0.name" for array elements).
170
+ * @returns The issues related to the specified field, or undefined if
171
+ * there are none.
172
+ */
173
+ static filterFieldIssues(issues: Issues, fieldName: string): Issues | undefined;
174
+ }
175
+ export { StandardValidator, issuePathKeys, issuePathToFieldName };
176
+ export default StandardValidator;
@@ -0,0 +1,9 @@
1
+ import type { PressEvent } from '../modifiers/press';
2
+ declare class ToggleState {
3
+ #private;
4
+ current: boolean;
5
+ constructor(initialValue?: boolean, onChange?: (val: boolean) => void);
6
+ toggle: (input?: boolean | Event | PressEvent) => void;
7
+ }
8
+ declare function toggleState(initialValue?: boolean, onChange?: (val: boolean) => void): ToggleState;
9
+ export { toggleState };
@@ -0,0 +1 @@
1
+ export { default } from "frontile/services/notifications";
@@ -0,0 +1,8 @@
1
+ export { Button } from './components/buttons/button.js';
2
+ export { CloseButton } from './components/buttons/close-button.js';
3
+ export { ToggleButton } from './components/buttons/toggle-button.js';
4
+ export { ButtonGroup } from './components/buttons/button-group.js';
5
+ export { Chip } from './components/buttons/chip.js';
6
+ export { SegmentedControl } from './components/buttons/segmented-control/segmented-control.js';
7
+ export { SegmentedControlItem } from './components/buttons/segmented-control/item.js';
8
+ //# sourceMappingURL=buttons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttons.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,13 @@
1
+ export { Listbox } from './components/collections/listbox/listbox.js';
2
+ export { Command } from './components/collections/command/command.js';
3
+ export { CommandInput } from './components/collections/command/input.js';
4
+ export { CommandList } from './components/collections/command/list.js';
5
+ export { CommandDialog } from './components/collections/command/dialog.js';
6
+ export { CommandFooter, CommandHint, CommandKbd } from './components/collections/command/footer.js';
7
+ export { Dropdown } from './components/collections/dropdown/dropdown.js';
8
+ export { Table } from './components/collections/table/table.js';
9
+ export { SimpleTable } from './components/collections/simple-table/index.js';
10
+ export { Calendar } from './components/collections/calendar/calendar.js';
11
+ export { ListboxGroup } from './components/collections/listbox/group.js';
12
+ export { ListboxItem } from './components/collections/listbox/item.js';
13
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,31 @@
1
+ import Component from '@glimmer/component';
2
+ import { hash } from '@ember/helper';
3
+ import { useStyles } from '@frontile/theme';
4
+ import { Button } from './button.js';
5
+ import { ToggleButton } from './toggle-button.js';
6
+ import { precompileTemplate } from '@ember/template-compilation';
7
+ import { setComponentTemplate } from '@ember/component';
8
+
9
+ class ButtonGroup extends Component {
10
+ get classNames() {
11
+ const {
12
+ buttonGroup
13
+ } = useStyles();
14
+ return buttonGroup({
15
+ class: this.args.class
16
+ });
17
+ }
18
+ static {
19
+ setComponentTemplate(precompileTemplate("<div class={{this.classNames}} role=\"group\" ...attributes>\n {{yield (hash Button=(component Button isInGroup=true appearance=@appearance intent=@intent size=@size) ToggleButton=(component ToggleButton isInGroup=true intent=@intent size=@size))}}\n</div>", {
20
+ strictMode: true,
21
+ scope: () => ({
22
+ hash,
23
+ Button,
24
+ ToggleButton
25
+ })
26
+ }), this);
27
+ }
28
+ }
29
+
30
+ export { ButtonGroup, ButtonGroup as default };
31
+ //# sourceMappingURL=button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-group.js","sources":["../../../src/components/buttons/button-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport Button, { type ButtonSignature } from './button';\nimport type { ButtonArgs } from './button';\nimport ToggleButton, { type ToggleButtonSignature } from './toggle-button';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface ButtonGroupArgs extends Pick<\n ButtonArgs,\n 'appearance' | 'intent' | 'size' | 'class'\n> {}\n\ninterface ButtonGroupSignature {\n Args: ButtonGroupArgs;\n Blocks: {\n default: [\n {\n Button: WithBoundArgs<ComponentLike<ButtonSignature>, 'isInGroup'>;\n ToggleButton: WithBoundArgs<\n ComponentLike<ToggleButtonSignature>,\n 'isInGroup'\n >;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nclass ButtonGroup extends Component<ButtonGroupSignature> {\n get classNames(): string {\n const { buttonGroup } = useStyles();\n\n return buttonGroup({\n class: this.args.class\n });\n }\n\n <template>\n <div class={{this.classNames}} role=\"group\" ...attributes>\n {{yield\n (hash\n Button=(component\n Button\n isInGroup=true\n appearance=@appearance\n intent=@intent\n size=@size\n )\n ToggleButton=(component\n ToggleButton isInGroup=true intent=@intent size=@size\n )\n )\n }}\n </div>\n </template>\n}\n\nexport { ButtonGroup, type ButtonGroupSignature };\nexport default ButtonGroup;\n"],"names":["ButtonGroup","Component","classNames","buttonGroup","useStyles","class","args","setComponentTemplate","precompileTemplate","strictMode","scope","hash","Button","ToggleButton"],"mappings":";;;;;;;;AA6BA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;AAExB,IAAA,OAAOD,WAAA,CAAY;AACjBE,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD;AACnB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,mQAAA,EAiBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,MAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -0,0 +1,120 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked, cached } from '@glimmer/tracking';
3
+ import { modifier } from 'ember-modifier';
4
+ import { useStyles } from '@frontile/theme';
5
+ import press from '../../modifiers/press.js';
6
+ import { Spinner } from '../utilities/spinner.js';
7
+ import { precompileTemplate } from '@ember/template-compilation';
8
+ import { setComponentTemplate } from '@ember/component';
9
+ import templateOnly from '@ember/component/template-only';
10
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../../runtime--fcdnjmJ-BOdRhmsS.js';
11
+
12
+ const disableWhile = modifier((el, [loading]) => {
13
+ if (!loading) {
14
+ return;
15
+ }
16
+ const previous = el.disabled;
17
+ el.disabled = true;
18
+ return () => {
19
+ el.disabled = previous;
20
+ };
21
+ });
22
+ /**
23
+ * The spinner stands in for the icon while loading, on whichever side
24
+ * `@iconPlacement` puts it. Extracted so the spinner-or-icon choice is written
25
+ * once; the caller passes the icon through as this component's default block.
26
+ *
27
+ * The invocation below is still written twice, once per side, and that is
28
+ * deliberate: the block contains `{{yield to="icon"}}`, and Glimmer has no way
29
+ * to hoist a block-yielding invocation into a `{{#let}}` or a helper. Only the
30
+ * choice was deduplicated, not the two call sites.
31
+ */
32
+ const SpinnerOrIcon = setComponentTemplate(precompileTemplate("{{#if @isLoading}}\n <Spinner @class={{@spinnerClass}} data-test-id=\"loading-spinner\" />\n{{else}}\n {{yield}}\n{{/if}}", {
33
+ strictMode: true,
34
+ scope: () => ({
35
+ Spinner
36
+ })
37
+ }), templateOnly());
38
+ class Button extends Component {
39
+ static {
40
+ decorateFieldV2(this.prototype, "isPressed", [tracked], function () {
41
+ return false;
42
+ });
43
+ }
44
+ #isPressed = (initializeDeferredDecorator(this, "isPressed"), void 0);
45
+ get type() {
46
+ if (this.args.type) {
47
+ return this.args.type;
48
+ }
49
+ return 'button';
50
+ }
51
+ get isLoading() {
52
+ return this.args.isLoading === true;
53
+ }
54
+ get isIconAtEnd() {
55
+ return this.args.iconPlacement === 'end';
56
+ }
57
+ get isIconAtStart() {
58
+ return !this.isIconAtEnd;
59
+ }
60
+ get classNames() {
61
+ const {
62
+ button
63
+ } = useStyles();
64
+ return button({
65
+ intent: this.args.intent || 'default',
66
+ size: this.args.size,
67
+ appearance: this.args.appearance || 'default',
68
+ isInGroup: this.args.isInGroup,
69
+ isLoading: this.isLoading,
70
+ class: this.args.class
71
+ });
72
+ }
73
+ static {
74
+ decorateMethodV2(this.prototype, "classNames", [cached]);
75
+ }
76
+ get spinnerClassNames() {
77
+ const {
78
+ buttonSpinner
79
+ } = useStyles();
80
+ return buttonSpinner();
81
+ }
82
+ /**
83
+ * The object yielded to the default block (and, when `@isRenderless`, in
84
+ * place of rendering). Hoisted so the shape is written once — it's part of
85
+ * this component's public contract, asserted on directly by tests.
86
+ */
87
+ static {
88
+ decorateMethodV2(this.prototype, "spinnerClassNames", [cached]);
89
+ }
90
+ get yieldedHash() {
91
+ return {
92
+ classNames: this.classNames,
93
+ isLoading: this.isLoading
94
+ };
95
+ }
96
+ static {
97
+ decorateMethodV2(this.prototype, "yieldedHash", [cached]);
98
+ }
99
+ handlePressChange = isPressed => {
100
+ this.isPressed = isPressed;
101
+ };
102
+ onPress = event => {
103
+ if (typeof this.args.onPress === 'function') {
104
+ this.args.onPress(event);
105
+ }
106
+ };
107
+ static {
108
+ setComponentTemplate(precompileTemplate("{{#if @isRenderless}}\n {{yield this.yieldedHash}}\n{{else}}\n <button type={{this.type}} class={{this.classNames}} aria-busy={{if this.isLoading \"true\"}} data-loading={{if this.isLoading \"true\"}} data-pressed={{if this.isPressed \"true\"}} {{press this.onPress onPressChange=this.handlePressChange}} ...attributes {{disableWhile this.isLoading}}>\n {{#if this.isIconAtStart}}\n <SpinnerOrIcon @isLoading={{this.isLoading}} @spinnerClass={{this.spinnerClassNames}}>\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n\n {{#if this.isLoading}}\n {{#if (has-block \"loading\")}}\n {{yield to=\"loading\"}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n\n {{#if this.isIconAtEnd}}\n <SpinnerOrIcon @isLoading={{this.isLoading}} @spinnerClass={{this.spinnerClassNames}}>\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n </button>\n{{/if}}", {
109
+ strictMode: true,
110
+ scope: () => ({
111
+ press,
112
+ disableWhile,
113
+ SpinnerOrIcon
114
+ })
115
+ }), this);
116
+ }
117
+ }
118
+
119
+ export { Button, Button as default };
120
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sources":["../../../src/components/buttons/button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport type { TOC } from '@ember/component/template-only';\nimport { useStyles } from '@frontile/theme';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { Spinner } from '../utilities/spinner';\n\n/**\n * Sets `disabled` on the element while `loading` is true, restoring whatever\n * the consumer had before. This is a modifier rather than a plain attribute\n * because splattributes are applied last: `disabled={{@isLoading}}` written\n * before `...attributes` is clobbered by a consumer's own `disabled`, and\n * written after it a consumer's `disabled={{false}}` would erase ours.\n * Modifiers run after attributes, so neither ordering problem applies.\n *\n * Known limitation: this re-runs only when `loading` changes, so `previous`\n * is a snapshot taken once at install time — it goes stale if the consumer's\n * own `disabled` binding changes while loading is already in flight, in\n * either direction:\n *\n * - true → false: Glimmer rewrites the attribute to `false`, we do not\n * re-run, so the button stays disabled (from our own `el.disabled = true`)\n * until loading ends and teardown restores the stale `previous` (`false`),\n * which happens to match — net: the button goes live at the same moment,\n * with the disabling outliving the intent for no visible reason.\n * - false → true: Glimmer rewrites the attribute to `true`, we do not\n * re-run, so `previous` is left holding the stale `false`. When loading\n * ends, teardown restores `previous` and sets `disabled = false` — the\n * button ends up enabled even though the consumer's binding says\n * `disabled={{true}}`. This is a fail-open: the consumer's disable is\n * silently and indefinitely lost. See the\n * `'known limitation: a consumer disable applied mid-load is lost when\n * loading ends'` test in buttons-test.gts, which pins this exact case.\n *\n * Closing this would need a MutationObserver watching `disabled` for a case\n * nobody has hit; the project has decided not to add one.\n */\nconst disableWhile = modifier((el: HTMLButtonElement, [loading]: [boolean]) => {\n if (!loading) {\n return;\n }\n\n const previous = el.disabled;\n el.disabled = true;\n\n return () => {\n el.disabled = previous;\n };\n});\n\n/**\n * The spinner stands in for the icon while loading, on whichever side\n * `@iconPlacement` puts it. Extracted so the spinner-or-icon choice is written\n * once; the caller passes the icon through as this component's default block.\n *\n * The invocation below is still written twice, once per side, and that is\n * deliberate: the block contains `{{yield to=\"icon\"}}`, and Glimmer has no way\n * to hoist a block-yielding invocation into a `{{#let}}` or a helper. Only the\n * choice was deduplicated, not the two call sites.\n */\nconst SpinnerOrIcon: TOC<{\n Args: {\n isLoading: boolean;\n spinnerClass: string;\n };\n Blocks: {\n default: [];\n };\n}> = <template>\n {{#if @isLoading}}\n <Spinner @class={{@spinnerClass}} data-test-id=\"loading-spinner\" />\n {{else}}\n {{yield}}\n {{/if}}\n</template>;\n\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n\n /**\n * The button appearance\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'soft' | 'outlined' | 'minimal' | 'tonal' | 'custom';\n\n /**\n * The intent of the button\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the button\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */\n isRenderless?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * If button is part of a group. Most of the time, this is automatically set\n * when using the ButtonGroup component.\n */\n isInGroup?: boolean;\n\n /**\n * Renders a spinner in place of the icon and disables the button.\n *\n * @defaultValue false\n */\n isLoading?: boolean;\n\n /**\n * Which side the `icon` block — and the loading spinner that replaces it —\n * sits on.\n *\n * @defaultValue 'start'\n */\n iconPlacement?: 'start' | 'end';\n\n /**\n * Callback for when the button is pressed.\n */\n onPress?: (event: PressEvent) => void;\n}\n\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{ classNames: string; isLoading: boolean }];\n icon?: [];\n loading?: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass Button extends Component<ButtonSignature> {\n @tracked isPressed = false;\n\n get type(): string {\n if (this.args.type) {\n return this.args.type;\n }\n return 'button';\n }\n\n get isLoading(): boolean {\n return this.args.isLoading === true;\n }\n\n get isIconAtEnd(): boolean {\n return this.args.iconPlacement === 'end';\n }\n\n get isIconAtStart(): boolean {\n return !this.isIconAtEnd;\n }\n\n @cached\n get classNames(): string {\n const { button } = useStyles();\n\n return button({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: this.args.appearance || 'default',\n isInGroup: this.args.isInGroup,\n isLoading: this.isLoading,\n class: this.args.class\n });\n }\n\n @cached\n get spinnerClassNames(): string {\n const { buttonSpinner } = useStyles();\n\n return buttonSpinner();\n }\n\n /**\n * The object yielded to the default block (and, when `@isRenderless`, in\n * place of rendering). Hoisted so the shape is written once — it's part of\n * this component's public contract, asserted on directly by tests.\n */\n @cached\n get yieldedHash(): { classNames: string; isLoading: boolean } {\n return { classNames: this.classNames, isLoading: this.isLoading };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n onPress = (event: PressEvent) => {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n };\n\n <template>\n {{#if @isRenderless}}\n {{yield this.yieldedHash}}\n {{else}}\n <button\n type={{this.type}}\n class={{this.classNames}}\n aria-busy={{if this.isLoading \"true\"}}\n data-loading={{if this.isLoading \"true\"}}\n data-pressed={{if this.isPressed \"true\"}}\n {{press this.onPress onPressChange=this.handlePressChange}}\n ...attributes\n {{disableWhile this.isLoading}}\n >\n {{#if this.isIconAtStart}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n\n {{#if this.isLoading}}\n {{#if (has-block \"loading\")}}\n {{yield to=\"loading\"}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n\n {{#if this.isIconAtEnd}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n </button>\n {{/if}}\n </template>\n}\n\nexport { Button, type ButtonSignature };\nexport default Button;\n"],"names":["disableWhile","modifier","el","loading","previous","disabled","SpinnerOrIcon","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","templateOnly","Button","Component","g","prototype","tracked","i","type","args","isLoading","isIconAtEnd","iconPlacement","isIconAtStart","classNames","button","useStyles","intent","size","appearance","isInGroup","class","n","cached","spinnerClassNames","buttonSpinner","yieldedHash","handlePressChange","isPressed","onPress","event","press"],"mappings":";;;;;;;;;;;AAsCA,MAAMA,eAAeC,QAAA,CAAS,CAACC,EAAI,EAAmB,CAACC,OAAA,CAAmB,KAAA;EACxE,IAAI,CAACA,OAAA,EAAS;AACZ,IAAA;AACF,EAAA;AAEA,EAAA,MAAMC,QAAA,GAAWF,GAAGG,QAAQ;EAC5BH,EAAA,CAAGG,QAAQ,GAAG,IAAA;AAEd,EAAA,OAAO,MAAA;IACLH,EAAA,CAAGG,QAAQ,GAAGD,QAAA;EAChB,CAAA;AACF,CAAA,CAAA;AAEA;;;;;;;;;AASC;AACD,MAAME,aAQD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,6HAAA,EAML;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;AAiFV,MAAMC,eAAeC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAC5BC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;EAErB,IAAIC,IAAAA,GAAe;AACjB,IAAA,IAAI,IAAI,CAACC,IAAI,CAACD,IAAI,EAAE;AAClB,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI;AACvB,IAAA;AACA,IAAA,OAAO,QAAA;AACT,EAAA;EAEA,IAAIE,SAAAA,GAAqB;AACvB,IAAA,OAAO,IAAI,CAACD,IAAI,CAACC,SAAS,KAAK,IAAA;AACjC,EAAA;EAEA,IAAIC,WAAAA,GAAuB;AACzB,IAAA,OAAO,IAAI,CAACF,IAAI,CAACG,aAAa,KAAK,KAAA;AACrC,EAAA;EAEA,IAAIC,aAAAA,GAAyB;IAC3B,OAAO,CAAC,IAAI,CAACF,WAAW;AAC1B,EAAA;EAEA,IACIG,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AAEnB,IAAA,OAAOD,MAAA,CAAO;AACZE,MAAAA,MAAA,EAAQ,IAAI,CAACR,IAAI,CAACQ,MAAM,IAAI,SAAA;AAC5BC,MAAAA,IAAA,EAAM,IAAI,CAACT,IAAI,CAACS,IAAI;AACpBC,MAAAA,UAAA,EAAY,IAAI,CAACV,IAAI,CAACU,UAAU,IAAI,SAAA;AACpCC,MAAAA,SAAA,EAAW,IAAI,CAACX,IAAI,CAACW,SAAS;MAC9BV,SAAA,EAAW,IAAI,CAACA,SAAS;AACzBW,MAAAA,KAAA,EAAO,IAAI,CAACZ,IAAI,CAACY;AACnB,KAAA,CAAA;AACF,EAAA;AAAA,EAAA;IAAAC,gBAAA,CAAA,IAAA,CAAAjB,SAAA,EAAA,YAAA,EAAA,CAZCkB,MAAA,CAAA,CAAA;AAAA;EAcD,IACIC,iBAAAA,GAA4B;IAC9B,MAAM;AAAEC,MAAAA;KAAe,GAAGT,SAAA,EAAA;IAE1B,OAAOS,aAAA,EAAA;AACT,EAAA;AAEA;;;;AAIC;AAJD,EAAA;IAAAH,gBAAA,CAAA,IAAA,CAAAjB,SAAA,EAAA,mBAAA,EAAA,CAPCkB,MAAA,CAAA,CAAA;AAAA;EAYD,IACIG,WAAAA,GAA0D;IAC5D,OAAO;MAAEZ,UAAA,EAAY,IAAI,CAACA,UAAU;MAAEJ,SAAA,EAAW,IAAI,CAACA;KAAU;AAClE,EAAA;AAAA,EAAA;IAAAY,gBAAA,CAAA,IAAA,CAAAjB,SAAA,EAAA,aAAA,EAAA,CAHCkB,MAAA,CAAA,CAAA;AAAA;EAKDI,iBAAA,GAAqBC,SAAkB,IAAO;IAC5C,IAAI,CAACA,SAAS,GAAGA,SAAA;EACnB,CAAA;EAEAC,OAAA,GAAWC,KAAO,IAAA;IAChB,IAAI,OAAO,IAAI,CAACrB,IAAI,CAACoB,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACpB,IAAI,CAACoB,OAAO,CAACC,KAAA,CAAA;AACpB,IAAA;EACF,CAAA;AAEA,EAAA;IAAAlC,oBAAA,CAAAC,kBAAA,CAAA,o+BAAA,EA2CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAgC,KAAA;QAAA1C,YAAA;AAAAM,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -0,0 +1,44 @@
1
+ import Component from '@glimmer/component';
2
+ import { useStyles } from '@frontile/theme';
3
+ import { CloseButton } from './close-button.js';
4
+ import { precompileTemplate } from '@ember/template-compilation';
5
+ import { setComponentTemplate } from '@ember/component';
6
+
7
+ class Chip extends Component {
8
+ get classNames() {
9
+ const {
10
+ chip
11
+ } = useStyles();
12
+ const {
13
+ base,
14
+ content,
15
+ dot,
16
+ closeButton
17
+ } = chip({
18
+ intent: this.args.intent || 'default',
19
+ size: this.args.size,
20
+ appearance: this.args.appearance || 'default',
21
+ radius: this.args.radius,
22
+ isDisabled: this.args.isDisabled
23
+ });
24
+ return {
25
+ base: base({
26
+ class: this.args.class
27
+ }),
28
+ content: content(),
29
+ dot: dot(),
30
+ closeButton: closeButton()
31
+ };
32
+ }
33
+ static {
34
+ setComponentTemplate(precompileTemplate("<div class={{this.classNames.base}} ...attributes>\n {{#if @withDot}}\n <span class={{this.classNames.dot}}></span>\n {{/if}}\n <span class={{this.classNames.content}}>\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton @class={{this.classNames.closeButton}} @title={{@closeButtonTitle}} @onPress={{@onClose}} tabindex={{@closeButtonTabIndex}} disabled={{@isDisabled}} />\n {{/if}}\n</div>", {
35
+ strictMode: true,
36
+ scope: () => ({
37
+ CloseButton
38
+ })
39
+ }), this);
40
+ }
41
+ }
42
+
43
+ export { Chip, Chip as default };
44
+ //# sourceMappingURL=chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chip.js","sources":["../../../src/components/buttons/chip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { CloseButton } from './close-button';\n\ninterface ChipSignature {\n Args: {\n /**\n * The chip appearance\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The intent of the chip, which drives its color\n *\n * @defaultValue 'default'\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the chip\n *\n * @defaultValue 'md'\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * The border radius of the chip\n *\n * @defaultValue 'full'\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * Adds a dot before the content, colored by `@intent`. On the `default`\n * appearance the dot takes the chip's text color, since the chip's\n * background is already the intent color.\n *\n * @defaultValue false\n */\n withDot?: boolean;\n\n /**\n * Function to be called when clicking on the close button.\n * If you pass this argument, the close button will be visible.\n */\n onClose?: () => void;\n\n /**\n * The accessible name of the close button. Every close button would\n * otherwise be announced as just \"Close\", which does not say *what* is\n * being removed — worth setting when several chips sit together.\n *\n * @defaultValue 'Close'\n */\n closeButtonTitle?: string;\n\n /**\n * `tabindex` for the close button.\n *\n * Set to `-1` when chips sit inside another control (a multi-select field,\n * say) and the close button should stay a pointer affordance: every chip\n * would otherwise cost a Tab stop before the control itself is reached.\n * Whoever does this owes keyboard users another way to remove a chip.\n *\n * @defaultValue undefined (the close button is a normal tab stop)\n */\n closeButtonTabIndex?: number | string;\n\n /**\n * Dims the chip and disables its close button, if any.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\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 Chip extends Component<ChipSignature> {\n get classNames() {\n const { chip } = useStyles();\n\n const { base, content, dot, closeButton } = chip({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: this.args.appearance || 'default',\n radius: this.args.radius,\n isDisabled: this.args.isDisabled\n });\n\n return {\n base: base({ class: this.args.class }),\n content: content(),\n dot: dot(),\n closeButton: closeButton()\n };\n }\n\n <template>\n <div class={{this.classNames.base}} ...attributes>\n {{#if @withDot}}\n <span class={{this.classNames.dot}}></span>\n {{/if}}\n <span class={{this.classNames.content}}>\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton\n @class={{this.classNames.closeButton}}\n @title={{@closeButtonTitle}}\n @onPress={{@onClose}}\n tabindex={{@closeButtonTabIndex}}\n disabled={{@isDisabled}}\n />\n {{/if}}\n </div>\n </template>\n}\n\nexport { Chip, type ChipSignature };\nexport default Chip;\n"],"names":["Chip","Component","classNames","chip","useStyles","base","content","dot","closeButton","intent","args","size","appearance","radius","isDisabled","class","setComponentTemplate","precompileTemplate","strictMode","scope","CloseButton"],"mappings":";;;;;;AA+FA,MAAMA,aAAaC,SAAA,CAAU;EAC3B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAM,GAAGC,SAAA,EAAA;IAEjB,MAAM;MAAEC,IAAI;MAAEC,OAAO;MAAEC,GAAG;AAAEC,MAAAA;KAAa,GAAGL,IAAA,CAAK;AAC/CM,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAA,EAAY,IAAI,CAACF,IAAI,CAACE,UAAU,IAAI,SAAA;AACpCC,MAAAA,MAAA,EAAQ,IAAI,CAACH,IAAI,CAACG,MAAM;AACxBC,MAAAA,UAAA,EAAY,IAAI,CAACJ,IAAI,CAACI;AACxB,KAAA,CAAA;IAEA,OAAO;MACLT,IAAA,EAAMA,IAAA,CAAK;AAAEU,QAAAA,KAAA,EAAO,IAAI,CAACL,IAAI,CAACK;AAAM,OAAA,CAAA;MACpCT,OAAA,EAASA,OAAA,EAAA;MACTC,GAAA,EAAKA,GAAA,EAAA;MACLC,WAAA,EAAaA,WAAA;KACf;AACF,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,2ZAAA,EAkBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -0,0 +1,84 @@
1
+ import Component from '@glimmer/component';
2
+ import { action } from '@ember/object';
3
+ import { tracked } from '@glimmer/tracking';
4
+ import { on } from '@ember/modifier';
5
+ import { deprecate } from '@ember/debug';
6
+ import { VisuallyHidden } from '../utilities/visually-hidden.js';
7
+ import press from '../../modifiers/press.js';
8
+ import { useStyles } from '@frontile/theme';
9
+ import { precompileTemplate } from '@ember/template-compilation';
10
+ import { setComponentTemplate } from '@ember/component';
11
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../../runtime--fcdnjmJ-BOdRhmsS.js';
12
+
13
+ class CloseButton extends Component {
14
+ static {
15
+ decorateFieldV2(this.prototype, "isPressed", [tracked], function () {
16
+ return false;
17
+ });
18
+ }
19
+ #isPressed = (initializeDeferredDecorator(this, "isPressed"), void 0);
20
+ constructor(owner, args) {
21
+ super(owner, args);
22
+ if (args.onClick) {
23
+ deprecate('CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.', false, {
24
+ id: 'frontile.close-button.onClick',
25
+ until: '0.18.0',
26
+ for: 'frontile',
27
+ since: {
28
+ available: '0.17.0',
29
+ enabled: '0.17.0'
30
+ }
31
+ });
32
+ }
33
+ }
34
+ get classes() {
35
+ const {
36
+ closeButton
37
+ } = useStyles();
38
+ let {
39
+ base,
40
+ icon
41
+ } = closeButton({
42
+ size: this.args.size || 'md',
43
+ variant: this.args.variant || 'transparent'
44
+ });
45
+ return {
46
+ base: base({
47
+ class: this.args.class
48
+ }),
49
+ icon: icon()
50
+ };
51
+ }
52
+ handlePressChange = isPressed => {
53
+ this.isPressed = isPressed;
54
+ };
55
+ handlePress(event) {
56
+ if (typeof this.args.onPress === 'function') {
57
+ this.args.onPress(event);
58
+ }
59
+ }
60
+ static {
61
+ decorateMethodV2(this.prototype, "handlePress", [action]);
62
+ }
63
+ handleClick(event) {
64
+ if (typeof this.args.onClick === 'function') {
65
+ this.args.onClick(event);
66
+ }
67
+ }
68
+ static {
69
+ decorateMethodV2(this.prototype, "handleClick", [action]);
70
+ }
71
+ static {
72
+ setComponentTemplate(precompileTemplate("<button type=\"button\" class={{this.classes.base}} data-pressed={{if this.isPressed \"true\"}} ...attributes {{press this.handlePress onPressChange=this.handlePressChange}} {{on \"click\" this.handleClick}}>\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg class={{this.classes.icon}} aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n</button>", {
73
+ strictMode: true,
74
+ scope: () => ({
75
+ press,
76
+ on,
77
+ VisuallyHidden
78
+ })
79
+ }), this);
80
+ }
81
+ }
82
+
83
+ export { CloseButton, CloseButton as default };
84
+ //# sourceMappingURL=close-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-button.js","sources":["../../../src/components/buttons/close-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { deprecate } from '@ember/debug';\nimport { VisuallyHidden } from '../utilities/visually-hidden';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { useStyles, type CloseButtonVariants } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\ninterface CloseButtonSignature {\n Args: {\n /**\n * The title of the close button\n *\n * @defaultValue 'Close'\n */\n title?: string;\n\n /**\n * The icon size\n *\n * @defaultValue 'lg'\n */\n size?: CloseButtonVariants['size'];\n\n /**\n * @defaultValue 'transparent'\n */\n variant?: CloseButtonVariants['variant'];\n\n /**\n * The function to call when button is pressed\n */\n onPress?: (event: PressEvent) => void;\n\n /**\n * Deprecated: The function to call when button is clicked\n *\n * @deprecated Use onPress instead for better cross-platform support\n */\n onClick?: (event: Event) => void;\n\n /**\n * Additional class for close button element\n */\n class?: string;\n };\n Blocks: {\n default: [string | null];\n };\n Element: HTMLButtonElement;\n}\n\nclass CloseButton extends Component<CloseButtonSignature> {\n @tracked isPressed = false;\n\n constructor(owner: Owner, args: CloseButtonSignature['Args']) {\n super(owner, args);\n\n if (args.onClick) {\n deprecate(\n 'CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.',\n false,\n {\n id: 'frontile.close-button.onClick',\n until: '0.18.0',\n for: 'frontile',\n since: { available: '0.17.0', enabled: '0.17.0' }\n }\n );\n }\n }\n\n get classes() {\n const { closeButton } = useStyles();\n\n let { base, icon } = closeButton({\n size: this.args.size || 'md',\n variant: this.args.variant || 'transparent'\n });\n\n return {\n base: base({ class: this.args.class }),\n icon: icon()\n };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n @action handlePress(event: PressEvent): void {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n }\n\n @action handleClick(event: Event): void {\n if (typeof this.args.onClick === 'function') {\n this.args.onClick(event);\n }\n }\n\n <template>\n <button\n type=\"button\"\n class={{this.classes.base}}\n data-pressed={{if this.isPressed \"true\"}}\n ...attributes\n {{press this.handlePress onPressChange=this.handlePressChange}}\n {{on \"click\" this.handleClick}}\n >\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg\n class={{this.classes.icon}}\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n ></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n </button>\n </template>\n}\n\nexport { CloseButton, type CloseButtonSignature };\nexport default CloseButton;\n"],"names":["CloseButton","Component","g","prototype","tracked","i","constructor","owner","args","onClick","deprecate","id","until","for","since","available","enabled","classes","closeButton","useStyles","base","icon","size","variant","class","handlePressChange","isPressed","handlePress","event","onPress","n","action","handleClick","setComponentTemplate","precompileTemplate","strictMode","scope","press","on","VisuallyHidden"],"mappings":";;;;;;;;;;;;AAsDA,MAAMA,oBAAoBC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACjCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAErBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAkC,EAAE;AAC5D,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IAEb,IAAIA,IAAA,CAAKC,OAAO,EAAE;AAChBC,MAAAA,SAAA,CACE,wJACA,KAAA,EACA;AACEC,QAAAA,EAAA,EAAI,+BAAA;AACJC,QAAAA,KAAA,EAAO,QAAA;AACPC,QAAAA,GAAA,EAAK,UAAA;AACLC,QAAAA,KAAA,EAAO;AAAEC,UAAAA,SAAA,EAAW,QAAA;AAAUC,UAAAA,OAAA,EAAS;AAAS;AAClD,OAAA,CAAA;AAEJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAM,GAAGH,WAAA,CAAY;AAC/BI,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc,IAAI,IAAI,IAAA;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACf,IAAI,CAACe,OAAO,IAAI;AAChC,KAAA,CAAA;IAEA,OAAO;MACLH,IAAA,EAAMA,IAAA,CAAK;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAAChB,IAAI,CAACgB;AAAM,OAAA,CAAA;MACpCH,IAAA,EAAMA,IAAA;KACR;AACF,EAAA;EAEAI,iBAAA,GAAqBC,SAAkB,IAAO;IAC5C,IAAI,CAACA,SAAS,GAAGA,SAAA;EACnB,CAAA;EAEQC,WAAAA,CAAYC,KAAiB,EAAQ;IAC3C,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACqB,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACrB,IAAI,CAACqB,OAAO,CAACD,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,aAAA,EAAA,CAJC4B,MAAA,CAAA,CAAA;AAAA;EAMOC,WAAAA,CAAYJ,KAAY,EAAQ;IACtC,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACC,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACD,IAAI,CAACC,OAAO,CAACmB,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,aAAA,EAAA,CAJC4B,MAAA,CAAA,CAAA;AAAA;AAMD,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,4pBAAA,EAkCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,KAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -0,0 +1,8 @@
1
+ export { Button } from './button.js';
2
+ export { CloseButton } from './close-button.js';
3
+ export { ToggleButton } from './toggle-button.js';
4
+ export { ButtonGroup } from './button-group.js';
5
+ export { Chip } from './chip.js';
6
+ export { SegmentedControl } from './segmented-control/segmented-control.js';
7
+ export { SegmentedControlItem } from './segmented-control/item.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,55 @@
1
+ import Component from '@glimmer/component';
2
+ import { hash } from '@ember/helper';
3
+ import { on } from '@ember/modifier';
4
+ import press from '../../../modifiers/press.js';
5
+ import { modifier } from 'ember-modifier';
6
+ import { precompileTemplate } from '@ember/template-compilation';
7
+ import { setComponentTemplate } from '@ember/component';
8
+
9
+ class SegmentedControlItem extends Component {
10
+ get isSelected() {
11
+ return this.args.context.isSelected(this.args.value);
12
+ }
13
+ get isDisabled() {
14
+ return this.args.isDisabled || this.args.context.isGroupDisabled;
15
+ }
16
+ registerValue = modifier((element, [value]) => {
17
+ this.args.context.registerValue(element, value);
18
+ return () => {
19
+ this.args.context.unregisterValue(element);
20
+ };
21
+ });
22
+ handleClick = () => {
23
+ if (this.isDisabled) {
24
+ return;
25
+ }
26
+ this.args.context.select(this.args.value);
27
+ };
28
+ get stringValue() {
29
+ return String(this.args.value);
30
+ }
31
+ handleChange = () => {
32
+ if (this.isDisabled) {
33
+ return;
34
+ }
35
+ this.args.context.select(this.args.value);
36
+ // The browser has already moved checkedness in the DOM. Ask the control to
37
+ // re-assert the whole group from `@value` once the consumer has had its
38
+ // chance to respond, so a declined (or absent) `@onChange` cannot leave the
39
+ // native state disagreeing with the rendered selection.
40
+ this.args.context.requestFormSync();
41
+ };
42
+ static {
43
+ setComponentTemplate(precompileTemplate("{{#if @context.name}}\n {{!-- Form mode. Native radios bring their own arrow-key and focus\n behaviour for a same-named group, so RovingFocus deliberately stands\n down here rather than fighting the browser for control. --}}\n <label class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{@context.indicator.setupTarget this.isSelected}} ...attributes>\n <input type=\"radio\" name={{@context.name}} value={{this.stringValue}} checked={{this.isSelected}} disabled={{this.isDisabled}} class=\"sr-only\" {{this.registerValue @value}} {{on \"change\" this.handleChange}} />\n {{yield (hash isSelected=this.isSelected)}}\n </label>\n{{else}}\n <button type=\"button\" role=\"radio\" aria-checked=\"{{this.isSelected}}\" disabled={{this.isDisabled}} class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{this.registerValue @value}} {{@context.indicator.setupTarget this.isSelected}} {{@context.roving.setupItem}} {{press this.handleClick}} ...attributes>\n {{yield (hash isSelected=this.isSelected)}}\n </button>\n{{/if}}", {
44
+ strictMode: true,
45
+ scope: () => ({
46
+ on,
47
+ hash,
48
+ press
49
+ })
50
+ }), this);
51
+ }
52
+ }
53
+
54
+ export { SegmentedControlItem, SegmentedControlItem as default };
55
+ //# sourceMappingURL=item.js.map