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,139 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Field } from '@base-ui/react/field';
4
+ import { Popover } from '@base-ui/react/popover';
5
+ import { CloseIcon } from './icons.js';
6
+ import { WidthSizer } from './sizer.js';
7
+ import { chipRemoveClasses, controlHeightClasses, controlTextLeadingClasses, cx, disabledClasses, fieldReadOnlyClasses, fieldRestClasses, focusWithinRingClasses, gapClasses, glassClasses, iconClasses, metaTextClasses, paddingXClasses, radiusClasses, stackGapClasses, surfaceSlots, transitionClasses } from './styles.js';
8
+ /**
9
+ * The shell all four pickers wear: a field-shaped trigger with a popup hanging
10
+ * off it.
11
+ *
12
+ * It is here rather than in one of the components for the reason the calendar
13
+ * is: four components need it, and none of them should have to import another.
14
+ * What it draws is deliberately not new — the trigger is `fieldRestClasses`,
15
+ * the same box a `PlTextField` and a `PlSelect`'s trigger are drawn on, to the
16
+ * pixel. A form where the date field is a different height, radius or material
17
+ * from the text field beside it is a form that looks assembled rather than
18
+ * designed.
19
+ *
20
+ * The one thing the pickers do *not* offer is typing a date into the trigger.
21
+ * Parsing a date out of free text is locale-dependent in a way that cannot be
22
+ * done honestly without a date library, and a field that understands `27/7/26`
23
+ * in one browser and not the next is worse than one that never claimed to. So
24
+ * the trigger is a button, exactly as a select's is, and the calendar is where
25
+ * the answer comes from.
26
+ */
27
+ /* ---------------------------------------------------------------------------
28
+ * Colour
29
+ * ------------------------------------------------------------------------- */
30
+ /**
31
+ * The popup's slots: a container's undyed sheet with the *control* fill added
32
+ * back on top.
33
+ *
34
+ * Neither generator in `internal/styles` says this on its own, and the reason is
35
+ * that a picker's popup is both things at once. It is a container — it holds a
36
+ * grid of forty-two days, and dyeing the sheet under them would put every one of
37
+ * them on a background it was not chosen against — and it also holds the one
38
+ * filled token in the library that has to be found without being read, which is
39
+ * the day you picked. So the sheet stays clear glass and the family arrives in
40
+ * the two fill slots the chosen cell reads.
41
+ */
42
+ export function popupSlots(color, elevation) {
43
+ return {
44
+ ...surfaceSlots(color, elevation),
45
+ '--p-fill': `var(--plass-${color}-fill)`,
46
+ '--p-on-solid': `var(--plass-${color}-on-solid)`
47
+ };
48
+ }
49
+ /* ---------------------------------------------------------------------------
50
+ * Surfaces
51
+ * ------------------------------------------------------------------------- */
52
+ /** The trigger's box. A `PlTextField`'s shell, unchanged. */
53
+ const triggerShellClasses = /* @__PURE__ */ [
54
+ 'group relative flex w-full items-center select-none',
55
+ '[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]',
56
+ transitionClasses,
57
+ focusWithinRingClasses,
58
+ iconClasses
59
+ ].join(' ');
60
+ /**
61
+ * The popup. Like every floating surface in the library it carries a shadow by
62
+ * default, at level 3 — as far as the ladder goes without hovering — because it
63
+ * is genuinely off the page rather than merely on top of it.
64
+ */
65
+ export const pickerPopupClasses = /* @__PURE__ */ [
66
+ glassClasses,
67
+ 'border text-(--plass-fg) bg-(--plass-glass-press)',
68
+ '[border-color:var(--plass-glass-line)]',
69
+ '[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]',
70
+ '[outline:none]',
71
+ // Opacity only. A calendar that slid into place would move the cell the
72
+ // pointer was already reaching for.
73
+ '[transition:opacity_var(--plass-duration)_var(--plass-ease)]',
74
+ 'data-[starting-style]:opacity-0 data-[ending-style]:opacity-0'
75
+ ].join(' ');
76
+ /** The popup's own padding, one track tighter than a control's. */
77
+ export const popupPaddingClasses = {
78
+ xs: 'p-1.5',
79
+ sm: 'p-2',
80
+ md: 'p-2.5',
81
+ lg: 'p-3',
82
+ xl: 'p-3.5'
83
+ };
84
+ /**
85
+ * A trigger, a label, the two lines of text under it, and a popup.
86
+ *
87
+ * Everything about it that is visible is a decision already made elsewhere: the
88
+ * shell classes, the read-only and disabled treatments, the label's type scale
89
+ * and the way `invalid` re-points the whole colour family at `danger` so the
90
+ * edge, the ring and the message turn over together.
91
+ */
92
+ export function PickerShell({ variant = 'glass', size = 'md', color = 'primary', density = 'default', elevation = 0, label, description, error, invalid, startIcon, fullWidth = false, disabled = false, readOnly = false, required = false, id, className, style, display, samples, empty, clearable = false, onClear, open, onOpenChange, labels, hiddenValues, children, triggerRef, ...props }) {
93
+ const generatedId = React.useId();
94
+ const triggerId = id ?? `${generatedId}-trigger`;
95
+ const labelId = `${generatedId}-label`;
96
+ const descriptionId = `${generatedId}-description`;
97
+ const errorId = `${generatedId}-error`;
98
+ const hasError = error !== undefined && error !== null && error !== false && error !== '';
99
+ const isInvalid = invalid ?? hasError;
100
+ const family = isInvalid ? 'danger' : color;
101
+ const inert = disabled || readOnly;
102
+ const describedBy = [description ? descriptionId : null, hasError ? errorId : null].filter(Boolean).join(' ') ||
103
+ undefined;
104
+ return (_jsxs(Field.Root, { disabled: disabled, invalid: isInvalid, className: cx('flex-col align-top', stackGapClasses[size], fullWidth ? 'flex w-full' : 'inline-flex', className), style: { ...surfaceSlots(family, elevation), ...style }, ...props, children: [label ? (_jsx(Field.Label, { id: labelId, htmlFor: triggerId, className: cx(metaTextClasses[size], 'font-semibold', disabled ? 'text-(--plass-muted-fg)' : 'text-(--plass-fg)'), children: label })) : null, _jsxs(Popover.Root, { open: open, onOpenChange: (next) => onOpenChange(next), children: [_jsxs("span", { className: cx(triggerShellClasses, controlHeightClasses[size], controlTextLeadingClasses[size], radiusClasses[size], gapClasses[size], paddingXClasses[density][size],
105
+ // An if/else rather than stacked variants: two Tailwind classes of
106
+ // equal specificity resolve by their order in the generated sheet.
107
+ disabled
108
+ ? disabledClasses[variant]
109
+ : readOnly
110
+ ? fieldReadOnlyClasses[variant]
111
+ : fieldRestClasses[variant]), children: [_jsxs(Popover.Trigger, { id: triggerId, ref: triggerRef, disabled: disabled, "aria-labelledby": label ? labelId : undefined, "aria-describedby": describedBy, "aria-required": required || undefined, "aria-invalid": isInvalid || undefined, className: cx('flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit', gapClasses[size], '[outline:none]', inert ? 'cursor-default' : 'cursor-pointer'), children: [startIcon ? (_jsx("span", { className: "flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)", children: startIcon })) : null, _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: cx('w-full truncate', empty ? 'text-(--plass-muted-fg)' : 'text-(--plass-fg)'), children: display }), _jsx(WidthSizer, { samples: samples ?? [] })] })] }), clearable && !empty && !inert ? (_jsx("button", { type: "button", "aria-label": labels.clear, className: cx(chipRemoveClasses, 'text-(--plass-muted-fg)'), onClick: (event) => {
112
+ event.stopPropagation();
113
+ onClear();
114
+ }, children: _jsx(CloseIcon, {}) })) : null] }), _jsx(Popover.Portal, { children: _jsx(Popover.Positioner, { className: "plass-portal z-50 [outline:none]", sideOffset: 6, align: "start", children: _jsx(Popover.Popup
115
+ // Base UI is told to leave the focus alone so the calendar can take
116
+ // it into the grid itself. Its own move would land on the popup
117
+ // element and run *after* the grid's, undoing it.
118
+ , {
119
+ // Base UI is told to leave the focus alone so the calendar can take
120
+ // it into the grid itself. Its own move would land on the popup
121
+ // element and run *after* the grid's, undoing it.
122
+ initialFocus: false, className: cx(pickerPopupClasses, radiusClasses[size], popupPaddingClasses[size], controlTextLeadingClasses[size]), style: popupSlots(family, 3), children: children }) }) })] }), description ? (_jsx(Field.Description, { id: descriptionId, className: cx(metaTextClasses[size], 'text-(--plass-muted-fg)'), children: description })) : null, hasError ? (_jsx(Field.Error, { id: errorId, match: true, className: cx(metaTextClasses[size], 'text-(--p-accent)'), children: error })) : null, hiddenValues?.map((entry, index) => (_jsx("input", { type: "hidden", name: entry.name, value: entry.value }, index)))] }));
123
+ }
124
+ /* ---------------------------------------------------------------------------
125
+ * The footer
126
+ * ------------------------------------------------------------------------- */
127
+ /**
128
+ * The row of shortcuts under a picker's panel.
129
+ *
130
+ * A hairline above it rather than a gap, because the actions act on the panel
131
+ * and a gap would read as a second popup stacked under the first.
132
+ */
133
+ export function PickerFooter({ size, children }) {
134
+ return (_jsx("div", { className: cx('flex items-center justify-end border-t pt-1.5', '[border-color:var(--plass-divider)]', gapClasses[size]), children: children }));
135
+ }
136
+ /** The vertical hairline between a calendar and the clock beside it. */
137
+ export function PickerDivider() {
138
+ return _jsx("div", { "aria-hidden": "true", className: "w-px self-stretch bg-(--plass-divider)" });
139
+ }
@@ -0,0 +1,145 @@
1
+ /**
2
+ * What the three progress indicators share.
3
+ *
4
+ * `PlProgressLinear`, `PlProgressCircular` and `PlProgressBox` are three shapes
5
+ * answering one question — how far along is this, and is it moving at all — so
6
+ * everything that is *not* the shape belongs here: the colour slots, the size
7
+ * ladders, and the arithmetic that turns `value`/`min`/`max` into a fraction.
8
+ *
9
+ * What is left in each component is the shape, which is the point: it is the
10
+ * only thing that genuinely differs.
11
+ */
12
+ import type * as React from 'react';
13
+ import type { PlassColor, PlassSize } from '../types.js';
14
+ /**
15
+ * The props all three take.
16
+ *
17
+ * Declared once and extended rather than written three times, because the whole
18
+ * claim being made is that these are one component in three shapes: a `value`
19
+ * of `null` has to mean the same thing on a bar, a ring and a row of plates, or
20
+ * the trio is three components that happen to share a prefix.
21
+ */
22
+ export interface PlassProgressProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
23
+ /**
24
+ * How far along, between `min` and `max`.
25
+ *
26
+ * `null` — the default — is the indeterminate case: something is happening
27
+ * and nobody knows how much of it is left. That is the default on purpose. An
28
+ * indicator that has not been told a value should say so rather than draw an
29
+ * empty bar, which is a claim that no progress has been made.
30
+ * @default null
31
+ */
32
+ value?: number | null;
33
+ /** @default 0 */
34
+ min?: number;
35
+ /** @default 100 */
36
+ max?: number;
37
+ /** A name for what is loading. Read out with the value by a screen reader. */
38
+ label?: React.ReactNode;
39
+ /**
40
+ * Shows the value as text beside the shape. A percentage of the range unless
41
+ * `format` says otherwise.
42
+ * @default false
43
+ */
44
+ showValue?: boolean;
45
+ /**
46
+ * How to format the value when it is shown — `Intl.NumberFormat` options, so
47
+ * bytes and currencies work as well as plain numbers. Without it the value is
48
+ * a percentage of `min`…`max`, which is the only formatting that holds for a
49
+ * range nobody described.
50
+ */
51
+ format?: Intl.NumberFormatOptions;
52
+ /** @default 'md' */
53
+ size?: PlassSize;
54
+ /** @default 'primary' */
55
+ color?: PlassColor;
56
+ }
57
+ /**
58
+ * The slots an indicator reads.
59
+ *
60
+ * An indicator **is** the coloured thing — unlike a PlBox, which holds other
61
+ * people's content — so it gets `--p-fill`, the family's own gradient, and the
62
+ * filled part of a bar is made of exactly the same material as the button that
63
+ * submits the form it is in.
64
+ *
65
+ * There is no elevation ladder and no `--p-lift` here, on purpose. An indicator
66
+ * is cut *into* the surface it sits on, the way a groove is, and a groove does
67
+ * not float.
68
+ */
69
+ export declare function progressSlots(color: PlassColor): React.CSSProperties;
70
+ /**
71
+ * How thick the linear groove is.
72
+ *
73
+ * Its own ladder rather than a fraction of `controlHeightClasses`: a bar is not
74
+ * a control you can put a label inside, and at `md` it wants to be the weight
75
+ * of a rule between two paragraphs rather than a quarter of a button.
76
+ *
77
+ * They are `PlSlider`'s rail thicknesses, and deliberately: a rail and a bar are
78
+ * the same channel, one of which you drag and one of which you watch.
79
+ */
80
+ export declare const barThicknessClasses: Record<PlassSize, string>;
81
+ /**
82
+ * The diameter of the ring, in pixels.
83
+ *
84
+ * Numbers rather than classes because the same value has to reach the SVG's
85
+ * `viewBox` arithmetic, and a ring is one of the few things in the library that
86
+ * cannot be described by a Tailwind class alone.
87
+ *
88
+ * They sit just under the control ladder at every step — a `md` ring is 20px
89
+ * inside a 40px control — so a ring dropped into a button, a field or a table
90
+ * row never makes the row taller than it already was.
91
+ */
92
+ export declare const ringDiameters: Record<PlassSize, number>;
93
+ /** The ring's stroke, thickening with the ring so the hole stays in proportion. */
94
+ export declare const ringStrokes: Record<PlassSize, number>;
95
+ /**
96
+ * One plate of a `PlProgressBox`, on the tick ladder — an indicator beside a
97
+ * label, not a control you can put one inside.
98
+ */
99
+ export declare const plateSizeClasses: Record<PlassSize, string>;
100
+ /** The corner cut off a plate: the same ~30% the tick boxes take. */
101
+ export declare const plateRadiusClasses: Record<PlassSize, string>;
102
+ /** Between the plates. Tight — they are one object, not a row of squares. */
103
+ export declare const plateGapClasses: Record<PlassSize, string>;
104
+ /**
105
+ * The groove an indicator is cut into, and the transition that fills it.
106
+ *
107
+ * `--plass-track` is the one neutral ink the library grooves with — a
108
+ * PlSlider's rail and a PlSwitch's off track are the same colour — so a form
109
+ * with a slider, a switch and a progress bar in it is made of one material
110
+ * rather than three.
111
+ *
112
+ * The fill is `--p-fill`, and it is a `background-image` rather than a colour
113
+ * because that is what a Plass fill *is*: a gradient that turns in hue. Which is
114
+ * also why the movement is on `width` and never on the paint: a gradient cannot
115
+ * be transitioned, and a length can.
116
+ */
117
+ export declare const trackClasses = "bg-(--plass-track)";
118
+ /** The bar's own duration, one step slower than a control's, so a fill reads as travel. */
119
+ export declare const fillTransitionClasses = "[transition:width_var(--plass-duration-slow)_var(--plass-ease)]";
120
+ /**
121
+ * `value` as a fraction of the range, or `null` when there is nothing to say.
122
+ *
123
+ * The clamp is not defensive programming for its own sake — `value` usually
124
+ * arrives from a division somewhere, and a bar that renders 140% wide because
125
+ * one request finished twice is a worse bug than a bar that sits full.
126
+ */
127
+ export declare function progressFraction(value: number | null | undefined, min: number, max: number): number | null;
128
+ /**
129
+ * What the value reads as, both on screen and to a screen reader.
130
+ *
131
+ * Base UI's own default is `${value}%`, which is right only when the range
132
+ * happens to be 0–100 — "3%" for step 3 of 4 is worse than saying nothing. So
133
+ * the percentage is computed from the fraction, and a caller who passed
134
+ * `format` gets Base UI's formatted string instead, because at that point they
135
+ * have said what the number means.
136
+ */
137
+ export declare function progressText(fraction: number | null, formatted: string | null, hasFormat: boolean): string | null;
138
+ /**
139
+ * The same string, shaped for Base UI's `getAriaValueText`.
140
+ *
141
+ * `undefined` when there is no value, which hands the indeterminate case back
142
+ * to Base UI — it already announces indeterminate progress, and re-inventing
143
+ * that here would be one more English string the library has to own.
144
+ */
145
+ export declare function progressAriaText(fraction: number | null, hasFormat: boolean): ((formatted: string | null) => string) | undefined;
@@ -0,0 +1,167 @@
1
+ /**
2
+ * What the three progress indicators share.
3
+ *
4
+ * `PlProgressLinear`, `PlProgressCircular` and `PlProgressBox` are three shapes
5
+ * answering one question — how far along is this, and is it moving at all — so
6
+ * everything that is *not* the shape belongs here: the colour slots, the size
7
+ * ladders, and the arithmetic that turns `value`/`min`/`max` into a fraction.
8
+ *
9
+ * What is left in each component is the shape, which is the point: it is the
10
+ * only thing that genuinely differs.
11
+ */
12
+ /**
13
+ * The slots an indicator reads.
14
+ *
15
+ * An indicator **is** the coloured thing — unlike a PlBox, which holds other
16
+ * people's content — so it gets `--p-fill`, the family's own gradient, and the
17
+ * filled part of a bar is made of exactly the same material as the button that
18
+ * submits the form it is in.
19
+ *
20
+ * There is no elevation ladder and no `--p-lift` here, on purpose. An indicator
21
+ * is cut *into* the surface it sits on, the way a groove is, and a groove does
22
+ * not float.
23
+ */
24
+ export function progressSlots(color) {
25
+ return {
26
+ '--p-fill': `var(--plass-${color}-fill)`,
27
+ // The two ends of that gradient on their own, which only the ring needs: an
28
+ // SVG stroke cannot take a CSS gradient, so an arc has to build a
29
+ // `<linearGradient>` out of the same two stops the bar's fill is made of.
30
+ // Without them a ring would be a flat arc beside a swept bar.
31
+ '--p-solid': `var(--plass-${color}-solid)`,
32
+ '--p-solid-to': `var(--plass-${color}-solid-to)`,
33
+ '--p-accent': `var(--plass-${color}-accent)`,
34
+ '--p-soft': `var(--plass-${color}-soft)`,
35
+ '--p-soft-press': `var(--plass-${color}-soft-press)`
36
+ };
37
+ }
38
+ /**
39
+ * How thick the linear groove is.
40
+ *
41
+ * Its own ladder rather than a fraction of `controlHeightClasses`: a bar is not
42
+ * a control you can put a label inside, and at `md` it wants to be the weight
43
+ * of a rule between two paragraphs rather than a quarter of a button.
44
+ *
45
+ * They are `PlSlider`'s rail thicknesses, and deliberately: a rail and a bar are
46
+ * the same channel, one of which you drag and one of which you watch.
47
+ */
48
+ export const barThicknessClasses = {
49
+ xs: 'h-1',
50
+ sm: 'h-1.5',
51
+ md: 'h-1.5',
52
+ lg: 'h-2',
53
+ xl: 'h-2.5'
54
+ };
55
+ /**
56
+ * The diameter of the ring, in pixels.
57
+ *
58
+ * Numbers rather than classes because the same value has to reach the SVG's
59
+ * `viewBox` arithmetic, and a ring is one of the few things in the library that
60
+ * cannot be described by a Tailwind class alone.
61
+ *
62
+ * They sit just under the control ladder at every step — a `md` ring is 20px
63
+ * inside a 40px control — so a ring dropped into a button, a field or a table
64
+ * row never makes the row taller than it already was.
65
+ */
66
+ export const ringDiameters = {
67
+ xs: 14,
68
+ sm: 16,
69
+ md: 20,
70
+ lg: 26,
71
+ xl: 32
72
+ };
73
+ /** The ring's stroke, thickening with the ring so the hole stays in proportion. */
74
+ export const ringStrokes = {
75
+ xs: 1.5,
76
+ sm: 1.75,
77
+ md: 2,
78
+ lg: 2.5,
79
+ xl: 3
80
+ };
81
+ /**
82
+ * One plate of a `PlProgressBox`, on the tick ladder — an indicator beside a
83
+ * label, not a control you can put one inside.
84
+ */
85
+ export const plateSizeClasses = {
86
+ xs: 'size-2',
87
+ sm: 'size-2.5',
88
+ md: 'size-3',
89
+ lg: 'size-4',
90
+ xl: 'size-5'
91
+ };
92
+ /** The corner cut off a plate: the same ~30% the tick boxes take. */
93
+ export const plateRadiusClasses = {
94
+ xs: 'rounded-[0.1875rem]',
95
+ sm: 'rounded-[0.25rem]',
96
+ md: 'rounded-[0.28125rem]',
97
+ lg: 'rounded-[0.375rem]',
98
+ xl: 'rounded-[0.4375rem]'
99
+ };
100
+ /** Between the plates. Tight — they are one object, not a row of squares. */
101
+ export const plateGapClasses = {
102
+ xs: 'gap-1',
103
+ sm: 'gap-1',
104
+ md: 'gap-1.5',
105
+ lg: 'gap-1.5',
106
+ xl: 'gap-2'
107
+ };
108
+ /**
109
+ * The groove an indicator is cut into, and the transition that fills it.
110
+ *
111
+ * `--plass-track` is the one neutral ink the library grooves with — a
112
+ * PlSlider's rail and a PlSwitch's off track are the same colour — so a form
113
+ * with a slider, a switch and a progress bar in it is made of one material
114
+ * rather than three.
115
+ *
116
+ * The fill is `--p-fill`, and it is a `background-image` rather than a colour
117
+ * because that is what a Plass fill *is*: a gradient that turns in hue. Which is
118
+ * also why the movement is on `width` and never on the paint: a gradient cannot
119
+ * be transitioned, and a length can.
120
+ */
121
+ export const trackClasses = 'bg-(--plass-track)';
122
+ /** The bar's own duration, one step slower than a control's, so a fill reads as travel. */
123
+ export const fillTransitionClasses = '[transition:width_var(--plass-duration-slow)_var(--plass-ease)]';
124
+ /**
125
+ * `value` as a fraction of the range, or `null` when there is nothing to say.
126
+ *
127
+ * The clamp is not defensive programming for its own sake — `value` usually
128
+ * arrives from a division somewhere, and a bar that renders 140% wide because
129
+ * one request finished twice is a worse bug than a bar that sits full.
130
+ */
131
+ export function progressFraction(value, min, max) {
132
+ if (value === null || value === undefined || Number.isNaN(value)) {
133
+ return null;
134
+ }
135
+ if (max <= min) {
136
+ return null;
137
+ }
138
+ return Math.min(1, Math.max(0, (value - min) / (max - min)));
139
+ }
140
+ /**
141
+ * What the value reads as, both on screen and to a screen reader.
142
+ *
143
+ * Base UI's own default is `${value}%`, which is right only when the range
144
+ * happens to be 0–100 — "3%" for step 3 of 4 is worse than saying nothing. So
145
+ * the percentage is computed from the fraction, and a caller who passed
146
+ * `format` gets Base UI's formatted string instead, because at that point they
147
+ * have said what the number means.
148
+ */
149
+ export function progressText(fraction, formatted, hasFormat) {
150
+ if (fraction === null) {
151
+ return null;
152
+ }
153
+ return hasFormat ? formatted : `${Math.round(fraction * 100)}%`;
154
+ }
155
+ /**
156
+ * The same string, shaped for Base UI's `getAriaValueText`.
157
+ *
158
+ * `undefined` when there is no value, which hands the indeterminate case back
159
+ * to Base UI — it already announces indeterminate progress, and re-inventing
160
+ * that here would be one more English string the library has to own.
161
+ */
162
+ export function progressAriaText(fraction, hasFormat) {
163
+ if (fraction === null) {
164
+ return undefined;
165
+ }
166
+ return (formatted) => progressText(fraction, formatted, hasFormat) ?? '';
167
+ }
@@ -0,0 +1,32 @@
1
+ import type * as React from 'react';
2
+ /**
3
+ * Holds a control open at the width of the widest thing it could ever say.
4
+ *
5
+ * A control that is not `fullWidth` is sized by what it is *currently* saying,
6
+ * which for anything whose value changes means the box changes with it. A
7
+ * PlSelect showing `Seoul` is narrower than the same one showing
8
+ * `Washington DC`. Either way the field moves under the pointer that just used
9
+ * it, and the whole row of controls beside it shuffles along.
10
+ *
11
+ * So the alternatives are laid out too, stacked in a box clipped to no height.
12
+ * The control's intrinsic width becomes the widest of them and stops depending
13
+ * on the value.
14
+ *
15
+ * Three things it deliberately is not:
16
+ *
17
+ * - **Not `hidden`, and not `display: none`.** Both take the box out of layout,
18
+ * and a box that is not laid out reserves nothing.
19
+ * - **Not read out.** `aria-hidden`, or a screen reader would announce every
20
+ * value the control might hold before the one it does.
21
+ * - **Not text.** A string sample is drawn as generated content off a data
22
+ * attribute rather than as a text node. `content: attr(…)` lays out exactly
23
+ * like text, so it reserves the same width — but it leaves nothing for
24
+ * `getByText` or a screen reader's find-in-page to trip over, and a caller's
25
+ * test asking for the option they selected keeps finding one element rather
26
+ * than two. Only a sample that is not a string — an option whose label is a
27
+ * node — has to be rendered for real, because there is nothing to put in an
28
+ * attribute.
29
+ */
30
+ export declare function WidthSizer({ samples }: {
31
+ samples: readonly React.ReactNode[];
32
+ }): React.JSX.Element | null;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Holds a control open at the width of the widest thing it could ever say.
4
+ *
5
+ * A control that is not `fullWidth` is sized by what it is *currently* saying,
6
+ * which for anything whose value changes means the box changes with it. A
7
+ * PlSelect showing `Seoul` is narrower than the same one showing
8
+ * `Washington DC`. Either way the field moves under the pointer that just used
9
+ * it, and the whole row of controls beside it shuffles along.
10
+ *
11
+ * So the alternatives are laid out too, stacked in a box clipped to no height.
12
+ * The control's intrinsic width becomes the widest of them and stops depending
13
+ * on the value.
14
+ *
15
+ * Three things it deliberately is not:
16
+ *
17
+ * - **Not `hidden`, and not `display: none`.** Both take the box out of layout,
18
+ * and a box that is not laid out reserves nothing.
19
+ * - **Not read out.** `aria-hidden`, or a screen reader would announce every
20
+ * value the control might hold before the one it does.
21
+ * - **Not text.** A string sample is drawn as generated content off a data
22
+ * attribute rather than as a text node. `content: attr(…)` lays out exactly
23
+ * like text, so it reserves the same width — but it leaves nothing for
24
+ * `getByText` or a screen reader's find-in-page to trip over, and a caller's
25
+ * test asking for the option they selected keeps finding one element rather
26
+ * than two. Only a sample that is not a string — an option whose label is a
27
+ * node — has to be rendered for real, because there is nothing to put in an
28
+ * attribute.
29
+ */
30
+ export function WidthSizer({ samples }) {
31
+ if (samples.length === 0) {
32
+ return null;
33
+ }
34
+ return (_jsx("span", { "aria-hidden": "true", className: "invisible h-0 min-h-0 overflow-hidden", children: samples.map((sample, index) => typeof sample === 'string' ? (_jsx("span", { "data-sample": sample, className: "block whitespace-nowrap before:content-[attr(data-sample)]" }, `${index}:${sample}`)) : (_jsx("span", { className: "block whitespace-nowrap", children: sample }, index))) }));
35
+ }