@punica/components 0.0.0-stage → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +139 -2
- package/bin/punica-components.mjs +138 -0
- package/custom-elements.json +38745 -0
- package/dist/ai/index.d.ts +39 -0
- package/dist/ai/index.mjs +615 -0
- package/dist/ai/node.d.ts +5 -0
- package/dist/ai/node.mjs +625 -0
- package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
- package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
- package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
- package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
- package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
- package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
- package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
- package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
- package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
- package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
- package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
- package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
- package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
- package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
- package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
- package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
- package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
- package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
- package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
- package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
- package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
- package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
- package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
- package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
- package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
- package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
- package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
- package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
- package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
- package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
- package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
- package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
- package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
- package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
- package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
- package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
- package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
- package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
- package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
- package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
- package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
- package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
- package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
- package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
- package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
- package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
- package/dist/esm/chunks/chunk-BC657356.js +93 -0
- package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
- package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
- package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
- package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
- package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
- package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
- package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
- package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
- package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
- package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
- package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
- package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
- package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
- package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
- package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
- package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
- package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
- package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
- package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
- package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
- package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
- package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
- package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
- package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
- package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
- package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
- package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
- package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
- package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
- package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
- package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
- package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
- package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
- package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
- package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
- package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
- package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
- package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
- package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
- package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
- package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
- package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
- package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
- package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
- package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
- package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
- package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
- package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
- package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
- package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
- package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
- package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
- package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
- package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
- package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
- package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
- package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
- package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
- package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
- package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
- package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
- package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
- package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
- package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
- package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
- package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
- package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
- package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
- package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
- package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
- package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
- package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
- package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
- package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
- package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
- package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
- package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
- package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
- package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
- package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
- package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
- package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
- package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
- package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
- package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
- package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
- package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
- package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
- package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
- package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
- package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
- package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
- package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
- package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
- package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
- package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
- package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
- package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
- package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
- package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
- package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
- package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
- package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
- package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
- package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
- package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
- package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
- package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
- package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
- package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
- package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
- package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
- package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
- package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
- package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
- package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
- package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
- package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
- package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
- package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
- package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
- package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
- package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
- package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
- package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
- package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
- package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
- package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
- package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
- package/dist/esm/components/accordion/accordion.js +8 -0
- package/dist/esm/components/accordion/accordionGroup.js +7 -0
- package/dist/esm/components/agenda/agenda.js +9 -0
- package/dist/esm/components/alert/alert.js +8 -0
- package/dist/esm/components/alertDialog/alertDialog.js +14 -0
- package/dist/esm/components/appBar/appBar.js +7 -0
- package/dist/esm/components/appShell/appShell.js +11 -0
- package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
- package/dist/esm/components/autocomplete/autocomplete.js +14 -0
- package/dist/esm/components/avatar/avatar.js +7 -0
- package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
- package/dist/esm/components/badge/badge.js +7 -0
- package/dist/esm/components/banner/banner.js +9 -0
- package/dist/esm/components/blockquote/blockquote.js +7 -0
- package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
- package/dist/esm/components/box/box.js +7 -0
- package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/esm/components/button/button.js +8 -0
- package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
- package/dist/esm/components/calendar/calendar.js +12 -0
- package/dist/esm/components/calendar/dates.js +44 -0
- package/dist/esm/components/card/card.js +7 -0
- package/dist/esm/components/card/cardActions.js +7 -0
- package/dist/esm/components/card/cardContent.js +7 -0
- package/dist/esm/components/card/cardHeader.js +7 -0
- package/dist/esm/components/card/cardMedia.js +7 -0
- package/dist/esm/components/carousel/carousel.js +9 -0
- package/dist/esm/components/carousel/carouselItem.js +7 -0
- package/dist/esm/components/center/center.js +7 -0
- package/dist/esm/components/chat/chatComposer.js +9 -0
- package/dist/esm/components/chat/chatDictationButton.js +8 -0
- package/dist/esm/components/chat/chatLayout.js +9 -0
- package/dist/esm/components/chat/chatMessage.js +9 -0
- package/dist/esm/components/chat/chatMessageBubble.js +7 -0
- package/dist/esm/components/chat/chatMessageList.js +8 -0
- package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
- package/dist/esm/components/chat/chatSystemMessage.js +7 -0
- package/dist/esm/components/chat/chatToolCall.js +9 -0
- package/dist/esm/components/chat/chatToolCalls.js +8 -0
- package/dist/esm/components/chat/slots.js +6 -0
- package/dist/esm/components/checkbox/checkbox.js +9 -0
- package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
- package/dist/esm/components/chip/chip.js +8 -0
- package/dist/esm/components/citation/citation.js +11 -0
- package/dist/esm/components/code/code.js +7 -0
- package/dist/esm/components/codeBlock/codeBlock.js +8 -0
- package/dist/esm/components/collapsible/collapsible.js +7 -0
- package/dist/esm/components/commandPalette/commandGroup.js +7 -0
- package/dist/esm/components/commandPalette/commandItem.js +7 -0
- package/dist/esm/components/commandPalette/commandPalette.js +10 -0
- package/dist/esm/components/complexSelector/complexOption.js +9 -0
- package/dist/esm/components/complexSelector/complexSelector.js +16 -0
- package/dist/esm/components/complexSelector/optionGroup.js +7 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/contextMenu/contextMenu.js +12 -0
- package/dist/esm/components/datePicker/datePicker.js +15 -0
- package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
- package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
- package/dist/esm/components/dialog/dialog.js +11 -0
- package/dist/esm/components/dialog/dialogContent.js +7 -0
- package/dist/esm/components/dialog/dialogFooter.js +7 -0
- package/dist/esm/components/dialog/dialogHeader.js +7 -0
- package/dist/esm/components/dialog/modalSurface.js +8 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/drawer/drawer.js +10 -0
- package/dist/esm/components/emptyState/emptyState.js +7 -0
- package/dist/esm/components/field/field.js +7 -0
- package/dist/esm/components/fileInput/fileInput.js +9 -0
- package/dist/esm/components/formLayout/formLayout.js +7 -0
- package/dist/esm/components/grid/col.js +7 -0
- package/dist/esm/components/grid/row.js +7 -0
- package/dist/esm/components/heading/heading.js +7 -0
- package/dist/esm/components/hidden/hidden.js +7 -0
- package/dist/esm/components/hoverCard/hoverCard.js +9 -0
- package/dist/esm/components/icon/icon.js +8 -0
- package/dist/esm/components/iconButton/iconButton.js +8 -0
- package/dist/esm/components/infoTip/infoTip.js +10 -0
- package/dist/esm/components/input/input.js +9 -0
- package/dist/esm/components/inputGroup/inputGroup.js +9 -0
- package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
- package/dist/esm/components/kbd/kbd.js +7 -0
- package/dist/esm/components/lightbox/lightbox.js +10 -0
- package/dist/esm/components/link/link.js +8 -0
- package/dist/esm/components/listView/list.js +7 -0
- package/dist/esm/components/listView/listItem.js +7 -0
- package/dist/esm/components/listbox/listbox.js +9 -0
- package/dist/esm/components/listbox/listboxItem.js +8 -0
- package/dist/esm/components/markdown/markdown.js +9 -0
- package/dist/esm/components/markdown/parser.js +9 -0
- package/dist/esm/components/markdown/url.js +6 -0
- package/dist/esm/components/menu/menu.js +11 -0
- package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
- package/dist/esm/components/menu/menuDivider.js +7 -0
- package/dist/esm/components/menu/menuGroup.js +7 -0
- package/dist/esm/components/menu/menuItem.js +8 -0
- package/dist/esm/components/menu/menuRadioGroup.js +7 -0
- package/dist/esm/components/menu/menuRadioItem.js +9 -0
- package/dist/esm/components/metadataList/metadataList.js +9 -0
- package/dist/esm/components/metadataList/metadataListItem.js +8 -0
- package/dist/esm/components/mobileNav/mobileNav.js +10 -0
- package/dist/esm/components/numberInput/numberInput.js +9 -0
- package/dist/esm/components/outline/outline.js +8 -0
- package/dist/esm/components/overflowList/overflowList.js +11 -0
- package/dist/esm/components/pagination/pagination.js +8 -0
- package/dist/esm/components/paper/paper.js +7 -0
- package/dist/esm/components/popover/popover.js +9 -0
- package/dist/esm/components/powerSearch/powerSearch.js +14 -0
- package/dist/esm/components/progressBar/progressBar.js +7 -0
- package/dist/esm/components/qrCode/qrCode.js +9 -0
- package/dist/esm/components/radio/radio.js +7 -0
- package/dist/esm/components/radio/radioGroup.js +10 -0
- package/dist/esm/components/scrollArea/scrollArea.js +8 -0
- package/dist/esm/components/section/section.js +8 -0
- package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
- package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
- package/dist/esm/components/select/field.js +18 -0
- package/dist/esm/components/select/option.js +8 -0
- package/dist/esm/components/select/select.js +14 -0
- package/dist/esm/components/selectableCard/selectableCard.js +9 -0
- package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
- package/dist/esm/components/sideNav/sideNav.js +9 -0
- package/dist/esm/components/sideNav/sideNavItem.js +9 -0
- package/dist/esm/components/sideNav/sideNavSection.js +8 -0
- package/dist/esm/components/skeleton/skeleton.js +7 -0
- package/dist/esm/components/slider/slider.js +9 -0
- package/dist/esm/components/spinner/spinner.js +7 -0
- package/dist/esm/components/split/split.js +8 -0
- package/dist/esm/components/splitButton/splitButton.js +12 -0
- package/dist/esm/components/stack/stack.js +7 -0
- package/dist/esm/components/statusDot/statusDot.js +7 -0
- package/dist/esm/components/stepper/step.js +8 -0
- package/dist/esm/components/stepper/stepper.js +7 -0
- package/dist/esm/components/switch/switch.js +8 -0
- package/dist/esm/components/tab/tab.js +7 -0
- package/dist/esm/components/tab/tabPanel.js +7 -0
- package/dist/esm/components/tab/tabs.js +8 -0
- package/dist/esm/components/table/table.js +7 -0
- package/dist/esm/components/table/tableBody.js +7 -0
- package/dist/esm/components/table/tableCell.js +7 -0
- package/dist/esm/components/table/tableFooter.js +7 -0
- package/dist/esm/components/table/tableHeader.js +7 -0
- package/dist/esm/components/table/tableHeaderCell.js +8 -0
- package/dist/esm/components/table/tableRow.js +7 -0
- package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
- package/dist/esm/components/text/text.js +7 -0
- package/dist/esm/components/textarea/textarea.js +8 -0
- package/dist/esm/components/thumbnail/thumbnail.js +8 -0
- package/dist/esm/components/timePicker/timePicker.js +15 -0
- package/dist/esm/components/timer/timer.js +7 -0
- package/dist/esm/components/timestamp/timestamp.js +7 -0
- package/dist/esm/components/toast/toast.js +8 -0
- package/dist/esm/components/toast/toaster.js +12 -0
- package/dist/esm/components/toggleButton/toggleButton.js +8 -0
- package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
- package/dist/esm/components/tokenizer/tokenizer.js +14 -0
- package/dist/esm/components/toolbar/toolbar.js +8 -0
- package/dist/esm/components/tooltip/tooltip.js +9 -0
- package/dist/esm/components/topNav/topNav.js +11 -0
- package/dist/esm/components/topNav/topNavItem.js +11 -0
- package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
- package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
- package/dist/esm/components/tree/tree.js +8 -0
- package/dist/esm/components/tree/treeItem.js +8 -0
- package/dist/esm/components/virtualList/virtualList.js +7 -0
- package/dist/esm/components/virtualTable/virtualTable.js +9 -0
- package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
- package/dist/esm/core/a11y.js +22 -0
- package/dist/esm/core/element.js +14 -0
- package/dist/esm/core/form.js +6 -0
- package/dist/esm/core/overlay.js +8 -0
- package/dist/esm/index.js +779 -0
- package/dist/llms-full.txt +8890 -0
- package/dist/llms.txt +275 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6753 -0
- package/dist/types/react.d.ts +1914 -0
- package/dist/vscode.css-custom-data.json +3892 -0
- package/dist/vscode.html-custom-data.json +6912 -0
- package/dist/web-types.json +12404 -0
- package/docs/MIGRATION-2.0.md +112 -0
- package/docs/contract.md +130 -0
- package/docs/migration/chat.md +309 -0
- package/docs/migration/content.md +806 -0
- package/docs/migration/data.md +140 -0
- package/docs/migration/display.md +625 -0
- package/docs/migration/form-basic.md +262 -0
- package/docs/migration/navigation.md +368 -0
- package/docs/migration/overlays.md +261 -0
- package/docs/migration/pickers.md +194 -0
- package/package.json +131 -4
- package/scripts/codemod-2.0.mjs +50 -0
- package/scripts/codemod-rules.mjs +102 -0
- package/skills/punica-components/SKILL.md +48 -0
|
@@ -0,0 +1,150 @@
|
|
|
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/topNavItem.css
|
|
13
|
+
var topNavItem_default = ":host {\n --punica-top-nav-item-height: var(--punica-size-md);\n --punica-top-nav-item-radius: var(--punica-radius);\n --punica-top-nav-item-padding: var(--punica-space-12);\n --punica-top-nav-item-current-background: var(--punica-color-selected);\n --punica-top-nav-item-current-color: currentColor;\n\n display: inline-flex;\n}\n\n.control {\n all: unset;\n box-sizing: border-box;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n min-block-size: var(--punica-top-nav-item-height);\n padding-inline: var(--punica-top-nav-item-padding);\n border-radius: var(--punica-top-nav-item-radius);\n /* Inherited, so a colour set on the navigation or the item reaches the label. */\n color: inherit;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n font-weight: var(--punica-font-weight-medium);\n line-height: 1.25;\n white-space: nowrap;\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n.control:hover,\n.control[aria-expanded='true'] {\n background: var(--punica-color-hover);\n}\n.control[aria-current] {\n background: var(--punica-top-nav-item-current-background);\n color: var(--punica-top-nav-item-current-color);\n font-weight: var(--punica-font-weight-semi-bold);\n}\n/* The ring sits inside the control: the row around it clips what overflows. */\n.control:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n.control:disabled,\n.control[aria-disabled='true'] {\n cursor: default;\n pointer-events: none;\n opacity: var(--punica-disabled-opacity);\n}\n\n.content {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: var(--punica-space-8);\n}\n.label {\n flex: 1 1 auto;\n text-align: start;\n}\n\n.chevron {\n display: inline-flex;\n flex: none;\n transition: transform var(--punica-duration) var(--punica-ease);\n}\n.control[aria-expanded='true'] .chevron {\n transform: rotate(180deg);\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/* A mega menu sets its own width; the panel follows it, up to the viewport. */\n:host(:state(mega)) [part='popover'] {\n --punica-popover-max-width: calc(100vw - var(--punica-space-16));\n}\n.menu ::slotted(punica-top-nav-mega-menu) {\n display: block;\n}\n\n[hidden] {\n display: none !important;\n}\n\n@media (forced-colors: active) {\n .control[aria-current] {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(-1 * var(--punica-border-width));\n }\n .control:disabled,\n .control[aria-disabled='true'] {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/topNav/topNavItem.js
|
|
16
|
+
var FOCUSABLE = 'a[href],button:not([disabled]),punica-top-nav-item:not([disabled]),punica-top-nav-mega-menu-item:not([disabled]),punica-top-nav-mega-menu-card[href],[tabindex]:not([tabindex="-1"])';
|
|
17
|
+
var PunicaTopNavItem = class extends PunicaElement {
|
|
18
|
+
static properties = {
|
|
19
|
+
href: {},
|
|
20
|
+
target: {},
|
|
21
|
+
rel: {},
|
|
22
|
+
current: { type: Boolean },
|
|
23
|
+
disabled: { type: Boolean },
|
|
24
|
+
open: { type: Boolean }
|
|
25
|
+
};
|
|
26
|
+
static styles = topNavItem_default;
|
|
27
|
+
static shadowOptions = { delegatesFocus: true };
|
|
28
|
+
static template = `
|
|
29
|
+
<a part="control" class="control" hidden></a>
|
|
30
|
+
<button part="control" class="control" type="button" hidden></button>
|
|
31
|
+
<span class="content">
|
|
32
|
+
<slot name="start"></slot>
|
|
33
|
+
<span part="label" class="label"><slot></slot></span>
|
|
34
|
+
<slot name="end"></slot>
|
|
35
|
+
<span part="chevron" class="chevron" hidden>${icons.chevronDown}</span>
|
|
36
|
+
</span>
|
|
37
|
+
<punica-popover part="popover" panel-role="group">
|
|
38
|
+
<div part="menu" class="menu"><slot name="menu"></slot></div>
|
|
39
|
+
</punica-popover>
|
|
40
|
+
`;
|
|
41
|
+
#link = this.$("a");
|
|
42
|
+
#button = this.$("button");
|
|
43
|
+
#content = this.$(".content");
|
|
44
|
+
#chevron = this.$(".chevron");
|
|
45
|
+
#popover = this.$("punica-popover");
|
|
46
|
+
#menu = this.$(".menu");
|
|
47
|
+
#menuSlot = this.$('slot[name="menu"]');
|
|
48
|
+
#labelSlot = this.$(".label slot");
|
|
49
|
+
#hasMenu = false;
|
|
50
|
+
#mega = false;
|
|
51
|
+
constructor() {
|
|
52
|
+
super();
|
|
53
|
+
this.#menuSlot.addEventListener("slotchange", () => {
|
|
54
|
+
const assigned = this.#menuSlot.assignedElements();
|
|
55
|
+
const has = assigned.length > 0;
|
|
56
|
+
const mega = assigned.some((el) => el.localName === "punica-top-nav-mega-menu");
|
|
57
|
+
if (has === this.#hasMenu && mega === this.#mega) return;
|
|
58
|
+
this.#hasMenu = has;
|
|
59
|
+
this.#mega = mega;
|
|
60
|
+
this.requestUpdate();
|
|
61
|
+
});
|
|
62
|
+
this.#button.addEventListener("click", () => {
|
|
63
|
+
if (this.#hasMenu && !this.disabled) this.open = !this.open;
|
|
64
|
+
});
|
|
65
|
+
this.#popover.addEventListener("punica-close", (event) => {
|
|
66
|
+
if (event.target === this.#popover) this.open = false;
|
|
67
|
+
});
|
|
68
|
+
this.shadowRoot.addEventListener("keydown", (event) => this.#onKeydown(
|
|
69
|
+
/** @type {KeyboardEvent} */
|
|
70
|
+
event
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
/** The item's label as text. */
|
|
74
|
+
get text() {
|
|
75
|
+
return this.#labelSlot.assignedNodes({ flatten: true }).map((node) => node.textContent).join("").replace(/\s+/g, " ").trim();
|
|
76
|
+
}
|
|
77
|
+
update() {
|
|
78
|
+
const menu = this.#hasMenu;
|
|
79
|
+
const asLink = !!this.href && !menu;
|
|
80
|
+
const control = asLink ? this.#link : this.#button;
|
|
81
|
+
const other = asLink ? this.#button : this.#link;
|
|
82
|
+
this.toggleState("has-menu", menu);
|
|
83
|
+
this.toggleState("mega", menu && this.#mega);
|
|
84
|
+
if (this.#content.parentNode !== control) control.append(this.#content);
|
|
85
|
+
control.hidden = false;
|
|
86
|
+
other.hidden = true;
|
|
87
|
+
other.removeAttribute("aria-current");
|
|
88
|
+
if (this.current) control.setAttribute("aria-current", "page");
|
|
89
|
+
else control.removeAttribute("aria-current");
|
|
90
|
+
const link = this.#link;
|
|
91
|
+
if (asLink && !this.disabled) {
|
|
92
|
+
link.setAttribute("href", this.href);
|
|
93
|
+
link.removeAttribute("role");
|
|
94
|
+
link.removeAttribute("aria-disabled");
|
|
95
|
+
} else {
|
|
96
|
+
link.removeAttribute("href");
|
|
97
|
+
link.setAttribute("role", "link");
|
|
98
|
+
link.setAttribute("aria-disabled", "true");
|
|
99
|
+
}
|
|
100
|
+
for (const name of ["target", "rel"]) {
|
|
101
|
+
if (this[name]) link.setAttribute(name, this[name]);
|
|
102
|
+
else link.removeAttribute(name);
|
|
103
|
+
}
|
|
104
|
+
const button = this.#button;
|
|
105
|
+
const open = menu && this.open && !this.disabled;
|
|
106
|
+
button.disabled = this.disabled;
|
|
107
|
+
if (menu) button.setAttribute("aria-expanded", String(open));
|
|
108
|
+
else button.removeAttribute("aria-expanded");
|
|
109
|
+
this.#chevron.hidden = !menu;
|
|
110
|
+
this.#popover.anchor = button;
|
|
111
|
+
this.#popover.label = this.text || null;
|
|
112
|
+
this.#popover.open = open;
|
|
113
|
+
}
|
|
114
|
+
/** @returns {HTMLElement[]} what the arrow keys move between in the menu */
|
|
115
|
+
#focusable() {
|
|
116
|
+
return this.#menuSlot.assignedElements({ flatten: true }).flatMap((el) => el.matches(FOCUSABLE) ? [el] : [...el.querySelectorAll(FOCUSABLE)]).filter((el) => el.parentElement?.closest("punica-top-nav-item") === this);
|
|
117
|
+
}
|
|
118
|
+
/** @param {KeyboardEvent} event */
|
|
119
|
+
#onKeydown(event) {
|
|
120
|
+
if (!this.#hasMenu || event.defaultPrevented) return;
|
|
121
|
+
const path = event.composedPath();
|
|
122
|
+
if (path.includes(this.#button)) {
|
|
123
|
+
if (event.key !== "ArrowDown" || this.disabled) return;
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
if (this.open) this.#focusable()[0]?.focus();
|
|
126
|
+
else this.open = true;
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (!path.includes(this.#menu)) return;
|
|
130
|
+
if (event.key === "Escape") {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
event.stopPropagation();
|
|
133
|
+
this.#popover.hide("escape");
|
|
134
|
+
this.#button.focus();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const items = this.#focusable();
|
|
138
|
+
const current = items.findIndex((item) => item === path[0] || item.matches(":focus-within") || item.matches(":focus"));
|
|
139
|
+
const index = nextIndex(event, items.length, current, { orientation: "vertical" });
|
|
140
|
+
if (index < 0) return;
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
event.stopPropagation();
|
|
143
|
+
items[index].focus();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
define("punica-top-nav-item", PunicaTopNavItem);
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
PunicaTopNavItem
|
|
150
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/inputGroup/inputGroupText.css
|
|
7
|
+
var inputGroupText_default = ":host {\n --punica-input-group-text-height: var(--punica-size-md);\n --punica-input-group-text-padding: var(--punica-space-12);\n --punica-input-group-text-radius: var(--punica-radius);\n --punica-input-group-text-background: var(--punica-color-neutral-light);\n --punica-input-group-text-color: var(--punica-color-text-muted);\n\n display: inline-flex;\n flex: none;\n min-block-size: var(--punica-input-group-text-height);\n border: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: var(--punica-input-group-text-radius);\n background: var(--punica-input-group-text-background);\n color: var(--punica-input-group-text-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: 1;\n white-space: nowrap;\n}\n\n.base {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-6);\n padding-inline: var(--punica-input-group-text-padding);\n unicode-bidi: plaintext;\n}\n\n@media (forced-colors: active) {\n :host {\n border-color: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/inputGroup/inputGroupText.js
|
|
10
|
+
var PunicaInputGroupText = class extends PunicaElement {
|
|
11
|
+
static styles = inputGroupText_default;
|
|
12
|
+
static template = `<span part="base" class="base"><slot></slot></span>`;
|
|
13
|
+
};
|
|
14
|
+
define("punica-input-group-text", PunicaInputGroupText);
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
PunicaInputGroupText
|
|
18
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/menu/menuItem.css
|
|
10
|
+
var menuItem_default = ":host {\n --punica-menu-item-radius: var(--punica-radius-sm);\n --punica-menu-item-padding: var(--punica-space-8) var(--punica-space-12);\n --punica-menu-item-highlight: var(--punica-color-hover);\n\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-menu-item-padding);\n border-radius: var(--punica-menu-item-radius);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n text-align: start;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n outline: none;\n}\n\n:host(:hover),\n:host(:focus),\n:host(:state(submenu-open)) {\n background: var(--punica-menu-item-highlight);\n}\n\n:host(:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n:host([disabled]) {\n color: color-mix(in srgb, var(--punica-color-text) 75%, transparent);\n opacity: var(--punica-disabled-opacity);\n cursor: default;\n pointer-events: none;\n}\n\n.label {\n flex: 1;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n::slotted([slot='start']),\n::slotted([slot='end']) {\n flex: none;\n}\n\n::slotted([slot='end']) {\n margin-inline-start: var(--punica-space-16);\n color: color-mix(in srgb, var(--punica-color-text) 75%, transparent);\n font-size: var(--punica-font-size-xs);\n}\n\n.chevron {\n display: none;\n flex: none;\n margin-inline-start: var(--punica-space-8);\n color: color-mix(in srgb, var(--punica-color-text) 75%, transparent);\n}\n\n:host(:state(has-submenu)) .chevron {\n display: inline-flex;\n}\n\n:host(:dir(rtl)) .chevron .icon {\n transform: scaleX(-1);\n}\n\n.indicator {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: 1em;\n block-size: 1em;\n visibility: hidden;\n}\n\n:host(:state(checked)) .indicator {\n visibility: visible;\n}\n\n@media (forced-colors: active) {\n :host(:hover),\n :host(:focus),\n :host(:state(submenu-open)) {\n outline: var(--punica-focus-ring-width) solid Highlight;\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n }\n :host([disabled]) {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/menu/menuItem.js
|
|
13
|
+
var PunicaMenuItem = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
value: {},
|
|
16
|
+
disabled: { type: Boolean }
|
|
17
|
+
};
|
|
18
|
+
static styles = menuItem_default;
|
|
19
|
+
static template = `
|
|
20
|
+
<slot name="start"></slot>
|
|
21
|
+
<span part="label" class="label"><slot></slot></span>
|
|
22
|
+
<slot name="end"></slot>
|
|
23
|
+
<span part="submenu-icon" class="chevron" aria-hidden="true">${icons.chevronEnd}</span>
|
|
24
|
+
<slot name="submenu"></slot>
|
|
25
|
+
`;
|
|
26
|
+
/** ARIA role of the item. */
|
|
27
|
+
static role = "menuitem";
|
|
28
|
+
#submenuSlot = this.$('slot[name="submenu"]');
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
const slot = this.#submenuSlot;
|
|
32
|
+
if (!slot) return;
|
|
33
|
+
slot.addEventListener("slotchange", () => this.requestUpdate());
|
|
34
|
+
for (const type of ["punica-open", "punica-close"]) {
|
|
35
|
+
slot.addEventListener(type, (event) => {
|
|
36
|
+
if (event.target !== this.submenu) return;
|
|
37
|
+
const open = type === "punica-open";
|
|
38
|
+
this.internals.ariaExpanded = String(open);
|
|
39
|
+
this.toggleState("submenu-open", open);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** The menu this item opens, if it has one. */
|
|
44
|
+
get submenu() {
|
|
45
|
+
const el = this.#submenuSlot?.assignedElements()[0];
|
|
46
|
+
return el && el.localName === "punica-menu" ? (
|
|
47
|
+
/** @type {any} */
|
|
48
|
+
el
|
|
49
|
+
) : null;
|
|
50
|
+
}
|
|
51
|
+
/** The item's own text, without its submenu's. */
|
|
52
|
+
get labelText() {
|
|
53
|
+
return this.$(".label slot").assignedNodes({ flatten: true }).map((node) => node.textContent).join("").trim();
|
|
54
|
+
}
|
|
55
|
+
/** What choosing the item does to the item itself: nothing for a plain one. */
|
|
56
|
+
activate() {
|
|
57
|
+
}
|
|
58
|
+
connected() {
|
|
59
|
+
this.internals.role = /** @type {typeof PunicaMenuItem} */
|
|
60
|
+
this.constructor.role;
|
|
61
|
+
if (!this.hasAttribute("tabindex")) this.tabIndex = -1;
|
|
62
|
+
}
|
|
63
|
+
update() {
|
|
64
|
+
this.internals.ariaDisabled = this.disabled ? "true" : null;
|
|
65
|
+
const sub = this.submenu;
|
|
66
|
+
this.toggleState("has-submenu", !!sub);
|
|
67
|
+
this.internals.ariaHasPopup = sub ? "menu" : null;
|
|
68
|
+
if (!sub) this.internals.ariaExpanded = null;
|
|
69
|
+
else if (this.internals.ariaExpanded == null) this.internals.ariaExpanded = "false";
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
define("punica-menu-item", PunicaMenuItem);
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
menuItem_default,
|
|
76
|
+
PunicaMenuItem
|
|
77
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/stepper/stepper.css
|
|
7
|
+
var stepper_default = ":host {\n --punica-stepper-gap: var(--punica-space-8);\n\n display: flex;\n align-items: flex-start;\n gap: var(--punica-stepper-gap);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n:host(:not([orientation='vertical'])) {\n /* Its steps read its width to fold their titles on a narrow screen. A\n definite width keeps a flex parent from sizing it at zero width. */\n container: punica-stepper / inline-size;\n inline-size: 100%;\n}\n\n:host([orientation='vertical']) {\n flex-direction: column;\n align-items: stretch;\n}\n\n::slotted(punica-step) {\n --punica-step-gap: var(--punica-stepper-gap);\n\n /* Sized by its title; the room left over goes to the connectors. */\n flex: 1 1 auto;\n}\n\n/* Nothing follows the last step. */\n::slotted(punica-step:last-of-type) {\n --punica-step-connector-display: none;\n\n flex: 0 0 auto;\n}\n\n:host([orientation='vertical']) ::slotted(punica-step) {\n flex: 0 0 auto;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/stepper/stepper.js
|
|
10
|
+
var PunicaStepper = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
orientation: { default: "horizontal" },
|
|
14
|
+
linear: { type: Boolean },
|
|
15
|
+
label: {}
|
|
16
|
+
};
|
|
17
|
+
static styles = stepper_default;
|
|
18
|
+
static template = `<slot></slot>`;
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.internals.role = "list";
|
|
22
|
+
this.$("slot").addEventListener("slotchange", () => this.requestUpdate());
|
|
23
|
+
this.addEventListener("click", (event) => {
|
|
24
|
+
const step = (
|
|
25
|
+
/** @type {Element} */
|
|
26
|
+
event.target.closest?.("punica-step")
|
|
27
|
+
);
|
|
28
|
+
if (!step || step.parentElement !== this || this.linear || step.hasAttribute("disabled")) return;
|
|
29
|
+
const value = this.#key(step, this.steps.indexOf(step));
|
|
30
|
+
if (value === this.#activeKey()) return;
|
|
31
|
+
this.value = value;
|
|
32
|
+
this.emit("change", { value });
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** The steps, in order. */
|
|
36
|
+
get steps() {
|
|
37
|
+
return (
|
|
38
|
+
/** @type {any[]} */
|
|
39
|
+
[...this.children].filter((el) => el.localName === "punica-step")
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
/** Index of the active step, -1 with no steps. */
|
|
43
|
+
get activeIndex() {
|
|
44
|
+
const steps = this.steps;
|
|
45
|
+
if (!steps.length) return -1;
|
|
46
|
+
const index = this.value == null ? -1 : steps.findIndex((step, i) => this.#key(step, i) === this.value);
|
|
47
|
+
return index < 0 ? 0 : index;
|
|
48
|
+
}
|
|
49
|
+
/** Makes the following step active. Fires nothing. */
|
|
50
|
+
next() {
|
|
51
|
+
this.#move(1);
|
|
52
|
+
}
|
|
53
|
+
/** Makes the preceding step active. Fires nothing. */
|
|
54
|
+
previous() {
|
|
55
|
+
this.#move(-1);
|
|
56
|
+
}
|
|
57
|
+
connected() {
|
|
58
|
+
this.requestUpdate();
|
|
59
|
+
}
|
|
60
|
+
#key(step, index) {
|
|
61
|
+
return step.value ?? step.getAttribute("value") ?? String(index);
|
|
62
|
+
}
|
|
63
|
+
#activeKey() {
|
|
64
|
+
const index = this.activeIndex;
|
|
65
|
+
return index < 0 ? null : this.#key(this.steps[index], index);
|
|
66
|
+
}
|
|
67
|
+
#move(by) {
|
|
68
|
+
const steps = this.steps;
|
|
69
|
+
const index = Math.min(steps.length - 1, Math.max(0, this.activeIndex + by));
|
|
70
|
+
if (index >= 0) this.value = this.#key(steps[index], index);
|
|
71
|
+
}
|
|
72
|
+
update() {
|
|
73
|
+
this.internals.ariaLabel = this.label || null;
|
|
74
|
+
const steps = this.steps;
|
|
75
|
+
const active = this.activeIndex;
|
|
76
|
+
if (this.value == null && active >= 0) this.value = this.#key(steps[active], active);
|
|
77
|
+
steps.forEach((step, i) => {
|
|
78
|
+
step.index = i + 1;
|
|
79
|
+
step.active = i === active;
|
|
80
|
+
step.interactive = !this.linear;
|
|
81
|
+
step.orientation = this.orientation === "vertical" ? "vertical" : "horizontal";
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
define("punica-stepper", PunicaStepper);
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
PunicaStepper
|
|
89
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/listbox/listboxItem.css
|
|
10
|
+
var listboxItem_default = ":host {\n --punica-listbox-item-padding: var(--punica-space-8) var(--punica-space-16);\n --punica-listbox-item-hover-background: var(--punica-color-hover);\n --punica-listbox-item-selected-background: var(--punica-color-selected);\n\n display: block;\n cursor: pointer;\n user-select: none;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.base {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-listbox-item-padding);\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:hover) .base {\n background: var(--punica-listbox-item-hover-background);\n}\n\n:host([selected]) .base {\n background: var(--punica-listbox-item-selected-background);\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.label {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\n.check {\n display: inline-flex;\n visibility: hidden;\n color: var(--punica-color-primary);\n}\n\n:host([selected]) .check {\n visibility: visible;\n}\n\n@media (forced-colors: active) {\n :host([selected]) .base {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(var(--punica-border-width) * -1);\n }\n :host([disabled]) {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/listbox/listboxItem.js
|
|
13
|
+
var PunicaListboxItem = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
value: {},
|
|
16
|
+
selected: { type: Boolean },
|
|
17
|
+
disabled: { type: Boolean }
|
|
18
|
+
};
|
|
19
|
+
static styles = listboxItem_default;
|
|
20
|
+
static template = `
|
|
21
|
+
<div part="base" class="base">
|
|
22
|
+
<slot name="start"></slot>
|
|
23
|
+
<span part="label" class="label"><slot></slot></span>
|
|
24
|
+
<slot name="end"></slot>
|
|
25
|
+
<span part="check" class="check">${icons.check}</span>
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.internals.role = "option";
|
|
31
|
+
}
|
|
32
|
+
update(changed) {
|
|
33
|
+
this.internals.ariaSelected = String(this.selected);
|
|
34
|
+
this.internals.ariaDisabled = this.disabled ? "true" : null;
|
|
35
|
+
this.toggleState("selected", this.selected);
|
|
36
|
+
if (changed.has("value") || changed.has("disabled")) {
|
|
37
|
+
this.parentElement?.requestUpdate?.();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
define("punica-listbox-item", PunicaListboxItem);
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
PunicaListboxItem
|
|
45
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModalSurface
|
|
3
|
+
} from "./chunk-FFH6CIAJ.js";
|
|
4
|
+
import {
|
|
5
|
+
isRtl
|
|
6
|
+
} from "./chunk-4RURT4SK.js";
|
|
7
|
+
import {
|
|
8
|
+
icons
|
|
9
|
+
} from "./chunk-YSGWORUD.js";
|
|
10
|
+
import {
|
|
11
|
+
PunicaElement,
|
|
12
|
+
define
|
|
13
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
14
|
+
|
|
15
|
+
// src/components/lightbox/lightbox.css
|
|
16
|
+
var lightbox_default = ":host {\n --punica-lightbox-background: color-mix(in srgb, var(--punica-color-black) 88%, transparent);\n --punica-lightbox-color: var(--punica-color-white);\n --punica-lightbox-control-background: color-mix(in srgb, var(--punica-color-black) 60%, transparent);\n --punica-lightbox-padding: var(--punica-space-48);\n --punica-lightbox-radius: var(--punica-radius-sm);\n\n display: contents;\n}\n\ndialog {\n position: fixed;\n inset: 0;\n inline-size: 100%;\n block-size: 100dvh;\n max-inline-size: none;\n max-block-size: none;\n margin: 0;\n padding: var(--punica-lightbox-padding);\n border: 0;\n background: var(--punica-lightbox-background);\n color: var(--punica-lightbox-color);\n font-family: var(--punica-font-family);\n overflow: hidden;\n opacity: 0;\n transition: opacity var(--punica-duration) var(--punica-ease),\n display var(--punica-duration) allow-discrete,\n overlay var(--punica-duration) allow-discrete;\n}\n\ndialog[open] {\n display: grid;\n place-items: center;\n opacity: 1;\n}\n\n@starting-style {\n dialog[open] {\n opacity: 0;\n }\n}\n\ndialog::backdrop {\n background: transparent;\n}\n\ndialog:focus-visible {\n outline: none;\n}\n\nfigure {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--punica-space-12);\n max-inline-size: 100%;\n max-block-size: 100%;\n min-block-size: 0;\n margin: 0;\n}\n\nimg {\n display: block;\n min-block-size: 0;\n max-inline-size: 100%;\n max-block-size: calc(100dvh - 2 * var(--punica-lightbox-padding) - var(--punica-space-48));\n border-radius: var(--punica-lightbox-radius);\n object-fit: contain;\n}\n\nfigcaption {\n max-inline-size: 60ch;\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n text-align: center;\n}\n\nfigcaption:empty {\n display: none;\n}\n\nbutton {\n all: unset;\n position: absolute;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-lg);\n block-size: var(--punica-size-lg);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-radius-full);\n background: var(--punica-lightbox-control-background);\n color: var(--punica-lightbox-color);\n font-size: var(--punica-font-size-xl);\n cursor: pointer;\n transition: background-color var(--punica-duration) var(--punica-ease);\n}\n\nbutton:hover {\n background: color-mix(in srgb, var(--punica-lightbox-color) 20%, var(--punica-lightbox-control-background));\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring-width) solid var(--punica-lightbox-color);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton[aria-disabled='true'] {\n opacity: var(--punica-disabled-opacity);\n cursor: default;\n}\n\n.previous {\n inset-block-start: calc(50% - var(--punica-size-lg) / 2);\n inset-inline-start: var(--punica-space-12);\n}\n\n.next {\n inset-block-start: calc(50% - var(--punica-size-lg) / 2);\n inset-inline-end: var(--punica-space-12);\n}\n\n.close {\n inset-block-start: var(--punica-space-12);\n inset-inline-end: var(--punica-space-12);\n}\n\n:host(:dir(rtl)) .previous .icon,\n:host(:dir(rtl)) .next .icon {\n transform: scaleX(-1);\n}\n\n.counter {\n position: absolute;\n inset-block-start: var(--punica-space-12);\n inset-inline-start: var(--punica-space-12);\n padding: var(--punica-space-4) var(--punica-space-8);\n border-radius: var(--punica-radius-full);\n background: var(--punica-lightbox-control-background);\n font-size: var(--punica-font-size-sm);\n font-variant-numeric: tabular-nums;\n}\n\n[hidden] {\n display: none !important;\n}\n\n@media (forced-colors: active) {\n button {\n border-color: ButtonText;\n }\n button[aria-disabled='true'] {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
17
|
+
|
|
18
|
+
// src/components/lightbox/lightbox.js
|
|
19
|
+
var PunicaLightbox = class extends ModalSurface(PunicaElement) {
|
|
20
|
+
static properties = {
|
|
21
|
+
index: { type: Number, default: 0 },
|
|
22
|
+
items: { type: Array, attribute: false },
|
|
23
|
+
labelClose: { default: "Close" },
|
|
24
|
+
labelPrevious: { default: "Previous image" },
|
|
25
|
+
labelNext: { default: "Next image" }
|
|
26
|
+
};
|
|
27
|
+
static styles = lightbox_default;
|
|
28
|
+
static template = `
|
|
29
|
+
<slot></slot>
|
|
30
|
+
<dialog part="dialog">
|
|
31
|
+
<figure part="figure" aria-live="polite" aria-atomic="true">
|
|
32
|
+
<img part="image" alt="" hidden>
|
|
33
|
+
<figcaption part="caption"></figcaption>
|
|
34
|
+
</figure>
|
|
35
|
+
<button part="previous-button" class="previous" type="button">${icons.chevronStart}</button>
|
|
36
|
+
<button part="next-button" class="next" type="button">${icons.chevronEnd}</button>
|
|
37
|
+
<span part="counter" class="counter"></span>
|
|
38
|
+
<button part="close-button" class="close" type="button">${icons.close}</button>
|
|
39
|
+
</dialog>
|
|
40
|
+
`;
|
|
41
|
+
#slot = this.$("slot");
|
|
42
|
+
#image = this.$("img");
|
|
43
|
+
#previous = this.$(".previous");
|
|
44
|
+
#next = this.$(".next");
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this.$(".close").addEventListener("click", () => this.requestClose("close-button"));
|
|
48
|
+
this.#previous.addEventListener("click", () => this.previous());
|
|
49
|
+
this.#next.addEventListener("click", () => this.next());
|
|
50
|
+
this.dialogElement.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
51
|
+
this.#slot.addEventListener("slotchange", () => this.requestUpdate());
|
|
52
|
+
this.#slot.addEventListener("click", (event) => {
|
|
53
|
+
const path = event.composedPath();
|
|
54
|
+
const at = this.#thumbnails.findIndex((img) => path.includes(img) || path.some((n) => n instanceof Element && n !== this && n.contains(img) && this.contains(n)));
|
|
55
|
+
if (at < 0) return;
|
|
56
|
+
this.index = at;
|
|
57
|
+
this.show();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** @returns {HTMLImageElement[]} */
|
|
61
|
+
get #thumbnails() {
|
|
62
|
+
return this.#slot.assignedElements({ flatten: true }).flatMap((el) => el instanceof HTMLImageElement ? [el] : [...el.querySelectorAll("img")]);
|
|
63
|
+
}
|
|
64
|
+
/** @returns {{ src: string, alt: string, caption: string }[]} */
|
|
65
|
+
get #list() {
|
|
66
|
+
const items = (
|
|
67
|
+
/** @type {any} */
|
|
68
|
+
this.items
|
|
69
|
+
);
|
|
70
|
+
if (Array.isArray(items) && items.length) {
|
|
71
|
+
return items.map((item) => ({ src: String(item.src ?? ""), alt: String(item.alt ?? ""), caption: String(item.caption ?? "") }));
|
|
72
|
+
}
|
|
73
|
+
return this.#thumbnails.map((img) => ({
|
|
74
|
+
src: img.dataset.full || img.currentSrc || img.src,
|
|
75
|
+
alt: img.alt,
|
|
76
|
+
caption: img.dataset.caption ?? ""
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
/** Number of images. */
|
|
80
|
+
get length() {
|
|
81
|
+
return this.#list.length;
|
|
82
|
+
}
|
|
83
|
+
/** Shows the previous image, as its button does. */
|
|
84
|
+
previous() {
|
|
85
|
+
this.#go(this.#current(this.length) - 1);
|
|
86
|
+
}
|
|
87
|
+
/** Shows the next image, as its button does. */
|
|
88
|
+
next() {
|
|
89
|
+
this.#go(this.#current(this.length) + 1);
|
|
90
|
+
}
|
|
91
|
+
/** Every blank part of the dialog counts as its backdrop. */
|
|
92
|
+
isBackdropHit() {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
update(changed) {
|
|
96
|
+
super.update(changed);
|
|
97
|
+
const list = this.#list;
|
|
98
|
+
const at = this.#current(list.length);
|
|
99
|
+
const item = list[at];
|
|
100
|
+
const image = this.#image;
|
|
101
|
+
image.hidden = !item;
|
|
102
|
+
if (item) {
|
|
103
|
+
if (image.getAttribute("src") !== item.src) image.setAttribute("src", item.src);
|
|
104
|
+
image.alt = item.alt;
|
|
105
|
+
} else {
|
|
106
|
+
image.removeAttribute("src");
|
|
107
|
+
}
|
|
108
|
+
this.$("figcaption").textContent = item?.caption ?? "";
|
|
109
|
+
const lang = (
|
|
110
|
+
/** @type {HTMLElement | null} */
|
|
111
|
+
this.closest("[lang]")?.lang || navigator.language
|
|
112
|
+
);
|
|
113
|
+
const number = new Intl.NumberFormat(lang);
|
|
114
|
+
const counter = this.$(".counter");
|
|
115
|
+
counter.hidden = list.length < 2;
|
|
116
|
+
counter.textContent = list.length ? `${number.format(at + 1)} / ${number.format(list.length)}` : "";
|
|
117
|
+
this.$(".close").setAttribute("aria-label", this.labelClose);
|
|
118
|
+
this.#previous.setAttribute("aria-label", this.labelPrevious);
|
|
119
|
+
this.#next.setAttribute("aria-label", this.labelNext);
|
|
120
|
+
this.#previous.hidden = this.#next.hidden = list.length < 2;
|
|
121
|
+
this.#previous.setAttribute("aria-disabled", String(at <= 0));
|
|
122
|
+
this.#next.setAttribute("aria-disabled", String(at >= list.length - 1));
|
|
123
|
+
}
|
|
124
|
+
/** @param {number} length */
|
|
125
|
+
#current(length) {
|
|
126
|
+
return Math.max(0, Math.min(length - 1, Math.round(this.index ?? 0)));
|
|
127
|
+
}
|
|
128
|
+
/** @param {number} to */
|
|
129
|
+
#go(to) {
|
|
130
|
+
const length = this.length;
|
|
131
|
+
const next = Math.max(0, Math.min(length - 1, to));
|
|
132
|
+
if (!length || next === this.#current(length)) return;
|
|
133
|
+
this.index = next;
|
|
134
|
+
this.emit("change", { index: next });
|
|
135
|
+
}
|
|
136
|
+
/** @param {KeyboardEvent} event */
|
|
137
|
+
#onKeydown(event) {
|
|
138
|
+
const forward = isRtl(this.dialogElement) ? "ArrowLeft" : "ArrowRight";
|
|
139
|
+
const back = forward === "ArrowRight" ? "ArrowLeft" : "ArrowRight";
|
|
140
|
+
if (event.key === forward) this.next();
|
|
141
|
+
else if (event.key === back) this.previous();
|
|
142
|
+
else if (event.key === "Home") this.#go(0);
|
|
143
|
+
else if (event.key === "End") this.#go(this.length - 1);
|
|
144
|
+
else return;
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
define("punica-lightbox", PunicaLightbox);
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
PunicaLightbox
|
|
152
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/breadcrumbs/breadcrumbItem.css
|
|
10
|
+
var breadcrumbItem_default = ":host {\n --punica-breadcrumb-item-color: var(--punica-color-primary);\n --punica-breadcrumb-item-current-color: var(--punica-color-text);\n\n display: inline-flex;\n align-items: center;\n gap: var(--punica-breadcrumb-item-gap, var(--punica-space-6));\n font-family: var(--punica-font-family);\n}\n\n.link {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-4);\n border-radius: var(--punica-radius-sm);\n color: var(--punica-breadcrumb-item-current-color);\n text-decoration: none;\n}\n\n.link[href] {\n color: var(--punica-breadcrumb-item-color);\n cursor: pointer;\n}\n\n.link[href]:hover {\n text-decoration: underline;\n}\n\n.link[aria-current='page'] {\n color: var(--punica-breadcrumb-item-current-color);\n font-weight: var(--punica-font-weight-semi-bold);\n}\n\n.link:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.separator {\n display: var(--punica-breadcrumb-item-separator-display, inline-flex);\n color: var(--punica-color-text-muted);\n}\n\n:host(:dir(rtl)) .separator .icon {\n transform: scaleX(-1);\n}\n\n@media (forced-colors: active) {\n .link[href] {\n color: LinkText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/breadcrumbs/breadcrumbItem.js
|
|
13
|
+
var PunicaBreadcrumbItem = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
href: {},
|
|
16
|
+
target: {},
|
|
17
|
+
rel: {},
|
|
18
|
+
current: { type: Boolean }
|
|
19
|
+
};
|
|
20
|
+
static styles = breadcrumbItem_default;
|
|
21
|
+
static shadowOptions = { delegatesFocus: true };
|
|
22
|
+
static template = `
|
|
23
|
+
<a part="link" class="link"><slot name="start"></slot><slot></slot></a>
|
|
24
|
+
<span part="separator" class="separator" aria-hidden="true"><slot name="separator">${icons.chevronEnd}</slot></span>
|
|
25
|
+
`;
|
|
26
|
+
#link = this.$("a");
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.internals.role = "listitem";
|
|
30
|
+
}
|
|
31
|
+
update() {
|
|
32
|
+
const link = this.#link;
|
|
33
|
+
for (const name of ["href", "target", "rel"]) {
|
|
34
|
+
if (this[name] != null) link.setAttribute(name, this[name]);
|
|
35
|
+
else link.removeAttribute(name);
|
|
36
|
+
}
|
|
37
|
+
if (this.current) link.setAttribute("aria-current", "page");
|
|
38
|
+
else link.removeAttribute("aria-current");
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
define("punica-breadcrumb-item", PunicaBreadcrumbItem);
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
PunicaBreadcrumbItem
|
|
45
|
+
};
|