@danielcruzcode/ui-core 0.1.4 → 0.1.6
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/components/Carousel/Carousel.d.ts +2 -1
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +87 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs12.js +2 -2
- package/dist/index.cjs13.js +2 -2
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs17.js +1 -0
- package/dist/index.cjs18.js +1 -0
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs5.js +2 -2
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +2 -2
- package/dist/index.cjs9.js +3 -3
- package/dist/index.esm10.js +1 -1
- package/dist/index.esm11.js +1 -1
- package/dist/index.esm12.js +1 -1
- package/dist/index.esm13.js +1 -1
- package/dist/index.esm14.js +45 -22
- package/dist/index.esm15.js +21 -32
- package/dist/index.esm16.js +32 -1201
- package/dist/index.esm17.js +1204 -0
- package/dist/index.esm18.js +52 -0
- package/dist/index.esm2.js +1 -1
- package/dist/index.esm3.js +1 -1
- package/dist/index.esm4.js +1 -1
- package/dist/index.esm5.js +1 -1
- package/dist/index.esm6.js +1 -1
- package/dist/index.esm7.js +1 -1
- package/dist/index.esm8.js +1 -1
- package/dist/index.esm9.js +76 -60
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export interface CarouselProps {
|
|
|
9
9
|
children: React.ReactNode[];
|
|
10
10
|
autoplay?: boolean;
|
|
11
11
|
autoplayMs?: number;
|
|
12
|
+
pauseOnHover?: boolean;
|
|
12
13
|
showArrows?: boolean;
|
|
13
14
|
showDots?: boolean;
|
|
14
15
|
loop?: boolean;
|
|
@@ -17,6 +18,6 @@ export interface CarouselProps {
|
|
|
17
18
|
gap?: keyof typeof tokens.space;
|
|
18
19
|
onSlideChange?: (index: number) => void;
|
|
19
20
|
}
|
|
20
|
-
export declare function Carousel({ children, autoplay, autoplayMs, showArrows, showDots, loop, slidesPerView, slidesPerGroup, gap, onSlideChange, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function Carousel({ children, autoplay, autoplayMs, pauseOnHover, showArrows, showDots, loop, slidesPerView, slidesPerGroup, gap, onSlideChange, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,KAAK,aAAa,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,KAAK,CAAA;IAC/B,aAAa,CAAC,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Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import { tokens } from '@danielcruzcode/design-tokens';
|
|
4
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
+
const GAP_PX = { sm: 8, md: 16, lg: 24, xl: 32 };
|
|
7
|
+
function getSpv(slidesPerView, width) {
|
|
8
|
+
if (typeof slidesPerView === 'number')
|
|
9
|
+
return slidesPerView;
|
|
10
|
+
if (width >= 1024)
|
|
11
|
+
return slidesPerView.desktop;
|
|
12
|
+
if (width >= 640)
|
|
13
|
+
return slidesPerView.tablet;
|
|
14
|
+
return slidesPerView.mobile;
|
|
15
|
+
}
|
|
16
|
+
const ArrowBtn = styled.button `
|
|
17
|
+
position:absolute;top:50%;transform:translateY(-50%);z-index:10;
|
|
18
|
+
display:flex;align-items:center;justify-content:center;
|
|
19
|
+
width:36px;height:36px;border-radius:${tokens.radius.full};
|
|
20
|
+
border:1px solid ${tokens.color.border};background-color:${tokens.color.background};
|
|
21
|
+
color:${tokens.color.text};cursor:pointer;box-shadow:${tokens.shadow.sm};
|
|
22
|
+
transition:box-shadow ${tokens.transition.fast};
|
|
23
|
+
&:hover{box-shadow:${tokens.shadow.md};}
|
|
24
|
+
&:focus-visible{outline:2px solid ${tokens.color.borderFocus};outline-offset:2px;}
|
|
25
|
+
&:disabled{opacity:0.4;cursor:not-allowed;}
|
|
26
|
+
`;
|
|
27
|
+
const ArrowPrev = styled(ArrowBtn) `left:${tokens.space.sm};`;
|
|
28
|
+
const ArrowNext = styled(ArrowBtn) `right:${tokens.space.sm};`;
|
|
29
|
+
const Dot = styled.button `
|
|
30
|
+
width:${({ active }) => (active ? '20px' : '8px')};height:8px;
|
|
31
|
+
border-radius:${tokens.radius.full};
|
|
32
|
+
background-color:${({ active }) => (active ? tokens.color.brand : tokens.color.border)};
|
|
33
|
+
border:none;cursor:pointer;padding:0;
|
|
34
|
+
transition:background-color ${tokens.transition.fast},width ${tokens.transition.fast};
|
|
35
|
+
&:focus-visible{outline:2px solid ${tokens.color.borderFocus};outline-offset:2px;}
|
|
36
|
+
`;
|
|
37
|
+
const Dots = styled.div `display:flex;justify-content:center;gap:${tokens.space.sm};margin-top:${tokens.space.sm};`;
|
|
38
|
+
export function Carousel({ children, autoplay = false, autoplayMs = 4000, pauseOnHover = true, showArrows = true, showDots = true, loop = false, slidesPerView = 1, slidesPerGroup = 1, gap, onSlideChange, }) {
|
|
39
|
+
const gapPx = gap ? (GAP_PX[gap] ?? 0) : 0;
|
|
40
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({ loop, slidesToScroll: slidesPerGroup, align: 'start' });
|
|
41
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
42
|
+
const [scrollSnaps, setScrollSnaps] = useState([]);
|
|
43
|
+
const [hovered, setHovered] = useState(false);
|
|
44
|
+
const slidesPerViewRef = useRef(slidesPerView);
|
|
45
|
+
slidesPerViewRef.current = slidesPerView;
|
|
46
|
+
const containerRef = useRef(null);
|
|
47
|
+
const [spv, setSpv] = useState(1);
|
|
48
|
+
// Use ResizeObserver on the container — reliable in iframes and custom viewports
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const el = containerRef.current;
|
|
51
|
+
if (!el)
|
|
52
|
+
return;
|
|
53
|
+
const ro = new ResizeObserver(([entry]) => {
|
|
54
|
+
const width = entry.contentRect.width;
|
|
55
|
+
setSpv(getSpv(slidesPerViewRef.current, width));
|
|
56
|
+
});
|
|
57
|
+
ro.observe(el);
|
|
58
|
+
return () => ro.disconnect();
|
|
59
|
+
}, []);
|
|
60
|
+
const onSelect = useCallback(() => {
|
|
61
|
+
if (!emblaApi)
|
|
62
|
+
return;
|
|
63
|
+
const index = emblaApi.selectedScrollSnap();
|
|
64
|
+
setSelectedIndex(index);
|
|
65
|
+
onSlideChange?.(index);
|
|
66
|
+
}, [emblaApi, onSlideChange]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!emblaApi)
|
|
69
|
+
return;
|
|
70
|
+
setScrollSnaps(emblaApi.scrollSnapList());
|
|
71
|
+
emblaApi.on('select', onSelect);
|
|
72
|
+
emblaApi.on('reInit', onSelect);
|
|
73
|
+
return () => { emblaApi.off('select', onSelect); emblaApi.off('reInit', onSelect); };
|
|
74
|
+
}, [emblaApi, onSelect]);
|
|
75
|
+
useEffect(() => { emblaApi?.reInit(); }, [emblaApi, spv]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!autoplay || !emblaApi)
|
|
78
|
+
return;
|
|
79
|
+
if (pauseOnHover && hovered)
|
|
80
|
+
return;
|
|
81
|
+
const id = setInterval(() => emblaApi.scrollNext(), autoplayMs);
|
|
82
|
+
return () => clearInterval(id);
|
|
83
|
+
}, [autoplay, autoplayMs, emblaApi, pauseOnHover, hovered]);
|
|
84
|
+
const slideWidth = `calc((100% - ${gapPx * (spv - 1)}px) / ${spv})`;
|
|
85
|
+
return (_jsxs("div", { ref: containerRef, style: { position: 'relative', width: '100%' }, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [_jsx("div", { ref: emblaRef, style: { overflow: 'hidden' }, children: _jsx("div", { style: { display: 'flex', gap: gapPx }, children: children.map((child, i) => (_jsx("div", { style: { flex: `0 0 ${slideWidth}`, minWidth: 0 }, children: child }, i))) }) }), showArrows && (_jsxs(_Fragment, { children: [_jsx(ArrowPrev, { type: "button", "aria-label": "Slide anterior", onClick: () => emblaApi?.scrollPrev(), children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M10 12L6 8l4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), _jsx(ArrowNext, { type: "button", "aria-label": "Slide siguiente", onClick: () => emblaApi?.scrollNext(), children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M6 4l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })), showDots && (_jsx(Dots, { children: scrollSnaps.map((_, i) => (_jsx(Dot, { active: i === selectedIndex, type: "button", onClick: () => emblaApi?.scrollTo(i), "aria-label": `Ir al slide ${i + 1}` }, i))) }))] }));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=Carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AAEnD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAkBhE,MAAM,MAAM,GAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AAExE,SAAS,MAAM,CAAC,aAA4B,EAAE,KAAa;IACzD,IAAI,OAAO,aAAa,KAAK,QAAQ;QAAE,OAAO,aAAa,CAAA;IAC3D,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,aAAa,CAAC,OAAO,CAAA;IAC/C,IAAI,KAAK,IAAI,GAAG;QAAE,OAAO,aAAa,CAAC,MAAM,CAAA;IAC7C,OAAO,aAAa,CAAC,MAAM,CAAA;AAC7B,CAAC;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAA;;;yCAGW,MAAM,CAAC,MAAM,CAAC,IAAI;qBACtC,MAAM,CAAC,KAAK,CAAC,MAAM,qBAAqB,MAAM,CAAC,KAAK,CAAC,UAAU;UAC1E,MAAM,CAAC,KAAK,CAAC,IAAI,8BAA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GAC5G,GACI,EACZ,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,gBAAY,iBAAiB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YACzF,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,YAC5E,eAAM,CAAC,EAAC,cAAc,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,GAAG,GAC1G,GACI,IACX,CACJ,EACA,QAAQ,IAAI,CACX,KAAC,IAAI,cACF,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACzB,KAAC,GAAG,IAAS,MAAM,EAAE,CAAC,KAAK,aAAa,EAAE,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,gBAAc,eAAe,CAAC,GAAG,CAAC,EAAE,IAAtH,CAAC,CAAyH,CACrI,CAAC,GACG,CACR,IACG,CACP,CAAA;AACH,CAAC"}
|
package/dist/index.cjs10.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@emotion/styled"),I=require("@emotion/react"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@emotion/styled"),I=require("@emotion/react"),o=require("./index.cjs14.js"),O=require("./index.cjs8.js"),w=require("./index.cjs3.js"),A=require("./index.cjs2.js"),R=I.keyframes`0%{background-position:-200% 0}100%{background-position:200% 0}`,P=t.div`display:flex;flex-direction:column;height:100%;`,B=t.div`position:relative;width:100%;padding-top:100%;overflow:hidden;background-color:${o.tokens.color.surface};`,T=t.img`position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform ${o.tokens.transition.normal};${B}:hover &{transform:scale(1.04);}`,U=t.div`position:absolute;top:${o.tokens.space.sm};left:${o.tokens.space.sm};display:flex;flex-direction:column;gap:4px;`,H=t.button`position:absolute;top:${o.tokens.space.sm};right:${o.tokens.space.sm};width:32px;height:32px;border-radius:${o.tokens.radius.full};border:1px solid ${o.tokens.color.border};background-color:${o.tokens.color.background};display:flex;align-items:center;justify-content:center;cursor:pointer;color:${o.tokens.color.textMuted};transition:color ${o.tokens.transition.fast},border-color ${o.tokens.transition.fast};&:hover{color:${o.tokens.color.danger};border-color:${o.tokens.color.danger};}&:focus-visible{outline:2px solid ${o.tokens.color.borderFocus};outline-offset:2px;}`,V=t.div`position:absolute;inset:0;background-color:rgba(255,255,255,0.7);display:flex;align-items:center;justify-content:center;`,_=t.span`font-family:${o.tokens.font.body};font-size:13px;font-weight:600;color:${o.tokens.color.textMuted};`,E=t.div`display:flex;flex-direction:column;gap:4px;padding:${o.tokens.space.sm};flex:1;`,G=t.p`font-family:${o.tokens.font.body};font-size:14px;font-weight:500;color:${o.tokens.color.text};display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4;margin:0;height:2.5rem;`,J=t.p`font-family:${o.tokens.font.body};font-size:12px;color:${o.tokens.color.textMuted};margin:0;`,z=t.div`display:flex;align-items:center;gap:4px;`,K=t.span`font-family:${o.tokens.font.body};font-size:12px;color:${o.tokens.color.textMuted};`,N=t.div`display:flex;align-items:baseline;gap:${o.tokens.space.sm};flex-wrap:wrap;margin-top:auto;`,Q=t.span`font-family:${o.tokens.font.body};font-size:18px;font-weight:700;color:${o.tokens.color.text};`,X=t.span`font-family:${o.tokens.font.body};font-size:13px;color:${o.tokens.color.textMuted};text-decoration:line-through;`,Y=t.span`font-family:${o.tokens.font.body};font-size:12px;color:${o.tokens.color.textMuted};`,Z=t.div`display:flex;flex-direction:column;gap:${o.tokens.space.sm};padding:0 ${o.tokens.space.sm} ${o.tokens.space.sm};`,D=t.button`background:none;border:none;cursor:pointer;font-family:${o.tokens.font.body};font-size:13px;color:${o.tokens.color.brand};padding:0;text-align:center;&:hover{text-decoration:underline;}&:focus-visible{outline:2px solid ${o.tokens.color.borderFocus};outline-offset:2px;}`,u=t.div`border-radius:${o.tokens.radius.md};background:linear-gradient(90deg,${o.tokens.color.surface} 25%,${o.tokens.color.surfaceHover} 50%,${o.tokens.color.surface} 75%);background-size:200% 100%;animation:${R} 1.5s ease-in-out infinite;`,oo=t(u)`width:100%;padding-top:100%;`,x=t(u)`height:14px;border-radius:${o.tokens.radius.sm};`,eo=t(u)`height:40px;border-radius:${o.tokens.radius.md};`;function to({rating:n}){return e.jsx(z,{"aria-label":`${n} de 5 estrellas`,role:"img",children:Array.from({length:5}).map((l,r)=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r<Math.round(n)?"#F9AB00":"none",stroke:"#F9AB00",strokeWidth:"1","aria-hidden":"true",children:e.jsx("path",{d:"M6 1l1.39 2.82L10.5 4.27l-2.25 2.19.53 3.09L6 8l-2.78 1.55.53-3.09L1.5 4.27l3.11-.45L6 1z"})},r))})}function no(){return e.jsxs("article",{"aria-label":"Cargando producto","aria-busy":"true",children:[e.jsx(oo,{}),e.jsxs("div",{style:{padding:"8px",display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(x,{style:{width:"100%"}}),e.jsx(x,{style:{width:"70%"}}),e.jsx(x,{style:{width:"50%"}}),e.jsx(eo,{})]})]})}function so({id:n,title:l,subtitle:r,images:S,price:f,originalPrice:a,discountPercent:h,badge:g,rating:k,reviewCount:b,installments:i,unavailable:m=!1,loading:C=!1,onAddToCart:y,onWishlist:$,onQuickView:j,onClick:d,formatPrice:s,className:M}){if(C)return e.jsx(no,{});const q=s?s(f):String(f),v=a?s?s(a):String(a):void 0,c=S[0],L=e.jsxs(B,{children:[c&&e.jsx(T,{src:c.src,alt:c.alt,width:100,height:100,loading:"lazy"}),e.jsxs(U,{children:[h!==void 0&&e.jsxs(w.Badge,{variant:"danger",size:"sm",children:["-",h,"%"]}),g&&e.jsx(w.Badge,{variant:"brand",size:"sm",children:g})]}),$&&e.jsx(H,{type:"button",onClick:p=>{p.stopPropagation(),$(n)},"aria-label":`Agregar ${l} a favoritos`,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:e.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}),m&&e.jsx(V,{children:e.jsx(_,{children:"Sin stock"})})]}),W=e.jsxs(E,{children:[e.jsx(G,{children:l}),r&&e.jsx(J,{children:r}),k!==void 0&&e.jsxs(z,{children:[e.jsx(to,{rating:k}),b!==void 0&&e.jsxs(K,{children:["(",b,")"]})]}),e.jsxs(N,{children:[e.jsx(Q,{children:q}),v&&e.jsx(X,{children:v})]}),i&&e.jsxs(Y,{children:[i.count,"x ",s?s(i.value):i.value]})]}),F=e.jsxs(Z,{children:[y&&e.jsx(A.Button,{variant:"primary",size:"sm",fullWidth:!0,disabled:m,onClick:()=>y(n),children:"Agregar"}),j&&e.jsx(D,{type:"button",onClick:p=>{p.stopPropagation(),j(n)},children:"Vista rápida"})]});return e.jsx(P,{className:M,children:e.jsx(O.Card,{media:L,body:W,footer:F,hoverable:!!d,onClick:d?()=>d(n):void 0})})}exports.ProductCard=so;
|
package/dist/index.cjs11.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty,b=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var
|
|
1
|
+
"use strict";var P=Object.defineProperty,b=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var i=(r,e,o)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,a=(r,e)=>{for(var o in e||(e={}))C.call(e,o)&&i(r,o,e[o]);if(c)for(var o of c(e))S.call(e,o)&&i(r,o,e[o]);return r},l=(r,e)=>b(r,q(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("@emotion/styled"),n=require("./index.cjs14.js"),$=require("./index.cjs9.js"),w=require("./index.cjs10.js"),A=d.section`display:flex;flex-direction:column;gap:${n.tokens.space.md};`,R=d.h2`font-family:${n.tokens.font.display};font-size:24px;color:${n.tokens.color.text};margin:0;letter-spacing:0.02em;`;function v({products:r,title:e,autoplay:o=!1,autoplayMs:u=4e3,slidesPerView:m={mobile:1,tablet:2,desktop:4},onAddToCart:f,onWishlist:p,onProductClick:g,formatPrice:h,loading:x=!1,skeletonCount:k=4}){const y=x?Array.from({length:k}).map((t,j)=>({id:`skeleton-${j}`,title:"",images:[],price:0,loading:!0})):r;return s.jsxs(A,{"aria-label":e!=null?e:"Productos",children:[e&&s.jsx(R,{children:e}),s.jsx($.Carousel,{autoplay:o,autoplayMs:u,slidesPerView:m,gap:"md",showArrows:!0,showDots:!0,loop:!0,children:y.map(t=>s.jsx(w.ProductCard,l(a({},t),{onAddToCart:f,onWishlist:p,onClick:g,formatPrice:h}),t.id))})]})}exports.ProductShelf=v;
|
package/dist/index.cjs12.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),i=require("@emotion/styled"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),i=require("@emotion/styled"),o=require("./index.cjs14.js"),l={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"},a=i.div`
|
|
2
2
|
display:flex;flex-direction:column;
|
|
3
3
|
align-items:${({align:e})=>l[e]};
|
|
4
4
|
gap:${({gap:e})=>e?o.tokens.space[e]:"0"};
|
|
5
|
-
`;function
|
|
5
|
+
`;function u({gap:e,align:t="stretch",children:n,as:r,className:s}){return c.jsx(a,{as:r,gap:e,align:t,className:s,children:n})}exports.Stack=u;
|
package/dist/index.cjs13.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("@emotion/styled"),e=require("./index.cjs14.js"),o={sm:"640px",md:"768px",lg:"1024px",xl:"1280px",full:"100%"},r=s.div`
|
|
2
2
|
width:100%;margin-inline:auto;padding-inline:${e.tokens.space.md};
|
|
3
3
|
max-width:${({maxWidth:n})=>o[n]};
|
|
4
4
|
@media screen and (min-width:640px){padding-inline:${e.tokens.space.lg};}
|
|
5
5
|
@media screen and (min-width:1024px){padding-inline:${e.tokens.space.xl};}
|
|
6
|
-
`;function l({maxWidth:n="xl",children:i,as:t,className:d}){return
|
|
6
|
+
`;function l({maxWidth:n="xl",children:i,as:t,className:d}){return a.jsx(r,{as:t,maxWidth:n,className:d,children:i})}exports.Container=l;
|
package/dist/index.cjs14.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index.cjs18.js"),r={color:{background:i.primitives.color.neutral[0],surface:i.primitives.color.neutral[100],surfaceHover:i.primitives.color.neutral[300],border:i.primitives.color.neutral[300],borderFocus:i.primitives.color.green[500],text:i.primitives.color.neutral[900],textMuted:i.primitives.color.neutral[700],brand:i.primitives.color.green[500],brandHover:i.primitives.color.green[600],brandSubtle:i.primitives.color.green[100],success:i.primitives.color.green[500],successSubtle:i.primitives.color.green[100],warning:i.primitives.color.yellow[500],warningSubtle:i.primitives.color.yellow[100],danger:i.primitives.color.red[500],dangerSubtle:i.primitives.color.red[100]},space:{sm:i.primitives.space[2],md:i.primitives.space[4],lg:i.primitives.space[6],xl:i.primitives.space[8]},radius:{sm:i.primitives.radius.sm,md:i.primitives.radius.md,full:i.primitives.radius.full},font:{body:i.primitives.font.family.body,display:i.primitives.font.family.display},shadow:{sm:i.primitives.shadow.sm,md:i.primitives.shadow.md},transition:{fast:i.primitives.transition.fast,normal:i.primitives.transition.normal}};exports.tokens=r;
|
package/dist/index.cjs15.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("react"),o=require("./index.cjs16.js"),b=require("./index.cjs17.js");function l(t={},r=[]){const s=e.useRef(t),n=e.useRef(r),[u,a]=e.useState(),[i,m]=e.useState(),c=e.useCallback(()=>{u&&u.reInit(s.current,n.current)},[u]);return e.useEffect(()=>{o.areOptionsEqual(s.current,t)||(s.current=t,c())},[t,c]),e.useEffect(()=>{o.arePluginsEqual(n.current,r)||(n.current=r,c())},[r,c]),e.useEffect(()=>{if(o.canUseDOM()&&i){b.globalOptions=l.globalOptions;const f=b(i,s.current,n.current);return a(f),()=>f.destroy()}else a(void 0)},[i,a]),[m,u]}l.globalOptions=void 0;module.exports=l;
|
package/dist/index.cjs16.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function Tt(t){return typeof t=="number"}function Lt(t){return typeof t=="string"}function gt(t){return typeof t=="boolean"}function zt(t){return Object.prototype.toString.call(t)==="[object Object]"}function P(t){return Math.abs(t)}function It(t){return Math.sign(t)}function ft(t,n){return P(t-n)}function Jt(t,n){if(t===0||n===0||P(t)<=P(n))return 0;const s=ft(P(t),P(n));return P(s/t)}function Zt(t){return Math.round(t*100)/100}function at(t){return lt(t).map(Number)}function k(t){return t[pt(t)]}function pt(t){return Math.max(0,t.length-1)}function vt(t,n){return n===pt(t)}function Bt(t,n=0){return Array.from(Array(t),(s,r)=>n+r)}function lt(t){return Object.keys(t)}function kt(t,n){return[t,n].reduce((s,r)=>(lt(r).forEach(c=>{const o=s[c],e=r[c],f=zt(o)&&zt(e);s[c]=f?kt(o,e):e}),s),{})}function Et(t,n){return typeof n.MouseEvent!="undefined"&&t instanceof n.MouseEvent}function Wt(t,n){const s={start:r,center:c,end:o};function r(){return 0}function c(i){return o(i)/2}function o(i){return n-i}function e(i,u){return Lt(t)?s[t](i):t(n,i,u)}return{measure:e}}function dt(){let t=[];function n(c,o,e,f={passive:!0}){let i;if("addEventListener"in c)c.addEventListener(o,e,f),i=()=>c.removeEventListener(o,e,f);else{const u=c;u.addListener(e),i=()=>u.removeListener(e)}return t.push(i),r}function s(){t=t.filter(c=>c())}const r={add:n,clear:s};return r}function tn(t,n,s,r){const c=dt(),o=1e3/60;let e=null,f=0,i=0;function u(){c.add(t,"visibilitychange",()=>{t.hidden&&l()})}function h(){b(),c.clear()}function d(g){if(!i)return;e||(e=g,s(),s());const a=g-e;for(e=g,f+=a;f>=o;)s(),f-=o;const S=f/o;r(S),i&&(i=n.requestAnimationFrame(d))}function p(){i||(i=n.requestAnimationFrame(d))}function b(){n.cancelAnimationFrame(i),e=null,f=0,i=0}function l(){e=null,f=0}return{init:u,destroy:h,start:p,stop:b,update:s,render:r}}function nn(t,n){const s=n==="rtl",r=t==="y",c=r?"y":"x",o=r?"x":"y",e=!r&&s?-1:1,f=h(),i=d();function u(l){const{height:m,width:g}=l;return r?m:g}function h(){return r?"top":s?"right":"left"}function d(){return r?"bottom":s?"left":"right"}function p(l){return l*e}return{scroll:c,cross:o,startEdge:f,endEdge:i,measureSize:u,direction:p}}function tt(t=0,n=0){const s=P(t-n);function r(u){return u<t}function c(u){return u>n}function o(u){return r(u)||c(u)}function e(u){return o(u)?r(u)?t:n:u}function f(u){return s?u-s*Math.ceil((u-n)/s):u}return{length:s,max:n,min:t,constrain:e,reachedAny:o,reachedMax:c,reachedMin:r,removeOffset:f}}function Gt(t,n,s){const{constrain:r}=tt(0,t),c=t+1;let o=e(n);function e(p){return s?P((c+p)%c):r(p)}function f(){return o}function i(p){return o=e(p),d}function u(p){return h().set(f()+p)}function h(){return Gt(t,f(),s)}const d={get:f,set:i,add:u,clone:h};return d}function en(t,n,s,r,c,o,e,f,i,u,h,d,p,b,l,m,g,a,S){const{cross:x,direction:T}=t,M=["INPUT","SELECT","TEXTAREA"],I={passive:!1},L=dt(),E=dt(),v=tt(50,225).constrain(b.measure(20)),C={mouse:300,touch:400},D={mouse:500,touch:600},V=l?43:25;let G=!1,H=0,j=0,J=!1,Y=!1,U=!1,$=!1;function st(y){if(!S)return;function A(N){(gt(S)||S(y,N))&&it(N)}const O=n;L.add(O,"dragstart",N=>N.preventDefault(),I).add(O,"touchmove",()=>{},I).add(O,"touchend",()=>{}).add(O,"touchstart",A).add(O,"mousedown",A).add(O,"touchcancel",w).add(O,"contextmenu",w).add(O,"click",K,!0)}function R(){L.clear(),E.clear()}function nt(){const y=$?s:n;E.add(y,"touchmove",z,I).add(y,"touchend",w).add(y,"mousemove",z,I).add(y,"mouseup",w)}function et(y){const A=y.nodeName||"";return M.includes(A)}function Q(){return(l?D:C)[$?"mouse":"touch"]}function rt(y,A){const O=d.add(It(y)*-1),N=h.byDistance(y,!l).distance;return l||P(y)<v?N:g&&A?N*.5:h.byIndex(O.get(),0).distance}function it(y){const A=Et(y,r);$=A,U=l&&A&&!y.buttons&&G,G=ft(c.get(),e.get())>=2,!(A&&y.button!==0)&&(et(y.target)||(J=!0,o.pointerDown(y),u.useFriction(0).useDuration(0),c.set(e),nt(),H=o.readPoint(y),j=o.readPoint(y,x),p.emit("pointerDown")))}function z(y){if(!Et(y,r)&&y.touches.length>=2)return w(y);const O=o.readPoint(y),N=o.readPoint(y,x),q=ft(O,H),X=ft(N,j);if(!Y&&!$&&(!y.cancelable||(Y=q>X,!Y)))return w(y);const Z=o.pointerMove(y);q>m&&(U=!0),u.useFriction(.3).useDuration(.75),f.start(),c.add(T(Z)),y.preventDefault()}function w(y){const O=h.byDistance(0,!1).index!==d.get(),N=o.pointerUp(y)*Q(),q=rt(T(N),O),X=Jt(N,q),Z=V-10*X,_=a+X/50;Y=!1,J=!1,E.clear(),u.useDuration(Z).useFriction(_),i.distance(q,!l),$=!1,p.emit("pointerUp")}function K(y){U&&(y.stopPropagation(),y.preventDefault(),U=!1)}function B(){return J}return{init:st,destroy:R,pointerDown:B}}function on(t,n){let r,c;function o(d){return d.timeStamp}function e(d,p){const l=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(Et(d,n)?d:d.touches[0])[l]}function f(d){return r=d,c=d,e(d)}function i(d){const p=e(d)-e(c),b=o(d)-o(r)>170;return c=d,b&&(r=d),p}function u(d){if(!r||!c)return 0;const p=e(c)-e(r),b=o(d)-o(r),l=o(d)-o(c)>170,m=p/b;return b&&!l&&P(m)>.1?m:0}return{pointerDown:f,pointerMove:i,pointerUp:u,readPoint:e}}function sn(){function t(s){const{offsetTop:r,offsetLeft:c,offsetWidth:o,offsetHeight:e}=s;return{top:r,right:c+o,bottom:r+e,left:c,width:o,height:e}}return{measure:t}}function rn(t){function n(r){return t*(r/100)}return{measure:n}}function cn(t,n,s,r,c,o,e){const f=[t].concat(r);let i,u,h=[],d=!1;function p(g){return c.measureSize(e.measure(g))}function b(g){if(!o)return;u=p(t),h=r.map(p);function a(S){for(const x of S){if(d)return;const T=x.target===t,M=r.indexOf(x.target),I=T?u:h[M],L=p(T?t:r[M]);if(P(L-I)>=.5){g.reInit(),n.emit("resize");break}}}i=new ResizeObserver(S=>{(gt(o)||o(g,S))&&a(S)}),s.requestAnimationFrame(()=>{f.forEach(S=>i.observe(S))})}function l(){d=!0,i&&i.disconnect()}return{init:b,destroy:l}}function un(t,n,s,r,c,o){let e=0,f=0,i=c,u=o,h=t.get(),d=0;function p(){const I=r.get()-t.get(),L=!i;let E=0;return L?(e=0,s.set(r),t.set(r),E=I):(s.set(t),e+=I/i,e*=u,h+=e,t.add(e),E=h-d),f=It(E),d=h,M}function b(){const I=r.get()-n.get();return P(I)<.001}function l(){return i}function m(){return f}function g(){return e}function a(){return x(c)}function S(){return T(o)}function x(I){return i=I,M}function T(I){return u=I,M}const M={direction:m,duration:l,velocity:g,seek:p,settled:b,useBaseFriction:S,useBaseDuration:a,useFriction:T,useDuration:x};return M}function fn(t,n,s,r,c){const o=c.measure(10),e=c.measure(50),f=tt(.1,.99);let i=!1;function u(){return!(i||!t.reachedAny(s.get())||!t.reachedAny(n.get()))}function h(b){if(!u())return;const l=t.reachedMin(n.get())?"min":"max",m=P(t[l]-n.get()),g=s.get()-n.get(),a=f.constrain(m/e);s.subtract(g*a),!b&&P(g)<o&&(s.set(t.constrain(s.get())),r.useDuration(25).useBaseFriction())}function d(b){i=!b}return{shouldConstrain:u,constrain:h,toggleActive:d}}function an(t,n,s,r,c){const o=tt(-n+t,0),e=d(),f=h(),i=p();function u(l,m){return ft(l,m)<=1}function h(){const l=e[0],m=k(e),g=e.lastIndexOf(l),a=e.indexOf(m)+1;return tt(g,a)}function d(){return s.map((l,m)=>{const{min:g,max:a}=o,S=o.constrain(l),x=!m,T=vt(s,m);return x?a:T||u(g,S)?g:u(a,S)?a:S}).map(l=>parseFloat(l.toFixed(3)))}function p(){if(n<=t+c)return[o.max];if(r==="keepSnaps")return e;const{min:l,max:m}=f;return e.slice(l,m)}return{snapsContained:i,scrollContainLimit:f}}function ln(t,n,s){const r=n[0],c=s?r-t:k(n);return{limit:tt(c,r)}}function dn(t,n,s,r){const o=n.min+.1,e=n.max+.1,{reachedMin:f,reachedMax:i}=tt(o,e);function u(p){return p===1?i(s.get()):p===-1?f(s.get()):!1}function h(p){if(!u(p))return;const b=t*(p*-1);r.forEach(l=>l.add(b))}return{loop:h}}function pn(t){const{max:n,length:s}=t;function r(o){const e=o-n;return s?e/-s:0}return{get:r}}function mn(t,n,s,r,c){const{startEdge:o,endEdge:e}=t,{groupSlides:f}=c,i=d().map(n.measure),u=p(),h=b();function d(){return f(r).map(m=>k(m)[e]-m[0][o]).map(P)}function p(){return r.map(m=>s[o]-m[o]).map(m=>-P(m))}function b(){return f(u).map(m=>m[0]).map((m,g)=>m+i[g])}return{snaps:u,snapsAligned:h}}function gn(t,n,s,r,c,o){const{groupSlides:e}=c,{min:f,max:i}=r,u=h();function h(){const p=e(o),b=!t||n==="keepSnaps";return s.length===1?[o]:b?p:p.slice(f,i).map((l,m,g)=>{const a=!m,S=vt(g,m);if(a){const x=k(g[0])+1;return Bt(x)}if(S){const x=pt(o)-k(g)[0]+1;return Bt(x,k(g)[0])}return l})}return{slideRegistry:u}}function hn(t,n,s,r,c){const{reachedAny:o,removeOffset:e,constrain:f}=r;function i(l){return l.concat().sort((m,g)=>P(m)-P(g))[0]}function u(l){const m=t?e(l):f(l),g=n.map((S,x)=>({diff:h(S-m,0),index:x})).sort((S,x)=>P(S.diff)-P(x.diff)),{index:a}=g[0];return{index:a,distance:m}}function h(l,m){const g=[l,l+s,l-s];if(!t)return l;if(!m)return i(g);const a=g.filter(S=>It(S)===m);return a.length?i(a):k(g)-s}function d(l,m){const g=n[l]-c.get(),a=h(g,m);return{index:l,distance:a}}function p(l,m){const g=c.get()+l,{index:a,distance:S}=u(g),x=!t&&o(g);if(!m||x)return{index:a,distance:l};const T=n[a]-S,M=l+h(T,0);return{index:a,distance:M}}return{byDistance:p,byIndex:d,shortcut:h}}function Sn(t,n,s,r,c,o,e){function f(d){const p=d.distance,b=d.index!==n.get();o.add(p),p&&(r.duration()?t.start():(t.update(),t.render(1),t.update())),b&&(s.set(n.get()),n.set(d.index),e.emit("select"))}function i(d,p){const b=c.byDistance(d,p);f(b)}function u(d,p){const b=n.clone().set(d),l=c.byIndex(b.get(),p);f(l)}return{distance:i,index:u}}function yn(t,n,s,r,c,o,e,f){const i={passive:!0,capture:!0};let u=0;function h(b){if(!f)return;function l(m){if(new Date().getTime()-u>10)return;e.emit("slideFocusStart"),t.scrollLeft=0;const S=s.findIndex(x=>x.includes(m));Tt(S)&&(c.useDuration(0),r.index(S,0),e.emit("slideFocus"))}o.add(document,"keydown",d,!1),n.forEach((m,g)=>{o.add(m,"focus",a=>{(gt(f)||f(b,a))&&l(g)},i)})}function d(b){b.code==="Tab"&&(u=new Date().getTime())}return{init:h}}function ut(t){let n=t;function s(){return n}function r(i){n=e(i)}function c(i){n+=e(i)}function o(i){n-=e(i)}function e(i){return Tt(i)?i:i.get()}return{get:s,set:r,add:c,subtract:o}}function Ht(t,n){const s=t.scroll==="x"?e:f,r=n.style;let c=null,o=!1;function e(p){return`translate3d(${p}px,0px,0px)`}function f(p){return`translate3d(0px,${p}px,0px)`}function i(p){if(o)return;const b=Zt(t.direction(p));b!==c&&(r.transform=s(b),c=b)}function u(p){o=!p}function h(){o||(r.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:h,to:i,toggleActive:u}}function bn(t,n,s,r,c,o,e,f,i){const h=at(c),d=at(c).reverse(),p=a().concat(S());function b(L,E){return L.reduce((v,C)=>v-c[C],E)}function l(L,E){return L.reduce((v,C)=>b(v,E)>0?v.concat([C]):v,[])}function m(L){return o.map((E,v)=>({start:E-r[v]+.5+L,end:E+n-.5+L}))}function g(L,E,v){const C=m(E);return L.map(D=>{const V=v?0:-s,G=v?s:0,H=v?"end":"start",j=C[D][H];return{index:D,loopPoint:j,slideLocation:ut(-1),translate:Ht(t,i[D]),target:()=>f.get()>j?V:G}})}function a(){const L=e[0],E=l(d,L);return g(E,s,!1)}function S(){const L=n-e[0]-1,E=l(h,L);return g(E,-s,!0)}function x(){return p.every(({index:L})=>{const E=h.filter(v=>v!==L);return b(E,n)<=.1})}function T(){p.forEach(L=>{const{target:E,translate:v,slideLocation:C}=L,D=E();D!==C.get()&&(v.to(D),C.set(D))})}function M(){p.forEach(L=>L.translate.clear())}return{canLoop:x,clear:M,loop:T,loopPoints:p}}function xn(t,n,s){let r,c=!1;function o(i){if(!s)return;function u(h){for(const d of h)if(d.type==="childList"){i.reInit(),n.emit("slidesChanged");break}}r=new MutationObserver(h=>{c||(gt(s)||s(i,h))&&u(h)}),r.observe(t,{childList:!0})}function e(){r&&r.disconnect(),c=!0}return{init:o,destroy:e}}function Ln(t,n,s,r){const c={};let o=null,e=null,f,i=!1;function u(){f=new IntersectionObserver(l=>{i||(l.forEach(m=>{const g=n.indexOf(m.target);c[g]=m}),o=null,e=null,s.emit("slidesInView"))},{root:t.parentElement,threshold:r}),n.forEach(l=>f.observe(l))}function h(){f&&f.disconnect(),i=!0}function d(l){return lt(c).reduce((m,g)=>{const a=parseInt(g),{isIntersecting:S}=c[a];return(l&&S||!l&&!S)&&m.push(a),m},[])}function p(l=!0){if(l&&o)return o;if(!l&&e)return e;const m=d(l);return l&&(o=m),l||(e=m),m}return{init:u,destroy:h,get:p}}function En(t,n,s,r,c,o){const{measureSize:e,startEdge:f,endEdge:i}=t,u=s[0]&&c,h=l(),d=m(),p=s.map(e),b=g();function l(){if(!u)return 0;const S=s[0];return P(n[f]-S[f])}function m(){if(!u)return 0;const S=o.getComputedStyle(k(r));return parseFloat(S.getPropertyValue(`margin-${i}`))}function g(){return s.map((S,x,T)=>{const M=!x,I=vt(T,x);return M?p[x]+h:I?p[x]+d:T[x+1][f]-S[f]}).map(P)}return{slideSizes:p,slideSizesWithGaps:b,startGap:h,endGap:d}}function Tn(t,n,s,r,c,o,e,f,i){const{startEdge:u,endEdge:h,direction:d}=t,p=Tt(s);function b(a,S){return at(a).filter(x=>x%S===0).map(x=>a.slice(x,x+S))}function l(a){return a.length?at(a).reduce((S,x,T)=>{const M=k(S)||0,I=M===0,L=x===pt(a),E=c[u]-o[M][u],v=c[u]-o[x][h],C=!r&&I?d(e):0,D=!r&&L?d(f):0,V=P(v-D-(E+C));return T&&V>n+i&&S.push(x),L&&S.push(a.length),S},[]).map((S,x,T)=>{const M=Math.max(T[x-1]||0);return a.slice(M,S)}):[]}function m(a){return p?b(a,s):l(a)}return{groupSlides:m}}function In(t,n,s,r,c,o,e){const{align:f,axis:i,direction:u,startIndex:h,loop:d,duration:p,dragFree:b,dragThreshold:l,inViewThreshold:m,slidesToScroll:g,skipSnaps:a,containScroll:S,watchResize:x,watchSlides:T,watchDrag:M,watchFocus:I}=o,L=2,E=sn(),v=E.measure(n),C=s.map(E.measure),D=nn(i,u),V=D.measureSize(v),G=rn(V),H=Wt(f,V),j=!d&&!!S,J=d||!!S,{slideSizes:Y,slideSizesWithGaps:U,startGap:$,endGap:st}=En(D,v,C,s,J,c),R=Tn(D,V,g,d,v,C,$,st,L),{snaps:nt,snapsAligned:et}=mn(D,H,v,C,R),Q=-k(nt)+k(U),{snapsContained:rt,scrollContainLimit:it}=an(V,Q,et,S,L),z=j?rt:et,{limit:w}=ln(Q,z,d),K=Gt(pt(z),h,d),B=K.clone(),F=at(s),y=({dragHandler:ot,scrollBody:bt,scrollBounds:xt,options:{loop:mt}})=>{mt||xt.constrain(ot.pointerDown()),bt.seek()},A=({scrollBody:ot,translate:bt,location:xt,offsetLocation:mt,previousLocation:qt,scrollLooper:Ut,slideLooper:$t,dragHandler:Qt,animation:Kt,eventHandler:Pt,scrollBounds:Xt,options:{loop:Ct}},Ot)=>{const wt=ot.settled(),Yt=!Xt.shouldConstrain(),Nt=Ct?wt:wt&&Yt,Vt=Nt&&!Qt.pointerDown();Vt&&Kt.stop();const _t=xt.get()*Ot+qt.get()*(1-Ot);mt.set(_t),Ct&&(Ut.loop(ot.direction()),$t.loop()),bt.to(mt.get()),Vt&&Pt.emit("settle"),Nt||Pt.emit("scroll")},O=tn(r,c,()=>y(yt),ot=>A(yt,ot)),N=.68,q=z[K.get()],X=ut(q),Z=ut(q),_=ut(q),W=ut(q),ct=un(X,_,Z,W,p,N),ht=hn(d,z,Q,w,W),St=Sn(O,K,B,ct,ht,W,e),At=pn(w),Mt=dt(),jt=Ln(n,s,e,m),{slideRegistry:Ft}=gn(j,S,z,it,R,F),Rt=yn(t,s,Ft,St,ct,Mt,e,I),yt={ownerDocument:r,ownerWindow:c,eventHandler:e,containerRect:v,slideRects:C,animation:O,axis:D,dragHandler:en(D,t,r,c,W,on(D,c),X,O,St,ct,ht,K,e,G,b,l,a,N,M),eventStore:Mt,percentOfView:G,index:K,indexPrevious:B,limit:w,location:X,offsetLocation:_,previousLocation:Z,options:o,resizeHandler:cn(n,e,c,s,D,x,E),scrollBody:ct,scrollBounds:fn(w,_,W,ct,G),scrollLooper:dn(Q,w,_,[X,_,Z,W]),scrollProgress:At,scrollSnapList:z.map(At.get),scrollSnaps:z,scrollTarget:ht,scrollTo:St,slideLooper:bn(D,V,Q,Y,U,nt,z,_,s),slideFocus:Rt,slidesHandler:xn(n,e,T),slidesInView:jt,slideIndexes:F,slideRegistry:Ft,slidesToScroll:R,target:W,translate:Ht(D,n)};return yt}function vn(){let t={},n;function s(u){n=u}function r(u){return t[u]||[]}function c(u){return r(u).forEach(h=>h(n,u)),i}function o(u,h){return t[u]=r(u).concat([h]),i}function e(u,h){return t[u]=r(u).filter(d=>d!==h),i}function f(){t={}}const i={init:s,emit:c,off:e,on:o,clear:f};return i}const Dn={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function An(t){function n(o,e){return kt(o,e||{})}function s(o){const e=o.breakpoints||{},f=lt(e).filter(i=>t.matchMedia(i).matches).map(i=>e[i]).reduce((i,u)=>n(i,u),{});return n(o,f)}function r(o){return o.map(e=>lt(e.breakpoints||{})).reduce((e,f)=>e.concat(f),[]).map(t.matchMedia)}return{mergeOptions:n,optionsAtMedia:s,optionsMediaQueries:r}}function Mn(t){let n=[];function s(o,e){return n=e.filter(({options:f})=>t.optionsAtMedia(f).active!==!1),n.forEach(f=>f.init(o,t)),e.reduce((f,i)=>Object.assign(f,{[i.name]:i}),{})}function r(){n=n.filter(o=>o.destroy())}return{init:s,destroy:r}}function Dt(t,n,s){const r=t.ownerDocument,c=r.defaultView,o=An(c),e=Mn(o),f=dt(),i=vn(),{mergeOptions:u,optionsAtMedia:h,optionsMediaQueries:d}=o,{on:p,off:b,emit:l}=i,m=D;let g=!1,a,S=u(Dn,Dt.globalOptions),x=u(S),T=[],M,I,L;function E(){const{container:F,slides:y}=x;I=(Lt(F)?t.querySelector(F):F)||t.children[0];const O=Lt(y)?I.querySelectorAll(y):y;L=[].slice.call(O||I.children)}function v(F){const y=In(t,I,L,r,c,F,i);if(F.loop&&!y.slideLooper.canLoop()){const A=Object.assign({},F,{loop:!1});return v(A)}return y}function C(F,y){g||(S=u(S,F),x=h(S),T=y||T,E(),a=v(x),d([S,...T.map(({options:A})=>A)]).forEach(A=>f.add(A,"change",D)),x.active&&(a.translate.to(a.location.get()),a.animation.init(),a.slidesInView.init(),a.slideFocus.init(B),a.eventHandler.init(B),a.resizeHandler.init(B),a.slidesHandler.init(B),a.options.loop&&a.slideLooper.loop(),I.offsetParent&&L.length&&a.dragHandler.init(B),M=e.init(B,T)))}function D(F,y){const A=R();V(),C(u({startIndex:A},F),y),i.emit("reInit")}function V(){a.dragHandler.destroy(),a.eventStore.clear(),a.translate.clear(),a.slideLooper.clear(),a.resizeHandler.destroy(),a.slidesHandler.destroy(),a.slidesInView.destroy(),a.animation.destroy(),e.destroy(),f.clear()}function G(){g||(g=!0,f.clear(),V(),i.emit("destroy"),i.clear())}function H(F,y,A){!x.active||g||(a.scrollBody.useBaseFriction().useDuration(y===!0?0:x.duration),a.scrollTo.index(F,A||0))}function j(F){const y=a.index.add(1).get();H(y,F,-1)}function J(F){const y=a.index.add(-1).get();H(y,F,1)}function Y(){return a.index.add(1).get()!==R()}function U(){return a.index.add(-1).get()!==R()}function $(){return a.scrollSnapList}function st(){return a.scrollProgress.get(a.offsetLocation.get())}function R(){return a.index.get()}function nt(){return a.indexPrevious.get()}function et(){return a.slidesInView.get()}function Q(){return a.slidesInView.get(!1)}function rt(){return M}function it(){return a}function z(){return t}function w(){return I}function K(){return L}const B={canScrollNext:Y,canScrollPrev:U,containerNode:w,internalEngine:it,destroy:G,off:b,on:p,emit:l,plugins:rt,previousScrollSnap:nt,reInit:m,rootNode:z,scrollNext:j,scrollPrev:J,scrollProgress:st,scrollSnapList:$,scrollTo:H,selectedScrollSnap:R,slideNodes:K,slidesInView:et,slidesNotInView:Q};return C(n,s),setTimeout(()=>i.emit("init"),0),B}Dt.globalOptions=void 0;module.exports=Dt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(n){return Object.prototype.toString.call(n)==="[object Object]"}function l(n){return p(n)||Array.isArray(n)}function y(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function f(n,t){const e=Object.keys(n),s=Object.keys(t);if(e.length!==s.length)return!1;const c=JSON.stringify(Object.keys(n.breakpoints||{})),u=JSON.stringify(Object.keys(t.breakpoints||{}));return c!==u?!1:e.every(o=>{const r=n[o],i=t[o];return typeof r=="function"?`${r}`==`${i}`:!l(r)||!l(i)?r===i:f(r,i)})}function a(n){return n.concat().sort((t,e)=>t.name>e.name?1:-1).map(t=>t.options)}function O(n,t){if(n.length!==t.length)return!1;const e=a(n),s=a(t);return e.every((c,u)=>{const o=s[u];return f(c,o)})}exports.areOptionsEqual=f;exports.arePluginsEqual=O;exports.canUseDOM=y;exports.sortAndMapPluginToOptions=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function Tt(t){return typeof t=="number"}function Lt(t){return typeof t=="string"}function gt(t){return typeof t=="boolean"}function zt(t){return Object.prototype.toString.call(t)==="[object Object]"}function P(t){return Math.abs(t)}function It(t){return Math.sign(t)}function ft(t,n){return P(t-n)}function Jt(t,n){if(t===0||n===0||P(t)<=P(n))return 0;const s=ft(P(t),P(n));return P(s/t)}function Zt(t){return Math.round(t*100)/100}function at(t){return lt(t).map(Number)}function k(t){return t[pt(t)]}function pt(t){return Math.max(0,t.length-1)}function vt(t,n){return n===pt(t)}function Bt(t,n=0){return Array.from(Array(t),(s,r)=>n+r)}function lt(t){return Object.keys(t)}function kt(t,n){return[t,n].reduce((s,r)=>(lt(r).forEach(c=>{const o=s[c],e=r[c],f=zt(o)&&zt(e);s[c]=f?kt(o,e):e}),s),{})}function Et(t,n){return typeof n.MouseEvent!="undefined"&&t instanceof n.MouseEvent}function Wt(t,n){const s={start:r,center:c,end:o};function r(){return 0}function c(i){return o(i)/2}function o(i){return n-i}function e(i,u){return Lt(t)?s[t](i):t(n,i,u)}return{measure:e}}function dt(){let t=[];function n(c,o,e,f={passive:!0}){let i;if("addEventListener"in c)c.addEventListener(o,e,f),i=()=>c.removeEventListener(o,e,f);else{const u=c;u.addListener(e),i=()=>u.removeListener(e)}return t.push(i),r}function s(){t=t.filter(c=>c())}const r={add:n,clear:s};return r}function tn(t,n,s,r){const c=dt(),o=1e3/60;let e=null,f=0,i=0;function u(){c.add(t,"visibilitychange",()=>{t.hidden&&l()})}function h(){b(),c.clear()}function d(g){if(!i)return;e||(e=g,s(),s());const a=g-e;for(e=g,f+=a;f>=o;)s(),f-=o;const S=f/o;r(S),i&&(i=n.requestAnimationFrame(d))}function p(){i||(i=n.requestAnimationFrame(d))}function b(){n.cancelAnimationFrame(i),e=null,f=0,i=0}function l(){e=null,f=0}return{init:u,destroy:h,start:p,stop:b,update:s,render:r}}function nn(t,n){const s=n==="rtl",r=t==="y",c=r?"y":"x",o=r?"x":"y",e=!r&&s?-1:1,f=h(),i=d();function u(l){const{height:m,width:g}=l;return r?m:g}function h(){return r?"top":s?"right":"left"}function d(){return r?"bottom":s?"left":"right"}function p(l){return l*e}return{scroll:c,cross:o,startEdge:f,endEdge:i,measureSize:u,direction:p}}function tt(t=0,n=0){const s=P(t-n);function r(u){return u<t}function c(u){return u>n}function o(u){return r(u)||c(u)}function e(u){return o(u)?r(u)?t:n:u}function f(u){return s?u-s*Math.ceil((u-n)/s):u}return{length:s,max:n,min:t,constrain:e,reachedAny:o,reachedMax:c,reachedMin:r,removeOffset:f}}function Gt(t,n,s){const{constrain:r}=tt(0,t),c=t+1;let o=e(n);function e(p){return s?P((c+p)%c):r(p)}function f(){return o}function i(p){return o=e(p),d}function u(p){return h().set(f()+p)}function h(){return Gt(t,f(),s)}const d={get:f,set:i,add:u,clone:h};return d}function en(t,n,s,r,c,o,e,f,i,u,h,d,p,b,l,m,g,a,S){const{cross:x,direction:T}=t,M=["INPUT","SELECT","TEXTAREA"],I={passive:!1},L=dt(),E=dt(),v=tt(50,225).constrain(b.measure(20)),C={mouse:300,touch:400},D={mouse:500,touch:600},V=l?43:25;let G=!1,H=0,j=0,J=!1,Y=!1,U=!1,$=!1;function st(y){if(!S)return;function A(N){(gt(S)||S(y,N))&&it(N)}const O=n;L.add(O,"dragstart",N=>N.preventDefault(),I).add(O,"touchmove",()=>{},I).add(O,"touchend",()=>{}).add(O,"touchstart",A).add(O,"mousedown",A).add(O,"touchcancel",w).add(O,"contextmenu",w).add(O,"click",K,!0)}function R(){L.clear(),E.clear()}function nt(){const y=$?s:n;E.add(y,"touchmove",z,I).add(y,"touchend",w).add(y,"mousemove",z,I).add(y,"mouseup",w)}function et(y){const A=y.nodeName||"";return M.includes(A)}function Q(){return(l?D:C)[$?"mouse":"touch"]}function rt(y,A){const O=d.add(It(y)*-1),N=h.byDistance(y,!l).distance;return l||P(y)<v?N:g&&A?N*.5:h.byIndex(O.get(),0).distance}function it(y){const A=Et(y,r);$=A,U=l&&A&&!y.buttons&&G,G=ft(c.get(),e.get())>=2,!(A&&y.button!==0)&&(et(y.target)||(J=!0,o.pointerDown(y),u.useFriction(0).useDuration(0),c.set(e),nt(),H=o.readPoint(y),j=o.readPoint(y,x),p.emit("pointerDown")))}function z(y){if(!Et(y,r)&&y.touches.length>=2)return w(y);const O=o.readPoint(y),N=o.readPoint(y,x),q=ft(O,H),X=ft(N,j);if(!Y&&!$&&(!y.cancelable||(Y=q>X,!Y)))return w(y);const Z=o.pointerMove(y);q>m&&(U=!0),u.useFriction(.3).useDuration(.75),f.start(),c.add(T(Z)),y.preventDefault()}function w(y){const O=h.byDistance(0,!1).index!==d.get(),N=o.pointerUp(y)*Q(),q=rt(T(N),O),X=Jt(N,q),Z=V-10*X,_=a+X/50;Y=!1,J=!1,E.clear(),u.useDuration(Z).useFriction(_),i.distance(q,!l),$=!1,p.emit("pointerUp")}function K(y){U&&(y.stopPropagation(),y.preventDefault(),U=!1)}function B(){return J}return{init:st,destroy:R,pointerDown:B}}function on(t,n){let r,c;function o(d){return d.timeStamp}function e(d,p){const l=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(Et(d,n)?d:d.touches[0])[l]}function f(d){return r=d,c=d,e(d)}function i(d){const p=e(d)-e(c),b=o(d)-o(r)>170;return c=d,b&&(r=d),p}function u(d){if(!r||!c)return 0;const p=e(c)-e(r),b=o(d)-o(r),l=o(d)-o(c)>170,m=p/b;return b&&!l&&P(m)>.1?m:0}return{pointerDown:f,pointerMove:i,pointerUp:u,readPoint:e}}function sn(){function t(s){const{offsetTop:r,offsetLeft:c,offsetWidth:o,offsetHeight:e}=s;return{top:r,right:c+o,bottom:r+e,left:c,width:o,height:e}}return{measure:t}}function rn(t){function n(r){return t*(r/100)}return{measure:n}}function cn(t,n,s,r,c,o,e){const f=[t].concat(r);let i,u,h=[],d=!1;function p(g){return c.measureSize(e.measure(g))}function b(g){if(!o)return;u=p(t),h=r.map(p);function a(S){for(const x of S){if(d)return;const T=x.target===t,M=r.indexOf(x.target),I=T?u:h[M],L=p(T?t:r[M]);if(P(L-I)>=.5){g.reInit(),n.emit("resize");break}}}i=new ResizeObserver(S=>{(gt(o)||o(g,S))&&a(S)}),s.requestAnimationFrame(()=>{f.forEach(S=>i.observe(S))})}function l(){d=!0,i&&i.disconnect()}return{init:b,destroy:l}}function un(t,n,s,r,c,o){let e=0,f=0,i=c,u=o,h=t.get(),d=0;function p(){const I=r.get()-t.get(),L=!i;let E=0;return L?(e=0,s.set(r),t.set(r),E=I):(s.set(t),e+=I/i,e*=u,h+=e,t.add(e),E=h-d),f=It(E),d=h,M}function b(){const I=r.get()-n.get();return P(I)<.001}function l(){return i}function m(){return f}function g(){return e}function a(){return x(c)}function S(){return T(o)}function x(I){return i=I,M}function T(I){return u=I,M}const M={direction:m,duration:l,velocity:g,seek:p,settled:b,useBaseFriction:S,useBaseDuration:a,useFriction:T,useDuration:x};return M}function fn(t,n,s,r,c){const o=c.measure(10),e=c.measure(50),f=tt(.1,.99);let i=!1;function u(){return!(i||!t.reachedAny(s.get())||!t.reachedAny(n.get()))}function h(b){if(!u())return;const l=t.reachedMin(n.get())?"min":"max",m=P(t[l]-n.get()),g=s.get()-n.get(),a=f.constrain(m/e);s.subtract(g*a),!b&&P(g)<o&&(s.set(t.constrain(s.get())),r.useDuration(25).useBaseFriction())}function d(b){i=!b}return{shouldConstrain:u,constrain:h,toggleActive:d}}function an(t,n,s,r,c){const o=tt(-n+t,0),e=d(),f=h(),i=p();function u(l,m){return ft(l,m)<=1}function h(){const l=e[0],m=k(e),g=e.lastIndexOf(l),a=e.indexOf(m)+1;return tt(g,a)}function d(){return s.map((l,m)=>{const{min:g,max:a}=o,S=o.constrain(l),x=!m,T=vt(s,m);return x?a:T||u(g,S)?g:u(a,S)?a:S}).map(l=>parseFloat(l.toFixed(3)))}function p(){if(n<=t+c)return[o.max];if(r==="keepSnaps")return e;const{min:l,max:m}=f;return e.slice(l,m)}return{snapsContained:i,scrollContainLimit:f}}function ln(t,n,s){const r=n[0],c=s?r-t:k(n);return{limit:tt(c,r)}}function dn(t,n,s,r){const o=n.min+.1,e=n.max+.1,{reachedMin:f,reachedMax:i}=tt(o,e);function u(p){return p===1?i(s.get()):p===-1?f(s.get()):!1}function h(p){if(!u(p))return;const b=t*(p*-1);r.forEach(l=>l.add(b))}return{loop:h}}function pn(t){const{max:n,length:s}=t;function r(o){const e=o-n;return s?e/-s:0}return{get:r}}function mn(t,n,s,r,c){const{startEdge:o,endEdge:e}=t,{groupSlides:f}=c,i=d().map(n.measure),u=p(),h=b();function d(){return f(r).map(m=>k(m)[e]-m[0][o]).map(P)}function p(){return r.map(m=>s[o]-m[o]).map(m=>-P(m))}function b(){return f(u).map(m=>m[0]).map((m,g)=>m+i[g])}return{snaps:u,snapsAligned:h}}function gn(t,n,s,r,c,o){const{groupSlides:e}=c,{min:f,max:i}=r,u=h();function h(){const p=e(o),b=!t||n==="keepSnaps";return s.length===1?[o]:b?p:p.slice(f,i).map((l,m,g)=>{const a=!m,S=vt(g,m);if(a){const x=k(g[0])+1;return Bt(x)}if(S){const x=pt(o)-k(g)[0]+1;return Bt(x,k(g)[0])}return l})}return{slideRegistry:u}}function hn(t,n,s,r,c){const{reachedAny:o,removeOffset:e,constrain:f}=r;function i(l){return l.concat().sort((m,g)=>P(m)-P(g))[0]}function u(l){const m=t?e(l):f(l),g=n.map((S,x)=>({diff:h(S-m,0),index:x})).sort((S,x)=>P(S.diff)-P(x.diff)),{index:a}=g[0];return{index:a,distance:m}}function h(l,m){const g=[l,l+s,l-s];if(!t)return l;if(!m)return i(g);const a=g.filter(S=>It(S)===m);return a.length?i(a):k(g)-s}function d(l,m){const g=n[l]-c.get(),a=h(g,m);return{index:l,distance:a}}function p(l,m){const g=c.get()+l,{index:a,distance:S}=u(g),x=!t&&o(g);if(!m||x)return{index:a,distance:l};const T=n[a]-S,M=l+h(T,0);return{index:a,distance:M}}return{byDistance:p,byIndex:d,shortcut:h}}function Sn(t,n,s,r,c,o,e){function f(d){const p=d.distance,b=d.index!==n.get();o.add(p),p&&(r.duration()?t.start():(t.update(),t.render(1),t.update())),b&&(s.set(n.get()),n.set(d.index),e.emit("select"))}function i(d,p){const b=c.byDistance(d,p);f(b)}function u(d,p){const b=n.clone().set(d),l=c.byIndex(b.get(),p);f(l)}return{distance:i,index:u}}function yn(t,n,s,r,c,o,e,f){const i={passive:!0,capture:!0};let u=0;function h(b){if(!f)return;function l(m){if(new Date().getTime()-u>10)return;e.emit("slideFocusStart"),t.scrollLeft=0;const S=s.findIndex(x=>x.includes(m));Tt(S)&&(c.useDuration(0),r.index(S,0),e.emit("slideFocus"))}o.add(document,"keydown",d,!1),n.forEach((m,g)=>{o.add(m,"focus",a=>{(gt(f)||f(b,a))&&l(g)},i)})}function d(b){b.code==="Tab"&&(u=new Date().getTime())}return{init:h}}function ut(t){let n=t;function s(){return n}function r(i){n=e(i)}function c(i){n+=e(i)}function o(i){n-=e(i)}function e(i){return Tt(i)?i:i.get()}return{get:s,set:r,add:c,subtract:o}}function Ht(t,n){const s=t.scroll==="x"?e:f,r=n.style;let c=null,o=!1;function e(p){return`translate3d(${p}px,0px,0px)`}function f(p){return`translate3d(0px,${p}px,0px)`}function i(p){if(o)return;const b=Zt(t.direction(p));b!==c&&(r.transform=s(b),c=b)}function u(p){o=!p}function h(){o||(r.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:h,to:i,toggleActive:u}}function bn(t,n,s,r,c,o,e,f,i){const h=at(c),d=at(c).reverse(),p=a().concat(S());function b(L,E){return L.reduce((v,C)=>v-c[C],E)}function l(L,E){return L.reduce((v,C)=>b(v,E)>0?v.concat([C]):v,[])}function m(L){return o.map((E,v)=>({start:E-r[v]+.5+L,end:E+n-.5+L}))}function g(L,E,v){const C=m(E);return L.map(D=>{const V=v?0:-s,G=v?s:0,H=v?"end":"start",j=C[D][H];return{index:D,loopPoint:j,slideLocation:ut(-1),translate:Ht(t,i[D]),target:()=>f.get()>j?V:G}})}function a(){const L=e[0],E=l(d,L);return g(E,s,!1)}function S(){const L=n-e[0]-1,E=l(h,L);return g(E,-s,!0)}function x(){return p.every(({index:L})=>{const E=h.filter(v=>v!==L);return b(E,n)<=.1})}function T(){p.forEach(L=>{const{target:E,translate:v,slideLocation:C}=L,D=E();D!==C.get()&&(v.to(D),C.set(D))})}function M(){p.forEach(L=>L.translate.clear())}return{canLoop:x,clear:M,loop:T,loopPoints:p}}function xn(t,n,s){let r,c=!1;function o(i){if(!s)return;function u(h){for(const d of h)if(d.type==="childList"){i.reInit(),n.emit("slidesChanged");break}}r=new MutationObserver(h=>{c||(gt(s)||s(i,h))&&u(h)}),r.observe(t,{childList:!0})}function e(){r&&r.disconnect(),c=!0}return{init:o,destroy:e}}function Ln(t,n,s,r){const c={};let o=null,e=null,f,i=!1;function u(){f=new IntersectionObserver(l=>{i||(l.forEach(m=>{const g=n.indexOf(m.target);c[g]=m}),o=null,e=null,s.emit("slidesInView"))},{root:t.parentElement,threshold:r}),n.forEach(l=>f.observe(l))}function h(){f&&f.disconnect(),i=!0}function d(l){return lt(c).reduce((m,g)=>{const a=parseInt(g),{isIntersecting:S}=c[a];return(l&&S||!l&&!S)&&m.push(a),m},[])}function p(l=!0){if(l&&o)return o;if(!l&&e)return e;const m=d(l);return l&&(o=m),l||(e=m),m}return{init:u,destroy:h,get:p}}function En(t,n,s,r,c,o){const{measureSize:e,startEdge:f,endEdge:i}=t,u=s[0]&&c,h=l(),d=m(),p=s.map(e),b=g();function l(){if(!u)return 0;const S=s[0];return P(n[f]-S[f])}function m(){if(!u)return 0;const S=o.getComputedStyle(k(r));return parseFloat(S.getPropertyValue(`margin-${i}`))}function g(){return s.map((S,x,T)=>{const M=!x,I=vt(T,x);return M?p[x]+h:I?p[x]+d:T[x+1][f]-S[f]}).map(P)}return{slideSizes:p,slideSizesWithGaps:b,startGap:h,endGap:d}}function Tn(t,n,s,r,c,o,e,f,i){const{startEdge:u,endEdge:h,direction:d}=t,p=Tt(s);function b(a,S){return at(a).filter(x=>x%S===0).map(x=>a.slice(x,x+S))}function l(a){return a.length?at(a).reduce((S,x,T)=>{const M=k(S)||0,I=M===0,L=x===pt(a),E=c[u]-o[M][u],v=c[u]-o[x][h],C=!r&&I?d(e):0,D=!r&&L?d(f):0,V=P(v-D-(E+C));return T&&V>n+i&&S.push(x),L&&S.push(a.length),S},[]).map((S,x,T)=>{const M=Math.max(T[x-1]||0);return a.slice(M,S)}):[]}function m(a){return p?b(a,s):l(a)}return{groupSlides:m}}function In(t,n,s,r,c,o,e){const{align:f,axis:i,direction:u,startIndex:h,loop:d,duration:p,dragFree:b,dragThreshold:l,inViewThreshold:m,slidesToScroll:g,skipSnaps:a,containScroll:S,watchResize:x,watchSlides:T,watchDrag:M,watchFocus:I}=o,L=2,E=sn(),v=E.measure(n),C=s.map(E.measure),D=nn(i,u),V=D.measureSize(v),G=rn(V),H=Wt(f,V),j=!d&&!!S,J=d||!!S,{slideSizes:Y,slideSizesWithGaps:U,startGap:$,endGap:st}=En(D,v,C,s,J,c),R=Tn(D,V,g,d,v,C,$,st,L),{snaps:nt,snapsAligned:et}=mn(D,H,v,C,R),Q=-k(nt)+k(U),{snapsContained:rt,scrollContainLimit:it}=an(V,Q,et,S,L),z=j?rt:et,{limit:w}=ln(Q,z,d),K=Gt(pt(z),h,d),B=K.clone(),F=at(s),y=({dragHandler:ot,scrollBody:bt,scrollBounds:xt,options:{loop:mt}})=>{mt||xt.constrain(ot.pointerDown()),bt.seek()},A=({scrollBody:ot,translate:bt,location:xt,offsetLocation:mt,previousLocation:qt,scrollLooper:Ut,slideLooper:$t,dragHandler:Qt,animation:Kt,eventHandler:Pt,scrollBounds:Xt,options:{loop:Ct}},Ot)=>{const wt=ot.settled(),Yt=!Xt.shouldConstrain(),Nt=Ct?wt:wt&&Yt,Vt=Nt&&!Qt.pointerDown();Vt&&Kt.stop();const _t=xt.get()*Ot+qt.get()*(1-Ot);mt.set(_t),Ct&&(Ut.loop(ot.direction()),$t.loop()),bt.to(mt.get()),Vt&&Pt.emit("settle"),Nt||Pt.emit("scroll")},O=tn(r,c,()=>y(yt),ot=>A(yt,ot)),N=.68,q=z[K.get()],X=ut(q),Z=ut(q),_=ut(q),W=ut(q),ct=un(X,_,Z,W,p,N),ht=hn(d,z,Q,w,W),St=Sn(O,K,B,ct,ht,W,e),At=pn(w),Mt=dt(),jt=Ln(n,s,e,m),{slideRegistry:Ft}=gn(j,S,z,it,R,F),Rt=yn(t,s,Ft,St,ct,Mt,e,I),yt={ownerDocument:r,ownerWindow:c,eventHandler:e,containerRect:v,slideRects:C,animation:O,axis:D,dragHandler:en(D,t,r,c,W,on(D,c),X,O,St,ct,ht,K,e,G,b,l,a,N,M),eventStore:Mt,percentOfView:G,index:K,indexPrevious:B,limit:w,location:X,offsetLocation:_,previousLocation:Z,options:o,resizeHandler:cn(n,e,c,s,D,x,E),scrollBody:ct,scrollBounds:fn(w,_,W,ct,G),scrollLooper:dn(Q,w,_,[X,_,Z,W]),scrollProgress:At,scrollSnapList:z.map(At.get),scrollSnaps:z,scrollTarget:ht,scrollTo:St,slideLooper:bn(D,V,Q,Y,U,nt,z,_,s),slideFocus:Rt,slidesHandler:xn(n,e,T),slidesInView:jt,slideIndexes:F,slideRegistry:Ft,slidesToScroll:R,target:W,translate:Ht(D,n)};return yt}function vn(){let t={},n;function s(u){n=u}function r(u){return t[u]||[]}function c(u){return r(u).forEach(h=>h(n,u)),i}function o(u,h){return t[u]=r(u).concat([h]),i}function e(u,h){return t[u]=r(u).filter(d=>d!==h),i}function f(){t={}}const i={init:s,emit:c,off:e,on:o,clear:f};return i}const Dn={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function An(t){function n(o,e){return kt(o,e||{})}function s(o){const e=o.breakpoints||{},f=lt(e).filter(i=>t.matchMedia(i).matches).map(i=>e[i]).reduce((i,u)=>n(i,u),{});return n(o,f)}function r(o){return o.map(e=>lt(e.breakpoints||{})).reduce((e,f)=>e.concat(f),[]).map(t.matchMedia)}return{mergeOptions:n,optionsAtMedia:s,optionsMediaQueries:r}}function Mn(t){let n=[];function s(o,e){return n=e.filter(({options:f})=>t.optionsAtMedia(f).active!==!1),n.forEach(f=>f.init(o,t)),e.reduce((f,i)=>Object.assign(f,{[i.name]:i}),{})}function r(){n=n.filter(o=>o.destroy())}return{init:s,destroy:r}}function Dt(t,n,s){const r=t.ownerDocument,c=r.defaultView,o=An(c),e=Mn(o),f=dt(),i=vn(),{mergeOptions:u,optionsAtMedia:h,optionsMediaQueries:d}=o,{on:p,off:b,emit:l}=i,m=D;let g=!1,a,S=u(Dn,Dt.globalOptions),x=u(S),T=[],M,I,L;function E(){const{container:F,slides:y}=x;I=(Lt(F)?t.querySelector(F):F)||t.children[0];const O=Lt(y)?I.querySelectorAll(y):y;L=[].slice.call(O||I.children)}function v(F){const y=In(t,I,L,r,c,F,i);if(F.loop&&!y.slideLooper.canLoop()){const A=Object.assign({},F,{loop:!1});return v(A)}return y}function C(F,y){g||(S=u(S,F),x=h(S),T=y||T,E(),a=v(x),d([S,...T.map(({options:A})=>A)]).forEach(A=>f.add(A,"change",D)),x.active&&(a.translate.to(a.location.get()),a.animation.init(),a.slidesInView.init(),a.slideFocus.init(B),a.eventHandler.init(B),a.resizeHandler.init(B),a.slidesHandler.init(B),a.options.loop&&a.slideLooper.loop(),I.offsetParent&&L.length&&a.dragHandler.init(B),M=e.init(B,T)))}function D(F,y){const A=R();V(),C(u({startIndex:A},F),y),i.emit("reInit")}function V(){a.dragHandler.destroy(),a.eventStore.clear(),a.translate.clear(),a.slideLooper.clear(),a.resizeHandler.destroy(),a.slidesHandler.destroy(),a.slidesInView.destroy(),a.animation.destroy(),e.destroy(),f.clear()}function G(){g||(g=!0,f.clear(),V(),i.emit("destroy"),i.clear())}function H(F,y,A){!x.active||g||(a.scrollBody.useBaseFriction().useDuration(y===!0?0:x.duration),a.scrollTo.index(F,A||0))}function j(F){const y=a.index.add(1).get();H(y,F,-1)}function J(F){const y=a.index.add(-1).get();H(y,F,1)}function Y(){return a.index.add(1).get()!==R()}function U(){return a.index.add(-1).get()!==R()}function $(){return a.scrollSnapList}function st(){return a.scrollProgress.get(a.offsetLocation.get())}function R(){return a.index.get()}function nt(){return a.indexPrevious.get()}function et(){return a.slidesInView.get()}function Q(){return a.slidesInView.get(!1)}function rt(){return M}function it(){return a}function z(){return t}function w(){return I}function K(){return L}const B={canScrollNext:Y,canScrollPrev:U,containerNode:w,internalEngine:it,destroy:G,off:b,on:p,emit:l,plugins:rt,previousScrollSnap:nt,reInit:m,rootNode:z,scrollNext:j,scrollPrev:J,scrollProgress:st,scrollSnapList:$,scrollTo:H,selectedScrollSnap:R,slideNodes:K,slidesInView:et,slidesNotInView:Q};return C(n,s),setTimeout(()=>i.emit("init"),0),B}Dt.globalOptions=void 0;module.exports=Dt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={color:{red:{100:"#FDECEA",500:"#E31837"},neutral:{0:"#FFFFFF",100:"#F5F5F5",300:"#D1D1D1",700:"#4A4A4A",900:"#1A1A1A"},green:{100:"#E8F5EA",500:"#0A8920",600:"#077319"},yellow:{100:"#FEF7E0",500:"#F9AB00"}},space:{2:"8px",4:"16px",6:"24px",8:"32px"},radius:{sm:"4px",md:"8px",full:"9999px"},font:{family:{body:"'DM Sans', sans-serif",display:"'Bebas Neue', sans-serif"}},shadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.08)",md:"0 4px 8px 0 rgba(0,0,0,0.12)"},transition:{fast:"100ms ease",normal:"200ms ease"}};exports.primitives=s;
|
package/dist/index.cjs2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@emotion/styled"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@emotion/styled"),o=require("./index.cjs14.js"),k={primary:`background-color:${o.tokens.color.brand};color:#fff;border:none;&:hover:not(:disabled){background-color:${o.tokens.color.brandHover};}&:active:not(:disabled){background-color:${o.tokens.color.brandHover};box-shadow:${o.tokens.shadow.sm};}`,secondary:`background-color:transparent;color:${o.tokens.color.brand};border:1.5px solid ${o.tokens.color.brand};&:hover:not(:disabled){background-color:${o.tokens.color.brandSubtle};}`,ghost:`background-color:transparent;color:${o.tokens.color.text};border:none;&:hover:not(:disabled){background-color:${o.tokens.color.surface};}`,danger:`background-color:${o.tokens.color.danger};color:#fff;border:none;&:hover:not(:disabled){opacity:0.9;}`},h={sm:`height:32px;padding-inline:${o.tokens.space.sm};font-size:13px;`,md:`height:40px;padding-inline:${o.tokens.space.md};font-size:15px;`,lg:`height:48px;padding-inline:${o.tokens.space.lg};font-size:17px;`},f=p.button`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
package/dist/index.cjs3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("@emotion/styled"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("@emotion/styled"),o=require("./index.cjs14.js"),c={brand:`background-color: ${o.tokens.color.brandSubtle}; color: ${o.tokens.color.brand};`,success:`background-color: ${o.tokens.color.successSubtle}; color: ${o.tokens.color.success};`,warning:`background-color: ${o.tokens.color.warningSubtle}; color: ${o.tokens.color.warning};`,danger:`background-color: ${o.tokens.color.dangerSubtle}; color: ${o.tokens.color.danger};`,neutral:`background-color: ${o.tokens.color.surface}; color: ${o.tokens.color.textMuted};`},l={sm:"font-size: 11px; padding: 2px 6px;",md:`font-size: 13px; padding: 4px ${o.tokens.space.sm};`},a=s.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
package/dist/index.cjs4.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("@emotion/styled"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("@emotion/styled"),o=require("./index.cjs14.js"),s={default:`background-color:${o.tokens.color.surface};color:${o.tokens.color.text};border:1px solid ${o.tokens.color.border};`,brand:`background-color:${o.tokens.color.brandSubtle};color:${o.tokens.color.brand};border:1px solid ${o.tokens.color.brand};`},l=t.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: 4px;
|
package/dist/index.cjs5.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("@emotion/styled"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("@emotion/styled"),o=require("./index.cjs14.js"),m=require("react"),v=n.div`display:flex;flex-direction:column;gap:4px;font-family:${o.tokens.font.body};`,I=n.label`font-size:13px;font-weight:500;color:${o.tokens.color.text};`,S=n.span`color:${o.tokens.color.danger};margin-left:2px;`,w=n.div`
|
|
2
2
|
display:flex;align-items:center;gap:${o.tokens.space.sm};
|
|
3
3
|
border-radius:${o.tokens.radius.md};
|
|
4
4
|
border:1.5px solid ${({hasError:e})=>e?o.tokens.color.danger:o.tokens.color.border};
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
flex:1;border:none;outline:none;background:transparent;
|
|
15
15
|
font-family:${o.tokens.font.body};font-size:15px;color:${o.tokens.color.text};height:40px;
|
|
16
16
|
&::placeholder{color:${o.tokens.color.textMuted};}&:disabled{cursor:not-allowed;}
|
|
17
|
-
`,f=n.span`display:flex;align-items:center;color:${o.tokens.color.textMuted};flex-shrink:0;`,q=n.span`font-size:12px;color:${o.tokens.color.textMuted};`,z=n.span`font-size:12px;color:${o.tokens.color.danger};`;function
|
|
17
|
+
`,f=n.span`display:flex;align-items:center;color:${o.tokens.color.textMuted};flex-shrink:0;`,q=n.span`font-size:12px;color:${o.tokens.color.textMuted};`,z=n.span`font-size:12px;color:${o.tokens.color.danger};`;function B({label:e,placeholder:b,value:$,onChange:l,type:g="text",error:r,hint:i,disabled:d=!1,required:a=!1,leftIcon:u,rightIcon:x,name:h,id:c}){const y=m.useId(),s=c!=null?c:y,p=r?`${s}-error`:void 0,k=i?`${s}-hint`:void 0;return t.jsxs(v,{children:[e&&t.jsxs(I,{htmlFor:s,children:[e,a&&t.jsx(S,{"aria-hidden":"true",children:" *"})]}),t.jsxs(w,{hasError:!!r,disabled:d,children:[u&&t.jsx(f,{"aria-hidden":"true",children:u}),t.jsx(M,{id:s,name:h,type:g,placeholder:b,value:$,onChange:j=>l==null?void 0:l(j.target.value),disabled:d,required:a,"aria-invalid":r?!0:void 0,"aria-describedby":[p,k].filter(Boolean).join(" ")||void 0}),x&&t.jsx(f,{"aria-hidden":"true",children:x})]}),r&&t.jsx(z,{id:p,role:"alert",children:r}),i&&!r&&t.jsx(q,{id:k,children:i})]})}exports.Input=B;
|
package/dist/index.cjs6.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("@emotion/styled"),e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("@emotion/styled"),e=require("./index.cjs14.js"),f=require("react"),h=r.div`display:flex;flex-direction:column;gap:4px;font-family:${e.tokens.font.body};`,g=r.label`font-size:13px;font-weight:500;color:${e.tokens.color.text};`,v=r.div`position:relative;display:flex;align-items:center;`,$=r.select`
|
|
2
2
|
width:100%;height:40px;padding-inline-start:${e.tokens.space.sm};padding-inline-end:36px;
|
|
3
3
|
border-radius:${e.tokens.radius.md};border:1.5px solid ${({hasError:t})=>t?e.tokens.color.danger:e.tokens.color.border};
|
|
4
4
|
background-color:${e.tokens.color.background};font-family:${e.tokens.font.body};font-size:15px;
|
package/dist/index.cjs7.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("@emotion/styled"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("@emotion/styled"),t=require("./index.cjs14.js"),l=require("react"),f=n.label`
|
|
2
2
|
display: inline-flex; align-items: center; gap: ${t.tokens.space.sm};
|
|
3
3
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
4
4
|
opacity: ${({disabled:e})=>e?.5:1};
|
package/dist/index.cjs8.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("@emotion/styled"),e=require("./index.cjs14.js"),u={none:"0",sm:e.tokens.space.sm,md:e.tokens.space.md,lg:e.tokens.space.lg},x=t.article`
|
|
2
2
|
display:flex;flex-direction:column;background-color:${e.tokens.color.background};
|
|
3
3
|
border-radius:${e.tokens.radius.md};border:1px solid ${e.tokens.color.border};
|
|
4
4
|
overflow:hidden;position:relative;
|
|
5
5
|
transition:box-shadow ${e.tokens.transition.normal},transform ${e.tokens.transition.normal};
|
|
6
6
|
max-width:15rem;height:27rem;padding:${({padding:o})=>u[o]};
|
|
7
7
|
${({hoverable:o})=>o&&`cursor:pointer;&:hover{box-shadow:${e.tokens.shadow.sm};transform:translateY(-2px);}`}
|
|
8
|
-
`,h=
|
|
8
|
+
`,h=t.div`width:100%;overflow:hidden;`,v=t.div`padding:${e.tokens.space.sm} ${e.tokens.space.md};`,b=t.div`padding:0 ${e.tokens.space.md};flex:1;`,g=t.div`padding:${e.tokens.space.md};border-top:1px solid ${e.tokens.color.border};margin-top:auto;`;function k({media:o,header:a,body:i,footer:c,onClick:r,hoverable:l=!1,className:p,padding:m="none"}){const s=!!r;return n.jsxs(x,{hoverable:l||s,padding:m,className:p,onClick:r,role:s?"button":void 0,tabIndex:s?0:void 0,onKeyDown:s?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r==null||r())}:void 0,children:[o&&n.jsx(h,{children:o}),a&&n.jsx(v,{children:a}),i&&n.jsx(b,{children:i}),c&&n.jsx(g,{children:c})]})}exports.Card=k;
|
package/dist/index.cjs9.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("@emotion/styled"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("@emotion/styled"),t=require("./index.cjs14.js"),N=require("./index.cjs15.js"),s=require("react"),T={sm:8,md:16,lg:24,xl:32};function _(r,i){return typeof r=="number"?r:i>=1024?r.desktop:i>=640?r.tablet:r.mobile}const w=d.button`
|
|
2
2
|
position:absolute;top:50%;transform:translateY(-50%);z-index:10;
|
|
3
3
|
display:flex;align-items:center;justify-content:center;
|
|
4
4
|
width:36px;height:36px;border-radius:${t.tokens.radius.full};
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
&:hover{box-shadow:${t.tokens.shadow.md};}
|
|
9
9
|
&:focus-visible{outline:2px solid ${t.tokens.color.borderFocus};outline-offset:2px;}
|
|
10
10
|
&:disabled{opacity:0.4;cursor:not-allowed;}
|
|
11
|
-
`,
|
|
11
|
+
`,z=d(w)`left:${t.tokens.space.sm};`,D=d(w)`right:${t.tokens.space.sm};`,P=d.button`
|
|
12
12
|
width:${({active:r})=>r?"20px":"8px"};height:8px;
|
|
13
13
|
border-radius:${t.tokens.radius.full};
|
|
14
14
|
background-color:${({active:r})=>r?t.tokens.color.brand:t.tokens.color.border};
|
|
15
15
|
border:none;cursor:pointer;padding:0;
|
|
16
16
|
transition:background-color ${t.tokens.transition.fast},width ${t.tokens.transition.fast};
|
|
17
17
|
&:focus-visible{outline:2px solid ${t.tokens.color.borderFocus};outline-offset:2px;}
|
|
18
|
-
`,
|
|
18
|
+
`,G=d.div`display:flex;justify-content:center;gap:${t.tokens.space.sm};margin-top:${t.tokens.space.sm};`;function O({children:r,autoplay:i=!1,autoplayMs:f=4e3,pauseOnHover:x=!0,showArrows:m=!0,showDots:y=!0,loop:S=!1,slidesPerView:h=1,slidesPerGroup:R=1,gap:p,onSlideChange:u}){var g;const k=p&&(g=T[p])!=null?g:0,[I,e]=N({loop:S,slidesToScroll:R,align:"start"}),[L,q]=s.useState(0),[E,C]=s.useState([]),[b,v]=s.useState(!1),$=s.useRef(h);$.current=h;const j=s.useRef(null),[a,M]=s.useState(1);s.useEffect(()=>{const n=j.current;if(!n)return;const c=new ResizeObserver(([B])=>{const F=B.contentRect.width;M(_($.current,F))});return c.observe(n),()=>c.disconnect()},[]);const l=s.useCallback(()=>{if(!e)return;const n=e.selectedScrollSnap();q(n),u==null||u(n)},[e,u]);s.useEffect(()=>{if(e)return C(e.scrollSnapList()),e.on("select",l),e.on("reInit",l),()=>{e.off("select",l),e.off("reInit",l)}},[e,l]),s.useEffect(()=>{e==null||e.reInit()},[e,a]),s.useEffect(()=>{if(!i||!e||x&&b)return;const n=setInterval(()=>e.scrollNext(),f);return()=>clearInterval(n)},[i,f,e,x,b]);const W=`calc((100% - ${k*(a-1)}px) / ${a})`;return o.jsxs("div",{ref:j,style:{position:"relative",width:"100%"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[o.jsx("div",{ref:I,style:{overflow:"hidden"},children:o.jsx("div",{style:{display:"flex",gap:k},children:r.map((n,c)=>o.jsx("div",{style:{flex:`0 0 ${W}`,minWidth:0},children:n},c))})}),m&&o.jsxs(o.Fragment,{children:[o.jsx(z,{type:"button","aria-label":"Slide anterior",onClick:()=>e==null?void 0:e.scrollPrev(),children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M10 12L6 8l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),o.jsx(D,{type:"button","aria-label":"Slide siguiente",onClick:()=>e==null?void 0:e.scrollNext(),children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),y&&o.jsx(G,{children:E.map((n,c)=>o.jsx(P,{active:c===L,type:"button",onClick:()=>e==null?void 0:e.scrollTo(c),"aria-label":`Ir al slide ${c+1}`},c))})]})}exports.Carousel=O;
|
package/dist/index.esm10.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import e from "@emotion/styled";
|
|
3
3
|
import { keyframes as A } from "@emotion/react";
|
|
4
|
-
import { tokens as o } from "
|
|
4
|
+
import { tokens as o } from "./index.esm14.js";
|
|
5
5
|
import { Card as O } from "./index.esm8.js";
|
|
6
6
|
import { Badge as B } from "./index.esm3.js";
|
|
7
7
|
import { Button as R } from "./index.esm2.js";
|
package/dist/index.esm11.js
CHANGED
|
@@ -12,7 +12,7 @@ var a = (e, o, r) => o in e ? b(e, o, { enumerable: !0, configurable: !0, writab
|
|
|
12
12
|
}, l = (e, o) => w(e, C(o));
|
|
13
13
|
import { jsxs as A, jsx as t } from "react/jsx-runtime";
|
|
14
14
|
import c from "@emotion/styled";
|
|
15
|
-
import { tokens as i } from "
|
|
15
|
+
import { tokens as i } from "./index.esm14.js";
|
|
16
16
|
import { Carousel as z } from "./index.esm9.js";
|
|
17
17
|
import { ProductCard as D } from "./index.esm10.js";
|
|
18
18
|
const H = c.section`display:flex;flex-direction:column;gap:${i.space.md};`, R = c.h2`font-family:${i.font.display};font-size:24px;color:${i.color.text};margin:0;letter-spacing:0.02em;`;
|
package/dist/index.esm12.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import s from "@emotion/styled";
|
|
3
|
-
import { tokens as i } from "
|
|
3
|
+
import { tokens as i } from "./index.esm14.js";
|
|
4
4
|
const l = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" }, a = s.div`
|
|
5
5
|
display:flex;flex-direction:column;
|
|
6
6
|
align-items:${({ align: t }) => l[t]};
|
package/dist/index.esm13.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import p from "@emotion/styled";
|
|
3
|
-
import { tokens as n } from "
|
|
3
|
+
import { tokens as n } from "./index.esm14.js";
|
|
4
4
|
const m = { sm: "640px", md: "768px", lg: "1024px", xl: "1280px", full: "100%" }, o = p.div`
|
|
5
5
|
width:100%;margin-inline:auto;padding-inline:${n.space.md};
|
|
6
6
|
max-width:${({ maxWidth: i }) => m[i]};
|
package/dist/index.esm14.js
CHANGED
|
@@ -1,24 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
1
|
+
import { primitives as o } from "./index.esm18.js";
|
|
2
|
+
const e = {
|
|
3
|
+
color: {
|
|
4
|
+
background: o.color.neutral[0],
|
|
5
|
+
surface: o.color.neutral[100],
|
|
6
|
+
surfaceHover: o.color.neutral[300],
|
|
7
|
+
border: o.color.neutral[300],
|
|
8
|
+
borderFocus: o.color.green[500],
|
|
9
|
+
text: o.color.neutral[900],
|
|
10
|
+
textMuted: o.color.neutral[700],
|
|
11
|
+
brand: o.color.green[500],
|
|
12
|
+
brandHover: o.color.green[600],
|
|
13
|
+
brandSubtle: o.color.green[100],
|
|
14
|
+
success: o.color.green[500],
|
|
15
|
+
successSubtle: o.color.green[100],
|
|
16
|
+
warning: o.color.yellow[500],
|
|
17
|
+
warningSubtle: o.color.yellow[100],
|
|
18
|
+
danger: o.color.red[500],
|
|
19
|
+
dangerSubtle: o.color.red[100]
|
|
20
|
+
},
|
|
21
|
+
space: {
|
|
22
|
+
sm: o.space[2],
|
|
23
|
+
md: o.space[4],
|
|
24
|
+
lg: o.space[6],
|
|
25
|
+
xl: o.space[8]
|
|
26
|
+
},
|
|
27
|
+
radius: {
|
|
28
|
+
sm: o.radius.sm,
|
|
29
|
+
md: o.radius.md,
|
|
30
|
+
full: o.radius.full
|
|
31
|
+
},
|
|
32
|
+
font: {
|
|
33
|
+
body: o.font.family.body,
|
|
34
|
+
display: o.font.family.display
|
|
35
|
+
},
|
|
36
|
+
shadow: {
|
|
37
|
+
sm: o.shadow.sm,
|
|
38
|
+
md: o.shadow.md
|
|
39
|
+
},
|
|
40
|
+
transition: {
|
|
41
|
+
fast: o.transition.fast,
|
|
42
|
+
normal: o.transition.normal
|
|
43
|
+
}
|
|
44
|
+
};
|
|
22
45
|
export {
|
|
23
|
-
|
|
46
|
+
e as tokens
|
|
24
47
|
};
|