@photon-ai/pho-ui 2.17.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/chunks/{basic-page-CogcwGx3.js → basic-page-CYDwfVjO.js} +2 -2
  2. package/dist/chunks/{basic-page-CogcwGx3.js.map → basic-page-CYDwfVjO.js.map} +1 -1
  3. package/dist/chunks/calendar-4OFiCLAv.js +292 -0
  4. package/dist/chunks/calendar-4OFiCLAv.js.map +1 -0
  5. package/dist/chunks/date-picker-Bwa6J4ik.js +381 -0
  6. package/dist/chunks/date-picker-Bwa6J4ik.js.map +1 -0
  7. package/dist/chunks/{error-D0yoFxCv.js → error-BAQgnde7.js} +2 -2
  8. package/dist/chunks/{error-D0yoFxCv.js.map → error-BAQgnde7.js.map} +1 -1
  9. package/dist/chunks/{filter-bar-BsvdXwzc.js → filter-bar-D9lBBr4z.js} +2 -2
  10. package/dist/chunks/{filter-bar-BsvdXwzc.js.map → filter-bar-D9lBBr4z.js.map} +1 -1
  11. package/dist/components/calendar.js +5 -0
  12. package/dist/components/date-picker.js +6 -0
  13. package/dist/components/error.js +1 -1
  14. package/dist/components/filter-bar.js +1 -1
  15. package/dist/index.js +114 -116
  16. package/dist/primitives.js +1 -1
  17. package/dist/sections/basic-page.js +1 -1
  18. package/dist/src/components/calendar/calendar.d.ts +36 -0
  19. package/dist/src/components/calendar/index.d.ts +2 -0
  20. package/dist/src/components/date-picker/date-picker.d.ts +97 -0
  21. package/dist/src/components/date-picker/index.d.ts +2 -0
  22. package/dist/src/index.d.ts +2 -1
  23. package/package.json +10 -5
  24. package/dist/chunks/date-range-picker-DwFDUNRL.js +0 -88
  25. package/dist/chunks/date-range-picker-DwFDUNRL.js.map +0 -1
  26. package/dist/components/date-range-picker.js +0 -10
  27. package/dist/src/components/date-range-picker/date-range-picker.d.ts +0 -31
  28. package/dist/src/components/date-range-picker/index.d.ts +0 -1
@@ -0,0 +1,292 @@
1
+ "use client";
2
+ import { t as l } from "./cn-ChIgwEl3.js";
3
+ import { t as J } from "./createReactComponent-BqCmnqfX.js";
4
+ import { t as M } from "./IconChevronDown-CZilB71T.js";
5
+ import { t as Z } from "./IconChevronLeft-CSWMKQ4C.js";
6
+ import { t as $ } from "./IconChevronRight-CzoJnYNI.js";
7
+ import { t as q } from "./IconChevronUp-CrpWSgIl.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";
10
+ import { DayPicker as Q, useDayPicker as x } from "react-day-picker";
11
+ var X = [["path", {
12
+ d: "M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z",
13
+ 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 = {
15
+ root: "text-pho-primary inline-block text-base",
16
+ months: "relative flex flex-col gap-6 sm:flex-row",
17
+ month: "flex flex-col gap-2",
18
+ nav: "absolute top-0 right-0 flex items-center gap-0.5",
19
+ button_previous: D,
20
+ button_next: D,
21
+ chevron: "size-4",
22
+ month_caption: "flex h-7 items-center",
23
+ caption_label: "text-pho-primary inline-flex items-center gap-0.5 font-medium",
24
+ dropdowns: "flex items-center gap-1",
25
+ dropdown_root: "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",
26
+ dropdown: "absolute inset-0 cursor-pointer opacity-0",
27
+ months_dropdown: "",
28
+ years_dropdown: "",
29
+ month_grid: "border-separate border-spacing-0",
30
+ weekdays: "",
31
+ weekday: "text-pho-description w-9 pb-1 text-xs font-normal",
32
+ weeks: "",
33
+ week: "",
34
+ week_number: "text-pho-placeholder w-9 text-xs font-normal",
35
+ week_number_header: "text-pho-description w-9 pb-1 text-xs font-normal",
36
+ footer: "text-pho-description pt-3 text-base",
37
+ day: "p-0 text-center align-middle",
38
+ day_button: "",
39
+ selected: "",
40
+ range_start: "",
41
+ range_middle: "",
42
+ range_end: "",
43
+ today: "",
44
+ outside: "",
45
+ focused: "",
46
+ disabled: "",
47
+ hidden: "invisible"
48
+ };
49
+ function oe(t) {
50
+ const e = !!(t.selected && !t.range_middle);
51
+ 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
+ }
53
+ function ne({ day: t, modifiers: e, className: n, ...a }) {
54
+ const o = e.range_start || e.range_middle || e.range_end;
55
+ return /* @__PURE__ */ r("td", {
56
+ ...a,
57
+ "data-range-start": e.range_start || void 0,
58
+ "data-range-middle": e.range_middle || void 0,
59
+ "data-range-end": e.range_end || void 0,
60
+ className: l(n, o && "bg-pho-secondary", e.range_start && "rounded-l-sm", e.range_end && "rounded-r-sm")
61
+ });
62
+ }
63
+ function re({ day: t, modifiers: e, className: n, ...a }) {
64
+ const o = E(null);
65
+ return R(() => {
66
+ e.focused && o.current?.focus();
67
+ }, [e.focused]), /* @__PURE__ */ r("button", {
68
+ ref: o,
69
+ ...a,
70
+ className: l(oe(e), n)
71
+ });
72
+ }
73
+ function ae({ orientation: t = "left", className: e }) {
74
+ return /* @__PURE__ */ r(t === "up" ? q : t === "down" ? M : t === "right" ? $ : Z, {
75
+ className: e,
76
+ "aria-hidden": !0
77
+ });
78
+ }
79
+ var y = (t) => new Date(t.getFullYear(), t.getMonth(), 1), g = I({
80
+ view: "days",
81
+ index: 0,
82
+ show: () => {
83
+ },
84
+ todayLabel: "Today"
85
+ }), C = I({
86
+ date: /* @__PURE__ */ new Date(0),
87
+ index: 0
88
+ }), S = l("flex cursor-pointer items-center justify-center rounded-sm text-base tabular-nums 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", "disabled:pointer-events-none disabled:text-pho-disabled"), U = l("bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover", "hover:text-pho-on-brand font-medium");
89
+ function L() {
90
+ const { dayPickerProps: t } = x(), e = t.locale?.code;
91
+ return k(() => ({
92
+ month: new Intl.DateTimeFormat(e, { month: "short" }),
93
+ monthLong: new Intl.DateTimeFormat(e, { month: "long" })
94
+ }), [e]);
95
+ }
96
+ function V() {
97
+ const { dayPickerProps: t } = x(), e = t.today ?? /* @__PURE__ */ new Date();
98
+ return {
99
+ first: t.startMonth?.getFullYear() ?? e.getFullYear() - N,
100
+ last: t.endMonth?.getFullYear() ?? e.getFullYear() + N
101
+ };
102
+ }
103
+ function se({ calendarMonth: t, displayIndex: e, className: n, ...a }) {
104
+ const o = v(g), h = L(), s = o.index === e ? o.view : "days";
105
+ return /* @__PURE__ */ _("div", {
106
+ className: l(n, "-ml-1.5 gap-0.5"),
107
+ ...a,
108
+ children: [/* @__PURE__ */ _("button", {
109
+ type: "button",
110
+ "aria-expanded": s === "months",
111
+ onClick: () => o.show(s === "months" ? "days" : "months", e),
112
+ className: O,
113
+ children: [h.monthLong.format(t.date), /* @__PURE__ */ r(M, {
114
+ "aria-hidden": !0,
115
+ className: l(A, s === "months" && "rotate-180")
116
+ })]
117
+ }), /* @__PURE__ */ _("button", {
118
+ type: "button",
119
+ "aria-expanded": s === "years",
120
+ onClick: () => o.show(s === "years" ? "days" : "years", e),
121
+ className: O,
122
+ children: [t.date.getFullYear(), /* @__PURE__ */ r(M, {
123
+ "aria-hidden": !0,
124
+ className: l(A, s === "years" && "rotate-180")
125
+ })]
126
+ })]
127
+ });
128
+ }
129
+ 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);
132
+ return !(i < s || i > p || o.startMonth && d < y(o.startMonth) || o.endMonth && f > y(o.endMonth));
133
+ };
134
+ return /* @__PURE__ */ r("div", {
135
+ role: "group",
136
+ "aria-label": String(i),
137
+ className: l(B, "grid h-[202px] grid-cols-3 content-start gap-1"),
138
+ children: Array.from({ length: 12 }, (c, d) => {
139
+ const f = new Date(i, d, 1), w = !u(d);
140
+ return /* @__PURE__ */ r("button", {
141
+ type: "button",
142
+ disabled: w,
143
+ onClick: () => {
144
+ a(new Date(i, d - n, 1)), t.show("days", t.index);
145
+ },
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"),
147
+ children: h.month.format(f)
148
+ }, d);
149
+ })
150
+ });
151
+ }
152
+ 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();
154
+ return R(() => {
155
+ p.current?.scrollIntoView({ block: "center" });
156
+ }, []), /* @__PURE__ */ r("div", {
157
+ role: "group",
158
+ "aria-label": "Year",
159
+ 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", {
163
+ type: "button",
164
+ ref: c ? p : void 0,
165
+ onClick: () => {
166
+ a(new Date(u, e.getMonth() - n, 1)), t.show("months", t.index);
167
+ },
168
+ className: l(S, "h-9", c && U, !c && u === i.getFullYear() && "ring-pho-primary text-pho-primary font-medium ring-1 ring-inset"),
169
+ children: u
170
+ }, u);
171
+ })
172
+ });
173
+ }
174
+ function le({ calendarMonth: t, displayIndex: e, ...n }) {
175
+ const a = k(() => ({
176
+ date: t.date,
177
+ index: e
178
+ }), [t.date, e]);
179
+ return /* @__PURE__ */ r(C.Provider, {
180
+ value: a,
181
+ children: /* @__PURE__ */ r("div", { ...n })
182
+ });
183
+ }
184
+ 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 });
187
+ }
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);
192
+ return /* @__PURE__ */ _("nav", {
193
+ ...o,
194
+ children: [
195
+ /* @__PURE__ */ r(p.PreviousMonthButton, {
196
+ type: "button",
197
+ className: s.button_previous,
198
+ tabIndex: n ? void 0 : -1,
199
+ "aria-disabled": n ? void 0 : !0,
200
+ "aria-label": b.labelPrevious(n),
201
+ onClick: (d) => {
202
+ n && t?.(d);
203
+ },
204
+ children: /* @__PURE__ */ r(p.Chevron, {
205
+ disabled: n ? void 0 : !0,
206
+ className: s.chevron,
207
+ orientation: "left"
208
+ })
209
+ }),
210
+ /* @__PURE__ */ r("button", {
211
+ type: "button",
212
+ className: D,
213
+ tabIndex: c ? -1 : void 0,
214
+ "aria-disabled": c ? !0 : void 0,
215
+ "aria-label": h.todayLabel,
216
+ title: h.todayLabel,
217
+ onClick: () => {
218
+ c || i(u);
219
+ },
220
+ children: /* @__PURE__ */ r(ee, {
221
+ className: s.chevron,
222
+ "aria-hidden": !0
223
+ })
224
+ }),
225
+ /* @__PURE__ */ r(p.NextMonthButton, {
226
+ type: "button",
227
+ className: s.button_next,
228
+ tabIndex: a ? void 0 : -1,
229
+ "aria-disabled": a ? void 0 : !0,
230
+ "aria-label": b.labelNext(a),
231
+ onClick: (d) => {
232
+ a && e?.(d);
233
+ },
234
+ children: /* @__PURE__ */ r(p.Chevron, {
235
+ disabled: a ? void 0 : !0,
236
+ className: s.chevron,
237
+ orientation: "right"
238
+ })
239
+ })
240
+ ]
241
+ });
242
+ }
243
+ 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
+ Day: ne,
245
+ DayButton: re,
246
+ Chevron: ae,
247
+ Nav: ue
248
+ }, pe = {
249
+ Month: le,
250
+ MonthCaption: se,
251
+ MonthGrid: ce
252
+ };
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,
256
+ index: c,
257
+ show: (G, H) => {
258
+ u(G), d(H);
259
+ },
260
+ todayLabel: p
261
+ }), [
262
+ m,
263
+ c,
264
+ 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,
268
+ startMonth: j,
269
+ endMonth: z,
270
+ classNames: {
271
+ ...F,
272
+ ...e,
273
+ root: l(F.root, e?.root, t)
274
+ },
275
+ components: {
276
+ ...he,
277
+ ...b ? pe : null,
278
+ ...n
279
+ },
280
+ ...i
281
+ });
282
+ return /* @__PURE__ */ r(g.Provider, {
283
+ value: f,
284
+ children: W
285
+ });
286
+ }
287
+ me.displayName = "Calendar";
288
+ export {
289
+ me as t
290
+ };
291
+
292
+ //# sourceMappingURL=calendar-4OFiCLAv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-4OFiCLAv.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconPointFilled.mjs","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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//# sourceMappingURL=IconPointFilled.mjs.map\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 {\n IconChevronDown,\n IconChevronLeft,\n IconChevronRight,\n IconChevronUp,\n IconPointFilled,\n} from \"@tabler/icons-react\";\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 ? IconChevronUp\n : orientation === \"down\"\n ? IconChevronDown\n : orientation === \"right\"\n ? IconChevronRight\n : IconChevronLeft;\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 <IconChevronDown\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 <IconChevronDown\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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AASA,IAAM,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA+E,KAAO;AAAQ,CAAC,CAAC,GAC9H,KAAkB,EAAqB,UAAU,gBAAgB,eAAe,CAAU,GC2B1F,KAAW,UAMX,IAAa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