plass-ui 0.0.1 → 1.0.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 (408) hide show
  1. package/dist/components/accordion/PlAccordion.d.ts +98 -0
  2. package/dist/components/accordion/PlAccordion.js +131 -0
  3. package/dist/components/accordion/index.d.ts +2 -0
  4. package/dist/components/accordion/index.js +1 -0
  5. package/dist/components/alert/PlAlert.d.ts +50 -0
  6. package/dist/components/alert/PlAlert.js +109 -0
  7. package/dist/components/alert/index.d.ts +2 -0
  8. package/dist/components/alert/index.js +1 -0
  9. package/dist/components/animate-appear/PlAnimateAppear.d.ts +55 -0
  10. package/dist/components/animate-appear/PlAnimateAppear.js +71 -0
  11. package/dist/components/animate-appear/index.d.ts +2 -0
  12. package/dist/components/animate-appear/index.js +1 -0
  13. package/dist/components/animate-blink/PlAnimateBlink.d.ts +30 -0
  14. package/dist/components/animate-blink/PlAnimateBlink.js +47 -0
  15. package/dist/components/animate-blink/index.d.ts +2 -0
  16. package/dist/components/animate-blink/index.js +1 -0
  17. package/dist/components/animate-fade/PlAnimateFade.d.ts +35 -0
  18. package/dist/components/animate-fade/PlAnimateFade.js +48 -0
  19. package/dist/components/animate-fade/index.d.ts +2 -0
  20. package/dist/components/animate-fade/index.js +1 -0
  21. package/dist/components/animate-grow/PlAnimateGrow.d.ts +45 -0
  22. package/dist/components/animate-grow/PlAnimateGrow.js +49 -0
  23. package/dist/components/animate-grow/index.d.ts +2 -0
  24. package/dist/components/animate-grow/index.js +1 -0
  25. package/dist/components/animate-headline/PlAnimateHeadline.d.ts +55 -0
  26. package/dist/components/animate-headline/PlAnimateHeadline.js +120 -0
  27. package/dist/components/animate-headline/index.d.ts +2 -0
  28. package/dist/components/animate-headline/index.js +1 -0
  29. package/dist/components/animate-lighting/PlAnimateLighting.d.ts +67 -0
  30. package/dist/components/animate-lighting/PlAnimateLighting.js +65 -0
  31. package/dist/components/animate-lighting/index.d.ts +2 -0
  32. package/dist/components/animate-lighting/index.js +1 -0
  33. package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +65 -0
  34. package/dist/components/animate-marquee/PlAnimateMarquee.js +94 -0
  35. package/dist/components/animate-marquee/index.d.ts +2 -0
  36. package/dist/components/animate-marquee/index.js +1 -0
  37. package/dist/components/animate-rotate/PlAnimateRotate.d.ts +52 -0
  38. package/dist/components/animate-rotate/PlAnimateRotate.js +50 -0
  39. package/dist/components/animate-rotate/index.d.ts +2 -0
  40. package/dist/components/animate-rotate/index.js +1 -0
  41. package/dist/components/animate-slide/PlAnimateSlide.d.ts +47 -0
  42. package/dist/components/animate-slide/PlAnimateSlide.js +49 -0
  43. package/dist/components/animate-slide/index.d.ts +2 -0
  44. package/dist/components/animate-slide/index.js +1 -0
  45. package/dist/components/animate-typing/PlAnimateTyping.d.ts +56 -0
  46. package/dist/components/animate-typing/PlAnimateTyping.js +177 -0
  47. package/dist/components/animate-typing/index.d.ts +2 -0
  48. package/dist/components/animate-typing/index.js +1 -0
  49. package/dist/components/animate-zoom/PlAnimateZoom.d.ts +37 -0
  50. package/dist/components/animate-zoom/PlAnimateZoom.js +45 -0
  51. package/dist/components/animate-zoom/index.d.ts +2 -0
  52. package/dist/components/animate-zoom/index.js +1 -0
  53. package/dist/components/aspect-ratio/PlAspectRatio.d.ts +64 -0
  54. package/dist/components/aspect-ratio/PlAspectRatio.js +58 -0
  55. package/dist/components/aspect-ratio/index.d.ts +2 -0
  56. package/dist/components/aspect-ratio/index.js +1 -0
  57. package/dist/components/avatar/PlAvatar.d.ts +102 -0
  58. package/dist/components/avatar/PlAvatar.js +121 -0
  59. package/dist/components/avatar/index.d.ts +2 -0
  60. package/dist/components/avatar/index.js +1 -0
  61. package/dist/components/badge/PlBadge.d.ts +86 -0
  62. package/dist/components/badge/PlBadge.js +168 -0
  63. package/dist/components/badge/index.d.ts +2 -0
  64. package/dist/components/badge/index.js +1 -0
  65. package/dist/components/blockquote/PlBlockquote.d.ts +64 -0
  66. package/dist/components/blockquote/PlBlockquote.js +112 -0
  67. package/dist/components/blockquote/index.d.ts +2 -0
  68. package/dist/components/blockquote/index.js +1 -0
  69. package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +111 -0
  70. package/dist/components/bottom-navigation/PlBottomNavigation.js +141 -0
  71. package/dist/components/bottom-navigation/index.d.ts +2 -0
  72. package/dist/components/bottom-navigation/index.js +1 -0
  73. package/dist/components/box/PlBox.d.ts +50 -0
  74. package/dist/components/box/PlBox.js +46 -0
  75. package/dist/components/box/index.d.ts +2 -0
  76. package/dist/components/box/index.js +1 -0
  77. package/dist/components/breadcrumb/PlBreadcrumb.d.ts +138 -0
  78. package/dist/components/breadcrumb/PlBreadcrumb.js +201 -0
  79. package/dist/components/breadcrumb/index.d.ts +2 -0
  80. package/dist/components/breadcrumb/index.js +1 -0
  81. package/dist/components/button/{Button.d.ts → PlButton.d.ts} +3 -3
  82. package/dist/components/button/PlButton.js +196 -0
  83. package/dist/components/button/index.d.ts +2 -2
  84. package/dist/components/button/index.js +1 -1
  85. package/dist/components/button-group/PlButtonGroup.d.ts +32 -0
  86. package/dist/components/button-group/PlButtonGroup.js +64 -0
  87. package/dist/components/button-group/index.d.ts +2 -0
  88. package/dist/components/button-group/index.js +1 -0
  89. package/dist/components/card/PlCard.d.ts +81 -0
  90. package/dist/components/card/PlCard.js +102 -0
  91. package/dist/components/card/index.d.ts +2 -0
  92. package/dist/components/card/index.js +1 -0
  93. package/dist/components/carousel/PlCarousel.d.ts +78 -0
  94. package/dist/components/carousel/PlCarousel.js +177 -0
  95. package/dist/components/carousel/index.d.ts +2 -0
  96. package/dist/components/carousel/index.js +1 -0
  97. package/dist/components/chat-bubble/PlChatBubble.d.ts +127 -0
  98. package/dist/components/chat-bubble/PlChatBubble.js +206 -0
  99. package/dist/components/chat-bubble/index.d.ts +2 -0
  100. package/dist/components/chat-bubble/index.js +1 -0
  101. package/dist/components/checkbox/PlCheckbox.d.ts +39 -0
  102. package/dist/components/checkbox/PlCheckbox.js +100 -0
  103. package/dist/components/checkbox/index.d.ts +2 -0
  104. package/dist/components/checkbox/index.js +1 -0
  105. package/dist/components/chip/PlChip.d.ts +55 -0
  106. package/dist/components/chip/PlChip.js +144 -0
  107. package/dist/components/chip/index.d.ts +2 -0
  108. package/dist/components/chip/index.js +1 -0
  109. package/dist/components/collapsible/PlCollapsible.d.ts +84 -0
  110. package/dist/components/collapsible/PlCollapsible.js +65 -0
  111. package/dist/components/collapsible/index.d.ts +2 -0
  112. package/dist/components/collapsible/index.js +1 -0
  113. package/dist/components/combobox/PlCombobox.d.ts +140 -0
  114. package/dist/components/combobox/PlCombobox.js +199 -0
  115. package/dist/components/combobox/index.d.ts +2 -0
  116. package/dist/components/combobox/index.js +1 -0
  117. package/dist/components/container/PlContainer.d.ts +66 -0
  118. package/dist/components/container/PlContainer.js +47 -0
  119. package/dist/components/container/index.d.ts +2 -0
  120. package/dist/components/container/index.js +1 -0
  121. package/dist/components/date-picker/PlDatePicker.d.ts +73 -0
  122. package/dist/components/date-picker/PlDatePicker.js +87 -0
  123. package/dist/components/date-picker/index.d.ts +2 -0
  124. package/dist/components/date-picker/index.js +1 -0
  125. package/dist/components/date-range-picker/PlDateRangePicker.d.ts +91 -0
  126. package/dist/components/date-range-picker/PlDateRangePicker.js +152 -0
  127. package/dist/components/date-range-picker/index.d.ts +2 -0
  128. package/dist/components/date-range-picker/index.js +1 -0
  129. package/dist/components/date-time-picker/PlDateTimePicker.d.ts +74 -0
  130. package/dist/components/date-time-picker/PlDateTimePicker.js +106 -0
  131. package/dist/components/date-time-picker/index.d.ts +2 -0
  132. package/dist/components/date-time-picker/index.js +1 -0
  133. package/dist/components/divider/PlDivider.d.ts +73 -0
  134. package/dist/components/divider/PlDivider.js +107 -0
  135. package/dist/components/divider/index.d.ts +2 -0
  136. package/dist/components/divider/index.js +1 -0
  137. package/dist/components/drawer/PlDrawer.d.ts +144 -0
  138. package/dist/components/drawer/PlDrawer.js +190 -0
  139. package/dist/components/drawer/index.d.ts +2 -0
  140. package/dist/components/drawer/index.js +1 -0
  141. package/dist/components/file-picker/PlFilePicker.d.ts +105 -0
  142. package/dist/components/file-picker/PlFilePicker.js +274 -0
  143. package/dist/components/file-picker/index.d.ts +2 -0
  144. package/dist/components/file-picker/index.js +1 -0
  145. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +118 -0
  146. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +291 -0
  147. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  148. package/dist/components/floating-bottom-navigation/index.js +1 -0
  149. package/dist/components/grid/PlGrid.d.ts +67 -0
  150. package/dist/components/grid/PlGrid.js +51 -0
  151. package/dist/components/grid/PlGridItem.d.ts +50 -0
  152. package/dist/components/grid/PlGridItem.js +34 -0
  153. package/dist/components/grid/index.d.ts +4 -0
  154. package/dist/components/grid/index.js +2 -0
  155. package/dist/components/highlight/PlHighlight.d.ts +90 -0
  156. package/dist/components/highlight/PlHighlight.js +185 -0
  157. package/dist/components/highlight/index.d.ts +2 -0
  158. package/dist/components/highlight/index.js +1 -0
  159. package/dist/components/hot-keys/PlHotKeys.d.ts +93 -0
  160. package/dist/components/hot-keys/PlHotKeys.js +294 -0
  161. package/dist/components/hot-keys/index.d.ts +2 -0
  162. package/dist/components/hot-keys/index.js +1 -0
  163. package/dist/components/icon/PlIcon.d.ts +62 -0
  164. package/dist/components/icon/PlIcon.js +58 -0
  165. package/dist/components/icon/index.d.ts +2 -0
  166. package/dist/components/icon/index.js +1 -0
  167. package/dist/components/icon-button/PlIconButton.d.ts +39 -0
  168. package/dist/components/icon-button/PlIconButton.js +37 -0
  169. package/dist/components/icon-button/index.d.ts +2 -0
  170. package/dist/components/icon-button/index.js +1 -0
  171. package/dist/components/list/PlList.d.ts +82 -0
  172. package/dist/components/list/PlList.js +160 -0
  173. package/dist/components/list/index.d.ts +2 -0
  174. package/dist/components/list/index.js +1 -0
  175. package/dist/components/menu/PlMenu.d.ts +210 -0
  176. package/dist/components/menu/PlMenu.js +209 -0
  177. package/dist/components/menu/index.d.ts +2 -0
  178. package/dist/components/menu/index.js +1 -0
  179. package/dist/components/modal/PlModal.d.ts +112 -0
  180. package/dist/components/modal/PlModal.js +150 -0
  181. package/dist/components/modal/index.d.ts +2 -0
  182. package/dist/components/modal/index.js +1 -0
  183. package/dist/components/number-field/PlNumberField.d.ts +133 -0
  184. package/dist/components/number-field/PlNumberField.js +111 -0
  185. package/dist/components/number-field/index.d.ts +2 -0
  186. package/dist/components/number-field/index.js +1 -0
  187. package/dist/components/otp-field/PlOtpField.d.ts +82 -0
  188. package/dist/components/otp-field/PlOtpField.js +109 -0
  189. package/dist/components/otp-field/index.d.ts +2 -0
  190. package/dist/components/otp-field/index.js +1 -0
  191. package/dist/components/overlay/PlOverlay.d.ts +96 -0
  192. package/dist/components/overlay/PlOverlay.js +77 -0
  193. package/dist/components/overlay/index.d.ts +2 -0
  194. package/dist/components/overlay/index.js +1 -0
  195. package/dist/components/pagination/PlPagination.d.ts +88 -0
  196. package/dist/components/pagination/PlPagination.js +159 -0
  197. package/dist/components/pagination/index.d.ts +2 -0
  198. package/dist/components/pagination/index.js +1 -0
  199. package/dist/components/panes/PlPanes.d.ts +79 -0
  200. package/dist/components/panes/PlPanes.js +324 -0
  201. package/dist/components/panes/index.d.ts +2 -0
  202. package/dist/components/panes/index.js +1 -0
  203. package/dist/components/pill/PlPill.d.ts +81 -0
  204. package/dist/components/pill/PlPill.js +154 -0
  205. package/dist/components/pill/index.d.ts +2 -0
  206. package/dist/components/pill/index.js +1 -0
  207. package/dist/components/popover/PlPopover.d.ts +107 -0
  208. package/dist/components/popover/PlPopover.js +113 -0
  209. package/dist/components/popover/index.d.ts +2 -0
  210. package/dist/components/popover/index.js +1 -0
  211. package/dist/components/progress-box/PlProgressBox.d.ts +32 -0
  212. package/dist/components/progress-box/PlProgressBox.js +34 -0
  213. package/dist/components/progress-box/index.d.ts +2 -0
  214. package/dist/components/progress-box/index.js +1 -0
  215. package/dist/components/progress-circular/PlProgressCircular.d.ts +22 -0
  216. package/dist/components/progress-circular/PlProgressCircular.js +47 -0
  217. package/dist/components/progress-circular/index.d.ts +2 -0
  218. package/dist/components/progress-circular/index.js +1 -0
  219. package/dist/components/progress-linear/PlProgressLinear.d.ts +31 -0
  220. package/dist/components/progress-linear/PlProgressLinear.js +40 -0
  221. package/dist/components/progress-linear/index.d.ts +2 -0
  222. package/dist/components/progress-linear/index.js +1 -0
  223. package/dist/components/radio-group/PlRadioGroup.d.ts +54 -0
  224. package/dist/components/radio-group/PlRadioGroup.js +99 -0
  225. package/dist/components/radio-group/index.d.ts +2 -0
  226. package/dist/components/radio-group/index.js +1 -0
  227. package/dist/components/rating/PlRating.d.ts +90 -0
  228. package/dist/components/rating/PlRating.js +101 -0
  229. package/dist/components/rating/index.d.ts +2 -0
  230. package/dist/components/rating/index.js +1 -0
  231. package/dist/components/scroll-zone/PlScrollZone.d.ts +132 -0
  232. package/dist/components/scroll-zone/PlScrollZone.js +411 -0
  233. package/dist/components/scroll-zone/index.d.ts +2 -0
  234. package/dist/components/scroll-zone/index.js +1 -0
  235. package/dist/components/segmented-button/PlSegmentedButton.d.ts +79 -0
  236. package/dist/components/segmented-button/PlSegmentedButton.js +206 -0
  237. package/dist/components/segmented-button/index.d.ts +2 -0
  238. package/dist/components/segmented-button/index.js +1 -0
  239. package/dist/components/select/PlSelect.d.ts +77 -0
  240. package/dist/components/select/PlSelect.js +115 -0
  241. package/dist/components/select/index.d.ts +2 -0
  242. package/dist/components/select/index.js +1 -0
  243. package/dist/components/skeleton/PlSkeleton.d.ts +73 -0
  244. package/dist/components/skeleton/PlSkeleton.js +142 -0
  245. package/dist/components/skeleton/index.d.ts +2 -0
  246. package/dist/components/skeleton/index.js +1 -0
  247. package/dist/components/slider/PlSlider.d.ts +44 -0
  248. package/dist/components/slider/PlSlider.js +132 -0
  249. package/dist/components/slider/index.d.ts +2 -0
  250. package/dist/components/slider/index.js +1 -0
  251. package/dist/components/spoiler/PlSpoiler.d.ts +84 -0
  252. package/dist/components/spoiler/PlSpoiler.js +74 -0
  253. package/dist/components/spoiler/index.d.ts +2 -0
  254. package/dist/components/spoiler/index.js +1 -0
  255. package/dist/components/switch/PlSwitch.d.ts +42 -0
  256. package/dist/components/switch/PlSwitch.js +131 -0
  257. package/dist/components/switch/index.d.ts +2 -0
  258. package/dist/components/switch/index.js +1 -0
  259. package/dist/components/table/PlTable.d.ts +112 -0
  260. package/dist/components/table/PlTable.js +210 -0
  261. package/dist/components/table/index.d.ts +2 -0
  262. package/dist/components/table/index.js +1 -0
  263. package/dist/components/tabs/PlTabs.d.ts +94 -0
  264. package/dist/components/tabs/PlTabs.js +182 -0
  265. package/dist/components/tabs/index.d.ts +2 -0
  266. package/dist/components/tabs/index.js +1 -0
  267. package/dist/components/text-field/{TextField.d.ts → PlTextField.d.ts} +5 -5
  268. package/dist/components/text-field/PlTextField.js +126 -0
  269. package/dist/components/text-field/index.d.ts +2 -2
  270. package/dist/components/text-field/index.js +1 -1
  271. package/dist/components/text-link/PlTextLink.d.ts +80 -0
  272. package/dist/components/text-link/PlTextLink.js +136 -0
  273. package/dist/components/text-link/index.d.ts +2 -0
  274. package/dist/components/text-link/index.js +1 -0
  275. package/dist/components/time-picker/PlTimePicker.d.ts +88 -0
  276. package/dist/components/time-picker/PlTimePicker.js +97 -0
  277. package/dist/components/time-picker/index.d.ts +2 -0
  278. package/dist/components/time-picker/index.js +1 -0
  279. package/dist/components/timeline/PlTimeline.d.ts +98 -0
  280. package/dist/components/timeline/PlTimeline.js +207 -0
  281. package/dist/components/timeline/index.d.ts +2 -0
  282. package/dist/components/timeline/index.js +1 -0
  283. package/dist/components/toast/PlToast.d.ts +122 -0
  284. package/dist/components/toast/PlToast.js +174 -0
  285. package/dist/components/toast/index.d.ts +2 -0
  286. package/dist/components/toast/index.js +1 -0
  287. package/dist/components/toolbar/PlToolbar.d.ts +68 -0
  288. package/dist/components/toolbar/PlToolbar.js +65 -0
  289. package/dist/components/toolbar/index.d.ts +2 -0
  290. package/dist/components/toolbar/index.js +1 -0
  291. package/dist/components/tooltip/PlTooltip.d.ts +92 -0
  292. package/dist/components/tooltip/PlTooltip.js +117 -0
  293. package/dist/components/tooltip/index.d.ts +2 -0
  294. package/dist/components/tooltip/index.js +1 -0
  295. package/dist/components/typography/PlTypography.d.ts +66 -0
  296. package/dist/components/typography/PlTypography.js +143 -0
  297. package/dist/components/typography/index.d.ts +2 -0
  298. package/dist/components/typography/index.js +1 -0
  299. package/dist/css/accordion.css +2 -0
  300. package/dist/css/alert.css +2 -0
  301. package/dist/css/animate-appear.css +2 -0
  302. package/dist/css/animate-blink.css +2 -0
  303. package/dist/css/animate-fade.css +2 -0
  304. package/dist/css/animate-grow.css +2 -0
  305. package/dist/css/animate-headline.css +2 -0
  306. package/dist/css/animate-lighting.css +2 -0
  307. package/dist/css/animate-marquee.css +2 -0
  308. package/dist/css/animate-rotate.css +2 -0
  309. package/dist/css/animate-slide.css +2 -0
  310. package/dist/css/animate-typing.css +2 -0
  311. package/dist/css/animate-zoom.css +2 -0
  312. package/dist/css/aspect-ratio.css +2 -0
  313. package/dist/css/avatar.css +2 -0
  314. package/dist/css/badge.css +2 -0
  315. package/dist/css/base.css +4 -0
  316. package/dist/css/blockquote.css +2 -0
  317. package/dist/css/bottom-navigation.css +2 -0
  318. package/dist/css/box.css +2 -0
  319. package/dist/css/breadcrumb.css +2 -0
  320. package/dist/css/button-group.css +2 -0
  321. package/dist/css/button.css +2 -0
  322. package/dist/css/card.css +2 -0
  323. package/dist/css/carousel.css +2 -0
  324. package/dist/css/chat-bubble.css +2 -0
  325. package/dist/css/checkbox.css +2 -0
  326. package/dist/css/chip.css +2 -0
  327. package/dist/css/collapsible.css +2 -0
  328. package/dist/css/combobox.css +2 -0
  329. package/dist/css/container.css +2 -0
  330. package/dist/css/date-picker.css +2 -0
  331. package/dist/css/date-range-picker.css +2 -0
  332. package/dist/css/date-time-picker.css +2 -0
  333. package/dist/css/divider.css +2 -0
  334. package/dist/css/drawer.css +2 -0
  335. package/dist/css/file-picker.css +2 -0
  336. package/dist/css/floating-bottom-navigation.css +2 -0
  337. package/dist/css/grid.css +2 -0
  338. package/dist/css/highlight.css +2 -0
  339. package/dist/css/hot-keys.css +2 -0
  340. package/dist/css/icon-button.css +2 -0
  341. package/dist/css/icon.css +2 -0
  342. package/dist/css/list.css +2 -0
  343. package/dist/css/menu.css +2 -0
  344. package/dist/css/modal.css +2 -0
  345. package/dist/css/number-field.css +2 -0
  346. package/dist/css/otp-field.css +2 -0
  347. package/dist/css/overlay.css +2 -0
  348. package/dist/css/pagination.css +2 -0
  349. package/dist/css/panes.css +2 -0
  350. package/dist/css/pill.css +2 -0
  351. package/dist/css/popover.css +2 -0
  352. package/dist/css/progress-box.css +2 -0
  353. package/dist/css/progress-circular.css +2 -0
  354. package/dist/css/progress-linear.css +2 -0
  355. package/dist/css/radio-group.css +2 -0
  356. package/dist/css/rating.css +2 -0
  357. package/dist/css/scroll-zone.css +2 -0
  358. package/dist/css/segmented-button.css +2 -0
  359. package/dist/css/select.css +2 -0
  360. package/dist/css/skeleton.css +2 -0
  361. package/dist/css/slider.css +2 -0
  362. package/dist/css/spoiler.css +2 -0
  363. package/dist/css/switch.css +2 -0
  364. package/dist/css/table.css +2 -0
  365. package/dist/css/tabs.css +2 -0
  366. package/dist/css/text-field.css +2 -0
  367. package/dist/css/text-link.css +2 -0
  368. package/dist/css/time-picker.css +2 -0
  369. package/dist/css/timeline.css +2 -0
  370. package/dist/css/toast.css +2 -0
  371. package/dist/css/toolbar.css +2 -0
  372. package/dist/css/tooltip.css +2 -0
  373. package/dist/css/typography.css +2 -0
  374. package/dist/index.d.ts +75 -3
  375. package/dist/index.js +75 -1
  376. package/dist/internal/animate.d.ts +161 -0
  377. package/dist/internal/animate.js +318 -0
  378. package/dist/internal/button-group.d.ts +27 -0
  379. package/dist/internal/button-group.js +19 -0
  380. package/dist/internal/calendar.d.ts +148 -0
  381. package/dist/internal/calendar.js +501 -0
  382. package/dist/internal/date.d.ts +173 -0
  383. package/dist/internal/date.js +353 -0
  384. package/dist/internal/format.d.ts +24 -0
  385. package/dist/internal/format.js +41 -0
  386. package/dist/internal/grid.d.ts +67 -0
  387. package/dist/internal/grid.js +143 -0
  388. package/dist/internal/icons.d.ts +86 -1
  389. package/dist/internal/icons.js +138 -1
  390. package/dist/internal/menu.d.ts +20 -0
  391. package/dist/internal/menu.js +18 -0
  392. package/dist/internal/picker.d.ts +118 -0
  393. package/dist/internal/picker.js +139 -0
  394. package/dist/internal/progress.d.ts +145 -0
  395. package/dist/internal/progress.js +167 -0
  396. package/dist/internal/sizer.d.ts +32 -0
  397. package/dist/internal/sizer.js +35 -0
  398. package/dist/internal/styles.d.ts +198 -8
  399. package/dist/internal/styles.js +636 -1
  400. package/dist/styles.css +1 -1
  401. package/dist/tailwind.css +899 -125
  402. package/dist/tokens.css +1275 -0
  403. package/dist/types.d.ts +150 -8
  404. package/dist/types.js +1 -1
  405. package/package.json +31 -27
  406. package/README.md +0 -111
  407. package/dist/components/button/Button.js +0 -1
  408. package/dist/components/text-field/TextField.js +0 -1
@@ -0,0 +1,207 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import { cx, hasContent, iconClasses, metaTextClasses, sheetBodyClasses, sheetTitleClasses, surfaceSlots, transitionClasses } from '../../internal/styles.js';
5
+ const TimelineContext = /* @__PURE__ */ React.createContext(null);
6
+ const TimelineItemContext = /* @__PURE__ */ React.createContext({
7
+ index: 0,
8
+ last: false
9
+ });
10
+ /* ---------------------------------------------------------------------------
11
+ * Scales
12
+ * ------------------------------------------------------------------------- */
13
+ /**
14
+ * The bullet.
15
+ *
16
+ * Its own ladder rather than a step off `controlHeightClasses`, for the reason
17
+ * `tickSizeClasses` has one: a bullet is not a control you can put a label
18
+ * inside. It is a mark beside one, sized against the title next to it — which is
19
+ * why the steps are close to the tick ladder and not to the control ladder.
20
+ *
21
+ * It is written as a custom property rather than as a class because the
22
+ * connector has to know it: the line is centred on the bullet, and centring is
23
+ * arithmetic on this number.
24
+ */
25
+ const bulletSizeValues = {
26
+ xs: '0.875rem',
27
+ sm: '1rem',
28
+ md: '1.25rem',
29
+ lg: '1.5rem',
30
+ xl: '1.875rem'
31
+ };
32
+ /** Between the bullet column and the content beside it. */
33
+ const bulletGapClasses = {
34
+ xs: 'gap-2',
35
+ sm: 'gap-2.5',
36
+ md: 'gap-3',
37
+ lg: 'gap-3.5',
38
+ xl: 'gap-4'
39
+ };
40
+ /**
41
+ * How far apart two items sit, and the one thing `density` is allowed to touch
42
+ * here — a compact timeline is the same type at the same bullet size with less
43
+ * air between the steps.
44
+ *
45
+ * The floor is set by the item with nothing in it. A step that is only a title
46
+ * and a time is one line tall, so the gap is the *whole* of what separates it
47
+ * from the next one — where a step with a paragraph under it has the paragraph's
48
+ * own leading working for it as well. Tuned against that case, which is why even
49
+ * `compact` keeps more air than a list of one-liners would otherwise suggest.
50
+ */
51
+ const itemGapClasses = {
52
+ default: { xs: 'pb-5', sm: 'pb-6', md: 'pb-7', lg: 'pb-8', xl: 'pb-10' },
53
+ compact: { xs: 'pb-3', sm: 'pb-3.5', md: 'pb-4', lg: 'pb-5', xl: 'pb-6' }
54
+ };
55
+ /** The same ladder across, for the horizontal form. */
56
+ const itemGapXClasses = {
57
+ default: { xs: 'pe-5', sm: 'pe-6', md: 'pe-7', lg: 'pe-8', xl: 'pe-10' },
58
+ compact: { xs: 'pe-3', sm: 'pe-3.5', md: 'pe-4', lg: 'pe-5', xl: 'pe-6' }
59
+ };
60
+ const borderStyleClasses = {
61
+ solid: 'border-solid',
62
+ dashed: 'border-dashed',
63
+ dotted: 'border-dotted',
64
+ none: ''
65
+ };
66
+ /**
67
+ * The bullet at each of the three states.
68
+ *
69
+ * Every one of them is a different axis, never a different opacity: `complete`
70
+ * is the family's gradient, `current` is that gradient with a halo of the soft
71
+ * tint around it, and `upcoming` is a hairline ring on the page's own surface. A
72
+ * reader who cannot tell the colours apart still has a filled shape, a haloed
73
+ * shape and an empty one.
74
+ *
75
+ * There is no gloss line on the two filled ones, for the reason a filled
76
+ * `PlButton` has none — the gradient is the form. The `upcoming` ring is drawn
77
+ * in the neutral hairline rather than the sheet's white one, the same call a
78
+ * checkbox's edge makes: a bullet is small enough that its edge *is* the object,
79
+ * and white light on a translucent pane disappears on a light card.
80
+ */
81
+ const bulletStatusClasses = {
82
+ complete: '[background-image:var(--p-fill)] text-(--p-on-solid)',
83
+ current: '[background-image:var(--p-fill)] text-(--p-on-solid) [box-shadow:0_0_0_0.25rem_var(--p-soft)]',
84
+ upcoming: 'border-2 bg-(--plass-surface) text-(--plass-muted-fg) [border-color:var(--plass-border)]'
85
+ };
86
+ /**
87
+ * The line *after* an item, which is what makes it the item's own property: a
88
+ * connector is coloured by whether the step it leaves has been reached, not by
89
+ * where it arrives.
90
+ */
91
+ const connectorColorClasses = {
92
+ complete: '[border-color:var(--p-line-hover)]',
93
+ current: '[border-color:var(--plass-border)]',
94
+ upcoming: '[border-color:var(--plass-border)]'
95
+ };
96
+ const titleStatusClasses = {
97
+ complete: 'text-(--plass-fg)',
98
+ current: 'text-(--p-accent)',
99
+ upcoming: 'text-(--plass-muted-fg)'
100
+ };
101
+ /**
102
+ * One step.
103
+ *
104
+ * Its index is not a prop and cannot be: an item that had to be told where it
105
+ * was in the list would be an item every caller could put in the wrong place,
106
+ * and `active={2}` would stop meaning anything. The `PlTimeline` numbers its
107
+ * children as it walks them, and hands each one its index through a context.
108
+ */
109
+ export const PlTimelineItem = /* @__PURE__ */ React.forwardRef(function PlTimelineItem({ title, meta, bullet, status, color, connector = 'solid', className, children, ...props }, ref) {
110
+ const timeline = React.useContext(TimelineContext);
111
+ const { index, last } = React.useContext(TimelineItemContext);
112
+ // A bare item outside a timeline still renders — it is just one step with
113
+ // nothing before or after it. The defaults are the timeline's own.
114
+ const size = timeline?.size ?? 'md';
115
+ const density = timeline?.density ?? 'default';
116
+ const orientation = timeline?.orientation ?? 'vertical';
117
+ const family = color ?? timeline?.color ?? 'primary';
118
+ const active = timeline?.active ?? null;
119
+ const resolved = status ??
120
+ (active === null
121
+ ? 'upcoming'
122
+ : index < active
123
+ ? 'complete'
124
+ : index === active
125
+ ? 'current'
126
+ : 'upcoming');
127
+ const horizontal = orientation === 'horizontal';
128
+ // The last item's line would run off the end of the sequence into nothing.
129
+ const drawsConnector = connector !== 'none' && !last;
130
+ const bulletBox = (_jsx("span", { "aria-hidden": "true", className: cx('relative z-10 flex shrink-0 items-center justify-center rounded-full',
131
+ // The label inside the bullet is sized off the bullet rather than off
132
+ // the page's own text, so a number in an `xs` bullet is not the same
133
+ // 8px it would be in an `xl` one.
134
+ 'size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums', bulletStatusClasses[resolved], transitionClasses, iconClasses), children: bullet }));
135
+ /*
136
+ * The line, drawn as one border edge on an absolutely positioned box rather
137
+ * than as a filled `<div>`, so `dashed` and `dotted` are the browser's own
138
+ * dashes and land on the device pixel grid the way every other edge in the
139
+ * library does.
140
+ *
141
+ * It starts at the far edge of the bullet and runs to the edge of the item,
142
+ * which is where the next bullet begins — so the arithmetic is the bullet
143
+ * size, and that is the whole reason it is a custom property.
144
+ */
145
+ const connectorLine = drawsConnector ? (_jsx("span", { "aria-hidden": "true", className: cx('pointer-events-none absolute',
146
+ // Half the bullet, less half the line, so the 2px rule is centred on
147
+ // the bullet rather than starting at its centre.
148
+ horizontal
149
+ ? 'top-[calc(var(--p-bullet)/2_-_1px)] end-0 start-(--p-bullet) border-t-2'
150
+ : 'top-(--p-bullet) bottom-0 start-[calc(var(--p-bullet)/2_-_1px)] border-s-2', borderStyleClasses[connector], connectorColorClasses[resolved], transitionClasses) })) : null;
151
+ const body = (_jsxs("div", { className: cx('flex min-w-0 flex-col gap-0.5', horizontal ? 'mt-2' : ''), children: [hasContent(title) || hasContent(meta) ? (_jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [hasContent(title) ? (_jsx("span", { className: cx('font-semibold', sheetTitleClasses[size], titleStatusClasses[resolved], transitionClasses), children: title })) : null, hasContent(meta) ? (_jsx("span", { className: cx('text-(--plass-muted-fg)', metaTextClasses[size]), children: meta })) : null] })) : null, hasContent(children) ? (_jsx("div", { className: cx('text-(--plass-muted-fg)', sheetBodyClasses[size]), children: children })) : null] }));
152
+ return (_jsxs("li", { ref: ref, "aria-current": resolved === 'current' ? 'step' : undefined, "data-status": resolved, className: cx('relative', horizontal
153
+ ? cx('flex min-w-0 flex-1 flex-col', last ? '' : itemGapXClasses[density][size])
154
+ : cx('flex', bulletGapClasses[size], last ? '' : itemGapClasses[density][size]), className), style: {
155
+ '--p-bullet': bulletSizeValues[size],
156
+ ...surfaceSlots(family, 0),
157
+ // A container's slots leave the sheet undyed, which is right for the
158
+ // ground a bullet sits on — but a bullet *is* the thing being
159
+ // coloured, so the two fills it needs are put back.
160
+ '--p-fill': `var(--plass-${family}-fill)`,
161
+ '--p-on-solid': `var(--plass-${family}-on-solid)`
162
+ }, ...props, children: [connectorLine, bulletBox, body] }));
163
+ });
164
+ /**
165
+ * A sequence of steps, in the order they happen in.
166
+ *
167
+ * There is no Base UI primitive under this and there should not be: a timeline
168
+ * has no selection, no roving focus and no keyboard contract — it is a list, and
169
+ * reaching for a composite primitive to draw one would hand every consumer's
170
+ * record of events the semantics of a widget.
171
+ *
172
+ * It is an `<ol>` for the reason it exists at all: the order *is* the content. A
173
+ * screen reader announcing "list of 5 items" over an unordered list would be
174
+ * describing something else.
175
+ *
176
+ * The children are numbered here rather than by a prop on each item, so `active`
177
+ * has something to count against and inserting a step in the middle does not
178
+ * mean renumbering the ones after it.
179
+ */
180
+ export const PlTimeline = /* @__PURE__ */ React.forwardRef(function PlTimeline({ active, size = 'md', color = 'primary', density = 'default', orientation = 'vertical', render, className, style, children, ...props }, ref) {
181
+ // `toArray` is what drops the `null`s and `false`s a conditional step leaves
182
+ // behind, so `active={2}` counts the steps that are actually on the page.
183
+ const items = React.Children.toArray(children);
184
+ const count = items.length;
185
+ const context = React.useMemo(() => ({
186
+ size,
187
+ density,
188
+ orientation,
189
+ color,
190
+ active: active ?? null
191
+ }), [size, density, orientation, color, active]);
192
+ const element = useRender({
193
+ render: render ?? _jsx("ol", {}),
194
+ ref,
195
+ props: {
196
+ // Tailwind's reset takes the markers off every `<ol>`, and Safari takes
197
+ // the list semantics off with them. Saying `role="list"` out loud is the
198
+ // one-line fix, and it costs nothing when the reset is not there.
199
+ role: 'list',
200
+ className: cx('flex', orientation === 'horizontal' ? 'flex-row' : 'flex-col', className),
201
+ style: { ...surfaceSlots(color, 0), ...style },
202
+ children: items.map((item, index) => (_jsx(TimelineItemContext.Provider, { value: { index, last: index === count - 1 }, children: item }, index))),
203
+ ...props
204
+ }
205
+ });
206
+ return _jsx(TimelineContext.Provider, { value: context, children: element });
207
+ });
@@ -0,0 +1,2 @@
1
+ export { PlTimeline, PlTimelineItem } from './PlTimeline.js';
2
+ export type { PlTimelineConnector, PlTimelineItemProps, PlTimelineProps, PlTimelineStatus } from './PlTimeline.js';
@@ -0,0 +1 @@
1
+ export { PlTimeline, PlTimelineItem } from './PlTimeline.js';
@@ -0,0 +1,122 @@
1
+ import * as React from 'react';
2
+ import type { PlassAlign, PlassColor, PlassStyleProps, PlassVariant } from '../../types.js';
3
+ /**
4
+ * Where the stack sits.
5
+ *
6
+ * Written as two words rather than as a `side` plus an `align` pair, because
7
+ * they are not independent: a toast stack is always pinned to the top or the
8
+ * bottom, never to a side, and offering `left`/`right` as a "side" would invite
9
+ * a stack down the middle of the screen that nothing in the layout survives.
10
+ * The second half is `PlassAlign`, the same word every other component uses.
11
+ */
12
+ export type PlToastPosition = `top-${PlassAlign}` | `bottom-${PlassAlign}`;
13
+ /**
14
+ * The Plass style props a single toast can override, carried in Base UI's
15
+ * per-toast `data`. Anything not set here falls back to the provider.
16
+ */
17
+ export interface PlToastData {
18
+ color?: PlassColor;
19
+ variant?: PlassVariant;
20
+ icon?: React.ReactNode | false;
21
+ }
22
+ export interface PlToastOptions extends PlToastData {
23
+ /**
24
+ * Reusing an id updates that toast in place and restarts its timer, which is
25
+ * what "uploading… / uploaded" wants: one toast that changed its mind, not two
26
+ * stacked on each other.
27
+ */
28
+ id?: string;
29
+ /** The headline. */
30
+ title?: React.ReactNode;
31
+ /** The detail under it. A toast with only this is a one-line toast. */
32
+ description?: React.ReactNode;
33
+ /**
34
+ * How long before it dismisses itself, in milliseconds. `0` means it stays
35
+ * until it is closed — which is the right answer for anything the reader has
36
+ * to act on, because a toast that leaves before it is read said nothing.
37
+ */
38
+ timeout?: number;
39
+ /**
40
+ * `high` interrupts a screen reader; `low` waits for a pause. An error is
41
+ * worth interrupting for and a save confirmation is not.
42
+ * @default 'low'
43
+ */
44
+ priority?: 'low' | 'high';
45
+ /** The label of the action button. Passing it is what makes the button appear. */
46
+ actionLabel?: React.ReactNode;
47
+ onAction?: (event: React.MouseEvent<HTMLButtonElement>) => void;
48
+ /** Called when the toast closes, however it closed. */
49
+ onClose?: () => void;
50
+ /** Called once it has finished animating out and left the DOM. */
51
+ onRemove?: () => void;
52
+ }
53
+ export interface PlToastProviderProps extends Pick<PlassStyleProps, 'variant' | 'size' | 'density'> {
54
+ /** The default colour family. A single toast overrides it in `add`. */
55
+ color?: PlassColor;
56
+ /** @default 'bottom-end' */
57
+ position?: PlToastPosition;
58
+ /**
59
+ * How long a toast lasts by default, in milliseconds. `0` keeps every toast up
60
+ * until it is closed.
61
+ * @default 5000
62
+ */
63
+ timeout?: number;
64
+ /**
65
+ * How many are shown at once. The rest are kept and revealed as the stack
66
+ * drains rather than being thrown away.
67
+ * @default 3
68
+ */
69
+ limit?: number;
70
+ /**
71
+ * How wide a toast is allowed to get. Numbers are pixels.
72
+ * @default 380
73
+ */
74
+ width?: number | string;
75
+ /**
76
+ * Accessible name of every toast's × button. Never drawn.
77
+ * @default 'Close'
78
+ */
79
+ closeLabel?: string;
80
+ children?: React.ReactNode;
81
+ }
82
+ /**
83
+ * Raises toasts from anywhere under a `PlToastProvider`.
84
+ *
85
+ * A hook rather than a component, because the thing a caller has at the moment a
86
+ * toast is warranted is a click handler, not a place in the tree — and a
87
+ * `<PlToast open={…} />` they would have to keep mounted, with a piece of state
88
+ * per message, is the shape this component exists to avoid.
89
+ */
90
+ export declare function usePlToast(): {
91
+ /** Raises a toast and returns its id. */
92
+ add: (options: PlToastOptions) => string;
93
+ /** Closes one toast, or every toast when called with nothing. */
94
+ close: (id?: string) => void;
95
+ /** Changes a toast already on screen. */
96
+ update: (id: string, options: PlToastOptions) => void;
97
+ /**
98
+ * One toast that follows a promise: the loading message while it runs, then
99
+ * the success or the error. `timeout: 0` is applied to the loading state by
100
+ * Base UI, so a slow request cannot dismiss its own toast.
101
+ */
102
+ promise: <Value>(promise: Promise<Value>, options: {
103
+ loading: PlToastOptions;
104
+ success: PlToastOptions | ((value: Value) => PlToastOptions);
105
+ error: PlToastOptions | ((error: unknown) => PlToastOptions);
106
+ }) => Promise<Value>;
107
+ /** Every toast currently in the stack, newest first. */
108
+ toasts: import("@base-ui/react").ToastObject<PlToastData>[];
109
+ };
110
+ /**
111
+ * Puts the toast stack on the page and lets anything under it raise a message.
112
+ *
113
+ * Wrap the application once. Everything about how a toast *looks* is decided
114
+ * here — where the stack sits, how wide it is, which material it wears, how long
115
+ * it lasts — so the call site stays the one thing it should be: what happened.
116
+ *
117
+ * Base UI owns the parts of this that are genuinely hard and invisible when they
118
+ * work: the timers and their pausing on hover and on window blur, the limit, the
119
+ * swipe, the F6 focus hotkey, and the live region that makes a message which
120
+ * appeared out of nowhere reach a screen reader at all.
121
+ */
122
+ export declare function PlToastProvider({ variant, size, color, density, position, timeout, limit, width, closeLabel, children }: PlToastProviderProps): React.JSX.Element;
@@ -0,0 +1,174 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Toast as BaseUIToast } from '@base-ui/react/toast';
4
+ import { CloseIcon, severityIcon } from '../../internal/icons.js';
5
+ import { controlSlots, focusRingClasses, glassClasses, hasContent, iconClasses, metaTextClasses, radiusClasses, sheetBodyClasses, sheetHeaderGapClasses, sheetPaddingXClasses, sheetPaddingYClasses, sheetSectionGapClasses, sheetTitleClasses } from '../../internal/styles.js';
6
+ /**
7
+ * How a stack is pinned, per position.
8
+ *
9
+ * The viewport is full width in every case and the alignment is done with
10
+ * `items-*`, rather than by pinning one edge and nudging the centre back with a
11
+ * translate. That keeps the one `transform` this component could have wanted out
12
+ * of it, and it means the same three classes serve all six positions.
13
+ */
14
+ const viewportClasses = {
15
+ 'top-start': 'top-0 items-start',
16
+ 'top-center': 'top-0 items-center',
17
+ 'top-end': 'top-0 items-end',
18
+ 'bottom-start': 'bottom-0 flex-col-reverse items-start',
19
+ 'bottom-center': 'bottom-0 flex-col-reverse items-center',
20
+ 'bottom-end': 'bottom-0 flex-col-reverse items-end'
21
+ };
22
+ /**
23
+ * A toast floats over the page, so — with the `PlSelect` popup, the `PlModal`
24
+ * sheet and the `PlTooltip` plate — it carries a shadow by default, at level 3.
25
+ *
26
+ * The two undyed materials are the glass at its most opaque, for the reason the
27
+ * modal's sheet is: what is behind a toast is arbitrary, and a 62%-translucent
28
+ * pane over a photograph is a pane you read the photograph through.
29
+ */
30
+ const rootClasses = {
31
+ solid: /* @__PURE__ */ [
32
+ 'text-(--p-on-solid) [background-image:var(--p-fill)]',
33
+ '[box-shadow:var(--plass-shadow-3),var(--p-lift)]'
34
+ ].join(' '),
35
+ glass: /* @__PURE__ */ [
36
+ glassClasses,
37
+ 'border text-(--plass-fg) bg-(--plass-glass-press)',
38
+ '[border-color:var(--p-line)]',
39
+ '[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]'
40
+ ].join(' '),
41
+ ghost: /* @__PURE__ */ [
42
+ glassClasses,
43
+ 'text-(--plass-fg) bg-(--plass-glass-press)',
44
+ '[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]'
45
+ ].join(' ')
46
+ };
47
+ const accentClasses = {
48
+ solid: '',
49
+ glass: 'text-(--p-accent)',
50
+ ghost: 'text-(--p-accent)'
51
+ };
52
+ /**
53
+ * Turns a Plass toast into the object Base UI's manager stores.
54
+ *
55
+ * The style props go into `data` rather than becoming top-level fields, because
56
+ * `data` is the slot Base UI reserves for exactly this and the alternative —
57
+ * shadowing the manager's own option names — is how a library ends up with two
58
+ * `type` props that mean different things.
59
+ */
60
+ function toManagerOptions(options) {
61
+ const { color, variant, icon, actionLabel, onAction, ...rest } = options;
62
+ return {
63
+ ...rest,
64
+ data: { color, variant, icon },
65
+ actionProps: actionLabel === undefined
66
+ ? undefined
67
+ : { children: actionLabel, onClick: onAction }
68
+ };
69
+ }
70
+ /**
71
+ * Raises toasts from anywhere under a `PlToastProvider`.
72
+ *
73
+ * A hook rather than a component, because the thing a caller has at the moment a
74
+ * toast is warranted is a click handler, not a place in the tree — and a
75
+ * `<PlToast open={…} />` they would have to keep mounted, with a piece of state
76
+ * per message, is the shape this component exists to avoid.
77
+ */
78
+ export function usePlToast() {
79
+ const manager = BaseUIToast.useToastManager();
80
+ return React.useMemo(() => ({
81
+ /** Raises a toast and returns its id. */
82
+ add: (options) => manager.add(toManagerOptions(options)),
83
+ /** Closes one toast, or every toast when called with nothing. */
84
+ close: (id) => manager.close(id),
85
+ /** Changes a toast already on screen. */
86
+ update: (id, options) => manager.update(id, toManagerOptions(options)),
87
+ /**
88
+ * One toast that follows a promise: the loading message while it runs, then
89
+ * the success or the error. `timeout: 0` is applied to the loading state by
90
+ * Base UI, so a slow request cannot dismiss its own toast.
91
+ */
92
+ promise: (promise, options) => manager.promise(promise, {
93
+ loading: toManagerOptions(options.loading),
94
+ success: (value) => toManagerOptions(typeof options.success === 'function' ? options.success(value) : options.success),
95
+ error: (error) => toManagerOptions(typeof options.error === 'function' ? options.error(error) : options.error)
96
+ }),
97
+ /** Every toast currently in the stack, newest first. */
98
+ toasts: manager.toasts
99
+ }), [manager]);
100
+ }
101
+ function ToastItem({ toast, variant: providerVariant, color: providerColor, size, density, closeLabel, swipeDirection }) {
102
+ const variant = toast.data?.variant ?? providerVariant ?? 'glass';
103
+ const color = toast.data?.color ?? providerColor;
104
+ const glyph = toast.data?.icon === undefined ? severityIcon(color) : toast.data.icon;
105
+ const accent = accentClasses[variant];
106
+ const titled = hasContent(toast.title);
107
+ return (_jsxs(BaseUIToast.Root, { toast: toast, swipeDirection: swipeDirection, className: [
108
+ 'pointer-events-auto flex w-full items-start',
109
+ sheetPaddingXClasses[density ?? 'default'][size],
110
+ sheetPaddingYClasses[density ?? 'default'][size],
111
+ radiusClasses[size],
112
+ sheetSectionGapClasses[size],
113
+ sheetBodyClasses[size],
114
+ rootClasses[variant],
115
+ iconClasses,
116
+ // Opacity, and only opacity — the same restraint the modal shows, and
117
+ // for the same reason: this is a box full of text. Base UI still moves
118
+ // it while a finger is dragging it, which is the reader's hand rather
119
+ // than a state change, and it stops the moment the finger lifts.
120
+ '[transition:opacity_var(--plass-duration)_var(--plass-ease)]',
121
+ 'data-[starting-style]:opacity-0 data-[ending-style]:opacity-0',
122
+ // A toast pushed out by the limit is kept in the DOM so it can come
123
+ // back; it just has nothing to say while it waits.
124
+ 'data-[limited]:hidden',
125
+ focusRingClasses,
126
+ '[outline:none]'
127
+ ]
128
+ .filter(Boolean)
129
+ .join(' '), style: controlSlots(color, 3, variant), children: [hasContent(glyph) ? (_jsx("span", { className: `flex h-[1lh] shrink-0 items-center ${accent}`, children: glyph })) : null, _jsxs("div", { className: `flex min-w-0 flex-1 flex-col ${sheetHeaderGapClasses[size]}`, children: [_jsx(BaseUIToast.Title, { className: `plass-title font-semibold ${sheetTitleClasses[size]} ${accent}` }), _jsx(BaseUIToast.Description, { className: titled && variant !== 'solid' ? 'text-(--plass-muted-fg)' : '' })] }), _jsx(BaseUIToast.Action, { className: [
130
+ 'flex h-[1lh] shrink-0 cursor-pointer items-center rounded-full px-2',
131
+ 'font-medium underline-offset-2',
132
+ accent || 'text-(--p-on-solid)',
133
+ 'hover:underline',
134
+ focusRingClasses,
135
+ metaTextClasses[size]
136
+ ].join(' ') }), _jsx("span", { className: "flex h-[1lh] shrink-0 items-center", children: _jsx(BaseUIToast.Close, { "aria-label": closeLabel, className: [
137
+ 'inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full',
138
+ 'opacity-70 [transition:opacity_var(--plass-duration)_var(--plass-ease)]',
139
+ 'hover:opacity-100 focus-visible:opacity-100',
140
+ focusRingClasses
141
+ ].join(' '), children: _jsx(CloseIcon, {}) }) })] }));
142
+ }
143
+ /** The stack itself. Rendered by the provider, never by a caller. */
144
+ function ToastViewport(props) {
145
+ const { toasts } = BaseUIToast.useToastManager();
146
+ const { position, width, ...rest } = props;
147
+ const swipeDirection = [
148
+ position.startsWith('top') ? 'up' : 'down',
149
+ 'left',
150
+ 'right'
151
+ ];
152
+ return (_jsx(BaseUIToast.Portal, { children: _jsx(BaseUIToast.Viewport, { className: [
153
+ // Full width and `pointer-events-none`, so the strip across the top or
154
+ // the bottom of the page is not a wall the rest of the app is behind.
155
+ // The toasts themselves take their events back.
156
+ 'plass-portal pointer-events-none fixed inset-x-0 z-50 flex flex-col gap-2 p-4',
157
+ viewportClasses[position]
158
+ ].join(' '), children: toasts.map((toast) => (_jsx("div", { className: "w-full", style: { maxWidth: typeof width === 'number' ? `${width}px` : width }, children: _jsx(ToastItem, { toast: toast, swipeDirection: swipeDirection, ...rest }) }, toast.id))) }) }));
159
+ }
160
+ /**
161
+ * Puts the toast stack on the page and lets anything under it raise a message.
162
+ *
163
+ * Wrap the application once. Everything about how a toast *looks* is decided
164
+ * here — where the stack sits, how wide it is, which material it wears, how long
165
+ * it lasts — so the call site stays the one thing it should be: what happened.
166
+ *
167
+ * Base UI owns the parts of this that are genuinely hard and invisible when they
168
+ * work: the timers and their pausing on hover and on window blur, the limit, the
169
+ * swipe, the F6 focus hotkey, and the live region that makes a message which
170
+ * appeared out of nowhere reach a screen reader at all.
171
+ */
172
+ export function PlToastProvider({ variant = 'glass', size = 'md', color = 'primary', density = 'default', position = 'bottom-end', timeout = 5000, limit = 3, width = 380, closeLabel = 'Close', children }) {
173
+ return (_jsxs(BaseUIToast.Provider, { timeout: timeout, limit: limit, children: [children, _jsx(ToastViewport, { position: position, variant: variant, size: size, color: color, density: density, width: width, closeLabel: closeLabel })] }));
174
+ }
@@ -0,0 +1,2 @@
1
+ export { PlToastProvider, usePlToast } from './PlToast.js';
2
+ export type { PlToastData, PlToastOptions, PlToastPosition, PlToastProviderProps } from './PlToast.js';
@@ -0,0 +1 @@
1
+ export { PlToastProvider, usePlToast } from './PlToast.js';
@@ -0,0 +1,68 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { PlassElevation, PlassPosition, PlassStyleProps } from '../../types.js';
4
+ export interface PlToolbarProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
5
+ /**
6
+ * Drop shadow depth. `0` — the default — is flat even when the bar is pinned:
7
+ * a shadow under a header is a way of saying "there is content beneath this",
8
+ * and that is only true once the page has been scrolled. Raise it yourself, or
9
+ * leave it flat and turn on `divider`.
10
+ * @default 0
11
+ */
12
+ elevation?: PlassElevation;
13
+ /**
14
+ * How the bar sits in the page's scroll.
15
+ *
16
+ * - `static` — in the flow, scrolling away with the content.
17
+ * - `sticky` — in the flow until it reaches the edge, then held there. What an
18
+ * application header usually wants: it takes up its own space, so nothing
19
+ * underneath has to be padded around it.
20
+ * - `fixed` — out of the flow entirely. The page needs padding of its own, or
21
+ * the first screenful sits behind the bar.
22
+ * @default 'static'
23
+ */
24
+ position?: PlassPosition;
25
+ /** Which edge it is held against when `position` is not `static`. @default 'top' */
26
+ side?: 'top' | 'bottom';
27
+ /**
28
+ * Draws a hairline along the edge that faces the content — under a `top` bar,
29
+ * over a `bottom` one.
30
+ * @default false
31
+ */
32
+ divider?: boolean;
33
+ /** Pinned to the start of the bar: a logo, a title, a back button. */
34
+ start?: React.ReactNode;
35
+ /** Pinned to the end: the actions. */
36
+ end?: React.ReactNode;
37
+ /**
38
+ * Renders something other than a `<div>` — `render={<header />}`,
39
+ * `render={<nav />}`. Base UI's own escape hatch, and worth reaching for here:
40
+ * a page's header should be a `<header>`.
41
+ */
42
+ render?: useRender.RenderProp;
43
+ /** The middle. Takes whatever width `start` and `end` leave. */
44
+ children?: React.ReactNode;
45
+ }
46
+ /**
47
+ * A bar of controls: an application header, a page's action row, the strip along
48
+ * the bottom of an editor.
49
+ *
50
+ * Three slots and a row. `start` and `end` are pinned to their ends and
51
+ * `children` takes what is left, which is the arrangement every toolbar has ever
52
+ * had — so it is laid out here rather than left to a caller and a spacer `<div>`
53
+ * they have to remember.
54
+ *
55
+ * The one thing it does not do is take a height. A toolbar is as tall as the
56
+ * controls in it plus its padding, and that padding is the `size` / `density`
57
+ * pair every other surface uses — so `density="compact"` gives the dense bar
58
+ * without a second prop meaning the same thing, and without the type scale
59
+ * moving.
60
+ *
61
+ * It has **no `role="toolbar"`**, deliberately. That role is a promise about
62
+ * keyboard behaviour — one tab stop for the whole bar, arrow keys between the
63
+ * controls in it — and a bar that claims it without implementing it is worse for
64
+ * a keyboard reader than one that never claimed anything. What a page header
65
+ * wants is `render={<header />}`; what a genuine roving-focus set of choices
66
+ * wants is a `PlSegmentedButton`, which is one.
67
+ */
68
+ export declare const PlToolbar: React.ForwardRefExoticComponent<PlToolbarProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import { cx, hasContent, radiusClasses, sheetPaddingXClasses, sheetPaddingYClasses, sheetRestClasses, sheetSectionGapClasses, surfaceSlots, transitionClasses } from '../../internal/styles.js';
5
+ /**
6
+ * The three materials, said the way a *container* says them — the bar is never
7
+ * dyed, exactly as on a `PlBox` and a `PlCard`. A toolbar holds other people's
8
+ * controls, and those controls arrive with colours of their own.
9
+ */
10
+ const variantClasses = sheetRestClasses;
11
+ const positionClasses = {
12
+ static: { top: '', bottom: '' },
13
+ sticky: { top: 'sticky top-0 z-20', bottom: 'sticky bottom-0 z-20' },
14
+ fixed: { top: 'fixed inset-x-0 top-0 z-30', bottom: 'fixed inset-x-0 bottom-0 z-30' }
15
+ };
16
+ /**
17
+ * The rule faces the content, so it moves to the other edge on a bottom bar.
18
+ *
19
+ * `--plass-divider` and not the sheet's own white edge line: this is a mark the
20
+ * sheet makes on *itself*, and white light on a cut edge only reads when the
21
+ * page wash is behind it.
22
+ */
23
+ const dividerClasses = {
24
+ top: 'border-b [border-color:var(--plass-divider)]',
25
+ bottom: 'border-t [border-color:var(--plass-divider)]'
26
+ };
27
+ /**
28
+ * A bar of controls: an application header, a page's action row, the strip along
29
+ * the bottom of an editor.
30
+ *
31
+ * Three slots and a row. `start` and `end` are pinned to their ends and
32
+ * `children` takes what is left, which is the arrangement every toolbar has ever
33
+ * had — so it is laid out here rather than left to a caller and a spacer `<div>`
34
+ * they have to remember.
35
+ *
36
+ * The one thing it does not do is take a height. A toolbar is as tall as the
37
+ * controls in it plus its padding, and that padding is the `size` / `density`
38
+ * pair every other surface uses — so `density="compact"` gives the dense bar
39
+ * without a second prop meaning the same thing, and without the type scale
40
+ * moving.
41
+ *
42
+ * It has **no `role="toolbar"`**, deliberately. That role is a promise about
43
+ * keyboard behaviour — one tab stop for the whole bar, arrow keys between the
44
+ * controls in it — and a bar that claims it without implementing it is worse for
45
+ * a keyboard reader than one that never claimed anything. What a page header
46
+ * wants is `render={<header />}`; what a genuine roving-focus set of choices
47
+ * wants is a `PlSegmentedButton`, which is one.
48
+ */
49
+ export const PlToolbar = /* @__PURE__ */ React.forwardRef(function PlToolbar({ variant = 'glass', size = 'md', color = 'primary', density = 'default', elevation = 0, position = 'static', side = 'top', divider = false, start, end, render, className, style, children, ...props }, ref) {
50
+ const classNames = cx('flex w-full min-w-0 items-center', sheetPaddingXClasses[density][size], sheetPaddingYClasses[density][size], sheetSectionGapClasses[size],
51
+ // A pinned bar spans an edge of the window, and a rounded corner against
52
+ // the edge of the screen is a gap with nothing behind it. Only a bar
53
+ // sitting in the flow is a sheet with corners.
54
+ position === 'static' ? radiusClasses[size] : '', variantClasses[variant], divider ? dividerClasses[side] : '', positionClasses[position][side], transitionClasses, className);
55
+ return useRender({
56
+ render: render ?? _jsx("div", {}),
57
+ ref,
58
+ props: {
59
+ className: classNames,
60
+ style: { ...surfaceSlots(color, elevation), ...style },
61
+ children: (_jsxs(_Fragment, { children: [hasContent(start) ? (_jsx("div", { className: "flex min-w-0 shrink-0 items-center gap-2", children: start })) : null, _jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: children }), hasContent(end) ? (_jsx("div", { className: "flex min-w-0 shrink-0 items-center gap-2", children: end })) : null] })),
62
+ ...props
63
+ }
64
+ });
65
+ });
@@ -0,0 +1,2 @@
1
+ export { PlToolbar } from './PlToolbar.js';
2
+ export type { PlToolbarProps } from './PlToolbar.js';
@@ -0,0 +1 @@
1
+ export { PlToolbar } from './PlToolbar.js';