@pantheon-systems/pds-toolkit-react 1.14.0 → 1.15.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.
@@ -5,6 +5,7 @@ import 'react-day-picker/dist/style.css';
5
5
  import './datepicker.css';
6
6
  type PresetType = 'today' | 'current-week' | 'current-month' | 'last-week' | 'last-month';
7
7
  export interface CustomPresetConfig {
8
+ active?: boolean;
8
9
  custom?: () => DateRange;
9
10
  days?: number;
10
11
  label: string;
@@ -68,6 +69,11 @@ export interface DatepickerProps extends DatepickerHTMLProps {
68
69
  * onChange handler
69
70
  */
70
71
  onChange?: (value: DateRange | Date | undefined) => void;
72
+ /**
73
+ * Callback fired once on mount when an active preset is applied.
74
+ * Only fires if no initial value is provided and a preset has active: true.
75
+ */
76
+ onInitialize?: (value: DateRange | Date | undefined) => void;
71
77
  /**
72
78
  * Placeholder text for the trigger button.
73
79
  */
@@ -100,5 +106,5 @@ export interface DatepickerProps extends DatepickerHTMLProps {
100
106
  /**
101
107
  * Datepicker UI component.
102
108
  */
103
- export declare const Datepicker: ({ className, disabled, hasDateRange, id, inputWidth, label, locale, maxDate, minDate, onChange, placeholder, presets, required, showLabel, tooltipText, translationStrings, value, ...props }: DatepickerProps) => import("react/jsx-runtime").JSX.Element;
109
+ export declare const Datepicker: ({ className, disabled, hasDateRange, id, inputWidth, label, locale, maxDate, minDate, onChange, onInitialize, placeholder, presets, required, showLabel, tooltipText, translationStrings, value, ...props }: DatepickerProps) => import("react/jsx-runtime").JSX.Element;
104
110
  export {};