@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,408 @@
|
|
|
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
|
+
isRtl
|
|
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/tokenizer/tokenizer.css
|
|
30
|
+
var tokenizer_default = ":host {\n --punica-tokenizer-radius: var(--punica-radius);\n --punica-tokenizer-height: var(--punica-size-md);\n --punica-tokenizer-padding: var(--punica-space-8);\n --punica-tokenizer-border-color: var(--punica-color-border);\n --punica-tokenizer-background: transparent;\n --punica-tokenizer-min-width: 240px;\n --punica-tokenizer-token-background: var(--punica-color-neutral-light);\n --punica-tokenizer-token-radius: var(--punica-radius-full);\n --punica-tokenizer-listbox-max-height: 250px;\n\n --_height: var(--punica-tokenizer-height);\n --_pad: var(--punica-tokenizer-padding);\n --_radius: var(--punica-tokenizer-radius);\n --_border: var(--punica-tokenizer-border-color);\n --_bg: var(--punica-tokenizer-background);\n --_list-max-height: var(--punica-tokenizer-listbox-max-height);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-tokenizer-min-width);\n}\n\n:host([size='small']) {\n --punica-tokenizer-height: var(--punica-size-sm);\n}\n:host([size='large']) {\n --punica-tokenizer-height: var(--punica-size-lg);\n --punica-tokenizer-padding: var(--punica-space-12);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.field {\n flex-wrap: wrap;\n gap: var(--punica-space-4);\n padding-block: var(--punica-space-4);\n cursor: text;\n}\n\n.tokens {\n display: contents;\n}\n\n/* A small field stays 28px tall with a token in it: a smaller token, less padding. */\n:host([size='small']) .field {\n padding-block: var(--punica-space-2);\n}\n:host([size='small']) .token,\n:host([size='small']) input.control {\n min-block-size: var(--punica-space-20);\n}\n\n.token {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-4);\n max-inline-size: 100%;\n padding-inline: var(--punica-space-8) var(--punica-space-4);\n min-block-size: var(--punica-space-24);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-tokenizer-token-radius);\n background: var(--punica-tokenizer-token-background);\n color: var(--punica-color-text);\n font-size: var(--punica-font-size-xs);\n cursor: default;\n user-select: none;\n}\n\n.token:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.token-label {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.remove {\n all: unset;\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-16);\n block-size: var(--punica-space-16);\n border-radius: var(--punica-radius-full);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n.remove:hover {\n background: var(--punica-color-hover);\n}\n.remove:focus-visible {\n outline: var(--punica-focus-ring);\n}\n.remove:disabled {\n display: none;\n}\n\ninput.control {\n flex: 1 1 var(--punica-space-80);\n min-block-size: var(--punica-space-24);\n}\n\n@media (forced-colors: active) {\n .token {\n border-color: CanvasText;\n }\n}\n";
|
|
31
|
+
|
|
32
|
+
// src/components/tokenizer/tokenizer.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 PunicaTokenizer = class extends FormControl(PunicaElement) {
|
|
36
|
+
static properties = {
|
|
37
|
+
value: { type: Array, reflect: false, default: Object.freeze([]) },
|
|
38
|
+
separator: { default: "," },
|
|
39
|
+
placeholder: {},
|
|
40
|
+
label: {},
|
|
41
|
+
open: { type: Boolean },
|
|
42
|
+
readonly: { type: Boolean },
|
|
43
|
+
size: {},
|
|
44
|
+
fullWidth: { type: Boolean },
|
|
45
|
+
labelRemove: { default: "Remove" }
|
|
46
|
+
};
|
|
47
|
+
static styles = [overlayCss, field_default, tokenizer_default];
|
|
48
|
+
static shadowOptions = { delegatesFocus: true };
|
|
49
|
+
static template = `
|
|
50
|
+
<div part="field" class="field">
|
|
51
|
+
<slot name="start"></slot>
|
|
52
|
+
<div part="tokens" class="tokens" role="list" hidden></div>
|
|
53
|
+
<input part="input" class="control" type="text" autocomplete="off" autocapitalize="off" spellcheck="false">
|
|
54
|
+
</div>
|
|
55
|
+
<div part="listbox" id="listbox" class="panel listbox" role="listbox" popover="manual"><slot></slot></div>
|
|
56
|
+
<template id="token">
|
|
57
|
+
<span part="token" class="token" role="listitem" tabindex="-1">
|
|
58
|
+
<span part="token-label" class="token-label"></span>
|
|
59
|
+
<button part="remove" class="remove" type="button" tabindex="-1">${icons.close}</button>
|
|
60
|
+
</span>
|
|
61
|
+
</template>
|
|
62
|
+
`;
|
|
63
|
+
#field = this.$(".field");
|
|
64
|
+
#tokens = this.$(".tokens");
|
|
65
|
+
#input = this.$("input");
|
|
66
|
+
#listbox = this.$("#listbox");
|
|
67
|
+
#slot = this.$("slot:not([name])");
|
|
68
|
+
#template = this.$("#token");
|
|
69
|
+
#surface = new FieldSurface(this, this.#listbox);
|
|
70
|
+
#nav = new OptionNavigator(this.#input, () => this.#rows());
|
|
71
|
+
/** What the tokens were last drawn from. @type {string | null} */
|
|
72
|
+
#drawn = null;
|
|
73
|
+
#touched = false;
|
|
74
|
+
#reason = "api";
|
|
75
|
+
constructor() {
|
|
76
|
+
super();
|
|
77
|
+
const input = this.#input;
|
|
78
|
+
input.addEventListener("input", () => {
|
|
79
|
+
if (this.isDisabled || this.readonly) return;
|
|
80
|
+
if (this.separator && input.value.includes(this.separator)) this.#addText(input.value);
|
|
81
|
+
this.#nav.set(null);
|
|
82
|
+
this.open = true;
|
|
83
|
+
this.update(/* @__PURE__ */ new Map());
|
|
84
|
+
this.emit("input", { value: input.value });
|
|
85
|
+
});
|
|
86
|
+
input.addEventListener("paste", (event) => {
|
|
87
|
+
const text = event.clipboardData?.getData("text") ?? "";
|
|
88
|
+
if (this.isDisabled || this.readonly || !/[\n\r\t]/.test(text) && !(this.separator && text.includes(this.separator))) return;
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
this.#addText(input.value + text);
|
|
91
|
+
});
|
|
92
|
+
input.addEventListener("keydown", (event) => this.#onInputKeydown(event));
|
|
93
|
+
this.#field.addEventListener("mousedown", (event) => {
|
|
94
|
+
if (event.target !== this.#field) return;
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
input.focus();
|
|
97
|
+
});
|
|
98
|
+
this.#tokens.addEventListener("keydown", (event) => this.#onTokenKeydown(event));
|
|
99
|
+
this.#tokens.addEventListener("focusin", () => {
|
|
100
|
+
if (!this.#walking) input.focus();
|
|
101
|
+
});
|
|
102
|
+
this.#tokens.addEventListener("click", (event) => {
|
|
103
|
+
const target = (
|
|
104
|
+
/** @type {Element} */
|
|
105
|
+
event.target
|
|
106
|
+
);
|
|
107
|
+
const token = (
|
|
108
|
+
/** @type {HTMLElement | null} */
|
|
109
|
+
target.closest(".token")
|
|
110
|
+
);
|
|
111
|
+
if (!token || this.isDisabled || this.readonly) return;
|
|
112
|
+
if (target.closest(".remove")) {
|
|
113
|
+
this.#remove(token.dataset.value);
|
|
114
|
+
input.focus();
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.#slot.addEventListener("slotchange", () => this.requestUpdate());
|
|
118
|
+
this.#listbox.addEventListener("mousedown", (event) => event.preventDefault());
|
|
119
|
+
this.#listbox.addEventListener("click", (event) => {
|
|
120
|
+
const option = this.#rowFrom(event);
|
|
121
|
+
if (option && !option.disabled) this.#pick(option);
|
|
122
|
+
});
|
|
123
|
+
this.#listbox.addEventListener("pointermove", (event) => {
|
|
124
|
+
const option = this.#rowFrom(event);
|
|
125
|
+
if (option && !option.disabled && option !== this.#nav.active) this.#nav.set(option);
|
|
126
|
+
});
|
|
127
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
128
|
+
const next = (
|
|
129
|
+
/** @type {FocusEvent} */
|
|
130
|
+
event.relatedTarget
|
|
131
|
+
);
|
|
132
|
+
if (next instanceof Node && (this.shadowRoot.contains(next) || this.contains(next))) return;
|
|
133
|
+
this.#touched = true;
|
|
134
|
+
if (!this.isDisabled && !this.readonly) this.#addText(input.value);
|
|
135
|
+
this.#close("blur");
|
|
136
|
+
this.requestUpdate();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** Opens the suggestions. */
|
|
140
|
+
show() {
|
|
141
|
+
this.open = true;
|
|
142
|
+
}
|
|
143
|
+
/** Closes the suggestions. */
|
|
144
|
+
hide() {
|
|
145
|
+
this.#close("api");
|
|
146
|
+
}
|
|
147
|
+
/** Moves focus to the text input. */
|
|
148
|
+
#walking = false;
|
|
149
|
+
/** Moves focus to a token (or the input) on purpose. */
|
|
150
|
+
#walkTo(target) {
|
|
151
|
+
this.#walking = true;
|
|
152
|
+
try {
|
|
153
|
+
target.focus();
|
|
154
|
+
} finally {
|
|
155
|
+
this.#walking = false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
focus(options) {
|
|
159
|
+
this.#input.focus(options);
|
|
160
|
+
}
|
|
161
|
+
connected() {
|
|
162
|
+
queueMicrotask(() => this.isConnected && this.update(/* @__PURE__ */ new Map()));
|
|
163
|
+
}
|
|
164
|
+
disconnected() {
|
|
165
|
+
this.#surface.hide();
|
|
166
|
+
this.#nav.set(null);
|
|
167
|
+
}
|
|
168
|
+
formReset() {
|
|
169
|
+
this.#touched = false;
|
|
170
|
+
this.#input.value = "";
|
|
171
|
+
let initial = [];
|
|
172
|
+
try {
|
|
173
|
+
initial = JSON.parse(this.getAttribute("value") || "[]");
|
|
174
|
+
} catch {
|
|
175
|
+
}
|
|
176
|
+
this.value = Array.isArray(initial) ? initial : [];
|
|
177
|
+
}
|
|
178
|
+
formRestore(state) {
|
|
179
|
+
if (state instanceof FormData) this.value = state.getAll(this.name).map(String);
|
|
180
|
+
}
|
|
181
|
+
/** @returns {string[]} */
|
|
182
|
+
#values() {
|
|
183
|
+
return Array.isArray(this.value) ? this.value.map(String) : [];
|
|
184
|
+
}
|
|
185
|
+
/** @returns {any[]} */
|
|
186
|
+
#rows() {
|
|
187
|
+
return [...this.children].filter((child) => child.localName === "punica-option");
|
|
188
|
+
}
|
|
189
|
+
#rowFrom(event) {
|
|
190
|
+
return event.composedPath().find((node) => node.localName === "punica-option" && node.parentElement === this) || null;
|
|
191
|
+
}
|
|
192
|
+
/** @returns {HTMLElement[]} */
|
|
193
|
+
#tokenElements() {
|
|
194
|
+
return (
|
|
195
|
+
/** @type {HTMLElement[]} */
|
|
196
|
+
[...this.#tokens.children]
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
update() {
|
|
200
|
+
const language = fieldLanguage(this);
|
|
201
|
+
const input = this.#input;
|
|
202
|
+
const disabled = this.isDisabled;
|
|
203
|
+
const locked = disabled || this.readonly;
|
|
204
|
+
const name = fieldName(this);
|
|
205
|
+
const values = this.#values();
|
|
206
|
+
const rows = this.#rows();
|
|
207
|
+
const labels = new Map(rows.map((row) => [valueOf(row), textOf(row)]));
|
|
208
|
+
setAttr(this.#tokens, "aria-disabled", disabled ? "true" : null);
|
|
209
|
+
const texts = values.map((value) => labels.get(value) ?? value);
|
|
210
|
+
const drawn = JSON.stringify([values, texts, this.labelRemove, locked]);
|
|
211
|
+
if (drawn !== this.#drawn) {
|
|
212
|
+
this.#drawn = drawn;
|
|
213
|
+
const focused = this.#tokenElements().indexOf(
|
|
214
|
+
/** @type {any} */
|
|
215
|
+
this.shadowRoot.activeElement
|
|
216
|
+
);
|
|
217
|
+
const tokens = values.map((value, i) => {
|
|
218
|
+
const token = (
|
|
219
|
+
/** @type {HTMLElement} */
|
|
220
|
+
this.#template.content.firstElementChild.cloneNode(true)
|
|
221
|
+
);
|
|
222
|
+
token.dataset.value = value;
|
|
223
|
+
token.querySelector(".token-label").textContent = texts[i];
|
|
224
|
+
const remove = token.querySelector("button");
|
|
225
|
+
remove.setAttribute("aria-label", `${this.labelRemove} ${texts[i]}`);
|
|
226
|
+
remove.disabled = locked;
|
|
227
|
+
return token;
|
|
228
|
+
});
|
|
229
|
+
this.#tokens.replaceChildren(...tokens);
|
|
230
|
+
this.#tokens.hidden = tokens.length === 0;
|
|
231
|
+
if (focused >= 0) this.#walkTo(tokens[Math.min(focused, tokens.length - 1)] || input);
|
|
232
|
+
}
|
|
233
|
+
const needle = input.value.trim().toLocaleLowerCase(language);
|
|
234
|
+
let visible = 0;
|
|
235
|
+
for (const row of rows) {
|
|
236
|
+
const taken = values.includes(valueOf(row));
|
|
237
|
+
const match = !taken && (!needle || textOf(row).toLocaleLowerCase(language).includes(needle));
|
|
238
|
+
row.hidden = !match;
|
|
239
|
+
if (match) visible++;
|
|
240
|
+
}
|
|
241
|
+
const suggests = rows.length > 0;
|
|
242
|
+
setAttr(input, "role", suggests ? "combobox" : null);
|
|
243
|
+
setAttr(input, "aria-autocomplete", suggests ? "list" : null);
|
|
244
|
+
setAttr(input, "aria-haspopup", suggests ? "listbox" : null);
|
|
245
|
+
setAttr(input, "aria-controls", suggests ? "listbox" : null);
|
|
246
|
+
input.disabled = disabled;
|
|
247
|
+
input.readOnly = this.readonly;
|
|
248
|
+
input.placeholder = values.length ? "" : this.placeholder || "";
|
|
249
|
+
setAttr(input, "aria-label", name);
|
|
250
|
+
setAttr(this.#tokens, "aria-label", name);
|
|
251
|
+
setAttr(this.#listbox, "aria-label", name);
|
|
252
|
+
this.toggleState("disabled", disabled);
|
|
253
|
+
if (this.name && values.length) {
|
|
254
|
+
const data = new FormData();
|
|
255
|
+
for (const value of values) data.append(this.name, value);
|
|
256
|
+
this.setFormValue(data);
|
|
257
|
+
} else {
|
|
258
|
+
this.setFormValue(null);
|
|
259
|
+
}
|
|
260
|
+
const missing = this.required && values.length === 0;
|
|
261
|
+
this.setValidity(missing ? { valueMissing: true } : {}, nativeMessage("required"), input);
|
|
262
|
+
setAttr(input, "aria-required", this.required ? "true" : null);
|
|
263
|
+
const invalid = this.#touched && !this.validity.valid;
|
|
264
|
+
setAttr(input, "aria-invalid", invalid ? "true" : null);
|
|
265
|
+
this.toggleState("user-invalid", invalid);
|
|
266
|
+
const want = this.open && !locked && visible > 0;
|
|
267
|
+
if (want && !this.#surface.open) {
|
|
268
|
+
this.#surface.show(this.#field, { matchWidth: true }, () => this.#close("outside"));
|
|
269
|
+
this.toggleState("open", true);
|
|
270
|
+
this.emit("open");
|
|
271
|
+
} else if (!want && this.#surface.open) {
|
|
272
|
+
this.#surface.hide();
|
|
273
|
+
this.#nav.set(null);
|
|
274
|
+
this.toggleState("open", false);
|
|
275
|
+
const reason = this.open ? "empty" : this.#reason;
|
|
276
|
+
this.#reason = "api";
|
|
277
|
+
this.emit("close", { reason });
|
|
278
|
+
}
|
|
279
|
+
setAttr(input, "aria-expanded", suggests ? String(this.#surface.open) : null);
|
|
280
|
+
if (this.#nav.active?.hidden) this.#nav.set(null);
|
|
281
|
+
}
|
|
282
|
+
/** @param {string} reason */
|
|
283
|
+
#close(reason) {
|
|
284
|
+
if (!this.open) return;
|
|
285
|
+
this.#reason = reason;
|
|
286
|
+
this.open = false;
|
|
287
|
+
}
|
|
288
|
+
/** @param {string[]} values */
|
|
289
|
+
#commit(values) {
|
|
290
|
+
this.#touched = true;
|
|
291
|
+
this.value = values;
|
|
292
|
+
this.update(/* @__PURE__ */ new Map());
|
|
293
|
+
this.emit("change", { value: values });
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Adds every token in a text, split at the separator and at line breaks.
|
|
297
|
+
* The input is emptied.
|
|
298
|
+
* @param {string} text
|
|
299
|
+
*/
|
|
300
|
+
#addText(text) {
|
|
301
|
+
const parts = text.split(/[\n\r\t]/).flatMap((line) => this.separator ? line.split(this.separator) : [line]).map((part) => part.trim()).filter(Boolean);
|
|
302
|
+
this.#input.value = "";
|
|
303
|
+
this.#add(parts);
|
|
304
|
+
}
|
|
305
|
+
/** @param {string[]} added */
|
|
306
|
+
#add(added) {
|
|
307
|
+
const values = this.#values();
|
|
308
|
+
const next = [...values];
|
|
309
|
+
for (const value of added) if (!next.includes(value)) next.push(value);
|
|
310
|
+
if (next.length !== values.length) this.#commit(next);
|
|
311
|
+
else this.requestUpdate();
|
|
312
|
+
}
|
|
313
|
+
/** @param {string | undefined} value */
|
|
314
|
+
#remove(value) {
|
|
315
|
+
const values = this.#values();
|
|
316
|
+
const next = values.filter((v) => v !== value);
|
|
317
|
+
if (next.length !== values.length) this.#commit(next);
|
|
318
|
+
}
|
|
319
|
+
/** @param {any} option */
|
|
320
|
+
#pick(option) {
|
|
321
|
+
this.#input.value = "";
|
|
322
|
+
this.#add([valueOf(option)]);
|
|
323
|
+
this.#nav.set(null);
|
|
324
|
+
this.update(/* @__PURE__ */ new Map());
|
|
325
|
+
}
|
|
326
|
+
/** @param {KeyboardEvent} event */
|
|
327
|
+
#onInputKeydown(event) {
|
|
328
|
+
if (this.isDisabled || this.readonly) return;
|
|
329
|
+
const input = this.#input;
|
|
330
|
+
const nav = this.#nav;
|
|
331
|
+
const showing = this.#surface.open;
|
|
332
|
+
const atStart = input.selectionStart === 0 && input.selectionEnd === 0;
|
|
333
|
+
const back = isRtl(this) ? "ArrowRight" : "ArrowLeft";
|
|
334
|
+
if (event.key === "Enter") {
|
|
335
|
+
if (showing && nav.active) {
|
|
336
|
+
event.preventDefault();
|
|
337
|
+
this.#pick(nav.active);
|
|
338
|
+
} else if (input.value.trim()) {
|
|
339
|
+
event.preventDefault();
|
|
340
|
+
this.#addText(input.value);
|
|
341
|
+
} else {
|
|
342
|
+
this.form?.requestSubmit();
|
|
343
|
+
}
|
|
344
|
+
} else if (this.separator && event.key === this.separator) {
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
this.#addText(input.value);
|
|
347
|
+
} else if (event.key === "Backspace" && atStart && !input.value) {
|
|
348
|
+
const last = this.#values().at(-1);
|
|
349
|
+
if (last !== void 0) {
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
this.#remove(last);
|
|
352
|
+
}
|
|
353
|
+
} else if (event.key === back && atStart) {
|
|
354
|
+
const last = this.#tokenElements().at(-1);
|
|
355
|
+
if (last) {
|
|
356
|
+
event.preventDefault();
|
|
357
|
+
this.#walkTo(last);
|
|
358
|
+
}
|
|
359
|
+
} else if (event.key === "Escape") {
|
|
360
|
+
if (!showing) return;
|
|
361
|
+
event.preventDefault();
|
|
362
|
+
event.stopPropagation();
|
|
363
|
+
this.#close("escape");
|
|
364
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
365
|
+
if (!this.#rows().length) return;
|
|
366
|
+
event.preventDefault();
|
|
367
|
+
if (!showing) {
|
|
368
|
+
this.open = true;
|
|
369
|
+
this.update(/* @__PURE__ */ new Map());
|
|
370
|
+
nav.set(event.key === "ArrowDown" ? nav.items[0] : nav.items.at(-1) || null);
|
|
371
|
+
} else {
|
|
372
|
+
nav.move(event, { homeEnd: false });
|
|
373
|
+
}
|
|
374
|
+
} else if (showing && nav.move(event, { homeEnd: false })) {
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/** @param {KeyboardEvent} event */
|
|
379
|
+
#onTokenKeydown(event) {
|
|
380
|
+
const tokens = this.#tokenElements();
|
|
381
|
+
const index = tokens.indexOf(
|
|
382
|
+
/** @type {any} */
|
|
383
|
+
this.shadowRoot.activeElement
|
|
384
|
+
);
|
|
385
|
+
if (index < 0) return;
|
|
386
|
+
const forward = isRtl(this) ? "ArrowLeft" : "ArrowRight";
|
|
387
|
+
const back = isRtl(this) ? "ArrowRight" : "ArrowLeft";
|
|
388
|
+
if (event.key === back) {
|
|
389
|
+
this.#walkTo(tokens[Math.max(0, index - 1)]);
|
|
390
|
+
} else if (event.key === forward) {
|
|
391
|
+
this.#walkTo(tokens[index + 1] || this.#input);
|
|
392
|
+
} else if (event.key === "Home") {
|
|
393
|
+
this.#walkTo(tokens[0]);
|
|
394
|
+
} else if (event.key === "End") {
|
|
395
|
+
this.#input.focus();
|
|
396
|
+
} else if ((event.key === "Backspace" || event.key === "Delete") && !this.isDisabled && !this.readonly) {
|
|
397
|
+
this.#remove(tokens[index].dataset.value);
|
|
398
|
+
} else {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
event.preventDefault();
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
define("punica-tokenizer", PunicaTokenizer);
|
|
405
|
+
|
|
406
|
+
export {
|
|
407
|
+
PunicaTokenizer
|
|
408
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/kbd/kbd.css
|
|
7
|
+
var kbd_default = ":host {\n --punica-kbd-background: var(--punica-color-neutral-light);\n --punica-kbd-border-color: var(--punica-color-border-strong);\n --punica-kbd-radius: var(--punica-radius-sm);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\nkbd {\n font: inherit;\n}\n\n[part='base'] {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-2);\n}\n\n.keys {\n display: contents;\n}\n\n.key {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: 1.5em;\n padding: var(--punica-space-2) var(--punica-space-4);\n border: var(--punica-border-width) solid var(--punica-kbd-border-color);\n border-block-end-width: var(--punica-space-2);\n border-radius: var(--punica-kbd-radius);\n background: var(--punica-kbd-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family-mono);\n font-size: var(--punica-font-size-xs);\n line-height: 1;\n white-space: nowrap;\n}\n\n.key[hidden] {\n display: none;\n}\n\n@media (forced-colors: active) {\n .key {\n border-color: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/kbd/kbd.js
|
|
10
|
+
var APPLE = /mac|iphone|ipad|ipod/i;
|
|
11
|
+
var PLUS = "\uE000";
|
|
12
|
+
var PunicaKbd = class extends PunicaElement {
|
|
13
|
+
static properties = {
|
|
14
|
+
keys: {},
|
|
15
|
+
labelMod: { default: "Ctrl" }
|
|
16
|
+
};
|
|
17
|
+
static styles = kbd_default;
|
|
18
|
+
static template = `<kbd part="base"><span class="keys"></span><kbd part="key" class="key own"><slot></slot></kbd></kbd>`;
|
|
19
|
+
#keys = this.$(".keys");
|
|
20
|
+
#own = this.$(".own");
|
|
21
|
+
#apple = false;
|
|
22
|
+
connected() {
|
|
23
|
+
const platform = (
|
|
24
|
+
/** @type {any} */
|
|
25
|
+
navigator.userAgentData?.platform || navigator.platform || ""
|
|
26
|
+
);
|
|
27
|
+
const apple = APPLE.test(platform);
|
|
28
|
+
if (apple !== this.#apple) {
|
|
29
|
+
this.#apple = apple;
|
|
30
|
+
this.requestUpdate();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
update() {
|
|
34
|
+
const names = (this.keys ?? "").replace(/\+\+$|^\+$/, `+${PLUS}`).split("+").map((key) => key === PLUS ? "+" : key.trim()).filter(Boolean);
|
|
35
|
+
this.#own.hidden = names.length > 0;
|
|
36
|
+
this.#keys.replaceChildren(
|
|
37
|
+
...names.map((name) => {
|
|
38
|
+
const key = document.createElement("kbd");
|
|
39
|
+
key.className = "key";
|
|
40
|
+
key.part.add("key");
|
|
41
|
+
key.textContent = name.toLowerCase() === "mod" ? this.#apple ? "\u2318" : this.labelMod : name;
|
|
42
|
+
return key;
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
define("punica-kbd", PunicaKbd);
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
PunicaKbd
|
|
51
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/toggleButton/toggleButton.css
|
|
10
|
+
var toggleButton_default = ":host {\n --_accent: var(--punica-color-primary);\n --_accent-strong: var(--punica-color-primary-dark);\n --punica-toggle-button-height: var(--punica-size-md);\n --punica-toggle-button-padding: var(--punica-space-16);\n --punica-toggle-button-radius: var(--punica-radius);\n --punica-toggle-button-border-color: var(--punica-color-border-strong);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n --_accent-strong: var(--punica-color-secondary-dark);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n --_accent-strong: var(--punica-color-error-dark);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n --_accent-strong: var(--punica-color-warning-dark);\n}\n:host([color='info']) {\n --_accent: var(--punica-color-info);\n --_accent-strong: var(--punica-color-info-dark);\n}\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n --_accent-strong: var(--punica-color-success-dark);\n}\n:host([color='neutral']) {\n --_accent: var(--punica-color-neutral-dark);\n --_accent-strong: var(--punica-color-neutral-dark);\n}\n\n:host([size='small']) {\n --punica-toggle-button-height: var(--punica-size-sm);\n --punica-toggle-button-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-toggle-button-height: var(--punica-size-lg);\n --punica-toggle-button-padding: var(--punica-space-28);\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--punica-space-6);\n inline-size: 100%;\n min-block-size: var(--punica-toggle-button-height);\n padding-inline: var(--punica-toggle-button-padding);\n border: var(--punica-border-width) solid var(--punica-toggle-button-border-color);\n border-start-start-radius: var(--punica-toggle-button-radius-start-start, var(--punica-toggle-button-radius));\n border-start-end-radius: var(--punica-toggle-button-radius-start-end, var(--punica-toggle-button-radius));\n border-end-start-radius: var(--punica-toggle-button-radius-end-start, var(--punica-toggle-button-radius));\n border-end-end-radius: var(--punica-toggle-button-radius-end-end, var(--punica-toggle-button-radius));\n background: var(--punica-color-surface);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration) var(--punica-ease),\n border-color var(--punica-duration) var(--punica-ease),\n color var(--punica-duration) var(--punica-ease);\n}\n\nbutton:hover {\n background: color-mix(in srgb, var(--punica-color-text) 8%, var(--punica-color-surface));\n}\n\n:host(:state(pressed)) button {\n background: var(--_accent);\n border-color: var(--_accent);\n color: var(--punica-color-on-accent);\n}\n:host(:state(pressed)) button:hover {\n background: var(--_accent-strong);\n border-color: var(--_accent-strong);\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n z-index: 1;\n}\n\nbutton:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n.label {\n display: inline-flex;\n align-items: center;\n}\n\n@media (forced-colors: active) {\n button {\n border-color: ButtonText;\n }\n :host(:state(pressed)) button {\n background: Highlight;\n border-color: Highlight;\n color: HighlightText;\n forced-color-adjust: none;\n }\n button:disabled {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/toggleButton/toggleButton.js
|
|
13
|
+
var missingMessage = () => {
|
|
14
|
+
const probe = document.createElement("input");
|
|
15
|
+
probe.type = "checkbox";
|
|
16
|
+
probe.required = true;
|
|
17
|
+
return probe.validationMessage;
|
|
18
|
+
};
|
|
19
|
+
var PunicaToggleButton = class extends FormControl(PunicaElement) {
|
|
20
|
+
static properties = {
|
|
21
|
+
pressed: { type: Boolean },
|
|
22
|
+
value: {},
|
|
23
|
+
label: {},
|
|
24
|
+
color: {},
|
|
25
|
+
size: {}
|
|
26
|
+
};
|
|
27
|
+
static styles = toggleButton_default;
|
|
28
|
+
static shadowOptions = { delegatesFocus: true };
|
|
29
|
+
static template = `
|
|
30
|
+
<button part="base" type="button" aria-pressed="false">
|
|
31
|
+
<slot name="start"></slot>
|
|
32
|
+
<span part="label" class="label"><slot></slot></span>
|
|
33
|
+
<slot name="end"></slot>
|
|
34
|
+
</button>
|
|
35
|
+
`;
|
|
36
|
+
#button = this.$("button");
|
|
37
|
+
#default = false;
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
this.#button.addEventListener("click", () => {
|
|
41
|
+
if (this.#off()) return;
|
|
42
|
+
this.pressed = !this.pressed;
|
|
43
|
+
this.emit("change", { pressed: this.pressed, checked: this.pressed, value: this.value });
|
|
44
|
+
});
|
|
45
|
+
this.addEventListener(
|
|
46
|
+
"click",
|
|
47
|
+
(event) => {
|
|
48
|
+
if (this.#off()) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
event.stopImmediatePropagation();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{ capture: true }
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
update() {
|
|
57
|
+
const button = this.#button;
|
|
58
|
+
const group = this.#group();
|
|
59
|
+
button.disabled = this.#off();
|
|
60
|
+
button.setAttribute("aria-pressed", String(this.pressed));
|
|
61
|
+
if (this.label) button.setAttribute("aria-label", this.label);
|
|
62
|
+
else button.removeAttribute("aria-label");
|
|
63
|
+
this.toggleState("pressed", this.pressed);
|
|
64
|
+
this.setFormValue(this.pressed && !group ? this.value ?? "on" : null, String(this.pressed));
|
|
65
|
+
const missing = this.required && !this.pressed && !group;
|
|
66
|
+
this.setValidity(missing ? { valueMissing: true } : {}, missing ? missingMessage() : "", button);
|
|
67
|
+
}
|
|
68
|
+
firstUpdated() {
|
|
69
|
+
this.#default = this.pressed;
|
|
70
|
+
}
|
|
71
|
+
formReset() {
|
|
72
|
+
if (!this.#group()) this.pressed = this.#default;
|
|
73
|
+
}
|
|
74
|
+
formRestore(state) {
|
|
75
|
+
if (!this.#group()) this.pressed = state === "true";
|
|
76
|
+
}
|
|
77
|
+
/** Moves focus to the button. */
|
|
78
|
+
focus(options) {
|
|
79
|
+
this.#button.focus(options);
|
|
80
|
+
}
|
|
81
|
+
/** Clicks the button the way a user would, firing `punica-change`. */
|
|
82
|
+
click() {
|
|
83
|
+
this.#button.click();
|
|
84
|
+
}
|
|
85
|
+
#group() {
|
|
86
|
+
return (
|
|
87
|
+
/** @type {any} */
|
|
88
|
+
this.closest("punica-toggle-button-group")
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
#off() {
|
|
92
|
+
return this.isDisabled || !!this.#group()?.isDisabled;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
define("punica-toggle-button", PunicaToggleButton);
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
PunicaToggleButton
|
|
99
|
+
};
|