@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,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
isRtl,
|
|
6
|
+
nextIndex,
|
|
7
|
+
setRovingTabindex
|
|
8
|
+
} from "./chunk-4RURT4SK.js";
|
|
9
|
+
import {
|
|
10
|
+
PunicaElement,
|
|
11
|
+
define
|
|
12
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
13
|
+
|
|
14
|
+
// src/components/radio/radioGroup.css
|
|
15
|
+
var radioGroup_default = ":host {\n --punica-radio-group-gap: var(--punica-space-8);\n\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--punica-radio-group-gap);\n vertical-align: middle;\n}\n\n:host([orientation='horizontal']) {\n flex-flow: row wrap;\n align-items: center;\n column-gap: var(--punica-space-16);\n}\n";
|
|
16
|
+
|
|
17
|
+
// src/components/radio/radioGroup.js
|
|
18
|
+
var missingMessage = () => {
|
|
19
|
+
const probe = document.createElement("input");
|
|
20
|
+
probe.type = "radio";
|
|
21
|
+
probe.name = "punica-probe";
|
|
22
|
+
probe.required = true;
|
|
23
|
+
return probe.validationMessage;
|
|
24
|
+
};
|
|
25
|
+
var valueOf = (item) => item.value ?? item.textContent.trim();
|
|
26
|
+
var PunicaRadioGroup = class extends FormControl(PunicaElement) {
|
|
27
|
+
static properties = {
|
|
28
|
+
value: { reflect: false, default: "" },
|
|
29
|
+
label: {},
|
|
30
|
+
orientation: { default: "vertical" }
|
|
31
|
+
};
|
|
32
|
+
static styles = radioGroup_default;
|
|
33
|
+
static template = `<slot></slot>`;
|
|
34
|
+
/** Tag of the elements the group chooses between. */
|
|
35
|
+
static itemTag = "punica-radio";
|
|
36
|
+
/** Boolean property of an item that marks it as the chosen one. */
|
|
37
|
+
static itemFlag = "checked";
|
|
38
|
+
/** @type {string | null} */
|
|
39
|
+
#initial = null;
|
|
40
|
+
#adopted = false;
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this.$("slot").addEventListener("slotchange", () => this.#adopt());
|
|
44
|
+
this.addEventListener("click", (event) => {
|
|
45
|
+
const item = this.#itemOf(event);
|
|
46
|
+
if (item) this.#choose(item);
|
|
47
|
+
});
|
|
48
|
+
this.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The items of the group, in document order.
|
|
52
|
+
* @returns {any[]}
|
|
53
|
+
*/
|
|
54
|
+
get items() {
|
|
55
|
+
const tag = (
|
|
56
|
+
/** @type {typeof PunicaRadioGroup} */
|
|
57
|
+
this.constructor.itemTag
|
|
58
|
+
);
|
|
59
|
+
return this.$("slot").assignedElements({ flatten: true }).filter((el) => el.localName === tag);
|
|
60
|
+
}
|
|
61
|
+
update() {
|
|
62
|
+
const flag = (
|
|
63
|
+
/** @type {typeof PunicaRadioGroup} */
|
|
64
|
+
this.constructor.itemFlag
|
|
65
|
+
);
|
|
66
|
+
const internals = this.internals;
|
|
67
|
+
internals.role = "radiogroup";
|
|
68
|
+
internals.ariaLabel = this.label || null;
|
|
69
|
+
internals.ariaOrientation = this.orientation === "horizontal" ? "horizontal" : "vertical";
|
|
70
|
+
internals.ariaRequired = this.required ? "true" : null;
|
|
71
|
+
internals.ariaDisabled = this.isDisabled ? "true" : null;
|
|
72
|
+
const value = this.value ?? "";
|
|
73
|
+
const items = this.items;
|
|
74
|
+
for (const item of items) {
|
|
75
|
+
if (this.#adopted) item[flag] = value !== "" && valueOf(item) === value;
|
|
76
|
+
item.requestUpdate?.();
|
|
77
|
+
}
|
|
78
|
+
const enabled = this.#enabled();
|
|
79
|
+
for (const item of items) if (!enabled.includes(item)) item.removeAttribute("tabindex");
|
|
80
|
+
setRovingTabindex(enabled, enabled.find((item) => item[flag]) || null);
|
|
81
|
+
this.setFormValue(value === "" ? null : value, value);
|
|
82
|
+
const missing = this.required && value === "";
|
|
83
|
+
this.setValidity(missing ? { valueMissing: true } : {}, missing ? missingMessage() : "", enabled[0]);
|
|
84
|
+
this.selectionChanged(items.find((item) => item[flag]) || null);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Runs after every update with the chosen item, for a subclass that draws
|
|
88
|
+
* something for it.
|
|
89
|
+
* @param {HTMLElement | null} item
|
|
90
|
+
*/
|
|
91
|
+
// eslint-disable-next-line no-unused-vars
|
|
92
|
+
selectionChanged(item) {
|
|
93
|
+
}
|
|
94
|
+
formReset() {
|
|
95
|
+
this.value = this.getAttribute("value") ?? this.#initial ?? "";
|
|
96
|
+
}
|
|
97
|
+
formRestore(state) {
|
|
98
|
+
if (typeof state === "string") this.value = state;
|
|
99
|
+
}
|
|
100
|
+
/** Moves focus to the item that is in the tab order. */
|
|
101
|
+
focus(options) {
|
|
102
|
+
const enabled = this.#enabled();
|
|
103
|
+
(enabled.find((item) => item.tabIndex === 0) || enabled[0])?.focus(options);
|
|
104
|
+
}
|
|
105
|
+
#enabled() {
|
|
106
|
+
return this.isDisabled ? [] : this.items.filter((item) => !item.disabled);
|
|
107
|
+
}
|
|
108
|
+
#itemOf(event) {
|
|
109
|
+
const enabled = this.#enabled();
|
|
110
|
+
return event.composedPath().find((node) => enabled.includes(node)) || null;
|
|
111
|
+
}
|
|
112
|
+
/** Items arrived: with no value of its own the group takes theirs. */
|
|
113
|
+
#adopt() {
|
|
114
|
+
const flag = (
|
|
115
|
+
/** @type {typeof PunicaRadioGroup} */
|
|
116
|
+
this.constructor.itemFlag
|
|
117
|
+
);
|
|
118
|
+
if (!this.value) {
|
|
119
|
+
const chosen = this.items.find((item) => item[flag]);
|
|
120
|
+
const value = chosen ? valueOf(chosen) : "";
|
|
121
|
+
this.#initial ??= value;
|
|
122
|
+
if (value) this.value = value;
|
|
123
|
+
}
|
|
124
|
+
this.#adopted = true;
|
|
125
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map());
|
|
126
|
+
}
|
|
127
|
+
#choose(item) {
|
|
128
|
+
const value = valueOf(item);
|
|
129
|
+
if (value === this.value) return;
|
|
130
|
+
this.value = value;
|
|
131
|
+
this.update(/* @__PURE__ */ new Map());
|
|
132
|
+
this.emit("change", { value });
|
|
133
|
+
}
|
|
134
|
+
#onKeydown(event) {
|
|
135
|
+
const item = this.#itemOf(event);
|
|
136
|
+
if (!item || event.target !== item) return;
|
|
137
|
+
if (event.key === " ") {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
this.#choose(item);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const enabled = this.#enabled();
|
|
143
|
+
const index = nextIndex(event, enabled.length, enabled.indexOf(item), {
|
|
144
|
+
orientation: "both",
|
|
145
|
+
rtl: isRtl(this)
|
|
146
|
+
});
|
|
147
|
+
if (index < 0) return;
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
enabled[index].focus();
|
|
150
|
+
this.#choose(enabled[index]);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
define("punica-radio-group", PunicaRadioGroup);
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
PunicaRadioGroup
|
|
157
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/topNav/topNavMegaMenuGroup.css
|
|
7
|
+
var topNavMegaMenuGroup_default = ":host {\n --punica-top-nav-mega-menu-group-heading-color: var(--punica-color-text-muted);\n\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-4);\n min-inline-size: 0;\n}\n\n.heading {\n padding: var(--punica-space-4) var(--punica-space-8);\n color: var(--punica-top-nav-mega-menu-group-heading-color);\n font-family: var(--punica-font-family);\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}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-2);\n}\n\n[hidden] {\n display: none !important;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/topNav/topNavMegaMenuGroup.js
|
|
10
|
+
var PunicaTopNavMegaMenuGroup = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
heading: {}
|
|
13
|
+
};
|
|
14
|
+
static styles = topNavMegaMenuGroup_default;
|
|
15
|
+
static template = `
|
|
16
|
+
<div part="heading" class="heading" aria-hidden="true"></div>
|
|
17
|
+
<div part="items" class="items"><slot></slot></div>
|
|
18
|
+
`;
|
|
19
|
+
#heading = this.$(".heading");
|
|
20
|
+
update() {
|
|
21
|
+
this.internals.role = "group";
|
|
22
|
+
this.internals.ariaLabel = this.heading || null;
|
|
23
|
+
this.#heading.textContent = this.heading ?? "";
|
|
24
|
+
this.#heading.hidden = !this.heading;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
define("punica-top-nav-mega-menu-group", PunicaTopNavMegaMenuGroup);
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
PunicaTopNavMegaMenuGroup
|
|
31
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/table/table.css
|
|
7
|
+
var table_default = ":host {\n --punica-table-cell-padding: var(--punica-space-12) var(--punica-space-16);\n --punica-table-border-color: var(--punica-color-border);\n --punica-table-header-background: var(--punica-color-surface);\n --punica-table-header-color: var(--punica-color-text);\n --punica-table-stripe-background: var(--punica-color-hover);\n --punica-table-selected-background: var(--punica-color-selected);\n --punica-table-font-size: var(--punica-font-size-sm);\n\n display: table;\n inline-size: 100%;\n border-collapse: separate;\n border-spacing: 0;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-table-font-size);\n line-height: var(--punica-line-height);\n}\n\n:host([dense]) {\n --punica-table-cell-padding: var(--punica-space-4) var(--punica-space-8);\n}\n:host([striped]) {\n --_stripe: var(--punica-table-stripe-background);\n}\n:host([dividers]) {\n --_divider: var(--punica-border-width) solid var(--punica-table-border-color);\n}\n:host([sticky-header]) {\n --_sticky: sticky;\n}\n\n.caption {\n display: table-caption;\n padding: var(--punica-space-8) var(--punica-space-16);\n font-weight: var(--punica-font-weight-semi-bold);\n text-align: start;\n}\n\n.toolbar {\n display: table-caption;\n}\n\n.empty {\n display: table-caption;\n caption-side: bottom;\n padding: var(--punica-space-32) var(--punica-space-16);\n color: var(--punica-color-text-muted);\n text-align: center;\n}\n\n[hidden] {\n display: none !important;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/table/table.js
|
|
10
|
+
var PunicaTable = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
label: {},
|
|
13
|
+
caption: {},
|
|
14
|
+
dense: { type: Boolean },
|
|
15
|
+
striped: { type: Boolean },
|
|
16
|
+
stickyHeader: { type: Boolean },
|
|
17
|
+
dividers: { type: Boolean },
|
|
18
|
+
selectable: {},
|
|
19
|
+
labelSelectRow: { default: "Select row" },
|
|
20
|
+
labelSelectAll: { default: "Select all rows" }
|
|
21
|
+
};
|
|
22
|
+
static styles = table_default;
|
|
23
|
+
static template = `
|
|
24
|
+
<div part="caption" class="caption" aria-hidden="true" hidden></div>
|
|
25
|
+
<div part="toolbar" class="toolbar" hidden><slot name="toolbar"></slot></div>
|
|
26
|
+
<slot></slot>
|
|
27
|
+
<div part="empty" class="empty" hidden><slot name="empty"></slot></div>
|
|
28
|
+
`;
|
|
29
|
+
#caption = this.$(".caption");
|
|
30
|
+
#empty = this.$(".empty");
|
|
31
|
+
#emptySlot = this.$('slot[name="empty"]');
|
|
32
|
+
#toolbar = this.$(".toolbar");
|
|
33
|
+
#toolbarSlot = this.$('slot[name="toolbar"]');
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.internals.role = "table";
|
|
37
|
+
this.shadowRoot.addEventListener("slotchange", () => this.refresh());
|
|
38
|
+
}
|
|
39
|
+
/** @returns {any[]} */
|
|
40
|
+
get #allRows() {
|
|
41
|
+
return [...this.querySelectorAll("punica-table-row")].filter((row) => row.closest("punica-table") === this);
|
|
42
|
+
}
|
|
43
|
+
get rows() {
|
|
44
|
+
return this.#allRows.filter((row) => !row.closest("punica-table-header, punica-table-footer"));
|
|
45
|
+
}
|
|
46
|
+
get selectedValues() {
|
|
47
|
+
return this.rows.filter((row) => row.selected).map((row) => row.value);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clears every selected row. Like any change made from code, it fires
|
|
51
|
+
* nothing; the header checkbox and any selection toolbar follow.
|
|
52
|
+
*/
|
|
53
|
+
clearSelection() {
|
|
54
|
+
for (const row of this.rows) row.selected = false;
|
|
55
|
+
this.refresh();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Re-reads the rows: the empty state, the header checkbox and the selection
|
|
59
|
+
* toolbars. Sections and rows call it when they change; an app has no need
|
|
60
|
+
* to.
|
|
61
|
+
*/
|
|
62
|
+
refresh() {
|
|
63
|
+
const rows = this.rows;
|
|
64
|
+
this.#empty.hidden = rows.length > 0 || this.#emptySlot.assignedNodes().length === 0;
|
|
65
|
+
this.#toolbar.hidden = this.#toolbarSlot.assignedElements().length === 0;
|
|
66
|
+
for (const row of this.#allRows) {
|
|
67
|
+
if (row.closest("punica-table-header")) row.requestUpdate?.();
|
|
68
|
+
}
|
|
69
|
+
for (const toolbar of selectionToolbars(this)) toolbar.requestUpdate?.();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The user toggled a row's checkbox, or the header's (`row` is null).
|
|
73
|
+
* @internal
|
|
74
|
+
* @param {any | null} row
|
|
75
|
+
* @param {boolean} selected
|
|
76
|
+
*/
|
|
77
|
+
userSelect(row, selected) {
|
|
78
|
+
const rows = this.rows;
|
|
79
|
+
if (!row) {
|
|
80
|
+
for (const each of rows) each.selected = selected;
|
|
81
|
+
} else {
|
|
82
|
+
row.selected = selected;
|
|
83
|
+
if (selected && this.selectable !== "multiple") {
|
|
84
|
+
for (const each of rows) if (each !== row) each.selected = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this.refresh();
|
|
88
|
+
this.emit("select", { value: this.selectedValues, item: row });
|
|
89
|
+
}
|
|
90
|
+
update(changed) {
|
|
91
|
+
const caption = this.caption || "";
|
|
92
|
+
this.#caption.textContent = caption;
|
|
93
|
+
this.#caption.hidden = !caption;
|
|
94
|
+
this.internals.ariaLabel = this.label || caption || null;
|
|
95
|
+
if (changed.has("selectable") || changed.has("labelSelectRow") || changed.has("labelSelectAll")) {
|
|
96
|
+
for (const row of this.#allRows) row.requestUpdate?.();
|
|
97
|
+
}
|
|
98
|
+
this.refresh();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
function selectionToolbars(table) {
|
|
102
|
+
const found = [...table.querySelectorAll("punica-table-selection-toolbar")];
|
|
103
|
+
const root = (
|
|
104
|
+
/** @type {Document | ShadowRoot} */
|
|
105
|
+
table.getRootNode()
|
|
106
|
+
);
|
|
107
|
+
if (table.id && root.querySelectorAll) {
|
|
108
|
+
for (const el of root.querySelectorAll("punica-table-selection-toolbar[for]")) {
|
|
109
|
+
if (el.getAttribute("for") === table.id && !found.includes(el)) found.push(el);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return found;
|
|
113
|
+
}
|
|
114
|
+
define("punica-table", PunicaTable);
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
PunicaTable
|
|
118
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.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/input/input.css
|
|
13
|
+
var input_default = ":host {\n --punica-input-height: var(--punica-size-md);\n --punica-input-padding: var(--punica-space-12);\n --punica-input-radius: var(--punica-radius);\n --punica-input-border-color: var(--punica-color-border);\n --punica-input-background: var(--punica-color-surface);\n --punica-input-color: var(--punica-color-text);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([size='small']) {\n --punica-input-height: var(--punica-size-sm);\n --punica-input-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-input-height: var(--punica-size-lg);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.base {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--punica-space-8);\n min-inline-size: 0;\n min-block-size: var(--punica-input-height);\n padding-inline: var(--punica-input-padding);\n border: var(--punica-border-width) solid var(--punica-input-border-color);\n border-radius: var(--punica-input-radius);\n background: var(--punica-input-background);\n color: var(--punica-input-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n cursor: text;\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(input: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\ninput {\n flex: 1;\n inline-size: 100%;\n min-inline-size: 0;\n margin: 0;\n padding: 0;\n border: 0;\n outline: none;\n background: none;\n color: inherit;\n font: inherit;\n text-align: inherit;\n -webkit-tap-highlight-color: transparent;\n}\ninput::placeholder {\n color: var(--punica-color-text-placeholder);\n opacity: 1;\n}\ninput[type='search']::-webkit-search-cancel-button {\n display: none;\n}\n\n.clear {\n all: unset;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-20);\n block-size: var(--punica-space-20);\n border-radius: var(--punica-radius-full);\n color: var(--punica-color-text-muted);\n cursor: pointer;\n}\n.clear:hover {\n background: var(--punica-color-hover);\n color: var(--punica-color-text);\n}\n.clear:focus-visible {\n outline: var(--punica-focus-ring);\n}\n.clear[hidden] {\n display: none;\n}\n\n:host([disabled]) .base,\n:host(:state(disabled)) .base {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n::slotted(*) {\n flex: none;\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";
|
|
14
|
+
|
|
15
|
+
// src/components/input/input.js
|
|
16
|
+
var setAttr = (el, name, value) => {
|
|
17
|
+
if (value == null || value === false) el.removeAttribute(name);
|
|
18
|
+
else el.setAttribute(name, value === true ? "" : String(value));
|
|
19
|
+
};
|
|
20
|
+
var flagsOf = (validity) => {
|
|
21
|
+
const flags = {};
|
|
22
|
+
for (const key in validity) if (key !== "valid" && validity[key]) flags[key] = true;
|
|
23
|
+
return flags;
|
|
24
|
+
};
|
|
25
|
+
var PunicaInput = class extends FormControl(PunicaElement) {
|
|
26
|
+
static properties = {
|
|
27
|
+
type: { default: "text" },
|
|
28
|
+
value: { reflect: false, default: "" },
|
|
29
|
+
label: {},
|
|
30
|
+
placeholder: {},
|
|
31
|
+
readonly: { type: Boolean },
|
|
32
|
+
pattern: {},
|
|
33
|
+
minlength: { type: Number },
|
|
34
|
+
maxlength: { type: Number },
|
|
35
|
+
min: {},
|
|
36
|
+
max: {},
|
|
37
|
+
step: {},
|
|
38
|
+
autocomplete: {},
|
|
39
|
+
inputmode: {},
|
|
40
|
+
clearable: { type: Boolean },
|
|
41
|
+
labelClear: { default: "Clear" },
|
|
42
|
+
size: {},
|
|
43
|
+
fullWidth: { type: Boolean }
|
|
44
|
+
};
|
|
45
|
+
static styles = input_default;
|
|
46
|
+
static shadowOptions = { delegatesFocus: true };
|
|
47
|
+
static template = `
|
|
48
|
+
<div part="base" class="base">
|
|
49
|
+
<slot name="start"></slot>
|
|
50
|
+
<input part="input" />
|
|
51
|
+
<button part="clear" class="clear" type="button" tabindex="-1" hidden>${icons.close}</button>
|
|
52
|
+
<slot name="end"></slot>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
#input = this.$("input");
|
|
56
|
+
#clear = this.$(".clear");
|
|
57
|
+
#touched = false;
|
|
58
|
+
constructor() {
|
|
59
|
+
super();
|
|
60
|
+
const input = this.#input;
|
|
61
|
+
input.addEventListener("input", () => {
|
|
62
|
+
this.value = input.value;
|
|
63
|
+
this.emit("input", { value: this.value });
|
|
64
|
+
});
|
|
65
|
+
input.addEventListener("change", () => {
|
|
66
|
+
this.value = input.value;
|
|
67
|
+
this.emit("change", { value: this.value });
|
|
68
|
+
});
|
|
69
|
+
input.addEventListener("keydown", (event) => {
|
|
70
|
+
if (event.key === "Enter" && !event.isComposing && !event.defaultPrevented) {
|
|
71
|
+
this.form?.requestSubmit();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
input.addEventListener("blur", () => this.#touch());
|
|
75
|
+
this.addEventListener("invalid", () => this.#touch());
|
|
76
|
+
this.#clear.addEventListener("click", () => this.#onClear());
|
|
77
|
+
this.$(".base").addEventListener("mousedown", (event) => {
|
|
78
|
+
if (event.target === input || event.target === this.#clear || this.isDisabled) return;
|
|
79
|
+
if (event.target.closest?.("button, a, input, select, textarea, [tabindex]")) return;
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
input.focus();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
update() {
|
|
85
|
+
const input = this.#input;
|
|
86
|
+
setAttr(input, "type", this.type || "text");
|
|
87
|
+
setAttr(input, "placeholder", this.placeholder);
|
|
88
|
+
setAttr(input, "pattern", this.pattern);
|
|
89
|
+
setAttr(input, "minlength", this.minlength);
|
|
90
|
+
setAttr(input, "maxlength", this.maxlength);
|
|
91
|
+
setAttr(input, "min", this.min);
|
|
92
|
+
setAttr(input, "max", this.max);
|
|
93
|
+
setAttr(input, "step", this.step);
|
|
94
|
+
setAttr(input, "autocomplete", this.autocomplete);
|
|
95
|
+
setAttr(input, "inputmode", this.inputmode);
|
|
96
|
+
setAttr(input, "aria-label", this.#name());
|
|
97
|
+
input.readOnly = this.readonly;
|
|
98
|
+
input.required = this.required;
|
|
99
|
+
input.disabled = this.isDisabled;
|
|
100
|
+
const value = this.value ?? "";
|
|
101
|
+
if (input.value !== value) input.value = value;
|
|
102
|
+
setAttr(this.#clear, "aria-label", this.labelClear);
|
|
103
|
+
this.#clear.hidden = !this.clearable || !input.value || this.readonly || this.isDisabled;
|
|
104
|
+
this.setFormValue(input.value);
|
|
105
|
+
this.setValidity(flagsOf(input.validity), input.validationMessage, input);
|
|
106
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
107
|
+
}
|
|
108
|
+
formReset() {
|
|
109
|
+
this.#touched = false;
|
|
110
|
+
this.value = this.getAttribute("value") ?? "";
|
|
111
|
+
this.requestUpdate();
|
|
112
|
+
}
|
|
113
|
+
formRestore(state) {
|
|
114
|
+
if (typeof state === "string") this.value = state;
|
|
115
|
+
}
|
|
116
|
+
/** Moves focus to the field. */
|
|
117
|
+
focus(options) {
|
|
118
|
+
this.#input.focus(options);
|
|
119
|
+
}
|
|
120
|
+
/** Selects all the text in the field. */
|
|
121
|
+
select() {
|
|
122
|
+
this.#input.select();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Selects a range of the text.
|
|
126
|
+
* @param {number} start
|
|
127
|
+
* @param {number} end
|
|
128
|
+
* @param {'forward' | 'backward' | 'none'} [direction]
|
|
129
|
+
*/
|
|
130
|
+
setSelectionRange(start, end, direction) {
|
|
131
|
+
this.#input.setSelectionRange(start, end, direction);
|
|
132
|
+
}
|
|
133
|
+
#name() {
|
|
134
|
+
if (this.label) return this.label;
|
|
135
|
+
const text = [...this.labels].map((l) => l.textContent.trim()).filter(Boolean);
|
|
136
|
+
return text.length ? text.join(" ") : null;
|
|
137
|
+
}
|
|
138
|
+
#touch() {
|
|
139
|
+
this.#touched = true;
|
|
140
|
+
this.toggleState("user-invalid", !this.validity.valid);
|
|
141
|
+
}
|
|
142
|
+
#onClear() {
|
|
143
|
+
if (this.isDisabled || this.readonly) return;
|
|
144
|
+
this.value = "";
|
|
145
|
+
this.#input.value = "";
|
|
146
|
+
this.#input.focus();
|
|
147
|
+
this.emit("input", { value: "" });
|
|
148
|
+
this.emit("change", { value: "" });
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
define("punica-input", PunicaInput);
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
PunicaInput
|
|
155
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/accordion/accordionGroup.css
|
|
7
|
+
var accordionGroup_default = ":host {\n --punica-accordion-group-gap: var(--punica-space-0);\n --punica-accordion-group-divider: var(--punica-border-width) solid var(--punica-color-border);\n\n display: flex;\n flex-direction: column;\n gap: var(--punica-accordion-group-gap);\n}\n\n::slotted(punica-accordion:not(:first-of-type)) {\n border-block-start: var(--punica-accordion-group-divider);\n}\n\n@media (forced-colors: active) {\n ::slotted(punica-accordion:not(:first-of-type)) {\n border-block-start-color: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/accordion/accordionGroup.js
|
|
10
|
+
var PunicaAccordionGroup = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
multiple: { type: Boolean }
|
|
13
|
+
};
|
|
14
|
+
static styles = accordionGroup_default;
|
|
15
|
+
static template = `<slot></slot>`;
|
|
16
|
+
/** @type {MutationObserver | null} */
|
|
17
|
+
#observer = null;
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.addEventListener("punica-toggle", (event) => {
|
|
21
|
+
const target = (
|
|
22
|
+
/** @type {any} */
|
|
23
|
+
event.target
|
|
24
|
+
);
|
|
25
|
+
const detail = (
|
|
26
|
+
/** @type {CustomEvent} */
|
|
27
|
+
event.detail
|
|
28
|
+
);
|
|
29
|
+
if (this.multiple || !detail?.open || target.parentElement !== this) return;
|
|
30
|
+
this.#closeOthers(target);
|
|
31
|
+
});
|
|
32
|
+
this.$("slot").addEventListener("slotchange", () => this.requestUpdate());
|
|
33
|
+
}
|
|
34
|
+
/** The sections of this group, in order. */
|
|
35
|
+
get items() {
|
|
36
|
+
return [...this.children].filter((el) => el.localName === "punica-accordion");
|
|
37
|
+
}
|
|
38
|
+
connected() {
|
|
39
|
+
this.#observer = new MutationObserver((records) => {
|
|
40
|
+
if (this.multiple) return;
|
|
41
|
+
let opened = null;
|
|
42
|
+
for (const record of records) {
|
|
43
|
+
const target = (
|
|
44
|
+
/** @type {Element} */
|
|
45
|
+
record.target
|
|
46
|
+
);
|
|
47
|
+
if (target.parentElement === this && target.localName === "punica-accordion" && record.oldValue === null && target.hasAttribute("open")) {
|
|
48
|
+
opened = target;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (opened) this.#closeOthers(opened);
|
|
52
|
+
});
|
|
53
|
+
this.#observer.observe(this, {
|
|
54
|
+
attributes: true,
|
|
55
|
+
attributeFilter: ["open"],
|
|
56
|
+
attributeOldValue: true,
|
|
57
|
+
subtree: true
|
|
58
|
+
});
|
|
59
|
+
this.requestUpdate();
|
|
60
|
+
}
|
|
61
|
+
disconnected() {
|
|
62
|
+
this.#observer?.disconnect();
|
|
63
|
+
this.#observer = null;
|
|
64
|
+
}
|
|
65
|
+
#closeOthers(keep) {
|
|
66
|
+
for (const item of this.items) {
|
|
67
|
+
if (item !== keep) item.open = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
update() {
|
|
71
|
+
if (this.multiple) return;
|
|
72
|
+
const open = this.items.filter((item) => item.hasAttribute("open"));
|
|
73
|
+
if (open.length > 1) this.#closeOthers(open[0]);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
define("punica-accordion-group", PunicaAccordionGroup);
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
PunicaAccordionGroup
|
|
80
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/toast/toast.css
|
|
10
|
+
var toast_default = ":host {\n --_accent: var(--punica-color-text);\n --_on-accent: var(--punica-color-surface);\n --punica-toast-radius: var(--punica-radius);\n --punica-toast-padding: var(--punica-space-12) var(--punica-space-16);\n --punica-toast-background: var(--_accent);\n --punica-toast-color: var(--_on-accent);\n --punica-toast-shadow: var(--punica-shadow-md);\n --punica-toast-max-width: min(92vw, 420px);\n\n display: block;\n max-inline-size: var(--punica-toast-max-width);\n pointer-events: auto;\n}\n\n:host([color='primary']) {\n --_accent: var(--punica-color-primary);\n --_on-accent: var(--punica-color-on-accent);\n}\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n --_on-accent: var(--punica-color-on-accent);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n --_on-accent: var(--punica-color-on-accent);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n --_on-accent: var(--punica-color-on-accent);\n}\n:host([color='info']) {\n --_accent: var(--punica-color-info);\n --_on-accent: var(--punica-color-on-accent);\n}\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n --_on-accent: var(--punica-color-on-accent);\n}\n\n[part='base'] {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--punica-space-12);\n padding: var(--punica-toast-padding);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-toast-radius);\n background: var(--punica-toast-background);\n color: var(--punica-toast-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n box-shadow: var(--punica-toast-shadow);\n overflow: hidden;\n opacity: 1;\n transform: none;\n transition: opacity var(--punica-duration-slow) var(--punica-ease),\n transform var(--punica-duration-slow) var(--punica-ease);\n}\n\n@starting-style {\n [part='base'] {\n opacity: 0;\n transform: translateY(var(--punica-space-8));\n }\n}\n\n:host(:state(leaving)) [part='base'] {\n opacity: 0;\n transform: translateY(var(--punica-space-6));\n}\n\n/* A punica-button in the action slot takes the toast's text colour: its own\n accent is unreadable on an accent background (lavender on navy, or on the\n light neutral toast of the dark theme). */\n::slotted(punica-button[slot='action']),\n::slotted(punica-icon-button[slot='action']) {\n --_accent: var(--punica-toast-color);\n --_accent-strong: var(--punica-toast-color);\n}\n\n[part='message'] {\n flex: 1;\n min-inline-size: 0;\n overflow-wrap: anywhere;\n}\n\n.close {\n all: unset;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-24);\n block-size: var(--punica-space-24);\n border-radius: var(--punica-radius-full);\n cursor: pointer;\n transition: background-color var(--punica-duration) var(--punica-ease);\n}\n\n.close:hover {\n background: color-mix(in srgb, currentColor 20%, transparent);\n}\n\n.close:focus-visible {\n outline: var(--punica-focus-ring-width) solid currentColor;\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n:host([no-close-button]) .close {\n display: none;\n}\n\n[part='progress'] {\n position: absolute;\n inset-block-end: 0;\n inset-inline: 0;\n block-size: var(--punica-space-2);\n background: currentColor;\n opacity: 0.6;\n transform-origin: 0 50%;\n animation: shrink linear forwards;\n animation-duration: var(--_duration, 0ms);\n}\n\n:host(:dir(rtl)) [part='progress'] {\n transform-origin: 100% 50%;\n}\n\n:host(:state(paused)) [part='progress'] {\n animation-play-state: paused;\n}\n\n[hidden] {\n display: none !important;\n}\n\n@keyframes shrink {\n from {\n transform: scaleX(1);\n }\n to {\n transform: scaleX(0);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n [part='progress'] {\n display: none;\n }\n}\n\n@media (forced-colors: active) {\n [part='base'] {\n border-color: CanvasText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/toast/toast.js
|
|
13
|
+
var PunicaToast = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
color: {},
|
|
16
|
+
duration: { type: Number, default: 5e3 },
|
|
17
|
+
noCloseButton: { type: Boolean },
|
|
18
|
+
labelClose: { default: "Close" }
|
|
19
|
+
};
|
|
20
|
+
static styles = toast_default;
|
|
21
|
+
static template = `
|
|
22
|
+
<div part="base">
|
|
23
|
+
<slot name="start"></slot>
|
|
24
|
+
<div part="message"><slot></slot></div>
|
|
25
|
+
<slot name="action"></slot>
|
|
26
|
+
<button part="close-button" class="close" type="button">${icons.close}</button>
|
|
27
|
+
<span part="progress" hidden></span>
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
#base = this.$('[part="base"]');
|
|
31
|
+
#progress = this.$('[part="progress"]');
|
|
32
|
+
#timer = 0;
|
|
33
|
+
#leaveTimer = 0;
|
|
34
|
+
#remaining = 0;
|
|
35
|
+
#startedAt = 0;
|
|
36
|
+
#holds = /* @__PURE__ */ new Set();
|
|
37
|
+
#leaving = false;
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
const base = this.#base;
|
|
41
|
+
this.$(".close").addEventListener("click", () => this.#dismiss("user"));
|
|
42
|
+
base.addEventListener("keydown", (event) => {
|
|
43
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
this.#dismiss("user");
|
|
46
|
+
});
|
|
47
|
+
base.addEventListener("pointerenter", () => this.#hold("pointer", true));
|
|
48
|
+
base.addEventListener("pointerleave", () => this.#hold("pointer", false));
|
|
49
|
+
base.addEventListener("focusin", () => this.#hold("focus", true));
|
|
50
|
+
base.addEventListener("focusout", () => this.#hold("focus", false));
|
|
51
|
+
}
|
|
52
|
+
/** Whether the countdown is held by the pointer or by focus. */
|
|
53
|
+
get paused() {
|
|
54
|
+
return this.#holds.size > 0;
|
|
55
|
+
}
|
|
56
|
+
/** Removes the toast, after its exit transition. Fires nothing. */
|
|
57
|
+
dismiss() {
|
|
58
|
+
this.#leave();
|
|
59
|
+
}
|
|
60
|
+
connected() {
|
|
61
|
+
this.#leaving = false;
|
|
62
|
+
this.#holds.clear();
|
|
63
|
+
this.toggleState("leaving", false);
|
|
64
|
+
this.toggleState("paused", false);
|
|
65
|
+
this.#run();
|
|
66
|
+
}
|
|
67
|
+
disconnected() {
|
|
68
|
+
clearTimeout(this.#timer);
|
|
69
|
+
clearTimeout(this.#leaveTimer);
|
|
70
|
+
}
|
|
71
|
+
update(changed) {
|
|
72
|
+
this.$(".close").setAttribute("aria-label", this.labelClose);
|
|
73
|
+
if (!changed.has("duration")) return;
|
|
74
|
+
this.#remaining = Math.max(0, this.duration ?? 0);
|
|
75
|
+
this.#progress.hidden = !this.#remaining;
|
|
76
|
+
this.#progress.style.setProperty("--_duration", `${this.#remaining}ms`);
|
|
77
|
+
this.#run();
|
|
78
|
+
}
|
|
79
|
+
#run() {
|
|
80
|
+
clearTimeout(this.#timer);
|
|
81
|
+
if (!this.#remaining || this.paused || this.#leaving) return;
|
|
82
|
+
this.#startedAt = performance.now();
|
|
83
|
+
this.#timer = setTimeout(() => this.#dismiss("timeout"), this.#remaining);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param {'pointer' | 'focus'} by
|
|
87
|
+
* @param {boolean} on
|
|
88
|
+
*/
|
|
89
|
+
#hold(by, on) {
|
|
90
|
+
const was = this.paused;
|
|
91
|
+
if (on) this.#holds.add(by);
|
|
92
|
+
else this.#holds.delete(by);
|
|
93
|
+
if (was === this.paused) return;
|
|
94
|
+
this.toggleState("paused", this.paused);
|
|
95
|
+
if (this.paused) {
|
|
96
|
+
clearTimeout(this.#timer);
|
|
97
|
+
if (this.#remaining) {
|
|
98
|
+
this.#remaining = Math.max(1, this.#remaining - (performance.now() - this.#startedAt));
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
this.#run();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** @param {'user' | 'timeout'} reason */
|
|
105
|
+
#dismiss(reason) {
|
|
106
|
+
if (this.#leaving) return;
|
|
107
|
+
this.emit("dismiss", { reason });
|
|
108
|
+
this.#leave();
|
|
109
|
+
}
|
|
110
|
+
#leave() {
|
|
111
|
+
if (this.#leaving || !this.isConnected) return;
|
|
112
|
+
this.#leaving = true;
|
|
113
|
+
clearTimeout(this.#timer);
|
|
114
|
+
this.toggleState("leaving", true);
|
|
115
|
+
const ms = parseFloat(getComputedStyle(this.#base).transitionDuration) * 1e3;
|
|
116
|
+
if (ms > 0) this.#leaveTimer = setTimeout(() => this.remove(), ms);
|
|
117
|
+
else this.remove();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
define("punica-toast", PunicaToast);
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
PunicaToast
|
|
124
|
+
};
|