@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,225 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/avatarGroup/avatarGroup.css
|
|
7
|
+
var avatarGroup_default = `:host {
|
|
8
|
+
--punica-avatar-group-size: var(--punica-size-md);
|
|
9
|
+
--punica-avatar-group-overlap: calc(var(--punica-avatar-group-size) / 4);
|
|
10
|
+
--punica-avatar-group-ring-width: var(--punica-space-2);
|
|
11
|
+
--punica-avatar-group-ring-color: var(--punica-color-surface);
|
|
12
|
+
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([size='small']) {
|
|
18
|
+
--punica-avatar-group-size: var(--punica-size-sm);
|
|
19
|
+
}
|
|
20
|
+
:host([size='large']) {
|
|
21
|
+
--punica-avatar-group-size: var(--punica-size-lg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.base {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
/* The first avatar's negative margin is given back here, so the row starts
|
|
28
|
+
where the element does in either direction. */
|
|
29
|
+
padding-inline-start: var(--punica-avatar-group-overlap);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Written from the group's tree, these win over each avatar's own size. */
|
|
33
|
+
::slotted(*),
|
|
34
|
+
.overflow {
|
|
35
|
+
--punica-avatar-size: var(--punica-avatar-group-size);
|
|
36
|
+
margin-inline-start: calc(-1 * var(--punica-avatar-group-overlap));
|
|
37
|
+
border-radius: var(--punica-radius-full);
|
|
38
|
+
box-shadow: 0 0 0 var(--punica-avatar-group-ring-width) var(--punica-avatar-group-ring-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::slotted([shape='square']) {
|
|
42
|
+
border-radius: var(--punica-avatar-radius, var(--punica-radius-sm));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.overflow {
|
|
46
|
+
all: unset;
|
|
47
|
+
/* Avatars are positioned; so is "+N", to paint over the last of them. */
|
|
48
|
+
position: relative;
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
flex: none;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
min-inline-size: var(--punica-avatar-group-size);
|
|
55
|
+
block-size: var(--punica-avatar-group-size);
|
|
56
|
+
padding-inline: var(--punica-space-4);
|
|
57
|
+
margin-inline-start: calc(-1 * var(--punica-avatar-group-overlap));
|
|
58
|
+
border-radius: var(--punica-radius-full);
|
|
59
|
+
box-shadow: 0 0 0 var(--punica-avatar-group-ring-width) var(--punica-avatar-group-ring-color);
|
|
60
|
+
background: color-mix(in srgb, var(--punica-color-text) 16%, var(--punica-color-surface));
|
|
61
|
+
color: var(--punica-color-text);
|
|
62
|
+
font-family: var(--punica-font-family);
|
|
63
|
+
font-size: calc(var(--punica-avatar-group-size) * 0.36);
|
|
64
|
+
font-weight: var(--punica-font-weight-semi-bold);
|
|
65
|
+
line-height: 1;
|
|
66
|
+
font-variant-numeric: tabular-nums;
|
|
67
|
+
user-select: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.overflow[hidden] {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
button.overflow {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: background-color var(--punica-duration-fast) var(--punica-ease);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
button.overflow:hover,
|
|
80
|
+
button.overflow[aria-expanded='true'] {
|
|
81
|
+
background: color-mix(in srgb, var(--punica-color-text) 24%, var(--punica-color-surface));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
button.overflow:focus-visible {
|
|
85
|
+
outline: var(--punica-focus-ring);
|
|
86
|
+
outline-offset: var(--punica-focus-ring-offset);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.list {
|
|
90
|
+
display: grid;
|
|
91
|
+
gap: var(--punica-space-4);
|
|
92
|
+
max-block-size: 280px;
|
|
93
|
+
margin: 0;
|
|
94
|
+
padding: var(--punica-space-4);
|
|
95
|
+
overflow: auto;
|
|
96
|
+
list-style: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.item {
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
gap: var(--punica-space-8);
|
|
103
|
+
font-family: var(--punica-font-family);
|
|
104
|
+
font-size: var(--punica-font-size-sm);
|
|
105
|
+
line-height: var(--punica-line-height);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.name {
|
|
109
|
+
min-inline-size: 0;
|
|
110
|
+
overflow-wrap: anywhere;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (forced-colors: active) {
|
|
114
|
+
.overflow {
|
|
115
|
+
border: var(--punica-border-width) solid CanvasText;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
// src/components/avatarGroup/avatarGroup.js
|
|
121
|
+
var nameOf = (el) => (el.getAttribute("label") || el.getAttribute("alt") || el.getAttribute("name") || el.textContent || "").trim();
|
|
122
|
+
var PunicaAvatarGroup = class extends PunicaElement {
|
|
123
|
+
static properties = {
|
|
124
|
+
label: {},
|
|
125
|
+
max: { type: Number },
|
|
126
|
+
overflow: {},
|
|
127
|
+
size: {},
|
|
128
|
+
labelOverflow: { default: "{count} more" }
|
|
129
|
+
};
|
|
130
|
+
static styles = avatarGroup_default;
|
|
131
|
+
static shadowOptions = { slotAssignment: "manual" };
|
|
132
|
+
static template = `
|
|
133
|
+
<div part="base" class="base">
|
|
134
|
+
<slot></slot>
|
|
135
|
+
<punica-popover class="popover" exportparts="panel">
|
|
136
|
+
<button slot="trigger" part="overflow" class="overflow more" type="button"></button>
|
|
137
|
+
<ul part="list" class="list"></ul>
|
|
138
|
+
</punica-popover>
|
|
139
|
+
<span part="overflow" class="overflow count" role="img"></span>
|
|
140
|
+
</div>
|
|
141
|
+
`;
|
|
142
|
+
#slot = this.$("slot");
|
|
143
|
+
#popover = this.$(".popover");
|
|
144
|
+
#more = this.$(".more");
|
|
145
|
+
#count = this.$(".count");
|
|
146
|
+
#list = this.$(".list");
|
|
147
|
+
/** @type {MutationObserver | null} */
|
|
148
|
+
#observer = null;
|
|
149
|
+
connected() {
|
|
150
|
+
this.#observer = new MutationObserver(() => this.#render());
|
|
151
|
+
this.#observer.observe(this, {
|
|
152
|
+
childList: true,
|
|
153
|
+
subtree: true,
|
|
154
|
+
characterData: true,
|
|
155
|
+
attributes: true,
|
|
156
|
+
attributeFilter: ["label", "alt", "name", "src"]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
disconnected() {
|
|
160
|
+
this.#observer?.disconnect();
|
|
161
|
+
this.#observer = null;
|
|
162
|
+
}
|
|
163
|
+
update() {
|
|
164
|
+
this.internals.role = "group";
|
|
165
|
+
this.internals.ariaLabel = this.label || null;
|
|
166
|
+
this.#render();
|
|
167
|
+
}
|
|
168
|
+
/** The avatars collapsed into "+N". @returns {Element[]} */
|
|
169
|
+
get hiddenAvatars() {
|
|
170
|
+
const avatars = this.#avatars();
|
|
171
|
+
return avatars.slice(this.#shownCount(avatars.length));
|
|
172
|
+
}
|
|
173
|
+
#avatars() {
|
|
174
|
+
return [...this.children].filter((el) => el.localName === "punica-avatar");
|
|
175
|
+
}
|
|
176
|
+
/** @param {number} total */
|
|
177
|
+
#shownCount(total) {
|
|
178
|
+
const max = this.max;
|
|
179
|
+
return Number.isInteger(max) && max >= 0 && max < total ? max : total;
|
|
180
|
+
}
|
|
181
|
+
#render() {
|
|
182
|
+
const avatars = this.#avatars();
|
|
183
|
+
const shown = this.#shownCount(avatars.length);
|
|
184
|
+
this.#slot.assign(...avatars.slice(0, shown));
|
|
185
|
+
const hidden = avatars.slice(shown);
|
|
186
|
+
const n = hidden.length;
|
|
187
|
+
const language = this.closest("[lang]")?.lang || navigator.language;
|
|
188
|
+
const number = new Intl.NumberFormat(language).format(n);
|
|
189
|
+
const name = (this.labelOverflow ?? "").replaceAll("{count}", number);
|
|
190
|
+
const list = this.overflow !== "count";
|
|
191
|
+
this.toggleState("overflowing", n > 0);
|
|
192
|
+
this.#popover.hidden = !n || !list;
|
|
193
|
+
this.#count.hidden = !n || list;
|
|
194
|
+
this.#more.textContent = `+${number}`;
|
|
195
|
+
this.#count.textContent = `+${number}`;
|
|
196
|
+
this.#more.setAttribute("aria-label", name);
|
|
197
|
+
this.#count.setAttribute("aria-label", name);
|
|
198
|
+
this.#popover.label = name;
|
|
199
|
+
if (!n && this.#popover.open) this.#popover.hide();
|
|
200
|
+
const items = hidden.map((avatar) => {
|
|
201
|
+
const item = document.createElement("li");
|
|
202
|
+
item.className = "item";
|
|
203
|
+
item.setAttribute("part", "item");
|
|
204
|
+
const picture = (
|
|
205
|
+
/** @type {HTMLElement} */
|
|
206
|
+
avatar.cloneNode(true)
|
|
207
|
+
);
|
|
208
|
+
picture.removeAttribute("id");
|
|
209
|
+
picture.setAttribute("size", "small");
|
|
210
|
+
picture.setAttribute("aria-hidden", "true");
|
|
211
|
+
const text = document.createElement("span");
|
|
212
|
+
text.className = "name";
|
|
213
|
+
text.textContent = nameOf(avatar);
|
|
214
|
+
item.append(picture, text);
|
|
215
|
+
return item;
|
|
216
|
+
});
|
|
217
|
+
this.#list.replaceChildren(...items);
|
|
218
|
+
if (this.#popover.open) this.#popover.reposition();
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
define("punica-avatar-group", PunicaAvatarGroup);
|
|
222
|
+
|
|
223
|
+
export {
|
|
224
|
+
PunicaAvatarGroup
|
|
225
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/emptyState/emptyState.css
|
|
7
|
+
var emptyState_default = ":host {\n --punica-empty-state-padding: var(--punica-space-48) var(--punica-space-24);\n --punica-empty-state-gap: var(--punica-space-8);\n --punica-empty-state-max-width: 40ch;\n --punica-empty-state-icon-size: var(--punica-space-48);\n\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--punica-empty-state-gap);\n box-sizing: border-box;\n min-block-size: 100%;\n padding: var(--punica-empty-state-padding);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n line-height: var(--punica-line-height);\n text-align: center;\n}\n\n:host([size='section']) {\n --punica-empty-state-padding: var(--punica-space-16);\n --punica-empty-state-gap: var(--punica-space-4);\n --punica-empty-state-icon-size: var(--punica-space-24);\n\n min-block-size: 0;\n}\n\n.icon {\n display: flex;\n color: var(--punica-color-text-muted);\n font-size: var(--punica-empty-state-icon-size);\n line-height: 1;\n}\n\n.heading {\n max-inline-size: var(--punica-empty-state-max-width);\n font-size: var(--punica-font-size-lg);\n font-weight: var(--punica-font-weight-semi-bold);\n}\n.heading[hidden] {\n display: none;\n}\n:host([size='section']) .heading {\n font-size: var(--punica-font-size-sm);\n}\n\n.description {\n max-inline-size: var(--punica-empty-state-max-width);\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-sm);\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--punica-space-8);\n}\n::slotted([slot='actions']) {\n margin-block-start: var(--punica-space-8);\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/emptyState/emptyState.js
|
|
10
|
+
var PunicaEmptyState = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
heading: {},
|
|
13
|
+
size: {},
|
|
14
|
+
headingLevel: { type: Number, default: 3 }
|
|
15
|
+
};
|
|
16
|
+
static styles = emptyState_default;
|
|
17
|
+
static template = `
|
|
18
|
+
<div part="icon" class="icon"><slot name="icon"></slot></div>
|
|
19
|
+
<div part="heading" class="heading" role="heading" aria-level="3" hidden></div>
|
|
20
|
+
<div part="description" class="description"><slot></slot></div>
|
|
21
|
+
<div part="actions" class="actions"><slot name="actions"></slot></div>
|
|
22
|
+
`;
|
|
23
|
+
#heading = this.$(".heading");
|
|
24
|
+
update() {
|
|
25
|
+
const level = Number.isInteger(this.headingLevel) && this.headingLevel >= 1 && this.headingLevel <= 6 ? this.headingLevel : 3;
|
|
26
|
+
this.#heading.textContent = this.heading ?? "";
|
|
27
|
+
this.#heading.hidden = !this.heading;
|
|
28
|
+
this.#heading.setAttribute("aria-level", String(level));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
define("punica-empty-state", PunicaEmptyState);
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
PunicaEmptyState
|
|
35
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {
|
|
2
|
+
nextIndex
|
|
3
|
+
} from "./chunk-4RURT4SK.js";
|
|
4
|
+
import {
|
|
5
|
+
icons
|
|
6
|
+
} from "./chunk-YSGWORUD.js";
|
|
7
|
+
import {
|
|
8
|
+
PunicaElement,
|
|
9
|
+
define
|
|
10
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
11
|
+
|
|
12
|
+
// src/components/topNav/topNav.css
|
|
13
|
+
var topNav_default = ":host {\n --punica-top-nav-height: var(--punica-space-56);\n --punica-top-nav-background: var(--punica-color-surface);\n --punica-top-nav-padding: var(--punica-space-16);\n --punica-top-nav-gap: var(--punica-space-4);\n\n display: block;\n color: var(--punica-color-text);\n}\n\nnav {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n min-block-size: var(--punica-top-nav-height);\n padding-inline: var(--punica-top-nav-padding);\n border-block-end: var(--punica-border-width) solid var(--punica-color-border);\n background: var(--punica-top-nav-background);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n}\n\n.start,\n.end {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--punica-space-8);\n}\n\n.items {\n display: flex;\n flex: 1 1 0;\n align-items: center;\n gap: var(--punica-top-nav-gap);\n min-inline-size: 0;\n overflow: hidden;\n}\n.items ::slotted(*) {\n flex: none;\n}\n\n.more {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-md);\n block-size: var(--punica-size-md);\n border-radius: var(--punica-radius);\n font-size: var(--punica-font-size-lg);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n.more:hover,\n.more[aria-expanded='true'] {\n background: var(--punica-color-hover);\n}\n.more:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n.more[hidden] {\n display: none !important;\n}\n\n.menu {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-2);\n min-inline-size: var(--punica-space-160);\n}\n.menu ::slotted(*) {\n display: flex;\n}\n.menu ::slotted([hidden]) {\n display: none;\n}\n\n@media (forced-colors: active) {\n nav {\n border-color: CanvasText;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/topNav/topNav.js
|
|
16
|
+
var PunicaTopNav = class extends PunicaElement {
|
|
17
|
+
static properties = {
|
|
18
|
+
label: {},
|
|
19
|
+
labelMore: { default: "More" }
|
|
20
|
+
};
|
|
21
|
+
static styles = topNav_default;
|
|
22
|
+
// Slots are assigned by hand: which items sit in the row and which in the
|
|
23
|
+
// menu is this element's decision, and it writes nothing on the items.
|
|
24
|
+
static shadowOptions = { slotAssignment: "manual" };
|
|
25
|
+
static template = `
|
|
26
|
+
<nav part="base">
|
|
27
|
+
<div part="start" class="start"><slot id="start"></slot></div>
|
|
28
|
+
<div part="items" class="items"><slot id="items"></slot></div>
|
|
29
|
+
<button part="more-button" class="more" type="button" aria-expanded="false" hidden>${icons.more}</button>
|
|
30
|
+
<punica-popover part="more-popover" align="end" panel-role="group">
|
|
31
|
+
<div part="more-menu" class="menu"><slot id="overflow"></slot></div>
|
|
32
|
+
</punica-popover>
|
|
33
|
+
<div part="end" class="end"><slot id="end"></slot></div>
|
|
34
|
+
</nav>
|
|
35
|
+
`;
|
|
36
|
+
#nav = this.$("nav");
|
|
37
|
+
#row = this.$(".items");
|
|
38
|
+
#more = this.$(".more");
|
|
39
|
+
#popover = this.$("punica-popover");
|
|
40
|
+
#menu = this.$(".menu");
|
|
41
|
+
#slots = {
|
|
42
|
+
start: this.$("#start"),
|
|
43
|
+
items: this.$("#items"),
|
|
44
|
+
overflow: this.$("#overflow"),
|
|
45
|
+
end: this.$("#end")
|
|
46
|
+
};
|
|
47
|
+
/** @type {Element[]} */
|
|
48
|
+
#items = [];
|
|
49
|
+
/** @type {Element[]} */
|
|
50
|
+
#overflowing = [];
|
|
51
|
+
/** @type {ResizeObserver | null} */
|
|
52
|
+
#resize = null;
|
|
53
|
+
#frame = 0;
|
|
54
|
+
/** @type {MutationObserver | null} */
|
|
55
|
+
#mutation = null;
|
|
56
|
+
constructor() {
|
|
57
|
+
super();
|
|
58
|
+
this.#more.addEventListener("click", () => {
|
|
59
|
+
this.#popover.open = !this.#popover.open;
|
|
60
|
+
});
|
|
61
|
+
this.#more.addEventListener("keydown", (event) => {
|
|
62
|
+
if (event.key !== "ArrowDown") return;
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
if (this.#popover.open) this.#focusable()[0]?.focus();
|
|
65
|
+
else this.#popover.open = true;
|
|
66
|
+
});
|
|
67
|
+
this.#popover.addEventListener("punica-open", (event) => {
|
|
68
|
+
if (event.target === this.#popover) this.#more.setAttribute("aria-expanded", "true");
|
|
69
|
+
});
|
|
70
|
+
this.#popover.addEventListener("punica-close", (event) => {
|
|
71
|
+
if (event.target !== this.#popover) return;
|
|
72
|
+
this.#more.setAttribute("aria-expanded", "false");
|
|
73
|
+
if (
|
|
74
|
+
/** @type {CustomEvent} */
|
|
75
|
+
event.detail?.reason === "escape"
|
|
76
|
+
) this.#more.focus();
|
|
77
|
+
for (const item of this.#overflowing) if ("open" in item) item.open = false;
|
|
78
|
+
});
|
|
79
|
+
this.#menu.addEventListener("keydown", (event) => this.#onMenuKeydown(event));
|
|
80
|
+
}
|
|
81
|
+
get overflowing() {
|
|
82
|
+
return [...this.#overflowing];
|
|
83
|
+
}
|
|
84
|
+
connected() {
|
|
85
|
+
this.#resize = new ResizeObserver(() => {
|
|
86
|
+
cancelAnimationFrame(this.#frame);
|
|
87
|
+
this.#frame = requestAnimationFrame(() => this.#layout());
|
|
88
|
+
});
|
|
89
|
+
this.#resize.observe(this);
|
|
90
|
+
this.#mutation = new MutationObserver(() => this.#assign());
|
|
91
|
+
this.#mutation.observe(this, {
|
|
92
|
+
childList: true,
|
|
93
|
+
subtree: true,
|
|
94
|
+
characterData: true,
|
|
95
|
+
attributes: true,
|
|
96
|
+
attributeFilter: ["slot", "hidden"]
|
|
97
|
+
});
|
|
98
|
+
this.#assign();
|
|
99
|
+
}
|
|
100
|
+
disconnected() {
|
|
101
|
+
cancelAnimationFrame(this.#frame);
|
|
102
|
+
this.#resize?.disconnect();
|
|
103
|
+
this.#resize = null;
|
|
104
|
+
this.#mutation?.disconnect();
|
|
105
|
+
this.#mutation = null;
|
|
106
|
+
}
|
|
107
|
+
update() {
|
|
108
|
+
if (this.label) this.#nav.setAttribute("aria-label", this.label);
|
|
109
|
+
else this.#nav.removeAttribute("aria-label");
|
|
110
|
+
this.#more.setAttribute("aria-label", this.labelMore);
|
|
111
|
+
this.#more.title = this.labelMore;
|
|
112
|
+
this.#popover.anchor = this.#more;
|
|
113
|
+
this.#popover.label = this.labelMore;
|
|
114
|
+
}
|
|
115
|
+
/** Sorts the children into the slots, then measures. */
|
|
116
|
+
#assign() {
|
|
117
|
+
const children = [...this.children];
|
|
118
|
+
this.#slots.start.assign(...children.filter((el) => el.slot === "start"));
|
|
119
|
+
this.#slots.end.assign(...children.filter((el) => el.slot === "end"));
|
|
120
|
+
this.#items = children.filter((el) => !el.slot);
|
|
121
|
+
this.#layout();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Puts every item in the row, measures, and moves the ones past the edge
|
|
125
|
+
* into the menu.
|
|
126
|
+
*/
|
|
127
|
+
#layout() {
|
|
128
|
+
const items = this.#items;
|
|
129
|
+
const row = this.#row;
|
|
130
|
+
const more = this.#more;
|
|
131
|
+
this.#slots.items.assign(...items);
|
|
132
|
+
more.hidden = true;
|
|
133
|
+
const gap = parseFloat(getComputedStyle(row).columnGap) || 0;
|
|
134
|
+
const widths = items.map((item) => (
|
|
135
|
+
/** @type {HTMLElement} */
|
|
136
|
+
item.offsetWidth
|
|
137
|
+
));
|
|
138
|
+
const total = widths.reduce((sum, width, i) => sum + width + (i ? gap : 0), 0);
|
|
139
|
+
let fit = items.length;
|
|
140
|
+
if (total > row.getBoundingClientRect().width + 0.5) {
|
|
141
|
+
more.hidden = false;
|
|
142
|
+
const room = row.getBoundingClientRect().width + 0.5;
|
|
143
|
+
let used = 0;
|
|
144
|
+
fit = 0;
|
|
145
|
+
for (const [i, width] of widths.entries()) {
|
|
146
|
+
used += width + (i ? gap : 0);
|
|
147
|
+
if (used > room) break;
|
|
148
|
+
fit++;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.#overflowing = items.slice(fit);
|
|
152
|
+
this.#slots.items.assign(...items.slice(0, fit));
|
|
153
|
+
this.#slots.overflow.assign(...this.#overflowing);
|
|
154
|
+
if (!this.#overflowing.length && this.#popover.open) this.#popover.open = false;
|
|
155
|
+
}
|
|
156
|
+
/** @returns {HTMLElement[]} */
|
|
157
|
+
#focusable() {
|
|
158
|
+
return (
|
|
159
|
+
/** @type {HTMLElement[]} */
|
|
160
|
+
this.#overflowing.filter((item) => !item.hasAttribute("disabled"))
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
#onMenuKeydown(event) {
|
|
164
|
+
if (event.defaultPrevented) return;
|
|
165
|
+
const items = this.#focusable();
|
|
166
|
+
const current = items.findIndex((item) => item.matches(":focus-within"));
|
|
167
|
+
const index = nextIndex(event, items.length, current, { orientation: "vertical" });
|
|
168
|
+
if (index < 0) return;
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
items[index].focus();
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
define("punica-top-nav", PunicaTopNav);
|
|
174
|
+
|
|
175
|
+
export {
|
|
176
|
+
PunicaTopNav
|
|
177
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
overlayCss
|
|
3
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/toast/toaster.css
|
|
10
|
+
var toaster_default = ":host {\n --punica-toaster-gap: var(--punica-space-10);\n --punica-toaster-offset: var(--punica-space-10);\n\n display: contents;\n}\n\n[part='region'] {\n inset-block-end: var(--punica-toaster-offset);\n inset-inline-end: var(--punica-toaster-offset);\n flex-direction: column-reverse;\n align-items: flex-end;\n gap: var(--punica-toaster-gap);\n max-block-size: calc(100dvh - 2 * var(--punica-toaster-offset));\n pointer-events: none;\n}\n\n[part='region']:popover-open,\n[part='region'][data-open] {\n display: flex;\n}\n\n:host([position^='block-start']) [part='region'] {\n inset-block: var(--punica-toaster-offset) auto;\n flex-direction: column;\n}\n\n:host([position$='-start']) [part='region'] {\n inset-inline: var(--punica-toaster-offset) auto;\n align-items: flex-start;\n}\n\n:host([position$='-center']) [part='region'] {\n inset-inline: 0;\n inline-size: fit-content;\n margin-inline: auto;\n align-items: center;\n}\n\n::slotted(*) {\n pointer-events: auto;\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/toast/toaster.js
|
|
13
|
+
var PunicaToaster = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
position: { default: "block-end-end" },
|
|
16
|
+
label: { default: "Notifications" }
|
|
17
|
+
};
|
|
18
|
+
static styles = [overlayCss, toaster_default];
|
|
19
|
+
static template = `<div part="region" popover="manual" role="region" aria-live="polite" aria-relevant="additions"><slot></slot></div>`;
|
|
20
|
+
#region = this.$('[part="region"]');
|
|
21
|
+
#slot = this.$("slot");
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.#slot.addEventListener("slotchange", () => this.#sync());
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds a toast holding a text message.
|
|
28
|
+
* @param {string} message set as text, never parsed as markup
|
|
29
|
+
* @param {{ color?: string, duration?: number, labelClose?: string, noCloseButton?: boolean }} [options]
|
|
30
|
+
* @returns {HTMLElement} the `punica-toast`
|
|
31
|
+
*/
|
|
32
|
+
add(message, options = {}) {
|
|
33
|
+
const el = (
|
|
34
|
+
/** @type {any} */
|
|
35
|
+
document.createElement("punica-toast")
|
|
36
|
+
);
|
|
37
|
+
el.textContent = String(message ?? "");
|
|
38
|
+
if (options.color != null) el.color = options.color;
|
|
39
|
+
if (options.duration != null) el.duration = options.duration;
|
|
40
|
+
if (options.labelClose != null) el.labelClose = options.labelClose;
|
|
41
|
+
if (options.noCloseButton != null) el.noCloseButton = options.noCloseButton;
|
|
42
|
+
this.appendChild(el);
|
|
43
|
+
return el;
|
|
44
|
+
}
|
|
45
|
+
connected() {
|
|
46
|
+
queueMicrotask(() => this.#sync());
|
|
47
|
+
}
|
|
48
|
+
update() {
|
|
49
|
+
this.#region.setAttribute("aria-label", this.label);
|
|
50
|
+
}
|
|
51
|
+
/** The region is in the top layer only while it holds a toast. */
|
|
52
|
+
#sync() {
|
|
53
|
+
if (!this.isConnected) return;
|
|
54
|
+
const region = this.#region;
|
|
55
|
+
const want = this.#slot.assignedElements({ flatten: true }).length > 0;
|
|
56
|
+
if (typeof region.showPopover !== "function") {
|
|
57
|
+
region.toggleAttribute("data-open", want);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const open = region.matches(":popover-open");
|
|
61
|
+
if (want && !open) region.showPopover();
|
|
62
|
+
else if (!want && open) region.hidePopover();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
define("punica-toaster", PunicaToaster);
|
|
66
|
+
function toast(message, options = {}) {
|
|
67
|
+
let toaster = (
|
|
68
|
+
/** @type {any} */
|
|
69
|
+
options.toaster || document.querySelector("punica-toaster")
|
|
70
|
+
);
|
|
71
|
+
if (!toaster) {
|
|
72
|
+
toaster = document.createElement("punica-toaster");
|
|
73
|
+
document.body.appendChild(toaster);
|
|
74
|
+
}
|
|
75
|
+
return toaster.add(message, options);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
PunicaToaster,
|
|
80
|
+
toast
|
|
81
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/accordion/accordion.css
|
|
10
|
+
var accordion_default = ":host {\n --punica-accordion-radius: var(--punica-radius);\n --punica-accordion-background: var(--punica-color-surface);\n --punica-accordion-summary-padding: var(--punica-padding);\n --punica-accordion-content-padding: var(--punica-padding);\n --punica-accordion-duration: var(--punica-duration);\n\n display: block;\n background: var(--punica-accordion-background);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n:host([rounded]) {\n border-radius: var(--punica-accordion-radius);\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n}\n\n.heading {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n inline-size: 100%;\n padding: var(--punica-accordion-summary-padding);\n border-radius: inherit;\n font: inherit;\n font-weight: var(--punica-font-weight-semi-bold);\n cursor: pointer;\n}\n\n:host([rounded]) button {\n border-radius: var(--punica-accordion-radius);\n}\n\nbutton:hover {\n background: var(--punica-color-hover);\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\nbutton:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n.label {\n flex: 1 1 auto;\n min-inline-size: 0;\n text-align: start;\n}\n\n.indicator {\n display: inline-flex;\n transition: transform var(--punica-accordion-duration) var(--punica-ease);\n}\n\n:host([open]) .indicator {\n transform: rotate(180deg);\n}\n\n::slotted([slot='end']) {\n margin-inline-end: var(--punica-space-8);\n}\n\n.region {\n display: grid;\n grid-template-rows: 0fr;\n visibility: hidden;\n transition: grid-template-rows var(--punica-accordion-duration) var(--punica-ease),\n visibility 0s linear var(--punica-accordion-duration);\n}\n\n:host([open]) .region {\n grid-template-rows: 1fr;\n visibility: visible;\n transition: grid-template-rows var(--punica-accordion-duration) var(--punica-ease), visibility 0s;\n}\n\n.clip {\n min-block-size: 0;\n overflow: hidden;\n}\n\n.content {\n padding: var(--punica-accordion-content-padding);\n}\n\n@media (forced-colors: active) {\n :host {\n border: var(--punica-border-width) solid CanvasText;\n }\n button:disabled {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/accordion/accordion.js
|
|
13
|
+
var PunicaAccordion = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
open: { type: Boolean },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
rounded: { type: Boolean },
|
|
18
|
+
headingLevel: { type: Number }
|
|
19
|
+
};
|
|
20
|
+
static styles = accordion_default;
|
|
21
|
+
static shadowOptions = { delegatesFocus: true };
|
|
22
|
+
static template = `
|
|
23
|
+
<div part="header" class="header">
|
|
24
|
+
<div class="heading">
|
|
25
|
+
<button part="summary" id="summary" type="button" aria-expanded="false" aria-controls="region">
|
|
26
|
+
<slot name="start"></slot>
|
|
27
|
+
<span part="label" class="label"><slot name="summary"></slot></span>
|
|
28
|
+
<span part="indicator" class="indicator"><slot name="indicator">${icons.chevronDown}</slot></span>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
<slot name="end"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="region" id="region" class="region" role="region" aria-labelledby="summary">
|
|
34
|
+
<div class="clip"><div part="content" class="content"><slot></slot></div></div>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
#button = this.$("button");
|
|
38
|
+
#heading = this.$(".heading");
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
this.#button.addEventListener("click", () => {
|
|
42
|
+
if (this.disabled) return;
|
|
43
|
+
this.open = !this.open;
|
|
44
|
+
this.emit("toggle", { open: this.open });
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Expands the section. Fires nothing. */
|
|
48
|
+
show() {
|
|
49
|
+
this.open = true;
|
|
50
|
+
}
|
|
51
|
+
/** Collapses the section. Fires nothing. */
|
|
52
|
+
hide() {
|
|
53
|
+
this.open = false;
|
|
54
|
+
}
|
|
55
|
+
/** Expands when collapsed and collapses when expanded. Fires nothing. */
|
|
56
|
+
toggle() {
|
|
57
|
+
this.open = !this.open;
|
|
58
|
+
}
|
|
59
|
+
/** Moves focus to the summary button. */
|
|
60
|
+
focus(options) {
|
|
61
|
+
this.#button.focus(options);
|
|
62
|
+
}
|
|
63
|
+
update() {
|
|
64
|
+
this.toggleState("open", this.open);
|
|
65
|
+
this.#button.disabled = this.disabled;
|
|
66
|
+
this.#button.setAttribute("aria-expanded", String(this.open));
|
|
67
|
+
const level = this.headingLevel;
|
|
68
|
+
if (level >= 1 && level <= 6) {
|
|
69
|
+
this.#heading.setAttribute("role", "heading");
|
|
70
|
+
this.#heading.setAttribute("aria-level", String(Math.round(level)));
|
|
71
|
+
} else {
|
|
72
|
+
this.#heading.removeAttribute("role");
|
|
73
|
+
this.#heading.removeAttribute("aria-level");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
define("punica-accordion", PunicaAccordion);
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
PunicaAccordion
|
|
81
|
+
};
|