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,138 @@
1
+ import * as React from 'react';
2
+ import type { PlassColor, PlassDensity, PlassSize } from '../../types.js';
3
+ /**
4
+ * What is drawn between two steps of the trail.
5
+ *
6
+ * Four named marks rather than a free-for-all, because a separator is read
7
+ * hundreds of times a day and the difference between them is meaning, not
8
+ * decoration: a `chevron` and an `arrow` say "and then", a `slash` says "path",
9
+ * a `dot` says "these are peers of one thing". Anything else can still be passed
10
+ * as a node.
11
+ */
12
+ export type PlBreadcrumbSeparator = 'chevron' | 'arrow' | 'slash' | 'dot';
13
+ export interface PlBreadcrumbProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'color'> {
14
+ /** @default 'md' */
15
+ size?: PlassSize;
16
+ /**
17
+ * The colour family a link picks up when it is hovered.
18
+ * @default 'primary'
19
+ */
20
+ color?: PlassColor;
21
+ /**
22
+ * How tightly the steps pack. Spacing only.
23
+ * @default 'default'
24
+ */
25
+ density?: PlassDensity;
26
+ /**
27
+ * The mark between two steps. One of the four names, or any node.
28
+ * @default 'chevron'
29
+ */
30
+ separator?: PlBreadcrumbSeparator | React.ReactNode;
31
+ /**
32
+ * How many steps to show before the middle is folded away behind a `…`. Left
33
+ * out, the whole trail is shown however long it gets.
34
+ */
35
+ maxItems?: number;
36
+ /**
37
+ * How many steps stay at the front of a folded trail.
38
+ * @default 1
39
+ */
40
+ itemsBeforeCollapse?: number;
41
+ /**
42
+ * How many stay at the end.
43
+ * @default 1
44
+ */
45
+ itemsAfterCollapse?: number;
46
+ /**
47
+ * Whether pressing the `…` unfolds the trail in place. Turn it off to leave
48
+ * the fold as a plain mark.
49
+ * @default true
50
+ */
51
+ expandable?: boolean;
52
+ /**
53
+ * The name the trail is announced by. Never drawn.
54
+ * @default 'Breadcrumb'
55
+ */
56
+ label?: string;
57
+ /**
58
+ * What the `…` is announced as. Never drawn.
59
+ * @default 'Show the hidden steps'
60
+ */
61
+ expandLabel?: string;
62
+ /**
63
+ * Emits the trail a second time as a `BreadcrumbList`, in a
64
+ * `<script type="application/ld+json">` beside the markup.
65
+ *
66
+ * Off by default, because a page can only have one of these and a great many
67
+ * apps already emit theirs from an SEO layer of their own — two would be a
68
+ * page describing itself twice. Turn it on where this component *is* the
69
+ * trail: correct markup alone is not what puts a path under a search result,
70
+ * and the structured data is.
71
+ *
72
+ * Every step goes in, including the ones a `maxItems` fold is hiding — what is
73
+ * collapsed is a matter of how much room the row has, and the path is the path
74
+ * either way.
75
+ * @default false
76
+ */
77
+ structuredData?: boolean;
78
+ /**
79
+ * What relative `href`s are resolved against for `structuredData` — the site's
80
+ * origin, as `https://example.com`.
81
+ *
82
+ * Search engines want an absolute URL there. Without this the `href`s are
83
+ * emitted exactly as written, which is right when they are already absolute
84
+ * and not much use when they are not.
85
+ */
86
+ baseUrl?: string;
87
+ /** The `PlBreadcrumbItem`s. */
88
+ children?: React.ReactNode;
89
+ }
90
+ export interface PlBreadcrumbItemProps extends Omit<React.ComponentPropsWithoutRef<'li'>, 'color' | 'onClick'> {
91
+ /** Renders the step as a link. */
92
+ href?: string;
93
+ /** Fires when the step is pressed. Renders it as a button when there is no `href`. */
94
+ onClick?: React.MouseEventHandler<HTMLElement>;
95
+ /** Content before the label — a home glyph, a repository avatar. */
96
+ startIcon?: React.ReactNode;
97
+ /** Content after the label. */
98
+ endIcon?: React.ReactNode;
99
+ /**
100
+ * Marks this step as the page you are on, which stops it being a link.
101
+ *
102
+ * The last step is the current one on its own, so this is only needed for a
103
+ * trail that ends somewhere the reader is not — and setting it anywhere takes
104
+ * the mark off the last step, because only one step in a trail can be it.
105
+ */
106
+ current?: boolean;
107
+ /** Unavailable. Stops answering, keeps its place in the trail. */
108
+ disabled?: boolean;
109
+ /** The step's label. */
110
+ children?: React.ReactNode;
111
+ }
112
+ /**
113
+ * The trail of pages above the one being read.
114
+ *
115
+ * Two things make this more than a row of links. The first is that the last step
116
+ * is where the reader already is, so it is not a link at all — it carries
117
+ * `aria-current="page"` and stops being pressable, and the component works that
118
+ * out rather than asking every caller to remember it. The second is the fold: a
119
+ * trail seven levels deep is a trail nobody reads, so the middle collapses to a
120
+ * `…` that puts it back when pressed.
121
+ *
122
+ * The separators are drawn by the trail rather than by the steps. A step does
123
+ * not know whether anything follows it, and a mark that belonged to a step would
124
+ * have to be taken off the last one by hand.
125
+ *
126
+ * There is no `variant` and no `elevation`: a trail is a line of text above the
127
+ * page, not a surface laid on it.
128
+ */
129
+ export declare const PlBreadcrumb: React.ForwardRefExoticComponent<PlBreadcrumbProps & React.RefAttributes<HTMLElement>>;
130
+ /**
131
+ * One step of the trail.
132
+ *
133
+ * It renders three different things and the caller picks by what they pass: an
134
+ * `<a>` with an `href`, a `<button>` with an `onClick`, and a plain `<span>` with
135
+ * neither — which is what the last step is, because the page you are already on
136
+ * is not somewhere to go.
137
+ */
138
+ export declare const PlBreadcrumbItem: React.ForwardRefExoticComponent<PlBreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,201 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { ArrowRightIcon, ChevronIcon, EllipsisIcon } from '../../internal/icons.js';
4
+ import { controlTextClasses, cx, focusRingClasses, gapClasses, hasContent, iconClasses, radiusClasses, transitionClasses } from '../../internal/styles.js';
5
+ const BreadcrumbContext = /* @__PURE__ */ React.createContext({
6
+ size: 'md',
7
+ last: false
8
+ });
9
+ /** Between the steps, and the only thing `density` touches. */
10
+ const trailGapClasses = {
11
+ default: { xs: 'gap-1', sm: 'gap-1.5', md: 'gap-2', lg: 'gap-2.5', xl: 'gap-3' },
12
+ compact: { xs: 'gap-0.5', sm: 'gap-1', md: 'gap-1', lg: 'gap-1.5', xl: 'gap-2' }
13
+ };
14
+ /**
15
+ * A step's corner, read two steps down the radius ladder.
16
+ *
17
+ * `radiusClasses.md` is 12px, which on a line of text 20px tall is most of the
18
+ * way to a pill — and a breadcrumb step is not a `PlChip`. What the hover tint
19
+ * needs is a rectangle with the corners taken off, which is what the ladder says
20
+ * everywhere else; it just has to be read further down for something this short.
21
+ */
22
+ const stepRadiusClasses = {
23
+ xs: radiusClasses.xs,
24
+ sm: radiusClasses.xs,
25
+ md: radiusClasses.xs,
26
+ lg: radiusClasses.sm,
27
+ xl: radiusClasses.sm
28
+ };
29
+ /**
30
+ * The four marks.
31
+ *
32
+ * The two that point are glyphs turned rather than redrawn, the same allowance
33
+ * the no-transform rule makes for the chevron on a `PlAccordion`: the wedge is
34
+ * drawn pointing down once, and a trail turns it a quarter. Both turn back under
35
+ * RTL, because a trail runs the way the language does.
36
+ */
37
+ function separatorMark(separator) {
38
+ switch (separator) {
39
+ case 'chevron':
40
+ return (_jsx("span", { className: "flex -rotate-90 items-center rtl:rotate-90", children: _jsx(ChevronIcon, {}) }));
41
+ case 'arrow':
42
+ return (_jsx("span", { className: "flex items-center rtl:rotate-180", children: _jsx(ArrowRightIcon, {}) }));
43
+ case 'slash':
44
+ return _jsx("span", { className: "opacity-70", children: "/" });
45
+ case 'dot':
46
+ return _jsx("span", { className: "opacity-70", children: "\u00B7" });
47
+ default:
48
+ return null;
49
+ }
50
+ }
51
+ const separatorNames = ['chevron', 'arrow', 'slash', 'dot'];
52
+ /**
53
+ * The words in a step, with everything that is not a word left out.
54
+ *
55
+ * A step's label is a `ReactNode` and `name` in the structured data is a string,
56
+ * so the tree is walked for its text. Only `children` is read — a `startIcon` is
57
+ * a picture of the thing rather than its name, and a home glyph contributing
58
+ * nothing is exactly right.
59
+ */
60
+ function textOf(node) {
61
+ if (typeof node === 'string' || typeof node === 'number') {
62
+ return String(node);
63
+ }
64
+ if (Array.isArray(node)) {
65
+ return node.map(textOf).join('');
66
+ }
67
+ if (React.isValidElement(node)) {
68
+ return textOf(node.props.children);
69
+ }
70
+ return '';
71
+ }
72
+ /**
73
+ * A step's `href` as a search engine wants it: absolute.
74
+ *
75
+ * `new URL` is what resolves `../guide` against a base rather than pasting the
76
+ * two together, and it throws on anything it cannot make sense of — a base that
77
+ * is not a URL, an `href` that is a router-only path. Falling back to the `href`
78
+ * as written is better than dropping the entry: a relative URL is a weaker
79
+ * signal, an absent one is none.
80
+ */
81
+ function absoluteHref(href, baseUrl) {
82
+ if (!baseUrl) {
83
+ return href;
84
+ }
85
+ try {
86
+ return new URL(href, baseUrl).href;
87
+ }
88
+ catch {
89
+ return href;
90
+ }
91
+ }
92
+ /**
93
+ * The trail as `schema.org`'s `BreadcrumbList`.
94
+ *
95
+ * `item` is omitted where a step has no `href`, which is the last step's usual
96
+ * case: a crawler reads a final entry without one as the page being looked at,
97
+ * and a `ListItem` pointing at nothing would be worse than one pointing nowhere.
98
+ */
99
+ function breadcrumbListData(steps, baseUrl) {
100
+ const itemListElement = steps.map((step, index) => {
101
+ const { href, children } = step.props;
102
+ return {
103
+ '@type': 'ListItem',
104
+ position: index + 1,
105
+ name: textOf(children),
106
+ ...(href ? { item: absoluteHref(href, baseUrl) } : null)
107
+ };
108
+ });
109
+ // `<` is escaped because this string is written into a `<script>`: a label
110
+ // holding `</script>` would otherwise close the tag and turn the rest of the
111
+ // JSON into markup.
112
+ return JSON.stringify({
113
+ '@context': 'https://schema.org',
114
+ '@type': 'BreadcrumbList',
115
+ itemListElement
116
+ }).replace(/</g, '\\u003c');
117
+ }
118
+ function isSeparatorName(value) {
119
+ return typeof value === 'string' && separatorNames.includes(value);
120
+ }
121
+ /**
122
+ * The trail of pages above the one being read.
123
+ *
124
+ * Two things make this more than a row of links. The first is that the last step
125
+ * is where the reader already is, so it is not a link at all — it carries
126
+ * `aria-current="page"` and stops being pressable, and the component works that
127
+ * out rather than asking every caller to remember it. The second is the fold: a
128
+ * trail seven levels deep is a trail nobody reads, so the middle collapses to a
129
+ * `…` that puts it back when pressed.
130
+ *
131
+ * The separators are drawn by the trail rather than by the steps. A step does
132
+ * not know whether anything follows it, and a mark that belonged to a step would
133
+ * have to be taken off the last one by hand.
134
+ *
135
+ * There is no `variant` and no `elevation`: a trail is a line of text above the
136
+ * page, not a surface laid on it.
137
+ */
138
+ export const PlBreadcrumb = /* @__PURE__ */ React.forwardRef(function PlBreadcrumb({ size = 'md', color = 'primary', density = 'default', separator = 'chevron', maxItems, itemsBeforeCollapse = 1, itemsAfterCollapse = 1, expandable = true, label = 'Breadcrumb', expandLabel = 'Show the hidden steps', structuredData = false, baseUrl, className, style, children, ...props }, ref) {
139
+ const [unfolded, setUnfolded] = React.useState(false);
140
+ const steps = React.Children.toArray(children).filter(React.isValidElement);
141
+ const total = steps.length;
142
+ /*
143
+ * The last step is the page you are on — unless a step says it is. Exactly one
144
+ * element in a trail may carry `aria-current="page"`, so a caller who marks an
145
+ * earlier step has to take the mark off the last one, and doing that by hand
146
+ * would mean writing `current={false}` on a step that never asked for it.
147
+ */
148
+ const claimed = steps.some((step) => step.props.current === true);
149
+ const folding = !unfolded &&
150
+ maxItems !== undefined &&
151
+ total > Math.max(maxItems, 1) &&
152
+ // A fold has to actually remove something. With `1` before and `1` after on
153
+ // a three-step trail the `…` would stand in for exactly one step, which is
154
+ // longer than the step it replaced.
155
+ total - itemsBeforeCollapse - itemsAfterCollapse > 1;
156
+ const shown = folding
157
+ ? [
158
+ ...steps.slice(0, Math.max(0, itemsBeforeCollapse)),
159
+ null,
160
+ ...steps.slice(total - Math.max(0, itemsAfterCollapse))
161
+ ]
162
+ : steps;
163
+ const mark = isSeparatorName(separator) ? separatorMark(separator) : separator;
164
+ const foldClassNames = cx('inline-flex items-center rounded-(--plass-radius-xs) px-0.5', 'text-(--plass-muted-fg)', transitionClasses, iconClasses, expandable
165
+ ? cx('cursor-pointer hover:bg-(--p-soft) hover:text-(--p-accent)', focusRingClasses)
166
+ : '');
167
+ return (_jsxs("nav", { ref: ref, "aria-label": label, className: cx('flex', controlTextClasses[size], iconClasses, className), style: {
168
+ '--p-accent': `var(--plass-${color}-accent)`,
169
+ '--p-soft': `var(--plass-${color}-soft)`,
170
+ '--p-ring': `var(--plass-${color}-ring)`,
171
+ ...style
172
+ }, ...props, children: [structuredData && total > 0 ? (_jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: breadcrumbListData(steps, baseUrl) } })) : null, _jsx("ol", {
173
+ // `role="list"` said out loud: Tailwind's reset takes the bullets off
174
+ // every `<ol>`, and Safari takes the list semantics off with them.
175
+ role: "list", className: cx('flex list-none flex-wrap items-center p-0', trailGapClasses[density][size]), children: shown.map((step, index) => (_jsxs(React.Fragment, { children: [index > 0 ? (_jsx("li", { "aria-hidden": "true", className: "flex shrink-0 items-center text-(--plass-muted-fg) select-none", children: mark })) : null, step ? (_jsx(BreadcrumbContext.Provider, { value: { size, last: !claimed && index === shown.length - 1 }, children: step })) : (_jsx("li", { className: "flex shrink-0 items-center", children: expandable ? (_jsx("button", { type: "button", className: foldClassNames, "aria-label": expandLabel, onClick: () => setUnfolded(true), children: _jsx(EllipsisIcon, {}) })) : (_jsx("span", { className: foldClassNames, "aria-hidden": "true", children: _jsx(EllipsisIcon, {}) })) }))] }, step ? (step.key ?? index) : 'fold'))) })] }));
176
+ });
177
+ /**
178
+ * One step of the trail.
179
+ *
180
+ * It renders three different things and the caller picks by what they pass: an
181
+ * `<a>` with an `href`, a `<button>` with an `onClick`, and a plain `<span>` with
182
+ * neither — which is what the last step is, because the page you are already on
183
+ * is not somewhere to go.
184
+ */
185
+ export const PlBreadcrumbItem = /* @__PURE__ */ React.forwardRef(function PlBreadcrumbItem({ href, onClick, startIcon, endIcon, current, disabled = false, className, children, ...props }, ref) {
186
+ const { size, last } = React.useContext(BreadcrumbContext);
187
+ const isCurrent = current ?? last;
188
+ const interactive = Boolean(href || onClick) && !isCurrent && !disabled;
189
+ const stepClassNames = cx('inline-flex min-w-0 items-center px-1', gapClasses[size], stepRadiusClasses[size], transitionClasses,
190
+ // An if/else rather than stacked variants: two Tailwind classes of equal
191
+ // specificity resolve by their order in the generated stylesheet.
192
+ disabled
193
+ ? 'cursor-not-allowed text-(--plass-muted-fg) opacity-50'
194
+ : isCurrent
195
+ ? 'font-medium text-(--plass-fg)'
196
+ : interactive
197
+ ? cx('cursor-pointer text-(--plass-muted-fg)', 'hover:bg-(--p-soft) hover:text-(--p-accent)', focusRingClasses)
198
+ : 'text-(--plass-muted-fg)');
199
+ const body = (_jsxs(_Fragment, { children: [hasContent(startIcon) ? (_jsx("span", { className: "flex h-[1lh] shrink-0 items-center", children: startIcon })) : null, _jsx("span", { className: "truncate", children: children }), hasContent(endIcon) ? (_jsx("span", { className: "flex h-[1lh] shrink-0 items-center", children: endIcon })) : null] }));
200
+ return (_jsx("li", { ref: ref, className: cx('flex min-w-0 items-center', className), ...props, children: interactive && href ? (_jsx("a", { href: href, className: stepClassNames, onClick: onClick, children: body })) : interactive ? (_jsx("button", { type: "button", className: stepClassNames, onClick: onClick, children: body })) : (_jsx("span", { className: stepClassNames, "aria-current": isCurrent ? 'page' : undefined, "aria-disabled": disabled || undefined, children: body })) }));
201
+ });
@@ -0,0 +1,2 @@
1
+ export { PlBreadcrumb, PlBreadcrumbItem } from './PlBreadcrumb.js';
2
+ export type { PlBreadcrumbItemProps, PlBreadcrumbProps, PlBreadcrumbSeparator } from './PlBreadcrumb.js';
@@ -0,0 +1 @@
1
+ export { PlBreadcrumb, PlBreadcrumbItem } from './PlBreadcrumb.js';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
- import type { PlassElevation, PlassStyleProps } from '../../types';
4
- export interface ButtonProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'button'>, 'color'> {
3
+ import type { PlassElevation, PlassStyleProps } from '../../types.js';
4
+ export interface PlButtonProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'button'>, 'color'> {
5
5
  /**
6
6
  * Drop shadow depth. `1` is the default, because a moulded key **rests on**
7
7
  * the sheet rather than lying flush with it. Hover adds a level and pressing
@@ -39,4 +39,4 @@ export interface ButtonProps extends PlassStyleProps, Omit<React.ComponentPropsW
39
39
  render?: useRender.RenderProp;
40
40
  children?: React.ReactNode;
41
41
  }
42
- export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
42
+ export declare const PlButton: React.ForwardRefExoticComponent<PlButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,196 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Button as BaseUIButton } from '@base-ui/react/button';
4
+ import { useRender } from '@base-ui/react/use-render';
5
+ import { ButtonGroupContext } from '../../internal/button-group.js';
6
+ import { Spinner } from '../../internal/icons.js';
7
+ import { controlHeightClasses, controlSlots, controlSquareClasses, controlTextClasses, disabledClasses, focusRingClasses, gapClasses, glassClasses, hasContent, iconClasses, paddingXClasses, radiusClasses, readOnlyFilterClasses, transitionClasses } from '../../internal/styles.js';
8
+ /**
9
+ * The scales all come from `internal/styles` — a button's height *is* the
10
+ * library's control height, and the same numbers have to hold on a PlTextField,
11
+ * a Select and a Chip for a mixed row to keep its baseline.
12
+ */
13
+ const sizeClasses = {
14
+ xs: `${controlHeightClasses.xs} ${gapClasses.xs} ${radiusClasses.xs} ${controlTextClasses.xs}`,
15
+ sm: `${controlHeightClasses.sm} ${gapClasses.sm} ${radiusClasses.sm} ${controlTextClasses.sm}`,
16
+ md: `${controlHeightClasses.md} ${gapClasses.md} ${radiusClasses.md} ${controlTextClasses.md}`,
17
+ lg: `${controlHeightClasses.lg} ${gapClasses.lg} ${radiusClasses.lg} ${controlTextClasses.lg}`,
18
+ xl: `${controlHeightClasses.xl} ${gapClasses.xl} ${radiusClasses.xl} ${controlTextClasses.xl}`
19
+ };
20
+ /** With no label there is nothing to pad against, so the button goes square. */
21
+ const iconOnlyClasses = {
22
+ xs: `${controlSquareClasses.xs} px-0`,
23
+ sm: `${controlSquareClasses.sm} px-0`,
24
+ md: `${controlSquareClasses.md} px-0`,
25
+ lg: `${controlSquareClasses.lg} px-0`,
26
+ xl: `${controlSquareClasses.xl} px-0`
27
+ };
28
+ const baseClasses = /* @__PURE__ */ [
29
+ // `relative` because `.plass-glow` hangs its two light layers off `::before`/`::after`.
30
+ 'relative inline-flex shrink-0 select-none items-center justify-center',
31
+ 'whitespace-nowrap align-middle font-semibold leading-none',
32
+ '[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]',
33
+ transitionClasses,
34
+ focusRingClasses,
35
+ iconClasses
36
+ ].join(' ');
37
+ /**
38
+ * The three materials.
39
+ *
40
+ * `solid` is the only one with a `background-image`, and that gradient is the
41
+ * whole of the form: two ends of the family swept across the control, with no
42
+ * highlight over the top of it. A filled control deliberately carries **no**
43
+ * gloss line — an inset white edge on a coloured surface is what reads as
44
+ * lacquer, and the sweep is already saying everything about the shape that
45
+ * needs saying. The hairline belongs to `glass`, which has a real cut edge.
46
+ *
47
+ * `glass` wears the family in its **text** rather than in its sheet, which is
48
+ * why `color="secondary"` is the neutral, quiet button and not a second grey
49
+ * variant nobody would remember the name of.
50
+ */
51
+ const restClasses = {
52
+ solid: /* @__PURE__ */ [
53
+ 'text-(--p-on-solid) [background-image:var(--p-fill)]',
54
+ '[box-shadow:var(--p-elev),var(--p-lift)]'
55
+ ].join(' '),
56
+ glass: /* @__PURE__ */ [
57
+ glassClasses,
58
+ 'border text-(--p-accent) bg-(--plass-glass)',
59
+ '[border-color:var(--plass-glass-line)]',
60
+ '[box-shadow:var(--p-elev),var(--plass-gloss-glass)]'
61
+ ].join(' '),
62
+ // Nothing to catch the light on, and nothing to cast a shadow.
63
+ ghost: 'text-(--p-accent) bg-transparent'
64
+ };
65
+ /**
66
+ * Hover lifts the control and turns the light up; press puts it down and turns
67
+ * the light down. Both are `filter: brightness()` rather than a second set of
68
+ * colours, because the fill is a gradient and a gradient cannot be transitioned
69
+ * — but light falling on one can. The pointer bloom `.plass-glow` draws rides
70
+ * on top of this; the brightness is the state, the bloom is where the pointer
71
+ * is.
72
+ */
73
+ const hoverClasses = {
74
+ solid: /* @__PURE__ */ [
75
+ 'hover:brightness-105',
76
+ 'hover:[box-shadow:var(--p-elev-hover),var(--p-lift-hover)]',
77
+ 'active:brightness-95',
78
+ 'active:[box-shadow:var(--p-elev-press),var(--p-lift-press)]'
79
+ ].join(' '),
80
+ glass: /* @__PURE__ */ [
81
+ 'hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]',
82
+ 'hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]',
83
+ 'active:bg-(--plass-glass-press)',
84
+ 'active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]'
85
+ ].join(' '),
86
+ ghost: 'hover:bg-(--p-soft) active:bg-(--p-soft-hover)'
87
+ };
88
+ /**
89
+ * Read-only keeps the shape, the colour and the edge but goes flat, loses its
90
+ * lift and drains most of the saturation.
91
+ */
92
+ const readOnlyClasses = {
93
+ solid: /* @__PURE__ */ [
94
+ 'cursor-default text-(--p-on-solid) [background-image:var(--p-fill)]',
95
+ `shadow-none ${readOnlyFilterClasses}`
96
+ ].join(' '),
97
+ glass: /* @__PURE__ */ [
98
+ glassClasses,
99
+ 'cursor-default border text-(--p-accent) bg-(--plass-glass)',
100
+ '[border-color:var(--plass-glass-line)]',
101
+ `[box-shadow:var(--plass-gloss-glass)] ${readOnlyFilterClasses}`
102
+ ].join(' '),
103
+ ghost: `cursor-default text-(--p-accent) bg-transparent ${readOnlyFilterClasses}`
104
+ };
105
+ export const PlButton = /* @__PURE__ */ React.forwardRef(function PlButton({ variant: variantProp, size: sizeProp, color: colorProp, density: densityProp, elevation: elevationProp, startIcon, endIcon, loading = false, readOnly = false, fullWidth = false, disabled: disabledProp, render, className, style, children, onClick, onPointerMove, ...props }, ref) {
106
+ /*
107
+ * A `PlButtonGroup` around this button sets the axes once for the set. The
108
+ * button's own prop still wins — a row of secondary actions with one danger
109
+ * button in it is a real thing — and with no group around it the fallbacks
110
+ * are the defaults they always were.
111
+ */
112
+ const group = React.useContext(ButtonGroupContext);
113
+ const variant = variantProp ?? group?.variant ?? 'solid';
114
+ const size = sizeProp ?? group?.size ?? 'md';
115
+ const color = colorProp ?? group?.color ?? 'primary';
116
+ const density = densityProp ?? group?.density ?? 'default';
117
+ const elevation = elevationProp ?? group?.elevation ?? 1;
118
+ const disabled = disabledProp ?? group?.disabled ?? false;
119
+ const iconOnly = !hasContent(children);
120
+ // `disabled` and `readOnly` change how the button looks; `loading` only stops
121
+ // it from firing.
122
+ const inert = loading || readOnly;
123
+ const interactive = !disabled && !inert;
124
+ const classNames = [
125
+ baseClasses,
126
+ sizeClasses[size],
127
+ iconOnly ? iconOnlyClasses[size] : paddingXClasses[density][size],
128
+ // Deliberately an if/else rather than stacked `data-*` variants: two
129
+ // Tailwind variants of equal specificity resolve by their order in the
130
+ // generated stylesheet, which is not something a component should depend on.
131
+ disabled
132
+ ? disabledClasses[variant]
133
+ : readOnly
134
+ ? readOnlyClasses[variant]
135
+ : restClasses[variant],
136
+ interactive ? `${hoverClasses[variant]} cursor-pointer` : '',
137
+ // The interaction light. Every variant takes it, because it is about where
138
+ // the pointer is rather than about what the surface is made of — the two
139
+ // colour slots behind it are what switch with the variant.
140
+ interactive ? 'plass-glow' : '',
141
+ loading ? 'cursor-progress' : '',
142
+ fullWidth ? 'w-full' : '',
143
+ className ?? ''
144
+ ]
145
+ .filter(Boolean)
146
+ .join(' ');
147
+ /*
148
+ * `render` deliberately steps around Base UI's PlButton rather than being handed
149
+ * to it. Told to render a non-`<button>`, that component puts `role="button"`
150
+ * on whatever it was given — which is right for a `<div>` and wrong for the
151
+ * case this prop exists for: an `<a href>` under a `role="button"` stops being
152
+ * a link to everything that reads the page, and the link list, the status bar
153
+ * and the crawler all lose it.
154
+ *
155
+ * What Base UI's PlButton adds over a bare `<button>` is its disabled handling,
156
+ * and `disabled` is the one thing that cannot travel to an `<a>` anyway.
157
+ */
158
+ return useRender({
159
+ render: render ?? _jsx(BaseUIButton, { disabled: disabled }),
160
+ ref,
161
+ props: {
162
+ className: classNames,
163
+ style: { ...controlSlots(color, elevation, variant), ...style },
164
+ 'aria-disabled': inert || undefined,
165
+ 'aria-busy': loading || undefined,
166
+ 'data-loading': loading || undefined,
167
+ 'data-readonly': readOnly || undefined,
168
+ onClick: (event) => {
169
+ if (inert) {
170
+ event.preventDefault();
171
+ event.stopPropagation();
172
+ return;
173
+ }
174
+ onClick?.(event);
175
+ },
176
+ onPointerMove: (event) => {
177
+ // Feeds the two light layers in `styles.css`. Written straight to the
178
+ // element rather than held in state: this fires at pointer rate, and a
179
+ // `setState` here would re-render the tree on every mouse move. Reading
180
+ // `offsetX/offsetY` costs nothing — no `getBoundingClientRect`, so no
181
+ // forced layout. Icons carry `pointer-events: none`, so the offsets are
182
+ // always relative to the button itself.
183
+ //
184
+ // It runs while a finger is down too, which is what makes the light
185
+ // follow a drag on a touch screen — there is no hover there, and the
186
+ // `:active` layer is the one doing the work.
187
+ const element = event.currentTarget;
188
+ element.style.setProperty('--p-mx', `${event.nativeEvent.offsetX}px`);
189
+ element.style.setProperty('--p-my', `${event.nativeEvent.offsetY}px`);
190
+ onPointerMove?.(event);
191
+ },
192
+ ...props,
193
+ children: (_jsxs(_Fragment, { children: [loading ? _jsx(Spinner, {}) : startIcon, children, endIcon] }))
194
+ }
195
+ });
196
+ });
@@ -1,2 +1,2 @@
1
- export { Button } from './Button';
2
- export type { ButtonProps } from './Button';
1
+ export { PlButton } from './PlButton.js';
2
+ export type { PlButtonProps } from './PlButton.js';
@@ -1 +1 @@
1
- export{Button}from"./Button";
1
+ export { PlButton } from './PlButton.js';
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import type { PlassElevation, PlassOrientation, PlassStyleProps } from '../../types.js';
3
+ export interface PlButtonGroupProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
4
+ /**
5
+ * Which way the buttons run. A vertical group is a stacked menu of equal
6
+ * actions; a horizontal one is the default because that is what a toolbar is.
7
+ * @default 'horizontal'
8
+ */
9
+ orientation?: PlassOrientation;
10
+ /** Drop shadow depth, passed to every button in the group. */
11
+ elevation?: PlassElevation;
12
+ /** Disables every button in the group at once. */
13
+ disabled?: boolean;
14
+ /** Stretches to the container and divides the width evenly between buttons. */
15
+ fullWidth?: boolean;
16
+ children?: React.ReactNode;
17
+ }
18
+ /**
19
+ * A run of buttons that belong together.
20
+ *
21
+ * Two things are happening here and only one of them is visual. The corners
22
+ * that face a neighbour are squared off — that is the look. The other half is
23
+ * that `variant`, `size`, `color`, `density`, `elevation` and `disabled` are
24
+ * stated once for the set rather than repeated on every button; a group where
25
+ * one button is a size out is the failure this exists to prevent.
26
+ *
27
+ * The buttons stay real `PlButton`s and nothing about them is replaced. Which
28
+ * also means this is **not** a segmented control and it does not manage
29
+ * selection: for one-of-a-set reach for `PlSegmentedButton`, which is what that
30
+ * actually is.
31
+ */
32
+ export declare const PlButtonGroup: React.ForwardRefExoticComponent<PlButtonGroupProps & React.RefAttributes<HTMLDivElement>>;