@bobbykim/manguito-theme 0.28.3 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-M2bUcfcK.cjs"),a=require("vue"),g=(t,e)=>{if(t.tagName==="A"){const r=t.getAttribute("href");return r?r.charAt(0)==="#"?r.substring(1):r:null}return e||null},v=t=>t?document.getElementById(t):null,f=t=>t.hasAttribute("visible"),u=t=>{const r=t.getAttribute("visible")==="true"?"false":"true";t.setAttribute("visible",r)},m=t=>{const e=`div[accordion="${t}"]`;return Array.from(document.querySelectorAll(e))},_=(t,e)=>{m(e).forEach(o=>{o.id===t.id?u(o):o.getAttribute("visible")==="true"&&o.setAttribute("visible","false")})},A=t=>{u(t)},C=t=>e=>{e.preventDefault();const r=e.target,o=g(r,t),l=v(o);if(!l){console.warn(`[v-collapse] Target element not found: ${o}`);return}if(!f(l)){console.warn(`[v-collapse] Target element missing 'visible' attribute: ${o}`);return}const n=l.getAttribute("accordion");n?_(l,n):A(l)},h={mounted(t,e){t.__HandleToggler=C(e.arg),t.addEventListener("click",t.__HandleToggler)},unmounted(t){t.__HandleToggler&&(t.removeEventListener("click",t.__HandleToggler),delete t.__HandleToggler)}},H=t=>e=>{e.preventDefault();const r=e.target,o=g(r,t),l=v(o);if(!l){console.warn(`[v-toggle] Target element not found: ${o}`);return}if(!f(l)){console.warn(`[v-toggle] Target element mission visible 'visible' attribute: ${o}`);return}u(l)},b={mounted(t,e){t.__ClickToggleHandler=H(e.arg),t.addEventListener("click",t.__ClickToggleHandler)},unmounted(t){t.__ClickToggleHandler&&(t.removeEventListener("click",t.__ClickToggleHandler),delete t.__ClickToggleHandler)}},s=(t,e,r,o)=>{if(t.hasAttribute(r))return t.getAttribute(r);if(typeof e.value=="object"&&e.value!==null&&o in e.value)return e.value[o]},k=(t,e)=>{if(t.hasAttribute("title"))return t.getAttribute("title")||void 0;if(typeof e.value=="string")return e.value;if(typeof e.value=="object"&&e.value?.title)return e.value.title},E=t=>{const e=Object.keys(t.modifiers);return e.length>0?e[0]:void 0},x=(t,e)=>{t.classList.add("relative","group","overflow-visible");const r=k(t,e),o=s(t,e,"color","color"),l=s(t,e,"text-color","textColor"),n=s(t,e,"tooltip-width","width"),c=typeof e.value=="object"?e.value.className:void 0,i=E(e);console.log(`color: ${o}, txt color: ${l}, width: ${n}`);const T=a.createVNode(d.tooltip,{direction:i,title:r,color:o,textColor:l,width:n,customClass:c});a.render(T,t)},w=t=>{a.render(null,t)},p={mounted(t,e){t.__HandleTooltip=r=>x(t,r),t.__UnmountTooltip=()=>w(t),t.__HandleTooltip(e)},updated(t,e,r,o){const l=e.value!==e.oldValue;let n=!1;const c=o.dirs?.find(i=>i.dir===p);if(c){const i=c.arg;e.arg!==i&&(n=!0)}(l||n)&&t.__HandleTooltip(e)},unmounted(t){t.__UnmountTooltip()}},y="pio!";exports.vClickOutside=d.vClickOutside;exports.testExport=y;exports.vCollapse=h;exports.vToggle=b;exports.vTooltip=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-D9hDl4no.cjs"),a=require("vue"),g=(t,e)=>{if(t.tagName==="A"){const o=t.getAttribute("href");return o?o.charAt(0)==="#"?o.substring(1):o:null}return e||null},v=t=>t?document.getElementById(t):null,p=t=>t.hasAttribute("visible"),u=t=>{const o=t.getAttribute("visible")==="true"?"false":"true";t.setAttribute("visible",o)},m=t=>{const e=`div[accordion="${t}"]`;return Array.from(document.querySelectorAll(e))},A=(t,e)=>{m(e).forEach(r=>{r.id===t.id?u(r):r.getAttribute("visible")==="true"&&r.setAttribute("visible","false")})},C=t=>{u(t)},b=t=>e=>{e.preventDefault();const o=e.target,r=g(o,t),l=v(r);if(!l){console.warn(`[v-collapse] Target element not found: ${r}`);return}if(!p(l)){console.warn(`[v-collapse] Target element missing 'visible' attribute: ${r}`);return}const n=l.getAttribute("accordion");n?A(l,n):C(l)},h={mounted(t,e){t.__HandleToggler=b(e.arg),t.addEventListener("click",t.__HandleToggler)},unmounted(t){t.__HandleToggler&&(t.removeEventListener("click",t.__HandleToggler),delete t.__HandleToggler)}},H=t=>e=>{e.preventDefault();const o=e.target,r=g(o,t),l=v(r);if(!l){console.warn(`[v-toggle] Target element not found: ${r}`);return}if(!p(l)){console.warn(`[v-toggle] Target element mission visible 'visible' attribute: ${r}`);return}u(l)},k={mounted(t,e){t.__ClickToggleHandler=H(e.arg),t.addEventListener("click",t.__ClickToggleHandler)},unmounted(t){t.__ClickToggleHandler&&(t.removeEventListener("click",t.__ClickToggleHandler),delete t.__ClickToggleHandler)}};let y=0;const s=(t,e,o,r)=>{if(t.hasAttribute(o))return t.getAttribute(o);if(typeof e.value=="object"&&e.value!==null&&r in e.value)return e.value[r]},E=(t,e)=>{if(t.hasAttribute("title"))return t.getAttribute("title")||void 0;if(typeof e.value=="string")return e.value;if(typeof e.value=="object"&&e.value?.title)return e.value.title},I=t=>{const e=Object.keys(t.modifiers);return e.length>0?e[0]:void 0},w=(t,e)=>{t.classList.add("relative","group","overflow-visible"),t.__TooltipId||(t.__TooltipId=`mcl-tooltip-${++y}`);const o=t.__TooltipId,r=E(t,e),l=s(t,e,"color","color"),n=s(t,e,"text-color","textColor"),c=s(t,e,"tooltip-width","width"),i=typeof e.value=="object"?e.value.customClass:void 0,_=I(e),T=a.createVNode(d.tooltip,{id:o,direction:_,content:r,color:l,textColor:n,width:c,customClass:i});a.render(T,t),t.setAttribute("aria-describedby",o)},x=t=>{a.render(null,t),t.removeAttribute("aria-describedby"),delete t.__TooltipId},f={mounted(t,e){t.__HandleTooltip=o=>w(t,o),t.__UnmountTooltip=()=>x(t),t.__HandleTooltip(e)},updated(t,e,o,r){const l=e.value!==e.oldValue;let n=!1;const c=r.dirs?.find(i=>i.dir===f);if(c){const i=c.arg;e.arg!==i&&(n=!0)}(l||n)&&t.__HandleTooltip(e)},unmounted(t){t.__UnmountTooltip()}};exports.vClickOutside=d.vClickOutside;exports.vCollapse=h;exports.vToggle=k;exports.vTooltip=f;
@@ -36,8 +36,6 @@ declare interface CollapseElement extends HTMLElement {
36
36
 
37
37
  declare type ColorPalette = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'light-1' | 'light-2' | 'light-3' | 'light-4' | 'dark-1' | 'dark-2' | 'dark-3' | 'dark-4' | 'black' | 'white' | 'transparent';
38
38
 
39
- export declare const testExport = "pio!";
40
-
41
39
  /**
42
40
  * Extends HTMLElement to include the custom handler attached by the directive
43
41
  */
@@ -48,6 +46,7 @@ declare interface ToggleElement extends HTMLElement {
48
46
  declare interface TooltipElementType extends HTMLElement {
49
47
  __HandleTooltip: (binding: DirectiveBinding<TooltipValueType>) => void;
50
48
  __UnmountTooltip: () => void;
49
+ __TooltipId?: string;
51
50
  }
52
51
 
53
52
  export declare interface TooltipValueObjectType {
@@ -55,7 +54,7 @@ export declare interface TooltipValueObjectType {
55
54
  color?: ColorPalette;
56
55
  textColor?: ColorPalette;
57
56
  width?: number | string;
58
- className?: string;
57
+ customClass?: string;
59
58
  }
60
59
 
61
60
  declare type TooltipValueType = TooltipValueObjectType | string;
@@ -76,43 +75,47 @@ declare type TooltipValueType = TooltipValueObjectType | string;
76
75
  export declare const vClickOutside: Directive<ClickOutsideElement, ClickOutsideValue>;
77
76
 
78
77
  /**
79
- * Vue directive for collapsible elements with accordion support
78
+ * Vue directive for collapsible elements with accordion support.
80
79
  *
81
- * Handles both simple collapse/expand behavior and accordion groups where
82
- * only one item can be open at a time.
80
+ * @deprecated `MclCollapseA` and `MclCollapseB` now manage state internally via the
81
+ * `useCollapseState` composable. This directive no longer has any effect on those
82
+ * components and will be removed in a future release.
83
83
  *
84
- * Works with the `observeVisibleAttr` composable for reactive state management.
84
+ * Migrate accordion groups to the `AccordionGroup` wrapper component:
85
85
  *
86
86
  * @example
87
- * // Simple collapsible
88
- * <button v-collapse:content1>Toggle</button>
89
- * <div id="content1" visible="false">Collapsible content</div>
87
+ * // Preferred: AccordionGroup wrapper
88
+ * import { AccordionGroup } from '@bobbykim/manguito-theme'
89
+ * import { MclCollapseA } from '@bobbykim/mcl-collapse'
90
90
  *
91
- * @example
92
- * // Accordion group
93
- * <button v-collapse:item1>Item 1</button>
94
- * <div id="item1" visible="false" accordion="myAccordion">Content 1</div>
91
+ * <AccordionGroup>
92
+ * <MclCollapseA collapse-id="item1" title="Item 1">...</MclCollapseA>
93
+ * <MclCollapseA collapse-id="item2" title="Item 2">...</MclCollapseA>
94
+ * </AccordionGroup>
95
95
  *
96
- * <button v-collapse:item2>Item 2</button>
97
- * <div id="item2" visible="false" accordion="myAccordion">Content 2</div>
96
+ * @example
97
+ * // Preferred: standalone collapse (no wrapper needed)
98
+ * <MclCollapseA collapse-id="item1" title="Item 1">...</MclCollapseA>
98
99
  *
99
100
  */
100
101
  export declare const vCollapse: Directive<CollapseElement>;
101
102
 
102
103
  /**
103
- * Vue directive for toggling visibility of elements via the 'visible' attribute
104
+ * Vue directive for toggling visibility of elements via the 'visible' attribute.
104
105
  *
105
- * Used internally by Modal and Sidebar components to control their visibility state.
106
+ * @deprecated Use the `defineExpose` API (`modalRef.open()`, `modalRef.toggle()`) or bind
107
+ * the `:visible` prop directly instead. This directive bypasses Vue's reactivity system
108
+ * and is not SSR-compatible. It will be removed in a future release.
106
109
  *
107
110
  * @example
108
- * // With directive argument
109
- * <button v-toggle:myModal>Open Modal</button>
110
- * <div id="myModal" visible="false">Modal content</div>
111
+ * // Preferred: defineExpose ref
112
+ * const modalRef = ref()
113
+ * <button @click="modalRef.open()">Open Modal</button>
114
+ * <Modal ref="modalRef" />
111
115
  *
112
116
  * @example
113
- * // With anchor tag href
114
- * <a href="#mySidebar" v-toggle>Toggle Sidebar</a>
115
- * <aside id="mySidebar" visible="false">Sidebar content</aside>
117
+ * // Preferred: visible prop
118
+ * <Modal :visible="isOpen" />
116
119
  *
117
120
  */
118
121
  export declare const vToggle: Directive<ToggleElement>;
@@ -1,117 +1,116 @@
1
- import { t as p } from "./index-DHpsV8uC.js";
2
- import { v as N } from "./index-DHpsV8uC.js";
1
+ import { t as _ } from "./index-CYEzkRix.js";
2
+ import { v as N } from "./index-CYEzkRix.js";
3
3
  import { createVNode as m, render as u } from "vue";
4
4
  const d = (t, e) => {
5
5
  if (t.tagName === "A") {
6
- const r = t.getAttribute("href");
7
- return r ? r.charAt(0) === "#" ? r.substring(1) : r : null;
6
+ const o = t.getAttribute("href");
7
+ return o ? o.charAt(0) === "#" ? o.substring(1) : o : null;
8
8
  }
9
9
  return e || null;
10
10
  }, g = (t) => t ? document.getElementById(t) : null, v = (t) => t.hasAttribute("visible"), a = (t) => {
11
- const r = t.getAttribute("visible") === "true" ? "false" : "true";
12
- t.setAttribute("visible", r);
11
+ const o = t.getAttribute("visible") === "true" ? "false" : "true";
12
+ t.setAttribute("visible", o);
13
13
  }, T = (t) => {
14
14
  const e = `div[accordion="${t}"]`;
15
15
  return Array.from(document.querySelectorAll(e));
16
- }, _ = (t, e) => {
17
- T(e).forEach((o) => {
18
- o.id === t.id ? a(o) : o.getAttribute("visible") === "true" && o.setAttribute("visible", "false");
16
+ }, A = (t, e) => {
17
+ T(e).forEach((r) => {
18
+ r.id === t.id ? a(r) : r.getAttribute("visible") === "true" && r.setAttribute("visible", "false");
19
19
  });
20
- }, A = (t) => {
20
+ }, C = (t) => {
21
21
  a(t);
22
- }, h = (t) => (e) => {
22
+ }, b = (t) => (e) => {
23
23
  e.preventDefault();
24
- const r = e.target, o = d(r, t), l = g(o);
24
+ const o = e.target, r = d(o, t), l = g(r);
25
25
  if (!l) {
26
- console.warn(`[v-collapse] Target element not found: ${o}`);
26
+ console.warn(`[v-collapse] Target element not found: ${r}`);
27
27
  return;
28
28
  }
29
29
  if (!v(l)) {
30
30
  console.warn(
31
- `[v-collapse] Target element missing 'visible' attribute: ${o}`
31
+ `[v-collapse] Target element missing 'visible' attribute: ${r}`
32
32
  );
33
33
  return;
34
34
  }
35
35
  const n = l.getAttribute("accordion");
36
- n ? _(l, n) : A(l);
37
- }, V = {
36
+ n ? A(l, n) : C(l);
37
+ }, $ = {
38
38
  mounted(t, e) {
39
- t.__HandleToggler = h(e.arg), t.addEventListener("click", t.__HandleToggler);
39
+ t.__HandleToggler = b(e.arg), t.addEventListener("click", t.__HandleToggler);
40
40
  },
41
41
  unmounted(t) {
42
42
  t.__HandleToggler && (t.removeEventListener("click", t.__HandleToggler), delete t.__HandleToggler);
43
43
  }
44
- }, C = (t) => (e) => {
44
+ }, h = (t) => (e) => {
45
45
  e.preventDefault();
46
- const r = e.target, o = d(r, t), l = g(o);
46
+ const o = e.target, r = d(o, t), l = g(r);
47
47
  if (!l) {
48
- console.warn(`[v-toggle] Target element not found: ${o}`);
48
+ console.warn(`[v-toggle] Target element not found: ${r}`);
49
49
  return;
50
50
  }
51
51
  if (!v(l)) {
52
52
  console.warn(
53
- `[v-toggle] Target element mission visible 'visible' attribute: ${o}`
53
+ `[v-toggle] Target element mission visible 'visible' attribute: ${r}`
54
54
  );
55
55
  return;
56
56
  }
57
57
  a(l);
58
- }, $ = {
58
+ }, D = {
59
59
  mounted(t, e) {
60
- t.__ClickToggleHandler = C(e.arg), t.addEventListener("click", t.__ClickToggleHandler);
60
+ t.__ClickToggleHandler = h(e.arg), t.addEventListener("click", t.__ClickToggleHandler);
61
61
  },
62
62
  unmounted(t) {
63
63
  t.__ClickToggleHandler && (t.removeEventListener("click", t.__ClickToggleHandler), delete t.__ClickToggleHandler);
64
64
  }
65
- }, s = (t, e, r, o) => {
66
- if (t.hasAttribute(r))
67
- return t.getAttribute(r);
68
- if (typeof e.value == "object" && e.value !== null && o in e.value)
69
- return e.value[o];
70
- }, H = (t, e) => {
65
+ };
66
+ let H = 0;
67
+ const s = (t, e, o, r) => {
68
+ if (t.hasAttribute(o))
69
+ return t.getAttribute(o);
70
+ if (typeof e.value == "object" && e.value !== null && r in e.value)
71
+ return e.value[r];
72
+ }, k = (t, e) => {
71
73
  if (t.hasAttribute("title"))
72
74
  return t.getAttribute("title") || void 0;
73
75
  if (typeof e.value == "string")
74
76
  return e.value;
75
77
  if (typeof e.value == "object" && e.value?.title)
76
78
  return e.value.title;
77
- }, k = (t) => {
79
+ }, E = (t) => {
78
80
  const e = Object.keys(t.modifiers);
79
81
  return e.length > 0 ? e[0] : void 0;
80
- }, b = (t, e) => {
81
- t.classList.add("relative", "group", "overflow-visible");
82
- const r = H(t, e), o = s(t, e, "color", "color"), l = s(
82
+ }, I = (t, e) => {
83
+ t.classList.add("relative", "group", "overflow-visible"), t.__TooltipId || (t.__TooltipId = `mcl-tooltip-${++H}`);
84
+ const o = t.__TooltipId, r = k(t, e), l = s(t, e, "color", "color"), n = s(
83
85
  t,
84
86
  e,
85
87
  "text-color",
86
88
  "textColor"
87
- ), n = s(
89
+ ), c = s(
88
90
  t,
89
91
  e,
90
92
  "tooltip-width",
91
93
  "width"
92
- ), c = typeof e.value == "object" ? e.value.className : void 0, i = k(e);
93
- console.log(
94
- `color: ${o}, txt color: ${l}, width: ${n}`
95
- );
96
- const f = m(p, {
97
- direction: i,
98
- title: r,
99
- color: o,
100
- textColor: l,
101
- width: n,
102
- customClass: c
94
+ ), i = typeof e.value == "object" ? e.value.customClass : void 0, p = E(e), f = m(_, {
95
+ id: o,
96
+ direction: p,
97
+ content: r,
98
+ color: l,
99
+ textColor: n,
100
+ width: c,
101
+ customClass: i
103
102
  });
104
- u(f, t);
105
- }, E = (t) => {
106
- u(null, t);
107
- }, x = {
103
+ u(f, t), t.setAttribute("aria-describedby", o);
104
+ }, y = (t) => {
105
+ u(null, t), t.removeAttribute("aria-describedby"), delete t.__TooltipId;
106
+ }, w = {
108
107
  mounted(t, e) {
109
- t.__HandleTooltip = (r) => b(t, r), t.__UnmountTooltip = () => E(t), t.__HandleTooltip(e);
108
+ t.__HandleTooltip = (o) => I(t, o), t.__UnmountTooltip = () => y(t), t.__HandleTooltip(e);
110
109
  },
111
- updated(t, e, r, o) {
110
+ updated(t, e, o, r) {
112
111
  const l = e.value !== e.oldValue;
113
112
  let n = !1;
114
- const c = o.dirs?.find((i) => i.dir === x);
113
+ const c = r.dirs?.find((i) => i.dir === w);
115
114
  if (c) {
116
115
  const i = c.arg;
117
116
  e.arg !== i && (n = !0);
@@ -121,11 +120,10 @@ const d = (t, e) => {
121
120
  unmounted(t) {
122
121
  t.__UnmountTooltip();
123
122
  }
124
- }, I = "pio!";
123
+ };
125
124
  export {
126
- I as testExport,
127
125
  N as vClickOutside,
128
- V as vCollapse,
129
- $ as vToggle,
130
- x as vTooltip
126
+ $ as vCollapse,
127
+ D as vToggle,
128
+ w as vTooltip
131
129
  };
@@ -1 +1 @@
1
- "use strict";const a=require("vue"),c=require("./index-CU3f0thH.cjs"),t=a.defineComponent({setup(e,{slots:l}){const s=a.ref(!1);return a.onMounted(()=>{s.value=!0}),()=>s.value&&l.default?l.default():null}}),m={xs:"backdrop-blur-xs",sm:"backdrop-blur-sm",md:"backdrop-blur-md",lg:"backdrop-blur-lg",xl:"backdrop-blur-xl"},d={primary:"mcl-glass-primary",secondary:"mcl-glass-secondary",success:"mcl-glass-success",info:"mcl-glass-info",danger:"mcl-glass-danger",warning:"mcl-glass-warning","light-1":"mcl-glass-light-1","light-2":"mcl-glass-light-2","light-3":"mcl-glass-light-3","light-4":"mcl-glass-light-4","dark-1":"mcl-glass-dark-1","dark-2":"mcl-glass-dark-2","dark-3":"mcl-glass-dark-3","dark-4":"mcl-glass-dark-4",black:"mcl-glass-black",white:"mcl-glass-white",transparent:"mcl-glass-transparent"},n={10:"mcl-depth-10",20:"mcl-depth-20",30:"mcl-depth-30",40:"mcl-depth-40",50:"mcl-depth-50",60:"mcl-depth-60",70:"mcl-depth-70",80:"mcl-depth-80",90:"mcl-depth-90",100:"mcl-depth-100"},g=(e,l,s,r=10)=>["mcl-glassmorphism",d[e],m[l],c.generateClass("BGOPACITY",s),n[r]].filter(Boolean).join(" ");exports.ClientSideRender=t;exports.getGlassmorphismClass=g;
1
+ "use strict";const a=require("vue"),c=require("./index-DPCdWvOi.cjs"),t=a.defineComponent({setup(e,{slots:l}){const s=a.ref(!1);return a.onMounted(()=>{s.value=!0}),()=>s.value&&l.default?l.default():null}}),m={xs:"backdrop-blur-xs",sm:"backdrop-blur-sm",md:"backdrop-blur-md",lg:"backdrop-blur-lg",xl:"backdrop-blur-xl"},n={primary:"mcl-glass-primary",secondary:"mcl-glass-secondary",success:"mcl-glass-success",info:"mcl-glass-info",danger:"mcl-glass-danger",warning:"mcl-glass-warning","light-1":"mcl-glass-light-1","light-2":"mcl-glass-light-2","light-3":"mcl-glass-light-3","light-4":"mcl-glass-light-4","dark-1":"mcl-glass-dark-1","dark-2":"mcl-glass-dark-2","dark-3":"mcl-glass-dark-3","dark-4":"mcl-glass-dark-4",black:"mcl-glass-black",white:"mcl-glass-white",transparent:"mcl-glass-transparent"},d={10:"mcl-depth-10",20:"mcl-depth-20",30:"mcl-depth-30",40:"mcl-depth-40",50:"mcl-depth-50",60:"mcl-depth-60",70:"mcl-depth-70",80:"mcl-depth-80",90:"mcl-depth-90",100:"mcl-depth-100"},g=(e,l,s,r=10)=>["mcl-glassmorphism",n[e],m[l],c.generateClass.bgOpacityVariant({opacity:s}),d[r]].filter(Boolean).join(" ");exports.ClientSideRender=t;exports.getGlassmorphismClass=g;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as c, ref as e, onMounted as t } from "vue";
2
- import { g as m } from "./index-DoK_iF2I.js";
2
+ import { g as m } from "./index-CaGu958U.js";
3
3
  const p = c({
4
4
  setup(a, { slots: l }) {
5
5
  const s = e(!1);
@@ -46,7 +46,7 @@ const p = c({
46
46
  "mcl-glassmorphism",
47
47
  d[a],
48
48
  g[l],
49
- m("BGOPACITY", s),
49
+ m.bgOpacityVariant({ opacity: s }),
50
50
  n[r]
51
51
  ].filter(Boolean).join(" ");
52
52
  export {