@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,225 @@
1
+ "use client";
2
+ import { addDays, addMonths, firstWeekday, formatDay, monthGrid, parseDay, withinBounds } from "./lib/calendar-month.js";
3
+ import { cx } from "./lib/cx.js";
4
+ import { Wheel } from "./lib/wheel.js";
5
+ import { useId, useMemo, useRef, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { ChevronDownIcon } from "@passui/icons/chevron-down";
8
+ import { ChevronLeftIcon } from "@passui/icons/chevron-left";
9
+ import { ChevronRightIcon } from "@passui/icons/chevron-right";
10
+ // src/components/calendar.tsx
11
+ const today = () => {
12
+ const now = /* @__PURE__ */ new Date();
13
+ return {
14
+ year: now.getFullYear(),
15
+ month: now.getMonth() + 1,
16
+ day: now.getDate()
17
+ };
18
+ };
19
+ /** Whole years offered by the month and year wheels around `now`, widened to the bounds. */
20
+ function yearSpan(now, min, max) {
21
+ const from = parseDay(min ?? "")?.year ?? now - 100;
22
+ const to = parseDay(max ?? "")?.year ?? now + 50;
23
+ return Array.from({ length: Math.max(1, to - from + 1) }, (_, i) => from + i);
24
+ }
25
+ const cell = "relative mx-auto flex size-8.5 items-center justify-center rounded-full text-footnote tabular-nums outline-none transition-colors duration-(--duration-fast) focus-visible:ring-2 focus-visible:ring-accent/70 disabled:pointer-events-none disabled:opacity-30 motion-reduce:transition-none";
26
+ /**
27
+ * An inline month calendar for one day or a range, on the locale's own week.
28
+ * Arrow keys move by day and week, Page Up and Page Down by month, Home and
29
+ * End to the week's edges.
30
+ */
31
+ function Calendar(props) {
32
+ const { label, locale, min, max, labels, className } = props;
33
+ const range = props.mode === "range";
34
+ const selected = range ? props.value.from : props.value;
35
+ const to = range ? props.value.to : "";
36
+ const start = parseDay(selected) ?? today();
37
+ const [focus, setFocus] = useState(start);
38
+ const [hover, setHover] = useState("");
39
+ const [jumping, setJumping] = useState(false);
40
+ const grid = useRef(null);
41
+ const headingId = useId();
42
+ const first = firstWeekday(locale);
43
+ const days = useMemo(() => monthGrid(focus.year, focus.month, first), [
44
+ focus.year,
45
+ focus.month,
46
+ first
47
+ ]);
48
+ const monthTitle = new Intl.DateTimeFormat(locale, {
49
+ month: "long",
50
+ year: "numeric",
51
+ timeZone: "UTC"
52
+ }).format(new Date(Date.UTC(focus.year, focus.month - 1, 1)));
53
+ const weekdays = Array.from({ length: 7 }, (_, index) => new Intl.DateTimeFormat(locale, {
54
+ weekday: "short",
55
+ timeZone: "UTC"
56
+ }).format(new Date(Date.UTC(2024, 0, (first - 1 + index) % 7 + 1))));
57
+ const todayValue = formatDay(today());
58
+ const monthOptions = useMemo(() => Array.from({ length: 12 }, (_, index) => ({
59
+ value: index + 1,
60
+ label: new Intl.DateTimeFormat(locale, {
61
+ month: "long",
62
+ timeZone: "UTC"
63
+ }).format(new Date(Date.UTC(2024, index, 1)))
64
+ })), [locale]);
65
+ const yearOptions = useMemo(() => {
66
+ const years = yearSpan(today().year, min, max);
67
+ if (!years.includes(focus.year)) years.push(focus.year);
68
+ const plain = new Intl.NumberFormat(locale, { useGrouping: false });
69
+ return years.sort((a, b) => a - b).map((year) => ({
70
+ value: year,
71
+ label: plain.format(year)
72
+ }));
73
+ }, [
74
+ locale,
75
+ min,
76
+ max,
77
+ focus.year
78
+ ]);
79
+ const field = (name) => new Intl.DisplayNames([locale], { type: "dateTimeField" }).of(name) ?? name;
80
+ /** Position of a day within its week, 0 for the locale's first day. */
81
+ const weekIndex = (day) => ((new Date(Date.UTC(day.year, day.month - 1, day.day)).getUTCDay() || 7) - first + 7) % 7;
82
+ const move = (next) => {
83
+ setFocus(next);
84
+ requestAnimationFrame(() => grid.current?.querySelector(`[data-day="${formatDay(next)}"]`)?.focus());
85
+ };
86
+ const pick = (value) => {
87
+ if (!withinBounds(value, min, max)) return;
88
+ if (props.mode !== "range") {
89
+ props.onValueChange(value);
90
+ return;
91
+ }
92
+ if (!(props.value.from && !props.value.to)) props.onValueChange({
93
+ from: value,
94
+ to: ""
95
+ });
96
+ else if (value < props.value.from) props.onValueChange({
97
+ from: value,
98
+ to: ""
99
+ });
100
+ else props.onValueChange({
101
+ from: props.value.from,
102
+ to: value
103
+ });
104
+ };
105
+ const onKeyDown = (event) => {
106
+ const next = (() => {
107
+ switch (event.key) {
108
+ case "ArrowLeft": return addDays(focus, -1);
109
+ case "ArrowRight": return addDays(focus, 1);
110
+ case "ArrowUp": return addDays(focus, -7);
111
+ case "ArrowDown": return addDays(focus, 7);
112
+ case "PageUp": return addMonths(focus, -1);
113
+ case "PageDown": return addMonths(focus, 1);
114
+ case "Home": return addDays(focus, -weekIndex(focus));
115
+ case "End": return addDays(focus, 6 - weekIndex(focus));
116
+ default: return null;
117
+ }
118
+ })();
119
+ if (!next) return;
120
+ event.preventDefault();
121
+ move(next);
122
+ };
123
+ const edge = range && props.value.from && !props.value.to ? hover : to;
124
+ return /* @__PURE__ */ jsxs("div", {
125
+ "data-slot": "calendar",
126
+ className: cx("w-[17.5rem]", className),
127
+ children: [
128
+ /* @__PURE__ */ jsxs("div", {
129
+ className: "mb-2 flex items-center justify-between",
130
+ children: [
131
+ /* @__PURE__ */ jsx("button", {
132
+ type: "button",
133
+ "aria-label": labels.previousMonth,
134
+ disabled: jumping,
135
+ onClick: () => setFocus(addMonths(focus, -1)),
136
+ className: "text-label-secondary hover:bg-fill/80 hover:text-label focus-visible:ring-accent/70 flex size-7.5 items-center justify-center rounded-full outline-none focus-visible:ring-2 disabled:opacity-0",
137
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 14 })
138
+ }),
139
+ /* @__PURE__ */ jsxs("button", {
140
+ type: "button",
141
+ id: headingId,
142
+ "aria-live": "polite",
143
+ "aria-expanded": jumping,
144
+ onClick: () => setJumping(!jumping),
145
+ className: "text-footnote text-label hover:bg-fill/80 focus-visible:ring-accent/70 flex h-7.5 items-center gap-1 rounded-full px-3 font-semibold outline-none focus-visible:ring-2",
146
+ children: [monthTitle, /* @__PURE__ */ jsx(ChevronDownIcon, {
147
+ size: 12,
148
+ className: cx("text-label-secondary spring-snappy transition-transform motion-reduce:transition-none", jumping && "rotate-180")
149
+ })]
150
+ }),
151
+ /* @__PURE__ */ jsx("button", {
152
+ type: "button",
153
+ "aria-label": labels.nextMonth,
154
+ disabled: jumping,
155
+ onClick: () => setFocus(addMonths(focus, 1)),
156
+ className: "text-label-secondary hover:bg-fill/80 hover:text-label focus-visible:ring-accent/70 flex size-7.5 items-center justify-center rounded-full outline-none focus-visible:ring-2 disabled:opacity-0",
157
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: 14 })
158
+ })
159
+ ]
160
+ }),
161
+ jumping ? /* @__PURE__ */ jsxs("div", {
162
+ className: "flex min-h-[15.5rem] items-center justify-center gap-2",
163
+ onKeyDown: (event) => {
164
+ if (event.key !== "Escape") return;
165
+ event.stopPropagation();
166
+ setJumping(false);
167
+ },
168
+ children: [/* @__PURE__ */ jsx(Wheel, {
169
+ label: field("month"),
170
+ options: monthOptions,
171
+ value: focus.month,
172
+ onValueChange: (month) => setFocus(addMonths(focus, month - focus.month)),
173
+ className: "w-32"
174
+ }), /* @__PURE__ */ jsx(Wheel, {
175
+ label: field("year"),
176
+ options: yearOptions,
177
+ value: focus.year,
178
+ onValueChange: (year) => setFocus(addMonths(focus, (year - focus.year) * 12)),
179
+ className: "w-24"
180
+ })]
181
+ }) : null,
182
+ /* @__PURE__ */ jsx("div", {
183
+ ref: grid,
184
+ hidden: jumping,
185
+ onMouseLeave: () => setHover(""),
186
+ children: /* @__PURE__ */ jsxs("table", {
187
+ "aria-labelledby": headingId,
188
+ "aria-label": label,
189
+ onKeyDown,
190
+ className: "w-full table-fixed border-collapse",
191
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: weekdays.map((name) => /* @__PURE__ */ jsx("th", {
192
+ scope: "col",
193
+ className: "text-caption text-label-tertiary py-1 text-center font-medium",
194
+ children: name
195
+ }, name)) }) }), /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ jsx("tr", { children: days.slice(week * 7, week * 7 + 7).map((day) => {
196
+ const value = formatDay(day);
197
+ const isStart = value === selected;
198
+ const isEnd = range && value === to;
199
+ const inSpan = range && !!selected && !!edge && value > selected && value < edge;
200
+ const blocked = !withinBounds(value, min, max);
201
+ return /* @__PURE__ */ jsx("td", {
202
+ className: cx("p-0", inSpan && "bg-accent-soft/70"),
203
+ children: /* @__PURE__ */ jsx("button", {
204
+ type: "button",
205
+ "data-day": value,
206
+ "data-today": value === todayValue || void 0,
207
+ "aria-pressed": isStart || isEnd,
208
+ "data-selected": isStart || isEnd || void 0,
209
+ "data-outside": !day.inMonth || void 0,
210
+ tabIndex: day.year === focus.year && day.month === focus.month && day.day === focus.day ? 0 : -1,
211
+ disabled: blocked,
212
+ onClick: () => pick(value),
213
+ onFocus: () => setFocus(day),
214
+ onMouseEnter: () => setHover(value),
215
+ className: cx(cell, !day.inMonth && "text-label-tertiary", day.inMonth && "text-label", value === todayValue && "text-accent-text font-semibold", !(isStart || isEnd) && "hover:bg-fill/80", (isStart || isEnd) && "bg-accent text-on-accent font-semibold"),
216
+ children: day.day
217
+ })
218
+ }, value);
219
+ }) }, week)) })]
220
+ })
221
+ })
222
+ ]
223
+ });
224
+ }
225
+ export { Calendar };
package/dist/card.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from "react";
2
+ /** A grouped surface. Compose with the header, content and footer parts. */
3
+ export declare function Card({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
4
+ export declare function CardHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
5
+ export declare function CardTitle({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
6
+ export declare function CardDescription({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
7
+ export declare function CardAction({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
8
+ export declare function CardContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
9
+ export declare function CardFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
package/dist/card.js ADDED
@@ -0,0 +1,54 @@
1
+ import { cx } from "./lib/cx.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/components/card.tsx
4
+ /** A grouped surface. Compose with the header, content and footer parts. */
5
+ function Card({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx("div", {
7
+ "data-slot": "card",
8
+ className: cx("card-surface squircle flex flex-col gap-4 py-5 text-label [--squircle-radius:1.5rem]", className),
9
+ ...props
10
+ });
11
+ }
12
+ function CardHeader({ className, ...props }) {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ "data-slot": "card-header",
15
+ className: cx("grid auto-rows-min items-start gap-1 px-5 has-data-[slot=card-action]:grid-cols-[1fr_auto]", className),
16
+ ...props
17
+ });
18
+ }
19
+ function CardTitle({ className, ...props }) {
20
+ return /* @__PURE__ */ jsx("div", {
21
+ "data-slot": "card-title",
22
+ className: cx("text-headline font-semibold leading-tight", className),
23
+ ...props
24
+ });
25
+ }
26
+ function CardDescription({ className, ...props }) {
27
+ return /* @__PURE__ */ jsx("div", {
28
+ "data-slot": "card-description",
29
+ className: cx("text-footnote text-label-secondary", className),
30
+ ...props
31
+ });
32
+ }
33
+ function CardAction({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx("div", {
35
+ "data-slot": "card-action",
36
+ className: cx("col-start-2 row-span-2 row-start-1 self-start", className),
37
+ ...props
38
+ });
39
+ }
40
+ function CardContent({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "card-content",
43
+ className: cx("px-5", className),
44
+ ...props
45
+ });
46
+ }
47
+ function CardFooter({ className, ...props }) {
48
+ return /* @__PURE__ */ jsx("div", {
49
+ "data-slot": "card-footer",
50
+ className: cx("flex items-center px-5", className),
51
+ ...props
52
+ });
53
+ }
54
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,30 @@
1
+ import { ComponentProps } from "react";
2
+ /** `bar` compares values, `line` follows a trend, `area` is a line with its weight filled in. */
3
+ export type ChartType = "bar" | "line" | "area";
4
+ export interface ChartSeries {
5
+ /** The key of the value in each data row. */
6
+ key: string;
7
+ /** Names the series in the tooltip and legend. */
8
+ label: string;
9
+ /** Any CSS colour. Defaults to the accent, then success, warning and danger. */
10
+ color?: string;
11
+ }
12
+ export type ChartProps = Omit<ComponentProps<"div">, "children"> & {
13
+ /** One row per point on the x axis. */
14
+ data: Array<Record<string, string | number>>;
15
+ /** The key holding each row's x label. */
16
+ xKey: string;
17
+ series: ChartSeries[];
18
+ /** Names the chart for assistive technology. */
19
+ label: string;
20
+ /** @default "line" */
21
+ type?: ChartType;
22
+ /** Formats a value for the axis and the tooltip. */
23
+ format?: (value: number) => string;
24
+ };
25
+ /**
26
+ * A responsive SVG chart for one or more series. Bars grow and lines draw on
27
+ * first paint, a tooltip follows the pointer to the nearest point, and a
28
+ * hidden table carries the same numbers for screen readers.
29
+ */
30
+ export declare function Chart({ data, xKey, series, label, type, format, className, ...props }: ChartProps): import("react").JSX.Element;
package/dist/chart.js ADDED
@@ -0,0 +1,226 @@
1
+ "use client";
2
+ import { cx } from "./lib/cx.js";
3
+ import { useId, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/chart.tsx
6
+ const palette = [
7
+ "var(--color-accent)",
8
+ "var(--color-success)",
9
+ "var(--color-warning)",
10
+ "var(--color-danger)"
11
+ ];
12
+ const W = 480;
13
+ const H = 220;
14
+ const pad = {
15
+ top: 12,
16
+ right: 12,
17
+ bottom: 26,
18
+ left: 40
19
+ };
20
+ /** The smallest round number above `max`, so gridlines fall on friendly values. */
21
+ function niceMax(max) {
22
+ if (max <= 0) return 1;
23
+ const magnitude = 10 ** Math.floor(Math.log10(max));
24
+ return ([
25
+ 1,
26
+ 2,
27
+ 2.5,
28
+ 5,
29
+ 10
30
+ ].find((n) => n * magnitude >= max) ?? 10) * magnitude;
31
+ }
32
+ /**
33
+ * A responsive SVG chart for one or more series. Bars grow and lines draw on
34
+ * first paint, a tooltip follows the pointer to the nearest point, and a
35
+ * hidden table carries the same numbers for screen readers.
36
+ */
37
+ function Chart({ data, xKey, series, label, type = "line", format = (value) => value.toLocaleString(), className, ...props }) {
38
+ const id = useId();
39
+ const [hover, setHover] = useState(null);
40
+ const top = niceMax(Math.max(...data.flatMap((row) => series.map((s) => Number(row[s.key]) || 0))));
41
+ const innerW = W - pad.left - pad.right;
42
+ const innerH = H - pad.top - pad.bottom;
43
+ const band = innerW / Math.max(data.length, 1);
44
+ const x = (index) => type === "bar" ? pad.left + band * index + band / 2 : pad.left + (data.length === 1 ? innerW / 2 : innerW * index / (data.length - 1));
45
+ const y = (value) => pad.top + innerH - value / top * innerH;
46
+ const color = (index) => series[index]?.color ?? palette[index % palette.length];
47
+ const ticks = [
48
+ 0,
49
+ .25,
50
+ .5,
51
+ .75,
52
+ 1
53
+ ].map((t) => t * top);
54
+ const barW = Math.min(28, band / series.length * .7);
55
+ const move = (event) => {
56
+ const rect = event.currentTarget.getBoundingClientRect();
57
+ const at = (event.clientX - rect.left) / rect.width * W;
58
+ const index = type === "bar" ? Math.floor((at - pad.left) / band) : Math.round((at - pad.left) / innerW * (data.length - 1));
59
+ setHover(Math.min(Math.max(index, 0), data.length - 1));
60
+ };
61
+ return /* @__PURE__ */ jsxs("div", {
62
+ "data-slot": "chart",
63
+ className: cx("relative flex w-full flex-col gap-2", className),
64
+ ...props,
65
+ children: [
66
+ /* @__PURE__ */ jsxs("svg", {
67
+ viewBox: `0 0 ${W} ${H}`,
68
+ role: "img",
69
+ "aria-label": label,
70
+ className: "h-auto w-full touch-pan-y overflow-visible",
71
+ onPointerMove: move,
72
+ onPointerLeave: () => setHover(null),
73
+ children: [
74
+ /* @__PURE__ */ jsx("defs", { children: series.map((s, index) => /* @__PURE__ */ jsxs("linearGradient", {
75
+ id: `${id}-${s.key}`,
76
+ x1: "0",
77
+ x2: "0",
78
+ y1: "0",
79
+ y2: "1",
80
+ children: [/* @__PURE__ */ jsx("stop", {
81
+ offset: "0",
82
+ stopColor: color(index),
83
+ stopOpacity: "0.35"
84
+ }), /* @__PURE__ */ jsx("stop", {
85
+ offset: "1",
86
+ stopColor: color(index),
87
+ stopOpacity: "0"
88
+ })]
89
+ }, s.key)) }),
90
+ ticks.map((tick) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
91
+ x1: pad.left,
92
+ x2: W - pad.right,
93
+ y1: y(tick),
94
+ y2: y(tick),
95
+ stroke: "var(--color-separator)",
96
+ strokeOpacity: tick === 0 ? 1 : .5,
97
+ strokeDasharray: tick === 0 ? void 0 : "3 4"
98
+ }), /* @__PURE__ */ jsx("text", {
99
+ x: pad.left - 8,
100
+ y: y(tick),
101
+ textAnchor: "end",
102
+ dominantBaseline: "middle",
103
+ className: "fill-label-tertiary text-[10px]",
104
+ children: format(tick)
105
+ })] }, tick)),
106
+ data.map((row, index) => /* @__PURE__ */ jsx("text", {
107
+ x: x(index),
108
+ y: 212,
109
+ textAnchor: "middle",
110
+ className: "fill-label-tertiary text-[10px]",
111
+ children: row[xKey]
112
+ }, String(row[xKey]))),
113
+ hover !== null ? /* @__PURE__ */ jsx("line", {
114
+ x1: x(hover),
115
+ x2: x(hover),
116
+ y1: pad.top,
117
+ y2: pad.top + innerH,
118
+ stroke: "var(--color-label-tertiary)",
119
+ strokeOpacity: "0.5"
120
+ }) : null,
121
+ series.map((s, si) => {
122
+ const points = data.map((row, index) => [x(index), y(Number(row[s.key]) || 0)]);
123
+ if (type === "bar") return /* @__PURE__ */ jsx("g", { children: points.map(([px, py], index) => /* @__PURE__ */ jsx("rect", {
124
+ x: px - barW * series.length / 2 + si * barW,
125
+ y: py,
126
+ width: barW - 2,
127
+ height: pad.top + innerH - py,
128
+ rx: 4,
129
+ fill: color(si),
130
+ opacity: hover === null || hover === index ? 1 : .45,
131
+ className: "spring-smooth origin-bottom transition-opacity motion-reduce:animate-none",
132
+ style: {
133
+ transformBox: "fill-box",
134
+ animation: `passui-grow var(--spring-smooth-duration) var(--spring-smooth) ${index * 40}ms backwards`
135
+ }
136
+ }, index)) }, s.key);
137
+ const line = points.map(([px, py], index) => `${index ? "L" : "M"}${px},${py}`).join(" ");
138
+ const first = points[0];
139
+ const last = points[points.length - 1];
140
+ return /* @__PURE__ */ jsxs("g", { children: [
141
+ type === "area" && first && last ? /* @__PURE__ */ jsx("path", {
142
+ d: `${line} L${last[0]},${pad.top + innerH} L${first[0]},${pad.top + innerH} Z`,
143
+ fill: `url(#${id}-${s.key})`,
144
+ className: "motion-reduce:animate-none",
145
+ style: { animation: "passui-fade-in 700ms ease-out backwards" }
146
+ }) : null,
147
+ /* @__PURE__ */ jsx("path", {
148
+ d: line,
149
+ fill: "none",
150
+ stroke: color(si),
151
+ strokeWidth: "2.5",
152
+ strokeLinecap: "round",
153
+ strokeLinejoin: "round",
154
+ pathLength: 1,
155
+ strokeDasharray: 1,
156
+ className: "motion-reduce:animate-none",
157
+ style: { animation: "passui-draw 900ms var(--ease-standard) forwards" }
158
+ }),
159
+ hover !== null && points[hover] ? /* @__PURE__ */ jsx("circle", {
160
+ cx: points[hover][0],
161
+ cy: points[hover][1],
162
+ r: "4.5",
163
+ fill: "var(--color-background)",
164
+ stroke: color(si),
165
+ strokeWidth: "2.5"
166
+ }) : null
167
+ ] }, s.key);
168
+ })
169
+ ]
170
+ }),
171
+ hover !== null && data[hover] ? /* @__PURE__ */ jsxs("div", {
172
+ role: "presentation",
173
+ className: "liquid-glass-dense squircle text-caption text-label pointer-events-none absolute top-0 z-10 -translate-x-1/2 px-2.5 py-1.5 [--squircle-radius:0.75rem]",
174
+ style: { left: `${x(hover) / W * 100}%` },
175
+ children: [/* @__PURE__ */ jsx("div", {
176
+ className: "text-label-secondary font-medium",
177
+ children: data[hover][xKey]
178
+ }), series.map((s, index) => /* @__PURE__ */ jsxs("div", {
179
+ className: "flex items-center gap-1.5",
180
+ children: [
181
+ /* @__PURE__ */ jsx("span", {
182
+ className: "size-2 rounded-full",
183
+ style: { background: color(index) }
184
+ }),
185
+ /* @__PURE__ */ jsx("span", {
186
+ className: "text-label-secondary",
187
+ children: s.label
188
+ }),
189
+ /* @__PURE__ */ jsx("span", {
190
+ className: "ms-auto ps-3 font-semibold tabular-nums",
191
+ children: format(Number(data[hover][s.key]) || 0)
192
+ })
193
+ ]
194
+ }, s.key))]
195
+ }) : null,
196
+ series.length > 1 ? /* @__PURE__ */ jsx("ul", {
197
+ className: "text-caption text-label-secondary m-0 flex list-none flex-wrap gap-x-4 gap-y-1 p-0",
198
+ children: series.map((s, index) => /* @__PURE__ */ jsxs("li", {
199
+ className: "flex items-center gap-1.5",
200
+ children: [/* @__PURE__ */ jsx("span", {
201
+ className: "size-2 rounded-full",
202
+ style: { background: color(index) }
203
+ }), s.label]
204
+ }, s.key))
205
+ }) : null,
206
+ /* @__PURE__ */ jsxs("table", {
207
+ className: "sr-only",
208
+ children: [
209
+ /* @__PURE__ */ jsx("caption", { children: label }),
210
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
211
+ scope: "col",
212
+ children: xKey
213
+ }), series.map((s) => /* @__PURE__ */ jsx("th", {
214
+ scope: "col",
215
+ children: s.label
216
+ }, s.key))] }) }),
217
+ /* @__PURE__ */ jsx("tbody", { children: data.map((row) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
218
+ scope: "row",
219
+ children: row[xKey]
220
+ }), series.map((s) => /* @__PURE__ */ jsx("td", { children: row[s.key] }, s.key))] }, String(row[xKey]))) })
221
+ ]
222
+ })
223
+ ]
224
+ });
225
+ }
226
+ export { Chart };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from "react";
2
+ import * as checkbox from "@zag-js/checkbox";
3
+ export interface CheckboxProps extends Omit<checkbox.Props, "id" | "ids" | "checked" | "defaultChecked" | "onCheckedChange"> {
4
+ checked?: boolean | "indeterminate";
5
+ defaultChecked?: boolean | "indeterminate";
6
+ onCheckedChange?: (checked: boolean | "indeterminate") => void;
7
+ /** The label beside the box. Optional, so a bare box can sit in a table cell. */
8
+ children?: ReactNode;
9
+ className?: string;
10
+ "aria-label"?: string;
11
+ }
12
+ /** A tick box. Renders a native hidden checkbox, so it submits with its form. */
13
+ export declare function Checkbox({ checked, defaultChecked, onCheckedChange, children, className, "aria-label": ariaLabel, ...props }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { cx } from "./lib/cx.js";
3
+ import { normalizeProps, useMachine } from "@zag-js/react";
4
+ import { useId } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import * as checkbox from "@zag-js/checkbox";
7
+ // src/components/checkbox.tsx
8
+ /** A tick box. Renders a native hidden checkbox, so it submits with its form. */
9
+ function Checkbox({ checked, defaultChecked, onCheckedChange, children, className, "aria-label": ariaLabel, ...props }) {
10
+ const id = useId();
11
+ const service = useMachine(checkbox.machine, {
12
+ id,
13
+ checked,
14
+ defaultChecked,
15
+ onCheckedChange: ({ checked: next }) => onCheckedChange?.(next),
16
+ ...props
17
+ });
18
+ const api = checkbox.connect(service, normalizeProps);
19
+ return /* @__PURE__ */ jsxs("label", {
20
+ ...api.getRootProps(),
21
+ "data-slot": "checkbox",
22
+ className: cx("group inline-flex cursor-pointer items-center gap-2.5 text-footnote data-disabled:cursor-not-allowed data-disabled:opacity-40", className),
23
+ children: [
24
+ /* @__PURE__ */ jsx("input", {
25
+ ...api.getHiddenInputProps(),
26
+ "aria-label": ariaLabel
27
+ }),
28
+ /* @__PURE__ */ jsx("span", {
29
+ ...api.getControlProps(),
30
+ "data-slot": "checkbox-control",
31
+ className: "bg-fill text-on-accent spring-snappy group-focus-within:ring-accent/70 data-[state=checked]:bg-accent data-[state=indeterminate]:bg-accent inline-flex size-5.5 shrink-0 items-center justify-center rounded-lg shadow-[inset_0_0_0_0.5px_var(--color-separator)] transition group-focus-within:ring-2 group-active:scale-90 motion-reduce:transition-none motion-reduce:group-active:scale-100",
32
+ children: /* @__PURE__ */ jsx("svg", {
33
+ ...api.getIndicatorProps(),
34
+ hidden: false,
35
+ viewBox: "0 0 16 16",
36
+ fill: "none",
37
+ stroke: "currentColor",
38
+ strokeWidth: "2.25",
39
+ strokeLinecap: "round",
40
+ strokeLinejoin: "round",
41
+ className: "spring-bouncy size-3.5 scale-0 transition-transform group-data-[state=checked]:scale-100 group-data-[state=indeterminate]:scale-100",
42
+ "aria-hidden": "true",
43
+ children: api.indeterminate ? /* @__PURE__ */ jsx("path", { d: "M4 8h8" }) : /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-7" })
44
+ })
45
+ }),
46
+ children ? /* @__PURE__ */ jsx("span", {
47
+ ...api.getLabelProps(),
48
+ children
49
+ }) : null
50
+ ]
51
+ });
52
+ }
53
+ export { Checkbox };
@@ -3,4 +3,4 @@
3
3
  * the write. Returns false when unavailable or denied, so the app can offer
4
4
  * manual copying. This helper never reads the clipboard or adds feedback.
5
5
  */
6
- export declare function copyText(text: string): Promise<boolean>;
6
+ export declare function copyText(text: string): Promise<boolean>;
@@ -0,0 +1,16 @@
1
+ // src/lib/clipboard.ts
2
+ /**
3
+ * Copies text after a user action. Returns true only after the browser confirms
4
+ * the write. Returns false when unavailable or denied, so the app can offer
5
+ * manual copying. This helper never reads the clipboard or adds feedback.
6
+ */
7
+ async function copyText(text) {
8
+ try {
9
+ if (typeof navigator === "undefined" || !navigator.clipboard?.writeText) return false;
10
+ await navigator.clipboard.writeText(text);
11
+ return true;
12
+ } catch {
13
+ return false;
14
+ }
15
+ }
16
+ export { copyText };
package/dist/cn.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/dist/cn.js ADDED
@@ -0,0 +1,10 @@
1
+ import { textStyles } from "@passui/tokens/typography";
2
+ import { clsx } from "clsx";
3
+ import { extendTailwindMerge } from "tailwind-merge";
4
+ // src/lib/class-names.ts
5
+ const textStyleClasses = Object.keys(textStyles).map((name) => `text-${name.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`)}`);
6
+ const twMerge = extendTailwindMerge({ extend: { classGroups: { "font-size": textStyleClasses } } });
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ export { cn };