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,397 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { action } from '@ember/object';
4
+ import { hash } from '@ember/helper';
5
+ import { on } from '@ember/modifier';
6
+ import { ref } from '../../utils/ref.js';
7
+ import { dataFrom } from 'form-data-utils';
8
+ import { StandardValidator, issuePathToFieldName } from '../../utils/standard-validator.js';
9
+ import { flattenData, deepEqual, unflattenData } from '../../utils/nested-data.js';
10
+ import { Field } from './field.js';
11
+ import { precompileTemplate } from '@ember/template-compilation';
12
+ import { setComponentTemplate } from '@ember/component';
13
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../../runtime--fcdnjmJ-BOdRhmsS.js';
14
+
15
+ /**
16
+ * A form component that handles form submissions and input changes.
17
+ *
18
+ * @example
19
+ * ```hbs
20
+ * <Form
21
+ * @data={{this.formData}}
22
+ * @schema={{this.schema}}
23
+ * @validate={{this.customValidator}}
24
+ * @onSubmit={{this.onSubmit}}
25
+ * @onChange={{this.onChange}}
26
+ * as |form|
27
+ * >
28
+ * <form.Field name="firstName" as |field|>
29
+ * <field.Input />
30
+ * </form.Field>
31
+ * <form.Field name="lastName" as |field|>
32
+ * <field.Input />
33
+ * </form.Field>
34
+ * <Button type="submit" @isLoading={{form.isLoading}}>
35
+ * Submit
36
+ * <:loading>Submitting...</:loading>
37
+ * </Button>
38
+ * </Form>
39
+ * ```
40
+ */
41
+ class Form extends Component {
42
+ static {
43
+ decorateFieldV2(this.prototype, "isLoading", [tracked], function () {
44
+ return false;
45
+ });
46
+ }
47
+ #isLoading = (initializeDeferredDecorator(this, "isLoading"), void 0);
48
+ /** Whether the form is currently submitting. */
49
+ static {
50
+ decorateFieldV2(this.prototype, "errors", [tracked], function () {
51
+ return {};
52
+ });
53
+ }
54
+ #errors = (initializeDeferredDecorator(this, "errors"), void 0);
55
+ /** The current form validation errors. */
56
+ static {
57
+ decorateFieldV2(this.prototype, "uncontrolledData", [tracked]);
58
+ }
59
+ #uncontrolledData = (initializeDeferredDecorator(this, "uncontrolledData"), void 0);
60
+ /** The current uncontrolled form data. */
61
+ static {
62
+ decorateFieldV2(this.prototype, "initialDataSnapshot", [tracked]);
63
+ }
64
+ #initialDataSnapshot = (initializeDeferredDecorator(this, "initialDataSnapshot"), void 0);
65
+ /**
66
+ * Flattened snapshot of initial data for dirty field comparison.
67
+ * Stored in flattened form regardless of whether source data is nested or flat.
68
+ */
69
+ static {
70
+ decorateFieldV2(this.prototype, "dirty", [tracked], function () {
71
+ return new Set();
72
+ });
73
+ }
74
+ #dirty = (initializeDeferredDecorator(this, "dirty"), void 0);
75
+ /**
76
+ * The set of fields that have changed from their initial values.
77
+ * For flat data structures: contains top-level keys (e.g., "firstName", "email")
78
+ * For nested data structures: contains dotted paths (e.g., "user.name.first", "profile.email")
79
+ */
80
+ /** Reference to the form element. */element = ref();
81
+ /**
82
+ * Creates a new instance of the Form component.
83
+ * Initializes internal state based on provided args.
84
+ * @param owner - The owner of the component.
85
+ * @param args - The arguments passed to the component.
86
+ */
87
+ constructor(owner, args) {
88
+ super(owner, args);
89
+ // Create copy of initial data
90
+ if (args.data) {
91
+ // Always store flattened snapshot for dirty tracking
92
+ // This ensures consistent comparison regardless of initial structure
93
+ this.initialDataSnapshot = flattenData(args.data);
94
+ // Keep uncontrolled data in original structure
95
+ this.uncontrolledData = {
96
+ ...args.data
97
+ };
98
+ }
99
+ }
100
+ /** Whether the form is valid (i.e. has no validation errors). */
101
+ get isValid() {
102
+ return Object.keys(this.errors).length === 0;
103
+ }
104
+ /** Whether the form is invalid (i.e. has validation errors). */
105
+ get isInvalid() {
106
+ return !this.isValid;
107
+ }
108
+ /** Whether the form is controlled (`onChange` is provided). */
109
+ get isControlled() {
110
+ return !!this.args.onChange;
111
+ }
112
+ /** The events on which validation should run. */
113
+ get validateOn() {
114
+ return this.args.validateOn ?? ['change', 'blur', 'submit'];
115
+ }
116
+ /** The events on which field-level validation should run. */
117
+ get fieldValidateOn() {
118
+ return this.validateOn.filter(e => e !== 'submit');
119
+ }
120
+ /** The current form data, from args if controlled, or internal state if uncontrolled. */
121
+ get currentData() {
122
+ if (this.isControlled) {
123
+ return this.args.data;
124
+ }
125
+ return this.uncontrolledData;
126
+ }
127
+ /**
128
+ * Validates data against the provided schema using StandardValidator.
129
+ * Updates the `errors` property with any validation errors found.
130
+ *
131
+ * @param data - The form data to validate.
132
+ * @returns A promise that resolves to the validation errors, if any.
133
+ */
134
+ async validate(data) {
135
+ // Run validator and get issues
136
+ const errors = await StandardValidator.validateAll(data, this.args.schema, this.args.validate);
137
+ // Convert validator errors to FormErrors
138
+ if (errors) {
139
+ const formErrors = validatorToFormErrors(errors);
140
+ this.errors = formErrors;
141
+ return formErrors;
142
+ }
143
+ // Clear errors if no issues
144
+ this.errors = {};
145
+ }
146
+ /**
147
+ * Validates a single field against the provided schema using
148
+ * StandardValidator. Updates the `errors` property with any validation
149
+ * errors found for the field. If the field had previous errors but
150
+ * is now valid, those errors are cleared.
151
+ *
152
+ * @param data - The form data to validate against.
153
+ * @param name - The name of the field to validate.
154
+ * @returns A promise that resolves to errors for the field, if any.
155
+ */
156
+ async validateField(data, name) {
157
+ if (!this.args.schema && !this.args.validate) {
158
+ return;
159
+ }
160
+ // Run validator and get issues
161
+ const errors = await StandardValidator.validateFieldAll(data, name, this.args.schema, this.args.validate);
162
+ // Convert validator errors to FormErrors
163
+ if (errors) {
164
+ const formErrors = validatorToFormErrors(errors);
165
+ if (formErrors[name]) {
166
+ // Merge with existing errors immutably
167
+ this.errors = {
168
+ ...this.errors,
169
+ [name]: formErrors[name]
170
+ };
171
+ }
172
+ return {
173
+ [name]: formErrors[name]
174
+ };
175
+ }
176
+ // Clear field error if no issues
177
+ // Remove field error using immutable pattern:
178
+ // 1. Use destructuring to extract the field we want to remove
179
+ // (assigned to '_' since unused)
180
+ // 2. Capture all remaining fields in 'rest' using the spread operator
181
+ // 3. Reassign this.errors to the 'rest' object, effectively removing
182
+ // the field
183
+ // This approach maintains immutability by creating a new object rather than
184
+ // mutating the existing errors object with 'delete'
185
+ if (this.errors[name]) {
186
+ const {
187
+ [name]: _,
188
+ ...rest
189
+ } = this.errors;
190
+ this.errors = rest;
191
+ }
192
+ }
193
+ /**
194
+ * Computes which fields have changed from their initial values.
195
+ * Uses deep comparison for consistency across flat and nested structures.
196
+ * This is a pure function with no side effects.
197
+ *
198
+ * @param data - The current form data.
199
+ * @returns A set of field names that have changed.
200
+ */
201
+ static {
202
+ decorateMethodV2(this.prototype, "validateField", [action]);
203
+ }
204
+ computeDirtyFields(data) {
205
+ const dirty = new Set();
206
+ if (!this.initialDataSnapshot) {
207
+ return dirty;
208
+ }
209
+ // Flatten current data to same representation as snapshot
210
+ const currentFlat = flattenData(data);
211
+ // Compare all keys in current data
212
+ for (const key in currentFlat) {
213
+ if (!deepEqual(currentFlat[key], this.initialDataSnapshot[key])) {
214
+ dirty.add(key);
215
+ }
216
+ }
217
+ // Check for keys in initial data that are missing in current data
218
+ for (const key in this.initialDataSnapshot) {
219
+ if (!(key in currentFlat) && this.initialDataSnapshot[key] !== undefined) {
220
+ dirty.add(key);
221
+ }
222
+ }
223
+ return dirty;
224
+ }
225
+ /**
226
+ * Builds the form result data object to pass to callbacks.
227
+ * Also updates the dirty state as a side effect.
228
+ *
229
+ * @param data - The current form data.
230
+ * @returns The form result data object.
231
+ */
232
+ buildFormResultData(data) {
233
+ const {
234
+ isValid,
235
+ isInvalid,
236
+ errors
237
+ } = this;
238
+ const dirty = this.computeDirtyFields(data);
239
+ this.dirty = dirty; // Update tracked state
240
+ return {
241
+ data,
242
+ isValid,
243
+ isInvalid,
244
+ errors,
245
+ dirty
246
+ };
247
+ }
248
+ /**
249
+ * Handles the `input` event on the form element.
250
+ * Calls the `onChange` callback with the current form data if provided.
251
+ * Automatically unflattens dotted field names to nested structure.
252
+ */
253
+ handleInput(event) {
254
+ const form = event.currentTarget;
255
+ if (form instanceof HTMLFormElement) {
256
+ let data = dataFrom(event);
257
+ // Always unflatten form data to handle dotted field names
258
+ // This is safe for flat data too - keys without dots remain unchanged
259
+ data = unflattenData(data);
260
+ const resultData = this.buildFormResultData(data);
261
+ this.uncontrolledData = data;
262
+ this.args.onChange?.(resultData, event);
263
+ }
264
+ }
265
+ /**
266
+ * Handles the `submit` event on the form element.
267
+ * Prevents the default form submission and calls the `onSubmit` callback
268
+ * with the current form data. Manages the `isLoading` state during the
269
+ * submission process. Automatically unflattens dotted field names to nested structure.
270
+ */
271
+ static {
272
+ decorateMethodV2(this.prototype, "handleInput", [action]);
273
+ }
274
+ async handleSubmit(event) {
275
+ event.preventDefault();
276
+ const form = event.currentTarget;
277
+ if (form instanceof HTMLFormElement) {
278
+ this.isLoading = true;
279
+ let data = dataFrom(event);
280
+ // Always unflatten form data to handle dotted field names
281
+ // This is safe for flat data too - keys without dots remain unchanged
282
+ data = unflattenData(data);
283
+ let errors;
284
+ if (this.validateOn.includes('submit')) {
285
+ errors = await this.validate(data);
286
+ }
287
+ const resultData = this.buildFormResultData(data);
288
+ this.uncontrolledData = data;
289
+ try {
290
+ if (errors && this.args.onError) {
291
+ // Call onError handler when there are validation errors
292
+ await this.args.onError(errors, data, event);
293
+ } else if (!errors && this.args.onSubmit) {
294
+ // Run `onSubmit` if validation was skipped OR if validation passed
295
+ await this.args.onSubmit(resultData, event);
296
+ // Update snapshot on successful submit (new baseline)
297
+ this.initialDataSnapshot = flattenData(data);
298
+ // Clear dirty state since we've updated the baseline
299
+ this.dirty = new Set();
300
+ }
301
+ } finally {
302
+ this.isLoading = false;
303
+ }
304
+ }
305
+ }
306
+ /**
307
+ * Handles the `reset` event on the form element.
308
+ * Clears validation errors and dirty tracking.
309
+ * Restores the form data to its initial state.
310
+ * Calls `onChange` if the form is controlled to let parent update state.
311
+ */
312
+ static {
313
+ decorateMethodV2(this.prototype, "handleSubmit", [action]);
314
+ }
315
+ handleReset(event) {
316
+ // Clear state
317
+ this.errors = {};
318
+ this.dirty = new Set();
319
+ // Restore initial data
320
+ if (this.initialDataSnapshot) {
321
+ // Unflatten data if it was nested
322
+ const restoredData = unflattenData(this.initialDataSnapshot);
323
+ // For controlled forms, call onChange to let parent update state
324
+ if (this.isControlled && this.args.onChange) {
325
+ const resultData = this.buildFormResultData(restoredData);
326
+ this.args.onChange(resultData, event);
327
+ } else {
328
+ // For uncontrolled forms, update internal state
329
+ this.uncontrolledData = restoredData;
330
+ }
331
+ } else {
332
+ // No initial data, just clear uncontrolled data
333
+ this.uncontrolledData = undefined;
334
+ }
335
+ }
336
+ /**
337
+ * Resets the form to its initial state.
338
+ * This method calls the native form reset() to clear all form controls,
339
+ * triggering a `reset` event that is handled in `handleReset`.
340
+ */
341
+ static {
342
+ decorateMethodV2(this.prototype, "handleReset", [action]);
343
+ }
344
+ reset() {
345
+ this.element?.current?.reset();
346
+ }
347
+ static {
348
+ decorateMethodV2(this.prototype, "reset", [action]);
349
+ }
350
+ static {
351
+ setComponentTemplate(precompileTemplate("{{!-- @glint-nocheck component generics (field) trigger: type instantiation is excessively deep and possibly infinite --}}\n<form {{this.element.setup}} {{on \"input\" this.handleInput}} {{on \"submit\" this.handleSubmit}} {{on \"reset\" this.handleReset}} ...attributes>\n {{yield (hash data=this.currentData isLoading=this.isLoading isValid=this.isValid isInvalid=this.isInvalid errors=this.errors dirty=this.dirty reset=this.reset Field=(component Field errors=this.errors formData=this.currentData disabled=@disabled validateOn=this.fieldValidateOn validateField=this.validateField)) to=\"default\"}}\n</form>", {
352
+ strictMode: true,
353
+ scope: () => ({
354
+ on,
355
+ hash,
356
+ Field
357
+ })
358
+ }), this);
359
+ }
360
+ }
361
+ /**
362
+ * Helper function.
363
+ * Converts validation type `Issues` from StandardValidator into a format
364
+ * suitable for the form component, type `FormErrors`.
365
+ *
366
+ * For example, an issue with path `['email']` will be converted
367
+ * to a form error for the field `email`, `{"email": "error message" }`.
368
+ * Numeric path segments are kept, so an issue with path
369
+ * `['items', 0, 'name']` becomes `{"items.0.name": "error message"}`.
370
+ *
371
+ * @param errors - The validation issues to convert.
372
+ * @returns A mapping of field names to their validation error messages.
373
+ */
374
+ function validatorToFormErrors(errors) {
375
+ const formErrors = {};
376
+ for (const issue of errors) {
377
+ if (!issue.path || issue.path.length === 0) continue;
378
+ // `issuePathToFieldName` is shared with
379
+ // `StandardValidator.filterFieldIssues`, so the keys written here are
380
+ // by construction the dotted names field lookup resolves against.
381
+ const fieldName = issuePathToFieldName(issue);
382
+ const message = issue.message;
383
+ // Add message to the field's errors
384
+ const existing = formErrors[fieldName];
385
+ if (existing === undefined) {
386
+ formErrors[fieldName] = message;
387
+ } else if (Array.isArray(existing)) {
388
+ existing.push(message);
389
+ } else {
390
+ formErrors[fieldName] = [existing, message];
391
+ }
392
+ }
393
+ return formErrors;
394
+ }
395
+
396
+ export { Form, Form as default };
397
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sources":["../../../src/components/forms/form.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { ref } from '../../utils/ref';\nimport { dataFrom } from 'form-data-utils';\nimport {\n StandardValidator,\n issuePathToFieldName\n} from '../../utils/standard-validator';\nimport { flattenData, unflattenData, deepEqual } from '../../utils/nested-data';\nimport { Field } from './field';\n\nimport type { WithBoundArgs } from '@glint/template';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { Issues, CustomValidatorFn } from '../../utils/standard-validator';\nimport type Owner from '@ember/owner';\n\n/** The form data as key/value pairs. */\ntype FormDataCompiled = ReturnType<typeof dataFrom>;\n/** The validation errors for the form, keyed by field name. */\ntype FormErrors = Record<string, string | string[] | undefined>;\n\n/**\n * The data passed to `onChange` and `onSubmit` callbacks, which is similar\n * to `FormContext` but also includes the form data.\n */\ntype FormResultData<T = FormDataCompiled> = {\n /** The form data as key/value pairs. */\n data: T;\n /** Whether the form is valid (i.e. has no validation errors). */\n isValid: boolean;\n /** Whether the form is invalid (i.e. has validation errors). */\n isInvalid: boolean;\n /** The current form validation errors. */\n errors: FormErrors;\n /**\n * The set of fields that have changed from their initial values.\n * For flat data structures: contains top-level keys (e.g., \"firstName\", \"email\")\n * For nested data structures: contains dotted paths (e.g., \"user.name.first\", \"profile.email\")\n */\n dirty: Set<string>;\n};\n\n/**\n * The context yielded to the default block of the `Form` component.\n */\ninterface FormContext<T = FormDataCompiled> {\n /** The form data as key/value pairs. */\n data?: T;\n /** Whether the form is currently submitting. */\n isLoading: boolean;\n /** Whether the form is valid (i.e. has no validation errors). */\n isValid: boolean;\n /** Whether the form is invalid (i.e. has validation errors). */\n isInvalid: boolean;\n /** The current form validation errors. */\n errors: FormErrors;\n /**\n * The set of fields that have changed from their initial values.\n * For flat data structures: contains top-level keys (e.g., \"firstName\", \"email\")\n * For nested data structures: contains dotted paths (e.g., \"user.name.first\", \"profile.email\")\n */\n dirty: Set<string>;\n /**\n * Resets the form to its initial state.\n * Clears all form fields, validation errors, and dirty tracking.\n */\n reset: () => void;\n /** The `Field` component, with args bound. */\n Field: WithBoundArgs<\n typeof Field,\n 'errors' | 'formData' | 'disabled' | 'validateOn' | 'validateField'\n >;\n}\n\ninterface FormSignature<T = FormDataCompiled> {\n Element: HTMLFormElement;\n Args: {\n /**\n * The standard schema to validate form data against.\n */\n schema?: StandardSchemaV1<T>;\n /**\n * Optional custom validation function. A custom validator should return\n * an array of Standard Schema issues, or `undefined` if there are none.\n * This function may be async or sync.\n */\n validate?: CustomValidatorFn<T>;\n /**\n * When to run validation.\n */\n validateOn?: ('change' | 'input' | 'blur' | 'submit')[];\n /**\n * The initial form data as key/value pairs.\n * This is primarily useful for setting default values in the form.\n * This object receives changes as the user interacts with the form.\n */\n data?: T;\n /**\n * Whether the entire form and all its fields should be disabled. This only\n * applies when using the yielded `Field` component.\n */\n disabled?: boolean;\n /**\n * Optional callback invoked on input changes within the form.\n * @param result - The current form result data.\n * @param event - The input event that triggered the change.\n * @returns A promise or void.\n */\n onChange?: (\n result: FormResultData<T>,\n event: Event\n ) => Promise<void> | void;\n /**\n * Callback invoked on form submission. If `onSubmit` returns a promise,\n * the form will be marked as `isLoading` until the promise resolves.\n * @param result - The current form result data.\n * @param event - The submit event that triggered the submission.\n * @returns A promise or void.\n */\n onSubmit: (\n result: FormResultData<T>,\n event: SubmitEvent\n ) => Promise<void> | void;\n /**\n * Optional callback invoked when validation errors occur on form submission.\n * @param errors - The validation errors found.\n * @param data - The form data that was validated.\n * @param event - The submit event that triggered the validation.\n * @returns A promise or void.\n */\n onError?: (\n errors: FormErrors,\n data: T,\n event: SubmitEvent\n ) => Promise<void> | void;\n };\n Blocks: {\n default: [FormContext<T>];\n };\n}\n\n/**\n * A form component that handles form submissions and input changes.\n *\n * @example\n * ```hbs\n * <Form\n * @data={{this.formData}}\n * @schema={{this.schema}}\n * @validate={{this.customValidator}}\n * @onSubmit={{this.onSubmit}}\n * @onChange={{this.onChange}}\n * as |form|\n * >\n * <form.Field name=\"firstName\" as |field|>\n * <field.Input />\n * </form.Field>\n * <form.Field name=\"lastName\" as |field|>\n * <field.Input />\n * </form.Field>\n * <Button type=\"submit\" @isLoading={{form.isLoading}}>\n * Submit\n * <:loading>Submitting...</:loading>\n * </Button>\n * </Form>\n * ```\n */\nclass Form<T = FormDataCompiled> extends Component<FormSignature<T>> {\n /** Whether the form is currently submitting. */\n @tracked isLoading = false;\n\n /** The current form validation errors. */\n @tracked errors: FormErrors = {};\n\n /** The current uncontrolled form data. */\n @tracked uncontrolledData?: T;\n\n /**\n * Flattened snapshot of initial data for dirty field comparison.\n * Stored in flattened form regardless of whether source data is nested or flat.\n */\n @tracked initialDataSnapshot?: Record<string, unknown>;\n\n /**\n * The set of fields that have changed from their initial values.\n * For flat data structures: contains top-level keys (e.g., \"firstName\", \"email\")\n * For nested data structures: contains dotted paths (e.g., \"user.name.first\", \"profile.email\")\n */\n @tracked dirty: Set<string> = new Set();\n\n /** Reference to the form element. */\n element = ref<HTMLFormElement>();\n\n /**\n * Creates a new instance of the Form component.\n * Initializes internal state based on provided args.\n * @param owner - The owner of the component.\n * @param args - The arguments passed to the component.\n */\n constructor(owner: Owner, args: FormSignature<T>['Args']) {\n super(owner, args);\n // Create copy of initial data\n if (args.data) {\n // Always store flattened snapshot for dirty tracking\n // This ensures consistent comparison regardless of initial structure\n this.initialDataSnapshot = flattenData(\n args.data as Record<string, unknown>\n );\n\n // Keep uncontrolled data in original structure\n this.uncontrolledData = { ...args.data };\n }\n }\n\n /** Whether the form is valid (i.e. has no validation errors). */\n get isValid() {\n return Object.keys(this.errors).length === 0;\n }\n\n /** Whether the form is invalid (i.e. has validation errors). */\n get isInvalid() {\n return !this.isValid;\n }\n\n /** Whether the form is controlled (`onChange` is provided). */\n get isControlled(): boolean {\n return !!this.args.onChange;\n }\n\n /** The events on which validation should run. */\n get validateOn(): ('change' | 'input' | 'blur' | 'submit')[] {\n return this.args.validateOn ?? ['change', 'blur', 'submit'];\n }\n\n /** The events on which field-level validation should run. */\n get fieldValidateOn(): ('change' | 'input' | 'blur')[] {\n return this.validateOn.filter((e) => e !== 'submit');\n }\n\n /** The current form data, from args if controlled, or internal state if uncontrolled. */\n get currentData(): T | undefined {\n if (this.isControlled) {\n return this.args.data;\n }\n return this.uncontrolledData;\n }\n\n /**\n * Validates data against the provided schema using StandardValidator.\n * Updates the `errors` property with any validation errors found.\n *\n * @param data - The form data to validate.\n * @returns A promise that resolves to the validation errors, if any.\n */\n async validate(data: T): Promise<FormErrors | undefined> {\n // Run validator and get issues\n const errors = await StandardValidator.validateAll(\n data,\n this.args.schema,\n this.args.validate\n );\n // Convert validator errors to FormErrors\n if (errors) {\n const formErrors = validatorToFormErrors(errors);\n this.errors = formErrors;\n return formErrors;\n }\n // Clear errors if no issues\n this.errors = {};\n }\n\n /**\n * Validates a single field against the provided schema using\n * StandardValidator. Updates the `errors` property with any validation\n * errors found for the field. If the field had previous errors but\n * is now valid, those errors are cleared.\n *\n * @param data - The form data to validate against.\n * @param name - The name of the field to validate.\n * @returns A promise that resolves to errors for the field, if any.\n */\n @action\n async validateField(data: T, name: string): Promise<FormErrors | undefined> {\n if (!this.args.schema && !this.args.validate) {\n return;\n }\n // Run validator and get issues\n const errors = await StandardValidator.validateFieldAll(\n data,\n name,\n this.args.schema,\n this.args.validate\n );\n // Convert validator errors to FormErrors\n if (errors) {\n const formErrors = validatorToFormErrors(errors);\n if (formErrors[name]) {\n // Merge with existing errors immutably\n this.errors = { ...this.errors, [name]: formErrors[name] };\n }\n return { [name]: formErrors[name] };\n }\n // Clear field error if no issues\n // Remove field error using immutable pattern:\n // 1. Use destructuring to extract the field we want to remove\n // (assigned to '_' since unused)\n // 2. Capture all remaining fields in 'rest' using the spread operator\n // 3. Reassign this.errors to the 'rest' object, effectively removing\n // the field\n // This approach maintains immutability by creating a new object rather than\n // mutating the existing errors object with 'delete'\n if (this.errors[name]) {\n const { [name]: _, ...rest } = this.errors;\n this.errors = rest;\n }\n }\n\n /**\n * Computes which fields have changed from their initial values.\n * Uses deep comparison for consistency across flat and nested structures.\n * This is a pure function with no side effects.\n *\n * @param data - The current form data.\n * @returns A set of field names that have changed.\n */\n computeDirtyFields(data: T): Set<string> {\n const dirty = new Set<string>();\n\n if (!this.initialDataSnapshot) {\n return dirty;\n }\n\n // Flatten current data to same representation as snapshot\n const currentFlat = flattenData(data as Record<string, unknown>);\n\n // Compare all keys in current data\n for (const key in currentFlat) {\n if (!deepEqual(currentFlat[key], this.initialDataSnapshot[key])) {\n dirty.add(key);\n }\n }\n\n // Check for keys in initial data that are missing in current data\n for (const key in this.initialDataSnapshot) {\n if (\n !(key in currentFlat) &&\n this.initialDataSnapshot[key] !== undefined\n ) {\n dirty.add(key);\n }\n }\n\n return dirty;\n }\n\n /**\n * Builds the form result data object to pass to callbacks.\n * Also updates the dirty state as a side effect.\n *\n * @param data - The current form data.\n * @returns The form result data object.\n */\n buildFormResultData(data: T): FormResultData<T> {\n const { isValid, isInvalid, errors } = this;\n const dirty = this.computeDirtyFields(data);\n this.dirty = dirty; // Update tracked state\n return {\n data,\n isValid,\n isInvalid,\n errors,\n dirty\n };\n }\n\n /**\n * Handles the `input` event on the form element.\n * Calls the `onChange` callback with the current form data if provided.\n * Automatically unflattens dotted field names to nested structure.\n */\n @action\n handleInput(event: Event) {\n const form = event.currentTarget;\n if (form instanceof HTMLFormElement) {\n let data = dataFrom(event) as T;\n\n // Always unflatten form data to handle dotted field names\n // This is safe for flat data too - keys without dots remain unchanged\n data = unflattenData(data as Record<string, unknown>) as T;\n\n const resultData = this.buildFormResultData(data);\n this.uncontrolledData = data;\n this.args.onChange?.(resultData, event);\n }\n }\n\n /**\n * Handles the `submit` event on the form element.\n * Prevents the default form submission and calls the `onSubmit` callback\n * with the current form data. Manages the `isLoading` state during the\n * submission process. Automatically unflattens dotted field names to nested structure.\n */\n @action\n async handleSubmit(event: SubmitEvent) {\n event.preventDefault();\n const form = event.currentTarget;\n if (form instanceof HTMLFormElement) {\n this.isLoading = true;\n let data = dataFrom(event) as T;\n\n // Always unflatten form data to handle dotted field names\n // This is safe for flat data too - keys without dots remain unchanged\n data = unflattenData(data as Record<string, unknown>) as T;\n\n let errors: FormErrors | undefined;\n if (this.validateOn.includes('submit')) {\n errors = await this.validate(data);\n }\n\n const resultData = this.buildFormResultData(data);\n this.uncontrolledData = data;\n try {\n if (errors && this.args.onError) {\n // Call onError handler when there are validation errors\n await this.args.onError(errors, data, event);\n } else if (!errors && this.args.onSubmit) {\n // Run `onSubmit` if validation was skipped OR if validation passed\n await this.args.onSubmit(resultData, event);\n // Update snapshot on successful submit (new baseline)\n this.initialDataSnapshot = flattenData(\n data as Record<string, unknown>\n );\n // Clear dirty state since we've updated the baseline\n this.dirty = new Set();\n }\n } finally {\n this.isLoading = false;\n }\n }\n }\n\n /**\n * Handles the `reset` event on the form element.\n * Clears validation errors and dirty tracking.\n * Restores the form data to its initial state.\n * Calls `onChange` if the form is controlled to let parent update state.\n */\n @action\n handleReset(event: Event) {\n // Clear state\n this.errors = {};\n this.dirty = new Set();\n\n // Restore initial data\n if (this.initialDataSnapshot) {\n // Unflatten data if it was nested\n const restoredData = unflattenData(this.initialDataSnapshot) as T;\n\n // For controlled forms, call onChange to let parent update state\n if (this.isControlled && this.args.onChange) {\n const resultData = this.buildFormResultData(restoredData);\n\n this.args.onChange(resultData, event);\n } else {\n // For uncontrolled forms, update internal state\n this.uncontrolledData = restoredData;\n }\n } else {\n // No initial data, just clear uncontrolled data\n this.uncontrolledData = undefined;\n }\n }\n\n /**\n * Resets the form to its initial state.\n * This method calls the native form reset() to clear all form controls,\n * triggering a `reset` event that is handled in `handleReset`.\n */\n @action\n reset() {\n this.element?.current?.reset();\n }\n\n <template>\n {{! @glint-nocheck component generics (field) trigger: type instantiation is excessively deep and possibly infinite }}\n <form\n {{this.element.setup}}\n {{on \"input\" this.handleInput}}\n {{on \"submit\" this.handleSubmit}}\n {{on \"reset\" this.handleReset}}\n ...attributes\n >\n {{yield\n (hash\n data=this.currentData\n isLoading=this.isLoading\n isValid=this.isValid\n isInvalid=this.isInvalid\n errors=this.errors\n dirty=this.dirty\n reset=this.reset\n Field=(component\n Field\n errors=this.errors\n formData=this.currentData\n disabled=@disabled\n validateOn=this.fieldValidateOn\n validateField=this.validateField\n )\n )\n to=\"default\"\n }}\n </form>\n </template>\n}\n\n/**\n * Helper function.\n * Converts validation type `Issues` from StandardValidator into a format\n * suitable for the form component, type `FormErrors`.\n *\n * For example, an issue with path `['email']` will be converted\n * to a form error for the field `email`, `{\"email\": \"error message\" }`.\n * Numeric path segments are kept, so an issue with path\n * `['items', 0, 'name']` becomes `{\"items.0.name\": \"error message\"}`.\n *\n * @param errors - The validation issues to convert.\n * @returns A mapping of field names to their validation error messages.\n */\nfunction validatorToFormErrors(errors: Issues): FormErrors {\n const formErrors: FormErrors = {};\n\n for (const issue of errors) {\n if (!issue.path || issue.path.length === 0) continue;\n\n // `issuePathToFieldName` is shared with\n // `StandardValidator.filterFieldIssues`, so the keys written here are\n // by construction the dotted names field lookup resolves against.\n const fieldName = issuePathToFieldName(issue);\n const message = issue.message;\n\n // Add message to the field's errors\n const existing = formErrors[fieldName];\n if (existing === undefined) {\n formErrors[fieldName] = message;\n } else if (Array.isArray(existing)) {\n existing.push(message);\n } else {\n formErrors[fieldName] = [existing, message];\n }\n }\n\n return formErrors;\n}\n\nexport {\n Form,\n type FormContext,\n type FormSignature,\n type FormDataCompiled,\n type FormResultData,\n type FormErrors\n};\nexport default Form;\n"],"names":["Form","Component","g","prototype","tracked","i","Set","element","ref","constructor","owner","args","data","initialDataSnapshot","flattenData","uncontrolledData","isValid","Object","keys","errors","length","isInvalid","isControlled","onChange","validateOn","fieldValidateOn","filter","e","currentData","validate","StandardValidator","validateAll","schema","formErrors","validatorToFormErrors","validateField","name","validateFieldAll","_","rest","n","action","computeDirtyFields","dirty","currentFlat","key","deepEqual","add","undefined","buildFormResultData","handleInput","event","form","currentTarget","HTMLFormElement","dataFrom","unflattenData","resultData","handleSubmit","preventDefault","isLoading","includes","onError","onSubmit","handleReset","restoredData","reset","current","setComponentTemplate","precompileTemplate","strictMode","scope","on","hash","Field","issue","path","fieldName","issuePathToFieldName","message","existing","Array","isArray","push"],"mappings":";;;;;;;;;;;;;;AAgJA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBC;AACD,MAAMA,IAAA,SAAmCC,UAAwB;AAAA,EAAA;IA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Q;AAC7C,IAAA;AACF,EAAA;AAEA,EAAA,OAAO9C,UAAA;AACT;;;;"}
@@ -0,0 +1,13 @@
1
+ import { precompileTemplate } from '@ember/template-compilation';
2
+ import { setComponentTemplate } from '@ember/component';
3
+ import templateOnly from '@ember/component/template-only';
4
+
5
+ const IconChevronUpDown = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\" />\n</svg>", {
6
+ strictMode: true
7
+ }), templateOnly());
8
+ var icons = setComponentTemplate(precompileTemplate("@frontile/froms Icons component is empty, use template imports.", {
9
+ strictMode: true
10
+ }), templateOnly());
11
+
12
+ export { IconChevronUpDown, icons as default };
13
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","sources":["../../../src/components/forms/icons.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\n\nconst IconChevronUpDown: TOC<{\n Element: SVGElement;\n}> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nexport { IconChevronUpDown };\n\n<template>\n @frontile/froms Icons component is empty, use template imports.\n</template>\n"],"names":["IconChevronUpDown","setComponentTemplate","precompileTemplate","strictMode","templateOnly"],"mappings":";;;;AAEA,MAAMA,iBAED,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,+RAAA,EAgBL;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAIV,YAAAH,oBAAA,CAAAC,kBAAA,CAAA,iEAAA,EAEA;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;;;;"}
@@ -0,0 +1,20 @@
1
+ export { Form } from './form.js';
2
+ export { Field } from './field.js';
3
+ export { Checkbox } from './checkbox.js';
4
+ export { CheckboxGroup } from './checkbox-group.js';
5
+ export { FormDescription } from './form-description.js';
6
+ export { FormFeedback, feedbackMessageText } from './form-feedback.js';
7
+ export { Input } from './input.js';
8
+ export { InputOtp } from './input-otp.js';
9
+ export { Label } from './label.js';
10
+ export { NativeSelect } from './native-select.js';
11
+ export { Select } from './select/select.js';
12
+ export { Autocomplete } from './autocomplete.js';
13
+ export { Textarea } from './textarea.js';
14
+ export { Radio } from './radio.js';
15
+ export { RadioGroup } from './radio-group.js';
16
+ export { FormControl } from './form-control.js';
17
+ export { Switch } from './switch.js';
18
+ export { StandardValidator } from '../../utils/standard-validator.js';
19
+ export { deepEqual, flattenData, hasNestedData, unflattenData } from '../../utils/nested-data.js';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}