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,68 @@
1
+ import * as React from 'react';
2
+ import type { PlassChartCurve, PlassChartDatum, PlassColor, PlassSize } from '../../types.js';
3
+ export interface PlSparklineProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
4
+ /** The values. `null` is a gap, exactly as it is on every other chart. */
5
+ data: readonly PlassChartDatum[];
6
+ /**
7
+ * Which mark. A line for a trend, an area for a quantity, bars for a count of
8
+ * discrete things — the same three sentences the full charts say, at a size
9
+ * where nothing else is being said at all.
10
+ * @default 'line'
11
+ */
12
+ shape?: 'line' | 'area' | 'bar';
13
+ /** How the line gets from one point to the next. @default 'linear' */
14
+ curve?: PlassChartCurve;
15
+ /**
16
+ * How tall the strip is. Sized against the line of text it sits beside rather
17
+ * than against the page — a sparkline is a word in a sentence, not a picture.
18
+ * @default 'md'
19
+ */
20
+ size?: PlassSize;
21
+ /**
22
+ * The mark's colour. A `PlassColor` family, or any CSS colour.
23
+ *
24
+ * Unlike the full charts this one takes it directly: a sparkline has exactly
25
+ * one series and no legend, so there is nothing for a palette to hand out.
26
+ * @default the first chart slot
27
+ */
28
+ color?: PlassColor | (string & {});
29
+ /**
30
+ * Puts a dot on the last point. The one direct label a strip this small has
31
+ * room for, and it says where the series ended up.
32
+ * @default false
33
+ */
34
+ endDot?: boolean;
35
+ /**
36
+ * Draws a rule across the strip at this value — a target, a budget, last
37
+ * year's average. The one piece of context a sparkline can carry.
38
+ */
39
+ baseline?: number;
40
+ /**
41
+ * The bottom of the scale. Left out, the strip fills itself with its own
42
+ * range, which is what makes a sparkline legible at twenty pixels tall — and
43
+ * what makes two of them side by side incomparable. Pass the same `min` and
44
+ * `max` to a row of them and they become a small-multiples chart.
45
+ */
46
+ min?: number;
47
+ /** And the top of it. */
48
+ max?: number;
49
+ /** How wide. Fills its container by default. */
50
+ width?: number | string;
51
+ /** A name for the strip, read out in place of it. */
52
+ label?: string;
53
+ }
54
+ /**
55
+ * A chart with everything taken away except the shape.
56
+ *
57
+ * No axes, no grid, no legend, no tooltip — it is not a small chart, it is a
58
+ * different thing: a word-sized picture that goes inside a sentence, beside a
59
+ * [`PlStat`](../display/stat), or in a table cell, and says which way something
60
+ * has been going. Every number it could label is one the surrounding text
61
+ * already has, which is why it labels none of them.
62
+ *
63
+ * It scales itself to its own range, so the strip is always full. That is what
64
+ * makes it readable this small and it is also the trap: two sparklines side by
65
+ * side are drawn on two different scales unless they are given the same `min`
66
+ * and `max`.
67
+ */
68
+ export declare const PlSparkline: React.ForwardRefExoticComponent<PlSparklineProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as a,jsxs as e,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{areaPath as t,barMaxThickness as n,barPath as i,barRadius as s,extentOf as o,linePath as m,lineWidths as h,markerRadii as u,markGap as c,resolveColor as d,sparklineHeights as p,toValue as f}from"../../internal/chart.js";import{useMeasuredWidth as v}from"../../internal/chart-frame.js";import{useDefaults as x}from"../../internal/defaults.js";import{cx as b,srOnlyClasses as k}from"../../internal/styles.js";export const PlSparkline=/* @__PURE__ */r.forwardRef(function PlSparkline({data:M,shape:g="line",curve:j="linear",size:w,color:$,endDot:N=!1,baseline:W,min:z,max:C,width:L,label:P,className:R,style:S,...B},D){const F=x(),G=w??F.size??"md",I=r.useRef(null),q=v(I),A=r.useId().replace(/:/g,""),E=r.useMemo(()=>M.map(f),[M]),H=p[G],J=h[G],K=u[G],O=o([E],!1),Q=z??(O?Math.min(O.min,W??O.min):0),T=C??(O?Math.max(O.max,W??O.max):1),U=T-Q||1,V="number"==typeof L?L:q,X=d($??"var(--plass-chart-1)"),Y="bar"===g?0:J/2+(N?K:0),Z=Math.max(1,H-2*Y),y=a=>Y+(1-(a-Q)/U)*Z,_=E.length>1?V/(E.length-1):V,aa=E.map((a,e)=>null===a.value?null:{x:e*_,y:y(a.value)}),ea=(()=>{for(let a=E.length-1;a>=0;a--)if(null!==E[a].value)return a;return-1})(),la=V/Math.max(1,E.length),ra=Math.min(n[G]/2,Math.max(1,la-c)),ta=y(Math.min(Math.max(Q,0),T)),barTop=a=>{const e=Math.min(y(a),ta);return Math.abs(y(a)-ta)<1?Math.min(e,H-1):e};return e("div",{ref:D,className:b("relative block",R??void 0),style:{width:L??"100%",height:H,...S},...B,children:[a("div",{ref:I,className:"absolute inset-0",children:V>0&&E.length>0?e("svg",{width:V,height:H,viewBox:`0 0 ${V} ${H}`,role:P?"img":"presentation","aria-label":P,"aria-hidden":!P||void 0,className:"block overflow-visible",children:["area"===g?e(l,{children:[a("defs",{children:e("linearGradient",{id:`${A}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[a("stop",{offset:"0%",stopColor:`color-mix(in oklab, ${X} 32%, transparent)`}),a("stop",{offset:"100%",stopColor:`color-mix(in oklab, ${X} 2%, transparent)`})]})}),a("path",{d:t(aa,H,j),fill:`url(#${A}-fill)`})]}):null,void 0!==W?a("line",{x1:0,x2:V,y1:y(W),y2:y(W),stroke:"var(--plass-chart-baseline)",strokeWidth:1}):null,"bar"===g?E.map((e,l)=>null===e.value?null:a("path",{d:i(l*la+(la-ra)/2,barTop(e.value),ra,Math.max(1,Math.abs(y(e.value)-ta)),s/2,e.value>=0?"up":"down"),fill:e.color??X},l)):a("path",{d:m(aa,j),fill:"none",stroke:X,strokeWidth:J,strokeLinecap:"round",strokeLinejoin:"round"}),N&&ea>=0&&"bar"!==g?a("circle",{cx:aa[ea].x,cy:aa[ea].y,r:K,fill:X,stroke:"var(--plass-chart-gap)",strokeWidth:c}):null]}):null}),P?a("span",{className:k,children:E.map(a=>null===a.value?"—":a.value).join(", ")}):null]})});
@@ -0,0 +1,2 @@
1
+ export { PlSparkline } from './PlSparkline.js';
2
+ export type { PlSparklineProps } from './PlSparkline.js';
@@ -0,0 +1 @@
1
+ export{PlSparkline}from"./PlSparkline.js";
@@ -32,7 +32,9 @@ export interface PlSpoilerProps extends Omit<React.ComponentPropsWithoutRef<'div
32
32
  reversible?: boolean;
33
33
  /**
34
34
  * Clamps the covered box to this height — a CSS length, or a number in pixels.
35
- * Revealing releases it and the content takes whatever height it needs.
35
+ * Revealing releases it and the content takes whatever height it needs, which
36
+ * makes this the one thing that changes the sheet's height between the two
37
+ * states.
36
38
  *
37
39
  * Left out, the box is exactly as tall as what it holds, which is the right
38
40
  * default for a paragraph or a picture. Set it for something long enough that
@@ -80,5 +82,18 @@ export interface PlSpoilerProps extends Omit<React.ComponentPropsWithoutRef<'div
80
82
  * The sheet is never dyed, exactly as on a `PlCard`: what a spoiler holds is a
81
83
  * photograph, a paragraph, a plot twist, and it arrives with its own colours.
82
84
  * The family shows up on the button and in the hairline and stops there.
85
+ *
86
+ * **The box is the same height covered and uncovered**, which takes every one of
87
+ * the things that could move it. The cover shares a grid cell with what it
88
+ * covers rather than being positioned over it, so a cover taller than a one-line
89
+ * spoiler makes the sheet taller instead of being clipped by it; and neither the
90
+ * cover nor the `reversible` Hide row is ever taken out of the tree — both are
91
+ * drawn from the start and merely held `invisible`, so their space is paid for
92
+ * once instead of arriving on the way in and leaving again on the way out.
93
+ *
94
+ * `maxHeight` is the one exception, and it is deliberate: a clamp is released on
95
+ * reveal, so a spoiler that was holding back four screens of text grows to fit
96
+ * them. Keeping the clamp would leave the reader a scrollbar where they asked
97
+ * for the content.
83
98
  */
84
99
  export declare const PlSpoiler: React.ForwardRefExoticComponent<PlSpoilerProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as r from"react";import{useDefaults as a}from"../../internal/defaults.js";import{PlButton as l}from"../button/PlButton.js";import{cx as s,hasContent as t,metaTextClasses as n,radiusClasses as o,sheetPaddingXClasses as d,sheetPaddingYClasses as c,sheetRestClasses as m,surfaceSlots as u,transitionClasses as f}from"../../internal/styles.js";export const PlSpoiler=/* @__PURE__ */r.forwardRef(function PlSpoiler({revealed:p,defaultRevealed:v=!1,onRevealedChange:h,label:x="Reveal",hideLabel:y="Hide",description:g="This may contain spoilers",action:b,reversible:j=!1,maxHeight:N,blur:w=10,padded:z=!0,variant:k="glass",size:R,color:_,density:C,elevation:H=0,className:P,style:S,children:$,...B},I){const L=a(),T=R??L.size??"md",q=_??L.color??"primary",A=C??L.density??"default",D=r.useId(),[E,F]=r.useState(v),G=p??E,change=e=>{void 0===p&&F(e),h?.(e)},J=d[A][T],K=c[A][T],M=!1===g?null:g;return i("div",{ref:I,className:s("isolate grid overflow-hidden",o[T],m[k],f,P),style:{...u(q,H),...S},...B,children:[e("div",{id:D,className:s("min-w-0 [grid-area:1/1]",z?`${J} ${K}`:"","[transition:filter_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",G?"":"select-none"),style:{filter:G?void 0:`blur(${w}px)`,maxHeight:G?void 0:N,overflow:G?void 0:"hidden"},inert:!G,children:$}),G?null:i("div",{className:s("z-10 flex flex-col items-center justify-center gap-2 text-center [grid-area:1/1]",J,K,"[background-color:color-mix(in_oklab,var(--plass-surface)_55%,transparent)]"),children:[t(M)?e("p",{className:s("m-0 text-(--plass-muted-fg)",n[T]),children:M}):null,b??e(l,{size:T,color:q,density:A,onClick:()=>change(!0),"aria-expanded":!1,"aria-controls":D,children:x})]}),G&&j?e("div",{className:s("flex justify-end",J,K,"pt-0"),children:e(l,{variant:"ghost",size:T,color:q,density:A,onClick:()=>change(!1),"aria-expanded":!0,"aria-controls":D,children:y})}):null]})});
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{inertProps as t}from"../../internal/inert.js";import{focusablesIn as s}from"../../internal/focusable.js";import{PlButton as a}from"../button/PlButton.js";import{cx as o,hasContent as c,metaTextClasses as d,radiusClasses as u,sheetPaddingXClasses as f,sheetPaddingYClasses as m,sheetRestClasses as p,surfaceSlots as v,transitionClasses as x}from"../../internal/styles.js";export const PlSpoiler=/* @__PURE__ */i.forwardRef(function PlSpoiler({revealed:h,defaultRevealed:b=!1,onRevealedChange:g,label:y,hideLabel:j,description:N,action:R,reversible:w=!1,maxHeight:z,blur:k=10,padded:S=!0,variant:_="glass",size:C,color:P,density:$,elevation:E=0,className:H,style:I,children:L,...B},W){const q=n(),A=l(),D=y??A.reveal,F=j??A.hide,G=void 0===N?A.spoilerWarning:N,J=C??q.size??"md",K=P??q.color??"primary",M=$??q.density??"default",O=i.useId(),Q=i.useRef(null),T=i.useRef(null),U=i.useRef(null),[V,X]=i.useState(b),Y=h??V,change=e=>{void 0===h&&X(e),g?.(e)},Z=i.useRef(Y);i.useLayoutEffect(()=>{if(Z.current===Y)return;Z.current=Y;const e=document.activeElement,r=Y?[T.current]:[U.current,Q.current];if(!e||!r.some(r=>r?.contains(e)))return;const i=Y?Q.current:s(T.current)[0];i?.focus({preventScroll:!0})},[Y]);const ee=f[M][J],re=m[M][J],ie=!1===G?null:G;return r("div",{ref:W,className:o("isolate grid overflow-hidden",u[J],p[_],x,H),style:{...v(K,E),...I},...B,children:[r("div",{className:"flex min-w-0 flex-col [grid-area:1/1]",children:[e("div",{ref:Q,id:O,tabIndex:-1,className:o("min-w-0 outline-none",S?`${ee} ${re}`:"","[transition:filter_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",Y?"":"select-none"),style:{filter:Y?void 0:`blur(${k}px)`,maxHeight:Y?void 0:z,overflow:Y?void 0:"hidden"},...t(!Y),children:L}),w?e("div",{ref:U,className:o("flex justify-end",ee,re,"pt-0",Y?"":"invisible"),...t(!Y),children:e(a,{variant:"ghost",size:J,color:K,density:M,onClick:()=>change(!1),"aria-expanded":!0,"aria-controls":O,children:F})}):null]}),r("div",{ref:T,className:o("z-10 flex flex-col items-center justify-center gap-2 text-center [grid-area:1/1]",ee,re,"[background-color:color-mix(in_oklab,var(--plass-surface)_55%,transparent)]",Y?"invisible":""),...t(Y),children:[c(ie)?e("p",{className:o("m-0 text-(--plass-muted-fg)",d[J]),children:ie}):null,R??e(a,{size:J,color:K,density:M,onClick:()=>change(!0),"aria-expanded":!1,"aria-controls":O,children:D})]})]})});
@@ -0,0 +1,114 @@
1
+ import * as React from 'react';
2
+ import type { PlassResponsive, PlassSize } from '../../types.js';
3
+ /** Which way the pile grows. */
4
+ export type PlStackDirection = 'horizontal' | 'vertical' | 'diagonal';
5
+ /** Which end of the list is on top. */
6
+ export type PlStackFront = 'first' | 'last';
7
+ export interface PlStackProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
8
+ /**
9
+ * Which way the pile grows.
10
+ *
11
+ * `diagonal` is a **fan** rather than a true 45°, and it cannot be anything
12
+ * else: the horizontal advance is `item width − overlap`, and a component that
13
+ * takes arbitrary children does not know how wide they are. `drop` is the
14
+ * vertical step, stated separately, and the two are independent on purpose.
15
+ * @default 'horizontal'
16
+ */
17
+ direction?: PlassResponsive<PlStackDirection>;
18
+ /**
19
+ * How far each item sits under the one before it, along the axis the pile
20
+ * flows on — a number of pixels or any CSS length.
21
+ *
22
+ * Left out it is a fraction of `size`, which keeps the overlap looking the
23
+ * same at every step.
24
+ */
25
+ overlap?: number | string;
26
+ /**
27
+ * The step on the *other* axis, for `direction="diagonal"` only. Defaults to
28
+ * whatever `overlap` resolved to, which is a 45° fan for square items and a
29
+ * shallower one for anything wider than it is tall.
30
+ */
31
+ drop?: number | string;
32
+ /**
33
+ * Which rung of the ladder the default `overlap` comes off.
34
+ *
35
+ * It decides **nothing else**. A stack draws no surface of its own and has no
36
+ * type in it, so there is no height to set and no ink to colour — the items
37
+ * are whatever they already were.
38
+ * @default 'md'
39
+ */
40
+ size?: PlassSize;
41
+ /** How many items are drawn. Left out, every one of them is. */
42
+ max?: number;
43
+ /**
44
+ * How many there are altogether, when the stack was handed only the first few.
45
+ * Without it the count is worked out from the children, which is right only
46
+ * when all of them were passed.
47
+ */
48
+ total?: number;
49
+ /**
50
+ * Draws a last item standing for the ones that did not fit, given how many
51
+ * that is: `(n) => <PlAvatar initials={`+${n}`} />`.
52
+ *
53
+ * A function rather than a node, because the number **is** the item — a node
54
+ * would have to be given a count it has no way to work out, and would then be
55
+ * wrong every time the list changed.
56
+ */
57
+ overflow?: (hidden: number) => React.ReactNode;
58
+ /**
59
+ * Which end of the list is on top.
60
+ *
61
+ * `last` is what the DOM does on its own and what a row of faces wants — the
62
+ * newest arrival in front. `first` is what a deck of cards is: the top card is
63
+ * the one you read first.
64
+ * @default 'last'
65
+ */
66
+ front?: PlStackFront;
67
+ /**
68
+ * What each item further back is multiplied by, compounding. `0.94` takes four
69
+ * steps down to about 78%.
70
+ *
71
+ * On the standalone `scale` property rather than inside a `transform`, so a
72
+ * caller's own transform on the same item survives.
73
+ * @default 1
74
+ */
75
+ scaleStep?: number;
76
+ /** The same, for opacity. @default 1 */
77
+ opacityStep?: number;
78
+ /**
79
+ * Draws a hairline of the page's own surface colour around each item, which
80
+ * is the *hole* the near item is cut out of rather than an edge on it.
81
+ *
82
+ * Two shapes of similar tone laid over each other have no boundary between
83
+ * them at all and the pile reads as one smeared shape. A translucent line
84
+ * would not help, because what is behind it is the other item.
85
+ *
86
+ * It lands on **the element you passed**, so it takes that element's shape.
87
+ * Wrap an avatar in something square and the ring is square; there is no way
88
+ * for a component that accepts arbitrary children to know better.
89
+ * @default false
90
+ */
91
+ ring?: boolean;
92
+ /** The things in the pile. */
93
+ children?: React.ReactNode;
94
+ }
95
+ /**
96
+ * Things piled up, overlapping.
97
+ *
98
+ * A row of faces is one arrangement of this and not a component of its own: a
99
+ * deck of cards, a pile of documents, a fan of thumbnails and a stack of avatars
100
+ * differ in what is in them, not in how they are laid out. So this takes
101
+ * whatever it is given and never looks inside.
102
+ *
103
+ * Which is also what it gives up. It cannot set an axis on its items the way a
104
+ * `PlAvatarGroup` used to, because it does not know what they are — put a
105
+ * `PlassProvider` around it for `size` and `color`, and write anything narrower
106
+ * on the items themselves.
107
+ *
108
+ * Two boxes are drawn per item rather than one, and the second is not spare. The
109
+ * outer one carries the offset and the stacking order; the inner one carries the
110
+ * depth, on the standalone `scale` and `opacity` properties. Kept on one box,
111
+ * an entrance animation that writes `scale` — every keyframe in this library
112
+ * that grows or zooms does — would overwrite the depth on its first frame.
113
+ */
114
+ export declare const PlStack: React.ForwardRefExoticComponent<PlStackProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{cx as e,toLength as a}from"../../internal/styles.js";import{useResponsiveValue as i}from"../../internal/responsive.js";const n={xs:"0.5rem",sm:"0.625rem",md:"0.875rem",lg:"1rem",xl:"1.25rem"},s={horizontal:/* @__PURE__ */["flex-row","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--p-overlap)*-1)]"].join(" "),vertical:/* @__PURE__ */["flex-col","[&>*:not(:first-child)]:[margin-block-start:calc(var(--p-overlap)*-1)]"].join(" "),diagonal:/* @__PURE__ */["flex-row","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--p-overlap)*-1)]"].join(" ")};export const PlStack=/* @__PURE__ */l.forwardRef(function PlStack({direction:o,overlap:c,drop:m,size:p,max:f,total:d,overflow:h,front:g="last",scaleStep:v=1,opacityStep:x=1,ring:u=!1,className:j,style:y,children:S,...k},z){const w=i(o,"horizontal"),N=t(),M=p??N.size??"md",P=void 0===c?n[M]:a(c),$=void 0===m?P:a(m),b=l.Children.toArray(S),A=void 0===f?b:b.slice(0,Math.max(0,f)),B=d??b.length,C=Math.max(0,B-A.length),I=h&&C>0?[...A,h(C)]:[...A];return r("div",{ref:z,className:e("isolate inline-flex items-start",s[w],u?"[&>*>*>*]:ring-2 [&>*>*>*]:ring-(--plass-surface)":"",j),style:{"--p-overlap":P,...y},...k,children:I.map((l,t)=>{const e="first"===g?t:I.length-1-t;return r("span",{className:"flex shrink-0",style:{zIndex:"first"===g?I.length-t:t+1,..."diagonal"===w&&t>0?{marginBlockStart:`calc(${$} * ${t})`}:null},children:r("span",{className:"flex",style:{...1===v?null:{scale:String(v**e)},...1===x?null:{opacity:x**e}},children:l})},t)})})});
@@ -0,0 +1,2 @@
1
+ export { PlStack } from './PlStack.js';
2
+ export type { PlStackDirection, PlStackFront, PlStackProps } from './PlStack.js';
@@ -0,0 +1 @@
1
+ export{PlStack}from"./PlStack.js";
@@ -21,6 +21,10 @@ export interface PlStatProps extends Omit<React.ComponentPropsWithoutRef<'div'>,
21
21
  /**
22
22
  * How much it moved, as a percentage. Drawn with an arrow, and coloured by
23
23
  * whether that is good news rather than by its sign.
24
+ *
25
+ * Written to one decimal at most, with a sign on a rise: `+12.4%`, `-3%`. A
26
+ * change that rounds to 0 at that decimal is `0%`, with no arrow and in the
27
+ * muted colour.
24
28
  */
25
29
  change?: number;
26
30
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as s from"react";import{PlSkeleton as l}from"../skeleton/PlSkeleton.js";import{useDefaults as a}from"../../internal/defaults.js";import{controlSlots as n,cx as r,hasContent as i,metaTextClasses as c,stackGapClasses as o}from"../../internal/styles.js";const m={xs:"text-xl",sm:"text-2xl",md:"text-3xl",lg:"text-4xl",xl:"text-5xl"};function Arrow({up:t}){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[1em]",children:e("path",{d:t?"M8 12V4m0 0L4.5 7.5M8 4l3.5 3.5":"M8 4v8m0 0 3.5-3.5M8 12l-3.5-3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStat=/* @__PURE__ */s.forwardRef(function PlStat({label:s,value:d,description:u,icon:p,change:x,changeLabel:f,improvesWhen:h="up",loading:g=!1,size:v,color:N,density:j,className:b,style:k,children:y,...w},z){const L=a(),M=v??L.size??"md",P=N??L.color??"primary",S=j??L.density??"default",A=void 0!==x&&0!==x,W=(x??0)>0,$=A&&("up"===h?W:!W),B=void 0!==x||i(f);return t("div",{ref:z,className:r("flex flex-col","compact"===S?"gap-0.5":o[M],b),style:{...n(P,0,"ghost"),...k},...w,children:[i(s)||i(p)?t("div",{className:r("flex items-center gap-1.5 text-(--plass-muted-fg)",c[M]),children:[i(p)?e("span",{"aria-hidden":"true",className:"flex items-center text-(--p-accent) [&_svg]:size-[1.15em]",children:p}):null,s]}):null,t("div",{className:"flex items-baseline gap-2",children:[g?e(l,{shape:"line",size:M,color:P,width:"6ch"}):e("span",{className:r("font-semibold text-(--plass-fg) tabular-nums",m[M]),children:d}),B&&!g?t("span",{className:r("flex items-center gap-0.5 font-medium tabular-nums",c[M],A?$?"text-(--plass-success-accent)":"text-(--plass-danger-accent)":"text-(--plass-muted-fg)"),children:[A?e(Arrow,{up:W}):null,f??`${W?"+":""}${x}%`]}):null]}),i(u)?e("div",{className:r("text-(--plass-muted-fg)",c[M]),children:u}):null,y]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as s from"react";import{PlSkeleton as n}from"../skeleton/PlSkeleton.js";import{useDefaults as l}from"../../internal/defaults.js";import{controlSlots as a,cx as r,hasContent as i,metaTextClasses as o,stackGapClasses as c}from"../../internal/styles.js";const d={xs:"text-xl",sm:"text-2xl",md:"text-3xl",lg:"text-4xl",xl:"text-5xl"};function formatChange(e){const t=Number.isInteger(e)?e.toFixed(0):e.toFixed(1);return`${e>0?"+":""}${t}%`}function Arrow({up:t}){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[1em]",children:e("path",{d:t?"M8 12V4m0 0L4.5 7.5M8 4l3.5 3.5":"M8 4v8m0 0 3.5-3.5M8 12l-3.5-3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStat=/* @__PURE__ */s.forwardRef(function PlStat({label:s,value:m,description:u,icon:x,change:p,changeLabel:f,improvesWhen:h="up",loading:g=!1,size:v,color:N,density:b,className:j,style:M,children:k,...y},w){const z=l(),C=v??z.size??"md",L=N??z.color??"primary",P=b??z.density??"default",S=void 0===p?void 0:function roundChange(e){const t=Math.sign(e)*Math.round(10*Math.abs(e))/10;return 0===t?0:t}(p),A=void 0!==S&&0!==S,F=(S??0)>0,W=A&&("up"===h?F:!F),$=void 0!==p||i(f);return t("div",{ref:w,className:r("flex flex-col","compact"===P?"gap-0.5":c[C],j),style:{...a(L,0,"ghost"),...M},...y,children:[i(s)||i(x)?t("div",{className:r("flex items-center gap-1.5 text-(--plass-muted-fg)",o[C]),children:[i(x)?e("span",{"aria-hidden":"true",className:"flex items-center text-(--p-accent) [&_svg]:size-[1.15em]",children:x}):null,s]}):null,t("div",{className:"flex items-baseline gap-2",children:[g?e(n,{shape:"line",size:C,color:L,width:"6ch"}):e("span",{className:r("font-semibold text-(--plass-fg) tabular-nums",d[C]),children:m}),$&&!g?t("span",{className:r("flex items-center gap-0.5 font-medium tabular-nums",o[C],A?W?"text-(--plass-success-accent)":"text-(--plass-danger-accent)":"text-(--plass-muted-fg)"),children:[A?e(Arrow,{up:F}):null,f??formatChange(S??0)]}):null]}),i(u)?e("div",{className:r("text-(--plass-muted-fg)",o[C]),children:u}):null,k]})});
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { type PlassStepConnector, type PlassStepStatus } from '../../internal/steps.js';
3
- import type { PlassColor, PlassDensity, PlassOrientation, PlassSize } from '../../types.js';
3
+ import type { PlassColor, PlassDensity, PlassOrientation, PlassResponsive, PlassSize } from '../../types.js';
4
4
  /** The same three a `PlTimeline` draws, and the same marks. */
5
5
  export type PlStepStatus = PlassStepStatus;
6
6
  /** How the line between two steps is drawn. `none` leaves the gap open. */
@@ -22,7 +22,7 @@ export interface PlStepperProps extends Omit<React.ComponentPropsWithoutRef<'div
22
22
  */
23
23
  linear?: boolean;
24
24
  /** @default 'horizontal' */
25
- orientation?: PlassOrientation;
25
+ orientation?: PlassResponsive<PlassOrientation>;
26
26
  /** How the line between two steps is drawn. @default 'solid' */
27
27
  connector?: PlStepConnector;
28
28
  /** @default 'md' */
@@ -57,7 +57,7 @@ export interface PlStepProps extends Omit<React.ComponentPropsWithoutRef<'li'>,
57
57
  disabled?: boolean;
58
58
  /** Overrides the stepper's family for this one step. */
59
59
  color?: PlassColor;
60
- /** The panel this step shows while it is the current one. */
60
+ /** The panel this step shows while the stepper's `active` is on it, whatever `status` says. */
61
61
  children?: React.ReactNode;
62
62
  }
63
63
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{bulletGapClasses as n,bulletSizeValues as s,bulletStatusClasses as a,connectorColorClasses as i,connectorStyleClasses as o,statusAt as c,titleStatusClasses as d}from"../../internal/steps.js";import{cx as u,focusRingClasses as m,hasContent as p,iconClasses as f,metaTextClasses as x,radiusClasses as h,sheetBodyClasses as v,sheetTitleClasses as b,surfaceSlots as N,transitionClasses as w}from"../../internal/styles.js";const y=/* @__PURE__ */t.createContext(null),z=/* @__PURE__ */t.createContext({index:0,last:!1});function StepTick(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[0.7em]",children:e("path",{d:"m3.5 8.5 3 3 6-7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStepper=/* @__PURE__ */t.forwardRef(function PlStepper({active:n,defaultActive:s=0,onActiveChange:a,linear:i=!0,orientation:o="horizontal",connector:c="solid",size:d,color:m,density:f,className:x,style:h,children:b,...w},k){const C=r(),S=d??C.size??"md",g=m??C.color??"primary",j=f??C.density??"default",[P,$]=t.useState(s),A=n??P,I=t.useId(),L=t.useCallback(e=>{void 0===n&&$(e),a?.(e)},[n,a]),R=t.Children.toArray(b),T=R.length,B=t.useMemo(()=>({size:S,density:j,orientation:o,color:g,active:A,linear:i,connector:c,baseId:I,onSelect:L}),[S,j,o,g,A,i,c,I,L]),M="horizontal"===o,O=M?R[A]?.props?.children:null;return e(y.Provider,{value:B,children:l("div",{ref:k,className:u("flex w-full flex-col",x),style:{...N(g,0),...h},...w,children:[e("ol",{role:"list",className:u("flex w-full",M?"flex-row":"flex-col"),children:R.map((l,t)=>e(z.Provider,{value:{index:t,last:t===T-1},children:l},t))}),p(O)?e("div",{"aria-labelledby":`${I}-${A}`,className:u("mt-4",v[S]),children:O}):null]})})});export const PlStep=/* @__PURE__ */t.forwardRef(function PlStep({label:r,description:k,bullet:C,status:S,optional:g,disabled:j=!1,color:P,className:$,children:A,...I},L){const R=t.useContext(y),{index:T,last:B}=t.useContext(z),M=R?.size??"md",O=R?.orientation??"horizontal",W=P??R?.color??"primary",q=R?.active??null,D=R?.connector??"solid",E=S??c(T,q),F="horizontal"===O,G=!j&&null!==R&&(!R.linear||T<=R.active),H="none"!==D&&!B,J=e("span",{"aria-hidden":"true",className:u("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",a[E],w,f),children:C??("complete"===E?e(StepTick,{}):T+1)}),K=l("span",{className:u("flex min-w-0 flex-col",F?"items-center text-center":""),children:[e("span",{id:R?`${R.baseId}-${T}`:void 0,className:u("font-semibold",b[M],d[E]),children:r}),p(k)?e("span",{className:u("text-(--plass-muted-fg)",x[M]),children:k}):null,g?e("span",{className:u("text-(--plass-muted-fg) italic",x[M]),children:!0===g?"Optional":g}):null]}),Q=l("span",{className:u("flex items-center",F?"flex-col":"flex-row",n[M]),children:[J,F?K:null]}),U=G?l("button",{type:"button","aria-current":"current"===E?"step":void 0,onClick:()=>R?.onSelect(T),className:u("flex cursor-pointer items-center bg-transparent p-1",F?"flex-col":"flex-row",n[M],h[M],m,w,"hover:bg-(--p-soft)"),children:[F?Q:J,F?null:K]}):l("span",{"aria-current":"current"===E?"step":void 0,className:u("flex items-center p-1",F?"flex-col":"flex-row",n[M],j?"opacity-50":""),children:[F?Q:J,F?null:K]});return l("li",{ref:L,className:u("relative flex min-w-0",F?"flex-1 flex-col items-center":"flex-col",$),style:{"--p-bullet":s[M],...N(W,0),"--p-fill":`var(--plass-${W}-fill)`,"--p-on-solid":`var(--plass-${W}-on-solid)`},...I,children:[l("span",{className:u("flex w-full",F?"flex-row items-start":"flex-col"),children:[U,H?e("span",{"aria-hidden":"true",className:u(F?"mt-[calc(var(--p-bullet)/2+0.25rem)] h-0 flex-1 border-t":"ms-[calc(var(--p-bullet)/2+0.25rem)] w-0 flex-1 self-stretch border-s",o[D],i[E],w)}):null]}),!F&&"current"===E&&p(A)?e("div",{className:u("ms-[calc(var(--p-bullet)+0.75rem)] pt-2 pb-4",v[M]),children:A}):null]})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{bulletGapClasses as n,bulletSizeValues as s,bulletStatusClasses as a,connectorColorClasses as i,connectorStyleClasses as o,statusAt as c,titleStatusClasses as d}from"../../internal/steps.js";import{cx as m,focusRingClasses as p,hasContent as u,iconClasses as f,metaTextClasses as x,radiusClasses as h,sheetBodyClasses as v,sheetTitleClasses as b,surfaceSlots as N,transitionClasses as w}from"../../internal/styles.js";import{useLabels as y}from"../../internal/labels.js";import{useResponsiveValue as z}from"../../internal/responsive.js";const j=/* @__PURE__ */t.createContext(null),g=/* @__PURE__ */t.createContext({index:0,last:!1});function StepTick(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[0.7em]",children:e("path",{d:"m3.5 8.5 3 3 6-7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStepper=/* @__PURE__ */t.forwardRef(function PlStepper({active:n,defaultActive:s=0,onActiveChange:a,linear:i=!0,orientation:o,connector:c="solid",size:d,color:p,density:f,className:x,style:h,children:b,...w},y){const k=z(o,"horizontal"),C=r(),S=d??C.size??"md",P=p??C.color??"primary",$=f??C.density??"default",[A,I]=t.useState(s),L=n??A,R=t.useId(),T=t.useCallback(e=>{void 0===n&&I(e),a?.(e)},[n,a]),B=t.Children.toArray(b),M=B.length,W=t.useMemo(()=>({size:S,density:$,orientation:k,color:P,active:L,linear:i,connector:c,baseId:R,onSelect:T}),[S,$,k,P,L,i,c,R,T]),q="horizontal"===k,D=q?B[L]?.props?.children:null;return e(j.Provider,{value:W,children:l("div",{ref:y,className:m("flex w-full flex-col",x),style:{...N(P,0),...h},...w,children:[e("ol",{role:"list",className:m("flex w-full",q?"flex-row":"flex-col"),children:B.map((l,t)=>e(g.Provider,{value:{index:t,last:t===M-1},children:l},t))}),u(D)?e("div",{role:"group","aria-labelledby":`${R}-${L}`,className:m("mt-4",v[S]),children:D}):null]})})});export const PlStep=/* @__PURE__ */t.forwardRef(function PlStep({label:r,description:z,bullet:k,status:C,optional:S,disabled:P=!1,color:$,className:A,children:I,...L},R){const T=t.useContext(j),{index:B,last:M}=t.useContext(g),W=y(),q=T?.size??"md",D=T?.orientation??"horizontal",E=$??T?.color??"primary",F=T?.active??null,G=T?.connector??"solid",H=C??c(B,F),J="horizontal"===D,K=!P&&null!==T&&(!T.linear||B<=T.active),O="none"!==G&&!M,Q=e("span",{"aria-hidden":"true",className:m("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",a[H],w,f),children:k??("complete"===H?e(StepTick,{}):B+1)}),U=l("span",{className:m("flex min-w-0 flex-col",J?"items-center text-center":""),children:[e("span",{id:T?`${T.baseId}-${B}`:void 0,className:m("font-semibold",b[q],d[H]),children:r}),u(z)?e("span",{className:m("text-(--plass-muted-fg)",x[q]),children:z}):null,S?e("span",{className:m("text-(--plass-muted-fg) italic",x[q]),children:!0===S?W.optional:S}):null]}),V=l("span",{className:m("flex items-center",J?"flex-col":"flex-row",n[q]),children:[Q,J?U:null]}),X=K?l("button",{type:"button","aria-current":"current"===H?"step":void 0,onClick:()=>T?.onSelect(B),className:m("flex cursor-pointer items-center bg-transparent p-1",J?"flex-col":"flex-row",n[q],h[q],p,w,"hover:bg-(--p-soft)"),children:[J?V:Q,J?null:U]}):l("span",{"aria-current":"current"===H?"step":void 0,className:m("flex items-center p-1",J?"flex-col":"flex-row",n[q],P?"opacity-50":""),children:[J?V:Q,J?null:U]});return l("li",{ref:R,className:m("relative flex min-w-0",J?"flex-1 flex-col items-center":"flex-col",A),style:{"--p-bullet":s[q],...N(E,0),"--p-fill":`var(--plass-${E}-fill)`,"--p-on-solid":`var(--plass-${E}-on-solid)`},...L,children:[l("span",{className:m("flex w-full",J?"flex-row items-start":"flex-col"),children:[X,O?e("span",{"aria-hidden":"true",className:m(J?"mt-[calc(var(--p-bullet)/2+0.25rem)] h-0 flex-1 border-t":"ms-[calc(var(--p-bullet)/2+0.25rem)] w-0 flex-1 self-stretch border-s",o[G],i[H],w)}):null]}),!J&&B===F&&u(I)?e("div",{className:m("ms-[calc(var(--p-bullet)+0.75rem)] pt-2 pb-4",v[q]),children:I}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as e,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Switch as l}from"@base-ui/react/switch";import{Field as i}from"@base-ui/react/field";import{controlSlots as c,cx as n,focusRingClasses as o,hasContent as d,metaTextClasses as h,tickRowTextClasses as m}from"../../internal/styles.js";const p={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},u={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},f=/* @__PURE__ */["relative inline-flex shrink-0 rounded-full","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition-property:background-color,background-image,box-shadow,filter]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]",o].join(" "),g=/* @__PURE__ */["cursor-pointer bg-(--plass-track)","hover:brightness-[0.97] dark:hover:brightness-110","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:[box-shadow:var(--p-lift)] data-[checked]:hover:brightness-105"].join(" "),b=/* @__PURE__ */["cursor-default bg-(--plass-track) saturate-[0.55]","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:shadow-none"].join(" "),x=/* @__PURE__ */["cursor-not-allowed bg-(--plass-track)","opacity-50 saturate-[0.35] shadow-none","data-[checked]:[background-image:var(--p-fill)]"].join(" "),k=/* @__PURE__ */["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-white","[box-shadow:0_1px_2px_rgb(20_40_90/0.25)]","[transition:inset-inline-start_var(--plass-duration)_var(--plass-ease)]"].join(" ");export const PlSwitch=/* @__PURE__ */t.forwardRef(function PlSwitch({size:t,color:o,label:w,description:v,error:j,invalid:N,labelPlacement:y="end",disabled:_=!1,readOnly:P=!1,className:R,classNames:S,style:$,...z},B){const O=s(),q=t??O.size??"md",D=o??O.color??"primary",E=d(j),F=N??E,L=F?"danger":D,T=a("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(l.Root,{ref:B,className:n(f,p[q],_?x:P?b:g,S?.control),disabled:_,readOnly:P,...z,children:a(l.Thumb,{className:`${k} ${u[q]}`})})}),A=w||v?e("span",{className:["flex min-w-0 flex-col gap-0.5","start"===y?"flex-1":""].filter(Boolean).join(" "),children:[w?a(i.Label,{className:n(_?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",S?.label),children:w}):null,v?a(i.Description,{className:n(h[q],"text-(--plass-muted-fg)",S?.description),children:v}):null]}):null;return e(i.Root,{disabled:_,invalid:F,className:["inline-flex flex-col gap-1 align-top",R??""].filter(Boolean).join(" "),style:{...c(L,0,"solid"),...$},children:[a("div",{className:`flex items-start gap-2.5 ${m[q]}`,children:e(r,"start"===y?{children:[A,T]}:{children:[T,A]})}),a(i.Error,E?{match:!0,className:n(h[q],"text-(--p-accent)",S?.error),children:j}:{className:n(h[q],"text-(--p-accent)",S?.error)})]})});
1
+ "use client";import{jsx as a,jsxs as e,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{useDefaults as o}from"../../internal/defaults.js";import{Switch as s}from"@base-ui/react/switch";import{Field as l}from"@base-ui/react/field";import{controlSlots as c,cx as i,focusRingClasses as n,hasContent as d,metaTextClasses as h,tickRowTextClasses as m}from"../../internal/styles.js";const p={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},f={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},u=/* @__PURE__ */["relative inline-flex shrink-0 rounded-full","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition-property:background-color,background-image,box-shadow,filter]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]",n].join(" "),g=/* @__PURE__ */["forced-colors:border forced-colors:[border-color:CanvasText]","forced-colors:data-[checked]:[background-color:Highlight]"].join(" "),b=/* @__PURE__ */[g,"cursor-pointer bg-(--plass-track)","hover:brightness-[0.97] dark:hover:brightness-110","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:[box-shadow:var(--p-lift)] data-[checked]:hover:brightness-105"].join(" "),x=/* @__PURE__ */[g,"cursor-default bg-(--plass-track) saturate-[0.55]","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:shadow-none"].join(" "),k=/* @__PURE__ */["forced-colors:border forced-colors:[border-color:GrayText]","cursor-not-allowed bg-(--plass-track)","opacity-50 saturate-[0.35] shadow-none","data-[checked]:[background-image:var(--p-fill)]"].join(" "),w=/* @__PURE__ */["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-white","[box-shadow:0_1px_2px_rgb(20_40_90/0.25)]","forced-colors:[background-color:CanvasText] forced-colors:data-[checked]:[background-color:HighlightText]","[transition:inset-inline-start_var(--plass-duration)_var(--plass-ease)]"].join(" ");export const PlSwitch=/* @__PURE__ */t.forwardRef(function PlSwitch({size:t,color:n,label:g,description:v,error:j,invalid:N,labelPlacement:y="end",disabled:_=!1,readOnly:T=!1,className:P,classNames:R,style:S,...$},z){const B=o(),C=t??B.size??"md",H=n??B.color??"primary",O=d(j),q=N??O,D=q?"danger":H,E=a("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(s.Root,{ref:z,className:i(u,p[C],_?k:T?x:b,R?.control),disabled:_,readOnly:T,...$,children:a(s.Thumb,{className:`${w} ${f[C]}`})})}),F=g||v?e("span",{className:["flex min-w-0 flex-col gap-0.5","start"===y?"flex-1":""].filter(Boolean).join(" "),children:[g?a(l.Label,{className:i(_?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",R?.label),children:g}):null,v?a(l.Description,{className:i(h[C],"text-(--plass-muted-fg)",R?.description),children:v}):null]}):null;return e(l.Root,{disabled:_,invalid:q,className:["inline-flex flex-col gap-1 align-top",P??""].filter(Boolean).join(" "),style:{...c(D,0,"solid"),...S},children:[a("div",{className:`flex items-start gap-2.5 ${m[C]}`,children:e(r,"start"===y?{children:[F,E]}:{children:[E,F]})}),a(l.Error,O?{match:!0,className:i(h[C],"text-(--p-accent)",R?.error),children:j}:{className:i(h[C],"text-(--p-accent)",R?.error)})]})});
@@ -71,11 +71,11 @@ export interface PlTableProps<Row> extends PlassStyleProps, Omit<React.Component
71
71
  /**
72
72
  * Pins the header while the rows scroll under it.
73
73
  *
74
- * It needs something to scroll *in*: a `position: sticky` header in a box
75
- * that is as tall as its content has nowhere to stick, so this does nothing
76
- * on its own. `maxHeight` is the usual answer and the two are made for each
77
- * other; a table inside a pane that already caps its own height works just as
78
- * well.
74
+ * It needs `maxHeight`. A `position: sticky` header sticks to the nearest box
75
+ * that scrolls, and here that is the table's own horizontal scroller, which
76
+ * without a cap is as tall as its content and has nowhere to stick. A pane
77
+ * around the table that scrolls or caps its own height does not change that,
78
+ * so this does nothing on its own.
79
79
  * @default false
80
80
  */
81
81
  stickyHeader?: boolean;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{controlTextLeadingClasses as a,focusRingInsetClasses as t,metaTextClasses as l,paddingXValues as s,radiusClasses as o,sheetRestClasses as n,srOnlyClasses as i,surfaceSlots as d}from"../../internal/styles.js";const c={default:{xs:"0.375rem",sm:"0.5rem",md:"0.75rem",lg:"0.875rem",xl:"1rem"},compact:{xs:"0.125rem",sm:"0.25rem",md:"0.4375rem",lg:"0.5625rem",xl:"0.6875rem"}},p={display:"table",width:"100%",margin:0,borderCollapse:"collapse",borderSpacing:0},m=/* @__PURE__ */["[--p-row:transparent]","[transition:background-color_var(--plass-duration)_var(--plass-ease)]"].join(" "),g=/* @__PURE__ */["cursor-pointer [outline:none]",t].join(" "),h="1px solid var(--plass-divider)";export function PlTable({variant:t="glass",size:v="md",color:y="primary",density:u="default",elevation:x=0,columns:f,rows:b,getRowKey:w,caption:k,empty:N="No data",striped:j=!1,hoverable:B=!1,stickyHeader:$=!1,maxHeight:A,onRowClick:C,className:H,style:S,...T}){const z=s[u][v],D=c[u][v],K=Boolean(C),R=B||K,_=void 0!==A,E={padding:`${D} ${z}`,border:0,background:"none"},I={...E,...$?{boxShadow:"inset 0 -1px 0 var(--plass-border)"}:{borderBottom:"1px solid var(--plass-border)"},...$?{background:"linear-gradient(var(--plass-glass-press), var(--plass-glass-press)), linear-gradient(var(--plass-surface), var(--plass-surface))"}:null},bodyCellStyle=e=>0===e?E:{...E,borderTop:h};return r("div",{className:["overflow-hidden",o[v],n[t],H??""].filter(Boolean).join(" "),style:{...d(y,x),...S},...T,children:[k?e("div",{"aria-hidden":"true",className:`${l[v]} font-semibold text-(--plass-muted-fg)`,style:{...E,borderBottom:h,textAlign:"start"},children:k}):null,e("div",{className:["overflow-x-auto",_?"overflow-y-auto overscroll-contain":""].filter(Boolean).join(" "),style:_?{maxHeight:A}:void 0,children:r("table",{className:`text-start ${a[v]} text-(--plass-fg)`,style:p,children:[k?e("caption",{className:i,children:k}):null,e("colgroup",{children:f.map(r=>e("col",{style:void 0===r.width?void 0:{width:"number"==typeof r.width?`${r.width}px`:r.width}},r.key))}),e("thead",{children:e("tr",{children:f.map(r=>e("th",{scope:"col",className:["font-semibold whitespace-nowrap text-(--plass-muted-fg)",$?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...I,textAlign:r.align??"start"},children:r.header??r.key},r.key))})}),e("tbody",{children:0===b.length?e("tr",{className:m,children:e("td",{colSpan:f.length,className:"text-(--plass-muted-fg)",style:{...E,padding:`2rem ${z}`,textAlign:"center"},children:N})}):b.map((r,a)=>e("tr",{className:[m,j&&a%2==1?"[--p-row:var(--plass-stripe)]":"",R?"hover:[--p-row:var(--p-soft)]":"",K?g:""].filter(Boolean).join(" "),style:{backgroundColor:"var(--p-row)"},tabIndex:K?0:void 0,onClick:C?()=>C(r,a):void 0,onKeyDown:C?e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C(r,a)))}:void 0,children:f.map(t=>e("td",{style:{...bodyCellStyle(a),textAlign:t.align??"start"},children:t.render?t.render(r,a):r[t.key]},t.key))},w?w(r,a):a))})]})})]})}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{controlTextLeadingClasses as r,metaTextClasses as a,paddingXValues as l,radiusClasses as o,sheetRestClasses as s,srOnlyClasses as n,surfaceSlots as i}from"../../internal/styles.js";import{cellPaddingYValues as d,clickableRowClasses as c,headRule as p,rowClasses as m,rowRule as h,tableStyle as g}from"../../internal/table.js";export function PlTable({variant:y="glass",size:v="md",color:f="primary",density:u="default",elevation:x=0,columns:b,rows:w,getRowKey:k,caption:N,empty:j="No data",striped:B=!1,hoverable:$=!1,stickyHeader:A=!1,maxHeight:C,onRowClick:H,className:T,style:z,...D}){const K=l[u][v],R=d[u][v],S=Boolean(H),E=$||S,I=void 0!==C,P={padding:`${R} ${K}`,border:0,background:"none"},q={...P,...A?{boxShadow:"inset 0 -1px 0 var(--plass-border)"}:{borderBottom:p},...A?{background:"linear-gradient(var(--plass-glass-press), var(--plass-glass-press)), linear-gradient(var(--plass-surface), var(--plass-surface))"}:null},bodyCellStyle=e=>0===e?P:{...P,borderTop:h};return t("div",{className:["overflow-hidden",o[v],s[y],T??""].filter(Boolean).join(" "),style:{...i(f,x),...z},...D,children:[N?e("div",{"aria-hidden":"true",className:`${a[v]} font-semibold text-(--plass-muted-fg)`,style:{...P,borderBottom:h,textAlign:"start"},children:N}):null,e("div",{className:["overflow-x-auto",I?"overflow-y-auto overscroll-contain":""].filter(Boolean).join(" "),style:I?{maxHeight:C}:void 0,children:t("table",{className:`text-start ${r[v]} text-(--plass-fg)`,style:g,children:[N?e("caption",{className:n,children:N}):null,e("colgroup",{children:b.map(t=>e("col",{style:void 0===t.width?void 0:{width:"number"==typeof t.width?`${t.width}px`:t.width}},t.key))}),e("thead",{children:e("tr",{children:b.map(t=>e("th",{scope:"col",className:["font-semibold whitespace-nowrap text-(--plass-muted-fg)",A?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...q,textAlign:t.align??"start"},children:t.header??t.key},t.key))})}),e("tbody",{children:0===w.length?e("tr",{className:m,children:e("td",{colSpan:b.length,className:"text-(--plass-muted-fg)",style:{...P,padding:`2rem ${K}`,textAlign:"center"},children:j})}):w.map((t,r)=>e("tr",{className:[m,B&&r%2==1?"[--p-row:var(--plass-stripe)]":"",E?"hover:[--p-row:var(--p-soft)]":"",S?c:""].filter(Boolean).join(" "),style:{backgroundColor:"var(--p-row)"},tabIndex:S?0:void 0,onClick:H?()=>H(t,r):void 0,onKeyDown:H?e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),H(t,r)))}:void 0,children:b.map(a=>e("td",{style:{...bodyCellStyle(r),textAlign:a.align??"start"},children:a.render?a.render(t,r):t[a.key]},a.key))},k?k(t,r):r))})]})})]})}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { PlassOrientation, PlassStyleProps, PlassVariant } from '../../types.js';
2
+ import type { PlassOrientation, PlassOverscroll, PlassResponsive, PlassStyleProps, PlassVariant } from '../../types.js';
3
3
  /** A tab's value. The same restraint `PlSelect` puts on its own — an identifier. */
4
4
  export type PlTabValue = string | number;
5
5
  export interface PlTabsProps extends Omit<PlassStyleProps, 'variant'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
@@ -28,7 +28,7 @@ export interface PlTabsProps extends Omit<PlassStyleProps, 'variant'>, Omit<Reac
28
28
  * UI's doing, and is what makes a vertical tab bar reachable.
29
29
  * @default 'horizontal'
30
30
  */
31
- orientation?: PlassOrientation;
31
+ orientation?: PlassResponsive<PlassOrientation>;
32
32
  /**
33
33
  * Whether moving the arrow keys also chooses the tab it lands on.
34
34
  *
@@ -45,6 +45,31 @@ export interface PlTabsProps extends Omit<PlassStyleProps, 'variant'>, Omit<Reac
45
45
  loopFocus?: boolean;
46
46
  /** The tabs share the bar's full width, each taking an equal part of it. */
47
47
  fullWidth?: boolean;
48
+ /**
49
+ * Whether a vertical wheel over a bar with more tabs than room moves it along.
50
+ *
51
+ * A mouse has one wheel and it points down the page, which is the one
52
+ * direction a tab bar does not run in — so a reader who can see that there are
53
+ * more tabs has no way of reaching them but the scrollbar that is deliberately
54
+ * not drawn, or the arrow keys, which also change the selection. The bar is
55
+ * the same scroller a `PlScrollZone` is and answers the wheel the same way.
56
+ *
57
+ * Only while the bar overflows, and only across: a bar that runs down the side
58
+ * scrolls with the page, and a bar whose tabs all fit is not a scroller at
59
+ * all.
60
+ * @default true
61
+ */
62
+ wheel?: boolean;
63
+ /**
64
+ * What the bar does with a wheel it has run out of tabs for.
65
+ *
66
+ * `contain`, the default, keeps it, so a reader working along a long bar is
67
+ * not thrown down the page by the notch that arrives after the last tab.
68
+ * `auto` is the browser's own chaining, held only for as long as the gesture
69
+ * lasts. A bar whose tabs all fit holds nothing back either way.
70
+ * @default 'contain'
71
+ */
72
+ overscroll?: PlassOverscroll;
48
73
  children?: React.ReactNode;
49
74
  }
50
75
  export interface PlTabProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'color'> {
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useDefaults as l}from"../../internal/defaults.js";import{Tabs as o}from"@base-ui/react/tabs";import{controlHeightClasses as s,controlTextClasses as i,focusRingClasses as n,focusRingInsetClasses as r,gapClasses as c,glassClasses as d,hasContent as h,iconClasses as f,paddingXClasses as u,radiusClasses as p,surfaceSlots as b,transitionClasses as v}from"../../internal/styles.js";const m=/* @__PURE__ */a.createContext({variant:"glass",size:"md",density:"default",orientation:"horizontal",fullWidth:!1}),x={solid:{horizontal:`${d} inline-flex bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)]`,vertical:`${d} inline-flex flex-col bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)]`},glass:{horizontal:"flex border-b [border-color:var(--plass-border)]",vertical:"flex flex-col border-e [border-color:var(--plass-border)]"},ghost:{horizontal:"flex",vertical:"flex flex-col"}},g={solid:{horizontal:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)"},glass:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},ghost:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},w={solid:`${d} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,glass:"bg-(--p-accent)",ghost:"bg-(--p-accent)"},z="text-(--plass-muted-fg) hover:text-(--plass-fg) data-[active]:text-(--p-accent)";export const PlTab=/* @__PURE__ */a.forwardRef(function PlTab({value:l,startIcon:n,endIcon:d,disabled:b=!1,className:x,children:g,...w},y){const{variant:P,size:j,density:N,fullWidth:T}=a.useContext(m);return t(o.Tab,{ref:y,value:l,disabled:b,className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","font-semibold whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",s[j],i[j],c[j],u[N][j],"solid"===P?p[j]:"",v,f,z,r,"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",T?"flex-1":"",x??""].filter(Boolean).join(" "),...w,children:[h(n)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:n}):null,g,h(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]})});export const PlTabPanel=/* @__PURE__ */a.forwardRef(function PlTabPanel({value:t,keepMounted:l=!1,className:s,children:i,...r},c){const{size:d}=a.useContext(m);return e(o.Panel,{ref:c,value:t,keepMounted:l,className:["min-w-0 flex-1 text-(--plass-fg)",n,p[d],s??""].filter(Boolean).join(" "),...r,children:i})});export const PlTabs=/* @__PURE__ */a.forwardRef(function PlTabs({variant:s="glass",size:i,color:n,density:r,value:c,defaultValue:d,onValueChange:h,orientation:f="horizontal",activateOnFocus:u=!1,loopFocus:v=!0,fullWidth:z=!1,className:y,style:P,children:j,...N},T){const k=l(),C=i??k.size??"md",V=n??k.color??"primary",B=r??k.density??"default",F=a.useMemo(()=>({variant:s,size:C,density:B,orientation:f,fullWidth:z}),[s,C,B,f,z]),R=[],W=[];return a.Children.forEach(j,e=>{a.isValidElement(e)&&e.type===PlTabPanel?W.push(e):null!=e&&!1!==e&&R.push(e)}),e(m.Provider,{value:F,children:t(o.Root,{ref:T,value:c,defaultValue:d,onValueChange:e=>h?.(e),orientation:f,className:["flex min-w-0","vertical"===f?"flex-row gap-4":"flex-col gap-4",y??""].filter(Boolean).join(" "),style:{...b(V,0),...P},...N,children:[t(o.List,{activateOnFocus:u,loopFocus:v,className:["relative shrink-0",x[s][f],"solid"===s?p[C]:"",z&&"horizontal"===f?"w-full":"","horizontal"===f?"overflow-x-auto overflow-y-hidden":""].filter(Boolean).join(" "),children:[R,e(o.Indicator,{className:["pointer-events-none",g[s][f],w[s],"solid"===s?p[C]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ")})]}),W]})})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useDefaults as l}from"../../internal/defaults.js";import{Tabs as o}from"@base-ui/react/tabs";import{controlHeightClasses as s,controlTextClasses as r,focusRingClasses as i,focusRingInsetClasses as n,forcedFieldEdgeClasses as c,forcedFillClasses as d,gapClasses as f,glassClasses as h,hasContent as u,iconClasses as p,paddingXClasses as v,radiusClasses as b,surfaceSlots as m,transitionClasses as g}from"../../internal/styles.js";import{useResponsiveValue as x}from"../../internal/responsive.js";import{overscrollClasses as w,useWheelScroll as y}from"../../internal/wheel.js";const z=/* @__PURE__ */a.createContext({variant:"glass",size:"md",density:"default",orientation:"horizontal",fullWidth:!1}),j={solid:{horizontal:`${h} inline-flex bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)] ${c}`,vertical:`${h} inline-flex flex-col bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)] ${c}`},glass:{horizontal:"flex border-b [border-color:var(--plass-border)]",vertical:"flex flex-col border-e [border-color:var(--plass-border)]"},ghost:{horizontal:"flex",vertical:"flex flex-col"}},P={solid:{horizontal:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)"},glass:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},ghost:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},N={solid:`${h} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,glass:"bg-(--p-accent)",ghost:"bg-(--p-accent)"},T="text-(--plass-muted-fg) hover:text-(--plass-fg) data-[active]:text-(--p-accent)";export const PlTab=/* @__PURE__ */a.forwardRef(function PlTab({value:l,startIcon:i,endIcon:c,disabled:d=!1,className:h,children:m,...x},w){const{variant:y,size:j,density:P,fullWidth:N}=a.useContext(z);return t(o.Tab,{ref:w,value:l,disabled:d,className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","font-semibold whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",s[j],r[j],f[j],v[P][j],"solid"===y?b[j]:"",g,p,T,"solid"===y?"forced-colors:data-[active]:[color:HighlightText]":"",n,"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",N?"flex-1":"",h??""].filter(Boolean).join(" "),...x,children:[u(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null,m,u(c)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:c}):null]})});export const PlTabPanel=/* @__PURE__ */a.forwardRef(function PlTabPanel({value:t,keepMounted:l=!1,className:s,children:r,...n},c){const{size:d}=a.useContext(z);return e(o.Panel,{ref:c,value:t,keepMounted:l,className:["min-w-0 flex-1 text-(--plass-fg)",i,b[d],s??""].filter(Boolean).join(" "),...n,children:r})});export const PlTabs=/* @__PURE__ */a.forwardRef(function PlTabs({variant:s="glass",size:r,color:i,density:n,value:c,defaultValue:f,onValueChange:h,orientation:u,activateOnFocus:p=!1,loopFocus:v=!0,fullWidth:g=!1,wheel:T=!0,overscroll:k="contain",className:C,style:R,children:S,...V},W){const E=x(u,"horizontal"),F=l(),O=r??F.size??"md",$=i??F.color??"primary",B=n??F.density??"default",L=a.useMemo(()=>({variant:s,size:O,density:B,orientation:E,fullWidth:g}),[s,O,B,E,g]),M=a.useRef(null),I="horizontal"===E,H=function useListOverflow(e,t){const[l,o]=a.useState({start:!1,end:!1,rtl:!1}),s=a.useCallback(()=>{const t=e.current;if(!t)return;const a=t.scrollWidth-t.clientWidth,l=Math.abs(t.scrollLeft),s={start:l>1,end:a-l>1,rtl:"rtl"===getComputedStyle(t).direction};o(e=>e.start===s.start&&e.end===s.end&&e.rtl===s.rtl?e:s)},[e]);return a.useLayoutEffect(()=>{t&&s()}),a.useEffect(()=>{const a=e.current;if(!a||!t||"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(s);return l.observe(a),()=>l.disconnect()},[t,s,e]),t?{style:{"--p-fade-left":(l.rtl?l.end:l.start)?"var(--p-fade)":void 0,"--p-fade-right":(l.rtl?l.start:l.end)?"var(--p-fade)":void 0},onScroll:s,state:l.start?l.end?"both":"start":l.end?"end":"none"}:{style:void 0,onScroll:void 0,state:void 0}}(M,I);y(M,{enabled:T&&I,overscroll:k});const q=[],A=[],sort=e=>{a.Children.forEach(e,e=>{a.isValidElement(e)&&e.type===a.Fragment?sort(e.props.children):a.isValidElement(e)&&e.type===PlTabPanel?A.push(e):null!=e&&!1!==e&&q.push(e)})};return sort(S),e(z.Provider,{value:L,children:t(o.Root,{ref:W,value:c,defaultValue:f,onValueChange:e=>h?.(e),orientation:E,className:["flex min-w-0","vertical"===E?"flex-row gap-4":"flex-col gap-4",C??""].filter(Boolean).join(" "),style:{...m($,0),...R},...V,children:[t(o.List,{ref:M,activateOnFocus:p,loopFocus:v,className:["relative shrink-0",j[s][E],"solid"===s?b[O]:"",g&&I?"w-full":"",I?"plass-fade-x overflow-x-auto overflow-y-hidden":"",I?w(k,!0):""].filter(Boolean).join(" "),style:H.style,onScroll:H.onScroll,"data-overflow":H.state,children:[q,e(o.Indicator,{className:["pointer-events-none",P[s][E],N[s],d,"solid"===s?b[O]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ")})]}),A]})})});
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{useRender as i}from"@base-ui/react/use-render";import{ExternalLinkIcon as l,LinkIcon as a}from"../../internal/icons.js";import{controlTextLeadingClasses as o,focusRingClasses as t,srOnlyClasses as c}from"../../internal/styles.js";import{safeRel as p}from"../../internal/link.js";const m={always:"[&.plass-link]:underline",hover:"[&.plass-link]:no-underline [&.plass-link]:hover:underline",none:"[&.plass-link]:no-underline"},d=/* @__PURE__ */["plass-link","cursor-pointer","[&_svg]:pointer-events-none [&_svg]:inline [&_svg]:size-[0.95em] [&_svg]:shrink-0",/* @__PURE__ */["[transition-property:color,text-decoration-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" "),t,"focus-visible:rounded-[0.25rem]"].join(" ");export const PlTextLink=/* @__PURE__ */s.forwardRef(function PlTextLink({href:t,underline:u="always",color:f,size:v,newTab:h=!1,icon:k,startIcon:x,newTabLabel:b="(opens in a new tab)",render:g,className:j,style:y,children:w,..._},N){const T=k??h,L=!0===T?n(h?l:a,{}):T,z=[d,v?o[v]:"",m[u],f?"[&.plass-link]:text-(--p-accent)":"[&.plass-link]:text-inherit",j??""].filter(Boolean).join(" "),C={"--p-underline":"color-mix(in oklab, currentColor 45%, transparent)","--p-underline-hover":"currentColor","--p-ring":`var(--plass-${f??"primary"}-ring)`,...f?{"--p-accent":`var(--plass-${f}-accent)`}:null},P=s.isValidElement(g)&&void 0!==g.props.href,{rel:$,...B}=_,E=p(h?"_blank":void 0,$);return i({render:g??n("a",{}),ref:N,props:{...P?null:{href:t},target:h?"_blank":void 0,className:z,style:{...C,...y},children:r(e,{children:[x?n("span",{className:"me-[0.25em]",children:x}):null,w,L?n("span",{className:"ms-[0.25em]",children:L}):null,h?r(e,{children:[" ",n("span",{className:c,children:b})]}):null]}),...B,rel:E}})});
1
+ "use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{useLabels as l}from"../../internal/labels.js";import{useRender as i}from"@base-ui/react/use-render";import{ExternalLinkIcon as a,LinkIcon as o}from"../../internal/icons.js";import{controlTextLeadingClasses as t,focusRingClasses as c,srOnlyClasses as p}from"../../internal/styles.js";import{safeRel as m}from"../../internal/link.js";const d={always:"[&.plass-link]:underline",hover:"[&.plass-link]:no-underline [&.plass-link]:hover:underline",none:"[&.plass-link]:no-underline"},u=/* @__PURE__ */["plass-link","cursor-pointer","[&_svg]:pointer-events-none [&_svg]:inline [&_svg]:size-[0.95em] [&_svg]:shrink-0",/* @__PURE__ */["[transition-property:color,text-decoration-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" "),c,"focus-visible:rounded-[0.25rem]"].join(" ");export const PlTextLink=/* @__PURE__ */s.forwardRef(function PlTextLink({href:c,underline:f="always",color:h,size:v,newTab:k=!1,icon:b,startIcon:g,newTabLabel:j,render:x,className:y,style:w,children:_,...N},T){const L=l(),z=j??L.newTab,C=b??k,P=!0===C?n(k?a:o,{}):C,$=[u,v?t[v]:"",d[f],h?"[&.plass-link]:text-(--p-accent)":"[&.plass-link]:text-inherit",y??""].filter(Boolean).join(" "),B={"--p-underline":"color-mix(in oklab, currentColor 45%, transparent)","--p-underline-hover":"currentColor","--p-ring":`var(--plass-${h??"primary"}-ring)`,...h?{"--p-accent":`var(--plass-${h}-accent)`}:null},E=s.isValidElement(x)&&void 0!==x.props.href,{rel:F,target:I,...R}=N,V=I??(k?"_blank":void 0),q=k||"_blank"===V,A=m(V,F);return i({render:x??n("a",{}),ref:T,props:{...E?null:{href:c},target:V,className:$,style:{...B,...w},children:r(e,{children:[g?n("span",{className:"me-[0.25em]",children:g}):null,_,P?n("span",{className:"ms-[0.25em]",children:P}):null,q?r(e,{children:[" ",n("span",{className:p,children:z})]}):null]}),...R,rel:A}})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as o from"react";import{useDefaults as l}from"../../internal/defaults.js";import{PlButton as t}from"../button/PlButton.js";import{TimeGrid as s,usePickerLabels as i}from"../../internal/calendar.js";import{ClockIcon as a}from"../../internal/icons.js";import{PickerFooter as r,PickerShell as c}from"../../internal/picker.js";import{displaySamples as d,formatDate as u,isHour12 as m,isValidDate as p,secondsOfDay as h,timeUnitSpan as f,toISOTime as g,withPlaceholder as y,withTime as S}from"../../internal/date.js";import{cx as b}from"../../internal/styles.js";export const PlTimePicker=/* @__PURE__ */o.forwardRef(function PlTimePicker({value:v,defaultValue:j,onValueChange:C,open:w,defaultOpen:z,onOpenChange:k,referenceDate:x,minTime:D,maxTime:O,shouldDisableTime:T,hour12:P,showSeconds:M=!1,hourStep:V=1,minuteStep:B=1,secondStep:I=1,locale:N,format:R,placeholder:F,clearable:H=!1,showNowButton:q=!0,closeOnSelect:A=!1,labels:E,name:G,size:J,color:K,density:L,readOnly:Q=!1,disabled:U=!1,startIcon:W,...X},Y){const Z=l(),$=N??Z.locale,_=J??Z.size??"md",ee=K??Z.color??"primary",ne=L??Z.density??"default",oe=i(E),le=P??m($),[te,se]=o.useState(j??null),ie=void 0!==v?v:te,[ae,re]=o.useState(z??!1),ce=w??ae,[de]=o.useState(()=>x??new Date),setOpen=e=>{e&&(Q||U)||(void 0===w&&re(e),k?.(e))},commit=e=>{void 0===v&&se(e),C?.(e)},ue=o.useCallback((e,n)=>{const[o,l]=f(n,e);return!!(p(D)&&l<h(D))||!!(p(O)&&o>h(O))||(T?.(e,n)??!1)},[D,O,T]),me=o.useMemo(()=>R??{hour:"numeric",minute:"2-digit",...M?{second:"2-digit"}:{}},[R,M]),pe=new Date,he=S(x??de,{hours:pe.getHours(),minutes:pe.getMinutes(),seconds:M?pe.getSeconds():0}),fe=q||H||!A,ge=o.useMemo(()=>y(d($,me),F),[$,me,F]);return e(c,{...X,size:_,color:ee,density:ne,readOnly:Q,disabled:U,triggerRef:Y,startIcon:W??e(a,{}),display:p(ie)?u(ie,$,me):F??"",samples:ge,empty:!p(ie),clearable:H,onClear:()=>commit(null),open:ce,onOpenChange:setOpen,labels:oe,hiddenValues:G?[{name:G,value:p(ie)?g(ie,M):""}]:void 0,children:n("div",{className:b("flex flex-col",fe&&"gap-1.5"),children:[e(s,{size:_,density:ne,locale:$,value:p(ie)?ie:null,referenceDate:x??de,onChange:e=>{commit(e),A&&setOpen(!1)},hour12:le,showSeconds:M,hourStep:V,minuteStep:B,secondStep:I,shouldDisableTime:ue,labels:oe,autoFocus:!0}),fe?n(r,{size:_,children:[H?e(t,{variant:"ghost",size:_,color:ee,density:"compact",onClick:()=>{commit(null),setOpen(!1)},children:oe.clear}):null,q?e(t,{variant:"ghost",size:_,color:ee,density:"compact",disabled:ue(he,"second"),onClick:()=>{commit(he),setOpen(!1)},children:oe.now}):null,A?null:e(t,{variant:"solid",size:_,color:ee,density:"compact",onClick:()=>setOpen(!1),children:oe.done})]}):null]})})});
1
+ "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as n from"react";import{useDefaults as l}from"../../internal/defaults.js";import{PlButton as t}from"../button/PlButton.js";import{TimeGrid as s,usePickerLabels as r}from"../../internal/calendar.js";import{ClockIcon as a}from"../../internal/icons.js";import{PickerFooter as i,PickerShell as c}from"../../internal/picker.js";import{displaySamples as d,formatDate as u,isHour12 as m,isValidDate as p,secondsOfDay as h,timeUnitSpan as f,toISOTime as g,withPlaceholder as y,withTime as S}from"../../internal/date.js";import{cx as b}from"../../internal/styles.js";export const PlTimePicker=/* @__PURE__ */n.forwardRef(function PlTimePicker({value:j,defaultValue:v,onValueChange:C,open:w,defaultOpen:z,onOpenChange:k,referenceDate:x,minTime:D,maxTime:O,shouldDisableTime:T,hour12:P,showSeconds:M=!1,hourStep:V=1,minuteStep:B=1,secondStep:I=1,locale:N,format:R,placeholder:F,clearable:H=!1,showNowButton:q=!0,closeOnSelect:A=!1,labels:E,name:G,size:J,color:K,density:L,readOnly:Q=!1,disabled:U=!1,startIcon:W,...X},Y){const Z=l(),$=N??Z.locale,_=J??Z.size??"md",ee=K??Z.color??"primary",oe=L??Z.density??"default",ne=r(E),le=P??m($),[te,se]=n.useState(v??null),re=void 0!==j?j:te,[ae,ie]=n.useState(z??!1),ce=w??ae,[de]=n.useState(()=>x??new Date),setOpen=e=>{e&&(Q||U)||(void 0===w&&ie(e),k?.(e))},commit=e=>{void 0===j&&se(e),C?.(e)},ue=n.useCallback((e,o)=>{const[n,l]=f(o,e);return!!(p(D)&&l<h(D))||!!(p(O)&&n>h(O))||(T?.(e,o)??!1)},[D,O,T]),me=n.useMemo(()=>R??{hour:"numeric",minute:"2-digit",...M?{second:"2-digit"}:{}},[R,M]),pe=new Date,he=S(x??de,{hours:pe.getHours(),minutes:pe.getMinutes(),seconds:M?pe.getSeconds():0}),fe=q||H||!A,ge=n.useMemo(()=>y(d($,me),F),[$,me,F]);return e(c,{...X,size:_,color:ee,density:oe,readOnly:Q,disabled:U,triggerRef:Y,startIcon:W??e(a,{}),display:p(re)?u(re,$,me):F??"",samples:ge,empty:!p(re),clearable:H,onClear:()=>commit(null),open:ce,onOpenChange:setOpen,labels:ne,name:G,formValue:p(re)?g(re,M):"",children:o("div",{className:b("flex flex-col",fe&&"gap-1.5"),children:[e(s,{size:_,density:oe,locale:$,value:p(re)?re:null,referenceDate:x??de,onChange:e=>{commit(e),A&&setOpen(!1)},hour12:le,showSeconds:M,hourStep:V,minuteStep:B,secondStep:I,shouldDisableTime:ue,labels:ne,autoFocus:!0}),fe?o(i,{size:_,children:[H?e(t,{variant:"ghost",size:_,color:ee,density:"compact",onClick:()=>{commit(null),setOpen(!1)},children:ne.clear}):null,q?e(t,{variant:"ghost",size:_,color:ee,density:"compact",disabled:ue(he,"second"),onClick:()=>{commit(he),setOpen(!1)},children:ne.now}):null,A?null:e(t,{variant:"solid",size:_,color:ee,density:"compact",onClick:()=>setOpen(!1),children:ne.done})]}):null]})})});
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
3
  import { type PlassStepConnector, type PlassStepStatus } from '../../internal/steps.js';
4
- import type { PlassColor, PlassDensity, PlassOrientation, PlassSize } from '../../types.js';
4
+ import type { PlassColor, PlassDensity, PlassOrientation, PlassResponsive, PlassSize } from '../../types.js';
5
5
  /**
6
6
  * How far along one item is. The same three a `PlStepper` draws, from
7
7
  * `internal/steps.ts`, because a haloed bullet must not mean two things.
@@ -33,7 +33,7 @@ export interface PlTimelineProps extends Omit<React.ComponentPropsWithoutRef<'ol
33
33
  * only honest while every label is short.
34
34
  * @default 'vertical'
35
35
  */
36
- orientation?: PlassOrientation;
36
+ orientation?: PlassResponsive<PlassOrientation>;
37
37
  /** Renders something other than an `<ol>` — Base UI's own escape hatch. */
38
38
  render?: useRender.RenderProp;
39
39
  children?: React.ReactNode;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useRender as s}from"@base-ui/react/use-render";import{cx as a,hasContent as n,iconClasses as i,metaTextClasses as o,sheetBodyClasses as c,sheetTitleClasses as p,surfaceSlots as d,transitionClasses as m}from"../../internal/styles.js";import{bulletGapClasses as u,bulletSizeValues as f,bulletStatusClasses as x,connectorColorClasses as b,connectorStyleClasses as v,statusAt as h,titleStatusClasses as y}from"../../internal/steps.js";const N=/* @__PURE__ */t.createContext(null),g=/* @__PURE__ */t.createContext({index:0,last:!1}),z={default:{xs:"pb-5",sm:"pb-6",md:"pb-7",lg:"pb-8",xl:"pb-10"},compact:{xs:"pb-3",sm:"pb-3.5",md:"pb-4",lg:"pb-5",xl:"pb-6"}},j={default:{xs:"pe-5",sm:"pe-6",md:"pe-7",lg:"pe-8",xl:"pe-10"},compact:{xs:"pe-3",sm:"pe-3.5",md:"pe-4",lg:"pe-5",xl:"pe-6"}};export const PlTimelineItem=/* @__PURE__ */t.forwardRef(function PlTimelineItem({title:r,meta:s,bullet:w,status:P,color:C,connector:T="solid",className:_,children:I,...R},$){const k=t.useContext(N),{index:A,last:M}=t.useContext(g),q=k?.size??"md",B=k?.density??"default",D=k?.orientation??"vertical",E=C??k?.color??"primary",F=P??h(A,k?.active??null),G="horizontal"===D,H="none"!==T&&!M,J=e("span",{"aria-hidden":"true",className:a("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",x[F],m,i),children:w}),K=H?e("span",{"aria-hidden":"true",className:a("pointer-events-none absolute",G?"top-[calc(var(--p-bullet)/2_-_1px)] end-0 start-(--p-bullet) border-t-2":"top-(--p-bullet) bottom-0 start-[calc(var(--p-bullet)/2_-_1px)] border-s-2",v[T],b[F],m)}):null,L=l("div",{className:a("flex min-w-0 flex-col gap-0.5",G?"mt-2":""),children:[n(r)||n(s)?l("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[n(r)?e("span",{className:a("font-semibold",p[q],y[F],m),children:r}):null,n(s)?e("span",{className:a("text-(--plass-muted-fg)",o[q]),children:s}):null]}):null,n(I)?e("div",{className:a("text-(--plass-muted-fg)",c[q]),children:I}):null]});return l("li",{ref:$,"aria-current":"current"===F?"step":void 0,"data-status":F,className:a("relative",G?a("flex min-w-0 flex-1 flex-col",M?"":j[B][q]):a("flex",u[q],M?"":z[B][q]),_),style:{"--p-bullet":f[q],...d(E,0),"--p-fill":`var(--plass-${E}-fill)`,"--p-on-solid":`var(--plass-${E}-on-solid)`},...R,children:[K,J,L]})});export const PlTimeline=/* @__PURE__ */t.forwardRef(function PlTimeline({active:l,size:n,color:i,density:o,orientation:c="vertical",render:p,className:m,style:u,children:f,...x},b){const v=r(),h=n??v.size??"md",y=i??v.color??"primary",z=o??v.density??"default",j=t.Children.toArray(f),w=j.length,P=t.useMemo(()=>({size:h,density:z,orientation:c,color:y,active:l??null}),[h,z,c,y,l]),C=s({render:p??e("ol",{}),ref:b,props:{role:"list",className:a("flex","horizontal"===c?"flex-row":"flex-col",m),style:{...d(y,0),...u},children:j.map((l,t)=>e(g.Provider,{value:{index:t,last:t===w-1},children:l},t)),...x}});return e(N.Provider,{value:P,children:C})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useRender as s}from"@base-ui/react/use-render";import{cx as a,hasContent as n,iconClasses as i,metaTextClasses as o,sheetBodyClasses as c,sheetTitleClasses as p,surfaceSlots as d,transitionClasses as m}from"../../internal/styles.js";import{bulletGapClasses as u,bulletSizeValues as f,bulletStatusClasses as x,connectorColorClasses as b,connectorStyleClasses as v,statusAt as h,titleStatusClasses as y}from"../../internal/steps.js";import{useResponsiveValue as N}from"../../internal/responsive.js";const g=/* @__PURE__ */t.createContext(null),j=/* @__PURE__ */t.createContext({index:0,last:!1}),z={default:{xs:"pb-5",sm:"pb-6",md:"pb-7",lg:"pb-8",xl:"pb-10"},compact:{xs:"pb-3",sm:"pb-3.5",md:"pb-4",lg:"pb-5",xl:"pb-6"}},w={default:{xs:"pe-5",sm:"pe-6",md:"pe-7",lg:"pe-8",xl:"pe-10"},compact:{xs:"pe-3",sm:"pe-3.5",md:"pe-4",lg:"pe-5",xl:"pe-6"}};export const PlTimelineItem=/* @__PURE__ */t.forwardRef(function PlTimelineItem({title:r,meta:s,bullet:N,status:P,color:C,connector:T="solid",className:_,children:k,...I},R){const $=t.useContext(g),{index:A,last:E}=t.useContext(j),M=$?.size??"md",V=$?.density??"default",q=$?.orientation??"vertical",B=C??$?.color??"primary",D=P??h(A,$?.active??null),F="horizontal"===q,G="none"!==T&&!E,H=e("span",{"aria-hidden":"true",className:a("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",x[D],m,i),children:N}),J=G?e("span",{"aria-hidden":"true",className:a("pointer-events-none absolute",F?"top-[calc(var(--p-bullet)/2_-_1px)] end-0 start-(--p-bullet) border-t-2":"top-(--p-bullet) bottom-0 start-[calc(var(--p-bullet)/2_-_1px)] border-s-2",v[T],b[D],m)}):null,K=l("div",{className:a("flex min-w-0 flex-col gap-0.5",F?"mt-2":""),children:[n(r)||n(s)?l("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[n(r)?e("span",{className:a("font-semibold",p[M],y[D],m),children:r}):null,n(s)?e("span",{className:a("text-(--plass-muted-fg)",o[M]),children:s}):null]}):null,n(k)?e("div",{className:a("text-(--plass-muted-fg)",c[M]),children:k}):null]});return l("li",{ref:R,"aria-current":"current"===D?"step":void 0,"data-status":D,className:a("relative",F?a("flex min-w-0 flex-1 flex-col",E?"":w[V][M]):a("flex",u[M],E?"":z[V][M]),_),style:{"--p-bullet":f[M],...d(B,0),"--p-fill":`var(--plass-${B}-fill)`,"--p-on-solid":`var(--plass-${B}-on-solid)`},...I,children:[J,H,K]})});export const PlTimeline=/* @__PURE__ */t.forwardRef(function PlTimeline({active:l,size:n,color:i,density:o,orientation:c,render:p,className:m,style:u,children:f,...x},b){const v=N(c,"vertical"),h=r(),y=n??h.size??"md",z=i??h.color??"primary",w=o??h.density??"default",P=t.Children.toArray(f),C=P.length,T=t.useMemo(()=>({size:y,density:w,orientation:v,color:z,active:l??null}),[y,w,v,z,l]),_=s({render:p??e("ol",{}),ref:b,props:{role:"list",className:a("flex","horizontal"===v?"flex-row":"flex-col",m),style:{...d(z,0),...u},children:P.map((l,r)=>e(j.Provider,{value:{index:r,last:r===C-1},children:l},t.isValidElement(l)?l.key??r:r)),...x}});return e(g.Provider,{value:T,children:_})});