@rubenpazch/pagination 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +29 -25
- package/dist/index.esm.js +38 -16
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -3,25 +3,6 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var shared = require('@rubenpazch/shared');
|
|
5
5
|
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
var n = Object.create(null);
|
|
8
|
-
if (e) {
|
|
9
|
-
Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default') {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
24
|
-
|
|
25
6
|
var jsxRuntime = {exports: {}};
|
|
26
7
|
|
|
27
8
|
var reactJsxRuntime_production = {};
|
|
@@ -444,7 +425,22 @@ function requireJsxRuntime () {
|
|
|
444
425
|
|
|
445
426
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
446
427
|
|
|
447
|
-
var
|
|
428
|
+
var e$1={exports:{}};
|
|
429
|
+
|
|
430
|
+
var r$3={};
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @license React
|
|
434
|
+
* react-jsx-runtime.production.js
|
|
435
|
+
*
|
|
436
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the MIT license found in the
|
|
439
|
+
* LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/var e;function t$2(){if(e)return r$3;e=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function n(r,e,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==e.key&&(n=""+e.key),"key"in e)for(var i in o={},e)"key"!==i&&(o[i]=e[i]);else o=e;return e=o.ref,{$$typeof:t,type:r,key:n,ref:void 0!==e?e:null,props:o}}return r$3.Fragment=o,r$3.jsx=n,r$3.jsxs=n,r$3}
|
|
441
|
+
|
|
442
|
+
var r$2={};
|
|
443
|
+
|
|
448
444
|
/**
|
|
449
445
|
* @license React
|
|
450
446
|
* react-jsx-runtime.development.js
|
|
@@ -453,7 +449,15 @@ var t,r={exports:{}},o={};var l,n,a={};
|
|
|
453
449
|
*
|
|
454
450
|
* This source code is licensed under the MIT license found in the
|
|
455
451
|
* LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/function
|
|
452
|
+
*/var t$1;function n(){return t$1||(t$1=1,"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===N?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return "Fragment";case _:return "Profiler";case b:return "StrictMode";case S:return "Suspense";case j:return "SuspenseList";case w:return "Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case m:return "Portal";case g:return e.displayName||"Context";case v:return (e._context.displayName||"Context")+".Consumer";case k:var r=e.render;return (e=e.displayName)||(e=""!==(e=r.displayName||r.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case h:return null!==(r=e.displayName||null)?r:t(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return t(e(r))}catch(e){}}return null}function n(e){return ""+e}function o(e){try{n(e);var r=!1;}catch(e){r=true;}if(r){var t=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function a(e){if(e===d)return "<>";if("object"==typeof e&&null!==e&&e.$$typeof===O)return "<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch(e){return "<...>"}}function l(){return Error("react-stack-top-frame")}function i(){var e=t(this.type);return P[e]||(P[e]=true,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function c(e,r,n,a,l,c){var u,y=r.children;if(void 0!==y)if(a)if(x(y)){for(a=0;a<y.length;a++)s(y[a]);Object.freeze&&Object.freeze(y);}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else s(y);if(T.call(r,"key")){y=t(e);var m=Object.keys(r).filter(function(e){return "key"!==e});a=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",C[y+a]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,y,m,y),C[y+a]=true);}if(y=null,void 0!==n&&(o(n),y=""+n),function(e){if(T.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return false}return void 0!==e.key}(r)&&(o(r.key),y=""+r.key),"key"in r)for(var d in n={},r)"key"!==d&&(n[d]=r[d]);else n=r;return y&&function(e,r){function t(){f||(f=true,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r));}t.isReactWarning=true,Object.defineProperty(e,"key",{get:t,configurable:true});}(n,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,r,t,n,o,a){var l=t.ref;return e={$$typeof:p,type:e,key:r,props:t,_owner:n},null!==(void 0!==l?l:null)?Object.defineProperty(e,"ref",{enumerable:false,get:i}):Object.defineProperty(e,"ref",{enumerable:false,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(e,"_debugStack",{configurable:false,enumerable:false,writable:true,value:o}),Object.defineProperty(e,"_debugTask",{configurable:false,enumerable:false,writable:true,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,y,n,null===(u=R.A)?null:u.getOwner(),l,c)}function s(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===O&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1));}function u(e){return "object"==typeof e&&null!==e&&e.$$typeof===p}var f,y=React,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),g=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),R=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=Object.prototype.hasOwnProperty,x=Array.isArray,E=console.createTask?console.createTask:function(){return null},P={},$=(y={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(y,l)(),A=E(a(l)),C={};r$2.Fragment=d,r$2.jsx=function(e,r,t){var n=1e4>R.recentlyCreatedOwnerStacks++;return c(e,r,t,false,n?Error("react-stack-top-frame"):$,n?E(a(e)):A)},r$2.jsxs=function(e,r,t){var n=1e4>R.recentlyCreatedOwnerStacks++;return c(e,r,t,true,n?Error("react-stack-top-frame"):$,n?E(a(e)):A)};}()),r$2}
|
|
453
|
+
|
|
454
|
+
var t;function s(){return t||(t=1,"production"===process.env.NODE_ENV?e$1.exports=t$2():e$1.exports=n()),e$1.exports}
|
|
455
|
+
|
|
456
|
+
var r$1=s();
|
|
457
|
+
|
|
458
|
+
const r={sm:16,md:20,lg:28},a=({size:a="md",direction:s="right",...e})=>{const i=r[a],l="left"===s;return r$1.jsx("svg",{width:i,height:i,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...e,children:r$1.jsxs("g",{transform:l?"scale(-1,1) translate(-20,0)":void 0,children:[r$1.jsx("path",{d:"M7.22 5.22a.75.75 0 011.06 0l4 4a.75.75 0 010 1.06l-4 4a.75.75 0 11-1.06-1.06L10.94 10 7.22 6.28a.75.75 0 010-1.06z"}),r$1.jsx("path",{d:"M15.25 4a.75.75 0 10-1.5 0v12a.75.75 0 101.5 0V4z"})]})})};
|
|
459
|
+
|
|
460
|
+
const o=({className:o="",size:e="md",color:r="currentColor",direction:s="down"})=>{const i={sm:16,md:20,lg:24};return r$1.jsx("svg",{width:i[e],height:i[e],className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[e]} ${{up:"rotate-180",down:"",left:"rotate-90",right:"-rotate-90"}[s]} ${o}`,fill:"none",stroke:r,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r$1.jsx("path",{d:"M6 9l6 6 6-6"})})};
|
|
457
461
|
|
|
458
462
|
function styleInject(css, ref) {
|
|
459
463
|
if ( ref === void 0 ) ref = {};
|
|
@@ -506,16 +510,16 @@ const PaginationItem = React.forwardRef(({ page, type, selected = false, disable
|
|
|
506
510
|
const renderNavigationIcon = () => {
|
|
507
511
|
const iconSize = iconSizeMap[size];
|
|
508
512
|
if (type === "first") {
|
|
509
|
-
return (jsxRuntimeExports.jsx(
|
|
513
|
+
return (jsxRuntimeExports.jsx(a, { direction: "left", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
510
514
|
}
|
|
511
515
|
if (type === "last") {
|
|
512
|
-
return (jsxRuntimeExports.jsx(
|
|
516
|
+
return (jsxRuntimeExports.jsx(a, { direction: "right", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
513
517
|
}
|
|
514
518
|
if (type === "next") {
|
|
515
|
-
return (jsxRuntimeExports.jsx(
|
|
519
|
+
return (jsxRuntimeExports.jsx(o, { direction: "right", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
516
520
|
}
|
|
517
521
|
if (type === "previous") {
|
|
518
|
-
return (jsxRuntimeExports.jsx(
|
|
522
|
+
return (jsxRuntimeExports.jsx(o, { direction: "left", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
519
523
|
}
|
|
520
524
|
return null;
|
|
521
525
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React__default from 'react';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { toLegacySize } from '@rubenpazch/shared';
|
|
4
3
|
|
|
5
4
|
var jsxRuntime = {exports: {}};
|
|
@@ -338,7 +337,7 @@ function requireReactJsxRuntime_development () {
|
|
|
338
337
|
object.$$typeof === REACT_ELEMENT_TYPE
|
|
339
338
|
);
|
|
340
339
|
}
|
|
341
|
-
var React =
|
|
340
|
+
var React$1 = React,
|
|
342
341
|
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
343
342
|
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
344
343
|
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
@@ -354,7 +353,7 @@ function requireReactJsxRuntime_development () {
|
|
|
354
353
|
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
355
354
|
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
356
355
|
ReactSharedInternals =
|
|
357
|
-
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
356
|
+
React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
358
357
|
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
359
358
|
isArrayImpl = Array.isArray,
|
|
360
359
|
createTask = console.createTask
|
|
@@ -362,15 +361,15 @@ function requireReactJsxRuntime_development () {
|
|
|
362
361
|
: function () {
|
|
363
362
|
return null;
|
|
364
363
|
};
|
|
365
|
-
React = {
|
|
364
|
+
React$1 = {
|
|
366
365
|
react_stack_bottom_frame: function (callStackForError) {
|
|
367
366
|
return callStackForError();
|
|
368
367
|
}
|
|
369
368
|
};
|
|
370
369
|
var specialPropKeyWarningShown;
|
|
371
370
|
var didWarnAboutElementRef = {};
|
|
372
|
-
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
373
|
-
React,
|
|
371
|
+
var unknownOwnerDebugStack = React$1.react_stack_bottom_frame.bind(
|
|
372
|
+
React$1,
|
|
374
373
|
UnknownOwner
|
|
375
374
|
)();
|
|
376
375
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -424,7 +423,22 @@ function requireJsxRuntime () {
|
|
|
424
423
|
|
|
425
424
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
426
425
|
|
|
427
|
-
var
|
|
426
|
+
var e$1={exports:{}};
|
|
427
|
+
|
|
428
|
+
var r$3={};
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @license React
|
|
432
|
+
* react-jsx-runtime.production.js
|
|
433
|
+
*
|
|
434
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the MIT license found in the
|
|
437
|
+
* LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/var e;function t$2(){if(e)return r$3;e=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function n(r,e,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==e.key&&(n=""+e.key),"key"in e)for(var i in o={},e)"key"!==i&&(o[i]=e[i]);else o=e;return e=o.ref,{$$typeof:t,type:r,key:n,ref:void 0!==e?e:null,props:o}}return r$3.Fragment=o,r$3.jsx=n,r$3.jsxs=n,r$3}
|
|
439
|
+
|
|
440
|
+
var r$2={};
|
|
441
|
+
|
|
428
442
|
/**
|
|
429
443
|
* @license React
|
|
430
444
|
* react-jsx-runtime.development.js
|
|
@@ -433,7 +447,15 @@ var t,r={exports:{}},o={};var l,n,a={};
|
|
|
433
447
|
*
|
|
434
448
|
* This source code is licensed under the MIT license found in the
|
|
435
449
|
* LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/function
|
|
450
|
+
*/var t$1;function n(){return t$1||(t$1=1,"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===N?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return "Fragment";case _:return "Profiler";case b:return "StrictMode";case S:return "Suspense";case j:return "SuspenseList";case w:return "Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case m:return "Portal";case g:return e.displayName||"Context";case v:return (e._context.displayName||"Context")+".Consumer";case k:var r=e.render;return (e=e.displayName)||(e=""!==(e=r.displayName||r.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case h:return null!==(r=e.displayName||null)?r:t(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return t(e(r))}catch(e){}}return null}function n(e){return ""+e}function o(e){try{n(e);var r=!1;}catch(e){r=true;}if(r){var t=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function a(e){if(e===d)return "<>";if("object"==typeof e&&null!==e&&e.$$typeof===O)return "<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch(e){return "<...>"}}function l(){return Error("react-stack-top-frame")}function i(){var e=t(this.type);return P[e]||(P[e]=true,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function c(e,r,n,a,l,c){var u,y=r.children;if(void 0!==y)if(a)if(x(y)){for(a=0;a<y.length;a++)s(y[a]);Object.freeze&&Object.freeze(y);}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else s(y);if(T.call(r,"key")){y=t(e);var m=Object.keys(r).filter(function(e){return "key"!==e});a=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",C[y+a]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,y,m,y),C[y+a]=true);}if(y=null,void 0!==n&&(o(n),y=""+n),function(e){if(T.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return false}return void 0!==e.key}(r)&&(o(r.key),y=""+r.key),"key"in r)for(var d in n={},r)"key"!==d&&(n[d]=r[d]);else n=r;return y&&function(e,r){function t(){f||(f=true,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r));}t.isReactWarning=true,Object.defineProperty(e,"key",{get:t,configurable:true});}(n,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,r,t,n,o,a){var l=t.ref;return e={$$typeof:p,type:e,key:r,props:t,_owner:n},null!==(void 0!==l?l:null)?Object.defineProperty(e,"ref",{enumerable:false,get:i}):Object.defineProperty(e,"ref",{enumerable:false,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(e,"_debugStack",{configurable:false,enumerable:false,writable:true,value:o}),Object.defineProperty(e,"_debugTask",{configurable:false,enumerable:false,writable:true,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,y,n,null===(u=R.A)?null:u.getOwner(),l,c)}function s(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===O&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1));}function u(e){return "object"==typeof e&&null!==e&&e.$$typeof===p}var f,y=React,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),g=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),R=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=Object.prototype.hasOwnProperty,x=Array.isArray,E=console.createTask?console.createTask:function(){return null},P={},$=(y={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(y,l)(),A=E(a(l)),C={};r$2.Fragment=d,r$2.jsx=function(e,r,t){var n=1e4>R.recentlyCreatedOwnerStacks++;return c(e,r,t,false,n?Error("react-stack-top-frame"):$,n?E(a(e)):A)},r$2.jsxs=function(e,r,t){var n=1e4>R.recentlyCreatedOwnerStacks++;return c(e,r,t,true,n?Error("react-stack-top-frame"):$,n?E(a(e)):A)};}()),r$2}
|
|
451
|
+
|
|
452
|
+
var t;function s(){return t||(t=1,"production"===process.env.NODE_ENV?e$1.exports=t$2():e$1.exports=n()),e$1.exports}
|
|
453
|
+
|
|
454
|
+
var r$1=s();
|
|
455
|
+
|
|
456
|
+
const r={sm:16,md:20,lg:28},a=({size:a="md",direction:s="right",...e})=>{const i=r[a],l="left"===s;return r$1.jsx("svg",{width:i,height:i,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...e,children:r$1.jsxs("g",{transform:l?"scale(-1,1) translate(-20,0)":void 0,children:[r$1.jsx("path",{d:"M7.22 5.22a.75.75 0 011.06 0l4 4a.75.75 0 010 1.06l-4 4a.75.75 0 11-1.06-1.06L10.94 10 7.22 6.28a.75.75 0 010-1.06z"}),r$1.jsx("path",{d:"M15.25 4a.75.75 0 10-1.5 0v12a.75.75 0 101.5 0V4z"})]})})};
|
|
457
|
+
|
|
458
|
+
const o=({className:o="",size:e="md",color:r="currentColor",direction:s="down"})=>{const i={sm:16,md:20,lg:24};return r$1.jsx("svg",{width:i[e],height:i[e],className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[e]} ${{up:"rotate-180",down:"",left:"rotate-90",right:"-rotate-90"}[s]} ${o}`,fill:"none",stroke:r,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r$1.jsx("path",{d:"M6 9l6 6 6-6"})})};
|
|
437
459
|
|
|
438
460
|
function styleInject(css, ref) {
|
|
439
461
|
if ( ref === void 0 ) ref = {};
|
|
@@ -472,7 +494,7 @@ const iconSizeMap = {
|
|
|
472
494
|
medium: "md",
|
|
473
495
|
large: "lg",
|
|
474
496
|
};
|
|
475
|
-
const PaginationItem =
|
|
497
|
+
const PaginationItem = React.forwardRef(({ page, type, selected = false, disabled = false, shape = "rounded", size: sizeProp = "medium", variant = "text", className, ...props }, ref) => {
|
|
476
498
|
const size = toLegacySize(sizeProp);
|
|
477
499
|
// Ellipsis are not interactive
|
|
478
500
|
if (type === "start-ellipsis" || type === "end-ellipsis") {
|
|
@@ -486,16 +508,16 @@ const PaginationItem = React__default.forwardRef(({ page, type, selected = false
|
|
|
486
508
|
const renderNavigationIcon = () => {
|
|
487
509
|
const iconSize = iconSizeMap[size];
|
|
488
510
|
if (type === "first") {
|
|
489
|
-
return (jsxRuntimeExports.jsx(
|
|
511
|
+
return (jsxRuntimeExports.jsx(a, { direction: "left", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
490
512
|
}
|
|
491
513
|
if (type === "last") {
|
|
492
|
-
return (jsxRuntimeExports.jsx(
|
|
514
|
+
return (jsxRuntimeExports.jsx(a, { direction: "right", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
493
515
|
}
|
|
494
516
|
if (type === "next") {
|
|
495
|
-
return (jsxRuntimeExports.jsx(
|
|
517
|
+
return (jsxRuntimeExports.jsx(o, { direction: "right", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
496
518
|
}
|
|
497
519
|
if (type === "previous") {
|
|
498
|
-
return (jsxRuntimeExports.jsx(
|
|
520
|
+
return (jsxRuntimeExports.jsx(o, { direction: "left", size: iconSize, className: styles$1.icon, "aria-hidden": "true" }));
|
|
499
521
|
}
|
|
500
522
|
return null;
|
|
501
523
|
};
|
|
@@ -602,9 +624,9 @@ const usePagination = (props) => {
|
|
|
602
624
|
}
|
|
603
625
|
return items;
|
|
604
626
|
};
|
|
605
|
-
const Pagination =
|
|
627
|
+
const Pagination = React.forwardRef(({ count = 1, page: controlledPage, defaultPage = 1, onChange, onPageChange, "aria-label": ariaLabel = "Paginación", disabled = false, hideNextButton = false, hidePrevButton = false, showFirstButton = false, showLastButton = false, boundaryCount = 1, siblingCount = 1, shape = "rounded", size: sizeProp = "medium", variant = "text", renderItem, className, ...props }, ref) => {
|
|
606
628
|
const size = toLegacySize(sizeProp);
|
|
607
|
-
const [page, setPage] =
|
|
629
|
+
const [page, setPage] = React.useState(defaultPage);
|
|
608
630
|
const currentPage = controlledPage ?? page;
|
|
609
631
|
const handleClick = (event, value) => {
|
|
610
632
|
if (!controlledPage) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubenpazch/pagination",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Pagination component",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"**/*.css"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@rubenpazch/icons": "6.
|
|
23
|
+
"@rubenpazch/icons": "6.3.0",
|
|
24
24
|
"@rubenpazch/shared": "5.2.0"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|