@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,87 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ //#region src/_internal/glyphs.tsx
3
+ function svg(name, paths) {
4
+ return /* @__PURE__ */ jsx("svg", {
5
+ className: `nz-glyph nz-glyph-${name}`,
6
+ viewBox: "0 0 24 24",
7
+ width: "1em",
8
+ height: "1em",
9
+ fill: "none",
10
+ stroke: "currentColor",
11
+ strokeWidth: 1.92,
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ "aria-hidden": "true",
15
+ focusable: "false",
16
+ children: paths
17
+ });
18
+ }
19
+ const SpinnerGlyph = () => svg("spinner", /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }));
20
+ /** Lucide's `chevron-right`: the Breadcrumb separator, and Pagination's next (turned for previous). */
21
+ const ChevronGlyph = () => svg("chevron", /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" }));
22
+ const ChevronsUpDownGlyph = () => svg("chevrons-up-down", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "m7 15 5 5 5-5" }), /* @__PURE__ */ jsx("path", { d: "m7 9 5-5 5 5" })] }));
23
+ const CircleXGlyph = () => svg("circle-x", /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx("circle", {
25
+ cx: "12",
26
+ cy: "12",
27
+ r: "10"
28
+ }),
29
+ /* @__PURE__ */ jsx("path", { d: "m15 9-6 6" }),
30
+ /* @__PURE__ */ jsx("path", { d: "m9 9 6 6" })
31
+ ] }));
32
+ const CircleCheckGlyph = () => svg("circle-check", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
33
+ cx: "12",
34
+ cy: "12",
35
+ r: "10"
36
+ }), /* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })] }));
37
+ const InfoGlyph = () => svg("info", /* @__PURE__ */ jsxs(Fragment, { children: [
38
+ /* @__PURE__ */ jsx("circle", {
39
+ cx: "12",
40
+ cy: "12",
41
+ r: "10"
42
+ }),
43
+ /* @__PURE__ */ jsx("path", { d: "M12 16v-4" }),
44
+ /* @__PURE__ */ jsx("path", { d: "M12 8h.01" })
45
+ ] }));
46
+ const CloseGlyph = () => svg("close", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })] }));
47
+ const CheckGlyph = () => svg("check", /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }));
48
+ const MinusGlyph = () => svg("minus", /* @__PURE__ */ jsx("path", { d: "M5 12h14" }));
49
+ /** PasswordInput's toggle while the password is hidden. */
50
+ const EyeGlyph = () => svg("eye", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }), /* @__PURE__ */ jsx("circle", {
51
+ cx: "12",
52
+ cy: "12",
53
+ r: "3"
54
+ })] }));
55
+ /** PasswordInput's toggle while the password is shown. */
56
+ const EyeOffGlyph = () => svg("eye-off", /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsx("path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }),
58
+ /* @__PURE__ */ jsx("path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }),
59
+ /* @__PURE__ */ jsx("path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }),
60
+ /* @__PURE__ */ jsx("path", { d: "m2 2 20 20" })
61
+ ] }));
62
+ /** SearchField's magnifier. */
63
+ const SearchGlyph = () => svg("search", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "m21 21-4.34-4.34" }), /* @__PURE__ */ jsx("circle", {
64
+ cx: "11",
65
+ cy: "11",
66
+ r: "8"
67
+ })] }));
68
+ /** Lucide's `ellipsis` (Feather's `more-horizontal`): MobileTabBar's More. */
69
+ const EllipsisGlyph = () => svg("ellipsis", /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ /* @__PURE__ */ jsx("circle", {
71
+ cx: "12",
72
+ cy: "12",
73
+ r: "1"
74
+ }),
75
+ /* @__PURE__ */ jsx("circle", {
76
+ cx: "19",
77
+ cy: "12",
78
+ r: "1"
79
+ }),
80
+ /* @__PURE__ */ jsx("circle", {
81
+ cx: "5",
82
+ cy: "12",
83
+ r: "1"
84
+ })
85
+ ] }));
86
+ //#endregion
87
+ export { CheckGlyph, ChevronGlyph, ChevronsUpDownGlyph, CircleCheckGlyph, CircleXGlyph, CloseGlyph, EllipsisGlyph, EyeGlyph, EyeOffGlyph, InfoGlyph, MinusGlyph, SearchGlyph, SpinnerGlyph };
@@ -0,0 +1,62 @@
1
+ //#region src/_internal/keys.ts
2
+ /**
3
+ * `"mod+shift+d"` → `["mod", "shift", "d"]`. The plus key is `plus`, or a `+` where a key is due:
4
+ * `"mod++"` and `"mod+plus"` are both ⌘ and +.
5
+ */
6
+ function splitKeys(keys) {
7
+ const parts = keys.split("+").map((part) => part.trim());
8
+ const out = [];
9
+ for (let index = 0; index < parts.length; index += 1) {
10
+ const part = parts[index] ?? "";
11
+ if (part !== "") out.push(part);
12
+ else if (parts[index + 1] === "") {
13
+ out.push("+");
14
+ index += 1;
15
+ }
16
+ }
17
+ return out;
18
+ }
19
+ /** Key name → its `aria-keyshortcuts` name (WAI-ARIA 1.2, UI Events `key` values). */
20
+ const ARIA = {
21
+ cmd: "Meta",
22
+ command: "Meta",
23
+ meta: "Meta",
24
+ ctrl: "Control",
25
+ control: "Control",
26
+ alt: "Alt",
27
+ option: "Alt",
28
+ shift: "Shift",
29
+ enter: "Enter",
30
+ return: "Enter",
31
+ esc: "Escape",
32
+ escape: "Escape",
33
+ tab: "Tab",
34
+ backspace: "Backspace",
35
+ delete: "Delete",
36
+ space: "Space",
37
+ plus: "Plus",
38
+ "+": "Plus",
39
+ up: "ArrowUp",
40
+ down: "ArrowDown",
41
+ left: "ArrowLeft",
42
+ right: "ArrowRight"
43
+ };
44
+ /** One key's `aria-keyshortcuts` name; `mod` is the platform's command key, given by the caller. */
45
+ function ariaName(key, mod) {
46
+ const lower = key.toLowerCase();
47
+ if (lower === "mod") return mod;
48
+ return ARIA[lower] ?? (key.length === 1 ? key.toUpperCase() : key);
49
+ }
50
+ /**
51
+ * `"mod+b"` → `"Meta+B Control+B"`. The server does not know the platform, so `mod` lists both
52
+ * alternatives (space-separated, as the attribute allows); one letter is uppercased.
53
+ */
54
+ function ariaKeyShortcuts(keys) {
55
+ const parts = splitKeys(keys);
56
+ if (parts.length === 0) return void 0;
57
+ const apple = parts.map((key) => ariaName(key, "Meta")).join("+");
58
+ const other = parts.map((key) => ariaName(key, "Control")).join("+");
59
+ return apple === other ? apple : `${apple} ${other}`;
60
+ }
61
+ //#endregion
62
+ export { ariaKeyShortcuts, splitKeys };
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { createContext, use, useLayoutEffect, useMemo, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/_internal/modal.client.tsx
5
+ const NestingContext = createContext(null);
6
+ /**
7
+ * The nesting state of one modal popup: the modal it was opened from (`parent`, null at the root),
8
+ * whether a modal opened from it is open (`childOpen`), and its own `nesting`, which
9
+ * `ModalNestingScope` hands to the modals opened inside it.
10
+ */
11
+ function useModalNesting() {
12
+ const parent = use(NestingContext);
13
+ const [openChildren, setOpenChildren] = useState(0);
14
+ return {
15
+ parent,
16
+ nesting: useMemo(() => ({ childOpened: (delta) => setOpenChildren((n) => n + delta) }), []),
17
+ childOpen: openChildren > 0
18
+ };
19
+ }
20
+ /** Wraps a modal popup's children: modals opened inside report to it, and it reports to its parent. */
21
+ function ModalNestingScope({ parent, nesting, children }) {
22
+ return /* @__PURE__ */ jsxs(NestingContext, {
23
+ value: nesting,
24
+ children: [parent !== null && /* @__PURE__ */ jsx(OpenSignal, { parent }), children]
25
+ });
26
+ }
27
+ /** Mounted only while this popup's content is mounted, i.e. while it is open. */
28
+ function OpenSignal({ parent }) {
29
+ useLayoutEffect(() => {
30
+ parent.childOpened(1);
31
+ return () => parent.childOpened(-1);
32
+ }, [parent]);
33
+ return null;
34
+ }
35
+ const TABBABLE = "a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable=\"false\"])";
36
+ /** The first tabbable, enabled, rendered element inside `root`, if any. */
37
+ function firstTabbable(root) {
38
+ if (root === null) return null;
39
+ for (const element of root.querySelectorAll(TABBABLE)) if (element.tabIndex >= 0 && !element.matches(":disabled") && element.getClientRects().length > 0) return element;
40
+ return null;
41
+ }
42
+ /**
43
+ * Focus on open (§12.2) for a modal leaf whose slots start with `name`: an element the consumer
44
+ * marked `autoFocus` keeps it (the engine sees focus inside and leaves it); an alertdialog focuses
45
+ * its least destructive action, the first `<name>-close` in its footer, else any; a dialog focuses
46
+ * the first tabbable element in its `<name>-body`; otherwise the engine focuses the popup itself, so
47
+ * a long text starts at its top.
48
+ */
49
+ function initialFocus(name, role) {
50
+ const close = `[data-slot="${name}-close"]:not(:disabled)`;
51
+ return (content) => role === "alertdialog" ? content.querySelector(`[data-slot="${name}-footer"] ${close}`) ?? content.querySelector(close) : firstTabbable(content.querySelector(`[data-slot="${name}-body"]`));
52
+ }
53
+ //#endregion
54
+ export { ModalNestingScope, firstTabbable, initialFocus, useModalNesting };
@@ -0,0 +1,33 @@
1
+ //#region src/_internal/nested-focus.ts
2
+ /**
3
+ * True while an input's keydown is being handled. An arrow key moves focus to the next radio as the
4
+ * keydown's default action, in the same task, so a focus seen while this is set came from a key.
5
+ */
6
+ let keyDown = false;
7
+ function markKeyDown() {
8
+ keyDown = true;
9
+ setTimeout(() => {
10
+ keyDown = false;
11
+ }, 0);
12
+ }
13
+ /**
14
+ * WebKit does not match :focus-visible on a radio reached with an arrow key, so the label marks a
15
+ * keyboard focus itself (nz.base draws the outline for `[data-focus-visible]`). Written on the DOM,
16
+ * not through state: re-rendering a focused radio makes React re-write its `name`, and Chromium then
17
+ * stops treating an unchecked group as one Tab stop.
18
+ */
19
+ function markFocus(event) {
20
+ const visible = event.currentTarget.matches(":focus-visible") || keyDown;
21
+ event.currentTarget.parentElement?.toggleAttribute("data-focus-visible", visible);
22
+ }
23
+ function clearFocus(event) {
24
+ event.currentTarget.parentElement?.removeAttribute("data-focus-visible");
25
+ }
26
+ /** Drops `undefined` values, so a spread never writes an empty attribute or handler. */
27
+ function definedProps(props) {
28
+ const out = {};
29
+ for (const [key, value] of Object.entries(props)) if (value !== void 0) out[key] = value;
30
+ return out;
31
+ }
32
+ //#endregion
33
+ export { clearFocus, definedProps, markFocus, markKeyDown };
@@ -0,0 +1,9 @@
1
+ import { CSSProperties, ReactElement, ReactNode, RefObject } from "react";
2
+ //#region src/_internal/overlay.d.ts
3
+ /**
4
+ * Where focus goes when an overlay closes (§12.2 Focus return): `true` follows the chain (the
5
+ * trigger, else the parent overlay's trigger), an element ref or a function returning an element
6
+ * goes there first while it is on the page, and `false` leaves focus alone.
7
+ */
8
+ export type ReturnFocusTarget = boolean | RefObject<HTMLElement | null> | (() => HTMLElement | null | undefined);
9
+ //#endregion
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,32 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
3
+ //#region src/alert/alert-dismiss.client.d.ts
4
+ /** Strings this part renders (§16.4). */
5
+ export interface AlertDismissLabels {
6
+ /** The button's accessible name. @default 'Dismiss' */
7
+ dismiss: string;
8
+ }
9
+ export interface AlertDismissProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
10
+ /**
11
+ * Called with no arguments, so a Server Component can pass a Server Action. The Alert does not hide
12
+ * itself: the caller stops rendering it.
13
+ */
14
+ onDismiss?: () => void;
15
+ labels?: Partial<AlertDismissLabels>;
16
+ /** The close glyph, decorative. Defaults to the internal `close` glyph (Lucide's `x`). */
17
+ children?: ReactNode;
18
+ /**
19
+ * Your element in place of the default IconButton; it must render a `<button>`. A plain element
20
+ * keeps its own look. An IconButton, for example
21
+ * `render={<IconButton icon={<X />} label="Dismiss" variant="tertiary" size="sm" />}` to add its
22
+ * tooltip, keeps its variant and size, and in an Alert takes the dismiss slot's placement (made for
23
+ * `sm`) and icon/secondary glyph colour, as a composed IconButton does in `Dialog.Close`.
24
+ */
25
+ render?: RenderProp<Record<string, never>>;
26
+ }
27
+ /**
28
+ * With no `render`, an IconButton (tertiary, `sm`: the 16 px glyph Figma draws, in a 32 px target)
29
+ * with no tooltip, as `Dialog.Close` does.
30
+ */
31
+ export declare function AlertDismiss({ onDismiss, labels: labelsProp, "aria-label": ariaLabel, type, render, className, onClick, children, ...rest }: AlertDismissProps): ReactElement;
32
+ //#endregion
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { cx } from "../_internal/cx.js";
3
+ import { renderElement } from "../contracts/render.js";
4
+ import { useLabels } from "../config/config.client.js";
5
+ import { CloseGlyph } from "../_internal/glyphs.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ //#region src/alert/alert-dismiss.client.tsx
8
+ /**
9
+ * With no `render`, an IconButton (tertiary, `sm`: the 16 px glyph Figma draws, in a 32 px target)
10
+ * with no tooltip, as `Dialog.Close` does.
11
+ */
12
+ function AlertDismiss({ onDismiss, labels: labelsProp, "aria-label": ariaLabel, type, render, className, onClick, children, ...rest }) {
13
+ const labels = useLabels("alertDismiss", labelsProp);
14
+ const own = render === void 0;
15
+ return renderElement("button", render, {}, {
16
+ "data-slot": "alert-dismiss",
17
+ ...own && {
18
+ "data-variant": "tertiary",
19
+ "data-size": "sm"
20
+ },
21
+ ...rest,
22
+ type: own ? type ?? "button" : void 0,
23
+ "aria-label": ariaLabel ?? labels?.dismiss ?? "Dismiss",
24
+ className: cx("nz-alert-dismiss", own && "nz-icon-button", "nz-hit-target", className),
25
+ onClick: (event) => {
26
+ onClick?.(event);
27
+ if (!event.defaultPrevented) onDismiss?.();
28
+ },
29
+ children: /* @__PURE__ */ jsx("span", {
30
+ className: "nz-icon-button-icon",
31
+ "data-slot": "icon-button-icon",
32
+ "aria-hidden": "true",
33
+ children: children ?? /* @__PURE__ */ jsx(CloseGlyph, {})
34
+ })
35
+ });
36
+ }
37
+ //#endregion
38
+ export { AlertDismiss };
@@ -0,0 +1,28 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
3
+ //#region src/alert/alert.d.ts
4
+ /** Figma "Tone". */
5
+ export type AlertTone = "info" | "success" | "warning" | "critical";
6
+ export interface AlertState {
7
+ tone: AlertTone;
8
+ }
9
+ export interface AlertProps extends Omit<ComponentPropsWithRef<"div">, "title"> {
10
+ /** @default 'info' */
11
+ tone?: AlertTone;
12
+ /** One line, Label/M Strong. The description is `children`. */
13
+ title?: ReactNode;
14
+ /** Decorative tone glyph, for example `<CircleX />` for `critical`; the text carries the meaning. */
15
+ icon?: ReactNode;
16
+ /** Controls under the text, for example `<Button size="sm">Retry</Button>`. */
17
+ action?: ReactNode;
18
+ /** `<AlertDismiss onDismiss={…}>…</AlertDismiss>`; leave it out for an alert that cannot be dismissed. */
19
+ dismiss?: ReactNode;
20
+ /**
21
+ * There is no live role by default: an alert present on page load must not interrupt. Pass
22
+ * `role="status"` or `role="alert"` for one injected after a user action.
23
+ */
24
+ role?: ComponentPropsWithRef<"div">["role"];
25
+ render?: RenderProp<AlertState>;
26
+ }
27
+ export declare function Alert({ tone, title, icon, action, dismiss, render, className, children, ...rest }: AlertProps): ReactElement;
28
+ //#endregion
@@ -0,0 +1,44 @@
1
+ import { cx } from "../_internal/cx.js";
2
+ import { renderElement } from "../contracts/render.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/alert/alert.tsx
5
+ function Alert({ tone = "info", title, icon, action, dismiss, render, className, children, ...rest }) {
6
+ return renderElement("div", render, { tone }, {
7
+ "data-slot": "alert",
8
+ "data-tone": tone,
9
+ ...rest,
10
+ className: cx("nz-alert", className),
11
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ icon != null && /* @__PURE__ */ jsx("span", {
13
+ className: "nz-alert-icon",
14
+ "data-slot": "alert-icon",
15
+ "aria-hidden": "true",
16
+ children: icon
17
+ }),
18
+ /* @__PURE__ */ jsxs("div", {
19
+ className: "nz-alert-content",
20
+ "data-slot": "alert-content",
21
+ children: [
22
+ title != null && /* @__PURE__ */ jsx("div", {
23
+ className: "nz-alert-title",
24
+ "data-slot": "alert-title",
25
+ children: title
26
+ }),
27
+ children != null && children !== false && children !== "" && /* @__PURE__ */ jsx("div", {
28
+ className: "nz-alert-description",
29
+ "data-slot": "alert-description",
30
+ children
31
+ }),
32
+ action != null && /* @__PURE__ */ jsx("div", {
33
+ className: "nz-alert-action",
34
+ "data-slot": "alert-action",
35
+ children: action
36
+ })
37
+ ]
38
+ }),
39
+ dismiss
40
+ ] })
41
+ });
42
+ }
43
+ //#endregion
44
+ export { Alert };
@@ -0,0 +1,3 @@
1
+ import { Alert, AlertProps, AlertState, AlertTone } from "./alert.js";
2
+ import { AlertDismiss, AlertDismissLabels, AlertDismissProps } from "./alert-dismiss.client.js";
3
+ export { Alert, AlertDismiss, type AlertDismissLabels, type AlertDismissProps, type AlertProps, type AlertState, type AlertTone };
@@ -0,0 +1,3 @@
1
+ import { Alert } from "./alert.js";
2
+ import { AlertDismiss } from "./alert-dismiss.client.js";
3
+ export { Alert, AlertDismiss };
@@ -0,0 +1,24 @@
1
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
2
+ //#region src/app-shell/app-shell.d.ts
3
+ /** Strings this part renders (§16.4). */
4
+ export interface AppShellLabels {
5
+ /** The skip link, the first Tab stop. @default 'Skip to content' */
6
+ skip: string;
7
+ }
8
+ export interface AppShellProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
9
+ /** A `Sidebar`, shown from 640 px. */
10
+ sidebar?: ReactNode;
11
+ /** A `TopBar`, shown from 640 px. */
12
+ topBar?: ReactNode;
13
+ /** A `MobileTopBar`, shown below 640 px. */
14
+ mobileTopBar?: ReactNode;
15
+ /** A `MobileTabBar`, pinned to the bottom below 640 px. */
16
+ tabBar?: ReactNode;
17
+ /** The `<main>` element's id, the skip link's target. Generated when absent. */
18
+ mainId?: string;
19
+ labels?: Partial<AppShellLabels>;
20
+ /** The page, inside `<main>`. */
21
+ children: ReactNode;
22
+ }
23
+ export declare function AppShell({ sidebar, topBar, mobileTopBar, tabBar, mainId, labels, className, children, ...rest }: AppShellProps): ReactElement;
24
+ //#endregion
@@ -0,0 +1,56 @@
1
+ import { cx } from "../_internal/cx.js";
2
+ import { useId } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/app-shell/app-shell.tsx
5
+ function AppShell({ sidebar, topBar, mobileTopBar, tabBar, mainId, labels, className, children, ...rest }) {
6
+ const generated = useId();
7
+ const main = mainId ?? `nz-main${generated.replaceAll(/[^\w-]/g, "")}`;
8
+ return /* @__PURE__ */ jsxs("div", {
9
+ "data-slot": "app-shell",
10
+ ...rest,
11
+ className: cx("nz-app-shell", className),
12
+ children: [
13
+ /* @__PURE__ */ jsx("a", {
14
+ className: "nz-app-shell-skip",
15
+ "data-slot": "app-shell-skip",
16
+ href: `#${main}`,
17
+ children: labels?.skip ?? "Skip to content"
18
+ }),
19
+ sidebar != null && /* @__PURE__ */ jsx("div", {
20
+ className: "nz-app-shell-sidebar",
21
+ "data-slot": "app-shell-sidebar",
22
+ children: sidebar
23
+ }),
24
+ /* @__PURE__ */ jsxs("div", {
25
+ className: "nz-app-shell-frame",
26
+ "data-slot": "app-shell-frame",
27
+ children: [
28
+ topBar != null && /* @__PURE__ */ jsx("div", {
29
+ className: "nz-app-shell-top-bar",
30
+ "data-slot": "app-shell-top-bar",
31
+ children: topBar
32
+ }),
33
+ mobileTopBar != null && /* @__PURE__ */ jsx("div", {
34
+ className: "nz-app-shell-mobile-top-bar",
35
+ "data-slot": "app-shell-mobile-top-bar",
36
+ children: mobileTopBar
37
+ }),
38
+ /* @__PURE__ */ jsx("main", {
39
+ id: main,
40
+ tabIndex: -1,
41
+ className: "nz-app-shell-main",
42
+ "data-slot": "app-shell-main",
43
+ children
44
+ })
45
+ ]
46
+ }),
47
+ tabBar != null && /* @__PURE__ */ jsx("div", {
48
+ className: "nz-app-shell-tab-bar",
49
+ "data-slot": "app-shell-tab-bar",
50
+ children: tabBar
51
+ })
52
+ ]
53
+ });
54
+ }
55
+ //#endregion
56
+ export { AppShell };
@@ -0,0 +1,2 @@
1
+ import { AppShell, AppShellLabels, AppShellProps } from "./app-shell.js";
2
+ export { AppShell, type AppShellLabels, type AppShellProps };
@@ -0,0 +1 @@
1
+ export { AppShell } from "./app-shell.js";
@@ -0,0 +1,13 @@
1
+ //#region src/augment.d.ts
2
+ /** Button variants, as lowercase Figma names. Augment this interface to add one. */
3
+ export interface ButtonVariantMap {
4
+ primary: true;
5
+ secondary: true;
6
+ tertiary: true;
7
+ critical: true;
8
+ accent: true;
9
+ }
10
+ export type ButtonVariant = keyof ButtonVariantMap;
11
+ /** Control heights 32 / 40 / 48 px. */
12
+ export type ControlSize = "sm" | "md" | "lg";
13
+ //#endregion
File without changes
@@ -0,0 +1,96 @@
1
+ import { RenderProp } from "../contracts/render.js";
2
+ import { PluralLabel } from "../i18n/format-label.js";
3
+ import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
4
+ //#region src/avatar/avatar.d.ts
5
+ /** Figma "Size": Sm 24, Md 32, Lg 40, XL 56 px. */
6
+ export type AvatarSize = "sm" | "md" | "lg" | "xl";
7
+ export interface AvatarState {
8
+ size: AvatarSize;
9
+ /** An image source or `image` element was given. */
10
+ image: boolean;
11
+ decorative: boolean;
12
+ }
13
+ export interface AvatarProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
14
+ /**
15
+ * The person's or store's name. It is the avatar's accessible name (unless `decorative`) and the
16
+ * source of the initials.
17
+ */
18
+ name: string;
19
+ /**
20
+ * The photo. Without it (or `image`), the initials show. Pass it only when the image is known to
21
+ * load: if it fails, Chromium and Firefox show the initials, but WebKit (Safari) draws its
22
+ * broken-image mark over them, and no script-free markup avoids that. For a URL that may be gone,
23
+ * check it on the server and leave `src` out (the initials render), or render the initials alone.
24
+ */
25
+ src?: string;
26
+ /** Passed to the `<img>` with `src`. */
27
+ srcSet?: string;
28
+ sizes?: string;
29
+ /**
30
+ * A framework image element in place of `src`, for example `image={<NextImage src={photo} alt="" />}`.
31
+ * It is cloned with the image slot's class and `alt=""`, and laid over the initials like `src`.
32
+ */
33
+ image?: ReactElement<{
34
+ className?: string | undefined;
35
+ }>;
36
+ /**
37
+ * Replaces the initials derived from `name` (the first letters of the first and last words).
38
+ * Figma: at most two letters.
39
+ */
40
+ initials?: string;
41
+ /** @default 'md' */
42
+ size?: AvatarSize;
43
+ /**
44
+ * The name is printed next to the avatar, so the avatar is hidden from assistive technology
45
+ * (Figma: `alt=""` when the name is printed next to it). @default false
46
+ */
47
+ decorative?: boolean;
48
+ /** Composition of the root `<span>`. */
49
+ render?: RenderProp<AvatarState>;
50
+ }
51
+ /**
52
+ * A person's or store's photo laid over their initials, with no script: the initials are always
53
+ * rendered, so a missing photo needs no `onError`. Known limit: a `src` that fails to load shows
54
+ * WebKit's (Safari's) broken-image mark over the initials, with no script-free fix; pass `src` only
55
+ * when it is known to load, or leave it out and the initials show.
56
+ */
57
+ export declare function Avatar({ name, src, srcSet, sizes, image, initials, size, decorative, render, className, ...rest }: AvatarProps): ReactElement;
58
+ /**
59
+ * AvatarGroup's own strings (§16.4): serialisable, English defaults. `{count}` is replaced by the
60
+ * formatted count, and a `PluralLabel` (`{ one, few, many, other }`, the locale's CLDR categories)
61
+ * picks its template by that count through `formatLabel`.
62
+ */
63
+ export interface AvatarGroupLabels {
64
+ /** The visible count after the shown avatars. @default '+{count}' */
65
+ overflow: string | PluralLabel;
66
+ /** The count's words in the group's accessible name ("Maya, Jonah, Priya and 4 more"). @default '{count} more' */
67
+ more: string | PluralLabel;
68
+ }
69
+ export interface AvatarGroupState {
70
+ size: AvatarSize;
71
+ /** People not shown as an avatar. */
72
+ hidden: number;
73
+ }
74
+ export interface AvatarGroupProps extends ComponentPropsWithRef<"span"> {
75
+ /** How many avatars to show before the count. Figma: up to 3. @default 3 */
76
+ max?: number;
77
+ /**
78
+ * Everyone in the group, when it is more than the avatars passed (the server sends three faces and
79
+ * a count). @default the number of avatars
80
+ */
81
+ total?: number;
82
+ /** Applied to every avatar and the count. @default 'md' */
83
+ size?: AvatarSize;
84
+ /** BCP 47 tag for the count and the list of names. @default 'en-US' */
85
+ locale?: string;
86
+ labels?: Partial<AvatarGroupLabels>;
87
+ render?: RenderProp<AvatarGroupState>;
88
+ /** `Avatar` elements. */
89
+ children?: ReactNode;
90
+ }
91
+ /**
92
+ * A stack of avatars and a count, announced as one item (Figma: "Maya, Jonah, Priya and 4 more"):
93
+ * the root is `role="img"` named by the list of names, and every avatar inside is decorative.
94
+ */
95
+ export declare function AvatarGroup({ max, total, size, locale, labels, render, className, children, ...rest }: AvatarGroupProps): ReactElement;
96
+ //#endregion