@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,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/complexSelector/optionGroup.css
|
|
7
|
+
var optionGroup_default = ":host {\n display: block;\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/complexSelector/optionGroup.js
|
|
10
|
+
var PunicaOptionGroup = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
label: {}
|
|
13
|
+
};
|
|
14
|
+
static styles = optionGroup_default;
|
|
15
|
+
static template = `<slot></slot>`;
|
|
16
|
+
update() {
|
|
17
|
+
this.internals.role = "group";
|
|
18
|
+
this.internals.ariaLabel = this.label || null;
|
|
19
|
+
}
|
|
20
|
+
/** The rows of the group, in order. @returns {any[]} */
|
|
21
|
+
get options() {
|
|
22
|
+
return [...this.children].filter((c) => c.localName === "punica-option" || c.localName === "punica-complex-option");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
define("punica-option-group", PunicaOptionGroup);
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
PunicaOptionGroup
|
|
29
|
+
};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRtl,
|
|
3
|
+
nextIndex,
|
|
4
|
+
prefersReducedMotion
|
|
5
|
+
} from "./chunk-4RURT4SK.js";
|
|
6
|
+
import {
|
|
7
|
+
icons
|
|
8
|
+
} from "./chunk-YSGWORUD.js";
|
|
9
|
+
import {
|
|
10
|
+
PunicaElement,
|
|
11
|
+
define
|
|
12
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
13
|
+
|
|
14
|
+
// src/components/carousel/carousel.css
|
|
15
|
+
var carousel_default = ":host {\n --punica-carousel-gap: var(--punica-space-0);\n --punica-carousel-slide-size: 100%;\n --punica-carousel-dot-size: var(--punica-space-8);\n --punica-carousel-dot-color: var(--punica-color-border-strong);\n --punica-carousel-dot-active-color: var(--punica-color-primary);\n\n display: block;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.base {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-8);\n}\n\n.track {\n display: flex;\n gap: var(--punica-carousel-gap);\n overflow: auto hidden;\n overscroll-behavior-x: contain;\n scroll-snap-type: x mandatory;\n scrollbar-width: none;\n border-radius: var(--punica-radius);\n}\n\n.track:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\n::slotted(punica-carousel-item) {\n flex: 0 0 var(--punica-carousel-slide-size);\n scroll-snap-align: start;\n}\n\n.controls {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--punica-space-4);\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-size-sm);\n block-size: var(--punica-size-sm);\n border-radius: var(--punica-radius-full);\n color: var(--punica-color-text);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\nbutton:hover {\n background: var(--punica-color-hover);\n}\n\nbutton:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: var(--punica-focus-ring-offset);\n}\n\nbutton[aria-disabled='true'] {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\nbutton[aria-disabled='true']:hover {\n background: none;\n}\n\nbutton[hidden],\n.dots[hidden] {\n display: none;\n}\n\n:host(:dir(rtl)) .previous .icon,\n:host(:dir(rtl)) .next .icon {\n transform: scaleX(-1);\n}\n\n.dots {\n display: flex;\n align-items: center;\n}\n\n.dot {\n inline-size: var(--punica-space-24);\n block-size: var(--punica-space-24);\n}\n\n.dot::before {\n content: '';\n inline-size: var(--punica-carousel-dot-size);\n block-size: var(--punica-carousel-dot-size);\n border-radius: var(--punica-radius-full);\n background: var(--punica-carousel-dot-color);\n transition: background-color var(--punica-duration) var(--punica-ease),\n transform var(--punica-duration) var(--punica-ease);\n}\n\n.dot[aria-selected='true']::before {\n background: var(--punica-carousel-dot-active-color);\n transform: scale(1.25);\n}\n\n/* Two bars while playing, a triangle while paused. */\n.glyph {\n box-sizing: border-box;\n inline-size: 0.625em;\n block-size: 0.75em;\n border-inline: 0.2em solid currentColor;\n}\n\n.pause.paused .glyph {\n inline-size: 0.75em;\n border: 0;\n background: currentColor;\n clip-path: polygon(15% 0, 100% 50%, 15% 100%);\n}\n\n@media (forced-colors: active) {\n .dot::before {\n background: CanvasText;\n }\n .dot[aria-selected='true']::before {\n background: Highlight;\n }\n .pause.paused .glyph {\n background: ButtonText;\n }\n button[aria-disabled='true'] {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
16
|
+
|
|
17
|
+
// src/components/carousel/carousel.js
|
|
18
|
+
var PunicaCarousel = class extends PunicaElement {
|
|
19
|
+
static properties = {
|
|
20
|
+
index: { type: Number, default: 0 },
|
|
21
|
+
loop: { type: Boolean },
|
|
22
|
+
autoplay: { type: Boolean },
|
|
23
|
+
interval: { type: Number, default: 5e3 },
|
|
24
|
+
label: {},
|
|
25
|
+
labelPrevious: { default: "Previous slide" },
|
|
26
|
+
labelNext: { default: "Next slide" },
|
|
27
|
+
labelPause: { default: "Pause" },
|
|
28
|
+
labelPlay: { default: "Play" },
|
|
29
|
+
labelSlide: { default: "{index} of {total}" },
|
|
30
|
+
labelDots: { default: "Slides" },
|
|
31
|
+
roledescription: { default: "carousel" },
|
|
32
|
+
slideRoledescription: { default: "slide" }
|
|
33
|
+
};
|
|
34
|
+
static styles = carousel_default;
|
|
35
|
+
static template = `
|
|
36
|
+
<div part="base" class="base">
|
|
37
|
+
<div part="track" class="track" tabindex="0"><slot></slot></div>
|
|
38
|
+
<div part="controls" class="controls">
|
|
39
|
+
<button part="pause" class="pause" type="button" hidden><span class="glyph"></span></button>
|
|
40
|
+
<button part="previous" class="previous" type="button">${icons.chevronStart}</button>
|
|
41
|
+
<div part="dots" class="dots" role="tablist"></div>
|
|
42
|
+
<button part="next" class="next" type="button">${icons.chevronEnd}</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
46
|
+
#track = this.$(".track");
|
|
47
|
+
#controls = this.$(".controls");
|
|
48
|
+
#dots = this.$(".dots");
|
|
49
|
+
#previous = this.$(".previous");
|
|
50
|
+
#next = this.$(".next");
|
|
51
|
+
#pause = this.$(".pause");
|
|
52
|
+
#timer = 0;
|
|
53
|
+
#settle = 0;
|
|
54
|
+
#paused = false;
|
|
55
|
+
#hover = false;
|
|
56
|
+
#focus = false;
|
|
57
|
+
#first = true;
|
|
58
|
+
/** @type {ResizeObserver | null} */
|
|
59
|
+
#resize = null;
|
|
60
|
+
constructor() {
|
|
61
|
+
super();
|
|
62
|
+
this.internals.role = "region";
|
|
63
|
+
this.$("slot").addEventListener("slotchange", () => this.requestUpdate());
|
|
64
|
+
this.#previous.addEventListener("click", () => this.#step(-1, true));
|
|
65
|
+
this.#next.addEventListener("click", () => this.#step(1, true));
|
|
66
|
+
this.#pause.addEventListener("click", () => {
|
|
67
|
+
this.#paused = !this.#paused;
|
|
68
|
+
this.requestUpdate();
|
|
69
|
+
});
|
|
70
|
+
this.#dots.addEventListener("click", (event) => {
|
|
71
|
+
const dot = (
|
|
72
|
+
/** @type {HTMLElement} */
|
|
73
|
+
event.target.closest("button")
|
|
74
|
+
);
|
|
75
|
+
if (dot) this.#go(Number(dot.dataset.index), true);
|
|
76
|
+
});
|
|
77
|
+
this.$(".base").addEventListener("keydown", (event) => this.#onKeydown(event));
|
|
78
|
+
const settled = () => {
|
|
79
|
+
clearTimeout(this.#settle);
|
|
80
|
+
if (!this.isConnected) return;
|
|
81
|
+
const nearest = this.#nearest();
|
|
82
|
+
if (nearest >= 0 && nearest !== this.currentIndex) this.#go(nearest, true);
|
|
83
|
+
};
|
|
84
|
+
this.#track.addEventListener("scrollend", settled);
|
|
85
|
+
this.#track.addEventListener(
|
|
86
|
+
"scroll",
|
|
87
|
+
() => {
|
|
88
|
+
clearTimeout(this.#settle);
|
|
89
|
+
this.#settle = setTimeout(settled, 150);
|
|
90
|
+
},
|
|
91
|
+
{ passive: true }
|
|
92
|
+
);
|
|
93
|
+
this.addEventListener("pointerenter", () => this.#hold("hover", true));
|
|
94
|
+
this.addEventListener("pointerleave", () => this.#hold("hover", false));
|
|
95
|
+
this.addEventListener("focusin", () => this.#hold("focus", true));
|
|
96
|
+
this.addEventListener("focusout", () => this.#hold("focus", false));
|
|
97
|
+
}
|
|
98
|
+
/** The slides, in order. */
|
|
99
|
+
get items() {
|
|
100
|
+
return (
|
|
101
|
+
/** @type {any[]} */
|
|
102
|
+
[...this.children].filter((el) => el.localName === "punica-carousel-item")
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
/** `index`, kept inside the slides there are. */
|
|
106
|
+
get currentIndex() {
|
|
107
|
+
const count = this.items.length;
|
|
108
|
+
return count ? Math.min(count - 1, Math.max(0, Math.round(this.index ?? 0))) : -1;
|
|
109
|
+
}
|
|
110
|
+
/** Whether autoplay is running right now. */
|
|
111
|
+
get playing() {
|
|
112
|
+
return this.autoplay && this.isConnected && !this.#paused && !this.#hover && !this.#focus && this.items.length > 1;
|
|
113
|
+
}
|
|
114
|
+
/** Shows the following slide. Fires nothing. */
|
|
115
|
+
next() {
|
|
116
|
+
this.#step(1, false);
|
|
117
|
+
}
|
|
118
|
+
/** Shows the preceding slide. Fires nothing. */
|
|
119
|
+
previous() {
|
|
120
|
+
this.#step(-1, false);
|
|
121
|
+
}
|
|
122
|
+
/** Stops autoplay until `play()`. */
|
|
123
|
+
pause() {
|
|
124
|
+
this.#paused = true;
|
|
125
|
+
this.requestUpdate();
|
|
126
|
+
}
|
|
127
|
+
/** Resumes autoplay. */
|
|
128
|
+
play() {
|
|
129
|
+
this.#paused = false;
|
|
130
|
+
this.requestUpdate();
|
|
131
|
+
}
|
|
132
|
+
connected() {
|
|
133
|
+
this.#first = true;
|
|
134
|
+
this.#paused = prefersReducedMotion();
|
|
135
|
+
this.#hover = false;
|
|
136
|
+
this.#focus = false;
|
|
137
|
+
let size = -1;
|
|
138
|
+
this.#resize = new ResizeObserver(([entry]) => {
|
|
139
|
+
const next = Math.round(entry.contentRect.width);
|
|
140
|
+
if (size >= 0 && next !== size) this.#scrollTo(this.currentIndex, false);
|
|
141
|
+
size = next;
|
|
142
|
+
});
|
|
143
|
+
this.#resize.observe(this.#track);
|
|
144
|
+
this.requestUpdate();
|
|
145
|
+
}
|
|
146
|
+
disconnected() {
|
|
147
|
+
clearInterval(this.#timer);
|
|
148
|
+
clearTimeout(this.#settle);
|
|
149
|
+
this.#timer = 0;
|
|
150
|
+
this.#resize?.disconnect();
|
|
151
|
+
this.#resize = null;
|
|
152
|
+
}
|
|
153
|
+
/** @param {'hover' | 'focus'} what @param {boolean} on */
|
|
154
|
+
#hold(what, on) {
|
|
155
|
+
if (what === "hover") this.#hover = on;
|
|
156
|
+
else this.#focus = on;
|
|
157
|
+
this.#syncTimer();
|
|
158
|
+
}
|
|
159
|
+
#step(by, user) {
|
|
160
|
+
const count = this.items.length;
|
|
161
|
+
if (!count) return;
|
|
162
|
+
let next = this.currentIndex + by;
|
|
163
|
+
if (this.loop) next = (next + count) % count;
|
|
164
|
+
this.#go(next, user);
|
|
165
|
+
}
|
|
166
|
+
#go(index, user) {
|
|
167
|
+
const count = this.items.length;
|
|
168
|
+
const next = Math.min(count - 1, Math.max(0, index));
|
|
169
|
+
if (!count || next === this.currentIndex) return;
|
|
170
|
+
this.index = next;
|
|
171
|
+
if (user) this.emit("change", { index: next, value: next });
|
|
172
|
+
}
|
|
173
|
+
/** @param {KeyboardEvent} event */
|
|
174
|
+
#onKeydown(event) {
|
|
175
|
+
const target = (
|
|
176
|
+
/** @type {HTMLElement} */
|
|
177
|
+
event.target
|
|
178
|
+
);
|
|
179
|
+
const inDots = this.#dots.contains(target);
|
|
180
|
+
if (target !== this.#track && !this.#controls.contains(target)) return;
|
|
181
|
+
const next = nextIndex(event, this.items.length, this.currentIndex, {
|
|
182
|
+
orientation: "horizontal",
|
|
183
|
+
loop: this.loop,
|
|
184
|
+
rtl: isRtl(this)
|
|
185
|
+
});
|
|
186
|
+
if (next < 0) return;
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
this.#go(next, true);
|
|
189
|
+
if (inDots) this.#dots.children[next]?.focus();
|
|
190
|
+
}
|
|
191
|
+
/** Index of the slide closest to the start of the track. */
|
|
192
|
+
#nearest() {
|
|
193
|
+
const track = this.#track.getBoundingClientRect();
|
|
194
|
+
const rtl = isRtl(this);
|
|
195
|
+
let best = -1;
|
|
196
|
+
let distance = Infinity;
|
|
197
|
+
this.items.forEach((item, i) => {
|
|
198
|
+
const rect = item.getBoundingClientRect();
|
|
199
|
+
const d = Math.abs(rtl ? rect.right - track.right : rect.left - track.left);
|
|
200
|
+
if (d < distance) {
|
|
201
|
+
distance = d;
|
|
202
|
+
best = i;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
return best;
|
|
206
|
+
}
|
|
207
|
+
#scrollTo(index, smooth) {
|
|
208
|
+
const item = this.items[index];
|
|
209
|
+
if (!item) return;
|
|
210
|
+
const track = this.#track.getBoundingClientRect();
|
|
211
|
+
const rect = item.getBoundingClientRect();
|
|
212
|
+
const delta = isRtl(this) ? rect.right - track.right : rect.left - track.left;
|
|
213
|
+
if (Math.abs(delta) < 1) return;
|
|
214
|
+
this.#track.scrollBy({ left: delta, behavior: smooth && !prefersReducedMotion() ? "smooth" : "instant" });
|
|
215
|
+
}
|
|
216
|
+
#syncTimer() {
|
|
217
|
+
clearInterval(this.#timer);
|
|
218
|
+
this.#timer = 0;
|
|
219
|
+
const playing = this.playing;
|
|
220
|
+
this.toggleState("playing", playing);
|
|
221
|
+
this.#track.setAttribute("aria-live", playing ? "off" : "polite");
|
|
222
|
+
if (!playing) return;
|
|
223
|
+
this.#timer = setInterval(
|
|
224
|
+
() => {
|
|
225
|
+
const last = this.currentIndex >= this.items.length - 1;
|
|
226
|
+
if (last && !this.loop) this.#go(0, false);
|
|
227
|
+
else this.#step(1, false);
|
|
228
|
+
},
|
|
229
|
+
Math.max(50, this.interval ?? 5e3)
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
update() {
|
|
233
|
+
const items = this.items;
|
|
234
|
+
const count = items.length;
|
|
235
|
+
const current = this.currentIndex;
|
|
236
|
+
const lang = this.closest("[lang]")?.lang || navigator.language;
|
|
237
|
+
const number = new Intl.NumberFormat(lang);
|
|
238
|
+
const name = (i) => this.labelSlide.replace("{index}", number.format(i + 1)).replace("{total}", number.format(count));
|
|
239
|
+
this.internals.ariaLabel = this.label || null;
|
|
240
|
+
this.internals.ariaRoleDescription = this.roledescription;
|
|
241
|
+
items.forEach((item, i) => {
|
|
242
|
+
item.active = i === current;
|
|
243
|
+
item.positionLabel = name(i);
|
|
244
|
+
item.roledescription = this.slideRoledescription;
|
|
245
|
+
});
|
|
246
|
+
const dots = this.#dots;
|
|
247
|
+
while (dots.children.length > count) dots.lastElementChild.remove();
|
|
248
|
+
while (dots.children.length < count) {
|
|
249
|
+
const dot = document.createElement("button");
|
|
250
|
+
dot.type = "button";
|
|
251
|
+
dot.className = "dot";
|
|
252
|
+
dot.setAttribute("role", "tab");
|
|
253
|
+
dot.dataset.index = String(dots.children.length);
|
|
254
|
+
dots.append(dot);
|
|
255
|
+
}
|
|
256
|
+
[...dots.children].forEach((dot, i) => {
|
|
257
|
+
const selected = i === current;
|
|
258
|
+
dot.setAttribute("part", selected ? "dot dot-active" : "dot");
|
|
259
|
+
dot.setAttribute("aria-selected", String(selected));
|
|
260
|
+
dot.setAttribute("aria-label", name(i));
|
|
261
|
+
dot.tabIndex = selected ? 0 : -1;
|
|
262
|
+
});
|
|
263
|
+
dots.setAttribute("aria-label", this.labelDots);
|
|
264
|
+
dots.hidden = count < 2;
|
|
265
|
+
this.#previous.setAttribute("aria-label", this.labelPrevious);
|
|
266
|
+
this.#next.setAttribute("aria-label", this.labelNext);
|
|
267
|
+
const edge = (button, at) => {
|
|
268
|
+
if (at) button.setAttribute("aria-disabled", "true");
|
|
269
|
+
else button.removeAttribute("aria-disabled");
|
|
270
|
+
};
|
|
271
|
+
edge(this.#previous, !this.loop && current <= 0);
|
|
272
|
+
edge(this.#next, !this.loop && current >= count - 1);
|
|
273
|
+
this.#pause.hidden = !this.autoplay;
|
|
274
|
+
this.#pause.setAttribute("aria-label", this.#paused ? this.labelPlay : this.labelPause);
|
|
275
|
+
this.#pause.classList.toggle("paused", this.#paused);
|
|
276
|
+
this.#scrollTo(current, !this.#first);
|
|
277
|
+
this.#first = false;
|
|
278
|
+
this.#syncTimer();
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
define("punica-carousel", PunicaCarousel);
|
|
282
|
+
|
|
283
|
+
export {
|
|
284
|
+
PunicaCarousel
|
|
285
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/topNav/topNavMegaMenuItem.css
|
|
7
|
+
var topNavMegaMenuItem_default = ":host {\n --punica-top-nav-mega-menu-item-radius: var(--punica-radius);\n --punica-top-nav-mega-menu-item-padding: var(--punica-space-8);\n --punica-top-nav-mega-menu-item-icon-background: var(--punica-color-selected);\n --punica-top-nav-mega-menu-item-icon-color: var(--punica-color-primary);\n\n display: block;\n}\n\n.control {\n all: unset;\n box-sizing: border-box;\n display: flex;\n inline-size: 100%;\n padding: var(--punica-top-nav-mega-menu-item-padding);\n border-radius: var(--punica-top-nav-mega-menu-item-radius);\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.control:hover {\n background: var(--punica-color-hover);\n}\n\n.control[aria-current] {\n background: var(--punica-color-selected);\n}\n\n.control:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(-1 * var(--punica-focus-ring-width));\n}\n\n.control:disabled,\n.control[aria-disabled='true'] {\n cursor: default;\n pointer-events: none;\n opacity: var(--punica-disabled-opacity);\n}\n\n.content {\n display: flex;\n align-items: flex-start;\n gap: var(--punica-space-12);\n min-inline-size: 0;\n}\n\n.icon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n inline-size: var(--punica-size-md);\n block-size: var(--punica-size-md);\n border-radius: var(--punica-radius);\n background: var(--punica-top-nav-mega-menu-item-icon-background);\n color: var(--punica-top-nav-mega-menu-item-icon-color);\n font-size: var(--punica-font-size-lg);\n}\n\n.text {\n display: flex;\n flex-direction: column;\n gap: var(--punica-space-2);\n min-inline-size: 0;\n}\n\n.label {\n font-size: var(--punica-font-size-sm);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: var(--punica-line-height-heading);\n}\n\n.description {\n color: var(--punica-color-text-muted);\n font-size: var(--punica-font-size-xs);\n line-height: var(--punica-line-height);\n}\n\n[hidden] {\n display: none !important;\n}\n\n@media (forced-colors: active) {\n .control[aria-current] {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(-1 * var(--punica-border-width));\n }\n .control:disabled,\n .control[aria-disabled='true'] {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/topNav/topNavMegaMenuItem.js
|
|
10
|
+
var PunicaTopNavMegaMenuItem = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
href: {},
|
|
13
|
+
target: {},
|
|
14
|
+
rel: {},
|
|
15
|
+
description: {},
|
|
16
|
+
current: { type: Boolean },
|
|
17
|
+
disabled: { type: Boolean }
|
|
18
|
+
};
|
|
19
|
+
static styles = topNavMegaMenuItem_default;
|
|
20
|
+
static shadowOptions = { delegatesFocus: true };
|
|
21
|
+
static template = `
|
|
22
|
+
<a part="control" class="control" hidden></a>
|
|
23
|
+
<button part="control" class="control" type="button" hidden></button>
|
|
24
|
+
<span class="content">
|
|
25
|
+
<span part="icon" class="icon"><slot name="start"></slot></span>
|
|
26
|
+
<span class="text">
|
|
27
|
+
<span part="label" class="label"><slot></slot></span>
|
|
28
|
+
<span part="description" class="description"><slot name="description"><span class="description-text"></span></slot></span>
|
|
29
|
+
</span>
|
|
30
|
+
</span>
|
|
31
|
+
`;
|
|
32
|
+
#link = this.$("a");
|
|
33
|
+
#button = this.$("button");
|
|
34
|
+
#content = this.$(".content");
|
|
35
|
+
#icon = this.$(".icon");
|
|
36
|
+
#description = this.$(".description");
|
|
37
|
+
#descriptionText = this.$(".description-text");
|
|
38
|
+
#startSlot = this.$('slot[name="start"]');
|
|
39
|
+
#descriptionSlot = this.$('slot[name="description"]');
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.#startSlot.addEventListener("slotchange", () => this.requestUpdate());
|
|
43
|
+
this.#descriptionSlot.addEventListener("slotchange", () => this.requestUpdate());
|
|
44
|
+
}
|
|
45
|
+
update() {
|
|
46
|
+
const asLink = !!this.href;
|
|
47
|
+
const control = asLink ? this.#link : this.#button;
|
|
48
|
+
const other = asLink ? this.#button : this.#link;
|
|
49
|
+
if (this.#content.parentNode !== control) control.append(this.#content);
|
|
50
|
+
control.hidden = false;
|
|
51
|
+
other.hidden = true;
|
|
52
|
+
other.removeAttribute("aria-current");
|
|
53
|
+
if (this.current) control.setAttribute("aria-current", "page");
|
|
54
|
+
else control.removeAttribute("aria-current");
|
|
55
|
+
const link = this.#link;
|
|
56
|
+
if (asLink && !this.disabled) {
|
|
57
|
+
link.setAttribute("href", this.href);
|
|
58
|
+
link.removeAttribute("role");
|
|
59
|
+
link.removeAttribute("aria-disabled");
|
|
60
|
+
} else {
|
|
61
|
+
link.removeAttribute("href");
|
|
62
|
+
link.setAttribute("role", "link");
|
|
63
|
+
link.setAttribute("aria-disabled", "true");
|
|
64
|
+
}
|
|
65
|
+
for (const name of ["target", "rel"]) {
|
|
66
|
+
if (this[name]) link.setAttribute(name, this[name]);
|
|
67
|
+
else link.removeAttribute(name);
|
|
68
|
+
}
|
|
69
|
+
this.#button.disabled = this.disabled;
|
|
70
|
+
this.#descriptionText.textContent = this.description ?? "";
|
|
71
|
+
const hasDescription = !!this.description || this.#descriptionSlot.assignedNodes().length > 0;
|
|
72
|
+
this.#description.hidden = !hasDescription;
|
|
73
|
+
this.#icon.hidden = !this.#startSlot.assignedNodes({ flatten: true }).length;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
define("punica-top-nav-mega-menu-item", PunicaTopNavMegaMenuItem);
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
PunicaTopNavMegaMenuItem
|
|
80
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/avatar/avatar.css
|
|
7
|
+
var avatar_default = ":host {\n --punica-avatar-size: var(--punica-size-md);\n --punica-avatar-radius: var(--punica-radius-sm);\n /* A grey drawn from the text colour: --punica-color-neutral under the text\n colour is 2.9:1 in dark mode. */\n --punica-avatar-background: color-mix(in srgb, var(--punica-color-text) 16%, var(--punica-color-surface));\n --punica-avatar-color: var(--punica-color-text);\n\n display: inline-flex;\n position: relative;\n flex: none;\n inline-size: var(--punica-avatar-size);\n block-size: var(--punica-avatar-size);\n vertical-align: middle;\n}\n\n:host([size='small']) {\n --punica-avatar-size: var(--punica-size-sm);\n}\n:host([size='large']) {\n --punica-avatar-size: var(--punica-size-lg);\n}\n\n:host([color='primary']) {\n --punica-avatar-background: var(--punica-color-primary);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n:host([color='secondary']) {\n --punica-avatar-background: var(--punica-color-secondary);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n:host([color='error']) {\n --punica-avatar-background: var(--punica-color-error);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n:host([color='warning']) {\n --punica-avatar-background: var(--punica-color-warning);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n:host([color='info']) {\n --punica-avatar-background: var(--punica-color-info);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n:host([color='success']) {\n --punica-avatar-background: var(--punica-color-success);\n --punica-avatar-color: var(--punica-color-on-accent);\n}\n\n.base {\n display: flex;\n align-items: center;\n justify-content: center;\n inline-size: 100%;\n block-size: 100%;\n border-radius: 50%;\n background: var(--punica-avatar-background);\n color: var(--punica-avatar-color);\n font-family: var(--punica-font-family);\n font-size: calc(var(--punica-avatar-size) * 0.4);\n font-weight: var(--punica-font-weight-semi-bold);\n line-height: 1;\n overflow: hidden;\n user-select: none;\n}\n\n:host([shape='square']) .base {\n border-radius: var(--punica-avatar-radius);\n}\n\n.image {\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n}\n.image[hidden] {\n display: none;\n}\n\n/* One of the three shows: the picture, else the initials, else the slot. */\n.initials,\nslot:not([name]) {\n display: none;\n}\n:host(:state(initials)) .initials {\n display: inline;\n}\n:host(:not(:state(image)):not(:state(initials))) slot:not([name]) {\n display: contents;\n}\n\n.status {\n position: absolute;\n inset-block-end: 0;\n inset-inline-end: 0;\n display: flex;\n}\n/* The ring is on the mark, so an empty corner draws nothing. */\n::slotted([slot='status']) {\n border-radius: var(--punica-radius-full);\n box-shadow: 0 0 0 var(--punica-space-2) var(--punica-color-surface);\n}\n\n@media (forced-colors: active) {\n .base {\n border: var(--punica-border-width) solid CanvasText;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/avatar/avatar.js
|
|
10
|
+
function initials(name, language) {
|
|
11
|
+
const words = (name ?? "").trim().split(/\s+/).filter(Boolean);
|
|
12
|
+
if (!words.length) return "";
|
|
13
|
+
const first = [...words[0]][0];
|
|
14
|
+
const last = words.length > 1 ? [...words[words.length - 1]][0] : "";
|
|
15
|
+
return (first + last).toLocaleUpperCase(language);
|
|
16
|
+
}
|
|
17
|
+
var PunicaAvatar = class extends PunicaElement {
|
|
18
|
+
static properties = {
|
|
19
|
+
src: {},
|
|
20
|
+
name: {},
|
|
21
|
+
label: {},
|
|
22
|
+
alt: {},
|
|
23
|
+
size: {},
|
|
24
|
+
shape: {},
|
|
25
|
+
color: {}
|
|
26
|
+
};
|
|
27
|
+
static styles = avatar_default;
|
|
28
|
+
static template = `
|
|
29
|
+
<span part="base" class="base">
|
|
30
|
+
<img part="image" class="image" alt="" hidden>
|
|
31
|
+
<span part="initials" class="initials" aria-hidden="true"></span>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</span>
|
|
34
|
+
<span part="status" class="status"><slot name="status"></slot></span>
|
|
35
|
+
`;
|
|
36
|
+
#image = this.$(".image");
|
|
37
|
+
#initials = this.$(".initials");
|
|
38
|
+
#loaded = false;
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
this.#image.addEventListener("load", () => this.#show(true));
|
|
42
|
+
this.#image.addEventListener("error", () => this.#show(false));
|
|
43
|
+
}
|
|
44
|
+
update(changed) {
|
|
45
|
+
if (changed.has("src")) {
|
|
46
|
+
this.#show(false);
|
|
47
|
+
if (this.src) this.#image.setAttribute("src", this.src);
|
|
48
|
+
else this.#image.removeAttribute("src");
|
|
49
|
+
}
|
|
50
|
+
const language = this.closest("[lang]")?.lang || navigator.language;
|
|
51
|
+
this.#initials.textContent = initials(this.name, language);
|
|
52
|
+
this.#states();
|
|
53
|
+
const name = this.label || this.alt || this.name;
|
|
54
|
+
this.internals.role = name ? "img" : null;
|
|
55
|
+
this.internals.ariaLabel = name || null;
|
|
56
|
+
}
|
|
57
|
+
#show(loaded) {
|
|
58
|
+
this.#loaded = loaded;
|
|
59
|
+
this.#image.hidden = !loaded;
|
|
60
|
+
this.#states();
|
|
61
|
+
}
|
|
62
|
+
#states() {
|
|
63
|
+
this.toggleState("image", this.#loaded);
|
|
64
|
+
this.toggleState("initials", !this.#loaded && this.#initials.textContent !== "");
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
define("punica-avatar", PunicaAvatar);
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
PunicaAvatar
|
|
71
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PunicaElement,
|
|
3
|
+
define
|
|
4
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
5
|
+
|
|
6
|
+
// src/components/listView/listItem.css
|
|
7
|
+
var listItem_default = ":host {\n --punica-list-item-padding: var(--punica-space-8) var(--punica-space-16);\n --punica-list-item-min-height: var(--punica-size-lg);\n --punica-list-item-gap: var(--punica-space-12);\n --punica-list-item-hover-background: var(--punica-color-hover);\n --punica-list-item-selected-background: var(--punica-color-selected);\n\n display: block;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.row {\n display: flex;\n align-items: center;\n min-block-size: var(--punica-list-item-min-height);\n}\n\n.base {\n all: unset;\n box-sizing: border-box;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n align-self: stretch;\n gap: var(--punica-list-item-gap);\n min-inline-size: 0;\n padding: var(--punica-list-item-padding);\n color: inherit;\n font: inherit;\n text-align: start;\n}\n\n.content {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\n::slotted([slot='end']) {\n flex: 0 0 auto;\n margin-inline-end: var(--punica-space-16);\n}\n\nbutton.base,\na.base {\n cursor: pointer;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\nbutton.base:hover,\na.base[href]:hover {\n background: var(--punica-list-item-hover-background);\n}\n\n:host([selected]) .base {\n background: var(--punica-list-item-selected-background);\n}\n\n.base:focus-visible {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\nbutton.base:disabled,\na.base[aria-disabled='true'] {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n@media (forced-colors: active) {\n :host([selected]) .base {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(var(--punica-border-width) * -1);\n }\n button.base:disabled,\n a.base[aria-disabled='true'] {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
8
|
+
|
|
9
|
+
// src/components/listView/listItem.js
|
|
10
|
+
var PunicaListItem = class extends PunicaElement {
|
|
11
|
+
static properties = {
|
|
12
|
+
interactive: { type: Boolean },
|
|
13
|
+
href: {},
|
|
14
|
+
target: {},
|
|
15
|
+
rel: {},
|
|
16
|
+
selected: { type: Boolean },
|
|
17
|
+
disabled: { type: Boolean },
|
|
18
|
+
value: {}
|
|
19
|
+
};
|
|
20
|
+
static styles = listItem_default;
|
|
21
|
+
static shadowOptions = { delegatesFocus: true };
|
|
22
|
+
static template = `
|
|
23
|
+
<div part="row" class="row">
|
|
24
|
+
<div part="base" class="base">
|
|
25
|
+
<slot name="start"></slot>
|
|
26
|
+
<span part="content" class="content"><slot></slot></span>
|
|
27
|
+
</div>
|
|
28
|
+
<slot name="end"></slot>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
#base = this.$(".base");
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.internals.role = "listitem";
|
|
35
|
+
this.shadowRoot.addEventListener("click", (event) => {
|
|
36
|
+
const target = (
|
|
37
|
+
/** @type {Element} */
|
|
38
|
+
event.target
|
|
39
|
+
);
|
|
40
|
+
if (!this.interactive || !target.closest(".base")) return;
|
|
41
|
+
if (this.disabled) {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.emit("select", { value: this.value, item: this });
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Moves focus to the button or link of an interactive row. */
|
|
49
|
+
focus(options) {
|
|
50
|
+
this.#base.focus(options);
|
|
51
|
+
}
|
|
52
|
+
update() {
|
|
53
|
+
const tag = !this.interactive ? "div" : this.href != null ? "a" : "button";
|
|
54
|
+
if (this.#base.localName !== tag) {
|
|
55
|
+
const next = document.createElement(tag);
|
|
56
|
+
next.setAttribute("part", "base");
|
|
57
|
+
next.className = "base";
|
|
58
|
+
next.append(...this.#base.childNodes);
|
|
59
|
+
this.#base.replaceWith(next);
|
|
60
|
+
this.#base = next;
|
|
61
|
+
}
|
|
62
|
+
const base = (
|
|
63
|
+
/** @type {any} */
|
|
64
|
+
this.#base
|
|
65
|
+
);
|
|
66
|
+
if (tag === "button") {
|
|
67
|
+
base.type = "button";
|
|
68
|
+
base.disabled = this.disabled;
|
|
69
|
+
} else if (tag === "a") {
|
|
70
|
+
if (this.disabled) {
|
|
71
|
+
base.removeAttribute("href");
|
|
72
|
+
base.setAttribute("aria-disabled", "true");
|
|
73
|
+
} else {
|
|
74
|
+
base.setAttribute("href", this.href);
|
|
75
|
+
base.removeAttribute("aria-disabled");
|
|
76
|
+
}
|
|
77
|
+
for (const name of ["target", "rel"]) {
|
|
78
|
+
if (this[name]) base.setAttribute(name, this[name]);
|
|
79
|
+
else base.removeAttribute(name);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (this.selected && tag !== "div") base.setAttribute("aria-current", "true");
|
|
83
|
+
else base.removeAttribute("aria-current");
|
|
84
|
+
this.toggleState("selected", this.selected);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
define("punica-list-item", PunicaListItem);
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
PunicaListItem
|
|
91
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
icons
|
|
3
|
+
} from "./chunk-YSGWORUD.js";
|
|
4
|
+
import {
|
|
5
|
+
PunicaElement,
|
|
6
|
+
define
|
|
7
|
+
} from "./chunk-Y7B65FYJ.js";
|
|
8
|
+
|
|
9
|
+
// src/components/tree/treeItem.css
|
|
10
|
+
var treeItem_default = ":host {\n --punica-tree-item-padding: var(--punica-space-4) var(--punica-space-8);\n --punica-tree-item-hover-background: var(--punica-color-hover);\n --punica-tree-item-selected-background: var(--punica-color-selected);\n\n display: block;\n outline: none;\n color: var(--punica-color-text);\n font-family: var(--punica-font-family);\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--punica-space-6);\n min-block-size: var(--punica-size-sm);\n padding: var(--punica-tree-item-padding);\n border-radius: var(--punica-radius-sm);\n cursor: pointer;\n user-select: none;\n transition: background-color var(--punica-duration-fast) var(--punica-ease);\n}\n\n.row:hover {\n background: var(--punica-tree-item-hover-background);\n}\n\n:host([selected]) .row {\n background: var(--punica-tree-item-selected-background);\n}\n\n:host(:focus-visible) .row {\n outline: var(--punica-focus-ring);\n outline-offset: calc(var(--punica-focus-ring-width) * -1);\n}\n\n:host([disabled]) .row {\n cursor: default;\n opacity: var(--punica-disabled-opacity);\n}\n\n:host([disabled]) .row:hover {\n background: none;\n}\n\n.toggle {\n display: inline-flex;\n flex: 0 0 auto;\n visibility: hidden;\n transition: transform var(--punica-duration-fast) var(--punica-ease);\n}\n\n:host(:state(branch)) .toggle {\n visibility: visible;\n}\n\n:host(:dir(rtl)) .toggle {\n transform: scaleX(-1);\n}\n\n:host([expanded]) .toggle {\n transform: rotate(90deg);\n}\n\n:host([expanded]:dir(rtl)) .toggle {\n transform: scaleX(-1) rotate(90deg);\n}\n\n.label {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n\n.spinner {\n display: none;\n flex: 0 0 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\n:host([loading]) .spinner {\n display: block;\n}\n\n.group {\n display: none;\n padding-inline-start: var(--punica-tree-item-indent, var(--punica-space-20));\n}\n\n:host([expanded]) .group {\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 :host([selected]) .row {\n outline: var(--punica-border-width) solid Highlight;\n outline-offset: calc(var(--punica-border-width) * -1);\n }\n :host([disabled]) .row {\n color: GrayText;\n opacity: 1;\n }\n}\n";
|
|
11
|
+
|
|
12
|
+
// src/components/tree/treeItem.js
|
|
13
|
+
var ITEM = "punica-tree-item";
|
|
14
|
+
var PunicaTreeItem = class extends PunicaElement {
|
|
15
|
+
static properties = {
|
|
16
|
+
label: {},
|
|
17
|
+
value: {},
|
|
18
|
+
expanded: { type: Boolean },
|
|
19
|
+
selected: { type: Boolean },
|
|
20
|
+
disabled: { type: Boolean },
|
|
21
|
+
lazy: { type: Boolean },
|
|
22
|
+
loading: { type: Boolean }
|
|
23
|
+
};
|
|
24
|
+
static styles = treeItem_default;
|
|
25
|
+
static template = `
|
|
26
|
+
<div part="row" class="row">
|
|
27
|
+
<span part="toggle" class="toggle" aria-hidden="true">${icons.chevronEnd}</span>
|
|
28
|
+
<slot name="start"></slot>
|
|
29
|
+
<span part="label" class="label"><slot name="label"><span class="label-text"></span></slot></span>
|
|
30
|
+
<slot name="end"></slot>
|
|
31
|
+
<span part="spinner" class="spinner" aria-hidden="true"></span>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="group" class="group" role="group"><slot></slot></div>
|
|
34
|
+
`;
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
this.internals.role = "treeitem";
|
|
38
|
+
this.$("slot:not([name])").addEventListener("slotchange", () => {
|
|
39
|
+
this.requestUpdate();
|
|
40
|
+
for (const child of this.#children) child.requestUpdate?.();
|
|
41
|
+
this.#tree?.requestUpdate?.();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get #children() {
|
|
45
|
+
return [...this.children].filter((el) => el.localName === ITEM);
|
|
46
|
+
}
|
|
47
|
+
/** @returns {any} */
|
|
48
|
+
get #tree() {
|
|
49
|
+
return this.closest("punica-tree");
|
|
50
|
+
}
|
|
51
|
+
connected() {
|
|
52
|
+
if (!this.hasAttribute("tabindex")) this.tabIndex = -1;
|
|
53
|
+
this.requestUpdate();
|
|
54
|
+
}
|
|
55
|
+
update(changed) {
|
|
56
|
+
const internals = this.internals;
|
|
57
|
+
const tree = this.#tree;
|
|
58
|
+
const branch = this.lazy || this.#children.length > 0;
|
|
59
|
+
this.toggleState("branch", branch);
|
|
60
|
+
if (this.lazy && this.expanded && !this.loading) {
|
|
61
|
+
this.loading = true;
|
|
62
|
+
this.emit("load", { item: this });
|
|
63
|
+
} else if (this.loading && !this.lazy) {
|
|
64
|
+
this.loading = false;
|
|
65
|
+
}
|
|
66
|
+
let level = 1;
|
|
67
|
+
for (let p = this.parentElement; p && p.localName === ITEM; p = p.parentElement) level++;
|
|
68
|
+
const siblings = this.parentElement ? [...this.parentElement.children].filter((el) => el.localName === ITEM) : [this];
|
|
69
|
+
internals.ariaLevel = String(level);
|
|
70
|
+
internals.ariaSetSize = String(siblings.length);
|
|
71
|
+
internals.ariaPosInSet = String(siblings.indexOf(this) + 1);
|
|
72
|
+
internals.ariaLabel = this.label || null;
|
|
73
|
+
internals.ariaExpanded = branch ? String(this.expanded) : null;
|
|
74
|
+
internals.ariaDisabled = this.disabled ? "true" : null;
|
|
75
|
+
internals.ariaBusy = this.loading ? "true" : null;
|
|
76
|
+
const selection = tree?.selection ?? tree?.getAttribute("selection") ?? "none";
|
|
77
|
+
internals.ariaSelected = selection === "none" ? null : String(this.selected);
|
|
78
|
+
this.$(".label-text").textContent = this.label ?? "";
|
|
79
|
+
if (changed.has("expanded") || changed.has("disabled") || changed.has("lazy")) tree?.requestUpdate?.();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
define("punica-tree-item", PunicaTreeItem);
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
PunicaTreeItem
|
|
86
|
+
};
|