@aic-kits/react 0.34.7 → 0.34.11

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 (37) hide show
  1. package/dist/components/DatePicker/DatePickerCalendar.d.ts +2 -0
  2. package/dist/components/DatePicker/DatePickerGrid.d.ts +2 -0
  3. package/dist/components/DatePicker/DatePickerHeader.d.ts +8 -0
  4. package/dist/components/DatePicker/DatePickerInput.d.ts +3 -0
  5. package/dist/components/DatePicker/DatePickerMonthPicker.d.ts +13 -0
  6. package/dist/components/DatePicker/DatePickerPopup.d.ts +6 -0
  7. package/dist/components/DatePicker/DatePickerRangeInput.d.ts +26 -0
  8. package/dist/components/DatePicker/DatePickerTimezone.d.ts +2 -0
  9. package/dist/components/DatePicker/DatePickerYearPicker.d.ts +11 -0
  10. package/dist/components/DatePicker/StyledDatePicker.d.ts +26 -0
  11. package/dist/components/DatePicker/constants.d.ts +23 -0
  12. package/dist/components/DatePicker/hooks.d.ts +37 -0
  13. package/dist/components/DatePicker/index.d.ts +4 -0
  14. package/dist/components/DatePicker/types.d.ts +325 -0
  15. package/dist/components/DatePicker/utils.d.ts +203 -0
  16. package/dist/components/Input/types.d.ts +8 -0
  17. package/dist/components/Select/SelectDropdown.d.ts +2 -2
  18. package/dist/components/TimePicker/StyledTimePicker.d.ts +15 -0
  19. package/dist/components/TimePicker/TimePickerInput.d.ts +3 -0
  20. package/dist/components/TimePicker/TimePickerPopup.d.ts +2 -0
  21. package/dist/components/TimePicker/TimePickerRangeInput.d.ts +24 -0
  22. package/dist/components/TimePicker/TimePickerWheel.d.ts +2 -0
  23. package/dist/components/TimePicker/TimePickerWheels.d.ts +2 -0
  24. package/dist/components/TimePicker/constants.d.ts +12 -0
  25. package/dist/components/TimePicker/hooks.d.ts +25 -0
  26. package/dist/components/TimePicker/index.d.ts +3 -0
  27. package/dist/components/TimePicker/types.d.ts +185 -0
  28. package/dist/components/TimePicker/utils.d.ts +73 -0
  29. package/dist/components/index.d.ts +2 -0
  30. package/dist/hooks/index.d.ts +1 -0
  31. package/dist/hooks/usePopupPosition.d.ts +15 -0
  32. package/dist/index.cjs +482 -315
  33. package/dist/index.js +10966 -7758
  34. package/dist/theme/components/datepicker.d.ts +85 -0
  35. package/dist/theme/components/index.d.ts +14 -0
  36. package/dist/theme/components/timepicker.d.ts +50 -0
  37. package/package.json +2 -2
@@ -0,0 +1,203 @@
1
+ import { DateConfig, DatePickerValue, WeekStartDay, TimezoneOption, TimeValue } from './types';
2
+ /**
3
+ * Get the first day of the month
4
+ */
5
+ export declare function getFirstDayOfMonth(date: Date): Date;
6
+ /**
7
+ * Get the last day of the month
8
+ */
9
+ export declare function getLastDayOfMonth(date: Date): Date;
10
+ /**
11
+ * Add months to a date
12
+ */
13
+ export declare function addMonths(date: Date, months: number): Date;
14
+ /**
15
+ * Add days to a date
16
+ */
17
+ export declare function addDays(date: Date, days: number): Date;
18
+ /**
19
+ * Check if two dates are the same day
20
+ */
21
+ export declare function isSameDay(date1: Date | null, date2: Date | null): boolean;
22
+ /**
23
+ * Check if two dates are in the same month
24
+ */
25
+ export declare function isSameMonth(date1: Date, date2: Date): boolean;
26
+ /**
27
+ * Check if a date is today
28
+ */
29
+ export declare function isToday(date: Date): boolean;
30
+ /**
31
+ * Check if date is before another date (day comparison)
32
+ */
33
+ export declare function isBefore(date: Date, compareDate: Date): boolean;
34
+ /**
35
+ * Check if date is after another date (day comparison)
36
+ */
37
+ export declare function isAfter(date: Date, compareDate: Date): boolean;
38
+ /**
39
+ * Check if a year is a leap year
40
+ */
41
+ export declare function isLeapYear(year: number): boolean;
42
+ /**
43
+ * Get the number of days in a given month
44
+ * @param month 1-indexed month (1 = January, 12 = December)
45
+ * @param year Full year (e.g., 2024)
46
+ */
47
+ export declare function getDaysInMonth(month: number, year: number): number;
48
+ /**
49
+ * Get the starting date for the calendar grid (may be in previous month)
50
+ */
51
+ export declare function getCalendarGridStartDate(month: Date, weekStartDay: WeekStartDay): Date;
52
+ /**
53
+ * Generate calendar grid dates (6 weeks x 7 days = 42 days)
54
+ */
55
+ export declare function generateCalendarGrid(month: Date, weekStartDay: WeekStartDay): Date[];
56
+ /**
57
+ * Get weekday names starting from the specified day
58
+ */
59
+ export declare function getWeekdayNames(locale: string, weekStartDay: WeekStartDay, format?: 'narrow' | 'short' | 'long'): string[];
60
+ /**
61
+ * Check if a date is disabled based on configuration
62
+ */
63
+ export declare function isDateDisabled(date: Date, config?: DateConfig): boolean;
64
+ /**
65
+ * Check if an entire month is before/after date constraints
66
+ */
67
+ export declare function isMonthDisabled(month: Date, direction: 'prev' | 'next', config?: DateConfig): boolean;
68
+ /**
69
+ * Parse time string (HH:mm) to minutes from midnight
70
+ */
71
+ export declare function parseTimeToMinutes(time: string): number;
72
+ /**
73
+ * Format minutes from midnight to time string
74
+ */
75
+ export declare function formatMinutesToTime(minutes: number, format?: '12h' | '24h'): string;
76
+ /**
77
+ * Format date for display in header (e.g., "December 2024")
78
+ */
79
+ export declare function formatMonthYear(date: Date, locale: string): string;
80
+ /**
81
+ * Format month only (e.g., "December")
82
+ */
83
+ export declare function formatMonth(date: Date, locale: string): string;
84
+ /**
85
+ * Format year only (e.g., "2024")
86
+ */
87
+ export declare function formatYear(date: Date): string;
88
+ /**
89
+ * Get all month names for a locale
90
+ */
91
+ export declare function getMonthNames(locale: string): string[];
92
+ /**
93
+ * Get year range for year picker (12 years centered on current year)
94
+ */
95
+ export declare function getYearRange(year: number): number[];
96
+ /**
97
+ * Add years to a date
98
+ */
99
+ export declare function addYears(date: Date, years: number): Date;
100
+ /**
101
+ * Format date for selected date display (e.g., "Monday, July 22")
102
+ */
103
+ export declare function formatSelectedDate(date: Date | null, locale: string): string;
104
+ /**
105
+ * Format date for input display (e.g., "Dec 25, 2024 at 10:00am")
106
+ */
107
+ export declare function formatDateTimeForInput(date: Date | null, locale: string): string;
108
+ /**
109
+ * Format time value to string
110
+ */
111
+ export declare function formatTimeValue(time: TimeValue | null, format?: '12h' | '24h'): string;
112
+ /**
113
+ * Format date for editable input
114
+ * Always uses DD/MM/YYYY format for consistency with validation
115
+ * Optionally includes time if showTime is true
116
+ */
117
+ export declare function formatDateForInput(date: Date | null, _locale: string, time?: TimeValue | null, showTime?: boolean, timeFormat?: '12h' | '24h'): string;
118
+ /**
119
+ * Parse result from parseInputDateTime
120
+ */
121
+ export interface ParsedDateTime {
122
+ date: Date;
123
+ time: TimeValue | null;
124
+ }
125
+ /**
126
+ * Parse user input string to Date and optional time
127
+ * Supports formats:
128
+ * - DD/MM/YYYY HH:mm (date with time suffix)
129
+ * - DD/MM/YYYY h:mm AM/PM (date with 12h time suffix)
130
+ * - DD/MM/YYYY or MM/DD/YYYY (date only)
131
+ * - YYYY-MM-DD (ISO date only)
132
+ * Returns null if parsing fails
133
+ */
134
+ export declare function parseInputDateTime(input: string, locale: string): ParsedDateTime | null;
135
+ /**
136
+ * Legacy function for backwards compatibility - parses date only
137
+ */
138
+ export declare function parseInputDate(input: string, locale: string): Date | null;
139
+ /**
140
+ * Get placeholder format based on locale and time format
141
+ * @param locale - locale for date format
142
+ * @param includeTime - if true, includes time placeholder
143
+ * @param timeFormat - '12h' or '24h' for time format
144
+ */
145
+ export declare function getDateInputPlaceholder(_locale: string, includeTime?: boolean, timeFormat?: '12h' | '24h'): string;
146
+ /**
147
+ * Get timezone offset string (e.g., "GMT-5")
148
+ */
149
+ export declare function getTimezoneOffset(timezone: string): string;
150
+ export declare function generateTimezoneOptions(): TimezoneOption[];
151
+ /**
152
+ * Convert a date+time from one timezone to another
153
+ * Returns new Date and TimeValue in target timezone
154
+ *
155
+ * Example: 9:00 UTC on Jan 17 → 16:00 UTC+7 on Jan 17
156
+ */
157
+ export declare function convertDateTimeToTimezone(date: Date, time: TimeValue, fromTimezone: string | null, toTimezone: string | null): {
158
+ date: Date;
159
+ time: TimeValue;
160
+ };
161
+ /**
162
+ * Convert a DatePickerValue to a different timezone
163
+ */
164
+ export declare function convertSlotToTimezone(slot: DatePickerValue, toTimezone: string | null): DatePickerValue;
165
+ /**
166
+ * Convert all slots to target timezone
167
+ */
168
+ export declare function convertSlotsToTimezone(slots: DatePickerValue[], toTimezone: string | null): DatePickerValue[];
169
+ /**
170
+ * Get all unique dates from slots array
171
+ */
172
+ export declare function getDatesFromSlots(slots: DatePickerValue[]): Date[];
173
+ /**
174
+ * Get time slots available for a specific date
175
+ */
176
+ export declare function getTimeSlotsForDate(slots: DatePickerValue[], date: Date | null): TimeValue[];
177
+ /**
178
+ * Check if a date has any available slots
179
+ */
180
+ export declare function dateHasSlots(slots: DatePickerValue[], date: Date): boolean;
181
+ /**
182
+ * Get all unique time slots from slots array (when no date is selected)
183
+ * Used to show preview of available times before user selects a date
184
+ */
185
+ export declare function getAllUniqueTimeSlots(slots: DatePickerValue[]): TimeValue[];
186
+ /**
187
+ * Create a DateConfig that disables dates without slots
188
+ */
189
+ export declare function createSlotsDateConfig(slots: DatePickerValue[], existingConfig?: DateConfig): DateConfig;
190
+ /**
191
+ * Convert DatePickerValue to timestamp (milliseconds) for comparison
192
+ * Combines date and time into single comparable number
193
+ */
194
+ export declare function datePickerValueToTimestamp(value: DatePickerValue): number;
195
+ /**
196
+ * Compare two DatePickerValues
197
+ * Returns:
198
+ * -1 if a < b
199
+ * 0 if a === b
200
+ * 1 if a > b
201
+ * null if either value has no date (incomparable)
202
+ */
203
+ export declare function compareDatePickerValues(a: DatePickerValue | undefined, b: DatePickerValue | undefined): -1 | 0 | 1 | null;
@@ -38,6 +38,14 @@ interface BaseInputProps {
38
38
  * Icon to display on the right side of the input
39
39
  */
40
40
  rightIcon?: Icon;
41
+ /**
42
+ * Show clear button when input has value
43
+ */
44
+ clearable?: boolean;
45
+ /**
46
+ * Callback when clear button is clicked
47
+ */
48
+ onClear?: () => void;
41
49
  /**
42
50
  * Border color when focused
43
51
  */
@@ -1,7 +1,7 @@
1
1
  import { SelectSize } from '../../theme/components/select';
2
2
  import { SelectOption } from './types';
3
3
  interface SelectDropdownProps<T extends string | number> {
4
- anchorElement: HTMLElement;
4
+ anchorRef: React.RefObject<HTMLDivElement | null>;
5
5
  isOpen: boolean;
6
6
  options: SelectOption<T>[];
7
7
  onSelect: (option: SelectOption<T>) => void;
@@ -10,5 +10,5 @@ interface SelectDropdownProps<T extends string | number> {
10
10
  size: SelectSize;
11
11
  borderRadius: string;
12
12
  }
13
- export declare function SelectDropdown<T extends string | number>({ anchorElement, isOpen, options, onSelect, selectedValue, onClose, size, borderRadius, }: SelectDropdownProps<T>): import('react').ReactPortal | null;
13
+ export declare function SelectDropdown<T extends string | number>({ anchorRef, isOpen, options, onSelect, selectedValue, onClose, size, borderRadius, }: SelectDropdownProps<T>): import("react/jsx-runtime").JSX.Element | null;
14
14
  export {};
@@ -0,0 +1,15 @@
1
+ import { TimePickerSize } from './types';
2
+ interface StyledWheelItemProps {
3
+ $size: TimePickerSize;
4
+ $isSelected: boolean;
5
+ $offset: number;
6
+ }
7
+ export declare const StyledWheelItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledWheelItemProps>> & string;
8
+ interface StyledRangeInputBoxProps {
9
+ $isFocused: boolean;
10
+ $isDisabled: boolean;
11
+ $error: boolean;
12
+ }
13
+ export declare const StyledRangeInputBox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledRangeInputBoxProps>> & string;
14
+ export declare const StyledRangeInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
15
+ export {};
@@ -0,0 +1,3 @@
1
+ import { InputHandle } from '../Input/types';
2
+ import { TimePickerInputProps } from './types';
3
+ export declare const TimePickerInput: import('react').ForwardRefExoticComponent<TimePickerInputProps & import('react').RefAttributes<InputHandle>>;
@@ -0,0 +1,2 @@
1
+ import { TimePickerPopupProps } from './types';
2
+ export declare const TimePickerPopup: ({ isOpen, anchorRef, onClose, children, size, isFixedPosition, }: TimePickerPopupProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ export interface TimePickerRangeInputProps {
3
+ startValue: string;
4
+ endValue: string;
5
+ onStartChange: (value: string) => void;
6
+ onEndChange: (value: string) => void;
7
+ onStartFocus: () => void;
8
+ onEndFocus: () => void;
9
+ onStartBlur?: () => void;
10
+ onEndBlur?: () => void;
11
+ onStartEnterPress?: () => void;
12
+ onEndEnterPress?: () => void;
13
+ onClear?: () => void;
14
+ hasValue?: boolean;
15
+ disabled?: boolean;
16
+ error?: boolean;
17
+ }
18
+ export interface TimePickerRangeInputHandle {
19
+ focusStart: () => void;
20
+ focusEnd: () => void;
21
+ blurStart: () => void;
22
+ blurEnd: () => void;
23
+ }
24
+ export declare const TimePickerRangeInput: React.ForwardRefExoticComponent<TimePickerRangeInputProps & React.RefAttributes<TimePickerRangeInputHandle>>;
@@ -0,0 +1,2 @@
1
+ import { TimePickerWheelProps } from './types';
2
+ export declare const TimePickerWheel: ({ items, selectedValue, onSelect, size, }: TimePickerWheelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { TimePickerWheelsProps } from './types';
2
+ export declare const TimePickerWheels: ({ value, onChange, format, minuteStep, size, slots, markerValue, markerLabel, }: TimePickerWheelsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { TimeFormat, TimePickerSize } from './types';
2
+ export declare const DEFAULT_SIZE: TimePickerSize;
3
+ export declare const DEFAULT_FORMAT: TimeFormat;
4
+ export declare const DEFAULT_MINUTE_STEP = 1;
5
+ export declare const DEFAULT_PLACEHOLDER = "Select time";
6
+ export declare const DEFAULT_START_LABEL = "Start time";
7
+ export declare const DEFAULT_END_LABEL = "End time";
8
+ export declare const MASK_24H = "HH:mm";
9
+ export declare const MASK_12H = "hh:mm AA";
10
+ export declare const HOURS_24: string[];
11
+ export declare const HOURS_12: string[];
12
+ export declare const PERIODS: string[];
@@ -0,0 +1,25 @@
1
+ import { TimeFormat, TimeValue } from './types';
2
+ interface UseTimePickerStateProps {
3
+ value?: TimeValue | null;
4
+ onChange?: (value: TimeValue | null) => void;
5
+ format: TimeFormat;
6
+ minuteStep?: number;
7
+ slots?: TimeValue[];
8
+ }
9
+ interface UseTimePickerStateReturn {
10
+ isOpen: boolean;
11
+ setIsOpen: (open: boolean) => void;
12
+ inputValue: string;
13
+ setInputValue: (value: string) => void;
14
+ editingValue: TimeValue | null;
15
+ setEditingValue: (value: TimeValue | null) => void;
16
+ handleOpen: () => void;
17
+ handleClose: () => void;
18
+ handleClear: () => void;
19
+ handleInputChange: (inputText: string) => void;
20
+ handleWheelChange: (time: TimeValue) => void;
21
+ handleInputBlur: () => void;
22
+ handleEnterPress: () => void;
23
+ }
24
+ export declare function useTimePickerState({ value, onChange, format, minuteStep, slots, }: UseTimePickerStateProps): UseTimePickerStateReturn;
25
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TimePickerProps, TimePickerHandle } from './types';
2
+ export declare const TimePicker: import('react').ForwardRefExoticComponent<TimePickerProps & import('react').RefAttributes<TimePickerHandle>>;
3
+ export type { TimePickerProps, TimePickerHandle, TimeValue } from './types';
@@ -0,0 +1,185 @@
1
+ import { TimePickerSize, TimeFormat } from '../../theme/components/timepicker';
2
+ import { BoxProps } from '../Box';
3
+ export type { TimePickerSize, TimeFormat };
4
+ /**
5
+ * Represents a time value with hours and minutes
6
+ */
7
+ export interface TimeValue {
8
+ /** Hours (0-23 for 24h format, 1-12 for 12h format internally stored as 0-23) */
9
+ hours: number;
10
+ /** Minutes (0-59) */
11
+ minutes: number;
12
+ }
13
+ /**
14
+ * Props for the main TimePicker component
15
+ */
16
+ export interface TimePickerProps extends Omit<BoxProps, 'onChange'> {
17
+ /**
18
+ * Current time value (single mode)
19
+ */
20
+ value?: TimeValue | null;
21
+ /**
22
+ * Callback when time changes (single mode)
23
+ */
24
+ onChange?: (value: TimeValue | null) => void;
25
+ /**
26
+ * Enable range mode (two time inputs: start and end)
27
+ * @default false
28
+ */
29
+ range?: boolean;
30
+ /**
31
+ * Start time value (range mode)
32
+ */
33
+ startValue?: TimeValue | null;
34
+ /**
35
+ * End time value (range mode)
36
+ */
37
+ endValue?: TimeValue | null;
38
+ /**
39
+ * Callback when start time changes (range mode)
40
+ */
41
+ onStartChange?: (value: TimeValue | null) => void;
42
+ /**
43
+ * Callback when end time changes (range mode)
44
+ */
45
+ onEndChange?: (value: TimeValue | null) => void;
46
+ /**
47
+ * Time display format
48
+ * @default '24h'
49
+ */
50
+ format?: TimeFormat;
51
+ /**
52
+ * Minute step for the wheel picker
53
+ * @default 1
54
+ */
55
+ minuteStep?: number;
56
+ /**
57
+ * Predefined time slots to choose from.
58
+ * When provided, shows a single wheel with these slots instead of hour/minute wheels.
59
+ * Example: [{ hours: 9, minutes: 0 }, { hours: 12, minutes: 30 }, { hours: 18, minutes: 0 }]
60
+ */
61
+ slots?: TimeValue[];
62
+ /**
63
+ * Size variant
64
+ * @default 'md'
65
+ */
66
+ size?: TimePickerSize;
67
+ /**
68
+ * Whether the picker is disabled
69
+ * @default false
70
+ */
71
+ disabled?: boolean;
72
+ /**
73
+ * Label text
74
+ */
75
+ label?: string;
76
+ /**
77
+ * Helper text below the input
78
+ */
79
+ helperText?: string;
80
+ /**
81
+ * Error message (takes precedence over helperText)
82
+ */
83
+ error?: string;
84
+ /**
85
+ * Use fixed positioning for popup (renders via portal to document.body).
86
+ * Useful when TimePicker is inside a container with overflow: hidden (e.g., Accordion).
87
+ * @default false
88
+ */
89
+ isFixedPosition?: boolean;
90
+ }
91
+ /**
92
+ * Props for TimePickerInput sub-component
93
+ */
94
+ export interface TimePickerInputProps {
95
+ /** Current display value */
96
+ value: string;
97
+ /** Callback when input value changes */
98
+ onChange: (value: string) => void;
99
+ /** Callback when input is focused */
100
+ onFocus: () => void;
101
+ /** Callback when input loses focus */
102
+ onBlur?: () => void;
103
+ /** Callback when Enter key is pressed */
104
+ onEnterPress?: () => void;
105
+ /** Callback when clear button is clicked */
106
+ onClear?: () => void;
107
+ /** Label text */
108
+ label?: string;
109
+ /** Helper text */
110
+ helperText?: string;
111
+ /** Error message */
112
+ error?: string;
113
+ /** Whether input is disabled */
114
+ disabled?: boolean;
115
+ /** Whether the input has a value (show clear button) */
116
+ hasValue: boolean;
117
+ /** Placeholder text */
118
+ placeholder?: string;
119
+ }
120
+ /**
121
+ * Props for TimePickerPopup sub-component
122
+ */
123
+ export interface TimePickerPopupProps {
124
+ /** Whether popup is open */
125
+ isOpen: boolean;
126
+ /** Anchor element ref */
127
+ anchorRef: React.RefObject<HTMLDivElement | null>;
128
+ /** Close handler */
129
+ onClose: () => void;
130
+ /** Popup content */
131
+ children: React.ReactNode;
132
+ /** Size variant */
133
+ size: TimePickerSize;
134
+ /** Use fixed positioning for popup (portal to document.body) */
135
+ isFixedPosition?: boolean;
136
+ }
137
+ /**
138
+ * Props for TimePickerWheel sub-component
139
+ */
140
+ export interface TimePickerWheelProps {
141
+ /** Array of values to display */
142
+ items: string[];
143
+ /** Currently selected value */
144
+ selectedValue: string;
145
+ /** Callback when value is selected */
146
+ onSelect: (value: string) => void;
147
+ /** Size variant */
148
+ size: TimePickerSize;
149
+ }
150
+ /**
151
+ * Props for TimePickerWheels container
152
+ */
153
+ export interface TimePickerWheelsProps {
154
+ /** Current time value */
155
+ value: TimeValue | null;
156
+ /** Callback when time changes */
157
+ onChange: (value: TimeValue) => void;
158
+ /** Time format */
159
+ format: TimeFormat;
160
+ /** Minute step */
161
+ minuteStep: number;
162
+ /** Size variant */
163
+ size: TimePickerSize;
164
+ /** Predefined time slots (shows single wheel when provided) */
165
+ slots?: TimeValue[];
166
+ /** Marker value to show (the other time in range mode) */
167
+ markerValue?: TimeValue | null;
168
+ /** Label for marker (e.g., "Start:" or "End:") */
169
+ markerLabel?: string;
170
+ }
171
+ /**
172
+ * Handle for imperative API access
173
+ */
174
+ export interface TimePickerHandle {
175
+ /** Open the picker popup */
176
+ open: () => void;
177
+ /** Close the picker popup */
178
+ close: () => void;
179
+ /** Reset to initial value */
180
+ reset: () => void;
181
+ /** Get current value */
182
+ getValue: () => TimeValue | null;
183
+ /** Focus the input */
184
+ focus: () => void;
185
+ }
@@ -0,0 +1,73 @@
1
+ import { TimeFormat, TimeValue } from './types';
2
+ /**
3
+ * Generate minutes array based on step
4
+ */
5
+ export declare function generateMinutes(step: number): string[];
6
+ /**
7
+ * Convert 24h hours to 12h format
8
+ */
9
+ export declare function to12Hour(hours24: number): {
10
+ hours: number;
11
+ period: 'AM' | 'PM';
12
+ };
13
+ /**
14
+ * Convert 12h format to 24h hours
15
+ */
16
+ export declare function to24Hour(hours12: number, period: 'AM' | 'PM'): number;
17
+ /**
18
+ * Format TimeValue to display string
19
+ */
20
+ export declare function formatTime(value: TimeValue | null, format: TimeFormat): string;
21
+ /**
22
+ * Parse display string to TimeValue
23
+ */
24
+ export declare function parseTime(input: string, format: TimeFormat): TimeValue | null;
25
+ /**
26
+ * Check if a string is a valid time input
27
+ */
28
+ export declare function isValidTimeInput(input: string, format: TimeFormat): boolean;
29
+ /**
30
+ * Get the mask pattern for input
31
+ */
32
+ export declare function getMask(format: TimeFormat): string;
33
+ /**
34
+ * Check if character at position is a mask placeholder
35
+ */
36
+ export declare function isMaskPlaceholder(char: string): boolean;
37
+ /**
38
+ * Apply typed digits to mask
39
+ */
40
+ export declare function applyInputToMask(digits: string, mask: string): string;
41
+ /**
42
+ * Snap minutes to nearest step
43
+ */
44
+ export declare function snapToStep(minutes: number, step: number): number;
45
+ /**
46
+ * Create TimeValue with snapped minutes
47
+ */
48
+ export declare function createTimeValue(hours: number, minutes: number, minuteStep: number): TimeValue;
49
+ /**
50
+ * Format a slot (TimeValue) to display string for wheel
51
+ */
52
+ export declare function formatSlot(slot: TimeValue, format: TimeFormat): string;
53
+ /**
54
+ * Check if two TimeValue are equal
55
+ */
56
+ export declare function isTimeEqual(a: TimeValue | null, b: TimeValue | null): boolean;
57
+ /**
58
+ * Convert TimeValue to minutes from midnight for comparison
59
+ */
60
+ export declare function timeValueToMinutes(time: TimeValue): number;
61
+ /**
62
+ * Compare two TimeValues
63
+ * Returns:
64
+ * -1 if a < b
65
+ * 0 if a === b
66
+ * 1 if a > b
67
+ * null if either value is null/undefined (incomparable)
68
+ */
69
+ export declare function compareTimeValues(a: TimeValue | null | undefined, b: TimeValue | null | undefined): -1 | 0 | 1 | null;
70
+ /**
71
+ * Find index of slot in slots array
72
+ */
73
+ export declare function findSlotIndex(slots: TimeValue[], value: TimeValue | null): number;
@@ -25,3 +25,5 @@ export * from './Tooltip';
25
25
  export * from './BarChart';
26
26
  export * from './PieChart';
27
27
  export * from './LineChart';
28
+ export * from './DatePicker';
29
+ export * from './TimePicker';
@@ -7,3 +7,4 @@ export * from './useInteractionDetector';
7
7
  export * from './useEventListener';
8
8
  export * from './useIsomorphicLayoutEffect';
9
9
  export * from './useUserAgent';
10
+ export * from './usePopupPosition';
@@ -0,0 +1,15 @@
1
+ interface UsePopupPositionProps<TAnchor extends HTMLElement = HTMLElement, TPopup extends HTMLElement = HTMLElement> {
2
+ anchorRef: React.RefObject<TAnchor | null>;
3
+ popupRef: React.RefObject<TPopup | null>;
4
+ offsetValue: number;
5
+ isOpen: boolean;
6
+ /** Use fixed positioning relative to viewport (for portal popups) */
7
+ useFixedPosition?: boolean;
8
+ }
9
+ /**
10
+ * Hook to calculate and update popup position relative to anchor element
11
+ * Position is calculated relative to container (using position: absolute)
12
+ * Automatically handles initial positioning and resize events
13
+ */
14
+ export declare function usePopupPosition<TAnchor extends HTMLElement = HTMLElement, TPopup extends HTMLElement = HTMLElement>({ anchorRef, popupRef, offsetValue, isOpen, useFixedPosition, }: UsePopupPositionProps<TAnchor, TPopup>): void;
15
+ export {};