@bobbykim/mcl-cards 0.8.5 → 0.9.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 +13 -0
- package/dist/mcl-cards.js +183 -162
- package/dist/mcl-cards.umd.cjs +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BodyText } from '@bobbykim/manguito-theme';
|
|
1
2
|
import { ColorPalette } from '@bobbykim/manguito-theme';
|
|
2
3
|
import { ComponentOptionsMixin } from 'vue';
|
|
3
4
|
import { ComponentProvideOptions } from 'vue';
|
|
@@ -14,6 +15,10 @@ titleSize?: HeadingSize;
|
|
|
14
15
|
titleColor?: ColorPalette;
|
|
15
16
|
borderColor?: ColorPalette;
|
|
16
17
|
bgColor?: ColorPalette;
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
glass?: boolean;
|
|
20
|
+
glassBlur?: BodyText;
|
|
21
|
+
glassOpacity?: OpacityRange;
|
|
17
22
|
displayImage?: boolean;
|
|
18
23
|
imageSource?: string;
|
|
19
24
|
imageAlt?: string;
|
|
@@ -41,6 +46,10 @@ titleSize?: HeadingSize;
|
|
|
41
46
|
titleColor?: ColorPalette;
|
|
42
47
|
borderColor?: ColorPalette;
|
|
43
48
|
bgColor?: ColorPalette;
|
|
49
|
+
fullWidth?: boolean;
|
|
50
|
+
glass?: boolean;
|
|
51
|
+
glassBlur?: BodyText;
|
|
52
|
+
glassOpacity?: OpacityRange;
|
|
44
53
|
displayImage?: boolean;
|
|
45
54
|
imageSource?: string;
|
|
46
55
|
imageAlt?: string;
|
|
@@ -67,6 +76,10 @@ titleSize: HeadingSize;
|
|
|
67
76
|
titleColor: ColorPalette;
|
|
68
77
|
borderColor: ColorPalette;
|
|
69
78
|
bgColor: ColorPalette;
|
|
79
|
+
fullWidth: boolean;
|
|
80
|
+
glass: boolean;
|
|
81
|
+
glassBlur: BodyText;
|
|
82
|
+
glassOpacity: OpacityRange;
|
|
70
83
|
displayImage: boolean;
|
|
71
84
|
displayCta: boolean;
|
|
72
85
|
ctaAsLink: boolean;
|
package/dist/mcl-cards.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import r from "@bobbykim/manguito-theme";
|
|
4
|
-
const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.perspective[data-v-0d2f293c]{-webkit-perspective:1800px;perspective:1800px}.card[data-v-0d2f293c]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateY(0deg);transform:rotateY(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.flip-card[data-v-0d2f293c]{-webkit-transform:rotateY(360deg);transform:rotateY(360deg)}.card[data-v-390b5ad7]{background-size:cover;background-position:center center;background-repeat:no-repeat;padding:var(--border-width);background:conic-gradient(from var(--border-angle, 0deg),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-via),var(--tw-gradient-to));animation:bg-spin-390b5ad7 4s linear infinite}@keyframes bg-spin-390b5ad7{0%{--border-angle: 0deg}to{--border-angle: 360deg}}.card[data-v-390b5ad7]:hover{animation-play-state:paused}@property --border-angle{syntax: "<angle>"; inherits: false; initial-value: 0deg;}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
import { defineComponent as L, useSlots as T, computed as p, createElementBlock as g, openBlock as h, normalizeClass as n, createCommentVNode as b, createElementVNode as s, unref as _, withModifiers as S, renderSlot as O, toDisplayString as w, ref as H, normalizeStyle as M } from "vue";
|
|
3
|
+
import r, { getGlassmorphismClass as E } from "@bobbykim/manguito-theme";
|
|
4
|
+
const $ = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "relative"
|
|
7
|
-
},
|
|
7
|
+
}, z = ["src", "alt"], G = ["innerHTML"], D = { class: "flex h-full flex-col justify-between" }, I = { class: "px-xs pt-sm flex-1" }, X = ["innerHTML"], N = ["innerHTML"], W = { class: "px-xs w-full" }, V = ["href", "target"], at = /* @__PURE__ */ L({
|
|
8
8
|
__name: "MclCardA",
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
@@ -12,6 +12,10 @@ const M = {
|
|
|
12
12
|
titleColor: { default: "dark-3" },
|
|
13
13
|
borderColor: { default: "light-3" },
|
|
14
14
|
bgColor: { default: "light-1" },
|
|
15
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
16
|
+
glass: { type: Boolean, default: !1 },
|
|
17
|
+
glassBlur: { default: "sm" },
|
|
18
|
+
glassOpacity: { default: 20 },
|
|
15
19
|
displayImage: { type: Boolean, default: !0 },
|
|
16
20
|
imageSource: {},
|
|
17
21
|
imageAlt: {},
|
|
@@ -34,109 +38,121 @@ const M = {
|
|
|
34
38
|
emits: ["card-click", "card-btn-click"],
|
|
35
39
|
setup(y, { emit: C }) {
|
|
36
40
|
const i = y;
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const {
|
|
41
|
+
T();
|
|
42
|
+
const c = C, k = p(() => {
|
|
43
|
+
const {
|
|
44
|
+
borderColor: t,
|
|
45
|
+
bgColor: a,
|
|
46
|
+
rounded: e,
|
|
47
|
+
enlargeOnHover: o,
|
|
48
|
+
displayShadow: m,
|
|
49
|
+
glass: f,
|
|
50
|
+
glassBlur: x,
|
|
51
|
+
glassOpacity: A,
|
|
52
|
+
fullWidth: R
|
|
53
|
+
} = i;
|
|
54
|
+
return [
|
|
40
55
|
r("BORDER", t),
|
|
41
|
-
r("BGCOLOR",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
r("BGCOLOR", a),
|
|
57
|
+
!R && "max-w-[450px] sm:max-w-[350px]",
|
|
58
|
+
e ? "rounded-lg" : "rounded-sm",
|
|
59
|
+
o && "hover:scale-105 transition ease-in duration-300",
|
|
60
|
+
m && "drop-shadow-md",
|
|
61
|
+
f && E(a, x, A)
|
|
62
|
+
].filter(Boolean).join(" ");
|
|
63
|
+
}), u = p(() => {
|
|
64
|
+
const { titleSize: t, titleColor: a, displayHighlight: e } = i;
|
|
65
|
+
return [
|
|
46
66
|
r("H3", t),
|
|
47
|
-
r("TEXTCOLOR",
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
r("TEXTCOLOR", a),
|
|
68
|
+
e ? "mb-2xs" : "mb-xs"
|
|
69
|
+
].filter(Boolean).join(" ");
|
|
50
70
|
}), v = p(() => {
|
|
51
|
-
const { labelTextColor: t, labelColor:
|
|
71
|
+
const { labelTextColor: t, labelColor: a } = i;
|
|
52
72
|
return [
|
|
53
73
|
r("TEXTCOLOR", t),
|
|
54
|
-
r("BGCOLOR",
|
|
55
|
-
].join(" ");
|
|
56
|
-
}),
|
|
57
|
-
const { ctaColor: t, rounded:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
r("BGCOLOR", a)
|
|
75
|
+
].filter(Boolean).join(" ");
|
|
76
|
+
}), B = p(() => {
|
|
77
|
+
const { ctaColor: t, rounded: a } = i, e = ["light-1", "light-2", "light-3", "light-4"];
|
|
78
|
+
return [
|
|
79
|
+
r("BTNCOLOR", t),
|
|
80
|
+
e.includes(t) ? "text-black" : "text-white",
|
|
81
|
+
a && "btn-round"
|
|
82
|
+
].filter(Boolean).join(" ");
|
|
83
|
+
}), l = (t) => {
|
|
84
|
+
const { title: a, ctaLink: e, ctaTarget: o, ctaAsLink: m } = i, f = {
|
|
85
|
+
title: a,
|
|
63
86
|
url: e,
|
|
64
|
-
target:
|
|
87
|
+
target: o || "_self"
|
|
65
88
|
};
|
|
66
|
-
!
|
|
67
|
-
},
|
|
68
|
-
const { title:
|
|
69
|
-
|
|
70
|
-
title:
|
|
89
|
+
!m && t.preventDefault(), c("card-btn-click", t, f);
|
|
90
|
+
}, d = (t) => {
|
|
91
|
+
const { title: a, ctaLink: e, ctaTarget: o } = i;
|
|
92
|
+
c("card-click", t, {
|
|
93
|
+
title: a,
|
|
71
94
|
url: e,
|
|
72
|
-
target:
|
|
95
|
+
target: o || "_self"
|
|
73
96
|
});
|
|
74
97
|
};
|
|
75
|
-
return (t,
|
|
76
|
-
class: n(["
|
|
77
|
-
onClick:
|
|
98
|
+
return (t, a) => (h(), g("div", {
|
|
99
|
+
class: n(["xs:w-auto flex w-full flex-shrink-0 flex-grow cursor-pointer flex-col overflow-hidden border", k.value]),
|
|
100
|
+
onClick: d
|
|
78
101
|
}, [
|
|
79
|
-
t.displayImage ? (
|
|
102
|
+
t.displayImage ? (h(), g("div", $, [
|
|
80
103
|
s("img", {
|
|
81
104
|
src: t.imageSource,
|
|
82
105
|
alt: t.imageAlt,
|
|
83
|
-
class: "object-cover object-top
|
|
84
|
-
}, null, 8,
|
|
85
|
-
t.displayLabel ? (
|
|
106
|
+
class: "aspect-video min-w-full object-cover object-top"
|
|
107
|
+
}, null, 8, z),
|
|
108
|
+
t.displayLabel ? (h(), g("span", {
|
|
86
109
|
key: 0,
|
|
87
|
-
class: n(["py-3xs px-2xs ml-xs
|
|
110
|
+
class: n(["py-3xs px-2xs ml-xs absolute bottom-0 inline-block translate-y-[50%] text-xs font-bold", v.value]),
|
|
88
111
|
innerHTML: t.labelText
|
|
89
|
-
}, null, 10,
|
|
112
|
+
}, null, 10, G)) : b("", !0)
|
|
90
113
|
])) : b("", !0),
|
|
91
|
-
s("div",
|
|
92
|
-
s("div",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
T(t.$slots, "default", {}, void 0, !0)
|
|
113
|
-
])
|
|
114
|
+
s("div", D, [
|
|
115
|
+
s("div", I, [
|
|
116
|
+
!t.displayImage && t.displayLabel ? (h(), g("span", {
|
|
117
|
+
key: 0,
|
|
118
|
+
class: n(["py-3xs px-2xs mb-2xs inline-block text-xs font-bold", v.value]),
|
|
119
|
+
innerHTML: t.labelText
|
|
120
|
+
}, null, 10, X)) : b("", !0),
|
|
121
|
+
s("h3", {
|
|
122
|
+
class: n(u.value),
|
|
123
|
+
innerHTML: t.title
|
|
124
|
+
}, null, 10, N),
|
|
125
|
+
t.displayHighlight ? (h(), g("div", {
|
|
126
|
+
key: 1,
|
|
127
|
+
class: n(["mb-xs h-3xs w-md", _(r)("BGCOLOR", t.highlightColor)])
|
|
128
|
+
}, null, 2)) : b("", !0),
|
|
129
|
+
s("div", {
|
|
130
|
+
class: "mb-sm cursor-default",
|
|
131
|
+
onClick: a[0] || (a[0] = S(() => {
|
|
132
|
+
}, ["stop"]))
|
|
133
|
+
}, [
|
|
134
|
+
O(t.$slots, "default")
|
|
114
135
|
])
|
|
115
136
|
]),
|
|
116
|
-
t.displayCta ? (
|
|
137
|
+
t.displayCta ? (h(), g("div", {
|
|
117
138
|
key: 0,
|
|
118
|
-
class: "pb-sm border-0
|
|
119
|
-
onClick:
|
|
139
|
+
class: "pb-sm cursor-default border-0",
|
|
140
|
+
onClick: a[2] || (a[2] = S(() => {
|
|
120
141
|
}, ["stop"]))
|
|
121
142
|
}, [
|
|
122
|
-
s("div",
|
|
143
|
+
s("div", W, [
|
|
123
144
|
s("a", {
|
|
124
145
|
href: t.ctaLink,
|
|
125
146
|
target: t.ctaTarget,
|
|
126
|
-
class: n(["btn btn-full",
|
|
127
|
-
onClick:
|
|
147
|
+
class: n(["btn btn-full", B.value]),
|
|
148
|
+
onClick: a[1] || (a[1] = (e) => l(e))
|
|
128
149
|
}, w(t.ctaText), 11, V)
|
|
129
150
|
])
|
|
130
151
|
])) : b("", !0)
|
|
131
152
|
])
|
|
132
153
|
], 2));
|
|
133
154
|
}
|
|
134
|
-
}),
|
|
135
|
-
const i = y.__vccOpts || y;
|
|
136
|
-
for (const [u, k] of C)
|
|
137
|
-
i[u] = k;
|
|
138
|
-
return i;
|
|
139
|
-
}, lt = /* @__PURE__ */ _(q, [["__scopeId", "data-v-9021bcb6"]]), W = ["href", "target"], F = { class: "absolute z-[15] flex flex-col justify-end items-start inset-0 p-xs [@media(hover:hover)]:opacity-0 hover:opacity-100 peer transition-opacity duration-200" }, P = ["innerHTML"], Y = ["src", "alt"], ot = /* @__PURE__ */ B({
|
|
155
|
+
}), q = ["href", "target"], F = { class: "absolute z-[15] flex flex-col justify-end items-start inset-0 p-xs [@media(hover:hover)]:opacity-0 hover:opacity-100 peer transition-opacity duration-200" }, P = ["innerHTML"], Y = ["src", "alt"], ot = /* @__PURE__ */ L({
|
|
140
156
|
__name: "MclCardB",
|
|
141
157
|
props: {
|
|
142
158
|
title: {},
|
|
@@ -155,54 +171,54 @@ const M = {
|
|
|
155
171
|
emits: ["card-click"],
|
|
156
172
|
setup(y, { emit: C }) {
|
|
157
173
|
const i = y;
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
const { borderColor:
|
|
161
|
-
return t.push(
|
|
162
|
-
}),
|
|
163
|
-
const { displayGrayScale:
|
|
164
|
-
return
|
|
174
|
+
T();
|
|
175
|
+
const c = C, k = p(() => {
|
|
176
|
+
const { borderColor: l, rounded: d } = i, t = [r("BORDER", l)];
|
|
177
|
+
return t.push(d ? "rounded-md" : "rounded-sm"), t.join(" ");
|
|
178
|
+
}), u = p(() => {
|
|
179
|
+
const { displayGrayScale: l } = i;
|
|
180
|
+
return l ? "[@media(hover:hover)]:grayscale peer-hover:grayscale-0" : "";
|
|
165
181
|
}), v = p(() => {
|
|
166
|
-
const { titleSize:
|
|
182
|
+
const { titleSize: l, titleColor: d, titleBlockColor: t } = i;
|
|
167
183
|
return [
|
|
168
|
-
r("H3",
|
|
169
|
-
r("TEXTCOLOR",
|
|
184
|
+
r("H3", l),
|
|
185
|
+
r("TEXTCOLOR", d),
|
|
170
186
|
r("BGCOLOR", t)
|
|
171
187
|
].join(" ");
|
|
172
|
-
}),
|
|
173
|
-
const { title:
|
|
174
|
-
!e &&
|
|
175
|
-
const
|
|
176
|
-
title:
|
|
188
|
+
}), B = (l) => {
|
|
189
|
+
const { title: d, ctaLink: t, ctaTarget: a, ctaAsLink: e } = i;
|
|
190
|
+
!e && l.preventDefault();
|
|
191
|
+
const o = {
|
|
192
|
+
title: d,
|
|
177
193
|
url: t,
|
|
178
|
-
target:
|
|
194
|
+
target: a || "_self"
|
|
179
195
|
};
|
|
180
|
-
console.log(
|
|
196
|
+
console.log(o), c("card-click", l, o);
|
|
181
197
|
};
|
|
182
|
-
return (
|
|
198
|
+
return (l, d) => (h(), g("div", {
|
|
183
199
|
class: n(["relative max-w-[450px] sm:max-w-[350px] w-full xs:w-auto flex-grow flex-shrink-0 cursor-pointer overflow-hidden border", k.value])
|
|
184
200
|
}, [
|
|
185
201
|
s("a", {
|
|
186
|
-
href:
|
|
187
|
-
target:
|
|
188
|
-
onClick:
|
|
202
|
+
href: l.ctaLink,
|
|
203
|
+
target: l.ctaTarget,
|
|
204
|
+
onClick: d[0] || (d[0] = (t) => B(t))
|
|
189
205
|
}, [
|
|
190
206
|
s("div", F, [
|
|
191
207
|
s("h3", {
|
|
192
|
-
innerHTML:
|
|
208
|
+
innerHTML: l.title,
|
|
193
209
|
class: n(["inline-block px-xs py-2xs mb-2xs pointer-events-none tracking-wide", v.value])
|
|
194
210
|
}, null, 10, P),
|
|
195
|
-
|
|
211
|
+
O(l.$slots, "default")
|
|
196
212
|
]),
|
|
197
213
|
s("img", {
|
|
198
|
-
src:
|
|
199
|
-
alt:
|
|
200
|
-
class: n(["relative h-full w-full z-10 object-cover object-center aspect-[3/4] transition-all duration-200",
|
|
214
|
+
src: l.imageSource,
|
|
215
|
+
alt: l.imageAlt,
|
|
216
|
+
class: n(["relative h-full w-full z-10 object-cover object-center aspect-[3/4] transition-all duration-200", u.value])
|
|
201
217
|
}, null, 10, Y)
|
|
202
|
-
], 8,
|
|
218
|
+
], 8, q)
|
|
203
219
|
], 2));
|
|
204
220
|
}
|
|
205
|
-
}), J = ["src", "alt"], K = /* @__PURE__ */
|
|
221
|
+
}), J = ["src", "alt"], K = /* @__PURE__ */ L({
|
|
206
222
|
__name: "MclCardC",
|
|
207
223
|
props: {
|
|
208
224
|
imageSource: {},
|
|
@@ -219,54 +235,59 @@ const M = {
|
|
|
219
235
|
emits: ["card-click"],
|
|
220
236
|
setup(y, { emit: C }) {
|
|
221
237
|
const i = y;
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
return
|
|
238
|
+
T();
|
|
239
|
+
const c = H(!1), k = C, u = p(() => {
|
|
240
|
+
const l = [r("BGCOLOR", i.cardColor)];
|
|
241
|
+
return c.value && l.push("flip-card"), l.join(" ");
|
|
226
242
|
}), v = p(() => {
|
|
227
243
|
const {
|
|
228
|
-
titleSize:
|
|
229
|
-
titleColor:
|
|
244
|
+
titleSize: l,
|
|
245
|
+
titleColor: d,
|
|
230
246
|
displayHighlight: t,
|
|
231
|
-
highlightColor:
|
|
247
|
+
highlightColor: a,
|
|
232
248
|
highlightOpacity: e
|
|
233
|
-
} = i,
|
|
234
|
-
r("H3",
|
|
235
|
-
r("TEXTCOLOR",
|
|
249
|
+
} = i, o = [
|
|
250
|
+
r("H3", l),
|
|
251
|
+
r("TEXTCOLOR", d)
|
|
236
252
|
];
|
|
237
|
-
return t && (
|
|
238
|
-
}),
|
|
239
|
-
|
|
253
|
+
return t && (o.push("px-xs py-2xs mb-2xs rounded"), o.push(r("BGCOLOR", a)), o.push(r("BGOPACITY", e))), o.join(" ");
|
|
254
|
+
}), B = (l) => {
|
|
255
|
+
l.preventDefault(), c.value && k("card-click", l), c.value = !0;
|
|
240
256
|
};
|
|
241
|
-
return (
|
|
242
|
-
class: n(["relative aspect-square card transition duration-[1600ms] max-h-[400px] overflow-hidden",
|
|
243
|
-
onClick:
|
|
257
|
+
return (l, d) => (h(), g("div", {
|
|
258
|
+
class: n(["relative aspect-square card transition duration-[1600ms] max-h-[400px] overflow-hidden", u.value]),
|
|
259
|
+
onClick: B
|
|
244
260
|
}, [
|
|
245
261
|
s("img", {
|
|
246
|
-
src:
|
|
247
|
-
alt:
|
|
262
|
+
src: l.imageSource,
|
|
263
|
+
alt: l.imageAlt,
|
|
248
264
|
class: n([
|
|
249
|
-
|
|
265
|
+
c.value ? "opacity-100" : "opacity-0",
|
|
250
266
|
"absolute w-full h-full object-cover object-center aspect-square transition-opacity delay-500 duration-[800ms]"
|
|
251
267
|
])
|
|
252
268
|
}, null, 10, J),
|
|
253
269
|
s("div", {
|
|
254
270
|
class: n([
|
|
255
|
-
|
|
271
|
+
c.value ? "cursor-pointer opacity-100" : "opacity-0",
|
|
256
272
|
"relative flex flex-col justify-end p-sm h-full transition delay-500 duration-[800ms]"
|
|
257
273
|
])
|
|
258
274
|
}, [
|
|
259
|
-
|
|
275
|
+
l.displayTitle ? (h(), g("h3", {
|
|
260
276
|
key: 0,
|
|
261
277
|
class: n(["relative self-start", v.value])
|
|
262
278
|
}, [
|
|
263
|
-
s("span", null, w(
|
|
279
|
+
s("span", null, w(l.title), 1)
|
|
264
280
|
], 2)) : b("", !0),
|
|
265
|
-
|
|
281
|
+
O(l.$slots, "card-body", {}, void 0, !0)
|
|
266
282
|
], 2)
|
|
267
283
|
], 2));
|
|
268
284
|
}
|
|
269
|
-
}),
|
|
285
|
+
}), j = (y, C) => {
|
|
286
|
+
const i = y.__vccOpts || y;
|
|
287
|
+
for (const [c, k] of C)
|
|
288
|
+
i[c] = k;
|
|
289
|
+
return i;
|
|
290
|
+
}, rt = /* @__PURE__ */ j(K, [["__scopeId", "data-v-0d2f293c"]]), Q = { class: "flex flex-col overflow-hidden rounded-md" }, U = ["src", "alt"], Z = ["href", "target"], tt = /* @__PURE__ */ L({
|
|
270
291
|
__name: "MclCardD",
|
|
271
292
|
props: {
|
|
272
293
|
displayImage: { type: Boolean, default: !0 },
|
|
@@ -311,7 +332,7 @@ const M = {
|
|
|
311
332
|
black: "from-black",
|
|
312
333
|
white: "from-white",
|
|
313
334
|
transparent: "from-transparent"
|
|
314
|
-
},
|
|
335
|
+
}, c = {
|
|
315
336
|
primary: "via-primary",
|
|
316
337
|
secondary: "via-secondary",
|
|
317
338
|
success: "via-success",
|
|
@@ -347,58 +368,58 @@ const M = {
|
|
|
347
368
|
black: "to-black",
|
|
348
369
|
white: "to-white",
|
|
349
370
|
transparent: "to-transparent"
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
const v = C,
|
|
353
|
-
const { titleSize: e, titleColor:
|
|
371
|
+
}, u = y;
|
|
372
|
+
T();
|
|
373
|
+
const v = C, B = p(() => {
|
|
374
|
+
const { titleSize: e, titleColor: o } = u;
|
|
354
375
|
return [
|
|
355
376
|
r("H2", e),
|
|
356
|
-
r("TEXTCOLOR",
|
|
377
|
+
r("TEXTCOLOR", o)
|
|
357
378
|
].join(" ");
|
|
358
|
-
}),
|
|
359
|
-
const { ctaButton: e, ctaButtonColor:
|
|
360
|
-
return e ?
|
|
361
|
-
}),
|
|
362
|
-
"--border-width": `${
|
|
379
|
+
}), l = p(() => {
|
|
380
|
+
const { ctaButton: e, ctaButtonColor: o, ctaButtonBlock: m } = u, f = [], x = ["light-1", "light-2", "light-3", "light-4"];
|
|
381
|
+
return e ? f.push("btn", r("BTNCOLOR", o)) : f.push("mcl-link"), e && m && f.push("btn-full"), e && !x.includes(o) && f.push("text-white"), f.join(" ");
|
|
382
|
+
}), d = p(() => ({
|
|
383
|
+
"--border-width": `${u.borderWidth}px`
|
|
363
384
|
})), t = p(() => {
|
|
364
|
-
const e = i[
|
|
385
|
+
const e = i[u.borderColor], o = c[u.gradient1], m = k[u.gradient2];
|
|
365
386
|
return [
|
|
366
|
-
r("BORDER",
|
|
387
|
+
r("BORDER", u.borderColor),
|
|
367
388
|
e,
|
|
368
|
-
|
|
369
|
-
|
|
389
|
+
o,
|
|
390
|
+
m
|
|
370
391
|
].join(" ");
|
|
371
|
-
}),
|
|
372
|
-
const { title:
|
|
373
|
-
title:
|
|
374
|
-
url:
|
|
375
|
-
target:
|
|
392
|
+
}), a = (e) => {
|
|
393
|
+
const { title: o, ctaLink: m, ctaLinkTarget: f, ctaAsLink: x } = u, A = {
|
|
394
|
+
title: o,
|
|
395
|
+
url: m,
|
|
396
|
+
target: f || "_self"
|
|
376
397
|
};
|
|
377
|
-
!
|
|
398
|
+
!x && e.preventDefault(), v("card-click", e, A);
|
|
378
399
|
};
|
|
379
|
-
return (e,
|
|
400
|
+
return (e, o) => (h(), g("div", {
|
|
380
401
|
class: n(["card xs:w-auto w-full max-w-[450px] flex-shrink-0 flex-grow overflow-hidden rounded-md border from-20% sm:max-w-[350px]", t.value]),
|
|
381
|
-
style:
|
|
402
|
+
style: M(d.value)
|
|
382
403
|
}, [
|
|
383
404
|
s("div", Q, [
|
|
384
|
-
e.displayImage ? (
|
|
405
|
+
e.displayImage ? (h(), g("img", {
|
|
385
406
|
key: 0,
|
|
386
407
|
src: e.imageSource,
|
|
387
408
|
class: "max-h-[200px] min-w-full object-cover object-top",
|
|
388
409
|
alt: e.imageAlt
|
|
389
410
|
}, null, 8, U)) : b("", !0),
|
|
390
411
|
s("div", {
|
|
391
|
-
class: n(["p-xs",
|
|
412
|
+
class: n(["p-xs", _(r)("BGCOLOR", e.bgColor)])
|
|
392
413
|
}, [
|
|
393
414
|
s("h3", {
|
|
394
|
-
class: n(["mb-xs",
|
|
415
|
+
class: n(["mb-xs", B.value])
|
|
395
416
|
}, w(e.title), 3),
|
|
396
|
-
e.displayHighlight ? (
|
|
417
|
+
e.displayHighlight ? (h(), g("div", {
|
|
397
418
|
key: 0,
|
|
398
|
-
class: n(["mb-xs h-3xs w-md",
|
|
419
|
+
class: n(["mb-xs h-3xs w-md", _(r)("BGCOLOR", e.highlightColor)])
|
|
399
420
|
}, null, 2)) : b("", !0),
|
|
400
421
|
s("div", null, [
|
|
401
|
-
|
|
422
|
+
O(e.$slots, "default", {}, void 0, !0)
|
|
402
423
|
]),
|
|
403
424
|
s("div", {
|
|
404
425
|
class: n(["mt-xs", { "mb-2xs": !e.ctaButton }])
|
|
@@ -406,17 +427,17 @@ const M = {
|
|
|
406
427
|
s("a", {
|
|
407
428
|
href: e.ctaLink,
|
|
408
429
|
target: e.ctaLinkTarget,
|
|
409
|
-
class: n(
|
|
410
|
-
onClick:
|
|
430
|
+
class: n(l.value),
|
|
431
|
+
onClick: a
|
|
411
432
|
}, w(e.ctaText), 11, Z)
|
|
412
433
|
], 2)
|
|
413
434
|
], 2)
|
|
414
435
|
])
|
|
415
436
|
], 6));
|
|
416
437
|
}
|
|
417
|
-
}), st = /* @__PURE__ */
|
|
438
|
+
}), st = /* @__PURE__ */ j(tt, [["__scopeId", "data-v-390b5ad7"]]);
|
|
418
439
|
export {
|
|
419
|
-
|
|
440
|
+
at as MclCardA,
|
|
420
441
|
ot as MclCardB,
|
|
421
442
|
rt as MclCardC,
|
|
422
443
|
st as MclCardD
|
package/dist/mcl-cards.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.
|
|
2
|
-
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.MclCards={},f.Vue,f.ManguitoTheme))})(this,function(f,t,i){"use strict";const B={key:0,class:"relative"},w=["src","alt"],x=["innerHTML"],E={class:"content-height flex flex-col justify-between"},L={class:"min-h-[100px] p-0"},T={class:"px-xs pt-sm"},O=["innerHTML"],S=["innerHTML"],_={class:"w-full px-xs"},A=["href","target"],N=t.defineComponent({__name:"MclCardA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},borderColor:{default:"light-3"},bgColor:{default:"light-1"},displayImage:{type:Boolean,default:!0},imageSource:{},imageAlt:{},displayCta:{type:Boolean,default:!0},ctaAsLink:{type:Boolean,default:!1},ctaText:{default:"cta text"},ctaColor:{default:"primary"},ctaLink:{default:"#"},ctaTarget:{default:"_self"},displayLabel:{type:Boolean,default:!0},labelText:{default:"Lorem ipsum"},labelTextColor:{default:"light-1"},labelColor:{default:"dark-4"},enlargeOnHover:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},rounded:{type:Boolean,default:!0},displayShadow:{type:Boolean,default:!0}},emits:["card-click","card-btn-click"],setup(h,{emit:u}){const s=h;t.useSlots();const d=u,g=t.computed(()=>{const{borderColor:e,bgColor:r,rounded:l,enlargeOnHover:a,displayShadow:p}=s,n=[i("BORDER",e),i("BGCOLOR",r)];return n.push(l?"rounded-md":"rounded-sm"),a&&n.push("hover:scale-105 transition ease-in duration-300"),p&&n.push("drop-shadow-md"),n.join(" ")}),m=t.computed(()=>{const{titleSize:e,titleColor:r,displayHighlight:l}=s,a=[i("H3",e),i("TEXTCOLOR",r)];return a.push(l?"mb-2xs":"mb-xs"),a.join(" ")}),k=t.computed(()=>{const{labelTextColor:e,labelColor:r}=s;return[i("TEXTCOLOR",e),i("BGCOLOR",r)].join(" ")}),y=t.computed(()=>{const{ctaColor:e,rounded:r}=s,l=[i("BTNCOLOR",e)];let p=["light-1","light-2","light-3","light-4"].includes(e)?"text-black":"text-white";return l.push(p),r&&l.push("btn-round"),l.join(" ")}),o=e=>{const{title:r,ctaLink:l,ctaTarget:a,ctaAsLink:p}=s,n={title:r,url:l,target:a||"_self"};!p&&e.preventDefault(),d("card-btn-click",e,n)},c=e=>{const{title:r,ctaLink:l,ctaTarget:a}=s;d("card-click",e,{title:r,url:l,target:a||"_self"})};return(e,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["overflow-hidden border max-w-[450px] sm:max-w-[350px] w-full xs:w-auto flex-grow flex-shrink-0 cursor-pointer",g.value]),onClick:c},[e.displayImage?(t.openBlock(),t.createElementBlock("div",B,[t.createElementVNode("img",{src:e.imageSource,alt:e.imageAlt,class:"object-cover object-top h-[220px] min-w-full"},null,8,w),e.displayLabel?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["py-3xs px-2xs ml-xs inline-block font-bold text-xs absolute bottom-0 translate-y-[50%]",k.value]),innerHTML:e.labelText},null,10,x)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",E,[t.createElementVNode("div",L,[t.createElementVNode("div",T,[!e.displayImage&&e.displayLabel?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["py-3xs px-2xs mb-2xs inline-block font-bold text-xs",k.value]),innerHTML:e.labelText},null,10,O)):t.createCommentVNode("",!0),t.createElementVNode("h3",{class:t.normalizeClass(m.value),innerHTML:e.title},null,10,S),e.displayHighlight?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["mb-xs h-3xs w-md",t.unref(i)("BGCOLOR",e.highlightColor)])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"mb-sm cursor-default",onClick:r[0]||(r[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default",{},void 0,!0)])])]),e.displayCta?(t.openBlock(),t.createElementBlock("div",{key:0,class:"pb-sm border-0 cursor-default",onClick:r[2]||(r[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",_,[t.createElementVNode("a",{href:e.ctaLink,target:e.ctaTarget,class:t.normalizeClass(["btn btn-full",y.value]),onClick:r[1]||(r[1]=l=>o(l))},t.toDisplayString(e.ctaText),11,A)])])):t.createCommentVNode("",!0)])],2))}}),C=(h,u)=>{const s=h.__vccOpts||h;for(const[d,g]of u)s[d]=g;return s},V=C(N,[["__scopeId","data-v-9021bcb6"]]),z=["href","target"],j={class:"absolute z-[15] flex flex-col justify-end items-start inset-0 p-xs [@media(hover:hover)]:opacity-0 hover:opacity-100 peer transition-opacity duration-200"},M=["innerHTML"],R=["src","alt"],H=t.defineComponent({__name:"MclCardB",props:{title:{},titleSize:{default:"md"},titleColor:{default:"light-1"},titleBlockColor:{default:"dark-4"},borderColor:{default:"light-3"},imageSource:{},imageAlt:{},displayGrayScale:{type:Boolean,default:!0},ctaAsLink:{type:Boolean,default:!1},ctaLink:{default:"#"},ctaTarget:{default:"_self"},rounded:{type:Boolean,default:!1}},emits:["card-click"],setup(h,{emit:u}){const s=h;t.useSlots();const d=u,g=t.computed(()=>{const{borderColor:o,rounded:c}=s,e=[i("BORDER",o)];return e.push(c?"rounded-md":"rounded-sm"),e.join(" ")}),m=t.computed(()=>{const{displayGrayScale:o}=s;return o?"[@media(hover:hover)]:grayscale peer-hover:grayscale-0":""}),k=t.computed(()=>{const{titleSize:o,titleColor:c,titleBlockColor:e}=s;return[i("H3",o),i("TEXTCOLOR",c),i("BGCOLOR",e)].join(" ")}),y=o=>{const{title:c,ctaLink:e,ctaTarget:r,ctaAsLink:l}=s;!l&&o.preventDefault();const a={title:c,url:e,target:r||"_self"};console.log(a),d("card-click",o,a)};return(o,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative max-w-[450px] sm:max-w-[350px] w-full xs:w-auto flex-grow flex-shrink-0 cursor-pointer overflow-hidden border",g.value])},[t.createElementVNode("a",{href:o.ctaLink,target:o.ctaTarget,onClick:c[0]||(c[0]=e=>y(e))},[t.createElementVNode("div",j,[t.createElementVNode("h3",{innerHTML:o.title,class:t.normalizeClass(["inline-block px-xs py-2xs mb-2xs pointer-events-none tracking-wide",k.value])},null,10,M),t.renderSlot(o.$slots,"default")]),t.createElementVNode("img",{src:o.imageSource,alt:o.imageAlt,class:t.normalizeClass(["relative h-full w-full z-10 object-cover object-center aspect-[3/4] transition-all duration-200",m.value])},null,10,R)],8,z)],2))}}),$=["src","alt"],D=C(t.defineComponent({__name:"MclCardC",props:{imageSource:{},imageAlt:{},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},displayHighlight:{type:Boolean,default:!1},highlightColor:{default:"light-3"},highlightOpacity:{default:80},displayTitle:{type:Boolean,default:!1},cardColor:{default:"primary"}},emits:["card-click"],setup(h,{emit:u}){const s=h;t.useSlots();const d=t.ref(!1),g=u,m=t.computed(()=>{const o=[i("BGCOLOR",s.cardColor)];return d.value&&o.push("flip-card"),o.join(" ")}),k=t.computed(()=>{const{titleSize:o,titleColor:c,displayHighlight:e,highlightColor:r,highlightOpacity:l}=s,a=[i("H3",o),i("TEXTCOLOR",c)];return e&&(a.push("px-xs py-2xs mb-2xs rounded"),a.push(i("BGCOLOR",r)),a.push(i("BGOPACITY",l))),a.join(" ")}),y=o=>{o.preventDefault(),d.value&&g("card-click",o),d.value=!0};return(o,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative aspect-square card transition duration-[1600ms] max-h-[400px] overflow-hidden",m.value]),onClick:y},[t.createElementVNode("img",{src:o.imageSource,alt:o.imageAlt,class:t.normalizeClass([d.value?"opacity-100":"opacity-0","absolute w-full h-full object-cover object-center aspect-square transition-opacity delay-500 duration-[800ms]"])},null,10,$),t.createElementVNode("div",{class:t.normalizeClass([d.value?"cursor-pointer opacity-100":"opacity-0","relative flex flex-col justify-end p-sm h-full transition delay-500 duration-[800ms]"])},[o.displayTitle?(t.openBlock(),t.createElementBlock("h3",{key:0,class:t.normalizeClass(["relative self-start",k.value])},[t.createElementVNode("span",null,t.toDisplayString(o.title),1)],2)):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"card-body",{},void 0,!0)],2)],2))}}),[["__scopeId","data-v-0d2f293c"]]),G={class:"flex flex-col overflow-hidden rounded-md"},I=["src","alt"],X=["href","target"],q=C(t.defineComponent({__name:"MclCardD",props:{displayImage:{type:Boolean,default:!0},imageSource:{},imageAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-4"},bgColor:{default:"light-1"},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},ctaText:{default:"Read more"},ctaLink:{},ctaLinkTarget:{default:"_self"},ctaAsLink:{type:Boolean,default:!1},ctaButton:{type:Boolean,default:!1},ctaButtonColor:{default:"warning"},ctaButtonBlock:{type:Boolean,default:!1},borderWidth:{default:3},borderColor:{default:"light-3"},gradient1:{default:"primary"},gradient2:{default:"secondary"},customColor:{}},emits:["card-click"],setup(h,{emit:u}){const s={primary:"from-primary",secondary:"from-secondary",success:"from-success",info:"from-info",warning:"from-warning",danger:"from-danger","light-1":"from-light-1","light-2":"from-light-2","light-3":"from-light-3","light-4":"from-light-4","dark-1":"from-dark-1","dark-2":"from-dark-2","dark-3":"from-dark-3","dark-4":"from-dark-4",black:"from-black",white:"from-white",transparent:"from-transparent"},d={primary:"via-primary",secondary:"via-secondary",success:"via-success",info:"via-info",warning:"via-warning",danger:"via-danger","light-1":"via-light-1","light-2":"via-light-2","light-3":"via-light-3","light-4":"via-light-4","dark-1":"via-dark-1","dark-2":"via-dark-2","dark-3":"via-dark-3","dark-4":"via-dark-4",black:"via-black",white:"via-white",transparent:"via-transparent"},g={primary:"to-primary",secondary:"to-secondary",success:"to-success",info:"to-info",warning:"to-warning",danger:"to-danger","light-1":"to-light-1","light-2":"to-light-2","light-3":"to-light-3","light-4":"to-light-4","dark-1":"to-dark-1","dark-2":"to-dark-2","dark-3":"to-dark-3","dark-4":"to-dark-4",black:"to-black",white:"to-white",transparent:"to-transparent"},m=h;t.useSlots();const k=u,y=t.computed(()=>{const{titleSize:l,titleColor:a}=m;return[i("H2",l),i("TEXTCOLOR",a)].join(" ")}),o=t.computed(()=>{const{ctaButton:l,ctaButtonColor:a,ctaButtonBlock:p}=m,n=[],b=["light-1","light-2","light-3","light-4"];return l?n.push("btn",i("BTNCOLOR",a)):n.push("mcl-link"),l&&p&&n.push("btn-full"),l&&!b.includes(a)&&n.push("text-white"),n.join(" ")}),c=t.computed(()=>({"--border-width":`${m.borderWidth}px`})),e=t.computed(()=>{const l=s[m.borderColor],a=d[m.gradient1],p=g[m.gradient2];return[i("BORDER",m.borderColor),l,a,p].join(" ")}),r=l=>{const{title:a,ctaLink:p,ctaLinkTarget:n,ctaAsLink:b}=m,P={title:a,url:p,target:n||"_self"};!b&&l.preventDefault(),k("card-click",l,P)};return(l,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["card xs:w-auto w-full max-w-[450px] flex-shrink-0 flex-grow overflow-hidden rounded-md border from-20% sm:max-w-[350px]",e.value]),style:t.normalizeStyle(c.value)},[t.createElementVNode("div",G,[l.displayImage?(t.openBlock(),t.createElementBlock("img",{key:0,src:l.imageSource,class:"max-h-[200px] min-w-full object-cover object-top",alt:l.imageAlt},null,8,I)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["p-xs",t.unref(i)("BGCOLOR",l.bgColor)])},[t.createElementVNode("h3",{class:t.normalizeClass(["mb-xs",y.value])},t.toDisplayString(l.title),3),l.displayHighlight?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["mb-xs h-3xs w-md",t.unref(i)("BGCOLOR",l.highlightColor)])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",null,[t.renderSlot(l.$slots,"default",{},void 0,!0)]),t.createElementVNode("div",{class:t.normalizeClass(["mt-xs",{"mb-2xs":!l.ctaButton}])},[t.createElementVNode("a",{href:l.ctaLink,target:l.ctaLinkTarget,class:t.normalizeClass(o.value),onClick:r},t.toDisplayString(l.ctaText),11,X)],2)],2)])],6))}}),[["__scopeId","data-v-390b5ad7"]]);f.MclCardA=V,f.MclCardB=H,f.MclCardC=D,f.MclCardD=q,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.perspective[data-v-0d2f293c]{-webkit-perspective:1800px;perspective:1800px}.card[data-v-0d2f293c]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateY(0deg);transform:rotateY(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.flip-card[data-v-0d2f293c]{-webkit-transform:rotateY(360deg);transform:rotateY(360deg)}.card[data-v-390b5ad7]{background-size:cover;background-position:center center;background-repeat:no-repeat;padding:var(--border-width);background:conic-gradient(from var(--border-angle, 0deg),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-via),var(--tw-gradient-to));animation:bg-spin-390b5ad7 4s linear infinite}@keyframes bg-spin-390b5ad7{0%{--border-angle: 0deg}to{--border-angle: 360deg}}.card[data-v-390b5ad7]:hover{animation-play-state:paused}@property --border-angle{syntax: "<angle>"; inherits: false; initial-value: 0deg;}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.MclCards={},f.Vue,f.ManguitoTheme))})(this,function(f,t,i){"use strict";const w={key:0,class:"relative"},x=["src","alt"],E=["innerHTML"],L={class:"flex h-full flex-col justify-between"},T={class:"px-xs pt-sm flex-1"},O=["innerHTML"],S=["innerHTML"],z={class:"px-xs w-full"},N=["href","target"],V=t.defineComponent({__name:"MclCardA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},borderColor:{default:"light-3"},bgColor:{default:"light-1"},fullWidth:{type:Boolean,default:!1},glass:{type:Boolean,default:!1},glassBlur:{default:"sm"},glassOpacity:{default:20},displayImage:{type:Boolean,default:!0},imageSource:{},imageAlt:{},displayCta:{type:Boolean,default:!0},ctaAsLink:{type:Boolean,default:!1},ctaText:{default:"cta text"},ctaColor:{default:"primary"},ctaLink:{default:"#"},ctaTarget:{default:"_self"},displayLabel:{type:Boolean,default:!0},labelText:{default:"Lorem ipsum"},labelTextColor:{default:"light-1"},labelColor:{default:"dark-4"},enlargeOnHover:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},rounded:{type:Boolean,default:!0},displayShadow:{type:Boolean,default:!0}},emits:["card-click","card-btn-click"],setup(h,{emit:u}){const s=h;t.useSlots();const c=u,g=t.computed(()=>{const{borderColor:e,bgColor:a,rounded:l,enlargeOnHover:r,displayShadow:p,glass:m,glassBlur:C,glassOpacity:b,fullWidth:W}=s;return[i("BORDER",e),i("BGCOLOR",a),!W&&"max-w-[450px] sm:max-w-[350px]",l?"rounded-lg":"rounded-sm",r&&"hover:scale-105 transition ease-in duration-300",p&&"drop-shadow-md",m&&i.getGlassmorphismClass(a,C,b)].filter(Boolean).join(" ")}),d=t.computed(()=>{const{titleSize:e,titleColor:a,displayHighlight:l}=s;return[i("H3",e),i("TEXTCOLOR",a),l?"mb-2xs":"mb-xs"].filter(Boolean).join(" ")}),k=t.computed(()=>{const{labelTextColor:e,labelColor:a}=s;return[i("TEXTCOLOR",e),i("BGCOLOR",a)].filter(Boolean).join(" ")}),y=t.computed(()=>{const{ctaColor:e,rounded:a}=s,l=["light-1","light-2","light-3","light-4"];return[i("BTNCOLOR",e),l.includes(e)?"text-black":"text-white",a&&"btn-round"].filter(Boolean).join(" ")}),o=e=>{const{title:a,ctaLink:l,ctaTarget:r,ctaAsLink:p}=s,m={title:a,url:l,target:r||"_self"};!p&&e.preventDefault(),c("card-btn-click",e,m)},n=e=>{const{title:a,ctaLink:l,ctaTarget:r}=s;c("card-click",e,{title:a,url:l,target:r||"_self"})};return(e,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["xs:w-auto flex w-full flex-shrink-0 flex-grow cursor-pointer flex-col overflow-hidden border",g.value]),onClick:n},[e.displayImage?(t.openBlock(),t.createElementBlock("div",w,[t.createElementVNode("img",{src:e.imageSource,alt:e.imageAlt,class:"aspect-video min-w-full object-cover object-top"},null,8,x),e.displayLabel?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["py-3xs px-2xs ml-xs absolute bottom-0 inline-block translate-y-[50%] text-xs font-bold",k.value]),innerHTML:e.labelText},null,10,E)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",L,[t.createElementVNode("div",T,[!e.displayImage&&e.displayLabel?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["py-3xs px-2xs mb-2xs inline-block text-xs font-bold",k.value]),innerHTML:e.labelText},null,10,O)):t.createCommentVNode("",!0),t.createElementVNode("h3",{class:t.normalizeClass(d.value),innerHTML:e.title},null,10,S),e.displayHighlight?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["mb-xs h-3xs w-md",t.unref(i)("BGCOLOR",e.highlightColor)])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"mb-sm cursor-default",onClick:a[0]||(a[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default")])]),e.displayCta?(t.openBlock(),t.createElementBlock("div",{key:0,class:"pb-sm cursor-default border-0",onClick:a[2]||(a[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",z,[t.createElementVNode("a",{href:e.ctaLink,target:e.ctaTarget,class:t.normalizeClass(["btn btn-full",y.value]),onClick:a[1]||(a[1]=l=>o(l))},t.toDisplayString(e.ctaText),11,N)])])):t.createCommentVNode("",!0)])],2))}}),_=["href","target"],A={class:"absolute z-[15] flex flex-col justify-end items-start inset-0 p-xs [@media(hover:hover)]:opacity-0 hover:opacity-100 peer transition-opacity duration-200"},j=["innerHTML"],M=["src","alt"],R=t.defineComponent({__name:"MclCardB",props:{title:{},titleSize:{default:"md"},titleColor:{default:"light-1"},titleBlockColor:{default:"dark-4"},borderColor:{default:"light-3"},imageSource:{},imageAlt:{},displayGrayScale:{type:Boolean,default:!0},ctaAsLink:{type:Boolean,default:!1},ctaLink:{default:"#"},ctaTarget:{default:"_self"},rounded:{type:Boolean,default:!1}},emits:["card-click"],setup(h,{emit:u}){const s=h;t.useSlots();const c=u,g=t.computed(()=>{const{borderColor:o,rounded:n}=s,e=[i("BORDER",o)];return e.push(n?"rounded-md":"rounded-sm"),e.join(" ")}),d=t.computed(()=>{const{displayGrayScale:o}=s;return o?"[@media(hover:hover)]:grayscale peer-hover:grayscale-0":""}),k=t.computed(()=>{const{titleSize:o,titleColor:n,titleBlockColor:e}=s;return[i("H3",o),i("TEXTCOLOR",n),i("BGCOLOR",e)].join(" ")}),y=o=>{const{title:n,ctaLink:e,ctaTarget:a,ctaAsLink:l}=s;!l&&o.preventDefault();const r={title:n,url:e,target:a||"_self"};console.log(r),c("card-click",o,r)};return(o,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative max-w-[450px] sm:max-w-[350px] w-full xs:w-auto flex-grow flex-shrink-0 cursor-pointer overflow-hidden border",g.value])},[t.createElementVNode("a",{href:o.ctaLink,target:o.ctaTarget,onClick:n[0]||(n[0]=e=>y(e))},[t.createElementVNode("div",A,[t.createElementVNode("h3",{innerHTML:o.title,class:t.normalizeClass(["inline-block px-xs py-2xs mb-2xs pointer-events-none tracking-wide",k.value])},null,10,j),t.renderSlot(o.$slots,"default")]),t.createElementVNode("img",{src:o.imageSource,alt:o.imageAlt,class:t.normalizeClass(["relative h-full w-full z-10 object-cover object-center aspect-[3/4] transition-all duration-200",d.value])},null,10,M)],8,_)],2))}}),H=["src","alt"],$=t.defineComponent({__name:"MclCardC",props:{imageSource:{},imageAlt:{},title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},displayHighlight:{type:Boolean,default:!1},highlightColor:{default:"light-3"},highlightOpacity:{default:80},displayTitle:{type:Boolean,default:!1},cardColor:{default:"primary"}},emits:["card-click"],setup(h,{emit:u}){const s=h;t.useSlots();const c=t.ref(!1),g=u,d=t.computed(()=>{const o=[i("BGCOLOR",s.cardColor)];return c.value&&o.push("flip-card"),o.join(" ")}),k=t.computed(()=>{const{titleSize:o,titleColor:n,displayHighlight:e,highlightColor:a,highlightOpacity:l}=s,r=[i("H3",o),i("TEXTCOLOR",n)];return e&&(r.push("px-xs py-2xs mb-2xs rounded"),r.push(i("BGCOLOR",a)),r.push(i("BGOPACITY",l))),r.join(" ")}),y=o=>{o.preventDefault(),c.value&&g("card-click",o),c.value=!0};return(o,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative aspect-square card transition duration-[1600ms] max-h-[400px] overflow-hidden",d.value]),onClick:y},[t.createElementVNode("img",{src:o.imageSource,alt:o.imageAlt,class:t.normalizeClass([c.value?"opacity-100":"opacity-0","absolute w-full h-full object-cover object-center aspect-square transition-opacity delay-500 duration-[800ms]"])},null,10,H),t.createElementVNode("div",{class:t.normalizeClass([c.value?"cursor-pointer opacity-100":"opacity-0","relative flex flex-col justify-end p-sm h-full transition delay-500 duration-[800ms]"])},[o.displayTitle?(t.openBlock(),t.createElementBlock("h3",{key:0,class:t.normalizeClass(["relative self-start",k.value])},[t.createElementVNode("span",null,t.toDisplayString(o.title),1)],2)):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"card-body",{},void 0,!0)],2)],2))}}),B=(h,u)=>{const s=h.__vccOpts||h;for(const[c,g]of u)s[c]=g;return s},D=B($,[["__scopeId","data-v-0d2f293c"]]),G={class:"flex flex-col overflow-hidden rounded-md"},I=["src","alt"],X=["href","target"],q=B(t.defineComponent({__name:"MclCardD",props:{displayImage:{type:Boolean,default:!0},imageSource:{},imageAlt:{default:""},title:{},titleSize:{default:"md"},titleColor:{default:"dark-4"},bgColor:{default:"light-1"},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},ctaText:{default:"Read more"},ctaLink:{},ctaLinkTarget:{default:"_self"},ctaAsLink:{type:Boolean,default:!1},ctaButton:{type:Boolean,default:!1},ctaButtonColor:{default:"warning"},ctaButtonBlock:{type:Boolean,default:!1},borderWidth:{default:3},borderColor:{default:"light-3"},gradient1:{default:"primary"},gradient2:{default:"secondary"},customColor:{}},emits:["card-click"],setup(h,{emit:u}){const s={primary:"from-primary",secondary:"from-secondary",success:"from-success",info:"from-info",warning:"from-warning",danger:"from-danger","light-1":"from-light-1","light-2":"from-light-2","light-3":"from-light-3","light-4":"from-light-4","dark-1":"from-dark-1","dark-2":"from-dark-2","dark-3":"from-dark-3","dark-4":"from-dark-4",black:"from-black",white:"from-white",transparent:"from-transparent"},c={primary:"via-primary",secondary:"via-secondary",success:"via-success",info:"via-info",warning:"via-warning",danger:"via-danger","light-1":"via-light-1","light-2":"via-light-2","light-3":"via-light-3","light-4":"via-light-4","dark-1":"via-dark-1","dark-2":"via-dark-2","dark-3":"via-dark-3","dark-4":"via-dark-4",black:"via-black",white:"via-white",transparent:"via-transparent"},g={primary:"to-primary",secondary:"to-secondary",success:"to-success",info:"to-info",warning:"to-warning",danger:"to-danger","light-1":"to-light-1","light-2":"to-light-2","light-3":"to-light-3","light-4":"to-light-4","dark-1":"to-dark-1","dark-2":"to-dark-2","dark-3":"to-dark-3","dark-4":"to-dark-4",black:"to-black",white:"to-white",transparent:"to-transparent"},d=h;t.useSlots();const k=u,y=t.computed(()=>{const{titleSize:l,titleColor:r}=d;return[i("H2",l),i("TEXTCOLOR",r)].join(" ")}),o=t.computed(()=>{const{ctaButton:l,ctaButtonColor:r,ctaButtonBlock:p}=d,m=[],C=["light-1","light-2","light-3","light-4"];return l?m.push("btn",i("BTNCOLOR",r)):m.push("mcl-link"),l&&p&&m.push("btn-full"),l&&!C.includes(r)&&m.push("text-white"),m.join(" ")}),n=t.computed(()=>({"--border-width":`${d.borderWidth}px`})),e=t.computed(()=>{const l=s[d.borderColor],r=c[d.gradient1],p=g[d.gradient2];return[i("BORDER",d.borderColor),l,r,p].join(" ")}),a=l=>{const{title:r,ctaLink:p,ctaLinkTarget:m,ctaAsLink:C}=d,b={title:r,url:p,target:m||"_self"};!C&&l.preventDefault(),k("card-click",l,b)};return(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["card xs:w-auto w-full max-w-[450px] flex-shrink-0 flex-grow overflow-hidden rounded-md border from-20% sm:max-w-[350px]",e.value]),style:t.normalizeStyle(n.value)},[t.createElementVNode("div",G,[l.displayImage?(t.openBlock(),t.createElementBlock("img",{key:0,src:l.imageSource,class:"max-h-[200px] min-w-full object-cover object-top",alt:l.imageAlt},null,8,I)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["p-xs",t.unref(i)("BGCOLOR",l.bgColor)])},[t.createElementVNode("h3",{class:t.normalizeClass(["mb-xs",y.value])},t.toDisplayString(l.title),3),l.displayHighlight?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["mb-xs h-3xs w-md",t.unref(i)("BGCOLOR",l.highlightColor)])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",null,[t.renderSlot(l.$slots,"default",{},void 0,!0)]),t.createElementVNode("div",{class:t.normalizeClass(["mt-xs",{"mb-2xs":!l.ctaButton}])},[t.createElementVNode("a",{href:l.ctaLink,target:l.ctaLinkTarget,class:t.normalizeClass(o.value),onClick:a},t.toDisplayString(l.ctaText),11,X)],2)],2)])],6))}}),[["__scopeId","data-v-390b5ad7"]]);f.MclCardA=V,f.MclCardB=R,f.MclCardC=D,f.MclCardD=q,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-cards",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "card components based on @bobbykim/manguito-theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bobbykim/manguito-theme": "0.
|
|
36
|
+
"@bobbykim/manguito-theme": "0.28.1",
|
|
37
37
|
"vue": "^3.5.13"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"vite-plugin-dts": "^4.3.0",
|
|
46
46
|
"vue-tsc": "^2.1.10"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9ffea0493c49e2c7df51c45e3c2f72d256663048"
|
|
49
49
|
}
|