@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,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseIsoDate,
|
|
3
|
+
parseIsoTime,
|
|
4
|
+
toIsoDate,
|
|
5
|
+
toIsoTime
|
|
6
|
+
} from "./chunk-CKI34FQL.js";
|
|
7
|
+
import {
|
|
8
|
+
fieldLanguage,
|
|
9
|
+
fieldName,
|
|
10
|
+
nativeMessage,
|
|
11
|
+
setAttr
|
|
12
|
+
} from "./chunk-H4Q2HHZA.js";
|
|
13
|
+
import {
|
|
14
|
+
FormControl
|
|
15
|
+
} from "./chunk-HW2CN2JV.js";
|
|
16
|
+
import {
|
|
17
|
+
PunicaElement,
|
|
18
|
+
define
|
|
19
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
20
|
+
|
|
21
|
+
// src/components/dateTimeInput/dateTimeInput.css
|
|
22
|
+
var dateTimeInput_default = ":host {\n --punica-date-time-input-gap: var(--punica-space-8);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.group {\n display: flex;\n flex-wrap: wrap;\n gap: var(--punica-date-time-input-gap);\n inline-size: 100%;\n}\n\npunica-date-picker {\n --punica-date-picker-min-width: 160px;\n flex: 3 1 160px;\n}\npunica-time-picker {\n --punica-time-picker-min-width: 110px;\n flex: 2 1 110px;\n}\n";
|
|
23
|
+
|
|
24
|
+
// src/components/dateTimeInput/dateTimeInput.js
|
|
25
|
+
var DATE_LABELS = ["labelToggle", "labelPreviousMonth", "labelNextMonth", "labelPreviousYear", "labelNextYear"];
|
|
26
|
+
function splitDateTime(value) {
|
|
27
|
+
const [date = "", time = ""] = (value || "").split(/[T ]/);
|
|
28
|
+
return { date: toIsoDate(parseIsoDate(date)), time: toIsoTime(parseIsoTime(time)) };
|
|
29
|
+
}
|
|
30
|
+
var PunicaDateTimeInput = class extends FormControl(PunicaElement) {
|
|
31
|
+
static properties = {
|
|
32
|
+
value: { reflect: false },
|
|
33
|
+
min: {},
|
|
34
|
+
max: {},
|
|
35
|
+
step: { type: Number, default: 30 },
|
|
36
|
+
locale: {},
|
|
37
|
+
label: {},
|
|
38
|
+
labelDate: { default: "Date" },
|
|
39
|
+
labelTime: { default: "Time" },
|
|
40
|
+
placeholderDate: {},
|
|
41
|
+
placeholderTime: {},
|
|
42
|
+
readonly: { type: Boolean },
|
|
43
|
+
size: {},
|
|
44
|
+
fullWidth: { type: Boolean },
|
|
45
|
+
labelToggle: { default: "Choose date" },
|
|
46
|
+
labelPreviousMonth: { default: "Previous month" },
|
|
47
|
+
labelNextMonth: { default: "Next month" },
|
|
48
|
+
labelPreviousYear: { default: "Previous year" },
|
|
49
|
+
labelNextYear: { default: "Next year" }
|
|
50
|
+
};
|
|
51
|
+
static styles = dateTimeInput_default;
|
|
52
|
+
static shadowOptions = { delegatesFocus: true };
|
|
53
|
+
static template = `
|
|
54
|
+
<div part="group" class="group" role="group">
|
|
55
|
+
<punica-date-picker part="date"></punica-date-picker>
|
|
56
|
+
<punica-time-picker part="time"></punica-time-picker>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
#group = this.$(".group");
|
|
60
|
+
#date = this.$("punica-date-picker");
|
|
61
|
+
#time = this.$("punica-time-picker");
|
|
62
|
+
/** The value the two fields were last written from, or produced. @type {string | null | undefined} */
|
|
63
|
+
#synced = void 0;
|
|
64
|
+
#touched = false;
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
customElements.upgrade(this.shadowRoot);
|
|
68
|
+
this.shadowRoot.addEventListener("punica-change", (event) => {
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
this.#compose();
|
|
71
|
+
});
|
|
72
|
+
this.shadowRoot.addEventListener("keydown", (event) => {
|
|
73
|
+
const key = (
|
|
74
|
+
/** @type {KeyboardEvent} */
|
|
75
|
+
event
|
|
76
|
+
);
|
|
77
|
+
if (key.key !== "Enter" || key.defaultPrevented) return;
|
|
78
|
+
if (!(key.composedPath()[0] instanceof HTMLInputElement)) return;
|
|
79
|
+
this.#compose();
|
|
80
|
+
this.update(/* @__PURE__ */ new Map());
|
|
81
|
+
this.form?.requestSubmit();
|
|
82
|
+
});
|
|
83
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
84
|
+
const next = (
|
|
85
|
+
/** @type {FocusEvent} */
|
|
86
|
+
event.relatedTarget
|
|
87
|
+
);
|
|
88
|
+
if (next instanceof Node && this.shadowRoot.contains(next)) return;
|
|
89
|
+
this.#touched = true;
|
|
90
|
+
queueMicrotask(() => this.isConnected && this.update(/* @__PURE__ */ new Map()));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/** Moves focus to the date field. */
|
|
94
|
+
focus(options) {
|
|
95
|
+
this.#date.focus(options);
|
|
96
|
+
}
|
|
97
|
+
formReset() {
|
|
98
|
+
this.#touched = false;
|
|
99
|
+
this.#synced = void 0;
|
|
100
|
+
this.value = this.getAttribute("value");
|
|
101
|
+
this.requestUpdate();
|
|
102
|
+
}
|
|
103
|
+
formRestore(state) {
|
|
104
|
+
if (typeof state === "string") this.value = state;
|
|
105
|
+
}
|
|
106
|
+
update() {
|
|
107
|
+
const language = fieldLanguage(this);
|
|
108
|
+
const disabled = this.isDisabled;
|
|
109
|
+
const date = this.#date;
|
|
110
|
+
const time = this.#time;
|
|
111
|
+
if (this.value !== this.#synced) {
|
|
112
|
+
const parts = splitDateTime(this.value);
|
|
113
|
+
const whole = parts.date && parts.time ? `${parts.date}T${parts.time}` : null;
|
|
114
|
+
this.#synced = this.value;
|
|
115
|
+
date.value = whole ? parts.date : null;
|
|
116
|
+
time.value = whole ? parts.time : null;
|
|
117
|
+
}
|
|
118
|
+
const isoDate = toIsoDate(parseIsoDate(date.value));
|
|
119
|
+
const isoTime = toIsoTime(parseIsoTime(time.value));
|
|
120
|
+
const value = isoDate && isoTime ? `${isoDate}T${isoTime}` : null;
|
|
121
|
+
const min = splitDateTime(this.min);
|
|
122
|
+
const max = splitDateTime(this.max);
|
|
123
|
+
date.min = min.date;
|
|
124
|
+
date.max = max.date;
|
|
125
|
+
time.min = min.date && isoDate === min.date ? min.time : null;
|
|
126
|
+
time.max = max.date && isoDate === max.date ? max.time : null;
|
|
127
|
+
time.step = this.step;
|
|
128
|
+
for (const field of [date, time]) {
|
|
129
|
+
field.locale = language;
|
|
130
|
+
field.disabled = disabled;
|
|
131
|
+
field.readonly = this.readonly;
|
|
132
|
+
field.size = this.size;
|
|
133
|
+
}
|
|
134
|
+
date.label = this.labelDate;
|
|
135
|
+
time.label = this.labelTime;
|
|
136
|
+
date.placeholder = this.placeholderDate;
|
|
137
|
+
time.placeholder = this.placeholderTime;
|
|
138
|
+
for (const name of DATE_LABELS) date[name] = this[name];
|
|
139
|
+
setAttr(this.#group, "aria-label", fieldName(this));
|
|
140
|
+
this.toggleState("disabled", disabled);
|
|
141
|
+
this.setFormValue(value);
|
|
142
|
+
const partial = !!isoDate !== !!isoTime;
|
|
143
|
+
const bad = date.validity.badInput || time.validity.badInput;
|
|
144
|
+
const wholeMin = min.date && min.time ? `${min.date}T${min.time}` : null;
|
|
145
|
+
const wholeMax = max.date && max.time ? `${max.date}T${max.time}` : null;
|
|
146
|
+
if (bad) {
|
|
147
|
+
this.setValidity({ badInput: true }, nativeMessage("format"), date.validity.badInput ? date : time);
|
|
148
|
+
} else if (partial) {
|
|
149
|
+
this.setValidity({ badInput: true }, nativeMessage("required"), isoDate ? time : date);
|
|
150
|
+
} else if (!value) {
|
|
151
|
+
this.setValidity(this.required ? { valueMissing: true } : {}, nativeMessage("required"), date);
|
|
152
|
+
} else if (wholeMin && value < wholeMin) {
|
|
153
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { type: "datetime-local", value, limit: wholeMin }), date);
|
|
154
|
+
} else if (wholeMax && value > wholeMax) {
|
|
155
|
+
this.setValidity({ rangeOverflow: true }, nativeMessage("max", { type: "datetime-local", value, limit: wholeMax }), date);
|
|
156
|
+
} else {
|
|
157
|
+
this.setValidity({});
|
|
158
|
+
}
|
|
159
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
160
|
+
}
|
|
161
|
+
/** Reads the two fields into one value and tells the page when it changed. */
|
|
162
|
+
#compose() {
|
|
163
|
+
const isoDate = toIsoDate(parseIsoDate(this.#date.value));
|
|
164
|
+
const isoTime = toIsoTime(parseIsoTime(this.#time.value));
|
|
165
|
+
const value = isoDate && isoTime ? `${isoDate}T${isoTime}` : null;
|
|
166
|
+
const parts = splitDateTime(this.value);
|
|
167
|
+
const before = parts.date && parts.time ? `${parts.date}T${parts.time}` : null;
|
|
168
|
+
this.#touched = true;
|
|
169
|
+
this.#synced = value;
|
|
170
|
+
this.value = value;
|
|
171
|
+
this.requestUpdate();
|
|
172
|
+
if (value !== before) this.emit("change", { value });
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
define("punica-date-time-input", PunicaDateTimeInput);
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
PunicaDateTimeInput
|
|
179
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/menu/menuDivider.css
|
|
7
|
+
var menuDivider_default = ":host {\n --punica-menu-divider-color: var(--punica-color-border);\n\n display: block;\n flex: none;\n block-size: var(--punica-border-width);\n margin: var(--punica-space-4) 0;\n background: var(--punica-menu-divider-color);\n}\n\n@media (forced-colors: active) {\n :host {\n background: CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/menu/menuDivider.js
|
|
10
|
+
var PunicaMenuDivider = class extends PunicaElement {
|
|
11
|
+
static styles = menuDivider_default;
|
|
12
|
+
connected() {
|
|
13
|
+
this.internals.role = "separator";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
define("punica-menu-divider", PunicaMenuDivider);
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
PunicaMenuDivider
|
|
20
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
isRtl,
|
|
6
|
+
nextIndex,
|
|
7
|
+
setRovingTabindex
|
|
8
|
+
} from "./chunk-4RURT4SK.js";
|
|
9
|
+
import {
|
|
10
|
+
PunicaElement,
|
|
11
|
+
define
|
|
12
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
13
|
+
|
|
14
|
+
// src/components/toggleButtonGroup/toggleButtonGroup.css
|
|
15
|
+
var toggleButtonGroup_default = ":host {\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([orientation='vertical']) {\n flex-direction: column;\n}\n\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n:host([full-width]) ::slotted(punica-toggle-button) {\n flex: 1;\n}\n\n/* Joined buttons: inner corners square, borders shared. */\n:host(:not([orientation='vertical'])) ::slotted(punica-toggle-button:not(:last-child)) {\n --punica-toggle-button-radius-start-end: 0;\n --punica-toggle-button-radius-end-end: 0;\n}\n:host(:not([orientation='vertical'])) ::slotted(punica-toggle-button:not(:first-child)) {\n --punica-toggle-button-radius-start-start: 0;\n --punica-toggle-button-radius-end-start: 0;\n margin-inline-start: calc(-1 * var(--punica-border-width));\n}\n\n:host([orientation='vertical']) ::slotted(punica-toggle-button) {\n display: flex;\n}\n:host([orientation='vertical']) ::slotted(punica-toggle-button:not(:last-child)) {\n --punica-toggle-button-radius-end-start: 0;\n --punica-toggle-button-radius-end-end: 0;\n}\n:host([orientation='vertical']) ::slotted(punica-toggle-button:not(:first-child)) {\n --punica-toggle-button-radius-start-start: 0;\n --punica-toggle-button-radius-start-end: 0;\n margin-block-start: calc(-1 * var(--punica-border-width));\n}\n\n/* A pressed or focused button draws its border over its neighbours'. */\n::slotted(punica-toggle-button:state(pressed)),\n::slotted(punica-toggle-button:focus-within) {\n position: relative;\n z-index: 1;\n}\n";
|
|
16
|
+
|
|
17
|
+
// src/components/toggleButtonGroup/toggleButtonGroup.js
|
|
18
|
+
var missingMessage = () => {
|
|
19
|
+
const probe = document.createElement("input");
|
|
20
|
+
probe.type = "radio";
|
|
21
|
+
probe.name = "punica-probe";
|
|
22
|
+
probe.required = true;
|
|
23
|
+
return probe.validationMessage;
|
|
24
|
+
};
|
|
25
|
+
var valueOf = (button) => button.value ?? button.textContent.trim();
|
|
26
|
+
var PunicaToggleButtonGroup = class extends FormControl(PunicaElement) {
|
|
27
|
+
static properties = {
|
|
28
|
+
value: { reflect: false, default: "" },
|
|
29
|
+
multiple: { type: Boolean },
|
|
30
|
+
label: {},
|
|
31
|
+
orientation: { default: "horizontal" },
|
|
32
|
+
fullWidth: { type: Boolean }
|
|
33
|
+
};
|
|
34
|
+
static styles = toggleButtonGroup_default;
|
|
35
|
+
static template = `<slot></slot>`;
|
|
36
|
+
/** @type {string | null} */
|
|
37
|
+
#initial = null;
|
|
38
|
+
/** @type {HTMLElement | null} */
|
|
39
|
+
#active = null;
|
|
40
|
+
#adopted = false;
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this.$("slot").addEventListener("slotchange", () => this.#adopt());
|
|
44
|
+
this.addEventListener("punica-change", (event) => this.#onChildChange(event));
|
|
45
|
+
this.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
46
|
+
this.addEventListener("focusin", (event) => {
|
|
47
|
+
const button = this.#buttons().find((b) => b === event.target);
|
|
48
|
+
if (button) {
|
|
49
|
+
this.#active = button;
|
|
50
|
+
this.#rove();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** The pressed values as a list. */
|
|
55
|
+
get values() {
|
|
56
|
+
const value = this.value ?? "";
|
|
57
|
+
if (!value) return [];
|
|
58
|
+
return this.multiple ? value.split(/\s+/).filter(Boolean) : [value];
|
|
59
|
+
}
|
|
60
|
+
set values(list) {
|
|
61
|
+
this.value = [...list || []].join(" ");
|
|
62
|
+
}
|
|
63
|
+
update() {
|
|
64
|
+
const internals = this.internals;
|
|
65
|
+
internals.role = "toolbar";
|
|
66
|
+
internals.ariaLabel = this.label || null;
|
|
67
|
+
internals.ariaOrientation = this.orientation === "vertical" ? "vertical" : "horizontal";
|
|
68
|
+
internals.ariaDisabled = this.isDisabled ? "true" : null;
|
|
69
|
+
const values = this.values;
|
|
70
|
+
const buttons = this.#buttons();
|
|
71
|
+
for (const button of buttons) {
|
|
72
|
+
if (this.#adopted) button.pressed = values.includes(valueOf(button));
|
|
73
|
+
button.requestUpdate?.();
|
|
74
|
+
}
|
|
75
|
+
this.#rove();
|
|
76
|
+
if (this.multiple && this.name) {
|
|
77
|
+
const data = new FormData();
|
|
78
|
+
for (const value of values) data.append(this.name, value);
|
|
79
|
+
this.setFormValue(values.length ? data : null, this.value ?? "");
|
|
80
|
+
} else {
|
|
81
|
+
this.setFormValue(values.length ? values[0] : null, this.value ?? "");
|
|
82
|
+
}
|
|
83
|
+
const missing = this.required && !values.length;
|
|
84
|
+
this.setValidity(
|
|
85
|
+
missing ? { valueMissing: true } : {},
|
|
86
|
+
missing ? missingMessage() : "",
|
|
87
|
+
buttons[0]
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
formReset() {
|
|
91
|
+
this.value = this.getAttribute("value") ?? this.#initial ?? "";
|
|
92
|
+
}
|
|
93
|
+
formRestore(state) {
|
|
94
|
+
if (typeof state === "string") this.value = state;
|
|
95
|
+
}
|
|
96
|
+
/** Moves focus to the button that is in the tab order. */
|
|
97
|
+
focus(options) {
|
|
98
|
+
const buttons = this.#enabled();
|
|
99
|
+
(buttons.find((b) => b.tabIndex === 0) || buttons[0])?.focus(options);
|
|
100
|
+
}
|
|
101
|
+
/** @returns {any[]} */
|
|
102
|
+
#buttons() {
|
|
103
|
+
return this.$("slot").assignedElements().filter((el) => el.localName === "punica-toggle-button");
|
|
104
|
+
}
|
|
105
|
+
#enabled() {
|
|
106
|
+
return this.isDisabled ? [] : this.#buttons().filter((b) => !b.disabled);
|
|
107
|
+
}
|
|
108
|
+
#rove() {
|
|
109
|
+
const buttons = this.#enabled();
|
|
110
|
+
const active = this.#active && buttons.includes(this.#active) && this.#active || buttons.find((b) => b.pressed) || null;
|
|
111
|
+
setRovingTabindex(buttons, active);
|
|
112
|
+
}
|
|
113
|
+
/** Buttons arrived: with no value of its own the group takes theirs. */
|
|
114
|
+
#adopt() {
|
|
115
|
+
if (!this.value) {
|
|
116
|
+
const pressed = this.#buttons().filter((b) => b.pressed).map(valueOf);
|
|
117
|
+
const value = (this.multiple ? pressed : pressed.slice(0, 1)).join(" ");
|
|
118
|
+
this.#initial ??= value;
|
|
119
|
+
if (value) this.value = value;
|
|
120
|
+
}
|
|
121
|
+
this.#adopted = true;
|
|
122
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map());
|
|
123
|
+
}
|
|
124
|
+
#onChildChange(event) {
|
|
125
|
+
const target = event.target;
|
|
126
|
+
if (target === this || !this.#buttons().includes(target)) return;
|
|
127
|
+
event.stopImmediatePropagation();
|
|
128
|
+
let pressed = this.#buttons().filter((b) => b.pressed);
|
|
129
|
+
if (!this.multiple) pressed = pressed.filter((b) => b === target);
|
|
130
|
+
this.value = pressed.map(valueOf).join(" ");
|
|
131
|
+
this.update(/* @__PURE__ */ new Map());
|
|
132
|
+
this.emit("change", { value: this.value, values: this.values });
|
|
133
|
+
}
|
|
134
|
+
#onKeydown(event) {
|
|
135
|
+
const buttons = this.#enabled();
|
|
136
|
+
const current = buttons.findIndex((b) => b.matches(":focus"));
|
|
137
|
+
if (current < 0) return;
|
|
138
|
+
const index = nextIndex(event, buttons.length, current, {
|
|
139
|
+
orientation: this.orientation === "vertical" ? "vertical" : "horizontal",
|
|
140
|
+
rtl: isRtl(this)
|
|
141
|
+
});
|
|
142
|
+
if (index < 0) return;
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
buttons[index].focus();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
define("punica-toggle-button-group", PunicaToggleButtonGroup);
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
PunicaToggleButtonGroup
|
|
151
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/radio/radio.css
|
|
7
|
+
var radio_default = ":host {\n --_accent: var(--punica-color-primary);\n --punica-radio-size: var(--punica-space-18);\n --punica-radio-border-color: var(--punica-color-border-strong);\n --punica-radio-color: var(--_accent);\n --punica-radio-gap: var(--punica-space-8);\n\n display: inline-flex;\n align-items: center;\n gap: var(--punica-radio-gap);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: 1.43;\n cursor: pointer;\n user-select: none;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n}\n:host([color='info']) {\n --_accent: var(--punica-color-info);\n}\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n}\n:host([color='neutral']) {\n --_accent: var(--punica-color-neutral-dark);\n}\n\n.control {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-radio-size);\n block-size: var(--punica-radio-size);\n border: var(--punica-border-width) solid var(--punica-radio-border-color);\n border-radius: var(--punica-radius-full);\n background: var(--punica-color-surface);\n transition: border-color var(--punica-duration-fast) var(--punica-ease);\n}\n.control::after {\n content: '';\n inline-size: 50%;\n block-size: 50%;\n border-radius: var(--punica-radius-full);\n background: var(--punica-radio-color);\n transform: scale(0);\n transition: transform var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:state(checked)) .control {\n border-color: var(--punica-radio-color);\n}\n:host(:state(checked)) .control::after {\n transform: scale(1);\n}\n\n:host(:focus-visible) .control {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n:host(:state(disabled)) {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n .control {\n border-color: FieldText;\n }\n :host(:state(checked)) .control {\n border-color: Highlight;\n }\n .control::after {\n background: Highlight;\n }\n :host(:state(disabled)) {\n opacity: 1;\n color: GrayText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/radio/radio.js
|
|
10
|
+
var PunicaRadio = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
value: {},
|
|
13
|
+
checked: { type: Boolean },
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
color: {}
|
|
16
|
+
};
|
|
17
|
+
static styles = radio_default;
|
|
18
|
+
static template = `
|
|
19
|
+
<span part="control" class="control"></span>
|
|
20
|
+
<span part="label" class="label"><slot></slot></span>
|
|
21
|
+
`;
|
|
22
|
+
update() {
|
|
23
|
+
const group = (
|
|
24
|
+
/** @type {any} */
|
|
25
|
+
this.closest("punica-radio-group")
|
|
26
|
+
);
|
|
27
|
+
const off = this.disabled || !!group?.isDisabled;
|
|
28
|
+
const internals = this.internals;
|
|
29
|
+
internals.role = "radio";
|
|
30
|
+
internals.ariaChecked = String(this.checked);
|
|
31
|
+
internals.ariaDisabled = off ? "true" : null;
|
|
32
|
+
this.toggleState("checked", this.checked);
|
|
33
|
+
this.toggleState("disabled", off);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
define("punica-radio", PunicaRadio);
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
PunicaRadio
|
|
40
|
+
};
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatFieldTime,
|
|
3
|
+
parseFieldTime,
|
|
4
|
+
parseIsoTime,
|
|
5
|
+
toIsoTime
|
|
6
|
+
} from "./chunk-CKI34FQL.js";
|
|
7
|
+
import {
|
|
8
|
+
field_default
|
|
9
|
+
} from "./chunk-LSDTMST7.js";
|
|
10
|
+
import {
|
|
11
|
+
FieldSurface,
|
|
12
|
+
OptionNavigator,
|
|
13
|
+
fieldLanguage,
|
|
14
|
+
fieldName,
|
|
15
|
+
nativeMessage,
|
|
16
|
+
setAttr
|
|
17
|
+
} from "./chunk-H4Q2HHZA.js";
|
|
18
|
+
import {
|
|
19
|
+
FormControl
|
|
20
|
+
} from "./chunk-HW2CN2JV.js";
|
|
21
|
+
import {
|
|
22
|
+
overlayCss
|
|
23
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
24
|
+
import {
|
|
25
|
+
icons
|
|
26
|
+
} from "./chunk-YSGWORUD.js";
|
|
27
|
+
import {
|
|
28
|
+
PunicaElement,
|
|
29
|
+
define
|
|
30
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
31
|
+
|
|
32
|
+
// src/components/timePicker/timePicker.css
|
|
33
|
+
var timePicker_default = ":host {\n --punica-time-picker-radius: var(--punica-radius);\n --punica-time-picker-height: var(--punica-size-md);\n --punica-time-picker-padding: var(--punica-space-12);\n --punica-time-picker-border-color: var(--punica-color-border);\n --punica-time-picker-background: transparent;\n --punica-time-picker-min-width: 140px;\n --punica-time-picker-listbox-max-height: 250px;\n\n --_height: var(--punica-time-picker-height);\n --_pad: var(--punica-time-picker-padding);\n --_radius: var(--punica-time-picker-radius);\n --_border: var(--punica-time-picker-border-color);\n --_bg: var(--punica-time-picker-background);\n --_list-max-height: var(--punica-time-picker-listbox-max-height);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-time-picker-min-width);\n}\n\n:host([size='small']) {\n --punica-time-picker-height: var(--punica-size-sm);\n --punica-time-picker-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-time-picker-height: var(--punica-size-lg);\n --punica-time-picker-padding: var(--punica-space-16);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n";
|
|
34
|
+
|
|
35
|
+
// src/components/timePicker/timePicker.js
|
|
36
|
+
var PunicaTimePicker = class extends FormControl(PunicaElement) {
|
|
37
|
+
static properties = {
|
|
38
|
+
value: { reflect: false },
|
|
39
|
+
step: { type: Number, default: 30 },
|
|
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
|
+
};
|
|
50
|
+
static styles = [overlayCss, field_default, timePicker_default];
|
|
51
|
+
static shadowOptions = { delegatesFocus: true };
|
|
52
|
+
static template = `
|
|
53
|
+
<div part="field" class="field">
|
|
54
|
+
<slot name="start"></slot>
|
|
55
|
+
<input part="input" class="control" type="text" role="combobox" aria-haspopup="listbox" aria-controls="listbox" aria-expanded="false" aria-autocomplete="none" autocomplete="off" spellcheck="false">
|
|
56
|
+
<button part="toggle" class="icon-button" type="button" tabindex="-1" aria-hidden="true">${icons.clock}</button>
|
|
57
|
+
</div>
|
|
58
|
+
<div part="listbox" id="listbox" class="panel listbox" role="listbox" popover="manual"></div>
|
|
59
|
+
`;
|
|
60
|
+
#field = this.$(".field");
|
|
61
|
+
#input = this.$("input");
|
|
62
|
+
#toggle = this.$('[part="toggle"]');
|
|
63
|
+
#listbox = this.$("#listbox");
|
|
64
|
+
#surface = new FieldSurface(this, this.#listbox);
|
|
65
|
+
#nav = new OptionNavigator(this.#input, () => [...this.#listbox.children]);
|
|
66
|
+
/** @type {string | null} */
|
|
67
|
+
#textKey = null;
|
|
68
|
+
/** @type {string | null} */
|
|
69
|
+
#listKey = null;
|
|
70
|
+
#bad = false;
|
|
71
|
+
#touched = false;
|
|
72
|
+
#reason = "api";
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
const input = this.#input;
|
|
76
|
+
input.addEventListener("change", () => this.#commitText());
|
|
77
|
+
input.addEventListener("input", () => this.#nav.set(null));
|
|
78
|
+
input.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
79
|
+
this.#toggle.addEventListener("click", () => {
|
|
80
|
+
if (this.open) this.#close("api");
|
|
81
|
+
else this.show();
|
|
82
|
+
input.focus();
|
|
83
|
+
});
|
|
84
|
+
this.#listbox.addEventListener("mousedown", (event) => event.preventDefault());
|
|
85
|
+
this.#listbox.addEventListener("click", (event) => {
|
|
86
|
+
const option = event.target instanceof Element ? event.target.closest("punica-option") : null;
|
|
87
|
+
if (option) this.#pick(option);
|
|
88
|
+
});
|
|
89
|
+
this.#listbox.addEventListener("pointermove", (event) => {
|
|
90
|
+
const option = event.target instanceof Element ? event.target.closest("punica-option") : null;
|
|
91
|
+
if (option && option !== this.#nav.active) this.#nav.set(option);
|
|
92
|
+
});
|
|
93
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
94
|
+
const next = (
|
|
95
|
+
/** @type {FocusEvent} */
|
|
96
|
+
event.relatedTarget
|
|
97
|
+
);
|
|
98
|
+
if (next instanceof Node && this.shadowRoot.contains(next)) return;
|
|
99
|
+
this.#touched = true;
|
|
100
|
+
if (this.open) this.#close("blur");
|
|
101
|
+
else this.requestUpdate();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/** Opens the list of times. */
|
|
105
|
+
show() {
|
|
106
|
+
this.open = true;
|
|
107
|
+
}
|
|
108
|
+
/** Closes the list of times. */
|
|
109
|
+
hide() {
|
|
110
|
+
this.#close("api");
|
|
111
|
+
}
|
|
112
|
+
/** Moves focus to the text input. */
|
|
113
|
+
focus(options) {
|
|
114
|
+
this.#input.focus(options);
|
|
115
|
+
}
|
|
116
|
+
connected() {
|
|
117
|
+
if (this.open) this.requestUpdate();
|
|
118
|
+
}
|
|
119
|
+
disconnected() {
|
|
120
|
+
this.#surface.hide();
|
|
121
|
+
this.#nav.set(null);
|
|
122
|
+
}
|
|
123
|
+
formReset() {
|
|
124
|
+
this.#touched = false;
|
|
125
|
+
this.#textKey = null;
|
|
126
|
+
this.value = this.getAttribute("value");
|
|
127
|
+
this.requestUpdate();
|
|
128
|
+
}
|
|
129
|
+
formRestore(state) {
|
|
130
|
+
if (typeof state === "string") this.value = state;
|
|
131
|
+
}
|
|
132
|
+
update() {
|
|
133
|
+
const language = fieldLanguage(this);
|
|
134
|
+
const input = this.#input;
|
|
135
|
+
const minutes = parseIsoTime(this.value);
|
|
136
|
+
const iso = toIsoTime(minutes);
|
|
137
|
+
const disabled = this.isDisabled;
|
|
138
|
+
const name = fieldName(this);
|
|
139
|
+
const min = parseIsoTime(this.min);
|
|
140
|
+
const max = parseIsoTime(this.max);
|
|
141
|
+
const key = `${iso}|${language}`;
|
|
142
|
+
if (key !== this.#textKey) {
|
|
143
|
+
this.#textKey = key;
|
|
144
|
+
this.#bad = false;
|
|
145
|
+
input.value = formatFieldTime(language, minutes);
|
|
146
|
+
}
|
|
147
|
+
input.disabled = disabled;
|
|
148
|
+
input.readOnly = this.readonly;
|
|
149
|
+
input.required = this.required;
|
|
150
|
+
input.placeholder = this.placeholder || "";
|
|
151
|
+
setAttr(input, "aria-label", name);
|
|
152
|
+
setAttr(this.#listbox, "aria-label", name);
|
|
153
|
+
this.#toggle.disabled = disabled || this.readonly;
|
|
154
|
+
this.toggleState("disabled", disabled);
|
|
155
|
+
const step = Math.max(1, Math.round(this.step || 30));
|
|
156
|
+
const listKey = [step, min, max, language].join("|");
|
|
157
|
+
if (listKey !== this.#listKey) {
|
|
158
|
+
this.#listKey = listKey;
|
|
159
|
+
this.#nav.set(null);
|
|
160
|
+
const rows = [];
|
|
161
|
+
for (let t = 0; t < 24 * 60; t += step) {
|
|
162
|
+
if (min != null && t < min || max != null && t > max) continue;
|
|
163
|
+
const option = document.createElement("punica-option");
|
|
164
|
+
option.setAttribute("part", "option");
|
|
165
|
+
option.value = toIsoTime(t);
|
|
166
|
+
option.textContent = formatFieldTime(language, t);
|
|
167
|
+
rows.push(option);
|
|
168
|
+
}
|
|
169
|
+
this.#listbox.replaceChildren(...rows);
|
|
170
|
+
}
|
|
171
|
+
for (const option of this.#listbox.children) option.selected = option.getAttribute("value") === iso;
|
|
172
|
+
this.setFormValue(iso);
|
|
173
|
+
if (this.#bad) {
|
|
174
|
+
this.setValidity({ badInput: true }, nativeMessage("format"), input);
|
|
175
|
+
} else if (minutes == null) {
|
|
176
|
+
this.setValidity(this.required ? { valueMissing: true } : {}, nativeMessage("required"), input);
|
|
177
|
+
} else if (min != null && minutes < min) {
|
|
178
|
+
this.setValidity({ rangeUnderflow: true }, nativeMessage("min", { type: "time", value: iso, limit: toIsoTime(min) }), input);
|
|
179
|
+
} else if (max != null && minutes > max) {
|
|
180
|
+
this.setValidity({ rangeOverflow: true }, nativeMessage("max", { type: "time", value: iso, limit: toIsoTime(max) }), input);
|
|
181
|
+
} else {
|
|
182
|
+
this.setValidity({});
|
|
183
|
+
}
|
|
184
|
+
const invalid = this.#touched && !this.validity.valid;
|
|
185
|
+
setAttr(input, "aria-invalid", invalid ? "true" : null);
|
|
186
|
+
this.toggleState("user-invalid", invalid);
|
|
187
|
+
const want = this.open && !disabled && !this.readonly;
|
|
188
|
+
if (want && !this.#surface.open) {
|
|
189
|
+
this.#surface.show(this.#field, { matchWidth: true }, () => this.#close("outside"));
|
|
190
|
+
const rows = (
|
|
191
|
+
/** @type {any[]} */
|
|
192
|
+
[...this.#listbox.children]
|
|
193
|
+
);
|
|
194
|
+
const start = rows.find((o) => o.selected) || rows.find((o) => minutes != null && parseIsoTime(o.value) >= minutes) || rows[0] || null;
|
|
195
|
+
this.#nav.set(start);
|
|
196
|
+
start?.scrollIntoView({ block: "center" });
|
|
197
|
+
this.toggleState("open", true);
|
|
198
|
+
input.setAttribute("aria-expanded", "true");
|
|
199
|
+
this.emit("open");
|
|
200
|
+
} else if (!want && this.#surface.open) {
|
|
201
|
+
this.#surface.hide();
|
|
202
|
+
this.#nav.set(null);
|
|
203
|
+
this.toggleState("open", false);
|
|
204
|
+
input.setAttribute("aria-expanded", "false");
|
|
205
|
+
const reason = this.#reason;
|
|
206
|
+
this.#reason = "api";
|
|
207
|
+
this.emit("close", { reason });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** @param {string} reason */
|
|
211
|
+
#close(reason) {
|
|
212
|
+
if (!this.open) return;
|
|
213
|
+
this.#reason = reason;
|
|
214
|
+
this.open = false;
|
|
215
|
+
}
|
|
216
|
+
/** @param {string | null} iso */
|
|
217
|
+
#commit(iso) {
|
|
218
|
+
this.#touched = true;
|
|
219
|
+
this.#bad = false;
|
|
220
|
+
this.#textKey = null;
|
|
221
|
+
this.requestUpdate();
|
|
222
|
+
if (iso === toIsoTime(parseIsoTime(this.value))) return;
|
|
223
|
+
this.value = iso;
|
|
224
|
+
this.emit("change", { value: iso });
|
|
225
|
+
}
|
|
226
|
+
/** @param {any} option */
|
|
227
|
+
#pick(option) {
|
|
228
|
+
this.#commit(option.value);
|
|
229
|
+
this.#close("select");
|
|
230
|
+
}
|
|
231
|
+
/** Takes what was typed. */
|
|
232
|
+
#commitText() {
|
|
233
|
+
if (this.isDisabled || this.readonly) return;
|
|
234
|
+
const language = fieldLanguage(this);
|
|
235
|
+
const text = this.#input.value.trim();
|
|
236
|
+
const minutes = text ? parseFieldTime(text, language) : null;
|
|
237
|
+
if (text && minutes == null) {
|
|
238
|
+
const had = parseIsoTime(this.value) != null;
|
|
239
|
+
this.#touched = true;
|
|
240
|
+
this.#bad = true;
|
|
241
|
+
this.value = null;
|
|
242
|
+
this.#textKey = `null|${language}`;
|
|
243
|
+
this.requestUpdate();
|
|
244
|
+
if (had) this.emit("change", { value: null });
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.#commit(toIsoTime(minutes));
|
|
248
|
+
}
|
|
249
|
+
/** @param {KeyboardEvent} event */
|
|
250
|
+
#onKeydown(event) {
|
|
251
|
+
if (this.isDisabled || this.readonly) return;
|
|
252
|
+
const nav = this.#nav;
|
|
253
|
+
if (event.key === "Enter") {
|
|
254
|
+
if (this.open && nav.active) {
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
this.#pick(nav.active);
|
|
257
|
+
} else {
|
|
258
|
+
this.#commitText();
|
|
259
|
+
this.#close("select");
|
|
260
|
+
this.update(/* @__PURE__ */ new Map());
|
|
261
|
+
this.form?.requestSubmit();
|
|
262
|
+
}
|
|
263
|
+
} else if (event.key === "Escape") {
|
|
264
|
+
if (!this.open) return;
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
event.stopPropagation();
|
|
267
|
+
this.#close("escape");
|
|
268
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
269
|
+
event.preventDefault();
|
|
270
|
+
if (!this.open) this.show();
|
|
271
|
+
else nav.move(event, { homeEnd: false });
|
|
272
|
+
} else if (this.open && nav.move(event, { homeEnd: false })) {
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
define("punica-time-picker", PunicaTimePicker);
|
|
278
|
+
|
|
279
|
+
export {
|
|
280
|
+
PunicaTimePicker
|
|
281
|
+
};
|