@burdenoff/microfe-calendar 2026.1124.1 → 2026.1124.2

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 (77) hide show
  1. package/dist/generated/wspace-operations.d.ts +189 -0
  2. package/dist/generated/wspace-operations.js +63 -2
  3. package/dist/generated/wspace-operations.js.map +1 -1
  4. package/dist/generated/wspace-types.d.ts +1243 -10
  5. package/dist/hooks/useSafePermissions.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/providers/CalendarProvider.d.ts +3 -1
  8. package/dist/providers/CalendarProvider.js +12 -10
  9. package/dist/providers/CalendarProvider.js.map +1 -1
  10. package/dist/translations/en.d.ts +60 -1
  11. package/dist/types/index.d.ts +9 -0
  12. package/dist/v2/CalendarPageV2.js +44 -39
  13. package/dist/v2/CalendarPageV2.js.map +1 -1
  14. package/dist/v2/grid/GridParts.js +100 -94
  15. package/dist/v2/grid/GridParts.js.map +1 -1
  16. package/dist/v2/grid/TimeGrid.js +98 -89
  17. package/dist/v2/grid/TimeGrid.js.map +1 -1
  18. package/dist/v2/list/ListViewV2.d.ts +6 -2
  19. package/dist/v2/list/ListViewV2.js +50 -44
  20. package/dist/v2/list/ListViewV2.js.map +1 -1
  21. package/dist/v2/month/MonthView.js +130 -126
  22. package/dist/v2/month/MonthView.js.map +1 -1
  23. package/dist/v2/rail/CalendarRail.js +54 -80
  24. package/dist/v2/rail/CalendarRail.js.map +1 -1
  25. package/dist/v2/runs/RunPeek.d.ts +2 -0
  26. package/dist/v2/runs/RunPeek.js +382 -0
  27. package/dist/v2/runs/RunPeek.js.map +1 -0
  28. package/dist/v2/runs/RunPills.d.ts +28 -0
  29. package/dist/v2/runs/RunPills.js +179 -0
  30. package/dist/v2/runs/RunPills.js.map +1 -0
  31. package/dist/v2/runs/RunRows.d.ts +21 -0
  32. package/dist/v2/runs/RunRows.js +140 -0
  33. package/dist/v2/runs/RunRows.js.map +1 -0
  34. package/dist/v2/runs/RunsNotices.d.ts +1 -0
  35. package/dist/v2/runs/RunsNotices.js +37 -0
  36. package/dist/v2/runs/RunsNotices.js.map +1 -0
  37. package/dist/v2/runs/RunsSwitch.d.ts +1 -0
  38. package/dist/v2/runs/RunsSwitch.js +54 -0
  39. package/dist/v2/runs/RunsSwitch.js.map +1 -0
  40. package/dist/v2/runs/WorkflowRunsLayer.d.ts +4 -0
  41. package/dist/v2/runs/WorkflowRunsLayer.js +82 -0
  42. package/dist/v2/runs/WorkflowRunsLayer.js.map +1 -0
  43. package/dist/v2/runs/runAccess.d.ts +37 -0
  44. package/dist/v2/runs/runAccess.js +14 -0
  45. package/dist/v2/runs/runAccess.js.map +1 -0
  46. package/dist/v2/runs/runLayout.d.ts +76 -0
  47. package/dist/v2/runs/runLayout.js +129 -0
  48. package/dist/v2/runs/runLayout.js.map +1 -0
  49. package/dist/v2/runs/runLinks.d.ts +32 -0
  50. package/dist/v2/runs/runLinks.js +50 -0
  51. package/dist/v2/runs/runLinks.js.map +1 -0
  52. package/dist/v2/runs/runModel.d.ts +97 -0
  53. package/dist/v2/runs/runModel.js +132 -0
  54. package/dist/v2/runs/runModel.js.map +1 -0
  55. package/dist/v2/runs/runPeekState.d.ts +53 -0
  56. package/dist/v2/runs/runPeekState.js +62 -0
  57. package/dist/v2/runs/runPeekState.js.map +1 -0
  58. package/dist/v2/runs/runTypes.d.ts +60 -0
  59. package/dist/v2/runs/runWords.d.ts +23 -0
  60. package/dist/v2/runs/runWords.js +83 -0
  61. package/dist/v2/runs/runWords.js.map +1 -0
  62. package/dist/v2/runs/runsLayerContext.d.ts +26 -0
  63. package/dist/v2/runs/runsLayerContext.js +33 -0
  64. package/dist/v2/runs/runsLayerContext.js.map +1 -0
  65. package/dist/v2/runs/useRunHrefs.d.ts +10 -0
  66. package/dist/v2/runs/useRunHrefs.js +60 -0
  67. package/dist/v2/runs/useRunHrefs.js.map +1 -0
  68. package/dist/v2/runs/useRunLabels.d.ts +6 -0
  69. package/dist/v2/runs/useRunLabels.js +27 -0
  70. package/dist/v2/runs/useRunLabels.js.map +1 -0
  71. package/dist/v2/runs/useRunsAccess.d.ts +2 -0
  72. package/dist/v2/runs/useRunsAccess.js +14 -0
  73. package/dist/v2/runs/useRunsAccess.js.map +1 -0
  74. package/dist/v2/runs/useWorkflowRuns.d.ts +61 -0
  75. package/dist/v2/runs/useWorkflowRuns.js +119 -0
  76. package/dist/v2/runs/useWorkflowRuns.js.map +1 -0
  77. package/package.json +1 -1
@@ -1,41 +1,42 @@
1
1
  import { calendarHueStyle as e } from "../colors.js";
2
2
  import { formatDay as t, formatDuration as n, formatMinuteRange as r, formatMinutes as i } from "../format.js";
3
3
  import { useCalendarPage as a } from "../page/CalendarPageContext.js";
4
- import { FOCUS_RING as o } from "../styles.js";
5
- import { isWeekendDay as s } from "../time/calendarTime.js";
6
- import { EventBlock as c } from "./EventBlock.js";
7
- import { minuteOffset as l } from "./geometry.js";
8
- import { offHours as u } from "./workingHours.js";
9
- import { CalendarPlus as d, Plus as f } from "lucide-react";
10
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
- import { Button as g, EmptyState as _, formatTimeZoneOffset as v } from "@burdenoff/fe-libs/ui";
12
- import { cn as y } from "@burdenoff/fe-libs/utils";
4
+ import { DayRunPills as o } from "../runs/RunPills.js";
5
+ import { FOCUS_RING as s } from "../styles.js";
6
+ import { isWeekendDay as c } from "../time/calendarTime.js";
7
+ import { EventBlock as l } from "./EventBlock.js";
8
+ import { minuteOffset as u } from "./geometry.js";
9
+ import { offHours as d } from "./workingHours.js";
10
+ import { CalendarPlus as f, Plus as p } from "lucide-react";
11
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import { Button as _, EmptyState as v, formatTimeZoneOffset as y } from "@burdenoff/fe-libs/ui";
13
+ import { cn as b } from "@burdenoff/fe-libs/utils";
13
14
  // src/v2/grid/GridParts.tsx
14
- var b = Array.from({ length: 24 }, (e, t) => t);
15
- function x({ columnsStyle: e }) {
16
- let t = a(), { tr: n, format: r, timeZone: i, compact: s, days: c, today: l, nav: u } = t, d = v(i, t.now, r.locale), f = n("calendar.v2.timeZoneButton", "Time zone: {{zone}}", { zone: i });
17
- return /* @__PURE__ */ h("div", {
15
+ var x = Array.from({ length: 24 }, (e, t) => t);
16
+ function S({ columnsStyle: e }) {
17
+ let t = a(), { tr: n, format: r, timeZone: i, compact: o, days: c, today: l, nav: u } = t, d = y(i, t.now, r.locale), f = n("calendar.v2.timeZoneButton", "Time zone: {{zone}}", { zone: i });
18
+ return /* @__PURE__ */ g("div", {
18
19
  className: "grid border-b border-border-subtle",
19
20
  style: e,
20
- children: [/* @__PURE__ */ m("div", {
21
+ children: [/* @__PURE__ */ h("div", {
21
22
  className: "flex items-end justify-end pe-1 pb-1.5",
22
- children: /* @__PURE__ */ m("button", {
23
+ children: /* @__PURE__ */ h("button", {
23
24
  type: "button",
24
25
  onClick: () => u.openDialog("settings"),
25
26
  title: f,
26
27
  "aria-label": f,
27
- className: y("rounded px-[3px] py-0.5 text-[10px] whitespace-nowrap tabular-nums text-text-muted hover:bg-bg-sunken hover:text-text-primary", o),
28
- children: s ? d.replace(/^[^+−-]*/, "") : d
28
+ className: b("rounded px-[3px] py-0.5 text-[10px] whitespace-nowrap tabular-nums text-text-muted hover:bg-bg-sunken hover:text-text-primary", s),
29
+ children: o ? d.replace(/^[^+−-]*/, "") : d
29
30
  })
30
- }), c.map((e) => /* @__PURE__ */ m(S, {
31
+ }), c.map((e) => /* @__PURE__ */ h(C, {
31
32
  day: e,
32
33
  isToday: e === l
33
34
  }, e))]
34
35
  });
35
36
  }
36
- function S({ day: e, isToday: n }) {
37
- let { tr: r, format: i, compact: c, nav: l } = a(), u = s(e), d = n ? "today" : u ? "weekend" : "day";
38
- return /* @__PURE__ */ h("button", {
37
+ function C({ day: e, isToday: n }) {
38
+ let { tr: r, format: i, compact: o, nav: l } = a(), u = c(e), d = n ? "today" : u ? "weekend" : "day";
39
+ return /* @__PURE__ */ g("button", {
39
40
  type: "button",
40
41
  onClick: () => l.goTo({
41
42
  view: "day",
@@ -43,143 +44,148 @@ function S({ day: e, isToday: n }) {
43
44
  }),
44
45
  "aria-current": n ? "date" : void 0,
45
46
  "aria-label": r("calendar.v2.openDay", "{{day}}. Open the day", { day: t(e, i, "full") }),
46
- className: y("flex min-w-0 items-center justify-center gap-1.5 border-s border-border-subtle px-0.5 py-[7px] hover:bg-bg-sunken", c && "flex-col gap-px py-[5px]", o),
47
- children: [/* @__PURE__ */ m("span", {
48
- className: y("text-[11px] font-semibold uppercase tracking-[0.06em]", d === "today" && "text-action-primary-bg", d === "weekend" && "text-text-muted", d === "day" && "text-text-secondary"),
47
+ className: b("flex min-w-0 items-center justify-center gap-1.5 border-s border-border-subtle px-0.5 py-[7px] hover:bg-bg-sunken", o && "flex-col gap-px py-[5px]", s),
48
+ children: [/* @__PURE__ */ h("span", {
49
+ className: b("text-[11px] font-semibold uppercase tracking-[0.06em]", d === "today" && "text-action-primary-bg", d === "weekend" && "text-text-muted", d === "day" && "text-text-secondary"),
49
50
  children: t(e, i, "weekday")
50
- }), /* @__PURE__ */ m("span", {
51
- className: y("grid h-[30px] min-w-[30px] place-items-center rounded-full px-1 text-lg font-semibold tabular-nums", c && "h-7 min-w-7 text-base", d === "today" && "bg-action-primary-bg text-action-primary-text", d === "weekend" && "text-text-muted", d === "day" && "text-text-primary"),
51
+ }), /* @__PURE__ */ h("span", {
52
+ className: b("grid h-[30px] min-w-[30px] place-items-center rounded-full px-1 text-lg font-semibold tabular-nums", o && "h-7 min-w-7 text-base", d === "today" && "bg-action-primary-bg text-action-primary-text", d === "weekend" && "text-text-muted", d === "day" && "text-text-primary"),
52
53
  children: t(e, i, "dayNumber")
53
54
  })]
54
55
  });
55
56
  }
56
- function C({ hourHeight: e }) {
57
+ function w({ hourHeight: e }) {
57
58
  let { format: t, days: n, today: r, nowMinute: o } = a(), s = n.includes(r);
58
- return /* @__PURE__ */ h("div", {
59
+ return /* @__PURE__ */ g("div", {
59
60
  className: "relative",
60
61
  "aria-hidden": "true",
61
- children: [b.map((n) => n === 0 || s && Math.abs(n * 60 - o) < 13 ? null : /* @__PURE__ */ m("span", {
62
+ children: [x.map((n) => n === 0 || s && Math.abs(n * 60 - o) < 13 ? null : /* @__PURE__ */ h("span", {
62
63
  className: "absolute end-[7px] -translate-y-1/2 text-[11px] leading-none whitespace-nowrap tabular-nums text-text-muted",
63
64
  style: { top: n * e },
64
65
  children: i(n * 60, t)
65
- }, n)), s ? /* @__PURE__ */ m("span", {
66
+ }, n)), s ? /* @__PURE__ */ h("span", {
66
67
  className: "absolute end-[3px] z-[4] -translate-y-1/2 rounded-full bg-action-primary-bg px-[5px] py-[3px] text-[10.5px] leading-none font-bold whitespace-nowrap tabular-nums text-action-primary-text",
67
- style: { top: l(o, e) },
68
+ style: { top: u(o, e) },
68
69
  children: i(o, t)
69
70
  }) : null]
70
71
  });
71
72
  }
72
- function w({ day: e, hourHeight: t }) {
73
+ function T({ day: e, hourHeight: t }) {
73
74
  let { workingHoursOn: n } = a(), r = n(e);
74
- return r === void 0 ? null : /* @__PURE__ */ m(p, { children: u(r).map((e) => /* @__PURE__ */ m("div", {
75
+ return r === void 0 ? null : /* @__PURE__ */ h(m, { children: d(r).map((e) => /* @__PURE__ */ h("div", {
75
76
  className: "pointer-events-none absolute inset-x-0 bg-bg-sunken/70",
76
77
  style: {
77
- top: l(e.start, t),
78
- height: l(e.end - e.start, t)
78
+ top: u(e.start, t),
79
+ height: u(e.end - e.start, t)
79
80
  }
80
81
  }, e.start)) });
81
82
  }
82
- function T({ isToday: e, hourHeight: t }) {
83
+ function E({ isToday: e, hourHeight: t }) {
83
84
  let { nowMinute: n } = a();
84
- return /* @__PURE__ */ m("div", {
85
+ return /* @__PURE__ */ h("div", {
85
86
  "aria-hidden": "true",
86
- className: y("pointer-events-none absolute inset-x-0", e ? "-start-px z-[5] -mt-px h-0.5 bg-action-primary-bg before:absolute before:-start-[5px] before:-top-1 before:size-2.5 before:rounded-full before:bg-action-primary-bg" : "z-[2] h-px bg-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]"),
87
- style: { top: l(n, t) }
87
+ className: b("pointer-events-none absolute inset-x-0", e ? "-start-px z-[5] -mt-px h-0.5 bg-action-primary-bg before:absolute before:-start-[5px] before:-top-1 before:size-2.5 before:rounded-full before:bg-action-primary-bg" : "z-[2] h-px bg-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]"),
88
+ style: { top: u(n, t) }
88
89
  });
89
90
  }
90
- function E({ day: i, placed: o, hourHeight: s, selectedId: u, onOpen: d, onKeyDown: f, consumeClick: p, ghost: g, quick: _, cursorMinute: v }) {
91
- let b = a(), { tr: x, format: S, compact: C, today: E, days: O } = b, k = i === E, A = {
91
+ function D({ day: i, placed: s, hourHeight: c, selectedId: d, onOpen: f, onKeyDown: p, consumeClick: m, ghost: _, quick: v, cursorMinute: y }) {
92
+ let x = a(), { tr: S, format: C, compact: w, today: D, days: k } = x, A = i === D, j = {
92
93
  backgroundImage: "linear-gradient(to bottom, var(--color-border-subtle) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in oklab, var(--color-border-subtle) 45%, transparent) 1px, transparent 1px)",
93
- backgroundSize: `100% ${s}px, 100% ${s}px`,
94
- backgroundPosition: `0 0, 0 ${s / 2}px`
94
+ backgroundSize: `100% ${c}px, 100% ${c}px`,
95
+ backgroundPosition: `0 0, 0 ${c / 2}px`
95
96
  };
96
- return /* @__PURE__ */ h("div", {
97
+ return /* @__PURE__ */ g("div", {
97
98
  "data-grid-day": i,
98
99
  role: "group",
99
- "aria-label": x("calendar.v2.dayColumn", "{{day}}: {{count}} events", {
100
- day: t(i, S, "full"),
101
- count: o.length
100
+ "aria-label": S("calendar.v2.dayColumn", "{{day}}: {{count}} events", {
101
+ day: t(i, C, "full"),
102
+ count: s.length
102
103
  }),
103
- className: y("relative border-s border-border-subtle", k && "bg-accent-soft/30"),
104
- style: A,
104
+ className: b("relative border-s border-border-subtle", A && "bg-accent-soft/30"),
105
+ style: j,
105
106
  children: [
106
- /* @__PURE__ */ m(w, {
107
+ /* @__PURE__ */ h(T, {
107
108
  day: i,
108
- hourHeight: s
109
+ hourHeight: c
109
110
  }),
110
- o.map((e) => {
111
- let t = b.lookOf(e.event);
112
- return /* @__PURE__ */ m(c, {
111
+ s.map((e) => {
112
+ let t = x.lookOf(e.event);
113
+ return /* @__PURE__ */ h(l, {
113
114
  placed: e,
114
- hourHeight: s,
115
+ hourHeight: c,
115
116
  look: t,
116
- hue: b.hueOf(e.event.calendarId),
117
- label: b.labelOf(e.event),
118
- format: S,
119
- selected: u === e.event.id,
120
- resizable: t.movable && !C && !e.continuesAfter,
121
- onOpen: d,
122
- onKeyDown: f,
123
- consumeClick: p
117
+ hue: x.hueOf(e.event.calendarId),
118
+ label: x.labelOf(e.event),
119
+ format: C,
120
+ selected: d === e.event.id,
121
+ resizable: t.movable && !w && !e.continuesAfter,
122
+ onOpen: f,
123
+ onKeyDown: p,
124
+ consumeClick: m
124
125
  }, `${e.event.id}|${e.date}`);
125
126
  }),
126
- O.includes(E) ? /* @__PURE__ */ m(T, {
127
- isToday: k,
128
- hourHeight: s
129
- }) : null,
130
- g ? /* @__PURE__ */ m(D, {
131
- start: g.start,
132
- end: g.end,
133
- hourHeight: s,
134
- hueStyle: g.event ? e(b.hueOf(g.event.calendarId)) : void 0,
135
- label: g.event ? `${g.event.title} · ${r(g.start, g.end, S)}` : `${r(g.start, g.end, S)} · ${n(g.end - g.start, b.durationWords)}`
127
+ /* @__PURE__ */ h(o, {
128
+ day: i,
129
+ hourHeight: c,
130
+ placed: s
131
+ }),
132
+ k.includes(D) ? /* @__PURE__ */ h(E, {
133
+ isToday: A,
134
+ hourHeight: c
136
135
  }) : null,
137
- _ ? /* @__PURE__ */ m(D, {
136
+ _ ? /* @__PURE__ */ h(O, {
138
137
  start: _.start,
139
138
  end: _.end,
140
- hourHeight: s,
141
- label: r(_.start, _.end, S),
139
+ hourHeight: c,
140
+ hueStyle: _.event ? e(x.hueOf(_.event.calendarId)) : void 0,
141
+ label: _.event ? `${_.event.title} · ${r(_.start, _.end, C)}` : `${r(_.start, _.end, C)} · ${n(_.end - _.start, x.durationWords)}`
142
+ }) : null,
143
+ v ? /* @__PURE__ */ h(O, {
144
+ start: v.start,
145
+ end: v.end,
146
+ hourHeight: c,
147
+ label: r(v.start, v.end, C),
142
148
  quickAnchor: !0
143
149
  }) : null,
144
- v === null ? null : /* @__PURE__ */ m("div", {
150
+ y === null ? null : /* @__PURE__ */ h("div", {
145
151
  "aria-hidden": "true",
146
152
  className: "pointer-events-none absolute inset-x-0.5 z-[8] rounded-md border-2 border-[var(--color-focus-ring)] bg-accent-soft/40 px-1.5 text-[11px] font-semibold text-text-primary",
147
153
  style: {
148
- top: l(v, s),
149
- height: l(30, s) - 2
154
+ top: u(y, c),
155
+ height: u(30, c) - 2
150
156
  },
151
- children: r(v, v + 30, S)
157
+ children: r(y, y + 30, C)
152
158
  })
153
159
  ]
154
160
  });
155
161
  }
156
- function D({ start: e, end: t, hourHeight: n, label: r, hueStyle: i, quickAnchor: a = !1 }) {
157
- return /* @__PURE__ */ m("div", {
162
+ function O({ start: e, end: t, hourHeight: n, label: r, hueStyle: i, quickAnchor: a = !1 }) {
163
+ return /* @__PURE__ */ h("div", {
158
164
  "aria-hidden": "true",
159
165
  "data-quick-ghost": a || void 0,
160
- className: y("pointer-events-none absolute inset-x-0.5 z-[9] overflow-hidden rounded-md border border-dashed px-1.5 py-0.5 text-[11px] font-semibold text-text-primary", i ? "border-[var(--cal-hue)] bg-[color-mix(in_oklab,var(--cal-hue)_22%,var(--color-bg-surface))]" : "border-action-primary-bg bg-accent-soft/70"),
166
+ className: b("pointer-events-none absolute inset-x-0.5 z-[9] overflow-hidden rounded-md border border-dashed px-1.5 py-0.5 text-[11px] font-semibold text-text-primary", i ? "border-[var(--cal-hue)] bg-[color-mix(in_oklab,var(--cal-hue)_22%,var(--color-bg-surface))]" : "border-action-primary-bg bg-accent-soft/70"),
161
167
  style: {
162
168
  ...i,
163
- top: l(e, n),
164
- height: Math.max(18, l(t - e, n) - 2)
169
+ top: u(e, n),
170
+ height: Math.max(18, u(t - e, n) - 2)
165
171
  },
166
172
  children: r
167
173
  });
168
174
  }
169
- function O() {
175
+ function k() {
170
176
  let e = a(), { tr: t, compact: n } = e, r = e.days.includes(e.today) ? e.today : e.days[0] ?? e.today;
171
- return /* @__PURE__ */ m("div", {
177
+ return /* @__PURE__ */ h("div", {
172
178
  className: "pointer-events-none absolute inset-0 z-30 grid place-items-center p-4",
173
- children: /* @__PURE__ */ m("div", {
179
+ children: /* @__PURE__ */ h("div", {
174
180
  className: "pointer-events-auto w-full max-w-sm rounded-card border border-border-default bg-bg-elevated shadow-elevation-3",
175
- children: /* @__PURE__ */ m(_, {
181
+ children: /* @__PURE__ */ h(v, {
176
182
  compact: !0,
177
183
  size: "panel",
178
184
  kind: "first-use",
179
185
  illustration: "calendar",
180
186
  title: t("calendar.v2.emptyDays", "Nothing on these days"),
181
187
  description: n ? t("calendar.v2.emptyDaysPhone", "Add an event, or bring in a team, holiday or other calendar.") : t("calendar.v2.emptyDaysDesktop", "Click and drag on the grid to add an event, or bring in a team, holiday or other calendar."),
182
- action: /* @__PURE__ */ h(g, {
188
+ action: /* @__PURE__ */ g(_, {
183
189
  type: "button",
184
190
  onClick: () => e.openEventDialog({
185
191
  date: r,
@@ -187,18 +193,18 @@ function O() {
187
193
  end: (e.workingHoursOn(r)?.start ?? 540) + e.prefs.defaultDuration,
188
194
  allDay: !1
189
195
  }),
190
- children: [/* @__PURE__ */ m(f, { "aria-hidden": "true" }), t("calendar.v2.newEvent", "New event")]
196
+ children: [/* @__PURE__ */ h(p, { "aria-hidden": "true" }), t("calendar.v2.newEvent", "New event")]
191
197
  }),
192
- secondaryAction: /* @__PURE__ */ h(g, {
198
+ secondaryAction: /* @__PURE__ */ g(_, {
193
199
  type: "button",
194
200
  variant: "outline",
195
201
  onClick: () => e.nav.openDialog("share"),
196
- children: [/* @__PURE__ */ m(d, { "aria-hidden": "true" }), t("calendar.v2.addCalendar", "Add a calendar")]
202
+ children: [/* @__PURE__ */ h(f, { "aria-hidden": "true" }), t("calendar.v2.addCalendar", "Add a calendar")]
197
203
  })
198
204
  })
199
205
  })
200
206
  });
201
207
  }
202
- export { E as DayColumn, x as DayHeaderRow, O as GridEmpty, D as GridGhost, C as HourGutter };
208
+ export { D as DayColumn, S as DayHeaderRow, k as GridEmpty, O as GridGhost, w as HourGutter };
203
209
 
204
210
  //# sourceMappingURL=GridParts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridParts.js","names":["_Fragment","HOURS","hour","DayHeaderRow","page","useCalendarPage","offsetLabel","formatTimeZoneOffset","timeZone","format","zoneLabel","tr","columnsStyle","nav","cn","FOCUS_RING","compact","days","DayHeader","day","today","weekend","isWeekendDay","tone","isToday","formatDay","HourGutter","showsToday","nowMinute","hourHeight","formatMinutes","minuteOffset","OffHours","hours","workingHoursOn","Fragment","offHours","stretch","NowLine","DayColumn","lineStyle","placed","look","piece","EventBlock","selectedId","ghost","GridGhost","calendarHueStyle","formatMinuteRange","formatDuration","quick","cursorMinute","quickAnchor","hueStyle","start","end","label","GridEmpty","EmptyState","Button","Plus","CalendarPlus"],"sources":["../../../src/v2/grid/GridParts.tsx"],"sourcesContent":["/**\n * The time grid's parts (BOFF-15698 A1): the row of days, the hours down the side with the now\n * time, a day's column (working hours unshaded, its events, the now line, a drag's ghost, the\n * quick create's slot and the keyboard cursor), and the \"nothing on these days\" card.\n */\nimport type { CSSProperties, KeyboardEvent } from 'react';\nimport { CalendarPlus, Plus } from 'lucide-react';\nimport { Button, EmptyState, formatTimeZoneOffset, type DateValue } from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { calendarHueStyle } from '../colors';\nimport { formatDay, formatDuration, formatMinuteRange, formatMinutes } from '../format';\nimport { useCalendarPage, type QuickDraft } from '../page/CalendarPageContext';\nimport { FOCUS_RING } from '../styles';\nimport { isWeekendDay } from '../time/calendarTime';\nimport type { CalendarEventV2, PlacedSegment } from '../types';\nimport { EventBlock } from './EventBlock';\nimport { CURSOR_STEP, minuteOffset } from './geometry';\nimport type { DragGhost } from './useGridDrag';\nimport { offHours } from './workingHours';\n\nconst HOURS = Array.from({ length: 24 }, (_, hour) => hour);\n\n/** The time zone (it opens Calendar settings) and the shown days (each opens its Day view). */\nexport function DayHeaderRow({ columnsStyle }: { columnsStyle: CSSProperties }) {\n const page = useCalendarPage();\n const { tr, format, timeZone, compact, days, today, nav } = page;\n const offsetLabel = formatTimeZoneOffset(timeZone, page.now, format.locale);\n const zoneLabel = tr('calendar.v2.timeZoneButton', 'Time zone: {{zone}}', { zone: timeZone });\n return (\n <div className=\"grid border-b border-border-subtle\" style={columnsStyle}>\n <div className=\"flex items-end justify-end pe-1 pb-1.5\">\n <button\n type=\"button\"\n onClick={() => nav.openDialog('settings')}\n title={zoneLabel}\n aria-label={zoneLabel}\n className={cn(\n 'rounded px-[3px] py-0.5 text-[10px] whitespace-nowrap tabular-nums text-text-muted hover:bg-bg-sunken hover:text-text-primary',\n FOCUS_RING\n )}\n >\n {compact ? offsetLabel.replace(/^[^+−-]*/, '') : offsetLabel}\n </button>\n </div>\n {days.map((day) => (\n <DayHeader key={day} day={day} isToday={day === today} />\n ))}\n </div>\n );\n}\n\nfunction DayHeader({ day, isToday }: { day: DateValue; isToday: boolean }) {\n const { tr, format, compact, nav } = useCalendarPage();\n const weekend = isWeekendDay(day);\n const tone = isToday ? 'today' : weekend ? 'weekend' : 'day';\n return (\n <button\n type=\"button\"\n onClick={() => nav.goTo({ view: 'day', date: day })}\n aria-current={isToday ? 'date' : undefined}\n aria-label={tr('calendar.v2.openDay', '{{day}}. Open the day', {\n day: formatDay(day, format, 'full'),\n })}\n className={cn(\n 'flex min-w-0 items-center justify-center gap-1.5 border-s border-border-subtle px-0.5 py-[7px] hover:bg-bg-sunken',\n compact && 'flex-col gap-px py-[5px]',\n FOCUS_RING\n )}\n >\n <span\n className={cn(\n 'text-[11px] font-semibold uppercase tracking-[0.06em]',\n tone === 'today' && 'text-action-primary-bg',\n tone === 'weekend' && 'text-text-muted',\n tone === 'day' && 'text-text-secondary'\n )}\n >\n {formatDay(day, format, 'weekday')}\n </span>\n <span\n className={cn(\n 'grid h-[30px] min-w-[30px] place-items-center rounded-full px-1 text-lg font-semibold tabular-nums',\n compact && 'h-7 min-w-7 text-base',\n tone === 'today' && 'bg-action-primary-bg text-action-primary-text',\n tone === 'weekend' && 'text-text-muted',\n tone === 'day' && 'text-text-primary'\n )}\n >\n {formatDay(day, format, 'dayNumber')}\n </span>\n </button>\n );\n}\n\n/** The hours down the side, and the time now beside the now line (when today is shown). */\nexport function HourGutter({ hourHeight }: { hourHeight: number }) {\n const { format, days, today, nowMinute } = useCalendarPage();\n const showsToday = days.includes(today);\n return (\n <div className=\"relative\" aria-hidden=\"true\">\n {HOURS.map((hour) =>\n hour === 0 || (showsToday && Math.abs(hour * 60 - nowMinute) < 13) ? null : (\n <span\n key={hour}\n className=\"absolute end-[7px] -translate-y-1/2 text-[11px] leading-none whitespace-nowrap tabular-nums text-text-muted\"\n style={{ top: hour * hourHeight }}\n >\n {formatMinutes(hour * 60, format)}\n </span>\n )\n )}\n {showsToday ? (\n <span\n className=\"absolute end-[3px] z-[4] -translate-y-1/2 rounded-full bg-action-primary-bg px-[5px] py-[3px] text-[10.5px] leading-none font-bold whitespace-nowrap tabular-nums text-action-primary-text\"\n style={{ top: minuteOffset(nowMinute, hourHeight) }}\n >\n {formatMinutes(nowMinute, format)}\n </span>\n ) : null}\n </div>\n );\n}\n\n/** The hours outside the working day, shaded (a day off is shaded whole). */\nfunction OffHours({ day, hourHeight }: { day: DateValue; hourHeight: number }) {\n const { workingHoursOn } = useCalendarPage();\n const hours = workingHoursOn(day);\n // Not known (free/busy hasn't answered, or failed): no shading rather than a guess.\n if (hours === undefined) return null;\n return (\n <>\n {offHours(hours).map((stretch) => (\n <div\n key={stretch.start}\n className=\"pointer-events-none absolute inset-x-0 bg-bg-sunken/70\"\n style={{\n top: minuteOffset(stretch.start, hourHeight),\n height: minuteOffset(stretch.end - stretch.start, hourHeight),\n }}\n />\n ))}\n </>\n );\n}\n\n/** Now: a line with a dot across today, faint across the other shown days. */\nfunction NowLine({ isToday, hourHeight }: { isToday: boolean; hourHeight: number }) {\n const { nowMinute } = useCalendarPage();\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-x-0',\n isToday\n ? '-start-px z-[5] -mt-px h-0.5 bg-action-primary-bg before:absolute before:-start-[5px] before:-top-1 before:size-2.5 before:rounded-full before:bg-action-primary-bg'\n : 'z-[2] h-px bg-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]'\n )}\n style={{ top: minuteOffset(nowMinute, hourHeight) }}\n />\n );\n}\n\nexport interface DayColumnProps {\n day: DateValue;\n placed: readonly PlacedSegment<CalendarEventV2>[];\n hourHeight: number;\n selectedId: string | null;\n onOpen: (event: CalendarEventV2, element: HTMLElement) => void;\n onKeyDown: (event: KeyboardEvent<HTMLButtonElement>, calendarEvent: CalendarEventV2) => void;\n consumeClick: () => boolean;\n /** A drag's preview in this column. */\n ghost: DragGhost | null;\n /** The quick create's slot in this column. */\n quick: QuickDraft | null;\n /** The keyboard cursor's minute in this column. */\n cursorMinute: number | null;\n}\n\n/** One day of the grid: its working hours, events, the now line and what's being made. */\nexport function DayColumn({\n day,\n placed,\n hourHeight,\n selectedId,\n onOpen,\n onKeyDown,\n consumeClick,\n ghost,\n quick,\n cursorMinute,\n}: DayColumnProps) {\n const page = useCalendarPage();\n const { tr, format, compact, today, days } = page;\n const isToday = day === today;\n const lineStyle: CSSProperties = {\n backgroundImage:\n 'linear-gradient(to bottom, var(--color-border-subtle) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in oklab, var(--color-border-subtle) 45%, transparent) 1px, transparent 1px)',\n backgroundSize: `100% ${hourHeight}px, 100% ${hourHeight}px`,\n backgroundPosition: `0 0, 0 ${hourHeight / 2}px`,\n };\n return (\n <div\n data-grid-day={day}\n role=\"group\"\n aria-label={tr('calendar.v2.dayColumn', '{{day}}: {{count}} events', {\n day: formatDay(day, format, 'full'),\n count: placed.length,\n })}\n className={cn('relative border-s border-border-subtle', isToday && 'bg-accent-soft/30')}\n style={lineStyle}\n >\n <OffHours day={day} hourHeight={hourHeight} />\n {placed.map((piece) => {\n const look = page.lookOf(piece.event);\n return (\n <EventBlock\n key={`${piece.event.id}|${piece.date}`}\n placed={piece}\n hourHeight={hourHeight}\n look={look}\n hue={page.hueOf(piece.event.calendarId)}\n label={page.labelOf(piece.event)}\n format={format}\n selected={selectedId === piece.event.id}\n resizable={look.movable && !compact && !piece.continuesAfter}\n onOpen={onOpen}\n onKeyDown={onKeyDown}\n consumeClick={consumeClick}\n />\n );\n })}\n {days.includes(today) ? <NowLine isToday={isToday} hourHeight={hourHeight} /> : null}\n {ghost ? (\n <GridGhost\n start={ghost.start}\n end={ghost.end}\n hourHeight={hourHeight}\n hueStyle={ghost.event ? calendarHueStyle(page.hueOf(ghost.event.calendarId)) : undefined}\n label={\n ghost.event\n ? `${ghost.event.title} · ${formatMinuteRange(ghost.start, ghost.end, format)}`\n : `${formatMinuteRange(ghost.start, ghost.end, format)} · ${formatDuration(ghost.end - ghost.start, page.durationWords)}`\n }\n />\n ) : null}\n {quick ? (\n <GridGhost\n start={quick.start}\n end={quick.end}\n hourHeight={hourHeight}\n label={formatMinuteRange(quick.start, quick.end, format)}\n quickAnchor\n />\n ) : null}\n {cursorMinute !== null ? (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0.5 z-[8] rounded-md border-2 border-[var(--color-focus-ring)] bg-accent-soft/40 px-1.5 text-[11px] font-semibold text-text-primary\"\n style={{\n top: minuteOffset(cursorMinute, hourHeight),\n height: minuteOffset(CURSOR_STEP, hourHeight) - 2,\n }}\n >\n {formatMinuteRange(cursorMinute, cursorMinute + CURSOR_STEP, format)}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function GridGhost({\n start,\n end,\n hourHeight,\n label,\n hueStyle,\n quickAnchor = false,\n}: {\n start: number;\n end: number;\n hourHeight: number;\n label: string;\n hueStyle?: CSSProperties;\n quickAnchor?: boolean;\n}) {\n return (\n <div\n aria-hidden=\"true\"\n data-quick-ghost={quickAnchor || undefined}\n className={cn(\n 'pointer-events-none absolute inset-x-0.5 z-[9] overflow-hidden rounded-md border border-dashed px-1.5 py-0.5 text-[11px] font-semibold text-text-primary',\n hueStyle\n ? 'border-[var(--cal-hue)] bg-[color-mix(in_oklab,var(--cal-hue)_22%,var(--color-bg-surface))]'\n : 'border-action-primary-bg bg-accent-soft/70'\n )}\n style={{\n ...hueStyle,\n top: minuteOffset(start, hourHeight),\n height: Math.max(18, minuteOffset(end - start, hourHeight) - 2),\n }}\n >\n {label}\n </div>\n );\n}\n\n/** Nothing on the shown days: a card over the grid, which stays usable around it. */\nexport function GridEmpty() {\n const page = useCalendarPage();\n const { tr, compact } = page;\n const day = page.days.includes(page.today) ? page.today : (page.days[0] ?? page.today);\n return (\n <div className=\"pointer-events-none absolute inset-0 z-30 grid place-items-center p-4\">\n <div className=\"pointer-events-auto w-full max-w-sm rounded-card border border-border-default bg-bg-elevated shadow-elevation-3\">\n <EmptyState\n compact\n size=\"panel\"\n kind=\"first-use\"\n illustration=\"calendar\"\n title={tr('calendar.v2.emptyDays', 'Nothing on these days')}\n description={\n compact\n ? tr(\n 'calendar.v2.emptyDaysPhone',\n 'Add an event, or bring in a team, holiday or other calendar.'\n )\n : tr(\n 'calendar.v2.emptyDaysDesktop',\n 'Click and drag on the grid to add an event, or bring in a team, holiday or other calendar.'\n )\n }\n action={\n <Button\n type=\"button\"\n onClick={() =>\n page.openEventDialog({\n date: day,\n start: page.workingHoursOn(day)?.start ?? 9 * 60,\n end: (page.workingHoursOn(day)?.start ?? 9 * 60) + page.prefs.defaultDuration,\n allDay: false,\n })\n }\n >\n <Plus aria-hidden=\"true\" />\n {tr('calendar.v2.newEvent', 'New event')}\n </Button>\n }\n secondaryAction={\n <Button type=\"button\" variant=\"outline\" onClick={() => page.nav.openDialog('share')}>\n <CalendarPlus aria-hidden=\"true\" />\n {tr('calendar.v2.addCalendar', 'Add a calendar')}\n </Button>\n }\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAMC,IAAQ,MAAM,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAASC,CAAI;AAG1D,SAAgBC,EAAa,EAAE,mBAAiD;CAC9E,IAAMC,IAAOC,EAAgB,GACvB,EAAE,OAAI,WAAQ,aAAU,YAAS,SAAM,UAAO,WAAQD,GACtDE,IAAcC,EAAqBC,GAAUJ,EAAK,KAAKK,EAAO,MAAM,GACpEC,IAAYC,EAAG,8BAA8B,uBAAuB,EAAE,MAAMH,EAAS,CAAC;CAC5F,OACE,kBAAC,OAAD;EAAK,WAAU;EAAqC,OAAOI;EAA3D,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAAC,UAAD;IACE,MAAK;IACL,eAAeC,EAAI,WAAW,UAAU;IACxC,OAAOH;IACP,cAAYA;IACZ,WAAWI,EACT,iIACAC,CACF;IAEC,UAAAC,IAAUV,EAAY,QAAQ,YAAY,EAAE,IAAIA;GAC3C,CAAA;EACL,CAAA,GACJW,EAAK,KAAK,MACT,kBAACC,GAAD;GAA0B;GAAK,SAASC,MAAQC;EAAQ,GAAxCD,CAAwC,CACzD,CACE;;AAET;AAEA,SAASD,EAAU,EAAE,QAAK,cAAiD;CACzE,IAAM,EAAE,OAAI,WAAQ,YAAS,WAAQb,EAAgB,GAC/CgB,IAAUC,EAAaH,CAAG,GAC1BI,IAAOC,IAAU,UAAUH,IAAU,YAAY;CACvD,OACE,kBAAC,UAAD;EACE,MAAK;EACL,eAAeR,EAAI,KAAK;GAAE,MAAM;GAAO,MAAMM;EAAI,CAAC;EAClD,gBAAcK,IAAU,SAAS,K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C,QAAQ,KAAK,IAAI,IAAIE,EAAayB,IAAMD,GAAO1B,CAAU,IAAI,CAAC;EAChE;EAEC,UAAA4B;CACE,CAAA;AAET;AAGA,SAAgBC,IAAY;CAC1B,IAAMtD,IAAOC,EAAgB,GACvB,EAAE,OAAI,eAAYD,GAClBe,IAAMf,EAAK,KAAK,SAASA,EAAK,KAAK,IAAIA,EAAK,QAASA,EAAK,KAAK,MAAMA,EAAK;CAChF,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACuD,GAAD;IACE,SAAA;IACA,MAAK;IACL,MAAK;IACL,cAAa;IACb,OAAOhD,EAAG,yBAAyB,uBAAuB;IAC1D,aACEK,IACIL,EACE,8BACA,8DACF,IACAA,EACE,gCACA,4FACF;IAEN,QACE,kBAACiD,GAAD;KACE,MAAK;KACL,eACExD,EAAK,gBAAgB;MACnB,MAAMe;MACN,OAAOf,EAAK,eAAee,CAAG,CAAC,EAAE,SAAS;MAC1C,MAAMf,EAAK,eAAee,CAAG,CAAC,EAAE,SAAS,OAAUf,EAAK,MAAM;MAC9D,QAAQ;KACV,CAAC;KARL,UAAA,CAWE,kBAACyD,GAAD,EAAM,eAAY,OAAQ,CAAA,GACzBlD,EAAG,wBAAwB,WAAW,CACjC;;IAEV,iBACE,kBAACiD,GAAD;KAAQ,MAAK;KAAS,SAAQ;KAAU,eAAexD,EAAK,IAAI,WAAW,OAAO;KAAlF,UAAA,CACE,kBAAC0D,GAAD,EAAc,eAAY,OAAQ,CAAA,GACjCnD,EAAG,2BAA2B,gBAAgB,CACzC;;GAEX,CAAA;EACE,CAAA;CACF,CAAA;AAET"}
1
+ {"version":3,"file":"GridParts.js","names":["_Fragment","HOURS","hour","DayHeaderRow","page","useCalendarPage","offsetLabel","formatTimeZoneOffset","timeZone","format","zoneLabel","tr","columnsStyle","nav","cn","FOCUS_RING","compact","days","DayHeader","day","today","weekend","isWeekendDay","tone","isToday","formatDay","HourGutter","showsToday","nowMinute","hourHeight","formatMinutes","minuteOffset","OffHours","hours","workingHoursOn","Fragment","offHours","stretch","NowLine","DayColumn","lineStyle","placed","look","piece","EventBlock","selectedId","DayRunPills","ghost","GridGhost","calendarHueStyle","formatMinuteRange","formatDuration","quick","cursorMinute","quickAnchor","hueStyle","start","end","label","GridEmpty","EmptyState","Button","Plus","CalendarPlus"],"sources":["../../../src/v2/grid/GridParts.tsx"],"sourcesContent":["/**\n * The time grid's parts (BOFF-15698 A1): the row of days, the hours down the side with the now\n * time, a day's column (working hours unshaded, its events, its workflow runs (B5), the now\n * line, a drag's ghost, the quick create's slot and the keyboard cursor), and the \"nothing on\n * these days\" card.\n */\nimport type { CSSProperties, KeyboardEvent } from 'react';\nimport { CalendarPlus, Plus } from 'lucide-react';\nimport { Button, EmptyState, formatTimeZoneOffset, type DateValue } from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { calendarHueStyle } from '../colors';\nimport { formatDay, formatDuration, formatMinuteRange, formatMinutes } from '../format';\nimport { useCalendarPage, type QuickDraft } from '../page/CalendarPageContext';\nimport { DayRunPills } from '../runs/RunPills';\nimport { FOCUS_RING } from '../styles';\nimport { isWeekendDay } from '../time/calendarTime';\nimport type { CalendarEventV2, PlacedSegment } from '../types';\nimport { EventBlock } from './EventBlock';\nimport { CURSOR_STEP, minuteOffset } from './geometry';\nimport type { DragGhost } from './useGridDrag';\nimport { offHours } from './workingHours';\n\nconst HOURS = Array.from({ length: 24 }, (_, hour) => hour);\n\n/** The time zone (it opens Calendar settings) and the shown days (each opens its Day view). */\nexport function DayHeaderRow({ columnsStyle }: { columnsStyle: CSSProperties }) {\n const page = useCalendarPage();\n const { tr, format, timeZone, compact, days, today, nav } = page;\n const offsetLabel = formatTimeZoneOffset(timeZone, page.now, format.locale);\n const zoneLabel = tr('calendar.v2.timeZoneButton', 'Time zone: {{zone}}', { zone: timeZone });\n return (\n <div className=\"grid border-b border-border-subtle\" style={columnsStyle}>\n <div className=\"flex items-end justify-end pe-1 pb-1.5\">\n <button\n type=\"button\"\n onClick={() => nav.openDialog('settings')}\n title={zoneLabel}\n aria-label={zoneLabel}\n className={cn(\n 'rounded px-[3px] py-0.5 text-[10px] whitespace-nowrap tabular-nums text-text-muted hover:bg-bg-sunken hover:text-text-primary',\n FOCUS_RING\n )}\n >\n {compact ? offsetLabel.replace(/^[^+−-]*/, '') : offsetLabel}\n </button>\n </div>\n {days.map((day) => (\n <DayHeader key={day} day={day} isToday={day === today} />\n ))}\n </div>\n );\n}\n\nfunction DayHeader({ day, isToday }: { day: DateValue; isToday: boolean }) {\n const { tr, format, compact, nav } = useCalendarPage();\n const weekend = isWeekendDay(day);\n const tone = isToday ? 'today' : weekend ? 'weekend' : 'day';\n return (\n <button\n type=\"button\"\n onClick={() => nav.goTo({ view: 'day', date: day })}\n aria-current={isToday ? 'date' : undefined}\n aria-label={tr('calendar.v2.openDay', '{{day}}. Open the day', {\n day: formatDay(day, format, 'full'),\n })}\n className={cn(\n 'flex min-w-0 items-center justify-center gap-1.5 border-s border-border-subtle px-0.5 py-[7px] hover:bg-bg-sunken',\n compact && 'flex-col gap-px py-[5px]',\n FOCUS_RING\n )}\n >\n <span\n className={cn(\n 'text-[11px] font-semibold uppercase tracking-[0.06em]',\n tone === 'today' && 'text-action-primary-bg',\n tone === 'weekend' && 'text-text-muted',\n tone === 'day' && 'text-text-secondary'\n )}\n >\n {formatDay(day, format, 'weekday')}\n </span>\n <span\n className={cn(\n 'grid h-[30px] min-w-[30px] place-items-center rounded-full px-1 text-lg font-semibold tabular-nums',\n compact && 'h-7 min-w-7 text-base',\n tone === 'today' && 'bg-action-primary-bg text-action-primary-text',\n tone === 'weekend' && 'text-text-muted',\n tone === 'day' && 'text-text-primary'\n )}\n >\n {formatDay(day, format, 'dayNumber')}\n </span>\n </button>\n );\n}\n\n/** The hours down the side, and the time now beside the now line (when today is shown). */\nexport function HourGutter({ hourHeight }: { hourHeight: number }) {\n const { format, days, today, nowMinute } = useCalendarPage();\n const showsToday = days.includes(today);\n return (\n <div className=\"relative\" aria-hidden=\"true\">\n {HOURS.map((hour) =>\n hour === 0 || (showsToday && Math.abs(hour * 60 - nowMinute) < 13) ? null : (\n <span\n key={hour}\n className=\"absolute end-[7px] -translate-y-1/2 text-[11px] leading-none whitespace-nowrap tabular-nums text-text-muted\"\n style={{ top: hour * hourHeight }}\n >\n {formatMinutes(hour * 60, format)}\n </span>\n )\n )}\n {showsToday ? (\n <span\n className=\"absolute end-[3px] z-[4] -translate-y-1/2 rounded-full bg-action-primary-bg px-[5px] py-[3px] text-[10.5px] leading-none font-bold whitespace-nowrap tabular-nums text-action-primary-text\"\n style={{ top: minuteOffset(nowMinute, hourHeight) }}\n >\n {formatMinutes(nowMinute, format)}\n </span>\n ) : null}\n </div>\n );\n}\n\n/** The hours outside the working day, shaded (a day off is shaded whole). */\nfunction OffHours({ day, hourHeight }: { day: DateValue; hourHeight: number }) {\n const { workingHoursOn } = useCalendarPage();\n const hours = workingHoursOn(day);\n // Not known (free/busy hasn't answered, or failed): no shading rather than a guess.\n if (hours === undefined) return null;\n return (\n <>\n {offHours(hours).map((stretch) => (\n <div\n key={stretch.start}\n className=\"pointer-events-none absolute inset-x-0 bg-bg-sunken/70\"\n style={{\n top: minuteOffset(stretch.start, hourHeight),\n height: minuteOffset(stretch.end - stretch.start, hourHeight),\n }}\n />\n ))}\n </>\n );\n}\n\n/** Now: a line with a dot across today, faint across the other shown days. */\nfunction NowLine({ isToday, hourHeight }: { isToday: boolean; hourHeight: number }) {\n const { nowMinute } = useCalendarPage();\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-x-0',\n isToday\n ? '-start-px z-[5] -mt-px h-0.5 bg-action-primary-bg before:absolute before:-start-[5px] before:-top-1 before:size-2.5 before:rounded-full before:bg-action-primary-bg'\n : 'z-[2] h-px bg-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)]'\n )}\n style={{ top: minuteOffset(nowMinute, hourHeight) }}\n />\n );\n}\n\nexport interface DayColumnProps {\n day: DateValue;\n placed: readonly PlacedSegment<CalendarEventV2>[];\n hourHeight: number;\n selectedId: string | null;\n onOpen: (event: CalendarEventV2, element: HTMLElement) => void;\n onKeyDown: (event: KeyboardEvent<HTMLButtonElement>, calendarEvent: CalendarEventV2) => void;\n consumeClick: () => boolean;\n /** A drag's preview in this column. */\n ghost: DragGhost | null;\n /** The quick create's slot in this column. */\n quick: QuickDraft | null;\n /** The keyboard cursor's minute in this column. */\n cursorMinute: number | null;\n}\n\n/** One day of the grid: its working hours, events, the now line and what's being made. */\nexport function DayColumn({\n day,\n placed,\n hourHeight,\n selectedId,\n onOpen,\n onKeyDown,\n consumeClick,\n ghost,\n quick,\n cursorMinute,\n}: DayColumnProps) {\n const page = useCalendarPage();\n const { tr, format, compact, today, days } = page;\n const isToday = day === today;\n const lineStyle: CSSProperties = {\n backgroundImage:\n 'linear-gradient(to bottom, var(--color-border-subtle) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in oklab, var(--color-border-subtle) 45%, transparent) 1px, transparent 1px)',\n backgroundSize: `100% ${hourHeight}px, 100% ${hourHeight}px`,\n backgroundPosition: `0 0, 0 ${hourHeight / 2}px`,\n };\n return (\n <div\n data-grid-day={day}\n role=\"group\"\n aria-label={tr('calendar.v2.dayColumn', '{{day}}: {{count}} events', {\n day: formatDay(day, format, 'full'),\n count: placed.length,\n })}\n className={cn('relative border-s border-border-subtle', isToday && 'bg-accent-soft/30')}\n style={lineStyle}\n >\n <OffHours day={day} hourHeight={hourHeight} />\n {placed.map((piece) => {\n const look = page.lookOf(piece.event);\n return (\n <EventBlock\n key={`${piece.event.id}|${piece.date}`}\n placed={piece}\n hourHeight={hourHeight}\n look={look}\n hue={page.hueOf(piece.event.calendarId)}\n label={page.labelOf(piece.event)}\n format={format}\n selected={selectedId === piece.event.id}\n resizable={look.movable && !compact && !piece.continuesAfter}\n onOpen={onOpen}\n onKeyDown={onKeyDown}\n consumeClick={consumeClick}\n />\n );\n })}\n <DayRunPills day={day} hourHeight={hourHeight} placed={placed} />\n {days.includes(today) ? <NowLine isToday={isToday} hourHeight={hourHeight} /> : null}\n {ghost ? (\n <GridGhost\n start={ghost.start}\n end={ghost.end}\n hourHeight={hourHeight}\n hueStyle={ghost.event ? calendarHueStyle(page.hueOf(ghost.event.calendarId)) : undefined}\n label={\n ghost.event\n ? `${ghost.event.title} · ${formatMinuteRange(ghost.start, ghost.end, format)}`\n : `${formatMinuteRange(ghost.start, ghost.end, format)} · ${formatDuration(ghost.end - ghost.start, page.durationWords)}`\n }\n />\n ) : null}\n {quick ? (\n <GridGhost\n start={quick.start}\n end={quick.end}\n hourHeight={hourHeight}\n label={formatMinuteRange(quick.start, quick.end, format)}\n quickAnchor\n />\n ) : null}\n {cursorMinute !== null ? (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0.5 z-[8] rounded-md border-2 border-[var(--color-focus-ring)] bg-accent-soft/40 px-1.5 text-[11px] font-semibold text-text-primary\"\n style={{\n top: minuteOffset(cursorMinute, hourHeight),\n height: minuteOffset(CURSOR_STEP, hourHeight) - 2,\n }}\n >\n {formatMinuteRange(cursorMinute, cursorMinute + CURSOR_STEP, format)}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function GridGhost({\n start,\n end,\n hourHeight,\n label,\n hueStyle,\n quickAnchor = false,\n}: {\n start: number;\n end: number;\n hourHeight: number;\n label: string;\n hueStyle?: CSSProperties;\n quickAnchor?: boolean;\n}) {\n return (\n <div\n aria-hidden=\"true\"\n data-quick-ghost={quickAnchor || undefined}\n className={cn(\n 'pointer-events-none absolute inset-x-0.5 z-[9] overflow-hidden rounded-md border border-dashed px-1.5 py-0.5 text-[11px] font-semibold text-text-primary',\n hueStyle\n ? 'border-[var(--cal-hue)] bg-[color-mix(in_oklab,var(--cal-hue)_22%,var(--color-bg-surface))]'\n : 'border-action-primary-bg bg-accent-soft/70'\n )}\n style={{\n ...hueStyle,\n top: minuteOffset(start, hourHeight),\n height: Math.max(18, minuteOffset(end - start, hourHeight) - 2),\n }}\n >\n {label}\n </div>\n );\n}\n\n/** Nothing on the shown days: a card over the grid, which stays usable around it. */\nexport function GridEmpty() {\n const page = useCalendarPage();\n const { tr, compact } = page;\n const day = page.days.includes(page.today) ? page.today : (page.days[0] ?? page.today);\n return (\n <div className=\"pointer-events-none absolute inset-0 z-30 grid place-items-center p-4\">\n <div className=\"pointer-events-auto w-full max-w-sm rounded-card border border-border-default bg-bg-elevated shadow-elevation-3\">\n <EmptyState\n compact\n size=\"panel\"\n kind=\"first-use\"\n illustration=\"calendar\"\n title={tr('calendar.v2.emptyDays', 'Nothing on these days')}\n description={\n compact\n ? tr(\n 'calendar.v2.emptyDaysPhone',\n 'Add an event, or bring in a team, holiday or other calendar.'\n )\n : tr(\n 'calendar.v2.emptyDaysDesktop',\n 'Click and drag on the grid to add an event, or bring in a team, holiday or other calendar.'\n )\n }\n action={\n <Button\n type=\"button\"\n onClick={() =>\n page.openEventDialog({\n date: day,\n start: page.workingHoursOn(day)?.start ?? 9 * 60,\n end: (page.workingHoursOn(day)?.start ?? 9 * 60) + page.prefs.defaultDuration,\n allDay: false,\n })\n }\n >\n <Plus aria-hidden=\"true\" />\n {tr('calendar.v2.newEvent', 'New event')}\n </Button>\n }\n secondaryAction={\n <Button type=\"button\" variant=\"outline\" onClick={() => page.nav.openDialog('share')}>\n <CalendarPlus aria-hidden=\"true\" />\n {tr('calendar.v2.addCalendar', 'Add a calendar')}\n </Button>\n }\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAMC,IAAQ,MAAM,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAASC,CAAI;AAG1D,SAAgBC,EAAa,EAAE,mBAAiD;CAC9E,IAAMC,IAAOC,EAAgB,GACvB,EAAE,OAAI,WAAQ,aAAU,YAAS,SAAM,UAAO,WAAQD,GACtDE,IAAcC,EAAqBC,GAAUJ,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