@photon-ai/pho-ui 4.26.0 → 4.27.1

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.
Files changed (128) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
  3. package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
  4. package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
  5. package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
  6. package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
  7. package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
  8. package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
  9. package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
  10. package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
  11. package/dist/chunks/chat-D6SGRahp.js.map +1 -0
  12. package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
  13. package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
  14. package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
  15. package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
  16. package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
  17. package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
  18. package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
  19. package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
  20. package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
  21. package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
  22. package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
  23. package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
  24. package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
  25. package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
  26. package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
  27. package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
  28. package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
  29. package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
  30. package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
  31. package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
  32. package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
  33. package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
  34. package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
  35. package/dist/chunks/input-hrrPhzXp.js.map +1 -0
  36. package/dist/chunks/{message-DRAWQlW-.js → message-DO-zoM2w.js} +7 -8
  37. package/dist/chunks/message-DO-zoM2w.js.map +1 -0
  38. package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
  39. package/dist/chunks/select-DlyDd7AB.js.map +1 -0
  40. package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
  41. package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
  42. package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
  43. package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
  44. package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
  45. package/dist/chunks/trace-CKYAff2U.js.map +1 -0
  46. package/dist/components/avatar.js +1 -1
  47. package/dist/components/button.js +1 -1
  48. package/dist/components/calendar.js +1 -1
  49. package/dist/components/chat.js +1 -1
  50. package/dist/components/checkbox.js +1 -1
  51. package/dist/components/code-block.js +1 -1
  52. package/dist/components/command.js +36 -37
  53. package/dist/components/command.js.map +1 -1
  54. package/dist/components/copy-button.js +1 -1
  55. package/dist/components/data-table.js +2 -2
  56. package/dist/components/date-picker.js +1 -1
  57. package/dist/components/description-list.js +1 -1
  58. package/dist/components/dialog.js +1 -1
  59. package/dist/components/error.js +252 -11
  60. package/dist/components/error.js.map +1 -0
  61. package/dist/components/filter-bar.js +1 -1
  62. package/dist/components/input.js +1 -1
  63. package/dist/components/message.js +1 -1
  64. package/dist/components/notification.js +27 -34
  65. package/dist/components/notification.js.map +1 -1
  66. package/dist/components/phone-input.js +3 -4
  67. package/dist/components/phone-input.js.map +1 -1
  68. package/dist/components/scope.js +52 -53
  69. package/dist/components/scope.js.map +1 -1
  70. package/dist/components/select.js +1 -1
  71. package/dist/components/theme-toggle.js +69 -95
  72. package/dist/components/theme-toggle.js.map +1 -1
  73. package/dist/components/toast.js +1 -1
  74. package/dist/components/trace.js +1 -1
  75. package/dist/icons.js +235 -78
  76. package/dist/icons.js.map +1 -1
  77. package/dist/index.js +158 -158
  78. package/dist/sections/basic-page.js +2 -2
  79. package/dist/sections/sidebar.js +1 -1
  80. package/dist/src/components/avatar/avatar.d.ts +1 -1
  81. package/dist/src/components/message/message-status.d.ts +7 -8
  82. package/dist/src/components/notification/notification.d.ts +2 -2
  83. package/dist/src/components/trace/decorations.d.ts +3 -3
  84. package/dist/src/icons/index.d.ts +1 -0
  85. package/dist/src/icons/photon/icons.d.ts +315 -0
  86. package/dist/src/icons/photon/index.d.ts +2 -0
  87. package/dist/src/icons/photon/photon-icon.d.ts +51 -0
  88. package/package.json +5 -3
  89. package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
  90. package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
  91. package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
  92. package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
  93. package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
  94. package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
  95. package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
  96. package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
  97. package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
  98. package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
  99. package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
  100. package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
  101. package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
  102. package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
  103. package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
  104. package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
  105. package/dist/chunks/IconX-DnPlFC68.js +0 -14
  106. package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
  107. package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
  108. package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
  109. package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
  110. package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
  111. package/dist/chunks/chat-D98GCjbe.js.map +0 -1
  112. package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
  113. package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
  114. package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
  115. package/dist/chunks/copy-button-BLvirhXk.js +0 -76
  116. package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
  117. package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
  118. package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
  119. package/dist/chunks/error-BT71wcUd.js +0 -270
  120. package/dist/chunks/error-BT71wcUd.js.map +0 -1
  121. package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
  122. package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
  123. package/dist/chunks/input-DWnb33UF.js.map +0 -1
  124. package/dist/chunks/message-DRAWQlW-.js.map +0 -1
  125. package/dist/chunks/select-Dux2SBVc.js.map +0 -1
  126. package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
  127. package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
  128. package/dist/chunks/trace-ClMpG82z.js.map +0 -1
@@ -1,36 +1,11 @@
1
1
  "use client";
2
2
  import { t as p } from "./cn-CPbhpG1q.js";
3
- import { t as Ue } from "./createReactComponent-yKZn9MIX.js";
4
- import { t as me } from "./calendar-DDWITGo4.js";
3
+ import { C as he } from "./icons-eq5FZ3Yc.js";
4
+ import { t as pe } from "./calendar-s-QRks1Z.js";
5
5
  import { t as V } from "./popover-Dtp9C6Qg.js";
6
- import { useCallback as Ze, useEffect as We, useId as Je, useRef as Q, useState as x, useSyncExternalStore as Qe } from "react";
6
+ import { useCallback as Ue, useEffect as Ze, useId as We, useRef as Q, useState as x, useSyncExternalStore as Je } from "react";
7
7
  import { Fragment as te, jsx as f, jsxs as y } from "react/jsx-runtime";
8
- var Xe = [
9
- ["path", {
10
- d: "M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",
11
- key: "svg-0"
12
- }],
13
- ["path", {
14
- d: "M16 3v4",
15
- key: "svg-1"
16
- }],
17
- ["path", {
18
- d: "M8 3v4",
19
- key: "svg-2"
20
- }],
21
- ["path", {
22
- d: "M4 11h16",
23
- key: "svg-3"
24
- }],
25
- ["path", {
26
- d: "M11 15h1",
27
- key: "svg-4"
28
- }],
29
- ["path", {
30
- d: "M12 15v3",
31
- key: "svg-5"
32
- }]
33
- ], pe = Ue("outline", "calendar", "Calendar", Xe), $e = {
8
+ var $e = {
34
9
  hour: 3600,
35
10
  minute: 60,
36
11
  second: 1
@@ -38,15 +13,15 @@ var Xe = [
38
13
  sm: "px-3 py-2 text-md md:text-base",
39
14
  md: "px-3 py-2 text-md",
40
15
  lg: "px-3.5 py-2.5 text-md"
41
- }, ve = {
16
+ }, be = {
42
17
  sm: "rounded-base",
43
18
  md: "rounded-base",
44
19
  lg: "squircle rounded-base"
45
- }, be = p("bg-pho-primary ring-pho-primary text-pho-primary relative flex cursor-pointer items-center gap-2 text-left ring-1 ring-inset", "transition-shadow duration-100 ease-linear focus-visible:outline-none", "data-[invalid]:ring-pho-error-subtle data-[invalid]:ring-[1.5px]"), et = p("has-[input:focus-visible]:ring-pho-brand data-[popup-open]:ring-pho-brand has-[input:focus-visible]:ring-2 data-[popup-open]:ring-2", "data-[invalid]:has-[input:focus-visible]:ring-pho-error data-[invalid]:data-[popup-open]:ring-pho-error", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"), tt = p("has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2", "data-[invalid]:has-[input:focus-visible]:ring-pho-error", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"), nt = p("flex shrink-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-base whitespace-nowrap select-none", "text-pho-secondary transition-[color,background-color] duration-150 ease-out", "hover:bg-pho-ghost-hover hover:text-pho-primary", "outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1", "sm:w-full"), rt = "bg-pho-ghost-hover text-pho-primary font-medium", ot = /[\u00a0\u2000-\u200a\u202f\u205f\u3000]/g, A = (e) => e.replace(ot, " "), Ce = {
20
+ }, ve = p("bg-pho-primary ring-pho-primary text-pho-primary relative flex cursor-pointer items-center gap-2 text-left ring-1 ring-inset", "transition-shadow duration-100 ease-linear focus-visible:outline-none", "data-[invalid]:ring-pho-error-subtle data-[invalid]:ring-[1.5px]"), Qe = p("has-[input:focus-visible]:ring-pho-brand data-[popup-open]:ring-pho-brand has-[input:focus-visible]:ring-2 data-[popup-open]:ring-2", "data-[invalid]:has-[input:focus-visible]:ring-pho-error data-[invalid]:data-[popup-open]:ring-pho-error", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"), Xe = p("has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2", "data-[invalid]:has-[input:focus-visible]:ring-pho-error", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"), et = p("flex shrink-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-base whitespace-nowrap select-none", "text-pho-secondary transition-[color,background-color] duration-150 ease-out", "hover:bg-pho-ghost-hover hover:text-pho-primary", "outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1", "sm:w-full"), tt = "bg-pho-ghost-hover text-pho-primary font-medium", nt = /[\u00a0\u2000-\u200a\u202f\u205f\u3000]/g, A = (e) => e.replace(nt, " "), Ce = {
46
21
  year: "numeric",
47
22
  month: "2-digit",
48
23
  day: "2-digit"
49
- }, at = {
24
+ }, rt = {
50
25
  hour: {
51
26
  hour: "2-digit",
52
27
  minute: "2-digit",
@@ -63,86 +38,86 @@ var Xe = [
63
38
  second: "2-digit",
64
39
  hourCycle: "h23"
65
40
  }
66
- }, R = "–", ke = new Date(2026, 8, 12, 15, 4, 5);
67
- function Se(e, t) {
41
+ }, R = "–", Se = new Date(2026, 8, 12, 15, 4, 5);
42
+ function Te(e, t) {
68
43
  return new Intl.DateTimeFormat(e, {
69
44
  ...Ce,
70
- ...t ? at[t] : {}
45
+ ...t ? rt[t] : {}
71
46
  });
72
47
  }
73
- var Te = (e) => e === "year" || e === "month" || e === "day";
74
- function it(e) {
75
- return new Intl.DateTimeFormat(e, Ce).formatToParts(ke).map((t) => t.type).filter(Te);
48
+ var Ee = (e) => e === "year" || e === "month" || e === "day";
49
+ function ot(e) {
50
+ return new Intl.DateTimeFormat(e, Ce).formatToParts(Se).map((t) => t.type).filter(Ee);
76
51
  }
77
- var st = {
52
+ var at = {
78
53
  year: "yyyy",
79
54
  month: "mm",
80
55
  day: "dd"
81
56
  };
82
- function lt(e, t) {
83
- return A(Se(e, t).formatToParts(ke).map((n) => Te(n.type) ? st[n.type] : n.type === "hour" ? "hh" : n.type === "minute" ? "mm" : n.type === "second" ? "ss" : n.value).join(""));
57
+ function it(e, t) {
58
+ return A(Te(e, t).formatToParts(Se).map((n) => Ee(n.type) ? at[n.type] : n.type === "hour" ? "hh" : n.type === "minute" ? "mm" : n.type === "second" ? "ss" : n.value).join(""));
84
59
  }
85
- function ut(e, t, n) {
60
+ function lt(e, t, n) {
86
61
  if (e == null) return "";
87
- const c = Se(t, n);
88
- return e instanceof Date ? A(c.format(e)) : e.from == null ? "" : e.to == null || n == null && e.from.getFullYear() === e.to.getFullYear() && e.from.getMonth() === e.to.getMonth() && e.from.getDate() === e.to.getDate() ? A(c.format(e.from)) : A(ct(c, e.from, e.to, n != null));
62
+ const c = Te(t, n);
63
+ return e instanceof Date ? A(c.format(e)) : e.from == null ? "" : e.to == null || n == null && e.from.getFullYear() === e.to.getFullYear() && e.from.getMonth() === e.to.getMonth() && e.from.getDate() === e.to.getDate() ? A(c.format(e.from)) : A(st(c, e.from, e.to, n != null));
89
64
  }
90
- function ct(e, t, n, c) {
91
- const o = e.formatToParts(t), s = e.formatToParts(n), l = (d) => d.map((N) => N.value).join("");
92
- if (c || o.length !== s.length) return `${l(o)}${R}${l(s)}`;
93
- const h = (d) => o[d].type === s[d].type && o[d].value === s[d].value;
65
+ function st(e, t, n, c) {
66
+ const o = e.formatToParts(t), l = e.formatToParts(n), s = (d) => d.map((M) => M.value).join("");
67
+ if (c || o.length !== l.length) return `${s(o)}${R}${s(l)}`;
68
+ const m = (d) => o[d].type === l[d].type && o[d].value === l[d].value;
94
69
  if (o[0]?.type === "year") {
95
70
  let d = 0;
96
- for (; d < o.length && h(d); ) d += 1;
97
- for (; d > 0 && s[d - 1].type !== "literal"; ) d -= 1;
98
- return d > 0 && d < o.length ? `${l(o)}${R}${l(s.slice(d))}` : `${l(o)}${R}${l(s)}`;
71
+ for (; d < o.length && m(d); ) d += 1;
72
+ for (; d > 0 && l[d - 1].type !== "literal"; ) d -= 1;
73
+ return d > 0 && d < o.length ? `${s(o)}${R}${s(l.slice(d))}` : `${s(o)}${R}${s(l)}`;
99
74
  }
100
75
  let u = o.length;
101
- for (; u > 0 && h(u - 1); ) u -= 1;
76
+ for (; u > 0 && m(u - 1); ) u -= 1;
102
77
  for (; u < o.length && o[u].type !== "literal"; ) u += 1;
103
- return u > 0 && u < o.length ? `${l(o.slice(0, u))}${R}${l(s)}` : `${l(o)}${R}${l(s)}`;
78
+ return u > 0 && u < o.length ? `${s(o.slice(0, u))}${R}${s(l)}` : `${s(o)}${R}${s(l)}`;
104
79
  }
105
80
  var O = (e) => String(e).padStart(2, "0");
106
- function M(e) {
81
+ function N(e) {
107
82
  return `${e.getFullYear()}-${O(e.getMonth() + 1)}-${O(e.getDate())}`;
108
83
  }
109
- function Ee(e, t) {
84
+ function ke(e, t) {
110
85
  const n = `${O(e.getHours())}:${O(e.getMinutes())}`;
111
86
  return t === "second" ? `${n}:${O(e.getSeconds())}` : n;
112
87
  }
113
88
  function X(e, t) {
114
- return `${M(e)}T${Ee(e, t)}`;
89
+ return `${N(e)}T${ke(e, t)}`;
115
90
  }
116
91
  function j(e) {
117
92
  const t = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(e);
118
93
  if (!t) return;
119
- const [, n, c, o, s, l, h] = t, u = new Date(Number(n), Number(c) - 1, Number(o), Number(s ?? 0), Number(l ?? 0), Number(h ?? 0), 0);
94
+ const [, n, c, o, l, s, m] = t, u = new Date(Number(n), Number(c) - 1, Number(o), Number(l ?? 0), Number(s ?? 0), Number(m ?? 0), 0);
120
95
  return Number.isNaN(u.getTime()) ? void 0 : u;
121
96
  }
122
97
  function ye(e, t, n, c) {
123
98
  const o = e < 100 ? 2e3 + e : e;
124
99
  if (t < 1 || t > 12 || n < 1 || n > 31) return;
125
- const [s = 0, l = 0, h = 0] = c;
126
- if (s > 23 || l > 59 || h > 59) return;
127
- const u = new Date(o, t - 1, n, s, l, h, 0);
100
+ const [l = 0, s = 0, m = 0] = c;
101
+ if (l > 23 || s > 59 || m > 59) return;
102
+ const u = new Date(o, t - 1, n, l, s, m, 0);
128
103
  return u.getMonth() === t - 1 && u.getDate() === n ? u : void 0;
129
104
  }
130
- function dt(e, t) {
105
+ function ut(e, t) {
131
106
  const n = e.trim();
132
107
  if (n === "") return;
133
108
  const c = (n.match(/\d+/g) ?? []).map(Number);
134
109
  if (c.length >= 3) {
135
- const s = c.slice(3);
136
- if (/\bpm\b/i.test(n) && s[0] !== void 0 && s[0] < 12 ? s[0] += 12 : /\bam\b/i.test(n) && s[0] === 12 && (s[0] = 0), /^\d{4}\D/.test(n)) {
137
- const [h, u, d] = c;
138
- return ye(h, u, d, s);
110
+ const l = c.slice(3);
111
+ if (/\bpm\b/i.test(n) && l[0] !== void 0 && l[0] < 12 ? l[0] += 12 : /\bam\b/i.test(n) && l[0] === 12 && (l[0] = 0), /^\d{4}\D/.test(n)) {
112
+ const [m, u, d] = c;
113
+ return ye(m, u, d, l);
139
114
  }
140
- const l = {};
141
- if (it(t).forEach((h, u) => {
142
- l[h] = c[u];
143
- }), l.year != null && l.month != null && l.day != null) {
144
- const h = ye(l.year, l.month, l.day, s);
145
- if (h) return h;
115
+ const s = {};
116
+ if (ot(t).forEach((m, u) => {
117
+ s[m] = c[u];
118
+ }), s.year != null && s.month != null && s.day != null) {
119
+ const m = ye(s.year, s.month, s.day, l);
120
+ if (m) return m;
146
121
  }
147
122
  }
148
123
  if (!/[a-z]/i.test(n) || c.length < 2 || !/\b\d{4}\b/.test(n)) return;
@@ -160,31 +135,31 @@ function z(e, t) {
160
135
  const n = new Date(e);
161
136
  return t && n.setHours(t.getHours(), t.getMinutes(), t.getSeconds(), 0), n;
162
137
  }
163
- var ft = (e) => new Date(e.getFullYear(), e.getMonth(), 1), ht = (e) => new Date(e.getFullYear(), e.getMonth() + 1, 0), mt = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), xe = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999), De = (e, t) => e && e > t ? e : t, Me = (e, t) => e && e < t ? e : t;
164
- function pt(e) {
138
+ var ct = (e) => new Date(e.getFullYear(), e.getMonth(), 1), dt = (e) => new Date(e.getFullYear(), e.getMonth() + 1, 0), ft = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), xe = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999), De = (e, t) => e && e > t ? e : t, Ne = (e, t) => e && e < t ? e : t;
139
+ function mt(e) {
165
140
  if (e?.hidden != null) return null;
166
141
  let t, n;
167
142
  const c = e?.disabled == null ? [] : Array.isArray(e.disabled) ? e.disabled : [e.disabled];
168
143
  for (const o of c) {
169
144
  if (o == null || typeof o != "object" || o instanceof Date || Object.keys(o).length !== 1) return null;
170
- if ("before" in o && o.before instanceof Date) t = De(t, mt(o.before));
171
- else if ("after" in o && o.after instanceof Date) n = Me(n, xe(o.after));
145
+ if ("before" in o && o.before instanceof Date) t = De(t, ft(o.before));
146
+ else if ("after" in o && o.after instanceof Date) n = Ne(n, xe(o.after));
172
147
  else return null;
173
148
  }
174
- return e?.startMonth && (t = De(t, ft(e.startMonth))), e?.endMonth && (n = Me(n, xe(ht(e.endMonth)))), {
149
+ return e?.startMonth && (t = De(t, ct(e.startMonth))), e?.endMonth && (n = Ne(n, xe(dt(e.endMonth)))), {
175
150
  min: t,
176
151
  max: n
177
152
  };
178
153
  }
179
- var Ne = "(pointer: coarse)";
180
- function gt() {
181
- const e = Ze((t) => {
154
+ var Me = "(pointer: coarse)";
155
+ function ht() {
156
+ const e = Ue((t) => {
182
157
  if (typeof window > "u" || !window.matchMedia) return () => {
183
158
  };
184
- const n = window.matchMedia(Ne);
159
+ const n = window.matchMedia(Me);
185
160
  return n.addEventListener("change", t), () => n.removeEventListener("change", t);
186
161
  }, []);
187
- return Qe(e, () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(Ne).matches, () => !1);
162
+ return Je(e, () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(Me).matches, () => !1);
188
163
  }
189
164
  function ee({ label: e, value: t, time: n, disabled: c, onChange: o }) {
190
165
  return /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ f("span", {
@@ -197,28 +172,28 @@ function ee({ label: e, value: t, time: n, disabled: c, onChange: o }) {
197
172
  step: $e[n],
198
173
  disabled: c,
199
174
  "aria-label": e,
200
- value: t ? Ee(t, n) : "",
201
- onChange: (s) => o(s.target.value),
175
+ value: t ? ke(t, n) : "",
176
+ onChange: (l) => o(l.target.value),
202
177
  className: p("text-pho-primary w-full bg-transparent text-base tabular-nums outline-none", "[&::-webkit-calendar-picker-indicator]:hidden")
203
178
  })
204
179
  })] });
205
180
  }
206
- function vt(e) {
207
- const { mode: t = "single", defaultValue: n, onValueChange: c, label: o, hint: s, placeholder: l, invalid: h, disabled: u, required: d, size: N = "md", width: $ = "fill", time: a, locales: G, calendarProps: S, id: Ie, className: ne, selectedPreset: H, align: Fe = "start", "aria-label": re } = e, Y = e.presets, { minDays: Pe, maxDays: Re } = e, oe = "value" in e, [Ae, Oe] = x(n), _ = oe ? e.value : Ae, [C, k] = x(!1), T = Q(0), q = l ?? (t === "range" ? "Pick a date range" : lt(G, a)), _e = Je(), E = Ie ?? _e, K = s ? `${E}-hint` : void 0, ae = `${E}-calendar`, [ie, se] = x(!1), B = (r = !1) => {
208
- C || (T.current = 0, F(void 0), se(r), k(!0));
209
- }, le = c, v = (r, i) => {
210
- i ? Z(!1) : (Z(!0), ue(null)), oe || Oe(r), i ? le?.(r, i) : le?.(r);
211
- }, b = t === "single" ? _ : void 0, m = t === "range" ? _ : void 0, Le = b ?? m?.from, [Ve, w] = x(null), [U, ue] = x(null), [je, Z] = x(!1);
212
- We(() => {
181
+ function pt(e) {
182
+ const { mode: t = "single", defaultValue: n, onValueChange: c, label: o, hint: l, placeholder: s, invalid: m, disabled: u, required: d, size: M = "md", width: $ = "fill", time: a, locales: G, calendarProps: T, id: Ie, className: ne, selectedPreset: H, align: Fe = "start", "aria-label": re } = e, Y = e.presets, { minDays: Pe, maxDays: Re } = e, oe = "value" in e, [Ae, Oe] = x(n), _ = oe ? e.value : Ae, [C, S] = x(!1), E = Q(0), q = s ?? (t === "range" ? "Pick a date range" : it(G, a)), _e = We(), k = Ie ?? _e, K = l ? `${k}-hint` : void 0, ae = `${k}-calendar`, [ie, le] = x(!1), B = (r = !1) => {
183
+ C || (E.current = 0, F(void 0), le(r), S(!0));
184
+ }, se = c, b = (r, i) => {
185
+ i ? Z(!1) : (Z(!0), ue(null)), oe || Oe(r), i ? se?.(r, i) : se?.(r);
186
+ }, v = t === "single" ? _ : void 0, h = t === "range" ? _ : void 0, Le = v ?? h?.from, [Ve, w] = x(null), [U, ue] = x(null), [je, Z] = x(!1);
187
+ Ze(() => {
213
188
  Z(!1);
214
189
  }, [H]);
215
- const W = H && !je ? H : U && U.key === we(_) ? U.label : null, I = Ve ?? W ?? ut(_, G, a), ze = Math.max(I.length, t === "range" ? 0 : q.length, 1), ce = $ === "hug" && t === "range", Ge = (r) => {
190
+ const W = H && !je ? H : U && U.key === we(_) ? U.label : null, I = Ve ?? W ?? lt(_, G, a), ze = Math.max(I.length, t === "range" ? 0 : q.length, 1), ce = $ === "hug" && t === "range", Ge = (r) => {
216
191
  const i = typeof r.value == "function" ? r.value() : r.value;
217
192
  ue({
218
193
  label: r.label,
219
194
  key: we(i)
220
- }), w(null), v(i, { preset: r }), k(!1);
221
- }, [He, F] = x(void 0), [Ye] = x(() => S?.today ?? /* @__PURE__ */ new Date()), de = He ?? S?.defaultMonth ?? Le ?? Ye, J = Q(null), fe = Q(null), qe = gt(), D = pt(S), Ke = qe && t === "single" && D != null && !Y?.length, Be = /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ f(pe, { className: "text-pho-secondary size-4 shrink-0" }), /* @__PURE__ */ f("span", {
195
+ }), w(null), b(i, { preset: r }), S(!1);
196
+ }, [He, F] = x(void 0), [Ye] = x(() => T?.today ?? /* @__PURE__ */ new Date()), de = He ?? T?.defaultMonth ?? Le ?? Ye, J = Q(null), fe = Q(null), qe = ht(), D = mt(T), Ke = qe && t === "single" && D != null && !Y?.length, Be = /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ f(he, { className: "text-pho-secondary size-4 shrink-0" }), /* @__PURE__ */ f("span", {
222
197
  className: p("min-w-0 flex-1 truncate", I === "" && "text-pho-placeholder"),
223
198
  children: I === "" ? q : I
224
199
  })] });
@@ -226,7 +201,7 @@ function vt(e) {
226
201
  className: p("flex flex-col gap-1.5", $ === "hug" ? "w-fit" : "w-full"),
227
202
  children: [
228
203
  o ? /* @__PURE__ */ y("label", {
229
- htmlFor: E,
204
+ htmlFor: k,
230
205
  className: "text-pho-secondary flex w-fit cursor-default items-center gap-0.5 text-base font-medium",
231
206
  children: [o, d ? /* @__PURE__ */ f("span", {
232
207
  className: "text-pho-brand",
@@ -234,37 +209,37 @@ function vt(e) {
234
209
  }) : null]
235
210
  }) : null,
236
211
  Ke ? /* @__PURE__ */ y("div", {
237
- "data-invalid": h || void 0,
238
- className: p(be, tt, $ === "hug" ? "w-fit" : "w-full", ge[N], ve[N], ne),
212
+ "data-invalid": m || void 0,
213
+ className: p(ve, Xe, $ === "hug" ? "w-fit" : "w-full", ge[M], be[M], ne),
239
214
  children: [Be, /* @__PURE__ */ f("input", {
240
- id: E,
215
+ id: k,
241
216
  type: a ? "datetime-local" : "date",
242
217
  step: a ? $e[a] : void 0,
243
- min: D?.min ? a ? X(g(D.min, a), a) : M(D.min) : void 0,
244
- max: D?.max ? a ? X(g(D.max, a), a) : M(D.max) : void 0,
218
+ min: D?.min ? a ? X(g(D.min, a), a) : N(D.min) : void 0,
219
+ max: D?.max ? a ? X(g(D.max, a), a) : N(D.max) : void 0,
245
220
  required: d,
246
221
  disabled: u,
247
222
  "aria-label": re,
248
223
  "aria-describedby": K,
249
- value: b ? a ? X(b, a) : M(b) : "",
224
+ value: v ? a ? X(v, a) : N(v) : "",
250
225
  onChange: (r) => {
251
226
  const i = j(r.target.value);
252
- v(i ? g(i, a) : void 0);
227
+ b(i ? g(i, a) : void 0);
253
228
  },
254
229
  className: "absolute inset-0 size-full cursor-pointer opacity-0"
255
230
  })]
256
231
  }) : /* @__PURE__ */ y(V.Root, {
257
232
  open: C,
258
233
  onOpenChange: (r, i) => {
259
- !r && i.reason === "outside-press" && i.event.target instanceof Node && J.current?.contains(i.event.target) || (r ? (T.current = 0, F(void 0)) : (w(null), se(!1)), k(r));
234
+ !r && i.reason === "outside-press" && i.event.target instanceof Node && J.current?.contains(i.event.target) || (r ? (E.current = 0, F(void 0)) : (w(null), le(!1)), S(r));
260
235
  },
261
236
  children: [/* @__PURE__ */ y("div", {
262
237
  ref: J,
263
- "data-invalid": h || void 0,
238
+ "data-invalid": m || void 0,
264
239
  "data-popup-open": C || void 0,
265
- className: p(be, et, $ === "hug" ? "w-fit" : "w-full", ge[N], ve[N], ne),
266
- children: [/* @__PURE__ */ f(pe, { className: "text-pho-secondary size-4 shrink-0" }), /* @__PURE__ */ f("input", {
267
- id: E,
240
+ className: p(ve, Qe, $ === "hug" ? "w-fit" : "w-full", ge[M], be[M], ne),
241
+ children: [/* @__PURE__ */ f(he, { className: "text-pho-secondary size-4 shrink-0" }), /* @__PURE__ */ f("input", {
242
+ id: k,
268
243
  type: "text",
269
244
  readOnly: t === "range",
270
245
  disabled: u,
@@ -284,16 +259,16 @@ function vt(e) {
284
259
  onChange: (r) => {
285
260
  const i = r.target.value;
286
261
  if (w(i), i.trim() === "") {
287
- v(void 0);
262
+ b(void 0);
288
263
  return;
289
264
  }
290
- const P = dt(i, G);
291
- P && (v(g(P, a)), F(P));
265
+ const P = ut(i, G);
266
+ P && (b(g(P, a)), F(P));
292
267
  },
293
268
  onBlur: () => w(null),
294
269
  onKeyDown: (r) => {
295
270
  if (r.key === "Escape" && C) {
296
- r.preventDefault(), w(null), k(!1);
271
+ r.preventDefault(), w(null), S(!1);
297
272
  return;
298
273
  }
299
274
  if (r.key === "ArrowDown") {
@@ -329,100 +304,100 @@ function vt(e) {
329
304
  type: "button",
330
305
  "aria-pressed": r.label === W,
331
306
  onClick: () => Ge(r),
332
- className: p(nt, r.label === W && rt),
307
+ className: p(et, r.label === W && tt),
333
308
  children: r.label
334
309
  }, r.label))
335
- }) : null, /* @__PURE__ */ y("div", { children: [t === "range" ? /* @__PURE__ */ f(me, {
336
- ...S,
310
+ }) : null, /* @__PURE__ */ y("div", { children: [t === "range" ? /* @__PURE__ */ f(pe, {
311
+ ...T,
337
312
  mode: "range",
338
313
  min: Pe,
339
314
  max: Re,
340
315
  month: de,
341
316
  onMonthChange: F,
342
317
  autoFocus: ie,
343
- selected: m,
318
+ selected: h,
344
319
  onSelect: (r, i) => {
345
- const P = T.current === 0;
346
- if (T.current += 1, P && m?.to) {
347
- const he = g(z(i, a ? m.from : void 0), a);
348
- v({
349
- from: he,
350
- to: new Date(he)
320
+ const P = E.current === 0;
321
+ if (E.current += 1, P && h?.to) {
322
+ const me = g(z(i, a ? h.from : void 0), a);
323
+ b({
324
+ from: me,
325
+ to: new Date(me)
351
326
  }), w(null);
352
327
  return;
353
328
  }
354
329
  const L = r && {
355
- from: r.from && g(z(r.from, a ? m?.from : void 0), a),
356
- to: r.to && g(z(r.to, a ? m?.to : void 0), a)
330
+ from: r.from && g(z(r.from, a ? h?.from : void 0), a),
331
+ to: r.to && g(z(r.to, a ? h?.to : void 0), a)
357
332
  };
358
- v(L), w(null), !a && T.current >= 2 && (!L || L.from && L.to) && k(!1);
333
+ b(L), w(null), !a && E.current >= 2 && (!L || L.from && L.to) && S(!1);
359
334
  }
360
- }) : /* @__PURE__ */ f(me, {
361
- ...S,
335
+ }) : /* @__PURE__ */ f(pe, {
336
+ ...T,
362
337
  mode: "single",
363
338
  month: de,
364
339
  onMonthChange: F,
365
340
  autoFocus: ie,
366
- selected: b,
341
+ selected: v,
367
342
  onSelect: (r) => {
368
- v(r && g(z(r, a ? b : void 0), a)), w(null), a || k(!1);
343
+ b(r && g(z(r, a ? v : void 0), a)), w(null), a || S(!1);
369
344
  }
370
345
  }), a ? /* @__PURE__ */ f("div", {
371
346
  className: "border-pho-secondary mt-3 grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-2 border-t pt-3",
372
347
  children: t === "range" ? /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ f(ee, {
373
348
  label: "From",
374
- value: m?.from,
349
+ value: h?.from,
375
350
  time: a,
376
351
  onChange: (r) => {
377
- if (!m?.from) return;
378
- const i = j(`${M(m.from)}T${r}`);
379
- i && v({
380
- ...m,
352
+ if (!h?.from) return;
353
+ const i = j(`${N(h.from)}T${r}`);
354
+ i && b({
355
+ ...h,
381
356
  from: g(i, a)
382
357
  });
383
358
  },
384
- disabled: !m?.from
359
+ disabled: !h?.from
385
360
  }), /* @__PURE__ */ f(ee, {
386
361
  label: "To",
387
- value: m?.to,
362
+ value: h?.to,
388
363
  time: a,
389
364
  onChange: (r) => {
390
- if (!m?.to) return;
391
- const i = j(`${M(m.to)}T${r}`);
392
- i && v({
393
- ...m,
365
+ if (!h?.to) return;
366
+ const i = j(`${N(h.to)}T${r}`);
367
+ i && b({
368
+ ...h,
394
369
  to: g(i, a)
395
370
  });
396
371
  },
397
- disabled: !m?.to
372
+ disabled: !h?.to
398
373
  })] }) : /* @__PURE__ */ f(ee, {
399
374
  label: "Time",
400
- value: b,
375
+ value: v,
401
376
  time: a,
402
377
  onChange: (r) => {
403
- if (!b) return;
404
- const i = j(`${M(b)}T${r}`);
405
- i && v(g(i, a));
378
+ if (!v) return;
379
+ const i = j(`${N(v)}T${r}`);
380
+ i && b(g(i, a));
406
381
  },
407
- disabled: !b
382
+ disabled: !v
408
383
  })
409
384
  }) : null] })]
410
385
  })
411
386
  })
412
387
  }) })]
413
388
  }),
414
- s ? /* @__PURE__ */ f("p", {
389
+ l ? /* @__PURE__ */ f("p", {
415
390
  id: K,
416
- className: p("text-pho-description text-base", h && "text-pho-error"),
417
- children: s
391
+ className: p("text-pho-description text-base", m && "text-pho-error"),
392
+ children: l
418
393
  }) : null
419
394
  ]
420
395
  });
421
396
  }
422
- vt.displayName = "DatePicker";
397
+ pt.displayName = "DatePicker";
423
398
  export {
424
- ut as n,
425
- vt as t
399
+ lt as n,
400
+ pt as t
426
401
  };
427
402
 
428
- //# sourceMappingURL=date-picker-D-sWo3i8.js.map
403
+ //# sourceMappingURL=date-picker-BaAkim2u.js.map