plass-ui 1.3.0 → 1.4.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 (340) hide show
  1. package/CHANGELOG.md +590 -0
  2. package/README.md +1 -1
  3. package/dist/components/alert/PlAlert.js +1 -1
  4. package/dist/components/anchor/PlAnchor.d.ts +72 -0
  5. package/dist/components/anchor/PlAnchor.js +1 -0
  6. package/dist/components/anchor/index.d.ts +2 -0
  7. package/dist/components/anchor/index.js +1 -0
  8. package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
  9. package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
  10. package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
  11. package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
  12. package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
  13. package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
  14. package/dist/components/animate-counter/index.d.ts +2 -0
  15. package/dist/components/animate-counter/index.js +1 -0
  16. package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
  17. package/dist/components/animate-fade/PlAnimateFade.js +1 -1
  18. package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
  19. package/dist/components/animate-float/PlAnimateFloat.js +1 -0
  20. package/dist/components/animate-float/index.d.ts +2 -0
  21. package/dist/components/animate-float/index.js +1 -0
  22. package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
  23. package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
  24. package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
  25. package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
  26. package/dist/components/animate-reveal/index.d.ts +2 -0
  27. package/dist/components/animate-reveal/index.js +1 -0
  28. package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
  29. package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
  30. package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
  31. package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
  32. package/dist/components/animate-scramble/index.d.ts +2 -0
  33. package/dist/components/animate-scramble/index.js +1 -0
  34. package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
  35. package/dist/components/animate-shake/PlAnimateShake.js +1 -0
  36. package/dist/components/animate-shake/index.d.ts +2 -0
  37. package/dist/components/animate-shake/index.js +1 -0
  38. package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
  39. package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
  40. package/dist/components/animate-split/PlAnimateSplit.d.ts +54 -0
  41. package/dist/components/animate-split/PlAnimateSplit.js +1 -0
  42. package/dist/components/animate-split/index.d.ts +2 -0
  43. package/dist/components/animate-split/index.js +1 -0
  44. package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
  45. package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
  46. package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
  47. package/dist/components/app-logo/PlAppLogo.js +1 -0
  48. package/dist/components/app-logo/index.d.ts +2 -0
  49. package/dist/components/app-logo/index.js +1 -0
  50. package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
  51. package/dist/components/area-chart/PlAreaChart.js +1 -0
  52. package/dist/components/area-chart/index.d.ts +2 -0
  53. package/dist/components/area-chart/index.js +1 -0
  54. package/dist/components/avatar/PlAvatar.js +1 -1
  55. package/dist/components/back-top/PlBackTop.js +1 -1
  56. package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
  57. package/dist/components/bar-chart/PlBarChart.js +1 -0
  58. package/dist/components/bar-chart/index.d.ts +2 -0
  59. package/dist/components/bar-chart/index.js +1 -0
  60. package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
  61. package/dist/components/button-group/PlButtonGroup.js +1 -1
  62. package/dist/components/carousel/PlCarousel.js +1 -1
  63. package/dist/components/chat-bubble/PlChatBubble.js +1 -1
  64. package/dist/components/checkbox/PlCheckbox.js +1 -1
  65. package/dist/components/chip/PlChip.js +1 -1
  66. package/dist/components/code-block/PlCodeBlock.d.ts +175 -0
  67. package/dist/components/code-block/PlCodeBlock.js +1 -0
  68. package/dist/components/code-block/index.d.ts +2 -0
  69. package/dist/components/code-block/index.js +1 -0
  70. package/dist/components/combobox/PlCombobox.d.ts +1 -1
  71. package/dist/components/combobox/PlCombobox.js +1 -1
  72. package/dist/components/command-palette/PlCommandPalette.d.ts +1 -1
  73. package/dist/components/command-palette/PlCommandPalette.js +1 -1
  74. package/dist/components/container/PlContainer.d.ts +22 -6
  75. package/dist/components/container/PlContainer.js +1 -1
  76. package/dist/components/data-list/PlDataList.d.ts +74 -0
  77. package/dist/components/data-list/PlDataList.js +1 -0
  78. package/dist/components/data-list/index.d.ts +2 -0
  79. package/dist/components/data-list/index.js +1 -0
  80. package/dist/components/data-table/PlDataTable.d.ts +202 -0
  81. package/dist/components/data-table/PlDataTable.js +1 -0
  82. package/dist/components/data-table/index.d.ts +2 -0
  83. package/dist/components/data-table/index.js +1 -0
  84. package/dist/components/drawer/PlDrawer.d.ts +1 -1
  85. package/dist/components/drawer/PlDrawer.js +1 -1
  86. package/dist/components/flex/PlFlex.d.ts +83 -0
  87. package/dist/components/flex/PlFlex.js +1 -0
  88. package/dist/components/flex/index.d.ts +2 -0
  89. package/dist/components/flex/index.js +1 -0
  90. package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
  91. package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
  92. package/dist/components/floating-action-button/index.d.ts +2 -0
  93. package/dist/components/floating-action-button/index.js +1 -0
  94. package/dist/components/footer/PlFooter.d.ts +4 -3
  95. package/dist/components/footer/PlFooter.js +1 -1
  96. package/dist/components/gallery/PlGallery.d.ts +154 -0
  97. package/dist/components/gallery/PlGallery.js +1 -0
  98. package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
  99. package/dist/components/gallery/PlGalleryViewer.js +1 -0
  100. package/dist/components/gallery/index.d.ts +2 -0
  101. package/dist/components/gallery/index.js +1 -0
  102. package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
  103. package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
  104. package/dist/components/gauge-chart/index.d.ts +2 -0
  105. package/dist/components/gauge-chart/index.js +1 -0
  106. package/dist/components/grid/PlGrid.js +1 -1
  107. package/dist/components/grid/PlGridItem.js +1 -1
  108. package/dist/components/header/PlHeader.d.ts +4 -3
  109. package/dist/components/header/PlHeader.js +1 -1
  110. package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
  111. package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
  112. package/dist/components/heatmap-chart/index.d.ts +2 -0
  113. package/dist/components/heatmap-chart/index.js +1 -0
  114. package/dist/components/hover-card/PlHoverCard.d.ts +94 -0
  115. package/dist/components/hover-card/PlHoverCard.js +1 -0
  116. package/dist/components/hover-card/index.d.ts +2 -0
  117. package/dist/components/hover-card/index.js +1 -0
  118. package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
  119. package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
  120. package/dist/components/how-to-steps/index.d.ts +2 -0
  121. package/dist/components/how-to-steps/index.js +1 -0
  122. package/dist/components/image/PlImage.js +1 -1
  123. package/dist/components/line-chart/PlLineChart.d.ts +74 -0
  124. package/dist/components/line-chart/PlLineChart.js +1 -0
  125. package/dist/components/line-chart/index.d.ts +2 -0
  126. package/dist/components/line-chart/index.js +1 -0
  127. package/dist/components/meter/PlMeter.d.ts +83 -0
  128. package/dist/components/meter/PlMeter.js +1 -0
  129. package/dist/components/meter/index.d.ts +2 -0
  130. package/dist/components/meter/index.js +1 -0
  131. package/dist/components/mockup/PlMockup.d.ts +146 -0
  132. package/dist/components/mockup/PlMockup.js +1 -0
  133. package/dist/components/mockup/index.d.ts +2 -0
  134. package/dist/components/mockup/index.js +1 -0
  135. package/dist/components/modal/PlModal.d.ts +1 -1
  136. package/dist/components/modal/PlModal.js +1 -1
  137. package/dist/components/number-field/PlNumberField.d.ts +1 -1
  138. package/dist/components/number-field/PlNumberField.js +1 -1
  139. package/dist/components/overlay/PlOverlay.d.ts +1 -1
  140. package/dist/components/overlay/PlOverlay.js +1 -1
  141. package/dist/components/page-layout/PlPageLayout.js +1 -1
  142. package/dist/components/pagination/PlPagination.js +1 -1
  143. package/dist/components/panes/PlPanes.d.ts +2 -2
  144. package/dist/components/panes/PlPanes.js +1 -1
  145. package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
  146. package/dist/components/pie-chart/PlPieChart.js +1 -0
  147. package/dist/components/pie-chart/index.d.ts +2 -0
  148. package/dist/components/pie-chart/index.js +1 -0
  149. package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
  150. package/dist/components/popconfirm/PlPopconfirm.js +1 -1
  151. package/dist/components/popover/PlPopover.d.ts +1 -1
  152. package/dist/components/popover/PlPopover.js +1 -1
  153. package/dist/components/portal/PlPortal.d.ts +78 -0
  154. package/dist/components/portal/PlPortal.js +1 -0
  155. package/dist/components/portal/index.d.ts +2 -0
  156. package/dist/components/portal/index.js +1 -0
  157. package/dist/components/radio-group/PlRadioGroup.js +1 -1
  158. package/dist/components/rating/PlRating.js +1 -1
  159. package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
  160. package/dist/components/scatter-chart/PlScatterChart.js +1 -0
  161. package/dist/components/scatter-chart/index.d.ts +2 -0
  162. package/dist/components/scatter-chart/index.js +1 -0
  163. package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
  164. package/dist/components/scroll-area/PlScrollArea.js +1 -0
  165. package/dist/components/scroll-area/index.d.ts +2 -0
  166. package/dist/components/scroll-area/index.js +1 -0
  167. package/dist/components/scroll-zone/PlScrollZone.d.ts +9 -5
  168. package/dist/components/scroll-zone/PlScrollZone.js +1 -1
  169. package/dist/components/select/PlSelect.js +1 -1
  170. package/dist/components/show/PlShow.d.ts +60 -0
  171. package/dist/components/show/PlShow.js +1 -0
  172. package/dist/components/show/index.d.ts +2 -0
  173. package/dist/components/show/index.js +1 -0
  174. package/dist/components/sidebar/PlSidebar.js +1 -1
  175. package/dist/components/slider/PlSlider.js +1 -1
  176. package/dist/components/sparkline/PlSparkline.d.ts +68 -0
  177. package/dist/components/sparkline/PlSparkline.js +1 -0
  178. package/dist/components/sparkline/index.d.ts +2 -0
  179. package/dist/components/sparkline/index.js +1 -0
  180. package/dist/components/spoiler/PlSpoiler.d.ts +8 -0
  181. package/dist/components/spoiler/PlSpoiler.js +1 -1
  182. package/dist/components/stack/PlStack.d.ts +114 -0
  183. package/dist/components/stack/PlStack.js +1 -0
  184. package/dist/components/stack/index.d.ts +2 -0
  185. package/dist/components/stack/index.js +1 -0
  186. package/dist/components/stepper/PlStepper.d.ts +2 -2
  187. package/dist/components/stepper/PlStepper.js +1 -1
  188. package/dist/components/table/PlTable.js +1 -1
  189. package/dist/components/tabs/PlTabs.d.ts +2 -2
  190. package/dist/components/tabs/PlTabs.js +1 -1
  191. package/dist/components/text-link/PlTextLink.js +1 -1
  192. package/dist/components/timeline/PlTimeline.d.ts +2 -2
  193. package/dist/components/timeline/PlTimeline.js +1 -1
  194. package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
  195. package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
  196. package/dist/components/timeline-chart/index.d.ts +2 -0
  197. package/dist/components/timeline-chart/index.js +1 -0
  198. package/dist/components/toast/PlToast.d.ts +1 -1
  199. package/dist/components/toast/PlToast.js +1 -1
  200. package/dist/components/toggle/PlToggle.js +1 -1
  201. package/dist/components/toggle/PlToggleGroup.js +1 -1
  202. package/dist/components/tour/PlTour.d.ts +134 -0
  203. package/dist/components/tour/PlTour.js +1 -0
  204. package/dist/components/tour/index.d.ts +2 -0
  205. package/dist/components/tour/index.js +1 -0
  206. package/dist/components/transfer/PlTransfer.js +1 -1
  207. package/dist/components/tree/PlTree.js +1 -1
  208. package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
  209. package/dist/components/tree-select/PlTreeSelect.js +1 -0
  210. package/dist/components/tree-select/index.d.ts +2 -0
  211. package/dist/components/tree-select/index.js +1 -0
  212. package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
  213. package/dist/components/window-pane/PlWindowPane.js +1 -0
  214. package/dist/components/window-pane/index.d.ts +2 -0
  215. package/dist/components/window-pane/index.js +1 -0
  216. package/dist/css/anchor.css +2 -0
  217. package/dist/css/animate-counter.css +2 -0
  218. package/dist/css/animate-float.css +2 -0
  219. package/dist/css/animate-reveal.css +2 -0
  220. package/dist/css/animate-scramble.css +2 -0
  221. package/dist/css/animate-shake.css +2 -0
  222. package/dist/css/animate-split.css +2 -0
  223. package/dist/css/app-logo.css +2 -0
  224. package/dist/css/area-chart.css +2 -0
  225. package/dist/css/bar-chart.css +2 -0
  226. package/dist/css/code-block.css +2 -0
  227. package/dist/css/data-list.css +2 -0
  228. package/dist/css/data-table.css +2 -0
  229. package/dist/css/flex.css +2 -0
  230. package/dist/css/floating-action-button.css +2 -0
  231. package/dist/css/gallery.css +2 -0
  232. package/dist/css/gauge-chart.css +2 -0
  233. package/dist/css/heatmap-chart.css +2 -0
  234. package/dist/css/hover-card.css +2 -0
  235. package/dist/css/how-to-steps.css +2 -0
  236. package/dist/css/line-chart.css +2 -0
  237. package/dist/css/meter.css +2 -0
  238. package/dist/css/mockup.css +2 -0
  239. package/dist/css/pie-chart.css +2 -0
  240. package/dist/css/portal.css +2 -0
  241. package/dist/css/scatter-chart.css +2 -0
  242. package/dist/css/scroll-area.css +2 -0
  243. package/dist/css/show.css +2 -0
  244. package/dist/css/sparkline.css +2 -0
  245. package/dist/css/stack.css +2 -0
  246. package/dist/css/timeline-chart.css +2 -0
  247. package/dist/css/tour.css +2 -0
  248. package/dist/css/tree-select.css +2 -0
  249. package/dist/css/window-pane.css +2 -0
  250. package/dist/hooks/index.d.ts +6 -0
  251. package/dist/hooks/index.js +1 -1
  252. package/dist/hooks/usePlBreakpoint.d.ts +3 -0
  253. package/dist/hooks/usePlBreakpoint.js +1 -1
  254. package/dist/hooks/usePlDisclosure.d.ts +44 -0
  255. package/dist/hooks/usePlDisclosure.js +1 -0
  256. package/dist/hooks/usePlElementSize.d.ts +31 -0
  257. package/dist/hooks/usePlElementSize.js +1 -0
  258. package/dist/hooks/usePlOnScreen.d.ts +50 -0
  259. package/dist/hooks/usePlOnScreen.js +1 -0
  260. package/dist/index.d.ts +34 -1
  261. package/dist/index.js +1 -1
  262. package/dist/internal/animate.d.ts +91 -5
  263. package/dist/internal/animate.js +1 -1
  264. package/dist/internal/breakpoints.d.ts +31 -0
  265. package/dist/internal/breakpoints.js +1 -0
  266. package/dist/internal/button-group.d.ts +29 -2
  267. package/dist/internal/button-group.js +2 -2
  268. package/dist/internal/calendar.d.ts +11 -36
  269. package/dist/internal/calendar.js +1 -1
  270. package/dist/internal/chart-frame.d.ts +458 -0
  271. package/dist/internal/chart-frame.js +1 -0
  272. package/dist/internal/chart-line.d.ts +44 -0
  273. package/dist/internal/chart-line.js +1 -0
  274. package/dist/internal/chart.d.ts +473 -0
  275. package/dist/internal/chart.js +1 -0
  276. package/dist/internal/data-table.d.ts +69 -0
  277. package/dist/internal/data-table.js +1 -0
  278. package/dist/internal/defaults.d.ts +8 -3
  279. package/dist/internal/drag.d.ts +49 -0
  280. package/dist/internal/drag.js +1 -0
  281. package/dist/internal/format.d.ts +2 -0
  282. package/dist/internal/format.js +1 -1
  283. package/dist/internal/gallery.d.ts +34 -0
  284. package/dist/internal/gallery.js +1 -0
  285. package/dist/internal/grid.d.ts +6 -27
  286. package/dist/internal/grid.js +1 -1
  287. package/dist/internal/highlight.d.ts +98 -0
  288. package/dist/internal/highlight.js +1 -0
  289. package/dist/internal/icons.d.ts +10 -0
  290. package/dist/internal/icons.js +1 -1
  291. package/dist/internal/labels.d.ts +138 -0
  292. package/dist/internal/labels.js +1 -0
  293. package/dist/internal/mockup.d.ts +193 -0
  294. package/dist/internal/mockup.js +1 -0
  295. package/dist/internal/page-layout.js +1 -1
  296. package/dist/internal/progress.d.ts +6 -0
  297. package/dist/internal/responsive.d.ts +108 -0
  298. package/dist/internal/responsive.js +1 -0
  299. package/dist/internal/scramble.d.ts +31 -0
  300. package/dist/internal/scramble.js +1 -0
  301. package/dist/internal/styles.d.ts +15 -0
  302. package/dist/internal/styles.js +1 -1
  303. package/dist/internal/table.d.ts +86 -0
  304. package/dist/internal/table.js +1 -0
  305. package/dist/internal/threshold.d.ts +19 -0
  306. package/dist/internal/threshold.js +1 -0
  307. package/dist/internal/tour.d.ts +42 -0
  308. package/dist/internal/tour.js +1 -0
  309. package/dist/internal/window.d.ts +201 -0
  310. package/dist/internal/window.js +1 -0
  311. package/dist/locales/de.d.ts +3 -0
  312. package/dist/locales/de.js +1 -0
  313. package/dist/locales/en.d.ts +2 -0
  314. package/dist/locales/en.js +1 -0
  315. package/dist/locales/es.d.ts +3 -0
  316. package/dist/locales/es.js +1 -0
  317. package/dist/locales/fr.d.ts +3 -0
  318. package/dist/locales/fr.js +1 -0
  319. package/dist/locales/index.d.ts +33 -0
  320. package/dist/locales/index.js +1 -0
  321. package/dist/locales/ja.d.ts +3 -0
  322. package/dist/locales/ja.js +1 -0
  323. package/dist/locales/ko.d.ts +3 -0
  324. package/dist/locales/ko.js +1 -0
  325. package/dist/locales/zh-Hans.d.ts +3 -0
  326. package/dist/locales/zh-Hans.js +1 -0
  327. package/dist/provider/index.d.ts +1 -0
  328. package/dist/provider/index.js +1 -1
  329. package/dist/styles.css +1 -1
  330. package/dist/tailwind.css +1104 -19
  331. package/dist/tokens.css +1104 -19
  332. package/dist/types.d.ts +381 -2
  333. package/package.json +14 -4
  334. package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
  335. package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
  336. package/dist/components/avatar-group/index.d.ts +0 -2
  337. package/dist/components/avatar-group/index.js +0 -1
  338. package/dist/css/avatar-group.css +0 -2
  339. package/dist/internal/avatar-group.d.ts +0 -25
  340. package/dist/internal/avatar-group.js +0 -2
@@ -1 +1 @@
1
- "use client";import*as e from"react";import{useMediaQuery as t}from"./media.js";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);const n={xs:null,sm:"(width < 40rem)",md:"(width < 48rem)",lg:"(width < 64rem)",xl:"(width < 80rem)"};export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(e){return t("none"===e?null:n[e])}export function drawerSide(e){const t="undefined"!=typeof document&&"rtl"===getComputedStyle(document.documentElement).direction;return"start"===e?t?"right":"left":t?"left":"right"}
1
+ "use client";import*as e from"react";import{belowQuery as n}from"./breakpoints.js";import{useMediaQuery as t}from"./media.js";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(e){return t("none"===e?null:function collapseQuery(e){return"xs"===e?null:n(e)}(e))}export function drawerSide(e){const n="undefined"!=typeof document&&"rtl"===getComputedStyle(document.documentElement).direction;return"start"===e?n?"right":"left":n?"left":"right"}
@@ -8,6 +8,12 @@
8
8
  *
9
9
  * What is left in each component is the shape, which is the point: it is the
10
10
  * only thing that genuinely differs.
11
+ *
12
+ * `PlMeter` borrows the groove, the thickness ladder, the fill slots and the
13
+ * clamp from here without being one of the three. It is the same channel cut
14
+ * into the same surface; what it reports is a quantity that is already known
15
+ * rather than something advancing, which is why it keeps its own props and its
16
+ * own role.
11
17
  */
12
18
  import type * as React from 'react';
13
19
  import type { PlassColor, PlassSize } from '../types.js';
@@ -0,0 +1,108 @@
1
+ /**
2
+ * The one shape a value takes when it changes with the width of the window, and
3
+ * the one way it reaches CSS.
4
+ *
5
+ * It started as `PlGrid`'s private arithmetic and is here because a second
6
+ * component wanted it — and because the *rule* is the interesting part, not the
7
+ * code: a bare value applies everywhere, a map applies each entry from its own
8
+ * breakpoint up, and a rung that was not named inherits the one below it.
9
+ * `usePlBreakpointValue` resolves the same shape in JavaScript, so a caller who
10
+ * has learned it once has learned all of it.
11
+ *
12
+ * ## Where the resolving happens, and why it is two places
13
+ *
14
+ * A responsive value that only decides **style** is resolved in **CSS**:
15
+ * `responsiveSlots` writes one `--p-{name}-{rung}` per rung the caller named,
16
+ * and the `@variant` blocks in `styles.css` cascade each slot down from the
17
+ * rung above. That is what `PlGrid` and `PlContainer` use, and what makes them
18
+ * free: no resize listener, no re-render, and a server render that is already
19
+ * correct at every width because the browser resolves it.
20
+ *
21
+ * A responsive value that decides **structure** cannot be: an orientation
22
+ * changes which DOM a component builds, which ARIA it claims, and which way its
23
+ * arrow keys go, and no stylesheet can do that. Those resolve in JavaScript
24
+ * through `usePlBreakpointValue`, and pay what that costs — the server renders
25
+ * the `xs` entry and the browser corrects it on hydration.
26
+ *
27
+ * The split is not a compromise between the two; it is the honest line. A
28
+ * component should reach for the CSS half whenever it can.
29
+ */
30
+ import type * as React from 'react';
31
+ import type { PlassBreakpoint, PlassResponsive, PlassSize } from '../types.js';
32
+ /** Smallest first, which is also the order the media queries have to be in. */
33
+ export declare const breakpoints: readonly PlassBreakpoint[];
34
+ /** A bare value means "from `xs` up"; a map is already per-breakpoint. */
35
+ export declare function breakpointMap<T>(value: PlassResponsive<T> | undefined): Partial<Record<PlassBreakpoint, T>>;
36
+ /** Whether a value is a per-breakpoint map rather than one answer for all of them. */
37
+ export declare function isResponsiveMap<T>(value: PlassResponsive<T> | undefined): boolean;
38
+ /**
39
+ * A responsive value at one rung of the ladder.
40
+ *
41
+ * Walks **down** from that rung rather than up from `xs`: the nearest entry at
42
+ * or below the window is the one that applies, and walking down finds it
43
+ * without having to know which rungs were named.
44
+ *
45
+ * `undefined` when the map named no rung at or below — `{ lg: 3 }` on a phone
46
+ * is not `3`, and guessing a value the caller did not write would be worse than
47
+ * saying so.
48
+ */
49
+ export declare function resolveAt<T>(value: PlassResponsive<T> | undefined, at: PlassBreakpoint): T | undefined;
50
+ /**
51
+ * A responsive prop a component has to resolve **itself**, with its own default
52
+ * behind it.
53
+ *
54
+ * For the props CSS cannot decide: an orientation changes which DOM a component
55
+ * builds, which ARIA it claims and which way its arrow keys go, and no
56
+ * stylesheet can do any of that. The cost is the one every JavaScript answer
57
+ * about width pays — a server renders the `xs` entry and the browser corrects
58
+ * it on hydration — which is why a prop that only decides *style* should use
59
+ * `responsiveSlots` instead and never come here.
60
+ *
61
+ * **A bare value subscribes to nothing.** `useMediaQuery(null)` is a hook that
62
+ * adds no listener, so a component whose orientation is one word costs exactly
63
+ * what it cost before this existed: the four queries are only asked when there
64
+ * is a map to answer with. Twenty tab bars on a page that never change shape
65
+ * install no listeners between them.
66
+ */
67
+ export declare function useResponsiveValue<T>(value: PlassResponsive<T> | undefined, fallback: T): T;
68
+ /**
69
+ * Turns a responsive value into the `--p-{name}-{breakpoint}` slots the CSS
70
+ * reads, emitting only the breakpoints the caller actually named.
71
+ *
72
+ * The gaps are filled in by CSS rather than here: each breakpoint's rule falls
73
+ * back through the ones below it, so `{ md: 6 }` needs one slot and not five.
74
+ * That keeps the inline style on a grid item down to what was asked for.
75
+ */
76
+ export declare function responsiveSlots<T>(name: string, value: PlassResponsive<T> | undefined, toCss: (value: T) => string): React.CSSProperties;
77
+ /**
78
+ * Fills in the `xs` entry of a partial map with the prop's own default.
79
+ *
80
+ * Without this, `spacing={{ md: 4 }}` would be a grid with no gutter at all
81
+ * below 48rem — the CSS fallback rather than the documented default — and a
82
+ * caller who narrowed one breakpoint would silently lose every other one. A map
83
+ * says "from here up, use this instead"; it does not say "and nothing below".
84
+ */
85
+ export declare function withBaseline<T>(value: PlassResponsive<T> | undefined, baseline: T): PlassResponsive<T>;
86
+ /**
87
+ * How wide content is allowed to get, and the three components that ask.
88
+ *
89
+ * A rung of the ladder, `none`, a number of pixels, or any CSS length. The
90
+ * `string & {}` half is what keeps the five rungs autocompleting: a bare
91
+ * `string` in the union would swallow them and the ladder would be five names a
92
+ * caller has to remember rather than five an editor offers.
93
+ */
94
+ export type PlassMeasure = PlassSize | 'none' | number | (string & {});
95
+ /** A rung if it is one of the five, `none` as itself, anything else a length. */
96
+ export declare function measureValue(value: PlassMeasure): string;
97
+ /**
98
+ * The class and the slots a measure is carried by, or nothing at all.
99
+ *
100
+ * `PlContainer`, `PlHeader` and `PlFooter` each hold their content to a measure
101
+ * and each used to carry a copy of the ladder. One implementation, because they
102
+ * are one decision written three times — a header whose measure did not line up
103
+ * with the container under it is the defect this prevents.
104
+ */
105
+ export declare function measureSlots(value: PlassResponsive<PlassMeasure> | undefined): {
106
+ className: string;
107
+ style: React.CSSProperties | undefined;
108
+ };
@@ -0,0 +1 @@
1
+ import{fromQuery as e}from"./breakpoints.js";import{useMediaQuery as o}from"./media.js";import{toLength as t}from"./styles.js";export const breakpoints=["xs","sm","md","lg","xl"];export function breakpointMap(e){return null==e?{}:"object"==typeof e?e:{xs:e}}export function isResponsiveMap(e){return null!=e&&"object"==typeof e}export function resolveAt(e,o){const t=breakpointMap(e);for(let e=breakpoints.indexOf(o);e>=0;e-=1){const o=t[breakpoints[e]];if(void 0!==o)return o}}export function useResponsiveValue(t,n){const s=isResponsiveMap(t),r=o(s?e("sm"):null),i=o(s?e("md"):null),l=o(s?e("lg"):null),p=o(s?e("xl"):null);return s?resolveAt(t,p?"xl":l?"lg":i?"md":r?"sm":"xs")??n:t??n}export function responsiveSlots(e,o,t){const n=breakpointMap(o),s={};for(const o of breakpoints){const r=n[o];void 0!==r&&(s[`--p-${e}-${o}`]=t(r))}return s}export function withBaseline(e,o){return null==e?o:"object"==typeof e?{xs:o,...e}:e}const n={xs:"30rem",sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem"};export function measureValue(e){return"none"===e?"none":"string"==typeof e&&e in n?n[e]:t(e)}export function measureSlots(e){return void 0===e?{className:"",style:void 0}:{className:"plass-container",style:responsiveSlots("maxw",e,measureValue)}}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The arithmetic behind `PlAnimateScramble`, and the one decision in it worth
3
+ * writing down.
4
+ *
5
+ * **The pool a character is drawn from is the text's own characters**, not a
6
+ * table of Latin letters. Every scrambler that ships with a default alphabet
7
+ * ships an English one, and English noise over a Korean, Greek or Arabic
8
+ * headline is not a word resolving — it is a different script flickering where
9
+ * a word is about to be. Shuffling the string's own glyphs is script-agnostic
10
+ * for nothing, and it also keeps the line's colour and width steady, because
11
+ * every frame is drawn out of exactly the characters the finished line is made
12
+ * of.
13
+ *
14
+ * `characters` overrides it for the caller who genuinely wants a terminal look.
15
+ */
16
+ /** Everything in the text that is worth scrambling: no spaces, no repeats. */
17
+ export declare function poolOf(text: string): string;
18
+ /**
19
+ * The line as it looks part of the way through.
20
+ *
21
+ * `progress` is `0`…`1`, and what it decides is **how many characters have
22
+ * settled**, counted from the start. Resolving left to right rather than at
23
+ * random is what makes it read as a word arriving rather than as a slot
24
+ * machine: a reader can follow it, and a reader who looks away and back has not
25
+ * lost their place.
26
+ *
27
+ * Whitespace is never scrambled. The gaps between words are what makes a line
28
+ * of noise still look like a sentence, and a space that flickers into a letter
29
+ * changes the word count on every frame.
30
+ */
31
+ export declare function scrambleAt(text: string, pool: string, progress: number, seed: number): string;
@@ -0,0 +1 @@
1
+ export function poolOf(t){const o=new Set;for(const r of t)""!==r.trim()&&o.add(r);return Array.from(o).join("")}export function scrambleAt(t,o,r,n){const e=Array.from(t),a=Math.floor(e.length*Math.max(0,Math.min(1,r)));return 0===o.length?t:e.map((t,r)=>r<a||""===t.trim()?t:o[(31*r+17*n)%o.length]).join("")}
@@ -103,6 +103,14 @@ export declare const tickRadiusClasses: Record<PlassSize, string>;
103
103
  * So every dot here has the same parity as the ring's content box: 12/6, 14/6,
104
104
  * 16/8, 18/8, 22/10. The ratio wanders between 38% and 44% as a result, which
105
105
  * is the price, and it is invisible next to the thing it buys.
106
+ *
107
+ * **The dot grows out of the middle rather than appearing at full size**, so
108
+ * the size is a pair: nothing until the option is chosen, and the diameter
109
+ * above once it is. It is the box that grows and not a `scale` — the ring is a
110
+ * fixed-size flex centre, so the two values are laid out around the same point
111
+ * and nothing outside the ring can be moved by either of them. Both classes
112
+ * have to be written out here rather than composed at the call site, because
113
+ * Tailwind only generates a utility it has seen spelled out in a source file.
106
114
  */
107
115
  export declare const tickDotClasses: Record<PlassSize, string>;
108
116
  /**
@@ -203,6 +211,13 @@ export declare const glassClasses = "[backdrop-filter:var(--plass-blur)] [-webki
203
211
  * is in the list because a gradient fill is the thing being changed on a solid
204
212
  * surface, and `filter` because that is what hover and press actually move.
205
213
  *
214
+ * `opacity` is in it because half the library already writes an opacity as a
215
+ * *state*: `opacity-50` is what disabled looks like everywhere, a `PlBackTop`
216
+ * appears and goes on `opacity-0`, and a `PlImage` uncovers itself the moment
217
+ * the picture decodes. Without it in the list every one of those is a value
218
+ * that changes between two frames, which is the one thing the house transition
219
+ * exists to prevent.
220
+ *
206
221
  * There is no `transform` in the list and none should be added to a *control*:
207
222
  * scaling a key resamples its label, and text that shimmers under the cursor
208
223
  * undoes the restraint everything else is spending effort on. A surface that
@@ -1 +1 @@
1
- export const radiusClasses={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-sm)",md:"rounded-(--plass-radius-md)",lg:"rounded-(--plass-radius-lg)",xl:"rounded-(--plass-radius-xl)"};export const controlHeightClasses={xs:"h-6",sm:"h-8",md:"h-10",lg:"h-12",xl:"h-14"};export const controlSquareClasses={xs:"w-6",sm:"w-8",md:"w-10",lg:"w-12",xl:"w-14"};export const controlTextClasses={xs:"text-[0.6875rem]",sm:"text-[0.8125rem]",md:"text-[0.875rem]",lg:"text-[1rem]",xl:"text-[1.125rem]"};export const controlTextLeadingClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.875rem]/[1.25rem]",lg:"text-[1rem]/[1.5rem]",xl:"text-[1.125rem]/[1.75rem]"};export const metaTextClasses={xs:"text-[0.625rem]",sm:"text-[0.6875rem]",md:"text-[0.75rem]",lg:"text-[0.8125rem]",xl:"text-[0.875rem]"};export const paddingXClasses={default:{xs:"px-2.5",sm:"px-3",md:"px-4",lg:"px-6",xl:"px-7"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3.5",xl:"px-4"}};export const iconSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-5",lg:"size-6",xl:"size-7"};export const tickSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const tickRadiusClasses={xs:"rounded-[0.25rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"};export const tickDotClasses={xs:"size-1.5",sm:"size-1.5",md:"size-2",lg:"size-2",xl:"size-2.5"};export const tickRowTextClasses=controlTextLeadingClasses;export const paddingXValues={default:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.5rem",xl:"1.75rem"},compact:{xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.875rem",xl:"1rem"}};export const gapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const stackGapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-1.5",lg:"gap-2",xl:"gap-2"};export const sheetPaddingXClasses={default:{xs:"px-2.5",sm:"px-3.5",md:"px-5",lg:"px-6",xl:"px-7"},compact:{xs:"px-2",sm:"px-2.5",md:"px-3.5",lg:"px-4",xl:"px-5"}};export const sheetPaddingYClasses={default:{xs:"py-2.5",sm:"py-3.5",md:"py-5",lg:"py-6",xl:"py-7"},compact:{xs:"py-2",sm:"py-2.5",md:"py-3.5",lg:"py-4",xl:"py-5"}};export const sheetTitleClasses={xs:"text-[0.75rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.9375rem]/[1.25rem]",lg:"text-[1.0625rem]/[1.5rem]",xl:"text-[1.25rem]/[1.75rem]"};export const sheetBodyClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.75rem]/[1.125rem]",md:"text-[0.8125rem]/[1.375rem]",lg:"text-[0.9375rem]/[1.5rem]",xl:"text-[1.0625rem]/[1.75rem]"};export const sheetSectionGapClasses={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const sheetLineClasses="border-t [border-color:var(--plass-divider)]";export const sheetHeaderGapClasses={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const glassClasses="[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]";export const transitionClasses=/* @__PURE__ */["[transition-property:background-color,background-image,border-color,box-shadow,color,filter]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ");export const focusRingClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:0px]";export const focusWithinRingClasses="has-[:focus-visible]:[outline:2px_solid_var(--p-ring)] has-[:focus-visible]:[outline-offset:0px]";export const focusRingInsetClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]";export const chipRemoveClasses=/* @__PURE__ */["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","size-[1.15em] cursor-pointer opacity-70","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","hover:opacity-100 focus-visible:opacity-100",focusRingClasses,"disabled:cursor-not-allowed"].join(" ");export const iconClasses="[&_svg]:pointer-events-none [&_svg]:size-[1.2em] [&_svg]:shrink-0";export const srOnlyClasses="absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";export function controlSlots(s,e,a){const r="solid"===a;return{"--p-fill":`var(--plass-${s}-fill)`,"--p-on-solid":`var(--plass-${s}-on-solid)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-tint":`var(--plass-${s}-tint)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-glow":r?"var(--plass-glow-on-fill)":`var(--plass-${s}-soft)`,"--p-flash":r?"var(--plass-flash-on-fill)":`var(--plass-${s}-soft-hover)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`,"--p-lift":"0 6px 16px -4px var(--p-tint)","--p-lift-hover":"0 10px 24px -6px var(--p-tint)","--p-lift-press":"0 2px 6px -2px var(--p-tint)"}}export function surfaceSlots(s,e){return{"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`}}export const disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),glass:/* @__PURE__ */[glassClasses,"cursor-not-allowed border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-border)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),ghost:"cursor-not-allowed bg-transparent text-(--p-accent) opacity-50 saturate-[0.35]"};export const readOnlyFilterClasses="saturate-[0.55]";export const sheetRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-transparent"};export const fieldRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-well)]","hover:bg-(--plass-glass-hover)","focus-within:bg-(--plass-glass-press)"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]","hover:bg-(--plass-glass-press) hover:[border-color:var(--p-line)]","focus-within:bg-(--plass-glass-press) focus-within:[border-color:var(--p-line-hover)]"].join(" "),ghost:/* @__PURE__ */["text-(--plass-fg) bg-transparent","hover:bg-(--p-soft)","focus-within:bg-(--p-soft-hover)"].join(" ")};export const fieldReadOnlyClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--plass-well)] saturate-[0.55]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--plass-gloss-glass)] saturate-[0.55]"].join(" "),ghost:"text-(--plass-fg) bg-transparent saturate-[0.55]"};export function toLength(s){return"number"==typeof s?`${s}px`:s}export function hasContent(s){return null!=s&&!1!==s&&""!==s}export function cx(...s){return s.filter(Boolean).join(" ")}
1
+ export const radiusClasses={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-sm)",md:"rounded-(--plass-radius-md)",lg:"rounded-(--plass-radius-lg)",xl:"rounded-(--plass-radius-xl)"};export const controlHeightClasses={xs:"h-6",sm:"h-8",md:"h-10",lg:"h-12",xl:"h-14"};export const controlSquareClasses={xs:"w-6",sm:"w-8",md:"w-10",lg:"w-12",xl:"w-14"};export const controlTextClasses={xs:"text-[0.6875rem]",sm:"text-[0.8125rem]",md:"text-[0.875rem]",lg:"text-[1rem]",xl:"text-[1.125rem]"};export const controlTextLeadingClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.875rem]/[1.25rem]",lg:"text-[1rem]/[1.5rem]",xl:"text-[1.125rem]/[1.75rem]"};export const metaTextClasses={xs:"text-[0.625rem]",sm:"text-[0.6875rem]",md:"text-[0.75rem]",lg:"text-[0.8125rem]",xl:"text-[0.875rem]"};export const paddingXClasses={default:{xs:"px-2.5",sm:"px-3",md:"px-4",lg:"px-6",xl:"px-7"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3.5",xl:"px-4"}};export const iconSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-5",lg:"size-6",xl:"size-7"};export const tickSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const tickRadiusClasses={xs:"rounded-[0.25rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"};export const tickDotClasses={xs:"size-0 data-[checked]:size-1.5",sm:"size-0 data-[checked]:size-1.5",md:"size-0 data-[checked]:size-2",lg:"size-0 data-[checked]:size-2",xl:"size-0 data-[checked]:size-2.5"};export const tickRowTextClasses=controlTextLeadingClasses;export const paddingXValues={default:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.5rem",xl:"1.75rem"},compact:{xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.875rem",xl:"1rem"}};export const gapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const stackGapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-1.5",lg:"gap-2",xl:"gap-2"};export const sheetPaddingXClasses={default:{xs:"px-2.5",sm:"px-3.5",md:"px-5",lg:"px-6",xl:"px-7"},compact:{xs:"px-2",sm:"px-2.5",md:"px-3.5",lg:"px-4",xl:"px-5"}};export const sheetPaddingYClasses={default:{xs:"py-2.5",sm:"py-3.5",md:"py-5",lg:"py-6",xl:"py-7"},compact:{xs:"py-2",sm:"py-2.5",md:"py-3.5",lg:"py-4",xl:"py-5"}};export const sheetTitleClasses={xs:"text-[0.75rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.9375rem]/[1.25rem]",lg:"text-[1.0625rem]/[1.5rem]",xl:"text-[1.25rem]/[1.75rem]"};export const sheetBodyClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.75rem]/[1.125rem]",md:"text-[0.8125rem]/[1.375rem]",lg:"text-[0.9375rem]/[1.5rem]",xl:"text-[1.0625rem]/[1.75rem]"};export const sheetSectionGapClasses={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const sheetLineClasses="border-t [border-color:var(--plass-divider)]";export const sheetHeaderGapClasses={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const glassClasses="[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]";export const transitionClasses=/* @__PURE__ */["[transition-property:background-color,background-image,border-color,box-shadow,color,filter,opacity]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ");export const focusRingClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:0px]";export const focusWithinRingClasses="has-[:focus-visible]:[outline:2px_solid_var(--p-ring)] has-[:focus-visible]:[outline-offset:0px]";export const focusRingInsetClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]";export const chipRemoveClasses=/* @__PURE__ */["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","size-[1.15em] cursor-pointer opacity-70","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","hover:opacity-100 focus-visible:opacity-100",focusRingClasses,"disabled:cursor-not-allowed"].join(" ");export const iconClasses="[&_svg]:pointer-events-none [&_svg]:size-[1.2em] [&_svg]:shrink-0";export const srOnlyClasses="absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";export function controlSlots(s,e,a){const t="solid"===a;return{"--p-fill":`var(--plass-${s}-fill)`,"--p-on-solid":`var(--plass-${s}-on-solid)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-tint":`var(--plass-${s}-tint)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-glow":t?"var(--plass-glow-on-fill)":`var(--plass-${s}-soft)`,"--p-flash":t?"var(--plass-flash-on-fill)":`var(--plass-${s}-soft-hover)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`,"--p-lift":"0 6px 16px -4px var(--p-tint)","--p-lift-hover":"0 10px 24px -6px var(--p-tint)","--p-lift-press":"0 2px 6px -2px var(--p-tint)"}}export function surfaceSlots(s,e){return{"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`}}export const disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),glass:/* @__PURE__ */[glassClasses,"cursor-not-allowed border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-border)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),ghost:"cursor-not-allowed bg-transparent text-(--p-accent) opacity-50 saturate-[0.35]"};export const readOnlyFilterClasses="saturate-[0.55]";export const sheetRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-transparent"};export const fieldRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-well)]","hover:bg-(--plass-glass-hover)","focus-within:bg-(--plass-glass-press)"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]","hover:bg-(--plass-glass-press) hover:[border-color:var(--p-line)]","focus-within:bg-(--plass-glass-press) focus-within:[border-color:var(--p-line-hover)]"].join(" "),ghost:/* @__PURE__ */["text-(--plass-fg) bg-transparent","hover:bg-(--p-soft)","focus-within:bg-(--p-soft-hover)"].join(" ")};export const fieldReadOnlyClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--plass-well)] saturate-[0.55]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--plass-gloss-glass)] saturate-[0.55]"].join(" "),ghost:"text-(--plass-fg) bg-transparent saturate-[0.55]"};export function toLength(s){return"number"==typeof s?`${s}px`:s}export function hasContent(s){return null!=s&&!1!==s&&""!==s}export function cx(...s){return s.filter(Boolean).join(" ")}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The ink a table is drawn with, and the reason two components share it.
3
+ *
4
+ * `PlTable` draws a grid it is given; `PlDataTable` sorts, filters and pages
5
+ * its own rows and then draws one. They are two components because the second
6
+ * has to call hooks and the first must not — a table whose every column is a
7
+ * `render` callback is the one component in this library that a React server
8
+ * component has to be able to render, and reading a context would take that
9
+ * away. Two components drawing the same grid out of two copies of these
10
+ * constants is how the rules under a sorted table end up a shade off the rules
11
+ * under a plain one.
12
+ */
13
+ import type * as React from 'react';
14
+ import type { PlassDensity, PlassSize } from '../types.js';
15
+ /**
16
+ * Row height, as vertical padding — and, like the horizontal track, a raw
17
+ * length rather than a class. See the note on `paddingXValues`.
18
+ */
19
+ export declare const cellPaddingYValues: Record<PlassDensity, Record<PlassSize, string>>;
20
+ /**
21
+ * Everything a table is painted with is written inline, `<table>` included.
22
+ *
23
+ * This is the one component in the library that has to do that, and the reason
24
+ * is the elements it renders. A PlButton owns its `<button>`; nobody else
25
+ * styles it. `<table>`, `<th>` and `<td>` are different — VitePress's
26
+ * `.vp-doc table`, Tailwind Typography's `.prose td` and every CSS framework in
27
+ * existence style them by tag name, at two-class specificity that a one-class
28
+ * Tailwind utility cannot outrank.
29
+ *
30
+ * Padding and alignment were already written inline for that reason. **The
31
+ * borders, the display mode and the margins were not**, and that omission was
32
+ * most of what a Plass table looked like on a documentation page: the host's
33
+ * `td { border: 1px solid }` drew a full grid of cell rules the design never
34
+ * asked for, its `table { display: block }` stopped `width: 100%` filling the
35
+ * sheet, and its `table { margin: 20px 0 }` pushed the whole thing off the
36
+ * top-left corner of the pane it is supposed to be flush inside. A grid of
37
+ * boxed cells floating inside a rounded sheet is not a restrained table with a
38
+ * problem — it is somebody else's table wearing this one's frame.
39
+ *
40
+ * So every cell states `border: 0` and then draws the one rule it actually
41
+ * wants, and the `<table>` states the four properties a prose stylesheet is
42
+ * known to take off it. It is verbose, and it is the only way the component
43
+ * looks the same in a bare app and inside `.prose`.
44
+ *
45
+ * What is *not* inline is the row's own background, because it has a hover
46
+ * state and inline styles have no `:hover`. It reads a `--p-row` slot instead,
47
+ * which classes then set — a custom property is invisible to a host stylesheet,
48
+ * so a one-class variant wins there without a fight.
49
+ */
50
+ export declare const tableStyle: React.CSSProperties;
51
+ export declare const rowClasses: string;
52
+ /**
53
+ * What a row that answers a press needs beyond the pointer treatment.
54
+ *
55
+ * `tabIndex` is the whole point: a row whose only way in is `onClick` is a
56
+ * control a keyboard cannot reach at all, and `cursor-pointer` advertises it as
57
+ * one anyway. The ring is inset rather than offset, because the sheet clips at
58
+ * its own rounded edge and an outline drawn outside the first or last row is an
59
+ * outline with its top or bottom sliced off.
60
+ *
61
+ * The `role` is deliberately left alone. `role="button"` on a `<tr>` reads well
62
+ * in isolation and takes the row semantics off it — which orphans every `<td>`
63
+ * inside from the table they belong to, and costs a screen reader the column
64
+ * headers, the row position and the count.
65
+ */
66
+ export declare const clickableRowClasses: string;
67
+ /**
68
+ * Two weights of rule, and the whole of the table's structure.
69
+ *
70
+ * `--plass-divider` scores one row off the next, the same ink a PlCard and a
71
+ * PlList are scored with, so a table on a card and the card's own dividers are
72
+ * one family of lines. The header sits on `--plass-border`, one step firmer,
73
+ * because the break between the names of the columns and the data in them is
74
+ * the one division a reader has to find without looking for it.
75
+ *
76
+ * Both are neutral inks rather than the `--plass-glass-line` this used to use.
77
+ * That line is white, and a white rule between two rows of a white sheet is
78
+ * not a rule — which is why the table had no visible structure of its own in
79
+ * light mode, and why it looked like whatever grid the host page happened to
80
+ * be drawing over it.
81
+ *
82
+ * They are on the *cells* rather than on the `<tr>`, which is where a rule can
83
+ * be written inline and therefore where a host stylesheet cannot reach it.
84
+ */
85
+ export declare const rowRule = "1px solid var(--plass-divider)";
86
+ export declare const headRule = "1px solid var(--plass-border)";
@@ -0,0 +1 @@
1
+ import{focusRingInsetClasses as r}from"./styles.js";export const cellPaddingYValues={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"}};export const tableStyle={display:"table",width:"100%",margin:0,borderCollapse:"collapse",borderSpacing:0};export const rowClasses=/* @__PURE__ */["[--p-row:transparent]","[transition:background-color_var(--plass-duration)_var(--plass-ease)]"].join(" ");export const clickableRowClasses=/* @__PURE__ */["cursor-pointer [outline:none]",r].join(" ");export const rowRule="1px solid var(--plass-divider)";export const headRule="1px solid var(--plass-border)";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Which band a reading has landed in.
3
+ *
4
+ * One rule, shared by the two components that draw a value against a scale a
5
+ * caller described: `PlMeter`'s bar and `PlGaugeChart`'s arc. Written twice
6
+ * they would drift, and a quota that turns `danger` on a bar but not on the
7
+ * dial beside it is a dashboard that contradicts itself.
8
+ */
9
+ import type { PlassColor, PlassThreshold } from '../types.js';
10
+ /**
11
+ * The family a value lands in.
12
+ *
13
+ * The highest band at or below the value, or `color` when the value is under
14
+ * all of them. One pass rather than a sort, because the list is small and
15
+ * sorting a caller's array — or a copy of it on every render — buys nothing.
16
+ * Reading it rather than walking it in order is also what makes the prop
17
+ * order-independent, which is what a caller assumes.
18
+ */
19
+ export declare function bandColor(value: number, color: PlassColor, thresholds: readonly PlassThreshold[] | undefined): PlassColor;
@@ -0,0 +1 @@
1
+ export function bandColor(o,r,f){if(!f?.length)return r;let n;for(const r of f)o>=r.from&&(void 0===n||r.from>n.from)&&(n=r);return n?.color??r}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The geometry a spotlight is cut out of, as arithmetic rather than as a
3
+ * component.
4
+ *
5
+ * A tour dims the page and takes one thing out of the dimming. Everything hard
6
+ * about that is a rectangle and a rounded corner, so it is here: it can be read
7
+ * without a browser, tested without one, and it is the same shape the Flutter
8
+ * build punches with `Path.combine`.
9
+ */
10
+ /** Where the thing being pointed at is, in viewport coordinates. */
11
+ export interface PlassSpot {
12
+ top: number;
13
+ left: number;
14
+ width: number;
15
+ height: number;
16
+ }
17
+ /** A rectangle grown by [padding] on every side, never to a negative size. */
18
+ export declare function inflate(rect: PlassSpot, padding: number): PlassSpot;
19
+ /**
20
+ * The whole scrim with a hole in it, as a `clip-path` value.
21
+ *
22
+ * A clip and not a shadow, and that is the decision the whole component rests
23
+ * on. The obvious way to draw a hole is one element the size of the target
24
+ * carrying a box shadow larger than any screen; it works, and it buys nothing
25
+ * else. A clip buys two things that matter:
26
+ *
27
+ * **The dimming can blur.** A `box-shadow` paints a colour. A clipped element
28
+ * can carry a `backdrop-filter`, so the page around the spotlight is blurred as
29
+ * well as dimmed — which is this library's own material rather than a grey wash
30
+ * over it.
31
+ *
32
+ * **The hole is a hole for the pointer too.** A clipped-away region is not
33
+ * hit-tested, so the scrim can take the pointer everywhere it is painted and
34
+ * nowhere it is not. The reader can use the control being pointed at and
35
+ * nothing else, which is what separates a tour from a dialog with a picture of
36
+ * a control in it — and it falls out of the geometry rather than being a second
37
+ * mechanism that has to agree with it.
38
+ *
39
+ * `null` is a step with no target: the whole page dims and nothing is cut out,
40
+ * which is what a welcome step and a closing step are.
41
+ */
42
+ export declare function spotlightPath(spot: PlassSpot | null, radius: number): string;
@@ -0,0 +1 @@
1
+ export function inflate(t,$){return{top:t.top-$,left:t.left-$,width:Math.max(0,t.width+2*$),height:Math.max(0,t.height+2*$)}}export function spotlightPath(t,$){const h="M0,0H100000V100000H0Z";return null===t||t.width<=0||t.height<=0?`path(evenodd,'${h}')`:`path(evenodd,'${h}${function roundedRect(t,$){const{top:h,left:e,width:n,height:i}=t,o=Math.max(0,Math.min($,n/2,i/2));return 0===o?`M${e},${h}H${e+n}V${h+i}H${e}Z`:`M${e+o},${h}H${e+n-o}A${o},${o} 0 0 1 ${e+n},${h+o}V${h+i-o}A${o},${o} 0 0 1 ${e+n-o},${h+i}H${e+o}A${o},${o} 0 0 1 ${e},${h+i-o}V${h+o}A${o},${o} 0 0 1 ${e+o},${h}Z`}(t,$)}')`}
@@ -0,0 +1,201 @@
1
+ /**
2
+ * The chrome a `PlWindowPane` draws, and the tables that say how big it is.
3
+ *
4
+ * It lives here for the reason `internal/mockup.tsx` does. One component reads
5
+ * it, but what it holds is reference data rather than a piece of that component
6
+ * — four systems' worth of title bars, three buttons each, drawn four different
7
+ * ways — and a component file with all of that in it would be a table with a
8
+ * `forwardRef` at the bottom.
9
+ *
10
+ * Three conventions run through it:
11
+ *
12
+ * **Every length is a CSS pixel at `md`, scaled once by `size`.** A title bar is
13
+ * 32px on Windows 11 and 38px on macOS because those are the heights they are,
14
+ * not because a ladder in `internal/styles.ts` says so — this is the one place
15
+ * in the library where the numbers come from somewhere else. `size` multiplies
16
+ * them, which is why they are written as numbers rather than as utilities.
17
+ *
18
+ * **The buttons are drawings of what they do and carry no other party's marks.**
19
+ * A traffic light is three circles; a Windows control is a line, a box and a
20
+ * cross. Their names come from `internal/labels.ts` and are read out; nothing here
21
+ * writes a word.
22
+ *
23
+ * **Nothing is mixed out of `currentColor`.** Every fill a control can take is a
24
+ * slot computed once in `windowSlots`, because a hover that changes the ink and
25
+ * a fill derived from the ink are the same declaration arguing with itself —
26
+ * which is exactly how a close button ends up white on white.
27
+ */
28
+ import * as React from 'react';
29
+ import type { PlassColor, PlassSize } from '../types.js';
30
+ /**
31
+ * Whose window this is a picture of.
32
+ *
33
+ * Versions are separate entries wherever the *title bar* is what changed, which
34
+ * is why Windows has five and the others have one or two. XP painted its bar in
35
+ * Luna blue and framed the window in it; 7 made it glass; 8 threw both away for
36
+ * a flat square sheet; 10 ruled the bar off from the body; 11 rounded the
37
+ * corners and made the two one Mica sheet again. `macosx` is Aqua — the striped
38
+ * grey bar, the glossy lights and the square bottom corners — against the flat
39
+ * `macos` that replaced it.
40
+ *
41
+ * They are named the way the systems are, so `windows11` rather than `win11`
42
+ * and `macos` rather than `mac`. Nothing here is a copy of any of them: what is
43
+ * drawn is a bar, a border and three buttons at the proportions the system used,
44
+ * and no mark, wordmark or icon belonging to anyone else.
45
+ */
46
+ export type PlWindowOs = 'macos' | 'macosx' | 'windows11' | 'windows10' | 'windows8' | 'windows7' | 'windowsxp' | 'linux';
47
+ /** The three buttons a title bar can carry. */
48
+ export type PlWindowControl = 'minimize' | 'maximize' | 'close';
49
+ /** How far the window has been dragged from where the layout put it. */
50
+ export interface PlWindowOffset {
51
+ x: number;
52
+ y: number;
53
+ }
54
+ /** Everything the component needs to lay a title bar out, in CSS pixels. */
55
+ export interface PlWindowMetrics {
56
+ /** The title bar's height. */
57
+ bar: number;
58
+ /** The window's own corner, at the top. */
59
+ radius: number;
60
+ /** And at the bottom, which the older systems leave square. */
61
+ radiusBottom: number;
62
+ /** The hairline around the window. */
63
+ frame: number;
64
+ /**
65
+ * The *band* around it, which is a different thing: the stretch of the
66
+ * system's own colour that XP and Aero put down the sides of a window and
67
+ * along the bottom of it, with the content inset into it. Zero on the systems
68
+ * that have only a hairline.
69
+ */
70
+ band: {
71
+ side: number;
72
+ bottom: number;
73
+ };
74
+ /** The air at the leading edge of the bar. */
75
+ padX: number;
76
+ /** And at the trailing edge, which is nothing where the buttons run to it. */
77
+ padEnd: number;
78
+ /** Between one control and the next. */
79
+ gap: number;
80
+ /** The title's type size. */
81
+ title: number;
82
+ /** One control's box. */
83
+ control: {
84
+ width: number;
85
+ height: number;
86
+ };
87
+ /** The mark inside it. */
88
+ glyph: number;
89
+ /** How heavy the title is written. */
90
+ weight: number;
91
+ /** How much room the whole set of them takes, given how many are drawn. */
92
+ controlsWidth: (count: number) => number;
93
+ /** Aero's close button, which is wider than the two beside it. */
94
+ closeWidth: number;
95
+ }
96
+ interface PlWindowChrome {
97
+ bar: number;
98
+ radius: number;
99
+ /** Square on every system before the corners were rounded all the way round. */
100
+ radiusBottom: number;
101
+ padX: number;
102
+ /** The air at the trailing end, which is nothing where the buttons run to it. */
103
+ padEnd: number;
104
+ gap: number;
105
+ title: number;
106
+ glyph: number;
107
+ weight: number;
108
+ frame: number;
109
+ band: {
110
+ side: number;
111
+ bottom: number;
112
+ };
113
+ control: {
114
+ width: number;
115
+ height: number;
116
+ };
117
+ /** Aero's close button is wider than the two beside it. */
118
+ closeWidth?: number;
119
+ /** Where the title sits along the bar. */
120
+ titleAlign: 'start' | 'center';
121
+ /** Which end the controls are on. */
122
+ controlsSide: 'start' | 'end';
123
+ /**
124
+ * How one control is drawn.
125
+ *
126
+ * - `dot` — a flat traffic light, and `gloss-dot` the same one with Aqua's
127
+ * highlight and ring on it.
128
+ * - `square` — a flat rectangle running to the corner of the window.
129
+ * - `plate` — XP's coloured, gradient-filled button.
130
+ * - `aero` — a pane of glass hung off the top edge, close first among equals.
131
+ * - `circle` — GNOME's small disc.
132
+ */
133
+ shape: 'dot' | 'gloss-dot' | 'square' | 'plate' | 'aero' | 'circle';
134
+ /** Whether the bar is ruled off from the body. */
135
+ rule: boolean;
136
+ /** How thick the glyphs are drawn. */
137
+ stroke: number;
138
+ /** The corner on the maximize box: Windows 11 rounds it, Windows 10 does not. */
139
+ boxRadius: number;
140
+ /** How much of the page's ink is stirred into the bar, in front and behind. */
141
+ tint: [number, number];
142
+ /** Whether an accented window carries the colour into its border as well. */
143
+ accentBorder: boolean;
144
+ /**
145
+ * The chrome's own colours, for the systems that painted their title bar
146
+ * rather than taking the page's.
147
+ *
148
+ * Fixed values rather than theme tokens, exactly as `PlMockup`'s finishes are:
149
+ * Luna blue is Luna blue on a page switched to dark, and a title bar that
150
+ * changed colour with the theme would be a drawing of the theme rather than
151
+ * of a window. `dark` says which way its own controls have to lighten.
152
+ */
153
+ paint: {
154
+ fill: string;
155
+ ink: string;
156
+ dark: boolean;
157
+ } | null;
158
+ /** What is laid over that fill: the gradient, the gloss, the stripes. */
159
+ image: string | null;
160
+ /** The title's own shadow — XP's hard one, Aero's glow, Aqua's emboss. */
161
+ shadow: string | null;
162
+ /** Whether the bar blurs what is behind it, which is what made Aero glass. */
163
+ glass: boolean;
164
+ }
165
+ export declare function windowMetrics(os: PlWindowOs, size: PlassSize): PlWindowMetrics;
166
+ export declare function windowChrome(os: PlWindowOs): PlWindowChrome;
167
+ export declare function orderControls(os: PlWindowOs, controls: readonly PlWindowControl[]): PlWindowControl[];
168
+ export declare function windowSlots(options: {
169
+ os: PlWindowOs;
170
+ color: PlassColor;
171
+ accent: boolean;
172
+ transparency: number;
173
+ active: boolean;
174
+ elevation: number;
175
+ }): React.CSSProperties;
176
+ export interface PlPlWindowControlsProps {
177
+ os: PlWindowOs;
178
+ metrics: PlWindowMetrics;
179
+ controls: readonly PlWindowControl[];
180
+ maximized: boolean;
181
+ active: boolean;
182
+ /** What each button is called, plus the word the maximize one takes once the
183
+ * window is maximized. */
184
+ labels: Record<PlWindowControl | 'restore', string>;
185
+ onCommand: (control: PlWindowControl) => void;
186
+ }
187
+ /**
188
+ * The buttons on a title bar.
189
+ *
190
+ * Real `<button>`s with real names, in every system: the whole point of drawing
191
+ * a window rather than a picture of one is that its controls work, and a
192
+ * `<div>` with a click handler on it is invisible to a keyboard. They also stop
193
+ * the press from reaching the bar underneath, or every close would begin by
194
+ * dragging the window half a pixel.
195
+ *
196
+ * Every fill is written into a slot and every state is a class that reads one,
197
+ * so no two declarations are ever left arguing about which of them paints the
198
+ * button — which is the bug that made a hovered close button vanish.
199
+ */
200
+ export declare function PlWindowControls({ os, metrics, controls, maximized, active, labels, onCommand }: PlPlWindowControlsProps): React.JSX.Element | null;
201
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{cx as t}from"./styles.js";const a={macos:{bar:38,radius:10,radiusBottom:10,padX:12,padEnd:12,gap:8,title:13,glyph:7,weight:500,frame:1,band:{side:0,bottom:0},control:{width:12,height:12},titleAlign:"center",controlsSide:"start",shape:"dot",rule:!1,stroke:1.4,boxRadius:0,tint:[6,3],accentBorder:!1,paint:null,image:null,shadow:null,glass:!1},macosx:{bar:26,radius:8,radiusBottom:0,padX:10,padEnd:10,gap:8,title:12,glyph:7,weight:700,frame:1,band:{side:0,bottom:0},control:{width:13,height:13},titleAlign:"center",controlsSide:"start",shape:"gloss-dot",rule:!0,stroke:1.5,boxRadius:0,tint:[0,0],accentBorder:!1,paint:{fill:"#e4e4e4",ink:"#333333",dark:!1},image:"repeating-linear-gradient(180deg, rgb(255 255 255 / 0.55) 0 1px, rgb(0 0 0 / 0.035) 1px 2px), linear-gradient(180deg, rgb(255 255 255 / 0.8), rgb(0 0 0 / 0.07))",shadow:"0 1px 0 rgb(255 255 255 / 0.85)",glass:!1},windows11:{bar:32,radius:8,radiusBottom:8,padX:12,padEnd:0,gap:0,title:12,glyph:10,weight:400,frame:1,band:{side:0,bottom:0},control:{width:46,height:32},titleAlign:"start",controlsSide:"end",shape:"square",rule:!1,tint:[3,1],stroke:1,boxRadius:1.6,accentBorder:!1,paint:null,image:null,shadow:null,glass:!1},windows10:{bar:30,radius:0,radiusBottom:0,padX:10,padEnd:0,gap:0,title:12,glyph:10,weight:400,frame:1,band:{side:0,bottom:0},control:{width:45,height:30},titleAlign:"start",controlsSide:"end",shape:"square",rule:!0,tint:[0,0],stroke:.9,boxRadius:0,accentBorder:!0,paint:null,image:null,shadow:null,glass:!1},windows8:{bar:32,radius:0,radiusBottom:0,padX:10,padEnd:0,gap:0,title:12,glyph:11,weight:400,frame:2,band:{side:0,bottom:0},control:{width:45,height:32},titleAlign:"start",controlsSide:"end",shape:"square",rule:!1,tint:[0,0],stroke:1,boxRadius:0,accentBorder:!0,paint:null,image:null,shadow:null,glass:!1},windows7:{bar:30,radius:7,radiusBottom:0,padX:10,padEnd:3,gap:2,title:12,glyph:10,weight:400,frame:1,band:{side:7,bottom:7},control:{width:29,height:20},closeWidth:45,titleAlign:"start",controlsSide:"end",shape:"aero",rule:!1,tint:[0,0],stroke:1.1,boxRadius:0,accentBorder:!1,paint:{fill:"rgb(198 218 242 / 0.45)",ink:"#12314f",dark:!1},image:"linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.1) 46%, rgb(255 255 255 / 0.34) 88%, rgb(255 255 255 / 0.5))",shadow:"0 0 6px rgb(255 255 255 / 0.95), 0 0 3px rgb(255 255 255 / 0.95)",glass:!0},windowsxp:{bar:30,radius:8,radiusBottom:0,padX:6,padEnd:4,gap:2,title:13,glyph:9,weight:700,frame:1,band:{side:4,bottom:4},control:{width:21,height:21},closeWidth:26,titleAlign:"start",controlsSide:"end",shape:"plate",rule:!1,tint:[0,0],stroke:1.8,boxRadius:3,accentBorder:!1,paint:{fill:"#1f66d6",ink:"#ffffff",dark:!0},image:"linear-gradient(180deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.26) 7%, rgb(0 0 0 / 0.11) 42%, rgb(0 0 0 / 0.05) 56%, rgb(255 255 255 / 0.22) 76%, rgb(255 255 255 / 0.34) 88%, rgb(0 0 0 / 0.16) 96%, rgb(0 0 0 / 0.34))",shadow:"0 1px 1px rgb(0 0 0 / 0.45)",glass:!1},linux:{bar:44,radius:12,radiusBottom:12,padX:10,padEnd:10,gap:6,title:14,glyph:10,weight:600,frame:1,band:{side:0,bottom:0},control:{width:24,height:24},titleAlign:"center",controlsSide:"end",shape:"circle",rule:!1,stroke:1.2,boxRadius:0,tint:[11,5],accentBorder:!1,paint:null,image:null,shadow:null,glass:!1}},r={xs:.8,sm:.9,md:1,lg:1.15,xl:1.3};export function windowMetrics(e,i){const t=a[e],o=r[i],round=e=>Math.round(e*o),n={width:round(t.control.width),height:round(t.control.height)},s=round(t.gap),l=void 0===t.closeWidth?n.width:round(t.closeWidth);return{bar:round(t.bar),radius:t.radius,radiusBottom:t.radiusBottom,frame:t.frame,band:{side:round(t.band.side),bottom:round(t.band.bottom)},padX:round(t.padX),padEnd:round(t.padEnd),gap:s,title:round(t.title),glyph:round(t.glyph),weight:t.weight,control:n,controlsWidth:e=>e<=0?0:l+(e-1)*n.width+(e-1)*s,closeWidth:l}}export function windowChrome(e){return a[e]}const o={macos:["close","minimize","maximize"],macosx:["close","minimize","maximize"],windows11:["minimize","maximize","close"],windows10:["minimize","maximize","close"],windows8:["minimize","maximize","close"],windows7:["minimize","maximize","close"],windowsxp:["minimize","maximize","close"],linux:["minimize","maximize","close"]};export function orderControls(e,i){return o[e].filter(e=>i.includes(e))}function veil(e,i){const t=Math.round(100*(1-i));return t>=100?e:`color-mix(in oklab, ${e} ${t}%, transparent)`}export function windowSlots(e){const{os:i,color:t,accent:r,transparency:o,active:n,elevation:s}=e,l=a[i],d=Math.min(Math.max(o,0),1),p="var(--plass-surface)",c=l.tint[n?0:1],g=0===c?p:`color-mix(in oklab, ${p} ${100-c}%, var(--plass-fg))`,h=r&&n,m=l.paint,u=m?n?m.fill:`color-mix(in oklab, ${m.fill} 45%, #c6c9ce)`:null,b=h?`var(--plass-${t}-solid)`:u??g,w=h?`var(--plass-${t}-on-solid)`:m?n?m.ink:`color-mix(in oklab, ${m.ink} 60%, transparent)`:n?"var(--plass-fg)":"var(--plass-muted-fg)",x=l.band.side>0,f=x?veil(h?`var(--plass-${t}-solid)`:u??g,d):"transparent",v=x?`color-mix(in oklab, ${h?`var(--plass-${t}-solid)`:u??"var(--plass-border)"} 72%, black)`:h&&l.accentBorder?`var(--plass-${t}-solid)`:n?"var(--plass-border)":"color-mix(in oklab, var(--plass-border) 55%, transparent)",k=h||(m?.dark??!1);return{"--p-window-bar":veil(b,d),"--p-window-bar-fg":w,"--p-window-bar-image":l.image??"none","--p-window-bar-shadow":l.shadow??"none","--p-window-body":veil(p,d),"--p-window-line":v,"--p-window-band":f,"--p-window-hover":k?"rgb(255 255 255 / 0.18)":"color-mix(in oklab, var(--plass-fg) 9%, transparent)","--p-window-press":k?"rgb(255 255 255 / 0.28)":"color-mix(in oklab, var(--plass-fg) 16%, transparent)","--p-window-shadow":`var(--plass-shadow-${n?s:Math.max(s-1,0)})`,"--p-accent":`var(--plass-${t}-accent)`,"--p-ring":`var(--plass-${t}-ring)`}}function Glyph({size:i,stroke:t,round:a,children:r}){return e("svg",{viewBox:"0 0 10 10",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:a?"round":"square",strokeLinejoin:a?"round":"miter","aria-hidden":"true",children:r})}function controlGlyph(t,a,r,o){const n=r.stroke,s=r.boxRadius>0||"square"!==r.shape,l=r.boxRadius;return"minimize"===t?e(Glyph,{size:o,stroke:n,round:s,children:e("path",{d:"plate"===r.shape?"M2 7.5h6":"M1.5 5h7"})}):"close"===t?e(Glyph,{size:o,stroke:n,round:s,children:e("path",{d:"m1.6 1.6 6.8 6.8M8.4 1.6 1.6 8.4"})}):a?i(Glyph,{size:o,stroke:n,round:s,children:[e("rect",{x:"1.4",y:"3.4",width:"5.2",height:"5.2",rx:l}),e("path",{d:"M3.6 3.4v-2h5v5h-2"})]}):e(Glyph,{size:o,stroke:n,round:s,children:e("rect",{x:"1.5",y:"1.5",width:"7",height:"7",rx:l})})}const n={close:"#ff5f57",minimize:"#febc2e",maximize:"#28c840"},s={close:"#cf4b36",minimize:"#4b85d4",maximize:"#4b85d4"},l={macos:null,macosx:null,windows11:"#c42b1c",windows10:"#e81123",windows8:"#e81123",windows7:"#e04a45",windowsxp:null,linux:null};export function PlWindowControls({os:i,metrics:r,controls:o,maximized:d,active:p,labels:c,onCommand:g}){const h=a[i],m=orderControls(i,o);if(0===m.length)return null;const u="dot"===h.shape||"gloss-dot"===h.shape,b="circle"===h.shape,w="plate"===h.shape,x="aero"===h.shape;return e("div",{className:t("group/controls flex shrink-0 items-center",x?"self-start":"self-stretch"),style:{gap:r.gap},onPointerDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:m.map(a=>{const o="maximize"===a&&d?c.restore:c[a],m="close"===a?l[i]:null,{face:f,ink:v,image:k,plate:y}=function controlFace(e,i,t){switch(e.shape){case"dot":case"gloss-dot":return{face:t?n[i]:"color-mix(in oklab, var(--plass-fg) 22%, transparent)",ink:"rgb(0 0 0 / 0.55)",image:"gloss-dot"===e.shape?"radial-gradient(circle at 50% 26%, rgb(255 255 255 / 0.8), rgb(255 255 255 / 0) 62%)":void 0,plate:"gloss-dot"===e.shape?"inset 0 0 0 1px rgb(0 0 0 / 0.22), inset 0 -1px 1px rgb(0 0 0 / 0.15)":void 0};case"plate":return{face:t?s[i]:`color-mix(in oklab, ${s[i]} 45%, #c6c9ce)`,ink:"#ffffff",image:"linear-gradient(180deg, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0.05) 55%, rgb(0 0 0 / 0.14))",plate:"inset 0 0 0 1px rgb(255 255 255 / 0.4)"};case"aero":return{face:"rgb(255 255 255 / 0.3)",image:"linear-gradient(180deg, rgb(255 255 255 / 0.6), rgb(255 255 255 / 0.08) 52%, rgb(255 255 255 / 0.3))",plate:"inset 0 0 0 1px rgb(255 255 255 / 0.55)"};default:return{}}}(h,a,p);return e("button",{type:"button","aria-label":o,title:o,className:t("relative flex shrink-0 cursor-pointer items-center justify-center","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease),filter_var(--plass-duration)_var(--plass-ease)]","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]",u||b?"rounded-full":"",b?"bg-(--p-window-hover)":"",f?"bg-(--p-window-face)":"",m?"hover:bg-(--p-window-danger) hover:text-white active:bg-(--p-window-danger)":u?"":w?"hover:brightness-110 active:brightness-95":b?"hover:bg-(--p-window-press) active:bg-(--p-window-press)":x?"hover:brightness-110 active:brightness-95":"hover:bg-(--p-window-hover) active:bg-(--p-window-press)"),style:{width:u?r.control.height:"close"===a?r.closeWidth:r.control.width,height:r.control.height,borderRadius:w?h.boxRadius+1:x?"0 0 3px 3px":void 0,backgroundImage:k,boxShadow:y,color:v,...f?{"--p-window-face":f}:{},...m?{"--p-window-danger":m}:{}},onClick:()=>g(a),children:e("span",{className:t("flex items-center justify-center",u?"opacity-0 [transition:opacity_var(--plass-duration)_var(--plass-ease)] group-hover/controls:opacity-100":""),children:controlGlyph(a,d,h,r.glyph)})},a)})})}
@@ -0,0 +1,3 @@
1
+ /** German. */
2
+ import type { PlassLabels } from '../internal/labels.js';
3
+ export declare const de: PlassLabels;