@leaflink/stash 53.4.7 → 53.4.9

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.
@@ -1,96 +1,98 @@
1
- import { defineComponent as B, useSlots as C, computed as h, ref as O, watchEffect as V, createElementBlock as s, openBlock as a, normalizeClass as _, createVNode as o, Transition as b, withCtx as g, withDirectives as x, withModifiers as $, vShow as y, createElementVNode as d, createCommentVNode as p, renderSlot as i, unref as c } from "vue";
2
- import { a as z } from "./index-t9tXBnql.js";
3
- import N from "./Backdrop.js";
4
- import j from "./Divider.js";
5
- import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- const D = {
1
+ import { defineComponent as B, useSlots as C, computed as h, ref as O, watchEffect as $, createElementBlock as t, openBlock as a, normalizeClass as _, createVNode as o, Transition as b, withCtx as g, withDirectives as y, withModifiers as M, vShow as x, createElementVNode as p, createCommentVNode as d, renderSlot as i, unref as c } from "vue";
2
+ import { a as V } from "./index-t9tXBnql.js";
3
+ import z from "./Backdrop.js";
4
+ import N from "./Divider.js";
5
+ import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const A = {
7
7
  key: 0,
8
8
  class: "px-3 pt-6"
9
- }, M = {
9
+ }, D = {
10
10
  key: 1,
11
11
  class: "px-3 pt-6"
12
12
  }, P = {
13
13
  key: 2,
14
14
  class: "pt-6"
15
- }, I = {
15
+ }, L = {
16
16
  role: "menubar",
17
17
  "aria-orientation": "vertical"
18
- }, L = /* @__PURE__ */ B({
18
+ }, Q = /* @__PURE__ */ B({
19
19
  __name: "AppSidebar",
20
20
  props: {
21
21
  isOpen: { type: Boolean, default: !1 }
22
22
  },
23
23
  emits: ["dismiss", "update:is-open"],
24
24
  setup(k, { emit: w }) {
25
- const u = k, n = C(), v = w, r = z("screen and (min-width: 1321px)"), t = h(() => u.isOpen && !r.value), l = O({ height: "", overflow: "" }), f = h(() => u.isOpen || r.value);
25
+ const u = k, n = C(), f = w, l = V("screen and (min-width: 1321px)"), s = h(() => u.isOpen && !l.value), r = O({ height: "", overflow: "" }), m = h(() => u.isOpen || l.value);
26
26
  function S() {
27
- v("dismiss"), v("update:is-open", !1);
27
+ f("dismiss"), f("update:is-open", !1);
28
28
  }
29
29
  function E() {
30
30
  return typeof document > "u" ? null : document.scrollingElement || document.body;
31
31
  }
32
- return V(() => {
33
- if (r.value) return;
32
+ return $(() => {
33
+ if (l.value) return;
34
34
  const e = E();
35
- e && (t.value && Object.assign(l.value, {
35
+ e && (s.value && Object.assign(r.value, {
36
36
  overflow: e.style.overflow,
37
37
  height: e.style.height
38
38
  }), Object.assign(e.style, {
39
- overflow: t.value ? "hidden" : l.value.overflow,
39
+ overflow: s.value ? "hidden" : r.value.overflow,
40
40
  // Prevents page from scrolling when AppSidebar is open
41
- height: t.value ? "100%" : l.value.height
41
+ height: s.value ? "100%" : r.value.height
42
42
  // Ensures the backdrop covers the entire page when AppSidebar is open
43
43
  }));
44
- }), (e, m) => (a(), s("div", {
44
+ }), (e, v) => (a(), t("div", {
45
45
  id: "stash-app-sidebar",
46
46
  class: _(["stash-app-sidebar relative", {
47
- "stash-app-sidebar--is-open": f.value,
48
- "z-modal": t.value,
49
- "z-[301]": !t.value
47
+ "stash-app-sidebar--is-open": m.value,
48
+ "z-modal": s.value,
49
+ "z-[301]": !s.value
50
50
  }]),
51
51
  "data-test": "stash-app-sidebar"
52
52
  }, [
53
53
  o(b, { name: "backdrop" }, {
54
54
  default: g(() => [
55
- x(o(N, {
55
+ y(o(z, {
56
56
  class: "stash-app-sidebar__backdrop",
57
- onClick: $(S, ["stop"])
57
+ onClick: M(S, ["stop"])
58
58
  }, null, 512), [
59
- [y, t.value]
59
+ [x, s.value]
60
60
  ])
61
61
  ]),
62
62
  _: 1
63
63
  }),
64
64
  o(b, { name: "aside" }, {
65
65
  default: g(() => [
66
- x(d("aside", {
67
- class: _(["stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500", { "shadow-3xl": t.value }]),
66
+ y(p("aside", {
67
+ class: _(["stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500", { "shadow-3xl": s.value }]),
68
68
  "data-test": "stash-app-sidebar__aside"
69
69
  }, [
70
- o(j, { class: "stash-app-sidebar__divider" }),
71
- c(n)["app-context"] ? (a(), s("div", D, [
72
- i(e.$slots, "app-context", {}, void 0, !0)
73
- ])) : p("", !0),
74
- c(n)["company-context"] ? (a(), s("div", M, [
75
- i(e.$slots, "company-context", {}, void 0, !0)
76
- ])) : p("", !0),
77
- c(n).navigation ? (a(), s("nav", P, [
78
- d("ul", I, [
79
- i(e.$slots, "navigation", {}, void 0, !0)
70
+ o(N, { class: "stash-app-sidebar__divider" }),
71
+ c(n)["app-context"] ? (a(), t("div", A, [
72
+ i(e.$slots, "app-context")
73
+ ])) : d("", !0),
74
+ c(n)["company-context"] ? (a(), t("div", D, [
75
+ i(e.$slots, "company-context")
76
+ ])) : d("", !0),
77
+ c(n).navigation ? (a(), t("nav", P, [
78
+ p("ul", L, [
79
+ i(e.$slots, "navigation")
80
80
  ])
81
- ])) : p("", !0),
82
- m[0] || (m[0] = d("div", { class: "flex-1" }, null, -1)),
83
- i(e.$slots, "footer", {}, void 0, !0)
81
+ ])) : d("", !0),
82
+ v[0] || (v[0] = p("div", { class: "flex-1" }, null, -1)),
83
+ i(e.$slots, "footer")
84
84
  ], 2), [
85
- [y, f.value]
85
+ [x, m.value]
86
86
  ])
87
87
  ]),
88
88
  _: 3
89
89
  })
90
90
  ], 2));
91
91
  }
92
- }), H = /* @__PURE__ */ A(L, [["__scopeId", "data-v-430707c9"]]);
92
+ }), T = {}, q = {
93
+ $style: T
94
+ }, K = /* @__PURE__ */ j(Q, [["__cssModules", q]]);
93
95
  export {
94
- H as default
96
+ K as default
95
97
  };
96
98
  //# sourceMappingURL=AppSidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.js","sources":["../src/components/AppSidebar/AppSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useSlots, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Divider from '../Divider/Divider.vue';\n\n export interface AppSidebarProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n isOpen?: boolean;\n }\n\n const props = withDefaults(defineProps<AppSidebarProps>(), {\n isOpen: false,\n });\n\n const slots = useSlots();\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'dismiss'): void;\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n const isExtraLargeScreen = useMediaQuery('screen and (min-width: 1321px)');\n const isBackdropVisible = computed(() => props.isOpen && !isExtraLargeScreen.value);\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const isSidebarOpen = computed(() => props.isOpen || isExtraLargeScreen.value);\n\n function onBackdropClick() {\n emit('dismiss');\n emit('update:is-open', false);\n }\n\n function getPageScrollingElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watchEffect(() => {\n if (isExtraLargeScreen.value) return;\n\n const el = getPageScrollingElement();\n if (!el) return;\n\n if (isBackdropVisible.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n overflow: el.style.overflow,\n height: el.style.height,\n });\n }\n\n Object.assign(el.style, {\n overflow: isBackdropVisible.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when AppSidebar is open\n height: isBackdropVisible.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when AppSidebar is open\n });\n });\n</script>\n\n<template>\n <div\n id=\"stash-app-sidebar\"\n class=\"stash-app-sidebar relative\"\n :class=\"{\n 'stash-app-sidebar--is-open': isSidebarOpen,\n 'z-modal': isBackdropVisible,\n 'z-[301]': !isBackdropVisible,\n }\"\n data-test=\"stash-app-sidebar\"\n >\n <Transition name=\"backdrop\">\n <Backdrop v-show=\"isBackdropVisible\" class=\"stash-app-sidebar__backdrop\" @click.stop=\"onBackdropClick\" />\n </Transition>\n <Transition name=\"aside\">\n <aside\n v-show=\"isSidebarOpen\"\n class=\"stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500\"\n :class=\"{ 'shadow-3xl': isBackdropVisible }\"\n data-test=\"stash-app-sidebar__aside\"\n >\n <Divider class=\"stash-app-sidebar__divider\" />\n <div v-if=\"slots['app-context']\" class=\"px-3 pt-6\">\n <!-- @slot App Context component slot, ideally for rendering the context switcher -->\n <slot name=\"app-context\"></slot>\n </div>\n <div v-if=\"slots['company-context']\" class=\"px-3 pt-6\">\n <!-- @slot Company Context component slot, ideally for rendering the company picker -->\n <slot name=\"company-context\"></slot>\n </div>\n <nav v-if=\"slots['navigation']\" class=\"pt-6\">\n <ul role=\"menubar\" aria-orientation=\"vertical\">\n <!-- @slot Navigation component slot, for rendering navigation items -->\n <slot name=\"navigation\"></slot>\n </ul>\n </nav>\n <div class=\"flex-1\"></div>\n <!-- @slot Footer component slot, for rendering version/environment notes -->\n <slot name=\"footer\"></slot>\n </aside>\n </Transition>\n </div>\n</template>\n\n<style scoped>\n @layer utilities {\n .stash-app-sidebar__aside {\n padding-top: calc(var(--height-topbar) - 1px); /* -1px to compensate for the border height */\n width: var(--width-sidebar);\n }\n\n .stash-app-sidebar__divider::before,\n .stash-app-sidebar__divider::after {\n border-bottom: 1px solid rgb(255 255 255 / 12%);\n }\n\n .backdrop-enter-active,\n .backdrop-leave-active {\n transition: opacity 200ms ease-in-out;\n }\n\n .backdrop-enter-from,\n .backdrop-leave-to {\n opacity: 0;\n }\n\n .aside-enter-active,\n .aside-leave-active {\n transition:\n opacity 200ms ease-in-out,\n transform 200ms ease-in-out;\n }\n\n .aside-enter-from,\n .aside-leave-to {\n opacity: 0;\n transform: translateX(-20%);\n }\n }\n</style>\n"],"names":["props","__props","slots","useSlots","emit","__emit","isExtraLargeScreen","useMediaQuery","isBackdropVisible","computed","initialPageScrollingElementStyle","ref","isSidebarOpen","onBackdropClick","getPageScrollingElement","watchEffect","el","_createElementBlock","_createVNode","_Transition","Backdrop","_createElementVNode","_normalizeClass","Divider","_unref","_openBlock","_hoisted_1","_renderSlot","_ctx","_hoisted_2","_hoisted_3","_hoisted_4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcE,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAERC,IAAOC,GAQPC,IAAqBC,EAAc,gCAAgC,GACnEC,IAAoBC,EAAS,MAAMT,EAAM,UAAU,CAACM,EAAmB,KAAK,GAC5EI,IAAmCC,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEC,IAAgBH,EAAS,MAAMT,EAAM,UAAUM,EAAmB,KAAK;AAE7E,aAASO,IAAkB;AACzB,MAAAT,EAAK,SAAS,GACdA,EAAK,kBAAkB,EAAK;AAAA,IAC9B;AAEA,aAASU,IAA8C;AACrD,aAAI,OAAO,WAAa,MAAoB,OACpC,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,WAAAC,EAAY,MAAM;AAChB,UAAIT,EAAmB,MAAO;AAE9B,YAAMU,IAAKF,EAAA;AACX,MAAKE,MAEDR,EAAkB,SACpB,OAAO,OAAOE,EAAiC,OAAO;AAAA,QACpD,UAAUM,EAAG,MAAM;AAAA,QACnB,QAAQA,EAAG,MAAM;AAAA,MAAA,CAClB,GAGH,OAAO,OAAOA,EAAG,OAAO;AAAA,QACtB,UAAUR,EAAkB,QAAQ,WAAWE,EAAiC,MAAM;AAAA;AAAA,QACtF,QAAQF,EAAkB,QAAQ,SAASE,EAAiC,MAAM;AAAA;AAAA,MAAA,CACnF;AAAA,IACH,CAAC,mBAIDO,EAwCM,OAAA;AAAA,MAvCJ,IAAG;AAAA,MACH,UAAM,8BAA4B;AAAA,sCACYL,EAAA;AAAA,mBAAgCJ,EAAA;AAAA,oBAAqCA,EAAA;AAAA,MAAA;MAKnH,aAAU;AAAA,IAAA;MAEVU,EAEaC,GAAA,EAFD,MAAK,cAAU;AAAA,mBACzB,MAAyG;AAAA,YAAzGD,EAAyGE,GAAA;AAAA,YAApE,OAAM;AAAA,YAA+B,WAAYP,GAAe,CAAA,MAAA,CAAA;AAAA,UAAA;gBAAnFL,EAAA,KAAiB;AAAA,UAAA;;;;MAErCU,EA0BaC,GAAA,EA1BD,MAAK,WAAO;AAAA,mBACtB,MAwBQ;AAAA,YAxBRE,EAwBQ,SAAA;AAAA,YAtBN,OAAKC,EAAA,CAAC,uEAAqE,EAAA,cACnDd,EAAA,MAAA,CAAiB,CAAA;AAAA,YACzC,aAAU;AAAA,UAAA;YAEVU,EAA8CK,GAAA,EAArC,OAAM,8BAA4B;AAAA,YAChCC,EAAAtB,CAAA,EAAK,aAAA,KAAhBuB,EAAA,GAAAR,EAGM,OAHNS,GAGM;AAAA,cADJC,EAAgCC,EAAA,QAAA,eAAA,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA;YAEvBJ,EAAAtB,CAAA,EAAK,iBAAA,KAAhBuB,EAAA,GAAAR,EAGM,OAHNY,GAGM;AAAA,cADJF,EAAoCC,EAAA,QAAA,mBAAA,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA;YAE3BJ,EAAAtB,CAAA,EAAK,cAAhBuB,EAAA,GAAAR,EAKM,OALNa,GAKM;AAAA,cAJJT,EAGK,MAHLU,GAGK;AAAA,gBADHJ,EAA+BC,EAAA,QAAA,cAAA,CAAA,GAAA,QAAA,EAAA;AAAA,cAAA;;4BAGnCP,EAA0B,OAAA,EAArB,OAAM,SAAA,GAAQ,MAAA,EAAA;AAAA,YAEnBM,EAA2BC,EAAA,QAAA,UAAA,CAAA,GAAA,QAAA,EAAA;AAAA,UAAA;gBAtBnBhB,EAAA,KAAa;AAAA,UAAA;;;;;;;"}
1
+ {"version":3,"file":"AppSidebar.js","sources":["../src/components/AppSidebar/AppSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useSlots, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Divider from '../Divider/Divider.vue';\n\n export interface AppSidebarProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n isOpen?: boolean;\n }\n\n const props = withDefaults(defineProps<AppSidebarProps>(), {\n isOpen: false,\n });\n\n const slots = useSlots();\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'dismiss'): void;\n (e: 'update:is-open', isOpen: boolean): void;\n }>();\n\n const isExtraLargeScreen = useMediaQuery('screen and (min-width: 1321px)');\n const isBackdropVisible = computed(() => props.isOpen && !isExtraLargeScreen.value);\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const isSidebarOpen = computed(() => props.isOpen || isExtraLargeScreen.value);\n\n function onBackdropClick() {\n emit('dismiss');\n emit('update:is-open', false);\n }\n\n function getPageScrollingElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watchEffect(() => {\n if (isExtraLargeScreen.value) return;\n\n const el = getPageScrollingElement();\n if (!el) return;\n\n if (isBackdropVisible.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n overflow: el.style.overflow,\n height: el.style.height,\n });\n }\n\n Object.assign(el.style, {\n overflow: isBackdropVisible.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when AppSidebar is open\n height: isBackdropVisible.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when AppSidebar is open\n });\n });\n</script>\n\n<template>\n <div\n id=\"stash-app-sidebar\"\n class=\"stash-app-sidebar relative\"\n :class=\"{\n 'stash-app-sidebar--is-open': isSidebarOpen,\n 'z-modal': isBackdropVisible,\n 'z-[301]': !isBackdropVisible,\n }\"\n data-test=\"stash-app-sidebar\"\n >\n <Transition name=\"backdrop\">\n <Backdrop v-show=\"isBackdropVisible\" class=\"stash-app-sidebar__backdrop\" @click.stop=\"onBackdropClick\" />\n </Transition>\n <Transition name=\"aside\">\n <aside\n v-show=\"isSidebarOpen\"\n class=\"stash-app-sidebar__aside fixed flex h-screen flex-col bg-purple-500\"\n :class=\"{ 'shadow-3xl': isBackdropVisible }\"\n data-test=\"stash-app-sidebar__aside\"\n >\n <Divider class=\"stash-app-sidebar__divider\" />\n <div v-if=\"slots['app-context']\" class=\"px-3 pt-6\">\n <!-- @slot App Context component slot, ideally for rendering the context switcher -->\n <slot name=\"app-context\"></slot>\n </div>\n <div v-if=\"slots['company-context']\" class=\"px-3 pt-6\">\n <!-- @slot Company Context component slot, ideally for rendering the company picker -->\n <slot name=\"company-context\"></slot>\n </div>\n <nav v-if=\"slots['navigation']\" class=\"pt-6\">\n <ul role=\"menubar\" aria-orientation=\"vertical\">\n <!-- @slot Navigation component slot, for rendering navigation items -->\n <slot name=\"navigation\"></slot>\n </ul>\n </nav>\n <div class=\"flex-1\"></div>\n <!-- @slot Footer component slot, for rendering version/environment notes -->\n <slot name=\"footer\"></slot>\n </aside>\n </Transition>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__aside) {\n padding-top: calc(var(--height-topbar) - 1px); /* -1px to compensate for the border height */\n width: var(--width-sidebar);\n }\n\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__divider::before),\n :global(:where(.stash-app-sidebar) .stash-app-sidebar__divider::after) {\n border-bottom: 1px solid rgb(255 255 255 / 12%);\n }\n\n :global(:where(.stash-app-sidebar) .backdrop-enter-active),\n :global(:where(.stash-app-sidebar) .backdrop-leave-active) {\n transition: opacity 200ms ease-in-out;\n }\n\n :global(:where(.stash-app-sidebar) .backdrop-enter-from),\n :global(:where(.stash-app-sidebar) .backdrop-leave-to) {\n opacity: 0;\n }\n\n :global(:where(.stash-app-sidebar) .aside-enter-active),\n :global(:where(.stash-app-sidebar) .aside-leave-active) {\n transition:\n opacity 200ms ease-in-out,\n transform 200ms ease-in-out;\n }\n\n :global(:where(.stash-app-sidebar) .aside-enter-from),\n :global(:where(.stash-app-sidebar) .aside-leave-to) {\n opacity: 0;\n transform: translateX(-20%);\n }\n }\n</style>\n"],"names":["props","__props","slots","useSlots","emit","__emit","isExtraLargeScreen","useMediaQuery","isBackdropVisible","computed","initialPageScrollingElementStyle","ref","isSidebarOpen","onBackdropClick","getPageScrollingElement","watchEffect","el","_createElementBlock","_createVNode","_Transition","Backdrop","_createElementVNode","_normalizeClass","Divider","_unref","_openBlock","_hoisted_1","_renderSlot","_ctx","_hoisted_2","_hoisted_3","_hoisted_4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcE,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAERC,IAAOC,GAQPC,IAAqBC,EAAc,gCAAgC,GACnEC,IAAoBC,EAAS,MAAMT,EAAM,UAAU,CAACM,EAAmB,KAAK,GAC5EI,IAAmCC,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEC,IAAgBH,EAAS,MAAMT,EAAM,UAAUM,EAAmB,KAAK;AAE7E,aAASO,IAAkB;AACzB,MAAAT,EAAK,SAAS,GACdA,EAAK,kBAAkB,EAAK;AAAA,IAC9B;AAEA,aAASU,IAA8C;AACrD,aAAI,OAAO,WAAa,MAAoB,OACpC,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,WAAAC,EAAY,MAAM;AAChB,UAAIT,EAAmB,MAAO;AAE9B,YAAMU,IAAKF,EAAA;AACX,MAAKE,MAEDR,EAAkB,SACpB,OAAO,OAAOE,EAAiC,OAAO;AAAA,QACpD,UAAUM,EAAG,MAAM;AAAA,QACnB,QAAQA,EAAG,MAAM;AAAA,MAAA,CAClB,GAGH,OAAO,OAAOA,EAAG,OAAO;AAAA,QACtB,UAAUR,EAAkB,QAAQ,WAAWE,EAAiC,MAAM;AAAA;AAAA,QACtF,QAAQF,EAAkB,QAAQ,SAASE,EAAiC,MAAM;AAAA;AAAA,MAAA,CACnF;AAAA,IACH,CAAC,mBAIDO,EAwC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ent as R, useSlots as V, ref as c, computed as C, watch as T, onBeforeUnmount as K, createElementBlock as m, createCommentVNode as n, openBlock as i, withKeys as q, normalizeClass as d, createVNode as z, createElementVNode as _, withModifiers as $, unref as p, createBlock as D, renderSlot as v, toDisplayString as P, withCtx as H } from "vue";
1
+ import { defineComponent as R, useSlots as V, ref as c, computed as C, watch as F, onBeforeUnmount as K, createElementBlock as m, createCommentVNode as n, openBlock as i, withKeys as q, normalizeClass as d, createVNode as z, createElementVNode as _, withModifiers as M, unref as p, createBlock as T, renderSlot as h, toDisplayString as P, withCtx as D } from "vue";
2
2
  import U from "lodash-es/uniqueId";
3
3
  import { FOCUS_ELEMENTS_SELECTOR as W } from "./constants.js";
4
- import { t as j } from "./locale.js";
4
+ import { t as H } from "./locale.js";
5
5
  import G from "./Backdrop.js";
6
- import I from "./Button.js";
7
- import M from "./Icon.js";
6
+ import j from "./Button.js";
7
+ import N from "./Icon.js";
8
8
  import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  var Q = /* @__PURE__ */ ((a) => (a.Narrow = "narrow", a.Medium = "medium", a.Wide = "wide", a))(Q || {}), X = /* @__PURE__ */ ((a) => (a.Center = "center", a.Left = "left", a.Right = "right", a))(X || {});
10
- const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["id"], te = { class: "stash-modal__footer__actions flex flex-col justify-end lg:flex-row" }, le = /* @__PURE__ */ R({
10
+ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["id"], te = { class: "stash-modal__footer__actions flex justify-end" }, le = /* @__PURE__ */ R({
11
11
  name: "ll-modal",
12
12
  __name: "Modal",
13
13
  props: {
@@ -26,13 +26,13 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
26
26
  preventDismiss: { type: Boolean, default: !1 }
27
27
  },
28
28
  emits: ["update:open", "update:is-open", "dismiss"],
29
- setup(a, { emit: N }) {
30
- const e = a, w = N, b = V(), r = c(), E = c(null), h = c([]), k = c(), x = c(), f = c({ height: "", overflow: "" }), L = U("modal-header-"), O = C(() => !!b.actions || !!b.footer), l = C(() => e.open || e.isOpen), s = C(() => e.position === "left" || e.position === "right");
29
+ setup(a, { emit: A }) {
30
+ const e = a, w = A, b = V(), r = c(), E = c(null), v = c([]), k = c(), B = c(), f = c({ height: "", overflow: "" }), L = U("modal-header-"), O = C(() => !!b.actions || !!b.footer), l = C(() => e.open || e.isOpen), s = C(() => e.position === "left" || e.position === "right");
31
31
  let u = !1;
32
32
  function g() {
33
33
  return document.scrollingElement || document.body;
34
34
  }
35
- T(
35
+ F(
36
36
  l,
37
37
  () => {
38
38
  var t;
@@ -41,7 +41,7 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
41
41
  const o = document.activeElement;
42
42
  E.value = o instanceof HTMLElement ? o : null;
43
43
  } else
44
- u && (document.removeEventListener("keydown", B), u = !1), (t = E.value) == null || t.focus();
44
+ u && (document.removeEventListener("keydown", x), u = !1), (t = E.value) == null || t.focus();
45
45
  l.value && Object.assign(f.value, {
46
46
  height: g().style.height,
47
47
  overflow: g().style.overflow
@@ -59,20 +59,20 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
59
59
  typeof document > "u" || (S("show"), Object.assign(g().style, {
60
60
  overflow: f.value.overflow,
61
61
  height: f.value.height
62
- }), u && (document.removeEventListener("keydown", B), u = !1), (t = E.value) == null || t.focus());
62
+ }), u && (document.removeEventListener("keydown", x), u = !1), (t = E.value) == null || t.focus());
63
63
  });
64
64
  function y() {
65
65
  e.preventDismiss || (w("update:open", !1), w("update:is-open", !1), w("dismiss"));
66
66
  }
67
- function B(t) {
68
- var o, F;
69
- t.key === "Tab" && (t.shiftKey && document.activeElement === k.value ? ((o = x.value) == null || o.focus(), t.preventDefault()) : document.activeElement === x.value && ((F = k.value) == null || F.focus(), t.preventDefault()));
67
+ function x(t) {
68
+ var o, $;
69
+ t.key === "Tab" && (t.shiftKey && document.activeElement === k.value ? ((o = B.value) == null || o.focus(), t.preventDefault()) : document.activeElement === B.value && (($ = k.value) == null || $.focus(), t.preventDefault()));
70
70
  }
71
- function A() {
72
- typeof document > "u" || !r.value || !l.value || (r.value.focus(), h.value = Array.from(r.value.querySelectorAll(W)), k.value = h.value[0], x.value = h.value[h.value.length - 1], u || (document.addEventListener("keydown", B), u = !0));
71
+ function I() {
72
+ typeof document > "u" || !r.value || !l.value || (r.value.focus(), v.value = Array.from(r.value.querySelectorAll(W)), k.value = v.value[0], B.value = v.value[v.value.length - 1], u || (document.addEventListener("keydown", x), u = !0));
73
73
  }
74
- T(r, () => {
75
- !r.value || !l.value || A();
74
+ F(r, () => {
75
+ !r.value || !l.value || I();
76
76
  });
77
77
  function S(t) {
78
78
  if (typeof document > "u")
@@ -97,7 +97,7 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
97
97
  }, [
98
98
  z(G, {
99
99
  class: "stash-modal__backdrop",
100
- onClick: $(y, ["stop"])
100
+ onClick: M(y, ["stop"])
101
101
  }),
102
102
  _("div", {
103
103
  "aria-modal": "true",
@@ -121,7 +121,7 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
121
121
  "lg:right-0": e.position === "right"
122
122
  }
123
123
  ]]),
124
- onClick: o[0] || (o[0] = $(() => {
124
+ onClick: o[0] || (o[0] = M(() => {
125
125
  }, ["stop"]))
126
126
  }, [
127
127
  e.hideHeader ? n("", !0) : (i(), m("header", {
@@ -130,23 +130,23 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
130
130
  class: d(["stash-modal__header grid h-12 place-items-center bg-purple-500", { "lg:rounded-t": !s.value }])
131
131
  }, [
132
132
  _("div", Z, [
133
- v(t.$slots, "headerAction", {}, void 0, !0)
133
+ h(t.$slots, "headerAction")
134
134
  ]),
135
135
  e.title ? (i(), m("h3", {
136
136
  key: 0,
137
137
  id: p(L),
138
138
  class: "m-0 flex-1 leading-6 text-white"
139
139
  }, P(e.title), 9, ee)) : n("", !0),
140
- e.hideClose ? n("", !0) : (i(), D(I, {
140
+ e.hideClose ? n("", !0) : (i(), T(j, {
141
141
  key: 1,
142
142
  icon: "",
143
143
  "data-test": "ll-modal-close",
144
- title: p(j)("ll.closeModal"),
144
+ title: p(H)("ll.closeModal"),
145
145
  type: "button",
146
146
  onClick: y
147
147
  }, {
148
- default: H(() => [
149
- z(M, {
148
+ default: D(() => [
149
+ z(N, {
150
150
  class: "text-white",
151
151
  name: "close"
152
152
  })
@@ -154,17 +154,17 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
154
154
  _: 1
155
155
  }, 8, ["title"]))
156
156
  ], 2)),
157
- !e.hideClose && e.hideHeader ? (i(), D(I, {
157
+ !e.hideClose && e.hideHeader ? (i(), T(j, {
158
158
  key: 1,
159
159
  class: "absolute right-0 top-0 z-10",
160
160
  icon: "",
161
161
  "data-test": "ll-modal-close",
162
162
  type: "button",
163
- title: p(j)("ll.closeModal"),
163
+ title: p(H)("ll.closeModal"),
164
164
  onClick: y
165
165
  }, {
166
- default: H(() => [
167
- z(M, {
166
+ default: D(() => [
167
+ z(N, {
168
168
  class: d(["drop-shadow-md", [e.closeButtonColorClass]]),
169
169
  name: "close"
170
170
  }, null, 8, ["class"])
@@ -177,7 +177,7 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
177
177
  "rounded-t": e.hideHeader
178
178
  }])
179
179
  }, [
180
- v(t.$slots, "featured-content", {}, void 0, !0)
180
+ h(t.$slots, "featured-content")
181
181
  ], 2)) : n("", !0),
182
182
  _("div", {
183
183
  class: d(["stash-modal__body flex-1 overflow-y-auto", [
@@ -191,25 +191,27 @@ const Y = ["aria-labelledby"], Z = { class: "flex place-items-center" }, ee = ["
191
191
  ]]),
192
192
  "data-test": "stash-modal__body"
193
193
  }, [
194
- v(t.$slots, "default", {}, void 0, !0)
194
+ h(t.$slots, "default")
195
195
  ], 2),
196
196
  O.value ? (i(), m("footer", {
197
197
  key: 3,
198
198
  class: d(["stash-modal__footer border-t border-ice-500 bg-ice-100 p-3 lg:p-6", { "lg:rounded-b": !s.value }])
199
199
  }, [
200
- v(t.$slots, "footer", {}, () => [
200
+ h(t.$slots, "footer", {}, () => [
201
201
  _("div", te, [
202
- v(t.$slots, "actions", {}, void 0, !0)
202
+ h(t.$slots, "actions")
203
203
  ])
204
- ], !0)
204
+ ])
205
205
  ], 2)) : n("", !0)
206
206
  ], 10, Y)
207
207
  ], 34)) : n("", !0);
208
208
  }
209
- }), ce = /* @__PURE__ */ J(le, [["__scopeId", "data-v-60489fbd"]]);
209
+ }), oe = {}, ae = {
210
+ $style: oe
211
+ }, me = /* @__PURE__ */ J(le, [["__cssModules", ae]]);
210
212
  export {
211
213
  X as ModalPosition,
212
214
  Q as ModalSize,
213
- ce as default
215
+ me as default
214
216
  };
215
217
  //# sourceMappingURL=Modal.js.map
package/dist/Modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'text-white/50',\n preventDismiss: false,\n });\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement | null>(null);\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n let isFocusTrapAttached = false;\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (typeof document === 'undefined') {\n return;\n }\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n const active = document.activeElement;\n lastExternalFocusedElement.value = active instanceof HTMLElement ? active : null;\n } else {\n if (isFocusTrapAttached) {\n document.removeEventListener('keydown', handleTab);\n isFocusTrapAttached = false;\n }\n\n lastExternalFocusedElement.value?.focus();\n }\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n if (typeof document === 'undefined') {\n return;\n }\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n if (isFocusTrapAttached) {\n document.removeEventListener('keydown', handleTab);\n isFocusTrapAttached = false;\n }\n\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n function handleTab(e: KeyboardEvent) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n function setupFocusTrap() {\n if (typeof document === 'undefined' || !rootRef.value || !isModalOpen.value) {\n return;\n }\n\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n\n if (!isFocusTrapAttached) {\n document.addEventListener('keydown', handleTab);\n isFocusTrapAttached = true;\n }\n }\n\n // Ensure the Tab key cycles through focusable elements within the modal only while it is open.\n watch(rootRef, () => {\n if (!rootRef.value || !isModalOpen.value) {\n return;\n }\n\n setupFocusTrap();\n });\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n if (typeof document === 'undefined') {\n return;\n }\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal fixed inset-0\"\n :class=\"{\n 'invisible z-behind': !isModalOpen,\n 'visible z-modal': isModalOpen,\n 'lg:flex lg:flex-col lg:items-center lg:justify-center': props.position === 'center',\n 'overflow-y-auto': !props.scrollable && !isDrawer,\n 'overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog relative flex h-screen w-full flex-col lg:shadow-3xl\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:w-[360px]': props.size === 'narrow',\n 'lg:w-[648px]': props.size === 'medium',\n 'lg:w-[960px]': props.size === 'wide',\n 'lg:my-0 lg:h-auto lg:max-h-[90vh]': props.position === 'center',\n // absolute causing this to break when items in bottom of container get focus\n 'lg:fixed lg:h-screen': isDrawer,\n 'lg:left-0': props.position === 'left',\n 'lg:right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header grid h-12 place-items-center bg-purple-500\"\n :class=\"{ 'lg:rounded-t': !isDrawer }\"\n >\n <div class=\"flex place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"m-0 flex-1 leading-6 text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"absolute right-0 top-0 z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content relative\"\n :class=\"{\n 'rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body flex-1 overflow-y-auto\"\n :class=\"[\n {\n 'p-3 lg:p-6': !props.disableBodyPadding,\n 'lg:overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:rounded-b': !hasFooterContent && !isDrawer,\n 'bg-white': !props.contrast,\n 'bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer border-t border-ice-500 bg-ice-100 p-3 lg:p-6\"\n :class=\"{ 'lg:rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions flex flex-col justify-end lg:flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: --spacing(3);\n order: 1;\n }\n\n @media (width >= theme(--breakpoint-lg)) {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n }\n</style>\n"],"names":["ModalSize","ModalPosition","props","__props","emit","__emit","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","isDrawer","isFocusTrapAttached","getPageScrollingElement","watch","toggleHelpWidgetLauncher","active","handleTab","_a","onBeforeUnmount","dismiss","e","_b","setupFocusTrap","FOCUS_ELEMENTS_SELECTOR","nextState","launcherElement","_createElementBlock","_createVNode","Backdrop","_createElementVNode","_unref","_normalizeClass","_hoisted_2","_renderSlot","_ctx","_toDisplayString","_hoisted_3","_createBlock","Button","t","Icon","_hoisted_4"],"mappings":";;;;;;;;AAAO,IAAKA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;ACkFV,UAAMC,IAAQC,GAeRC,IAAOC,GASPC,IAAQC,EAAA,GAERC,IAAUC,EAAA,GACVC,IAA6BD,EAAwB,IAAI,GACzDE,IAAgBF,EAAmB,EAAE,GACrCG,IAAoBH,EAAA,GACpBI,IAAmBJ,EAAA,GACnBK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAW,CAAC,CAACA,EAAM,MAAM,GACnEa,IAAcD,EAAS,MAAMhB,EAAM,QAAQA,EAAM,MAAM,GACvDkB,IAAWF,EAAS,MAAMhB,EAAM,aAAa,UAAUA,EAAM,aAAa,OAAO;AAEvF,QAAImB,IAAsB;AAE1B,aAASC,IAA0B;AACjC,aAAQ,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,IAAAC;AAAA,MACEJ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1
+ {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'text-white/50',\n preventDismiss: false,\n });\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement | null>(null);\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n let isFocusTrapAttached = false;\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (typeof document === 'undefined') {\n return;\n }\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n const active = document.activeElement;\n lastExternalFocusedElement.value = active instanceof HTMLElement ? active : null;\n } else {\n if (isFocusTrapAttached) {\n document.removeEventListener('keydown', handleTab);\n isFocusTrapAttached = false;\n }\n\n lastExternalFocusedElement.value?.focus();\n }\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n if (typeof document === 'undefined') {\n return;\n }\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n if (isFocusTrapAttached) {\n document.removeEventListener('keydown', handleTab);\n isFocusTrapAttached = false;\n }\n\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n function handleTab(e: KeyboardEvent) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n function setupFocusTrap() {\n if (typeof document === 'undefined' || !rootRef.value || !isModalOpen.value) {\n return;\n }\n\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n\n if (!isFocusTrapAttached) {\n document.addEventListener('keydown', handleTab);\n isFocusTrapAttached = true;\n }\n }\n\n // Ensure the Tab key cycles through focusable elements within the modal only while it is open.\n watch(rootRef, () => {\n if (!rootRef.value || !isModalOpen.value) {\n return;\n }\n\n setupFocusTrap();\n });\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n if (typeof document === 'undefined') {\n return;\n }\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal fixed inset-0\"\n :class=\"{\n 'invisible z-behind': !isModalOpen,\n 'visible z-modal': isModalOpen,\n 'lg:flex lg:flex-col lg:items-center lg:justify-center': props.position === 'center',\n 'overflow-y-auto': !props.scrollable && !isDrawer,\n 'overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog relative flex h-screen w-full flex-col lg:shadow-3xl\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:w-[360px]': props.size === 'narrow',\n 'lg:w-[648px]': props.size === 'medium',\n 'lg:w-[960px]': props.size === 'wide',\n 'lg:my-0 lg:h-auto lg:max-h-[90vh]': props.position === 'center',\n // absolute causing this to break when items in bottom of container get focus\n 'lg:fixed lg:h-screen': isDrawer,\n 'lg:left-0': props.position === 'left',\n 'lg:right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header grid h-12 place-items-center bg-purple-500\"\n :class=\"{ 'lg:rounded-t': !isDrawer }\"\n >\n <div class=\"flex place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"m-0 flex-1 leading-6 text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"absolute right-0 top-0 z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content relative\"\n :class=\"{\n 'rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body flex-1 overflow-y-auto\"\n :class=\"[\n {\n 'p-3 lg:p-6': !props.disableBodyPadding,\n 'lg:overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:rounded-b': !hasFooterContent && !isDrawer,\n 'bg-white': !props.contrast,\n 'bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer border-t border-ice-500 bg-ice-100 p-3 lg:p-6\"\n :class=\"{ 'lg:rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions flex justify-end\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n :global(:where(.stash-modal) .stash-modal__header) {\n grid-template-columns: 48px 1fr 48px;\n }\n\n /* Direction lives here (not Tailwind flex-col / lg:flex-row on the template) so utilities don’t fight column-reverse */\n :global(:where(.stash-modal) .stash-modal__footer__actions) {\n flex-direction: column-reverse;\n gap: --spacing(3);\n }\n\n @media (width >= theme(--breakpoint-lg)) {\n :global(:where(.stash-modal) .stash-modal__footer__actions) {\n flex-direction: row;\n gap: var(--grid-gutter);\n }\n }\n\n :global(:where(.stash-modal) .stash-modal__featured-content > *) {\n border-radius: inherit;\n }\n }\n</style>\n"],"names":["ModalSize","ModalPosition","props","__props","emit","__emit","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","isDrawer","isFocusTrapAttached","getPageScrollingElement","watch","toggleHelpWidgetLauncher","active","handleTab","_a","onBeforeUnmount","dismiss","e","_b","setupFocusTrap","FOCUS_ELEMENTS_SELECTOR","nextState","launcherElement","_createElementBlock","_createVNode","Backdrop","_createElementVNode","_unref","_normalizeClass","_hoisted_2","_renderSlot","_ctx","_toDisplayString","_hoisted_3","_createBlock","Button","t","Icon","_hoisted_4"],"mappings":";;;;;;;;AAAO,IAAKA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;ACkFV,UAAMC,IAAQC,GAeRC,IAAOC,GASPC,IAAQC,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EAAA,UAAqBG,EAAA;AAAA,cAAmC,YAAA,CAAAlB,EAAM;AAAA,cAAoC,cAAAA,EAAM;AAAA,YAAA;AAAA;UASrR,aAAU;AAAA,QAAA;UAEVyC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;QAIP3B,EAAA,cADRmB,EAYS,UAAA;AAAA;UAVP,OAAKK,EAAA,CAAC,qEAAmE,EAAA,gBAAA,CAC9CrB,EAAA,OAAQ,CAAA;AAAA,QAAA;UAGnCuB,EAKOC,wBALP,MAKO;AAAA,YAJLL,EAGM,OAHNY,IAGM;AAAA,cADJR,EAA4BC,EAAA,QAAA,SAAA;AAAA,YAAA;;;;;;;;;"}
package/dist/Modals.js CHANGED
@@ -1,37 +1,41 @@
1
- import { defineComponent as d, computed as u, createBlock as s, openBlock as r, Transition as m, withCtx as a, createCommentVNode as p, resolveDynamicComponent as _, mergeProps as f, toHandlers as v, createSlots as x, renderList as M, createElementVNode as L } from "vue";
2
- import C from "./useModals.js";
3
- import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const k = ["innerHTML"], H = /* @__PURE__ */ d({
1
+ import { defineComponent as i, computed as d, createElementBlock as u, openBlock as n, createVNode as m, Transition as _, withCtx as r, createBlock as p, createCommentVNode as f, resolveDynamicComponent as v, mergeProps as M, toHandlers as x, createSlots as h, renderList as L, createElementVNode as k } from "vue";
2
+ import y from "./useModals.js";
3
+ import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const B = { class: "stash-modals" }, H = ["innerHTML"], N = /* @__PURE__ */ i({
5
5
  __name: "Modals",
6
- setup(T) {
7
- const t = C(), e = u(() => t.current);
8
- function c(n) {
6
+ setup(b) {
7
+ const t = y(), e = d(() => t.current);
8
+ function c(s) {
9
9
  var o;
10
- return (o = n.options) != null && o.disableDefaultListeners ? {} : {
10
+ return (o = s.options) != null && o.disableDefaultListeners ? {} : {
11
11
  dismiss: () => t.close({ index: 0 }),
12
12
  close: () => t.close({ index: 0 }),
13
13
  cancel: () => t.close({ index: 0 })
14
14
  };
15
15
  }
16
- return (n, o) => (r(), s(m, {
17
- name: "modals",
18
- mode: "out-in"
19
- }, {
20
- default: a(() => [
21
- e.value ? (r(), s(_(e.value.component), f({ key: 0 }, e.value.attributes, { "is-open": !0 }, v(c(e.value))), x({ _: 2 }, [
22
- M(e.value.slots, (l, i) => ({
23
- name: i,
24
- fn: a(() => [
25
- L("div", { innerHTML: l }, null, 8, k)
26
- ])
27
- }))
28
- ]), 1040)) : p("", !0)
29
- ]),
30
- _: 1
31
- }));
16
+ return (s, o) => (n(), u("div", B, [
17
+ m(_, {
18
+ name: "modals",
19
+ mode: "out-in"
20
+ }, {
21
+ default: r(() => [
22
+ e.value ? (n(), p(v(e.value.component), M({ key: 0 }, e.value.attributes, { "is-open": !0 }, x(c(e.value))), h({ _: 2 }, [
23
+ L(e.value.slots, (l, a) => ({
24
+ name: a,
25
+ fn: r(() => [
26
+ k("div", { innerHTML: l }, null, 8, H)
27
+ ])
28
+ }))
29
+ ]), 1040)) : f("", !0)
30
+ ]),
31
+ _: 1
32
+ })
33
+ ]));
32
34
  }
33
- }), B = /* @__PURE__ */ h(H, [["__scopeId", "data-v-27678e71"]]);
35
+ }), T = {}, V = {
36
+ $style: T
37
+ }, w = /* @__PURE__ */ C(N, [["__cssModules", V]]);
34
38
  export {
35
- B as default
39
+ w as default
36
40
  };
37
41
  //# sourceMappingURL=Modals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n const currentModal = computed(() => modals.current);\n\n // Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n\n function getListeners(modal: DeepReadonly<Modal> | any) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index: 0 }),\n close: () => modals.close({ index: 0 }),\n cancel: () => modals.close({ index: 0 }),\n };\n }\n</script>\n\n<template>\n <Transition name=\"modals\" mode=\"out-in\">\n <component\n :is=\"currentModal.component\"\n v-if=\"currentModal\"\n v-bind=\"currentModal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(currentModal)\"\n >\n <template v-for=\"(value, name) in currentModal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </Transition>\n</template>\n\n<style scoped>\n @layer utilities {\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n }\n</style>\n"],"names":["modals","useModals","currentModal","computed","getListeners","modal","_a","_createBlock","_Transition","_openBlock","_resolveDynamicComponent","_mergeProps","_toHandlers","_createSlots","_renderList","value","name","_createElementVNode","_hoisted_1"],"mappings":";;;;;;AAKE,UAAMA,IAASC,EAAA,GAETC,IAAeC,EAAS,MAAMH,EAAO,OAAO;AAIlD,aAASI,EAAaC,GAAkC;;AACtD,cAAIC,IAAAD,EAAM,YAAN,QAAAC,EAAe,0BACV,CAAA,IAGF;AAAA,QACL,SAAS,MAAMN,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACxC,OAAO,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACtC,QAAQ,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,MAAA;AAAA,IAE3C;2BAIAO,EAaaC,GAAA;AAAA,MAbD,MAAK;AAAA,MAAS,MAAK;AAAA,IAAA;iBAC7B,MAWY;AAAA,QATJN,EAAA,SAFRO,EAAA,GAAAF,EAWYG,EAVLR,EAAA,MAAa,SAAS,GAD7BS,EAWY,YARFT,EAAA,MAAa,YAAU,EAC9B,WAAS,GAAA,GACVU,EAAMR,EAAaF,EAAA,KAAY,CAAA,CAAA,GAAAW,EAAA,EAAA,GAAA,KAAA;AAAA,UAEGC,EAAAZ,EAAA,MAAa,OAAK,CAAlCa,GAAOC;;kBAEvB,MAAsB;AAAA,cAAtBC,EAAsB,OAAA,EAAjB,WAAQF,KAAK,MAAA,GAAAG,CAAA;AAAA,YAAA;;;;;;;;"}
1
+ {"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n const currentModal = computed(() => modals.current);\n\n // Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n\n function getListeners(modal: DeepReadonly<Modal> | any) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index: 0 }),\n close: () => modals.close({ index: 0 }),\n cancel: () => modals.close({ index: 0 }),\n };\n }\n</script>\n\n<template>\n <div class=\"stash-modals\">\n <Transition name=\"modals\" mode=\"out-in\">\n <component\n :is=\"currentModal.component\"\n v-if=\"currentModal\"\n v-bind=\"currentModal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(currentModal)\"\n >\n <template v-for=\"(value, name) in currentModal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </Transition>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n /* No layout box; keeps transition hook element in tree for scoped selectors */\n :global(.stash-modals) {\n display: contents;\n }\n\n :global(:where(.stash-modals) .modals-enter-active),\n :global(:where(.stash-modals) .modals-leave-active) {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n :global(:where(.stash-modals) .modals-enter-from),\n :global(:where(.stash-modals) .modals-leave-to) {\n opacity: 0;\n }\n\n :global(:where(.stash-modals) .modals-enter-active .stash-modal__dialog--position-center),\n :global(:where(.stash-modals) .modals-leave-active .stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n :global(:where(.stash-modals) .modals-enter-from .stash-modal__dialog--position-center),\n :global(:where(.stash-modals) .modals-leave-to .stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n :global(:where(.stash-modals) .modals-enter-active .stash-modal__dialog--is-drawer),\n :global(:where(.stash-modals) .modals-leave-active .stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n :global(:where(.stash-modals) .modals-enter-from .stash-modal__dialog--position-left),\n :global(:where(.stash-modals) .modals-leave-to .stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n :global(:where(.stash-modals) .modals-enter-from .stash-modal__dialog--position-right),\n :global(:where(.stash-modals) .modals-leave-to .stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n }\n</style>\n"],"names":["modals","useModals","currentModal","computed","getListeners","modal","_a","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_Transition","_createBlock","_resolveDynamicComponent","_mergeProps","_toHandlers","_createSlots","_renderList","value","name","_createElementVNode","_hoisted_2"],"mappings":";;;;;;AAKE,UAAMA,IAASC,EAAA,GAETC,IAAeC,EAAS,MAAMH,EAAO,OAAO;AAIlD,aAASI,EAAaC,GAAkC;;AACtD,cAAIC,IAAAD,EAAM,YAAN,QAAAC,EAAe,0BACV,CAAA,IAGF;AAAA,QACL,SAAS,MAAMN,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACxC,OAAO,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACtC,QAAQ,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,MAAA;AAAA,IAE3C;sBAIAO,EAAA,GAAAC,EAeM,OAfNC,GAeM;AAAA,MAdJC,EAaaC,GAAA;AAAA,QAbD,MAAK;AAAA,QAAS,MAAK;AAAA,MAAA;mBAC7B,MAWY;AAAA,UATJT,EAAA,SAFRK,EAAA,GAAAK,EAWYC,EAVLX,EAAA,MAAa,SAAS,GAD7BY,EAWY,YARFZ,EAAA,MAAa,YAAU,EAC9B,WAAS,GAAA,GACVa,EAAMX,EAAaF,EAAA,KAAY,CAAA,CAAA,GAAAc,EAAA,EAAA,GAAA,KAAA;AAAA,YAEGC,EAAAf,EAAA,MAAa,OAAK,CAAlCgB,GAAOC;;oBAEvB,MAAsB;AAAA,gBAAtBC,EAAsB,OAAA,EAAjB,WAAQF,KAAK,MAAA,GAAAG,CAAA;AAAA,cAAA;;;;;;;;;;;"}