@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.
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +139 -2
- package/bin/punica-components.mjs +138 -0
- package/custom-elements.json +38745 -0
- package/dist/ai/index.d.ts +39 -0
- package/dist/ai/index.mjs +615 -0
- package/dist/ai/node.d.ts +5 -0
- package/dist/ai/node.mjs +625 -0
- package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
- package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
- package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
- package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
- package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
- package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
- package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
- package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
- package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
- package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
- package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
- package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
- package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
- package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
- package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
- package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
- package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
- package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
- package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
- package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
- package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
- package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
- package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
- package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
- package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
- package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
- package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
- package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
- package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
- package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
- package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
- package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
- package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
- package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
- package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
- package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
- package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
- package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
- package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
- package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
- package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
- package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
- package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
- package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
- package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
- package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
- package/dist/esm/chunks/chunk-BC657356.js +93 -0
- package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
- package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
- package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
- package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
- package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
- package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
- package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
- package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
- package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
- package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
- package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
- package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
- package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
- package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
- package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
- package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
- package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
- package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
- package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
- package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
- package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
- package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
- package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
- package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
- package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
- package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
- package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
- package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
- package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
- package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
- package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
- package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
- package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
- package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
- package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
- package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
- package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
- package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
- package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
- package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
- package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
- package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
- package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
- package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
- package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
- package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
- package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
- package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
- package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
- package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
- package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
- package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
- package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
- package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
- package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
- package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
- package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
- package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
- package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
- package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
- package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
- package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
- package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
- package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
- package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
- package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
- package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
- package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
- package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
- package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
- package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
- package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
- package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
- package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
- package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
- package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
- package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
- package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
- package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
- package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
- package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
- package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
- package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
- package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
- package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
- package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
- package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
- package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
- package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
- package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
- package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
- package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
- package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
- package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
- package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
- package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
- package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
- package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
- package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
- package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
- package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
- package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
- package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
- package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
- package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
- package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
- package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
- package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
- package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
- package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
- package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
- package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
- package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
- package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
- package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
- package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
- package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
- package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
- package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
- package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
- package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
- package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
- package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
- package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
- package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
- package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
- package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
- package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
- package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
- package/dist/esm/components/accordion/accordion.js +8 -0
- package/dist/esm/components/accordion/accordionGroup.js +7 -0
- package/dist/esm/components/agenda/agenda.js +9 -0
- package/dist/esm/components/alert/alert.js +8 -0
- package/dist/esm/components/alertDialog/alertDialog.js +14 -0
- package/dist/esm/components/appBar/appBar.js +7 -0
- package/dist/esm/components/appShell/appShell.js +11 -0
- package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
- package/dist/esm/components/autocomplete/autocomplete.js +14 -0
- package/dist/esm/components/avatar/avatar.js +7 -0
- package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
- package/dist/esm/components/badge/badge.js +7 -0
- package/dist/esm/components/banner/banner.js +9 -0
- package/dist/esm/components/blockquote/blockquote.js +7 -0
- package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
- package/dist/esm/components/box/box.js +7 -0
- package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/esm/components/button/button.js +8 -0
- package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
- package/dist/esm/components/calendar/calendar.js +12 -0
- package/dist/esm/components/calendar/dates.js +44 -0
- package/dist/esm/components/card/card.js +7 -0
- package/dist/esm/components/card/cardActions.js +7 -0
- package/dist/esm/components/card/cardContent.js +7 -0
- package/dist/esm/components/card/cardHeader.js +7 -0
- package/dist/esm/components/card/cardMedia.js +7 -0
- package/dist/esm/components/carousel/carousel.js +9 -0
- package/dist/esm/components/carousel/carouselItem.js +7 -0
- package/dist/esm/components/center/center.js +7 -0
- package/dist/esm/components/chat/chatComposer.js +9 -0
- package/dist/esm/components/chat/chatDictationButton.js +8 -0
- package/dist/esm/components/chat/chatLayout.js +9 -0
- package/dist/esm/components/chat/chatMessage.js +9 -0
- package/dist/esm/components/chat/chatMessageBubble.js +7 -0
- package/dist/esm/components/chat/chatMessageList.js +8 -0
- package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
- package/dist/esm/components/chat/chatSystemMessage.js +7 -0
- package/dist/esm/components/chat/chatToolCall.js +9 -0
- package/dist/esm/components/chat/chatToolCalls.js +8 -0
- package/dist/esm/components/chat/slots.js +6 -0
- package/dist/esm/components/checkbox/checkbox.js +9 -0
- package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
- package/dist/esm/components/chip/chip.js +8 -0
- package/dist/esm/components/citation/citation.js +11 -0
- package/dist/esm/components/code/code.js +7 -0
- package/dist/esm/components/codeBlock/codeBlock.js +8 -0
- package/dist/esm/components/collapsible/collapsible.js +7 -0
- package/dist/esm/components/commandPalette/commandGroup.js +7 -0
- package/dist/esm/components/commandPalette/commandItem.js +7 -0
- package/dist/esm/components/commandPalette/commandPalette.js +10 -0
- package/dist/esm/components/complexSelector/complexOption.js +9 -0
- package/dist/esm/components/complexSelector/complexSelector.js +16 -0
- package/dist/esm/components/complexSelector/optionGroup.js +7 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/contextMenu/contextMenu.js +12 -0
- package/dist/esm/components/datePicker/datePicker.js +15 -0
- package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
- package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
- package/dist/esm/components/dialog/dialog.js +11 -0
- package/dist/esm/components/dialog/dialogContent.js +7 -0
- package/dist/esm/components/dialog/dialogFooter.js +7 -0
- package/dist/esm/components/dialog/dialogHeader.js +7 -0
- package/dist/esm/components/dialog/modalSurface.js +8 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/drawer/drawer.js +10 -0
- package/dist/esm/components/emptyState/emptyState.js +7 -0
- package/dist/esm/components/field/field.js +7 -0
- package/dist/esm/components/fileInput/fileInput.js +9 -0
- package/dist/esm/components/formLayout/formLayout.js +7 -0
- package/dist/esm/components/grid/col.js +7 -0
- package/dist/esm/components/grid/row.js +7 -0
- package/dist/esm/components/heading/heading.js +7 -0
- package/dist/esm/components/hidden/hidden.js +7 -0
- package/dist/esm/components/hoverCard/hoverCard.js +9 -0
- package/dist/esm/components/icon/icon.js +8 -0
- package/dist/esm/components/iconButton/iconButton.js +8 -0
- package/dist/esm/components/infoTip/infoTip.js +10 -0
- package/dist/esm/components/input/input.js +9 -0
- package/dist/esm/components/inputGroup/inputGroup.js +9 -0
- package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
- package/dist/esm/components/kbd/kbd.js +7 -0
- package/dist/esm/components/lightbox/lightbox.js +10 -0
- package/dist/esm/components/link/link.js +8 -0
- package/dist/esm/components/listView/list.js +7 -0
- package/dist/esm/components/listView/listItem.js +7 -0
- package/dist/esm/components/listbox/listbox.js +9 -0
- package/dist/esm/components/listbox/listboxItem.js +8 -0
- package/dist/esm/components/markdown/markdown.js +9 -0
- package/dist/esm/components/markdown/parser.js +9 -0
- package/dist/esm/components/markdown/url.js +6 -0
- package/dist/esm/components/menu/menu.js +11 -0
- package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
- package/dist/esm/components/menu/menuDivider.js +7 -0
- package/dist/esm/components/menu/menuGroup.js +7 -0
- package/dist/esm/components/menu/menuItem.js +8 -0
- package/dist/esm/components/menu/menuRadioGroup.js +7 -0
- package/dist/esm/components/menu/menuRadioItem.js +9 -0
- package/dist/esm/components/metadataList/metadataList.js +9 -0
- package/dist/esm/components/metadataList/metadataListItem.js +8 -0
- package/dist/esm/components/mobileNav/mobileNav.js +10 -0
- package/dist/esm/components/numberInput/numberInput.js +9 -0
- package/dist/esm/components/outline/outline.js +8 -0
- package/dist/esm/components/overflowList/overflowList.js +11 -0
- package/dist/esm/components/pagination/pagination.js +8 -0
- package/dist/esm/components/paper/paper.js +7 -0
- package/dist/esm/components/popover/popover.js +9 -0
- package/dist/esm/components/powerSearch/powerSearch.js +14 -0
- package/dist/esm/components/progressBar/progressBar.js +7 -0
- package/dist/esm/components/qrCode/qrCode.js +9 -0
- package/dist/esm/components/radio/radio.js +7 -0
- package/dist/esm/components/radio/radioGroup.js +10 -0
- package/dist/esm/components/scrollArea/scrollArea.js +8 -0
- package/dist/esm/components/section/section.js +8 -0
- package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
- package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
- package/dist/esm/components/select/field.js +18 -0
- package/dist/esm/components/select/option.js +8 -0
- package/dist/esm/components/select/select.js +14 -0
- package/dist/esm/components/selectableCard/selectableCard.js +9 -0
- package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
- package/dist/esm/components/sideNav/sideNav.js +9 -0
- package/dist/esm/components/sideNav/sideNavItem.js +9 -0
- package/dist/esm/components/sideNav/sideNavSection.js +8 -0
- package/dist/esm/components/skeleton/skeleton.js +7 -0
- package/dist/esm/components/slider/slider.js +9 -0
- package/dist/esm/components/spinner/spinner.js +7 -0
- package/dist/esm/components/split/split.js +8 -0
- package/dist/esm/components/splitButton/splitButton.js +12 -0
- package/dist/esm/components/stack/stack.js +7 -0
- package/dist/esm/components/statusDot/statusDot.js +7 -0
- package/dist/esm/components/stepper/step.js +8 -0
- package/dist/esm/components/stepper/stepper.js +7 -0
- package/dist/esm/components/switch/switch.js +8 -0
- package/dist/esm/components/tab/tab.js +7 -0
- package/dist/esm/components/tab/tabPanel.js +7 -0
- package/dist/esm/components/tab/tabs.js +8 -0
- package/dist/esm/components/table/table.js +7 -0
- package/dist/esm/components/table/tableBody.js +7 -0
- package/dist/esm/components/table/tableCell.js +7 -0
- package/dist/esm/components/table/tableFooter.js +7 -0
- package/dist/esm/components/table/tableHeader.js +7 -0
- package/dist/esm/components/table/tableHeaderCell.js +8 -0
- package/dist/esm/components/table/tableRow.js +7 -0
- package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
- package/dist/esm/components/text/text.js +7 -0
- package/dist/esm/components/textarea/textarea.js +8 -0
- package/dist/esm/components/thumbnail/thumbnail.js +8 -0
- package/dist/esm/components/timePicker/timePicker.js +15 -0
- package/dist/esm/components/timer/timer.js +7 -0
- package/dist/esm/components/timestamp/timestamp.js +7 -0
- package/dist/esm/components/toast/toast.js +8 -0
- package/dist/esm/components/toast/toaster.js +12 -0
- package/dist/esm/components/toggleButton/toggleButton.js +8 -0
- package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
- package/dist/esm/components/tokenizer/tokenizer.js +14 -0
- package/dist/esm/components/toolbar/toolbar.js +8 -0
- package/dist/esm/components/tooltip/tooltip.js +9 -0
- package/dist/esm/components/topNav/topNav.js +11 -0
- package/dist/esm/components/topNav/topNavItem.js +11 -0
- package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
- package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
- package/dist/esm/components/tree/tree.js +8 -0
- package/dist/esm/components/tree/treeItem.js +8 -0
- package/dist/esm/components/virtualList/virtualList.js +7 -0
- package/dist/esm/components/virtualTable/virtualTable.js +9 -0
- package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
- package/dist/esm/core/a11y.js +22 -0
- package/dist/esm/core/element.js +14 -0
- package/dist/esm/core/form.js +6 -0
- package/dist/esm/core/overlay.js +8 -0
- package/dist/esm/index.js +779 -0
- package/dist/llms-full.txt +8890 -0
- package/dist/llms.txt +275 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6753 -0
- package/dist/types/react.d.ts +1914 -0
- package/dist/vscode.css-custom-data.json +3892 -0
- package/dist/vscode.html-custom-data.json +6912 -0
- package/dist/web-types.json +12404 -0
- package/docs/MIGRATION-2.0.md +112 -0
- package/docs/contract.md +130 -0
- package/docs/migration/chat.md +309 -0
- package/docs/migration/content.md +806 -0
- package/docs/migration/data.md +140 -0
- package/docs/migration/display.md +625 -0
- package/docs/migration/form-basic.md +262 -0
- package/docs/migration/navigation.md +368 -0
- package/docs/migration/overlays.md +261 -0
- package/docs/migration/pickers.md +194 -0
- package/package.json +131 -4
- package/scripts/codemod-2.0.mjs +50 -0
- package/scripts/codemod-rules.mjs +102 -0
- package/skills/punica-components/SKILL.md +48 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deepActiveElement
|
|
3
|
+
} from "./chunk-4RURT4SK.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/contextMenu/contextMenu.css
|
|
10
|
+
var contextMenu_default = ":host {\n display: contents;\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/contextMenu/contextMenu.js
|
|
13
|
+
var PunicaContextMenu = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
label: {},
|
|
16
|
+
open: { type: Boolean },
|
|
17
|
+
disabled: { type: Boolean }
|
|
18
|
+
};
|
|
19
|
+
static styles = contextMenu_default;
|
|
20
|
+
static template = `
|
|
21
|
+
<slot></slot>
|
|
22
|
+
<punica-menu part="menu" exportparts="panel"><slot name="menu"></slot></punica-menu>
|
|
23
|
+
`;
|
|
24
|
+
#menu;
|
|
25
|
+
#keyboardAt = -Infinity;
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.#menu = this.$("punica-menu");
|
|
29
|
+
const area = this.$("slot:not([name])");
|
|
30
|
+
area.addEventListener("contextmenu", (event) => {
|
|
31
|
+
if (this.disabled) return;
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
if (event.timeStamp - this.#keyboardAt < 200) return;
|
|
34
|
+
this.showAt({ x: event.clientX, y: event.clientY });
|
|
35
|
+
});
|
|
36
|
+
area.addEventListener("keydown", (event) => {
|
|
37
|
+
if (this.disabled) return;
|
|
38
|
+
if (event.key !== "ContextMenu" && !(event.key === "F10" && event.shiftKey)) return;
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
this.#keyboardAt = event.timeStamp;
|
|
41
|
+
const menu = this.#menu;
|
|
42
|
+
menu.point = null;
|
|
43
|
+
menu.anchor = deepActiveElement() || this;
|
|
44
|
+
menu.show({ focus: "first" });
|
|
45
|
+
});
|
|
46
|
+
this.#menu.addEventListener("contextmenu", (event) => event.preventDefault());
|
|
47
|
+
for (const type of ["punica-open", "punica-close"]) {
|
|
48
|
+
this.#menu.addEventListener(type, (event) => {
|
|
49
|
+
if (event.target === this.#menu) this.open = type === "punica-open";
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Opens the menu at a viewport point.
|
|
55
|
+
* @param {{ x: number, y: number }} point
|
|
56
|
+
*/
|
|
57
|
+
showAt(point) {
|
|
58
|
+
const menu = this.#menu;
|
|
59
|
+
menu.anchor = null;
|
|
60
|
+
menu.point = point;
|
|
61
|
+
menu.show({ focus: "panel" });
|
|
62
|
+
}
|
|
63
|
+
/** Closes the menu. */
|
|
64
|
+
hide() {
|
|
65
|
+
this.#menu.hide();
|
|
66
|
+
}
|
|
67
|
+
update() {
|
|
68
|
+
const menu = this.#menu;
|
|
69
|
+
menu.label = this.label;
|
|
70
|
+
menu.offset = 0;
|
|
71
|
+
if (menu.open !== this.open) {
|
|
72
|
+
if (this.open) menu.show();
|
|
73
|
+
else menu.hide();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
define("punica-context-menu", PunicaContextMenu);
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
PunicaContextMenu
|
|
81
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/select/option.css
|
|
10
|
+
var option_default = "/* audit-allow: pointer-without-focus-visible (the row is never focused: the combobox keeps focus and :state(active) marks the row) */\n:host {\n --punica-option-padding: var(--punica-space-8) var(--punica-space-16);\n --punica-option-active-background: var(--punica-color-hover);\n --punica-option-selected-background: var(--punica-color-selected);\n\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-option-padding);\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 cursor: pointer;\n user-select: none;\n}\n\n:host(:state(active)) {\n background: var(--punica-option-active-background);\n}\n\n:host([selected]) {\n background: var(--punica-option-selected-background);\n}\n\n:host([selected]:state(active)) {\n background: color-mix(in srgb, var(--punica-option-selected-background), var(--punica-option-active-background));\n}\n\n:host([disabled]) {\n color: var(--punica-color-text-muted);\n opacity: var(--punica-disabled-opacity);\n cursor: default;\n}\n\n.label {\n flex: 1 1 auto;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.check {\n flex: none;\n display: inline-flex;\n visibility: hidden;\n color: var(--punica-color-primary);\n}\n\n:host([selected]) .check {\n visibility: visible;\n}\n\n@media (forced-colors: active) {\n :host(:state(active)) {\n outline: var(--punica-focus-ring-width) solid Highlight;\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n }\n :host([selected]) .check {\n color: Highlight;\n }\n :host([disabled]) {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/select/option.js
|
|
13
|
+
var PunicaOption = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
value: {},
|
|
16
|
+
label: {},
|
|
17
|
+
disabled: { type: Boolean },
|
|
18
|
+
selected: { type: Boolean },
|
|
19
|
+
active: { type: Boolean, attribute: false }
|
|
20
|
+
};
|
|
21
|
+
static styles = option_default;
|
|
22
|
+
static template = `
|
|
23
|
+
<slot name="start"></slot>
|
|
24
|
+
<span part="label" class="label"><slot><span class="fallback"></span></slot></span>
|
|
25
|
+
<slot name="end"></slot>
|
|
26
|
+
<span part="check" class="check">${icons.check}</span>
|
|
27
|
+
`;
|
|
28
|
+
#fallback = this.$(".fallback");
|
|
29
|
+
/** The text shown for this row: `label`, else its text content. */
|
|
30
|
+
get text() {
|
|
31
|
+
return this.label ?? this.textContent.trim().replace(/\s+/g, " ");
|
|
32
|
+
}
|
|
33
|
+
/** The value this row stands for: `value`, else its text. */
|
|
34
|
+
get optionValue() {
|
|
35
|
+
return this.value ?? this.text;
|
|
36
|
+
}
|
|
37
|
+
update() {
|
|
38
|
+
const internals = this.internals;
|
|
39
|
+
internals.role = "option";
|
|
40
|
+
internals.ariaSelected = String(this.selected);
|
|
41
|
+
internals.ariaDisabled = this.disabled ? "true" : null;
|
|
42
|
+
this.toggleState("active", this.active);
|
|
43
|
+
this.#fallback.textContent = this.label ?? "";
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
define("punica-option", PunicaOption);
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
option_default,
|
|
50
|
+
PunicaOption
|
|
51
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Overlay,
|
|
3
|
+
overlayCss
|
|
4
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
5
|
+
import {
|
|
6
|
+
composedContains,
|
|
7
|
+
deepActiveElement
|
|
8
|
+
} from "./chunk-4RURT4SK.js";
|
|
9
|
+
import {
|
|
10
|
+
PunicaElement,
|
|
11
|
+
define
|
|
12
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
13
|
+
|
|
14
|
+
// src/components/hoverCard/hoverCard.css
|
|
15
|
+
var hoverCard_default = ":host {\n --punica-hover-card-radius: var(--punica-radius);\n --punica-hover-card-padding: var(--punica-padding);\n --punica-hover-card-background: var(--punica-color-surface-raised);\n --punica-hover-card-shadow: var(--punica-shadow-md);\n --punica-hover-card-max-width: min(90vw, 360px);\n\n display: contents;\n}\n\n[part='panel'] {\n max-inline-size: var(--punica-hover-card-max-width);\n padding: var(--punica-hover-card-padding);\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-hover-card-radius);\n background: var(--punica-hover-card-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 box-shadow: var(--punica-hover-card-shadow);\n overflow: auto;\n opacity: 0;\n transition: opacity var(--punica-duration) var(--punica-ease),\n display var(--punica-duration) allow-discrete,\n overlay var(--punica-duration) allow-discrete;\n}\n\n[part='panel']:popover-open,\n[part='panel'][data-open] {\n opacity: 1;\n}\n\n[part='panel']:focus-visible {\n outline: var(--punica-focus-ring);\n}\n\n@starting-style {\n [part='panel']:popover-open {\n opacity: 0;\n }\n}\n\n@media (forced-colors: active) {\n [part='panel'] {\n border-color: CanvasText;\n }\n}\n";
|
|
16
|
+
|
|
17
|
+
// src/components/hoverCard/hoverCard.js
|
|
18
|
+
var PunicaHoverCard = class extends PunicaElement {
|
|
19
|
+
static properties = {
|
|
20
|
+
label: {},
|
|
21
|
+
open: { type: Boolean },
|
|
22
|
+
side: { default: "block-end" },
|
|
23
|
+
align: { default: "start" },
|
|
24
|
+
delay: { type: Number, default: 400 },
|
|
25
|
+
closeDelay: { type: Number, default: 200 },
|
|
26
|
+
offset: { type: Number, default: 8 },
|
|
27
|
+
disabled: { type: Boolean }
|
|
28
|
+
};
|
|
29
|
+
static styles = [overlayCss, hoverCard_default];
|
|
30
|
+
static template = `
|
|
31
|
+
<slot name="trigger"></slot>
|
|
32
|
+
<div part="panel" popover="manual" role="dialog" tabindex="-1"><slot></slot></div>
|
|
33
|
+
`;
|
|
34
|
+
#panel = this.$('[part="panel"]');
|
|
35
|
+
#triggerSlot = this.$('slot[name="trigger"]');
|
|
36
|
+
#overlay = new Overlay(this.#panel);
|
|
37
|
+
#showTimer = 0;
|
|
38
|
+
#hideTimer = 0;
|
|
39
|
+
#shown = false;
|
|
40
|
+
#reason = "api";
|
|
41
|
+
#restoring = false;
|
|
42
|
+
/** @type {AbortController | null} */
|
|
43
|
+
#openAbort = null;
|
|
44
|
+
constructor() {
|
|
45
|
+
super();
|
|
46
|
+
const trigger = this.#triggerSlot;
|
|
47
|
+
const panel = this.#panel;
|
|
48
|
+
trigger.addEventListener("slotchange", () => this.requestUpdate());
|
|
49
|
+
trigger.addEventListener("pointerover", (event) => {
|
|
50
|
+
if (event.pointerType !== "touch") this.#schedule(true);
|
|
51
|
+
});
|
|
52
|
+
panel.addEventListener("pointerover", () => clearTimeout(this.#hideTimer));
|
|
53
|
+
trigger.addEventListener("focusin", () => {
|
|
54
|
+
if (this.#restoring || this.disabled || !deepActiveElement()?.matches(":focus-visible")) return;
|
|
55
|
+
clearTimeout(this.#showTimer);
|
|
56
|
+
clearTimeout(this.#hideTimer);
|
|
57
|
+
this.open = true;
|
|
58
|
+
});
|
|
59
|
+
for (const part of [trigger, panel]) {
|
|
60
|
+
part.addEventListener("pointerout", (event) => {
|
|
61
|
+
if (!this.#inside(
|
|
62
|
+
/** @type {Node | null} */
|
|
63
|
+
event.relatedTarget
|
|
64
|
+
)) this.#schedule(false);
|
|
65
|
+
});
|
|
66
|
+
part.addEventListener("focusout", (event) => {
|
|
67
|
+
if (!this.#inside(
|
|
68
|
+
/** @type {Node | null} */
|
|
69
|
+
event.relatedTarget
|
|
70
|
+
)) this.hide("blur");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
get #trigger() {
|
|
75
|
+
return this.#triggerSlot.assignedElements({ flatten: true })[0] || null;
|
|
76
|
+
}
|
|
77
|
+
/** The floating panel element. */
|
|
78
|
+
get panel() {
|
|
79
|
+
return this.#panel;
|
|
80
|
+
}
|
|
81
|
+
/** Shows the panel now. */
|
|
82
|
+
show() {
|
|
83
|
+
this.open = true;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Hides the panel now.
|
|
87
|
+
* @param {'pointer' | 'blur' | 'escape' | 'api'} [reason]
|
|
88
|
+
*/
|
|
89
|
+
hide(reason = "api") {
|
|
90
|
+
clearTimeout(this.#showTimer);
|
|
91
|
+
clearTimeout(this.#hideTimer);
|
|
92
|
+
if (!this.open) return;
|
|
93
|
+
this.#reason = reason;
|
|
94
|
+
this.open = false;
|
|
95
|
+
}
|
|
96
|
+
connected() {
|
|
97
|
+
if (this.open && !this.#shown) {
|
|
98
|
+
queueMicrotask(() => this.isConnected && this.open && !this.#shown && this.#setup());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
disconnected() {
|
|
102
|
+
clearTimeout(this.#showTimer);
|
|
103
|
+
clearTimeout(this.#hideTimer);
|
|
104
|
+
this.#teardown(false);
|
|
105
|
+
}
|
|
106
|
+
update(changed) {
|
|
107
|
+
const panel = this.#panel;
|
|
108
|
+
if (this.label) panel.setAttribute("aria-label", this.label);
|
|
109
|
+
else panel.removeAttribute("aria-label");
|
|
110
|
+
const trigger = this.#trigger;
|
|
111
|
+
if (trigger) {
|
|
112
|
+
trigger.setAttribute("aria-haspopup", "dialog");
|
|
113
|
+
trigger.setAttribute("aria-expanded", String(this.open));
|
|
114
|
+
}
|
|
115
|
+
if (this.open && !this.#shown) this.#setup();
|
|
116
|
+
else if (!this.open && this.#shown) this.#teardown(true);
|
|
117
|
+
else if (this.open && ["side", "align", "offset"].some((name) => changed.has(name))) this.#place();
|
|
118
|
+
}
|
|
119
|
+
/** @param {Node | null} node */
|
|
120
|
+
#inside(node) {
|
|
121
|
+
return !!node && (composedContains(this, node) || composedContains(this.#panel, node));
|
|
122
|
+
}
|
|
123
|
+
/** @param {boolean} show */
|
|
124
|
+
#schedule(show) {
|
|
125
|
+
clearTimeout(this.#showTimer);
|
|
126
|
+
clearTimeout(this.#hideTimer);
|
|
127
|
+
if (show) {
|
|
128
|
+
if (this.open || this.disabled) return;
|
|
129
|
+
this.#showTimer = setTimeout(() => this.open = true, Math.max(0, this.delay));
|
|
130
|
+
} else {
|
|
131
|
+
this.#hideTimer = setTimeout(() => this.hide("pointer"), Math.max(0, this.closeDelay));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
#place() {
|
|
135
|
+
this.#overlay.show(this.#trigger || this, {
|
|
136
|
+
side: (
|
|
137
|
+
/** @type {any} */
|
|
138
|
+
this.side
|
|
139
|
+
),
|
|
140
|
+
align: (
|
|
141
|
+
/** @type {any} */
|
|
142
|
+
this.align
|
|
143
|
+
),
|
|
144
|
+
offset: this.offset
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
#setup() {
|
|
148
|
+
this.#shown = true;
|
|
149
|
+
this.#place();
|
|
150
|
+
this.#openAbort = new AbortController();
|
|
151
|
+
document.addEventListener(
|
|
152
|
+
"keydown",
|
|
153
|
+
(event) => {
|
|
154
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
155
|
+
if (this.#inside(deepActiveElement())) event.preventDefault();
|
|
156
|
+
this.hide("escape");
|
|
157
|
+
},
|
|
158
|
+
{ signal: this.#openAbort.signal }
|
|
159
|
+
);
|
|
160
|
+
this.emit("open");
|
|
161
|
+
}
|
|
162
|
+
/** @param {boolean} announce */
|
|
163
|
+
#teardown(announce) {
|
|
164
|
+
if (!this.#shown) return;
|
|
165
|
+
const active = deepActiveElement();
|
|
166
|
+
const focusInPanel = !!active && composedContains(this.#panel, active);
|
|
167
|
+
this.#shown = false;
|
|
168
|
+
this.#openAbort?.abort();
|
|
169
|
+
this.#openAbort = null;
|
|
170
|
+
this.#overlay.hide();
|
|
171
|
+
if (!announce) return;
|
|
172
|
+
const reason = this.#reason;
|
|
173
|
+
this.#reason = "api";
|
|
174
|
+
const trigger = this.#trigger;
|
|
175
|
+
if (focusInPanel && trigger instanceof HTMLElement) {
|
|
176
|
+
this.#restoring = true;
|
|
177
|
+
trigger.focus({ preventScroll: true });
|
|
178
|
+
this.#restoring = false;
|
|
179
|
+
}
|
|
180
|
+
this.emit("close", { reason });
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
define("punica-hover-card", PunicaHoverCard);
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
PunicaHoverCard
|
|
187
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/badge/badge.css
|
|
7
|
+
var badge_default = `:host {
|
|
8
|
+
--punica-badge-background: var(--punica-color-primary);
|
|
9
|
+
--punica-badge-color: var(--punica-color-on-accent);
|
|
10
|
+
--punica-badge-size: var(--punica-space-20);
|
|
11
|
+
--punica-badge-dot-size: var(--punica-space-8);
|
|
12
|
+
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
position: relative;
|
|
15
|
+
flex: none;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([color='secondary']) {
|
|
20
|
+
--punica-badge-background: var(--punica-color-secondary);
|
|
21
|
+
}
|
|
22
|
+
:host([color='error']) {
|
|
23
|
+
--punica-badge-background: var(--punica-color-error);
|
|
24
|
+
}
|
|
25
|
+
:host([color='warning']) {
|
|
26
|
+
--punica-badge-background: var(--punica-color-warning);
|
|
27
|
+
}
|
|
28
|
+
:host([color='info']) {
|
|
29
|
+
--punica-badge-background: var(--punica-color-info);
|
|
30
|
+
}
|
|
31
|
+
:host([color='success']) {
|
|
32
|
+
--punica-badge-background: var(--punica-color-success);
|
|
33
|
+
}
|
|
34
|
+
:host([color='neutral']) {
|
|
35
|
+
/* A grey drawn from the text colour: --punica-color-neutral under the text
|
|
36
|
+
colour is 2.9:1 in dark mode. */
|
|
37
|
+
--punica-badge-background: color-mix(in srgb, var(--punica-color-text) 16%, var(--punica-color-surface));
|
|
38
|
+
--punica-badge-color: var(--punica-color-text);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.badge {
|
|
42
|
+
--_x: 50%;
|
|
43
|
+
--_y: -50%;
|
|
44
|
+
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset-block-start: 0;
|
|
47
|
+
inset-inline-end: 0;
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
min-inline-size: var(--punica-badge-size);
|
|
52
|
+
block-size: var(--punica-badge-size);
|
|
53
|
+
padding-inline: var(--punica-space-6);
|
|
54
|
+
border-radius: var(--punica-radius-full);
|
|
55
|
+
background: var(--punica-badge-background);
|
|
56
|
+
color: var(--punica-badge-color);
|
|
57
|
+
font-family: var(--punica-font-family);
|
|
58
|
+
font-size: var(--punica-font-size-xs);
|
|
59
|
+
font-weight: var(--punica-font-weight-medium);
|
|
60
|
+
line-height: 1;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
translate: var(--_x) var(--_y);
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
transition: background-color var(--punica-duration) var(--punica-ease);
|
|
65
|
+
}
|
|
66
|
+
/* A count reads left to right in every script: "99+" stays "99+" in RTL. */
|
|
67
|
+
.count {
|
|
68
|
+
direction: ltr;
|
|
69
|
+
unicode-bidi: isolate;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.badge[hidden] {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
.badge:dir(rtl) {
|
|
76
|
+
--_x: -50%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([placement='block-start-inline-start']) .badge,
|
|
80
|
+
:host([placement='block-end-inline-start']) .badge {
|
|
81
|
+
--_x: -50%;
|
|
82
|
+
inset-inline: 0 auto;
|
|
83
|
+
}
|
|
84
|
+
:host([placement='block-start-inline-start']) .badge:dir(rtl),
|
|
85
|
+
:host([placement='block-end-inline-start']) .badge:dir(rtl) {
|
|
86
|
+
--_x: 50%;
|
|
87
|
+
}
|
|
88
|
+
:host([placement='block-end-inline-end']) .badge,
|
|
89
|
+
:host([placement='block-end-inline-start']) .badge {
|
|
90
|
+
--_y: 50%;
|
|
91
|
+
inset-block: auto 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([dot]) .badge {
|
|
95
|
+
min-inline-size: 0;
|
|
96
|
+
inline-size: var(--punica-badge-dot-size);
|
|
97
|
+
block-size: var(--punica-badge-dot-size);
|
|
98
|
+
padding: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host(:state(standalone)) .badge {
|
|
102
|
+
position: static;
|
|
103
|
+
translate: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.label {
|
|
107
|
+
position: absolute;
|
|
108
|
+
inline-size: 1px;
|
|
109
|
+
block-size: 1px;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
clip-path: inset(50%);
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media (forced-colors: active) {
|
|
116
|
+
.badge {
|
|
117
|
+
border: var(--punica-border-width) solid CanvasText;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
// src/components/badge/badge.js
|
|
123
|
+
var PunicaBadge = class extends PunicaElement {
|
|
124
|
+
static properties = {
|
|
125
|
+
content: {},
|
|
126
|
+
color: {},
|
|
127
|
+
placement: {},
|
|
128
|
+
label: {},
|
|
129
|
+
max: { type: Number, default: 99 },
|
|
130
|
+
dot: { type: Boolean },
|
|
131
|
+
showZero: { type: Boolean }
|
|
132
|
+
};
|
|
133
|
+
static styles = badge_default;
|
|
134
|
+
static template = `<slot></slot><span part="badge" class="badge" hidden><span class="count"></span><span class="label"></span></span>`;
|
|
135
|
+
#slot = this.$("slot");
|
|
136
|
+
#badge = this.$(".badge");
|
|
137
|
+
#count = this.$(".count");
|
|
138
|
+
#label = this.$(".label");
|
|
139
|
+
constructor() {
|
|
140
|
+
super();
|
|
141
|
+
this.#slot.addEventListener("slotchange", () => this.#standalone());
|
|
142
|
+
}
|
|
143
|
+
update() {
|
|
144
|
+
const raw = this.content?.trim() ?? "";
|
|
145
|
+
const count = raw !== "" && Number.isFinite(Number(raw)) ? Number(raw) : null;
|
|
146
|
+
const zero = count === 0 && !this.showZero;
|
|
147
|
+
let text = "";
|
|
148
|
+
if (!this.dot && !zero) {
|
|
149
|
+
if (count === null) text = raw;
|
|
150
|
+
else {
|
|
151
|
+
const language = this.closest("[lang]")?.lang || navigator.language;
|
|
152
|
+
const format = new Intl.NumberFormat(language);
|
|
153
|
+
const max = this.max >= 0 ? this.max : 99;
|
|
154
|
+
text = count > max ? `${format.format(max)}+` : format.format(count);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const shown = this.dot ? !zero : text !== "";
|
|
158
|
+
this.#badge.hidden = !shown;
|
|
159
|
+
this.#count.textContent = text;
|
|
160
|
+
this.#label.textContent = shown ? this.label ?? "" : "";
|
|
161
|
+
if (this.label) this.#count.setAttribute("aria-hidden", "true");
|
|
162
|
+
else this.#count.removeAttribute("aria-hidden");
|
|
163
|
+
this.#standalone();
|
|
164
|
+
}
|
|
165
|
+
#standalone() {
|
|
166
|
+
const filled = this.#slot.assignedNodes({ flatten: true }).some((node) => node.nodeType === Node.ELEMENT_NODE || node.textContent.trim() !== "");
|
|
167
|
+
this.toggleState("standalone", !filled);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
define("punica-badge", PunicaBadge);
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
PunicaBadge
|
|
174
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/codeBlock/codeBlock.css
|
|
10
|
+
var codeBlock_default = ":host {\n --punica-code-block-background: var(--punica-color-neutral-light);\n --punica-code-block-color: var(--punica-color-text);\n --punica-code-block-radius: var(--punica-radius);\n --punica-code-block-padding: var(--punica-space-12) var(--punica-space-16);\n --punica-code-block-font-size: var(--punica-font-size-sm);\n --punica-code-block-line-number-color: var(--punica-color-text-muted);\n\n display: block;\n}\n\n/* A grid track of minmax(0, auto) gives the block a min-content size of\n nothing, so a long line scrolls inside it instead of widening whatever\n shrink-wraps the block (a chat bubble, a flex column, a table cell). */\n.base {\n display: grid;\n grid-template-columns: minmax(0, auto);\n position: relative;\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-code-block-radius);\n background: var(--punica-code-block-background);\n color: var(--punica-code-block-color);\n overflow: hidden;\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--punica-space-8);\n padding-block: var(--punica-space-4);\n padding-inline: var(--punica-space-16) var(--punica-space-4);\n border-block-end: var(--punica-border-width) solid var(--punica-color-border);\n}\n\n.language {\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-xs);\n font-weight: var(--punica-font-weight-semi-bold);\n color: var(--punica-color-text);\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--punica-radius-sm);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\nbutton:hover {\n background: var(--punica-color-hover);\n}\nbutton:focus-visible,\npre:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n.copy {\n inline-size: var(--punica-size-sm);\n block-size: var(--punica-size-sm);\n}\n.when-copied,\n:host(:state(copied)) .when-idle {\n display: none;\n}\n:host(:state(copied)) .when-copied {\n display: inline-flex;\n color: var(--punica-color-success);\n}\n.when-idle {\n display: inline-flex;\n}\n\n/* Code reads left to right in a right-to-left page too: its punctuation\n would otherwise be reordered and its lines set against the right edge. */\npre {\n direction: ltr;\n unicode-bidi: isolate;\n text-align: start;\n margin: 0;\n padding: var(--punica-code-block-padding);\n overflow: auto;\n font-family: var(--punica-font-family-mono);\n font-size: var(--punica-code-block-font-size);\n line-height: var(--punica-line-height);\n tab-size: 2;\n white-space: pre;\n}\n:host([wrap]) pre {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\ncode {\n --_gutter: calc(var(--_digits, 1) * 1ch + var(--punica-space-16));\n display: block;\n inline-size: max-content;\n min-inline-size: 100%;\n font: inherit;\n counter-reset: line;\n}\n:host([wrap]) code {\n inline-size: auto;\n}\n\n.line {\n display: block;\n position: relative;\n counter-increment: line;\n}\n.line[hidden] {\n display: none !important;\n}\n:host([line-numbers]) .line {\n padding-inline-start: var(--_gutter);\n}\n:host([line-numbers]) .line::before {\n content: counter(line);\n content: counter(line) / '';\n position: absolute;\n inset-inline-start: 0;\n inline-size: calc(var(--_gutter) - var(--punica-space-16));\n text-align: end;\n color: var(--punica-code-block-line-number-color);\n user-select: none;\n}\n\n.expand {\n display: flex;\n inline-size: 100%;\n min-block-size: var(--punica-size-sm);\n border-block-start: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: 0;\n font-weight: var(--punica-font-weight-semi-bold);\n}\n.expand[hidden] {\n display: none !important;\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\n@media (forced-colors: active) {\n .base {\n border-color: CanvasText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/codeBlock/codeBlock.js
|
|
13
|
+
function splitLines(source) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
const stack = [];
|
|
16
|
+
let chain = [];
|
|
17
|
+
let line;
|
|
18
|
+
const newLine = () => {
|
|
19
|
+
line = document.createElement("span");
|
|
20
|
+
line.className = "line";
|
|
21
|
+
line.setAttribute("part", "line");
|
|
22
|
+
lines.push(line);
|
|
23
|
+
chain = [];
|
|
24
|
+
let parent = line;
|
|
25
|
+
for (const el of stack) {
|
|
26
|
+
const clone = el.cloneNode(false);
|
|
27
|
+
parent.appendChild(clone);
|
|
28
|
+
chain.push(clone);
|
|
29
|
+
parent = clone;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const tip = () => chain[chain.length - 1] || line;
|
|
33
|
+
const walk = (node) => {
|
|
34
|
+
for (const child of node.childNodes) {
|
|
35
|
+
if (child.nodeType === 3) {
|
|
36
|
+
child.data.split("\n").forEach((piece, i) => {
|
|
37
|
+
if (i) newLine();
|
|
38
|
+
if (piece) tip().appendChild(document.createTextNode(piece));
|
|
39
|
+
});
|
|
40
|
+
} else if (child.nodeType === 1) {
|
|
41
|
+
const clone = child.cloneNode(false);
|
|
42
|
+
tip().appendChild(clone);
|
|
43
|
+
stack.push(child);
|
|
44
|
+
chain.push(clone);
|
|
45
|
+
walk(child);
|
|
46
|
+
stack.pop();
|
|
47
|
+
chain.pop();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
newLine();
|
|
52
|
+
walk(source);
|
|
53
|
+
return lines;
|
|
54
|
+
}
|
|
55
|
+
function tidy(text) {
|
|
56
|
+
const lines = text.replace(/^[ \t]*\n/, "").replace(/\s+$/, "").split("\n");
|
|
57
|
+
const indents = lines.filter((l) => l.trim()).map((l) => l.match(/^[ \t]*/)[0].length);
|
|
58
|
+
const indent = indents.length ? Math.min(...indents) : 0;
|
|
59
|
+
return lines.map((l) => l.slice(indent)).join("\n");
|
|
60
|
+
}
|
|
61
|
+
var PunicaCodeBlock = class extends PunicaElement {
|
|
62
|
+
static properties = {
|
|
63
|
+
language: {},
|
|
64
|
+
label: {},
|
|
65
|
+
lineNumbers: { type: Boolean },
|
|
66
|
+
wrap: { type: Boolean },
|
|
67
|
+
maxLines: { type: Number },
|
|
68
|
+
open: { type: Boolean },
|
|
69
|
+
labelCopy: { default: "Copy" },
|
|
70
|
+
labelCopied: { default: "Copied" },
|
|
71
|
+
labelExpand: { default: "Show more" },
|
|
72
|
+
labelCollapse: { default: "Show less" },
|
|
73
|
+
code: { attribute: false },
|
|
74
|
+
highlight: { type: Object, attribute: false }
|
|
75
|
+
};
|
|
76
|
+
static styles = codeBlock_default;
|
|
77
|
+
static template = `
|
|
78
|
+
<div part="base" class="base">
|
|
79
|
+
<div part="header" class="header">
|
|
80
|
+
<span part="language" class="language"></span>
|
|
81
|
+
<button part="copy-button" class="copy" type="button">
|
|
82
|
+
<span class="when-idle">${icons.copy}</span>
|
|
83
|
+
<span class="when-copied">${icons.check}</span>
|
|
84
|
+
</button>
|
|
85
|
+
</div>
|
|
86
|
+
<pre part="pre" tabindex="0"><code part="code"></code></pre>
|
|
87
|
+
<button part="expand-button" class="expand" type="button" hidden></button>
|
|
88
|
+
<span part="status" class="status" role="status" aria-live="polite"></span>
|
|
89
|
+
</div>
|
|
90
|
+
`;
|
|
91
|
+
#code = this.$("code");
|
|
92
|
+
#pre = this.$("pre");
|
|
93
|
+
#language = this.$(".language");
|
|
94
|
+
#copy = this.$(".copy");
|
|
95
|
+
#expand = this.$(".expand");
|
|
96
|
+
#status = this.$(".status");
|
|
97
|
+
/** @type {MutationObserver | null} */
|
|
98
|
+
#observer = null;
|
|
99
|
+
#copiedTimer = 0;
|
|
100
|
+
#ready = false;
|
|
101
|
+
constructor() {
|
|
102
|
+
super();
|
|
103
|
+
this.#copy.addEventListener("click", () => this.copy());
|
|
104
|
+
this.#expand.addEventListener("click", () => {
|
|
105
|
+
this.open = !this.open;
|
|
106
|
+
this.emit("toggle", { open: this.open });
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** The code as it is shown and copied. */
|
|
110
|
+
get text() {
|
|
111
|
+
return this.code ?? tidy(this.textContent || "");
|
|
112
|
+
}
|
|
113
|
+
connected() {
|
|
114
|
+
this.#observer = new MutationObserver(() => {
|
|
115
|
+
if (this.code == null) this.#render();
|
|
116
|
+
});
|
|
117
|
+
this.#observer.observe(this, { childList: true, characterData: true, subtree: true });
|
|
118
|
+
if (this.#ready) this.#render();
|
|
119
|
+
}
|
|
120
|
+
disconnected() {
|
|
121
|
+
this.#observer?.disconnect();
|
|
122
|
+
this.#observer = null;
|
|
123
|
+
this.#clearCopied();
|
|
124
|
+
}
|
|
125
|
+
update() {
|
|
126
|
+
this.#ready = true;
|
|
127
|
+
this.#language.textContent = this.language || "";
|
|
128
|
+
this.#copy.setAttribute("aria-label", this.labelCopy);
|
|
129
|
+
this.#copy.title = this.labelCopy;
|
|
130
|
+
if (this.label) {
|
|
131
|
+
this.#pre.setAttribute("role", "region");
|
|
132
|
+
this.#pre.setAttribute("aria-label", this.label);
|
|
133
|
+
} else {
|
|
134
|
+
this.#pre.removeAttribute("role");
|
|
135
|
+
this.#pre.removeAttribute("aria-label");
|
|
136
|
+
}
|
|
137
|
+
this.#render();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Copies the code to the clipboard and announces it.
|
|
141
|
+
* @returns {Promise<boolean>} whether the clipboard took it
|
|
142
|
+
*/
|
|
143
|
+
async copy() {
|
|
144
|
+
try {
|
|
145
|
+
await navigator.clipboard.writeText(this.text);
|
|
146
|
+
} catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
if (!this.isConnected) return true;
|
|
150
|
+
clearTimeout(this.#copiedTimer);
|
|
151
|
+
this.toggleState("copied", true);
|
|
152
|
+
this.#status.textContent = this.labelCopied;
|
|
153
|
+
this.#copiedTimer = setTimeout(() => this.#clearCopied(), 2e3);
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
#clearCopied() {
|
|
157
|
+
clearTimeout(this.#copiedTimer);
|
|
158
|
+
this.#copiedTimer = 0;
|
|
159
|
+
this.toggleState("copied", false);
|
|
160
|
+
this.#status.textContent = "";
|
|
161
|
+
}
|
|
162
|
+
#render() {
|
|
163
|
+
const text = this.text;
|
|
164
|
+
let fragment = null;
|
|
165
|
+
if (typeof this.highlight === "function") {
|
|
166
|
+
const result = this.highlight(text, this.language);
|
|
167
|
+
if (result instanceof DocumentFragment) fragment = result;
|
|
168
|
+
}
|
|
169
|
+
if (!fragment) {
|
|
170
|
+
fragment = document.createDocumentFragment();
|
|
171
|
+
fragment.append(text);
|
|
172
|
+
}
|
|
173
|
+
const lines = splitLines(fragment);
|
|
174
|
+
const max = this.maxLines > 0 ? Math.floor(this.maxLines) : Infinity;
|
|
175
|
+
const cut = lines.length > max;
|
|
176
|
+
lines.forEach((line, i) => {
|
|
177
|
+
line.append("\n");
|
|
178
|
+
line.hidden = cut && !this.open && i >= max;
|
|
179
|
+
});
|
|
180
|
+
this.#code.replaceChildren(...lines);
|
|
181
|
+
this.#code.style.setProperty("--_digits", String(String(lines.length).length));
|
|
182
|
+
this.#expand.hidden = !cut;
|
|
183
|
+
this.#expand.textContent = this.open ? this.labelCollapse : this.labelExpand;
|
|
184
|
+
this.#expand.setAttribute("aria-expanded", String(this.open));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
define("punica-code-block", PunicaCodeBlock);
|
|
188
|
+
|
|
189
|
+
export {
|
|
190
|
+
PunicaCodeBlock
|
|
191
|
+
};
|