@senvenli/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 (636) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -2
  3. package/dist/action/button-group.d.ts +26 -0
  4. package/dist/action/button-group.js +12 -0
  5. package/dist/action/button-group.js.map +1 -0
  6. package/dist/action/button.d.ts +42 -0
  7. package/dist/action/button.js +58 -0
  8. package/dist/action/button.js.map +1 -0
  9. package/dist/action/close-button.d.ts +12 -0
  10. package/dist/action/close-button.js +13 -0
  11. package/dist/action/close-button.js.map +1 -0
  12. package/dist/action/copy-button.d.ts +21 -0
  13. package/dist/action/copy-button.js +38 -0
  14. package/dist/action/copy-button.js.map +1 -0
  15. package/dist/action/fab.d.ts +29 -0
  16. package/dist/action/fab.js +57 -0
  17. package/dist/action/fab.js.map +1 -0
  18. package/dist/action/files.d.ts +70 -0
  19. package/dist/action/files.js +156 -0
  20. package/dist/action/files.js.map +1 -0
  21. package/dist/action/index.d.ts +23 -0
  22. package/dist/action/index.js +16 -0
  23. package/dist/action/index.js.map +1 -0
  24. package/dist/action/language-names.d.ts +19 -0
  25. package/dist/action/language-names.js +79 -0
  26. package/dist/action/language-names.js.map +1 -0
  27. package/dist/action/language-switcher.d.ts +57 -0
  28. package/dist/action/language-switcher.js +53 -0
  29. package/dist/action/language-switcher.js.map +1 -0
  30. package/dist/action/link-button.d.ts +57 -0
  31. package/dist/action/link-button.js +48 -0
  32. package/dist/action/link-button.js.map +1 -0
  33. package/dist/action/link.d.ts +24 -0
  34. package/dist/action/link.js +18 -0
  35. package/dist/action/link.js.map +1 -0
  36. package/dist/action/pressable.d.ts +40 -0
  37. package/dist/action/pressable.js +65 -0
  38. package/dist/action/pressable.js.map +1 -0
  39. package/dist/action/styles.d.ts +60 -0
  40. package/dist/action/styles.js +109 -0
  41. package/dist/action/styles.js.map +1 -0
  42. package/dist/action/theme-script.d.ts +12 -0
  43. package/dist/action/theme-script.js +23 -0
  44. package/dist/action/theme-script.js.map +1 -0
  45. package/dist/action/theme-switcher.d.ts +43 -0
  46. package/dist/action/theme-switcher.js +260 -0
  47. package/dist/action/theme-switcher.js.map +1 -0
  48. package/dist/action/theme-toggle.d.ts +43 -0
  49. package/dist/action/theme-toggle.js +259 -0
  50. package/dist/action/theme-toggle.js.map +1 -0
  51. package/dist/action/toggle.d.ts +44 -0
  52. package/dist/action/toggle.js +28 -0
  53. package/dist/action/toggle.js.map +1 -0
  54. package/dist/action/touch-target.d.ts +9 -0
  55. package/dist/action/touch-target.js +14 -0
  56. package/dist/action/touch-target.js.map +1 -0
  57. package/dist/charts/axis-width.d.ts +186 -0
  58. package/dist/charts/axis-width.js +1262 -0
  59. package/dist/charts/axis-width.js.map +1 -0
  60. package/dist/charts/bar-public.d.ts +16 -0
  61. package/dist/charts/bar-public.js +16 -0
  62. package/dist/charts/bar-public.js.map +1 -0
  63. package/dist/charts/chart-parts.d.ts +136 -0
  64. package/dist/charts/chart-parts.js +160 -0
  65. package/dist/charts/chart-parts.js.map +1 -0
  66. package/dist/charts/core-charts.d.ts +157 -0
  67. package/dist/charts/core-charts.js +505 -0
  68. package/dist/charts/core-charts.js.map +1 -0
  69. package/dist/charts/index.d.ts +12 -0
  70. package/dist/charts/index.js +8 -0
  71. package/dist/charts/index.js.map +1 -0
  72. package/dist/charts/list-charts.d.ts +124 -0
  73. package/dist/charts/list-charts.js +308 -0
  74. package/dist/charts/list-charts.js.map +1 -0
  75. package/dist/charts/more-charts.d.ts +138 -0
  76. package/dist/charts/more-charts.js +284 -0
  77. package/dist/charts/more-charts.js.map +1 -0
  78. package/dist/charts/report-charts.d.ts +138 -0
  79. package/dist/charts/report-charts.js +370 -0
  80. package/dist/charts/report-charts.js.map +1 -0
  81. package/dist/charts/value-tick.d.ts +178 -0
  82. package/dist/charts/value-tick.js +240 -0
  83. package/dist/charts/value-tick.js.map +1 -0
  84. package/dist/collection/data-table-url-hook.d.ts +34 -0
  85. package/dist/collection/data-table-url-hook.js +70 -0
  86. package/dist/collection/data-table-url-hook.js.map +1 -0
  87. package/dist/collection/data-table-url.d.ts +30 -0
  88. package/dist/collection/data-table-url.js +48 -0
  89. package/dist/collection/data-table-url.js.map +1 -0
  90. package/dist/collection/data-table.d.ts +112 -0
  91. package/dist/collection/data-table.js +188 -0
  92. package/dist/collection/data-table.js.map +1 -0
  93. package/dist/collection/grid-list-public.d.ts +18 -0
  94. package/dist/collection/grid-list-public.js +19 -0
  95. package/dist/collection/grid-list-public.js.map +1 -0
  96. package/dist/collection/grid-list.d.ts +73 -0
  97. package/dist/collection/grid-list.js +46 -0
  98. package/dist/collection/grid-list.js.map +1 -0
  99. package/dist/collection/index.d.ts +14 -0
  100. package/dist/collection/index.js +8 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/list.d.ts +61 -0
  103. package/dist/collection/list.js +38 -0
  104. package/dist/collection/list.js.map +1 -0
  105. package/dist/collection/selection-checkbox.d.ts +5 -0
  106. package/dist/collection/selection-checkbox.js +13 -0
  107. package/dist/collection/selection-checkbox.js.map +1 -0
  108. package/dist/collection/table.d.ts +91 -0
  109. package/dist/collection/table.js +183 -0
  110. package/dist/collection/table.js.map +1 -0
  111. package/dist/collection/tree.d.ts +31 -0
  112. package/dist/collection/tree.js +22 -0
  113. package/dist/collection/tree.js.map +1 -0
  114. package/dist/color/color.d.ts +87 -0
  115. package/dist/color/color.js +200 -0
  116. package/dist/color/color.js.map +1 -0
  117. package/dist/color/contrast.d.ts +34 -0
  118. package/dist/color/contrast.js +44 -0
  119. package/dist/color/contrast.js.map +1 -0
  120. package/dist/color/index.d.ts +4 -0
  121. package/dist/color/index.js +5 -0
  122. package/dist/color/index.js.map +1 -0
  123. package/dist/date/calendar.d.ts +71 -0
  124. package/dist/date/calendar.js +291 -0
  125. package/dist/date/calendar.js.map +1 -0
  126. package/dist/date/fields.d.ts +174 -0
  127. package/dist/date/fields.js +250 -0
  128. package/dist/date/fields.js.map +1 -0
  129. package/dist/date/index.d.ts +7 -0
  130. package/dist/date/index.js +6 -0
  131. package/dist/date/index.js.map +1 -0
  132. package/dist/date/month-grid.d.ts +31 -0
  133. package/dist/date/month-grid.js +115 -0
  134. package/dist/date/month-grid.js.map +1 -0
  135. package/dist/date/pickers.d.ts +118 -0
  136. package/dist/date/pickers.js +176 -0
  137. package/dist/date/pickers.js.map +1 -0
  138. package/dist/date/public.d.ts +25 -0
  139. package/dist/date/public.js +24 -0
  140. package/dist/date/public.js.map +1 -0
  141. package/dist/date/segments.d.ts +153 -0
  142. package/dist/date/segments.js +433 -0
  143. package/dist/date/segments.js.map +1 -0
  144. package/dist/defaults.d.ts +74 -0
  145. package/dist/defaults.js +100 -0
  146. package/dist/defaults.js.map +1 -0
  147. package/dist/density.d.ts +2 -0
  148. package/dist/density.js +2 -0
  149. package/dist/density.js.map +1 -0
  150. package/dist/display/avatar.d.ts +29 -0
  151. package/dist/display/avatar.js +71 -0
  152. package/dist/display/avatar.js.map +1 -0
  153. package/dist/display/badge.d.ts +65 -0
  154. package/dist/display/badge.js +99 -0
  155. package/dist/display/badge.js.map +1 -0
  156. package/dist/display/card.d.ts +72 -0
  157. package/dist/display/card.js +91 -0
  158. package/dist/display/card.js.map +1 -0
  159. package/dist/display/carousel.d.ts +47 -0
  160. package/dist/display/carousel.js +214 -0
  161. package/dist/display/carousel.js.map +1 -0
  162. package/dist/display/description-list.d.ts +25 -0
  163. package/dist/display/description-list.js +36 -0
  164. package/dist/display/description-list.js.map +1 -0
  165. package/dist/display/icon-aliases.d.ts +1 -0
  166. package/dist/display/icon-aliases.js +259 -0
  167. package/dist/display/icon-aliases.js.map +1 -0
  168. package/dist/display/icon-names.d.ts +4 -0
  169. package/dist/display/icon-names.js +2 -0
  170. package/dist/display/icon-names.js.map +1 -0
  171. package/dist/display/icon.d.ts +51 -0
  172. package/dist/display/icon.js +96 -0
  173. package/dist/display/icon.js.map +1 -0
  174. package/dist/display/image-crop.d.ts +106 -0
  175. package/dist/display/image-crop.js +117 -0
  176. package/dist/display/image-crop.js.map +1 -0
  177. package/dist/display/image-cropper.d.ts +68 -0
  178. package/dist/display/image-cropper.js +284 -0
  179. package/dist/display/image-cropper.js.map +1 -0
  180. package/dist/display/image-viewer.d.ts +54 -0
  181. package/dist/display/image-viewer.js +84 -0
  182. package/dist/display/image-viewer.js.map +1 -0
  183. package/dist/display/image.d.ts +26 -0
  184. package/dist/display/image.js +17 -0
  185. package/dist/display/image.js.map +1 -0
  186. package/dist/display/index.d.ts +29 -0
  187. package/dist/display/index.js +16 -0
  188. package/dist/display/index.js.map +1 -0
  189. package/dist/display/iso-chip.d.ts +19 -0
  190. package/dist/display/iso-chip.js +21 -0
  191. package/dist/display/iso-chip.js.map +1 -0
  192. package/dist/display/kbd.d.ts +11 -0
  193. package/dist/display/kbd.js +33 -0
  194. package/dist/display/kbd.js.map +1 -0
  195. package/dist/display/lozenge.d.ts +30 -0
  196. package/dist/display/lozenge.js +55 -0
  197. package/dist/display/lozenge.js.map +1 -0
  198. package/dist/display/scroll-area.d.ts +29 -0
  199. package/dist/display/scroll-area.js +95 -0
  200. package/dist/display/scroll-area.js.map +1 -0
  201. package/dist/display/separator.d.ts +13 -0
  202. package/dist/display/separator.js +24 -0
  203. package/dist/display/separator.js.map +1 -0
  204. package/dist/display/stat.d.ts +35 -0
  205. package/dist/display/stat.js +41 -0
  206. package/dist/display/stat.js.map +1 -0
  207. package/dist/display/timeline.d.ts +44 -0
  208. package/dist/display/timeline.js +111 -0
  209. package/dist/display/timeline.js.map +1 -0
  210. package/dist/display/typography.d.ts +37 -0
  211. package/dist/display/typography.js +53 -0
  212. package/dist/display/typography.js.map +1 -0
  213. package/dist/display/visually-hidden.d.ts +14 -0
  214. package/dist/display/visually-hidden.js +10 -0
  215. package/dist/display/visually-hidden.js.map +1 -0
  216. package/dist/feedback/banner.d.ts +46 -0
  217. package/dist/feedback/banner.js +157 -0
  218. package/dist/feedback/banner.js.map +1 -0
  219. package/dist/feedback/cooldown.d.ts +17 -0
  220. package/dist/feedback/cooldown.js +59 -0
  221. package/dist/feedback/cooldown.js.map +1 -0
  222. package/dist/feedback/empty-state.d.ts +35 -0
  223. package/dist/feedback/empty-state.js +39 -0
  224. package/dist/feedback/empty-state.js.map +1 -0
  225. package/dist/feedback/index.d.ts +12 -0
  226. package/dist/feedback/index.js +11 -0
  227. package/dist/feedback/index.js.map +1 -0
  228. package/dist/feedback/meter.d.ts +33 -0
  229. package/dist/feedback/meter.js +42 -0
  230. package/dist/feedback/meter.js.map +1 -0
  231. package/dist/feedback/motion.d.ts +9 -0
  232. package/dist/feedback/motion.js +57 -0
  233. package/dist/feedback/motion.js.map +1 -0
  234. package/dist/feedback/progress.d.ts +39 -0
  235. package/dist/feedback/progress.js +68 -0
  236. package/dist/feedback/progress.js.map +1 -0
  237. package/dist/feedback/skeleton.d.ts +48 -0
  238. package/dist/feedback/skeleton.js +61 -0
  239. package/dist/feedback/skeleton.js.map +1 -0
  240. package/dist/feedback/spinner.d.ts +19 -0
  241. package/dist/feedback/spinner.js +29 -0
  242. package/dist/feedback/spinner.js.map +1 -0
  243. package/dist/feedback/status-dot.d.ts +23 -0
  244. package/dist/feedback/status-dot.js +37 -0
  245. package/dist/feedback/status-dot.js.map +1 -0
  246. package/dist/form/countries.d.ts +34 -0
  247. package/dist/form/countries.js +273 -0
  248. package/dist/form/countries.js.map +1 -0
  249. package/dist/form/data-attributes.d.ts +11 -0
  250. package/dist/form/data-attributes.js +22 -0
  251. package/dist/form/data-attributes.js.map +1 -0
  252. package/dist/form/field-parts.d.ts +113 -0
  253. package/dist/form/field-parts.js +178 -0
  254. package/dist/form/field-parts.js.map +1 -0
  255. package/dist/form/field.d.ts +36 -0
  256. package/dist/form/field.js +65 -0
  257. package/dist/form/field.js.map +1 -0
  258. package/dist/form/files.d.ts +70 -0
  259. package/dist/form/files.js +156 -0
  260. package/dist/form/files.js.map +1 -0
  261. package/dist/form/form.d.ts +40 -0
  262. package/dist/form/form.js +74 -0
  263. package/dist/form/form.js.map +1 -0
  264. package/dist/form/image-crop.d.ts +106 -0
  265. package/dist/form/image-crop.js +117 -0
  266. package/dist/form/image-crop.js.map +1 -0
  267. package/dist/form/image-cropper.d.ts +68 -0
  268. package/dist/form/image-cropper.js +284 -0
  269. package/dist/form/image-cropper.js.map +1 -0
  270. package/dist/form/index.d.ts +24 -0
  271. package/dist/form/index.js +15 -0
  272. package/dist/form/index.js.map +1 -0
  273. package/dist/form/input-group.d.ts +63 -0
  274. package/dist/form/input-group.js +63 -0
  275. package/dist/form/input-group.js.map +1 -0
  276. package/dist/form/input-otp.d.ts +35 -0
  277. package/dist/form/input-otp.js +83 -0
  278. package/dist/form/input-otp.js.map +1 -0
  279. package/dist/form/input.d.ts +36 -0
  280. package/dist/form/input.js +41 -0
  281. package/dist/form/input.js.map +1 -0
  282. package/dist/form/number-field.d.ts +84 -0
  283. package/dist/form/number-field.js +81 -0
  284. package/dist/form/number-field.js.map +1 -0
  285. package/dist/form/otp-field.d.ts +37 -0
  286. package/dist/form/otp-field.js +116 -0
  287. package/dist/form/otp-field.js.map +1 -0
  288. package/dist/form/password-field.d.ts +61 -0
  289. package/dist/form/password-field.js +61 -0
  290. package/dist/form/password-field.js.map +1 -0
  291. package/dist/form/phone-field.d.ts +104 -0
  292. package/dist/form/phone-field.js +275 -0
  293. package/dist/form/phone-field.js.map +1 -0
  294. package/dist/form/phone-paste.d.ts +24 -0
  295. package/dist/form/phone-paste.js +40 -0
  296. package/dist/form/phone-paste.js.map +1 -0
  297. package/dist/form/phone.d.ts +159 -0
  298. package/dist/form/phone.js +309 -0
  299. package/dist/form/phone.js.map +1 -0
  300. package/dist/form/search-field.d.ts +29 -0
  301. package/dist/form/search-field.js +23 -0
  302. package/dist/form/search-field.js.map +1 -0
  303. package/dist/form/styles.d.ts +31 -0
  304. package/dist/form/styles.js +43 -0
  305. package/dist/form/styles.js.map +1 -0
  306. package/dist/form/text-area.d.ts +70 -0
  307. package/dist/form/text-area.js +93 -0
  308. package/dist/form/text-area.js.map +1 -0
  309. package/dist/form/text-field.d.ts +131 -0
  310. package/dist/form/text-field.js +59 -0
  311. package/dist/form/text-field.js.map +1 -0
  312. package/dist/form/validation.d.ts +145 -0
  313. package/dist/form/validation.js +136 -0
  314. package/dist/form/validation.js.map +1 -0
  315. package/dist/i18n.d.ts +438 -0
  316. package/dist/i18n.js +948 -0
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/index.d.ts +9 -0
  319. package/dist/index.js +7 -0
  320. package/dist/index.js.map +1 -0
  321. package/dist/intl-locale.d.ts +30 -0
  322. package/dist/intl-locale.js +83 -0
  323. package/dist/intl-locale.js.map +1 -0
  324. package/dist/layers.d.ts +32 -0
  325. package/dist/layers.js +33 -0
  326. package/dist/layers.js.map +1 -0
  327. package/dist/layout/auth-form-layout.d.ts +71 -0
  328. package/dist/layout/auth-form-layout.js +61 -0
  329. package/dist/layout/auth-form-layout.js.map +1 -0
  330. package/dist/layout/auth-layout.d.ts +59 -0
  331. package/dist/layout/auth-layout.js +26 -0
  332. package/dist/layout/auth-layout.js.map +1 -0
  333. package/dist/layout/box.d.ts +26 -0
  334. package/dist/layout/box.js +16 -0
  335. package/dist/layout/box.js.map +1 -0
  336. package/dist/layout/grid.d.ts +27 -0
  337. package/dist/layout/grid.js +26 -0
  338. package/dist/layout/grid.js.map +1 -0
  339. package/dist/layout/index.d.ts +16 -0
  340. package/dist/layout/index.js +12 -0
  341. package/dist/layout/index.js.map +1 -0
  342. package/dist/layout/pressable.d.ts +40 -0
  343. package/dist/layout/pressable.js +65 -0
  344. package/dist/layout/pressable.js.map +1 -0
  345. package/dist/layout/reset-sent-card.d.ts +39 -0
  346. package/dist/layout/reset-sent-card.js +22 -0
  347. package/dist/layout/reset-sent-card.js.map +1 -0
  348. package/dist/layout/scroll-area.d.ts +29 -0
  349. package/dist/layout/scroll-area.js +95 -0
  350. package/dist/layout/scroll-area.js.map +1 -0
  351. package/dist/layout/section.d.ts +41 -0
  352. package/dist/layout/section.js +22 -0
  353. package/dist/layout/section.js.map +1 -0
  354. package/dist/layout/split.d.ts +50 -0
  355. package/dist/layout/split.js +35 -0
  356. package/dist/layout/split.js.map +1 -0
  357. package/dist/layout/stack.d.ts +44 -0
  358. package/dist/layout/stack.js +36 -0
  359. package/dist/layout/stack.js.map +1 -0
  360. package/dist/layout/tokens.d.ts +33 -0
  361. package/dist/layout/tokens.js +85 -0
  362. package/dist/layout/tokens.js.map +1 -0
  363. package/dist/layout/toolbar.d.ts +37 -0
  364. package/dist/layout/toolbar.js +334 -0
  365. package/dist/layout/toolbar.js.map +1 -0
  366. package/dist/navigate-context.d.ts +12 -0
  367. package/dist/navigate-context.js +13 -0
  368. package/dist/navigate-context.js.map +1 -0
  369. package/dist/navigation/accordion.d.ts +40 -0
  370. package/dist/navigation/accordion.js +33 -0
  371. package/dist/navigation/accordion.js.map +1 -0
  372. package/dist/navigation/bottom-nav.d.ts +29 -0
  373. package/dist/navigation/bottom-nav.js +48 -0
  374. package/dist/navigation/bottom-nav.js.map +1 -0
  375. package/dist/navigation/brand-link-context.d.ts +8 -0
  376. package/dist/navigation/brand-link-context.js +9 -0
  377. package/dist/navigation/brand-link-context.js.map +1 -0
  378. package/dist/navigation/breadcrumbs.d.ts +36 -0
  379. package/dist/navigation/breadcrumbs.js +51 -0
  380. package/dist/navigation/breadcrumbs.js.map +1 -0
  381. package/dist/navigation/dock.d.ts +27 -0
  382. package/dist/navigation/dock.js +47 -0
  383. package/dist/navigation/dock.js.map +1 -0
  384. package/dist/navigation/footer.d.ts +43 -0
  385. package/dist/navigation/footer.js +43 -0
  386. package/dist/navigation/footer.js.map +1 -0
  387. package/dist/navigation/index.d.ts +22 -0
  388. package/dist/navigation/index.js +17 -0
  389. package/dist/navigation/index.js.map +1 -0
  390. package/dist/navigation/language-names.d.ts +19 -0
  391. package/dist/navigation/language-names.js +79 -0
  392. package/dist/navigation/language-names.js.map +1 -0
  393. package/dist/navigation/language-switcher.d.ts +55 -0
  394. package/dist/navigation/language-switcher.js +53 -0
  395. package/dist/navigation/language-switcher.js.map +1 -0
  396. package/dist/navigation/nav-panel.d.ts +18 -0
  397. package/dist/navigation/nav-panel.js +51 -0
  398. package/dist/navigation/nav-panel.js.map +1 -0
  399. package/dist/navigation/navbar.d.ts +73 -0
  400. package/dist/navigation/navbar.js +64 -0
  401. package/dist/navigation/navbar.js.map +1 -0
  402. package/dist/navigation/page-header.d.ts +37 -0
  403. package/dist/navigation/page-header.js +50 -0
  404. package/dist/navigation/page-header.js.map +1 -0
  405. package/dist/navigation/pagination.d.ts +25 -0
  406. package/dist/navigation/pagination.js +51 -0
  407. package/dist/navigation/pagination.js.map +1 -0
  408. package/dist/navigation/panel-header.d.ts +37 -0
  409. package/dist/navigation/panel-header.js +50 -0
  410. package/dist/navigation/panel-header.js.map +1 -0
  411. package/dist/navigation/sidebar-script.d.ts +12 -0
  412. package/dist/navigation/sidebar-script.js +20 -0
  413. package/dist/navigation/sidebar-script.js.map +1 -0
  414. package/dist/navigation/sidebar.d.ts +149 -0
  415. package/dist/navigation/sidebar.js +332 -0
  416. package/dist/navigation/sidebar.js.map +1 -0
  417. package/dist/navigation/skip-link.d.ts +12 -0
  418. package/dist/navigation/skip-link.js +30 -0
  419. package/dist/navigation/skip-link.js.map +1 -0
  420. package/dist/navigation/stepper.d.ts +50 -0
  421. package/dist/navigation/stepper.js +96 -0
  422. package/dist/navigation/stepper.js.map +1 -0
  423. package/dist/navigation/tabs.d.ts +84 -0
  424. package/dist/navigation/tabs.js +118 -0
  425. package/dist/navigation/tabs.js.map +1 -0
  426. package/dist/navigation/toolbar.d.ts +37 -0
  427. package/dist/navigation/toolbar.js +334 -0
  428. package/dist/navigation/toolbar.js.map +1 -0
  429. package/dist/overlay/alert-dialog.d.ts +63 -0
  430. package/dist/overlay/alert-dialog.js +76 -0
  431. package/dist/overlay/alert-dialog.js.map +1 -0
  432. package/dist/overlay/command-palette.d.ts +53 -0
  433. package/dist/overlay/command-palette.js +130 -0
  434. package/dist/overlay/command-palette.js.map +1 -0
  435. package/dist/overlay/command.d.ts +53 -0
  436. package/dist/overlay/command.js +129 -0
  437. package/dist/overlay/command.js.map +1 -0
  438. package/dist/overlay/context-menu.d.ts +29 -0
  439. package/dist/overlay/context-menu.js +58 -0
  440. package/dist/overlay/context-menu.js.map +1 -0
  441. package/dist/overlay/dialog.d.ts +162 -0
  442. package/dist/overlay/dialog.js +174 -0
  443. package/dist/overlay/dialog.js.map +1 -0
  444. package/dist/overlay/drawer.d.ts +41 -0
  445. package/dist/overlay/drawer.js +114 -0
  446. package/dist/overlay/drawer.js.map +1 -0
  447. package/dist/overlay/floating.d.ts +142 -0
  448. package/dist/overlay/floating.js +226 -0
  449. package/dist/overlay/floating.js.map +1 -0
  450. package/dist/overlay/hover-card.d.ts +19 -0
  451. package/dist/overlay/hover-card.js +31 -0
  452. package/dist/overlay/hover-card.js.map +1 -0
  453. package/dist/overlay/index.d.ts +18 -0
  454. package/dist/overlay/index.js +12 -0
  455. package/dist/overlay/index.js.map +1 -0
  456. package/dist/overlay/overlay-base.d.ts +105 -0
  457. package/dist/overlay/overlay-base.js +250 -0
  458. package/dist/overlay/overlay-base.js.map +1 -0
  459. package/dist/overlay/overlay.d.ts +299 -0
  460. package/dist/overlay/overlay.js +558 -0
  461. package/dist/overlay/overlay.js.map +1 -0
  462. package/dist/overlay/toast.d.ts +58 -0
  463. package/dist/overlay/toast.js +145 -0
  464. package/dist/overlay/toast.js.map +1 -0
  465. package/dist/provider.d.ts +26 -0
  466. package/dist/provider.js +30 -0
  467. package/dist/provider.js.map +1 -0
  468. package/dist/selection/autocomplete.d.ts +54 -0
  469. package/dist/selection/autocomplete.js +122 -0
  470. package/dist/selection/autocomplete.js.map +1 -0
  471. package/dist/selection/checkbox.d.ts +56 -0
  472. package/dist/selection/checkbox.js +49 -0
  473. package/dist/selection/checkbox.js.map +1 -0
  474. package/dist/selection/choice-size.d.ts +26 -0
  475. package/dist/selection/choice-size.js +50 -0
  476. package/dist/selection/choice-size.js.map +1 -0
  477. package/dist/selection/choice-text.d.ts +21 -0
  478. package/dist/selection/choice-text.js +33 -0
  479. package/dist/selection/choice-text.js.map +1 -0
  480. package/dist/selection/combobox.d.ts +173 -0
  481. package/dist/selection/combobox.js +410 -0
  482. package/dist/selection/combobox.js.map +1 -0
  483. package/dist/selection/index.d.ts +20 -0
  484. package/dist/selection/index.js +13 -0
  485. package/dist/selection/index.js.map +1 -0
  486. package/dist/selection/list-box.d.ts +30 -0
  487. package/dist/selection/list-box.js +16 -0
  488. package/dist/selection/list-box.js.map +1 -0
  489. package/dist/selection/listbox.d.ts +44 -0
  490. package/dist/selection/listbox.js +49 -0
  491. package/dist/selection/listbox.js.map +1 -0
  492. package/dist/selection/match.d.ts +20 -0
  493. package/dist/selection/match.js +57 -0
  494. package/dist/selection/match.js.map +1 -0
  495. package/dist/selection/multi-select.d.ts +72 -0
  496. package/dist/selection/multi-select.js +138 -0
  497. package/dist/selection/multi-select.js.map +1 -0
  498. package/dist/selection/radio-card.d.ts +31 -0
  499. package/dist/selection/radio-card.js +29 -0
  500. package/dist/selection/radio-card.js.map +1 -0
  501. package/dist/selection/radio.d.ts +72 -0
  502. package/dist/selection/radio.js +64 -0
  503. package/dist/selection/radio.js.map +1 -0
  504. package/dist/selection/select-public.d.ts +19 -0
  505. package/dist/selection/select-public.js +24 -0
  506. package/dist/selection/select-public.js.map +1 -0
  507. package/dist/selection/select.d.ts +72 -0
  508. package/dist/selection/select.js +69 -0
  509. package/dist/selection/select.js.map +1 -0
  510. package/dist/selection/slider.d.ts +16 -0
  511. package/dist/selection/slider.js +44 -0
  512. package/dist/selection/slider.js.map +1 -0
  513. package/dist/selection/styles.d.ts +26 -0
  514. package/dist/selection/styles.js +78 -0
  515. package/dist/selection/styles.js.map +1 -0
  516. package/dist/selection/switch.d.ts +24 -0
  517. package/dist/selection/switch.js +27 -0
  518. package/dist/selection/switch.js.map +1 -0
  519. package/dist/selection/tag-group.d.ts +38 -0
  520. package/dist/selection/tag-group.js +45 -0
  521. package/dist/selection/tag-group.js.map +1 -0
  522. package/dist/tone.d.ts +6 -0
  523. package/dist/tone.js +2 -0
  524. package/dist/tone.js.map +1 -0
  525. package/dist/utils.d.ts +9 -0
  526. package/dist/utils.js +42 -0
  527. package/dist/utils.js.map +1 -0
  528. package/manifest/component.full.schema.json +391 -0
  529. package/manifest/component.schema.json +279 -0
  530. package/manifests/accordion.json +299 -0
  531. package/manifests/alert-dialog.json +261 -0
  532. package/manifests/area-chart.json +338 -0
  533. package/manifests/autocomplete.json +299 -0
  534. package/manifests/avatar.json +253 -0
  535. package/manifests/badge.json +288 -0
  536. package/manifests/banner.json +185 -0
  537. package/manifests/bar-chart.json +454 -0
  538. package/manifests/bar-list.json +262 -0
  539. package/manifests/bottom-nav.json +139 -0
  540. package/manifests/box.json +3450 -0
  541. package/manifests/breadcrumbs.json +199 -0
  542. package/manifests/button-group.json +2294 -0
  543. package/manifests/button.json +1211 -0
  544. package/manifests/calendar-heatmap.json +218 -0
  545. package/manifests/calendar.json +299 -0
  546. package/manifests/card.json +308 -0
  547. package/manifests/carousel.json +263 -0
  548. package/manifests/chart-parts.json +309 -0
  549. package/manifests/checkbox.json +998 -0
  550. package/manifests/close-button.json +1000 -0
  551. package/manifests/color-field.json +276 -0
  552. package/manifests/color-picker.json +161 -0
  553. package/manifests/color-swatch-picker.json +220 -0
  554. package/manifests/color-swatch.json +140 -0
  555. package/manifests/combobox.json +581 -0
  556. package/manifests/command.json +275 -0
  557. package/manifests/composed-chart.json +287 -0
  558. package/manifests/context-menu.json +148 -0
  559. package/manifests/copy-button.json +192 -0
  560. package/manifests/data-table.json +334 -0
  561. package/manifests/date-field.json +302 -0
  562. package/manifests/date-picker.json +472 -0
  563. package/manifests/description-list.json +201 -0
  564. package/manifests/dialog.json +322 -0
  565. package/manifests/donut-chart.json +264 -0
  566. package/manifests/drawer.json +211 -0
  567. package/manifests/empty-state.json +185 -0
  568. package/manifests/fab.json +172 -0
  569. package/manifests/field.json +209 -0
  570. package/manifests/file-upload.json +791 -0
  571. package/manifests/form.json +829 -0
  572. package/manifests/funnel-chart.json +223 -0
  573. package/manifests/gauge-chart.json +252 -0
  574. package/manifests/grid-list.json +335 -0
  575. package/manifests/grid.json +3482 -0
  576. package/manifests/heading.json +183 -0
  577. package/manifests/heatmap.json +265 -0
  578. package/manifests/hover-card.json +172 -0
  579. package/manifests/icon.json +201 -0
  580. package/manifests/image-cropper.json +295 -0
  581. package/manifests/image-viewer.json +198 -0
  582. package/manifests/image.json +193 -0
  583. package/manifests/index.json +2035 -0
  584. package/manifests/input-group.json +3571 -0
  585. package/manifests/input.json +1557 -0
  586. package/manifests/kbd.json +98 -0
  587. package/manifests/language-switcher.json +274 -0
  588. package/manifests/line-chart.json +342 -0
  589. package/manifests/link.json +867 -0
  590. package/manifests/list-box.json +213 -0
  591. package/manifests/menu.json +453 -0
  592. package/manifests/meter.json +145 -0
  593. package/manifests/navbar.json +281 -0
  594. package/manifests/otp-field.json +1029 -0
  595. package/manifests/page-header.json +164 -0
  596. package/manifests/pagination.json +181 -0
  597. package/manifests/popover.json +205 -0
  598. package/manifests/pressable.json +367 -0
  599. package/manifests/progress.json +282 -0
  600. package/manifests/radar-chart.json +229 -0
  601. package/manifests/radial-chart.json +195 -0
  602. package/manifests/radio.json +975 -0
  603. package/manifests/scatter-chart.json +277 -0
  604. package/manifests/scroll-area.json +127 -0
  605. package/manifests/section.json +169 -0
  606. package/manifests/select.json +474 -0
  607. package/manifests/separator.json +119 -0
  608. package/manifests/sidebar.json +584 -0
  609. package/manifests/skeleton.json +235 -0
  610. package/manifests/skip-link.json +89 -0
  611. package/manifests/slider.json +706 -0
  612. package/manifests/sparkline.json +208 -0
  613. package/manifests/spinner.json +105 -0
  614. package/manifests/split.json +6618 -0
  615. package/manifests/stack.json +3541 -0
  616. package/manifests/stat.json +192 -0
  617. package/manifests/stepper.json +279 -0
  618. package/manifests/switch.json +205 -0
  619. package/manifests/table.json +375 -0
  620. package/manifests/tabs.json +438 -0
  621. package/manifests/tag-group.json +264 -0
  622. package/manifests/text-area.json +1136 -0
  623. package/manifests/text.json +244 -0
  624. package/manifests/theme-switcher.json +152 -0
  625. package/manifests/time-field.json +284 -0
  626. package/manifests/timeline.json +196 -0
  627. package/manifests/toast.json +87 -0
  628. package/manifests/toggle-button.json +1489 -0
  629. package/manifests/toolbar.json +145 -0
  630. package/manifests/tooltip.json +181 -0
  631. package/manifests/tracker.json +192 -0
  632. package/manifests/tree.json +245 -0
  633. package/manifests/visually-hidden.json +114 -0
  634. package/package.json +117 -3
  635. package/styles/base.css +56 -0
  636. package/styles/theme.css +154 -0
@@ -0,0 +1,59 @@
1
+ import * as React from "react";
2
+ export interface AuthLayoutProps {
3
+ /** Top of the brand pane — the logo lockup. */
4
+ brandLogo?: React.ReactNode;
5
+ /** Middle of the brand pane — kicker / headline / copy / stats. */
6
+ brandContent?: React.ReactNode;
7
+ /** Bottom of the brand pane — a low-key footer line. */
8
+ brandFooter?: React.ReactNode;
9
+ /**
10
+ * What rides at the start of the footer row, before `brandFooter` — a rule, a
11
+ * mark, a motif. Nothing paints when it is absent: this layout carries no
12
+ * signature of its own, so an app that wants one passes it.
13
+ */
14
+ brandFooterLead?: React.ReactNode;
15
+ /**
16
+ * Decoration behind the brand pane's content. A slot rather than a choice —
17
+ * the layout knows the geometry, the app knows what it wants to look like.
18
+ *
19
+ * The pane is the positioning context and clips its overflow, so what goes
20
+ * here should be `absolute inset-0 pointer-events-none` (and `aria-hidden`,
21
+ * being decoration). It is rendered first and the pane's own rows carry
22
+ * `relative`, so a backdrop that follows that shape sits behind them.
23
+ */
24
+ brandBackdrop?: React.ReactNode;
25
+ /**
26
+ * The brand pane's own ground: its background and the text color its
27
+ * contents inherit. The layout has no opinion, because the surface is where
28
+ * two apps sharing this skeleton most need to differ.
29
+ */
30
+ brandClassName?: string;
31
+ /** The credentials pane's corner control (top, inline end). */
32
+ topRightSlot?: React.ReactNode;
33
+ /** The credentials content — typically an `AuthFormLayout`. */
34
+ children: React.ReactNode;
35
+ /**
36
+ * The credentials pane's element: `main` (default) when the layout is the page, `div` when the app's shell already
37
+ * renders the page's one `<main>`.
38
+ */
39
+ credentialsElement?: "main" | "div";
40
+ className?: string;
41
+ }
42
+ /**
43
+ * The split-screen skeleton an auth screen is built on: a desktop-only brand
44
+ * pane beside a centered credentials pane (the auth pattern).
45
+ *
46
+ * Only the geometry lives here — the column ratio, the pane's top / middle /
47
+ * bottom rhythm, the clipping, the full-height centring, the corner control.
48
+ * Every surface is a slot: the ground arrives as `brandClassName`, the
49
+ * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two
50
+ * apps that want to look unrelated still share one skeleton.
51
+ *
52
+ * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds
53
+ * inside a dialog, a preview frame or a shell with a sidebar.
54
+ *
55
+ * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,
56
+ * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).
57
+ * The corner control sits at the inline end, so it mirrors in right-to-left.
58
+ */
59
+ export declare function AuthLayout({ brandLogo, brandContent, brandFooter, brandFooterLead, brandBackdrop, brandClassName, topRightSlot, children, credentialsElement: Credentials, className, }: AuthLayoutProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../utils.js";
4
+ /**
5
+ * The split-screen skeleton an auth screen is built on: a desktop-only brand
6
+ * pane beside a centered credentials pane (the auth pattern).
7
+ *
8
+ * Only the geometry lives here — the column ratio, the pane's top / middle /
9
+ * bottom rhythm, the clipping, the full-height centring, the corner control.
10
+ * Every surface is a slot: the ground arrives as `brandClassName`, the
11
+ * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two
12
+ * apps that want to look unrelated still share one skeleton.
13
+ *
14
+ * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds
15
+ * inside a dialog, a preview frame or a shell with a sidebar.
16
+ *
17
+ * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,
18
+ * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).
19
+ * The corner control sits at the inline end, so it mirrors in right-to-left.
20
+ */
21
+ export function AuthLayout({ brandLogo, brandContent, brandFooter, brandFooterLead, brandBackdrop, brandClassName, topRightSlot, children, credentialsElement: Credentials = "main", className, }) {
22
+ return (
23
+ // The container is the outer box: an element cannot query its own width, so the grid is one level in.
24
+ _jsx("div", { "data-slot": "auth-layout", className: cn("@container min-h-svh", className), children: _jsxs("div", { "data-slot": "auth-layout-grid", className: "grid min-h-svh @5xl:grid-cols-[1.05fr_1fr]", children: [_jsxs("aside", { "data-slot": "auth-brand", className: cn("relative hidden overflow-hidden @5xl:flex @5xl:flex-col @5xl:justify-between @5xl:p-ds-600 @7xl:p-ds-800", brandClassName), children: [brandBackdrop, brandLogo && _jsx("div", { className: "relative", children: brandLogo }), brandContent && _jsx("div", { className: "relative", children: brandContent }), _jsxs("div", { "data-slot": "auth-brand-footer", className: "relative flex items-center gap-ds-200", children: [brandFooterLead, brandFooter && _jsx("div", { className: "min-w-0", children: brandFooter })] })] }), _jsxs(Credentials, { "data-slot": "auth-credentials", className: "relative flex h-full min-h-0 flex-col items-center justify-center bg-ds-surface px-ds-250 py-ds-600 text-ds-text", children: [topRightSlot && (_jsx("div", { "data-slot": "auth-corner", className: "absolute top-ds-200 end-ds-200 z-10", children: topRightSlot })), children] })] }) }));
25
+ }
26
+ //# sourceMappingURL=auth-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-layout.js","sourceRoot":"","sources":["../../src/layout/auth-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA2C9B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAAE,WAAW,GAAG,MAAM,EACxC,SAAS,GACO;IAChB,OAAO;IACL,sGAAsG;IACtG,2BAAe,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,YAC3E,4BAAe,kBAAkB,EAAC,SAAS,EAAC,4CAA4C,aACtF,8BACY,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,0GAA0G,EAC1G,cAAc,CACf,aAEA,aAAa,EAEb,SAAS,IAAI,cAAK,SAAS,EAAC,UAAU,YAAE,SAAS,GAAO,EAExD,YAAY,IAAI,cAAK,SAAS,EAAC,UAAU,YAAE,YAAY,GAAO,EAK/D,4BAAe,mBAAmB,EAAC,SAAS,EAAC,uCAAuC,aACjF,eAAe,EACf,WAAW,IAAI,cAAK,SAAS,EAAC,SAAS,YAAE,WAAW,GAAO,IACxD,IACA,EAER,MAAC,WAAW,iBACA,kBAAkB,EAC5B,SAAS,EAAC,kHAAkH,aAE3H,YAAY,IAAI,CACf,2BAAe,aAAa,EAAC,SAAS,EAAC,qCAAqC,YACzE,YAAY,GACT,CACP,EACA,QAAQ,IACG,IACV,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\n\nexport interface AuthLayoutProps {\n /** Top of the brand pane — the logo lockup. */\n brandLogo?: React.ReactNode;\n /** Middle of the brand pane — kicker / headline / copy / stats. */\n brandContent?: React.ReactNode;\n /** Bottom of the brand pane — a low-key footer line. */\n brandFooter?: React.ReactNode;\n /**\n * What rides at the start of the footer row, before `brandFooter` — a rule, a\n * mark, a motif. Nothing paints when it is absent: this layout carries no\n * signature of its own, so an app that wants one passes it.\n */\n brandFooterLead?: React.ReactNode;\n /**\n * Decoration behind the brand pane's content. A slot rather than a choice —\n * the layout knows the geometry, the app knows what it wants to look like.\n *\n * The pane is the positioning context and clips its overflow, so what goes\n * here should be `absolute inset-0 pointer-events-none` (and `aria-hidden`,\n * being decoration). It is rendered first and the pane's own rows carry\n * `relative`, so a backdrop that follows that shape sits behind them.\n */\n brandBackdrop?: React.ReactNode;\n /**\n * The brand pane's own ground: its background and the text color its\n * contents inherit. The layout has no opinion, because the surface is where\n * two apps sharing this skeleton most need to differ.\n */\n brandClassName?: string;\n /** The credentials pane's corner control (top, inline end). */\n topRightSlot?: React.ReactNode;\n /** The credentials content — typically an `AuthFormLayout`. */\n children: React.ReactNode;\n /**\n * The credentials pane's element: `main` (default) when the layout is the page, `div` when the app's shell already\n * renders the page's one `<main>`.\n */\n credentialsElement?: \"main\" | \"div\";\n className?: string;\n}\n\n/**\n * The split-screen skeleton an auth screen is built on: a desktop-only brand\n * pane beside a centered credentials pane (the auth pattern).\n *\n * Only the geometry lives here — the column ratio, the pane's top / middle /\n * bottom rhythm, the clipping, the full-height centring, the corner control.\n * Every surface is a slot: the ground arrives as `brandClassName`, the\n * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two\n * apps that want to look unrelated still share one skeleton.\n *\n * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds\n * inside a dialog, a preview frame or a shell with a sidebar.\n *\n * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,\n * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).\n * The corner control sits at the inline end, so it mirrors in right-to-left.\n */\nexport function AuthLayout({\n brandLogo,\n brandContent,\n brandFooter,\n brandFooterLead,\n brandBackdrop,\n brandClassName,\n topRightSlot,\n children,\n credentialsElement: Credentials = \"main\",\n className,\n}: AuthLayoutProps) {\n return (\n // The container is the outer box: an element cannot query its own width, so the grid is one level in.\n <div data-slot=\"auth-layout\" className={cn(\"@container min-h-svh\", className)}>\n <div data-slot=\"auth-layout-grid\" className=\"grid min-h-svh @5xl:grid-cols-[1.05fr_1fr]\">\n <aside\n data-slot=\"auth-brand\"\n className={cn(\n \"relative hidden overflow-hidden @5xl:flex @5xl:flex-col @5xl:justify-between @5xl:p-ds-600 @7xl:p-ds-800\",\n brandClassName,\n )}\n >\n {brandBackdrop}\n\n {brandLogo && <div className=\"relative\">{brandLogo}</div>}\n\n {brandContent && <div className=\"relative\">{brandContent}</div>}\n\n {/* Always rendered, even when it holds nothing. The pane is a `justify-between` column, so\n dropping this row slams the narrative against the bottom edge; a zero-height\n spacer holds the top / middle / bottom rhythm whatever the consumer supplies. */}\n <div data-slot=\"auth-brand-footer\" className=\"relative flex items-center gap-ds-200\">\n {brandFooterLead}\n {brandFooter && <div className=\"min-w-0\">{brandFooter}</div>}\n </div>\n </aside>\n\n <Credentials\n data-slot=\"auth-credentials\"\n className=\"relative flex h-full min-h-0 flex-col items-center justify-center bg-ds-surface px-ds-250 py-ds-600 text-ds-text\"\n >\n {topRightSlot && (\n <div data-slot=\"auth-corner\" className=\"absolute top-ds-200 end-ds-200 z-10\">\n {topRightSlot}\n </div>\n )}\n {children}\n </Credentials>\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import { type Background, type Border, type Radius, type Shadow, type Space } from "./tokens.js";
3
+ /** Visual props shared by Box and Pressable. Token names only. */
4
+ export type BoxStyleProps = {
5
+ padding?: Space;
6
+ paddingInline?: Space;
7
+ paddingBlock?: Space;
8
+ background?: Background;
9
+ radius?: Radius;
10
+ shadow?: Shadow;
11
+ border?: Border;
12
+ };
13
+ export declare function boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }: BoxStyleProps): string;
14
+ type LayoutElement = "div" | "section" | "article" | "aside" | "header" | "footer" | "main" | "nav" | "ul" | "ol" | "li" | "span" | "form" | "fieldset";
15
+ /** HTML attributes a layout primitive passes through. No `className` or `style`: look comes from token props. */
16
+ export type LayoutHTMLProps = Omit<React.AllHTMLAttributes<HTMLElement>, "className" | "style" | "color" | "as" | "wrap">;
17
+ export type BoxProps = BoxStyleProps & LayoutHTMLProps & {
18
+ as?: LayoutElement;
19
+ children?: React.ReactNode;
20
+ };
21
+ /** One element whose padding, ground, radius, shadow and border come from tokens. */
22
+ export declare const Box: React.ForwardRefExoticComponent<BoxStyleProps & LayoutHTMLProps & {
23
+ as?: LayoutElement;
24
+ children?: React.ReactNode;
25
+ } & React.RefAttributes<HTMLElement>>;
26
+ export {};
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { cn } from "../utils.js";
3
+ import { BACKGROUND, PADDING, PADDING_BLOCK, PADDING_INLINE, RADIUS, SHADOW, borderClass, } from "./tokens.js";
4
+ export function boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }) {
5
+ return cn(padding && PADDING[padding], paddingInline && PADDING_INLINE[paddingInline], paddingBlock && PADDING_BLOCK[paddingBlock], background && BACKGROUND[background], radius && RADIUS[radius], shadow && SHADOW[shadow], borderClass(border));
6
+ }
7
+ /** One element whose padding, ground, radius, shadow and border come from tokens. */
8
+ export const Box = React.forwardRef(function Box({ as = "div", padding, paddingInline, paddingBlock, background, radius, shadow, border, children, ...rest }, ref) {
9
+ return React.createElement(as, {
10
+ ...rest,
11
+ ref,
12
+ "data-slot": "box",
13
+ className: boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }) || undefined,
14
+ }, children);
15
+ });
16
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../src/layout/box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAEhF,MAAM,UAAU,CAAC;AAalB,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAiB;IACpH,OAAO,EAAE,CACP,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAC3B,aAAa,IAAI,cAAc,CAAC,aAAa,CAAC,EAC9C,YAAY,IAAI,aAAa,CAAC,YAAY,CAAC,EAC3C,UAAU,IAAI,UAAU,CAAC,UAAU,CAAC,EACpC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,EACxB,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,EACxB,WAAW,CAAC,MAAM,CAAC,CACpB,CAAC;AACJ,CAAC;AAYD,qFAAqF;AACrF,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAwB,SAAS,GAAG,CACrE,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAC3G,GAAG;IAEH,OAAO,KAAK,CAAC,aAAa,CACxB,EAAE,EACF;QACE,GAAG,IAAI;QACP,GAAG;QACH,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,SAAS;KACjH,EACD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport {\n BACKGROUND, PADDING, PADDING_BLOCK, PADDING_INLINE, RADIUS, SHADOW, borderClass,\n type Background, type Border, type Radius, type Shadow, type Space,\n} from \"./tokens\";\n\n/** Visual props shared by Box and Pressable. Token names only. */\nexport type BoxStyleProps = {\n padding?: Space;\n paddingInline?: Space;\n paddingBlock?: Space;\n background?: Background;\n radius?: Radius;\n shadow?: Shadow;\n border?: Border;\n};\n\nexport function boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }: BoxStyleProps) {\n return cn(\n padding && PADDING[padding],\n paddingInline && PADDING_INLINE[paddingInline],\n paddingBlock && PADDING_BLOCK[paddingBlock],\n background && BACKGROUND[background],\n radius && RADIUS[radius],\n shadow && SHADOW[shadow],\n borderClass(border),\n );\n}\n\ntype LayoutElement = \"div\" | \"section\" | \"article\" | \"aside\" | \"header\" | \"footer\" | \"main\" | \"nav\" | \"ul\" | \"ol\" | \"li\" | \"span\" | \"form\" | \"fieldset\";\n\n/** HTML attributes a layout primitive passes through. No `className` or `style`: look comes from token props. */\nexport type LayoutHTMLProps = Omit<React.AllHTMLAttributes<HTMLElement>, \"className\" | \"style\" | \"color\" | \"as\" | \"wrap\">;\n\nexport type BoxProps = BoxStyleProps & LayoutHTMLProps & {\n as?: LayoutElement;\n children?: React.ReactNode;\n};\n\n/** One element whose padding, ground, radius, shadow and border come from tokens. */\nexport const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(\n { as = \"div\", padding, paddingInline, paddingBlock, background, radius, shadow, border, children, ...rest },\n ref,\n) {\n return React.createElement(\n as,\n {\n ...rest,\n ref,\n \"data-slot\": \"box\",\n className: boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }) || undefined,\n },\n children,\n );\n});\n"]}
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { type BoxProps } from "./box.js";
3
+ import { type Space } from "./tokens.js";
4
+ declare const COLUMNS: {
5
+ readonly 1: "grid-cols-1";
6
+ readonly 2: "grid-cols-2";
7
+ readonly 3: "grid-cols-3";
8
+ readonly 4: "grid-cols-4";
9
+ readonly 5: "grid-cols-5";
10
+ readonly 6: "grid-cols-6";
11
+ };
12
+ export type GridProps = BoxProps & {
13
+ space?: Space;
14
+ } & ({
15
+ columns: keyof typeof COLUMNS;
16
+ minColumnWidth?: never;
17
+ } | {
18
+ /**
19
+ * Auto-fit columns no narrower than this many pixels (never wider than
20
+ * the grid itself), as many as fit. The one length a layout prop takes.
21
+ */
22
+ minColumnWidth: number;
23
+ columns?: never;
24
+ });
25
+ /** Equal columns, fixed or auto-fit, with a token gap. */
26
+ export declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLElement>>;
27
+ export {};
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import { cn } from "../utils.js";
3
+ import { boxClasses } from "./box.js";
4
+ import { GAP } from "./tokens.js";
5
+ const COLUMNS = {
6
+ 1: "grid-cols-1",
7
+ 2: "grid-cols-2",
8
+ 3: "grid-cols-3",
9
+ 4: "grid-cols-4",
10
+ 5: "grid-cols-5",
11
+ 6: "grid-cols-6",
12
+ };
13
+ /** Equal columns, fixed or auto-fit, with a token gap. */
14
+ export const Grid = React.forwardRef(function Grid({ as = "div", space, columns, minColumnWidth, padding, paddingInline, paddingBlock, background, radius, shadow, border, children, ...rest }, ref) {
15
+ // A width that is not a positive number cannot drive auto-fit; fall back to one column.
16
+ const autoFit = typeof minColumnWidth === "number" && Number.isFinite(minColumnWidth) && minColumnWidth > 0;
17
+ const fallback = minColumnWidth !== undefined && !autoFit;
18
+ return React.createElement(as, {
19
+ ...rest,
20
+ ref,
21
+ "data-slot": "grid",
22
+ className: cn("grid", columns !== undefined && COLUMNS[columns], fallback && "grid-cols-1", autoFit && "grid-cols-[repeat(auto-fit,minmax(min(var(--ds-grid-min),100%),1fr))]", space && GAP[space], boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border })),
23
+ style: autoFit ? { "--ds-grid-min": `${minColumnWidth}px` } : undefined,
24
+ }, children);
25
+ });
26
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/layout/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAiB,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,GAAG,EAAc,MAAM,UAAU,CAAC;AAE3C,MAAM,OAAO,GAAG;IACd,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;CACR,CAAC;AAgBX,0DAA0D;AAC1D,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAyB,SAAS,IAAI,CACxE,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAC3I,GAAG;IAEH,wFAAwF;IACxF,MAAM,OAAO,GAAG,OAAO,cAAc,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC,CAAC;IAC5G,MAAM,QAAQ,GAAG,cAAc,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC;IAC1D,OAAO,KAAK,CAAC,aAAa,CACxB,EAAE,EACF;QACE,GAAG,IAAI;QACP,GAAG;QACH,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,EAAE,CACX,MAAM,EACN,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,EACzC,QAAQ,IAAI,aAAa,EACzB,OAAO,IAAI,uEAAuE,EAClF,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,EACnB,UAAU,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CACzF;QACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,eAAe,EAAE,GAAG,cAAc,IAAI,EAA0B,CAAC,CAAC,CAAC,SAAS;KACjG,EACD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { boxClasses, type BoxProps } from \"./box\";\nimport { GAP, type Space } from \"./tokens\";\n\nconst COLUMNS = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-2\",\n 3: \"grid-cols-3\",\n 4: \"grid-cols-4\",\n 5: \"grid-cols-5\",\n 6: \"grid-cols-6\",\n} as const;\n\nexport type GridProps = BoxProps & {\n space?: Space;\n} & (\n | { /** A fixed number of equal columns. */ columns: keyof typeof COLUMNS; minColumnWidth?: never }\n | {\n /**\n * Auto-fit columns no narrower than this many pixels (never wider than\n * the grid itself), as many as fit. The one length a layout prop takes.\n */\n minColumnWidth: number;\n columns?: never;\n }\n );\n\n/** Equal columns, fixed or auto-fit, with a token gap. */\nexport const Grid = React.forwardRef<HTMLElement, GridProps>(function Grid(\n { as = \"div\", space, columns, minColumnWidth, padding, paddingInline, paddingBlock, background, radius, shadow, border, children, ...rest },\n ref,\n) {\n // A width that is not a positive number cannot drive auto-fit; fall back to one column.\n const autoFit = typeof minColumnWidth === \"number\" && Number.isFinite(minColumnWidth) && minColumnWidth > 0;\n const fallback = minColumnWidth !== undefined && !autoFit;\n return React.createElement(\n as,\n {\n ...rest,\n ref,\n \"data-slot\": \"grid\",\n className: cn(\n \"grid\",\n columns !== undefined && COLUMNS[columns],\n fallback && \"grid-cols-1\",\n autoFit && \"grid-cols-[repeat(auto-fit,minmax(min(var(--ds-grid-min),100%),1fr))]\",\n space && GAP[space],\n boxClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border }),\n ),\n style: autoFit ? ({ \"--ds-grid-min\": `${minColumnWidth}px` } as React.CSSProperties) : undefined,\n },\n children,\n );\n});\n"]}
@@ -0,0 +1,16 @@
1
+ export { Box } from "./box.js";
2
+ export type { BoxProps, BoxStyleProps } from "./box.js";
3
+ export { Stack } from "./stack.js";
4
+ export type { StackHorizontalProps, StackProps, StackVerticalProps } from "./stack.js";
5
+ export { Grid } from "./grid.js";
6
+ export type { GridProps } from "./grid.js";
7
+ export { Container, Section } from "./section.js";
8
+ export type { ContainerProps, SectionProps } from "./section.js";
9
+ export { SPACE_TOKENS } from "./tokens.js";
10
+ export type { Space, Background, Radius, Shadow, Border, Align, Justify } from "./tokens.js";
11
+ export { Split, SplitPane } from "./split.js";
12
+ export type { SplitCollapse, SplitPaneProps, SplitProps } from "./split.js";
13
+ export { ScrollArea } from "./scroll-area.js";
14
+ export type { ScrollAreaProps } from "./scroll-area.js";
15
+ export { BulkBar, Toolbar, ToolbarSpacer } from "./toolbar.js";
16
+ export type { BulkBarProps, ToolbarProps } from "./toolbar.js";
@@ -0,0 +1,12 @@
1
+ // @senvenli/react/layout: Box, Stack (vertical or horizontal), Grid, Toolbar, BulkBar and ScrollArea with token-only layout
2
+ // props, `gap` between siblings and logical properties; Section and Container
3
+ // for page bands.
4
+ export { Box } from "./box.js";
5
+ export { Stack } from "./stack.js";
6
+ export { Grid } from "./grid.js";
7
+ export { Container, Section } from "./section.js";
8
+ export { SPACE_TOKENS } from "./tokens.js";
9
+ export { Split, SplitPane } from "./split.js";
10
+ export { ScrollArea } from "./scroll-area.js";
11
+ export { BulkBar, Toolbar, ToolbarSpacer } from "./toolbar.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,4HAA4H;AAC5H,8EAA8E;AAC9E,kBAAkB;AAClB,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["// @senvenli/react/layout: Box, Stack (vertical or horizontal), Grid, Toolbar, BulkBar and ScrollArea with token-only layout\n// props, `gap` between siblings and logical properties; Section and Container\n// for page bands.\nexport { Box } from \"./box\";\nexport type { BoxProps, BoxStyleProps } from \"./box\";\nexport { Stack } from \"./stack\";\nexport type { StackHorizontalProps, StackProps, StackVerticalProps } from \"./stack\";\nexport { Grid } from \"./grid\";\nexport type { GridProps } from \"./grid\";\nexport { Container, Section } from \"./section\";\nexport type { ContainerProps, SectionProps } from \"./section\";\nexport { SPACE_TOKENS } from \"./tokens\";\nexport type { Space, Background, Radius, Shadow, Border, Align, Justify } from \"./tokens\";\nexport { Split, SplitPane } from \"./split\";\nexport type { SplitCollapse, SplitPaneProps, SplitProps } from \"./split\";\nexport { ScrollArea } from \"./scroll-area\";\nexport type { ScrollAreaProps } from \"./scroll-area\";\nexport { BulkBar, Toolbar, ToolbarSpacer } from \"./toolbar\";\nexport type { BulkBarProps, ToolbarProps } from \"./toolbar\";\n"]}
@@ -0,0 +1,40 @@
1
+ import * as React from "react";
2
+ import { type ButtonProps, type LinkProps, type PressEvent } from "react-aria-components";
3
+ import { type BoxStyleProps } from "./box.js";
4
+ /**
5
+ * Shared look for every Pressable: no native chrome, a 24px minimum hit
6
+ * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed
7
+ * feedback from tokens. A surface with a shadow lifts to the overlay shadow
8
+ * on hover and settles back to the raised one while pressed (the interactive
9
+ * Card rule); every Pressable also takes the hover / pressed fill of its ground.
10
+ */
11
+ export declare function pressableClasses(style: BoxStyleProps & {
12
+ fullWidth?: boolean;
13
+ }): string;
14
+ type PressableBase = BoxStyleProps & {
15
+ /** As wide as its container (default `true`), as a button or a link; `false` hugs what it holds. */
16
+ fullWidth?: boolean;
17
+ children?: React.ReactNode;
18
+ isDisabled?: boolean;
19
+ /** Required when the content has no text that names the action. */
20
+ "aria-label"?: string;
21
+ id?: string;
22
+ };
23
+ export type PressableProps = PressableBase & (({
24
+ href?: undefined;
25
+ onPress?: (event: PressEvent) => void;
26
+ } & Pick<ButtonProps, "type" | "form" | "aria-describedby" | "aria-pressed" | "aria-expanded">) | ({
27
+ href: string;
28
+ onPress?: (event: PressEvent) => void;
29
+ } & Pick<LinkProps, "target" | "rel" | "routerOptions" | "aria-describedby">));
30
+ /**
31
+ * Makes a custom surface clickable with React Aria's press handling: mouse,
32
+ * touch, keyboard (Enter / Space) and screen readers, with consistent
33
+ * hover, pressed and focus-visible states. With `href` it is a link that
34
+ * goes through the host router (`DesignSystemProvider`); otherwise a button.
35
+ *
36
+ * Content is phrasing content only (a `<button>` or `<a>` may not hold block
37
+ * elements): lay it out with `Stack` / `Inline` / `Box` `as="span"`.
38
+ */
39
+ export declare const Pressable: React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
40
+ export {};
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button, Link } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { boxClasses } from "./box.js";
7
+ /**
8
+ * Hover and pressed fills follow the ground the Pressable starts from, so a
9
+ * selected or neutral surface keeps its meaning while it reacts. Status
10
+ * grounds (information, success…) keep their fill; their feedback is the
11
+ * shadow or the focus ring.
12
+ */
13
+ const HOVER_FILL = {
14
+ none: "data-[hovered]:bg-ds-surface-hovered",
15
+ surface: "data-[hovered]:bg-ds-surface-hovered",
16
+ "surface-raised": "data-[hovered]:bg-ds-surface-hovered",
17
+ "surface-overlay": "data-[hovered]:bg-ds-surface-hovered",
18
+ "surface-sunken": "data-[hovered]:bg-ds-background-neutral-hovered",
19
+ neutral: "data-[hovered]:bg-ds-background-neutral-hovered",
20
+ selected: "data-[hovered]:bg-ds-background-selected-hovered",
21
+ "brand-subtle": "data-[hovered]:bg-ds-background-selected-hovered",
22
+ };
23
+ const PRESSED_FILL = {
24
+ none: "data-[pressed]:bg-ds-background-neutral-hovered",
25
+ surface: "data-[pressed]:bg-ds-background-neutral-hovered",
26
+ "surface-raised": "data-[pressed]:bg-ds-background-neutral-hovered",
27
+ "surface-overlay": "data-[pressed]:bg-ds-background-neutral-hovered",
28
+ "surface-sunken": "data-[pressed]:bg-ds-background-neutral-pressed",
29
+ neutral: "data-[pressed]:bg-ds-background-neutral-pressed",
30
+ selected: "data-[pressed]:bg-ds-background-selected-pressed",
31
+ "brand-subtle": "data-[pressed]:bg-ds-background-selected-hovered",
32
+ };
33
+ /**
34
+ * Shared look for every Pressable: no native chrome, a 24px minimum hit
35
+ * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed
36
+ * feedback from tokens. A surface with a shadow lifts to the overlay shadow
37
+ * on hover and settles back to the raised one while pressed (the interactive
38
+ * Card rule); every Pressable also takes the hover / pressed fill of its ground.
39
+ */
40
+ export function pressableClasses(style) {
41
+ const ground = style.background ?? "none";
42
+ return cn(
43
+ // A <button> sizes to its content even as a block; `w-full` makes it fill like the link form does.
44
+ style.fullWidth === false ? "w-fit" : "w-full", "relative block min-h-6 min-w-6 cursor-pointer appearance-none text-start text-inherit [font:inherit] outline-hidden select-none", "transition-[background-color,box-shadow] duration-(--ds-duration-instant) ease-ds-standard",
45
+ // Keyboard focus: a 2px inner border (no outer ring); pointer focus shows nothing.
46
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", style.shadow && "data-[hovered]:shadow-ds-overlay data-[pressed]:shadow-ds-raised", HOVER_FILL[ground], PRESSED_FILL[ground], "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", boxClasses(style));
47
+ }
48
+ /**
49
+ * Makes a custom surface clickable with React Aria's press handling: mouse,
50
+ * touch, keyboard (Enter / Space) and screen readers, with consistent
51
+ * hover, pressed and focus-visible states. With `href` it is a link that
52
+ * goes through the host router (`DesignSystemProvider`); otherwise a button.
53
+ *
54
+ * Content is phrasing content only (a `<button>` or `<a>` may not hold block
55
+ * elements): lay it out with `Stack` / `Inline` / `Box` `as="span"`.
56
+ */
57
+ export const Pressable = React.forwardRef(function Pressable({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth = true, children, ...rest }, ref) {
58
+ const className = pressableClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth });
59
+ if (rest.href !== undefined) {
60
+ return (_jsx(Link, { ...rest, ref: ref, "data-slot": "pressable", className: className, children: children }));
61
+ }
62
+ const { href: _href, ...buttonProps } = rest;
63
+ return (_jsx(Button, { type: "button", ...buttonProps, ref: ref, "data-slot": "pressable", className: className, children: children }));
64
+ });
65
+ //# sourceMappingURL=pressable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pressable.js","sourceRoot":"","sources":["../../src/layout/pressable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAqD,MAAM,uBAAuB,CAAC;AAExG,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAGvD;;;;;GAKG;AACH,MAAM,UAAU,GAAiD;IAC/D,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,sCAAsC;IAC/C,gBAAgB,EAAE,sCAAsC;IACxD,iBAAiB,EAAE,sCAAsC;IACzD,gBAAgB,EAAE,iDAAiD;IACnE,OAAO,EAAE,iDAAiD;IAC1D,QAAQ,EAAE,kDAAkD;IAC5D,cAAc,EAAE,kDAAkD;CACnE,CAAC;AACF,MAAM,YAAY,GAAiD;IACjE,IAAI,EAAE,iDAAiD;IACvD,OAAO,EAAE,iDAAiD;IAC1D,gBAAgB,EAAE,iDAAiD;IACnE,iBAAiB,EAAE,iDAAiD;IACpE,gBAAgB,EAAE,iDAAiD;IACnE,OAAO,EAAE,iDAAiD;IAC1D,QAAQ,EAAE,kDAAkD;IAC5D,cAAc,EAAE,kDAAkD;CACnE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA8C;IAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC;IAC1C,OAAO,EAAE;IACP,mGAAmG;IACnG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAC9C,iIAAiI,EACjI,4FAA4F;IAC5F,mFAAmF;IACnF,qFAAqF,EACrF,KAAK,CAAC,MAAM,IAAI,kEAAkE,EAClF,UAAU,CAAC,MAAM,CAAC,EAClB,YAAY,CAAC,MAAM,CAAC,EACpB,+DAA+D,EAC/D,UAAU,CAAC,KAAK,CAAC,CAClB,CAAC;AACJ,CAAC;AAkBD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAwD,SAAS,SAAS,CACjH,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EACjH,GAAG;IAEH,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5H,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CACL,KAAC,IAAI,OAAK,IAAI,EAAE,GAAG,EAAE,GAAmC,eAAY,WAAW,EAAC,SAAS,EAAE,SAAS,YACjG,QAAQ,GACJ,CACR,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7C,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,KAAK,WAAW,EAAE,GAAG,EAAE,GAAmC,eAAY,WAAW,EAAC,SAAS,EAAE,SAAS,YACxH,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Button, Link, type ButtonProps, type LinkProps, type PressEvent } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { boxClasses, type BoxStyleProps } from \"./box\";\nimport type { Background } from \"./tokens\";\n\n/**\n * Hover and pressed fills follow the ground the Pressable starts from, so a\n * selected or neutral surface keeps its meaning while it reacts. Status\n * grounds (information, success…) keep their fill; their feedback is the\n * shadow or the focus ring.\n */\nconst HOVER_FILL: Partial<Record<Background | \"none\", string>> = {\n none: \"data-[hovered]:bg-ds-surface-hovered\",\n surface: \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-raised\": \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-overlay\": \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-sunken\": \"data-[hovered]:bg-ds-background-neutral-hovered\",\n neutral: \"data-[hovered]:bg-ds-background-neutral-hovered\",\n selected: \"data-[hovered]:bg-ds-background-selected-hovered\",\n \"brand-subtle\": \"data-[hovered]:bg-ds-background-selected-hovered\",\n};\nconst PRESSED_FILL: Partial<Record<Background | \"none\", string>> = {\n none: \"data-[pressed]:bg-ds-background-neutral-hovered\",\n surface: \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-raised\": \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-overlay\": \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-sunken\": \"data-[pressed]:bg-ds-background-neutral-pressed\",\n neutral: \"data-[pressed]:bg-ds-background-neutral-pressed\",\n selected: \"data-[pressed]:bg-ds-background-selected-pressed\",\n \"brand-subtle\": \"data-[pressed]:bg-ds-background-selected-hovered\",\n};\n\n/**\n * Shared look for every Pressable: no native chrome, a 24px minimum hit\n * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed\n * feedback from tokens. A surface with a shadow lifts to the overlay shadow\n * on hover and settles back to the raised one while pressed (the interactive\n * Card rule); every Pressable also takes the hover / pressed fill of its ground.\n */\nexport function pressableClasses(style: BoxStyleProps & { fullWidth?: boolean }) {\n const ground = style.background ?? \"none\";\n return cn(\n // A <button> sizes to its content even as a block; `w-full` makes it fill like the link form does.\n style.fullWidth === false ? \"w-fit\" : \"w-full\",\n \"relative block min-h-6 min-w-6 cursor-pointer appearance-none text-start text-inherit [font:inherit] outline-hidden select-none\",\n \"transition-[background-color,box-shadow] duration-(--ds-duration-instant) ease-ds-standard\",\n // Keyboard focus: a 2px inner border (no outer ring); pointer focus shows nothing.\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n style.shadow && \"data-[hovered]:shadow-ds-overlay data-[pressed]:shadow-ds-raised\",\n HOVER_FILL[ground],\n PRESSED_FILL[ground],\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n boxClasses(style),\n );\n}\n\ntype PressableBase = BoxStyleProps & {\n /** As wide as its container (default `true`), as a button or a link; `false` hugs what it holds. */\n fullWidth?: boolean;\n children?: React.ReactNode;\n isDisabled?: boolean;\n /** Required when the content has no text that names the action. */\n \"aria-label\"?: string;\n id?: string;\n};\n\nexport type PressableProps = PressableBase &\n (\n | ({ href?: undefined; onPress?: (event: PressEvent) => void } & Pick<ButtonProps, \"type\" | \"form\" | \"aria-describedby\" | \"aria-pressed\" | \"aria-expanded\">)\n | ({ href: string; onPress?: (event: PressEvent) => void } & Pick<LinkProps, \"target\" | \"rel\" | \"routerOptions\" | \"aria-describedby\">)\n );\n\n/**\n * Makes a custom surface clickable with React Aria's press handling: mouse,\n * touch, keyboard (Enter / Space) and screen readers, with consistent\n * hover, pressed and focus-visible states. With `href` it is a link that\n * goes through the host router (`DesignSystemProvider`); otherwise a button.\n *\n * Content is phrasing content only (a `<button>` or `<a>` may not hold block\n * elements): lay it out with `Stack` / `Inline` / `Box` `as=\"span\"`.\n */\nexport const Pressable = React.forwardRef<HTMLButtonElement | HTMLAnchorElement, PressableProps>(function Pressable(\n { padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth = true, children, ...rest },\n ref,\n) {\n const className = pressableClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth });\n if (rest.href !== undefined) {\n return (\n <Link {...rest} ref={ref as React.Ref<HTMLAnchorElement>} data-slot=\"pressable\" className={className}>\n {children}\n </Link>\n );\n }\n const { href: _href, ...buttonProps } = rest;\n return (\n <Button type=\"button\" {...buttonProps} ref={ref as React.Ref<HTMLButtonElement>} data-slot=\"pressable\" className={className}>\n {children}\n </Button>\n );\n});\n"]}
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ export interface ResetSentLabels {
3
+ title: React.ReactNode;
4
+ /** Enumeration-safe body, e.g. "If an account exists we've sent a reset link." */
5
+ description: React.ReactNode;
6
+ resend: React.ReactNode;
7
+ /** Resend-button label during the cooldown, e.g. `(s) => `Resend in ${s}s``. */
8
+ resendIn?: (seconds: number) => React.ReactNode;
9
+ /** Shown when a resend fails (the button is usable again at once), e.g. "Couldn't resend. Try again." */
10
+ resendFailed?: React.ReactNode;
11
+ }
12
+ export interface ResetSentCardProps {
13
+ labels: ResetSentLabels;
14
+ /** Sends the link again. A rejected promise (or a throw) starts no wait and shows `labels.resendFailed`. */
15
+ onResend: () => void | Promise<void>;
16
+ /** Seconds to disable "Resend" for after each successful send. Default 60. */
17
+ cooldownSeconds?: number;
18
+ /**
19
+ * The wait already running when the card appears. Default `cooldownSeconds`: the link was just sent. Pass 0 when the
20
+ * card shows long after the send, or the server's "retry after"; a new value restarts the wait.
21
+ */
22
+ initialCooldown?: number;
23
+ resending?: boolean;
24
+ /** Optional icon in place of the default check. */
25
+ icon?: React.ReactNode;
26
+ /** "Back to sign in" affordance under the actions. */
27
+ backSlot?: React.ReactNode;
28
+ className?: string;
29
+ /** The title's heading level: 1 by default, or 2 when the page has its own h1. */
30
+ headingLevel?: 1 | 2 | 3;
31
+ }
32
+ /**
33
+ * "Check your inbox" confirmation shown after a reset link is requested
34
+ * (the auth pattern). The message is deliberately
35
+ * enumeration-safe, and "Resend" is rate-limited by a local cooldown so it
36
+ * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending
37
+ * state while the send runs (or while `resending`).
38
+ */
39
+ export declare function ResetSentCard({ labels, onResend, cooldownSeconds, initialCooldown, resending, icon, backSlot, className, headingLevel, }: ResetSentCardProps): React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button } from "../action/button.js";
5
+ import { IconGlyph } from "../display/icon.js";
6
+ import { useCooldownAction } from "../feedback/cooldown.js";
7
+ import { cn } from "../utils.js";
8
+ import { TitleTag } from "./auth-form-layout.js";
9
+ /**
10
+ * "Check your inbox" confirmation shown after a reset link is requested
11
+ * (the auth pattern). The message is deliberately
12
+ * enumeration-safe, and "Resend" is rate-limited by a local cooldown so it
13
+ * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending
14
+ * state while the send runs (or while `resending`).
15
+ */
16
+ export function ResetSentCard({ labels, onResend, cooldownSeconds = 60, initialCooldown, resending = false, icon, backSlot, className, headingLevel = 1, }) {
17
+ const resend = useCooldownAction(onResend, cooldownSeconds, initialCooldown ?? cooldownSeconds);
18
+ const cooling = resend.remaining > 0;
19
+ const pending = resending || resend.isPending;
20
+ return (_jsxs("div", { "data-slot": "auth-card", className: cn("w-full max-w-sm", className), children: [_jsx("div", { "data-slot": "reset-sent-icon", className: "flex size-11 items-center justify-center rounded-ds-full bg-ds-background-success text-ds-text-success", children: icon ?? _jsx(IconGlyph, { name: "circle-check", size: "large" }) }), _jsxs("div", { className: "mt-ds-300 space-y-1.5", children: [_jsx(TitleTag, { level: headingLevel, className: "text-heading-large text-ds-text", children: labels.title }), _jsx("p", { className: "text-body text-ds-text-subtle", children: labels.description })] }), _jsxs("div", { className: "mt-8 grid gap-ds-200", children: [_jsx(Button, { size: "large", isDisabled: cooling && !pending, isPending: pending, onPress: () => void resend.run(), children: !pending && cooling && labels.resendIn ? labels.resendIn(resend.remaining) : labels.resend }), resend.failed && labels.resendFailed && (_jsx("p", { role: "alert", className: "text-center text-body text-ds-text-danger", children: labels.resendFailed })), backSlot && _jsx("div", { className: "flex justify-center", children: backSlot })] })] }));
21
+ }
22
+ //# sourceMappingURL=reset-sent-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-sent-card.js","sourceRoot":"","sources":["../../src/layout/reset-sent-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAkC9C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,EACR,eAAe,GAAG,EAAE,EACpB,eAAe,EACf,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,GAAG,CAAC,GACG;IACnB,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,eAAe,IAAI,eAAe,CAAC,CAAC;IAChG,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC;IAE9C,OAAO,CACL,4BAAe,WAAW,EAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,aACpE,2BACY,iBAAiB,EAC3B,SAAS,EAAC,wGAAwG,YAEjH,IAAI,IAAI,KAAC,SAAS,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,OAAO,GAAG,GACnD,EAEN,eAAK,SAAS,EAAC,uBAAuB,aACpC,KAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAC,iCAAiC,YAAE,MAAM,CAAC,KAAK,GAAY,EACpG,YAAG,SAAS,EAAC,+BAA+B,YAAE,MAAM,CAAC,WAAW,GAAK,IACjE,EAGN,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,OAAO,IAAI,CAAC,OAAO,EAC/B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,EAAE,YAE/B,CAAC,OAAO,IAAI,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GACpF,EAER,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,IAAI,CACvC,YAAG,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,2CAA2C,YAClE,MAAM,CAAC,YAAY,GAClB,CACL,EAEA,QAAQ,IAAI,cAAK,SAAS,EAAC,qBAAqB,YAAE,QAAQ,GAAO,IAC9D,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button } from \"../action/button\";\nimport { IconGlyph } from \"../display/icon\";\nimport { useCooldownAction } from \"../feedback/cooldown\";\nimport { cn } from \"../utils\";\nimport { TitleTag } from \"./auth-form-layout\";\n\nexport interface ResetSentLabels {\n title: React.ReactNode;\n /** Enumeration-safe body, e.g. \"If an account exists we've sent a reset link.\" */\n description: React.ReactNode;\n resend: React.ReactNode;\n /** Resend-button label during the cooldown, e.g. `(s) => `Resend in ${s}s``. */\n resendIn?: (seconds: number) => React.ReactNode;\n /** Shown when a resend fails (the button is usable again at once), e.g. \"Couldn't resend. Try again.\" */\n resendFailed?: React.ReactNode;\n}\n\nexport interface ResetSentCardProps {\n labels: ResetSentLabels;\n /** Sends the link again. A rejected promise (or a throw) starts no wait and shows `labels.resendFailed`. */\n onResend: () => void | Promise<void>;\n /** Seconds to disable \"Resend\" for after each successful send. Default 60. */\n cooldownSeconds?: number;\n /**\n * The wait already running when the card appears. Default `cooldownSeconds`: the link was just sent. Pass 0 when the\n * card shows long after the send, or the server's \"retry after\"; a new value restarts the wait.\n */\n initialCooldown?: number;\n resending?: boolean;\n /** Optional icon in place of the default check. */\n icon?: React.ReactNode;\n /** \"Back to sign in\" affordance under the actions. */\n backSlot?: React.ReactNode;\n className?: string;\n /** The title's heading level: 1 by default, or 2 when the page has its own h1. */\n headingLevel?: 1 | 2 | 3;\n}\n\n/**\n * \"Check your inbox\" confirmation shown after a reset link is requested\n * (the auth pattern). The message is deliberately\n * enumeration-safe, and \"Resend\" is rate-limited by a local cooldown so it\n * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending\n * state while the send runs (or while `resending`).\n */\nexport function ResetSentCard({\n labels,\n onResend,\n cooldownSeconds = 60,\n initialCooldown,\n resending = false,\n icon,\n backSlot,\n className,\n headingLevel = 1,\n}: ResetSentCardProps) {\n const resend = useCooldownAction(onResend, cooldownSeconds, initialCooldown ?? cooldownSeconds);\n const cooling = resend.remaining > 0;\n const pending = resending || resend.isPending;\n\n return (\n <div data-slot=\"auth-card\" className={cn(\"w-full max-w-sm\", className)}>\n <div\n data-slot=\"reset-sent-icon\"\n className=\"flex size-11 items-center justify-center rounded-ds-full bg-ds-background-success text-ds-text-success\"\n >\n {icon ?? <IconGlyph name=\"circle-check\" size=\"large\" />}\n </div>\n\n <div className=\"mt-ds-300 space-y-1.5\">\n <TitleTag level={headingLevel} className=\"text-heading-large text-ds-text\">{labels.title}</TitleTag>\n <p className=\"text-body text-ds-text-subtle\">{labels.description}</p>\n </div>\n\n {/* A grid stretches the button to the full width, as the old `w-full` did. */}\n <div className=\"mt-8 grid gap-ds-200\">\n <Button\n size=\"large\"\n isDisabled={cooling && !pending}\n isPending={pending}\n onPress={() => void resend.run()}\n >\n {!pending && cooling && labels.resendIn ? labels.resendIn(resend.remaining) : labels.resend}\n </Button>\n\n {resend.failed && labels.resendFailed && (\n <p role=\"alert\" className=\"text-center text-body text-ds-text-danger\">\n {labels.resendFailed}\n </p>\n )}\n\n {backSlot && <div className=\"flex justify-center\">{backSlot}</div>}\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ export type ScrollAreaProps = {
3
+ children: React.ReactNode;
4
+ /** Names the region; screen readers announce it when focus enters. */
5
+ "aria-label": string;
6
+ /** The region's height limit ("320px", 320, "60vh"); for horizontal areas, set the width on the parent. */
7
+ maxHeight?: number | string;
8
+ /**
9
+ * Fills the parent's height and scrolls inside it, for a pane in a flex column or a grid
10
+ * row that is given its height: a conversation's messages between its header and the reply box, a list
11
+ * beside it. The parent must give the area a definite height (`min-h-0` on a flex or grid child).
12
+ * Leave `maxHeight` out when filling.
13
+ */
14
+ fill?: boolean;
15
+ orientation?: "vertical" | "horizontal" | "both";
16
+ };
17
+ /**
18
+ * A fixed-size region with its own native scroll (never hijacked) and the
19
+ * scrollbar contract (thin, a ds-border-bold thumb), plus an overflow
20
+ * shadow on each edge where content continues. When it holds nothing
21
+ * focusable it becomes a focusable region itself, so keyboard users can
22
+ * scroll it with the arrow keys.
23
+ *
24
+ * Known deviation: the design's 6px thumb is drawn by the platform's thin
25
+ * scrollbar (about 8–11px); standard CSS cannot size it further without
26
+ * replacing native scrolling. With `orientation="both"` the edge shadows
27
+ * follow the vertical axis.
28
+ */
29
+ export declare function ScrollArea({ children, "aria-label": ariaLabel, maxHeight, fill, orientation }: ScrollAreaProps): React.JSX.Element;
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../utils.js";
5
+ const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
6
+ /** A tabbable descendant that is not hidden or inert. */
7
+ function hasTabbable(root) {
8
+ return Array.from(root.querySelectorAll(TABBABLE)).some((element) => !element.closest("[hidden], [inert]"));
9
+ }
10
+ /**
11
+ * A fixed-size region with its own native scroll (never hijacked) and the
12
+ * scrollbar contract (thin, a ds-border-bold thumb), plus an overflow
13
+ * shadow on each edge where content continues. When it holds nothing
14
+ * focusable it becomes a focusable region itself, so keyboard users can
15
+ * scroll it with the arrow keys.
16
+ *
17
+ * Known deviation: the design's 6px thumb is drawn by the platform's thin
18
+ * scrollbar (about 8–11px); standard CSS cannot size it further without
19
+ * replacing native scrolling. With `orientation="both"` the edge shadows
20
+ * follow the vertical axis.
21
+ */
22
+ export function ScrollArea({ children, "aria-label": ariaLabel, maxHeight, fill = false, orientation = "vertical" }) {
23
+ const viewport = React.useRef(null);
24
+ const [edges, setEdges] = React.useState({ start: false, end: false });
25
+ const [needsFocus, setNeedsFocus] = React.useState(false);
26
+ // The thumb shows while scrolling and fades shortly after.
27
+ const [scrolling, setScrolling] = React.useState(false);
28
+ const scrollTimer = React.useRef(undefined);
29
+ React.useEffect(() => () => window.clearTimeout(scrollTimer.current), []);
30
+ // Every scroll event restarts the fade-out, so a long scroll keeps the thumb steady.
31
+ const onScrolling = () => {
32
+ window.clearTimeout(scrollTimer.current);
33
+ setScrolling(true);
34
+ scrollTimer.current = window.setTimeout(() => setScrolling(false), 800);
35
+ };
36
+ const horizontal = orientation === "horizontal";
37
+ const room = () => {
38
+ const frame = viewport.current;
39
+ return frame ? (horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight) : 0;
40
+ };
41
+ /** Which edges hide content; cheap enough for every scroll event. */
42
+ const measureEdges = React.useCallback(() => {
43
+ const frame = viewport.current;
44
+ if (!frame)
45
+ return;
46
+ // Horizontal scroll positions are negative in RTL; magnitudes work for both directions.
47
+ const position = Math.abs(horizontal ? frame.scrollLeft : frame.scrollTop);
48
+ const space = horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight;
49
+ const next = { start: position > 1, end: space - position > 1 };
50
+ setEdges((current) => (current.start === next.start && current.end === next.end ? current : next));
51
+ }, [horizontal]);
52
+ /** Whether the region must take focus itself: it scrolls and holds nothing focusable. Runs on size and content changes. */
53
+ const measureFocus = React.useCallback(() => {
54
+ const frame = viewport.current;
55
+ if (!frame)
56
+ return;
57
+ const next = room() > 1 && !hasTabbable(frame);
58
+ // Never pull focus out from under the keyboard: keep the tab stop while the region itself has focus.
59
+ setNeedsFocus((current) => (current && !next && document.activeElement === frame ? current : next));
60
+ }, [horizontal]);
61
+ React.useLayoutEffect(() => {
62
+ measureEdges();
63
+ measureFocus();
64
+ const frame = viewport.current;
65
+ if (!frame)
66
+ return;
67
+ const sized = () => {
68
+ measureEdges();
69
+ measureFocus();
70
+ };
71
+ const resize = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(sized);
72
+ resize?.observe(frame);
73
+ if (frame.firstElementChild)
74
+ resize?.observe(frame.firstElementChild);
75
+ // Children that appear, disappear or change focusability without changing size.
76
+ const mutation = typeof MutationObserver === "undefined" ? undefined : new MutationObserver(sized);
77
+ mutation?.observe(frame, { childList: true, subtree: true, attributes: true, attributeFilter: ["disabled", "tabindex", "hidden", "inert", "href", "contenteditable"] });
78
+ return () => {
79
+ resize?.disconnect();
80
+ mutation?.disconnect();
81
+ };
82
+ }, [measureEdges, measureFocus]);
83
+ const shadow = "pointer-events-none absolute z-[1] shadow-ds-overflow transition-opacity duration-(--ds-duration-instant)";
84
+ return (
85
+ // Clipped: the edge-shadow casters sit just outside the box and only their inward shadow may show,
86
+ // so the area never makes its column (or the page) scroll sideways.
87
+ _jsxs("div", { "data-slot": "scroll-area", "data-orientation": orientation, "data-fill": fill || undefined, className: cn("relative min-h-0 min-w-0 overflow-clip", fill && "h-full"), children: [_jsx("div", { ref: viewport, "data-slot": "scroll-area-viewport", role: needsFocus ? "region" : undefined, "aria-label": needsFocus ? ariaLabel : undefined, tabIndex: needsFocus ? 0 : undefined, onScroll: () => {
88
+ measureEdges();
89
+ onScrolling();
90
+ }, onBlur: measureFocus, "data-scrolling": scrolling || undefined, style: { maxHeight }, className: cn("peer outline-hidden", fill && "h-full",
91
+ // The scrollbar: thin, a ds-border-bold thumb at 70% on no track, shown on hover, keyboard
92
+ // focus and while scrolling. Native underneath, so wheel, touch and keyboard scroll as usual.
93
+ "[scrollbar-width:thin] [scrollbar-color:transparent_transparent]", "hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", "focus-visible:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", "data-[scrolling]:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", orientation === "vertical" && "overflow-y-auto overflow-x-hidden", orientation === "horizontal" && "overflow-x-auto overflow-y-hidden", orientation === "both" && "overflow-auto"), children: _jsx("div", { "data-slot": "scroll-area-content", children: children }) }), horizontal ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "start", className: cn(shadow, "inset-y-0 start-0 w-3 [clip-path:inset(0_-12px_0_0)] rtl:[clip-path:inset(0_0_0_-12px)] -translate-x-full rtl:translate-x-full", !edges.start && "opacity-0") }), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "end", className: cn(shadow, "inset-y-0 end-0 w-3 [clip-path:inset(0_0_0_-12px)] rtl:[clip-path:inset(0_-12px_0_0)] translate-x-full rtl:-translate-x-full", !edges.end && "opacity-0") })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "start", className: cn(shadow, "inset-x-0 top-0 h-3 -translate-y-full [clip-path:inset(0_0_-12px_0)]", !edges.start && "opacity-0") }), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "end", className: cn(shadow, "inset-x-0 bottom-0 h-3 translate-y-full [clip-path:inset(-12px_0_0_0)]", !edges.end && "opacity-0") })] })), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-focus", className: "pointer-events-none absolute inset-0 z-[2] peer-focus-visible:inset-ring-2 peer-focus-visible:inset-ring-ds-border-focused" })] }));
94
+ }
95
+ //# sourceMappingURL=scroll-area.js.map