plass-ui 1.3.0 → 1.5.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 (454) hide show
  1. package/CHANGELOG.md +962 -0
  2. package/README.md +19 -17
  3. package/dist/components/accordion/PlAccordion.d.ts +1 -1
  4. package/dist/components/alert/PlAlert.js +1 -1
  5. package/dist/components/anchor/PlAnchor.d.ts +85 -0
  6. package/dist/components/anchor/PlAnchor.js +1 -0
  7. package/dist/components/anchor/index.d.ts +2 -0
  8. package/dist/components/anchor/index.js +1 -0
  9. package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
  10. package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
  11. package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
  12. package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
  13. package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
  14. package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
  15. package/dist/components/animate-counter/index.d.ts +2 -0
  16. package/dist/components/animate-counter/index.js +1 -0
  17. package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
  18. package/dist/components/animate-fade/PlAnimateFade.js +1 -1
  19. package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
  20. package/dist/components/animate-float/PlAnimateFloat.js +1 -0
  21. package/dist/components/animate-float/index.d.ts +2 -0
  22. package/dist/components/animate-float/index.js +1 -0
  23. package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
  24. package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
  25. package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
  26. package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
  27. package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +13 -4
  28. package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
  29. package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
  30. package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
  31. package/dist/components/animate-reveal/index.d.ts +2 -0
  32. package/dist/components/animate-reveal/index.js +1 -0
  33. package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
  34. package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
  35. package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
  36. package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
  37. package/dist/components/animate-scramble/index.d.ts +2 -0
  38. package/dist/components/animate-scramble/index.js +1 -0
  39. package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
  40. package/dist/components/animate-shake/PlAnimateShake.js +1 -0
  41. package/dist/components/animate-shake/index.d.ts +2 -0
  42. package/dist/components/animate-shake/index.js +1 -0
  43. package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
  44. package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
  45. package/dist/components/animate-split/PlAnimateSplit.d.ts +57 -0
  46. package/dist/components/animate-split/PlAnimateSplit.js +1 -0
  47. package/dist/components/animate-split/index.d.ts +2 -0
  48. package/dist/components/animate-split/index.js +1 -0
  49. package/dist/components/animate-typing/PlAnimateTyping.d.ts +3 -2
  50. package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
  51. package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
  52. package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
  53. package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
  54. package/dist/components/app-logo/PlAppLogo.js +1 -0
  55. package/dist/components/app-logo/index.d.ts +2 -0
  56. package/dist/components/app-logo/index.js +1 -0
  57. package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
  58. package/dist/components/area-chart/PlAreaChart.js +1 -0
  59. package/dist/components/area-chart/index.d.ts +2 -0
  60. package/dist/components/area-chart/index.js +1 -0
  61. package/dist/components/aspect-ratio/PlAspectRatio.d.ts +2 -1
  62. package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
  63. package/dist/components/avatar/PlAvatar.js +1 -1
  64. package/dist/components/back-top/PlBackTop.d.ts +2 -1
  65. package/dist/components/back-top/PlBackTop.js +1 -1
  66. package/dist/components/badge/PlBadge.js +1 -1
  67. package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
  68. package/dist/components/bar-chart/PlBarChart.js +1 -0
  69. package/dist/components/bar-chart/index.d.ts +2 -0
  70. package/dist/components/bar-chart/index.js +1 -0
  71. package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +3 -0
  72. package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
  73. package/dist/components/button/PlButton.d.ts +8 -0
  74. package/dist/components/button/PlButton.js +1 -1
  75. package/dist/components/button-group/PlButtonGroup.js +1 -1
  76. package/dist/components/calendar/PlCalendar.js +1 -1
  77. package/dist/components/card/PlCard.js +1 -1
  78. package/dist/components/carousel/PlCarousel.d.ts +1 -1
  79. package/dist/components/carousel/PlCarousel.js +1 -1
  80. package/dist/components/chat-bubble/PlChatBubble.d.ts +4 -1
  81. package/dist/components/chat-bubble/PlChatBubble.js +1 -1
  82. package/dist/components/checkbox/PlCheckbox.js +1 -1
  83. package/dist/components/chip/PlChip.d.ts +6 -2
  84. package/dist/components/chip/PlChip.js +1 -1
  85. package/dist/components/code-block/PlCodeBlock.d.ts +192 -0
  86. package/dist/components/code-block/PlCodeBlock.js +1 -0
  87. package/dist/components/code-block/index.d.ts +2 -0
  88. package/dist/components/code-block/index.js +1 -0
  89. package/dist/components/color-picker/PlColorPicker.js +1 -1
  90. package/dist/components/combobox/PlCombobox.d.ts +6 -5
  91. package/dist/components/combobox/PlCombobox.js +1 -1
  92. package/dist/components/command-palette/PlCommandPalette.d.ts +6 -2
  93. package/dist/components/command-palette/PlCommandPalette.js +1 -1
  94. package/dist/components/confirm/PlConfirmProvider.js +1 -1
  95. package/dist/components/container/PlContainer.d.ts +22 -6
  96. package/dist/components/container/PlContainer.js +1 -1
  97. package/dist/components/data-list/PlDataList.d.ts +74 -0
  98. package/dist/components/data-list/PlDataList.js +1 -0
  99. package/dist/components/data-list/index.d.ts +2 -0
  100. package/dist/components/data-list/index.js +1 -0
  101. package/dist/components/data-table/PlDataTable.d.ts +216 -0
  102. package/dist/components/data-table/PlDataTable.js +1 -0
  103. package/dist/components/data-table/index.d.ts +2 -0
  104. package/dist/components/data-table/index.js +1 -0
  105. package/dist/components/date-picker/PlDatePicker.js +1 -1
  106. package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
  107. package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
  108. package/dist/components/drawer/PlDrawer.d.ts +1 -1
  109. package/dist/components/drawer/PlDrawer.js +1 -1
  110. package/dist/components/file-picker/PlFilePicker.d.ts +4 -1
  111. package/dist/components/file-picker/PlFilePicker.js +1 -1
  112. package/dist/components/flex/PlFlex.d.ts +83 -0
  113. package/dist/components/flex/PlFlex.js +1 -0
  114. package/dist/components/flex/index.d.ts +2 -0
  115. package/dist/components/flex/index.js +1 -0
  116. package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
  117. package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
  118. package/dist/components/floating-action-button/index.d.ts +2 -0
  119. package/dist/components/floating-action-button/index.js +1 -0
  120. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +3 -0
  121. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
  122. package/dist/components/footer/PlFooter.d.ts +4 -3
  123. package/dist/components/footer/PlFooter.js +1 -1
  124. package/dist/components/form/PlForm.js +1 -1
  125. package/dist/components/gallery/PlGallery.d.ts +192 -0
  126. package/dist/components/gallery/PlGallery.js +1 -0
  127. package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
  128. package/dist/components/gallery/PlGalleryViewer.js +1 -0
  129. package/dist/components/gallery/index.d.ts +2 -0
  130. package/dist/components/gallery/index.js +1 -0
  131. package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
  132. package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
  133. package/dist/components/gauge-chart/index.d.ts +2 -0
  134. package/dist/components/gauge-chart/index.js +1 -0
  135. package/dist/components/grid/PlGrid.js +1 -1
  136. package/dist/components/grid/PlGridItem.js +1 -1
  137. package/dist/components/header/PlHeader.d.ts +4 -3
  138. package/dist/components/header/PlHeader.js +1 -1
  139. package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
  140. package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
  141. package/dist/components/heatmap-chart/index.d.ts +2 -0
  142. package/dist/components/heatmap-chart/index.js +1 -0
  143. package/dist/components/highlight/PlHighlight.js +1 -1
  144. package/dist/components/hot-keys/PlHotKeys.js +1 -1
  145. package/dist/components/hover-card/PlHoverCard.d.ts +96 -0
  146. package/dist/components/hover-card/PlHoverCard.js +1 -0
  147. package/dist/components/hover-card/index.d.ts +2 -0
  148. package/dist/components/hover-card/index.js +1 -0
  149. package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
  150. package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
  151. package/dist/components/how-to-steps/index.d.ts +2 -0
  152. package/dist/components/how-to-steps/index.js +1 -0
  153. package/dist/components/image/PlImage.d.ts +195 -8
  154. package/dist/components/image/PlImage.js +1 -1
  155. package/dist/components/image/PlImagePreview.d.ts +58 -0
  156. package/dist/components/image/PlImagePreview.js +1 -0
  157. package/dist/components/image/index.d.ts +1 -1
  158. package/dist/components/line-chart/PlLineChart.d.ts +74 -0
  159. package/dist/components/line-chart/PlLineChart.js +1 -0
  160. package/dist/components/line-chart/index.d.ts +2 -0
  161. package/dist/components/line-chart/index.js +1 -0
  162. package/dist/components/menu/PlMenu.d.ts +14 -5
  163. package/dist/components/menu/PlMenu.js +1 -1
  164. package/dist/components/meter/PlMeter.d.ts +83 -0
  165. package/dist/components/meter/PlMeter.js +1 -0
  166. package/dist/components/meter/index.d.ts +2 -0
  167. package/dist/components/meter/index.js +1 -0
  168. package/dist/components/mockup/PlMockup.d.ts +146 -0
  169. package/dist/components/mockup/PlMockup.js +1 -0
  170. package/dist/components/mockup/index.d.ts +2 -0
  171. package/dist/components/mockup/index.js +1 -0
  172. package/dist/components/modal/PlModal.d.ts +1 -1
  173. package/dist/components/modal/PlModal.js +1 -1
  174. package/dist/components/navigation-menu/PlNavigationMenu.d.ts +7 -1
  175. package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
  176. package/dist/components/number-field/PlNumberField.d.ts +1 -1
  177. package/dist/components/number-field/PlNumberField.js +1 -1
  178. package/dist/components/otp-field/PlOtpField.d.ts +6 -0
  179. package/dist/components/otp-field/PlOtpField.js +1 -1
  180. package/dist/components/overlay/PlOverlay.d.ts +1 -1
  181. package/dist/components/overlay/PlOverlay.js +1 -1
  182. package/dist/components/page-layout/PlPageLayout.js +1 -1
  183. package/dist/components/pagination/PlPagination.d.ts +12 -9
  184. package/dist/components/pagination/PlPagination.js +1 -1
  185. package/dist/components/panes/PlPanes.d.ts +7 -2
  186. package/dist/components/panes/PlPanes.js +1 -1
  187. package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
  188. package/dist/components/pie-chart/PlPieChart.js +1 -0
  189. package/dist/components/pie-chart/index.d.ts +2 -0
  190. package/dist/components/pie-chart/index.js +1 -0
  191. package/dist/components/pill/PlPill.js +1 -1
  192. package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
  193. package/dist/components/popconfirm/PlPopconfirm.js +1 -1
  194. package/dist/components/popover/PlPopover.d.ts +6 -6
  195. package/dist/components/popover/PlPopover.js +1 -1
  196. package/dist/components/portal/PlPortal.d.ts +78 -0
  197. package/dist/components/portal/PlPortal.js +1 -0
  198. package/dist/components/portal/index.d.ts +2 -0
  199. package/dist/components/portal/index.js +1 -0
  200. package/dist/components/progress-box/PlProgressBox.js +1 -1
  201. package/dist/components/progress-circular/PlProgressCircular.js +1 -1
  202. package/dist/components/progress-linear/PlProgressLinear.js +1 -1
  203. package/dist/components/radio-group/PlRadioGroup.js +1 -1
  204. package/dist/components/rating/PlRating.d.ts +1 -1
  205. package/dist/components/rating/PlRating.js +1 -1
  206. package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
  207. package/dist/components/scatter-chart/PlScatterChart.js +1 -0
  208. package/dist/components/scatter-chart/index.d.ts +2 -0
  209. package/dist/components/scatter-chart/index.js +1 -0
  210. package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
  211. package/dist/components/scroll-area/PlScrollArea.js +1 -0
  212. package/dist/components/scroll-area/index.d.ts +2 -0
  213. package/dist/components/scroll-area/index.js +1 -0
  214. package/dist/components/scroll-zone/PlScrollZone.d.ts +27 -10
  215. package/dist/components/scroll-zone/PlScrollZone.js +1 -1
  216. package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
  217. package/dist/components/select/PlSelect.js +1 -1
  218. package/dist/components/show/PlShow.d.ts +76 -0
  219. package/dist/components/show/PlShow.js +1 -0
  220. package/dist/components/show/index.d.ts +2 -0
  221. package/dist/components/show/index.js +1 -0
  222. package/dist/components/sidebar/PlSidebar.js +1 -1
  223. package/dist/components/sidebar/PlSidebarTrigger.js +1 -1
  224. package/dist/components/skeleton/PlSkeleton.js +1 -1
  225. package/dist/components/slider/PlSlider.d.ts +13 -1
  226. package/dist/components/slider/PlSlider.js +1 -1
  227. package/dist/components/sparkline/PlSparkline.d.ts +68 -0
  228. package/dist/components/sparkline/PlSparkline.js +1 -0
  229. package/dist/components/sparkline/index.d.ts +2 -0
  230. package/dist/components/sparkline/index.js +1 -0
  231. package/dist/components/spoiler/PlSpoiler.d.ts +16 -1
  232. package/dist/components/spoiler/PlSpoiler.js +1 -1
  233. package/dist/components/stack/PlStack.d.ts +114 -0
  234. package/dist/components/stack/PlStack.js +1 -0
  235. package/dist/components/stack/index.d.ts +2 -0
  236. package/dist/components/stack/index.js +1 -0
  237. package/dist/components/stat/PlStat.d.ts +4 -0
  238. package/dist/components/stat/PlStat.js +1 -1
  239. package/dist/components/stepper/PlStepper.d.ts +3 -3
  240. package/dist/components/stepper/PlStepper.js +1 -1
  241. package/dist/components/switch/PlSwitch.js +1 -1
  242. package/dist/components/table/PlTable.d.ts +5 -5
  243. package/dist/components/table/PlTable.js +1 -1
  244. package/dist/components/tabs/PlTabs.d.ts +27 -2
  245. package/dist/components/tabs/PlTabs.js +1 -1
  246. package/dist/components/text-link/PlTextLink.js +1 -1
  247. package/dist/components/time-picker/PlTimePicker.js +1 -1
  248. package/dist/components/timeline/PlTimeline.d.ts +2 -2
  249. package/dist/components/timeline/PlTimeline.js +1 -1
  250. package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
  251. package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
  252. package/dist/components/timeline-chart/index.d.ts +2 -0
  253. package/dist/components/timeline-chart/index.js +1 -0
  254. package/dist/components/toast/PlToast.d.ts +1 -1
  255. package/dist/components/toast/PlToast.js +1 -1
  256. package/dist/components/toggle/PlToggle.js +1 -1
  257. package/dist/components/toggle/PlToggleGroup.js +1 -1
  258. package/dist/components/tooltip/PlTooltip.js +1 -1
  259. package/dist/components/tour/PlTour.d.ts +134 -0
  260. package/dist/components/tour/PlTour.js +1 -0
  261. package/dist/components/tour/index.d.ts +2 -0
  262. package/dist/components/tour/index.js +1 -0
  263. package/dist/components/transfer/PlTransfer.d.ts +10 -1
  264. package/dist/components/transfer/PlTransfer.js +1 -1
  265. package/dist/components/tree/PlTree.js +1 -1
  266. package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
  267. package/dist/components/tree-select/PlTreeSelect.js +1 -0
  268. package/dist/components/tree-select/index.d.ts +2 -0
  269. package/dist/components/tree-select/index.js +1 -0
  270. package/dist/components/typography/PlTypography.js +1 -1
  271. package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
  272. package/dist/components/window-pane/PlWindowPane.js +1 -0
  273. package/dist/components/window-pane/index.d.ts +2 -0
  274. package/dist/components/window-pane/index.js +1 -0
  275. package/dist/css/anchor.css +2 -0
  276. package/dist/css/animate-counter.css +2 -0
  277. package/dist/css/animate-float.css +2 -0
  278. package/dist/css/animate-reveal.css +2 -0
  279. package/dist/css/animate-scramble.css +2 -0
  280. package/dist/css/animate-shake.css +2 -0
  281. package/dist/css/animate-split.css +2 -0
  282. package/dist/css/app-logo.css +2 -0
  283. package/dist/css/area-chart.css +3 -0
  284. package/dist/css/back-top.css +2 -0
  285. package/dist/css/bar-chart.css +3 -0
  286. package/dist/css/calendar.css +1 -0
  287. package/dist/css/carousel.css +2 -0
  288. package/dist/css/code-block.css +2 -0
  289. package/dist/css/color-picker.css +1 -0
  290. package/dist/css/combobox.css +1 -0
  291. package/dist/css/command-palette.css +1 -0
  292. package/dist/css/confirm.css +2 -0
  293. package/dist/css/data-list.css +2 -0
  294. package/dist/css/data-table.css +7 -0
  295. package/dist/css/date-picker.css +1 -0
  296. package/dist/css/date-range-picker.css +1 -0
  297. package/dist/css/date-time-picker.css +1 -0
  298. package/dist/css/flex.css +2 -0
  299. package/dist/css/floating-action-button.css +4 -0
  300. package/dist/css/gallery.css +7 -0
  301. package/dist/css/gauge-chart.css +3 -0
  302. package/dist/css/heatmap-chart.css +3 -0
  303. package/dist/css/hover-card.css +2 -0
  304. package/dist/css/how-to-steps.css +2 -0
  305. package/dist/css/icon-button.css +1 -0
  306. package/dist/css/image.css +2 -0
  307. package/dist/css/line-chart.css +3 -0
  308. package/dist/css/menubar.css +1 -0
  309. package/dist/css/meter.css +2 -0
  310. package/dist/css/mockup.css +2 -0
  311. package/dist/css/pagination.css +1 -0
  312. package/dist/css/pie-chart.css +3 -0
  313. package/dist/css/popconfirm.css +2 -0
  314. package/dist/css/portal.css +2 -0
  315. package/dist/css/scatter-chart.css +3 -0
  316. package/dist/css/scroll-area.css +2 -0
  317. package/dist/css/scroll-zone.css +2 -0
  318. package/dist/css/show.css +2 -0
  319. package/dist/css/sidebar.css +3 -0
  320. package/dist/css/sparkline.css +3 -0
  321. package/dist/css/spoiler.css +1 -0
  322. package/dist/css/stack.css +2 -0
  323. package/dist/css/stat.css +1 -0
  324. package/dist/css/time-picker.css +1 -0
  325. package/dist/css/timeline-chart.css +3 -0
  326. package/dist/css/tour.css +3 -0
  327. package/dist/css/transfer.css +4 -0
  328. package/dist/css/tree-select.css +4 -0
  329. package/dist/css/window-pane.css +2 -0
  330. package/dist/hooks/index.d.ts +6 -0
  331. package/dist/hooks/index.js +1 -1
  332. package/dist/hooks/usePlBreakpoint.d.ts +3 -0
  333. package/dist/hooks/usePlBreakpoint.js +1 -1
  334. package/dist/hooks/usePlDisclosure.d.ts +44 -0
  335. package/dist/hooks/usePlDisclosure.js +1 -0
  336. package/dist/hooks/usePlElementSize.d.ts +34 -0
  337. package/dist/hooks/usePlElementSize.js +1 -0
  338. package/dist/hooks/usePlHotKeys.d.ts +5 -1
  339. package/dist/hooks/usePlHotKeys.js +1 -1
  340. package/dist/hooks/usePlOnScreen.d.ts +54 -0
  341. package/dist/hooks/usePlOnScreen.js +1 -0
  342. package/dist/index.d.ts +34 -1
  343. package/dist/index.js +1 -1
  344. package/dist/internal/animate.d.ts +121 -7
  345. package/dist/internal/animate.js +1 -1
  346. package/dist/internal/breakpoints.d.ts +31 -0
  347. package/dist/internal/breakpoints.js +1 -0
  348. package/dist/internal/button-group.d.ts +29 -2
  349. package/dist/internal/button-group.js +2 -2
  350. package/dist/internal/calendar.d.ts +11 -36
  351. package/dist/internal/calendar.js +1 -1
  352. package/dist/internal/chart-frame.d.ts +462 -0
  353. package/dist/internal/chart-frame.js +1 -0
  354. package/dist/internal/chart-line.d.ts +44 -0
  355. package/dist/internal/chart-line.js +1 -0
  356. package/dist/internal/chart.d.ts +551 -0
  357. package/dist/internal/chart.js +1 -0
  358. package/dist/internal/color-scheme.js +1 -1
  359. package/dist/internal/data-table.d.ts +70 -0
  360. package/dist/internal/data-table.js +1 -0
  361. package/dist/internal/date.d.ts +10 -0
  362. package/dist/internal/date.js +1 -1
  363. package/dist/internal/defaults.d.ts +8 -3
  364. package/dist/internal/drag.d.ts +65 -0
  365. package/dist/internal/drag.js +1 -0
  366. package/dist/internal/focusable.d.ts +8 -0
  367. package/dist/internal/focusable.js +1 -0
  368. package/dist/internal/form.d.ts +61 -0
  369. package/dist/internal/form.js +1 -0
  370. package/dist/internal/format.d.ts +2 -0
  371. package/dist/internal/format.js +1 -1
  372. package/dist/internal/gallery.d.ts +80 -0
  373. package/dist/internal/gallery.js +1 -0
  374. package/dist/internal/glow.d.ts +17 -0
  375. package/dist/internal/glow.js +1 -0
  376. package/dist/internal/grid.d.ts +6 -27
  377. package/dist/internal/grid.js +1 -1
  378. package/dist/internal/highlight.d.ts +98 -0
  379. package/dist/internal/highlight.js +1 -0
  380. package/dist/internal/icons.d.ts +10 -0
  381. package/dist/internal/icons.js +1 -1
  382. package/dist/internal/image.d.ts +94 -0
  383. package/dist/internal/image.js +1 -0
  384. package/dist/internal/inert.d.ts +19 -0
  385. package/dist/internal/inert.js +1 -0
  386. package/dist/internal/keys.d.ts +19 -0
  387. package/dist/internal/keys.js +1 -1
  388. package/dist/internal/labels.d.ts +182 -0
  389. package/dist/internal/labels.js +1 -0
  390. package/dist/internal/link.d.ts +17 -0
  391. package/dist/internal/link.js +1 -1
  392. package/dist/internal/mockup.d.ts +193 -0
  393. package/dist/internal/mockup.js +1 -0
  394. package/dist/internal/page-layout.d.ts +14 -7
  395. package/dist/internal/page-layout.js +1 -1
  396. package/dist/internal/picker.d.ts +43 -6
  397. package/dist/internal/picker.js +1 -1
  398. package/dist/internal/progress.d.ts +22 -8
  399. package/dist/internal/progress.js +1 -1
  400. package/dist/internal/responsive.d.ts +108 -0
  401. package/dist/internal/responsive.js +1 -0
  402. package/dist/internal/scramble.d.ts +35 -0
  403. package/dist/internal/scramble.js +1 -0
  404. package/dist/internal/scroll-target.d.ts +5 -0
  405. package/dist/internal/scroll-target.js +1 -0
  406. package/dist/internal/steps.js +1 -1
  407. package/dist/internal/styles.d.ts +81 -0
  408. package/dist/internal/styles.js +1 -1
  409. package/dist/internal/table.d.ts +86 -0
  410. package/dist/internal/table.js +1 -0
  411. package/dist/internal/text.d.ts +39 -0
  412. package/dist/internal/text.js +1 -0
  413. package/dist/internal/threshold.d.ts +19 -0
  414. package/dist/internal/threshold.js +1 -0
  415. package/dist/internal/tour.d.ts +42 -0
  416. package/dist/internal/tour.js +1 -0
  417. package/dist/internal/watermark.d.ts +44 -0
  418. package/dist/internal/watermark.js +1 -0
  419. package/dist/internal/wheel.d.ts +52 -0
  420. package/dist/internal/wheel.js +1 -0
  421. package/dist/internal/window.d.ts +201 -0
  422. package/dist/internal/window.js +1 -0
  423. package/dist/locales/de.d.ts +3 -0
  424. package/dist/locales/de.js +1 -0
  425. package/dist/locales/en.d.ts +2 -0
  426. package/dist/locales/en.js +1 -0
  427. package/dist/locales/es.d.ts +3 -0
  428. package/dist/locales/es.js +1 -0
  429. package/dist/locales/fr.d.ts +3 -0
  430. package/dist/locales/fr.js +1 -0
  431. package/dist/locales/index.d.ts +33 -0
  432. package/dist/locales/index.js +1 -0
  433. package/dist/locales/ja.d.ts +3 -0
  434. package/dist/locales/ja.js +1 -0
  435. package/dist/locales/ko.d.ts +3 -0
  436. package/dist/locales/ko.js +1 -0
  437. package/dist/locales/zh-Hans.d.ts +3 -0
  438. package/dist/locales/zh-Hans.js +1 -0
  439. package/dist/provider/PlColorSchemeScript.js +1 -1
  440. package/dist/provider/PlassProvider.js +1 -1
  441. package/dist/provider/index.d.ts +1 -0
  442. package/dist/provider/index.js +1 -1
  443. package/dist/styles.css +1 -1
  444. package/dist/tailwind.css +1357 -25
  445. package/dist/tokens.css +1357 -25
  446. package/dist/types.d.ts +368 -2
  447. package/package.json +26 -16
  448. package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
  449. package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
  450. package/dist/components/avatar-group/index.d.ts +0 -2
  451. package/dist/components/avatar-group/index.js +0 -1
  452. package/dist/css/avatar-group.css +0 -2
  453. package/dist/internal/avatar-group.d.ts +0 -25
  454. package/dist/internal/avatar-group.js +0 -2
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ /** The box an element is laid out at, in pixels. */
3
+ export interface PlElementSize {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ /**
8
+ * How big an element is, kept up to date as it changes.
9
+ *
10
+ * A `ResizeObserver` and the two things a hook has to add. The first is
11
+ * **when**: the size is read in a layout effect as well as from the observer,
12
+ * because an observer's first callback arrives after a frame has been painted
13
+ * and a component that laid itself out from `0 × 0` for one frame flashes.
14
+ *
15
+ * The second is what it reports: the **content box**, the room actually left
16
+ * inside the element once its own padding has been taken off. A hand-written
17
+ * version nearly always reports `getBoundingClientRect` or `borderBoxSize`
18
+ * instead, which is a different number — and the wrong one for the question
19
+ * that made somebody measure the element.
20
+ *
21
+ * `null` until there is an element to measure, which is the honest answer on a
22
+ * server and on the first render: guessing `0` there would let a caller divide
23
+ * by it. The ref is read again after every render, so an element that is
24
+ * attached later — `loading ? <Spinner /> : <div ref={box}>` — or swapped for
25
+ * another is measured from the moment it is there, and the answer goes back to
26
+ * `null` while there is none.
27
+ *
28
+ * @example
29
+ * const box = React.useRef<HTMLDivElement>(null);
30
+ * const size = usePlElementSize(box);
31
+ *
32
+ * <div ref={box}>{size ? `${Math.round(size.width)}px` : null}</div>
33
+ */
34
+ export declare function usePlElementSize(target: React.RefObject<HTMLElement | null>): PlElementSize | null;
@@ -0,0 +1 @@
1
+ "use client";import*as e from"react";export function usePlElementSize(t){const[n,r]=e.useState(null),[i,o]=e.useState(null);return e.useLayoutEffect(()=>{t.current!==i&&o(t.current)}),e.useLayoutEffect(()=>{if(!i)return void r(null);const read=()=>{const e=function contentBoxOf(e){const t=getComputedStyle(e),n=parseFloat(t.paddingInlineStart)+parseFloat(t.paddingInlineEnd),r=parseFloat(t.paddingBlockStart)+parseFloat(t.paddingBlockEnd);return{width:Math.max(0,e.clientWidth-n),height:Math.max(0,e.clientHeight-r)}}(i);r(t=>t?.width===e.width&&t.height===e.height?t:e)};if(read(),"undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(read);return e.observe(i),()=>e.disconnect()},[i]),n}
@@ -55,7 +55,7 @@ export interface PlHotKeysOptions {
55
55
  * this way since it existed, with a private copy of the matcher — and an
56
56
  * application's own shortcuts are the reason it is public.
57
57
  *
58
- * Three rules it shares with the `hotKeys` prop:
58
+ * Five rules it shares with the `hotKeys` prop:
59
59
  *
60
60
  * - **A modifier is checked in both directions.** `Enter` does not fire on
61
61
  * `Shift+Enter`, and `Mod+K` does not fire on `Mod+Shift+K`.
@@ -66,6 +66,10 @@ export interface PlHotKeysOptions {
66
66
  * - **These are chords rather than letters.** A single unmodified key is
67
67
  * allowed and is sometimes right (`?` for help), but it is the case
68
68
  * `whileTyping` is about.
69
+ * - **A chord names the key, not the character it types.** `Alt+K` answers
70
+ * the `˚` Option+K types on a Mac, and `?` needs no `Shift+`.
71
+ * - **A key an input method is composing is left alone**, so the Enter that
72
+ * commits a syllable fires nothing.
69
73
  *
70
74
  * The handlers are read fresh on every keystroke, so an inline object literal
71
75
  * costs nothing and a handler closing over current state is never stale. What
@@ -1 +1 @@
1
- "use client";import*as e from"react";import{editsText as n,hasHardModifier as t,isTypingTarget as r,matchesHotKey as o}from"../internal/keys.js";export function usePlHotKeys(i,u={}){const{enabled:s=!0,target:f,whileTyping:c=!1}=u,l=e.useRef(i);e.useEffect(()=>{l.current=i});const d=Object.keys(i??{}).join("\n");e.useEffect(()=>{const e=function resolve(e){return void 0===e?"undefined"==typeof window?null:window:null===e?null:"current"in e?e.current:e}(f);if(!s||!e||""===d)return;const i=d.split("\n"),onKeyDown=e=>{const u=e;if(!u.defaultPrevented)for(const e of i)if(o(u,e)){if(!c&&!t(e)&&n(u.key)&&r(u.target))return;return u.preventDefault(),void l.current?.[e]?.()}};return e.addEventListener("keydown",onKeyDown),()=>e.removeEventListener("keydown",onKeyDown)},[d,f,s,c])}
1
+ "use client";import*as e from"react";import{editsText as n,hasHardModifier as t,isComposingKey as r,isTypingTarget as o,matchesHotKey as i}from"../internal/keys.js";export function usePlHotKeys(u,s={}){const{enabled:f=!0,target:c,whileTyping:l=!1}=s,d=e.useRef(u);e.useEffect(()=>{d.current=u});const a=Object.keys(u??{}).join("\n");e.useEffect(()=>{const e=function resolve(e){return void 0===e?"undefined"==typeof window?null:window:null===e?null:"current"in e?e.current:e}(c);if(!f||!e||""===a)return;const u=a.split("\n"),onKeyDown=e=>{const s=e;if(!s.defaultPrevented&&!r(s))for(const e of u)if(i(s,e)){if(!l&&!t(e)&&n(s.key)&&o(s.target))return;return s.preventDefault(),void d.current?.[e]?.()}};return e.addEventListener("keydown",onKeyDown),()=>e.removeEventListener("keydown",onKeyDown)},[a,c,f,l])}
@@ -0,0 +1,54 @@
1
+ import * as React from 'react';
2
+ export interface PlOnScreenOptions {
3
+ /**
4
+ * How much of the element has to be showing before it counts, from `0` to
5
+ * `1`.
6
+ * @default 0
7
+ */
8
+ threshold?: number;
9
+ /**
10
+ * How far outside the viewport still counts, as a CSS margin — `'200px'`
11
+ * starts a fetch a screen early.
12
+ */
13
+ rootMargin?: string;
14
+ /**
15
+ * What it is measured against. The viewport when it is not given; a scrolling
16
+ * panel otherwise.
17
+ */
18
+ root?: React.RefObject<Element | null>;
19
+ /**
20
+ * Stops watching the first time it appears.
21
+ *
22
+ * On by default, because the question a caller almost always has is "has this
23
+ * been seen yet" rather than "is it on screen right now" — a lazily loaded
24
+ * picture, a section that animates once, a page that fetches the next batch.
25
+ * Turn it off for the answer that keeps changing.
26
+ * @default true
27
+ */
28
+ once?: boolean;
29
+ }
30
+ /**
31
+ * Whether an element is on screen.
32
+ *
33
+ * An `IntersectionObserver` with the three things a hook has to decide, and
34
+ * the interesting one is `once`. It is **on** by default: the question a caller
35
+ * almost always has is "has this been seen yet", not "is it on screen right
36
+ * now", and a hook that kept answering the second one would re-render a page of
37
+ * lazily loaded pictures every time the reader scrolled past any of them.
38
+ *
39
+ * `false` on a server and on the first render, which is the safe answer for
40
+ * both of the things this is used for: nothing is fetched that did not need to
41
+ * be, and nothing is played before a reader could see it.
42
+ *
43
+ * A browser with no observer is told **yes** rather than no. There is no way to
44
+ * find out, and a picture that never loads is worse than one that loads early.
45
+ *
46
+ * The refs are read again after every render, so an element or a `root` that is
47
+ * attached after the first one, or swapped for another, is watched from the
48
+ * moment it is there.
49
+ *
50
+ * @example
51
+ * const section = React.useRef<HTMLDivElement>(null);
52
+ * const seen = usePlOnScreen(section, { rootMargin: '200px' });
53
+ */
54
+ export declare function usePlOnScreen(target: React.RefObject<Element | null>, { threshold, rootMargin, root, once }?: PlOnScreenOptions): boolean;
@@ -0,0 +1 @@
1
+ "use client";import*as e from"react";export function usePlOnScreen(t,{threshold:r=0,rootMargin:n,root:o,once:s=!0}={}){const[u,c]=e.useState(!1),[i,l]=e.useState(null),[f,a]=e.useState(null);return e.useEffect(()=>{t.current!==i&&l(t.current),(o?.current??null)!==f&&a(o?.current??null)}),e.useEffect(()=>{if(!i)return;if("undefined"==typeof IntersectionObserver)return void c(!0);const e=new IntersectionObserver(([t])=>{t.isIntersecting?(c(!0),s&&e.disconnect()):s||c(!1)},{threshold:r,rootMargin:n,root:f});return e.observe(i),()=>e.disconnect()},[i,f,r,n,s]),u}
package/dist/index.d.ts CHANGED
@@ -3,22 +3,31 @@ export * from './hooks/index.js';
3
3
  export * from './provider/index.js';
4
4
  export * from './components/accordion/index.js';
5
5
  export * from './components/alert/index.js';
6
+ export * from './components/anchor/index.js';
6
7
  export * from './components/animate-appear/index.js';
7
8
  export * from './components/animate-blink/index.js';
9
+ export * from './components/animate-counter/index.js';
8
10
  export * from './components/animate-fade/index.js';
11
+ export * from './components/animate-float/index.js';
9
12
  export * from './components/animate-grow/index.js';
10
13
  export * from './components/animate-headline/index.js';
11
14
  export * from './components/animate-lighting/index.js';
12
15
  export * from './components/animate-marquee/index.js';
16
+ export * from './components/animate-reveal/index.js';
13
17
  export * from './components/animate-rotate/index.js';
18
+ export * from './components/animate-scramble/index.js';
19
+ export * from './components/animate-shake/index.js';
14
20
  export * from './components/animate-slide/index.js';
21
+ export * from './components/animate-split/index.js';
15
22
  export * from './components/animate-typing/index.js';
16
23
  export * from './components/animate-zoom/index.js';
24
+ export * from './components/app-logo/index.js';
25
+ export * from './components/area-chart/index.js';
17
26
  export * from './components/aspect-ratio/index.js';
18
27
  export * from './components/avatar/index.js';
19
- export * from './components/avatar-group/index.js';
20
28
  export * from './components/back-top/index.js';
21
29
  export * from './components/badge/index.js';
30
+ export * from './components/bar-chart/index.js';
22
31
  export * from './components/blockquote/index.js';
23
32
  export * from './components/bottom-navigation/index.js';
24
33
  export * from './components/box/index.js';
@@ -31,12 +40,15 @@ export * from './components/carousel/index.js';
31
40
  export * from './components/chat-bubble/index.js';
32
41
  export * from './components/checkbox/index.js';
33
42
  export * from './components/chip/index.js';
43
+ export * from './components/code-block/index.js';
34
44
  export * from './components/collapsible/index.js';
35
45
  export * from './components/color-picker/index.js';
36
46
  export * from './components/combobox/index.js';
37
47
  export * from './components/confirm/index.js';
38
48
  export * from './components/command-palette/index.js';
39
49
  export * from './components/container/index.js';
50
+ export * from './components/data-list/index.js';
51
+ export * from './components/data-table/index.js';
40
52
  export * from './components/date-picker/index.js';
41
53
  export * from './components/date-range-picker/index.js';
42
54
  export * from './components/date-time-picker/index.js';
@@ -45,19 +57,29 @@ export * from './components/drawer/index.js';
45
57
  export * from './components/empty/index.js';
46
58
  export * from './components/fieldset/index.js';
47
59
  export * from './components/file-picker/index.js';
60
+ export * from './components/flex/index.js';
61
+ export * from './components/floating-action-button/index.js';
48
62
  export * from './components/floating-bottom-navigation/index.js';
49
63
  export * from './components/footer/index.js';
50
64
  export * from './components/form/index.js';
65
+ export * from './components/gallery/index.js';
66
+ export * from './components/gauge-chart/index.js';
51
67
  export * from './components/grid/index.js';
52
68
  export * from './components/header/index.js';
69
+ export * from './components/heatmap-chart/index.js';
53
70
  export * from './components/highlight/index.js';
54
71
  export * from './components/hot-keys/index.js';
72
+ export * from './components/hover-card/index.js';
73
+ export * from './components/how-to-steps/index.js';
55
74
  export * from './components/icon/index.js';
56
75
  export * from './components/icon-button/index.js';
57
76
  export * from './components/image/index.js';
77
+ export * from './components/line-chart/index.js';
58
78
  export * from './components/list/index.js';
59
79
  export * from './components/menu/index.js';
60
80
  export * from './components/menubar/index.js';
81
+ export * from './components/meter/index.js';
82
+ export * from './components/mockup/index.js';
61
83
  export * from './components/modal/index.js';
62
84
  export * from './components/navigation-menu/index.js';
63
85
  export * from './components/number-field/index.js';
@@ -66,21 +88,28 @@ export * from './components/overlay/index.js';
66
88
  export * from './components/page-layout/index.js';
67
89
  export * from './components/pagination/index.js';
68
90
  export * from './components/panes/index.js';
91
+ export * from './components/pie-chart/index.js';
69
92
  export * from './components/pill/index.js';
70
93
  export * from './components/popconfirm/index.js';
71
94
  export * from './components/popover/index.js';
95
+ export * from './components/portal/index.js';
72
96
  export * from './components/progress-box/index.js';
73
97
  export * from './components/progress-circular/index.js';
74
98
  export * from './components/progress-linear/index.js';
75
99
  export * from './components/radio-group/index.js';
76
100
  export * from './components/rating/index.js';
101
+ export * from './components/scatter-chart/index.js';
102
+ export * from './components/scroll-area/index.js';
77
103
  export * from './components/scroll-zone/index.js';
78
104
  export * from './components/segmented-button/index.js';
79
105
  export * from './components/select/index.js';
106
+ export * from './components/show/index.js';
80
107
  export * from './components/sidebar/index.js';
81
108
  export * from './components/skeleton/index.js';
82
109
  export * from './components/slider/index.js';
110
+ export * from './components/sparkline/index.js';
83
111
  export * from './components/spoiler/index.js';
112
+ export * from './components/stack/index.js';
84
113
  export * from './components/stat/index.js';
85
114
  export * from './components/stepper/index.js';
86
115
  export * from './components/switch/index.js';
@@ -90,11 +119,15 @@ export * from './components/text-field/index.js';
90
119
  export * from './components/text-link/index.js';
91
120
  export * from './components/time-picker/index.js';
92
121
  export * from './components/timeline/index.js';
122
+ export * from './components/timeline-chart/index.js';
93
123
  export * from './components/toast/index.js';
94
124
  export * from './components/toggle/index.js';
95
125
  export * from './components/toolbar/index.js';
96
126
  export * from './components/tooltip/index.js';
127
+ export * from './components/tour/index.js';
97
128
  export * from './components/tree/index.js';
129
+ export * from './components/tree-select/index.js';
98
130
  export * from './components/transfer/index.js';
99
131
  export * from './components/typography/index.js';
100
132
  export * from './components/visually-hidden/index.js';
133
+ export * from './components/window-pane/index.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./types.js";export*from"./hooks/index.js";export*from"./provider/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/avatar-group/index.js";export*from"./components/back-top/index.js";export*from"./components/badge/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/confirm/index.js";export*from"./components/command-palette/index.js";export*from"./components/container/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/form/index.js";export*from"./components/grid/index.js";export*from"./components/header/index.js";export*from"./components/highlight/index.js";export*from"./components/hot-keys/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/modal/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/spoiler/index.js";export*from"./components/stat/index.js";export*from"./components/stepper/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/toast/index.js";export*from"./components/toggle/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tree/index.js";export*from"./components/transfer/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";
1
+ export*from"./types.js";export*from"./hooks/index.js";export*from"./provider/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/anchor/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-counter/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-float/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-reveal/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-scramble/index.js";export*from"./components/animate-shake/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-split/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/app-logo/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/back-top/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/confirm/index.js";export*from"./components/command-palette/index.js";export*from"./components/container/index.js";export*from"./components/data-list/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/flex/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/form/index.js";export*from"./components/gallery/index.js";export*from"./components/gauge-chart/index.js";export*from"./components/grid/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/hot-keys/index.js";export*from"./components/hover-card/index.js";export*from"./components/how-to-steps/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/meter/index.js";export*from"./components/mockup/index.js";export*from"./components/modal/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/portal/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-area/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/show/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/stack/index.js";export*from"./components/stat/index.js";export*from"./components/stepper/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toggle/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tour/index.js";export*from"./components/tree/index.js";export*from"./components/tree-select/index.js";export*from"./components/transfer/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";export*from"./components/window-pane/index.js";
@@ -25,15 +25,27 @@
25
25
  * `rotate` properties rather than on the `transform` shorthand, so a caller's
26
26
  * own transform on the same element survives.
27
27
  *
28
+ * ## Telling the children apart
29
+ *
30
+ * `stagger`, `durationStep` and `reverse` move an effect off the box and onto
31
+ * the things inside it, one after another. There is no `PlAnimateStagger`
32
+ * component and there should not be: a stagger is a *differential* rather than
33
+ * an effect, and a wrapper would be a second way to spell something all six
34
+ * effects can already say. `animateChildren` and `staggerSlots` are what
35
+ * `PlAnimateAppear` — which was staggering long before the six could — now runs
36
+ * on as well, because two implementations of "one after another" is two
37
+ * opinions about the arithmetic.
38
+ *
28
39
  * ## What is deliberately not here
29
40
  *
30
41
  * An effect that has to know what its children *are* — a marquee that lays them
31
42
  * down twice, a headline that swaps between them, a typewriter that counts
32
43
  * graphemes — cannot be a class name and a few numbers. Those are components,
33
- * and their logic stays in their own files.
44
+ * and their logic stays in their own files. They are also the four that cannot
45
+ * take a `stagger`, for the same reason: their children are already spoken for.
34
46
  */
35
47
  import * as React from 'react';
36
- import type { PlassAnimateRepeat, PlassAnimateTrigger, PlassAnimation, PlassSide } from '../types.js';
48
+ import type { PlassAnimateRepeat, PlassAnimateStaggerProps, PlassAnimateTimelineProps, PlassAnimateTrigger, PlassAnimation, PlassSide } from '../types.js';
37
49
  /**
38
50
  * Which keyframe an effect runs.
39
51
  *
@@ -59,7 +71,15 @@ export declare function isInfinite(repeat: PlassAnimateRepeat | undefined): bool
59
71
  * is `both`, so a faded-out element stays faded out instead of snapping back.
60
72
  */
61
73
  export declare function directionValue(mode: 'in' | 'out', alternate: boolean | undefined): string;
62
- export interface AnimationSlotOptions {
74
+ /**
75
+ * Where a scroll-linked effect starts and finishes, as an `animation-range`.
76
+ *
77
+ * Finished while the element is still arriving rather than when it reaches the
78
+ * middle of the screen: an entrance that is only half drawn by the time a
79
+ * reader has read past it is an entrance that never happened.
80
+ */
81
+ export declare const defaultViewRange = "entry 0% cover 45%";
82
+ export interface AnimationSlotOptions extends PlassAnimateTimelineProps {
63
83
  duration: number;
64
84
  delay: number;
65
85
  easing?: string;
@@ -73,6 +93,8 @@ export interface AnimationSlotOptions {
73
93
  y?: string;
74
94
  angle?: string;
75
95
  angleTo?: string;
96
+ /** The `clip-path` a reveal is uncovered from. */
97
+ clip?: string;
76
98
  }
77
99
  /**
78
100
  * The `--p-anim-*` slots, as an inline style object.
@@ -82,6 +104,14 @@ export interface AnimationSlotOptions {
82
104
  * has never seen written down.
83
105
  */
84
106
  export declare function animationSlots(options: AnimationSlotOptions): React.CSSProperties;
107
+ /**
108
+ * The `clip-path` a reveal starts from, given the edge it uncovers from.
109
+ *
110
+ * `inset()` takes its four sides in the physical order CSS writes them, and
111
+ * `PlassSide` is physical for the same reason it is on a slide: a title wiped
112
+ * in from the top is wiped in from the top in every writing direction.
113
+ */
114
+ export declare function revealClip(from: PlassSide): string;
85
115
  /**
86
116
  * Which way a slide starts, given the edge it comes from.
87
117
  *
@@ -101,6 +131,17 @@ export interface AnimationRunOptions {
101
131
  paused?: boolean;
102
132
  /** An infinite effect stops when the pointer leaves; a finite one finishes. */
103
133
  infinite: boolean;
134
+ /**
135
+ * A value that plays the effect again whenever it changes, and never on the
136
+ * first render.
137
+ *
138
+ * `play` is a boolean, so replaying with it means toggling off and on — two
139
+ * renders for one event, and a piece of state whose only job is to be
140
+ * flipped back. A response to something that can happen twice needs the
141
+ * *event*, and a value that has changed is the closest React has to one: a
142
+ * count of failed attempts already is this.
143
+ */
144
+ nonce?: unknown;
104
145
  }
105
146
  export interface AnimationRun {
106
147
  /** Goes on the animated element. */
@@ -109,7 +150,25 @@ export interface AnimationRun {
109
150
  state: 'running' | 'paused';
110
151
  /** Whether the animation has been let go at all. */
111
152
  started: boolean;
112
- /** Spread onto the element when `trigger` is `hover`; empty otherwise. */
153
+ /**
154
+ * How many times it has been started, counting every hover, every `play` and
155
+ * every change of `nonce`.
156
+ *
157
+ * `started` stays `true` from the first start on, so a second hover changes
158
+ * nothing an effect could depend on. A keyframe does not need to know, because
159
+ * it is rewound in the DOM whenever this changes. Counter, Scramble and Typing
160
+ * run their own loops in JavaScript, and they replay by listing this among
161
+ * their effects' dependencies.
162
+ */
163
+ runs: number;
164
+ /**
165
+ * The hover trigger's handlers when `trigger` is `hover`; empty otherwise.
166
+ *
167
+ * Merged with the caller's props through `mergeProps` rather than spread
168
+ * beside them. Both sides want `onPointerEnter` and `onFocus`, and a spread
169
+ * keeps only one: either a caller's prefetch never runs, or a caller's
170
+ * `onFocus` quietly takes the keyboard's way in away from the effect.
171
+ */
113
172
  handlers: React.HTMLAttributes<HTMLElement>;
114
173
  }
115
174
  /**
@@ -130,18 +189,73 @@ export interface AnimationRun {
130
189
  * with it. Clearing `animation-name`, reading a layout property to force the
131
190
  * style to settle, and putting it back is the one move that rewinds the element
132
191
  * and leaves everything inside it alone.
192
+ *
193
+ * **`visible` is measured rather than observed.** Two observers report and
194
+ * neither decides: what they say is that the view has moved, and the answer is
195
+ * then read off the element's own resting box. An `IntersectionObserver` sees
196
+ * the element where its first frame is holding it, which for a slide is a
197
+ * screen from where it lives, so the box it reports on is the wrong box.
198
+ */
199
+ export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite, nonce }: AnimationRunOptions): AnimationRun;
200
+ export interface StaggerPosition extends Required<PlassAnimateStaggerProps> {
201
+ index: number;
202
+ count: number;
203
+ }
204
+ /**
205
+ * Where one child sits in a staggered run.
206
+ *
207
+ * `reverse` turns the *order* round and nothing else: the last child goes
208
+ * first and every child still plays forwards. An effect that ran backwards is
209
+ * `mode="out"`, which is a different question and already has an answer.
210
+ *
211
+ * The duration is floored at zero rather than allowed to go negative, because a
212
+ * negative `animation-duration` is invalid and an invalid declaration is
213
+ * dropped — which would leave that one child playing at the CSS default while
214
+ * its neighbours honoured the prop.
215
+ */
216
+ export declare function staggerSlots(slots: AnimationSlotOptions, { index, count, stagger, durationStep, reverse }: StaggerPosition): AnimationSlotOptions;
217
+ /**
218
+ * Writes one effect onto each child, with that child's own slots.
219
+ *
220
+ * Onto the children **themselves** rather than onto wrappers around them, which
221
+ * is the whole reason this is worth sharing: a row of `<li>`s stays a row of
222
+ * `<li>`s, a grid's cells stay its direct children, and nothing about the
223
+ * layout changes because the set is being animated. A wrapper per child would
224
+ * break every one of those.
225
+ *
226
+ * The trade is the one `React.cloneElement` always makes — a child has to
227
+ * accept a `className` and a `style` — and it is taken here and nowhere else in
228
+ * the library. It is bearable because what is being copied is *only* the
229
+ * animation, so a child that ignores both is a child that does not animate,
230
+ * rather than a child that lands in the wrong place. `PlStack` draws a wrapper
231
+ * per item instead, and takes the layout cost, precisely because *there* the
232
+ * failure would not be survivable: a child that dropped the class would land in
233
+ * the wrong place rather than merely arriving without an entrance.
234
+ *
235
+ * A bare string has no element to write onto, so that one is wrapped in a
236
+ * `<span>`. It is the only case that gets a wrapper.
133
237
  */
134
- export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite }: AnimationRunOptions): AnimationRun;
135
- export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions {
238
+ export declare function animateChildren(children: React.ReactNode, className: string, slotsFor: (index: number, count: number) => React.CSSProperties): React.ReactNode[];
239
+ export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions, PlassAnimateStaggerProps {
136
240
  /** Which keyframe. `null` for the components that write their own. */
137
241
  effect: PlassAnimation | null;
242
+ /** `transform-origin`, for the two effects that turn about a point. */
243
+ origin?: string;
244
+ /** Needed only to be handed back staggered. Passed straight through otherwise. */
245
+ children?: React.ReactNode;
138
246
  }
139
247
  export interface AnimateElement {
140
248
  ref: React.RefCallback<HTMLElement>;
141
249
  className: string;
142
250
  style: React.CSSProperties;
143
- /** The hover handlers and the two data attributes, ready to be spread. */
251
+ /**
252
+ * The hover handlers and the two data attributes, to be merged with the
253
+ * caller's props through `mergeProps` for the reason `AnimationRun.handlers`
254
+ * gives.
255
+ */
144
256
  props: React.HTMLAttributes<HTMLElement> & Record<string, unknown>;
257
+ /** The children, with the effect written onto them if it was staggered. */
258
+ children: React.ReactNode;
145
259
  }
146
260
  /**
147
261
  * Everything a one-keyframe `PlAnimate*` root needs, in one call.
@@ -1 +1 @@
1
- import*as e from"react";export const animationClasses={fade:"plass-anim-fade",grow:"plass-anim-scale",slide:"plass-anim-slide",zoom:"plass-anim-scale",rotate:"plass-anim-rotate",blink:"plass-anim-blink"};export const animBaseClass="plass-anim";export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,n){return"out"===e?n?"alternate-reverse":"reverse":n?"alternate":"normal"}export function animationSlots(e){const n={"--p-anim-duration":`${e.duration}ms`,"--p-anim-delay":`${e.delay}ms`,"--p-anim-repeat":repeatValue(e.repeat),"--p-anim-direction":directionValue(e.mode??"in",e.alternate)};return e.easing&&(n["--p-anim-ease"]=e.easing),void 0!==e.opacity&&(n["--p-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(n["--p-anim-scale"]=String(e.scale)),void 0!==e.x&&(n["--p-anim-x"]=e.x),void 0!==e.y&&(n["--p-anim-y"]=e.y),void 0!==e.angle&&(n["--p-anim-angle"]=e.angle),void 0!==e.angleTo&&(n["--p-anim-angle-to"]=e.angleTo),n}export function slideOffsets(e,n){const t=lengthValue(n),a="number"==typeof n?-n+"px":`calc(-1 * ${t})`;switch(e){case"top":return{x:"0px",y:a};case"bottom":return{x:"0px",y:t};case"left":return{x:a,y:"0px"};default:return{x:t,y:"0px"}}}export function useAnimationRun({trigger:n,play:t,once:a,threshold:i,paused:s,infinite:r}){const o=e.useRef(null),[l,u]=e.useState("mount"===n),[c,p]=e.useState(0),m=e.useCallback(()=>{u(!0),p(e=>e+1)},[]);e.useLayoutEffect(()=>{const e=o.current;if(!e||0===c)return;const n=[e,...e.querySelectorAll(".plass-anim, .plass-marquee-track")];for(const e of n)e.style.animationName="none";e.offsetWidth;for(const e of n)e.style.animationName=""},[c]),e.useEffect(()=>{if("visible"!==n)return;const e=o.current;if(!e||"undefined"==typeof IntersectionObserver)return void u(!0);const t=new IntersectionObserver(([e])=>{e.isIntersecting?(m(),a&&t.disconnect()):a||u(!1)},{threshold:i});return t.observe(e),()=>t.disconnect()},[n,a,i,m]),e.useEffect(()=>{"manual"===n&&(t?m():u(!1))},[n,t,m]);const f="hover"===n?{onPointerEnter:m,onFocus:m,onPointerLeave:()=>{r&&u(!1)},onBlur:()=>{r&&u(!1)}}:{};return{ref:e.useCallback(e=>{o.current=e},[]),state:l&&!s?"running":"paused",started:l,handlers:f}}export function useAnimateElement(e){const{effect:n,trigger:t,play:a,once:i,threshold:s,paused:r,infinite:o,...l}=e,u=useAnimationRun({trigger:t,play:a,once:i,threshold:s,paused:r,infinite:o});return{ref:u.ref,className:n?`plass-anim ${animationClasses[n]}`:"",style:{...animationSlots(l),"--p-anim-state":u.state},props:{...u.handlers,"data-plass-animation":n??void 0,"data-state":u.state}}}
1
+ import*as e from"react";import{cx as t}from"./styles.js";export const animationClasses={fade:"plass-anim-fade",grow:"plass-anim-scale",slide:"plass-anim-slide",zoom:"plass-anim-scale",rotate:"plass-anim-rotate",blink:"plass-anim-blink",reveal:"plass-anim-reveal"};export const animBaseClass="plass-anim";export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,t){return"out"===e?t?"alternate-reverse":"reverse":t?"alternate":"normal"}export const defaultViewRange="entry 0% cover 45%";export function animationSlots(e){const t={"--p-anim-duration":`${e.duration}ms`,"--p-anim-delay":`${e.delay}ms`,"--p-anim-repeat":repeatValue(e.repeat),"--p-anim-direction":directionValue(e.mode??"in",e.alternate)};return e.easing&&(t["--p-anim-ease"]=e.easing),"view"===e.timeline&&(t["--p-anim-timeline"]="view()",t["--p-anim-range"]=e.range??defaultViewRange),void 0!==e.opacity&&(t["--p-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(t["--p-anim-scale"]=String(e.scale)),void 0!==e.x&&(t["--p-anim-x"]=e.x),void 0!==e.y&&(t["--p-anim-y"]=e.y),void 0!==e.angle&&(t["--p-anim-angle"]=e.angle),void 0!==e.angleTo&&(t["--p-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(t["--p-anim-clip"]=e.clip),t}export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}export function slideOffsets(e,t){const n=lengthValue(t),r="number"==typeof t?-t+"px":`calc(-1 * ${n})`;switch(e){case"top":return{x:"0px",y:r};case"bottom":return{x:"0px",y:n};case"left":return{x:r,y:"0px"};default:return{x:n,y:"0px"}}}function viewportRect(){const e=document.documentElement;return new DOMRect(0,0,e.clientWidth,e.clientHeight)}function holds(e,t){return null!==e&&t instanceof Node&&e.contains(t)}export function useAnimationRun({trigger:t,play:n,once:r,threshold:i,paused:a,infinite:o,nonce:s}){const l=e.useRef(null),[c,u]=e.useState("mount"===t),[m,p]=e.useState(0),f=e.useCallback(()=>{u(!0),p(e=>e+1)},[]);e.useLayoutEffect(()=>{const e=l.current;if(!e||0===m)return;const t=[e];for(const n of e.querySelectorAll(".plass-anim, .plass-marquee-track"))n.closest("[data-plass-animation]")===e&&t.push(n);for(const e of t)e.style.animationName="none";e.offsetWidth;for(const e of t)e.style.animationName=""},[m]);const d=e.useRef("mount"!==t);e.useEffect(()=>{d.current=!c},[c]),e.useEffect(()=>{if("visible"!==t)return;const e=l.current;if(!e||"undefined"==typeof IntersectionObserver)return void u(!0);const n=[],a=e.parentElement;let o=a?null:viewportRect();const check=()=>{if(!o)return;const t=function visibleShare(e,t){const n=e.width*e.height;if(n<=0)return 0;const r=Math.min(e.right,t.right)-Math.max(e.left,t.left),i=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return Math.max(0,r)*Math.max(0,i)/n}(function restingRect(e,t){if(!t)return e.getBoundingClientRect();const n=e.style.animationName;e.style.animationName="none";const r=e.getBoundingClientRect();return e.style.animationName=n,r}(e,d.current),o);if(t>0&&t>=i){if(f(),r)for(const e of n)e.disconnect()}else r||u(!1)},s=function measureSteps(e){const t=Array.from({length:21},(e,t)=>t/20);return e>0&&e<1?[...t,e]:t}(i);if(a){const e=new IntersectionObserver(([e])=>{o=function clipRect(e){const t=e.boundingClientRect;return t.width*t.height>0?e.intersectionRect:e.rootBounds??viewportRect()}(e),check()},{threshold:s});n.push(e),e.observe(a)}const c=new IntersectionObserver(check,{threshold:s});return n.push(c),c.observe(e),()=>{for(const e of n)e.disconnect()}},[t,r,i,f]);const g=e.useRef(s);e.useEffect(()=>{Object.is(s,g.current)||(g.current=s,f())},[s,f]),e.useEffect(()=>{"manual"===t&&(n?f():u(!1))},[t,n,f]);const h="hover"===t?{onPointerEnter:f,onFocus:e=>{holds(l.current,e.relatedTarget)||f()},onPointerLeave:()=>{o&&u(!1)},onBlur:e=>{o&&!holds(l.current,e.relatedTarget)&&u(!1)}}:{};return{ref:e.useCallback(e=>{l.current=e},[]),state:c&&!a?"running":"paused",started:c,runs:m,handlers:h}}export function staggerSlots(e,{index:t,count:n,stagger:r,durationStep:i,reverse:a}){const o=a?n-1-t:t;return{...e,delay:e.delay+o*r,duration:Math.max(0,e.duration+o*i)}}export function animateChildren(n,r,i){const a=e.Children.toArray(n);return a.map((n,o)=>{const s=i(o,a.length);if(!e.isValidElement(n))return e.createElement("span",{key:o,className:r,style:s},n);const l=n.props;return e.cloneElement(n,{className:t(r,l.className),style:{...s,...l.style}})})}export function useAnimateElement(e){const{effect:t,trigger:n,play:r,once:i,threshold:a,paused:o,infinite:s,nonce:l,stagger:c=0,durationStep:u=0,reverse:m=!1,origin:p,children:f,...d}=e,g=useAnimationRun({trigger:"view"===d.timeline?"mount":n,play:r,once:i,threshold:a,paused:o,infinite:s,nonce:l}),h=t?`plass-anim ${animationClasses[t]}`:"",y=0!==c&&null!==t,v=void 0===p?null:{transformOrigin:p};return{ref:g.ref,className:y?"":h,style:{...v,...y?null:animationSlots(d),"--p-anim-state":g.state},props:{...g.handlers,"data-plass-animation":t??void 0,"data-state":g.state},children:y?animateChildren(f,h,(e,t)=>({...v,...animationSlots(staggerSlots(d,{index:e,count:t,stagger:c,durationStep:u,reverse:m}))})):f}}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The width of each rung, and the queries the library asks about them.
3
+ *
4
+ * The ladder itself is declared **in the stylesheet**, as
5
+ * `--plass-breakpoint-*`, because a page must not have two answers about how
6
+ * wide it is. That file explains the whole arrangement; the short version is
7
+ * that a media query's *condition* cannot read a custom property, so the CSS
8
+ * half resolves Tailwind's `--breakpoint-*` theme at build time through
9
+ * `@variant`, and this — where a breakpoint is a *value* rather than a
10
+ * condition — reads the same answer off the document at runtime.
11
+ *
12
+ * So a project that moves a breakpoint moves one thing:
13
+ *
14
+ * @theme { --breakpoint-md: 50rem; }
15
+ *
16
+ * and both halves follow.
17
+ */
18
+ import type { PlassBreakpointFloor } from '../types.js';
19
+ /**
20
+ * Tailwind's own widths, and what is used when the stylesheet cannot be read.
21
+ *
22
+ * That is not an edge case: it is every server render, and the first client
23
+ * render of a page whose CSS has not arrived. Both want the same answer the
24
+ * shipped stylesheet has baked in, which is this.
25
+ */
26
+ export declare const defaultFloors: Record<PlassBreakpointFloor, string>;
27
+ export declare function breakpointFloors(): Record<PlassBreakpointFloor, string>;
28
+ /** `(width >= …)` — at this rung and above. */
29
+ export declare function fromQuery(rung: PlassBreakpointFloor): string;
30
+ /** `(width < …)` — below this rung. The mirror of `fromQuery`, never both. */
31
+ export declare function belowQuery(rung: PlassBreakpointFloor): string;
@@ -0,0 +1 @@
1
+ "use client";export const defaultFloors={sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem"};let e=null;export function breakpointFloors(){if(e)return e;if("undefined"==typeof document||"undefined"==typeof getComputedStyle)return defaultFloors;const t=getComputedStyle(document.documentElement),read=e=>{const o=t.getPropertyValue(`--plass-breakpoint-${e}`).trim();return""===o?defaultFloors[e]:o};return e={sm:read("sm"),md:read("md"),lg:read("lg"),xl:read("xl")},e}export function fromQuery(e){return`(width >= ${breakpointFloors()[e]})`}export function belowQuery(e){return`(width < ${breakpointFloors()[e]})`}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * What a `PlButton` inherits from the `PlButtonGroup` around it.
2
+ * What a `PlButton` inherits from the `PlButtonGroup` around it, and what a run
3
+ * of keys is made of.
3
4
  *
4
5
  * A context rather than `React.Children.map` with `cloneElement`, and a file of
5
6
  * its own rather than something the group exports, for one reason each.
@@ -13,9 +14,13 @@
13
14
  * Every field is optional, and every one of them means *not specified* rather
14
15
  * than a value: a button falls back to its own default, so a `PlButtonGroup`
15
16
  * with no props of its own changes nothing except the corners.
17
+ *
18
+ * The three class lists at the end are here for the same reason the context is:
19
+ * a `PlToggleGroup` is the same run of keys with a selection on it, and two
20
+ * copies of the join would be two places for the seam to stop lining up.
16
21
  */
17
22
  import * as React from 'react';
18
- import type { PlassColor, PlassDensity, PlassElevation, PlassSize, PlassVariant } from '../types.js';
23
+ import type { PlassColor, PlassDensity, PlassElevation, PlassOrientation, PlassSize, PlassVariant } from '../types.js';
19
24
  export interface PlassButtonGroupContextValue {
20
25
  variant?: PlassVariant;
21
26
  size?: PlassSize;
@@ -25,3 +30,25 @@ export interface PlassButtonGroupContextValue {
25
30
  disabled?: boolean;
26
31
  }
27
32
  export declare const ButtonGroupContext: React.Context<PlassButtonGroupContextValue | null>;
33
+ /**
34
+ * The corners that face a neighbour are squared off, so a run reads as one
35
+ * piece scored into segments rather than as three keys that happen to be
36
+ * touching.
37
+ *
38
+ * Logical properties (`s`/`e`) rather than left/right: under RTL the first key
39
+ * is on the right, and `rounded-l-none` would flatten the wrong side.
40
+ */
41
+ export declare const groupJoinClasses: Record<PlassOrientation, string>;
42
+ /**
43
+ * Only `glass` needs the overlap, because it is the only variant that draws an
44
+ * edge. Two glass keys meeting would otherwise show both of their hairlines and
45
+ * the seam would be twice as heavy as every other edge on the page; pulling the
46
+ * second one back a pixel makes the two share one line.
47
+ *
48
+ * A `solid` run must **not** do this. Its keys have no border to double up, and
49
+ * overlapping would put one gradient over the start of the next — which is
50
+ * exactly the join the squared corners are drawing.
51
+ */
52
+ export declare const groupOverlapClasses: Record<PlassOrientation, string>;
53
+ /** What a run of keys is, before either of the two above. */
54
+ export declare const groupBaseClasses: string;
@@ -1,2 +1,2 @@
1
- import*as t from"react";export const ButtonGroupContext=
2
- /* @__PURE__ */t.createContext(null);
1
+ import*as o from"react";export const ButtonGroupContext=
2
+ /* @__PURE__ */o.createContext(null);export const groupJoinClasses={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"};export const groupOverlapClasses={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"};export const groupBaseClasses=/* @__PURE__ */["inline-flex align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");