@himal_bhattarai/nepali-datepicker 1.0.0 → 1.1.0

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.
@@ -1,66 +1,66 @@
1
- import ye, { useState as R, useRef as le, useEffect as ie, useCallback as we } from "react";
2
- var Q = { exports: {} }, B = {};
3
- var ce;
4
- function ke() {
5
- if (ce) return B;
6
- ce = 1;
7
- var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), c = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function b(p, s, i) {
9
- var d = null;
10
- if (i !== void 0 && (d = "" + i), s.key !== void 0 && (d = "" + s.key), "key" in s) {
1
+ import je, { useState as C, useRef as ce, useEffect as de, useCallback as _e } from "react";
2
+ var Q = { exports: {} }, W = {};
3
+ var pe;
4
+ function Ee() {
5
+ if (pe) return W;
6
+ pe = 1;
7
+ var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function b(c, d, i) {
9
+ var x = null;
10
+ if (i !== void 0 && (x = "" + i), d.key !== void 0 && (x = "" + d.key), "key" in d) {
11
11
  i = {};
12
- for (var u in s)
13
- u !== "key" && (i[u] = s[u]);
14
- } else i = s;
15
- return s = i.ref, {
12
+ for (var a in d)
13
+ a !== "key" && (i[a] = d[a]);
14
+ } else i = d;
15
+ return d = i.ref, {
16
16
  $$typeof: n,
17
- type: p,
18
- key: d,
19
- ref: s !== void 0 ? s : null,
17
+ type: c,
18
+ key: x,
19
+ ref: d !== void 0 ? d : null,
20
20
  props: i
21
21
  };
22
22
  }
23
- return B.Fragment = c, B.jsx = b, B.jsxs = b, B;
23
+ return W.Fragment = l, W.jsx = b, W.jsxs = b, W;
24
24
  }
25
- var I = {};
26
- var pe;
27
- function je() {
28
- return pe || (pe = 1, process.env.NODE_ENV !== "production" && (function() {
25
+ var V = {};
26
+ var ue;
27
+ function Se() {
28
+ return ue || (ue = 1, process.env.NODE_ENV !== "production" && (function() {
29
29
  function n(e) {
30
30
  if (e == null) return null;
31
31
  if (typeof e == "function")
32
- return e.$$typeof === C ? null : e.displayName || e.name || null;
32
+ return e.$$typeof === te ? null : e.displayName || e.name || null;
33
33
  if (typeof e == "string") return e;
34
34
  switch (e) {
35
- case x:
35
+ case w:
36
36
  return "Fragment";
37
- case h:
37
+ case g:
38
38
  return "Profiler";
39
- case N:
39
+ case D:
40
40
  return "StrictMode";
41
- case re:
41
+ case Y:
42
42
  return "Suspense";
43
- case ne:
43
+ case $:
44
44
  return "SuspenseList";
45
- case U:
45
+ case ne:
46
46
  return "Activity";
47
47
  }
48
48
  if (typeof e == "object")
49
49
  switch (typeof e.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
51
  ), e.$$typeof) {
52
- case S:
52
+ case R:
53
53
  return "Portal";
54
- case A:
54
+ case h:
55
55
  return e.displayName || "Context";
56
- case k:
56
+ case N:
57
57
  return (e._context.displayName || "Context") + ".Consumer";
58
- case O:
58
+ case y:
59
59
  var o = e.render;
60
60
  return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
- case te:
61
+ case re:
62
62
  return o = e.displayName || null, o !== null ? o : n(e.type) || "Memo";
63
- case P:
63
+ case B:
64
64
  o = e._payload, e = e._init;
65
65
  try {
66
66
  return n(e(o));
@@ -69,29 +69,29 @@ function je() {
69
69
  }
70
70
  return null;
71
71
  }
72
- function c(e) {
72
+ function l(e) {
73
73
  return "" + e;
74
74
  }
75
75
  function b(e) {
76
76
  try {
77
- c(e);
77
+ l(e);
78
78
  var o = !1;
79
79
  } catch {
80
80
  o = !0;
81
81
  }
82
82
  if (o) {
83
83
  o = console;
84
- var a = o.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
- return a.call(
84
+ var s = o.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
+ return s.call(
86
86
  o,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
- l
89
- ), c(e);
88
+ p
89
+ ), l(e);
90
90
  }
91
91
  }
92
- function p(e) {
93
- if (e === x) return "<>";
94
- if (typeof e == "object" && e !== null && e.$$typeof === P)
92
+ function c(e) {
93
+ if (e === w) return "<>";
94
+ if (typeof e == "object" && e !== null && e.$$typeof === B)
95
95
  return "<...>";
96
96
  try {
97
97
  var o = n(e);
@@ -100,49 +100,49 @@ function je() {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
- function s() {
104
- var e = Y.A;
103
+ function d() {
104
+ var e = A.A;
105
105
  return e === null ? null : e.getOwner();
106
106
  }
107
107
  function i() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
- function d(e) {
111
- if (X.call(e, "key")) {
110
+ function x(e) {
111
+ if (O.call(e, "key")) {
112
112
  var o = Object.getOwnPropertyDescriptor(e, "key").get;
113
113
  if (o && o.isReactWarning) return !1;
114
114
  }
115
115
  return e.key !== void 0;
116
116
  }
117
- function u(e, o) {
118
- function a() {
117
+ function a(e, o) {
118
+ function s() {
119
119
  q || (q = !0, console.error(
120
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
121
  o
122
122
  ));
123
123
  }
124
- a.isReactWarning = !0, Object.defineProperty(e, "key", {
125
- get: a,
124
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
125
+ get: s,
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function g() {
129
+ function f() {
130
130
  var e = n(this.type);
131
- return ae[e] || (ae[e] = !0, console.error(
131
+ return J[e] || (J[e] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
133
  )), e = this.props.ref, e !== void 0 ? e : null;
134
134
  }
135
- function j(e, o, a, l, $, L) {
136
- var f = a.ref;
135
+ function j(e, o, s, p, T, P) {
136
+ var u = s.ref;
137
137
  return e = {
138
- $$typeof: E,
138
+ $$typeof: M,
139
139
  type: e,
140
140
  key: o,
141
- props: a,
142
- _owner: l
143
- }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
141
+ props: s,
142
+ _owner: p
143
+ }, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
144
144
  enumerable: !1,
145
- get: g
145
+ get: f
146
146
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
@@ -157,109 +157,109 @@ function je() {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: $
160
+ value: T
161
161
  }), Object.defineProperty(e, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: L
165
+ value: P
166
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
167
  }
168
- function v(e, o, a, l, $, L) {
169
- var f = o.children;
170
- if (f !== void 0)
171
- if (l)
172
- if (oe(f)) {
173
- for (l = 0; l < f.length; l++)
174
- y(f[l]);
175
- Object.freeze && Object.freeze(f);
168
+ function _(e, o, s, p, T, P) {
169
+ var u = o.children;
170
+ if (u !== void 0)
171
+ if (p)
172
+ if (oe(u)) {
173
+ for (p = 0; p < u.length; p++)
174
+ E(u[p]);
175
+ Object.freeze && Object.freeze(u);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else y(f);
181
- if (X.call(o, "key")) {
182
- f = n(e);
183
- var _ = Object.keys(o).filter(function(se) {
180
+ else E(u);
181
+ if (O.call(o, "key")) {
182
+ u = n(e);
183
+ var k = Object.keys(o).filter(function(se) {
184
184
  return se !== "key";
185
185
  });
186
- l = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", Z[f + l] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ p = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", Z[u + p] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
190
190
  React keys must be passed directly to JSX without using spread:
191
191
  let props = %s;
192
192
  <%s key={someKey} {...props} />`,
193
- l,
194
- f,
195
- _,
196
- f
197
- ), Z[f + l] = !0);
193
+ p,
194
+ u,
195
+ k,
196
+ u
197
+ ), Z[u + p] = !0);
198
198
  }
199
- if (f = null, a !== void 0 && (b(a), f = "" + a), d(o) && (b(o.key), f = "" + o.key), "key" in o) {
200
- a = {};
201
- for (var T in o)
202
- T !== "key" && (a[T] = o[T]);
203
- } else a = o;
204
- return f && u(
205
- a,
199
+ if (u = null, s !== void 0 && (b(s), u = "" + s), x(o) && (b(o.key), u = "" + o.key), "key" in o) {
200
+ s = {};
201
+ for (var z in o)
202
+ z !== "key" && (s[z] = o[z]);
203
+ } else s = o;
204
+ return u && a(
205
+ s,
206
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
207
  ), j(
208
208
  e,
209
- f,
210
- a,
211
- s(),
212
- $,
213
- L
209
+ u,
210
+ s,
211
+ d(),
212
+ T,
213
+ P
214
214
  );
215
215
  }
216
- function y(e) {
217
- D(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? D(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
216
+ function E(e) {
217
+ S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === B && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
218
  }
219
- function D(e) {
220
- return typeof e == "object" && e !== null && e.$$typeof === E;
219
+ function S(e) {
220
+ return typeof e == "object" && e !== null && e.$$typeof === M;
221
221
  }
222
- var w = ye, E = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), N = /* @__PURE__ */ Symbol.for("react.strict_mode"), h = /* @__PURE__ */ Symbol.for("react.profiler"), k = /* @__PURE__ */ Symbol.for("react.consumer"), A = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), re = /* @__PURE__ */ Symbol.for("react.suspense"), ne = /* @__PURE__ */ Symbol.for("react.suspense_list"), te = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), U = /* @__PURE__ */ Symbol.for("react.activity"), C = /* @__PURE__ */ Symbol.for("react.client.reference"), Y = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, oe = Array.isArray, M = console.createTask ? console.createTask : function() {
222
+ var v = je, M = /* @__PURE__ */ Symbol.for("react.transitional.element"), R = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), D = /* @__PURE__ */ Symbol.for("react.strict_mode"), g = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), Y = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), te = /* @__PURE__ */ Symbol.for("react.client.reference"), A = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, oe = Array.isArray, L = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- w = {
225
+ v = {
226
226
  react_stack_bottom_frame: function(e) {
227
227
  return e();
228
228
  }
229
229
  };
230
- var q, ae = {}, J = w.react_stack_bottom_frame.bind(
231
- w,
230
+ var q, J = {}, H = v.react_stack_bottom_frame.bind(
231
+ v,
232
232
  i
233
- )(), H = M(p(i)), Z = {};
234
- I.Fragment = x, I.jsx = function(e, o, a) {
235
- var l = 1e4 > Y.recentlyCreatedOwnerStacks++;
236
- return v(
233
+ )(), ae = L(c(i)), Z = {};
234
+ V.Fragment = w, V.jsx = function(e, o, s) {
235
+ var p = 1e4 > A.recentlyCreatedOwnerStacks++;
236
+ return _(
237
237
  e,
238
238
  o,
239
- a,
239
+ s,
240
240
  !1,
241
- l ? Error("react-stack-top-frame") : J,
242
- l ? M(p(e)) : H
241
+ p ? Error("react-stack-top-frame") : H,
242
+ p ? L(c(e)) : ae
243
243
  );
244
- }, I.jsxs = function(e, o, a) {
245
- var l = 1e4 > Y.recentlyCreatedOwnerStacks++;
246
- return v(
244
+ }, V.jsxs = function(e, o, s) {
245
+ var p = 1e4 > A.recentlyCreatedOwnerStacks++;
246
+ return _(
247
247
  e,
248
248
  o,
249
- a,
249
+ s,
250
250
  !0,
251
- l ? Error("react-stack-top-frame") : J,
252
- l ? M(p(e)) : H
251
+ p ? Error("react-stack-top-frame") : H,
252
+ p ? L(c(e)) : ae
253
253
  );
254
254
  };
255
- })()), I;
255
+ })()), V;
256
256
  }
257
257
  var fe;
258
- function _e() {
259
- return fe || (fe = 1, process.env.NODE_ENV === "production" ? Q.exports = ke() : Q.exports = je()), Q.exports;
258
+ function Ne() {
259
+ return fe || (fe = 1, process.env.NODE_ENV === "production" ? Q.exports = Ee() : Q.exports = Se()), Q.exports;
260
260
  }
261
- var r = _e();
262
- const G = {
261
+ var r = Ne();
262
+ const X = {
263
263
  2e3: [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
264
264
  2001: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
265
265
  2002: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
@@ -352,56 +352,63 @@ const G = {
352
352
  2089: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
353
353
  2090: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30]
354
354
  }, ee = new Date(1943, 3, 14);
355
- function Ee(n, c, b) {
356
- let p = 0;
355
+ function Te(n, l, b) {
356
+ let c = 0;
357
357
  for (let i = 2e3; i < n; i++) {
358
- const d = G[i];
359
- d && (p += d.reduce((u, g) => u + g, 0));
358
+ const x = X[i];
359
+ x && (c += x.reduce((a, f) => a + f, 0));
360
360
  }
361
- const s = G[n] || [];
362
- for (let i = 0; i < c - 1; i++) p += s[i] || 30;
363
- return p + b - 1;
361
+ const d = X[n] || [];
362
+ for (let i = 0; i < l - 1; i++) c += d[i] || 30;
363
+ return c + b - 1;
364
364
  }
365
- function V(n, c, b) {
366
- const p = new Date(ee);
367
- return p.setDate(p.getDate() + Ee(n, c, b)), p;
365
+ function U(n, l, b) {
366
+ const c = new Date(ee);
367
+ return c.setDate(c.getDate() + Te(n, l, b)), c;
368
368
  }
369
- function Ne(n) {
370
- const c = new Date(n.getFullYear(), n.getMonth(), n.getDate()), b = new Date(ee.getFullYear(), ee.getMonth(), ee.getDate());
371
- let p = Math.round((c - b) / 864e5), s = 2e3;
372
- for (; s <= 2090; ) {
373
- const u = G[s], g = u ? u.reduce((j, v) => j + v, 0) : 365;
374
- if (p < g) break;
375
- p -= g, s++;
369
+ function Re(n) {
370
+ const l = new Date(n.getFullYear(), n.getMonth(), n.getDate()), b = new Date(ee.getFullYear(), ee.getMonth(), ee.getDate());
371
+ let c = Math.round((l - b) / 864e5), d = 2e3;
372
+ for (; d <= 2090; ) {
373
+ const a = X[d], f = a ? a.reduce((j, _) => j + _, 0) : 365;
374
+ if (c < f) break;
375
+ c -= f, d++;
376
376
  }
377
- const i = G[s] || [];
378
- let d = 1;
379
- for (let u = 0; u < 12; u++) {
380
- const g = i[u] || 30;
381
- if (p < g) {
382
- d = u + 1;
377
+ const i = X[d] || [];
378
+ let x = 1;
379
+ for (let a = 0; a < 12; a++) {
380
+ const f = i[a] || 30;
381
+ if (c < f) {
382
+ x = a + 1;
383
383
  break;
384
384
  }
385
- p -= g, u === 11 && (d = 12);
385
+ c -= f, a === 11 && (x = 12);
386
386
  }
387
- return { year: s, month: d, day: p + 1 };
387
+ return { year: d, month: x, day: c + 1 };
388
388
  }
389
389
  function K() {
390
- return Ne(/* @__PURE__ */ new Date());
390
+ return Re(/* @__PURE__ */ new Date());
391
391
  }
392
- function ue(n, c) {
393
- return (G[n] || [])[c - 1] || 30;
392
+ function me(n, l) {
393
+ return (X[n] || [])[l - 1] || 30;
394
394
  }
395
- function Se(n, c) {
396
- return V(n, c, 1).getDay();
395
+ function De(n, l) {
396
+ return U(n, l, 1).getDay();
397
397
  }
398
- const me = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], he = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Te = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Re = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], De = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], W = (n) => String(n).split("").map((c) => De[+c] ?? c).join(""), Ae = (n) => n ? n.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }) : "", Oe = `
398
+ const he = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], xe = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ae = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Oe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Pe = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], G = (n) => String(n).split("").map((l) => Pe[+l] ?? l).join(""), Ce = (n) => n ? n.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }) : "", Me = `
399
399
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
400
400
 
401
401
  .ndp{
402
- --pr:#C0392B; --prs:#fff0ee; --acs:#fffaee;
403
- --sf:#fff; --tx:#1A1208; --txm:#8C7B6B; --bd:#E8DED0;
404
- --r:16px; --sh:0 24px 64px rgba(0,0,0,0.13),0 4px 16px rgba(0,0,0,0.07);
402
+ --ndp-primary: #C0392B;
403
+ --ndp-primary-soft: #fff0ee;
404
+ --ndp-controls-bg: #fffaee;
405
+ --ndp-background: #fff;
406
+ --ndp-text: #1A1208;
407
+ --ndp-text-muted: #8C7B6B;
408
+ --ndp-border: #E8DED0;
409
+ --ndp-today-bg: #fde8e6;
410
+ --ndp-radius: 16px;
411
+ --ndp-shadow: 0 24px 64px rgba(0,0,0,0.13),0 4px 16px rgba(0,0,0,0.07);
405
412
  font-family:'DM Sans',sans-serif;
406
413
  position:relative; display:inline-block;
407
414
  }
@@ -412,24 +419,24 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
412
419
  .ndp-input{
413
420
  width:100%; min-width:270px;
414
421
  padding:13px 48px 13px 17px;
415
- border:2px solid var(--bd); border-radius:13px;
416
- background:var(--sf); color:var(--tx);
422
+ border:2px solid var(--ndp-border); border-radius:13px;
423
+ background:var(--ndp-background); color:var(--tx);
417
424
  font-family:'DM Sans',sans-serif; font-size:15px;
418
425
  cursor:pointer; outline:none;
419
426
  transition:border-color .2s,box-shadow .2s;
420
427
  caret-color:transparent;
421
428
  }
422
- .ndp-input::placeholder{color:var(--txm);}
423
- .ndp-input.open{border-color:var(--pr);box-shadow:0 0 0 4px rgba(192,57,43,.11);}
424
- .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--txm);transition:color .2s;}
425
- .ndp-input.open ~ .ndp-icon{color:var(--pr);}
429
+ .ndp-input::placeholder{color:var(--ndp-text-muted);}
430
+ .ndp-input.open{border-color:var(--ndp-primary);box-shadow:0 0 0 4px rgba(192,57,43,.11);}
431
+ .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--ndp-text-muted);transition:color .2s;}
432
+ .ndp-input.open ~ .ndp-icon{color:var(--ndp-primary);}
426
433
 
427
434
  /* Popup */
428
435
  .ndp-popup{
429
436
  position:absolute; top:calc(100% + 9px); left:0; z-index:9999;
430
437
  width:336px;
431
- background:var(--sf); border-radius:var(--r);
432
- box-shadow:var(--sh); border:1px solid var(--bd);
438
+ background:var(--ndp-background); border-radius:var(--r);
439
+ box-shadow:var(--sh); border:1px solid var(--ndp-border);
433
440
  overflow:hidden;
434
441
  animation:ndp-pop .18s cubic-bezier(.34,1.56,.64,1);
435
442
  transform-origin:top left;
@@ -441,7 +448,7 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
441
448
  .ndp-slide-right{animation:ndp-slide-right .2s cubic-bezier(.25,.8,.25,1);}
442
449
 
443
450
  /* Header */
444
- .ndp-hd{background:var(--pr);padding:14px;color:#fff;}
451
+ .ndp-hd{background:var(--ndp-primary);padding:14px;color:#fff;}
445
452
  .ndp-hd-row{display:flex;align-items:center;justify-content:space-between;}
446
453
  .ndp-nav{
447
454
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
@@ -456,13 +463,13 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
456
463
  /* Custom dropdowns */
457
464
  .ndp-controls{
458
465
  display:flex;gap:6px;padding:9px 12px;
459
- background:var(--acs);border-bottom:1px solid var(--bd);
466
+ background:var(--ndp-controls-bg);border-bottom:1px solid var(--ndp-border);
460
467
  position:relative;z-index:10;
461
468
  }
462
469
  .ndp-dd{position:relative;flex:1;}
463
470
  .ndp-dd-trigger{
464
471
  width:100%;padding:6px 28px 6px 10px;
465
- border:1px solid var(--bd);border-radius:8px;
472
+ border:1px solid var(--ndp-border);border-radius:8px;
466
473
  background:#fff;color:var(--tx);
467
474
  font-family:'Noto Sans Devanagari',sans-serif;font-size:13px;font-weight:500;
468
475
  cursor:pointer;outline:none;
@@ -472,17 +479,17 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
472
479
  position:relative;
473
480
  }
474
481
  .ndp-dd-trigger:hover{border-color:#c8b8a8;}
475
- .ndp-dd-trigger.active{border-color:var(--pr);box-shadow:0 0 0 3px rgba(192,57,43,.10);}
482
+ .ndp-dd-trigger.active{border-color:var(--ndp-primary);box-shadow:0 0 0 3px rgba(192,57,43,.10);}
476
483
  .ndp-dd-arrow{
477
484
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
478
- pointer-events:none;color:var(--txm);transition:transform .18s;flex-shrink:0;
485
+ pointer-events:none;color:var(--ndp-text-muted);transition:transform .18s;flex-shrink:0;
479
486
  }
480
487
  .ndp-dd-trigger.active .ndp-dd-arrow{transform:translateY(-50%) rotate(180deg);}
481
488
 
482
489
  .ndp-dd-panel{
483
490
  position:absolute;top:calc(100% + 5px);left:0;
484
491
  min-width:100%;
485
- background:#fff;border:1px solid var(--bd);border-radius:10px;
492
+ background:#fff;border:1px solid var(--ndp-border);border-radius:10px;
486
493
  box-shadow:0 8px 28px rgba(0,0,0,0.13);
487
494
  z-index:999;overflow:hidden;
488
495
  animation:ndp-dd-in .15s cubic-bezier(.25,.8,.25,1);
@@ -502,16 +509,16 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
502
509
  transition:background .12s,color .12s;
503
510
  white-space:nowrap;
504
511
  }
505
- .ndp-dd-month-item:hover{background:var(--prs);color:var(--pr);}
506
- .ndp-dd-month-item.sel{background:var(--pr);color:#fff;font-weight:700;}
512
+ .ndp-dd-month-item:hover{background:var(--ndp-primary-soft);color:var(--ndp-primary);}
513
+ .ndp-dd-month-item.sel{background:var(--ndp-primary);color:#fff;font-weight:700;}
507
514
 
508
515
  /* Year panel: scrollable list */
509
516
  .ndp-dd-years{
510
517
  max-height:180px;overflow-y:auto;padding:5px;
511
- scrollbar-width:thin;scrollbar-color:var(--bd) transparent;
518
+ scrollbar-width:thin;scrollbar-color:var(--ndp-border) transparent;
512
519
  }
513
520
  .ndp-dd-years::-webkit-scrollbar{width:4px;}
514
- .ndp-dd-years::-webkit-scrollbar-thumb{background:var(--bd);border-radius:4px;}
521
+ .ndp-dd-years::-webkit-scrollbar-thumb{background:var(--ndp-border);border-radius:4px;}
515
522
  .ndp-dd-year-item{
516
523
  padding:7px 14px;border-radius:7px;cursor:pointer;border:none;background:transparent;
517
524
  font-family:'DM Sans',sans-serif;font-size:13px;font-weight:500;color:var(--tx);
@@ -519,18 +526,18 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
519
526
  transition:background .12s,color .12s;
520
527
  display:block;
521
528
  }
522
- .ndp-dd-year-item:hover{background:var(--prs);color:var(--pr);}
523
- .ndp-dd-year-item.sel{background:var(--pr);color:#fff;font-weight:700;}
529
+ .ndp-dd-year-item:hover{background:var(--ndp-primary-soft);color:var(--ndp-primary);}
530
+ .ndp-dd-year-item.sel{background:var(--ndp-primary);color:#fff;font-weight:700;}
524
531
 
525
532
  /* Grid — FIXED 6 rows so height never changes between months */
526
533
  .ndp-body{padding:10px 10px 6px;}
527
534
  .ndp-wdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px;}
528
535
  .ndp-wday{
529
536
  text-align:center;font-size:10.5px;font-weight:600;
530
- letter-spacing:.04em;color:var(--txm);padding:3px 0;
537
+ letter-spacing:.04em;color:var(--ndp-text-muted);padding:3px 0;
531
538
  font-family:'Noto Sans Devanagari',sans-serif;
532
539
  }
533
- .ndp-wday:last-child{color:var(--pr);}
540
+ .ndp-wday:last-child{color:var(--ndp-primary);}
534
541
 
535
542
  .ndp-grid{
536
543
  display:grid;
@@ -547,96 +554,109 @@ const me = ["बैशाख", "जेठ", "असार", "श्रावण"
547
554
  font-weight:500;width:100%;
548
555
  }
549
556
  .ndp-cell.blank{cursor:default;pointer-events:none;}
550
- .ndp-cell.overflow{color:var(--bd);cursor:default;pointer-events:none;}
551
- .ndp-cell.wknd{color:var(--pr);}
557
+ .ndp-cell.overflow{color:var(--ndp-border);cursor:default;pointer-events:none;}
558
+ .ndp-cell.wknd{color:var(--ndp-primary);}
552
559
  .ndp-cell.today:not(.picked){
553
- background:#fde8e6;
554
- font-weight:700;color:var(--pr);
560
+ background:var(--ndp-today-bg);
561
+ font-weight:700;color:var(--ndp-primary);
555
562
  }
556
563
  .ndp-cell.picked{
557
- background:var(--pr);color:#fff;font-weight:700;
564
+ background:var(--ndp-primary);color:#fff;font-weight:700;
558
565
  box-shadow:0 3px 10px rgba(192,57,43,.35);
559
566
  }
560
567
  .ndp-cell:hover:not(.overflow):not(.picked){
561
- background:var(--prs);color:var(--pr);
568
+ background:var(--ndp-primary-soft);color:var(--ndp-primary);
562
569
  }
563
570
 
564
571
  /* Footer */
565
572
  .ndp-ft{
566
573
  padding:9px 12px 12px;
567
- border-top:1px solid var(--bd);
574
+ border-top:1px solid var(--ndp-border);
568
575
  display:flex;align-items:center;justify-content:space-between;gap:8px;
569
576
  }
570
- .ndp-ad{font-size:12px;color:var(--txm);}
577
+ .ndp-ad{font-size:12px;color:var(--ndp-text-muted);}
571
578
  .ndp-ad b{color:var(--tx);}
572
579
  .ndp-today-btn{
573
580
  font-size:12px;padding:5px 13px;
574
- background:var(--acs);color:#9A7000;
581
+ background:var(--ndp-controls-bg);color:#9A7000;
575
582
  border:1px solid #F0D090;border-radius:8px;
576
583
  cursor:pointer;font-family:'DM Sans',sans-serif;font-weight:600;
577
584
  transition:background .15s;white-space:nowrap;
578
585
  }
579
586
  .ndp-today-btn:hover{background:#FDEECA;}
580
587
  `;
581
- let xe = !1;
582
- function Pe() {
583
- if (!xe && typeof document < "u") {
588
+ let ge = !1;
589
+ function Ye() {
590
+ if (!ge && typeof document < "u") {
584
591
  const n = document.createElement("style");
585
- n.textContent = Oe, document.head.appendChild(n), xe = !0;
592
+ n.textContent = Me, document.head.appendChild(n), ge = !0;
586
593
  }
587
594
  }
588
- function Me({
595
+ function Le({
589
596
  value: n,
590
- onChange: c,
597
+ onChange: l,
591
598
  language: b = "np",
592
- placeholder: p,
593
- minYear: s = 2060,
594
- maxYear: i = 2090
599
+ placeholder: c,
600
+ minYear: d = 2060,
601
+ maxYear: i = 2090,
602
+ className: x = "",
603
+ styles: a = {}
595
604
  }) {
596
- Pe();
597
- const d = b !== "en", u = K(), [g, j] = R(!1), [v, y] = R(null), [D, w] = R(!1), [E, S] = R(!1), [x, N] = R(() => n?.year ?? K().year), [h, k] = R(() => n?.month ?? K().month), A = le(null), O = le(null);
598
- ie(() => {
605
+ Ye();
606
+ const f = b !== "en", j = K(), [_, E] = C(!1), [S, v] = C(null), [M, R] = C(!1), [w, D] = C(!1), [g, N] = C(() => n?.year ?? K().year), [h, y] = C(() => n?.month ?? K().month), Y = ce(null), $ = ce(null);
607
+ de(() => {
599
608
  const t = (m) => {
600
- A.current && !A.current.contains(m.target) && (j(!1), w(!1), S(!1));
609
+ Y.current && !Y.current.contains(m.target) && (E(!1), R(!1), D(!1));
601
610
  };
602
611
  return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
603
- }, []), ie(() => {
604
- n && (N(n.year), k(n.month));
605
- }, [n]), ie(() => {
606
- if (E && O.current) {
607
- const t = O.current.querySelector(".sel");
612
+ }, []), de(() => {
613
+ n && (N(n.year), y(n.month));
614
+ }, [n]), de(() => {
615
+ if (w && $.current) {
616
+ const t = $.current.querySelector(".sel");
608
617
  t && t.scrollIntoView({ block: "center" });
609
618
  }
610
- }, [E]);
611
- const re = we((t) => {
619
+ }, [w]);
620
+ const re = _e((t) => {
612
621
  if (!t) return;
613
- c?.({ year: x, month: h, day: t }, V(x, h, t)), j(!1);
614
- }, [x, h, c]), ne = () => {
615
- y("right"), setTimeout(() => y(null), 200), h === 1 ? (k(12), N((t) => t - 1)) : k((t) => t - 1);
622
+ l?.({ year: g, month: h, day: t }, U(g, h, t)), E(!1);
623
+ }, [g, h, l]), B = () => {
624
+ v("right"), setTimeout(() => v(null), 200), h === 1 ? (y(12), N((t) => t - 1)) : y((t) => t - 1);
625
+ }, ne = () => {
626
+ v("left"), setTimeout(() => v(null), 200), h === 12 ? (y(1), N((t) => t + 1)) : y((t) => t + 1);
616
627
  }, te = () => {
617
- y("left"), setTimeout(() => y(null), 200), h === 12 ? (k(1), N((t) => t + 1)) : k((t) => t + 1);
618
- }, P = () => {
619
628
  const t = K();
620
- N(t.year), k(t.month), c?.(t, V(t.year, t.month, t.day)), j(!1);
621
- }, U = ue(x, h), C = Se(x, h), Y = h === 1 ? 12 : h - 1, X = h === 1 ? x - 1 : x, oe = ue(X, Y), M = Array.from({ length: C }, (t, m) => ({
622
- day: oe - C + 1 + m,
629
+ N(t.year), y(t.month), l?.(t, U(t.year, t.month, t.day)), E(!1);
630
+ }, A = me(g, h), O = De(g, h), oe = h === 1 ? 12 : h - 1, L = h === 1 ? g - 1 : g, q = me(L, oe), J = Array.from({ length: O }, (t, m) => ({
631
+ day: q - O + 1 + m,
623
632
  overflow: "prev"
624
- })), q = Array.from({ length: U }, (t, m) => ({
633
+ })), H = Array.from({ length: A }, (t, m) => ({
625
634
  day: m + 1,
626
635
  overflow: null
627
- })), J = 42 - (C + U), H = Array.from({ length: J }, (t, m) => ({
636
+ })), Z = 42 - (O + A), e = Array.from({ length: Z }, (t, m) => ({
628
637
  day: m + 1,
629
638
  overflow: "next"
630
- })), Z = [...M, ...q, ...H], e = d ? me : he, o = d ? Te : Re, a = e[h - 1], l = d ? W(x) : String(x), L = V(x, h, 1).toLocaleDateString("en-GB", { month: "short", year: "numeric" }), f = n ? d ? `${W(n.year)} ${me[n.month - 1]} ${W(n.day)}` : `${n.year} ${he[n.month - 1]} ${n.day}` : "", _ = d ? "मिति छान्नुहोस्" : "Select BS date", T = n ? V(n.year, n.month, n.day) : null, se = Array.from({ length: i - s + 1 }, (t, m) => s + m);
631
- return /* @__PURE__ */ r.jsxs("div", { className: "ndp", ref: A, children: [
632
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-wrap", onClick: () => j((t) => !t), children: [
639
+ })), o = [...J, ...H, ...e], s = f ? he : xe, p = f ? Ae : Oe, T = s[h - 1], P = f ? G(g) : String(g), k = U(g, h, 1).toLocaleDateString("en-GB", { month: "short", year: "numeric" }), z = n ? f ? `${G(n.year)} ${he[n.month - 1]} ${G(n.day)}` : `${n.year} ${xe[n.month - 1]} ${n.day}` : "", se = f ? "मिति छान्नुहोस्" : "Select BS date", ie = n ? U(n.year, n.month, n.day) : null, be = Array.from({ length: i - d + 1 }, (t, m) => d + m), ve = {
640
+ ...a.primary && { "--ndp-primary": a.primary },
641
+ ...a.primarySoft && { "--ndp-primary-soft": a.primarySoft },
642
+ ...a.background && { "--ndp-background": a.background },
643
+ ...a.text && { "--ndp-text": a.text },
644
+ ...a.textMuted && { "--ndp-text-muted": a.textMuted },
645
+ ...a.border && { "--ndp-border": a.border },
646
+ ...a.todayBg && { "--ndp-today-bg": a.todayBg },
647
+ ...a.controlsBg && { "--ndp-controls-bg": a.controlsBg },
648
+ ...a.radius && { "--ndp-radius": a.radius },
649
+ ...a.shadow && { "--ndp-shadow": a.shadow }
650
+ };
651
+ return /* @__PURE__ */ r.jsxs("div", { className: `ndp${x ? ` ${x}` : ""}`, ref: Y, style: ve, children: [
652
+ /* @__PURE__ */ r.jsxs("div", { className: "ndp-wrap", onClick: () => E((t) => !t), children: [
633
653
  /* @__PURE__ */ r.jsx(
634
654
  "input",
635
655
  {
636
656
  readOnly: !0,
637
- className: `ndp-input${g ? " open" : ""}`,
638
- value: f,
639
- placeholder: p ?? _
657
+ className: `ndp-input${_ ? " open" : ""}`,
658
+ value: z,
659
+ placeholder: c ?? se
640
660
  }
641
661
  ),
642
662
  /* @__PURE__ */ r.jsx("span", { className: "ndp-icon", children: /* @__PURE__ */ r.jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -646,40 +666,40 @@ function Me({
646
666
  /* @__PURE__ */ r.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
647
667
  ] }) })
648
668
  ] }),
649
- g && /* @__PURE__ */ r.jsxs("div", { className: "ndp-popup", children: [
669
+ _ && /* @__PURE__ */ r.jsxs("div", { className: "ndp-popup", children: [
650
670
  /* @__PURE__ */ r.jsx("div", { className: "ndp-hd", children: /* @__PURE__ */ r.jsxs("div", { className: "ndp-hd-row", children: [
651
- /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: ne, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
652
- /* @__PURE__ */ r.jsxs("div", { className: `ndp-hd-center${v ? ` ndp-slide-${v}` : ""}`, children: [
653
- /* @__PURE__ */ r.jsx("div", { className: "ndp-hd-month", children: a }),
671
+ /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: B, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
672
+ /* @__PURE__ */ r.jsxs("div", { className: `ndp-hd-center${S ? ` ndp-slide-${S}` : ""}`, children: [
673
+ /* @__PURE__ */ r.jsx("div", { className: "ndp-hd-month", children: T }),
654
674
  /* @__PURE__ */ r.jsxs("div", { className: "ndp-hd-sub", children: [
655
- l,
675
+ P,
656
676
  " BS · ",
657
- L
677
+ k
658
678
  ] })
659
679
  ] }),
660
- /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: te, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
680
+ /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: ne, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
661
681
  ] }) }),
662
682
  /* @__PURE__ */ r.jsxs("div", { className: "ndp-controls", children: [
663
683
  /* @__PURE__ */ r.jsxs("div", { className: "ndp-dd", children: [
664
684
  /* @__PURE__ */ r.jsxs(
665
685
  "button",
666
686
  {
667
- className: `ndp-dd-trigger${D ? " active" : ""}`,
687
+ className: `ndp-dd-trigger${M ? " active" : ""}`,
668
688
  onClick: () => {
669
- w((t) => !t), S(!1);
689
+ R((t) => !t), D(!1);
670
690
  },
671
691
  children: [
672
- /* @__PURE__ */ r.jsx("span", { children: a }),
692
+ /* @__PURE__ */ r.jsx("span", { children: T }),
673
693
  /* @__PURE__ */ r.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
674
694
  ]
675
695
  }
676
696
  ),
677
- D && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-months", children: e.map((t, m) => /* @__PURE__ */ r.jsx(
697
+ M && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-months", children: s.map((t, m) => /* @__PURE__ */ r.jsx(
678
698
  "button",
679
699
  {
680
700
  className: `ndp-dd-month-item${h === m + 1 ? " sel" : ""}`,
681
701
  onClick: () => {
682
- y(m + 1 < h ? "right" : "left"), setTimeout(() => y(null), 200), k(m + 1), w(!1);
702
+ v(m + 1 < h ? "right" : "left"), setTimeout(() => v(null), 200), y(m + 1), R(!1);
683
703
  },
684
704
  children: t
685
705
  },
@@ -690,62 +710,62 @@ function Me({
690
710
  /* @__PURE__ */ r.jsxs(
691
711
  "button",
692
712
  {
693
- className: `ndp-dd-trigger${E ? " active" : ""}`,
713
+ className: `ndp-dd-trigger${w ? " active" : ""}`,
694
714
  onClick: () => {
695
- S((t) => !t), w(!1);
715
+ D((t) => !t), R(!1);
696
716
  },
697
717
  children: [
698
- /* @__PURE__ */ r.jsx("span", { children: l }),
718
+ /* @__PURE__ */ r.jsx("span", { children: P }),
699
719
  /* @__PURE__ */ r.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
700
720
  ]
701
721
  }
702
722
  ),
703
- E && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-years", ref: O, children: se.map((t) => /* @__PURE__ */ r.jsx(
723
+ w && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-years", ref: $, children: be.map((t) => /* @__PURE__ */ r.jsx(
704
724
  "button",
705
725
  {
706
- className: `ndp-dd-year-item${x === t ? " sel" : ""}`,
726
+ className: `ndp-dd-year-item${g === t ? " sel" : ""}`,
707
727
  onClick: () => {
708
- N(t), S(!1);
728
+ N(t), D(!1);
709
729
  },
710
- children: d ? W(t) : t
730
+ children: f ? G(t) : t
711
731
  },
712
732
  t
713
733
  )) }) })
714
734
  ] })
715
735
  ] }),
716
736
  /* @__PURE__ */ r.jsxs("div", { className: "ndp-body", children: [
717
- /* @__PURE__ */ r.jsx("div", { className: "ndp-wdays", children: o.map((t, m) => /* @__PURE__ */ r.jsx("div", { className: "ndp-wday", children: t }, m)) }),
718
- /* @__PURE__ */ r.jsx("div", { className: `ndp-grid${v ? ` ndp-slide-${v}` : ""}`, children: Z.map(({ day: t, overflow: m }, de) => {
719
- const be = de % 7 === 6, z = m !== null, ge = !z && t === u.day && h === u.month && x === u.year, ve = !z && n && t === n.day && h === n.month && x === n.year;
720
- let F = "ndp-cell";
721
- return z ? F += " overflow" : be && (F += " wknd"), ge && (F += " today"), ve && (F += " picked"), /* @__PURE__ */ r.jsx(
737
+ /* @__PURE__ */ r.jsx("div", { className: "ndp-wdays", children: p.map((t, m) => /* @__PURE__ */ r.jsx("div", { className: "ndp-wday", children: t }, m)) }),
738
+ /* @__PURE__ */ r.jsx("div", { className: `ndp-grid${S ? ` ndp-slide-${S}` : ""}`, children: o.map(({ day: t, overflow: m }, le) => {
739
+ const ye = le % 7 === 6, F = m !== null, we = !F && t === j.day && h === j.month && g === j.year, ke = !F && n && t === n.day && h === n.month && g === n.year;
740
+ let I = "ndp-cell";
741
+ return F ? I += " overflow" : ye && (I += " wknd"), we && (I += " today"), ke && (I += " picked"), /* @__PURE__ */ r.jsx(
722
742
  "button",
723
743
  {
724
- className: F,
725
- disabled: z,
726
- onClick: () => !z && re(t),
727
- children: d ? W(t) : t
744
+ className: I,
745
+ disabled: F,
746
+ onClick: () => !F && re(t),
747
+ children: f ? G(t) : t
728
748
  },
729
- de
749
+ le
730
750
  );
731
751
  }) })
732
752
  ] }),
733
753
  /* @__PURE__ */ r.jsxs("div", { className: "ndp-ft", children: [
734
- /* @__PURE__ */ r.jsx("span", { className: "ndp-ad", children: T ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
754
+ /* @__PURE__ */ r.jsx("span", { className: "ndp-ad", children: ie ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
735
755
  /* @__PURE__ */ r.jsx("b", { children: "AD:" }),
736
756
  " ",
737
- Ae(T)
738
- ] }) : /* @__PURE__ */ r.jsx("span", { style: { color: "var(--txm)", fontSize: 12 }, children: d ? "मिति छानिएको छैन" : "No date selected" }) }),
739
- /* @__PURE__ */ r.jsx("button", { className: "ndp-today-btn", onClick: P, children: d ? "आज" : "Today" })
757
+ Ce(ie)
758
+ ] }) : /* @__PURE__ */ r.jsx("span", { style: { color: "var(--ndp-text-muted)", fontSize: 12 }, children: f ? "मिति छानिएको छैन" : "No date selected" }) }),
759
+ /* @__PURE__ */ r.jsx("button", { className: "ndp-today-btn", onClick: te, children: f ? "आज" : "Today" })
740
760
  ] })
741
761
  ] })
742
762
  ] });
743
763
  }
744
764
  export {
745
- Ne as adToBs,
746
- V as bsToAd,
747
- Me as default,
748
- ue as getDaysInBSMonth,
749
- Se as getFirstDayOfWeekBS,
765
+ Le as NepaliDatePicker,
766
+ Re as adToBs,
767
+ U as bsToAd,
768
+ me as getDaysInBSMonth,
769
+ De as getFirstDayOfWeekBS,
750
770
  K as getTodayBS
751
771
  };
@@ -1,15 +1,22 @@
1
- (function(v,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(v=typeof globalThis<"u"?globalThis:v||self,x(v.NepaliDatePicker={},v.React))})(this,(function(v,x){"use strict";var H={exports:{}},O={};var le;function be(){if(le)return O;le=1;var n=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function b(p,s,i){var d=null;if(i!==void 0&&(d=""+i),s.key!==void 0&&(d=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:n,type:p,key:d,ref:s!==void 0?s:null,props:i}}return O.Fragment=c,O.jsx=b,O.jsxs=b,O}var P={};var ce;function ve(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===I?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case h:return"Profiler";case T:return"StrictMode";case te:return"Suspense";case oe:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case D:return"Portal";case L:return e.displayName||"Context";case S:return(e._context.displayName||"Context")+".Consumer";case F:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return o=e.displayName||null,o!==null?o:n(e.type)||"Memo";case z:o=e._payload,e=e._init;try{return n(e(o))}catch{}}return null}function c(e){return""+e}function b(e){try{c(e);var o=!1}catch{o=!0}if(o){o=console;var a=o.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),c(e)}}function p(e){if(e===g)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===z)return"<...>";try{var o=n(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function s(){var e=W.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function d(e){if(Q.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function u(e,o){function a(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function y(){var e=n(this.type);return ie[e]||(ie[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function _(e,o,a,l,G,U){var f=a.ref;return e={$$typeof:N,type:e,key:o,props:a,_owner:l},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,o,a,l,G,U){var f=o.children;if(f!==void 0)if(l)if(se(f)){for(l=0;l<f.length;l++)k(f[l]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(f);if(Q.call(o,"key")){f=n(e);var E=Object.keys(o).filter(function(de){return de!=="key"});l=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",re[f+l]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.NepaliDatePicker={},y.React))})(this,(function(y,x){"use strict";var Z={exports:{}},B={};var ce;function ve(){if(ce)return B;ce=1;var n=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function v(l,d,i){var g=null;if(i!==void 0&&(g=""+i),d.key!==void 0&&(g=""+d.key),"key"in d){i={};for(var a in d)a!=="key"&&(i[a]=d[a])}else i=d;return d=i.ref,{$$typeof:n,type:l,key:g,ref:d!==void 0?d:null,props:i}}return B.Fragment=c,B.jsx=v,B.jsxs=v,B}var L={};var le;function ye(){return le||(le=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case b:return"Profiler";case P:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case O:return"Portal";case h:return e.displayName||"Context";case R:return(e._context.displayName||"Context")+".Consumer";case k:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return o=e.displayName||null,o!==null?o:n(e.type)||"Memo";case U:o=e._payload,e=e._init;try{return n(e(o))}catch{}}return null}function c(e){return""+e}function v(e){try{c(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),c(e)}}function l(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===U)return"<...>";try{var o=n(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function d(){var e=C.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function g(e){if(M.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function a(e,o){function s(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function u(){var e=n(this.type);return q[e]||(q[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function _(e,o,s,p,D,Y){var f=s.ref;return e={$$typeof:W,type:e,key:o,props:s,_owner:p},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:u}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function E(e,o,s,p,D,Y){var f=o.children;if(f!==void 0)if(p)if(se(f)){for(p=0;p<f.length;p++)N(f[p]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(f);if(M.call(o,"key")){f=n(e);var S=Object.keys(o).filter(function(ie){return ie!=="key"});p=0<S.length?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}",re[f+p]||(S=0<S.length?"{"+S.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,l,f,E,f),re[f+l]=!0)}if(f=null,a!==void 0&&(b(a),f=""+a),d(o)&&(b(o.key),f=""+o.key),"key"in o){a={};for(var A in o)A!=="key"&&(a[A]=o[A])}else a=o;return f&&u(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,f,a,s(),G,U)}function k(e){B(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===z&&(e._payload.status==="fulfilled"?B(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function B(e){return typeof e=="object"&&e!==null&&e.$$typeof===N}var j=x,N=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),L=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),W=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,se=Array.isArray,V=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(e){return e()}};var K,ie={},q=j.react_stack_bottom_frame.bind(j,i)(),ee=V(p(i)),re={};P.Fragment=g,P.jsx=function(e,o,a){var l=1e4>W.recentlyCreatedOwnerStacks++;return w(e,o,a,!1,l?Error("react-stack-top-frame"):q,l?V(p(e)):ee)},P.jsxs=function(e,o,a){var l=1e4>W.recentlyCreatedOwnerStacks++;return w(e,o,a,!0,l?Error("react-stack-top-frame"):q,l?V(p(e)):ee)}})()),P}var pe;function ye(){return pe||(pe=1,process.env.NODE_ENV==="production"?H.exports=be():H.exports=ve()),H.exports}var r=ye();const C={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,31,32,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,29,30,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,31,32,32,31,30,30,29,30,29,30,30],2023:[31,32,31,32,31,30,30,30,29,29,30,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,31,32,32,31,30,30,29,30,29,30,30],2027:[31,32,31,32,31,30,30,30,29,29,30,32],2028:[30,32,31,32,31,30,30,30,29,30,29,31],2029:[31,31,32,31,31,31,30,29,30,29,30,30],2030:[31,31,32,32,31,30,30,29,30,29,30,30],2031:[31,32,31,32,31,30,30,30,29,29,30,31],2032:[30,32,31,32,31,30,30,30,29,30,29,31],2033:[31,31,32,31,31,31,30,29,30,29,30,30],2034:[31,31,32,32,31,30,30,29,30,29,30,30],2035:[31,32,31,32,31,30,30,30,29,29,30,31],2036:[30,32,31,32,31,31,29,30,30,29,29,31],2037:[31,31,32,31,31,31,30,29,30,29,30,30],2038:[31,31,32,32,31,30,30,29,30,29,30,30],2039:[31,32,31,32,31,30,30,30,29,29,30,31],2040:[31,31,31,32,31,31,29,30,30,29,30,30],2041:[31,31,32,31,31,31,30,29,30,29,30,30],2042:[31,31,32,32,31,30,30,29,30,29,30,31],2043:[31,32,31,32,31,30,30,30,29,29,30,30],2044:[31,31,31,32,31,31,29,30,30,29,30,30],2045:[31,31,32,31,31,31,30,29,30,29,30,30],2046:[31,31,32,32,31,30,30,29,30,29,30,30],2047:[31,32,31,32,31,30,30,30,29,29,30,31],2048:[30,32,31,32,31,30,30,30,29,30,29,31],2049:[31,31,32,31,31,31,30,29,30,29,30,30],2050:[31,31,32,32,31,30,30,29,30,29,30,30],2051:[31,32,31,32,31,30,30,30,29,29,30,31],2052:[31,31,31,32,31,31,29,30,30,29,30,30],2053:[31,31,32,31,31,31,30,29,30,29,30,30],2054:[31,31,32,32,31,30,30,29,30,29,30,30],2055:[31,32,31,32,31,30,30,30,29,29,30,31],2056:[31,31,31,32,31,31,30,29,30,29,30,30],2057:[31,31,32,31,31,31,30,29,30,29,30,30],2058:[31,31,32,32,31,30,30,29,30,29,30,30],2059:[31,32,31,32,31,30,30,30,29,29,30,31],2060:[31,31,31,32,31,31,30,29,30,29,30,30],2061:[31,31,32,31,31,31,30,29,30,29,30,30],2062:[31,31,32,32,31,30,30,29,30,29,30,30],2063:[31,32,31,32,31,30,30,30,29,29,30,31],2064:[31,31,31,32,31,31,29,30,29,30,29,31],2065:[31,31,32,31,31,31,30,29,30,29,30,30],2066:[31,31,32,32,31,30,30,29,30,29,30,30],2067:[31,32,31,32,31,30,30,30,29,29,30,31],2068:[31,31,31,32,31,31,29,30,30,29,30,30],2069:[31,31,32,31,31,31,30,29,30,29,30,30],2070:[31,31,32,32,31,30,30,29,30,29,30,30],2071:[31,32,31,32,31,30,30,30,29,29,30,31],2072:[31,31,31,32,31,31,29,30,30,29,30,30],2073:[31,31,32,31,31,31,30,29,30,29,30,30],2074:[31,31,32,32,31,30,30,29,30,29,30,30],2075:[31,32,31,32,31,30,30,30,29,29,30,31],2076:[31,31,31,32,31,31,30,29,30,29,30,30],2077:[31,31,32,31,31,31,30,29,30,29,30,30],2078:[31,31,32,32,31,30,30,29,30,29,30,30],2079:[31,32,31,32,31,30,30,30,29,29,30,31],2080:[31,31,31,32,31,31,30,29,30,29,30,30],2081:[31,31,32,31,31,31,30,29,30,29,30,30],2082:[31,32,31,32,31,30,30,29,30,29,30,30],2083:[31,32,31,32,31,30,30,30,29,30,29,31],2084:[31,31,31,32,31,31,30,29,30,29,30,30],2085:[31,31,32,31,31,31,30,29,30,29,30,30],2086:[31,32,31,32,31,30,30,29,30,29,30,30],2087:[31,32,31,32,31,30,30,30,29,29,30,31],2088:[30,32,31,32,31,30,30,30,29,30,29,31],2089:[31,31,32,31,31,31,30,29,30,29,30,30],2090:[31,31,32,32,31,30,30,29,30,29,30,30]},$=new Date(1943,3,14);function we(n,c,b){let p=0;for(let i=2e3;i<n;i++){const d=C[i];d&&(p+=d.reduce((u,y)=>u+y,0))}const s=C[n]||[];for(let i=0;i<c-1;i++)p+=s[i]||30;return p+b-1}function R(n,c,b){const p=new Date($);return p.setDate(p.getDate()+we(n,c,b)),p}function fe(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),b=new Date($.getFullYear(),$.getMonth(),$.getDate());let p=Math.round((c-b)/864e5),s=2e3;for(;s<=2090;){const u=C[s],y=u?u.reduce((_,w)=>_+w,0):365;if(p<y)break;p-=y,s++}const i=C[s]||[];let d=1;for(let u=0;u<12;u++){const y=i[u]||30;if(p<y){d=u+1;break}p-=y,u===11&&(d=12)}return{year:s,month:d,day:p+1}}function M(){return fe(new Date)}function ne(n,c){return(C[n]||[])[c-1]||30}function ue(n,c){return R(n,c,1).getDay()}const me=["बैशाख","जेठ","असार","श्रावण","भाद्र","असोज","कार्तिक","मङ्सिर","पुष","माघ","फागुन","चैत्र"],he=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],ke=["आइत","सोम","मङ्गल","बुध","बिही","शुक्र","शनि"],je=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Se=["०","१","२","३","४","५","६","७","८","९"],Y=n=>String(n).split("").map(c=>Se[+c]??c).join(""),_e=n=>n?n.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",Ee=`
6
+ <%s key={someKey} {...props} />`,p,f,S,f),re[f+p]=!0)}if(f=null,s!==void 0&&(v(s),f=""+s),g(o)&&(v(o.key),f=""+o.key),"key"in o){s={};for(var J in o)J!=="key"&&(s[J]=o[J])}else s=o;return f&&a(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,f,s,d(),D,Y)}function N(e){T(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===U&&(e._payload.status==="fulfilled"?T(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function T(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}var w=x,W=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),h=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),C=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,se=Array.isArray,X=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(e){return e()}};var K,q={},ee=w.react_stack_bottom_frame.bind(w,i)(),de=X(l(i)),re={};L.Fragment=j,L.jsx=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!1,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)},L.jsxs=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!0,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)}})()),L}var pe;function we(){return pe||(pe=1,process.env.NODE_ENV==="production"?Z.exports=ve():Z.exports=ye()),Z.exports}var r=we();const F={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,31,32,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,29,30,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,31,32,32,31,30,30,29,30,29,30,30],2023:[31,32,31,32,31,30,30,30,29,29,30,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,31,32,32,31,30,30,29,30,29,30,30],2027:[31,32,31,32,31,30,30,30,29,29,30,32],2028:[30,32,31,32,31,30,30,30,29,30,29,31],2029:[31,31,32,31,31,31,30,29,30,29,30,30],2030:[31,31,32,32,31,30,30,29,30,29,30,30],2031:[31,32,31,32,31,30,30,30,29,29,30,31],2032:[30,32,31,32,31,30,30,30,29,30,29,31],2033:[31,31,32,31,31,31,30,29,30,29,30,30],2034:[31,31,32,32,31,30,30,29,30,29,30,30],2035:[31,32,31,32,31,30,30,30,29,29,30,31],2036:[30,32,31,32,31,31,29,30,30,29,29,31],2037:[31,31,32,31,31,31,30,29,30,29,30,30],2038:[31,31,32,32,31,30,30,29,30,29,30,30],2039:[31,32,31,32,31,30,30,30,29,29,30,31],2040:[31,31,31,32,31,31,29,30,30,29,30,30],2041:[31,31,32,31,31,31,30,29,30,29,30,30],2042:[31,31,32,32,31,30,30,29,30,29,30,31],2043:[31,32,31,32,31,30,30,30,29,29,30,30],2044:[31,31,31,32,31,31,29,30,30,29,30,30],2045:[31,31,32,31,31,31,30,29,30,29,30,30],2046:[31,31,32,32,31,30,30,29,30,29,30,30],2047:[31,32,31,32,31,30,30,30,29,29,30,31],2048:[30,32,31,32,31,30,30,30,29,30,29,31],2049:[31,31,32,31,31,31,30,29,30,29,30,30],2050:[31,31,32,32,31,30,30,29,30,29,30,30],2051:[31,32,31,32,31,30,30,30,29,29,30,31],2052:[31,31,31,32,31,31,29,30,30,29,30,30],2053:[31,31,32,31,31,31,30,29,30,29,30,30],2054:[31,31,32,32,31,30,30,29,30,29,30,30],2055:[31,32,31,32,31,30,30,30,29,29,30,31],2056:[31,31,31,32,31,31,30,29,30,29,30,30],2057:[31,31,32,31,31,31,30,29,30,29,30,30],2058:[31,31,32,32,31,30,30,29,30,29,30,30],2059:[31,32,31,32,31,30,30,30,29,29,30,31],2060:[31,31,31,32,31,31,30,29,30,29,30,30],2061:[31,31,32,31,31,31,30,29,30,29,30,30],2062:[31,31,32,32,31,30,30,29,30,29,30,30],2063:[31,32,31,32,31,30,30,30,29,29,30,31],2064:[31,31,31,32,31,31,29,30,29,30,29,31],2065:[31,31,32,31,31,31,30,29,30,29,30,30],2066:[31,31,32,32,31,30,30,29,30,29,30,30],2067:[31,32,31,32,31,30,30,30,29,29,30,31],2068:[31,31,31,32,31,31,29,30,30,29,30,30],2069:[31,31,32,31,31,31,30,29,30,29,30,30],2070:[31,31,32,32,31,30,30,29,30,29,30,30],2071:[31,32,31,32,31,30,30,30,29,29,30,31],2072:[31,31,31,32,31,31,29,30,30,29,30,30],2073:[31,31,32,31,31,31,30,29,30,29,30,30],2074:[31,31,32,32,31,30,30,29,30,29,30,30],2075:[31,32,31,32,31,30,30,30,29,29,30,31],2076:[31,31,31,32,31,31,30,29,30,29,30,30],2077:[31,31,32,31,31,31,30,29,30,29,30,30],2078:[31,31,32,32,31,30,30,29,30,29,30,30],2079:[31,32,31,32,31,30,30,30,29,29,30,31],2080:[31,31,31,32,31,31,30,29,30,29,30,30],2081:[31,31,32,31,31,31,30,29,30,29,30,30],2082:[31,32,31,32,31,30,30,29,30,29,30,30],2083:[31,32,31,32,31,30,30,30,29,30,29,31],2084:[31,31,31,32,31,31,30,29,30,29,30,30],2085:[31,31,32,31,31,31,30,29,30,29,30,30],2086:[31,32,31,32,31,30,30,29,30,29,30,30],2087:[31,32,31,32,31,30,30,30,29,29,30,31],2088:[30,32,31,32,31,30,30,30,29,30,29,31],2089:[31,31,32,31,31,31,30,29,30,29,30,30],2090:[31,31,32,32,31,30,30,29,30,29,30,30]},Q=new Date(1943,3,14);function ke(n,c,v){let l=0;for(let i=2e3;i<n;i++){const g=F[i];g&&(l+=g.reduce((a,u)=>a+u,0))}const d=F[n]||[];for(let i=0;i<c-1;i++)l+=d[i]||30;return l+v-1}function A(n,c,v){const l=new Date(Q);return l.setDate(l.getDate()+ke(n,c,v)),l}function fe(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),v=new Date(Q.getFullYear(),Q.getMonth(),Q.getDate());let l=Math.round((c-v)/864e5),d=2e3;for(;d<=2090;){const a=F[d],u=a?a.reduce((_,E)=>_+E,0):365;if(l<u)break;l-=u,d++}const i=F[d]||[];let g=1;for(let a=0;a<12;a++){const u=i[a]||30;if(l<u){g=a+1;break}l-=u,a===11&&(g=12)}return{year:d,month:g,day:l+1}}function z(){return fe(new Date)}function ne(n,c){return(F[n]||[])[c-1]||30}function ue(n,c){return A(n,c,1).getDay()}const me=["बैशाख","जेठ","असार","श्रावण","भाद्र","असोज","कार्तिक","मङ्सिर","पुष","माघ","फागुन","चैत्र"],he=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],je=["आइत","सोम","मङ्गल","बुध","बिही","शुक्र","शनि"],Se=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_e=["०","१","२","३","४","५","६","७","८","९"],I=n=>String(n).split("").map(c=>_e[+c]??c).join(""),Ee=n=>n?n.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",Ne=`
7
7
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
8
8
 
9
9
  .ndp{
10
- --pr:#C0392B; --prs:#fff0ee; --acs:#fffaee;
11
- --sf:#fff; --tx:#1A1208; --txm:#8C7B6B; --bd:#E8DED0;
12
- --r:16px; --sh:0 24px 64px rgba(0,0,0,0.13),0 4px 16px rgba(0,0,0,0.07);
10
+ --ndp-primary: #C0392B;
11
+ --ndp-primary-soft: #fff0ee;
12
+ --ndp-controls-bg: #fffaee;
13
+ --ndp-background: #fff;
14
+ --ndp-text: #1A1208;
15
+ --ndp-text-muted: #8C7B6B;
16
+ --ndp-border: #E8DED0;
17
+ --ndp-today-bg: #fde8e6;
18
+ --ndp-radius: 16px;
19
+ --ndp-shadow: 0 24px 64px rgba(0,0,0,0.13),0 4px 16px rgba(0,0,0,0.07);
13
20
  font-family:'DM Sans',sans-serif;
14
21
  position:relative; display:inline-block;
15
22
  }
@@ -20,24 +27,24 @@ React keys must be passed directly to JSX without using spread:
20
27
  .ndp-input{
21
28
  width:100%; min-width:270px;
22
29
  padding:13px 48px 13px 17px;
23
- border:2px solid var(--bd); border-radius:13px;
24
- background:var(--sf); color:var(--tx);
30
+ border:2px solid var(--ndp-border); border-radius:13px;
31
+ background:var(--ndp-background); color:var(--tx);
25
32
  font-family:'DM Sans',sans-serif; font-size:15px;
26
33
  cursor:pointer; outline:none;
27
34
  transition:border-color .2s,box-shadow .2s;
28
35
  caret-color:transparent;
29
36
  }
30
- .ndp-input::placeholder{color:var(--txm);}
31
- .ndp-input.open{border-color:var(--pr);box-shadow:0 0 0 4px rgba(192,57,43,.11);}
32
- .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--txm);transition:color .2s;}
33
- .ndp-input.open ~ .ndp-icon{color:var(--pr);}
37
+ .ndp-input::placeholder{color:var(--ndp-text-muted);}
38
+ .ndp-input.open{border-color:var(--ndp-primary);box-shadow:0 0 0 4px rgba(192,57,43,.11);}
39
+ .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--ndp-text-muted);transition:color .2s;}
40
+ .ndp-input.open ~ .ndp-icon{color:var(--ndp-primary);}
34
41
 
35
42
  /* Popup */
36
43
  .ndp-popup{
37
44
  position:absolute; top:calc(100% + 9px); left:0; z-index:9999;
38
45
  width:336px;
39
- background:var(--sf); border-radius:var(--r);
40
- box-shadow:var(--sh); border:1px solid var(--bd);
46
+ background:var(--ndp-background); border-radius:var(--r);
47
+ box-shadow:var(--sh); border:1px solid var(--ndp-border);
41
48
  overflow:hidden;
42
49
  animation:ndp-pop .18s cubic-bezier(.34,1.56,.64,1);
43
50
  transform-origin:top left;
@@ -49,7 +56,7 @@ React keys must be passed directly to JSX without using spread:
49
56
  .ndp-slide-right{animation:ndp-slide-right .2s cubic-bezier(.25,.8,.25,1);}
50
57
 
51
58
  /* Header */
52
- .ndp-hd{background:var(--pr);padding:14px;color:#fff;}
59
+ .ndp-hd{background:var(--ndp-primary);padding:14px;color:#fff;}
53
60
  .ndp-hd-row{display:flex;align-items:center;justify-content:space-between;}
54
61
  .ndp-nav{
55
62
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
@@ -64,13 +71,13 @@ React keys must be passed directly to JSX without using spread:
64
71
  /* Custom dropdowns */
65
72
  .ndp-controls{
66
73
  display:flex;gap:6px;padding:9px 12px;
67
- background:var(--acs);border-bottom:1px solid var(--bd);
74
+ background:var(--ndp-controls-bg);border-bottom:1px solid var(--ndp-border);
68
75
  position:relative;z-index:10;
69
76
  }
70
77
  .ndp-dd{position:relative;flex:1;}
71
78
  .ndp-dd-trigger{
72
79
  width:100%;padding:6px 28px 6px 10px;
73
- border:1px solid var(--bd);border-radius:8px;
80
+ border:1px solid var(--ndp-border);border-radius:8px;
74
81
  background:#fff;color:var(--tx);
75
82
  font-family:'Noto Sans Devanagari',sans-serif;font-size:13px;font-weight:500;
76
83
  cursor:pointer;outline:none;
@@ -80,17 +87,17 @@ React keys must be passed directly to JSX without using spread:
80
87
  position:relative;
81
88
  }
82
89
  .ndp-dd-trigger:hover{border-color:#c8b8a8;}
83
- .ndp-dd-trigger.active{border-color:var(--pr);box-shadow:0 0 0 3px rgba(192,57,43,.10);}
90
+ .ndp-dd-trigger.active{border-color:var(--ndp-primary);box-shadow:0 0 0 3px rgba(192,57,43,.10);}
84
91
  .ndp-dd-arrow{
85
92
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
86
- pointer-events:none;color:var(--txm);transition:transform .18s;flex-shrink:0;
93
+ pointer-events:none;color:var(--ndp-text-muted);transition:transform .18s;flex-shrink:0;
87
94
  }
88
95
  .ndp-dd-trigger.active .ndp-dd-arrow{transform:translateY(-50%) rotate(180deg);}
89
96
 
90
97
  .ndp-dd-panel{
91
98
  position:absolute;top:calc(100% + 5px);left:0;
92
99
  min-width:100%;
93
- background:#fff;border:1px solid var(--bd);border-radius:10px;
100
+ background:#fff;border:1px solid var(--ndp-border);border-radius:10px;
94
101
  box-shadow:0 8px 28px rgba(0,0,0,0.13);
95
102
  z-index:999;overflow:hidden;
96
103
  animation:ndp-dd-in .15s cubic-bezier(.25,.8,.25,1);
@@ -110,16 +117,16 @@ React keys must be passed directly to JSX without using spread:
110
117
  transition:background .12s,color .12s;
111
118
  white-space:nowrap;
112
119
  }
113
- .ndp-dd-month-item:hover{background:var(--prs);color:var(--pr);}
114
- .ndp-dd-month-item.sel{background:var(--pr);color:#fff;font-weight:700;}
120
+ .ndp-dd-month-item:hover{background:var(--ndp-primary-soft);color:var(--ndp-primary);}
121
+ .ndp-dd-month-item.sel{background:var(--ndp-primary);color:#fff;font-weight:700;}
115
122
 
116
123
  /* Year panel: scrollable list */
117
124
  .ndp-dd-years{
118
125
  max-height:180px;overflow-y:auto;padding:5px;
119
- scrollbar-width:thin;scrollbar-color:var(--bd) transparent;
126
+ scrollbar-width:thin;scrollbar-color:var(--ndp-border) transparent;
120
127
  }
121
128
  .ndp-dd-years::-webkit-scrollbar{width:4px;}
122
- .ndp-dd-years::-webkit-scrollbar-thumb{background:var(--bd);border-radius:4px;}
129
+ .ndp-dd-years::-webkit-scrollbar-thumb{background:var(--ndp-border);border-radius:4px;}
123
130
  .ndp-dd-year-item{
124
131
  padding:7px 14px;border-radius:7px;cursor:pointer;border:none;background:transparent;
125
132
  font-family:'DM Sans',sans-serif;font-size:13px;font-weight:500;color:var(--tx);
@@ -127,18 +134,18 @@ React keys must be passed directly to JSX without using spread:
127
134
  transition:background .12s,color .12s;
128
135
  display:block;
129
136
  }
130
- .ndp-dd-year-item:hover{background:var(--prs);color:var(--pr);}
131
- .ndp-dd-year-item.sel{background:var(--pr);color:#fff;font-weight:700;}
137
+ .ndp-dd-year-item:hover{background:var(--ndp-primary-soft);color:var(--ndp-primary);}
138
+ .ndp-dd-year-item.sel{background:var(--ndp-primary);color:#fff;font-weight:700;}
132
139
 
133
140
  /* Grid — FIXED 6 rows so height never changes between months */
134
141
  .ndp-body{padding:10px 10px 6px;}
135
142
  .ndp-wdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px;}
136
143
  .ndp-wday{
137
144
  text-align:center;font-size:10.5px;font-weight:600;
138
- letter-spacing:.04em;color:var(--txm);padding:3px 0;
145
+ letter-spacing:.04em;color:var(--ndp-text-muted);padding:3px 0;
139
146
  font-family:'Noto Sans Devanagari',sans-serif;
140
147
  }
141
- .ndp-wday:last-child{color:var(--pr);}
148
+ .ndp-wday:last-child{color:var(--ndp-primary);}
142
149
 
143
150
  .ndp-grid{
144
151
  display:grid;
@@ -155,34 +162,34 @@ React keys must be passed directly to JSX without using spread:
155
162
  font-weight:500;width:100%;
156
163
  }
157
164
  .ndp-cell.blank{cursor:default;pointer-events:none;}
158
- .ndp-cell.overflow{color:var(--bd);cursor:default;pointer-events:none;}
159
- .ndp-cell.wknd{color:var(--pr);}
165
+ .ndp-cell.overflow{color:var(--ndp-border);cursor:default;pointer-events:none;}
166
+ .ndp-cell.wknd{color:var(--ndp-primary);}
160
167
  .ndp-cell.today:not(.picked){
161
- background:#fde8e6;
162
- font-weight:700;color:var(--pr);
168
+ background:var(--ndp-today-bg);
169
+ font-weight:700;color:var(--ndp-primary);
163
170
  }
164
171
  .ndp-cell.picked{
165
- background:var(--pr);color:#fff;font-weight:700;
172
+ background:var(--ndp-primary);color:#fff;font-weight:700;
166
173
  box-shadow:0 3px 10px rgba(192,57,43,.35);
167
174
  }
168
175
  .ndp-cell:hover:not(.overflow):not(.picked){
169
- background:var(--prs);color:var(--pr);
176
+ background:var(--ndp-primary-soft);color:var(--ndp-primary);
170
177
  }
171
178
 
172
179
  /* Footer */
173
180
  .ndp-ft{
174
181
  padding:9px 12px 12px;
175
- border-top:1px solid var(--bd);
182
+ border-top:1px solid var(--ndp-border);
176
183
  display:flex;align-items:center;justify-content:space-between;gap:8px;
177
184
  }
178
- .ndp-ad{font-size:12px;color:var(--txm);}
185
+ .ndp-ad{font-size:12px;color:var(--ndp-text-muted);}
179
186
  .ndp-ad b{color:var(--tx);}
180
187
  .ndp-today-btn{
181
188
  font-size:12px;padding:5px 13px;
182
- background:var(--acs);color:#9A7000;
189
+ background:var(--ndp-controls-bg);color:#9A7000;
183
190
  border:1px solid #F0D090;border-radius:8px;
184
191
  cursor:pointer;font-family:'DM Sans',sans-serif;font-weight:600;
185
192
  transition:background .15s;white-space:nowrap;
186
193
  }
187
194
  .ndp-today-btn:hover{background:#FDEECA;}
188
- `;let xe=!1;function Ne(){if(!xe&&typeof document<"u"){const n=document.createElement("style");n.textContent=Ee,document.head.appendChild(n),xe=!0}}function Te({value:n,onChange:c,language:b="np",placeholder:p,minYear:s=2060,maxYear:i=2090}){Ne();const d=b!=="en",u=M(),[y,_]=x.useState(!1),[w,k]=x.useState(null),[B,j]=x.useState(!1),[N,D]=x.useState(!1),[g,T]=x.useState(()=>n?.year??M().year),[h,S]=x.useState(()=>n?.month??M().month),L=x.useRef(null),F=x.useRef(null);x.useEffect(()=>{const t=m=>{L.current&&!L.current.contains(m.target)&&(_(!1),j(!1),D(!1))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),x.useEffect(()=>{n&&(T(n.year),S(n.month))},[n]),x.useEffect(()=>{if(N&&F.current){const t=F.current.querySelector(".sel");t&&t.scrollIntoView({block:"center"})}},[N]);const te=x.useCallback(t=>{if(!t)return;c?.({year:g,month:h,day:t},R(g,h,t)),_(!1)},[g,h,c]),oe=()=>{k("right"),setTimeout(()=>k(null),200),h===1?(S(12),T(t=>t-1)):S(t=>t-1)},ae=()=>{k("left"),setTimeout(()=>k(null),200),h===12?(S(1),T(t=>t+1)):S(t=>t+1)},z=()=>{const t=M();T(t.year),S(t.month),c?.(t,R(t.year,t.month,t.day)),_(!1)},Z=ne(g,h),I=ue(g,h),W=h===1?12:h-1,Q=h===1?g-1:g,se=ne(Q,W),V=Array.from({length:I},(t,m)=>({day:se-I+1+m,overflow:"prev"})),K=Array.from({length:Z},(t,m)=>({day:m+1,overflow:null})),q=42-(I+Z),ee=Array.from({length:q},(t,m)=>({day:m+1,overflow:"next"})),re=[...V,...K,...ee],e=d?me:he,o=d?ke:je,a=e[h-1],l=d?Y(g):String(g),U=R(g,h,1).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),f=n?d?`${Y(n.year)} ${me[n.month-1]} ${Y(n.day)}`:`${n.year} ${he[n.month-1]} ${n.day}`:"",E=d?"मिति छान्नुहोस्":"Select BS date",A=n?R(n.year,n.month,n.day):null,de=Array.from({length:i-s+1},(t,m)=>s+m);return r.jsxs("div",{className:"ndp",ref:L,children:[r.jsxs("div",{className:"ndp-wrap",onClick:()=>_(t=>!t),children:[r.jsx("input",{readOnly:!0,className:`ndp-input${y?" open":""}`,value:f,placeholder:p??E}),r.jsx("span",{className:"ndp-icon",children:r.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),y&&r.jsxs("div",{className:"ndp-popup",children:[r.jsx("div",{className:"ndp-hd",children:r.jsxs("div",{className:"ndp-hd-row",children:[r.jsx("button",{className:"ndp-nav",onClick:oe,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m15 18-6-6 6-6"})})}),r.jsxs("div",{className:`ndp-hd-center${w?` ndp-slide-${w}`:""}`,children:[r.jsx("div",{className:"ndp-hd-month",children:a}),r.jsxs("div",{className:"ndp-hd-sub",children:[l," BS · ",U]})]}),r.jsx("button",{className:"ndp-nav",onClick:ae,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m9 18 6-6-6-6"})})})]})}),r.jsxs("div",{className:"ndp-controls",children:[r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${B?" active":""}`,onClick:()=>{j(t=>!t),D(!1)},children:[r.jsx("span",{children:a}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),B&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-months",children:e.map((t,m)=>r.jsx("button",{className:`ndp-dd-month-item${h===m+1?" sel":""}`,onClick:()=>{k(m+1<h?"right":"left"),setTimeout(()=>k(null),200),S(m+1),j(!1)},children:t},m))})})]}),r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${N?" active":""}`,onClick:()=>{D(t=>!t),j(!1)},children:[r.jsx("span",{children:l}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),N&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-years",ref:F,children:de.map(t=>r.jsx("button",{className:`ndp-dd-year-item${g===t?" sel":""}`,onClick:()=>{T(t),D(!1)},children:d?Y(t):t},t))})})]})]}),r.jsxs("div",{className:"ndp-body",children:[r.jsx("div",{className:"ndp-wdays",children:o.map((t,m)=>r.jsx("div",{className:"ndp-wday",children:t},m))}),r.jsx("div",{className:`ndp-grid${w?` ndp-slide-${w}`:""}`,children:re.map(({day:t,overflow:m},ge)=>{const Re=ge%7===6,X=m!==null,De=!X&&t===u.day&&h===u.month&&g===u.year,Ae=!X&&n&&t===n.day&&h===n.month&&g===n.year;let J="ndp-cell";return X?J+=" overflow":Re&&(J+=" wknd"),De&&(J+=" today"),Ae&&(J+=" picked"),r.jsx("button",{className:J,disabled:X,onClick:()=>!X&&te(t),children:d?Y(t):t},ge)})})]}),r.jsxs("div",{className:"ndp-ft",children:[r.jsx("span",{className:"ndp-ad",children:A?r.jsxs(r.Fragment,{children:[r.jsx("b",{children:"AD:"})," ",_e(A)]}):r.jsx("span",{style:{color:"var(--txm)",fontSize:12},children:d?"मिति छानिएको छैन":"No date selected"})}),r.jsx("button",{className:"ndp-today-btn",onClick:z,children:d?"आज":"Today"})]})]})]})}v.adToBs=fe,v.bsToAd=R,v.default=Te,v.getDaysInBSMonth=ne,v.getFirstDayOfWeekBS=ue,v.getTodayBS=M,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
195
+ `;let xe=!1;function Te(){if(!xe&&typeof document<"u"){const n=document.createElement("style");n.textContent=Ne,document.head.appendChild(n),xe=!0}}function Re({value:n,onChange:c,language:v="np",placeholder:l,minYear:d=2060,maxYear:i=2090,className:g="",styles:a={}}){Te();const u=v!=="en",_=z(),[E,N]=x.useState(!1),[T,w]=x.useState(null),[W,O]=x.useState(!1),[j,P]=x.useState(!1),[b,R]=x.useState(()=>n?.year??z().year),[h,k]=x.useState(()=>n?.month??z().month),V=x.useRef(null),G=x.useRef(null);x.useEffect(()=>{const t=m=>{V.current&&!V.current.contains(m.target)&&(N(!1),O(!1),P(!1))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),x.useEffect(()=>{n&&(R(n.year),k(n.month))},[n]),x.useEffect(()=>{if(j&&G.current){const t=G.current.querySelector(".sel");t&&t.scrollIntoView({block:"center"})}},[j]);const te=x.useCallback(t=>{if(!t)return;c?.({year:b,month:h,day:t},A(b,h,t)),N(!1)},[b,h,c]),U=()=>{w("right"),setTimeout(()=>w(null),200),h===1?(k(12),R(t=>t-1)):k(t=>t-1)},oe=()=>{w("left"),setTimeout(()=>w(null),200),h===12?(k(1),R(t=>t+1)):k(t=>t+1)},ae=()=>{const t=z();R(t.year),k(t.month),c?.(t,A(t.year,t.month,t.day)),N(!1)},C=ne(b,h),M=ue(b,h),se=h===1?12:h-1,X=h===1?b-1:b,K=ne(X,se),q=Array.from({length:M},(t,m)=>({day:K-M+1+m,overflow:"prev"})),ee=Array.from({length:C},(t,m)=>({day:m+1,overflow:null})),re=42-(M+C),e=Array.from({length:re},(t,m)=>({day:m+1,overflow:"next"})),o=[...q,...ee,...e],s=u?me:he,p=u?je:Se,D=s[h-1],Y=u?I(b):String(b),S=A(b,h,1).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),J=n?u?`${I(n.year)} ${me[n.month-1]} ${I(n.day)}`:`${n.year} ${he[n.month-1]} ${n.day}`:"",ie=u?"मिति छान्नुहोस्":"Select BS date",ge=n?A(n.year,n.month,n.day):null,De=Array.from({length:i-d+1},(t,m)=>d+m),Ae={...a.primary&&{"--ndp-primary":a.primary},...a.primarySoft&&{"--ndp-primary-soft":a.primarySoft},...a.background&&{"--ndp-background":a.background},...a.text&&{"--ndp-text":a.text},...a.textMuted&&{"--ndp-text-muted":a.textMuted},...a.border&&{"--ndp-border":a.border},...a.todayBg&&{"--ndp-today-bg":a.todayBg},...a.controlsBg&&{"--ndp-controls-bg":a.controlsBg},...a.radius&&{"--ndp-radius":a.radius},...a.shadow&&{"--ndp-shadow":a.shadow}};return r.jsxs("div",{className:`ndp${g?` ${g}`:""}`,ref:V,style:Ae,children:[r.jsxs("div",{className:"ndp-wrap",onClick:()=>N(t=>!t),children:[r.jsx("input",{readOnly:!0,className:`ndp-input${E?" open":""}`,value:J,placeholder:l??ie}),r.jsx("span",{className:"ndp-icon",children:r.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),E&&r.jsxs("div",{className:"ndp-popup",children:[r.jsx("div",{className:"ndp-hd",children:r.jsxs("div",{className:"ndp-hd-row",children:[r.jsx("button",{className:"ndp-nav",onClick:U,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m15 18-6-6 6-6"})})}),r.jsxs("div",{className:`ndp-hd-center${T?` ndp-slide-${T}`:""}`,children:[r.jsx("div",{className:"ndp-hd-month",children:D}),r.jsxs("div",{className:"ndp-hd-sub",children:[Y," BS · ",S]})]}),r.jsx("button",{className:"ndp-nav",onClick:oe,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m9 18 6-6-6-6"})})})]})}),r.jsxs("div",{className:"ndp-controls",children:[r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${W?" active":""}`,onClick:()=>{O(t=>!t),P(!1)},children:[r.jsx("span",{children:D}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),W&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-months",children:s.map((t,m)=>r.jsx("button",{className:`ndp-dd-month-item${h===m+1?" sel":""}`,onClick:()=>{w(m+1<h?"right":"left"),setTimeout(()=>w(null),200),k(m+1),O(!1)},children:t},m))})})]}),r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${j?" active":""}`,onClick:()=>{P(t=>!t),O(!1)},children:[r.jsx("span",{children:Y}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),j&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-years",ref:G,children:De.map(t=>r.jsx("button",{className:`ndp-dd-year-item${b===t?" sel":""}`,onClick:()=>{R(t),P(!1)},children:u?I(t):t},t))})})]})]}),r.jsxs("div",{className:"ndp-body",children:[r.jsx("div",{className:"ndp-wdays",children:p.map((t,m)=>r.jsx("div",{className:"ndp-wday",children:t},m))}),r.jsx("div",{className:`ndp-grid${T?` ndp-slide-${T}`:""}`,children:o.map(({day:t,overflow:m},be)=>{const Oe=be%7===6,H=m!==null,Pe=!H&&t===_.day&&h===_.month&&b===_.year,Ce=!H&&n&&t===n.day&&h===n.month&&b===n.year;let $="ndp-cell";return H?$+=" overflow":Oe&&($+=" wknd"),Pe&&($+=" today"),Ce&&($+=" picked"),r.jsx("button",{className:$,disabled:H,onClick:()=>!H&&te(t),children:u?I(t):t},be)})})]}),r.jsxs("div",{className:"ndp-ft",children:[r.jsx("span",{className:"ndp-ad",children:ge?r.jsxs(r.Fragment,{children:[r.jsx("b",{children:"AD:"})," ",Ee(ge)]}):r.jsx("span",{style:{color:"var(--ndp-text-muted)",fontSize:12},children:u?"मिति छानिएको छैन":"No date selected"})}),r.jsx("button",{className:"ndp-today-btn",onClick:ae,children:u?"आज":"Today"})]})]})]})}y.NepaliDatePicker=Re,y.adToBs=fe,y.bsToAd=A,y.getDaysInBSMonth=ne,y.getFirstDayOfWeekBS=ue,y.getTodayBS=z,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@himal_bhattarai/nepali-datepicker",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Nepali Bikram Sambat (BS) date picker React component with BS↔AD conversion",
5
5
  "main": "./dist/nepali-datepicker.umd.js",
6
6
  "module": "./dist/nepali-datepicker.es.js",
@@ -10,7 +10,9 @@
10
10
  "require": "./dist/nepali-datepicker.umd.js"
11
11
  }
12
12
  },
13
- "files": ["dist"],
13
+ "files": [
14
+ "dist"
15
+ ],
14
16
  "scripts": {
15
17
  "build": "vite build",
16
18
  "prepublishOnly": "npm run build"
@@ -24,8 +26,15 @@
24
26
  "vite": "^5.0.0"
25
27
  },
26
28
  "keywords": [
27
- "nepali", "datepicker", "bikram", "sambat",
28
- "bs", "calendar", "react", "nepal", "bs-date"
29
+ "nepali",
30
+ "datepicker",
31
+ "bikram",
32
+ "sambat",
33
+ "bs",
34
+ "calendar",
35
+ "react",
36
+ "nepal",
37
+ "bs-date"
29
38
  ],
30
39
  "license": "MIT"
31
- }
40
+ }