@punica/components 0.0.0-stage → 2.1.1
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 +48 -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 +8903 -0
- package/dist/llms.txt +288 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6762 -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 +135 -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,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Overlay
|
|
3
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
4
|
+
import {
|
|
5
|
+
nextIndex
|
|
6
|
+
} from "./chunk-4RURT4SK.js";
|
|
7
|
+
|
|
8
|
+
// src/components/select/field.js
|
|
9
|
+
function fieldLanguage(el) {
|
|
10
|
+
const fallback = typeof navigator !== "undefined" ? navigator.language : "en";
|
|
11
|
+
const wanted = el.locale || el.closest("[lang]")?.lang || fallback;
|
|
12
|
+
try {
|
|
13
|
+
return Intl.getCanonicalLocales(wanted)[0] || fallback;
|
|
14
|
+
} catch {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function fieldName(el) {
|
|
19
|
+
if (el.label) return el.label;
|
|
20
|
+
const text = [...el.labels || []].map((l) => l.textContent.trim()).filter(Boolean).join(" ");
|
|
21
|
+
return text || null;
|
|
22
|
+
}
|
|
23
|
+
function setAttr(node, name, value) {
|
|
24
|
+
if (value == null || value === false) node.removeAttribute(name);
|
|
25
|
+
else node.setAttribute(name, value === true ? "" : String(value));
|
|
26
|
+
}
|
|
27
|
+
var FieldSurface = class {
|
|
28
|
+
#host;
|
|
29
|
+
#overlay;
|
|
30
|
+
/** @type {AbortController | null} */
|
|
31
|
+
#abort = null;
|
|
32
|
+
/**
|
|
33
|
+
* @param {HTMLElement} host the component; a press inside it is not outside
|
|
34
|
+
* @param {HTMLElement} panel the popover element in the host's shadow root
|
|
35
|
+
*/
|
|
36
|
+
constructor(host, panel) {
|
|
37
|
+
this.#host = host;
|
|
38
|
+
this.#overlay = new Overlay(panel);
|
|
39
|
+
}
|
|
40
|
+
get open() {
|
|
41
|
+
return this.#abort !== null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @param {Element} anchor
|
|
45
|
+
* @param {import('../../core/overlay.js').OverlayOptions} options
|
|
46
|
+
* @param {() => void} onOutside
|
|
47
|
+
*/
|
|
48
|
+
show(anchor, options, onOutside) {
|
|
49
|
+
this.#overlay.show(anchor, options);
|
|
50
|
+
if (this.#abort) return;
|
|
51
|
+
this.#abort = new AbortController();
|
|
52
|
+
document.addEventListener(
|
|
53
|
+
"pointerdown",
|
|
54
|
+
(event) => {
|
|
55
|
+
if (!event.composedPath().includes(this.#host)) onOutside();
|
|
56
|
+
},
|
|
57
|
+
{ capture: true, signal: this.#abort.signal }
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
hide() {
|
|
61
|
+
if (!this.#abort) return;
|
|
62
|
+
this.#abort.abort();
|
|
63
|
+
this.#abort = null;
|
|
64
|
+
this.#overlay.hide();
|
|
65
|
+
}
|
|
66
|
+
reposition() {
|
|
67
|
+
this.#overlay.reposition();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var OptionNavigator = class {
|
|
71
|
+
#combobox;
|
|
72
|
+
#getOptions;
|
|
73
|
+
/** @type {any} */
|
|
74
|
+
#active = null;
|
|
75
|
+
/**
|
|
76
|
+
* @param {HTMLElement} combobox the element that keeps focus
|
|
77
|
+
* @param {() => any[]} getOptions every option, in order
|
|
78
|
+
*/
|
|
79
|
+
constructor(combobox, getOptions) {
|
|
80
|
+
this.#combobox = combobox;
|
|
81
|
+
this.#getOptions = getOptions;
|
|
82
|
+
}
|
|
83
|
+
/** Options a key can land on. */
|
|
84
|
+
get items() {
|
|
85
|
+
return this.#getOptions().filter((o) => !o.hidden && !o.disabled);
|
|
86
|
+
}
|
|
87
|
+
get active() {
|
|
88
|
+
return this.#active && this.#active.isConnected && !this.#active.hidden ? this.#active : null;
|
|
89
|
+
}
|
|
90
|
+
/** @param {any} option the row to highlight, or null for none */
|
|
91
|
+
set(option) {
|
|
92
|
+
if (this.#active && this.#active !== option) this.#active.active = false;
|
|
93
|
+
this.#active = option || null;
|
|
94
|
+
if ("ariaActiveDescendantElement" in this.#combobox) {
|
|
95
|
+
this.#combobox.ariaActiveDescendantElement = this.#active;
|
|
96
|
+
}
|
|
97
|
+
if (!this.#active) {
|
|
98
|
+
this.#combobox.removeAttribute("aria-activedescendant");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.#active.active = true;
|
|
102
|
+
this.#active.scrollIntoView?.({ block: "nearest" });
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Moves for ArrowDown, ArrowUp, Home, End, PageDown and PageUp.
|
|
106
|
+
* @param {KeyboardEvent} event
|
|
107
|
+
* @param {{ homeEnd?: boolean }} [options] an editable combobox keeps Home and End for its text
|
|
108
|
+
* @returns {boolean} whether the key was one of them
|
|
109
|
+
*/
|
|
110
|
+
move(event, { homeEnd = true } = {}) {
|
|
111
|
+
const items = this.items;
|
|
112
|
+
const current = items.indexOf(this.active);
|
|
113
|
+
let index = -1;
|
|
114
|
+
if (event.key === "PageDown") index = Math.min(items.length - 1, Math.max(current, 0) + 10);
|
|
115
|
+
else if (event.key === "PageUp") index = Math.max(0, current - 10);
|
|
116
|
+
else if (!homeEnd && (event.key === "Home" || event.key === "End")) return false;
|
|
117
|
+
else index = nextIndex(event, items.length, current, { orientation: "vertical", loop: false });
|
|
118
|
+
if (index < 0) return ["ArrowDown", "ArrowUp", "PageDown", "PageUp"].includes(event.key) || homeEnd && ["Home", "End"].includes(event.key);
|
|
119
|
+
this.set(items[index]);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
function nativeMessage(kind, { type = "date", value = "", limit = "" } = {}) {
|
|
124
|
+
if (kind === "choose") {
|
|
125
|
+
const select = document.createElement("select");
|
|
126
|
+
select.required = true;
|
|
127
|
+
select.append(document.createElement("option"));
|
|
128
|
+
return select.validationMessage || " ";
|
|
129
|
+
}
|
|
130
|
+
const probe = document.createElement("input");
|
|
131
|
+
if (kind === "required") {
|
|
132
|
+
probe.required = true;
|
|
133
|
+
} else if (kind === "format") {
|
|
134
|
+
probe.pattern = "0";
|
|
135
|
+
probe.value = "1";
|
|
136
|
+
} else {
|
|
137
|
+
probe.type = type;
|
|
138
|
+
probe[kind] = limit;
|
|
139
|
+
probe.value = value;
|
|
140
|
+
}
|
|
141
|
+
return probe.validationMessage || " ";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
fieldLanguage,
|
|
146
|
+
fieldName,
|
|
147
|
+
setAttr,
|
|
148
|
+
FieldSurface,
|
|
149
|
+
OptionNavigator,
|
|
150
|
+
nativeMessage
|
|
151
|
+
};
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import {
|
|
2
|
+
field_default
|
|
3
|
+
} from "./chunk-LSDTMST7.js";
|
|
4
|
+
import {
|
|
5
|
+
FieldSurface,
|
|
6
|
+
OptionNavigator,
|
|
7
|
+
fieldLanguage,
|
|
8
|
+
fieldName,
|
|
9
|
+
nativeMessage,
|
|
10
|
+
setAttr
|
|
11
|
+
} from "./chunk-H4Q2HHZA.js";
|
|
12
|
+
import {
|
|
13
|
+
FormControl
|
|
14
|
+
} from "./chunk-HW2CN2JV.js";
|
|
15
|
+
import {
|
|
16
|
+
overlayCss
|
|
17
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
18
|
+
import {
|
|
19
|
+
createTypeahead
|
|
20
|
+
} from "./chunk-4RURT4SK.js";
|
|
21
|
+
import {
|
|
22
|
+
icons
|
|
23
|
+
} from "./chunk-YSGWORUD.js";
|
|
24
|
+
import {
|
|
25
|
+
PunicaElement,
|
|
26
|
+
define
|
|
27
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
28
|
+
|
|
29
|
+
// src/components/select/select.css
|
|
30
|
+
var select_default = "/* audit-allow: pointer-without-focus-visible (focus is shown on the field box by field.css) */\n:host {\n --punica-select-radius: var(--punica-radius);\n --punica-select-height: var(--punica-size-md);\n --punica-select-padding: var(--punica-space-16);\n --punica-select-border-color: var(--punica-color-border);\n --punica-select-background: transparent;\n --punica-select-min-width: 200px;\n --punica-select-listbox-max-height: 250px;\n\n --_height: var(--punica-select-height);\n --_pad: var(--punica-select-padding);\n --_radius: var(--punica-select-radius);\n --_border: var(--punica-select-border-color);\n --_bg: var(--punica-select-background);\n --_list-max-height: var(--punica-select-listbox-max-height);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-select-min-width);\n}\n\n:host([size='small']) {\n --punica-select-height: var(--punica-size-sm);\n --punica-select-padding: var(--punica-space-12);\n}\n:host([size='large']) {\n --punica-select-height: var(--punica-size-lg);\n --punica-select-padding: var(--punica-space-28);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n[part='trigger'] {\n gap: var(--punica-space-8);\n cursor: pointer;\n outline: none;\n}\n[part='trigger']:disabled {\n cursor: default;\n}\n\n.value {\n flex: 1 1 auto;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.caret {\n flex: none;\n display: inline-flex;\n font-size: var(--punica-font-size);\n color: var(--punica-color-text-muted);\n transition: rotate var(--punica-duration) var(--punica-ease);\n}\n:host(:state(open)) .caret {\n rotate: 180deg;\n}\n";
|
|
31
|
+
|
|
32
|
+
// src/components/select/select.js
|
|
33
|
+
var valueOf = (option) => option.optionValue ?? option.getAttribute("value") ?? option.textContent.trim();
|
|
34
|
+
var textOf = (option) => option.text ?? option.getAttribute("label") ?? option.textContent.trim();
|
|
35
|
+
var PunicaSelect = class extends FormControl(PunicaElement) {
|
|
36
|
+
static properties = {
|
|
37
|
+
defaultValue: { attribute: "value", reflect: false },
|
|
38
|
+
value: { type: Object, attribute: false },
|
|
39
|
+
multiple: { type: Boolean },
|
|
40
|
+
placeholder: {},
|
|
41
|
+
clearable: { type: Boolean },
|
|
42
|
+
label: {},
|
|
43
|
+
open: { type: Boolean },
|
|
44
|
+
size: {},
|
|
45
|
+
fullWidth: { type: Boolean },
|
|
46
|
+
labelClear: { default: "Clear" }
|
|
47
|
+
};
|
|
48
|
+
static styles = [overlayCss, field_default, select_default];
|
|
49
|
+
static shadowOptions = { delegatesFocus: true };
|
|
50
|
+
static template = `
|
|
51
|
+
<div part="field" class="field">
|
|
52
|
+
<slot name="start"></slot>
|
|
53
|
+
<button part="trigger" class="control" type="button" role="combobox" aria-haspopup="listbox" aria-controls="listbox" aria-expanded="false">
|
|
54
|
+
<span part="value" class="value"></span>
|
|
55
|
+
<span part="caret" class="caret">${icons.chevronDown}</span>
|
|
56
|
+
</button>
|
|
57
|
+
<button part="clear" class="icon-button clear" type="button" hidden>${icons.close}</button>
|
|
58
|
+
</div>
|
|
59
|
+
<div part="listbox" id="listbox" class="panel listbox" role="listbox" popover="manual"><slot></slot></div>
|
|
60
|
+
`;
|
|
61
|
+
#field = this.$(".field");
|
|
62
|
+
#trigger = this.$('[part="trigger"]');
|
|
63
|
+
#valueEl = this.$('[part="value"]');
|
|
64
|
+
#clear = this.$('[part="clear"]');
|
|
65
|
+
#listbox = this.$("#listbox");
|
|
66
|
+
#slot = this.$("slot:not([name])");
|
|
67
|
+
#surface = new FieldSurface(this, this.#listbox);
|
|
68
|
+
#nav = new OptionNavigator(this.#trigger, () => this.options);
|
|
69
|
+
#typeahead = createTypeahead();
|
|
70
|
+
/** Options that carried `selected` when first seen: the markup's default. */
|
|
71
|
+
#defaults = /* @__PURE__ */ new WeakSet();
|
|
72
|
+
#seen = /* @__PURE__ */ new WeakSet();
|
|
73
|
+
#dirty = false;
|
|
74
|
+
#touched = false;
|
|
75
|
+
#initialised = false;
|
|
76
|
+
/** The default this element last applied itself, serialised. @type {string | null} */
|
|
77
|
+
#auto = null;
|
|
78
|
+
#reason = "api";
|
|
79
|
+
constructor() {
|
|
80
|
+
super();
|
|
81
|
+
this.#trigger.addEventListener("click", () => {
|
|
82
|
+
if (this.isDisabled) return;
|
|
83
|
+
if (this.open) this.#close("api");
|
|
84
|
+
else this.show();
|
|
85
|
+
});
|
|
86
|
+
this.#trigger.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
87
|
+
this.#trigger.addEventListener("keyup", (event) => {
|
|
88
|
+
if (event.key === " ") event.preventDefault();
|
|
89
|
+
});
|
|
90
|
+
this.#clear.addEventListener("click", () => {
|
|
91
|
+
if (this.isDisabled) return;
|
|
92
|
+
this.#commit([]);
|
|
93
|
+
this.#trigger.focus();
|
|
94
|
+
});
|
|
95
|
+
this.#slot.addEventListener("slotchange", () => this.#sync());
|
|
96
|
+
this.#listbox.addEventListener("mousedown", (event) => event.preventDefault());
|
|
97
|
+
this.#listbox.addEventListener("click", (event) => {
|
|
98
|
+
const option = this.#optionFrom(event);
|
|
99
|
+
if (option && !option.disabled) this.#pick(option);
|
|
100
|
+
});
|
|
101
|
+
this.#listbox.addEventListener("pointermove", (event) => {
|
|
102
|
+
const option = this.#optionFrom(event);
|
|
103
|
+
if (option && !option.disabled && option !== this.#nav.active) this.#nav.set(option);
|
|
104
|
+
});
|
|
105
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
106
|
+
const next = (
|
|
107
|
+
/** @type {FocusEvent} */
|
|
108
|
+
event.relatedTarget
|
|
109
|
+
);
|
|
110
|
+
if (next instanceof Node && (this.shadowRoot.contains(next) || this.contains(next))) return;
|
|
111
|
+
this.#touched = true;
|
|
112
|
+
if (this.open) this.#close("blur");
|
|
113
|
+
else this.requestUpdate();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** The `punica-option` children, in order. @returns {any[]} */
|
|
117
|
+
get options() {
|
|
118
|
+
return [...this.children].filter((child) => child.localName === "punica-option");
|
|
119
|
+
}
|
|
120
|
+
/** The picked options. @returns {any[]} */
|
|
121
|
+
get selectedOptions() {
|
|
122
|
+
const values = this.#values();
|
|
123
|
+
return this.options.filter((option) => values.includes(valueOf(option)));
|
|
124
|
+
}
|
|
125
|
+
/** Opens the list. */
|
|
126
|
+
show() {
|
|
127
|
+
this.open = true;
|
|
128
|
+
}
|
|
129
|
+
/** Closes the list. */
|
|
130
|
+
hide() {
|
|
131
|
+
this.#close("api");
|
|
132
|
+
}
|
|
133
|
+
/** Moves focus to the combobox. */
|
|
134
|
+
focus(options) {
|
|
135
|
+
this.#trigger.focus(options);
|
|
136
|
+
}
|
|
137
|
+
connected() {
|
|
138
|
+
queueMicrotask(() => this.isConnected && this.#sync());
|
|
139
|
+
}
|
|
140
|
+
disconnected() {
|
|
141
|
+
this.#surface.hide();
|
|
142
|
+
this.#nav.set(null);
|
|
143
|
+
}
|
|
144
|
+
formReset() {
|
|
145
|
+
this.#dirty = false;
|
|
146
|
+
this.#touched = false;
|
|
147
|
+
this.value = this.#defaultValue();
|
|
148
|
+
this.#auto = JSON.stringify(this.#values());
|
|
149
|
+
}
|
|
150
|
+
formRestore(state) {
|
|
151
|
+
if (state instanceof FormData) this.value = this.multiple ? state.getAll(this.name) : state.get(this.name);
|
|
152
|
+
else if (typeof state === "string") this.value = state;
|
|
153
|
+
}
|
|
154
|
+
/** @returns {string[]} */
|
|
155
|
+
#values() {
|
|
156
|
+
const value = this.value;
|
|
157
|
+
if (Array.isArray(value)) return value.map(String);
|
|
158
|
+
return value == null || value === "" ? [] : [String(value)];
|
|
159
|
+
}
|
|
160
|
+
#defaultValue() {
|
|
161
|
+
let values = [];
|
|
162
|
+
if (this.defaultValue != null) {
|
|
163
|
+
values = this.multiple ? this.defaultValue.split(/\s+/).filter(Boolean) : [this.defaultValue];
|
|
164
|
+
} else {
|
|
165
|
+
values = this.options.filter((o) => this.#defaults.has(o)).map(valueOf);
|
|
166
|
+
}
|
|
167
|
+
if (this.multiple) return values;
|
|
168
|
+
return values.length ? values[0] : null;
|
|
169
|
+
}
|
|
170
|
+
/** Takes in options that arrived and brings the tree up to date. */
|
|
171
|
+
#sync() {
|
|
172
|
+
this.#applyDefault();
|
|
173
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map());
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Applies the default value until the user, or code, sets another one.
|
|
177
|
+
*/
|
|
178
|
+
#applyDefault() {
|
|
179
|
+
for (const option of this.options) {
|
|
180
|
+
if (this.#seen.has(option)) continue;
|
|
181
|
+
this.#seen.add(option);
|
|
182
|
+
if (option.hasAttribute("selected")) this.#defaults.add(option);
|
|
183
|
+
}
|
|
184
|
+
this.#initialised = true;
|
|
185
|
+
if (this.#dirty) return;
|
|
186
|
+
const current = JSON.stringify(this.#values());
|
|
187
|
+
if (current !== (this.#auto ?? "[]")) {
|
|
188
|
+
this.#dirty = true;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this.value = this.#defaultValue();
|
|
192
|
+
this.#auto = JSON.stringify(this.#values());
|
|
193
|
+
}
|
|
194
|
+
update(changed) {
|
|
195
|
+
if (!this.#initialised || changed.has("defaultValue") || changed.has("multiple")) this.#applyDefault();
|
|
196
|
+
const options = this.options;
|
|
197
|
+
const values = this.#values();
|
|
198
|
+
const disabled = this.isDisabled;
|
|
199
|
+
const name = fieldName(this);
|
|
200
|
+
const known = new Map(options.map((option) => [valueOf(option), option]));
|
|
201
|
+
for (const option of options) option.selected = values.includes(valueOf(option));
|
|
202
|
+
const texts = values.map((value) => known.has(value) ? textOf(known.get(value)) : value);
|
|
203
|
+
const empty = texts.length === 0;
|
|
204
|
+
let text = this.placeholder || "";
|
|
205
|
+
if (!empty) {
|
|
206
|
+
text = texts.length === 1 ? texts[0] : new Intl.ListFormat(fieldLanguage(this), { style: "short", type: "unit" }).format(texts);
|
|
207
|
+
}
|
|
208
|
+
this.#valueEl.textContent = text;
|
|
209
|
+
this.#valueEl.classList.toggle("placeholder", empty);
|
|
210
|
+
this.toggleState("placeholder", empty);
|
|
211
|
+
this.toggleState("disabled", disabled);
|
|
212
|
+
const trigger = this.#trigger;
|
|
213
|
+
trigger.disabled = disabled;
|
|
214
|
+
setAttr(trigger, "aria-label", name);
|
|
215
|
+
setAttr(trigger, "aria-required", this.required ? "true" : null);
|
|
216
|
+
setAttr(this.#listbox, "aria-label", name);
|
|
217
|
+
setAttr(this.#listbox, "aria-multiselectable", this.multiple ? "true" : null);
|
|
218
|
+
setAttr(this.#clear, "aria-label", this.labelClear);
|
|
219
|
+
this.#clear.hidden = !this.clearable || empty || disabled;
|
|
220
|
+
if (this.multiple && this.name) {
|
|
221
|
+
const data = new FormData();
|
|
222
|
+
for (const value of values) data.append(this.name, value);
|
|
223
|
+
this.setFormValue(data);
|
|
224
|
+
} else {
|
|
225
|
+
this.setFormValue(empty ? null : values[0]);
|
|
226
|
+
}
|
|
227
|
+
const missing = this.required && empty;
|
|
228
|
+
this.setValidity(missing ? { valueMissing: true } : {}, nativeMessage("choose"), trigger);
|
|
229
|
+
setAttr(trigger, "aria-invalid", this.#touched && missing ? "true" : null);
|
|
230
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
231
|
+
const want = this.open && !disabled;
|
|
232
|
+
if (want && !this.#surface.open) {
|
|
233
|
+
this.#surface.show(this.#field, { matchWidth: true }, () => this.#close("outside"));
|
|
234
|
+
const first = options.find((o) => o.selected && !o.disabled) || this.#nav.items[0] || null;
|
|
235
|
+
if (!this.#nav.active) this.#nav.set(first);
|
|
236
|
+
this.toggleState("open", true);
|
|
237
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
238
|
+
this.emit("open");
|
|
239
|
+
} else if (!want && this.#surface.open) {
|
|
240
|
+
this.#surface.hide();
|
|
241
|
+
this.#nav.set(null);
|
|
242
|
+
this.toggleState("open", false);
|
|
243
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
244
|
+
const reason = this.#reason;
|
|
245
|
+
this.#reason = "api";
|
|
246
|
+
this.emit("close", { reason });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
#optionFrom(event) {
|
|
250
|
+
return event.composedPath().find((node) => node.localName === "punica-option" && node.parentElement === this) || null;
|
|
251
|
+
}
|
|
252
|
+
/** @param {string} reason */
|
|
253
|
+
#close(reason) {
|
|
254
|
+
if (!this.open) return;
|
|
255
|
+
this.#reason = reason;
|
|
256
|
+
this.open = false;
|
|
257
|
+
}
|
|
258
|
+
/** @param {string[]} values */
|
|
259
|
+
#commit(values) {
|
|
260
|
+
const before = this.#values();
|
|
261
|
+
if (before.length === values.length && before.every((v, i) => v === values[i])) return;
|
|
262
|
+
this.#dirty = true;
|
|
263
|
+
this.#touched = true;
|
|
264
|
+
this.value = this.multiple ? values : values[0] ?? null;
|
|
265
|
+
this.emit("change", { value: this.value });
|
|
266
|
+
}
|
|
267
|
+
/** @param {any} option */
|
|
268
|
+
#pick(option) {
|
|
269
|
+
const value = valueOf(option);
|
|
270
|
+
if (this.multiple) {
|
|
271
|
+
const values = this.#values();
|
|
272
|
+
const next = values.includes(value) ? values.filter((v) => v !== value) : [...values, value];
|
|
273
|
+
const order = this.options.map(valueOf);
|
|
274
|
+
next.sort((a, b) => order.indexOf(a) - order.indexOf(b));
|
|
275
|
+
this.#commit(next);
|
|
276
|
+
this.#nav.set(option);
|
|
277
|
+
} else {
|
|
278
|
+
this.#commit([value]);
|
|
279
|
+
this.#close("select");
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/** @param {KeyboardEvent} event */
|
|
283
|
+
#onKeydown(event) {
|
|
284
|
+
if (this.isDisabled) return;
|
|
285
|
+
const nav = this.#nav;
|
|
286
|
+
const key = event.key;
|
|
287
|
+
if (!this.open) {
|
|
288
|
+
if (["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End"].includes(key)) {
|
|
289
|
+
event.preventDefault();
|
|
290
|
+
if (key === "Home") nav.set(nav.items[0] || null);
|
|
291
|
+
if (key === "End") nav.set(nav.items.at(-1) || null);
|
|
292
|
+
this.show();
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const index = this.#typeahead(event, nav.items.map(textOf), -1);
|
|
296
|
+
if (index >= 0) {
|
|
297
|
+
event.preventDefault();
|
|
298
|
+
nav.set(nav.items[index]);
|
|
299
|
+
this.show();
|
|
300
|
+
}
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
if (key === "Escape") {
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
event.stopPropagation();
|
|
306
|
+
this.#close("escape");
|
|
307
|
+
} else if (key === "Tab") {
|
|
308
|
+
if (nav.active && !this.multiple) this.#pick(nav.active);
|
|
309
|
+
else this.#close("blur");
|
|
310
|
+
} else if (key === "Enter" || key === " " || key === "ArrowUp" && event.altKey) {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
if (nav.active) this.#pick(nav.active);
|
|
313
|
+
if (key === "ArrowUp") this.#close("select");
|
|
314
|
+
} else if (nav.move(event)) {
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
} else {
|
|
317
|
+
const items = nav.items;
|
|
318
|
+
const index = this.#typeahead(event, items.map(textOf), items.indexOf(nav.active));
|
|
319
|
+
if (index >= 0) {
|
|
320
|
+
event.preventDefault();
|
|
321
|
+
nav.set(items[index]);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
define("punica-select", PunicaSelect);
|
|
327
|
+
|
|
328
|
+
export {
|
|
329
|
+
PunicaSelect
|
|
330
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/table/tableRow.css
|
|
7
|
+
var tableRow_default = ":host {\n display: table-row;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:nth-child(even)) {\n background: var(--_stripe, transparent);\n}\n:host([selected]) {\n background: var(--punica-table-selected-background, var(--punica-color-selected));\n}\n\n.select {\n display: table-cell;\n inline-size: var(--punica-space-16);\n padding: var(--punica-table-cell-padding, var(--punica-space-12) var(--punica-space-16));\n padding-inline-end: 0;\n border-block-end: var(--punica-border-width) solid var(--punica-table-border-color, var(--punica-color-border));\n vertical-align: middle;\n}\n:host(:state(header)) .select {\n position: var(--_sticky, static);\n inset-block-start: 0;\n z-index: 1;\n background: var(--punica-table-header-background, var(--punica-color-surface));\n}\n\ninput {\n display: block;\n inline-size: var(--punica-space-16);\n block-size: var(--punica-space-16);\n margin: 0;\n accent-color: var(--punica-color-primary);\n cursor: pointer;\n}\ninput:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n[hidden] {\n display: none !important;\n}\n\n@media (forced-colors: active) {\n :host([selected]) {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(-1 * var(--punica-border-width));\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/table/tableRow.js
|
|
10
|
+
var PunicaTableRow = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
selected: { type: Boolean },
|
|
14
|
+
label: {}
|
|
15
|
+
};
|
|
16
|
+
static styles = tableRow_default;
|
|
17
|
+
static template = `
|
|
18
|
+
<div part="select-cell" class="select" role="cell" hidden><input part="checkbox" type="checkbox" /></div>
|
|
19
|
+
<slot></slot>
|
|
20
|
+
`;
|
|
21
|
+
#cell = this.$(".select");
|
|
22
|
+
#input = this.$("input");
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.internals.role = "row";
|
|
26
|
+
this.#input.addEventListener("change", () => {
|
|
27
|
+
const table = this.#table;
|
|
28
|
+
const checked = this.#input.checked;
|
|
29
|
+
if (table?.userSelect) table.userSelect(this.#section === "header" ? null : this, checked);
|
|
30
|
+
else this.selected = checked;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** @returns {any} */
|
|
34
|
+
get #table() {
|
|
35
|
+
return this.closest("punica-table");
|
|
36
|
+
}
|
|
37
|
+
/** @returns {'header' | 'body' | 'footer'} */
|
|
38
|
+
get #section() {
|
|
39
|
+
const name = this.parentElement?.localName;
|
|
40
|
+
if (name === "punica-table-header") return "header";
|
|
41
|
+
if (name === "punica-table-footer") return "footer";
|
|
42
|
+
return "body";
|
|
43
|
+
}
|
|
44
|
+
update(changed) {
|
|
45
|
+
const table = this.#table;
|
|
46
|
+
const mode = table?.selectable;
|
|
47
|
+
const on = mode === "single" || mode === "multiple";
|
|
48
|
+
const section = this.#section;
|
|
49
|
+
const input = this.#input;
|
|
50
|
+
this.toggleState("header", section === "header");
|
|
51
|
+
this.#cell.hidden = !on;
|
|
52
|
+
const all = section === "header" && mode === "multiple";
|
|
53
|
+
this.#cell.setAttribute("role", all ? "columnheader" : "cell");
|
|
54
|
+
input.hidden = !(section === "body" || all);
|
|
55
|
+
if (all) {
|
|
56
|
+
const rows = table.rows;
|
|
57
|
+
const count = rows.filter((row) => row.selected).length;
|
|
58
|
+
input.checked = rows.length > 0 && count === rows.length;
|
|
59
|
+
input.indeterminate = count > 0 && count < rows.length;
|
|
60
|
+
input.setAttribute("aria-label", table.labelSelectAll);
|
|
61
|
+
} else {
|
|
62
|
+
input.checked = this.selected;
|
|
63
|
+
input.indeterminate = false;
|
|
64
|
+
input.setAttribute("aria-label", this.label || table?.labelSelectRow || "");
|
|
65
|
+
}
|
|
66
|
+
this.internals.ariaSelected = on && section === "body" ? String(this.selected) : null;
|
|
67
|
+
if (changed.has("selected") && section === "body") table?.refresh?.();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
define("punica-table-row", PunicaTableRow);
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
PunicaTableRow
|
|
74
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
slotHasContent
|
|
3
|
+
} from "./chunk-XWZPKK2I.js";
|
|
4
|
+
import {
|
|
5
|
+
icons
|
|
6
|
+
} from "./chunk-YSGWORUD.js";
|
|
7
|
+
import {
|
|
8
|
+
PunicaElement,
|
|
9
|
+
define
|
|
10
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
11
|
+
|
|
12
|
+
// src/components/chat/chatToolCall.css
|
|
13
|
+
var chatToolCall_default = ":host {\n --punica-chat-tool-call-background: var(--punica-color-surface);\n --punica-chat-tool-call-border-color: var(--punica-color-border);\n --punica-chat-tool-call-radius: var(--punica-radius);\n\n display: block;\n font-family: var(--punica-font-family);\n color: var(--punica-color-text);\n}\n\n.base {\n border: var(--punica-border-width) solid var(--punica-chat-tool-call-border-color);\n border-radius: var(--punica-chat-tool-call-radius);\n background: var(--punica-chat-tool-call-background);\n}\n\n.header {\n all: unset;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n inline-size: 100%;\n min-block-size: var(--punica-size-md);\n padding: var(--punica-space-6) var(--punica-space-10);\n border-radius: var(--punica-chat-tool-call-radius);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n cursor: pointer;\n}\n\n.header:hover {\n background: var(--punica-color-hover);\n}\n\n.header:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\n.chevron {\n display: inline-flex;\n flex: none;\n transition: rotate var(--punica-duration-fast) var(--punica-ease);\n}\n\n.chevron:dir(rtl) {\n scale: -1 1;\n}\n\n:host([open]) .chevron {\n rotate: 90deg;\n}\n\n:host([open]) .chevron:dir(rtl) {\n rotate: -90deg;\n}\n\n.name {\n flex: 0 1 auto;\n min-inline-size: 0;\n overflow: hidden;\n font-family: var(--punica-font-family-mono);\n font-weight: var(--punica-font-weight-semi-bold);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.status {\n display: inline-flex;\n flex: none;\n align-items: center;\n gap: var(--punica-space-4);\n margin-inline-start: auto;\n color: var(--punica-color-text-muted);\n}\n\n.glyph {\n display: none;\n}\n\n.status[data-status='pending'] .glyph-pending,\n.status[data-status='running'] .glyph-running,\n.status[data-status='success'] .glyph-success,\n.status[data-status='error'] .glyph-error {\n display: inline-flex;\n}\n\n.glyph-success {\n color: var(--punica-color-success);\n}\n\n.glyph-error {\n color: var(--punica-color-error);\n}\n\n.status[data-status='error'] {\n color: var(--punica-color-error);\n}\n\n.spinner {\n inline-size: 1em;\n block-size: 1em;\n border: 2px solid currentColor;\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: spin 700ms linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 2s;\n }\n}\n\n.duration {\n flex: none;\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.duration:empty {\n display: none;\n}\n\n.panel {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-10);\n padding: var(--punica-space-10);\n border-block-start: var(--punica-border-width) solid var(--punica-chat-tool-call-border-color);\n}\n\n.panel[hidden],\n.section[hidden] {\n display: none;\n}\n\n.section {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-4);\n min-inline-size: 0;\n}\n\n.section-label {\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-xs);\n font-weight: var(--punica-font-weight-semi-bold);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n\n::slotted(pre) {\n margin: 0;\n padding: var(--punica-space-8);\n overflow: auto;\n border-radius: var(--punica-radius-sm);\n background: var(--punica-color-neutral-light);\n font-family: var(--punica-font-family-mono);\n font-size: var(--punica-font-size-sm);\n}\n\n@media (forced-colors: active) {\n .base {\n border-color: CanvasText;\n }\n .status,\n .glyph-success,\n .glyph-error {\n color: CanvasText;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/chat/chatToolCall.js
|
|
16
|
+
var PunicaChatToolCall = class extends PunicaElement {
|
|
17
|
+
static properties = {
|
|
18
|
+
name: {},
|
|
19
|
+
status: { default: "pending" },
|
|
20
|
+
duration: { type: Number },
|
|
21
|
+
open: { type: Boolean },
|
|
22
|
+
labelPending: { default: "Pending" },
|
|
23
|
+
labelRunning: { default: "Running" },
|
|
24
|
+
labelSuccess: { default: "Done" },
|
|
25
|
+
labelError: { default: "Failed" },
|
|
26
|
+
labelInput: { default: "Input" },
|
|
27
|
+
labelOutput: { default: "Output" }
|
|
28
|
+
};
|
|
29
|
+
static styles = chatToolCall_default;
|
|
30
|
+
static shadowOptions = { delegatesFocus: true };
|
|
31
|
+
static template = `
|
|
32
|
+
<div part="base" class="base">
|
|
33
|
+
<button part="header" class="header" type="button" aria-expanded="false" aria-controls="panel">
|
|
34
|
+
<span class="chevron">${icons.chevronEnd}</span>
|
|
35
|
+
<span part="name" class="name"></span>
|
|
36
|
+
<span part="status" class="status">
|
|
37
|
+
<span class="glyph glyph-pending">${icons.clock}</span>
|
|
38
|
+
<span class="glyph glyph-running"><span class="spinner" aria-hidden="true"></span></span>
|
|
39
|
+
<span class="glyph glyph-success">${icons.success}</span>
|
|
40
|
+
<span class="glyph glyph-error">${icons.error}</span>
|
|
41
|
+
<span part="status-text" class="status-text"></span>
|
|
42
|
+
</span>
|
|
43
|
+
<span part="duration" class="duration"></span>
|
|
44
|
+
</button>
|
|
45
|
+
<div part="panel" class="panel" id="panel" role="group" hidden>
|
|
46
|
+
<div part="section" class="section" data-slot="input" hidden>
|
|
47
|
+
<div part="section-label" class="section-label"></div>
|
|
48
|
+
<slot name="input"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
<div part="section" class="section" data-slot="output" hidden>
|
|
51
|
+
<div part="section-label" class="section-label"></div>
|
|
52
|
+
<slot name="output"></slot>
|
|
53
|
+
</div>
|
|
54
|
+
<slot></slot>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
constructor() {
|
|
59
|
+
super();
|
|
60
|
+
this.$(".header").addEventListener("click", () => {
|
|
61
|
+
this.open = !this.open;
|
|
62
|
+
this.emit("toggle", { open: this.open });
|
|
63
|
+
});
|
|
64
|
+
for (const section of this.shadowRoot.querySelectorAll(".section")) {
|
|
65
|
+
const slot = section.querySelector("slot");
|
|
66
|
+
slot.addEventListener("slotchange", () => {
|
|
67
|
+
section.hidden = !slotHasContent(slot);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
update() {
|
|
72
|
+
const labels = {
|
|
73
|
+
pending: this.labelPending,
|
|
74
|
+
running: this.labelRunning,
|
|
75
|
+
success: this.labelSuccess,
|
|
76
|
+
error: this.labelError
|
|
77
|
+
};
|
|
78
|
+
const status = Object.hasOwn(labels, this.status) ? this.status : "pending";
|
|
79
|
+
this.$(".status").dataset.status = status;
|
|
80
|
+
this.$(".status-text").textContent = labels[status];
|
|
81
|
+
this.$(".name").textContent = this.name || "";
|
|
82
|
+
this.$(".duration").textContent = this.#formatDuration();
|
|
83
|
+
this.$(".header").setAttribute("aria-expanded", String(this.open));
|
|
84
|
+
const panel = this.$(".panel");
|
|
85
|
+
panel.hidden = !this.open;
|
|
86
|
+
if (this.name) panel.setAttribute("aria-label", this.name);
|
|
87
|
+
else panel.removeAttribute("aria-label");
|
|
88
|
+
this.$('[data-slot="input"] .section-label').textContent = this.labelInput;
|
|
89
|
+
this.$('[data-slot="output"] .section-label').textContent = this.labelOutput;
|
|
90
|
+
}
|
|
91
|
+
#formatDuration() {
|
|
92
|
+
const ms = this.duration;
|
|
93
|
+
if (ms == null || ms < 0) return "";
|
|
94
|
+
const seconds = ms >= 1e3;
|
|
95
|
+
const lang = this.closest("[lang]")?.lang || navigator.language;
|
|
96
|
+
const options = {
|
|
97
|
+
style: "unit",
|
|
98
|
+
unit: seconds ? "second" : "millisecond",
|
|
99
|
+
unitDisplay: "narrow",
|
|
100
|
+
maximumFractionDigits: seconds ? 1 : 0
|
|
101
|
+
};
|
|
102
|
+
const amount = seconds ? ms / 1e3 : ms;
|
|
103
|
+
try {
|
|
104
|
+
return new Intl.NumberFormat(lang, options).format(amount);
|
|
105
|
+
} catch {
|
|
106
|
+
return new Intl.NumberFormat(void 0, options).format(amount);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
define("punica-chat-tool-call", PunicaChatToolCall);
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
PunicaChatToolCall
|
|
114
|
+
};
|