@bobbykim/mcl-container 0.8.8 → 0.9.0

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