@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,128 @@
|
|
|
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/selectableCard/selectableCard.css
|
|
13
|
+
var selectableCard_default = ":host {\n --_accent: var(--punica-color-primary);\n --punica-selectable-card-padding: var(--punica-space-16);\n --punica-selectable-card-radius: var(--punica-radius-lg);\n --punica-selectable-card-background: var(--punica-color-surface);\n --punica-selectable-card-border-color: var(--punica-color-border);\n --punica-selectable-card-checked-color: var(--_accent);\n --punica-selectable-card-checked-background: color-mix(in srgb, var(--punica-selectable-card-checked-color) 6%, var(--punica-selectable-card-background));\n\n display: block;\n position: relative;\n border-radius: var(--punica-selectable-card-radius);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n cursor: pointer;\n user-select: none;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.base {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-8);\n block-size: 100%;\n padding: var(--punica-selectable-card-padding);\n padding-inline-end: calc(var(--punica-selectable-card-padding) + var(--punica-space-24));\n border: var(--punica-border-width) solid var(--punica-selectable-card-border-color);\n border-radius: inherit;\n background: var(--punica-selectable-card-background);\n transition: border-color var(--punica-duration-fast) var(--punica-ease),\n background-color var(--punica-duration-fast) var(--punica-ease),\n box-shadow var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:hover) .base {\n border-color: var(--punica-color-border-strong);\n}\n\n:host(:state(checked)) .base {\n border-color: var(--punica-selectable-card-checked-color);\n background: var(--punica-selectable-card-checked-background);\n box-shadow: inset 0 0 0 var(--punica-border-width) var(--punica-selectable-card-checked-color);\n}\n\n:host(:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n.media {\n display: flex;\n margin: calc(-1 * var(--punica-selectable-card-padding));\n margin-block-end: 0;\n margin-inline-end: calc(-1 * (var(--punica-selectable-card-padding) + var(--punica-space-24)));\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n overflow: hidden;\n}\n.media ::slotted(img) {\n display: block;\n inline-size: 100%;\n block-size: auto;\n object-fit: cover;\n}\n\n.body {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-4);\n min-inline-size: 0;\n}\n\n.title {\n font-size: var(--punica-font-size);\n font-weight: var(--punica-font-weight-semi-bold);\n}\n\n.description {\n color: var(--punica-color-text-muted);\n}\n\n[hidden] {\n display: none !important;\n}\n\n.indicator {\n position: absolute;\n inset-block-start: var(--punica-selectable-card-padding);\n inset-inline-end: var(--punica-selectable-card-padding);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-18);\n block-size: var(--punica-space-18);\n border: var(--punica-border-width) solid var(--punica-color-border-strong);\n border-radius: var(--punica-radius-sm);\n background: var(--punica-color-surface);\n color: var(--punica-color-on-accent);\n font-size: var(--punica-font-size-sm);\n}\n.indicator .icon {\n visibility: hidden;\n stroke-width: 3;\n}\n:host(:state(checked)) .indicator {\n border-color: var(--punica-selectable-card-checked-color);\n background: var(--punica-selectable-card-checked-color);\n}\n:host(:state(checked)) .indicator .icon {\n visibility: visible;\n}\n\n/* A radio card draws a circle with a dot. */\n:host(:state(radio)) .indicator {\n border-radius: var(--punica-radius-full);\n}\n:host(:state(radio)) .indicator .icon {\n display: none;\n}\n:host(:state(radio)) .indicator::after {\n content: '';\n inline-size: 50%;\n block-size: 50%;\n border-radius: var(--punica-radius-full);\n background: var(--punica-selectable-card-checked-color);\n transform: scale(0);\n transition: transform var(--punica-duration-fast) var(--punica-ease);\n}\n:host(:state(radio):state(checked)) .indicator {\n background: var(--punica-color-surface);\n}\n:host(:state(radio):state(checked)) .indicator::after {\n transform: scale(1);\n}\n\n:host(:state(disabled)) {\n cursor: default;\n}\n:host(:state(disabled)) .base {\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .base,\n .indicator {\n border-color: CanvasText;\n }\n :host(:state(checked)) .base,\n :host(:state(checked)) .indicator {\n border-color: Highlight;\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(-2 * var(--punica-border-width));\n }\n :host(:state(checked)) .indicator {\n background: Highlight;\n color: HighlightText;\n }\n :host(:state(radio):state(checked)) .indicator::after {\n background: Highlight;\n }\n :host(:focus-visible) {\n outline-color: Highlight;\n }\n :host(:state(disabled)) .base {\n opacity: 1;\n color: GrayText;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/selectableCard/selectableCard.js
|
|
16
|
+
var missingMessage = () => {
|
|
17
|
+
const probe = document.createElement("input");
|
|
18
|
+
probe.type = "checkbox";
|
|
19
|
+
probe.required = true;
|
|
20
|
+
return probe.validationMessage || " ";
|
|
21
|
+
};
|
|
22
|
+
var INTERACTIVE = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
23
|
+
var PunicaSelectableCard = class extends FormControl(PunicaElement) {
|
|
24
|
+
static properties = {
|
|
25
|
+
type: {},
|
|
26
|
+
value: {},
|
|
27
|
+
checked: { type: Boolean },
|
|
28
|
+
label: {}
|
|
29
|
+
};
|
|
30
|
+
static styles = selectableCard_default;
|
|
31
|
+
static template = `
|
|
32
|
+
<div part="base" class="base">
|
|
33
|
+
<div part="media" class="media" hidden><slot name="media"></slot></div>
|
|
34
|
+
<div class="body">
|
|
35
|
+
<div part="title" class="title"><slot name="title"></slot></div>
|
|
36
|
+
<div part="description" class="description"><slot name="description"></slot></div>
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>
|
|
39
|
+
<span part="indicator" class="indicator" aria-hidden="true">${icons.check}</span>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
#default = false;
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
for (const slot of this.shadowRoot.querySelectorAll("slot")) {
|
|
46
|
+
slot.addEventListener("slotchange", () => this.requestUpdate());
|
|
47
|
+
}
|
|
48
|
+
this.addEventListener("click", (event) => this.#onClick(event));
|
|
49
|
+
this.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
50
|
+
}
|
|
51
|
+
/** The group the card belongs to, if any. @returns {any} */
|
|
52
|
+
get group() {
|
|
53
|
+
return this.closest("punica-selectable-card-group");
|
|
54
|
+
}
|
|
55
|
+
/** Whether the card is a radio: in a group, or `type="radio"`. */
|
|
56
|
+
get isRadio() {
|
|
57
|
+
return !!this.group || this.type === "radio";
|
|
58
|
+
}
|
|
59
|
+
update() {
|
|
60
|
+
const radio = this.isRadio;
|
|
61
|
+
const group = this.group;
|
|
62
|
+
const off = this.isDisabled || !!group?.isDisabled;
|
|
63
|
+
const internals = this.internals;
|
|
64
|
+
internals.role = radio ? "radio" : "checkbox";
|
|
65
|
+
internals.ariaChecked = String(this.checked);
|
|
66
|
+
internals.ariaDisabled = off ? "true" : null;
|
|
67
|
+
internals.ariaRequired = !radio && this.required ? "true" : null;
|
|
68
|
+
internals.ariaLabel = this.label || null;
|
|
69
|
+
const titles = this.$('slot[name="title"]').assignedElements();
|
|
70
|
+
const descriptions = this.$('slot[name="description"]').assignedElements();
|
|
71
|
+
if ("ariaLabelledByElements" in internals) {
|
|
72
|
+
internals.ariaLabelledByElements = !this.label && titles.length ? titles : null;
|
|
73
|
+
internals.ariaDescribedByElements = descriptions.length ? descriptions : null;
|
|
74
|
+
}
|
|
75
|
+
this.$(".media").hidden = !this.$('slot[name="media"]').assignedNodes().length;
|
|
76
|
+
this.$(".title").hidden = !titles.length;
|
|
77
|
+
this.$(".description").hidden = !descriptions.length;
|
|
78
|
+
if (!group) {
|
|
79
|
+
if (radio || off) this.removeAttribute("tabindex");
|
|
80
|
+
else if (!this.hasAttribute("tabindex")) this.tabIndex = 0;
|
|
81
|
+
}
|
|
82
|
+
this.toggleState("checked", this.checked);
|
|
83
|
+
this.toggleState("radio", radio);
|
|
84
|
+
this.toggleState("disabled", off);
|
|
85
|
+
if (radio) {
|
|
86
|
+
this.setFormValue(null);
|
|
87
|
+
this.setValidity({});
|
|
88
|
+
} else {
|
|
89
|
+
this.setFormValue(this.checked ? this.value ?? "on" : null, String(this.checked));
|
|
90
|
+
const missing = this.required && !this.checked;
|
|
91
|
+
this.setValidity(missing ? { valueMissing: true } : {}, missing ? missingMessage() : "");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
firstUpdated() {
|
|
95
|
+
this.#default = this.checked;
|
|
96
|
+
}
|
|
97
|
+
formReset() {
|
|
98
|
+
if (!this.isRadio) this.checked = this.#default;
|
|
99
|
+
}
|
|
100
|
+
formRestore(state) {
|
|
101
|
+
if (!this.isRadio) this.checked = state === "true";
|
|
102
|
+
}
|
|
103
|
+
/** Toggles a checkbox card the way a user would, firing `punica-change`; chooses a radio card through its group. */
|
|
104
|
+
click() {
|
|
105
|
+
super.click();
|
|
106
|
+
}
|
|
107
|
+
#onClick(event) {
|
|
108
|
+
if (this.isRadio) return;
|
|
109
|
+
if (this.isDisabled) return;
|
|
110
|
+
const inner = event.composedPath().find((node) => node instanceof Element && node !== this && node.matches?.(INTERACTIVE));
|
|
111
|
+
if (inner && this.contains(inner)) return;
|
|
112
|
+
this.checked = !this.checked;
|
|
113
|
+
this.update(/* @__PURE__ */ new Map());
|
|
114
|
+
this.emit("change", { checked: this.checked, value: this.value ?? "on" });
|
|
115
|
+
}
|
|
116
|
+
#onKeydown(event) {
|
|
117
|
+
if (event.target !== this || this.isDisabled || this.group?.isDisabled) return;
|
|
118
|
+
if (event.key === "Enter" || event.key === " " && !this.isRadio) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
if (!event.repeat) this.click();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
define("punica-selectable-card", PunicaSelectableCard);
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
PunicaSelectableCard
|
|
128
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/card/card.css
|
|
7
|
+
var card_default = ":host {\n --punica-card-radius: var(--punica-radius);\n /* Raised, so an elevated card still stands off a surface in dark mode. */\n --punica-card-background: var(--punica-color-surface-raised);\n --punica-card-shadow: var(--punica-shadow-sm);\n --punica-card-border-color: transparent;\n\n display: block;\n}\n\n:host([variant='outlined']) {\n --punica-card-background: var(--punica-color-surface);\n --punica-card-shadow: none;\n --punica-card-border-color: var(--punica-color-border);\n}\n:host([variant='filled']) {\n --punica-card-shadow: none;\n --punica-card-background: var(--punica-color-neutral-light);\n}\n\n.base {\n all: unset;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n inline-size: 100%;\n block-size: 100%;\n border: var(--punica-border-width) solid var(--punica-card-border-color);\n border-radius: var(--punica-card-radius);\n background: var(--punica-card-background);\n box-shadow: var(--punica-card-shadow);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n text-align: start;\n overflow: hidden;\n transition: box-shadow var(--punica-duration) var(--punica-ease),\n border-color var(--punica-duration) var(--punica-ease);\n}\n\na.base,\nbutton.base {\n cursor: pointer;\n}\na.base:hover,\nbutton.base:not(:disabled):hover {\n box-shadow: var(--punica-shadow-md);\n}\n:host([variant='outlined']) a.base:hover,\n:host([variant='outlined']) button.base:not(:disabled):hover,\n:host([variant='filled']) a.base:hover,\n:host([variant='filled']) button.base:not(:disabled):hover {\n border-color: var(--punica-color-border-strong);\n box-shadow: none;\n}\n\n.base:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton.base:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .base {\n border-color: CanvasText;\n }\n button.base:disabled {\n border-color: GrayText;\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/card/card.js
|
|
10
|
+
var SCRIPT_SCHEME = /^(javascript|vbscript):$/i;
|
|
11
|
+
function set(el, name, value) {
|
|
12
|
+
if (value == null) el.removeAttribute(name);
|
|
13
|
+
else el.setAttribute(name, value);
|
|
14
|
+
}
|
|
15
|
+
var PunicaCard = class extends PunicaElement {
|
|
16
|
+
static properties = {
|
|
17
|
+
variant: {},
|
|
18
|
+
href: {},
|
|
19
|
+
target: {},
|
|
20
|
+
rel: {},
|
|
21
|
+
label: {},
|
|
22
|
+
interactive: { type: Boolean },
|
|
23
|
+
disabled: { type: Boolean }
|
|
24
|
+
};
|
|
25
|
+
static styles = card_default;
|
|
26
|
+
static template = `<div part="base" class="base"><slot></slot></div>`;
|
|
27
|
+
#base = this.$(".base");
|
|
28
|
+
update() {
|
|
29
|
+
const href = this.interactive && !this.disabled ? this.#safeHref() : null;
|
|
30
|
+
const tag = !this.interactive ? "div" : href != null ? "a" : "button";
|
|
31
|
+
if (this.#base.localName !== tag) {
|
|
32
|
+
const next = document.createElement(tag);
|
|
33
|
+
next.className = "base";
|
|
34
|
+
next.part.add("base");
|
|
35
|
+
next.append(...this.#base.childNodes);
|
|
36
|
+
this.#base.replaceWith(next);
|
|
37
|
+
this.#base = next;
|
|
38
|
+
}
|
|
39
|
+
const base = this.#base;
|
|
40
|
+
if (tag === "a") {
|
|
41
|
+
set(base, "href", href);
|
|
42
|
+
set(base, "target", this.target);
|
|
43
|
+
set(base, "rel", this.#rel());
|
|
44
|
+
} else if (tag === "button") {
|
|
45
|
+
base.type = "button";
|
|
46
|
+
base.disabled = this.disabled;
|
|
47
|
+
}
|
|
48
|
+
set(base, "aria-label", this.interactive ? this.label : null);
|
|
49
|
+
}
|
|
50
|
+
/** Moves focus to an interactive card. */
|
|
51
|
+
focus(options) {
|
|
52
|
+
if (this.interactive) this.#base.focus(options);
|
|
53
|
+
}
|
|
54
|
+
/** Activates an interactive card the way a click would. */
|
|
55
|
+
click() {
|
|
56
|
+
if (this.interactive) this.#base.click();
|
|
57
|
+
else super.click();
|
|
58
|
+
}
|
|
59
|
+
#safeHref() {
|
|
60
|
+
const href = this.href;
|
|
61
|
+
if (href == null) return null;
|
|
62
|
+
try {
|
|
63
|
+
if (SCRIPT_SCHEME.test(new URL(href, document.baseURI).protocol)) return null;
|
|
64
|
+
} catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return href;
|
|
68
|
+
}
|
|
69
|
+
#rel() {
|
|
70
|
+
const types = (this.rel ?? "").split(/\s+/).filter(Boolean);
|
|
71
|
+
if (this.target?.toLowerCase() === "_blank" && !types.some((t) => t.toLowerCase() === "noopener")) {
|
|
72
|
+
types.push("noopener");
|
|
73
|
+
}
|
|
74
|
+
return types.length ? types.join(" ") : null;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
define("punica-card", PunicaCard);
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
PunicaCard
|
|
81
|
+
};
|
|
@@ -0,0 +1,271 @@
|
|
|
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/datePicker/datePicker.css
|
|
34
|
+
var datePicker_default = ":host {\n --punica-date-picker-radius: var(--punica-radius);\n --punica-date-picker-height: var(--punica-size-md);\n --punica-date-picker-padding: var(--punica-space-12);\n --punica-date-picker-border-color: var(--punica-color-border);\n --punica-date-picker-background: transparent;\n --punica-date-picker-min-width: 250px;\n --punica-date-picker-panel-padding: var(--punica-space-12);\n\n --_height: var(--punica-date-picker-height);\n --_pad: var(--punica-date-picker-padding);\n --_radius: var(--punica-date-picker-radius);\n --_border: var(--punica-date-picker-border-color);\n --_bg: var(--punica-date-picker-background);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-date-picker-min-width);\n}\n\n:host([size='small']) {\n --punica-date-picker-height: var(--punica-size-sm);\n --punica-date-picker-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-date-picker-height: var(--punica-size-lg);\n --punica-date-picker-padding: var(--punica-space-16);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n[part='panel'] {\n padding: var(--punica-date-picker-panel-padding);\n}\n";
|
|
35
|
+
|
|
36
|
+
// src/components/datePicker/datePicker.js
|
|
37
|
+
var PunicaDatePicker = class extends FormControl(PunicaElement) {
|
|
38
|
+
static properties = {
|
|
39
|
+
value: { reflect: false },
|
|
40
|
+
min: {},
|
|
41
|
+
max: {},
|
|
42
|
+
locale: {},
|
|
43
|
+
placeholder: {},
|
|
44
|
+
label: {},
|
|
45
|
+
open: { type: Boolean },
|
|
46
|
+
readonly: { type: Boolean },
|
|
47
|
+
size: {},
|
|
48
|
+
fullWidth: { type: Boolean },
|
|
49
|
+
labelToggle: { default: "Choose date" },
|
|
50
|
+
labelPreviousMonth: { default: "Previous month" },
|
|
51
|
+
labelNextMonth: { default: "Next month" },
|
|
52
|
+
labelPreviousYear: { default: "Previous year" },
|
|
53
|
+
labelNextYear: { default: "Next year" },
|
|
54
|
+
disabledDates: { type: Object, attribute: false }
|
|
55
|
+
};
|
|
56
|
+
static styles = [overlayCss, field_default, datePicker_default];
|
|
57
|
+
static shadowOptions = { delegatesFocus: true };
|
|
58
|
+
static template = `
|
|
59
|
+
<div part="field" class="field">
|
|
60
|
+
<slot name="start"></slot>
|
|
61
|
+
<input part="input" class="control" type="text" inputmode="numeric" autocomplete="off" spellcheck="false">
|
|
62
|
+
<button part="toggle" class="icon-button" type="button" aria-haspopup="dialog" aria-controls="panel" aria-expanded="false">${icons.calendar}</button>
|
|
63
|
+
</div>
|
|
64
|
+
<div part="panel" id="panel" class="panel" role="dialog" popover="manual">
|
|
65
|
+
<punica-calendar part="calendar"></punica-calendar>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
#field = this.$(".field");
|
|
69
|
+
#input = this.$("input");
|
|
70
|
+
#toggle = this.$('[part="toggle"]');
|
|
71
|
+
#panel = this.$("#panel");
|
|
72
|
+
#calendar = this.$("punica-calendar");
|
|
73
|
+
#surface = new FieldSurface(this, this.#panel);
|
|
74
|
+
/** What the input's text was last written from. @type {string | null} */
|
|
75
|
+
#textKey = null;
|
|
76
|
+
/** The typed text is not a date. */
|
|
77
|
+
#bad = false;
|
|
78
|
+
#touched = false;
|
|
79
|
+
#tabbing = false;
|
|
80
|
+
#reason = "api";
|
|
81
|
+
constructor() {
|
|
82
|
+
super();
|
|
83
|
+
customElements.upgrade(this.shadowRoot);
|
|
84
|
+
const input = this.#input;
|
|
85
|
+
input.addEventListener("change", () => this.#commitText());
|
|
86
|
+
input.addEventListener("keydown", (event) => {
|
|
87
|
+
if (event.key === "Enter") {
|
|
88
|
+
this.#commitText();
|
|
89
|
+
this.update(/* @__PURE__ */ new Map());
|
|
90
|
+
this.form?.requestSubmit();
|
|
91
|
+
} else if (event.key === "ArrowDown" && !this.open) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
this.show();
|
|
94
|
+
} else if (event.key === "Escape" && this.open) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
event.stopPropagation();
|
|
97
|
+
this.#close("escape");
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
this.#toggle.addEventListener("click", () => {
|
|
101
|
+
if (this.open) this.#close("api");
|
|
102
|
+
else this.show();
|
|
103
|
+
});
|
|
104
|
+
this.#calendar.addEventListener("punica-change", (event) => {
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
this.#commit(
|
|
107
|
+
/** @type {CustomEvent} */
|
|
108
|
+
event.detail.value
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
this.#calendar.addEventListener("punica-select", (event) => {
|
|
112
|
+
event.stopPropagation();
|
|
113
|
+
this.#close("select");
|
|
114
|
+
this.#input.focus();
|
|
115
|
+
});
|
|
116
|
+
this.#panel.addEventListener("keydown", (event) => {
|
|
117
|
+
this.#tabbing = event.key === "Tab";
|
|
118
|
+
if (event.key !== "Escape") return;
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
event.stopPropagation();
|
|
121
|
+
this.#close("escape");
|
|
122
|
+
this.#toggle.focus();
|
|
123
|
+
});
|
|
124
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
125
|
+
const next = (
|
|
126
|
+
/** @type {FocusEvent} */
|
|
127
|
+
event.relatedTarget
|
|
128
|
+
);
|
|
129
|
+
if (next instanceof Node && this.shadowRoot.contains(next)) return;
|
|
130
|
+
this.#touched = true;
|
|
131
|
+
if (this.open && this.#tabbing) this.#close("blur");
|
|
132
|
+
this.#tabbing = false;
|
|
133
|
+
this.requestUpdate();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/** The calendar inside the panel. */
|
|
137
|
+
get calendar() {
|
|
138
|
+
return this.#calendar;
|
|
139
|
+
}
|
|
140
|
+
/** Opens the calendar. */
|
|
141
|
+
show() {
|
|
142
|
+
this.open = true;
|
|
143
|
+
}
|
|
144
|
+
/** Closes the calendar. */
|
|
145
|
+
hide() {
|
|
146
|
+
this.#close("api");
|
|
147
|
+
}
|
|
148
|
+
/** Moves focus to the text input. */
|
|
149
|
+
focus(options) {
|
|
150
|
+
this.#input.focus(options);
|
|
151
|
+
}
|
|
152
|
+
connected() {
|
|
153
|
+
if (this.open) this.requestUpdate();
|
|
154
|
+
}
|
|
155
|
+
disconnected() {
|
|
156
|
+
this.#surface.hide();
|
|
157
|
+
}
|
|
158
|
+
formReset() {
|
|
159
|
+
this.#touched = false;
|
|
160
|
+
this.#textKey = null;
|
|
161
|
+
this.value = this.getAttribute("value");
|
|
162
|
+
this.requestUpdate();
|
|
163
|
+
}
|
|
164
|
+
formRestore(state) {
|
|
165
|
+
if (typeof state === "string") this.value = state;
|
|
166
|
+
}
|
|
167
|
+
update() {
|
|
168
|
+
const language = fieldLanguage(this);
|
|
169
|
+
const input = this.#input;
|
|
170
|
+
const date = parseIsoDate(this.value);
|
|
171
|
+
const iso = toIsoDate(date);
|
|
172
|
+
const disabled = this.isDisabled;
|
|
173
|
+
const name = fieldName(this);
|
|
174
|
+
const key = `${iso}|${language}`;
|
|
175
|
+
if (key !== this.#textKey) {
|
|
176
|
+
this.#textKey = key;
|
|
177
|
+
this.#bad = false;
|
|
178
|
+
input.value = formatFieldDate(language, date);
|
|
179
|
+
}
|
|
180
|
+
input.disabled = disabled;
|
|
181
|
+
input.readOnly = this.readonly;
|
|
182
|
+
input.required = this.required;
|
|
183
|
+
input.placeholder = this.placeholder || "";
|
|
184
|
+
setAttr(input, "aria-label", name);
|
|
185
|
+
this.#toggle.disabled = disabled || this.readonly;
|
|
186
|
+
setAttr(this.#toggle, "aria-label", this.labelToggle);
|
|
187
|
+
setAttr(this.#panel, "aria-label", this.labelToggle);
|
|
188
|
+
this.toggleState("disabled", disabled);
|
|
189
|
+
const calendar = this.#calendar;
|
|
190
|
+
calendar.value = iso;
|
|
191
|
+
calendar.min = this.min;
|
|
192
|
+
calendar.max = this.max;
|
|
193
|
+
calendar.locale = language;
|
|
194
|
+
calendar.disabledDates = this.disabledDates;
|
|
195
|
+
calendar.labelPreviousMonth = this.labelPreviousMonth;
|
|
196
|
+
calendar.labelNextMonth = this.labelNextMonth;
|
|
197
|
+
calendar.labelPreviousYear = this.labelPreviousYear;
|
|
198
|
+
calendar.labelNextYear = this.labelNextYear;
|
|
199
|
+
this.setFormValue(iso);
|
|
200
|
+
const min = parseIsoDate(this.min);
|
|
201
|
+
const max = parseIsoDate(this.max);
|
|
202
|
+
if (this.#bad) {
|
|
203
|
+
this.setValidity({ badInput: true }, nativeMessage("format"), input);
|
|
204
|
+
} else if (!date) {
|
|
205
|
+
this.setValidity(this.required ? { valueMissing: true } : {}, nativeMessage("required"), input);
|
|
206
|
+
} else if (min && compareDates(date, min) < 0) {
|
|
207
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { value: iso, limit: this.min }), input);
|
|
208
|
+
} else if (max && compareDates(date, max) > 0) {
|
|
209
|
+
this.setValidity({ rangeOverflow: true }, nativeMessage("max", { value: iso, limit: this.max }), input);
|
|
210
|
+
} else {
|
|
211
|
+
this.setValidity({});
|
|
212
|
+
}
|
|
213
|
+
const invalid = this.#touched && !this.validity.valid;
|
|
214
|
+
setAttr(input, "aria-invalid", invalid ? "true" : null);
|
|
215
|
+
this.toggleState("user-invalid", invalid);
|
|
216
|
+
const want = this.open && !disabled && !this.readonly;
|
|
217
|
+
if (want && !this.#surface.open) {
|
|
218
|
+
this.#surface.show(this.#field, {}, () => this.#close("outside"));
|
|
219
|
+
calendar.showDate(iso || toIsoDate(todayDate()));
|
|
220
|
+
this.toggleState("open", true);
|
|
221
|
+
this.#toggle.setAttribute("aria-expanded", "true");
|
|
222
|
+
calendar.focus({ preventScroll: true });
|
|
223
|
+
this.emit("open");
|
|
224
|
+
} else if (!want && this.#surface.open) {
|
|
225
|
+
this.#surface.hide();
|
|
226
|
+
this.toggleState("open", false);
|
|
227
|
+
this.#toggle.setAttribute("aria-expanded", "false");
|
|
228
|
+
const reason = this.#reason;
|
|
229
|
+
this.#reason = "api";
|
|
230
|
+
this.emit("close", { reason });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/** @param {string} reason */
|
|
234
|
+
#close(reason) {
|
|
235
|
+
if (!this.open) return;
|
|
236
|
+
this.#reason = reason;
|
|
237
|
+
this.open = false;
|
|
238
|
+
}
|
|
239
|
+
/** @param {string | null} iso */
|
|
240
|
+
#commit(iso) {
|
|
241
|
+
this.#touched = true;
|
|
242
|
+
this.#bad = false;
|
|
243
|
+
this.#textKey = null;
|
|
244
|
+
this.requestUpdate();
|
|
245
|
+
if (iso === toIsoDate(parseIsoDate(this.value))) return;
|
|
246
|
+
this.value = iso;
|
|
247
|
+
this.emit("change", { value: iso });
|
|
248
|
+
}
|
|
249
|
+
/** Takes what was typed. */
|
|
250
|
+
#commitText() {
|
|
251
|
+
if (this.isDisabled || this.readonly) return;
|
|
252
|
+
const text = this.#input.value.trim();
|
|
253
|
+
const date = text ? parseFieldDate(text, fieldLanguage(this)) : null;
|
|
254
|
+
if (text && !date) {
|
|
255
|
+
const had = parseIsoDate(this.value);
|
|
256
|
+
this.#touched = true;
|
|
257
|
+
this.#bad = true;
|
|
258
|
+
this.value = null;
|
|
259
|
+
this.#textKey = `null|${fieldLanguage(this)}`;
|
|
260
|
+
this.requestUpdate();
|
|
261
|
+
if (had) this.emit("change", { value: null });
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
this.#commit(toIsoDate(date));
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
define("punica-date-picker", PunicaDatePicker);
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
PunicaDatePicker
|
|
271
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// src/core/a11y.js
|
|
2
|
+
function nextIndex(event, count, current, options = {}) {
|
|
3
|
+
const { orientation = "vertical", loop = true, rtl = false } = options;
|
|
4
|
+
if (!count) return -1;
|
|
5
|
+
const vertical = orientation !== "horizontal";
|
|
6
|
+
const horizontal = orientation !== "vertical";
|
|
7
|
+
let step = 0;
|
|
8
|
+
switch (event.key) {
|
|
9
|
+
case "ArrowDown":
|
|
10
|
+
if (vertical) step = 1;
|
|
11
|
+
break;
|
|
12
|
+
case "ArrowUp":
|
|
13
|
+
if (vertical) step = -1;
|
|
14
|
+
break;
|
|
15
|
+
case "ArrowRight":
|
|
16
|
+
if (horizontal) step = rtl ? -1 : 1;
|
|
17
|
+
break;
|
|
18
|
+
case "ArrowLeft":
|
|
19
|
+
if (horizontal) step = rtl ? 1 : -1;
|
|
20
|
+
break;
|
|
21
|
+
case "Home":
|
|
22
|
+
return 0;
|
|
23
|
+
case "End":
|
|
24
|
+
return count - 1;
|
|
25
|
+
default:
|
|
26
|
+
return -1;
|
|
27
|
+
}
|
|
28
|
+
if (!step) return -1;
|
|
29
|
+
if (current < 0) return step > 0 ? 0 : count - 1;
|
|
30
|
+
const next = current + step;
|
|
31
|
+
if (loop) return (next + count) % count;
|
|
32
|
+
return Math.max(0, Math.min(count - 1, next));
|
|
33
|
+
}
|
|
34
|
+
var isRtl = (el) => getComputedStyle(el).direction === "rtl";
|
|
35
|
+
var directionListeners = /* @__PURE__ */ new Set();
|
|
36
|
+
var directionObserver = null;
|
|
37
|
+
function onDirectionChange(callback, signal) {
|
|
38
|
+
if (signal.aborted) return;
|
|
39
|
+
directionListeners.add(callback);
|
|
40
|
+
if (!directionObserver) {
|
|
41
|
+
directionObserver = new MutationObserver(() => {
|
|
42
|
+
for (const listener of directionListeners) listener();
|
|
43
|
+
});
|
|
44
|
+
directionObserver.observe(document.documentElement, {
|
|
45
|
+
attributes: true,
|
|
46
|
+
attributeFilter: ["dir"],
|
|
47
|
+
subtree: true
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
signal.addEventListener(
|
|
51
|
+
"abort",
|
|
52
|
+
() => {
|
|
53
|
+
directionListeners.delete(callback);
|
|
54
|
+
if (!directionListeners.size && directionObserver) {
|
|
55
|
+
directionObserver.disconnect();
|
|
56
|
+
directionObserver = null;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{ once: true }
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function setRovingTabindex(items, active) {
|
|
63
|
+
const target = active && items.includes(active) ? active : items[0];
|
|
64
|
+
for (const item of items) item.tabIndex = item === target ? 0 : -1;
|
|
65
|
+
}
|
|
66
|
+
function createTypeahead() {
|
|
67
|
+
let buffer = "";
|
|
68
|
+
let timer = 0;
|
|
69
|
+
return (event, labels, current = -1) => {
|
|
70
|
+
if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) {
|
|
71
|
+
return -1;
|
|
72
|
+
}
|
|
73
|
+
if (event.key === " " && !buffer) return -1;
|
|
74
|
+
clearTimeout(timer);
|
|
75
|
+
timer = setTimeout(() => buffer = "", 500);
|
|
76
|
+
buffer += event.key.toLowerCase();
|
|
77
|
+
const n = labels.length;
|
|
78
|
+
const repeated = [...buffer].every((c) => c === buffer[0]);
|
|
79
|
+
const query = repeated ? buffer[0] : buffer;
|
|
80
|
+
const start = repeated ? current + 1 : Math.max(current, 0);
|
|
81
|
+
for (let i = 0; i < n; i++) {
|
|
82
|
+
const index = (start + i) % n;
|
|
83
|
+
if (labels[index].trim().toLowerCase().startsWith(query)) return index;
|
|
84
|
+
}
|
|
85
|
+
return -1;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]';
|
|
89
|
+
function firstFocusable(root) {
|
|
90
|
+
const walk = (node) => {
|
|
91
|
+
if (node instanceof HTMLElement) {
|
|
92
|
+
if (node.matches(FOCUSABLE) || node.shadowRoot?.delegatesFocus && !node.hasAttribute("disabled")) {
|
|
93
|
+
return node;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (node instanceof HTMLSlotElement) {
|
|
97
|
+
for (const assigned of node.assignedElements({ flatten: true })) {
|
|
98
|
+
const found = walk(assigned);
|
|
99
|
+
if (found) return found;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const children = node.shadowRoot ? node.shadowRoot.children : node.children;
|
|
104
|
+
for (const child of children) {
|
|
105
|
+
const found = walk(child);
|
|
106
|
+
if (found) return found;
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
};
|
|
110
|
+
for (const child of root.children) {
|
|
111
|
+
const found = walk(child);
|
|
112
|
+
if (found) return found;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
function deepActiveElement() {
|
|
117
|
+
let el = document.activeElement;
|
|
118
|
+
while (el?.shadowRoot?.activeElement) el = el.shadowRoot.activeElement;
|
|
119
|
+
return el;
|
|
120
|
+
}
|
|
121
|
+
function composedContains(root, node) {
|
|
122
|
+
for (let n = node; n; ) {
|
|
123
|
+
if (n === root) return true;
|
|
124
|
+
n = /** @type {any} */
|
|
125
|
+
n.assignedSlot || n.parentNode || /** @type {any} */
|
|
126
|
+
n.host || null;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
var prefersReducedMotion = () => matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
nextIndex,
|
|
134
|
+
isRtl,
|
|
135
|
+
onDirectionChange,
|
|
136
|
+
setRovingTabindex,
|
|
137
|
+
createTypeahead,
|
|
138
|
+
firstFocusable,
|
|
139
|
+
deepActiveElement,
|
|
140
|
+
composedContains,
|
|
141
|
+
prefersReducedMotion
|
|
142
|
+
};
|