@bobbykim/mcl-carousel 0.10.0 → 0.10.2
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/README.md +2 -2
- package/dist/mcl-carousel.js +8 -8
- package/dist/mcl-carousel.umd.cjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Demo
|
|
4
4
|
|
|
5
|
-
[MCL Storybook Page](https://manguito-component-library.
|
|
5
|
+
[MCL Storybook Page](https://manguito-component-library.bobbykim.dev/)
|
|
6
6
|
|
|
7
|
-
- [MCL Carousel A](https://manguito-component-library.
|
|
7
|
+
- [MCL Carousel A](https://manguito-component-library.bobbykim.dev/?path=/docs/sections-carousel-mclcarousela--mclcarousela)
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
package/dist/mcl-carousel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as E, ref as i, onMounted as H, openBlock as f, createElementBlock as v, normalizeClass as r, unref as x, createElementVNode as n, createCommentVNode as w, renderSlot as y } from "vue";
|
|
2
2
|
import { generateClass as l } from "@bobbykim/manguito-theme";
|
|
3
3
|
import { useEventListener as L, useIntersectionObserver as j } from "@vueuse/core";
|
|
4
|
-
const $ = { class: "px-xs sm:px-md
|
|
4
|
+
const $ = { class: "container px-xs text-center sm:px-md sm:text-left" }, G = { class: "relative" }, I = { class: "relative" }, N = ["innerHTML"], R = ["innerHTML"], U = { class: "relative flex flex-wrap items-center justify-center space-y-4 space-x-4 sm:flex-nowrap sm:justify-start" }, D = { class: "max-w-144" }, O = { class: "flex space-x-4" }, W = ["disabled"], X = ["disabled"], q = { class: "container mt-md sm:mt-lg lg:mt-xl" }, P = /* @__PURE__ */ E({
|
|
5
5
|
__name: "MclCarouselA",
|
|
6
6
|
props: {
|
|
7
7
|
title: {},
|
|
@@ -78,13 +78,13 @@ const $ = { class: "px-xs sm:px-md container text-center sm:text-left" }, G = {
|
|
|
78
78
|
), H(() => {
|
|
79
79
|
h.value = c.value[c.value.length - 1].$el;
|
|
80
80
|
}), (s, t) => (f(), v("section", {
|
|
81
|
-
class: r(["py-lg lg:py-xl
|
|
81
|
+
class: r(["overflow-hidden py-lg lg:py-xl", x(l).bgColorVariant({ color: e.bgColor })])
|
|
82
82
|
}, [
|
|
83
83
|
n("div", $, [
|
|
84
84
|
n("div", G, [
|
|
85
85
|
e.showHighlight ? (f(), v("div", {
|
|
86
86
|
key: 0,
|
|
87
|
-
class: r(["
|
|
87
|
+
class: r(["absolute -left-4 hidden h-full w-md bg-opacity-25 sm:block", x(l).bgColorVariant({ color: e.highlightColor })])
|
|
88
88
|
}, null, 2)) : w("", !0),
|
|
89
89
|
n("div", I, [
|
|
90
90
|
e.showTagLine ? (f(), v("span", {
|
|
@@ -106,13 +106,13 @@ const $ = { class: "px-xs sm:px-md container text-center sm:text-left" }, G = {
|
|
|
106
106
|
]),
|
|
107
107
|
n("div", O, [
|
|
108
108
|
n("button", {
|
|
109
|
-
class: r(["
|
|
109
|
+
class: r(["grid place-items-center rounded-full p-xs ring-offset-2 ring-offset-inherit transition-all duration-200 hover:bg-opacity-80 focus:ring-4 focus:outline-none disabled:opacity-50", b(e.btnColor, e.btnBgColor)]),
|
|
110
110
|
disabled: d.value === 0,
|
|
111
111
|
onClick: t[0] || (t[0] = (a) => C(a, "prev")),
|
|
112
112
|
"aria-label": "previous"
|
|
113
113
|
}, [...t[2] || (t[2] = [
|
|
114
114
|
n("svg", {
|
|
115
|
-
class: "
|
|
115
|
+
class: "h-xs w-xs",
|
|
116
116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
117
117
|
viewBox: "0 0 384 512",
|
|
118
118
|
fill: "currentColor"
|
|
@@ -121,13 +121,13 @@ const $ = { class: "px-xs sm:px-md container text-center sm:text-left" }, G = {
|
|
|
121
121
|
], -1)
|
|
122
122
|
])], 10, W),
|
|
123
123
|
n("button", {
|
|
124
|
-
class: r(["
|
|
124
|
+
class: r(["grid place-items-center rounded-full p-xs ring-offset-2 ring-offset-inherit transition-all duration-200 hover:bg-opacity-80 focus:ring-4 focus:outline-none disabled:opacity-50", b(e.btnColor, e.btnBgColor)]),
|
|
125
125
|
disabled: u.value,
|
|
126
126
|
onClick: t[1] || (t[1] = (a) => C(a, "next")),
|
|
127
127
|
"aria-label": "next"
|
|
128
128
|
}, [...t[3] || (t[3] = [
|
|
129
129
|
n("svg", {
|
|
130
|
-
class: "
|
|
130
|
+
class: "h-xs w-xs",
|
|
131
131
|
xmlns: "http://www.w3.org/2000/svg",
|
|
132
132
|
viewBox: "0 0 384 512",
|
|
133
133
|
fill: "currentColor"
|
|
@@ -141,7 +141,7 @@ const $ = { class: "px-xs sm:px-md container text-center sm:text-left" }, G = {
|
|
|
141
141
|
]),
|
|
142
142
|
n("div", q, [
|
|
143
143
|
n("div", {
|
|
144
|
-
class: r(["
|
|
144
|
+
class: r(["flex gap-xs px-xs transition-transform duration-500", x(l).gapVariant({ spacing: e.cardsGap })]),
|
|
145
145
|
ref_key: "slideContainer",
|
|
146
146
|
ref: o
|
|
147
147
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,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):(a=typeof globalThis<"u"?globalThis:a||self,e(a.MclCarousel={},a.Vue,a.ManguitoTheme,a.core))})(this,(function(a,e,l,d){"use strict";const b={class:"px-xs sm:px-md
|
|
1
|
+
(function(a,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):(a=typeof globalThis<"u"?globalThis:a||self,e(a.MclCarousel={},a.Vue,a.ManguitoTheme,a.core))})(this,(function(a,e,l,d){"use strict";const b={class:"container px-xs text-center sm:px-md sm:text-left"},p={class:"relative"},y={class:"relative"},V=["innerHTML"],w=["innerHTML"],E={class:"relative flex flex-wrap items-center justify-center space-y-4 space-x-4 sm:flex-nowrap sm:justify-start"},k={class:"max-w-144"},L={class:"flex space-x-4"},N=["disabled"],B=["disabled"],M={class:"container mt-md sm:mt-lg lg:mt-xl"},z=e.defineComponent({__name:"MclCarouselA",props:{title:{},titleSize:{default:"md"},titleColor:{default:"dark-3"},bgColor:{default:"light-1"},showTagLine:{type:Boolean,default:!0},tagLineUpperCase:{type:Boolean,default:!0},tagLine:{},tagLineSize:{default:"md"},tagLineColor:{default:"dark-1"},showHighlight:{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(t,{emit:v}){const S=t,o=e.ref(null),i=e.ref([]),g=e.ref(),C=v,c=e.ref(0),f=e.ref(!1);let u=!1;const j=s=>{switch(s){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}},A=s=>{i.value.push(s)},m=(s,n)=>{u||(u=!0,n==="prev"&&(c.value--,C("btn-prev",s)),n==="next"&&(c.value++,C("btn-next",s)),o.value?.dispatchEvent(new Event("sliderMove")))},H=(s,n)=>[l.generateClass.h2Variant({size:s}),l.generateClass.textColorVariant({color:n})].join(" "),T=(s,n,r)=>{const h=[l.generateClass.bodyTextVariant({size:s}),l.generateClass.textColorVariant({color:n})];return r&&h.push("uppercase"),h.join(" ")},x=(s,n)=>[l.generateClass.textColorVariant({color:s}),l.generateClass.bgColorVariant({color:n}),l.generateClass.ringColorVariant({color:n})].join(" "),$=()=>{o.value.style.transform=`translateX(-${c.value*(i.value[0].$el.clientWidth+j(S.cardsGap)+2)}px)`,f.value=!1},q=()=>{u=!1};return d.useEventListener(o,"sliderMove",$),d.useEventListener(o,"transitionend",q),d.useIntersectionObserver(g,s=>{s[0].isIntersecting&&(f.value=!0)},{threshold:.75}),e.onMounted(()=>{g.value=i.value[i.value.length-1].$el}),(s,n)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["overflow-hidden py-lg lg:py-xl",e.unref(l.generateClass).bgColorVariant({color:t.bgColor})])},[e.createElementVNode("div",b,[e.createElementVNode("div",p,[t.showHighlight?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute -left-4 hidden h-full w-md bg-opacity-25 sm:block",e.unref(l.generateClass).bgColorVariant({color:t.highlightColor})])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",y,[t.showTagLine?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["tracking-widest",T(t.tagLineSize,t.tagLineColor,t.tagLineUpperCase)]),innerHTML:t.tagLine},null,10,V)):e.createCommentVNode("",!0),e.createElementVNode("h2",{class:e.normalizeClass(["tracking-wide",H(t.titleSize,t.titleColor)]),innerHTML:t.title},null,10,w)]),e.createElementVNode("div",E,[e.createElementVNode("div",k,[e.renderSlot(s.$slots,"description")]),e.createElementVNode("div",L,[e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center rounded-full p-xs ring-offset-2 ring-offset-inherit transition-all duration-200 hover:bg-opacity-80 focus:ring-4 focus:outline-none disabled:opacity-50",x(t.btnColor,t.btnBgColor)]),disabled:c.value===0,onClick:n[0]||(n[0]=r=>m(r,"prev")),"aria-label":"previous"},[...n[2]||(n[2]=[e.createElementVNode("svg",{class:"h-xs w-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,N),e.createElementVNode("button",{class:e.normalizeClass(["grid place-items-center rounded-full p-xs ring-offset-2 ring-offset-inherit transition-all duration-200 hover:bg-opacity-80 focus:ring-4 focus:outline-none disabled:opacity-50",x(t.btnColor,t.btnBgColor)]),disabled:f.value,onClick:n[1]||(n[1]=r=>m(r,"next")),"aria-label":"next"},[...n[3]||(n[3]=[e.createElementVNode("svg",{class:"h-xs w-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,B)])])])]),e.createElementVNode("div",M,[e.createElementVNode("div",{class:e.normalizeClass(["flex gap-xs px-xs transition-transform duration-500",e.unref(l.generateClass).gapVariant({spacing:t.cardsGap})]),ref_key:"slideContainer",ref:o},[e.renderSlot(s.$slots,"carousel",{cards:t.content,setRef:A})],2)])],2))}});a.MclCarouselA=z,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-carousel",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "carousel component based on @bobbykim/manguito-theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"name": "Bobby Kim",
|
|
21
21
|
"url": "https://www.devbobbykim.com/"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://manguito-component-library.
|
|
23
|
+
"homepage": "https://manguito-component-library.bobbykim.dev/",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@vueuse/core": "^12.0.0",
|
|
34
34
|
"vue": "^3.5.13",
|
|
35
|
-
"@bobbykim/manguito-theme": "1.0.
|
|
35
|
+
"@bobbykim/manguito-theme": "1.0.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@vitejs/plugin-vue": "^5.2.1",
|