@starasia/pagination 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,647 +1,6 @@
1
- import Pa, { useMemo as vr } from "react";
2
- var ra = { exports: {} }, N = {};
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var Oa;
13
- function gr() {
14
- if (Oa)
15
- return N;
16
- Oa = 1;
17
- var m = Pa, c = Symbol.for("react.element"), w = Symbol.for("react.fragment"), v = Object.prototype.hasOwnProperty, f = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function S(E, u, y) {
19
- var p, x = {}, R = null, j = null;
20
- y !== void 0 && (R = "" + y), u.key !== void 0 && (R = "" + u.key), u.ref !== void 0 && (j = u.ref);
21
- for (p in u)
22
- v.call(u, p) && !T.hasOwnProperty(p) && (x[p] = u[p]);
23
- if (E && E.defaultProps)
24
- for (p in u = E.defaultProps, u)
25
- x[p] === void 0 && (x[p] = u[p]);
26
- return { $$typeof: c, type: E, key: R, ref: j, props: x, _owner: f.current };
27
- }
28
- return N.Fragment = w, N.jsx = S, N.jsxs = S, N;
29
- }
30
- var Y = {};
31
- /**
32
- * @license React
33
- * react-jsx-runtime.development.js
34
- *
35
- * Copyright (c) Facebook, Inc. and its affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */
40
- var ja;
41
- function mr() {
42
- return ja || (ja = 1, process.env.NODE_ENV !== "production" && function() {
43
- var m = Pa, c = Symbol.for("react.element"), w = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), E = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), ea = Symbol.iterator, ka = "@@iterator";
44
- function Da(a) {
45
- if (a === null || typeof a != "object")
46
- return null;
47
- var r = ea && a[ea] || a[ka];
48
- return typeof r == "function" ? r : null;
49
- }
50
- var D = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function g(a) {
52
- {
53
- for (var r = arguments.length, e = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
54
- e[n - 1] = arguments[n];
55
- Aa("error", a, e);
56
- }
57
- }
58
- function Aa(a, r, e) {
59
- {
60
- var n = D.ReactDebugCurrentFrame, o = n.getStackAddendum();
61
- o !== "" && (r += "%s", e = e.concat([o]));
62
- var s = e.map(function(i) {
63
- return String(i);
64
- });
65
- s.unshift("Warning: " + r), Function.prototype.apply.call(console[a], console, s);
66
- }
67
- }
68
- var Fa = !1, Ia = !1, $a = !1, Wa = !1, Na = !1, na;
69
- na = Symbol.for("react.module.reference");
70
- function Ya(a) {
71
- return !!(typeof a == "string" || typeof a == "function" || a === v || a === T || Na || a === f || a === y || a === p || Wa || a === j || Fa || Ia || $a || typeof a == "object" && a !== null && (a.$$typeof === R || a.$$typeof === x || a.$$typeof === S || a.$$typeof === E || a.$$typeof === u || // This needs to include all possible module reference object
72
- // types supported by any Flight configuration anywhere since
73
- // we don't know which Flight build this will end up being used
74
- // with.
75
- a.$$typeof === na || a.getModuleId !== void 0));
76
- }
77
- function Ma(a, r, e) {
78
- var n = a.displayName;
79
- if (n)
80
- return n;
81
- var o = r.displayName || r.name || "";
82
- return o !== "" ? e + "(" + o + ")" : e;
83
- }
84
- function ta(a) {
85
- return a.displayName || "Context";
86
- }
87
- function O(a) {
88
- if (a == null)
89
- return null;
90
- if (typeof a.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
91
- return a.displayName || a.name || null;
92
- if (typeof a == "string")
93
- return a;
94
- switch (a) {
95
- case v:
96
- return "Fragment";
97
- case w:
98
- return "Portal";
99
- case T:
100
- return "Profiler";
101
- case f:
102
- return "StrictMode";
103
- case y:
104
- return "Suspense";
105
- case p:
106
- return "SuspenseList";
107
- }
108
- if (typeof a == "object")
109
- switch (a.$$typeof) {
110
- case E:
111
- var r = a;
112
- return ta(r) + ".Consumer";
113
- case S:
114
- var e = a;
115
- return ta(e._context) + ".Provider";
116
- case u:
117
- return Ma(a, a.render, "ForwardRef");
118
- case x:
119
- var n = a.displayName || null;
120
- return n !== null ? n : O(a.type) || "Memo";
121
- case R: {
122
- var o = a, s = o._payload, i = o._init;
123
- try {
124
- return O(i(s));
125
- } catch {
126
- return null;
127
- }
128
- }
129
- }
130
- return null;
131
- }
132
- var C = Object.assign, I = 0, ia, oa, sa, ua, la, ca, fa;
133
- function da() {
134
- }
135
- da.__reactDisabledLog = !0;
136
- function La() {
137
- {
138
- if (I === 0) {
139
- ia = console.log, oa = console.info, sa = console.warn, ua = console.error, la = console.group, ca = console.groupCollapsed, fa = console.groupEnd;
140
- var a = {
141
- configurable: !0,
142
- enumerable: !0,
143
- value: da,
144
- writable: !0
145
- };
146
- Object.defineProperties(console, {
147
- info: a,
148
- log: a,
149
- warn: a,
150
- error: a,
151
- group: a,
152
- groupCollapsed: a,
153
- groupEnd: a
154
- });
155
- }
156
- I++;
157
- }
158
- }
159
- function Ua() {
160
- {
161
- if (I--, I === 0) {
162
- var a = {
163
- configurable: !0,
164
- enumerable: !0,
165
- writable: !0
166
- };
167
- Object.defineProperties(console, {
168
- log: C({}, a, {
169
- value: ia
170
- }),
171
- info: C({}, a, {
172
- value: oa
173
- }),
174
- warn: C({}, a, {
175
- value: sa
176
- }),
177
- error: C({}, a, {
178
- value: ua
179
- }),
180
- group: C({}, a, {
181
- value: la
182
- }),
183
- groupCollapsed: C({}, a, {
184
- value: ca
185
- }),
186
- groupEnd: C({}, a, {
187
- value: fa
188
- })
189
- });
190
- }
191
- I < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
- }
193
- }
194
- var B = D.ReactCurrentDispatcher, J;
195
- function L(a, r, e) {
196
- {
197
- if (J === void 0)
198
- try {
199
- throw Error();
200
- } catch (o) {
201
- var n = o.stack.trim().match(/\n( *(at )?)/);
202
- J = n && n[1] || "";
203
- }
204
- return `
205
- ` + J + a;
206
- }
207
- }
208
- var K = !1, U;
209
- {
210
- var Va = typeof WeakMap == "function" ? WeakMap : Map;
211
- U = new Va();
212
- }
213
- function pa(a, r) {
214
- if (!a || K)
215
- return "";
216
- {
217
- var e = U.get(a);
218
- if (e !== void 0)
219
- return e;
220
- }
221
- var n;
222
- K = !0;
223
- var o = Error.prepareStackTrace;
224
- Error.prepareStackTrace = void 0;
225
- var s;
226
- s = B.current, B.current = null, La();
227
- try {
228
- if (r) {
229
- var i = function() {
230
- throw Error();
231
- };
232
- if (Object.defineProperty(i.prototype, "props", {
233
- set: function() {
234
- throw Error();
235
- }
236
- }), typeof Reflect == "object" && Reflect.construct) {
237
- try {
238
- Reflect.construct(i, []);
239
- } catch (h) {
240
- n = h;
241
- }
242
- Reflect.construct(a, [], i);
243
- } else {
244
- try {
245
- i.call();
246
- } catch (h) {
247
- n = h;
248
- }
249
- a.call(i.prototype);
250
- }
251
- } else {
252
- try {
253
- throw Error();
254
- } catch (h) {
255
- n = h;
256
- }
257
- a();
258
- }
259
- } catch (h) {
260
- if (h && n && typeof h.stack == "string") {
261
- for (var t = h.stack.split(`
262
- `), b = n.stack.split(`
263
- `), l = t.length - 1, d = b.length - 1; l >= 1 && d >= 0 && t[l] !== b[d]; )
264
- d--;
265
- for (; l >= 1 && d >= 0; l--, d--)
266
- if (t[l] !== b[d]) {
267
- if (l !== 1 || d !== 1)
268
- do
269
- if (l--, d--, d < 0 || t[l] !== b[d]) {
270
- var _ = `
271
- ` + t[l].replace(" at new ", " at ");
272
- return a.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", a.displayName)), typeof a == "function" && U.set(a, _), _;
273
- }
274
- while (l >= 1 && d >= 0);
275
- break;
276
- }
277
- }
278
- } finally {
279
- K = !1, B.current = s, Ua(), Error.prepareStackTrace = o;
280
- }
281
- var F = a ? a.displayName || a.name : "", P = F ? L(F) : "";
282
- return typeof a == "function" && U.set(a, P), P;
283
- }
284
- function qa(a, r, e) {
285
- return pa(a, !1);
286
- }
287
- function za(a) {
288
- var r = a.prototype;
289
- return !!(r && r.isReactComponent);
290
- }
291
- function V(a, r, e) {
292
- if (a == null)
293
- return "";
294
- if (typeof a == "function")
295
- return pa(a, za(a));
296
- if (typeof a == "string")
297
- return L(a);
298
- switch (a) {
299
- case y:
300
- return L("Suspense");
301
- case p:
302
- return L("SuspenseList");
303
- }
304
- if (typeof a == "object")
305
- switch (a.$$typeof) {
306
- case u:
307
- return qa(a.render);
308
- case x:
309
- return V(a.type, r, e);
310
- case R: {
311
- var n = a, o = n._payload, s = n._init;
312
- try {
313
- return V(s(o), r, e);
314
- } catch {
315
- }
316
- }
317
- }
318
- return "";
319
- }
320
- var $ = Object.prototype.hasOwnProperty, va = {}, ga = D.ReactDebugCurrentFrame;
321
- function q(a) {
322
- if (a) {
323
- var r = a._owner, e = V(a.type, a._source, r ? r.type : null);
324
- ga.setExtraStackFrame(e);
325
- } else
326
- ga.setExtraStackFrame(null);
327
- }
328
- function Ba(a, r, e, n, o) {
329
- {
330
- var s = Function.call.bind($);
331
- for (var i in a)
332
- if (s(a, i)) {
333
- var t = void 0;
334
- try {
335
- if (typeof a[i] != "function") {
336
- var b = Error((n || "React class") + ": " + e + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw b.name = "Invariant Violation", b;
338
- }
339
- t = a[i](r, i, n, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (l) {
341
- t = l;
342
- }
343
- t && !(t instanceof Error) && (q(o), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", e, i, typeof t), q(null)), t instanceof Error && !(t.message in va) && (va[t.message] = !0, q(o), g("Failed %s type: %s", e, t.message), q(null));
344
- }
345
- }
346
- }
347
- var Ja = Array.isArray;
348
- function G(a) {
349
- return Ja(a);
350
- }
351
- function Ka(a) {
352
- {
353
- var r = typeof Symbol == "function" && Symbol.toStringTag, e = r && a[Symbol.toStringTag] || a.constructor.name || "Object";
354
- return e;
355
- }
356
- }
357
- function Ga(a) {
358
- try {
359
- return ma(a), !1;
360
- } catch {
361
- return !0;
362
- }
363
- }
364
- function ma(a) {
365
- return "" + a;
366
- }
367
- function ya(a) {
368
- if (Ga(a))
369
- return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ka(a)), ma(a);
370
- }
371
- var W = D.ReactCurrentOwner, Xa = {
372
- key: !0,
373
- ref: !0,
374
- __self: !0,
375
- __source: !0
376
- }, ba, ha, X;
377
- X = {};
378
- function Ha(a) {
379
- if ($.call(a, "ref")) {
380
- var r = Object.getOwnPropertyDescriptor(a, "ref").get;
381
- if (r && r.isReactWarning)
382
- return !1;
383
- }
384
- return a.ref !== void 0;
385
- }
386
- function Za(a) {
387
- if ($.call(a, "key")) {
388
- var r = Object.getOwnPropertyDescriptor(a, "key").get;
389
- if (r && r.isReactWarning)
390
- return !1;
391
- }
392
- return a.key !== void 0;
393
- }
394
- function Qa(a, r) {
395
- if (typeof a.ref == "string" && W.current && r && W.current.stateNode !== r) {
396
- var e = O(W.current.type);
397
- X[e] || (g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(W.current.type), a.ref), X[e] = !0);
398
- }
399
- }
400
- function ar(a, r) {
401
- {
402
- var e = function() {
403
- ba || (ba = !0, g("%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://reactjs.org/link/special-props)", r));
404
- };
405
- e.isReactWarning = !0, Object.defineProperty(a, "key", {
406
- get: e,
407
- configurable: !0
408
- });
409
- }
410
- }
411
- function rr(a, r) {
412
- {
413
- var e = function() {
414
- ha || (ha = !0, g("%s: `ref` 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://reactjs.org/link/special-props)", r));
415
- };
416
- e.isReactWarning = !0, Object.defineProperty(a, "ref", {
417
- get: e,
418
- configurable: !0
419
- });
420
- }
421
- }
422
- var er = function(a, r, e, n, o, s, i) {
423
- var t = {
424
- // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: c,
426
- // Built-in properties that belong on the element
427
- type: a,
428
- key: r,
429
- ref: e,
430
- props: i,
431
- // Record the component responsible for creating this element.
432
- _owner: s
433
- };
434
- return t._store = {}, Object.defineProperty(t._store, "validated", {
435
- configurable: !1,
436
- enumerable: !1,
437
- writable: !0,
438
- value: !1
439
- }), Object.defineProperty(t, "_self", {
440
- configurable: !1,
441
- enumerable: !1,
442
- writable: !1,
443
- value: n
444
- }), Object.defineProperty(t, "_source", {
445
- configurable: !1,
446
- enumerable: !1,
447
- writable: !1,
448
- value: o
449
- }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
450
- };
451
- function nr(a, r, e, n, o) {
452
- {
453
- var s, i = {}, t = null, b = null;
454
- e !== void 0 && (ya(e), t = "" + e), Za(r) && (ya(r.key), t = "" + r.key), Ha(r) && (b = r.ref, Qa(r, o));
455
- for (s in r)
456
- $.call(r, s) && !Xa.hasOwnProperty(s) && (i[s] = r[s]);
457
- if (a && a.defaultProps) {
458
- var l = a.defaultProps;
459
- for (s in l)
460
- i[s] === void 0 && (i[s] = l[s]);
461
- }
462
- if (t || b) {
463
- var d = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
464
- t && ar(i, d), b && rr(i, d);
465
- }
466
- return er(a, t, b, o, n, W.current, i);
467
- }
468
- }
469
- var H = D.ReactCurrentOwner, Ra = D.ReactDebugCurrentFrame;
470
- function A(a) {
471
- if (a) {
472
- var r = a._owner, e = V(a.type, a._source, r ? r.type : null);
473
- Ra.setExtraStackFrame(e);
474
- } else
475
- Ra.setExtraStackFrame(null);
476
- }
477
- var Z;
478
- Z = !1;
479
- function Q(a) {
480
- return typeof a == "object" && a !== null && a.$$typeof === c;
481
- }
482
- function Ea() {
483
- {
484
- if (H.current) {
485
- var a = O(H.current.type);
486
- if (a)
487
- return `
488
-
489
- Check the render method of \`` + a + "`.";
490
- }
491
- return "";
492
- }
493
- }
494
- function tr(a) {
495
- {
496
- if (a !== void 0) {
497
- var r = a.fileName.replace(/^.*[\\\/]/, ""), e = a.lineNumber;
498
- return `
499
-
500
- Check your code at ` + r + ":" + e + ".";
501
- }
502
- return "";
503
- }
504
- }
505
- var _a = {};
506
- function ir(a) {
507
- {
508
- var r = Ea();
509
- if (!r) {
510
- var e = typeof a == "string" ? a : a.displayName || a.name;
511
- e && (r = `
512
-
513
- Check the top-level render call using <` + e + ">.");
514
- }
515
- return r;
516
- }
517
- }
518
- function wa(a, r) {
519
- {
520
- if (!a._store || a._store.validated || a.key != null)
521
- return;
522
- a._store.validated = !0;
523
- var e = ir(r);
524
- if (_a[e])
525
- return;
526
- _a[e] = !0;
527
- var n = "";
528
- a && a._owner && a._owner !== H.current && (n = " It was passed a child from " + O(a._owner.type) + "."), A(a), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', e, n), A(null);
529
- }
530
- }
531
- function xa(a, r) {
532
- {
533
- if (typeof a != "object")
534
- return;
535
- if (G(a))
536
- for (var e = 0; e < a.length; e++) {
537
- var n = a[e];
538
- Q(n) && wa(n, r);
539
- }
540
- else if (Q(a))
541
- a._store && (a._store.validated = !0);
542
- else if (a) {
543
- var o = Da(a);
544
- if (typeof o == "function" && o !== a.entries)
545
- for (var s = o.call(a), i; !(i = s.next()).done; )
546
- Q(i.value) && wa(i.value, r);
547
- }
548
- }
549
- }
550
- function or(a) {
551
- {
552
- var r = a.type;
553
- if (r == null || typeof r == "string")
554
- return;
555
- var e;
556
- if (typeof r == "function")
557
- e = r.propTypes;
558
- else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
559
- // Inner props are checked in the reconciler.
560
- r.$$typeof === x))
561
- e = r.propTypes;
562
- else
563
- return;
564
- if (e) {
565
- var n = O(r);
566
- Ba(e, a.props, "prop", n, a);
567
- } else if (r.PropTypes !== void 0 && !Z) {
568
- Z = !0;
569
- var o = O(r);
570
- g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
571
- }
572
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
- }
574
- }
575
- function sr(a) {
576
- {
577
- for (var r = Object.keys(a.props), e = 0; e < r.length; e++) {
578
- var n = r[e];
579
- if (n !== "children" && n !== "key") {
580
- A(a), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
581
- break;
582
- }
583
- }
584
- a.ref !== null && (A(a), g("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
585
- }
586
- }
587
- var Ta = {};
588
- function Sa(a, r, e, n, o, s) {
589
- {
590
- var i = Ya(a);
591
- if (!i) {
592
- var t = "";
593
- (a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (t += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
- var b = tr(o);
595
- b ? t += b : t += Ea();
596
- var l;
597
- a === null ? l = "null" : G(a) ? l = "array" : a !== void 0 && a.$$typeof === c ? (l = "<" + (O(a.type) || "Unknown") + " />", t = " Did you accidentally export a JSX literal instead of a component?") : l = typeof a, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, t);
598
- }
599
- var d = nr(a, r, e, o, s);
600
- if (d == null)
601
- return d;
602
- if (i) {
603
- var _ = r.children;
604
- if (_ !== void 0)
605
- if (n)
606
- if (G(_)) {
607
- for (var F = 0; F < _.length; F++)
608
- xa(_[F], a);
609
- Object.freeze && Object.freeze(_);
610
- } else
611
- g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
- else
613
- xa(_, a);
614
- }
615
- if ($.call(r, "key")) {
616
- var P = O(a), h = Object.keys(r).filter(function(pr) {
617
- return pr !== "key";
618
- }), aa = h.length > 0 ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}";
619
- if (!Ta[P + aa]) {
620
- var dr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
621
- g(`A props object containing a "key" prop is being spread into JSX:
622
- let props = %s;
623
- <%s {...props} />
624
- React keys must be passed directly to JSX without using spread:
625
- let props = %s;
626
- <%s key={someKey} {...props} />`, aa, P, dr, P), Ta[P + aa] = !0;
627
- }
628
- }
629
- return a === v ? sr(d) : or(d), d;
630
- }
631
- }
632
- function ur(a, r, e) {
633
- return Sa(a, r, e, !0);
634
- }
635
- function lr(a, r, e) {
636
- return Sa(a, r, e, !1);
637
- }
638
- var cr = lr, fr = ur;
639
- Y.Fragment = v, Y.jsx = cr, Y.jsxs = fr;
640
- }()), Y;
641
- }
642
- process.env.NODE_ENV === "production" ? ra.exports = gr() : ra.exports = mr();
643
- var k = ra.exports;
644
- const yr = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap");
1
+ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
+ import { useMemo as h } from "react";
3
+ const x = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap");
645
4
 
646
5
  :root {
647
6
  /* spacing */
@@ -789,96 +148,96 @@ const yr = `@import url("https://fonts.googleapis.com/css2?family=Montserrat:wgh
789
148
  background-color: transparent;
790
149
  cursor: default;
791
150
  }
792
- `, M = "...", z = (m, c) => {
793
- let w = c - m + 1;
794
- return Array.from({ length: w }, (v, f) => f + m);
795
- }, br = ({
796
- totalCount: m,
151
+ `, u = "...", m = (n, i) => {
152
+ let s = i - n + 1;
153
+ return Array.from({ length: s }, (t, a) => a + n);
154
+ }, w = ({
155
+ totalCount: n,
797
156
  // pageSize,
798
- siblingCount: c = 1,
799
- currentPage: w
800
- }) => vr(() => {
801
- const f = m;
802
- if (c + 5 >= f)
803
- return z(1, f);
804
- const S = Math.max(w - c, 1), E = Math.min(
805
- w + c,
806
- f
807
- ), u = S > 2, y = E < f - 2, p = 1, x = f;
808
- if (!u && y) {
809
- let R = 3 + 2 * c;
810
- return [...z(1, R), M, f];
157
+ siblingCount: i = 1,
158
+ currentPage: s
159
+ }) => h(() => {
160
+ const a = n;
161
+ if (i + 5 >= a)
162
+ return m(1, a);
163
+ const c = Math.max(s - i, 1), d = Math.min(
164
+ s + i,
165
+ a
166
+ ), l = c > 2, r = d < a - 2, g = 1, v = a;
167
+ if (!l && r) {
168
+ let p = 3 + 2 * i;
169
+ return [...m(1, p), u, a];
811
170
  }
812
- if (u && !y) {
813
- let R = 3 + 2 * c, j = z(
814
- f - R + 1,
815
- f
171
+ if (l && !r) {
172
+ let p = 3 + 2 * i, f = m(
173
+ a - p + 1,
174
+ a
816
175
  );
817
- return [p, M, ...j];
176
+ return [g, u, ...f];
818
177
  }
819
- if (u && y) {
820
- let R = z(S, E);
821
- return [p, M, ...R, M, x];
178
+ if (l && r) {
179
+ let p = m(c, d);
180
+ return [g, u, ...p, u, v];
822
181
  }
823
- }, [m, c, w]), Ca = "starasia-pagination-styles", hr = (m) => {
824
- if (!document.getElementById(Ca)) {
825
- const c = document.createElement("style");
826
- c.id = Ca, c.textContent = m, document.head.appendChild(c);
182
+ }, [n, i, s]), y = "starasia-pagination-styles", k = (n) => {
183
+ if (!document.getElementById(y)) {
184
+ const i = document.createElement("style");
185
+ i.id = y, i.textContent = n, document.head.appendChild(i);
827
186
  }
828
187
  };
829
- hr(yr);
830
- const Er = ({
831
- onPageChange: m,
832
- totalCount: c,
833
- siblingCount: w = 1,
834
- currentPage: v,
835
- size: f = "md"
188
+ k(x);
189
+ const N = ({
190
+ onPageChange: n,
191
+ totalCount: i,
192
+ siblingCount: s = 1,
193
+ currentPage: t,
194
+ size: a = "md"
836
195
  }) => {
837
- const T = br({
838
- currentPage: v,
839
- totalCount: c,
840
- siblingCount: w
196
+ const e = w({
197
+ currentPage: t,
198
+ totalCount: i,
199
+ siblingCount: s
841
200
  // pageSize
842
201
  });
843
- if (v === 0 || T.length < 2)
202
+ if (t === 0 || e.length < 2)
844
203
  return null;
845
- const S = () => {
846
- m(v + 1);
847
- }, E = () => {
848
- m(v - 1);
204
+ const c = () => {
205
+ n(t + 1);
206
+ }, d = () => {
207
+ n(t - 1);
849
208
  };
850
- let u = T[T.length - 1];
851
- return /* @__PURE__ */ k.jsxs("ul", { className: "starasia-pagination-container", style: { padding: 0 }, children: [
852
- /* @__PURE__ */ k.jsx(
209
+ let l = e[e.length - 1];
210
+ return /* @__PURE__ */ b("ul", { className: "starasia-pagination-container", style: { padding: 0 }, children: [
211
+ /* @__PURE__ */ o(
853
212
  "li",
854
213
  {
855
- className: `starasia-pagination-item ${v === 1 ? "starasia-pagination-disabled" : null} ${f === "sm" ? "starasia-pagination-item-responsive" : ""}`,
856
- onClick: E,
857
- children: /* @__PURE__ */ k.jsx("div", { className: "starasia-pagination-arrow starasia-pagination-left" })
214
+ className: `starasia-pagination-item ${t === 1 ? "starasia-pagination-disabled" : null} ${a === "sm" ? "starasia-pagination-item-responsive" : ""}`,
215
+ onClick: d,
216
+ children: /* @__PURE__ */ o("div", { className: "starasia-pagination-arrow starasia-pagination-left" })
858
217
  }
859
218
  ),
860
- T.map((y, p) => y === M ? /* @__PURE__ */ k.jsx(
219
+ e.map((r, g) => r === u ? /* @__PURE__ */ o(
861
220
  "li",
862
221
  {
863
- className: `starasia-pagination-item starasia-pagination-dots ${f === "sm" ? "starasia-pagination-item-responsive" : ""}`,
222
+ className: `starasia-pagination-item starasia-pagination-dots ${a === "sm" ? "starasia-pagination-item-responsive" : ""}`,
864
223
  children: "…"
865
224
  },
866
- p
867
- ) : /* @__PURE__ */ k.jsx(
225
+ g
226
+ ) : /* @__PURE__ */ o(
868
227
  "li",
869
228
  {
870
- className: `starasia-pagination-item ${y === v ? "starasia-pagination-selected" : null} ${f === "sm" ? "starasia-pagination-item-responsive" : ""}`,
871
- onClick: () => m(Number(y)),
872
- children: y
229
+ className: `starasia-pagination-item ${r === t ? "starasia-pagination-selected" : null} ${a === "sm" ? "starasia-pagination-item-responsive" : ""}`,
230
+ onClick: () => n(Number(r)),
231
+ children: r
873
232
  },
874
- p
233
+ g
875
234
  )),
876
- /* @__PURE__ */ k.jsx(
235
+ /* @__PURE__ */ o(
877
236
  "li",
878
237
  {
879
- className: `starasia-pagination-item ${v === u ? "starasia-pagination-disabled" : null} ${f === "sm" ? "starasia-pagination-item-responsive" : ""}`,
880
- onClick: S,
881
- children: /* @__PURE__ */ k.jsx(
238
+ className: `starasia-pagination-item ${t === l ? "starasia-pagination-disabled" : null} ${a === "sm" ? "starasia-pagination-item-responsive" : ""}`,
239
+ onClick: c,
240
+ children: /* @__PURE__ */ o(
882
241
  "div",
883
242
  {
884
243
  className: "starasia-pagination-arrow starasia-pagination-right"
@@ -889,5 +248,5 @@ const Er = ({
889
248
  ] });
890
249
  };
891
250
  export {
892
- Er as Pagination
251
+ N as Pagination
893
252
  };
@@ -1,35 +1,4 @@
1
- (function(j,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(j=typeof globalThis<"u"?globalThis:j||self,P(j.Pagination={},j.React))})(this,function(j,P){"use strict";var K={exports:{}},$={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ta;function Da(){if(ta)return $;ta=1;var m=P,c=Symbol.for("react.element"),w=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,f=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function S(E,u,y){var p,x={},R=null,k=null;y!==void 0&&(R=""+y),u.key!==void 0&&(R=""+u.key),u.ref!==void 0&&(k=u.ref);for(p in u)g.call(u,p)&&!T.hasOwnProperty(p)&&(x[p]=u[p]);if(E&&E.defaultProps)for(p in u=E.defaultProps,u)x[p]===void 0&&(x[p]=u[p]);return{$$typeof:c,type:E,key:R,ref:k,props:x,_owner:f.current}}return $.Fragment=w,$.jsx=S,$.jsxs=S,$}var N={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ia;function Aa(){return ia||(ia=1,process.env.NODE_ENV!=="production"&&function(){var m=P,c=Symbol.for("react.element"),w=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),E=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),sa=Symbol.iterator,$a="@@iterator";function Na(a){if(a===null||typeof a!="object")return null;var r=sa&&a[sa]||a[$a];return typeof r=="function"?r:null}var F=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(a){{for(var r=arguments.length,e=new Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];Ya("error",a,e)}}function Ya(a,r,e){{var n=F.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",e=e.concat([o]));var s=e.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[a],console,s)}}var Ma=!1,La=!1,Ua=!1,Va=!1,qa=!1,ua;ua=Symbol.for("react.module.reference");function za(a){return!!(typeof a=="string"||typeof a=="function"||a===g||a===T||qa||a===f||a===y||a===p||Va||a===k||Ma||La||Ua||typeof a=="object"&&a!==null&&(a.$$typeof===R||a.$$typeof===x||a.$$typeof===S||a.$$typeof===E||a.$$typeof===u||a.$$typeof===ua||a.getModuleId!==void 0))}function Ba(a,r,e){var n=a.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?e+"("+o+")":e}function la(a){return a.displayName||"Context"}function O(a){if(a==null)return null;if(typeof a.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case g:return"Fragment";case w:return"Portal";case T:return"Profiler";case f:return"StrictMode";case y:return"Suspense";case p:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case E:var r=a;return la(r)+".Consumer";case S:var e=a;return la(e._context)+".Provider";case u:return Ba(a,a.render,"ForwardRef");case x:var n=a.displayName||null;return n!==null?n:O(a.type)||"Memo";case R:{var o=a,s=o._payload,i=o._init;try{return O(i(s))}catch{return null}}}return null}var D=Object.assign,M=0,ca,fa,da,pa,ga,va,ma;function ya(){}ya.__reactDisabledLog=!0;function Ja(){{if(M===0){ca=console.log,fa=console.info,da=console.warn,pa=console.error,ga=console.group,va=console.groupCollapsed,ma=console.groupEnd;var a={configurable:!0,enumerable:!0,value:ya,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}M++}}function Ka(){{if(M--,M===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},a,{value:ca}),info:D({},a,{value:fa}),warn:D({},a,{value:da}),error:D({},a,{value:pa}),group:D({},a,{value:ga}),groupCollapsed:D({},a,{value:va}),groupEnd:D({},a,{value:ma})})}M<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=F.ReactCurrentDispatcher,X;function q(a,r,e){{if(X===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
18
- `+X+a}}var H=!1,z;{var Ga=typeof WeakMap=="function"?WeakMap:Map;z=new Ga}function ba(a,r){if(!a||H)return"";{var e=z.get(a);if(e!==void 0)return e}var n;H=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=G.current,G.current=null,Ja();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(h){n=h}Reflect.construct(a,[],i)}else{try{i.call()}catch(h){n=h}a.call(i.prototype)}}else{try{throw Error()}catch(h){n=h}a()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var t=h.stack.split(`
19
- `),b=n.stack.split(`
20
- `),l=t.length-1,d=b.length-1;l>=1&&d>=0&&t[l]!==b[d];)d--;for(;l>=1&&d>=0;l--,d--)if(t[l]!==b[d]){if(l!==1||d!==1)do if(l--,d--,d<0||t[l]!==b[d]){var _=`
21
- `+t[l].replace(" at new "," at ");return a.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",a.displayName)),typeof a=="function"&&z.set(a,_),_}while(l>=1&&d>=0);break}}}finally{H=!1,G.current=s,Ka(),Error.prepareStackTrace=o}var W=a?a.displayName||a.name:"",A=W?q(W):"";return typeof a=="function"&&z.set(a,A),A}function Xa(a,r,e){return ba(a,!1)}function Ha(a){var r=a.prototype;return!!(r&&r.isReactComponent)}function B(a,r,e){if(a==null)return"";if(typeof a=="function")return ba(a,Ha(a));if(typeof a=="string")return q(a);switch(a){case y:return q("Suspense");case p:return q("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return Xa(a.render);case x:return B(a.type,r,e);case R:{var n=a,o=n._payload,s=n._init;try{return B(s(o),r,e)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,ha={},Ra=F.ReactDebugCurrentFrame;function J(a){if(a){var r=a._owner,e=B(a.type,a._source,r?r.type:null);Ra.setExtraStackFrame(e)}else Ra.setExtraStackFrame(null)}function Za(a,r,e,n,o){{var s=Function.call.bind(L);for(var i in a)if(s(a,i)){var t=void 0;try{if(typeof a[i]!="function"){var b=Error((n||"React class")+": "+e+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}t=a[i](r,i,n,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){t=l}t&&!(t instanceof Error)&&(J(o),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",e,i,typeof t),J(null)),t instanceof Error&&!(t.message in ha)&&(ha[t.message]=!0,J(o),v("Failed %s type: %s",e,t.message),J(null))}}}var Qa=Array.isArray;function Z(a){return Qa(a)}function ar(a){{var r=typeof Symbol=="function"&&Symbol.toStringTag,e=r&&a[Symbol.toStringTag]||a.constructor.name||"Object";return e}}function rr(a){try{return Ea(a),!1}catch{return!0}}function Ea(a){return""+a}function _a(a){if(rr(a))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(a)),Ea(a)}var U=F.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},wa,xa,Q;Q={};function nr(a){if(L.call(a,"ref")){var r=Object.getOwnPropertyDescriptor(a,"ref").get;if(r&&r.isReactWarning)return!1}return a.ref!==void 0}function tr(a){if(L.call(a,"key")){var r=Object.getOwnPropertyDescriptor(a,"key").get;if(r&&r.isReactWarning)return!1}return a.key!==void 0}function ir(a,r){if(typeof a.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var e=O(U.current.type);Q[e]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',O(U.current.type),a.ref),Q[e]=!0)}}function or(a,r){{var e=function(){wa||(wa=!0,v("%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://reactjs.org/link/special-props)",r))};e.isReactWarning=!0,Object.defineProperty(a,"key",{get:e,configurable:!0})}}function sr(a,r){{var e=function(){xa||(xa=!0,v("%s: `ref` 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://reactjs.org/link/special-props)",r))};e.isReactWarning=!0,Object.defineProperty(a,"ref",{get:e,configurable:!0})}}var ur=function(a,r,e,n,o,s,i){var t={$$typeof:c,type:a,key:r,ref:e,props:i,_owner:s};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function lr(a,r,e,n,o){{var s,i={},t=null,b=null;e!==void 0&&(_a(e),t=""+e),tr(r)&&(_a(r.key),t=""+r.key),nr(r)&&(b=r.ref,ir(r,o));for(s in r)L.call(r,s)&&!er.hasOwnProperty(s)&&(i[s]=r[s]);if(a&&a.defaultProps){var l=a.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(t||b){var d=typeof a=="function"?a.displayName||a.name||"Unknown":a;t&&or(i,d),b&&sr(i,d)}return ur(a,t,b,o,n,U.current,i)}}var aa=F.ReactCurrentOwner,Ta=F.ReactDebugCurrentFrame;function I(a){if(a){var r=a._owner,e=B(a.type,a._source,r?r.type:null);Ta.setExtraStackFrame(e)}else Ta.setExtraStackFrame(null)}var ra;ra=!1;function ea(a){return typeof a=="object"&&a!==null&&a.$$typeof===c}function Sa(){{if(aa.current){var a=O(aa.current.type);if(a)return`
22
-
23
- Check the render method of \``+a+"`."}return""}}function cr(a){{if(a!==void 0){var r=a.fileName.replace(/^.*[\\\/]/,""),e=a.lineNumber;return`
24
-
25
- Check your code at `+r+":"+e+"."}return""}}var Oa={};function fr(a){{var r=Sa();if(!r){var e=typeof a=="string"?a:a.displayName||a.name;e&&(r=`
26
-
27
- Check the top-level render call using <`+e+">.")}return r}}function ja(a,r){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var e=fr(r);if(Oa[e])return;Oa[e]=!0;var n="";a&&a._owner&&a._owner!==aa.current&&(n=" It was passed a child from "+O(a._owner.type)+"."),I(a),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',e,n),I(null)}}function Pa(a,r){{if(typeof a!="object")return;if(Z(a))for(var e=0;e<a.length;e++){var n=a[e];ea(n)&&ja(n,r)}else if(ea(a))a._store&&(a._store.validated=!0);else if(a){var o=Na(a);if(typeof o=="function"&&o!==a.entries)for(var s=o.call(a),i;!(i=s.next()).done;)ea(i.value)&&ja(i.value,r)}}}function dr(a){{var r=a.type;if(r==null||typeof r=="string")return;var e;if(typeof r=="function")e=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===x))e=r.propTypes;else return;if(e){var n=O(r);Za(e,a.props,"prop",n,a)}else if(r.PropTypes!==void 0&&!ra){ra=!0;var o=O(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pr(a){{for(var r=Object.keys(a.props),e=0;e<r.length;e++){var n=r[e];if(n!=="children"&&n!=="key"){I(a),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}a.ref!==null&&(I(a),v("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var Ca={};function ka(a,r,e,n,o,s){{var i=za(a);if(!i){var t="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=cr(o);b?t+=b:t+=Sa();var l;a===null?l="null":Z(a)?l="array":a!==void 0&&a.$$typeof===c?(l="<"+(O(a.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):l=typeof a,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,t)}var d=lr(a,r,e,o,s);if(d==null)return d;if(i){var _=r.children;if(_!==void 0)if(n)if(Z(_)){for(var W=0;W<_.length;W++)Pa(_[W],a);Object.freeze&&Object.freeze(_)}else v("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 Pa(_,a)}if(L.call(r,"key")){var A=O(a),h=Object.keys(r).filter(function(hr){return hr!=="key"}),na=h.length>0?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}";if(!Ca[A+na]){var br=h.length>0?"{"+h.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
28
- let props = %s;
29
- <%s {...props} />
30
- React keys must be passed directly to JSX without using spread:
31
- let props = %s;
32
- <%s key={someKey} {...props} />`,na,A,br,A),Ca[A+na]=!0}}return a===g?pr(d):dr(d),d}}function gr(a,r,e){return ka(a,r,e,!0)}function vr(a,r,e){return ka(a,r,e,!1)}var mr=vr,yr=gr;N.Fragment=g,N.jsx=mr,N.jsxs=yr}()),N}process.env.NODE_ENV==="production"?K.exports=Da():K.exports=Aa();var C=K.exports;const Fa=`@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap");
1
+ (function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.Pagination={},r.jsxRuntime,r.React))})(this,function(r,n,h){"use strict";const b=`@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap");
33
2
 
34
3
  :root {
35
4
  /* spacing */
@@ -177,4 +146,4 @@ React keys must be passed directly to JSX without using spread:
177
146
  background-color: transparent;
178
147
  cursor: default;
179
148
  }
180
- `,Y="...",V=(m,c)=>{let w=c-m+1;return Array.from({length:w},(g,f)=>f+m)},Ia=({totalCount:m,siblingCount:c=1,currentPage:w})=>P.useMemo(()=>{const f=m;if(c+5>=f)return V(1,f);const S=Math.max(w-c,1),E=Math.min(w+c,f),u=S>2,y=E<f-2,p=1,x=f;if(!u&&y){let R=3+2*c;return[...V(1,R),Y,f]}if(u&&!y){let R=3+2*c,k=V(f-R+1,f);return[p,Y,...k]}if(u&&y){let R=V(S,E);return[p,Y,...R,Y,x]}},[m,c,w]),oa="starasia-pagination-styles";(m=>{if(!document.getElementById(oa)){const c=document.createElement("style");c.id=oa,c.textContent=m,document.head.appendChild(c)}})(Fa);const Wa=({onPageChange:m,totalCount:c,siblingCount:w=1,currentPage:g,size:f="md"})=>{const T=Ia({currentPage:g,totalCount:c,siblingCount:w});if(g===0||T.length<2)return null;const S=()=>{m(g+1)},E=()=>{m(g-1)};let u=T[T.length-1];return C.jsxs("ul",{className:"starasia-pagination-container",style:{padding:0},children:[C.jsx("li",{className:`starasia-pagination-item ${g===1?"starasia-pagination-disabled":null} ${f==="sm"?"starasia-pagination-item-responsive":""}`,onClick:E,children:C.jsx("div",{className:"starasia-pagination-arrow starasia-pagination-left"})}),T.map((y,p)=>y===Y?C.jsx("li",{className:`starasia-pagination-item starasia-pagination-dots ${f==="sm"?"starasia-pagination-item-responsive":""}`,children:"…"},p):C.jsx("li",{className:`starasia-pagination-item ${y===g?"starasia-pagination-selected":null} ${f==="sm"?"starasia-pagination-item-responsive":""}`,onClick:()=>m(Number(y)),children:y},p)),C.jsx("li",{className:`starasia-pagination-item ${g===u?"starasia-pagination-disabled":null} ${f==="sm"?"starasia-pagination-item-responsive":""}`,onClick:S,children:C.jsx("div",{className:"starasia-pagination-arrow starasia-pagination-right"})})]})};j.Pagination=Wa,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
149
+ `,l="...",d=(t,i)=>{let e=i-t+1;return Array.from({length:e},(s,a)=>a+t)},x=({totalCount:t,siblingCount:i=1,currentPage:e})=>h.useMemo(()=>{const a=t;if(i+5>=a)return d(1,a);const m=Math.max(e-i,1),f=Math.min(e+i,a),p=m>2,o=f<a-2,c=1,S=a;if(!p&&o){let u=3+2*i;return[...d(1,u),l,a]}if(p&&!o){let u=3+2*i,v=d(a-u+1,a);return[c,l,...v]}if(p&&o){let u=d(m,f);return[c,l,...u,l,S]}},[t,i,e]),y="starasia-pagination-styles";(t=>{if(!document.getElementById(y)){const i=document.createElement("style");i.id=y,i.textContent=t,document.head.appendChild(i)}})(b);const w=({onPageChange:t,totalCount:i,siblingCount:e=1,currentPage:s,size:a="md"})=>{const g=x({currentPage:s,totalCount:i,siblingCount:e});if(s===0||g.length<2)return null;const m=()=>{t(s+1)},f=()=>{t(s-1)};let p=g[g.length-1];return n.jsxs("ul",{className:"starasia-pagination-container",style:{padding:0},children:[n.jsx("li",{className:`starasia-pagination-item ${s===1?"starasia-pagination-disabled":null} ${a==="sm"?"starasia-pagination-item-responsive":""}`,onClick:f,children:n.jsx("div",{className:"starasia-pagination-arrow starasia-pagination-left"})}),g.map((o,c)=>o===l?n.jsx("li",{className:`starasia-pagination-item starasia-pagination-dots ${a==="sm"?"starasia-pagination-item-responsive":""}`,children:"…"},c):n.jsx("li",{className:`starasia-pagination-item ${o===s?"starasia-pagination-selected":null} ${a==="sm"?"starasia-pagination-item-responsive":""}`,onClick:()=>t(Number(o)),children:o},c)),n.jsx("li",{className:`starasia-pagination-item ${s===p?"starasia-pagination-disabled":null} ${a==="sm"?"starasia-pagination-item-responsive":""}`,onClick:m,children:n.jsx("div",{className:"starasia-pagination-arrow starasia-pagination-right"})})]})};r.Pagination=w,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starasia/pagination",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "pagination component for starasia UI",
5
5
  "author": "Prawito Hudoro",
6
6
  "main": "dist/pagination.umd.js",
@@ -12,16 +12,16 @@
12
12
  "dist/*.map",
13
13
  "dist/*.css"
14
14
  ],
15
- "scripts": {
16
- "dev": "vite --config vite.config.ts --port 3000",
17
- "build": "vite build --config vite.config.ts"
18
- },
19
15
  "keywords": [],
20
16
  "license": "ISC",
21
17
  "type": "module",
22
18
  "engines": {
23
19
  "node": ">=18.0.0"
24
20
  },
21
+ "peerDependencies": {
22
+ "react": ">=18.0.0 <20.0.0",
23
+ "react-dom": ">=18.0.0 <20.0.0"
24
+ },
25
25
  "devDependencies": {
26
26
  "@types/node": "^20.11.16",
27
27
  "@vitejs/plugin-react": "^4.2.1",
@@ -33,5 +33,9 @@
33
33
  "react-dom": "^18.2.0",
34
34
  "@types/react": "^18.2.55",
35
35
  "@types/react-dom": "^18.2.19"
36
+ },
37
+ "scripts": {
38
+ "dev": "vite --config vite.config.ts --port 3000",
39
+ "build": "vite build --config vite.config.ts"
36
40
  }
37
- }
41
+ }