@theengineerguy/chronos-picker 1.0.6 → 1.0.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.esm.js +296 -288
- package/dist/index.js +1 -1
- package/dist/src/components/DateTimePicker.d.ts.map +1 -1
- package/dist/src/constants/holidays.d.ts +8 -0
- package/dist/src/constants/holidays.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +14 -1
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,43 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as j, useState as $, useEffect as G, useRef as Q, useCallback as H } from "react";
|
|
3
3
|
import { DateTime as w } from "luxon";
|
|
4
|
-
const
|
|
4
|
+
const pe = "Asia/Kolkata", ye = [
|
|
5
|
+
// --- 2026 National Holidays (India) ---
|
|
6
|
+
{ date: "2026-01-26", name: "Republic Day", type: "national" },
|
|
7
|
+
{ date: "2026-03-19", name: "Holi", type: "national" },
|
|
8
|
+
// Tentative
|
|
9
|
+
{ date: "2026-04-14", name: "Dr. Ambedkar Jayanti", type: "national" },
|
|
10
|
+
{ date: "2026-08-15", name: "Independence Day", type: "national" },
|
|
11
|
+
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "national" },
|
|
12
|
+
{ date: "2026-10-20", name: "Dussehra", type: "national" },
|
|
13
|
+
// Tentative
|
|
14
|
+
{ date: "2026-11-08", name: "Diwali", type: "national" },
|
|
15
|
+
// Tentative
|
|
16
|
+
{ date: "2026-12-25", name: "Christmas", type: "national" }
|
|
17
|
+
], Me = [
|
|
18
|
+
// Republic Day Weekend (Jan 24-26)
|
|
19
|
+
{ date: "2026-01-24", name: "Long Weekend: Trip to Jaipur?", type: "long-weekend" },
|
|
20
|
+
{ date: "2026-01-25", name: "Long Weekend: Fort Visit", type: "long-weekend" },
|
|
21
|
+
{ date: "2026-01-26", name: "Republic Day", type: "long-weekend" },
|
|
22
|
+
// Holi Weekend (Mar 19-22 - Take Friday off)
|
|
23
|
+
{ date: "2026-03-19", name: "Holi Celebration", type: "long-weekend" },
|
|
24
|
+
{ date: "2026-03-20", name: "Take a leave! Beach time?", type: "long-weekend" },
|
|
25
|
+
{ date: "2026-03-21", name: "Relaxing Saturday", type: "long-weekend" },
|
|
26
|
+
{ date: "2026-03-22", name: "Lazy Sunday", type: "long-weekend" },
|
|
27
|
+
// Independence Day Weekend (Aug 15-17)
|
|
28
|
+
{ date: "2026-08-15", name: "Independence Day", type: "long-weekend" },
|
|
29
|
+
{ date: "2026-08-16", name: "Sunday Brunch", type: "long-weekend" },
|
|
30
|
+
{ date: "2026-08-17", name: "Take a leave? Hills calling!", type: "long-weekend" },
|
|
31
|
+
// Monday leave suggestion
|
|
32
|
+
// Diwali Weekend (Nov 7-9)
|
|
33
|
+
{ date: "2026-11-07", name: "Choti Diwali", type: "long-weekend" },
|
|
34
|
+
{ date: "2026-11-08", name: "Diwali", type: "long-weekend" },
|
|
35
|
+
{ date: "2026-11-09", name: "Govardhan Puja (Take leave)", type: "long-weekend" }
|
|
36
|
+
];
|
|
37
|
+
function be(e) {
|
|
38
|
+
return e === pe ? [...ye, ...Me] : [];
|
|
39
|
+
}
|
|
40
|
+
const ke = "Asia/Kolkata", X = [
|
|
5
41
|
{ value: "Asia/Kolkata", label: "India (IST)" },
|
|
6
42
|
{ value: "America/New_York", label: "Eastern Time (ET)" },
|
|
7
43
|
{ value: "America/Chicago", label: "Central Time (CT)" },
|
|
@@ -15,57 +51,57 @@ const me = "Asia/Kolkata", X = [
|
|
|
15
51
|
{ value: "Australia/Sydney", label: "Sydney (AEDT)" },
|
|
16
52
|
{ value: "UTC", label: "UTC" }
|
|
17
53
|
];
|
|
18
|
-
function
|
|
54
|
+
function _(e, i) {
|
|
19
55
|
return w.isDateTime(e) ? e.setZone(i) : typeof e == "string" ? w.fromISO(e, { zone: i }) : w.fromJSDate(e, { zone: i });
|
|
20
56
|
}
|
|
21
|
-
function
|
|
57
|
+
function U(e) {
|
|
22
58
|
return w.now().setZone(e);
|
|
23
59
|
}
|
|
24
|
-
function
|
|
25
|
-
const s = w.now().setZone(e).offset,
|
|
26
|
-
return `UTC${s >= 0 ? "+" : "-"}${
|
|
60
|
+
function V(e) {
|
|
61
|
+
const s = w.now().setZone(e).offset, r = Math.floor(Math.abs(s) / 60), l = Math.abs(s) % 60;
|
|
62
|
+
return `UTC${s >= 0 ? "+" : "-"}${r}${l > 0 ? `:${l.toString().padStart(2, "0")}` : ""}`;
|
|
27
63
|
}
|
|
28
|
-
function
|
|
64
|
+
function ve(e, i, s, r, l, k, c, y, v) {
|
|
29
65
|
const M = w.fromObject(
|
|
30
66
|
{ year: e, month: i, day: 1 },
|
|
31
67
|
{ zone: s }
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
w.isDateTime(
|
|
68
|
+
), E = M.startOf("week"), R = M.endOf("month").endOf("week"), P = w.now().setZone(s).startOf("day"), L = c != null && y != null, A = c == null ? void 0 : c.startOf("day"), C = y == null ? void 0 : y.endOf("day"), n = /* @__PURE__ */ new Map();
|
|
69
|
+
v && v.forEach((N) => {
|
|
70
|
+
let d;
|
|
71
|
+
w.isDateTime(N.date) ? d = N.date.setZone(s) : typeof N.date == "string" ? d = w.fromISO(N.date, { zone: s }) : d = w.fromJSDate(N.date, { zone: s }), n.set(d.toISODate() || "", { name: N.name, type: N.type || "national" });
|
|
36
72
|
});
|
|
37
73
|
const u = [];
|
|
38
|
-
let
|
|
39
|
-
for (;
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
const K = n.get(
|
|
46
|
-
|
|
47
|
-
date:
|
|
48
|
-
isCurrentMonth:
|
|
49
|
-
isToday:
|
|
50
|
-
isSelected:
|
|
51
|
-
isDisabled:
|
|
52
|
-
isInRange:
|
|
53
|
-
isRangeStart:
|
|
74
|
+
let x = [], b = E;
|
|
75
|
+
for (; b <= R; ) {
|
|
76
|
+
const N = b.month === i, d = b.hasSame(P, "day"), o = b.startOf("day"), f = b.toISODate() || "";
|
|
77
|
+
let t = !1, D = !1, g = !1, W = !1;
|
|
78
|
+
L && A && C ? (g = o.hasSame(A, "day"), W = o.hasSame(C, "day"), D = o >= A && o <= C || g || W, t = g || W) : r && (t = b.hasSame(r, "day"));
|
|
79
|
+
let S = !1;
|
|
80
|
+
l && b < l.startOf("day") && (S = !0), k && b > k.endOf("day") && (S = !0);
|
|
81
|
+
const K = n.get(f);
|
|
82
|
+
x.push({
|
|
83
|
+
date: b,
|
|
84
|
+
isCurrentMonth: N,
|
|
85
|
+
isToday: d,
|
|
86
|
+
isSelected: t,
|
|
87
|
+
isDisabled: S,
|
|
88
|
+
isInRange: D,
|
|
89
|
+
isRangeStart: g,
|
|
54
90
|
isRangeEnd: W,
|
|
55
|
-
holiday: K ? { date:
|
|
56
|
-
}),
|
|
91
|
+
holiday: K ? { date: b, ...K } : void 0
|
|
92
|
+
}), x.length === 7 && (u.push(x), x = []), b = b.plus({ days: 1 });
|
|
57
93
|
}
|
|
58
94
|
return u;
|
|
59
95
|
}
|
|
60
|
-
function
|
|
96
|
+
function ge() {
|
|
61
97
|
const e = w.now().startOf("week"), i = [];
|
|
62
98
|
for (let s = 0; s < 7; s++) {
|
|
63
|
-
const
|
|
64
|
-
i.push(
|
|
99
|
+
const r = e.plus({ days: s });
|
|
100
|
+
i.push(r.toFormat("ccc"));
|
|
65
101
|
}
|
|
66
102
|
return i;
|
|
67
103
|
}
|
|
68
|
-
function
|
|
104
|
+
function Ne() {
|
|
69
105
|
const e = [];
|
|
70
106
|
for (let i = 1; i <= 12; i++) {
|
|
71
107
|
const s = w.fromObject({ month: i });
|
|
@@ -73,146 +109,146 @@ function ye() {
|
|
|
73
109
|
}
|
|
74
110
|
return e;
|
|
75
111
|
}
|
|
76
|
-
const
|
|
112
|
+
const Te = ({
|
|
77
113
|
viewDate: e,
|
|
78
114
|
selectedDate: i,
|
|
79
115
|
onDateSelect: s,
|
|
80
|
-
onViewDateChange:
|
|
81
|
-
timezone:
|
|
82
|
-
minDate:
|
|
83
|
-
maxDate:
|
|
116
|
+
onViewDateChange: r,
|
|
117
|
+
timezone: l,
|
|
118
|
+
minDate: k,
|
|
119
|
+
maxDate: c,
|
|
84
120
|
selectedStart: y,
|
|
85
|
-
selectedEnd:
|
|
121
|
+
selectedEnd: v,
|
|
86
122
|
onRangeSelect: M,
|
|
87
|
-
holidays:
|
|
123
|
+
holidays: E
|
|
88
124
|
}) => {
|
|
89
|
-
const
|
|
125
|
+
const z = M != null, R = j(() => ve(
|
|
90
126
|
e.year,
|
|
91
127
|
e.month,
|
|
92
|
-
|
|
128
|
+
l,
|
|
93
129
|
i ?? void 0,
|
|
94
|
-
|
|
95
|
-
|
|
130
|
+
k,
|
|
131
|
+
c,
|
|
96
132
|
y ?? void 0,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
), [e, i,
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
}, n = (
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
}, u = (
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
if (!
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
133
|
+
v ?? void 0,
|
|
134
|
+
E
|
|
135
|
+
), [e, i, l, k, c, y, v, E]), P = j(() => ge(), []), L = j(() => Ne(), []), A = () => {
|
|
136
|
+
r(e.minus({ months: 1 }));
|
|
137
|
+
}, C = () => {
|
|
138
|
+
r(e.plus({ months: 1 }));
|
|
139
|
+
}, n = (o) => {
|
|
140
|
+
const f = parseInt(o.target.value, 10);
|
|
141
|
+
r(e.set({ month: f }));
|
|
142
|
+
}, u = (o) => {
|
|
143
|
+
const f = parseInt(o.target.value, 10);
|
|
144
|
+
r(e.set({ year: f }));
|
|
145
|
+
}, x = (o, f) => {
|
|
146
|
+
if (!f)
|
|
147
|
+
if (z && M) {
|
|
148
|
+
const t = o.startOf("day");
|
|
113
149
|
if (y == null)
|
|
114
|
-
M(
|
|
115
|
-
else if (
|
|
116
|
-
const
|
|
117
|
-
|
|
150
|
+
M(o, o);
|
|
151
|
+
else if (v != null && y.hasSame(v, "day")) {
|
|
152
|
+
const D = y.startOf("day");
|
|
153
|
+
t < D ? M(o, y) : M(y, o);
|
|
118
154
|
} else
|
|
119
|
-
M(
|
|
155
|
+
M(o, o);
|
|
120
156
|
} else
|
|
121
|
-
s(
|
|
122
|
-
},
|
|
123
|
-
(
|
|
124
|
-
},
|
|
157
|
+
s(o);
|
|
158
|
+
}, b = (o, f, t) => {
|
|
159
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), x(f, t));
|
|
160
|
+
}, N = e.year, d = Array.from({ length: 21 }, (o, f) => N - 10 + f);
|
|
125
161
|
return /* @__PURE__ */ h("div", { className: "chronos-calendar", role: "region", "aria-label": "Calendar", children: [
|
|
126
162
|
/* @__PURE__ */ h("div", { className: "chronos-calendar-header", children: [
|
|
127
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ a(
|
|
128
164
|
"button",
|
|
129
165
|
{
|
|
130
166
|
type: "button",
|
|
131
167
|
className: "chronos-nav-button",
|
|
132
|
-
onClick:
|
|
168
|
+
onClick: A,
|
|
133
169
|
"aria-label": "Previous month",
|
|
134
170
|
children: "‹"
|
|
135
171
|
}
|
|
136
172
|
),
|
|
137
173
|
/* @__PURE__ */ h("div", { className: "chronos-month-year-selectors", children: [
|
|
138
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ a(
|
|
139
175
|
"select",
|
|
140
176
|
{
|
|
141
177
|
className: "chronos-month-select",
|
|
142
178
|
value: e.month,
|
|
143
179
|
onChange: n,
|
|
144
180
|
"aria-label": "Select month",
|
|
145
|
-
children:
|
|
181
|
+
children: L.map((o, f) => /* @__PURE__ */ a("option", { value: f + 1, children: o }, f))
|
|
146
182
|
}
|
|
147
183
|
),
|
|
148
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ a(
|
|
149
185
|
"select",
|
|
150
186
|
{
|
|
151
187
|
className: "chronos-year-select",
|
|
152
188
|
value: e.year,
|
|
153
189
|
onChange: u,
|
|
154
190
|
"aria-label": "Select year",
|
|
155
|
-
children:
|
|
191
|
+
children: d.map((o) => /* @__PURE__ */ a("option", { value: o, children: o }, o))
|
|
156
192
|
}
|
|
157
193
|
)
|
|
158
194
|
] }),
|
|
159
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ a(
|
|
160
196
|
"button",
|
|
161
197
|
{
|
|
162
198
|
type: "button",
|
|
163
199
|
className: "chronos-nav-button",
|
|
164
|
-
onClick:
|
|
200
|
+
onClick: C,
|
|
165
201
|
"aria-label": "Next month",
|
|
166
202
|
children: "›"
|
|
167
203
|
}
|
|
168
204
|
)
|
|
169
205
|
] }),
|
|
170
206
|
/* @__PURE__ */ h("div", { className: "chronos-calendar-grid", children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
R.map((
|
|
207
|
+
/* @__PURE__ */ a("div", { className: "chronos-weekday-row", children: P.map((o) => /* @__PURE__ */ a("div", { className: "chronos-weekday", children: o }, o)) }),
|
|
208
|
+
R.map((o, f) => /* @__PURE__ */ a("div", { className: "chronos-week-row", children: o.map((t, D) => /* @__PURE__ */ h(
|
|
173
209
|
"button",
|
|
174
210
|
{
|
|
175
211
|
type: "button",
|
|
176
|
-
className: `chronos-day ${
|
|
177
|
-
onClick: () =>
|
|
178
|
-
onKeyDown: (
|
|
179
|
-
disabled:
|
|
180
|
-
"aria-label": `${
|
|
181
|
-
"aria-selected":
|
|
182
|
-
"aria-current":
|
|
183
|
-
title:
|
|
212
|
+
className: `chronos-day ${t.isSelected ? "selected" : ""} ${t.isToday ? "today" : ""} ${t.isCurrentMonth ? "" : "other-month"} ${t.isDisabled ? "disabled" : ""} ${t.isInRange ? "in-range" : ""} ${t.isRangeStart ? "range-start" : ""} ${t.isRangeEnd ? "range-end" : ""} ${t.holiday ? `holiday ${t.holiday.type}` : ""}`,
|
|
213
|
+
onClick: () => x(t.date, t.isDisabled),
|
|
214
|
+
onKeyDown: (g) => b(g, t.date, t.isDisabled),
|
|
215
|
+
disabled: t.isDisabled,
|
|
216
|
+
"aria-label": `${t.date.toFormat("MMMM d, yyyy")}${t.holiday ? `, ${t.holiday.name}` : ""}`,
|
|
217
|
+
"aria-selected": t.isSelected,
|
|
218
|
+
"aria-current": t.isToday ? "date" : void 0,
|
|
219
|
+
title: t.holiday ? t.holiday.name : void 0,
|
|
184
220
|
children: [
|
|
185
|
-
|
|
186
|
-
|
|
221
|
+
t.date.day,
|
|
222
|
+
t.holiday && /* @__PURE__ */ a("span", { className: "chronos-holiday-dot" })
|
|
187
223
|
]
|
|
188
224
|
},
|
|
189
|
-
|
|
190
|
-
)) },
|
|
225
|
+
D
|
|
226
|
+
)) }, f))
|
|
191
227
|
] })
|
|
192
228
|
] });
|
|
193
|
-
},
|
|
229
|
+
}, we = ({
|
|
194
230
|
value: e,
|
|
195
231
|
onChange: i,
|
|
196
232
|
use24Hour: s
|
|
197
233
|
}) => {
|
|
198
|
-
const [
|
|
234
|
+
const [r, l] = $((e == null ? void 0 : e.hour) ?? 12), [k, c] = $((e == null ? void 0 : e.minute) ?? 0), [y, v] = $(
|
|
199
235
|
e && e.hour >= 12 ? "PM" : "AM"
|
|
200
236
|
);
|
|
201
|
-
|
|
202
|
-
e && (
|
|
237
|
+
G(() => {
|
|
238
|
+
e && (l(e.hour), c(e.minute), v(e.hour >= 12 ? "PM" : "AM"));
|
|
203
239
|
}, [e]);
|
|
204
240
|
const M = (n) => {
|
|
205
|
-
|
|
241
|
+
l(n);
|
|
206
242
|
let u = n;
|
|
207
|
-
s || (y === "PM" && n !== 12 ? u = n + 12 : y === "AM" && n === 12 && (u = 0)), i(u,
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
},
|
|
243
|
+
s || (y === "PM" && n !== 12 ? u = n + 12 : y === "AM" && n === 12 && (u = 0)), i(u, k);
|
|
244
|
+
}, E = (n) => {
|
|
245
|
+
c(n), i(r, n);
|
|
246
|
+
}, z = () => {
|
|
211
247
|
const n = y === "AM" ? "PM" : "AM";
|
|
212
|
-
|
|
213
|
-
let u =
|
|
214
|
-
n === "PM" &&
|
|
215
|
-
}, R = s ?
|
|
248
|
+
v(n);
|
|
249
|
+
let u = r;
|
|
250
|
+
n === "PM" && r !== 12 ? u = r + 12 : n === "AM" && r === 12 ? u = 0 : n === "AM" && r > 12 && (u = r - 12), i(u, k);
|
|
251
|
+
}, R = s ? r : r % 12 || 12, P = s ? 23 : 12, L = s ? 0 : 1, A = Array.from({ length: P - L + 1 }, (n, u) => L + u), C = Array.from({ length: 60 }, (n, u) => u);
|
|
216
252
|
return /* @__PURE__ */ h("div", { className: "chronos-time-picker", role: "group", "aria-label": "Time picker", children: [
|
|
217
253
|
/* @__PURE__ */ h("div", { className: "chronos-time-header", children: [
|
|
218
254
|
/* @__PURE__ */ h(
|
|
@@ -225,17 +261,17 @@ const fe = ({
|
|
|
225
261
|
stroke: "currentColor",
|
|
226
262
|
strokeWidth: "2",
|
|
227
263
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
|
|
265
|
+
/* @__PURE__ */ a("polyline", { points: "12 6 12 12 16 14" })
|
|
230
266
|
]
|
|
231
267
|
}
|
|
232
268
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ a("span", { children: "Time" })
|
|
234
270
|
] }),
|
|
235
271
|
/* @__PURE__ */ h("div", { className: "chronos-time-controls", children: [
|
|
236
272
|
/* @__PURE__ */ h("div", { className: "chronos-time-input-group", children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ a("label", { htmlFor: "chronos-hour-select", className: "chronos-time-label", children: "Hour" }),
|
|
274
|
+
/* @__PURE__ */ a(
|
|
239
275
|
"select",
|
|
240
276
|
{
|
|
241
277
|
id: "chronos-hour-select",
|
|
@@ -243,45 +279,45 @@ const fe = ({
|
|
|
243
279
|
value: R,
|
|
244
280
|
onChange: (n) => M(parseInt(n.target.value, 10)),
|
|
245
281
|
"aria-label": "Select hour",
|
|
246
|
-
children:
|
|
282
|
+
children: A.map((n) => /* @__PURE__ */ a("option", { value: n, children: n.toString().padStart(2, "0") }, n))
|
|
247
283
|
}
|
|
248
284
|
)
|
|
249
285
|
] }),
|
|
250
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ a("span", { className: "chronos-time-separator", children: ":" }),
|
|
251
287
|
/* @__PURE__ */ h("div", { className: "chronos-time-input-group", children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ a("label", { htmlFor: "chronos-minute-select", className: "chronos-time-label", children: "Minute" }),
|
|
289
|
+
/* @__PURE__ */ a(
|
|
254
290
|
"select",
|
|
255
291
|
{
|
|
256
292
|
id: "chronos-minute-select",
|
|
257
293
|
className: "chronos-time-select",
|
|
258
|
-
value:
|
|
259
|
-
onChange: (n) =>
|
|
294
|
+
value: k,
|
|
295
|
+
onChange: (n) => E(parseInt(n.target.value, 10)),
|
|
260
296
|
"aria-label": "Select minute",
|
|
261
|
-
children:
|
|
297
|
+
children: C.map((n) => /* @__PURE__ */ a("option", { value: n, children: n.toString().padStart(2, "0") }, n))
|
|
262
298
|
}
|
|
263
299
|
)
|
|
264
300
|
] }),
|
|
265
|
-
!s && /* @__PURE__ */
|
|
301
|
+
!s && /* @__PURE__ */ a(
|
|
266
302
|
"button",
|
|
267
303
|
{
|
|
268
304
|
type: "button",
|
|
269
305
|
className: "chronos-period-toggle",
|
|
270
|
-
onClick:
|
|
306
|
+
onClick: z,
|
|
271
307
|
"aria-label": `Switch to ${y === "AM" ? "PM" : "AM"}`,
|
|
272
308
|
children: y
|
|
273
309
|
}
|
|
274
310
|
)
|
|
275
311
|
] })
|
|
276
312
|
] });
|
|
277
|
-
},
|
|
313
|
+
}, De = ({
|
|
278
314
|
value: e,
|
|
279
315
|
onChange: i
|
|
280
316
|
}) => {
|
|
281
|
-
const [s,
|
|
317
|
+
const [s, r] = $(!1), l = X.find((c) => c.value === e) || {
|
|
282
318
|
label: e
|
|
283
|
-
},
|
|
284
|
-
i(
|
|
319
|
+
}, k = (c) => {
|
|
320
|
+
i(c), r(!1);
|
|
285
321
|
};
|
|
286
322
|
return /* @__PURE__ */ h("div", { className: "chronos-timezone-selector", children: [
|
|
287
323
|
/* @__PURE__ */ h("div", { className: "chronos-timezone-header", children: [
|
|
@@ -295,26 +331,26 @@ const fe = ({
|
|
|
295
331
|
stroke: "currentColor",
|
|
296
332
|
strokeWidth: "2",
|
|
297
333
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
|
|
335
|
+
/* @__PURE__ */ a("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
336
|
+
/* @__PURE__ */ a("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
301
337
|
]
|
|
302
338
|
}
|
|
303
339
|
),
|
|
304
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ a("span", { children: "Timezone" })
|
|
305
341
|
] }),
|
|
306
342
|
/* @__PURE__ */ h(
|
|
307
343
|
"button",
|
|
308
344
|
{
|
|
309
345
|
type: "button",
|
|
310
346
|
className: "chronos-timezone-button",
|
|
311
|
-
onClick: () =>
|
|
347
|
+
onClick: () => r(!s),
|
|
312
348
|
"aria-expanded": s,
|
|
313
349
|
"aria-label": "Select timezone",
|
|
314
350
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ a("span", { className: "chronos-timezone-label", children: l.label }),
|
|
352
|
+
/* @__PURE__ */ a("span", { className: "chronos-timezone-offset", children: V(e) }),
|
|
353
|
+
/* @__PURE__ */ a(
|
|
318
354
|
"svg",
|
|
319
355
|
{
|
|
320
356
|
className: `chronos-chevron ${s ? "expanded" : ""}`,
|
|
@@ -323,30 +359,30 @@ const fe = ({
|
|
|
323
359
|
fill: "none",
|
|
324
360
|
stroke: "currentColor",
|
|
325
361
|
strokeWidth: "2",
|
|
326
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ a("polyline", { points: "6 9 12 15 18 9" })
|
|
327
363
|
}
|
|
328
364
|
)
|
|
329
365
|
]
|
|
330
366
|
}
|
|
331
367
|
),
|
|
332
|
-
s && /* @__PURE__ */
|
|
368
|
+
s && /* @__PURE__ */ a("div", { className: "chronos-timezone-list", role: "listbox", children: X.map((c) => /* @__PURE__ */ h(
|
|
333
369
|
"button",
|
|
334
370
|
{
|
|
335
371
|
type: "button",
|
|
336
|
-
className: `chronos-timezone-option ${
|
|
337
|
-
onClick: () =>
|
|
372
|
+
className: `chronos-timezone-option ${c.value === e ? "selected" : ""}`,
|
|
373
|
+
onClick: () => k(c.value),
|
|
338
374
|
role: "option",
|
|
339
|
-
"aria-selected":
|
|
375
|
+
"aria-selected": c.value === e,
|
|
340
376
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ a("span", { className: "chronos-timezone-option-label", children: c.label }),
|
|
378
|
+
/* @__PURE__ */ a("span", { className: "chronos-timezone-option-offset", children: V(c.value) })
|
|
343
379
|
]
|
|
344
380
|
},
|
|
345
|
-
|
|
381
|
+
c.value
|
|
346
382
|
)) })
|
|
347
383
|
] });
|
|
348
384
|
};
|
|
349
|
-
function
|
|
385
|
+
function ee(e, i, s) {
|
|
350
386
|
return {
|
|
351
387
|
iso: e.toISO() || "",
|
|
352
388
|
formatted: e.toFormat(`${i} ${s}`),
|
|
@@ -354,124 +390,126 @@ function V(e, i, s) {
|
|
|
354
390
|
dateTime: e
|
|
355
391
|
};
|
|
356
392
|
}
|
|
357
|
-
const
|
|
393
|
+
const $e = ({
|
|
358
394
|
value: e,
|
|
359
395
|
onChange: i,
|
|
360
|
-
timezone: s =
|
|
361
|
-
dateFormat:
|
|
362
|
-
timeFormat:
|
|
363
|
-
minDate:
|
|
364
|
-
maxDate:
|
|
396
|
+
timezone: s = ke,
|
|
397
|
+
dateFormat: r = "DD",
|
|
398
|
+
timeFormat: l = "HH:mm",
|
|
399
|
+
minDate: k,
|
|
400
|
+
maxDate: c,
|
|
365
401
|
placeholder: y = "Select date and time",
|
|
366
|
-
disabled:
|
|
402
|
+
disabled: v = !1,
|
|
367
403
|
showTime: M = !0,
|
|
368
|
-
use24Hour:
|
|
369
|
-
className:
|
|
404
|
+
use24Hour: E = !0,
|
|
405
|
+
className: z = "",
|
|
370
406
|
ariaLabel: R = "Date and time picker",
|
|
371
|
-
showTimezoneSelector:
|
|
372
|
-
theme:
|
|
373
|
-
orientation:
|
|
374
|
-
selectionMode:
|
|
407
|
+
showTimezoneSelector: P = !1,
|
|
408
|
+
theme: L = "light",
|
|
409
|
+
orientation: A = "portrait",
|
|
410
|
+
selectionMode: C = "single",
|
|
375
411
|
rangeValue: n,
|
|
376
412
|
onRangeChange: u,
|
|
377
|
-
holidays:
|
|
413
|
+
holidays: x,
|
|
414
|
+
customHolidays: b,
|
|
415
|
+
showHolidays: N = !0
|
|
378
416
|
}) => {
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
!
|
|
382
|
-
}, [e,
|
|
383
|
-
|
|
384
|
-
}, [
|
|
385
|
-
const
|
|
386
|
-
J.current && !J.current.contains(m.target) &&
|
|
417
|
+
const d = C === "range", [o, f] = $(!1), [t, D] = $(() => !d && e ? _(e, s) : null), [g, W] = $(() => d && (n != null && n.start) ? _(n.start, s) : null), [S, K] = $(() => d && (n != null && n.end) ? _(n.end, s) : null), [T, ne] = $(s), [te, B] = $(() => t || g || S || U(s)), J = Q(null), q = Q(null);
|
|
418
|
+
G(() => {
|
|
419
|
+
!d && e && D(_(e, T));
|
|
420
|
+
}, [e, T, d]), G(() => {
|
|
421
|
+
d && (n == null ? void 0 : n.start) != null && (n == null ? void 0 : n.end) != null && (W(_(n.start, T)), K(_(n.end, T)));
|
|
422
|
+
}, [d, n, T]), G(() => {
|
|
423
|
+
const p = (m) => {
|
|
424
|
+
J.current && !J.current.contains(m.target) && f(!1);
|
|
387
425
|
};
|
|
388
|
-
if (
|
|
389
|
-
return document.addEventListener("mousedown",
|
|
390
|
-
}, [
|
|
391
|
-
const
|
|
392
|
-
var
|
|
393
|
-
m.key === "Escape" &&
|
|
426
|
+
if (o)
|
|
427
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
428
|
+
}, [o]), G(() => {
|
|
429
|
+
const p = (m) => {
|
|
430
|
+
var O;
|
|
431
|
+
m.key === "Escape" && o && (f(!1), (O = q.current) == null || O.focus());
|
|
394
432
|
};
|
|
395
|
-
return document.addEventListener("keydown",
|
|
396
|
-
}, [
|
|
397
|
-
const
|
|
398
|
-
let m =
|
|
399
|
-
if (t && (m =
|
|
433
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
434
|
+
}, [o]);
|
|
435
|
+
const oe = H((p) => {
|
|
436
|
+
let m = p;
|
|
437
|
+
if (t && (m = p.set({
|
|
400
438
|
hour: t.hour,
|
|
401
439
|
minute: t.minute,
|
|
402
440
|
second: t.second
|
|
403
|
-
})),
|
|
404
|
-
const
|
|
441
|
+
})), D(m), B(m), M || f(!1), i) {
|
|
442
|
+
const O = {
|
|
405
443
|
iso: m.toISO() || "",
|
|
406
|
-
formatted: m.toFormat(`${
|
|
444
|
+
formatted: m.toFormat(`${r} ${l}`),
|
|
407
445
|
timestamp: m.toMillis(),
|
|
408
446
|
dateTime: m
|
|
409
447
|
};
|
|
410
|
-
i(
|
|
448
|
+
i(O);
|
|
411
449
|
}
|
|
412
|
-
}, [t, M, i,
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
const
|
|
416
|
-
iso:
|
|
417
|
-
formatted:
|
|
418
|
-
timestamp:
|
|
419
|
-
dateTime:
|
|
450
|
+
}, [t, M, i, r, l]), ae = H((p, m) => {
|
|
451
|
+
const I = (t || U(T)).set({ hour: p, minute: m, second: 0 });
|
|
452
|
+
if (D(I), i) {
|
|
453
|
+
const Z = {
|
|
454
|
+
iso: I.toISO() || "",
|
|
455
|
+
formatted: I.toFormat(`${r} ${l}`),
|
|
456
|
+
timestamp: I.toMillis(),
|
|
457
|
+
dateTime: I
|
|
420
458
|
};
|
|
421
|
-
i(
|
|
459
|
+
i(Z);
|
|
422
460
|
}
|
|
423
|
-
}, [t,
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
const
|
|
427
|
-
u({ start:
|
|
461
|
+
}, [t, T, i, r, l]), se = H((p, m) => {
|
|
462
|
+
const O = p.startOf("day"), I = m.startOf("day"), [Z, Y] = O <= I ? [O, I] : [I, O];
|
|
463
|
+
if (W(Z), K(Y), B(Z), u) {
|
|
464
|
+
const me = ee(Z, r, l), ue = ee(Y, r, l), fe = Math.max(0, Math.ceil(Y.diff(Z, "days").days));
|
|
465
|
+
u({ start: me, end: ue, nights: fe });
|
|
428
466
|
}
|
|
429
|
-
}, [u,
|
|
430
|
-
if (
|
|
431
|
-
const m = t.setZone(
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
467
|
+
}, [u, r, l]), ie = H((p) => {
|
|
468
|
+
if (ne(p), t) {
|
|
469
|
+
const m = t.setZone(p);
|
|
470
|
+
if (D(m), B(m), i) {
|
|
471
|
+
const O = {
|
|
434
472
|
iso: m.toISO() || "",
|
|
435
|
-
formatted: m.toFormat(`${
|
|
473
|
+
formatted: m.toFormat(`${r} ${l}`),
|
|
436
474
|
timestamp: m.toMillis(),
|
|
437
475
|
dateTime: m
|
|
438
476
|
};
|
|
439
|
-
i(
|
|
477
|
+
i(O);
|
|
440
478
|
}
|
|
441
479
|
} else
|
|
442
|
-
|
|
443
|
-
}, [t, i,
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
(
|
|
447
|
-
},
|
|
480
|
+
B(U(p));
|
|
481
|
+
}, [t, i, r, l]), F = () => {
|
|
482
|
+
v || f(!o);
|
|
483
|
+
}, re = (p) => {
|
|
484
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), F());
|
|
485
|
+
}, le = d ? g && S ? `${g.toFormat("d MMM yyyy")} – ${S.toFormat("d MMM yyyy")}` : "" : t ? t.toFormat(`${r} ${M ? l : ""}`) : "", ce = k ? _(k, T) : void 0, de = c ? _(c, T) : void 0, he = x !== void 0 ? x : N ? [...be(T), ...b ?? []] : b ?? [];
|
|
448
486
|
return /* @__PURE__ */ h(
|
|
449
487
|
"div",
|
|
450
488
|
{
|
|
451
489
|
ref: J,
|
|
452
|
-
className: `chronos-picker ${
|
|
453
|
-
"data-disabled":
|
|
454
|
-
"data-theme":
|
|
490
|
+
className: `chronos-picker ${z}`,
|
|
491
|
+
"data-disabled": v,
|
|
492
|
+
"data-theme": L,
|
|
455
493
|
children: [
|
|
456
494
|
/* @__PURE__ */ h(
|
|
457
495
|
"div",
|
|
458
496
|
{
|
|
459
497
|
className: "chronos-input-wrapper",
|
|
460
|
-
onClick:
|
|
498
|
+
onClick: F,
|
|
461
499
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ a(
|
|
463
501
|
"input",
|
|
464
502
|
{
|
|
465
|
-
ref:
|
|
503
|
+
ref: q,
|
|
466
504
|
type: "text",
|
|
467
505
|
className: "chronos-input",
|
|
468
|
-
value:
|
|
506
|
+
value: le,
|
|
469
507
|
placeholder: y,
|
|
470
508
|
readOnly: !0,
|
|
471
|
-
disabled:
|
|
472
|
-
onKeyDown:
|
|
509
|
+
disabled: v,
|
|
510
|
+
onKeyDown: re,
|
|
473
511
|
"aria-label": R,
|
|
474
|
-
"aria-expanded":
|
|
512
|
+
"aria-expanded": o,
|
|
475
513
|
"aria-haspopup": "dialog",
|
|
476
514
|
role: "combobox"
|
|
477
515
|
}
|
|
@@ -486,67 +524,67 @@ const Ne = ({
|
|
|
486
524
|
stroke: "currentColor",
|
|
487
525
|
strokeWidth: "2",
|
|
488
526
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ a("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
528
|
+
/* @__PURE__ */ a("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
529
|
+
/* @__PURE__ */ a("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
530
|
+
/* @__PURE__ */ a("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
493
531
|
]
|
|
494
532
|
}
|
|
495
533
|
)
|
|
496
534
|
]
|
|
497
535
|
}
|
|
498
536
|
),
|
|
499
|
-
|
|
537
|
+
o && /* @__PURE__ */ a(
|
|
500
538
|
"div",
|
|
501
539
|
{
|
|
502
540
|
className: "chronos-dropdown",
|
|
503
|
-
"data-orientation":
|
|
504
|
-
"data-range-mode":
|
|
541
|
+
"data-orientation": A,
|
|
542
|
+
"data-range-mode": d,
|
|
505
543
|
role: "dialog",
|
|
506
544
|
"aria-label": "Date and time picker dialog",
|
|
507
545
|
children: /* @__PURE__ */ h("div", { className: "chronos-dropdown-content", children: [
|
|
508
|
-
|
|
546
|
+
d && g && S && /* @__PURE__ */ h("div", { className: "chronos-range-summary", children: [
|
|
509
547
|
/* @__PURE__ */ h("div", { className: "chronos-range-nights", children: [
|
|
510
|
-
Math.max(0, Math.ceil(
|
|
548
|
+
Math.max(0, Math.ceil(S.diff(g, "days").days)),
|
|
511
549
|
" nights"
|
|
512
550
|
] }),
|
|
513
551
|
/* @__PURE__ */ h("div", { className: "chronos-range-dates", children: [
|
|
514
|
-
|
|
552
|
+
g.toFormat("d MMM yyyy"),
|
|
515
553
|
" – ",
|
|
516
|
-
|
|
554
|
+
S.toFormat("d MMM yyyy")
|
|
517
555
|
] })
|
|
518
556
|
] }),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
|
|
557
|
+
/* @__PURE__ */ a(
|
|
558
|
+
Te,
|
|
521
559
|
{
|
|
522
|
-
viewDate:
|
|
523
|
-
selectedDate:
|
|
524
|
-
onDateSelect:
|
|
525
|
-
onViewDateChange:
|
|
526
|
-
timezone:
|
|
527
|
-
minDate:
|
|
528
|
-
maxDate:
|
|
529
|
-
selectedStart:
|
|
530
|
-
selectedEnd:
|
|
531
|
-
onRangeSelect:
|
|
532
|
-
holidays:
|
|
560
|
+
viewDate: te,
|
|
561
|
+
selectedDate: d ? null : t,
|
|
562
|
+
onDateSelect: oe,
|
|
563
|
+
onViewDateChange: B,
|
|
564
|
+
timezone: T,
|
|
565
|
+
minDate: ce,
|
|
566
|
+
maxDate: de,
|
|
567
|
+
selectedStart: d ? g : void 0,
|
|
568
|
+
selectedEnd: d ? S : void 0,
|
|
569
|
+
onRangeSelect: d ? se : void 0,
|
|
570
|
+
holidays: he
|
|
533
571
|
}
|
|
534
572
|
),
|
|
535
|
-
!
|
|
536
|
-
M && /* @__PURE__ */
|
|
537
|
-
|
|
573
|
+
!d && (M || P) && /* @__PURE__ */ h("div", { className: "chronos-sidebar", children: [
|
|
574
|
+
M && /* @__PURE__ */ a(
|
|
575
|
+
we,
|
|
538
576
|
{
|
|
539
577
|
value: t,
|
|
540
|
-
onChange:
|
|
541
|
-
use24Hour:
|
|
542
|
-
timezone:
|
|
578
|
+
onChange: ae,
|
|
579
|
+
use24Hour: E,
|
|
580
|
+
timezone: T
|
|
543
581
|
}
|
|
544
582
|
),
|
|
545
|
-
|
|
546
|
-
|
|
583
|
+
P && /* @__PURE__ */ a(
|
|
584
|
+
De,
|
|
547
585
|
{
|
|
548
|
-
value:
|
|
549
|
-
onChange:
|
|
586
|
+
value: T,
|
|
587
|
+
onChange: ie
|
|
550
588
|
}
|
|
551
589
|
)
|
|
552
590
|
] })
|
|
@@ -556,45 +594,15 @@ const Ne = ({
|
|
|
556
594
|
]
|
|
557
595
|
}
|
|
558
596
|
);
|
|
559
|
-
}
|
|
560
|
-
// --- 2026 National Holidays (India) ---
|
|
561
|
-
{ date: "2026-01-26", name: "Republic Day", type: "national" },
|
|
562
|
-
{ date: "2026-03-19", name: "Holi", type: "national" },
|
|
563
|
-
// Tentative
|
|
564
|
-
{ date: "2026-04-14", name: "Dr. Ambedkar Jayanti", type: "national" },
|
|
565
|
-
{ date: "2026-08-15", name: "Independence Day", type: "national" },
|
|
566
|
-
{ date: "2026-10-02", name: "Gandhi Jayanti", type: "national" },
|
|
567
|
-
{ date: "2026-10-20", name: "Dussehra", type: "national" },
|
|
568
|
-
// Tentative
|
|
569
|
-
{ date: "2026-11-08", name: "Diwali", type: "national" },
|
|
570
|
-
// Tentative
|
|
571
|
-
{ date: "2026-12-25", name: "Christmas", type: "national" }
|
|
572
|
-
], we = [
|
|
573
|
-
// Republic Day Weekend (Jan 24-26)
|
|
574
|
-
{ date: "2026-01-24", name: "Long Weekend: Trip to Jaipur?", type: "long-weekend" },
|
|
575
|
-
{ date: "2026-01-25", name: "Long Weekend: Fort Visit", type: "long-weekend" },
|
|
576
|
-
{ date: "2026-01-26", name: "Republic Day", type: "long-weekend" },
|
|
577
|
-
// Holi Weekend (Mar 19-22 - Take Friday off)
|
|
578
|
-
{ date: "2026-03-19", name: "Holi Celebration", type: "long-weekend" },
|
|
579
|
-
{ date: "2026-03-20", name: "Take a leave! Beach time?", type: "long-weekend" },
|
|
580
|
-
{ date: "2026-03-21", name: "Relaxing Saturday", type: "long-weekend" },
|
|
581
|
-
{ date: "2026-03-22", name: "Lazy Sunday", type: "long-weekend" },
|
|
582
|
-
// Independence Day Weekend (Aug 15-17)
|
|
583
|
-
{ date: "2026-08-15", name: "Independence Day", type: "long-weekend" },
|
|
584
|
-
{ date: "2026-08-16", name: "Sunday Brunch", type: "long-weekend" },
|
|
585
|
-
{ date: "2026-08-17", name: "Take a leave? Hills calling!", type: "long-weekend" },
|
|
586
|
-
// Monday leave suggestion
|
|
587
|
-
// Diwali Weekend (Nov 7-9)
|
|
588
|
-
{ date: "2026-11-07", name: "Choti Diwali", type: "long-weekend" },
|
|
589
|
-
{ date: "2026-11-08", name: "Diwali", type: "long-weekend" },
|
|
590
|
-
{ date: "2026-11-09", name: "Govardhan Puja (Take leave)", type: "long-weekend" }
|
|
591
|
-
];
|
|
597
|
+
};
|
|
592
598
|
export {
|
|
593
599
|
X as COMMON_TIMEZONES,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
+
pe as DEFAULT_HOLIDAYS_TIMEZONE,
|
|
601
|
+
ke as DEFAULT_TIMEZONE,
|
|
602
|
+
$e as DateTimePicker,
|
|
603
|
+
ye as INDIAN_HOLIDAYS_2026,
|
|
604
|
+
Me as LONG_WEEKENDS_2026,
|
|
605
|
+
_ as convertToTimezone,
|
|
606
|
+
be as getDefaultHolidaysForTimezone,
|
|
607
|
+
U as nowInTimezone
|
|
600
608
|
};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(T,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("luxon")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","luxon"],e):(T=typeof globalThis<"u"?globalThis:T||self,e(T.ChronosPicker={},T.jsxRuntime,T.React,T.luxon))})(this,function(T,e,c,S){"use strict";const H="Asia/Kolkata",G=[{value:"Asia/Kolkata",label:"India (IST)"},{value:"America/New_York",label:"Eastern Time (ET)"},{value:"America/Chicago",label:"Central Time (CT)"},{value:"America/Denver",label:"Mountain Time (MT)"},{value:"America/Los_Angeles",label:"Pacific Time (PT)"},{value:"Europe/London",label:"London (GMT/BST)"},{value:"Europe/Paris",label:"Central Europe (CET)"},{value:"Asia/Dubai",label:"Dubai (GST)"},{value:"Asia/Singapore",label:"Singapore (SGT)"},{value:"Asia/Tokyo",label:"Tokyo (JST)"},{value:"Australia/Sydney",label:"Sydney (AEDT)"},{value:"UTC",label:"UTC"}];function O(n,l){return S.DateTime.isDateTime(n)?n.setZone(l):typeof n=="string"?S.DateTime.fromISO(n,{zone:l}):S.DateTime.fromJSDate(n,{zone:l})}function K(n){return S.DateTime.now().setZone(n)}function U(n){const a=S.DateTime.now().setZone(n).offset,r=Math.floor(Math.abs(a)/60),d=Math.abs(a)%60;return`UTC${a>=0?"+":"-"}${r}${d>0?`:${d.toString().padStart(2,"0")}`:""}`}function F(n,l,a,r,d,v,h,y,N){const b=S.DateTime.fromObject({year:n,month:l,day:1},{zone:a}),x=b.startOf("week"),L=b.endOf("month").endOf("week"),P=S.DateTime.now().setZone(a).startOf("day"),_=h!=null&&y!=null,E=h==null?void 0:h.startOf("day"),C=y==null?void 0:y.endOf("day"),t=new Map;N&&N.forEach(M=>{let D;S.DateTime.isDateTime(M.date)?D=M.date.setZone(a):typeof M.date=="string"?D=S.DateTime.fromISO(M.date,{zone:a}):D=S.DateTime.fromJSDate(M.date,{zone:a}),t.set(D.toISODate()||"",{name:M.name,type:M.type||"national"})});const m=[];let I=[],i=x;for(;i<=L;){const M=i.month===l,D=i.hasSame(P,"day"),o=i.startOf("day"),p=i.toISODate()||"";let s=!1,$=!1,g=!1,W=!1;_&&E&&C?(g=o.hasSame(E,"day"),W=o.hasSame(C,"day"),$=o>=E&&o<=C||g||W,s=g||W):r&&(s=i.hasSame(r,"day"));let k=!1;d&&i<d.startOf("day")&&(k=!0),v&&i>v.endOf("day")&&(k=!0);const B=t.get(p);I.push({date:i,isCurrentMonth:M,isToday:D,isSelected:s,isDisabled:k,isInRange:$,isRangeStart:g,isRangeEnd:W,holiday:B?{date:i,...B}:void 0}),I.length===7&&(m.push(I),I=[]),i=i.plus({days:1})}return m}function V(){const n=S.DateTime.now().startOf("week"),l=[];for(let a=0;a<7;a++){const r=n.plus({days:a});l.push(r.toFormat("ccc"))}return l}function R(){const n=[];for(let l=1;l<=12;l++){const a=S.DateTime.fromObject({month:l});n.push(a.toFormat("MMMM"))}return n}const ee=({viewDate:n,selectedDate:l,onDateSelect:a,onViewDateChange:r,timezone:d,minDate:v,maxDate:h,selectedStart:y,selectedEnd:N,onRangeSelect:b,holidays:x})=>{const z=b!=null,L=c.useMemo(()=>F(n.year,n.month,d,l??void 0,v,h,y??void 0,N??void 0,x),[n,l,d,v,h,y,N,x]),P=c.useMemo(()=>V(),[]),_=c.useMemo(()=>R(),[]),E=()=>{r(n.minus({months:1}))},C=()=>{r(n.plus({months:1}))},t=o=>{const p=parseInt(o.target.value,10);r(n.set({month:p}))},m=o=>{const p=parseInt(o.target.value,10);r(n.set({year:p}))},I=(o,p)=>{if(!p)if(z&&b){const s=o.startOf("day");if(y==null)b(o,o);else if(N!=null&&y.hasSame(N,"day")){const $=y.startOf("day");s<$?b(o,y):b(y,o)}else b(o,o)}else a(o)},i=(o,p,s)=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),I(p,s))},M=n.year,D=Array.from({length:21},(o,p)=>M-10+p);return e.jsxs("div",{className:"chronos-calendar",role:"region","aria-label":"Calendar",children:[e.jsxs("div",{className:"chronos-calendar-header",children:[e.jsx("button",{type:"button",className:"chronos-nav-button",onClick:E,"aria-label":"Previous month",children:"‹"}),e.jsxs("div",{className:"chronos-month-year-selectors",children:[e.jsx("select",{className:"chronos-month-select",value:n.month,onChange:t,"aria-label":"Select month",children:_.map((o,p)=>e.jsx("option",{value:p+1,children:o},p))}),e.jsx("select",{className:"chronos-year-select",value:n.year,onChange:m,"aria-label":"Select year",children:D.map(o=>e.jsx("option",{value:o,children:o},o))})]}),e.jsx("button",{type:"button",className:"chronos-nav-button",onClick:C,"aria-label":"Next month",children:"›"})]}),e.jsxs("div",{className:"chronos-calendar-grid",children:[e.jsx("div",{className:"chronos-weekday-row",children:P.map(o=>e.jsx("div",{className:"chronos-weekday",children:o},o))}),L.map((o,p)=>e.jsx("div",{className:"chronos-week-row",children:o.map((s,$)=>e.jsxs("button",{type:"button",className:`chronos-day ${s.isSelected?"selected":""} ${s.isToday?"today":""} ${s.isCurrentMonth?"":"other-month"} ${s.isDisabled?"disabled":""} ${s.isInRange?"in-range":""} ${s.isRangeStart?"range-start":""} ${s.isRangeEnd?"range-end":""} ${s.holiday?`holiday ${s.holiday.type}`:""}`,onClick:()=>I(s.date,s.isDisabled),onKeyDown:g=>i(g,s.date,s.isDisabled),disabled:s.isDisabled,"aria-label":`${s.date.toFormat("MMMM d, yyyy")}${s.holiday?`, ${s.holiday.name}`:""}`,"aria-selected":s.isSelected,"aria-current":s.isToday?"date":void 0,title:s.holiday?s.holiday.name:void 0,children:[s.date.day,s.holiday&&e.jsx("span",{className:"chronos-holiday-dot"})]},$))},p))]})]})},ne=({value:n,onChange:l,use24Hour:a})=>{const[r,d]=c.useState((n==null?void 0:n.hour)??12),[v,h]=c.useState((n==null?void 0:n.minute)??0),[y,N]=c.useState(n&&n.hour>=12?"PM":"AM");c.useEffect(()=>{n&&(d(n.hour),h(n.minute),N(n.hour>=12?"PM":"AM"))},[n]);const b=t=>{d(t);let m=t;a||(y==="PM"&&t!==12?m=t+12:y==="AM"&&t===12&&(m=0)),l(m,v)},x=t=>{h(t),l(r,t)},z=()=>{const t=y==="AM"?"PM":"AM";N(t);let m=r;t==="PM"&&r!==12?m=r+12:t==="AM"&&r===12?m=0:t==="AM"&&r>12&&(m=r-12),l(m,v)},L=a?r:r%12||12,P=a?23:12,_=a?0:1,E=Array.from({length:P-_+1},(t,m)=>_+m),C=Array.from({length:60},(t,m)=>m);return e.jsxs("div",{className:"chronos-time-picker",role:"group","aria-label":"Time picker",children:[e.jsxs("div",{className:"chronos-time-header",children:[e.jsxs("svg",{className:"chronos-clock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("span",{children:"Time"})]}),e.jsxs("div",{className:"chronos-time-controls",children:[e.jsxs("div",{className:"chronos-time-input-group",children:[e.jsx("label",{htmlFor:"chronos-hour-select",className:"chronos-time-label",children:"Hour"}),e.jsx("select",{id:"chronos-hour-select",className:"chronos-time-select",value:L,onChange:t=>b(parseInt(t.target.value,10)),"aria-label":"Select hour",children:E.map(t=>e.jsx("option",{value:t,children:t.toString().padStart(2,"0")},t))})]}),e.jsx("span",{className:"chronos-time-separator",children:":"}),e.jsxs("div",{className:"chronos-time-input-group",children:[e.jsx("label",{htmlFor:"chronos-minute-select",className:"chronos-time-label",children:"Minute"}),e.jsx("select",{id:"chronos-minute-select",className:"chronos-time-select",value:v,onChange:t=>x(parseInt(t.target.value,10)),"aria-label":"Select minute",children:C.map(t=>e.jsx("option",{value:t,children:t.toString().padStart(2,"0")},t))})]}),!a&&e.jsx("button",{type:"button",className:"chronos-period-toggle",onClick:z,"aria-label":`Switch to ${y==="AM"?"PM":"AM"}`,children:y})]})]})},te=({value:n,onChange:l})=>{const[a,r]=c.useState(!1),d=G.find(h=>h.value===n)||{label:n},v=h=>{l(h),r(!1)};return e.jsxs("div",{className:"chronos-timezone-selector",children:[e.jsxs("div",{className:"chronos-timezone-header",children:[e.jsxs("svg",{className:"chronos-globe-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),e.jsx("span",{children:"Timezone"})]}),e.jsxs("button",{type:"button",className:"chronos-timezone-button",onClick:()=>r(!a),"aria-expanded":a,"aria-label":"Select timezone",children:[e.jsx("span",{className:"chronos-timezone-label",children:d.label}),e.jsx("span",{className:"chronos-timezone-offset",children:U(n)}),e.jsx("svg",{className:`chronos-chevron ${a?"expanded":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),a&&e.jsx("div",{className:"chronos-timezone-list",role:"listbox",children:G.map(h=>e.jsxs("button",{type:"button",className:`chronos-timezone-option ${h.value===n?"selected":""}`,onClick:()=>v(h.value),role:"option","aria-selected":h.value===n,children:[e.jsx("span",{className:"chronos-timezone-option-label",children:h.label}),e.jsx("span",{className:"chronos-timezone-option-offset",children:U(h.value)})]},h.value))})]})};function q(n,l,a){return{iso:n.toISO()||"",formatted:n.toFormat(`${l} ${a}`),timestamp:n.toMillis(),dateTime:n}}const oe=({value:n,onChange:l,timezone:a=H,dateFormat:r="DD",timeFormat:d="HH:mm",minDate:v,maxDate:h,placeholder:y="Select date and time",disabled:N=!1,showTime:b=!0,use24Hour:x=!0,className:z="",ariaLabel:L="Date and time picker",showTimezoneSelector:P=!1,theme:_="light",orientation:E="portrait",selectionMode:C="single",rangeValue:t,onRangeChange:m,holidays:I})=>{const i=C==="range",[M,D]=c.useState(!1),[o,p]=c.useState(()=>!i&&n?O(n,a):null),[s,$]=c.useState(()=>i&&(t!=null&&t.start)?O(t.start,a):null),[g,W]=c.useState(()=>i&&(t!=null&&t.end)?O(t.end,a):null),[k,B]=c.useState(a),[le,j]=c.useState(()=>o||s||g||K(a)),J=c.useRef(null),Q=c.useRef(null);c.useEffect(()=>{!i&&n&&p(O(n,k))},[n,k,i]),c.useEffect(()=>{i&&(t==null?void 0:t.start)!=null&&(t==null?void 0:t.end)!=null&&($(O(t.start,k)),W(O(t.end,k)))},[i,t,k]),c.useEffect(()=>{const u=f=>{J.current&&!J.current.contains(f.target)&&D(!1)};if(M)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[M]),c.useEffect(()=>{const u=f=>{var w;f.key==="Escape"&&M&&(D(!1),(w=Q.current)==null||w.focus())};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[M]);const re=c.useCallback(u=>{let f=u;if(o&&(f=u.set({hour:o.hour,minute:o.minute,second:o.second})),p(f),j(f),b||D(!1),l){const w={iso:f.toISO()||"",formatted:f.toFormat(`${r} ${d}`),timestamp:f.toMillis(),dateTime:f};l(w)}},[o,b,l,r,d]),ie=c.useCallback((u,f)=>{const A=(o||K(k)).set({hour:u,minute:f,second:0});if(p(A),l){const Z={iso:A.toISO()||"",formatted:A.toFormat(`${r} ${d}`),timestamp:A.toMillis(),dateTime:A};l(Z)}},[o,k,l,r,d]),ce=c.useCallback((u,f)=>{const w=u.startOf("day"),A=f.startOf("day"),[Z,Y]=w<=A?[w,A]:[A,w];if($(Z),W(Y),j(Z),m){const ye=q(Z,r,d),ue=q(Y,r,d),Me=Math.max(0,Math.ceil(Y.diff(Z,"days").days));m({start:ye,end:ue,nights:Me})}},[m,r,d]),de=c.useCallback(u=>{if(B(u),o){const f=o.setZone(u);if(p(f),j(f),l){const w={iso:f.toISO()||"",formatted:f.toFormat(`${r} ${d}`),timestamp:f.toMillis(),dateTime:f};l(w)}}else j(K(u))},[o,l,r,d]),X=()=>{N||D(!M)},he=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),X())},fe=i?s&&g?`${s.toFormat("d MMM yyyy")} – ${g.toFormat("d MMM yyyy")}`:"":o?o.toFormat(`${r} ${b?d:""}`):"",me=v?O(v,k):void 0,pe=h?O(h,k):void 0;return e.jsxs("div",{ref:J,className:`chronos-picker ${z}`,"data-disabled":N,"data-theme":_,children:[e.jsxs("div",{className:"chronos-input-wrapper",onClick:X,children:[e.jsx("input",{ref:Q,type:"text",className:"chronos-input",value:fe,placeholder:y,readOnly:!0,disabled:N,onKeyDown:he,"aria-label":L,"aria-expanded":M,"aria-haspopup":"dialog",role:"combobox"}),e.jsxs("svg",{className:"chronos-calendar-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})]}),M&&e.jsx("div",{className:"chronos-dropdown","data-orientation":E,"data-range-mode":i,role:"dialog","aria-label":"Date and time picker dialog",children:e.jsxs("div",{className:"chronos-dropdown-content",children:[i&&s&&g&&e.jsxs("div",{className:"chronos-range-summary",children:[e.jsxs("div",{className:"chronos-range-nights",children:[Math.max(0,Math.ceil(g.diff(s,"days").days))," nights"]}),e.jsxs("div",{className:"chronos-range-dates",children:[s.toFormat("d MMM yyyy")," – ",g.toFormat("d MMM yyyy")]})]}),e.jsx(ee,{viewDate:le,selectedDate:i?null:o,onDateSelect:re,onViewDateChange:j,timezone:k,minDate:me,maxDate:pe,selectedStart:i?s:void 0,selectedEnd:i?g:void 0,onRangeSelect:i?ce:void 0,holidays:I}),!i&&(b||P)&&e.jsxs("div",{className:"chronos-sidebar",children:[b&&e.jsx(ne,{value:o,onChange:ie,use24Hour:x,timezone:k}),P&&e.jsx(te,{value:k,onChange:de})]})]})})]})},se=[{date:"2026-01-26",name:"Republic Day",type:"national"},{date:"2026-03-19",name:"Holi",type:"national"},{date:"2026-04-14",name:"Dr. Ambedkar Jayanti",type:"national"},{date:"2026-08-15",name:"Independence Day",type:"national"},{date:"2026-10-02",name:"Gandhi Jayanti",type:"national"},{date:"2026-10-20",name:"Dussehra",type:"national"},{date:"2026-11-08",name:"Diwali",type:"national"},{date:"2026-12-25",name:"Christmas",type:"national"}],ae=[{date:"2026-01-24",name:"Long Weekend: Trip to Jaipur?",type:"long-weekend"},{date:"2026-01-25",name:"Long Weekend: Fort Visit",type:"long-weekend"},{date:"2026-01-26",name:"Republic Day",type:"long-weekend"},{date:"2026-03-19",name:"Holi Celebration",type:"long-weekend"},{date:"2026-03-20",name:"Take a leave! Beach time?",type:"long-weekend"},{date:"2026-03-21",name:"Relaxing Saturday",type:"long-weekend"},{date:"2026-03-22",name:"Lazy Sunday",type:"long-weekend"},{date:"2026-08-15",name:"Independence Day",type:"long-weekend"},{date:"2026-08-16",name:"Sunday Brunch",type:"long-weekend"},{date:"2026-08-17",name:"Take a leave? Hills calling!",type:"long-weekend"},{date:"2026-11-07",name:"Choti Diwali",type:"long-weekend"},{date:"2026-11-08",name:"Diwali",type:"long-weekend"},{date:"2026-11-09",name:"Govardhan Puja (Take leave)",type:"long-weekend"}];T.COMMON_TIMEZONES=G,T.DEFAULT_TIMEZONE=H,T.DateTimePicker=oe,T.INDIAN_HOLIDAYS_2026=se,T.LONG_WEEKENDS_2026=ae,T.convertToTimezone=O,T.nowInTimezone=K,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("luxon")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","luxon"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.ChronosPicker={},M.jsxRuntime,M.React,M.luxon))})(this,function(M,e,i,S){"use strict";const J="Asia/Kolkata",q=[{date:"2026-01-26",name:"Republic Day",type:"national"},{date:"2026-03-19",name:"Holi",type:"national"},{date:"2026-04-14",name:"Dr. Ambedkar Jayanti",type:"national"},{date:"2026-08-15",name:"Independence Day",type:"national"},{date:"2026-10-02",name:"Gandhi Jayanti",type:"national"},{date:"2026-10-20",name:"Dussehra",type:"national"},{date:"2026-11-08",name:"Diwali",type:"national"},{date:"2026-12-25",name:"Christmas",type:"national"}],F=[{date:"2026-01-24",name:"Long Weekend: Trip to Jaipur?",type:"long-weekend"},{date:"2026-01-25",name:"Long Weekend: Fort Visit",type:"long-weekend"},{date:"2026-01-26",name:"Republic Day",type:"long-weekend"},{date:"2026-03-19",name:"Holi Celebration",type:"long-weekend"},{date:"2026-03-20",name:"Take a leave! Beach time?",type:"long-weekend"},{date:"2026-03-21",name:"Relaxing Saturday",type:"long-weekend"},{date:"2026-03-22",name:"Lazy Sunday",type:"long-weekend"},{date:"2026-08-15",name:"Independence Day",type:"long-weekend"},{date:"2026-08-16",name:"Sunday Brunch",type:"long-weekend"},{date:"2026-08-17",name:"Take a leave? Hills calling!",type:"long-weekend"},{date:"2026-11-07",name:"Choti Diwali",type:"long-weekend"},{date:"2026-11-08",name:"Diwali",type:"long-weekend"},{date:"2026-11-09",name:"Govardhan Puja (Take leave)",type:"long-weekend"}];function Q(n){return n===J?[...q,...F]:[]}const X="Asia/Kolkata",B=[{value:"Asia/Kolkata",label:"India (IST)"},{value:"America/New_York",label:"Eastern Time (ET)"},{value:"America/Chicago",label:"Central Time (CT)"},{value:"America/Denver",label:"Mountain Time (MT)"},{value:"America/Los_Angeles",label:"Pacific Time (PT)"},{value:"Europe/London",label:"London (GMT/BST)"},{value:"Europe/Paris",label:"Central Europe (CET)"},{value:"Asia/Dubai",label:"Dubai (GST)"},{value:"Asia/Singapore",label:"Singapore (SGT)"},{value:"Asia/Tokyo",label:"Tokyo (JST)"},{value:"Australia/Sydney",label:"Sydney (AEDT)"},{value:"UTC",label:"UTC"}];function A(n,l){return S.DateTime.isDateTime(n)?n.setZone(l):typeof n=="string"?S.DateTime.fromISO(n,{zone:l}):S.DateTime.fromJSDate(n,{zone:l})}function Y(n){return S.DateTime.now().setZone(n)}function V(n){const a=S.DateTime.now().setZone(n).offset,r=Math.floor(Math.abs(a)/60),c=Math.abs(a)%60;return`UTC${a>=0?"+":"-"}${r}${c>0?`:${c.toString().padStart(2,"0")}`:""}`}function te(n,l,a,r,c,b,d,u,v){const T=S.DateTime.fromObject({year:n,month:l,day:1},{zone:a}),P=T.startOf("week"),z=T.endOf("month").endOf("week"),_=S.DateTime.now().setZone(a).startOf("day"),L=d!=null&&u!=null,C=d==null?void 0:d.startOf("day"),$=u==null?void 0:u.endOf("day"),t=new Map;v&&v.forEach(D=>{let h;S.DateTime.isDateTime(D.date)?h=D.date.setZone(a):typeof D.date=="string"?h=S.DateTime.fromISO(D.date,{zone:a}):h=S.DateTime.fromJSDate(D.date,{zone:a}),t.set(h.toISODate()||"",{name:D.name,type:D.type||"national"})});const m=[];let I=[],k=P;for(;k<=z;){const D=k.month===l,h=k.hasSame(_,"day"),s=k.startOf("day"),y=k.toISODate()||"";let o=!1,w=!1,N=!1,W=!1;L&&C&&$?(N=s.hasSame(C,"day"),W=s.hasSame($,"day"),w=s>=C&&s<=$||N||W,o=N||W):r&&(o=k.hasSame(r,"day"));let O=!1;c&&k<c.startOf("day")&&(O=!0),b&&k>b.endOf("day")&&(O=!0);const H=t.get(y);I.push({date:k,isCurrentMonth:D,isToday:h,isSelected:o,isDisabled:O,isInRange:w,isRangeStart:N,isRangeEnd:W,holiday:H?{date:k,...H}:void 0}),I.length===7&&(m.push(I),I=[]),k=k.plus({days:1})}return m}function oe(){const n=S.DateTime.now().startOf("week"),l=[];for(let a=0;a<7;a++){const r=n.plus({days:a});l.push(r.toFormat("ccc"))}return l}function se(){const n=[];for(let l=1;l<=12;l++){const a=S.DateTime.fromObject({month:l});n.push(a.toFormat("MMMM"))}return n}const ae=({viewDate:n,selectedDate:l,onDateSelect:a,onViewDateChange:r,timezone:c,minDate:b,maxDate:d,selectedStart:u,selectedEnd:v,onRangeSelect:T,holidays:P})=>{const Z=T!=null,z=i.useMemo(()=>te(n.year,n.month,c,l??void 0,b,d,u??void 0,v??void 0,P),[n,l,c,b,d,u,v,P]),_=i.useMemo(()=>oe(),[]),L=i.useMemo(()=>se(),[]),C=()=>{r(n.minus({months:1}))},$=()=>{r(n.plus({months:1}))},t=s=>{const y=parseInt(s.target.value,10);r(n.set({month:y}))},m=s=>{const y=parseInt(s.target.value,10);r(n.set({year:y}))},I=(s,y)=>{if(!y)if(Z&&T){const o=s.startOf("day");if(u==null)T(s,s);else if(v!=null&&u.hasSame(v,"day")){const w=u.startOf("day");o<w?T(s,u):T(u,s)}else T(s,s)}else a(s)},k=(s,y,o)=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),I(y,o))},D=n.year,h=Array.from({length:21},(s,y)=>D-10+y);return e.jsxs("div",{className:"chronos-calendar",role:"region","aria-label":"Calendar",children:[e.jsxs("div",{className:"chronos-calendar-header",children:[e.jsx("button",{type:"button",className:"chronos-nav-button",onClick:C,"aria-label":"Previous month",children:"‹"}),e.jsxs("div",{className:"chronos-month-year-selectors",children:[e.jsx("select",{className:"chronos-month-select",value:n.month,onChange:t,"aria-label":"Select month",children:L.map((s,y)=>e.jsx("option",{value:y+1,children:s},y))}),e.jsx("select",{className:"chronos-year-select",value:n.year,onChange:m,"aria-label":"Select year",children:h.map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsx("button",{type:"button",className:"chronos-nav-button",onClick:$,"aria-label":"Next month",children:"›"})]}),e.jsxs("div",{className:"chronos-calendar-grid",children:[e.jsx("div",{className:"chronos-weekday-row",children:_.map(s=>e.jsx("div",{className:"chronos-weekday",children:s},s))}),z.map((s,y)=>e.jsx("div",{className:"chronos-week-row",children:s.map((o,w)=>e.jsxs("button",{type:"button",className:`chronos-day ${o.isSelected?"selected":""} ${o.isToday?"today":""} ${o.isCurrentMonth?"":"other-month"} ${o.isDisabled?"disabled":""} ${o.isInRange?"in-range":""} ${o.isRangeStart?"range-start":""} ${o.isRangeEnd?"range-end":""} ${o.holiday?`holiday ${o.holiday.type}`:""}`,onClick:()=>I(o.date,o.isDisabled),onKeyDown:N=>k(N,o.date,o.isDisabled),disabled:o.isDisabled,"aria-label":`${o.date.toFormat("MMMM d, yyyy")}${o.holiday?`, ${o.holiday.name}`:""}`,"aria-selected":o.isSelected,"aria-current":o.isToday?"date":void 0,title:o.holiday?o.holiday.name:void 0,children:[o.date.day,o.holiday&&e.jsx("span",{className:"chronos-holiday-dot"})]},w))},y))]})]})},le=({value:n,onChange:l,use24Hour:a})=>{const[r,c]=i.useState((n==null?void 0:n.hour)??12),[b,d]=i.useState((n==null?void 0:n.minute)??0),[u,v]=i.useState(n&&n.hour>=12?"PM":"AM");i.useEffect(()=>{n&&(c(n.hour),d(n.minute),v(n.hour>=12?"PM":"AM"))},[n]);const T=t=>{c(t);let m=t;a||(u==="PM"&&t!==12?m=t+12:u==="AM"&&t===12&&(m=0)),l(m,b)},P=t=>{d(t),l(r,t)},Z=()=>{const t=u==="AM"?"PM":"AM";v(t);let m=r;t==="PM"&&r!==12?m=r+12:t==="AM"&&r===12?m=0:t==="AM"&&r>12&&(m=r-12),l(m,b)},z=a?r:r%12||12,_=a?23:12,L=a?0:1,C=Array.from({length:_-L+1},(t,m)=>L+m),$=Array.from({length:60},(t,m)=>m);return e.jsxs("div",{className:"chronos-time-picker",role:"group","aria-label":"Time picker",children:[e.jsxs("div",{className:"chronos-time-header",children:[e.jsxs("svg",{className:"chronos-clock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("span",{children:"Time"})]}),e.jsxs("div",{className:"chronos-time-controls",children:[e.jsxs("div",{className:"chronos-time-input-group",children:[e.jsx("label",{htmlFor:"chronos-hour-select",className:"chronos-time-label",children:"Hour"}),e.jsx("select",{id:"chronos-hour-select",className:"chronos-time-select",value:z,onChange:t=>T(parseInt(t.target.value,10)),"aria-label":"Select hour",children:C.map(t=>e.jsx("option",{value:t,children:t.toString().padStart(2,"0")},t))})]}),e.jsx("span",{className:"chronos-time-separator",children:":"}),e.jsxs("div",{className:"chronos-time-input-group",children:[e.jsx("label",{htmlFor:"chronos-minute-select",className:"chronos-time-label",children:"Minute"}),e.jsx("select",{id:"chronos-minute-select",className:"chronos-time-select",value:b,onChange:t=>P(parseInt(t.target.value,10)),"aria-label":"Select minute",children:$.map(t=>e.jsx("option",{value:t,children:t.toString().padStart(2,"0")},t))})]}),!a&&e.jsx("button",{type:"button",className:"chronos-period-toggle",onClick:Z,"aria-label":`Switch to ${u==="AM"?"PM":"AM"}`,children:u})]})]})},re=({value:n,onChange:l})=>{const[a,r]=i.useState(!1),c=B.find(d=>d.value===n)||{label:n},b=d=>{l(d),r(!1)};return e.jsxs("div",{className:"chronos-timezone-selector",children:[e.jsxs("div",{className:"chronos-timezone-header",children:[e.jsxs("svg",{className:"chronos-globe-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),e.jsx("span",{children:"Timezone"})]}),e.jsxs("button",{type:"button",className:"chronos-timezone-button",onClick:()=>r(!a),"aria-expanded":a,"aria-label":"Select timezone",children:[e.jsx("span",{className:"chronos-timezone-label",children:c.label}),e.jsx("span",{className:"chronos-timezone-offset",children:V(n)}),e.jsx("svg",{className:`chronos-chevron ${a?"expanded":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),a&&e.jsx("div",{className:"chronos-timezone-list",role:"listbox",children:B.map(d=>e.jsxs("button",{type:"button",className:`chronos-timezone-option ${d.value===n?"selected":""}`,onClick:()=>b(d.value),role:"option","aria-selected":d.value===n,children:[e.jsx("span",{className:"chronos-timezone-option-label",children:d.label}),e.jsx("span",{className:"chronos-timezone-option-offset",children:V(d.value)})]},d.value))})]})};function R(n,l,a){return{iso:n.toISO()||"",formatted:n.toFormat(`${l} ${a}`),timestamp:n.toMillis(),dateTime:n}}const ie=({value:n,onChange:l,timezone:a=X,dateFormat:r="DD",timeFormat:c="HH:mm",minDate:b,maxDate:d,placeholder:u="Select date and time",disabled:v=!1,showTime:T=!0,use24Hour:P=!0,className:Z="",ariaLabel:z="Date and time picker",showTimezoneSelector:_=!1,theme:L="light",orientation:C="portrait",selectionMode:$="single",rangeValue:t,onRangeChange:m,holidays:I,customHolidays:k,showHolidays:D=!0})=>{const h=$==="range",[s,y]=i.useState(!1),[o,w]=i.useState(()=>!h&&n?A(n,a):null),[N,W]=i.useState(()=>h&&(t!=null&&t.start)?A(t.start,a):null),[O,H]=i.useState(()=>h&&(t!=null&&t.end)?A(t.end,a):null),[g,ce]=i.useState(a),[de,K]=i.useState(()=>o||N||O||Y(a)),G=i.useRef(null),ee=i.useRef(null);i.useEffect(()=>{!h&&n&&w(A(n,g))},[n,g,h]),i.useEffect(()=>{h&&(t==null?void 0:t.start)!=null&&(t==null?void 0:t.end)!=null&&(W(A(t.start,g)),H(A(t.end,g)))},[h,t,g]),i.useEffect(()=>{const p=f=>{G.current&&!G.current.contains(f.target)&&y(!1)};if(s)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]),i.useEffect(()=>{const p=f=>{var E;f.key==="Escape"&&s&&(y(!1),(E=ee.current)==null||E.focus())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s]);const he=i.useCallback(p=>{let f=p;if(o&&(f=p.set({hour:o.hour,minute:o.minute,second:o.second})),w(f),K(f),T||y(!1),l){const E={iso:f.toISO()||"",formatted:f.toFormat(`${r} ${c}`),timestamp:f.toMillis(),dateTime:f};l(E)}},[o,T,l,r,c]),fe=i.useCallback((p,f)=>{const x=(o||Y(g)).set({hour:p,minute:f,second:0});if(w(x),l){const j={iso:x.toISO()||"",formatted:x.toFormat(`${r} ${c}`),timestamp:x.toMillis(),dateTime:x};l(j)}},[o,g,l,r,c]),me=i.useCallback((p,f)=>{const E=p.startOf("day"),x=f.startOf("day"),[j,U]=E<=x?[E,x]:[x,E];if(W(j),H(U),K(j),m){const be=R(j,r,c),ve=R(U,r,c),Ne=Math.max(0,Math.ceil(U.diff(j,"days").days));m({start:be,end:ve,nights:Ne})}},[m,r,c]),ye=i.useCallback(p=>{if(ce(p),o){const f=o.setZone(p);if(w(f),K(f),l){const E={iso:f.toISO()||"",formatted:f.toFormat(`${r} ${c}`),timestamp:f.toMillis(),dateTime:f};l(E)}}else K(Y(p))},[o,l,r,c]),ne=()=>{v||y(!s)},pe=p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),ne())},ue=h?N&&O?`${N.toFormat("d MMM yyyy")} – ${O.toFormat("d MMM yyyy")}`:"":o?o.toFormat(`${r} ${T?c:""}`):"",Me=b?A(b,g):void 0,Te=d?A(d,g):void 0,ke=I!==void 0?I:D?[...Q(g),...k??[]]:k??[];return e.jsxs("div",{ref:G,className:`chronos-picker ${Z}`,"data-disabled":v,"data-theme":L,children:[e.jsxs("div",{className:"chronos-input-wrapper",onClick:ne,children:[e.jsx("input",{ref:ee,type:"text",className:"chronos-input",value:ue,placeholder:u,readOnly:!0,disabled:v,onKeyDown:pe,"aria-label":z,"aria-expanded":s,"aria-haspopup":"dialog",role:"combobox"}),e.jsxs("svg",{className:"chronos-calendar-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})]}),s&&e.jsx("div",{className:"chronos-dropdown","data-orientation":C,"data-range-mode":h,role:"dialog","aria-label":"Date and time picker dialog",children:e.jsxs("div",{className:"chronos-dropdown-content",children:[h&&N&&O&&e.jsxs("div",{className:"chronos-range-summary",children:[e.jsxs("div",{className:"chronos-range-nights",children:[Math.max(0,Math.ceil(O.diff(N,"days").days))," nights"]}),e.jsxs("div",{className:"chronos-range-dates",children:[N.toFormat("d MMM yyyy")," – ",O.toFormat("d MMM yyyy")]})]}),e.jsx(ae,{viewDate:de,selectedDate:h?null:o,onDateSelect:he,onViewDateChange:K,timezone:g,minDate:Me,maxDate:Te,selectedStart:h?N:void 0,selectedEnd:h?O:void 0,onRangeSelect:h?me:void 0,holidays:ke}),!h&&(T||_)&&e.jsxs("div",{className:"chronos-sidebar",children:[T&&e.jsx(le,{value:o,onChange:fe,use24Hour:P,timezone:g}),_&&e.jsx(re,{value:g,onChange:ye})]})]})})]})};M.COMMON_TIMEZONES=B,M.DEFAULT_HOLIDAYS_TIMEZONE=J,M.DEFAULT_TIMEZONE=X,M.DateTimePicker=ie,M.INDIAN_HOLIDAYS_2026=q,M.LONG_WEEKENDS_2026=F,M.convertToTimezone=A,M.getDefaultHolidaysForTimezone=Q,M.nowInTimezone=Y,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,UAAU,CAAC;AAM9D,OAAO,8BAA8B,CAAC;AAWtC,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkTxD,CAAC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Holiday } from '../types';
|
|
2
2
|
|
|
3
|
+
/** IANA timezone for which built-in 2026 holidays are provided */
|
|
4
|
+
export declare const DEFAULT_HOLIDAYS_TIMEZONE = "Asia/Kolkata";
|
|
3
5
|
export declare const INDIAN_HOLIDAYS_2026: Holiday[];
|
|
4
6
|
export declare const LONG_WEEKENDS_2026: Holiday[];
|
|
7
|
+
/**
|
|
8
|
+
* Returns default national holidays and long weekend suggestions for the given timezone.
|
|
9
|
+
* Built-in data is provided for Asia/Kolkata (India) for 2026; other timezones get an empty array.
|
|
10
|
+
* Use with customHolidays prop to add your own dates on top of these.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDefaultHolidaysForTimezone(timezone: string): Holiday[];
|
|
5
13
|
//# sourceMappingURL=holidays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holidays.d.ts","sourceRoot":"","sources":["../../../src/constants/holidays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,oBAAoB,EAAE,OAAO,EAUzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAAO,EAqBvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"holidays.d.ts","sourceRoot":"","sources":["../../../src/constants/holidays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,kEAAkE;AAClE,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,OAAO,EAUzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAAO,EAqBvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAKzE"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DateTimePicker } from './components/DateTimePicker';
|
|
2
2
|
export type { DateTimePickerProps, DateTimeValue, DateTimeRangeValue } from './types';
|
|
3
3
|
export { DEFAULT_TIMEZONE, COMMON_TIMEZONES, convertToTimezone, nowInTimezone } from './utils/timezone';
|
|
4
|
-
export { INDIAN_HOLIDAYS_2026, LONG_WEEKENDS_2026 } from './constants/holidays';
|
|
4
|
+
export { INDIAN_HOLIDAYS_2026, LONG_WEEKENDS_2026, DEFAULT_HOLIDAYS_TIMEZONE, getDefaultHolidaysForTimezone, } from './constants/holidays';
|
|
5
5
|
export type { Holiday } from './types';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -65,8 +65,21 @@ export interface DateTimePickerProps {
|
|
|
65
65
|
} | null;
|
|
66
66
|
/** Callback when range changes (selectionMode is 'range') */
|
|
67
67
|
onRangeChange?: (value: DateTimeRangeValue) => void;
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* List of holidays to display. When provided, this fully overrides default holidays
|
|
70
|
+
* for the timezone. Omit to use built-in holidays (Asia/Kolkata 2026) plus customHolidays.
|
|
71
|
+
*/
|
|
69
72
|
holidays?: Holiday[];
|
|
73
|
+
/**
|
|
74
|
+
* Custom holiday dates to add on top of the default holidays for the selected timezone.
|
|
75
|
+
* Ignored when holidays prop is set. Only used when timezone has built-in data or you pass holidays.
|
|
76
|
+
*/
|
|
77
|
+
customHolidays?: Holiday[];
|
|
78
|
+
/**
|
|
79
|
+
* Whether to show default national holidays and long weekend suggestions for the selected timezone.
|
|
80
|
+
* Default true. Set to false to hide built-in holidays (customHolidays and holidays still apply if set).
|
|
81
|
+
*/
|
|
82
|
+
showHolidays?: boolean;
|
|
70
83
|
}
|
|
71
84
|
export interface CalendarDate {
|
|
72
85
|
date: DateTime;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,mBAAmB;IACnB,GAAG,EAAE,aAAa,CAAC;IACnB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;IAEjC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAE1C,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAExB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAExB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IAEvC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAEnC,gDAAgD;IAChD,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;QAAC,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAEvF,6DAA6D;IAC7D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAEpD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,mBAAmB;IACnB,GAAG,EAAE,aAAa,CAAC;IACnB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;IAEjC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAE1C,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAExB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAExB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IAEvC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAEnC,gDAAgD;IAChD,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;QAAC,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAEvF,6DAA6D;IAC7D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
package/package.json
CHANGED