@neural-ui/native 0.0.0-stage → 0.1.0-beta.10

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 (483) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -2
  3. package/dist/accordion/accordion.d.ts +11 -0
  4. package/dist/accordion/accordion.js +75 -0
  5. package/dist/accordion/accordion.js.map +1 -0
  6. package/dist/accordion/index.d.ts +1 -0
  7. package/dist/accordion/index.js +2 -0
  8. package/dist/accordion/index.js.map +1 -0
  9. package/dist/alert/alert.d.ts +27 -0
  10. package/dist/alert/alert.js +69 -0
  11. package/dist/alert/alert.js.map +1 -0
  12. package/dist/alert/index.d.ts +1 -0
  13. package/dist/alert/index.js +2 -0
  14. package/dist/alert/index.js.map +1 -0
  15. package/dist/autocomplete/autocomplete.d.ts +15 -0
  16. package/dist/autocomplete/autocomplete.js +117 -0
  17. package/dist/autocomplete/autocomplete.js.map +1 -0
  18. package/dist/autocomplete/index.d.ts +1 -0
  19. package/dist/autocomplete/index.js +2 -0
  20. package/dist/autocomplete/index.js.map +1 -0
  21. package/dist/avatar/avatar.d.ts +22 -0
  22. package/dist/avatar/avatar.js +89 -0
  23. package/dist/avatar/avatar.js.map +1 -0
  24. package/dist/avatar/index.d.ts +1 -0
  25. package/dist/avatar/index.js +2 -0
  26. package/dist/avatar/index.js.map +1 -0
  27. package/dist/avatar-group/avatar-group.d.ts +29 -0
  28. package/dist/avatar-group/avatar-group.js +83 -0
  29. package/dist/avatar-group/avatar-group.js.map +1 -0
  30. package/dist/avatar-group/index.d.ts +1 -0
  31. package/dist/avatar-group/index.js +2 -0
  32. package/dist/avatar-group/index.js.map +1 -0
  33. package/dist/badge/badge.d.ts +15 -0
  34. package/dist/badge/badge.js +27 -0
  35. package/dist/badge/badge.js.map +1 -0
  36. package/dist/badge/index.d.ts +1 -0
  37. package/dist/badge/index.js +2 -0
  38. package/dist/badge/index.js.map +1 -0
  39. package/dist/bottom-sheet/bottom-sheet.d.ts +34 -0
  40. package/dist/bottom-sheet/bottom-sheet.js +160 -0
  41. package/dist/bottom-sheet/bottom-sheet.js.map +1 -0
  42. package/dist/bottom-sheet/index.d.ts +1 -0
  43. package/dist/bottom-sheet/index.js +2 -0
  44. package/dist/bottom-sheet/index.js.map +1 -0
  45. package/dist/button/button.d.ts +32 -0
  46. package/dist/button/button.js +114 -0
  47. package/dist/button/button.js.map +1 -0
  48. package/dist/button/index.d.ts +1 -0
  49. package/dist/button/index.js +2 -0
  50. package/dist/button/index.js.map +1 -0
  51. package/dist/button-group/button-group.d.ts +25 -0
  52. package/dist/button-group/button-group.js +121 -0
  53. package/dist/button-group/button-group.js.map +1 -0
  54. package/dist/button-group/index.d.ts +1 -0
  55. package/dist/button-group/index.js +2 -0
  56. package/dist/button-group/index.js.map +1 -0
  57. package/dist/calendar/calendar.d.ts +76 -0
  58. package/dist/calendar/calendar.js +612 -0
  59. package/dist/calendar/calendar.js.map +1 -0
  60. package/dist/calendar/index.d.ts +1 -0
  61. package/dist/calendar/index.js +2 -0
  62. package/dist/calendar/index.js.map +1 -0
  63. package/dist/card/card-slots.d.ts +11 -0
  64. package/dist/card/card-slots.js +21 -0
  65. package/dist/card/card-slots.js.map +1 -0
  66. package/dist/card/card.d.ts +10 -0
  67. package/dist/card/card.js +47 -0
  68. package/dist/card/card.js.map +1 -0
  69. package/dist/card/index.d.ts +2 -0
  70. package/dist/card/index.js +3 -0
  71. package/dist/card/index.js.map +1 -0
  72. package/dist/carousel/carousel.d.ts +54 -0
  73. package/dist/carousel/carousel.js +238 -0
  74. package/dist/carousel/carousel.js.map +1 -0
  75. package/dist/carousel/index.d.ts +1 -0
  76. package/dist/carousel/index.js +2 -0
  77. package/dist/carousel/index.js.map +1 -0
  78. package/dist/cascade-select/cascade-select.d.ts +25 -0
  79. package/dist/cascade-select/cascade-select.js +151 -0
  80. package/dist/cascade-select/cascade-select.js.map +1 -0
  81. package/dist/cascade-select/index.d.ts +1 -0
  82. package/dist/cascade-select/index.js +2 -0
  83. package/dist/cascade-select/index.js.map +1 -0
  84. package/dist/checkbox/checkbox.d.ts +23 -0
  85. package/dist/checkbox/checkbox.js +107 -0
  86. package/dist/checkbox/checkbox.js.map +1 -0
  87. package/dist/checkbox/index.d.ts +1 -0
  88. package/dist/checkbox/index.js +2 -0
  89. package/dist/checkbox/index.js.map +1 -0
  90. package/dist/chip/chip.d.ts +24 -0
  91. package/dist/chip/chip.js +86 -0
  92. package/dist/chip/chip.js.map +1 -0
  93. package/dist/chip/index.d.ts +1 -0
  94. package/dist/chip/index.js +2 -0
  95. package/dist/chip/index.js.map +1 -0
  96. package/dist/confirm-dialog/confirm-dialog.d.ts +21 -0
  97. package/dist/confirm-dialog/confirm-dialog.js +93 -0
  98. package/dist/confirm-dialog/confirm-dialog.js.map +1 -0
  99. package/dist/confirm-dialog/index.d.ts +1 -0
  100. package/dist/confirm-dialog/index.js +2 -0
  101. package/dist/confirm-dialog/index.js.map +1 -0
  102. package/dist/context-menu/context-menu.d.ts +21 -0
  103. package/dist/context-menu/context-menu.js +105 -0
  104. package/dist/context-menu/context-menu.js.map +1 -0
  105. package/dist/context-menu/index.d.ts +1 -0
  106. package/dist/context-menu/index.js +2 -0
  107. package/dist/context-menu/index.js.map +1 -0
  108. package/dist/data-view/data-view-row.d.ts +31 -0
  109. package/dist/data-view/data-view-row.js +108 -0
  110. package/dist/data-view/data-view-row.js.map +1 -0
  111. package/dist/data-view/data-view-templates.d.ts +15 -0
  112. package/dist/data-view/data-view-templates.js +14 -0
  113. package/dist/data-view/data-view-templates.js.map +1 -0
  114. package/dist/data-view/data-view.d.ts +33 -0
  115. package/dist/data-view/data-view.js +178 -0
  116. package/dist/data-view/data-view.js.map +1 -0
  117. package/dist/data-view/index.d.ts +2 -0
  118. package/dist/data-view/index.js +3 -0
  119. package/dist/data-view/index.js.map +1 -0
  120. package/dist/date-input/date-input.d.ts +21 -0
  121. package/dist/date-input/date-input.js +150 -0
  122. package/dist/date-input/date-input.js.map +1 -0
  123. package/dist/date-input/index.d.ts +1 -0
  124. package/dist/date-input/index.js +2 -0
  125. package/dist/date-input/index.js.map +1 -0
  126. package/dist/divider/divider.d.ts +6 -0
  127. package/dist/divider/divider.js +14 -0
  128. package/dist/divider/divider.js.map +1 -0
  129. package/dist/divider/index.d.ts +1 -0
  130. package/dist/divider/index.js +2 -0
  131. package/dist/divider/index.js.map +1 -0
  132. package/dist/empty-state/empty-state.d.ts +9 -0
  133. package/dist/empty-state/empty-state.js +34 -0
  134. package/dist/empty-state/empty-state.js.map +1 -0
  135. package/dist/empty-state/index.d.ts +1 -0
  136. package/dist/empty-state/index.js +2 -0
  137. package/dist/empty-state/index.js.map +1 -0
  138. package/dist/filter-bar/filter-bar.d.ts +21 -0
  139. package/dist/filter-bar/filter-bar.js +121 -0
  140. package/dist/filter-bar/filter-bar.js.map +1 -0
  141. package/dist/filter-bar/index.d.ts +1 -0
  142. package/dist/filter-bar/index.js +2 -0
  143. package/dist/filter-bar/index.js.map +1 -0
  144. package/dist/form-field/form-field.d.ts +12 -0
  145. package/dist/form-field/form-field.js +39 -0
  146. package/dist/form-field/form-field.js.map +1 -0
  147. package/dist/form-field/index.d.ts +1 -0
  148. package/dist/form-field/index.js +2 -0
  149. package/dist/form-field/index.js.map +1 -0
  150. package/dist/foundation/accordion-indicator.d.ts +16 -0
  151. package/dist/foundation/accordion-indicator.js +36 -0
  152. package/dist/foundation/accordion-indicator.js.map +1 -0
  153. package/dist/foundation/anchored-layout.d.ts +23 -0
  154. package/dist/foundation/anchored-layout.js +23 -0
  155. package/dist/foundation/anchored-layout.js.map +1 -0
  156. package/dist/foundation/anchored-overlay.d.ts +41 -0
  157. package/dist/foundation/anchored-overlay.js +134 -0
  158. package/dist/foundation/anchored-overlay.js.map +1 -0
  159. package/dist/foundation/calendar.d.ts +8 -0
  160. package/dist/foundation/calendar.js +34 -0
  161. package/dist/foundation/calendar.js.map +1 -0
  162. package/dist/foundation/collapse.d.ts +22 -0
  163. package/dist/foundation/collapse.js +70 -0
  164. package/dist/foundation/collapse.js.map +1 -0
  165. package/dist/foundation/control-label.d.ts +2 -0
  166. package/dist/foundation/control-label.js +6 -0
  167. package/dist/foundation/control-label.js.map +1 -0
  168. package/dist/foundation/file-picker.d.ts +22 -0
  169. package/dist/foundation/file-picker.js +23 -0
  170. package/dist/foundation/file-picker.js.map +1 -0
  171. package/dist/foundation/haptics.d.ts +30 -0
  172. package/dist/foundation/haptics.js +53 -0
  173. package/dist/foundation/haptics.js.map +1 -0
  174. package/dist/foundation/icons.d.ts +14 -0
  175. package/dist/foundation/icons.js +16 -0
  176. package/dist/foundation/icons.js.map +1 -0
  177. package/dist/foundation/index.d.ts +44 -0
  178. package/dist/foundation/index.js +52 -0
  179. package/dist/foundation/index.js.map +1 -0
  180. package/dist/foundation/mobile.d.ts +37 -0
  181. package/dist/foundation/mobile.js +59 -0
  182. package/dist/foundation/mobile.js.map +1 -0
  183. package/dist/foundation/motion.d.ts +22 -0
  184. package/dist/foundation/motion.js +119 -0
  185. package/dist/foundation/motion.js.map +1 -0
  186. package/dist/foundation/native-pressable.d.ts +14 -0
  187. package/dist/foundation/native-pressable.js +44 -0
  188. package/dist/foundation/native-pressable.js.map +1 -0
  189. package/dist/foundation/native-text-input.d.ts +20 -0
  190. package/dist/foundation/native-text-input.js +96 -0
  191. package/dist/foundation/native-text-input.js.map +1 -0
  192. package/dist/foundation/native-text-snapshot.d.ts +3 -0
  193. package/dist/foundation/native-text-snapshot.js +19 -0
  194. package/dist/foundation/native-text-snapshot.js.map +1 -0
  195. package/dist/foundation/native-text-sync.d.ts +8 -0
  196. package/dist/foundation/native-text-sync.js +41 -0
  197. package/dist/foundation/native-text-sync.js.map +1 -0
  198. package/dist/foundation/text-control.d.ts +20 -0
  199. package/dist/foundation/text-control.js +41 -0
  200. package/dist/foundation/text-control.js.map +1 -0
  201. package/dist/foundation/tone.d.ts +10 -0
  202. package/dist/foundation/tone.js +52 -0
  203. package/dist/foundation/tone.js.map +1 -0
  204. package/dist/foundation/tree.d.ts +12 -0
  205. package/dist/foundation/tree.js +39 -0
  206. package/dist/foundation/tree.js.map +1 -0
  207. package/dist/gallery/gallery-templates.d.ts +24 -0
  208. package/dist/gallery/gallery-templates.js +25 -0
  209. package/dist/gallery/gallery-templates.js.map +1 -0
  210. package/dist/gallery/gallery.d.ts +74 -0
  211. package/dist/gallery/gallery.js +208 -0
  212. package/dist/gallery/gallery.js.map +1 -0
  213. package/dist/gallery/index.d.ts +2 -0
  214. package/dist/gallery/index.js +3 -0
  215. package/dist/gallery/index.js.map +1 -0
  216. package/dist/haptics/index.d.ts +12 -0
  217. package/dist/haptics/index.js +36 -0
  218. package/dist/haptics/index.js.map +1 -0
  219. package/dist/icon-button/icon-button.d.ts +27 -0
  220. package/dist/icon-button/icon-button.js +88 -0
  221. package/dist/icon-button/icon-button.js.map +1 -0
  222. package/dist/icon-button/index.d.ts +1 -0
  223. package/dist/icon-button/index.js +2 -0
  224. package/dist/icon-button/index.js.map +1 -0
  225. package/dist/image-viewer/image-viewer.d.ts +134 -0
  226. package/dist/image-viewer/image-viewer.js +380 -0
  227. package/dist/image-viewer/image-viewer.js.map +1 -0
  228. package/dist/image-viewer/index.d.ts +1 -0
  229. package/dist/image-viewer/index.js +2 -0
  230. package/dist/image-viewer/index.js.map +1 -0
  231. package/dist/index.d.ts +67 -0
  232. package/dist/index.js +67 -0
  233. package/dist/index.js.map +1 -0
  234. package/dist/inline-editor/index.d.ts +1 -0
  235. package/dist/inline-editor/index.js +2 -0
  236. package/dist/inline-editor/index.js.map +1 -0
  237. package/dist/inline-editor/inline-editor.d.ts +17 -0
  238. package/dist/inline-editor/inline-editor.js +144 -0
  239. package/dist/inline-editor/inline-editor.js.map +1 -0
  240. package/dist/input/index.d.ts +1 -0
  241. package/dist/input/index.js +2 -0
  242. package/dist/input/index.js.map +1 -0
  243. package/dist/input/input.d.ts +9 -0
  244. package/dist/input/input.js +87 -0
  245. package/dist/input/input.js.map +1 -0
  246. package/dist/input-mask/index.d.ts +1 -0
  247. package/dist/input-mask/index.js +2 -0
  248. package/dist/input-mask/index.js.map +1 -0
  249. package/dist/input-mask/input-mask.d.ts +17 -0
  250. package/dist/input-mask/input-mask.js +112 -0
  251. package/dist/input-mask/input-mask.js.map +1 -0
  252. package/dist/input-otp/index.d.ts +1 -0
  253. package/dist/input-otp/index.js +2 -0
  254. package/dist/input-otp/index.js.map +1 -0
  255. package/dist/input-otp/input-otp.d.ts +18 -0
  256. package/dist/input-otp/input-otp.js +169 -0
  257. package/dist/input-otp/input-otp.js.map +1 -0
  258. package/dist/input-tags/index.d.ts +1 -0
  259. package/dist/input-tags/index.js +2 -0
  260. package/dist/input-tags/index.js.map +1 -0
  261. package/dist/input-tags/input-tags.d.ts +21 -0
  262. package/dist/input-tags/input-tags.js +150 -0
  263. package/dist/input-tags/input-tags.js.map +1 -0
  264. package/dist/listbox/index.d.ts +2 -0
  265. package/dist/listbox/index.js +3 -0
  266. package/dist/listbox/index.js.map +1 -0
  267. package/dist/listbox/listbox-templates.d.ts +17 -0
  268. package/dist/listbox/listbox-templates.js +14 -0
  269. package/dist/listbox/listbox-templates.js.map +1 -0
  270. package/dist/listbox/listbox.d.ts +24 -0
  271. package/dist/listbox/listbox.js +136 -0
  272. package/dist/listbox/listbox.js.map +1 -0
  273. package/dist/menu/index.d.ts +1 -0
  274. package/dist/menu/index.js +2 -0
  275. package/dist/menu/index.js.map +1 -0
  276. package/dist/menu/menu.d.ts +19 -0
  277. package/dist/menu/menu.js +95 -0
  278. package/dist/menu/menu.js.map +1 -0
  279. package/dist/meter-group/index.d.ts +1 -0
  280. package/dist/meter-group/index.js +2 -0
  281. package/dist/meter-group/index.js.map +1 -0
  282. package/dist/meter-group/meter-group.d.ts +23 -0
  283. package/dist/meter-group/meter-group.js +68 -0
  284. package/dist/meter-group/meter-group.js.map +1 -0
  285. package/dist/modal/index.d.ts +2 -0
  286. package/dist/modal/index.js +3 -0
  287. package/dist/modal/index.js.map +1 -0
  288. package/dist/modal/modal-templates.d.ts +14 -0
  289. package/dist/modal/modal-templates.js +23 -0
  290. package/dist/modal/modal-templates.js.map +1 -0
  291. package/dist/modal/modal.d.ts +38 -0
  292. package/dist/modal/modal.js +169 -0
  293. package/dist/modal/modal.js.map +1 -0
  294. package/dist/nav/index.d.ts +1 -0
  295. package/dist/nav/index.js +2 -0
  296. package/dist/nav/index.js.map +1 -0
  297. package/dist/nav/nav.d.ts +15 -0
  298. package/dist/nav/nav.js +84 -0
  299. package/dist/nav/nav.js.map +1 -0
  300. package/dist/notification-center/index.d.ts +1 -0
  301. package/dist/notification-center/index.js +2 -0
  302. package/dist/notification-center/index.js.map +1 -0
  303. package/dist/notification-center/notification-center.d.ts +18 -0
  304. package/dist/notification-center/notification-center.js +104 -0
  305. package/dist/notification-center/notification-center.js.map +1 -0
  306. package/dist/number-input/index.d.ts +1 -0
  307. package/dist/number-input/index.js +2 -0
  308. package/dist/number-input/index.js.map +1 -0
  309. package/dist/number-input/number-input.d.ts +23 -0
  310. package/dist/number-input/number-input.js +143 -0
  311. package/dist/number-input/number-input.js.map +1 -0
  312. package/dist/panel/index.d.ts +2 -0
  313. package/dist/panel/index.js +3 -0
  314. package/dist/panel/index.js.map +1 -0
  315. package/dist/panel/panel-slots.d.ts +11 -0
  316. package/dist/panel/panel-slots.js +21 -0
  317. package/dist/panel/panel-slots.js.map +1 -0
  318. package/dist/panel/panel.d.ts +11 -0
  319. package/dist/panel/panel.js +60 -0
  320. package/dist/panel/panel.js.map +1 -0
  321. package/dist/password/index.d.ts +1 -0
  322. package/dist/password/index.js +2 -0
  323. package/dist/password/index.js.map +1 -0
  324. package/dist/password/password.d.ts +12 -0
  325. package/dist/password/password.js +111 -0
  326. package/dist/password/password.js.map +1 -0
  327. package/dist/pick-list/index.d.ts +1 -0
  328. package/dist/pick-list/index.js +2 -0
  329. package/dist/pick-list/index.js.map +1 -0
  330. package/dist/pick-list/pick-list.d.ts +32 -0
  331. package/dist/pick-list/pick-list.js +215 -0
  332. package/dist/pick-list/pick-list.js.map +1 -0
  333. package/dist/popover/index.d.ts +1 -0
  334. package/dist/popover/index.js +2 -0
  335. package/dist/popover/index.js.map +1 -0
  336. package/dist/popover/popover.d.ts +15 -0
  337. package/dist/popover/popover.js +55 -0
  338. package/dist/popover/popover.js.map +1 -0
  339. package/dist/progress-bar/index.d.ts +1 -0
  340. package/dist/progress-bar/index.js +2 -0
  341. package/dist/progress-bar/index.js.map +1 -0
  342. package/dist/progress-bar/progress-bar.d.ts +13 -0
  343. package/dist/progress-bar/progress-bar.js +50 -0
  344. package/dist/progress-bar/progress-bar.js.map +1 -0
  345. package/dist/radio/index.d.ts +1 -0
  346. package/dist/radio/index.js +2 -0
  347. package/dist/radio/index.js.map +1 -0
  348. package/dist/radio/radio.d.ts +19 -0
  349. package/dist/radio/radio.js +109 -0
  350. package/dist/radio/radio.js.map +1 -0
  351. package/dist/rating/index.d.ts +1 -0
  352. package/dist/rating/index.js +2 -0
  353. package/dist/rating/index.js.map +1 -0
  354. package/dist/rating/rating.d.ts +17 -0
  355. package/dist/rating/rating.js +121 -0
  356. package/dist/rating/rating.js.map +1 -0
  357. package/dist/select/index.d.ts +2 -0
  358. package/dist/select/index.js +3 -0
  359. package/dist/select/index.js.map +1 -0
  360. package/dist/select/select-templates.d.ts +24 -0
  361. package/dist/select/select-templates.js +23 -0
  362. package/dist/select/select-templates.js.map +1 -0
  363. package/dist/select/select.d.ts +33 -0
  364. package/dist/select/select.js +193 -0
  365. package/dist/select/select.js.map +1 -0
  366. package/dist/sidebar/index.d.ts +1 -0
  367. package/dist/sidebar/index.js +2 -0
  368. package/dist/sidebar/index.js.map +1 -0
  369. package/dist/sidebar/sidebar.d.ts +34 -0
  370. package/dist/sidebar/sidebar.js +127 -0
  371. package/dist/sidebar/sidebar.js.map +1 -0
  372. package/dist/skeleton/index.d.ts +1 -0
  373. package/dist/skeleton/index.js +2 -0
  374. package/dist/skeleton/index.js.map +1 -0
  375. package/dist/skeleton/skeleton.d.ts +32 -0
  376. package/dist/skeleton/skeleton.js +121 -0
  377. package/dist/skeleton/skeleton.js.map +1 -0
  378. package/dist/slider/index.d.ts +1 -0
  379. package/dist/slider/index.js +2 -0
  380. package/dist/slider/index.js.map +1 -0
  381. package/dist/slider/slider.d.ts +37 -0
  382. package/dist/slider/slider.js +186 -0
  383. package/dist/slider/slider.js.map +1 -0
  384. package/dist/speed-dial/index.d.ts +1 -0
  385. package/dist/speed-dial/index.js +2 -0
  386. package/dist/speed-dial/index.js.map +1 -0
  387. package/dist/speed-dial/speed-dial.d.ts +31 -0
  388. package/dist/speed-dial/speed-dial.js +138 -0
  389. package/dist/speed-dial/speed-dial.js.map +1 -0
  390. package/dist/spinner/index.d.ts +1 -0
  391. package/dist/spinner/index.js +2 -0
  392. package/dist/spinner/index.js.map +1 -0
  393. package/dist/spinner/spinner.d.ts +13 -0
  394. package/dist/spinner/spinner.js +57 -0
  395. package/dist/spinner/spinner.js.map +1 -0
  396. package/dist/stats-card/index.d.ts +1 -0
  397. package/dist/stats-card/index.js +2 -0
  398. package/dist/stats-card/index.js.map +1 -0
  399. package/dist/stats-card/stats-card.d.ts +19 -0
  400. package/dist/stats-card/stats-card.js +70 -0
  401. package/dist/stats-card/stats-card.js.map +1 -0
  402. package/dist/stepper/index.d.ts +1 -0
  403. package/dist/stepper/index.js +2 -0
  404. package/dist/stepper/index.js.map +1 -0
  405. package/dist/stepper/stepper.d.ts +21 -0
  406. package/dist/stepper/stepper.js +134 -0
  407. package/dist/stepper/stepper.js.map +1 -0
  408. package/dist/switch/index.d.ts +1 -0
  409. package/dist/switch/index.js +2 -0
  410. package/dist/switch/index.js.map +1 -0
  411. package/dist/switch/switch.d.ts +27 -0
  412. package/dist/switch/switch.js +106 -0
  413. package/dist/switch/switch.js.map +1 -0
  414. package/dist/tabs/index.d.ts +1 -0
  415. package/dist/tabs/index.js +2 -0
  416. package/dist/tabs/index.js.map +1 -0
  417. package/dist/tabs/tabs.d.ts +25 -0
  418. package/dist/tabs/tabs.js +112 -0
  419. package/dist/tabs/tabs.js.map +1 -0
  420. package/dist/textarea/index.d.ts +1 -0
  421. package/dist/textarea/index.js +2 -0
  422. package/dist/textarea/index.js.map +1 -0
  423. package/dist/textarea/textarea.d.ts +8 -0
  424. package/dist/textarea/textarea.js +87 -0
  425. package/dist/textarea/textarea.js.map +1 -0
  426. package/dist/theme/index.d.ts +1 -0
  427. package/dist/theme/index.js +2 -0
  428. package/dist/theme/index.js.map +1 -0
  429. package/dist/theme/theme.d.ts +16 -0
  430. package/dist/theme/theme.js +146 -0
  431. package/dist/theme/theme.js.map +1 -0
  432. package/dist/timeline/index.d.ts +1 -0
  433. package/dist/timeline/index.js +2 -0
  434. package/dist/timeline/index.js.map +1 -0
  435. package/dist/timeline/timeline.d.ts +16 -0
  436. package/dist/timeline/timeline.js +66 -0
  437. package/dist/timeline/timeline.js.map +1 -0
  438. package/dist/toast/index.d.ts +1 -0
  439. package/dist/toast/index.js +2 -0
  440. package/dist/toast/index.js.map +1 -0
  441. package/dist/toast/toast.d.ts +35 -0
  442. package/dist/toast/toast.js +146 -0
  443. package/dist/toast/toast.js.map +1 -0
  444. package/dist/toggle-button-group/index.d.ts +1 -0
  445. package/dist/toggle-button-group/index.js +2 -0
  446. package/dist/toggle-button-group/index.js.map +1 -0
  447. package/dist/toggle-button-group/toggle-button-group.d.ts +27 -0
  448. package/dist/toggle-button-group/toggle-button-group.js +145 -0
  449. package/dist/toggle-button-group/toggle-button-group.js.map +1 -0
  450. package/dist/toolbar/index.d.ts +1 -0
  451. package/dist/toolbar/index.js +2 -0
  452. package/dist/toolbar/index.js.map +1 -0
  453. package/dist/toolbar/toolbar.d.ts +18 -0
  454. package/dist/toolbar/toolbar.js +84 -0
  455. package/dist/toolbar/toolbar.js.map +1 -0
  456. package/dist/tree/index.d.ts +1 -0
  457. package/dist/tree/index.js +2 -0
  458. package/dist/tree/index.js.map +1 -0
  459. package/dist/tree/tree.d.ts +26 -0
  460. package/dist/tree/tree.js +167 -0
  461. package/dist/tree/tree.js.map +1 -0
  462. package/dist/tree-select/index.d.ts +1 -0
  463. package/dist/tree-select/index.js +2 -0
  464. package/dist/tree-select/index.js.map +1 -0
  465. package/dist/tree-select/tree-select.d.ts +20 -0
  466. package/dist/tree-select/tree-select.js +112 -0
  467. package/dist/tree-select/tree-select.js.map +1 -0
  468. package/dist/uploader/index.d.ts +2 -0
  469. package/dist/uploader/index.js +3 -0
  470. package/dist/uploader/index.js.map +1 -0
  471. package/dist/uploader/uploader.d.ts +37 -0
  472. package/dist/uploader/uploader.js +280 -0
  473. package/dist/uploader/uploader.js.map +1 -0
  474. package/dist/virtual-list/index.d.ts +2 -0
  475. package/dist/virtual-list/index.js +3 -0
  476. package/dist/virtual-list/index.js.map +1 -0
  477. package/dist/virtual-list/virtual-list-templates.d.ts +16 -0
  478. package/dist/virtual-list/virtual-list-templates.js +14 -0
  479. package/dist/virtual-list/virtual-list-templates.js.map +1 -0
  480. package/dist/virtual-list/virtual-list.d.ts +20 -0
  481. package/dist/virtual-list/virtual-list.js +110 -0
  482. package/dist/virtual-list/virtual-list.js.map +1 -0
  483. package/package.json +344 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile.js","sourceRoot":"","sources":["../../src/foundation/mobile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;;AAepD,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC;IAChD,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnD,CAAC;AACD,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IAC3D,OAAO,IAAI,CAAC,GAAG,CA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pB,CAAC;IACH,CAAC;uGAtBmB,cAAc;2FAAd,cAAc;;2FAAd,cAAc;kBADnC,SAAS","sourcesContent":["import {\n Directive,\n booleanAttribute,\n computed,\n input,\n model,\n output,\n} from '@angular/core';\nimport { controlLabelId } from './control-label.js';\nexport interface NeuOption {\n readonly id: string;\n readonly label: string;\n readonly description?: string;\n readonly disabled?: boolean;\n}\nexport interface NeuTreeNode extends NeuOption {\n readonly children?: readonly NeuTreeNode[];\n}\nexport interface NeuImageItem {\n readonly id: string;\n readonly uri: string;\n readonly label: string;\n}\nexport function finite(value: number, fallback = 0): number {\n return Number.isFinite(value) ? value : fallback;\n}\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(finite(value, min), min), max);\n}\nexport function bounded(\n value: number,\n min: number,\n max: number,\n step = 1,\n): number {\n const lo = finite(min),\n hi = Math.max(lo, finite(max, lo)),\n s = Math.max(Number.EPSILON, Math.abs(finite(step, 1)));\n const n = lo + Math.round((finite(value, lo) - lo) / s) * s;\n return clamp(Number(n.toFixed(10)), lo, hi);\n}\nexport function uniqueOptions(\n options: readonly NeuOption[],\n): readonly NeuOption[] {\n const seen = new Set<string>();\n return options.filter((x) => {\n if (seen.has(x.id)) return false;\n seen.add(x.id);\n return true;\n });\n}\n@Directive()\nexport abstract class NeuTextControl {\n protected readonly labelNativeId = controlLabelId();\n readonly value = model('');\n readonly label = input.required<string>();\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly hint = input('');\n readonly required = input(false, { transform: booleanAttribute });\n readonly requiredLabel = input('Required');\n readonly error = input('');\n readonly touch = output<void>();\n protected readonly fieldHint = computed(() => [\n this.required() ? this.requiredLabel() : '',\n this.invalid() && this.error() ? this.error() : this.hint(),\n ].filter(Boolean).join('. ') || undefined);\n protected accept(value: string): void {\n if (!this.disabled() && !this.readonly()) {\n this.value.set(value);\n this.touch.emit();\n }\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { type Signal } from '@angular/core';
2
+ import { Animated } from '@ng-native/components/animations';
3
+ export declare function neuMotionDuration(configured: number, entering: boolean): number;
4
+ /** Keep an outgoing native view alive until its closing animation has completed. */
5
+ export declare function neuPresence(open: Signal<boolean>, nativeDriver?: boolean, animateInitially?: boolean): {
6
+ visible: import("@angular/core").WritableSignal<boolean>;
7
+ progress: Animated.Value;
8
+ };
9
+ /** Keep the settled layer underneath the next one until its pixels are ready. */
10
+ export declare function neuCrossfade<T>(current: Signal<T | undefined>, enabled: Signal<boolean>, same: (a: T, b: T) => boolean, waitForLoad?: boolean): {
11
+ outgoing: import("@angular/core").WritableSignal<T | undefined>;
12
+ loaded: (item: T) => void;
13
+ incomingStyle: {
14
+ opacity: Animated.Value;
15
+ };
16
+ outgoingStyle: {
17
+ opacity: Animated.AnimatedInterpolation<string | number>;
18
+ };
19
+ settledStyle: {
20
+ opacity: number;
21
+ };
22
+ };
@@ -0,0 +1,119 @@
1
+ import { DestroyRef, ElementRef, effect, inject, signal, untracked } from '@angular/core';
2
+ import { Animated, Easing } from '@ng-native/components/animations';
3
+ import { Accessibility } from '@ng-native/device';
4
+ import { HostEngine } from '@ng-native/fabric';
5
+ import { snapshotNativeText } from "./native-text-snapshot.js";
6
+ import { NEU_THEME, NEU_LIGHT_TOKENS } from './index.js';
7
+ export function neuMotionDuration(configured, entering) {
8
+ const base = Number.isFinite(configured) ? configured : NEU_LIGHT_TOKENS.duration;
9
+ return Math.max(0, Math.min(1000, base * (entering ? 1.8 : 1.5)));
10
+ }
11
+ /** Keep an outgoing native view alive until its closing animation has completed. */
12
+ export function neuPresence(open, nativeDriver = true, animateInitially = true) {
13
+ const accessibility = inject(Accessibility);
14
+ const destroy = inject(DestroyRef);
15
+ const theme = inject(NEU_THEME, { optional: true });
16
+ const host = inject(ElementRef, { optional: true });
17
+ const engine = inject(HostEngine, { optional: true });
18
+ const visible = signal(open(), /* @ts-ignore */
19
+ ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
20
+ const progress = new Animated.Value(!animateInitially && open() ? 1 : 0);
21
+ let initial = true;
22
+ effect(onCleanup => {
23
+ const first = initial;
24
+ initial = false;
25
+ const entering = open(), reduced = accessibility.reduceMotion();
26
+ if (!entering && visible())
27
+ untracked(() => {
28
+ if (!host)
29
+ return;
30
+ // A submit button can clear the engine's focus record before closing the
31
+ // presentation, without delivering the edited field's blur handler.
32
+ snapshotNativeText(host.nativeElement);
33
+ const focused = engine?.focusedField;
34
+ if (!engine || !focused)
35
+ return;
36
+ for (let node = focused; node; node = node.parent) {
37
+ if (node === host.nativeElement) {
38
+ // Android can retain field focus when a presentation disappears.
39
+ // End editing while its native view still exists, even without motion.
40
+ engine.dispatchCommand(focused, 'blur');
41
+ break;
42
+ }
43
+ }
44
+ });
45
+ const configured = theme?.().duration ?? NEU_LIGHT_TOKENS.duration;
46
+ const duration = neuMotionDuration(configured, entering);
47
+ if (entering)
48
+ visible.set(true);
49
+ if ((first && !animateInitially) || reduced || duration === 0 || (!entering && !visible())) {
50
+ progress.setValue(entering ? 1 : 0);
51
+ visible.set(entering);
52
+ return;
53
+ }
54
+ const animation = Animated.timing(progress, {
55
+ toValue: entering ? 1 : 0,
56
+ duration,
57
+ easing: Easing.out(Easing.cubic),
58
+ useNativeDriver: nativeDriver,
59
+ isInteraction: false,
60
+ });
61
+ let active = true;
62
+ animation.start(({ finished }) => {
63
+ if (active && finished && !destroy.destroyed && !open())
64
+ visible.set(false);
65
+ });
66
+ onCleanup(() => { active = false; animation.stop(); });
67
+ });
68
+ destroy.onDestroy(() => progress.stopAnimation());
69
+ return { visible, progress };
70
+ }
71
+ /** Keep the settled layer underneath the next one until its pixels are ready. */
72
+ export function neuCrossfade(current, enabled, same, waitForLoad = false) {
73
+ const accessibility = inject(Accessibility);
74
+ const destroy = inject(DestroyRef);
75
+ const theme = inject(NEU_THEME, { optional: true });
76
+ const outgoing = signal(undefined, /* @ts-ignore */
77
+ ...(ngDevMode ? [{ debugName: "outgoing" }] : /* istanbul ignore next */ []));
78
+ const ready = signal(undefined, /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
80
+ const progress = new Animated.Value(1);
81
+ let previous;
82
+ let wasEnabled = false;
83
+ effect(onCleanup => {
84
+ const item = current(), open = enabled();
85
+ const duration = Math.min(1000, neuMotionDuration(theme?.().duration ?? NEU_LIGHT_TOKENS.duration, true) * 4 / 3);
86
+ const reduced = accessibility.reduceMotion();
87
+ const animate = open && wasEnabled && previous !== undefined && item !== undefined && !same(previous, item) && !reduced && duration > 0;
88
+ outgoing.set(animate ? previous : undefined);
89
+ wasEnabled = open;
90
+ progress.setValue(animate ? 0 : 1);
91
+ if (!animate) {
92
+ previous = item;
93
+ return;
94
+ }
95
+ const loaded = ready();
96
+ if (waitForLoad && (!loaded || !same(loaded, item)))
97
+ return;
98
+ const animation = Animated.timing(progress, {
99
+ toValue: 1, duration, easing: Easing.inOut(Easing.cubic), useNativeDriver: true, isInteraction: false,
100
+ });
101
+ let active = true;
102
+ animation.start(({ finished }) => {
103
+ if (active && finished && !destroy.destroyed) {
104
+ previous = item;
105
+ outgoing.set(undefined);
106
+ }
107
+ });
108
+ onCleanup(() => { active = false; animation.stop(); });
109
+ });
110
+ destroy.onDestroy(() => progress.stopAnimation());
111
+ return {
112
+ outgoing,
113
+ loaded: (item) => ready.set(item),
114
+ incomingStyle: { opacity: progress },
115
+ outgoingStyle: { opacity: progress.interpolate({ inputRange: [0, 1], outputRange: [1, 0] }) },
116
+ settledStyle: { opacity: 1 },
117
+ };
118
+ }
119
+ //# sourceMappingURL=motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/foundation/motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EA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EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAC7F,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import { DestroyRef, ElementRef, effect, inject, signal, untracked, type Signal } from '@angular/core';\nimport { Animated, Easing } from '@ng-native/components/animations';\nimport { Accessibility } from '@ng-native/device';\nimport { HostEngine, type HostNode } from '@ng-native/fabric';\nimport { snapshotNativeText } from './native-text-snapshot.ts';\nimport { NEU_THEME, NEU_LIGHT_TOKENS } from './index.js';\n\nexport function neuMotionDuration(configured: number, entering: boolean): number {\n const base = Number.isFinite(configured) ? configured : NEU_LIGHT_TOKENS.duration;\n return Math.max(0, Math.min(1000, base * (entering ? 1.8 : 1.5)));\n}\n\n/** Keep an outgoing native view alive until its closing animation has completed. */\nexport function neuPresence(open: Signal<boolean>, nativeDriver = true, animateInitially = true) {\n const accessibility = inject(Accessibility);\n const destroy = inject(DestroyRef);\n const theme = inject(NEU_THEME, { optional: true });\n const host = inject<ElementRef<HostNode>>(ElementRef, { optional: true });\n const engine = inject(HostEngine, { optional: true });\n const visible = signal(open());\n const progress = new Animated.Value(!animateInitially && open() ? 1 : 0);\n let initial = true;\n effect(onCleanup => {\n const first = initial;\n initial = false;\n const entering = open(), reduced = accessibility.reduceMotion();\n if (!entering && visible()) untracked(() => {\n if (!host) return;\n // A submit button can clear the engine's focus record before closing the\n // presentation, without delivering the edited field's blur handler.\n snapshotNativeText(host.nativeElement);\n const focused = engine?.focusedField;\n if (!engine || !focused) return;\n for (let node: HostNode | null = focused; node; node = node.parent) {\n if (node === host.nativeElement) {\n // Android can retain field focus when a presentation disappears.\n // End editing while its native view still exists, even without motion.\n engine.dispatchCommand(focused, 'blur');\n break;\n }\n }\n });\n const configured = theme?.().duration ?? NEU_LIGHT_TOKENS.duration;\n const duration = neuMotionDuration(configured, entering);\n if (entering) visible.set(true);\n if ((first && !animateInitially) || reduced || duration === 0 || (!entering && !visible())) {\n progress.setValue(entering ? 1 : 0);\n visible.set(entering);\n return;\n }\n const animation = Animated.timing(progress, {\n toValue: entering ? 1 : 0,\n duration,\n easing: Easing.out(Easing.cubic),\n useNativeDriver: nativeDriver,\n isInteraction: false,\n });\n let active = true;\n animation.start(({ finished }) => {\n if (active && finished && !destroy.destroyed && !open()) visible.set(false);\n });\n onCleanup(() => { active = false; animation.stop(); });\n });\n destroy.onDestroy(() => progress.stopAnimation());\n return { visible, progress };\n}\n\n/** Keep the settled layer underneath the next one until its pixels are ready. */\nexport function neuCrossfade<T>(current: Signal<T | undefined>, enabled: Signal<boolean>, same: (a: T, b: T) => boolean, waitForLoad = false) {\n const accessibility = inject(Accessibility);\n const destroy = inject(DestroyRef);\n const theme = inject(NEU_THEME, { optional: true });\n const outgoing = signal<T | undefined>(undefined);\n const ready = signal<T | undefined>(undefined);\n const progress = new Animated.Value(1);\n let previous: T | undefined;\n let wasEnabled = false;\n effect(onCleanup => {\n const item = current(), open = enabled();\n const duration = Math.min(1000, neuMotionDuration(theme?.().duration ?? NEU_LIGHT_TOKENS.duration, true) * 4 / 3);\n const reduced = accessibility.reduceMotion();\n const animate = open && wasEnabled && previous !== undefined && item !== undefined && !same(previous, item) && !reduced && duration > 0;\n outgoing.set(animate ? previous : undefined);\n wasEnabled = open;\n progress.setValue(animate ? 0 : 1);\n if (!animate) {\n previous = item;\n return;\n }\n const loaded = ready();\n if (waitForLoad && (!loaded || !same(loaded, item!))) return;\n const animation = Animated.timing(progress, {\n toValue: 1, duration, easing: Easing.inOut(Easing.cubic), useNativeDriver: true, isInteraction: false,\n });\n let active = true;\n animation.start(({ finished }) => {\n if (active && finished && !destroy.destroyed) {\n previous = item;\n outgoing.set(undefined);\n }\n });\n onCleanup(() => { active = false; animation.stop(); });\n });\n destroy.onDestroy(() => progress.stopAnimation());\n return {\n outgoing,\n loaded: (item: T) => ready.set(item),\n incomingStyle: { opacity: progress },\n outgoingStyle: { opacity: progress.interpolate({ inputRange: [0, 1], outputRange: [1, 0] }) },\n settledStyle: { opacity: 1 },\n };\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { Pressable } from '@ng-native/components';
2
+ import { type NeuHapticFeedback } from './haptics.js';
3
+ import * as i0 from "@angular/core";
4
+ /** Bridge the iOS accessibility activation event to the normal guarded action. */
5
+ export declare class NeuNativePressable extends Pressable {
6
+ readonly haptic: import("@angular/core").InputSignal<false | NeuHapticFeedback>;
7
+ private readonly haptics;
8
+ private stopHaptics?;
9
+ private stopAccessibilityTap?;
10
+ ngOnInit(): void;
11
+ ngOnDestroy(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NeuNativePressable, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NeuNativePressable, "pressable", ["pressable"], { "haptic": { "alias": "haptic"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
14
+ }
@@ -0,0 +1,44 @@
1
+ import { Directive, inject, input } from '@angular/core';
2
+ import { Pressable } from '@ng-native/components';
3
+ import { declareNativeProps, nativePlatform } from '@ng-native/fabric';
4
+ import { NeuHaptics } from './haptics.js';
5
+ import * as i0 from "@angular/core";
6
+ declareNativeProps('pressable', ['onAccessibilityTap']);
7
+ /** Bridge the iOS accessibility activation event to the normal guarded action. */
8
+ export class NeuNativePressable extends Pressable {
9
+ haptic = input('press', /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "haptic" }] : /* istanbul ignore next */ []));
11
+ haptics = inject(NeuHaptics);
12
+ stopHaptics;
13
+ stopAccessibilityTap;
14
+ ngOnInit() {
15
+ super.ngOnInit();
16
+ this.stopHaptics = this.press.subscribe(() => {
17
+ if (this.claims())
18
+ this.haptics.play(this.haptic());
19
+ });
20
+ if (nativePlatform() !== 'ios')
21
+ return;
22
+ // Fabric's iOS view emits this event only when the native opt-in is present.
23
+ this.engine.setProp(this.node, 'onAccessibilityTap', true);
24
+ this.stopAccessibilityTap = this.engine.setEventListener(this.node, 'topAccessibilityTap', raw => {
25
+ const event = raw;
26
+ if (event.target !== this.node)
27
+ return;
28
+ if (this.claims())
29
+ this.press.emit(event);
30
+ });
31
+ }
32
+ ngOnDestroy() {
33
+ this.stopHaptics?.unsubscribe();
34
+ this.stopAccessibilityTap?.();
35
+ super.ngOnDestroy();
36
+ }
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativePressable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
38
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.2", type: NeuNativePressable, isStandalone: true, selector: "pressable", inputs: { haptic: { classPropertyName: "haptic", publicName: "haptic", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["pressable"], usesInheritance: true, ngImport: i0 });
39
+ }
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativePressable, decorators: [{
41
+ type: Directive,
42
+ args: [{ selector: 'pressable', exportAs: 'pressable' }]
43
+ }], propDecorators: { haptic: [{ type: i0.Input, args: [{ isSignal: true, alias: "haptic", required: false }] }] } });
44
+ //# sourceMappingURL=native-pressable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-pressable.js","sourceRoot":"","sources":["../../src/foundation/native-pressable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAmB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;;AAElE,kBAAkB,CAAC,WAAW,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAExD,kFAAkF;AAElF,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IACt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{ Directive, inject, input, type OutputRefSubscription } from '@angular/core';\nimport { Pressable, type PressEvent } from '@ng-native/components';\nimport { declareNativeProps, nativePlatform } from '@ng-native/fabric';\nimport { NeuHaptics, type NeuHapticFeedback } from './haptics.js';\n\ndeclareNativeProps('pressable', ['onAccessibilityTap']);\n\n/** Bridge the iOS accessibility activation event to the normal guarded action. */\n@Directive({ selector: 'pressable', exportAs: 'pressable' })\nexport class NeuNativePressable extends Pressable {\n readonly haptic = input<NeuHapticFeedback | false>('press');\n private readonly haptics = inject(NeuHaptics);\n private stopHaptics?: OutputRefSubscription;\n private stopAccessibilityTap?: () => void;\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.stopHaptics = this.press.subscribe(() => {\n if (this.claims()) this.haptics.play(this.haptic());\n });\n if (nativePlatform() !== 'ios') return;\n // Fabric's iOS view emits this event only when the native opt-in is present.\n this.engine.setProp(this.node, 'onAccessibilityTap', true);\n this.stopAccessibilityTap = this.engine.setEventListener(this.node, 'topAccessibilityTap', raw => {\n const event = raw as PressEvent;\n if (event.target !== this.node) return;\n if (this.claims()) this.press.emit(event as PressEvent);\n });\n }\n\n override ngOnDestroy(): void {\n this.stopHaptics?.unsubscribe();\n this.stopAccessibilityTap?.();\n super.ngOnDestroy();\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { TextInput, type TextInputChangePayload } from '@ng-native/components';
2
+ import type { NativeSyntheticEvent } from '@ng-native/fabric';
3
+ import * as i0 from "@angular/core";
4
+ /** Internal text bridge: retain the native editing buffer until explicit reconciliation. */
5
+ export declare class NeuNativeTextInput extends TextInput {
6
+ readonly neuralValue: import("@angular/core").InputSignal<string>;
7
+ readonly neuralValueChange: import("@angular/core").OutputEmitterRef<string>;
8
+ readonly neuralRemeasure: import("@angular/core").InputSignal<boolean>;
9
+ private readonly reportedText;
10
+ private nativeEventCount;
11
+ private hasNativeEdits;
12
+ private nativeTextReleased;
13
+ constructor();
14
+ private snapshotReleasedText;
15
+ protected onFocus(): void;
16
+ setSelection(start: number, end?: number): void;
17
+ protected onNativeChange(event: NativeSyntheticEvent<Partial<TextInputChangePayload>>): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<NeuNativeTextInput, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NeuNativeTextInput, "text-input", never, { "neuralValue": { "alias": "neuralValue"; "required": true; "isSignal": true; }; "neuralRemeasure": { "alias": "neuralRemeasure"; "required": false; "isSignal": true; }; }, { "neuralValueChange": "neuralValueChange"; }, never, never, true, never>;
20
+ }
@@ -0,0 +1,96 @@
1
+ import { DestroyRef, Directive, afterRenderEffect, inject, input, output, signal } from '@angular/core';
2
+ import { TextInput } from '@ng-native/components';
3
+ import { registerNativeTextSnapshot } from "./native-text-snapshot.js";
4
+ import * as i0 from "@angular/core";
5
+ /** Internal text bridge: retain the native editing buffer until explicit reconciliation. */
6
+ export class NeuNativeTextInput extends TextInput {
7
+ neuralValue = input.required(/* @ts-ignore */
8
+ ...(ngDevMode ? [{ debugName: "neuralValue" }] : /* istanbul ignore next */ []));
9
+ neuralValueChange = output();
10
+ // Stable single-line controls can rely on the normal batched props commit.
11
+ // Keep explicit remeasurement by default for content-dependent controls.
12
+ neuralRemeasure = input(true, /* @ts-ignore */
13
+ ...(ngDevMode ? [{ debugName: "neuralRemeasure" }] : /* istanbul ignore next */ []));
14
+ reportedText = signal(null, /* @ts-ignore */
15
+ ...(ngDevMode ? [{ debugName: "reportedText" }] : /* istanbul ignore next */ []));
16
+ nativeEventCount = 0;
17
+ hasNativeEdits = false;
18
+ nativeTextReleased = false;
19
+ constructor() {
20
+ super();
21
+ inject(DestroyRef).onDestroy(registerNativeTextSnapshot(this.node, () => this.snapshotReleasedText()));
22
+ this.touch.subscribe(() => {
23
+ // A presentation can recreate its native text view while retaining this
24
+ // directive. Snapshot the accepted buffer once editing has ended so the
25
+ // new view receives current text rather than an empty or outdated seed.
26
+ // Keep this out of the keystroke path to preserve iOS predictive selection.
27
+ this.snapshotReleasedText();
28
+ });
29
+ afterRenderEffect({
30
+ write: () => {
31
+ const desired = this.neuralValue();
32
+ const reported = this.reportedText();
33
+ if (reported === desired)
34
+ return;
35
+ this.reportedText.set(desired);
36
+ // A focused, initially empty field owns its text. Keep its inherited host
37
+ // binding stable; later app values reach native through the counted command.
38
+ if (!this.nativeTextReleased)
39
+ this.value.set(desired);
40
+ // Untouched fields need only the normal text prop. In particular, a
41
+ // modal may not have mounted its native field yet. Reconcile by command
42
+ // once native has an editing buffer, or focus has released the text prop.
43
+ if (reported !== null && (this.hasNativeEdits || this.nativeTextReleased)) {
44
+ this.eventCount.set(this.nativeEventCount);
45
+ // Use the current native counter and preserve the native selection.
46
+ this.engine.dispatchCommand(this.node, 'setTextAndSelection', [
47
+ this.nativeEventCount, desired, -1, -1,
48
+ ]);
49
+ if (this.neuralRemeasure())
50
+ this.engine.remeasure(this.node);
51
+ }
52
+ },
53
+ });
54
+ }
55
+ snapshotReleasedText() {
56
+ this.nativeTextReleased = false;
57
+ this.eventCount.set(this.nativeEventCount);
58
+ this.value.set(this.neuralValue());
59
+ }
60
+ onFocus() {
61
+ // Clearing an initial nonempty text prop would erase a seeded field on focus.
62
+ if (!this.nativeTextReleased && this.neuralValue() === '') {
63
+ this.nativeTextReleased = true;
64
+ this.engine.setProp(this.node, 'text', undefined);
65
+ }
66
+ super.onFocus();
67
+ }
68
+ setSelection(start, end = start) {
69
+ this.engine.dispatchCommand(this.node, 'setTextAndSelection', [
70
+ this.nativeEventCount, null, start, end,
71
+ ]);
72
+ }
73
+ onNativeChange(event) {
74
+ const text = event.nativeEvent?.text ?? '';
75
+ this.hasNativeEdits = true;
76
+ this.reportedText.set(text);
77
+ // Accepted edits already live in the native field. Keep its programmatic text
78
+ // prop stable: echoing each keystroke can move the iOS predictive-text cursor.
79
+ // The render effect still reconciles rejected, transformed and external values.
80
+ // Track every native counter for commands without committing a counter-only
81
+ // props update on accepted edits. That commit can replay an iOS predictive
82
+ // text snapshot and move the cursor even when the text prop did not change.
83
+ this.nativeEventCount = event.nativeEvent?.eventCount ?? this.nativeEventCount + 1;
84
+ if (this.resolvedEditable() !== false)
85
+ this.neuralValueChange.emit(text);
86
+ // The shared directive retains its guarded ApplicationRef.tick() after this.
87
+ this.changeText.emit(text);
88
+ }
89
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
90
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.2", type: NeuNativeTextInput, isStandalone: true, selector: "text-input", inputs: { neuralValue: { classPropertyName: "neuralValue", publicName: "neuralValue", isSignal: true, isRequired: true, transformFunction: null }, neuralRemeasure: { classPropertyName: "neuralRemeasure", publicName: "neuralRemeasure", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { neuralValueChange: "neuralValueChange" }, usesInheritance: true, ngImport: i0 });
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextInput, decorators: [{
93
+ type: Directive,
94
+ args: [{ selector: 'text-input' }]
95
+ }], ctorParameters: () => [], propDecorators: { neuralValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "neuralValue", required: true }] }], neuralValueChange: [{ type: i0.Output, args: ["neuralValueChange"] }], neuralRemeasure: [{ type: i0.Input, args: [{ isSignal: true, alias: "neuralRemeasure", required: false }] }] } });
96
+ //# sourceMappingURL=native-text-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-text-input.js","sourceRoot":"","sources":["../../src/foundation/native-text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,SAAS,EAA+B,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,0BAA0B,EAA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EAAE,KAAK,EAAE,GAAG;SACxC,CAAC,CAAC;IACL,CAAC;IAEkB,cAAc,CAC/B,KAA4D;QAE5D,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,8EAA8E;QAC9E,+EAA+E;QAC/E,gFAAgF;QAChF,4EAA4E;QAC5E,2EAA2E;QAC3E,4EAA4E;QAC5E,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,WAAW,EAAE,UAAU,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QACnF,IAAI,IAAI,CAAC,gBAAgB,EAAE,KAAK,KAAK;YAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzE,6EAA6E;QAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;uGAlFU,kBAAkB;2FAAlB,kBAAkB;;2FAAlB,kBAAkB;kBAD9B,SAAS;mBAAC,EAAE,QAAQ,EAAE,YAAY,EAAE","sourcesContent":["import { DestroyRef, Directive, afterRenderEffect, inject, input, output, signal } from '@angular/core';\nimport { TextInput, type TextInputChangePayload } from '@ng-native/components';\nimport type { NativeSyntheticEvent } from '@ng-native/fabric';\nimport { registerNativeTextSnapshot } from './native-text-snapshot.ts';\n\n/** Internal text bridge: retain the native editing buffer until explicit reconciliation. */\n@Directive({ selector: 'text-input' })\nexport class NeuNativeTextInput extends TextInput {\n readonly neuralValue = input.required<string>();\n readonly neuralValueChange = output<string>();\n // Stable single-line controls can rely on the normal batched props commit.\n // Keep explicit remeasurement by default for content-dependent controls.\n readonly neuralRemeasure = input(true);\n private readonly reportedText = signal<string | null>(null);\n private nativeEventCount = 0;\n private hasNativeEdits = false;\n private nativeTextReleased = false;\n\n constructor() {\n super();\n inject(DestroyRef).onDestroy(registerNativeTextSnapshot(this.node, () => this.snapshotReleasedText()));\n this.touch.subscribe(() => {\n // A presentation can recreate its native text view while retaining this\n // directive. Snapshot the accepted buffer once editing has ended so the\n // new view receives current text rather than an empty or outdated seed.\n // Keep this out of the keystroke path to preserve iOS predictive selection.\n this.snapshotReleasedText();\n });\n afterRenderEffect({\n write: () => {\n const desired = this.neuralValue();\n const reported = this.reportedText();\n if (reported === desired) return;\n this.reportedText.set(desired);\n // A focused, initially empty field owns its text. Keep its inherited host\n // binding stable; later app values reach native through the counted command.\n if (!this.nativeTextReleased) this.value.set(desired);\n // Untouched fields need only the normal text prop. In particular, a\n // modal may not have mounted its native field yet. Reconcile by command\n // once native has an editing buffer, or focus has released the text prop.\n if (reported !== null && (this.hasNativeEdits || this.nativeTextReleased)) {\n this.eventCount.set(this.nativeEventCount);\n // Use the current native counter and preserve the native selection.\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [\n this.nativeEventCount, desired, -1, -1,\n ]);\n if (this.neuralRemeasure()) this.engine.remeasure(this.node);\n }\n },\n });\n }\n\n private snapshotReleasedText(): void {\n this.nativeTextReleased = false;\n this.eventCount.set(this.nativeEventCount);\n this.value.set(this.neuralValue());\n }\n\n protected override onFocus(): void {\n // Clearing an initial nonempty text prop would erase a seeded field on focus.\n if (!this.nativeTextReleased && this.neuralValue() === '') {\n this.nativeTextReleased = true;\n this.engine.setProp(this.node, 'text', undefined);\n }\n super.onFocus();\n }\n\n override setSelection(start: number, end = start): void {\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [\n this.nativeEventCount, null, start, end,\n ]);\n }\n\n protected override onNativeChange(\n event: NativeSyntheticEvent<Partial<TextInputChangePayload>>,\n ): void {\n const text = event.nativeEvent?.text ?? '';\n this.hasNativeEdits = true;\n this.reportedText.set(text);\n // Accepted edits already live in the native field. Keep its programmatic text\n // prop stable: echoing each keystroke can move the iOS predictive-text cursor.\n // The render effect still reconciles rejected, transformed and external values.\n // Track every native counter for commands without committing a counter-only\n // props update on accepted edits. That commit can replay an iOS predictive\n // text snapshot and move the cursor even when the text prop did not change.\n this.nativeEventCount = event.nativeEvent?.eventCount ?? this.nativeEventCount + 1;\n if (this.resolvedEditable() !== false) this.neuralValueChange.emit(text);\n // The shared directive retains its guarded ApplicationRef.tick() after this.\n this.changeText.emit(text);\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { HostNode } from '@ng-native/fabric';
2
+ export declare function registerNativeTextSnapshot(node: HostNode, snapshot: () => void): () => void;
3
+ export declare function snapshotNativeText(node: HostNode): void;
@@ -0,0 +1,19 @@
1
+ // A projected field can outlive its native presentation. Retain its accepted
2
+ // buffer before that presentation detaches and can no longer deliver blur.
3
+ const snapshots = new WeakMap();
4
+ export function registerNativeTextSnapshot(node, snapshot) {
5
+ snapshots.set(node, snapshot);
6
+ return () => { snapshots.delete(node); };
7
+ }
8
+ export function snapshotNativeText(node) {
9
+ const pending = [node];
10
+ while (pending.length) {
11
+ const current = pending.pop();
12
+ if (!current)
13
+ continue;
14
+ snapshots.get(current)?.();
15
+ for (const child of current.childList)
16
+ pending.push(child);
17
+ }
18
+ }
19
+ //# sourceMappingURL=native-text-snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-text-snapshot.js","sourceRoot":"","sources":["../../src/foundation/native-text-snapshot.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,2EAA2E;AAC3E,MAAM,SAAS,GAAG,IAAI,OAAO,EAAwB,CAAC;AAEtD,MAAM,UAAU,0BAA0B,CAAC,IAAc,EAAE,QAAoB;IAC7E,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9B,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAc;IAC/C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAC3B,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC","sourcesContent":["import type { HostNode } from '@ng-native/fabric';\n\n// A projected field can outlive its native presentation. Retain its accepted\n// buffer before that presentation detaches and can no longer deliver blur.\nconst snapshots = new WeakMap<HostNode, () => void>();\n\nexport function registerNativeTextSnapshot(node: HostNode, snapshot: () => void): () => void {\n snapshots.set(node, snapshot);\n return () => { snapshots.delete(node); };\n}\n\nexport function snapshotNativeText(node: HostNode): void {\n const pending = [node];\n while (pending.length) {\n const current = pending.pop();\n if (!current) continue;\n snapshots.get(current)?.();\n for (const child of current.childList) pending.push(child);\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ /** Internal bridge for the controlled text-input protocol in Angular Native. */
3
+ export declare class NeuNativeTextSyncDirective {
4
+ private readonly synchronization;
5
+ synchronize(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<NeuNativeTextSyncDirective, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NeuNativeTextSyncDirective, "text-input[neuSyncText]", ["neuSyncText"], {}, {}, never, never, true, never>;
8
+ }
@@ -0,0 +1,41 @@
1
+ import { ApplicationRef, Directive, Injectable, inject } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ class NeuNativeTextSynchronization {
4
+ application = inject(ApplicationRef);
5
+ synchronizing = false;
6
+ synchronize() {
7
+ if (this.synchronizing || this.application.destroyed)
8
+ return;
9
+ this.synchronizing = true;
10
+ try {
11
+ // Native changeText follows the text and event-count update. Finish Angular's
12
+ // after-render reconciliation before the OS delivers the next key; a local
13
+ // detectChanges() alone does not run that reconciliation. OnPush still skips
14
+ // clean views. This explicit boundary is limited to native text edits.
15
+ this.application.tick();
16
+ }
17
+ finally {
18
+ this.synchronizing = false;
19
+ }
20
+ }
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextSynchronization, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
22
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextSynchronization, providedIn: 'root' });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextSynchronization, decorators: [{
25
+ type: Injectable,
26
+ args: [{ providedIn: 'root' }]
27
+ }] });
28
+ /** Internal bridge for the controlled text-input protocol in Angular Native. */
29
+ export class NeuNativeTextSyncDirective {
30
+ synchronization = inject(NeuNativeTextSynchronization);
31
+ synchronize() {
32
+ this.synchronization.synchronize();
33
+ }
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextSyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
35
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.2", type: NeuNativeTextSyncDirective, isStandalone: true, selector: "text-input[neuSyncText]", exportAs: ["neuSyncText"], ngImport: i0 });
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuNativeTextSyncDirective, decorators: [{
38
+ type: Directive,
39
+ args: [{ selector: 'text-input[neuSyncText]', exportAs: 'neuSyncText' }]
40
+ }] });
41
+ //# sourceMappingURL=native-text-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-text-sync.js","sourceRoot":"","sources":["../../src/foundation/native-text-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAE9E,MACM,4BAA4B;IACf,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC9C,aAAa,GAAG,KAAK,CAAC;IAE9B,WAAW;QACT,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS;YAAE,OAAO;QAC7D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC;YACH,8EAA8E;YAC9E,2EAA2E;YAC3E,6EAA6E;YAC7E,uEAAuE;YACvE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;uGAhBG,4BAA4B;2GAA5B,4BAA4B,cADR,MAAM;;2FAC1B,4BAA4B;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AAoBlC,gFAAgF;AAEhF,MAAM,OAAO,0BAA0B;IACpB,eAAe,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAExE,WAAW;QACT,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;uGALU,0BAA0B;2FAA1B,0BAA0B;;2FAA1B,0BAA0B;kBADtC,SAAS;mBAAC,EAAE,QAAQ,EAAE,yBAAyB,EAAE,QAAQ,EAAE,aAAa,EAAE","sourcesContent":["import { ApplicationRef, Directive, Injectable, inject } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nclass NeuNativeTextSynchronization {\n private readonly application = inject(ApplicationRef);\n private synchronizing = false;\n\n synchronize(): void {\n if (this.synchronizing || this.application.destroyed) return;\n this.synchronizing = true;\n try {\n // Native changeText follows the text and event-count update. Finish Angular's\n // after-render reconciliation before the OS delivers the next key; a local\n // detectChanges() alone does not run that reconciliation. OnPush still skips\n // clean views. This explicit boundary is limited to native text edits.\n this.application.tick();\n } finally {\n this.synchronizing = false;\n }\n }\n}\n\n/** Internal bridge for the controlled text-input protocol in Angular Native. */\n@Directive({ selector: 'text-input[neuSyncText]', exportAs: 'neuSyncText' })\nexport class NeuNativeTextSyncDirective {\n private readonly synchronization = inject(NeuNativeTextSynchronization);\n\n synchronize(): void {\n this.synchronization.synchronize();\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare abstract class NeuTextControl {
3
+ protected readonly labelNativeId: string;
4
+ readonly value: import("@angular/core").ModelSignal<string>;
5
+ readonly label: import("@angular/core").InputSignal<string>;
6
+ readonly placeholder: import("@angular/core").InputSignal<string>;
7
+ readonly hint: import("@angular/core").InputSignal<string>;
8
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
9
+ readonly requiredLabel: import("@angular/core").InputSignal<string>;
10
+ readonly error: import("@angular/core").InputSignal<string>;
11
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
12
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
13
+ readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
14
+ readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
15
+ readonly maxLength: import("@angular/core").InputSignalWithTransform<number | undefined, number | undefined>;
16
+ readonly touch: import("@angular/core").OutputEmitterRef<void>;
17
+ protected readonly fieldHint: import("@angular/core").Signal<string | undefined>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<NeuTextControl, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NeuTextControl, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "requiredLabel": { "alias": "requiredLabel"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
20
+ }
@@ -0,0 +1,41 @@
1
+ import { Directive, booleanAttribute, computed, input, model, output, } from '@angular/core';
2
+ import { controlLabelId } from './control-label.js';
3
+ import * as i0 from "@angular/core";
4
+ function textLengthLimit(value) {
5
+ return value === undefined || !Number.isFinite(value)
6
+ ? undefined
7
+ : Math.max(0, Math.trunc(value));
8
+ }
9
+ export class NeuTextControl {
10
+ labelNativeId = controlLabelId();
11
+ value = model('', /* @ts-ignore */
12
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
13
+ label = input.required(/* @ts-ignore */
14
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
15
+ placeholder = input('', /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
17
+ hint = input('', /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
19
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
20
+ requiredLabel = input('Required', /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "requiredLabel" }] : /* istanbul ignore next */ []));
22
+ error = input('', /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
24
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
25
+ readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
26
+ invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
27
+ touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
28
+ maxLength = input(undefined, { ...(ngDevMode ? { debugName: "maxLength" } : /* istanbul ignore next */ {}), transform: textLengthLimit });
29
+ touch = output();
30
+ fieldHint = computed(() => [
31
+ this.required() ? this.requiredLabel() : '',
32
+ this.invalid() && this.error() ? this.error() : this.hint(),
33
+ ].filter(Boolean).join('. ') || undefined, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "fieldHint" }] : /* istanbul ignore next */ []));
35
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTextControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
36
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.2", type: NeuTextControl, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, requiredLabel: { classPropertyName: "requiredLabel", publicName: "requiredLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, ngImport: i0 });
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTextControl, decorators: [{
39
+ type: Directive
40
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], requiredLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredLabel", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] } });
41
+ //# sourceMappingURL=text-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-control.js","sourceRoot":"","sources":["../../src/foundation/text-control.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;;AAEpD,SAAS,eAAe,CAAC,KAAyB;IAChD,OA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EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;KAC5D,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS;kFAAC,CAAC;uGAvBvB,cAAc;2FAAd,cAAc;;2FAAd,cAAc;kBADnC,SAAS","sourcesContent":["import {\n Directive,\n booleanAttribute,\n computed,\n input,\n model,\n output,\n} from '@angular/core';\nimport { controlLabelId } from './control-label.js';\n\nfunction textLengthLimit(value: number | undefined): number | undefined {\n return value === undefined || !Number.isFinite(value)\n ? undefined\n : Math.max(0, Math.trunc(value));\n}\n\n@Directive()\nexport abstract class NeuTextControl {\n protected readonly labelNativeId = controlLabelId();\n readonly value = model('');\n readonly label = input.required<string>();\n readonly placeholder = input('');\n readonly hint = input('');\n readonly required = input(false, { transform: booleanAttribute });\n readonly requiredLabel = input('Required');\n readonly error = input('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly invalid = input(false, { transform: booleanAttribute });\n readonly touched = input(false, { transform: booleanAttribute });\n readonly maxLength = input<number | undefined, number | undefined>(\n undefined,\n {\n transform: textLengthLimit,\n },\n );\n readonly touch = output<void>();\n protected readonly fieldHint = computed(() => [\n this.required() ? this.requiredLabel() : '',\n this.invalid() && this.error() ? this.error() : this.hint(),\n ].filter(Boolean).join('. ') || undefined);\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { NeuTokens, NeuTone } from './index.js';
2
+ /** Resolve semantic colors from the current theme, including runtime overrides. */
3
+ export declare function neuTonePalette(tokens: Readonly<NeuTokens>, tone: NeuTone): {
4
+ color: string;
5
+ onColor: string;
6
+ ink: string;
7
+ tonal: string;
8
+ };
9
+ /** Relative luminance for opaque sRGB theme colors. Platform colors remain untouched. */
10
+ export declare function neuContrastRatio(foreground: string, background: string): number | undefined;