@codecademy/gamut
68.2.268.2.3-alpha.6d52f4.0
dist/DatePicker/utils/quickActions.d.ts+
dist/DatePicker/utils/quickActions.d.tsNew file+25
Index: package/dist/DatePicker/utils/quickActions.d.ts
===================================================================
--- package/dist/DatePicker/utils/quickActions.d.ts
+++ package/dist/DatePicker/utils/quickActions.d.ts
@@ -0,0 +1,25 @@
+import { QuickAction } from '../Calendar/types';
+import { DatePickerTranslations } from './translations';
+export declare const getDefaultSingleQuickActions: (locale: Intl.Locale) => QuickAction[];
+export declare const getDefaultRangeQuickActions: (translations: Required<DatePickerTranslations>) => QuickAction[];
+/**
+ * Computes [start, end] for footer quick actions when `onClick` is omitted.
+ * `date` (local calendar day of `now`) is the anchor — returned as `end` unless the range
+ * is reordered (see below).
+ *
+ * **Rolling** offsets (no month/year boundaries):
+ * - **day**: `num` days from anchor.
+ * - **week**: `num × 7` days.
+ * - **month**: `num × 30` days.
+ * - **year**: `num × 365` days.
+ *
+ * **Range mode (`isRange: true`):** if `start` is after the anchor day, returns
+ * `{ start: anchor, end: computed }` so the interval runs forward. Otherwise
+ * `{ start: computed, end: anchor }` (past through “today”).
+ *
+ * **Single mode:** same return shape; the calendar uses `start` as the selected day.
+ */
+export declare const computeQuickAction: (num: number, timePeriod: QuickAction["timePeriod"], isRange: boolean, now?: Date) => {
+ start: Date;
+ end: Date;
+};