@punica/components 0.0.0-stage → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +139 -2
- package/bin/punica-components.mjs +138 -0
- package/custom-elements.json +38745 -0
- package/dist/ai/index.d.ts +39 -0
- package/dist/ai/index.mjs +615 -0
- package/dist/ai/node.d.ts +5 -0
- package/dist/ai/node.mjs +625 -0
- package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
- package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
- package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
- package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
- package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
- package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
- package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
- package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
- package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
- package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
- package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
- package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
- package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
- package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
- package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
- package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
- package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
- package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
- package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
- package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
- package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
- package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
- package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
- package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
- package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
- package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
- package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
- package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
- package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
- package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
- package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
- package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
- package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
- package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
- package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
- package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
- package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
- package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
- package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
- package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
- package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
- package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
- package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
- package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
- package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
- package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
- package/dist/esm/chunks/chunk-BC657356.js +93 -0
- package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
- package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
- package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
- package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
- package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
- package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
- package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
- package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
- package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
- package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
- package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
- package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
- package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
- package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
- package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
- package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
- package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
- package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
- package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
- package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
- package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
- package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
- package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
- package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
- package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
- package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
- package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
- package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
- package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
- package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
- package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
- package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
- package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
- package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
- package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
- package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
- package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
- package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
- package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
- package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
- package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
- package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
- package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
- package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
- package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
- package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
- package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
- package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
- package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
- package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
- package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
- package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
- package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
- package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
- package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
- package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
- package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
- package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
- package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
- package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
- package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
- package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
- package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
- package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
- package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
- package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
- package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
- package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
- package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
- package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
- package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
- package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
- package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
- package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
- package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
- package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
- package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
- package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
- package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
- package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
- package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
- package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
- package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
- package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
- package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
- package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
- package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
- package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
- package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
- package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
- package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
- package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
- package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
- package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
- package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
- package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
- package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
- package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
- package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
- package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
- package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
- package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
- package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
- package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
- package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
- package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
- package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
- package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
- package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
- package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
- package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
- package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
- package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
- package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
- package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
- package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
- package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
- package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
- package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
- package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
- package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
- package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
- package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
- package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
- package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
- package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
- package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
- package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
- package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
- package/dist/esm/components/accordion/accordion.js +8 -0
- package/dist/esm/components/accordion/accordionGroup.js +7 -0
- package/dist/esm/components/agenda/agenda.js +9 -0
- package/dist/esm/components/alert/alert.js +8 -0
- package/dist/esm/components/alertDialog/alertDialog.js +14 -0
- package/dist/esm/components/appBar/appBar.js +7 -0
- package/dist/esm/components/appShell/appShell.js +11 -0
- package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
- package/dist/esm/components/autocomplete/autocomplete.js +14 -0
- package/dist/esm/components/avatar/avatar.js +7 -0
- package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
- package/dist/esm/components/badge/badge.js +7 -0
- package/dist/esm/components/banner/banner.js +9 -0
- package/dist/esm/components/blockquote/blockquote.js +7 -0
- package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
- package/dist/esm/components/box/box.js +7 -0
- package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/esm/components/button/button.js +8 -0
- package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
- package/dist/esm/components/calendar/calendar.js +12 -0
- package/dist/esm/components/calendar/dates.js +44 -0
- package/dist/esm/components/card/card.js +7 -0
- package/dist/esm/components/card/cardActions.js +7 -0
- package/dist/esm/components/card/cardContent.js +7 -0
- package/dist/esm/components/card/cardHeader.js +7 -0
- package/dist/esm/components/card/cardMedia.js +7 -0
- package/dist/esm/components/carousel/carousel.js +9 -0
- package/dist/esm/components/carousel/carouselItem.js +7 -0
- package/dist/esm/components/center/center.js +7 -0
- package/dist/esm/components/chat/chatComposer.js +9 -0
- package/dist/esm/components/chat/chatDictationButton.js +8 -0
- package/dist/esm/components/chat/chatLayout.js +9 -0
- package/dist/esm/components/chat/chatMessage.js +9 -0
- package/dist/esm/components/chat/chatMessageBubble.js +7 -0
- package/dist/esm/components/chat/chatMessageList.js +8 -0
- package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
- package/dist/esm/components/chat/chatSystemMessage.js +7 -0
- package/dist/esm/components/chat/chatToolCall.js +9 -0
- package/dist/esm/components/chat/chatToolCalls.js +8 -0
- package/dist/esm/components/chat/slots.js +6 -0
- package/dist/esm/components/checkbox/checkbox.js +9 -0
- package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
- package/dist/esm/components/chip/chip.js +8 -0
- package/dist/esm/components/citation/citation.js +11 -0
- package/dist/esm/components/code/code.js +7 -0
- package/dist/esm/components/codeBlock/codeBlock.js +8 -0
- package/dist/esm/components/collapsible/collapsible.js +7 -0
- package/dist/esm/components/commandPalette/commandGroup.js +7 -0
- package/dist/esm/components/commandPalette/commandItem.js +7 -0
- package/dist/esm/components/commandPalette/commandPalette.js +10 -0
- package/dist/esm/components/complexSelector/complexOption.js +9 -0
- package/dist/esm/components/complexSelector/complexSelector.js +16 -0
- package/dist/esm/components/complexSelector/optionGroup.js +7 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/contextMenu/contextMenu.js +12 -0
- package/dist/esm/components/datePicker/datePicker.js +15 -0
- package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
- package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
- package/dist/esm/components/dialog/dialog.js +11 -0
- package/dist/esm/components/dialog/dialogContent.js +7 -0
- package/dist/esm/components/dialog/dialogFooter.js +7 -0
- package/dist/esm/components/dialog/dialogHeader.js +7 -0
- package/dist/esm/components/dialog/modalSurface.js +8 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/drawer/drawer.js +10 -0
- package/dist/esm/components/emptyState/emptyState.js +7 -0
- package/dist/esm/components/field/field.js +7 -0
- package/dist/esm/components/fileInput/fileInput.js +9 -0
- package/dist/esm/components/formLayout/formLayout.js +7 -0
- package/dist/esm/components/grid/col.js +7 -0
- package/dist/esm/components/grid/row.js +7 -0
- package/dist/esm/components/heading/heading.js +7 -0
- package/dist/esm/components/hidden/hidden.js +7 -0
- package/dist/esm/components/hoverCard/hoverCard.js +9 -0
- package/dist/esm/components/icon/icon.js +8 -0
- package/dist/esm/components/iconButton/iconButton.js +8 -0
- package/dist/esm/components/infoTip/infoTip.js +10 -0
- package/dist/esm/components/input/input.js +9 -0
- package/dist/esm/components/inputGroup/inputGroup.js +9 -0
- package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
- package/dist/esm/components/kbd/kbd.js +7 -0
- package/dist/esm/components/lightbox/lightbox.js +10 -0
- package/dist/esm/components/link/link.js +8 -0
- package/dist/esm/components/listView/list.js +7 -0
- package/dist/esm/components/listView/listItem.js +7 -0
- package/dist/esm/components/listbox/listbox.js +9 -0
- package/dist/esm/components/listbox/listboxItem.js +8 -0
- package/dist/esm/components/markdown/markdown.js +9 -0
- package/dist/esm/components/markdown/parser.js +9 -0
- package/dist/esm/components/markdown/url.js +6 -0
- package/dist/esm/components/menu/menu.js +11 -0
- package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
- package/dist/esm/components/menu/menuDivider.js +7 -0
- package/dist/esm/components/menu/menuGroup.js +7 -0
- package/dist/esm/components/menu/menuItem.js +8 -0
- package/dist/esm/components/menu/menuRadioGroup.js +7 -0
- package/dist/esm/components/menu/menuRadioItem.js +9 -0
- package/dist/esm/components/metadataList/metadataList.js +9 -0
- package/dist/esm/components/metadataList/metadataListItem.js +8 -0
- package/dist/esm/components/mobileNav/mobileNav.js +10 -0
- package/dist/esm/components/numberInput/numberInput.js +9 -0
- package/dist/esm/components/outline/outline.js +8 -0
- package/dist/esm/components/overflowList/overflowList.js +11 -0
- package/dist/esm/components/pagination/pagination.js +8 -0
- package/dist/esm/components/paper/paper.js +7 -0
- package/dist/esm/components/popover/popover.js +9 -0
- package/dist/esm/components/powerSearch/powerSearch.js +14 -0
- package/dist/esm/components/progressBar/progressBar.js +7 -0
- package/dist/esm/components/qrCode/qrCode.js +9 -0
- package/dist/esm/components/radio/radio.js +7 -0
- package/dist/esm/components/radio/radioGroup.js +10 -0
- package/dist/esm/components/scrollArea/scrollArea.js +8 -0
- package/dist/esm/components/section/section.js +8 -0
- package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
- package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
- package/dist/esm/components/select/field.js +18 -0
- package/dist/esm/components/select/option.js +8 -0
- package/dist/esm/components/select/select.js +14 -0
- package/dist/esm/components/selectableCard/selectableCard.js +9 -0
- package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
- package/dist/esm/components/sideNav/sideNav.js +9 -0
- package/dist/esm/components/sideNav/sideNavItem.js +9 -0
- package/dist/esm/components/sideNav/sideNavSection.js +8 -0
- package/dist/esm/components/skeleton/skeleton.js +7 -0
- package/dist/esm/components/slider/slider.js +9 -0
- package/dist/esm/components/spinner/spinner.js +7 -0
- package/dist/esm/components/split/split.js +8 -0
- package/dist/esm/components/splitButton/splitButton.js +12 -0
- package/dist/esm/components/stack/stack.js +7 -0
- package/dist/esm/components/statusDot/statusDot.js +7 -0
- package/dist/esm/components/stepper/step.js +8 -0
- package/dist/esm/components/stepper/stepper.js +7 -0
- package/dist/esm/components/switch/switch.js +8 -0
- package/dist/esm/components/tab/tab.js +7 -0
- package/dist/esm/components/tab/tabPanel.js +7 -0
- package/dist/esm/components/tab/tabs.js +8 -0
- package/dist/esm/components/table/table.js +7 -0
- package/dist/esm/components/table/tableBody.js +7 -0
- package/dist/esm/components/table/tableCell.js +7 -0
- package/dist/esm/components/table/tableFooter.js +7 -0
- package/dist/esm/components/table/tableHeader.js +7 -0
- package/dist/esm/components/table/tableHeaderCell.js +8 -0
- package/dist/esm/components/table/tableRow.js +7 -0
- package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
- package/dist/esm/components/text/text.js +7 -0
- package/dist/esm/components/textarea/textarea.js +8 -0
- package/dist/esm/components/thumbnail/thumbnail.js +8 -0
- package/dist/esm/components/timePicker/timePicker.js +15 -0
- package/dist/esm/components/timer/timer.js +7 -0
- package/dist/esm/components/timestamp/timestamp.js +7 -0
- package/dist/esm/components/toast/toast.js +8 -0
- package/dist/esm/components/toast/toaster.js +12 -0
- package/dist/esm/components/toggleButton/toggleButton.js +8 -0
- package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
- package/dist/esm/components/tokenizer/tokenizer.js +14 -0
- package/dist/esm/components/toolbar/toolbar.js +8 -0
- package/dist/esm/components/tooltip/tooltip.js +9 -0
- package/dist/esm/components/topNav/topNav.js +11 -0
- package/dist/esm/components/topNav/topNavItem.js +11 -0
- package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
- package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
- package/dist/esm/components/tree/tree.js +8 -0
- package/dist/esm/components/tree/treeItem.js +8 -0
- package/dist/esm/components/virtualList/virtualList.js +7 -0
- package/dist/esm/components/virtualTable/virtualTable.js +9 -0
- package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
- package/dist/esm/core/a11y.js +22 -0
- package/dist/esm/core/element.js +14 -0
- package/dist/esm/core/form.js +6 -0
- package/dist/esm/core/overlay.js +8 -0
- package/dist/esm/index.js +779 -0
- package/dist/llms-full.txt +8903 -0
- package/dist/llms.txt +288 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6762 -0
- package/dist/types/react.d.ts +1914 -0
- package/dist/vscode.css-custom-data.json +3892 -0
- package/dist/vscode.html-custom-data.json +6912 -0
- package/dist/web-types.json +12404 -0
- package/docs/MIGRATION-2.0.md +112 -0
- package/docs/contract.md +130 -0
- package/docs/migration/chat.md +309 -0
- package/docs/migration/content.md +806 -0
- package/docs/migration/data.md +140 -0
- package/docs/migration/display.md +625 -0
- package/docs/migration/form-basic.md +262 -0
- package/docs/migration/navigation.md +368 -0
- package/docs/migration/overlays.md +261 -0
- package/docs/migration/pickers.md +194 -0
- package/package.json +135 -4
- package/scripts/codemod-2.0.mjs +50 -0
- package/scripts/codemod-rules.mjs +102 -0
- package/skills/punica-components/SKILL.md +48 -0
|
@@ -0,0 +1,410 @@
|
|
|
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/virtualTable/virtualTable.css
|
|
13
|
+
var virtualTable_default = ":host {\n --punica-virtual-table-background: var(--punica-color-surface);\n --punica-virtual-table-header-background: var(--punica-color-surface);\n --punica-virtual-table-border-color: var(--punica-color-border);\n --punica-virtual-table-cell-padding: var(--punica-space-8) var(--punica-space-12);\n --punica-virtual-table-max-height: 100vb;\n\n display: block;\n block-size: 100%;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n color: var(--punica-color-text);\n}\n\n/* The scroller. An unsized host would grow to its whole content and render\n every row, so the scroller never exceeds the max height. */\n.viewport {\n position: relative;\n overflow: auto;\n block-size: 100%;\n max-block-size: var(--punica-virtual-table-max-height);\n overflow-anchor: none;\n background: var(--punica-virtual-table-background);\n}\n\n.viewport:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n.inner {\n min-inline-size: max-content;\n}\n\n.header[hidden] {\n display: none;\n}\n\n.header {\n position: sticky;\n inset-block-start: 0;\n z-index: 1;\n background: var(--punica-virtual-table-header-background);\n}\n\n.row {\n display: grid;\n grid-template-columns: var(--_columns, none);\n align-items: stretch;\n}\n\n.body {\n position: relative;\n contain: layout style;\n}\n\n.body .row {\n position: absolute;\n inset-inline: 0;\n}\n\n.cell {\n display: flex;\n align-items: center;\n min-inline-size: 0;\n padding: var(--punica-virtual-table-cell-padding);\n border-block-end: var(--punica-border-width) solid var(--punica-virtual-table-border-color);\n overflow: hidden;\n}\n\n.cell[data-align='center'] {\n justify-content: center;\n text-align: center;\n}\n.cell[data-align='end'] {\n justify-content: end;\n text-align: end;\n}\n/* The indicator goes on the side away from the column's edge, so the label\n lines up with the cells under it. */\n.cell[data-align='end'] .sort {\n flex-direction: row-reverse;\n}\n\n.text {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.header .cell {\n min-block-size: var(--punica-size-md);\n font-weight: var(--punica-font-weight-semi-bold);\n}\n\n.body .row.last .cell {\n border-block-end-color: transparent;\n}\n\n/* selectable rows */\n.body .row[tabindex] {\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n.body .row[tabindex]:hover {\n background: var(--punica-color-hover);\n}\n.body .row[aria-selected='true'] {\n background: var(--punica-color-selected);\n}\n.body .row:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n/* sortable headers: the button fills the cell, so it is pressed anywhere in it */\n.header .cell:has(> .sort) {\n padding: 0;\n}\n.sort {\n all: unset;\n box-sizing: border-box;\n display: flex;\n flex: 1 1 auto;\n align-self: stretch;\n align-items: center;\n gap: var(--punica-space-4);\n min-inline-size: 0;\n padding: var(--punica-virtual-table-cell-padding);\n font: inherit;\n cursor: pointer;\n}\n.cell[data-align='center'] .sort {\n justify-content: center;\n}\n.sort:hover {\n color: var(--punica-color-primary);\n}\n.sort:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n.sort .icon {\n flex: none;\n opacity: 0;\n transition: transform var(--punica-duration) var(--punica-ease),\n opacity var(--punica-duration) var(--punica-ease);\n}\n.sort:hover .icon,\n.sort:focus-visible .icon {\n opacity: 0.5;\n}\n[aria-sort='ascending'] .sort .icon,\n[aria-sort='descending'] .sort .icon {\n opacity: 1;\n}\n[aria-sort='descending'] .sort .icon {\n transform: rotate(180deg);\n}\n\n@media (forced-colors: active) {\n .cell {\n border-block-end-color: CanvasText;\n }\n .body .row[aria-selected='true'] {\n background: Highlight;\n color: HighlightText;\n forced-color-adjust: none;\n }\n .viewport:focus-visible,\n .body .row:focus-visible,\n .sort:focus-visible {\n outline-color: Highlight;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/virtualTable/virtualTable.js
|
|
16
|
+
var PunicaVirtualTable = class extends PunicaElement {
|
|
17
|
+
static properties = {
|
|
18
|
+
columns: { type: Array, attribute: false },
|
|
19
|
+
rows: { type: Array, attribute: false },
|
|
20
|
+
value: { type: Object, attribute: false },
|
|
21
|
+
rowHeight: { type: Number, default: 48 },
|
|
22
|
+
overscan: { type: Number, default: 6 },
|
|
23
|
+
label: {},
|
|
24
|
+
selectable: { type: Boolean },
|
|
25
|
+
rowKey: {},
|
|
26
|
+
sortColumn: {},
|
|
27
|
+
sortDirection: { default: "ascending" }
|
|
28
|
+
};
|
|
29
|
+
static styles = virtualTable_default;
|
|
30
|
+
static template = `
|
|
31
|
+
<div part="viewport" class="viewport" role="table">
|
|
32
|
+
<div class="inner" role="none">
|
|
33
|
+
<div part="header" class="header" role="rowgroup">
|
|
34
|
+
<div class="row" role="row" aria-rowindex="1"></div>
|
|
35
|
+
</div>
|
|
36
|
+
<div part="body" class="body" role="rowgroup"></div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<template>${icons.chevronUp}</template>
|
|
40
|
+
`;
|
|
41
|
+
#viewport = this.$(".viewport");
|
|
42
|
+
#inner = this.$(".inner");
|
|
43
|
+
#header = this.$(".header");
|
|
44
|
+
#headRow = this.$(".header .row");
|
|
45
|
+
#body = this.$(".body");
|
|
46
|
+
#icon = this.$("template");
|
|
47
|
+
/** Mounted rows. @type {Map<number, { el: HTMLElement, row: unknown, epoch: number }>} */
|
|
48
|
+
#mounted = /* @__PURE__ */ new Map();
|
|
49
|
+
/** @type {ResizeObserver | null} */
|
|
50
|
+
#resize = null;
|
|
51
|
+
/** Bumped whenever every mounted row must be rebuilt. */
|
|
52
|
+
#epoch = 0;
|
|
53
|
+
#active = 0;
|
|
54
|
+
#start = -1;
|
|
55
|
+
#end = -1;
|
|
56
|
+
#nearEnd = false;
|
|
57
|
+
/** Index of a row rebuilt while it had focus. @type {number | null} */
|
|
58
|
+
#refocus = null;
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
this.#viewport.addEventListener("scroll", () => this.#render(), { passive: true });
|
|
62
|
+
this.#headRow.addEventListener("click", (event) => this.#onHeaderClick(event));
|
|
63
|
+
this.#body.addEventListener("click", (event) => this.#onRowClick(event));
|
|
64
|
+
this.#body.addEventListener("keydown", (event) => this.#onRowKeydown(event));
|
|
65
|
+
}
|
|
66
|
+
connected() {
|
|
67
|
+
this.#resize = new ResizeObserver(() => this.#render());
|
|
68
|
+
this.#resize.observe(this.#viewport);
|
|
69
|
+
this.#resize.observe(this.#header);
|
|
70
|
+
}
|
|
71
|
+
disconnected() {
|
|
72
|
+
this.#resize?.disconnect();
|
|
73
|
+
this.#resize = null;
|
|
74
|
+
}
|
|
75
|
+
update(changed) {
|
|
76
|
+
const viewport = this.#viewport;
|
|
77
|
+
const columns = this.#columns;
|
|
78
|
+
if (this.label) viewport.setAttribute("aria-label", this.label);
|
|
79
|
+
else viewport.removeAttribute("aria-label");
|
|
80
|
+
viewport.setAttribute("role", this.selectable ? "grid" : "table");
|
|
81
|
+
if (this.selectable) viewport.removeAttribute("tabindex");
|
|
82
|
+
else viewport.tabIndex = 0;
|
|
83
|
+
viewport.setAttribute("aria-colcount", String(columns.length));
|
|
84
|
+
viewport.setAttribute("aria-rowcount", String(this.#rows.length + 1));
|
|
85
|
+
if (changed.has("columns")) {
|
|
86
|
+
this.#inner.style.setProperty("--_columns", columns.map(track).join(" "));
|
|
87
|
+
this.#buildHeader();
|
|
88
|
+
}
|
|
89
|
+
if (changed.has("columns") || changed.has("sortColumn") || changed.has("sortDirection")) {
|
|
90
|
+
this.#syncSort();
|
|
91
|
+
}
|
|
92
|
+
if (changed.has("columns") || changed.has("selectable")) {
|
|
93
|
+
this.#epoch++;
|
|
94
|
+
}
|
|
95
|
+
if (changed.has("rows")) {
|
|
96
|
+
this.#nearEnd = false;
|
|
97
|
+
this.#active = Math.max(0, Math.min(this.#active, this.#rows.length - 1));
|
|
98
|
+
}
|
|
99
|
+
if ((changed.has("value") || changed.has("rows") || changed.has("rowKey")) && this.selectable) {
|
|
100
|
+
const rows = this.#rows;
|
|
101
|
+
if (this.value != null && !this.#isSelected(rows[this.#active], this.#active)) {
|
|
102
|
+
const index = rows.findIndex((row, i) => this.#isSelected(row, i));
|
|
103
|
+
if (index >= 0) this.#active = index;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
this.#render();
|
|
107
|
+
if (changed.has("value")) {
|
|
108
|
+
for (const toolbar of selectionToolbars(this)) toolbar.requestUpdate?.();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
get selectedValues() {
|
|
112
|
+
return this.value == null ? [] : [this.value];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Clears the selection. Like any change made from code, it fires nothing.
|
|
116
|
+
*/
|
|
117
|
+
clearSelection() {
|
|
118
|
+
this.value = null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A person cleared the selection from a selection toolbar.
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
userClear() {
|
|
125
|
+
this.value = null;
|
|
126
|
+
this.emit("select", { value: null, item: null });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Moves focus into the table: to the current row of a `selectable` grid,
|
|
130
|
+
* else to the scroller, which scrolls with the keyboard.
|
|
131
|
+
* @param {FocusOptions} [options]
|
|
132
|
+
*/
|
|
133
|
+
focus(options) {
|
|
134
|
+
if (this.selectable && this.#rows.length) {
|
|
135
|
+
this.#render();
|
|
136
|
+
this.#mounted.get(this.#active)?.el.focus(options);
|
|
137
|
+
} else {
|
|
138
|
+
this.#viewport.focus(options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** The first row index in view and the one after the last, without overscan. */
|
|
142
|
+
get range() {
|
|
143
|
+
return { start: Math.max(0, this.#start), end: Math.max(0, this.#end) };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Scrolls a row into view.
|
|
147
|
+
* @param {number} index
|
|
148
|
+
* @param {{ align?: 'start' | 'center' | 'end' | 'nearest' }} [options]
|
|
149
|
+
* Where the row lands under the header, `start` by default; `nearest`
|
|
150
|
+
* scrolls only as far as needed and not at all for a row already in view.
|
|
151
|
+
*/
|
|
152
|
+
scrollToIndex(index, options = {}) {
|
|
153
|
+
const count = this.#rows.length;
|
|
154
|
+
if (!count) return;
|
|
155
|
+
const i = Math.max(0, Math.min(count - 1, Math.trunc(Number(index)) || 0));
|
|
156
|
+
const h = this.#height;
|
|
157
|
+
const view = this.#view;
|
|
158
|
+
const top = i * h;
|
|
159
|
+
const current = this.#viewport.scrollTop;
|
|
160
|
+
let target = top;
|
|
161
|
+
const align = options.align || "start";
|
|
162
|
+
if (align === "center") target = top - (view - h) / 2;
|
|
163
|
+
else if (align === "end") target = top - (view - h);
|
|
164
|
+
else if (align === "nearest") {
|
|
165
|
+
if (top < current) target = top;
|
|
166
|
+
else if (top + h > current + view) target = top - (view - h);
|
|
167
|
+
else target = current;
|
|
168
|
+
}
|
|
169
|
+
this.#viewport.scrollTop = Math.max(0, target);
|
|
170
|
+
this.#render();
|
|
171
|
+
}
|
|
172
|
+
/** @returns {VirtualTableColumn[]} */
|
|
173
|
+
get #columns() {
|
|
174
|
+
return Array.isArray(this.columns) ? this.columns.filter((c) => c && c.key != null) : [];
|
|
175
|
+
}
|
|
176
|
+
get #rows() {
|
|
177
|
+
return Array.isArray(this.rows) ? this.rows : [];
|
|
178
|
+
}
|
|
179
|
+
get #height() {
|
|
180
|
+
return Math.max(1, this.rowHeight || 48);
|
|
181
|
+
}
|
|
182
|
+
/** Block size of the body's visible part: the scroller less the header. */
|
|
183
|
+
get #view() {
|
|
184
|
+
return Math.max(0, this.#viewport.clientHeight - this.#header.offsetHeight);
|
|
185
|
+
}
|
|
186
|
+
#key(row, index) {
|
|
187
|
+
const field = this.rowKey;
|
|
188
|
+
return field && row != null && row[field] != null ? row[field] : index;
|
|
189
|
+
}
|
|
190
|
+
#isSelected(row, index) {
|
|
191
|
+
return this.value != null && String(this.#key(row, index)) === String(this.value);
|
|
192
|
+
}
|
|
193
|
+
#buildHeader() {
|
|
194
|
+
const cells = this.#columns.map((column) => {
|
|
195
|
+
const cell = document.createElement("div");
|
|
196
|
+
cell.className = "cell";
|
|
197
|
+
cell.setAttribute("part", "header-cell");
|
|
198
|
+
cell.setAttribute("role", "columnheader");
|
|
199
|
+
cell.dataset.key = String(column.key);
|
|
200
|
+
if (column.align) cell.dataset.align = column.align;
|
|
201
|
+
const text = document.createElement("span");
|
|
202
|
+
text.className = "text";
|
|
203
|
+
text.textContent = column.label == null ? "" : String(column.label);
|
|
204
|
+
if (column.sortable) {
|
|
205
|
+
const button = document.createElement("button");
|
|
206
|
+
button.type = "button";
|
|
207
|
+
button.className = "sort";
|
|
208
|
+
button.setAttribute("part", "sort-button");
|
|
209
|
+
button.append(text, this.#icon.content.cloneNode(true));
|
|
210
|
+
cell.appendChild(button);
|
|
211
|
+
} else {
|
|
212
|
+
cell.appendChild(text);
|
|
213
|
+
}
|
|
214
|
+
return cell;
|
|
215
|
+
});
|
|
216
|
+
this.#headRow.replaceChildren(...cells);
|
|
217
|
+
this.#header.hidden = !cells.length;
|
|
218
|
+
}
|
|
219
|
+
#syncSort() {
|
|
220
|
+
const columns = this.#columns;
|
|
221
|
+
[...this.#headRow.children].forEach((cell, i) => {
|
|
222
|
+
const column = columns[i];
|
|
223
|
+
if (!column?.sortable) return cell.removeAttribute("aria-sort");
|
|
224
|
+
const sorted = this.sortColumn != null && String(column.key) === this.sortColumn;
|
|
225
|
+
cell.setAttribute("aria-sort", sorted ? direction(this.sortDirection) : "none");
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
#render() {
|
|
229
|
+
const rows = this.#rows;
|
|
230
|
+
const columns = this.#columns;
|
|
231
|
+
const count = rows.length;
|
|
232
|
+
const h = this.#height;
|
|
233
|
+
const overscan = Math.max(0, Math.trunc(this.overscan ?? 6));
|
|
234
|
+
const viewport = this.#viewport;
|
|
235
|
+
const body = this.#body;
|
|
236
|
+
const total = `${count * h}px`;
|
|
237
|
+
if (body.style.blockSize !== total) body.style.blockSize = total;
|
|
238
|
+
const view = this.#view;
|
|
239
|
+
const top = Math.min(viewport.scrollTop, Math.max(0, count * h - view));
|
|
240
|
+
const start = Math.min(count, Math.max(0, Math.floor(top / h)));
|
|
241
|
+
const end = Math.min(count, Math.max(start, Math.ceil((top + view) / h)));
|
|
242
|
+
const from = Math.max(0, start - overscan);
|
|
243
|
+
const to = Math.min(count, end + overscan);
|
|
244
|
+
const selectable = this.selectable;
|
|
245
|
+
const active = this.shadowRoot.activeElement;
|
|
246
|
+
for (const [index, entry] of this.#mounted) {
|
|
247
|
+
const stale = index >= count || entry.row !== rows[index] || entry.epoch !== this.#epoch;
|
|
248
|
+
const outside = index < from || index >= to;
|
|
249
|
+
const keep = !stale && outside && (active && entry.el.contains(active) || selectable && index === this.#active);
|
|
250
|
+
if (stale || outside && !keep) {
|
|
251
|
+
if (stale && index < count && entry.el === active) this.#refocus = index;
|
|
252
|
+
entry.el.remove();
|
|
253
|
+
this.#mounted.delete(index);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const wanted = [];
|
|
257
|
+
for (let index = from; index < to; index++) wanted.push(index);
|
|
258
|
+
if (selectable && count && (this.#active < from || this.#active >= to)) wanted.push(this.#active);
|
|
259
|
+
for (const index of wanted) {
|
|
260
|
+
if (this.#mounted.has(index)) continue;
|
|
261
|
+
const row = rows[index];
|
|
262
|
+
const el = document.createElement("div");
|
|
263
|
+
el.className = "row";
|
|
264
|
+
el.setAttribute("part", "row");
|
|
265
|
+
el.setAttribute("role", "row");
|
|
266
|
+
el.setAttribute("aria-rowindex", String(index + 2));
|
|
267
|
+
el.dataset.index = String(index);
|
|
268
|
+
for (const column of columns) {
|
|
269
|
+
const cell = document.createElement("div");
|
|
270
|
+
cell.className = "cell";
|
|
271
|
+
cell.setAttribute("part", "cell");
|
|
272
|
+
cell.setAttribute("role", selectable ? "gridcell" : "cell");
|
|
273
|
+
if (column.align) cell.dataset.align = column.align;
|
|
274
|
+
const content = typeof column.render === "function" ? column.render(row, index, column) : row?.[column.key];
|
|
275
|
+
if (content instanceof Node) cell.appendChild(content);
|
|
276
|
+
else {
|
|
277
|
+
const text = document.createElement("span");
|
|
278
|
+
text.className = "text";
|
|
279
|
+
text.textContent = content == null ? "" : String(content);
|
|
280
|
+
cell.appendChild(text);
|
|
281
|
+
}
|
|
282
|
+
el.appendChild(cell);
|
|
283
|
+
}
|
|
284
|
+
this.#mounted.set(index, { el, row, epoch: this.#epoch });
|
|
285
|
+
body.insertBefore(el, this.#after(index));
|
|
286
|
+
}
|
|
287
|
+
for (const [index, entry] of this.#mounted) {
|
|
288
|
+
const { el } = entry;
|
|
289
|
+
const offset = `${index * h}px`;
|
|
290
|
+
if (el.style.insetBlockStart !== offset) el.style.insetBlockStart = offset;
|
|
291
|
+
if (el.style.blockSize !== `${h}px`) el.style.blockSize = `${h}px`;
|
|
292
|
+
el.classList.toggle("last", index === count - 1);
|
|
293
|
+
if (selectable) {
|
|
294
|
+
el.tabIndex = index === this.#active ? 0 : -1;
|
|
295
|
+
el.setAttribute("aria-selected", String(this.#isSelected(entry.row, index)));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (this.#refocus != null) {
|
|
299
|
+
const index = this.#refocus;
|
|
300
|
+
this.#refocus = null;
|
|
301
|
+
this.#mounted.get(index)?.el.focus({ preventScroll: true });
|
|
302
|
+
}
|
|
303
|
+
if (start !== this.#start || end !== this.#end) {
|
|
304
|
+
this.#start = start;
|
|
305
|
+
this.#end = end;
|
|
306
|
+
this.emit("range-change", { start, end });
|
|
307
|
+
}
|
|
308
|
+
if (count && view && !this.#nearEnd && count - end <= Math.max(overscan, end - start)) {
|
|
309
|
+
this.#nearEnd = true;
|
|
310
|
+
this.emit("near-end", { end });
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/** The mounted row that follows `index` in document order, if any. */
|
|
314
|
+
#after(index) {
|
|
315
|
+
let best = Infinity;
|
|
316
|
+
for (const i of this.#mounted.keys()) if (i > index && i < best) best = i;
|
|
317
|
+
return best === Infinity ? null : this.#mounted.get(best).el;
|
|
318
|
+
}
|
|
319
|
+
#onHeaderClick(event) {
|
|
320
|
+
const button = (
|
|
321
|
+
/** @type {Element} */
|
|
322
|
+
event.target.closest?.(".sort")
|
|
323
|
+
);
|
|
324
|
+
if (!button) return;
|
|
325
|
+
const key = button.parentElement.dataset.key;
|
|
326
|
+
const column = this.#columns.find((c) => String(c.key) === key);
|
|
327
|
+
if (!column) return;
|
|
328
|
+
const same = this.sortColumn === key;
|
|
329
|
+
const next = same && direction(this.sortDirection) === "ascending" ? "descending" : "ascending";
|
|
330
|
+
const sent = this.emit("sort", { column: column.key, direction: next }, { cancelable: true });
|
|
331
|
+
if (sent.defaultPrevented) return;
|
|
332
|
+
this.sortColumn = key;
|
|
333
|
+
this.sortDirection = next;
|
|
334
|
+
}
|
|
335
|
+
/** @param {Event} event */
|
|
336
|
+
#rowOf(event) {
|
|
337
|
+
const el = (
|
|
338
|
+
/** @type {Element} */
|
|
339
|
+
event.target.closest?.(".row")
|
|
340
|
+
);
|
|
341
|
+
return el && this.#body.contains(el) ? (
|
|
342
|
+
/** @type {HTMLElement} */
|
|
343
|
+
el
|
|
344
|
+
) : null;
|
|
345
|
+
}
|
|
346
|
+
#onRowClick(event) {
|
|
347
|
+
if (!this.selectable) return;
|
|
348
|
+
const el = this.#rowOf(event);
|
|
349
|
+
if (!el) return;
|
|
350
|
+
const path = event.composedPath();
|
|
351
|
+
const inside = path.slice(0, path.indexOf(el));
|
|
352
|
+
const control = 'button, a[href], input, select, textarea, label, [role=button], [role=link], [contenteditable=""], [contenteditable=true]';
|
|
353
|
+
if (inside.some((node) => node instanceof Element && node.matches(control))) return;
|
|
354
|
+
const index = Number(el.dataset.index);
|
|
355
|
+
this.#setActive(index, false);
|
|
356
|
+
this.#select(index);
|
|
357
|
+
}
|
|
358
|
+
#onRowKeydown(event) {
|
|
359
|
+
if (!this.selectable) return;
|
|
360
|
+
const el = this.#rowOf(event);
|
|
361
|
+
if (!el || event.target !== el) return;
|
|
362
|
+
const count = this.#rows.length;
|
|
363
|
+
const index = Number(el.dataset.index);
|
|
364
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
this.#select(index);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const page = Math.max(1, Math.floor(this.#view / this.#height) - 1);
|
|
370
|
+
let next = -1;
|
|
371
|
+
if (event.key === "PageDown") next = Math.min(count - 1, index + page);
|
|
372
|
+
else if (event.key === "PageUp") next = Math.max(0, index - page);
|
|
373
|
+
else next = nextIndex(event, count, index, { orientation: "vertical", loop: false });
|
|
374
|
+
if (next < 0) return;
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
this.#setActive(next, true);
|
|
377
|
+
}
|
|
378
|
+
#setActive(index, focus) {
|
|
379
|
+
this.#active = index;
|
|
380
|
+
if (focus) this.scrollToIndex(index, { align: "nearest" });
|
|
381
|
+
else this.#render();
|
|
382
|
+
if (focus) this.#mounted.get(index)?.el.focus({ preventScroll: true });
|
|
383
|
+
}
|
|
384
|
+
#select(index) {
|
|
385
|
+
const row = this.#rows[index];
|
|
386
|
+
const value = this.#key(row, index);
|
|
387
|
+
this.value = value;
|
|
388
|
+
this.emit("select", { value, item: row });
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
function track(column) {
|
|
392
|
+
const { width } = column;
|
|
393
|
+
if (typeof width === "number" && Number.isFinite(width)) return `${Math.max(0, width)}px`;
|
|
394
|
+
if (typeof width === "string" && width.trim() && !/[;{}]/.test(width)) return width.trim();
|
|
395
|
+
return "minmax(0, 1fr)";
|
|
396
|
+
}
|
|
397
|
+
function selectionToolbars(table) {
|
|
398
|
+
const root = (
|
|
399
|
+
/** @type {Document | ShadowRoot} */
|
|
400
|
+
table.getRootNode()
|
|
401
|
+
);
|
|
402
|
+
if (!table.id || !root.querySelectorAll) return [];
|
|
403
|
+
return [...root.querySelectorAll("punica-table-selection-toolbar[for]")].filter((el) => el.getAttribute("for") === table.id);
|
|
404
|
+
}
|
|
405
|
+
var direction = (value) => value === "descending" ? "descending" : "ascending";
|
|
406
|
+
define("punica-virtual-table", PunicaVirtualTable);
|
|
407
|
+
|
|
408
|
+
export {
|
|
409
|
+
PunicaVirtualTable
|
|
410
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaOption,
|
|
3
|
+
option_default
|
|
4
|
+
} from "./chunk-RQ2NYS2W.js";
|
|
5
|
+
import {
|
|
6
|
+
icons
|
|
7
|
+
} from "./chunk-YSGWORUD.js";
|
|
8
|
+
import {
|
|
9
|
+
define
|
|
10
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
11
|
+
|
|
12
|
+
// src/components/complexSelector/complexOption.css
|
|
13
|
+
var complexOption_default = "/* audit-allow: pointer-without-focus-visible (the row is never focused: the search field keeps focus and :state(active) marks the row) */\n.label {\n display: flex;\n flex-direction: column;\n white-space: normal;\n}\n\n.text,\n.description {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.description {\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-xs);\n}\n\n.description[hidden] {\n display: none;\n}\n\n::slotted([slot='start']) {\n flex: none;\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/complexSelector/complexOption.js
|
|
16
|
+
var PunicaComplexOption = class extends PunicaOption {
|
|
17
|
+
static properties = {
|
|
18
|
+
description: {}
|
|
19
|
+
};
|
|
20
|
+
static styles = [option_default, complexOption_default];
|
|
21
|
+
static template = `
|
|
22
|
+
<slot name="start"></slot>
|
|
23
|
+
<span part="label" class="label">
|
|
24
|
+
<span class="text"><slot><span class="fallback"></span></slot></span>
|
|
25
|
+
<span part="description" class="description" hidden><slot name="description"><span class="description-text"></span></slot></span>
|
|
26
|
+
</span>
|
|
27
|
+
<slot name="end"></slot>
|
|
28
|
+
<span part="check" class="check">${icons.check}</span>
|
|
29
|
+
`;
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.$('slot[name="description"]').addEventListener("slotchange", () => this.requestUpdate());
|
|
33
|
+
}
|
|
34
|
+
/** The text shown for this row: `label`, else its own text, without the description. */
|
|
35
|
+
get text() {
|
|
36
|
+
if (this.label != null) return this.label;
|
|
37
|
+
return [...this.childNodes].filter((n) => !(n.nodeType === 1 && /** @type {Element} */
|
|
38
|
+
n.hasAttribute("slot"))).map((n) => n.textContent).join("").trim().replace(/\s+/g, " ");
|
|
39
|
+
}
|
|
40
|
+
/** The second line as text, for filtering. */
|
|
41
|
+
get descriptionText() {
|
|
42
|
+
if (this.description != null) return this.description;
|
|
43
|
+
const node = this.querySelector(':scope > [slot="description"]');
|
|
44
|
+
return node ? node.textContent.trim() : "";
|
|
45
|
+
}
|
|
46
|
+
update(changed) {
|
|
47
|
+
super.update(changed);
|
|
48
|
+
this.$(".description-text").textContent = this.description ?? "";
|
|
49
|
+
this.$(".description").hidden = !this.descriptionText;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
define("punica-complex-option", PunicaComplexOption);
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
PunicaComplexOption
|
|
56
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/chat/chatMessageBubble.css
|
|
7
|
+
var chatMessageBubble_default = ":host {\n --punica-chat-message-bubble-background: var(--punica-chat-message-surface, var(--punica-color-surface));\n --punica-chat-message-bubble-color: var(--punica-chat-message-on-surface, var(--punica-color-text));\n --punica-chat-message-bubble-border-color: var(--punica-chat-message-border, var(--punica-color-border));\n --punica-chat-message-bubble-radius: var(--punica-radius-lg);\n --punica-chat-message-bubble-padding: var(--punica-space-8) var(--punica-space-14);\n\n display: block;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n\n:host([variant='outlined']) {\n --punica-chat-message-bubble-background: transparent;\n --punica-chat-message-bubble-color: var(--punica-color-text);\n --punica-chat-message-bubble-border-color: var(--punica-chat-message-border, var(--punica-color-border));\n}\n\n:host([variant='plain']) {\n --punica-chat-message-bubble-background: transparent;\n --punica-chat-message-bubble-color: var(--punica-color-text);\n --punica-chat-message-bubble-border-color: transparent;\n --punica-chat-message-bubble-padding: var(--punica-space-0);\n}\n\n.base {\n padding: var(--punica-chat-message-bubble-padding);\n border: var(--punica-border-width) solid var(--punica-chat-message-bubble-border-color);\n border-radius: var(--punica-chat-message-bubble-radius);\n background: var(--punica-chat-message-bubble-background);\n color: var(--punica-chat-message-bubble-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size);\n line-height: var(--punica-line-height);\n overflow-wrap: anywhere;\n}\n\n:host([variant='plain']) .base {\n border-width: 0;\n}\n\n@media (forced-colors: active) {\n :host(:not([variant='plain'])) .base {\n border-color: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/chat/chatMessageBubble.js
|
|
10
|
+
var PunicaChatMessageBubble = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
variant: {}
|
|
13
|
+
};
|
|
14
|
+
static styles = chatMessageBubble_default;
|
|
15
|
+
static template = `<div part="base" class="base"><slot></slot></div>`;
|
|
16
|
+
};
|
|
17
|
+
define("punica-chat-message-bubble", PunicaChatMessageBubble);
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
PunicaChatMessageBubble
|
|
21
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/commandPalette/commandItem.css
|
|
7
|
+
var commandItem_default = "/* audit-allow: pointer-without-focus-visible (the row is never focused: the input keeps focus and :state(active) marks the row) */\n:host {\n --punica-command-item-radius: var(--punica-radius-sm);\n --punica-command-item-padding: var(--punica-space-8) var(--punica-space-12);\n --punica-command-item-highlight: var(--punica-color-selected);\n\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-command-item-padding);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-command-item-radius);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n cursor: pointer;\n user-select: none;\n}\n\n:host(:state(filtered-out)) {\n display: none;\n}\n\n:host(:state(active)) {\n background: var(--punica-command-item-highlight);\n}\n\n:host([disabled]) {\n opacity: var(--punica-disabled-opacity);\n cursor: default;\n pointer-events: none;\n}\n\n.label {\n flex: 1;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n::slotted([slot='shortcut']) {\n flex: none;\n font-family: var(--punica-font-family-mono);\n font-size: var(--punica-font-size-xs);\n}\n\n@media (forced-colors: active) {\n :host(:state(active)) {\n border-color: Highlight;\n }\n :host([disabled]) {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/commandPalette/commandItem.js
|
|
10
|
+
var PunicaCommandItem = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
keywords: {},
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
active: { type: Boolean, attribute: false },
|
|
16
|
+
filteredOut: { type: Boolean, attribute: false }
|
|
17
|
+
};
|
|
18
|
+
static styles = commandItem_default;
|
|
19
|
+
static template = `
|
|
20
|
+
<slot name="start"></slot>
|
|
21
|
+
<span part="label" class="label"><slot></slot></span>
|
|
22
|
+
<slot name="shortcut"></slot>
|
|
23
|
+
`;
|
|
24
|
+
connected() {
|
|
25
|
+
this.internals.role = "option";
|
|
26
|
+
}
|
|
27
|
+
update() {
|
|
28
|
+
this.internals.ariaDisabled = this.disabled ? "true" : null;
|
|
29
|
+
this.internals.ariaSelected = String(this.active);
|
|
30
|
+
this.toggleState("active", this.active);
|
|
31
|
+
this.toggleState("filtered-out", this.filteredOut);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
define("punica-command-item", PunicaCommandItem);
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
PunicaCommandItem
|
|
38
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/icon/icon.css
|
|
10
|
+
var icon_default = ":host {\n --punica-icon-size: 1em;\n --punica-icon-color: currentColor;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n vertical-align: middle;\n color: var(--punica-icon-color);\n font-size: var(--punica-icon-size);\n line-height: 1;\n transition: color var(--punica-duration) var(--punica-ease);\n}\n\n:host([size='xsmall']) {\n --punica-icon-size: 0.75em;\n}\n:host([size='small']) {\n --punica-icon-size: 0.875em;\n}\n:host([size='large']) {\n --punica-icon-size: 1.25em;\n}\n:host([size='xlarge']) {\n --punica-icon-size: 1.5em;\n}\n:host([size='2xlarge']) {\n --punica-icon-size: 2em;\n}\n\n:host([color='primary']) {\n --punica-icon-color: var(--punica-color-primary);\n}\n:host([color='secondary']) {\n --punica-icon-color: var(--punica-color-secondary);\n}\n:host([color='error']) {\n --punica-icon-color: var(--punica-color-error);\n}\n:host([color='warning']) {\n --punica-icon-color: var(--punica-color-warning);\n}\n:host([color='info']) {\n --punica-icon-color: var(--punica-color-info);\n}\n:host([color='success']) {\n --punica-icon-color: var(--punica-color-success);\n}\n:host([color='neutral']) {\n --punica-icon-color: var(--punica-color-text);\n}\n\n.glyph {\n display: contents;\n}\n\nsvg {\n display: block;\n flex: none;\n}\n\n::slotted(svg) {\n inline-size: 1em;\n block-size: 1em;\n fill: currentColor;\n}\n\n@media (forced-colors: active) {\n :host {\n --punica-icon-color: CanvasText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/icon/icon.js
|
|
13
|
+
var parsed = /* @__PURE__ */ new Map();
|
|
14
|
+
function glyph(name) {
|
|
15
|
+
if (!name || !Object.hasOwn(icons, name)) return null;
|
|
16
|
+
let source = parsed.get(name);
|
|
17
|
+
if (!source) {
|
|
18
|
+
source = new DOMParser().parseFromString(icons[name], "text/html").body.firstElementChild;
|
|
19
|
+
parsed.set(name, source);
|
|
20
|
+
}
|
|
21
|
+
return document.importNode(source, true);
|
|
22
|
+
}
|
|
23
|
+
var PunicaIcon = class extends PunicaElement {
|
|
24
|
+
static properties = {
|
|
25
|
+
name: {},
|
|
26
|
+
label: {},
|
|
27
|
+
size: {},
|
|
28
|
+
color: {}
|
|
29
|
+
};
|
|
30
|
+
static styles = icon_default;
|
|
31
|
+
static template = `<span class="glyph"></span><slot></slot>`;
|
|
32
|
+
#glyph = this.$(".glyph");
|
|
33
|
+
update(changed) {
|
|
34
|
+
if (changed.has("name")) {
|
|
35
|
+
const svg = glyph(this.name);
|
|
36
|
+
if (svg) this.#glyph.replaceChildren(svg);
|
|
37
|
+
else this.#glyph.replaceChildren();
|
|
38
|
+
}
|
|
39
|
+
const internals = this.internals;
|
|
40
|
+
if (this.label) {
|
|
41
|
+
internals.role = "img";
|
|
42
|
+
internals.ariaLabel = this.label;
|
|
43
|
+
internals.ariaHidden = null;
|
|
44
|
+
} else {
|
|
45
|
+
internals.role = null;
|
|
46
|
+
internals.ariaLabel = null;
|
|
47
|
+
internals.ariaHidden = "true";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
define("punica-icon", PunicaIcon);
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
PunicaIcon
|
|
55
|
+
};
|