react-simplicity-lib
Version:
**react-simplicity-lib** is a collection of reusable React components that simplify UI development. This library includes various components like `Toggle`, `Modal`, `Tabs`, `HoverCard`, `Table`, and more, designed for easy integration and customization.
910 lines (907 loc) • 29.6 kB
JavaScript
import Ne, { useState as A, useEffect as H, useRef as vr, Children as pr } from "react";
import './index.css';var ce = { exports: {} }, B = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Fe;
function hr() {
if (Fe) return B;
Fe = 1;
var f = Ne, u = Symbol.for("react.element"), R = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, h = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
function m(y, a, _) {
var p, c = {}, o = null, T = null;
_ !== void 0 && (o = "" + _), a.key !== void 0 && (o = "" + a.key), a.ref !== void 0 && (T = a.ref);
for (p in a) g.call(a, p) && !b.hasOwnProperty(p) && (c[p] = a[p]);
if (y && y.defaultProps) for (p in a = y.defaultProps, a) c[p] === void 0 && (c[p] = a[p]);
return { $$typeof: u, type: y, key: o, ref: T, props: c, _owner: h.current };
}
return B.Fragment = R, B.jsx = m, B.jsxs = m, B;
}
var X = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Me;
function gr() {
return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
var f = Ne, u = Symbol.for("react.element"), R = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), y = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), o = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), $ = Symbol.iterator, w = "@@iterator";
function D(e) {
if (e === null || typeof e != "object")
return null;
var r = $ && e[$] || e[w];
return typeof r == "function" ? r : null;
}
var S = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function x(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
t[n - 1] = arguments[n];
Y("error", e, t);
}
}
function Y(e, r, t) {
{
var n = S.ReactDebugCurrentFrame, d = n.getStackAddendum();
d !== "" && (r += "%s", t = t.concat([d]));
var v = t.map(function(s) {
return String(s);
});
v.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, v);
}
}
var W = !1, Z = !1, Q = !1, z = !1, ee = !1, fe;
fe = Symbol.for("react.module.reference");
function Ie(e) {
return !!(typeof e == "string" || typeof e == "function" || e === g || e === b || ee || e === h || e === _ || e === p || z || e === T || W || Z || Q || typeof e == "object" && e !== null && (e.$$typeof === o || e.$$typeof === c || e.$$typeof === m || e.$$typeof === y || e.$$typeof === a || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === fe || e.getModuleId !== void 0));
}
function Ye(e, r, t) {
var n = e.displayName;
if (n)
return n;
var d = r.displayName || r.name || "";
return d !== "" ? t + "(" + d + ")" : t;
}
function de(e) {
return e.displayName || "Context";
}
function k(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case g:
return "Fragment";
case R:
return "Portal";
case b:
return "Profiler";
case h:
return "StrictMode";
case _:
return "Suspense";
case p:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case y:
var r = e;
return de(r) + ".Consumer";
case m:
var t = e;
return de(t._context) + ".Provider";
case a:
return Ye(e, e.render, "ForwardRef");
case c:
var n = e.displayName || null;
return n !== null ? n : k(e.type) || "Memo";
case o: {
var d = e, v = d._payload, s = d._init;
try {
return k(s(v));
} catch {
return null;
}
}
}
return null;
}
var F = Object.assign, L = 0, ve, pe, he, ge, be, me, ye;
function Ee() {
}
Ee.__reactDisabledLog = !0;
function We() {
{
if (L === 0) {
ve = console.log, pe = console.info, he = console.warn, ge = console.error, be = console.group, me = console.groupCollapsed, ye = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: Ee,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
L++;
}
}
function Le() {
{
if (L--, L === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: F({}, e, {
value: ve
}),
info: F({}, e, {
value: pe
}),
warn: F({}, e, {
value: he
}),
error: F({}, e, {
value: ge
}),
group: F({}, e, {
value: be
}),
groupCollapsed: F({}, e, {
value: me
}),
groupEnd: F({}, e, {
value: ye
})
});
}
L < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var re = S.ReactCurrentDispatcher, te;
function q(e, r, t) {
{
if (te === void 0)
try {
throw Error();
} catch (d) {
var n = d.stack.trim().match(/\n( *(at )?)/);
te = n && n[1] || "";
}
return `
` + te + e;
}
}
var ne = !1, J;
{
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
J = new Ve();
}
function Re(e, r) {
if (!e || ne)
return "";
{
var t = J.get(e);
if (t !== void 0)
return t;
}
var n;
ne = !0;
var d = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var v;
v = re.current, re.current = null, We();
try {
if (r) {
var s = function() {
throw Error();
};
if (Object.defineProperty(s.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(s, []);
} catch (O) {
n = O;
}
Reflect.construct(e, [], s);
} else {
try {
s.call();
} catch (O) {
n = O;
}
e.call(s.prototype);
}
} else {
try {
throw Error();
} catch (O) {
n = O;
}
e();
}
} catch (O) {
if (O && n && typeof O.stack == "string") {
for (var i = O.stack.split(`
`), C = n.stack.split(`
`), E = i.length - 1, j = C.length - 1; E >= 1 && j >= 0 && i[E] !== C[j]; )
j--;
for (; E >= 1 && j >= 0; E--, j--)
if (i[E] !== C[j]) {
if (E !== 1 || j !== 1)
do
if (E--, j--, j < 0 || i[E] !== C[j]) {
var P = `
` + i[E].replace(" at new ", " at ");
return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && J.set(e, P), P;
}
while (E >= 1 && j >= 0);
break;
}
}
} finally {
ne = !1, re.current = v, Le(), Error.prepareStackTrace = d;
}
var I = e ? e.displayName || e.name : "", M = I ? q(I) : "";
return typeof e == "function" && J.set(e, M), M;
}
function Ue(e, r, t) {
return Re(e, !1);
}
function Be(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function K(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return Re(e, Be(e));
if (typeof e == "string")
return q(e);
switch (e) {
case _:
return q("Suspense");
case p:
return q("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case a:
return Ue(e.render);
case c:
return K(e.type, r, t);
case o: {
var n = e, d = n._payload, v = n._init;
try {
return K(v(d), r, t);
} catch {
}
}
}
return "";
}
var V = Object.prototype.hasOwnProperty, _e = {}, xe = S.ReactDebugCurrentFrame;
function G(e) {
if (e) {
var r = e._owner, t = K(e.type, e._source, r ? r.type : null);
xe.setExtraStackFrame(t);
} else
xe.setExtraStackFrame(null);
}
function Xe(e, r, t, n, d) {
{
var v = Function.call.bind(V);
for (var s in e)
if (v(e, s)) {
var i = void 0;
try {
if (typeof e[s] != "function") {
var C = Error((n || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw C.name = "Invariant Violation", C;
}
i = e[s](r, s, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (E) {
i = E;
}
i && !(i instanceof Error) && (G(d), x("%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", t, s, typeof i), G(null)), i instanceof Error && !(i.message in _e) && (_e[i.message] = !0, G(d), x("Failed %s type: %s", t, i.message), G(null));
}
}
}
var qe = Array.isArray;
function ae(e) {
return qe(e);
}
function Je(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function Ke(e) {
try {
return je(e), !1;
} catch {
return !0;
}
}
function je(e) {
return "" + e;
}
function Te(e) {
if (Ke(e))
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), je(e);
}
var U = S.ReactCurrentOwner, Ge = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ce, Oe, oe;
oe = {};
function He(e) {
if (V.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function Ze(e) {
if (V.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Qe(e, r) {
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
var t = k(U.current.type);
oe[t] || (x('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', k(U.current.type), e.ref), oe[t] = !0);
}
}
function ze(e, r) {
{
var t = function() {
Ce || (Ce = !0, x("%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));
};
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
}
function er(e, r) {
{
var t = function() {
Oe || (Oe = !0, x("%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));
};
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: t,
configurable: !0
});
}
}
var rr = function(e, r, t, n, d, v, s) {
var i = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: u,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: s,
// Record the component responsible for creating this element.
_owner: v
};
return i._store = {}, Object.defineProperty(i._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(i, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: n
}), Object.defineProperty(i, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: d
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
};
function tr(e, r, t, n, d) {
{
var v, s = {}, i = null, C = null;
t !== void 0 && (Te(t), i = "" + t), Ze(r) && (Te(r.key), i = "" + r.key), He(r) && (C = r.ref, Qe(r, d));
for (v in r)
V.call(r, v) && !Ge.hasOwnProperty(v) && (s[v] = r[v]);
if (e && e.defaultProps) {
var E = e.defaultProps;
for (v in E)
s[v] === void 0 && (s[v] = E[v]);
}
if (i || C) {
var j = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
i && ze(s, j), C && er(s, j);
}
return rr(e, i, C, d, n, U.current, s);
}
}
var ie = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
function N(e) {
if (e) {
var r = e._owner, t = K(e.type, e._source, r ? r.type : null);
Pe.setExtraStackFrame(t);
} else
Pe.setExtraStackFrame(null);
}
var se;
se = !1;
function le(e) {
return typeof e == "object" && e !== null && e.$$typeof === u;
}
function we() {
{
if (ie.current) {
var e = k(ie.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function nr(e) {
return "";
}
var Se = {};
function ar(e) {
{
var r = we();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
}
}
function ke(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var t = ar(r);
if (Se[t])
return;
Se[t] = !0;
var n = "";
e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + k(e._owner.type) + "."), N(e), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), N(null);
}
}
function $e(e, r) {
{
if (typeof e != "object")
return;
if (ae(e))
for (var t = 0; t < e.length; t++) {
var n = e[t];
le(n) && ke(n, r);
}
else if (le(e))
e._store && (e._store.validated = !0);
else if (e) {
var d = D(e);
if (typeof d == "function" && d !== e.entries)
for (var v = d.call(e), s; !(s = v.next()).done; )
le(s.value) && ke(s.value, r);
}
}
}
function or(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var t;
if (typeof r == "function")
t = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === a || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === c))
t = r.propTypes;
else
return;
if (t) {
var n = k(r);
Xe(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !se) {
se = !0;
var d = k(r);
x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function ir(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var n = r[t];
if (n !== "children" && n !== "key") {
N(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), N(null);
break;
}
}
e.ref !== null && (N(e), x("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
}
}
var Ae = {};
function De(e, r, t, n, d, v) {
{
var s = Ie(e);
if (!s) {
var i = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " 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 C = nr();
C ? i += C : i += we();
var E;
e === null ? E = "null" : ae(e) ? E = "array" : e !== void 0 && e.$$typeof === u ? (E = "<" + (k(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, i);
}
var j = tr(e, r, t, d, v);
if (j == null)
return j;
if (s) {
var P = r.children;
if (P !== void 0)
if (n)
if (ae(P)) {
for (var I = 0; I < P.length; I++)
$e(P[I], e);
Object.freeze && Object.freeze(P);
} else
x("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
$e(P, e);
}
if (V.call(r, "key")) {
var M = k(e), O = Object.keys(r).filter(function(dr) {
return dr !== "key";
}), ue = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Ae[M + ue]) {
var fr = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
x(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, ue, M, fr, M), Ae[M + ue] = !0;
}
}
return e === g ? ir(j) : or(j), j;
}
}
function sr(e, r, t) {
return De(e, r, t, !0);
}
function lr(e, r, t) {
return De(e, r, t, !1);
}
var ur = lr, cr = sr;
X.Fragment = g, X.jsx = ur, X.jsxs = cr;
}()), X;
}
process.env.NODE_ENV === "production" ? ce.exports = hr() : ce.exports = gr();
var l = ce.exports;
const yr = ({
toggleState: f = void 0,
onChangeToggleState: u,
labelOn: R = "On",
labelOff: g = "Off",
ballSize: h = 24,
transitionDuration: b = "300ms",
backgroundColorOn: m = "white",
backgroundColorOff: y = "lightgray",
ballColorOn: a = "#348dfa",
ballColorOff: _ = "grey",
style: p = {},
className: c = ""
}) => {
const [o, T] = A(f);
H(() => {
f !== void 0 && T(f);
}, [f]);
const $ = () => {
f !== void 0 ? u && u(!o) : T(!o);
};
return /* @__PURE__ */ l.jsxs(
"div",
{
className: `toggle ${c}`,
style: { "--ballSize": `${h}px`, ...p },
children: [
/* @__PURE__ */ l.jsx(
"div",
{
className: "toggle-area",
onClick: () => $(),
style: {
backgroundColor: o ? m : y,
border: `.5px solid ${y}`,
boxShadow: o ? `0 0 2px ${a}` : "none",
transitionDuration: b
},
children: /* @__PURE__ */ l.jsx(
"div",
{
className: "toggle-ball-container",
style: { width: o ? h : h * 2, transitionDuration: b },
children: /* @__PURE__ */ l.jsx(
"div",
{
className: "toggle-ball",
style: { backgroundColor: o ? a : _ }
}
)
}
)
}
),
/* @__PURE__ */ l.jsx("p", { className: "toggle-label", children: o ? R : g })
]
}
);
}, Er = ({ children: f, className: u = "", style: R = {} }) => {
const g = vr(null), [h, b] = A(null), [m, y] = A({
rotationX: 0,
rotationY: 0,
rotationAngle: 0
}), [a, _] = A(1), p = (w, D) => Math.sqrt(w ** 2 + D ** 2), c = (w, D) => {
const S = w.y / 100, x = -w.x / 100, Y = Math.log(D) * 2;
return { rotationX: S, rotationY: x, rotationAngle: Y };
}, o = (w) => {
if (!h) return;
const D = w.clientX, S = w.clientY, x = D - h.x, Y = S - h.y, W = {
x: x - h.width / 2,
y: Y - h.height / 2
}, Z = p(W.x, W.y), { rotationX: Q, rotationY: z, rotationAngle: ee } = c(
W,
Z
);
y({
rotationX: Q,
rotationY: z,
rotationAngle: ee
}), _(1.07);
}, T = () => {
const w = g.current.getBoundingClientRect();
b(w);
}, $ = () => {
g.current.style.transform = "", g.current.style.backgroundImage = "", _(1);
};
return /* @__PURE__ */ l.jsx(
"div",
{
ref: g,
className: `hover-card ${u}`,
style: {
transform: a !== 1 ? ` scale3d(${a}, ${a}, ${a})
rotate3d(${m.rotationX}, ${m.rotationY}, 0, ${m.rotationAngle}deg)` : "none",
perspective: a !== 1 ? "1500px" : "none",
...R
},
onMouseEnter: T,
onMouseMove: o,
onMouseLeave: $,
children: f
}
);
}, Rr = ({
text: f = "",
baseSpeed: u = 500,
// Base speed for very short texts.
style: R = {},
className: g = "",
onEffectComplete: h = () => {
}
}) => {
const [b, m] = A(""), [y, a] = A(0), p = ((c) => {
const o = u / Math.log(c + 1);
return Math.max(30, Math.min(o, 100));
})(f.length);
return H(() => {
let c;
return y < f.length ? c = setTimeout(() => {
m((o) => o + f[y]), a((o) => o + 1);
}, p) : h(), () => clearTimeout(c);
}, [y, f, p]), H(() => {
m(""), a(0);
}, [f]), /* @__PURE__ */ l.jsx("p", { className: `type-writer ${g}`, style: R, children: b });
}, _r = ({
children: f,
onClick: u,
buttonColor: R = "lightblue",
style: g = {},
className: h = ""
}) => /* @__PURE__ */ l.jsx(
"button",
{
className: `animated-button ${h}`,
onClick: u,
style: { "--color": R, ...g },
children: f
}
), xr = ({
children: f,
isOpen: u,
isCenter: R = !0,
onModalClose: g = () => {
},
className: h = "",
style: b = {}
}) => /* @__PURE__ */ l.jsx(
"div",
{
className: `Modal ${R ? "modal-center" : ""} ${h}`,
style: { ...b, display: br(u, R) },
onClick: (m) => m.target.classList[0] === "Modal" && g(),
children: u && f
}
), br = (f, u) => f ? f && u ? "grid" : "block" : "none", jr = ({
columns: f = [{ name: "", field: "" }],
rows: u = [{ columnName: "value" }],
className: R = "",
style: g = {},
isPagination: h = !1,
pageSize: b = 10,
pageMenuPlacement: m = "center",
isSerialized: y = !1
}) => {
const [a, _] = A([0, b - 1]), p = (c) => {
const [o, T] = a;
c === "next" && T < u.length - 1 ? _([o + b, T + b]) : c === "previous" && o > 0 && _([o - b, T - b]);
};
return /* @__PURE__ */ l.jsxs("div", { className: `simplicity-table ${R}`, style: g, children: [
/* @__PURE__ */ l.jsx("div", { className: "simplicity-table-container", children: /* @__PURE__ */ l.jsxs("table", { children: [
/* @__PURE__ */ l.jsx("thead", { children: /* @__PURE__ */ l.jsxs("tr", { children: [
y && /* @__PURE__ */ l.jsx("th", { children: "S.No" }),
f.map((c, o) => /* @__PURE__ */ l.jsx("th", { children: c.name }, o))
] }) }),
/* @__PURE__ */ l.jsx("tbody", { children: u.slice(a[0], a[1] + 1).map((c, o) => /* @__PURE__ */ l.jsxs("tr", { children: [
y && /* @__PURE__ */ l.jsx("td", { children: a[0] + o + 1 }),
f.map((T, $) => /* @__PURE__ */ l.jsx("td", { children: c[T.field || T.name] }, $))
] }, o)) })
] }) }),
h && /* @__PURE__ */ l.jsxs(
"div",
{
className: "simplicity-table-pagination",
style: { justifyContent: m },
children: [
/* @__PURE__ */ l.jsx(
"button",
{
onClick: () => _([0, b - 1]),
disabled: a[0] === 0,
children: "<<"
}
),
/* @__PURE__ */ l.jsx(
"button",
{
onClick: () => p("previous"),
disabled: a[0] === 0,
children: "<"
}
),
/* @__PURE__ */ l.jsxs("p", { children: [
a[0] + 1,
" - ",
Math.min(a[1] + 1, u.length),
" of",
" ",
u.length
] }),
/* @__PURE__ */ l.jsx(
"button",
{
onClick: () => p("next"),
disabled: a[1] >= u.length - 1,
children: ">"
}
),
/* @__PURE__ */ l.jsx(
"button",
{
onClick: () => _([u.length - b, u.length - 1]),
disabled: a[1] >= u.length - 1,
children: ">>"
}
)
]
}
)
] });
}, Tr = ({
Tabs: f = [],
children: u,
color: R = "#cbdce1",
style: g = {},
className: h = "",
onTabChange: b = () => {
},
value: m = 0,
isNativeMomentDisable: y = !1
}) => {
const [a, _] = A(m);
H(() => {
_(m);
}, [m]);
const p = (c) => {
y || (_(c), b(c));
};
return /* @__PURE__ */ l.jsxs(
"section",
{
className: `Tabs ${h}`,
style: { "--tabColor": R, ...g },
children: [
/* @__PURE__ */ l.jsx("div", { className: "Tabs-names", children: f.map((c, o) => /* @__PURE__ */ l.jsx(
"span",
{
onClick: () => p(o),
className: `Tab-name ${a === o ? "active-tab" : ""}`,
children: c
},
o
)) }),
/* @__PURE__ */ l.jsx("div", { className: "Tabs-area", children: /* @__PURE__ */ l.jsx("div", { style: { left: `-${a * 100}%` }, children: pr.map(u, (c, o) => /* @__PURE__ */ l.jsx(l.Fragment, { children: c })) }) })
]
}
);
}, Cr = ({ children: f, style: u = {}, className: R = "" }) => /* @__PURE__ */ l.jsx("section", { className: `Tab ${R}`, style: u, children: f });
export {
_r as Button,
Er as HoverCard,
xr as Modal,
Cr as Tab,
jr as Table,
Tr as Tabs,
yr as Toggle,
Rr as TypeWriter
};
//# sourceMappingURL=react-simplicity-lib.es.js.map