@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.
- package/dist/mcl-container.js +105 -105
- package/dist/mcl-container.umd.cjs +2 -2
- package/package.json +7 -8
package/dist/mcl-container.js
CHANGED
|
@@ -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-
|
|
2
|
-
import { defineComponent as
|
|
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" },
|
|
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",
|
|
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
|
-
},
|
|
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(),
|
|
46
|
-
class: d(["py-lg lg:py-xl", v(u)(
|
|
45
|
+
return (l, s) => (g(), w("section", {
|
|
46
|
+
class: d(["py-lg lg:py-xl", v(u).bgColorVariant({ color: e.sectionBg })])
|
|
47
47
|
}, [
|
|
48
|
-
|
|
49
|
-
(g(),
|
|
50
|
-
class: d(["absolute inset-x-0 left-0 block h-full w-full", v(u)(
|
|
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
|
-
|
|
55
|
+
r("polygon", {
|
|
56
56
|
points: t("top", e.topDirection)
|
|
57
57
|
}, null, 8, P)
|
|
58
58
|
], 2))
|
|
59
59
|
]),
|
|
60
|
-
|
|
61
|
-
class: d(["py-md md:py-lg lg:py-xl px-sm md:px-md lg:px-lg", v(u)(
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
class: d(
|
|
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(),
|
|
69
|
+
e.twoColumns && e.leftColumnWidth !== 100 ? (g(), w("div", {
|
|
70
70
|
key: 0,
|
|
71
|
-
class: d(
|
|
71
|
+
class: d(c(e.twoColumns, e.leftColumnWidth))
|
|
72
72
|
}, [
|
|
73
73
|
B(l.$slots, "right-column")
|
|
74
|
-
], 2)) :
|
|
74
|
+
], 2)) : D("", !0)
|
|
75
75
|
])
|
|
76
76
|
], 2),
|
|
77
|
-
|
|
78
|
-
(g(),
|
|
79
|
-
class: d(["absolute inset-x-0 left-0 block h-full w-full", v(u)(
|
|
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
|
-
|
|
84
|
+
r("polygon", {
|
|
85
85
|
points: t("bottom", e.bottomDirection)
|
|
86
|
-
}, null, 8,
|
|
86
|
+
}, null, 8, q)
|
|
87
87
|
], 2))
|
|
88
88
|
])
|
|
89
89
|
], 2));
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function J(e, t) {
|
|
93
|
+
return E() ? (_(e, t), !0) : !1;
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const K = typeof window < "u" && typeof document < "u";
|
|
96
96
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
97
|
-
function
|
|
97
|
+
function Q(e) {
|
|
98
98
|
return Array.isArray(e) ? e : [e];
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function X(e) {
|
|
101
|
+
return k();
|
|
102
102
|
}
|
|
103
|
-
function Y(e, t = !0,
|
|
104
|
-
|
|
103
|
+
function Y(e, t = !0, n) {
|
|
104
|
+
X() ? A(e, n) : t ? e() : O(e);
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const M = K ? window : void 0;
|
|
107
107
|
function p(e) {
|
|
108
108
|
var t;
|
|
109
|
-
const
|
|
110
|
-
return (t =
|
|
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 =
|
|
115
|
-
return t &&
|
|
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,
|
|
125
|
-
const { window:
|
|
124
|
+
function te(e, t, n = {}) {
|
|
125
|
+
const { window: c = M, ...l } = n;
|
|
126
126
|
let s;
|
|
127
|
-
const
|
|
127
|
+
const a = /* @__PURE__ */ ee(() => c && "ResizeObserver" in c), i = () => {
|
|
128
128
|
s && (s.disconnect(), s = void 0);
|
|
129
|
-
}, C =
|
|
130
|
-
const f =
|
|
131
|
-
return Array.isArray(f) ? f.map((
|
|
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(),
|
|
133
|
+
if (i(), a.value && c) {
|
|
134
134
|
s = new ResizeObserver(t);
|
|
135
|
-
for (const
|
|
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
|
|
144
|
-
isSupported:
|
|
143
|
+
return J(m), {
|
|
144
|
+
isSupported: a,
|
|
145
145
|
stop: m
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function oe(e, t = {
|
|
149
149
|
width: 0,
|
|
150
150
|
height: 0
|
|
151
|
-
},
|
|
152
|
-
const { window:
|
|
153
|
-
var
|
|
154
|
-
return (
|
|
155
|
-
}),
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const h =
|
|
161
|
-
|
|
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 (
|
|
164
|
-
const
|
|
165
|
-
|
|
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
|
-
|
|
168
|
-
},
|
|
167
|
+
a.value = o.contentRect.width, i.value = o.contentRect.height;
|
|
168
|
+
}, n);
|
|
169
169
|
Y(() => {
|
|
170
|
-
const
|
|
171
|
-
|
|
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 =
|
|
174
|
-
|
|
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:
|
|
180
|
+
width: a,
|
|
181
181
|
height: i,
|
|
182
182
|
stop: f
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
const
|
|
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
|
|
201
|
-
const { titleLevel:
|
|
202
|
-
h1: u(
|
|
203
|
-
h2: u(
|
|
204
|
-
h3: u(
|
|
205
|
-
h4: u(
|
|
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(
|
|
209
|
-
m[
|
|
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": `${
|
|
213
|
+
"--space-height": `${c.value / 2}px`
|
|
214
214
|
}));
|
|
215
|
-
return (
|
|
215
|
+
return (a, i) => (g(), w("section", {
|
|
216
216
|
class: "relative",
|
|
217
|
-
style:
|
|
217
|
+
style: L(s.value)
|
|
218
218
|
}, [
|
|
219
|
-
|
|
220
|
-
class: d([v(u)(
|
|
219
|
+
r("div", {
|
|
220
|
+
class: d([v(u).bgColorVariant({ color: e.sectionBgColor }), "space-hts"])
|
|
221
221
|
}, null, 2),
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
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:
|
|
231
|
+
ref: n
|
|
232
232
|
}, [
|
|
233
|
-
|
|
234
|
-
class: d([v(u)(
|
|
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
|
-
|
|
237
|
-
(g(),
|
|
238
|
-
default:
|
|
239
|
-
|
|
236
|
+
r("div", se, [
|
|
237
|
+
(g(), G(T(e.titleLevel), null, {
|
|
238
|
+
default: F(() => [
|
|
239
|
+
r("span", {
|
|
240
240
|
class: d(l.value)
|
|
241
|
-
},
|
|
241
|
+
}, H(e.title), 3)
|
|
242
242
|
]),
|
|
243
243
|
_: 1
|
|
244
244
|
})),
|
|
245
|
-
|
|
246
|
-
B(
|
|
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
|
-
}),
|
|
255
|
-
const
|
|
256
|
-
for (const [
|
|
257
|
-
|
|
258
|
-
return
|
|
259
|
-
}, fe = /* @__PURE__ */ re
|
|
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-
|
|
2
|
-
(function(
|
|
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.
|
|
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
|
-
"
|
|
50
|
-
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "vite build"
|
|
48
|
+
}
|
|
49
|
+
}
|