@delightui/components 0.1.159 → 0.1.160

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.
@@ -1,4 +1,5 @@
1
1
  import { DateInputProps } from './DateInput.types';
2
+ import { Instance } from 'flatpickr/dist/types/instance';
2
3
  declare const usePresenter: (props: DateInputProps) => {
3
4
  invalid: boolean | undefined;
4
5
  onInputBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
@@ -10,5 +11,7 @@ declare const usePresenter: (props: DateInputProps) => {
10
11
  value: import("../DatePickerBase").DatePickerValue | undefined;
11
12
  isTimePickerOnly: boolean | undefined;
12
13
  handleInputReadOnlyState: (value: boolean) => void;
14
+ handleReady: (dates: Date[], dateStr: string, calendarInstance: Instance) => void;
15
+ handleCalendarIconClick: () => void;
13
16
  };
14
17
  export default usePresenter;
@@ -6,37 +6,32 @@ declare const usePresenter: (props: DatePickerBaseProps) => {
6
6
  datePickerRef: import("react").RefObject<DatePicker>;
7
7
  disabled: boolean | undefined;
8
8
  required: boolean | undefined;
9
- mode: "range" | "single";
10
- enableTime: boolean | undefined;
11
- noCalendar: boolean | undefined;
12
- isTimePickerOnly: boolean | undefined;
13
- customPlugin: import("flatpickr/dist/types/options").Plugin[];
14
- handleKeyDown: (_selectedDates: Date[], _dateStr: string, instance: Instance, event: KeyboardEvent) => void;
15
9
  onDateChange: (dates: Date[]) => void;
16
10
  onCloseDatePicker: import("flatpickr/dist/types/options").Hook;
17
11
  onOpenDatePicker: import("flatpickr/dist/types/options").Hook;
18
- calendarVariantProps: {
19
- 'component-variant': string;
20
- };
21
- dayVariantProps: {
22
- 'component-variant': string;
23
- };
24
- isInDialog: boolean;
25
- otherProps: {
12
+ handleDayCreate: (_: Date[], __: string, ___: Instance, dayElem: HTMLElement) => void;
13
+ handleCalendarReady: (dates: Date[], dateStr: string, calendarInstance: Instance) => void;
14
+ flatpickrOptions: {
26
15
  initialValue?: import("./DatePickerBase.types").DatePickerValue | undefined;
27
16
  checked?: boolean;
28
17
  invalid?: boolean;
29
18
  id?: string;
30
- className?: string;
31
19
  minDate?: string | Date;
32
20
  maxDate?: string | Date;
33
21
  defaultDate?: string | Date;
34
22
  dateFormat?: string;
35
- inline?: boolean;
23
+ inline: boolean;
36
24
  position?: "auto" | "above" | "below" | "auto left" | "auto center" | "auto right" | "above left" | "above center" | "above right" | "below left" | "below center" | "below right";
37
25
  parseDate?: (date: string, format?: string) => Date;
38
- allowInput?: boolean;
39
- renderInput?: ((props: Omit<import("react-flatpickr").DateTimePickerProps, "options" | "render">, ref: (node: HTMLInputElement | null) => void) => React.ReactElement) | undefined;
26
+ allowInput: boolean;
27
+ mode: "range" | "single";
28
+ enableTime: boolean | undefined;
29
+ noCalendar: boolean | undefined;
30
+ altInput: boolean | undefined;
31
+ altInputClass: string;
32
+ plugins: import("flatpickr/dist/types/options").Plugin[];
33
+ onKeyDown: (_selectedDates: Date[], _dateStr: string, instance: Instance, event: KeyboardEvent) => void;
34
+ static: boolean;
40
35
  };
41
36
  };
42
37
  export default usePresenter;
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from 'flatpickr/dist/types/options';
2
2
  import FlatPickr, { DateTimePickerProps } from 'react-flatpickr';
3
3
  import { ControlledFormComponentProps } from '../../FormField/FormField.types';
4
+ import { Instance } from 'flatpickr/dist/types/instance';
4
5
  type DatePickerPosition = 'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right';
5
6
  export type DatePickerValue = string | Date | (string | Date)[];
6
7
  export type DatePickerBaseProps = ControlledFormComponentProps<DatePickerValue> & {
@@ -41,13 +42,20 @@ export type DatePickerBaseProps = ControlledFormComponentProps<DatePickerValue>
41
42
  * @param dates - Array of selected dates.
42
43
  * @param dateStr - String representation of the selected date(s). Will match the date format.
43
44
  */
44
- onOpen?: (dates: Date[], dateStr: string) => void;
45
+ onOpen?: (dates: Date[], dateStr: string, calendarInstance: Instance) => void;
45
46
  /**
46
47
  * Callback function when the date picker is closed.
47
48
  * @param dates - Array of selected dates.
48
49
  * @param dateStr - String representation of the selected date(s). Will match the date format.
49
50
  */
50
- onClose?: (dates: Date[], dateStr: string) => void;
51
+ onClose?: (dates: Date[], dateStr: string, calendarInstance: Instance) => void;
52
+ /**
53
+ * Callback function when the calendar is ready and mounted.
54
+ * @param dates - Array of selected dates.
55
+ * @param dateStr - String representation of the selected date(s). Will match the date format.
56
+ * @param calendarInstance - The Flatpickr instance.
57
+ */
58
+ onReady?: (dates: Date[], dateStr: string, calendarInstance: Instance) => void;
51
59
  /**
52
60
  * render date picker inline
53
61
  */
@@ -0,0 +1,19 @@
1
+ import type { Instance } from 'flatpickr/dist/types/instance';
2
+ /**
3
+ * Applies variant props (theme attributes) to a DOM element
4
+ */
5
+ export declare function applyVariantProps(element: HTMLElement, variantProps: Record<string, string>): void;
6
+ /**
7
+ * Sets up a MutationObserver to sync the 'active' attribute based on the 'selected' class.
8
+ * Returns a cleanup function to disconnect the observer.
9
+ */
10
+ export declare function setupActiveSyncObserver(dayElem: HTMLElement): () => void;
11
+ /**
12
+ * Applies external CSS classes to the calendar container
13
+ */
14
+ export declare function applyExternalClasses(container: HTMLElement, className?: string): void;
15
+ /**
16
+ * Sets up dialog-specific behavior: ensures single-click opens the calendar
17
+ * Returns a cleanup function to remove event listeners.
18
+ */
19
+ export declare function setupDialogBehavior(calendarInstance: Instance): () => void;
@@ -2062,6 +2062,12 @@ ul.ButtonGroup-module_buttonGroup__s1X98[component-variant=button-group-vertical
2062
2062
  --input-placeholder-line-height: var(--date-input-placeholder-line-height);
2063
2063
  --input-placeholder-color: var(--date-input-placeholder-color);
2064
2064
  }
2065
+ .DateInput-module_dateInput__hYA3X svg {
2066
+ pointer-events: none;
2067
+ }
2068
+ .DateInput-module_clickableWrapper__1zMm4 {
2069
+ cursor: pointer;
2070
+ }
2065
2071
  .flatpickr-calendar {
2066
2072
  background: transparent;
2067
2073
  opacity: 0;