@makroz/web 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MkButton.d.ts.map +1 -1
- package/dist/components/MkButton.js +0 -2
- package/dist/components/MkButton.js.map +1 -1
- package/dist/components/MkThemeEditor.js +1 -1
- package/dist/components/MkThemeEditor.js.map +1 -1
- package/dist/components/MkToastContainer.d.ts.map +1 -1
- package/dist/components/MkToastContainer.js +0 -2
- package/dist/components/MkToastContainer.js.map +1 -1
- package/dist/components/MkToastContainer.stories.d.ts.map +1 -0
- package/dist/components/MkToastContainer.stories.test.d.ts.map +1 -0
- package/dist/context/MkAuthContext.d.ts +1 -2
- package/dist/context/MkAuthContext.d.ts.map +1 -1
- package/dist/context/MkAuthContext.js +1 -3
- package/dist/context/MkAuthContext.js.map +1 -1
- package/dist/context/MkConfirmContext.d.ts +1 -2
- package/dist/context/MkConfirmContext.d.ts.map +1 -1
- package/dist/context/MkConfirmContext.js +0 -2
- package/dist/context/MkConfirmContext.js.map +1 -1
- package/dist/context/MkToastContext.d.ts +1 -2
- package/dist/context/MkToastContext.d.ts.map +1 -1
- package/dist/context/MkToastContext.js +0 -2
- package/dist/context/MkToastContext.js.map +1 -1
- package/dist/hooks/useApi.d.ts +5 -6
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useApi.js +0 -2
- package/dist/hooks/useApi.js.map +1 -1
- package/dist/hooks/useMkCrud.d.ts.map +1 -1
- package/dist/hooks/useMkCrud.js +0 -2
- package/dist/hooks/useMkCrud.js.map +1 -1
- package/dist/hooks/useMkCrud.test.js +0 -2
- package/dist/hooks/useMkCrud.test.js.map +1 -1
- package/dist/hooks/useMkForm.d.ts.map +1 -1
- package/dist/hooks/useMkForm.js +1 -1
- package/dist/hooks/useMkForm.js.map +1 -1
- package/dist/hooks/useMkList.d.ts +7 -7
- package/dist/theme/MkThemeProvider.d.ts.map +1 -1
- package/dist/theme/MkThemeProvider.js +2 -2
- package/dist/theme/MkThemeProvider.js.map +1 -1
- package/eslint-plugin-mk/README.md +167 -0
- package/package.json +17 -5
- package/dist/auth/MkAuthContext.d.ts +0 -43
- package/dist/auth/MkAuthContext.d.ts.map +0 -1
- package/dist/auth/MkAuthContext.js +0 -3
- package/dist/auth/MkAuthContext.js.map +0 -1
- package/dist/auth/MkAuthForm.d.ts +0 -42
- package/dist/auth/MkAuthForm.d.ts.map +0 -1
- package/dist/auth/MkAuthForm.js +0 -53
- package/dist/auth/MkAuthForm.js.map +0 -1
- package/dist/auth/MkAuthProvider.d.ts +0 -30
- package/dist/auth/MkAuthProvider.d.ts.map +0 -1
- package/dist/auth/MkAuthProvider.js +0 -319
- package/dist/auth/MkAuthProvider.js.map +0 -1
- package/dist/auth/auth/MkAuthContext.d.ts +0 -42
- package/dist/auth/auth/MkAuthForm.d.ts +0 -41
- package/dist/auth/auth/MkAuthProvider.d.ts +0 -29
- package/dist/auth/auth/types.d.ts +0 -62
- package/dist/auth/auth/useMkAuth.d.ts +0 -18
- package/dist/auth/components/MkButton.d.ts +0 -10
- package/dist/auth/components/MkInput.d.ts +0 -12
- package/dist/auth/types.d.ts +0 -63
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -20
- package/dist/auth/types.js.map +0 -1
- package/dist/auth/useMkAuth.d.ts +0 -19
- package/dist/auth/useMkAuth.d.ts.map +0 -1
- package/dist/auth/useMkAuth.js +0 -26
- package/dist/auth/useMkAuth.js.map +0 -1
- package/dist/components/MkAccordion.d.ts +0 -36
- package/dist/components/MkAccordion.d.ts.map +0 -1
- package/dist/components/MkAccordion.js +0 -25
- package/dist/components/MkAccordion.js.map +0 -1
- package/dist/components/MkAccordion.module.css +0 -79
- package/dist/components/MkAlert.d.ts +0 -25
- package/dist/components/MkAlert.d.ts.map +0 -1
- package/dist/components/MkAlert.js +0 -23
- package/dist/components/MkAlert.js.map +0 -1
- package/dist/components/MkAlert.module.css +0 -103
- package/dist/components/MkAvatar.d.ts +0 -16
- package/dist/components/MkAvatar.d.ts.map +0 -1
- package/dist/components/MkAvatar.js +0 -25
- package/dist/components/MkAvatar.js.map +0 -1
- package/dist/components/MkAvatar.module.css +0 -62
- package/dist/components/MkBadge.d.ts +0 -15
- package/dist/components/MkBadge.d.ts.map +0 -1
- package/dist/components/MkBadge.js +0 -9
- package/dist/components/MkBadge.js.map +0 -1
- package/dist/components/MkBadge.module.css +0 -74
- package/dist/components/MkButton.d.ts +0 -11
- package/dist/components/MkButton.module.css +0 -85
- package/dist/components/MkButton.test.d.ts +0 -2
- package/dist/components/MkButton.test.d.ts.map +0 -1
- package/dist/components/MkButton.test.js +0 -58
- package/dist/components/MkButton.test.js.map +0 -1
- package/dist/components/MkCard.d.ts +0 -18
- package/dist/components/MkCard.d.ts.map +0 -1
- package/dist/components/MkCard.js +0 -8
- package/dist/components/MkCard.js.map +0 -1
- package/dist/components/MkCard.module.css +0 -63
- package/dist/components/MkCheck.d.ts +0 -32
- package/dist/components/MkCheck.d.ts.map +0 -1
- package/dist/components/MkCheck.js +0 -14
- package/dist/components/MkCheck.js.map +0 -1
- package/dist/components/MkCheck.module.css +0 -87
- package/dist/components/MkDatePicker.d.ts +0 -29
- package/dist/components/MkDatePicker.d.ts.map +0 -1
- package/dist/components/MkDatePicker.js +0 -12
- package/dist/components/MkDatePicker.js.map +0 -1
- package/dist/components/MkDatePicker.module.css +0 -77
- package/dist/components/MkDivider.d.ts +0 -14
- package/dist/components/MkDivider.d.ts.map +0 -1
- package/dist/components/MkDivider.js +0 -14
- package/dist/components/MkDivider.js.map +0 -1
- package/dist/components/MkDivider.module.css +0 -39
- package/dist/components/MkDropDown.d.ts +0 -22
- package/dist/components/MkDropDown.d.ts.map +0 -1
- package/dist/components/MkDropDown.js +0 -26
- package/dist/components/MkDropDown.js.map +0 -1
- package/dist/components/MkDropDown.module.css +0 -108
- package/dist/components/MkEmptyState.d.ts +0 -14
- package/dist/components/MkEmptyState.d.ts.map +0 -1
- package/dist/components/MkEmptyState.js +0 -8
- package/dist/components/MkEmptyState.js.map +0 -1
- package/dist/components/MkEmptyState.module.css +0 -35
- package/dist/components/MkFileUpload.d.ts +0 -36
- package/dist/components/MkFileUpload.d.ts.map +0 -1
- package/dist/components/MkFileUpload.js +0 -52
- package/dist/components/MkFileUpload.js.map +0 -1
- package/dist/components/MkFileUpload.module.css +0 -74
- package/dist/components/MkIcons.d.ts +0 -14
- package/dist/components/MkIcons.d.ts.map +0 -1
- package/dist/components/MkIcons.js +0 -38
- package/dist/components/MkIcons.js.map +0 -1
- package/dist/components/MkInfiniteList.d.ts +0 -15
- package/dist/components/MkInfiniteList.d.ts.map +0 -1
- package/dist/components/MkInfiniteList.js +0 -31
- package/dist/components/MkInfiniteList.js.map +0 -1
- package/dist/components/MkInfiniteList.module.css +0 -69
- package/dist/components/MkInput.d.ts +0 -13
- package/dist/components/MkInput.d.ts.map +0 -1
- package/dist/components/MkInput.js +0 -23
- package/dist/components/MkInput.js.map +0 -1
- package/dist/components/MkInput.module.css +0 -94
- package/dist/components/MkLoading.d.ts +0 -20
- package/dist/components/MkLoading.d.ts.map +0 -1
- package/dist/components/MkLoading.js +0 -16
- package/dist/components/MkLoading.js.map +0 -1
- package/dist/components/MkLoading.module.css +0 -39
- package/dist/components/MkModal.d.ts +0 -20
- package/dist/components/MkModal.d.ts.map +0 -1
- package/dist/components/MkModal.js +0 -33
- package/dist/components/MkModal.js.map +0 -1
- package/dist/components/MkModal.module.css +0 -107
- package/dist/components/MkProgressBar.d.ts +0 -17
- package/dist/components/MkProgressBar.d.ts.map +0 -1
- package/dist/components/MkProgressBar.js +0 -9
- package/dist/components/MkProgressBar.js.map +0 -1
- package/dist/components/MkProgressBar.module.css +0 -48
- package/dist/components/MkRadio.d.ts +0 -34
- package/dist/components/MkRadio.d.ts.map +0 -1
- package/dist/components/MkRadio.js +0 -21
- package/dist/components/MkRadio.js.map +0 -1
- package/dist/components/MkRadio.module.css +0 -74
- package/dist/components/MkSearchInput.d.ts +0 -30
- package/dist/components/MkSearchInput.d.ts.map +0 -1
- package/dist/components/MkSearchInput.js +0 -29
- package/dist/components/MkSearchInput.js.map +0 -1
- package/dist/components/MkSearchInput.module.css +0 -80
- package/dist/components/MkSelect.d.ts +0 -23
- package/dist/components/MkSelect.d.ts.map +0 -1
- package/dist/components/MkSelect.js +0 -61
- package/dist/components/MkSelect.js.map +0 -1
- package/dist/components/MkSelect.module.css +0 -177
- package/dist/components/MkSkeleton.d.ts +0 -22
- package/dist/components/MkSkeleton.d.ts.map +0 -1
- package/dist/components/MkSkeleton.js +0 -23
- package/dist/components/MkSkeleton.js.map +0 -1
- package/dist/components/MkSkeleton.module.css +0 -28
- package/dist/components/MkSwitch.d.ts +0 -22
- package/dist/components/MkSwitch.d.ts.map +0 -1
- package/dist/components/MkSwitch.js +0 -16
- package/dist/components/MkSwitch.js.map +0 -1
- package/dist/components/MkSwitch.module.css +0 -108
- package/dist/components/MkTable.d.ts +0 -27
- package/dist/components/MkTable.d.ts.map +0 -1
- package/dist/components/MkTable.js +0 -13
- package/dist/components/MkTable.js.map +0 -1
- package/dist/components/MkTable.module.css +0 -163
- package/dist/components/MkTabs.d.ts +0 -22
- package/dist/components/MkTabs.d.ts.map +0 -1
- package/dist/components/MkTabs.js +0 -19
- package/dist/components/MkTabs.js.map +0 -1
- package/dist/components/MkTabs.module.css +0 -117
- package/dist/components/MkTextArea.d.ts +0 -21
- package/dist/components/MkTextArea.d.ts.map +0 -1
- package/dist/components/MkTextArea.js +0 -10
- package/dist/components/MkTextArea.js.map +0 -1
- package/dist/components/MkThemeEditor.d.ts +0 -8
- package/dist/components/MkThemeEditor.module.css +0 -177
- package/dist/components/MkToastContainer.d.ts +0 -3
- package/dist/components/MkToastContainer.module.css +0 -95
- package/dist/components/MkTooltip.d.ts +0 -14
- package/dist/components/MkTooltip.d.ts.map +0 -1
- package/dist/components/MkTooltip.js +0 -19
- package/dist/components/MkTooltip.js.map +0 -1
- package/dist/components/MkTooltip.module.css +0 -43
- package/dist/components/MkWindowList.d.ts +0 -20
- package/dist/components/MkWindowList.d.ts.map +0 -1
- package/dist/components/MkWindowList.js +0 -61
- package/dist/components/MkWindowList.js.map +0 -1
- package/dist/components/MkWindowList.module.css +0 -59
- package/dist/components/index.d.ts +0 -31
- package/dist/components/index.js +0 -34
- package/dist/components/index.js.map +0 -1
- package/dist/context/MkApiContext.d.ts +0 -15
- package/dist/context/MkApiContext.d.ts.map +0 -1
- package/dist/context/MkApiContext.js +0 -30
- package/dist/context/MkApiContext.js.map +0 -1
- package/dist/hooks/useApi.test.d.ts +0 -2
- package/dist/hooks/useApi.test.js +0 -186
- package/dist/hooks/useApi.test.js.map +0 -1
- package/dist/hooks/useMkClickOutside.d.ts +0 -8
- package/dist/hooks/useMkClickOutside.d.ts.map +0 -1
- package/dist/hooks/useMkClickOutside.js +0 -26
- package/dist/hooks/useMkClickOutside.js.map +0 -1
- package/dist/hooks/useMkCrud.d.ts +0 -39
- package/dist/hooks/useMkCrud.test.d.ts +0 -2
- package/dist/hooks/useMkDebounce.d.ts +0 -24
- package/dist/hooks/useMkDebounce.d.ts.map +0 -1
- package/dist/hooks/useMkDebounce.js +0 -38
- package/dist/hooks/useMkDebounce.js.map +0 -1
- package/dist/hooks/useMkEffectDebug.d.ts +0 -7
- package/dist/hooks/useMkEffectDebug.d.ts.map +0 -1
- package/dist/hooks/useMkEffectDebug.js +0 -26
- package/dist/hooks/useMkEffectDebug.js.map +0 -1
- package/dist/hooks/useMkEvent.d.ts +0 -31
- package/dist/hooks/useMkEvent.d.ts.map +0 -1
- package/dist/hooks/useMkEvent.js +0 -56
- package/dist/hooks/useMkEvent.js.map +0 -1
- package/dist/hooks/useMkForm.d.ts +0 -43
- package/dist/hooks/useMkForm.test.d.ts +0 -2
- package/dist/hooks/useMkInViewPort.d.ts +0 -14
- package/dist/hooks/useMkInViewPort.d.ts.map +0 -1
- package/dist/hooks/useMkInViewPort.js +0 -31
- package/dist/hooks/useMkInViewPort.js.map +0 -1
- package/dist/hooks/useMkInfiniteList.d.ts +0 -15
- package/dist/hooks/useMkInfiniteList.js +0 -47
- package/dist/hooks/useMkInfiniteList.js.map +0 -1
- package/dist/hooks/useMkList.js +0 -54
- package/dist/hooks/useMkList.js.map +0 -1
- package/dist/hooks/useMkLocalStorage.d.ts +0 -6
- package/dist/hooks/useMkLocalStorage.d.ts.map +0 -1
- package/dist/hooks/useMkLocalStorage.js +0 -33
- package/dist/hooks/useMkLocalStorage.js.map +0 -1
- package/dist/hooks/useMkLongPress.d.ts +0 -37
- package/dist/hooks/useMkLongPress.d.ts.map +0 -1
- package/dist/hooks/useMkLongPress.js +0 -59
- package/dist/hooks/useMkLongPress.js.map +0 -1
- package/dist/hooks/useMkMediaQuery.d.ts +0 -14
- package/dist/hooks/useMkMediaQuery.d.ts.map +0 -1
- package/dist/hooks/useMkMediaQuery.js +0 -31
- package/dist/hooks/useMkMediaQuery.js.map +0 -1
- package/dist/hooks/useMkPrevious.d.ts +0 -7
- package/dist/hooks/useMkPrevious.d.ts.map +0 -1
- package/dist/hooks/useMkPrevious.js +0 -14
- package/dist/hooks/useMkPrevious.js.map +0 -1
- package/dist/hooks/useMkScreenSize.d.ts +0 -25
- package/dist/hooks/useMkScreenSize.d.ts.map +0 -1
- package/dist/hooks/useMkScreenSize.js +0 -43
- package/dist/hooks/useMkScreenSize.js.map +0 -1
- package/dist/hooks/useMkStore.d.ts +0 -22
- package/dist/hooks/useMkStore.d.ts.map +0 -1
- package/dist/hooks/useMkStore.js +0 -58
- package/dist/hooks/useMkStore.js.map +0 -1
- package/dist/hooks/useMkToggle.d.ts +0 -6
- package/dist/hooks/useMkToggle.d.ts.map +0 -1
- package/dist/hooks/useMkToggle.js +0 -13
- package/dist/hooks/useMkToggle.js.map +0 -1
- package/dist/index.d.ts +0 -33
- package/dist/index.js +0 -37
- package/dist/index.js.map +0 -1
- package/dist/styles/index.css +0 -124
- package/dist/test-setup.d.ts +0 -2
- package/dist/test-setup.d.ts.map +0 -1
- package/dist/test-setup.js +0 -2
- package/dist/test-setup.js.map +0 -1
- package/dist/theme/MkThemeProvider.d.ts +0 -20
- package/dist/utils/images.d.ts +0 -9
- package/dist/utils/images.d.ts.map +0 -1
- package/dist/utils/images.js +0 -50
- package/dist/utils/images.js.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* useMkMediaQuery — Track CSS media query matches reactively.
|
|
4
|
-
*
|
|
5
|
-
* @param query - CSS media query string (e.g., '(max-width: 768px)')
|
|
6
|
-
* @returns `true` if the query matches, `false` otherwise.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* const isMobile = useMkMediaQuery('(max-width: 600px)');
|
|
11
|
-
* const prefersDark = useMkMediaQuery('(prefers-color-scheme: dark)');
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export function useMkMediaQuery(query) {
|
|
15
|
-
const [matches, setMatches] = useState(() => {
|
|
16
|
-
if (typeof window === 'undefined')
|
|
17
|
-
return false;
|
|
18
|
-
return window.matchMedia(query).matches;
|
|
19
|
-
});
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (typeof window === 'undefined')
|
|
22
|
-
return;
|
|
23
|
-
const mediaQuery = window.matchMedia(query);
|
|
24
|
-
setMatches(mediaQuery.matches);
|
|
25
|
-
const handler = (event) => setMatches(event.matches);
|
|
26
|
-
mediaQuery.addEventListener('change', handler);
|
|
27
|
-
return () => mediaQuery.removeEventListener('change', handler);
|
|
28
|
-
}, [query]);
|
|
29
|
-
return matches;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=useMkMediaQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkMediaQuery.js","sourceRoot":"","sources":["../../src/hooks/useMkMediaQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IACzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,GAAG,EAAE;QACjD,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC5C,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE/B,MAAM,OAAO,GAAG,CAAC,KAA0B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1E,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE/C,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useMkPrevious
|
|
3
|
-
* 🚀 Retorna el valor del render anterior.
|
|
4
|
-
* Útil para comparar cambios de props o estados y disparar animaciones o efectos.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useMkPrevious: <T>(value: T, initialValue?: T) => T | undefined;
|
|
7
|
-
//# sourceMappingURL=useMkPrevious.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkPrevious.d.ts","sourceRoot":"","sources":["../../src/hooks/useMkPrevious.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,KAAG,CAAC,GAAG,SAQjE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* useMkPrevious
|
|
4
|
-
* 🚀 Retorna el valor del render anterior.
|
|
5
|
-
* Útil para comparar cambios de props o estados y disparar animaciones o efectos.
|
|
6
|
-
*/
|
|
7
|
-
export const useMkPrevious = (value, initialValue) => {
|
|
8
|
-
const ref = useRef(initialValue);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
ref.current = value;
|
|
11
|
-
}, [value]);
|
|
12
|
-
return ref.current;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=useMkPrevious.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkPrevious.js","sourceRoot":"","sources":["../../src/hooks/useMkPrevious.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,KAAQ,EAAE,YAAgB,EAAiB,EAAE;IAC1E,MAAM,GAAG,GAAG,MAAM,CAAgB,YAAY,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACX,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,GAAG,CAAC,OAAO,CAAC;AACvB,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface MkScreenSize {
|
|
2
|
-
width: number;
|
|
3
|
-
height: number;
|
|
4
|
-
isMobile: boolean;
|
|
5
|
-
isTablet: boolean;
|
|
6
|
-
isDesktop: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface MkScreenBreakpoints {
|
|
9
|
-
mobile: number;
|
|
10
|
-
tablet: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* useMkScreenSize — Track viewport dimensions and responsive breakpoints.
|
|
14
|
-
*
|
|
15
|
-
* @param breakpoints - Custom breakpoint thresholds (optional).
|
|
16
|
-
* @returns Object with `width`, `height`, `isMobile`, `isTablet`, `isDesktop`.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* const { isMobile, isDesktop, width } = useMkScreenSize();
|
|
21
|
-
* const { isMobile } = useMkScreenSize({ mobile: 480, tablet: 768 });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function useMkScreenSize(breakpoints?: Partial<MkScreenBreakpoints>): MkScreenSize;
|
|
25
|
-
//# sourceMappingURL=useMkScreenSize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkScreenSize.d.ts","sourceRoot":"","sources":["../../src/hooks/useMkScreenSize.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,YAAY,CA6BxF"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
const DEFAULT_BREAKPOINTS = {
|
|
3
|
-
mobile: 600,
|
|
4
|
-
tablet: 1024,
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* useMkScreenSize — Track viewport dimensions and responsive breakpoints.
|
|
8
|
-
*
|
|
9
|
-
* @param breakpoints - Custom breakpoint thresholds (optional).
|
|
10
|
-
* @returns Object with `width`, `height`, `isMobile`, `isTablet`, `isDesktop`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* const { isMobile, isDesktop, width } = useMkScreenSize();
|
|
15
|
-
* const { isMobile } = useMkScreenSize({ mobile: 480, tablet: 768 });
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export function useMkScreenSize(breakpoints) {
|
|
19
|
-
const bp = Object.assign(Object.assign({}, DEFAULT_BREAKPOINTS), breakpoints);
|
|
20
|
-
const compute = () => {
|
|
21
|
-
const w = typeof window !== 'undefined' ? window.innerWidth : 1200;
|
|
22
|
-
const h = typeof window !== 'undefined' ? window.innerHeight : 800;
|
|
23
|
-
return {
|
|
24
|
-
width: w,
|
|
25
|
-
height: h,
|
|
26
|
-
isMobile: w <= bp.mobile,
|
|
27
|
-
isTablet: w > bp.mobile && w <= bp.tablet,
|
|
28
|
-
isDesktop: w > bp.tablet,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const [size, setSize] = useState(compute);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (typeof window === 'undefined')
|
|
34
|
-
return;
|
|
35
|
-
const handleResize = () => setSize(compute());
|
|
36
|
-
handleResize();
|
|
37
|
-
window.addEventListener('resize', handleResize);
|
|
38
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
39
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
-
}, [bp.mobile, bp.tablet]);
|
|
41
|
-
return size;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=useMkScreenSize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkScreenSize.js","sourceRoot":"","sources":["../../src/hooks/useMkScreenSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAe5C,MAAM,mBAAmB,GAAwB;IAC7C,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,IAAI;CACf,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,WAA0C;IACtE,MAAM,EAAE,mCAAQ,mBAAmB,GAAK,WAAW,CAAE,CAAC;IAEtD,MAAM,OAAO,GAAG,GAAiB,EAAE;QAC/B,MAAM,CAAC,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;QACnE,MAAM,CAAC,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;QACnE,OAAO;YACH,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM;YACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM;YACzC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM;SAC3B,CAAC;IACN,CAAC,CAAC;IAEF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAe,OAAO,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAE1C,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAE9C,YAAY,EAAE,CAAC;QACf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACpE,uDAAuD;IACvD,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a lightweight external store with React 18's useSyncExternalStore.
|
|
3
|
-
* No Context/Provider needed — just create and use anywhere.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* // store.ts
|
|
8
|
-
* export const useCounter = createMkStore(0);
|
|
9
|
-
*
|
|
10
|
-
* // Component.tsx
|
|
11
|
-
* const [count, setCount] = useCounter();
|
|
12
|
-
* setCount(count + 1);
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare function createMkStore<T>(initialState: T): {
|
|
16
|
-
(): readonly [T, (newState: T | ((prev: T) => T)) => void];
|
|
17
|
-
getState: () => T;
|
|
18
|
-
setState: (newState: T | ((prev: T) => T)) => void;
|
|
19
|
-
subscribe: (listener: () => void) => () => void;
|
|
20
|
-
reset: () => void;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=useMkStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkStore.d.ts","sourceRoot":"","sources":["../../src/hooks/useMkStore.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC;QAqCvB,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;;yBA3B/C,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;0BAUnB,MAAM,IAAI;;EA6B1C"}
|
package/dist/hooks/useMkStore.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a lightweight external store with React 18's useSyncExternalStore.
|
|
4
|
-
* No Context/Provider needed — just create and use anywhere.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* // store.ts
|
|
9
|
-
* export const useCounter = createMkStore(0);
|
|
10
|
-
*
|
|
11
|
-
* // Component.tsx
|
|
12
|
-
* const [count, setCount] = useCounter();
|
|
13
|
-
* setCount(count + 1);
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export function createMkStore(initialState) {
|
|
17
|
-
let state = initialState;
|
|
18
|
-
let listeners = [];
|
|
19
|
-
const notifyListeners = () => {
|
|
20
|
-
listeners.forEach(listener => listener());
|
|
21
|
-
};
|
|
22
|
-
const getSnapshot = () => state;
|
|
23
|
-
const setState = (newState) => {
|
|
24
|
-
const nextState = typeof newState === 'function'
|
|
25
|
-
? newState(state)
|
|
26
|
-
: newState;
|
|
27
|
-
if (Object.is(state, nextState))
|
|
28
|
-
return;
|
|
29
|
-
state = nextState;
|
|
30
|
-
notifyListeners();
|
|
31
|
-
};
|
|
32
|
-
const subscribe = (listener) => {
|
|
33
|
-
listeners.push(listener);
|
|
34
|
-
return () => {
|
|
35
|
-
listeners = listeners.filter(l => l !== listener);
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
/** Reset store to initial state */
|
|
39
|
-
const reset = () => {
|
|
40
|
-
state = initialState;
|
|
41
|
-
notifyListeners();
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* React hook to consume this store.
|
|
45
|
-
* Returns [state, setState] tuple (like useState).
|
|
46
|
-
*/
|
|
47
|
-
function useStore() {
|
|
48
|
-
const currentState = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
49
|
-
return [currentState, setState];
|
|
50
|
-
}
|
|
51
|
-
// Attach utilities to the hook
|
|
52
|
-
useStore.getState = getSnapshot;
|
|
53
|
-
useStore.setState = setState;
|
|
54
|
-
useStore.subscribe = subscribe;
|
|
55
|
-
useStore.reset = reset;
|
|
56
|
-
return useStore;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=useMkStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkStore.js","sourceRoot":"","sources":["../../src/hooks/useMkStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAI,YAAe;IAC5C,IAAI,KAAK,GAAG,YAAY,CAAC;IACzB,IAAI,SAAS,GAAsB,EAAE,CAAC;IAEtC,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;IAEhC,MAAM,QAAQ,GAAG,CAAC,QAA8B,EAAE,EAAE;QAChD,MAAM,SAAS,GAAG,OAAO,QAAQ,KAAK,UAAU;YAC5C,CAAC,CAAE,QAA2B,CAAC,KAAK,CAAC;YACrC,CAAC,CAAC,QAAQ,CAAC;QAEf,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;YAAE,OAAO;QACxC,KAAK,GAAG,SAAS,CAAC;QAClB,eAAe,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,QAAoB,EAAE,EAAE;QACvC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,GAAG,EAAE;YACR,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,mCAAmC;IACnC,MAAM,KAAK,GAAG,GAAG,EAAE;QACf,KAAK,GAAG,YAAY,CAAC;QACrB,eAAe,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF;;;OAGG;IACH,SAAS,QAAQ;QACb,MAAM,YAAY,GAAG,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAC/E,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAU,CAAC;IAC7C,CAAC;IAED,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,GAAG,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAEvB,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkToggle.d.ts","sourceRoot":"","sources":["../../src/hooks/useMkToggle.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,eAAc,OAAe,KAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAQrG,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* useMkToggle
|
|
4
|
-
* 🚀 Gestor de estado booleano simple y atómico.
|
|
5
|
-
*/
|
|
6
|
-
export const useMkToggle = (initialValue = false) => {
|
|
7
|
-
const [value, setValue] = useState(initialValue);
|
|
8
|
-
const toggle = useCallback(() => {
|
|
9
|
-
setValue((v) => !v);
|
|
10
|
-
}, []);
|
|
11
|
-
return [value, toggle, setValue];
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=useMkToggle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMkToggle.js","sourceRoot":"","sources":["../../src/hooks/useMkToggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,eAAwB,KAAK,EAA+C,EAAE;IACxG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAU,YAAY,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export { MkThemeEditor } from './components/MkThemeEditor';
|
|
3
|
-
export { MkThemeProvider, useMkTheme } from './theme/MkThemeProvider';
|
|
4
|
-
export * from './context/MkApiContext';
|
|
5
|
-
export * from './context/MkToastContext';
|
|
6
|
-
export * from './context/MkConfirmContext';
|
|
7
|
-
export * from './theme/MkThemeProvider';
|
|
8
|
-
export * from './hooks/useApi';
|
|
9
|
-
export * from './hooks/useMkList';
|
|
10
|
-
export * from './hooks/useMkInfiniteList';
|
|
11
|
-
export * from './hooks/useMkDebounce';
|
|
12
|
-
export * from './hooks/useMkInViewPort';
|
|
13
|
-
export * from './hooks/useMkClickOutside';
|
|
14
|
-
export * from './hooks/useMkEffectDebug';
|
|
15
|
-
export * from './hooks/useMkEvent';
|
|
16
|
-
export * from './hooks/useMkLocalStorage';
|
|
17
|
-
export * from './hooks/useMkPrevious';
|
|
18
|
-
export * from './hooks/useMkToggle';
|
|
19
|
-
export * from './hooks/useMkForm';
|
|
20
|
-
export * from './hooks/useMkCrud';
|
|
21
|
-
export * from './hooks/useMkMediaQuery';
|
|
22
|
-
export * from './hooks/useMkScreenSize';
|
|
23
|
-
export * from './hooks/useMkLongPress';
|
|
24
|
-
export * from './hooks/useMkStore';
|
|
25
|
-
export { MkAuthProvider } from './auth/MkAuthProvider';
|
|
26
|
-
export type { MkAuthProviderProps } from './auth/MkAuthProvider';
|
|
27
|
-
export { useMkAuth } from './auth/useMkAuth';
|
|
28
|
-
export { MkAuthForm } from './auth/MkAuthForm';
|
|
29
|
-
export type { MkAuthFormProps } from './auth/MkAuthForm';
|
|
30
|
-
export type { MkAuthContextValue } from './auth/MkAuthContext';
|
|
31
|
-
export type { AdminDto, AuthTokens, LoginInput, LoginResponse, RefreshResponse, } from './auth/types';
|
|
32
|
-
export * from './utils/images';
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export { MkThemeEditor } from './components/MkThemeEditor';
|
|
3
|
-
export { MkThemeProvider, useMkTheme } from './theme/MkThemeProvider';
|
|
4
|
-
// Contexts
|
|
5
|
-
export * from './context/MkApiContext';
|
|
6
|
-
export * from './context/MkToastContext';
|
|
7
|
-
export * from './context/MkConfirmContext';
|
|
8
|
-
export * from './theme/MkThemeProvider';
|
|
9
|
-
// Hooks
|
|
10
|
-
export * from './hooks/useApi';
|
|
11
|
-
export * from './hooks/useMkList';
|
|
12
|
-
export * from './hooks/useMkInfiniteList';
|
|
13
|
-
export * from './hooks/useMkDebounce';
|
|
14
|
-
export * from './hooks/useMkInViewPort';
|
|
15
|
-
export * from './hooks/useMkClickOutside';
|
|
16
|
-
export * from './hooks/useMkEffectDebug';
|
|
17
|
-
export * from './hooks/useMkEvent';
|
|
18
|
-
export * from './hooks/useMkLocalStorage';
|
|
19
|
-
export * from './hooks/useMkPrevious';
|
|
20
|
-
export * from './hooks/useMkToggle';
|
|
21
|
-
export * from './hooks/useMkForm';
|
|
22
|
-
export * from './hooks/useMkCrud';
|
|
23
|
-
export * from './hooks/useMkMediaQuery';
|
|
24
|
-
export * from './hooks/useMkScreenSize';
|
|
25
|
-
export * from './hooks/useMkLongPress';
|
|
26
|
-
export * from './hooks/useMkStore';
|
|
27
|
-
// Auth (mk-web 1.0 — scope-aware provider, see MK-WEB-1.0.3 / 1.0.4)
|
|
28
|
-
export { MkAuthProvider } from './auth/MkAuthProvider';
|
|
29
|
-
export { useMkAuth } from './auth/useMkAuth';
|
|
30
|
-
export { MkAuthForm } from './auth/MkAuthForm';
|
|
31
|
-
// Utils
|
|
32
|
-
export * from './utils/images';
|
|
33
|
-
// Note: Global CSS (`@mk/web/styles/index.css`) MUST be imported by the
|
|
34
|
-
// consuming app from `pages/_app.tsx` (or `app/layout.tsx`) — Next 13+
|
|
35
|
-
// forbids auto-importing global CSS from a package's main entry, and
|
|
36
|
-
// Turbopack in Next 16 enforces it strictly. See package README for usage.
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEtE,WAAW;AACX,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AAExC,QAAQ;AACR,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAEnC,qEAAqE;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAW/C,QAAQ;AACR,cAAc,gBAAgB,CAAC;AAE/B,wEAAwE;AACxE,uEAAuE;AACvE,qEAAqE;AACrE,2EAA2E"}
|
package/dist/styles/index.css
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MK-Director Design Tokens
|
|
3
|
-
* -------------------------
|
|
4
|
-
* Overwrite these variables in your own CSS to customize the entire UI Kit.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
/* Colors - Light Mode */
|
|
9
|
-
--mk-primary: #3b82f6;
|
|
10
|
-
--mk-primary-foreground: #ffffff;
|
|
11
|
-
|
|
12
|
-
--mk-background: #ffffff;
|
|
13
|
-
--mk-foreground: #0f172a;
|
|
14
|
-
|
|
15
|
-
--mk-muted: #f1f5f9;
|
|
16
|
-
--mk-muted-foreground: #64748b;
|
|
17
|
-
|
|
18
|
-
--mk-accent: #f8fafc;
|
|
19
|
-
--mk-accent-foreground: #0f172a;
|
|
20
|
-
|
|
21
|
-
--mk-border: #e2e8f0;
|
|
22
|
-
--mk-input: #e2e8f0;
|
|
23
|
-
|
|
24
|
-
--mk-success: #10b981;
|
|
25
|
-
--mk-success-foreground: #ffffff;
|
|
26
|
-
--mk-error: #ef4444;
|
|
27
|
-
--mk-error-foreground: #ffffff;
|
|
28
|
-
--mk-warning: #f59e0b;
|
|
29
|
-
--mk-warning-foreground: #ffffff;
|
|
30
|
-
--mk-info: #3b82f6;
|
|
31
|
-
--mk-info-foreground: #ffffff;
|
|
32
|
-
|
|
33
|
-
/* Card / Surface */
|
|
34
|
-
--mk-card: #ffffff;
|
|
35
|
-
--mk-card-foreground: #0f172a;
|
|
36
|
-
|
|
37
|
-
/* Popover / Dropdown */
|
|
38
|
-
--mk-popover: #ffffff;
|
|
39
|
-
--mk-popover-foreground: #0f172a;
|
|
40
|
-
|
|
41
|
-
/* Shared Tokens */
|
|
42
|
-
--mk-radius: 0.5rem;
|
|
43
|
-
--mk-font-sans: 'Inter', system-ui, sans-serif;
|
|
44
|
-
|
|
45
|
-
/* Animations & Transitions */
|
|
46
|
-
--mk-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
47
|
-
--mk-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
|
-
--mk-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
49
|
-
--mk-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@keyframes mk-fade-in {
|
|
53
|
-
from {
|
|
54
|
-
opacity: 0;
|
|
55
|
-
transform: translateY(8px);
|
|
56
|
-
}
|
|
57
|
-
to {
|
|
58
|
-
opacity: 1;
|
|
59
|
-
transform: translateY(0);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@keyframes mk-shimmer {
|
|
64
|
-
0% {
|
|
65
|
-
background-position: -200% 0;
|
|
66
|
-
}
|
|
67
|
-
100% {
|
|
68
|
-
background-position: 200% 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@keyframes mk-pulse-subtle {
|
|
73
|
-
0%,
|
|
74
|
-
100% {
|
|
75
|
-
opacity: 1;
|
|
76
|
-
transform: scale(1);
|
|
77
|
-
}
|
|
78
|
-
50% {
|
|
79
|
-
opacity: 0.85;
|
|
80
|
-
transform: scale(0.995);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Dark Mode */
|
|
85
|
-
.mk-dark {
|
|
86
|
-
--mk-background: #0f172a;
|
|
87
|
-
--mk-foreground: #f8fafc;
|
|
88
|
-
|
|
89
|
-
--mk-muted: #1e293b;
|
|
90
|
-
--mk-muted-foreground: #94a3b8;
|
|
91
|
-
|
|
92
|
-
--mk-accent: #1e293b;
|
|
93
|
-
--mk-accent-foreground: #f8fafc;
|
|
94
|
-
|
|
95
|
-
--mk-border: #334155;
|
|
96
|
-
--mk-input: #334155;
|
|
97
|
-
|
|
98
|
-
--mk-primary: #60a5fa;
|
|
99
|
-
--mk-primary-foreground: #0f172a;
|
|
100
|
-
|
|
101
|
-
--mk-success-foreground: #0f172a;
|
|
102
|
-
--mk-error-foreground: #ffffff;
|
|
103
|
-
--mk-warning-foreground: #0f172a;
|
|
104
|
-
--mk-info-foreground: #0f172a;
|
|
105
|
-
|
|
106
|
-
/* Card / Surface */
|
|
107
|
-
--mk-card: #1e293b;
|
|
108
|
-
--mk-card-foreground: #f8fafc;
|
|
109
|
-
|
|
110
|
-
/* Popover / Dropdown */
|
|
111
|
-
--mk-popover: #1e293b;
|
|
112
|
-
--mk-popover-foreground: #f8fafc;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* Global Styles */
|
|
116
|
-
* {
|
|
117
|
-
border-color: var(--mk-border);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
body {
|
|
121
|
-
background-color: var(--mk-background);
|
|
122
|
-
color: var(--mk-foreground);
|
|
123
|
-
font-family: var(--mk-font-sans);
|
|
124
|
-
}
|
package/dist/test-setup.d.ts
DELETED
package/dist/test-setup.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
package/dist/test-setup.js
DELETED
package/dist/test-setup.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { MkTheme } from '@mk/core';
|
|
3
|
-
interface ThemeContextType {
|
|
4
|
-
theme: MkTheme;
|
|
5
|
-
isDark: boolean;
|
|
6
|
-
toggleTheme: () => void;
|
|
7
|
-
setDark: (dark: boolean) => void;
|
|
8
|
-
customOverrides: Partial<Record<string, string>>;
|
|
9
|
-
updateOverride: (key: string, value: string) => void;
|
|
10
|
-
resetOverrides: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function MkThemeProvider({ children, initialDark, defaultTheme, }: {
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
initialDark?: boolean;
|
|
15
|
-
defaultTheme?: MkTheme;
|
|
16
|
-
}): React.JSX.Element;
|
|
17
|
-
export declare const useMkTheme: () => ThemeContextType;
|
|
18
|
-
export { tokens } from '@mk/core';
|
|
19
|
-
export type { MkTheme } from '@mk/core';
|
|
20
|
-
//# sourceMappingURL=MkThemeProvider.d.ts.map
|
package/dist/utils/images.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mkResizeImage
|
|
3
|
-
*
|
|
4
|
-
* Frontend image resizer using Canvas.
|
|
5
|
-
* Generates a WebP version of the image with the specified constraints.
|
|
6
|
-
* 🚀 Performance-first: Reduces upload payload size.
|
|
7
|
-
*/
|
|
8
|
-
export declare const mkResizeImage: (file: File | Blob, maxWidth?: number, maxHeight?: number, quality?: number) => Promise<string>;
|
|
9
|
-
//# sourceMappingURL=images.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/utils/images.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACtB,MAAM,IAAI,GAAG,IAAI,EACjB,WAAU,MAAa,EACvB,YAAW,MAAa,EACxB,UAAS,MAAY,KACtB,OAAO,CAAC,MAAM,CAgDhB,CAAC"}
|
package/dist/utils/images.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mkResizeImage
|
|
3
|
-
*
|
|
4
|
-
* Frontend image resizer using Canvas.
|
|
5
|
-
* Generates a WebP version of the image with the specified constraints.
|
|
6
|
-
* 🚀 Performance-first: Reduces upload payload size.
|
|
7
|
-
*/
|
|
8
|
-
export const mkResizeImage = async (file, maxWidth = 1024, maxHeight = 1024, quality = 0.8) => {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
if (typeof window === 'undefined') {
|
|
11
|
-
return reject(new Error('mkResizeImage solo puede usarse en el navegador.'));
|
|
12
|
-
}
|
|
13
|
-
const reader = new FileReader();
|
|
14
|
-
reader.onload = (event) => {
|
|
15
|
-
var _a;
|
|
16
|
-
const img = new Image();
|
|
17
|
-
img.src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
18
|
-
img.onload = () => {
|
|
19
|
-
let width = img.width;
|
|
20
|
-
let height = img.height;
|
|
21
|
-
// Adjust based on constraints
|
|
22
|
-
if (width > maxWidth || height > maxHeight) {
|
|
23
|
-
const aspectRatio = width / height;
|
|
24
|
-
if (width > height) {
|
|
25
|
-
width = maxWidth;
|
|
26
|
-
height = maxWidth / aspectRatio;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
height = maxHeight;
|
|
30
|
-
width = maxHeight * aspectRatio;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const canvas = document.createElement('canvas');
|
|
34
|
-
canvas.width = width;
|
|
35
|
-
canvas.height = height;
|
|
36
|
-
const ctx = canvas.getContext('2d');
|
|
37
|
-
if (!ctx)
|
|
38
|
-
return reject(new Error('No se pudo obtener el contexto 2d del canvas.'));
|
|
39
|
-
ctx.drawImage(img, 0, 0, width, height);
|
|
40
|
-
// Convert to WebP for modern performance
|
|
41
|
-
const resizedImage = canvas.toDataURL('image/webp', quality);
|
|
42
|
-
resolve(resizedImage);
|
|
43
|
-
};
|
|
44
|
-
img.onerror = () => reject(new Error('Error al cargar la imagen en el motor de renderizado.'));
|
|
45
|
-
};
|
|
46
|
-
reader.onerror = () => reject(new Error('Error al leer el archivo de origen.'));
|
|
47
|
-
reader.readAsDataURL(file);
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=images.js.map
|
package/dist/utils/images.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../src/utils/images.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAC9B,IAAiB,EACjB,WAAmB,IAAI,EACvB,YAAoB,IAAI,EACxB,UAAkB,GAAG,EACN,EAAE;IACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAEhC,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;;YACtB,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,GAAG,CAAC,GAAG,GAAG,MAAA,KAAK,CAAC,MAAM,0CAAE,MAAgB,CAAC;YAEzC,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;gBACd,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;gBACtB,IAAI,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;gBAExB,8BAA8B;gBAC9B,IAAI,KAAK,GAAG,QAAQ,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;oBACzC,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;oBACnC,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;wBACjB,KAAK,GAAG,QAAQ,CAAC;wBACjB,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;oBACpC,CAAC;yBAAM,CAAC;wBACJ,MAAM,GAAG,SAAS,CAAC;wBACnB,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;oBACpC,CAAC;gBACL,CAAC;gBAED,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAChD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;gBACrB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;gBACvB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAEpC,IAAI,CAAC,GAAG;oBAAE,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;gBAEpF,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;gBAExC,yCAAyC;gBACzC,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBAC7D,OAAO,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC,CAAC;YAEF,GAAG,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC,CAAC;QACnG,CAAC,CAAC;QAEF,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC,CAAC;QAChF,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|