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