@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,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/textarea/textarea.css
|
|
10
|
+
var textarea_default = ":host {\n --punica-textarea-padding: var(--punica-space-12);\n --punica-textarea-radius: var(--punica-radius);\n --punica-textarea-border-color: var(--punica-color-border);\n --punica-textarea-background: var(--punica-color-surface);\n --punica-textarea-color: var(--punica-color-text);\n --punica-textarea-max-height: none;\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.base {\n display: flex;\n flex: 1;\n min-inline-size: 0;\n border: var(--punica-border-width) solid var(--punica-textarea-border-color);\n border-radius: var(--punica-textarea-radius);\n background: var(--punica-textarea-background);\n color: var(--punica-textarea-color);\n overflow: hidden;\n transition: border-color var(--punica-duration) var(--punica-ease);\n}\n\n.base:hover {\n border-color: var(--punica-color-border-strong);\n}\n.base:focus-within {\n border-color: var(--punica-color-primary);\n}\n.base:has(textarea:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-border-width));\n}\n:host(:state(user-invalid)) .base {\n border-color: var(--punica-color-error);\n}\n\ntextarea {\n flex: 1;\n display: block;\n inline-size: 100%;\n min-inline-size: 0;\n max-block-size: var(--punica-textarea-max-height);\n margin: 0;\n padding: var(--punica-textarea-padding);\n border: 0;\n outline: none;\n background: none;\n color: inherit;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n resize: none;\n -webkit-tap-highlight-color: transparent;\n}\ntextarea::placeholder {\n color: var(--punica-color-text-placeholder);\n opacity: 1;\n}\n\n:host([resize='vertical']) textarea {\n resize: vertical;\n}\n:host([resize='auto']) textarea {\n field-sizing: content;\n /* `rows` is the least height once the content sizes the field. */\n min-block-size: calc(\n var(--_rows, 3) * 1lh + 2 * var(--punica-textarea-padding)\n );\n}\n\n:host([disabled]) .base,\n:host(:state(disabled)) .base {\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .base {\n border-color: FieldText;\n }\n .base:focus-within {\n border-color: Highlight;\n }\n :host([disabled]) .base,\n :host(:state(disabled)) .base {\n border-color: GrayText;\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/textarea/textarea.js
|
|
13
|
+
var setAttr = (el, name, value) => {
|
|
14
|
+
if (value == null || value === false) el.removeAttribute(name);
|
|
15
|
+
else el.setAttribute(name, value === true ? "" : String(value));
|
|
16
|
+
};
|
|
17
|
+
var flagsOf = (validity) => {
|
|
18
|
+
const flags = {};
|
|
19
|
+
for (const key in validity) if (key !== "valid" && validity[key]) flags[key] = true;
|
|
20
|
+
return flags;
|
|
21
|
+
};
|
|
22
|
+
var PunicaTextarea = class extends FormControl(PunicaElement) {
|
|
23
|
+
static properties = {
|
|
24
|
+
value: { reflect: false, default: "" },
|
|
25
|
+
label: {},
|
|
26
|
+
placeholder: {},
|
|
27
|
+
rows: { type: Number, default: 3 },
|
|
28
|
+
resize: { default: "none" },
|
|
29
|
+
readonly: { type: Boolean },
|
|
30
|
+
minlength: { type: Number },
|
|
31
|
+
maxlength: { type: Number },
|
|
32
|
+
autocomplete: {},
|
|
33
|
+
inputmode: {},
|
|
34
|
+
fullWidth: { type: Boolean }
|
|
35
|
+
};
|
|
36
|
+
static styles = textarea_default;
|
|
37
|
+
static shadowOptions = { delegatesFocus: true };
|
|
38
|
+
static template = `<div part="base" class="base"><textarea part="textarea"></textarea></div>`;
|
|
39
|
+
#textarea = this.$("textarea");
|
|
40
|
+
#touched = false;
|
|
41
|
+
/** @type {ResizeObserver | null} */
|
|
42
|
+
#observer = null;
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
const textarea = this.#textarea;
|
|
46
|
+
textarea.addEventListener("input", () => {
|
|
47
|
+
this.value = textarea.value;
|
|
48
|
+
this.#fit();
|
|
49
|
+
this.emit("input", { value: this.value });
|
|
50
|
+
});
|
|
51
|
+
textarea.addEventListener("change", () => {
|
|
52
|
+
this.value = textarea.value;
|
|
53
|
+
this.emit("change", { value: this.value });
|
|
54
|
+
});
|
|
55
|
+
textarea.addEventListener("blur", () => this.#touch());
|
|
56
|
+
this.addEventListener("invalid", () => this.#touch());
|
|
57
|
+
}
|
|
58
|
+
connected() {
|
|
59
|
+
if (!CSS.supports("field-sizing", "content")) {
|
|
60
|
+
this.#observer = new ResizeObserver(() => this.#fit());
|
|
61
|
+
this.#observer.observe(this);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
disconnected() {
|
|
65
|
+
this.#observer?.disconnect();
|
|
66
|
+
this.#observer = null;
|
|
67
|
+
}
|
|
68
|
+
update() {
|
|
69
|
+
const textarea = this.#textarea;
|
|
70
|
+
setAttr(textarea, "placeholder", this.placeholder);
|
|
71
|
+
setAttr(textarea, "rows", this.rows ?? 3);
|
|
72
|
+
textarea.style.setProperty("--_rows", String(this.rows ?? 3));
|
|
73
|
+
setAttr(textarea, "minlength", this.minlength);
|
|
74
|
+
setAttr(textarea, "maxlength", this.maxlength);
|
|
75
|
+
setAttr(textarea, "autocomplete", this.autocomplete);
|
|
76
|
+
setAttr(textarea, "inputmode", this.inputmode);
|
|
77
|
+
setAttr(textarea, "aria-label", this.#name());
|
|
78
|
+
textarea.readOnly = this.readonly;
|
|
79
|
+
textarea.required = this.required;
|
|
80
|
+
textarea.disabled = this.isDisabled;
|
|
81
|
+
const value = this.value ?? "";
|
|
82
|
+
if (textarea.value !== value) textarea.value = value;
|
|
83
|
+
this.#fit();
|
|
84
|
+
this.setFormValue(textarea.value);
|
|
85
|
+
this.setValidity(flagsOf(textarea.validity), textarea.validationMessage, textarea);
|
|
86
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
87
|
+
}
|
|
88
|
+
formReset() {
|
|
89
|
+
this.#touched = false;
|
|
90
|
+
this.value = this.getAttribute("value") ?? "";
|
|
91
|
+
this.requestUpdate();
|
|
92
|
+
}
|
|
93
|
+
formRestore(state) {
|
|
94
|
+
if (typeof state === "string") this.value = state;
|
|
95
|
+
}
|
|
96
|
+
/** Moves focus to the field. */
|
|
97
|
+
focus(options) {
|
|
98
|
+
this.#textarea.focus(options);
|
|
99
|
+
}
|
|
100
|
+
/** Selects all the text in the field. */
|
|
101
|
+
select() {
|
|
102
|
+
this.#textarea.select();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Selects a range of the text.
|
|
106
|
+
* @param {number} start
|
|
107
|
+
* @param {number} end
|
|
108
|
+
* @param {'forward' | 'backward' | 'none'} [direction]
|
|
109
|
+
*/
|
|
110
|
+
setSelectionRange(start, end, direction) {
|
|
111
|
+
this.#textarea.setSelectionRange(start, end, direction);
|
|
112
|
+
}
|
|
113
|
+
#name() {
|
|
114
|
+
if (this.label) return this.label;
|
|
115
|
+
const text = [...this.labels].map((l) => l.textContent.trim()).filter(Boolean);
|
|
116
|
+
return text.length ? text.join(" ") : null;
|
|
117
|
+
}
|
|
118
|
+
#touch() {
|
|
119
|
+
this.#touched = true;
|
|
120
|
+
this.toggleState("user-invalid", !this.validity.valid);
|
|
121
|
+
}
|
|
122
|
+
/** Grows the textarea to its content where `field-sizing` is missing. */
|
|
123
|
+
#fit() {
|
|
124
|
+
const textarea = this.#textarea;
|
|
125
|
+
if (this.resize !== "auto" || CSS.supports("field-sizing", "content")) {
|
|
126
|
+
if (textarea.style.blockSize) textarea.style.blockSize = "";
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
textarea.style.blockSize = "auto";
|
|
130
|
+
const borders = textarea.offsetHeight - textarea.clientHeight;
|
|
131
|
+
textarea.style.blockSize = `${textarea.scrollHeight + borders}px`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
define("punica-textarea", PunicaTextarea);
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
PunicaTextarea
|
|
138
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/spinner/spinner.css
|
|
7
|
+
var spinner_default = ":host {\n --punica-spinner-size: var(--punica-space-24);\n --punica-spinner-color: var(--punica-color-primary);\n --punica-spinner-track-color: var(--punica-color-hover);\n --punica-spinner-width: var(--punica-space-2);\n\n display: inline-block;\n flex: none;\n inline-size: var(--punica-spinner-size);\n block-size: var(--punica-spinner-size);\n vertical-align: middle;\n}\n\n:host([size='small']) {\n --punica-spinner-size: var(--punica-space-16);\n}\n:host([size='large']) {\n --punica-spinner-size: var(--punica-space-40);\n --punica-spinner-width: var(--punica-space-4);\n}\n\n:host([color='secondary']) {\n --punica-spinner-color: var(--punica-color-secondary);\n}\n:host([color='error']) {\n --punica-spinner-color: var(--punica-color-error);\n}\n:host([color='warning']) {\n --punica-spinner-color: var(--punica-color-warning);\n}\n:host([color='info']) {\n --punica-spinner-color: var(--punica-color-info);\n}\n:host([color='success']) {\n --punica-spinner-color: var(--punica-color-success);\n}\n:host([color='neutral']) {\n --punica-spinner-color: var(--punica-color-text);\n}\n\n.ring {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n border: var(--punica-spinner-width) solid var(--punica-spinner-track-color);\n border-block-start-color: var(--punica-spinner-color);\n border-radius: 50%;\n animation: spin 700ms linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes breathe {\n 50% {\n opacity: 0.4;\n }\n}\n\n/* Reduced motion: the ring stands still and fades in and out slowly. */\n@media (prefers-reduced-motion: reduce) {\n .ring {\n animation: breathe 2s ease-in-out infinite;\n }\n}\n\n@media (forced-colors: active) {\n .ring {\n border-color: GrayText;\n border-block-start-color: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/spinner/spinner.js
|
|
10
|
+
var PunicaSpinner = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
size: {},
|
|
13
|
+
color: {},
|
|
14
|
+
label: { default: "Loading" },
|
|
15
|
+
decorative: { type: Boolean }
|
|
16
|
+
};
|
|
17
|
+
static styles = spinner_default;
|
|
18
|
+
static template = `<span part="base" class="ring"></span>`;
|
|
19
|
+
update() {
|
|
20
|
+
const internals = this.internals;
|
|
21
|
+
if (this.decorative) {
|
|
22
|
+
internals.role = null;
|
|
23
|
+
internals.ariaLabel = null;
|
|
24
|
+
internals.ariaHidden = "true";
|
|
25
|
+
} else {
|
|
26
|
+
internals.role = "progressbar";
|
|
27
|
+
internals.ariaLabel = this.label;
|
|
28
|
+
internals.ariaHidden = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
define("punica-spinner", PunicaSpinner);
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
PunicaSpinner
|
|
36
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/sideNav/sideNavSection.css
|
|
10
|
+
var sideNavSection_default = ":host {\n --punica-side-nav-section-gap: var(--punica-space-12);\n --punica-side-nav-section-color: var(--punica-color-neutral-dark);\n\n display: block;\n}\n\n:host(:not(:first-child)) .base {\n margin-block-start: var(--punica-side-nav-section-gap);\n}\n\n.heading {\n all: unset;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--punica-space-8);\n inline-size: 100%;\n min-block-size: var(--punica-size-sm);\n padding-inline: var(--punica-space-12);\n border-radius: var(--punica-radius);\n color: var(--punica-side-nav-section-color);\n font-size: var(--punica-font-size-xs);\n font-weight: var(--punica-font-weight-semi-bold);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.toggle {\n cursor: pointer;\n}\n.toggle:hover {\n background: var(--punica-color-hover);\n}\n.toggle:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n.toggle .icon {\n flex: none;\n transition: transform var(--punica-duration) var(--punica-ease);\n}\n.toggle[aria-expanded='false'] .icon {\n transform: rotate(-90deg);\n}\n.toggle[aria-expanded='false']:dir(rtl) .icon {\n transform: rotate(90deg);\n}\n\n/* In a rail the heading is a rule between groups. */\n:host(:state(rail)) .heading {\n display: block;\n min-block-size: 0;\n block-size: 0;\n padding: 0;\n margin-block: var(--punica-space-6);\n border-block-start: var(--punica-border-width) solid var(--punica-color-border);\n border-radius: 0;\n overflow: hidden;\n pointer-events: none;\n}\n:host(:state(rail)) .toggle {\n visibility: hidden;\n}\n\n[hidden] {\n display: none !important;\n}\n\n@media (forced-colors: active) {\n :host(:state(rail)) .heading {\n border-color: CanvasText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/sideNav/sideNavSection.js
|
|
13
|
+
var PunicaSideNavSection = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
label: {},
|
|
16
|
+
collapsible: { type: Boolean },
|
|
17
|
+
collapsed: { type: Boolean }
|
|
18
|
+
};
|
|
19
|
+
static styles = sideNavSection_default;
|
|
20
|
+
static template = `
|
|
21
|
+
<div part="base" class="base" role="group">
|
|
22
|
+
<div part="heading" class="heading" id="heading" hidden></div>
|
|
23
|
+
<button part="toggle" class="heading toggle" id="toggle" type="button" aria-controls="items" hidden>
|
|
24
|
+
<span class="text"></span>${icons.chevronDown}
|
|
25
|
+
</button>
|
|
26
|
+
<div part="items" class="items" id="items"><slot></slot></div>
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
#base = this.$(".base");
|
|
30
|
+
#heading = this.$("#heading");
|
|
31
|
+
#toggle = this.$("#toggle");
|
|
32
|
+
#text = this.$(".text");
|
|
33
|
+
#items = this.$("#items");
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.#toggle.addEventListener("click", () => {
|
|
37
|
+
this.collapsed = !this.collapsed;
|
|
38
|
+
this.emit("toggle", { open: !this.collapsed });
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
update() {
|
|
42
|
+
const rail = !!/** @type {any} */
|
|
43
|
+
this.closest("punica-side-nav")?.collapsed;
|
|
44
|
+
const label = this.label || "";
|
|
45
|
+
const button = this.collapsible && !!label;
|
|
46
|
+
this.toggleState("rail", rail);
|
|
47
|
+
this.#heading.textContent = label;
|
|
48
|
+
this.#text.textContent = label;
|
|
49
|
+
this.#heading.hidden = !label || button;
|
|
50
|
+
this.#toggle.hidden = !button;
|
|
51
|
+
this.#toggle.setAttribute("aria-expanded", String(!this.collapsed));
|
|
52
|
+
if (label) this.#base.setAttribute("aria-labelledby", button ? "toggle" : "heading");
|
|
53
|
+
else this.#base.removeAttribute("aria-labelledby");
|
|
54
|
+
this.#items.hidden = button && this.collapsed && !rail;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
define("punica-side-nav-section", PunicaSideNavSection);
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
PunicaSideNavSection
|
|
61
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/field/field.css
|
|
7
|
+
var field_default = ":host {\n --punica-field-gap: var(--punica-space-6);\n --punica-field-label-color: var(--punica-color-text);\n --punica-field-help-color: var(--punica-color-text);\n --punica-field-error-color: var(--punica-color-error);\n\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--punica-field-gap);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: 1.43;\n}\n\n.label {\n display: inline-flex;\n gap: var(--punica-space-4);\n color: var(--punica-field-label-color);\n font-weight: var(--punica-font-weight-semi-bold);\n cursor: default;\n}\n\n.required {\n color: var(--punica-field-error-color);\n}\n\n.help {\n color: var(--punica-field-help-color);\n font-size: var(--punica-font-size-xs);\n}\n\n.error {\n color: var(--punica-field-error-color);\n font-size: var(--punica-font-size-xs);\n}\n\n[hidden] {\n display: none;\n}\n\n::slotted([full-width]) {\n /* A form layout with labels beside the fields sets baseline. */\n align-self: var(--punica-field-control-align, stretch);\n}\n\n/* In a grid layout (a form layout with labels beside the fields), the help,\n the error and the control share the second column. */\n.help,\n.error,\nslot:not([name])::slotted(*) {\n grid-column: -2 / -1;\n}\n\n@media (forced-colors: active) {\n .error,\n .required {\n color: LinkText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/field/field.js
|
|
10
|
+
var PunicaField = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
label: {},
|
|
13
|
+
help: {},
|
|
14
|
+
error: {},
|
|
15
|
+
required: { type: Boolean }
|
|
16
|
+
};
|
|
17
|
+
static styles = field_default;
|
|
18
|
+
static template = `
|
|
19
|
+
<div part="label" class="label" hidden>
|
|
20
|
+
<slot name="label"><span class="label-text"></span></slot>
|
|
21
|
+
<span part="required" class="required" aria-hidden="true" hidden>*</span>
|
|
22
|
+
</div>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
<div part="help" class="help" hidden><slot name="help"><span class="help-text"></span></slot></div>
|
|
25
|
+
<div part="error" class="error" aria-live="polite" hidden></div>
|
|
26
|
+
`;
|
|
27
|
+
/** The control was reported invalid, or left while invalid. */
|
|
28
|
+
#touched = false;
|
|
29
|
+
/** The control whose name this field wrote, so it can keep it current. */
|
|
30
|
+
#named = null;
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
const root = this.shadowRoot;
|
|
34
|
+
for (const slot of root.querySelectorAll("slot")) {
|
|
35
|
+
slot.addEventListener("slotchange", () => {
|
|
36
|
+
if (this.isConnected) this.update();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
this.$(".label").addEventListener("click", (event) => {
|
|
40
|
+
if (event.target.closest?.("a, button, input, select, textarea")) return;
|
|
41
|
+
this.control?.focus();
|
|
42
|
+
});
|
|
43
|
+
this.addEventListener(
|
|
44
|
+
"invalid",
|
|
45
|
+
(event) => {
|
|
46
|
+
if (event.target !== this.control) return;
|
|
47
|
+
this.#touched = true;
|
|
48
|
+
this.#refresh();
|
|
49
|
+
},
|
|
50
|
+
{ capture: true }
|
|
51
|
+
);
|
|
52
|
+
this.addEventListener("focusout", () => {
|
|
53
|
+
const control = this.control;
|
|
54
|
+
if (control?.validity && !control.validity.valid) this.#touched = true;
|
|
55
|
+
this.#later();
|
|
56
|
+
});
|
|
57
|
+
for (const type of ["input", "change", "punica-input", "punica-change"]) {
|
|
58
|
+
this.addEventListener(type, () => this.#later());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
connected() {
|
|
62
|
+
const form = this.closest("form");
|
|
63
|
+
if (form) {
|
|
64
|
+
this.listen(form, "reset", () => {
|
|
65
|
+
this.#touched = false;
|
|
66
|
+
this.#later();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The control in the default slot.
|
|
72
|
+
* @returns {any}
|
|
73
|
+
*/
|
|
74
|
+
get control() {
|
|
75
|
+
const slot = this.shadowRoot.querySelector("slot:not([name])");
|
|
76
|
+
return slot.assignedElements({ flatten: true })[0] || null;
|
|
77
|
+
}
|
|
78
|
+
update() {
|
|
79
|
+
const control = this.control;
|
|
80
|
+
const labelSlot = this.$("slot[name=label]");
|
|
81
|
+
const helpSlot = this.$("slot[name=help]");
|
|
82
|
+
this.$(".label-text").textContent = this.label ?? "";
|
|
83
|
+
this.$(".help-text").textContent = this.help ?? "";
|
|
84
|
+
this.$(".label").hidden = !this.label && !labelSlot.assignedNodes().length;
|
|
85
|
+
this.$(".help").hidden = !this.help && !helpSlot.assignedNodes().length;
|
|
86
|
+
const required = this.required || !!control?.required;
|
|
87
|
+
this.$(".required").hidden = !required;
|
|
88
|
+
this.toggleState("required", required);
|
|
89
|
+
this.#name(control);
|
|
90
|
+
this.#refresh();
|
|
91
|
+
}
|
|
92
|
+
/** Gives the control the field's label as its name, if it has none. */
|
|
93
|
+
#name(control) {
|
|
94
|
+
if (this.#named && this.#named !== control) this.#named = null;
|
|
95
|
+
if (!control) return;
|
|
96
|
+
if (control.localName.includes("-") && !customElements.get(control.localName)) {
|
|
97
|
+
customElements.whenDefined(control.localName).then(() => this.isConnected && this.update());
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const label = this.label || this.$("slot[name=label]").assignedNodes().map((n) => n.textContent.trim()).join(" ") || null;
|
|
101
|
+
if ("label" in control) {
|
|
102
|
+
if (this.#named === control || !control.label) {
|
|
103
|
+
if (label || this.#named === control) control.label = label;
|
|
104
|
+
this.#named = label ? control : null;
|
|
105
|
+
}
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const has = control.hasAttribute("aria-labelledby") || control.labels?.length;
|
|
109
|
+
if (this.#named === control || !has && !control.hasAttribute("aria-label")) {
|
|
110
|
+
if (label) control.setAttribute("aria-label", label);
|
|
111
|
+
else control.removeAttribute("aria-label");
|
|
112
|
+
this.#named = label ? control : null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Shows `error`, or the control's own message once it was touched. */
|
|
116
|
+
#refresh() {
|
|
117
|
+
const control = this.control;
|
|
118
|
+
let message = this.error || "";
|
|
119
|
+
if (!message && this.#touched && control?.validity && !control.validity.valid) {
|
|
120
|
+
message = control.validationMessage || "";
|
|
121
|
+
}
|
|
122
|
+
const box = this.$(".error");
|
|
123
|
+
if (box.textContent !== message) box.textContent = message;
|
|
124
|
+
box.hidden = !message;
|
|
125
|
+
this.toggleState("invalid", !!message);
|
|
126
|
+
}
|
|
127
|
+
/** Refreshes after the control has brought its validity up to date. */
|
|
128
|
+
#later() {
|
|
129
|
+
Promise.resolve().then(() => void 0).then(() => {
|
|
130
|
+
if (this.isConnected) this.update();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
define("punica-field", PunicaField);
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
PunicaField
|
|
138
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaRadioGroup
|
|
3
|
+
} from "./chunk-TK5H2DLW.js";
|
|
4
|
+
import {
|
|
5
|
+
define
|
|
6
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
7
|
+
|
|
8
|
+
// src/components/selectableCard/selectableCardGroup.css
|
|
9
|
+
var selectableCardGroup_default = ":host {\n --punica-selectable-card-group-gap: var(--punica-space-12);\n --punica-selectable-card-group-min-width: 12rem;\n\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--punica-selectable-card-group-min-width)), 1fr));\n gap: var(--punica-selectable-card-group-gap);\n}\n\n:host([orientation='vertical']) {\n grid-template-columns: minmax(0, 1fr);\n}\n";
|
|
10
|
+
|
|
11
|
+
// src/components/selectableCard/selectableCardGroup.js
|
|
12
|
+
var PunicaSelectableCardGroup = class extends PunicaRadioGroup {
|
|
13
|
+
static properties = {
|
|
14
|
+
orientation: { default: "horizontal" }
|
|
15
|
+
};
|
|
16
|
+
static styles = selectableCardGroup_default;
|
|
17
|
+
static itemTag = "punica-selectable-card";
|
|
18
|
+
static itemFlag = "checked";
|
|
19
|
+
};
|
|
20
|
+
define("punica-selectable-card-group", PunicaSelectableCardGroup);
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
PunicaSelectableCardGroup
|
|
24
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/table/tableBody.css
|
|
7
|
+
var tableBody_default = ":host {\n display: table-row-group;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/table/tableBody.js
|
|
10
|
+
var PunicaTableBody = class extends PunicaElement {
|
|
11
|
+
static styles = tableBody_default;
|
|
12
|
+
static template = `<slot></slot>`;
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.internals.role = "rowgroup";
|
|
16
|
+
this.shadowRoot.addEventListener("slotchange", () => this.#table?.refresh?.());
|
|
17
|
+
}
|
|
18
|
+
/** @returns {any} */
|
|
19
|
+
get #table() {
|
|
20
|
+
return this.closest("punica-table");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
define("punica-table-body", PunicaTableBody);
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
PunicaTableBody
|
|
27
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/aspectRatio/aspectRatio.css
|
|
7
|
+
var aspectRatio_default = ":host {\n --punica-aspect-ratio-fit: cover;\n --_ratio: 1 / 1;\n\n display: block;\n position: relative;\n aspect-ratio: var(--_ratio);\n overflow: hidden;\n}\n\n::slotted(*) {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n object-fit: var(--punica-aspect-ratio-fit);\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/aspectRatio/aspectRatio.js
|
|
10
|
+
var RATIO = /^\s*(\d+(?:\.\d+)?)\s*(?:\/\s*(\d+(?:\.\d+)?)\s*)?$/;
|
|
11
|
+
function instanceStyle(root) {
|
|
12
|
+
const own = new CSSStyleSheet();
|
|
13
|
+
own.replaceSync(":host{}");
|
|
14
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, own];
|
|
15
|
+
return (
|
|
16
|
+
/** @type {CSSStyleRule} */
|
|
17
|
+
own.cssRules[0].style
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
var PunicaAspectRatio = class extends PunicaElement {
|
|
21
|
+
static properties = {
|
|
22
|
+
ratio: {}
|
|
23
|
+
};
|
|
24
|
+
static styles = aspectRatio_default;
|
|
25
|
+
static template = `<slot></slot>`;
|
|
26
|
+
#style = instanceStyle(this.shadowRoot);
|
|
27
|
+
update() {
|
|
28
|
+
const match = RATIO.exec(this.ratio ?? "");
|
|
29
|
+
const inline = match ? Number(match[1]) : 0;
|
|
30
|
+
const block = match ? Number(match[2] ?? 1) : 0;
|
|
31
|
+
if (inline > 0 && block > 0) this.#style.setProperty("--_ratio", `${inline} / ${block}`);
|
|
32
|
+
else this.#style.removeProperty("--_ratio");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
define("punica-aspect-ratio", PunicaAspectRatio);
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
PunicaAspectRatio
|
|
39
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/thumbnail/thumbnail.css
|
|
7
|
+
var thumbnail_default = ":host {\n --punica-thumbnail-size: var(--punica-space-96);\n --punica-thumbnail-radius: var(--punica-radius);\n --punica-thumbnail-background: color-mix(in srgb, var(--punica-color-text) 8%, var(--punica-color-surface));\n /* Set per instance from ratio. */\n --_ratio: 1 / 1;\n\n display: inline-block;\n inline-size: var(--punica-thumbnail-size);\n max-inline-size: 100%;\n vertical-align: middle;\n}\n\n:host([size='small']) {\n --punica-thumbnail-size: var(--punica-space-48);\n}\n:host([size='large']) {\n --punica-thumbnail-size: var(--punica-space-160);\n}\n\n:host([radius='none']) {\n --punica-thumbnail-radius: 0;\n}\n:host([radius='small']) {\n --punica-thumbnail-radius: var(--punica-radius-sm);\n}\n:host([radius='large']) {\n --punica-thumbnail-radius: var(--punica-radius-lg);\n}\n:host([radius='full']) {\n --punica-thumbnail-radius: var(--punica-radius-full);\n}\n\n.base {\n position: relative;\n display: block;\n inline-size: 100%;\n aspect-ratio: var(--_ratio);\n border-radius: var(--punica-thumbnail-radius);\n background: var(--punica-thumbnail-background);\n color: var(--punica-color-text-muted);\n overflow: hidden;\n text-decoration: none;\n}\n\n.base[href] {\n cursor: pointer;\n}\n\n.base[href]:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.base[href]::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: transparent;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.base[href]:hover::after {\n background: var(--punica-color-hover);\n}\n\n.image,\n.skeleton,\n.fallback {\n position: absolute;\n inset: 0;\n inline-size: 100%;\n block-size: 100%;\n}\n\n.image {\n display: block;\n object-fit: cover;\n opacity: 0;\n transition: opacity var(--punica-duration) var(--punica-ease);\n}\n\n:host([fit='contain']) .image {\n object-fit: contain;\n}\n\n:host(:state(loaded)) .image {\n opacity: 1;\n}\n\n.skeleton {\n --punica-skeleton-radius: 0;\n display: none;\n}\n\n:host(:state(loading)) .skeleton {\n display: block;\n}\n\n.fallback {\n display: none;\n align-items: center;\n justify-content: center;\n font-size: max(var(--punica-space-16), calc(var(--punica-thumbnail-size) * 0.3));\n}\n\n:host(:state(error)) .fallback {\n display: flex;\n}\n\n:host(:state(error)) .image {\n display: none;\n}\n\n@media (forced-colors: active) {\n .base {\n border: var(--punica-border-width) solid CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/thumbnail/thumbnail.js
|
|
10
|
+
var RATIO = /^\s*(\d+(?:\.\d+)?)\s*(?:\/\s*(\d+(?:\.\d+)?)\s*)?$/;
|
|
11
|
+
function instanceStyle(root) {
|
|
12
|
+
const own = new CSSStyleSheet();
|
|
13
|
+
own.replaceSync(":host{}");
|
|
14
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets, own];
|
|
15
|
+
return (
|
|
16
|
+
/** @type {CSSStyleRule} */
|
|
17
|
+
own.cssRules[0].style
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
var PunicaThumbnail = class extends PunicaElement {
|
|
21
|
+
static properties = {
|
|
22
|
+
src: {},
|
|
23
|
+
srcset: {},
|
|
24
|
+
sizes: {},
|
|
25
|
+
alt: {},
|
|
26
|
+
ratio: {},
|
|
27
|
+
fit: {},
|
|
28
|
+
size: {},
|
|
29
|
+
radius: {},
|
|
30
|
+
loading: { default: "lazy" },
|
|
31
|
+
href: {},
|
|
32
|
+
target: {},
|
|
33
|
+
label: {}
|
|
34
|
+
};
|
|
35
|
+
static styles = thumbnail_default;
|
|
36
|
+
static template = `
|
|
37
|
+
<a part="base" class="base">
|
|
38
|
+
<img part="image" class="image" decoding="async">
|
|
39
|
+
<punica-skeleton part="skeleton" class="skeleton" variant="rect" width="100%" height="100%"></punica-skeleton>
|
|
40
|
+
<span part="fallback" class="fallback"><slot name="fallback"><svg class="glyph" viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="2"/><path d="m21 17-5-5-9 8"/></svg></slot></span>
|
|
41
|
+
</a>
|
|
42
|
+
`;
|
|
43
|
+
#base = this.$(".base");
|
|
44
|
+
#image = this.$(".image");
|
|
45
|
+
#fallback = this.$(".fallback");
|
|
46
|
+
#style = instanceStyle(this.shadowRoot);
|
|
47
|
+
/** @type {'loading' | 'loaded' | 'error'} */
|
|
48
|
+
#state = "error";
|
|
49
|
+
constructor() {
|
|
50
|
+
super();
|
|
51
|
+
this.#image.addEventListener("load", () => {
|
|
52
|
+
if (!this.#image.getAttribute("src")) return;
|
|
53
|
+
this.#set("loaded");
|
|
54
|
+
this.emit("load", { src: this.#image.currentSrc || this.src });
|
|
55
|
+
});
|
|
56
|
+
this.#image.addEventListener("error", () => {
|
|
57
|
+
if (!this.#image.getAttribute("src")) return;
|
|
58
|
+
this.#set("error");
|
|
59
|
+
this.emit("error", { src: this.src });
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
update(changed) {
|
|
63
|
+
const image = this.#image;
|
|
64
|
+
image.loading = this.loading === "eager" ? "eager" : "lazy";
|
|
65
|
+
image.alt = this.alt ?? "";
|
|
66
|
+
for (const name of ["sizes", "srcset"]) {
|
|
67
|
+
if (this[name]) image.setAttribute(name, this[name]);
|
|
68
|
+
else image.removeAttribute(name);
|
|
69
|
+
}
|
|
70
|
+
if (changed.has("src") || changed.has("srcset")) {
|
|
71
|
+
if (this.src || this.srcset) {
|
|
72
|
+
this.#set("loading");
|
|
73
|
+
if (this.src) image.setAttribute("src", this.src);
|
|
74
|
+
else image.removeAttribute("src");
|
|
75
|
+
if (image.complete && image.naturalWidth > 0) this.#set("loaded");
|
|
76
|
+
} else {
|
|
77
|
+
image.removeAttribute("src");
|
|
78
|
+
this.#set("error");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const base = this.#base;
|
|
82
|
+
if (this.href) {
|
|
83
|
+
base.setAttribute("href", this.href);
|
|
84
|
+
if (this.target) base.setAttribute("target", this.target);
|
|
85
|
+
else base.removeAttribute("target");
|
|
86
|
+
} else {
|
|
87
|
+
base.removeAttribute("href");
|
|
88
|
+
base.removeAttribute("target");
|
|
89
|
+
}
|
|
90
|
+
if (this.href && this.label) base.setAttribute("aria-label", this.label);
|
|
91
|
+
else base.removeAttribute("aria-label");
|
|
92
|
+
const match = RATIO.exec(this.ratio ?? "");
|
|
93
|
+
const inline = match ? Number(match[1]) : 0;
|
|
94
|
+
const block = match ? Number(match[2] ?? 1) : 0;
|
|
95
|
+
if (inline > 0 && block > 0) this.#style.setProperty("--_ratio", `${inline} / ${block}`);
|
|
96
|
+
else this.#style.removeProperty("--_ratio");
|
|
97
|
+
this.#describeFallback();
|
|
98
|
+
}
|
|
99
|
+
/** @param {'loading' | 'loaded' | 'error'} state */
|
|
100
|
+
#set(state) {
|
|
101
|
+
this.#state = state;
|
|
102
|
+
for (const name of ["loading", "loaded", "error"]) this.toggleState(name, name === state);
|
|
103
|
+
this.#describeFallback();
|
|
104
|
+
}
|
|
105
|
+
/** With the picture gone, its text alternative moves to the fallback. */
|
|
106
|
+
#describeFallback() {
|
|
107
|
+
const fallback = this.#fallback;
|
|
108
|
+
if (this.#state === "error" && this.alt) {
|
|
109
|
+
fallback.setAttribute("role", "img");
|
|
110
|
+
fallback.setAttribute("aria-label", this.alt);
|
|
111
|
+
fallback.removeAttribute("aria-hidden");
|
|
112
|
+
} else {
|
|
113
|
+
fallback.removeAttribute("role");
|
|
114
|
+
fallback.removeAttribute("aria-label");
|
|
115
|
+
fallback.setAttribute("aria-hidden", "true");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
define("punica-thumbnail", PunicaThumbnail);
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
PunicaThumbnail
|
|
123
|
+
};
|