@povio/ui 2.3.0-rc.6 → 2.3.0-rc.7

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 (191) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +8 -8
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +103 -103
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +9 -9
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +314 -75
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  113. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  114. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  115. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  116. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  117. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  118. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  119. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  120. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  121. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  122. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  123. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +36 -11
  124. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  125. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  126. package/dist/components/inputs/Skeleton/InputFrame.js +472 -145
  127. package/dist/components/inputs/Slider/Slider.js +247 -74
  128. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  129. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  130. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  131. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  132. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  133. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  134. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  135. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  136. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  137. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  138. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  139. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  140. package/dist/components/inputs/shared/CheckContent.js +21 -10
  141. package/dist/components/inputs/shared/InputClear.js +78 -21
  142. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  143. package/dist/components/inputs/shared/input.cva.js +13 -3
  144. package/dist/components/inputs/shared/useStaticInputHandoff.js +93 -50
  145. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  146. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  147. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  148. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  149. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  150. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  151. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  152. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  153. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  154. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  155. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  156. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  157. package/dist/components/segment/Segment.js +218 -57
  158. package/dist/components/segment/SegmentItem.js +67 -10
  159. package/dist/components/shared/pagination/Pagination.js +108 -22
  160. package/dist/components/shared/pagination/PaginationList.js +167 -64
  161. package/dist/components/status/Alert/Alert.js +97 -30
  162. package/dist/components/status/Loader/Loader.js +77 -22
  163. package/dist/components/status/Toast/Toast.js +21 -13
  164. package/dist/components/status/Toast/useToast.js +62 -57
  165. package/dist/components/table/ColumnConfig.js +158 -54
  166. package/dist/components/table/InfiniteTable.js +67 -16
  167. package/dist/components/table/PaginatedTable.js +84 -18
  168. package/dist/components/table/Table.js +23 -23
  169. package/dist/components/text/Link/Link.js +19 -7
  170. package/dist/components/text/Typography/Typography.js +23 -8
  171. package/dist/config/confirmation.context.js +1 -1
  172. package/dist/config/link.context.js +23 -9
  173. package/dist/config/router.context.js +42 -16
  174. package/dist/config/theme.context.js +98 -45
  175. package/dist/config/uiConfig.context.js +39 -8
  176. package/dist/config/uiStyle.context.js +15 -5
  177. package/dist/hooks/useBreakpoint.js +16 -3
  178. package/dist/hooks/useDebounceCallback.js +51 -17
  179. package/dist/hooks/useFilters.js +125 -64
  180. package/dist/hooks/useForm.js +42 -8
  181. package/dist/hooks/useFormAutosave.js +101 -30
  182. package/dist/hooks/useIntersectionObserver.js +86 -32
  183. package/dist/hooks/useLocalStorage.js +43 -10
  184. package/dist/hooks/useLongPressRepeat.js +55 -20
  185. package/dist/hooks/usePagination.js +49 -19
  186. package/dist/hooks/useScrollableListBox.js +37 -16
  187. package/dist/hooks/useSorting.js +69 -28
  188. package/dist/hooks/useStateAndRef.js +21 -7
  189. package/dist/hooks/useTableColumnConfig.js +124 -31
  190. package/dist/hooks/useTranslationMemo.js +25 -5
  191. package/package.json +1 -1
@@ -3,154 +3,305 @@ import { CalendarHeader } from "./CalendarHeader.js";
3
3
  import { MonthPicker } from "./MonthPicker.js";
4
4
  import { TimePickerForm } from "./TimePickerForm.js";
5
5
  import { YearPicker } from "./YearPicker.js";
6
+ import { c } from "react/compiler-runtime";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  import { clsx } from "clsx";
8
- import { useCallback, useEffect, useState } from "react";
9
+ import { useEffect, useState } from "react";
9
10
  import { useCalendar } from "@react-aria/calendar";
10
11
  //#region src/components/inputs/DateTime/shared/Calendar.tsx
11
- var Calendar = ({ className, includesTime, datePickerState, hourCycle, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity = "day", setDateValueOnDateSelection = false, onDateSelectionChange, ...props }) => {
12
- const [toggleState, setToggleState] = useState(() => {
13
- if (granularity === "year") return "year";
14
- if (granularity === "month") return "month";
15
- return null;
16
- });
12
+ var Calendar = (t0) => {
13
+ const $ = c(88);
14
+ let className;
15
+ let datePickerState;
16
+ let hourCycle;
17
+ let includesTime;
18
+ let onApply;
19
+ let onDateSelectionChange;
20
+ let onMonthYearChange;
21
+ let onMonthYearCommit;
22
+ let props;
23
+ let selectedDate;
24
+ let t1;
25
+ let t2;
26
+ if ($[0] !== t0) {
27
+ ({className, includesTime, datePickerState, hourCycle, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity: t1, setDateValueOnDateSelection: t2, onDateSelectionChange, ...props} = t0);
28
+ $[0] = t0;
29
+ $[1] = className;
30
+ $[2] = datePickerState;
31
+ $[3] = hourCycle;
32
+ $[4] = includesTime;
33
+ $[5] = onApply;
34
+ $[6] = onDateSelectionChange;
35
+ $[7] = onMonthYearChange;
36
+ $[8] = onMonthYearCommit;
37
+ $[9] = props;
38
+ $[10] = selectedDate;
39
+ $[11] = t1;
40
+ $[12] = t2;
41
+ } else {
42
+ className = $[1];
43
+ datePickerState = $[2];
44
+ hourCycle = $[3];
45
+ includesTime = $[4];
46
+ onApply = $[5];
47
+ onDateSelectionChange = $[6];
48
+ onMonthYearChange = $[7];
49
+ onMonthYearCommit = $[8];
50
+ props = $[9];
51
+ selectedDate = $[10];
52
+ t1 = $[11];
53
+ t2 = $[12];
54
+ }
55
+ const granularity = t1 === void 0 ? "day" : t1;
56
+ const setDateValueOnDateSelection = t2 === void 0 ? false : t2;
57
+ let t3;
58
+ if ($[13] !== granularity) {
59
+ t3 = () => {
60
+ if (granularity === "year") return "year";
61
+ if (granularity === "month") return "month";
62
+ return null;
63
+ };
64
+ $[13] = granularity;
65
+ $[14] = t3;
66
+ } else t3 = $[14];
67
+ const [toggleState, setToggleState] = useState(t3);
17
68
  const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(props.calendarProps, props.state);
18
- useEffect(() => {
19
- if (granularity === "year" && toggleState !== "year") {
20
- setToggleState("year");
21
- return;
22
- }
23
- if (granularity === "month" && toggleState === null) {
24
- setToggleState("month");
25
- return;
26
- }
27
- if (granularity === "month" && toggleState === "time") {
28
- setToggleState("month");
29
- return;
30
- }
31
- if (granularity === "day" && toggleState === "time" && !includesTime) setToggleState(null);
32
- }, [
33
- granularity,
34
- toggleState,
35
- includesTime
36
- ]);
37
- const onMonthSelectionChange = () => {
38
- if (granularity === "day") {
39
- setToggleState(null);
40
- return;
41
- }
42
- setToggleState("month");
43
- };
44
- const onYearSelectionChange = () => {
45
- if (granularity === "day") {
46
- setToggleState(null);
47
- return;
48
- }
49
- if (granularity === "month") {
69
+ let t4;
70
+ let t5;
71
+ if ($[15] !== granularity || $[16] !== includesTime || $[17] !== toggleState) {
72
+ t4 = () => {
73
+ if (granularity === "year" && toggleState !== "year") {
74
+ setToggleState("year");
75
+ return;
76
+ }
77
+ if (granularity === "month" && toggleState === null) {
78
+ setToggleState("month");
79
+ return;
80
+ }
81
+ if (granularity === "month" && toggleState === "time") {
82
+ setToggleState("month");
83
+ return;
84
+ }
85
+ if (granularity === "day" && toggleState === "time" && !includesTime) setToggleState(null);
86
+ };
87
+ t5 = [
88
+ granularity,
89
+ toggleState,
90
+ includesTime
91
+ ];
92
+ $[15] = granularity;
93
+ $[16] = includesTime;
94
+ $[17] = toggleState;
95
+ $[18] = t4;
96
+ $[19] = t5;
97
+ } else {
98
+ t4 = $[18];
99
+ t5 = $[19];
100
+ }
101
+ useEffect(t4, t5);
102
+ let t6;
103
+ if ($[20] !== granularity) {
104
+ t6 = () => {
105
+ if (granularity === "day") {
106
+ setToggleState(null);
107
+ return;
108
+ }
50
109
  setToggleState("month");
51
- return;
52
- }
53
- setToggleState("year");
54
- };
55
- const handleHeaderMonthNavigation = (months) => {
56
- if (toggleState) return;
57
- if (!onMonthYearChange) return;
58
- const focusedDate = props.state.focusedDate;
59
- if (months === -1) {
60
- onMonthYearChange(focusedDate.subtract({ months: 1 }));
61
- return;
62
- }
63
- onMonthYearChange(focusedDate.add({ months: 1 }));
64
- };
65
- const headerPrevButtonProps = {
66
- ...prevButtonProps,
67
- onPress: (event) => {
110
+ };
111
+ $[20] = granularity;
112
+ $[21] = t6;
113
+ } else t6 = $[21];
114
+ const onMonthSelectionChange = t6;
115
+ let t7;
116
+ if ($[22] !== granularity) {
117
+ t7 = () => {
118
+ if (granularity === "day") {
119
+ setToggleState(null);
120
+ return;
121
+ }
122
+ if (granularity === "month") {
123
+ setToggleState("month");
124
+ return;
125
+ }
126
+ setToggleState("year");
127
+ };
128
+ $[22] = granularity;
129
+ $[23] = t7;
130
+ } else t7 = $[23];
131
+ const onYearSelectionChange = t7;
132
+ let t8;
133
+ if ($[24] !== onMonthYearChange || $[25] !== props.state || $[26] !== toggleState) {
134
+ t8 = (months) => {
135
+ if (toggleState) return;
136
+ if (!onMonthYearChange) return;
137
+ const focusedDate = props.state.focusedDate;
138
+ if (months === -1) {
139
+ onMonthYearChange(focusedDate.subtract({ months: 1 }));
140
+ return;
141
+ }
142
+ onMonthYearChange(focusedDate.add({ months: 1 }));
143
+ };
144
+ $[24] = onMonthYearChange;
145
+ $[25] = props.state;
146
+ $[26] = toggleState;
147
+ $[27] = t8;
148
+ } else t8 = $[27];
149
+ const handleHeaderMonthNavigation = t8;
150
+ let t9;
151
+ if ($[28] !== handleHeaderMonthNavigation || $[29] !== prevButtonProps) {
152
+ t9 = (event) => {
68
153
  prevButtonProps.onPress?.(event);
69
154
  handleHeaderMonthNavigation(-1);
70
- }
71
- };
72
- const headerNextButtonProps = {
73
- ...nextButtonProps,
74
- onPress: (event) => {
75
- nextButtonProps.onPress?.(event);
155
+ };
156
+ $[28] = handleHeaderMonthNavigation;
157
+ $[29] = prevButtonProps;
158
+ $[30] = t9;
159
+ } else t9 = $[30];
160
+ let t10;
161
+ if ($[31] !== prevButtonProps || $[32] !== t9) {
162
+ t10 = {
163
+ ...prevButtonProps,
164
+ onPress: t9
165
+ };
166
+ $[31] = prevButtonProps;
167
+ $[32] = t9;
168
+ $[33] = t10;
169
+ } else t10 = $[33];
170
+ const headerPrevButtonProps = t10;
171
+ let t11;
172
+ if ($[34] !== handleHeaderMonthNavigation || $[35] !== nextButtonProps) {
173
+ t11 = (event_0) => {
174
+ nextButtonProps.onPress?.(event_0);
76
175
  handleHeaderMonthNavigation(1);
77
- }
78
- };
79
- const onDateSelection = useCallback((date) => {
80
- if (!includesTime || !setDateValueOnDateSelection) return;
81
- datePickerState.setDateValue(date);
82
- }, [
83
- includesTime,
84
- datePickerState,
85
- setDateValueOnDateSelection
86
- ]);
87
- const handleDateChange = (selectedDate) => {
88
- const resolvedDate = selectedDate ?? props.state.focusedDate;
89
- if (includesTime && resolvedDate && setDateValueOnDateSelection) {
90
- datePickerState.setDateValue(resolvedDate);
91
- onDateSelectionChange?.(resolvedDate);
92
- }
93
- if (includesTime && toggleState !== "time") {
94
- setToggleState("time");
95
- return;
96
- }
97
- if (datePickerState?.value && !setDateValueOnDateSelection) onApply(resolvedDate);
98
- };
99
- const getContent = () => {
100
- if (!toggleState) {
101
- if (granularity === "month") return /* @__PURE__ */ jsx(MonthPicker, {
102
- state: props.state,
103
- onSelectionChange: onMonthSelectionChange,
104
- onDateChange: onMonthYearChange,
105
- onCommit: onMonthYearCommit,
106
- selectedDate
107
- });
108
- if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
109
- state: props.state,
110
- onSelectionChange: onYearSelectionChange,
111
- onDateChange: onMonthYearChange,
112
- onCommit: onMonthYearCommit,
113
- selectedDate
114
- });
115
- return /* @__PURE__ */ jsx(CalendarGrid, {
116
- state: props.state,
117
- onApply: handleDateChange,
118
- onDateSelection
119
- });
120
- }
121
- if (toggleState === "month") {
122
- if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
176
+ };
177
+ $[34] = handleHeaderMonthNavigation;
178
+ $[35] = nextButtonProps;
179
+ $[36] = t11;
180
+ } else t11 = $[36];
181
+ let t12;
182
+ if ($[37] !== nextButtonProps || $[38] !== t11) {
183
+ t12 = {
184
+ ...nextButtonProps,
185
+ onPress: t11
186
+ };
187
+ $[37] = nextButtonProps;
188
+ $[38] = t11;
189
+ $[39] = t12;
190
+ } else t12 = $[39];
191
+ const headerNextButtonProps = t12;
192
+ let t13;
193
+ if ($[40] !== datePickerState || $[41] !== includesTime || $[42] !== setDateValueOnDateSelection) {
194
+ t13 = (date) => {
195
+ if (!includesTime || !setDateValueOnDateSelection) return;
196
+ datePickerState.setDateValue(date);
197
+ };
198
+ $[40] = datePickerState;
199
+ $[41] = includesTime;
200
+ $[42] = setDateValueOnDateSelection;
201
+ $[43] = t13;
202
+ } else t13 = $[43];
203
+ const onDateSelection = t13;
204
+ let t14;
205
+ if ($[44] !== datePickerState || $[45] !== includesTime || $[46] !== onApply || $[47] !== onDateSelectionChange || $[48] !== props.state || $[49] !== setDateValueOnDateSelection || $[50] !== toggleState) {
206
+ t14 = (selectedDate_0) => {
207
+ const resolvedDate = selectedDate_0 ?? props.state.focusedDate;
208
+ if (includesTime && resolvedDate && setDateValueOnDateSelection) {
209
+ datePickerState.setDateValue(resolvedDate);
210
+ onDateSelectionChange?.(resolvedDate);
211
+ }
212
+ if (includesTime && toggleState !== "time") {
213
+ setToggleState("time");
214
+ return;
215
+ }
216
+ if (datePickerState?.value && !setDateValueOnDateSelection) onApply(resolvedDate);
217
+ };
218
+ $[44] = datePickerState;
219
+ $[45] = includesTime;
220
+ $[46] = onApply;
221
+ $[47] = onDateSelectionChange;
222
+ $[48] = props.state;
223
+ $[49] = setDateValueOnDateSelection;
224
+ $[50] = toggleState;
225
+ $[51] = t14;
226
+ } else t14 = $[51];
227
+ const handleDateChange = t14;
228
+ let t15;
229
+ if ($[52] !== datePickerState || $[53] !== granularity || $[54] !== handleDateChange || $[55] !== includesTime || $[56] !== onDateSelection || $[57] !== onMonthSelectionChange || $[58] !== onMonthYearChange || $[59] !== onMonthYearCommit || $[60] !== onYearSelectionChange || $[61] !== props.state || $[62] !== selectedDate || $[63] !== toggleState) {
230
+ t15 = () => {
231
+ if (!toggleState) {
232
+ if (granularity === "month") return /* @__PURE__ */ jsx(MonthPicker, {
233
+ state: props.state,
234
+ onSelectionChange: onMonthSelectionChange,
235
+ onDateChange: onMonthYearChange,
236
+ onCommit: onMonthYearCommit,
237
+ selectedDate
238
+ });
239
+ if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
240
+ state: props.state,
241
+ onSelectionChange: onYearSelectionChange,
242
+ onDateChange: onMonthYearChange,
243
+ onCommit: onMonthYearCommit,
244
+ selectedDate
245
+ });
246
+ return /* @__PURE__ */ jsx(CalendarGrid, {
247
+ state: props.state,
248
+ onApply: handleDateChange,
249
+ onDateSelection
250
+ });
251
+ }
252
+ if (toggleState === "month") {
253
+ if (granularity === "year") return /* @__PURE__ */ jsx(YearPicker, {
254
+ state: props.state,
255
+ onSelectionChange: onYearSelectionChange,
256
+ onDateChange: onMonthYearChange,
257
+ onCommit: onMonthYearCommit,
258
+ selectedDate
259
+ });
260
+ return /* @__PURE__ */ jsx(MonthPicker, {
261
+ state: props.state,
262
+ onSelectionChange: onMonthSelectionChange,
263
+ onDateChange: onMonthYearChange,
264
+ onCommit: onMonthYearCommit,
265
+ selectedDate
266
+ });
267
+ }
268
+ if (toggleState === "year") return /* @__PURE__ */ jsx(YearPicker, {
123
269
  state: props.state,
124
270
  onSelectionChange: onYearSelectionChange,
125
271
  onDateChange: onMonthYearChange,
126
272
  onCommit: onMonthYearCommit,
127
273
  selectedDate
128
274
  });
129
- return /* @__PURE__ */ jsx(MonthPicker, {
130
- state: props.state,
131
- onSelectionChange: onMonthSelectionChange,
132
- onDateChange: onMonthYearChange,
133
- onCommit: onMonthYearCommit,
134
- selectedDate
275
+ if (toggleState === "time" && includesTime) return /* @__PURE__ */ jsx("div", {
276
+ className: "flex h-72 w-80 items-center justify-center",
277
+ children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState })
135
278
  });
136
- }
137
- if (toggleState === "year") return /* @__PURE__ */ jsx(YearPicker, {
138
- state: props.state,
139
- onSelectionChange: onYearSelectionChange,
140
- onDateChange: onMonthYearChange,
141
- onCommit: onMonthYearCommit,
142
- selectedDate
143
- });
144
- if (toggleState === "time" && includesTime) return /* @__PURE__ */ jsx("div", {
145
- className: "flex h-72 w-80 items-center justify-center",
146
- children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState })
147
- });
148
- return null;
149
- };
150
- return /* @__PURE__ */ jsxs("div", {
151
- ...calendarProps,
152
- className: clsx("flex min-h-0 w-full flex-col items-center", className),
153
- children: [/* @__PURE__ */ jsx(CalendarHeader, {
279
+ return null;
280
+ };
281
+ $[52] = datePickerState;
282
+ $[53] = granularity;
283
+ $[54] = handleDateChange;
284
+ $[55] = includesTime;
285
+ $[56] = onDateSelection;
286
+ $[57] = onMonthSelectionChange;
287
+ $[58] = onMonthYearChange;
288
+ $[59] = onMonthYearCommit;
289
+ $[60] = onYearSelectionChange;
290
+ $[61] = props.state;
291
+ $[62] = selectedDate;
292
+ $[63] = toggleState;
293
+ $[64] = t15;
294
+ } else t15 = $[64];
295
+ const getContent = t15;
296
+ let t16;
297
+ if ($[65] !== className) {
298
+ t16 = clsx("flex min-h-0 w-full flex-col items-center", className);
299
+ $[65] = className;
300
+ $[66] = t16;
301
+ } else t16 = $[66];
302
+ let t17;
303
+ if ($[67] !== datePickerState || $[68] !== granularity || $[69] !== headerNextButtonProps || $[70] !== headerPrevButtonProps || $[71] !== hourCycle || $[72] !== includesTime || $[73] !== props.state || $[74] !== toggleState) {
304
+ t17 = /* @__PURE__ */ jsx(CalendarHeader, {
154
305
  calendarState: props.state,
155
306
  datePickerState,
156
307
  prevButtonProps: headerPrevButtonProps,
@@ -160,11 +311,54 @@ var Calendar = ({ className, includesTime, datePickerState, hourCycle, onApply,
160
311
  granularity,
161
312
  toggleState,
162
313
  setToggleState
163
- }), /* @__PURE__ */ jsx("div", {
164
- className: clsx("flex min-h-0 w-full flex-1 flex-col items-center", toggleState !== "year" && "pb-8 md:pb-0"),
165
- children: getContent()
166
- })]
167
- });
314
+ });
315
+ $[67] = datePickerState;
316
+ $[68] = granularity;
317
+ $[69] = headerNextButtonProps;
318
+ $[70] = headerPrevButtonProps;
319
+ $[71] = hourCycle;
320
+ $[72] = includesTime;
321
+ $[73] = props.state;
322
+ $[74] = toggleState;
323
+ $[75] = t17;
324
+ } else t17 = $[75];
325
+ const t18 = toggleState !== "year" && "pb-8 md:pb-0";
326
+ let t19;
327
+ if ($[76] !== t18) {
328
+ t19 = clsx("flex min-h-0 w-full flex-1 flex-col items-center", t18);
329
+ $[76] = t18;
330
+ $[77] = t19;
331
+ } else t19 = $[77];
332
+ let t20;
333
+ if ($[78] !== getContent) {
334
+ t20 = getContent();
335
+ $[78] = getContent;
336
+ $[79] = t20;
337
+ } else t20 = $[79];
338
+ let t21;
339
+ if ($[80] !== t19 || $[81] !== t20) {
340
+ t21 = /* @__PURE__ */ jsx("div", {
341
+ className: t19,
342
+ children: t20
343
+ });
344
+ $[80] = t19;
345
+ $[81] = t20;
346
+ $[82] = t21;
347
+ } else t21 = $[82];
348
+ let t22;
349
+ if ($[83] !== calendarProps || $[84] !== t16 || $[85] !== t17 || $[86] !== t21) {
350
+ t22 = /* @__PURE__ */ jsxs("div", {
351
+ ...calendarProps,
352
+ className: t16,
353
+ children: [t17, t21]
354
+ });
355
+ $[83] = calendarProps;
356
+ $[84] = t16;
357
+ $[85] = t17;
358
+ $[86] = t21;
359
+ $[87] = t22;
360
+ } else t22 = $[87];
361
+ return t22;
168
362
  };
169
363
  //#endregion
170
364
  export { Calendar };