@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,3 @@
1
+ import { ComponentProps } from "react";
2
+ /** A native multi line input. It grows with its content where the browser supports it. */
3
+ export declare function Textarea({ className, ...props }: ComponentProps<"textarea">): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { cx } from "./lib/cx.js";
2
+ import { inputStyles } from "./input.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/textarea.tsx
5
+ /** A native multi line input. It grows with its content where the browser supports it. */
6
+ function Textarea({ className, ...props }) {
7
+ return /* @__PURE__ */ jsx("textarea", {
8
+ "data-slot": "textarea",
9
+ className: cx(inputStyles, "field-sizing-content min-h-16 py-2", className),
10
+ ...props
11
+ });
12
+ }
13
+ export { Textarea };
@@ -0,0 +1,3 @@
1
+ import { Toast, ToastAction, ToastInput, ToastOptions, ToastSize, ToastTone, toast } from "./components/toast/toast-store.js";
2
+ import { Toaster } from "./components/toast/toaster.js";
3
+ export { type Toast, type ToastAction, type ToastInput, type ToastOptions, type ToastSize, type ToastTone, Toaster, toast };
package/dist/toast.js ADDED
@@ -0,0 +1,3 @@
1
+ import { toast } from "./components/toast/toast-store.js";
2
+ import { Toaster } from "./components/toast/toaster.js";
3
+ export { Toaster, toast };
@@ -0,0 +1,20 @@
1
+ import { ToggleSize, ToggleVariant } from "./toggle.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ import * as group from "@zag-js/toggle-group";
4
+ type Style = {
5
+ variant: ToggleVariant;
6
+ size: ToggleSize;
7
+ };
8
+ export interface ToggleGroupProps extends Omit<group.Props, "id" | "ids" | "onValueChange">, Partial<Style> {
9
+ onValueChange?: (value: string[]) => void;
10
+ children?: ReactNode;
11
+ className?: string;
12
+ }
13
+ /** A row of toggles. `multiple` allows several on at once; otherwise it behaves like a segmented control. */
14
+ export declare function ToggleGroup({ onValueChange, variant, size, children, className, ...props }: ToggleGroupProps): import("react").JSX.Element;
15
+ export type ToggleGroupItemProps = Omit<ComponentProps<"button">, "value"> & {
16
+ value: string;
17
+ disabled?: boolean;
18
+ };
19
+ export declare function ToggleGroupItem({ value, disabled, className, ...props }: ToggleGroupItemProps): import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { cx } from "./lib/cx.js";
3
+ import { toggleVariants } from "./toggle.js";
4
+ import { normalizeProps, useMachine } from "@zag-js/react";
5
+ import { createContext, useContext, useId, useLayoutEffect, useRef } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import * as group from "@zag-js/toggle-group";
8
+ // src/components/toggle-group.tsx
9
+ const Context = createContext(null);
10
+ function useGroup() {
11
+ const ctx = useContext(Context);
12
+ if (!ctx) throw new Error("ToggleGroupItem must be used inside <ToggleGroup>.");
13
+ return ctx;
14
+ }
15
+ /** A row of toggles. `multiple` allows several on at once; otherwise it behaves like a segmented control. */
16
+ function ToggleGroup({ onValueChange, variant = "default", size = "default", children, className, ...props }) {
17
+ const id = useId();
18
+ const service = useMachine(group.machine, {
19
+ id,
20
+ onValueChange: ({ value }) => onValueChange?.(value),
21
+ ...props
22
+ });
23
+ const api = group.connect(service, normalizeProps);
24
+ const root = useRef(null);
25
+ const single = !props.multiple;
26
+ useLayoutEffect(() => {
27
+ const el = root.current;
28
+ const on = el?.querySelector("[data-state=on]");
29
+ if (!el) return;
30
+ if (!on) return void el.style.setProperty("--lens-w", "0px");
31
+ el.style.setProperty("--lens-x", `${on.offsetLeft}px`);
32
+ el.style.setProperty("--lens-w", `${on.offsetWidth}px`);
33
+ }, [api.value]);
34
+ return /* @__PURE__ */ jsx(Context.Provider, {
35
+ value: {
36
+ api,
37
+ style: {
38
+ variant,
39
+ size
40
+ },
41
+ single
42
+ },
43
+ children: /* @__PURE__ */ jsxs("div", {
44
+ ...api.getRootProps(),
45
+ ref: root,
46
+ "data-slot": "toggle-group",
47
+ className: cx("glass relative inline-flex w-fit items-center gap-1 rounded-full p-1", className),
48
+ children: [single ? /* @__PURE__ */ jsx("span", {
49
+ "aria-hidden": "true",
50
+ "data-slot": "toggle-group-indicator",
51
+ className: "glass-lens spring-smooth absolute inset-y-1 left-0 z-0 w-(--lens-w,0px) translate-x-(--lens-x,0px) rounded-full transition-[translate,width] motion-reduce:transition-none"
52
+ }) : null, children]
53
+ })
54
+ });
55
+ }
56
+ function ToggleGroupItem({ value, disabled, className, ...props }) {
57
+ const { api, style, single } = useGroup();
58
+ return /* @__PURE__ */ jsx("button", {
59
+ ...api.getItemProps({
60
+ value,
61
+ disabled
62
+ }),
63
+ "data-slot": "toggle-group-item",
64
+ className: cx(toggleVariants.base, toggleVariants.variant[style.variant], toggleVariants.size[style.size], "relative z-10 hover:bg-transparent data-[state=on]:text-label text-label-secondary active:scale-[0.96] spring-snappy", single ? "data-[state=on]:bg-transparent" : "data-[state=on]:bg-fill", className),
65
+ ...props
66
+ });
67
+ }
68
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,24 @@
1
+ import { ComponentProps } from "react";
2
+ export type ToggleVariant = "default" | "outline";
3
+ export type ToggleSize = "default" | "sm" | "lg";
4
+ export declare const toggleVariants: {
5
+ base: string;
6
+ variant: {
7
+ default: string;
8
+ outline: string;
9
+ };
10
+ size: {
11
+ default: string;
12
+ sm: string;
13
+ lg: string;
14
+ };
15
+ };
16
+ export type ToggleProps = Omit<ComponentProps<"button">, "onChange"> & {
17
+ pressed?: boolean;
18
+ defaultPressed?: boolean;
19
+ onPressedChange?: (pressed: boolean) => void;
20
+ variant?: ToggleVariant;
21
+ size?: ToggleSize;
22
+ };
23
+ /** A two state button with `aria-pressed`. */
24
+ export declare function Toggle({ pressed: controlled, defaultPressed, onPressedChange, variant, size, className, onClick, ...props }: ToggleProps): import("react").JSX.Element;
package/dist/toggle.js ADDED
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { cx } from "./lib/cx.js";
3
+ import { useState } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/toggle.tsx
6
+ const toggleVariants = {
7
+ base: "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-semibold outline-none transition spring-snappy active:scale-[0.96] hover:bg-fill/80 focus-visible:ring-2 focus-visible:ring-accent/70 disabled:pointer-events-none disabled:opacity-40 aria-pressed:bg-fill aria-pressed:text-label data-[state=on]:bg-fill motion-reduce:transition-none motion-reduce:active:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
8
+ variant: {
9
+ default: "",
10
+ outline: "shadow-[inset_0_0_0_0.5px_var(--color-separator)]"
11
+ },
12
+ size: {
13
+ default: "h-8.5 min-w-8.5 px-3 text-footnote",
14
+ sm: "h-7.5 min-w-7.5 px-2.5 text-caption",
15
+ lg: "h-9.5 min-w-9.5 px-4 text-subheadline"
16
+ }
17
+ };
18
+ /** A two state button with `aria-pressed`. */
19
+ function Toggle({ pressed: controlled, defaultPressed = false, onPressedChange, variant = "default", size = "default", className, onClick, ...props }) {
20
+ const [inner, setInner] = useState(defaultPressed);
21
+ const pressed = controlled ?? inner;
22
+ return /* @__PURE__ */ jsx("button", {
23
+ type: "button",
24
+ "data-slot": "toggle",
25
+ "data-state": pressed ? "on" : "off",
26
+ "aria-pressed": pressed,
27
+ className: cx(toggleVariants.base, toggleVariants.variant[variant], toggleVariants.size[size], className),
28
+ onClick: (event) => {
29
+ onClick?.(event);
30
+ if (event.defaultPrevented) return;
31
+ if (controlled === void 0) setInner(!pressed);
32
+ onPressedChange?.(!pressed);
33
+ },
34
+ ...props
35
+ });
36
+ }
37
+ export { Toggle, toggleVariants };
@@ -0,0 +1 @@
1
+ export * from "@passui/tokens";
@@ -0,0 +1,21 @@
1
+ import { RenderProp } from "./lib/render.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ import * as tooltip from "@zag-js/tooltip";
4
+ export interface TooltipProps extends Omit<tooltip.Props, "id" | "ids" | "positioning"> {
5
+ /** Where the tip sits against its trigger. Defaults to `top`. */
6
+ placement?: tooltip.Placement;
7
+ /** Gap between trigger and tip, in pixels. Defaults to 6. */
8
+ offset?: number;
9
+ children?: ReactNode;
10
+ }
11
+ /**
12
+ * Opens on hover and keyboard focus only, never on touch. After one tip opens,
13
+ * its neighbours open without the delay (Zag shares that warm-up window).
14
+ */
15
+ export declare function Tooltip({ children, placement, offset, ...props }: TooltipProps): import("react").JSX.Element;
16
+ export declare function TooltipTrigger({ render, ...props }: ComponentProps<"button"> & {
17
+ render?: RenderProp;
18
+ }): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
19
+ export declare function TooltipContent({ className, render, ...props }: ComponentProps<"div"> & {
20
+ render?: RenderProp;
21
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { cx } from "./lib/cx.js";
3
+ import { Portal } from "./lib/portal.js";
4
+ import { usePresence } from "./lib/presence.js";
5
+ import { mergeProps, renderPart } from "./lib/render.js";
6
+ import { normalizeProps, useMachine } from "@zag-js/react";
7
+ import { createContext, useContext, useId } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ import * as tooltip from "@zag-js/tooltip";
10
+ // src/components/tooltip.tsx
11
+ const Context = createContext(null);
12
+ function useTooltip() {
13
+ const api = useContext(Context);
14
+ if (!api) throw new Error("Tooltip parts must be used inside <Tooltip>.");
15
+ return api;
16
+ }
17
+ /**
18
+ * Opens on hover and keyboard focus only, never on touch. After one tip opens,
19
+ * its neighbours open without the delay (Zag shares that warm-up window).
20
+ */
21
+ function Tooltip({ children, placement = "top", offset = 6, ...props }) {
22
+ const id = useId();
23
+ const service = useMachine(tooltip.machine, {
24
+ id,
25
+ positioning: {
26
+ placement,
27
+ offset: { mainAxis: offset }
28
+ },
29
+ ...props
30
+ });
31
+ const api = tooltip.connect(service, normalizeProps);
32
+ return /* @__PURE__ */ jsx(Context.Provider, {
33
+ value: api,
34
+ children
35
+ });
36
+ }
37
+ function TooltipTrigger({ render, ...props }) {
38
+ const api = useTooltip();
39
+ return renderPart("button", mergeProps({
40
+ ...api.getTriggerProps(),
41
+ "data-slot": "tooltip-trigger"
42
+ }, props), render);
43
+ }
44
+ function TooltipContent({ className, render, ...props }) {
45
+ const api = useTooltip();
46
+ const { ref, mounted, attrs } = usePresence(api.open);
47
+ if (!mounted) return null;
48
+ return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx("div", {
49
+ ...api.getPositionerProps(),
50
+ className: "z-[80]",
51
+ children: renderPart("div", mergeProps({
52
+ ...api.getContentProps(),
53
+ ...attrs,
54
+ ref,
55
+ hidden: false,
56
+ "data-slot": "tooltip-content",
57
+ className: cx("pointer-events-none max-w-64 liquid-glass-dense squircle [--squircle-radius:0.875rem] px-2.5 py-1.5 text-center text-caption leading-tight font-medium text-label transition spring-smooth origin-(--transform-origin,center) data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:scale-[0.88] data-starting-style:scale-[0.88] motion-reduce:transition-none motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100", className)
58
+ }, props), render)
59
+ }) });
60
+ }
61
+ export { Tooltip, TooltipContent, TooltipTrigger };
@@ -0,0 +1,14 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ export type TraceStatus = "pending" | "running" | "done" | "error";
3
+ /** A timeline of steps: reasoning, tool calls, sources. Each step can fold open its detail. */
4
+ export declare function Trace({ className, ...props }: ComponentProps<"ol">): import("react").JSX.Element;
5
+ export type TraceItemProps = Omit<ComponentProps<"li">, "title"> & {
6
+ title: ReactNode;
7
+ /** The state of this step. @default "done" */
8
+ status?: TraceStatus;
9
+ /** A short note beside the title, such as a duration. */
10
+ meta?: ReactNode;
11
+ /** Opens the detail by default. @default false */
12
+ defaultOpen?: boolean;
13
+ };
14
+ export declare function TraceItem({ title, status, meta, defaultOpen, className, children, ...props }: TraceItemProps): import("react").JSX.Element;
package/dist/trace.js ADDED
@@ -0,0 +1,54 @@
1
+ import { cx } from "./lib/cx.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ // src/components/trace.tsx
4
+ const dot = {
5
+ pending: "border-separator bg-transparent",
6
+ running: "border-accent bg-accent/30 animate-pulse motion-reduce:animate-none",
7
+ done: "border-success bg-success",
8
+ error: "border-danger bg-danger"
9
+ };
10
+ /** A timeline of steps: reasoning, tool calls, sources. Each step can fold open its detail. */
11
+ function Trace({ className, ...props }) {
12
+ return /* @__PURE__ */ jsx("ol", {
13
+ "data-slot": "trace",
14
+ className: cx("m-0 flex list-none flex-col p-0", className),
15
+ ...props
16
+ });
17
+ }
18
+ function TraceItem({ title, status = "done", meta, defaultOpen = false, className, children, ...props }) {
19
+ const head = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
20
+ className: "text-footnote text-label min-w-0 flex-1 truncate font-medium",
21
+ children: title
22
+ }), meta ? /* @__PURE__ */ jsx("span", {
23
+ className: "text-caption text-label-tertiary shrink-0",
24
+ children: meta
25
+ }) : null] });
26
+ return /* @__PURE__ */ jsxs("li", {
27
+ "data-slot": "trace-item",
28
+ "data-status": status,
29
+ className: cx("relative pb-4 ps-6 last:pb-0 before:absolute before:start-[5px] before:top-4 before:-bottom-0 before:w-px before:bg-separator/60 last:before:hidden", className),
30
+ ...props,
31
+ children: [/* @__PURE__ */ jsx("span", {
32
+ "aria-hidden": "true",
33
+ className: cx("absolute start-0 top-1.5 size-[11px] rounded-full border-2", dot[status])
34
+ }), children ? /* @__PURE__ */ jsxs("details", {
35
+ open: defaultOpen,
36
+ className: "group",
37
+ children: [/* @__PURE__ */ jsxs("summary", {
38
+ className: "focus-visible:ring-accent/70 flex cursor-pointer list-none items-center gap-2 rounded-md outline-none focus-visible:ring-2 [&::-webkit-details-marker]:hidden",
39
+ children: [head, /* @__PURE__ */ jsx("span", {
40
+ "aria-hidden": "true",
41
+ className: "text-label-tertiary text-caption transition-transform group-open:rotate-90 motion-reduce:transition-none",
42
+ children: "›"
43
+ })]
44
+ }), /* @__PURE__ */ jsx("div", {
45
+ className: "text-footnote text-label-secondary mt-1.5",
46
+ children
47
+ })]
48
+ }) : /* @__PURE__ */ jsx("div", {
49
+ className: "flex items-center gap-2",
50
+ children: head
51
+ })]
52
+ });
53
+ }
54
+ export { Trace, TraceItem };
@@ -1,9 +1,9 @@
1
- import { type RefObject } from "react";
2
- /** Marks a floating layer (a pop-up list, a menu) whose clicks belong to what opened it. */
3
- export { FLOATING_LAYER } from "../lib/floating-layers";
1
+ import { FLOATING_LAYER } from "./lib/floating-layers.js";
2
+ import { RefObject } from "react";
4
3
  /**
5
4
  * Calls `onDismiss` when the user presses Escape or clicks outside `ref`
6
5
  * while `active`, for menus, popovers and sheets. Clicks in a floating
7
6
  * layer opened from inside, such as a pop-up button's list, don't count.
8
7
  */
9
8
  export declare function useDismiss(ref: RefObject<HTMLElement | null>, active: boolean, onDismiss: () => void): void;
9
+ export { FLOATING_LAYER };
@@ -0,0 +1,38 @@
1
+ import { FLOATING_LAYER, belongsToFloatingSurface, ownsFloatingLayer } from "./lib/floating-layers.js";
2
+ import { useEffect } from "react";
3
+ // src/hooks/use-dismiss.ts
4
+ /**
5
+ * Calls `onDismiss` when the user presses Escape or clicks outside `ref`
6
+ * while `active`, for menus, popovers and sheets. Clicks in a floating
7
+ * layer opened from inside, such as a pop-up button's list, don't count.
8
+ */
9
+ function useDismiss(ref, active, onDismiss) {
10
+ useEffect(() => {
11
+ if (!active) return;
12
+ const onPointerDown = (event) => {
13
+ const target = event.target;
14
+ const surface = ref.current;
15
+ if (surface && belongsToFloatingSurface(surface, target)) return;
16
+ onDismiss();
17
+ };
18
+ const onKeyDown = (event) => {
19
+ if (event.defaultPrevented) return;
20
+ if (ref.current && ownsFloatingLayer(ref.current, document.activeElement)) return;
21
+ if (event.key === "Escape") {
22
+ event.preventDefault();
23
+ onDismiss();
24
+ }
25
+ };
26
+ document.addEventListener("pointerdown", onPointerDown);
27
+ window.addEventListener("keydown", onKeyDown);
28
+ return () => {
29
+ document.removeEventListener("pointerdown", onPointerDown);
30
+ window.removeEventListener("keydown", onKeyDown);
31
+ };
32
+ }, [
33
+ ref,
34
+ active,
35
+ onDismiss
36
+ ]);
37
+ }
38
+ export { FLOATING_LAYER, useDismiss };
@@ -1,21 +1,21 @@
1
1
  declare const BREAKPOINTS: {
2
- readonly "2xl": 1536;
3
- readonly "3xl": 1600;
4
- readonly "4xl": 2000;
5
- readonly lg: 1024;
6
- readonly md: 800;
7
- readonly sm: 640;
8
- readonly xl: 1280;
2
+ readonly "2xl": 1536;
3
+ readonly "3xl": 1600;
4
+ readonly "4xl": 2000;
5
+ readonly lg: 1024;
6
+ readonly md: 800;
7
+ readonly sm: 640;
8
+ readonly xl: 1280;
9
9
  };
10
10
  export type Breakpoint = keyof typeof BREAKPOINTS;
11
11
  export type BreakpointQuery = Breakpoint | `max-${Breakpoint}` | `${Breakpoint}:max-${Breakpoint}`;
12
12
  export type MediaQueryInput = {
13
- min?: Breakpoint | number;
14
- max?: Breakpoint | number;
15
- /** Touch-like input (finger). Use "fine" for mouse/trackpad. */
16
- pointer?: PointerPrecision;
13
+ min?: Breakpoint | number;
14
+ max?: Breakpoint | number;
15
+ /** Touch-like input (finger). Use "fine" for mouse/trackpad. */
16
+ pointer?: PointerPrecision;
17
17
  };
18
18
  export type PointerPrecision = "coarse" | "fine";
19
19
  export declare function useMediaQuery(query: BreakpointQuery | MediaQueryInput | (string & {})): boolean;
20
20
  export declare function useIsMobile(): boolean;
21
- export {};
21
+ export {};
@@ -0,0 +1,56 @@
1
+ import { useCallback, useSyncExternalStore } from "react";
2
+ // src/hooks/use-media-query.ts
3
+ const BREAKPOINTS = {
4
+ "2xl": 1536,
5
+ "3xl": 1600,
6
+ "4xl": 2e3,
7
+ lg: 1024,
8
+ md: 800,
9
+ sm: 640,
10
+ xl: 1280
11
+ };
12
+ function resolveMin(value) {
13
+ return `(min-width: ${typeof value === "number" ? value : BREAKPOINTS[value]}px)`;
14
+ }
15
+ function resolveMax(value) {
16
+ return `(max-width: ${(typeof value === "number" ? value : BREAKPOINTS[value]) - 1}px)`;
17
+ }
18
+ function parseQuery(query) {
19
+ if (typeof query !== "string") {
20
+ const parts = [];
21
+ if (query.min != null) parts.push(resolveMin(query.min));
22
+ if (query.max != null) parts.push(resolveMax(query.max));
23
+ if (query.pointer === "coarse") parts.push("(pointer: coarse)");
24
+ if (query.pointer === "fine") parts.push("(pointer: fine)");
25
+ if (parts.length === 0) return "(min-width: 0px)";
26
+ return parts.join(" and ");
27
+ }
28
+ if (query.startsWith("(")) return query;
29
+ const parts = [];
30
+ for (const segment of query.split(":")) if (segment.startsWith("max-")) {
31
+ const bp = segment.slice(4);
32
+ if (bp in BREAKPOINTS) parts.push(resolveMax(bp));
33
+ } else if (segment in BREAKPOINTS) parts.push(resolveMin(segment));
34
+ return parts.length > 0 ? parts.join(" and ") : query;
35
+ }
36
+ function getServerSnapshot() {
37
+ return false;
38
+ }
39
+ function useMediaQuery(query) {
40
+ const mediaQuery = parseQuery(query);
41
+ const subscribe = useCallback((callback) => {
42
+ if (typeof window === "undefined") return () => {};
43
+ const mql = window.matchMedia(mediaQuery);
44
+ mql.addEventListener("change", callback);
45
+ return () => mql.removeEventListener("change", callback);
46
+ }, [mediaQuery]);
47
+ const getSnapshot = useCallback(() => {
48
+ if (typeof window === "undefined") return false;
49
+ return window.matchMedia(mediaQuery).matches;
50
+ }, [mediaQuery]);
51
+ return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
52
+ }
53
+ function useIsMobile() {
54
+ return useMediaQuery("(max-width: 768px)");
55
+ }
56
+ export { useIsMobile, useMediaQuery };
@@ -0,0 +1,12 @@
1
+ import { PlatformOS } from "./appearance/platform.js";
2
+ import "./index.js";
3
+ /**
4
+ * The platform, SSR safe: `"unknown"` on the server and on the first client
5
+ * render, then the real one, so markup never mismatches. For styling prefer the
6
+ * `ios:` and `macos:` variants, which read `data-os` before the first paint.
7
+ */
8
+ export declare function useOS(): {
9
+ os: PlatformOS;
10
+ isApple: boolean;
11
+ isTouch: boolean;
12
+ };
package/dist/use-os.js ADDED
@@ -0,0 +1,17 @@
1
+ import { usePlatform } from "./appearance/platform.js";
2
+ // src/hooks/use-os.ts
3
+ const apple = /* @__PURE__ */ new Set(["ios", "macos"]);
4
+ /**
5
+ * The platform, SSR safe: `"unknown"` on the server and on the first client
6
+ * render, then the real one, so markup never mismatches. For styling prefer the
7
+ * `ios:` and `macos:` variants, which read `data-os` before the first paint.
8
+ */
9
+ function useOS() {
10
+ const os = usePlatform();
11
+ return {
12
+ os,
13
+ isApple: apple.has(os),
14
+ isTouch: os === "ios" || os === "android"
15
+ };
16
+ }
17
+ export { useOS };
@@ -0,0 +1,15 @@
1
+ export type WakeSliderSize = "sm" | "md" | "lg";
2
+ export interface WakeSliderProps {
3
+ label: string;
4
+ value?: number;
5
+ defaultValue?: number;
6
+ onChange?: (value: number) => void;
7
+ bars?: number;
8
+ wake?: number;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ formatValue?: (value: number) => string;
12
+ /** Bar height at rest and value text scale. @default "md" */
13
+ size?: WakeSliderSize;
14
+ }
15
+ export declare function WakeSlider({ label, value: controlledValue, defaultValue, onChange, disabled, className, formatValue, size, bars, wake }: WakeSliderProps): import("react").JSX.Element;