@eliseubatista99/react-scaffold-core 0.1.12 → 0.1.13
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (
|
|
4
|
+
component: ({ styles, content, settings, gap, }: import('../carousel').CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -11,6 +11,9 @@ declare const meta: {
|
|
|
11
11
|
content: import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
}[];
|
|
13
13
|
settings: {};
|
|
14
|
+
styles: {
|
|
15
|
+
padding: string;
|
|
16
|
+
};
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
19
|
export default meta;
|
package/dist/index.cjs.js
CHANGED
|
@@ -28,6 +28,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
28
28
|
height: fit-content;
|
|
29
29
|
|
|
30
30
|
${({styles:e})=>e&&{...e}}
|
|
31
|
+
|
|
32
|
+
.slick-list {
|
|
33
|
+
overflow: visible;
|
|
34
|
+
}
|
|
31
35
|
`,Ji=Ve.div`
|
|
32
36
|
box-sizing: border-box;
|
|
33
37
|
display: flex;
|
|
@@ -41,7 +45,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
41
45
|
box-sizing: border-box;
|
|
42
46
|
display: flex;
|
|
43
47
|
}
|
|
44
|
-
`,Zi=({styles:e,content:t,settings:r,gap:o="15px"})=>{var i={dots:!1,speed:500,slidesToScroll:1,infinite:!1,variableWidth:!0,arrows:!1,...r};const a=t.map((l,f)=>G.jsx(Ji,{styles:{paddingLeft:f===0?"0px":o
|
|
48
|
+
`,Zi=({styles:e,content:t,settings:r,gap:o="15px"})=>{var i={dots:!1,speed:500,slidesToScroll:1,infinite:!1,variableWidth:!0,arrows:!1,...r};const a=t.map((l,f)=>G.jsx(Ji,{styles:{paddingLeft:f===0?"0px":o,...l.styles},"data-testid":"carousel-slide-item",children:l.content}));return G.jsx(Ki,{styles:{...e},children:G.jsx(Qn,{...i,children:a})})},Qi=e=>B.useEffect(e,[]),qr=()=>{const[e,t]=B.useState({}),[r,o]=B.useState(!1);return B.useEffect(()=>{const i=f=>{t({x:f.clientX,y:f.clientY})},a=f=>{o(!0)},l=f=>{o(!1)};return window.addEventListener("pointermove",i),window.addEventListener("pointerdown",a),window.addEventListener("pointerup",l),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerdown",a),window.removeEventListener("pointerup",l)}},[]),{pointerPosition:e,isPointerDown:r}},Br=({ref:e,onDrag:t,onDragStart:r,onDragEnd:o})=>{const i=B.useRef(!1),a=B.useRef(!1),{pointerPosition:l,isPointerDown:f}=qr(),d=B.useRef({isDragging:!1}),h=B.useCallback(C=>{if(!e||!e.current||!d.current)return;const v={...d.current};return v.posY=C.y,v.posX=C.x,d.current.startPosX&&d.current.posX&&(v.distanceX=d.current.startPosX-d.current.posX),d.current.startPosY&&d.current.posY&&(v.distanceY=-(d.current.startPosY-d.current.posY)),v},[]),w=B.useCallback(C=>{C.preventDefault(),C.stopPropagation(),d.current.isDragging=!0,d.current.startPosY=C.clientY,d.current.startPosX=C.clientX;const v=h({x:C.clientX,y:C.clientY});v&&(d.current=v,r?.(v))},[h]),R=B.useCallback(C=>{d.current.isDragging=!1;const v=h(l);v&&(o?.(v),v.startPosX=void 0,v.startPosY=void 0,d.current=v)},[h,l]),E=B.useCallback(C=>{if(console.debug("useDrag > onPointerMove > Is Dragging >",d.current.isDragging),!d.current.isDragging)return;const v=h(l);console.debug("useDrag > onPointerMove > Drag Result >",v),v&&(t?.(v),d.current=v)},[h,l]),z=B.useCallback(async()=>{if(!i.current){for(;!e?.current;)await new Promise(C=>setTimeout(C,300));i.current=!0,e.current.onpointerdown=w,e.current.style.touchAction="none"}},[e?.current,w]);B.useEffect(()=>{z()},[z]),B.useEffect(()=>{E()},[l]),B.useEffect(()=>{f!==a.current&&(a.current=f,f||R())},[f,a.current])},eo=()=>{const e=(r,o)=>{let i=0,a=`${r}?`;for(const l in o){const f=o[l];i>0&&(a=`${a}&`),a=`${a}${l}=${f}`,i++}return a};return async(r,o)=>{const i=e(r,o);return await(await fetch(i)).json()}},Ur={xs:0,sm:420,md:768,lg:991,xl:1200,xxl:1440},to=e=>{const t={...Ur,...e?.breakpointConfiguration},[r,o]=B.useState(br(t)),i=()=>{o(br(t))};return B.useEffect(()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[]),B.useMemo(()=>r,[r])},ro=(e,t)=>e<t.sm?"xs":e<t.md?"sm":e<t.lg?"md":e<t.xl?"lg":e<t.xxl?"xl":"xxl",no=(e,t)=>e<=t.sm?"mobile":e<=t.md?"tablet":"desktop",br=e=>{const t=window.innerWidth,r=window.innerHeight,o=ro(t,e),i=no(t,e);return{currentWidth:t,currentHeight:r,currentBreakpoint:o,currentSize:i}},io=e=>{const t=e.translations,r=e.language,o=(a,l)=>{if(!a)return;let f=a[r];if(f)return l&&Object.keys(l).forEach(d=>{const h=l[d];f=f.replaceAll(`{{${d}}}`,`${h}`)}),f};return{t:(a,l)=>{if(t[a]){const f=o(t[a],l);return f??a}return a},getTranslation:o}};var We={},wr;function oo(){if(wr)return We;wr=1,Object.defineProperty(We,"__esModule",{value:!0}),We.parse=l,We.serialize=h;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,a=(()=>{const E=function(){};return E.prototype=Object.create(null),E})();function l(E,z){const C=new a,v=E.length;if(v<2)return C;const I=z?.decode||w;let O=0;do{const H=E.indexOf("=",O);if(H===-1)break;const q=E.indexOf(";",O),U=q===-1?v:q;if(H>U){O=E.lastIndexOf(";",H-1)+1;continue}const p=f(E,O,H),y=d(E,H,p),g=E.slice(p,y);if(C[g]===void 0){let k=f(E,H+1,U),m=d(E,U,k);const c=I(E.slice(k,m));C[g]=c}O=U+1}while(O<v);return C}function f(E,z,C){do{const v=E.charCodeAt(z);if(v!==32&&v!==9)return z}while(++z<C);return C}function d(E,z,C){for(;z>C;){const v=E.charCodeAt(--z);if(v!==32&&v!==9)return z+1}return C}function h(E,z,C){const v=C?.encode||encodeURIComponent;if(!e.test(E))throw new TypeError(`argument name is invalid: ${E}`);const I=v(z);if(!t.test(I))throw new TypeError(`argument val is invalid: ${z}`);let O=E+"="+I;if(!C)return O;if(C.maxAge!==void 0){if(!Number.isInteger(C.maxAge))throw new TypeError(`option maxAge is invalid: ${C.maxAge}`);O+="; Max-Age="+C.maxAge}if(C.domain){if(!r.test(C.domain))throw new TypeError(`option domain is invalid: ${C.domain}`);O+="; Domain="+C.domain}if(C.path){if(!o.test(C.path))throw new TypeError(`option path is invalid: ${C.path}`);O+="; Path="+C.path}if(C.expires){if(!R(C.expires)||!Number.isFinite(C.expires.valueOf()))throw new TypeError(`option expires is invalid: ${C.expires}`);O+="; Expires="+C.expires.toUTCString()}if(C.httpOnly&&(O+="; HttpOnly"),C.secure&&(O+="; Secure"),C.partitioned&&(O+="; Partitioned"),C.priority)switch(typeof C.priority=="string"?C.priority.toLowerCase():void 0){case"low":O+="; Priority=Low";break;case"medium":O+="; Priority=Medium";break;case"high":O+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${C.priority}`)}if(C.sameSite)switch(typeof C.sameSite=="string"?C.sameSite.toLowerCase():C.sameSite){case!0:case"strict":O+="; SameSite=Strict";break;case"lax":O+="; SameSite=Lax";break;case"none":O+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${C.sameSite}`)}return O}function w(E){if(E.indexOf("%")===-1)return E;try{return decodeURIComponent(E)}catch{return E}}function R(E){return i.call(E)==="[object Date]"}return We}oo();/**
|
|
45
49
|
* react-router v7.6.3
|
|
46
50
|
*
|
|
47
51
|
* Copyright (c) Remix Software Inc.
|
package/dist/index.es.js
CHANGED
|
@@ -3745,6 +3745,10 @@ const Ki = Ve.div`
|
|
|
3745
3745
|
height: fit-content;
|
|
3746
3746
|
|
|
3747
3747
|
${({ styles: e }) => e && { ...e }}
|
|
3748
|
+
|
|
3749
|
+
.slick-list {
|
|
3750
|
+
overflow: visible;
|
|
3751
|
+
}
|
|
3748
3752
|
`, Ji = Ve.div`
|
|
3749
3753
|
box-sizing: border-box;
|
|
3750
3754
|
display: flex;
|
|
@@ -3778,7 +3782,7 @@ const Ki = Ve.div`
|
|
|
3778
3782
|
{
|
|
3779
3783
|
styles: {
|
|
3780
3784
|
paddingLeft: f === 0 ? "0px" : o,
|
|
3781
|
-
marginLeft:
|
|
3785
|
+
// marginLeft: index !== 0 ? "0px" : margin,
|
|
3782
3786
|
...l.styles
|
|
3783
3787
|
},
|
|
3784
3788
|
"data-testid": "carousel-slide-item",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eliseubatista99/react-scaffold-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library which provides basic components, hooks, helpers and providers to easily build a React application and avoid repeating the usual code.",
|
|
6
6
|
"main": "dist/index.cjs.js",
|