@nizivo/react 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +120 -2
  3. package/THIRD_PARTY_NOTICES +68 -0
  4. package/dist/_engines/react-aria/dialog.client.js +126 -0
  5. package/dist/_engines/react-aria/dom-allowlist.js +19 -0
  6. package/dist/_engines/react-aria/dom.js +31 -0
  7. package/dist/_engines/react-aria/drawer.client.js +8 -0
  8. package/dist/_engines/react-aria/file-upload.client.js +50 -0
  9. package/dist/_engines/react-aria/locale.client.js +13 -0
  10. package/dist/_engines/react-aria/menu.client.js +229 -0
  11. package/dist/_engines/react-aria/open-state.client.js +53 -0
  12. package/dist/_engines/react-aria/outside-press.client.js +61 -0
  13. package/dist/_engines/react-aria/overlay.client.js +46 -0
  14. package/dist/_engines/react-aria/popover.client.js +148 -0
  15. package/dist/_engines/react-aria/popup.client.js +153 -0
  16. package/dist/_engines/react-aria/select.client.js +180 -0
  17. package/dist/_engines/react-aria/tabs.client.js +95 -0
  18. package/dist/_engines/react-aria/toast.client.js +38 -0
  19. package/dist/_engines/react-aria/tooltip.client.js +72 -0
  20. package/dist/_internal/cx.js +11 -0
  21. package/dist/_internal/data-status.d.ts +3 -0
  22. package/dist/_internal/data-status.js +13 -0
  23. package/dist/_internal/engine-part.d.ts +1 -0
  24. package/dist/_internal/field.js +20 -0
  25. package/dist/_internal/glyphs.js +87 -0
  26. package/dist/_internal/keys.js +62 -0
  27. package/dist/_internal/modal.client.js +54 -0
  28. package/dist/_internal/nested-focus.js +33 -0
  29. package/dist/_internal/overlay.d.ts +9 -0
  30. package/dist/_virtual/_rolldown/runtime.js +13 -0
  31. package/dist/alert/alert-dismiss.client.d.ts +32 -0
  32. package/dist/alert/alert-dismiss.client.js +38 -0
  33. package/dist/alert/alert.d.ts +28 -0
  34. package/dist/alert/alert.js +44 -0
  35. package/dist/alert/index.d.ts +3 -0
  36. package/dist/alert/index.js +3 -0
  37. package/dist/app-shell/app-shell.d.ts +24 -0
  38. package/dist/app-shell/app-shell.js +56 -0
  39. package/dist/app-shell/index.d.ts +2 -0
  40. package/dist/app-shell/index.js +1 -0
  41. package/dist/augment.d.ts +13 -0
  42. package/dist/augment.js +0 -0
  43. package/dist/avatar/avatar.d.ts +96 -0
  44. package/dist/avatar/avatar.js +94 -0
  45. package/dist/avatar/index.d.ts +2 -0
  46. package/dist/avatar/index.js +1 -0
  47. package/dist/badge/badge.d.ts +19 -0
  48. package/dist/badge/badge.js +22 -0
  49. package/dist/badge/index.d.ts +2 -0
  50. package/dist/badge/index.js +1 -0
  51. package/dist/banner/banner-dismiss.client.d.ts +32 -0
  52. package/dist/banner/banner-dismiss.client.js +38 -0
  53. package/dist/banner/banner.d.ts +34 -0
  54. package/dist/banner/banner.js +47 -0
  55. package/dist/banner/index.d.ts +3 -0
  56. package/dist/banner/index.js +3 -0
  57. package/dist/breadcrumb/breadcrumb.d.ts +46 -0
  58. package/dist/breadcrumb/breadcrumb.js +46 -0
  59. package/dist/breadcrumb/breadcrumb.parts.d.ts +6 -0
  60. package/dist/breadcrumb/breadcrumb.parts.js +9 -0
  61. package/dist/breadcrumb/index.d.ts +3 -0
  62. package/dist/breadcrumb/index.js +3 -0
  63. package/dist/button/button.d.ts +55 -0
  64. package/dist/button/button.js +62 -0
  65. package/dist/button/index.d.ts +2 -0
  66. package/dist/button/index.js +1 -0
  67. package/dist/card/card.d.ts +64 -0
  68. package/dist/card/card.js +62 -0
  69. package/dist/card/card.parts.d.ts +6 -0
  70. package/dist/card/card.parts.js +14 -0
  71. package/dist/card/index.d.ts +3 -0
  72. package/dist/card/index.js +3 -0
  73. package/dist/checkbox/checkbox.client.d.ts +37 -0
  74. package/dist/checkbox/checkbox.client.js +81 -0
  75. package/dist/checkbox/index.d.ts +2 -0
  76. package/dist/checkbox/index.js +1 -0
  77. package/dist/chip-group/chip-group.client.d.ts +88 -0
  78. package/dist/chip-group/chip-group.client.js +157 -0
  79. package/dist/chip-group/index.d.ts +2 -0
  80. package/dist/chip-group/index.js +1 -0
  81. package/dist/choice-card/choice-card.client.d.ts +66 -0
  82. package/dist/choice-card/choice-card.client.js +138 -0
  83. package/dist/choice-card/index.d.ts +2 -0
  84. package/dist/choice-card/index.js +1 -0
  85. package/dist/config/config.client.d.ts +24 -0
  86. package/dist/config/config.client.js +33 -0
  87. package/dist/config/index.d.ts +2 -0
  88. package/dist/config/index.js +1 -0
  89. package/dist/container/container.d.ts +13 -0
  90. package/dist/container/container.js +16 -0
  91. package/dist/container/index.d.ts +2 -0
  92. package/dist/container/index.js +1 -0
  93. package/dist/contracts/details.d.ts +13 -0
  94. package/dist/contracts/details.js +9 -0
  95. package/dist/contracts/index.d.ts +5 -0
  96. package/dist/contracts/index.js +5 -0
  97. package/dist/contracts/merge-props.d.ts +16 -0
  98. package/dist/contracts/merge-props.js +76 -0
  99. package/dist/contracts/render.d.ts +17 -0
  100. package/dist/contracts/render.js +43 -0
  101. package/dist/contracts/state.d.ts +42 -0
  102. package/dist/contracts/state.js +42 -0
  103. package/dist/css/alert.css +2 -0
  104. package/dist/css/app-shell.css +2 -0
  105. package/dist/css/avatar.css +2 -0
  106. package/dist/css/badge.css +2 -0
  107. package/dist/css/banner.css +2 -0
  108. package/dist/css/base.css +2 -0
  109. package/dist/css/breadcrumb.css +2 -0
  110. package/dist/css/button.css +2 -0
  111. package/dist/css/card.css +2 -0
  112. package/dist/css/checkbox.css +2 -0
  113. package/dist/css/chip-group.css +2 -0
  114. package/dist/css/choice-card.css +2 -0
  115. package/dist/css/container.css +2 -0
  116. package/dist/css/delta.css +2 -0
  117. package/dist/css/dialog.css +2 -0
  118. package/dist/css/drawer.css +2 -0
  119. package/dist/css/empty-state.css +2 -0
  120. package/dist/css/field.css +2 -0
  121. package/dist/css/fieldset.css +2 -0
  122. package/dist/css/file-upload.css +2 -0
  123. package/dist/css/form.css +2 -0
  124. package/dist/css/grid.css +2 -0
  125. package/dist/css/heading.css +2 -0
  126. package/dist/css/icon-button.css +2 -0
  127. package/dist/css/image.css +2 -0
  128. package/dist/css/inline-error.css +2 -0
  129. package/dist/css/inline.css +2 -0
  130. package/dist/css/input.css +2 -0
  131. package/dist/css/kbd.css +2 -0
  132. package/dist/css/kpi-tile.css +2 -0
  133. package/dist/css/menu.css +2 -0
  134. package/dist/css/meter.css +2 -0
  135. package/dist/css/metric.css +2 -0
  136. package/dist/css/mobile-tab-bar.css +2 -0
  137. package/dist/css/mobile-top-bar.css +2 -0
  138. package/dist/css/motion.css +2 -0
  139. package/dist/css/native-select.css +2 -0
  140. package/dist/css/nav-item.css +2 -0
  141. package/dist/css/number-value.css +2 -0
  142. package/dist/css/page-header.css +2 -0
  143. package/dist/css/pagination.css +2 -0
  144. package/dist/css/password-input.css +2 -0
  145. package/dist/css/popover.css +2 -0
  146. package/dist/css/progress-bar.css +2 -0
  147. package/dist/css/progress-ring.css +2 -0
  148. package/dist/css/radio-group.css +2 -0
  149. package/dist/css/ranked-list.css +2 -0
  150. package/dist/css/search-field.css +2 -0
  151. package/dist/css/segmented-control.css +2 -0
  152. package/dist/css/select.css +2 -0
  153. package/dist/css/separator.css +2 -0
  154. package/dist/css/sidebar.css +2 -0
  155. package/dist/css/skeleton.css +2 -0
  156. package/dist/css/split.css +2 -0
  157. package/dist/css/stack.css +2 -0
  158. package/dist/css/sticky-bar.css +2 -0
  159. package/dist/css/switch.css +2 -0
  160. package/dist/css/tab-nav.css +2 -0
  161. package/dist/css/table-selection.css +2 -0
  162. package/dist/css/table.css +2 -0
  163. package/dist/css/tabs.css +2 -0
  164. package/dist/css/text.css +2 -0
  165. package/dist/css/textarea.css +2 -0
  166. package/dist/css/toast.css +2 -0
  167. package/dist/css/tooltip.css +2 -0
  168. package/dist/css/top-bar.css +2 -0
  169. package/dist/css/trend-card.css +2 -0
  170. package/dist/delta/delta.d.ts +32 -0
  171. package/dist/delta/delta.js +50 -0
  172. package/dist/delta/index.d.ts +2 -0
  173. package/dist/delta/index.js +1 -0
  174. package/dist/dialog/dialog.client.d.ts +25 -0
  175. package/dist/dialog/dialog.client.js +145 -0
  176. package/dist/dialog/dialog.contract.d.ts +97 -0
  177. package/dist/dialog/dialog.parts.d.ts +6 -0
  178. package/dist/dialog/dialog.parts.js +15 -0
  179. package/dist/dialog/index.d.ts +5 -0
  180. package/dist/dialog/index.js +3 -0
  181. package/dist/drawer/drawer.client.d.ts +25 -0
  182. package/dist/drawer/drawer.client.js +154 -0
  183. package/dist/drawer/drawer.contract.d.ts +98 -0
  184. package/dist/drawer/drawer.parts.d.ts +6 -0
  185. package/dist/drawer/drawer.parts.js +16 -0
  186. package/dist/drawer/index.d.ts +5 -0
  187. package/dist/drawer/index.js +3 -0
  188. package/dist/empty-state/empty-state.d.ts +18 -0
  189. package/dist/empty-state/empty-state.js +32 -0
  190. package/dist/empty-state/index.d.ts +2 -0
  191. package/dist/empty-state/index.js +1 -0
  192. package/dist/field/field-scope.client.d.ts +50 -0
  193. package/dist/field/field-scope.client.js +212 -0
  194. package/dist/field/field-static.d.ts +122 -0
  195. package/dist/field/field-static.js +159 -0
  196. package/dist/field/field.d.ts +5 -0
  197. package/dist/field/field.js +53 -0
  198. package/dist/field/index.d.ts +4 -0
  199. package/dist/field/index.js +4 -0
  200. package/dist/fieldset/fieldset.d.ts +36 -0
  201. package/dist/fieldset/fieldset.js +63 -0
  202. package/dist/fieldset/index.d.ts +2 -0
  203. package/dist/fieldset/index.js +1 -0
  204. package/dist/file-upload/file-upload.client.d.ts +9 -0
  205. package/dist/file-upload/file-upload.client.js +406 -0
  206. package/dist/file-upload/file-upload.contract.d.ts +112 -0
  207. package/dist/file-upload/index.d.ts +3 -0
  208. package/dist/file-upload/index.js +1 -0
  209. package/dist/file-upload/seam.d.ts +1 -0
  210. package/dist/form/form.client.d.ts +38 -0
  211. package/dist/form/form.client.js +127 -0
  212. package/dist/form/form.d.ts +36 -0
  213. package/dist/form/form.js +29 -0
  214. package/dist/form/index.d.ts +4 -0
  215. package/dist/form/index.js +4 -0
  216. package/dist/form/submit-button.client.d.ts +20 -0
  217. package/dist/form/submit-button.client.js +19 -0
  218. package/dist/grid/grid.d.ts +38 -0
  219. package/dist/grid/grid.js +28 -0
  220. package/dist/grid/index.d.ts +2 -0
  221. package/dist/grid/index.js +1 -0
  222. package/dist/heading/heading.d.ts +30 -0
  223. package/dist/heading/heading.js +26 -0
  224. package/dist/heading/index.d.ts +2 -0
  225. package/dist/heading/index.js +1 -0
  226. package/dist/i18n/format-label.d.ts +24 -0
  227. package/dist/i18n/format-label.js +19 -0
  228. package/dist/i18n/index.d.ts +2 -0
  229. package/dist/i18n/index.js +1 -0
  230. package/dist/icon-button/icon-button-static.d.ts +23 -0
  231. package/dist/icon-button/icon-button-static.js +83 -0
  232. package/dist/icon-button/icon-button.client.js +29 -0
  233. package/dist/icon-button/icon-button.contract.d.ts +89 -0
  234. package/dist/icon-button/icon-button.d.ts +5 -0
  235. package/dist/icon-button/icon-button.js +21 -0
  236. package/dist/icon-button/index.d.ts +4 -0
  237. package/dist/icon-button/index.js +3 -0
  238. package/dist/image/image.d.ts +28 -0
  239. package/dist/image/image.js +24 -0
  240. package/dist/image/index.d.ts +2 -0
  241. package/dist/image/index.js +1 -0
  242. package/dist/index.d.ts +174 -0
  243. package/dist/index.js +96 -0
  244. package/dist/inline/index.d.ts +2 -0
  245. package/dist/inline/index.js +1 -0
  246. package/dist/inline/inline.d.ts +16 -0
  247. package/dist/inline/inline.js +14 -0
  248. package/dist/inline-error/index.d.ts +2 -0
  249. package/dist/inline-error/index.js +1 -0
  250. package/dist/inline-error/inline-error.d.ts +17 -0
  251. package/dist/inline-error/inline-error.js +33 -0
  252. package/dist/input/index.d.ts +2 -0
  253. package/dist/input/index.js +1 -0
  254. package/dist/input/input.client.d.ts +39 -0
  255. package/dist/input/input.client.js +82 -0
  256. package/dist/kbd/index.d.ts +2 -0
  257. package/dist/kbd/index.js +1 -0
  258. package/dist/kbd/kbd.d.ts +19 -0
  259. package/dist/kbd/kbd.js +68 -0
  260. package/dist/kpi-tile/index.d.ts +2 -0
  261. package/dist/kpi-tile/index.js +1 -0
  262. package/dist/kpi-tile/kpi-tile.d.ts +30 -0
  263. package/dist/kpi-tile/kpi-tile.js +48 -0
  264. package/dist/locales/en-US.d.ts +77 -0
  265. package/dist/locales/en-US.js +83 -0
  266. package/dist/menu/index.d.ts +5 -0
  267. package/dist/menu/index.js +3 -0
  268. package/dist/menu/menu.client.d.ts +14 -0
  269. package/dist/menu/menu.client.js +152 -0
  270. package/dist/menu/menu.contract.d.ts +152 -0
  271. package/dist/menu/menu.parts.d.ts +6 -0
  272. package/dist/menu/menu.parts.js +17 -0
  273. package/dist/meter/index.d.ts +2 -0
  274. package/dist/meter/index.js +1 -0
  275. package/dist/meter/meter.d.ts +43 -0
  276. package/dist/meter/meter.js +59 -0
  277. package/dist/metric/index.d.ts +2 -0
  278. package/dist/metric/index.js +1 -0
  279. package/dist/metric/metric.d.ts +72 -0
  280. package/dist/metric/metric.js +116 -0
  281. package/dist/mobile-tab-bar/index.d.ts +4 -0
  282. package/dist/mobile-tab-bar/index.js +4 -0
  283. package/dist/mobile-tab-bar/mobile-tab-bar-inset.client.js +38 -0
  284. package/dist/mobile-tab-bar/mobile-tab-bar-more.client.d.ts +26 -0
  285. package/dist/mobile-tab-bar/mobile-tab-bar-more.client.js +60 -0
  286. package/dist/mobile-tab-bar/mobile-tab-bar.d.ts +39 -0
  287. package/dist/mobile-tab-bar/mobile-tab-bar.js +54 -0
  288. package/dist/mobile-tab-bar/mobile-tab-bar.parts.d.ts +6 -0
  289. package/dist/mobile-tab-bar/mobile-tab-bar.parts.js +9 -0
  290. package/dist/mobile-top-bar/index.d.ts +2 -0
  291. package/dist/mobile-top-bar/index.js +1 -0
  292. package/dist/mobile-top-bar/mobile-top-bar.d.ts +17 -0
  293. package/dist/mobile-top-bar/mobile-top-bar.js +31 -0
  294. package/dist/motion/count-up.client.d.ts +39 -0
  295. package/dist/motion/count-up.client.js +109 -0
  296. package/dist/motion/index.d.ts +2 -0
  297. package/dist/motion/index.js +1 -0
  298. package/dist/native-select/index.d.ts +2 -0
  299. package/dist/native-select/index.js +1 -0
  300. package/dist/native-select/native-select.d.ts +43 -0
  301. package/dist/native-select/native-select.js +56 -0
  302. package/dist/nav-item/index.d.ts +2 -0
  303. package/dist/nav-item/index.js +1 -0
  304. package/dist/nav-item/nav-item.d.ts +35 -0
  305. package/dist/nav-item/nav-item.js +50 -0
  306. package/dist/number-value/index.d.ts +2 -0
  307. package/dist/number-value/index.js +1 -0
  308. package/dist/number-value/number-value.d.ts +25 -0
  309. package/dist/number-value/number-value.js +26 -0
  310. package/dist/page-header/index.d.ts +2 -0
  311. package/dist/page-header/index.js +1 -0
  312. package/dist/page-header/page-header.d.ts +19 -0
  313. package/dist/page-header/page-header.js +39 -0
  314. package/dist/pagination/index.d.ts +2 -0
  315. package/dist/pagination/index.js +1 -0
  316. package/dist/pagination/pagination.d.ts +74 -0
  317. package/dist/pagination/pagination.js +136 -0
  318. package/dist/password-input/index.d.ts +2 -0
  319. package/dist/password-input/index.js +1 -0
  320. package/dist/password-input/password-input.client.d.ts +52 -0
  321. package/dist/password-input/password-input.client.js +106 -0
  322. package/dist/popover/index.d.ts +5 -0
  323. package/dist/popover/index.js +3 -0
  324. package/dist/popover/popover.client.d.ts +20 -0
  325. package/dist/popover/popover.client.js +113 -0
  326. package/dist/popover/popover.contract.d.ts +88 -0
  327. package/dist/popover/popover.parts.d.ts +6 -0
  328. package/dist/popover/popover.parts.js +13 -0
  329. package/dist/progress-bar/index.d.ts +2 -0
  330. package/dist/progress-bar/index.js +1 -0
  331. package/dist/progress-bar/progress-bar.d.ts +34 -0
  332. package/dist/progress-bar/progress-bar.js +55 -0
  333. package/dist/progress-ring/index.d.ts +2 -0
  334. package/dist/progress-ring/index.js +1 -0
  335. package/dist/progress-ring/progress-ring.d.ts +38 -0
  336. package/dist/progress-ring/progress-ring.js +67 -0
  337. package/dist/radio-group/index.d.ts +3 -0
  338. package/dist/radio-group/index.js +3 -0
  339. package/dist/radio-group/radio-group.client.d.ts +22 -0
  340. package/dist/radio-group/radio-group.client.js +70 -0
  341. package/dist/radio-group/radio-group.d.ts +28 -0
  342. package/dist/radio-group/radio-group.js +35 -0
  343. package/dist/ranked-list/index.d.ts +3 -0
  344. package/dist/ranked-list/index.js +3 -0
  345. package/dist/ranked-list/ranked-list.d.ts +85 -0
  346. package/dist/ranked-list/ranked-list.js +153 -0
  347. package/dist/ranked-list/ranked-list.parts.d.ts +6 -0
  348. package/dist/ranked-list/ranked-list.parts.js +10 -0
  349. package/dist/search-field/index.d.ts +2 -0
  350. package/dist/search-field/index.js +1 -0
  351. package/dist/search-field/search-field.client.d.ts +55 -0
  352. package/dist/search-field/search-field.client.js +136 -0
  353. package/dist/segmented-control/index.d.ts +3 -0
  354. package/dist/segmented-control/index.js +3 -0
  355. package/dist/segmented-control/segmented-control.client.d.ts +61 -0
  356. package/dist/segmented-control/segmented-control.client.js +156 -0
  357. package/dist/segmented-control/segmented-control.parts.d.ts +6 -0
  358. package/dist/segmented-control/segmented-control.parts.js +9 -0
  359. package/dist/select/index.d.ts +5 -0
  360. package/dist/select/index.js +3 -0
  361. package/dist/select/select.client.d.ts +12 -0
  362. package/dist/select/select.client.js +152 -0
  363. package/dist/select/select.contract.d.ts +119 -0
  364. package/dist/select/select.parts.d.ts +6 -0
  365. package/dist/select/select.parts.js +15 -0
  366. package/dist/separator/index.d.ts +2 -0
  367. package/dist/separator/index.js +1 -0
  368. package/dist/separator/separator.d.ts +26 -0
  369. package/dist/separator/separator.js +23 -0
  370. package/dist/sidebar/index.d.ts +4 -0
  371. package/dist/sidebar/index.js +4 -0
  372. package/dist/sidebar/sidebar-item.client.d.ts +10 -0
  373. package/dist/sidebar/sidebar-item.client.js +55 -0
  374. package/dist/sidebar/sidebar.d.ts +45 -0
  375. package/dist/sidebar/sidebar.js +62 -0
  376. package/dist/sidebar/sidebar.parts.d.ts +6 -0
  377. package/dist/sidebar/sidebar.parts.js +11 -0
  378. package/dist/skeleton/index.d.ts +2 -0
  379. package/dist/skeleton/index.js +1 -0
  380. package/dist/skeleton/skeleton.d.ts +20 -0
  381. package/dist/skeleton/skeleton.js +19 -0
  382. package/dist/split/index.d.ts +3 -0
  383. package/dist/split/index.js +3 -0
  384. package/dist/split/split.d.ts +28 -0
  385. package/dist/split/split.js +33 -0
  386. package/dist/split/split.parts.d.ts +6 -0
  387. package/dist/split/split.parts.js +10 -0
  388. package/dist/stack/index.d.ts +2 -0
  389. package/dist/stack/index.js +1 -0
  390. package/dist/stack/stack.d.ts +17 -0
  391. package/dist/stack/stack.js +14 -0
  392. package/dist/sticky-bar/index.d.ts +2 -0
  393. package/dist/sticky-bar/index.js +1 -0
  394. package/dist/sticky-bar/sticky-bar.d.ts +16 -0
  395. package/dist/sticky-bar/sticky-bar.js +26 -0
  396. package/dist/styles.css +595 -0
  397. package/dist/switch/index.d.ts +2 -0
  398. package/dist/switch/index.js +1 -0
  399. package/dist/switch/switch.client.d.ts +33 -0
  400. package/dist/switch/switch.client.js +63 -0
  401. package/dist/tab-nav/index.d.ts +3 -0
  402. package/dist/tab-nav/index.js +3 -0
  403. package/dist/tab-nav/tab-nav.d.ts +36 -0
  404. package/dist/tab-nav/tab-nav.js +47 -0
  405. package/dist/tab-nav/tab-nav.parts.d.ts +6 -0
  406. package/dist/tab-nav/tab-nav.parts.js +9 -0
  407. package/dist/table/index.d.ts +3 -0
  408. package/dist/table/index.js +3 -0
  409. package/dist/table/table.d.ts +101 -0
  410. package/dist/table/table.js +121 -0
  411. package/dist/table/table.parts.d.ts +6 -0
  412. package/dist/table/table.parts.js +18 -0
  413. package/dist/table-selection/index.d.ts +3 -0
  414. package/dist/table-selection/index.js +3 -0
  415. package/dist/table-selection/table-selection.client.d.ts +14 -0
  416. package/dist/table-selection/table-selection.client.js +84 -0
  417. package/dist/table-selection/table-selection.d.ts +34 -0
  418. package/dist/table-selection/table-selection.js +50 -0
  419. package/dist/tabs/index.d.ts +4 -0
  420. package/dist/tabs/index.js +3 -0
  421. package/dist/tabs/tabs.client.d.ts +8 -0
  422. package/dist/tabs/tabs.client.js +68 -0
  423. package/dist/tabs/tabs.contract.d.ts +89 -0
  424. package/dist/tabs/tabs.parts.d.ts +6 -0
  425. package/dist/tabs/tabs.parts.js +11 -0
  426. package/dist/text/index.d.ts +2 -0
  427. package/dist/text/index.js +1 -0
  428. package/dist/text/text.d.ts +32 -0
  429. package/dist/text/text.js +17 -0
  430. package/dist/textarea/index.d.ts +2 -0
  431. package/dist/textarea/index.js +1 -0
  432. package/dist/textarea/textarea.client.d.ts +18 -0
  433. package/dist/textarea/textarea.client.js +31 -0
  434. package/dist/theme-script/index.d.ts +2 -0
  435. package/dist/theme-script/index.js +1 -0
  436. package/dist/theme-script/theme-script.d.ts +43 -0
  437. package/dist/theme-script/theme-script.js +46 -0
  438. package/dist/toast/index.d.ts +4 -0
  439. package/dist/toast/index.js +3 -0
  440. package/dist/toast/seam.d.ts +2 -0
  441. package/dist/toast/store.d.ts +19 -0
  442. package/dist/toast/store.js +136 -0
  443. package/dist/toast/toast.contract.d.ts +56 -0
  444. package/dist/toast/toaster.client.d.ts +10 -0
  445. package/dist/toast/toaster.client.js +305 -0
  446. package/dist/tooltip/index.d.ts +5 -0
  447. package/dist/tooltip/index.js +3 -0
  448. package/dist/tooltip/tooltip.client.d.ts +12 -0
  449. package/dist/tooltip/tooltip.client.js +51 -0
  450. package/dist/tooltip/tooltip.contract.d.ts +60 -0
  451. package/dist/tooltip/tooltip.parts.d.ts +6 -0
  452. package/dist/tooltip/tooltip.parts.js +10 -0
  453. package/dist/top-bar/index.d.ts +2 -0
  454. package/dist/top-bar/index.js +1 -0
  455. package/dist/top-bar/top-bar.d.ts +17 -0
  456. package/dist/top-bar/top-bar.js +35 -0
  457. package/dist/trend-card/index.d.ts +2 -0
  458. package/dist/trend-card/index.js +1 -0
  459. package/dist/trend-card/trend-card.d.ts +34 -0
  460. package/dist/trend-card/trend-card.js +74 -0
  461. package/package.json +447 -3
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,121 @@
1
- # Temporary Holding Version
1
+ # @nizivo/react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Accessible React components for the Nizivo design system. Server Components by default: only the interactive leaves are `'use client'`, so a page that renders a Button, a Card or a Field with a native control ships no Nizivo JavaScript. The styling is plain CSS that reads the tokens of [`@nizivo/tokens`](https://www.npmjs.com/package/@nizivo/tokens).
4
+
5
+ **Pre-release.** 0.x versions go to the `next` dist-tag, and a minor release may break (with a `BREAKING` note in the changelog).
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @nizivo/react@next @nizivo/tokens@next
11
+ ```
12
+
13
+ - Peers: `react` and `react-dom` `^19.2.0` (`@types/react` `^19.2.0` is optional).
14
+ - ESM only, no CommonJS build. Node `>=22.12` can still `require()` it.
15
+ - Install `@nizivo/tokens` as a direct dependency too: your CSS imports its `tokens.css`. The two always release at the same version.
16
+ - Browser support floor: Chrome and Edge 123, Firefox 129, Safari and iOS 17.5.
17
+
18
+ ## Import the CSS once
19
+
20
+ The JavaScript never imports CSS. In your root layout (or global stylesheet), import, in this order:
21
+
22
+ 1. `@nizivo/tokens/tokens.css`, the only source of token CSS;
23
+ 2. `@nizivo/react/css/base.css`, the shared accessibility floor (the focus ring and forced-colours rules of every control);
24
+ 3. one `@nizivo/react/css/<name>.css` per component you use.
25
+
26
+ ```tsx
27
+ // app/layout.tsx
28
+ import '@nizivo/tokens/tokens.css';
29
+ import '@nizivo/react/css/base.css';
30
+ import '@nizivo/react/css/button.css';
31
+ import '@nizivo/react/css/field.css';
32
+ import '@nizivo/react/css/input.css';
33
+ ```
34
+
35
+ Every stylesheet starts with the same `@layer` statement, so the order a bundler emits them in never changes which rule wins.
36
+
37
+ Or import a single file, `@nizivo/react/styles.css`: the tokens, `base.css` and every component's stylesheet. Import **either** it **or** the files above, never both. It already holds a byte-identical copy of `@nizivo/tokens/tokens.css` from the same release, so the two never drift apart.
38
+
39
+ ```tsx
40
+ // app/layout.tsx
41
+ import '@nizivo/react/styles.css';
42
+ ```
43
+
44
+ With Tailwind CSS v4, import either route inside `layer(components)` and add `@nizivo/tokens/tailwind.css`.
45
+
46
+ Keep `light-dark()` intact, or nested theme scopes and inverse surfaces stop following their own theme:
47
+
48
+ - **Next.js with Turbopack:** set your browser targets to the support floor (a `browserslist` of `chrome >= 123`, `edge >= 123`, `firefox >= 129`, `safari >= 17.5`, `ios_saf >= 17.5`).
49
+ - **Vite 8:** set `build.cssTarget` to `['chrome123', 'edge123', 'firefox129', 'safari17.5', 'ios17.5']`. A `browserslist` is not enough; without `cssTarget` a plain build lowers every `light-dark()` value.
50
+ - **Astro 7.3:** nothing to set.
51
+
52
+ ## Use
53
+
54
+ ```tsx
55
+ import { Button } from '@nizivo/react/button';
56
+ import { Field } from '@nizivo/react/field';
57
+ import { Input } from '@nizivo/react/input';
58
+
59
+ export default function NewProduct() {
60
+ return (
61
+ <form>
62
+ <Field label="Product title" description="Shown on product pages and checkout." required>
63
+ <Input name="title" placeholder="e.g. Stoneware mug" />
64
+ </Field>
65
+ <Button variant="primary" type="submit">
66
+ Save
67
+ </Button>
68
+ </form>
69
+ );
70
+ }
71
+ ```
72
+
73
+ Each component has its own subpath (`@nizivo/react/<name>`, kebab-case) and its own stylesheet (`@nizivo/react/css/<name>.css`). The root `@nizivo/react` barrel exports the same components.
74
+
75
+ Compound components are namespaces, and the interactive ones (Select, Dialog, Tooltip, Menu, Tabs) run on React Aria. A Server Component can render them as they are:
76
+
77
+ ```tsx
78
+ import { Select } from '@nizivo/react/select';
79
+
80
+ <Select.Root defaultValue="30d" name="period" aria-label="Period">
81
+ <Select.Trigger />
82
+ <Select.Popup>
83
+ <Select.Item value="7d">Last 7 days</Select.Item>
84
+ <Select.Item value="30d">Last 30 days</Select.Item>
85
+ </Select.Popup>
86
+ </Select.Root>;
87
+ ```
88
+
89
+ ## Theme
90
+
91
+ Light by default. Set `data-nz-theme` on `<html>` to `system` (follows the operating system, no script, no flash), `light` or `dark`. Any element with `data-nz-theme` starts a nested scope.
92
+
93
+ To remember a reader's choice, render `ThemeScript` in `<head>` and put `suppressHydrationWarning` on `<html>`. Before first paint it reads `localStorage` key `nz-theme` (`light`, `dark` or `system`) and sets `data-nz-theme` on `<html>`; with nothing stored, or storage blocked, it leaves your default alone and never throws. It also sets `data-nz-platform`, so `Kbd` shows ⌘ or Ctrl. Your theme switch stores the choice under the same key and sets the attribute.
94
+
95
+ ```tsx
96
+ import { ThemeScript } from '@nizivo/react/theme-script';
97
+
98
+ <html lang="en" data-nz-theme="system" suppressHydrationWarning>
99
+ <head>
100
+ <ThemeScript nonce={nonce} />
101
+ </head>
102
+ <body>{children}</body>
103
+ </html>;
104
+ ```
105
+
106
+ Under a strict CSP, pass the nonce as above or allow the script by hash: `'sha256-nA1HUQWDdDUFqqoxWbjzCzcYSjzWLEe0pwDdRCMGqOw='`. The plain string is exported as `themeScript` for Astro (`<script is:inline set:html={themeScript} />`) and Vite (`transformIndexHtml`).
107
+
108
+ ## Components in 0.1
109
+
110
+ Text, Heading, Stack, Inline, Grid, Container, Separator; Button, IconButton; Badge, Card, Delta, ProgressBar, ProgressRing, Meter, Skeleton, EmptyState, InlineError, Alert, Kbd, Image; Field, Fieldset, Input, Textarea, Checkbox, RadioGroup, Switch, SegmentedControl, Select, NativeSelect; Tooltip, Dialog, Menu, Tabs, TabNav; ThemeScript and NizivoConfig.
111
+
112
+ ## Documentation
113
+
114
+ The docs site is coming. Until then:
115
+
116
+ - [Getting started for Next.js, Vite and Astro, and the Tailwind recipe](https://github.com/theneev/nizivo/tree/main/apps/docs/content/docs/getting-started) (the docs site's source).
117
+ - [The plan](https://github.com/theneev/nizivo/blob/main/docs/ARCHITECTURE.md): §5 (packages, exports and the CSS import rule), §11 (framework setup), §12 (overlays), §16.4 (RTL).
118
+
119
+ ## Licence
120
+
121
+ Apache-2.0. Copyright 2026 Neev Technologies. The icon drawings inlined into some components come from Lucide (ISC): see `THIRD_PARTY_NOTICES`.
@@ -0,0 +1,68 @@
1
+ @nizivo/react includes material from the following third-party projects.
2
+
3
+ --------------------------------------------------------------------------------
4
+ Lucide (https://lucide.dev), lucide-static 1.56.0
5
+
6
+ The internal glyphs in dist/_internal/glyphs.js reuse the SVG path data of these
7
+ Lucide icons:
8
+
9
+ loader-circle (the Button and IconButton pending spinner)
10
+ chevron-right (the Breadcrumb separator and the Pagination previous/next marks)
11
+ chevrons-up-down (the Select trigger indicator)
12
+ circle-x (the Field, Fieldset and InlineError error mark, the critical Toast mark)
13
+ circle-check (the success Toast mark)
14
+ info (the neutral Toast mark)
15
+ x (the AlertDismiss close mark)
16
+ check (the Checkbox checked mark)
17
+ minus (the Checkbox indeterminate dash)
18
+ eye (the PasswordInput toggle while the password is hidden)
19
+ eye-off (the PasswordInput toggle while the password is shown)
20
+ search (the SearchField magnifier)
21
+ ellipsis (the MobileTabBar More mark)
22
+
23
+ Lucide's licence covers all thirteen:
24
+
25
+ ISC License
26
+
27
+ Copyright (c) 2026 Lucide Icons and Contributors
28
+
29
+ Permission to use, copy, modify, and/or distribute this software for any
30
+ purpose with or without fee is hereby granted, provided that the above
31
+ copyright notice and this permission notice appear in all copies.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
34
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
35
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
36
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
37
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
38
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
39
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40
+
41
+ --------------------------------------------------------------------------------
42
+ Feather (https://feathericons.com)
43
+
44
+ chevron-right, circle-x (Feather's x-circle), info, x, check, minus, search and
45
+ ellipsis (Feather's more-horizontal) are on Lucide's list of icons derived from the
46
+ Feather project, so their path data is also under Feather's licence:
47
+
48
+ The MIT License (MIT)
49
+
50
+ Copyright (c) 2013-present Cole Bemis
51
+
52
+ Permission is hereby granted, free of charge, to any person obtaining a copy
53
+ of this software and associated documentation files (the "Software"), to deal
54
+ in the Software without restriction, including without limitation the rights
55
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56
+ copies of the Software, and to permit persons to whom the Software is
57
+ furnished to do so, subject to the following conditions:
58
+
59
+ The above copyright notice and this permission notice shall be included in all
60
+ copies or substantial portions of the Software.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68
+ SOFTWARE.
@@ -0,0 +1,126 @@
1
+ "use client";
2
+ import { mergeProps } from "../../contracts/merge-props.js";
3
+ import { stateAttrs } from "../../contracts/state.js";
4
+ import { defined, engineDom } from "./dom.js";
5
+ import { EngineLocale } from "./locale.client.js";
6
+ import { OverlayScope, TOP_LAYER } from "./overlay.client.js";
7
+ import { useOpenState } from "./open-state.client.js";
8
+ import { InitialFocus, ReturnFocus, useTriggerRef } from "./popup.client.js";
9
+ import { OutsidePress } from "./outside-press.client.js";
10
+ import { createElement, use, useRef } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { Button, Dialog, DialogTrigger, Heading, Modal, ModalOverlay, OverlayTriggerStateContext, Text } from "react-aria-components";
13
+ //#region src/_engines/react-aria/dialog.client.tsx
14
+ /** A box-less wrapper: popups portaled into it position against the positioner. */
15
+ const NESTED_STYLE = { display: "contents" };
16
+ const Root = ({ open, defaultOpen, onOpenChange, children }) => {
17
+ const [isOpen, setOpen, key] = useOpenState(open, defaultOpen, onOpenChange);
18
+ return /* @__PURE__ */ jsx(EngineLocale, { children: /* @__PURE__ */ jsx(DialogTrigger, {
19
+ isOpen,
20
+ onOpenChange: setOpen,
21
+ children
22
+ }, key) });
23
+ };
24
+ const Trigger = ({ render, children, ...dom }) => {
25
+ const open = use(OverlayTriggerStateContext)?.isOpen ?? false;
26
+ return /* @__PURE__ */ jsx(Button, {
27
+ render: (p, rp) => {
28
+ const s = {
29
+ open,
30
+ pressed: rp.isPressed && !open,
31
+ focusVisible: rp.isFocusVisible,
32
+ disabled: rp.isDisabled
33
+ };
34
+ return render(mergeProps(engineDom(p), dom, stateAttrs(s)), s);
35
+ },
36
+ children
37
+ });
38
+ };
39
+ const Popup = ({ role, backdrop, container, positioner, backdropProps, contentProps, initialFocus, returnFocus, "aria-label": label, "aria-labelledby": labelledBy, "aria-describedby": describedBy, render, children, ...dom }) => {
40
+ const nestedRef = useRef(null);
41
+ const contentRef = useRef(null);
42
+ const trigger = useTriggerRef();
43
+ return /* @__PURE__ */ jsx(ModalOverlay, {
44
+ isDismissable: role !== "alertdialog",
45
+ ...defined({ UNSTABLE_portalContainer: container ?? void 0 }),
46
+ render: (p, rp) => {
47
+ const attrs = stateAttrs({
48
+ open: rp.state.isOpen,
49
+ entering: rp.isEntering,
50
+ exiting: rp.isExiting
51
+ });
52
+ return createElement("div", mergeProps(engineDom(p), positioner, attrs), backdrop ? createElement("div", mergeProps(backdropProps, attrs, { "aria-hidden": true })) : null, p.children, createElement("div", {
53
+ ref: nestedRef,
54
+ style: NESTED_STYLE,
55
+ ...TOP_LAYER
56
+ }));
57
+ },
58
+ children: /* @__PURE__ */ jsx(OverlayScope, {
59
+ container: nestedRef,
60
+ children: /* @__PURE__ */ jsx(Modal, {
61
+ render: (p, rp) => {
62
+ const s = {
63
+ entering: rp.isEntering,
64
+ exiting: rp.isExiting
65
+ };
66
+ const attrs = stateAttrs({
67
+ open: rp.state.isOpen,
68
+ ...s
69
+ });
70
+ return render(mergeProps(engineDom(p), dom, attrs), s);
71
+ },
72
+ children: /* @__PURE__ */ jsxs(Dialog, {
73
+ role,
74
+ ...defined({
75
+ "aria-label": label,
76
+ "aria-labelledby": labelledBy,
77
+ "aria-describedby": describedBy
78
+ }),
79
+ render: (p) => createElement("section", mergeProps(engineDom(p), contentProps, { ref: contentRef })),
80
+ children: [
81
+ /* @__PURE__ */ jsx(InitialFocus, {
82
+ content: contentRef,
83
+ resolve: initialFocus
84
+ }),
85
+ /* @__PURE__ */ jsx(ReturnFocus, {
86
+ trigger,
87
+ popup: contentRef,
88
+ target: returnFocus
89
+ }),
90
+ /* @__PURE__ */ jsx(OutsidePress, {
91
+ popup: contentRef,
92
+ dismissable: role !== "alertdialog"
93
+ }),
94
+ children
95
+ ]
96
+ })
97
+ })
98
+ })
99
+ });
100
+ };
101
+ const Title = ({ level, render, children, ...dom }) => /* @__PURE__ */ jsx(Heading, {
102
+ slot: "title",
103
+ level,
104
+ render: (p) => render(mergeProps(engineDom(p), dom), {}),
105
+ children
106
+ });
107
+ const Description = ({ render, children, ...dom }) => /* @__PURE__ */ jsx(Text, {
108
+ slot: "description",
109
+ elementType: "p",
110
+ render: (p) => render(mergeProps(engineDom(p), dom), {}),
111
+ children
112
+ });
113
+ const Close = ({ render, children, ...dom }) => /* @__PURE__ */ jsx(Button, {
114
+ slot: "close",
115
+ render: (p, rp) => {
116
+ const s = {
117
+ pressed: rp.isPressed,
118
+ focusVisible: rp.isFocusVisible,
119
+ disabled: rp.isDisabled
120
+ };
121
+ return render(mergeProps(engineDom(p), dom, stateAttrs(s)), s);
122
+ },
123
+ children
124
+ });
125
+ //#endregion
126
+ export { Close, Description, Popup, Root, Title, Trigger };
@@ -0,0 +1,19 @@
1
+ //#region src/_engines/react-aria/dom-allowlist.json
2
+ var attributes = [
3
+ "data-react-aria-top-layer",
4
+ "data-live-announcer",
5
+ "data-key",
6
+ "data-collection",
7
+ "data-ismodal",
8
+ "data-overlay-container",
9
+ "data-react-aria-prevent-focus",
10
+ "data-react-aria-pressable",
11
+ "data-href",
12
+ "data-target",
13
+ "data-rel",
14
+ "data-download",
15
+ "data-ping",
16
+ "data-referrer-policy"
17
+ ];
18
+ //#endregion
19
+ export { attributes };
@@ -0,0 +1,31 @@
1
+ import { attributes } from "./dom-allowlist.js";
2
+ //#region src/_engines/react-aria/dom.ts
3
+ const ALLOWED = new Set(attributes);
4
+ /**
5
+ * Filters the DOM props React Aria hands to a `render` function:
6
+ * - drops `className`: the engine's default `react-aria-*` classes are not ours, and adapters write none;
7
+ * - drops `slot`: React Aria's context slot name (`slot="close"`) is not a DOM attribute of ours;
8
+ * - drops every `data-*` except the functional allowlist. Vocabulary attributes come only from
9
+ * `stateAttrs()` over render state, so React Aria's `data-focused`, `data-rac`, `data-hovered` and
10
+ * its own copies of `data-open`, `data-invalid`, … never reach the DOM.
11
+ */
12
+ function engineDom(props) {
13
+ const out = {};
14
+ for (const [key, value] of Object.entries(props)) {
15
+ if (key === "className" || key === "slot") continue;
16
+ if (key.startsWith("data-") && !ALLOWED.has(key)) continue;
17
+ out[key] = value;
18
+ }
19
+ return out;
20
+ }
21
+ /** Drops `undefined` keys so optional props can be spread into engine props under exactOptionalPropertyTypes. */
22
+ function defined(props) {
23
+ const out = {};
24
+ for (const key in props) {
25
+ const value = props[key];
26
+ if (value !== void 0) out[key] = value;
27
+ }
28
+ return out;
29
+ }
30
+ //#endregion
31
+ export { defined, engineDom };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import "./dialog.client.js";
3
+ import { useLocale } from "react-aria-components";
4
+ //#region src/_engines/react-aria/drawer.client.tsx
5
+ /** The engine's writing direction, from the locale every engine root provides (§9.3 rule 5). */
6
+ const useDirection = () => useLocale().direction;
7
+ //#endregion
8
+ export { useDirection };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { useRef, useState } from "react";
3
+ //#region src/_engines/react-aria/file-upload.client.tsx
4
+ const carriesFiles = (event) => event.dataTransfer?.types.includes("Files") ?? false;
5
+ function useDropTarget(options, _ref) {
6
+ const [over, setOver] = useState(false);
7
+ const depth = useRef(0);
8
+ if (options.disabled) return {
9
+ dropProps: {
10
+ onDragOver: refuse,
11
+ onDrop: refuse
12
+ },
13
+ isDropTarget: false
14
+ };
15
+ return {
16
+ dropProps: {
17
+ onDragEnter(event) {
18
+ if (!carriesFiles(event)) return;
19
+ event.preventDefault();
20
+ depth.current += 1;
21
+ setOver(true);
22
+ },
23
+ onDragOver(event) {
24
+ if (!carriesFiles(event)) return;
25
+ event.preventDefault();
26
+ if (event.dataTransfer !== null) event.dataTransfer.dropEffect = "copy";
27
+ },
28
+ onDragLeave(event) {
29
+ if (!carriesFiles(event)) return;
30
+ depth.current = Math.max(0, depth.current - 1);
31
+ if (depth.current === 0) setOver(false);
32
+ },
33
+ onDrop(event) {
34
+ if (!carriesFiles(event)) return;
35
+ event.preventDefault();
36
+ depth.current = 0;
37
+ setOver(false);
38
+ const files = [...event.dataTransfer?.files ?? []];
39
+ if (files.length > 0) options.onDrop(files, event.currentTarget);
40
+ }
41
+ },
42
+ isDropTarget: over
43
+ };
44
+ }
45
+ function refuse(event) {
46
+ event.preventDefault();
47
+ if (event.dataTransfer !== null) event.dataTransfer.dropEffect = "none";
48
+ }
49
+ //#endregion
50
+ export { useDropTarget };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { useResolvedLocale } from "../../config/config.client.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { I18nProvider } from "react-aria-components";
5
+ //#region src/_engines/react-aria/locale.client.tsx
6
+ function EngineLocale({ children }) {
7
+ return /* @__PURE__ */ jsx(I18nProvider, {
8
+ locale: useResolvedLocale(),
9
+ children
10
+ });
11
+ }
12
+ //#endregion
13
+ export { EngineLocale };