@super-calendar/core 2.12.0 → 2.13.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.
package/dist/index.d.mts CHANGED
@@ -158,6 +158,22 @@ export interface BusinessHoursBand {
158
158
  start: number;
159
159
  end: number;
160
160
  }
161
+ /** Options for {@link CalendarHandle.scrollToTime}. */
162
+ export interface ScrollToTimeOptions {
163
+ /** Animate the scroll. Default true; off when the OS asks to reduce motion. */
164
+ animated?: boolean;
165
+ }
166
+ /**
167
+ * Imperative methods exposed through a `ref` on `Calendar` and `TimeGrid`.
168
+ */
169
+ export interface CalendarHandle {
170
+ /**
171
+ * Scroll the time grid so `minutes` (from midnight) sits at the top of the
172
+ * hours, at the current zoom. Works with any value, including the one already
173
+ * passed as `scrollOffsetMinutes`. A no-op when no time grid is showing.
174
+ */
175
+ scrollToTime(minutes: number, options?: ScrollToTimeOptions): void;
176
+ }
161
177
  //#endregion
162
178
  //#region src/tokens.d.ts
163
179
  /** The shared colour palette both renderers derive their themes from. */
package/dist/index.d.ts CHANGED
@@ -158,6 +158,22 @@ export interface BusinessHoursBand {
158
158
  start: number;
159
159
  end: number;
160
160
  }
161
+ /** Options for {@link CalendarHandle.scrollToTime}. */
162
+ export interface ScrollToTimeOptions {
163
+ /** Animate the scroll. Default true; off when the OS asks to reduce motion. */
164
+ animated?: boolean;
165
+ }
166
+ /**
167
+ * Imperative methods exposed through a `ref` on `Calendar` and `TimeGrid`.
168
+ */
169
+ export interface CalendarHandle {
170
+ /**
171
+ * Scroll the time grid so `minutes` (from midnight) sits at the top of the
172
+ * hours, at the current zoom. Works with any value, including the one already
173
+ * passed as `scrollOffsetMinutes`. A no-op when no time grid is showing.
174
+ */
175
+ scrollToTime(minutes: number, options?: ScrollToTimeOptions): void;
176
+ }
161
177
  //#endregion
162
178
  //#region src/tokens.d.ts
163
179
  /** The shared colour palette both renderers derive their themes from. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-calendar/core",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Render-agnostic core for super-calendar: date math, selection model, event layout, the month-grid builder, headless hooks, and neutral theme tokens. No renderer.",
5
5
  "keywords": [
6
6
  "calendar",
package/src/types.ts CHANGED
@@ -158,3 +158,21 @@ export interface BusinessHoursBand {
158
158
  start: number;
159
159
  end: number;
160
160
  }
161
+
162
+ /** Options for {@link CalendarHandle.scrollToTime}. */
163
+ export interface ScrollToTimeOptions {
164
+ /** Animate the scroll. Default true; off when the OS asks to reduce motion. */
165
+ animated?: boolean;
166
+ }
167
+
168
+ /**
169
+ * Imperative methods exposed through a `ref` on `Calendar` and `TimeGrid`.
170
+ */
171
+ export interface CalendarHandle {
172
+ /**
173
+ * Scroll the time grid so `minutes` (from midnight) sits at the top of the
174
+ * hours, at the current zoom. Works with any value, including the one already
175
+ * passed as `scrollOffsetMinutes`. A no-op when no time grid is showing.
176
+ */
177
+ scrollToTime(minutes: number, options?: ScrollToTimeOptions): void;
178
+ }