react-fill-calendar 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,66 +1,66 @@
1
- import Q, { useMemo as re } from "react";
2
- var D = { exports: {} }, S = {};
3
- var B;
1
+ import re, { useMemo as B } from "react";
2
+ var I = { exports: {} }, $ = {};
3
+ var H;
4
4
  function te() {
5
- if (B) return S;
6
- B = 1;
7
- var c = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function g(p, s, f) {
9
- var i = null;
10
- if (f !== void 0 && (i = "" + f), s.key !== void 0 && (i = "" + s.key), "key" in s) {
11
- f = {};
12
- for (var x in s)
13
- x !== "key" && (f[x] = s[x]);
14
- } else f = s;
15
- return s = f.ref, {
5
+ if (H) return $;
6
+ H = 1;
7
+ var c = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function b(v, l, i) {
9
+ var d = null;
10
+ if (i !== void 0 && (d = "" + i), l.key !== void 0 && (d = "" + l.key), "key" in l) {
11
+ i = {};
12
+ for (var y in l)
13
+ y !== "key" && (i[y] = l[y]);
14
+ } else i = l;
15
+ return l = i.ref, {
16
16
  $$typeof: c,
17
- type: p,
18
- key: i,
19
- ref: s !== void 0 ? s : null,
20
- props: f
17
+ type: v,
18
+ key: d,
19
+ ref: l !== void 0 ? l : null,
20
+ props: i
21
21
  };
22
22
  }
23
- return S.Fragment = b, S.jsx = g, S.jsxs = g, S;
23
+ return $.Fragment = m, $.jsx = b, $.jsxs = b, $;
24
24
  }
25
- var N = {};
26
- var H;
25
+ var D = {};
26
+ var Z;
27
27
  function ne() {
28
- return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
28
+ return Z || (Z = 1, process.env.NODE_ENV !== "production" && (function() {
29
29
  function c(e) {
30
30
  if (e == null) return null;
31
31
  if (typeof e == "function")
32
- return e.$$typeof === I ? null : e.displayName || e.name || null;
32
+ return e.$$typeof === T ? null : e.displayName || e.name || null;
33
33
  if (typeof e == "string") return e;
34
34
  switch (e) {
35
- case j:
35
+ case A:
36
36
  return "Fragment";
37
37
  case P:
38
38
  return "Profiler";
39
- case A:
39
+ case g:
40
40
  return "StrictMode";
41
- case m:
41
+ case E:
42
42
  return "Suspense";
43
- case y:
43
+ case p:
44
44
  return "SuspenseList";
45
- case C:
45
+ case x:
46
46
  return "Activity";
47
47
  }
48
48
  if (typeof e == "object")
49
49
  switch (typeof e.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
51
  ), e.$$typeof) {
52
- case Y:
52
+ case O:
53
53
  return "Portal";
54
- case u:
54
+ case L:
55
55
  return e.displayName || "Context";
56
- case F:
56
+ case Y:
57
57
  return (e._context.displayName || "Context") + ".Consumer";
58
- case l:
58
+ case f:
59
59
  var r = e.render;
60
60
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
- case T:
61
+ case t:
62
62
  return r = e.displayName || null, r !== null ? r : c(e.type) || "Memo";
63
- case d:
63
+ case u:
64
64
  r = e._payload, e = e._init;
65
65
  try {
66
66
  return c(e(r));
@@ -69,29 +69,29 @@ function ne() {
69
69
  }
70
70
  return null;
71
71
  }
72
- function b(e) {
72
+ function m(e) {
73
73
  return "" + e;
74
74
  }
75
- function g(e) {
75
+ function b(e) {
76
76
  try {
77
- b(e);
77
+ m(e);
78
78
  var r = !1;
79
79
  } catch {
80
80
  r = !0;
81
81
  }
82
82
  if (r) {
83
83
  r = console;
84
- var t = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
- return t.call(
84
+ var n = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
+ return n.call(
86
86
  r,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
- a
89
- ), b(e);
88
+ o
89
+ ), m(e);
90
90
  }
91
91
  }
92
- function p(e) {
93
- if (e === j) return "<>";
94
- if (typeof e == "object" && e !== null && e.$$typeof === d)
92
+ function v(e) {
93
+ if (e === A) return "<>";
94
+ if (typeof e == "object" && e !== null && e.$$typeof === u)
95
95
  return "<...>";
96
96
  try {
97
97
  var r = c(e);
@@ -100,49 +100,49 @@ function ne() {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
- function s() {
104
- var e = M.A;
103
+ function l() {
104
+ var e = k.A;
105
105
  return e === null ? null : e.getOwner();
106
106
  }
107
- function f() {
107
+ function i() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
- function i(e) {
111
- if (W.call(e, "key")) {
110
+ function d(e) {
111
+ if (F.call(e, "key")) {
112
112
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
113
113
  if (r && r.isReactWarning) return !1;
114
114
  }
115
115
  return e.key !== void 0;
116
116
  }
117
- function x(e, r) {
118
- function t() {
117
+ function y(e, r) {
118
+ function n() {
119
119
  z || (z = !0, console.error(
120
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
121
  r
122
122
  ));
123
123
  }
124
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
125
- get: t,
124
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
125
+ get: n,
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function k() {
129
+ function S() {
130
130
  var e = c(this.type);
131
131
  return J[e] || (J[e] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
133
  )), e = this.props.ref, e !== void 0 ? e : null;
134
134
  }
135
- function _(e, r, t, a, $, U) {
136
- var o = t.ref;
135
+ function R(e, r, n, o, M, q) {
136
+ var s = n.ref;
137
137
  return e = {
138
- $$typeof: R,
138
+ $$typeof: _,
139
139
  type: e,
140
140
  key: r,
141
- props: t,
142
- _owner: a
143
- }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
141
+ props: n,
142
+ _owner: o
143
+ }, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
144
144
  enumerable: !1,
145
- get: k
145
+ get: S
146
146
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
@@ -157,235 +157,236 @@ function ne() {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: $
160
+ value: M
161
161
  }), Object.defineProperty(e, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: U
165
+ value: q
166
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
167
  }
168
- function v(e, r, t, a, $, U) {
169
- var o = r.children;
170
- if (o !== void 0)
171
- if (a)
172
- if (K(o)) {
173
- for (a = 0; a < o.length; a++)
174
- E(o[a]);
175
- Object.freeze && Object.freeze(o);
168
+ function w(e, r, n, o, M, q) {
169
+ var s = r.children;
170
+ if (s !== void 0)
171
+ if (o)
172
+ if (K(s)) {
173
+ for (o = 0; o < s.length; o++)
174
+ h(s[o]);
175
+ Object.freeze && Object.freeze(s);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else E(o);
181
- if (W.call(r, "key")) {
182
- o = c(e);
183
- var w = Object.keys(r).filter(function(ee) {
180
+ else h(s);
181
+ if (F.call(r, "key")) {
182
+ s = c(e);
183
+ var C = Object.keys(r).filter(function(ee) {
184
184
  return ee !== "key";
185
185
  });
186
- a = 0 < w.length ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}", X[o + a] || (w = 0 < w.length ? "{" + w.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ o = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", X[s + o] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
190
190
  React keys must be passed directly to JSX without using spread:
191
191
  let props = %s;
192
192
  <%s key={someKey} {...props} />`,
193
- a,
194
193
  o,
195
- w,
196
- o
197
- ), X[o + a] = !0);
194
+ s,
195
+ C,
196
+ s
197
+ ), X[s + o] = !0);
198
198
  }
199
- if (o = null, t !== void 0 && (g(t), o = "" + t), i(r) && (g(r.key), o = "" + r.key), "key" in r) {
200
- t = {};
201
- for (var q in r)
202
- q !== "key" && (t[q] = r[q]);
203
- } else t = r;
204
- return o && x(
205
- t,
199
+ if (s = null, n !== void 0 && (b(n), s = "" + n), d(r) && (b(r.key), s = "" + r.key), "key" in r) {
200
+ n = {};
201
+ for (var W in r)
202
+ W !== "key" && (n[W] = r[W]);
203
+ } else n = r;
204
+ return s && y(
205
+ n,
206
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
- ), _(
207
+ ), R(
208
208
  e,
209
- o,
210
- t,
211
- s(),
212
- $,
213
- U
209
+ s,
210
+ n,
211
+ l(),
212
+ M,
213
+ q
214
214
  );
215
215
  }
216
- function E(e) {
217
- O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === d && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
216
+ function h(e) {
217
+ N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === u && (e._payload.status === "fulfilled" ? N(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
218
  }
219
- function O(e) {
220
- return typeof e == "object" && e !== null && e.$$typeof === R;
219
+ function N(e) {
220
+ return typeof e == "object" && e !== null && e.$$typeof === _;
221
221
  }
222
- var h = Q, R = /* @__PURE__ */ Symbol.for("react.transitional.element"), Y = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), A = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), F = /* @__PURE__ */ Symbol.for("react.consumer"), u = /* @__PURE__ */ Symbol.for("react.context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), y = /* @__PURE__ */ Symbol.for("react.suspense_list"), T = /* @__PURE__ */ Symbol.for("react.memo"), d = /* @__PURE__ */ Symbol.for("react.lazy"), C = /* @__PURE__ */ Symbol.for("react.activity"), I = /* @__PURE__ */ Symbol.for("react.client.reference"), M = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, K = Array.isArray, L = console.createTask ? console.createTask : function() {
222
+ var j = re, _ = /* @__PURE__ */ Symbol.for("react.transitional.element"), O = /* @__PURE__ */ Symbol.for("react.portal"), A = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), Y = /* @__PURE__ */ Symbol.for("react.consumer"), L = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), E = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), t = /* @__PURE__ */ Symbol.for("react.memo"), u = /* @__PURE__ */ Symbol.for("react.lazy"), x = /* @__PURE__ */ Symbol.for("react.activity"), T = /* @__PURE__ */ Symbol.for("react.client.reference"), k = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, K = Array.isArray, U = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- h = {
225
+ j = {
226
226
  react_stack_bottom_frame: function(e) {
227
227
  return e();
228
228
  }
229
229
  };
230
- var z, J = {}, V = h.react_stack_bottom_frame.bind(
231
- h,
232
- f
233
- )(), G = L(p(f)), X = {};
234
- N.Fragment = j, N.jsx = function(e, r, t) {
235
- var a = 1e4 > M.recentlyCreatedOwnerStacks++;
236
- return v(
230
+ var z, J = {}, V = j.react_stack_bottom_frame.bind(
231
+ j,
232
+ i
233
+ )(), G = U(v(i)), X = {};
234
+ D.Fragment = A, D.jsx = function(e, r, n) {
235
+ var o = 1e4 > k.recentlyCreatedOwnerStacks++;
236
+ return w(
237
237
  e,
238
238
  r,
239
- t,
239
+ n,
240
240
  !1,
241
- a ? Error("react-stack-top-frame") : V,
242
- a ? L(p(e)) : G
241
+ o ? Error("react-stack-top-frame") : V,
242
+ o ? U(v(e)) : G
243
243
  );
244
- }, N.jsxs = function(e, r, t) {
245
- var a = 1e4 > M.recentlyCreatedOwnerStacks++;
246
- return v(
244
+ }, D.jsxs = function(e, r, n) {
245
+ var o = 1e4 > k.recentlyCreatedOwnerStacks++;
246
+ return w(
247
247
  e,
248
248
  r,
249
- t,
249
+ n,
250
250
  !0,
251
- a ? Error("react-stack-top-frame") : V,
252
- a ? L(p(e)) : G
251
+ o ? Error("react-stack-top-frame") : V,
252
+ o ? U(v(e)) : G
253
253
  );
254
254
  };
255
- })()), N;
255
+ })()), D;
256
256
  }
257
- var Z;
257
+ var Q;
258
258
  function ae() {
259
- return Z || (Z = 1, process.env.NODE_ENV === "production" ? D.exports = te() : D.exports = ne()), D.exports;
259
+ return Q || (Q = 1, process.env.NODE_ENV === "production" ? I.exports = te() : I.exports = ne()), I.exports;
260
260
  }
261
- var n = ae();
261
+ var a = ae();
262
262
  const oe = ({
263
263
  fillingColor: c,
264
- borderfillColor: b,
265
- hoverborderColor: g,
266
- cellBorderColor: p,
267
- cellColor: s,
268
- day: f,
269
- isSelected: i = !1,
270
- cellShape: x
264
+ borderfillColor: m,
265
+ hoverborderColor: b,
266
+ cellBorderColor: v,
267
+ cellColor: l,
268
+ day: i,
269
+ isSelected: d = !1,
270
+ cellShape: y,
271
+ href: S
271
272
  }) => {
272
- const k = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
273
+ const R = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
273
274
  month: "long",
274
275
  day: "numeric",
275
276
  year: "numeric"
276
- }), _ = x === "square" ? "rounded-md" : "rounded-full", v = f === k, E = `
277
+ }), w = y === "square" ? "rounded-md" : "rounded-full", h = i === R, N = `
277
278
  flex items-center justify-center
278
- ${_} border-2 transition-colors duration-150 hover:scale-150
279
- ${!v && !i && g ? "hover-border-var" : ""}
280
- `;
281
- return v ? /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center justify-center w-4 h-4", children: [
282
- /* @__PURE__ */ n.jsx(
283
- "div",
284
- {
285
- className: "absolute inset-0 rounded-md rainbow-spin",
286
- style: {
287
- background: "conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",
288
- padding: "2px",
289
- boxShadow: "0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",
290
- borderRadius: "0.5rem"
291
- }
292
- }
293
- ),
294
- /* @__PURE__ */ n.jsx("div", { className: `relative flex items-center justify-center w-4 h-4 ${_} p-[2px]`, children: /* @__PURE__ */ n.jsx(
295
- "button",
296
- {
297
- type: "button",
298
- className: "today-cell-btn flex items-center justify-center w-full h-full rounded-md border-2 border-transparent transition-colors duration-150 hover:scale-150",
299
- style: {
300
- "--border-fill-color": i ? b : p,
301
- backgroundColor: i ? c : s
302
- }
303
- }
304
- ) })
305
- ] }) : /* @__PURE__ */ n.jsx(
279
+ ${w} border-2 transition-colors duration-150 hover:scale-150
280
+ ${!h && !d && b ? "hover-border-var" : ""}
281
+ `, j = !!(S && d), _ = (g = "", P) => /* @__PURE__ */ a.jsx(
306
282
  "button",
307
283
  {
308
284
  type: "button",
309
- className: `${E} w-4 h-4`,
310
- style: i && !v ? {
311
- backgroundColor: c,
312
- borderColor: b,
313
- "--hover-border-color": g
314
- } : v ? void 0 : {
315
- backgroundColor: s,
316
- "--border-color": p,
317
- "--hover-border-color": g
318
- }
285
+ className: `${N} ${g}`,
286
+ style: P
319
287
  }
320
- );
288
+ ), O = (g) => j ? /* @__PURE__ */ a.jsx("a", { href: S, className: "contents", children: g }) : g;
289
+ if (h) {
290
+ const g = /* @__PURE__ */ a.jsxs("div", { className: "relative flex items-center justify-center w-4 h-4", children: [
291
+ /* @__PURE__ */ a.jsx(
292
+ "div",
293
+ {
294
+ className: "absolute inset-0 rounded-md rainbow-spin",
295
+ style: {
296
+ background: "conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",
297
+ padding: "2px",
298
+ boxShadow: "0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",
299
+ borderRadius: "0.5rem"
300
+ }
301
+ }
302
+ ),
303
+ /* @__PURE__ */ a.jsx("div", { className: `relative flex items-center justify-center w-4 h-4 ${w} p-[2px]`, children: _("today-cell-btn w-full h-full rounded-md border-transparent", {
304
+ "--border-fill-color": d ? m : v,
305
+ backgroundColor: d ? c : l
306
+ }) })
307
+ ] });
308
+ return O(g);
309
+ }
310
+ return O(_("w-4 h-4", d && !h ? {
311
+ backgroundColor: c,
312
+ borderColor: m,
313
+ "--hover-border-color": b
314
+ } : h ? void 0 : {
315
+ backgroundColor: l,
316
+ "--border-color": v,
317
+ "--hover-border-color": b
318
+ }));
321
319
  }, se = ({
322
320
  fillingColor: c = "#50C878",
323
- borderfillColor: b = "#27592D",
324
- hoverborderColor: g = "#FFCCCB",
325
- cellBorderColor: p = "#808080",
326
- cellColor: s = "#ADADAD",
327
- legend: f = !0,
328
- mainBorder: i = !0,
329
- borderColor: x = "#708090",
330
- textColor: k = "#708090",
331
- selectedDates: _ = [],
332
- title: v = "Calendar",
333
- cellShape: E = "square",
334
- column: O = 15,
335
- legendColumn: h = !1
321
+ borderfillColor: m = "#27592D",
322
+ hoverborderColor: b = "#FFCCCB",
323
+ cellBorderColor: v = "#808080",
324
+ cellColor: l = "#ADADAD",
325
+ legend: i = !0,
326
+ mainBorder: d = !0,
327
+ borderColor: y = "#708090",
328
+ textColor: S = "#708090",
329
+ selectedDates: R = [],
330
+ title: w = "Calendar",
331
+ cellShape: h = "square",
332
+ column: N = 15,
333
+ legendColumn: j = !1
336
334
  }) => {
337
- const R = /* @__PURE__ */ new Date(), Y = Q.useMemo(() => {
338
- const u = (l) => {
339
- if (!l) return "";
340
- if (typeof l == "string") {
341
- const m = l.split("-");
342
- if (m.length === 3) {
343
- const y = m[0], T = String(Number(m[1])).padStart(2, "0"), d = String(Number(m[2])).padStart(2, "0");
344
- return `${y}-${T}-${d}`;
335
+ const _ = /* @__PURE__ */ new Date(), { selectedSet: O, hrefMap: A } = B(() => {
336
+ const f = (t) => {
337
+ if (!t) return "";
338
+ if (typeof t == "string") {
339
+ const u = t.split("-");
340
+ if (u.length === 3) {
341
+ const x = u[0], T = String(Number(u[1])).padStart(2, "0"), k = String(Number(u[2])).padStart(2, "0");
342
+ return `${x}-${T}-${k}`;
345
343
  }
346
- return l;
344
+ return t;
347
345
  }
348
- return typeof l == "object" && l.day ? u(l.day) : "";
349
- };
350
- return new Set(
351
- (_ || []).map((l) => u(l)).filter(Boolean)
352
- );
353
- }, [_]), j = re(() => {
354
- const u = R.getFullYear(), l = R.getMonth(), m = new Date(u, l - 1, 1), y = new Date(u, l + 2, 0), T = [], d = new Date(m);
355
- for (; d <= y; ) {
356
- const C = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(
357
- d.getDate()
358
- ).padStart(2, "0")}`, I = Y.has(C);
359
- T.push({
360
- key: C,
361
- isSelected: I,
346
+ return typeof t == "object" && t.day ? f(t.day) : "";
347
+ }, E = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map();
348
+ for (const t of R || []) {
349
+ const u = t && typeof t == "object" && t.day ? f(t.day) : f(t);
350
+ u && (E.add(u), t && typeof t == "object" && t.href && p.set(u, t.href));
351
+ }
352
+ return { selectedSet: E, hrefMap: p };
353
+ }, [R]), g = B(() => {
354
+ const f = _.getFullYear(), E = _.getMonth(), p = new Date(f, E - 1, 1), t = new Date(f, E + 2, 0), u = [], x = new Date(p);
355
+ for (; x <= t; ) {
356
+ const T = `${x.getFullYear()}-${String(x.getMonth() + 1).padStart(2, "0")}-${String(
357
+ x.getDate()
358
+ ).padStart(2, "0")}`, k = O.has(T), F = A.get(T);
359
+ u.push({
360
+ key: T,
361
+ isSelected: k,
362
+ href: F,
362
363
  // keep a Date copy in case you want to use it later
363
- dateObj: new Date(d)
364
- }), d.setDate(d.getDate() + 1);
364
+ dateObj: new Date(x)
365
+ }), x.setDate(x.getDate() + 1);
365
366
  }
366
- return T;
367
- }, [_, R]), A = [], P = O;
368
- for (let u = 0; u < j.length; u += P)
369
- A.push(j.slice(u, u + P));
370
- const F = E === "square" ? "rounded-md" : "rounded-full";
371
- return /* @__PURE__ */ n.jsxs(
367
+ return u;
368
+ }, [R, _]), P = [], Y = N;
369
+ for (let f = 0; f < g.length; f += Y)
370
+ P.push(g.slice(f, f + Y));
371
+ const L = h === "square" ? "rounded-md" : "rounded-full";
372
+ return /* @__PURE__ */ a.jsxs(
372
373
  "div",
373
374
  {
374
- className: `inline-flex flex-col gap-2 p-3 rounded-xl ${i ? "border shadow-sm" : ""} `,
375
+ className: `inline-flex flex-col gap-2 p-3 rounded-xl ${d ? "border shadow-sm" : ""} `,
375
376
  style: {
376
- borderColor: i ? x : void 0
377
+ borderColor: d ? y : void 0
377
378
  },
378
379
  children: [
379
- f && /* @__PURE__ */ n.jsxs(
380
+ i && /* @__PURE__ */ a.jsxs(
380
381
  "div",
381
382
  {
382
- className: `flex ${h ? "flex-col items-start" : "justify-between"} text-sm`,
383
- style: { color: k },
383
+ className: `flex ${j ? "flex-col items-start" : "justify-between"} text-sm`,
384
+ style: { color: S },
384
385
  children: [
385
- /* @__PURE__ */ n.jsx("strong", { children: v }),
386
- /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 font-semibold", children: [
387
- /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center justify-center w-4 h-4", children: [
388
- /* @__PURE__ */ n.jsx(
386
+ /* @__PURE__ */ a.jsx("strong", { children: w }),
387
+ /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 font-semibold", children: [
388
+ /* @__PURE__ */ a.jsxs("div", { className: "relative flex items-center justify-center w-4 h-4", children: [
389
+ /* @__PURE__ */ a.jsx(
389
390
  "div",
390
391
  {
391
392
  className: "absolute inset-0 rounded-md rainbow-spin",
@@ -397,69 +398,70 @@ const oe = ({
397
398
  }
398
399
  }
399
400
  ),
400
- /* @__PURE__ */ n.jsx("div", { className: "relative flex items-center justify-center w-4 h-4 rounded-md p-[2px]", children: /* @__PURE__ */ n.jsx(
401
+ /* @__PURE__ */ a.jsx("div", { className: "relative flex items-center justify-center w-4 h-4 rounded-md p-[2px]", children: /* @__PURE__ */ a.jsx(
401
402
  "button",
402
403
  {
403
404
  type: "button",
404
405
  className: "flex items-center justify-center w-full h-full rounded-md border-2 border-transparent transition-colors duration-150",
405
406
  style: {
406
- "--border-fill-color": b,
407
- backgroundColor: s
407
+ "--border-fill-color": m,
408
+ backgroundColor: l
408
409
  }
409
410
  }
410
411
  ) })
411
412
  ] }),
412
- /* @__PURE__ */ n.jsx("span", { children: "Today" })
413
+ /* @__PURE__ */ a.jsx("span", { children: "Today" })
413
414
  ] }),
414
- /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 font-semibold", children: [
415
- /* @__PURE__ */ n.jsx(
415
+ /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 font-semibold", children: [
416
+ /* @__PURE__ */ a.jsx(
416
417
  "button",
417
418
  {
418
419
  type: "button",
419
- className: `flex items-center justify-center w-4 h-4 ${F} border-2 border-emerald-600 transition-colors duration-150`,
420
+ className: `flex items-center justify-center w-4 h-4 ${L} border-2 border-emerald-600 transition-colors duration-150`,
420
421
  style: {
421
422
  backgroundColor: c,
422
- borderColor: b
423
+ borderColor: m
423
424
  }
424
425
  }
425
426
  ),
426
- /* @__PURE__ */ n.jsx("span", { children: "Completed" })
427
+ /* @__PURE__ */ a.jsx("span", { children: "Completed" })
427
428
  ] })
428
429
  ]
429
430
  }
430
431
  ),
431
- /* @__PURE__ */ n.jsx("div", { className: "flex flex-col gap-1", children: A.map((u, l) => /* @__PURE__ */ n.jsx("div", { className: "flex gap-1", children: u.map((m) => {
432
- const y = m.dateObj.toLocaleDateString("en-US", {
432
+ /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-1", children: P.map((f, E) => /* @__PURE__ */ a.jsx("div", { className: "flex gap-1", children: f.map((p) => {
433
+ const t = p.dateObj.toLocaleDateString("en-US", {
433
434
  month: "long",
434
435
  day: "numeric",
435
436
  year: "numeric"
436
437
  });
437
- return /* @__PURE__ */ n.jsx(
438
+ return /* @__PURE__ */ a.jsx(
438
439
  "div",
439
440
  {
440
441
  className: "tooltip tooltip-top",
441
- "data-tip": y,
442
- children: /* @__PURE__ */ n.jsx(
442
+ "data-tip": t,
443
+ children: /* @__PURE__ */ a.jsx(
443
444
  oe,
444
445
  {
445
446
  fillingColor: c,
446
- borderfillColor: b,
447
- hoverborderColor: g,
448
- cellBorderColor: p,
449
- cellColor: s,
450
- isSelected: m.isSelected,
451
- day: y,
452
- cellShape: E
447
+ borderfillColor: m,
448
+ hoverborderColor: b,
449
+ cellBorderColor: v,
450
+ cellColor: l,
451
+ isSelected: p.isSelected,
452
+ day: t,
453
+ href: p.href,
454
+ cellShape: h
453
455
  }
454
456
  )
455
457
  },
456
- m.key
458
+ p.key
457
459
  );
458
- }) }, l)) })
460
+ }) }, E)) })
459
461
  ]
460
462
  }
461
463
  );
462
- }, ce = (c) => /* @__PURE__ */ n.jsx(se, { ...c });
464
+ }, ce = (c) => /* @__PURE__ */ a.jsx(se, { ...c });
463
465
  export {
464
466
  se as Calendar,
465
467
  ce as default
@@ -1,10 +1,10 @@
1
- (function(y,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(y=typeof globalThis<"u"?globalThis:y||self,h(y.FillCalendar={},y.React))})(this,(function(y,h){"use strict";var P={exports:{}},N={};var J;function re(){if(J)return N;J=1;var f=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function g(p,s,c){var i=null;if(c!==void 0&&(i=""+c),s.key!==void 0&&(i=""+s.key),"key"in s){c={};for(var x in s)x!=="key"&&(c[x]=s[x])}else c=s;return s=c.ref,{$$typeof:f,type:p,key:i,ref:s!==void 0?s:null,props:c}}return N.Fragment=b,N.jsx=g,N.jsxs=g,N}var O={};var V;function te(){return V||(V=1,process.env.NODE_ENV!=="production"&&(function(){function f(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===L?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case $:return"Profiler";case D:return"StrictMode";case m:return"Suspense";case E:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case M:return"Portal";case u:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case l:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case S:return r=e.displayName||null,r!==null?r:f(e.type)||"Memo";case d:r=e._payload,e=e._init;try{return f(e(r))}catch{}}return null}function b(e){return""+e}function g(e){try{b(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),b(e)}}function p(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===d)return"<...>";try{var r=f(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=U.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function i(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function x(e,r){function n(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function A(){var e=f(this.type);return Z[e]||(Z[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function _(e,r,n,a,F,q){var o=n.ref;return e={$$typeof:T,type:e,key:r,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:A}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function v(e,r,n,a,F,q){var o=r.children;if(o!==void 0)if(a)if(se(o)){for(a=0;a<o.length;a++)j(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(o);if(B.call(r,"key")){o=f(e);var k=Object.keys(r).filter(function(le){return le!=="key"});a=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",ee[o+a]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(j,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(j=typeof globalThis<"u"?globalThis:j||self,T(j.FillCalendar={},j.React))})(this,(function(j,T){"use strict";var M={exports:{}},Y={};var V;function re(){if(V)return Y;V=1;var f=Symbol.for("react.transitional.element"),m=Symbol.for("react.fragment");function b(h,l,i){var d=null;if(i!==void 0&&(d=""+i),l.key!==void 0&&(d=""+l.key),"key"in l){i={};for(var y in l)y!=="key"&&(i[y]=l[y])}else i=l;return l=i.ref,{$$typeof:f,type:h,key:d,ref:l!==void 0?l:null,props:i}}return Y.Fragment=m,Y.jsx=b,Y.jsxs=b,Y}var F={};var G;function te(){return G||(G=1,process.env.NODE_ENV!=="production"&&(function(){function f(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===S?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case D:return"Profiler";case p:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList";case x:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case P:return"Portal";case W:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case c:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case t:return r=e.displayName||null,r!==null?r:f(e.type)||"Memo";case u:r=e._payload,e=e._init;try{return f(e(r))}catch{}}return null}function m(e){return""+e}function b(e){try{m(e);var r=!1}catch{r=!0}if(r){r=console;var a=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),m(e)}}function h(e){if(e===C)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===u)return"<...>";try{var r=f(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function l(){var e=N.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function d(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function y(e,r){function a(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function O(){var e=f(this.type);return Z[e]||(Z[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function w(e,r,a,o,U,q){var s=a.ref;return e={$$typeof:_,type:e,key:r,props:a,_owner:o},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:O}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function k(e,r,a,o,U,q){var s=r.children;if(s!==void 0)if(o)if(se(s)){for(o=0;o<s.length;o++)v(s[o]);Object.freeze&&Object.freeze(s)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(s);if(L.call(r,"key")){s=f(e);var $=Object.keys(r).filter(function(le){return le!=="key"});o=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",ee[s+o]||($=0<$.length?"{"+$.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,a,o,k,o),ee[o+a]=!0)}if(o=null,n!==void 0&&(g(n),o=""+n),i(r)&&(g(r.key),o=""+r.key),"key"in r){n={};for(var z in r)z!=="key"&&(n[z]=r[z])}else n=r;return o&&x(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,o,n,s(),F,q)}function j(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===d&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}var R=h,T=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),U=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,se=Array.isArray,W=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var H,Z={},Q=R.react_stack_bottom_frame.bind(R,c)(),K=W(p(c)),ee={};O.Fragment=w,O.jsx=function(e,r,n){var a=1e4>U.recentlyCreatedOwnerStacks++;return v(e,r,n,!1,a?Error("react-stack-top-frame"):Q,a?W(p(e)):K)},O.jsxs=function(e,r,n){var a=1e4>U.recentlyCreatedOwnerStacks++;return v(e,r,n,!0,a?Error("react-stack-top-frame"):Q,a?W(p(e)):K)}})()),O}var G;function ne(){return G||(G=1,process.env.NODE_ENV==="production"?P.exports=re():P.exports=te()),P.exports}var t=ne();const ae=({fillingColor:f,borderfillColor:b,hoverborderColor:g,cellBorderColor:p,cellColor:s,day:c,isSelected:i=!1,cellShape:x})=>{const A=new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),_=x==="square"?"rounded-md":"rounded-full",v=c===A,j=`
6
+ <%s key={someKey} {...props} />`,o,s,$,s),ee[s+o]=!0)}if(s=null,a!==void 0&&(b(a),s=""+a),d(r)&&(b(r.key),s=""+r.key),"key"in r){a={};for(var J in r)J!=="key"&&(a[J]=r[J])}else a=r;return s&&y(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),w(e,s,a,l(),U,q)}function v(e){A(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===u&&(e._payload.status==="fulfilled"?A(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}var R=T,_=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),W=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),t=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),N=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,se=Array.isArray,z=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var H,Z={},Q=R.react_stack_bottom_frame.bind(R,i)(),K=z(h(i)),ee={};F.Fragment=C,F.jsx=function(e,r,a){var o=1e4>N.recentlyCreatedOwnerStacks++;return k(e,r,a,!1,o?Error("react-stack-top-frame"):Q,o?z(h(e)):K)},F.jsxs=function(e,r,a){var o=1e4>N.recentlyCreatedOwnerStacks++;return k(e,r,a,!0,o?Error("react-stack-top-frame"):Q,o?z(h(e)):K)}})()),F}var X;function ne(){return X||(X=1,process.env.NODE_ENV==="production"?M.exports=re():M.exports=te()),M.exports}var n=ne();const ae=({fillingColor:f,borderfillColor:m,hoverborderColor:b,cellBorderColor:h,cellColor:l,day:i,isSelected:d=!1,cellShape:y,href:O})=>{const w=new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),k=y==="square"?"rounded-md":"rounded-full",v=i===w,A=`
7
7
  flex items-center justify-center
8
- ${_} border-2 transition-colors duration-150 hover:scale-150
9
- ${!v&&!i&&g?"hover-border-var":""}
10
- `;return v?t.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[t.jsx("div",{className:"absolute inset-0 rounded-md rainbow-spin",style:{background:"conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",padding:"2px",boxShadow:"0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",borderRadius:"0.5rem"}}),t.jsx("div",{className:`relative flex items-center justify-center w-4 h-4 ${_} p-[2px]`,children:t.jsx("button",{type:"button",className:"today-cell-btn flex items-center justify-center w-full h-full rounded-md border-2 border-transparent transition-colors duration-150 hover:scale-150",style:{"--border-fill-color":i?b:p,backgroundColor:i?f:s}})})]}):t.jsx("button",{type:"button",className:`${j} w-4 h-4`,style:i&&!v?{backgroundColor:f,borderColor:b,"--hover-border-color":g}:v?void 0:{backgroundColor:s,"--border-color":p,"--hover-border-color":g}})},X=({fillingColor:f="#50C878",borderfillColor:b="#27592D",hoverborderColor:g="#FFCCCB",cellBorderColor:p="#808080",cellColor:s="#ADADAD",legend:c=!0,mainBorder:i=!0,borderColor:x="#708090",textColor:A="#708090",selectedDates:_=[],title:v="Calendar",cellShape:j="square",column:C=15,legendColumn:R=!1})=>{const T=new Date,M=h.useMemo(()=>{const u=l=>{if(!l)return"";if(typeof l=="string"){const m=l.split("-");if(m.length===3){const E=m[0],S=String(Number(m[1])).padStart(2,"0"),d=String(Number(m[2])).padStart(2,"0");return`${E}-${S}-${d}`}return l}return typeof l=="object"&&l.day?u(l.day):""};return new Set((_||[]).map(l=>u(l)).filter(Boolean))},[_]),w=h.useMemo(()=>{const u=T.getFullYear(),l=T.getMonth(),m=new Date(u,l-1,1),E=new Date(u,l+2,0),S=[],d=new Date(m);for(;d<=E;){const Y=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`,L=M.has(Y);S.push({key:Y,isSelected:L,dateObj:new Date(d)}),d.setDate(d.getDate()+1)}return S},[_,T]),D=[],$=C;for(let u=0;u<w.length;u+=$)D.push(w.slice(u,u+$));const I=j==="square"?"rounded-md":"rounded-full";return t.jsxs("div",{className:`inline-flex flex-col gap-2 p-3 rounded-xl ${i?"border shadow-sm":""} `,style:{borderColor:i?x:void 0},children:[c&&t.jsxs("div",{className:`flex ${R?"flex-col items-start":"justify-between"} text-sm`,style:{color:A},children:[t.jsx("strong",{children:v}),t.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[t.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[t.jsx("div",{className:"absolute inset-0 rounded-md rainbow-spin",style:{background:"conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",padding:"2px",boxShadow:"0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",borderRadius:"0.5rem"}}),t.jsx("div",{className:"relative flex items-center justify-center w-4 h-4 rounded-md p-[2px]",children:t.jsx("button",{type:"button",className:"flex items-center justify-center w-full h-full rounded-md border-2 border-transparent transition-colors duration-150",style:{"--border-fill-color":b,backgroundColor:s}})})]}),t.jsx("span",{children:"Today"})]}),t.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[t.jsx("button",{type:"button",className:`flex items-center justify-center w-4 h-4 ${I} border-2 border-emerald-600 transition-colors duration-150`,style:{backgroundColor:f,borderColor:b}}),t.jsx("span",{children:"Completed"})]})]}),t.jsx("div",{className:"flex flex-col gap-1",children:D.map((u,l)=>t.jsx("div",{className:"flex gap-1",children:u.map(m=>{const E=m.dateObj.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return t.jsx("div",{className:"tooltip tooltip-top","data-tip":E,children:t.jsx(ae,{fillingColor:f,borderfillColor:b,hoverborderColor:g,cellBorderColor:p,cellColor:s,isSelected:m.isSelected,day:E,cellShape:j})},m.key)})},l))})]})},oe=f=>t.jsx(X,{...f});y.Calendar=X,y.default=oe,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
8
+ ${k} border-2 transition-colors duration-150 hover:scale-150
9
+ ${!v&&!d&&b?"hover-border-var":""}
10
+ `,R=!!(O&&d),_=(p="",D)=>n.jsx("button",{type:"button",className:`${A} ${p}`,style:D}),P=p=>R?n.jsx("a",{href:O,className:"contents",children:p}):p;if(v){const p=n.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[n.jsx("div",{className:"absolute inset-0 rounded-md rainbow-spin",style:{background:"conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",padding:"2px",boxShadow:"0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",borderRadius:"0.5rem"}}),n.jsx("div",{className:`relative flex items-center justify-center w-4 h-4 ${k} p-[2px]`,children:_("today-cell-btn w-full h-full rounded-md border-transparent",{"--border-fill-color":d?m:h,backgroundColor:d?f:l})})]});return P(p)}return P(_("w-4 h-4",d&&!v?{backgroundColor:f,borderColor:m,"--hover-border-color":b}:v?void 0:{backgroundColor:l,"--border-color":h,"--hover-border-color":b}))},B=({fillingColor:f="#50C878",borderfillColor:m="#27592D",hoverborderColor:b="#FFCCCB",cellBorderColor:h="#808080",cellColor:l="#ADADAD",legend:i=!0,mainBorder:d=!0,borderColor:y="#708090",textColor:O="#708090",selectedDates:w=[],title:k="Calendar",cellShape:v="square",column:A=15,legendColumn:R=!1})=>{const _=new Date,{selectedSet:P,hrefMap:C}=T.useMemo(()=>{const c=t=>{if(!t)return"";if(typeof t=="string"){const u=t.split("-");if(u.length===3){const x=u[0],S=String(Number(u[1])).padStart(2,"0"),N=String(Number(u[2])).padStart(2,"0");return`${x}-${S}-${N}`}return t}return typeof t=="object"&&t.day?c(t.day):""},E=new Set,g=new Map;for(const t of w||[]){const u=t&&typeof t=="object"&&t.day?c(t.day):c(t);u&&(E.add(u),t&&typeof t=="object"&&t.href&&g.set(u,t.href))}return{selectedSet:E,hrefMap:g}},[w]),p=T.useMemo(()=>{const c=_.getFullYear(),E=_.getMonth(),g=new Date(c,E-1,1),t=new Date(c,E+2,0),u=[],x=new Date(g);for(;x<=t;){const S=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}-${String(x.getDate()).padStart(2,"0")}`,N=P.has(S),L=C.get(S);u.push({key:S,isSelected:N,href:L,dateObj:new Date(x)}),x.setDate(x.getDate()+1)}return u},[w,_]),D=[],I=A;for(let c=0;c<p.length;c+=I)D.push(p.slice(c,c+I));const W=v==="square"?"rounded-md":"rounded-full";return n.jsxs("div",{className:`inline-flex flex-col gap-2 p-3 rounded-xl ${d?"border shadow-sm":""} `,style:{borderColor:d?y:void 0},children:[i&&n.jsxs("div",{className:`flex ${R?"flex-col items-start":"justify-between"} text-sm`,style:{color:O},children:[n.jsx("strong",{children:k}),n.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[n.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[n.jsx("div",{className:"absolute inset-0 rounded-md rainbow-spin",style:{background:"conic-gradient(from 0deg, #ff0000 0deg, #ff4000 20deg, #ff8000 40deg, #ffbf00 60deg, #ffff00 80deg, #bfff00 100deg, #80ff00 120deg, #40ff00 140deg, #00ff00 160deg, #00ff40 180deg, #00ff80 200deg, #00ffbf 220deg, #00ffff 240deg, #00bfff 260deg, #0080ff 280deg, #0040ff 300deg, #0000ff 320deg, #4000ff 340deg, #8000ff 360deg)",padding:"2px",boxShadow:"0 0 8px rgba(255,0,255,0.35), 0 0 14px rgba(0,255,255,0.25)",borderRadius:"0.5rem"}}),n.jsx("div",{className:"relative flex items-center justify-center w-4 h-4 rounded-md p-[2px]",children:n.jsx("button",{type:"button",className:"flex items-center justify-center w-full h-full rounded-md border-2 border-transparent transition-colors duration-150",style:{"--border-fill-color":m,backgroundColor:l}})})]}),n.jsx("span",{children:"Today"})]}),n.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[n.jsx("button",{type:"button",className:`flex items-center justify-center w-4 h-4 ${W} border-2 border-emerald-600 transition-colors duration-150`,style:{backgroundColor:f,borderColor:m}}),n.jsx("span",{children:"Completed"})]})]}),n.jsx("div",{className:"flex flex-col gap-1",children:D.map((c,E)=>n.jsx("div",{className:"flex gap-1",children:c.map(g=>{const t=g.dateObj.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return n.jsx("div",{className:"tooltip tooltip-top","data-tip":t,children:n.jsx(ae,{fillingColor:f,borderfillColor:m,hoverborderColor:b,cellBorderColor:h,cellColor:l,isSelected:g.isSelected,day:t,href:g.href,cellShape:v})},g.key)})},E))})]})},oe=f=>n.jsx(B,{...f});j.Calendar=B,j.default=oe,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
 
3
- export type CalendarSelectedDate = string | { day: string };
3
+ export type CalendarSelectedDate = string | { day: string; href?: string };
4
4
 
5
5
  export interface CalendarProps {
6
6
  fillingColor?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-fill-calendar",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Fill dates on a calendar displaying boxes for dates. Customize colors and borders. Perfect for habit tracking or event marking in React applications.",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -14,6 +14,7 @@ A lightweight, customizable React calendar component that automatically fills an
14
14
  - Built with React
15
15
  - Easily styled with TailwindCSS + DaisyUI
16
16
  - Ideal for dashboards, planners, journals, and scheduling tools
17
+ - Added hrefs to selected dates by passing href key shown in example
17
18
 
18
19
  ---
19
20
 
@@ -31,7 +32,6 @@ A lightweight, customizable React calendar component that automatically fills an
31
32
  </div>
32
33
 
33
34
 
34
-
35
35
  ```
36
36
  import Calendar from 'react-fill-calendar'
37
37
 
@@ -51,6 +51,7 @@ A lightweight, customizable React calendar component that automatically fills an
51
51
  selectedDates = [
52
52
  {
53
53
  day: '2026-1-13',
54
+ href: '/habit/1234565',
54
55
  },
55
56
  {
56
57
  day: '2026-1-15',