@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,105 @@
1
+ import {
2
+ FormControl
3
+ } from "./chunk-HW2CN2JV.js";
4
+ import {
5
+ PunicaElement,
6
+ define
7
+ } from "./chunk-Y7B65FYJ.js";
8
+
9
+ // src/components/switch/switch.css
10
+ var switch_default = ":host {\n --_accent: var(--punica-color-primary);\n --_thumb: calc(var(--punica-switch-height) - 2 * var(--punica-space-2));\n --punica-switch-width: var(--punica-space-40);\n --punica-switch-height: var(--punica-space-22);\n --punica-switch-track-color: var(--punica-color-border-strong);\n --punica-switch-track-color-checked: var(--_accent);\n --punica-switch-thumb-color: var(--punica-color-white);\n --punica-switch-gap: var(--punica-space-8);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n}\n:host([color='info']) {\n --_accent: var(--punica-color-info);\n}\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n}\n:host([color='neutral']) {\n --_accent: var(--punica-color-neutral-dark);\n}\n\n:host([size='small']) {\n --punica-switch-width: var(--punica-space-32);\n --punica-switch-height: var(--punica-space-18);\n}\n:host([size='large']) {\n --punica-switch-width: var(--punica-space-48);\n --punica-switch-height: var(--punica-space-26);\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n gap: var(--punica-switch-gap);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: 1.43;\n cursor: pointer;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.track {\n position: relative;\n display: inline-block;\n flex: none;\n inline-size: var(--punica-switch-width);\n block-size: var(--punica-switch-height);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-radius-full);\n background: var(--punica-switch-track-color);\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.thumb {\n position: absolute;\n inset-block-start: calc(var(--punica-space-2) - var(--punica-border-width));\n inset-inline-start: calc(var(--punica-space-2) - var(--punica-border-width));\n inline-size: var(--_thumb);\n block-size: var(--_thumb);\n border-radius: var(--punica-radius-full);\n background: var(--punica-switch-thumb-color);\n box-shadow: var(--punica-shadow-xs);\n transition: inset-inline-start var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:state(checked)) .track {\n background: var(--punica-switch-track-color-checked);\n}\n:host(:state(checked)) .thumb {\n inset-inline-start: calc(\n var(--punica-switch-width) - var(--_thumb) - var(--punica-space-2) - var(--punica-border-width)\n );\n}\n\n/* The muted text token fails AA on a white page at this size, so the side\n that is not in effect is told apart by weight alone. */\n.text {\n font-weight: var(--punica-font-weight-regular);\n}\n:host(:not(:state(checked))) .off,\n:host(:state(checked)) .on {\n font-weight: var(--punica-font-weight-bold);\n}\n\n.text[hidden],\n.label[hidden] {\n display: none;\n}\n\nbutton:focus-visible .track {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .track {\n border-color: ButtonText;\n background: Canvas;\n }\n .thumb {\n background: ButtonText;\n }\n :host(:state(checked)) .track {\n background: Highlight;\n }\n :host(:state(checked)) .thumb {\n background: HighlightText;\n }\n button:disabled {\n opacity: 1;\n color: GrayText;\n }\n}\n";
11
+
12
+ // src/components/switch/switch.js
13
+ var missingMessage = () => {
14
+ const probe = document.createElement("input");
15
+ probe.type = "checkbox";
16
+ probe.required = true;
17
+ return probe.validationMessage;
18
+ };
19
+ var PunicaSwitch = class extends FormControl(PunicaElement) {
20
+ static properties = {
21
+ checked: { type: Boolean },
22
+ value: { default: "on" },
23
+ label: {},
24
+ labelOn: {},
25
+ labelOff: {},
26
+ color: {},
27
+ size: {}
28
+ };
29
+ static styles = switch_default;
30
+ static shadowOptions = { delegatesFocus: true };
31
+ static template = `
32
+ <button part="base" type="button" role="switch" aria-checked="false">
33
+ <span part="label-off" class="text off" aria-hidden="true" hidden></span>
34
+ <span part="track" class="track"><span part="thumb" class="thumb"></span></span>
35
+ <span part="label-on" class="text on" aria-hidden="true" hidden></span>
36
+ <span part="label" class="label" hidden><slot></slot></span>
37
+ </button>
38
+ `;
39
+ #button = this.$("button");
40
+ #default = false;
41
+ constructor() {
42
+ super();
43
+ const button = this.#button;
44
+ button.addEventListener("click", () => {
45
+ if (this.isDisabled) return;
46
+ this.checked = !this.checked;
47
+ this.emit("change", { checked: this.checked, value: this.value });
48
+ });
49
+ this.addEventListener("click", (event) => {
50
+ if (event.composedPath()[0] === this && !this.isDisabled) button.click();
51
+ });
52
+ const slot = this.$("slot");
53
+ slot.addEventListener("slotchange", () => {
54
+ const filled = slot.assignedNodes().some((n) => n.nodeType === 1 || n.textContent.trim());
55
+ this.$(".label").hidden = !filled;
56
+ });
57
+ }
58
+ update() {
59
+ const button = this.#button;
60
+ button.disabled = this.isDisabled;
61
+ button.setAttribute("aria-checked", String(this.checked));
62
+ const name = this.#name();
63
+ if (name) button.setAttribute("aria-label", name);
64
+ else button.removeAttribute("aria-label");
65
+ if (this.required) button.setAttribute("aria-required", "true");
66
+ else button.removeAttribute("aria-required");
67
+ const on = this.$(".on");
68
+ const off = this.$(".off");
69
+ on.textContent = this.labelOn ?? "";
70
+ on.hidden = !this.labelOn;
71
+ off.textContent = this.labelOff ?? "";
72
+ off.hidden = !this.labelOff;
73
+ this.toggleState("checked", this.checked);
74
+ this.setFormValue(this.checked ? this.value ?? "on" : null, String(this.checked));
75
+ const missing = this.required && !this.checked;
76
+ this.setValidity(missing ? { valueMissing: true } : {}, missing ? missingMessage() : "", button);
77
+ }
78
+ firstUpdated() {
79
+ this.#default = this.checked;
80
+ }
81
+ formReset() {
82
+ this.checked = this.#default;
83
+ }
84
+ formRestore(state) {
85
+ this.checked = state === "true";
86
+ }
87
+ /** Moves focus to the switch. */
88
+ focus(options) {
89
+ this.#button.focus(options);
90
+ }
91
+ /** Flips the switch the way a user would, firing `punica-change`. */
92
+ click() {
93
+ this.#button.click();
94
+ }
95
+ #name() {
96
+ if (this.label) return this.label;
97
+ const text = [...this.labels].map((l) => l.textContent.trim()).filter(Boolean);
98
+ return text.length ? text.join(" ") : null;
99
+ }
100
+ };
101
+ define("punica-switch", PunicaSwitch);
102
+
103
+ export {
104
+ PunicaSwitch
105
+ };
@@ -0,0 +1,44 @@
1
+ import {
2
+ PunicaElement,
3
+ define
4
+ } from "./chunk-Y7B65FYJ.js";
5
+
6
+ // src/components/divider/divider.css
7
+ var divider_default = ":host {\n --punica-divider-color: var(--punica-color-border);\n --punica-divider-width: var(--punica-border-width);\n --punica-divider-spacing: var(--punica-space-0);\n --punica-divider-inset: var(--punica-space-16);\n\n display: flex;\n align-items: center;\n flex-shrink: 0;\n margin-block: var(--punica-divider-spacing);\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}\n\n.line {\n flex: 1 1 0;\n border-block-start: var(--punica-divider-width) solid var(--punica-divider-color);\n}\n\n.label,\n.label + .line {\n display: none;\n}\n\n:host(:state(labelled)) {\n gap: var(--punica-space-8);\n}\n:host(:state(labelled)) .label,\n:host(:state(labelled)) .label + .line {\n display: block;\n}\n\n:host([inset]) {\n margin-inline: var(--punica-divider-inset);\n}\n\n:host([orientation='vertical']) {\n display: inline-flex;\n flex-direction: column;\n align-self: stretch;\n min-block-size: 1em;\n margin-block: 0;\n margin-inline: var(--punica-divider-spacing);\n vertical-align: middle;\n}\n:host([orientation='vertical'][inset]) {\n margin-block: var(--punica-divider-inset);\n}\n:host([orientation='vertical']) .line {\n border-block-start: 0;\n border-inline-start: var(--punica-divider-width) solid var(--punica-divider-color);\n}\n\n@media (forced-colors: active) {\n .line {\n border-color: CanvasText;\n }\n}\n";
8
+
9
+ // src/components/divider/divider.js
10
+ var PunicaDivider = class extends PunicaElement {
11
+ static properties = {
12
+ orientation: {},
13
+ decorative: { type: Boolean },
14
+ inset: { type: Boolean }
15
+ };
16
+ static styles = divider_default;
17
+ static template = `
18
+ <span part="line" class="line"></span>
19
+ <span part="label" class="label"><slot></slot></span>
20
+ <span part="line" class="line"></span>
21
+ `;
22
+ #slot = this.$("slot");
23
+ constructor() {
24
+ super();
25
+ this.#slot.addEventListener("slotchange", () => this.#label());
26
+ }
27
+ update() {
28
+ const internals = this.internals;
29
+ internals.role = this.decorative ? "presentation" : "separator";
30
+ internals.ariaOrientation = this.decorative ? null : this.orientation === "vertical" ? "vertical" : "horizontal";
31
+ this.#label();
32
+ }
33
+ #label() {
34
+ const text = this.#slot.assignedNodes({ flatten: true }).map((node) => node.textContent).join("").trim();
35
+ const labelled = text !== "" || this.#slot.assignedElements({ flatten: true }).length > 0;
36
+ this.toggleState("labelled", labelled);
37
+ this.internals.ariaLabel = labelled && text && !this.decorative ? text : null;
38
+ }
39
+ };
40
+ define("punica-divider", PunicaDivider);
41
+
42
+ export {
43
+ PunicaDivider
44
+ };
@@ -0,0 +1,106 @@
1
+ import {
2
+ icons
3
+ } from "./chunk-YSGWORUD.js";
4
+ import {
5
+ PunicaElement,
6
+ define
7
+ } from "./chunk-Y7B65FYJ.js";
8
+
9
+ // src/components/overflowList/overflowList.css
10
+ var overflowList_default = ":host {\n --punica-overflow-list-gap: var(--punica-space-8);\n --punica-overflow-list-menu-gap: var(--punica-space-4);\n\n display: block;\n min-inline-size: 0;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.base {\n display: flex;\n align-items: center;\n gap: var(--punica-overflow-list-gap);\n inline-size: 100%;\n}\n\n.items {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--punica-overflow-list-gap);\n min-inline-size: 0;\n /* Clip, not hidden: a child's focus ring may reach past the row. */\n overflow-x: clip;\n}\n\n#visible::slotted(*) {\n flex: 0 0 auto;\n}\n\n.more {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-sm);\n block-size: var(--punica-size-sm);\n border-radius: var(--punica-radius);\n color: var(--punica-color-text);\n cursor: pointer;\n}\n\n.more:hover {\n background: var(--punica-color-hover);\n}\n\n.more:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.menu {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: var(--punica-overflow-list-menu-gap);\n}\n\n@media (forced-colors: active) {\n .more {\n border: var(--punica-border-width) solid ButtonText;\n }\n}\n";
11
+
12
+ // src/components/overflowList/overflowList.js
13
+ var PunicaOverflowList = class extends PunicaElement {
14
+ static properties = {
15
+ labelMore: { default: "More" }
16
+ };
17
+ static styles = overflowList_default;
18
+ static shadowOptions = { slotAssignment: "manual" };
19
+ static template = `
20
+ <div part="base" class="base">
21
+ <div part="items" class="items"><slot id="visible"></slot></div>
22
+ <punica-popover align="end" hidden>
23
+ <button slot="trigger" part="more" class="more" type="button">${icons.more}</button>
24
+ <div part="menu" class="menu"><slot id="overflow"></slot></div>
25
+ </punica-popover>
26
+ </div>
27
+ `;
28
+ #base = this.$(".base");
29
+ #items = this.$(".items");
30
+ #visible = this.$("#visible");
31
+ #overflow = this.$("#overflow");
32
+ #popover = this.$("punica-popover");
33
+ #more = this.$(".more");
34
+ #count = 0;
35
+ /** @type {ResizeObserver | null} */
36
+ #resize = null;
37
+ /** @type {MutationObserver | null} */
38
+ #mutation = null;
39
+ constructor() {
40
+ super();
41
+ this.#overflow.addEventListener("click", () => this.#popover.hide?.());
42
+ }
43
+ /** Number of children in the "more" popover. */
44
+ get overflowCount() {
45
+ return this.#count;
46
+ }
47
+ /** Measures again; call after a child changed size by itself. */
48
+ layout() {
49
+ if (!this.isConnected) return;
50
+ const children = [...this.children];
51
+ const visible = this.#visible;
52
+ const overflow = this.#overflow;
53
+ const popover = this.#popover;
54
+ visible.assign(...children);
55
+ overflow.assign();
56
+ popover.hidden = true;
57
+ const available = this.#base.getBoundingClientRect().width;
58
+ const gap = parseFloat(getComputedStyle(this.#items).columnGap) || 0;
59
+ const widths = children.map((child) => child.getBoundingClientRect().width);
60
+ const total = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, children.length - 1);
61
+ let fit = children.length;
62
+ if (total > available + 0.5) {
63
+ popover.hidden = false;
64
+ const reserved = this.#more.getBoundingClientRect().width + gap;
65
+ let used = 0;
66
+ fit = 0;
67
+ for (const width of widths) {
68
+ const next = used + width + (fit ? gap : 0);
69
+ if (next + reserved > available + 0.5) break;
70
+ used = next;
71
+ fit++;
72
+ }
73
+ visible.assign(...children.slice(0, fit));
74
+ overflow.assign(...children.slice(fit));
75
+ } else if (popover.open) {
76
+ popover.open = false;
77
+ }
78
+ const count = children.length - fit;
79
+ if (count !== this.#count) {
80
+ this.#count = count;
81
+ this.emit("overflow", { count });
82
+ }
83
+ }
84
+ connected() {
85
+ this.#resize = new ResizeObserver(() => this.layout());
86
+ this.#resize.observe(this);
87
+ this.#mutation = new MutationObserver(() => this.layout());
88
+ this.#mutation.observe(this, { childList: true });
89
+ }
90
+ disconnected() {
91
+ this.#resize?.disconnect();
92
+ this.#resize = null;
93
+ this.#mutation?.disconnect();
94
+ this.#mutation = null;
95
+ }
96
+ update() {
97
+ this.#more.setAttribute("aria-label", this.labelMore);
98
+ this.#popover.setAttribute("label", this.labelMore);
99
+ this.layout();
100
+ }
101
+ };
102
+ define("punica-overflow-list", PunicaOverflowList);
103
+
104
+ export {
105
+ PunicaOverflowList
106
+ };
@@ -0,0 +1,337 @@
1
+ import {
2
+ PunicaElement,
3
+ define
4
+ } from "./chunk-Y7B65FYJ.js";
5
+
6
+ // src/components/qrCode/qrCode.css
7
+ var qrCode_default = ":host {\n --punica-qr-code-size: var(--punica-space-128);\n --punica-qr-code-foreground: var(--punica-color-black);\n --punica-qr-code-background: var(--punica-color-white);\n --_size: var(--punica-qr-code-size);\n\n display: inline-block;\n inline-size: var(--_size);\n block-size: var(--_size);\n vertical-align: middle;\n}\n\nsvg {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n}\n\n.background {\n fill: var(--punica-qr-code-background);\n}\n\n.foreground {\n fill: var(--punica-qr-code-foreground);\n}\n\n:host(:state(empty)) svg {\n visibility: hidden;\n}\n\n/* A scanner needs the two colours as they are, whatever the user's palette. */\n@media (forced-colors: active) {\n svg {\n forced-color-adjust: none;\n }\n}\n";
8
+
9
+ // src/components/qrCode/qrCode.js
10
+ var ECC_PER_BLOCK = {
11
+ L: [0, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
12
+ M: [0, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
13
+ Q: [0, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
14
+ H: [0, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
15
+ };
16
+ var BLOCKS = {
17
+ L: [0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
18
+ M: [0, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
19
+ Q: [0, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
20
+ H: [0, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
21
+ };
22
+ var LEVEL_BITS = { L: 1, M: 0, Q: 3, H: 2 };
23
+ function rawModules(version) {
24
+ let count = (16 * version + 128) * version + 64;
25
+ if (version >= 2) {
26
+ const align = Math.floor(version / 7) + 2;
27
+ count -= (25 * align - 10) * align - 55;
28
+ if (version >= 7) count -= 36;
29
+ }
30
+ return count;
31
+ }
32
+ var dataCodewords = (version, level) => Math.floor(rawModules(version) / 8) - ECC_PER_BLOCK[level][version] * BLOCKS[level][version];
33
+ function multiply(x, y) {
34
+ let z = 0;
35
+ for (let i = 7; i >= 0; i--) {
36
+ z = z << 1 ^ (z >>> 7) * 285;
37
+ z ^= (y >>> i & 1) * x;
38
+ }
39
+ return z;
40
+ }
41
+ function reedSolomonDivisor(degree) {
42
+ const result = new Array(degree).fill(0);
43
+ result[degree - 1] = 1;
44
+ let root = 1;
45
+ for (let i = 0; i < degree; i++) {
46
+ for (let j = 0; j < degree; j++) {
47
+ result[j] = multiply(result[j], root);
48
+ if (j + 1 < degree) result[j] ^= result[j + 1];
49
+ }
50
+ root = multiply(root, 2);
51
+ }
52
+ return result;
53
+ }
54
+ function reedSolomonRemainder(data, divisor) {
55
+ const result = divisor.map(() => 0);
56
+ for (const byte of data) {
57
+ const factor = byte ^ result.shift();
58
+ result.push(0);
59
+ divisor.forEach((coefficient, i) => result[i] ^= multiply(coefficient, factor));
60
+ }
61
+ return result;
62
+ }
63
+ function withErrorCorrection(data, version, level) {
64
+ const blockCount = BLOCKS[level][version];
65
+ const eccLength = ECC_PER_BLOCK[level][version];
66
+ const raw = Math.floor(rawModules(version) / 8);
67
+ const shortBlocks = blockCount - raw % blockCount;
68
+ const shortLength = Math.floor(raw / blockCount);
69
+ const divisor = reedSolomonDivisor(eccLength);
70
+ const blocks = [];
71
+ for (let i = 0, k = 0; i < blockCount; i++) {
72
+ const part = data.slice(k, k + shortLength - eccLength + (i < shortBlocks ? 0 : 1));
73
+ k += part.length;
74
+ const ecc = reedSolomonRemainder(part, divisor);
75
+ if (i < shortBlocks) part.push(0);
76
+ blocks.push(part.concat(ecc));
77
+ }
78
+ const result = [];
79
+ for (let i = 0; i < blocks[0].length; i++) {
80
+ blocks.forEach((block, j) => {
81
+ if (i !== shortLength - eccLength || j >= shortBlocks) result.push(block[i]);
82
+ });
83
+ }
84
+ return result;
85
+ }
86
+ function alignmentPositions(version, size) {
87
+ if (version === 1) return [];
88
+ const count = Math.floor(version / 7) + 2;
89
+ const step = version === 32 ? 26 : Math.ceil((version * 4 + 4) / (count * 2 - 2)) * 2;
90
+ const result = [6];
91
+ for (let position = size - 7; result.length < count; position -= step) result.splice(1, 0, position);
92
+ return result;
93
+ }
94
+ var MASKS = [
95
+ (x, y) => (x + y) % 2 === 0,
96
+ (x, y) => y % 2 === 0,
97
+ (x) => x % 3 === 0,
98
+ (x, y) => (x + y) % 3 === 0,
99
+ (x, y) => (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0,
100
+ (x, y) => x * y % 2 + x * y % 3 === 0,
101
+ (x, y) => (x * y % 2 + x * y % 3) % 2 === 0,
102
+ (x, y) => ((x + y) % 2 + x * y % 3) % 2 === 0
103
+ ];
104
+ var FINDER_LIKE = [
105
+ [true, false, true, true, true, false, true, false, false, false, false],
106
+ [false, false, false, false, true, false, true, true, true, false, true]
107
+ ];
108
+ function penalty(modules) {
109
+ const size = modules.length;
110
+ let score = 0;
111
+ const line = (get) => {
112
+ let run = 1;
113
+ for (let i = 1; i <= size; i++) {
114
+ if (i < size && get(i) === get(i - 1)) run++;
115
+ else {
116
+ if (run >= 5) score += run - 2;
117
+ run = 1;
118
+ }
119
+ }
120
+ for (let i = 0; i + 11 <= size; i++) {
121
+ for (const pattern of FINDER_LIKE) {
122
+ if (pattern.every((dark2, k) => get(i + k) === dark2)) score += 40;
123
+ }
124
+ }
125
+ };
126
+ let dark = 0;
127
+ for (let a = 0; a < size; a++) {
128
+ line((i) => modules[a][i]);
129
+ line((i) => modules[i][a]);
130
+ for (let b = 0; b < size; b++) {
131
+ if (modules[a][b]) dark++;
132
+ if (a + 1 < size && b + 1 < size) {
133
+ const colour = modules[a][b];
134
+ if (colour === modules[a][b + 1] && colour === modules[a + 1][b] && colour === modules[a + 1][b + 1]) score += 3;
135
+ }
136
+ }
137
+ }
138
+ const total = size * size;
139
+ score += Math.floor(Math.abs(dark * 20 - total * 10) / total) * 10;
140
+ return score;
141
+ }
142
+ function qrMatrix(text, level = "M") {
143
+ if (!Object.hasOwn(LEVEL_BITS, level)) level = "M";
144
+ const bytes = [...new TextEncoder().encode(text)];
145
+ let version = 1;
146
+ for (; version <= 40; version++) {
147
+ const countBits = version < 10 ? 8 : 16;
148
+ if (4 + countBits + bytes.length * 8 <= dataCodewords(version, level) * 8) break;
149
+ }
150
+ if (version > 40) return null;
151
+ const bits = [];
152
+ const push = (value, length) => {
153
+ for (let i = length - 1; i >= 0; i--) bits.push(value >>> i & 1);
154
+ };
155
+ push(4, 4);
156
+ push(bytes.length, version < 10 ? 8 : 16);
157
+ for (const byte of bytes) push(byte, 8);
158
+ const capacity = dataCodewords(version, level) * 8;
159
+ push(0, Math.min(4, capacity - bits.length));
160
+ push(0, (8 - bits.length % 8) % 8);
161
+ for (let pad = 236; bits.length < capacity; pad ^= 236 ^ 17) push(pad, 8);
162
+ const data = [];
163
+ for (let i = 0; i < bits.length; i += 8) {
164
+ let byte = 0;
165
+ for (let k = 0; k < 8; k++) byte = byte << 1 | bits[i + k];
166
+ data.push(byte);
167
+ }
168
+ const codewords = withErrorCorrection(data, version, level);
169
+ const size = version * 4 + 17;
170
+ const modules = Array.from({ length: size }, () => new Array(size).fill(false));
171
+ const reserved = Array.from({ length: size }, () => new Array(size).fill(false));
172
+ const set = (x, y, dark) => {
173
+ modules[y][x] = dark;
174
+ reserved[y][x] = true;
175
+ };
176
+ for (let i = 0; i < size; i++) {
177
+ set(6, i, i % 2 === 0);
178
+ set(i, 6, i % 2 === 0);
179
+ }
180
+ for (const [cx, cy] of [[3, 3], [size - 4, 3], [3, size - 4]]) {
181
+ for (let dy = -4; dy <= 4; dy++) {
182
+ for (let dx = -4; dx <= 4; dx++) {
183
+ const distance = Math.max(Math.abs(dx), Math.abs(dy));
184
+ const x = cx + dx;
185
+ const y = cy + dy;
186
+ if (x >= 0 && x < size && y >= 0 && y < size) set(x, y, distance !== 2 && distance !== 4);
187
+ }
188
+ }
189
+ }
190
+ const align = alignmentPositions(version, size);
191
+ const last = align.length - 1;
192
+ align.forEach((cx, i) => {
193
+ align.forEach((cy, j) => {
194
+ if (i === 0 && j === 0 || i === 0 && j === last || i === last && j === 0) return;
195
+ for (let dy = -2; dy <= 2; dy++) {
196
+ for (let dx = -2; dx <= 2; dx++) set(cx + dx, cy + dy, Math.max(Math.abs(dx), Math.abs(dy)) !== 1);
197
+ }
198
+ });
199
+ });
200
+ if (version >= 7) {
201
+ let remainder = version;
202
+ for (let i = 0; i < 12; i++) remainder = remainder << 1 ^ (remainder >>> 11) * 7973;
203
+ const info = version << 12 | remainder;
204
+ for (let i = 0; i < 18; i++) {
205
+ const dark = (info >>> i & 1) === 1;
206
+ const a = size - 11 + i % 3;
207
+ const b = Math.floor(i / 3);
208
+ set(a, b, dark);
209
+ set(b, a, dark);
210
+ }
211
+ }
212
+ const drawFormat = (mask) => {
213
+ const value = LEVEL_BITS[level] << 3 | mask;
214
+ let remainder = value;
215
+ for (let i = 0; i < 10; i++) remainder = remainder << 1 ^ (remainder >>> 9) * 1335;
216
+ const info = (value << 10 | remainder) ^ 21522;
217
+ const bit = (i) => (info >>> i & 1) === 1;
218
+ for (let i = 0; i <= 5; i++) set(8, i, bit(i));
219
+ set(8, 7, bit(6));
220
+ set(8, 8, bit(7));
221
+ set(7, 8, bit(8));
222
+ for (let i = 9; i < 15; i++) set(14 - i, 8, bit(i));
223
+ for (let i = 0; i < 8; i++) set(size - 1 - i, 8, bit(i));
224
+ for (let i = 8; i < 15; i++) set(8, size - 15 + i, bit(i));
225
+ set(8, size - 8, true);
226
+ };
227
+ drawFormat(0);
228
+ let index = 0;
229
+ for (let right = size - 1; right >= 1; right -= 2) {
230
+ if (right === 6) right = 5;
231
+ for (let vertical = 0; vertical < size; vertical++) {
232
+ for (let j = 0; j < 2; j++) {
233
+ const x = right - j;
234
+ const upward = (right + 1 & 2) === 0;
235
+ const y = upward ? size - 1 - vertical : vertical;
236
+ if (!reserved[y][x] && index < codewords.length * 8) {
237
+ modules[y][x] = (codewords[index >>> 3] >>> 7 - (index & 7) & 1) === 1;
238
+ index++;
239
+ }
240
+ }
241
+ }
242
+ }
243
+ const applyMask = (mask) => {
244
+ for (let y = 0; y < size; y++) {
245
+ for (let x = 0; x < size; x++) {
246
+ if (!reserved[y][x] && MASKS[mask](x, y)) modules[y][x] = !modules[y][x];
247
+ }
248
+ }
249
+ };
250
+ let best = 0;
251
+ let lowest = Infinity;
252
+ for (let mask = 0; mask < 8; mask++) {
253
+ applyMask(mask);
254
+ drawFormat(mask);
255
+ const score = penalty(modules);
256
+ if (score < lowest) {
257
+ lowest = score;
258
+ best = mask;
259
+ }
260
+ applyMask(mask);
261
+ }
262
+ applyMask(best);
263
+ drawFormat(best);
264
+ return modules;
265
+ }
266
+ var QUIET = 4;
267
+ function instanceStyle(root) {
268
+ const own = new CSSStyleSheet();
269
+ own.replaceSync(":host{}");
270
+ root.adoptedStyleSheets = [...root.adoptedStyleSheets, own];
271
+ return (
272
+ /** @type {CSSStyleRule} */
273
+ own.cssRules[0].style
274
+ );
275
+ }
276
+ var PunicaQrCode = class extends PunicaElement {
277
+ static properties = {
278
+ value: {},
279
+ label: {},
280
+ errorCorrection: { default: "M" },
281
+ size: { type: Number }
282
+ };
283
+ static styles = qrCode_default;
284
+ static template = `
285
+ <svg part="base" viewBox="0 0 29 29" shape-rendering="crispEdges" aria-hidden="true" focusable="false">
286
+ <rect class="background" width="100%" height="100%"></rect>
287
+ <path class="foreground"></path>
288
+ </svg>
289
+ `;
290
+ #svg = this.$("svg");
291
+ #path = this.$("path");
292
+ #style = instanceStyle(this.shadowRoot);
293
+ update(changed) {
294
+ const size = this.size;
295
+ if (size != null && size >= 16 && size <= 4096) this.#style.setProperty("--_size", `${size}px`);
296
+ else this.#style.removeProperty("--_size");
297
+ if (changed.has("value") || changed.has("errorCorrection")) this.#draw();
298
+ const internals = this.internals;
299
+ const name = this.label || this.value;
300
+ internals.role = name ? "img" : null;
301
+ internals.ariaLabel = name || null;
302
+ internals.ariaHidden = name ? null : "true";
303
+ }
304
+ #draw() {
305
+ const level = String(this.errorCorrection ?? "M").toUpperCase();
306
+ const modules = this.value ? qrMatrix(
307
+ this.value,
308
+ /** @type {any} */
309
+ level
310
+ ) : null;
311
+ this.toggleState("empty", !modules);
312
+ if (!modules) {
313
+ this.#path.setAttribute("d", "");
314
+ return;
315
+ }
316
+ const size = modules.length;
317
+ let d = "";
318
+ for (let y = 0; y < size; y++) {
319
+ for (let x = 0; x < size; x++) {
320
+ if (!modules[y][x]) continue;
321
+ let run = 1;
322
+ while (x + run < size && modules[y][x + run]) run++;
323
+ d += `M${x + QUIET} ${y + QUIET}h${run}v1h-${run}z`;
324
+ x += run;
325
+ }
326
+ }
327
+ const side = size + QUIET * 2;
328
+ this.#svg.setAttribute("viewBox", `0 0 ${side} ${side}`);
329
+ this.#path.setAttribute("d", d);
330
+ }
331
+ };
332
+ define("punica-qr-code", PunicaQrCode);
333
+
334
+ export {
335
+ qrMatrix,
336
+ PunicaQrCode
337
+ };
@@ -0,0 +1,6 @@
1
+ // src/components/select/field.css
2
+ var field_default = "/*\n * The field box and the floating panel shared by select and the pickers.\n * A component maps its public custom properties onto the private ones:\n * --_height, --_pad, --_radius, --_border, --_bg.\n */\n.field {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n inline-size: 100%;\n min-inline-size: 0;\n min-block-size: var(--_height);\n padding-inline: var(--_pad);\n border: var(--punica-border-width) solid var(--_border);\n border-radius: var(--_radius);\n background: var(--_bg);\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}\n\n.field:hover {\n border-color: var(--punica-color-border-strong);\n}\n\n.field:focus-within,\n:host(:state(open)) .field {\n border-color: var(--punica-color-primary);\n}\n\n.field:has(.control:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n:host(:state(user-invalid)) .field {\n border-color: var(--punica-color-error);\n}\n\n:host(:state(disabled)) .field {\n opacity: var(--punica-disabled-opacity);\n cursor: default;\n border-color: var(--_border);\n}\n\n.control {\n all: unset;\n flex: 1 1 0;\n min-inline-size: 0;\n align-self: stretch;\n display: flex;\n align-items: center;\n font: inherit;\n color: inherit;\n text-align: start;\n}\n\ninput.control {\n display: block;\n cursor: text;\n}\n\ninput.control::placeholder,\n.placeholder {\n color: var(--punica-color-text-placeholder);\n opacity: 1;\n}\n\n.icon-button {\n all: unset;\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-24);\n block-size: var(--punica-space-24);\n border-radius: var(--punica-radius-sm);\n font-size: var(--punica-font-size);\n color: var(--punica-color-text-muted);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.icon-button:hover {\n background: var(--punica-color-hover);\n color: var(--punica-color-text);\n}\n\n.icon-button:focus-visible {\n outline: var(--punica-focus-ring);\n}\n\n.icon-button:disabled {\n cursor: default;\n pointer-events: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n.panel {\n box-sizing: border-box;\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--_panel-radius, var(--punica-radius-sm));\n background: var(--_panel-bg, var(--punica-color-surface));\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n box-shadow: var(--_panel-shadow, var(--punica-shadow-xxs));\n opacity: 0;\n transition: opacity var(--punica-duration-fast) var(--punica-ease),\n display var(--punica-duration-fast) allow-discrete,\n overlay var(--punica-duration-fast) allow-discrete;\n}\n\n.panel:popover-open,\n.panel[data-open] {\n opacity: 1;\n}\n\n@starting-style {\n .panel:popover-open {\n opacity: 0;\n }\n}\n\n.listbox {\n max-block-size: var(--_list-max-height, 250px);\n padding-block: var(--punica-space-8);\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n@media (forced-colors: active) {\n .field,\n .panel {\n border-color: CanvasText;\n }\n .field:focus-within {\n border-color: Highlight;\n }\n :host(:state(disabled)) .field {\n border-color: GrayText;\n color: GrayText;\n opacity: 1;\n }\n}\n";
3
+
4
+ export {
5
+ field_default
6
+ };