@zydon/common 2.9.21 → 2.9.23

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 (141) hide show
  1. package/dist/chunk-4734QSYC.js +46 -0
  2. package/dist/chunk-4734QSYC.js.map +1 -0
  3. package/dist/chunk-5KEVIB7P.js +7 -0
  4. package/dist/chunk-5KEVIB7P.js.map +1 -0
  5. package/dist/{chunk-XO2DW5UL.js → chunk-6L44C7QM.js} +2 -2
  6. package/dist/{chunk-Q2AVS24Z.js → chunk-7GJMLPJV.js} +3 -3
  7. package/dist/{chunk-Y5W727NP.js → chunk-7IE367Y6.js} +2 -2
  8. package/dist/{chunk-UJMWTYPH.js → chunk-A7AOWJKX.js} +2 -2
  9. package/dist/{chunk-X4F3O7PX.js → chunk-BKL525ZD.js} +3 -3
  10. package/dist/{chunk-WLRSUL67.js → chunk-E5SBGF5G.js} +2 -2
  11. package/dist/chunk-GTPEQ3CM.js +8 -0
  12. package/dist/chunk-GTPEQ3CM.js.map +1 -0
  13. package/dist/chunk-HFDGIEZC.js +7 -0
  14. package/dist/chunk-HFDGIEZC.js.map +1 -0
  15. package/dist/{chunk-I3B772WD.js → chunk-HW6M33F3.js} +2 -2
  16. package/dist/{chunk-LZQ7OFKO.js → chunk-JUAHRU5E.js} +2 -2
  17. package/dist/{chunk-YXRL4O4H.js → chunk-P2QZJ57W.js} +2 -2
  18. package/dist/{chunk-YXRL4O4H.js.map → chunk-P2QZJ57W.js.map} +1 -1
  19. package/dist/{chunk-7LBBLVDC.js → chunk-PUMCHXCD.js} +2 -2
  20. package/dist/{chunk-TGDOTL22.js → chunk-PVVI3GEL.js} +3 -3
  21. package/dist/{chunk-F7RZH6OK.js → chunk-RU3QT4Q3.js} +2 -2
  22. package/dist/chunk-SV2GIIMQ.js +6 -0
  23. package/dist/chunk-SV2GIIMQ.js.map +1 -0
  24. package/dist/{chunk-JM3SE72J.js → chunk-TAA5KCEG.js} +5 -5
  25. package/dist/chunk-TXJ45CNA.js +7 -0
  26. package/dist/chunk-TXJ45CNA.js.map +1 -0
  27. package/dist/{chunk-YDU3ZCS7.js → chunk-UE7W6ACG.js} +2 -2
  28. package/dist/{chunk-HJPMWQB2.js → chunk-ULVPJ2DF.js} +3 -3
  29. package/dist/{chunk-T3RP2QXG.js → chunk-XUD7JMEF.js} +2 -2
  30. package/dist/{chunk-GLRLKFPS.js → chunk-Y66XXBB3.js} +6 -4
  31. package/dist/chunk-Y66XXBB3.js.map +1 -0
  32. package/dist/{chunk-BVPBGV4Y.js → chunk-ZMXVWURR.js} +2 -2
  33. package/dist/components/Analytics/OverviewAnalytics/index.js +6 -6
  34. package/dist/components/Analytics/PartnerAnalysis/index.js +5 -5
  35. package/dist/components/Analytics/index.js +1 -1
  36. package/dist/components/AutocompleteDetailed/index.js +2 -2
  37. package/dist/components/Avatar/index.d.ts +1 -1
  38. package/dist/components/AvatarButton/index.js +7 -7
  39. package/dist/components/Common/index.js +5 -5
  40. package/dist/components/CopyButton/index.js +2 -2
  41. package/dist/components/DataCards/index.js +2 -2
  42. package/dist/components/DataGrid/index.js +3 -3
  43. package/dist/components/DataView/index.d.ts +1 -1
  44. package/dist/components/DataView/index.js +5 -5
  45. package/dist/components/DynamicDataView/index.js +9 -9
  46. package/dist/components/EasyCropModal/index.js +2 -2
  47. package/dist/components/EmptyContent/index.js +2 -2
  48. package/dist/components/FileUpload/index.js +4 -4
  49. package/dist/components/Filters/index.js +1 -1
  50. package/dist/components/Label/index.js +2 -2
  51. package/dist/components/ListBundles/index.js +2 -2
  52. package/dist/components/ResponsivePopover/index.js +2 -2
  53. package/dist/components/SeoPreview/index.js +2 -2
  54. package/dist/components/SplashScreen/index.js +1 -1
  55. package/dist/components/StepUpDialog/index.js +1 -1
  56. package/dist/components/TextMaxLine/index.js +2 -2
  57. package/dist/components/ToggleTheme/index.js +7 -7
  58. package/dist/components/WebhookCard/index.js +2 -2
  59. package/dist/components/animate/index.js +2 -2
  60. package/dist/components/carousel/index.js +2 -2
  61. package/dist/components/form/Address/index.js +1 -1
  62. package/dist/components/form/AutocompleteDetailed/index.js +2 -2
  63. package/dist/components/form/Field/index.js +1 -1
  64. package/dist/components/form/FileUpload/index.js +4 -4
  65. package/dist/components/form/Password/index.js +2 -2
  66. package/dist/components/form/Password/index.js.map +1 -1
  67. package/dist/components/form/Webhook/index.js +1 -1
  68. package/dist/hooks/useCopyToClipboard.d.ts +1 -0
  69. package/dist/hooks/useCopyToClipboard.js +1 -1
  70. package/dist/hooks/useDatagrid.d.ts +1 -0
  71. package/dist/hooks/useDatagrid.js +1 -1
  72. package/dist/hooks/useDynamicAutocomplete.d.ts +1 -0
  73. package/dist/hooks/useDynamicAutocomplete.js +1 -1
  74. package/dist/hooks/useDynamicAutocomplete.js.map +1 -1
  75. package/dist/hooks/useFiltersSearchParams.d.ts +2 -1
  76. package/dist/hooks/useFiltersSearchParams.js +2 -2
  77. package/dist/hooks/useFiltersSearchParams.js.map +1 -1
  78. package/dist/hooks/useInfiniteScroll.d.ts +1 -0
  79. package/dist/hooks/useInfiniteScroll.js +2 -2
  80. package/dist/hooks/useInfiniteScroll.js.map +1 -1
  81. package/dist/hooks/useLocalStorage.d.ts +6 -5
  82. package/dist/hooks/useLocalStorage.js +1 -1
  83. package/dist/hooks/useOnClickOutside.d.ts +1 -0
  84. package/dist/hooks/useOnClickOutside.js +2 -2
  85. package/dist/hooks/useOnClickOutside.js.map +1 -1
  86. package/dist/hooks/usePagination.d.ts +1 -0
  87. package/dist/hooks/usePagination.js +2 -2
  88. package/dist/hooks/usePagination.js.map +1 -1
  89. package/dist/hooks/useReconciliation.d.ts +1 -0
  90. package/dist/hooks/useReconciliation.js +2 -2
  91. package/dist/hooks/useReconciliation.js.map +1 -1
  92. package/dist/hooks/useResponsive.d.ts +1 -0
  93. package/dist/hooks/useResponsive.js +1 -1
  94. package/dist/hooks/useScrollOffSetTop.d.ts +1 -0
  95. package/dist/hooks/useScrollOffSetTop.js +1 -1
  96. package/dist/hooks/useScrollOffSetTop.js.map +1 -1
  97. package/dist/hooks/useSnackbar.d.ts +1 -1
  98. package/dist/hooks/useThemeToggle.d.ts +1 -0
  99. package/dist/hooks/useThemeToggle.js +6 -6
  100. package/dist/hooks/useUploadImage.d.ts +1 -0
  101. package/dist/hooks/useUploadImage.js +2 -2
  102. package/dist/hooks/useUploadImage.js.map +1 -1
  103. package/dist/index.d.ts +3 -3
  104. package/dist/index.js +6 -6
  105. package/dist/theme/core/index.d.ts +1 -1
  106. package/dist/theme/core/index.js +3 -3
  107. package/dist/theme/styles/index.d.ts +15 -14
  108. package/dist/theme/styles/index.js +1 -1
  109. package/dist/theme/theme-provider.js +5 -5
  110. package/dist/theme/with-settings/index.js +3 -3
  111. package/package.json +1 -1
  112. package/dist/chunk-2HAPOY5M.js +0 -8
  113. package/dist/chunk-2HAPOY5M.js.map +0 -1
  114. package/dist/chunk-2ZJUGM2S.js +0 -7
  115. package/dist/chunk-2ZJUGM2S.js.map +0 -1
  116. package/dist/chunk-CFNATBO2.js +0 -6
  117. package/dist/chunk-CFNATBO2.js.map +0 -1
  118. package/dist/chunk-GLRLKFPS.js.map +0 -1
  119. package/dist/chunk-RMYYQLRJ.js +0 -7
  120. package/dist/chunk-RMYYQLRJ.js.map +0 -1
  121. package/dist/chunk-U4I7JPER.js +0 -7
  122. package/dist/chunk-U4I7JPER.js.map +0 -1
  123. package/dist/chunk-YPL4KIKN.js +0 -46
  124. package/dist/chunk-YPL4KIKN.js.map +0 -1
  125. package/dist/{chunk-XO2DW5UL.js.map → chunk-6L44C7QM.js.map} +0 -0
  126. package/dist/{chunk-Q2AVS24Z.js.map → chunk-7GJMLPJV.js.map} +0 -0
  127. package/dist/{chunk-Y5W727NP.js.map → chunk-7IE367Y6.js.map} +0 -0
  128. package/dist/{chunk-UJMWTYPH.js.map → chunk-A7AOWJKX.js.map} +0 -0
  129. package/dist/{chunk-X4F3O7PX.js.map → chunk-BKL525ZD.js.map} +0 -0
  130. package/dist/{chunk-WLRSUL67.js.map → chunk-E5SBGF5G.js.map} +0 -0
  131. package/dist/{chunk-I3B772WD.js.map → chunk-HW6M33F3.js.map} +0 -0
  132. package/dist/{chunk-LZQ7OFKO.js.map → chunk-JUAHRU5E.js.map} +0 -0
  133. package/dist/{chunk-7LBBLVDC.js.map → chunk-PUMCHXCD.js.map} +0 -0
  134. package/dist/{chunk-TGDOTL22.js.map → chunk-PVVI3GEL.js.map} +0 -0
  135. package/dist/{chunk-F7RZH6OK.js.map → chunk-RU3QT4Q3.js.map} +0 -0
  136. package/dist/{chunk-JM3SE72J.js.map → chunk-TAA5KCEG.js.map} +0 -0
  137. package/dist/{chunk-YDU3ZCS7.js.map → chunk-UE7W6ACG.js.map} +0 -0
  138. package/dist/{chunk-HJPMWQB2.js.map → chunk-ULVPJ2DF.js.map} +0 -0
  139. package/dist/{chunk-T3RP2QXG.js.map → chunk-XUD7JMEF.js.map} +0 -0
  140. package/dist/{chunk-BVPBGV4Y.js.map → chunk-ZMXVWURR.js.map} +0 -0
  141. package/dist/{index-5a5e5dc8.d.ts → index-c8f1e6e7.d.ts} +12 -12
@@ -1,15 +1,16 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
 
3
- declare global {
4
- interface WindowEventMap {
5
- 'local-storage': CustomEvent;
6
- }
7
- }
8
3
  type UseLocalStorageOptions<T> = {
9
4
  serializer?: (value: T) => string;
10
5
  deserializer?: (value: string) => T;
11
6
  initializeWithValue?: boolean;
12
7
  };
8
+
9
+ declare global {
10
+ interface WindowEventMap {
11
+ 'local-storage': CustomEvent;
12
+ }
13
+ }
13
14
  declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T), options?: UseLocalStorageOptions<T>) => [T, Dispatch<SetStateAction<T>>, () => void];
14
15
 
15
16
  export { useLocalStorage as default };
@@ -1,4 +1,4 @@
1
- export { a as default } from '../chunk-2HAPOY5M.js';
1
+ export { a as default } from '../chunk-GTPEQ3CM.js';
2
2
  import '../chunk-FJBC6QA5.js';
3
3
  import '../chunk-POTVACYB.js';
4
4
  import '../chunk-ET3WPQIO.js';
@@ -1,6 +1,7 @@
1
1
  import { RefObject } from 'react';
2
2
 
3
3
  type Handler = (event: MouseEvent) => void;
4
+
4
5
  declare const useOnClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: 'mousedown' | 'mouseup') => void;
5
6
 
6
7
  export { useOnClickOutside as default };
@@ -2,7 +2,7 @@ import { a } from '../chunk-FJBC6QA5.js';
2
2
  import '../chunk-POTVACYB.js';
3
3
  import '../chunk-ET3WPQIO.js';
4
4
 
5
- var u=(o,r,s="mousedown")=>{a(s,e=>{let t=o?.current;!t||t.contains(e.target)||r(e);});},m=u;
5
+ var u=(o,r,s="mousedown")=>{a(s,e=>{let t=o?.current;!t||t.contains(e.target)||r(e);});},i=u;
6
6
 
7
- export { m as default };
7
+ export { i as default };
8
8
  //# sourceMappingURL=useOnClickOutside.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useOnClickOutside.ts"],"names":["useOnClickOutside","ref","handler","mouseEvent","useEventListener_default","event","el","useOnClickOutside_default"],"mappings":"mGAMA,IAAMA,EAAoB,CACxBC,EACAC,EACAC,EAAsC,cACnC,CACHC,EAAiBD,EAAYE,GAAS,CACpC,IAAMC,EAAKL,GAAK,QAGZ,CAACK,GAAMA,EAAG,SAASD,EAAM,MAAc,GAI3CH,EAAQG,CAAK,CACf,CAAC,CACH,EAEOE,EAAQP","sourcesContent":["import { RefObject } from 'react';\n\nimport useEventListener from './useEventListener';\n\ntype Handler = (event: MouseEvent) => void;\n\nconst useOnClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: RefObject<T>,\n handler: Handler,\n mouseEvent: 'mousedown' | 'mouseup' = 'mousedown',\n) => {\n useEventListener(mouseEvent, event => {\n const el = ref?.current;\n\n // Do nothing if clicking ref's element or descendent elements\n if (!el || el.contains(event.target as Node)) {\n return;\n }\n\n handler(event);\n });\n};\n\nexport default useOnClickOutside;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useOnClickOutside.ts"],"names":["useOnClickOutside","ref","handler","mouseEvent","useEventListener_default","event","el","useOnClickOutside_default"],"mappings":"mGAKA,IAAMA,EAAoB,CACxBC,EACAC,EACAC,EAAsC,cACnC,CACHC,EAAiBD,EAAYE,GAAS,CACpC,IAAMC,EAAKL,GAAK,QAGZ,CAACK,GAAMA,EAAG,SAASD,EAAM,MAAc,GAI3CH,EAAQG,CAAK,CACf,CAAC,CACH,EAEOE,EAAQP","sourcesContent":["import { RefObject } from 'react';\n\nimport useEventListener from './useEventListener';\nimport type { Handler } from './useOnClickOutside.types';\n\nconst useOnClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: RefObject<T>,\n handler: Handler,\n mouseEvent: 'mousedown' | 'mouseup' = 'mousedown',\n) => {\n useEventListener(mouseEvent, event => {\n const el = ref?.current;\n\n // Do nothing if clicking ref's element or descendent elements\n if (!el || el.contains(event.target as Node)) {\n return;\n }\n\n handler(event);\n });\n};\n\nexport default useOnClickOutside;\n"]}
@@ -10,6 +10,7 @@ interface UsePaginationResult<T> {
10
10
  nextPage: () => void;
11
11
  prevPage: () => void;
12
12
  }
13
+
13
14
  declare function usePagination<T>({ items, itemsPerPage, }: UsePaginationProps<T>): UsePaginationResult<T>;
14
15
 
15
16
  export { usePagination as default };
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
 
3
- function s({items:r,itemsPerPage:n}){let[t,a]=useState(1),o=Math.ceil(r.length/n),g=r.slice((t-1)*n,t*n);return {currentPage:t,totalPages:o,currentItems:g,goToPage:e=>{e>0&&e<=o&&a(e);},nextPage:()=>{t<o&&a(e=>e+1);},prevPage:()=>{t>1&&a(e=>e-1);}}}var f=s;
3
+ function g({items:s,itemsPerPage:n}){let[e,o]=useState(1),a=Math.ceil(s.length/n),i=s.slice((e-1)*n,e*n);return {currentPage:e,totalPages:a,currentItems:i,goToPage:t=>{t>0&&t<=a&&o(t);},nextPage:()=>{e<a&&o(t=>t+1);},prevPage:()=>{e>1&&o(t=>t-1);}}}var l=g;
4
4
 
5
- export { f as default };
5
+ export { l as default };
6
6
  //# sourceMappingURL=usePagination.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/usePagination.ts"],"names":["useState","usePagination","items","itemsPerPage","currentPage","setCurrentPage","totalPages","currentItems","page","prevPage","usePagination_default"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,QAgBzB,SAASC,EAAiB,CACxB,MAAAC,EACA,aAAAC,CACF,EAAkD,CAChD,GAAM,CAACC,EAAaC,CAAc,EAAIL,EAAS,CAAC,EAE1CM,EAAa,KAAK,KAAKJ,EAAM,OAASC,CAAY,EAElDI,EAAeL,EAAM,OACxBE,EAAc,GAAKD,EACpBC,EAAcD,CAChB,EAoBA,MAAO,CACL,YAAAC,EACA,WAAAE,EACA,aAAAC,EACA,SAtBgBC,GAAiB,CAC7BA,EAAO,GAAKA,GAAQF,GACtBD,EAAeG,CAAI,CAEvB,EAmBE,SAjBe,IAAM,CACjBJ,EAAcE,GAChBD,EAAeI,GAAYA,EAAW,CAAC,CAE3C,EAcE,SAZe,IAAM,CACjBL,EAAc,GAChBC,EAAeI,GAAYA,EAAW,CAAC,CAE3C,CASA,CACF,CAEA,IAAOC,EAAQT","sourcesContent":["import { useState } from 'react';\n\ninterface UsePaginationProps<T> {\n items: T[];\n itemsPerPage: number;\n}\n\ninterface UsePaginationResult<T> {\n currentPage: number;\n totalPages: number;\n currentItems: T[];\n goToPage: (page: number) => void;\n nextPage: () => void;\n prevPage: () => void;\n}\n\nfunction usePagination<T>({\n items,\n itemsPerPage,\n}: UsePaginationProps<T>): UsePaginationResult<T> {\n const [currentPage, setCurrentPage] = useState(1);\n\n const totalPages = Math.ceil(items.length / itemsPerPage);\n\n const currentItems = items.slice(\n (currentPage - 1) * itemsPerPage,\n currentPage * itemsPerPage,\n );\n\n const goToPage = (page: number) => {\n if (page > 0 && page <= totalPages) {\n setCurrentPage(page);\n }\n };\n\n const nextPage = () => {\n if (currentPage < totalPages) {\n setCurrentPage(prevPage => prevPage + 1);\n }\n };\n\n const prevPage = () => {\n if (currentPage > 1) {\n setCurrentPage(prevPage => prevPage - 1);\n }\n };\n\n return {\n currentPage,\n totalPages,\n currentItems,\n goToPage,\n nextPage,\n prevPage,\n };\n}\n\nexport default usePagination;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/usePagination.ts"],"names":["useState","usePagination","items","itemsPerPage","currentPage","setCurrentPage","totalPages","currentItems","page","prevPage","usePagination_default"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,QAOzB,SAASC,EAAiB,CACxB,MAAAC,EACA,aAAAC,CACF,EAAkD,CAChD,GAAM,CAACC,EAAaC,CAAc,EAAIL,EAAS,CAAC,EAE1CM,EAAa,KAAK,KAAKJ,EAAM,OAASC,CAAY,EAElDI,EAAeL,EAAM,OACxBE,EAAc,GAAKD,EACpBC,EAAcD,CAChB,EAoBA,MAAO,CACL,YAAAC,EACA,WAAAE,EACA,aAAAC,EACA,SAtBgBC,GAAiB,CAC7BA,EAAO,GAAKA,GAAQF,GACtBD,EAAeG,CAAI,CAEvB,EAmBE,SAjBe,IAAM,CACjBJ,EAAcE,GAChBD,EAAeI,GAAYA,EAAW,CAAC,CAE3C,EAcE,SAZe,IAAM,CACjBL,EAAc,GAChBC,EAAeI,GAAYA,EAAW,CAAC,CAE3C,CASA,CACF,CAEA,IAAOC,EAAQT","sourcesContent":["import { useState } from 'react';\n\nimport type {\n UsePaginationProps,\n UsePaginationResult,\n} from './usePagination.types';\n\nfunction usePagination<T>({\n items,\n itemsPerPage,\n}: UsePaginationProps<T>): UsePaginationResult<T> {\n const [currentPage, setCurrentPage] = useState(1);\n\n const totalPages = Math.ceil(items.length / itemsPerPage);\n\n const currentItems = items.slice(\n (currentPage - 1) * itemsPerPage,\n currentPage * itemsPerPage,\n );\n\n const goToPage = (page: number) => {\n if (page > 0 && page <= totalPages) {\n setCurrentPage(page);\n }\n };\n\n const nextPage = () => {\n if (currentPage < totalPages) {\n setCurrentPage(prevPage => prevPage + 1);\n }\n };\n\n const prevPage = () => {\n if (currentPage > 1) {\n setCurrentPage(prevPage => prevPage - 1);\n }\n };\n\n return {\n currentPage,\n totalPages,\n currentItems,\n goToPage,\n nextPage,\n prevPage,\n };\n}\n\nexport default usePagination;\n"]}
@@ -6,6 +6,7 @@ interface UseReconciliationParams {
6
6
  interface UseReconciliationResult {
7
7
  notifyActivity: () => void;
8
8
  }
9
+
9
10
  declare function useReconciliation({ reconcile, isActive, intervalMs, }: UseReconciliationParams): UseReconciliationResult;
10
11
 
11
12
  export { useReconciliation };
@@ -1,6 +1,6 @@
1
1
  import { useRef, useCallback, useEffect } from 'react';
2
2
 
3
- var s=1e4;function v({reconcile:c,isActive:n,intervalMs:o=s}){let l=useRef(c);l.current=c;let t=useRef(null),e=useCallback(()=>{t.current&&(clearInterval(t.current),t.current=null);},[]),r=useCallback(()=>{e(),t.current=setInterval(()=>{l.current();},o);},[e,o]);return useEffect(()=>{if(!n){e();return}return r(),e},[e,n,r]),{notifyActivity:useCallback(()=>{n&&r();},[n,r])}}
3
+ var a=1e4;function y({reconcile:o,isActive:t,intervalMs:i=a}){let u=useRef(o);u.current=o;let n=useRef(null),e=useCallback(()=>{n.current&&(clearInterval(n.current),n.current=null);},[]),r=useCallback(()=>{e(),n.current=setInterval(()=>{u.current();},i);},[e,i]);return useEffect(()=>{if(!t){e();return}return r(),e},[e,t,r]),{notifyActivity:useCallback(()=>{t&&r();},[t,r])}}
4
4
 
5
- export { v as useReconciliation };
5
+ export { y as useReconciliation };
6
6
  //# sourceMappingURL=useReconciliation.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useReconciliation.ts"],"names":["useCallback","useEffect","useRef","DEFAULT_INTERVAL_MS","useReconciliation","reconcile","isActive","intervalMs","reconcileRef","intervalRef","clear","start"],"mappings":"AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,UAAAC,MAAc,QAY/C,IAAMC,EAAsB,IAErB,SAASC,EAAkB,CAChC,UAAAC,EACA,SAAAC,EACA,WAAAC,EAAaJ,CACf,EAAqD,CACnD,IAAMK,EAAeN,EAAOG,CAAS,EACrCG,EAAa,QAAUH,EAEvB,IAAMI,EAAcP,EAA8C,IAAI,EAEhEQ,EAAQV,EAAY,IAAM,CAC1BS,EAAY,UACd,cAAcA,EAAY,OAAO,EACjCA,EAAY,QAAU,KAE1B,EAAG,CAAC,CAAC,EAECE,EAAQX,EAAY,IAAM,CAC9BU,EAAM,EAEND,EAAY,QAAU,YAAY,IAAM,CACjCD,EAAa,QAAQ,CAC5B,EAAGD,CAAU,CACf,EAAG,CAACG,EAAOH,CAAU,CAAC,EAEtB,OAAAN,EAAU,IAAM,CACd,GAAI,CAACK,EAAU,CACbI,EAAM,EAEN,OAGF,OAAAC,EAAM,EAECD,CACT,EAAG,CAACA,EAAOJ,EAAUK,CAAK,CAAC,EAQpB,CAAE,eANcX,EAAY,IAAM,CACnCM,GACFK,EAAM,CAEV,EAAG,CAACL,EAAUK,CAAK,CAAC,CAEI,CAC1B","sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\n\ninterface UseReconciliationParams {\n reconcile: () => void | Promise<void>;\n isActive: boolean;\n intervalMs?: number;\n}\n\ninterface UseReconciliationResult {\n notifyActivity: () => void;\n}\n\nconst DEFAULT_INTERVAL_MS = 10000;\n\nexport function useReconciliation({\n reconcile,\n isActive,\n intervalMs = DEFAULT_INTERVAL_MS,\n}: UseReconciliationParams): UseReconciliationResult {\n const reconcileRef = useRef(reconcile);\n reconcileRef.current = reconcile;\n\n const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const clear = useCallback(() => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n\n const start = useCallback(() => {\n clear();\n\n intervalRef.current = setInterval(() => {\n void reconcileRef.current();\n }, intervalMs);\n }, [clear, intervalMs]);\n\n useEffect(() => {\n if (!isActive) {\n clear();\n\n return undefined;\n }\n\n start();\n\n return clear;\n }, [clear, isActive, start]);\n\n const notifyActivity = useCallback(() => {\n if (isActive) {\n start();\n }\n }, [isActive, start]);\n\n return { notifyActivity };\n}\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useReconciliation.ts"],"names":["useCallback","useEffect","useRef","DEFAULT_INTERVAL_MS","useReconciliation","reconcile","isActive","intervalMs","reconcileRef","intervalRef","clear","start"],"mappings":"AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,UAAAC,MAAc,QAO/C,IAAMC,EAAsB,IAErB,SAASC,EAAkB,CAChC,UAAAC,EACA,SAAAC,EACA,WAAAC,EAAaJ,CACf,EAAqD,CACnD,IAAMK,EAAeN,EAAOG,CAAS,EACrCG,EAAa,QAAUH,EAEvB,IAAMI,EAAcP,EAA8C,IAAI,EAEhEQ,EAAQV,EAAY,IAAM,CAC1BS,EAAY,UACd,cAAcA,EAAY,OAAO,EACjCA,EAAY,QAAU,KAE1B,EAAG,CAAC,CAAC,EAECE,EAAQX,EAAY,IAAM,CAC9BU,EAAM,EAEND,EAAY,QAAU,YAAY,IAAM,CACjCD,EAAa,QAAQ,CAC5B,EAAGD,CAAU,CACf,EAAG,CAACG,EAAOH,CAAU,CAAC,EAEtB,OAAAN,EAAU,IAAM,CACd,GAAI,CAACK,EAAU,CACbI,EAAM,EAEN,OAGF,OAAAC,EAAM,EAECD,CACT,EAAG,CAACA,EAAOJ,EAAUK,CAAK,CAAC,EAQpB,CAAE,eANcX,EAAY,IAAM,CACnCM,GACFK,EAAM,CAEV,EAAG,CAACL,EAAUK,CAAK,CAAC,CAEI,CAC1B","sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\n\nimport type {\n UseReconciliationParams,\n UseReconciliationResult,\n} from './useReconciliation.types';\n\nconst DEFAULT_INTERVAL_MS = 10000;\n\nexport function useReconciliation({\n reconcile,\n isActive,\n intervalMs = DEFAULT_INTERVAL_MS,\n}: UseReconciliationParams): UseReconciliationResult {\n const reconcileRef = useRef(reconcile);\n reconcileRef.current = reconcile;\n\n const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const clear = useCallback(() => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n\n const start = useCallback(() => {\n clear();\n\n intervalRef.current = setInterval(() => {\n void reconcileRef.current();\n }, intervalMs);\n }, [clear, intervalMs]);\n\n useEffect(() => {\n if (!isActive) {\n clear();\n\n return undefined;\n }\n\n start();\n\n return clear;\n }, [clear, isActive, start]);\n\n const notifyActivity = useCallback(() => {\n if (isActive) {\n start();\n }\n }, [isActive, start]);\n\n return { notifyActivity };\n}\n"]}
@@ -3,6 +3,7 @@ import { Breakpoint } from '@mui/material/styles';
3
3
  type ReturnType = boolean;
4
4
  type Query = 'up' | 'down' | 'between' | 'only';
5
5
  type Value = Breakpoint | number;
6
+
6
7
  declare const useResponsive: (query: Query, start?: Value, end?: Value) => ReturnType;
7
8
  declare function useWidth(): "xs" | "sm" | "md" | "lg" | "xl";
8
9
 
@@ -1,2 +1,2 @@
1
- export { b as default, a as useWidth } from '../chunk-2ZJUGM2S.js';
1
+ export { b as default, a as useWidth } from '../chunk-TXJ45CNA.js';
2
2
  //# sourceMappingURL=useResponsive.js.map
@@ -2,6 +2,7 @@ type UseScrollOffSetTopReturn = {
2
2
  offsetTop: boolean;
3
3
  elementRef: React.RefObject<HTMLDivElement | null>;
4
4
  };
5
+
5
6
  declare const useScrollOffSetTop: (top?: number) => UseScrollOffSetTopReturn;
6
7
 
7
8
  export { UseScrollOffSetTopReturn, useScrollOffSetTop as default };
@@ -1,7 +1,7 @@
1
1
  import { useRef, useState, useCallback, useMemo } from 'react';
2
2
  import { useScroll, useMotionValueEvent } from 'framer-motion';
3
3
 
4
- var R=(t=0)=>{let e=useRef(null),{scrollY:r}=useScroll(),[o,l]=useState(!1),n=useCallback(c=>{let u=Math.round(c);if(e?.current){let f=e.current.getBoundingClientRect(),a=Math.round(f.top);l(a<t);}else l(u>t);},[e,t]);return useMotionValueEvent(r,"change",useMemo(()=>n,[n])),useMemo(()=>({elementRef:e,offsetTop:o}),[o])},g=R;
4
+ var d=(t=0)=>{let e=useRef(null),{scrollY:s}=useScroll(),[o,l]=useState(!1),r=useCallback(c=>{let f=Math.round(c);if(e?.current){let u=e.current.getBoundingClientRect(),p=Math.round(u.top);l(p<t);}else l(f>t);},[e,t]);return useMotionValueEvent(s,"change",useMemo(()=>r,[r])),useMemo(()=>({elementRef:e,offsetTop:o}),[o])},g=d;
5
5
 
6
6
  export { g as default };
7
7
  //# sourceMappingURL=useScrollOffSetTop.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useScrollOffSetTop.ts"],"names":["useCallback","useMemo","useRef","useState","useMotionValueEvent","useScroll","useScrollOffSetTop","top","elementRef","scrollY","offsetTop","setOffsetTop","handleScrollChange","val","scrollHeight","rect","elementTop","useScrollOffSetTop_default"],"mappings":"AAAA,OAAS,eAAAA,EAAa,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QACvD,OAAS,uBAAAC,EAAqB,aAAAC,MAAiB,gBAS/C,IAAMC,EAAqB,CAACC,EAAM,IAAgC,CAChE,IAAMC,EAAaN,EAAuB,IAAI,EAExC,CAAE,QAAAO,CAAQ,EAAIJ,EAAU,EAExB,CAACK,EAAWC,CAAY,EAAIR,EAAS,EAAK,EAE1CS,EAAqBZ,EACxBa,GAAgB,CACf,IAAMC,EAAe,KAAK,MAAMD,CAAG,EAEnC,GAAIL,GAAY,QAAS,CACvB,IAAMO,EAAOP,EAAW,QAAQ,sBAAsB,EAChDQ,EAAa,KAAK,MAAMD,EAAK,GAAG,EAEtCJ,EAAaK,EAAaT,CAAG,OAE7BI,EAAaG,EAAeP,CAAG,CAEnC,EACA,CAACC,EAAYD,CAAG,CAClB,EAEA,OAAAH,EACEK,EACA,SACAR,EAAQ,IAAMW,EAAoB,CAACA,CAAkB,CAAC,CACxD,EAEsBX,EAAQ,KAAO,CAAE,WAAAO,EAAY,UAAAE,CAAU,GAAI,CAACA,CAAS,CAAC,CAG9E,EAEOO,EAAQX","sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react';\nimport { useMotionValueEvent, useScroll } from 'framer-motion';\n\n// ----------------------------------------------------------------------\n\nexport type UseScrollOffSetTopReturn = {\n offsetTop: boolean;\n elementRef: React.RefObject<HTMLDivElement | null>;\n};\n\nconst useScrollOffSetTop = (top = 0): UseScrollOffSetTopReturn => {\n const elementRef = useRef<HTMLDivElement>(null);\n\n const { scrollY } = useScroll();\n\n const [offsetTop, setOffsetTop] = useState(false);\n\n const handleScrollChange = useCallback(\n (val: number) => {\n const scrollHeight = Math.round(val);\n\n if (elementRef?.current) {\n const rect = elementRef.current.getBoundingClientRect();\n const elementTop = Math.round(rect.top);\n\n setOffsetTop(elementTop < top);\n } else {\n setOffsetTop(scrollHeight > top);\n }\n },\n [elementRef, top],\n );\n\n useMotionValueEvent(\n scrollY,\n 'change',\n useMemo(() => handleScrollChange, [handleScrollChange]),\n );\n\n const memoizedValue = useMemo(() => ({ elementRef, offsetTop }), [offsetTop]);\n\n return memoizedValue;\n};\n\nexport default useScrollOffSetTop;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useScrollOffSetTop.ts"],"names":["useCallback","useMemo","useRef","useState","useMotionValueEvent","useScroll","useScrollOffSetTop","top","elementRef","scrollY","offsetTop","setOffsetTop","handleScrollChange","val","scrollHeight","rect","elementTop","useScrollOffSetTop_default"],"mappings":"AAAA,OAAS,eAAAA,EAAa,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QACvD,OAAS,uBAAAC,EAAqB,aAAAC,MAAiB,gBAQ/C,IAAMC,EAAqB,CAACC,EAAM,IAAgC,CAChE,IAAMC,EAAaN,EAAuB,IAAI,EAExC,CAAE,QAAAO,CAAQ,EAAIJ,EAAU,EAExB,CAACK,EAAWC,CAAY,EAAIR,EAAS,EAAK,EAE1CS,EAAqBZ,EACxBa,GAAgB,CACf,IAAMC,EAAe,KAAK,MAAMD,CAAG,EAEnC,GAAIL,GAAY,QAAS,CACvB,IAAMO,EAAOP,EAAW,QAAQ,sBAAsB,EAChDQ,EAAa,KAAK,MAAMD,EAAK,GAAG,EAEtCJ,EAAaK,EAAaT,CAAG,OAE7BI,EAAaG,EAAeP,CAAG,CAEnC,EACA,CAACC,EAAYD,CAAG,CAClB,EAEA,OAAAH,EACEK,EACA,SACAR,EAAQ,IAAMW,EAAoB,CAACA,CAAkB,CAAC,CACxD,EAEsBX,EAAQ,KAAO,CAAE,WAAAO,EAAY,UAAAE,CAAU,GAAI,CAACA,CAAS,CAAC,CAG9E,EAEOO,EAAQX","sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react';\nimport { useMotionValueEvent, useScroll } from 'framer-motion';\n\nimport type { UseScrollOffSetTopReturn } from './useScrollOffSetTop.types';\n\n// ----------------------------------------------------------------------\n\nexport type { UseScrollOffSetTopReturn } from './useScrollOffSetTop.types';\n\nconst useScrollOffSetTop = (top = 0): UseScrollOffSetTopReturn => {\n const elementRef = useRef<HTMLDivElement>(null);\n\n const { scrollY } = useScroll();\n\n const [offsetTop, setOffsetTop] = useState(false);\n\n const handleScrollChange = useCallback(\n (val: number) => {\n const scrollHeight = Math.round(val);\n\n if (elementRef?.current) {\n const rect = elementRef.current.getBoundingClientRect();\n const elementTop = Math.round(rect.top);\n\n setOffsetTop(elementTop < top);\n } else {\n setOffsetTop(scrollHeight > top);\n }\n },\n [elementRef, top],\n );\n\n useMotionValueEvent(\n scrollY,\n 'change',\n useMemo(() => handleScrollChange, [handleScrollChange]),\n );\n\n const memoizedValue = useMemo(() => ({ elementRef, offsetTop }), [offsetTop]);\n\n return memoizedValue;\n};\n\nexport default useScrollOffSetTop;\n"]}
@@ -12,6 +12,7 @@ declare const useSnackbar: () => {
12
12
  custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
13
13
  message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | (() => ReactNode) | null | undefined, data?: ExternalToast | undefined) => string | number;
14
14
  promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
15
+ cancel?: ReactNode | sonner.Action;
15
16
  className?: string | undefined;
16
17
  style?: react.CSSProperties | undefined;
17
18
  position?: ("top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right") | undefined;
@@ -20,7 +21,6 @@ declare const useSnackbar: () => {
20
21
  icon?: ReactNode;
21
22
  duration?: number | undefined;
22
23
  onDismiss?: ((toast: sonner.ToastT) => void) | undefined;
23
- cancel?: ReactNode | sonner.Action;
24
24
  richColors?: boolean | undefined;
25
25
  invert?: boolean | undefined;
26
26
  closeButton?: boolean | undefined;
@@ -7,6 +7,7 @@ interface UseThemeToggleReturn {
7
7
  toggleTheme: () => void;
8
8
  setColorScheme: (scheme: ColorScheme) => void;
9
9
  }
10
+
10
11
  declare const useThemeToggle: () => UseThemeToggleReturn;
11
12
 
12
13
  export { UseThemeToggleReturn, useThemeToggle };
@@ -1,12 +1,12 @@
1
- export { a as useThemeToggle } from '../chunk-U4I7JPER.js';
2
- import '../chunk-JM3SE72J.js';
1
+ export { a as useThemeToggle } from '../chunk-5KEVIB7P.js';
2
+ import '../chunk-TAA5KCEG.js';
3
3
  import '../chunk-373WGZZL.js';
4
4
  import '../chunk-WUFEPE2G.js';
5
5
  import '../chunk-BX2DSNRV.js';
6
- import '../chunk-X4F3O7PX.js';
7
- import '../chunk-Q2AVS24Z.js';
6
+ import '../chunk-BKL525ZD.js';
7
+ import '../chunk-7GJMLPJV.js';
8
8
  import '../chunk-LNESYSHP.js';
9
- import '../chunk-YPL4KIKN.js';
9
+ import '../chunk-4734QSYC.js';
10
10
  import '../chunk-HBOBTNB5.js';
11
- import '../chunk-GLRLKFPS.js';
11
+ import '../chunk-Y66XXBB3.js';
12
12
  //# sourceMappingURL=useThemeToggle.js.map
@@ -6,6 +6,7 @@ interface Props {
6
6
  onImageUploaded(image?: string): void;
7
7
  onCancel?: VoidFunction;
8
8
  }
9
+
9
10
  declare const useUploadImage: ({ onFileCropped, onImageUploaded, onCancel, }: Props) => {
10
11
  id: string;
11
12
  setCropModalOpen: react.Dispatch<react.SetStateAction<boolean>>;
@@ -2,7 +2,7 @@ import { a } from '../chunk-E3R7W7GK.js';
2
2
  import { useId, useState } from 'react';
3
3
  import I from 'browser-image-compression';
4
4
 
5
- var h=5242880,M=({onFileCropped:n,onImageUploaded:c,onCancel:t})=>{let d=useId(),[e,m]=useState(),[f,o,s]=a(),[u,i]=useState(),[v,p]=useState(!1);return {id:d,setCropModalOpen:s,handleRemove:()=>{n(void 0),c(void 0),s(!1);},toggleCropModalOpen:o,cropModalOpen:f,cancelChanges:()=>{t&&t(),s(!1);},saveChanges:()=>{e!==void 0&&e.getCroppedCanvas().toBlob(async g=>{try{if(!g)return;p(!0);let a=new File([g],"imagem.png",{type:"image/png"});if(a.size>h){let C=await I(a,{maxSizeMB:5});n(C),o();return}n(a),o();}finally{p(!1);}},"image/png",1);},previewImage:()=>{e!==void 0&&i(e.getCroppedCanvas().toDataURL());},setCropper:m,preview:u,closePreviewImage:()=>i(void 0),saving:v}},x=M;
5
+ var h=5242880,y=({onFileCropped:n,onImageUploaded:c,onCancel:a$1})=>{let l=useId(),[e,f]=useState(),[d,o,s]=a(),[u,i]=useState(),[v,p]=useState(!1);return {id:l,setCropModalOpen:s,handleRemove:()=>{n(void 0),c(void 0),s(!1);},toggleCropModalOpen:o,cropModalOpen:d,cancelChanges:()=>{a$1&&a$1(),s(!1);},saveChanges:()=>{e!==void 0&&e.getCroppedCanvas().toBlob(async g=>{try{if(!g)return;p(!0);let r=new File([g],"imagem.png",{type:"image/png"});if(r.size>h){let C=await I(r,{maxSizeMB:5});n(C),o();return}n(r),o();}finally{p(!1);}},"image/png",1);},previewImage:()=>{e!==void 0&&i(e.getCroppedCanvas().toDataURL());},setCropper:f,preview:u,closePreviewImage:()=>i(void 0),saving:v}},z=y;
6
6
 
7
- export { x as default };
7
+ export { z as default };
8
8
  //# sourceMappingURL=useUploadImage.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useUploadImage.ts"],"names":["useId","useState","imageCompression","FIVE_MB","useUploadImage","onFileCropped","onImageUploaded","onCancel","id","cropper","setCropper","cropModalOpen","toggleCropModalOpen","setCropModalOpen","useToggle_default","preview","setPreview","saving","setSaving","blob","file","compressedFile","useUploadImage_default"],"mappings":"yCAAA,OAAS,SAAAA,EAAO,YAAAC,MAAgB,QAChC,OAAOC,MAAsB,4BAW7B,IAAMC,EAAU,QAEVC,EAAiB,CAAC,CACtB,cAAAC,EACA,gBAAAC,EACA,SAAAC,CACF,IAAa,CACX,IAAMC,EAAKR,EAAM,EACX,CAACS,EAASC,CAAU,EAAIT,EAAkB,EAC1C,CAACU,EAAeC,EAAqBC,CAAgB,EAAIC,EAAU,EACnE,CAACC,EAASC,CAAU,EAAIf,EAAiB,EACzC,CAACgB,EAAQC,CAAS,EAAIjB,EAAS,EAAK,EAuD1C,MAAO,CACL,GAAAO,EACA,iBAAAK,EACA,aATmB,IAAM,CACzBR,EAAc,MAAS,EACvBC,EAAgB,MAAS,EACzBO,EAAiB,EAAK,CACxB,EAME,oBAAAD,EACA,cAAAD,EACA,cA3DoB,IAAM,CACtBJ,GAAUA,EAAS,EACvBM,EAAiB,EAAK,CACxB,EAyDE,YA/CkB,IAAM,CACpBJ,IAAY,QAEhBA,EAAQ,iBAAiB,EAAE,OACzB,MAAOU,GAAsB,CAC3B,GAAI,CACF,GAAI,CAACA,EAAM,OAEXD,EAAU,EAAI,EAEd,IAAME,EAAO,IAAI,KAAK,CAACD,CAAI,EAAG,aAAc,CAAE,KAAM,WAAY,CAAC,EAEjE,GAAIC,EAAK,KAAOjB,EAAS,CACvB,IAAMkB,EAAiB,MAAMnB,EAAiBkB,EAAM,CAClD,UAAW,CACb,CAAC,EAEDf,EAAcgB,CAAc,EAC5BT,EAAoB,EAEpB,OAGFP,EAAce,CAAI,EAClBR,EAAoB,CACtB,QAAE,CACAM,EAAU,EAAK,CACjB,CACF,EACA,YACA,CACF,CACF,EAgBE,aAxDmB,IAAM,CACrBT,IAAY,QAEhBO,EAAWP,EAAQ,iBAAiB,EAAE,UAAU,CAAC,CACnD,EAqDE,WAAAC,EACA,QAAAK,EACA,kBArDwB,IAAMC,EAAW,MAAS,EAsDlD,OAAAC,CACF,CACF,EAEOK,EAAQlB","sourcesContent":["import { useId, useState } from 'react';\nimport imageCompression from 'browser-image-compression';\nimport Cropper from 'cropperjs';\n\nimport useToggle from './useToggle';\n\ninterface Props {\n onFileCropped(file?: File): void;\n onImageUploaded(image?: string): void;\n onCancel?: VoidFunction;\n}\n\nconst FIVE_MB = 5242880;\n\nconst useUploadImage = ({\n onFileCropped,\n onImageUploaded,\n onCancel,\n}: Props) => {\n const id = useId();\n const [cropper, setCropper] = useState<Cropper>();\n const [cropModalOpen, toggleCropModalOpen, setCropModalOpen] = useToggle();\n const [preview, setPreview] = useState<string>();\n const [saving, setSaving] = useState(false);\n\n const cancelChanges = () => {\n if (onCancel) onCancel();\n setCropModalOpen(false);\n };\n\n const previewImage = () => {\n if (cropper === undefined) return;\n\n setPreview(cropper.getCroppedCanvas().toDataURL());\n };\n\n const closePreviewImage = () => setPreview(undefined);\n\n const saveChanges = () => {\n if (cropper === undefined) return;\n\n cropper.getCroppedCanvas().toBlob(\n async (blob: Blob | null) => {\n try {\n if (!blob) return;\n\n setSaving(true);\n\n const file = new File([blob], 'imagem.png', { type: 'image/png' });\n\n if (file.size > FIVE_MB) {\n const compressedFile = await imageCompression(file, {\n maxSizeMB: 5,\n });\n\n onFileCropped(compressedFile);\n toggleCropModalOpen();\n\n return;\n }\n\n onFileCropped(file);\n toggleCropModalOpen();\n } finally {\n setSaving(false);\n }\n },\n 'image/png',\n 1,\n );\n };\n\n const handleRemove = () => {\n onFileCropped(undefined);\n onImageUploaded(undefined);\n setCropModalOpen(false);\n };\n\n return {\n id,\n setCropModalOpen,\n handleRemove,\n toggleCropModalOpen,\n cropModalOpen,\n cancelChanges,\n saveChanges,\n previewImage,\n setCropper,\n preview,\n closePreviewImage,\n saving,\n };\n};\n\nexport default useUploadImage;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useUploadImage.ts"],"names":["useId","useState","imageCompression","FIVE_MB","useUploadImage","onFileCropped","onImageUploaded","onCancel","id","cropper","setCropper","cropModalOpen","toggleCropModalOpen","setCropModalOpen","useToggle_default","preview","setPreview","saving","setSaving","blob","file","compressedFile","useUploadImage_default"],"mappings":"yCAAA,OAAS,SAAAA,EAAO,YAAAC,MAAgB,QAChC,OAAOC,MAAsB,4BAM7B,IAAMC,EAAU,QAEVC,EAAiB,CAAC,CACtB,cAAAC,EACA,gBAAAC,EACA,SAAAC,CACF,IAAa,CACX,IAAMC,EAAKR,EAAM,EACX,CAACS,EAASC,CAAU,EAAIT,EAAkB,EAC1C,CAACU,EAAeC,EAAqBC,CAAgB,EAAIC,EAAU,EACnE,CAACC,EAASC,CAAU,EAAIf,EAAiB,EACzC,CAACgB,EAAQC,CAAS,EAAIjB,EAAS,EAAK,EAuD1C,MAAO,CACL,GAAAO,EACA,iBAAAK,EACA,aATmB,IAAM,CACzBR,EAAc,MAAS,EACvBC,EAAgB,MAAS,EACzBO,EAAiB,EAAK,CACxB,EAME,oBAAAD,EACA,cAAAD,EACA,cA3DoB,IAAM,CACtBJ,GAAUA,EAAS,EACvBM,EAAiB,EAAK,CACxB,EAyDE,YA/CkB,IAAM,CACpBJ,IAAY,QAEhBA,EAAQ,iBAAiB,EAAE,OACzB,MAAOU,GAAsB,CAC3B,GAAI,CACF,GAAI,CAACA,EAAM,OAEXD,EAAU,EAAI,EAEd,IAAME,EAAO,IAAI,KAAK,CAACD,CAAI,EAAG,aAAc,CAAE,KAAM,WAAY,CAAC,EAEjE,GAAIC,EAAK,KAAOjB,EAAS,CACvB,IAAMkB,EAAiB,MAAMnB,EAAiBkB,EAAM,CAClD,UAAW,CACb,CAAC,EAEDf,EAAcgB,CAAc,EAC5BT,EAAoB,EAEpB,OAGFP,EAAce,CAAI,EAClBR,EAAoB,CACtB,QAAE,CACAM,EAAU,EAAK,CACjB,CACF,EACA,YACA,CACF,CACF,EAgBE,aAxDmB,IAAM,CACrBT,IAAY,QAEhBO,EAAWP,EAAQ,iBAAiB,EAAE,UAAU,CAAC,CACnD,EAqDE,WAAAC,EACA,QAAAK,EACA,kBArDwB,IAAMC,EAAW,MAAS,EAsDlD,OAAAC,CACF,CACF,EAEOK,EAAQlB","sourcesContent":["import { useId, useState } from 'react';\nimport imageCompression from 'browser-image-compression';\nimport Cropper from 'cropperjs';\n\nimport useToggle from './useToggle';\nimport type { Props } from './useUploadImage.types';\n\nconst FIVE_MB = 5242880;\n\nconst useUploadImage = ({\n onFileCropped,\n onImageUploaded,\n onCancel,\n}: Props) => {\n const id = useId();\n const [cropper, setCropper] = useState<Cropper>();\n const [cropModalOpen, toggleCropModalOpen, setCropModalOpen] = useToggle();\n const [preview, setPreview] = useState<string>();\n const [saving, setSaving] = useState(false);\n\n const cancelChanges = () => {\n if (onCancel) onCancel();\n setCropModalOpen(false);\n };\n\n const previewImage = () => {\n if (cropper === undefined) return;\n\n setPreview(cropper.getCroppedCanvas().toDataURL());\n };\n\n const closePreviewImage = () => setPreview(undefined);\n\n const saveChanges = () => {\n if (cropper === undefined) return;\n\n cropper.getCroppedCanvas().toBlob(\n async (blob: Blob | null) => {\n try {\n if (!blob) return;\n\n setSaving(true);\n\n const file = new File([blob], 'imagem.png', { type: 'image/png' });\n\n if (file.size > FIVE_MB) {\n const compressedFile = await imageCompression(file, {\n maxSizeMB: 5,\n });\n\n onFileCropped(compressedFile);\n toggleCropModalOpen();\n\n return;\n }\n\n onFileCropped(file);\n toggleCropModalOpen();\n } finally {\n setSaving(false);\n }\n },\n 'image/png',\n 1,\n );\n };\n\n const handleRemove = () => {\n onFileCropped(undefined);\n onImageUploaded(undefined);\n setCropModalOpen(false);\n };\n\n return {\n id,\n setCropModalOpen,\n handleRemove,\n toggleCropModalOpen,\n cropModalOpen,\n cancelChanges,\n saveChanges,\n previewImage,\n setCropper,\n preview,\n closePreviewImage,\n saving,\n };\n};\n\nexport default useUploadImage;\n"]}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { C as CustomShadows } from './index-5a5e5dc8.js';
2
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-5a5e5dc8.js';
1
+ import { C as CustomShadows } from './index-c8f1e6e7.js';
2
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-c8f1e6e7.js';
3
3
  export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
4
4
  export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
5
5
  import { S as SettingsState } from './settings-583c107c.js';
6
6
  import { Theme as Theme$1 } from '@mui/material/styles';
7
7
  import { a as ThemeLocaleComponents } from './types-b8e8c021.js';
8
- export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha } from './theme/styles/index.js';
8
+ export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha, whenAutoFilled } from './theme/styles/index.js';
9
9
  export { useThemeToggle } from './hooks/useThemeToggle.js';
10
10
  import '@mui/lab/TimelineConnector';
11
11
  import '@mui/system';
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- export { a as useThemeToggle } from './chunk-U4I7JPER.js';
2
- export { b as ThemeProvider, a as createTheme } from './chunk-JM3SE72J.js';
1
+ export { a as useThemeToggle } from './chunk-5KEVIB7P.js';
2
+ export { b as ThemeProvider, a as createTheme } from './chunk-TAA5KCEG.js';
3
3
  import './chunk-373WGZZL.js';
4
4
  import './chunk-WUFEPE2G.js';
5
5
  export { c as SettingsProvider, b as useSettingsContext } from './chunk-BX2DSNRV.js';
6
- export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-X4F3O7PX.js';
7
- import './chunk-Q2AVS24Z.js';
6
+ export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-BKL525ZD.js';
7
+ import './chunk-7GJMLPJV.js';
8
8
  import './chunk-LNESYSHP.js';
9
- export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-YPL4KIKN.js';
9
+ export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-4734QSYC.js';
10
10
  import './chunk-HBOBTNB5.js';
11
- export { a as THEME_CONFIG, q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha } from './chunk-GLRLKFPS.js';
11
+ export { a as THEME_CONFIG, q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha, u as whenAutoFilled } from './chunk-Y66XXBB3.js';
12
12
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-5a5e5dc8.js';
1
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-c8f1e6e7.js';
2
2
  import '@mui/lab/TimelineConnector';
3
3
  import '@mui/system';
4
4
  import '@mui/lab/TimelineDot';
@@ -1,5 +1,5 @@
1
- export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from '../../chunk-X4F3O7PX.js';
2
- export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from '../../chunk-YPL4KIKN.js';
1
+ export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from '../../chunk-BKL525ZD.js';
2
+ export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from '../../chunk-4734QSYC.js';
3
3
  import '../../chunk-HBOBTNB5.js';
4
- import '../../chunk-GLRLKFPS.js';
4
+ import '../../chunk-Y66XXBB3.js';
5
5
  //# sourceMappingURL=index.js.map
@@ -173,7 +173,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
173
173
  float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
174
174
  floodColor?: readonly string[] | csstype.Property.FloodColor | readonly csstype.Property.FloodColor[] | undefined;
175
175
  floodOpacity?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FloodOpacity | readonly NonNullable<csstype.Property.FloodOpacity | undefined>[] | undefined;
176
- fontFamily?: csstype.Property.FontFamily | readonly string[] | readonly csstype.Property.FontFamily[] | undefined;
176
+ fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
177
177
  fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
178
178
  fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
179
179
  fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
@@ -197,7 +197,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
197
197
  fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
198
198
  fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
199
199
  fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
200
- fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "normal" | "bolder" | "lighter")[] | undefined;
200
+ fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
201
201
  fontWidth?: readonly string[] | csstype.Property.FontWidth | readonly csstype.Property.FontWidth[] | undefined;
202
202
  forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
203
203
  gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
@@ -460,9 +460,9 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
460
460
  x?: readonly (string | (string & {}))[] | csstype.Property.X<string | number> | readonly NonNullable<csstype.Property.X<string | number> | undefined>[] | undefined;
461
461
  y?: readonly (string | (string & {}))[] | csstype.Property.Y<string | number> | readonly NonNullable<csstype.Property.Y<string | number> | undefined>[] | undefined;
462
462
  zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
463
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
463
+ zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
464
464
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
465
- animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
465
+ animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
466
466
  animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
467
467
  background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
468
468
  border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
@@ -474,7 +474,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
474
474
  borderBlockWidth?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockWidth<string | number> | readonly NonNullable<csstype.Property.BorderBlockWidth<string | number> | undefined>[] | undefined;
475
475
  borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
476
476
  borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
477
- borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
477
+ borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
478
478
  borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
479
479
  borderInlineColor?: readonly string[] | csstype.Property.BorderInlineColor | readonly csstype.Property.BorderInlineColor[] | undefined;
480
480
  borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
@@ -509,7 +509,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
509
509
  marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
510
510
  marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
511
511
  mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
512
- maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
512
+ maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
513
513
  motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
514
514
  offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
515
515
  outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
@@ -758,8 +758,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
758
758
  WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
759
759
  WebkitUserSelect?: csstype.Property.WebkitUserSelect | readonly NonNullable<csstype.Property.WebkitUserSelect | undefined>[] | readonly csstype.Property.WebkitUserSelect[] | undefined;
760
760
  WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
761
- MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
- MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
761
+ MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
+ MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
763
763
  MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
764
764
  MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
765
765
  MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
@@ -771,16 +771,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
771
771
  msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
772
772
  msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
773
773
  msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
774
- WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
774
+ WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
775
775
  WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
776
- WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
776
+ WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
777
777
  WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
778
778
  WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
779
779
  WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
780
780
  WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
781
781
  WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
782
782
  WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
783
- WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
783
+ WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
784
784
  WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
785
785
  WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
786
786
  WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
@@ -861,7 +861,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
861
861
  MozUserFocus?: csstype.Property.MozUserFocus | readonly NonNullable<csstype.Property.MozUserFocus | undefined>[] | readonly csstype.Property.MozUserFocus[] | undefined;
862
862
  MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
863
863
  msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
864
- OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
864
+ OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
865
865
  OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
866
866
  OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
867
867
  OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
@@ -871,7 +871,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
871
871
  OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
872
872
  OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
873
873
  OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
874
- OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
874
+ OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
875
875
  OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
876
876
  OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
877
877
  OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
@@ -1914,6 +1914,7 @@ declare function menuItem(theme: Theme): {
1914
1914
  colorRendering?: csstype.Property.ColorRendering | undefined;
1915
1915
  glyphOrientationVertical?: csstype.Property.GlyphOrientationVertical | undefined;
1916
1916
  };
1917
+ declare function whenAutoFilled(selector: string): string;
1917
1918
 
1918
1919
  declare const stylesMode: {
1919
1920
  light: string;
@@ -1949,4 +1950,4 @@ interface ColorWithAlpha {
1949
1950
  }
1950
1951
  declare function varAlpha(color: string, opacity?: number): string;
1951
1952
 
1952
- export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha };
1953
+ export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha, whenAutoFilled };
@@ -1,2 +1,2 @@
1
- export { q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha } from '../../chunk-GLRLKFPS.js';
1
+ export { q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha, u as whenAutoFilled } from '../../chunk-Y66XXBB3.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,11 +1,11 @@
1
- export { b as default } from '../chunk-JM3SE72J.js';
1
+ export { b as default } from '../chunk-TAA5KCEG.js';
2
2
  import '../chunk-373WGZZL.js';
3
3
  import '../chunk-WUFEPE2G.js';
4
4
  export { b as useSettingsContext } from '../chunk-BX2DSNRV.js';
5
- import '../chunk-X4F3O7PX.js';
6
- import '../chunk-Q2AVS24Z.js';
5
+ import '../chunk-BKL525ZD.js';
6
+ import '../chunk-7GJMLPJV.js';
7
7
  import '../chunk-LNESYSHP.js';
8
- import '../chunk-YPL4KIKN.js';
8
+ import '../chunk-4734QSYC.js';
9
9
  import '../chunk-HBOBTNB5.js';
10
- export { a as THEME_CONFIG } from '../chunk-GLRLKFPS.js';
10
+ export { a as THEME_CONFIG } from '../chunk-Y66XXBB3.js';
11
11
  //# sourceMappingURL=theme-provider.js.map
@@ -1,6 +1,6 @@
1
- export { c as buildPrimaryColors, b as updateComponentsWithSettings, a as updateCoreWithSettings } from '../../chunk-Q2AVS24Z.js';
1
+ export { c as buildPrimaryColors, b as updateComponentsWithSettings, a as updateCoreWithSettings } from '../../chunk-7GJMLPJV.js';
2
2
  import '../../chunk-LNESYSHP.js';
3
- import '../../chunk-YPL4KIKN.js';
3
+ import '../../chunk-4734QSYC.js';
4
4
  import '../../chunk-HBOBTNB5.js';
5
- import '../../chunk-GLRLKFPS.js';
5
+ import '../../chunk-Y66XXBB3.js';
6
6
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.9.21",
3
+ "version": "2.9.23",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- import { a as a$1 } from './chunk-FJBC6QA5.js';
2
- import { a } from './chunk-POTVACYB.js';
3
- import { useCallback, useState, useEffect } from 'react';
4
-
5
- var h=typeof window>"u",p=(r,t,o={})=>{let{initializeWithValue:l=!0}=o,S=useCallback(e=>o.serializer?o.serializer(e):JSON.stringify(e),[o]),d=useCallback(e=>{if(o.deserializer)return o.deserializer(e);if(e==="undefined")return;let n=t instanceof Function?t():t,g;try{g=JSON.parse(e);}catch{return n}return g},[o,t]),a$2=useCallback(()=>{let e=t instanceof Function?t():t;if(h)return e;try{let n=window.localStorage.getItem(r);return n?d(n):e}catch{return e}},[t,r,d]),[w,s]=useState(()=>l?a$2():t instanceof Function?t():t),T=a(e=>{try{let n=e instanceof Function?e(a$2()):e;window.localStorage.setItem(r,S(n)),s(n),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));}catch{}}),m=a(()=>{let e=t instanceof Function?t():t;window.localStorage.removeItem(r),s(e),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));});useEffect(()=>{s(a$2());},[r]);let f=useCallback(e=>{e.key&&e.key!==r||s(a$2());},[r,a$2]);return a$1("storage",f),a$1("local-storage",f),[w,T,m]},I=p;
6
-
7
- export { I as a };
8
- //# sourceMappingURL=chunk-2HAPOY5M.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/useLocalStorage.ts"],"names":["useCallback","useEffect","useState","IS_SERVER","useLocalStorage","key","initialValue","options","initializeWithValue","serializer","value","deserializer","defaultValue","parsed","readValue","initialValueToUse","raw","storedValue","setStoredValue","setValue","useEventCallback_default","newValue","removeValue","handleStorageChange","event","useEventListener_default","useLocalStorage_default"],"mappings":"gFACA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAiBjD,IAAMC,EAAY,OAAO,OAAW,IAE9BC,EAAkB,CACtBC,EACAC,EACAC,EAAqC,CAAC,IACW,CACjD,GAAM,CAAE,oBAAAC,EAAsB,EAAK,EAAID,EAEjCE,EAAaT,EACjBU,GACMH,EAAQ,WACHA,EAAQ,WAAWG,CAAK,EAE1B,KAAK,UAAUA,CAAK,EAE7B,CAACH,CAAO,CACV,EAEMI,EAAeX,EACnBU,GAAS,CACP,GAAIH,EAAQ,aACV,OAAOA,EAAQ,aAAaG,CAAK,EAEnC,GAAIA,IAAU,YACZ,OAGF,IAAME,EACJN,aAAwB,SAAWA,EAAa,EAAIA,EAElDO,EACJ,GAAI,CACFA,EAAS,KAAK,MAAMH,CAAK,CAC3B,MAAE,CACA,OAAOE,CACT,CAEA,OAAOC,CACT,EACA,CAACN,EAASD,CAAY,CACxB,EAEMQ,EAAYd,EAAY,IAAS,CACrC,IAAMe,EACJT,aAAwB,SAAWA,EAAa,EAAIA,EAEtD,GAAIH,EACF,OAAOY,EAGT,GAAI,CACF,IAAMC,EAAM,OAAO,aAAa,QAAQX,CAAG,EAC3C,OAAOW,EAAML,EAAaK,CAAG,EAAID,CACnC,MAAE,CACA,OAAOA,CACT,CACF,EAAG,CAACT,EAAcD,EAAKM,CAAY,CAAC,EAE9B,CAACM,EAAaC,CAAc,EAAIhB,EAAS,IACzCM,EACKM,EAAU,EAEZR,aAAwB,SAAWA,EAAa,EAAIA,CAC5D,EAEKa,EAAwCC,EAAiBV,GAAS,CACtE,GAAI,CACF,IAAMW,EAAWX,aAAiB,SAAWA,EAAMI,EAAU,CAAC,EAAIJ,EAClE,OAAO,aAAa,QAAQL,EAAKI,EAAWY,CAAQ,CAAC,EACrDH,EAAeG,CAAQ,EACvB,OAAO,cAAc,IAAI,aAAa,gBAAiB,CAAE,IAAAhB,CAAI,CAAC,CAAC,CACjE,MAAE,CAEF,CACF,CAAC,EAEKiB,EAAcF,EAAiB,IAAM,CACzC,IAAMR,EACJN,aAAwB,SAAWA,EAAa,EAAIA,EACtD,OAAO,aAAa,WAAWD,CAAG,EAClCa,EAAeN,CAAY,EAC3B,OAAO,cAAc,IAAI,aAAa,gBAAiB,CAAE,IAAAP,CAAI,CAAC,CAAC,CACjE,CAAC,EAEDJ,EAAU,IAAM,CACdiB,EAAeJ,EAAU,CAAC,CAE5B,EAAG,CAACT,CAAG,CAAC,EAER,IAAMkB,EAAsBvB,EACzBwB,GAAsC,CAChCA,EAAuB,KAAQA,EAAuB,MAAQnB,GAGnEa,EAAeJ,EAAU,CAAC,CAC5B,EACA,CAACT,EAAKS,CAAS,CACjB,EAEA,OAAAW,EAAiB,UAAWF,CAAmB,EAC/CE,EAAiB,gBAAiBF,CAAmB,EAE9C,CAACN,EAAaE,EAAUG,CAAW,CAC5C,EAEOI,EAAQtB","sourcesContent":["import type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport useEventCallback from './useEventCallback';\nimport useEventListener from './useEventListener';\n\ndeclare global {\n interface WindowEventMap {\n 'local-storage': CustomEvent;\n }\n}\n\ntype UseLocalStorageOptions<T> = {\n serializer?: (value: T) => string;\n deserializer?: (value: string) => T;\n initializeWithValue?: boolean;\n};\n\nconst IS_SERVER = typeof window === 'undefined';\n\nconst useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n options: UseLocalStorageOptions<T> = {},\n): [T, Dispatch<SetStateAction<T>>, () => void] => {\n const { initializeWithValue = true } = options;\n\n const serializer = useCallback<(value: T) => string>(\n value => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options],\n );\n\n const deserializer = useCallback<(value: string) => T>(\n value => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === 'undefined') {\n return undefined as unknown as T;\n }\n\n const defaultValue =\n initialValue instanceof Function ? initialValue() : initialValue;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n return defaultValue;\n }\n\n return parsed as T;\n },\n [options, initialValue],\n );\n\n const readValue = useCallback((): T => {\n const initialValueToUse =\n initialValue instanceof Function ? initialValue() : initialValue;\n\n if (IS_SERVER) {\n return initialValueToUse;\n }\n\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n\n const setValue: Dispatch<SetStateAction<T>> = useEventCallback(value => {\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent('local-storage', { key }));\n } catch {\n /* empty */\n }\n });\n\n const removeValue = useEventCallback(() => {\n const defaultValue =\n initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent('local-storage', { key }));\n });\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n const handleStorageChange = useCallback(\n (event: StorageEvent | CustomEvent) => {\n if ((event as StorageEvent).key && (event as StorageEvent).key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue],\n );\n\n useEventListener('storage', handleStorageChange);\n useEventListener('local-storage', handleStorageChange);\n\n return [storedValue, setValue, removeValue];\n};\n\nexport default useLocalStorage;\n"]}
@@ -1,7 +0,0 @@
1
- import { useTheme } from '@mui/material/styles';
2
- import n from '@mui/material/useMediaQuery';
3
-
4
- var m=(e,t,r)=>{let o=useTheme(),u=n(o.breakpoints.up(t)),s=n(o.breakpoints.down(t)),p=n(o.breakpoints.between(t,r)),i=n(o.breakpoints.only(t));return e==="up"?u:e==="down"?s:e==="between"?p:i};function d(){let e=useTheme(),t=n(e.breakpoints.up("xl")),r=n(e.breakpoints.up("lg")),o=n(e.breakpoints.up("md")),u=n(e.breakpoints.up("sm"));return t?"xl":r?"lg":o?"md":u?"sm":"xs"}var f=m;
5
-
6
- export { d as a, f as b };
7
- //# sourceMappingURL=chunk-2ZJUGM2S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/useResponsive.ts"],"names":["useTheme","useMediaQuery","useResponsive","query","start","end","theme","mediaUp","mediaDown","mediaBetween","mediaOnly","useWidth","matchXl","matchLg","matchMd","matchSm","useResponsive_default"],"mappings":"AAAA,OAAqB,YAAAA,MAAgB,uBACrC,OAAOC,MAAmB,8BAQ1B,IAAMC,EAAgB,CACpBC,EACAC,EACAC,IACe,CACf,IAAMC,EAAQN,EAAS,EAEjBO,EAAUN,EAAcK,EAAM,YAAY,GAAGF,CAAc,CAAC,EAE5DI,EAAYP,EAAcK,EAAM,YAAY,KAAKF,CAAc,CAAC,EAEhEK,EAAeR,EACnBK,EAAM,YAAY,QAAQF,EAAgBC,CAAY,CACxD,EAEMK,EAAYT,EAAcK,EAAM,YAAY,KAAKF,CAAmB,CAAC,EAE3E,OAAID,IAAU,KACLI,EAGLJ,IAAU,OACLK,EAGLL,IAAU,UACLM,EAGFC,CACT,EAEO,SAASC,GAAW,CACzB,IAAML,EAAQN,EAAS,EAEjBY,EAAUX,EAAcK,EAAM,YAAY,GAAG,IAAI,CAAC,EAClDO,EAAUZ,EAAcK,EAAM,YAAY,GAAG,IAAI,CAAC,EAClDQ,EAAUb,EAAcK,EAAM,YAAY,GAAG,IAAI,CAAC,EAClDS,EAAUd,EAAcK,EAAM,YAAY,GAAG,IAAI,CAAC,EAExD,OAAIM,EAAgB,KAChBC,EAAgB,KAChBC,EAAgB,KAChBC,EAAgB,KACb,IACT,CAEA,IAAOC,EAAQd","sourcesContent":["import { Breakpoint, useTheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\ntype ReturnType = boolean;\n\ntype Query = 'up' | 'down' | 'between' | 'only';\n\ntype Value = Breakpoint | number;\n\nconst useResponsive = (\n query: Query,\n start?: Value,\n end?: Value,\n): ReturnType => {\n const theme = useTheme();\n\n const mediaUp = useMediaQuery(theme.breakpoints.up(start as Value));\n\n const mediaDown = useMediaQuery(theme.breakpoints.down(start as Value));\n\n const mediaBetween = useMediaQuery(\n theme.breakpoints.between(start as Value, end as Value),\n );\n\n const mediaOnly = useMediaQuery(theme.breakpoints.only(start as Breakpoint));\n\n if (query === 'up') {\n return mediaUp;\n }\n\n if (query === 'down') {\n return mediaDown;\n }\n\n if (query === 'between') {\n return mediaBetween;\n }\n\n return mediaOnly;\n};\n\nexport function useWidth() {\n const theme = useTheme();\n\n const matchXl = useMediaQuery(theme.breakpoints.up('xl'));\n const matchLg = useMediaQuery(theme.breakpoints.up('lg'));\n const matchMd = useMediaQuery(theme.breakpoints.up('md'));\n const matchSm = useMediaQuery(theme.breakpoints.up('sm'));\n\n if (matchXl) return 'xl';\n if (matchLg) return 'lg';\n if (matchMd) return 'md';\n if (matchSm) return 'sm';\n return 'xs';\n}\n\nexport default useResponsive;\n"]}
@@ -1,6 +0,0 @@
1
- import { useState } from 'react';
2
-
3
- var p=()=>{let[o,e]=useState(null);return {copiedText:o,copy:async t=>{if(!navigator?.clipboard)return !1;try{return await navigator.clipboard.writeText(t),e(t),!0}catch{return e(null),!1}}}},l=p;
4
-
5
- export { l as a };
6
- //# sourceMappingURL=chunk-CFNATBO2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/useCopyToClipboard.ts"],"names":["useState","useCopyToClipboard","copiedText","setCopiedText","text","useCopyToClipboard_default"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,QAWzB,IAAMC,EAAqB,IAAkB,CAC3C,GAAM,CAACC,EAAYC,CAAa,EAAIH,EAAsB,IAAI,EAe9D,MAAO,CAAE,WAAAE,EAAY,KAbA,MAAME,GAAQ,CACjC,GAAI,CAAC,WAAW,UAAW,MAAO,GAElC,GAAI,CACF,aAAM,UAAU,UAAU,UAAUA,CAAI,EACxCD,EAAcC,CAAI,EACX,EACT,MAAE,CACA,OAAAD,EAAc,IAAI,EACX,EACT,CACF,CAE0B,CAC5B,EAEOE,EAAQJ","sourcesContent":["import { useState } from 'react';\n\ntype CopiedValue = string | null;\n\ntype CopyFn = (text: string) => Promise<boolean>;\n\ntype ReturnType = {\n copy: CopyFn;\n copiedText: CopiedValue;\n};\n\nconst useCopyToClipboard = (): ReturnType => {\n const [copiedText, setCopiedText] = useState<CopiedValue>(null);\n\n const copy: CopyFn = async text => {\n if (!navigator?.clipboard) return false;\n\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n setCopiedText(null);\n return false;\n }\n };\n\n return { copiedText, copy };\n};\n\nexport default useCopyToClipboard;\n"]}