Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-contribution-calendar

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-contribution-calendar - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

764

dist/index.js
import './styles/style.css';
import Ne from "react";
var ie = { exports: {} }, W = {};
import We, { useRef as hr, useState as gr, useEffect as mr } from "react";
var fe = { exports: {} }, V = {};
/**

@@ -13,21 +13,21 @@ * @license React

*/
var Ae;
function hr() {
if (Ae)
return W;
Ae = 1;
var n = Ne, l = Symbol.for("react.element"), a = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, u = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
function d(p, h, b) {
var f, E = {}, F = null, x = null;
b !== void 0 && (F = "" + b), h.key !== void 0 && (F = "" + h.key), h.ref !== void 0 && (x = h.ref);
var Ie;
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) && !y.hasOwnProperty(f) && (E[f] = h[f]);
if (p && p.defaultProps)
for (f in h = p.defaultProps, h)
E[f] === void 0 && (E[f] = h[f]);
return { $$typeof: l, type: p, key: F, ref: x, props: E, _owner: u.current };
o.call(h, f) && !b.hasOwnProperty(f) && (p[f] = h[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 };
}
return W.Fragment = a, W.jsx = d, W.jsxs = d, W;
return V.Fragment = a, V.jsx = s, V.jsxs = s, V;
}
var B = {};
var J = {};
/**

@@ -42,38 +42,38 @@ * @license React

*/
var Me;
function gr() {
return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
var n = Ne, l = Symbol.for("react.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), p = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), L = Symbol.iterator, X = "@@iterator";
function Z(e) {
var $e;
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) {
if (e === null || typeof e != "object")
return null;
var r = L && e[L] || e[X];
var r = w && e[w] || e[k];
return typeof r == "function" ? r : null;
}
var T = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function m(e) {
var P = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function _(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
t[i - 1] = arguments[i];
J("error", e, t);
C("error", e, t);
}
}
function J(e, r, t) {
function C(e, r, t) {
{
var i = T.ReactDebugCurrentFrame, v = i.getStackAddendum();
v !== "" && (r += "%s", t = t.concat([v]));
var g = t.map(function(c) {
return String(c);
var i = P.ReactDebugCurrentFrame, y = i.getStackAddendum();
y !== "" && (r += "%s", t = t.concat([y]));
var m = t.map(function(u) {
return String(u);
});
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
}
}
var j = !1, k = !1, Be = !1, Le = !1, Je = !1, ce;
ce = Symbol.for("react.module.reference");
function Ve(e) {
return !!(typeof e == "string" || typeof e == "function" || e === o || e === y || Je || e === u || e === b || e === f || Le || e === x || j || k || Be || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === E || e.$$typeof === d || e.$$typeof === p || e.$$typeof === h || // This needs to include all possible module reference object
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
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === ce || e.getModuleId !== void 0));
e.$$typeof === ve || e.getModuleId !== void 0));
}

@@ -84,12 +84,12 @@ function Ue(e, r, t) {

return i;
var v = r.displayName || r.name || "";
return v !== "" ? t + "(" + v + ")" : t;
var y = r.displayName || r.name || "";
return y !== "" ? t + "(" + y + ")" : t;
}
function ue(e) {
function de(e) {
return e.displayName || "Context";
}
function C(e) {
function O(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && m("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" && _("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;

@@ -103,7 +103,7 @@ if (typeof e == "string")

return "Portal";
case y:
case b:
return "Profiler";
case u:
case v:
return "StrictMode";
case b:
case g:
return "Suspense";

@@ -115,17 +115,17 @@ case f:

switch (e.$$typeof) {
case p:
case d:
var r = e;
return ue(r) + ".Consumer";
case d:
return de(r) + ".Consumer";
case s:
var t = e;
return ue(t._context) + ".Provider";
return de(t._context) + ".Provider";
case h:
return Ue(e, e.render, "ForwardRef");
case E:
case p:
var i = e.displayName || null;
return i !== null ? i : C(e.type) || "Memo";
case F: {
var v = e, g = v._payload, c = v._init;
return i !== null ? i : O(e.type) || "Memo";
case E: {
var y = e, m = y._payload, u = y._init;
try {
return C(c(g));
return O(u(m));
} catch {

@@ -138,14 +138,14 @@ return null;

}
var P = Object.assign, N = 0, ve, de, pe, ye, be, he, ge;
function me() {
var I = Object.assign, B = 0, pe, ye, be, he, ge, me, Ee;
function _e() {
}
me.__reactDisabledLog = !0;
_e.__reactDisabledLog = !0;
function qe() {
{
if (N === 0) {
ve = console.log, de = console.info, pe = console.warn, ye = console.error, be = console.group, he = console.groupCollapsed, ge = console.groupEnd;
if (B === 0) {
pe = console.log, ye = console.info, be = console.warn, he = console.error, ge = console.group, me = console.groupCollapsed, Ee = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: me,
value: _e,
writable: !0

@@ -163,3 +163,3 @@ };

}
N++;
B++;
}

@@ -169,3 +169,3 @@ }

{
if (N--, N === 0) {
if (B--, B === 0) {
var e = {

@@ -177,52 +177,52 @@ configurable: !0,

Object.defineProperties(console, {
log: P({}, e, {
value: ve
}),
info: P({}, e, {
value: de
}),
warn: P({}, e, {
log: I({}, e, {
value: pe
}),
error: P({}, e, {
info: I({}, e, {
value: ye
}),
group: P({}, e, {
warn: I({}, e, {
value: be
}),
groupCollapsed: P({}, e, {
error: I({}, e, {
value: he
}),
groupEnd: P({}, e, {
group: I({}, e, {
value: ge
}),
groupCollapsed: I({}, e, {
value: me
}),
groupEnd: I({}, e, {
value: Ee
})
});
}
N < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
B < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var Q = T.ReactCurrentDispatcher, ee;
function V(e, r, t) {
var re = P.ReactCurrentDispatcher, te;
function q(e, r, t) {
{
if (ee === void 0)
if (te === void 0)
try {
throw Error();
} catch (v) {
var i = v.stack.trim().match(/\n( *(at )?)/);
ee = i && i[1] || "";
} catch (y) {
var i = y.stack.trim().match(/\n( *(at )?)/);
te = i && i[1] || "";
}
return `
` + ee + e;
` + te + e;
}
}
var re = !1, U;
var ne = !1, G;
{
var He = typeof WeakMap == "function" ? WeakMap : Map;
U = new He();
G = new He();
}
function Ee(e, r) {
if (!e || re)
function Re(e, r) {
if (!e || ne)
return "";
{
var t = U.get(e);
var t = G.get(e);
if (t !== void 0)

@@ -232,13 +232,13 @@ return t;

var i;
re = !0;
var v = Error.prepareStackTrace;
ne = !0;
var y = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var g;
g = Q.current, Q.current = null, qe();
var m;
m = re.current, re.current = null, qe();
try {
if (r) {
var c = function() {
var u = function() {
throw Error();
};
if (Object.defineProperty(c.prototype, "props", {
if (Object.defineProperty(u.prototype, "props", {
set: function() {

@@ -249,14 +249,14 @@ throw Error();

try {
Reflect.construct(c, []);
} catch (O) {
i = O;
Reflect.construct(u, []);
} catch (j) {
i = j;
}
Reflect.construct(e, [], c);
Reflect.construct(e, [], u);
} else {
try {
c.call();
} catch (O) {
i = O;
u.call();
} catch (j) {
i = j;
}
e.call(c.prototype);
e.call(u.prototype);
}

@@ -266,23 +266,23 @@ } else {

throw Error();
} catch (O) {
i = O;
} catch (j) {
i = j;
}
e();
}
} catch (O) {
if (O && i && typeof O.stack == "string") {
for (var s = O.stack.split(`
} catch (j) {
if (j && i && typeof j.stack == "string") {
for (var c = j.stack.split(`
`), D = i.stack.split(`
`), _ = s.length - 1, R = D.length - 1; _ >= 1 && R >= 0 && s[_] !== D[R]; )
R--;
for (; _ >= 1 && R >= 0; _--, R--)
if (s[_] !== D[R]) {
if (_ !== 1 || R !== 1)
`), S = c.length - 1, x = D.length - 1; S >= 1 && x >= 0 && c[S] !== D[x]; )
x--;
for (; S >= 1 && x >= 0; S--, x--)
if (c[S] !== D[x]) {
if (S !== 1 || x !== 1)
do
if (_--, R--, R < 0 || s[_] !== D[R]) {
var w = `
` + s[_].replace(" at new ", " at ");
return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, w), w;
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;
}
while (_ >= 1 && R >= 0);
while (S >= 1 && x >= 0);
break;

@@ -292,9 +292,9 @@ }

} finally {
re = !1, Q.current = g, Ge(), Error.prepareStackTrace = v;
ne = !1, re.current = m, Ge(), Error.prepareStackTrace = y;
}
var I = e ? e.displayName || e.name : "", Pe = I ? V(I) : "";
return typeof e == "function" && U.set(e, Pe), Pe;
var Y = e ? e.displayName || e.name : "", Me = Y ? q(Y) : "";
return typeof e == "function" && G.set(e, Me), Me;
}
function ze(e, r, t) {
return Ee(e, !1);
return Re(e, !1);
}

@@ -305,14 +305,14 @@ function Ke(e) {

}
function q(e, r, t) {
function H(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return Ee(e, Ke(e));
return Re(e, Ke(e));
if (typeof e == "string")
return V(e);
return q(e);
switch (e) {
case b:
return V("Suspense");
case g:
return q("Suspense");
case f:
return V("SuspenseList");
return q("SuspenseList");
}

@@ -323,8 +323,8 @@ if (typeof e == "object")

return ze(e.render);
case E:
return q(e.type, r, t);
case F: {
var i = e, v = i._payload, g = i._init;
case p:
return H(e.type, r, t);
case E: {
var i = e, y = i._payload, m = i._init;
try {
return q(g(v), r, t);
return H(m(y), r, t);
} catch {

@@ -336,26 +336,26 @@ }

}
var G = Object.prototype.hasOwnProperty, _e = {}, Re = T.ReactDebugCurrentFrame;
function H(e) {
var z = Object.prototype.hasOwnProperty, Se = {}, xe = P.ReactDebugCurrentFrame;
function K(e) {
if (e) {
var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
Re.setExtraStackFrame(t);
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
xe.setExtraStackFrame(t);
} else
Re.setExtraStackFrame(null);
xe.setExtraStackFrame(null);
}
function Xe(e, r, t, i, v) {
function Xe(e, r, t, i, y) {
{
var g = Function.call.bind(G);
for (var c in e)
if (g(e, c)) {
var s = void 0;
var m = Function.call.bind(z);
for (var u in e)
if (m(e, u)) {
var c = void 0;
try {
if (typeof e[c] != "function") {
var D = Error((i || "React class") + ": " + t + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
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`.");
throw D.name = "Invariant Violation", D;
}
s = e[c](r, c, i, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (_) {
s = _;
c = e[u](r, u, i, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (S) {
c = S;
}
s && !(s instanceof Error) && (H(v), m("%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, c, typeof s), H(null)), s instanceof Error && !(s.message in _e) && (_e[s.message] = !0, H(v), m("Failed %s type: %s", t, s.message), H(null));
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));
}

@@ -365,3 +365,3 @@ }

var Ze = Array.isArray;
function te(e) {
function le(e) {
return Ze(e);

@@ -377,3 +377,3 @@ }

try {
return Se(e), !1;
return Te(e), !1;
} catch {

@@ -383,10 +383,10 @@ return !0;

}
function Se(e) {
function Te(e) {
return "" + e;
}
function Fe(e) {
function De(e) {
if (er(e))
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Se(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);
}
var Y = T.ReactCurrentOwner, rr = {
var L = P.ReactCurrentOwner, rr = {
key: !0,

@@ -396,6 +396,6 @@ ref: !0,

__source: !0
}, Te, De, ne;
ne = {};
}, we, Fe, ae;
ae = {};
function tr(e) {
if (G.call(e, "ref")) {
if (z.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;

@@ -408,3 +408,3 @@ if (r && r.isReactWarning)

function nr(e) {
if (G.call(e, "key")) {
if (z.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;

@@ -417,5 +417,5 @@ if (r && r.isReactWarning)

function lr(e, r) {
if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) {
var t = C(Y.current.type);
ne[t] || (m('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', C(Y.current.type), e.ref), ne[t] = !0);
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);
}

@@ -426,3 +426,3 @@ }

var t = function() {
Te || (Te = !0, m("%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));
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));
};

@@ -438,3 +438,3 @@ t.isReactWarning = !0, Object.defineProperty(e, "key", {

var t = function() {
De || (De = !0, m("%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));
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));
};

@@ -447,4 +447,4 @@ t.isReactWarning = !0, Object.defineProperty(e, "ref", {

}
var ir = function(e, r, t, i, v, g, c) {
var s = {
var ir = function(e, r, t, i, y, m, u) {
var c = {
// This tag allows us to uniquely identify this as a React Element

@@ -456,7 +456,7 @@ $$typeof: l,

ref: t,
props: c,
props: u,
// Record the component responsible for creating this element.
_owner: g
_owner: m
};
return s._store = {}, Object.defineProperty(s._store, "validated", {
return c._store = {}, Object.defineProperty(c._store, "validated", {
configurable: !1,

@@ -466,3 +466,3 @@ enumerable: !1,

value: !1
}), Object.defineProperty(s, "_self", {
}), Object.defineProperty(c, "_self", {
configurable: !1,

@@ -472,44 +472,44 @@ enumerable: !1,

value: i
}), Object.defineProperty(s, "_source", {
}), Object.defineProperty(c, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: v
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
value: y
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
};
function sr(e, r, t, i, v) {
function sr(e, r, t, i, y) {
{
var g, c = {}, s = null, D = null;
t !== void 0 && (Fe(t), s = "" + t), nr(r) && (Fe(r.key), s = "" + r.key), tr(r) && (D = r.ref, lr(r, v));
for (g in r)
G.call(r, g) && !rr.hasOwnProperty(g) && (c[g] = r[g]);
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]);
if (e && e.defaultProps) {
var _ = e.defaultProps;
for (g in _)
c[g] === void 0 && (c[g] = _[g]);
var S = e.defaultProps;
for (m in S)
u[m] === void 0 && (u[m] = S[m]);
}
if (s || D) {
var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
s && ar(c, R), D && or(c, R);
if (c || D) {
var x = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
c && ar(u, x), D && or(u, x);
}
return ir(e, s, D, v, i, Y.current, c);
return ir(e, c, D, y, i, L.current, u);
}
}
var le = T.ReactCurrentOwner, we = T.ReactDebugCurrentFrame;
function M(e) {
var oe = P.ReactCurrentOwner, Ce = P.ReactDebugCurrentFrame;
function N(e) {
if (e) {
var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
we.setExtraStackFrame(t);
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
Ce.setExtraStackFrame(t);
} else
we.setExtraStackFrame(null);
Ce.setExtraStackFrame(null);
}
var ae;
ae = !1;
function oe(e) {
var ie;
ie = !1;
function se(e) {
return typeof e == "object" && e !== null && e.$$typeof === l;
}
function xe() {
function Oe() {
{
if (le.current) {
var e = C(le.current.type);
if (oe.current) {
var e = O(oe.current.type);
if (e)

@@ -534,6 +534,6 @@ return `

}
var Ce = {};
var je = {};
function cr(e) {
{
var r = xe();
var r = Oe();
if (!r) {

@@ -548,3 +548,3 @@ var t = typeof e == "string" ? e : e.displayName || e.name;

}
function Oe(e, r) {
function ke(e, r) {
{

@@ -555,25 +555,25 @@ if (!e._store || e._store.validated || e.key != null)

var t = cr(r);
if (Ce[t])
if (je[t])
return;
Ce[t] = !0;
je[t] = !0;
var i = "";
e && e._owner && e._owner !== le.current && (i = " It was passed a child from " + C(e._owner.type) + "."), M(e), m('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), M(null);
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);
}
}
function je(e, r) {
function Pe(e, r) {
{
if (typeof e != "object")
return;
if (te(e))
if (le(e))
for (var t = 0; t < e.length; t++) {
var i = e[t];
oe(i) && Oe(i, r);
se(i) && ke(i, r);
}
else if (oe(e))
else if (se(e))
e._store && (e._store.validated = !0);
else if (e) {
var v = Z(e);
if (typeof v == "function" && v !== e.entries)
for (var g = v.call(e), c; !(c = g.next()).done; )
oe(c.value) && Oe(c.value, r);
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);
}

@@ -592,3 +592,3 @@ }

// Inner props are checked in the reconciler.
r.$$typeof === E))
r.$$typeof === p))
t = r.propTypes;

@@ -598,10 +598,10 @@ else

if (t) {
var i = C(r);
var i = O(r);
Xe(t, e.props, "prop", i, e);
} else if (r.PropTypes !== void 0 && !ae) {
ae = !0;
var v = C(r);
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
} 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");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}

@@ -614,58 +614,58 @@ }

if (i !== "children" && i !== "key") {
M(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), M(null);
N(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), N(null);
break;
}
}
e.ref !== null && (M(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
e.ref !== null && (N(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
}
}
function ke(e, r, t, i, v, g) {
function Ae(e, r, t, i, y, m) {
{
var c = Ve(e);
if (!c) {
var s = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " 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(v);
D ? s += D : s += xe();
var _;
e === null ? _ = "null" : te(e) ? _ = "array" : e !== void 0 && e.$$typeof === l ? (_ = "<" + (C(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, s);
var u = Je(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 R = sr(e, r, t, v, g);
if (R == null)
return R;
if (c) {
var w = r.children;
if (w !== void 0)
var x = sr(e, r, t, y, m);
if (x == null)
return x;
if (u) {
var F = r.children;
if (F !== void 0)
if (i)
if (te(w)) {
for (var I = 0; I < w.length; I++)
je(w[I], e);
Object.freeze && Object.freeze(w);
if (le(F)) {
for (var Y = 0; Y < F.length; Y++)
Pe(F[Y], e);
Object.freeze && Object.freeze(F);
} else
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
_("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
je(w, e);
Pe(F, e);
}
return e === o ? vr(R) : ur(R), R;
return e === o ? vr(x) : ur(x), x;
}
}
function dr(e, r, t) {
return ke(e, r, t, !0);
return Ae(e, r, t, !0);
}
function pr(e, r, t) {
return ke(e, r, t, !1);
return Ae(e, r, t, !1);
}
var yr = pr, br = dr;
B.Fragment = o, B.jsx = yr, B.jsxs = br;
}()), B;
J.Fragment = o, J.jsx = yr, J.jsxs = br;
}()), J;
}
process.env.NODE_ENV === "production" ? ie.exports = hr() : ie.exports = gr();
var S = ie.exports;
function se({ children: n, textColor: l, style: a, colSpan: o, ...u }) {
return /* @__PURE__ */ S.jsxs("td", { className: "calendar-label", style: a, colSpan: o, ...u, 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 })
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 })
] });
}
const mr = {
const Rr = {
//light themes

@@ -897,3 +897,3 @@ empty: {

}
}, Er = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Ar = (n = /* @__PURE__ */ new Date()) => {
}, Sr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], xr = (n = /* @__PURE__ */ new Date()) => {
const l = {

@@ -927,14 +927,17 @@ Sun: "Sunday",

};
}, Ie = (n, l, a) => `${n}-${String(l + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`, _r = (n, l, a) => `${n}-${String(l).padStart(2, "0")}-${String(a).padStart(2, "0")}`, A = (n) => +n.slice(0, 4), $e = (n) => +n.slice(5, 7), Mr = (n) => +n.slice(8, 10), Rr = (n = $()) => n % 4 === 0 && n % 100 !== 0 || n % 400 === 0, fe = (n = $()) => [31, Rr(n) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], K = (n = $()) => new Date(n, 0, 1).getDay(), Ir = (n) => new Date(n).getDay(), $ = () => (/* @__PURE__ */ new Date()).getFullYear(), $r = (n = $(), l, a) => {
const o = fe(n), u = K(n), y = [];
let d = u;
for (let p = 0; p < 12; p++) {
const h = o[p];
let b = 0;
}, Tr = (n) => {
const l = xr(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;
for (let d = 0; d < 12; d++) {
const h = o[d];
let g = 0;
for (let f = 0; f < h; f++)
d === 0 && b++, d = (d + 1) % 7;
p === 0 && u !== 0 && b++, y.push(b);
s === 0 && g++, s = (s + 1) % 7;
d === 0 && v !== 0 && g++, b.push(g);
}
return n !== l && u !== 0 && l !== a && (y[0] -= 1), y;
}, Sr = (n) => {
return n !== l && v !== 0 && l !== a && (b[0] -= 1), b;
}, Fr = (n) => {
const l = /* @__PURE__ */ new Map();

@@ -946,91 +949,126 @@ return n.forEach((a) => {

}), l;
}, Fr = (n) => typeof n == "string" ? mr[n] : n, Tr = (n, l) => {
}, Cr = (n) => typeof n == "string" ? Rr[n] : n, Or = (n, l) => {
let a = 0;
for (let o = n; o <= l; ++o)
a += Ye(n, o === n);
a += Be(n, o === n);
return new Array(7).fill(0).map(() => new Array(a).fill(0));
}, Dr = (n, l) => {
}, jr = (n, l) => {
let a = 0;
for (let o = n; o <= l; ++o)
a += Ye(n, o === n);
a += Be(n, o === n);
return new Array(7).fill("").map(() => new Array(a).fill(""));
}, Ye = (n, l) => {
const a = K(n);
}, Be = (n, l) => {
const a = Z(n);
return l || a === 0 ? 53 : 52;
}, wr = (n, l) => {
const a = A(n), o = A(l), u = Tr(a, o);
let y = 0, d = 1;
for (let p = a; p <= o; ++p) {
const h = K(p), b = fe(p);
let f = 0, E = 1, F = h;
}, 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;
for (; f < 12; ) {
for (let x = 0; x < b[f]; ++x)
u[F % 7][~~(F / 7) + y] = d, F++, E++, d++;
E > b[f] && (E = 1, f++);
for (let R = 0; R < g[f]; ++R)
v[E % 7][~~(E / 7) + b] = s, E++, p++, s++;
p > g[f] && (p = 1, f++);
}
y += ~~(F / 7);
b += ~~(E / 7);
}
return u;
}, We = (n, l) => {
const a = A(n), o = A(l), u = Dr(a, o);
let y = 0;
for (let d = a; d <= o; ++d) {
const p = K(d), h = fe(d);
let b = 0, f = 1, E = p;
for (; b < 12; ) {
for (let F = 0; F < h[b]; ++F) {
const x = _r(d, b + 1, f);
u[E % 7][~~(E / 7) + y] = x, E++, f++;
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++;
}
f > h[b] && (f = 1, b++);
f > h[g] && (f = 1, g++);
}
y += ~~(E / 7);
b += ~~(p / 7);
}
return u;
}, z = (n, l) => {
const a = `${n}-01-01`, o = xr(a, l), u = wr(a, l);
for (let y = 0; y < u.length; ++y)
for (let d = 0; d < u[y].length; ++d)
if (o === u[y][d])
return { row: y, col: d };
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 };
return { row: 0, col: 0 };
}, xr = (n, l) => {
}, Pr = (n, l) => {
const a = new Date(n);
return (new Date(l).getTime() - a.getTime()) / (1e3 * 60 * 60 * 24) + 1;
}, Cr = (n, l, a) => {
const { row: o, col: u } = z(A(n), n), { col: y } = z(A(n), l), d = [], p = [];
let h = -1, b = 0;
for (let f = u; f <= y; ++f)
f === u ? b = $e(a[o][f]) - 1 : b = $e(a[0][f]) - 1, b !== h && (d.push(Er[b]), h = b, p.push(0)), p[p.length - 1]++;
return { months: d, colSpans: p };
}, 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 };
};
function Or({ start: n, end: l, textColor: a }) {
const o = We(n, l), { months: u, colSpans: y } = Cr(n, l, o);
return /* @__PURE__ */ S.jsx("thead", { children: /* @__PURE__ */ S.jsxs("tr", { children: [
/* @__PURE__ */ S.jsx(se, { textColor: a, style: { width: "40px" }, colSpan: 1, children: " " }),
u.map((d, p) => /* @__PURE__ */ S.jsx(se, { textColor: a, colSpan: y[p], children: d }, p))
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))
] }) });
}
function jr({ children: n, style: l, dataTooltip: a, dataLevel: o, themeProps: u, ...y }) {
return /* @__PURE__ */ S.jsx(
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)
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)
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;
};
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);
}
}
};
return s.current && s.current.addEventListener("mouseover", p), () => {
s.current && s.current.removeEventListener("mouseover", p);
};
}, []), /* @__PURE__ */ T.jsx(
"td",
{
ref: s,
className: "calendar-cell top half-arrow",
style: { ...l, backgroundColor: u[`level${o}`] },
style: {
...l,
backgroundColor: v[`level${o}`],
"--tooltip-offset": `${d}px`
},
"data-tooltip": a,
"data-level": o,
...y,
children: /* @__PURE__ */ S.jsx("span", { className: "sr-only", children: n })
...b,
children: /* @__PURE__ */ T.jsx("span", { className: "sr-only", children: n })
}
);
}
function kr({ data: n, start: l, end: a, textColor: o, theme: u }) {
const y = A(l), { row: d, col: p } = z(y, l), { row: h, col: b } = z(y, a), f = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], E = We(l, a), x = ((T) => Fr(T))(u), L = Sr(n), X = (T, m) => !E[T][m] || m < p || m > b, Z = (T, m) => m === p && T < d || m === b && T > h;
return /* @__PURE__ */ S.jsx("tbody", { children: f.map((T, m) => /* @__PURE__ */ S.jsxs("tr", { children: [
/* @__PURE__ */ S.jsx(se, { tabIndex: 0, textColor: o, style: { textAlign: "inherit" }, children: T }),
E[m].map((J, j) => {
if (X(m, j))
return /* @__PURE__ */ S.jsx("td", { style: { padding: "0", display: "none" } }, j);
if (Z(m, j))
return /* @__PURE__ */ S.jsx(
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(
"td",

@@ -1040,3 +1078,3 @@ {

padding: 0,
outline: "1px solid rgba(27, 31, 35, 0.06)",
outline: b ? "1px solid rgba(27, 31, 35, 0.06)" : "none",
borderRadius: "2px",

@@ -1047,50 +1085,62 @@ outlineOffset: "-1px",

},
j
A
);
const k = L.get(J);
return /* @__PURE__ */ S.jsx(
jr,
const M = k.get(U), ee = Tr(U);
return /* @__PURE__ */ T.jsx(
Ir,
{
tabIndex: -1,
style: { width: "10px", height: "10px" },
dataLevel: k !== void 0 ? k.level : 0,
"data-content": JSON.stringify(k == null ? void 0 : k.data),
dataTooltip: J,
themeProps: x
dataLevel: M !== void 0 ? M.level : 0,
"data-content": JSON.stringify(M == null ? void 0 : M.data),
dataTooltip: ee,
themeProps: w
},
j
A
);
})
] }, T)) });
] }, _)) });
}
function Nr({
function Lr({
data: n = [],
textColor: l = "#000",
theme: a = "grass",
start: o = Ie($(), 0, 1),
end: u = Ie($(), 11, 31)
start: o = Ne(W(), 0, 1),
end: v = Ne(W(), 11, 31),
includeBoundary: b = !0
}) {
return /* @__PURE__ */ S.jsx("div", { className: "container", children: /* @__PURE__ */ S.jsxs("table", { children: [
/* @__PURE__ */ S.jsx(Or, { textColor: l, start: o, end: u }),
/* @__PURE__ */ S.jsx(kr, { data: n, textColor: l, theme: a, start: o, end: u })
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(
$r,
{
data: n,
textColor: l,
theme: a,
start: o,
end: v,
includeBoundary: b
}
)
] }) });
}
export {
Nr as ContributionCalendar,
Fr as createTheme,
$r as getColumnSpansForYears,
$ as getCurrentYear,
Ar as getDateDetails,
Ie as getDateString,
We as getDayArray,
Ir as getDayIndexOfMonth,
xr as getDaysBetween,
K as getFirstDayIndexOfYear,
Cr as getMonthsAndColSpans,
z as getRowAndColumnIndexFromDate,
Rr as isLeapYear,
Mr as parseDayFromDateString,
Sr as parseInputData,
$e as parseMonthFromDateString,
A as parseYearFromDateString
Lr as ContributionCalendar,
Cr as createTheme,
Br as getColumnSpansForYears,
W as getCurrentYear,
xr as getDateDetails,
Ne as getDateString,
Tr as getDateTooltip,
Le as getDayArray,
Wr as getDayIndexOfMonth,
Pr as getDaysBetween,
Z as getFirstDayIndexOfYear,
Ar as getMonthsAndColSpans,
X as getRowAndColumnIndexFromDate,
wr as isLeapYear,
Yr as parseDayFromDateString,
Fr as parseInputData,
Ye as parseMonthFromDateString,
$ as parseYearFromDateString
};

@@ -1,2 +0,2 @@

// Type definitions for react-contribution-calendar 1.1.1
// Type definitions for react-contribution-calendar 1.1.2
// Project: https://github.com/seiwon-yaehee/react-contribution-calendar

@@ -40,2 +40,6 @@ // Definitions by: Seiwon Park <https://github.com/SeiwonPark>

/**
* Whether to include the boundary column or not, defaults to `true`.
*/
includeBoundary?: boolean
/**
* The name of theme for the ContributionCalendar, defaults to `grass`. Also

@@ -42,0 +46,0 @@ * `ThemeProps` could be added directly i.e. when trying to use custom theme.

{
"name": "react-contribution-calendar",
"description": "A GitHub-like contribution calendar component for React",
"version": "1.1.1",
"version": "1.1.2",
"type": "module",

@@ -6,0 +6,0 @@ "main": "./dist/index.js",

@@ -54,2 +54,3 @@ # react-contribution-calendar

textColor="#000000"
includeBoundary={true}
theme="grass"

@@ -88,2 +89,3 @@ />

- `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`.

@@ -90,0 +92,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc