@donotdev/expo 0.0.2 → 0.0.4

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 (167) hide show
  1. package/dist/atomic/Accordion/index.js +1 -1
  2. package/dist/atomic/Alert/index.js +1 -1
  3. package/dist/atomic/AlertDialog/index.d.ts.map +1 -1
  4. package/dist/atomic/AlertDialog/index.js +1 -1
  5. package/dist/atomic/Avatar/index.d.ts +1 -1
  6. package/dist/atomic/Avatar/index.d.ts.map +1 -1
  7. package/dist/atomic/Avatar/index.js +1 -1
  8. package/dist/atomic/Badge/index.d.ts.map +1 -1
  9. package/dist/atomic/Badge/index.js +1 -1
  10. package/dist/atomic/Blockquote/index.js +1 -1
  11. package/dist/atomic/Button/index.d.ts.map +1 -1
  12. package/dist/atomic/Button/index.js +1 -1
  13. package/dist/atomic/Calendar/index.js +1 -1
  14. package/dist/atomic/CallToAction/index.js +1 -1
  15. package/dist/atomic/Card/index.d.ts.map +1 -1
  16. package/dist/atomic/Card/index.js +1 -1
  17. package/dist/atomic/Checkbox/index.d.ts.map +1 -1
  18. package/dist/atomic/Checkbox/index.js +1 -1
  19. package/dist/atomic/Collapsible/index.js +1 -1
  20. package/dist/atomic/Combobox/index.js +1 -1
  21. package/dist/atomic/Command/index.js +1 -1
  22. package/dist/atomic/CommandDialog/index.d.ts.map +1 -1
  23. package/dist/atomic/CommandDialog/index.js +1 -1
  24. package/dist/atomic/ContextMenu/index.js +1 -1
  25. package/dist/atomic/CopyToClipboard/index.js +1 -1
  26. package/dist/atomic/DescriptionList/index.js +1 -1
  27. package/dist/atomic/Dialog/index.js +1 -1
  28. package/dist/atomic/DropdownMenu/index.js +1 -1
  29. package/dist/atomic/DualCard/index.d.ts.map +1 -1
  30. package/dist/atomic/DualCard/index.js +1 -1
  31. package/dist/atomic/FeatureFallback/index.d.ts.map +1 -1
  32. package/dist/atomic/FeatureFallback/index.js +1 -1
  33. package/dist/atomic/FileButton/index.js +1 -1
  34. package/dist/atomic/Grid/index.d.ts +2 -2
  35. package/dist/atomic/Grid/index.d.ts.map +1 -1
  36. package/dist/atomic/Grid/index.js +1 -1
  37. package/dist/atomic/HeroSection/index.js +1 -1
  38. package/dist/atomic/HoverCard/index.js +1 -1
  39. package/dist/atomic/Icons/index.js +1 -1
  40. package/dist/atomic/InfiniteScroll/index.js +1 -1
  41. package/dist/atomic/Input/index.d.ts.map +1 -1
  42. package/dist/atomic/Input/index.js +1 -1
  43. package/dist/atomic/Label/index.d.ts.map +1 -1
  44. package/dist/atomic/Label/index.js +1 -1
  45. package/dist/atomic/List/index.d.ts.map +1 -1
  46. package/dist/atomic/List/index.js +1 -1
  47. package/dist/atomic/NavigationMenu/index.js +1 -1
  48. package/dist/atomic/Pagination/index.js +1 -1
  49. package/dist/atomic/PasswordInput/index.js +1 -1
  50. package/dist/atomic/Popover/index.js +1 -1
  51. package/dist/atomic/Portal/index.js +1 -1
  52. package/dist/atomic/PortalButton/index.js +1 -1
  53. package/dist/atomic/Progress/index.d.ts.map +1 -1
  54. package/dist/atomic/Progress/index.js +1 -1
  55. package/dist/atomic/RadioGroup/index.d.ts.map +1 -1
  56. package/dist/atomic/RadioGroup/index.js +1 -1
  57. package/dist/atomic/RangeInput/index.d.ts.map +1 -1
  58. package/dist/atomic/RangeInput/index.js +1 -1
  59. package/dist/atomic/Rating/index.js +1 -1
  60. package/dist/atomic/ScrollArea/index.js +1 -1
  61. package/dist/atomic/Section/index.d.ts.map +1 -1
  62. package/dist/atomic/Section/index.js +1 -1
  63. package/dist/atomic/Select/index.d.ts.map +1 -1
  64. package/dist/atomic/Select/index.js +1 -1
  65. package/dist/atomic/Separator/index.d.ts.map +1 -1
  66. package/dist/atomic/Separator/index.js +1 -1
  67. package/dist/atomic/Sheet/index.js +1 -1
  68. package/dist/atomic/Skeleton/index.js +1 -1
  69. package/dist/atomic/Slider/index.d.ts.map +1 -1
  70. package/dist/atomic/Slider/index.js +1 -1
  71. package/dist/atomic/Slot/index.js +1 -1
  72. package/dist/atomic/Spinner/index.js +1 -1
  73. package/dist/atomic/Stack/index.js +1 -1
  74. package/dist/atomic/Stepper/index.js +1 -1
  75. package/dist/atomic/Switch/index.d.ts.map +1 -1
  76. package/dist/atomic/Switch/index.js +1 -1
  77. package/dist/atomic/Table/index.js +1 -1
  78. package/dist/atomic/Tabs/index.d.ts.map +1 -1
  79. package/dist/atomic/Tabs/index.js +1 -1
  80. package/dist/atomic/Tag/index.js +1 -1
  81. package/dist/atomic/Text/index.d.ts.map +1 -1
  82. package/dist/atomic/Text/index.js +1 -1
  83. package/dist/atomic/Textarea/index.js +1 -1
  84. package/dist/atomic/Toaster/index.d.ts.map +1 -1
  85. package/dist/atomic/Toaster/index.js +1 -1
  86. package/dist/atomic/Toggle/index.d.ts.map +1 -1
  87. package/dist/atomic/Toggle/index.js +1 -1
  88. package/dist/atomic/ToggleGroup/index.js +1 -1
  89. package/dist/atomic/Tooltip/index.js +1 -1
  90. package/dist/atomic/VideoPlayer/index.js +1 -1
  91. package/dist/atomic/VisuallyHidden/index.js +1 -1
  92. package/dist/atomic/index.js +1 -1
  93. package/dist/crud/components/DateFilter.js +1 -1
  94. package/dist/crud/components/DisplayFieldRenderer.js +1 -1
  95. package/dist/crud/components/EntityCardList.js +1 -1
  96. package/dist/crud/components/EntityDisplayRenderer.js +1 -1
  97. package/dist/crud/components/EntityFilters.js +1 -1
  98. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  99. package/dist/crud/components/EntityList.js +1 -1
  100. package/dist/crud/components/FormFieldRenderer.js +1 -1
  101. package/dist/crud/components/FormLayout.js +1 -1
  102. package/dist/crud/components/index.js +1 -1
  103. package/dist/crud/contexts/UploadContext.js +1 -1
  104. package/dist/crud/stores/index.js +1 -1
  105. package/dist/features/auth/components/AuthPartnerButton.d.ts.map +1 -1
  106. package/dist/features/auth/components/AuthPartnerButton.js +1 -1
  107. package/dist/features/auth/components/ConfirmDeleteDialog.js +1 -1
  108. package/dist/features/auth/components/FeatureGuard.js +1 -1
  109. package/dist/features/auth/components/GoogleOneTap.js +1 -1
  110. package/dist/features/auth/components/LoginModal.js +1 -1
  111. package/dist/features/auth/components/MultipleAuthProviders.d.ts.map +1 -1
  112. package/dist/features/auth/components/MultipleAuthProviders.js +1 -1
  113. package/dist/features/auth/components/ReauthDialog.js +1 -1
  114. package/dist/features/auth/components/index.js +1 -1
  115. package/dist/features/auth/hooks/index.js +1 -1
  116. package/dist/features/auth/hooks/useAuthState.js +1 -1
  117. package/dist/features/auth/hooks/useCanAccess.js +1 -1
  118. package/dist/features/auth/hooks/useHasRole.js +1 -1
  119. package/dist/features/auth/hooks/useUserRole.js +1 -1
  120. package/dist/features/auth/index.js +1 -1
  121. package/dist/features/billing/components/ProductCard.d.ts.map +1 -1
  122. package/dist/features/billing/components/ProductCard.js +1 -1
  123. package/dist/features/billing/components/SecurityNotice.js +1 -1
  124. package/dist/features/billing/components/StripeCheckoutButton.d.ts.map +1 -1
  125. package/dist/features/billing/components/StripeCheckoutButton.js +1 -1
  126. package/dist/features/billing/components/SubscriptionManager.js +1 -1
  127. package/dist/features/billing/components/index.js +1 -1
  128. package/dist/features/billing/index.js +1 -1
  129. package/dist/features/oauth/components/MultipleOAuthProviders.d.ts.map +1 -1
  130. package/dist/features/oauth/components/MultipleOAuthProviders.js +1 -1
  131. package/dist/features/oauth/components/OAuthConnectionModal.d.ts.map +1 -1
  132. package/dist/features/oauth/components/OAuthConnectionModal.js +1 -1
  133. package/dist/features/oauth/components/OAuthFallback.d.ts.map +1 -1
  134. package/dist/features/oauth/components/OAuthFallback.js +1 -1
  135. package/dist/features/oauth/components/OAuthPartnerButton.js +1 -1
  136. package/dist/features/oauth/components/index.js +1 -1
  137. package/dist/firebase/authPersistence.d.ts.map +1 -1
  138. package/dist/firebase/authPersistence.js +1 -1
  139. package/dist/firebase/index.js +1 -1
  140. package/dist/index.js +1 -1
  141. package/dist/providers/ExpoAppProviders.js +1 -1
  142. package/dist/routing/components.js +1 -1
  143. package/dist/storage/AsyncStorageStrategy.js +1 -1
  144. package/dist/storage/zustandAsyncStorage.js +1 -1
  145. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  146. package/dist/theme/ThemeProvider.js +1 -1
  147. package/dist/theme/index.js +1 -1
  148. package/dist/theme/tokens.js +1 -1
  149. package/dist/utils/constants.js +1 -1
  150. package/dist/utils/helpers.js +1 -1
  151. package/dist/utils/index.js +1 -1
  152. package/dist/utils/theme-helpers.js +1 -1
  153. package/dist/utils/useAuthSafe.js +1 -1
  154. package/dist/utils/variants.js +1 -1
  155. package/package.json +9 -8
  156. package/dist/__tests__/components/atomic.test.d.ts +0 -10
  157. package/dist/__tests__/components/atomic.test.d.ts.map +0 -1
  158. package/dist/__tests__/components/atomic.test.js +0 -1
  159. package/dist/__tests__/providers/ExpoAppProviders.test.d.ts +0 -10
  160. package/dist/__tests__/providers/ExpoAppProviders.test.d.ts.map +0 -1
  161. package/dist/__tests__/providers/ExpoAppProviders.test.js +0 -1
  162. package/dist/__tests__/setup.d.ts +0 -10
  163. package/dist/__tests__/setup.d.ts.map +0 -1
  164. package/dist/__tests__/setup.js +0 -1
  165. package/dist/__tests__/test-utils.d.ts +0 -22
  166. package/dist/__tests__/test-utils.d.ts.map +0 -1
  167. package/dist/__tests__/test-utils.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthFallback.d.ts","sourceRoot":"","sources":["../../../../src/features/oauth/components/OAuthFallback.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,iBAAyB,EACzB,KAAK,EACL,MAAM,GACP,EAAE,kBAAkB,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,2CAa7D;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"OAuthFallback.d.ts","sourceRoot":"","sources":["../../../../src/features/oauth/components/OAuthFallback.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,iBAAyB,EACzB,KAAK,EACL,MAAM,GACP,EAAE,kBAAkB,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,2CAgB7D;AAED,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{View as r}from"react-native";import{Text as l,Button as c}from"../../../atomic";function a({message:s,showConnectButton:n=!1,style:o,testID:t}){return i(r,{style:o,testID:t,children:[e(l,{level:"body",variant:"muted",children:s||"OAuth is not available"}),n&&e(c,{variant:"outline",testID:t?`${t}-connect`:void 0,children:"Connect Account"})]})}var u=a;export{a as OAuthFallback,u as default};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{View as a}from"react-native";import{Text as l,Button as s}from"../../../atomic";function c({message:n,showConnectButton:o=!1,style:r,testID:t}){return i(a,{style:r,testID:t,children:[e(l,{level:"body",variant:"muted",children:n||"OAuth is not available"}),o&&e(s,{variant:"outline",testID:t?`${t}-connect`:void 0,children:"Connect Account"})]})}var m=c;export{c as OAuthFallback,m as default};
@@ -1 +1 @@
1
- import{jsx as m}from"react/jsx-runtime";import{Button as h}from"../../../atomic";import"@donotdev/core";import{useOAuth as e}from"@donotdev/oauth";function g({partnerId:i,providerId:s,purpose:I,showLabel:a=!0,children:o,disabled:c,onSuccess:u,onError:d,style:l,testID:p}){const f=e("connect"),t=e("status")==="initializing",r=i||s;return m(h,{variant:"outline",onPress:async()=>{if(r)try{await f(r),u?.()}catch(n){d?.(n instanceof Error?n:new Error(String(n)))}},disabled:c||t,loading:t,style:l,testID:p,children:(()=>{if(o)return o;if(a)return t?`Connecting to ${r}...`:`Connect ${r}`})()})}var y=g;export{y as default};
1
+ import{jsx as g}from"react/jsx-runtime";import{Button as p}from"../../../atomic";import"@donotdev/core";import{useOAuth as o}from"@donotdev/oauth";function h({partnerId:s,providerId:i,purpose:x,showLabel:u=!0,children:e,disabled:a,onSuccess:c,onError:f,style:d,testID:l}){const m=o("connect"),n=o("status")==="initializing",t=s||i;return g(p,{variant:"outline",onPress:async()=>{if(t)try{await m(t),c?.()}catch(r){f?.(r instanceof Error?r:new Error(String(r)))}},disabled:a||n,loading:n,style:d,testID:l,children:(()=>{if(e)return e;if(u)return n?`Connecting to ${t}...`:`Connect ${t}`})()})}var C=h;export{C as default};
@@ -1 +1 @@
1
- import{default as a}from"./MultipleOAuthProviders";import{default as t}from"./OAuthConnectionModal";import{OAuthFallback as o}from"./OAuthFallback";import{default as r}from"./OAuthPartnerButton";export{a as MultipleOAuthProviders,t as OAuthConnectionModal,o as OAuthFallback,r as OAuthPartnerButton};
1
+ import{default as r}from"./MultipleOAuthProviders";import{default as a}from"./OAuthConnectionModal";import{OAuthFallback as l}from"./OAuthFallback";import{default as d}from"./OAuthPartnerButton";export{r as MultipleOAuthProviders,a as OAuthConnectionModal,l as OAuthFallback,d as OAuthPartnerButton};
@@ -1 +1 @@
1
- {"version":3,"file":"authPersistence.d.ts","sourceRoot":"","sources":["../../src/firebase/authPersistence.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAMH;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,iCAYjC;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"authPersistence.d.ts","sourceRoot":"","sources":["../../src/firebase/authPersistence.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAUH;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,iCAYjC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- import{getAuth as i,initializeAuth as r,getReactNativePersistence as a}from"firebase/auth";import o from"@react-native-async-storage/async-storage";import{getApp as s}from"firebase/app";function e(){const t=s();try{return i(t)}catch{return r(t,{persistence:a(o)})}}var n=e;export{n as default,e as initializeExpoAuth};
1
+ import{getAuth as e,initializeAuth as r,getReactNativePersistence as i}from"firebase/auth";import o from"@react-native-async-storage/async-storage";import{getApp as p}from"firebase/app";function n(){const t=p();try{return e(t)}catch{return r(t,{persistence:i(o)})}}var m=n;export{m as default,n as initializeExpoAuth};
@@ -1 +1 @@
1
- import{initializeExpoAuth as i}from"./authPersistence";export{i as initializeExpoAuth};
1
+ import{initializeExpoAuth as t}from"./authPersistence";export{t as initializeExpoAuth};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./atomic";export*from"./utils";export*from"./crud";import{AsyncStorageStrategy as r}from"./storage/AsyncStorageStrategy";import{zustandAsyncStorage as o}from"./storage/zustandAsyncStorage";import{ExpoAppProviders as t,getZustandAsyncStorage as s}from"./providers/ExpoAppProviders";export*from"./routing";export*from"./firebase";export*from"./theme";export{r as AsyncStorageStrategy,t as ExpoAppProviders,s as getZustandAsyncStorage,o as zustandAsyncStorage};
1
+ export*from"./atomic";export*from"./utils";export*from"./crud";import{AsyncStorageStrategy as x}from"./storage/AsyncStorageStrategy";import{zustandAsyncStorage as m}from"./storage/zustandAsyncStorage";import{ExpoAppProviders as s,getZustandAsyncStorage as g}from"./providers/ExpoAppProviders";export*from"./routing";export*from"./firebase";export*from"./theme";export{x as AsyncStorageStrategy,s as ExpoAppProviders,g as getZustandAsyncStorage,m as zustandAsyncStorage};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useEffect as l}from"react";import{SafeAreaProvider as m}from"react-native-safe-area-context";import{QueryClient as u,QueryClientProvider as p}from"@tanstack/react-query";import{getStorageManager as f,initializePlatformDetection as c}from"@donotdev/core";import{AsyncStorageStrategy as d}from"../storage/AsyncStorageStrategy";import{zustandAsyncStorage as g}from"../storage/zustandAsyncStorage";import{ThemeProvider as _}from"../theme";let o=null;function y(){return o||(o=new u({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*30}}})),o}function a({children:s,userId:e}){return l(()=>{if(typeof globalThis<"u"){const t=globalThis._DNDEV_CONFIG_;globalThis._DNDEV_CONFIG_={...t,platform:"expo",context:"client",mode:__DEV__?"development":"production",version:t?.version||"0.0.0",timestamp:t?.timestamp||Date.now()}}c();const i=f(),n=new d(e||null);return i.setStrategy(n),e&&i.updateUser(e,!1),()=>{n.setUserId(null)}},[e]),r(m,{children:r(_,{children:r(p,{client:y(),children:s})})})}function h(){return g}var v=a;export{a as ExpoAppProviders,v as default,h as getZustandAsyncStorage};
1
+ import{jsx as r}from"react/jsx-runtime";import{useEffect as l}from"react";import{SafeAreaProvider as s}from"react-native-safe-area-context";import{QueryClient as m,QueryClientProvider as f}from"@tanstack/react-query";import{getStorageManager as p,initializePlatformDetection as u}from"@donotdev/core";import{AsyncStorageStrategy as c}from"../storage/AsyncStorageStrategy";import{zustandAsyncStorage as g}from"../storage/zustandAsyncStorage";import{ThemeProvider as d}from"../theme";let o=null;function y(){return o||(o=new m({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*30}}})),o}function _({children:a,userId:e}){return l(()=>{if(typeof globalThis<"u"){const t=globalThis._DNDEV_CONFIG_;globalThis._DNDEV_CONFIG_={...t,platform:"expo",context:"client",mode:__DEV__?"development":"production",version:t?.version||"0.0.0",timestamp:t?.timestamp||Date.now()}}u();const i=p(),n=new c(e||null);return i.setStrategy(n),e&&i.updateUser(e,!1),()=>{n.setUserId(null)}},[e]),r(s,{children:r(d,{children:r(f,{client:y(),children:a})})})}function E(){return g}var P=_;export{_ as ExpoAppProviders,P as default,E as getZustandAsyncStorage};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{Link as o}from"expo-router";import{TouchableOpacity as t}from"react-native";function c({to:r,children:a,replace:e,...n}){return i(o,{href:r,replace:e,asChild:!0,children:i(t,{...n,children:a})})}function l({to:r}){return null}export{c as Link,l as Navigate};
1
+ import{jsx as i}from"react/jsx-runtime";import{Link as n}from"expo-router";import{TouchableOpacity as a}from"react-native";function u({to:r,children:o,replace:t,...e}){return i(n,{href:r,replace:t,asChild:!0,children:i(a,{...e,children:o})})}function f({to:r}){return null}export{u as Link,f as Navigate};
@@ -1 +1 @@
1
- import o from"@react-native-async-storage/async-storage";import{BaseStorageStrategy as y,handleError as l}from"@donotdev/core";class d extends y{userId=null;constructor(t=null){super(),this.userId=t}setUserId(t){this.userId=t}async get(t,r={}){const{scope:s="user",encryption:e=!1}=r,a=this.buildKey(t,s,this.userId,!0);if(!a)return null;let u;try{u=await o.getItem(a)}catch(c){throw l(c,{userMessage:"Failed to read from storage",context:{key:t,options:r}})}if(!u)return null;let n;try{n=JSON.parse(u)}catch{return await o.removeItem(a).catch(()=>{}),null}if(n.expiresAt&&new Date(n.expiresAt)<new Date)return await this.remove(t),null;const i=n.value;if(e)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");return i}async set(t,r,s={}){const{scope:e="user",encryption:a=!1,expiry:u=0}=s,n=this.buildKey(t,e,this.userId,!0);if(n)try{if(a)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");const i=u>0?new Date(Date.now()+u*1e3).toISOString():null,c=JSON.stringify({value:r,expiresAt:i});await o.setItem(n,c)}catch(i){const c=i instanceof Error&&/quota/i.test(i.message)?"Storage quota exceeded. Please free up space or login to sync to cloud.":"Failed to store data in storage";throw l(i,{userMessage:c,context:{key:t,options:s}})}}async remove(t){const r=["user","global","session"];for(const s of r)try{const e=this.buildKey(t,s,this.userId,!0);if(!e)continue;await o.removeItem(e)}catch{}}async clear(t){if(!t){const e=(await o.getAllKeys()).filter(a=>a.startsWith("dndev:"));await o.multiRemove(e);return}const r=t==="user"&&this.userId?`dndev:user:${this.userId}:`:`dndev:${t}:`,s=(await o.getAllKeys()).filter(e=>e.startsWith(r));await o.multiRemove(s)}}var p=d;export{d as AsyncStorageStrategy,p as default};
1
+ import n from"@react-native-async-storage/async-storage";import{BaseStorageStrategy as d,handleError as c}from"@donotdev/core";class y extends d{userId=null;constructor(e=null){super(),this.userId=e}setUserId(e){this.userId=e}async get(e,s={}){const{scope:i="user",encryption:t=!1}=s,o=this.buildKey(e,i,this.userId,!0);if(!o)return null;let a;try{a=await n.getItem(o)}catch(u){throw c(u,{userMessage:"Failed to read from storage",context:{key:e,options:s}})}if(!a)return null;let r;try{r=JSON.parse(a)}catch{return await n.removeItem(o).catch(()=>{}),null}if(r.expiresAt&&new Date(r.expiresAt)<new Date)return await this.remove(e),null;const l=r.value;if(t)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");return l}async set(e,s,i={}){const{scope:t="user",encryption:o=!1,expiry:a=0}=i,r=this.buildKey(e,t,this.userId,!0);if(r)try{if(o)throw new Error("AsyncStorageStrategy: encryption is not yet supported. Data would be stored in plaintext \u2014 refusing to proceed.");const l=a>0?new Date(Date.now()+a*1e3).toISOString():null,u=JSON.stringify({value:s,expiresAt:l});await n.setItem(r,u)}catch(l){const u=l instanceof Error&&/quota/i.test(l.message)?"Storage quota exceeded. Please free up space or login to sync to cloud.":"Failed to store data in storage";throw c(l,{userMessage:u,context:{key:e,options:i}})}}async remove(e){const s=["user","global","session"];for(const i of s)try{const t=this.buildKey(e,i,this.userId,!0);if(!t)continue;await n.removeItem(t)}catch{}}async clear(e){if(!e){const a=(await n.getAllKeys()).filter(r=>r.startsWith("dndev:"));await n.multiRemove(a);return}const s=e==="user"&&this.userId?`dndev:user:${this.userId}:`:`dndev:${e}:`,t=(await n.getAllKeys()).filter(o=>o.startsWith(s));await n.multiRemove(t)}}var h=y;export{y as AsyncStorageStrategy,h as default};
@@ -1 +1 @@
1
- import a from"@react-native-async-storage/async-storage";const e={getItem:async t=>{try{return await a.getItem(t)}catch{return __DEV__,null}},setItem:async(t,r)=>{try{await a.setItem(t,r)}catch(_){throw __DEV__,_}},removeItem:async t=>{try{await a.removeItem(t)}catch{__DEV__}}};var c=e;export{c as default,e as zustandAsyncStorage};
1
+ import t from"@react-native-async-storage/async-storage";const a={getItem:async e=>{try{return await t.getItem(e)}catch{return __DEV__,null}},setItem:async(e,r)=>{try{await t.setItem(e,r)}catch(o){throw __DEV__,o}},removeItem:async e=>{try{await t.removeItem(e)}catch{__DEV__}}};var s=a;export{s as default,a as zustandAsyncStorage};
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAE7D,UAAU,iBAAiB;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACrD,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACtC;AAID,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,YAAqB,EACrB,YAAmB,GACpB,EAAE,kBAAkB,2CAqBpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAM5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7B"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAE7D,UAAU,iBAAiB;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACrD,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACtC;AAID,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,YAAqB,EACrB,YAAmB,GACpB,EAAE,kBAAkB,2CAqBpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAM5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7B"}
@@ -1 +1 @@
1
- import{jsx as d}from"react/jsx-runtime";import{createContext as l,useContext as f,useState as T}from"react";import{useColorScheme as p}from"react-native";import{lightTheme as v,darkTheme as x}from"./tokens";const t=l(void 0);function C({children:e,initialTheme:m="auto",followSystem:a=!0}){const i=p(),[o,n]=T(m),r=o==="dark"||o==="auto"&&a&&i==="dark",h=r?x:v,u=c=>{n(c)};return d(t.Provider,{value:{theme:h,isDark:r,setTheme:u,themeMode:o},children:e})}function s(){const e=f(t);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function k(){const{theme:e}=s();return e.colors}export{C as ThemeProvider,s as useTheme,k as useThemeColors};
1
+ import{jsx as d}from"react/jsx-runtime";import{createContext as a,useContext as T,useState as f}from"react";import{useColorScheme as x}from"react-native";import{lightTheme as l,darkTheme as p}from"./tokens";const r=a(void 0);function S({children:e,initialTheme:n="auto",followSystem:s=!0}){const m=x(),[t,h]=f(n),o=t==="dark"||t==="auto"&&s&&m==="dark",u=o?p:l,c=i=>{h(i)};return d(r.Provider,{value:{theme:u,isDark:o,setTheme:c,themeMode:t},children:e})}function C(){const e=T(r);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function j(){const{theme:e}=C();return e.colors}export{S as ThemeProvider,C as useTheme,j as useThemeColors};
@@ -1 +1 @@
1
- export*from"./tokens";export*from"./ThemeProvider";import{useTheme as e,useThemeColors as o}from"./ThemeProvider";export{e as useTheme,o as useThemeColors};
1
+ export*from"./tokens";export*from"./ThemeProvider";import{useTheme as f,useThemeColors as p}from"./ThemeProvider";export{f as useTheme,p as useThemeColors};
@@ -1 +1 @@
1
- const r={none:0,sm:8,md:16,lg:32},f={none:0,md:12,full:9999,interactive:0,surface:12,floating:0},o={fontSize:{xs:12,sm:14,base:16,lg:20,xl:25,"2xl":31,"3xl":39},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{base:1.25}},e={touchTarget:48,iconMd:24,iconTouch:32},d={header:100,sidebar:90,footer:1,overlay:40,breadcrumbs:10,dropdown:50,modal:1e3,tooltip:1100,toast:1200},a={subtle:.3,muted:.6,strong:.9},n={fast:150,normal:300,slow:500,heavy:700,hero:1e3},t={background:"#ffffff",foreground:"#000000",textColor:"#000000",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#047857",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#000000",destructive:"#dc2626",destructiveForeground:"#ffffff",success:"#047857",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#f3f4f6",mutedForeground:"#4b5563",border:"#e5e7eb",input:"#f3f4f6",ring:"#00bcd4",card:"#ffffff",cardForeground:"#000000",popover:"#ffffff",popoverForeground:"#000000"},s={background:"#000000",foreground:"#ffffff",textColor:"#ffffff",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#10b981",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#ffffff",destructive:"#ef4444",destructiveForeground:"#ffffff",success:"#10b981",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#1f2937",mutedForeground:"#d1d5db",border:"#374151",input:"#1f2937",ring:"#00bcd4",card:"#111827",cardForeground:"#ffffff",popover:"#111827",popoverForeground:"#ffffff"},c={colors:t,spacing:r,radius:f,typography:o,interactive:e,zIndex:d,opacity:a,duration:n},u={colors:s,spacing:r,radius:f,typography:o,interactive:e,zIndex:d,opacity:a,duration:n},i=c;export{s as colorsDark,t as colorsLight,u as darkTheme,i as defaultTheme,n as duration,e as interactive,c as lightTheme,a as opacity,f as radius,r as spacing,o as typography,d as zIndex};
1
+ const o={none:0,sm:8,md:16,lg:32},r={none:0,md:12,full:9999,interactive:0,surface:12,floating:0},f={fontSize:{xs:12,sm:14,base:16,lg:20,xl:25,"2xl":31,"3xl":39},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{base:1.25}},e={touchTarget:48,iconMd:24,iconTouch:32},n={header:100,sidebar:90,footer:1,overlay:40,breadcrumbs:10,dropdown:50,modal:1e3,tooltip:1100,toast:1200},t={subtle:.3,muted:.6,strong:.9},d={fast:150,normal:300,slow:500,heavy:700,hero:1e3},c={background:"#ffffff",foreground:"#000000",textColor:"#000000",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#047857",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#000000",destructive:"#dc2626",destructiveForeground:"#ffffff",success:"#047857",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#f3f4f6",mutedForeground:"#4b5563",border:"#e5e7eb",input:"#f3f4f6",ring:"#00bcd4",card:"#ffffff",cardForeground:"#000000",popover:"#ffffff",popoverForeground:"#000000"},s={background:"#000000",foreground:"#ffffff",textColor:"#ffffff",primary:"#00bcd4",primaryForeground:"#000000",secondary:"#10b981",secondaryForeground:"#ffffff",accent:"#ff9800",accentForeground:"#ffffff",destructive:"#ef4444",destructiveForeground:"#ffffff",success:"#10b981",successForeground:"#ffffff",warning:"#f59e0b",warningForeground:"#000000",muted:"#1f2937",mutedForeground:"#d1d5db",border:"#374151",input:"#1f2937",ring:"#00bcd4",card:"#111827",cardForeground:"#ffffff",popover:"#111827",popoverForeground:"#ffffff"},a={colors:c,spacing:o,radius:r,typography:f,interactive:e,zIndex:n,opacity:t,duration:d},u={colors:s,spacing:o,radius:r,typography:f,interactive:e,zIndex:n,opacity:t,duration:d},g=a;export{s as colorsDark,c as colorsLight,u as darkTheme,g as defaultTheme,d as duration,e as interactive,a as lightTheme,t as opacity,r as radius,o as spacing,f as typography,n as zIndex};
@@ -1 +1 @@
1
- const A={DEFAULT:"default",MUTED:"muted",PRIMARY:"primary",SECONDARY:"secondary",ACCENT:"accent",SUCCESS:"success",WARNING:"warning",DESTRUCTIVE:"destructive"},T={...A,OUTLINE:"outline",GLASS:"glass"},s=T,E=A;export{E as CONTROL_VARIANT,s as FLOATING_VARIANT,T as SURFACE_VARIANT,A as THEME_VARIANT};
1
+ const A={DEFAULT:"default",MUTED:"muted",PRIMARY:"primary",SECONDARY:"secondary",ACCENT:"accent",SUCCESS:"success",WARNING:"warning",DESTRUCTIVE:"destructive"},t={...A,OUTLINE:"outline",GLASS:"glass"},T=t,e=A;export{e as CONTROL_VARIANT,T as FLOATING_VARIANT,t as SURFACE_VARIANT,A as THEME_VARIANT};
@@ -1 +1 @@
1
- function t(...a){return Object.assign({},...a.filter(Boolean))}function e(a){const n={};return a.variant!=null&&(n["data-variant"]=a.variant),a.size!=null&&(n["data-size"]=a.size),n}export{e as getVariantDataAttrs,t as mergeStyles};
1
+ function n(...t){return Object.assign({},...t.filter(Boolean))}function a(t){const e={};return t.variant!=null&&(e["data-variant"]=t.variant),t.size!=null&&(e["data-size"]=t.size),e}export{a as getVariantDataAttrs,n as mergeStyles};
@@ -1 +1 @@
1
- export*from"./helpers";export*from"./constants";export*from"./variants";import{useAuthSafe as a,isAuthAvailable as e}from"./useAuthSafe";export{e as isAuthAvailable,a as useAuthSafe};
1
+ export*from"./helpers";export*from"./constants";export*from"./variants";import{useAuthSafe as m,isAuthAvailable as p}from"./useAuthSafe";export{p as isAuthAvailable,m as useAuthSafe};
@@ -1 +1 @@
1
- function c(r,e){const o={default:"foreground",primary:"primary",secondary:"secondary",accent:"accent",success:"success",warning:"warning",destructive:"destructive",muted:"muted"};return r.colors[o[e]||"foreground"]}function s(r,e){const o={default:"foreground",primary:"primaryForeground",secondary:"secondaryForeground",accent:"accentForeground",success:"successForeground",warning:"warningForeground",destructive:"destructiveForeground",muted:"mutedForeground"};return r.colors[o[e]||"foreground"]}function u(r){const e=r.colors.background;if(e.startsWith("#")){const o=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),t=parseInt(e.slice(5,7),16);return`rgba(${o}, ${n}, ${t}, 0.5)`}return e}function a(r){return r.colors.foreground}function d(r){return r.opacity.subtle}export{u as getOverlayBackground,a as getShadowColor,d as getShadowOpacity,c as getVariantColor,s as getVariantForegroundColor};
1
+ function c(r,o){const e={default:"foreground",primary:"primary",secondary:"secondary",accent:"accent",success:"success",warning:"warning",destructive:"destructive",muted:"muted"};return r.colors[e[o]||"foreground"]}function u(r,o){const e={default:"foreground",primary:"primaryForeground",secondary:"secondaryForeground",accent:"accentForeground",success:"successForeground",warning:"warningForeground",destructive:"destructiveForeground",muted:"mutedForeground"};return r.colors[e[o]||"foreground"]}function s(r){const o=r.colors.background;if(o.startsWith("#")){const e=parseInt(o.slice(1,3),16),n=parseInt(o.slice(3,5),16),t=parseInt(o.slice(5,7),16);return`rgba(${e}, ${n}, ${t}, 0.5)`}return o}function a(r){return r.colors.foreground}function d(r){return r.opacity.subtle}export{s as getOverlayBackground,a as getShadowColor,d as getShadowOpacity,c as getVariantColor,u as getVariantForegroundColor};
@@ -1 +1 @@
1
- import{DEGRADED_AUTH_API as s}from"@donotdev/core";import*as e from"@donotdev/auth";const t=e?.useAuth;function n(o){return s[o]}const r=t??n,u=typeof t=="function";export{u as isAuthAvailable,r as useAuthSafe};
1
+ import{DEGRADED_AUTH_API as o}from"@donotdev/core";import*as e from"@donotdev/auth";const t=e?.useAuth;function r(u){return o[u]}const s=t??r,n=typeof t=="function";export{n as isAuthAvailable,s as useAuthSafe};
@@ -1 +1 @@
1
- import"react-native";import"./constants";function c(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.muted},primary:{backgroundColor:r.primary},secondary:{backgroundColor:r.secondary},accent:{backgroundColor:r.accent},success:{backgroundColor:r.success},warning:{backgroundColor:r.warning},destructive:{backgroundColor:r.destructive},muted:{backgroundColor:r.muted},ghost:{backgroundColor:"transparent"},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},link:{backgroundColor:"transparent"}}}function e(o){const{colors:r}=o;return{default:{color:r.foreground},primary:{color:r.primaryForeground},secondary:{color:r.secondaryForeground},accent:{color:r.accentForeground},success:{color:r.successForeground},warning:{color:r.warningForeground},destructive:{color:r.destructiveForeground},muted:{color:r.mutedForeground},ghost:{color:r.foreground},outline:{color:r.foreground},link:{color:r.primary,textDecorationLine:"underline"}}}function a(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.card},primary:{backgroundColor:r.primary+"1A"},secondary:{backgroundColor:r.secondary+"1A"},accent:{backgroundColor:r.accent+"1A"},success:{backgroundColor:r.success+"1A"},warning:{backgroundColor:r.warning+"1A"},destructive:{backgroundColor:r.destructive+"1A"},muted:{backgroundColor:r.muted},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},glass:{backgroundColor:r.card+"CC"}}}export{e as getButtonTextVariants,c as getButtonVariants,a as getSurfaceVariants};
1
+ import"react-native";import"./constants";function u(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.muted},primary:{backgroundColor:r.primary},secondary:{backgroundColor:r.secondary},accent:{backgroundColor:r.accent},success:{backgroundColor:r.success},warning:{backgroundColor:r.warning},destructive:{backgroundColor:r.destructive},muted:{backgroundColor:r.muted},ghost:{backgroundColor:"transparent"},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},link:{backgroundColor:"transparent"}}}function d(o){const{colors:r}=o;return{default:{color:r.foreground},primary:{color:r.primaryForeground},secondary:{color:r.secondaryForeground},accent:{color:r.accentForeground},success:{color:r.successForeground},warning:{color:r.warningForeground},destructive:{color:r.destructiveForeground},muted:{color:r.mutedForeground},ghost:{color:r.foreground},outline:{color:r.foreground},link:{color:r.primary,textDecorationLine:"underline"}}}function s(o){const{colors:r,radius:n}=o;return{default:{backgroundColor:r.card},primary:{backgroundColor:r.primary+"1A"},secondary:{backgroundColor:r.secondary+"1A"},accent:{backgroundColor:r.accent+"1A"},success:{backgroundColor:r.success+"1A"},warning:{backgroundColor:r.warning+"1A"},destructive:{backgroundColor:r.destructive+"1A"},muted:{backgroundColor:r.muted},outline:{backgroundColor:"transparent",borderWidth:1,borderColor:r.border},glass:{backgroundColor:r.card+"CC"}}}export{d as getButtonTextVariants,u as getButtonVariants,s as getSurfaceVariants};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/expo",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "React Native/Expo UI components for DoNotDev framework",
@@ -51,8 +51,8 @@
51
51
  "test:coverage": "jest --coverage"
52
52
  },
53
53
  "dependencies": {
54
- "@donotdev/core": "^0.0.25",
55
- "@donotdev/crud": "^0.0.16",
54
+ "@donotdev/core": "^0.0.27",
55
+ "@donotdev/crud": "^0.0.18",
56
56
  "@expo/vector-icons": "^15.0.0",
57
57
  "@hookform/resolvers": "^5.2.2",
58
58
  "@react-native-async-storage/async-storage": "^2.1.0",
@@ -62,17 +62,18 @@
62
62
  "expo-clipboard": "^8.0.0",
63
63
  "expo-document-picker": "^14.0.0",
64
64
  "expo-router": "^6.0.0",
65
- "react-hook-form": "^7.71.1",
65
+ "react-hook-form": "^7.71.2",
66
66
  "react-native-safe-area-context": "^5.0.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@donotdev/auth": "^0.0.9",
70
- "@donotdev/billing": "^0.0.8",
71
- "@donotdev/oauth": "^0.0.8",
72
- "@donotdev/ui": "^0.0.15",
69
+ "@donotdev/auth": "^0.0.11",
70
+ "@donotdev/billing": "^0.0.10",
71
+ "@donotdev/oauth": "^0.0.10",
72
+ "@donotdev/ui": "^0.0.17",
73
73
  "@tanstack/react-query": "^5.0.0",
74
74
  "firebase": "^11.0.0",
75
75
  "react": "^19.2.4",
76
+ "react-dom": "^19.2.4",
76
77
  "react-native": "^0.84.0",
77
78
  "zustand": "^5.0.0"
78
79
  },
@@ -1,10 +0,0 @@
1
- /**
2
- * @fileoverview Atomic components smoke tests
3
- * @description Basic rendering tests to ensure components work
4
- *
5
- * @version 0.0.1
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- export {};
10
- //# sourceMappingURL=atomic.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atomic.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/components/atomic.test.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -1 +0,0 @@
1
- import{jsx as n,jsxs as y}from"react/jsx-runtime";import{describe as d,it as o,expect as t,vi as c}from"vitest";import{render as l,fireEvent as h}from"@testing-library/react-native";import T from"../../atomic/Button";import s from"../../atomic/Text";import g from"../../atomic/Card";import a from"../../atomic/Input";import B from"../../atomic/Stack";d("Atomic Components",()=>{d("Button",()=>{o("renders without crashing",()=>{const{getByText:e}=l(n(T,{children:"Test Button"}));t(e("Test Button")).toBeTruthy()}),o("calls onPress when pressed",()=>{const e=c.fn(),{getByText:r}=l(n(T,{onPress:e,children:"Click me"})),i=r("Click me");h.press(i),t(e).toHaveBeenCalledTimes(1)}),o("does not call onPress when disabled",()=>{const e=c.fn(),{getByText:r}=l(n(T,{onPress:e,disabled:!0,children:"Disabled Button"})),i=r("Disabled Button");h.press(i),t(e).not.toHaveBeenCalled()}),o("shows loading state correctly",()=>{const{getByText:e,queryByText:r}=l(n(T,{loading:!0,loadingText:"Loading...",children:"Original Text"}));t(e("Loading...")).toBeTruthy(),t(r("Original Text")).toBeNull()}),o("does not call onPress when loading",()=>{const e=c.fn(),{getByText:r}=l(n(T,{onPress:e,loading:!0,children:"Loading Button"})),i=r("Loading Button");h.press(i),t(e).not.toHaveBeenCalled()})}),d("Text",()=>{o("renders text content",()=>{const{getByText:e}=l(n(s,{children:"Hello World"}));t(e("Hello World")).toBeTruthy()}),o("renders with different levels",()=>{const{getByText:e}=l(n(s,{level:"h1",children:"Heading"}));t(e("Heading")).toBeTruthy()})}),d("Card",()=>{o("renders card with title",()=>{const{getByText:e}=l(n(g,{title:"Card Title",children:"Content"}));t(e("Card Title")).toBeTruthy(),t(e("Content")).toBeTruthy()})}),d("Input",()=>{o("renders input with placeholder",()=>{const{getByPlaceholderText:e}=l(n(a,{placeholder:"Enter text"}));t(e("Enter text")).toBeTruthy()}),o("renders input with label",()=>{const{getByText:e}=l(n(a,{label:"Name"}));t(e("Name")).toBeTruthy()}),o("calls onChangeText when text changes",()=>{const e=c.fn(),{getByPlaceholderText:r}=l(n(a,{placeholder:"Enter text",onChangeText:e})),i=r("Enter text");h.changeText(i,"Hello"),t(e).toHaveBeenCalledWith("Hello"),t(e).toHaveBeenCalledTimes(1)}),o("displays error message when provided",()=>{const{getByText:e}=l(n(a,{label:"Email",error:"Invalid email format"}));t(e("Invalid email format")).toBeTruthy()}),o("shows required indicator when required",()=>{const{getByText:e}=l(n(a,{label:"Name",required:!0})),r=e("Name");t(r).toBeTruthy()}),o("does not call onChangeText when disabled",()=>{const e=c.fn(),{getByPlaceholderText:r}=l(n(a,{placeholder:"Enter text",onChangeText:e,disabled:!0})),i=r("Enter text");h.changeText(i,"Hello"),t(e).not.toHaveBeenCalled()})}),d("Stack",()=>{o("renders children",()=>{const{getByText:e}=l(y(B,{children:[n(s,{children:"Item 1"}),n(s,{children:"Item 2"})]}));t(e("Item 1")).toBeTruthy(),t(e("Item 2")).toBeTruthy()}),o("applies gap spacing correctly",()=>{const{UNSAFE_getByType:e}=l(y(B,{gap:20,children:[n(s,{children:"Item 1"}),n(s,{children:"Item 2"})]})),r=e(B);t(r.props.gap).toBe(20)}),o("handles direction prop correctly",()=>{const{UNSAFE_getByType:e}=l(y(B,{direction:"row",children:[n(s,{children:"Item 1"}),n(s,{children:"Item 2"})]})),r=e(B);t(r.props.direction).toBe("row")})}),d("Card",()=>{o("renders card with title and content",()=>{const{getByText:e}=l(n(g,{title:"Card Title",children:"Card Content"}));t(e("Card Title")).toBeTruthy(),t(e("Card Content")).toBeTruthy()}),o("renders card with subtitle when provided",()=>{const{getByText:e}=l(n(g,{title:"Title",subtitle:"Subtitle",children:"Content"}));t(e("Subtitle")).toBeTruthy()}),o("renders card without title when not provided",()=>{const{getByText:e,queryByText:r}=l(n(g,{children:"Content only"}));t(e("Content only")).toBeTruthy(),t(r(/Title/i)).toBeNull()})}),d("Text",()=>{o("applies correct level styling",()=>{const{UNSAFE_getByType:e}=l(n(s,{level:"h1",children:"Heading"})),r=e(s);t(r.props.level).toBe("h1")}),o("renders with different levels correctly",()=>{["h1","h2","h3","h4","body","small","caption"].forEach(e=>{const{getByText:r,unmount:i}=l(y(s,{level:e,children:["Test ",e]}));t(r(`Test ${e}`)).toBeTruthy(),i()})})})});
@@ -1,10 +0,0 @@
1
- /**
2
- * @fileoverview ExpoAppProviders tests
3
- * @description Tests for ExpoAppProviders to ensure proper setup
4
- *
5
- * @version 0.0.1
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- export {};
10
- //# sourceMappingURL=ExpoAppProviders.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoAppProviders.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/providers/ExpoAppProviders.test.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -1 +0,0 @@
1
- import{jsx as s}from"react/jsx-runtime";import{describe as a,it as r,expect as t,beforeEach as c,vi as l}from"vitest";import{render as o}from"@testing-library/react-native";import{ExpoAppProviders as i,getZustandAsyncStorage as m}from"../../providers/ExpoAppProviders";import{getStorageManager as g}from"@donotdev/core";import{Text as n}from"react-native";a("ExpoAppProviders",()=>{c(()=>{l.clearAllMocks(),delete globalThis._DNDEV_CONFIG_}),r("renders children",()=>{const{getByText:e}=o(s(i,{children:s(n,{children:"Test Content"})}));t(e("Test Content")).toBeTruthy()}),r("initializes platform detection",async()=>{o(s(i,{children:s(n,{children:"Test"})})),await new Promise(e=>setTimeout(e,10)),t(globalThis._DNDEV_CONFIG_).toBeDefined(),t(globalThis._DNDEV_CONFIG_.platform).toBe("expo")}),r("sets AsyncStorageStrategy in StorageManager",async()=>{o(s(i,{userId:"user123",children:s(n,{children:"Test"})})),await new Promise(d=>setTimeout(d,10));const e=g();t(e).toBeDefined()}),r("handles userId prop",async()=>{o(s(i,{userId:"user123",children:s(n,{children:"Test"})})),await new Promise(e=>setTimeout(e,10)),t(globalThis._DNDEV_CONFIG_).toBeDefined()})}),a("getZustandAsyncStorage",()=>{r("returns zustandAsyncStorage instance",()=>{const e=m();t(e).toBeDefined(),t(e.getItem).toBeDefined(),t(e.setItem).toBeDefined(),t(e.removeItem).toBeDefined()})});
@@ -1,10 +0,0 @@
1
- /**
2
- * @fileoverview Test setup for Expo package
3
- * @description Mocks React Native APIs and sets up test environment
4
- *
5
- * @version 0.0.2
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- export {};
10
- //# sourceMappingURL=setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG"}
@@ -1 +0,0 @@
1
- import"react";jest.mock("react-native",()=>{const t=require("react");return{View:t.forwardRef(({children:e,...s},r)=>t.createElement("View",{...s,ref:r},e)),Text:t.forwardRef(({children:e,...s},r)=>t.createElement("Text",{...s,ref:r},e)),TouchableOpacity:t.forwardRef(({children:e,onPress:s,...r},n)=>t.createElement("TouchableOpacity",{...r,ref:n,onPress:s},e)),ScrollView:t.forwardRef(({children:e,...s},r)=>t.createElement("ScrollView",{...s,ref:r},e)),TextInput:t.forwardRef((e,s)=>t.createElement("TextInput",{...e,ref:s})),Modal:({children:e,...s})=>t.createElement("Modal",s,e),ActivityIndicator:e=>t.createElement("ActivityIndicator",e),Switch:e=>t.createElement("Switch",e),Image:t.forwardRef((e,s)=>t.createElement("Image",{...e,ref:s})),Platform:{OS:"ios",select:jest.fn(e=>e.ios||e.default)},Linking:{openURL:jest.fn(()=>Promise.resolve())},Clipboard:{setString:jest.fn(()=>Promise.resolve()),getString:jest.fn(()=>Promise.resolve(""))},StyleSheet:{create:jest.fn(e=>e),absoluteFill:{}},Animated:{View:"Animated.View",Value:jest.fn(()=>({setValue:jest.fn(),addListener:jest.fn(),removeListener:jest.fn()})),timing:jest.fn(()=>({start:jest.fn(e=>e?.())}))}}}),jest.mock("@react-native-async-storage/async-storage",()=>{const t=new Map;return{__esModule:!0,default:{getItem:jest.fn(e=>Promise.resolve(t.get(e)||null)),setItem:jest.fn((e,s)=>(t.set(e,s),Promise.resolve())),removeItem:jest.fn(e=>(t.delete(e),Promise.resolve())),getAllKeys:jest.fn(()=>Promise.resolve(Array.from(t.keys()))),multiRemove:jest.fn(e=>(e.forEach(s=>t.delete(s)),Promise.resolve())),clear:jest.fn(()=>(t.clear(),Promise.resolve()))}}}),jest.mock("expo-router",()=>({useRouter:jest.fn(()=>({push:jest.fn(),replace:jest.fn(),back:jest.fn(),setParams:jest.fn()})),useLocalSearchParams:jest.fn(()=>({})),usePathname:jest.fn(()=>"/"),useSegments:jest.fn(()=>[]),Link:"Link",useNavigation:jest.fn(()=>({navigate:jest.fn(),goBack:jest.fn()}))})),jest.mock("expo-av",()=>({Video:"Video",ResizeMode:{CONTAIN:"contain",COVER:"cover",STRETCH:"stretch"}})),jest.mock("expo-clipboard",()=>({setStringAsync:jest.fn(()=>Promise.resolve()),getStringAsync:jest.fn(()=>Promise.resolve(""))})),jest.mock("expo-document-picker",()=>({getDocumentAsync:jest.fn(()=>Promise.resolve({canceled:!1,assets:[{uri:"file://test.pdf",name:"test.pdf",mimeType:"application/pdf",size:1024}]}))})),jest.mock("@react-native-community/datetimepicker",()=>({default:"DateTimePicker"})),jest.mock("react-native-safe-area-context",()=>({SafeAreaProvider:({children:t})=>t,useSafeAreaInsets:jest.fn(()=>({top:0,bottom:0,left:0,right:0}))})),jest.mock("firebase/auth",()=>({getAuth:jest.fn(()=>({})),initializeAuth:jest.fn(()=>({})),getReactNativePersistence:jest.fn(()=>({}))})),jest.mock("firebase/app",()=>({getApp:jest.fn(()=>({}))})),jest.mock("@tanstack/react-query",()=>({QueryClient:jest.fn(()=>({})),QueryClientProvider:({children:t})=>t})),beforeEach(()=>{delete globalThis._DNDEV_CONFIG_,delete globalThis._DNDEV_STORES_});
@@ -1,22 +0,0 @@
1
- /**
2
- * @fileoverview Test utilities for Expo package
3
- * @description Shared utilities for testing Expo components and utilities
4
- *
5
- * @version 0.0.2
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- import AsyncStorage from '@react-native-async-storage/async-storage';
10
- /**
11
- * Create a mock AsyncStorage with in-memory storage
12
- */
13
- export declare function createMockAsyncStorage(): typeof AsyncStorage;
14
- /**
15
- * Clear all mocks and reset state
16
- */
17
- export declare function resetMocks(): void;
18
- /**
19
- * Wait for async operations
20
- */
21
- export declare function waitFor(ms: number): Promise<unknown>;
22
- //# sourceMappingURL=test-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/__tests__/test-utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,YAAY,MAAM,2CAA2C,CAAC;AAErE;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,YAAY,CAyB5D;AAED;;GAEG;AACH,wBAAgB,UAAU,SAIzB;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,oBAEjC"}
@@ -1 +0,0 @@
1
- import"@react-native-async-storage/async-storage";function c(){const t=new Map;return{getItem:async e=>t.get(e)||null,setItem:async(e,s)=>{t.set(e,s)},removeItem:async e=>{t.delete(e)},getAllKeys:async()=>Array.from(t.keys()),multiRemove:async e=>{e.forEach(s=>t.delete(s))},clear:async()=>{t.clear()},multiGet:async e=>e.map(s=>[s,t.get(s)||null]),multiSet:async e=>{e.forEach(([s,a])=>t.set(s,a))}}}function l(){jest.clearAllMocks(),delete globalThis._DNDEV_CONFIG_,delete globalThis._DNDEV_STORES_}function n(t){return new Promise(e=>setTimeout(e,t))}export{c as createMockAsyncStorage,l as resetMocks,n as waitFor};