@passui/react 0.1.46 → 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 (429) hide show
  1. package/README.md +29 -109
  2. package/THIRD_PARTY_NOTICES.md +29 -0
  3. package/dist/accordion.d.ts +15 -0
  4. package/dist/accordion.js +93 -0
  5. package/dist/alert-dialog.d.ts +26 -0
  6. package/dist/alert-dialog.js +142 -0
  7. package/dist/alert.d.ts +10 -0
  8. package/dist/alert.js +28 -0
  9. package/dist/{types/src/components/ambient/ambient.d.ts → ambient.d.ts} +4 -4
  10. package/dist/ambient.js +22 -0
  11. package/dist/{types/src/appearance → appearance}/platform.d.ts +3 -3
  12. package/dist/appearance/platform.js +43 -0
  13. package/dist/appearance/theme.d.ts +71 -0
  14. package/dist/appearance/theme.js +236 -0
  15. package/dist/appearance.d.ts +3 -0
  16. package/dist/appearance.js +3 -0
  17. package/dist/{types/src/components/aspect-ratio/aspect-ratio.d.ts → aspect-ratio.d.ts} +4 -4
  18. package/dist/aspect-ratio.js +17 -0
  19. package/dist/avatar.d.ts +5 -0
  20. package/dist/avatar.js +43 -0
  21. package/dist/badge.d.ts +8 -0
  22. package/dist/badge.js +21 -0
  23. package/dist/breadcrumb.d.ts +13 -0
  24. package/dist/breadcrumb.js +63 -0
  25. package/dist/button-group.d.ts +5 -0
  26. package/dist/button-group.js +14 -0
  27. package/dist/button.d.ts +21 -0
  28. package/dist/button.js +58 -0
  29. package/dist/calendar.d.ts +35 -0
  30. package/dist/calendar.js +225 -0
  31. package/dist/card.d.ts +9 -0
  32. package/dist/card.js +54 -0
  33. package/dist/chart.d.ts +30 -0
  34. package/dist/chart.js +226 -0
  35. package/dist/checkbox.d.ts +13 -0
  36. package/dist/checkbox.js +53 -0
  37. package/dist/{types/src/lib/clipboard.d.ts → clipboard.d.ts} +1 -1
  38. package/dist/clipboard.js +16 -0
  39. package/dist/cn.d.ts +2 -0
  40. package/dist/cn.js +10 -0
  41. package/dist/code-block.d.ts +34 -0
  42. package/dist/code-block.js +87 -0
  43. package/dist/collapsible.d.ts +13 -0
  44. package/dist/collapsible.js +49 -0
  45. package/dist/combobox.d.ts +25 -0
  46. package/dist/combobox.js +112 -0
  47. package/dist/command.d.ts +22 -0
  48. package/dist/command.js +129 -0
  49. package/dist/components/toast/toast-store.d.ts +60 -0
  50. package/dist/components/toast/toast-store.js +96 -0
  51. package/dist/{types/src/components → components}/toast/toaster.d.ts +4 -4
  52. package/dist/components/toast/toaster.js +345 -0
  53. package/dist/context-menu.d.ts +2 -0
  54. package/dist/context-menu.js +2 -0
  55. package/dist/conversation.d.ts +48 -0
  56. package/dist/conversation.js +202 -0
  57. package/dist/date-time-picker.d.ts +50 -0
  58. package/dist/date-time-picker.js +235 -0
  59. package/dist/date.d.ts +50 -0
  60. package/dist/date.js +77 -0
  61. package/dist/dialog.d.ts +21 -0
  62. package/dist/dialog.js +113 -0
  63. package/dist/drawer.d.ts +30 -0
  64. package/dist/drawer.js +140 -0
  65. package/dist/dropdown-menu.d.ts +56 -0
  66. package/dist/dropdown-menu.js +295 -0
  67. package/dist/empty.d.ts +11 -0
  68. package/dist/empty.js +51 -0
  69. package/dist/field.d.ts +16 -0
  70. package/dist/field.js +47 -0
  71. package/{src/hooks/scroll/minimize-decision.ts → dist/hooks/scroll/minimize-decision.js} +3 -5
  72. package/dist/{types/src/hooks → hooks}/use-anchored-placement.d.ts +2 -2
  73. package/dist/hooks/use-anchored-placement.js +33 -0
  74. package/dist/{types/src/hooks → hooks}/use-minimize-on-scroll.d.ts +1 -1
  75. package/dist/hooks/use-minimize-on-scroll.js +59 -0
  76. package/dist/{types/src/hooks → hooks}/use-visual-viewport.d.ts +2 -2
  77. package/{src/hooks/use-visual-viewport.ts → dist/hooks/use-visual-viewport.js} +20 -35
  78. package/dist/hooks/viewport/types.d.ts +7 -0
  79. package/dist/hooks/viewport/viewport-metrics.js +13 -0
  80. package/dist/index.d.ts +84 -0
  81. package/dist/index.js +80 -0
  82. package/dist/input-group.d.ts +17 -0
  83. package/dist/input-group.js +55 -0
  84. package/dist/input-otp.d.ts +13 -0
  85. package/dist/input-otp.js +36 -0
  86. package/dist/input.d.ts +4 -0
  87. package/dist/input.js +14 -0
  88. package/dist/item.d.ts +49 -0
  89. package/dist/item.js +142 -0
  90. package/dist/kbd.d.ts +4 -0
  91. package/dist/kbd.js +86 -0
  92. package/dist/label.d.ts +3 -0
  93. package/dist/label.js +12 -0
  94. package/dist/labeled-content.d.ts +24 -0
  95. package/dist/labeled-content.js +41 -0
  96. package/dist/{types/src/lib/language.d.ts → language.d.ts} +1 -1
  97. package/dist/language.js +11 -0
  98. package/dist/layout.d.ts +24 -0
  99. package/dist/layout.js +36 -0
  100. package/dist/{types/src/lib → lib}/anchored-placement.d.ts +27 -27
  101. package/dist/lib/anchored-placement.js +42 -0
  102. package/dist/lib/calendar-month.js +90 -0
  103. package/dist/lib/cx.js +6 -0
  104. package/dist/lib/drawer.math.js +29 -0
  105. package/dist/lib/floating-layers.d.ts +3 -0
  106. package/dist/lib/floating-layers.js +25 -0
  107. package/dist/{types/src/lib → lib}/haptics.d.ts +1 -1
  108. package/dist/lib/haptics.js +13 -0
  109. package/dist/lib/liquid-step.js +33 -0
  110. package/dist/lib/page-scale.js +58 -0
  111. package/dist/lib/portal.js +12 -0
  112. package/dist/lib/presence.js +53 -0
  113. package/dist/lib/range-value.js +25 -0
  114. package/dist/lib/render.d.ts +8 -0
  115. package/dist/lib/render.js +42 -0
  116. package/dist/lib/rolling-digit.js +83 -0
  117. package/dist/{types/src/lib → lib}/screen-edges.d.ts +5 -5
  118. package/dist/lib/screen-edges.js +30 -0
  119. package/dist/lib/swipe-touch-action.js +34 -0
  120. package/dist/lib/visual-viewport.js +27 -0
  121. package/dist/lib/water-drop.js +412 -0
  122. package/dist/lib/wheel.js +125 -0
  123. package/dist/list.d.ts +26 -0
  124. package/dist/list.js +80 -0
  125. package/dist/locales.d.ts +18 -0
  126. package/dist/locales.js +36 -0
  127. package/dist/marker.d.ts +13 -0
  128. package/dist/marker.js +33 -0
  129. package/dist/motion/transitions.d.ts +170 -0
  130. package/dist/motion/transitions.js +156 -0
  131. package/dist/pagination.d.ts +30 -0
  132. package/dist/pagination.js +117 -0
  133. package/dist/popover.d.ts +26 -0
  134. package/dist/popover.js +101 -0
  135. package/dist/progress.d.ts +9 -0
  136. package/dist/progress.js +24 -0
  137. package/dist/questionnaire.d.ts +46 -0
  138. package/dist/questionnaire.js +133 -0
  139. package/dist/radio-group.d.ts +21 -0
  140. package/dist/radio-group.js +67 -0
  141. package/dist/search-field.d.ts +18 -0
  142. package/dist/search-field.js +45 -0
  143. package/dist/segmented-control.d.ts +16 -0
  144. package/dist/segmented-control.js +25 -0
  145. package/dist/select.d.ts +24 -0
  146. package/dist/select.js +107 -0
  147. package/dist/separator.d.ts +9 -0
  148. package/dist/separator.js +17 -0
  149. package/dist/{types/src/lib/shapes.d.ts → shapes.d.ts} +2 -2
  150. package/dist/shapes.js +65 -0
  151. package/dist/sheet.d.ts +24 -0
  152. package/dist/sheet.js +141 -0
  153. package/dist/sidebar.d.ts +32 -0
  154. package/dist/sidebar.js +85 -0
  155. package/dist/skeleton.d.ts +3 -0
  156. package/dist/skeleton.js +13 -0
  157. package/dist/slider.d.ts +9 -0
  158. package/dist/slider.js +42 -0
  159. package/dist/slosh-slider.d.ts +21 -0
  160. package/dist/slosh-slider.js +205 -0
  161. package/dist/spinner.d.ts +3 -0
  162. package/dist/spinner.js +20 -0
  163. package/dist/stat-tile.d.ts +20 -0
  164. package/dist/stat-tile.js +53 -0
  165. package/dist/stepper.d.ts +22 -0
  166. package/dist/stepper.js +98 -0
  167. package/dist/swatch-picker.d.ts +22 -0
  168. package/dist/swatch-picker.js +70 -0
  169. package/dist/switch.d.ts +10 -0
  170. package/dist/switch.js +44 -0
  171. package/dist/tab-bar.d.ts +15 -0
  172. package/dist/tab-bar.js +34 -0
  173. package/dist/{types/src/components/table/table.d.ts → table.d.ts} +3 -3
  174. package/dist/table.js +93 -0
  175. package/dist/tabs.d.ts +32 -0
  176. package/dist/tabs.js +131 -0
  177. package/dist/text.d.ts +25 -0
  178. package/dist/text.js +44 -0
  179. package/dist/textarea.d.ts +3 -0
  180. package/dist/textarea.js +13 -0
  181. package/dist/toast.d.ts +3 -0
  182. package/dist/toast.js +3 -0
  183. package/dist/toggle-group.d.ts +20 -0
  184. package/dist/toggle-group.js +68 -0
  185. package/dist/toggle.d.ts +24 -0
  186. package/dist/toggle.js +37 -0
  187. package/dist/tokens.d.ts +1 -0
  188. package/dist/tooltip.d.ts +21 -0
  189. package/dist/tooltip.js +61 -0
  190. package/dist/trace.d.ts +14 -0
  191. package/dist/trace.js +54 -0
  192. package/dist/{types/src/hooks/use-dismiss.d.ts → use-dismiss.d.ts} +3 -3
  193. package/dist/use-dismiss.js +38 -0
  194. package/dist/{types/src/hooks/use-media-query.d.ts → use-media-query.d.ts} +12 -12
  195. package/dist/use-media-query.js +56 -0
  196. package/dist/use-os.d.ts +12 -0
  197. package/dist/use-os.js +17 -0
  198. package/dist/wake-slider.d.ts +15 -0
  199. package/dist/wake-slider.js +174 -0
  200. package/package.json +122 -253
  201. package/src/styles/code-block.css +4 -0
  202. package/src/styles/globals.css +5 -0
  203. package/src/styles/motion-controls.css +10 -0
  204. package/src/styles/page-scale.css +27 -0
  205. package/src/styles/styles.css +4 -2
  206. package/dist/types/src/appearance/index.d.ts +0 -2
  207. package/dist/types/src/appearance/theme.d.ts +0 -71
  208. package/dist/types/src/components/accordion/accordion.d.ts +0 -23
  209. package/dist/types/src/components/ambient/index.d.ts +0 -1
  210. package/dist/types/src/components/breadcrumb/breadcrumb.d.ts +0 -19
  211. package/dist/types/src/components/button/button-styles.d.ts +0 -12
  212. package/dist/types/src/components/button/button.d.ts +0 -32
  213. package/dist/types/src/components/button/icon-button.d.ts +0 -10
  214. package/dist/types/src/components/button/pending-spinner.d.ts +0 -5
  215. package/dist/types/src/components/button/use-pending-indicator.d.ts +0 -2
  216. package/dist/types/src/components/chip/chip.d.ts +0 -10
  217. package/dist/types/src/components/code-block/code-block.d.ts +0 -13
  218. package/dist/types/src/components/combo-box/combo-box.d.ts +0 -9
  219. package/dist/types/src/components/command/command.d.ts +0 -18
  220. package/dist/types/src/components/compact-date-picker/calendar-month.d.ts +0 -25
  221. package/dist/types/src/components/compact-date-picker/compact-date-picker.d.ts +0 -30
  222. package/dist/types/src/components/compact-time-picker/compact-time-picker.d.ts +0 -29
  223. package/dist/types/src/components/compact-time-picker/time-value.d.ts +0 -18
  224. package/dist/types/src/components/content-unavailable-view/content-unavailable-view.d.ts +0 -12
  225. package/dist/types/src/components/content-view/content-view.d.ts +0 -51
  226. package/dist/types/src/components/content-view/index.d.ts +0 -1
  227. package/dist/types/src/components/context-menu/conceal-menu-source.d.ts +0 -2
  228. package/dist/types/src/components/context-menu/context-menu-host.d.ts +0 -2
  229. package/dist/types/src/components/context-menu/context-menu-store.d.ts +0 -62
  230. package/dist/types/src/components/context-menu/menu-navigation.d.ts +0 -6
  231. package/dist/types/src/components/context-menu/menu-position.d.ts +0 -21
  232. package/dist/types/src/components/context-menu/menu-reveal.d.ts +0 -26
  233. package/dist/types/src/components/context-menu/use-context-menu.d.ts +0 -14
  234. package/dist/types/src/components/conversation/conversation.d.ts +0 -48
  235. package/dist/types/src/components/conversation/index.d.ts +0 -1
  236. package/dist/types/src/components/date-picker/date-picker.d.ts +0 -19
  237. package/dist/types/src/components/date-picker/date-value.d.ts +0 -2
  238. package/dist/types/src/components/dialog/dialog-host.d.ts +0 -6
  239. package/dist/types/src/components/dialog/dialog-store.d.ts +0 -23
  240. package/dist/types/src/components/dialog/dialog.d.ts +0 -33
  241. package/dist/types/src/components/dialog/index.d.ts +0 -1
  242. package/dist/types/src/components/disclosure-group/disclosure-group.d.ts +0 -18
  243. package/dist/types/src/components/divider/divider.d.ts +0 -9
  244. package/dist/types/src/components/inline-disclosure/inline-disclosure.d.ts +0 -15
  245. package/dist/types/src/components/keyboard-shortcut/keyboard-shortcut.d.ts +0 -8
  246. package/dist/types/src/components/labeled-content/labeled-content.d.ts +0 -22
  247. package/dist/types/src/components/locale-switcher/index.d.ts +0 -1
  248. package/dist/types/src/components/locale-switcher/locale-switcher.d.ts +0 -13
  249. package/dist/types/src/components/menu/menu.d.ts +0 -16
  250. package/dist/types/src/components/morph/index.d.ts +0 -2
  251. package/dist/types/src/components/morph/morph.d.ts +0 -32
  252. package/dist/types/src/components/morph/use-morph-disclosure.d.ts +0 -13
  253. package/dist/types/src/components/one-time-code/one-time-code.d.ts +0 -26
  254. package/dist/types/src/components/picker/picker-trigger.d.ts +0 -3
  255. package/dist/types/src/components/picker/picker.d.ts +0 -46
  256. package/dist/types/src/components/popover/anchored-surface.d.ts +0 -17
  257. package/dist/types/src/components/popover/index.d.ts +0 -41
  258. package/dist/types/src/components/popover/popover-content.d.ts +0 -32
  259. package/dist/types/src/components/popover/popover-fit.d.ts +0 -21
  260. package/dist/types/src/components/popover/popover-root.d.ts +0 -22
  261. package/dist/types/src/components/popover/popover-trigger.d.ts +0 -23
  262. package/dist/types/src/components/profile-image/profile-image.d.ts +0 -9
  263. package/dist/types/src/components/progress-view/progress-view.d.ts +0 -13
  264. package/dist/types/src/components/progress-view/use-liquid-progress.d.ts +0 -3
  265. package/dist/types/src/components/radio-group/radio-group.d.ts +0 -20
  266. package/dist/types/src/components/search-field/expanding-search-field.d.ts +0 -5
  267. package/dist/types/src/components/search-field/search-field.d.ts +0 -9
  268. package/dist/types/src/components/search-list/search-list.d.ts +0 -22
  269. package/dist/types/src/components/section/section.d.ts +0 -18
  270. package/dist/types/src/components/secure-field/secure-field.d.ts +0 -4
  271. package/dist/types/src/components/segmented-control/segmented-control.d.ts +0 -25
  272. package/dist/types/src/components/sheet/modal-environment.d.ts +0 -2
  273. package/dist/types/src/components/sheet/sheet-portal.d.ts +0 -5
  274. package/dist/types/src/components/sheet/sheet.d.ts +0 -26
  275. package/dist/types/src/components/sheet/use-sheet-focus.d.ts +0 -3
  276. package/dist/types/src/components/sidebar/sidebar.d.ts +0 -24
  277. package/dist/types/src/components/skeleton/skeleton.d.ts +0 -9
  278. package/dist/types/src/components/slider/slider.d.ts +0 -17
  279. package/dist/types/src/components/slosh-slider/liquid-step.d.ts +0 -6
  280. package/dist/types/src/components/slosh-slider/slosh-slider.d.ts +0 -21
  281. package/dist/types/src/components/stat-tile/index.d.ts +0 -1
  282. package/dist/types/src/components/stat-tile/stat-tile.d.ts +0 -20
  283. package/dist/types/src/components/status-indicator/status-indicator.d.ts +0 -17
  284. package/dist/types/src/components/stepper/rolling-digit.d.ts +0 -11
  285. package/dist/types/src/components/stepper/stepper.d.ts +0 -22
  286. package/dist/types/src/components/swatch-picker/swatch-picker.d.ts +0 -22
  287. package/dist/types/src/components/tab-bar/tab-bar.d.ts +0 -43
  288. package/dist/types/src/components/tab-view/tab-view.d.ts +0 -27
  289. package/dist/types/src/components/text-editor/text-editor.d.ts +0 -9
  290. package/dist/types/src/components/text-field/text-field.d.ts +0 -33
  291. package/dist/types/src/components/toast/toast-store.d.ts +0 -52
  292. package/dist/types/src/components/toggle/toggle.d.ts +0 -22
  293. package/dist/types/src/components/tooltip/tooltip-host.d.ts +0 -7
  294. package/dist/types/src/components/view-controller/index.d.ts +0 -1
  295. package/dist/types/src/components/view-controller/view-controller.d.ts +0 -21
  296. package/dist/types/src/components/wake-slider/wake-slider.d.ts +0 -15
  297. package/dist/types/src/hooks/scroll/minimize-decision.d.ts +0 -2
  298. package/dist/types/src/hooks/use-anchored-disclosure.d.ts +0 -9
  299. package/dist/types/src/hooks/use-floating-dismiss.d.ts +0 -3
  300. package/dist/types/src/hooks/viewport/types.d.ts +0 -19
  301. package/dist/types/src/hooks/viewport/viewport-metrics.d.ts +0 -3
  302. package/dist/types/src/icons/icons.d.ts +0 -616
  303. package/dist/types/src/index.d.ts +0 -73
  304. package/dist/types/src/lib/class-names.d.ts +0 -2
  305. package/dist/types/src/lib/date.d.ts +0 -50
  306. package/dist/types/src/lib/floating-layers.d.ts +0 -8
  307. package/dist/types/src/lib/range-value.d.ts +0 -4
  308. package/dist/types/src/machines/popover.machine.d.ts +0 -30
  309. package/dist/types/src/motion/transitions.d.ts +0 -170
  310. package/src/appearance/index.ts +0 -2
  311. package/src/appearance/platform.tsx +0 -102
  312. package/src/appearance/theme.tsx +0 -467
  313. package/src/components/accordion/accordion.tsx +0 -70
  314. package/src/components/ambient/ambient.tsx +0 -35
  315. package/src/components/ambient/index.ts +0 -1
  316. package/src/components/aspect-ratio/aspect-ratio.tsx +0 -27
  317. package/src/components/breadcrumb/breadcrumb.tsx +0 -73
  318. package/src/components/button/button-styles.ts +0 -49
  319. package/src/components/button/button.tsx +0 -107
  320. package/src/components/button/icon-button.tsx +0 -33
  321. package/src/components/button/pending-spinner.tsx +0 -14
  322. package/src/components/button/use-pending-indicator.ts +0 -22
  323. package/src/components/chip/chip.tsx +0 -45
  324. package/src/components/code-block/code-block.tsx +0 -48
  325. package/src/components/combo-box/combo-box.tsx +0 -13
  326. package/src/components/command/command.tsx +0 -149
  327. package/src/components/compact-date-picker/calendar-month.ts +0 -109
  328. package/src/components/compact-date-picker/compact-date-picker.tsx +0 -337
  329. package/src/components/compact-time-picker/compact-time-picker.tsx +0 -321
  330. package/src/components/compact-time-picker/time-value.ts +0 -58
  331. package/src/components/content-unavailable-view/content-unavailable-view.tsx +0 -78
  332. package/src/components/content-view/content-view.tsx +0 -215
  333. package/src/components/content-view/index.ts +0 -1
  334. package/src/components/context-menu/conceal-menu-source.ts +0 -30
  335. package/src/components/context-menu/context-menu-host.tsx +0 -459
  336. package/src/components/context-menu/context-menu-store.ts +0 -167
  337. package/src/components/context-menu/menu-navigation.ts +0 -36
  338. package/src/components/context-menu/menu-position.ts +0 -38
  339. package/src/components/context-menu/menu-reveal.ts +0 -42
  340. package/src/components/context-menu/use-context-menu.ts +0 -73
  341. package/src/components/conversation/conversation.tsx +0 -309
  342. package/src/components/conversation/index.ts +0 -1
  343. package/src/components/date-picker/date-picker.tsx +0 -106
  344. package/src/components/date-picker/date-value.ts +0 -22
  345. package/src/components/dialog/dialog-host.tsx +0 -119
  346. package/src/components/dialog/dialog-store.ts +0 -66
  347. package/src/components/dialog/dialog.tsx +0 -211
  348. package/src/components/dialog/index.ts +0 -1
  349. package/src/components/disclosure-group/disclosure-group.tsx +0 -108
  350. package/src/components/divider/divider.tsx +0 -33
  351. package/src/components/inline-disclosure/inline-disclosure.tsx +0 -53
  352. package/src/components/keyboard-shortcut/keyboard-shortcut.tsx +0 -32
  353. package/src/components/labeled-content/labeled-content.tsx +0 -84
  354. package/src/components/locale-switcher/index.ts +0 -1
  355. package/src/components/locale-switcher/locale-switcher.tsx +0 -311
  356. package/src/components/menu/menu.tsx +0 -85
  357. package/src/components/morph/index.ts +0 -2
  358. package/src/components/morph/morph.tsx +0 -258
  359. package/src/components/morph/use-morph-disclosure.ts +0 -27
  360. package/src/components/one-time-code/one-time-code.tsx +0 -234
  361. package/src/components/picker/picker-trigger.ts +0 -22
  362. package/src/components/picker/picker.tsx +0 -404
  363. package/src/components/popover/anchored-surface.tsx +0 -264
  364. package/src/components/popover/index.ts +0 -50
  365. package/src/components/popover/popover-content.tsx +0 -334
  366. package/src/components/popover/popover-fit.ts +0 -74
  367. package/src/components/popover/popover-root.tsx +0 -97
  368. package/src/components/popover/popover-trigger.tsx +0 -71
  369. package/src/components/profile-image/profile-image.tsx +0 -96
  370. package/src/components/progress-view/progress-view.tsx +0 -72
  371. package/src/components/progress-view/use-liquid-progress.ts +0 -43
  372. package/src/components/radio-group/radio-group.tsx +0 -86
  373. package/src/components/search-field/expanding-search-field.tsx +0 -197
  374. package/src/components/search-field/search-field.tsx +0 -66
  375. package/src/components/search-list/search-list.tsx +0 -276
  376. package/src/components/section/section.tsx +0 -75
  377. package/src/components/secure-field/secure-field.tsx +0 -8
  378. package/src/components/segmented-control/segmented-control.tsx +0 -157
  379. package/src/components/sheet/modal-environment.ts +0 -82
  380. package/src/components/sheet/sheet-portal.tsx +0 -62
  381. package/src/components/sheet/sheet.tsx +0 -165
  382. package/src/components/sheet/use-sheet-focus.ts +0 -109
  383. package/src/components/sidebar/sidebar.tsx +0 -102
  384. package/src/components/skeleton/skeleton.tsx +0 -38
  385. package/src/components/slider/slider.tsx +0 -134
  386. package/src/components/slosh-slider/liquid-step.ts +0 -43
  387. package/src/components/slosh-slider/slosh-slider.tsx +0 -294
  388. package/src/components/stat-tile/index.ts +0 -1
  389. package/src/components/stat-tile/stat-tile.tsx +0 -90
  390. package/src/components/status-indicator/status-indicator.tsx +0 -54
  391. package/src/components/stepper/rolling-digit.tsx +0 -91
  392. package/src/components/stepper/stepper.tsx +0 -136
  393. package/src/components/swatch-picker/swatch-picker.tsx +0 -138
  394. package/src/components/tab-bar/tab-bar.tsx +0 -182
  395. package/src/components/tab-view/tab-view.tsx +0 -155
  396. package/src/components/table/table.tsx +0 -151
  397. package/src/components/text-editor/text-editor.tsx +0 -42
  398. package/src/components/text-field/text-field.tsx +0 -200
  399. package/src/components/toast/toast-store.ts +0 -164
  400. package/src/components/toast/toaster.tsx +0 -407
  401. package/src/components/toggle/toggle.tsx +0 -320
  402. package/src/components/tooltip/tooltip-host.tsx +0 -178
  403. package/src/components/view-controller/index.ts +0 -1
  404. package/src/components/view-controller/view-controller.tsx +0 -75
  405. package/src/components/wake-slider/wake-slider.tsx +0 -260
  406. package/src/hooks/use-anchored-disclosure.ts +0 -23
  407. package/src/hooks/use-anchored-placement.ts +0 -40
  408. package/src/hooks/use-dismiss.ts +0 -44
  409. package/src/hooks/use-floating-dismiss.ts +0 -30
  410. package/src/hooks/use-media-query.ts +0 -94
  411. package/src/hooks/use-minimize-on-scroll.ts +0 -77
  412. package/src/hooks/viewport/types.ts +0 -19
  413. package/src/hooks/viewport/viewport-metrics.ts +0 -19
  414. package/src/icons/icons.tsx +0 -458
  415. package/src/index.ts +0 -107
  416. package/src/lib/anchored-placement.ts +0 -91
  417. package/src/lib/class-names.ts +0 -21
  418. package/src/lib/clipboard.ts +0 -15
  419. package/src/lib/date.ts +0 -86
  420. package/src/lib/floating-layers.ts +0 -53
  421. package/src/lib/haptics.ts +0 -23
  422. package/src/lib/language.ts +0 -16
  423. package/src/lib/range-value.ts +0 -38
  424. package/src/lib/screen-edges.ts +0 -44
  425. package/src/lib/shapes.ts +0 -59
  426. package/src/machines/popover.machine.ts +0 -51
  427. package/src/motion/transitions.ts +0 -97
  428. package/src/tokens.ts +0 -1
  429. /package/dist/{types/src/tokens.d.ts → tokens.js} +0 -0
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Opt in page scaling behind a Drawer. Put `data-passui-page` on the app root.
3
+ * The Drawer writes --passui-page-scale, --passui-page-radius and --passui-page-y,
4
+ * computed from `pageScale` in @passui/tokens/motion.
5
+ */
6
+ [data-passui-page][data-passui-page-active] {
7
+ transform-origin: top center;
8
+ transform: translate3d(0, var(--passui-page-y, 0px), 0)
9
+ scale(var(--passui-page-scale, 1));
10
+ border-radius: var(--passui-page-radius, 0px);
11
+ overflow: hidden;
12
+ transition:
13
+ transform var(--duration-sheet) var(--ease-sheet),
14
+ border-radius var(--duration-sheet) var(--ease-sheet);
15
+ }
16
+
17
+ [data-passui-page][data-passui-page-dragging] {
18
+ transition: none;
19
+ }
20
+
21
+ @media (prefers-reduced-motion: reduce) {
22
+ [data-passui-page][data-passui-page-active] {
23
+ transform: none;
24
+ border-radius: 0;
25
+ transition: none;
26
+ }
27
+ }
@@ -1,6 +1,8 @@
1
1
  @import "@passui/tokens/styles.css";
2
2
 
3
- @source "../";
4
3
  @import "./code-block.css";
5
-
6
4
  @import "./motion-controls.css";
5
+ @import "./page-scale.css";
6
+
7
+ @source "../";
8
+ @source "../../dist";
@@ -1,2 +0,0 @@
1
- export * from "./platform";
2
- export * from "./theme";
@@ -1,71 +0,0 @@
1
- import type { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from "react";
2
- type ValueObject = {
3
- [themeName: string]: string;
4
- };
5
- /**
6
- * Props for the useTheme hook
7
- * @author la niina
8
- */
9
- export type UseThemeProps = {
10
- /** List of all available theme names */
11
- themes: Array<string>;
12
- /** Forced theme name for the current page */
13
- forcedTheme?: string | undefined;
14
- /** Update the theme */
15
- setTheme: Dispatch<SetStateAction<string>>;
16
- /** Active theme name */
17
- theme?: string | undefined;
18
- /** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */
19
- systemTheme?: SystemTheme | undefined;
20
- };
21
- export type SystemTheme = "dark" | "light";
22
- export type Attribute = `data-${string}` | "class";
23
- export interface ThemeProviderProps extends PropsWithChildren {
24
- /** List of all available theme names */
25
- themes?: Array<string> | undefined;
26
- /** Forced theme name for the current page */
27
- forcedTheme?: string | undefined;
28
- /** Whether to switch between dark and light themes based on prefers-color-scheme */
29
- enableSystem?: boolean | undefined;
30
- /** Disable all CSS transitions when switching themes */
31
- disableTransitionOnChange?: boolean | undefined;
32
- /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
33
- enableColorScheme?: boolean | undefined;
34
- /** Key used to store theme setting in localStorage */
35
- storageKey?: string | undefined;
36
- /** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */
37
- defaultTheme?: string | undefined;
38
- /** HTML attribute modified based on the active theme. Accepts `class`, `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.), or an array which could include both */
39
- attribute?: Attribute | Array<Attribute> | undefined;
40
- /** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */
41
- value?: ValueObject | undefined;
42
- /** Nonce string to pass to the inline script for CSP headers */
43
- nonce?: string | undefined;
44
- }
45
- /**
46
- * Hook to access the theme context
47
- * @returns {UseThemeProps} theme context
48
- * @example
49
- * const { theme, setTheme } = useTheme()
50
- */
51
- export declare const useTheme: () => UseThemeProps;
52
- /**
53
- * Theme provider component is used to wrap your app &
54
- * provide theme context to all components. It can be used to switch
55
- * between themes.
56
- * @author la niina
57
- * @param {ThemeProviderProps} props
58
- * @returns {ReactNode} children
59
- * @example
60
- * <ThemeProvider attribute="class" disableTransitionOnChange>
61
- * <App />
62
- * </ThemeProvider>
63
- *
64
- * @example
65
- * <ThemeProvider themes={["light", "queer", "dark", "system"]} defaultTheme="light">
66
- * <App />
67
- * </ThemeProvider>
68
- */
69
- export declare const ThemeProvider: (props: ThemeProviderProps) => ReactNode;
70
- export declare const script: (attribute: Attribute | Array<Attribute>, storageKey: string, defaultTheme: string, forcedTheme: string | undefined, themes: Array<string>, value: ValueObject | undefined, enableSystem: boolean, enableColorScheme: boolean) => void;
71
- export {};
@@ -1,23 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import { type DisclosureGroupSize } from "../disclosure-group/disclosure-group";
3
- export type AccordionSize = DisclosureGroupSize;
4
- export interface AccordionItem {
5
- /** Stable value used to identify the expanded item. */
6
- value: string;
7
- title: string;
8
- content: ReactNode;
9
- description?: string;
10
- disabled?: boolean;
11
- }
12
- export interface AccordionProps {
13
- items: readonly AccordionItem[];
14
- /** The expanded item, or `null` when all items are closed. */
15
- value: string | null;
16
- /** Selecting the open item reports `null`, so every item can collapse. */
17
- onValueChange: (value: string | null) => void;
18
- /** Density passed through to each DisclosureGroup. @default "md" */
19
- size?: AccordionSize;
20
- className?: string;
21
- }
22
- /** A single-open, collapsible accordion with labelled animated content regions. */
23
- export declare function Accordion({ items, value, onValueChange, size, className, }: AccordionProps): import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./ambient";
@@ -1,19 +0,0 @@
1
- import type { ReactNode } from "react";
2
- export type BreadcrumbSize = "sm" | "md";
3
- export interface BreadcrumbItem {
4
- label: string;
5
- href?: string;
6
- }
7
- export interface BreadcrumbProps {
8
- label: string;
9
- items: readonly BreadcrumbItem[];
10
- className?: string;
11
- /** Integrate a client router without nesting interactive elements. */
12
- renderLink?: (item: BreadcrumbItem & {
13
- href: string;
14
- }) => ReactNode;
15
- /** Text scale. @default "md" */
16
- size?: BreadcrumbSize;
17
- }
18
- /** Ancestors stay links; the final item identifies the current page. */
19
- export declare function Breadcrumb({ label, items, className, renderLink, size, }: BreadcrumbProps): import("react").JSX.Element;
@@ -1,12 +0,0 @@
1
- export type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "accent";
2
- /** Icon-only buttons use the same sizing contract as Button. */
3
- export declare const iconButtonSizes: {
4
- readonly icon: "size-11 p-0 rounded-full";
5
- readonly "icon-xs": "size-8 p-0 rounded-full";
6
- readonly "icon-sm": "size-9 p-0 rounded-full";
7
- readonly "icon-lg": "size-12 p-0 rounded-full";
8
- };
9
- export type IconButtonSize = keyof typeof iconButtonSizes;
10
- export type ButtonSize = "default" | "xs" | "sm" | "lg" | "icon-full" | IconButtonSize;
11
- export declare const buttonVariants: Record<ButtonVariant, string>;
12
- export declare const buttonSizes: Record<ButtonSize, string>;
@@ -1,32 +0,0 @@
1
- import { type ButtonHTMLAttributes } from "react";
2
- import { type ButtonSize, type ButtonVariant } from "./button-styles";
3
- export type { ButtonSize, ButtonVariant };
4
- /**
5
- * Each variant has a little depth: a fine highlight along the top edge and
6
- * a soft, layered shadow, like a well-made physical key.
7
- */
8
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
9
- /**
10
- * Visual emphasis: `default` (solid), `accent` (main action),
11
- * `secondary` (quiet fill), `outline`, `ghost`, `link`, or `destructive`.
12
- * @default "default"
13
- */
14
- variant?: ButtonVariant;
15
- /**
16
- * Label sizes: `xs`, `sm`, `default`, `lg`.
17
- * Icon sizes: `icon-xs`, `icon-sm`, `icon`, `icon-lg`, `icon-full`.
18
- * Prefer IconButton for an icon with a built-in accessible label.
19
- * @default "default"
20
- */
21
- size?: ButtonSize;
22
- /** Shows a delayed spinner, keeps the button's width, and prevents repeat presses.
23
- * @default false
24
- */
25
- isPending?: boolean;
26
- /** Layout classes for the content wrapper, such as a full-width disclosure row. */
27
- contentClassName?: string;
28
- }
29
- /** Shares native button appearance with semantic links without nesting a button. */
30
- export declare function buttonStyle({ variant, size, className, }?: Pick<ButtonProps, "variant" | "size" | "className">): string;
31
- /** A native button with Passui styling, pending feedback, and an HTMLButtonElement ref. */
32
- export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,10 +0,0 @@
1
- import { type ButtonProps } from "./button";
2
- import type { ButtonVariant, IconButtonSize } from "./button-styles";
3
- export type { ButtonVariant, IconButtonSize };
4
- export interface IconButtonProps extends Omit<ButtonProps, "size"> {
5
- /** Icon-only actions must have an accessible name. */
6
- label: string;
7
- size?: IconButtonSize;
8
- }
9
- /** An accessible icon-only presentation of Button, sharing its interaction behavior. */
10
- export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Centred over the button while it is pending: fades in, spins, and is
3
- * sized from the text so it suits every button size.
4
- */
5
- export declare function PendingSpinner(): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- export declare function schedulePendingIndicator(onShow: () => void): () => void;
2
- export declare function usePendingIndicator(isPending: boolean): boolean;
@@ -1,10 +0,0 @@
1
- import type { HTMLAttributes } from "react";
2
- export type ChipTone = "neutral" | "accent" | "public" | "family" | "friends";
3
- export type ChipSize = "xs" | "sm" | "md";
4
- export interface ChipProps extends HTMLAttributes<HTMLSpanElement> {
5
- /** `neutral`, `accent`, `public`, `family`, or `friends`. @default "neutral" */
6
- tone?: ChipTone;
7
- /** `xs`, `sm`, or `md`. @default "sm" */
8
- size?: ChipSize;
9
- }
10
- export declare function Chip({ tone, size, className, ...props }: ChipProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { type ComponentProps, type ReactNode } from "react";
2
- export type CodeBlockSize = "sm" | "md" | "lg";
3
- export interface CodeBlockProps extends Omit<ComponentProps<"div">, "children" | "size"> {
4
- code: string;
5
- /** Supply a highlighter's rendered pre/code element; source remains the fallback. */
6
- children?: ReactNode;
7
- /** Show a nonselectable line gutter. @default true */
8
- lineNumbers?: boolean;
9
- /** Code font size, padding and line gutter scale. @default "md" */
10
- size?: CodeBlockSize;
11
- }
12
- /** Code presentation without shipping a highlighter or formatter to consumers. */
13
- export declare function CodeBlock({ code, children, lineNumbers, size, className, ...props }: CodeBlockProps): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { type PickerOption, type PickerProps } from "../picker/picker";
2
- export interface ComboBoxOption<T extends string> extends PickerOption<T> {
3
- }
4
- export interface ComboBoxProps<T extends string> extends Omit<PickerProps<T>, "searchable" | "options"> {
5
- options: readonly ComboBoxOption<T>[];
6
- emptyLabel: string;
7
- }
8
- /** A searchable Picker, with optional creation from the person's typed query. */
9
- export declare function ComboBox<T extends string>(props: ComboBoxProps<T>): import("react").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { type ComponentProps } from "react";
2
- import { KeyboardShortcut } from "../keyboard-shortcut/keyboard-shortcut";
3
- import { SearchList, SearchListField, SearchListResults, SearchListEmpty, SearchListGroup, SearchListItem } from "../search-list/search-list";
4
- import { type SheetProps } from "../sheet/sheet";
5
- export interface CommandProps extends ComponentProps<typeof SearchList> {
6
- }
7
- export interface CommandDialogProps extends Omit<SheetProps, "placement"> {
8
- }
9
- /** An inline command palette. SearchList owns filtering and keyboard selection. */
10
- export declare function Command({ className, ...props }: CommandProps): import("react").JSX.Element;
11
- /** A modal command palette with Sheet's focus isolation and restoration. */
12
- export declare function CommandDialog({ children, className, ...props }: CommandDialogProps): import("react").JSX.Element;
13
- export declare function CommandInput({ className, autoFocus, ref: forwardedRef, ...props }: ComponentProps<typeof SearchListField>): import("react").JSX.Element;
14
- export declare function CommandList({ className, ...props }: ComponentProps<typeof SearchListResults>): import("react").JSX.Element;
15
- export declare function CommandEmpty({ className, ...props }: ComponentProps<typeof SearchListEmpty>): import("react").JSX.Element;
16
- export declare function CommandShortcut({ className, ...props }: ComponentProps<typeof KeyboardShortcut>): import("react").JSX.Element;
17
- export declare function CommandGroup({ className, ...props }: ComponentProps<typeof SearchListGroup>): import("react").JSX.Element;
18
- export declare function CommandItem({ className, ...props }: ComponentProps<typeof SearchListItem>): import("react").JSX.Element;
@@ -1,25 +0,0 @@
1
- /** A calendar day, with `month` counted from 1. */
2
- export interface CalendarDay {
3
- year: number;
4
- month: number;
5
- day: number;
6
- }
7
- /** Reads `YYYY-MM-DD`; null for anything else, or a date that doesn't exist. */
8
- export declare function parseDay(value: string): CalendarDay | null;
9
- export declare function formatDay({ year, month, day }: CalendarDay): string;
10
- /** Moves by whole days, across months and years. */
11
- export declare function addDays(day: CalendarDay, count: number): CalendarDay;
12
- /** Moves by months, keeping the day where the month allows (31 Jan + 1 is 28 or 29 Feb). */
13
- export declare function addMonths(day: CalendarDay, count: number): CalendarDay;
14
- /**
15
- * The first day of the week where `locale` is used, 1 (Monday) to 7
16
- * (Sunday), from the browser where it knows, else Monday except in the
17
- * places that start on Sunday.
18
- */
19
- export declare function firstWeekday(locale: string): number;
20
- /** Six weeks covering `year`/`month`, starting on `firstDay` (1 to 7). */
21
- export declare function monthGrid(year: number, month: number, firstDay: number): Array<CalendarDay & {
22
- inMonth: boolean;
23
- }>;
24
- /** Whether `value` (`YYYY-MM-DD`) lies within the optional bounds. */
25
- export declare function withinBounds(value: string, min?: string, max?: string): boolean;
@@ -1,30 +0,0 @@
1
- import { type PickerSize } from "../picker/picker-trigger";
2
- export interface CompactDatePickerProps {
3
- /** `YYYY-MM-DD`, or "" when no date is chosen. */
4
- value: string;
5
- onChange: (value: string) => void;
6
- /** Names the button and the calendar for assistive technology. */
7
- label: string;
8
- locale: string;
9
- min?: string;
10
- max?: string;
11
- /** Shown when no date is chosen. */
12
- placeholder?: string;
13
- labels: {
14
- previousMonth: string;
15
- nextMonth: string;
16
- /** Offers to remove the date, for optional dates. */
17
- clear?: string;
18
- };
19
- className?: string;
20
- /** Prevents opening the date panel. @default false */
21
- disabled?: boolean;
22
- /** Trigger button density; matches Picker's sm | md | lg. @default "md" */
23
- size?: PickerSize;
24
- }
25
- /**
26
- * A date as a compact button that opens a month calendar, like SwiftUI's
27
- * compact DatePicker: for dates on a calendar, such as an event or an
28
- * invoice. For dates people know by heart, like a birthday, use DatePicker.
29
- */
30
- export declare function CompactDatePicker({ value, onChange, label, locale, min, max, placeholder, labels, className, disabled, size, }: CompactDatePickerProps): import("react").JSX.Element;
@@ -1,29 +0,0 @@
1
- import { type PickerSize } from "../picker/picker-trigger";
2
- export interface CompactTimePickerProps {
3
- /** `HH:MM` on a 24 hour clock, or "" when no time is chosen. */
4
- value: string;
5
- onChange: (value: string) => void;
6
- /** Names the button and the panel for assistive technology. */
7
- label: string;
8
- locale: string;
9
- /** Minutes offered, in steps; an exact time already chosen is kept. */
10
- minuteStep?: number;
11
- /** Shown when no time is chosen. */
12
- placeholder?: string;
13
- labels: {
14
- hour: string;
15
- minute: string;
16
- period: string;
17
- };
18
- className?: string;
19
- /** Prevents opening the time panel. @default false */
20
- disabled?: boolean;
21
- /** Trigger button density; matches Picker's sm | md | lg. @default "md" */
22
- size?: PickerSize;
23
- }
24
- /**
25
- * A time as a compact button that opens columns of hours and minutes,
26
- * like SwiftUI's compact DatePicker for times, on the clock the locale
27
- * reads (12 hours with AM and PM, or 24).
28
- */
29
- export declare function CompactTimePicker({ value, onChange, label, locale, minuteStep, placeholder, labels, className, disabled, size, }: CompactTimePickerProps): import("react").JSX.Element;
@@ -1,18 +0,0 @@
1
- /** A time of day on a 24 hour clock. */
2
- export interface TimeOfDay {
3
- hour: number;
4
- minute: number;
5
- }
6
- /** Reads `HH:MM` (24 hour); null for anything else. */
7
- export declare function parseTime(value: string): TimeOfDay | null;
8
- export declare function formatTime({ hour, minute }: TimeOfDay): string;
9
- /** Whether people where `locale` is used read time on a 12 hour clock. */
10
- export declare function usesTwelveHours(locale: string): boolean;
11
- /** The hour as shown on a 12 hour clock (12, 1 to 11) and whether it's after noon. */
12
- export declare function toTwelveHours(hour: number): {
13
- hour: number;
14
- pm: boolean;
15
- };
16
- export declare function fromTwelveHours(hour: number, pm: boolean): number;
17
- /** Minutes offered in steps of `step`, keeping `current` when it falls between them. */
18
- export declare function minuteChoices(step: number, current?: number): number[];
@@ -1,12 +0,0 @@
1
- import type { ReactNode, ComponentProps } from "react";
2
- export type ContentUnavailableViewSize = "sm" | "md" | "lg";
3
- export interface ContentUnavailableViewProps extends Omit<ComponentProps<"div">, "title"> {
4
- title: string;
5
- description?: string;
6
- icon?: ReactNode;
7
- actions?: ReactNode;
8
- /** Title, description and vertical rhythm. @default "md" */
9
- size?: ContentUnavailableViewSize;
10
- }
11
- /** A focused empty or unavailable state with an optional next action. */
12
- export declare function ContentUnavailableView({ title, description, icon, actions, size, className, ...props }: ContentUnavailableViewProps): import("react").JSX.Element;
@@ -1,51 +0,0 @@
1
- import { type ComponentPropsWithoutRef, type PropsWithChildren, type ReactNode } from "react";
2
- export type ContentViewVariant = keyof typeof variants;
3
- export type ContentViewHeadingLevel = "h1" | "h2" | "h3";
4
- export type ContentViewSize = "sm" | "md" | "lg";
5
- type ContentViewProps = ComponentPropsWithoutRef<"section"> & {
6
- variant?: ContentViewVariant;
7
- /** Container radius, section gap and text scale. @default "md" */
8
- size?: ContentViewSize;
9
- };
10
- type RowProps = ComponentPropsWithoutRef<"div">;
11
- type SectionProps = ComponentPropsWithoutRef<"section">;
12
- type HeaderProps = PropsWithChildren<{
13
- heading: string;
14
- p?: string;
15
- pClassName?: string;
16
- icon?: ReactNode;
17
- action?: ReactNode;
18
- actionClassName?: string;
19
- as?: ContentViewHeadingLevel;
20
- className?: string;
21
- }>;
22
- type H1Props = ComponentPropsWithoutRef<"h1">;
23
- type H2Props = ComponentPropsWithoutRef<"h2">;
24
- type PProps = ComponentPropsWithoutRef<"p">;
25
- type SpanProps = ComponentPropsWithoutRef<"span">;
26
- type SubProps = ComponentPropsWithoutRef<"sub">;
27
- declare const variants: {
28
- readonly elevated: string;
29
- };
30
- export declare function ContentView({ variant, size, className, children, ...props }: ContentViewProps): import("react").JSX.Element;
31
- export declare namespace ContentView {
32
- export { Row };
33
- export { Section };
34
- export { Header };
35
- export { Divider };
36
- export { H1 };
37
- export { H2 };
38
- export { P };
39
- export { Span };
40
- export { Sub };
41
- }
42
- declare function Row({ className, children, ...props }: RowProps): import("react").JSX.Element;
43
- declare function Section({ className, children, ...props }: SectionProps): import("react").JSX.Element;
44
- declare function Header({ heading, p, pClassName, icon, action, actionClassName, as: Tag, className, children, }: HeaderProps): import("react").JSX.Element;
45
- declare function Divider(): import("react").JSX.Element;
46
- declare function H1({ className, children, ...props }: H1Props): import("react").JSX.Element;
47
- declare function H2({ className, children, ...props }: H2Props): import("react").JSX.Element;
48
- declare function P({ className, children, ...props }: PProps): import("react").JSX.Element;
49
- declare function Span({ className, children, ...props }: SpanProps): import("react").JSX.Element;
50
- declare function Sub({ className, children, ...props }: SubProps): import("react").JSX.Element;
51
- export {};
@@ -1 +0,0 @@
1
- export * from "./content-view";
@@ -1,2 +0,0 @@
1
- /** Follow-up menus share ownership until the last surface finishes closing. */
2
- export declare function concealMenuSource(element: HTMLElement, inert: boolean): () => boolean;
@@ -1,2 +0,0 @@
1
- /** Renders the open context menu. Mount once, near the app root. */
2
- export declare function ContextMenuHost(): import("react").JSX.Element;
@@ -1,62 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { MenuRect } from "./menu-reveal";
3
- export type ContextMenuAlignX = "start" | "end";
4
- export type ContextMenuAlignY = "top" | "bottom";
5
- export type ContextMenuEdge = "leading" | "trailing";
6
- export type ContextMenuSize = "sm" | "md" | "lg";
7
- /** One row of a context menu, or a divider between groups of rows. */
8
- export type ContextMenuItem = {
9
- label: string;
10
- icon?: ReactNode;
11
- onSelect: () => void;
12
- destructive?: boolean;
13
- disabled?: boolean;
14
- /** Marks the current choice, e.g. a note's kind. */
15
- checked?: boolean;
16
- } | {
17
- heading: string;
18
- } | "divider";
19
- export interface OpenMenu {
20
- id: number;
21
- anchor: Element | null;
22
- x: number;
23
- y: number;
24
- items: ContextMenuItem[];
25
- /** Opened by long-press: bigger rows for fingers. */
26
- touch: boolean;
27
- /** Surface, item and heading density. @default "md" */
28
- size: ContextMenuSize;
29
- /** Which edge of the menu sits at `x`: its left (`start`) or its right (`end`). */
30
- alignX: ContextMenuAlignX;
31
- /** Which edge of the menu sits at `y`: its top (`top`) or its bottom (`bottom`). */
32
- alignY: ContextMenuAlignY;
33
- source?: MenuRect;
34
- toolbar?: HTMLElement;
35
- toolbarRect?: MenuRect;
36
- restoreFocus?: boolean;
37
- }
38
- /** Opens a menu at a point, such as where a pointer was pressed. */
39
- export declare function openContextMenu(x: number, y: number, items: ContextMenuItem[], touch?: boolean, anchor?: Element | null, size?: ContextMenuSize): void;
40
- /**
41
- * Opens a second menu where the last one stood, the way an iOS menu swaps
42
- * in a submenu: a long list (a note's fonts, its kinds) stays one row in the
43
- * first menu instead of making it tall.
44
- */
45
- export declare function openFollowUpMenu(items: ContextMenuItem[]): void;
46
- /**
47
- * Expands a control into a menu, lined up with its leading or trailing
48
- * edge and growing down (or up) from the control's bounds. Leading and
49
- * trailing follow the text direction, so right-to-left languages mirror.
50
- * The menu's real size decides where it goes; nothing is guessed.
51
- */
52
- export declare function openMenu(anchor: Element, items: ContextMenuItem[], { edge, above, toolbar, size, }?: {
53
- edge?: ContextMenuEdge;
54
- above?: boolean;
55
- /** Replace this action group with a horizontally expanding menu surface. */
56
- toolbar?: HTMLElement;
57
- /** Surface, item and heading density. @default "md" */
58
- size?: ContextMenuSize;
59
- }): void;
60
- export declare function closeContextMenu(restoreFocus?: boolean): void;
61
- export declare function subscribeContextMenu(listener: () => void): () => void;
62
- export declare function getContextMenu(): OpenMenu | null;
@@ -1,6 +0,0 @@
1
- export type MenuNavigationKey = "ArrowDown" | "ArrowUp" | "Home" | "End";
2
- export declare function isMenuNavigationKey(key: string): key is MenuNavigationKey;
3
- /** Index of the next enabled action in a menu, with wrapping arrow navigation. */
4
- export declare function nextMenuIndex(key: MenuNavigationKey, current: number, count: number): number;
5
- /** Finds a matching label after the current action, wrapping at the end. */
6
- export declare function findMenuTypeaheadIndex(labels: ReadonlyArray<string>, query: string, current: number): number;
@@ -1,21 +0,0 @@
1
- import type { OpenMenu } from "./context-menu-store";
2
- import type { MenuRect } from "./menu-reveal";
3
- type MenuAnchor = Pick<OpenMenu, "x" | "y" | "alignX" | "alignY">;
4
- type MenuSize = Pick<MenuRect, "width" | "height">;
5
- type MenuBounds = {
6
- left: number;
7
- top: number;
8
- right: number;
9
- bottom: number;
10
- };
11
- /** Fit within the current visible viewport, including a keyboard or Safari pan. */
12
- export declare function menuPosition(menu: MenuAnchor, size: MenuSize, bounds: MenuBounds): {
13
- left: number;
14
- top: number;
15
- originX: number;
16
- originY: number;
17
- maxHeight: number;
18
- width: number;
19
- height: number;
20
- };
21
- export {};
@@ -1,26 +0,0 @@
1
- export type MenuRect = {
2
- left: number;
3
- top: number;
4
- width: number;
5
- height: number;
6
- };
7
- /** Return toward the source while handing its material back to the real trigger. */
8
- export declare function menuSurfaceExit(source: ReturnType<typeof menuSurfaceReveal>): {
9
- opacity: number;
10
- x: number;
11
- y: number;
12
- width: number;
13
- height: number;
14
- borderRadius: number;
15
- };
16
- /** Animate the material's bounds independently so menu text never stretches. */
17
- export declare function menuSurfaceReveal(source: MenuRect | undefined, target: MenuRect & {
18
- radius?: number;
19
- }): {
20
- x: number;
21
- y: number;
22
- width: number;
23
- height: number;
24
- opacity: number;
25
- borderRadius: number;
26
- };
@@ -1,14 +0,0 @@
1
- import { type MouseEvent, type PointerEvent } from "react";
2
- import { type ContextMenuItem } from "./context-menu-store";
3
- /**
4
- * Right-click on desktop, long-press on touch screens: both open the same
5
- * menu of actions. Spread the returned handlers onto the element.
6
- */
7
- export declare function useContextMenu(items: () => ContextMenuItem[]): {
8
- onContextMenu(event: MouseEvent): void;
9
- onPointerDown(event: PointerEvent): void;
10
- onPointerMove(event: PointerEvent): void;
11
- onPointerUp: () => void;
12
- onPointerCancel: () => void;
13
- onClickCapture(event: MouseEvent): void;
14
- };