@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,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/pagination/pagination.css
|
|
10
|
+
var pagination_default = ":host {\n --punica-pagination-gap: var(--punica-space-4);\n --punica-pagination-size: var(--punica-size-sm);\n --punica-pagination-radius: var(--punica-radius);\n --punica-pagination-current-background: var(--punica-color-primary);\n --punica-pagination-current-color: var(--punica-color-on-accent);\n\n display: inline-block;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n}\n\n.list {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--punica-pagination-gap);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-inline-size: var(--punica-pagination-size);\n block-size: var(--punica-pagination-size);\n padding-inline: var(--punica-space-6);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-pagination-radius);\n font: inherit;\n font-weight: var(--punica-font-weight-semi-bold);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration) var(--punica-ease);\n}\n\nbutton:hover {\n background: var(--punica-color-hover);\n}\n\nbutton[aria-current='page'] {\n background: var(--punica-pagination-current-background);\n color: var(--punica-pagination-current-color);\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\nbutton:disabled:hover:not([aria-current]) {\n background: none;\n}\n\n.ellipsis {\n min-inline-size: var(--punica-pagination-size);\n text-align: center;\n color: var(--punica-color-text-muted);\n}\n\n:host(:dir(rtl)) .previous .icon,\n:host(:dir(rtl)) .next .icon {\n transform: scaleX(-1);\n}\n\n@media (forced-colors: active) {\n button[aria-current='page'] {\n border-color: Highlight;\n }\n button:disabled {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/pagination/pagination.js
|
|
13
|
+
var PunicaPagination = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
label: { default: "Pagination" },
|
|
16
|
+
page: { type: Number, default: 1 },
|
|
17
|
+
totalCount: { type: Number, default: 0 },
|
|
18
|
+
pageSize: { type: Number, default: 10 },
|
|
19
|
+
siblingCount: { type: Number, default: 1 },
|
|
20
|
+
disabled: { type: Boolean },
|
|
21
|
+
labelPrevious: { default: "Previous page" },
|
|
22
|
+
labelNext: { default: "Next page" },
|
|
23
|
+
labelPage: { default: "Page {page}" }
|
|
24
|
+
};
|
|
25
|
+
static styles = pagination_default;
|
|
26
|
+
static shadowOptions = { delegatesFocus: true };
|
|
27
|
+
static template = `
|
|
28
|
+
<nav part="base">
|
|
29
|
+
<ul part="list" class="list">
|
|
30
|
+
<li><button part="previous" class="previous" type="button"><slot name="previous">${icons.chevronStart}</slot></button></li>
|
|
31
|
+
<li class="next-item"><button part="next" class="next" type="button"><slot name="next">${icons.chevronEnd}</slot></button></li>
|
|
32
|
+
</ul>
|
|
33
|
+
</nav>
|
|
34
|
+
`;
|
|
35
|
+
#nav = this.$("nav");
|
|
36
|
+
#list = this.$(".list");
|
|
37
|
+
#previous = this.$(".previous");
|
|
38
|
+
#next = this.$(".next");
|
|
39
|
+
#nextItem = this.$(".next-item");
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.#list.addEventListener("click", (event) => {
|
|
43
|
+
const button = (
|
|
44
|
+
/** @type {Element} */
|
|
45
|
+
event.target.closest("button")
|
|
46
|
+
);
|
|
47
|
+
if (!button || button.disabled || this.disabled) return;
|
|
48
|
+
if (button === this.#previous) this.#go(this.currentPage - 1);
|
|
49
|
+
else if (button === this.#next) this.#go(this.currentPage + 1);
|
|
50
|
+
else this.#go(Number(button.dataset.page));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Number of pages. */
|
|
54
|
+
get pageCount() {
|
|
55
|
+
const size = this.pageSize > 0 ? this.pageSize : 10;
|
|
56
|
+
return Math.max(0, Math.ceil((this.totalCount || 0) / size));
|
|
57
|
+
}
|
|
58
|
+
/** The current page, kept inside 1 and `pageCount`. */
|
|
59
|
+
get currentPage() {
|
|
60
|
+
return Math.min(Math.max(1, Math.round(this.page || 1)), Math.max(1, this.pageCount));
|
|
61
|
+
}
|
|
62
|
+
#go(page) {
|
|
63
|
+
const next = Math.min(Math.max(1, page), Math.max(1, this.pageCount));
|
|
64
|
+
if (next === this.currentPage) return;
|
|
65
|
+
this.page = next;
|
|
66
|
+
this.emit("change", { page: next, value: next });
|
|
67
|
+
}
|
|
68
|
+
update() {
|
|
69
|
+
const count = this.pageCount;
|
|
70
|
+
const page = this.currentPage;
|
|
71
|
+
const format = new Intl.NumberFormat(this.closest("[lang]")?.lang || navigator.language);
|
|
72
|
+
const active = this.shadowRoot.activeElement;
|
|
73
|
+
this.#nav.setAttribute("aria-label", this.label);
|
|
74
|
+
this.#previous.setAttribute("aria-label", this.labelPrevious);
|
|
75
|
+
this.#next.setAttribute("aria-label", this.labelNext);
|
|
76
|
+
this.#previous.disabled = this.disabled || page <= 1;
|
|
77
|
+
this.#next.disabled = this.disabled || page >= count;
|
|
78
|
+
for (const old of this.#list.querySelectorAll(".page-item")) old.remove();
|
|
79
|
+
let current = null;
|
|
80
|
+
for (const entry of pageList(page, count, Math.max(0, this.siblingCount ?? 1))) {
|
|
81
|
+
const li = document.createElement("li");
|
|
82
|
+
li.className = "page-item";
|
|
83
|
+
if (entry === 0) {
|
|
84
|
+
li.setAttribute("part", "ellipsis");
|
|
85
|
+
li.setAttribute("aria-hidden", "true");
|
|
86
|
+
li.classList.add("ellipsis");
|
|
87
|
+
li.textContent = "\u2026";
|
|
88
|
+
} else {
|
|
89
|
+
const button = document.createElement("button");
|
|
90
|
+
const text = format.format(entry);
|
|
91
|
+
button.type = "button";
|
|
92
|
+
button.className = "page";
|
|
93
|
+
button.dataset.page = String(entry);
|
|
94
|
+
button.textContent = text;
|
|
95
|
+
button.setAttribute("aria-label", this.labelPage.replace("{page}", text));
|
|
96
|
+
button.setAttribute("part", entry === page ? "page current" : "page");
|
|
97
|
+
button.disabled = this.disabled;
|
|
98
|
+
if (entry === page) {
|
|
99
|
+
button.setAttribute("aria-current", "page");
|
|
100
|
+
current = button;
|
|
101
|
+
}
|
|
102
|
+
li.append(button);
|
|
103
|
+
}
|
|
104
|
+
this.#list.insertBefore(li, this.#nextItem);
|
|
105
|
+
}
|
|
106
|
+
if (active && (!active.isConnected || /** @type {any} */
|
|
107
|
+
active.disabled)) current?.focus();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function pageList(page, count, siblings) {
|
|
111
|
+
const range = (from, to) => Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => from + i);
|
|
112
|
+
if (count <= siblings * 2 + 5) return range(1, count);
|
|
113
|
+
const left = Math.max(page - siblings, 1);
|
|
114
|
+
const right = Math.min(page + siblings, count);
|
|
115
|
+
const gapLeft = left > 2;
|
|
116
|
+
const gapRight = right < count - 1;
|
|
117
|
+
if (!gapLeft && gapRight) return [...range(1, 3 + siblings * 2), 0, count];
|
|
118
|
+
if (gapLeft && !gapRight) return [1, 0, ...range(count - (2 + siblings * 2), count)];
|
|
119
|
+
return [1, 0, ...range(left, right), 0, count];
|
|
120
|
+
}
|
|
121
|
+
define("punica-pagination", PunicaPagination);
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
PunicaPagination
|
|
125
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/core/icons.js
|
|
2
|
+
var svg = (path) => `<svg part="icon" class="icon" viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${path}</svg>`;
|
|
3
|
+
var icons = {
|
|
4
|
+
chevronDown: svg('<path d="m6 9 6 6 6-6"/>'),
|
|
5
|
+
chevronUp: svg('<path d="m6 15 6-6 6 6"/>'),
|
|
6
|
+
/** Points to the inline end; mirror it under `:dir(rtl)`. */
|
|
7
|
+
chevronEnd: svg('<path d="m9 6 6 6-6 6"/>'),
|
|
8
|
+
/** Points to the inline start; mirror it under `:dir(rtl)`. */
|
|
9
|
+
chevronStart: svg('<path d="m15 6-6 6 6 6"/>'),
|
|
10
|
+
close: svg('<path d="M6 6l12 12M18 6 6 18"/>'),
|
|
11
|
+
check: svg('<path d="m5 12 5 5 9-10"/>'),
|
|
12
|
+
minus: svg('<path d="M5 12h14"/>'),
|
|
13
|
+
plus: svg('<path d="M12 5v14M5 12h14"/>'),
|
|
14
|
+
search: svg('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),
|
|
15
|
+
calendar: svg('<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 10h18M8 3v4M16 3v4"/>'),
|
|
16
|
+
clock: svg('<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>'),
|
|
17
|
+
more: svg('<circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/>'),
|
|
18
|
+
info: svg('<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>'),
|
|
19
|
+
warning: svg('<path d="M12 3 2 20h20L12 3z"/><path d="M12 10v4M12 17h.01"/>'),
|
|
20
|
+
error: svg('<circle cx="12" cy="12" r="9"/><path d="M12 7v6M12 16h.01"/>'),
|
|
21
|
+
success: svg('<circle cx="12" cy="12" r="9"/><path d="m8 12 3 3 5-6"/>'),
|
|
22
|
+
upload: svg('<path d="M12 16V4M7 9l5-5 5 5M4 20h16"/>'),
|
|
23
|
+
externalLink: svg('<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>'),
|
|
24
|
+
send: svg('<path d="M12 19V5M6 11l6-6 6 6"/>'),
|
|
25
|
+
menu: svg('<path d="M4 6h16M4 12h16M4 18h16"/>'),
|
|
26
|
+
image: svg('<rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="2"/><path d="m21 17-5-5-9 8"/>'),
|
|
27
|
+
mic: svg('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>'),
|
|
28
|
+
stop: svg('<rect x="6" y="6" width="12" height="12" rx="2"/>'),
|
|
29
|
+
play: svg('<path d="M8 5v14l11-7z"/>'),
|
|
30
|
+
pause: svg('<path d="M9 5v14M15 5v14"/>'),
|
|
31
|
+
copy: svg('<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V6a2 2 0 0 1 2-2h9"/>')
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
icons
|
|
36
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Overlay,
|
|
3
|
+
overlayCss
|
|
4
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
5
|
+
import {
|
|
6
|
+
deepActiveElement
|
|
7
|
+
} from "./chunk-4RURT4SK.js";
|
|
8
|
+
import {
|
|
9
|
+
PunicaElement,
|
|
10
|
+
define
|
|
11
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
12
|
+
|
|
13
|
+
// src/components/tooltip/tooltip.css
|
|
14
|
+
var tooltip_default = ":host {\n --punica-tooltip-radius: var(--punica-radius-sm);\n --punica-tooltip-padding: var(--punica-space-4) var(--punica-space-8);\n --punica-tooltip-background: var(--punica-color-surface-raised);\n --punica-tooltip-color: var(--punica-color-text);\n --punica-tooltip-shadow: var(--punica-shadow-xs);\n --punica-tooltip-max-width: 200px;\n\n display: contents;\n}\n\n[part='panel'] {\n inline-size: max-content;\n max-inline-size: var(--punica-tooltip-max-width);\n padding: var(--punica-tooltip-padding);\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-tooltip-radius);\n background: var(--punica-tooltip-background);\n color: var(--punica-tooltip-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n text-align: center;\n overflow-wrap: anywhere;\n box-shadow: var(--punica-tooltip-shadow);\n opacity: 0;\n transition: opacity var(--punica-duration) var(--punica-ease),\n display var(--punica-duration) allow-discrete,\n overlay var(--punica-duration) allow-discrete;\n}\n\n[part='panel']:popover-open,\n[part='panel'][data-open] {\n opacity: 1;\n}\n\n@starting-style {\n [part='panel']:popover-open {\n opacity: 0;\n }\n}\n\n@media (forced-colors: active) {\n [part='panel'] {\n border-color: CanvasText;\n }\n}\n";
|
|
15
|
+
|
|
16
|
+
// src/components/tooltip/tooltip.js
|
|
17
|
+
var PunicaTooltip = class extends PunicaElement {
|
|
18
|
+
static properties = {
|
|
19
|
+
text: {},
|
|
20
|
+
open: { type: Boolean },
|
|
21
|
+
side: { default: "block-start" },
|
|
22
|
+
align: { default: "center" },
|
|
23
|
+
delay: { type: Number, default: 300 },
|
|
24
|
+
offset: { type: Number, default: 6 },
|
|
25
|
+
disabled: { type: Boolean }
|
|
26
|
+
};
|
|
27
|
+
static styles = [overlayCss, tooltip_default];
|
|
28
|
+
static template = `
|
|
29
|
+
<slot></slot>
|
|
30
|
+
<div part="panel" popover="manual" role="tooltip"><slot name="content"><span part="text"></span></slot></div>
|
|
31
|
+
`;
|
|
32
|
+
#panel = this.$('[part="panel"]');
|
|
33
|
+
#text = this.$('[part="text"]');
|
|
34
|
+
#slot = this.$("slot:not([name])");
|
|
35
|
+
#contentSlot = this.$('slot[name="content"]');
|
|
36
|
+
#overlay = new Overlay(this.#panel);
|
|
37
|
+
#showTimer = 0;
|
|
38
|
+
#hideTimer = 0;
|
|
39
|
+
#shown = false;
|
|
40
|
+
#reason = "api";
|
|
41
|
+
/** @type {AbortController | null} */
|
|
42
|
+
#openAbort = null;
|
|
43
|
+
/** What was written on which trigger, to take it back. @type {{ el: Element, linked: boolean } | null} */
|
|
44
|
+
#described = null;
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
const slot = this.#slot;
|
|
48
|
+
slot.addEventListener("slotchange", () => this.#describe());
|
|
49
|
+
this.#contentSlot.addEventListener("slotchange", () => this.#describe());
|
|
50
|
+
slot.addEventListener("pointerover", (event) => {
|
|
51
|
+
if (event.pointerType === "touch") return;
|
|
52
|
+
this.#schedule(true);
|
|
53
|
+
});
|
|
54
|
+
slot.addEventListener("pointerout", (event) => this.#pointerOut(event));
|
|
55
|
+
slot.addEventListener("focusin", () => {
|
|
56
|
+
if (this.disabled || !deepActiveElement()?.matches(":focus-visible")) return;
|
|
57
|
+
clearTimeout(this.#showTimer);
|
|
58
|
+
clearTimeout(this.#hideTimer);
|
|
59
|
+
this.open = true;
|
|
60
|
+
});
|
|
61
|
+
slot.addEventListener("focusout", () => this.hide("blur"));
|
|
62
|
+
this.#panel.addEventListener("pointerover", () => clearTimeout(this.#hideTimer));
|
|
63
|
+
this.#panel.addEventListener("pointerout", (event) => this.#pointerOut(event));
|
|
64
|
+
}
|
|
65
|
+
get #trigger() {
|
|
66
|
+
return this.#slot.assignedElements({ flatten: true })[0] || null;
|
|
67
|
+
}
|
|
68
|
+
/** The floating tooltip element. */
|
|
69
|
+
get panel() {
|
|
70
|
+
return this.#panel;
|
|
71
|
+
}
|
|
72
|
+
/** Shows the tooltip now. */
|
|
73
|
+
show() {
|
|
74
|
+
this.open = true;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Hides the tooltip now.
|
|
78
|
+
* @param {'pointer' | 'blur' | 'escape' | 'api'} [reason]
|
|
79
|
+
*/
|
|
80
|
+
hide(reason = "api") {
|
|
81
|
+
clearTimeout(this.#showTimer);
|
|
82
|
+
clearTimeout(this.#hideTimer);
|
|
83
|
+
if (!this.open) return;
|
|
84
|
+
this.#reason = reason;
|
|
85
|
+
this.open = false;
|
|
86
|
+
}
|
|
87
|
+
connected() {
|
|
88
|
+
this.#describe();
|
|
89
|
+
if (this.open && !this.#shown) {
|
|
90
|
+
queueMicrotask(() => this.isConnected && this.open && !this.#shown && this.#setup());
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
disconnected() {
|
|
94
|
+
clearTimeout(this.#showTimer);
|
|
95
|
+
clearTimeout(this.#hideTimer);
|
|
96
|
+
this.#teardown(false);
|
|
97
|
+
this.#undescribe();
|
|
98
|
+
}
|
|
99
|
+
update(changed) {
|
|
100
|
+
this.#text.textContent = this.text ?? "";
|
|
101
|
+
if (changed.has("text")) this.#describe();
|
|
102
|
+
if (this.open && !this.#shown) this.#setup();
|
|
103
|
+
else if (!this.open && this.#shown) this.#teardown(true);
|
|
104
|
+
else if (this.open) {
|
|
105
|
+
if (changed.has("side") || changed.has("align") || changed.has("offset")) this.#place();
|
|
106
|
+
else if (changed.has("text")) this.#overlay.reposition();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** @param {boolean} show */
|
|
110
|
+
#schedule(show) {
|
|
111
|
+
clearTimeout(this.#showTimer);
|
|
112
|
+
clearTimeout(this.#hideTimer);
|
|
113
|
+
if (show) {
|
|
114
|
+
if (this.open || this.disabled) return;
|
|
115
|
+
this.#showTimer = setTimeout(() => this.open = true, Math.max(0, this.delay));
|
|
116
|
+
} else {
|
|
117
|
+
this.#hideTimer = setTimeout(() => this.hide("pointer"), 100);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** @param {PointerEvent} event */
|
|
121
|
+
#pointerOut(event) {
|
|
122
|
+
const to = (
|
|
123
|
+
/** @type {Node | null} */
|
|
124
|
+
event.relatedTarget
|
|
125
|
+
);
|
|
126
|
+
const trigger = this.#trigger;
|
|
127
|
+
if (to && (trigger?.contains(to) || this.#panel.contains(to) || this.contains(to))) return;
|
|
128
|
+
this.#schedule(false);
|
|
129
|
+
}
|
|
130
|
+
#place() {
|
|
131
|
+
this.#overlay.show(this.#trigger || this, {
|
|
132
|
+
side: (
|
|
133
|
+
/** @type {any} */
|
|
134
|
+
this.side
|
|
135
|
+
),
|
|
136
|
+
align: (
|
|
137
|
+
/** @type {any} */
|
|
138
|
+
this.align
|
|
139
|
+
),
|
|
140
|
+
offset: this.offset
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
#setup() {
|
|
144
|
+
this.#shown = true;
|
|
145
|
+
this.#place();
|
|
146
|
+
this.#openAbort = new AbortController();
|
|
147
|
+
document.addEventListener(
|
|
148
|
+
"keydown",
|
|
149
|
+
(event) => {
|
|
150
|
+
if (event.key === "Escape") this.hide("escape");
|
|
151
|
+
},
|
|
152
|
+
{ capture: true, signal: this.#openAbort.signal }
|
|
153
|
+
);
|
|
154
|
+
this.emit("open");
|
|
155
|
+
}
|
|
156
|
+
/** @param {boolean} announce */
|
|
157
|
+
#teardown(announce) {
|
|
158
|
+
if (!this.#shown) return;
|
|
159
|
+
this.#shown = false;
|
|
160
|
+
this.#openAbort?.abort();
|
|
161
|
+
this.#openAbort = null;
|
|
162
|
+
this.#overlay.hide();
|
|
163
|
+
if (!announce) return;
|
|
164
|
+
const reason = this.#reason;
|
|
165
|
+
this.#reason = "api";
|
|
166
|
+
this.emit("close", { reason });
|
|
167
|
+
}
|
|
168
|
+
/** Ties the trigger to the description. */
|
|
169
|
+
#describe() {
|
|
170
|
+
if (!this.isConnected) return;
|
|
171
|
+
const trigger = this.#trigger;
|
|
172
|
+
if (this.#described && this.#described.el !== trigger) this.#undescribe();
|
|
173
|
+
if (!trigger) return;
|
|
174
|
+
const content = this.#contentSlot.assignedElements({ flatten: true });
|
|
175
|
+
const targets = content.length ? content : [this.#panel];
|
|
176
|
+
const own = trigger.getAttribute("aria-describedby")?.trim();
|
|
177
|
+
let linked = false;
|
|
178
|
+
if ("ariaDescribedByElements" in trigger && !own) {
|
|
179
|
+
trigger.ariaDescribedByElements = targets;
|
|
180
|
+
linked = (trigger.ariaDescribedByElements || []).length === targets.length;
|
|
181
|
+
if (!linked) trigger.ariaDescribedByElements = null;
|
|
182
|
+
}
|
|
183
|
+
if (linked) {
|
|
184
|
+
trigger.removeAttribute("aria-description");
|
|
185
|
+
} else {
|
|
186
|
+
const text = content.length ? content.map((el) => el.textContent.trim()).join(" ") : this.text ?? "";
|
|
187
|
+
if (text) trigger.setAttribute("aria-description", text);
|
|
188
|
+
else trigger.removeAttribute("aria-description");
|
|
189
|
+
}
|
|
190
|
+
this.#described = { el: trigger, linked };
|
|
191
|
+
}
|
|
192
|
+
#undescribe() {
|
|
193
|
+
const described = this.#described;
|
|
194
|
+
this.#described = null;
|
|
195
|
+
if (!described) return;
|
|
196
|
+
if (described.linked) described.el.ariaDescribedByElements = null;
|
|
197
|
+
else described.el.removeAttribute("aria-description");
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
define("punica-tooltip", PunicaTooltip);
|
|
201
|
+
|
|
202
|
+
export {
|
|
203
|
+
PunicaTooltip
|
|
204
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composedContains,
|
|
3
|
+
isRtl,
|
|
4
|
+
nextIndex,
|
|
5
|
+
setRovingTabindex
|
|
6
|
+
} from "./chunk-4RURT4SK.js";
|
|
7
|
+
import {
|
|
8
|
+
PunicaElement,
|
|
9
|
+
define
|
|
10
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
11
|
+
|
|
12
|
+
// src/components/table/tableSelectionToolbar.css
|
|
13
|
+
var tableSelectionToolbar_default = ":host {\n --punica-table-selection-toolbar-background: var(--punica-color-neutral-light);\n --punica-table-selection-toolbar-color: var(--punica-color-text);\n --punica-table-selection-toolbar-radius: var(--punica-radius);\n --punica-table-selection-toolbar-padding: var(--punica-space-4) var(--punica-space-8) var(--punica-space-4)\n var(--punica-space-16);\n --punica-table-selection-toolbar-gap: var(--punica-space-8);\n\n display: block;\n position: relative;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n color: var(--punica-table-selection-toolbar-color);\n}\n\n.bar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--punica-table-selection-toolbar-gap);\n min-block-size: var(--punica-size-lg);\n padding: var(--punica-table-selection-toolbar-padding);\n border-radius: var(--punica-table-selection-toolbar-radius);\n background: var(--punica-table-selection-toolbar-background);\n}\n\n:host(:state(empty)) .bar {\n display: none;\n}\n\n.count {\n /* The pattern's own words set its direction, whatever the page's. */\n unicode-bidi: plaintext;\n font-weight: var(--punica-font-weight-semi-bold);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n}\n\n.actions {\n display: flex;\n flex: 1 1 auto;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--punica-table-selection-toolbar-gap);\n min-inline-size: 0;\n}\n\n.clear {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n min-block-size: var(--punica-size-sm);\n padding-inline: var(--punica-space-8);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-radius-sm);\n color: var(--punica-color-primary);\n font: inherit;\n font-weight: var(--punica-font-weight-semi-bold);\n white-space: nowrap;\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.clear:hover {\n background: var(--punica-color-hover);\n}\n\n.clear:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n/* Heard, never seen. */\n.status {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@media (forced-colors: active) {\n .bar {\n border: var(--punica-border-width) solid CanvasText;\n }\n .clear {\n color: LinkText;\n }\n .clear:focus-visible {\n outline-color: Highlight;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/table/tableSelectionToolbar.js
|
|
16
|
+
var CONTROL = 'a[href],button,input:not([type="hidden"]),select,textarea,[tabindex],[contenteditable="true"]';
|
|
17
|
+
var TEXT_ENTRY = 'input:not([type="button"],[type="checkbox"],[type="radio"],[type="submit"],[type="reset"],[type="image"],[type="file"],[type="color"]),textarea,select,[contenteditable="true"]';
|
|
18
|
+
var PunicaTableSelectionToolbar = class extends PunicaElement {
|
|
19
|
+
static properties = {
|
|
20
|
+
for: {},
|
|
21
|
+
label: { default: "Bulk actions" },
|
|
22
|
+
labelSelected: { default: "{count} selected" },
|
|
23
|
+
labelClear: { default: "Clear selection" }
|
|
24
|
+
};
|
|
25
|
+
static styles = tableSelectionToolbar_default;
|
|
26
|
+
static template = `
|
|
27
|
+
<div part="base" class="bar">
|
|
28
|
+
<span part="count" class="count"></span>
|
|
29
|
+
<div part="actions" class="actions"><slot></slot></div>
|
|
30
|
+
<button part="clear-button" class="clear" type="button"></button>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="status" role="status"></div>
|
|
33
|
+
`;
|
|
34
|
+
#count = this.$(".count");
|
|
35
|
+
#clear = this.$(".clear");
|
|
36
|
+
#status = this.$(".status");
|
|
37
|
+
/** @type {HTMLElement | null} */
|
|
38
|
+
#active = null;
|
|
39
|
+
/** @type {any} */
|
|
40
|
+
#table = null;
|
|
41
|
+
/** @type {AbortController | null} */
|
|
42
|
+
#tableListeners = null;
|
|
43
|
+
/** The count last written, -1 before the first. */
|
|
44
|
+
#shown = -1;
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this.shadowRoot.addEventListener("slotchange", () => this.#rove());
|
|
48
|
+
this.#clear.addEventListener("click", () => this.#onClear());
|
|
49
|
+
this.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
50
|
+
this.addEventListener("focusin", (event) => {
|
|
51
|
+
const items = this.#items();
|
|
52
|
+
const item = this.#itemOf(items, event.composedPath()[0]);
|
|
53
|
+
if (item) {
|
|
54
|
+
this.#active = item;
|
|
55
|
+
setRovingTabindex(items, item);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
disconnected() {
|
|
60
|
+
this.#tableListeners?.abort();
|
|
61
|
+
this.#tableListeners = null;
|
|
62
|
+
this.#table = null;
|
|
63
|
+
this.#shown = -1;
|
|
64
|
+
}
|
|
65
|
+
/** @returns {any} */
|
|
66
|
+
get table() {
|
|
67
|
+
if (this.for) {
|
|
68
|
+
const root = (
|
|
69
|
+
/** @type {Document | ShadowRoot} */
|
|
70
|
+
this.getRootNode()
|
|
71
|
+
);
|
|
72
|
+
return root.getElementById?.(this.for) ?? null;
|
|
73
|
+
}
|
|
74
|
+
return this.closest("punica-table, punica-virtual-table");
|
|
75
|
+
}
|
|
76
|
+
get count() {
|
|
77
|
+
const values = this.table?.selectedValues;
|
|
78
|
+
return Array.isArray(values) ? values.length : 0;
|
|
79
|
+
}
|
|
80
|
+
update() {
|
|
81
|
+
this.#watch();
|
|
82
|
+
const count = this.count;
|
|
83
|
+
const empty = count === 0;
|
|
84
|
+
const lang = this.closest("[lang]")?.lang || navigator.language;
|
|
85
|
+
let number;
|
|
86
|
+
try {
|
|
87
|
+
number = new Intl.NumberFormat(lang).format(count);
|
|
88
|
+
} catch {
|
|
89
|
+
number = String(count);
|
|
90
|
+
}
|
|
91
|
+
const text = String(this.labelSelected).split("{count}").join(number);
|
|
92
|
+
this.#count.textContent = text;
|
|
93
|
+
this.#clear.textContent = this.labelClear;
|
|
94
|
+
if (this.#shown !== -1 && this.#shown !== count) this.#status.textContent = text;
|
|
95
|
+
this.#shown = count;
|
|
96
|
+
const internals = this.internals;
|
|
97
|
+
internals.role = empty ? null : "toolbar";
|
|
98
|
+
internals.ariaLabel = empty ? null : this.label;
|
|
99
|
+
internals.ariaOrientation = empty ? null : "horizontal";
|
|
100
|
+
this.toggleState("empty", empty);
|
|
101
|
+
this.#rove();
|
|
102
|
+
}
|
|
103
|
+
/** Listens to the table it reads for a person's change of selection. */
|
|
104
|
+
#watch() {
|
|
105
|
+
const table = this.isConnected ? this.table : null;
|
|
106
|
+
if (table === this.#table) return;
|
|
107
|
+
this.#tableListeners?.abort();
|
|
108
|
+
this.#tableListeners = null;
|
|
109
|
+
this.#table = table;
|
|
110
|
+
if (!table) return;
|
|
111
|
+
this.#tableListeners = new AbortController();
|
|
112
|
+
const signal = AbortSignal.any([this.#tableListeners.signal, this.signal]);
|
|
113
|
+
table.addEventListener("punica-select", () => this.requestUpdate(), { signal });
|
|
114
|
+
}
|
|
115
|
+
#onClear() {
|
|
116
|
+
const table = this.table;
|
|
117
|
+
if (!table) return;
|
|
118
|
+
const hadFocus = composedContains(this, document.activeElement);
|
|
119
|
+
if (typeof table.userSelect === "function") table.userSelect(null, false);
|
|
120
|
+
else if (typeof table.userClear === "function") table.userClear();
|
|
121
|
+
else table.clearSelection?.();
|
|
122
|
+
this.update();
|
|
123
|
+
if (hadFocus) rowControl(table)?.focus();
|
|
124
|
+
}
|
|
125
|
+
/** The enabled controls: the slotted ones, then the clear button. */
|
|
126
|
+
#items() {
|
|
127
|
+
const items = [];
|
|
128
|
+
const visit = (el) => {
|
|
129
|
+
if (!(el instanceof HTMLElement) || el.hidden || el.hasAttribute("disabled") || el.inert) return;
|
|
130
|
+
if (el.matches(CONTROL) || el.shadowRoot?.delegatesFocus) items.push(el);
|
|
131
|
+
else for (const child of el.children) visit(child);
|
|
132
|
+
};
|
|
133
|
+
for (const el of this.shadowRoot.querySelector("slot").assignedElements({ flatten: true })) visit(el);
|
|
134
|
+
items.push(this.#clear);
|
|
135
|
+
return items;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @param {HTMLElement[]} items
|
|
139
|
+
* @param {EventTarget} origin
|
|
140
|
+
*/
|
|
141
|
+
#itemOf(items, origin) {
|
|
142
|
+
return items.find((item) => composedContains(
|
|
143
|
+
item,
|
|
144
|
+
/** @type {Node} */
|
|
145
|
+
origin
|
|
146
|
+
)) || null;
|
|
147
|
+
}
|
|
148
|
+
#rove() {
|
|
149
|
+
const items = this.#items();
|
|
150
|
+
if (!items.includes(this.#active)) this.#active = null;
|
|
151
|
+
setRovingTabindex(items, this.#active);
|
|
152
|
+
}
|
|
153
|
+
/** @param {KeyboardEvent} event */
|
|
154
|
+
#onKeydown(event) {
|
|
155
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
156
|
+
const origin = event.composedPath()[0];
|
|
157
|
+
if (origin instanceof Element && origin.matches(TEXT_ENTRY)) return;
|
|
158
|
+
const items = this.#items();
|
|
159
|
+
const current = items.indexOf(this.#itemOf(items, origin));
|
|
160
|
+
if (current < 0) return;
|
|
161
|
+
const next = nextIndex(event, items.length, current, { orientation: "horizontal", rtl: isRtl(this) });
|
|
162
|
+
if (next < 0) return;
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
this.#active = items[next];
|
|
165
|
+
setRovingTabindex(items, items[next]);
|
|
166
|
+
items[next].focus();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
function rowControl(table) {
|
|
170
|
+
if (table.localName !== "punica-table") return table;
|
|
171
|
+
const rows = [table.querySelector("punica-table-header punica-table-row"), ...table.rows || []];
|
|
172
|
+
for (const row of rows) {
|
|
173
|
+
const input = row?.shadowRoot?.querySelector("input");
|
|
174
|
+
if (input && !input.hidden && input.checkVisibility()) return input;
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
define("punica-table-selection-toolbar", PunicaTableSelectionToolbar);
|
|
179
|
+
|
|
180
|
+
export {
|
|
181
|
+
PunicaTableSelectionToolbar
|
|
182
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/statusDot/statusDot.css
|
|
7
|
+
var statusDot_default = ":host {\n --punica-status-dot-size: var(--punica-space-6);\n --punica-status-dot-color: var(--punica-color-neutral-dark);\n\n display: inline-block;\n flex: none;\n inline-size: var(--punica-status-dot-size);\n block-size: var(--punica-status-dot-size);\n vertical-align: middle;\n}\n\n:host([color='primary']) {\n --punica-status-dot-color: var(--punica-color-primary);\n}\n:host([color='secondary']) {\n --punica-status-dot-color: var(--punica-color-secondary);\n}\n:host([color='error']) {\n --punica-status-dot-color: var(--punica-color-error);\n}\n:host([color='warning']) {\n --punica-status-dot-color: var(--punica-color-warning);\n}\n:host([color='info']) {\n --punica-status-dot-color: var(--punica-color-info);\n}\n:host([color='success']) {\n --punica-status-dot-color: var(--punica-color-success);\n}\n\n.dot {\n position: relative;\n display: block;\n inline-size: 100%;\n block-size: 100%;\n border-radius: var(--punica-radius-full);\n background: var(--punica-status-dot-color);\n}\n\n:host([pulse]) .dot::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: inherit;\n animation: pulse 1.6s var(--punica-ease) infinite;\n}\n\n@keyframes pulse {\n from {\n opacity: 0.6;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(3);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host([pulse]) .dot::after {\n animation: none;\n opacity: 0.3;\n transform: scale(2);\n }\n}\n\n@media (forced-colors: active) {\n .dot {\n forced-color-adjust: none;\n border: var(--punica-border-width) solid CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/statusDot/statusDot.js
|
|
10
|
+
var PunicaStatusDot = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
color: {},
|
|
13
|
+
label: {},
|
|
14
|
+
pulse: { type: Boolean }
|
|
15
|
+
};
|
|
16
|
+
static styles = statusDot_default;
|
|
17
|
+
static template = `<span part="base" class="dot"></span>`;
|
|
18
|
+
update() {
|
|
19
|
+
const internals = this.internals;
|
|
20
|
+
if (this.label) {
|
|
21
|
+
internals.role = "img";
|
|
22
|
+
internals.ariaLabel = this.label;
|
|
23
|
+
internals.ariaHidden = null;
|
|
24
|
+
} else {
|
|
25
|
+
internals.role = null;
|
|
26
|
+
internals.ariaLabel = null;
|
|
27
|
+
internals.ariaHidden = "true";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
define("punica-status-dot", PunicaStatusDot);
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
PunicaStatusDot
|
|
35
|
+
};
|