@redvars/peacock 4.3.4 → 4.5.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 (242) hide show
  1. package/dist/{BaseField-DPyW5Zm5.js → BaseField-BbOj212R.js} +3 -3
  2. package/dist/{BaseField-DPyW5Zm5.js.map → BaseField-BbOj212R.js.map} +1 -1
  3. package/dist/{BaseInput-FhjvfMjF.js → BaseInput-Cv03GZLu.js} +2 -2
  4. package/dist/{BaseInput-FhjvfMjF.js.map → BaseInput-Cv03GZLu.js.map} +1 -1
  5. package/dist/ai-badge.js +2 -2
  6. package/dist/ai-summary.js +2 -2
  7. package/dist/alert.js +2 -2
  8. package/dist/anchor-nav.js +2 -2
  9. package/dist/app-shell.js +2 -2
  10. package/dist/assistant-panel.js +2 -2
  11. package/dist/assistant-step.js +2 -2
  12. package/dist/assistant-steps.js +2 -2
  13. package/dist/avatar-group.js +2 -2
  14. package/dist/banner.js +2 -2
  15. package/dist/{base-progress-D8-x6XS4.js → base-progress-CqsyiVOV.js} +2 -2
  16. package/dist/{base-progress-D8-x6XS4.js.map → base-progress-CqsyiVOV.js.map} +1 -1
  17. package/dist/bottom-sheet.js +2 -2
  18. package/dist/breadcrumb.js +2 -2
  19. package/dist/calendar-column-view.js +648 -30
  20. package/dist/calendar-column-view.js.map +1 -1
  21. package/dist/calendar-drag-IXMPZrTN.js +344 -0
  22. package/dist/calendar-drag-IXMPZrTN.js.map +1 -0
  23. package/dist/{calendar-event-_OYdAT3c.js → calendar-event-BQChlMXy.js} +15 -4
  24. package/dist/calendar-event-BQChlMXy.js.map +1 -0
  25. package/dist/calendar-header-DVrfThwr.js +59 -0
  26. package/dist/calendar-header-DVrfThwr.js.map +1 -0
  27. package/dist/calendar-month-view.js +311 -21
  28. package/dist/calendar-month-view.js.map +1 -1
  29. package/dist/calendar-timeline.js +1877 -0
  30. package/dist/calendar-timeline.js.map +1 -0
  31. package/dist/calendar.js +224 -62
  32. package/dist/calendar.js.map +1 -1
  33. package/dist/{canvas-base-CjxNdEsR.js → canvas-base-BjiU3Ecl.js} +2 -2
  34. package/dist/{canvas-base-CjxNdEsR.js.map → canvas-base-BjiU3Ecl.js.map} +1 -1
  35. package/dist/carousel.js +2 -2
  36. package/dist/{cartesian-chart-D30aTNVm.js → cartesian-chart-iE3cmeGF.js} +2 -2
  37. package/dist/{cartesian-chart-D30aTNVm.js.map → cartesian-chart-iE3cmeGF.js.map} +1 -1
  38. package/dist/{cb-group-base-BhWC78b0.js → cb-group-base-CWctDJvy.js} +2 -2
  39. package/dist/{cb-group-base-BhWC78b0.js.map → cb-group-base-CWctDJvy.js.map} +1 -1
  40. package/dist/cb-group.js +3 -3
  41. package/dist/cb-rule.js +3 -3
  42. package/dist/chart-area.js +4 -4
  43. package/dist/chart-bar.js +4 -4
  44. package/dist/{chart-base-D2kPte5J.js → chart-base-CDyVDmz7.js} +2 -2
  45. package/dist/{chart-base-D2kPte5J.js.map → chart-base-CDyVDmz7.js.map} +1 -1
  46. package/dist/chart-doughnut.js +3 -3
  47. package/dist/chart-line.js +4 -4
  48. package/dist/chart-pie.js +3 -3
  49. package/dist/chat-event.js +2 -2
  50. package/dist/chat-message.js +2 -2
  51. package/dist/chat-thread.js +2 -2
  52. package/dist/checkbox-group.js +3 -3
  53. package/dist/checkbox.js +3 -3
  54. package/dist/chip-set.js +2 -2
  55. package/dist/chip.js +2 -2
  56. package/dist/circular-progress.js +3 -3
  57. package/dist/citation.js +2 -2
  58. package/dist/code-editor.js +3 -3
  59. package/dist/code-highlighter.js +2 -2
  60. package/dist/color-field.js +4 -4
  61. package/dist/color-picker.js +2 -2
  62. package/dist/command-palette.js +2 -2
  63. package/dist/comment-composer.js +4 -4
  64. package/dist/condition-builder.js +3 -3
  65. package/dist/confirm-dialog.js +2 -2
  66. package/dist/copy-button.js +2 -2
  67. package/dist/currency-field.js +4 -4
  68. package/dist/custom-elements-jsdocs.json +52 -129
  69. package/dist/custom-elements.json +3109 -5
  70. package/dist/{date-vFrYT1S9.js → date-cfPx3alz.js} +20 -3
  71. package/dist/date-cfPx3alz.js.map +1 -0
  72. package/dist/date-field.js +8 -8
  73. package/dist/date-picker.js +4 -4
  74. package/dist/date-range-field.js +8 -8
  75. package/dist/datetime-field.js +7 -7
  76. package/dist/dependency-map.js +3 -3
  77. package/dist/description-item.js +2 -2
  78. package/dist/description-list.js +2 -2
  79. package/dist/{diagram-BFGq2POp.js → diagram-D2aM93kf.js} +2 -2
  80. package/dist/{diagram-BFGq2POp.js.map → diagram-D2aM93kf.js.map} +1 -1
  81. package/dist/diagram-controls.js +2 -2
  82. package/dist/diagram-minimap.js +2 -2
  83. package/dist/diagram.js +4 -4
  84. package/dist/diff-viewer.js +2 -2
  85. package/dist/discussion-activity.js +2 -2
  86. package/dist/discussion-comment.js +2 -2
  87. package/dist/discussion.js +4 -4
  88. package/dist/{document-editor-CC7MTHMO.js → document-editor-BS6al7Hq.js} +2 -2
  89. package/dist/{document-editor-CC7MTHMO.js.map → document-editor-BS6al7Hq.js.map} +1 -1
  90. package/dist/document-editor.js +3 -3
  91. package/dist/draft-card.js +2 -2
  92. package/dist/erd.js +3 -3
  93. package/dist/{event-manager-CWAWPOUE.js → event-manager-KGMT2x2Q.js} +10 -8
  94. package/dist/event-manager-KGMT2x2Q.js.map +1 -0
  95. package/dist/file-upload.js +3 -3
  96. package/dist/filter-bar.js +4 -4
  97. package/dist/flow.js +4 -4
  98. package/dist/form.js +2 -2
  99. package/dist/{generative-view-DoT9YwHL.js → generative-view-DsSOPf26.js} +2 -2
  100. package/dist/{generative-view-DoT9YwHL.js.map → generative-view-DsSOPf26.js.map} +1 -1
  101. package/dist/generative-view.js +3 -3
  102. package/dist/html-editor.js +4 -4
  103. package/dist/{i18n-controller-Co6pasNo.js → i18n-controller-BTeChxE0.js} +2 -2
  104. package/dist/{i18n-controller-Co6pasNo.js.map → i18n-controller-BTeChxE0.js.map} +1 -1
  105. package/dist/image.js +2 -2
  106. package/dist/index.js +26 -23
  107. package/dist/index.js.map +1 -1
  108. package/dist/inline-edit.js +2 -2
  109. package/dist/input.js +3 -3
  110. package/dist/json-viewer.js +2 -2
  111. package/dist/kanban.js +2 -2
  112. package/dist/kbd.js +2 -2
  113. package/dist/linear-progress.js +3 -3
  114. package/dist/listbox.js +2 -2
  115. package/dist/loader-full.js +13 -13
  116. package/dist/loader.js +17 -13
  117. package/dist/loader.js.map +1 -1
  118. package/dist/markdown-editor.js +4 -4
  119. package/dist/mention-input.js +4 -4
  120. package/dist/modal.js +2 -2
  121. package/dist/navigation-bar.js +2 -2
  122. package/dist/navigation-drawer.js +2 -2
  123. package/dist/navigation-rail.js +2 -2
  124. package/dist/notification-center.js +2 -2
  125. package/dist/number-field.js +4 -4
  126. package/dist/page-header.js +2 -2
  127. package/dist/pagination.js +2 -2
  128. package/dist/password-field.js +4 -4
  129. package/dist/password-rules.js +2 -2
  130. package/dist/phone-field.js +4 -4
  131. package/dist/{picker-field-BliKNENo.js → picker-field-DmXYPvbF.js} +3 -3
  132. package/dist/{picker-field-BliKNENo.js.map → picker-field-DmXYPvbF.js.map} +1 -1
  133. package/dist/pin-input.js +4 -4
  134. package/dist/presence-indicator.js +2 -2
  135. package/dist/prompt-input.js +4 -4
  136. package/dist/radio.js +3 -3
  137. package/dist/{range-utils-BoKOhxVX.js → range-utils-DZe96GnO.js} +2 -2
  138. package/dist/{range-utils-BoKOhxVX.js.map → range-utils-DZe96GnO.js.map} +1 -1
  139. package/dist/rating.js +3 -3
  140. package/dist/redvars-loader.js +2 -2
  141. package/dist/relative-time.js +2 -2
  142. package/dist/resizable-panels.js +2 -2
  143. package/dist/{rich-text-input-YeqK1or-.js → rich-text-input-BCZ46UF8.js} +3 -3
  144. package/dist/{rich-text-input-YeqK1or-.js.map → rich-text-input-BCZ46UF8.js.map} +1 -1
  145. package/dist/{schema-CuHBNpzo.js → schema-D0PCeIEA.js} +2 -2
  146. package/dist/{schema-CuHBNpzo.js.map → schema-D0PCeIEA.js.map} +1 -1
  147. package/dist/search.js +3 -3
  148. package/dist/select.js +4 -4
  149. package/dist/side-sheet.js +2 -2
  150. package/dist/signature-pad.js +3 -3
  151. package/dist/site-header.js +2 -2
  152. package/dist/slider.js +3 -3
  153. package/dist/snackbar.js +2 -2
  154. package/dist/sparkline.js +2 -2
  155. package/dist/split-button.js +2 -2
  156. package/dist/src/__internal/i18n/strings.d.ts +20 -0
  157. package/dist/src/__internal/utils/date.d.ts +5 -0
  158. package/dist/src/calendar/base-event.d.ts +5 -0
  159. package/dist/src/calendar/calendar-column-view.d.ts +65 -1
  160. package/dist/src/calendar/calendar-drag.d.ts +91 -0
  161. package/dist/src/calendar/calendar-header.d.ts +28 -0
  162. package/dist/src/calendar/calendar-month-view.d.ts +39 -1
  163. package/dist/src/calendar/calendar.d.ts +83 -6
  164. package/dist/src/calendar/index.d.ts +2 -2
  165. package/dist/src/calendar/types.d.ts +32 -0
  166. package/dist/src/calendar/utils.d.ts +53 -0
  167. package/dist/src/calendar-timeline/calendar-timeline.d.ts +287 -0
  168. package/dist/src/calendar-timeline/index.d.ts +3 -0
  169. package/dist/src/calendar-timeline/layout.d.ts +39 -0
  170. package/dist/src/calendar-timeline/types.d.ts +60 -0
  171. package/dist/src/index.d.ts +4 -2
  172. package/dist/src/workflow/workflow-model.d.ts +12 -3
  173. package/dist/stat.js +2 -2
  174. package/dist/status-indicator.js +2 -2
  175. package/dist/step.js +2 -2
  176. package/dist/stepper.js +2 -2
  177. package/dist/{strings-DYwXSSu_.js → strings-DeiQWMd9.js} +22 -1
  178. package/dist/strings-DeiQWMd9.js.map +1 -0
  179. package/dist/svg.js +2 -2
  180. package/dist/switch.js +3 -3
  181. package/dist/table.js +2 -2
  182. package/dist/test/calendar-timeline.test.d.ts +1 -0
  183. package/dist/textarea.js +4 -4
  184. package/dist/time-field.js +7 -7
  185. package/dist/time-picker.js +4 -4
  186. package/dist/timeline-item.js +2 -2
  187. package/dist/timeline.js +2 -2
  188. package/dist/{toggle-base-B-HOnUIy.js → toggle-base-BtjRAZ5z.js} +2 -2
  189. package/dist/{toggle-base-B-HOnUIy.js.map → toggle-base-BtjRAZ5z.js.map} +1 -1
  190. package/dist/tour.js +2 -2
  191. package/dist/transfer-list.js +3 -3
  192. package/dist/tree-chart.js +3 -3
  193. package/dist/tree-item.js +2 -2
  194. package/dist/tree.js +2 -2
  195. package/dist/tsconfig.tsbuildinfo +1 -1
  196. package/dist/typing-indicator.js +2 -2
  197. package/dist/url-field.js +4 -4
  198. package/dist/user-menu.js +2 -2
  199. package/dist/{utils-D92ldd1V.js → utils-DcvLgexs.js} +116 -19
  200. package/dist/utils-DcvLgexs.js.map +1 -0
  201. package/dist/{video-u-Vs7M9g.js → video-DPjOBk6I.js} +2 -2
  202. package/dist/{video-u-Vs7M9g.js.map → video-DPjOBk6I.js.map} +1 -1
  203. package/dist/video.js +3 -3
  204. package/dist/virtual-list.js +2 -2
  205. package/dist/workflow-model-CauduOG2.js.map +1 -1
  206. package/dist/workflow-timeline.js +2 -2
  207. package/dist/workflow.js +16 -5
  208. package/dist/workflow.js.map +1 -1
  209. package/dist/workspace-switcher.js +2 -2
  210. package/package.json +1 -1
  211. package/readme.md +1 -0
  212. package/src/__internal/i18n/strings.ts +29 -0
  213. package/src/__internal/utils/date.ts +19 -0
  214. package/src/calendar/_calendar-header.scss +33 -0
  215. package/src/calendar/base-event.ts +19 -2
  216. package/src/calendar/calendar-column-view.scss +174 -2
  217. package/src/calendar/calendar-column-view.ts +665 -37
  218. package/src/calendar/calendar-drag.ts +403 -0
  219. package/src/calendar/calendar-header.ts +78 -0
  220. package/src/calendar/calendar-month-view.scss +89 -0
  221. package/src/calendar/calendar-month-view.ts +289 -23
  222. package/src/calendar/calendar.scss +2 -27
  223. package/src/calendar/calendar.ts +264 -62
  224. package/src/calendar/event-manager.ts +11 -7
  225. package/src/calendar/index.ts +8 -2
  226. package/src/calendar/types.ts +35 -0
  227. package/src/calendar/utils.ts +160 -20
  228. package/src/calendar-timeline/calendar-timeline.scss +554 -0
  229. package/src/calendar-timeline/calendar-timeline.ts +1528 -0
  230. package/src/calendar-timeline/index.ts +14 -0
  231. package/src/calendar-timeline/layout.ts +129 -0
  232. package/src/calendar-timeline/types.ts +65 -0
  233. package/src/index.ts +18 -0
  234. package/src/loader.ts +4 -0
  235. package/src/workflow/workflow-model.ts +12 -3
  236. package/src/workflow/workflow.scss +5 -0
  237. package/src/workflow/workflow.ts +10 -2
  238. package/dist/calendar-event-_OYdAT3c.js.map +0 -1
  239. package/dist/date-vFrYT1S9.js.map +0 -1
  240. package/dist/event-manager-CWAWPOUE.js.map +0 -1
  241. package/dist/strings-DYwXSSu_.js.map +0 -1
  242. package/dist/utils-D92ldd1V.js.map +0 -1
@@ -3,11 +3,11 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { e as e$1 } from './class-map-NDIkZErE.js';
6
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
6
+ import { I as I18nController } from './i18n-controller-BTeChxE0.js';
7
7
  import { M as MenuTriggerController } from './menu-trigger-controller-CEJq1ugC.js';
8
8
  import './base-Cl6v8-BZ.js';
9
9
  import './directive-ZPhl09Yt.js';
10
- import './strings-DYwXSSu_.js';
10
+ import './strings-DeiQWMd9.js';
11
11
  import './locale-DEsJZCQG.js';
12
12
 
13
13
  var css_248z = i`* {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@redvars/peacock",
3
3
  "description": "The foundation for beautiful user interfaces",
4
4
  "license": "Apache-2.0",
5
- "version": "4.3.4",
5
+ "version": "4.5.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -240,6 +240,7 @@ Every component below ships in 4.0, except the [AI](#ai) group, which arrives in
240
240
  [Time picker](https://peacock.redvars.com/components/time-picker) `wc-time-picker` ·
241
241
  [Date time field](https://peacock.redvars.com/components/datetime-field) `wc-datetime-field` ·
242
242
  [Calendar](https://peacock.redvars.com/components/calendar) `wc-calendar` ·
243
+ [Calendar timeline](https://peacock.redvars.com/components/calendar-timeline) `wc-calendar-timeline` ·
243
244
  [Clock](https://peacock.redvars.com/components/clock) `wc-clock` ·
244
245
  [Relative time](https://peacock.redvars.com/components/relative-time) `wc-relative-time`
245
246
 
@@ -108,6 +108,31 @@ export const defaultStrings = {
108
108
  previousPeriod: 'Previous',
109
109
  nextPeriod: 'Next',
110
110
  invalidView: 'Invalid view',
111
+ /** Title shown for a calendar event without one. */
112
+ calendarUntitled: '(no title)',
113
+ /** Title of the block that marks a new calendar event while it is drawn, until the app adds it. */
114
+ calendarNewEvent: 'New event',
115
+ /** Announced when an event is dragged to a new time, for example "Moved Standup to Nov 4, 2026, 10:00 – 10:30 AM." */
116
+ calendarEventMoved: (title: string, when: string): string =>
117
+ `Moved ${title} to ${when}.`,
118
+ /** Announced when an event's start or end is dragged, for example "Changed Standup to Nov 4, 2026, 9:00 – 10:30 AM." */
119
+ calendarEventResized: (title: string, when: string): string =>
120
+ `Changed ${title} to ${when}.`,
121
+
122
+ // ── Calendar timeline ────────────────────────────────────────────────────
123
+ /** Header of a calendar timeline's resource column, unless `resource-label` names it. */
124
+ calendarTimelineResources: 'Resources',
125
+ /** A calendar timeline without resources. */
126
+ calendarTimelineEmpty: 'No resources',
127
+ /** Resource count of a calendar timeline's group header; `count` is formatted, `n` the number for plural rules. */
128
+ calendarTimelineGroupCount: (count: string, n: number): string =>
129
+ n === 1 ? `${count} resource` : `${count} resources`,
130
+ /** Announced when an event is dragged to another resource's row, for example "Moved Standup to Room B, Nov 4, 2026, 10:00 – 10:30 AM." */
131
+ calendarTimelineEventMoved: (
132
+ title: string,
133
+ resource: string,
134
+ when: string,
135
+ ): string => `Moved ${title} to ${resource}, ${when}.`,
111
136
 
112
137
  // ── Overlays and feedback ────────────────────────────────────────────────
113
138
  closeDialog: 'Close dialog',
@@ -986,6 +1011,7 @@ export const defaultStrings = {
986
1011
  workflowNoSteps: 'No matching steps',
987
1012
  workflowOnError: 'On error',
988
1013
  workflowWaitForAll: 'Wait for all',
1014
+ workflowFirstToFinish: 'First to finish',
989
1015
  workflowEnd: 'End',
990
1016
  workflowMoreActions: 'More actions',
991
1017
  workflowDuplicate: 'Duplicate',
@@ -1003,6 +1029,9 @@ export const defaultStrings = {
1003
1029
  count === 1 ? '1 problem' : `${count} problems`,
1004
1030
  workflowUnreachable: 'This step never runs: the path before it ends.',
1005
1031
  workflowLoopForEach: 'For each',
1032
+ workflowLoopTimes: 'Repeat',
1033
+ /** After a `times` loop's count, for example "3 times". */
1034
+ workflowLoopTimesSuffix: 'times',
1006
1035
  workflowLoopWhile: 'While',
1007
1036
  workflowLoopUntil: 'Repeat until',
1008
1037
  /** Announced after a step is added, for example "Send email added". */
@@ -45,6 +45,25 @@ export function weekStart(locale: string): WeekDay {
45
45
  return 0;
46
46
  }
47
47
 
48
+ /**
49
+ * The weekend days of a locale (0 = Sunday), from `Intl.Locale` week info when available, else
50
+ * Saturday and Sunday.
51
+ */
52
+ export function weekendDays(locale: string): WeekDay[] {
53
+ try {
54
+ const loc = new Intl.Locale(locale) as Intl.Locale & {
55
+ weekInfo?: { weekend: number[] };
56
+ getWeekInfo?: () => { weekend: number[] };
57
+ };
58
+ const info = loc.getWeekInfo?.() ?? loc.weekInfo;
59
+ // Week info numbers days 1 (Monday) to 7 (Sunday).
60
+ if (info?.weekend) return info.weekend.map(day => (day % 7) as WeekDay);
61
+ } catch {
62
+ // Unknown locale tag: fall through.
63
+ }
64
+ return [6, 0];
65
+ }
66
+
48
67
  /** The locale's preferred hour cycle. */
49
68
  export function localeHourCycle(locale: string): HourCycle {
50
69
  const options = new Intl.DateTimeFormat(locale, {
@@ -0,0 +1,33 @@
1
+ // The header `wc-calendar` and `wc-calendar-timeline` share (calendar-header.ts): Today, Previous and
2
+ // Next, the period shown, and the views as segmented buttons. Include it inside the element that
3
+ // holds the header.
4
+
5
+ @mixin styles {
6
+ .calendar-header-classic {
7
+ display: flex;
8
+ align-items: center;
9
+ padding: 0.75rem 1rem;
10
+ gap: 0.5rem;
11
+
12
+ .header-left {
13
+ display: flex;
14
+ gap: 0.5rem;
15
+ align-items: center;
16
+ flex: 1;
17
+
18
+ .title {
19
+ display: flex;
20
+ align-items: center;
21
+ font-weight: 500;
22
+ font-size: 1rem;
23
+ color: var(--calendar-on-surface, var(--color-on-surface));
24
+ padding-inline-start: 0.5rem;
25
+ }
26
+ }
27
+
28
+ .header-right {
29
+ display: flex;
30
+ align-items: center;
31
+ }
32
+ }
33
+ }
@@ -1,12 +1,19 @@
1
- import { startOfDay, endOfDay } from './utils.js';
1
+ import { startOfDay, endOfDay, isAllDayRange, lastDayOf } from './utils.js';
2
+
3
+ let lastId = 0;
2
4
 
3
5
  export class BaseEvent {
6
+ /** Identifies the event within a layout pass. */
4
7
  gid: string;
8
+
5
9
  start: Date;
10
+
6
11
  end: Date;
7
12
 
8
13
  constructor(start: Date, end: Date) {
9
- this.gid = crypto.randomUUID();
14
+ // A counter, not `crypto.randomUUID()`, which only exists in secure contexts.
15
+ lastId += 1;
16
+ this.gid = `calendar-event-${lastId}`;
10
17
  this.start = start;
11
18
  this.end = end;
12
19
  }
@@ -15,6 +22,16 @@ export class BaseEvent {
15
22
  return this.end.valueOf() - this.start.valueOf();
16
23
  }
17
24
 
25
+ /** Whether the event belongs in the all-day row: it lasts a day or more, or midnight to midnight. */
26
+ isAllDay(): boolean {
27
+ return isAllDayRange(this.start, this.end);
28
+ }
29
+
30
+ /** The last day the event covers; `end` is exclusive, so an event ending at midnight ends the day before. */
31
+ lastDay(): Date {
32
+ return lastDayOf(this.start, this.end);
33
+ }
34
+
18
35
  isOverlapping(event: BaseEvent): boolean {
19
36
  let totalLength: number;
20
37
  if (this.start.valueOf() <= event.start.valueOf()) {
@@ -123,12 +123,16 @@
123
123
  &:first-child {
124
124
  border-inline-start: 0;
125
125
  }
126
+
127
+ &.drop-target {
128
+ background: color-mix(in srgb, var(--color-primary) 12%, transparent);
129
+ }
126
130
  }
127
131
  }
128
132
  }
129
133
 
130
134
  .multi-events {
131
- padding: 0 0 0 var(--scale-size);
135
+ padding-inline-start: var(--scale-size);
132
136
 
133
137
  .row {
134
138
  height: 1.8rem;
@@ -323,7 +327,8 @@
323
327
  &:hover {
324
328
  background: var(--calendar-event-bg-color--hover);
325
329
 
326
- .event-title {
330
+ .event-title,
331
+ .resize-handle {
327
332
  color: var(--calendar-event-text-color--hover);
328
333
  }
329
334
  }
@@ -334,3 +339,170 @@
334
339
  }
335
340
  }
336
341
  }
342
+
343
+ /* ── Editing ── */
344
+
345
+ // Empty time takes presses that add events, so it must not start a text selection or a
346
+ // long-press callout.
347
+ .calendar-column-view.addable {
348
+ .drawing-area,
349
+ .multi-day-section {
350
+ user-select: none;
351
+ -webkit-touch-callout: none;
352
+ }
353
+
354
+ // Leave room to draw an all-day event when there are none yet.
355
+ .multi-events {
356
+ min-height: 2rem;
357
+ }
358
+ }
359
+
360
+ .calendar-column-view.dragging {
361
+ user-select: none;
362
+
363
+ // Other events let the pointer through, so they neither flicker on hover nor set the cursor.
364
+ .event {
365
+ pointer-events: none;
366
+ }
367
+ }
368
+
369
+ .calendar-column-view.drag-move {
370
+ cursor: grabbing;
371
+ }
372
+
373
+ .calendar-column-view.drag-resize-y {
374
+ cursor: ns-resize;
375
+ }
376
+
377
+ .calendar-column-view.drag-resize-x {
378
+ cursor: ew-resize;
379
+ }
380
+
381
+ .event {
382
+ &.editable {
383
+ cursor: grab;
384
+ user-select: none;
385
+ -webkit-touch-callout: none;
386
+ }
387
+
388
+ // The event being moved stays at its old time, faded, while a copy shows where it will land.
389
+ &.drag-source {
390
+ opacity: 0.4;
391
+ }
392
+
393
+ // The event being resized, or moved along the all-day row, in place. Its times may wrap in a
394
+ // narrow column.
395
+ &.lifted {
396
+ z-index: 2;
397
+ overflow: hidden;
398
+ box-shadow: var(--elevation-level2);
399
+
400
+ .event-time {
401
+ white-space: normal;
402
+ }
403
+ }
404
+
405
+ // A new event while it is drawn, a moved one where it will land, and the placeholder that
406
+ // marks a new event until the app adds it.
407
+ &.preview {
408
+ z-index: 2;
409
+ overflow: hidden;
410
+ pointer-events: none;
411
+ box-shadow: var(--elevation-level2);
412
+ }
413
+
414
+ &.placeholder {
415
+ box-shadow: var(--elevation-level3);
416
+ }
417
+
418
+ .event-time {
419
+ padding: 0 0.375rem 0.25rem;
420
+ font-size: 0.75rem;
421
+ color: var(--calendar-event-text-color);
422
+ white-space: nowrap;
423
+ overflow: hidden;
424
+ text-overflow: ellipsis;
425
+ // Times start with digits, which take no direction of their own: without this, "9:00 – 10:00
426
+ // AM" reads "AM 10:00 – 9:00" in a right-to-left page.
427
+ unicode-bidi: plaintext;
428
+ }
429
+ }
430
+
431
+ // A grip at each edge an event can be resized by; the line in it shows on hover and focus.
432
+ .resize-handle {
433
+ position: absolute;
434
+ z-index: 1;
435
+ color: var(--calendar-event-text-color);
436
+
437
+ &::after {
438
+ content: '';
439
+ position: absolute;
440
+ margin: auto;
441
+ border-radius: var(--shape-corner-full);
442
+ background: currentColor;
443
+ opacity: 0;
444
+ transition: opacity 150ms ease;
445
+ }
446
+ }
447
+
448
+ .event.editable:hover,
449
+ .event.editable:focus-visible,
450
+ .event.lifted {
451
+ .resize-handle::after {
452
+ opacity: 0.6;
453
+ }
454
+ }
455
+
456
+ // Timed events resize at the top and bottom.
457
+ .events-container .resize-handle {
458
+ inset-inline: 0;
459
+ block-size: 0.375rem;
460
+ cursor: ns-resize;
461
+
462
+ &.start {
463
+ inset-block-start: 0;
464
+ }
465
+
466
+ &.end {
467
+ inset-block-end: 0;
468
+ }
469
+
470
+ &::after {
471
+ inset: 0;
472
+ inline-size: 1rem;
473
+ block-size: 0.125rem;
474
+ }
475
+ }
476
+
477
+ // All-day events resize at their start and end.
478
+ .multi-events .resize-handle {
479
+ inset-block: 0;
480
+ inline-size: 0.375rem;
481
+ cursor: ew-resize;
482
+
483
+ &.start {
484
+ inset-inline-start: 0;
485
+ }
486
+
487
+ &.end {
488
+ inset-inline-end: 0;
489
+ }
490
+
491
+ &::after {
492
+ inset: 0;
493
+ inline-size: 0.125rem;
494
+ block-size: 0.875rem;
495
+ }
496
+ }
497
+
498
+ @media (forced-colors: active) {
499
+ .event.preview,
500
+ .event.lifted {
501
+ outline: 2px solid Highlight;
502
+ }
503
+
504
+ .multi-day-background .column.drop-target {
505
+ outline: 2px solid Highlight;
506
+ outline-offset: -2px;
507
+ }
508
+ }