@punica/components 0.0.0-stage → 2.1.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 (382) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +21 -0
  3. package/README.md +139 -2
  4. package/bin/punica-components.mjs +138 -0
  5. package/custom-elements.json +38745 -0
  6. package/dist/ai/index.d.ts +39 -0
  7. package/dist/ai/index.mjs +615 -0
  8. package/dist/ai/node.d.ts +5 -0
  9. package/dist/ai/node.mjs +625 -0
  10. package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
  11. package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
  12. package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
  13. package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
  14. package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
  15. package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
  16. package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
  17. package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
  18. package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
  19. package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
  20. package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
  21. package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
  22. package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
  23. package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
  24. package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
  25. package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
  26. package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
  27. package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
  28. package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
  29. package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
  30. package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
  31. package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
  32. package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
  33. package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
  34. package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
  35. package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
  36. package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
  37. package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
  38. package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
  39. package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
  40. package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
  41. package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
  42. package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
  43. package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
  44. package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
  45. package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
  46. package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
  47. package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
  48. package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
  49. package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
  50. package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
  51. package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
  52. package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
  53. package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
  54. package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
  55. package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
  56. package/dist/esm/chunks/chunk-BC657356.js +93 -0
  57. package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
  58. package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
  59. package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
  60. package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
  61. package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
  62. package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
  63. package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
  64. package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
  65. package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
  66. package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
  67. package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
  68. package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
  69. package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
  70. package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
  71. package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
  72. package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
  73. package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
  74. package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
  75. package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
  76. package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
  77. package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
  78. package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
  79. package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
  80. package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
  81. package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
  82. package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
  83. package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
  84. package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
  85. package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
  86. package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
  87. package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
  88. package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
  89. package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
  90. package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
  91. package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
  92. package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
  93. package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
  94. package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
  95. package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
  96. package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
  97. package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
  98. package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
  99. package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
  100. package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
  101. package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
  102. package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
  103. package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
  104. package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
  105. package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
  106. package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
  107. package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
  108. package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
  109. package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
  110. package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
  111. package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
  112. package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
  113. package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
  114. package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
  115. package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
  116. package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
  117. package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
  118. package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
  119. package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
  120. package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
  121. package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
  122. package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
  123. package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
  124. package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
  125. package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
  126. package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
  127. package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
  128. package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
  129. package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
  130. package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
  131. package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
  132. package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
  133. package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
  134. package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
  135. package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
  136. package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
  137. package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
  138. package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
  139. package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
  140. package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
  141. package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
  142. package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
  143. package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
  144. package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
  145. package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
  146. package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
  147. package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
  148. package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
  149. package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
  150. package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
  151. package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
  152. package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
  153. package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
  154. package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
  155. package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
  156. package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
  157. package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
  158. package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
  159. package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
  160. package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
  161. package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
  162. package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
  163. package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
  164. package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
  165. package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
  166. package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
  167. package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
  168. package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
  169. package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
  170. package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
  171. package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
  172. package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
  173. package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
  174. package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
  175. package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
  176. package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
  177. package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
  178. package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
  179. package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
  180. package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
  181. package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
  182. package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
  183. package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
  184. package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
  185. package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
  186. package/dist/esm/components/accordion/accordion.js +8 -0
  187. package/dist/esm/components/accordion/accordionGroup.js +7 -0
  188. package/dist/esm/components/agenda/agenda.js +9 -0
  189. package/dist/esm/components/alert/alert.js +8 -0
  190. package/dist/esm/components/alertDialog/alertDialog.js +14 -0
  191. package/dist/esm/components/appBar/appBar.js +7 -0
  192. package/dist/esm/components/appShell/appShell.js +11 -0
  193. package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
  194. package/dist/esm/components/autocomplete/autocomplete.js +14 -0
  195. package/dist/esm/components/avatar/avatar.js +7 -0
  196. package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
  197. package/dist/esm/components/badge/badge.js +7 -0
  198. package/dist/esm/components/banner/banner.js +9 -0
  199. package/dist/esm/components/blockquote/blockquote.js +7 -0
  200. package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
  201. package/dist/esm/components/box/box.js +7 -0
  202. package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
  203. package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
  204. package/dist/esm/components/button/button.js +8 -0
  205. package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
  206. package/dist/esm/components/calendar/calendar.js +12 -0
  207. package/dist/esm/components/calendar/dates.js +44 -0
  208. package/dist/esm/components/card/card.js +7 -0
  209. package/dist/esm/components/card/cardActions.js +7 -0
  210. package/dist/esm/components/card/cardContent.js +7 -0
  211. package/dist/esm/components/card/cardHeader.js +7 -0
  212. package/dist/esm/components/card/cardMedia.js +7 -0
  213. package/dist/esm/components/carousel/carousel.js +9 -0
  214. package/dist/esm/components/carousel/carouselItem.js +7 -0
  215. package/dist/esm/components/center/center.js +7 -0
  216. package/dist/esm/components/chat/chatComposer.js +9 -0
  217. package/dist/esm/components/chat/chatDictationButton.js +8 -0
  218. package/dist/esm/components/chat/chatLayout.js +9 -0
  219. package/dist/esm/components/chat/chatMessage.js +9 -0
  220. package/dist/esm/components/chat/chatMessageBubble.js +7 -0
  221. package/dist/esm/components/chat/chatMessageList.js +8 -0
  222. package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
  223. package/dist/esm/components/chat/chatSystemMessage.js +7 -0
  224. package/dist/esm/components/chat/chatToolCall.js +9 -0
  225. package/dist/esm/components/chat/chatToolCalls.js +8 -0
  226. package/dist/esm/components/chat/slots.js +6 -0
  227. package/dist/esm/components/checkbox/checkbox.js +9 -0
  228. package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
  229. package/dist/esm/components/chip/chip.js +8 -0
  230. package/dist/esm/components/citation/citation.js +11 -0
  231. package/dist/esm/components/code/code.js +7 -0
  232. package/dist/esm/components/codeBlock/codeBlock.js +8 -0
  233. package/dist/esm/components/collapsible/collapsible.js +7 -0
  234. package/dist/esm/components/commandPalette/commandGroup.js +7 -0
  235. package/dist/esm/components/commandPalette/commandItem.js +7 -0
  236. package/dist/esm/components/commandPalette/commandPalette.js +10 -0
  237. package/dist/esm/components/complexSelector/complexOption.js +9 -0
  238. package/dist/esm/components/complexSelector/complexSelector.js +16 -0
  239. package/dist/esm/components/complexSelector/optionGroup.js +7 -0
  240. package/dist/esm/components/container/container.js +7 -0
  241. package/dist/esm/components/contextMenu/contextMenu.js +12 -0
  242. package/dist/esm/components/datePicker/datePicker.js +15 -0
  243. package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
  244. package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
  245. package/dist/esm/components/dialog/dialog.js +11 -0
  246. package/dist/esm/components/dialog/dialogContent.js +7 -0
  247. package/dist/esm/components/dialog/dialogFooter.js +7 -0
  248. package/dist/esm/components/dialog/dialogHeader.js +7 -0
  249. package/dist/esm/components/dialog/modalSurface.js +8 -0
  250. package/dist/esm/components/divider/divider.js +7 -0
  251. package/dist/esm/components/drawer/drawer.js +10 -0
  252. package/dist/esm/components/emptyState/emptyState.js +7 -0
  253. package/dist/esm/components/field/field.js +7 -0
  254. package/dist/esm/components/fileInput/fileInput.js +9 -0
  255. package/dist/esm/components/formLayout/formLayout.js +7 -0
  256. package/dist/esm/components/grid/col.js +7 -0
  257. package/dist/esm/components/grid/row.js +7 -0
  258. package/dist/esm/components/heading/heading.js +7 -0
  259. package/dist/esm/components/hidden/hidden.js +7 -0
  260. package/dist/esm/components/hoverCard/hoverCard.js +9 -0
  261. package/dist/esm/components/icon/icon.js +8 -0
  262. package/dist/esm/components/iconButton/iconButton.js +8 -0
  263. package/dist/esm/components/infoTip/infoTip.js +10 -0
  264. package/dist/esm/components/input/input.js +9 -0
  265. package/dist/esm/components/inputGroup/inputGroup.js +9 -0
  266. package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
  267. package/dist/esm/components/kbd/kbd.js +7 -0
  268. package/dist/esm/components/lightbox/lightbox.js +10 -0
  269. package/dist/esm/components/link/link.js +8 -0
  270. package/dist/esm/components/listView/list.js +7 -0
  271. package/dist/esm/components/listView/listItem.js +7 -0
  272. package/dist/esm/components/listbox/listbox.js +9 -0
  273. package/dist/esm/components/listbox/listboxItem.js +8 -0
  274. package/dist/esm/components/markdown/markdown.js +9 -0
  275. package/dist/esm/components/markdown/parser.js +9 -0
  276. package/dist/esm/components/markdown/url.js +6 -0
  277. package/dist/esm/components/menu/menu.js +11 -0
  278. package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
  279. package/dist/esm/components/menu/menuDivider.js +7 -0
  280. package/dist/esm/components/menu/menuGroup.js +7 -0
  281. package/dist/esm/components/menu/menuItem.js +8 -0
  282. package/dist/esm/components/menu/menuRadioGroup.js +7 -0
  283. package/dist/esm/components/menu/menuRadioItem.js +9 -0
  284. package/dist/esm/components/metadataList/metadataList.js +9 -0
  285. package/dist/esm/components/metadataList/metadataListItem.js +8 -0
  286. package/dist/esm/components/mobileNav/mobileNav.js +10 -0
  287. package/dist/esm/components/numberInput/numberInput.js +9 -0
  288. package/dist/esm/components/outline/outline.js +8 -0
  289. package/dist/esm/components/overflowList/overflowList.js +11 -0
  290. package/dist/esm/components/pagination/pagination.js +8 -0
  291. package/dist/esm/components/paper/paper.js +7 -0
  292. package/dist/esm/components/popover/popover.js +9 -0
  293. package/dist/esm/components/powerSearch/powerSearch.js +14 -0
  294. package/dist/esm/components/progressBar/progressBar.js +7 -0
  295. package/dist/esm/components/qrCode/qrCode.js +9 -0
  296. package/dist/esm/components/radio/radio.js +7 -0
  297. package/dist/esm/components/radio/radioGroup.js +10 -0
  298. package/dist/esm/components/scrollArea/scrollArea.js +8 -0
  299. package/dist/esm/components/section/section.js +8 -0
  300. package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
  301. package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
  302. package/dist/esm/components/select/field.js +18 -0
  303. package/dist/esm/components/select/option.js +8 -0
  304. package/dist/esm/components/select/select.js +14 -0
  305. package/dist/esm/components/selectableCard/selectableCard.js +9 -0
  306. package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
  307. package/dist/esm/components/sideNav/sideNav.js +9 -0
  308. package/dist/esm/components/sideNav/sideNavItem.js +9 -0
  309. package/dist/esm/components/sideNav/sideNavSection.js +8 -0
  310. package/dist/esm/components/skeleton/skeleton.js +7 -0
  311. package/dist/esm/components/slider/slider.js +9 -0
  312. package/dist/esm/components/spinner/spinner.js +7 -0
  313. package/dist/esm/components/split/split.js +8 -0
  314. package/dist/esm/components/splitButton/splitButton.js +12 -0
  315. package/dist/esm/components/stack/stack.js +7 -0
  316. package/dist/esm/components/statusDot/statusDot.js +7 -0
  317. package/dist/esm/components/stepper/step.js +8 -0
  318. package/dist/esm/components/stepper/stepper.js +7 -0
  319. package/dist/esm/components/switch/switch.js +8 -0
  320. package/dist/esm/components/tab/tab.js +7 -0
  321. package/dist/esm/components/tab/tabPanel.js +7 -0
  322. package/dist/esm/components/tab/tabs.js +8 -0
  323. package/dist/esm/components/table/table.js +7 -0
  324. package/dist/esm/components/table/tableBody.js +7 -0
  325. package/dist/esm/components/table/tableCell.js +7 -0
  326. package/dist/esm/components/table/tableFooter.js +7 -0
  327. package/dist/esm/components/table/tableHeader.js +7 -0
  328. package/dist/esm/components/table/tableHeaderCell.js +8 -0
  329. package/dist/esm/components/table/tableRow.js +7 -0
  330. package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
  331. package/dist/esm/components/text/text.js +7 -0
  332. package/dist/esm/components/textarea/textarea.js +8 -0
  333. package/dist/esm/components/thumbnail/thumbnail.js +8 -0
  334. package/dist/esm/components/timePicker/timePicker.js +15 -0
  335. package/dist/esm/components/timer/timer.js +7 -0
  336. package/dist/esm/components/timestamp/timestamp.js +7 -0
  337. package/dist/esm/components/toast/toast.js +8 -0
  338. package/dist/esm/components/toast/toaster.js +12 -0
  339. package/dist/esm/components/toggleButton/toggleButton.js +8 -0
  340. package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
  341. package/dist/esm/components/tokenizer/tokenizer.js +14 -0
  342. package/dist/esm/components/toolbar/toolbar.js +8 -0
  343. package/dist/esm/components/tooltip/tooltip.js +9 -0
  344. package/dist/esm/components/topNav/topNav.js +11 -0
  345. package/dist/esm/components/topNav/topNavItem.js +11 -0
  346. package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
  347. package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
  348. package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
  349. package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
  350. package/dist/esm/components/tree/tree.js +8 -0
  351. package/dist/esm/components/tree/treeItem.js +8 -0
  352. package/dist/esm/components/virtualList/virtualList.js +7 -0
  353. package/dist/esm/components/virtualTable/virtualTable.js +9 -0
  354. package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
  355. package/dist/esm/core/a11y.js +22 -0
  356. package/dist/esm/core/element.js +14 -0
  357. package/dist/esm/core/form.js +6 -0
  358. package/dist/esm/core/overlay.js +8 -0
  359. package/dist/esm/index.js +779 -0
  360. package/dist/llms-full.txt +8890 -0
  361. package/dist/llms.txt +275 -0
  362. package/dist/punica-components.min.js +14283 -0
  363. package/dist/tokens.css +158 -0
  364. package/dist/types/index.d.ts +6753 -0
  365. package/dist/types/react.d.ts +1914 -0
  366. package/dist/vscode.css-custom-data.json +3892 -0
  367. package/dist/vscode.html-custom-data.json +6912 -0
  368. package/dist/web-types.json +12404 -0
  369. package/docs/MIGRATION-2.0.md +112 -0
  370. package/docs/contract.md +130 -0
  371. package/docs/migration/chat.md +309 -0
  372. package/docs/migration/content.md +806 -0
  373. package/docs/migration/data.md +140 -0
  374. package/docs/migration/display.md +625 -0
  375. package/docs/migration/form-basic.md +262 -0
  376. package/docs/migration/navigation.md +368 -0
  377. package/docs/migration/overlays.md +261 -0
  378. package/docs/migration/pickers.md +194 -0
  379. package/package.json +131 -4
  380. package/scripts/codemod-2.0.mjs +50 -0
  381. package/scripts/codemod-rules.mjs +102 -0
  382. package/skills/punica-components/SKILL.md +48 -0
@@ -0,0 +1,172 @@
1
+ import {
2
+ FormControl
3
+ } from "./chunk-HW2CN2JV.js";
4
+ import {
5
+ icons
6
+ } from "./chunk-YSGWORUD.js";
7
+ import {
8
+ PunicaElement,
9
+ define
10
+ } from "./chunk-Y7B65FYJ.js";
11
+
12
+ // src/components/fileInput/fileInput.css
13
+ var fileInput_default = ":host {\n --punica-file-input-padding: var(--punica-space-16);\n --punica-file-input-radius: var(--punica-radius);\n --punica-file-input-border-color: var(--punica-color-border-strong);\n --punica-file-input-background: var(--punica-color-surface);\n\n display: inline-block;\n vertical-align: middle;\n}\n\n.base {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-file-input-padding);\n border: var(--punica-border-width) dashed var(--punica-file-input-border-color);\n border-radius: var(--punica-file-input-radius);\n background: var(--punica-file-input-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n transition: border-color var(--punica-duration) var(--punica-ease),\n background-color var(--punica-duration) var(--punica-ease);\n}\n\n:host(:state(dragover)) .base {\n border-color: var(--punica-color-primary);\n border-style: solid;\n background: var(--punica-color-selected);\n}\n\n.native[hidden] {\n display: none;\n}\n\n.icon {\n flex: none;\n font-size: var(--punica-font-size-lg);\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n min-block-size: var(--punica-size-sm);\n padding-inline: var(--punica-space-12);\n border: var(--punica-border-width) solid var(--punica-color-primary);\n border-radius: var(--punica-radius);\n color: var(--punica-color-primary);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration) var(--punica-ease);\n}\nbutton:hover {\n background: color-mix(in srgb, var(--punica-color-primary) 12%, transparent);\n}\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\nbutton:disabled {\n cursor: default;\n}\n\n.list {\n flex-basis: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n font-weight: var(--punica-font-weight-semi-bold);\n overflow-wrap: anywhere;\n}\n.list[hidden] {\n display: none;\n}\n\n:host([disabled]) .base,\n:host(:state(disabled)) .base {\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .base {\n border-color: ButtonText;\n }\n :host(:state(dragover)) .base {\n border-color: Highlight;\n }\n button {\n border-color: ButtonText;\n }\n :host([disabled]) .base,\n :host(:state(disabled)) .base {\n border-color: GrayText;\n color: GrayText;\n opacity: 1;\n }\n}\n";
14
+
15
+ // src/components/fileInput/fileInput.js
16
+ var NONE = Object.freeze([]);
17
+ var missingMessage = () => {
18
+ const probe = document.createElement("input");
19
+ probe.type = "file";
20
+ probe.required = true;
21
+ return probe.validationMessage;
22
+ };
23
+ var accepts = (file, accept) => {
24
+ const rules = (accept || "").split(",").map((rule) => rule.trim().toLowerCase()).filter(Boolean);
25
+ if (!rules.length) return true;
26
+ const name = file.name.toLowerCase();
27
+ const type = (file.type || "").toLowerCase();
28
+ return rules.some((rule) => {
29
+ if (rule.startsWith(".")) return name.endsWith(rule);
30
+ if (rule.endsWith("/*")) return type.startsWith(rule.slice(0, -1));
31
+ return type === rule;
32
+ });
33
+ };
34
+ var PunicaFileInput = class extends FormControl(PunicaElement) {
35
+ static properties = {
36
+ accept: {},
37
+ multiple: { type: Boolean },
38
+ label: {},
39
+ labelBrowse: { default: "Choose file" },
40
+ labelDrop: { default: "or drop it here" },
41
+ files: { type: Array, attribute: false, default: NONE }
42
+ };
43
+ static styles = fileInput_default;
44
+ static shadowOptions = { delegatesFocus: true };
45
+ static template = `
46
+ <div part="base" class="base" role="group">
47
+ <input class="native" type="file" hidden />
48
+ ${icons.upload}
49
+ <button part="button" type="button"></button>
50
+ <span part="hint" class="hint"></span>
51
+ <ul part="list" class="list" hidden></ul>
52
+ </div>
53
+ `;
54
+ #native = this.$(".native");
55
+ #button = this.$("button");
56
+ #depth = 0;
57
+ constructor() {
58
+ super();
59
+ const base = this.$(".base");
60
+ const native = this.#native;
61
+ this.#button.addEventListener("click", () => {
62
+ if (!this.isDisabled) native.click();
63
+ });
64
+ native.addEventListener("change", () => {
65
+ const files = [...native.files];
66
+ native.value = "";
67
+ if (files.length) this.#take(files);
68
+ });
69
+ native.addEventListener("cancel", (event) => event.stopPropagation());
70
+ native.addEventListener("click", (event) => event.stopPropagation());
71
+ base.addEventListener("dragenter", (event) => {
72
+ if (!this.#carriesFiles(event)) return;
73
+ event.preventDefault();
74
+ this.#depth++;
75
+ this.toggleState("dragover", true);
76
+ });
77
+ base.addEventListener("dragover", (event) => {
78
+ if (!this.#carriesFiles(event)) return;
79
+ event.preventDefault();
80
+ event.dataTransfer.dropEffect = "copy";
81
+ });
82
+ base.addEventListener("dragleave", () => {
83
+ this.#depth = Math.max(0, this.#depth - 1);
84
+ if (!this.#depth) this.toggleState("dragover", false);
85
+ });
86
+ base.addEventListener("drop", (event) => {
87
+ this.#depth = 0;
88
+ this.toggleState("dragover", false);
89
+ if (!this.#carriesFiles(event)) return;
90
+ event.preventDefault();
91
+ let files = [...event.dataTransfer.files].filter((file) => accepts(file, this.accept));
92
+ if (!this.multiple) files = files.slice(0, 1);
93
+ if (files.length) this.#take(files);
94
+ });
95
+ }
96
+ update() {
97
+ const files = this.#files();
98
+ const native = this.#native;
99
+ if (this.accept) native.setAttribute("accept", this.accept);
100
+ else native.removeAttribute("accept");
101
+ native.multiple = this.multiple;
102
+ native.disabled = this.isDisabled;
103
+ const base = this.$(".base");
104
+ const name = this.#name();
105
+ if (name) base.setAttribute("aria-label", name);
106
+ else base.removeAttribute("aria-label");
107
+ if (this.isDisabled) base.setAttribute("aria-disabled", "true");
108
+ else base.removeAttribute("aria-disabled");
109
+ this.#button.disabled = this.isDisabled;
110
+ this.#button.textContent = this.labelBrowse ?? "";
111
+ this.$(".hint").textContent = this.labelDrop ?? "";
112
+ const list = this.$(".list");
113
+ list.replaceChildren(
114
+ ...files.map((file) => {
115
+ const item = document.createElement("li");
116
+ item.setAttribute("part", "file");
117
+ item.textContent = file.name;
118
+ return item;
119
+ })
120
+ );
121
+ list.hidden = !files.length;
122
+ this.toggleState("filled", files.length > 0);
123
+ if (files.length && this.name) {
124
+ const data = new FormData();
125
+ for (const file of files) data.append(this.name, file);
126
+ this.setFormValue(data);
127
+ } else {
128
+ this.setFormValue(null);
129
+ }
130
+ const missing = this.required && !files.length;
131
+ this.setValidity(missing ? { valueMissing: true } : {}, missing ? missingMessage() : "", this.#button);
132
+ }
133
+ formReset() {
134
+ this.files = [];
135
+ }
136
+ formRestore(state) {
137
+ if (state instanceof FormData) {
138
+ this.files = [...state.values()].filter((value) => value instanceof File);
139
+ }
140
+ }
141
+ /** Moves focus to the button. */
142
+ focus(options) {
143
+ this.#button.focus(options);
144
+ }
145
+ /** Opens the system file dialog; like a native file input, only from a user gesture. */
146
+ showPicker() {
147
+ if (!this.isDisabled) this.#native.click();
148
+ }
149
+ /** @returns {File[]} */
150
+ #files() {
151
+ return [...this.files || NONE];
152
+ }
153
+ #name() {
154
+ if (this.label) return this.label;
155
+ const text = [...this.labels].map((l) => l.textContent.trim()).filter(Boolean);
156
+ return text.length ? text.join(" ") : null;
157
+ }
158
+ #carriesFiles(event) {
159
+ return !this.isDisabled && [...event.dataTransfer?.types || []].includes("Files");
160
+ }
161
+ /** Takes files from the user: sets them and says so. */
162
+ #take(files) {
163
+ this.files = files;
164
+ this.update(/* @__PURE__ */ new Map());
165
+ this.emit("change", { files: this.#files() });
166
+ }
167
+ };
168
+ define("punica-file-input", PunicaFileInput);
169
+
170
+ export {
171
+ PunicaFileInput
172
+ };
@@ -0,0 +1,39 @@
1
+ import {
2
+ PunicaElement,
3
+ define
4
+ } from "./chunk-Y7B65FYJ.js";
5
+
6
+ // src/components/formLayout/formLayout.css
7
+ var formLayout_default = ":host {\n --punica-form-layout-gap: var(--punica-space-16);\n --punica-form-layout-column-gap: var(--punica-space-24);\n --punica-form-layout-label-max-width: 40%;\n\n --_cols: 1;\n\n display: block;\n container-type: inline-size;\n}\n\n:host([columns='2']) {\n --_cols: 2;\n}\n:host([columns='3']) {\n --_cols: 3;\n}\n:host([columns='4']) {\n --_cols: 4;\n}\n:host([gap='small']) {\n --punica-form-layout-gap: var(--punica-space-8);\n}\n:host([gap='large']) {\n --punica-form-layout-gap: var(--punica-space-24);\n}\n\n.grid {\n display: grid;\n grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));\n align-items: start;\n row-gap: var(--punica-form-layout-gap);\n column-gap: var(--punica-form-layout-column-gap);\n}\n\n::slotted(*) {\n min-inline-size: 0;\n}\n\n/* A field fills its cell; its control keeps its own width unless it is full-width. */\n::slotted(punica-field) {\n align-items: stretch;\n}\n\n::slotted([span='2']) {\n grid-column: span min(2, var(--_cols));\n}\n::slotted([span='3']) {\n grid-column: span min(3, var(--_cols));\n}\n::slotted([span='4']) {\n grid-column: span min(4, var(--_cols));\n}\n::slotted([span='full']) {\n grid-column: 1 / -1;\n}\n\n.actions {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--punica-space-8);\n padding-block-start: var(--punica-space-8);\n}\n\n[hidden] {\n display: none !important;\n}\n\n/* Labels beside the fields: a label track and a field track per column. */\n:host([label-position='start']) .grid {\n grid-template-columns: repeat(\n var(--_cols),\n [label] fit-content(var(--punica-form-layout-label-max-width)) [field] minmax(0, 1fr)\n );\n align-items: baseline;\n}\n:host([label-position='start']) ::slotted(*) {\n grid-column: span 2;\n}\n:host([label-position='start']) ::slotted(punica-field) {\n --punica-field-control-align: baseline;\n display: grid;\n grid-template-columns: subgrid;\n align-items: baseline;\n /* normal: the layout's own column gap, not the field's. */\n column-gap: normal;\n row-gap: var(--punica-space-4);\n}\n:host([label-position='start']) ::slotted([span='2']) {\n grid-column: span min(4, calc(var(--_cols) * 2));\n}\n:host([label-position='start']) ::slotted([span='3']) {\n grid-column: span min(6, calc(var(--_cols) * 2));\n}\n:host([label-position='start']) ::slotted([span='4']) {\n grid-column: span min(8, calc(var(--_cols) * 2));\n}\n:host([label-position='start']) ::slotted([span='full']) {\n grid-column: 1 / -1;\n}\n:host([label-position='start']) .actions {\n grid-column: 2 / -1;\n}\n\n/* A narrow container: one column, labels above. */\n@container (inline-size < 480px) {\n .grid,\n :host([label-position='start']) .grid {\n grid-template-columns: minmax(0, 1fr);\n align-items: start;\n }\n ::slotted(*),\n :host([label-position='start']) ::slotted(*),\n :host([label-position='start']) ::slotted([span]) {\n grid-column: 1 / -1;\n }\n :host([label-position='start']) ::slotted(punica-field) {\n display: flex;\n flex-direction: column;\n }\n :host([label-position='start']) .actions {\n grid-column: 1 / -1;\n }\n}\n";
8
+
9
+ // src/components/formLayout/formLayout.js
10
+ var PunicaFormLayout = class extends PunicaElement {
11
+ static properties = {
12
+ columns: { type: Number, default: 1 },
13
+ labelPosition: { default: "top" },
14
+ gap: {}
15
+ };
16
+ static styles = formLayout_default;
17
+ static template = `
18
+ <div part="base" class="grid">
19
+ <slot></slot>
20
+ <div part="actions" class="actions" hidden><slot name="actions"></slot></div>
21
+ </div>
22
+ `;
23
+ #actions = this.$(".actions");
24
+ #actionsSlot = this.$('slot[name="actions"]');
25
+ constructor() {
26
+ super();
27
+ this.#actionsSlot.addEventListener("slotchange", () => this.requestUpdate());
28
+ }
29
+ update() {
30
+ const filled = this.#actionsSlot.assignedNodes().some((n) => n.nodeType === 1 || n.textContent.trim());
31
+ this.#actions.hidden = !filled;
32
+ this.toggleState("has-actions", filled);
33
+ }
34
+ };
35
+ define("punica-form-layout", PunicaFormLayout);
36
+
37
+ export {
38
+ PunicaFormLayout
39
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ slotHasContent
3
+ } from "./chunk-XWZPKK2I.js";
4
+ import {
5
+ PunicaElement,
6
+ define
7
+ } from "./chunk-Y7B65FYJ.js";
8
+
9
+ // src/components/chat/chatMessageList.css
10
+ var chatMessageList_default = ":host {\n --punica-chat-message-list-gap: var(--punica-space-24);\n\n display: block;\n font-family: var(--punica-font-family);\n color: var(--punica-color-text);\n}\n\n.base {\n display: flex;\n flex-direction: column;\n gap: var(--punica-chat-message-list-gap);\n}\n\n.empty {\n display: none;\n}\n\n:host(:state(empty)) .base {\n display: none;\n}\n\n:host(:state(empty)) .empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--punica-space-8);\n padding-block: var(--punica-space-48);\n text-align: center;\n}\n";
11
+
12
+ // src/components/chat/chatMessageList.js
13
+ var PunicaChatMessageList = class extends PunicaElement {
14
+ static properties = {
15
+ label: { default: "Conversation" }
16
+ };
17
+ static styles = chatMessageList_default;
18
+ static template = `
19
+ <div part="base" class="base"><slot></slot></div>
20
+ <div part="empty" class="empty"><slot name="empty"></slot></div>
21
+ `;
22
+ #slot = this.$("slot:not([name])");
23
+ constructor() {
24
+ super();
25
+ this.#slot.addEventListener("slotchange", () => this.#count());
26
+ }
27
+ connected() {
28
+ this.internals.role = "log";
29
+ this.internals.ariaLive = "polite";
30
+ this.#count();
31
+ }
32
+ update() {
33
+ this.internals.ariaLabel = this.label;
34
+ }
35
+ #count() {
36
+ this.toggleState("empty", !slotHasContent(this.#slot));
37
+ }
38
+ };
39
+ define("punica-chat-message-list", PunicaChatMessageList);
40
+
41
+ export {
42
+ PunicaChatMessageList
43
+ };
@@ -0,0 +1,211 @@
1
+ import {
2
+ isRtl,
3
+ nextIndex,
4
+ onDirectionChange,
5
+ setRovingTabindex
6
+ } from "./chunk-4RURT4SK.js";
7
+ import {
8
+ PunicaElement,
9
+ define,
10
+ uid
11
+ } from "./chunk-Y7B65FYJ.js";
12
+
13
+ // src/components/tab/tabs.css
14
+ var tabs_default = ":host {\n --punica-tabs-indicator-color: var(--punica-color-primary);\n --punica-tabs-indicator-size: 2px;\n --punica-tabs-border-color: var(--punica-color-border);\n --punica-tabs-gap: var(--punica-space-0);\n\n display: flex;\n flex-direction: column;\n gap: var(--punica-tabs-gap);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n:host([orientation='vertical']) {\n flex-direction: row;\n}\n\n.tablist {\n position: relative;\n display: flex;\n align-items: stretch;\n inline-size: fit-content;\n max-inline-size: 100%;\n overflow: auto hidden;\n /* Thin rather than none: a mouse with no horizontal wheel needs it. */\n scrollbar-width: thin;\n box-shadow: inset 0 calc(var(--punica-border-width) * -1) 0 var(--punica-tabs-border-color);\n}\n\n:host([full-width]) .tablist {\n inline-size: 100%;\n}\n\n:host([full-width]) ::slotted(punica-tab) {\n flex: 1 1 0;\n}\n\n:host([orientation='vertical']) .tablist {\n flex: 0 0 auto;\n flex-direction: column;\n inline-size: auto;\n overflow: hidden auto;\n box-shadow: none;\n border-inline-end: var(--punica-border-width) solid var(--punica-tabs-border-color);\n}\n\n:host([orientation='vertical']) ::slotted(punica-tab) {\n justify-content: flex-start;\n}\n\n.indicator {\n position: absolute;\n inset-block-end: 0;\n inset-inline-start: 0;\n inline-size: var(--_size, 0);\n block-size: var(--punica-tabs-indicator-size);\n background: var(--punica-tabs-indicator-color);\n transform: translateX(var(--_offset, 0));\n pointer-events: none;\n}\n\n:host([orientation='vertical']) .indicator {\n inset-block: 0 auto;\n inset-inline: auto 0;\n inline-size: var(--punica-tabs-indicator-size);\n block-size: var(--_size, 0);\n transform: translateY(var(--_offset, 0));\n}\n\n.indicator.animated {\n transition: transform var(--punica-duration) var(--punica-ease),\n inline-size var(--punica-duration) var(--punica-ease),\n block-size var(--punica-duration) var(--punica-ease);\n}\n\n.indicator[hidden] {\n display: none;\n}\n\n:host([disabled]) ::slotted(punica-tab) {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n pointer-events: none;\n}\n\n.panels {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\n@media (forced-colors: active) {\n .indicator {\n background: Highlight;\n }\n}\n";
15
+
16
+ // src/components/tab/tabs.js
17
+ var PunicaTabs = class extends PunicaElement {
18
+ static properties = {
19
+ value: {},
20
+ orientation: { default: "horizontal" },
21
+ activation: { default: "auto" },
22
+ label: {},
23
+ fullWidth: { type: Boolean },
24
+ disabled: { type: Boolean }
25
+ };
26
+ static styles = tabs_default;
27
+ static template = `
28
+ <div part="tablist" class="tablist" role="tablist">
29
+ <slot name="tab"></slot>
30
+ <span part="indicator" class="indicator"></span>
31
+ </div>
32
+ <div part="panels" class="panels"><slot></slot></div>
33
+ `;
34
+ #tablist = this.$(".tablist");
35
+ #indicator = this.$(".indicator");
36
+ /** @type {ResizeObserver | null} */
37
+ #resize = null;
38
+ #placed = false;
39
+ /** The tab and list size last scrolled for. */
40
+ #revealed = "";
41
+ constructor() {
42
+ super();
43
+ for (const slot of this.shadowRoot.querySelectorAll("slot")) {
44
+ slot.addEventListener("slotchange", () => this.requestUpdate());
45
+ }
46
+ this.addEventListener("click", (event) => {
47
+ const tab = this.#tabOf(event);
48
+ if (tab && !this.#isDisabled(tab)) this.#select(tab);
49
+ });
50
+ this.addEventListener("keydown", (event) => this.#onKeydown(event));
51
+ }
52
+ /** The tabs, in order. */
53
+ get tabs() {
54
+ return (
55
+ /** @type {HTMLElement[]} */
56
+ [...this.children].filter((el) => el.localName === "punica-tab")
57
+ );
58
+ }
59
+ /** The panels, in order. */
60
+ get panels() {
61
+ return (
62
+ /** @type {HTMLElement[]} */
63
+ [...this.children].filter((el) => el.localName === "punica-tab-panel")
64
+ );
65
+ }
66
+ connected() {
67
+ this.#placed = false;
68
+ this.#resize = new ResizeObserver(() => this.#placeIndicator());
69
+ this.#resize.observe(this.#tablist);
70
+ onDirectionChange(() => this.#placeIndicator(), this.signal);
71
+ this.requestUpdate();
72
+ }
73
+ disconnected() {
74
+ this.#resize?.disconnect();
75
+ this.#resize = null;
76
+ }
77
+ /** @param {Event} event */
78
+ #tabOf(event) {
79
+ const target = (
80
+ /** @type {Element} */
81
+ event.target
82
+ );
83
+ const tab = target.closest?.("punica-tab");
84
+ return tab && tab.parentElement === this ? (
85
+ /** @type {HTMLElement} */
86
+ tab
87
+ ) : null;
88
+ }
89
+ #isDisabled(tab) {
90
+ return this.disabled || tab.hasAttribute("disabled");
91
+ }
92
+ #key(el, index) {
93
+ return el.value ?? el.getAttribute("value") ?? String(index);
94
+ }
95
+ #enabled() {
96
+ return this.tabs.filter((tab) => !this.#isDisabled(tab));
97
+ }
98
+ /** The tab the current `value` selects, or the first enabled one. */
99
+ get selectedTab() {
100
+ const tabs = this.tabs;
101
+ const match = this.value == null ? null : tabs.find((tab, i) => this.#key(tab, i) === this.value);
102
+ return match || tabs.find((tab) => !this.#isDisabled(tab)) || tabs.find((tab) => !tab.hasAttribute("disabled")) || tabs[0] || null;
103
+ }
104
+ #select(tab) {
105
+ const value = this.#key(tab, this.tabs.indexOf(tab));
106
+ if (value === this.value) return;
107
+ this.value = value;
108
+ this.emit("change", { value });
109
+ }
110
+ /** @param {KeyboardEvent} event */
111
+ #onKeydown(event) {
112
+ const tab = this.#tabOf(event);
113
+ if (!tab || event.target !== tab) return;
114
+ const enabled = this.#enabled();
115
+ const index = nextIndex(event, enabled.length, enabled.indexOf(tab), {
116
+ orientation: this.orientation === "vertical" ? "vertical" : "horizontal",
117
+ rtl: isRtl(this)
118
+ });
119
+ if (index >= 0) {
120
+ event.preventDefault();
121
+ const next = enabled[index];
122
+ setRovingTabindex(enabled, next);
123
+ next.focus();
124
+ if (this.activation !== "manual") this.#select(next);
125
+ } else if (event.key === "Enter" || event.key === " ") {
126
+ event.preventDefault();
127
+ if (!this.#isDisabled(tab)) this.#select(tab);
128
+ }
129
+ }
130
+ update(changed) {
131
+ const tabs = this.tabs;
132
+ if (changed.has("disabled")) for (const tab of tabs) tab.requestUpdate?.();
133
+ const panels = this.panels;
134
+ const vertical = this.orientation === "vertical";
135
+ this.#tablist.setAttribute("aria-orientation", vertical ? "vertical" : "horizontal");
136
+ if (this.label) this.#tablist.setAttribute("aria-label", this.label);
137
+ else this.#tablist.removeAttribute("aria-label");
138
+ const selected = this.selectedTab;
139
+ const selectedKey = selected ? this.#key(selected, tabs.indexOf(selected)) : null;
140
+ if (this.value == null && selectedKey != null) this.value = selectedKey;
141
+ const panelByKey = new Map(panels.map((panel, i) => [this.#key(panel, i), panel]));
142
+ tabs.forEach((tab, i) => {
143
+ const key = this.#key(tab, i);
144
+ tab.selected = tab === selected;
145
+ if (!tab.id) tab.id = uid("punica-tab");
146
+ const panel = panelByKey.get(key);
147
+ if (panel) {
148
+ if (!panel.id) panel.id = uid("punica-tab-panel");
149
+ tab.setAttribute("aria-controls", panel.id);
150
+ panel.setAttribute("aria-labelledby", tab.id);
151
+ } else {
152
+ tab.removeAttribute("aria-controls");
153
+ }
154
+ });
155
+ panels.forEach((panel, i) => {
156
+ panel.active = this.#key(panel, i) === selectedKey;
157
+ });
158
+ const enabled = this.#enabled();
159
+ const focused = enabled.find((tab) => tab.matches(":focus"));
160
+ for (const tab of tabs) if (!enabled.includes(tab)) tab.tabIndex = -1;
161
+ setRovingTabindex(enabled, focused || (enabled.includes(selected) ? selected : null));
162
+ this.#placeIndicator();
163
+ }
164
+ /**
165
+ * Scrolls the tab list, and only it, so the selected tab is in view.
166
+ * @param {HTMLElement} tab
167
+ * @param {DOMRect} list
168
+ * @param {DOMRect} rect
169
+ * @param {boolean} vertical
170
+ */
171
+ #reveal(tab, list, rect, vertical) {
172
+ const key = `${tab.id}:${Math.round(list.width)}:${Math.round(list.height)}`;
173
+ if (key === this.#revealed || !rect.width || tab.assignedSlot?.name !== "tab") return;
174
+ this.#revealed = key;
175
+ const box = this.#tablist;
176
+ if (vertical) {
177
+ if (rect.top < list.top) box.scrollTop -= list.top - rect.top;
178
+ else if (rect.bottom > list.bottom) box.scrollTop += rect.bottom - list.bottom;
179
+ } else if (rect.left < list.left) {
180
+ box.scrollLeft -= list.left - rect.left;
181
+ } else if (rect.right > list.right) {
182
+ box.scrollLeft += rect.right - list.right;
183
+ }
184
+ }
185
+ #placeIndicator() {
186
+ const indicator = this.#indicator;
187
+ const tab = this.selectedTab;
188
+ if (!tab || !this.isConnected) {
189
+ indicator.hidden = true;
190
+ return;
191
+ }
192
+ indicator.hidden = false;
193
+ const list = this.#tablist.getBoundingClientRect();
194
+ const rect = tab.getBoundingClientRect();
195
+ const vertical = this.orientation === "vertical";
196
+ const offset = vertical ? rect.top - list.top + this.#tablist.scrollTop : (isRtl(this) ? rect.right - list.right : rect.left - list.left) + this.#tablist.scrollLeft;
197
+ indicator.style.setProperty("--_offset", `${offset}px`);
198
+ indicator.style.setProperty("--_size", `${vertical ? rect.height : rect.width}px`);
199
+ this.#reveal(tab, list, rect, vertical);
200
+ if (!this.#placed && rect.width) {
201
+ this.#placed = true;
202
+ void indicator.offsetWidth;
203
+ indicator.classList.add("animated");
204
+ }
205
+ }
206
+ };
207
+ define("punica-tabs", PunicaTabs);
208
+
209
+ export {
210
+ PunicaTabs
211
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ PunicaMenuItem,
3
+ menuItem_default
4
+ } from "./chunk-E3XOZZSK.js";
5
+ import {
6
+ icons
7
+ } from "./chunk-YSGWORUD.js";
8
+ import {
9
+ define
10
+ } from "./chunk-Y7B65FYJ.js";
11
+
12
+ // src/components/menu/menuCheckboxItem.css
13
+ var menuCheckboxItem_default = ":host {\n --punica-menu-checkbox-item-indicator-color: var(--punica-color-primary);\n}\n\n.indicator {\n color: var(--punica-menu-checkbox-item-indicator-color);\n}\n\n@media (forced-colors: active) {\n .indicator {\n color: CanvasText;\n }\n}\n";
14
+
15
+ // src/components/menu/menuCheckboxItem.js
16
+ var PunicaMenuCheckboxItem = class extends PunicaMenuItem {
17
+ static properties = {
18
+ checked: { type: Boolean }
19
+ };
20
+ static styles = [menuItem_default, menuCheckboxItem_default];
21
+ static template = `
22
+ <span part="indicator" class="indicator" aria-hidden="true">${icons.check}</span>
23
+ <slot name="start"></slot>
24
+ <span part="label" class="label"><slot></slot></span>
25
+ <slot name="end"></slot>
26
+ `;
27
+ static role = "menuitemcheckbox";
28
+ /** Switches the option, as a click on the item does. */
29
+ activate() {
30
+ this.checked = !this.checked;
31
+ this.emit("change", { value: this.value ?? this.labelText, checked: this.checked });
32
+ }
33
+ update() {
34
+ super.update();
35
+ this.internals.ariaChecked = String(this.checked);
36
+ this.toggleState("checked", this.checked);
37
+ }
38
+ };
39
+ define("punica-menu-checkbox-item", PunicaMenuCheckboxItem);
40
+
41
+ export {
42
+ PunicaMenuCheckboxItem
43
+ };
@@ -0,0 +1,163 @@
1
+ import {
2
+ PunicaElement,
3
+ define
4
+ } from "./chunk-Y7B65FYJ.js";
5
+
6
+ // src/components/timer/timer.css
7
+ var timer_default = ":host {\n --punica-timer-color: inherit;\n --punica-timer-font-family: var(--punica-font-family-mono);\n\n display: inline-block;\n position: relative;\n}\n\ntime {\n color: var(--punica-timer-color);\n font-family: var(--punica-timer-font-family);\n font-variant-numeric: tabular-nums;\n}\n\n.status {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n";
8
+
9
+ // src/components/timer/timer.js
10
+ var pad = (n) => String(n).padStart(2, "0");
11
+ var PunicaTimer = class extends PunicaElement {
12
+ static properties = {
13
+ label: {},
14
+ mode: { default: "countdown" },
15
+ duration: { type: Number },
16
+ until: {},
17
+ running: { type: Boolean },
18
+ format: { default: "digital" },
19
+ announceEvery: { type: Number },
20
+ locale: {}
21
+ };
22
+ static styles = timer_default;
23
+ static template = `<time part="base"></time><span part="status" class="status" role="status" aria-live="polite"></span>`;
24
+ #time = this.$("time");
25
+ #status = this.$(".status");
26
+ #timeout = 0;
27
+ #ready = false;
28
+ /** Milliseconds counted before the last start. */
29
+ #banked = 0;
30
+ /** @type {number | null} `performance.now()` at the last start. */
31
+ #startedAt = null;
32
+ /** @type {number | null} `performance.now()` at which `until` falls. */
33
+ #target = null;
34
+ #stoppedAt = 0;
35
+ #completed = false;
36
+ /** @type {number | null} */
37
+ #announced = null;
38
+ constructor() {
39
+ super();
40
+ this.internals.role = "timer";
41
+ this.internals.ariaLive = "off";
42
+ }
43
+ get elapsed() {
44
+ return this.#banked + (this.#startedAt == null ? 0 : performance.now() - this.#startedAt);
45
+ }
46
+ get remaining() {
47
+ if (this.mode === "stopwatch") return null;
48
+ if (this.#target != null) {
49
+ return Math.max(0, this.#target - (this.#startedAt == null ? this.#stoppedAt : performance.now()));
50
+ }
51
+ return Math.max(0, (this.duration || 0) * 1e3 - this.elapsed);
52
+ }
53
+ /** Starts or resumes the clock; a finished countdown starts over. */
54
+ start() {
55
+ if (this.#completed) this.reset();
56
+ this.running = true;
57
+ }
58
+ /** Stops the clock where it is. */
59
+ pause() {
60
+ this.running = false;
61
+ }
62
+ /** Puts the clock back to its beginning; a running clock keeps running. */
63
+ reset() {
64
+ this.#banked = 0;
65
+ if (this.#startedAt != null) this.#startedAt = performance.now();
66
+ this.#completed = false;
67
+ this.#announced = null;
68
+ this.#status.textContent = "";
69
+ this.toggleState("complete", false);
70
+ if (this.#ready) this.#tick();
71
+ }
72
+ connected() {
73
+ if (this.#ready) this.#tick();
74
+ }
75
+ disconnected() {
76
+ clearTimeout(this.#timeout);
77
+ this.#timeout = 0;
78
+ }
79
+ update(changed) {
80
+ const now = performance.now();
81
+ if (!this.#ready) this.#stoppedAt = now;
82
+ this.#ready = true;
83
+ if (changed.has("until")) {
84
+ const at = this.until ? Date.parse(this.until) : NaN;
85
+ this.#target = Number.isNaN(at) ? null : now + (at - Date.now());
86
+ }
87
+ if (changed.has("until") || changed.has("duration") || changed.has("mode")) {
88
+ this.#completed = false;
89
+ this.toggleState("complete", false);
90
+ }
91
+ if (this.running && this.#startedAt == null) {
92
+ this.#startedAt = now;
93
+ } else if (!this.running && this.#startedAt != null) {
94
+ this.#banked += now - this.#startedAt;
95
+ this.#startedAt = null;
96
+ this.#stoppedAt = now;
97
+ }
98
+ this.toggleState("running", this.running);
99
+ this.internals.ariaLabel = this.label || null;
100
+ this.#tick();
101
+ }
102
+ get #language() {
103
+ const tag = this.locale || this.closest("[lang]")?.lang || navigator.language;
104
+ try {
105
+ return Intl.getCanonicalLocales(tag)[0];
106
+ } catch {
107
+ return void 0;
108
+ }
109
+ }
110
+ /**
111
+ * @param {number} total whole seconds
112
+ * @param {string} style
113
+ */
114
+ #write(total, style) {
115
+ const hours = Math.floor(total / 3600);
116
+ const minutes = Math.floor(total % 3600 / 60);
117
+ const seconds = total % 60;
118
+ const DurationFormat = (
119
+ /** @type {any} */
120
+ Intl.DurationFormat
121
+ );
122
+ if (typeof DurationFormat === "function") {
123
+ try {
124
+ const options = style === "digital" ? { style, hoursDisplay: hours ? "always" : "auto" } : { style, secondsDisplay: total ? "auto" : "always" };
125
+ return new DurationFormat(this.#language, options).format({ hours, minutes, seconds });
126
+ } catch {
127
+ }
128
+ }
129
+ return `${hours ? `${hours}:` : ""}${pad(minutes)}:${pad(seconds)}`;
130
+ }
131
+ #tick() {
132
+ clearTimeout(this.#timeout);
133
+ this.#timeout = 0;
134
+ const countdown = this.mode !== "stopwatch";
135
+ const ms = countdown ? this.remaining : this.elapsed;
136
+ const total = Math.max(0, countdown ? Math.ceil(ms / 1e3 - 5e-3) : Math.floor(ms / 1e3 + 5e-3));
137
+ this.#time.textContent = this.#write(total, this.format);
138
+ this.#time.dateTime = `PT${total}S`;
139
+ const every = this.announceEvery;
140
+ if (this.running && every > 0 && total % every === 0 && total !== this.#announced) {
141
+ this.#announced = total;
142
+ this.#status.textContent = this.#write(total, "long");
143
+ }
144
+ const bounded = countdown && (this.#target != null || this.duration != null);
145
+ if (this.running && bounded && total === 0) {
146
+ if (!this.#completed) {
147
+ this.#completed = true;
148
+ this.toggleState("complete", true);
149
+ this.running = false;
150
+ this.emit("complete", {});
151
+ }
152
+ return;
153
+ }
154
+ if (!this.running || !this.isConnected || countdown && !bounded) return;
155
+ const delay = countdown ? ms % 1e3 || 1e3 : 1e3 - ms % 1e3;
156
+ this.#timeout = setTimeout(() => this.#tick(), Math.max(1, delay));
157
+ }
158
+ };
159
+ define("punica-timer", PunicaTimer);
160
+
161
+ export {
162
+ PunicaTimer
163
+ };