@dotss/ui 1.0.2 → 1.0.4

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,15 +1,15 @@
1
- import { jsxs as v, jsx as f, Fragment as de } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as me, useState as X, useRef as W, useCallback as pe, useLayoutEffect as _t, useEffect as nt } from "react";
3
- import he from "../Flexbox/Flexbox.es.js";
4
- import Kt from "../Icon/Icon.es.js";
5
- import qt from "../IconButton/IconButton.es.js";
6
- import ye from "../Menu/Menu.es.js";
7
- import ge from "../Menu/MenuBlock/MenuBlock.es.js";
8
- import Ut from "../Menu/MenuButton/MenuButton.es.js";
9
- import De from "../core/useTheme.es.js";
1
+ import { jsxs as v, jsx as f, Fragment as pe } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as he, useState as X, useRef as R, useCallback as ye, useLayoutEffect as Kt, useEffect as J } from "react";
3
+ import ge from "../Flexbox/Flexbox.es.js";
4
+ import qt from "../Icon/Icon.es.js";
5
+ import Ut from "../IconButton/IconButton.es.js";
6
+ import De from "../Menu/Menu.es.js";
7
+ import we from "../Menu/MenuBlock/MenuBlock.es.js";
8
+ import Pt from "../Menu/MenuButton/MenuButton.es.js";
9
+ import $e from "../core/useTheme.es.js";
10
10
  import k from "@emotion/styled";
11
11
  import it from "../utils/getContrastingTextColor/getContrastingTextColor.es.js";
12
- const $e = k.div`
12
+ const be = k.div`
13
13
  position: relative;
14
14
  display: flex;
15
15
  flex-direction: column;
@@ -32,7 +32,7 @@ const $e = k.div`
32
32
  lineHeight: t.lineHeight,
33
33
  letterSpacing: t.letterSpacing
34
34
  })};
35
- `, we = k.div`
35
+ `, xe = k.div`
36
36
  display: flex;
37
37
  align-items: center;
38
38
  justify-content: center;
@@ -48,7 +48,7 @@ const $e = k.div`
48
48
  lineHeight: t.lineHeight,
49
49
  letterSpacing: t.letterSpacing
50
50
  })};
51
- `, be = k.div`
51
+ `, ke = k.div`
52
52
  display: flex;
53
53
  align-items: center;
54
54
  padding: 0 ${({ theme: { spacing: t }, edgeSpacing: n }) => t.content(n || 0)}px;
@@ -70,9 +70,9 @@ const $e = k.div`
70
70
  color: t[50]
71
71
  })};
72
72
  }
73
- `, xe = k.div`
73
+ `, Ae = k.div`
74
74
  overflow: hidden;
75
- `, ke = k.div`
75
+ `, Me = k.div`
76
76
  display: flex;
77
77
  transform: translate3d(0, 0, 0);
78
78
  `, Vt = k.div`
@@ -85,7 +85,7 @@ const $e = k.div`
85
85
  `, Jt = k.div`
86
86
  display: flex;
87
87
  width: 100%;
88
- `, Pt = k.div`
88
+ `, Qt = k.div`
89
89
  position: relative;
90
90
  display: inline-flex;
91
91
  align-items: center;
@@ -137,11 +137,11 @@ const $e = k.div`
137
137
  palette: { brand: t, grey: n }
138
138
  },
139
139
  variant: r,
140
- today: u,
140
+ today: l,
141
141
  selected: s
142
142
  }) => {
143
143
  if (s) {
144
- let y = {
144
+ let d = {
145
145
  fontWeight: 700,
146
146
  color: it(t.primary.main, [n.white, n[100]]),
147
147
  "& > div:nth-of-type(1):before": {
@@ -159,7 +159,7 @@ const $e = k.div`
159
159
  backgroundColor: t.primary.disable
160
160
  }
161
161
  };
162
- return r === "start" && (y = {
162
+ return r === "start" && (d = {
163
163
  fontWeight: 700,
164
164
  color: it(t.primary.main, [n.white, n[100]]),
165
165
  overflow: "hidden",
@@ -191,7 +191,7 @@ const $e = k.div`
191
191
  '&[aria-disabled="true"] > div:nth-of-type(1):after': {
192
192
  backgroundColor: t.primary.disable
193
193
  }
194
- }), r === "end" && (y = {
194
+ }), r === "end" && (d = {
195
195
  fontWeight: 700,
196
196
  color: it(t.primary.main, [n.white, n[100]]),
197
197
  overflow: "hidden",
@@ -223,7 +223,7 @@ const $e = k.div`
223
223
  '&[aria-disabled="true"] > div:nth-of-type(1):after': {
224
224
  backgroundColor: t.primary.disable
225
225
  }
226
- }), r === "middle" && (y = {
226
+ }), r === "middle" && (d = {
227
227
  fontWeight: 700,
228
228
  color: it(t.primary.main, [n.white, n[100]]),
229
229
  overflow: "hidden",
@@ -240,9 +240,9 @@ const $e = k.div`
240
240
  '&[aria-disabled="true"] > div:nth-of-type(1):after': {
241
241
  backgroundColor: t.primary.disable
242
242
  }
243
- }), y;
243
+ }), d;
244
244
  }
245
- return u ? {
245
+ return l ? {
246
246
  "& > div:nth-of-type(1):after": {
247
247
  content: '""',
248
248
  position: "absolute",
@@ -262,11 +262,11 @@ const $e = k.div`
262
262
  palette: { pink: t, brand: n }
263
263
  },
264
264
  holiday: r,
265
- selected: u
265
+ selected: l
266
266
  }) => {
267
267
  let s = null;
268
268
  return r && (s = {
269
- color: it(u ? n.primary.main : "transparent", [
269
+ color: it(l ? n.primary.main : "transparent", [
270
270
  t[30],
271
271
  t[100]
272
272
  ]),
@@ -275,99 +275,103 @@ const $e = k.div`
275
275
  }
276
276
  }), s;
277
277
  }}
278
- `, Qt = k.div`
278
+ `, Zt = k.div`
279
279
  display: flex;
280
280
  align-items: center;
281
281
  justify-content: center;
282
282
 
283
283
  cursor: ${({ clickable: t }) => t ? "pointer" : "default"};
284
- `, Zt = k.span`
284
+ `, Ct = k.span`
285
285
  width: 100%;
286
286
  min-width: 100%;
287
287
  height: 6px;
288
288
  min-height: 6px;
289
- `, Ae = 30, Ie = me(function({
289
+ `, Se = 30, te = 5, Ee = he(function({
290
290
  children: n,
291
291
  onChange: r,
292
- onChangeMonth: u,
292
+ onChangeMonth: l,
293
293
  value: s,
294
- date: y,
295
- minDate: d,
296
- maxDate: m,
294
+ date: d,
295
+ minDate: m,
296
+ maxDate: h,
297
297
  holidayDates: Rt,
298
- disableDates: _,
299
- showWeekHead: ee = !1,
300
- multiple: T = !1,
298
+ disableDates: B,
299
+ showWeekHead: ne = !1,
300
+ multiple: A = !1,
301
301
  period: ot = !1,
302
- enableMonthSelect: Z = !1,
303
- showToday: Wt = !1,
302
+ enableMonthSelect: C = !1,
303
+ showToday: Ht = !1,
304
304
  edgeSpacing: yt = 0,
305
- renderEvent: Y,
306
- inlineCSS: re,
305
+ renderEvent: z,
306
+ inlineCSS: ie,
307
307
  monthProps: st,
308
- ...ne
309
- }, ie) {
310
- const { spacing: Ht } = De(), [$, gt] = X(
311
- (typeof y == "string" || typeof y == "number" ? new Date(y) : y) || /* @__PURE__ */ new Date()
312
- ), [w, C] = X(() => Array.isArray(s) && s.length > 0 ? h(s[0]) : h(s)), [L, at] = X(() => Array.isArray(s) && s.length > 1 ? h(s[s.length - 1]) : null), [A, Ft] = X(0), [b, K] = X(1), [zt, Yt] = X(!1), [Dt, $t] = X(!1), tt = W(null), g = W(null), ct = W(0), F = W(0), R = W(!1), et = W(b), wt = W(), lt = W(null), bt = W(null), M = $.getFullYear(), ut = $.getMonth(), Lt = Tt(M, ut), I = B(ut), q = h(s), U = h(Rt), G = h(_), xt = P($, d) || ht($, d), kt = N($, m) || ht($, m), ft = new Date(M, ut - 1), dt = new Date(M, ut + 1), O = `${M}. ${I}`, j = `${M}년 ${I}월`, V = ot && !!w && !!L, It = [
308
+ ...oe
309
+ }, se) {
310
+ const { spacing: Wt } = $e(), [w, at] = X(
311
+ (typeof d == "string" || typeof d == "number" ? new Date(d) : d) || /* @__PURE__ */ new Date()
312
+ ), [$, tt] = X(() => Array.isArray(s) && s.length > 0 ? y(s[0]) : y(s)), [L, ct] = X(() => Array.isArray(s) && s.length > 1 ? y(s[s.length - 1]) : null), [M, Ft] = X(0), [b, K] = X(1), [Yt, zt] = X(!1), [gt, Dt] = X(!1), et = R(null), g = R(null), wt = R(0), Lt = R(0), F = R(0), H = R(!1), rt = R(b), $t = R(), lt = R(null), bt = R(null), S = w.getFullYear(), ut = w.getMonth(), It = vt(S, ut), I = _(ut), q = y(s), U = y(Rt), P = y(B), xt = Q(w, m) || ht(w, m), kt = N(w, h) || ht(w, h), ft = new Date(S, ut - 1), dt = new Date(S, ut + 1), O = `${S}. ${I}`, E = `${S}년 ${I}월`, G = ot && !!$ && !!L, Ot = [
313
313
  {
314
314
  year: ft.getFullYear(),
315
- month: B(ft.getMonth()),
316
- weeks: Tt(ft.getFullYear(), ft.getMonth())
315
+ month: _(ft.getMonth()),
316
+ weeks: vt(ft.getFullYear(), ft.getMonth())
317
317
  },
318
318
  {
319
- year: M,
319
+ year: S,
320
320
  month: I,
321
- weeks: Lt
321
+ weeks: It
322
322
  },
323
323
  {
324
324
  year: dt.getFullYear(),
325
- month: B(dt.getMonth()),
326
- weeks: Tt(dt.getFullYear(), dt.getMonth())
325
+ month: _(dt.getMonth()),
326
+ weeks: vt(dt.getFullYear(), dt.getMonth())
327
327
  }
328
- ], At = typeof Y == "function", oe = It[1].weeks.length * (Ae + (At ? 10 : 0) + Ht.content(2)) + Ht.content(2), Ot = (e) => () => {
329
- T && (g.current && (g.current.style.transition = "none", g.current.style.cursor = "grabbing"), ct.current = e, R.current = !0);
330
- }, E = pe(() => {
331
- if (!R.current) return;
332
- const e = A - F.current, c = Math.abs(A - e), o = A * 0.1;
333
- g.current && (g.current.style.transform = `translate3d(-${A * b}px, 0, 0)`, g.current.style.cursor = "grab", g.current.style.transition = "transform 0.2s"), ct.current = 0, F.current = 0, R.current = !1, !(c <= o) && (A < e ? K((a) => a + 1) : A > e && K((a) => a - 1));
334
- }, [A, b]), Mt = (e, c) => () => {
335
- if (!(R.current || b !== 1) && !c) {
328
+ ], At = typeof z == "function", ae = Ot[1].weeks.length * (Se + (At ? 10 : 0) + Wt.content(2)) + Wt.content(2), Et = (e, c) => () => {
329
+ g.current && (g.current.style.transition = "none", g.current.style.cursor = "grabbing"), wt.current = e, Lt.current = c;
330
+ }, j = ye(() => {
331
+ if (!H.current) return;
332
+ const e = M - F.current, c = Math.abs(M - e), o = M * 0.1;
333
+ g.current && (g.current.style.transform = `translate3d(-${M * b}px, 0, 0)`, g.current.style.cursor = "grab", g.current.style.transition = "transform 0.2s"), wt.current = 0, F.current = 0, H.current = !1, !(c <= o) && (M < e ? K((a) => a + 1) : M > e && K((a) => a - 1));
334
+ }, [M, b]), Mt = (e, c) => () => {
335
+ if (!(H.current || b !== 1) && !c) {
336
336
  if (!ot) {
337
- r == null || r(e, h);
337
+ r == null || r(e, y);
338
338
  return;
339
339
  }
340
- if (H(e, w) && Array.isArray(s) && s.length === 1) {
341
- C(null), at(null), r == null || r([], h);
340
+ if (W(e, $) && Array.isArray(s) && s.length === 1) {
341
+ tt(null), ct(null), r == null || r([], y);
342
342
  return;
343
- } else if (H(e, w) && !Array.isArray(s) && H(e, s)) {
344
- C(null), at(null), r == null || r([], h);
343
+ } else if (W(e, $) && !Array.isArray(s) && W(e, s)) {
344
+ tt(null), ct(null), r == null || r([], y);
345
345
  return;
346
346
  }
347
- if (!w) {
348
- C(e), r == null || r(e, h);
347
+ if (!$) {
348
+ tt(e), r == null || r(e, y);
349
349
  return;
350
350
  }
351
- if (!L && w) {
352
- const [o, a] = N(e, w) ? [w, e] : [e, w];
353
- C(o), at(a);
354
- const i = te([o, a], _);
355
- r == null || r(i, h);
351
+ if (!L && $) {
352
+ const [o, a] = N(e, $) ? [$, e] : [e, $];
353
+ tt(o), ct(a);
354
+ const i = re([o, a], B);
355
+ r == null || r(i, y);
356
356
  return;
357
357
  }
358
- w && L && (C(e), at(null), r == null || r(e, h));
358
+ $ && L && (tt(e), ct(null), r == null || r(e, y));
359
359
  }
360
- }, se = (e) => Ot(e.clientX)(), ae = (e) => Ot(e.touches[0].clientX)(), jt = () => {
361
- zt || (g.current && (g.current.style.transition = "transform 0.2s"), K((e) => e - 1));
362
- }, Et = () => {
363
- zt || (g.current && (g.current.style.transition = "transform 0.2s"), K((e) => e + 1));
360
+ }, ce = (e) => {
361
+ A && (H.current = !0, Et(e.clientX, e.clientY)());
362
+ }, le = (e) => {
363
+ A && Et(e.touches[0].clientX, e.touches[0].clientY)();
364
+ }, jt = () => {
365
+ Yt || (g.current && (g.current.style.transition = "transform 0.2s"), K((e) => e - 1));
366
+ }, Xt = () => {
367
+ Yt || (g.current && (g.current.style.transition = "transform 0.2s"), K((e) => e + 1));
364
368
  }, mt = (e) => {
365
- e.stopPropagation(), $t((c) => !c);
366
- }, ce = () => $t(!1), le = (e) => {
369
+ e.stopPropagation(), Dt((c) => !c);
370
+ }, ue = () => Dt(!1), fe = (e) => {
367
371
  if (!e) return;
368
372
  const [c, o] = e.toString().split(".").map(Number);
369
- gt(new Date(c, o - 1)), u && typeof u == "function" && u(h(new Date(c, o - 1)), h), $t(!1);
370
- }, Xt = (e, c) => (o) => {
373
+ at(new Date(c, o - 1)), l && typeof l == "function" && l(y(new Date(c, o - 1)), y), Dt(!1);
374
+ }, Nt = (e, c) => (o) => {
371
375
  const a = new Date(e);
372
376
  let i = null;
373
377
  if (o.stopPropagation(), o.key === "ArrowRight")
@@ -390,79 +394,79 @@ const $e = k.div`
390
394
  o.preventDefault(), Mt(e, c)();
391
395
  return;
392
396
  } else if (o.key === "Escape") {
393
- o.preventDefault(), r == null || r([], h);
397
+ o.preventDefault(), r == null || r([], y);
394
398
  return;
395
399
  }
396
- if (i && tt.current) {
397
- const D = a.getMonth(), p = a.getFullYear(), x = i.getMonth(), l = i.getFullYear(), S = h(i), z = tt.current.querySelector(
398
- `[data-date="${S}"]`
400
+ if (i && et.current) {
401
+ const D = a.getMonth(), p = a.getFullYear(), x = i.getMonth(), u = i.getFullYear(), T = y(i), Y = et.current.querySelector(
402
+ `[data-date="${T}"]`
399
403
  );
400
- if (z) {
401
- if (D !== x || p !== l) {
402
- i > a ? (Et(), setTimeout(() => {
403
- z.focus();
404
+ if (Y) {
405
+ if (D !== x || p !== u) {
406
+ i > a ? (Xt(), setTimeout(() => {
407
+ Y.focus();
404
408
  }, 0)) : (jt(), setTimeout(() => {
405
- z.focus();
409
+ Y.focus();
406
410
  }, 0));
407
411
  return;
408
412
  }
409
- z.focus();
413
+ Y.focus();
410
414
  }
411
415
  }
412
416
  };
413
- return _t(() => {
417
+ return Kt(() => {
414
418
  var e;
415
- Ft(((e = tt.current) == null ? void 0 : e.clientWidth) || 0);
416
- }, [T]), nt(() => {
419
+ Ft(((e = et.current) == null ? void 0 : e.clientWidth) || 0);
420
+ }, [A]), J(() => {
417
421
  const e = () => {
418
422
  var c;
419
- Ft(((c = tt.current) == null ? void 0 : c.clientWidth) || 0);
423
+ Ft(((c = et.current) == null ? void 0 : c.clientWidth) || 0);
420
424
  };
421
425
  return window.addEventListener("resize", e), window.addEventListener("scroll", e), () => {
422
426
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e);
423
427
  };
424
- }, [T]), nt(() => {
428
+ }, [A]), J(() => {
425
429
  const e = g.current, c = (i, D, p) => {
426
- if (!e || !R.current) return;
427
- F.current = i - ct.current;
428
- const x = D - ct.current, l = 5;
429
- if (R.current = R.current || Math.abs(F.current) > l && Math.abs(x) < l * 2, p.cancelable && p.preventDefault(), R.current) {
430
+ if (!e) return;
431
+ F.current = i - wt.current;
432
+ const x = D - Lt.current;
433
+ if (H.current = H.current || Math.abs(F.current) > te && Math.abs(x) < te * 2, H.current && p.cancelable && (p.preventDefault(), p.stopPropagation()), H.current) {
430
434
  if (xt && F.current > 0) {
431
- E();
435
+ j();
432
436
  return;
433
437
  }
434
438
  if (kt && F.current < 0) {
435
- E();
439
+ j();
436
440
  return;
437
441
  }
438
- Math.abs(F.current) >= 10 && (e.style.transform = `translate3d(${F.current - A * b}px, 0, 0)`, e.style.cursor = "grabbing");
442
+ Math.abs(F.current) >= 10 && (e.style.transform = `translate3d(${F.current - M * b}px, 0, 0)`, e.style.cursor = "grabbing");
439
443
  }
440
444
  }, o = (i) => c(i.touches[0].clientX, i.touches[0].clientY, i), a = (i) => {
441
- R.current && c(i.clientX, i.clientY, i);
445
+ H.current && c(i.clientX, i.clientY, i);
442
446
  };
443
447
  return e == null || e.addEventListener("mousemove", a), e == null || e.addEventListener("touchmove", o), () => {
444
448
  e == null || e.removeEventListener("mousemove", a), e == null || e.removeEventListener("touchmove", o);
445
449
  };
446
- }, [A, b, E, kt, xt]), nt(() => {
447
- Yt(!0), wt.current = setTimeout(() => {
448
- if (g.current && (g.current.style.transition = "none"), b > et.current) {
450
+ }, [M, b, j, kt, xt]), J(() => {
451
+ zt(!0), $t.current = setTimeout(() => {
452
+ if (g.current && (g.current.style.transition = "none"), b > rt.current) {
449
453
  K(1);
450
- const e = new Date($.setMonth($.getMonth() + 1));
451
- gt(e), u && typeof u == "function" && u(h(e), h), et.current = 1;
452
- } else if (b < et.current) {
453
- const e = new Date($.setMonth($.getMonth() - 1));
454
- gt(e), u && typeof u == "function" && u(h(e), h), K(1), et.current = 1;
454
+ const e = new Date(w.setMonth(w.getMonth() + 1));
455
+ at(e), l && typeof l == "function" && l(y(e), y), rt.current = 1;
456
+ } else if (b < rt.current) {
457
+ const e = new Date(w.setMonth(w.getMonth() - 1));
458
+ at(e), l && typeof l == "function" && l(y(e), y), K(1), rt.current = 1;
455
459
  } else
456
- et.current = b;
457
- Yt(!1);
460
+ rt.current = b;
461
+ zt(!1);
458
462
  }, 200);
459
- }, [b, $, u]), _t(() => {
463
+ }, [b, w, l]), Kt(() => {
460
464
  if (!ot || !Array.isArray(s)) return;
461
- const e = te(s, _);
462
- s.length < e.length && (r == null || r(e, h));
463
- }, [ot, s, r, _]), nt(() => {
465
+ const e = re(s, B);
466
+ s.length < e.length && (r == null || r(e, y));
467
+ }, [ot, s, r, B]), J(() => {
464
468
  let e;
465
- return Dt && (e = setTimeout(() => {
469
+ return gt && (e = setTimeout(() => {
466
470
  if (bt.current) {
467
471
  const c = bt.current.querySelector("ul"), o = c == null ? void 0 : c.querySelector(`[data-value="${O}"]`);
468
472
  o == null || o.scrollIntoView({
@@ -472,32 +476,36 @@ const $e = k.div`
472
476
  }, 200)), () => {
473
477
  clearTimeout(e);
474
478
  };
475
- }, [Dt, O]), nt(() => () => {
476
- wt.current && clearTimeout(wt.current);
477
- }, []), /* @__PURE__ */ v($e, { ref: ie, "aria-label": "달력", role: "application", ...ne, css: re, children: [
478
- T ? /* @__PURE__ */ v(we, { children: [
479
+ }, [gt, O]), J(() => () => {
480
+ $t.current && clearTimeout($t.current);
481
+ }, []), J(() => {
482
+ d && at(
483
+ (typeof d == "string" || typeof d == "number" ? new Date(d) : d) || /* @__PURE__ */ new Date()
484
+ );
485
+ }, [d]), /* @__PURE__ */ v(be, { ref: se, "aria-label": "달력", role: "application", ...oe, css: ie, children: [
486
+ A ? /* @__PURE__ */ v(xe, { children: [
479
487
  /* @__PURE__ */ f(
480
- qt,
488
+ Ut,
481
489
  {
482
490
  name: "ChevronLeftLine",
483
491
  size: "small",
484
492
  onClick: jt,
485
493
  disabled: xt,
486
- "aria-label": `이전 달로 이동, 현재 ${j}`
494
+ "aria-label": `이전 달로 이동, 현재 ${E}`
487
495
  }
488
496
  ),
489
- Z && /* @__PURE__ */ v(
490
- Qt,
497
+ C && /* @__PURE__ */ v(
498
+ Zt,
491
499
  {
492
500
  ref: lt,
493
501
  clickable: !0,
494
502
  onClick: mt,
495
- "aria-label": j,
503
+ "aria-label": E,
496
504
  ...st,
497
505
  children: [
498
506
  O,
499
507
  /* @__PURE__ */ f(
500
- Ut,
508
+ Pt,
501
509
  {
502
510
  iconOnly: !0,
503
511
  isMenuOpen: !1,
@@ -505,47 +513,47 @@ const $e = k.div`
505
513
  variant: "text",
506
514
  menuId: "date-picker-month-menu",
507
515
  onClick: mt,
508
- "aria-label": `달 변경, 현재 ${j}`,
509
- startAdornment: /* @__PURE__ */ f(Kt, { name: "ArrowDownFill", size: "xSmall" })
516
+ "aria-label": `달 변경, 현재 ${E}`,
517
+ startAdornment: /* @__PURE__ */ f(qt, { name: "ArrowDownFill", size: "xSmall" })
510
518
  }
511
519
  )
512
520
  ]
513
521
  }
514
522
  ),
515
- !Z && /* @__PURE__ */ f(
516
- Qt,
523
+ !C && /* @__PURE__ */ f(
524
+ Zt,
517
525
  {
518
526
  ref: lt,
519
527
  id: "date-picker-title",
520
528
  clickable: !1,
521
- "aria-label": j,
529
+ "aria-label": E,
522
530
  ...st,
523
531
  children: O
524
532
  }
525
533
  ),
526
534
  /* @__PURE__ */ f(
527
- qt,
535
+ Ut,
528
536
  {
529
537
  name: "ChevronRightLine",
530
538
  size: "small",
531
- onClick: Et,
539
+ onClick: Xt,
532
540
  disabled: kt,
533
- "aria-label": `다음 달로 이동, 현재 ${j}`
541
+ "aria-label": `다음 달로 이동, 현재 ${E}`
534
542
  }
535
543
  )
536
- ] }) : /* @__PURE__ */ v(de, { children: [
537
- Z && /* @__PURE__ */ v(
544
+ ] }) : /* @__PURE__ */ v(pe, { children: [
545
+ C && /* @__PURE__ */ v(
538
546
  Gt,
539
547
  {
540
548
  ref: lt,
541
549
  clickable: !0,
542
550
  onClick: mt,
543
- "aria-label": j,
551
+ "aria-label": E,
544
552
  ...st,
545
553
  children: [
546
554
  O,
547
555
  /* @__PURE__ */ f(
548
- Ut,
556
+ Pt,
549
557
  {
550
558
  iconOnly: !0,
551
559
  isMenuOpen: !1,
@@ -553,35 +561,35 @@ const $e = k.div`
553
561
  variant: "text",
554
562
  menuId: "date-picker-month-menu",
555
563
  onClick: mt,
556
- "aria-label": `달 변경, 현재 ${j}`,
557
- startAdornment: /* @__PURE__ */ f(Kt, { name: "ArrowDownFill", size: "xSmall" })
564
+ "aria-label": `달 변경, 현재 ${E}`,
565
+ startAdornment: /* @__PURE__ */ f(qt, { name: "ArrowDownFill", size: "xSmall" })
558
566
  }
559
567
  )
560
568
  ]
561
569
  }
562
570
  ),
563
- !Z && /* @__PURE__ */ f(Gt, { id: "date-picker-title", clickable: !1, ...st, children: O })
571
+ !C && /* @__PURE__ */ f(Gt, { id: "date-picker-title", clickable: !1, ...st, children: O })
564
572
  ] }),
565
- Z && /* @__PURE__ */ f(
566
- ye,
573
+ C && /* @__PURE__ */ f(
574
+ De,
567
575
  {
568
576
  id: "date-picker-month-menu",
569
577
  anchorRef: lt,
570
578
  ref: bt,
571
- open: Dt,
572
- onClose: ce,
573
- onChange: le,
579
+ open: gt,
580
+ onClose: ue,
581
+ onChange: fe,
574
582
  value: O,
575
- placement: T ? "bottom-center" : "bottom-left",
583
+ placement: A ? "bottom-center" : "bottom-left",
576
584
  width: 160,
577
585
  fitToAnchorWidth: !1,
578
586
  maxHeight: 368,
579
587
  children: Array.from({ length: 130 }, (e, c) => {
580
588
  const o = 1970 + c;
581
589
  return Array.from({ length: 12 }, (a, i) => {
582
- const D = i + 1, p = D < 10 ? `0${D}` : D, x = new Date(o, i + 1, 0).getDate(), l = `${o}-${p}-${x}`, S = `${o}-${p}-01`;
583
- return P(l, d) || N(S, m) ? null : /* @__PURE__ */ f(
584
- ge,
590
+ const D = i + 1, p = D < 10 ? `0${D}` : D, x = new Date(o, i + 1, 0).getDate(), u = `${o}-${p}-${x}`, T = `${o}-${p}-01`;
591
+ return Q(u, m) || N(T, h) ? null : /* @__PURE__ */ f(
592
+ we,
585
593
  {
586
594
  value: `${o}. ${p}`,
587
595
  "aria-label": `${o}년 ${p}월 선택`,
@@ -594,13 +602,13 @@ const $e = k.div`
594
602
  }
595
603
  ),
596
604
  /* @__PURE__ */ v(
597
- he,
605
+ ge,
598
606
  {
599
607
  flexDirection: "column",
600
608
  role: "grid",
601
- "aria-label": `${M}년 ${I}월 달력`,
609
+ "aria-label": `${S}년 ${I}월 달력`,
602
610
  children: [
603
- ee && /* @__PURE__ */ v(be, { id: "date-picker-week-head", role: "row", edgeSpacing: yt, children: [
611
+ ne && /* @__PURE__ */ v(ke, { id: "date-picker-week-head", role: "row", edgeSpacing: yt, children: [
604
612
  /* @__PURE__ */ f("span", { role: "columnheader", children: "일" }),
605
613
  /* @__PURE__ */ f("span", { role: "columnheader", children: "월" }),
606
614
  /* @__PURE__ */ f("span", { role: "columnheader", children: "화" }),
@@ -609,24 +617,24 @@ const $e = k.div`
609
617
  /* @__PURE__ */ f("span", { role: "columnheader", children: "금" }),
610
618
  /* @__PURE__ */ f("span", { role: "columnheader", children: "토" })
611
619
  ] }),
612
- /* @__PURE__ */ f(xe, { ref: tt, role: "presentation", children: /* @__PURE__ */ v(
613
- ke,
620
+ /* @__PURE__ */ f(Ae, { ref: et, role: "presentation", children: /* @__PURE__ */ v(
621
+ Me,
614
622
  {
615
623
  role: "presentation",
616
624
  ref: g,
617
- onMouseDown: se,
618
- onMouseUp: E,
619
- onMouseLeave: E,
620
- onTouchStart: ae,
621
- onTouchEnd: E,
622
- onTouchCancel: E,
625
+ onMouseDown: ce,
626
+ onMouseUp: j,
627
+ onMouseLeave: j,
628
+ onTouchStart: le,
629
+ onTouchEnd: j,
630
+ onTouchCancel: j,
623
631
  style: {
624
- transform: T ? `translate3d(-${A * b}px, 0, 0)` : void 0,
625
- cursor: T ? "grab" : void 0,
626
- maxHeight: oe
632
+ transform: A ? `translate3d(-${M * b}px, 0, 0)` : void 0,
633
+ cursor: A ? "grab" : void 0,
634
+ maxHeight: ae
627
635
  },
628
636
  children: [
629
- T && It.map(
637
+ A && Ot.map(
630
638
  ({ year: e, month: c, weeks: o }, a) => /* @__PURE__ */ f(
631
639
  Vt,
632
640
  {
@@ -638,32 +646,32 @@ const $e = k.div`
638
646
  {
639
647
  role: "row",
640
648
  children: i.map((p, x) => {
641
- const l = `${e}-${c}-${Q(p || 0)}`, S = !p, z = H(l, /* @__PURE__ */ new Date()), St = Array.isArray(U) ? U.includes(l) : U === l, rt = Array.isArray(q) ? q.includes(l) : q === l, J = !p || (Array.isArray(G) ? G.includes(l) : G === l) || N(l, m) || P(l, d), vt = V && H(l, w), pt = V && H(l, L), ue = V && N(l, w) && P(l, L), Nt = ht(l, $), fe = Nt && D === 0 && p === 1 || Nt && rt, Bt = Y == null ? void 0 : Y(l);
649
+ const u = `${e}-${c}-${Z(p || 0)}`, T = !p, Y = W(u, /* @__PURE__ */ new Date()), St = Array.isArray(U) ? U.includes(u) : U === u, nt = Array.isArray(q) ? q.includes(u) : q === u, V = !p || (Array.isArray(P) ? P.includes(u) : P === u) || N(u, h) || Q(u, m), Tt = G && W(u, $), pt = G && W(u, L), de = G && N(u, $) && Q(u, L), _t = ht(u, w), me = _t && D === 0 && p === 1 || _t && nt, Bt = z == null ? void 0 : z(u);
642
650
  return /* @__PURE__ */ v(
643
- Pt,
651
+ Qt,
644
652
  {
645
653
  as: "button",
646
654
  role: "gridcell",
647
- variant: vt ? "start" : pt ? "end" : ue ? "middle" : void 0,
648
- onClick: Mt(l, J),
649
- today: Wt && z,
655
+ variant: Tt ? "start" : pt ? "end" : de ? "middle" : void 0,
656
+ onClick: Mt(u, V),
657
+ today: Ht && Y,
650
658
  holiday: St,
651
- tabIndex: fe ? 0 : -1,
659
+ tabIndex: me ? 0 : -1,
652
660
  "aria-rowindex": D + 1,
653
661
  "aria-colindex": x + 1,
654
- selected: rt,
655
- "aria-selected": rt,
656
- "aria-disabled": J,
662
+ selected: nt,
663
+ "aria-selected": nt,
664
+ "aria-disabled": V,
657
665
  "aria-hidden": p === null,
658
- "data-date": l,
659
- onKeyDown: Xt(l, J),
666
+ "data-date": u,
667
+ onKeyDown: Nt(u, V),
660
668
  children: [
661
- /* @__PURE__ */ f("div", { "aria-label": `${Ct(l)}`, children: /* @__PURE__ */ f("span", { children: p }) }),
662
- !S && Bt,
663
- !S && At && !Bt && /* @__PURE__ */ f(Zt, {})
669
+ /* @__PURE__ */ f("div", { "aria-label": `${ee(u)}`, children: /* @__PURE__ */ f("span", { children: p }) }),
670
+ !T && Bt,
671
+ !T && At && !Bt && /* @__PURE__ */ f(Ct, {})
664
672
  ]
665
673
  },
666
- `${e}-${c}-week-row-${x}-${p ? l : `${D}-${x}`}`
674
+ `${e}-${c}-week-row-${x}-${p ? u : `${D}-${x}`}`
667
675
  );
668
676
  })
669
677
  },
@@ -673,41 +681,41 @@ const $e = k.div`
673
681
  `week-body-${e}-${c}`
674
682
  )
675
683
  ),
676
- !T && /* @__PURE__ */ f(Vt, { role: "rowgroup", edgeSpacing: yt, children: Lt.map((e, c) => /* @__PURE__ */ f(
684
+ !A && /* @__PURE__ */ f(Vt, { role: "rowgroup", edgeSpacing: yt, children: It.map((e, c) => /* @__PURE__ */ f(
677
685
  Jt,
678
686
  {
679
687
  role: "row",
680
688
  children: e.map((o, a) => {
681
- const i = `${M}-${I}-${Q(o || 0)}`, D = !o, p = H(i, /* @__PURE__ */ new Date()), x = Array.isArray(U) ? U.includes(i) : U === i, l = Array.isArray(q) ? q.includes(i) : q === i, S = !o || (Array.isArray(G) ? G.includes(i) : G === i) || N(i, m) || P(i, d), z = V && H(i, w), St = V && H(i, L), rt = V && N(i, w) && P(i, L), J = ht(i, $), vt = J && c === 0 && o === 1 || J && l, pt = Y == null ? void 0 : Y(i);
689
+ const i = `${S}-${I}-${Z(o || 0)}`, D = !o, p = W(i, /* @__PURE__ */ new Date()), x = Array.isArray(U) ? U.includes(i) : U === i, u = Array.isArray(q) ? q.includes(i) : q === i, T = !o || (Array.isArray(P) ? P.includes(i) : P === i) || N(i, h) || Q(i, m), Y = G && W(i, $), St = G && W(i, L), nt = G && N(i, $) && Q(i, L), V = ht(i, w), Tt = V && c === 0 && o === 1 || V && u, pt = z == null ? void 0 : z(i);
682
690
  return /* @__PURE__ */ v(
683
- Pt,
691
+ Qt,
684
692
  {
685
693
  as: "button",
686
- variant: z ? "start" : St ? "end" : rt ? "middle" : void 0,
694
+ variant: Y ? "start" : St ? "end" : nt ? "middle" : void 0,
687
695
  role: "gridcell",
688
- onClick: Mt(i, S),
689
- today: Wt && p,
696
+ onClick: Mt(i, T),
697
+ today: Ht && p,
690
698
  holiday: x,
691
699
  "aria-rowindex": c + 1,
692
700
  "aria-colindex": a + 1,
693
- selected: l,
694
- "aria-selected": l,
695
- "aria-disabled": S,
701
+ selected: u,
702
+ "aria-selected": u,
703
+ "aria-disabled": T,
696
704
  "aria-hidden": o === null,
697
- tabIndex: vt ? 0 : -1,
705
+ tabIndex: Tt ? 0 : -1,
698
706
  "data-date": i,
699
- onKeyDown: Xt(i, S),
707
+ onKeyDown: Nt(i, T),
700
708
  children: [
701
- /* @__PURE__ */ f("div", { "aria-label": `${Ct(i)}`, children: /* @__PURE__ */ f("span", { children: o }) }),
709
+ /* @__PURE__ */ f("div", { "aria-label": `${ee(i)}`, children: /* @__PURE__ */ f("span", { children: o }) }),
702
710
  !D && pt,
703
- !D && At && !pt && /* @__PURE__ */ f(Zt, {})
711
+ !D && At && !pt && /* @__PURE__ */ f(Ct, {})
704
712
  ]
705
713
  },
706
- `${M}-${I}-week-row-${e}-${o ? i : `${c}-${a}`}`
714
+ `${S}-${I}-week-row-${e}-${o ? i : `${c}-${a}`}`
707
715
  );
708
716
  })
709
717
  },
710
- `${M}-${I}-week-row-${String(e)}`
718
+ `${S}-${I}-week-row-${String(e)}`
711
719
  )) })
712
720
  ]
713
721
  }
@@ -718,93 +726,93 @@ const $e = k.div`
718
726
  n
719
727
  ] });
720
728
  });
721
- function Tt(t, n) {
729
+ function vt(t, n) {
722
730
  let r = [];
723
- const u = new Date(t, n, 1), s = new Date(t, n + 1, 0).getDate(), y = u.getDay();
724
- let d = Array.from({ length: y }).fill(null);
725
- for (let m = 1; m <= s; m += 1)
726
- d.push(m), (d.length === 7 || m === s) && (r.push(d), d = []);
731
+ const l = new Date(t, n, 1), s = new Date(t, n + 1, 0).getDate(), d = l.getDay();
732
+ let m = Array.from({ length: d }).fill(null);
733
+ for (let h = 1; h <= s; h += 1)
734
+ m.push(h), (m.length === 7 || h === s) && (r.push(m), m = []);
727
735
  return r = r.map(
728
- (m) => Array.from({ length: 7 }).map((Rt, _) => m[_] || null)
736
+ (h) => Array.from({ length: 7 }).map((Rt, B) => h[B] || null)
729
737
  ), r;
730
738
  }
731
- function B(t) {
739
+ function _(t) {
732
740
  return String(t + 1).length === 1 ? `0${t + 1}` : t + 1;
733
741
  }
734
- function Q(t) {
742
+ function Z(t) {
735
743
  return String(t).length === 1 ? `0${t}` : t;
736
744
  }
737
- function h(t) {
745
+ function y(t) {
738
746
  if (Array.isArray(t))
739
- return t.map((n) => n instanceof Date ? `${n.getFullYear()}-${B(n.getMonth())}-${Q(n.getDate())}` : n);
747
+ return t.map((n) => n instanceof Date ? `${n.getFullYear()}-${_(n.getMonth())}-${Z(n.getDate())}` : n);
740
748
  if (t instanceof Date)
741
- return `${t.getFullYear()}-${B(t.getMonth())}-${Q(t.getDate())}`;
749
+ return `${t.getFullYear()}-${_(t.getMonth())}-${Z(t.getDate())}`;
742
750
  if (typeof t == "number") {
743
751
  const n = new Date(t);
744
- return `${n.getFullYear()}-${B(n.getMonth())}-${Q(n.getDate())}`;
752
+ return `${n.getFullYear()}-${_(n.getMonth())}-${Z(n.getDate())}`;
745
753
  }
746
754
  return t;
747
755
  }
748
- function Ct(t) {
749
- const [n, r, u] = t.split("-");
750
- return `${n}년 ${Number(r)}월 ${Number(u)}일`;
756
+ function ee(t) {
757
+ const [n, r, l] = t.split("-");
758
+ return `${n}년 ${Number(r)}월 ${Number(l)}일`;
751
759
  }
752
760
  function N(t, n) {
753
761
  if (!t || !n)
754
762
  return !1;
755
763
  const r = t instanceof Date ? t : new Date(t);
756
764
  r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0);
757
- const u = r.getTime(), s = n instanceof Date ? n : new Date(n);
765
+ const l = r.getTime(), s = n instanceof Date ? n : new Date(n);
758
766
  s.setHours(0), s.setMinutes(0), s.setSeconds(0), s.setMilliseconds(0);
759
- const y = s.getTime();
760
- return u > y;
767
+ const d = s.getTime();
768
+ return l > d;
761
769
  }
762
- function P(t, n) {
770
+ function Q(t, n) {
763
771
  if (!t || !n)
764
772
  return !1;
765
773
  const r = t instanceof Date ? t : new Date(t);
766
774
  r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0);
767
- const u = r.getTime(), s = n instanceof Date ? n : new Date(n);
775
+ const l = r.getTime(), s = n instanceof Date ? n : new Date(n);
768
776
  s.setHours(0), s.setMinutes(0), s.setSeconds(0), s.setMilliseconds(0);
769
- const y = s.getTime();
770
- return u < y;
777
+ const d = s.getTime();
778
+ return l < d;
771
779
  }
772
780
  function ht(t, n) {
773
781
  if (!t || !n)
774
782
  return !1;
775
- const r = t instanceof Date ? t : new Date(t), u = n instanceof Date ? n : new Date(n);
776
- return `${r.getFullYear()}-${r.getMonth()}` == `${u.getFullYear()}-${u.getMonth()}`;
783
+ const r = t instanceof Date ? t : new Date(t), l = n instanceof Date ? n : new Date(n);
784
+ return `${r.getFullYear()}-${r.getMonth()}` == `${l.getFullYear()}-${l.getMonth()}`;
777
785
  }
778
- function H(t, n) {
786
+ function W(t, n) {
779
787
  if (!t || !n)
780
788
  return !1;
781
789
  const r = t instanceof Date ? t : new Date(t);
782
790
  r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0);
783
- const u = r.getTime(), s = n instanceof Date ? n : new Date(n);
791
+ const l = r.getTime(), s = n instanceof Date ? n : new Date(n);
784
792
  s.setHours(0), s.setMinutes(0), s.setSeconds(0), s.setMilliseconds(0);
785
- const y = s.getTime();
786
- return u === y;
793
+ const d = s.getTime();
794
+ return l === d;
787
795
  }
788
- function te(t, n) {
796
+ function re(t, n) {
789
797
  if (!t || !Array.isArray(t) || t.length === 0)
790
798
  return [];
791
- const r = t.map((m) => m instanceof Date ? m : m === null ? /* @__PURE__ */ new Date() : new Date(m)), u = new Date(Math.min(...r.map((m) => m.getTime()))), s = new Date(Math.max(...r.map((m) => m.getTime()))), y = [], d = new Date(u);
792
- for (; d <= s; ) {
793
- if (Array.isArray(n) && n.includes(d)) {
794
- d.setDate(d.getDate() + 1);
799
+ const r = t.map((h) => h instanceof Date ? h : h === null ? /* @__PURE__ */ new Date() : new Date(h)), l = new Date(Math.min(...r.map((h) => h.getTime()))), s = new Date(Math.max(...r.map((h) => h.getTime()))), d = [], m = new Date(l);
800
+ for (; m <= s; ) {
801
+ if (Array.isArray(n) && n.includes(m)) {
802
+ m.setDate(m.getDate() + 1);
795
803
  continue;
796
- } else if (n === d) {
797
- d.setDate(d.getDate() + 1);
804
+ } else if (n === m) {
805
+ m.setDate(m.getDate() + 1);
798
806
  continue;
799
807
  }
800
- y.push(
801
- `${d.getFullYear()}-${B(d.getMonth())}-${Q(
802
- d.getDate()
808
+ d.push(
809
+ `${m.getFullYear()}-${_(m.getMonth())}-${Z(
810
+ m.getDate()
803
811
  )}`
804
- ), d.setDate(d.getDate() + 1);
812
+ ), m.setDate(m.getDate() + 1);
805
813
  }
806
- return y;
814
+ return d;
807
815
  }
808
816
  export {
809
- Ie as default
817
+ Ee as default
810
818
  };