@bobbykim/mcl-container 0.8.2 → 0.8.3

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,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 36px)}@media screen and (min-width: 768px){.space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 48px)}}@media screen and (min-width: 1024px){.space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 64px)}}.bg-image[data-v-fb05edc4]{background-image:var(--bg-image)}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { defineComponent as O, useSlots as R, openBlock as h, createElementBlock as y, normalizeClass as p, unref as f, createElementVNode as a, renderSlot as S, createCommentVNode as z, onMounted as L, nextTick as G, getCurrentScope as M, onScopeDispose as D, getCurrentInstance as k, computed as B, ref as _, watch as A, normalizeStyle as E, createBlock as I, resolveDynamicComponent as H, withCtx as V, toDisplayString as T } from "vue";
3
- import d from "@bobbykim/manguito-theme";
4
- const F = { class: "relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]" }, N = ["points"], P = { class: "container grid md:grid-cols-4 gap-4" }, j = { class: "relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]" }, U = ["points"], ce = /* @__PURE__ */ O({
2
+ import { defineComponent as O, useSlots as R, createElementBlock as y, openBlock as m, normalizeClass as p, unref as h, createElementVNode as a, createCommentVNode as z, renderSlot as x, onMounted as L, nextTick as G, getCurrentScope as M, onScopeDispose as D, getCurrentInstance as A, computed as B, shallowRef as S, watch as k, toValue as W, ref as E, normalizeStyle as I, createBlock as H, resolveDynamicComponent as V, withCtx as T, toDisplayString as F } from "vue";
3
+ import u from "@bobbykim/manguito-theme";
4
+ const N = { class: "relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]" }, P = ["points"], j = { class: "container grid md:grid-cols-4 gap-4" }, U = { class: "relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]" }, X = ["points"], de = /* @__PURE__ */ O({
5
5
  __name: "MclContainerA",
6
6
  props: {
7
7
  sectionBg: { default: "light-1" },
@@ -43,136 +43,136 @@ const F = { class: "relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]" }, N
43
43
  return "";
44
44
  }
45
45
  };
46
- return (t, i) => (h(), y("section", {
47
- class: p(["py-lg lg:py-xl", f(d)("BGCOLOR", t.sectionBg)])
46
+ return (t, i) => (m(), y("section", {
47
+ class: p(["py-lg lg:py-xl", h(u)("BGCOLOR", t.sectionBg)])
48
48
  }, [
49
- a("div", F, [
50
- (h(), y("svg", {
51
- class: p(["block absolute left-0 inset-x-0 h-full w-full", f(d)("SVGFILL", t.containerBg)]),
49
+ a("div", N, [
50
+ (m(), y("svg", {
51
+ class: p(["block absolute left-0 inset-x-0 h-full w-full", h(u)("SVGFILL", t.containerBg)]),
52
52
  viewBox: "0 0 100 100",
53
53
  preserveAspectRatio: "none",
54
54
  "aria-hidden": "true"
55
55
  }, [
56
56
  a("polygon", {
57
57
  points: o("top", t.topDirection)
58
- }, null, 8, N)
58
+ }, null, 8, P)
59
59
  ], 2))
60
60
  ]),
61
61
  a("div", {
62
- class: p(["py-md md:py-lg lg:py-xl px-sm md:px-md lg:px-lg", f(d)("BGCOLOR", t.containerBg)])
62
+ class: p(["py-md md:py-lg lg:py-xl px-sm md:px-md lg:px-lg", h(u)("BGCOLOR", t.containerBg)])
63
63
  }, [
64
- a("div", P, [
64
+ a("div", j, [
65
65
  a("div", {
66
66
  class: p(s(t.twoColumns, t.leftColumnWidth))
67
67
  }, [
68
- S(t.$slots, "left-column")
68
+ x(t.$slots, "left-column")
69
69
  ], 2),
70
- t.twoColumns && t.leftColumnWidth !== 100 ? (h(), y("div", {
70
+ t.twoColumns && t.leftColumnWidth !== 100 ? (m(), y("div", {
71
71
  key: 0,
72
72
  class: p(c(t.twoColumns, t.leftColumnWidth))
73
73
  }, [
74
- S(t.$slots, "right-column")
74
+ x(t.$slots, "right-column")
75
75
  ], 2)) : z("", !0)
76
76
  ])
77
77
  ], 2),
78
- a("div", j, [
79
- (h(), y("svg", {
80
- class: p(["block absolute left-0 inset-x-0 h-full w-full", f(d)("SVGFILL", t.containerBg)]),
78
+ a("div", U, [
79
+ (m(), y("svg", {
80
+ class: p(["block absolute left-0 inset-x-0 h-full w-full", h(u)("SVGFILL", t.containerBg)]),
81
81
  viewBox: "0 0 100 100",
82
82
  preserveAspectRatio: "none",
83
83
  "aria-hidden": "true"
84
84
  }, [
85
85
  a("polygon", {
86
86
  points: o("bottom", t.bottomDirection)
87
- }, null, 8, U)
87
+ }, null, 8, X)
88
88
  ], 2))
89
89
  ])
90
90
  ], 2));
91
91
  }
92
92
  });
93
- function X(e) {
93
+ function q(e) {
94
94
  return M() ? (D(e), !0) : !1;
95
95
  }
96
- function W(e) {
97
- return typeof e == "function" ? e() : f(e);
98
- }
99
- const q = typeof window < "u" && typeof document < "u";
96
+ const J = typeof window < "u" && typeof document < "u";
100
97
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
101
- function J(e) {
102
- return k();
98
+ function K(e) {
99
+ return Array.isArray(e) ? e : [e];
100
+ }
101
+ function Q(e) {
102
+ return A();
103
103
  }
104
- function K(e, o = !0, s) {
105
- J() ? L(e, s) : o ? e() : G(e);
104
+ function Y(e, o = !0, s) {
105
+ Q() ? L(e, s) : o ? e() : G(e);
106
106
  }
107
- const $ = q ? window : void 0;
107
+ const $ = J ? window : void 0;
108
108
  function g(e) {
109
109
  var o;
110
110
  const s = W(e);
111
111
  return (o = s == null ? void 0 : s.$el) != null ? o : s;
112
112
  }
113
- function Q() {
114
- const e = _(!1), o = k();
113
+ function Z() {
114
+ const e = S(!1), o = A();
115
115
  return o && L(() => {
116
116
  e.value = !0;
117
117
  }, o), e;
118
118
  }
119
- function Y(e) {
120
- const o = Q();
119
+ function ee(e) {
120
+ const o = Z();
121
121
  return B(() => (o.value, !!e()));
122
122
  }
123
- function Z(e, o, s = {}) {
123
+ function te(e, o, s = {}) {
124
124
  const { window: c = $, ...t } = s;
125
125
  let i;
126
- const l = Y(() => c && "ResizeObserver" in c), r = () => {
126
+ const l = ee(() => c && "ResizeObserver" in c), r = () => {
127
127
  i && (i.disconnect(), i = void 0);
128
128
  }, v = B(() => {
129
129
  const n = W(e);
130
- return Array.isArray(n) ? n.map((u) => g(u)) : [g(n)];
131
- }), C = A(
130
+ return Array.isArray(n) ? n.map((d) => g(d)) : [g(n)];
131
+ }), C = k(
132
132
  v,
133
133
  (n) => {
134
134
  if (r(), l.value && c) {
135
135
  i = new ResizeObserver(o);
136
- for (const u of n)
137
- u && i.observe(u, t);
136
+ for (const d of n)
137
+ d && i.observe(d, t);
138
138
  }
139
139
  },
140
140
  { immediate: !0, flush: "post" }
141
141
  ), b = () => {
142
142
  r(), C();
143
143
  };
144
- return X(b), {
144
+ return q(b), {
145
145
  isSupported: l,
146
146
  stop: b
147
147
  };
148
148
  }
149
- function ee(e, o = { width: 0, height: 0 }, s = {}) {
149
+ function oe(e, o = { width: 0, height: 0 }, s = {}) {
150
150
  const { window: c = $, box: t = "content-box" } = s, i = B(() => {
151
- var n, u;
152
- return (u = (n = g(e)) == null ? void 0 : n.namespaceURI) == null ? void 0 : u.includes("svg");
153
- }), l = _(o.width), r = _(o.height), { stop: v } = Z(
151
+ var n, d;
152
+ return (d = (n = g(e)) == null ? void 0 : n.namespaceURI) == null ? void 0 : d.includes("svg");
153
+ }), l = S(o.width), r = S(o.height), { stop: v } = te(
154
154
  e,
155
155
  ([n]) => {
156
- const u = t === "border-box" ? n.borderBoxSize : t === "content-box" ? n.contentBoxSize : n.devicePixelContentBoxSize;
156
+ const d = t === "border-box" ? n.borderBoxSize : t === "content-box" ? n.contentBoxSize : n.devicePixelContentBoxSize;
157
157
  if (c && i.value) {
158
158
  const w = g(e);
159
159
  if (w) {
160
- const m = w.getBoundingClientRect();
161
- l.value = m.width, r.value = m.height;
160
+ const f = w.getBoundingClientRect();
161
+ l.value = f.width, r.value = f.height;
162
162
  }
163
- } else if (u) {
164
- const w = Array.isArray(u) ? u : [u];
165
- l.value = w.reduce((m, { inlineSize: x }) => m + x, 0), r.value = w.reduce((m, { blockSize: x }) => m + x, 0);
163
+ } else if (d) {
164
+ const w = K(d);
165
+ l.value = w.reduce((f, { inlineSize: _ }) => f + _, 0), r.value = w.reduce((f, { blockSize: _ }) => f + _, 0);
166
166
  } else
167
167
  l.value = n.contentRect.width, r.value = n.contentRect.height;
168
168
  },
169
169
  s
170
170
  );
171
- K(() => {
171
+ Y(() => {
172
172
  const n = g(e);
173
173
  n && (l.value = "offsetWidth" in n ? n.offsetWidth : o.width, r.value = "offsetHeight" in n ? n.offsetHeight : o.height);
174
174
  });
175
- const C = A(
175
+ const C = k(
176
176
  () => g(e),
177
177
  (n) => {
178
178
  l.value = n ? o.width : 0, r.value = n ? o.height : 0;
@@ -187,7 +187,7 @@ function ee(e, o = { width: 0, height: 0 }, s = {}) {
187
187
  stop: b
188
188
  };
189
189
  }
190
- const te = { class: "relative" }, oe = ["aria-label"], ne = { class: "w-full" }, se = { class: "mt-sm" }, le = /* @__PURE__ */ O({
190
+ const ne = { class: "relative" }, se = ["aria-label"], le = { class: "w-full" }, ie = { class: "mt-sm" }, re = /* @__PURE__ */ O({
191
191
  __name: "MclContainerB",
192
192
  props: {
193
193
  sectionBgColor: { default: "transparent" },
@@ -202,53 +202,53 @@ const te = { class: "relative" }, oe = ["aria-label"], ne = { class: "w-full" },
202
202
  setup(e) {
203
203
  const o = e;
204
204
  R();
205
- const s = _(), { height: c } = ee(s), t = B(() => {
205
+ const s = E(), { height: c } = oe(s), t = B(() => {
206
206
  const { titleLevel: l, titleSize: r, titleColor: v } = o, C = {
207
- h1: d("H1", r),
208
- h2: d("H2", r),
209
- h3: d("H3", r),
210
- h4: d("H4", r)
207
+ h1: u("H1", r),
208
+ h2: u("H2", r),
209
+ h3: u("H3", r),
210
+ h4: u("H4", r)
211
211
  };
212
212
  return [
213
- d("TEXTCOLOR", v),
213
+ u("TEXTCOLOR", v),
214
214
  C[l]
215
215
  ].join(" ");
216
216
  }), i = B(() => ({
217
217
  "--bg-image": `url('${o.imageSource}')`,
218
218
  "--space-height": `${c.value / 2}px`
219
219
  }));
220
- return (l, r) => (h(), y("section", {
220
+ return (l, r) => (m(), y("section", {
221
221
  class: "relative",
222
- style: E(i.value)
222
+ style: I(i.value)
223
223
  }, [
224
224
  a("div", {
225
- class: p([f(d)("BGCOLOR", l.sectionBgColor), "space-hts"])
225
+ class: p([h(u)("BGCOLOR", l.sectionBgColor), "space-hts"])
226
226
  }, null, 2),
227
- a("div", te, [
227
+ a("div", ne, [
228
228
  a("div", {
229
229
  class: "absolute bg-fixed bg-cover bg-top inset-0 bg-no-repeat bg-image",
230
230
  role: "img",
231
231
  "aria-label": l.imageAlt
232
- }, null, 8, oe),
232
+ }, null, 8, se),
233
233
  a("div", {
234
234
  class: "container relative z-[10] -translate-y-1/2 px-xs max-w-[1140px]",
235
235
  ref_key: "mainContentElem",
236
236
  ref: s
237
237
  }, [
238
238
  a("div", {
239
- class: p([f(d)("BGCOLOR", l.containerBgColor), "py-md md:py-lg px-xs md:px-md lg:p-xl"])
239
+ class: p([h(u)("BGCOLOR", l.containerBgColor), "py-md md:py-lg px-xs md:px-md lg:p-xl"])
240
240
  }, [
241
- a("div", ne, [
242
- (h(), I(H(l.titleLevel), null, {
243
- default: V(() => [
241
+ a("div", le, [
242
+ (m(), H(V(l.titleLevel), null, {
243
+ default: T(() => [
244
244
  a("span", {
245
245
  class: p(t.value)
246
- }, T(l.title), 3)
246
+ }, F(l.title), 3)
247
247
  ]),
248
248
  _: 1
249
249
  })),
250
- a("div", se, [
251
- S(l.$slots, "content", {}, void 0, !0)
250
+ a("div", ie, [
251
+ x(l.$slots, "content", {}, void 0, !0)
252
252
  ])
253
253
  ])
254
254
  ], 2)
@@ -256,13 +256,13 @@ const te = { class: "relative" }, oe = ["aria-label"], ne = { class: "w-full" },
256
256
  ])
257
257
  ], 4));
258
258
  }
259
- }), ie = (e, o) => {
259
+ }), ae = (e, o) => {
260
260
  const s = e.__vccOpts || e;
261
261
  for (const [c, t] of o)
262
262
  s[c] = t;
263
263
  return s;
264
- }, ue = /* @__PURE__ */ ie(le, [["__scopeId", "data-v-fb05edc4"]]);
264
+ }, pe = /* @__PURE__ */ ae(re, [["__scopeId", "data-v-fb05edc4"]]);
265
265
  export {
266
- ce as MclContainerA,
267
- ue as MclContainerB
266
+ de as MclContainerA,
267
+ pe as MclContainerB
268
268
  };
@@ -1,2 +1,2 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 36px)}@media screen and (min-width: 768px){.space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 48px)}}@media screen and (min-width: 1024px){.space-hts[data-v-fb05edc4]{height:calc(var(--space-height) + 64px)}}.bg-image[data-v-fb05edc4]{background-image:var(--bg-image)}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- (function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.MclContainer={},p.Vue,p.ManguitoTheme))})(this,function(p,e,m){"use strict";const _={class:"relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]"},E=["points"],S={class:"container grid md:grid-cols-4 gap-4"},k={class:"relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]"},x=["points"],V=e.defineComponent({__name:"MclContainerA",props:{sectionBg:{default:"light-1"},containerBg:{default:"primary"},topDirection:{default:"left"},bottomDirection:{default:"left"},twoColumns:{type:Boolean,default:!0},leftColumnWidth:{default:50}},setup(t){e.useSlots();const n=(o,r)=>o==="top"?r==="left"?"0,0 100,100 0,100":"100,0 100,100 0,100":r==="left"?"0,0 100,0 0,100":"0,0 100,0 100,100",s=(o,r)=>{if(!o)return"md:col-span-4";switch(r){case 25:return"md:col-span-1";case 50:return"md:col-span-2";case 75:return"md:col-span-3";case 100:return"md:col-span-4";default:return""}},a=(o,r)=>{if(!o)return"";switch(r){case 25:return"md:col-span-3";case 50:return"md:col-span-2";case 75:return"md:col-span-1";case 100:default:return""}};return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["py-lg lg:py-xl",e.unref(m)("BGCOLOR",o.sectionBg)])},[e.createElementVNode("div",_,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["block absolute left-0 inset-x-0 h-full w-full",e.unref(m)("SVGFILL",o.containerBg)]),viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true"},[e.createElementVNode("polygon",{points:n("top",o.topDirection)},null,8,E)],2))]),e.createElementVNode("div",{class:e.normalizeClass(["py-md md:py-lg lg:py-xl px-sm md:px-md lg:px-lg",e.unref(m)("BGCOLOR",o.containerBg)])},[e.createElementVNode("div",S,[e.createElementVNode("div",{class:e.normalizeClass(s(o.twoColumns,o.leftColumnWidth))},[e.renderSlot(o.$slots,"left-column")],2),o.twoColumns&&o.leftColumnWidth!==100?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a(o.twoColumns,o.leftColumnWidth))},[e.renderSlot(o.$slots,"right-column")],2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",k,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["block absolute left-0 inset-x-0 h-full w-full",e.unref(m)("SVGFILL",o.containerBg)]),viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true"},[e.createElementVNode("polygon",{points:n("bottom",o.bottomDirection)},null,8,x)],2))])],2))}});function O(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function y(t){return typeof t=="function"?t():e.unref(t)}const z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function N(t){return e.getCurrentInstance()}function R(t,n=!0,s){N()?e.onMounted(t,s):n?t():e.nextTick(t)}const w=z?window:void 0;function f(t){var n;const s=y(t);return(n=s==null?void 0:s.$el)!=null?n:s}function L(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function M(t){const n=L();return e.computed(()=>(n.value,!!t()))}function A(t,n,s={}){const{window:a=w,...o}=s;let r;const i=M(()=>a&&"ResizeObserver"in a),c=()=>{r&&(r.disconnect(),r=void 0)},h=e.computed(()=>{const l=y(t);return Array.isArray(l)?l.map(d=>f(d)):[f(l)]}),g=e.watch(h,l=>{if(c(),i.value&&a){r=new ResizeObserver(n);for(const d of l)d&&r.observe(d,o)}},{immediate:!0,flush:"post"}),b=()=>{c(),g()};return O(b),{isSupported:i,stop:b}}function W(t,n={width:0,height:0},s={}){const{window:a=w,box:o="content-box"}=s,r=e.computed(()=>{var l,d;return(d=(l=f(t))==null?void 0:l.namespaceURI)==null?void 0:d.includes("svg")}),i=e.ref(n.width),c=e.ref(n.height),{stop:h}=A(t,([l])=>{const d=o==="border-box"?l.borderBoxSize:o==="content-box"?l.contentBoxSize:l.devicePixelContentBoxSize;if(a&&r.value){const C=f(t);if(C){const u=C.getBoundingClientRect();i.value=u.width,c.value=u.height}}else if(d){const C=Array.isArray(d)?d:[d];i.value=C.reduce((u,{inlineSize:B})=>u+B,0),c.value=C.reduce((u,{blockSize:B})=>u+B,0)}else i.value=l.contentRect.width,c.value=l.contentRect.height},s);R(()=>{const l=f(t);l&&(i.value="offsetWidth"in l?l.offsetWidth:n.width,c.value="offsetHeight"in l?l.offsetHeight:n.height)});const g=e.watch(()=>f(t),l=>{i.value=l?n.width:0,c.value=l?n.height:0});function b(){h(),g()}return{width:i,height:c,stop:b}}const $={class:"relative"},G=["aria-label"],T={class:"w-full"},D={class:"mt-sm"},I=((t,n)=>{const s=t.__vccOpts||t;for(const[a,o]of n)s[a]=o;return s})(e.defineComponent({__name:"MclContainerB",props:{sectionBgColor:{default:"transparent"},containerBgColor:{default:"light-2"},imageSource:{},imageAlt:{},title:{},titleLevel:{default:"h2"},titleSize:{default:"md"},titleColor:{default:"dark-3"}},setup(t){const n=t;e.useSlots();const s=e.ref(),{height:a}=W(s),o=e.computed(()=>{const{titleLevel:i,titleSize:c,titleColor:h}=n,g={h1:m("H1",c),h2:m("H2",c),h3:m("H3",c),h4:m("H4",c)};return[m("TEXTCOLOR",h),g[i]].join(" ")}),r=e.computed(()=>({"--bg-image":`url('${n.imageSource}')`,"--space-height":`${a.value/2}px`}));return(i,c)=>(e.openBlock(),e.createElementBlock("section",{class:"relative",style:e.normalizeStyle(r.value)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(m)("BGCOLOR",i.sectionBgColor),"space-hts"])},null,2),e.createElementVNode("div",$,[e.createElementVNode("div",{class:"absolute bg-fixed bg-cover bg-top inset-0 bg-no-repeat bg-image",role:"img","aria-label":i.imageAlt},null,8,G),e.createElementVNode("div",{class:"container relative z-[10] -translate-y-1/2 px-xs max-w-[1140px]",ref_key:"mainContentElem",ref:s},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(m)("BGCOLOR",i.containerBgColor),"py-md md:py-lg px-xs md:px-md lg:p-xl"])},[e.createElementVNode("div",T,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.titleLevel),null,{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(o.value)},e.toDisplayString(i.title),3)]),_:1})),e.createElementVNode("div",D,[e.renderSlot(i.$slots,"content",{},void 0,!0)])])],2)],512)])],4))}}),[["__scopeId","data-v-fb05edc4"]]);p.MclContainerA=V,p.MclContainerB=I,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
2
+ (function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.MclContainer={},p.Vue,p.ManguitoTheme))})(this,function(p,e,d){"use strict";const y={class:"relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]"},_=["points"],E={class:"container grid md:grid-cols-4 gap-4"},S={class:"relative min-h-[36px] md:min-h-[48px] lg:min-h-[60px]"},k=["points"],x=e.defineComponent({__name:"MclContainerA",props:{sectionBg:{default:"light-1"},containerBg:{default:"primary"},topDirection:{default:"left"},bottomDirection:{default:"left"},twoColumns:{type:Boolean,default:!0},leftColumnWidth:{default:50}},setup(t){e.useSlots();const n=(o,r)=>o==="top"?r==="left"?"0,0 100,100 0,100":"100,0 100,100 0,100":r==="left"?"0,0 100,0 0,100":"0,0 100,0 100,100",s=(o,r)=>{if(!o)return"md:col-span-4";switch(r){case 25:return"md:col-span-1";case 50:return"md:col-span-2";case 75:return"md:col-span-3";case 100:return"md:col-span-4";default:return""}},a=(o,r)=>{if(!o)return"";switch(r){case 25:return"md:col-span-3";case 50:return"md:col-span-2";case 75:return"md:col-span-1";case 100:default:return""}};return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["py-lg lg:py-xl",e.unref(d)("BGCOLOR",o.sectionBg)])},[e.createElementVNode("div",y,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["block absolute left-0 inset-x-0 h-full w-full",e.unref(d)("SVGFILL",o.containerBg)]),viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true"},[e.createElementVNode("polygon",{points:n("top",o.topDirection)},null,8,_)],2))]),e.createElementVNode("div",{class:e.normalizeClass(["py-md md:py-lg lg:py-xl px-sm md:px-md lg:px-lg",e.unref(d)("BGCOLOR",o.containerBg)])},[e.createElementVNode("div",E,[e.createElementVNode("div",{class:e.normalizeClass(s(o.twoColumns,o.leftColumnWidth))},[e.renderSlot(o.$slots,"left-column")],2),o.twoColumns&&o.leftColumnWidth!==100?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a(o.twoColumns,o.leftColumnWidth))},[e.renderSlot(o.$slots,"right-column")],2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",S,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["block absolute left-0 inset-x-0 h-full w-full",e.unref(d)("SVGFILL",o.containerBg)]),viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true"},[e.createElementVNode("polygon",{points:n("bottom",o.bottomDirection)},null,8,k)],2))])],2))}});function V(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}const O=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function R(t){return Array.isArray(t)?t:[t]}function z(t){return e.getCurrentInstance()}function N(t,n=!0,s){z()?e.onMounted(t,s):n?t():e.nextTick(t)}const w=O?window:void 0;function f(t){var n;const s=e.toValue(t);return(n=s==null?void 0:s.$el)!=null?n:s}function L(){const t=e.shallowRef(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function M(t){const n=L();return e.computed(()=>(n.value,!!t()))}function A(t,n,s={}){const{window:a=w,...o}=s;let r;const i=M(()=>a&&"ResizeObserver"in a),c=()=>{r&&(r.disconnect(),r=void 0)},h=e.computed(()=>{const l=e.toValue(t);return Array.isArray(l)?l.map(m=>f(m)):[f(l)]}),g=e.watch(h,l=>{if(c(),i.value&&a){r=new ResizeObserver(n);for(const m of l)m&&r.observe(m,o)}},{immediate:!0,flush:"post"}),b=()=>{c(),g()};return V(b),{isSupported:i,stop:b}}function W(t,n={width:0,height:0},s={}){const{window:a=w,box:o="content-box"}=s,r=e.computed(()=>{var l,m;return(m=(l=f(t))==null?void 0:l.namespaceURI)==null?void 0:m.includes("svg")}),i=e.shallowRef(n.width),c=e.shallowRef(n.height),{stop:h}=A(t,([l])=>{const m=o==="border-box"?l.borderBoxSize:o==="content-box"?l.contentBoxSize:l.devicePixelContentBoxSize;if(a&&r.value){const C=f(t);if(C){const u=C.getBoundingClientRect();i.value=u.width,c.value=u.height}}else if(m){const C=R(m);i.value=C.reduce((u,{inlineSize:B})=>u+B,0),c.value=C.reduce((u,{blockSize:B})=>u+B,0)}else i.value=l.contentRect.width,c.value=l.contentRect.height},s);N(()=>{const l=f(t);l&&(i.value="offsetWidth"in l?l.offsetWidth:n.width,c.value="offsetHeight"in l?l.offsetHeight:n.height)});const g=e.watch(()=>f(t),l=>{i.value=l?n.width:0,c.value=l?n.height:0});function b(){h(),g()}return{width:i,height:c,stop:b}}const $={class:"relative"},G=["aria-label"],T={class:"w-full"},D={class:"mt-sm"},I=((t,n)=>{const s=t.__vccOpts||t;for(const[a,o]of n)s[a]=o;return s})(e.defineComponent({__name:"MclContainerB",props:{sectionBgColor:{default:"transparent"},containerBgColor:{default:"light-2"},imageSource:{},imageAlt:{},title:{},titleLevel:{default:"h2"},titleSize:{default:"md"},titleColor:{default:"dark-3"}},setup(t){const n=t;e.useSlots();const s=e.ref(),{height:a}=W(s),o=e.computed(()=>{const{titleLevel:i,titleSize:c,titleColor:h}=n,g={h1:d("H1",c),h2:d("H2",c),h3:d("H3",c),h4:d("H4",c)};return[d("TEXTCOLOR",h),g[i]].join(" ")}),r=e.computed(()=>({"--bg-image":`url('${n.imageSource}')`,"--space-height":`${a.value/2}px`}));return(i,c)=>(e.openBlock(),e.createElementBlock("section",{class:"relative",style:e.normalizeStyle(r.value)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(d)("BGCOLOR",i.sectionBgColor),"space-hts"])},null,2),e.createElementVNode("div",$,[e.createElementVNode("div",{class:"absolute bg-fixed bg-cover bg-top inset-0 bg-no-repeat bg-image",role:"img","aria-label":i.imageAlt},null,8,G),e.createElementVNode("div",{class:"container relative z-[10] -translate-y-1/2 px-xs max-w-[1140px]",ref_key:"mainContentElem",ref:s},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(d)("BGCOLOR",i.containerBgColor),"py-md md:py-lg px-xs md:px-md lg:p-xl"])},[e.createElementVNode("div",T,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.titleLevel),null,{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(o.value)},e.toDisplayString(i.title),3)]),_:1})),e.createElementVNode("div",D,[e.renderSlot(i.$slots,"content",{},void 0,!0)])])],2)],512)])],4))}}),[["__scopeId","data-v-fb05edc4"]]);p.MclContainerA=x,p.MclContainerB=I,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobbykim/mcl-container",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "basic container components based on manguito-theme",
5
5
  "type": "module",
6
6
  "files": [
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "@bobbykim/manguito-theme": "0.24.0",
36
+ "@bobbykim/manguito-theme": "0.25.0",
37
37
  "@vueuse/core": "^12.0.0",
38
38
  "vue": "^3.5.13"
39
39
  },
@@ -46,5 +46,5 @@
46
46
  "vite-plugin-dts": "^4.3.0",
47
47
  "vue-tsc": "^2.1.10"
48
48
  },
49
- "gitHead": "92ed1f261177034bd95ac0e3d60ba672e3473555"
49
+ "gitHead": "ff7499791d1ced7ae862e474ce4b8b421f947a27"
50
50
  }