@leavepulse/ui 0.43.3 → 0.44.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/README.md +75 -7
- package/dist/assets/{LpCommandPalette-DH7sPcKP.css → LpCommandPalette-DCP5g2ik.css} +21 -21
- package/dist/assets/{LpDropzone-BBoWvi-J.css → LpDropzone-i4BdMi1H.css} +12 -12
- package/dist/assets/{LpImageEditor-Ct7Y3aNu.css → LpImageEditor-CbMA82g8.css} +6 -6
- package/dist/assets/{LpShortcutsDialog-C6YoQ8_M.css → LpShortcutsDialog-ChUyU7oV.css} +7 -7
- package/dist/assets/{LpSkeleton-D7xU8IPV.css → LpSkeleton-H3Z5dEIk.css} +4 -1
- package/dist/assets/{LpTable-BgPLJOXa.css → LpTable-DDQNdf86.css} +9 -9
- package/dist/chunks/ContextMenuItems-CrfeNPWT.js +123 -0
- package/dist/chunks/{LayoutCanvas-Dd20boUG.js → LayoutCanvas-D-jPOAvg.js} +26 -9
- package/dist/chunks/{LayoutNode-DGpZA9LX.js → LayoutNode-D8Xy9N-o.js} +20 -8
- package/dist/chunks/{LpActionBar-BlvtGB2P.js → LpActionBar-BbwCF6l5.js} +24 -10
- package/dist/chunks/{LpAddressInput-B-Zvxsn7.js → LpAddressInput-BrOqkZqg.js} +53 -48
- package/dist/chunks/{LpAlert-BAYHDSS1.js → LpAlert-DkOIjsbq.js} +15 -8
- package/dist/chunks/{LpAppShell-BGQVIY-3.js → LpAppShell-BUKPcHco.js} +51 -24
- package/dist/chunks/{LpAutocomplete-DExlIZe_.js → LpAutocomplete-DxV3Y9h4.js} +50 -23
- package/dist/chunks/{LpAvatar-B3-xAOH3.js → LpAvatar-ClBbEYZN.js} +17 -8
- package/dist/chunks/LpBreadcrumbs-B8IJgFIc.js +95 -0
- package/dist/chunks/{LpButton-5VXXCjwF.js → LpButton-kqJBHIIb.js} +44 -14
- package/dist/chunks/{LpCard-BhI1N_vL.js → LpCard-CpRByR0q.js} +1 -1
- package/dist/chunks/{LpCheckbox-CVccKYaH.js → LpCheckbox-DpqchzH4.js} +7 -3
- package/dist/chunks/{LpCodeBlock-Bo0B4TFR.js → LpCodeBlock-DeHJPq7p.js} +48 -16
- package/dist/chunks/{LpColorPicker-BlXea7LM.js → LpColorPicker-Bhf1qxhB.js} +32 -9
- package/dist/chunks/{LpConfirmDialog-Q-bxff8z.js → LpConfirmDialog-CIUOSnWo.js} +58 -16
- package/dist/chunks/LpConfirmHost-CDm0Wtpv.js +49 -0
- package/dist/chunks/LpContextMenu-DQw5dGfG.js +68 -0
- package/dist/chunks/LpDatePicker-Drirx1AK.js +191 -0
- package/dist/chunks/{LpDrawer-BZ6k3hvo.js → LpDrawer-bScx-KMO.js} +63 -26
- package/dist/chunks/{LpFileTree-_5vFBgaK.js → LpFileTree-CSI_5SK2.js} +23 -8
- package/dist/chunks/{LpFileTreeNode-BdcIYKIE.js → LpFileTreeNode-B4MiSQX2.js} +2 -2
- package/dist/chunks/LpFormField-CIk5qosh.js +87 -0
- package/dist/chunks/{LpInput-9EXWUM9B.js → LpInput-C0e8y8_d.js} +26 -11
- package/dist/chunks/{LpLightbox-2sYVMY-S.js → LpLightbox-Mr0W_6HK.js} +147 -60
- package/dist/chunks/{LpLink-DCND-zyu.js → LpLink-Krkjhe_y.js} +15 -6
- package/dist/chunks/{LpLogViewer-CaRy5MeS.js → LpLogViewer-YBOaFnc_.js} +68 -34
- package/dist/chunks/{LpMapPicker-ul4oYno6.js → LpMapPicker-NUzS9e37.js} +38 -13
- package/dist/chunks/{LpMediaGallery-FF-NquIo.js → LpMediaGallery-DfJmMW0I.js} +6 -3
- package/dist/chunks/{LpModal-Bt0pQCI_.js → LpModal-DPwGKBPv.js} +49 -26
- package/dist/chunks/{LpModalNav-YaifHrXC.js → LpModalNav-DPg5H9f3.js} +9 -6
- package/dist/chunks/{LpNotificationBell-DyGGsMAM.js → LpNotificationBell-t5yn-siX.js} +58 -24
- package/dist/chunks/{LpNumberField-CWuX08iX.js → LpNumberField-DWnQKktS.js} +20 -7
- package/dist/chunks/{LpNumberFlow-amWYaeuA.js → LpNumberFlow-z4WPZcZu.js} +22 -12
- package/dist/chunks/{LpOtpInput-y2v-pmiN.js → LpOtpInput-CziPF3Oq.js} +37 -8
- package/dist/chunks/{LpPagination-5FxjmmB5.js → LpPagination-DFngX7Xo.js} +30 -19
- package/dist/chunks/{LpPasswordInput--sjYCkLS.js → LpPasswordInput-CWVDuBJ5.js} +10 -7
- package/dist/chunks/{LpPhoneInput-BDSKVl_z.js → LpPhoneInput-CD-ZTeSd.js} +57 -33
- package/dist/chunks/{LpPie-D6OnzwlJ.js → LpPie-BLco31Nx.js} +78 -21
- package/dist/chunks/{LpPopover-8268UmlC.js → LpPopover-p_e_shN3.js} +4 -2
- package/dist/chunks/{LpProgress-Btq5W4Ut.js → LpProgress-CBU1iI69.js} +5 -4
- package/dist/chunks/{LpRadioGroup-xPIuVDO_.js → LpRadioGroup-DmEW0l78.js} +9 -2
- package/dist/chunks/{LpSegmented-fV0Sk92p.js → LpSegmented-Dejd7cIx.js} +7 -3
- package/dist/chunks/{LpSelect-ANIVtrpM.js → LpSelect-DrRD9I7L.js} +40 -18
- package/dist/chunks/{LpSidebar-ClBUwoEz.js → LpSidebar-BgwUNWpJ.js} +30 -22
- package/dist/chunks/{LpSidebarNav-llOcs_Fn.js → LpSidebarNav-Bqxz8aWT.js} +14 -9
- package/dist/chunks/{LpSkeleton-CTI-vBgW.js → LpSkeleton-BB6XIV-w.js} +1 -1
- package/dist/chunks/{LpSlider-BwNIBkAK.js → LpSlider-Cuzmrd7p.js} +7 -2
- package/dist/chunks/{LpSparkline-C6xQ2dwv.js → LpSparkline-CB80N8SJ.js} +11 -4
- package/dist/chunks/{LpStat-CQaW8R--.js → LpStat-dXtyrdX9.js} +1 -1
- package/dist/chunks/{LpSwitch-Blizvqyt.js → LpSwitch-B1aLKulj.js} +40 -26
- package/dist/chunks/{LpTableOfContents-CjvxPMpU.js → LpTableOfContents-BUcAfGPQ.js} +36 -41
- package/dist/chunks/{LpTabs-Cefe_lys.js → LpTabs-_qMVaZJ6.js} +19 -5
- package/dist/chunks/LpTextarea-yP8hGedR.js +77 -0
- package/dist/chunks/LpThemeProvider-Wjm7Tuit.js +35 -0
- package/dist/chunks/LpThemeSwitcher-CKLc10KZ.js +169 -0
- package/dist/chunks/{LpTilt-DuyKbpkA.js → LpTilt-B7KHX1zH.js} +2 -2
- package/dist/chunks/{LpTimeField-K6nAGboX.js → LpTimeField-C5HRgS5H.js} +13 -7
- package/dist/chunks/{LpToaster-gDB1EaU3.js → LpToaster--oT6lfhL.js} +57 -28
- package/dist/chunks/{LpTooltip-hCLPAqMG.js → LpTooltip-CBdzeKNf.js} +13 -6
- package/dist/chunks/LpTooltipProvider-CftjV7Xc.js +25 -0
- package/dist/chunks/{LpTopologyCanvas-Cm1L39uL.js → LpTopologyCanvas-DocsLal3.js} +6 -1
- package/dist/chunks/{LpUptimeBar-DvAMno0S.js → LpUptimeBar-DLtxOMRy.js} +43 -14
- package/dist/chunks/{LpThemeSwitcher-Cue-myST.js → useTheme-C8JHUlPM.js} +173 -215
- package/dist/component-names.d.ts +1 -1
- package/dist/components/ContextMenuItems.vue.d.ts +8 -0
- package/dist/components/ContextMenuItems.vue.js +4 -0
- package/dist/components/LayoutCanvas.vue.js +1 -1
- package/dist/components/LayoutNode.vue.d.ts +4 -0
- package/dist/components/LayoutNode.vue.js +1 -1
- package/dist/components/LpActionBar.vue.d.ts +3 -0
- package/dist/components/LpActionBar.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.d.ts +9 -0
- package/dist/components/LpAlert.vue.js +1 -1
- package/dist/components/LpAppShell.vue.d.ts +10 -0
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.d.ts +31 -6
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpAvatar.vue.d.ts +3 -3
- package/dist/components/LpAvatar.vue.js +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpBreadcrumbs.vue.d.ts +13 -9
- package/dist/components/LpBreadcrumbs.vue.js +1 -1
- package/dist/components/LpButton.vue.d.ts +35 -98
- package/dist/components/LpButton.vue.js +1 -1
- package/dist/components/LpCard.vue.js +1 -1
- package/dist/components/LpChart.vue.d.ts +31 -2
- package/dist/components/LpChart.vue.js +317 -95
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.d.ts +2 -0
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.d.ts +8 -10
- package/dist/components/LpCommandPalette.vue.js +88 -78
- package/dist/components/LpConfirmDialog.vue.d.ts +15 -3
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.d.ts +9 -0
- package/dist/components/LpConfirmHost.vue.js +4 -0
- package/dist/components/LpContextMenu.vue.d.ts +3 -5
- package/dist/components/LpContextMenu.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.d.ts +24 -6
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDrawer.vue.d.ts +10 -0
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +22 -6
- package/dist/components/LpFileTree.vue.d.ts +11 -2
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpFormField.vue.d.ts +9 -0
- package/dist/components/LpFormField.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.js +92 -57
- package/dist/components/LpInput.vue.d.ts +3 -3
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLightbox.vue.d.ts +17 -0
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLink.vue.d.ts +11 -11
- package/dist/components/LpLink.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.d.ts +20 -2
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.d.ts +4 -4
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.d.ts +16 -6
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.d.ts +0 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.d.ts +11 -2
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +2 -0
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpNumberFlow.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPagination.vue.d.ts +2 -0
- package/dist/components/LpPagination.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpPie.vue.d.ts +21 -2
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPopover.vue.d.ts +2 -0
- package/dist/components/LpPopover.vue.js +1 -1
- package/dist/components/LpProgress.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpSection.vue.d.ts +1 -1
- package/dist/components/LpSegmented.vue.d.ts +5 -0
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.d.ts +1 -0
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.d.ts +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +11 -8
- package/dist/components/LpSidebar.vue.d.ts +6 -2
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpSkeleton.vue.js +1 -1
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpSparkline.vue.d.ts +1 -0
- package/dist/components/LpSparkline.vue.js +1 -1
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.d.ts +23 -1
- package/dist/components/LpTable.vue.js +74 -36
- package/dist/components/LpTableOfContents.vue.d.ts +4 -2
- package/dist/components/LpTableOfContents.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +2 -0
- package/dist/components/LpTabs.vue.js +1 -1
- package/dist/components/LpTextarea.vue.d.ts +19 -6
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeProvider.vue.d.ts +22 -0
- package/dist/components/LpThemeProvider.vue.js +4 -0
- package/dist/components/LpThemeSwitcher.vue.d.ts +13 -0
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTilt.vue.js +1 -1
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpToaster.vue.d.ts +6 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +1 -2
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTooltipProvider.vue.d.ts +22 -0
- package/dist/components/LpTooltipProvider.vue.js +4 -0
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.d.ts +4 -0
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/chart.d.ts +32 -1
- package/dist/components/chart.js +39 -4
- package/dist/components/codeHighlight.d.ts +6 -0
- package/dist/components/codeHighlight.js +92 -20
- package/dist/components/color.d.ts +1 -1
- package/dist/components/color.js +20 -9
- package/dist/components/commandSearch.d.ts +0 -1
- package/dist/components/commandSearch.js +1 -17
- package/dist/components/confirm.d.ts +25 -0
- package/dist/components/confirm.js +26 -0
- package/dist/components/countries.d.ts +6 -0
- package/dist/components/countries.js +7 -0
- package/dist/components/fileTree.js +16 -7
- package/dist/components/imageCrop.d.ts +42 -0
- package/dist/components/imageCrop.js +47 -0
- package/dist/components/link.d.ts +12 -0
- package/dist/components/link.js +19 -0
- package/dist/components/modalDepth.d.ts +18 -2
- package/dist/components/modalDepth.js +17 -5
- package/dist/components/otp.d.ts +5 -0
- package/dist/components/otp.js +10 -0
- package/dist/components/sidebar.d.ts +7 -1
- package/dist/components/tableSort.d.ts +8 -0
- package/dist/components/tableSort.js +31 -0
- package/dist/composables/useField.d.ts +34 -0
- package/dist/composables/useField.js +45 -0
- package/dist/composables/useFormDraft.d.ts +10 -3
- package/dist/composables/useFormDraft.js +9 -14
- package/dist/composables/useHotkeys.d.ts +17 -1
- package/dist/composables/useHotkeys.js +55 -18
- package/dist/composables/useInputFilter.d.ts +17 -0
- package/dist/composables/useInputFilter.js +47 -10
- package/dist/composables/useLpConfig.d.ts +24 -0
- package/dist/composables/useLpConfig.js +44 -0
- package/dist/composables/useRovingFocus.js +7 -0
- package/dist/composables/useTilt.d.ts +2 -2
- package/dist/composables/useTilt.js +5 -6
- package/dist/composables/useToast.d.ts +20 -0
- package/dist/composables/useToast.js +28 -4
- package/dist/composables/useZoomPan.d.ts +3 -3
- package/dist/composables/useZoomPan.js +4 -4
- package/dist/index.d.ts +33 -3
- package/dist/index.js +185 -139
- package/dist/layout/tree.d.ts +2 -0
- package/dist/layout/tree.js +16 -1
- package/dist/layout/useLayout.d.ts +15 -0
- package/dist/layout/useLayout.js +41 -14
- package/dist/theme/useTheme.d.ts +32 -9
- package/package.json +8 -7
- package/src/component-names.ts +5 -7
- package/src/components/ContextMenuItems.vue +88 -0
- package/src/components/LayoutCanvas.vue +26 -6
- package/src/components/LayoutNode.vue +19 -2
- package/src/components/LpActionBar.vue +30 -7
- package/src/components/LpAddressInput.vue +57 -41
- package/src/components/LpAlert.vue +16 -3
- package/src/components/LpAppShell.vue +45 -12
- package/src/components/LpAutocomplete.vue +46 -10
- package/src/components/LpAvatar.vue +19 -5
- package/src/components/LpBreadcrumbs.vue +65 -41
- package/src/components/LpButton.vue +59 -13
- package/src/components/LpChart.vue +272 -28
- package/src/components/LpCheckbox.vue +7 -3
- package/src/components/LpCodeBlock.vue +50 -14
- package/src/components/LpColorPicker.vue +39 -9
- package/src/components/LpCommandPalette.vue +36 -25
- package/src/components/LpConfirmDialog.vue +68 -17
- package/src/components/LpConfirmHost.vue +59 -0
- package/src/components/LpContextMenu.vue +14 -115
- package/src/components/LpDatePicker.vue +99 -68
- package/src/components/LpDrawer.vue +56 -19
- package/src/components/LpDropzone.vue +21 -4
- package/src/components/LpFileTree.vue +33 -7
- package/src/components/LpFormField.vue +30 -7
- package/src/components/LpImageEditor.vue +96 -57
- package/src/components/LpInput.vue +18 -7
- package/src/components/LpLightbox.vue +140 -29
- package/src/components/LpLink.vue +24 -13
- package/src/components/LpLogViewer.vue +86 -17
- package/src/components/LpMapPicker.vue +36 -13
- package/src/components/LpMediaGallery.vue +8 -2
- package/src/components/LpModal.vue +53 -27
- package/src/components/LpModalNav.vue +5 -2
- package/src/components/LpNotificationBell.vue +63 -17
- package/src/components/LpNumberField.vue +21 -6
- package/src/components/LpNumberFlow.vue +26 -10
- package/src/components/LpOtpInput.vue +43 -8
- package/src/components/LpPagination.vue +23 -7
- package/src/components/LpPasswordInput.vue +4 -1
- package/src/components/LpPhoneInput.vue +53 -27
- package/src/components/LpPie.vue +94 -15
- package/src/components/LpPopover.vue +3 -0
- package/src/components/LpProgress.vue +5 -3
- package/src/components/LpRadioGroup.vue +9 -2
- package/src/components/LpSegmented.vue +12 -2
- package/src/components/LpSelect.vue +0 -0
- package/src/components/LpShortcutsDialog.vue +8 -3
- package/src/components/LpSidebar.vue +14 -9
- package/src/components/LpSidebarNav.vue +17 -5
- package/src/components/LpSkeleton.vue +4 -1
- package/src/components/LpSlider.vue +7 -1
- package/src/components/LpSparkline.vue +11 -3
- package/src/components/LpSwitch.vue +30 -7
- package/src/components/LpTable.vue +91 -32
- package/src/components/LpTableOfContents.vue +50 -32
- package/src/components/LpTabs.vue +23 -6
- package/src/components/LpTextarea.vue +44 -6
- package/src/components/LpThemeProvider.vue +41 -0
- package/src/components/LpThemeSwitcher.vue +64 -17
- package/src/components/LpTilt.vue +2 -2
- package/src/components/LpTimeField.vue +14 -3
- package/src/components/LpToaster.vue +66 -26
- package/src/components/LpTooltip.vue +22 -5
- package/src/components/LpTooltipProvider.vue +24 -0
- package/src/components/LpTopologyCanvas.vue +12 -1
- package/src/components/LpUptimeBar.vue +46 -8
- package/src/components/chart.ts +77 -5
- package/src/components/codeHighlight.ts +111 -15
- package/src/components/color.ts +30 -9
- package/src/components/commandSearch.ts +0 -17
- package/src/components/confirm.ts +58 -0
- package/src/components/countries.ts +12 -0
- package/src/components/fileTree.ts +19 -7
- package/src/components/imageCrop.ts +107 -0
- package/src/components/link.ts +34 -0
- package/src/components/modalDepth.ts +48 -6
- package/src/components/otp.ts +16 -0
- package/src/components/sidebar.ts +7 -1
- package/src/components/tableSort.ts +37 -0
- package/src/composables/useField.ts +79 -0
- package/src/composables/useFormDraft.ts +25 -20
- package/src/composables/useHotkeys.ts +89 -18
- package/src/composables/useInputFilter.ts +77 -14
- package/src/composables/useLpConfig.ts +87 -0
- package/src/composables/useRovingFocus.ts +11 -0
- package/src/composables/useTilt.ts +5 -6
- package/src/composables/useToast.ts +56 -4
- package/src/composables/useZoomPan.ts +6 -6
- package/src/index.ts +38 -3
- package/src/layout/tree.ts +30 -0
- package/src/layout/useLayout.ts +68 -18
- package/src/nuxt.ts +59 -17
- package/src/runtime/config.plugin.ts +14 -0
- package/src/runtime/theme.plugin.ts +42 -22
- package/src/theme/useTheme.ts +206 -100
- package/dist/chunks/LpBreadcrumbs-p4jHe_V-.js +0 -62
- package/dist/chunks/LpContextMenu-CwW1QXe_.js +0 -217
- package/dist/chunks/LpDatePicker-CwOToxGq.js +0 -164
- package/dist/chunks/LpFormField-CazBc2-a.js +0 -62
- package/dist/chunks/LpTextarea-t7F6gv8E.js +0 -47
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { defineComponent, ref, useId,
|
|
1
|
+
import { defineComponent, computed, ref, useId, onMounted, watch, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeStyle, normalizeClass, createBlock, unref, createCommentVNode, createTextVNode } from "vue";
|
|
2
2
|
import { Motion } from "motion-v";
|
|
3
|
+
import { useLabels } from "../composables/useLpConfig.js";
|
|
3
4
|
import { usePillTransition } from "../composables/usePillTransition.js";
|
|
4
5
|
const _hoisted_1 = ["aria-label"];
|
|
5
6
|
const _hoisted_2 = { class: "mb-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted" };
|
|
6
|
-
const _hoisted_3 = ["href", "onClick", "onMouseenter"];
|
|
7
|
-
const _hoisted_4 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "flex flex-col gap-0.5"
|
|
10
|
-
};
|
|
11
|
-
const _hoisted_5 = ["href", "onClick", "onMouseenter"];
|
|
7
|
+
const _hoisted_3 = ["href", "aria-current", "onClick", "onMouseenter"];
|
|
12
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
9
|
__name: "LpTableOfContents",
|
|
14
10
|
props: {
|
|
15
11
|
links: {},
|
|
16
|
-
title: {
|
|
17
|
-
offset: { default: 96 }
|
|
12
|
+
title: {},
|
|
13
|
+
offset: { default: 96 },
|
|
14
|
+
labels: {}
|
|
18
15
|
},
|
|
19
16
|
setup(__props) {
|
|
20
17
|
const props = __props;
|
|
18
|
+
const text = useLabels("toc", { title: "On this page" }, () => props.labels);
|
|
19
|
+
const heading = computed(() => props.title ?? text.value.title);
|
|
20
|
+
function flatten(links, depth = 0) {
|
|
21
|
+
return links.flatMap((link) => [{ link, depth }, ...flatten(link.children ?? [], depth + 1)]);
|
|
22
|
+
}
|
|
23
|
+
const rows = computed(() => flatten(props.links));
|
|
21
24
|
const activeId = ref("");
|
|
22
25
|
const hoveredId = ref(null);
|
|
23
26
|
const pillId = `lp-toc-${useId()}`;
|
|
@@ -60,13 +63,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
63
|
rafId = null;
|
|
61
64
|
safetyTimer = null;
|
|
62
65
|
}
|
|
63
|
-
function
|
|
66
|
+
function scrollerOf(el) {
|
|
67
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
68
|
+
const { overflowY } = getComputedStyle(node);
|
|
69
|
+
if (/(auto|scroll|overlay)/.test(overflowY) && node.scrollHeight > node.clientHeight) return node;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function suppressSpyUntilScrollEnds(target) {
|
|
64
74
|
spySuppressed = true;
|
|
65
75
|
if (rafId != null) cancelAnimationFrame(rafId);
|
|
66
76
|
if (safetyTimer != null) clearTimeout(safetyTimer);
|
|
67
|
-
|
|
77
|
+
const scroller = scrollerOf(target);
|
|
78
|
+
const position = () => scroller ? scroller.scrollTop : window.scrollY;
|
|
79
|
+
let last = position();
|
|
68
80
|
const tick = () => {
|
|
69
|
-
const y =
|
|
81
|
+
const y = position();
|
|
70
82
|
if (y === last) {
|
|
71
83
|
unfreeze();
|
|
72
84
|
return;
|
|
@@ -82,9 +94,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
94
|
if (!el) return;
|
|
83
95
|
ev.preventDefault();
|
|
84
96
|
activeId.value = id;
|
|
85
|
-
suppressSpyUntilScrollEnds();
|
|
97
|
+
suppressSpyUntilScrollEnds(el);
|
|
86
98
|
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
87
|
-
history.replaceState(
|
|
99
|
+
history.replaceState(history.state, "", `#${id}`);
|
|
88
100
|
}
|
|
89
101
|
onMounted(setup);
|
|
90
102
|
watch(() => props.links, setup, { deep: true });
|
|
@@ -94,22 +106,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
94
106
|
});
|
|
95
107
|
return (_ctx, _cache) => {
|
|
96
108
|
return openBlock(), createElementBlock("nav", {
|
|
97
|
-
"aria-label":
|
|
109
|
+
"aria-label": heading.value,
|
|
98
110
|
class: "text-sm"
|
|
99
111
|
}, [
|
|
100
|
-
createElementVNode("p", _hoisted_2, toDisplayString(
|
|
112
|
+
createElementVNode("p", _hoisted_2, toDisplayString(heading.value), 1),
|
|
101
113
|
createElementVNode("ul", {
|
|
102
114
|
class: "relative flex flex-col gap-0.5 border-l border-line",
|
|
103
115
|
onMouseleave: _cache[0] || (_cache[0] = ($event) => hoveredId.value = null)
|
|
104
116
|
}, [
|
|
105
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
117
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, ({ link, depth }) => {
|
|
106
118
|
return openBlock(), createElementBlock("li", {
|
|
107
119
|
key: link.id,
|
|
108
120
|
class: "flex flex-col"
|
|
109
121
|
}, [
|
|
110
122
|
createElementVNode("a", {
|
|
111
123
|
href: `#${link.id}`,
|
|
112
|
-
class: normalizeClass(["relative -ml-px block py-1
|
|
124
|
+
class: normalizeClass(["relative -ml-px block py-1 leading-snug transition-colors duration-[var(--duration-fast)]", [
|
|
125
|
+
depth > 0 ? "text-[13px]" : "",
|
|
126
|
+
litId.value === link.id ? "text-brand" : "text-muted hover:text-ink"
|
|
127
|
+
]]),
|
|
128
|
+
style: normalizeStyle({ paddingLeft: `${0.875 + depth * 0.875}rem` }),
|
|
129
|
+
"aria-current": activeId.value === link.id ? "location" : void 0,
|
|
113
130
|
onClick: ($event) => onClick(link.id, $event),
|
|
114
131
|
onMouseenter: ($event) => hoveredId.value = link.id
|
|
115
132
|
}, [
|
|
@@ -120,29 +137,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
137
|
class: "absolute -left-px top-0 h-full w-0.5 rounded-full bg-brand"
|
|
121
138
|
}, null, 8, ["transition"])) : createCommentVNode("", true),
|
|
122
139
|
createTextVNode(" " + toDisplayString(link.text), 1)
|
|
123
|
-
],
|
|
124
|
-
link.children?.length ? (openBlock(), createElementBlock("ul", _hoisted_4, [
|
|
125
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(link.children, (child) => {
|
|
126
|
-
return openBlock(), createElementBlock("li", {
|
|
127
|
-
key: child.id
|
|
128
|
-
}, [
|
|
129
|
-
createElementVNode("a", {
|
|
130
|
-
href: `#${child.id}`,
|
|
131
|
-
class: normalizeClass(["relative -ml-px block py-1 pl-7 text-[13px] leading-snug transition-colors duration-[var(--duration-fast)]", litId.value === child.id ? "text-brand" : "text-muted hover:text-ink"]),
|
|
132
|
-
onClick: ($event) => onClick(child.id, $event),
|
|
133
|
-
onMouseenter: ($event) => hoveredId.value = child.id
|
|
134
|
-
}, [
|
|
135
|
-
litId.value === child.id ? (openBlock(), createBlock(unref(Motion), {
|
|
136
|
-
key: 0,
|
|
137
|
-
"layout-id": pillId,
|
|
138
|
-
transition: unref(pillTransition),
|
|
139
|
-
class: "absolute -left-px top-0 h-full w-0.5 rounded-full bg-brand"
|
|
140
|
-
}, null, 8, ["transition"])) : createCommentVNode("", true),
|
|
141
|
-
createTextVNode(" " + toDisplayString(child.text), 1)
|
|
142
|
-
], 42, _hoisted_5)
|
|
143
|
-
]);
|
|
144
|
-
}), 128))
|
|
145
|
-
])) : createCommentVNode("", true)
|
|
140
|
+
], 46, _hoisted_3)
|
|
146
141
|
]);
|
|
147
142
|
}), 128))
|
|
148
143
|
], 32)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, watch, useId, computed, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, createElementBlock, Fragment, renderList, createCommentVNode, createElementVNode, toDisplayString, renderSlot } from "vue";
|
|
2
2
|
import { useReducedMotion, Motion } from "motion-v";
|
|
3
3
|
import { TabsRoot, TabsList, TabsTrigger, TabsContent } from "reka-ui";
|
|
4
4
|
import { usePillTransition } from "../composables/usePillTransition.js";
|
|
@@ -8,13 +8,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
8
|
__name: "LpTabs",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: {},
|
|
11
|
+
defaultValue: {},
|
|
11
12
|
items: {},
|
|
12
13
|
variant: { default: "contained" },
|
|
13
14
|
accent: { type: Boolean, default: false },
|
|
14
15
|
block: { type: Boolean, default: false }
|
|
15
16
|
},
|
|
16
17
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(__props) {
|
|
18
|
+
setup(__props, { emit: __emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const emit = __emit;
|
|
21
|
+
const current = ref(props.modelValue ?? props.defaultValue ?? props.items[0]?.value);
|
|
22
|
+
watch(
|
|
23
|
+
() => props.modelValue,
|
|
24
|
+
(value) => {
|
|
25
|
+
if (value !== void 0) current.value = value;
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
function select(value) {
|
|
29
|
+
if (props.modelValue === void 0) current.value = value;
|
|
30
|
+
emit("update:modelValue", value);
|
|
31
|
+
}
|
|
18
32
|
const pillId = `lp-tab-indicator-${useId()}`;
|
|
19
33
|
const hovered = ref(null);
|
|
20
34
|
const pillTransition = usePillTransition();
|
|
@@ -31,8 +45,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
45
|
}
|
|
32
46
|
return (_ctx, _cache) => {
|
|
33
47
|
return openBlock(), createBlock(unref(TabsRoot), {
|
|
34
|
-
"model-value":
|
|
35
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = (v) =>
|
|
48
|
+
"model-value": current.value,
|
|
49
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = (v) => select(v))
|
|
36
50
|
}, {
|
|
37
51
|
default: withCtx(() => [
|
|
38
52
|
createVNode(unref(TabsList), {
|
|
@@ -58,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
72
|
onPointerup: releaseFocusAfterPointer
|
|
59
73
|
}, {
|
|
60
74
|
default: withCtx(() => [
|
|
61
|
-
pillUnder(item.value,
|
|
75
|
+
pillUnder(item.value, current.value) ? (openBlock(), createBlock(unref(Motion), {
|
|
62
76
|
key: 0,
|
|
63
77
|
"layout-id": pillId,
|
|
64
78
|
transition: unref(pillTransition),
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineComponent, computed, useAttrs, openBlock, createBlock, resolveDynamicComponent, normalizeStyle, unref, normalizeClass, withCtx, createElementVNode, mergeProps } from "vue";
|
|
2
|
+
import { useFieldControl } from "../composables/useField.js";
|
|
3
|
+
import { mergeClass } from "../composables/useMergedClass.js";
|
|
4
|
+
import { _ as _sfc_main$1 } from "./LpFormField-CIk5qosh.js";
|
|
5
|
+
const _hoisted_1 = ["id", "value", "placeholder", "rows", "disabled", "required", "aria-invalid", "aria-describedby"];
|
|
6
|
+
const __default__ = { inheritAttrs: false };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...__default__,
|
|
9
|
+
__name: "LpTextarea",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {},
|
|
12
|
+
placeholder: {},
|
|
13
|
+
rows: {},
|
|
14
|
+
invalid: { type: Boolean },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
label: {},
|
|
17
|
+
hint: {},
|
|
18
|
+
error: {},
|
|
19
|
+
required: { type: Boolean }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue"],
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const hasField = computed(() => !!props.label || !!props.hint || !!props.error);
|
|
25
|
+
const attrs = useAttrs();
|
|
26
|
+
const textareaAttrs = computed(() => {
|
|
27
|
+
const { class: _c, style: _s, ...rest } = attrs;
|
|
28
|
+
return rest;
|
|
29
|
+
});
|
|
30
|
+
const field = useFieldControl(() => ({
|
|
31
|
+
wrapped: hasField.value,
|
|
32
|
+
hasMessage: !!props.error || !!props.hint,
|
|
33
|
+
id: typeof attrs.id === "string" ? attrs.id : void 0,
|
|
34
|
+
invalid: props.invalid || !!props.error,
|
|
35
|
+
required: props.required,
|
|
36
|
+
disabled: props.disabled
|
|
37
|
+
}));
|
|
38
|
+
const textareaClass = computed(
|
|
39
|
+
() => mergeClass(
|
|
40
|
+
"w-full resize-y rounded-control border bg-surface-soft px-3 py-2 text-sm text-ink outline-none transition-colors duration-[var(--duration-fast)] placeholder:text-muted focus:border-brand focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-55",
|
|
41
|
+
field.value.invalid ? "border-danger focus:border-danger focus:ring-danger-soft" : "border-line",
|
|
42
|
+
hasField.value ? "" : attrs.class
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
return openBlock(), createBlock(resolveDynamicComponent(hasField.value ? _sfc_main$1 : "div"), {
|
|
47
|
+
id: hasField.value ? unref(field).id : void 0,
|
|
48
|
+
label: hasField.value ? __props.label : void 0,
|
|
49
|
+
hint: hasField.value ? __props.hint : void 0,
|
|
50
|
+
error: hasField.value ? __props.error : void 0,
|
|
51
|
+
required: hasField.value ? __props.required : void 0,
|
|
52
|
+
class: normalizeClass(hasField.value ? unref(attrs).class : "contents"),
|
|
53
|
+
style: normalizeStyle(hasField.value ? unref(attrs).style : void 0)
|
|
54
|
+
}, {
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
createElementVNode("textarea", mergeProps(textareaAttrs.value, {
|
|
57
|
+
id: unref(field).id,
|
|
58
|
+
value: __props.modelValue,
|
|
59
|
+
placeholder: __props.placeholder,
|
|
60
|
+
rows: __props.rows ?? 4,
|
|
61
|
+
disabled: unref(field).disabled,
|
|
62
|
+
required: unref(field).required || void 0,
|
|
63
|
+
"aria-invalid": unref(field).invalid || void 0,
|
|
64
|
+
"aria-describedby": unref(field).describedBy,
|
|
65
|
+
class: textareaClass.value,
|
|
66
|
+
style: hasField.value ? void 0 : unref(attrs).style,
|
|
67
|
+
onInput: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.value))
|
|
68
|
+
}), null, 16, _hoisted_1)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["id", "label", "hint", "error", "required", "class", "style"]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
_sfc_main as _
|
|
77
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, unref, withCtx, renderSlot } from "vue";
|
|
2
|
+
import { t as themeEntries } from "./useTheme-C8JHUlPM.js";
|
|
3
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
|
+
const __default__ = { inheritAttrs: false };
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...__default__,
|
|
7
|
+
__name: "LpThemeProvider",
|
|
8
|
+
props: {
|
|
9
|
+
theme: {},
|
|
10
|
+
as: { default: "div" }
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs("bg-surface text-ink");
|
|
15
|
+
const style = computed(() => ({
|
|
16
|
+
...Object.fromEntries(themeEntries(props.theme)),
|
|
17
|
+
colorScheme: props.theme.mode
|
|
18
|
+
}));
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps({
|
|
21
|
+
style: style.value,
|
|
22
|
+
"data-theme-mode": __props.theme.mode,
|
|
23
|
+
class: unref(rootClass)
|
|
24
|
+
}, unref(rest)), {
|
|
25
|
+
default: withCtx(() => [
|
|
26
|
+
renderSlot(_ctx.$slots, "default")
|
|
27
|
+
]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16, ["style", "data-theme-mode", "class"]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
_sfc_main as _
|
|
35
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { defineComponent, computed, onMounted, ref, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, createVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
import { useLabels } from "../composables/useLpConfig.js";
|
|
3
|
+
import { u as useTheme, p as presets } from "./useTheme-C8JHUlPM.js";
|
|
4
|
+
import { _ as _sfc_main$1 } from "./LpContextMenu-DQw5dGfG.js";
|
|
5
|
+
import { _ as _sfc_main$2 } from "./LpIcon-CCnX5_2j.js";
|
|
6
|
+
const _hoisted_1 = ["aria-label", "title"];
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "text-sm font-medium"
|
|
10
|
+
};
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "LpThemeSwitcher",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {},
|
|
15
|
+
themes: {},
|
|
16
|
+
cycleThemes: {},
|
|
17
|
+
variant: { default: "swatch" },
|
|
18
|
+
showLabel: { type: Boolean },
|
|
19
|
+
default: {},
|
|
20
|
+
transition: { type: Boolean, default: true },
|
|
21
|
+
size: { default: "md" },
|
|
22
|
+
"aria-label": {},
|
|
23
|
+
system: {},
|
|
24
|
+
labels: {}
|
|
25
|
+
},
|
|
26
|
+
emits: ["update:modelValue", "change"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const emit = __emit;
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
const text = useLabels(
|
|
32
|
+
"themeSwitcher",
|
|
33
|
+
{ trigger: "Theme: {name}. Click to switch, right-click to choose.", system: "System" },
|
|
34
|
+
() => props.labels
|
|
35
|
+
);
|
|
36
|
+
const list = computed(
|
|
37
|
+
() => props.themes && props.themes.length ? props.themes : Object.values(presets)
|
|
38
|
+
);
|
|
39
|
+
const activeName = computed(
|
|
40
|
+
() => props.modelValue ?? (theme.currentName.value || list.value[0]?.name || "")
|
|
41
|
+
);
|
|
42
|
+
onMounted(() => {
|
|
43
|
+
if (props.default == null) return;
|
|
44
|
+
const fallback = typeof props.default === "string" ? list.value.find((t) => t.name === props.default) : props.default;
|
|
45
|
+
if (fallback) theme.init(fallback);
|
|
46
|
+
});
|
|
47
|
+
const SIZES = { sm: "size-7", md: "size-8", lg: "size-9" };
|
|
48
|
+
const ICON_SIZE = { sm: 15, md: 16, lg: 18 };
|
|
49
|
+
const wantsLabel = computed(() => props.showLabel || props.variant === "pill");
|
|
50
|
+
const bareIcon = computed(() => props.variant === "icon" && !wantsLabel.value);
|
|
51
|
+
function applyTheme(t, ev) {
|
|
52
|
+
if (props.transition) {
|
|
53
|
+
theme.setTheme(t, ev ? { x: ev.clientX, y: ev.clientY } : void 0);
|
|
54
|
+
} else {
|
|
55
|
+
theme.apply(t);
|
|
56
|
+
}
|
|
57
|
+
emit("update:modelValue", t.name);
|
|
58
|
+
emit("change", t);
|
|
59
|
+
}
|
|
60
|
+
const cycleList = computed(() => {
|
|
61
|
+
if (!props.cycleThemes?.length) return list.value;
|
|
62
|
+
const resolved = props.cycleThemes.map(
|
|
63
|
+
(t) => typeof t === "string" ? list.value.find((x) => x.name === t) : t
|
|
64
|
+
).filter((t) => Boolean(t));
|
|
65
|
+
return resolved.length ? resolved : list.value;
|
|
66
|
+
});
|
|
67
|
+
function cycle(ev) {
|
|
68
|
+
const arr = cycleList.value;
|
|
69
|
+
if (!arr.length) return;
|
|
70
|
+
const i = arr.findIndex((t) => t.name === activeName.value);
|
|
71
|
+
const next = arr[(i + 1) % arr.length];
|
|
72
|
+
if (next) applyTheme(next, ev);
|
|
73
|
+
}
|
|
74
|
+
function resolve(t) {
|
|
75
|
+
return typeof t === "string" ? list.value.find((x) => x.name === t) : t;
|
|
76
|
+
}
|
|
77
|
+
const systemPair = computed(() => {
|
|
78
|
+
if (!props.system) return null;
|
|
79
|
+
const light = resolve(props.system.light);
|
|
80
|
+
const dark = resolve(props.system.dark);
|
|
81
|
+
return light && dark ? { light, dark } : null;
|
|
82
|
+
});
|
|
83
|
+
function followSystem() {
|
|
84
|
+
const pair = systemPair.value;
|
|
85
|
+
if (!pair) return;
|
|
86
|
+
theme.setSystem(pair);
|
|
87
|
+
const next = theme.current.value;
|
|
88
|
+
if (next) {
|
|
89
|
+
emit("update:modelValue", next.name);
|
|
90
|
+
emit("change", next);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const menu = computed(() => {
|
|
94
|
+
const following = theme.system.value;
|
|
95
|
+
const items = list.value.map((t) => ({
|
|
96
|
+
label: t.name,
|
|
97
|
+
icon: !following && t.name === activeName.value ? "lucide:check" : t.mode === "dark" ? "lucide:moon" : "lucide:sun",
|
|
98
|
+
onSelect: () => applyTheme(t)
|
|
99
|
+
}));
|
|
100
|
+
if (systemPair.value) {
|
|
101
|
+
items.unshift({
|
|
102
|
+
label: text.value.system,
|
|
103
|
+
icon: following ? "lucide:check" : "lucide:monitor",
|
|
104
|
+
onSelect: followSystem
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return items;
|
|
108
|
+
});
|
|
109
|
+
const hydrated = ref(false);
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
hydrated.value = true;
|
|
112
|
+
});
|
|
113
|
+
const labelName = computed(
|
|
114
|
+
() => hydrated.value ? activeName.value : list.value[0]?.name ?? ""
|
|
115
|
+
);
|
|
116
|
+
const triggerLabel = computed(
|
|
117
|
+
() => props["aria-label"] ?? text.value.trigger.replace("{name}", labelName.value)
|
|
118
|
+
);
|
|
119
|
+
return (_ctx, _cache) => {
|
|
120
|
+
return openBlock(), createBlock(_sfc_main$1, { items: menu.value }, {
|
|
121
|
+
default: withCtx(() => [
|
|
122
|
+
createElementVNode("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
"aria-label": triggerLabel.value,
|
|
125
|
+
title: triggerLabel.value,
|
|
126
|
+
class: normalizeClass([
|
|
127
|
+
"inline-flex items-center justify-center gap-2 rounded-control outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
|
|
128
|
+
bareIcon.value ? [SIZES[__props.size], "text-muted hover:bg-surface-soft hover:text-ink"] : [
|
|
129
|
+
"border border-line bg-surface-raised px-1.5 text-ink hover:border-line-strong",
|
|
130
|
+
wantsLabel.value ? "py-1 pr-2.5" : ""
|
|
131
|
+
]
|
|
132
|
+
]),
|
|
133
|
+
onClick: cycle
|
|
134
|
+
}, [
|
|
135
|
+
__props.variant !== "icon" ? (openBlock(), createElementBlock("span", {
|
|
136
|
+
key: 0,
|
|
137
|
+
class: normalizeClass(["grid shrink-0 place-items-center rounded-control border border-line/60", SIZES[__props.size]]),
|
|
138
|
+
style: { "background": "var(--color-surface)" }
|
|
139
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
140
|
+
createElementVNode("span", {
|
|
141
|
+
class: "size-3 rounded-full",
|
|
142
|
+
style: { "background": "var(--color-brand)" }
|
|
143
|
+
}, null, -1)
|
|
144
|
+
])], 2)) : (openBlock(), createElementBlock("span", {
|
|
145
|
+
key: 1,
|
|
146
|
+
class: normalizeClass(["grid shrink-0 place-items-center", SIZES[__props.size]])
|
|
147
|
+
}, [
|
|
148
|
+
createVNode(_sfc_main$2, {
|
|
149
|
+
name: "lucide:moon",
|
|
150
|
+
size: ICON_SIZE[__props.size],
|
|
151
|
+
class: "in-data-[theme-mode=light]:hidden"
|
|
152
|
+
}, null, 8, ["size"]),
|
|
153
|
+
createVNode(_sfc_main$2, {
|
|
154
|
+
name: "lucide:sun",
|
|
155
|
+
size: ICON_SIZE[__props.size],
|
|
156
|
+
class: "hidden in-data-[theme-mode=light]:block"
|
|
157
|
+
}, null, 8, ["size"])
|
|
158
|
+
], 2)),
|
|
159
|
+
wantsLabel.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(labelName.value), 1)) : createCommentVNode("", true)
|
|
160
|
+
], 10, _hoisted_1)
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["items"]);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
export {
|
|
168
|
+
_sfc_main as _
|
|
169
|
+
};
|
|
@@ -11,12 +11,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
},
|
|
12
12
|
setup(__props) {
|
|
13
13
|
const props = __props;
|
|
14
|
-
const tilt = useTilt({
|
|
14
|
+
const tilt = useTilt(() => ({
|
|
15
15
|
max: props.max,
|
|
16
16
|
lift: props.lift,
|
|
17
17
|
scale: props.scale,
|
|
18
18
|
glare: props.glare
|
|
19
|
-
});
|
|
19
|
+
}));
|
|
20
20
|
const stageStyle = computed(() => ({ perspective: `${props.perspective}px` }));
|
|
21
21
|
return (_ctx, _cache) => {
|
|
22
22
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, normalizeClass, withCtx, createCommentVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { Time } from "@internationalized/date";
|
|
3
3
|
import { TimeFieldRoot, TimeFieldInput } from "reka-ui";
|
|
4
|
+
import { useFieldControl } from "../composables/useField.js";
|
|
4
5
|
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
7
|
__name: "LpTimeField",
|
|
@@ -29,6 +30,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
30
|
const pad = (n) => String(n).padStart(2, "0");
|
|
30
31
|
emit("update:modelValue", `${pad(next.hour)}:${pad(next.minute)}`);
|
|
31
32
|
}
|
|
33
|
+
const field = useFieldControl(() => ({
|
|
34
|
+
wrapped: false,
|
|
35
|
+
invalid: props.invalid,
|
|
36
|
+
disabled: props.disabled
|
|
37
|
+
}));
|
|
32
38
|
const shellSize = {
|
|
33
39
|
sm: "h-(--size-control-sm) text-xs",
|
|
34
40
|
md: "h-(--size-control-md) text-sm",
|
|
@@ -40,10 +46,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
46
|
"hour-cycle": __props.hourCycle,
|
|
41
47
|
locale: __props.locale,
|
|
42
48
|
granularity: "minute",
|
|
43
|
-
disabled:
|
|
49
|
+
disabled: unref(field).disabled,
|
|
50
|
+
"aria-invalid": unref(field).invalid || void 0,
|
|
51
|
+
"aria-describedby": unref(field).describedBy,
|
|
44
52
|
class: normalizeClass(["flex w-full items-center gap-0.5 rounded-control border bg-surface-soft px-3 text-ink transition-colors duration-[var(--duration-fast)] focus-within:ring-2 focus-within:ring-ring data-[disabled]:cursor-not-allowed data-[disabled]:opacity-55", [
|
|
45
53
|
shellSize[__props.size],
|
|
46
|
-
|
|
54
|
+
unref(field).invalid ? "border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand"
|
|
47
55
|
]]),
|
|
48
56
|
"onUpdate:modelValue": onUpdate
|
|
49
57
|
}, {
|
|
@@ -54,10 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
62
|
size: 15,
|
|
55
63
|
class: "mr-1.5 shrink-0 text-muted"
|
|
56
64
|
})) : createCommentVNode("", true),
|
|
57
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(segments, (item) => {
|
|
58
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
59
|
-
key: item.part
|
|
60
|
-
}, [
|
|
65
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(segments, (item, i) => {
|
|
66
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
61
67
|
item.part === "literal" ? (openBlock(), createBlock(unref(TimeFieldInput), {
|
|
62
68
|
key: 0,
|
|
63
69
|
part: item.part,
|
|
@@ -81,7 +87,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
81
87
|
}), 128))
|
|
82
88
|
]),
|
|
83
89
|
_: 1
|
|
84
|
-
}, 8, ["model-value", "hour-cycle", "locale", "disabled", "class"]);
|
|
90
|
+
}, 8, ["model-value", "hour-cycle", "locale", "disabled", "aria-invalid", "aria-describedby", "class"]);
|
|
85
91
|
};
|
|
86
92
|
}
|
|
87
93
|
});
|