react-contribution-calendar
Advanced tools
Comparing version 1.1.3 to 1.2.0
import './styles/style.css'; | ||
import We, { useRef as hr, useState as gr, useEffect as mr } from "react"; | ||
var fe = { exports: {} }, V = {}; | ||
import Ve, { useRef as hr, useState as gr, useEffect as mr } from "react"; | ||
var pe = { exports: {} }, q = {}; | ||
/** | ||
@@ -13,21 +13,21 @@ * @license React | ||
*/ | ||
var Ie; | ||
var Ye; | ||
function Er() { | ||
if (Ie) | ||
return V; | ||
Ie = 1; | ||
var n = We, l = Symbol.for("react.element"), a = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, v = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function s(d, h, g) { | ||
var f, p = {}, E = null, R = null; | ||
g !== void 0 && (E = "" + g), h.key !== void 0 && (E = "" + h.key), h.ref !== void 0 && (R = h.ref); | ||
for (f in h) | ||
o.call(h, f) && !b.hasOwnProperty(f) && (p[f] = h[f]); | ||
if (Ye) | ||
return q; | ||
Ye = 1; | ||
var n = Ve, l = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, v = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function o(d, p, y) { | ||
var f, b = {}, _ = null, m = null; | ||
y !== void 0 && (_ = "" + y), p.key !== void 0 && (_ = "" + p.key), p.ref !== void 0 && (m = p.ref); | ||
for (f in p) | ||
i.call(p, f) && !g.hasOwnProperty(f) && (b[f] = p[f]); | ||
if (d && d.defaultProps) | ||
for (f in h = d.defaultProps, h) | ||
p[f] === void 0 && (p[f] = h[f]); | ||
return { $$typeof: l, type: d, key: E, ref: R, props: p, _owner: v.current }; | ||
for (f in p = d.defaultProps, p) | ||
b[f] === void 0 && (b[f] = p[f]); | ||
return { $$typeof: l, type: d, key: _, ref: m, props: b, _owner: v.current }; | ||
} | ||
return V.Fragment = a, V.jsx = s, V.jsxs = s, V; | ||
return q.Fragment = a, q.jsx = o, q.jsxs = o, q; | ||
} | ||
var J = {}; | ||
var G = {}; | ||
/** | ||
@@ -42,53 +42,53 @@ * @license React | ||
*/ | ||
var $e; | ||
var We; | ||
function _r() { | ||
return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() { | ||
var n = We, l = Symbol.for("react.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), d = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), w = Symbol.iterator, k = "@@iterator"; | ||
function Q(e) { | ||
return We || (We = 1, process.env.NODE_ENV !== "production" && function() { | ||
var n = Ve, l = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), d = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), w = Symbol.iterator, F = "@@iterator"; | ||
function k(e) { | ||
if (e === null || typeof e != "object") | ||
return null; | ||
var r = w && e[w] || e[k]; | ||
var r = w && e[w] || e[F]; | ||
return typeof r == "function" ? r : null; | ||
} | ||
var P = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function _(e) { | ||
var N = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function T(e) { | ||
{ | ||
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++) | ||
t[i - 1] = arguments[i]; | ||
C("error", e, t); | ||
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++) | ||
t[s - 1] = arguments[s]; | ||
te("error", e, t); | ||
} | ||
} | ||
function C(e, r, t) { | ||
function te(e, r, t) { | ||
{ | ||
var i = P.ReactDebugCurrentFrame, y = i.getStackAddendum(); | ||
y !== "" && (r += "%s", t = t.concat([y])); | ||
var m = t.map(function(u) { | ||
var s = N.ReactDebugCurrentFrame, h = s.getStackAddendum(); | ||
h !== "" && (r += "%s", t = t.concat([h])); | ||
var E = t.map(function(u) { | ||
return String(u); | ||
}); | ||
m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m); | ||
E.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, E); | ||
} | ||
} | ||
var U = !1, A = !1, M = !1, ee = !1, Ve = !1, ve; | ||
ve = Symbol.for("react.module.reference"); | ||
function Je(e) { | ||
return !!(typeof e == "string" || typeof e == "function" || e === o || e === b || Ve || e === v || e === g || e === f || ee || e === R || U || A || M || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === p || e.$$typeof === s || e.$$typeof === d || e.$$typeof === h || // This needs to include all possible module reference object | ||
var ne = !1, le = !1, P = !1, O = !1, V = !1, $; | ||
$ = Symbol.for("react.module.reference"); | ||
function A(e) { | ||
return !!(typeof e == "string" || typeof e == "function" || e === i || e === g || V || e === v || e === y || e === f || O || e === m || ne || le || P || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === b || e.$$typeof === o || e.$$typeof === d || e.$$typeof === p || // 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 === ve || e.getModuleId !== void 0)); | ||
e.$$typeof === $ || e.getModuleId !== void 0)); | ||
} | ||
function Ue(e, r, t) { | ||
var i = e.displayName; | ||
if (i) | ||
return i; | ||
var y = r.displayName || r.name || ""; | ||
return y !== "" ? t + "(" + y + ")" : t; | ||
function ae(e, r, t) { | ||
var s = e.displayName; | ||
if (s) | ||
return s; | ||
var h = r.displayName || r.name || ""; | ||
return h !== "" ? t + "(" + h + ")" : t; | ||
} | ||
function de(e) { | ||
function H(e) { | ||
return e.displayName || "Context"; | ||
} | ||
function O(e) { | ||
function j(e) { | ||
if (e == null) | ||
return null; | ||
if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") | ||
if (typeof e.tag == "number" && T("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; | ||
@@ -98,11 +98,11 @@ if (typeof e == "string") | ||
switch (e) { | ||
case o: | ||
case i: | ||
return "Fragment"; | ||
case a: | ||
return "Portal"; | ||
case b: | ||
case g: | ||
return "Profiler"; | ||
case v: | ||
return "StrictMode"; | ||
case g: | ||
case y: | ||
return "Suspense"; | ||
@@ -116,15 +116,15 @@ case f: | ||
var r = e; | ||
return de(r) + ".Consumer"; | ||
case s: | ||
return H(r) + ".Consumer"; | ||
case o: | ||
var t = e; | ||
return de(t._context) + ".Provider"; | ||
case h: | ||
return Ue(e, e.render, "ForwardRef"); | ||
return H(t._context) + ".Provider"; | ||
case p: | ||
var i = e.displayName || null; | ||
return i !== null ? i : O(e.type) || "Memo"; | ||
case E: { | ||
var y = e, m = y._payload, u = y._init; | ||
return ae(e, e.render, "ForwardRef"); | ||
case b: | ||
var s = e.displayName || null; | ||
return s !== null ? s : j(e.type) || "Memo"; | ||
case _: { | ||
var h = e, E = h._payload, u = h._init; | ||
try { | ||
return O(u(m)); | ||
return j(u(E)); | ||
} catch { | ||
@@ -137,14 +137,14 @@ return null; | ||
} | ||
var I = Object.assign, B = 0, pe, ye, be, he, ge, me, Ee; | ||
function _e() { | ||
var M = Object.assign, J = 0, he, ge, me, Ee, _e, Re, xe; | ||
function Se() { | ||
} | ||
_e.__reactDisabledLog = !0; | ||
Se.__reactDisabledLog = !0; | ||
function qe() { | ||
{ | ||
if (B === 0) { | ||
pe = console.log, ye = console.info, be = console.warn, he = console.error, ge = console.group, me = console.groupCollapsed, Ee = console.groupEnd; | ||
if (J === 0) { | ||
he = console.log, ge = console.info, me = console.warn, Ee = console.error, _e = console.group, Re = console.groupCollapsed, xe = console.groupEnd; | ||
var e = { | ||
configurable: !0, | ||
enumerable: !0, | ||
value: _e, | ||
value: Se, | ||
writable: !0 | ||
@@ -162,3 +162,3 @@ }; | ||
} | ||
B++; | ||
J++; | ||
} | ||
@@ -168,3 +168,3 @@ } | ||
{ | ||
if (B--, B === 0) { | ||
if (J--, J === 0) { | ||
var e = { | ||
@@ -176,61 +176,61 @@ configurable: !0, | ||
Object.defineProperties(console, { | ||
log: I({}, e, { | ||
value: pe | ||
}), | ||
info: I({}, e, { | ||
value: ye | ||
}), | ||
warn: I({}, e, { | ||
value: be | ||
}), | ||
error: I({}, e, { | ||
log: M({}, e, { | ||
value: he | ||
}), | ||
group: I({}, e, { | ||
info: M({}, e, { | ||
value: ge | ||
}), | ||
groupCollapsed: I({}, e, { | ||
warn: M({}, e, { | ||
value: me | ||
}), | ||
groupEnd: I({}, e, { | ||
error: M({}, e, { | ||
value: Ee | ||
}), | ||
group: M({}, e, { | ||
value: _e | ||
}), | ||
groupCollapsed: M({}, e, { | ||
value: Re | ||
}), | ||
groupEnd: M({}, e, { | ||
value: xe | ||
}) | ||
}); | ||
} | ||
B < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
J < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
} | ||
} | ||
var re = P.ReactCurrentDispatcher, te; | ||
function q(e, r, t) { | ||
var oe = N.ReactCurrentDispatcher, ie; | ||
function z(e, r, t) { | ||
{ | ||
if (te === void 0) | ||
if (ie === void 0) | ||
try { | ||
throw Error(); | ||
} catch (y) { | ||
var i = y.stack.trim().match(/\n( *(at )?)/); | ||
te = i && i[1] || ""; | ||
} catch (h) { | ||
var s = h.stack.trim().match(/\n( *(at )?)/); | ||
ie = s && s[1] || ""; | ||
} | ||
return ` | ||
` + te + e; | ||
` + ie + e; | ||
} | ||
} | ||
var ne = !1, G; | ||
var se = !1, K; | ||
{ | ||
var He = typeof WeakMap == "function" ? WeakMap : Map; | ||
G = new He(); | ||
K = new He(); | ||
} | ||
function Re(e, r) { | ||
if (!e || ne) | ||
function Te(e, r) { | ||
if (!e || se) | ||
return ""; | ||
{ | ||
var t = G.get(e); | ||
var t = K.get(e); | ||
if (t !== void 0) | ||
return t; | ||
} | ||
var i; | ||
ne = !0; | ||
var y = Error.prepareStackTrace; | ||
var s; | ||
se = !0; | ||
var h = Error.prepareStackTrace; | ||
Error.prepareStackTrace = void 0; | ||
var m; | ||
m = re.current, re.current = null, qe(); | ||
var E; | ||
E = oe.current, oe.current = null, qe(); | ||
try { | ||
@@ -248,4 +248,4 @@ if (r) { | ||
Reflect.construct(u, []); | ||
} catch (j) { | ||
i = j; | ||
} catch (I) { | ||
s = I; | ||
} | ||
@@ -256,4 +256,4 @@ Reflect.construct(e, [], u); | ||
u.call(); | ||
} catch (j) { | ||
i = j; | ||
} catch (I) { | ||
s = I; | ||
} | ||
@@ -265,23 +265,23 @@ e.call(u.prototype); | ||
throw Error(); | ||
} catch (j) { | ||
i = j; | ||
} catch (I) { | ||
s = I; | ||
} | ||
e(); | ||
} | ||
} catch (j) { | ||
if (j && i && typeof j.stack == "string") { | ||
for (var c = j.stack.split(` | ||
`), D = i.stack.split(` | ||
`), S = c.length - 1, x = D.length - 1; S >= 1 && x >= 0 && c[S] !== D[x]; ) | ||
} catch (I) { | ||
if (I && s && typeof I.stack == "string") { | ||
for (var c = I.stack.split(` | ||
`), D = s.stack.split(` | ||
`), R = c.length - 1, x = D.length - 1; R >= 1 && x >= 0 && c[R] !== D[x]; ) | ||
x--; | ||
for (; S >= 1 && x >= 0; S--, x--) | ||
if (c[S] !== D[x]) { | ||
if (S !== 1 || x !== 1) | ||
for (; R >= 1 && x >= 0; R--, x--) | ||
if (c[R] !== D[x]) { | ||
if (R !== 1 || x !== 1) | ||
do | ||
if (S--, x--, x < 0 || c[S] !== D[x]) { | ||
var F = ` | ||
` + c[S].replace(" at new ", " at "); | ||
return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, F), F; | ||
if (R--, x--, x < 0 || c[R] !== D[x]) { | ||
var C = ` | ||
` + c[R].replace(" at new ", " at "); | ||
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, C), C; | ||
} | ||
while (S >= 1 && x >= 0); | ||
while (R >= 1 && x >= 0); | ||
break; | ||
@@ -291,9 +291,9 @@ } | ||
} finally { | ||
ne = !1, re.current = m, Ge(), Error.prepareStackTrace = y; | ||
se = !1, oe.current = E, Ge(), Error.prepareStackTrace = h; | ||
} | ||
var Y = e ? e.displayName || e.name : "", Me = Y ? q(Y) : ""; | ||
return typeof e == "function" && G.set(e, Me), Me; | ||
var B = e ? e.displayName || e.name : "", Ne = B ? z(B) : ""; | ||
return typeof e == "function" && K.set(e, Ne), Ne; | ||
} | ||
function ze(e, r, t) { | ||
return Re(e, !1); | ||
return Te(e, !1); | ||
} | ||
@@ -304,25 +304,25 @@ function Ke(e) { | ||
} | ||
function H(e, r, t) { | ||
function X(e, r, t) { | ||
if (e == null) | ||
return ""; | ||
if (typeof e == "function") | ||
return Re(e, Ke(e)); | ||
return Te(e, Ke(e)); | ||
if (typeof e == "string") | ||
return q(e); | ||
return z(e); | ||
switch (e) { | ||
case g: | ||
return q("Suspense"); | ||
case y: | ||
return z("Suspense"); | ||
case f: | ||
return q("SuspenseList"); | ||
return z("SuspenseList"); | ||
} | ||
if (typeof e == "object") | ||
switch (e.$$typeof) { | ||
case h: | ||
case p: | ||
return ze(e.render); | ||
case p: | ||
return H(e.type, r, t); | ||
case E: { | ||
var i = e, y = i._payload, m = i._init; | ||
case b: | ||
return X(e.type, r, t); | ||
case _: { | ||
var s = e, h = s._payload, E = s._init; | ||
try { | ||
return H(m(y), r, t); | ||
return X(E(h), r, t); | ||
} catch { | ||
@@ -334,26 +334,26 @@ } | ||
} | ||
var z = Object.prototype.hasOwnProperty, Se = {}, xe = P.ReactDebugCurrentFrame; | ||
function K(e) { | ||
var Z = Object.prototype.hasOwnProperty, De = {}, we = N.ReactDebugCurrentFrame; | ||
function Q(e) { | ||
if (e) { | ||
var r = e._owner, t = H(e.type, e._source, r ? r.type : null); | ||
xe.setExtraStackFrame(t); | ||
var r = e._owner, t = X(e.type, e._source, r ? r.type : null); | ||
we.setExtraStackFrame(t); | ||
} else | ||
xe.setExtraStackFrame(null); | ||
we.setExtraStackFrame(null); | ||
} | ||
function Xe(e, r, t, i, y) { | ||
function Xe(e, r, t, s, h) { | ||
{ | ||
var m = Function.call.bind(z); | ||
var E = Function.call.bind(Z); | ||
for (var u in e) | ||
if (m(e, u)) { | ||
if (E(e, u)) { | ||
var c = void 0; | ||
try { | ||
if (typeof e[u] != "function") { | ||
var D = Error((i || "React class") + ": " + t + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
var D = Error((s || "React class") + ": " + t + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
throw D.name = "Invariant Violation", D; | ||
} | ||
c = e[u](r, u, i, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} catch (S) { | ||
c = S; | ||
c = e[u](r, u, s, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} catch (R) { | ||
c = R; | ||
} | ||
c && !(c instanceof Error) && (K(y), _("%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).", i || "React class", t, u, typeof c), K(null)), c instanceof Error && !(c.message in Se) && (Se[c.message] = !0, K(y), _("Failed %s type: %s", t, c.message), K(null)); | ||
c && !(c instanceof Error) && (Q(h), T("%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).", s || "React class", t, u, typeof c), Q(null)), c instanceof Error && !(c.message in De) && (De[c.message] = !0, Q(h), T("Failed %s type: %s", t, c.message), Q(null)); | ||
} | ||
@@ -363,3 +363,3 @@ } | ||
var Ze = Array.isArray; | ||
function le(e) { | ||
function fe(e) { | ||
return Ze(e); | ||
@@ -375,3 +375,3 @@ } | ||
try { | ||
return Te(e), !1; | ||
return Fe(e), !1; | ||
} catch { | ||
@@ -381,10 +381,10 @@ return !0; | ||
} | ||
function Te(e) { | ||
function Fe(e) { | ||
return "" + e; | ||
} | ||
function De(e) { | ||
function Ce(e) { | ||
if (er(e)) | ||
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Te(e); | ||
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Fe(e); | ||
} | ||
var L = P.ReactCurrentOwner, rr = { | ||
var U = N.ReactCurrentOwner, rr = { | ||
key: !0, | ||
@@ -394,6 +394,6 @@ ref: !0, | ||
__source: !0 | ||
}, we, Fe, ae; | ||
ae = {}; | ||
}, Oe, je, ce; | ||
ce = {}; | ||
function tr(e) { | ||
if (z.call(e, "ref")) { | ||
if (Z.call(e, "ref")) { | ||
var r = Object.getOwnPropertyDescriptor(e, "ref").get; | ||
@@ -406,3 +406,3 @@ if (r && r.isReactWarning) | ||
function nr(e) { | ||
if (z.call(e, "key")) { | ||
if (Z.call(e, "key")) { | ||
var r = Object.getOwnPropertyDescriptor(e, "key").get; | ||
@@ -415,5 +415,5 @@ if (r && r.isReactWarning) | ||
function lr(e, r) { | ||
if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) { | ||
var t = O(L.current.type); | ||
ae[t] || (_('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(L.current.type), e.ref), ae[t] = !0); | ||
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) { | ||
var t = j(U.current.type); | ||
ce[t] || (T('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', j(U.current.type), e.ref), ce[t] = !0); | ||
} | ||
@@ -424,3 +424,3 @@ } | ||
var t = function() { | ||
we || (we = !0, _("%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)); | ||
Oe || (Oe = !0, T("%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)); | ||
}; | ||
@@ -436,3 +436,3 @@ t.isReactWarning = !0, Object.defineProperty(e, "key", { | ||
var t = function() { | ||
Fe || (Fe = !0, _("%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)); | ||
je || (je = !0, T("%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)); | ||
}; | ||
@@ -445,3 +445,3 @@ t.isReactWarning = !0, Object.defineProperty(e, "ref", { | ||
} | ||
var ir = function(e, r, t, i, y, m, u) { | ||
var ir = function(e, r, t, s, h, E, u) { | ||
var c = { | ||
@@ -456,3 +456,3 @@ // This tag allows us to uniquely identify this as a React Element | ||
// Record the component responsible for creating this element. | ||
_owner: m | ||
_owner: E | ||
}; | ||
@@ -468,3 +468,3 @@ return c._store = {}, Object.defineProperty(c._store, "validated", { | ||
writable: !1, | ||
value: i | ||
value: s | ||
}), Object.defineProperty(c, "_source", { | ||
@@ -474,15 +474,15 @@ configurable: !1, | ||
writable: !1, | ||
value: y | ||
value: h | ||
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c; | ||
}; | ||
function sr(e, r, t, i, y) { | ||
function sr(e, r, t, s, h) { | ||
{ | ||
var m, u = {}, c = null, D = null; | ||
t !== void 0 && (De(t), c = "" + t), nr(r) && (De(r.key), c = "" + r.key), tr(r) && (D = r.ref, lr(r, y)); | ||
for (m in r) | ||
z.call(r, m) && !rr.hasOwnProperty(m) && (u[m] = r[m]); | ||
var E, u = {}, c = null, D = null; | ||
t !== void 0 && (Ce(t), c = "" + t), nr(r) && (Ce(r.key), c = "" + r.key), tr(r) && (D = r.ref, lr(r, h)); | ||
for (E in r) | ||
Z.call(r, E) && !rr.hasOwnProperty(E) && (u[E] = r[E]); | ||
if (e && e.defaultProps) { | ||
var S = e.defaultProps; | ||
for (m in S) | ||
u[m] === void 0 && (u[m] = S[m]); | ||
var R = e.defaultProps; | ||
for (E in R) | ||
u[E] === void 0 && (u[E] = R[E]); | ||
} | ||
@@ -493,22 +493,22 @@ if (c || D) { | ||
} | ||
return ir(e, c, D, y, i, L.current, u); | ||
return ir(e, c, D, h, s, U.current, u); | ||
} | ||
} | ||
var oe = P.ReactCurrentOwner, Ce = P.ReactDebugCurrentFrame; | ||
function N(e) { | ||
var ue = N.ReactCurrentOwner, ke = N.ReactDebugCurrentFrame; | ||
function W(e) { | ||
if (e) { | ||
var r = e._owner, t = H(e.type, e._source, r ? r.type : null); | ||
Ce.setExtraStackFrame(t); | ||
var r = e._owner, t = X(e.type, e._source, r ? r.type : null); | ||
ke.setExtraStackFrame(t); | ||
} else | ||
Ce.setExtraStackFrame(null); | ||
ke.setExtraStackFrame(null); | ||
} | ||
var ie; | ||
ie = !1; | ||
function se(e) { | ||
var ve; | ||
ve = !1; | ||
function de(e) { | ||
return typeof e == "object" && e !== null && e.$$typeof === l; | ||
} | ||
function Oe() { | ||
function Pe() { | ||
{ | ||
if (oe.current) { | ||
var e = O(oe.current.type); | ||
if (ue.current) { | ||
var e = j(ue.current.type); | ||
if (e) | ||
@@ -533,6 +533,6 @@ return ` | ||
} | ||
var je = {}; | ||
var Ae = {}; | ||
function cr(e) { | ||
{ | ||
var r = Oe(); | ||
var r = Pe(); | ||
if (!r) { | ||
@@ -547,3 +547,3 @@ var t = typeof e == "string" ? e : e.displayName || e.name; | ||
} | ||
function ke(e, r) { | ||
function Me(e, r) { | ||
{ | ||
@@ -554,25 +554,25 @@ if (!e._store || e._store.validated || e.key != null) | ||
var t = cr(r); | ||
if (je[t]) | ||
if (Ae[t]) | ||
return; | ||
je[t] = !0; | ||
var i = ""; | ||
e && e._owner && e._owner !== oe.current && (i = " It was passed a child from " + O(e._owner.type) + "."), N(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, i), N(null); | ||
Ae[t] = !0; | ||
var s = ""; | ||
e && e._owner && e._owner !== ue.current && (s = " It was passed a child from " + j(e._owner.type) + "."), W(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, s), W(null); | ||
} | ||
} | ||
function Pe(e, r) { | ||
function Ie(e, r) { | ||
{ | ||
if (typeof e != "object") | ||
return; | ||
if (le(e)) | ||
if (fe(e)) | ||
for (var t = 0; t < e.length; t++) { | ||
var i = e[t]; | ||
se(i) && ke(i, r); | ||
var s = e[t]; | ||
de(s) && Me(s, r); | ||
} | ||
else if (se(e)) | ||
else if (de(e)) | ||
e._store && (e._store.validated = !0); | ||
else if (e) { | ||
var y = Q(e); | ||
if (typeof y == "function" && y !== e.entries) | ||
for (var m = y.call(e), u; !(u = m.next()).done; ) | ||
se(u.value) && ke(u.value, r); | ||
var h = k(e); | ||
if (typeof h == "function" && h !== e.entries) | ||
for (var E = h.call(e), u; !(u = E.next()).done; ) | ||
de(u.value) && Me(u.value, r); | ||
} | ||
@@ -589,5 +589,5 @@ } | ||
t = r.propTypes; | ||
else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here. | ||
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here. | ||
// Inner props are checked in the reconciler. | ||
r.$$typeof === p)) | ||
r.$$typeof === b)) | ||
t = r.propTypes; | ||
@@ -597,10 +597,10 @@ else | ||
if (t) { | ||
var i = O(r); | ||
Xe(t, e.props, "prop", i, e); | ||
} else if (r.PropTypes !== void 0 && !ie) { | ||
ie = !0; | ||
var y = O(r); | ||
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown"); | ||
var s = j(r); | ||
Xe(t, e.props, "prop", s, e); | ||
} else if (r.PropTypes !== void 0 && !ve) { | ||
ve = !0; | ||
var h = j(r); | ||
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown"); | ||
} | ||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
} | ||
@@ -611,57 +611,57 @@ } | ||
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { | ||
var i = r[t]; | ||
if (i !== "children" && i !== "key") { | ||
N(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), N(null); | ||
var s = r[t]; | ||
if (s !== "children" && s !== "key") { | ||
W(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), W(null); | ||
break; | ||
} | ||
} | ||
e.ref !== null && (N(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), N(null)); | ||
e.ref !== null && (W(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), W(null)); | ||
} | ||
} | ||
function Ae(e, r, t, i, y, m) { | ||
function $e(e, r, t, s, h, E) { | ||
{ | ||
var u = Je(e); | ||
var u = A(e); | ||
if (!u) { | ||
var c = ""; | ||
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " 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 D = fr(y); | ||
D ? c += D : c += Oe(); | ||
var S; | ||
e === null ? S = "null" : le(e) ? S = "array" : e !== void 0 && e.$$typeof === l ? (S = "<" + (O(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : S = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, c); | ||
var D = fr(h); | ||
D ? c += D : c += Pe(); | ||
var R; | ||
e === null ? R = "null" : fe(e) ? R = "array" : e !== void 0 && e.$$typeof === l ? (R = "<" + (j(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, c); | ||
} | ||
var x = sr(e, r, t, y, m); | ||
var x = sr(e, r, t, h, E); | ||
if (x == null) | ||
return x; | ||
if (u) { | ||
var F = r.children; | ||
if (F !== void 0) | ||
if (i) | ||
if (le(F)) { | ||
for (var Y = 0; Y < F.length; Y++) | ||
Pe(F[Y], e); | ||
Object.freeze && Object.freeze(F); | ||
var C = r.children; | ||
if (C !== void 0) | ||
if (s) | ||
if (fe(C)) { | ||
for (var B = 0; B < C.length; B++) | ||
Ie(C[B], e); | ||
Object.freeze && Object.freeze(C); | ||
} else | ||
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); | ||
T("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 | ||
Pe(F, e); | ||
Ie(C, e); | ||
} | ||
return e === o ? vr(x) : ur(x), x; | ||
return e === i ? vr(x) : ur(x), x; | ||
} | ||
} | ||
function dr(e, r, t) { | ||
return Ae(e, r, t, !0); | ||
return $e(e, r, t, !0); | ||
} | ||
function pr(e, r, t) { | ||
return Ae(e, r, t, !1); | ||
return $e(e, r, t, !1); | ||
} | ||
var yr = pr, br = dr; | ||
J.Fragment = o, J.jsx = yr, J.jsxs = br; | ||
}()), J; | ||
G.Fragment = i, G.jsx = yr, G.jsxs = br; | ||
}()), G; | ||
} | ||
process.env.NODE_ENV === "production" ? fe.exports = Er() : fe.exports = _r(); | ||
var T = fe.exports; | ||
function ce({ children: n, textColor: l, style: a, colSpan: o, ...v }) { | ||
return /* @__PURE__ */ T.jsxs("td", { className: "calendar-label", style: a, colSpan: o, ...v, children: [ | ||
/* @__PURE__ */ T.jsx("span", { className: "sr-only", children: n }), | ||
/* @__PURE__ */ T.jsx("span", { className: "calendar-label-text", "aria-hidden": "true", style: { color: l }, children: n }) | ||
process.env.NODE_ENV === "production" ? pe.exports = Er() : pe.exports = _r(); | ||
var S = pe.exports; | ||
function ye({ children: n, textColor: l, style: a, colSpan: i, ...v }) { | ||
return /* @__PURE__ */ S.jsxs("td", { className: "calendar-label", style: a, colSpan: i, ...v, children: [ | ||
/* @__PURE__ */ S.jsx("span", { className: "sr-only", children: n }), | ||
/* @__PURE__ */ S.jsx("span", { className: "calendar-label-text", "aria-hidden": "true", style: { color: l }, children: n }) | ||
] }); | ||
@@ -896,3 +896,3 @@ } | ||
} | ||
}, Sr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], xr = (n = /* @__PURE__ */ new Date()) => { | ||
}, xr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Sr = (n = /* @__PURE__ */ new Date()) => { | ||
const l = { | ||
@@ -919,28 +919,28 @@ Sun: "Sunday", | ||
Dec: "December" | ||
}, o = n.toString().split(" "); | ||
}, i = n.toString().split(" "); | ||
return { | ||
year: o[3], | ||
month: a[o[1]], | ||
day: parseInt(o[2], 10), | ||
date: l[o[0]] | ||
year: i[3], | ||
month: a[i[1]], | ||
day: parseInt(i[2], 10), | ||
date: l[i[0]] | ||
}; | ||
}, Tr = (n) => { | ||
const l = xr(new Date(n)); | ||
const l = Sr(new Date(n)); | ||
return `${l.date}, ${l.month} ${l.day}, ${l.year}`; | ||
}, Ne = (n, l, a) => `${n}-${String(l + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`, Dr = (n, l, a) => `${n}-${String(l).padStart(2, "0")}-${String(a).padStart(2, "0")}`, $ = (n) => +n.slice(0, 4), Ye = (n) => +n.slice(5, 7), Yr = (n) => +n.slice(8, 10), wr = (n = W()) => n % 4 === 0 && n % 100 !== 0 || n % 400 === 0, ue = (n = W()) => [31, wr(n) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Z = (n = W()) => new Date(n, 0, 1).getDay(), Wr = (n) => new Date(n).getDay(), W = () => (/* @__PURE__ */ new Date()).getFullYear(), Br = (n = W(), l, a) => { | ||
const o = ue(n), v = Z(n), b = []; | ||
let s = v; | ||
}, Be = (n, l, a) => `${n}-${String(l + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`, Dr = (n, l, a) => `${n}-${String(l).padStart(2, "0")}-${String(a).padStart(2, "0")}`, Y = (n) => +n.slice(0, 4), Le = (n) => +n.slice(5, 7), Yr = (n) => +n.slice(8, 10), wr = (n = L()) => n % 4 === 0 && n % 100 !== 0 || n % 400 === 0, be = (n = L()) => [31, wr(n) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], re = (n = L()) => new Date(n, 0, 1).getDay(), Wr = (n) => new Date(n).getDay(), L = () => (/* @__PURE__ */ new Date()).getFullYear(), Br = (n = L(), l, a) => { | ||
const i = be(n), v = re(n), g = []; | ||
let o = v; | ||
for (let d = 0; d < 12; d++) { | ||
const h = o[d]; | ||
let g = 0; | ||
for (let f = 0; f < h; f++) | ||
s === 0 && g++, s = (s + 1) % 7; | ||
d === 0 && v !== 0 && g++, b.push(g); | ||
const p = i[d]; | ||
let y = 0; | ||
for (let f = 0; f < p; f++) | ||
o === 0 && y++, o = (o + 1) % 7; | ||
d === 0 && v !== 0 && y++, g.push(y); | ||
} | ||
return n !== l && v !== 0 && l !== a && (b[0] -= 1), b; | ||
return n !== l && v !== 0 && l !== a && (g[0] -= 1), g; | ||
}, Fr = (n) => { | ||
const l = /* @__PURE__ */ new Map(); | ||
return n.forEach((a) => { | ||
Object.keys(a).forEach((o) => { | ||
l.set(o, a[o]); | ||
Object.keys(a).forEach((i) => { | ||
l.set(i, a[i]); | ||
}); | ||
@@ -950,49 +950,49 @@ }), l; | ||
let a = 0; | ||
for (let o = n; o <= l; ++o) | ||
a += Be(n, o === n); | ||
for (let i = n; i <= l; ++i) | ||
a += Je(n, i === n); | ||
return new Array(7).fill(0).map(() => new Array(a).fill(0)); | ||
}, jr = (n, l) => { | ||
let a = 0; | ||
for (let o = n; o <= l; ++o) | ||
a += Be(n, o === n); | ||
for (let i = n; i <= l; ++i) | ||
a += Je(n, i === n); | ||
return new Array(7).fill("").map(() => new Array(a).fill("")); | ||
}, Be = (n, l) => { | ||
const a = Z(n); | ||
}, Je = (n, l) => { | ||
const a = re(n); | ||
return l || a === 0 ? 53 : 52; | ||
}, kr = (n, l) => { | ||
const a = $(n), o = $(l), v = Or(a, o); | ||
let b = 0, s = 1; | ||
for (let d = a; d <= o; ++d) { | ||
const h = Z(d), g = ue(d); | ||
let f = 0, p = 1, E = h; | ||
const a = Y(n), i = Y(l), v = Or(a, i); | ||
let g = 0, o = 1; | ||
for (let d = a; d <= i; ++d) { | ||
const p = re(d), y = be(d); | ||
let f = 0, b = 1, _ = p; | ||
for (; f < 12; ) { | ||
for (let R = 0; R < g[f]; ++R) | ||
v[E % 7][~~(E / 7) + b] = s, E++, p++, s++; | ||
p > g[f] && (p = 1, f++); | ||
for (let m = 0; m < y[f]; ++m) | ||
v[_ % 7][~~(_ / 7) + g] = o, _++, b++, o++; | ||
b > y[f] && (b = 1, f++); | ||
} | ||
b += ~~(E / 7); | ||
g += ~~(_ / 7); | ||
} | ||
return v; | ||
}, Le = (n, l) => { | ||
const a = $(n), o = $(l), v = jr(a, o); | ||
let b = 0; | ||
for (let s = a; s <= o; ++s) { | ||
const d = Z(s), h = ue(s); | ||
let g = 0, f = 1, p = d; | ||
for (; g < 12; ) { | ||
for (let E = 0; E < h[g]; ++E) { | ||
const R = Dr(s, g + 1, f); | ||
v[p % 7][~~(p / 7) + b] = R, p++, f++; | ||
}, Ue = (n, l) => { | ||
const a = Y(n), i = Y(l), v = jr(a, i); | ||
let g = 0; | ||
for (let o = a; o <= i; ++o) { | ||
const d = re(o), p = be(o); | ||
let y = 0, f = 1, b = d; | ||
for (; y < 12; ) { | ||
for (let _ = 0; _ < p[y]; ++_) { | ||
const m = Dr(o, y + 1, f); | ||
v[b % 7][~~(b / 7) + g] = m, b++, f++; | ||
} | ||
f > h[g] && (f = 1, g++); | ||
f > p[y] && (f = 1, y++); | ||
} | ||
b += ~~(p / 7); | ||
g += ~~(b / 7); | ||
} | ||
return v; | ||
}, X = (n, l) => { | ||
const a = `${n}-01-01`, o = Pr(a, l), v = kr(a, l); | ||
for (let b = 0; b < v.length; ++b) | ||
for (let s = 0; s < v[b].length; ++s) | ||
if (o === v[b][s]) | ||
return { row: b, col: s }; | ||
}, ee = (n, l) => { | ||
const a = `${n}-01-01`, i = Pr(a, l), v = kr(a, l); | ||
for (let g = 0; g < v.length; ++g) | ||
for (let o = 0; o < v[g].length; ++o) | ||
if (i === v[g][o]) | ||
return { row: g, col: o }; | ||
return { row: 0, col: 0 }; | ||
@@ -1003,72 +1003,84 @@ }, Pr = (n, l) => { | ||
}, Ar = (n, l, a) => { | ||
const { row: o, col: v } = X($(n), n), { col: b } = X($(n), l), s = [], d = []; | ||
let h = -1, g = 0; | ||
for (let f = v; f <= b; ++f) | ||
f === v ? g = Ye(a[o][f]) - 1 : g = Ye(a[0][f]) - 1, g !== h && (s.push(Sr[g]), h = g, d.push(0)), d[d.length - 1]++; | ||
return { months: s, colSpans: d }; | ||
const { row: i, col: v } = ee(Y(n), n), { col: g } = ee(Y(n), l), o = [], d = []; | ||
let p = -1, y = 0; | ||
for (let f = v; f <= g; ++f) | ||
f === v ? y = Le(a[i][f]) - 1 : y = Le(a[0][f]) - 1, y !== p && (o.push(xr[y]), p = y, d.push(0)), d[d.length - 1]++; | ||
return { months: o, colSpans: d }; | ||
}; | ||
function Mr({ start: n, end: l, textColor: a }) { | ||
const o = Le(n, l), { months: v, colSpans: b } = Ar(n, l, o); | ||
return /* @__PURE__ */ T.jsx("thead", { children: /* @__PURE__ */ T.jsxs("tr", { children: [ | ||
/* @__PURE__ */ T.jsx(ce, { textColor: a, style: { width: "40px" }, colSpan: 1, children: " " }), | ||
v.map((s, d) => /* @__PURE__ */ T.jsx(ce, { textColor: a, colSpan: b[d], children: s }, d)) | ||
const i = Ue(n, l), { months: v, colSpans: g } = Ar(n, l, i); | ||
return /* @__PURE__ */ S.jsx("thead", { children: /* @__PURE__ */ S.jsxs("tr", { children: [ | ||
/* @__PURE__ */ S.jsx(ye, { textColor: a, style: { width: "3.5em" }, colSpan: 1, children: " " }), | ||
v.map((o, d) => /* @__PURE__ */ S.jsx(ye, { textColor: a, colSpan: g[d], children: o }, d)) | ||
] }) }); | ||
} | ||
function Ir({ children: n, style: l, dataTooltip: a, dataLevel: o, themeProps: v, ...b }) { | ||
const s = hr(null), [d, h] = gr(-10), g = (p) => { | ||
if (!p) | ||
function Ir({ themeProps: n, dataLevel: l, style: a, children: i, dataTooltip: v, ...g }) { | ||
const o = hr(null), [d, p] = gr(-10), y = (b) => { | ||
if (!b) | ||
return 0; | ||
let E = 0; | ||
return p.childNodes.forEach((R) => { | ||
R.nodeType === Node.ELEMENT_NODE && window.getComputedStyle(R).display !== "none" && E++; | ||
}), E; | ||
}, f = (p) => { | ||
if (!p || !p.parentNode) | ||
let _ = 0; | ||
return b.childNodes.forEach((m) => { | ||
m.nodeType === Node.ELEMENT_NODE && window.getComputedStyle(m).display !== "none" && _++; | ||
}), _; | ||
}, f = (b) => { | ||
if (!b || !b.parentNode) | ||
return -1; | ||
const E = Array.from(p.parentNode.childNodes); | ||
let R = 0; | ||
for (let w = 0; w < p.cellIndex; w++) | ||
E[w].style.display !== "none" && R++; | ||
return R; | ||
const _ = Array.from(b.parentNode.childNodes); | ||
let m = 0; | ||
for (let w = 0; w < b.cellIndex; w++) | ||
_[w].style.display !== "none" && m++; | ||
return m; | ||
}; | ||
return mr(() => { | ||
const p = () => { | ||
var E; | ||
if (s.current) { | ||
const R = g((E = s.current) == null ? void 0 : E.parentNode), w = f(s.current); | ||
if (R) { | ||
let k = -10; | ||
w / R > 0.66 ? k = Math.max(~~(s.current.cellIndex * -150) / R, -130) : w / R > 0.33 ? k = Math.max(~~(s.current.cellIndex * -100) / R, -120) : k = Math.min(~~(s.current.cellIndex * -50) / R, -10), h(k); | ||
const b = () => { | ||
var _; | ||
if (o.current) { | ||
const m = y((_ = o.current) == null ? void 0 : _.parentNode), w = f(o.current); | ||
if (m) { | ||
let F = -10; | ||
const k = w / m; | ||
k > 0.9 ? F = Math.max(~~(o.current.cellIndex * -150) / m, -160) : k > 0.8 ? F = Math.max(~~(o.current.cellIndex * -130) / m, -130) : k > 0.66 ? F = Math.max(~~(o.current.cellIndex * -110) / m, -120) : k > 0.5 ? F = Math.max(~~(o.current.cellIndex * -90) / m, -110) : k > 0.33 ? F = Math.max(~~(o.current.cellIndex * -40) / m, -90) : k > 0.2 ? F = Math.min(~~(o.current.cellIndex * -15) / m, -40) : F = Math.min(~~(o.current.cellIndex * -7) / m, -10), p(F); | ||
} | ||
} | ||
}; | ||
return s.current && s.current.addEventListener("mouseover", p), () => { | ||
s.current && s.current.removeEventListener("mouseover", p); | ||
return o.current && o.current.addEventListener("mouseover", b), () => { | ||
o.current && o.current.removeEventListener("mouseover", b); | ||
}; | ||
}, []), /* @__PURE__ */ T.jsx( | ||
}, []), /* @__PURE__ */ S.jsx( | ||
"td", | ||
{ | ||
ref: s, | ||
ref: o, | ||
className: "calendar-cell top half-arrow", | ||
style: { | ||
...l, | ||
backgroundColor: v[`level${o}`], | ||
...a, | ||
backgroundColor: n[`level${l}`], | ||
"--tooltip-offset": `${d}px` | ||
}, | ||
"data-tooltip": a, | ||
"data-level": o, | ||
...b, | ||
children: /* @__PURE__ */ T.jsx("span", { className: "sr-only", children: n }) | ||
"data-tooltip": v, | ||
"data-level": l, | ||
...g, | ||
children: /* @__PURE__ */ S.jsx("span", { className: "sr-only", children: i }) | ||
} | ||
); | ||
} | ||
function $r({ data: n, start: l, end: a, textColor: o, theme: v, includeBoundary: b }) { | ||
const s = $(l), { row: d, col: h } = X(s, l), { row: g, col: f } = X(s, a), p = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], E = Le(l, a), w = ((_) => Cr(_))(v), k = Fr(n), Q = (_, C) => C < h || C > f, P = (_, C) => C === h && _ < d || C === f && _ > g; | ||
return /* @__PURE__ */ T.jsx("tbody", { children: p.map((_, C) => /* @__PURE__ */ T.jsxs("tr", { children: [ | ||
/* @__PURE__ */ T.jsx(ce, { tabIndex: 0, textColor: o, style: { textAlign: "inherit" }, children: _ }), | ||
E[C].map((U, A) => { | ||
if (Q(C, A)) | ||
return /* @__PURE__ */ T.jsx("td", { style: { padding: "0", display: "none" } }, A); | ||
if (P(C, A)) | ||
return /* @__PURE__ */ T.jsx( | ||
function $r({ | ||
data: n, | ||
start: l, | ||
end: a, | ||
textColor: i, | ||
theme: v, | ||
includeBoundary: g, | ||
cx: o, | ||
cy: d, | ||
cr: p, | ||
onClick: y | ||
}) { | ||
const f = Y(l), { row: b, col: _ } = ee(f, l), { row: m, col: w } = ee(f, a), F = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], k = Ue(l, a), T = ((P) => Cr(P))(v), te = Fr(n), ne = (P, O) => O < _ || O > w, le = (P, O) => O === _ && P < b || O === w && P > m; | ||
return /* @__PURE__ */ S.jsx("tbody", { children: F.map((P, O) => /* @__PURE__ */ S.jsxs("tr", { children: [ | ||
/* @__PURE__ */ S.jsx(ye, { tabIndex: 0, textColor: i, style: { textAlign: "inherit" }, children: P }), | ||
k[O].map((V, $) => { | ||
if (ne(O, $)) | ||
return /* @__PURE__ */ S.jsx("td", { style: { padding: "0", display: "none" } }, $); | ||
if (le(O, $)) | ||
return /* @__PURE__ */ S.jsx( | ||
"td", | ||
@@ -1078,4 +1090,4 @@ { | ||
padding: 0, | ||
outline: b ? `1px solid ${w.level0}` : "none", | ||
borderRadius: "2px", | ||
outline: g ? `1px solid ${T.level0}` : "none", | ||
borderRadius: p, | ||
outlineOffset: "-1px", | ||
@@ -1085,19 +1097,26 @@ shapeRendering: "geometricPrecision" | ||
}, | ||
A | ||
$ | ||
); | ||
const M = k.get(U), ee = Tr(U); | ||
return /* @__PURE__ */ T.jsx( | ||
const A = te.get(V), ae = Tr(V), H = (j) => { | ||
const M = { | ||
date: V, | ||
data: A == null ? void 0 : A.data | ||
}; | ||
y && y(j, M); | ||
}; | ||
return /* @__PURE__ */ S.jsx( | ||
Ir, | ||
{ | ||
tabIndex: -1, | ||
style: { width: "10px", height: "10px" }, | ||
dataLevel: M !== void 0 ? M.level : 0, | ||
"data-content": JSON.stringify(M == null ? void 0 : M.data), | ||
dataTooltip: ee, | ||
themeProps: w | ||
style: { width: o, height: d, borderRadius: p }, | ||
dataLevel: A !== void 0 ? A.level : 0, | ||
"data-content": JSON.stringify(A == null ? void 0 : A.data), | ||
dataTooltip: ae, | ||
themeProps: T, | ||
onClick: H | ||
}, | ||
A | ||
$ | ||
); | ||
}) | ||
] }, _)) }); | ||
] }, P)) }); | ||
} | ||
@@ -1108,9 +1127,15 @@ function Lr({ | ||
theme: a = "grass", | ||
start: o = Ne(W(), 0, 1), | ||
end: v = Ne(W(), 11, 31), | ||
includeBoundary: b = !0 | ||
start: i = Be(L(), 0, 1), | ||
end: v = Be(L(), 11, 31), | ||
includeBoundary: g = !0, | ||
cx: o = 10, | ||
cy: d = 10, | ||
cr: p = 2, | ||
onCellClick: y = () => { | ||
}, | ||
style: f | ||
}) { | ||
return /* @__PURE__ */ T.jsx("div", { className: "container", children: /* @__PURE__ */ T.jsxs("table", { children: [ | ||
/* @__PURE__ */ T.jsx(Mr, { textColor: l, start: o, end: v }), | ||
/* @__PURE__ */ T.jsx( | ||
return /* @__PURE__ */ S.jsx("div", { className: "container", style: f, children: /* @__PURE__ */ S.jsxs("table", { children: [ | ||
/* @__PURE__ */ S.jsx(Mr, { textColor: l, start: i, end: v }), | ||
/* @__PURE__ */ S.jsx( | ||
$r, | ||
@@ -1121,5 +1146,9 @@ { | ||
theme: a, | ||
start: o, | ||
start: i, | ||
end: v, | ||
includeBoundary: b | ||
includeBoundary: g, | ||
cx: o, | ||
cy: d, | ||
cr: p, | ||
onClick: y | ||
} | ||
@@ -1133,17 +1162,17 @@ ) | ||
Br as getColumnSpansForYears, | ||
W as getCurrentYear, | ||
xr as getDateDetails, | ||
Ne as getDateString, | ||
L as getCurrentYear, | ||
Sr as getDateDetails, | ||
Be as getDateString, | ||
Tr as getDateTooltip, | ||
Le as getDayArray, | ||
Ue as getDayArray, | ||
Wr as getDayIndexOfMonth, | ||
Pr as getDaysBetween, | ||
Z as getFirstDayIndexOfYear, | ||
re as getFirstDayIndexOfYear, | ||
Ar as getMonthsAndColSpans, | ||
X as getRowAndColumnIndexFromDate, | ||
ee as getRowAndColumnIndexFromDate, | ||
wr as isLeapYear, | ||
Yr as parseDayFromDateString, | ||
Fr as parseInputData, | ||
Ye as parseMonthFromDateString, | ||
$ as parseYearFromDateString | ||
Le as parseMonthFromDateString, | ||
Y as parseYearFromDateString | ||
}; |
@@ -1,2 +0,2 @@ | ||
// Type definitions for react-contribution-calendar 1.1.2 | ||
// Type definitions for react-contribution-calendar 1.2.0 | ||
// Project: https://github.com/seiwon-yaehee/react-contribution-calendar | ||
@@ -15,3 +15,3 @@ // Definitions by: Seiwon Park <https://github.com/SeiwonPark> | ||
*/ | ||
export const createTheme = (themeProps: ThemeProps): ThemeProps => {} | ||
export const createTheme: (themeProps: ThemeProps) => ThemeProps | ||
@@ -45,2 +45,14 @@ /** | ||
/** | ||
* The size of width of each cell, defaults to `10`px. | ||
*/ | ||
cx?: number | ||
/** | ||
* The size of height of each cell, defaults to `10`px. | ||
*/ | ||
cy?: number | ||
/** | ||
* The border radius of each cell, defaults to `2`px. | ||
*/ | ||
cr?: number | ||
/** | ||
* The name of theme for the ContributionCalendar, defaults to `grass`. Also | ||
@@ -50,5 +62,51 @@ * `ThemeProps` could be added directly i.e. when trying to use custom theme. | ||
theme?: string | ThemeProps | ||
/** | ||
* Click event handler for table cells. This takes `cellData` as optional value. | ||
*/ | ||
onCellClick?: MouseEventHandler | ||
} | ||
/** | ||
* `ContributionCalendar` is a React component that renders data contributions over time, | ||
* similar to the contribution graph seen on GitHub profiles. | ||
* | ||
* This calendar displays data in cells, with varying color intensities based on the value | ||
* of each data point. The appearance and behavior of the calendar can be customized using | ||
* the provided props. | ||
* | ||
* @example | ||
* ```tsx | ||
* import { ContributionCalendar } from 'react-contribution-calendar'; | ||
* | ||
* const data = [ | ||
* { | ||
* '2023-07-08': { | ||
* level: 1, | ||
* } | ||
* }, | ||
* { | ||
* '2023-07-09': { | ||
* level: 4, | ||
* data: {}, // data with any kinds of keys can be set | ||
* } | ||
* }, | ||
* { | ||
* '2023-03-31': { | ||
* level: 3, | ||
* data: { | ||
* myKey: 'my data' // data with any kinds of keys can be set | ||
* }, | ||
* } | ||
* }, | ||
* // ... | ||
* ]; | ||
* | ||
* | ||
* <ContributionCalendar data={data} theme="grass" /> | ||
* ``` | ||
* | ||
* @version 1.2.0 | ||
* @see {@link https://github.com/seiwon-yaehee/react-contribution-calendar#apis} | ||
*/ | ||
export const ContributionCalendar: FunctionComponent<ContributionCalendarProps> | ||
} |
/** | ||
* This is for handling the issue of storing the object data with string keys. | ||
* | ||
* Note: Each object might need proper types rather than this. | ||
@@ -23,2 +22,3 @@ */ | ||
* Note: Currently the type `object` might have flexibility but should be reconsidered. | ||
* @type {object | undefined} | ||
*/ | ||
@@ -67,1 +67,28 @@ data?: object | ||
} | ||
/** | ||
* Represents the data with a table cell. | ||
*/ | ||
interface CellData { | ||
/** | ||
* The date from the cell. | ||
*/ | ||
date: string | ||
/** | ||
* Contains an object data of the cell. | ||
* @type {object | undefined} | ||
*/ | ||
data?: object | ||
} | ||
/** | ||
* Type representing the mouse event specific to an HTML table cell. | ||
*/ | ||
type TableCellMouseEvent = React.MouseEvent<HTMLTableCellElement, MouseEvent> | ||
/** | ||
* Type representing a handler for mouse events on an HTML table cell. | ||
* @param {TableCellMouseEvent} event - The mouse event triggered on the table cell. | ||
* @param {CellData | undefined} cellData - Optional data of the table cell. | ||
*/ | ||
type MouseEventHandler = (event: TableCellMouseEvent, cellData?: CellData) => void |
{ | ||
"name": "react-contribution-calendar", | ||
"description": "A GitHub-like contribution calendar component for React", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "main": "./dist/index.js", |
# react-contribution-calendar | ||
![npm](https://img.shields.io/npm/v/react-contribution-calendar?logo=npm&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Freact-contribution-calendar) ![NPM](https://img.shields.io/npm/l/react-contribution-calendar) | ||
A GitHub-like contribution calendar component for React, built with Vite and TypeScript. This provides a visual representation of contribution activity, similar to the contribution graph seen on a GitHub profile. | ||
<br /> | ||
<br /> | ||
## Installation | ||
```bash | ||
$ npm i react-contribution-calendar | ||
``` | ||
> **Note** | ||
@@ -19,2 +21,3 @@ > Add --save if you are using npm < 5.0.0 | ||
## Demo | ||
[Live Demo](https://codepen.io/yaeheechoe/pen/wvRwJbP) | ||
@@ -25,2 +28,3 @@ | ||
## Usage | ||
```js | ||
@@ -56,3 +60,3 @@ import { ContributionCalendar } from 'react-contribution-calendar' | ||
<ContributionCalendar | ||
<ContributionCalendar | ||
data={data} | ||
@@ -64,2 +68,6 @@ start="2020-04-04" | ||
theme="grass" | ||
cx={10} | ||
cy={10} | ||
cr={2} | ||
onCellClick={(e, data) => console.log(data)} | ||
/> | ||
@@ -71,6 +79,8 @@ ``` | ||
## APIs | ||
### `ContributionCalendar` | ||
`ContributionCalendar` is the main component of this library. It takes a data property, which is an array of objects representing the contribution data, and a theme property to customize its appearance. | ||
- `data`: An array of objects, where each object has a date string(`YYYY-MM-DD` format) as key, and an `InputDataProps` object as value. Defaults to `[]`. | ||
- **`data`**: An array of objects, where each object has a date string(`YYYY-MM-DD` format) as key, and an `InputDataProps` object as value. Defaults to `[]`. | ||
@@ -90,3 +100,3 @@ - An example data is as follows: | ||
'2023-07-09': { | ||
level: 1, | ||
level: 1, // `data` attribute could be omitted | ||
}, | ||
@@ -96,20 +106,27 @@ }, | ||
``` | ||
- `start`: Optional. The starting date for the calendar to start, defaults to current year's January 1st(`YYYY-MM-DD` format). | ||
- `end`: Optional. The ending date for the calendar to end, defaults to current year's December 31st(`YYYY-MM-DD` format). | ||
- `textColor`: Optional. The color of indexes. String color code format. | ||
- `includeBoundary`: Optional. Whethere to include the boundary cells in the starting or ending date column, defaults to `true`. | ||
- `theme`: Optional. A string that represents a predefined theme name, or an object with custom theme colors. Defaults to `grass`. | ||
<br /> | ||
- **`start`**: Optional. The starting date for the calendar to start, defaults to current year's January 1st(`YYYY-MM-DD` format). | ||
- **`end`**: Optional. The ending date for the calendar to end, defaults to current year's December 31st(`YYYY-MM-DD` format). | ||
- **`textColor`**: Optional. The color of indexes. String color code format. | ||
- **`includeBoundary`**: Optional. Whethere to include the boundary cells in the starting or ending date column, defaults to `true`. | ||
- **`theme`**: Optional. A string that represents a predefined theme name, or an object with custom theme colors. Defaults to `grass`. | ||
- **`cx`**: Optional. The pixel size of width of each cell, defaults to `10`. | ||
- **`cy`**: Optional. The pixel size of height of each cell, defaults to `10`. | ||
- **`cr`**: Optional. The pixel size of border radius of each cell, defaults to `2`. | ||
- **`onCellClick`**: Optional. An onClick mouse event on each table cell. | ||
<br /> | ||
### `createTheme` | ||
`createTheme` is a helper function to create custom themes. It takes a string representing a predefined theme name or an object containing custom theme colors. This returns a theme object(`ThemeProps`). | ||
<br /> | ||
<br /> | ||
## Themes | ||
You can customize the appearance of the `<ContributionCalendar />` with the theme property. We provide several built-in themes. | ||
```javascript | ||
// Replace `theme` attribute with belows | ||
// Replace `theme` attribute with belows | ||
<ContributionCalendar data={[]} theme={'grass'} /> | ||
@@ -119,57 +136,76 @@ ``` | ||
### Light Themes | ||
#### `grass` | ||
<img src="./images/grass.png" alt="grass" with=600 /> | ||
#### `pink` | ||
<img src="./images/pink.png" alt="pink" with=600 /> | ||
#### `halloween` | ||
<img src="./images/halloween.png" alt="halloween" with=600 /> | ||
#### `winter` | ||
<img src="./images/winter.png" alt="winter" with=600 /> | ||
#### `cherry` | ||
<img src="./images/cherry.png" alt="cherry" with=600 /> | ||
#### `cherry_blossom` | ||
<img src="./images/cherry_blossom.png" alt="cherry_blossom" with=600 /> | ||
#### `sky` | ||
<img src="./images/sky.png" alt="sky" with=600 /> | ||
#### `purquoise` | ||
<img src="./images/purquoise.png" alt="purquoise" with=600 /> | ||
#### `blue_pop` | ||
<img src="./images/blue_pop.png" alt="blue_pop" with=600 /> | ||
#### `mustard` | ||
<img src="./images/mustard.png" alt="mustard" with=600 /> | ||
<br /> | ||
<br /> | ||
### Dark Themes | ||
#### `dark_grass` | ||
<img src="./images/dark_grass.png" alt="dark_grass" with=600 /> | ||
#### `dark_pink` | ||
<img src="./images/dark_pink.png" alt="dark_pink" with=600 /> | ||
#### `dark_halloween` | ||
<img src="./images/dark_halloween.png" alt="dark_halloween" with=600 /> | ||
#### `dark_winter` | ||
<img src="./images/dark_winter.png" alt="dark_winter" with=600 /> | ||
#### `dark_blue` | ||
<img src="./images/dark_blue.png" alt="dark_blue" with=600 /> | ||
#### `dark_ocean` | ||
<img src="./images/dark_ocean.png" alt="dark_ocean" with=600 /> | ||
#### `dark_vomit` | ||
<img src="./images/dark_vomit.png" alt="dark_vomit" with=600 /> | ||
<br /> | ||
<br /> | ||
@@ -182,20 +218,13 @@ ### Custom Theme | ||
function App() { | ||
/* Define your custom theme */ | ||
const customTheme = createTheme({ | ||
level0: "#ebedf0", | ||
level1: "#9be9a8", | ||
level2: "#40c463", | ||
level3: "#30a14e", | ||
level4: "#216e39", | ||
level0: '#ebedf0', | ||
level1: '#9be9a8', | ||
level2: '#40c463', | ||
level3: '#30a14e', | ||
level4: '#216e39', | ||
}) | ||
return ( | ||
<ContributionCalendar | ||
data={[]} | ||
theme={customTheme} | ||
/> | ||
) | ||
return <ContributionCalendar data={[]} theme={customTheme} /> | ||
} | ||
``` | ||
@@ -214,7 +243,7 @@ | ||
/* Assign theme properties directly */ | ||
level0: "#ebedf0", | ||
level1: "#9be9a8", | ||
level2: "#40c463", | ||
level3: "#30a14e", | ||
level4: "#216e39", | ||
level0: '#ebedf0', | ||
level1: '#9be9a8', | ||
level2: '#40c463', | ||
level3: '#30a14e', | ||
level4: '#216e39', | ||
}} | ||
@@ -221,0 +250,0 @@ /> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73990
1443
244