@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,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
nextIndex
|
|
3
|
+
} from "./chunk-4RURT4SK.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/sideNav/sideNav.css
|
|
13
|
+
var sideNav_default = ":host {\n --punica-side-nav-width: 16rem;\n --punica-side-nav-rail-width: calc(var(--punica-size-md) + 2 * var(--punica-space-8) + var(--punica-border-width));\n --punica-side-nav-background: var(--punica-color-surface);\n --punica-side-nav-padding: var(--punica-space-8);\n\n display: block;\n inline-size: var(--punica-side-nav-width);\n block-size: 100%;\n transition: inline-size var(--punica-duration) var(--punica-ease);\n}\n\n:host([collapsed]) {\n inline-size: var(--punica-side-nav-rail-width);\n}\n\nnav {\n display: flex;\n flex-direction: column;\n block-size: 100%;\n border-inline-end: var(--punica-border-width) solid var(--punica-color-border);\n background: var(--punica-side-nav-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n overflow: hidden;\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--punica-space-8);\n padding: var(--punica-side-nav-padding);\n}\n:host([collapsed]) .header {\n flex-direction: column;\n justify-content: center;\n}\n\n.items {\n flex: 1 1 auto;\n min-block-size: 0;\n padding: var(--punica-side-nav-padding);\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.footer {\n padding: var(--punica-side-nav-padding);\n}\n.footer:not(:has(slot:has-slotted)) {\n padding: 0;\n}\n\n.collapse {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-md);\n block-size: var(--punica-size-md);\n margin-inline-start: auto;\n border-radius: var(--punica-radius);\n font-size: var(--punica-font-size-lg);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n:host([collapsed]) .collapse {\n margin-inline-start: 0;\n}\n.collapse:hover {\n background: var(--punica-color-hover);\n}\n.collapse:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n.collapse .icon {\n transition: transform var(--punica-duration) var(--punica-ease);\n}\n:host([collapsed]) .collapse .icon,\n.collapse:dir(rtl) .icon {\n transform: scaleX(-1);\n}\n:host([collapsed]) .collapse:dir(rtl) .icon {\n transform: none;\n}\n\n@media (forced-colors: active) {\n nav {\n border-color: CanvasText;\n }\n}\n\n:host([no-collapse]) .collapse {\n display: none;\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/sideNav/sideNav.js
|
|
16
|
+
var PunicaSideNav = class extends PunicaElement {
|
|
17
|
+
static properties = {
|
|
18
|
+
label: {},
|
|
19
|
+
collapsed: { type: Boolean },
|
|
20
|
+
noCollapse: { type: Boolean },
|
|
21
|
+
labelCollapse: { default: "Collapse navigation" },
|
|
22
|
+
labelExpand: { default: "Expand navigation" }
|
|
23
|
+
};
|
|
24
|
+
static styles = sideNav_default;
|
|
25
|
+
static template = `
|
|
26
|
+
<nav part="base">
|
|
27
|
+
<div part="header" class="header">
|
|
28
|
+
<slot name="header"></slot>
|
|
29
|
+
<button part="collapse-button" class="collapse" type="button">${icons.chevronStart}</button>
|
|
30
|
+
</div>
|
|
31
|
+
<div part="items" class="items"><slot></slot></div>
|
|
32
|
+
<div part="footer" class="footer"><slot name="footer"></slot></div>
|
|
33
|
+
</nav>
|
|
34
|
+
`;
|
|
35
|
+
#nav = this.$("nav");
|
|
36
|
+
#button = this.$(".collapse");
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.#button.addEventListener("click", () => {
|
|
40
|
+
this.collapsed = !this.collapsed;
|
|
41
|
+
this.emit("toggle", { open: !this.collapsed });
|
|
42
|
+
});
|
|
43
|
+
this.#nav.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
44
|
+
}
|
|
45
|
+
update(changed) {
|
|
46
|
+
if (this.label) this.#nav.setAttribute("aria-label", this.label);
|
|
47
|
+
else this.#nav.removeAttribute("aria-label");
|
|
48
|
+
this.#button.setAttribute("aria-label", this.collapsed ? this.labelExpand : this.labelCollapse);
|
|
49
|
+
this.#button.setAttribute("aria-expanded", String(!this.collapsed));
|
|
50
|
+
if (changed.has("collapsed")) {
|
|
51
|
+
for (const el of this.querySelectorAll("punica-side-nav-item, punica-side-nav-section")) {
|
|
52
|
+
el.requestUpdate?.();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Arrow keys, Home and End move between the items that are showing. */
|
|
57
|
+
#onKeydown(event) {
|
|
58
|
+
const current = event.target instanceof Element ? event.target.closest("punica-side-nav-item") : null;
|
|
59
|
+
if (!current || event.defaultPrevented) return;
|
|
60
|
+
const items = (
|
|
61
|
+
/** @type {HTMLElement[]} */
|
|
62
|
+
[...this.querySelectorAll("punica-side-nav-item:not([disabled])")].filter((item) => item.checkVisibility())
|
|
63
|
+
);
|
|
64
|
+
const index = nextIndex(event, items.length, items.indexOf(
|
|
65
|
+
/** @type {HTMLElement} */
|
|
66
|
+
current
|
|
67
|
+
), {
|
|
68
|
+
orientation: "vertical"
|
|
69
|
+
});
|
|
70
|
+
if (index < 0) return;
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
items[index].focus();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
define("punica-side-nav", PunicaSideNav);
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
PunicaSideNav
|
|
79
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/table/tableHeaderCell.css
|
|
10
|
+
var tableHeaderCell_default = ":host {\n display: table-cell;\n position: var(--_sticky, static);\n inset-block-start: 0;\n z-index: 1;\n padding: var(--punica-table-cell-padding, var(--punica-space-12) var(--punica-space-16));\n border-block-end: var(--punica-border-width) solid var(--punica-table-border-color, var(--punica-color-border));\n border-inline-end: var(--_divider, 0 none transparent);\n background: var(--punica-table-header-background, var(--punica-color-surface));\n color: var(--punica-table-header-color, var(--punica-color-text));\n font-weight: var(--punica-font-weight-semi-bold);\n text-align: start;\n vertical-align: middle;\n white-space: nowrap;\n}\n\n:host(:last-child) {\n border-inline-end: 0;\n}\n:host([align='center']) {\n text-align: center;\n}\n:host([align='end']) {\n text-align: end;\n}\n/* The indicator goes on the side away from the column's edge, so the text\n lines up with the cells under it. */\n:host([align='end']) button {\n flex-direction: row-reverse;\n}\n\n/* A sortable header is pressed anywhere in the cell: the button carries the\n cell's padding and fills it. */\n:host([sortable]) {\n padding: 0;\n}\nbutton {\n all: unset;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--punica-space-4);\n inline-size: 100%;\n padding: var(--punica-table-cell-padding, var(--punica-space-12) var(--punica-space-16));\n font: inherit;\n cursor: pointer;\n}\n:host([align='center']) button {\n justify-content: center;\n}\nbutton[hidden] {\n display: none !important;\n}\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n.sort-icon {\n display: inline-flex;\n flex-direction: column;\n font-size: var(--punica-font-size-xs);\n line-height: 0;\n color: var(--punica-color-text-muted);\n}\n.up,\n.down {\n display: inline-flex;\n margin-block: calc(-1 * var(--punica-space-2));\n opacity: var(--punica-disabled-opacity);\n transition: opacity var(--punica-duration-fast) var(--punica-ease);\n}\nbutton:hover .up,\nbutton:hover .down {\n opacity: 0.7;\n}\n:host([sort='ascending']) .up,\n:host([sort='descending']) .down {\n opacity: 1;\n color: var(--punica-color-text);\n}\n\n@media (forced-colors: active) {\n :host([sort='ascending']) .down,\n :host([sort='descending']) .up {\n visibility: hidden;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/table/tableHeaderCell.js
|
|
13
|
+
var PunicaTableHeaderCell = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
sortable: { type: Boolean },
|
|
16
|
+
sort: {},
|
|
17
|
+
column: {},
|
|
18
|
+
align: {}
|
|
19
|
+
};
|
|
20
|
+
static styles = tableHeaderCell_default;
|
|
21
|
+
static shadowOptions = { delegatesFocus: true };
|
|
22
|
+
static template = `
|
|
23
|
+
<button part="button" type="button" hidden>
|
|
24
|
+
<span part="sort-icon" class="sort-icon">
|
|
25
|
+
<span class="up">${icons.chevronUp}</span>
|
|
26
|
+
<span class="down">${icons.chevronDown}</span>
|
|
27
|
+
</span>
|
|
28
|
+
</button>
|
|
29
|
+
<slot></slot>
|
|
30
|
+
`;
|
|
31
|
+
#button = this.$("button");
|
|
32
|
+
#slot = this.$("slot");
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
this.internals.role = "columnheader";
|
|
36
|
+
this.#button.addEventListener("click", () => this.#onSort());
|
|
37
|
+
}
|
|
38
|
+
update() {
|
|
39
|
+
const button = this.#button;
|
|
40
|
+
if (this.sortable && this.#slot.parentNode !== button) button.prepend(this.#slot);
|
|
41
|
+
else if (!this.sortable && this.#slot.parentNode === button) this.shadowRoot.append(this.#slot);
|
|
42
|
+
button.hidden = !this.sortable;
|
|
43
|
+
const sort = this.sort === "ascending" || this.sort === "descending" ? this.sort : "none";
|
|
44
|
+
this.internals.ariaSort = this.sortable ? sort : null;
|
|
45
|
+
}
|
|
46
|
+
#onSort() {
|
|
47
|
+
const direction = this.sort === "ascending" ? "descending" : "ascending";
|
|
48
|
+
const siblings = [...this.parentElement?.children || []];
|
|
49
|
+
const column = this.column ?? String(siblings.indexOf(this));
|
|
50
|
+
const event = this.emit("sort", { column, direction }, { cancelable: true });
|
|
51
|
+
if (event.defaultPrevented) return;
|
|
52
|
+
for (const other of siblings) {
|
|
53
|
+
if (other !== this && other.localName === this.localName && other.sort) other.sort = null;
|
|
54
|
+
}
|
|
55
|
+
this.sort = direction;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
define("punica-table-header-cell", PunicaTableHeaderCell);
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
PunicaTableHeaderCell
|
|
62
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
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/chatLayout.css
|
|
13
|
+
var chatLayout_default = ":host {\n --punica-chat-layout-background: var(--punica-color-bg);\n --punica-chat-layout-padding: var(--punica-space-16);\n --punica-chat-layout-max-width: 48rem;\n\n display: flex;\n flex-direction: column;\n block-size: 100%;\n min-block-size: 0;\n background: var(--punica-chat-layout-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.header {\n flex: none;\n padding: var(--punica-space-8) var(--punica-chat-layout-padding);\n border-block-end: var(--punica-border-width) solid var(--punica-color-border);\n}\n\n.body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n min-block-size: 0;\n}\n\n.scroller {\n flex: 1 1 auto;\n min-inline-size: 0;\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: var(--punica-chat-layout-padding);\n}\n\n.scroller:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\n.content,\n.composer ::slotted(*) {\n max-inline-size: var(--punica-chat-layout-max-width);\n margin-inline: auto;\n}\n\n.jump {\n all: unset;\n position: absolute;\n inset-block-end: var(--punica-space-12);\n inset-inline: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-md);\n block-size: var(--punica-size-md);\n margin-inline: auto;\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-radius-full);\n background: var(--punica-color-surface-raised);\n color: var(--punica-color-text);\n box-shadow: var(--punica-shadow-sm);\n font-size: var(--punica-font-size-lg);\n cursor: pointer;\n}\n\n.jump:hover {\n border-color: var(--punica-color-border-strong);\n}\n\n.jump:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.composer {\n flex: none;\n padding: var(--punica-space-8) var(--punica-chat-layout-padding) var(--punica-chat-layout-padding);\n}\n\n.header[hidden],\n.composer[hidden],\n.jump[hidden] {\n display: none;\n}\n\n@media (forced-colors: active) {\n .jump {\n border-color: ButtonText;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/chat/chatLayout.js
|
|
16
|
+
var THRESHOLD = 8;
|
|
17
|
+
var PunicaChatLayout = class extends PunicaElement {
|
|
18
|
+
static properties = {
|
|
19
|
+
label: { default: "Messages" },
|
|
20
|
+
labelScrollToLatest: { default: "Jump to latest" }
|
|
21
|
+
};
|
|
22
|
+
static styles = chatLayout_default;
|
|
23
|
+
static template = `
|
|
24
|
+
<div part="header" class="header" hidden><slot name="header"></slot></div>
|
|
25
|
+
<div part="body" class="body">
|
|
26
|
+
<div part="scroller" class="scroller" role="group" tabindex="0">
|
|
27
|
+
<div part="content" class="content"><slot></slot></div>
|
|
28
|
+
</div>
|
|
29
|
+
<button part="scroll-button" class="jump" type="button" hidden>${icons.chevronDown}</button>
|
|
30
|
+
</div>
|
|
31
|
+
<div part="composer" class="composer" hidden><slot name="composer"></slot></div>
|
|
32
|
+
`;
|
|
33
|
+
#scroller = this.$(".scroller");
|
|
34
|
+
#content = this.$(".content");
|
|
35
|
+
#jump = this.$(".jump");
|
|
36
|
+
/** @type {ResizeObserver | null} */
|
|
37
|
+
#resize = null;
|
|
38
|
+
/** @type {MutationObserver | null} */
|
|
39
|
+
#mutation = null;
|
|
40
|
+
/** The reader is following the end. */
|
|
41
|
+
#pinned = true;
|
|
42
|
+
/** scrollTop as this element last left or saw it; null when unknown. */
|
|
43
|
+
#top = (
|
|
44
|
+
/** @type {number | null} */
|
|
45
|
+
null
|
|
46
|
+
);
|
|
47
|
+
/** The largest scrollTop of the content as last seen. */
|
|
48
|
+
#extent = 0;
|
|
49
|
+
constructor() {
|
|
50
|
+
super();
|
|
51
|
+
this.#scroller.addEventListener("scroll", () => this.#sync(true), { passive: true });
|
|
52
|
+
this.#jump.addEventListener("click", () => {
|
|
53
|
+
this.scrollToLatest();
|
|
54
|
+
this.#scroller.focus({ preventScroll: true });
|
|
55
|
+
});
|
|
56
|
+
for (const name of ["header", "composer"]) {
|
|
57
|
+
const slot = this.$(`slot[name="${name}"]`);
|
|
58
|
+
slot.addEventListener("slotchange", () => {
|
|
59
|
+
slot.parentElement.hidden = !slotHasContent(slot);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
connected() {
|
|
64
|
+
this.#top = null;
|
|
65
|
+
this.#resize = new ResizeObserver(() => this.#sync(false));
|
|
66
|
+
this.#resize.observe(this.#scroller);
|
|
67
|
+
this.#resize.observe(this.#content);
|
|
68
|
+
this.#mutation = new MutationObserver(() => this.#sync(false));
|
|
69
|
+
this.#mutation.observe(this, { childList: true, subtree: true, characterData: true });
|
|
70
|
+
}
|
|
71
|
+
disconnected() {
|
|
72
|
+
this.#resize?.disconnect();
|
|
73
|
+
this.#resize = null;
|
|
74
|
+
this.#mutation?.disconnect();
|
|
75
|
+
this.#mutation = null;
|
|
76
|
+
}
|
|
77
|
+
update() {
|
|
78
|
+
this.#scroller.setAttribute("aria-label", this.label);
|
|
79
|
+
this.#jump.setAttribute("aria-label", this.labelScrollToLatest);
|
|
80
|
+
}
|
|
81
|
+
/** True while the view follows the latest content. */
|
|
82
|
+
get atBottom() {
|
|
83
|
+
return this.#pinned;
|
|
84
|
+
}
|
|
85
|
+
/** Scrolls to the latest content and follows it again. */
|
|
86
|
+
scrollToLatest() {
|
|
87
|
+
const scroller = this.#scroller;
|
|
88
|
+
scroller.scrollTop = scroller.scrollHeight;
|
|
89
|
+
this.#top = scroller.scrollTop;
|
|
90
|
+
this.#extent = scroller.scrollHeight - scroller.clientHeight;
|
|
91
|
+
this.#setPinned(true);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Decides whether the reader is following the end and, if so, goes there.
|
|
95
|
+
* A scroll position this element did not set is the reader's doing.
|
|
96
|
+
* @param {boolean} fromScroll called by a scroll event
|
|
97
|
+
*/
|
|
98
|
+
#sync(fromScroll) {
|
|
99
|
+
const scroller = this.#scroller;
|
|
100
|
+
const extent = scroller.scrollHeight - scroller.clientHeight;
|
|
101
|
+
const top = scroller.scrollTop;
|
|
102
|
+
const moved = this.#top !== null && Math.abs(top - this.#top) > 1;
|
|
103
|
+
let pinned = this.#pinned;
|
|
104
|
+
if (moved) {
|
|
105
|
+
pinned = Math.min(extent, this.#extent) - top <= THRESHOLD;
|
|
106
|
+
} else if (!pinned) {
|
|
107
|
+
pinned = extent - top <= THRESHOLD;
|
|
108
|
+
}
|
|
109
|
+
if (pinned && !(fromScroll && moved)) scroller.scrollTop = scroller.scrollHeight;
|
|
110
|
+
this.#top = scroller.scrollTop;
|
|
111
|
+
this.#extent = extent;
|
|
112
|
+
this.#setPinned(pinned);
|
|
113
|
+
}
|
|
114
|
+
/** @param {boolean} pinned */
|
|
115
|
+
#setPinned(pinned) {
|
|
116
|
+
this.toggleState("at-bottom", pinned);
|
|
117
|
+
this.#jump.hidden = pinned;
|
|
118
|
+
if (pinned === this.#pinned) return;
|
|
119
|
+
this.#pinned = pinned;
|
|
120
|
+
this.emit("scroll-state", { atBottom: pinned });
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
define("punica-chat-layout", PunicaChatLayout);
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
PunicaChatLayout
|
|
127
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composedContains,
|
|
3
|
+
deepActiveElement
|
|
4
|
+
} from "./chunk-4RURT4SK.js";
|
|
5
|
+
import {
|
|
6
|
+
sheet
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/dialog/modalSurface.js
|
|
10
|
+
var LOCK_CSS = ":root { overflow: hidden; overscroll-behavior: none; }";
|
|
11
|
+
var GUTTER_CSS = ":root { scrollbar-gutter: stable; }";
|
|
12
|
+
var locks = /* @__PURE__ */ new Set();
|
|
13
|
+
var lockSheet = null;
|
|
14
|
+
var gutterSheet = null;
|
|
15
|
+
function lockScroll(owner, on) {
|
|
16
|
+
if (typeof document === "undefined") return;
|
|
17
|
+
if (on) locks.add(owner);
|
|
18
|
+
else locks.delete(owner);
|
|
19
|
+
const want = locks.size > 0;
|
|
20
|
+
const has = !!lockSheet && document.adoptedStyleSheets.includes(lockSheet);
|
|
21
|
+
if (want && !has) {
|
|
22
|
+
lockSheet ||= sheet(LOCK_CSS);
|
|
23
|
+
gutterSheet ||= sheet(GUTTER_CSS);
|
|
24
|
+
const scrollbar = window.innerWidth - document.documentElement.clientWidth > 0;
|
|
25
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lockSheet, ...scrollbar ? [gutterSheet] : []];
|
|
26
|
+
} else if (!want && has) {
|
|
27
|
+
document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== lockSheet && s !== gutterSheet);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function closeDialog(dialog) {
|
|
31
|
+
if (dialog.hasAttribute("popover")) {
|
|
32
|
+
try {
|
|
33
|
+
if (dialog.matches(":popover-open")) dialog.hidePopover();
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
dialog.removeAttribute("popover");
|
|
37
|
+
}
|
|
38
|
+
if (dialog.open) dialog.close();
|
|
39
|
+
}
|
|
40
|
+
var ModalSurface = (Base) => class ModalSurfaceElement extends Base {
|
|
41
|
+
static properties = {
|
|
42
|
+
/** Accessible name of the dialog. */
|
|
43
|
+
label: {},
|
|
44
|
+
/** The dialog is showing. */
|
|
45
|
+
open: { type: Boolean },
|
|
46
|
+
/** A click on the backdrop does not close it. */
|
|
47
|
+
noLightDismiss: { type: Boolean }
|
|
48
|
+
};
|
|
49
|
+
#shown = false;
|
|
50
|
+
#reason = "api";
|
|
51
|
+
#returnValue = "";
|
|
52
|
+
#downOnBackdrop = false;
|
|
53
|
+
/** @type {Element | null} */
|
|
54
|
+
#returnFocus = null;
|
|
55
|
+
constructor(...args) {
|
|
56
|
+
super(...args);
|
|
57
|
+
const dialog = this.dialogElement;
|
|
58
|
+
dialog.addEventListener("cancel", (event) => {
|
|
59
|
+
if (event.target !== dialog) return;
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
this.requestClose("escape");
|
|
62
|
+
});
|
|
63
|
+
dialog.addEventListener("close", (event) => {
|
|
64
|
+
if (event.target !== dialog) return;
|
|
65
|
+
if (this.open && this.isConnected && this.#shown && !dialog.open) {
|
|
66
|
+
this.#reason = "escape";
|
|
67
|
+
this.open = false;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
dialog.addEventListener("keydown", (event) => {
|
|
71
|
+
if (event.key !== "Escape" || event.defaultPrevented || !this.modeless) return;
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
this.requestClose("escape");
|
|
74
|
+
});
|
|
75
|
+
dialog.addEventListener("pointerdown", (event) => {
|
|
76
|
+
this.#downOnBackdrop = event.target === dialog && this.isBackdropHit(event);
|
|
77
|
+
});
|
|
78
|
+
dialog.addEventListener("click", (event) => {
|
|
79
|
+
const hit = this.#downOnBackdrop && event.target === dialog && this.isBackdropHit(event);
|
|
80
|
+
this.#downOnBackdrop = false;
|
|
81
|
+
if (hit && !this.noLightDismiss && !this.modeless) this.requestClose("backdrop");
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** The native dialog. @returns {HTMLDialogElement} */
|
|
85
|
+
get dialogElement() {
|
|
86
|
+
return this.$("dialog");
|
|
87
|
+
}
|
|
88
|
+
/** Elements that name the dialog when `label` is not set. @returns {Element[]} */
|
|
89
|
+
get labelSources() {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
/** The value handed to `hide()` or `requestClose()` when it last closed. */
|
|
93
|
+
get returnValue() {
|
|
94
|
+
return this.#returnValue;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Whether a pointer event on the dialog element landed on its backdrop.
|
|
98
|
+
* @param {MouseEvent} event
|
|
99
|
+
*/
|
|
100
|
+
isBackdropHit(event) {
|
|
101
|
+
const rect = this.dialogElement.getBoundingClientRect();
|
|
102
|
+
return event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom;
|
|
103
|
+
}
|
|
104
|
+
/** Opens the dialog. */
|
|
105
|
+
show() {
|
|
106
|
+
this.open = true;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Closes the dialog without asking.
|
|
110
|
+
* @param {string} [returnValue] reported in `punica-close`
|
|
111
|
+
*/
|
|
112
|
+
hide(returnValue) {
|
|
113
|
+
this.closeWith("api", returnValue);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Closes the dialog the way a user does: fires the cancelable
|
|
117
|
+
* `punica-request-close` first.
|
|
118
|
+
* @param {string} [reason] `api` by default
|
|
119
|
+
* @param {string} [returnValue] reported in `punica-close`
|
|
120
|
+
* @returns {boolean} false when a listener kept it open
|
|
121
|
+
*/
|
|
122
|
+
requestClose(reason = "api", returnValue) {
|
|
123
|
+
if (!this.open) return false;
|
|
124
|
+
const event = this.emit("request-close", { reason }, { cancelable: true });
|
|
125
|
+
if (event.defaultPrevented) return false;
|
|
126
|
+
this.closeWith(reason, returnValue);
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Closes with a reason, without asking. For the component's own use.
|
|
131
|
+
* @param {string} reason
|
|
132
|
+
* @param {string} [returnValue]
|
|
133
|
+
*/
|
|
134
|
+
closeWith(reason, returnValue) {
|
|
135
|
+
if (!this.open) return;
|
|
136
|
+
this.#reason = reason;
|
|
137
|
+
if (returnValue !== void 0) this.#returnValue = String(returnValue);
|
|
138
|
+
this.open = false;
|
|
139
|
+
}
|
|
140
|
+
connected() {
|
|
141
|
+
super.connected();
|
|
142
|
+
if (this.open && !this.#shown) queueMicrotask(() => this.isConnected && this.#sync());
|
|
143
|
+
}
|
|
144
|
+
disconnected() {
|
|
145
|
+
super.disconnected();
|
|
146
|
+
const dialog = this.dialogElement;
|
|
147
|
+
if (dialog.open) closeDialog(dialog);
|
|
148
|
+
this.#shown = false;
|
|
149
|
+
lockScroll(this, false);
|
|
150
|
+
}
|
|
151
|
+
update(changed) {
|
|
152
|
+
super.update(changed);
|
|
153
|
+
this.#name();
|
|
154
|
+
this.#sync();
|
|
155
|
+
}
|
|
156
|
+
#name() {
|
|
157
|
+
const dialog = this.dialogElement;
|
|
158
|
+
const sources = this.label ? [] : this.labelSources;
|
|
159
|
+
const text = this.label || sources.map((el) => el.textContent.trim()).join(" ");
|
|
160
|
+
if ("ariaLabelledByElements" in dialog) dialog.ariaLabelledByElements = sources.length ? sources : null;
|
|
161
|
+
if (text) dialog.setAttribute("aria-label", text);
|
|
162
|
+
else dialog.removeAttribute("aria-label");
|
|
163
|
+
}
|
|
164
|
+
#sync() {
|
|
165
|
+
const dialog = this.dialogElement;
|
|
166
|
+
if (this.open && !this.#shown) {
|
|
167
|
+
this.#shown = true;
|
|
168
|
+
this.#returnValue = "";
|
|
169
|
+
this.#returnFocus = deepActiveElement();
|
|
170
|
+
if (dialog.open) closeDialog(dialog);
|
|
171
|
+
if (this.modeless) {
|
|
172
|
+
dialog.setAttribute("popover", "manual");
|
|
173
|
+
dialog.show();
|
|
174
|
+
dialog.showPopover?.();
|
|
175
|
+
} else {
|
|
176
|
+
dialog.showModal();
|
|
177
|
+
lockScroll(this, true);
|
|
178
|
+
}
|
|
179
|
+
this.surfaceOpened();
|
|
180
|
+
this.emit("open");
|
|
181
|
+
} else if (!this.open && this.#shown) {
|
|
182
|
+
this.#shown = false;
|
|
183
|
+
lockScroll(this, false);
|
|
184
|
+
const active = deepActiveElement();
|
|
185
|
+
const inside = !active || active === document.body || composedContains(this, active) || composedContains(dialog, active);
|
|
186
|
+
closeDialog(dialog);
|
|
187
|
+
const back = this.#returnFocus;
|
|
188
|
+
this.#returnFocus = null;
|
|
189
|
+
const reason = this.#reason;
|
|
190
|
+
this.#reason = "api";
|
|
191
|
+
if (inside && back instanceof HTMLElement && back.isConnected && deepActiveElement() !== back) {
|
|
192
|
+
back.focus({ preventScroll: true });
|
|
193
|
+
}
|
|
194
|
+
this.surfaceClosed();
|
|
195
|
+
this.emit("close", { reason, returnValue: this.#returnValue });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/** Runs right after the dialog opened, before `punica-open`. */
|
|
199
|
+
surfaceOpened() {
|
|
200
|
+
}
|
|
201
|
+
/** Runs right after the dialog closed, before `punica-close`. */
|
|
202
|
+
surfaceClosed() {
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
ModalSurface
|
|
208
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/visuallyHidden/visuallyHidden.css
|
|
7
|
+
var visuallyHidden_default = ":host {\n display: inline-block;\n}\n\n:host(:not([focusable])),\n:host([focusable]:not(:focus-within)) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/visuallyHidden/visuallyHidden.js
|
|
10
|
+
var PunicaVisuallyHidden = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
focusable: { type: Boolean }
|
|
13
|
+
};
|
|
14
|
+
static styles = visuallyHidden_default;
|
|
15
|
+
static template = `<slot></slot>`;
|
|
16
|
+
};
|
|
17
|
+
define("punica-visually-hidden", PunicaVisuallyHidden);
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
PunicaVisuallyHidden
|
|
21
|
+
};
|