@punica/components 0.0.0-stage → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +139 -2
- package/bin/punica-components.mjs +138 -0
- package/custom-elements.json +38745 -0
- package/dist/ai/index.d.ts +39 -0
- package/dist/ai/index.mjs +615 -0
- package/dist/ai/node.d.ts +5 -0
- package/dist/ai/node.mjs +625 -0
- package/dist/esm/chunks/chunk-25RFU6B5.js +25 -0
- package/dist/esm/chunks/chunk-2EK3PZFT.js +179 -0
- package/dist/esm/chunks/chunk-2KBDCVUH.js +20 -0
- package/dist/esm/chunks/chunk-2NCRRDPI.js +151 -0
- package/dist/esm/chunks/chunk-33GO7Z32.js +40 -0
- package/dist/esm/chunks/chunk-36BKRO3B.js +281 -0
- package/dist/esm/chunks/chunk-3DWJAU5S.js +607 -0
- package/dist/esm/chunks/chunk-3GOFXBR7.js +61 -0
- package/dist/esm/chunks/chunk-3H5QEUFO.js +21 -0
- package/dist/esm/chunks/chunk-3NHCLXYC.js +6 -0
- package/dist/esm/chunks/chunk-3NQ2RVWE.js +36 -0
- package/dist/esm/chunks/chunk-3SYFLID6.js +20 -0
- package/dist/esm/chunks/chunk-3TK5BG5K.js +322 -0
- package/dist/esm/chunks/chunk-3WLKVJO4.js +36 -0
- package/dist/esm/chunks/chunk-427DCAZS.js +49 -0
- package/dist/esm/chunks/chunk-4446KGJH.js +67 -0
- package/dist/esm/chunks/chunk-45UR4HAQ.js +128 -0
- package/dist/esm/chunks/chunk-46P3CPXM.js +81 -0
- package/dist/esm/chunks/chunk-4C3AUANN.js +271 -0
- package/dist/esm/chunks/chunk-4RURT4SK.js +142 -0
- package/dist/esm/chunks/chunk-4XJKCJQG.js +166 -0
- package/dist/esm/chunks/chunk-5PKJV3JP.js +61 -0
- package/dist/esm/chunks/chunk-5SSKNOUZ.js +141 -0
- package/dist/esm/chunks/chunk-5XB5CUJU.js +18 -0
- package/dist/esm/chunks/chunk-5XQX7D2B.js +27 -0
- package/dist/esm/chunks/chunk-6A5Q3TR2.js +73 -0
- package/dist/esm/chunks/chunk-6HE2DQS5.js +29 -0
- package/dist/esm/chunks/chunk-6IWDX7AR.js +32 -0
- package/dist/esm/chunks/chunk-6LO2ITXI.js +138 -0
- package/dist/esm/chunks/chunk-6NSNMUZE.js +36 -0
- package/dist/esm/chunks/chunk-6UQOC4YG.js +61 -0
- package/dist/esm/chunks/chunk-72ANEBJJ.js +138 -0
- package/dist/esm/chunks/chunk-7JTOYPC7.js +24 -0
- package/dist/esm/chunks/chunk-7O3D52ZO.js +27 -0
- package/dist/esm/chunks/chunk-7UN7TAOI.js +39 -0
- package/dist/esm/chunks/chunk-7WEISIJL.js +123 -0
- package/dist/esm/chunks/chunk-7YAUHJR2.js +225 -0
- package/dist/esm/chunks/chunk-7ZT7WUEL.js +35 -0
- package/dist/esm/chunks/chunk-ALU2KZWS.js +177 -0
- package/dist/esm/chunks/chunk-AMVMOCUW.js +81 -0
- package/dist/esm/chunks/chunk-APPQS53K.js +81 -0
- package/dist/esm/chunks/chunk-AVTATVAG.js +410 -0
- package/dist/esm/chunks/chunk-AZMUP33Z.js +56 -0
- package/dist/esm/chunks/chunk-B32J3O2V.js +21 -0
- package/dist/esm/chunks/chunk-B7YCX5VB.js +38 -0
- package/dist/esm/chunks/chunk-BBSDD7DS.js +55 -0
- package/dist/esm/chunks/chunk-BC657356.js +93 -0
- package/dist/esm/chunks/chunk-BFRWXGP4.js +44 -0
- package/dist/esm/chunks/chunk-BYZADSVQ.js +49 -0
- package/dist/esm/chunks/chunk-CDXX27FL.js +28 -0
- package/dist/esm/chunks/chunk-CKI34FQL.js +166 -0
- package/dist/esm/chunks/chunk-CNT47W5N.js +60 -0
- package/dist/esm/chunks/chunk-CU3RW3AS.js +515 -0
- package/dist/esm/chunks/chunk-CZ3R7GRW.js +73 -0
- package/dist/esm/chunks/chunk-DLEJ74RA.js +18 -0
- package/dist/esm/chunks/chunk-DPOPZQ7A.js +150 -0
- package/dist/esm/chunks/chunk-DYXHKPQU.js +18 -0
- package/dist/esm/chunks/chunk-E3XOZZSK.js +77 -0
- package/dist/esm/chunks/chunk-EJLQD3FS.js +89 -0
- package/dist/esm/chunks/chunk-ELY5HYAI.js +45 -0
- package/dist/esm/chunks/chunk-ELY5NJBV.js +152 -0
- package/dist/esm/chunks/chunk-EWIF3VBH.js +45 -0
- package/dist/esm/chunks/chunk-F2OASWR4.js +79 -0
- package/dist/esm/chunks/chunk-F4ODKLNS.js +62 -0
- package/dist/esm/chunks/chunk-F5HKSUTX.js +127 -0
- package/dist/esm/chunks/chunk-FFH6CIAJ.js +208 -0
- package/dist/esm/chunks/chunk-FFLBSXWE.js +21 -0
- package/dist/esm/chunks/chunk-FNTBMCUQ.js +184 -0
- package/dist/esm/chunks/chunk-FYSNICNC.js +71 -0
- package/dist/esm/chunks/chunk-G2QRQLP5.js +18 -0
- package/dist/esm/chunks/chunk-G36PG2LK.js +27 -0
- package/dist/esm/chunks/chunk-G5LARXMF.js +73 -0
- package/dist/esm/chunks/chunk-GQLNLUQX.js +42 -0
- package/dist/esm/chunks/chunk-GRWYCZQZ.js +73 -0
- package/dist/esm/chunks/chunk-GSXWSHYU.js +304 -0
- package/dist/esm/chunks/chunk-GVH32USX.js +48 -0
- package/dist/esm/chunks/chunk-GW3IYQNO.js +271 -0
- package/dist/esm/chunks/chunk-H4Q2HHZA.js +151 -0
- package/dist/esm/chunks/chunk-HDHVTBGS.js +330 -0
- package/dist/esm/chunks/chunk-HK6DEJO3.js +74 -0
- package/dist/esm/chunks/chunk-HUMTZKOD.js +114 -0
- package/dist/esm/chunks/chunk-HW2CN2JV.js +118 -0
- package/dist/esm/chunks/chunk-I6WGYC6M.js +50 -0
- package/dist/esm/chunks/chunk-ICGI6UOP.js +28 -0
- package/dist/esm/chunks/chunk-IYZKVVEX.js +285 -0
- package/dist/esm/chunks/chunk-J4HTWL4Q.js +34 -0
- package/dist/esm/chunks/chunk-J6FXZP6E.js +99 -0
- package/dist/esm/chunks/chunk-JTIBDZBU.js +392 -0
- package/dist/esm/chunks/chunk-K2OIQJ36.js +23 -0
- package/dist/esm/chunks/chunk-K5D5UHVI.js +99 -0
- package/dist/esm/chunks/chunk-K753LIJX.js +157 -0
- package/dist/esm/chunks/chunk-KV4Y5ZP5.js +105 -0
- package/dist/esm/chunks/chunk-KVWZQINH.js +44 -0
- package/dist/esm/chunks/chunk-LKKKFYM4.js +106 -0
- package/dist/esm/chunks/chunk-LKPOFLSP.js +337 -0
- package/dist/esm/chunks/chunk-LSDTMST7.js +6 -0
- package/dist/esm/chunks/chunk-LUASZ5NH.js +271 -0
- package/dist/esm/chunks/chunk-LUPYODQN.js +54 -0
- package/dist/esm/chunks/chunk-M3HQENQG.js +93 -0
- package/dist/esm/chunks/chunk-MCHPBSW4.js +155 -0
- package/dist/esm/chunks/chunk-MDEV5WIN.js +25 -0
- package/dist/esm/chunks/chunk-MF2ASALV.js +194 -0
- package/dist/esm/chunks/chunk-MIUSZNAX.js +62 -0
- package/dist/esm/chunks/chunk-NINGLTB2.js +194 -0
- package/dist/esm/chunks/chunk-NLFUTVKG.js +158 -0
- package/dist/esm/chunks/chunk-NNCGUKTM.js +44 -0
- package/dist/esm/chunks/chunk-NSCGX5GB.js +408 -0
- package/dist/esm/chunks/chunk-NTIMVMDT.js +51 -0
- package/dist/esm/chunks/chunk-OBUW2HDW.js +99 -0
- package/dist/esm/chunks/chunk-OKRRNW3E.js +202 -0
- package/dist/esm/chunks/chunk-PGWADMK3.js +198 -0
- package/dist/esm/chunks/chunk-PMGKVE2V.js +30 -0
- package/dist/esm/chunks/chunk-PMLVGWVZ.js +80 -0
- package/dist/esm/chunks/chunk-PXECURYJ.js +78 -0
- package/dist/esm/chunks/chunk-Q2766HFS.js +34 -0
- package/dist/esm/chunks/chunk-Q62K7757.js +22 -0
- package/dist/esm/chunks/chunk-Q7JNV3UN.js +192 -0
- package/dist/esm/chunks/chunk-QRJKBLYH.js +43 -0
- package/dist/esm/chunks/chunk-QRZWLIUQ.js +551 -0
- package/dist/esm/chunks/chunk-RKF3ZNBC.js +25 -0
- package/dist/esm/chunks/chunk-RMJM6NWT.js +58 -0
- package/dist/esm/chunks/chunk-ROTG34TD.js +81 -0
- package/dist/esm/chunks/chunk-RQ2NYS2W.js +51 -0
- package/dist/esm/chunks/chunk-RX5HOB7L.js +187 -0
- package/dist/esm/chunks/chunk-RYOY6CGB.js +174 -0
- package/dist/esm/chunks/chunk-S2P6I4PF.js +191 -0
- package/dist/esm/chunks/chunk-SCSGRIQM.js +27 -0
- package/dist/esm/chunks/chunk-SENDWPHS.js +115 -0
- package/dist/esm/chunks/chunk-SFY6NIVM.js +106 -0
- package/dist/esm/chunks/chunk-SHEACXCO.js +67 -0
- package/dist/esm/chunks/chunk-SII4GAN2.js +302 -0
- package/dist/esm/chunks/chunk-SIUUXS2M.js +172 -0
- package/dist/esm/chunks/chunk-SLXOGLX4.js +39 -0
- package/dist/esm/chunks/chunk-ST7UASSS.js +43 -0
- package/dist/esm/chunks/chunk-SUNHM3W2.js +211 -0
- package/dist/esm/chunks/chunk-SWTIN4AS.js +43 -0
- package/dist/esm/chunks/chunk-T2FH4DTZ.js +163 -0
- package/dist/esm/chunks/chunk-TK5H2DLW.js +157 -0
- package/dist/esm/chunks/chunk-U3SSEG6P.js +31 -0
- package/dist/esm/chunks/chunk-UNQEQ3F2.js +118 -0
- package/dist/esm/chunks/chunk-UP3ZQ5S6.js +155 -0
- package/dist/esm/chunks/chunk-UQFS4FAE.js +80 -0
- package/dist/esm/chunks/chunk-UZXXUKV6.js +124 -0
- package/dist/esm/chunks/chunk-VF4NHXZG.js +33 -0
- package/dist/esm/chunks/chunk-VIGFMBQW.js +337 -0
- package/dist/esm/chunks/chunk-VJBXT6L2.js +86 -0
- package/dist/esm/chunks/chunk-VM4IKZDR.js +211 -0
- package/dist/esm/chunks/chunk-VPCWI2SH.js +18 -0
- package/dist/esm/chunks/chunk-VR225VA6.js +29 -0
- package/dist/esm/chunks/chunk-WEGQW4SS.js +285 -0
- package/dist/esm/chunks/chunk-WHXEETCS.js +80 -0
- package/dist/esm/chunks/chunk-X2XT4SYI.js +71 -0
- package/dist/esm/chunks/chunk-X6Y3S66P.js +91 -0
- package/dist/esm/chunks/chunk-XBFOPEHZ.js +86 -0
- package/dist/esm/chunks/chunk-XE74KQOC.js +18 -0
- package/dist/esm/chunks/chunk-XNMQ4SC7.js +95 -0
- package/dist/esm/chunks/chunk-XWPDELI6.js +53 -0
- package/dist/esm/chunks/chunk-XWZPKK2I.js +6 -0
- package/dist/esm/chunks/chunk-XZSAOJUV.js +83 -0
- package/dist/esm/chunks/chunk-Y5BQXWLM.js +58 -0
- package/dist/esm/chunks/chunk-Y5HOTHVK.js +22 -0
- package/dist/esm/chunks/chunk-Y7B65FYJ.js +336 -0
- package/dist/esm/chunks/chunk-YIAEOUGS.js +46 -0
- package/dist/esm/chunks/chunk-YKL6MAIV.js +208 -0
- package/dist/esm/chunks/chunk-YPH3G6P7.js +125 -0
- package/dist/esm/chunks/chunk-YSGWORUD.js +36 -0
- package/dist/esm/chunks/chunk-ZB7DQSJK.js +204 -0
- package/dist/esm/chunks/chunk-ZC7JPIL7.js +182 -0
- package/dist/esm/chunks/chunk-ZGBBW7U4.js +35 -0
- package/dist/esm/chunks/chunk-ZIQREEEI.js +210 -0
- package/dist/esm/chunks/chunk-ZJ3UIJ46.js +30 -0
- package/dist/esm/chunks/chunk-ZK6JTE6K.js +826 -0
- package/dist/esm/chunks/chunk-ZPIJWNFB.js +150 -0
- package/dist/esm/chunks/chunk-ZQVI42RW.js +136 -0
- package/dist/esm/chunks/chunk-ZWP6KATC.js +25 -0
- package/dist/esm/chunks/chunk-ZY5YHMTQ.js +88 -0
- package/dist/esm/components/accordion/accordion.js +8 -0
- package/dist/esm/components/accordion/accordionGroup.js +7 -0
- package/dist/esm/components/agenda/agenda.js +9 -0
- package/dist/esm/components/alert/alert.js +8 -0
- package/dist/esm/components/alertDialog/alertDialog.js +14 -0
- package/dist/esm/components/appBar/appBar.js +7 -0
- package/dist/esm/components/appShell/appShell.js +11 -0
- package/dist/esm/components/aspectRatio/aspectRatio.js +7 -0
- package/dist/esm/components/autocomplete/autocomplete.js +14 -0
- package/dist/esm/components/avatar/avatar.js +7 -0
- package/dist/esm/components/avatarGroup/avatarGroup.js +11 -0
- package/dist/esm/components/badge/badge.js +7 -0
- package/dist/esm/components/banner/banner.js +9 -0
- package/dist/esm/components/blockquote/blockquote.js +7 -0
- package/dist/esm/components/bottomSheet/bottomSheet.js +9 -0
- package/dist/esm/components/box/box.js +7 -0
- package/dist/esm/components/breadcrumbs/breadcrumbItem.js +8 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/esm/components/button/button.js +8 -0
- package/dist/esm/components/buttonGroup/buttonGroup.js +7 -0
- package/dist/esm/components/calendar/calendar.js +12 -0
- package/dist/esm/components/calendar/dates.js +44 -0
- package/dist/esm/components/card/card.js +7 -0
- package/dist/esm/components/card/cardActions.js +7 -0
- package/dist/esm/components/card/cardContent.js +7 -0
- package/dist/esm/components/card/cardHeader.js +7 -0
- package/dist/esm/components/card/cardMedia.js +7 -0
- package/dist/esm/components/carousel/carousel.js +9 -0
- package/dist/esm/components/carousel/carouselItem.js +7 -0
- package/dist/esm/components/center/center.js +7 -0
- package/dist/esm/components/chat/chatComposer.js +9 -0
- package/dist/esm/components/chat/chatDictationButton.js +8 -0
- package/dist/esm/components/chat/chatLayout.js +9 -0
- package/dist/esm/components/chat/chatMessage.js +9 -0
- package/dist/esm/components/chat/chatMessageBubble.js +7 -0
- package/dist/esm/components/chat/chatMessageList.js +8 -0
- package/dist/esm/components/chat/chatMessageMetadata.js +7 -0
- package/dist/esm/components/chat/chatSystemMessage.js +7 -0
- package/dist/esm/components/chat/chatToolCall.js +9 -0
- package/dist/esm/components/chat/chatToolCalls.js +8 -0
- package/dist/esm/components/chat/slots.js +6 -0
- package/dist/esm/components/checkbox/checkbox.js +9 -0
- package/dist/esm/components/checkboxGroup/checkboxGroup.js +10 -0
- package/dist/esm/components/chip/chip.js +8 -0
- package/dist/esm/components/citation/citation.js +11 -0
- package/dist/esm/components/code/code.js +7 -0
- package/dist/esm/components/codeBlock/codeBlock.js +8 -0
- package/dist/esm/components/collapsible/collapsible.js +7 -0
- package/dist/esm/components/commandPalette/commandGroup.js +7 -0
- package/dist/esm/components/commandPalette/commandItem.js +7 -0
- package/dist/esm/components/commandPalette/commandPalette.js +10 -0
- package/dist/esm/components/complexSelector/complexOption.js +9 -0
- package/dist/esm/components/complexSelector/complexSelector.js +16 -0
- package/dist/esm/components/complexSelector/optionGroup.js +7 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/contextMenu/contextMenu.js +12 -0
- package/dist/esm/components/datePicker/datePicker.js +15 -0
- package/dist/esm/components/dateRangeInput/dateRangeInput.js +15 -0
- package/dist/esm/components/dateTimeInput/dateTimeInput.js +18 -0
- package/dist/esm/components/dialog/dialog.js +11 -0
- package/dist/esm/components/dialog/dialogContent.js +7 -0
- package/dist/esm/components/dialog/dialogFooter.js +7 -0
- package/dist/esm/components/dialog/dialogHeader.js +7 -0
- package/dist/esm/components/dialog/modalSurface.js +8 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/drawer/drawer.js +10 -0
- package/dist/esm/components/emptyState/emptyState.js +7 -0
- package/dist/esm/components/field/field.js +7 -0
- package/dist/esm/components/fileInput/fileInput.js +9 -0
- package/dist/esm/components/formLayout/formLayout.js +7 -0
- package/dist/esm/components/grid/col.js +7 -0
- package/dist/esm/components/grid/row.js +7 -0
- package/dist/esm/components/heading/heading.js +7 -0
- package/dist/esm/components/hidden/hidden.js +7 -0
- package/dist/esm/components/hoverCard/hoverCard.js +9 -0
- package/dist/esm/components/icon/icon.js +8 -0
- package/dist/esm/components/iconButton/iconButton.js +8 -0
- package/dist/esm/components/infoTip/infoTip.js +10 -0
- package/dist/esm/components/input/input.js +9 -0
- package/dist/esm/components/inputGroup/inputGroup.js +9 -0
- package/dist/esm/components/inputGroup/inputGroupText.js +7 -0
- package/dist/esm/components/kbd/kbd.js +7 -0
- package/dist/esm/components/lightbox/lightbox.js +10 -0
- package/dist/esm/components/link/link.js +8 -0
- package/dist/esm/components/listView/list.js +7 -0
- package/dist/esm/components/listView/listItem.js +7 -0
- package/dist/esm/components/listbox/listbox.js +9 -0
- package/dist/esm/components/listbox/listboxItem.js +8 -0
- package/dist/esm/components/markdown/markdown.js +9 -0
- package/dist/esm/components/markdown/parser.js +9 -0
- package/dist/esm/components/markdown/url.js +6 -0
- package/dist/esm/components/menu/menu.js +11 -0
- package/dist/esm/components/menu/menuCheckboxItem.js +9 -0
- package/dist/esm/components/menu/menuDivider.js +7 -0
- package/dist/esm/components/menu/menuGroup.js +7 -0
- package/dist/esm/components/menu/menuItem.js +8 -0
- package/dist/esm/components/menu/menuRadioGroup.js +7 -0
- package/dist/esm/components/menu/menuRadioItem.js +9 -0
- package/dist/esm/components/metadataList/metadataList.js +9 -0
- package/dist/esm/components/metadataList/metadataListItem.js +8 -0
- package/dist/esm/components/mobileNav/mobileNav.js +10 -0
- package/dist/esm/components/numberInput/numberInput.js +9 -0
- package/dist/esm/components/outline/outline.js +8 -0
- package/dist/esm/components/overflowList/overflowList.js +11 -0
- package/dist/esm/components/pagination/pagination.js +8 -0
- package/dist/esm/components/paper/paper.js +7 -0
- package/dist/esm/components/popover/popover.js +9 -0
- package/dist/esm/components/powerSearch/powerSearch.js +14 -0
- package/dist/esm/components/progressBar/progressBar.js +7 -0
- package/dist/esm/components/qrCode/qrCode.js +9 -0
- package/dist/esm/components/radio/radio.js +7 -0
- package/dist/esm/components/radio/radioGroup.js +10 -0
- package/dist/esm/components/scrollArea/scrollArea.js +8 -0
- package/dist/esm/components/section/section.js +8 -0
- package/dist/esm/components/segmentedControl/segmentedControl.js +12 -0
- package/dist/esm/components/segmentedControl/segmentedControlItem.js +7 -0
- package/dist/esm/components/select/field.js +18 -0
- package/dist/esm/components/select/option.js +8 -0
- package/dist/esm/components/select/select.js +14 -0
- package/dist/esm/components/selectableCard/selectableCard.js +9 -0
- package/dist/esm/components/selectableCard/selectableCardGroup.js +13 -0
- package/dist/esm/components/sideNav/sideNav.js +9 -0
- package/dist/esm/components/sideNav/sideNavItem.js +9 -0
- package/dist/esm/components/sideNav/sideNavSection.js +8 -0
- package/dist/esm/components/skeleton/skeleton.js +7 -0
- package/dist/esm/components/slider/slider.js +9 -0
- package/dist/esm/components/spinner/spinner.js +7 -0
- package/dist/esm/components/split/split.js +8 -0
- package/dist/esm/components/splitButton/splitButton.js +12 -0
- package/dist/esm/components/stack/stack.js +7 -0
- package/dist/esm/components/statusDot/statusDot.js +7 -0
- package/dist/esm/components/stepper/step.js +8 -0
- package/dist/esm/components/stepper/stepper.js +7 -0
- package/dist/esm/components/switch/switch.js +8 -0
- package/dist/esm/components/tab/tab.js +7 -0
- package/dist/esm/components/tab/tabPanel.js +7 -0
- package/dist/esm/components/tab/tabs.js +8 -0
- package/dist/esm/components/table/table.js +7 -0
- package/dist/esm/components/table/tableBody.js +7 -0
- package/dist/esm/components/table/tableCell.js +7 -0
- package/dist/esm/components/table/tableFooter.js +7 -0
- package/dist/esm/components/table/tableHeader.js +7 -0
- package/dist/esm/components/table/tableHeaderCell.js +8 -0
- package/dist/esm/components/table/tableRow.js +7 -0
- package/dist/esm/components/table/tableSelectionToolbar.js +8 -0
- package/dist/esm/components/text/text.js +7 -0
- package/dist/esm/components/textarea/textarea.js +8 -0
- package/dist/esm/components/thumbnail/thumbnail.js +8 -0
- package/dist/esm/components/timePicker/timePicker.js +15 -0
- package/dist/esm/components/timer/timer.js +7 -0
- package/dist/esm/components/timestamp/timestamp.js +7 -0
- package/dist/esm/components/toast/toast.js +8 -0
- package/dist/esm/components/toast/toaster.js +12 -0
- package/dist/esm/components/toggleButton/toggleButton.js +8 -0
- package/dist/esm/components/toggleButtonGroup/toggleButtonGroup.js +10 -0
- package/dist/esm/components/tokenizer/tokenizer.js +14 -0
- package/dist/esm/components/toolbar/toolbar.js +8 -0
- package/dist/esm/components/tooltip/tooltip.js +9 -0
- package/dist/esm/components/topNav/topNav.js +11 -0
- package/dist/esm/components/topNav/topNavItem.js +11 -0
- package/dist/esm/components/topNav/topNavMegaMenu.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuCard.js +8 -0
- package/dist/esm/components/topNav/topNavMegaMenuGroup.js +7 -0
- package/dist/esm/components/topNav/topNavMegaMenuItem.js +7 -0
- package/dist/esm/components/tree/tree.js +8 -0
- package/dist/esm/components/tree/treeItem.js +8 -0
- package/dist/esm/components/virtualList/virtualList.js +7 -0
- package/dist/esm/components/virtualTable/virtualTable.js +9 -0
- package/dist/esm/components/visuallyHidden/visuallyHidden.js +7 -0
- package/dist/esm/core/a11y.js +22 -0
- package/dist/esm/core/element.js +14 -0
- package/dist/esm/core/form.js +6 -0
- package/dist/esm/core/overlay.js +8 -0
- package/dist/esm/index.js +779 -0
- package/dist/llms-full.txt +8903 -0
- package/dist/llms.txt +288 -0
- package/dist/punica-components.min.js +14283 -0
- package/dist/tokens.css +158 -0
- package/dist/types/index.d.ts +6762 -0
- package/dist/types/react.d.ts +1914 -0
- package/dist/vscode.css-custom-data.json +3892 -0
- package/dist/vscode.html-custom-data.json +6912 -0
- package/dist/web-types.json +12404 -0
- package/docs/MIGRATION-2.0.md +112 -0
- package/docs/contract.md +130 -0
- package/docs/migration/chat.md +309 -0
- package/docs/migration/content.md +806 -0
- package/docs/migration/data.md +140 -0
- package/docs/migration/display.md +625 -0
- package/docs/migration/form-basic.md +262 -0
- package/docs/migration/navigation.md +368 -0
- package/docs/migration/overlays.md +261 -0
- package/docs/migration/pickers.md +194 -0
- package/package.json +135 -4
- package/scripts/codemod-2.0.mjs +50 -0
- package/scripts/codemod-rules.mjs +102 -0
- package/skills/punica-components/SKILL.md +48 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import {
|
|
2
|
+
field_default
|
|
3
|
+
} from "./chunk-LSDTMST7.js";
|
|
4
|
+
import {
|
|
5
|
+
FieldSurface,
|
|
6
|
+
OptionNavigator,
|
|
7
|
+
fieldLanguage,
|
|
8
|
+
fieldName,
|
|
9
|
+
nativeMessage,
|
|
10
|
+
setAttr
|
|
11
|
+
} from "./chunk-H4Q2HHZA.js";
|
|
12
|
+
import {
|
|
13
|
+
FormControl
|
|
14
|
+
} from "./chunk-HW2CN2JV.js";
|
|
15
|
+
import {
|
|
16
|
+
overlayCss
|
|
17
|
+
} from "./chunk-FNTBMCUQ.js";
|
|
18
|
+
import {
|
|
19
|
+
icons
|
|
20
|
+
} from "./chunk-YSGWORUD.js";
|
|
21
|
+
import {
|
|
22
|
+
PunicaElement,
|
|
23
|
+
define
|
|
24
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
25
|
+
|
|
26
|
+
// src/components/complexSelector/complexSelector.css
|
|
27
|
+
var complexSelector_default = "/* audit-allow: pointer-without-focus-visible (focus is shown on the field box by field.css; the rows are never focused) */\n:host {\n --punica-complex-selector-radius: var(--punica-radius);\n --punica-complex-selector-height: var(--punica-size-md);\n --punica-complex-selector-padding: var(--punica-space-12);\n --punica-complex-selector-border-color: var(--punica-color-border);\n --punica-complex-selector-background: transparent;\n --punica-complex-selector-min-width: 220px;\n --punica-complex-selector-panel-width: 280px;\n --punica-complex-selector-listbox-max-height: 320px;\n --punica-complex-selector-chip-background: var(--punica-color-neutral-light);\n\n --_height: var(--punica-complex-selector-height);\n --_pad: var(--punica-complex-selector-padding);\n --_radius: var(--punica-complex-selector-radius);\n --_border: var(--punica-complex-selector-border-color);\n --_bg: var(--punica-complex-selector-background);\n\n display: inline-flex;\n vertical-align: middle;\n min-inline-size: var(--punica-complex-selector-min-width);\n max-inline-size: 100%;\n}\n\n:host([size='small']) {\n --punica-complex-selector-height: var(--punica-size-sm);\n --punica-complex-selector-padding: var(--punica-space-8);\n}\n:host([size='large']) {\n --punica-complex-selector-height: var(--punica-size-lg);\n --punica-complex-selector-padding: var(--punica-space-16);\n}\n:host([full-width]) {\n display: flex;\n inline-size: 100%;\n}\n\n[part='trigger'] {\n gap: var(--punica-space-8);\n cursor: pointer;\n outline: none;\n}\n[part='trigger']:disabled {\n cursor: default;\n}\n\n.value {\n flex: 1 1 auto;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value.chips {\n display: flex;\n flex-wrap: wrap;\n gap: var(--punica-space-4);\n padding-block: var(--punica-space-4);\n white-space: normal;\n}\n\n.chip {\n display: inline-flex;\n align-items: center;\n max-inline-size: 100%;\n min-block-size: var(--punica-space-22);\n padding-inline: var(--punica-space-8);\n border-radius: var(--punica-radius-full);\n background: var(--punica-complex-selector-chip-background);\n font-size: var(--punica-font-size-xs);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.caret {\n flex: none;\n display: inline-flex;\n font-size: var(--punica-font-size);\n color: var(--punica-color-text-muted);\n transition: rotate var(--punica-duration) var(--punica-ease);\n}\n:host(:state(open)) .caret {\n rotate: 180deg;\n}\n\n.panel {\n display: flex;\n flex-direction: column;\n inline-size: max-content;\n min-inline-size: var(--punica-complex-selector-panel-width);\n max-inline-size: min(28rem, calc(100vw - 2 * var(--punica-space-8)));\n overflow: hidden;\n}\n.panel:not(:popover-open):not([data-open]) {\n display: none;\n}\n\n.search {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding-inline: var(--punica-space-12);\n border-block-end: var(--punica-border-width) solid var(--punica-color-border);\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size);\n}\n\n.search:has(input:focus-visible) {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n[part='search'] {\n flex: 1;\n min-inline-size: 0;\n min-block-size: var(--punica-size-md);\n margin: 0;\n padding: 0;\n border: 0;\n outline: none;\n background: none;\n color: var(--punica-color-text);\n font: inherit;\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n}\n[part='search']::placeholder {\n color: var(--punica-color-text-placeholder);\n opacity: 1;\n}\n\n.listbox {\n max-block-size: var(--punica-complex-selector-listbox-max-height);\n padding-block: var(--punica-space-4);\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.group-header {\n display: flex;\n align-items: center;\n gap: var(--punica-space-8);\n padding: var(--punica-space-8) var(--punica-space-16) var(--punica-space-4);\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-xs);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: var(--punica-line-height);\n user-select: none;\n}\n.group-label {\n flex: 1;\n min-inline-size: 0;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n.group-header.selectable {\n cursor: pointer;\n}\n.group-header.selectable .select-all {\n color: var(--punica-color-primary);\n}\n.group-header.selectable.selected .select-all {\n color: var(--punica-color-text-muted);\n}\n.group-header.active {\n background: var(--punica-color-hover);\n}\n\n.empty {\n padding: var(--punica-space-12) var(--punica-space-16);\n color: var(--punica-color-text-muted);\n font-family: var(--punica-font-family);\n font-size: var(--punica-font-size-sm);\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--punica-border-width) solid CanvasText;\n }\n .group-header.active {\n outline: var(--punica-focus-ring-width) solid Highlight;\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n }\n .group-header.selectable .select-all {\n color: LinkText;\n }\n}\n";
|
|
28
|
+
|
|
29
|
+
// src/components/complexSelector/complexSelector.js
|
|
30
|
+
var ROW = /* @__PURE__ */ new Set(["punica-option", "punica-complex-option"]);
|
|
31
|
+
var valueOf = (option) => option.optionValue ?? option.getAttribute("value") ?? option.textContent.trim();
|
|
32
|
+
var textOf = (option) => option.text ?? option.getAttribute("label") ?? option.textContent.trim();
|
|
33
|
+
var PunicaComplexSelector = class extends FormControl(PunicaElement) {
|
|
34
|
+
static properties = {
|
|
35
|
+
defaultValue: { attribute: "value", reflect: false },
|
|
36
|
+
value: { type: Object, attribute: false },
|
|
37
|
+
multiple: { type: Boolean },
|
|
38
|
+
placeholder: {},
|
|
39
|
+
clearable: { type: Boolean },
|
|
40
|
+
label: {},
|
|
41
|
+
open: { type: Boolean },
|
|
42
|
+
size: {},
|
|
43
|
+
fullWidth: { type: Boolean },
|
|
44
|
+
labelSearch: { default: "Search" },
|
|
45
|
+
labelNoResults: { default: "No results" },
|
|
46
|
+
labelSelectAll: { default: "Select all" },
|
|
47
|
+
labelClear: { default: "Clear" }
|
|
48
|
+
};
|
|
49
|
+
static styles = [overlayCss, field_default, complexSelector_default];
|
|
50
|
+
static shadowOptions = { delegatesFocus: true, slotAssignment: "manual" };
|
|
51
|
+
static template = `
|
|
52
|
+
<div part="field" class="field">
|
|
53
|
+
<slot name="start"></slot>
|
|
54
|
+
<button part="trigger" class="control" type="button" role="combobox" aria-haspopup="dialog" aria-controls="panel" aria-expanded="false">
|
|
55
|
+
<span part="value" class="value"></span>
|
|
56
|
+
<span part="caret" class="caret">${icons.chevronDown}</span>
|
|
57
|
+
</button>
|
|
58
|
+
<button part="clear" class="icon-button clear" type="button" hidden>${icons.close}</button>
|
|
59
|
+
</div>
|
|
60
|
+
<div part="panel" id="panel" class="panel" role="dialog" popover="manual">
|
|
61
|
+
<div class="search">
|
|
62
|
+
${icons.search}
|
|
63
|
+
<input part="search" type="text" role="combobox" aria-autocomplete="list" aria-controls="listbox" aria-expanded="true" autocomplete="off" autocapitalize="off" spellcheck="false">
|
|
64
|
+
</div>
|
|
65
|
+
<div part="listbox" id="listbox" class="listbox" role="listbox"></div>
|
|
66
|
+
<div part="empty" class="empty" hidden></div>
|
|
67
|
+
</div>
|
|
68
|
+
<template id="chip"><span part="chip" class="chip"></span></template>
|
|
69
|
+
`;
|
|
70
|
+
#field = this.$(".field");
|
|
71
|
+
#trigger = this.$('[part="trigger"]');
|
|
72
|
+
#valueEl = this.$('[part="value"]');
|
|
73
|
+
#clear = this.$('[part="clear"]');
|
|
74
|
+
#panel = this.$("#panel");
|
|
75
|
+
#search = this.$('[part="search"]');
|
|
76
|
+
#listbox = this.$("#listbox");
|
|
77
|
+
#empty = this.$('[part="empty"]');
|
|
78
|
+
#startSlot = this.$('slot[name="start"]');
|
|
79
|
+
#surface = new FieldSurface(this, this.#panel);
|
|
80
|
+
#nav = new OptionNavigator(this.#search, () => this.#navigable());
|
|
81
|
+
/** Header row in the shadow root for each group. @type {Map<Element, HTMLElement>} */
|
|
82
|
+
#headers = /* @__PURE__ */ new Map();
|
|
83
|
+
/** @type {MutationObserver | null} */
|
|
84
|
+
#observer = null;
|
|
85
|
+
/** Rows that carried `selected` when first seen: the markup's default. */
|
|
86
|
+
#defaults = /* @__PURE__ */ new WeakSet();
|
|
87
|
+
#seen = /* @__PURE__ */ new WeakSet();
|
|
88
|
+
#dirty = false;
|
|
89
|
+
#touched = false;
|
|
90
|
+
#initialised = false;
|
|
91
|
+
/** The value this element last applied as its default, serialised. @type {string | null} */
|
|
92
|
+
#auto = null;
|
|
93
|
+
#reason = "api";
|
|
94
|
+
/** What the chips were last drawn from. */
|
|
95
|
+
#drawn = "";
|
|
96
|
+
constructor() {
|
|
97
|
+
super();
|
|
98
|
+
this.#trigger.addEventListener("click", () => {
|
|
99
|
+
if (this.isDisabled) return;
|
|
100
|
+
if (this.open) this.#close("api");
|
|
101
|
+
else this.show();
|
|
102
|
+
});
|
|
103
|
+
this.#trigger.addEventListener("keydown", (event) => this.#onTriggerKeydown(event));
|
|
104
|
+
this.#clear.addEventListener("click", () => {
|
|
105
|
+
if (this.isDisabled) return;
|
|
106
|
+
this.#commit([]);
|
|
107
|
+
this.#trigger.focus();
|
|
108
|
+
});
|
|
109
|
+
this.#search.addEventListener("input", () => {
|
|
110
|
+
this.#nav.set(null);
|
|
111
|
+
this.update(/* @__PURE__ */ new Map());
|
|
112
|
+
this.#nav.set(this.#nav.items[0] || null);
|
|
113
|
+
this.#markHeaders();
|
|
114
|
+
});
|
|
115
|
+
this.#search.addEventListener("keydown", (event) => this.#onSearchKeydown(event));
|
|
116
|
+
this.#listbox.addEventListener("mousedown", (event) => event.preventDefault());
|
|
117
|
+
this.#listbox.addEventListener("click", (event) => {
|
|
118
|
+
const row = this.#rowFrom(event);
|
|
119
|
+
if (row && !row.disabled) this.#activate(row);
|
|
120
|
+
});
|
|
121
|
+
this.#listbox.addEventListener("pointermove", (event) => {
|
|
122
|
+
const row = this.#rowFrom(event);
|
|
123
|
+
if (row && !row.disabled && row !== this.#nav.active) {
|
|
124
|
+
this.#nav.set(row);
|
|
125
|
+
this.#markHeaders();
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
this.shadowRoot.addEventListener("focusout", (event) => {
|
|
129
|
+
const next = (
|
|
130
|
+
/** @type {FocusEvent} */
|
|
131
|
+
event.relatedTarget
|
|
132
|
+
);
|
|
133
|
+
if (next instanceof Node && (this.shadowRoot.contains(next) || this.contains(next))) return;
|
|
134
|
+
this.#touched = true;
|
|
135
|
+
if (this.open) this.#close("blur");
|
|
136
|
+
else this.requestUpdate();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** Every row, grouped or not, in order. @returns {any[]} */
|
|
140
|
+
get options() {
|
|
141
|
+
const out = [];
|
|
142
|
+
for (const child of this.children) {
|
|
143
|
+
if (ROW.has(child.localName)) out.push(child);
|
|
144
|
+
else if (child.localName === "punica-option-group") out.push(...[...child.children].filter((c) => ROW.has(c.localName)));
|
|
145
|
+
}
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
/** The picked rows. @returns {any[]} */
|
|
149
|
+
get selectedOptions() {
|
|
150
|
+
const values = this.#values();
|
|
151
|
+
return this.options.filter((option) => values.includes(valueOf(option)));
|
|
152
|
+
}
|
|
153
|
+
/** Opens the panel. */
|
|
154
|
+
show() {
|
|
155
|
+
this.open = true;
|
|
156
|
+
}
|
|
157
|
+
/** Closes the panel. */
|
|
158
|
+
hide() {
|
|
159
|
+
this.#close("api");
|
|
160
|
+
}
|
|
161
|
+
/** Moves focus to the trigger. */
|
|
162
|
+
focus(options) {
|
|
163
|
+
this.#trigger.focus(options);
|
|
164
|
+
}
|
|
165
|
+
connected() {
|
|
166
|
+
this.#observer = new MutationObserver(() => this.#layout());
|
|
167
|
+
this.#observer.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ["slot", "label"] });
|
|
168
|
+
queueMicrotask(() => this.isConnected && this.#layout());
|
|
169
|
+
}
|
|
170
|
+
disconnected() {
|
|
171
|
+
this.#observer?.disconnect();
|
|
172
|
+
this.#observer = null;
|
|
173
|
+
this.#surface.hide();
|
|
174
|
+
this.#nav.set(null);
|
|
175
|
+
}
|
|
176
|
+
formReset() {
|
|
177
|
+
this.#dirty = false;
|
|
178
|
+
this.#touched = false;
|
|
179
|
+
this.value = this.#defaultValue();
|
|
180
|
+
this.#auto = JSON.stringify(this.#values());
|
|
181
|
+
}
|
|
182
|
+
formRestore(state) {
|
|
183
|
+
if (state instanceof FormData) this.value = this.multiple ? state.getAll(this.name) : state.get(this.name);
|
|
184
|
+
else if (typeof state === "string") this.value = state;
|
|
185
|
+
}
|
|
186
|
+
/* ------------------------------------------------------------ layout */
|
|
187
|
+
/** Assigns the light children to slots: groups each behind a header row of the shadow root. */
|
|
188
|
+
#layout() {
|
|
189
|
+
const start = [];
|
|
190
|
+
const parts = [];
|
|
191
|
+
let loose = null;
|
|
192
|
+
const headers = /* @__PURE__ */ new Map();
|
|
193
|
+
for (const child of this.children) {
|
|
194
|
+
if (child.getAttribute("slot") === "start") {
|
|
195
|
+
start.push(child);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (child.localName === "punica-option-group") {
|
|
199
|
+
loose = null;
|
|
200
|
+
const header = this.#headers.get(child) || this.#makeHeader();
|
|
201
|
+
headers.set(child, header);
|
|
202
|
+
const slot = document.createElement("slot");
|
|
203
|
+
slot.assign(child);
|
|
204
|
+
parts.push(header, slot);
|
|
205
|
+
} else if (ROW.has(child.localName)) {
|
|
206
|
+
if (!loose) {
|
|
207
|
+
loose = { slot: document.createElement("slot"), nodes: [] };
|
|
208
|
+
parts.push(loose.slot);
|
|
209
|
+
}
|
|
210
|
+
loose.nodes.push(child);
|
|
211
|
+
loose.slot.assign(...loose.nodes);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
this.#startSlot.assign(...start);
|
|
215
|
+
this.#headers = headers;
|
|
216
|
+
const active = this.#nav.active;
|
|
217
|
+
this.#listbox.replaceChildren(...parts);
|
|
218
|
+
if (active?.isConnected && this.#navigable().includes(active)) this.#nav.set(active);
|
|
219
|
+
this.#sync();
|
|
220
|
+
}
|
|
221
|
+
#makeHeader() {
|
|
222
|
+
const header = document.createElement("div");
|
|
223
|
+
header.className = "group-header";
|
|
224
|
+
header.setAttribute("part", "group-header");
|
|
225
|
+
const text = document.createElement("span");
|
|
226
|
+
text.className = "group-label";
|
|
227
|
+
const all = document.createElement("span");
|
|
228
|
+
all.className = "select-all";
|
|
229
|
+
header.append(text, all);
|
|
230
|
+
return header;
|
|
231
|
+
}
|
|
232
|
+
/** Rows the keyboard can land on: each group's select-all row with `multiple`, then its rows. */
|
|
233
|
+
#navigable() {
|
|
234
|
+
const out = [];
|
|
235
|
+
for (const child of this.children) {
|
|
236
|
+
if (ROW.has(child.localName) && child.getAttribute("slot") !== "start") out.push(child);
|
|
237
|
+
else if (child.localName === "punica-option-group") {
|
|
238
|
+
const header = this.#headers.get(child);
|
|
239
|
+
if (header && this.multiple) out.push(header);
|
|
240
|
+
out.push(...[...child.children].filter((c) => ROW.has(c.localName)));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return out;
|
|
244
|
+
}
|
|
245
|
+
#markHeaders() {
|
|
246
|
+
const active = this.#nav.active;
|
|
247
|
+
for (const header of this.#headers.values()) header.classList.toggle("active", header === active);
|
|
248
|
+
}
|
|
249
|
+
#rowFrom(event) {
|
|
250
|
+
const rows = this.#navigable();
|
|
251
|
+
return event.composedPath().find((node) => rows.includes(node)) || null;
|
|
252
|
+
}
|
|
253
|
+
/* ------------------------------------------------------------- value */
|
|
254
|
+
/** @returns {string[]} */
|
|
255
|
+
#values() {
|
|
256
|
+
const value = this.value;
|
|
257
|
+
if (Array.isArray(value)) return value.map(String);
|
|
258
|
+
return value == null || value === "" ? [] : [String(value)];
|
|
259
|
+
}
|
|
260
|
+
#defaultValue() {
|
|
261
|
+
let values = [];
|
|
262
|
+
if (this.defaultValue != null) {
|
|
263
|
+
values = this.multiple ? this.defaultValue.split(/\s+/).filter(Boolean) : [this.defaultValue];
|
|
264
|
+
} else {
|
|
265
|
+
values = this.options.filter((o) => this.#defaults.has(o)).map(valueOf);
|
|
266
|
+
}
|
|
267
|
+
if (this.multiple) return values;
|
|
268
|
+
return values.length ? values[0] : null;
|
|
269
|
+
}
|
|
270
|
+
#sync() {
|
|
271
|
+
this.#applyDefault();
|
|
272
|
+
if (this.isConnected) this.update(/* @__PURE__ */ new Map());
|
|
273
|
+
}
|
|
274
|
+
#applyDefault() {
|
|
275
|
+
for (const option of this.options) {
|
|
276
|
+
if (this.#seen.has(option)) continue;
|
|
277
|
+
this.#seen.add(option);
|
|
278
|
+
if (option.hasAttribute("selected")) this.#defaults.add(option);
|
|
279
|
+
}
|
|
280
|
+
this.#initialised = true;
|
|
281
|
+
if (this.#dirty) return;
|
|
282
|
+
const current = JSON.stringify(this.#values());
|
|
283
|
+
if (current !== (this.#auto ?? "[]")) {
|
|
284
|
+
this.#dirty = true;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.value = this.#defaultValue();
|
|
288
|
+
this.#auto = JSON.stringify(this.#values());
|
|
289
|
+
}
|
|
290
|
+
update(changed) {
|
|
291
|
+
if (!this.#initialised || changed.has("defaultValue") || changed.has("multiple")) this.#applyDefault();
|
|
292
|
+
if (this.open && !this.#surface.open) this.#search.value = "";
|
|
293
|
+
const language = fieldLanguage(this);
|
|
294
|
+
const options = this.options;
|
|
295
|
+
const values = this.#values();
|
|
296
|
+
const disabled = this.isDisabled;
|
|
297
|
+
const name = fieldName(this);
|
|
298
|
+
const known = new Map(options.map((option) => [valueOf(option), option]));
|
|
299
|
+
for (const option of options) option.selected = values.includes(valueOf(option));
|
|
300
|
+
const texts = values.map((value) => known.has(value) ? textOf(known.get(value)) : value);
|
|
301
|
+
const empty = texts.length === 0;
|
|
302
|
+
this.#drawValue(texts, empty);
|
|
303
|
+
this.toggleState("placeholder", empty);
|
|
304
|
+
this.toggleState("disabled", disabled);
|
|
305
|
+
const trigger = this.#trigger;
|
|
306
|
+
trigger.disabled = disabled;
|
|
307
|
+
setAttr(trigger, "aria-label", name);
|
|
308
|
+
setAttr(trigger, "aria-required", this.required ? "true" : null);
|
|
309
|
+
setAttr(this.#panel, "aria-label", name);
|
|
310
|
+
setAttr(this.#listbox, "aria-label", name);
|
|
311
|
+
setAttr(this.#listbox, "aria-multiselectable", this.multiple ? "true" : null);
|
|
312
|
+
setAttr(this.#search, "aria-label", this.labelSearch);
|
|
313
|
+
setAttr(this.#search, "placeholder", this.labelSearch);
|
|
314
|
+
setAttr(this.#clear, "aria-label", this.labelClear);
|
|
315
|
+
this.#clear.hidden = !this.clearable || empty || disabled;
|
|
316
|
+
const needle = this.#search.value.trim().toLocaleLowerCase(language);
|
|
317
|
+
const matches = (row) => {
|
|
318
|
+
if (!needle) return true;
|
|
319
|
+
const hay = `${textOf(row)} ${row.descriptionText ?? ""}`.toLocaleLowerCase(language);
|
|
320
|
+
return hay.includes(needle);
|
|
321
|
+
};
|
|
322
|
+
let visible = 0;
|
|
323
|
+
for (const child of this.children) {
|
|
324
|
+
if (ROW.has(child.localName) && child.getAttribute("slot") !== "start") {
|
|
325
|
+
child.hidden = !matches(child);
|
|
326
|
+
if (!child.hidden) visible++;
|
|
327
|
+
} else if (child.localName === "punica-option-group") {
|
|
328
|
+
const rows = [...child.children].filter((c) => ROW.has(c.localName));
|
|
329
|
+
let shown = 0;
|
|
330
|
+
for (const row of rows) {
|
|
331
|
+
row.hidden = !matches(row);
|
|
332
|
+
if (!row.hidden) shown++;
|
|
333
|
+
}
|
|
334
|
+
visible += shown;
|
|
335
|
+
child.hidden = shown === 0;
|
|
336
|
+
const header = this.#headers.get(child);
|
|
337
|
+
if (header) this.#drawHeader(header, child, rows, values);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
this.#empty.textContent = this.labelNoResults;
|
|
341
|
+
this.#empty.hidden = visible > 0;
|
|
342
|
+
if (this.multiple && this.name) {
|
|
343
|
+
const data = new FormData();
|
|
344
|
+
for (const value of values) data.append(this.name, value);
|
|
345
|
+
this.setFormValue(data);
|
|
346
|
+
} else {
|
|
347
|
+
this.setFormValue(empty ? null : values[0]);
|
|
348
|
+
}
|
|
349
|
+
const missing = this.required && empty;
|
|
350
|
+
this.setValidity(missing ? { valueMissing: true } : {}, nativeMessage("choose"), trigger);
|
|
351
|
+
setAttr(trigger, "aria-invalid", this.#touched && missing ? "true" : null);
|
|
352
|
+
this.toggleState("user-invalid", this.#touched && !this.validity.valid);
|
|
353
|
+
const want = this.open && !disabled;
|
|
354
|
+
if (want && !this.#surface.open) {
|
|
355
|
+
this.#surface.show(this.#field, { matchWidth: true }, () => this.#close("outside"));
|
|
356
|
+
this.toggleState("open", true);
|
|
357
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
358
|
+
this.#search.focus({ preventScroll: true });
|
|
359
|
+
const first = options.find((o) => o.selected && !o.disabled && !o.hidden) || this.#nav.items[0] || null;
|
|
360
|
+
this.#nav.set(first);
|
|
361
|
+
this.#markHeaders();
|
|
362
|
+
this.emit("open");
|
|
363
|
+
} else if (!want && this.#surface.open) {
|
|
364
|
+
const inside = this.shadowRoot.activeElement === this.#search;
|
|
365
|
+
this.#surface.hide();
|
|
366
|
+
this.#nav.set(null);
|
|
367
|
+
this.#markHeaders();
|
|
368
|
+
this.toggleState("open", false);
|
|
369
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
370
|
+
const reason = this.#reason;
|
|
371
|
+
this.#reason = "api";
|
|
372
|
+
if (inside && reason !== "outside" && reason !== "blur") trigger.focus({ preventScroll: true });
|
|
373
|
+
this.emit("close", { reason });
|
|
374
|
+
}
|
|
375
|
+
if (this.#nav.active?.hidden) {
|
|
376
|
+
this.#nav.set(null);
|
|
377
|
+
this.#markHeaders();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/** The trigger's text, or a chip per value with `multiple`. */
|
|
381
|
+
#drawValue(texts, empty) {
|
|
382
|
+
const key = JSON.stringify([this.multiple, texts, this.placeholder]);
|
|
383
|
+
if (key === this.#drawn) return;
|
|
384
|
+
this.#drawn = key;
|
|
385
|
+
const el = this.#valueEl;
|
|
386
|
+
el.classList.toggle("placeholder", empty);
|
|
387
|
+
el.classList.toggle("chips", this.multiple && !empty);
|
|
388
|
+
if (empty) {
|
|
389
|
+
el.textContent = this.placeholder || "";
|
|
390
|
+
} else if (this.multiple) {
|
|
391
|
+
const template = (
|
|
392
|
+
/** @type {HTMLTemplateElement} */
|
|
393
|
+
this.$("#chip")
|
|
394
|
+
);
|
|
395
|
+
el.replaceChildren(
|
|
396
|
+
...texts.map((text) => {
|
|
397
|
+
const chip = (
|
|
398
|
+
/** @type {HTMLElement} */
|
|
399
|
+
template.content.firstElementChild.cloneNode(true)
|
|
400
|
+
);
|
|
401
|
+
chip.textContent = text;
|
|
402
|
+
return chip;
|
|
403
|
+
})
|
|
404
|
+
);
|
|
405
|
+
} else {
|
|
406
|
+
el.textContent = texts[0];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* @param {HTMLElement} header
|
|
411
|
+
* @param {any} group
|
|
412
|
+
* @param {any[]} rows
|
|
413
|
+
* @param {string[]} values
|
|
414
|
+
*/
|
|
415
|
+
#drawHeader(header, group, rows, values) {
|
|
416
|
+
const label = group.label || group.getAttribute("label") || "";
|
|
417
|
+
header.hidden = group.hidden;
|
|
418
|
+
header.querySelector(".group-label").textContent = label;
|
|
419
|
+
const all = header.querySelector(".select-all");
|
|
420
|
+
all.textContent = this.multiple ? this.labelSelectAll : "";
|
|
421
|
+
header.classList.toggle("selectable", this.multiple);
|
|
422
|
+
if (this.multiple) {
|
|
423
|
+
const pickable = rows.filter((r) => !r.hidden && !r.disabled);
|
|
424
|
+
const every = pickable.length > 0 && pickable.every((r) => values.includes(valueOf(r)));
|
|
425
|
+
header.setAttribute("role", "option");
|
|
426
|
+
header.setAttribute("aria-selected", String(every));
|
|
427
|
+
header.removeAttribute("aria-hidden");
|
|
428
|
+
header.classList.toggle("selected", every);
|
|
429
|
+
} else {
|
|
430
|
+
header.removeAttribute("role");
|
|
431
|
+
header.removeAttribute("aria-selected");
|
|
432
|
+
header.setAttribute("aria-hidden", "true");
|
|
433
|
+
header.classList.remove("selected");
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
/* ----------------------------------------------------------- actions */
|
|
437
|
+
/** @param {string} reason */
|
|
438
|
+
#close(reason) {
|
|
439
|
+
if (!this.open) return;
|
|
440
|
+
this.#reason = reason;
|
|
441
|
+
this.open = false;
|
|
442
|
+
}
|
|
443
|
+
/** @param {string[]} values */
|
|
444
|
+
#commit(values) {
|
|
445
|
+
const before = this.#values();
|
|
446
|
+
if (before.length === values.length && before.every((v, i) => v === values[i])) return;
|
|
447
|
+
this.#dirty = true;
|
|
448
|
+
this.#touched = true;
|
|
449
|
+
this.value = this.multiple ? values : values[0] ?? null;
|
|
450
|
+
this.update(/* @__PURE__ */ new Map());
|
|
451
|
+
this.emit("change", { value: this.value });
|
|
452
|
+
}
|
|
453
|
+
/** Keeps the list's own order, whatever order the user picked in. */
|
|
454
|
+
#ordered(values) {
|
|
455
|
+
const order = this.options.map(valueOf);
|
|
456
|
+
return [...new Set(values)].sort((a, b) => order.indexOf(a) - order.indexOf(b));
|
|
457
|
+
}
|
|
458
|
+
/** A row or a select-all row was picked. */
|
|
459
|
+
#activate(row) {
|
|
460
|
+
if (this.#headers.size && [...this.#headers.values()].includes(row)) {
|
|
461
|
+
const group = [...this.#headers].find(([, h]) => h === row)?.[0];
|
|
462
|
+
const pickable = [...group?.children || []].filter((r) => ROW.has(r.localName) && !r.hidden && !r.disabled).map(valueOf);
|
|
463
|
+
const values = this.#values();
|
|
464
|
+
const every = pickable.every((v) => values.includes(v));
|
|
465
|
+
this.#commit(this.#ordered(every ? values.filter((v) => !pickable.includes(v)) : [...values, ...pickable]));
|
|
466
|
+
this.#nav.set(row);
|
|
467
|
+
this.#markHeaders();
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const value = valueOf(row);
|
|
471
|
+
if (this.multiple) {
|
|
472
|
+
const values = this.#values();
|
|
473
|
+
this.#commit(this.#ordered(values.includes(value) ? values.filter((v) => v !== value) : [...values, value]));
|
|
474
|
+
this.#nav.set(row);
|
|
475
|
+
this.#markHeaders();
|
|
476
|
+
} else {
|
|
477
|
+
this.#commit([value]);
|
|
478
|
+
this.#close("select");
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/** @param {KeyboardEvent} event */
|
|
482
|
+
#onTriggerKeydown(event) {
|
|
483
|
+
if (this.isDisabled || this.open) return;
|
|
484
|
+
if (["Enter", " ", "ArrowDown", "ArrowUp"].includes(event.key)) {
|
|
485
|
+
event.preventDefault();
|
|
486
|
+
this.show();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/** @param {KeyboardEvent} event */
|
|
490
|
+
#onSearchKeydown(event) {
|
|
491
|
+
const nav = this.#nav;
|
|
492
|
+
const key = event.key;
|
|
493
|
+
if (key === "Escape") {
|
|
494
|
+
event.preventDefault();
|
|
495
|
+
event.stopPropagation();
|
|
496
|
+
this.#close("escape");
|
|
497
|
+
} else if (key === "Tab") {
|
|
498
|
+
this.#close("blur");
|
|
499
|
+
} else if (key === "Enter") {
|
|
500
|
+
event.preventDefault();
|
|
501
|
+
if (nav.active) this.#activate(nav.active);
|
|
502
|
+
} else if (key === "ArrowUp" && event.altKey) {
|
|
503
|
+
event.preventDefault();
|
|
504
|
+
this.#close("escape");
|
|
505
|
+
} else if (nav.move(event, { homeEnd: false })) {
|
|
506
|
+
event.preventDefault();
|
|
507
|
+
this.#markHeaders();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
define("punica-complex-selector", PunicaComplexSelector);
|
|
512
|
+
|
|
513
|
+
export {
|
|
514
|
+
PunicaComplexSelector
|
|
515
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl
|
|
3
|
+
} from "./chunk-HW2CN2JV.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/iconButton/iconButton.css
|
|
10
|
+
var iconButton_default = ":host {\n /* With no color the button takes the text colour around it, so it reads on\n a coloured app bar or toolbar too. */\n --_accent: currentColor;\n --_accent-strong: currentColor;\n --punica-icon-button-size: var(--punica-size-md);\n --punica-icon-button-radius: var(--punica-radius-full);\n --punica-icon-button-icon-size: var(--punica-font-size-lg);\n\n display: inline-flex;\n vertical-align: middle;\n flex: 0 0 auto;\n}\n\n:host([color='primary']) {\n --_accent: var(--punica-color-primary);\n --_accent-strong: var(--punica-color-primary-dark);\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\n:host([size='small']) {\n --punica-icon-button-size: var(--punica-size-sm);\n --punica-icon-button-icon-size: var(--punica-font-size);\n}\n:host([size='large']) {\n --punica-icon-button-size: var(--punica-size-lg);\n --punica-icon-button-icon-size: var(--punica-font-size-xl);\n}\n\nbutton {\n all: unset;\n box-sizing: border-box;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-icon-button-size);\n block-size: var(--punica-icon-button-size);\n border: var(--punica-border-width) solid transparent;\n border-radius: var(--punica-icon-button-radius);\n font-family: var(--punica-font-family);\n font-size: var(--punica-icon-button-icon-size);\n line-height: 1;\n cursor: pointer;\n user-select: none;\n background: transparent;\n color: var(--_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: color-mix(in srgb, var(--_accent) 10%, transparent);\n}\n\n:host([variant='outlined']) button {\n border-color: var(--_accent);\n}\n\n:host([variant='filled']) button {\n background: var(--_accent);\n color: var(--punica-color-on-accent);\n}\n:host([variant='filled']:not([color])) button,\n:host([variant='filled'][color='neutral']) button {\n color: var(--punica-color-surface);\n}\n:host([variant='filled']) button:hover {\n background: var(--_accent-strong);\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\n::slotted(*) {\n flex: none;\n}\n\n:host([loading]) button {\n cursor: progress;\n}\n:host([loading]) ::slotted(*) {\n visibility: hidden;\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: var(--punica-space-2) solid currentColor;\n border-inline-end-color: transparent;\n border-radius: var(--punica-radius-full);\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/iconButton/iconButton.js
|
|
13
|
+
var PunicaIconButton = class extends FormControl(PunicaElement) {
|
|
14
|
+
static properties = {
|
|
15
|
+
label: {},
|
|
16
|
+
variant: {},
|
|
17
|
+
color: {},
|
|
18
|
+
size: {},
|
|
19
|
+
type: { default: "button" },
|
|
20
|
+
loading: { type: Boolean },
|
|
21
|
+
value: {}
|
|
22
|
+
};
|
|
23
|
+
static styles = iconButton_default;
|
|
24
|
+
static shadowOptions = { delegatesFocus: true };
|
|
25
|
+
static template = `<button part="base" type="button"><slot></slot><span part="spinner" class="spinner" aria-hidden="true"></span></button>`;
|
|
26
|
+
#button = this.$("button");
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.#button.addEventListener("click", () => this.#onClick());
|
|
30
|
+
this.addEventListener(
|
|
31
|
+
"click",
|
|
32
|
+
(event) => {
|
|
33
|
+
if (this.isDisabled || this.loading) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
event.stopImmediatePropagation();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{ capture: true }
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
update() {
|
|
42
|
+
const button = this.#button;
|
|
43
|
+
button.disabled = this.isDisabled;
|
|
44
|
+
button.setAttribute("aria-busy", String(this.loading));
|
|
45
|
+
if (this.loading) button.setAttribute("aria-disabled", "true");
|
|
46
|
+
else button.removeAttribute("aria-disabled");
|
|
47
|
+
if (this.label) button.setAttribute("aria-label", this.label);
|
|
48
|
+
else button.removeAttribute("aria-label");
|
|
49
|
+
}
|
|
50
|
+
/** Moves focus to the button. */
|
|
51
|
+
focus(options) {
|
|
52
|
+
this.#button.focus(options);
|
|
53
|
+
}
|
|
54
|
+
/** Clicks the button the way a user would. */
|
|
55
|
+
click() {
|
|
56
|
+
this.#button.click();
|
|
57
|
+
}
|
|
58
|
+
#onClick() {
|
|
59
|
+
if (this.isDisabled || this.loading) return;
|
|
60
|
+
if (this.type === "submit") {
|
|
61
|
+
this.internals.setFormValue(this.value ?? "");
|
|
62
|
+
this.formAction("submit");
|
|
63
|
+
this.internals.setFormValue(null);
|
|
64
|
+
} else if (this.type === "reset") {
|
|
65
|
+
this.formAction("reset");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
define("punica-icon-button", PunicaIconButton);
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
PunicaIconButton
|
|
73
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/dialog/dialogContent.css
|
|
7
|
+
var dialogContent_default = ":host {\n --punica-dialog-content-padding: var(--punica-space-32) 0;\n\n display: block;\n grid-area: content;\n min-block-size: 0;\n padding: var(--punica-dialog-content-padding);\n overflow: auto;\n overscroll-behavior: contain;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n line-height: var(--punica-line-height);\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/dialog/dialogContent.js
|
|
10
|
+
var PunicaDialogContent = class extends PunicaElement {
|
|
11
|
+
static styles = dialogContent_default;
|
|
12
|
+
static template = `<slot></slot>`;
|
|
13
|
+
};
|
|
14
|
+
define("punica-dialog-content", PunicaDialogContent);
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
PunicaDialogContent
|
|
18
|
+
};
|