@makroz/mobile 1.1.2 → 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.
Files changed (90) hide show
  1. package/dist/__mocks__/flash-list.d.ts +12 -0
  2. package/dist/__mocks__/react-native.d.ts +77 -0
  3. package/dist/auth/MkAuthContext.d.ts +72 -0
  4. package/dist/auth/MkAuthForm.d.ts +31 -0
  5. package/dist/auth/MkAuthProvider.d.ts +57 -0
  6. package/dist/auth/secureStorage.d.ts +63 -0
  7. package/dist/auth/types.d.ts +65 -0
  8. package/dist/auth/useMkAuth.d.ts +17 -0
  9. package/dist/components/MkAccordion.d.ts +19 -0
  10. package/dist/components/MkAccordion.test.d.ts +2 -0
  11. package/dist/components/MkAlert.d.ts +18 -0
  12. package/dist/components/MkAlert.test.d.ts +2 -0
  13. package/dist/components/MkAvatar.d.ts +12 -0
  14. package/dist/components/MkAvatar.test.d.ts +2 -0
  15. package/dist/components/MkBadge.d.ts +11 -0
  16. package/dist/components/MkBadge.test.d.ts +2 -0
  17. package/dist/components/MkButton.d.ts +13 -0
  18. package/dist/components/MkButton.test.d.ts +2 -0
  19. package/dist/components/MkCard.d.ts +15 -0
  20. package/dist/components/MkCard.test.d.ts +2 -0
  21. package/dist/components/MkCheck.d.ts +18 -0
  22. package/dist/components/MkCheck.test.d.ts +2 -0
  23. package/dist/components/MkDatePicker.d.ts +30 -0
  24. package/dist/components/MkDatePicker.test.d.ts +2 -0
  25. package/dist/components/MkDivider.d.ts +11 -0
  26. package/dist/components/MkDivider.test.d.ts +2 -0
  27. package/dist/components/MkDropDown.d.ts +37 -0
  28. package/dist/components/MkDropDown.test.d.ts +2 -0
  29. package/dist/components/MkEmptyState.d.ts +11 -0
  30. package/dist/components/MkEmptyState.test.d.ts +2 -0
  31. package/dist/components/MkFileUpload.d.ts +63 -0
  32. package/dist/components/MkFileUpload.test.d.ts +2 -0
  33. package/dist/components/MkIcons.d.ts +15 -0
  34. package/dist/components/MkInfiniteList.d.ts +22 -0
  35. package/dist/components/MkInfiniteList.test.d.ts +2 -0
  36. package/dist/components/MkInput.d.ts +16 -0
  37. package/dist/components/MkInput.test.d.ts +2 -0
  38. package/dist/components/MkLoading.d.ts +12 -0
  39. package/dist/components/MkLoading.test.d.ts +2 -0
  40. package/dist/components/MkModal.d.ts +20 -0
  41. package/dist/components/MkModal.test.d.ts +2 -0
  42. package/dist/components/MkProgressBar.d.ts +13 -0
  43. package/dist/components/MkProgressBar.test.d.ts +2 -0
  44. package/dist/components/MkRadio.d.ts +20 -0
  45. package/dist/components/MkRadio.test.d.ts +2 -0
  46. package/dist/components/MkSearchInput.d.ts +21 -0
  47. package/dist/components/MkSearchInput.test.d.ts +2 -0
  48. package/dist/components/MkSelect.d.ts +16 -0
  49. package/dist/components/MkSelect.test.d.ts +2 -0
  50. package/dist/components/MkSkeleton.d.ts +13 -0
  51. package/dist/components/MkSkeleton.test.d.ts +2 -0
  52. package/dist/components/MkSwitch.d.ts +13 -0
  53. package/dist/components/MkSwitch.test.d.ts +2 -0
  54. package/dist/components/MkTable.d.ts +39 -0
  55. package/dist/components/MkTable.test.d.ts +2 -0
  56. package/dist/components/MkTabs.d.ts +19 -0
  57. package/dist/components/MkTabs.test.d.ts +2 -0
  58. package/dist/components/MkTextArea.d.ts +17 -0
  59. package/dist/components/MkTextArea.test.d.ts +2 -0
  60. package/dist/components/MkToastRenderer.d.ts +3 -0
  61. package/dist/components/MkToastRenderer.test.d.ts +2 -0
  62. package/dist/components/MkTooltip.d.ts +15 -0
  63. package/dist/components/MkTooltip.test.d.ts +2 -0
  64. package/dist/components/MkWindowList.d.ts +48 -0
  65. package/dist/components/MkWindowList.test.d.ts +2 -0
  66. package/dist/components/index.d.ts +30 -0
  67. package/dist/context/MkApiContext.d.ts +14 -0
  68. package/dist/context/MkAuthContext.d.ts +19 -0
  69. package/dist/context/MkConfirmContext.d.ts +8 -0
  70. package/dist/context/MkToastContext.d.ts +19 -0
  71. package/dist/hooks/filePicker.types.d.ts +13 -0
  72. package/dist/hooks/useApi.d.ts +19 -0
  73. package/dist/hooks/useApi.test.d.ts +2 -0
  74. package/dist/hooks/useMkCrud.d.ts +39 -0
  75. package/dist/hooks/useMkDebounce.d.ts +24 -0
  76. package/dist/hooks/useMkEffectDebug.d.ts +6 -0
  77. package/dist/hooks/useMkEvent.d.ts +42 -0
  78. package/dist/hooks/useMkFilePickerCli.d.ts +59 -0
  79. package/dist/hooks/useMkFilePickerExpo.d.ts +38 -0
  80. package/dist/hooks/useMkForm.d.ts +43 -0
  81. package/dist/hooks/useMkInfiniteList.d.ts +16 -0
  82. package/dist/hooks/useMkList.d.ts +61 -0
  83. package/dist/hooks/useMkLocalStorage.d.ts +6 -0
  84. package/dist/hooks/useMkPrevious.d.ts +6 -0
  85. package/dist/hooks/useMkToggle.d.ts +6 -0
  86. package/dist/index.d.ts +29 -0
  87. package/dist/test-setup.d.ts +28 -0
  88. package/dist/test-utils.d.ts +22 -0
  89. package/dist/theme/MkThemeProvider.d.ts +14 -0
  90. package/package.json +2 -2
@@ -0,0 +1,39 @@
1
+ import type { MkCrudConfig, MkCrudAction, MkCrudReturn } from '@makroz/core';
2
+ /**
3
+ * @module useMkCrud
4
+ * @description Full CRUD operations hook with form management, validation, and API integration.
5
+ * Same API surface for both mk-web and mk-mobile.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * const crud = useMkCrud({
10
+ * module: 'users',
11
+ * singular: 'Usuario',
12
+ * plural: 'Usuarios',
13
+ * fields: {
14
+ * name: { rules: ['required', 'min:3'], api: 'ae', label: 'Nombre' },
15
+ * email: { rules: ['required', 'email'], api: 'ae', label: 'Email' },
16
+ * },
17
+ * });
18
+ *
19
+ * // In your component:
20
+ * <MkButton label="Nuevo" onPress={crud.onAdd} />
21
+ *
22
+ * // In the modal:
23
+ * <MkInput label="Nombre" value={crud.form.formState.name}
24
+ * error={crud.form.errors.name}
25
+ * onChangeText={v => crud.form.setField('name', v)} />
26
+ * <MkButton label="Guardar" loading={crud.saving} onPress={crud.onSave} />
27
+ * ```
28
+ */
29
+ interface UseMkCrudOptions extends MkCrudConfig {
30
+ /** Callback after successful save. */
31
+ onSuccess?: (action: MkCrudAction, data: any) => void;
32
+ /** Callback after failed save. */
33
+ onError?: (action: MkCrudAction, error: any) => void;
34
+ /** External reload function (from useMkList). */
35
+ onReload?: () => void;
36
+ }
37
+ export declare function useMkCrud<T extends Record<string, any> = Record<string, any>>(config: UseMkCrudOptions): MkCrudReturn<T>;
38
+ export {};
39
+ //# sourceMappingURL=useMkCrud.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @module useMkDebounce
3
+ * @description Returns a debounced value — the value only updates after the specified
4
+ * delay of inactivity. Useful for search inputs, filters, and API-driven queries.
5
+ *
6
+ * API is identical between mk-web and mk-mobile.
7
+ *
8
+ * @template T - Type of the input value.
9
+ * @param value - The value to debounce.
10
+ * @param delay - Milliseconds to wait before updating. Default 300.
11
+ * @returns The debounced value.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const [search, setSearch] = useState('');
16
+ * const debouncedSearch = useMkDebounce(search, 400);
17
+ *
18
+ * useEffect(() => {
19
+ * if (debouncedSearch) api.get('/search', { q: debouncedSearch });
20
+ * }, [debouncedSearch]);
21
+ * ```
22
+ */
23
+ export declare const useMkDebounce: <T = any>(value: T, delay?: number) => T;
24
+ //# sourceMappingURL=useMkDebounce.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * useMkEffectDebug (Mobile)
3
+ * 🚀 Parity with Web.
4
+ */
5
+ export declare const useMkEffectDebug: (effectFunction: () => void | (() => void), dependencies: any[]) => void;
6
+ //# sourceMappingURL=useMkEffectDebug.d.ts.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @module useMkEvent
3
+ * @description Lightweight event bus for cross-component communication in React Native.
4
+ * Uses a shared in-memory Map — no DOM APIs, no external dependencies.
5
+ * API matches mk-web's useMkEvent exactly: { emit }.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * // Component A — listen
10
+ * useMkEvent('cart:updated', (data) => {
11
+ * console.log('Cart updated:', data);
12
+ * });
13
+ *
14
+ * // Component B — emit
15
+ * const { emit } = useMkEvent('cart:updated');
16
+ * emit({ items: 5 });
17
+ * ```
18
+ */
19
+ type Listener = (data?: any) => void;
20
+ declare function _on(event: string, fn: Listener): void;
21
+ declare function _off(event: string, fn: Listener): void;
22
+ declare function _emit(event: string, data?: any): void;
23
+ export declare function useMkEvent<T = any>(eventName: string, handler?: (data: T) => void): {
24
+ emit: (data?: T) => void;
25
+ };
26
+ /**
27
+ * Imperative event API — for use outside React components (services, callbacks).
28
+ * @example
29
+ * import { MkEventBus } from '@makroz/mobile';
30
+ * MkEventBus.emit('notification:received', payload);
31
+ */
32
+ export declare const MkEventBus: {
33
+ readonly on: typeof _on;
34
+ readonly off: typeof _off;
35
+ readonly emit: typeof _emit;
36
+ /** Clear all listeners for an event. */
37
+ readonly clear: (event: string) => void;
38
+ /** Clear ALL listeners. */
39
+ readonly clearAll: () => void;
40
+ };
41
+ export {};
42
+ //# sourceMappingURL=useMkEvent.d.ts.map
@@ -0,0 +1,59 @@
1
+ import type { UseMkFilePickerReturn } from './filePicker.types';
2
+ /**
3
+ * @module useMkFilePickerCli
4
+ * @description Picker adapter for **React Native CLI** projects.
5
+ *
6
+ * **Required peer packages** (choose what you need):
7
+ * ```bash
8
+ * # Images / Videos:
9
+ * npm install react-native-image-picker
10
+ * cd ios && pod install && cd ..
11
+ *
12
+ * # Documents (PDF, Word, etc.):
13
+ * npm install react-native-document-picker
14
+ * cd ios && pod install && cd ..
15
+ * ```
16
+ *
17
+ * **Android** — add to AndroidManifest.xml:
18
+ * ```xml
19
+ * <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
20
+ * <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
21
+ * ```
22
+ *
23
+ * **iOS** — add to Info.plist:
24
+ * ```xml
25
+ * <key>NSPhotoLibraryUsageDescription</key>
26
+ * <string>Necesitamos acceso para subir imágenes</string>
27
+ * ```
28
+ *
29
+ * @example Images
30
+ * ```tsx
31
+ * const picker = useMkFilePickerCli({ mediaType: 'images', multiple: true });
32
+ * <MkFileUpload onTap={picker.pick} onFiles={setFiles} />
33
+ * ```
34
+ *
35
+ * @example Documents
36
+ * ```tsx
37
+ * const picker = useMkFilePickerCli({
38
+ * mediaType: 'documents',
39
+ * documentMimeTypes: ['application/pdf'],
40
+ * });
41
+ * <MkFileUpload onTap={picker.pick} onFiles={setFiles} />
42
+ * ```
43
+ */
44
+ export type CliMediaType = 'images' | 'videos' | 'documents' | 'all';
45
+ export interface UseMkFilePickerCliOptions {
46
+ /** What type of files to pick. Default 'images'. */
47
+ mediaType?: CliMediaType;
48
+ /** Allow multiple selection. Default false. */
49
+ multiple?: boolean;
50
+ /** Image quality 0–1. Default 0.8. */
51
+ quality?: number;
52
+ /**
53
+ * MIME types for document picker.
54
+ * Default: ['image/*', 'application/pdf']
55
+ */
56
+ documentMimeTypes?: string[];
57
+ }
58
+ export declare function useMkFilePickerCli(options?: UseMkFilePickerCliOptions): UseMkFilePickerReturn;
59
+ //# sourceMappingURL=useMkFilePickerCli.d.ts.map
@@ -0,0 +1,38 @@
1
+ import type { UseMkFilePickerReturn } from './filePicker.types';
2
+ /**
3
+ * @module useMkFilePickerExpo
4
+ * @description Picker adapter for **Expo** projects.
5
+ *
6
+ * **Required peer packages** (install separately in your app):
7
+ * ```bash
8
+ * npx expo install expo-image-picker expo-document-picker
9
+ * ```
10
+ *
11
+ * This hook uses `require()` at runtime so the library compiles even if these
12
+ * packages are not installed. A clear error message is shown if they're missing.
13
+ *
14
+ * @example Images
15
+ * ```tsx
16
+ * const picker = useMkFilePickerExpo({ mediaType: 'images', multiple: true });
17
+ * <MkFileUpload onTap={picker.pick} onFiles={setFiles} />
18
+ * ```
19
+ *
20
+ * @example Documents
21
+ * ```tsx
22
+ * const picker = useMkFilePickerExpo({ mediaType: 'documents' });
23
+ * <MkFileUpload onTap={picker.pick} onFiles={setFiles} accept=".pdf" />
24
+ * ```
25
+ */
26
+ export type ExpoMediaType = 'images' | 'videos' | 'documents' | 'all';
27
+ export interface UseMkFilePickerExpoOptions {
28
+ /** What type of files to pick. Default 'images'. */
29
+ mediaType?: ExpoMediaType;
30
+ /** Allow multiple selection. Default false. */
31
+ multiple?: boolean;
32
+ /** Allow editing after picking (images only, ignored when multiple=true). */
33
+ allowsEditing?: boolean;
34
+ /** Image quality 0–1. Default 0.8. */
35
+ quality?: number;
36
+ }
37
+ export declare function useMkFilePickerExpo(options?: UseMkFilePickerExpoOptions): UseMkFilePickerReturn;
38
+ //# sourceMappingURL=useMkFilePickerExpo.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { MkFormFields, MkFormReturn, MkCrudAction } from '@makroz/core';
2
+ /**
3
+ * @module useMkForm
4
+ * @description Unified form state manager with built-in validation.
5
+ * Works on both Web and Mobile — zero platform dependencies.
6
+ *
7
+ * Uses mkValidation from mk-core for field-level and form-level validation,
8
+ * and mkValidation.getApiFields for extracting API-ready data.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * const form = useMkForm({
13
+ * fields: {
14
+ * name: { rules: ['required', 'min:3'], api: 'ae' },
15
+ * email: { rules: ['required', 'email'], api: 'ae' },
16
+ * phone: { rules: ['phone'], api: 'ae*' },
17
+ * },
18
+ * initialData: { name: '', email: '', phone: '' },
19
+ * });
20
+ *
21
+ * // In handler
22
+ * <MkInput label="Nombre" value={form.formState.name} error={form.errors.name}
23
+ * onChange={v => form.setField('name', v)} />
24
+ *
25
+ * const handleSave = () => {
26
+ * if (!form.validate()) return;
27
+ * const data = form.getApiData();
28
+ * api.post('/users', data);
29
+ * };
30
+ * ```
31
+ */
32
+ export interface UseMkFormOptions<T = Record<string, any>> {
33
+ /** Field definitions with rules and API flags. */
34
+ fields: MkFormFields;
35
+ /** Initial data for the form. */
36
+ initialData?: Partial<T>;
37
+ /** Current CRUD action (affects which rules apply). Default 'add'. */
38
+ action?: MkCrudAction;
39
+ /** Validate on every setField call. Default false. */
40
+ validateOnChange?: boolean;
41
+ }
42
+ export declare function useMkForm<T extends Record<string, any> = Record<string, any>>({ fields, initialData, action, validateOnChange, }: UseMkFormOptions<T>): MkFormReturn<T>;
43
+ //# sourceMappingURL=useMkForm.d.ts.map
@@ -0,0 +1,16 @@
1
+ export interface InfiniteListOptions {
2
+ per_page?: number;
3
+ q?: string;
4
+ filter?: Record<string, any>;
5
+ sort?: string;
6
+ }
7
+ export declare function useMkInfiniteList(endpoint: string, options?: InfiniteListOptions): {
8
+ items: any[];
9
+ loading: boolean;
10
+ error: any;
11
+ isRefreshing: boolean;
12
+ hasMore: boolean;
13
+ loadMore: (isInitial?: boolean) => Promise<void>;
14
+ onRefresh: () => Promise<void>;
15
+ };
16
+ //# sourceMappingURL=useMkInfiniteList.d.ts.map
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @module useMkList
3
+ * @description Paginated list manager for React Native — mirrors mk-web's useMkList API.
4
+ * Manages page, search, sort, and filters with auto-refresh on param changes.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const { data, loading, params, setSearch, setPage, setSort, setFilter, refresh } = useMkList('/users');
9
+ *
10
+ * // Search
11
+ * setSearch('mario');
12
+ *
13
+ * // Change page
14
+ * setPage(2);
15
+ *
16
+ * // Sort
17
+ * setSort('-created_at');
18
+ *
19
+ * // Filter
20
+ * setFilter('status', 'active');
21
+ * ```
22
+ */
23
+ export interface MkListParams {
24
+ page?: number;
25
+ per_page?: number;
26
+ q?: string;
27
+ sort?: string;
28
+ filter?: Record<string, any>;
29
+ }
30
+ export interface MkListOptions {
31
+ /** Initial params. */
32
+ initialParams?: MkListParams;
33
+ /** Whether to auto-fetch on mount and param changes. Default true. */
34
+ autoFetch?: boolean;
35
+ /** Debounce delay in ms for search updates. Default 0 (no debounce). */
36
+ debounceMs?: number;
37
+ }
38
+ export declare function useMkList(endpoint: string, options?: MkListOptions): {
39
+ params: MkListParams;
40
+ setParams: import("react").Dispatch<import("react").SetStateAction<MkListParams>>;
41
+ setFilter: (field: string, value: any) => void;
42
+ setPage: (page: number) => void;
43
+ setSearch: (q: string) => void;
44
+ setSort: (sort: string) => void;
45
+ setPerPage: (per_page: number) => void;
46
+ resetFilters: () => void;
47
+ refresh: (extraParams?: MkListParams) => Promise<import("@makroz/core").MkResponse<unknown>>;
48
+ /** Pagination meta from __extraData */
49
+ pagination: any;
50
+ status: import("@makroz/core").ApiStatus;
51
+ data: any;
52
+ error: any;
53
+ waiting: number;
54
+ loading: boolean;
55
+ get: (endpoint: string, params?: any) => Promise<import("@makroz/core").MkResponse<unknown>>;
56
+ post: (endpoint: string, body: any) => Promise<import("@makroz/core").MkResponse<unknown>>;
57
+ put: (endpoint: string, body: any) => Promise<import("@makroz/core").MkResponse<unknown>>;
58
+ delete: (endpoint: string) => Promise<import("@makroz/core").MkResponse<unknown>>;
59
+ remove: (endpoint: string) => Promise<import("@makroz/core").MkResponse<unknown>>;
60
+ };
61
+ //# sourceMappingURL=useMkList.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * useMkLocalStorage (Mobile)
3
+ * 🚀 Parity with Web but using AsyncStorage.
4
+ */
5
+ export declare function useMkLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
6
+ //# sourceMappingURL=useMkLocalStorage.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * useMkPrevious (Mobile)
3
+ * 🚀 Parity with Web.
4
+ */
5
+ export declare const useMkPrevious: <T>(value: T, initialValue?: T) => T | undefined;
6
+ //# sourceMappingURL=useMkPrevious.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * useMkToggle (Mobile)
3
+ * 🚀 Parity with Web.
4
+ */
5
+ export declare const useMkToggle: (initialValue?: boolean) => [boolean, () => void, (v: boolean) => void];
6
+ //# sourceMappingURL=useMkToggle.d.ts.map
@@ -0,0 +1,29 @@
1
+ export * from './components';
2
+ export * from './theme/MkThemeProvider';
3
+ export * from './context/MkApiContext';
4
+ export * from './context/MkAuthContext';
5
+ export * from './context/MkConfirmContext';
6
+ export * from './context/MkToastContext';
7
+ export { MkAuthProvider } from './auth/MkAuthProvider';
8
+ export type { MkAuthProviderProps } from './auth/MkAuthProvider';
9
+ export { useMkAuth } from './auth/useMkAuth';
10
+ export { MkAuthForm } from './auth/MkAuthForm';
11
+ export type { MkAuthFormProps } from './auth/MkAuthForm';
12
+ export type { MkAuthContextValue } from './auth/MkAuthContext';
13
+ export type { AdminDto, AuthTokens, LoginInput, LoginResponse, RefreshResponse } from './auth/types';
14
+ export { getAccessToken, setAccessToken, getRefreshToken, setRefreshToken, getUser, setUser, clearAll, SECURE_KEYS, } from './auth/secureStorage';
15
+ export type { SecureKey } from './auth/secureStorage';
16
+ export * from './hooks/useApi';
17
+ export * from './hooks/useMkList';
18
+ export * from './hooks/useMkInfiniteList';
19
+ export * from './hooks/useMkDebounce';
20
+ export * from './hooks/useMkEffectDebug';
21
+ export * from './hooks/useMkEvent';
22
+ export * from './hooks/useMkLocalStorage';
23
+ export * from './hooks/useMkPrevious';
24
+ export * from './hooks/useMkToggle';
25
+ export * from './hooks/useMkForm';
26
+ export * from './hooks/useMkCrud';
27
+ export * from './hooks/useMkFilePickerExpo';
28
+ export * from './hooks/useMkFilePickerCli';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Test setup for @makroz/mobile — jsdom env + global stubs.
3
+ *
4
+ * Note: react-native and @shopify/flash-list mocks are NOT done
5
+ * here. `vi.mock` in setup files is loaded after the test file
6
+ * imports, so the mocks wouldn't apply. Instead, each .test.tsx
7
+ * file should `import { rnMocks } from '../test-utils'` and call
8
+ * `rnMocks()` at the top, BEFORE importing the component.
9
+ *
10
+ * This file just provides:
11
+ * - ResizeObserver / IntersectionObserver stubs (jsdom missing)
12
+ * - LayoutAnimation / UIManager global stubs (RN missing in jsdom)
13
+ */
14
+ declare class ResizeObserverStub {
15
+ observe(): void;
16
+ unobserve(): void;
17
+ disconnect(): void;
18
+ }
19
+ declare class IntersectionObserverStub {
20
+ readonly root: null;
21
+ readonly rootMargin = "";
22
+ readonly thresholds: ReadonlyArray<number>;
23
+ observe(): void;
24
+ unobserve(): void;
25
+ disconnect(): void;
26
+ takeRecords(): IntersectionObserverEntry[];
27
+ }
28
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export declare function rnMocks(): void;
3
+ declare function customRender(ui: React.ReactElement, options?: {
4
+ wrapper?: React.ComponentType<{
5
+ children: React.ReactNode;
6
+ }>;
7
+ }): {
8
+ toJSON: () => any;
9
+ unmount: () => any;
10
+ rerender: () => void;
11
+ };
12
+ export declare function renderWithProviders(ui: React.ReactElement, options?: {
13
+ wrapper?: React.ComponentType<{
14
+ children: React.ReactNode;
15
+ }>;
16
+ }): {
17
+ toJSON: () => any;
18
+ unmount: () => any;
19
+ rerender: () => void;
20
+ };
21
+ export { customRender as render };
22
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { MkTheme } from '@makroz/core';
3
+ interface ThemeContextType {
4
+ theme: MkTheme;
5
+ isDark: boolean;
6
+ toggleTheme: () => void;
7
+ }
8
+ export declare const MkThemeProvider: React.FC<{
9
+ children: React.ReactNode;
10
+ initialDark?: boolean;
11
+ }>;
12
+ export declare const useMkTheme: () => ThemeContextType;
13
+ export {};
14
+ //# sourceMappingURL=MkThemeProvider.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makroz/mobile",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "React Native UI components and hooks for MK-Director mobile applications",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "@react-native-async-storage/async-storage": "^3.0.2",
30
30
  "@shopify/flash-list": "^2.0.0",
31
31
  "react-native-svg": "^15.15.4",
32
- "@makroz/core": "1.0.1"
32
+ "@makroz/core": "1.1.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@shopify/flash-list": ">=2.0.0",