@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
@@ -0,0 +1,39 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { ControlSize } from "../augment.js";
3
+ import { ComponentPropsWithRef, JSX, ReactNode } from "react";
4
+ //#region src/input/input.client.d.ts
5
+ /** Text-like input types; the others (checkbox, file, date, …) are other components. */
6
+ export type InputType = "text" | "email" | "search" | "password" | "number" | "tel" | "url";
7
+ export interface InputState {
8
+ size: ControlSize;
9
+ /** An error message is presented (the Field's, or the `invalid` prop). */
10
+ invalid: boolean;
11
+ disabled: boolean;
12
+ readOnly: boolean;
13
+ }
14
+ export interface InputProps extends Omit<ComponentPropsWithRef<"input">, "type" | "size" | "prefix" | "children"> {
15
+ /** @default 'text' */
16
+ type?: InputType;
17
+ /** 32 / 40 / 48 px, as Button and Select. @default 'md' */
18
+ size?: ControlSize;
19
+ /**
20
+ * An error message is presented for this input (§8.3). Inside a Field, the Field sets it; an
21
+ * explicit value here wins.
22
+ */
23
+ invalid?: boolean;
24
+ /** Decorative icon before the value (`aria-hidden`). */
25
+ leadingIcon?: ReactNode;
26
+ /** Decorative icon after the value (`aria-hidden`). */
27
+ trailingIcon?: ReactNode;
28
+ /** Text before the value, such as a currency sign; joined to the input's `aria-describedby`. */
29
+ prefix?: ReactNode;
30
+ /** Text after the value, such as a unit; joined to the input's `aria-describedby`. */
31
+ suffix?: ReactNode;
32
+ /**
33
+ * Composition of the root, the bordered box around the native `<input>`. `className` and `style`
34
+ * go on the root too; every other prop, `ref` included, goes on the `<input>`.
35
+ */
36
+ render?: RenderProp<InputState>;
37
+ }
38
+ export declare function Input({ type, size, id, name, required, disabled, readOnly, invalid, "aria-invalid": ariaInvalid, "aria-describedby": describedBy, leadingIcon, trailingIcon, prefix, suffix, render, className, style, ...rest }: InputProps): JSX.Element;
39
+ //#endregion
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { cx } from "../_internal/cx.js";
3
+ import { mergeProps } from "../contracts/merge-props.js";
4
+ import { renderElement } from "../contracts/render.js";
5
+ import { stateAttrs } from "../contracts/state.js";
6
+ import { joinIds } from "../_internal/field.js";
7
+ import { useFieldControl } from "../field/field-scope.client.js";
8
+ import { useId } from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/input/input.client.tsx
11
+ function Input({ type = "text", size = "md", id, name, required, disabled, readOnly, invalid, "aria-invalid": ariaInvalid, "aria-describedby": describedBy, leadingIcon, trailingIcon, prefix, suffix, render, className, style, ...rest }) {
12
+ const affix = useId();
13
+ const prefixId = prefix == null ? void 0 : `${affix}-prefix`;
14
+ const suffixId = suffix == null ? void 0 : `${affix}-suffix`;
15
+ const field = useFieldControl({
16
+ id,
17
+ name,
18
+ required,
19
+ disabled,
20
+ readOnly,
21
+ invalid: invalid ?? (ariaInvalid === true || ariaInvalid === "true" ? true : void 0),
22
+ "aria-describedby": joinIds(describedBy, prefixId, suffixId)
23
+ });
24
+ const state = {
25
+ size,
26
+ invalid: field.invalid,
27
+ disabled: field.disabled,
28
+ readOnly: field.readOnly
29
+ };
30
+ return renderElement("span", render, state, {
31
+ "data-slot": "input",
32
+ "data-size": size,
33
+ ...stateAttrs({
34
+ invalid: state.invalid,
35
+ disabled: state.disabled,
36
+ readOnly: state.readOnly
37
+ }),
38
+ className: cx("nz-input", className),
39
+ style,
40
+ onMouseDown: focusInput,
41
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ leadingIcon != null && /* @__PURE__ */ jsx("span", {
43
+ className: "nz-input-icon",
44
+ "data-slot": "input-icon",
45
+ "aria-hidden": "true",
46
+ children: leadingIcon
47
+ }),
48
+ prefix != null && /* @__PURE__ */ jsx("span", {
49
+ className: "nz-input-prefix",
50
+ "data-slot": "input-prefix",
51
+ id: prefixId,
52
+ children: prefix
53
+ }),
54
+ /* @__PURE__ */ jsx("input", {
55
+ ...mergeProps(field.controlProps, rest),
56
+ type,
57
+ className: "nz-input-control",
58
+ "data-slot": "input-control"
59
+ }),
60
+ suffix != null && /* @__PURE__ */ jsx("span", {
61
+ className: "nz-input-suffix",
62
+ "data-slot": "input-suffix",
63
+ id: suffixId,
64
+ children: suffix
65
+ }),
66
+ trailingIcon != null && /* @__PURE__ */ jsx("span", {
67
+ className: "nz-input-icon",
68
+ "data-slot": "input-icon",
69
+ "aria-hidden": "true",
70
+ children: trailingIcon
71
+ })
72
+ ] })
73
+ });
74
+ }
75
+ function focusInput(event) {
76
+ const input = event.currentTarget.querySelector(":scope > .nz-input-control");
77
+ if (input === null || event.target === input || input.disabled) return;
78
+ event.preventDefault();
79
+ input.focus();
80
+ }
81
+ //#endregion
82
+ export { Input };
@@ -0,0 +1,2 @@
1
+ import { Kbd, KbdPlatform, KbdProps } from "./kbd.js";
2
+ export { Kbd, type KbdPlatform, type KbdProps };
@@ -0,0 +1 @@
1
+ export { Kbd } from "./kbd.js";
@@ -0,0 +1,19 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
3
+ //#region src/kbd/kbd.d.ts
4
+ /** The `data-platform` values of the glyph spans; they match `data-nz-platform` (§8.3). */
5
+ export type KbdPlatform = "apple" | "other";
6
+ export interface KbdProps extends ComponentPropsWithRef<"kbd"> {
7
+ /**
8
+ * A shortcut such as `"mod+k"` or `"mod+shift+d"`, drawn for both platforms (`⌘⇧D` and
9
+ * `Ctrl+Shift+D`); CSS shows the one `data-nz-platform` names, and `other` when no ancestor sets it.
10
+ * `mod` is ⌘ on Apple platforms and Ctrl elsewhere; the plus key is `plus` (`"mod+plus"`, or
11
+ * `"mod++"`). Replaces `children`.
12
+ */
13
+ keys?: string;
14
+ /** Literal key text, for example `<Kbd>esc</Kbd>` or `<Kbd>↑↓</Kbd>`. */
15
+ children?: ReactNode;
16
+ render?: RenderProp<Record<string, never>>;
17
+ }
18
+ export declare function Kbd({ keys, render, className, children, ...rest }: KbdProps): ReactElement;
19
+ //#endregion
@@ -0,0 +1,68 @@
1
+ import { cx } from "../_internal/cx.js";
2
+ import { renderElement } from "../contracts/render.js";
3
+ import { splitKeys } from "../_internal/keys.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/kbd/kbd.tsx
6
+ /** Key name → [Apple glyph, other platforms]. Anything else is drawn as written; one letter is uppercased. */
7
+ const KEYS = {
8
+ mod: ["⌘", "Ctrl"],
9
+ cmd: ["⌘", "Win"],
10
+ command: ["⌘", "Win"],
11
+ meta: ["⌘", "Win"],
12
+ ctrl: ["⌃", "Ctrl"],
13
+ control: ["⌃", "Ctrl"],
14
+ alt: ["⌥", "Alt"],
15
+ option: ["⌥", "Alt"],
16
+ shift: ["⇧", "Shift"],
17
+ enter: ["↵", "Enter"],
18
+ return: ["↵", "Enter"],
19
+ esc: ["esc", "esc"],
20
+ escape: ["esc", "esc"],
21
+ tab: ["⇥", "Tab"],
22
+ backspace: ["⌫", "Backspace"],
23
+ delete: ["⌦", "Del"],
24
+ space: ["Space", "Space"],
25
+ plus: ["+", "+"],
26
+ up: ["↑", "↑"],
27
+ down: ["↓", "↓"],
28
+ left: ["←", "←"],
29
+ right: ["→", "→"]
30
+ };
31
+ /** `"mod+shift+d"` → `["⌘⇧D", "Ctrl+Shift+D"]`: Apple glyphs run together, others join with `+`. */
32
+ function formatKeys(keys) {
33
+ const apple = [];
34
+ const other = [];
35
+ for (const key of splitKeys(keys)) {
36
+ const known = KEYS[key.toLowerCase()];
37
+ const text = key.length === 1 ? key.toUpperCase() : key;
38
+ apple.push(known?.[0] ?? text);
39
+ other.push(known?.[1] ?? text);
40
+ }
41
+ return [apple.join(""), other.join("+")];
42
+ }
43
+ function Kbd({ keys, render, className, children, ...rest }) {
44
+ return renderElement("kbd", render, {}, {
45
+ "data-slot": "kbd",
46
+ ...rest,
47
+ className: cx("nz-kbd", className),
48
+ children: keys === void 0 ? children : glyphs(keys)
49
+ });
50
+ }
51
+ /** One span per platform when they differ; CSS hides the other (kbd.css). */
52
+ function glyphs(keys) {
53
+ const [apple, other] = formatKeys(keys);
54
+ if (apple === other) return apple;
55
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
56
+ className: "nz-kbd-glyphs",
57
+ "data-slot": "kbd-glyphs",
58
+ "data-platform": "apple",
59
+ children: apple
60
+ }), /* @__PURE__ */ jsx("span", {
61
+ className: "nz-kbd-glyphs",
62
+ "data-slot": "kbd-glyphs",
63
+ "data-platform": "other",
64
+ children: other
65
+ })] });
66
+ }
67
+ //#endregion
68
+ export { Kbd };
@@ -0,0 +1,2 @@
1
+ import { KpiTile, KpiTileProps, KpiTileState, KpiTileTone } from "./kpi-tile.js";
2
+ export { KpiTile, type KpiTileProps, type KpiTileState, type KpiTileTone };
@@ -0,0 +1 @@
1
+ export { KpiTile } from "./kpi-tile.js";
@@ -0,0 +1,30 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { DataStatus } from "../_internal/data-status.js";
3
+ import { MetricDataProps } from "../metric/metric.js";
4
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
5
+ //#region src/kpi-tile/kpi-tile.d.ts
6
+ /** Figma "Tone": Surface, or Tinted as `brand` or `accent` (Card's tones of the same names). */
7
+ export type KpiTileTone = "surface" | "brand" | "accent";
8
+ export interface KpiTileState {
9
+ /** The status as rendered: `'empty'` when a ready tile has no value. */
10
+ status: DataStatus;
11
+ pending: boolean;
12
+ tone: KpiTileTone;
13
+ }
14
+ export interface KpiTileProps extends MetricDataProps, Omit<ComponentPropsWithRef<"div">, "children"> {
15
+ /** The surface; group a row of related KPIs with one tint. @default 'surface' */
16
+ tone?: KpiTileTone;
17
+ /**
18
+ * A small chart beside the value, shown while ready, for example
19
+ * `<Sparkline data={series} label="Sales, last 7 days" />` from `@nizivo/charts`. Drawn at most
20
+ * 88 × 28 px (Figma).
21
+ */
22
+ chart?: ReactNode;
23
+ render?: RenderProp<KpiTileState>;
24
+ }
25
+ /**
26
+ * One number, its change and its shape. A `role="group"` named by the label (not a landmark). The
27
+ * Suspense fallback is the same tile with `status="loading"`: the box does not change (§16.5).
28
+ */
29
+ export declare function KpiTile({ label, value, format, locale, delta, comparison, chart, tone, status, pending, empty, error, labels, render, className, ...rest }: KpiTileProps): ReactElement;
30
+ //#endregion
@@ -0,0 +1,48 @@
1
+ import { cx } from "../_internal/cx.js";
2
+ import { renderElement } from "../contracts/render.js";
3
+ import { dataStatusAttrs } from "../_internal/data-status.js";
4
+ import { Metric, resolveStatus } from "../metric/metric.js";
5
+ import { useId } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ //#region src/kpi-tile/kpi-tile.tsx
8
+ /**
9
+ * One number, its change and its shape. A `role="group"` named by the label (not a landmark). The
10
+ * Suspense fallback is the same tile with `status="loading"`: the box does not change (§16.5).
11
+ */
12
+ function KpiTile({ label, value, format, locale, delta, comparison, chart, tone = "surface", status = "ready", pending = false, empty, error, labels, render, className, ...rest }) {
13
+ const labelId = useId();
14
+ const st = resolveStatus(status, value);
15
+ const busy = st === "ready" && pending;
16
+ return renderElement("div", render, {
17
+ status: st,
18
+ pending: busy,
19
+ tone
20
+ }, {
21
+ "data-slot": "kpi-tile",
22
+ "data-tone": tone,
23
+ "data-padding": "sm",
24
+ ...dataStatusAttrs(st, busy),
25
+ role: "group",
26
+ "aria-labelledby": labelId,
27
+ ...rest,
28
+ className: cx("nz-card", "nz-kpi-tile", className),
29
+ children: /* @__PURE__ */ jsx(Metric, {
30
+ labelId,
31
+ label,
32
+ value,
33
+ format,
34
+ locale,
35
+ delta,
36
+ comparison,
37
+ chart,
38
+ status,
39
+ pending,
40
+ empty,
41
+ error,
42
+ labels,
43
+ reserveChange: true
44
+ })
45
+ });
46
+ }
47
+ //#endregion
48
+ export { KpiTile };
@@ -0,0 +1,77 @@
1
+ import { AlertDismissLabels } from "../alert/alert-dismiss.client.js";
2
+ import "../alert/index.js";
3
+ import { AppShellLabels } from "../app-shell/app-shell.js";
4
+ import "../app-shell/index.js";
5
+ import { AvatarGroupLabels } from "../avatar/avatar.js";
6
+ import "../avatar/index.js";
7
+ import { BannerDismissLabels } from "../banner/banner-dismiss.client.js";
8
+ import "../banner/index.js";
9
+ import { BreadcrumbLabels } from "../breadcrumb/breadcrumb.js";
10
+ import "../breadcrumb/index.js";
11
+ import { ButtonLabels } from "../button/button.js";
12
+ import "../button/index.js";
13
+ import { ChipGroupLabels } from "../chip-group/chip-group.client.js";
14
+ import "../chip-group/index.js";
15
+ import { DialogLabels } from "../dialog/dialog.contract.js";
16
+ import "../dialog/index.js";
17
+ import { DrawerLabels } from "../drawer/drawer.contract.js";
18
+ import "../drawer/index.js";
19
+ import { FileUploadLabels } from "../file-upload/file-upload.contract.js";
20
+ import "../file-upload/index.js";
21
+ import { FormLabels } from "../form/form.client.js";
22
+ import "../form/index.js";
23
+ import { MetricLabels } from "../metric/metric.js";
24
+ import "../metric/index.js";
25
+ import { MobileTabBarLabels } from "../mobile-tab-bar/mobile-tab-bar.js";
26
+ import { MobileTabBarMoreLabels } from "../mobile-tab-bar/mobile-tab-bar-more.client.js";
27
+ import "../mobile-tab-bar/index.js";
28
+ import { PaginationLabels } from "../pagination/pagination.js";
29
+ import "../pagination/index.js";
30
+ import { PasswordInputLabels } from "../password-input/password-input.client.js";
31
+ import "../password-input/index.js";
32
+ import { PopoverLabels } from "../popover/popover.contract.js";
33
+ import "../popover/index.js";
34
+ import { RankedListLabels } from "../ranked-list/ranked-list.js";
35
+ import "../ranked-list/index.js";
36
+ import { SearchFieldLabels } from "../search-field/search-field.client.js";
37
+ import "../search-field/index.js";
38
+ import { SidebarLabels } from "../sidebar/sidebar.js";
39
+ import "../sidebar/index.js";
40
+ import { TableSelectionLabels } from "../table-selection/table-selection.js";
41
+ import "../table-selection/index.js";
42
+ import { ToasterLabels } from "../toast/toast.contract.js";
43
+ import "../toast/index.js";
44
+ //#region src/locales/en-US.d.ts
45
+ /**
46
+ * The en-US strings of every component that takes `labels`, keyed by component: pass
47
+ * `labels={enUS.pagination}` or a catalogue of the same shape for another locale
48
+ * (`const deDE: typeof enUS = { … }`). Count-bearing strings (`avatarGroup`) may be plural
49
+ * objects in other locales (`PluralLabel` from `@nizivo/react/i18n`).
50
+ */
51
+ export declare const enUS: {
52
+ alertDismiss: AlertDismissLabels;
53
+ appShell: AppShellLabels;
54
+ avatarGroup: AvatarGroupLabels;
55
+ bannerDismiss: BannerDismissLabels;
56
+ breadcrumb: BreadcrumbLabels;
57
+ button: ButtonLabels;
58
+ chipGroup: ChipGroupLabels;
59
+ dialog: Pick<DialogLabels, "close">;
60
+ drawer: Pick<DrawerLabels, "close">;
61
+ fileUpload: FileUploadLabels;
62
+ form: FormLabels;
63
+ kpiTile: MetricLabels;
64
+ metric: MetricLabels;
65
+ mobileTabBar: MobileTabBarLabels;
66
+ mobileTabBarMore: MobileTabBarMoreLabels;
67
+ pagination: PaginationLabels;
68
+ passwordInput: PasswordInputLabels;
69
+ popover: Pick<PopoverLabels, "close">;
70
+ rankedList: RankedListLabels;
71
+ searchField: SearchFieldLabels;
72
+ sidebar: SidebarLabels;
73
+ tableSelection: TableSelectionLabels;
74
+ toaster: ToasterLabels;
75
+ trendCard: MetricLabels;
76
+ };
77
+ //#endregion
@@ -0,0 +1,83 @@
1
+ //#region src/locales/en-US.ts
2
+ /**
3
+ * The en-US strings of every component that takes `labels`, keyed by component: pass
4
+ * `labels={enUS.pagination}` or a catalogue of the same shape for another locale
5
+ * (`const deDE: typeof enUS = { … }`). Count-bearing strings (`avatarGroup`) may be plural
6
+ * objects in other locales (`PluralLabel` from `@nizivo/react/i18n`).
7
+ */
8
+ const enUS = {
9
+ alertDismiss: { dismiss: "Dismiss" },
10
+ appShell: { skip: "Skip to content" },
11
+ avatarGroup: {
12
+ overflow: "+{count}",
13
+ more: "{count} more"
14
+ },
15
+ bannerDismiss: { dismiss: "Dismiss" },
16
+ breadcrumb: { nav: "Breadcrumb" },
17
+ button: { pending: "Loading…" },
18
+ chipGroup: { unavailable: "Unavailable" },
19
+ dialog: { close: "Close" },
20
+ drawer: { close: "Close" },
21
+ fileUpload: {
22
+ prompt: "Drop files here or {browse}",
23
+ browse: "browse",
24
+ release: "Release to add files",
25
+ summary: "{complete} of {total} uploaded",
26
+ wrongType: "{name} is not an accepted file type.",
27
+ tooLarge: "{name} is larger than {max}.",
28
+ tooMany: "{name} was not added: choose one file.",
29
+ list: "Chosen files",
30
+ remove: "Remove {name}",
31
+ retry: "Retry",
32
+ cancel: "Cancel",
33
+ uploading: "Uploading {name}",
34
+ complete: "Uploaded",
35
+ failed: "Upload failed"
36
+ },
37
+ form: { summaryTitle: "There is a problem" },
38
+ kpiTile: {
39
+ loading: "Loading {label}",
40
+ empty: "No data",
41
+ error: "Could not load {label}"
42
+ },
43
+ metric: {
44
+ loading: "Loading {label}",
45
+ empty: "No data",
46
+ error: "Could not load {label}"
47
+ },
48
+ mobileTabBar: { nav: "Primary" },
49
+ mobileTabBarMore: {
50
+ more: "More",
51
+ close: "Close"
52
+ },
53
+ pagination: {
54
+ nav: "Pagination",
55
+ previous: "Previous page",
56
+ next: "Next page",
57
+ page: "Page {page}"
58
+ },
59
+ passwordInput: { toggle: "Show password" },
60
+ popover: { close: "Close" },
61
+ rankedList: {
62
+ loading: "Loading {label}",
63
+ empty: "No data",
64
+ error: "Could not load {label}"
65
+ },
66
+ searchField: {
67
+ label: "Search",
68
+ clear: "Clear search"
69
+ },
70
+ sidebar: { nav: "Primary" },
71
+ tableSelection: { selectAll: "Select all rows" },
72
+ toaster: {
73
+ region: "Notifications (F8)",
74
+ dismiss: "Dismiss"
75
+ },
76
+ trendCard: {
77
+ loading: "Loading {label}",
78
+ empty: "No data",
79
+ error: "Could not load {label}"
80
+ }
81
+ };
82
+ //#endregion
83
+ export { enUS };
@@ -0,0 +1,5 @@
1
+ import { OpenReason } from "../contracts/details.js";
2
+ import { MenuCheckboxItemProps, MenuCheckedReason, MenuGroupLabelProps, MenuGroupProps, MenuItemProps, MenuItemState, MenuItemTone, MenuLabels, MenuPopupProps, MenuPopupState, MenuRadioGroupProps, MenuRadioItemProps, MenuRootProps, MenuSeparatorProps, MenuSide, MenuTriggerProps, MenuTriggerState } from "./menu.contract.js";
3
+ import { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger } from "./menu.client.js";
4
+ import { menu_parts_d_exports } from "./menu.parts.js";
5
+ export { menu_parts_d_exports as Menu, MenuCheckboxItem, type MenuCheckboxItemProps, type MenuCheckedReason, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, MenuItem, type MenuItemProps, type MenuItemState, type MenuItemTone, type MenuLabels, MenuPopup, type MenuPopupProps, type MenuPopupState, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuRoot, type MenuRootProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuTrigger, type MenuTriggerProps, type MenuTriggerState, type OpenReason };
@@ -0,0 +1,3 @@
1
+ import { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger } from "./menu.client.js";
2
+ import { menu_parts_exports } from "./menu.parts.js";
3
+ export { menu_parts_exports as Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger };
@@ -0,0 +1,14 @@
1
+ import { MenuCheckboxItemProps, MenuGroupLabelProps, MenuGroupProps, MenuItemProps, MenuPopupProps, MenuRadioGroupProps, MenuRadioItemProps, MenuRootProps, MenuSeparatorProps, MenuTriggerProps } from "./menu.contract.js";
2
+ import { JSX } from "react";
3
+ //#region src/menu/menu.client.d.ts
4
+ export declare function MenuRoot(props: MenuRootProps): JSX.Element;
5
+ export declare function MenuTrigger({ className, render, ...rest }: MenuTriggerProps): JSX.Element;
6
+ export declare function MenuPopup({ side, align, sideOffset, container, "aria-label": label, className, style, children }: MenuPopupProps): JSX.Element;
7
+ export declare function MenuItem({ className, tone, icon, shortcut, textValue, "aria-keyshortcuts": keyshortcuts, href, render, children, ...rest }: MenuItemProps): JSX.Element;
8
+ export declare function MenuCheckboxItem({ className, tone, icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }: MenuCheckboxItemProps): JSX.Element;
9
+ export declare function MenuRadioGroup({ className, render, ...rest }: MenuRadioGroupProps): JSX.Element;
10
+ export declare function MenuRadioItem({ className, tone, icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }: MenuRadioItemProps): JSX.Element;
11
+ export declare function MenuGroup({ className, render, ...rest }: MenuGroupProps): JSX.Element;
12
+ export declare function MenuGroupLabel({ className, render, ...rest }: MenuGroupLabelProps): JSX.Element;
13
+ export declare function MenuSeparator({ className, render, ...rest }: MenuSeparatorProps): JSX.Element;
14
+ //#endregion
@@ -0,0 +1,152 @@
1
+ "use client";
2
+ import { cx } from "../_internal/cx.js";
3
+ import { toRenderFn } from "../contracts/render.js";
4
+ import { CheckGlyph } from "../_internal/glyphs.js";
5
+ import { ariaKeyShortcuts } from "../_internal/keys.js";
6
+ import { Kbd } from "../kbd/kbd.js";
7
+ import { CheckboxItem, Group, GroupLabel, Item, Popup, RadioGroup, RadioItem, Root, Separator, Trigger } from "../_engines/react-aria/menu.client.js";
8
+ import { isValidElement } from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/menu/menu.client.tsx
11
+ const renderDiv = toRenderFn(void 0, "div");
12
+ function MenuRoot(props) {
13
+ return /* @__PURE__ */ jsx(Root, { ...props });
14
+ }
15
+ function MenuTrigger({ className, render, ...rest }) {
16
+ return /* @__PURE__ */ jsx(Trigger, {
17
+ ...rest,
18
+ className: cx("nz-menu-trigger", className),
19
+ "data-slot": "menu-trigger",
20
+ render: toRenderFn(render, "button")
21
+ });
22
+ }
23
+ function MenuPopup({ side = "bottom", align = "start", sideOffset = 8, container, "aria-label": label, className, style, children }) {
24
+ return /* @__PURE__ */ jsx(Popup, {
25
+ side,
26
+ align,
27
+ sideOffset,
28
+ container,
29
+ className: cx("nz-menu-popup", className),
30
+ style,
31
+ "data-slot": "menu-popup",
32
+ render: renderDiv,
33
+ list: {
34
+ className: "nz-menu-list",
35
+ "data-slot": "menu-list",
36
+ "aria-label": label
37
+ },
38
+ children
39
+ });
40
+ }
41
+ /**
42
+ * The row's content in Figma order. The inner spans carry classes only: every item kind shares them,
43
+ * and a `data-slot` belongs to one component. `indicator` is set only on checkbox and radio items.
44
+ */
45
+ function itemContent(icon, children, shortcut, indicator) {
46
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
47
+ icon != null && /* @__PURE__ */ jsx("span", {
48
+ className: "nz-menu-item-icon",
49
+ "aria-hidden": "true",
50
+ children: icon
51
+ }),
52
+ /* @__PURE__ */ jsx("span", {
53
+ className: "nz-menu-item-label",
54
+ children
55
+ }),
56
+ shortcut !== void 0 && /* @__PURE__ */ jsx(Kbd, {
57
+ keys: shortcut,
58
+ className: "nz-menu-item-shortcut",
59
+ "aria-hidden": "true"
60
+ }),
61
+ indicator !== void 0 && /* @__PURE__ */ jsx("span", {
62
+ className: "nz-menu-item-indicator",
63
+ "aria-hidden": "true",
64
+ children: indicator ?? /* @__PURE__ */ jsx(CheckGlyph, {})
65
+ })
66
+ ] });
67
+ }
68
+ /** Typeahead text and the announced shortcut, shared by every item kind. */
69
+ function itemBehaviour(children, textValue, shortcut, keyshortcuts) {
70
+ return {
71
+ textValue: textValue ?? (typeof children === "string" ? children : void 0),
72
+ "aria-keyshortcuts": keyshortcuts ?? (shortcut === void 0 ? void 0 : ariaKeyShortcuts(shortcut))
73
+ };
74
+ }
75
+ /** The `href` of a `render={<Link href="…" />}` element, which makes the item a link item (§9.3 rule 3). */
76
+ function elementHref(render) {
77
+ if (!isValidElement(render)) return void 0;
78
+ const { href } = render.props;
79
+ return typeof href === "string" ? href : void 0;
80
+ }
81
+ function MenuItem({ className, tone = "neutral", icon, shortcut, textValue, "aria-keyshortcuts": keyshortcuts, href, render, children, ...rest }) {
82
+ const link = href ?? elementHref(render);
83
+ return /* @__PURE__ */ jsx(Item, {
84
+ ...rest,
85
+ ...itemBehaviour(children, textValue, shortcut, keyshortcuts),
86
+ className: cx("nz-menu-item", className),
87
+ "data-slot": "menu-item",
88
+ "data-tone": tone,
89
+ "data-focus-inset": "",
90
+ href: link,
91
+ render: toRenderFn(render, link === void 0 ? "div" : "a"),
92
+ children: itemContent(icon, children, shortcut)
93
+ });
94
+ }
95
+ function MenuCheckboxItem({ className, tone = "neutral", icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }) {
96
+ return /* @__PURE__ */ jsx(CheckboxItem, {
97
+ ...rest,
98
+ ...itemBehaviour(children, textValue, shortcut, keyshortcuts),
99
+ className: cx("nz-menu-checkbox-item", className),
100
+ "data-slot": "menu-checkbox-item",
101
+ "data-tone": tone,
102
+ "data-focus-inset": "",
103
+ render: toRenderFn(render, "div"),
104
+ children: itemContent(icon, children, shortcut, indicator ?? null)
105
+ });
106
+ }
107
+ function MenuRadioGroup({ className, render, ...rest }) {
108
+ return /* @__PURE__ */ jsx(RadioGroup, {
109
+ ...rest,
110
+ className: cx("nz-menu-radio-group", className),
111
+ "data-slot": "menu-radio-group",
112
+ render: toRenderFn(render, "section")
113
+ });
114
+ }
115
+ function MenuRadioItem({ className, tone = "neutral", icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }) {
116
+ return /* @__PURE__ */ jsx(RadioItem, {
117
+ ...rest,
118
+ ...itemBehaviour(children, textValue, shortcut, keyshortcuts),
119
+ className: cx("nz-menu-radio-item", className),
120
+ "data-slot": "menu-radio-item",
121
+ "data-tone": tone,
122
+ "data-focus-inset": "",
123
+ render: toRenderFn(render, "div"),
124
+ children: itemContent(icon, children, shortcut, indicator ?? null)
125
+ });
126
+ }
127
+ function MenuGroup({ className, render, ...rest }) {
128
+ return /* @__PURE__ */ jsx(Group, {
129
+ ...rest,
130
+ className: cx("nz-menu-group", className),
131
+ "data-slot": "menu-group",
132
+ render: toRenderFn(render, "section")
133
+ });
134
+ }
135
+ function MenuGroupLabel({ className, render, ...rest }) {
136
+ return /* @__PURE__ */ jsx(GroupLabel, {
137
+ ...rest,
138
+ className: cx("nz-menu-group-label", className),
139
+ "data-slot": "menu-group-label",
140
+ render: toRenderFn(render, "header")
141
+ });
142
+ }
143
+ function MenuSeparator({ className, render, ...rest }) {
144
+ return /* @__PURE__ */ jsx(Separator, {
145
+ ...rest,
146
+ className: cx("nz-menu-separator", className),
147
+ "data-slot": "menu-separator",
148
+ render: toRenderFn(render, "div")
149
+ });
150
+ }
151
+ //#endregion
152
+ export { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger };