@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,118 @@
|
|
|
1
|
+
// src/core/form.js
|
|
2
|
+
var FormControl = (Base) => class FormControlElement extends Base {
|
|
3
|
+
static formAssociated = true;
|
|
4
|
+
static properties = {
|
|
5
|
+
/** Name the value is submitted under. */
|
|
6
|
+
name: {},
|
|
7
|
+
/** The control takes no input and submits nothing. */
|
|
8
|
+
disabled: { type: Boolean },
|
|
9
|
+
/** A value is needed before the form submits. */
|
|
10
|
+
required: { type: Boolean }
|
|
11
|
+
};
|
|
12
|
+
#formDisabled = false;
|
|
13
|
+
#customError = "";
|
|
14
|
+
/** True for the control's own `disabled` or a disabled fieldset. */
|
|
15
|
+
get isDisabled() {
|
|
16
|
+
return this.disabled || this.#formDisabled;
|
|
17
|
+
}
|
|
18
|
+
/** @returns {HTMLFormElement | null} */
|
|
19
|
+
get form() {
|
|
20
|
+
return this.internals.form;
|
|
21
|
+
}
|
|
22
|
+
/** @returns {NodeList} */
|
|
23
|
+
get labels() {
|
|
24
|
+
return this.internals.labels;
|
|
25
|
+
}
|
|
26
|
+
/** @returns {ValidityState} */
|
|
27
|
+
get validity() {
|
|
28
|
+
return this.internals.validity;
|
|
29
|
+
}
|
|
30
|
+
get validationMessage() {
|
|
31
|
+
return this.internals.validationMessage;
|
|
32
|
+
}
|
|
33
|
+
get willValidate() {
|
|
34
|
+
return this.internals.willValidate;
|
|
35
|
+
}
|
|
36
|
+
checkValidity() {
|
|
37
|
+
return this.internals.checkValidity();
|
|
38
|
+
}
|
|
39
|
+
reportValidity() {
|
|
40
|
+
return this.internals.reportValidity();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sets a custom error; an empty string clears it.
|
|
44
|
+
* @param {string} message
|
|
45
|
+
*/
|
|
46
|
+
setCustomValidity(message) {
|
|
47
|
+
this.#customError = message || "";
|
|
48
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map());
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @param {File | string | FormData | null} value
|
|
52
|
+
* @param {File | string | FormData | null} [state]
|
|
53
|
+
*/
|
|
54
|
+
setFormValue(value, state) {
|
|
55
|
+
this.internals.setFormValue(this.isDisabled ? null : value, state);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reports validity. A custom error set by `setCustomValidity` wins.
|
|
59
|
+
* @param {ValidityStateFlags} [flags]
|
|
60
|
+
* @param {string} [message]
|
|
61
|
+
* @param {HTMLElement} [anchor] element the browser points its bubble at
|
|
62
|
+
*/
|
|
63
|
+
setValidity(flags, message, anchor) {
|
|
64
|
+
if (this.#customError) {
|
|
65
|
+
this.internals.setValidity(
|
|
66
|
+
{ customError: true },
|
|
67
|
+
this.#customError,
|
|
68
|
+
anchor
|
|
69
|
+
);
|
|
70
|
+
} else if (flags && Object.keys(plainFlags(flags)).length) {
|
|
71
|
+
this.internals.setValidity(plainFlags(flags), message || " ", anchor);
|
|
72
|
+
} else {
|
|
73
|
+
this.internals.setValidity({});
|
|
74
|
+
}
|
|
75
|
+
const invalid = !this.internals.validity.valid;
|
|
76
|
+
this.toggleState("invalid", invalid);
|
|
77
|
+
this.toggleState("valid", !invalid);
|
|
78
|
+
}
|
|
79
|
+
formDisabledCallback(disabled) {
|
|
80
|
+
this.#formDisabled = disabled;
|
|
81
|
+
this.toggleState("disabled", this.isDisabled);
|
|
82
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map([["disabled", this.disabled]]));
|
|
83
|
+
}
|
|
84
|
+
formResetCallback() {
|
|
85
|
+
this.formReset();
|
|
86
|
+
}
|
|
87
|
+
formStateRestoreCallback(state) {
|
|
88
|
+
this.formRestore(state);
|
|
89
|
+
}
|
|
90
|
+
/** Go back to the default value. */
|
|
91
|
+
formReset() {
|
|
92
|
+
}
|
|
93
|
+
/** Take a value the browser restored. */
|
|
94
|
+
// eslint-disable-next-line no-unused-vars
|
|
95
|
+
formRestore(state) {
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Submits or resets the owning form the way a native button would.
|
|
99
|
+
* @param {'submit' | 'reset'} type
|
|
100
|
+
*/
|
|
101
|
+
formAction(type) {
|
|
102
|
+
const form = this.form;
|
|
103
|
+
if (!form) return;
|
|
104
|
+
if (type === "reset") form.reset();
|
|
105
|
+
else form.requestSubmit();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
function plainFlags(flags) {
|
|
109
|
+
const out = {};
|
|
110
|
+
for (const key in flags) {
|
|
111
|
+
if (key !== "valid" && flags[key] === true) out[key] = true;
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
FormControl
|
|
118
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/alert/alert.css
|
|
10
|
+
var alert_default = ":host {\n --punica-alert-radius: var(--punica-radius);\n --punica-alert-padding: var(--punica-space-12) var(--punica-padding);\n --punica-alert-gap: var(--punica-space-12);\n --_accent: var(--punica-color-info);\n --_background: var(--punica-color-info-light);\n --_text: var(--punica-color-info-dark);\n --_icon: var(--_accent);\n\n display: flex;\n align-items: flex-start;\n gap: var(--punica-alert-gap);\n padding: var(--punica-alert-padding);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-alert-radius);\n background: var(--_background);\n color: var(--_text);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n}\n\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n --_background: var(--punica-color-success-light);\n --_text: var(--punica-color-success-dark);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n --_background: var(--punica-color-warning-light);\n --_text: var(--punica-color-warning-dark);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n --_background: var(--punica-color-error-light);\n --_text: var(--punica-color-error-dark);\n}\n:host([color='primary']) {\n --_accent: var(--punica-color-primary);\n --_background: color-mix(in srgb, var(--punica-color-primary) 12%, var(--punica-color-surface));\n --_text: var(--punica-color-text);\n}\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n --_background: color-mix(in srgb, var(--punica-color-secondary) 12%, var(--punica-color-surface));\n --_text: var(--punica-color-text);\n}\n:host([color='neutral']) {\n --_accent: var(--punica-color-neutral-dark);\n --_background: var(--punica-color-neutral-light);\n --_text: var(--punica-color-text);\n}\n\n:host([variant='outlined']) {\n --_background: var(--punica-color-surface);\n --_text: var(--punica-color-text);\n border-color: var(--_accent);\n}\n:host([variant='filled']) {\n --_background: var(--_accent);\n --_text: var(--punica-color-on-accent);\n --_icon: var(--punica-color-on-accent);\n}\n\n.icon {\n display: inline-flex;\n flex: none;\n align-items: center;\n /* One line of the message tall, so the icon sits on the first line. */\n block-size: calc(var(--punica-font-size-sm) * var(--punica-line-height));\n color: var(--_icon);\n font-size: var(--punica-font-size-xl);\n}\n\n.default {\n display: none;\n}\n.info {\n display: inline-flex;\n}\n:host([color='success']) .info,\n:host([color='warning']) .info,\n:host([color='error']) .info {\n display: none;\n}\n:host([color='success']) .success,\n:host([color='warning']) .warning,\n:host([color='error']) .error {\n display: inline-flex;\n}\n\n.content {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\n.actions {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--punica-space-8);\n /* A small button centred on the message's first line, like the icon. */\n margin-block: calc((var(--punica-font-size-sm) * var(--punica-line-height) - var(--punica-size-sm)) / 2);\n}\n\n.close {\n all: unset;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-24);\n block-size: var(--punica-space-24);\n margin-block: calc(var(--punica-space-2) * -1);\n border-radius: var(--punica-radius-sm);\n font-size: var(--punica-font-size-lg);\n cursor: pointer;\n transition: background-color var(--punica-duration) var(--punica-ease);\n}\n.close[hidden] {\n display: none;\n}\n.close:hover {\n background: color-mix(in srgb, currentColor 14%, transparent);\n}\n.close:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n:host([variant='filled']) .close:focus-visible {\n outline-color: currentColor;\n}\n\n@media (forced-colors: active) {\n :host {\n border-color: CanvasText;\n }\n /* An SVG's stroke keeps its colour in forced colours: a filled alert's\n on-accent icon would be drawn in the canvas colour. */\n .icon {\n color: CanvasText;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/alert/alert.js
|
|
13
|
+
var PunicaAlert = class extends PunicaElement {
|
|
14
|
+
static properties = {
|
|
15
|
+
color: {},
|
|
16
|
+
variant: {},
|
|
17
|
+
dismissible: { type: Boolean },
|
|
18
|
+
labelClose: { default: "Close" }
|
|
19
|
+
};
|
|
20
|
+
static styles = alert_default;
|
|
21
|
+
static template = `
|
|
22
|
+
<span class="icon"><slot name="icon"><span class="default info">${icons.info}</span><span class="default success">${icons.success}</span><span class="default warning">${icons.warning}</span><span class="default error">${icons.error}</span></slot></span>
|
|
23
|
+
<div part="content" class="content"><slot></slot></div>
|
|
24
|
+
<div part="actions" class="actions"><slot name="actions"></slot></div>
|
|
25
|
+
<button part="close" class="close" type="button" hidden>${icons.close}</button>
|
|
26
|
+
`;
|
|
27
|
+
#close = this.$(".close");
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.#close.addEventListener("click", () => this.dismiss());
|
|
31
|
+
}
|
|
32
|
+
update() {
|
|
33
|
+
this.internals.role = this.color === "error" || this.color === "warning" ? "alert" : "status";
|
|
34
|
+
this.#close.hidden = !this.dismissible;
|
|
35
|
+
this.#close.setAttribute("aria-label", this.labelClose ?? "");
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Does what the close button does: fires `punica-dismiss` and, unless a
|
|
39
|
+
* listener prevents it, hides the alert.
|
|
40
|
+
*/
|
|
41
|
+
dismiss() {
|
|
42
|
+
if (!this.emit("dismiss", {}, { cancelable: true }).defaultPrevented) this.hidden = true;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
define("punica-alert", PunicaAlert);
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
alert_default,
|
|
49
|
+
PunicaAlert
|
|
50
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/chat/chatSystemMessage.css
|
|
7
|
+
var chatSystemMessage_default = ":host {\n --punica-chat-system-message-color: var(--punica-color-text-muted);\n --punica-chat-system-message-background: transparent;\n --punica-chat-system-message-line-color: var(--punica-color-border);\n\n display: block;\n}\n\n:host([color='primary']) {\n --punica-chat-system-message-color: var(--punica-color-primary-dark);\n --punica-chat-system-message-background: color-mix(in srgb, var(--punica-color-primary) 12%, transparent);\n}\n:host([color='secondary']) {\n --punica-chat-system-message-color: var(--punica-color-secondary-dark);\n --punica-chat-system-message-background: color-mix(in srgb, var(--punica-color-secondary) 12%, transparent);\n}\n:host([color='error']) {\n --punica-chat-system-message-color: var(--punica-color-error-dark);\n --punica-chat-system-message-background: var(--punica-color-error-light);\n}\n:host([color='warning']) {\n --punica-chat-system-message-color: var(--punica-color-warning-dark);\n --punica-chat-system-message-background: var(--punica-color-warning-light);\n}\n:host([color='info']) {\n --punica-chat-system-message-color: var(--punica-color-info-dark);\n --punica-chat-system-message-background: var(--punica-color-info-light);\n}\n:host([color='success']) {\n --punica-chat-system-message-color: var(--punica-color-success-dark);\n --punica-chat-system-message-background: var(--punica-color-success-light);\n}\n\n.base {\n display: flex;\n align-items: center;\n gap: var(--punica-space-12);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n line-height: var(--punica-line-height);\n}\n\n.base::before,\n.base::after {\n content: '';\n flex: 1 1 0;\n border-block-start: var(--punica-border-width) solid var(--punica-chat-system-message-line-color);\n}\n\n.label {\n display: inline-flex;\n align-items: center;\n gap: var(--punica-space-6);\n max-inline-size: 80%;\n padding: var(--punica-space-2) var(--punica-space-10);\n border-radius: var(--punica-radius-full);\n background: var(--punica-chat-system-message-background);\n color: var(--punica-chat-system-message-color);\n text-align: center;\n}\n\n@media (forced-colors: active) {\n .label {\n border: var(--punica-border-width) solid CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/chat/chatSystemMessage.js
|
|
10
|
+
var PunicaChatSystemMessage = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
color: {}
|
|
13
|
+
};
|
|
14
|
+
static styles = chatSystemMessage_default;
|
|
15
|
+
static template = `
|
|
16
|
+
<div part="base" class="base">
|
|
17
|
+
<span part="label" class="label"><slot name="icon"></slot><slot></slot></span>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
connected() {
|
|
21
|
+
this.internals.role = "note";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
define("punica-chat-system-message", PunicaChatSystemMessage);
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
PunicaChatSystemMessage
|
|
28
|
+
};
|
|
@@ -0,0 +1,285 @@
|
|
|
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/numberInput/numberInput.css
|
|
13
|
+
var numberInput_default = ":host {\n --punica-number-input-height: var(--punica-size-md);\n --punica-number-input-padding: var(--punica-space-12);\n --punica-number-input-radius: var(--punica-radius);\n --punica-number-input-border-color: var(--punica-color-border);\n --punica-number-input-background: var(--punica-color-surface);\n --punica-number-input-color: var(--punica-color-text);\n\n display: inline-flex;\n vertical-align: middle;\n inline-size: var(--punica-space-160);\n}\n\n:host([size='small']) {\n --punica-number-input-height: var(--punica-size-sm);\n --punica-number-input-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-number-input-height: var(--punica-size-lg);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n.base {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--punica-space-8);\n min-inline-size: 0;\n min-block-size: var(--punica-number-input-height);\n padding-inline-start: var(--punica-number-input-padding);\n border: var(--punica-border-width) solid var(--punica-number-input-border-color);\n border-radius: var(--punica-number-input-radius);\n background: var(--punica-number-input-background);\n color: var(--punica-number-input-color);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n overflow: hidden;\n transition: border-color var(--punica-duration) var(--punica-ease);\n}\n\n.base:hover {\n border-color: var(--punica-color-border-strong);\n}\n.base:focus-within {\n border-color: var(--punica-color-primary);\n}\n.base:has(input:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-border-width));\n}\n:host(:state(user-invalid)) .base {\n border-color: var(--punica-color-error);\n}\n\ninput {\n flex: 1;\n inline-size: 100%;\n min-inline-size: 0;\n margin: 0;\n padding: 0;\n border: 0;\n outline: none;\n background: none;\n color: inherit;\n font: inherit;\n font-variant-numeric: tabular-nums;\n text-align: inherit;\n -webkit-tap-highlight-color: transparent;\n}\ninput::placeholder {\n color: var(--punica-color-text-placeholder);\n opacity: 1;\n}\n\n.steppers {\n display: flex;\n flex: none;\n align-self: stretch;\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-space-28);\n border-inline-start: var(--punica-border-width) solid var(--punica-number-input-border-color);\n color: var(--punica-color-text);\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\nbutton:hover {\n background: var(--punica-color-hover);\n}\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\nbutton:disabled {\n cursor: default;\n background: none;\n opacity: var(--punica-disabled-opacity);\n}\n\n:host([disabled]) .base,\n:host(:state(disabled)) .base {\n opacity: var(--punica-disabled-opacity);\n}\n:host([disabled]) button:disabled,\n:host(:state(disabled)) button:disabled {\n opacity: 1;\n}\n\n::slotted(*) {\n flex: none;\n}\n\n@media (forced-colors: active) {\n .base,\n button {\n border-color: FieldText;\n }\n .base:focus-within {\n border-color: Highlight;\n }\n button:disabled {\n color: GrayText;\n opacity: 1;\n }\n :host([disabled]) .base,\n :host(:state(disabled)) .base {\n border-color: GrayText;\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
14
|
+
|
|
15
|
+
// src/components/numberInput/numberInput.js
|
|
16
|
+
var setAttr = (el, name, value) => {
|
|
17
|
+
if (value == null || value === false) el.removeAttribute(name);
|
|
18
|
+
else el.setAttribute(name, value === true ? "" : String(value));
|
|
19
|
+
};
|
|
20
|
+
var flagsOf = (validity) => {
|
|
21
|
+
const flags = {};
|
|
22
|
+
for (const key in validity) if (key !== "valid" && validity[key]) flags[key] = true;
|
|
23
|
+
return flags;
|
|
24
|
+
};
|
|
25
|
+
var decimals = (n) => {
|
|
26
|
+
const text = String(n);
|
|
27
|
+
if (text.includes("e-")) return Number(text.split("e-")[1]);
|
|
28
|
+
return text.includes(".") ? text.split(".")[1].length : 0;
|
|
29
|
+
};
|
|
30
|
+
var PunicaNumberInput = class extends FormControl(PunicaElement) {
|
|
31
|
+
static properties = {
|
|
32
|
+
value: { type: Number, reflect: false },
|
|
33
|
+
min: { type: Number },
|
|
34
|
+
max: { type: Number },
|
|
35
|
+
step: { type: Number, default: 1 },
|
|
36
|
+
label: {},
|
|
37
|
+
placeholder: {},
|
|
38
|
+
readonly: { type: Boolean },
|
|
39
|
+
labelIncrement: { default: "Increase" },
|
|
40
|
+
labelDecrement: { default: "Decrease" },
|
|
41
|
+
size: {},
|
|
42
|
+
fullWidth: { type: Boolean },
|
|
43
|
+
formatOptions: { type: Object, attribute: false }
|
|
44
|
+
};
|
|
45
|
+
static styles = numberInput_default;
|
|
46
|
+
static shadowOptions = { delegatesFocus: true };
|
|
47
|
+
static template = `
|
|
48
|
+
<div part="base" class="base">
|
|
49
|
+
<slot name="start"></slot>
|
|
50
|
+
<input part="input" type="text" inputmode="decimal" role="spinbutton" autocomplete="off" />
|
|
51
|
+
<slot name="end"></slot>
|
|
52
|
+
<span part="steppers" class="steppers">
|
|
53
|
+
<button part="decrement" class="decrement" type="button" tabindex="-1">${icons.minus}</button>
|
|
54
|
+
<button part="increment" class="increment" type="button" tabindex="-1">${icons.plus}</button>
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
#input = this.$("input");
|
|
59
|
+
#touched = false;
|
|
60
|
+
/** Value when the field took focus, to tell whether the visit changed it. */
|
|
61
|
+
#committed = null;
|
|
62
|
+
constructor() {
|
|
63
|
+
super();
|
|
64
|
+
const input = this.#input;
|
|
65
|
+
input.addEventListener("input", () => {
|
|
66
|
+
const value = this.#parse(input.value);
|
|
67
|
+
if (value === this.value) return;
|
|
68
|
+
this.value = value;
|
|
69
|
+
this.emit("input", { value });
|
|
70
|
+
});
|
|
71
|
+
input.addEventListener("focus", () => {
|
|
72
|
+
this.#committed = this.value;
|
|
73
|
+
const text = this.#format(this.value, true);
|
|
74
|
+
if (input.value !== text) input.value = text;
|
|
75
|
+
});
|
|
76
|
+
input.addEventListener("blur", () => {
|
|
77
|
+
this.#commit();
|
|
78
|
+
this.#touched = true;
|
|
79
|
+
this.update(/* @__PURE__ */ new Map());
|
|
80
|
+
});
|
|
81
|
+
input.addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
82
|
+
this.addEventListener("invalid", () => {
|
|
83
|
+
this.#touched = true;
|
|
84
|
+
this.toggleState("user-invalid", true);
|
|
85
|
+
});
|
|
86
|
+
this.$(".increment").addEventListener("click", () => this.#press(1));
|
|
87
|
+
this.$(".decrement").addEventListener("click", () => this.#press(-1));
|
|
88
|
+
this.$(".steppers").addEventListener("mousedown", (event) => event.preventDefault());
|
|
89
|
+
}
|
|
90
|
+
update() {
|
|
91
|
+
const input = this.#input;
|
|
92
|
+
const value = this.value;
|
|
93
|
+
setAttr(input, "placeholder", this.placeholder);
|
|
94
|
+
setAttr(input, "aria-label", this.#name());
|
|
95
|
+
setAttr(input, "aria-valuenow", value);
|
|
96
|
+
setAttr(input, "aria-valuemin", this.min);
|
|
97
|
+
setAttr(input, "aria-valuemax", this.max);
|
|
98
|
+
input.readOnly = this.readonly;
|
|
99
|
+
input.required = this.required;
|
|
100
|
+
input.disabled = this.isDisabled;
|
|
101
|
+
this.#show();
|
|
102
|
+
const locked = this.isDisabled || this.readonly;
|
|
103
|
+
const up = this.$(".increment");
|
|
104
|
+
const down = this.$(".decrement");
|
|
105
|
+
setAttr(up, "aria-label", this.labelIncrement);
|
|
106
|
+
setAttr(down, "aria-label", this.labelDecrement);
|
|
107
|
+
up.disabled = locked || value != null && this.max != null && value >= this.max;
|
|
108
|
+
down.disabled = locked || value != null && this.min != null && value <= this.min;
|
|
109
|
+
this.setFormValue(value == null ? "" : String(value));
|
|
110
|
+
this.setValidity(value == null ? flagsOf(input.validity) : {}, input.validationMessage, input);
|
|
111
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
112
|
+
}
|
|
113
|
+
formReset() {
|
|
114
|
+
this.#touched = false;
|
|
115
|
+
const attr = this.getAttribute("value");
|
|
116
|
+
const n = attr === null || attr.trim() === "" ? NaN : Number(attr);
|
|
117
|
+
this.value = Number.isNaN(n) ? null : n;
|
|
118
|
+
this.requestUpdate();
|
|
119
|
+
}
|
|
120
|
+
formRestore(state) {
|
|
121
|
+
if (typeof state === "string") this.value = state === "" ? null : Number(state);
|
|
122
|
+
}
|
|
123
|
+
/** Moves focus to the field. */
|
|
124
|
+
focus(options) {
|
|
125
|
+
this.#input.focus(options);
|
|
126
|
+
}
|
|
127
|
+
/** Selects all the text in the field. */
|
|
128
|
+
select() {
|
|
129
|
+
this.#input.select();
|
|
130
|
+
}
|
|
131
|
+
/** Raises the value by `n` steps, 1 by default. Fires nothing. */
|
|
132
|
+
stepUp(n = 1) {
|
|
133
|
+
this.value = this.#stepped(n);
|
|
134
|
+
}
|
|
135
|
+
/** Lowers the value by `n` steps, 1 by default. Fires nothing. */
|
|
136
|
+
stepDown(n = 1) {
|
|
137
|
+
this.value = this.#stepped(-n);
|
|
138
|
+
}
|
|
139
|
+
#name() {
|
|
140
|
+
if (this.label) return this.label;
|
|
141
|
+
const text = [...this.labels].map((l) => l.textContent.trim()).filter(Boolean);
|
|
142
|
+
return text.length ? text.join(" ") : null;
|
|
143
|
+
}
|
|
144
|
+
#lang() {
|
|
145
|
+
return this.closest("[lang]")?.lang || navigator.language;
|
|
146
|
+
}
|
|
147
|
+
/** The decimal and group separators of the element's language. */
|
|
148
|
+
#separators() {
|
|
149
|
+
let parts;
|
|
150
|
+
try {
|
|
151
|
+
parts = new Intl.NumberFormat(this.#lang()).formatToParts(12345.6);
|
|
152
|
+
} catch {
|
|
153
|
+
parts = new Intl.NumberFormat().formatToParts(12345.6);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
decimal: parts.find((p) => p.type === "decimal")?.value || ".",
|
|
157
|
+
group: parts.find((p) => p.type === "group")?.value || ""
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** @returns {number | null} */
|
|
161
|
+
#parse(text) {
|
|
162
|
+
const { decimal, group } = this.#separators();
|
|
163
|
+
let plain = text.trim().replace(/[\s\u00a0\u202f]/g, "");
|
|
164
|
+
if (group) plain = plain.split(group).join("");
|
|
165
|
+
if (decimal !== ".") plain = plain.split(decimal).join(".");
|
|
166
|
+
plain = plain.replace(/^\u2212/, "-");
|
|
167
|
+
if (!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(plain)) return null;
|
|
168
|
+
return Number(plain);
|
|
169
|
+
}
|
|
170
|
+
#format(value, editing) {
|
|
171
|
+
if (value == null) return "";
|
|
172
|
+
if (editing) {
|
|
173
|
+
const { decimal } = this.#separators();
|
|
174
|
+
const text = String(value);
|
|
175
|
+
return /e/i.test(text) ? text : text.replace(".", decimal);
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
return new Intl.NumberFormat(this.#lang(), {
|
|
179
|
+
maximumFractionDigits: 20,
|
|
180
|
+
...this.formatOptions || {}
|
|
181
|
+
}).format(value);
|
|
182
|
+
} catch {
|
|
183
|
+
return String(value);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** Writes the value into the input, unless the input already says it. */
|
|
187
|
+
#show() {
|
|
188
|
+
const input = this.#input;
|
|
189
|
+
const focused = this.shadowRoot.activeElement === input;
|
|
190
|
+
if (focused) {
|
|
191
|
+
if (this.#parse(input.value) !== this.value) input.value = this.#format(this.value, true);
|
|
192
|
+
} else {
|
|
193
|
+
const text = this.#format(this.value, false);
|
|
194
|
+
if (input.value !== text) input.value = text;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
#clamp(value) {
|
|
198
|
+
if (this.min != null && value < this.min) value = this.min;
|
|
199
|
+
if (this.max != null && value > this.max) value = this.max;
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
/** The value `n` steps away, on the step grid that starts at `min`. */
|
|
203
|
+
#stepped(n) {
|
|
204
|
+
const step = this.step > 0 ? this.step : 1;
|
|
205
|
+
const base = this.min ?? 0;
|
|
206
|
+
const current = this.value ?? this.#clamp(0);
|
|
207
|
+
const places = Math.max(decimals(step), decimals(base), decimals(current));
|
|
208
|
+
const ratio = Number(((current - base) / step).toFixed(8));
|
|
209
|
+
const index = Number.isInteger(ratio) ? ratio + n : n > 0 ? Math.floor(ratio) + n : Math.ceil(ratio) + n;
|
|
210
|
+
return this.#clamp(Number((base + index * step).toFixed(places)));
|
|
211
|
+
}
|
|
212
|
+
/** Takes a number from the user: sets it and fires both events. */
|
|
213
|
+
#set(value) {
|
|
214
|
+
if (value === this.value) return;
|
|
215
|
+
this.value = value;
|
|
216
|
+
this.#committed = value;
|
|
217
|
+
this.#input.value = this.#format(value, this.shadowRoot.activeElement === this.#input);
|
|
218
|
+
this.update(/* @__PURE__ */ new Map());
|
|
219
|
+
this.emit("input", { value });
|
|
220
|
+
this.emit("change", { value });
|
|
221
|
+
}
|
|
222
|
+
/** The end of an edit: clamp, drop what is not a number, say what changed. */
|
|
223
|
+
#commit() {
|
|
224
|
+
const before = this.value;
|
|
225
|
+
if (before != null) {
|
|
226
|
+
const clamped = this.#clamp(before);
|
|
227
|
+
if (clamped !== before) {
|
|
228
|
+
this.value = clamped;
|
|
229
|
+
this.emit("input", { value: clamped });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (this.value !== this.#committed) {
|
|
233
|
+
this.#committed = this.value;
|
|
234
|
+
this.update(/* @__PURE__ */ new Map());
|
|
235
|
+
this.emit("change", { value: this.value });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
#press(direction) {
|
|
239
|
+
if (this.isDisabled || this.readonly) return;
|
|
240
|
+
this.#input.focus();
|
|
241
|
+
this.#set(this.#stepped(direction));
|
|
242
|
+
}
|
|
243
|
+
#onKeydown(event) {
|
|
244
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
245
|
+
if (event.key === "Enter" && !event.isComposing) {
|
|
246
|
+
this.#commit();
|
|
247
|
+
this.#input.value = this.#format(this.value, true);
|
|
248
|
+
this.form?.requestSubmit();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (this.readonly) return;
|
|
252
|
+
let next;
|
|
253
|
+
switch (event.key) {
|
|
254
|
+
case "ArrowUp":
|
|
255
|
+
next = this.#stepped(1);
|
|
256
|
+
break;
|
|
257
|
+
case "ArrowDown":
|
|
258
|
+
next = this.#stepped(-1);
|
|
259
|
+
break;
|
|
260
|
+
case "PageUp":
|
|
261
|
+
next = this.#stepped(10);
|
|
262
|
+
break;
|
|
263
|
+
case "PageDown":
|
|
264
|
+
next = this.#stepped(-10);
|
|
265
|
+
break;
|
|
266
|
+
case "Home":
|
|
267
|
+
if (this.min == null) return;
|
|
268
|
+
next = this.min;
|
|
269
|
+
break;
|
|
270
|
+
case "End":
|
|
271
|
+
if (this.max == null) return;
|
|
272
|
+
next = this.max;
|
|
273
|
+
break;
|
|
274
|
+
default:
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
event.preventDefault();
|
|
278
|
+
this.#set(next);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
define("punica-number-input", PunicaNumberInput);
|
|
282
|
+
|
|
283
|
+
export {
|
|
284
|
+
PunicaNumberInput
|
|
285
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/carousel/carouselItem.css
|
|
7
|
+
var carouselItem_default = ":host {\n display: block;\n min-inline-size: 0;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.base {\n block-size: 100%;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/carousel/carouselItem.js
|
|
10
|
+
var PunicaCarouselItem = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
label: {},
|
|
13
|
+
active: { type: Boolean },
|
|
14
|
+
positionLabel: { attribute: false },
|
|
15
|
+
roledescription: { attribute: false }
|
|
16
|
+
};
|
|
17
|
+
static styles = carouselItem_default;
|
|
18
|
+
static template = `<div part="base" class="base"><slot></slot></div>`;
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.internals.role = "group";
|
|
22
|
+
}
|
|
23
|
+
update() {
|
|
24
|
+
this.internals.ariaLabel = this.label || this.positionLabel || null;
|
|
25
|
+
this.internals.ariaRoleDescription = this.roledescription || null;
|
|
26
|
+
this.toggleState("active", this.active);
|
|
27
|
+
this.inert = this.parentElement?.localName === "punica-carousel" && !this.active;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
define("punica-carousel-item", PunicaCarouselItem);
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
PunicaCarouselItem
|
|
34
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/button/button.css
|
|
10
|
+
var button_default = ":host {\n --_accent: var(--punica-color-primary);\n --_accent-strong: var(--punica-color-primary-dark);\n --_accent-tint: color-mix(in srgb, var(--_accent) 12%, transparent);\n --punica-button-radius: var(--punica-radius);\n --punica-button-height: var(--punica-size-md);\n --punica-button-padding: var(--punica-space-16);\n\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([color='secondary']) {\n --_accent: var(--punica-color-secondary);\n --_accent-strong: var(--punica-color-secondary-dark);\n}\n:host([color='error']) {\n --_accent: var(--punica-color-error);\n --_accent-strong: var(--punica-color-error-dark);\n}\n:host([color='warning']) {\n --_accent: var(--punica-color-warning);\n --_accent-strong: var(--punica-color-warning-dark);\n}\n:host([color='info']) {\n --_accent: var(--punica-color-info);\n --_accent-strong: var(--punica-color-info-dark);\n}\n:host([color='success']) {\n --_accent: var(--punica-color-success);\n --_accent-strong: var(--punica-color-success-dark);\n}\n:host([color='neutral']) {\n --_accent: var(--punica-color-text);\n --_accent-strong: var(--punica-color-text);\n}\n\n:host([size='small']) {\n --punica-button-height: var(--punica-size-sm);\n --punica-button-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-button-height: var(--punica-size-lg);\n --punica-button-padding: var(--punica-space-28);\n}\n\n:host([pill]) {\n --punica-button-radius: var(--punica-radius-full);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\nbutton {\n all: unset;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--punica-space-6);\n box-sizing: border-box;\n inline-size: 100%;\n min-block-size: var(--punica-button-height);\n padding-inline: var(--punica-button-padding);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-button-radius);\n font: inherit;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n background: var(--_accent);\n color: var(--punica-color-on-accent);\n transition: background-color var(--punica-duration) var(--punica-ease),\n border-color var(--punica-duration) var(--punica-ease),\n color var(--punica-duration) var(--punica-ease);\n}\n\nbutton:hover {\n background: var(--_accent-strong);\n}\n\n:host([variant='outlined']) button {\n background: transparent;\n border-color: var(--_accent);\n color: var(--_accent);\n}\n:host([variant='text']) button {\n background: transparent;\n color: var(--_accent);\n}\n:host([variant='outlined']) button:hover,\n:host([variant='text']) button:hover {\n background: var(--_accent-tint);\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton:disabled {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n:host([loading]) button {\n cursor: progress;\n}\n:host([loading]) .label,\n:host([loading]) ::slotted(*) {\n visibility: hidden;\n}\n\n.label {\n display: inline-flex;\n align-items: center;\n}\n\n.spinner {\n display: none;\n position: absolute;\n inset: 0;\n margin: auto;\n inline-size: 1em;\n block-size: 1em;\n border: 2px solid currentColor;\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: spin 700ms linear infinite;\n}\n:host([loading]) .spinner {\n display: block;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 2s;\n }\n}\n\n@media (forced-colors: active) {\n button {\n border-color: ButtonText;\n }\n button:disabled {\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/button/button.js
|
|
13
|
+
var FORWARDED = [
|
|
14
|
+
["ariaExpanded", "aria-expanded"],
|
|
15
|
+
["ariaHasPopup", "aria-haspopup"],
|
|
16
|
+
["ariaPressed", "aria-pressed"],
|
|
17
|
+
["ariaDescription", "aria-description"]
|
|
18
|
+
];
|
|
19
|
+
var PunicaButton = class extends FormControl(PunicaElement) {
|
|
20
|
+
static properties = {
|
|
21
|
+
variant: {},
|
|
22
|
+
color: {},
|
|
23
|
+
size: {},
|
|
24
|
+
type: { default: "button" },
|
|
25
|
+
loading: { type: Boolean },
|
|
26
|
+
pill: { type: Boolean },
|
|
27
|
+
fullWidth: { type: Boolean },
|
|
28
|
+
value: {},
|
|
29
|
+
label: {},
|
|
30
|
+
// ARIA a wrapper (a popover, a menu) writes on the host is passed to
|
|
31
|
+
// the native button, which is what assistive technology reads.
|
|
32
|
+
ariaExpanded: { attribute: "aria-expanded", reflect: false },
|
|
33
|
+
ariaHasPopup: { attribute: "aria-haspopup", reflect: false },
|
|
34
|
+
ariaControls: { attribute: "aria-controls", reflect: false },
|
|
35
|
+
ariaPressed: { attribute: "aria-pressed", reflect: false },
|
|
36
|
+
ariaDescription: { attribute: "aria-description", reflect: false }
|
|
37
|
+
};
|
|
38
|
+
static styles = button_default;
|
|
39
|
+
static shadowOptions = { delegatesFocus: true };
|
|
40
|
+
static template = `
|
|
41
|
+
<button part="base" type="button">
|
|
42
|
+
<slot name="start"></slot>
|
|
43
|
+
<span part="label" class="label"><slot></slot></span>
|
|
44
|
+
<slot name="end"></slot>
|
|
45
|
+
<span part="spinner" class="spinner" aria-hidden="true"></span>
|
|
46
|
+
</button>
|
|
47
|
+
`;
|
|
48
|
+
#button = this.$("button");
|
|
49
|
+
constructor() {
|
|
50
|
+
super();
|
|
51
|
+
this.#button.addEventListener("click", (event) => this.#onClick(event));
|
|
52
|
+
this.addEventListener(
|
|
53
|
+
"click",
|
|
54
|
+
(event) => {
|
|
55
|
+
if (this.isDisabled || this.loading) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
event.stopImmediatePropagation();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{ capture: true }
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
update() {
|
|
64
|
+
const button = this.#button;
|
|
65
|
+
button.disabled = this.isDisabled;
|
|
66
|
+
button.setAttribute("aria-busy", String(this.loading));
|
|
67
|
+
if (this.loading) button.setAttribute("aria-disabled", "true");
|
|
68
|
+
else button.removeAttribute("aria-disabled");
|
|
69
|
+
if (this.label) button.setAttribute("aria-label", this.label);
|
|
70
|
+
else button.removeAttribute("aria-label");
|
|
71
|
+
for (const [prop, attribute] of FORWARDED) {
|
|
72
|
+
if (this[prop] == null) button.removeAttribute(attribute);
|
|
73
|
+
else button.setAttribute(attribute, this[prop]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Moves focus to the button. */
|
|
77
|
+
focus(options) {
|
|
78
|
+
this.#button.focus(options);
|
|
79
|
+
}
|
|
80
|
+
/** Clicks the button the way a user would. */
|
|
81
|
+
click() {
|
|
82
|
+
this.#button.click();
|
|
83
|
+
}
|
|
84
|
+
#onClick() {
|
|
85
|
+
if (this.isDisabled || this.loading) return;
|
|
86
|
+
if (this.type === "submit") {
|
|
87
|
+
this.internals.setFormValue(this.value ?? "");
|
|
88
|
+
this.formAction("submit");
|
|
89
|
+
this.internals.setFormValue(null);
|
|
90
|
+
} else if (this.type === "reset") {
|
|
91
|
+
this.formAction("reset");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
define("punica-button", PunicaButton);
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
PunicaButton
|
|
99
|
+
};
|