@leavepulse/ui 0.87.1 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{LpCommandPalette-DCZB4EAf.css → LpCommandPalette-CO_5TFOQ.css} +38 -19
- package/dist/assets/{LpDropzone-CfL3Vrx4.css → LpDropzone-CVGUQqgY.css} +10 -10
- package/dist/assets/{LpImageEditor-y3B-aW3H.css → LpImageEditor-D_ECuegW.css} +6 -6
- package/dist/assets/{LpTable-BqZNpWgC.css → LpTable-DAVNb-x2.css} +25 -25
- package/dist/chunks/{ContextMenuItems-D0jObgzN.js → ContextMenuItems-LujPZSWM.js} +2 -1
- package/dist/chunks/{DropzoneLinkField-DhwYRnvd.js → DropzoneLinkField-Ckuh8zFC.js} +2 -2
- package/dist/chunks/{IconCloseButton-CmWOJAXG.js → IconCloseButton-C_V7qngw.js} +1 -1
- package/dist/chunks/{LpActionBar-Cx_MSZl9.js → LpActionBar-43WHmTsM.js} +1 -1
- package/dist/chunks/{LpAddressInput-CfqQR5jE.js → LpAddressInput-BCqR0zmv.js} +5 -5
- package/dist/chunks/{LpAlert-CYtbpRYW.js → LpAlert-Q0h7Gucu.js} +1 -1
- package/dist/chunks/{LpAppShell-BQG98odS.js → LpAppShell-BWaVRsDB.js} +3 -3
- package/dist/chunks/{LpAutocomplete-VNID5zdy.js → LpAutocomplete-YPxAPHEo.js} +5 -5
- package/dist/chunks/{LpButton-DSHioIfD.js → LpButton-BvVoF-PO.js} +1 -1
- package/dist/chunks/{LpCheckbox-P7tEw8GO.js → LpCheckbox-C9VnPIQf.js} +1 -1
- package/dist/chunks/{LpCodeBlock-BNThgUdQ.js → LpCodeBlock-BgWcg2mk.js} +3 -3
- package/dist/chunks/{LpCodeDisplay-DsiE-Qy9.js → LpCodeDisplay-DBi1YPLp.js} +3 -3
- package/dist/chunks/{LpColorPicker-EXpwcX-t.js → LpColorPicker-KGMG8QEh.js} +4 -4
- package/dist/chunks/{LpConfirmDialog-DPiPVRn_.js → LpConfirmDialog-y6k0ryWR.js} +2 -2
- package/dist/chunks/{LpConfirmHost-Ddiljlog.js → LpConfirmHost-D-X0tDym.js} +1 -1
- package/dist/chunks/{LpContextMenu-DYpDm6iI.js → LpContextMenu-DEFirphS.js} +3 -3
- package/dist/chunks/{LpContextSwitcher-BPDSkKyA.js → LpContextSwitcher-COw6GHPW.js} +1 -1
- package/dist/chunks/{LpCopyButton-CxX682t4.js → LpCopyButton-BGzw95Xc.js} +2 -2
- package/dist/chunks/{LpDataList-DCtF7krm.js → LpDataList-B56Gu6Yt.js} +3 -3
- package/dist/chunks/{LpDatePicker-BElEHVm6.js → LpDatePicker-Dlyvgsan.js} +2 -2
- package/dist/chunks/{LpDateRangePicker-vLt-drEu.js → LpDateRangePicker-CAn2yGbn.js} +1 -1
- package/dist/chunks/{LpDrawer-C97k-3L2.js → LpDrawer-iRHwJOGn.js} +4 -4
- package/dist/chunks/{LpDropdownMenu-BPEsqZCN.js → LpDropdownMenu-CdCe7D2d.js} +3 -3
- package/dist/chunks/{LpEditable-CeRAzYMv.js → LpEditable-DfRUAGkA.js} +2 -2
- package/dist/chunks/{LpEmptyState-DrHBR3yh.js → LpEmptyState-DLOm07KH.js} +1 -1
- package/dist/chunks/{LpFileTree-BcQgsw4e.js → LpFileTree-BN_zybBN.js} +3 -3
- package/dist/chunks/{LpFileTreeNode-Dk2WqkPF.js → LpFileTreeNode-CC48DbT5.js} +3 -3
- package/dist/chunks/{LpHintLayer-CUSRLtLu.js → LpHintLayer-nuMqfzvy.js} +3 -3
- package/dist/chunks/{LpHints-BF40CP4_.js → LpHints-ByAd3a76.js} +3 -3
- package/dist/chunks/{LpHoverCard-CHE9jAJG.js → LpHoverCard-DYguY2AP.js} +10 -61
- package/dist/chunks/{LpInput-BU5IsOlE.js → LpInput-DGMpxrcg.js} +1 -1
- package/dist/chunks/{LpInspector-CEko6-pS.js → LpInspector-oTfkOdYd.js} +2 -2
- package/dist/chunks/{LpLightbox-REei-y5e.js → LpLightbox-a24V_0Wk.js} +19 -7
- package/dist/chunks/{LpLogInspector-Bwz351LY.js → LpLogInspector-BhJTJIst.js} +1 -1
- package/dist/chunks/{LpLogViewer-BCkqdH66.js → LpLogViewer-BuIzr_6h.js} +4 -4
- package/dist/chunks/{LpMediaGallery-BF1Bch3v.js → LpMediaGallery-B7DOV_aL.js} +2 -2
- package/dist/chunks/{LpModal-BK2T5uIG.js → LpModal-D1E7rQzw.js} +5 -5
- package/dist/chunks/{LpModalNav-Dk4eHpg6.js → LpModalNav-DivqT1NV.js} +5 -4
- package/dist/chunks/{LpNotificationBell-CMwUXhFg.js → LpNotificationBell-KRgdRZs-.js} +4 -4
- package/dist/chunks/{LpNotificationFeed-BXsRp9jm.js → LpNotificationFeed-CMGYU8c-.js} +5 -5
- package/dist/chunks/{LpNumberField-QUMXvpqx.js → LpNumberField-C0LSu-tl.js} +1 -1
- package/dist/chunks/{LpPaletteTheme-wiJtP5hV.js → LpPaletteTheme-CLwO-SDf.js} +3 -3
- package/dist/chunks/{LpPasswordInput-W9AZfzaL.js → LpPasswordInput-LPVI7D3v.js} +2 -2
- package/dist/chunks/{LpPhoneInput-DsRv-Qla.js → LpPhoneInput-BdglZsGH.js} +5 -5
- package/dist/chunks/{LpPie-pbrNFbRP.js → LpPie-CsiBXe-e.js} +3 -3
- package/dist/chunks/{LpPipeline-BHWmvOiv.js → LpPipeline-DVcoSs--.js} +1 -1
- package/dist/chunks/{LpPopover-BQSuxtai.js → LpPopover-w2rr4x7n.js} +2 -2
- package/dist/chunks/{LpRadio-CWA5Eb3M.js → LpRadio-4KyxeSz4.js} +1 -1
- package/dist/chunks/{LpRadioGroup-D94KMStE.js → LpRadioGroup-Cr_fmrBY.js} +1 -1
- package/dist/chunks/{LpRangeSlider-CkP9hYUC.js → LpRangeSlider-DbaITHtC.js} +1 -1
- package/dist/chunks/{LpRelativeTime-0zI-44ve.js → LpRelativeTime-CN5bWD73.js} +1 -1
- package/dist/chunks/{LpRepeater-DLLcbQ6J.js → LpRepeater-C0rns2xW.js} +1 -1
- package/dist/chunks/{LpSecretField-Au7ZQTtm.js → LpSecretField-BwrZ4TfT.js} +5 -5
- package/dist/chunks/{LpSection-RKCwB0xN.js → LpSection-CwsfNR7N.js} +1 -1
- package/dist/chunks/{LpSegmented-DD8MPj4j.js → LpSegmented-DzFYP0ZF.js} +1 -1
- package/dist/chunks/{LpSelect-BeXz1TWh.js → LpSelect-Dffg5r4I.js} +5 -5
- package/dist/chunks/{LpSidebar-DUFlf6Uu.js → LpSidebar-DQtCYlT4.js} +4 -4
- package/dist/chunks/{LpSidebarNav-C34YEZIR.js → LpSidebarNav-CFcI7--7.js} +1 -1
- package/dist/chunks/{LpSidebarRow-BeEGgsZi.js → LpSidebarRow-C5jXpcRL.js} +2 -2
- package/dist/chunks/{LpSlider-BCy5rjwK.js → LpSlider-DUd4gXnw.js} +1 -1
- package/dist/chunks/{LpStat-eVz7iUfD.js → LpStat-SyVb5JXm.js} +1 -1
- package/dist/chunks/{LpSwitch-D7hmVsif.js → LpSwitch-D-mcaA6C.js} +1 -1
- package/dist/chunks/{LpTableFilter-BGFNKyUX.js → LpTableFilter-CILHffC1.js} +3 -3
- package/dist/chunks/{LpTagsInput-D9uOSlvf.js → LpTagsInput-DD8-xe3F.js} +2 -2
- package/dist/chunks/{LpTextarea-DwE-lQt4.js → LpTextarea-CQg-dVxN.js} +1 -1
- package/dist/chunks/{LpThemeStudio-COn2H76d.js → LpThemeStudio-BPPctXgd.js} +4 -4
- package/dist/chunks/{LpThemeSwitcher-B3R3nNid.js → LpThemeSwitcher-B3c44xFH.js} +4 -4
- package/dist/chunks/{LpTimeField-Mi8H1g_9.js → LpTimeField-Dio7Tj9A.js} +1 -1
- package/dist/chunks/{LpToaster-DOJn6Vey.js → LpToaster-Cdx1tnHB.js} +2 -2
- package/dist/chunks/{LpTooltip-Bz_rrq5S.js → LpTooltip-BKde8Xjv.js} +43 -7
- package/dist/chunks/{LpTopologyCanvas-5RFMP4gR.js → LpTopologyCanvas-CQ0l6A5h.js} +3 -3
- package/dist/chunks/{LpTour-DUI_hoPv.js → LpTour-BGUKUxSZ.js} +1 -1
- package/dist/chunks/{LpTruncate-CynJhsEw.js → LpTruncate-C_C8eiIE.js} +2 -2
- package/dist/chunks/{LpUptimeBar-G7PfNJUH.js → LpUptimeBar-Dt6SY_-m.js} +1 -1
- package/dist/chunks/{LpVideoCompress-CPUxXh-c.js → LpVideoCompress-CvxNdyjp.js} +2 -2
- package/dist/chunks/{LpVideoPlayer-BbCjEQAx.js → LpVideoPlayer-FMuxTAU8.js} +4 -4
- package/dist/chunks/{LpWindow-Dp_0nNqg.js → LpWindow-DsPeiDCZ.js} +1 -1
- package/dist/chunks/{LpWorkspaceSwitcher-bjkncjSl.js → LpWorkspaceSwitcher-DCIiOQt_.js} +4 -4
- package/dist/chunks/{PickerField-CjOTUXDK.js → PickerField-DzF3UVnX.js} +1 -1
- package/dist/chunks/{RevealToggle-Bl1NcfxB.js → RevealToggle-BsYxY6Oz.js} +2 -2
- package/dist/chunks/{TourCard-BovXtMbO.js → TourCard-yrLqv4Oz.js} +1 -1
- package/dist/chunks/{VideoVolume-DE3i1ree.js → VideoVolume-CzL5mZPE.js} +2 -2
- package/dist/components/ContextMenuItems.vue.js +1 -1
- package/dist/components/DropzoneLinkField.vue.js +1 -1
- package/dist/components/IconCloseButton.vue.js +1 -1
- package/dist/components/LpActionBar.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.js +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpButton.vue.js +1 -1
- package/dist/components/LpChart.vue.js +2 -2
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.d.ts +2 -0
- package/dist/components/LpCommandPalette.vue.js +69 -33
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.js +1 -1
- package/dist/components/LpContextMenu.vue.js +1 -1
- package/dist/components/LpContextSwitcher.vue.js +1 -1
- package/dist/components/LpCopyButton.vue.js +1 -1
- package/dist/components/LpDataList.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDateRangePicker.vue.js +1 -1
- package/dist/components/LpDock.vue.js +1 -1
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropdownMenu.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +5 -5
- package/dist/components/LpEditable.vue.js +1 -1
- package/dist/components/LpEmptyState.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpHintLayer.vue.js +1 -1
- package/dist/components/LpHints.vue.js +1 -1
- package/dist/components/LpHoverCard.vue.d.ts +3 -3
- package/dist/components/LpHoverCard.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.js +4 -4
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpInspector.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLogInspector.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNotificationFeed.vue.js +1 -1
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpPaletteTheme.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.js +1 -1
- package/dist/components/LpPipeline.vue.js +1 -1
- package/dist/components/LpPopover.vue.js +1 -1
- package/dist/components/LpRadio.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpRangeSlider.vue.js +1 -1
- package/dist/components/LpRelativeTime.vue.js +1 -1
- package/dist/components/LpRepeater.vue.js +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpSection.vue.js +1 -1
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpSidebarRow.vue.js +1 -1
- package/dist/components/LpSlider.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 +7 -0
- package/dist/components/LpTable.vue.js +48 -41
- package/dist/components/LpTableFilter.vue.js +1 -1
- package/dist/components/LpTabs.vue.js +1 -1
- package/dist/components/LpTagsInput.vue.js +1 -1
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +9 -0
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpTour.vue.js +1 -1
- package/dist/components/LpTruncate.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/LpVideoCompress.vue.js +1 -1
- package/dist/components/LpVideoPlayer.vue.js +1 -1
- package/dist/components/LpVideoTrim.vue.js +4 -4
- package/dist/components/LpWindow.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/PickerField.vue.js +1 -1
- package/dist/components/RevealToggle.vue.js +1 -1
- package/dist/components/TourCard.vue.js +1 -1
- package/dist/components/VideoVolume.vue.js +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/dropdown.d.ts +14 -0
- package/dist/components/dropdown.js +7 -1
- package/dist/components/menuWhen.js +1 -1
- package/dist/components/modalDepth.d.ts +1 -0
- package/dist/components/modalDepth.js +2 -0
- package/dist/composables/useReveal.js +3 -3
- package/dist/composables/useTouchHold.d.ts +19 -0
- package/dist/composables/useTouchHold.js +60 -0
- package/dist/index.js +72 -71
- package/package.json +1 -1
- package/src/components/ContextMenuItems.vue +2 -1
- package/src/components/IconCloseButton.vue +1 -1
- package/src/components/LpAlert.vue +1 -1
- package/src/components/LpAutocomplete.vue +4 -4
- package/src/components/LpButton.vue +1 -1
- package/src/components/LpCheckbox.vue +1 -1
- package/src/components/LpCodeBlock.vue +2 -2
- package/src/components/LpColorPicker.vue +3 -3
- package/src/components/LpCommandPalette.vue +89 -7
- package/src/components/LpContextMenu.vue +2 -2
- package/src/components/LpDataList.vue +1 -1
- package/src/components/LpDrawer.vue +7 -4
- package/src/components/LpDropdownMenu.vue +2 -2
- package/src/components/LpDropzone.vue +2 -2
- package/src/components/LpEditable.vue +2 -2
- package/src/components/LpEmptyState.vue +1 -1
- package/src/components/LpFileTreeNode.vue +1 -1
- package/src/components/LpHintLayer.vue +2 -2
- package/src/components/LpHoverCard.vue +11 -80
- package/src/components/LpImageEditor.vue +1 -1
- package/src/components/LpInput.vue +1 -1
- package/src/components/LpLightbox.vue +20 -3
- package/src/components/LpModal.vue +4 -4
- package/src/components/LpModalNav.vue +2 -1
- package/src/components/LpNumberField.vue +1 -1
- package/src/components/LpPhoneInput.vue +5 -5
- package/src/components/LpPopover.vue +2 -2
- package/src/components/LpRadio.vue +1 -1
- package/src/components/LpRadioGroup.vue +1 -1
- package/src/components/LpRangeSlider.vue +1 -1
- package/src/components/LpSection.vue +9 -6
- package/src/components/LpSegmented.vue +1 -1
- package/src/components/LpSelect.vue +4 -4
- package/src/components/LpSlider.vue +1 -1
- package/src/components/LpStat.vue +1 -1
- package/src/components/LpSwitch.vue +1 -1
- package/src/components/LpTable.vue +13 -1
- package/src/components/LpTableFilter.vue +1 -1
- package/src/components/LpTagsInput.vue +2 -2
- package/src/components/LpTextarea.vue +1 -1
- package/src/components/LpThemeSwitcher.vue +2 -2
- package/src/components/LpTimeField.vue +1 -1
- package/src/components/LpToaster.vue +1 -1
- package/src/components/LpTooltip.vue +59 -5
- package/src/components/badge.ts +1 -1
- package/src/components/dropdown.ts +24 -0
- package/src/components/modalDepth.ts +6 -0
- package/src/composables/useReveal.ts +7 -4
- package/src/composables/useTouchHold.ts +92 -0
- package/src/locales/uk.ts +1 -0
- package/src/tokens/utilities.css +34 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { onBeforeUnmount } from "vue"
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Press-and-hold on a touch screen, for things a pointer reaches by hovering
|
|
5
|
+
* (a hover card, a tooltip). A hold that drifts is a scroll, not a hold, so
|
|
6
|
+
* moving past a few pixels cancels it. Once it has fired, the click the finger
|
|
7
|
+
* produces on lifting is swallowed: the reader asked for the preview, not for
|
|
8
|
+
* the link or button under it. A mouse or pen is left alone.
|
|
9
|
+
*
|
|
10
|
+
* The handlers go on the trigger: pointerdown, pointermove, pointerup,
|
|
11
|
+
* pointercancel, click (capture) and contextmenu.
|
|
12
|
+
*/
|
|
13
|
+
const SLOP = 8
|
|
14
|
+
/* A long press may produce no click at all; past this the next click is the user's own. */
|
|
15
|
+
const CLICK_AFTER_RELEASE_MS = 350
|
|
16
|
+
|
|
17
|
+
export interface TouchHoldOptions {
|
|
18
|
+
/** Whether a touch press may start a hold now. */
|
|
19
|
+
enabled: () => boolean
|
|
20
|
+
/** How long the finger must stay, in ms. */
|
|
21
|
+
delay: () => number
|
|
22
|
+
onHold: () => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function useTouchHold(options: TouchHoldOptions) {
|
|
26
|
+
let timer = 0
|
|
27
|
+
/* The finger the hold belongs to: a second one must not move or end it. */
|
|
28
|
+
let finger: number | null = null
|
|
29
|
+
let start = { x: 0, y: 0 }
|
|
30
|
+
let held = false
|
|
31
|
+
|
|
32
|
+
function stop() {
|
|
33
|
+
window.clearTimeout(timer)
|
|
34
|
+
timer = 0
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function onPointerDown(event: PointerEvent) {
|
|
38
|
+
// Any new press starts over: on a hybrid laptop the mouse click after a
|
|
39
|
+
// hold must not be taken for that hold's own click.
|
|
40
|
+
if (timer && event.pointerId !== finger) return
|
|
41
|
+
held = false
|
|
42
|
+
if (event.pointerType !== "touch" || !options.enabled()) return
|
|
43
|
+
finger = event.pointerId
|
|
44
|
+
start = { x: event.clientX, y: event.clientY }
|
|
45
|
+
stop()
|
|
46
|
+
timer = window.setTimeout(() => {
|
|
47
|
+
timer = 0
|
|
48
|
+
held = true
|
|
49
|
+
options.onHold()
|
|
50
|
+
}, options.delay())
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function onPointerMove(event: PointerEvent) {
|
|
54
|
+
if (!timer || event.pointerId !== finger) return
|
|
55
|
+
if (Math.hypot(event.clientX - start.x, event.clientY - start.y) > SLOP) stop()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function onPointerUp(event: PointerEvent) {
|
|
59
|
+
if (finger !== null && event.pointerId !== finger) return
|
|
60
|
+
finger = null
|
|
61
|
+
stop()
|
|
62
|
+
if (held) window.setTimeout(() => (held = false), CLICK_AFTER_RELEASE_MS)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A cancelled press produces no click, so there is nothing left to swallow.
|
|
66
|
+
function onPointerCancel(event?: PointerEvent) {
|
|
67
|
+
if (event && finger !== null && event.pointerId !== finger) return
|
|
68
|
+
finger = null
|
|
69
|
+
stop()
|
|
70
|
+
held = false
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function onClickCapture(event: MouseEvent) {
|
|
74
|
+
if (!held) return
|
|
75
|
+
held = false
|
|
76
|
+
event.preventDefault()
|
|
77
|
+
event.stopImmediatePropagation()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A long press would otherwise also bring up the system's own menu.
|
|
81
|
+
function onContextMenu(event: Event) {
|
|
82
|
+
if (timer || held) event.preventDefault()
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
onBeforeUnmount(stop)
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
/** Drops a hold in progress, as if the finger had been lifted off the screen. */
|
|
89
|
+
cancel: () => onPointerCancel(),
|
|
90
|
+
handlers: { onPointerdown: onPointerDown, onPointermove: onPointerMove, onPointerup: onPointerUp, onPointercancel: onPointerCancel, onClickCapture, onContextmenu: onContextMenu },
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/locales/uk.ts
CHANGED
package/src/tokens/utilities.css
CHANGED
|
@@ -171,3 +171,37 @@
|
|
|
171
171
|
animation: none;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* Text entry on a touch screen. iOS Safari zooms the page in when a field whose
|
|
177
|
+
* text is smaller than 16px takes focus, and leaves it zoomed after the field
|
|
178
|
+
* loses it. Every kit field that takes typing carries this class, so on a
|
|
179
|
+
* coarse pointer its text is 16px; a mouse keeps the size it was drawn at.
|
|
180
|
+
* Unlayered on purpose: it has to win over the field's own `text-sm`.
|
|
181
|
+
*/
|
|
182
|
+
@media (hover: none) and (pointer: coarse) {
|
|
183
|
+
.lp-entry {
|
|
184
|
+
font-size: 16px;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/*
|
|
189
|
+
* A control drawn smaller than a fingertip: a checkbox, a switch, an icon or a
|
|
190
|
+
* small button, a chip's remove. On a coarse pointer an invisible ::after
|
|
191
|
+
* grows what it answers to to 40px on each axis, centred on the control, so it
|
|
192
|
+
* keeps its look and a thumb still lands on it. Bigger controls are left as
|
|
193
|
+
* they are. Both rules sit in the components layer, so a control placed with
|
|
194
|
+
* `absolute`, or one that draws its own ::after, keeps what its classes say.
|
|
195
|
+
*/
|
|
196
|
+
@layer components {
|
|
197
|
+
@media (hover: none) and (pointer: coarse) {
|
|
198
|
+
.lp-tap {
|
|
199
|
+
position: relative;
|
|
200
|
+
}
|
|
201
|
+
.lp-tap::after {
|
|
202
|
+
content: "";
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset: min(0px, calc((100% - 40px) / 2));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|