@luzmo/lucero 0.0.3 → 0.0.6
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/components/accordion/accordion-item.d.ts +24 -0
- package/components/accordion/accordion.d.ts +42 -0
- package/components/accordion/index.cjs +43 -0
- package/components/accordion/index.d.ts +10 -0
- package/components/accordion/index.js +181 -0
- package/components/action-bar/action-bar.d.ts +42 -0
- package/components/action-bar/index.cjs +39 -0
- package/components/action-bar/index.d.ts +7 -0
- package/components/action-bar/index.js +107 -0
- package/components/action-button/action-button.d.ts +81 -0
- package/components/action-button/index.cjs +24 -0
- package/components/action-button/index.d.ts +7 -0
- package/components/action-button/index.js +161 -0
- package/components/action-group/action-group.d.ts +50 -0
- package/components/action-group/index.cjs +18 -0
- package/components/action-group/index.d.ts +7 -0
- package/components/action-group/index.js +29 -0
- package/components/action-group-B7oQXv30.js +258 -0
- package/components/action-group-C8YUQzt8.cjs +20 -0
- package/components/action-menu/action-menu.d.ts +40 -0
- package/components/action-menu/index.cjs +56 -0
- package/components/action-menu/index.d.ts +7 -0
- package/components/action-menu/index.js +126 -0
- package/components/async-directive-BhRGSTWB.js +82 -0
- package/components/async-directive-_65ULPLK.cjs +22 -0
- package/components/avatar/avatar.d.ts +31 -0
- package/components/avatar/index.cjs +24 -0
- package/components/avatar/index.d.ts +7 -0
- package/components/avatar/index.js +81 -0
- package/components/base-BjTwmyRF.cjs +22 -0
- package/components/base-CxUap9HL.js +665 -0
- package/components/base-D76d76ww.js +26 -0
- package/components/base-rtxi7uaR.cjs +40 -0
- package/components/button/button-base.d.ts +44 -0
- package/components/button/button.d.ts +59 -0
- package/components/button/clear-button.d.ts +22 -0
- package/components/button/close-button.d.ts +24 -0
- package/components/button/index.cjs +20 -0
- package/components/button/index.d.ts +13 -0
- package/components/button/index.js +127 -0
- package/components/button-base-CgrTYVgq.js +142 -0
- package/components/button-base-DjqSZyn2.cjs +25 -0
- package/components/button-group/button-group.d.ts +19 -0
- package/components/button-group/index.cjs +18 -0
- package/components/button-group/index.d.ts +7 -0
- package/components/button-group/index.js +59 -0
- package/components/checkbox/checkbox-base.d.ts +9 -0
- package/components/checkbox/checkbox-mixin.d.ts +14 -0
- package/components/checkbox/checkbox.d.ts +54 -0
- package/components/checkbox/index.cjs +25 -0
- package/components/checkbox/index.d.ts +7 -0
- package/components/checkbox/index.js +96 -0
- package/components/checkbox-mixin-BRluTF9s.js +70 -0
- package/components/checkbox-mixin-iB-0ivgo.cjs +27 -0
- package/components/clear-button-CyLF5dx_.js +53 -0
- package/components/clear-button-DFXE6MLx.cjs +18 -0
- package/components/close-button-CcD-aVqh.cjs +18 -0
- package/components/close-button-CzpdWCWI.js +51 -0
- package/components/color-Bg3tYsAQ.js +178 -0
- package/components/color-DphK4hwx.cjs +18 -0
- package/components/color-area/color-area.d.ts +67 -0
- package/components/color-area/index.cjs +80 -0
- package/components/color-area/index.d.ts +7 -0
- package/components/color-area/index.js +372 -0
- package/components/color-field/color-field.d.ts +20 -0
- package/components/color-field/index.cjs +23 -0
- package/components/color-field/index.d.ts +7 -0
- package/components/color-field/index.js +80 -0
- package/components/color-handle/color-handle.d.ts +13 -0
- package/components/color-handle/index.cjs +24 -0
- package/components/color-handle/index.d.ts +7 -0
- package/components/color-handle/index.js +73 -0
- package/components/color-loupe/color-loupe.d.ts +7 -0
- package/components/color-loupe/index.cjs +18 -0
- package/components/color-loupe/index.d.ts +7 -0
- package/components/color-loupe/index.js +29 -0
- package/components/color-loupe-BN3k1ACF.cjs +56 -0
- package/components/color-loupe-CD-dhmB1.js +81 -0
- package/components/color-menu/color-menu.d.ts +54 -0
- package/components/color-menu/index.cjs +86 -0
- package/components/color-menu/index.d.ts +7 -0
- package/components/color-menu/index.js +203 -0
- package/components/color-picker/color-picker.d.ts +39 -0
- package/components/color-picker/index.cjs +48 -0
- package/components/color-picker/index.d.ts +7 -0
- package/components/color-picker/index.js +141 -0
- package/components/color-slider/color-slider.d.ts +57 -0
- package/components/color-slider/index.cjs +57 -0
- package/components/color-slider/index.d.ts +7 -0
- package/components/color-slider/index.js +317 -0
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
- package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
- package/components/dependency-manger-C5HCkMMB.cjs +18 -0
- package/components/dependency-manger-CEXvGQUV.js +54 -0
- package/components/directive-C7oCP5Bh.cjs +22 -0
- package/components/directive-helpers-C3pAxRR3.cjs +22 -0
- package/components/directive-helpers-D0vm0gvF.js +28 -0
- package/components/directive-oAbCiebi.js +44 -0
- package/components/divider/divider.d.ts +24 -0
- package/components/divider/index.cjs +18 -0
- package/components/divider/index.d.ts +7 -0
- package/components/divider/index.js +61 -0
- package/components/divider.module-CXMNveQc.cjs +18 -0
- package/components/divider.module-DwOuLGU3.js +21 -0
- package/components/element-resolution-BvRLGqIU.cjs +18 -0
- package/components/element-resolution-FCUT-wql.js +91 -0
- package/components/field-group/field-group.d.ts +24 -0
- package/components/field-group/index.cjs +18 -0
- package/components/field-group/index.d.ts +7 -0
- package/components/field-group/index.js +29 -0
- package/components/field-group-DAImvhSF.js +66 -0
- package/components/field-group-d5Hkb8UW.cjs +23 -0
- package/components/field-label/field-label.d.ts +50 -0
- package/components/field-label/index.cjs +18 -0
- package/components/field-label/index.d.ts +7 -0
- package/components/field-label/index.js +29 -0
- package/components/field-label-D1zKXSG6.cjs +25 -0
- package/components/field-label-DY9iRmRI.js +106 -0
- package/components/focus-group-DHeTq18L.js +218 -0
- package/components/focus-group-DnxZUBhQ.cjs +18 -0
- package/components/focus-visible-B0P9aY_G.cjs +18 -0
- package/components/focus-visible-DBlJGoEW.js +74 -0
- package/components/focusable-Bze9xE25.js +153 -0
- package/components/focusable-DyyBr-J-.cjs +18 -0
- package/components/focusable-selectors-B4YgbghQ.js +31 -0
- package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
- package/components/icon/icon-base.d.ts +11 -0
- package/components/icon/icon.d.ts +12 -0
- package/components/icon/index.cjs +18 -0
- package/components/icon/index.d.ts +7 -0
- package/components/icon/index.js +88 -0
- package/components/if-defined-C-8FyBSN.cjs +22 -0
- package/components/if-defined-XzWkhMhg.js +27 -0
- package/components/index-C1chwzNp.js +727 -0
- package/components/index-CNtoBntg.cjs +77 -0
- package/components/index-Ci6Jnhu4.js +927 -0
- package/components/index-DCKCHDTt.cjs +18 -0
- package/components/index.cjs +27 -0
- package/components/index.js +207 -0
- package/components/infield-button/index.cjs +22 -0
- package/components/infield-button/index.d.ts +7 -0
- package/components/infield-button/index.js +64 -0
- package/components/infield-button/infield-button.d.ts +25 -0
- package/components/label/index.cjs +18 -0
- package/components/label/index.d.ts +7 -0
- package/components/label/index.js +51 -0
- package/components/label/label.d.ts +7 -0
- package/components/legend-position/index.d.ts +7 -0
- package/components/legend-position/legend-position.d.ts +10 -0
- package/components/like-anchor-DKuw8fJA.cjs +32 -0
- package/components/like-anchor-DnsAwo_O.js +69 -0
- package/components/manage-help-text-B-FXFXgT.js +92 -0
- package/components/manage-help-text-I5aYDAKT.cjs +30 -0
- package/components/menu/index.cjs +18 -0
- package/components/menu/index.d.ts +16 -0
- package/components/menu/index.js +32 -0
- package/components/menu/menu-divider.d.ts +14 -0
- package/components/menu/menu-group.d.ts +17 -0
- package/components/menu/menu-item.d.ts +125 -0
- package/components/menu/menu.d.ts +119 -0
- package/components/multi-language-field/index.cjs +39 -0
- package/components/multi-language-field/index.d.ts +7 -0
- package/components/multi-language-field/index.js +148 -0
- package/components/multi-language-field/multi-language-field.d.ts +41 -0
- package/components/mutation-controller-DH7YOCyj.js +52 -0
- package/components/mutation-controller-DkOMCW-c.cjs +22 -0
- package/components/number-field/index.cjs +57 -0
- package/components/number-field/index.d.ts +7 -0
- package/components/number-field/index.js +735 -0
- package/components/number-field/number-field.d.ts +113 -0
- package/components/observe-slot-text-DeSKIzvP.cjs +18 -0
- package/components/observe-slot-text-DrM71me1.js +87 -0
- package/components/overlay/abstract-overlay.d.ts +72 -0
- package/components/overlay/click-controller.d.ts +14 -0
- package/components/overlay/events.d.ts +23 -0
- package/components/overlay/full-size-plugin.d.ts +12 -0
- package/components/overlay/hover-controller.d.ts +20 -0
- package/components/overlay/index.cjs +73 -0
- package/components/overlay/index.d.ts +22 -0
- package/components/overlay/index.js +342 -0
- package/components/overlay/interaction-controller.d.ts +38 -0
- package/components/overlay/loader.d.ts +4 -0
- package/components/overlay/longpress-controller.d.ts +21 -0
- package/components/overlay/overlay-dialog.d.ts +4 -0
- package/components/overlay/overlay-events.d.ts +11 -0
- package/components/overlay/overlay-no-popover.d.ts +4 -0
- package/components/overlay/overlay-popover.d.ts +4 -0
- package/components/overlay/overlay-stack.d.ts +44 -0
- package/components/overlay/overlay-timer.d.ts +21 -0
- package/components/overlay/overlay-trigger-directive.d.ts +26 -0
- package/components/overlay/overlay-trigger.d.ts +53 -0
- package/components/overlay/overlay-types.d.ts +50 -0
- package/components/overlay/overlay.d.ts +464 -0
- package/components/overlay/placement-controller.d.ts +157 -0
- package/components/overlay/slottable-request-directive.d.ts +17 -0
- package/components/overlay/slottable-request-event.d.ts +12 -0
- package/components/overlay/strategies.d.ts +8 -0
- package/components/overlay/virtual-trigger.d.ts +7 -0
- package/components/overlay-C2Cck0Az.js +2712 -0
- package/components/overlay-dn6Xe_vz.cjs +47 -0
- package/components/pending-state--XOfTjzE.js +61 -0
- package/components/pending-state-BeJ7iP-O.cjs +26 -0
- package/components/picker/desktop-controller.d.ts +7 -0
- package/components/picker/index.cjs +18 -0
- package/components/picker/index.d.ts +7 -0
- package/components/picker/index.js +32 -0
- package/components/picker/interaction-controller.d.ts +43 -0
- package/components/picker/mobile-controller.d.ts +9 -0
- package/components/picker/picker.d.ts +154 -0
- package/components/picker/strategies.d.ts +6 -0
- package/components/picker-8cOc-jjh.cjs +127 -0
- package/components/picker-BZAWrSDk.js +655 -0
- package/components/platform-CQzYNWKq.cjs +18 -0
- package/components/platform-DQYMG7JI.js +54 -0
- package/components/popover/index.cjs +18 -0
- package/components/popover/index.d.ts +7 -0
- package/components/popover/index.js +29 -0
- package/components/popover/popover.d.ts +29 -0
- package/components/popover-CCzs4VH8.cjs +30 -0
- package/components/popover-D0EliN0L.js +67 -0
- package/components/progress-circle/index.cjs +18 -0
- package/components/progress-circle/index.d.ts +7 -0
- package/components/progress-circle/index.js +29 -0
- package/components/progress-circle/progress-circle.d.ts +35 -0
- package/components/progress-circle-DYSSkjlY.cjs +33 -0
- package/components/progress-circle-_-9sAlMM.js +97 -0
- package/components/query-BL-TJj7K.cjs +22 -0
- package/components/query-D_KR_GUc.js +51 -0
- package/components/query-assigned-elements-DjfhL1cl.js +36 -0
- package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
- package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
- package/components/query-assigned-nodes-C76XVPWY.js +36 -0
- package/components/radio/index.cjs +22 -0
- package/components/radio/index.d.ts +10 -0
- package/components/radio/index.js +191 -0
- package/components/radio/radio-group.d.ts +27 -0
- package/components/radio/radio.d.ts +39 -0
- package/components/random-id-ByCz1xaq.js +26 -0
- package/components/random-id-CqvckpWe.cjs +18 -0
- package/components/roving-tabindex-By_fCy_e.cjs +18 -0
- package/components/roving-tabindex-DOg4z6ZU.js +66 -0
- package/components/search/index.cjs +45 -0
- package/components/search/index.d.ts +7 -0
- package/components/search/index.js +131 -0
- package/components/search/search.d.ts +27 -0
- package/components/sized-mixin-BAI6NiE2.cjs +18 -0
- package/components/sized-mixin-DcJTTohI.js +63 -0
- package/components/slider/index.cjs +18 -0
- package/components/slider/index.d.ts +7 -0
- package/components/slider/index.js +1158 -0
- package/components/slider/slider.d.ts +24 -0
- package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
- package/components/slottable-request-event-DggLA4Rx.js +31 -0
- package/components/state-D8vot9IB.js +29 -0
- package/components/state-WWHLNMRG.cjs +22 -0
- package/components/streaming-listener-BbmNyKWO.js +125 -0
- package/components/streaming-listener-C2A7ZJZP.cjs +18 -0
- package/components/style-map-CoBJRbvu.js +53 -0
- package/components/style-map-DH0jkl7s.cjs +22 -0
- package/components/swatch/index.cjs +49 -0
- package/components/swatch/index.d.ts +10 -0
- package/components/swatch/index.js +342 -0
- package/components/swatch/swatch-group.d.ts +41 -0
- package/components/swatch/swatch.d.ts +40 -0
- package/components/switch/index.cjs +22 -0
- package/components/switch/index.d.ts +7 -0
- package/components/switch/index.js +73 -0
- package/components/switch/switch.d.ts +27 -0
- package/components/tags/index.cjs +32 -0
- package/components/tags/index.d.ts +10 -0
- package/components/tags/index.js +173 -0
- package/components/tags/tag.d.ts +29 -0
- package/components/tags/tags.d.ts +28 -0
- package/components/text-field/help-text-manager.d.ts +19 -0
- package/components/text-field/help-text.d.ts +20 -0
- package/components/text-field/index.cjs +21 -0
- package/components/text-field/index.d.ts +14 -0
- package/components/text-field/index.js +62 -0
- package/components/text-field/manage-help-text.d.ts +13 -0
- package/components/text-field/text-field.d.ts +142 -0
- package/components/text-field-05QNK_Lj.js +313 -0
- package/components/text-field-BU7yxiOR.cjs +85 -0
- package/components/toast/index.cjs +51 -0
- package/components/toast/index.d.ts +7 -0
- package/components/toast/index.js +153 -0
- package/components/toast/toast.d.ts +77 -0
- package/components/tooltip/index.cjs +45 -0
- package/components/tooltip/index.d.ts +8 -0
- package/components/tooltip/index.js +220 -0
- package/components/tooltip/tooltip-directive.d.ts +5 -0
- package/components/tooltip/tooltip.d.ts +55 -0
- package/components/unit-input/index.cjs +43 -0
- package/components/unit-input/index.d.ts +7 -0
- package/components/unit-input/index.js +183 -0
- package/components/unit-input/unit-input.d.ts +33 -0
- package/components/when-CDK1Tt5Y.js +28 -0
- package/components/when-CDZyJPvd.cjs +22 -0
- package/index.d.ts +39 -0
- package/package.json +139 -101
- package/utils/base.d.ts +16 -0
- package/utils/condition-attribute-with-id.d.ts +2 -0
- package/utils/first-focusable-in.d.ts +3 -0
- package/utils/focus-visible.d.ts +29 -0
- package/utils/focusable-selectors.d.ts +2 -0
- package/utils/focusable.d.ts +58 -0
- package/utils/get-css-variable.d.ts +1 -0
- package/utils/get-label-from-slot.d.ts +1 -0
- package/utils/like-anchor.d.ts +23 -0
- package/utils/observe-slot-presence.d.ts +12 -0
- package/utils/observe-slot-text.d.ts +11 -0
- package/utils/platform.d.ts +10 -0
- package/utils/random-id.d.ts +1 -0
- package/utils/reactive-controllers/color.d.ts +54 -0
- package/utils/reactive-controllers/dependency-manger.d.ts +26 -0
- package/utils/reactive-controllers/element-resolution.d.ts +23 -0
- package/utils/reactive-controllers/focus-group.d.ts +62 -0
- package/utils/reactive-controllers/language-resolution.d.ts +11 -0
- package/utils/reactive-controllers/match-media.d.ts +13 -0
- package/utils/reactive-controllers/pending-state.d.ts +41 -0
- package/utils/reactive-controllers/roving-tabindex.d.ts +19 -0
- package/utils/reparent-child.d.ts +4 -0
- package/utils/sized-mixin.d.ts +17 -0
- package/utils/streaming-listener.d.ts +48 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { O as f, I as O, s as $, A as S } from "../overlay-C2Cck0Az.js";
|
|
19
|
+
import { C as G, H as M, b as J, L as K, c as Q, P as W, V as X, g as Y, a as Z, n as ee, o as te, p as oe } from "../overlay-C2Cck0Az.js";
|
|
20
|
+
import { L as E, r as w, x as c, n as u, E as z, B as b } from "../base-CxUap9HL.js";
|
|
21
|
+
import { r as h } from "../state-D8vot9IB.js";
|
|
22
|
+
import { e as g } from "../query-D_KR_GUc.js";
|
|
23
|
+
import { e as v } from "../directive-oAbCiebi.js";
|
|
24
|
+
import { f as A } from "../async-directive-BhRGSTWB.js";
|
|
25
|
+
import { r as y } from "../slottable-request-event-DggLA4Rx.js";
|
|
26
|
+
import { S as le } from "../slottable-request-event-DggLA4Rx.js";
|
|
27
|
+
const k = () => {
|
|
28
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
29
|
+
const i = document.createElement("style");
|
|
30
|
+
i.setAttribute("data-luzmo-vars", ""), i.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-color-negative: #ca221c;--luzmo-color-negative-hover: #b3241f;--luzmo-color-negative-down: #9f231f;--luzmo-color-negative-focus: #b3241f;--luzmo-color-negative-rgb: 202, 34, 28;--luzmo-color-positive: rgb(20, 150, 101);--luzmo-color-positive-hover: rgb(17, 128, 86);--luzmo-color-positive-down: rgb(16, 105, 71);--luzmo-color-positive-focus: rgb(17, 128, 86);--luzmo-color-positive-rgb: 20, 150, 101;--luzmo-color-selected: rgb(110, 110, 110);--luzmo-color-selected-hover: rgb(70, 70, 70);--luzmo-color-selected-down: rgb(40, 40, 40);--luzmo-color-selected-focus: rgb(70, 70, 70);--luzmo-color-selected-hard: #1e1e1e;--luzmo-color-selected-hard-hover: rgb(0, 0, 0);--luzmo-color-selected-hard-down: rgb(0, 0, 0);--luzmo-color-selected-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(i);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
k();
|
|
34
|
+
const F = ":host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}";
|
|
35
|
+
var T = Object.defineProperty, s = (i, e, t, o) => {
|
|
36
|
+
for (var r = void 0, n = i.length - 1, a; n >= 0; n--)
|
|
37
|
+
(a = i[n]) && (r = a(e, t, r) || r);
|
|
38
|
+
return r && T(e, t, r), r;
|
|
39
|
+
};
|
|
40
|
+
class l extends E {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments), this.content = "click hover longpress", this.offset = 6, this.disabled = !1, this.receivesFocus = "auto", this.clickContent = [], this.longpressContent = [], this.hoverContent = [], this.targetContent = [];
|
|
43
|
+
}
|
|
44
|
+
static get styles() {
|
|
45
|
+
return [w(F)];
|
|
46
|
+
}
|
|
47
|
+
getAssignedElementsFromSlot(e) {
|
|
48
|
+
return e.assignedElements({ flatten: !0 });
|
|
49
|
+
}
|
|
50
|
+
handleTriggerContent(e) {
|
|
51
|
+
this.targetContent = this.getAssignedElementsFromSlot(e.target);
|
|
52
|
+
}
|
|
53
|
+
handleSlotContent(e) {
|
|
54
|
+
switch (e.target.name) {
|
|
55
|
+
case "click-content": {
|
|
56
|
+
this.clickContent = this.getAssignedElementsFromSlot(e.target);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "longpress-content": {
|
|
60
|
+
this.longpressContent = this.getAssignedElementsFromSlot(e.target);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case "hover-content": {
|
|
64
|
+
this.hoverContent = this.getAssignedElementsFromSlot(e.target);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
handleBeforetoggle(e) {
|
|
70
|
+
const { target: t } = e;
|
|
71
|
+
let o;
|
|
72
|
+
if (t === this.clickOverlayElement)
|
|
73
|
+
o = "click";
|
|
74
|
+
else if (t === this.longpressOverlayElement)
|
|
75
|
+
o = "longpress";
|
|
76
|
+
else if (t === this.hoverOverlayElement)
|
|
77
|
+
o = "hover";
|
|
78
|
+
else
|
|
79
|
+
return;
|
|
80
|
+
e.newState === "open" ? this.open = o : this.open === o && (this.open = void 0);
|
|
81
|
+
}
|
|
82
|
+
update(e) {
|
|
83
|
+
var t, o, r, n, a, m;
|
|
84
|
+
e.has("clickContent") && (this.clickPlacement = ((t = this.clickContent[0]) == null ? void 0 : t.getAttribute("placement")) || ((o = this.clickContent[0]) == null ? void 0 : o.getAttribute("direction")) || void 0), e.has("hoverContent") && (this.hoverPlacement = ((r = this.hoverContent[0]) == null ? void 0 : r.getAttribute("placement")) || ((n = this.hoverContent[0]) == null ? void 0 : n.getAttribute("direction")) || void 0), e.has("longpressContent") && (this.longpressPlacement = ((a = this.longpressContent[0]) == null ? void 0 : a.getAttribute("placement")) || ((m = this.longpressContent[0]) == null ? void 0 : m.getAttribute("direction")) || void 0), super.update(e);
|
|
85
|
+
}
|
|
86
|
+
renderSlot(e) {
|
|
87
|
+
return c`
|
|
88
|
+
<slot name=${e} @slotchange=${this.handleSlotContent}></slot>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
renderClickOverlay() {
|
|
92
|
+
import("../overlay-C2Cck0Az.js").then((t) => t.d);
|
|
93
|
+
const e = this.renderSlot("click-content");
|
|
94
|
+
return this.clickContent.length === 0 ? e : c`
|
|
95
|
+
<luzmo-overlay
|
|
96
|
+
id="click-overlay"
|
|
97
|
+
?disabled=${this.disabled || this.clickContent.length === 0}
|
|
98
|
+
?open=${this.open === "click" && this.clickContent.length > 0}
|
|
99
|
+
.offset=${this.offset}
|
|
100
|
+
.placement=${this.clickPlacement || this.placement}
|
|
101
|
+
.triggerElement=${this.targetContent[0]}
|
|
102
|
+
.triggerInteraction=${"click"}
|
|
103
|
+
.type=${this.type === "modal" ? "modal" : "auto"}
|
|
104
|
+
@beforetoggle=${this.handleBeforetoggle}
|
|
105
|
+
.receivesFocus=${this.receivesFocus}
|
|
106
|
+
>
|
|
107
|
+
${e}
|
|
108
|
+
</luzmo-overlay>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
renderHoverOverlay() {
|
|
112
|
+
import("../overlay-C2Cck0Az.js").then((t) => t.d);
|
|
113
|
+
const e = this.renderSlot("hover-content");
|
|
114
|
+
return this.hoverContent.length === 0 ? e : c`
|
|
115
|
+
<luzmo-overlay
|
|
116
|
+
id="hover-overlay"
|
|
117
|
+
?open=${this.open === "hover" && this.hoverContent.length > 0}
|
|
118
|
+
?disabled=${this.disabled || this.hoverContent.length === 0 || !!this.open && this.open !== "hover"}
|
|
119
|
+
.offset=${this.offset}
|
|
120
|
+
.placement=${this.hoverPlacement || this.placement}
|
|
121
|
+
.triggerElement=${this.targetContent[0]}
|
|
122
|
+
.triggerInteraction=${"hover"}
|
|
123
|
+
.type=${"hint"}
|
|
124
|
+
@beforetoggle=${this.handleBeforetoggle}
|
|
125
|
+
.receivesFocus=${this.receivesFocus}
|
|
126
|
+
>
|
|
127
|
+
${e}
|
|
128
|
+
</luzmo-overlay>
|
|
129
|
+
`;
|
|
130
|
+
}
|
|
131
|
+
renderLongpressOverlay() {
|
|
132
|
+
import("../overlay-C2Cck0Az.js").then((t) => t.d);
|
|
133
|
+
const e = this.renderSlot("longpress-content");
|
|
134
|
+
return this.longpressContent.length === 0 ? e : c`
|
|
135
|
+
<luzmo-overlay
|
|
136
|
+
id="longpress-overlay"
|
|
137
|
+
?disabled=${this.disabled || this.longpressContent.length === 0}
|
|
138
|
+
?open=${this.open === "longpress" && this.longpressContent.length > 0}
|
|
139
|
+
.offset=${this.offset}
|
|
140
|
+
.placement=${this.longpressPlacement || this.placement}
|
|
141
|
+
.triggerElement=${this.targetContent[0]}
|
|
142
|
+
.triggerInteraction=${"longpress"}
|
|
143
|
+
.type=${"auto"}
|
|
144
|
+
@beforetoggle=${this.handleBeforetoggle}
|
|
145
|
+
.receivesFocus=${this.receivesFocus}
|
|
146
|
+
>
|
|
147
|
+
${e}
|
|
148
|
+
</luzmo-overlay>
|
|
149
|
+
<slot name="longpress-describedby-descriptor"></slot>
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
const e = this.content.split(" ");
|
|
154
|
+
return c`
|
|
155
|
+
<slot
|
|
156
|
+
id="trigger"
|
|
157
|
+
name="trigger"
|
|
158
|
+
@slotchange=${this.handleTriggerContent}
|
|
159
|
+
></slot>
|
|
160
|
+
${[
|
|
161
|
+
e.includes("click") ? this.renderClickOverlay() : c``,
|
|
162
|
+
e.includes("hover") ? this.renderHoverOverlay() : c``,
|
|
163
|
+
e.includes("longpress") ? this.renderLongpressOverlay() : c``
|
|
164
|
+
]}
|
|
165
|
+
`;
|
|
166
|
+
}
|
|
167
|
+
updated(e) {
|
|
168
|
+
if (super.updated(e), this.disabled && e.has("disabled")) {
|
|
169
|
+
this.open = void 0;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async getUpdateComplete() {
|
|
174
|
+
return await super.getUpdateComplete();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
s([
|
|
178
|
+
u()
|
|
179
|
+
], l.prototype, "content");
|
|
180
|
+
s([
|
|
181
|
+
u({ reflect: !0 })
|
|
182
|
+
], l.prototype, "placement");
|
|
183
|
+
s([
|
|
184
|
+
u()
|
|
185
|
+
], l.prototype, "type");
|
|
186
|
+
s([
|
|
187
|
+
u({ type: Number })
|
|
188
|
+
], l.prototype, "offset");
|
|
189
|
+
s([
|
|
190
|
+
u({ reflect: !0 })
|
|
191
|
+
], l.prototype, "open");
|
|
192
|
+
s([
|
|
193
|
+
u({ type: Boolean, reflect: !0 })
|
|
194
|
+
], l.prototype, "disabled");
|
|
195
|
+
s([
|
|
196
|
+
u({ attribute: "receives-focus" })
|
|
197
|
+
], l.prototype, "receivesFocus");
|
|
198
|
+
s([
|
|
199
|
+
h()
|
|
200
|
+
], l.prototype, "clickContent");
|
|
201
|
+
s([
|
|
202
|
+
h()
|
|
203
|
+
], l.prototype, "longpressContent");
|
|
204
|
+
s([
|
|
205
|
+
h()
|
|
206
|
+
], l.prototype, "hoverContent");
|
|
207
|
+
s([
|
|
208
|
+
h()
|
|
209
|
+
], l.prototype, "targetContent");
|
|
210
|
+
s([
|
|
211
|
+
g("#click-overlay", !0)
|
|
212
|
+
], l.prototype, "clickOverlayElement");
|
|
213
|
+
s([
|
|
214
|
+
g("#longpress-overlay", !0)
|
|
215
|
+
], l.prototype, "longpressOverlayElement");
|
|
216
|
+
s([
|
|
217
|
+
g("#hover-overlay", !0)
|
|
218
|
+
], l.prototype, "hoverOverlayElement");
|
|
219
|
+
function U(i, e, t, o) {
|
|
220
|
+
return f.open(
|
|
221
|
+
i,
|
|
222
|
+
e,
|
|
223
|
+
t,
|
|
224
|
+
o
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
class x extends A {
|
|
228
|
+
/* c8 ignore next 9 */
|
|
229
|
+
render(e) {
|
|
230
|
+
return z;
|
|
231
|
+
}
|
|
232
|
+
update(e, [t]) {
|
|
233
|
+
this.template = t, this.target !== e.element && (this.target = e.element, this.renderBefore = this.target.children[0]), this.listenerHost = this.target, this.init();
|
|
234
|
+
}
|
|
235
|
+
handleSlottableRequest(e) {
|
|
236
|
+
if (e.target !== e.currentTarget)
|
|
237
|
+
return;
|
|
238
|
+
const t = e.data === y;
|
|
239
|
+
b(t ? void 0 : this.template(), this.target, {
|
|
240
|
+
renderBefore: this.renderBefore
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
init() {
|
|
244
|
+
var t;
|
|
245
|
+
(t = this.listeners) == null || t.abort(), this.listeners = new AbortController();
|
|
246
|
+
const { signal: e } = this.listeners;
|
|
247
|
+
this.listenerHost.addEventListener(
|
|
248
|
+
"slottable-request",
|
|
249
|
+
(o) => this.handleSlottableRequest(o),
|
|
250
|
+
{ signal: e }
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
disconnected() {
|
|
254
|
+
var e;
|
|
255
|
+
(e = this.listeners) == null || e.abort();
|
|
256
|
+
}
|
|
257
|
+
/* c8 ignore next 3 */
|
|
258
|
+
reconnected() {
|
|
259
|
+
this.init();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const N = v(x);
|
|
263
|
+
class I extends x {
|
|
264
|
+
constructor() {
|
|
265
|
+
super(...arguments), this.defaultOptions = {
|
|
266
|
+
triggerInteraction: "click",
|
|
267
|
+
overlayOptions: {
|
|
268
|
+
type: "auto",
|
|
269
|
+
offset: 0
|
|
270
|
+
}
|
|
271
|
+
}, this.options = {
|
|
272
|
+
...this.defaultOptions.overlayOptions
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/* c8 ignore next 9 */
|
|
276
|
+
render(e, t) {
|
|
277
|
+
return z;
|
|
278
|
+
}
|
|
279
|
+
update(e, [t, o]) {
|
|
280
|
+
var m, d, p;
|
|
281
|
+
this.options = {
|
|
282
|
+
...this.defaultOptions.overlayOptions,
|
|
283
|
+
...o == null ? void 0 : o.overlayOptions
|
|
284
|
+
}, this.insertionOptions = o == null ? void 0 : o.insertionOptions, this.template = t, this.host = (m = e.options) == null ? void 0 : m.host;
|
|
285
|
+
let r = !1;
|
|
286
|
+
const n = (o == null ? void 0 : o.triggerInteraction) || this.defaultOptions.triggerInteraction, a = O[(d = this.strategy) == null ? void 0 : d.type] !== n;
|
|
287
|
+
this.target !== e.element && (this.target = e.element, r = !0), (r || a) && ((p = this.strategy) == null || p.abort(), this.strategy = new $[n](this.target, {
|
|
288
|
+
isPersistent: !0,
|
|
289
|
+
handleOverlayReady: (C) => {
|
|
290
|
+
this.listenerHost = this.overlay = C, this.init();
|
|
291
|
+
}
|
|
292
|
+
})), this.strategy.open = (o == null ? void 0 : o.open) ?? !1;
|
|
293
|
+
}
|
|
294
|
+
handleSlottableRequest(e) {
|
|
295
|
+
var r, n;
|
|
296
|
+
if (e.target !== e.currentTarget)
|
|
297
|
+
return;
|
|
298
|
+
const t = e.data === y, o = {};
|
|
299
|
+
if (this.host && (o.host = this.host), b(
|
|
300
|
+
t ? void 0 : this.template(),
|
|
301
|
+
this.overlay,
|
|
302
|
+
o
|
|
303
|
+
), t)
|
|
304
|
+
this.overlay.remove();
|
|
305
|
+
else {
|
|
306
|
+
S.applyOptions(this.overlay, {
|
|
307
|
+
...this.options,
|
|
308
|
+
trigger: this.target
|
|
309
|
+
});
|
|
310
|
+
const a = typeof ((r = this.insertionOptions) == null ? void 0 : r.el) == "function" ? this.insertionOptions.el() : ((n = this.insertionOptions) == null ? void 0 : n.el) || this.target, { where: m = "afterend" } = this.insertionOptions || {};
|
|
311
|
+
a.insertAdjacentElement(m, this.overlay);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const V = v(I);
|
|
316
|
+
customElements.get("luzmo-overlay") || customElements.define("luzmo-overlay", f);
|
|
317
|
+
customElements.get("luzmo-overlay-trigger") || customElements.define("luzmo-overlay-trigger", l);
|
|
318
|
+
export {
|
|
319
|
+
S as AbstractOverlay,
|
|
320
|
+
G as ClickController,
|
|
321
|
+
M as HoverController,
|
|
322
|
+
J as InteractionController,
|
|
323
|
+
O as InteractionTypes,
|
|
324
|
+
K as LONGPRESS_INSTRUCTIONS,
|
|
325
|
+
Q as LongpressController,
|
|
326
|
+
f as Overlay,
|
|
327
|
+
l as OverlayTrigger,
|
|
328
|
+
I as OverlayTriggerDirective,
|
|
329
|
+
W as PlacementController,
|
|
330
|
+
x as SlottableRequestDirective,
|
|
331
|
+
le as SlottableRequestEvent,
|
|
332
|
+
X as VirtualTrigger,
|
|
333
|
+
Y as guaranteedAllTransitionend,
|
|
334
|
+
Z as nextFrame,
|
|
335
|
+
ee as noop,
|
|
336
|
+
U as openOverlay,
|
|
337
|
+
te as overlayTimer,
|
|
338
|
+
oe as placementUpdatedSymbol,
|
|
339
|
+
y as removeSlottableRequest,
|
|
340
|
+
N as slottableRequest,
|
|
341
|
+
V as trigger
|
|
342
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactiveController } from 'lit';
|
|
2
|
+
import { AbstractOverlay } from './abstract-overlay';
|
|
3
|
+
export declare enum InteractionTypes {
|
|
4
|
+
'click' = 0,
|
|
5
|
+
'hover' = 1,
|
|
6
|
+
'longpress' = 2
|
|
7
|
+
}
|
|
8
|
+
export type ControllerOptions = {
|
|
9
|
+
overlay?: AbstractOverlay;
|
|
10
|
+
handleOverlayReady?: (overlay: AbstractOverlay) => void;
|
|
11
|
+
isPersistent?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare class InteractionController implements ReactiveController {
|
|
14
|
+
target: HTMLElement;
|
|
15
|
+
abortController: AbortController;
|
|
16
|
+
get activelyOpening(): boolean;
|
|
17
|
+
private handleOverlayReady?;
|
|
18
|
+
private isLazilyOpen;
|
|
19
|
+
get open(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Set `open` against the associated Overlay lazily.
|
|
22
|
+
*/
|
|
23
|
+
set open(open: boolean);
|
|
24
|
+
get overlay(): AbstractOverlay;
|
|
25
|
+
set overlay(overlay: AbstractOverlay | undefined);
|
|
26
|
+
private _overlay;
|
|
27
|
+
protected isPersistent: boolean;
|
|
28
|
+
type: InteractionTypes;
|
|
29
|
+
constructor(target: HTMLElement, { overlay, isPersistent, handleOverlayReady }: ControllerOptions);
|
|
30
|
+
prepareDescription(_: HTMLElement): void;
|
|
31
|
+
releaseDescription(): void;
|
|
32
|
+
shouldCompleteOpen(): void;
|
|
33
|
+
init(): void;
|
|
34
|
+
initOverlay(): void;
|
|
35
|
+
abort(): void;
|
|
36
|
+
hostConnected(): void;
|
|
37
|
+
hostDisconnected(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Overlay } from './overlay';
|
|
2
|
+
import type { OverlayOptions, OverlayOptionsV1, TriggerInteractionsV1 } from './overlay-types';
|
|
3
|
+
export declare function openOverlay(trigger: HTMLElement, interaction: TriggerInteractionsV1, content: HTMLElement, optionsV1: OverlayOptionsV1): Promise<() => void>;
|
|
4
|
+
export declare function openOverlay(content: HTMLElement, options?: OverlayOptions): Promise<Overlay>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InteractionController, InteractionTypes } from './interaction-controller';
|
|
2
|
+
export declare const LONGPRESS_INSTRUCTIONS: {
|
|
3
|
+
touch: string;
|
|
4
|
+
keyboard: string;
|
|
5
|
+
mouse: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class LongpressController extends InteractionController {
|
|
8
|
+
type: InteractionTypes;
|
|
9
|
+
get activelyOpening(): boolean;
|
|
10
|
+
protected longpressState: null | 'potential' | 'opening' | 'pressed';
|
|
11
|
+
releaseDescription: () => void;
|
|
12
|
+
private timeout;
|
|
13
|
+
handleLongpress(): void;
|
|
14
|
+
handlePointerdown(event: PointerEvent): void;
|
|
15
|
+
private handlePointerup;
|
|
16
|
+
private handleKeydown;
|
|
17
|
+
private handleKeyup;
|
|
18
|
+
prepareDescription(trigger: HTMLElement): void;
|
|
19
|
+
shouldCompleteOpen(): void;
|
|
20
|
+
init(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LuzmoElement } from '../../utils/base';
|
|
2
|
+
import { AbstractOverlay } from './abstract-overlay';
|
|
3
|
+
import { Constructor } from './overlay-types';
|
|
4
|
+
export declare function OverlayDialog<T extends Constructor<AbstractOverlay>>(constructor: T): T & Constructor<LuzmoElement>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class OverlayCloseEvent extends Event {
|
|
2
|
+
root?: HTMLElement;
|
|
3
|
+
constructor({ root }: {
|
|
4
|
+
root?: HTMLElement;
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface GlobalEventHandlersEventMap {
|
|
9
|
+
'luzmo-overlay-close': CustomEvent<OverlayCloseEvent>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LuzmoElement } from '../../utils/base';
|
|
2
|
+
import { AbstractOverlay } from './abstract-overlay';
|
|
3
|
+
import { Constructor } from './overlay-types';
|
|
4
|
+
export declare function OverlayNoPopover<T extends Constructor<AbstractOverlay>>(constructor: T): T & Constructor<LuzmoElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LuzmoElement } from '../../utils/base';
|
|
2
|
+
import { AbstractOverlay } from './abstract-overlay';
|
|
3
|
+
import { Constructor } from './overlay-types';
|
|
4
|
+
export declare function OverlayPopover<T extends Constructor<AbstractOverlay>>(constructor: T): T & Constructor<LuzmoElement>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Overlay } from './overlay';
|
|
2
|
+
declare class OverlayStack {
|
|
3
|
+
private get document();
|
|
4
|
+
private pointerdownPath?;
|
|
5
|
+
private lastOverlay?;
|
|
6
|
+
private root;
|
|
7
|
+
stack: Overlay[];
|
|
8
|
+
constructor();
|
|
9
|
+
bindEvents(): void;
|
|
10
|
+
private closeOverlay;
|
|
11
|
+
/**
|
|
12
|
+
* Cach the `pointerdownTarget` for later testing
|
|
13
|
+
*
|
|
14
|
+
* @param event {ClickEvent}
|
|
15
|
+
*/
|
|
16
|
+
handlePointerdown: (event: Event) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Close all overlays that are not ancestors of this click event
|
|
19
|
+
*
|
|
20
|
+
* @param event {ClickEvent}
|
|
21
|
+
*/
|
|
22
|
+
handlePointerup: () => void;
|
|
23
|
+
handleBeforetoggle: (event: Event) => void;
|
|
24
|
+
private handleKeydown;
|
|
25
|
+
/**
|
|
26
|
+
* Get an array of Overlays that all share the same trigger element.
|
|
27
|
+
*
|
|
28
|
+
* @param triggerElement {HTMLELement}
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[];
|
|
32
|
+
/**
|
|
33
|
+
* When overlays are added manage the open state of exisiting overlays appropriately:
|
|
34
|
+
* - 'modal': should close other non-'modal' and non-'manual' overlays
|
|
35
|
+
* - 'page': should close other non-'modal' and non-'manual' overlays
|
|
36
|
+
* - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays
|
|
37
|
+
* - 'manual': shouldn't close other overlays
|
|
38
|
+
* - 'hint': shouldn't close other overlays and give way to all other overlays on a trigger
|
|
39
|
+
*/
|
|
40
|
+
add(overlay: Overlay): void;
|
|
41
|
+
remove(overlay: Overlay): void;
|
|
42
|
+
}
|
|
43
|
+
export declare const overlayStack: OverlayStack;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A timer to help with implementation of warnup/cooldown behavior as described here:
|
|
3
|
+
*/
|
|
4
|
+
export declare class OverlayTimer {
|
|
5
|
+
private warmUpDelay;
|
|
6
|
+
private coolDownDelay;
|
|
7
|
+
private isWarm;
|
|
8
|
+
private cooldownTimeout?;
|
|
9
|
+
private component?;
|
|
10
|
+
private timeout;
|
|
11
|
+
private promise?;
|
|
12
|
+
private resolve?;
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
warmUpDelay?: number;
|
|
15
|
+
coolDownDelay?: number;
|
|
16
|
+
});
|
|
17
|
+
openTimer(component: HTMLElement): Promise<boolean>;
|
|
18
|
+
close(component: HTMLElement): void;
|
|
19
|
+
private resetCooldownTimer;
|
|
20
|
+
private cancelCooldownTimer;
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ElementPart, TemplateResult } from 'lit';
|
|
2
|
+
import { OverlayOptions, TriggerInteraction } from './overlay-types';
|
|
3
|
+
import { SlottableRequestDirective } from './slottable-request-directive';
|
|
4
|
+
import { SlottableRequestEvent } from './slottable-request-event';
|
|
5
|
+
export type InsertionOptions = {
|
|
6
|
+
el: HTMLElement | (() => HTMLElement);
|
|
7
|
+
where: InsertPosition;
|
|
8
|
+
};
|
|
9
|
+
export type OverlayTriggerOptions = {
|
|
10
|
+
open?: boolean;
|
|
11
|
+
triggerInteraction: TriggerInteraction;
|
|
12
|
+
overlayOptions: OverlayOptions;
|
|
13
|
+
insertionOptions?: InsertionOptions;
|
|
14
|
+
};
|
|
15
|
+
export declare class OverlayTriggerDirective extends SlottableRequestDirective {
|
|
16
|
+
private host?;
|
|
17
|
+
private overlay;
|
|
18
|
+
private strategy;
|
|
19
|
+
protected defaultOptions: OverlayTriggerOptions;
|
|
20
|
+
protected options: OverlayOptions;
|
|
21
|
+
protected insertionOptions?: InsertionOptions;
|
|
22
|
+
render(_template: () => TemplateResult, _options?: Partial<OverlayTriggerOptions>): unknown;
|
|
23
|
+
update(part: ElementPart, [template, options]: Parameters<this['render']>): void;
|
|
24
|
+
handleSlottableRequest(event: SlottableRequestEvent): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const trigger: (_template: () => TemplateResult, _options?: Partial<OverlayTriggerOptions> | undefined) => import("lit-html/directive.js").DirectiveResult<typeof OverlayTriggerDirective>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/dom';
|
|
2
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import { LuzmoElement } from '../../utils/base';
|
|
4
|
+
import { Overlay } from './overlay';
|
|
5
|
+
import { OverlayTriggerInteractions } from './overlay-types';
|
|
6
|
+
export type OverlayContentTypes = 'click' | 'hover' | 'longpress';
|
|
7
|
+
/**
|
|
8
|
+
* @element overlay-trigger
|
|
9
|
+
*
|
|
10
|
+
* @slot trigger - The content that will trigger the various overlays
|
|
11
|
+
* @slot hover-content - The content that will be displayed on hover
|
|
12
|
+
* @slot click-content - The content that will be displayed on click
|
|
13
|
+
* @slot longpress-content - The content that will be displayed on click
|
|
14
|
+
*
|
|
15
|
+
* @fires luzmo-opened - Announces that the overlay has been opened
|
|
16
|
+
* @fires luzmo-closed - Announces that the overlay has been closed
|
|
17
|
+
*/
|
|
18
|
+
export declare class OverlayTrigger extends LuzmoElement {
|
|
19
|
+
static get styles(): CSSResultArray;
|
|
20
|
+
content: string;
|
|
21
|
+
/**
|
|
22
|
+
* @type {"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"}
|
|
23
|
+
* @attr
|
|
24
|
+
*/
|
|
25
|
+
placement?: Placement;
|
|
26
|
+
type?: OverlayTriggerInteractions;
|
|
27
|
+
offset: number;
|
|
28
|
+
open?: OverlayContentTypes;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
receivesFocus: 'true' | 'false' | 'auto';
|
|
31
|
+
private clickContent;
|
|
32
|
+
private clickPlacement?;
|
|
33
|
+
private longpressContent;
|
|
34
|
+
private longpressPlacement?;
|
|
35
|
+
private hoverContent;
|
|
36
|
+
private hoverPlacement?;
|
|
37
|
+
private targetContent;
|
|
38
|
+
clickOverlayElement: Overlay;
|
|
39
|
+
longpressOverlayElement: Overlay;
|
|
40
|
+
hoverOverlayElement: Overlay;
|
|
41
|
+
private getAssignedElementsFromSlot;
|
|
42
|
+
private handleTriggerContent;
|
|
43
|
+
private handleSlotContent;
|
|
44
|
+
private handleBeforetoggle;
|
|
45
|
+
protected update(changes: PropertyValues): void;
|
|
46
|
+
protected renderSlot(name: string): TemplateResult;
|
|
47
|
+
protected renderClickOverlay(): TemplateResult;
|
|
48
|
+
protected renderHoverOverlay(): TemplateResult;
|
|
49
|
+
protected renderLongpressOverlay(): TemplateResult;
|
|
50
|
+
protected render(): TemplateResult;
|
|
51
|
+
protected updated(changes: PropertyValues): void;
|
|
52
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/dom';
|
|
2
|
+
import type { VirtualTrigger } from './virtual-trigger';
|
|
3
|
+
export type Constructor<T = Record<string, unknown>> = {
|
|
4
|
+
new (...args: any[]): T;
|
|
5
|
+
prototype: T;
|
|
6
|
+
};
|
|
7
|
+
export type OverlayTypes = 'auto' | 'hint' | 'manual' | 'modal' | 'page';
|
|
8
|
+
export type TriggerInteraction = 'click' | 'longpress' | 'hover';
|
|
9
|
+
export type TriggerInteractions = OverlayTypes;
|
|
10
|
+
export type TriggerInteractionsV1 = 'click' | 'longpress' | 'hover' | 'custom' | 'replace' | 'inline' | 'modal';
|
|
11
|
+
export type OverlayTriggerInteractions = Extract<TriggerInteractions, 'inline' | 'modal' | 'replace'>;
|
|
12
|
+
export interface OverlayOpenCloseDetail {
|
|
13
|
+
interaction: TriggerInteractions;
|
|
14
|
+
reason?: 'external-click';
|
|
15
|
+
}
|
|
16
|
+
export interface OverlayCloseReasonDetail {
|
|
17
|
+
reason?: 'external-click';
|
|
18
|
+
}
|
|
19
|
+
export type OverlayOptions = {
|
|
20
|
+
delayed?: boolean;
|
|
21
|
+
notImmediatelyClosable?: boolean;
|
|
22
|
+
offset?: number | [number, number];
|
|
23
|
+
placement?: Placement;
|
|
24
|
+
receivesFocus?: 'auto' | 'true' | 'false';
|
|
25
|
+
trigger?: HTMLElement | VirtualTrigger;
|
|
26
|
+
type?: 'modal' | 'page' | 'hint' | 'auto' | 'manual';
|
|
27
|
+
};
|
|
28
|
+
export type OverlayOptionsV1 = {
|
|
29
|
+
root?: HTMLElement;
|
|
30
|
+
delayed?: boolean;
|
|
31
|
+
placement?: Placement;
|
|
32
|
+
offset?: number;
|
|
33
|
+
receivesFocus?: 'true' | 'false' | 'auto';
|
|
34
|
+
notImmediatelyClosable?: boolean;
|
|
35
|
+
abortPromise?: Promise<boolean>;
|
|
36
|
+
virtualTrigger?: VirtualTrigger;
|
|
37
|
+
};
|
|
38
|
+
declare global {
|
|
39
|
+
interface GlobalEventHandlersEventMap {
|
|
40
|
+
'luzmo-opened': CustomEvent<OverlayOpenCloseDetail>;
|
|
41
|
+
'luzmo-closed': CustomEvent<OverlayOpenCloseDetail>;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export type OpenableElement = HTMLElement & {
|
|
45
|
+
open: boolean;
|
|
46
|
+
tipElement?: HTMLElement;
|
|
47
|
+
updateComplete?: Promise<void>;
|
|
48
|
+
};
|
|
49
|
+
export type OverlayState = 'closed' | 'opening' | 'opened' | 'closing';
|
|
50
|
+
export { type Placement } from '@floating-ui/dom';
|