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 +246 -244
- package/dist/index.umd.cjs +5 -5
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +2 -1
package/dist/index.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
import re, { useMemo as B } from "react";
|
|
2
|
+
var I = { exports: {} }, $ = {};
|
|
3
|
+
var H;
|
|
4
4
|
function te() {
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
var c = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
for (var
|
|
13
|
-
|
|
14
|
-
} else
|
|
15
|
-
return
|
|
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:
|
|
18
|
-
key:
|
|
19
|
-
ref:
|
|
20
|
-
props:
|
|
17
|
+
type: v,
|
|
18
|
+
key: d,
|
|
19
|
+
ref: l !== void 0 ? l : null,
|
|
20
|
+
props: i
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return $.Fragment = m, $.jsx = b, $.jsxs = b, $;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var D = {};
|
|
26
|
+
var Z;
|
|
27
27
|
function ne() {
|
|
28
|
-
return
|
|
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 ===
|
|
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
|
|
35
|
+
case A:
|
|
36
36
|
return "Fragment";
|
|
37
37
|
case P:
|
|
38
38
|
return "Profiler";
|
|
39
|
-
case
|
|
39
|
+
case g:
|
|
40
40
|
return "StrictMode";
|
|
41
|
-
case
|
|
41
|
+
case E:
|
|
42
42
|
return "Suspense";
|
|
43
|
-
case
|
|
43
|
+
case p:
|
|
44
44
|
return "SuspenseList";
|
|
45
|
-
case
|
|
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
|
|
52
|
+
case O:
|
|
53
53
|
return "Portal";
|
|
54
|
-
case
|
|
54
|
+
case L:
|
|
55
55
|
return e.displayName || "Context";
|
|
56
|
-
case
|
|
56
|
+
case Y:
|
|
57
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
-
case
|
|
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
|
|
61
|
+
case t:
|
|
62
62
|
return r = e.displayName || null, r !== null ? r : c(e.type) || "Memo";
|
|
63
|
-
case
|
|
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
|
|
72
|
+
function m(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function b(e) {
|
|
76
76
|
try {
|
|
77
|
-
|
|
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
|
|
85
|
-
return
|
|
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
|
-
|
|
89
|
-
),
|
|
88
|
+
o
|
|
89
|
+
), m(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
if (e ===
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
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
|
|
104
|
-
var e =
|
|
103
|
+
function l() {
|
|
104
|
+
var e = k.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function i() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
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
|
|
118
|
-
function
|
|
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
|
-
|
|
125
|
-
get:
|
|
124
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: n,
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
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
|
|
136
|
-
var
|
|
135
|
+
function R(e, r, n, o, M, q) {
|
|
136
|
+
var s = n.ref;
|
|
137
137
|
return e = {
|
|
138
|
-
$$typeof:
|
|
138
|
+
$$typeof: _,
|
|
139
139
|
type: e,
|
|
140
140
|
key: r,
|
|
141
|
-
props:
|
|
142
|
-
_owner:
|
|
143
|
-
}, (
|
|
141
|
+
props: n,
|
|
142
|
+
_owner: o
|
|
143
|
+
}, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
|
-
get:
|
|
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:
|
|
165
|
+
value: q
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (K(
|
|
173
|
-
for (
|
|
174
|
-
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
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
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
s,
|
|
195
|
+
C,
|
|
196
|
+
s
|
|
197
|
+
), X[s + o] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
for (var
|
|
202
|
-
|
|
203
|
-
} else
|
|
204
|
-
return
|
|
205
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
s,
|
|
210
|
+
n,
|
|
211
|
+
l(),
|
|
212
|
+
M,
|
|
213
|
+
q
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
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
|
|
220
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function N(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
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
|
-
|
|
225
|
+
j = {
|
|
226
226
|
react_stack_bottom_frame: function(e) {
|
|
227
227
|
return e();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var z, J = {}, V =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
)(), G =
|
|
234
|
-
|
|
235
|
-
var
|
|
236
|
-
return
|
|
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
|
-
|
|
239
|
+
n,
|
|
240
240
|
!1,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
o ? Error("react-stack-top-frame") : V,
|
|
242
|
+
o ? U(v(e)) : G
|
|
243
243
|
);
|
|
244
|
-
},
|
|
245
|
-
var
|
|
246
|
-
return
|
|
244
|
+
}, D.jsxs = function(e, r, n) {
|
|
245
|
+
var o = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return w(
|
|
247
247
|
e,
|
|
248
248
|
r,
|
|
249
|
-
|
|
249
|
+
n,
|
|
250
250
|
!0,
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
o ? Error("react-stack-top-frame") : V,
|
|
252
|
+
o ? U(v(e)) : G
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
|
-
})()),
|
|
255
|
+
})()), D;
|
|
256
256
|
}
|
|
257
|
-
var
|
|
257
|
+
var Q;
|
|
258
258
|
function ae() {
|
|
259
|
-
return
|
|
259
|
+
return Q || (Q = 1, process.env.NODE_ENV === "production" ? I.exports = te() : I.exports = ne()), I.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var a = ae();
|
|
262
262
|
const oe = ({
|
|
263
263
|
fillingColor: c,
|
|
264
|
-
borderfillColor:
|
|
265
|
-
hoverborderColor:
|
|
266
|
-
cellBorderColor:
|
|
267
|
-
cellColor:
|
|
268
|
-
day:
|
|
269
|
-
isSelected:
|
|
270
|
-
cellShape:
|
|
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
|
|
273
|
+
const R = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
273
274
|
month: "long",
|
|
274
275
|
day: "numeric",
|
|
275
276
|
year: "numeric"
|
|
276
|
-
}),
|
|
277
|
+
}), w = y === "square" ? "rounded-md" : "rounded-full", h = i === R, N = `
|
|
277
278
|
flex items-center justify-center
|
|
278
|
-
${
|
|
279
|
-
${!
|
|
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: `${
|
|
310
|
-
style:
|
|
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:
|
|
324
|
-
hoverborderColor:
|
|
325
|
-
cellBorderColor:
|
|
326
|
-
cellColor:
|
|
327
|
-
legend:
|
|
328
|
-
mainBorder:
|
|
329
|
-
borderColor:
|
|
330
|
-
textColor:
|
|
331
|
-
selectedDates:
|
|
332
|
-
title:
|
|
333
|
-
cellShape:
|
|
334
|
-
column:
|
|
335
|
-
legendColumn:
|
|
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
|
|
338
|
-
const
|
|
339
|
-
if (!
|
|
340
|
-
if (typeof
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
343
|
-
const
|
|
344
|
-
return `${
|
|
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
|
|
344
|
+
return t;
|
|
347
345
|
}
|
|
348
|
-
return typeof
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
).padStart(2, "0")}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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(
|
|
364
|
-
}),
|
|
364
|
+
dateObj: new Date(x)
|
|
365
|
+
}), x.setDate(x.getDate() + 1);
|
|
365
366
|
}
|
|
366
|
-
return
|
|
367
|
-
}, [
|
|
368
|
-
for (let
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
return /* @__PURE__ */
|
|
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 ${
|
|
375
|
+
className: `inline-flex flex-col gap-2 p-3 rounded-xl ${d ? "border shadow-sm" : ""} `,
|
|
375
376
|
style: {
|
|
376
|
-
borderColor:
|
|
377
|
+
borderColor: d ? y : void 0
|
|
377
378
|
},
|
|
378
379
|
children: [
|
|
379
|
-
|
|
380
|
+
i && /* @__PURE__ */ a.jsxs(
|
|
380
381
|
"div",
|
|
381
382
|
{
|
|
382
|
-
className: `flex ${
|
|
383
|
-
style: { color:
|
|
383
|
+
className: `flex ${j ? "flex-col items-start" : "justify-between"} text-sm`,
|
|
384
|
+
style: { color: S },
|
|
384
385
|
children: [
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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":
|
|
407
|
-
backgroundColor:
|
|
407
|
+
"--border-fill-color": m,
|
|
408
|
+
backgroundColor: l
|
|
408
409
|
}
|
|
409
410
|
}
|
|
410
411
|
) })
|
|
411
412
|
] }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ a.jsx("span", { children: "Today" })
|
|
413
414
|
] }),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
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 ${
|
|
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:
|
|
423
|
+
borderColor: m
|
|
423
424
|
}
|
|
424
425
|
}
|
|
425
426
|
),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ a.jsx("span", { children: "Completed" })
|
|
427
428
|
] })
|
|
428
429
|
]
|
|
429
430
|
}
|
|
430
431
|
),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
const
|
|
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__ */
|
|
438
|
+
return /* @__PURE__ */ a.jsx(
|
|
438
439
|
"div",
|
|
439
440
|
{
|
|
440
441
|
className: "tooltip tooltip-top",
|
|
441
|
-
"data-tip":
|
|
442
|
-
children: /* @__PURE__ */
|
|
442
|
+
"data-tip": t,
|
|
443
|
+
children: /* @__PURE__ */ a.jsx(
|
|
443
444
|
oe,
|
|
444
445
|
{
|
|
445
446
|
fillingColor: c,
|
|
446
|
-
borderfillColor:
|
|
447
|
-
hoverborderColor:
|
|
448
|
-
cellBorderColor:
|
|
449
|
-
cellColor:
|
|
450
|
-
isSelected:
|
|
451
|
-
day:
|
|
452
|
-
|
|
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
|
-
|
|
458
|
+
p.key
|
|
457
459
|
);
|
|
458
|
-
}) },
|
|
460
|
+
}) }, E)) })
|
|
459
461
|
]
|
|
460
462
|
}
|
|
461
463
|
);
|
|
462
|
-
}, ce = (c) => /* @__PURE__ */
|
|
464
|
+
}, ce = (c) => /* @__PURE__ */ a.jsx(se, { ...c });
|
|
463
465
|
export {
|
|
464
466
|
se as Calendar,
|
|
465
467
|
ce as default
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(
|
|
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} />`,
|
|
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
|
-
${
|
|
9
|
-
${!v&&!
|
|
10
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-fill-calendar",
|
|
3
|
-
"version": "0.1.
|
|
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',
|