rupoui 1.0.1 → 1.1.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.
Files changed (105) hide show
  1. package/dist/components/button/Button.d.ts +1 -1
  2. package/dist/components/button/button.styles.d.ts +9 -0
  3. package/dist/components/button/button.types.d.ts +1 -1
  4. package/dist/components/calendar/Calendar.d.ts +4 -0
  5. package/dist/components/calendar/calendar.grid.d.ts +6 -0
  6. package/dist/components/calendar/calendar.navigation.d.ts +17 -0
  7. package/dist/components/calendar/calendar.selection.d.ts +12 -0
  8. package/dist/components/calendar/calendar.state.d.ts +8 -0
  9. package/dist/components/calendar/calendar.styles.d.ts +103 -0
  10. package/dist/components/calendar/calendar.types.d.ts +48 -0
  11. package/dist/components/calendar/index.d.ts +3 -0
  12. package/dist/components/calendar/utils.d.ts +8 -0
  13. package/dist/components/checkbox/checkbox.styles.d.ts +9 -0
  14. package/dist/components/checkbox/useCheckbox.d.ts +1 -1
  15. package/dist/components/checkbox/useCheckboxGroup.d.ts +1 -1
  16. package/dist/components/datepicker/DatePart.d.ts +19 -0
  17. package/dist/components/datepicker/DatePicker.d.ts +20 -0
  18. package/dist/components/datepicker/DatePickerCalendar.d.ts +12 -0
  19. package/dist/components/datepicker/DatePickerDay.d.ts +14 -0
  20. package/dist/components/datepicker/DatePickerInput.d.ts +20 -0
  21. package/dist/components/datepicker/DatePickerPopover.d.ts +11 -0
  22. package/dist/components/datepicker/SegmentedDatePickerInput.d.ts +13 -0
  23. package/dist/components/datepicker/datepicker.controller.d.ts +19 -0
  24. package/dist/components/datepicker/datepicker.format.d.ts +10 -0
  25. package/dist/components/datepicker/datepicker.input.logic.d.ts +20 -0
  26. package/dist/components/datepicker/datepicker.input.state.d.ts +4 -0
  27. package/dist/components/datepicker/datepicker.input.types.d.ts +24 -0
  28. package/dist/components/datepicker/datepicker.keyboard.d.ts +6 -0
  29. package/dist/components/datepicker/datepicker.state.d.ts +7 -0
  30. package/dist/components/datepicker/datepicker.styles.d.ts +133 -0
  31. package/dist/components/datepicker/datepicker.types.d.ts +62 -0
  32. package/dist/components/datepicker/index.d.ts +5 -0
  33. package/dist/components/dropdown/Dropdown.d.ts +4 -0
  34. package/dist/components/dropdown/DropdownContent.d.ts +4 -0
  35. package/dist/components/dropdown/DropdownItem.d.ts +4 -0
  36. package/dist/components/dropdown/DropdownSection.d.ts +4 -0
  37. package/dist/components/dropdown/DropdownSeparator.d.ts +4 -0
  38. package/dist/components/dropdown/DropdownTrigger.d.ts +4 -0
  39. package/dist/components/dropdown/context.d.ts +25 -0
  40. package/dist/components/dropdown/dropdown.styles.d.ts +235 -0
  41. package/dist/components/dropdown/dropdown.types.d.ts +102 -0
  42. package/dist/components/dropdown/index.d.ts +9 -0
  43. package/dist/components/dropdown/useDropdown.d.ts +18 -0
  44. package/dist/components/input/Input.d.ts +1 -1
  45. package/dist/components/input/input.styles.d.ts +9 -0
  46. package/dist/components/input/input.types.d.ts +1 -1
  47. package/dist/components/input-number/InputNumber.d.ts +1 -1
  48. package/dist/components/input-number/input-number.styles.d.ts +9 -0
  49. package/dist/components/input-number/input-number.types.d.ts +1 -1
  50. package/dist/components/modal/Modal.d.ts +7 -0
  51. package/dist/components/modal/ModalContent.d.ts +4 -0
  52. package/dist/components/modal/ModalLayout.d.ts +5 -0
  53. package/dist/components/modal/ModalTrigger.d.ts +5 -0
  54. package/dist/components/modal/context.d.ts +12 -0
  55. package/dist/components/modal/index.d.ts +6 -0
  56. package/dist/components/modal/modal.styles.d.ts +304 -0
  57. package/dist/components/modal/modal.types.d.ts +52 -0
  58. package/dist/components/modal/useModal.d.ts +10 -0
  59. package/dist/components/pagination/Pagination.d.ts +4 -0
  60. package/dist/components/pagination/PaginationContent.d.ts +4 -0
  61. package/dist/components/pagination/PaginationContext.d.ts +58 -0
  62. package/dist/components/pagination/PaginationEllipsis.d.ts +4 -0
  63. package/dist/components/pagination/PaginationItem.d.ts +4 -0
  64. package/dist/components/pagination/PaginationItems.d.ts +8 -0
  65. package/dist/components/pagination/PaginationNext.d.ts +4 -0
  66. package/dist/components/pagination/PaginationPrevious.d.ts +4 -0
  67. package/dist/components/pagination/index.d.ts +9 -0
  68. package/dist/components/pagination/pagination.styles.d.ts +169 -0
  69. package/dist/components/pagination/pagination.types.d.ts +135 -0
  70. package/dist/components/pagination/usePagination.d.ts +27 -0
  71. package/dist/components/popover/Popover.d.ts +4 -0
  72. package/dist/components/popover/PopoverContent.d.ts +4 -0
  73. package/dist/components/popover/PopoverContext.d.ts +96 -0
  74. package/dist/components/popover/PopoverTrigger.d.ts +4 -0
  75. package/dist/components/popover/index.d.ts +6 -0
  76. package/dist/components/popover/popover.styles.d.ts +151 -0
  77. package/dist/components/popover/popover.types.d.ts +106 -0
  78. package/dist/components/popover/usePopover.d.ts +51 -0
  79. package/dist/components/radio/radio.styles.d.ts +12 -0
  80. package/dist/components/radio/useRadioGroup.d.ts +1 -1
  81. package/dist/components/ripple/Ripple.d.ts +16 -0
  82. package/dist/components/select/select.styles.d.ts +12 -0
  83. package/dist/components/tabs/Tab.d.ts +3 -0
  84. package/dist/components/tabs/Tabs.d.ts +3 -0
  85. package/dist/components/tabs/index.d.ts +4 -0
  86. package/dist/components/tabs/tabs.styles.d.ts +412 -0
  87. package/dist/components/tabs/tabs.types.d.ts +71 -0
  88. package/dist/components/tabs/useTabs.d.ts +7 -0
  89. package/dist/components/textarea/Textarea.d.ts +1 -1
  90. package/dist/components/textarea/textarea.styles.d.ts +9 -0
  91. package/dist/components/textarea/textarea.types.d.ts +1 -1
  92. package/dist/components/tooltip/Tooltip.d.ts +4 -0
  93. package/dist/components/tooltip/index.d.ts +3 -0
  94. package/dist/components/tooltip/tooltip.styles.d.ts +232 -0
  95. package/dist/components/tooltip/tooltip.types.d.ts +75 -0
  96. package/dist/components/tooltip/useTooltip.d.ts +29 -0
  97. package/dist/components/tooltip/utils.d.ts +22 -0
  98. package/dist/hooks/useFocusTrap.d.ts +1 -0
  99. package/dist/hooks/useScrollLock.d.ts +1 -0
  100. package/dist/index.cjs +4 -1
  101. package/dist/index.d.ts +8 -0
  102. package/dist/index.js +9538 -1807
  103. package/dist/motion/hover.d.ts +2 -1
  104. package/dist/style.css +1 -1
  105. package/package.json +1 -1
@@ -5,7 +5,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
5
5
  size?: "sm" | "md" | "lg";
6
6
  variant?: "solid" | "flat" | "ghost" | "bordered";
7
7
  color?: "primary" | "secondary" | "success" | "warning" | "danger";
8
- radius?: "sm" | "md" | "lg" | "full";
8
+ radius?: "sm" | "md" | "lg" | "xl" | "full";
9
9
  isLoading?: boolean;
10
10
  isDisabled?: boolean;
11
11
  fullWidth?: boolean;
@@ -47,6 +47,9 @@ export declare const button: import('tailwind-variants').TVReturnType<{
47
47
  lg: {
48
48
  base: string;
49
49
  };
50
+ xl: {
51
+ base: string;
52
+ };
50
53
  full: {
51
54
  base: string;
52
55
  };
@@ -119,6 +122,9 @@ export declare const button: import('tailwind-variants').TVReturnType<{
119
122
  lg: {
120
123
  base: string;
121
124
  };
125
+ xl: {
126
+ base: string;
127
+ };
122
128
  full: {
123
129
  base: string;
124
130
  };
@@ -191,6 +197,9 @@ export declare const button: import('tailwind-variants').TVReturnType<{
191
197
  lg: {
192
198
  base: string;
193
199
  };
200
+ xl: {
201
+ base: string;
202
+ };
194
203
  full: {
195
204
  base: string;
196
205
  };
@@ -5,7 +5,7 @@ export type ButtonProps = {
5
5
  size?: "sm" | "md" | "lg";
6
6
  variant?: "solid" | "flat" | "ghost" | "bordered";
7
7
  color?: "primary" | "secondary" | "success" | "warning" | "danger";
8
- radius?: "sm" | "md" | "lg" | "full";
8
+ radius?: "sm" | "md" | "lg" | "xl" | "full";
9
9
  isLoading?: boolean;
10
10
  isDisabled?: boolean;
11
11
  fullWidth?: boolean;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { CalendarProps } from './calendar.types';
3
+
4
+ export declare const Calendar: React.FC<CalendarProps>;
@@ -0,0 +1,6 @@
1
+ import { CalendarCell, CalendarConfig, CalendarState } from './calendar.types';
2
+
3
+ /**
4
+ * Generates a 6x7 grid of calendar cells for the current viewDate.
5
+ */
6
+ export declare function getMonthGrid(state: CalendarState, config?: CalendarConfig): CalendarCell[][];
@@ -0,0 +1,17 @@
1
+ import { CalendarState } from './calendar.types';
2
+
3
+ /**
4
+ * Navigates to the next month.
5
+ * Returns a new state object.
6
+ */
7
+ export declare function goToNextMonth(state: CalendarState): CalendarState;
8
+ /**
9
+ * Navigates to the previous month.
10
+ * Returns a new state object.
11
+ */
12
+ export declare function goToPreviousMonth(state: CalendarState): CalendarState;
13
+ /**
14
+ * Navigates to a specific date (month/year).
15
+ * Returns a new state object.
16
+ */
17
+ export declare function goToMonth(state: CalendarState, date: Date): CalendarState;
@@ -0,0 +1,12 @@
1
+ import { CalendarConfig, CalendarState } from './calendar.types';
2
+
3
+ /**
4
+ * Checks if a date is disabled based on the config.
5
+ */
6
+ export declare function isDateDisabled(date: Date, config?: CalendarConfig): boolean;
7
+ /**
8
+ * Selects a date.
9
+ * Updates both selectedDate and viewDate (if the selected date is in a different month).
10
+ * Respects disabled constraints.
11
+ */
12
+ export declare function selectDate(state: CalendarState, date: Date, config?: CalendarConfig): CalendarState;
@@ -0,0 +1,8 @@
1
+ import { CalendarState } from './calendar.types';
2
+
3
+ /**
4
+ * Creates the initial calendar state.
5
+ * @param initialDate The date to start viewing (defaults to today).
6
+ * @param selectedDate The initially selected date (optional).
7
+ */
8
+ export declare function createCalendarState(initialDate?: Date, selectedDate?: Date): CalendarState;
@@ -0,0 +1,103 @@
1
+ export declare const calendar: import('tailwind-variants').TVReturnType<{
2
+ [key: string]: {
3
+ [key: string]: import('tailwind-merge').ClassNameValue | {
4
+ base?: import('tailwind-merge').ClassNameValue;
5
+ footer?: import('tailwind-merge').ClassNameValue;
6
+ header?: import('tailwind-merge').ClassNameValue;
7
+ time?: import('tailwind-merge').ClassNameValue;
8
+ grid?: import('tailwind-merge').ClassNameValue;
9
+ cell?: import('tailwind-merge').ClassNameValue;
10
+ headerTitle?: import('tailwind-merge').ClassNameValue;
11
+ weekdaysWrapper?: import('tailwind-merge').ClassNameValue;
12
+ daysWrapper?: import('tailwind-merge').ClassNameValue;
13
+ weekday?: import('tailwind-merge').ClassNameValue;
14
+ cellToday?: import('tailwind-merge').ClassNameValue;
15
+ cellDisabled?: import('tailwind-merge').ClassNameValue;
16
+ cellOutside?: import('tailwind-merge').ClassNameValue;
17
+ cellSelected?: import('tailwind-merge').ClassNameValue;
18
+ };
19
+ };
20
+ } | {
21
+ [x: string]: {
22
+ [x: string]: import('tailwind-merge').ClassNameValue | {
23
+ base?: import('tailwind-merge').ClassNameValue;
24
+ footer?: import('tailwind-merge').ClassNameValue;
25
+ header?: import('tailwind-merge').ClassNameValue;
26
+ time?: import('tailwind-merge').ClassNameValue;
27
+ grid?: import('tailwind-merge').ClassNameValue;
28
+ cell?: import('tailwind-merge').ClassNameValue;
29
+ headerTitle?: import('tailwind-merge').ClassNameValue;
30
+ weekdaysWrapper?: import('tailwind-merge').ClassNameValue;
31
+ daysWrapper?: import('tailwind-merge').ClassNameValue;
32
+ weekday?: import('tailwind-merge').ClassNameValue;
33
+ cellToday?: import('tailwind-merge').ClassNameValue;
34
+ cellDisabled?: import('tailwind-merge').ClassNameValue;
35
+ cellOutside?: import('tailwind-merge').ClassNameValue;
36
+ cellSelected?: import('tailwind-merge').ClassNameValue;
37
+ };
38
+ };
39
+ } | {}, {
40
+ base: string;
41
+ header: string;
42
+ headerTitle: string;
43
+ grid: string;
44
+ weekdaysWrapper: string;
45
+ daysWrapper: string;
46
+ weekday: string;
47
+ cell: string[];
48
+ cellSelected: string[];
49
+ cellToday: string;
50
+ cellDisabled: string;
51
+ cellOutside: string;
52
+ time: string;
53
+ footer: string;
54
+ }, undefined, {
55
+ [key: string]: {
56
+ [key: string]: import('tailwind-merge').ClassNameValue | {
57
+ base?: import('tailwind-merge').ClassNameValue;
58
+ footer?: import('tailwind-merge').ClassNameValue;
59
+ header?: import('tailwind-merge').ClassNameValue;
60
+ time?: import('tailwind-merge').ClassNameValue;
61
+ grid?: import('tailwind-merge').ClassNameValue;
62
+ cell?: import('tailwind-merge').ClassNameValue;
63
+ headerTitle?: import('tailwind-merge').ClassNameValue;
64
+ weekdaysWrapper?: import('tailwind-merge').ClassNameValue;
65
+ daysWrapper?: import('tailwind-merge').ClassNameValue;
66
+ weekday?: import('tailwind-merge').ClassNameValue;
67
+ cellToday?: import('tailwind-merge').ClassNameValue;
68
+ cellDisabled?: import('tailwind-merge').ClassNameValue;
69
+ cellOutside?: import('tailwind-merge').ClassNameValue;
70
+ cellSelected?: import('tailwind-merge').ClassNameValue;
71
+ };
72
+ };
73
+ } | {}, {
74
+ base: string;
75
+ header: string;
76
+ headerTitle: string;
77
+ grid: string;
78
+ weekdaysWrapper: string;
79
+ daysWrapper: string;
80
+ weekday: string;
81
+ cell: string[];
82
+ cellSelected: string[];
83
+ cellToday: string;
84
+ cellDisabled: string;
85
+ cellOutside: string;
86
+ time: string;
87
+ footer: string;
88
+ }, import('tailwind-variants').TVReturnType<unknown, {
89
+ base: string;
90
+ header: string;
91
+ headerTitle: string;
92
+ grid: string;
93
+ weekdaysWrapper: string;
94
+ daysWrapper: string;
95
+ weekday: string;
96
+ cell: string[];
97
+ cellSelected: string[];
98
+ cellToday: string;
99
+ cellDisabled: string;
100
+ cellOutside: string;
101
+ time: string;
102
+ footer: string;
103
+ }, undefined, unknown, unknown, undefined>>;
@@ -0,0 +1,48 @@
1
+ export interface CalendarState {
2
+ viewDate: Date;
3
+ selectedDate?: Date;
4
+ }
5
+ export interface CalendarEngineDay {
6
+ date: Date;
7
+ isToday: boolean;
8
+ isSelected: boolean;
9
+ isDisabled: boolean;
10
+ isOutsideMonth: boolean;
11
+ isCurrentMonth?: boolean;
12
+ }
13
+ export type CalendarCell = CalendarEngineDay;
14
+ export interface CalendarConfig {
15
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
16
+ minDate?: Date;
17
+ maxDate?: Date;
18
+ disabledDates?: Date[] | ((date: Date) => boolean);
19
+ }
20
+ export interface CalendarEngine {
21
+ weeks: CalendarEngineDay[][];
22
+ viewDate: Date;
23
+ goToNextMonth(): void;
24
+ goToPrevMonth(): void;
25
+ setDate(date: Date): void;
26
+ }
27
+ export interface CalendarProps {
28
+ engine: CalendarEngine;
29
+ granularity?: "date" | "minute" | "second";
30
+ isDisabled?: boolean;
31
+ isReadOnly?: boolean;
32
+ classNames?: {
33
+ base?: string;
34
+ header?: string;
35
+ headerTitle?: string;
36
+ grid?: string;
37
+ weekdaysWrapper?: string;
38
+ daysWrapper?: string;
39
+ weekday?: string;
40
+ cell?: string;
41
+ cellSelected?: string;
42
+ cellToday?: string;
43
+ cellDisabled?: string;
44
+ cellOutside?: string;
45
+ time?: string;
46
+ footer?: string;
47
+ };
48
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Calendar';
2
+ export * from './calendar.types';
3
+ export * from './calendar.grid';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Normalizes a date to the start of the day in local time.
3
+ * This ensures consistency across all calendar operations.
4
+ *
5
+ * @param date The date to normalize
6
+ * @returns A new Date object set to 00:00:00.000 local time
7
+ */
8
+ export declare function normalizeDate(date: Date): Date;
@@ -51,6 +51,9 @@ export declare const checkbox: import('tailwind-variants').TVReturnType<{
51
51
  lg: {
52
52
  wrapper: string;
53
53
  };
54
+ xl: {
55
+ wrapper: string;
56
+ };
54
57
  full: {
55
58
  wrapper: string;
56
59
  };
@@ -150,6 +153,9 @@ export declare const checkbox: import('tailwind-variants').TVReturnType<{
150
153
  lg: {
151
154
  wrapper: string;
152
155
  };
156
+ xl: {
157
+ wrapper: string;
158
+ };
153
159
  full: {
154
160
  wrapper: string;
155
161
  };
@@ -249,6 +255,9 @@ export declare const checkbox: import('tailwind-variants').TVReturnType<{
249
255
  lg: {
250
256
  wrapper: string;
251
257
  };
258
+ xl: {
259
+ wrapper: string;
260
+ };
252
261
  full: {
253
262
  wrapper: string;
254
263
  };
@@ -10,7 +10,7 @@ export declare function useCheckbox(props: CheckboxProps): {
10
10
  isInvalid: boolean;
11
11
  size: "sm" | "md" | "lg" | undefined;
12
12
  color: "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
13
- radius: "sm" | "md" | "lg" | "full" | "none" | undefined;
13
+ radius: "sm" | "md" | "lg" | "xl" | "full" | "none" | undefined;
14
14
  variant: "solid" | "flat" | "ghost" | "bordered" | "light" | undefined;
15
15
  handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
16
16
  children: import('react').ReactNode;
@@ -13,7 +13,7 @@ export declare function useCheckboxGroup(props: CheckboxGroupProps): {
13
13
  orientation: "vertical" | "horizontal";
14
14
  color: "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
15
15
  size: "sm" | "md" | "lg" | undefined;
16
- radius: "sm" | "md" | "lg" | "full" | "none" | undefined;
16
+ radius: "sm" | "md" | "lg" | "xl" | "full" | "none" | undefined;
17
17
  variant: "solid" | "flat" | "ghost" | "bordered" | "light" | undefined;
18
18
  otherProps: {
19
19
  classNames?: Partial<Record<import('./checkbox.types').CheckboxGroupSlots, string>>;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface DatePartProps {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ onKeyDown: (e: React.KeyboardEvent, type: DatePartType) => void;
7
+ onFocus: () => void;
8
+ onBlur: () => void;
9
+ type: DatePartType;
10
+ min: number;
11
+ max: number;
12
+ placeholder: string;
13
+ width?: string;
14
+ className?: string;
15
+ ariaLabel?: string;
16
+ }
17
+ export type DatePartType = "day" | "month" | "year" | "hour" | "minute" | "second";
18
+ export declare const DatePart: React.ForwardRefExoticComponent<DatePartProps & React.RefAttributes<HTMLInputElement>>;
19
+ export {};
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { DatePickerConfig } from './datepicker.types';
3
+
4
+ export interface DatePickerProps extends Omit<DatePickerConfig, "value"> {
5
+ value?: Date | null;
6
+ className?: string;
7
+ placeholder?: string;
8
+ isDisabled?: boolean;
9
+ isReadOnly?: boolean;
10
+ onChange?: (date: Date | null) => void;
11
+ /** Whether manual text input is allowed */
12
+ allowInput?: boolean;
13
+ /** Expected date format (e.g., 'yyyy-MM-dd') */
14
+ format?: string;
15
+ /** Locale for formatting/parsing */
16
+ locale?: string;
17
+ /** Callback when input is invalid */
18
+ onInvalidInput?: (value: string, reason: string) => void;
19
+ }
20
+ export declare const DatePicker: React.FC<DatePickerProps>;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { DatePickerState, DatePickerConfig } from './datepicker.types';
3
+ import { datePicker } from './datepicker.styles';
4
+
5
+ interface DatePickerCalendarProps {
6
+ state: DatePickerState;
7
+ config: DatePickerConfig;
8
+ onUpdate: (newState: DatePickerState) => void;
9
+ styles: ReturnType<typeof datePicker>;
10
+ }
11
+ export declare const DatePickerCalendar: React.FC<DatePickerCalendarProps>;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { CalendarCell } from '../calendar/calendar.types';
3
+ import { DatePickerState, DatePickerConfig } from './datepicker.types';
4
+ import { datePicker } from './datepicker.styles';
5
+
6
+ interface DatePickerDayProps {
7
+ cell: CalendarCell;
8
+ state: DatePickerState;
9
+ config: DatePickerConfig;
10
+ onSelect: (newState: DatePickerState) => void;
11
+ styles: ReturnType<typeof datePicker>;
12
+ }
13
+ export declare const DatePickerDay: React.FC<DatePickerDayProps>;
14
+ export {};
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { DatePickerState, DatePickerConfig } from './datepicker.types';
3
+ import { datePicker } from './datepicker.styles';
4
+
5
+ interface DatePickerInputProps {
6
+ state: DatePickerState;
7
+ config: DatePickerConfig;
8
+ onUpdate: (newState: DatePickerState) => void;
9
+ styles: ReturnType<typeof datePicker>;
10
+ placeholder?: string;
11
+ isDisabled?: boolean;
12
+ isReadOnly?: boolean;
13
+ className?: string;
14
+ allowInput?: boolean;
15
+ formatString?: string;
16
+ locale?: string;
17
+ onInvalidInput?: (value: string, reason: string) => void;
18
+ }
19
+ export declare const DatePickerInput: React.FC<DatePickerInputProps>;
20
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { datePicker } from './datepicker.styles';
3
+
4
+ interface DatePickerPopoverProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ children: React.ReactNode;
8
+ styles: ReturnType<typeof datePicker>;
9
+ }
10
+ export declare const DatePickerPopover: React.FC<DatePickerPopoverProps>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { DatePickerState, DatePickerConfig } from './datepicker.types';
3
+ import { datePicker } from './datepicker.styles';
4
+
5
+ interface SegmentedDatePickerInputProps {
6
+ state: DatePickerState;
7
+ config: DatePickerConfig;
8
+ onUpdate: (newState: DatePickerState) => void;
9
+ styles: ReturnType<typeof datePicker>;
10
+ className?: string;
11
+ }
12
+ export declare const SegmentedDatePickerInput: React.FC<SegmentedDatePickerInputProps>;
13
+ export {};
@@ -0,0 +1,19 @@
1
+ import { DatePickerConfig, DatePickerState } from './datepicker.types';
2
+
3
+ /** ----------------------------------------------------------------------------
4
+ * VISIBILITY CONTROLS
5
+ * -------------------------------------------------------------------------- */
6
+ export declare function openPicker(state: DatePickerState, shouldFocus?: boolean): DatePickerState;
7
+ export declare function closePicker(state: DatePickerState): DatePickerState;
8
+ export declare function togglePicker(state: DatePickerState): DatePickerState;
9
+ /** ----------------------------------------------------------------------------
10
+ * NAVIGATION
11
+ * -------------------------------------------------------------------------- */
12
+ export declare function goToNextMonth(state: DatePickerState): DatePickerState;
13
+ export declare function goToPreviousMonth(state: DatePickerState): DatePickerState;
14
+ export declare function goToMonth(state: DatePickerState, date: Date): DatePickerState;
15
+ /** ----------------------------------------------------------------------------
16
+ * SELECTION & FOCUS
17
+ * -------------------------------------------------------------------------- */
18
+ export declare function selectDate(state: DatePickerState, date: Date, config?: DatePickerConfig): DatePickerState;
19
+ export declare function setFocusedDate(state: DatePickerState, date: Date): DatePickerState;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Formats a date object into a string based on the provided format.
3
+ * Currently supports 'yyyy-MM-dd' as the primary format.
4
+ *
5
+ * @param date The date to format
6
+ * @param format The format string (default: 'yyyy-MM-dd')
7
+ * @param locale The locale to use (optional)
8
+ * @returns The formatted date string
9
+ */
10
+ export declare function formatDate(date: Date, format?: string, locale?: string): string;
@@ -0,0 +1,20 @@
1
+ import { DatePickerInputState, DatePickerInputConfig } from './datepicker.input.types';
2
+
3
+ /**
4
+ * Parses an input string into a Date object based on the format.
5
+ * Returns null if parsing fails or input is invalid.
6
+ */
7
+ export declare function parseInputDate(input: string, format?: string, locale?: string): Date | null;
8
+ /**
9
+ * Handles input change event.
10
+ * Simply updates value and sets typing state.
11
+ */
12
+ export declare function onInputChange(prevState: DatePickerInputState, newValue: string): DatePickerInputState;
13
+ /**
14
+ * Handles input blur event.
15
+ * Attempts to parse, validate, and returns new state + potential date selection.
16
+ */
17
+ export declare function onInputBlur(currentState: DatePickerInputState, config: DatePickerInputConfig): {
18
+ inputState: DatePickerInputState;
19
+ selectedDate?: Date | null;
20
+ };
@@ -0,0 +1,4 @@
1
+ import { DatePickerInputState } from './datepicker.input.types';
2
+
3
+ export declare const initialInputState: DatePickerInputState;
4
+ export declare const createInputState: (initialValue?: string) => DatePickerInputState;
@@ -0,0 +1,24 @@
1
+ export type DatePickerInputState = {
2
+ /** The current text value of the input */
3
+ inputValue: string;
4
+ /** Whether the user is currently typing (has not blurred/selected yet) */
5
+ isTyping: boolean;
6
+ /** Error message if parsing failed or constraints violated */
7
+ error?: string;
8
+ };
9
+ export type DatePickerInputConfig = {
10
+ /** Whether manual input is allowed */
11
+ allowInput?: boolean;
12
+ /** Expected date format (e.g., 'yyyy-MM-dd') */
13
+ format?: string;
14
+ /** Locale for formatting/parsing */
15
+ locale?: string;
16
+ /** Callback when input is invalid */
17
+ onInvalidInput?: (value: string, reason: string) => void;
18
+ /** Minimum allowed date */
19
+ minDate?: Date;
20
+ /** Maximum allowed date */
21
+ maxDate?: Date;
22
+ /** Function to determine if a date is disabled */
23
+ disabledDates?: (date: Date) => boolean;
24
+ };
@@ -0,0 +1,6 @@
1
+ import { DatePickerConfig, DatePickerState } from './datepicker.types';
2
+
3
+ /**
4
+ * Handles keyboard events for the DatePicker.
5
+ */
6
+ export declare function handleKeyDown(state: DatePickerState, key: string, config: DatePickerConfig): DatePickerState;
@@ -0,0 +1,7 @@
1
+ import { DatePickerConfig, DatePickerState } from './datepicker.types';
2
+
3
+ /**
4
+ * Creates the initial state for the DatePicker.
5
+ * Handles controlled vs uncontrolled values and normalizes dates.
6
+ */
7
+ export declare function createDatePickerState(config?: DatePickerConfig): DatePickerState;