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