@theengineerguy/chronos-picker 1.0.5 → 1.0.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
- import { useMemo as G, useState as w, useEffect as K, useRef as Q, useCallback as j } from "react";
3
- import { DateTime as O } from "luxon";
2
+ import { useMemo as Y, useState as S, useEffect as B, useRef as Q, useCallback as G } from "react";
3
+ import { DateTime as w } from "luxon";
4
4
  const me = "Asia/Kolkata", X = [
5
5
  { value: "Asia/Kolkata", label: "India (IST)" },
6
6
  { value: "America/New_York", label: "Eastern Time (ET)" },
@@ -15,113 +15,113 @@ const me = "Asia/Kolkata", X = [
15
15
  { value: "Australia/Sydney", label: "Sydney (AEDT)" },
16
16
  { value: "UTC", label: "UTC" }
17
17
  ];
18
- function R(e, r) {
19
- return O.isDateTime(e) ? e.setZone(r) : typeof e == "string" ? O.fromISO(e, { zone: r }) : O.fromJSDate(e, { zone: r });
18
+ function L(e, i) {
19
+ return w.isDateTime(e) ? e.setZone(i) : typeof e == "string" ? w.fromISO(e, { zone: i }) : w.fromJSDate(e, { zone: i });
20
20
  }
21
- function J(e) {
22
- return O.now().setZone(e);
21
+ function H(e) {
22
+ return w.now().setZone(e);
23
23
  }
24
24
  function F(e) {
25
- const a = O.now().setZone(e).offset, i = Math.floor(Math.abs(a) / 60), c = Math.abs(a) % 60;
26
- return `UTC${a >= 0 ? "+" : "-"}${i}${c > 0 ? `:${c.toString().padStart(2, "0")}` : ""}`;
25
+ const s = w.now().setZone(e).offset, l = Math.floor(Math.abs(s) / 60), c = Math.abs(s) % 60;
26
+ return `UTC${s >= 0 ? "+" : "-"}${l}${c > 0 ? `:${c.toString().padStart(2, "0")}` : ""}`;
27
27
  }
28
- function ue(e, r, a, i, c, N, d, p, k) {
29
- const b = O.fromObject(
30
- { year: e, month: r, day: 1 },
31
- { zone: a }
32
- ), E = b.startOf("week"), z = b.endOf("month").endOf("week"), I = O.now().setZone(a).startOf("day"), P = d != null && p != null, x = d == null ? void 0 : d.startOf("day"), D = p == null ? void 0 : p.endOf("day"), t = /* @__PURE__ */ new Map();
33
- k && k.forEach((M) => {
34
- let g;
35
- O.isDateTime(M.date) ? g = M.date.setZone(a) : typeof M.date == "string" ? g = O.fromISO(M.date, { zone: a }) : g = O.fromJSDate(M.date, { zone: a }), t.set(g.toISODate() || "", { name: M.name, type: M.type || "national" });
28
+ function ue(e, i, s, l, c, v, d, y, g) {
29
+ const M = w.fromObject(
30
+ { year: e, month: i, day: 1 },
31
+ { zone: s }
32
+ ), I = M.startOf("week"), R = M.endOf("month").endOf("week"), E = w.now().setZone(s).startOf("day"), P = d != null && y != null, O = d == null ? void 0 : d.startOf("day"), x = y == null ? void 0 : y.endOf("day"), n = /* @__PURE__ */ new Map();
33
+ g && g.forEach((b) => {
34
+ let T;
35
+ w.isDateTime(b.date) ? T = b.date.setZone(s) : typeof b.date == "string" ? T = w.fromISO(b.date, { zone: s }) : T = w.fromJSDate(b.date, { zone: s }), n.set(T.toISODate() || "", { name: b.name, type: b.type || "national" });
36
36
  });
37
37
  const u = [];
38
- let $ = [], l = E;
39
- for (; l <= z; ) {
40
- const M = l.month === r, g = l.hasSame(I, "day"), n = l.startOf("day"), f = l.toISODate() || "";
41
- let s = !1, C = !1, T = !1, L = !1;
42
- P && x && D ? (T = n.hasSame(x, "day"), L = n.hasSame(D, "day"), C = n >= x && n <= D || T || L, s = T || L) : i && (s = l.hasSame(i, "day"));
43
- let v = !1;
44
- c && l < c.startOf("day") && (v = !0), N && l > N.endOf("day") && (v = !0);
45
- const B = t.get(f);
38
+ let $ = [], r = I;
39
+ for (; r <= R; ) {
40
+ const b = r.month === i, T = r.hasSame(E, "day"), t = r.startOf("day"), p = r.toISODate() || "";
41
+ let a = !1, C = !1, N = !1, W = !1;
42
+ P && O && x ? (N = t.hasSame(O, "day"), W = t.hasSame(x, "day"), C = t >= O && t <= x || N || W, a = N || W) : l && (a = r.hasSame(l, "day"));
43
+ let k = !1;
44
+ c && r < c.startOf("day") && (k = !0), v && r > v.endOf("day") && (k = !0);
45
+ const K = n.get(p);
46
46
  $.push({
47
- date: l,
48
- isCurrentMonth: M,
49
- isToday: g,
50
- isSelected: s,
51
- isDisabled: v,
47
+ date: r,
48
+ isCurrentMonth: b,
49
+ isToday: T,
50
+ isSelected: a,
51
+ isDisabled: k,
52
52
  isInRange: C,
53
- isRangeStart: T,
54
- isRangeEnd: L,
55
- holiday: B ? { date: l, ...B } : void 0
56
- }), $.length === 7 && (u.push($), $ = []), l = l.plus({ days: 1 });
53
+ isRangeStart: N,
54
+ isRangeEnd: W,
55
+ holiday: K ? { date: r, ...K } : void 0
56
+ }), $.length === 7 && (u.push($), $ = []), r = r.plus({ days: 1 });
57
57
  }
58
58
  return u;
59
59
  }
60
- function fe() {
61
- const e = O.now().startOf("week"), r = [];
62
- for (let a = 0; a < 7; a++) {
63
- const i = e.plus({ days: a });
64
- r.push(i.toFormat("ccc"));
60
+ function pe() {
61
+ const e = w.now().startOf("week"), i = [];
62
+ for (let s = 0; s < 7; s++) {
63
+ const l = e.plus({ days: s });
64
+ i.push(l.toFormat("ccc"));
65
65
  }
66
- return r;
66
+ return i;
67
67
  }
68
- function pe() {
68
+ function ye() {
69
69
  const e = [];
70
- for (let r = 1; r <= 12; r++) {
71
- const a = O.fromObject({ month: r });
72
- e.push(a.toFormat("MMMM"));
70
+ for (let i = 1; i <= 12; i++) {
71
+ const s = w.fromObject({ month: i });
72
+ e.push(s.toFormat("MMMM"));
73
73
  }
74
74
  return e;
75
75
  }
76
- const ye = ({
76
+ const fe = ({
77
77
  viewDate: e,
78
- selectedDate: r,
79
- onDateSelect: a,
80
- onViewDateChange: i,
78
+ selectedDate: i,
79
+ onDateSelect: s,
80
+ onViewDateChange: l,
81
81
  timezone: c,
82
- minDate: N,
82
+ minDate: v,
83
83
  maxDate: d,
84
- selectedStart: p,
85
- selectedEnd: k,
86
- onRangeSelect: b,
87
- holidays: E
84
+ selectedStart: y,
85
+ selectedEnd: g,
86
+ onRangeSelect: M,
87
+ holidays: I
88
88
  }) => {
89
- const W = b != null, z = G(() => ue(
89
+ const _ = M != null, R = Y(() => ue(
90
90
  e.year,
91
91
  e.month,
92
92
  c,
93
- r ?? void 0,
94
- N,
93
+ i ?? void 0,
94
+ v,
95
95
  d,
96
- p ?? void 0,
97
- k ?? void 0,
98
- E
99
- ), [e, r, c, N, d, p, k, E]), I = G(() => fe(), []), P = G(() => pe(), []), x = () => {
100
- i(e.minus({ months: 1 }));
101
- }, D = () => {
102
- i(e.plus({ months: 1 }));
103
- }, t = (n) => {
104
- const f = parseInt(n.target.value, 10);
105
- i(e.set({ month: f }));
106
- }, u = (n) => {
107
- const f = parseInt(n.target.value, 10);
108
- i(e.set({ year: f }));
109
- }, $ = (n, f) => {
110
- if (!f)
111
- if (W && b) {
112
- const s = n.startOf("day");
113
- if (p == null)
114
- b(n, n);
115
- else if (k != null && p.hasSame(k, "day")) {
116
- const C = p.startOf("day");
117
- s < C ? b(n, p) : b(p, n);
96
+ y ?? void 0,
97
+ g ?? void 0,
98
+ I
99
+ ), [e, i, c, v, d, y, g, I]), E = Y(() => pe(), []), P = Y(() => ye(), []), O = () => {
100
+ l(e.minus({ months: 1 }));
101
+ }, x = () => {
102
+ l(e.plus({ months: 1 }));
103
+ }, n = (t) => {
104
+ const p = parseInt(t.target.value, 10);
105
+ l(e.set({ month: p }));
106
+ }, u = (t) => {
107
+ const p = parseInt(t.target.value, 10);
108
+ l(e.set({ year: p }));
109
+ }, $ = (t, p) => {
110
+ if (!p)
111
+ if (_ && M) {
112
+ const a = t.startOf("day");
113
+ if (y == null)
114
+ M(t, t);
115
+ else if (g != null && y.hasSame(g, "day")) {
116
+ const C = y.startOf("day");
117
+ a < C ? M(t, y) : M(y, t);
118
118
  } else
119
- b(n, n);
119
+ M(t, t);
120
120
  } else
121
- a(n);
122
- }, l = (n, f, s) => {
123
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), $(f, s));
124
- }, M = e.year, g = Array.from({ length: 21 }, (n, f) => M - 10 + f);
121
+ s(t);
122
+ }, r = (t, p, a) => {
123
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(p, a));
124
+ }, b = e.year, T = Array.from({ length: 21 }, (t, p) => b - 10 + p);
125
125
  return /* @__PURE__ */ h("div", { className: "chronos-calendar", role: "region", "aria-label": "Calendar", children: [
126
126
  /* @__PURE__ */ h("div", { className: "chronos-calendar-header", children: [
127
127
  /* @__PURE__ */ o(
@@ -129,7 +129,7 @@ const ye = ({
129
129
  {
130
130
  type: "button",
131
131
  className: "chronos-nav-button",
132
- onClick: x,
132
+ onClick: O,
133
133
  "aria-label": "Previous month",
134
134
  children: "‹"
135
135
  }
@@ -140,9 +140,9 @@ const ye = ({
140
140
  {
141
141
  className: "chronos-month-select",
142
142
  value: e.month,
143
- onChange: t,
143
+ onChange: n,
144
144
  "aria-label": "Select month",
145
- children: P.map((n, f) => /* @__PURE__ */ o("option", { value: f + 1, children: n }, f))
145
+ children: P.map((t, p) => /* @__PURE__ */ o("option", { value: p + 1, children: t }, p))
146
146
  }
147
147
  ),
148
148
  /* @__PURE__ */ o(
@@ -152,7 +152,7 @@ const ye = ({
152
152
  value: e.year,
153
153
  onChange: u,
154
154
  "aria-label": "Select year",
155
- children: g.map((n) => /* @__PURE__ */ o("option", { value: n, children: n }, n))
155
+ children: T.map((t) => /* @__PURE__ */ o("option", { value: t, children: t }, t))
156
156
  }
157
157
  )
158
158
  ] }),
@@ -161,58 +161,58 @@ const ye = ({
161
161
  {
162
162
  type: "button",
163
163
  className: "chronos-nav-button",
164
- onClick: D,
164
+ onClick: x,
165
165
  "aria-label": "Next month",
166
166
  children: "›"
167
167
  }
168
168
  )
169
169
  ] }),
170
170
  /* @__PURE__ */ h("div", { className: "chronos-calendar-grid", children: [
171
- /* @__PURE__ */ o("div", { className: "chronos-weekday-row", children: I.map((n) => /* @__PURE__ */ o("div", { className: "chronos-weekday", children: n }, n)) }),
172
- z.map((n, f) => /* @__PURE__ */ o("div", { className: "chronos-week-row", children: n.map((s, C) => /* @__PURE__ */ h(
171
+ /* @__PURE__ */ o("div", { className: "chronos-weekday-row", children: E.map((t) => /* @__PURE__ */ o("div", { className: "chronos-weekday", children: t }, t)) }),
172
+ R.map((t, p) => /* @__PURE__ */ o("div", { className: "chronos-week-row", children: t.map((a, C) => /* @__PURE__ */ h(
173
173
  "button",
174
174
  {
175
175
  type: "button",
176
- 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}` : ""}`,
177
- onClick: () => $(s.date, s.isDisabled),
178
- onKeyDown: (T) => l(T, s.date, s.isDisabled),
179
- disabled: s.isDisabled,
180
- "aria-label": `${s.date.toFormat("MMMM d, yyyy")}${s.holiday ? `, ${s.holiday.name}` : ""}`,
181
- "aria-selected": s.isSelected,
182
- "aria-current": s.isToday ? "date" : void 0,
183
- title: s.holiday ? s.holiday.name : void 0,
176
+ className: `chronos-day ${a.isSelected ? "selected" : ""} ${a.isToday ? "today" : ""} ${a.isCurrentMonth ? "" : "other-month"} ${a.isDisabled ? "disabled" : ""} ${a.isInRange ? "in-range" : ""} ${a.isRangeStart ? "range-start" : ""} ${a.isRangeEnd ? "range-end" : ""} ${a.holiday ? `holiday ${a.holiday.type}` : ""}`,
177
+ onClick: () => $(a.date, a.isDisabled),
178
+ onKeyDown: (N) => r(N, a.date, a.isDisabled),
179
+ disabled: a.isDisabled,
180
+ "aria-label": `${a.date.toFormat("MMMM d, yyyy")}${a.holiday ? `, ${a.holiday.name}` : ""}`,
181
+ "aria-selected": a.isSelected,
182
+ "aria-current": a.isToday ? "date" : void 0,
183
+ title: a.holiday ? a.holiday.name : void 0,
184
184
  children: [
185
- s.date.day,
186
- s.holiday && /* @__PURE__ */ o("span", { className: "chronos-holiday-dot" })
185
+ a.date.day,
186
+ a.holiday && /* @__PURE__ */ o("span", { className: "chronos-holiday-dot" })
187
187
  ]
188
188
  },
189
189
  C
190
- )) }, f))
190
+ )) }, p))
191
191
  ] })
192
192
  ] });
193
- }, Me = ({
193
+ }, be = ({
194
194
  value: e,
195
- onChange: r,
196
- use24Hour: a
195
+ onChange: i,
196
+ use24Hour: s
197
197
  }) => {
198
- const [i, c] = w((e == null ? void 0 : e.hour) ?? 12), [N, d] = w((e == null ? void 0 : e.minute) ?? 0), [p, k] = w(
198
+ const [l, c] = S((e == null ? void 0 : e.hour) ?? 12), [v, d] = S((e == null ? void 0 : e.minute) ?? 0), [y, g] = S(
199
199
  e && e.hour >= 12 ? "PM" : "AM"
200
200
  );
201
- K(() => {
202
- e && (c(e.hour), d(e.minute), k(e.hour >= 12 ? "PM" : "AM"));
201
+ B(() => {
202
+ e && (c(e.hour), d(e.minute), g(e.hour >= 12 ? "PM" : "AM"));
203
203
  }, [e]);
204
- const b = (t) => {
205
- c(t);
206
- let u = t;
207
- a || (p === "PM" && t !== 12 ? u = t + 12 : p === "AM" && t === 12 && (u = 0)), r(u, N);
208
- }, E = (t) => {
209
- d(t), r(i, t);
210
- }, W = () => {
211
- const t = p === "AM" ? "PM" : "AM";
212
- k(t);
213
- let u = i;
214
- t === "PM" && i !== 12 ? u = i + 12 : t === "AM" && i === 12 ? u = 0 : t === "AM" && i > 12 && (u = i - 12), r(u, N);
215
- }, z = a ? i : i % 12 || 12, I = a ? 23 : 12, P = a ? 0 : 1, x = Array.from({ length: I - P + 1 }, (t, u) => P + u), D = Array.from({ length: 60 }, (t, u) => u);
204
+ const M = (n) => {
205
+ c(n);
206
+ let u = n;
207
+ s || (y === "PM" && n !== 12 ? u = n + 12 : y === "AM" && n === 12 && (u = 0)), i(u, v);
208
+ }, I = (n) => {
209
+ d(n), i(l, n);
210
+ }, _ = () => {
211
+ const n = y === "AM" ? "PM" : "AM";
212
+ g(n);
213
+ let u = l;
214
+ n === "PM" && l !== 12 ? u = l + 12 : n === "AM" && l === 12 ? u = 0 : n === "AM" && l > 12 && (u = l - 12), i(u, v);
215
+ }, R = s ? l : l % 12 || 12, E = s ? 23 : 12, P = s ? 0 : 1, O = Array.from({ length: E - P + 1 }, (n, u) => P + u), x = Array.from({ length: 60 }, (n, u) => u);
216
216
  return /* @__PURE__ */ h("div", { className: "chronos-time-picker", role: "group", "aria-label": "Time picker", children: [
217
217
  /* @__PURE__ */ h("div", { className: "chronos-time-header", children: [
218
218
  /* @__PURE__ */ h(
@@ -240,10 +240,10 @@ const ye = ({
240
240
  {
241
241
  id: "chronos-hour-select",
242
242
  className: "chronos-time-select",
243
- value: z,
244
- onChange: (t) => b(parseInt(t.target.value, 10)),
243
+ value: R,
244
+ onChange: (n) => M(parseInt(n.target.value, 10)),
245
245
  "aria-label": "Select hour",
246
- children: x.map((t) => /* @__PURE__ */ o("option", { value: t, children: t.toString().padStart(2, "0") }, t))
246
+ children: O.map((n) => /* @__PURE__ */ o("option", { value: n, children: n.toString().padStart(2, "0") }, n))
247
247
  }
248
248
  )
249
249
  ] }),
@@ -255,33 +255,33 @@ const ye = ({
255
255
  {
256
256
  id: "chronos-minute-select",
257
257
  className: "chronos-time-select",
258
- value: N,
259
- onChange: (t) => E(parseInt(t.target.value, 10)),
258
+ value: v,
259
+ onChange: (n) => I(parseInt(n.target.value, 10)),
260
260
  "aria-label": "Select minute",
261
- children: D.map((t) => /* @__PURE__ */ o("option", { value: t, children: t.toString().padStart(2, "0") }, t))
261
+ children: x.map((n) => /* @__PURE__ */ o("option", { value: n, children: n.toString().padStart(2, "0") }, n))
262
262
  }
263
263
  )
264
264
  ] }),
265
- !a && /* @__PURE__ */ o(
265
+ !s && /* @__PURE__ */ o(
266
266
  "button",
267
267
  {
268
268
  type: "button",
269
269
  className: "chronos-period-toggle",
270
- onClick: W,
271
- "aria-label": `Switch to ${p === "AM" ? "PM" : "AM"}`,
272
- children: p
270
+ onClick: _,
271
+ "aria-label": `Switch to ${y === "AM" ? "PM" : "AM"}`,
272
+ children: y
273
273
  }
274
274
  )
275
275
  ] })
276
276
  ] });
277
- }, be = ({
277
+ }, Me = ({
278
278
  value: e,
279
- onChange: r
279
+ onChange: i
280
280
  }) => {
281
- const [a, i] = w(!1), c = X.find((d) => d.value === e) || {
281
+ const [s, l] = S(!1), c = X.find((d) => d.value === e) || {
282
282
  label: e
283
- }, N = (d) => {
284
- r(d), i(!1);
283
+ }, v = (d) => {
284
+ i(d), l(!1);
285
285
  };
286
286
  return /* @__PURE__ */ h("div", { className: "chronos-timezone-selector", children: [
287
287
  /* @__PURE__ */ h("div", { className: "chronos-timezone-header", children: [
@@ -308,8 +308,8 @@ const ye = ({
308
308
  {
309
309
  type: "button",
310
310
  className: "chronos-timezone-button",
311
- onClick: () => i(!a),
312
- "aria-expanded": a,
311
+ onClick: () => l(!s),
312
+ "aria-expanded": s,
313
313
  "aria-label": "Select timezone",
314
314
  children: [
315
315
  /* @__PURE__ */ o("span", { className: "chronos-timezone-label", children: c.label }),
@@ -317,7 +317,7 @@ const ye = ({
317
317
  /* @__PURE__ */ o(
318
318
  "svg",
319
319
  {
320
- className: `chronos-chevron ${a ? "expanded" : ""}`,
320
+ className: `chronos-chevron ${s ? "expanded" : ""}`,
321
321
  xmlns: "http://www.w3.org/2000/svg",
322
322
  viewBox: "0 0 24 24",
323
323
  fill: "none",
@@ -329,12 +329,12 @@ const ye = ({
329
329
  ]
330
330
  }
331
331
  ),
332
- a && /* @__PURE__ */ o("div", { className: "chronos-timezone-list", role: "listbox", children: X.map((d) => /* @__PURE__ */ h(
332
+ s && /* @__PURE__ */ o("div", { className: "chronos-timezone-list", role: "listbox", children: X.map((d) => /* @__PURE__ */ h(
333
333
  "button",
334
334
  {
335
335
  type: "button",
336
336
  className: `chronos-timezone-option ${d.value === e ? "selected" : ""}`,
337
- onClick: () => N(d.value),
337
+ onClick: () => v(d.value),
338
338
  role: "option",
339
339
  "aria-selected": d.value === e,
340
340
  children: [
@@ -346,132 +346,132 @@ const ye = ({
346
346
  )) })
347
347
  ] });
348
348
  };
349
- function V(e, r, a) {
349
+ function V(e, i, s) {
350
350
  return {
351
351
  iso: e.toISO() || "",
352
- formatted: e.toFormat(`${r} ${a}`),
352
+ formatted: e.toFormat(`${i} ${s}`),
353
353
  timestamp: e.toMillis(),
354
354
  dateTime: e
355
355
  };
356
356
  }
357
- const Te = ({
357
+ const Ne = ({
358
358
  value: e,
359
- onChange: r,
360
- timezone: a = me,
361
- dateFormat: i = "DD",
359
+ onChange: i,
360
+ timezone: s = me,
361
+ dateFormat: l = "DD",
362
362
  timeFormat: c = "HH:mm",
363
- minDate: N,
363
+ minDate: v,
364
364
  maxDate: d,
365
- placeholder: p = "Select date and time",
366
- disabled: k = !1,
367
- showTime: b = !0,
368
- use24Hour: E = !0,
369
- className: W = "",
370
- ariaLabel: z = "Date and time picker",
371
- showTimezoneSelector: I = !1,
365
+ placeholder: y = "Select date and time",
366
+ disabled: g = !1,
367
+ showTime: M = !0,
368
+ use24Hour: I = !0,
369
+ className: _ = "",
370
+ ariaLabel: R = "Date and time picker",
371
+ showTimezoneSelector: E = !1,
372
372
  theme: P = "light",
373
- orientation: x = "portrait",
374
- selectionMode: D = "single",
375
- rangeValue: t,
373
+ orientation: O = "portrait",
374
+ selectionMode: x = "single",
375
+ rangeValue: n,
376
376
  onRangeChange: u,
377
377
  holidays: $
378
378
  }) => {
379
- const l = D === "range", [M, g] = w(!1), [n, f] = w(() => !l && e ? R(e, a) : null), [s, C] = w(() => l && (t != null && t.start) ? R(t.start, a) : null), [T, L] = w(() => l && (t != null && t.end) ? R(t.end, a) : null), [v, B] = w(a), [ee, _] = w(() => n || s || T || J(a)), U = Q(null), q = Q(null);
380
- K(() => {
381
- !l && e && f(R(e, v));
382
- }, [e, v, l]), K(() => {
383
- l && (t == null ? void 0 : t.start) != null && (t == null ? void 0 : t.end) != null && (C(R(t.start, v)), L(R(t.end, v)));
384
- }, [l, t, v]), K(() => {
385
- const y = (m) => {
386
- U.current && !U.current.contains(m.target) && g(!1);
379
+ const r = x === "range", [b, T] = S(!1), [t, p] = S(() => !r && e ? L(e, s) : null), [a, C] = S(() => r && (n != null && n.start) ? L(n.start, s) : null), [N, W] = S(() => r && (n != null && n.end) ? L(n.end, s) : null), [k, K] = S(s), [ee, Z] = S(() => t || a || N || H(s)), J = Q(null), U = Q(null);
380
+ B(() => {
381
+ !r && e && p(L(e, k));
382
+ }, [e, k, r]), B(() => {
383
+ r && (n == null ? void 0 : n.start) != null && (n == null ? void 0 : n.end) != null && (C(L(n.start, k)), W(L(n.end, k)));
384
+ }, [r, n, k]), B(() => {
385
+ const f = (m) => {
386
+ J.current && !J.current.contains(m.target) && T(!1);
387
387
  };
388
- if (M)
389
- return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
390
- }, [M]), K(() => {
391
- const y = (m) => {
392
- var S;
393
- m.key === "Escape" && M && (g(!1), (S = q.current) == null || S.focus());
388
+ if (b)
389
+ return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
390
+ }, [b]), B(() => {
391
+ const f = (m) => {
392
+ var D;
393
+ m.key === "Escape" && b && (T(!1), (D = U.current) == null || D.focus());
394
394
  };
395
- return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
396
- }, [M]);
397
- const te = j((y) => {
398
- let m = y;
399
- if (n && (m = y.set({
400
- hour: n.hour,
401
- minute: n.minute,
402
- second: n.second
403
- })), f(m), _(m), b || g(!1), r) {
404
- const S = {
395
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
396
+ }, [b]);
397
+ const ne = G((f) => {
398
+ let m = f;
399
+ if (t && (m = f.set({
400
+ hour: t.hour,
401
+ minute: t.minute,
402
+ second: t.second
403
+ })), p(m), Z(m), M || T(!1), i) {
404
+ const D = {
405
405
  iso: m.toISO() || "",
406
- formatted: m.toFormat(`${i} ${c}`),
406
+ formatted: m.toFormat(`${l} ${c}`),
407
407
  timestamp: m.toMillis(),
408
408
  dateTime: m
409
409
  };
410
- r(S);
410
+ i(D);
411
411
  }
412
- }, [n, b, r, i, c]), ne = j((y, m) => {
413
- const A = (n || J(v)).set({ hour: y, minute: m, second: 0 });
414
- if (f(A), r) {
415
- const Z = {
412
+ }, [t, M, i, l, c]), te = G((f, m) => {
413
+ const A = (t || H(k)).set({ hour: f, minute: m, second: 0 });
414
+ if (p(A), i) {
415
+ const z = {
416
416
  iso: A.toISO() || "",
417
- formatted: A.toFormat(`${i} ${c}`),
417
+ formatted: A.toFormat(`${l} ${c}`),
418
418
  timestamp: A.toMillis(),
419
419
  dateTime: A
420
420
  };
421
- r(Z);
421
+ i(z);
422
422
  }
423
- }, [n, v, r, i, c]), oe = j((y, m) => {
424
- const S = y.startOf("day"), A = m.startOf("day"), [Z, Y] = S <= A ? [S, A] : [A, S];
425
- if (C(Z), L(Y), _(Z), u) {
426
- const ce = V(Z, i, c), de = V(Y, i, c), he = Math.max(0, Math.ceil(Y.diff(Z, "days").days));
423
+ }, [t, k, i, l, c]), oe = G((f, m) => {
424
+ const D = f.startOf("day"), A = m.startOf("day"), [z, j] = D <= A ? [D, A] : [A, D];
425
+ if (C(z), W(j), Z(z), u) {
426
+ const ce = V(z, l, c), de = V(j, l, c), he = Math.max(0, Math.ceil(j.diff(z, "days").days));
427
427
  u({ start: ce, end: de, nights: he });
428
428
  }
429
- }, [u, i, c]), se = j((y) => {
430
- if (B(y), n) {
431
- const m = n.setZone(y);
432
- if (f(m), _(m), r) {
433
- const S = {
429
+ }, [u, l, c]), ae = G((f) => {
430
+ if (K(f), t) {
431
+ const m = t.setZone(f);
432
+ if (p(m), Z(m), i) {
433
+ const D = {
434
434
  iso: m.toISO() || "",
435
- formatted: m.toFormat(`${i} ${c}`),
435
+ formatted: m.toFormat(`${l} ${c}`),
436
436
  timestamp: m.toMillis(),
437
437
  dateTime: m
438
438
  };
439
- r(S);
439
+ i(D);
440
440
  }
441
441
  } else
442
- _(J(y));
443
- }, [n, r, i, c]), H = () => {
444
- k || g(!M);
445
- }, ae = (y) => {
446
- (y.key === "Enter" || y.key === " ") && (y.preventDefault(), H());
447
- }, re = l ? s && T ? `${s.toFormat("d MMM yyyy")} – ${T.toFormat("d MMM yyyy")}` : "" : n ? n.toFormat(`${i} ${b ? c : ""}`) : "", ie = N ? R(N, v) : void 0, le = d ? R(d, v) : void 0;
442
+ Z(H(f));
443
+ }, [t, i, l, c]), q = () => {
444
+ g || T(!b);
445
+ }, se = (f) => {
446
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), q());
447
+ }, ie = r ? a && N ? `${a.toFormat("d MMM yyyy")} – ${N.toFormat("d MMM yyyy")}` : "" : t ? t.toFormat(`${l} ${M ? c : ""}`) : "", le = v ? L(v, k) : void 0, re = d ? L(d, k) : void 0;
448
448
  return /* @__PURE__ */ h(
449
449
  "div",
450
450
  {
451
- ref: U,
452
- className: `chronos-picker ${W}`,
453
- "data-disabled": k,
451
+ ref: J,
452
+ className: `chronos-picker ${_}`,
453
+ "data-disabled": g,
454
454
  "data-theme": P,
455
455
  children: [
456
456
  /* @__PURE__ */ h(
457
457
  "div",
458
458
  {
459
459
  className: "chronos-input-wrapper",
460
- onClick: H,
460
+ onClick: q,
461
461
  children: [
462
462
  /* @__PURE__ */ o(
463
463
  "input",
464
464
  {
465
- ref: q,
465
+ ref: U,
466
466
  type: "text",
467
467
  className: "chronos-input",
468
- value: re,
469
- placeholder: p,
468
+ value: ie,
469
+ placeholder: y,
470
470
  readOnly: !0,
471
- disabled: k,
472
- onKeyDown: ae,
473
- "aria-label": z,
474
- "aria-expanded": M,
471
+ disabled: g,
472
+ onKeyDown: se,
473
+ "aria-label": R,
474
+ "aria-expanded": b,
475
475
  "aria-haspopup": "dialog",
476
476
  role: "combobox"
477
477
  }
@@ -496,57 +496,57 @@ const Te = ({
496
496
  ]
497
497
  }
498
498
  ),
499
- M && /* @__PURE__ */ o(
499
+ b && /* @__PURE__ */ o(
500
500
  "div",
501
501
  {
502
502
  className: "chronos-dropdown",
503
- "data-orientation": x,
504
- "data-range-mode": l,
503
+ "data-orientation": O,
504
+ "data-range-mode": r,
505
505
  role: "dialog",
506
506
  "aria-label": "Date and time picker dialog",
507
507
  children: /* @__PURE__ */ h("div", { className: "chronos-dropdown-content", children: [
508
- l && s && T && /* @__PURE__ */ h("div", { className: "chronos-range-summary", children: [
508
+ r && a && N && /* @__PURE__ */ h("div", { className: "chronos-range-summary", children: [
509
509
  /* @__PURE__ */ h("div", { className: "chronos-range-nights", children: [
510
- Math.max(0, Math.ceil(T.diff(s, "days").days)),
510
+ Math.max(0, Math.ceil(N.diff(a, "days").days)),
511
511
  " nights"
512
512
  ] }),
513
513
  /* @__PURE__ */ h("div", { className: "chronos-range-dates", children: [
514
- s.toFormat("d MMM yyyy"),
514
+ a.toFormat("d MMM yyyy"),
515
515
  " – ",
516
- T.toFormat("d MMM yyyy")
516
+ N.toFormat("d MMM yyyy")
517
517
  ] })
518
518
  ] }),
519
519
  /* @__PURE__ */ o(
520
- ye,
520
+ fe,
521
521
  {
522
522
  viewDate: ee,
523
- selectedDate: l ? null : n,
524
- onDateSelect: te,
525
- onViewDateChange: _,
526
- timezone: v,
527
- minDate: ie,
528
- maxDate: le,
529
- selectedStart: l ? s : void 0,
530
- selectedEnd: l ? T : void 0,
531
- onRangeSelect: l ? oe : void 0,
523
+ selectedDate: r ? null : t,
524
+ onDateSelect: ne,
525
+ onViewDateChange: Z,
526
+ timezone: k,
527
+ minDate: le,
528
+ maxDate: re,
529
+ selectedStart: r ? a : void 0,
530
+ selectedEnd: r ? N : void 0,
531
+ onRangeSelect: r ? oe : void 0,
532
532
  holidays: $
533
533
  }
534
534
  ),
535
- !l && (b || I) && /* @__PURE__ */ h("div", { className: "chronos-sidebar", children: [
536
- b && /* @__PURE__ */ o(
537
- Me,
535
+ !r && (M || E) && /* @__PURE__ */ h("div", { className: "chronos-sidebar", children: [
536
+ M && /* @__PURE__ */ o(
537
+ be,
538
538
  {
539
- value: n,
540
- onChange: ne,
541
- use24Hour: E,
542
- timezone: v
539
+ value: t,
540
+ onChange: te,
541
+ use24Hour: I,
542
+ timezone: k
543
543
  }
544
544
  ),
545
- I && /* @__PURE__ */ o(
546
- be,
545
+ E && /* @__PURE__ */ o(
546
+ Me,
547
547
  {
548
- value: v,
549
- onChange: se
548
+ value: k,
549
+ onChange: ae
550
550
  }
551
551
  )
552
552
  ] })
@@ -556,11 +556,45 @@ const Te = ({
556
556
  ]
557
557
  }
558
558
  );
559
- };
559
+ }, Te = [
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
+ ];
560
592
  export {
561
593
  X as COMMON_TIMEZONES,
562
594
  me as DEFAULT_TIMEZONE,
563
- Te as DateTimePicker,
564
- R as convertToTimezone,
565
- J as nowInTimezone
595
+ Ne as DateTimePicker,
596
+ Te as INDIAN_HOLIDAYS_2026,
597
+ we as LONG_WEEKENDS_2026,
598
+ L as convertToTimezone,
599
+ H as nowInTimezone
566
600
  };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(S,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):(S=typeof globalThis<"u"?globalThis:S||self,e(S.ChronosPicker={},S.jsxRuntime,S.React,S.luxon))})(this,function(S,e,c,D){"use strict";const G="Asia/Kolkata",U=[{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 w(s,r){return D.DateTime.isDateTime(s)?s.setZone(r):typeof s=="string"?D.DateTime.fromISO(s,{zone:r}):D.DateTime.fromJSDate(s,{zone:r})}function K(s){return D.DateTime.now().setZone(s)}function J(s){const a=D.DateTime.now().setZone(s).offset,l=Math.floor(Math.abs(a)/60),d=Math.abs(a)%60;return`UTC${a>=0?"+":"-"}${l}${d>0?`:${d.toString().padStart(2,"0")}`:""}`}function F(s,r,a,l,d,v,h,y,N){const b=D.DateTime.fromObject({year:s,month:r,day:1},{zone:a}),I=b.startOf("week"),Z=b.endOf("month").endOf("week"),P=D.DateTime.now().setZone(a).startOf("day"),z=h!=null&&y!=null,C=h==null?void 0:h.startOf("day"),$=y==null?void 0:y.endOf("day"),o=new Map;N&&N.forEach(M=>{let g;D.DateTime.isDateTime(M.date)?g=M.date.setZone(a):typeof M.date=="string"?g=D.DateTime.fromISO(M.date,{zone:a}):g=D.DateTime.fromJSDate(M.date,{zone:a}),o.set(g.toISODate()||"",{name:M.name,type:M.type||"national"})});const m=[];let E=[],i=I;for(;i<=Z;){const M=i.month===r,g=i.hasSame(P,"day"),t=i.startOf("day"),p=i.toISODate()||"";let n=!1,A=!1,k=!1,L=!1;z&&C&&$?(k=t.hasSame(C,"day"),L=t.hasSame($,"day"),A=t>=C&&t<=$||k||L,n=k||L):l&&(n=i.hasSame(l,"day"));let T=!1;d&&i<d.startOf("day")&&(T=!0),v&&i>v.endOf("day")&&(T=!0);const B=o.get(p);E.push({date:i,isCurrentMonth:M,isToday:g,isSelected:n,isDisabled:T,isInRange:A,isRangeStart:k,isRangeEnd:L,holiday:B?{date:i,...B}:void 0}),E.length===7&&(m.push(E),E=[]),i=i.plus({days:1})}return m}function V(){const s=D.DateTime.now().startOf("week"),r=[];for(let a=0;a<7;a++){const l=s.plus({days:a});r.push(l.toFormat("ccc"))}return r}function R(){const s=[];for(let r=1;r<=12;r++){const a=D.DateTime.fromObject({month:r});s.push(a.toFormat("MMMM"))}return s}const ee=({viewDate:s,selectedDate:r,onDateSelect:a,onViewDateChange:l,timezone:d,minDate:v,maxDate:h,selectedStart:y,selectedEnd:N,onRangeSelect:b,holidays:I})=>{const _=b!=null,Z=c.useMemo(()=>F(s.year,s.month,d,r??void 0,v,h,y??void 0,N??void 0,I),[s,r,d,v,h,y,N,I]),P=c.useMemo(()=>V(),[]),z=c.useMemo(()=>R(),[]),C=()=>{l(s.minus({months:1}))},$=()=>{l(s.plus({months:1}))},o=t=>{const p=parseInt(t.target.value,10);l(s.set({month:p}))},m=t=>{const p=parseInt(t.target.value,10);l(s.set({year:p}))},E=(t,p)=>{if(!p)if(_&&b){const n=t.startOf("day");if(y==null)b(t,t);else if(N!=null&&y.hasSame(N,"day")){const A=y.startOf("day");n<A?b(t,y):b(y,t)}else b(t,t)}else a(t)},i=(t,p,n)=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),E(p,n))},M=s.year,g=Array.from({length:21},(t,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:C,"aria-label":"Previous month",children:"‹"}),e.jsxs("div",{className:"chronos-month-year-selectors",children:[e.jsx("select",{className:"chronos-month-select",value:s.month,onChange:o,"aria-label":"Select month",children:z.map((t,p)=>e.jsx("option",{value:p+1,children:t},p))}),e.jsx("select",{className:"chronos-year-select",value:s.year,onChange:m,"aria-label":"Select year",children:g.map(t=>e.jsx("option",{value:t,children:t},t))})]}),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:P.map(t=>e.jsx("div",{className:"chronos-weekday",children:t},t))}),Z.map((t,p)=>e.jsx("div",{className:"chronos-week-row",children:t.map((n,A)=>e.jsxs("button",{type:"button",className:`chronos-day ${n.isSelected?"selected":""} ${n.isToday?"today":""} ${n.isCurrentMonth?"":"other-month"} ${n.isDisabled?"disabled":""} ${n.isInRange?"in-range":""} ${n.isRangeStart?"range-start":""} ${n.isRangeEnd?"range-end":""} ${n.holiday?`holiday ${n.holiday.type}`:""}`,onClick:()=>E(n.date,n.isDisabled),onKeyDown:k=>i(k,n.date,n.isDisabled),disabled:n.isDisabled,"aria-label":`${n.date.toFormat("MMMM d, yyyy")}${n.holiday?`, ${n.holiday.name}`:""}`,"aria-selected":n.isSelected,"aria-current":n.isToday?"date":void 0,title:n.holiday?n.holiday.name:void 0,children:[n.date.day,n.holiday&&e.jsx("span",{className:"chronos-holiday-dot"})]},A))},p))]})]})},se=({value:s,onChange:r,use24Hour:a})=>{const[l,d]=c.useState((s==null?void 0:s.hour)??12),[v,h]=c.useState((s==null?void 0:s.minute)??0),[y,N]=c.useState(s&&s.hour>=12?"PM":"AM");c.useEffect(()=>{s&&(d(s.hour),h(s.minute),N(s.hour>=12?"PM":"AM"))},[s]);const b=o=>{d(o);let m=o;a||(y==="PM"&&o!==12?m=o+12:y==="AM"&&o===12&&(m=0)),r(m,v)},I=o=>{h(o),r(l,o)},_=()=>{const o=y==="AM"?"PM":"AM";N(o);let m=l;o==="PM"&&l!==12?m=l+12:o==="AM"&&l===12?m=0:o==="AM"&&l>12&&(m=l-12),r(m,v)},Z=a?l:l%12||12,P=a?23:12,z=a?0:1,C=Array.from({length:P-z+1},(o,m)=>z+m),$=Array.from({length:60},(o,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:o=>b(parseInt(o.target.value,10)),"aria-label":"Select hour",children:C.map(o=>e.jsx("option",{value:o,children:o.toString().padStart(2,"0")},o))})]}),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:o=>I(parseInt(o.target.value,10)),"aria-label":"Select minute",children:$.map(o=>e.jsx("option",{value:o,children:o.toString().padStart(2,"0")},o))})]}),!a&&e.jsx("button",{type:"button",className:"chronos-period-toggle",onClick:_,"aria-label":`Switch to ${y==="AM"?"PM":"AM"}`,children:y})]})]})},oe=({value:s,onChange:r})=>{const[a,l]=c.useState(!1),d=U.find(h=>h.value===s)||{label:s},v=h=>{r(h),l(!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:()=>l(!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:J(s)}),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:U.map(h=>e.jsxs("button",{type:"button",className:`chronos-timezone-option ${h.value===s?"selected":""}`,onClick:()=>v(h.value),role:"option","aria-selected":h.value===s,children:[e.jsx("span",{className:"chronos-timezone-option-label",children:h.label}),e.jsx("span",{className:"chronos-timezone-option-offset",children:J(h.value)})]},h.value))})]})};function H(s,r,a){return{iso:s.toISO()||"",formatted:s.toFormat(`${r} ${a}`),timestamp:s.toMillis(),dateTime:s}}const te=({value:s,onChange:r,timezone:a=G,dateFormat:l="DD",timeFormat:d="HH:mm",minDate:v,maxDate:h,placeholder:y="Select date and time",disabled:N=!1,showTime:b=!0,use24Hour:I=!0,className:_="",ariaLabel:Z="Date and time picker",showTimezoneSelector:P=!1,theme:z="light",orientation:C="portrait",selectionMode:$="single",rangeValue:o,onRangeChange:m,holidays:E})=>{const i=$==="range",[M,g]=c.useState(!1),[t,p]=c.useState(()=>!i&&s?w(s,a):null),[n,A]=c.useState(()=>i&&(o!=null&&o.start)?w(o.start,a):null),[k,L]=c.useState(()=>i&&(o!=null&&o.end)?w(o.end,a):null),[T,B]=c.useState(a),[ne,W]=c.useState(()=>t||n||k||K(a)),Y=c.useRef(null),Q=c.useRef(null);c.useEffect(()=>{!i&&s&&p(w(s,T))},[s,T,i]),c.useEffect(()=>{i&&(o==null?void 0:o.start)!=null&&(o==null?void 0:o.end)!=null&&(A(w(o.start,T)),L(w(o.end,T)))},[i,o,T]),c.useEffect(()=>{const u=f=>{Y.current&&!Y.current.contains(f.target)&&g(!1)};if(M)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[M]),c.useEffect(()=>{const u=f=>{var O;f.key==="Escape"&&M&&(g(!1),(O=Q.current)==null||O.focus())};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[M]);const ae=c.useCallback(u=>{let f=u;if(t&&(f=u.set({hour:t.hour,minute:t.minute,second:t.second})),p(f),W(f),b||g(!1),r){const O={iso:f.toISO()||"",formatted:f.toFormat(`${l} ${d}`),timestamp:f.toMillis(),dateTime:f};r(O)}},[t,b,r,l,d]),re=c.useCallback((u,f)=>{const x=(t||K(T)).set({hour:u,minute:f,second:0});if(p(x),r){const j={iso:x.toISO()||"",formatted:x.toFormat(`${l} ${d}`),timestamp:x.toMillis(),dateTime:x};r(j)}},[t,T,r,l,d]),le=c.useCallback((u,f)=>{const O=u.startOf("day"),x=f.startOf("day"),[j,q]=O<=x?[O,x]:[x,O];if(A(j),L(q),W(j),m){const me=H(j,l,d),pe=H(q,l,d),ye=Math.max(0,Math.ceil(q.diff(j,"days").days));m({start:me,end:pe,nights:ye})}},[m,l,d]),ie=c.useCallback(u=>{if(B(u),t){const f=t.setZone(u);if(p(f),W(f),r){const O={iso:f.toISO()||"",formatted:f.toFormat(`${l} ${d}`),timestamp:f.toMillis(),dateTime:f};r(O)}}else W(K(u))},[t,r,l,d]),X=()=>{N||g(!M)},ce=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),X())},de=i?n&&k?`${n.toFormat("d MMM yyyy")} – ${k.toFormat("d MMM yyyy")}`:"":t?t.toFormat(`${l} ${b?d:""}`):"",he=v?w(v,T):void 0,fe=h?w(h,T):void 0;return e.jsxs("div",{ref:Y,className:`chronos-picker ${_}`,"data-disabled":N,"data-theme":z,children:[e.jsxs("div",{className:"chronos-input-wrapper",onClick:X,children:[e.jsx("input",{ref:Q,type:"text",className:"chronos-input",value:de,placeholder:y,readOnly:!0,disabled:N,onKeyDown:ce,"aria-label":Z,"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":C,"data-range-mode":i,role:"dialog","aria-label":"Date and time picker dialog",children:e.jsxs("div",{className:"chronos-dropdown-content",children:[i&&n&&k&&e.jsxs("div",{className:"chronos-range-summary",children:[e.jsxs("div",{className:"chronos-range-nights",children:[Math.max(0,Math.ceil(k.diff(n,"days").days))," nights"]}),e.jsxs("div",{className:"chronos-range-dates",children:[n.toFormat("d MMM yyyy")," – ",k.toFormat("d MMM yyyy")]})]}),e.jsx(ee,{viewDate:ne,selectedDate:i?null:t,onDateSelect:ae,onViewDateChange:W,timezone:T,minDate:he,maxDate:fe,selectedStart:i?n:void 0,selectedEnd:i?k:void 0,onRangeSelect:i?le:void 0,holidays:E}),!i&&(b||P)&&e.jsxs("div",{className:"chronos-sidebar",children:[b&&e.jsx(se,{value:t,onChange:re,use24Hour:I,timezone:T}),P&&e.jsx(oe,{value:T,onChange:ie})]})]})})]})};S.COMMON_TIMEZONES=U,S.DEFAULT_TIMEZONE=G,S.DateTimePicker=te,S.convertToTimezone=w,S.nowInTimezone=K,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
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"})});
@@ -0,0 +1,5 @@
1
+ import { Holiday } from '../types';
2
+
3
+ export declare const INDIAN_HOLIDAYS_2026: Holiday[];
4
+ export declare const LONG_WEEKENDS_2026: Holiday[];
5
+ //# sourceMappingURL=holidays.d.ts.map
@@ -0,0 +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,4 +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';
5
+ export type { Holiday } from './types';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChF,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theengineerguy/chronos-picker",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A modern, accessible date & time picker with comprehensive timezone support",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",