@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,336 @@
|
|
|
1
|
+
// src/tokens/tokens.css
|
|
2
|
+
var tokens_default = "/*\n * Punica design tokens.\n *\n * Every token is `--punica-*`. Colors are light-dark() pairs, so they follow\n * the `color-scheme` of the page or of any subtree that sets its own.\n * The whole file sits in a cascade layer: any unlayered declaration a page\n * makes for one of these names wins without a specificity fight.\n */\n@layer punica.tokens {\n :root {\n /* surfaces */\n --punica-color-bg: light-dark(#f6f6fa, #181a1c);\n --punica-color-surface: light-dark(#ffffff, #2a2e30);\n --punica-color-surface-raised: light-dark(#ffffff, #3c4143);\n --punica-color-hover: light-dark(rgb(111 126 140 / 10%), rgb(190 200 210 / 12%));\n --punica-color-selected: light-dark(rgb(85 96 169 / 12%), rgb(140 150 215 / 22%));\n --punica-color-backdrop: light-dark(rgb(44 50 60 / 50%), rgb(0 0 0 / 60%));\n\n /* text */\n --punica-color-text: light-dark(#2d2d56, #d3dadf);\n --punica-color-text-muted: light-dark(#5b6975, #a7b6be);\n --punica-color-text-placeholder: light-dark(#62707c, #98a6af);\n --punica-color-on-accent: light-dark(#ffffff, #101214);\n\n /* lines */\n --punica-color-border: light-dark(#dedede, #5a6063);\n --punica-color-border-strong: light-dark(#9c9c9c, #8a9196);\n --punica-color-focus: light-dark(#1f6fd0, #6db3ff);\n\n /* palettes: <name>-light is a tint, <name> the accent, <name>-dark the shade */\n --punica-color-primary-light: light-dark(#767fba, #7783d6);\n --punica-color-primary: light-dark(#5560a9, #a0a9ee);\n --punica-color-primary-dark: light-dark(#3b4376, #bcc3f5);\n\n --punica-color-secondary-light: light-dark(#e7c1fa, #5a2a78);\n --punica-color-secondary: light-dark(#aa14f0, #d894fa);\n --punica-color-secondary-dark: light-dark(#7d17e3, #e7c1fa);\n\n --punica-color-error-light: light-dark(#fdeded, #4a1f1f);\n --punica-color-error: light-dark(#c62828, #f6908d);\n --punica-color-error-dark: light-dark(#5f2120, #f7b4b2);\n\n --punica-color-warning-light: light-dark(#fff4e5, #4a3110);\n --punica-color-warning: light-dark(#b35000, #ffa23d);\n --punica-color-warning-dark: light-dark(#663c00, #ffd6a3);\n\n --punica-color-info-light: light-dark(#e5f6fd, #0f3547);\n --punica-color-info: light-dark(#01679e, #4db5ea);\n --punica-color-info-dark: light-dark(#014361, #b3e2f7);\n\n --punica-color-success-light: light-dark(#edf7ed, #1c3a1e);\n --punica-color-success: light-dark(#2e7d32, #66bb6a);\n --punica-color-success-dark: light-dark(#1e4620, #b9e0bb);\n\n --punica-color-neutral-light: light-dark(#f5f5f5, #33383a);\n --punica-color-neutral: light-dark(#dedede, #797e81);\n --punica-color-neutral-dark: light-dark(#6f6f6f, #b4babd);\n\n --punica-color-white: #ffffff;\n --punica-color-black: #000000;\n\n /* shape */\n --punica-radius-sm: 4px;\n --punica-radius: 8px;\n --punica-radius-lg: 12px;\n --punica-radius-full: 9999px;\n --punica-padding: 16px;\n --punica-border-width: 1px;\n\n /* focus */\n --punica-focus-ring-width: 2px;\n --punica-focus-ring-offset: 2px;\n --punica-focus-ring: var(--punica-focus-ring-width) solid var(--punica-color-focus);\n\n /* elevation */\n --punica-shadow-xxs: 0 20px 25px -5px rgb(0 0 0 / 5%);\n --punica-shadow-xs: 0 7px 8px rgb(0 0 0 / 8%);\n --punica-shadow-sm: 0 6px 12px rgb(0 0 0 / 11%);\n --punica-shadow-md: 0 9px 18px rgb(0 0 0 / 15%);\n --punica-shadow-lg: 0 13px 37px rgb(0 0 0 / 21%);\n --punica-shadow-xl: 0 20px 56px rgb(0 0 0 / 29%);\n\n /* stacking (only for in-flow layers; overlays use the top layer) */\n --punica-z-sticky: 1000;\n --punica-z-fixed: 1100;\n\n /* type */\n --punica-font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;\n --punica-font-family-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;\n --punica-font-size-xs: 0.75rem;\n --punica-font-size-sm: 0.875rem;\n --punica-font-size: 1rem;\n --punica-font-size-lg: 1.125rem;\n --punica-font-size-xl: 1.25rem;\n --punica-font-size-2xl: 1.5rem;\n --punica-font-size-3xl: 2.125rem;\n --punica-line-height: 1.5;\n --punica-line-height-heading: 1.25;\n --punica-font-weight-thin: 200;\n --punica-font-weight-light: 300;\n --punica-font-weight-regular: 400;\n --punica-font-weight-medium: 500;\n --punica-font-weight-semi-bold: 600;\n --punica-font-weight-bold: 700;\n --punica-font-weight-extra-bold: 800;\n\n /* spacing, named by pixel value */\n --punica-space-0: 0;\n --punica-space-2: 2px;\n --punica-space-4: 4px;\n --punica-space-6: 6px;\n --punica-space-8: 8px;\n --punica-space-10: 10px;\n --punica-space-12: 12px;\n --punica-space-14: 14px;\n --punica-space-16: 16px;\n --punica-space-18: 18px;\n --punica-space-20: 20px;\n --punica-space-22: 22px;\n --punica-space-24: 24px;\n --punica-space-26: 26px;\n --punica-space-28: 28px;\n --punica-space-32: 32px;\n --punica-space-36: 36px;\n --punica-space-40: 40px;\n --punica-space-44: 44px;\n --punica-space-48: 48px;\n --punica-space-56: 56px;\n --punica-space-64: 64px;\n --punica-space-80: 80px;\n --punica-space-96: 96px;\n --punica-space-112: 112px;\n --punica-space-128: 128px;\n --punica-space-144: 144px;\n --punica-space-160: 160px;\n\n /* control heights */\n --punica-size-sm: 28px;\n --punica-size-md: 36px;\n --punica-size-lg: 44px;\n\n /* motion */\n --punica-duration-fast: 120ms;\n --punica-duration: 200ms;\n --punica-duration-slow: 320ms;\n --punica-ease: cubic-bezier(0.2, 0, 0, 1);\n\n --punica-disabled-opacity: 0.4;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :root {\n --punica-duration-fast: 0ms;\n --punica-duration: 0ms;\n --punica-duration-slow: 0ms;\n }\n }\n}\n";
|
|
3
|
+
|
|
4
|
+
// src/core/element.js
|
|
5
|
+
var HAS_DOM = typeof HTMLElement !== "undefined";
|
|
6
|
+
var Base = HAS_DOM ? HTMLElement : (
|
|
7
|
+
/** @type {typeof HTMLElement} */
|
|
8
|
+
class {
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
var BASE_CSS = `
|
|
12
|
+
:host { box-sizing: border-box; }
|
|
13
|
+
:host([hidden]) { display: none !important; }
|
|
14
|
+
/* Chromium maps an align attribute on any element to text-align; here align
|
|
15
|
+
is a placement, never a text alignment. */
|
|
16
|
+
:host([align]) { text-align: inherit; }
|
|
17
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
18
|
+
`;
|
|
19
|
+
var baseSheet;
|
|
20
|
+
var tokensInstalled = false;
|
|
21
|
+
function sheet(text) {
|
|
22
|
+
const s = new CSSStyleSheet();
|
|
23
|
+
s.replaceSync(text);
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
function installTokens() {
|
|
27
|
+
if (tokensInstalled || typeof document === "undefined") return;
|
|
28
|
+
tokensInstalled = true;
|
|
29
|
+
if (document.documentElement.hasAttribute("data-punica-no-tokens")) return;
|
|
30
|
+
document.adoptedStyleSheets = [sheet(tokens_default), ...document.adoptedStyleSheets];
|
|
31
|
+
}
|
|
32
|
+
function define(tag, ctor) {
|
|
33
|
+
if (typeof customElements === "undefined") return;
|
|
34
|
+
if (!customElements.get(tag)) customElements.define(tag, ctor);
|
|
35
|
+
}
|
|
36
|
+
var kebab = (name) => name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
|
|
37
|
+
var uidCounter = 0;
|
|
38
|
+
var uid = (prefix = "punica") => `${prefix}-${++uidCounter}`;
|
|
39
|
+
var PunicaElement = class extends Base {
|
|
40
|
+
/** @type {Record<string, PropertyDeclaration>} */
|
|
41
|
+
static properties = {};
|
|
42
|
+
/** CSS text, or a list of CSS texts. @type {string | string[]} */
|
|
43
|
+
static styles = "";
|
|
44
|
+
/** Static, author-written shadow markup. Never interpolate data into it. */
|
|
45
|
+
static template = "";
|
|
46
|
+
/** Set to false for a light-DOM component. */
|
|
47
|
+
static shadow = true;
|
|
48
|
+
/** @type {Partial<ShadowRootInit>} */
|
|
49
|
+
static shadowOptions = {};
|
|
50
|
+
static finalize() {
|
|
51
|
+
if (Object.hasOwn(this, "_finalized")) return;
|
|
52
|
+
this._finalized = true;
|
|
53
|
+
const parent = Object.getPrototypeOf(this);
|
|
54
|
+
if (typeof parent.finalize === "function") parent.finalize();
|
|
55
|
+
this._props = new Map(parent._props || []);
|
|
56
|
+
this._attrs = new Map(parent._attrs || []);
|
|
57
|
+
const own = Object.hasOwn(this, "properties") ? this.properties : {};
|
|
58
|
+
for (const [name, raw] of Object.entries(own)) {
|
|
59
|
+
const type = raw.type || String;
|
|
60
|
+
const primitive = type === String || type === Boolean || type === Number;
|
|
61
|
+
const attribute = raw.attribute === false ? false : raw.attribute || kebab(name);
|
|
62
|
+
const def = {
|
|
63
|
+
type,
|
|
64
|
+
attribute,
|
|
65
|
+
reflect: raw.reflect ?? (primitive && attribute !== false),
|
|
66
|
+
default: raw.default ?? (type === Boolean ? false : null)
|
|
67
|
+
};
|
|
68
|
+
this._props.set(name, def);
|
|
69
|
+
if (attribute) this._attrs.set(attribute, name);
|
|
70
|
+
Object.defineProperty(this.prototype, name, {
|
|
71
|
+
get() {
|
|
72
|
+
return this._get(name);
|
|
73
|
+
},
|
|
74
|
+
set(value) {
|
|
75
|
+
this._set(name, value);
|
|
76
|
+
},
|
|
77
|
+
configurable: true,
|
|
78
|
+
enumerable: true
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
static get observedAttributes() {
|
|
83
|
+
this.finalize();
|
|
84
|
+
return [...this._attrs.keys()];
|
|
85
|
+
}
|
|
86
|
+
static _sheets() {
|
|
87
|
+
if (!Object.hasOwn(this, "_sheetCache")) {
|
|
88
|
+
baseSheet ||= sheet(BASE_CSS);
|
|
89
|
+
const own = [this.styles].flat().filter(Boolean);
|
|
90
|
+
this._sheetCache = [baseSheet, ...own.map(sheet)];
|
|
91
|
+
}
|
|
92
|
+
return this._sheetCache;
|
|
93
|
+
}
|
|
94
|
+
static _template() {
|
|
95
|
+
if (!Object.hasOwn(this, "_templateCache")) {
|
|
96
|
+
const t = document.createElement("template");
|
|
97
|
+
t.innerHTML = this.template;
|
|
98
|
+
this._templateCache = t;
|
|
99
|
+
}
|
|
100
|
+
return this._templateCache;
|
|
101
|
+
}
|
|
102
|
+
#values = /* @__PURE__ */ new Map();
|
|
103
|
+
/** @type {Map<string, unknown> | null} */
|
|
104
|
+
#pending = null;
|
|
105
|
+
#scheduled = false;
|
|
106
|
+
#updated = false;
|
|
107
|
+
#reflecting = null;
|
|
108
|
+
/** @type {AbortController | null} */
|
|
109
|
+
#abort = null;
|
|
110
|
+
/** @type {ElementInternals | null} */
|
|
111
|
+
#internals = null;
|
|
112
|
+
constructor() {
|
|
113
|
+
super();
|
|
114
|
+
const ctor = (
|
|
115
|
+
/** @type {typeof PunicaElement} */
|
|
116
|
+
this.constructor
|
|
117
|
+
);
|
|
118
|
+
ctor.finalize();
|
|
119
|
+
installTokens();
|
|
120
|
+
if (ctor.shadow) {
|
|
121
|
+
const root = this.attachShadow({ mode: "open", ...ctor.shadowOptions });
|
|
122
|
+
root.adoptedStyleSheets = ctor._sheets();
|
|
123
|
+
if (ctor.template) {
|
|
124
|
+
root.appendChild(document.importNode(ctor._template().content, true));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/* ---------------------------------------------------------------- props */
|
|
129
|
+
_get(name) {
|
|
130
|
+
const def = this.constructor._props.get(name);
|
|
131
|
+
const value = this.#values.get(name);
|
|
132
|
+
return value ?? def.default;
|
|
133
|
+
}
|
|
134
|
+
_set(name, raw) {
|
|
135
|
+
const def = this.constructor._props.get(name);
|
|
136
|
+
const value = convert(raw, def.type);
|
|
137
|
+
const old = this._get(name);
|
|
138
|
+
if (Object.is(old, value ?? def.default)) {
|
|
139
|
+
this.#values.set(name, value);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
this.#values.set(name, value);
|
|
143
|
+
if (def.reflect && def.attribute) {
|
|
144
|
+
this.#reflecting = name;
|
|
145
|
+
try {
|
|
146
|
+
writeAttribute(this, def.attribute, value, def.type);
|
|
147
|
+
} finally {
|
|
148
|
+
this.#reflecting = null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.#changed(name, old);
|
|
152
|
+
}
|
|
153
|
+
attributeChangedCallback(attribute, oldValue, newValue) {
|
|
154
|
+
if (oldValue === newValue) return;
|
|
155
|
+
const ctor = this.constructor;
|
|
156
|
+
const name = ctor._attrs.get(attribute);
|
|
157
|
+
if (!name || this.#reflecting === name) return;
|
|
158
|
+
const def = ctor._props.get(name);
|
|
159
|
+
const old = this._get(name);
|
|
160
|
+
const value = readAttribute(newValue, def.type);
|
|
161
|
+
this.#values.set(name, value);
|
|
162
|
+
if (!Object.is(old, value ?? def.default)) this.#changed(name, old);
|
|
163
|
+
}
|
|
164
|
+
#changed(name, old) {
|
|
165
|
+
this.#pending ||= /* @__PURE__ */ new Map();
|
|
166
|
+
if (!this.#pending.has(name)) this.#pending.set(name, old);
|
|
167
|
+
this.requestUpdate();
|
|
168
|
+
}
|
|
169
|
+
/** Schedules `update()` for the end of the current microtask. */
|
|
170
|
+
requestUpdate() {
|
|
171
|
+
if (this.#scheduled || !this.isConnected || !this.#updated) return;
|
|
172
|
+
this.#scheduled = true;
|
|
173
|
+
queueMicrotask(() => {
|
|
174
|
+
this.#scheduled = false;
|
|
175
|
+
if (this.isConnected) this.#flush();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
#flush() {
|
|
179
|
+
const changed = this.#pending || /* @__PURE__ */ new Map();
|
|
180
|
+
this.#pending = null;
|
|
181
|
+
this.update(changed);
|
|
182
|
+
}
|
|
183
|
+
/** Resolves after the pending update, if any, has run. */
|
|
184
|
+
get updateComplete() {
|
|
185
|
+
return Promise.resolve().then(() => void 0);
|
|
186
|
+
}
|
|
187
|
+
/* ------------------------------------------------------------ lifecycle */
|
|
188
|
+
connectedCallback() {
|
|
189
|
+
const ctor = this.constructor;
|
|
190
|
+
if (!this.#updated) {
|
|
191
|
+
for (const name of ctor._props.keys()) {
|
|
192
|
+
if (Object.hasOwn(this, name)) {
|
|
193
|
+
const value = this[name];
|
|
194
|
+
delete this[name];
|
|
195
|
+
this[name] = value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
this.#abort = new AbortController();
|
|
200
|
+
this.connected();
|
|
201
|
+
if (!this.#updated) {
|
|
202
|
+
this.#updated = true;
|
|
203
|
+
const all = /* @__PURE__ */ new Map();
|
|
204
|
+
for (const name of ctor._props.keys()) all.set(name, void 0);
|
|
205
|
+
this.#pending = null;
|
|
206
|
+
this.update(all);
|
|
207
|
+
this.firstUpdated();
|
|
208
|
+
} else if (this.#pending) {
|
|
209
|
+
this.#flush();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
disconnectedCallback() {
|
|
213
|
+
this.#abort?.abort();
|
|
214
|
+
this.#abort = null;
|
|
215
|
+
this.disconnected();
|
|
216
|
+
}
|
|
217
|
+
/** Runs on every connect, before the update. Add outside listeners here. */
|
|
218
|
+
connected() {
|
|
219
|
+
}
|
|
220
|
+
/** Runs on every disconnect, after `this.signal` aborted. */
|
|
221
|
+
disconnected() {
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Brings the shadow tree in line with the properties.
|
|
225
|
+
* @param {Map<string, unknown>} changed property name → previous value;
|
|
226
|
+
* holds every property on the first run.
|
|
227
|
+
*/
|
|
228
|
+
// eslint-disable-next-line no-unused-vars
|
|
229
|
+
update(changed) {
|
|
230
|
+
}
|
|
231
|
+
/** Runs once, after the first update. */
|
|
232
|
+
firstUpdated() {
|
|
233
|
+
}
|
|
234
|
+
/* -------------------------------------------------------------- helpers */
|
|
235
|
+
/** Aborts on disconnect. Only valid while connected. */
|
|
236
|
+
get signal() {
|
|
237
|
+
return this.#abort?.signal;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* addEventListener that is removed on disconnect.
|
|
241
|
+
* @param {EventTarget} target
|
|
242
|
+
* @param {string} type
|
|
243
|
+
* @param {EventListenerOrEventListenerObject} handler
|
|
244
|
+
* @param {AddEventListenerOptions} [options]
|
|
245
|
+
*/
|
|
246
|
+
listen(target, type, handler, options) {
|
|
247
|
+
target.addEventListener(type, handler, { ...options, signal: this.signal });
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* First match in the shadow root.
|
|
251
|
+
* @param {string} selector
|
|
252
|
+
* @returns {any}
|
|
253
|
+
*/
|
|
254
|
+
$(selector) {
|
|
255
|
+
return this.shadowRoot.querySelector(selector);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Dispatches `punica-<name>`, bubbling and composed.
|
|
259
|
+
* @param {string} name
|
|
260
|
+
* @param {unknown} [detail]
|
|
261
|
+
* @param {{ cancelable?: boolean }} [options]
|
|
262
|
+
* @returns {CustomEvent} the dispatched event; check `defaultPrevented`
|
|
263
|
+
*/
|
|
264
|
+
emit(name, detail, options) {
|
|
265
|
+
const event = new CustomEvent(`punica-${name}`, {
|
|
266
|
+
detail,
|
|
267
|
+
bubbles: true,
|
|
268
|
+
composed: true,
|
|
269
|
+
cancelable: options?.cancelable ?? false
|
|
270
|
+
});
|
|
271
|
+
this.dispatchEvent(event);
|
|
272
|
+
return event;
|
|
273
|
+
}
|
|
274
|
+
/** @returns {ElementInternals} */
|
|
275
|
+
get internals() {
|
|
276
|
+
return this.#internals ||= this.attachInternals();
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Adds or removes a custom state, matched in CSS by `:state(name)`.
|
|
280
|
+
* @param {string} name
|
|
281
|
+
* @param {boolean} on
|
|
282
|
+
*/
|
|
283
|
+
toggleState(name, on) {
|
|
284
|
+
const states = this.internals.states;
|
|
285
|
+
if (!states) return;
|
|
286
|
+
if (on) {
|
|
287
|
+
try {
|
|
288
|
+
states.add(name);
|
|
289
|
+
} catch {
|
|
290
|
+
states.add(`--${name}`);
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
states.delete(name);
|
|
294
|
+
states.delete(`--${name}`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
function convert(value, type) {
|
|
299
|
+
if (type === Boolean) return value != null && value !== false;
|
|
300
|
+
if (value == null) return null;
|
|
301
|
+
if (type === Number) {
|
|
302
|
+
const n = Number(value);
|
|
303
|
+
return Number.isNaN(n) ? null : n;
|
|
304
|
+
}
|
|
305
|
+
if (type === String) return String(value);
|
|
306
|
+
return value;
|
|
307
|
+
}
|
|
308
|
+
function readAttribute(value, type) {
|
|
309
|
+
if (type === Boolean) return value !== null;
|
|
310
|
+
if (value === null) return null;
|
|
311
|
+
if (type === Number) {
|
|
312
|
+
const n = Number(value);
|
|
313
|
+
return value.trim() === "" || Number.isNaN(n) ? null : n;
|
|
314
|
+
}
|
|
315
|
+
if (type === Object || type === Array) {
|
|
316
|
+
try {
|
|
317
|
+
return JSON.parse(value);
|
|
318
|
+
} catch {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return value;
|
|
323
|
+
}
|
|
324
|
+
function writeAttribute(el, attribute, value, type) {
|
|
325
|
+
if (type === Boolean) el.toggleAttribute(attribute, !!value);
|
|
326
|
+
else if (value == null) el.removeAttribute(attribute);
|
|
327
|
+
else el.setAttribute(attribute, String(value));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export {
|
|
331
|
+
sheet,
|
|
332
|
+
installTokens,
|
|
333
|
+
define,
|
|
334
|
+
uid,
|
|
335
|
+
PunicaElement
|
|
336
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/tab/tab.css
|
|
7
|
+
var tab_default = ":host {\n --punica-tab-padding: var(--punica-space-8) var(--punica-space-16);\n --punica-tab-color: var(--punica-color-text-muted);\n --punica-tab-selected-color: var(--punica-color-primary);\n --punica-tab-hover-background: color-mix(in srgb, var(--punica-color-primary-light) 20%, transparent);\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n padding: var(--punica-tab-padding);\n color: var(--punica-tab-color);\n font-family: var(--punica-font-family);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration) var(--punica-ease),\n color var(--punica-duration) var(--punica-ease);\n}\n\n:host(:hover) {\n background: var(--punica-tab-hover-background);\n}\n\n:host([selected]) {\n color: var(--punica-tab-selected-color);\n}\n\n:host(:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\n:host([disabled]) {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n pointer-events: none;\n}\n\n.base {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-6);\n}\n\n@media (forced-colors: active) {\n :host([selected]) {\n color: Highlight;\n }\n :host([disabled]) {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/tab/tab.js
|
|
10
|
+
var PunicaTab = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
disabled: { type: Boolean },
|
|
14
|
+
selected: { type: Boolean }
|
|
15
|
+
};
|
|
16
|
+
static styles = tab_default;
|
|
17
|
+
static template = `
|
|
18
|
+
<span part="base" class="base">
|
|
19
|
+
<slot name="start"></slot>
|
|
20
|
+
<slot></slot>
|
|
21
|
+
<slot name="end"></slot>
|
|
22
|
+
</span>
|
|
23
|
+
`;
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.internals.role = "tab";
|
|
27
|
+
}
|
|
28
|
+
connected() {
|
|
29
|
+
if (!this.hasAttribute("slot")) this.slot = "tab";
|
|
30
|
+
}
|
|
31
|
+
update(changed) {
|
|
32
|
+
this.internals.ariaSelected = String(this.selected);
|
|
33
|
+
const off = this.disabled || !!/** @type {any} */
|
|
34
|
+
this.parentElement?.disabled;
|
|
35
|
+
this.internals.ariaDisabled = off ? "true" : null;
|
|
36
|
+
this.toggleState("selected", this.selected);
|
|
37
|
+
if (changed.has("value") || changed.has("disabled")) {
|
|
38
|
+
this.parentElement?.requestUpdate?.();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
define("punica-tab", PunicaTab);
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
PunicaTab
|
|
46
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Overlay,
|
|
3
|
+
overlayCss
|
|
4
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
5
|
+
import {
|
|
6
|
+
composedContains,
|
|
7
|
+
deepActiveElement
|
|
8
|
+
} from "./chunk-4RURT4SK.js";
|
|
9
|
+
import {
|
|
10
|
+
icons
|
|
11
|
+
} from "./chunk-YSGWORUD.js";
|
|
12
|
+
import {
|
|
13
|
+
PunicaElement,
|
|
14
|
+
define
|
|
15
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
16
|
+
|
|
17
|
+
// src/components/infoTip/infoTip.css
|
|
18
|
+
var infoTip_default = ":host {\n --punica-info-tip-color: var(--punica-color-text-muted);\n --punica-info-tip-size: var(--punica-space-16);\n --punica-info-tip-radius: var(--punica-radius-sm);\n --punica-info-tip-padding: var(--punica-space-8) var(--punica-space-12);\n --punica-info-tip-background: var(--punica-color-surface-raised);\n --punica-info-tip-shadow: var(--punica-shadow-sm);\n --punica-info-tip-max-width: 280px;\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([size='small']) {\n --punica-info-tip-size: var(--punica-space-14);\n}\n:host([size='large']) {\n --punica-info-tip-size: var(--punica-space-20);\n}\n\n.button {\n all: unset;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n /* The target is at least 24 px, whatever the icon's size (WCAG 2.5.8). */\n min-inline-size: var(--punica-space-24);\n min-block-size: var(--punica-space-24);\n margin-block: calc((var(--punica-info-tip-size) - var(--punica-space-24)) / 2);\n border-radius: var(--punica-radius-full);\n color: var(--punica-info-tip-color);\n font-size: var(--punica-info-tip-size);\n cursor: pointer;\n transition: color var(--punica-duration-fast) var(--punica-ease),\n background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.button:hover,\n:host(:state(pinned)) .button {\n color: var(--punica-color-text);\n background: var(--punica-color-hover);\n}\n\n.button:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: 0;\n}\n\n.panel {\n inline-size: max-content;\n max-inline-size: var(--punica-info-tip-max-width);\n padding: var(--punica-info-tip-padding);\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-info-tip-radius);\n background: var(--punica-info-tip-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n font-weight: var(--punica-font-weight-regular);\n line-height: var(--punica-line-height);\n text-align: start;\n overflow-wrap: anywhere;\n box-shadow: var(--punica-info-tip-shadow);\n opacity: 0;\n transition: opacity var(--punica-duration-fast) var(--punica-ease),\n display var(--punica-duration-fast) allow-discrete,\n overlay var(--punica-duration-fast) allow-discrete;\n}\n\n.panel:popover-open,\n.panel[data-open] {\n opacity: 1;\n}\n\n@starting-style {\n .panel:popover-open {\n opacity: 0;\n }\n}\n\n@media (forced-colors: active) {\n .button {\n color: ButtonText;\n }\n .panel {\n border-color: CanvasText;\n }\n}\n";
|
|
19
|
+
|
|
20
|
+
// src/components/infoTip/infoTip.js
|
|
21
|
+
var PunicaInfoTip = class extends PunicaElement {
|
|
22
|
+
static properties = {
|
|
23
|
+
label: { default: "More information" },
|
|
24
|
+
open: { type: Boolean },
|
|
25
|
+
side: { default: "block-start" },
|
|
26
|
+
align: { default: "center" },
|
|
27
|
+
size: {},
|
|
28
|
+
delay: { type: Number, default: 300 }
|
|
29
|
+
};
|
|
30
|
+
static styles = [overlayCss, infoTip_default];
|
|
31
|
+
static shadowOptions = { delegatesFocus: true };
|
|
32
|
+
static template = `
|
|
33
|
+
<button part="button" class="button" type="button" aria-expanded="false" aria-controls="panel">${icons.info}</button>
|
|
34
|
+
<div part="panel" class="panel" id="panel" popover="manual"><slot></slot></div>
|
|
35
|
+
`;
|
|
36
|
+
#button = this.$(".button");
|
|
37
|
+
#panel = this.$(".panel");
|
|
38
|
+
#overlay = new Overlay(this.#panel);
|
|
39
|
+
#shown = false;
|
|
40
|
+
#pinned = false;
|
|
41
|
+
#reason = "api";
|
|
42
|
+
#showTimer = 0;
|
|
43
|
+
#hideTimer = 0;
|
|
44
|
+
/** @type {AbortController | null} */
|
|
45
|
+
#openAbort = null;
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
const button = this.#button;
|
|
49
|
+
const panel = this.#panel;
|
|
50
|
+
button.addEventListener("click", () => {
|
|
51
|
+
if (this.open && this.#pinned) {
|
|
52
|
+
this.hide("button");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
clearTimeout(this.#showTimer);
|
|
56
|
+
clearTimeout(this.#hideTimer);
|
|
57
|
+
this.#pin(true);
|
|
58
|
+
this.open = true;
|
|
59
|
+
});
|
|
60
|
+
for (const part of [button, panel]) {
|
|
61
|
+
part.addEventListener("pointerover", (event) => {
|
|
62
|
+
if (event.pointerType === "touch") return;
|
|
63
|
+
clearTimeout(this.#hideTimer);
|
|
64
|
+
if (!this.open && part === button) {
|
|
65
|
+
clearTimeout(this.#showTimer);
|
|
66
|
+
this.#showTimer = setTimeout(() => {
|
|
67
|
+
this.#pin(false);
|
|
68
|
+
this.open = true;
|
|
69
|
+
}, Math.max(0, this.delay));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
part.addEventListener("pointerout", (event) => {
|
|
73
|
+
if (this.#inside(
|
|
74
|
+
/** @type {Node | null} */
|
|
75
|
+
event.relatedTarget
|
|
76
|
+
)) return;
|
|
77
|
+
clearTimeout(this.#showTimer);
|
|
78
|
+
if (this.open && !this.#pinned) {
|
|
79
|
+
this.#hideTimer = setTimeout(() => this.hide("pointer"), 150);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
84
|
+
const to = (
|
|
85
|
+
/** @type {Node | null} */
|
|
86
|
+
/** @type {FocusEvent} */
|
|
87
|
+
event.relatedTarget
|
|
88
|
+
);
|
|
89
|
+
if (to && !this.#inside(to)) this.hide("blur");
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** The floating explanation. */
|
|
93
|
+
get panel() {
|
|
94
|
+
return this.#panel;
|
|
95
|
+
}
|
|
96
|
+
/** Shows the explanation, pinned. */
|
|
97
|
+
show() {
|
|
98
|
+
this.#pin(true);
|
|
99
|
+
this.open = true;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Hides the explanation.
|
|
103
|
+
* @param {'button' | 'escape' | 'outside' | 'blur' | 'pointer' | 'api'} [reason]
|
|
104
|
+
*/
|
|
105
|
+
hide(reason = "api") {
|
|
106
|
+
clearTimeout(this.#showTimer);
|
|
107
|
+
clearTimeout(this.#hideTimer);
|
|
108
|
+
if (!this.open) return;
|
|
109
|
+
this.#reason = reason;
|
|
110
|
+
this.open = false;
|
|
111
|
+
}
|
|
112
|
+
/** Moves focus to the button. */
|
|
113
|
+
focus(options) {
|
|
114
|
+
this.#button.focus(options);
|
|
115
|
+
}
|
|
116
|
+
connected() {
|
|
117
|
+
if (this.open && !this.#shown) {
|
|
118
|
+
queueMicrotask(() => this.isConnected && this.open && !this.#shown && this.#setup());
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
disconnected() {
|
|
122
|
+
clearTimeout(this.#showTimer);
|
|
123
|
+
clearTimeout(this.#hideTimer);
|
|
124
|
+
this.#teardown(false);
|
|
125
|
+
}
|
|
126
|
+
update(changed) {
|
|
127
|
+
const button = this.#button;
|
|
128
|
+
button.setAttribute("aria-label", this.label ?? "");
|
|
129
|
+
if ("ariaDescribedByElements" in button) button.ariaDescribedByElements = [this.#panel];
|
|
130
|
+
else button.setAttribute("aria-describedby", "panel");
|
|
131
|
+
button.setAttribute("aria-expanded", String(this.open && this.#pinned));
|
|
132
|
+
if (this.open && !this.#shown) this.#setup();
|
|
133
|
+
else if (!this.open && this.#shown) this.#teardown(true);
|
|
134
|
+
else if (this.open && ["side", "align"].some((name) => changed.has(name))) this.#place();
|
|
135
|
+
}
|
|
136
|
+
/** @param {boolean} on */
|
|
137
|
+
#pin(on) {
|
|
138
|
+
this.#pinned = on;
|
|
139
|
+
this.toggleState("pinned", on);
|
|
140
|
+
this.#button.setAttribute("aria-expanded", String(this.open && on));
|
|
141
|
+
this.requestUpdate();
|
|
142
|
+
}
|
|
143
|
+
/** @param {Node | null} node */
|
|
144
|
+
#inside(node) {
|
|
145
|
+
return !!node && (composedContains(this, node) || composedContains(this.#panel, node));
|
|
146
|
+
}
|
|
147
|
+
#place() {
|
|
148
|
+
this.#overlay.show(this.#button, {
|
|
149
|
+
side: (
|
|
150
|
+
/** @type {any} */
|
|
151
|
+
this.side
|
|
152
|
+
),
|
|
153
|
+
align: (
|
|
154
|
+
/** @type {any} */
|
|
155
|
+
this.align
|
|
156
|
+
),
|
|
157
|
+
offset: 6
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
#setup() {
|
|
161
|
+
this.#shown = true;
|
|
162
|
+
this.#place();
|
|
163
|
+
this.#openAbort = new AbortController();
|
|
164
|
+
const signal = this.#openAbort.signal;
|
|
165
|
+
document.addEventListener(
|
|
166
|
+
"keydown",
|
|
167
|
+
(event) => {
|
|
168
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
169
|
+
if (this.#inside(deepActiveElement())) event.preventDefault();
|
|
170
|
+
this.hide("escape");
|
|
171
|
+
},
|
|
172
|
+
{ signal }
|
|
173
|
+
);
|
|
174
|
+
document.addEventListener(
|
|
175
|
+
"pointerdown",
|
|
176
|
+
(event) => {
|
|
177
|
+
const path = event.composedPath();
|
|
178
|
+
if (path.includes(this) || path.includes(this.#panel)) return;
|
|
179
|
+
this.hide("outside");
|
|
180
|
+
},
|
|
181
|
+
{ capture: true, signal }
|
|
182
|
+
);
|
|
183
|
+
this.emit("open");
|
|
184
|
+
}
|
|
185
|
+
/** @param {boolean} announce */
|
|
186
|
+
#teardown(announce) {
|
|
187
|
+
if (!this.#shown) return;
|
|
188
|
+
const active = deepActiveElement();
|
|
189
|
+
const focusInPanel = !!active && composedContains(this.#panel, active);
|
|
190
|
+
this.#shown = false;
|
|
191
|
+
this.#openAbort?.abort();
|
|
192
|
+
this.#openAbort = null;
|
|
193
|
+
this.#overlay.hide();
|
|
194
|
+
if (!announce) return;
|
|
195
|
+
const reason = this.#reason;
|
|
196
|
+
this.#reason = "api";
|
|
197
|
+
this.#pin(false);
|
|
198
|
+
if (focusInPanel || reason === "escape" && active && composedContains(this, active)) {
|
|
199
|
+
this.#button.focus({ preventScroll: true });
|
|
200
|
+
}
|
|
201
|
+
this.emit("close", { reason });
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
define("punica-info-tip", PunicaInfoTip);
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
PunicaInfoTip
|
|
208
|
+
};
|