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
@@ -0,0 +1,202 @@
1
+ import * as React from 'react';
2
+ import { type PlassSort, type PlassSortDirection } from '../../internal/data-table.js';
3
+ import type { PlTableAlign } from '../table/index.js';
4
+ import type { PlassElevation, PlassStyleProps } from '../../types.js';
5
+ /** Which way a column runs when it is sorted. */
6
+ export type PlDataTableSortDirection = PlassSortDirection;
7
+ /** The column being sorted on, and its direction. */
8
+ export type PlDataTableSort = PlassSort;
9
+ /**
10
+ * How many rows may be ticked at once.
11
+ *
12
+ * `none` is the default. A table that draws a tick column it does nothing with
13
+ * has promised something it does not do.
14
+ */
15
+ export type PlDataTableSelection = 'none' | 'single' | 'multiple';
16
+ /**
17
+ * How the rows are handed out.
18
+ *
19
+ * - `scroll` — all of them, in one body. Pair it with `maxHeight` and the rows
20
+ * scroll inside the sheet instead of the page growing.
21
+ * - `pages` — a slice at a time, with a pager in the footer. Right when a row's
22
+ * position in the whole set is information, and the only honest option when
23
+ * the rows are fetched a page at a time.
24
+ */
25
+ export type PlDataTablePaging = 'scroll' | 'pages';
26
+ /**
27
+ * The three things the table does to the rows, and the ones an application can
28
+ * take back.
29
+ *
30
+ * Naming a stage in `manual` means the rows arriving in `rows` have already had
31
+ * it done to them — by a server, usually — so the table reports the reader's
32
+ * intent and draws what it is given rather than doing the work twice.
33
+ */
34
+ export type PlDataTableStage = 'sort' | 'search' | 'pages';
35
+ /**
36
+ * A column: its heading, how to get a value out of a row, and how to draw one.
37
+ *
38
+ * The split between `value` and `render` is the shape of this type. `render`
39
+ * decides what a reader sees; `value` decides what the sort and the search see.
40
+ * Most columns need neither — the cell is `row[key]`, and that is what is
41
+ * compared and matched. A column that draws a `PlChip` needs `render`, and it
42
+ * needs `value` as well the moment it is sortable, because an element has no
43
+ * order and no text a search can look inside.
44
+ */
45
+ export interface PlDataTableColumn<Row> {
46
+ /**
47
+ * Identifies the column — to `sort`, and unless `value` or `render` says
48
+ * otherwise, it names the property to read off each row.
49
+ */
50
+ key: string;
51
+ /** The heading. Defaults to the `key`, which is usually not what you want. */
52
+ header?: React.ReactNode;
53
+ /**
54
+ * The column's default width. A number is pixels; a string is any CSS length.
55
+ *
56
+ * "Default" is meant: the table still balances its columns to fill the sheet.
57
+ */
58
+ width?: number | string;
59
+ /**
60
+ * Text alignment. Numbers usually want `end` so their digits line up.
61
+ * @default 'start'
62
+ */
63
+ align?: PlTableAlign;
64
+ /** Renders the cell. Without it the cell is `row[key]` rendered as-is. */
65
+ render?: (row: Row, index: number) => React.ReactNode;
66
+ /**
67
+ * What this column *is*, for the sort and the search.
68
+ *
69
+ * Defaults to `row[key]`. Give it whenever the cell is drawn rather than
70
+ * printed: a status column showing a chip sorts on the status, and a name
71
+ * column showing an avatar beside the name searches on the name.
72
+ */
73
+ value?: (row: Row) => unknown;
74
+ /**
75
+ * Puts the heading in the sort rotation: ascending, descending, then back to
76
+ * the order the rows arrived in.
77
+ * @default false
78
+ */
79
+ sortable?: boolean;
80
+ /** Orders two rows against each other, when `compareValues` is not enough. */
81
+ compare?: (a: Row, b: Row) => number;
82
+ /**
83
+ * Keeps this column out of the search. Right for a column of identifiers a
84
+ * reader never types, where a match is a row they cannot see the reason for.
85
+ * @default false
86
+ */
87
+ unsearchable?: boolean;
88
+ }
89
+ export interface PlDataTableProps<Row> extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'onSelect'> {
90
+ /**
91
+ * Drop shadow depth. `0` is the default — a table is a grid set into the page
92
+ * rather than a panel floating over it.
93
+ * @default 0
94
+ */
95
+ elevation?: PlassElevation;
96
+ /** The columns, in the order they appear. */
97
+ columns: readonly PlDataTableColumn<Row>[];
98
+ /** The rows, in the order they arrived in. */
99
+ rows: readonly Row[];
100
+ /**
101
+ * A stable key per row, and the one prop worth setting before any other.
102
+ *
103
+ * It defaults to the row's index, which is wrong for every table this
104
+ * component is for: sorting moves a row and its index stays behind, so a
105
+ * selection made before the sort belongs to different rows after it.
106
+ */
107
+ getRowKey?: (row: Row, index: number) => React.Key;
108
+ /** Shown above the grid, and read out as the table's accessible name. */
109
+ caption?: React.ReactNode;
110
+ /** What to show instead of rows when there are none left to show. */
111
+ empty?: React.ReactNode;
112
+ /** Tints every other row. @default false */
113
+ striped?: boolean;
114
+ /** Lights the row under the pointer. @default false */
115
+ hoverable?: boolean;
116
+ /** Pins the header while the rows scroll under it. @default true */
117
+ stickyHeader?: boolean;
118
+ /** A hard cap on the grid's height. A number is pixels; a string is a CSS length. */
119
+ maxHeight?: number | string;
120
+ /** Makes rows activatable. Also turns on the hover treatment. */
121
+ onRowClick?: (row: Row, index: number) => void;
122
+ /** The sorted column and its direction. Pass it to control the sort. */
123
+ sort?: PlDataTableSort | null;
124
+ /** Where the sort starts when the table keeps it itself. */
125
+ defaultSort?: PlDataTableSort | null;
126
+ /** Called with the sort a heading press asks for, `null` for the third press. */
127
+ onSortChange?: (sort: PlDataTableSort | null) => void;
128
+ /** Draws a field above the grid that narrows the rows to what was typed. */
129
+ searchable?: boolean;
130
+ /** The query. Pass it to control the field. */
131
+ search?: string;
132
+ /** Where the query starts when the table keeps it itself. */
133
+ defaultSearch?: string;
134
+ /** Called with what the reader typed. */
135
+ onSearchChange?: (search: string) => void;
136
+ /** The field's placeholder. Defaults to the locale's word for searching. */
137
+ searchPlaceholder?: string;
138
+ /** How many rows may be ticked at once. @default 'none' */
139
+ selection?: PlDataTableSelection;
140
+ /** The ticked rows, as their keys. Pass it to control the selection. */
141
+ selected?: readonly React.Key[];
142
+ /** Where the selection starts when the table keeps it itself. */
143
+ defaultSelected?: readonly React.Key[];
144
+ /** Called with the keys of every ticked row. */
145
+ onSelectedChange?: (selected: React.Key[], rows: Row[]) => void;
146
+ /** Keeps a row out of the selection — a total line, a row already spent. */
147
+ isRowSelectable?: (row: Row, index: number) => boolean;
148
+ /** How the rows are handed out. @default 'scroll' */
149
+ paging?: PlDataTablePaging;
150
+ /** How many rows a page holds. @default 10 */
151
+ pageSize?: number;
152
+ /** The page being read, counted from `1`. Pass it to control the pager. */
153
+ page?: number;
154
+ /** Where the pager starts when the table keeps it itself. */
155
+ defaultPage?: number;
156
+ /** Called with the page a pager press asks for. */
157
+ onPageChange?: (page: number) => void;
158
+ /**
159
+ * How many rows there are in total, when the table is only ever handed one
160
+ * page of them. Required for `manual` paging and ignored without it.
161
+ */
162
+ rowCount?: number;
163
+ /** The stages an application has already done to `rows` itself. */
164
+ manual?: readonly PlDataTableStage[];
165
+ /** Draws bars in place of the rows and marks the grid busy. @default false */
166
+ loading?: boolean;
167
+ /** Drawn in the toolbar, at the end. A filter, a button, a count of its own. */
168
+ toolbar?: React.ReactNode;
169
+ /** Drawn in the footer, at the start, in place of the row count. */
170
+ footer?: React.ReactNode;
171
+ }
172
+ /**
173
+ * A table that owns its rows: it sorts them, narrows them to what was typed,
174
+ * hands them out a page at a time and remembers which of them are ticked.
175
+ *
176
+ * `PlTable` is the one to reach for when the rows are already in the order they
177
+ * belong in — it renders on a server, which this cannot, because every one of
178
+ * these is a decision that has to be remembered between renders.
179
+ *
180
+ * ```tsx
181
+ * <PlDataTable
182
+ * columns={[
183
+ * { key: 'name', header: 'Name', sortable: true },
184
+ * { key: 'amount', header: 'Amount', align: 'end', sortable: true }
185
+ * ]}
186
+ * rows={invoices}
187
+ * getRowKey={(row) => row.id}
188
+ * searchable
189
+ * selection="multiple"
190
+ * paging="pages"
191
+ * />
192
+ * ```
193
+ *
194
+ * Every one of sort, search, selection and page is **controllable and
195
+ * uncontrolled by default**, so the ordinary table is the markup above and a
196
+ * table backed by a server is the same markup with `manual` and the four
197
+ * handlers. Nothing changes shape in between.
198
+ *
199
+ * Not a `forwardRef`, for `PlTable`'s reason: a component wrapped in
200
+ * `React.forwardRef` loses its type parameter, and `Row` is the whole point.
201
+ */
202
+ export declare function PlDataTable<Row>({ variant, size: sizeProp, color: colorProp, density: densityProp, elevation, columns, rows, getRowKey, caption, empty: emptyProp, striped, hoverable, stickyHeader, maxHeight, onRowClick, sort: sortProp, defaultSort, onSortChange, searchable, search: searchProp, defaultSearch, onSearchChange, searchPlaceholder, selection, selected: selectedProp, defaultSelected, onSelectedChange, isRowSelectable, paging, pageSize, page: pageProp, defaultPage, onPageChange, rowCount, manual, loading, toolbar, footer, className, style, ...props }: PlDataTableProps<Row>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{PlCheckbox as a}from"../checkbox/index.js";import{PlPagination as l}from"../pagination/index.js";import{PlSkeleton as n}from"../skeleton/index.js";import{PlTextField as s}from"../text-field/index.js";import{compareValues as o,keysBetween as i,nextSort as c,pageBounds as d}from"../../internal/data-table.js";import{useDefaults as u}from"../../internal/defaults.js";import{ChevronIcon as p}from"../../internal/icons.js";import{useLabels as m}from"../../internal/labels.js";import{searchHaystack as h,searchText as g}from"../../internal/search.js";import{controlTextLeadingClasses as f,cx as v,focusRingInsetClasses as y,gapClasses as b,hasContent as x,metaTextClasses as k,paddingXValues as w,radiusClasses as C,sheetRestClasses as N,srOnlyClasses as S,surfaceSlots as j}from"../../internal/styles.js";import{cellPaddingYValues as z,clickableRowClasses as M,headRule as P,rowClasses as $,rowRule as _,tableStyle as A}from"../../internal/table.js";const R={xs:"2rem",sm:"2.25rem",md:"2.75rem",lg:"3rem",xl:"3.5rem"},B=/* @__PURE__ */v("inline-flex items-center gap-1 [outline:none]","font-semibold whitespace-nowrap text-inherit","[background:none] [border:0] [padding:0] [margin:0] cursor-pointer","hover:text-(--plass-fg) [transition:color_var(--plass-duration)_var(--plass-ease)]",y);function SortMark({direction:t}){return e("span",{"aria-hidden":"true",className:v("[&_svg]:size-[1em] [&_svg]:shrink-0","[transition:opacity_var(--plass-duration)_var(--plass-ease),transform_var(--plass-duration)_var(--plass-ease)]",null===t?"opacity-30":"opacity-100","asc"===t?"rotate-180":""),children:e(p,{})})}export function PlDataTable({variant:p="glass",size:y,color:T,density:D,elevation:H=0,columns:K,rows:I,getRowKey:E,caption:q,empty:F,striped:G=!1,hoverable:J=!1,stickyHeader:L=!0,maxHeight:O,onRowClick:Q,sort:U,defaultSort:V=null,onSortChange:W,searchable:X=!1,search:Y,defaultSearch:Z="",onSearchChange:ee,searchPlaceholder:te,selection:re="none",selected:ae,defaultSelected:le,onSelectedChange:ne,isRowSelectable:se,paging:oe="scroll",pageSize:ie=10,page:ce,defaultPage:de=1,onPageChange:ue,rowCount:pe,manual:me,loading:he=!1,toolbar:ge,footer:fe,className:ve,style:ye,...be}){const xe=u(),ke=m(),we=y??xe.size??"md",Ce=T??xe.color??"primary",Ne=D??xe.density??"default",Se=F??ke.empty,[je,ze]=r.useState(V),[Me,Pe]=r.useState(Z),[$e,_e]=r.useState(le??[]),[Ae,Re]=r.useState(de),Be=void 0===U?je:U,Te=Y??Me,De=ae??$e,He=!me?.includes("sort"),Ke=!me?.includes("search"),Ie=!me?.includes("pages"),Ee=r.useCallback((e,t)=>E?E(e,t):t,[E]),qe=r.useCallback((e,t)=>e.value?e.value(t):t[e.key],[]),Fe=g(Te),Ge=r.useMemo(()=>{if(!Ke||""===Fe)return I;const e=K.filter(e=>!e.unsearchable);return I.filter(t=>h(e.map(e=>qe(e,t))).includes(Fe))},[I,K,Fe,Ke,qe]),Je=r.useMemo(()=>{if(!He||null===Be)return Ge;const e=K.find(e=>e.key===Be.key);if(!e)return Ge;const t="asc"===Be.direction?1:-1;return[...Ge].sort((r,a)=>(e.compare?e.compare(r,a):o(qe(e,r),qe(e,a)))*t)},[Ge,K,Be,He,qe]),Le=Ie?Je.length:pe??Je.length,Oe=Math.max(1,Math.ceil(Le/ie)),Qe=Math.min(Math.max(ce??Ae,1),Oe),Ue=r.useMemo(()=>{if("pages"!==oe||!Ie)return Je;const[e,t]=d(Je.length,Qe,ie);return Je.slice(e,t)},[Je,oe,Ie,Qe,ie]),Ve=r.useMemo(()=>Ue.map(Ee),[Ue,Ee]),We=r.useRef(null);function goPage(e){void 0===ce&&Re(e),e!==Qe&&ue?.(e)}const selectable=(e,t)=>"none"!==re&&(!se||se(e,t)),goSelected=e=>{void 0===ae&&_e(e);const t=new Set(e);ne?.(e,I.filter((e,r)=>t.has(Ee(e,r))))},Xe=Ve.filter(e=>De.includes(e)),Ye=Ue.filter(selectable).map(Ee),Ze=Ye.length>0&&Xe.length===Ye.length,et=w[Ne][we],tt=z[Ne][we],rt=Boolean(Q),at=J||rt,lt=void 0!==O,nt="none"!==re,st=K.length+(nt?1:0),ot={padding:`${tt} ${et}`,border:0,background:"none"},it={...ot,...L?{boxShadow:"inset 0 -1px 0 var(--plass-border)",background:"linear-gradient(var(--plass-glass-press), var(--plass-glass-press)), linear-gradient(var(--plass-surface), var(--plass-surface))"}:{borderBottom:P}},bodyCellStyle=e=>({...ot,borderTop:0===e?0:_}),ct={padding:`${tt} ${et}`,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"0.75rem"},dt=X||x(ge),ut="pages"===oe&&Oe>1||x(fe);return t("div",{className:v("overflow-hidden",C[we],N[p],ve),style:{...j(Ce,H),...ye},...be,children:[x(q)?e("div",{"aria-hidden":"true",className:v(k[we],"font-semibold text-(--plass-muted-fg)"),style:{...ot,borderBottom:_,textAlign:"start"},children:q}):null,dt?t("div",{style:{...ct,borderBottom:_},children:[X?e(s,{size:we,color:Ce,density:Ne,value:Te,onChange:e=>{return t=e.target.value,void 0===Y&&Pe(t),goPage(1),void ee?.(t);var t},placeholder:te??ke.search,"aria-label":ke.search,className:"min-w-0 flex-1"}):e("span",{}),x(ge)?e("div",{className:v("flex items-center",b[we]),children:ge}):null]}):null,e("div",{className:v("overflow-x-auto",lt&&"overflow-y-auto overscroll-contain"),style:lt?{maxHeight:O}:void 0,children:t("table",{className:v("text-start",f[we],"text-(--plass-fg)"),style:A,"aria-busy":he||void 0,children:[x(q)?e("caption",{className:S,children:q}):null,t("colgroup",{children:[nt?e("col",{style:{width:R[we]}}):null,K.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:t("tr",{children:[nt?e("th",{scope:"col",className:v(L&&"sticky top-0 z-10"),style:it,children:"multiple"===re?e(a,{size:we,color:Ce,checked:Ze,indeterminate:Xe.length>0&&!Ze,onCheckedChange:()=>{const e=De.filter(e=>!Ye.includes(e));goSelected(Ze?e:[...e,...Ye])},disabled:0===Ye.length,"aria-label":ke.selectAll}):e("span",{className:S,children:ke.selectRow})}):null,K.map(r=>{const a=Be?.key===r.key?Be.direction:null;return e("th",{scope:"col",className:v("font-semibold whitespace-nowrap text-(--plass-muted-fg)",L&&"sticky top-0 z-10"),style:{...it,textAlign:r.align??"start"},"aria-sort":r.sortable?"asc"===a?"ascending":"desc"===a?"descending":"none":void 0,children:r.sortable?t("button",{type:"button",className:B,onClick:()=>(e=>{const t=c(Be,e);void 0===U&&ze(t),goPage(1),W?.(t)})(r.key),children:[r.header??r.key,e(SortMark,{direction:a})]}):r.header??r.key},r.key)})]})}),e("tbody",{children:he?Array.from({length:"pages"===oe?ie:5},(t,r)=>e("tr",{className:$,children:Array.from({length:st},(t,a)=>e("td",{style:bodyCellStyle(r),children:e(n,{size:we,color:Ce})},a))},r)):0===Ue.length?e("tr",{className:$,children:e("td",{colSpan:st,className:"text-(--plass-muted-fg)",style:{...ot,padding:`2rem ${et}`,textAlign:"center"},children:Se})}):Ue.map((r,l)=>{const n=Ee(r,l),s=De.includes(n),o=selectable(r,l);return t("tr",{"aria-selected":nt?s:void 0,className:v($,G&&l%2==1&&"[--p-row:var(--plass-stripe)]",s&&"[--p-row:var(--p-soft)]",at&&"hover:[--p-row:var(--p-soft)]",rt&&M),style:{backgroundColor:"var(--p-row)"},tabIndex:rt?0:void 0,onClick:Q?()=>Q(r,l):void 0,onKeyDown:Q?e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Q(r,l)))}:void 0,children:[nt?e("td",{style:bodyCellStyle(l),children:e(a,{size:we,color:Ce,checked:s,disabled:!o,onCheckedChange:(e,t)=>((e,t)=>{if("single"===re)return goSelected(De.includes(e)?[]:[e]),void(We.current=e);if(t&&null!==We.current&&We.current!==e){const t=i(Ve,We.current,e).filter(e=>Ye.includes(e));return void goSelected([...De.filter(e=>!t.includes(e)),...t])}We.current=e,goSelected(De.includes(e)?De.filter(t=>t!==e):[...De,e])})(n,Boolean(t.event.shiftKey)),onClick:e=>e.stopPropagation(),"aria-label":ke.selectRow})}):null,K.map(t=>e("td",{style:{...bodyCellStyle(l),textAlign:t.align??"start"},children:t.render?t.render(r,l):r[t.key]},t.key))]},n)})})]})}),ut?t("div",{style:{...ct,borderTop:_},children:[e("span",{className:v(k[we],"text-(--plass-muted-fg)"),children:x(fe)?fe:`${Ue.length} / ${Le}`}),"pages"===oe?e(l,{size:we,color:Ce,density:Ne,count:Oe,page:Qe,onPageChange:goPage}):null]}):null]})}
@@ -0,0 +1,2 @@
1
+ export { PlDataTable } from './PlDataTable.js';
2
+ export type { PlDataTableColumn, PlDataTablePaging, PlDataTableProps, PlDataTableSelection, PlDataTableSort, PlDataTableSortDirection, PlDataTableStage } from './PlDataTable.js';
@@ -0,0 +1 @@
1
+ export{PlDataTable}from"./PlDataTable.js";
@@ -143,4 +143,4 @@ export declare const PlDrawerClose: React.ForwardRefExoticComponent<Omit<import(
143
143
  * scroll lock, the `aria-labelledby` / `aria-describedby` wiring, restoring
144
144
  * focus to the trigger, and the inert page behind.
145
145
  */
146
- export declare function PlDrawer({ side, mode, size: sizeProp, color: colorProp, density: densityProp, open, defaultOpen, onOpenChange, trigger, title, description, actions, dividers, showClose, closeLabel, extent, rounded, modal, dismissible, className, classNames, style, children, ...props }: PlDrawerProps): React.JSX.Element | null;
146
+ export declare function PlDrawer({ side, mode, size: sizeProp, color: colorProp, density: densityProp, open, defaultOpen, onOpenChange, trigger, title, description, actions, dividers, showClose, closeLabel: closeLabelProp, extent, rounded, modal, dismissible, className, classNames, style, children, ...props }: PlDrawerProps): React.JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as s,jsxs as l,Fragment as e}from"react/jsx-runtime";import{useDefaults as r}from"../../internal/defaults.js";import{Dialog as a}from"@base-ui/react/dialog";import{CloseIcon as o}from"../../internal/icons.js";import{cx as d,focusRingClasses as i,glassClasses as t,hasContent as n,metaTextClasses as p,sheetBodyClasses as u,sheetHeaderGapClasses as m,sheetLineClasses as c,sheetPaddingXClasses as f,sheetPaddingYClasses as x,sheetSectionGapClasses as g,sheetTitleClasses as h,surfaceSlots as b}from"../../internal/styles.js";const v={xs:"w-56",sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},y={left:{xs:"rounded-r-(--plass-radius-xs)",sm:"rounded-r-(--plass-radius-sm)",md:"rounded-r-(--plass-radius-md)",lg:"rounded-r-(--plass-radius-lg)",xl:"rounded-r-(--plass-radius-xl)"},right:{xs:"rounded-l-(--plass-radius-xs)",sm:"rounded-l-(--plass-radius-sm)",md:"rounded-l-(--plass-radius-md)",lg:"rounded-l-(--plass-radius-lg)",xl:"rounded-l-(--plass-radius-xl)"},top:{xs:"rounded-b-(--plass-radius-xs)",sm:"rounded-b-(--plass-radius-sm)",md:"rounded-b-(--plass-radius-md)",lg:"rounded-b-(--plass-radius-lg)",xl:"rounded-b-(--plass-radius-xl)"},bottom:{xs:"rounded-t-(--plass-radius-xs)",sm:"rounded-t-(--plass-radius-sm)",md:"rounded-t-(--plass-radius-md)",lg:"rounded-t-(--plass-radius-lg)",xl:"rounded-t-(--plass-radius-xl)"}},w={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},j={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},N=/* @__PURE__ */[t,"relative flex flex-col overflow-hidden","text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[outline:none]"].join(" "),k=/* @__PURE__ */["[transition:opacity_var(--plass-duration)_var(--plass-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),z=/* @__PURE__ */["fixed inset-0 z-(--plass-z-portal) bg-(--plass-scrim)","[backdrop-filter:blur(2px)] [-webkit-backdrop-filter:blur(2px)]",k].join(" "),C=/* @__PURE__ */["flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center","rounded-full text-(--plass-muted-fg)","[&_svg]:size-[1.1em] [&_svg]:shrink-0","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease)]","hover:bg-(--p-soft) hover:text-(--plass-fg)",i].join(" ");export const PlDrawerClose=a.Close;export function PlDrawer({side:i="left",mode:t="overlay",size:_,color:$,density:D,open:P,defaultOpen:O,onOpenChange:T,trigger:B,title:F,description:L,actions:R,dividers:V=!1,showClose:q,closeLabel:A="Close",extent:E,rounded:G=!0,modal:H=!0,dismissible:I=!0,className:J,classNames:K,style:M,children:Q,...S}){const U=r(),W=_??U.size??"md",X=$??U.color??"primary",Y=D??U.density??"default",Z="overlay"===t,ss="left"===i||"right"===i,ls=q??Z,es=f[Y][W],rs=x[Y][W],as=V?`${es} ${rs}`:es,os=n(F)||n(L),ds=n(R),is=void 0===E?null:{[ss?"width":"height"]:"number"==typeof E?`${E}px`:E},ts=d(N,u[W],w[i],G?y[i][W]:"",Z?"[box-shadow:var(--plass-shadow-4),var(--plass-gloss-glass)]":"[box-shadow:var(--plass-gloss-glass)]",Z?k:"",ss?`h-full max-w-full ${void 0===E?v[W]:""}`:"w-full "+(void 0===E?"max-h-[85%]":""),V?"":`${rs} ${g[W]}`,J),ns=Z?a.Title:"h2",ps=Z?a.Description:"p",us=l(e,{children:[os||ls?l("div",{className:d("flex shrink-0 items-start gap-3",as),children:[l("div",{className:d("flex min-w-0 flex-1 flex-col",m[W]),children:[n(F)?s(ns,{className:d("m-0 font-semibold",h[W]),children:F}):null,n(L)?s(ps,{className:d("m-0 text-(--plass-muted-fg)",p[W]),children:L}):null]}),ls?Z?s(a.Close,{"aria-label":A,className:C,children:s(o,{})}):s("button",{type:"button","aria-label":A,className:C,onClick:()=>T?.(!1),children:s(o,{})}):null]}):null,n(Q)?s("div",{className:d("min-h-0 flex-1 overflow-y-auto overscroll-contain",as,V&&(os||ls)?c:"",V?"":"-my-1 py-1"),children:Q}):null,ds?s("div",{className:d("flex shrink-0 flex-wrap items-center justify-end gap-2",as,V?c:""),children:R}):null]});return Z?l(a.Root,{open:P,defaultOpen:O,modal:H,disablePointerDismissal:!I,onOpenChange:(s,l)=>{I||s||"escape-key"!==l.reason?T?.(s):l.cancel()},children:[B?s(a.Trigger,{render:B}):null,l(a.Portal,{children:[s(a.Backdrop,{className:d("plass-portal",z,K?.backdrop)}),s(a.Viewport,{className:d("plass-portal fixed inset-0 z-(--plass-z-portal) flex",j[i]),children:s(a.Popup,{className:ts,style:{...b(X,3),...is,...M},...S,children:us})})]})]}):P??O??!0?s("div",{className:ts,style:{...b(X,0),...is,...M},...S,children:us}):null}
1
+ "use client";import{jsx as s,jsxs as l,Fragment as e}from"react/jsx-runtime";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{Dialog as o}from"@base-ui/react/dialog";import{CloseIcon as d}from"../../internal/icons.js";import{cx as i,focusRingClasses as t,glassClasses as n,hasContent as p,metaTextClasses as u,sheetBodyClasses as m,sheetHeaderGapClasses as c,sheetLineClasses as f,sheetPaddingXClasses as x,sheetPaddingYClasses as g,sheetSectionGapClasses as h,sheetTitleClasses as b,surfaceSlots as v}from"../../internal/styles.js";const y={xs:"w-56",sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},w={left:{xs:"rounded-r-(--plass-radius-xs)",sm:"rounded-r-(--plass-radius-sm)",md:"rounded-r-(--plass-radius-md)",lg:"rounded-r-(--plass-radius-lg)",xl:"rounded-r-(--plass-radius-xl)"},right:{xs:"rounded-l-(--plass-radius-xs)",sm:"rounded-l-(--plass-radius-sm)",md:"rounded-l-(--plass-radius-md)",lg:"rounded-l-(--plass-radius-lg)",xl:"rounded-l-(--plass-radius-xl)"},top:{xs:"rounded-b-(--plass-radius-xs)",sm:"rounded-b-(--plass-radius-sm)",md:"rounded-b-(--plass-radius-md)",lg:"rounded-b-(--plass-radius-lg)",xl:"rounded-b-(--plass-radius-xl)"},bottom:{xs:"rounded-t-(--plass-radius-xs)",sm:"rounded-t-(--plass-radius-sm)",md:"rounded-t-(--plass-radius-md)",lg:"rounded-t-(--plass-radius-lg)",xl:"rounded-t-(--plass-radius-xl)"}},j={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},N={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},k=/* @__PURE__ */[n,"relative flex flex-col overflow-hidden","text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[outline:none]"].join(" "),z=/* @__PURE__ */["[transition:opacity_var(--plass-duration-slow)_var(--plass-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),_=/* @__PURE__ */["fixed inset-0 z-(--plass-z-portal) bg-(--plass-scrim)","[backdrop-filter:blur(2px)] [-webkit-backdrop-filter:blur(2px)]",z].join(" "),C=/* @__PURE__ */["flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center","rounded-full text-(--plass-muted-fg)","[&_svg]:size-[1.1em] [&_svg]:shrink-0","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease)]","hover:bg-(--p-soft) hover:text-(--plass-fg)",t].join(" ");export const PlDrawerClose=o.Close;export function PlDrawer({side:t="left",mode:n="overlay",size:$,color:D,density:P,open:O,defaultOpen:T,onOpenChange:B,trigger:F,title:L,description:R,actions:V,dividers:q=!1,showClose:A,closeLabel:E,extent:G,rounded:H=!0,modal:I=!0,dismissible:J=!0,className:K,classNames:M,style:Q,children:S,...U}){const W=r(),X=a(),Y=E??X.close,Z=$??W.size??"md",ss=D??W.color??"primary",ls=P??W.density??"default",es="overlay"===n,rs="left"===t||"right"===t,as=A??es,os=x[ls][Z],ds=g[ls][Z],is=q?`${os} ${ds}`:os,ts=p(L)||p(R),ns=p(V),ps=void 0===G?null:{[rs?"width":"height"]:"number"==typeof G?`${G}px`:G},us=i(k,m[Z],j[t],H?w[t][Z]:"",es?"[box-shadow:var(--plass-shadow-4),var(--plass-gloss-glass)]":"[box-shadow:var(--plass-gloss-glass)]",es?z:"",rs?`h-full max-w-full ${void 0===G?y[Z]:""}`:"w-full "+(void 0===G?"max-h-[85%]":""),q?"":`${ds} ${h[Z]}`,K),ms=es?o.Title:"h2",cs=es?o.Description:"p",fs=l(e,{children:[ts||as?l("div",{className:i("flex shrink-0 items-start gap-3",is),children:[l("div",{className:i("flex min-w-0 flex-1 flex-col",c[Z]),children:[p(L)?s(ms,{className:i("m-0 font-semibold",b[Z]),children:L}):null,p(R)?s(cs,{className:i("m-0 text-(--plass-muted-fg)",u[Z]),children:R}):null]}),as?es?s(o.Close,{"aria-label":Y,className:C,children:s(d,{})}):s("button",{type:"button","aria-label":Y,className:C,onClick:()=>B?.(!1),children:s(d,{})}):null]}):null,p(S)?s("div",{className:i("min-h-0 flex-1 overflow-y-auto overscroll-contain",is,q&&(ts||as)?f:"",q?"":"-my-1 py-1"),children:S}):null,ns?s("div",{className:i("flex shrink-0 flex-wrap items-center justify-end gap-2",is,q?f:""),children:V}):null]});return es?l(o.Root,{open:O,defaultOpen:T,modal:I,disablePointerDismissal:!J,onOpenChange:(s,l)=>{J||s||"escape-key"!==l.reason?B?.(s):l.cancel()},children:[F?s(o.Trigger,{render:F}):null,l(o.Portal,{children:[s(o.Backdrop,{className:i("plass-portal",_,M?.backdrop)}),s(o.Viewport,{className:i("plass-portal fixed inset-0 z-(--plass-z-portal) flex",N[t]),children:s(o.Popup,{className:us,style:{...v(ss,3),...ps,...Q},...U,children:fs})})]})]}):O??T??!0?s("div",{className:us,style:{...v(ss,0),...ps,...Q},...U,children:fs}):null}
@@ -0,0 +1,83 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { PlassAlignItems, PlassJustify, PlassOrientation, PlassResponsive } from '../../types.js';
4
+ export interface PlFlexProps extends React.ComponentPropsWithoutRef<'div'> {
5
+ /**
6
+ * Which way the children run. `horizontal` is a row, `vertical` is a column.
7
+ *
8
+ * Responsive: `direction={{ xs: 'vertical', md: 'horizontal' }}` stacks on a
9
+ * phone and lines up on a laptop, which is most of what this component is
10
+ * for.
11
+ * @default 'horizontal'
12
+ */
13
+ direction?: PlassResponsive<PlassOrientation>;
14
+ /**
15
+ * Runs the children the other way along that axis — the last one first.
16
+ *
17
+ * It reverses the **painting order and nothing else**: the DOM order is what
18
+ * a screen reader reads and what the Tab key walks, and neither of them
19
+ * changes here. Use it for a visual arrangement, never to reorder content.
20
+ * @default false
21
+ */
22
+ reverse?: boolean;
23
+ /**
24
+ * The gap between children, on Tailwind's spacing scale — `spacing={4}` is
25
+ * `1rem`, the same length `gap-4` is. Fractions are allowed, so `1.5` is
26
+ * `0.375rem`.
27
+ * @default 2
28
+ */
29
+ spacing?: PlassResponsive<number>;
30
+ /** The gap between rows only. Falls back to `spacing`. */
31
+ rowSpacing?: PlassResponsive<number>;
32
+ /** The gap between columns only. Falls back to `spacing`. */
33
+ columnSpacing?: PlassResponsive<number>;
34
+ /** How the box distributes the space its children did not use, along the axis. */
35
+ justify?: PlassJustify;
36
+ /** How the children sit against each other across the axis. @default 'stretch' */
37
+ alignItems?: PlassAlignItems;
38
+ /** Where the lines sit when the box is longer across than its content. */
39
+ alignContent?: PlassJustify;
40
+ /**
41
+ * Whether children that run out of room continue on the next line.
42
+ *
43
+ * `false` by default, which is what a flex box already does — a row that
44
+ * wraps is a decision rather than the absence of one, and the opposite
45
+ * default would silently reflow a toolbar somebody sized to fit.
46
+ * @default false
47
+ */
48
+ wrap?: boolean;
49
+ /**
50
+ * Lays the box out **inline**, so it sits in a line of text and is only as
51
+ * wide as its children.
52
+ * @default false
53
+ */
54
+ inline?: boolean;
55
+ /**
56
+ * Renders something other than a `<div>`: `render={<ul />}`,
57
+ * `render={<nav />}`. Base UI's own escape hatch.
58
+ */
59
+ render?: useRender.RenderProp;
60
+ /** What is laid out. */
61
+ children?: React.ReactNode;
62
+ }
63
+ /**
64
+ * A row or a column, and the gap between the things in it.
65
+ *
66
+ * This is the layout box with no arithmetic in it — the one to reach for when
67
+ * the answer is "these, side by side, with a gap". A [PlGrid](./grid) divides a
68
+ * row into columns and needs a `PlGridItem` to take them; here the children
69
+ * are whatever they are and the box only decides which way they run.
70
+ *
71
+ * **`direction` is responsive and resolves in CSS**, which is the whole reason
72
+ * it is worth a component rather than three Tailwind classes. `{ xs:
73
+ * 'vertical', md: 'horizontal' }` is a form that stacks on a phone and lines up
74
+ * on a laptop, decided by the stylesheet — so a server renders it correctly at
75
+ * every width, and dragging a window costs no re-render. It is also the only
76
+ * way to say that in a project that imports `plass-ui/styles.css` and has no
77
+ * Tailwind of its own.
78
+ *
79
+ * It draws **nothing**: no surface, no padding, no `variant`, `color`, `size`
80
+ * or `density`. A flex box is the arrangement of the surfaces inside it, and
81
+ * `spacing` — the space *between* children — is the only measurement it owns.
82
+ */
83
+ export declare const PlFlex: React.ForwardRefExoticComponent<PlFlexProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignContentClasses as n,alignItemsClasses as i,justifyClasses as a,spacingValue as l}from"../../internal/grid.js";import{responsiveSlots as t,withBaseline as o}from"../../internal/responsive.js";import{cx as s}from"../../internal/styles.js";export const PlFlex=/* @__PURE__ */e.forwardRef(function PlFlex({direction:e,reverse:p=!1,spacing:c,rowSpacing:f,columnSpacing:m,justify:g,alignItems:u,alignContent:x,wrap:d=!1,inline:y=!1,render:w,className:j,style:v,children:h,...F},N){const P=s("plass-flex",y?"inline-flex":"flex",d?"flex-wrap":"flex-nowrap","gap-x-(--p-gap-x) gap-y-(--p-gap-y)",g?a[g]:"",u?i[u]:"",x?n[x]:"",j);return r({render:w,ref:N,props:{className:P,style:{...t("dir",o(e,"horizontal"),e=>function directionValue(e,r){const n="vertical"===e?"column":"row";return r?`${n}-reverse`:n}(e,p)),...t("gap-x",o(m??c,2),l),...t("gap-y",o(f??c,2),l),...v},children:h,...F}})});
@@ -0,0 +1,2 @@
1
+ export { PlFlex } from './PlFlex.js';
2
+ export type { PlFlexProps } from './PlFlex.js';
@@ -0,0 +1 @@
1
+ export{PlFlex}from"./PlFlex.js";
@@ -0,0 +1,81 @@
1
+ import * as React from 'react';
2
+ import { type PlButtonProps } from '../button/PlButton.js';
3
+ import type { PlassCorner, PlassElevation, PlassSize, PlassVariant } from '../../types.js';
4
+ export interface PlFloatingActionButtonProps extends Omit<PlButtonProps, 'children' | 'startIcon' | 'endIcon'> {
5
+ /** The glyph. Sized in `em` against the button, exactly as a `startIcon` is. */
6
+ icon: React.ReactNode;
7
+ /**
8
+ * What the button does, in words.
9
+ *
10
+ * Required, and the one prop here that is. It is the accessible name whether
11
+ * or not the words are drawn — a floating button is a disc with a mark in it
12
+ * nine times out of ten, and an unnamed one is the most common accessibility
13
+ * defect this pattern ships with.
14
+ */
15
+ label: string;
16
+ /**
17
+ * Draws the label beside the glyph.
18
+ *
19
+ * Worth turning on for the action a first-time reader would not guess from a
20
+ * glyph, and worth turning off again once they would.
21
+ * @default false
22
+ */
23
+ extended?: boolean;
24
+ /**
25
+ * Which corner of the window it sits in.
26
+ * @default 'bottom-end'
27
+ */
28
+ corner?: PlassCorner;
29
+ /**
30
+ * How far it stands off the two edges it is against. A number is pixels.
31
+ * @default '1.5rem'
32
+ */
33
+ offset?: number | string;
34
+ /**
35
+ * Whether it pins itself to the window at all.
36
+ *
37
+ * On by default, because that is what this component is. Turn it off to put
38
+ * the same button somewhere of your own — the end of a card, a toolbar — and
39
+ * keep the shape and the shadow.
40
+ * @default true
41
+ */
42
+ floating?: boolean;
43
+ /** @default 'solid' */
44
+ variant?: PlassVariant;
45
+ /**
46
+ * One step up the ladder from a `PlButton`'s default.
47
+ * @default 'lg'
48
+ */
49
+ size?: PlassSize;
50
+ /**
51
+ * How far off the page. `3` — the top of the ladder — and unlike every other
52
+ * default in the library it is not a compromise: this is the one control that
53
+ * genuinely floats over the content rather than resting on it.
54
+ * @default 3
55
+ */
56
+ elevation?: PlassElevation;
57
+ }
58
+ /**
59
+ * The one action a screen is about, floating over it.
60
+ *
61
+ * It is a [PlButton](./button) in a corner, and everything that makes it one is
62
+ * the button's: the three materials, the elevation ladder, the pointer light,
63
+ * `loading`, `readOnly` and `disabled`. What this adds is the **pinning**, the
64
+ * shape, and one rule.
65
+ *
66
+ * **`label` is required and is always the accessible name.** A floating button
67
+ * is a disc with a mark in it nine times out of ten, and `extended` decides
68
+ * only whether the words are also drawn — never whether they exist. An icon
69
+ * with no name is the defect this pattern ships with everywhere else.
70
+ *
71
+ * The icon-only form is a **disc**, which is [PlIconButton](./icon-button)'s
72
+ * deliberate exception to the radius rule: the flat run along a control's edge
73
+ * is there for a line of text to sit on, and a glyph has no line of text. The
74
+ * extended form is **not** a pill for exactly that reason — it has words along
75
+ * its edge, so it takes the house fillet like every other labelled control.
76
+ *
77
+ * **One per screen.** Two floating buttons in one corner is two primary
78
+ * actions, which is none; and a screen whose main action is already a button in
79
+ * the content does not want a second copy of it in the corner.
80
+ */
81
+ export declare const PlFloatingActionButton: React.ForwardRefExoticComponent<PlFloatingActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import*as o from"react";import{PlButton as n}from"../button/PlButton.js";import{PlIconButton as e}from"../icon-button/PlIconButton.js";import{useDefaults as r}from"../../internal/defaults.js";import{cx as i,toLength as s}from"../../internal/styles.js";const a={"top-start":["Start","Start"],"top-end":["Start","End"],"bottom-start":["End","Start"],"bottom-end":["End","End"]};export const PlFloatingActionButton=/* @__PURE__ */o.forwardRef(function PlFloatingActionButton({icon:o,label:l,extended:c=!1,corner:m="bottom-end",offset:f,floating:d=!0,variant:u="solid",size:p,elevation:b=3,className:j,style:x,...B},g){const v=r(),z=p??v.size??"lg",[E,P]=a[m],S=s(f)??"1.5rem",y=d?{position:"fixed",[`insetBlock${E}`]:S,[`insetInline${P}`]:S}:{},I={ref:g,variant:u,size:z,elevation:b,className:i(d?"z-30":"",j),style:{...y,...x},...B};return c?t(n,{...I,startIcon:o,children:l}):t(e,{...I,icon:o,label:l})});
@@ -0,0 +1,2 @@
1
+ export { PlFloatingActionButton } from './PlFloatingActionButton.js';
2
+ export type { PlFloatingActionButtonProps } from './PlFloatingActionButton.js';
@@ -0,0 +1 @@
1
+ export{PlFloatingActionButton}from"./PlFloatingActionButton.js";
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
- import type { PlassColor, PlassDensity, PlassElevation, PlassPosition, PlassSize, PlassVariant } from '../../types.js';
3
+ import { type PlassMeasure } from '../../internal/responsive.js';
4
+ import type { PlassColor, PlassDensity, PlassElevation, PlassPosition, PlassResponsive, PlassSize, PlassVariant } from '../../types.js';
4
5
  /** How wide the content inside the sheet is allowed to get. */
5
- export type PlFooterWidth = PlassSize | 'none';
6
+ export type PlFooterWidth = PlassMeasure;
6
7
  export interface PlFooterProps extends Omit<React.ComponentPropsWithoutRef<'footer'>, 'color' | 'title'> {
7
8
  /**
8
9
  * How the bar sits in the page's scroll.
@@ -45,7 +46,7 @@ export interface PlFooterProps extends Omit<React.ComponentPropsWithoutRef<'foot
45
46
  * spans the window. The same ladder `PlContainer`'s `maxWidth` uses.
46
47
  * @default 'none'
47
48
  */
48
- maxWidth?: PlFooterWidth;
49
+ maxWidth?: PlassResponsive<PlFooterWidth>;
49
50
  /** The gutter and the air above and below. @default true */
50
51
  padded?: boolean;
51
52
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{PlPageLayoutContext as s}from"../../internal/page-layout.js";import{cx as a,sheetPaddingXClasses as i,sheetPaddingYClasses as l,sheetRestClasses as m,surfaceSlots as n,transitionClasses as d}from"../../internal/styles.js";const c=m,f={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},u={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"};export const PlFooter=/* @__PURE__ */r.forwardRef(function PlFooter({position:m="static",variant:x="glass",size:p,color:y,density:w,elevation:b=0,divider:v=!0,maxWidth:j="none",padded:g=!0,label:h,render:z,className:k,style:N,children:C,...F},P){const R=t(),W=p??R.size??"md",q=y??R.color??"primary",A=w??R.density??"default",{register:B}=r.useContext(s),D=r.useCallback(e=>{B("footer",e),"function"==typeof P?P(e):P&&(P.current=e)},[B,P]),E=a("w-full min-w-0",c[x],v?"border-t [border-color:var(--plass-divider)]":"",f[m],d,k);return o({render:z??e("footer",{}),ref:D,props:{"aria-label":h,className:E,style:{...n(q,b),...N},children:e("div",{className:a("w-full",g?a(i[A][W],l[A][W]):"","none"===j?"":a(u[j],"mx-auto")),children:C}),...F}})});
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{PlPageLayoutContext as s}from"../../internal/page-layout.js";import{measureSlots as i}from"../../internal/responsive.js";import{cx as a,sheetPaddingXClasses as l,sheetPaddingYClasses as n,sheetRestClasses as d,surfaceSlots as m,transitionClasses as c}from"../../internal/styles.js";const f=d,p={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"};export const PlFooter=/* @__PURE__ */r.forwardRef(function PlFooter({position:d="static",variant:u="glass",size:y,color:x,density:b,elevation:v=0,divider:j=!0,maxWidth:h,padded:w=!0,label:z,render:N,className:g,style:k,children:C,...F},P){const R=i(h),W=t(),q=y??W.size??"md",A=x??W.color??"primary",B=b??W.density??"default",{register:D}=r.useContext(s),E=r.useCallback(e=>{D("footer",e),"function"==typeof P?P(e):P&&(P.current=e)},[D,P]),G=a("w-full min-w-0",f[u],j?"border-t [border-color:var(--plass-divider)]":"",p[d],c,g);return o({render:N??e("footer",{}),ref:E,props:{"aria-label":z,className:G,style:{...m(A,v),...k},children:e("div",{style:R.style,className:a("w-full",w?a(l[B][q],n[B][q]):"",R.className,void 0===h?"":"mx-auto"),children:C}),...F}})});