@bobbykim/mcl-carousel 0.7.3 → 0.8.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 CHANGED
@@ -1,106 +1,52 @@
1
1
  import { BodyText } from '@bobbykim/manguito-theme';
2
2
  import { ColorPalette } from '@bobbykim/manguito-theme';
3
3
  import { ComponentOptionsMixin } from 'vue';
4
+ import { ComponentProvideOptions } from 'vue';
4
5
  import { ComponentPublicInstance } from 'vue';
5
6
  import { DefineComponent } from 'vue';
6
- import { ExtractPropTypes } from 'vue';
7
7
  import { HeadingSize } from '@bobbykim/manguito-theme';
8
- import { PropType } from 'vue';
9
8
  import { PublicProps } from 'vue';
10
9
  import { SpacingLevel } from '@bobbykim/manguito-theme';
11
10
 
12
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
-
14
- declare type __VLS_Prettify<T> = {
15
- [K in keyof T]: T[K];
16
- } & {};
17
-
18
- declare type __VLS_TypePropsToRuntimeProps<T> = {
19
- [K in keyof T]-?: {} extends Pick<T, K> ? {
20
- type: PropType<__VLS_NonUndefinedable<T[K]>>;
21
- } : {
22
- type: PropType<T[K]>;
23
- required: true;
24
- };
25
- };
26
-
27
- declare type __VLS_WithDefaults<P, D> = {
28
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
29
- default: D[K];
30
- }> : P[K];
31
- };
32
-
33
- declare type __VLS_WithTemplateSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };
38
-
39
- export declare const MclCarouselA: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
+ declare const __VLS_component: DefineComponent< {
40
12
  title: string;
41
- titleSize?: HeadingSize | undefined;
42
- titleColor?: ColorPalette | undefined;
43
- bgColor?: ColorPalette | undefined;
44
- displayTagLine?: boolean | undefined;
45
- tagLineUpperCase?: boolean | undefined;
46
- tagLine?: string | undefined;
47
- tagLineSize?: BodyText | undefined;
48
- tagLineColor?: ColorPalette | undefined;
49
- displayHighlight?: boolean | undefined;
50
- highlightColor?: ColorPalette | undefined;
51
- btnColor?: ColorPalette | undefined;
52
- btnBgColor?: ColorPalette | undefined;
13
+ titleSize?: HeadingSize;
14
+ titleColor?: ColorPalette;
15
+ bgColor?: ColorPalette;
16
+ displayTagLine?: boolean;
17
+ tagLineUpperCase?: boolean;
18
+ tagLine?: string;
19
+ tagLineSize?: BodyText;
20
+ tagLineColor?: ColorPalette;
21
+ displayHighlight?: boolean;
22
+ highlightColor?: ColorPalette;
23
+ btnColor?: ColorPalette;
24
+ btnBgColor?: ColorPalette;
53
25
  content: any[];
54
- cardsGap?: SpacingLevel | undefined;
55
- }>, {
56
- titleSize: string;
57
- titleColor: string;
58
- bgColor: string;
59
- displayTagLine: boolean;
60
- tagLineUpperCase: boolean;
61
- tagLineSize: string;
62
- tagLineColor: string;
63
- displayHighlight: boolean;
64
- highlightColor: string;
65
- btnColor: string;
66
- btnBgColor: string;
67
- cardsGap: string;
68
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
69
- "btn-prev": (event: Event) => void;
70
- "btn-next": (event: Event) => void;
71
- }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
26
+ cardsGap?: SpacingLevel;
27
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
28
+ "btn-prev": (event: Event) => any;
29
+ "btn-next": (event: Event) => any;
30
+ }, string, PublicProps, Readonly<{
72
31
  title: string;
73
- titleSize?: HeadingSize | undefined;
74
- titleColor?: ColorPalette | undefined;
75
- bgColor?: ColorPalette | undefined;
76
- displayTagLine?: boolean | undefined;
77
- tagLineUpperCase?: boolean | undefined;
78
- tagLine?: string | undefined;
79
- tagLineSize?: BodyText | undefined;
80
- tagLineColor?: ColorPalette | undefined;
81
- displayHighlight?: boolean | undefined;
82
- highlightColor?: ColorPalette | undefined;
83
- btnColor?: ColorPalette | undefined;
84
- btnBgColor?: ColorPalette | undefined;
32
+ titleSize?: HeadingSize;
33
+ titleColor?: ColorPalette;
34
+ bgColor?: ColorPalette;
35
+ displayTagLine?: boolean;
36
+ tagLineUpperCase?: boolean;
37
+ tagLine?: string;
38
+ tagLineSize?: BodyText;
39
+ tagLineColor?: ColorPalette;
40
+ displayHighlight?: boolean;
41
+ highlightColor?: ColorPalette;
42
+ btnColor?: ColorPalette;
43
+ btnBgColor?: ColorPalette;
85
44
  content: any[];
86
- cardsGap?: SpacingLevel | undefined;
87
- }>, {
88
- titleSize: string;
89
- titleColor: string;
90
- bgColor: string;
91
- displayTagLine: boolean;
92
- tagLineUpperCase: boolean;
93
- tagLineSize: string;
94
- tagLineColor: string;
95
- displayHighlight: boolean;
96
- highlightColor: string;
97
- btnColor: string;
98
- btnBgColor: string;
99
- cardsGap: string;
100
- }>>> & {
45
+ cardsGap?: SpacingLevel;
46
+ }> & Readonly<{
101
47
  "onBtn-prev"?: ((event: Event) => any) | undefined;
102
48
  "onBtn-next"?: ((event: Event) => any) | undefined;
103
- }, {
49
+ }>, {
104
50
  titleSize: HeadingSize;
105
51
  titleColor: ColorPalette;
106
52
  bgColor: ColorPalette;
@@ -113,12 +59,30 @@ highlightColor: ColorPalette;
113
59
  btnColor: ColorPalette;
114
60
  btnBgColor: ColorPalette;
115
61
  cardsGap: SpacingLevel;
116
- }, {}>, {
117
- description?(_: {}): any;
118
- carousel?(_: {
119
- cards: any[];
120
- setRef: (el: Element | ComponentPublicInstance | null) => void;
121
- }): any;
122
- }>;
62
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
63
+
64
+ declare function __VLS_template(): {
65
+ slots: {
66
+ description?(_: {}): any;
67
+ carousel?(_: {
68
+ cards: any[];
69
+ setRef: (el: ComponentPublicInstance | Element | null) => void;
70
+ }): any;
71
+ };
72
+ refs: {
73
+ slideContainer: HTMLDivElement;
74
+ };
75
+ attrs: Partial<{}>;
76
+ };
77
+
78
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
79
+
80
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
81
+ new (): {
82
+ $slots: S;
83
+ };
84
+ };
85
+
86
+ export declare const MclCarouselA: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
123
87
 
124
88
  export { }
@@ -1,25 +1,7 @@
1
- import { defineComponent as A, ref as o, onMounted as G, openBlock as p, createElementBlock as f, normalizeClass as a, unref as g, createElementVNode as t, createCommentVNode as x, renderSlot as y } from "vue";
1
+ import { defineComponent as G, ref as o, onMounted as S, openBlock as p, createElementBlock as f, normalizeClass as r, unref as g, createElementVNode as s, createCommentVNode as x, renderSlot as y } from "vue";
2
2
  import n from "@bobbykim/manguito-theme";
3
- import { useEventListener as L, useIntersectionObserver as S } from "@vueuse/core";
4
- const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = { class: "relative" }, j = { class: "relative" }, X = ["innerHTML"], $ = ["innerHTML"], I = { class: "relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4" }, N = { class: "max-w-xl" }, D = { class: "flex space-x-4" }, U = ["disabled"], V = /* @__PURE__ */ t("svg", {
5
- class: "w-xs h-xs",
6
- xmlns: "http://www.w3.org/2000/svg",
7
- viewBox: "0 0 384 512",
8
- fill: "currentColor"
9
- }, [
10
- /* @__PURE__ */ t("path", { d: "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" })
11
- ], -1), P = [
12
- V
13
- ], W = ["disabled"], Y = /* @__PURE__ */ t("svg", {
14
- class: "w-xs h-xs",
15
- xmlns: "http://www.w3.org/2000/svg",
16
- viewBox: "0 0 384 512",
17
- fill: "currentColor"
18
- }, [
19
- /* @__PURE__ */ t("path", { d: "M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" })
20
- ], -1), q = [
21
- Y
22
- ], F = { class: "container mt-md sm:mt-lg lg:mt-xl" }, Z = /* @__PURE__ */ A({
3
+ import { useEventListener as L, useIntersectionObserver as z } from "@vueuse/core";
4
+ const H = { class: "container px-xs sm:px-md text-center sm:text-left" }, j = { class: "relative" }, X = { class: "relative" }, $ = ["innerHTML"], I = ["innerHTML"], N = { class: "relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4" }, D = { class: "max-w-xl" }, U = { class: "flex space-x-4" }, V = ["disabled"], _ = ["disabled"], P = { class: "container mt-md sm:mt-lg lg:mt-xl" }, F = /* @__PURE__ */ G({
23
5
  __name: "MclCarouselA",
24
6
  props: {
25
7
  title: {},
@@ -40,7 +22,7 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
40
22
  },
41
23
  emits: ["btn-prev", "btn-next"],
42
24
  setup(w, { emit: B }) {
43
- const T = w, r = o(null), i = o([]), h = o(), v = B, d = o(0), c = o(!1);
25
+ const T = w, a = o(null), i = o([]), v = o(), m = B, d = o(0), c = o(!1);
44
26
  let u = !1;
45
27
  const O = (e) => {
46
28
  switch (e) {
@@ -67,84 +49,102 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
67
49
  }
68
50
  }, k = (e) => {
69
51
  i.value.push(e);
70
- }, m = (e, s) => {
52
+ }, h = (e, t) => {
71
53
  var l;
72
- u || (u = !0, s === "prev" && (d.value--, v("btn-prev", e)), s === "next" && (d.value++, v("btn-next", e)), (l = r.value) == null || l.dispatchEvent(new Event("sliderMove")));
73
- }, _ = (e, s) => [
54
+ u || (u = !0, t === "prev" && (d.value--, m("btn-prev", e)), t === "next" && (d.value++, m("btn-next", e)), (l = a.value) == null || l.dispatchEvent(new Event("sliderMove")));
55
+ }, M = (e, t) => [
74
56
  n("H2", e),
75
- n("TEXTCOLOR", s)
76
- ].join(" "), M = (e, s, l) => {
57
+ n("TEXTCOLOR", t)
58
+ ].join(" "), E = (e, t, l) => {
77
59
  const b = [
78
60
  n("BODYTEXT", e),
79
- n("TEXTCOLOR", s)
61
+ n("TEXTCOLOR", t)
80
62
  ];
81
63
  return l && b.push("uppercase"), b.join(" ");
82
- }, C = (e, s) => [
64
+ }, C = (e, t) => [
83
65
  n("TEXTCOLOR", e),
84
- n("BGCOLOR", s),
85
- n("RINGCOLOR", s)
86
- ].join(" "), E = () => {
87
- r.value.style.transform = `translateX(-${d.value * (i.value[0].$el.clientWidth + O(T.cardsGap) + 2)}px)`, c.value = !1;
88
- }, R = () => {
66
+ n("BGCOLOR", t),
67
+ n("RINGCOLOR", t)
68
+ ].join(" "), R = () => {
69
+ a.value.style.transform = `translateX(-${d.value * (i.value[0].$el.clientWidth + O(T.cardsGap) + 2)}px)`, c.value = !1;
70
+ }, A = () => {
89
71
  u = !1;
90
72
  };
91
- return L(r, "sliderMove", E), L(r, "transitionend", R), S(
92
- h,
73
+ return L(a, "sliderMove", R), L(a, "transitionend", A), z(
74
+ v,
93
75
  (e) => {
94
76
  e[0].isIntersecting && (c.value = !0);
95
77
  },
96
78
  { threshold: 0.75 }
97
- ), G(() => {
98
- h.value = i.value[i.value.length - 1].$el;
99
- }), (e, s) => (p(), f("section", {
100
- class: a(["py-lg lg:py-xl overflow-hidden", g(n)("BGCOLOR", e.bgColor)])
79
+ ), S(() => {
80
+ v.value = i.value[i.value.length - 1].$el;
81
+ }), (e, t) => (p(), f("section", {
82
+ class: r(["py-lg lg:py-xl overflow-hidden", g(n)("BGCOLOR", e.bgColor)])
101
83
  }, [
102
- t("div", z, [
103
- t("div", H, [
84
+ s("div", H, [
85
+ s("div", j, [
104
86
  e.displayHighlight ? (p(), f("div", {
105
87
  key: 0,
106
- class: a(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full", g(n)("BGCOLOR", e.highlightColor)])
88
+ class: r(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full", g(n)("BGCOLOR", e.highlightColor)])
107
89
  }, null, 2)) : x("", !0),
108
- t("div", j, [
90
+ s("div", X, [
109
91
  e.displayTagLine ? (p(), f("span", {
110
92
  key: 0,
111
- class: a([
93
+ class: r([
112
94
  "tracking-widest",
113
- M(e.tagLineSize, e.tagLineColor, e.tagLineUpperCase)
95
+ E(e.tagLineSize, e.tagLineColor, e.tagLineUpperCase)
114
96
  ]),
115
97
  innerHTML: e.tagLine
116
- }, null, 10, X)) : x("", !0),
117
- t("h2", {
118
- class: a(["tracking-wide", _(e.titleSize, e.titleColor)]),
98
+ }, null, 10, $)) : x("", !0),
99
+ s("h2", {
100
+ class: r(["tracking-wide", M(e.titleSize, e.titleColor)]),
119
101
  innerHTML: e.title
120
- }, null, 10, $)
102
+ }, null, 10, I)
121
103
  ]),
122
- t("div", I, [
123
- t("div", N, [
104
+ s("div", N, [
105
+ s("div", D, [
124
106
  y(e.$slots, "description")
125
107
  ]),
126
- t("div", D, [
127
- t("button", {
128
- class: a(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
108
+ s("div", U, [
109
+ s("button", {
110
+ class: r(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
129
111
  disabled: d.value === 0,
130
- onClick: s[0] || (s[0] = (l) => m(l, "prev")),
112
+ onClick: t[0] || (t[0] = (l) => h(l, "prev")),
131
113
  "aria-label": "previous"
132
- }, P, 10, U),
133
- t("button", {
134
- class: a(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
114
+ }, t[2] || (t[2] = [
115
+ s("svg", {
116
+ class: "w-xs h-xs",
117
+ xmlns: "http://www.w3.org/2000/svg",
118
+ viewBox: "0 0 384 512",
119
+ fill: "currentColor"
120
+ }, [
121
+ s("path", { d: "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" })
122
+ ], -1)
123
+ ]), 10, V),
124
+ s("button", {
125
+ class: r(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200", C(e.btnColor, e.btnBgColor)]),
135
126
  disabled: c.value,
136
- onClick: s[1] || (s[1] = (l) => m(l, "next")),
127
+ onClick: t[1] || (t[1] = (l) => h(l, "next")),
137
128
  "aria-label": "next"
138
- }, q, 10, W)
129
+ }, t[3] || (t[3] = [
130
+ s("svg", {
131
+ class: "w-xs h-xs",
132
+ xmlns: "http://www.w3.org/2000/svg",
133
+ viewBox: "0 0 384 512",
134
+ fill: "currentColor"
135
+ }, [
136
+ s("path", { d: "M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" })
137
+ ], -1)
138
+ ]), 10, _)
139
139
  ])
140
140
  ])
141
141
  ])
142
142
  ]),
143
- t("div", F, [
144
- t("div", {
145
- class: a(["flex transition-transform duration-500 px-xs gap-xs", g(n)("GAP", e.cardsGap)]),
143
+ s("div", P, [
144
+ s("div", {
145
+ class: r(["flex transition-transform duration-500 px-xs gap-xs", g(n)("GAP", e.cardsGap)]),
146
146
  ref_key: "slideContainer",
147
- ref: r
147
+ ref: a
148
148
  }, [
149
149
  y(e.$slots, "carousel", {
150
150
  cards: e.content,
@@ -156,5 +156,5 @@ const z = { class: "container px-xs sm:px-md text-center sm:text-left" }, H = {
156
156
  }
157
157
  });
158
158
  export {
159
- Z as MclCarouselA
159
+ F as MclCarouselA
160
160
  };
@@ -1 +1 @@
1
- (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme","@vueuse/core"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.MclCarousel={},o.Vue,o.ManguitoTheme,o.core))})(this,function(o,e,n,d){"use strict";const C={class:"container px-xs sm:px-md text-center sm:text-left"},b={class:"relative"},y={class:"relative"},x=["innerHTML"],E=["innerHTML"],L={class:"relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4"},w={class:"max-w-xl"},B={class:"flex space-x-4"},T=["disabled"],k=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})],-1)],N=["disabled"],V=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})],-1)],_={class:"container mt-md sm:mt-lg lg:mt-xl"},O=e.defineComponent({__name:"MclCarouselA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},bgColor:{default:"light-1"},displayTagLine:{type:Boolean,default:!0},tagLineUpperCase:{type:Boolean,default:!0},tagLine:{},tagLineSize:{default:"md"},tagLineColor:{default:"dark-1"},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},btnColor:{default:"dark-3"},btnBgColor:{default:"light-4"},content:{},cardsGap:{default:"xs"}},emits:["btn-prev","btn-next"],setup(M,{emit:z}){const v=M,r=e.ref(null),i=e.ref([]),u=e.ref(),m=z,a=e.ref(0),c=e.ref(!1);let f=!1;const S=t=>{switch(t){case"0":return 0;case"3xs":return 4;case"2xs":return 8;case"xs":return 16;case"sm":return 24;case"md":return 32;case"lg":return 48;case"xl":return 64;case"2xl":return 96;case"3xl":return 128}},R=t=>{i.value.push(t)},p=(t,s)=>{var l;f||(f=!0,s==="prev"&&(a.value--,m("btn-prev",t)),s==="next"&&(a.value++,m("btn-next",t)),(l=r.value)==null||l.dispatchEvent(new Event("sliderMove")))},A=(t,s)=>[n("H2",t),n("TEXTCOLOR",s)].join(" "),G=(t,s,l)=>{const g=[n("BODYTEXT",t),n("TEXTCOLOR",s)];return l&&g.push("uppercase"),g.join(" ")},h=(t,s)=>[n("TEXTCOLOR",t),n("BGCOLOR",s),n("RINGCOLOR",s)].join(" "),j=()=>{r.value.style.transform=`translateX(-${a.value*(i.value[0].$el.clientWidth+S(v.cardsGap)+2)}px)`,c.value=!1},H=()=>{f=!1};return d.useEventListener(r,"sliderMove",j),d.useEventListener(r,"transitionend",H),d.useIntersectionObserver(u,t=>{t[0].isIntersecting&&(c.value=!0)},{threshold:.75}),e.onMounted(()=>{u.value=i.value[i.value.length-1].$el}),(t,s)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["py-lg lg:py-xl overflow-hidden",e.unref(n)("BGCOLOR",t.bgColor)])},[e.createElementVNode("div",C,[e.createElementVNode("div",b,[t.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full",e.unref(n)("BGCOLOR",t.highlightColor)])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",y,[t.displayTagLine?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["tracking-widest",G(t.tagLineSize,t.tagLineColor,t.tagLineUpperCase)]),innerHTML:t.tagLine},null,10,x)):e.createCommentVNode("",!0),e.createElementVNode("h2",{class:e.normalizeClass(["tracking-wide",A(t.titleSize,t.titleColor)]),innerHTML:t.title},null,10,E)]),e.createElementVNode("div",L,[e.createElementVNode("div",w,[e.renderSlot(t.$slots,"description")]),e.createElementVNode("div",B,[e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",h(t.btnColor,t.btnBgColor)]),disabled:a.value===0,onClick:s[0]||(s[0]=l=>p(l,"prev")),"aria-label":"previous"},k,10,T),e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",h(t.btnColor,t.btnBgColor)]),disabled:c.value,onClick:s[1]||(s[1]=l=>p(l,"next")),"aria-label":"next"},V,10,N)])])])]),e.createElementVNode("div",_,[e.createElementVNode("div",{class:e.normalizeClass(["flex transition-transform duration-500 px-xs gap-xs",e.unref(n)("GAP",t.cardsGap)]),ref_key:"slideContainer",ref:r},[e.renderSlot(t.$slots,"carousel",{cards:t.content,setRef:R})],2)])],2))}});o.MclCarouselA=O,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@bobbykim/manguito-theme"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme","@vueuse/core"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.MclCarousel={},o.Vue,o.ManguitoTheme,o.core))})(this,function(o,e,s,d){"use strict";const C={class:"container px-xs sm:px-md text-center sm:text-left"},b={class:"relative"},y={class:"relative"},x=["innerHTML"],E=["innerHTML"],L={class:"relative flex flex-wrap sm:flex-nowrap justify-center sm:justify-start items-center space-x-4 space-y-4"},w={class:"max-w-xl"},B={class:"flex space-x-4"},T=["disabled"],k=["disabled"],N={class:"container mt-md sm:mt-lg lg:mt-xl"},V=e.defineComponent({__name:"MclCarouselA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},bgColor:{default:"light-1"},displayTagLine:{type:Boolean,default:!0},tagLineUpperCase:{type:Boolean,default:!0},tagLine:{},tagLineSize:{default:"md"},tagLineColor:{default:"dark-1"},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"primary"},btnColor:{default:"dark-3"},btnBgColor:{default:"light-4"},content:{},cardsGap:{default:"xs"}},emits:["btn-prev","btn-next"],setup(O,{emit:M}){const z=O,r=e.ref(null),i=e.ref([]),u=e.ref(),m=M,a=e.ref(0),c=e.ref(!1);let f=!1;const v=t=>{switch(t){case"0":return 0;case"3xs":return 4;case"2xs":return 8;case"xs":return 16;case"sm":return 24;case"md":return 32;case"lg":return 48;case"xl":return 64;case"2xl":return 96;case"3xl":return 128}},S=t=>{i.value.push(t)},p=(t,n)=>{var l;f||(f=!0,n==="prev"&&(a.value--,m("btn-prev",t)),n==="next"&&(a.value++,m("btn-next",t)),(l=r.value)==null||l.dispatchEvent(new Event("sliderMove")))},R=(t,n)=>[s("H2",t),s("TEXTCOLOR",n)].join(" "),A=(t,n,l)=>{const h=[s("BODYTEXT",t),s("TEXTCOLOR",n)];return l&&h.push("uppercase"),h.join(" ")},g=(t,n)=>[s("TEXTCOLOR",t),s("BGCOLOR",n),s("RINGCOLOR",n)].join(" "),G=()=>{r.value.style.transform=`translateX(-${a.value*(i.value[0].$el.clientWidth+v(z.cardsGap)+2)}px)`,c.value=!1},j=()=>{f=!1};return d.useEventListener(r,"sliderMove",G),d.useEventListener(r,"transitionend",j),d.useIntersectionObserver(u,t=>{t[0].isIntersecting&&(c.value=!0)},{threshold:.75}),e.onMounted(()=>{u.value=i.value[i.value.length-1].$el}),(t,n)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["py-lg lg:py-xl overflow-hidden",e.unref(s)("BGCOLOR",t.bgColor)])},[e.createElementVNode("div",C,[e.createElementVNode("div",b,[t.displayHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["hidden sm:block absolute w-md bg-opacity-25 -left-4 h-full",e.unref(s)("BGCOLOR",t.highlightColor)])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",y,[t.displayTagLine?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["tracking-widest",A(t.tagLineSize,t.tagLineColor,t.tagLineUpperCase)]),innerHTML:t.tagLine},null,10,x)):e.createCommentVNode("",!0),e.createElementVNode("h2",{class:e.normalizeClass(["tracking-wide",R(t.titleSize,t.titleColor)]),innerHTML:t.title},null,10,E)]),e.createElementVNode("div",L,[e.createElementVNode("div",w,[e.renderSlot(t.$slots,"description")]),e.createElementVNode("div",B,[e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",g(t.btnColor,t.btnBgColor)]),disabled:a.value===0,onClick:n[0]||(n[0]=l=>p(l,"prev")),"aria-label":"previous"},n[2]||(n[2]=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})],-1)]),10,T),e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center hover:bg-opacity-80 rounded-full p-xs focus:outline-none focus:ring-4 ring-offset-2 ring-offset-inherit disabled:opacity-50 transition-all duration-200",g(t.btnColor,t.btnBgColor)]),disabled:c.value,onClick:n[1]||(n[1]=l=>p(l,"next")),"aria-label":"next"},n[3]||(n[3]=[e.createElementVNode("svg",{class:"w-xs h-xs",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor"},[e.createElementVNode("path",{d:"M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})],-1)]),10,k)])])])]),e.createElementVNode("div",N,[e.createElementVNode("div",{class:e.normalizeClass(["flex transition-transform duration-500 px-xs gap-xs",e.unref(s)("GAP",t.cardsGap)]),ref_key:"slideContainer",ref:r},[e.renderSlot(t.$slots,"carousel",{cards:t.content,setRef:S})],2)])],2))}});o.MclCarouselA=V,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobbykim/mcl-carousel",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "carousel component based on @bobbykim/manguito-theme",
5
5
  "type": "module",
6
6
  "files": [
@@ -33,17 +33,17 @@
33
33
  },
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "@bobbykim/manguito-theme": "0.22.1",
37
- "@vueuse/core": "^10.8.0",
38
- "vue": "^3.3.10"
36
+ "@bobbykim/manguito-theme": "0.23.0",
37
+ "@vueuse/core": "^12.0.0",
38
+ "vue": "^3.5.13"
39
39
  },
40
40
  "devDependencies": {
41
- "@vitejs/plugin-vue": "^4.5.2",
42
- "typescript": "^5.3.3",
43
- "vite": "^4.5.1",
44
- "vite-plugin-css-injected-by-js": "^3.5.0",
45
- "vite-plugin-dts": "^3.8.3",
46
- "vue-tsc": "^1.8.25"
41
+ "@vitejs/plugin-vue": "^5.2.1",
42
+ "typescript": "^5.7.2",
43
+ "vite": "^6.0.3",
44
+ "vite-plugin-css-injected-by-js": "^3.5.2",
45
+ "vite-plugin-dts": "^4.3.0",
46
+ "vue-tsc": "^2.1.10"
47
47
  },
48
- "gitHead": "9b631d93e295d0a94a1bee83153c6671045221ef"
48
+ "gitHead": "0c86a1a70a33446112dafbaf5fce5fdcb5fdf755"
49
49
  }