@punica/components 0.0.0-stage → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +139 -2
- package/bin/punica-components.mjs +138 -0
- package/custom-elements.json +38745 -0
- package/dist/ai/index.d.ts +39 -0
- package/dist/ai/index.mjs +615 -0
- package/dist/ai/node.d.ts +5 -0
- package/dist/ai/node.mjs +625 -0
- package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
- package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
- package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
- package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
- package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
- package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
- package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
- package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
- package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
- package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
- package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
- package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
- package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
- package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
- package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
- package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
- package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
- package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
- package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
- package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
- package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
- package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
- package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
- package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
- package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
- package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
- package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
- package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
- package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
- package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
- package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
- package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
- package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
- package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
- package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
- package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
- package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
- package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
- package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
- package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
- package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
- package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
- package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
- package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
- package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
- package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
- package/dist/esm/chunks/chunk-BC657356.js +93 -0
- package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
- package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
- package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
- package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
- package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
- package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
- package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
- package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
- package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
- package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
- package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
- package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
- package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
- package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
- package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
- package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
- package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
- package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
- package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
- package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
- package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
- package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
- package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
- package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
- package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
- package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
- package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
- package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
- package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
- package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
- package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
- package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
- package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
- package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
- package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
- package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
- package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
- package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
- package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
- package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
- package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
- package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
- package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
- package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
- package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
- package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
- package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
- package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
- package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
- package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
- package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
- package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
- package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
- package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
- package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
- package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
- package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
- package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
- package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
- package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
- package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
- package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
- package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
- package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
- package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
- package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
- package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
- package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
- package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
- package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
- package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
- package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
- package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
- package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
- package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
- package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
- package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
- package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
- package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
- package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
- package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
- package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
- package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
- package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
- package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
- package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
- package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
- package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
- package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
- package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
- package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
- package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
- package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
- package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
- package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
- package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
- package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
- package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
- package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
- package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
- package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
- package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
- package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
- package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
- package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
- package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
- package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
- package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
- package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
- package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
- package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
- package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
- package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
- package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
- package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
- package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
- package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
- package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
- package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
- package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
- package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
- package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
- package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
- package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
- package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
- package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
- package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
- package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
- package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
- package/dist/esm/components/accordion/accordion.js +8 -0
- package/dist/esm/components/accordion/accordionGroup.js +7 -0
- package/dist/esm/components/agenda/agenda.js +9 -0
- package/dist/esm/components/alert/alert.js +8 -0
- package/dist/esm/components/alertDialog/alertDialog.js +14 -0
- package/dist/esm/components/appBar/appBar.js +7 -0
- package/dist/esm/components/appShell/appShell.js +11 -0
- package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
- package/dist/esm/components/autocomplete/autocomplete.js +14 -0
- package/dist/esm/components/avatar/avatar.js +7 -0
- package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
- package/dist/esm/components/badge/badge.js +7 -0
- package/dist/esm/components/banner/banner.js +9 -0
- package/dist/esm/components/blockquote/blockquote.js +7 -0
- package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
- package/dist/esm/components/box/box.js +7 -0
- package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/esm/components/button/button.js +8 -0
- package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
- package/dist/esm/components/calendar/calendar.js +12 -0
- package/dist/esm/components/calendar/dates.js +44 -0
- package/dist/esm/components/card/card.js +7 -0
- package/dist/esm/components/card/cardActions.js +7 -0
- package/dist/esm/components/card/cardContent.js +7 -0
- package/dist/esm/components/card/cardHeader.js +7 -0
- package/dist/esm/components/card/cardMedia.js +7 -0
- package/dist/esm/components/carousel/carousel.js +9 -0
- package/dist/esm/components/carousel/carouselItem.js +7 -0
- package/dist/esm/components/center/center.js +7 -0
- package/dist/esm/components/chat/chatComposer.js +9 -0
- package/dist/esm/components/chat/chatDictationButton.js +8 -0
- package/dist/esm/components/chat/chatLayout.js +9 -0
- package/dist/esm/components/chat/chatMessage.js +9 -0
- package/dist/esm/components/chat/chatMessageBubble.js +7 -0
- package/dist/esm/components/chat/chatMessageList.js +8 -0
- package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
- package/dist/esm/components/chat/chatSystemMessage.js +7 -0
- package/dist/esm/components/chat/chatToolCall.js +9 -0
- package/dist/esm/components/chat/chatToolCalls.js +8 -0
- package/dist/esm/components/chat/slots.js +6 -0
- package/dist/esm/components/checkbox/checkbox.js +9 -0
- package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
- package/dist/esm/components/chip/chip.js +8 -0
- package/dist/esm/components/citation/citation.js +11 -0
- package/dist/esm/components/code/code.js +7 -0
- package/dist/esm/components/codeBlock/codeBlock.js +8 -0
- package/dist/esm/components/collapsible/collapsible.js +7 -0
- package/dist/esm/components/commandPalette/commandGroup.js +7 -0
- package/dist/esm/components/commandPalette/commandItem.js +7 -0
- package/dist/esm/components/commandPalette/commandPalette.js +10 -0
- package/dist/esm/components/complexSelector/complexOption.js +9 -0
- package/dist/esm/components/complexSelector/complexSelector.js +16 -0
- package/dist/esm/components/complexSelector/optionGroup.js +7 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/contextMenu/contextMenu.js +12 -0
- package/dist/esm/components/datePicker/datePicker.js +15 -0
- package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
- package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
- package/dist/esm/components/dialog/dialog.js +11 -0
- package/dist/esm/components/dialog/dialogContent.js +7 -0
- package/dist/esm/components/dialog/dialogFooter.js +7 -0
- package/dist/esm/components/dialog/dialogHeader.js +7 -0
- package/dist/esm/components/dialog/modalSurface.js +8 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/drawer/drawer.js +10 -0
- package/dist/esm/components/emptyState/emptyState.js +7 -0
- package/dist/esm/components/field/field.js +7 -0
- package/dist/esm/components/fileInput/fileInput.js +9 -0
- package/dist/esm/components/formLayout/formLayout.js +7 -0
- package/dist/esm/components/grid/col.js +7 -0
- package/dist/esm/components/grid/row.js +7 -0
- package/dist/esm/components/heading/heading.js +7 -0
- package/dist/esm/components/hidden/hidden.js +7 -0
- package/dist/esm/components/hoverCard/hoverCard.js +9 -0
- package/dist/esm/components/icon/icon.js +8 -0
- package/dist/esm/components/iconButton/iconButton.js +8 -0
- package/dist/esm/components/infoTip/infoTip.js +10 -0
- package/dist/esm/components/input/input.js +9 -0
- package/dist/esm/components/inputGroup/inputGroup.js +9 -0
- package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
- package/dist/esm/components/kbd/kbd.js +7 -0
- package/dist/esm/components/lightbox/lightbox.js +10 -0
- package/dist/esm/components/link/link.js +8 -0
- package/dist/esm/components/listView/list.js +7 -0
- package/dist/esm/components/listView/listItem.js +7 -0
- package/dist/esm/components/listbox/listbox.js +9 -0
- package/dist/esm/components/listbox/listboxItem.js +8 -0
- package/dist/esm/components/markdown/markdown.js +9 -0
- package/dist/esm/components/markdown/parser.js +9 -0
- package/dist/esm/components/markdown/url.js +6 -0
- package/dist/esm/components/menu/menu.js +11 -0
- package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
- package/dist/esm/components/menu/menuDivider.js +7 -0
- package/dist/esm/components/menu/menuGroup.js +7 -0
- package/dist/esm/components/menu/menuItem.js +8 -0
- package/dist/esm/components/menu/menuRadioGroup.js +7 -0
- package/dist/esm/components/menu/menuRadioItem.js +9 -0
- package/dist/esm/components/metadataList/metadataList.js +9 -0
- package/dist/esm/components/metadataList/metadataListItem.js +8 -0
- package/dist/esm/components/mobileNav/mobileNav.js +10 -0
- package/dist/esm/components/numberInput/numberInput.js +9 -0
- package/dist/esm/components/outline/outline.js +8 -0
- package/dist/esm/components/overflowList/overflowList.js +11 -0
- package/dist/esm/components/pagination/pagination.js +8 -0
- package/dist/esm/components/paper/paper.js +7 -0
- package/dist/esm/components/popover/popover.js +9 -0
- package/dist/esm/components/powerSearch/powerSearch.js +14 -0
- package/dist/esm/components/progressBar/progressBar.js +7 -0
- package/dist/esm/components/qrCode/qrCode.js +9 -0
- package/dist/esm/components/radio/radio.js +7 -0
- package/dist/esm/components/radio/radioGroup.js +10 -0
- package/dist/esm/components/scrollArea/scrollArea.js +8 -0
- package/dist/esm/components/section/section.js +8 -0
- package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
- package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
- package/dist/esm/components/select/field.js +18 -0
- package/dist/esm/components/select/option.js +8 -0
- package/dist/esm/components/select/select.js +14 -0
- package/dist/esm/components/selectableCard/selectableCard.js +9 -0
- package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
- package/dist/esm/components/sideNav/sideNav.js +9 -0
- package/dist/esm/components/sideNav/sideNavItem.js +9 -0
- package/dist/esm/components/sideNav/sideNavSection.js +8 -0
- package/dist/esm/components/skeleton/skeleton.js +7 -0
- package/dist/esm/components/slider/slider.js +9 -0
- package/dist/esm/components/spinner/spinner.js +7 -0
- package/dist/esm/components/split/split.js +8 -0
- package/dist/esm/components/splitButton/splitButton.js +12 -0
- package/dist/esm/components/stack/stack.js +7 -0
- package/dist/esm/components/statusDot/statusDot.js +7 -0
- package/dist/esm/components/stepper/step.js +8 -0
- package/dist/esm/components/stepper/stepper.js +7 -0
- package/dist/esm/components/switch/switch.js +8 -0
- package/dist/esm/components/tab/tab.js +7 -0
- package/dist/esm/components/tab/tabPanel.js +7 -0
- package/dist/esm/components/tab/tabs.js +8 -0
- package/dist/esm/components/table/table.js +7 -0
- package/dist/esm/components/table/tableBody.js +7 -0
- package/dist/esm/components/table/tableCell.js +7 -0
- package/dist/esm/components/table/tableFooter.js +7 -0
- package/dist/esm/components/table/tableHeader.js +7 -0
- package/dist/esm/components/table/tableHeaderCell.js +8 -0
- package/dist/esm/components/table/tableRow.js +7 -0
- package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
- package/dist/esm/components/text/text.js +7 -0
- package/dist/esm/components/textarea/textarea.js +8 -0
- package/dist/esm/components/thumbnail/thumbnail.js +8 -0
- package/dist/esm/components/timePicker/timePicker.js +15 -0
- package/dist/esm/components/timer/timer.js +7 -0
- package/dist/esm/components/timestamp/timestamp.js +7 -0
- package/dist/esm/components/toast/toast.js +8 -0
- package/dist/esm/components/toast/toaster.js +12 -0
- package/dist/esm/components/toggleButton/toggleButton.js +8 -0
- package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
- package/dist/esm/components/tokenizer/tokenizer.js +14 -0
- package/dist/esm/components/toolbar/toolbar.js +8 -0
- package/dist/esm/components/tooltip/tooltip.js +9 -0
- package/dist/esm/components/topNav/topNav.js +11 -0
- package/dist/esm/components/topNav/topNavItem.js +11 -0
- package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
- package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
- package/dist/esm/components/tree/tree.js +8 -0
- package/dist/esm/components/tree/treeItem.js +8 -0
- package/dist/esm/components/virtualList/virtualList.js +7 -0
- package/dist/esm/components/virtualTable/virtualTable.js +9 -0
- package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
- package/dist/esm/core/a11y.js +22 -0
- package/dist/esm/core/element.js +14 -0
- package/dist/esm/core/form.js +6 -0
- package/dist/esm/core/overlay.js +8 -0
- package/dist/esm/index.js +779 -0
- package/dist/llms-full.txt +8890 -0
- package/dist/llms.txt +275 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6753 -0
- package/dist/types/react.d.ts +1914 -0
- package/dist/vscode.css-custom-data.json +3892 -0
- package/dist/vscode.html-custom-data.json +6912 -0
- package/dist/web-types.json +12404 -0
- package/docs/MIGRATION-2.0.md +112 -0
- package/docs/contract.md +130 -0
- package/docs/migration/chat.md +309 -0
- package/docs/migration/content.md +806 -0
- package/docs/migration/data.md +140 -0
- package/docs/migration/display.md +625 -0
- package/docs/migration/form-basic.md +262 -0
- package/docs/migration/navigation.md +368 -0
- package/docs/migration/overlays.md +261 -0
- package/docs/migration/pickers.md +194 -0
- package/package.json +131 -4
- package/scripts/codemod-2.0.mjs +50 -0
- package/scripts/codemod-rules.mjs +102 -0
- package/skills/punica-components/SKILL.md +48 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/tab/tabPanel.css
|
|
7
|
+
var tabPanel_default = ":host {\n --punica-tab-panel-padding: var(--punica-space-16);\n\n display: block;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n:host(:not([active])) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\n.base {\n padding: var(--punica-tab-panel-padding);\n}\n\n@media (forced-colors: active) {\n :host(:focus-visible) {\n outline-color: Highlight;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/tab/tabPanel.js
|
|
10
|
+
var PunicaTabPanel = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
active: { type: Boolean }
|
|
14
|
+
};
|
|
15
|
+
static styles = tabPanel_default;
|
|
16
|
+
static template = `<div part="base" class="base"><slot></slot></div>`;
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.internals.role = "tabpanel";
|
|
20
|
+
}
|
|
21
|
+
connected() {
|
|
22
|
+
if (!this.hasAttribute("tabindex")) this.tabIndex = 0;
|
|
23
|
+
}
|
|
24
|
+
update(changed) {
|
|
25
|
+
this.toggleState("active", this.active);
|
|
26
|
+
if (changed.has("value")) this.parentElement?.requestUpdate?.();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
define("punica-tab-panel", PunicaTabPanel);
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
PunicaTabPanel
|
|
33
|
+
};
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compareDates,
|
|
3
|
+
formatFieldDate,
|
|
4
|
+
parseFieldDate,
|
|
5
|
+
parseIsoDate,
|
|
6
|
+
toIsoDate,
|
|
7
|
+
todayDate
|
|
8
|
+
} from "./chunk-CKI34FQL.js";
|
|
9
|
+
import {
|
|
10
|
+
field_default
|
|
11
|
+
} from "./chunk-LSDTMST7.js";
|
|
12
|
+
import {
|
|
13
|
+
FieldSurface,
|
|
14
|
+
fieldLanguage,
|
|
15
|
+
fieldName,
|
|
16
|
+
nativeMessage,
|
|
17
|
+
setAttr
|
|
18
|
+
} from "./chunk-H4Q2HHZA.js";
|
|
19
|
+
import {
|
|
20
|
+
FormControl
|
|
21
|
+
} from "./chunk-HW2CN2JV.js";
|
|
22
|
+
import {
|
|
23
|
+
overlayCss
|
|
24
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
25
|
+
import {
|
|
26
|
+
icons
|
|
27
|
+
} from "./chunk-YSGWORUD.js";
|
|
28
|
+
import {
|
|
29
|
+
PunicaElement,
|
|
30
|
+
define
|
|
31
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
32
|
+
|
|
33
|
+
// src/components/dateRangeInput/dateRangeInput.css
|
|
34
|
+
var dateRangeInput_default = ":host {\n --punica-date-range-input-radius: var(--punica-radius);\n --punica-date-range-input-height: var(--punica-size-md);\n --punica-date-range-input-padding: var(--punica-space-12);\n --punica-date-range-input-border-color: var(--punica-color-border);\n --punica-date-range-input-background: transparent;\n --punica-date-range-input-min-width: 300px;\n --punica-date-range-input-panel-padding: var(--punica-space-12);\n\n --_height: var(--punica-date-range-input-height);\n --_pad: var(--punica-date-range-input-padding);\n --_radius: var(--punica-date-range-input-radius);\n --_border: var(--punica-date-range-input-border-color);\n --_bg: var(--punica-date-range-input-background);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-date-range-input-min-width);\n}\n\n:host([size='small']) {\n --punica-date-range-input-height: var(--punica-size-sm);\n --punica-date-range-input-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-date-range-input-height: var(--punica-size-lg);\n --punica-date-range-input-padding: var(--punica-space-16);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.separator {\n flex: none;\n inline-size: var(--punica-space-8);\n border-block-start: var(--punica-border-width) solid var(--punica-color-border-strong);\n}\n\n[part='panel'] {\n padding: var(--punica-date-range-input-panel-padding);\n}\n";
|
|
35
|
+
|
|
36
|
+
// src/components/dateRangeInput/dateRangeInput.js
|
|
37
|
+
var PunicaDateRangeInput = class extends FormControl(PunicaElement) {
|
|
38
|
+
static properties = {
|
|
39
|
+
valueStart: { reflect: false },
|
|
40
|
+
valueEnd: { reflect: false },
|
|
41
|
+
min: {},
|
|
42
|
+
max: {},
|
|
43
|
+
locale: {},
|
|
44
|
+
label: {},
|
|
45
|
+
labelStart: { default: "Start date" },
|
|
46
|
+
labelEnd: { default: "End date" },
|
|
47
|
+
placeholderStart: {},
|
|
48
|
+
placeholderEnd: {},
|
|
49
|
+
open: { type: Boolean },
|
|
50
|
+
readonly: { type: Boolean },
|
|
51
|
+
size: {},
|
|
52
|
+
fullWidth: { type: Boolean },
|
|
53
|
+
labelToggle: { default: "Choose dates" },
|
|
54
|
+
labelPreviousMonth: { default: "Previous month" },
|
|
55
|
+
labelNextMonth: { default: "Next month" },
|
|
56
|
+
labelPreviousYear: { default: "Previous year" },
|
|
57
|
+
labelNextYear: { default: "Next year" },
|
|
58
|
+
disabledDates: { type: Object, attribute: false }
|
|
59
|
+
};
|
|
60
|
+
static styles = [overlayCss, field_default, dateRangeInput_default];
|
|
61
|
+
static shadowOptions = { delegatesFocus: true };
|
|
62
|
+
static template = `
|
|
63
|
+
<div part="field" class="field" role="group">
|
|
64
|
+
<slot name="start"></slot>
|
|
65
|
+
<input part="input start" class="control" data-edge="Start" type="text" inputmode="numeric" autocomplete="off" spellcheck="false">
|
|
66
|
+
<span part="separator" class="separator" aria-hidden="true"></span>
|
|
67
|
+
<input part="input end" class="control" data-edge="End" type="text" inputmode="numeric" autocomplete="off" spellcheck="false">
|
|
68
|
+
<button part="toggle" class="icon-button" type="button" aria-haspopup="dialog" aria-controls="panel" aria-expanded="false">${icons.calendar}</button>
|
|
69
|
+
</div>
|
|
70
|
+
<div part="panel" id="panel" class="panel" role="dialog" popover="manual">
|
|
71
|
+
<punica-calendar part="calendar" range></punica-calendar>
|
|
72
|
+
</div>
|
|
73
|
+
`;
|
|
74
|
+
#field = this.$(".field");
|
|
75
|
+
/** @type {{ Start: HTMLInputElement, End: HTMLInputElement }} */
|
|
76
|
+
#inputs = { Start: this.$('[data-edge="Start"]'), End: this.$('[data-edge="End"]') };
|
|
77
|
+
#toggle = this.$('[part="toggle"]');
|
|
78
|
+
#panel = this.$("#panel");
|
|
79
|
+
#calendar = this.$("punica-calendar");
|
|
80
|
+
#surface = new FieldSurface(this, this.#panel);
|
|
81
|
+
/** What each input's text was last written from. */
|
|
82
|
+
#textKeys = { Start: (
|
|
83
|
+
/** @type {string | null} */
|
|
84
|
+
null
|
|
85
|
+
), End: (
|
|
86
|
+
/** @type {string | null} */
|
|
87
|
+
null
|
|
88
|
+
) };
|
|
89
|
+
/** Whether each input holds text that is not a date. */
|
|
90
|
+
#bad = { Start: false, End: false };
|
|
91
|
+
#touched = false;
|
|
92
|
+
#tabbing = false;
|
|
93
|
+
#reason = "api";
|
|
94
|
+
constructor() {
|
|
95
|
+
super();
|
|
96
|
+
customElements.upgrade(this.shadowRoot);
|
|
97
|
+
for (
|
|
98
|
+
const edge of
|
|
99
|
+
/** @type {('Start' | 'End')[]} */
|
|
100
|
+
["Start", "End"]
|
|
101
|
+
) {
|
|
102
|
+
const input = this.#inputs[edge];
|
|
103
|
+
input.addEventListener("change", () => this.#commitText(edge));
|
|
104
|
+
input.addEventListener("keydown", (event) => {
|
|
105
|
+
if (event.key === "Enter") {
|
|
106
|
+
this.#commitText(edge);
|
|
107
|
+
this.update(/* @__PURE__ */ new Map());
|
|
108
|
+
this.form?.requestSubmit();
|
|
109
|
+
} else if (event.key === "ArrowDown" && !this.open) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
this.show();
|
|
112
|
+
} else if (event.key === "Escape" && this.open) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
event.stopPropagation();
|
|
115
|
+
this.#close("escape");
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
this.#toggle.addEventListener("click", () => {
|
|
120
|
+
if (this.open) this.#close("api");
|
|
121
|
+
else this.show();
|
|
122
|
+
});
|
|
123
|
+
const calendar = this.#calendar;
|
|
124
|
+
calendar.addEventListener("punica-input", (event) => {
|
|
125
|
+
event.stopPropagation();
|
|
126
|
+
this.#take(calendar.valueStart, null, "input");
|
|
127
|
+
});
|
|
128
|
+
calendar.addEventListener("punica-change", (event) => {
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
this.#take(calendar.valueStart, calendar.valueEnd, "change");
|
|
131
|
+
this.#close("select");
|
|
132
|
+
this.#inputs.End.focus();
|
|
133
|
+
});
|
|
134
|
+
calendar.addEventListener("punica-select", (event) => event.stopPropagation());
|
|
135
|
+
this.#panel.addEventListener("keydown", (event) => {
|
|
136
|
+
this.#tabbing = event.key === "Tab";
|
|
137
|
+
if (event.key !== "Escape") return;
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
this.#close("escape");
|
|
141
|
+
this.#toggle.focus();
|
|
142
|
+
});
|
|
143
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
144
|
+
const next = (
|
|
145
|
+
/** @type {FocusEvent} */
|
|
146
|
+
event.relatedTarget
|
|
147
|
+
);
|
|
148
|
+
if (next instanceof Node && this.shadowRoot.contains(next)) return;
|
|
149
|
+
this.#touched = true;
|
|
150
|
+
if (this.open && this.#tabbing) this.#close("blur");
|
|
151
|
+
this.#tabbing = false;
|
|
152
|
+
this.requestUpdate();
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/** `start/end` when both dates are set, else null. */
|
|
156
|
+
get value() {
|
|
157
|
+
const start = toIsoDate(parseIsoDate(this.valueStart));
|
|
158
|
+
const end = toIsoDate(parseIsoDate(this.valueEnd));
|
|
159
|
+
return start && end ? `${start}/${end}` : null;
|
|
160
|
+
}
|
|
161
|
+
/** The calendar inside the panel. */
|
|
162
|
+
get calendar() {
|
|
163
|
+
return this.#calendar;
|
|
164
|
+
}
|
|
165
|
+
/** Opens the calendar. */
|
|
166
|
+
show() {
|
|
167
|
+
this.open = true;
|
|
168
|
+
}
|
|
169
|
+
/** Closes the calendar. */
|
|
170
|
+
hide() {
|
|
171
|
+
this.#close("api");
|
|
172
|
+
}
|
|
173
|
+
/** Moves focus to the start input. */
|
|
174
|
+
focus(options) {
|
|
175
|
+
this.#inputs.Start.focus(options);
|
|
176
|
+
}
|
|
177
|
+
connected() {
|
|
178
|
+
if (this.open) this.requestUpdate();
|
|
179
|
+
}
|
|
180
|
+
disconnected() {
|
|
181
|
+
this.#surface.hide();
|
|
182
|
+
}
|
|
183
|
+
formReset() {
|
|
184
|
+
this.#touched = false;
|
|
185
|
+
this.#textKeys = { Start: null, End: null };
|
|
186
|
+
this.valueStart = this.getAttribute("value-start");
|
|
187
|
+
this.valueEnd = this.getAttribute("value-end");
|
|
188
|
+
this.requestUpdate();
|
|
189
|
+
}
|
|
190
|
+
formRestore(state) {
|
|
191
|
+
if (!(state instanceof FormData)) return;
|
|
192
|
+
this.valueStart = /** @type {string | null} */
|
|
193
|
+
state.get(`${this.name}-start`);
|
|
194
|
+
this.valueEnd = /** @type {string | null} */
|
|
195
|
+
state.get(`${this.name}-end`);
|
|
196
|
+
}
|
|
197
|
+
update() {
|
|
198
|
+
const language = fieldLanguage(this);
|
|
199
|
+
const disabled = this.isDisabled;
|
|
200
|
+
const start = parseIsoDate(this.valueStart);
|
|
201
|
+
const end = parseIsoDate(this.valueEnd);
|
|
202
|
+
const dates = { Start: start, End: end };
|
|
203
|
+
const isoStart = toIsoDate(start);
|
|
204
|
+
const isoEnd = toIsoDate(end);
|
|
205
|
+
for (
|
|
206
|
+
const edge of
|
|
207
|
+
/** @type {('Start' | 'End')[]} */
|
|
208
|
+
["Start", "End"]
|
|
209
|
+
) {
|
|
210
|
+
const input = this.#inputs[edge];
|
|
211
|
+
const key = `${toIsoDate(dates[edge])}|${language}`;
|
|
212
|
+
if (key !== this.#textKeys[edge]) {
|
|
213
|
+
this.#textKeys[edge] = key;
|
|
214
|
+
this.#bad[edge] = false;
|
|
215
|
+
input.value = formatFieldDate(language, dates[edge]);
|
|
216
|
+
}
|
|
217
|
+
input.disabled = disabled;
|
|
218
|
+
input.readOnly = this.readonly;
|
|
219
|
+
input.required = this.required;
|
|
220
|
+
input.placeholder = this[`placeholder${edge}`] || "";
|
|
221
|
+
setAttr(input, "aria-label", this[`label${edge}`]);
|
|
222
|
+
}
|
|
223
|
+
setAttr(this.#field, "aria-label", fieldName(this));
|
|
224
|
+
this.#toggle.disabled = disabled || this.readonly;
|
|
225
|
+
setAttr(this.#toggle, "aria-label", this.labelToggle);
|
|
226
|
+
setAttr(this.#panel, "aria-label", this.labelToggle);
|
|
227
|
+
this.toggleState("disabled", disabled);
|
|
228
|
+
const calendar = this.#calendar;
|
|
229
|
+
calendar.valueStart = isoStart;
|
|
230
|
+
calendar.valueEnd = isoEnd;
|
|
231
|
+
calendar.min = this.min;
|
|
232
|
+
calendar.max = this.max;
|
|
233
|
+
calendar.locale = language;
|
|
234
|
+
calendar.disabledDates = this.disabledDates;
|
|
235
|
+
calendar.labelPreviousMonth = this.labelPreviousMonth;
|
|
236
|
+
calendar.labelNextMonth = this.labelNextMonth;
|
|
237
|
+
calendar.labelPreviousYear = this.labelPreviousYear;
|
|
238
|
+
calendar.labelNextYear = this.labelNextYear;
|
|
239
|
+
if (this.name && (isoStart || isoEnd)) {
|
|
240
|
+
const data = new FormData();
|
|
241
|
+
if (isoStart) data.append(`${this.name}-start`, isoStart);
|
|
242
|
+
if (isoEnd) data.append(`${this.name}-end`, isoEnd);
|
|
243
|
+
this.setFormValue(data);
|
|
244
|
+
} else {
|
|
245
|
+
this.setFormValue(null);
|
|
246
|
+
}
|
|
247
|
+
const min = parseIsoDate(this.min);
|
|
248
|
+
const max = parseIsoDate(this.max);
|
|
249
|
+
const { Start: startInput, End: endInput } = this.#inputs;
|
|
250
|
+
if (this.#bad.Start || this.#bad.End) {
|
|
251
|
+
this.setValidity({ badInput: true }, nativeMessage("format"), this.#bad.Start ? startInput : endInput);
|
|
252
|
+
} else if (this.required && (!start || !end)) {
|
|
253
|
+
this.setValidity({ valueMissing: true }, nativeMessage("required"), start ? endInput : startInput);
|
|
254
|
+
} else if (start && end && compareDates(end, start) < 0) {
|
|
255
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { value: isoEnd, limit: isoStart }), endInput);
|
|
256
|
+
} else if (min && start && compareDates(start, min) < 0) {
|
|
257
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { value: isoStart, limit: this.min }), startInput);
|
|
258
|
+
} else if (min && end && compareDates(end, min) < 0) {
|
|
259
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { value: isoEnd, limit: this.min }), endInput);
|
|
260
|
+
} else if (max && end && compareDates(end, max) > 0) {
|
|
261
|
+
this.setValidity({ rangeOverflow: true }, nativeMessage("max", { value: isoEnd, limit: this.max }), endInput);
|
|
262
|
+
} else if (max && start && compareDates(start, max) > 0) {
|
|
263
|
+
this.setValidity({ rangeOverflow: true }, nativeMessage("max", { value: isoStart, limit: this.max }), startInput);
|
|
264
|
+
} else {
|
|
265
|
+
this.setValidity({});
|
|
266
|
+
}
|
|
267
|
+
const invalid = this.#touched && !this.validity.valid;
|
|
268
|
+
setAttr(startInput, "aria-invalid", invalid ? "true" : null);
|
|
269
|
+
setAttr(endInput, "aria-invalid", invalid ? "true" : null);
|
|
270
|
+
this.toggleState("user-invalid", invalid);
|
|
271
|
+
const want = this.open && !disabled && !this.readonly;
|
|
272
|
+
if (want && !this.#surface.open) {
|
|
273
|
+
this.#surface.show(this.#field, {}, () => this.#close("outside"));
|
|
274
|
+
calendar.showDate(isoStart || toIsoDate(todayDate()));
|
|
275
|
+
this.toggleState("open", true);
|
|
276
|
+
this.#toggle.setAttribute("aria-expanded", "true");
|
|
277
|
+
calendar.focus({ preventScroll: true });
|
|
278
|
+
this.emit("open");
|
|
279
|
+
} else if (!want && this.#surface.open) {
|
|
280
|
+
this.#surface.hide();
|
|
281
|
+
this.toggleState("open", false);
|
|
282
|
+
this.#toggle.setAttribute("aria-expanded", "false");
|
|
283
|
+
const reason = this.#reason;
|
|
284
|
+
this.#reason = "api";
|
|
285
|
+
this.emit("close", { reason });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** @param {string} reason */
|
|
289
|
+
#close(reason) {
|
|
290
|
+
if (!this.open) return;
|
|
291
|
+
this.#reason = reason;
|
|
292
|
+
this.open = false;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Takes a start and an end and tells the page when they changed.
|
|
296
|
+
* @param {string | null} start
|
|
297
|
+
* @param {string | null} end
|
|
298
|
+
* @param {'input' | 'change'} event
|
|
299
|
+
*/
|
|
300
|
+
#take(start, end, event) {
|
|
301
|
+
const before = `${toIsoDate(parseIsoDate(this.valueStart))}/${toIsoDate(parseIsoDate(this.valueEnd))}`;
|
|
302
|
+
this.#touched = true;
|
|
303
|
+
this.#bad = { Start: false, End: false };
|
|
304
|
+
this.#textKeys = { Start: null, End: null };
|
|
305
|
+
this.valueStart = start;
|
|
306
|
+
this.valueEnd = end;
|
|
307
|
+
this.requestUpdate();
|
|
308
|
+
if (before === `${start}/${end}`) return;
|
|
309
|
+
this.emit(event, { value: this.value, valueStart: start, valueEnd: end });
|
|
310
|
+
}
|
|
311
|
+
/** Takes what was typed into one of the inputs. @param {'Start' | 'End'} edge */
|
|
312
|
+
#commitText(edge) {
|
|
313
|
+
if (this.isDisabled || this.readonly) return;
|
|
314
|
+
const language = fieldLanguage(this);
|
|
315
|
+
const text = this.#inputs[edge].value.trim();
|
|
316
|
+
const date = text ? parseFieldDate(text, language) : null;
|
|
317
|
+
const other = edge === "Start" ? "End" : "Start";
|
|
318
|
+
const kept = toIsoDate(parseIsoDate(this[`value${other}`]));
|
|
319
|
+
const otherBad = this.#bad[other];
|
|
320
|
+
const otherKey = this.#textKeys[other];
|
|
321
|
+
const pair = (iso) => edge === "Start" ? [iso, kept] : [kept, iso];
|
|
322
|
+
if (text && !date) {
|
|
323
|
+
this.#take(...pair(null), "change");
|
|
324
|
+
this.#bad[edge] = true;
|
|
325
|
+
this.#textKeys[edge] = `null|${language}`;
|
|
326
|
+
} else {
|
|
327
|
+
this.#take(...pair(toIsoDate(date)), "change");
|
|
328
|
+
}
|
|
329
|
+
this.#bad[other] = otherBad;
|
|
330
|
+
if (otherBad) this.#textKeys[other] = otherKey;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
define("punica-date-range-input", PunicaDateRangeInput);
|
|
334
|
+
|
|
335
|
+
export {
|
|
336
|
+
PunicaDateRangeInput
|
|
337
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/metadataList/metadataListItem.css
|
|
10
|
+
var metadataListItem_default = ":host {\n --punica-metadata-list-item-label-color: var(--_metadata-label-color, var(--punica-color-text-muted));\n\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n row-gap: var(--punica-space-2);\n column-gap: var(--punica-space-16);\n position: relative;\n font-family: var(--punica-font-family);\n font-size: var(--_metadata-font-size, var(--punica-font-size-sm));\n line-height: var(--punica-line-height);\n}\n\n.label {\n min-inline-size: 0;\n color: var(--punica-metadata-list-item-label-color);\n font-weight: var(--punica-font-weight-medium);\n overflow-wrap: anywhere;\n}\n\n::slotted([slot='label']) {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-4);\n}\n\n.value {\n display: flex;\n align-items: baseline;\n gap: var(--punica-space-4);\n min-inline-size: 0;\n color: var(--punica-color-text);\n}\n\n.content {\n min-inline-size: 0;\n overflow-wrap: anywhere;\n}\n\n.copy {\n all: unset;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n inline-size: var(--punica-space-24);\n block-size: var(--punica-space-24);\n margin-block: calc(-1 * var(--punica-space-4));\n align-self: center;\n border-radius: var(--punica-radius-sm);\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-sm);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease),\n color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.copy[hidden] {\n display: none;\n}\n\n.copy:hover {\n background: var(--punica-color-hover);\n color: var(--punica-color-text);\n}\n\n.copy:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: 0;\n}\n\n.when-idle,\n.when-copied {\n display: inline-flex;\n}\n.when-copied,\n:host(:state(copied)) .when-idle {\n display: none;\n}\n:host(:state(copied)) .when-copied {\n display: inline-flex;\n color: var(--punica-color-success);\n}\n\n.status {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@media (forced-colors: active) {\n .copy {\n border: var(--punica-border-width) solid ButtonText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/metadataList/metadataListItem.js
|
|
13
|
+
var PunicaMetadataListItem = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
label: {},
|
|
16
|
+
copyable: { type: Boolean },
|
|
17
|
+
copyValue: {},
|
|
18
|
+
labelCopy: { default: "Copy" },
|
|
19
|
+
labelCopied: { default: "Copied" }
|
|
20
|
+
};
|
|
21
|
+
static styles = metadataListItem_default;
|
|
22
|
+
static template = `
|
|
23
|
+
<span part="label" class="label" role="term" id="term"><slot name="label"><span class="label-text"></span></slot></span>
|
|
24
|
+
<span part="value" class="value" role="definition">
|
|
25
|
+
<span class="content"><slot></slot></span>
|
|
26
|
+
<button part="copy-button" class="copy" type="button" aria-describedby="term" hidden>
|
|
27
|
+
<span class="when-idle">${icons.copy}</span>
|
|
28
|
+
<span class="when-copied">${icons.check}</span>
|
|
29
|
+
</button>
|
|
30
|
+
</span>
|
|
31
|
+
<span part="status" class="status" role="status" hidden></span>
|
|
32
|
+
`;
|
|
33
|
+
#labelText = this.$(".label-text");
|
|
34
|
+
#copy = this.$(".copy");
|
|
35
|
+
#status = this.$(".status");
|
|
36
|
+
#content = this.$("slot:not([name])");
|
|
37
|
+
#timer = 0;
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
this.#copy.addEventListener("click", () => this.copy());
|
|
41
|
+
}
|
|
42
|
+
/** The text the copy button copies. */
|
|
43
|
+
get text() {
|
|
44
|
+
if (this.copyValue != null) return this.copyValue;
|
|
45
|
+
return this.#content.assignedNodes({ flatten: true }).map((n) => n.textContent).join("").replace(/\s+/g, " ").trim();
|
|
46
|
+
}
|
|
47
|
+
disconnected() {
|
|
48
|
+
this.#clear();
|
|
49
|
+
}
|
|
50
|
+
update() {
|
|
51
|
+
this.internals.role = "listitem";
|
|
52
|
+
this.#labelText.textContent = this.label ?? "";
|
|
53
|
+
this.#copy.hidden = !this.copyable;
|
|
54
|
+
this.#status.hidden = !this.copyable;
|
|
55
|
+
this.#copy.setAttribute("aria-label", this.labelCopy ?? "");
|
|
56
|
+
this.#copy.title = this.labelCopy ?? "";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Copies the value to the clipboard and announces it.
|
|
60
|
+
* @returns {Promise<boolean>} whether the clipboard took it
|
|
61
|
+
*/
|
|
62
|
+
async copy() {
|
|
63
|
+
try {
|
|
64
|
+
await navigator.clipboard.writeText(this.text);
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (!this.isConnected) return true;
|
|
69
|
+
clearTimeout(this.#timer);
|
|
70
|
+
this.toggleState("copied", true);
|
|
71
|
+
this.#status.textContent = this.labelCopied ?? "";
|
|
72
|
+
this.#timer = setTimeout(() => this.#clear(), 2e3);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
#clear() {
|
|
76
|
+
clearTimeout(this.#timer);
|
|
77
|
+
this.#timer = 0;
|
|
78
|
+
this.toggleState("copied", false);
|
|
79
|
+
this.#status.textContent = "";
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
define("punica-metadata-list-item", PunicaMetadataListItem);
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
PunicaMetadataListItem
|
|
86
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTypeahead,
|
|
3
|
+
isRtl,
|
|
4
|
+
nextIndex
|
|
5
|
+
} from "./chunk-4RURT4SK.js";
|
|
6
|
+
import {
|
|
7
|
+
PunicaElement,
|
|
8
|
+
define
|
|
9
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
10
|
+
|
|
11
|
+
// src/components/tree/tree.css
|
|
12
|
+
var tree_default = ":host {\n --punica-tree-indent: var(--punica-space-20);\n\n display: block;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n::slotted(punica-tree-item) {\n --punica-tree-item-indent: var(--punica-tree-indent);\n}\n";
|
|
13
|
+
|
|
14
|
+
// src/components/tree/tree.js
|
|
15
|
+
var ITEM = "punica-tree-item";
|
|
16
|
+
var childItems = (el) => (
|
|
17
|
+
/** @type {any[]} */
|
|
18
|
+
[...el.children].filter((child) => child.localName === ITEM)
|
|
19
|
+
);
|
|
20
|
+
var isBranch = (item) => item.hasAttribute("lazy") || childItems(item).length > 0;
|
|
21
|
+
var isOpen = (item) => item.hasAttribute("expanded");
|
|
22
|
+
var isDisabled = (item) => item.hasAttribute("disabled");
|
|
23
|
+
var PunicaTree = class extends PunicaElement {
|
|
24
|
+
static properties = {
|
|
25
|
+
selection: { default: "none" },
|
|
26
|
+
label: {}
|
|
27
|
+
};
|
|
28
|
+
static styles = tree_default;
|
|
29
|
+
static template = `<slot></slot>`;
|
|
30
|
+
#typeahead = createTypeahead();
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
this.internals.role = "tree";
|
|
34
|
+
this.$("slot").addEventListener("slotchange", () => {
|
|
35
|
+
this.requestUpdate();
|
|
36
|
+
for (const item of childItems(this)) item.requestUpdate?.();
|
|
37
|
+
});
|
|
38
|
+
this.addEventListener("click", (event) => this.#onClick(event));
|
|
39
|
+
this.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
40
|
+
this.addEventListener("focusin", (event) => {
|
|
41
|
+
const item = (
|
|
42
|
+
/** @type {Element} */
|
|
43
|
+
event.target
|
|
44
|
+
);
|
|
45
|
+
if (item.localName === ITEM) this.#rove(item);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Every item of the tree, in document order. */
|
|
49
|
+
get items() {
|
|
50
|
+
return (
|
|
51
|
+
/** @type {any[]} */
|
|
52
|
+
[...this.querySelectorAll(ITEM)]
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
/** The selected items, in document order. */
|
|
56
|
+
get selectedItems() {
|
|
57
|
+
return this.items.filter((item) => item.hasAttribute("selected"));
|
|
58
|
+
}
|
|
59
|
+
/** The items not hidden inside a collapsed branch, in order. */
|
|
60
|
+
get visibleItems() {
|
|
61
|
+
const out = [];
|
|
62
|
+
const walk = (parent) => {
|
|
63
|
+
for (const item of childItems(parent)) {
|
|
64
|
+
out.push(item);
|
|
65
|
+
if (isOpen(item)) walk(item);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
walk(this);
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/** Expands every branch. Fires nothing. */
|
|
72
|
+
expandAll() {
|
|
73
|
+
for (const item of this.items) if (isBranch(item) && !item.hasAttribute("lazy")) item.expanded = true;
|
|
74
|
+
}
|
|
75
|
+
/** Collapses every branch. Fires nothing. */
|
|
76
|
+
collapseAll() {
|
|
77
|
+
for (const item of this.items) item.expanded = false;
|
|
78
|
+
}
|
|
79
|
+
connected() {
|
|
80
|
+
this.requestUpdate();
|
|
81
|
+
}
|
|
82
|
+
#enabled() {
|
|
83
|
+
return this.visibleItems.filter((item) => !isDisabled(item));
|
|
84
|
+
}
|
|
85
|
+
#rove(active) {
|
|
86
|
+
for (const item of this.items) item.tabIndex = item === active ? 0 : -1;
|
|
87
|
+
}
|
|
88
|
+
#focus(item) {
|
|
89
|
+
this.#rove(item);
|
|
90
|
+
item.focus();
|
|
91
|
+
}
|
|
92
|
+
#valueOf(item) {
|
|
93
|
+
return item.value ?? item.getAttribute("value") ?? this.#labelOf(item);
|
|
94
|
+
}
|
|
95
|
+
#labelOf(item) {
|
|
96
|
+
return (item.getAttribute("label") ?? item.querySelector(':scope > [slot="label"]')?.textContent ?? "").trim();
|
|
97
|
+
}
|
|
98
|
+
#toggle(item, open = !isOpen(item)) {
|
|
99
|
+
if (!isBranch(item) || open === isOpen(item)) return;
|
|
100
|
+
item.expanded = open;
|
|
101
|
+
item.emit?.("toggle", { open, item });
|
|
102
|
+
}
|
|
103
|
+
#select(item) {
|
|
104
|
+
if (this.selection === "multiple") {
|
|
105
|
+
item.selected = !item.hasAttribute("selected");
|
|
106
|
+
} else if (this.selection === "single") {
|
|
107
|
+
if (item.hasAttribute("selected")) return;
|
|
108
|
+
for (const other of this.items) other.selected = other === item;
|
|
109
|
+
} else {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.emit("select", { value: this.#valueOf(item), item });
|
|
113
|
+
}
|
|
114
|
+
/** @param {MouseEvent} event */
|
|
115
|
+
#onClick(event) {
|
|
116
|
+
const path = event.composedPath();
|
|
117
|
+
const row = (
|
|
118
|
+
/** @type {any} */
|
|
119
|
+
path.find((node) => (
|
|
120
|
+
/** @type {any} */
|
|
121
|
+
node.classList?.contains("row")
|
|
122
|
+
))
|
|
123
|
+
);
|
|
124
|
+
const item = row?.getRootNode().host;
|
|
125
|
+
if (!item || item.localName !== ITEM || !this.contains(item) || isDisabled(item)) return;
|
|
126
|
+
this.#focus(item);
|
|
127
|
+
const onToggle = path.some((node) => (
|
|
128
|
+
/** @type {any} */
|
|
129
|
+
node.classList?.contains("toggle")
|
|
130
|
+
));
|
|
131
|
+
if (!onToggle) this.#select(item);
|
|
132
|
+
this.#toggle(item);
|
|
133
|
+
}
|
|
134
|
+
/** @param {KeyboardEvent} event */
|
|
135
|
+
#onKeydown(event) {
|
|
136
|
+
const item = (
|
|
137
|
+
/** @type {any} */
|
|
138
|
+
event.target
|
|
139
|
+
);
|
|
140
|
+
if (item.localName !== ITEM || event.defaultPrevented) return;
|
|
141
|
+
const enabled = this.#enabled();
|
|
142
|
+
const current = enabled.indexOf(item);
|
|
143
|
+
const rtl = isRtl(this);
|
|
144
|
+
const key = event.key;
|
|
145
|
+
const opens = key === (rtl ? "ArrowLeft" : "ArrowRight");
|
|
146
|
+
const closes = key === (rtl ? "ArrowRight" : "ArrowLeft");
|
|
147
|
+
if (opens || closes) {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
if (opens) {
|
|
150
|
+
if (isBranch(item) && !isOpen(item)) this.#toggle(item, true);
|
|
151
|
+
else if (isBranch(item)) {
|
|
152
|
+
const child = childItems(item).find((el) => !isDisabled(el));
|
|
153
|
+
if (child) this.#focus(child);
|
|
154
|
+
}
|
|
155
|
+
} else if (isBranch(item) && isOpen(item)) {
|
|
156
|
+
this.#toggle(item, false);
|
|
157
|
+
} else {
|
|
158
|
+
const parent = item.parentElement?.closest(ITEM);
|
|
159
|
+
if (parent && this.contains(parent)) this.#focus(parent);
|
|
160
|
+
}
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (key === "*") {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
for (const sibling of childItems(item.parentElement)) {
|
|
166
|
+
if (!isDisabled(sibling)) this.#toggle(sibling, true);
|
|
167
|
+
}
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (key === "Enter" || key === " ") {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
if (isDisabled(item)) return;
|
|
173
|
+
if (this.selection === "none") this.#toggle(item);
|
|
174
|
+
else this.#select(item);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
let index = nextIndex(event, enabled.length, current, { orientation: "vertical", loop: false });
|
|
178
|
+
if (index < 0) {
|
|
179
|
+
index = this.#typeahead(
|
|
180
|
+
event,
|
|
181
|
+
enabled.map((el) => this.#labelOf(el)),
|
|
182
|
+
current
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
if (index >= 0) {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
this.#focus(enabled[index]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
update(changed) {
|
|
191
|
+
this.internals.ariaLabel = this.label || null;
|
|
192
|
+
this.internals.ariaMultiSelectable = this.selection === "multiple" ? "true" : null;
|
|
193
|
+
const items = this.items;
|
|
194
|
+
if (changed.has("selection")) {
|
|
195
|
+
if (this.selection !== "multiple") {
|
|
196
|
+
const keep = this.selection === "single" ? this.selectedItems[0] : null;
|
|
197
|
+
for (const item of items) if (item !== keep && item.hasAttribute("selected")) item.selected = false;
|
|
198
|
+
}
|
|
199
|
+
for (const item of items) item.requestUpdate?.();
|
|
200
|
+
}
|
|
201
|
+
const enabled = this.#enabled();
|
|
202
|
+
let active = enabled.find((item) => item.matches(":focus")) || items.find((item) => item.getAttribute("tabindex") === "0") || enabled.find((item) => item.hasAttribute("selected")) || null;
|
|
203
|
+
while (active && !enabled.includes(active)) active = active.parentElement?.closest(ITEM) || null;
|
|
204
|
+
this.#rove(active && this.contains(active) ? active : enabled[0]);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
define("punica-tree", PunicaTree);
|
|
208
|
+
|
|
209
|
+
export {
|
|
210
|
+
PunicaTree
|
|
211
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/dialog/dialogFooter.css
|
|
7
|
+
var dialogFooter_default = ":host {\n --punica-dialog-footer-gap: var(--punica-space-8);\n\n display: flex;\n grid-area: footer;\n flex-wrap: wrap;\n gap: var(--punica-dialog-footer-gap);\n justify-content: flex-end;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/dialog/dialogFooter.js
|
|
10
|
+
var PunicaDialogFooter = class extends PunicaElement {
|
|
11
|
+
static styles = dialogFooter_default;
|
|
12
|
+
static template = `<slot></slot>`;
|
|
13
|
+
};
|
|
14
|
+
define("punica-dialog-footer", PunicaDialogFooter);
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
PunicaDialogFooter
|
|
18
|
+
};
|