@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,56 +1,55 @@
1
1
  "use client";
2
- import { t as m } from "./cn-CPbhpG1q.js";
3
- import { t as d } from "./IconSearch-DkcWWZ1H.js";
4
- import { t as f } from "./IconX-DnPlFC68.js";
5
- import { t } from "./input-group-C3upo2OU.js";
2
+ import { t as d } from "./cn-CPbhpG1q.js";
3
+ import { L as m, _n as f } from "./icons-eq5FZ3Yc.js";
4
+ import { t as n } from "./input-group-C3upo2OU.js";
6
5
  import { useRef as x } from "react";
7
6
  import { jsx as e, jsxs as b } from "react/jsx-runtime";
8
7
  var y = "has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-pho-primary has-[input:focus-visible]:ring-1 has-[input:focus-visible]:ring-pho-primary", g = "my-0.5 w-full min-w-0 flex-1 bg-transparent py-1.5 text-pho-primary outline-none placeholder:text-pho-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none";
9
- function A({ className: l, onClear: a, trailing: i, value: n, onChange: p, disabled: s, ref: o, ...u }) {
10
- const c = x(null), h = n != null && String(n) !== "";
11
- return /* @__PURE__ */ b(t.Root, {
8
+ function v({ className: c, onClear: a, trailing: s, value: t, onChange: p, disabled: i, ref: o, ...u }) {
9
+ const l = x(null), h = t != null && String(t) !== "";
10
+ return /* @__PURE__ */ b(n.Root, {
12
11
  size: "sm",
13
- className: m("group/search", y, l),
12
+ className: d("group/search", y, c),
14
13
  children: [
15
- /* @__PURE__ */ e(t.Addon, { children: /* @__PURE__ */ e(d, {
14
+ /* @__PURE__ */ e(n.Addon, { children: /* @__PURE__ */ e(f, {
16
15
  "aria-hidden": !0,
17
16
  className: "text-pho-description group-focus-within/search:text-pho-primary transition-colors duration-100 ease-linear"
18
17
  }) }),
19
18
  /* @__PURE__ */ e("input", {
20
19
  ref: (r) => {
21
- c.current = r, typeof o == "function" ? o(r) : o != null && (o.current = r);
20
+ l.current = r, typeof o == "function" ? o(r) : o != null && (o.current = r);
22
21
  },
23
22
  type: "search",
24
- value: n,
23
+ value: t,
25
24
  onChange: (r) => {
26
25
  r.stopPropagation(), p?.(r);
27
26
  },
28
- disabled: s,
27
+ disabled: i,
29
28
  autoComplete: "off",
30
29
  spellCheck: !1,
31
30
  className: g,
32
31
  ...u
33
32
  }),
34
- i != null ? /* @__PURE__ */ e(t.Addon, {
33
+ s != null ? /* @__PURE__ */ e(n.Addon, {
35
34
  className: "text-pho-description text-xs tabular-nums",
36
- children: i
35
+ children: s
37
36
  }) : null,
38
- a != null && h && !s ? /* @__PURE__ */ e(t.Addon, { children: /* @__PURE__ */ e("button", {
37
+ a != null && h && !i ? /* @__PURE__ */ e(n.Addon, { children: /* @__PURE__ */ e("button", {
39
38
  type: "button",
40
39
  "aria-label": "Clear search",
41
40
  tabIndex: -1,
42
41
  onClick: () => {
43
- a(), c.current?.focus();
42
+ a(), l.current?.focus();
44
43
  },
45
44
  className: "text-pho-secondary hover:text-pho-secondary-hover flex cursor-pointer items-center transition-colors duration-100 ease-linear",
46
- children: /* @__PURE__ */ e(f, { "aria-hidden": !0 })
45
+ children: /* @__PURE__ */ e(m, { "aria-hidden": !0 })
47
46
  }) }) : null
48
47
  ]
49
48
  });
50
49
  }
51
50
  export {
52
51
  y as n,
53
- A as t
52
+ v as t
54
53
  };
55
54
 
56
- //# sourceMappingURL=box-search-CMl5bQ7Y.js.map
55
+ //# sourceMappingURL=box-search-DD2EPtDy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box-search-DD2EPtDy.js","names":["cn","CloseIcon","SearchIcon","InputGroup","useRef","jsx","jsxs","QUIET_SEARCH_FOCUS","BOX_SEARCH_INPUT","BoxSearch","className","onClear","trailing","value","onChange","disabled","ref","props","inputRef","filled","node","event"],"sources":["../../src/components/input-group/box-search.tsx"],"sourcesContent":["import { useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { CloseIcon, SearchIcon } from \"../../icons/photon\";\nimport { cn } from \"../../utils/cn\";\nimport { InputGroup } from \"./input-group\";\n\n/**\n * The quiet focus of a search riding on a list or table. The field keeps\n * its resting hairline when it takes focus: the list it narrows is where\n * the eye goes, and a ring would box the field off from it. Focus shows\n * in the caret and in the magnifier, which takes the primary ink. Put it\n * on the field's surface after the surface's own classes (an `Input`'s\n * `wrapperClassName`, an `InputGroup.Root`'s `className`): tailwind-merge\n * keeps the ring at its rest width and ink.\n */\nexport const QUIET_SEARCH_FOCUS =\n \"has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-pho-primary has-[input:focus-visible]:ring-1 has-[input:focus-visible]:ring-pho-primary\";\n\n/**\n * The text control: `InputGroup.Input`'s `sm` classes on a plain input.\n * Not a Base UI `Field.Control` — inside a host's `Field` that would make\n * the search the field's control, taking its name and its label. The\n * browser's own clear glyph gives way to the field's.\n */\nconst BOX_SEARCH_INPUT =\n \"my-0.5 w-full min-w-0 flex-1 bg-transparent py-1.5 text-pho-primary outline-none placeholder:text-pho-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none\";\n\nexport interface BoxSearchProps extends Omit<\n ComponentProps<\"input\">,\n \"type\" | \"size\" | \"children\"\n> {\n /**\n * Empties the query from the field's own clear button, shown while the\n * field holds text; focus stays in the field. Without it, no button.\n */\n onClear?: () => void;\n /** Quiet words at the field's end, before the clear button — a count. */\n trailing?: ReactNode;\n /** Classes for the field's surface: its width, its place in a row. */\n className?: string;\n}\n\n/**\n * The boxed search over a list or table — an `sm` field with the\n * magnifier leading, a `trailing` slot, and a clear button. Its focus is\n * quiet (see `QUIET_SEARCH_FOCUS`). Shared by `BasicPage.Search`,\n * `FilterBar`, and `Scope`; the boxless face is `GhostSearch`.\n */\nexport function BoxSearch({\n className,\n onClear,\n trailing,\n value,\n onChange,\n disabled,\n ref,\n ...props\n}: BoxSearchProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const filled = value != null && String(value) !== \"\";\n return (\n <InputGroup.Root\n size=\"sm\"\n className={cn(\"group/search\", QUIET_SEARCH_FOCUS, className)}\n >\n <InputGroup.Addon>\n <SearchIcon\n aria-hidden\n className=\"text-pho-description group-focus-within/search:text-pho-primary transition-colors duration-100 ease-linear\"\n />\n </InputGroup.Addon>\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref != null) ref.current = node;\n }}\n type=\"search\"\n value={value}\n // The query is the list's, not a form's: an enclosing form that\n // saves on change or shows a save row once dirty never hears it.\n onChange={(event) => {\n event.stopPropagation();\n onChange?.(event);\n }}\n disabled={disabled}\n autoComplete=\"off\"\n spellCheck={false}\n className={BOX_SEARCH_INPUT}\n {...props}\n />\n {trailing != null ? (\n <InputGroup.Addon className=\"text-pho-description text-xs tabular-nums\">\n {trailing}\n </InputGroup.Addon>\n ) : null}\n {onClear != null && filled && !disabled ? (\n <InputGroup.Addon>\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n // Reachable by click, skipped by Tab: `Escape` clears from the\n // keyboard, and Tab moves on to the list.\n tabIndex={-1}\n onClick={() => {\n onClear();\n inputRef.current?.focus();\n }}\n className=\"text-pho-secondary hover:text-pho-secondary-hover flex cursor-pointer items-center transition-colors duration-100 ease-linear\"\n >\n <CloseIcon aria-hidden />\n </button>\n </InputGroup.Addon>\n ) : null}\n </InputGroup.Root>\n );\n}\n"],"mappings":";;;;;;AAcA,IAAaO,IACX,iJAQIC,IACJ;AAuBF,SAAgBC,EAAU,EACxB,WAAAC,GACA,SAAAC,GACA,UAAAC,GACA,OAAAC,GACA,UAAAC,GACA,UAAAC,GACA,KAAAC,GACA,GAAGC,EAAA,GACc;AACjB,QAAMC,IAAWd,EAA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@
1
1
  "use client";
2
2
  import { t as l } from "./cn-CPbhpG1q.js";
3
- import { t as J } from "./createReactComponent-yKZn9MIX.js";
4
- import { t as M } from "./IconChevronDown-Cd68NnX2.js";
5
- import { t as Z } from "./IconChevronLeft-CptqhdxO.js";
6
- import { t as $ } from "./IconChevronRight-BNkXCTk6.js";
7
- import { t as q } from "./IconChevronUp-Bxllwz8J.js";
8
- import { createContext as I, useContext as v, useEffect as R, useMemo as k, useRef as E, useState as Y } from "react";
9
- import { Fragment as K, jsx as r, jsxs as _ } from "react/jsx-runtime";
3
+ import { F as J, M, N as Z, P as $ } from "./icons-eq5FZ3Yc.js";
4
+ import { t as q } from "./createReactComponent-yKZn9MIX.js";
5
+ import { createContext as I, useContext as m, useEffect as R, useMemo as k, useRef as E, useState as Y } from "react";
6
+ import { Fragment as K, jsx as a, jsxs as _ } from "react/jsx-runtime";
10
7
  import { DayPicker as Q, useDayPicker as x } from "react-day-picker";
11
8
  var X = [["path", {
12
9
  d: "M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z",
13
10
  key: "svg-0"
14
- }]], ee = J("filled", "point-filled", "PointFilled", X), te = "size-9", B = "w-63", N = 10, D = l("text-pho-secondary flex size-7 cursor-pointer items-center justify-center rounded-sm", "transition-[color,background-color] duration-150 ease-out", "hover:bg-pho-ghost-hover hover:text-pho-secondary-hover", "outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1", "aria-disabled:pointer-events-none aria-disabled:opacity-30"), F = {
11
+ }]], ee = q("filled", "point-filled", "PointFilled", X), te = "size-9", B = "w-63", N = 10, D = l("text-pho-secondary flex size-7 cursor-pointer items-center justify-center rounded-sm", "transition-[color,background-color] duration-150 ease-out", "hover:bg-pho-ghost-hover hover:text-pho-secondary-hover", "outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1", "aria-disabled:pointer-events-none aria-disabled:opacity-30"), F = {
15
12
  root: "text-pho-primary inline-block text-base",
16
13
  months: "relative flex flex-col gap-6 sm:flex-row",
17
14
  month: "flex flex-col gap-2",
@@ -50,28 +47,28 @@ function oe(t) {
50
47
  const e = !!(t.selected && !t.range_middle);
51
48
  return l("relative flex cursor-pointer items-center justify-center rounded-sm tabular-nums select-none", te, "text-pho-secondary", "transition-[color,background-color,box-shadow] 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", t.outside && "text-pho-placeholder", t.today && !t.selected && "ring-pho-primary ring-1 ring-inset font-medium text-pho-primary", t.range_middle && "text-pho-primary", e && "bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover hover:text-pho-on-brand font-medium ring-0", "disabled:pointer-events-none disabled:text-pho-disabled", "aria-disabled:pointer-events-none aria-disabled:text-pho-disabled");
52
49
  }
53
- function ne({ day: t, modifiers: e, className: n, ...a }) {
50
+ function ne({ day: t, modifiers: e, className: n, ...r }) {
54
51
  const o = e.range_start || e.range_middle || e.range_end;
55
- return /* @__PURE__ */ r("td", {
56
- ...a,
52
+ return /* @__PURE__ */ a("td", {
53
+ ...r,
57
54
  "data-range-start": e.range_start || void 0,
58
55
  "data-range-middle": e.range_middle || void 0,
59
56
  "data-range-end": e.range_end || void 0,
60
57
  className: l(n, o && "bg-pho-secondary", e.range_start && "rounded-l-sm", e.range_end && "rounded-r-sm")
61
58
  });
62
59
  }
63
- function re({ day: t, modifiers: e, className: n, ...a }) {
60
+ function ae({ day: t, modifiers: e, className: n, ...r }) {
64
61
  const o = E(null);
65
62
  return R(() => {
66
63
  e.focused && o.current?.focus();
67
- }, [e.focused]), /* @__PURE__ */ r("button", {
64
+ }, [e.focused]), /* @__PURE__ */ a("button", {
68
65
  ref: o,
69
- ...a,
66
+ ...r,
70
67
  className: l(oe(e), n)
71
68
  });
72
69
  }
73
- function ae({ orientation: t = "left", className: e }) {
74
- return /* @__PURE__ */ r(t === "up" ? q : t === "down" ? M : t === "right" ? $ : Z, {
70
+ function re({ orientation: t = "left", className: e }) {
71
+ return /* @__PURE__ */ a(t === "up" ? J : t === "down" ? M : t === "right" ? $ : Z, {
75
72
  className: e,
76
73
  "aria-hidden": !0
77
74
  });
@@ -100,17 +97,17 @@ function V() {
100
97
  last: t.endMonth?.getFullYear() ?? e.getFullYear() + N
101
98
  };
102
99
  }
103
- function se({ calendarMonth: t, displayIndex: e, className: n, ...a }) {
104
- const o = v(g), h = L(), s = o.index === e ? o.view : "days";
100
+ function se({ calendarMonth: t, displayIndex: e, className: n, ...r }) {
101
+ const o = m(g), h = L(), s = o.index === e ? o.view : "days";
105
102
  return /* @__PURE__ */ _("div", {
106
103
  className: l(n, "-ml-1.5 gap-0.5"),
107
- ...a,
104
+ ...r,
108
105
  children: [/* @__PURE__ */ _("button", {
109
106
  type: "button",
110
107
  "aria-expanded": s === "months",
111
108
  onClick: () => o.show(s === "months" ? "days" : "months", e),
112
109
  className: O,
113
- children: [h.monthLong.format(t.date), /* @__PURE__ */ r(M, {
110
+ children: [h.monthLong.format(t.date), /* @__PURE__ */ a(M, {
114
111
  "aria-hidden": !0,
115
112
  className: l(A, s === "months" && "rotate-180")
116
113
  })]
@@ -119,7 +116,7 @@ function se({ calendarMonth: t, displayIndex: e, className: n, ...a }) {
119
116
  "aria-expanded": s === "years",
120
117
  onClick: () => o.show(s === "years" ? "days" : "years", e),
121
118
  className: O,
122
- children: [t.date.getFullYear(), /* @__PURE__ */ r(M, {
119
+ children: [t.date.getFullYear(), /* @__PURE__ */ a(M, {
123
120
  "aria-hidden": !0,
124
121
  className: l(A, s === "years" && "rotate-180")
125
122
  })]
@@ -127,43 +124,43 @@ function se({ calendarMonth: t, displayIndex: e, className: n, ...a }) {
127
124
  });
128
125
  }
129
126
  function ie() {
130
- const t = v(g), { date: e, index: n } = v(C), { goToMonth: a, dayPickerProps: o } = x(), h = L(), { first: s, last: p } = V(), i = e.getFullYear(), b = o.today ?? /* @__PURE__ */ new Date(), m = o.numberOfMonths ?? 1, u = (c) => {
131
- const d = new Date(i, c - n, 1), f = new Date(i, c - n + m - 1, 1);
127
+ const t = m(g), { date: e, index: n } = m(C), { goToMonth: r, dayPickerProps: o } = x(), h = L(), { first: s, last: p } = V(), i = e.getFullYear(), v = o.today ?? /* @__PURE__ */ new Date(), b = o.numberOfMonths ?? 1, u = (c) => {
128
+ const d = new Date(i, c - n, 1), f = new Date(i, c - n + b - 1, 1);
132
129
  return !(i < s || i > p || o.startMonth && d < y(o.startMonth) || o.endMonth && f > y(o.endMonth));
133
130
  };
134
- return /* @__PURE__ */ r("div", {
131
+ return /* @__PURE__ */ a("div", {
135
132
  role: "group",
136
133
  "aria-label": String(i),
137
134
  className: l(B, "grid h-[202px] grid-cols-3 content-start gap-1"),
138
135
  children: Array.from({ length: 12 }, (c, d) => {
139
136
  const f = new Date(i, d, 1), w = !u(d);
140
- return /* @__PURE__ */ r("button", {
137
+ return /* @__PURE__ */ a("button", {
141
138
  type: "button",
142
139
  disabled: w,
143
140
  onClick: () => {
144
- a(new Date(i, d - n, 1)), t.show("days", t.index);
141
+ r(new Date(i, d - n, 1)), t.show("days", t.index);
145
142
  },
146
- className: l(S, "h-11", d === e.getMonth() && U, d !== e.getMonth() && i === b.getFullYear() && d === b.getMonth() && "ring-pho-primary text-pho-primary font-medium ring-1 ring-inset"),
143
+ className: l(S, "h-11", d === e.getMonth() && U, d !== e.getMonth() && i === v.getFullYear() && d === v.getMonth() && "ring-pho-primary text-pho-primary font-medium ring-1 ring-inset"),
147
144
  children: h.month.format(f)
148
145
  }, d);
149
146
  })
150
147
  });
151
148
  }
152
149
  function de() {
153
- const t = v(g), { date: e, index: n } = v(C), { goToMonth: a, dayPickerProps: o } = x(), { first: h, last: s } = V(), p = E(null), i = o.today ?? /* @__PURE__ */ new Date();
150
+ const t = m(g), { date: e, index: n } = m(C), { goToMonth: r, dayPickerProps: o } = x(), { first: h, last: s } = V(), p = E(null), i = o.today ?? /* @__PURE__ */ new Date();
154
151
  return R(() => {
155
152
  p.current?.scrollIntoView({ block: "center" });
156
- }, []), /* @__PURE__ */ r("div", {
153
+ }, []), /* @__PURE__ */ a("div", {
157
154
  role: "group",
158
155
  "aria-label": "Year",
159
156
  className: l(B, "grid h-[202px] grid-cols-4 content-start gap-1 overflow-y-auto"),
160
- children: Array.from({ length: s - h + 1 }, (b, m) => {
161
- const u = h + m, c = u === e.getFullYear();
162
- return /* @__PURE__ */ r("button", {
157
+ children: Array.from({ length: s - h + 1 }, (v, b) => {
158
+ const u = h + b, c = u === e.getFullYear();
159
+ return /* @__PURE__ */ a("button", {
163
160
  type: "button",
164
161
  ref: c ? p : void 0,
165
162
  onClick: () => {
166
- a(new Date(u, e.getMonth() - n, 1)), t.show("months", t.index);
163
+ r(new Date(u, e.getMonth() - n, 1)), t.show("months", t.index);
167
164
  },
168
165
  className: l(S, "h-9", c && U, !c && u === i.getFullYear() && "ring-pho-primary text-pho-primary font-medium ring-1 ring-inset"),
169
166
  children: u
@@ -172,42 +169,42 @@ function de() {
172
169
  });
173
170
  }
174
171
  function le({ calendarMonth: t, displayIndex: e, ...n }) {
175
- const a = k(() => ({
172
+ const r = k(() => ({
176
173
  date: t.date,
177
174
  index: e
178
175
  }), [t.date, e]);
179
- return /* @__PURE__ */ r(C.Provider, {
180
- value: a,
181
- children: /* @__PURE__ */ r("div", { ...n })
176
+ return /* @__PURE__ */ a(C.Provider, {
177
+ value: r,
178
+ children: /* @__PURE__ */ a("div", { ...n })
182
179
  });
183
180
  }
184
181
  function ce(t) {
185
- const e = v(g), { index: n } = v(C), a = e.index === n ? e.view : "days";
186
- return a === "months" ? /* @__PURE__ */ r(ie, {}) : a === "years" ? /* @__PURE__ */ r(de, {}) : /* @__PURE__ */ r("table", { ...t });
182
+ const e = m(g), { index: n } = m(C), r = e.index === n ? e.view : "days";
183
+ return r === "months" ? /* @__PURE__ */ a(ie, {}) : r === "years" ? /* @__PURE__ */ a(de, {}) : /* @__PURE__ */ a("table", { ...t });
187
184
  }
188
- function ue({ onPreviousClick: t, onNextClick: e, previousMonth: n, nextMonth: a, ...o }) {
189
- const h = v(g), { classNames: s, components: p, goToMonth: i, labels: b, dayPickerProps: m } = x();
190
- if (h.view !== "days") return /* @__PURE__ */ r(K, {});
191
- const u = y(m.today ?? /* @__PURE__ */ new Date()), c = m.startMonth != null && u < y(m.startMonth) || m.endMonth != null && u > y(m.endMonth);
185
+ function ue({ onPreviousClick: t, onNextClick: e, previousMonth: n, nextMonth: r, ...o }) {
186
+ const h = m(g), { classNames: s, components: p, goToMonth: i, labels: v, dayPickerProps: b } = x();
187
+ if (h.view !== "days") return /* @__PURE__ */ a(K, {});
188
+ const u = y(b.today ?? /* @__PURE__ */ new Date()), c = b.startMonth != null && u < y(b.startMonth) || b.endMonth != null && u > y(b.endMonth);
192
189
  return /* @__PURE__ */ _("nav", {
193
190
  ...o,
194
191
  children: [
195
- /* @__PURE__ */ r(p.PreviousMonthButton, {
192
+ /* @__PURE__ */ a(p.PreviousMonthButton, {
196
193
  type: "button",
197
194
  className: s.button_previous,
198
195
  tabIndex: n ? void 0 : -1,
199
196
  "aria-disabled": n ? void 0 : !0,
200
- "aria-label": b.labelPrevious(n),
197
+ "aria-label": v.labelPrevious(n),
201
198
  onClick: (d) => {
202
199
  n && t?.(d);
203
200
  },
204
- children: /* @__PURE__ */ r(p.Chevron, {
201
+ children: /* @__PURE__ */ a(p.Chevron, {
205
202
  disabled: n ? void 0 : !0,
206
203
  className: s.chevron,
207
204
  orientation: "left"
208
205
  })
209
206
  }),
210
- /* @__PURE__ */ r("button", {
207
+ /* @__PURE__ */ a("button", {
211
208
  type: "button",
212
209
  className: D,
213
210
  tabIndex: c ? -1 : void 0,
@@ -217,22 +214,22 @@ function ue({ onPreviousClick: t, onNextClick: e, previousMonth: n, nextMonth: a
217
214
  onClick: () => {
218
215
  c || i(u);
219
216
  },
220
- children: /* @__PURE__ */ r(ee, {
217
+ children: /* @__PURE__ */ a(ee, {
221
218
  className: s.chevron,
222
219
  "aria-hidden": !0
223
220
  })
224
221
  }),
225
- /* @__PURE__ */ r(p.NextMonthButton, {
222
+ /* @__PURE__ */ a(p.NextMonthButton, {
226
223
  type: "button",
227
224
  className: s.button_next,
228
- tabIndex: a ? void 0 : -1,
229
- "aria-disabled": a ? void 0 : !0,
230
- "aria-label": b.labelNext(a),
225
+ tabIndex: r ? void 0 : -1,
226
+ "aria-disabled": r ? void 0 : !0,
227
+ "aria-label": v.labelNext(r),
231
228
  onClick: (d) => {
232
- a && e?.(d);
229
+ r && e?.(d);
233
230
  },
234
- children: /* @__PURE__ */ r(p.Chevron, {
235
- disabled: a ? void 0 : !0,
231
+ children: /* @__PURE__ */ a(p.Chevron, {
232
+ disabled: r ? void 0 : !0,
236
233
  className: s.chevron,
237
234
  orientation: "right"
238
235
  })
@@ -242,29 +239,29 @@ function ue({ onPreviousClick: t, onNextClick: e, previousMonth: n, nextMonth: a
242
239
  }
243
240
  var O = l("text-pho-primary flex cursor-pointer items-center gap-0.5 rounded-sm px-1.5 py-0.5 font-medium", "transition-[color,background-color] duration-150 ease-out hover:bg-pho-ghost-hover", "outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1"), A = "text-pho-secondary size-3.5 transition-transform duration-150 ease-out", he = {
244
241
  Day: ne,
245
- DayButton: re,
246
- Chevron: ae,
242
+ DayButton: ae,
243
+ Chevron: re,
247
244
  Nav: ue
248
245
  }, pe = {
249
246
  Month: le,
250
247
  MonthCaption: se,
251
248
  MonthGrid: ce
252
249
  };
253
- function me({ className: t, classNames: e, components: n, showOutsideDays: a = !0, captionLayout: o, startMonth: h, endMonth: s, todayLabel: p = "Today", ...i }) {
254
- const b = o === void 0, [m, u] = Y("days"), [c, d] = Y(0), f = k(() => ({
255
- view: m,
250
+ function be({ className: t, classNames: e, components: n, showOutsideDays: r = !0, captionLayout: o, startMonth: h, endMonth: s, todayLabel: p = "Today", ...i }) {
251
+ const v = o === void 0, [b, u] = Y("days"), [c, d] = Y(0), f = k(() => ({
252
+ view: b,
256
253
  index: c,
257
254
  show: (G, H) => {
258
255
  u(G), d(H);
259
256
  },
260
257
  todayLabel: p
261
258
  }), [
262
- m,
259
+ b,
263
260
  c,
264
261
  p
265
- ]), w = b || o !== "label", P = (i.today ?? /* @__PURE__ */ new Date()).getFullYear(), T = (i.month ?? i.defaultMonth ?? i.today ?? /* @__PURE__ */ new Date()).getFullYear(), j = h ?? (w ? new Date(Math.min(P, T) - N, 0, 1) : void 0), z = s ?? (w ? new Date(Math.max(P, T) + N, 11, 1) : void 0), W = /* @__PURE__ */ r(Q, {
266
- showOutsideDays: a,
267
- captionLayout: b ? "label" : o,
262
+ ]), w = v || o !== "label", P = (i.today ?? /* @__PURE__ */ new Date()).getFullYear(), T = (i.month ?? i.defaultMonth ?? i.today ?? /* @__PURE__ */ new Date()).getFullYear(), j = h ?? (w ? new Date(Math.min(P, T) - N, 0, 1) : void 0), z = s ?? (w ? new Date(Math.max(P, T) + N, 11, 1) : void 0), W = /* @__PURE__ */ a(Q, {
263
+ showOutsideDays: r,
264
+ captionLayout: v ? "label" : o,
268
265
  startMonth: j,
269
266
  endMonth: z,
270
267
  classNames: {
@@ -274,19 +271,19 @@ function me({ className: t, classNames: e, components: n, showOutsideDays: a = !
274
271
  },
275
272
  components: {
276
273
  ...he,
277
- ...b ? pe : null,
274
+ ...v ? pe : null,
278
275
  ...n
279
276
  },
280
277
  ...i
281
278
  });
282
- return /* @__PURE__ */ r(g.Provider, {
279
+ return /* @__PURE__ */ a(g.Provider, {
283
280
  value: f,
284
281
  children: W
285
282
  });
286
283
  }
287
- me.displayName = "Calendar";
284
+ be.displayName = "Calendar";
288
285
  export {
289
- me as t
286
+ be as t
290
287
  };
291
288
 
292
- //# sourceMappingURL=calendar-DDWITGo4.js.map
289
+ //# sourceMappingURL=calendar-s-QRks1Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-s-QRks1Z.js","names":["_Fragment","cn","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","createReactComponent","createContext","useContext","useEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","DayPicker","useDayPicker","__iconNode","IconPointFilled","DAY_SIZE","GRID_WIDTH","DROPDOWN_YEAR_REACH","NAV_BUTTON","CALENDAR_CLASS_NAMES","dayButtonClassName","modifiers","selectedEnd","CalendarDay","_day","className","props","inRange","CalendarDayButton","ref","CalendarChevron","orientation","ChevronDownIcon","startOfMonth","date","ViewContext","MonthContext","JUMP_BUTTON","JUMP_BUTTON_ON","useMonthYearWords","dayPickerProps","code","useNavYears","now","CalendarMonthCaption","calendarMonth","displayIndex","views","words","open","CAPTION_BUTTON","CAPTION_CHEVRON","MonthsView","index","goToMonth","first","last","year","today","span","reachable","month","lead","tail","_","when","outOfReach","YearsView","current","step","chosen","CalendarMonthWrapper","value","CalendarMonthGrid","showing","CalendarNav","onPreviousClick","onNextClick","previousMonth","nextMonth","navProps","classNames","components","labels","event","CALENDAR_COMPONENTS","JUMP_COMPONENTS","Calendar","showOutsideDays","captionLayout","startMonth","endMonth","todayLabel","jumps","view","setView","setIndex","next","at","bounded","thisYear","askedYear","navStart","navEnd","picker"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPointFilled.mjs","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z\", \"key\": \"svg-0\" }]];\nconst IconPointFilled = createReactComponent(\"filled\", \"point-filled\", \"PointFilled\", __iconNode);\n\nexport { __iconNode, IconPointFilled as default };\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type TdHTMLAttributes,\n} from \"react\";\nimport {\n DayPicker,\n useDayPicker,\n type ChevronProps,\n type ClassNames,\n type CustomComponents,\n type DayButtonProps,\n type DayPickerProps,\n type DayProps,\n type Modifiers,\n type MonthCaptionProps,\n type MonthGridProps,\n type MonthProps,\n type NavProps,\n} from \"react-day-picker\";\nimport { IconPointFilled } from \"@tabler/icons-react\";\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n} from \"../../icons/photon\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * One square per day — the unit the whole grid is measured in. The header\n * cells share the width so the weekday initials sit over their column.\n */\nconst DAY_SIZE = \"size-9\";\n\n/**\n * Seven of those columns — the width the month grid comes to, and the width\n * the jump lists hold to, so the panel never changes shape under a tap.\n */\nconst GRID_WIDTH = \"w-63\";\n\n/**\n * How far the year dropdown reaches when the page has not bounded the\n * calendar: ten years back and ten on, which covers the dates a dashboard\n * asks for and still fits one glance. Set `startMonth` / `endMonth` for a\n * birthday, an archive, anything further out.\n */\nconst DROPDOWN_YEAR_REACH = 10;\n\n/** Ghost icon button — the month arrows, sized to the caption row. */\nconst NAV_BUTTON = cn(\n \"text-pho-secondary flex size-7 cursor-pointer items-center justify-center rounded-sm\",\n \"transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-secondary-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n // Past the first or last navigable month the arrow stays put and dims.\n \"aria-disabled:pointer-events-none aria-disabled:opacity-30\",\n);\n\n/**\n * The structural classes. Every element DayPicker renders is named here — the\n * ones Pho dresses from the modifiers instead are named empty — so the\n * library's own stylesheet is never imported and no `rdp-*` class reaches the\n * DOM. A consumer's `classNames` merges over this map, element by element.\n */\nconst CALENDAR_CLASS_NAMES: Partial<ClassNames> = {\n root: \"text-pho-primary inline-block text-base\",\n // `relative` anchors the nav; months sit side by side once there is room.\n months: \"relative flex flex-col gap-6 sm:flex-row\",\n month: \"flex flex-col gap-2\",\n nav: \"absolute top-0 right-0 flex items-center gap-0.5\",\n button_previous: NAV_BUTTON,\n button_next: NAV_BUTTON,\n chevron: \"size-4\",\n // Matches the nav buttons' height so caption and arrows share a baseline.\n month_caption: \"flex h-7 items-center\",\n caption_label:\n \"text-pho-primary inline-flex items-center gap-0.5 font-medium\",\n dropdowns: \"flex items-center gap-1\",\n // The native select is a transparent overlay; the label under it is what shows.\n dropdown_root:\n \"relative -mx-1 inline-flex items-center rounded-sm px-1 hover:bg-pho-ghost-hover has-[select:focus-visible]:outline-pho-brand has-[select:focus-visible]:outline-2\",\n dropdown: \"absolute inset-0 cursor-pointer opacity-0\",\n months_dropdown: \"\",\n years_dropdown: \"\",\n // Separate borders so a range band's rounded ends actually round.\n month_grid: \"border-separate border-spacing-0\",\n weekdays: \"\",\n weekday: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n weeks: \"\",\n week: \"\",\n week_number: \"text-pho-placeholder w-9 text-xs font-normal\",\n week_number_header: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n footer: \"text-pho-description pt-3 text-base\",\n day: \"p-0 text-center align-middle\",\n // Day state is read off the modifiers in the two components below — as data\n // attributes on the cell and as classes on the button — so the library's own\n // state classes stay empty rather than doubling up.\n day_button: \"\",\n selected: \"\",\n range_start: \"\",\n range_middle: \"\",\n range_end: \"\",\n today: \"\",\n outside: \"\",\n focused: \"\",\n disabled: \"\",\n hidden: \"invisible\",\n};\n\n/** The day's own classes, resolved from the modifiers DayPicker hands down. */\nfunction dayButtonClassName(modifiers: Modifiers): string {\n const selectedEnd = Boolean(modifiers.selected && !modifiers.range_middle);\n\n return cn(\n \"relative flex cursor-pointer items-center justify-center rounded-sm tabular-nums select-none\",\n DAY_SIZE,\n \"text-pho-secondary\",\n \"transition-[color,background-color,box-shadow] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n // A day from the neighbouring month is context, not a choice — it recedes\n // to the placeholder step but stays clickable.\n modifiers.outside && \"text-pho-placeholder\",\n // Today is marked with the field hairline, not a fill: the fill means\n // selected, and the two must never be confused.\n modifiers.today &&\n !modifiers.selected &&\n \"ring-pho-primary ring-1 ring-inset font-medium text-pho-primary\",\n // Inside a range the band behind carries the selection; the number just\n // reads as normal ink.\n modifiers.range_middle && \"text-pho-primary\",\n // The chosen day (and both ends of a range) takes the action fill.\n selectedEnd &&\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover hover:text-pho-on-brand font-medium ring-0\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n \"aria-disabled:pointer-events-none aria-disabled:text-pho-disabled\",\n );\n}\n\n/**\n * The grid cell. Carries the range band: a continuous wash behind the days\n * between both ends, rounded where the range starts and stops. The ends' own\n * buttons paint over their half of it, so the band reads as one shape.\n */\nfunction CalendarDay({\n // `day` is DayPicker's own object — kept out of the spread so it never\n // reaches the DOM as an attribute.\n day: _day,\n modifiers,\n className,\n ...props\n}: DayProps) {\n const inRange =\n modifiers.range_start || modifiers.range_middle || modifiers.range_end;\n\n return (\n <td\n {...(props as TdHTMLAttributes<HTMLTableCellElement>)}\n data-range-start={modifiers.range_start || undefined}\n data-range-middle={modifiers.range_middle || undefined}\n data-range-end={modifiers.range_end || undefined}\n className={cn(\n className,\n inRange && \"bg-pho-secondary\",\n modifiers.range_start && \"rounded-l-sm\",\n modifiers.range_end && \"rounded-r-sm\",\n )}\n />\n );\n}\n\n/**\n * The day button. Mirrors the library's own focus handover — roving tabindex\n * moves the `focused` modifier, and the newly focused day claims the caret —\n * then dresses itself from the modifiers.\n */\nfunction CalendarDayButton({\n day: _day,\n modifiers,\n className,\n ...props\n}: DayButtonProps) {\n const ref = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <button\n ref={ref}\n {...props}\n className={cn(dayButtonClassName(modifiers), className)}\n />\n );\n}\n\n/** The system's stroke chevrons in place of the library's filled triangles. */\nfunction CalendarChevron({ orientation = \"left\", className }: ChevronProps) {\n const Icon =\n orientation === \"up\"\n ? ChevronUpIcon\n : orientation === \"down\"\n ? ChevronDownIcon\n : orientation === \"right\"\n ? ChevronRightIcon\n : ChevronLeftIcon;\n\n return <Icon className={className} aria-hidden />;\n}\n\n/* ------------------------------------------------- the caption's two views */\n\nconst startOfMonth = (date: Date) =>\n new Date(date.getFullYear(), date.getMonth(), 1);\n\n/** Which face the calendar is showing — the days, or a way to jump. */\ntype CalendarView = \"days\" | \"months\" | \"years\";\n\ninterface ViewState {\n view: CalendarView;\n /** Which displayed month opened it; only one view is up at a time. */\n index: number;\n show: (view: CalendarView, index: number) => void;\n /** The word on the button back to today, for the label and the tooltip. */\n todayLabel: string;\n}\n\n// Always provided, even where the caption only reads: the nav below needs the\n// today label whether or not the caption drills down.\nconst ViewContext = createContext<ViewState>({\n view: \"days\",\n index: 0,\n show: () => {},\n todayLabel: \"Today\",\n});\n\n/** The month a `Month` subtree belongs to — `MonthGrid` has no other way to know. */\nconst MonthContext = createContext<{ date: Date; index: number }>({\n date: new Date(0),\n index: 0,\n});\n\n/** A month or a year to jump to — the day button's manners at list size. */\nconst JUMP_BUTTON = cn(\n \"flex cursor-pointer items-center justify-center rounded-sm text-base tabular-nums select-none\",\n \"text-pho-secondary transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n);\n\nconst JUMP_BUTTON_ON = cn(\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover\",\n \"hover:text-pho-on-brand font-medium\",\n);\n\n/** The words for a month and a year, in the calendar's own locale. */\nfunction useMonthYearWords() {\n const { dayPickerProps } = useDayPicker();\n const code = dayPickerProps.locale?.code;\n return useMemo(\n () => ({\n month: new Intl.DateTimeFormat(code, { month: \"short\" }),\n monthLong: new Intl.DateTimeFormat(code, { month: \"long\" }),\n }),\n [code],\n );\n}\n\n/** The first and last month the page allows, as plain years. */\nfunction useNavYears() {\n const { dayPickerProps } = useDayPicker();\n const now = dayPickerProps.today ?? new Date();\n const first =\n dayPickerProps.startMonth?.getFullYear() ??\n now.getFullYear() - DROPDOWN_YEAR_REACH;\n const last =\n dayPickerProps.endMonth?.getFullYear() ??\n now.getFullYear() + DROPDOWN_YEAR_REACH;\n return { first, last };\n}\n\n/**\n * The caption. Its month and its year are each a button into their own view,\n * so a date two years out is two taps: the year, then the month.\n */\nfunction CalendarMonthCaption({\n calendarMonth,\n displayIndex,\n className,\n ...props\n}: MonthCaptionProps) {\n const views = useContext(ViewContext);\n const words = useMonthYearWords();\n const open = views.index === displayIndex ? views.view : \"days\";\n\n return (\n // The buttons carry their own padding, so the row pulls back to keep the\n // month's first letter over the grid's left edge.\n <div className={cn(className, \"-ml-1.5 gap-0.5\")} {...props}>\n <button\n type=\"button\"\n aria-expanded={open === \"months\"}\n onClick={() =>\n views.show(open === \"months\" ? \"days\" : \"months\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {words.monthLong.format(calendarMonth.date)}\n <ChevronDownIcon\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"months\" && \"rotate-180\")}\n />\n </button>\n <button\n type=\"button\"\n aria-expanded={open === \"years\"}\n onClick={() =>\n views.show(open === \"years\" ? \"days\" : \"years\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {calendarMonth.date.getFullYear()}\n <ChevronDownIcon\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"years\" && \"rotate-180\")}\n />\n </button>\n </div>\n );\n}\n\n/** The twelve months of the year on screen. Picking one lands on the days. */\nfunction MonthsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const words = useMonthYearWords();\n const { first, last } = useNavYears();\n const year = date.getFullYear();\n const today = dayPickerProps.today ?? new Date();\n const span = dayPickerProps.numberOfMonths ?? 1;\n\n /**\n * The first month `goToMonth` would be given for a choice, and whether the\n * whole strip still fits between the navigable ends. Without the second\n * check DayPicker clamps the value and the pick lands under a different\n * caption than the one that was clicked.\n */\n const reachable = (month: number) => {\n const lead = new Date(year, month - index, 1);\n const tail = new Date(year, month - index + span - 1, 1);\n if (year < first || year > last) return false;\n if (\n dayPickerProps.startMonth &&\n lead < startOfMonth(dayPickerProps.startMonth)\n ) {\n return false;\n }\n if (\n dayPickerProps.endMonth &&\n tail > startOfMonth(dayPickerProps.endMonth)\n ) {\n return false;\n }\n return true;\n };\n\n return (\n <div\n // A labelled set of buttons, not a form section — `fieldset` would say\n // the wrong thing about what this is.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label={String(year)}\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-3 content-start gap-1\",\n )}\n >\n {Array.from({ length: 12 }, (_, month) => {\n const when = new Date(year, month, 1);\n const outOfReach = !reachable(month);\n return (\n <button\n key={month}\n type=\"button\"\n disabled={outOfReach}\n onClick={() => {\n // `goToMonth` names the FIRST month on screen, so a caption\n // further along the strip steps back by its own offset and the\n // pick lands under the caption that was clicked.\n goToMonth(new Date(year, month - index, 1));\n views.show(\"days\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-11\",\n month === date.getMonth() && JUMP_BUTTON_ON,\n month !== date.getMonth() &&\n year === today.getFullYear() &&\n month === today.getMonth() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {words.month.format(when)}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Every year the page allows. Picking one asks for the month next. */\nfunction YearsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const { first, last } = useNavYears();\n const current = useRef<HTMLButtonElement>(null);\n const today = dayPickerProps.today ?? new Date();\n\n // Open on the year in play, however far down the list it sits.\n useEffect(() => {\n current.current?.scrollIntoView({ block: \"center\" });\n }, []);\n\n return (\n <div\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label=\"Year\"\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-4 content-start gap-1 overflow-y-auto\",\n )}\n >\n {Array.from({ length: last - first + 1 }, (_, step) => {\n const year = first + step;\n const chosen = year === date.getFullYear();\n return (\n <button\n key={year}\n type=\"button\"\n ref={chosen ? current : undefined}\n onClick={() => {\n goToMonth(new Date(year, date.getMonth() - index, 1));\n // The year alone does not name a day: ask for the month next.\n views.show(\"months\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-9\",\n chosen && JUMP_BUTTON_ON,\n !chosen &&\n year === today.getFullYear() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {year}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Puts the month a subtree belongs to in reach of the grid below it. */\nfunction CalendarMonthWrapper({\n calendarMonth,\n displayIndex,\n ...props\n}: MonthProps) {\n const value = useMemo(\n () => ({ date: calendarMonth.date, index: displayIndex }),\n [calendarMonth.date, displayIndex],\n );\n return (\n <MonthContext.Provider value={value}>\n <div {...props} />\n </MonthContext.Provider>\n );\n}\n\n/** The days, or whichever jump list the caption asked for in their place. */\nfunction CalendarMonthGrid(props: MonthGridProps) {\n const views = useContext(ViewContext);\n const { index } = useContext(MonthContext);\n const showing = views.index === index ? views.view : \"days\";\n\n if (showing === \"months\") return <MonthsView />;\n if (showing === \"years\") return <YearsView />;\n return <table {...props} />;\n}\n\n/** The month arrows step the days; a jump list is its own navigation. */\n/**\n * Back a month, back to today, on a month. The middle button moves the view\n * to today's month and leaves the selection alone — it is a way back, not a\n * way to choose. It stays lit while sitting on today's month, where the click\n * is a harmless no-op, because a control that reads as broken on first sight\n * is worse than one that sometimes does nothing; it dims only where it truly\n * cannot go, out past `startMonth` / `endMonth`, as the arrows do.\n */\nfunction CalendarNav({\n onPreviousClick,\n onNextClick,\n previousMonth,\n nextMonth,\n ...navProps\n}: NavProps) {\n const views = useContext(ViewContext);\n const { classNames, components, goToMonth, labels, dayPickerProps } =\n useDayPicker();\n\n // A jump list is its own navigation, so the arrows step aside. The nav is\n // absolutely positioned, so nothing below it moves.\n if (views.view !== \"days\") return <></>;\n\n const today = startOfMonth(dayPickerProps.today ?? new Date());\n const outOfReach =\n (dayPickerProps.startMonth != null &&\n today < startOfMonth(dayPickerProps.startMonth)) ||\n (dayPickerProps.endMonth != null &&\n today > startOfMonth(dayPickerProps.endMonth));\n\n return (\n <nav {...navProps}>\n <components.PreviousMonthButton\n type=\"button\"\n className={classNames.button_previous}\n tabIndex={previousMonth ? undefined : -1}\n aria-disabled={previousMonth ? undefined : true}\n aria-label={labels.labelPrevious(previousMonth)}\n onClick={(event) => {\n if (previousMonth) onPreviousClick?.(event);\n }}\n >\n <components.Chevron\n disabled={previousMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"left\"\n />\n </components.PreviousMonthButton>\n\n <button\n type=\"button\"\n className={NAV_BUTTON}\n tabIndex={outOfReach ? -1 : undefined}\n aria-disabled={outOfReach ? true : undefined}\n aria-label={views.todayLabel}\n title={views.todayLabel}\n onClick={() => {\n if (!outOfReach) goToMonth(today);\n }}\n >\n <IconPointFilled className={classNames.chevron} aria-hidden />\n </button>\n\n <components.NextMonthButton\n type=\"button\"\n className={classNames.button_next}\n tabIndex={nextMonth ? undefined : -1}\n aria-disabled={nextMonth ? undefined : true}\n aria-label={labels.labelNext(nextMonth)}\n onClick={(event) => {\n if (nextMonth) onNextClick?.(event);\n }}\n >\n <components.Chevron\n disabled={nextMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"right\"\n />\n </components.NextMonthButton>\n </nav>\n );\n}\n\nconst CAPTION_BUTTON = cn(\n \"text-pho-primary flex cursor-pointer items-center gap-0.5 rounded-sm px-1.5 py-0.5 font-medium\",\n \"transition-[color,background-color] duration-150 ease-out hover:bg-pho-ghost-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n);\n\nconst CAPTION_CHEVRON =\n \"text-pho-secondary size-3.5 transition-transform duration-150 ease-out\";\n\nconst CALENDAR_COMPONENTS: Partial<CustomComponents> = {\n Day: CalendarDay,\n DayButton: CalendarDayButton,\n Chevron: CalendarChevron,\n Nav: CalendarNav,\n};\n\n/** The extra parts the drill-down caption needs on top of the base set. */\nconst JUMP_COMPONENTS: Partial<CustomComponents> = {\n Month: CalendarMonthWrapper,\n MonthCaption: CalendarMonthCaption,\n MonthGrid: CalendarMonthGrid,\n};\n\nexport type CalendarProps = DayPickerProps & {\n /**\n * The word on the button back to today, used as its label and its tooltip.\n * @default \"Today\"\n */\n todayLabel?: string;\n};\n\n/**\n * Calendar built on React DayPicker — a month of days to read or to choose\n * from. Pass `mode` to make it selectable (`single`, `multiple`, `range`);\n * without one it is a static month. Every DayPicker prop passes through, so\n * `numberOfMonths`, `disabled`, `startMonth` / `endMonth`, `captionLayout`,\n * and the locale props all work as documented upstream.\n *\n * Pho supplies the whole class map, so the library's stylesheet is neither\n * imported nor needed. `classNames` and `components` merge over Pho's,\n * element by element.\n *\n * The caption is clickable: month and year each open a jump list, so a date\n * two years out is two taps rather than twenty-four. Pass\n * `captionLayout=\"label\"` for a caption that only reads, and `startMonth` /\n * `endMonth` to say how far the year list should reach. Between the month\n * arrows sits a way back to today's month.\n *\n * Selection follows DayPicker's own contract: hand it `onSelect` and the\n * calendar is controlled, so `selected` has to come with it. Leave both off\n * and it keeps the selection itself.\n *\n * For a calendar behind a field — a trigger that shows the chosen date and\n * opens this in a popover — use `DatePicker`.\n */\nexport function Calendar({\n className,\n classNames,\n components,\n showOutsideDays = true,\n captionLayout,\n startMonth,\n endMonth,\n todayLabel = \"Today\",\n ...props\n}: CalendarProps) {\n // No layout named means Pho's own: a caption that drills down. Name one and\n // DayPicker's handling of it stands, untouched.\n const jumps = captionLayout === undefined;\n const [view, setView] = useState<CalendarView>(\"days\");\n const [index, setIndex] = useState(0);\n const views = useMemo<ViewState>(\n () => ({\n view,\n index,\n show: (next, at) => {\n setView(next);\n setIndex(at);\n },\n todayLabel,\n }),\n [view, index, todayLabel],\n );\n\n // A jump list needs a first and last year to offer, even when none was set.\n // The window has to hold the month the page asked for as well as today:\n // DayPicker clamps a `month` / `defaultMonth` outside it, so a calendar\n // opened on 1979 would silently render this decade instead.\n const bounded = jumps || captionLayout !== \"label\";\n const thisYear = (props.today ?? new Date()).getFullYear();\n const askedYear = (\n props.month ??\n props.defaultMonth ??\n props.today ??\n new Date()\n ).getFullYear();\n const navStart =\n startMonth ??\n (bounded\n ? new Date(Math.min(thisYear, askedYear) - DROPDOWN_YEAR_REACH, 0, 1)\n : undefined);\n const navEnd =\n endMonth ??\n (bounded\n ? new Date(Math.max(thisYear, askedYear) + DROPDOWN_YEAR_REACH, 11, 1)\n : undefined);\n\n const picker = (\n <DayPicker\n showOutsideDays={showOutsideDays}\n // Pho's caption replaces the label wholesale, so DayPicker is told to\n // build the plain one and hand it over.\n captionLayout={jumps ? \"label\" : captionLayout}\n startMonth={navStart}\n endMonth={navEnd}\n classNames={{\n ...CALENDAR_CLASS_NAMES,\n ...classNames,\n // DayPicker concatenates `className` onto the root's classes; folding\n // it in here runs it through `cn` instead, so a caller's `text-md`\n // actually replaces the root's `text-base` rather than fighting it.\n root: cn(CALENDAR_CLASS_NAMES.root, classNames?.root, className),\n }}\n components={{\n ...CALENDAR_COMPONENTS,\n ...(jumps ? JUMP_COMPONENTS : null),\n ...components,\n }}\n {...props}\n />\n );\n\n // Provided either way: the nav's way back to today needs its word even\n // where the caption itself only reads.\n return <ViewContext.Provider value={views}>{picker}</ViewContext.Provider>;\n}\n\nCalendar.displayName = \"Calendar\";\n"],"ignoreList":[0],"mappings":";;;;;;;AASA,IAAMiB,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA+E,KAAO;AAAQ,CAAC,CAAC,GAC9HC,KAAkB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