@povio/ui 2.3.0-rc.5 → 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 (195) 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 +16 -12
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -107
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +17 -13
  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 +321 -77
  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/Autocomplete.js +9 -3
  113. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  114. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  115. package/dist/components/inputs/Selection/Select/Select.js +9 -3
  116. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  117. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  118. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  119. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  120. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  121. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  122. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  123. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  124. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  125. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  126. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  127. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  128. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  129. package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
  130. package/dist/components/inputs/Skeleton/InputFrame.js +444 -116
  131. package/dist/components/inputs/Slider/Slider.js +247 -74
  132. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  133. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  134. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  135. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  136. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  137. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  138. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  139. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  140. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  141. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  142. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  143. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  144. package/dist/components/inputs/shared/CheckContent.js +21 -10
  145. package/dist/components/inputs/shared/InputClear.js +78 -21
  146. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  147. package/dist/components/inputs/shared/input.cva.js +13 -3
  148. package/dist/components/inputs/shared/useStaticInputHandoff.js +97 -39
  149. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  150. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  151. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  152. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  153. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  154. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  155. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  156. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  157. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  158. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  159. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  160. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  161. package/dist/components/segment/Segment.js +218 -57
  162. package/dist/components/segment/SegmentItem.js +67 -10
  163. package/dist/components/shared/pagination/Pagination.js +108 -22
  164. package/dist/components/shared/pagination/PaginationList.js +167 -64
  165. package/dist/components/status/Alert/Alert.js +97 -30
  166. package/dist/components/status/Loader/Loader.js +77 -22
  167. package/dist/components/status/Toast/Toast.js +21 -13
  168. package/dist/components/status/Toast/useToast.js +62 -57
  169. package/dist/components/table/ColumnConfig.js +158 -54
  170. package/dist/components/table/InfiniteTable.js +67 -16
  171. package/dist/components/table/PaginatedTable.js +84 -18
  172. package/dist/components/table/Table.js +23 -23
  173. package/dist/components/text/Link/Link.js +19 -7
  174. package/dist/components/text/Typography/Typography.js +23 -8
  175. package/dist/config/confirmation.context.js +1 -1
  176. package/dist/config/link.context.js +23 -9
  177. package/dist/config/router.context.js +42 -16
  178. package/dist/config/theme.context.js +98 -45
  179. package/dist/config/uiConfig.context.js +39 -8
  180. package/dist/config/uiStyle.context.js +15 -5
  181. package/dist/hooks/useBreakpoint.js +16 -3
  182. package/dist/hooks/useDebounceCallback.js +51 -17
  183. package/dist/hooks/useFilters.js +125 -64
  184. package/dist/hooks/useForm.js +42 -8
  185. package/dist/hooks/useFormAutosave.js +101 -30
  186. package/dist/hooks/useIntersectionObserver.js +86 -32
  187. package/dist/hooks/useLocalStorage.js +43 -10
  188. package/dist/hooks/useLongPressRepeat.js +55 -20
  189. package/dist/hooks/usePagination.js +49 -19
  190. package/dist/hooks/useScrollableListBox.js +37 -16
  191. package/dist/hooks/useSorting.js +69 -28
  192. package/dist/hooks/useStateAndRef.js +21 -7
  193. package/dist/hooks/useTableColumnConfig.js +124 -31
  194. package/dist/hooks/useTranslationMemo.js +25 -5
  195. package/package.json +1 -1
@@ -1,21 +1,33 @@
1
1
  import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { LinkContext } from "../../../config/link.context.js";
3
3
  import { link } from "./link.cva.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  import { Link } from "react-aria-components";
6
7
  //#region src/components/text/Link/Link.tsx
7
- var Link$1 = ({ variant, ...props }) => {
8
+ var Link$1 = (t0) => {
9
+ const $ = c(4);
10
+ const { variant, ...props } = t0;
8
11
  const linkContext = LinkContext.useLinkContext();
9
12
  const linkCva = UIStyle.useCva("link.cva", link);
10
13
  const LinkComponent = linkContext?.LinkComponent ?? Link;
11
14
  if (!props.to && props.href) props.to = props.href;
12
- return /* @__PURE__ */ jsx(LinkComponent, {
13
- ...props,
14
- className: linkCva({
15
- variant,
16
- className: props.className
17
- })
15
+ const t1 = linkCva({
16
+ variant,
17
+ className: props.className
18
18
  });
19
+ let t2;
20
+ if ($[0] !== LinkComponent || $[1] !== props || $[2] !== t1) {
21
+ t2 = /* @__PURE__ */ jsx(LinkComponent, {
22
+ ...props,
23
+ className: t1
24
+ });
25
+ $[0] = LinkComponent;
26
+ $[1] = props;
27
+ $[2] = t1;
28
+ $[3] = t2;
29
+ } else t2 = $[3];
30
+ return t2;
19
31
  };
20
32
  //#endregion
21
33
  export { Link$1 as Link };
@@ -1,16 +1,31 @@
1
1
  import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { typography } from "./typography.cva.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/components/text/Typography/Typography.tsx
5
- var Typography = ({ as = "p", className, ...props }) => {
6
- return /* @__PURE__ */ jsx(as, {
7
- className: UIStyle.useCva("typography.cva", typography)({
8
- ...props,
9
- sizeMobile: props.sizeMobile ?? props.size,
10
- className
11
- }),
12
- ...props
6
+ var Typography = (t0) => {
7
+ const $ = c(4);
8
+ const { as: t1, className, ...props } = t0;
9
+ const as = t1 === void 0 ? "p" : t1;
10
+ const typographyCva = UIStyle.useCva("typography.cva", typography);
11
+ const Tag = as;
12
+ const t2 = typographyCva({
13
+ ...props,
14
+ sizeMobile: props.sizeMobile ?? props.size,
15
+ className
13
16
  });
17
+ let t3;
18
+ if ($[0] !== Tag || $[1] !== props || $[2] !== t2) {
19
+ t3 = /* @__PURE__ */ jsx(Tag, {
20
+ className: t2,
21
+ ...props
22
+ });
23
+ $[0] = Tag;
24
+ $[1] = props;
25
+ $[2] = t2;
26
+ $[3] = t3;
27
+ } else t3 = $[3];
28
+ return t3;
14
29
  };
15
30
  //#endregion
16
31
  export { Typography };
@@ -24,7 +24,7 @@ var Confirmation;
24
24
  const [state, setState] = useState(DEFAULT_STATE);
25
25
  const { t } = useTranslation("ui");
26
26
  const onCancel = () => setState(DEFAULT_STATE);
27
- const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($) => $.ui.confirmation.confirm), confirmVariant, confirmColor, cancelVariant, cancelColor }) => {
27
+ const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($_0) => $_0.ui.confirmation.confirm), confirmVariant, confirmColor, cancelVariant, cancelColor }) => {
28
28
  return new Promise((resolve) => {
29
29
  setState({
30
30
  heading,
@@ -1,17 +1,31 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { jsx } from "react/jsx-runtime";
2
- import { createContext, use, useMemo } from "react";
3
+ import { createContext, use } from "react";
3
4
  //#region src/config/link.context.tsx
4
5
  var LinkContext;
5
6
  (function(_LinkContext) {
6
7
  const LinkContextInternal = createContext(null);
7
- _LinkContext.LinkContextProvider = ({ children, LinkComponent }) => {
8
- const value = useMemo(() => {
9
- return { LinkComponent };
10
- }, [LinkComponent]);
11
- return /* @__PURE__ */ jsx(LinkContextInternal.Provider, {
12
- value,
13
- children
14
- });
8
+ _LinkContext.LinkContextProvider = (t0) => {
9
+ const $ = c(5);
10
+ const { children, LinkComponent } = t0;
11
+ let t1;
12
+ if ($[0] !== LinkComponent) {
13
+ t1 = { LinkComponent };
14
+ $[0] = LinkComponent;
15
+ $[1] = t1;
16
+ } else t1 = $[1];
17
+ const value = t1;
18
+ let t2;
19
+ if ($[2] !== children || $[3] !== value) {
20
+ t2 = /* @__PURE__ */ jsx(LinkContextInternal.Provider, {
21
+ value,
22
+ children
23
+ });
24
+ $[2] = children;
25
+ $[3] = value;
26
+ $[4] = t2;
27
+ } else t2 = $[4];
28
+ return t2;
15
29
  };
16
30
  _LinkContext.useLinkContext = () => {
17
31
  return use(LinkContextInternal);
@@ -1,31 +1,57 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { jsx } from "react/jsx-runtime";
2
- import { createContext, use, useMemo } from "react";
3
+ import { createContext, use } from "react";
3
4
  import { RouterProvider } from "react-aria";
4
5
  //#region src/config/router.context.tsx
5
6
  var UIRouter;
6
7
  (function(_UIRouter) {
7
8
  const UIRouterContext = createContext(null);
8
- _UIRouter.UIRouterProvider = ({ children, push, replace, searchString }) => {
9
- const searchParams = useMemo(() => {
10
- return new URLSearchParams(searchString);
11
- }, [searchString]);
12
- return /* @__PURE__ */ jsx(UIRouterContext, {
13
- value: useMemo(() => ({
9
+ _UIRouter.UIRouterProvider = (t0) => {
10
+ const $ = c(13);
11
+ const { children, push, replace, searchString } = t0;
12
+ let t1;
13
+ if ($[0] !== searchString) {
14
+ t1 = new URLSearchParams(searchString);
15
+ $[0] = searchString;
16
+ $[1] = t1;
17
+ } else t1 = $[1];
18
+ const searchParams = t1;
19
+ let t2;
20
+ if ($[2] !== push || $[3] !== replace || $[4] !== searchParams || $[5] !== searchString) {
21
+ t2 = {
14
22
  searchParams,
15
23
  push,
16
24
  searchString,
17
25
  replace
18
- }), [
19
- searchParams,
20
- push,
21
- searchString,
22
- replace
23
- ]),
24
- children: /* @__PURE__ */ jsx(RouterProvider, {
26
+ };
27
+ $[2] = push;
28
+ $[3] = replace;
29
+ $[4] = searchParams;
30
+ $[5] = searchString;
31
+ $[6] = t2;
32
+ } else t2 = $[6];
33
+ const value = t2;
34
+ let t3;
35
+ if ($[7] !== children || $[8] !== push) {
36
+ t3 = /* @__PURE__ */ jsx(RouterProvider, {
25
37
  navigate: push,
26
38
  children
27
- })
28
- });
39
+ });
40
+ $[7] = children;
41
+ $[8] = push;
42
+ $[9] = t3;
43
+ } else t3 = $[9];
44
+ let t4;
45
+ if ($[10] !== t3 || $[11] !== value) {
46
+ t4 = /* @__PURE__ */ jsx(UIRouterContext, {
47
+ value,
48
+ children: t3
49
+ });
50
+ $[10] = t3;
51
+ $[11] = value;
52
+ $[12] = t4;
53
+ } else t4 = $[12];
54
+ return t4;
29
55
  };
30
56
  _UIRouter.useUIRouter = () => {
31
57
  const context = use(UIRouterContext);
@@ -1,6 +1,7 @@
1
1
  import { useLocalStorage } from "../hooks/useLocalStorage.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { jsx } from "react/jsx-runtime";
3
- import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
4
+ import { createContext, use, useEffect, useState } from "react";
4
5
  import { z } from "zod";
5
6
  //#region src/config/theme.context.tsx
6
7
  var ThemeContext;
@@ -12,56 +13,108 @@ var ThemeContext;
12
13
  "system"
13
14
  ]);
14
15
  const ThemeContext = createContext(null);
15
- _ThemeContext.ThemeContextProvider = ({ children, storageKey = DEFAULT_STORAGE_KEY }) => {
16
- const [systemTheme, setSystemTheme] = useState(() => {
17
- if (typeof window === "undefined") return;
18
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
19
- });
20
- const { value: theme, set } = useLocalStorage({
21
- key: storageKey,
22
- schema: ThemeSchema
23
- });
24
- const updateTheme = useCallback((theme) => {
25
- set(theme);
26
- }, [set]);
27
- useEffect(() => {
28
- if (typeof window === "undefined") return;
29
- const onChange = (event) => {
30
- setSystemTheme(event.matches ? "dark" : "light");
16
+ _ThemeContext.ThemeContextProvider = (t0) => {
17
+ const $ = c(17);
18
+ const { children, storageKey: t1 } = t0;
19
+ const storageKey = t1 === void 0 ? DEFAULT_STORAGE_KEY : t1;
20
+ const [systemTheme, setSystemTheme] = useState(_temp);
21
+ let t2;
22
+ if ($[0] !== storageKey) {
23
+ t2 = {
24
+ key: storageKey,
25
+ schema: ThemeSchema
31
26
  };
32
- const media = window.matchMedia("(prefers-color-scheme: dark)");
33
- media.addEventListener("change", onChange);
34
- return () => {
35
- media.removeEventListener("change", onChange);
27
+ $[0] = storageKey;
28
+ $[1] = t2;
29
+ } else t2 = $[1];
30
+ const { value: theme, set } = useLocalStorage(t2);
31
+ let t3;
32
+ if ($[2] !== set) {
33
+ t3 = (theme_0) => {
34
+ set(theme_0);
36
35
  };
37
- }, []);
38
- useEffect(() => {
39
- document.documentElement.classList.remove("dark");
40
- if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
41
- document.documentElement.classList.add("dark");
42
- document.documentElement.style.colorScheme = "dark";
43
- } else if (theme === "light") {
44
- document.documentElement.classList.add("light");
45
- document.documentElement.style.colorScheme = "light";
46
- } else document.documentElement.style.colorScheme = "light";
47
- }, [theme, systemTheme]);
48
- const contextValue = useMemo(() => ({
49
- theme: theme ?? "system",
50
- systemTheme,
51
- updateTheme
52
- }), [
53
- theme,
54
- systemTheme,
55
- updateTheme
56
- ]);
57
- return /* @__PURE__ */ jsx(ThemeContext.Provider, {
58
- value: contextValue,
59
- children
60
- });
36
+ $[2] = set;
37
+ $[3] = t3;
38
+ } else t3 = $[3];
39
+ const updateTheme = t3;
40
+ let t4;
41
+ let t5;
42
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
43
+ t4 = () => {
44
+ if (typeof window === "undefined") return;
45
+ const onChange = (event) => {
46
+ setSystemTheme(event.matches ? "dark" : "light");
47
+ };
48
+ const media_0 = window.matchMedia("(prefers-color-scheme: dark)");
49
+ media_0.addEventListener("change", onChange);
50
+ return () => {
51
+ media_0.removeEventListener("change", onChange);
52
+ };
53
+ };
54
+ t5 = [];
55
+ $[4] = t4;
56
+ $[5] = t5;
57
+ } else {
58
+ t4 = $[4];
59
+ t5 = $[5];
60
+ }
61
+ useEffect(t4, t5);
62
+ let t6;
63
+ let t7;
64
+ if ($[6] !== systemTheme || $[7] !== theme) {
65
+ t6 = () => {
66
+ document.documentElement.classList.remove("dark");
67
+ if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
68
+ document.documentElement.classList.add("dark");
69
+ document.documentElement.style.colorScheme = "dark";
70
+ } else if (theme === "light") {
71
+ document.documentElement.classList.add("light");
72
+ document.documentElement.style.colorScheme = "light";
73
+ } else document.documentElement.style.colorScheme = "light";
74
+ };
75
+ t7 = [theme, systemTheme];
76
+ $[6] = systemTheme;
77
+ $[7] = theme;
78
+ $[8] = t6;
79
+ $[9] = t7;
80
+ } else {
81
+ t6 = $[8];
82
+ t7 = $[9];
83
+ }
84
+ useEffect(t6, t7);
85
+ const t8 = theme ?? "system";
86
+ let t9;
87
+ if ($[10] !== systemTheme || $[11] !== t8 || $[12] !== updateTheme) {
88
+ t9 = {
89
+ theme: t8,
90
+ systemTheme,
91
+ updateTheme
92
+ };
93
+ $[10] = systemTheme;
94
+ $[11] = t8;
95
+ $[12] = updateTheme;
96
+ $[13] = t9;
97
+ } else t9 = $[13];
98
+ const contextValue = t9;
99
+ let t10;
100
+ if ($[14] !== children || $[15] !== contextValue) {
101
+ t10 = /* @__PURE__ */ jsx(ThemeContext.Provider, {
102
+ value: contextValue,
103
+ children
104
+ });
105
+ $[14] = children;
106
+ $[15] = contextValue;
107
+ $[16] = t10;
108
+ } else t10 = $[16];
109
+ return t10;
61
110
  };
62
111
  _ThemeContext.useTheme = () => {
63
112
  return use(ThemeContext);
64
113
  };
65
114
  })(ThemeContext || (ThemeContext = {}));
115
+ function _temp() {
116
+ if (typeof window === "undefined") return;
117
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
118
+ }
66
119
  //#endregion
67
120
  export { ThemeContext };
@@ -3,6 +3,7 @@ import { ClockIcon } from "../assets/icons/Clock.js";
3
3
  import { DateTimeIcon } from "../assets/icons/DateTime.js";
4
4
  import { ObjectUtils } from "../utils/object.utils.js";
5
5
  import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
6
+ import { c } from "react/compiler-runtime";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { createContext, use } from "react";
8
9
  //#region src/config/uiConfig.context.tsx
@@ -90,15 +91,42 @@ var UIConfig;
90
91
  toast: { variant: "outlined" }
91
92
  };
92
93
  const Context = createContext(DEFAULT_CONFIG);
93
- _UIConfig.Provider = ({ config = {}, children }) => {
94
+ _UIConfig.Provider = (t0) => {
95
+ const $ = c(9);
96
+ const { config: t1, children } = t0;
97
+ let t2;
98
+ if ($[0] !== t1) {
99
+ t2 = t1 === void 0 ? {} : t1;
100
+ $[0] = t1;
101
+ $[1] = t2;
102
+ } else t2 = $[1];
103
+ const config = t2;
94
104
  const parentConfig = use(Context) || DEFAULT_CONFIG;
95
- const value = useDeepCompareMemo(() => {
96
- return ObjectUtils.deepConditionalMerge(parentConfig, config, (val) => val !== null && val !== void 0);
97
- }, [config, parentConfig]);
98
- return /* @__PURE__ */ jsx(Context.Provider, {
99
- value,
100
- children
101
- });
105
+ let t3;
106
+ let t4;
107
+ if ($[2] !== config || $[3] !== parentConfig) {
108
+ t3 = () => ObjectUtils.deepConditionalMerge(parentConfig, config, _temp);
109
+ t4 = [config, parentConfig];
110
+ $[2] = config;
111
+ $[3] = parentConfig;
112
+ $[4] = t3;
113
+ $[5] = t4;
114
+ } else {
115
+ t3 = $[4];
116
+ t4 = $[5];
117
+ }
118
+ const value = useDeepCompareMemo(t3, t4);
119
+ let t5;
120
+ if ($[6] !== children || $[7] !== value) {
121
+ t5 = /* @__PURE__ */ jsx(Context.Provider, {
122
+ value,
123
+ children
124
+ });
125
+ $[6] = children;
126
+ $[7] = value;
127
+ $[8] = t5;
128
+ } else t5 = $[8];
129
+ return t5;
102
130
  };
103
131
  _UIConfig.useConfig = () => {
104
132
  const context = use(Context);
@@ -106,5 +134,8 @@ var UIConfig;
106
134
  return context;
107
135
  };
108
136
  })(UIConfig || (UIConfig = {}));
137
+ function _temp(val) {
138
+ return val !== null && val !== void 0;
139
+ }
109
140
  //#endregion
110
141
  export { UIConfig };
@@ -1,14 +1,24 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { createContext, use } from "react";
3
4
  //#region src/config/uiStyle.context.tsx
4
5
  var UIStyle;
5
6
  (function(_UIStyle) {
6
7
  const Context = createContext(null);
7
- _UIStyle.Provider = ({ children, config }) => {
8
- return /* @__PURE__ */ jsx(Context.Provider, {
9
- value: config,
10
- children
11
- });
8
+ _UIStyle.Provider = (t0) => {
9
+ const $ = c(3);
10
+ const { children, config } = t0;
11
+ let t1;
12
+ if ($[0] !== children || $[1] !== config) {
13
+ t1 = /* @__PURE__ */ jsx(Context.Provider, {
14
+ value: config,
15
+ children
16
+ });
17
+ $[0] = children;
18
+ $[1] = config;
19
+ $[2] = t1;
20
+ } else t1 = $[2];
21
+ return t1;
12
22
  };
13
23
  const useConfig = () => {
14
24
  return use(Context);
@@ -1,4 +1,4 @@
1
- import { useMemo } from "react";
1
+ import { c } from "react/compiler-runtime";
2
2
  import { useMediaQuery } from "react-responsive";
3
3
  //#region src/hooks/useBreakpoint.ts
4
4
  var breakpoints = null;
@@ -22,9 +22,22 @@ function getBreakpoints() {
22
22
  return breakpoints;
23
23
  }
24
24
  function useBreakpoint(breakpointKey) {
25
- const breakpoints = useMemo(() => getBreakpoints(), []);
25
+ const $ = c(3);
26
+ let t0;
27
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28
+ t0 = getBreakpoints();
29
+ $[0] = t0;
30
+ } else t0 = $[0];
31
+ const breakpoints = t0;
26
32
  if (!breakpoints) throw new Error("Tailwind config is missing theme.screens");
27
- return useMediaQuery({ query: `(min-width: ${breakpoints[breakpointKey]})` });
33
+ const t1 = `(min-width: ${breakpoints[breakpointKey]})`;
34
+ let t2;
35
+ if ($[1] !== t1) {
36
+ t2 = { query: t1 };
37
+ $[1] = t1;
38
+ $[2] = t2;
39
+ } else t2 = $[2];
40
+ return useMediaQuery(t2);
28
41
  }
29
42
  //#endregion
30
43
  export { useBreakpoint };
@@ -1,25 +1,59 @@
1
- import { useCallback, useEffect, useRef, useState } from "react";
1
+ import { c } from "react/compiler-runtime";
2
+ import { useEffect, useRef, useState } from "react";
2
3
  //#region src/hooks/useDebounceCallback.ts
3
- function useDebounceCallback(callback, { delay = 500 } = {}) {
4
+ function useDebounceCallback(callback, t0) {
5
+ const $ = c(10);
6
+ let t1;
7
+ if ($[0] !== t0) {
8
+ t1 = t0 === void 0 ? {} : t0;
9
+ $[0] = t0;
10
+ $[1] = t1;
11
+ } else t1 = $[1];
12
+ const { delay: t2 } = t1;
13
+ const delay = t2 === void 0 ? 500 : t2;
4
14
  const timeoutRef = useRef(null);
5
15
  const [isDebouncing, setIsDebouncing] = useState(false);
6
- const debouncedCallback = useCallback((...args) => {
7
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
8
- setIsDebouncing(true);
9
- timeoutRef.current = setTimeout(() => {
10
- setIsDebouncing(false);
11
- callback?.(...args);
12
- }, delay);
13
- }, [callback, delay]);
14
- useEffect(() => {
15
- return () => {
16
+ let t3;
17
+ if ($[2] !== callback || $[3] !== delay) {
18
+ t3 = (...t4) => {
19
+ const args = t4;
16
20
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
21
+ setIsDebouncing(true);
22
+ timeoutRef.current = setTimeout(() => {
23
+ setIsDebouncing(false);
24
+ callback?.(...args);
25
+ }, delay);
17
26
  };
18
- }, []);
19
- return {
20
- callback: debouncedCallback,
21
- isDebouncing
22
- };
27
+ $[2] = callback;
28
+ $[3] = delay;
29
+ $[4] = t3;
30
+ } else t3 = $[4];
31
+ const debouncedCallback = t3;
32
+ let t4;
33
+ let t5;
34
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
35
+ t4 = () => () => {
36
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
37
+ };
38
+ t5 = [];
39
+ $[5] = t4;
40
+ $[6] = t5;
41
+ } else {
42
+ t4 = $[5];
43
+ t5 = $[6];
44
+ }
45
+ useEffect(t4, t5);
46
+ let t6;
47
+ if ($[7] !== debouncedCallback || $[8] !== isDebouncing) {
48
+ t6 = {
49
+ callback: debouncedCallback,
50
+ isDebouncing
51
+ };
52
+ $[7] = debouncedCallback;
53
+ $[8] = isDebouncing;
54
+ $[9] = t6;
55
+ } else t6 = $[9];
56
+ return t6;
23
57
  }
24
58
  //#endregion
25
59
  export { useDebounceCallback };