@react-xp/aeiou 0.1.0-rc.1 → 1.0.0-beta.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 (280) hide show
  1. package/dist/cjs/components/a/a.native.js +8 -7
  2. package/dist/cjs/components/a/a.web.js +7 -7
  3. package/dist/cjs/components/d/d.native.js +8 -8
  4. package/dist/cjs/components/d/d.web.js +11 -6
  5. package/dist/cjs/components/e/e.native.js +8 -12
  6. package/dist/cjs/components/e/e.web.js +7 -8
  7. package/dist/cjs/components/i/i.native.js +9 -11
  8. package/dist/cjs/components/i/i.web.js +9 -5
  9. package/dist/cjs/components/l/l.web.js +7 -9
  10. package/dist/cjs/components/o/o.native.js +4 -4
  11. package/dist/cjs/components/o/o.web.js +7 -4
  12. package/dist/cjs/components/p/p.native.js +4 -4
  13. package/dist/cjs/components/p/p.web.js +7 -4
  14. package/dist/cjs/components/s/s.native.js +4 -4
  15. package/dist/cjs/components/t/t.native.js +7 -8
  16. package/dist/cjs/components/t/t.web.js +7 -8
  17. package/dist/cjs/components/u/errorBoundary.js +27 -0
  18. package/dist/cjs/components/u/provider.native.js +3 -2
  19. package/dist/cjs/components/u/provider.web.js +3 -2
  20. package/dist/cjs/hooks/index.js +0 -2
  21. package/dist/cjs/hooks/index.native.js +2 -1
  22. package/dist/cjs/hooks/index.web.js +2 -1
  23. package/dist/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +43 -0
  24. package/dist/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +45 -0
  25. package/dist/cjs/hooks/useInteractiveState/useInteractiveState.native.js +52 -54
  26. package/dist/cjs/hooks/useInteractiveState/useInteractiveState.web.js +56 -53
  27. package/dist/cjs/hooks/useOnChange.js +1 -1
  28. package/dist/cjs/hooks/useStyles/useStyles.helpers.js +35 -0
  29. package/dist/cjs/hooks/useStyles/useStyles.native.js +42 -0
  30. package/dist/cjs/hooks/useStyles/useStyles.web.js +71 -0
  31. package/dist/esm/components/a/a.native.js +9 -8
  32. package/dist/esm/components/a/a.web.js +7 -7
  33. package/dist/esm/components/d/d.native.js +6 -6
  34. package/dist/esm/components/d/d.web.js +9 -4
  35. package/dist/esm/components/e/e.native.js +7 -11
  36. package/dist/esm/components/e/e.web.js +6 -7
  37. package/dist/esm/components/i/i.native.js +7 -9
  38. package/dist/esm/components/i/i.web.js +7 -3
  39. package/dist/esm/components/l/l.web.js +6 -8
  40. package/dist/esm/components/o/o.native.js +3 -3
  41. package/dist/esm/components/o/o.web.js +6 -3
  42. package/dist/esm/components/p/p.native.js +3 -3
  43. package/dist/esm/components/p/p.web.js +6 -3
  44. package/dist/esm/components/s/s.native.js +3 -3
  45. package/dist/esm/components/t/t.native.js +6 -7
  46. package/dist/esm/components/t/t.web.js +6 -7
  47. package/dist/esm/components/u/errorBoundary.js +23 -0
  48. package/dist/esm/components/u/provider.native.js +3 -2
  49. package/dist/esm/components/u/provider.web.js +3 -2
  50. package/dist/esm/hooks/index.js +0 -2
  51. package/dist/esm/hooks/index.native.js +2 -1
  52. package/dist/esm/hooks/index.web.js +2 -1
  53. package/dist/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +40 -0
  54. package/dist/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +42 -0
  55. package/dist/esm/hooks/useInteractiveState/useInteractiveState.native.js +53 -55
  56. package/dist/esm/hooks/useInteractiveState/useInteractiveState.web.js +57 -54
  57. package/dist/esm/hooks/useOnChange.js +1 -1
  58. package/dist/esm/hooks/useStyles/useStyles.helpers.js +29 -0
  59. package/dist/esm/hooks/useStyles/useStyles.native.js +38 -0
  60. package/dist/esm/hooks/useStyles/useStyles.web.js +66 -0
  61. package/dist/native/cjs/components/a/a.native.js +17 -0
  62. package/dist/native/cjs/components/a/a.web.js +15 -0
  63. package/dist/native/cjs/components/a/index.native.js +17 -0
  64. package/dist/native/cjs/components/a/index.web.js +17 -0
  65. package/dist/native/cjs/components/d/d.native.js +28 -0
  66. package/dist/native/cjs/components/d/d.web.js +38 -0
  67. package/dist/native/cjs/components/d/index.native.js +17 -0
  68. package/dist/native/cjs/components/d/index.web.js +17 -0
  69. package/dist/native/cjs/components/e/e.native.js +16 -0
  70. package/dist/native/cjs/components/e/e.web.js +14 -0
  71. package/dist/native/cjs/components/e/index.native.js +17 -0
  72. package/dist/native/cjs/components/e/index.web.js +17 -0
  73. package/dist/native/cjs/components/i/i.native.js +28 -0
  74. package/dist/native/cjs/components/i/i.web.js +27 -0
  75. package/dist/native/cjs/components/i/index.native.js +17 -0
  76. package/dist/native/cjs/components/i/index.web.js +17 -0
  77. package/dist/native/cjs/components/i/useIUtils.js +71 -0
  78. package/dist/native/cjs/components/index.js +26 -0
  79. package/dist/native/cjs/components/index.native.js +26 -0
  80. package/dist/native/cjs/components/index.web.js +26 -0
  81. package/dist/native/cjs/components/l/index.native.js +17 -0
  82. package/dist/native/cjs/components/l/index.web.js +17 -0
  83. package/dist/native/cjs/components/l/l.native.js +10 -0
  84. package/dist/native/cjs/components/l/l.web.js +15 -0
  85. package/dist/native/cjs/components/o/index.native.js +17 -0
  86. package/dist/native/cjs/components/o/index.web.js +17 -0
  87. package/dist/native/cjs/components/o/o.native.js +12 -0
  88. package/dist/native/cjs/components/o/o.web.js +15 -0
  89. package/dist/native/cjs/components/p/index.native.js +17 -0
  90. package/dist/native/cjs/components/p/index.web.js +17 -0
  91. package/dist/native/cjs/components/p/p.native.js +13 -0
  92. package/dist/native/cjs/components/p/p.web.js +16 -0
  93. package/dist/native/cjs/components/s/index.native.js +17 -0
  94. package/dist/native/cjs/components/s/index.web.js +17 -0
  95. package/dist/native/cjs/components/s/s.native.js +10 -0
  96. package/dist/native/cjs/components/s/s.web.js +10 -0
  97. package/dist/native/cjs/components/t/index.native.js +17 -0
  98. package/dist/native/cjs/components/t/index.web.js +17 -0
  99. package/dist/native/cjs/components/t/t.native.js +15 -0
  100. package/dist/native/cjs/components/t/t.web.js +15 -0
  101. package/dist/native/cjs/components/u/context.js +14 -0
  102. package/dist/native/cjs/components/u/errorBoundary.js +27 -0
  103. package/dist/native/cjs/components/u/index.native.js +19 -0
  104. package/dist/native/cjs/components/u/index.web.js +19 -0
  105. package/dist/native/cjs/components/u/provider.native.js +24 -0
  106. package/dist/native/cjs/components/u/provider.web.js +21 -0
  107. package/dist/native/cjs/components/u/useUniverse.js +8 -0
  108. package/dist/native/cjs/hooks/index.js +19 -0
  109. package/dist/native/cjs/hooks/index.native.js +22 -0
  110. package/dist/native/cjs/hooks/index.web.js +22 -0
  111. package/dist/native/cjs/hooks/useCn.js +15 -0
  112. package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +43 -0
  113. package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +45 -0
  114. package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.native.js +69 -0
  115. package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.web.js +74 -0
  116. package/dist/native/cjs/hooks/useOnChange.js +18 -0
  117. package/dist/native/cjs/hooks/useProps.js +66 -0
  118. package/dist/native/cjs/hooks/useStyles/useStyles.helpers.js +35 -0
  119. package/dist/native/cjs/hooks/useStyles/useStyles.native.js +42 -0
  120. package/dist/native/cjs/hooks/useStyles/useStyles.types.js +2 -0
  121. package/dist/native/cjs/hooks/useStyles/useStyles.web.js +71 -0
  122. package/dist/native/cjs/index.js +19 -0
  123. package/dist/native/cjs/index.native.js +19 -0
  124. package/dist/native/cjs/index.web.js +19 -0
  125. package/dist/native/cjs/types/base.js +2 -0
  126. package/dist/native/cjs/types/index.js +17 -0
  127. package/dist/native/esm/components/a/a.native.js +13 -0
  128. package/dist/native/esm/components/a/a.web.js +11 -0
  129. package/dist/native/esm/components/a/index.native.js +1 -0
  130. package/dist/native/esm/components/a/index.web.js +1 -0
  131. package/dist/native/esm/components/d/d.native.js +24 -0
  132. package/dist/native/esm/components/d/d.web.js +34 -0
  133. package/dist/native/esm/components/d/index.native.js +1 -0
  134. package/dist/native/esm/components/d/index.web.js +1 -0
  135. package/dist/native/esm/components/e/e.native.js +12 -0
  136. package/dist/native/esm/components/e/e.web.js +10 -0
  137. package/dist/native/esm/components/e/index.native.js +1 -0
  138. package/dist/native/esm/components/e/index.web.js +1 -0
  139. package/dist/native/esm/components/i/i.native.js +24 -0
  140. package/dist/native/esm/components/i/i.web.js +23 -0
  141. package/dist/native/esm/components/i/index.native.js +1 -0
  142. package/dist/native/esm/components/i/index.web.js +1 -0
  143. package/dist/native/esm/components/i/useIUtils.js +67 -0
  144. package/dist/native/esm/components/index.js +10 -0
  145. package/dist/native/esm/components/index.native.js +10 -0
  146. package/dist/native/esm/components/index.web.js +10 -0
  147. package/dist/native/esm/components/l/index.native.js +1 -0
  148. package/dist/native/esm/components/l/index.web.js +1 -0
  149. package/dist/native/esm/components/l/l.native.js +6 -0
  150. package/dist/native/esm/components/l/l.web.js +11 -0
  151. package/dist/native/esm/components/o/index.native.js +1 -0
  152. package/dist/native/esm/components/o/index.web.js +1 -0
  153. package/dist/native/esm/components/o/o.native.js +8 -0
  154. package/dist/native/esm/components/o/o.web.js +11 -0
  155. package/dist/native/esm/components/p/index.native.js +1 -0
  156. package/dist/native/esm/components/p/index.web.js +1 -0
  157. package/dist/native/esm/components/p/p.native.js +9 -0
  158. package/dist/native/esm/components/p/p.web.js +12 -0
  159. package/dist/native/esm/components/s/index.native.js +1 -0
  160. package/dist/native/esm/components/s/index.web.js +1 -0
  161. package/dist/native/esm/components/s/s.native.js +7 -0
  162. package/dist/native/esm/components/s/s.web.js +6 -0
  163. package/dist/native/esm/components/t/index.native.js +1 -0
  164. package/dist/native/esm/components/t/index.web.js +1 -0
  165. package/dist/native/esm/components/t/t.native.js +11 -0
  166. package/dist/native/esm/components/t/t.web.js +11 -0
  167. package/dist/native/esm/components/u/context.js +11 -0
  168. package/dist/native/esm/components/u/errorBoundary.js +23 -0
  169. package/dist/native/esm/components/u/index.native.js +3 -0
  170. package/dist/native/esm/components/u/index.web.js +3 -0
  171. package/dist/native/esm/components/u/provider.native.js +20 -0
  172. package/dist/native/esm/components/u/provider.web.js +17 -0
  173. package/dist/native/esm/components/u/useUniverse.js +5 -0
  174. package/dist/native/esm/hooks/index.js +3 -0
  175. package/dist/native/esm/hooks/index.native.js +6 -0
  176. package/dist/native/esm/hooks/index.web.js +6 -0
  177. package/dist/native/esm/hooks/useCn.js +8 -0
  178. package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +40 -0
  179. package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +42 -0
  180. package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.native.js +66 -0
  181. package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.web.js +71 -0
  182. package/dist/native/esm/hooks/useOnChange.js +14 -0
  183. package/dist/native/esm/hooks/useProps.js +59 -0
  184. package/dist/native/esm/hooks/useStyles/useStyles.helpers.js +29 -0
  185. package/dist/native/esm/hooks/useStyles/useStyles.native.js +38 -0
  186. package/dist/native/esm/hooks/useStyles/useStyles.types.js +1 -0
  187. package/dist/native/esm/hooks/useStyles/useStyles.web.js +66 -0
  188. package/dist/native/esm/index.js +3 -0
  189. package/dist/native/esm/index.native.js +3 -0
  190. package/dist/native/esm/index.web.js +3 -0
  191. package/dist/native/esm/types/base.js +1 -0
  192. package/dist/native/esm/types/index.js +1 -0
  193. package/dist/native/tsconfig.native.cjs.tsbuildinfo +1 -0
  194. package/dist/native/tsconfig.native.esm.tsbuildinfo +1 -0
  195. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  196. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  197. package/dist/types/components/a/a.native.d.ts +1 -1
  198. package/dist/types/components/a/a.native.d.ts.map +1 -1
  199. package/dist/types/components/a/a.web.d.ts +1 -1
  200. package/dist/types/components/a/a.web.d.ts.map +1 -1
  201. package/dist/types/components/d/d.native.d.ts +1 -1
  202. package/dist/types/components/d/d.native.d.ts.map +1 -1
  203. package/dist/types/components/d/d.web.d.ts +1 -1
  204. package/dist/types/components/d/d.web.d.ts.map +1 -1
  205. package/dist/types/components/e/e.native.d.ts +1 -1
  206. package/dist/types/components/e/e.native.d.ts.map +1 -1
  207. package/dist/types/components/e/e.web.d.ts +1 -1
  208. package/dist/types/components/e/e.web.d.ts.map +1 -1
  209. package/dist/types/components/i/i.native.d.ts +1 -1
  210. package/dist/types/components/i/i.native.d.ts.map +1 -1
  211. package/dist/types/components/i/i.web.d.ts +1 -1
  212. package/dist/types/components/i/i.web.d.ts.map +1 -1
  213. package/dist/types/components/i/useIUtils.d.ts +2 -2
  214. package/dist/types/components/l/l.web.d.ts +1 -1
  215. package/dist/types/components/l/l.web.d.ts.map +1 -1
  216. package/dist/types/components/o/o.native.d.ts +1 -1
  217. package/dist/types/components/o/o.native.d.ts.map +1 -1
  218. package/dist/types/components/o/o.web.d.ts +1 -1
  219. package/dist/types/components/o/o.web.d.ts.map +1 -1
  220. package/dist/types/components/p/p.native.d.ts +1 -1
  221. package/dist/types/components/p/p.native.d.ts.map +1 -1
  222. package/dist/types/components/p/p.web.d.ts +1 -1
  223. package/dist/types/components/p/p.web.d.ts.map +1 -1
  224. package/dist/types/components/s/s.native.d.ts +1 -1
  225. package/dist/types/components/s/s.native.d.ts.map +1 -1
  226. package/dist/types/components/t/t.native.d.ts +1 -1
  227. package/dist/types/components/t/t.native.d.ts.map +1 -1
  228. package/dist/types/components/t/t.web.d.ts +1 -1
  229. package/dist/types/components/t/t.web.d.ts.map +1 -1
  230. package/dist/types/components/u/errorBoundary.d.ts +18 -0
  231. package/dist/types/components/u/errorBoundary.d.ts.map +1 -0
  232. package/dist/types/components/u/provider.native.d.ts +1 -1
  233. package/dist/types/components/u/provider.native.d.ts.map +1 -1
  234. package/dist/types/components/u/provider.web.d.ts +1 -1
  235. package/dist/types/components/u/provider.web.d.ts.map +1 -1
  236. package/dist/types/components/u/types.d.ts +5 -0
  237. package/dist/types/components/u/types.d.ts.map +1 -1
  238. package/dist/types/hooks/index.d.ts +0 -2
  239. package/dist/types/hooks/index.d.ts.map +1 -1
  240. package/dist/types/hooks/index.native.d.ts +2 -1
  241. package/dist/types/hooks/index.native.d.ts.map +1 -1
  242. package/dist/types/hooks/index.web.d.ts +2 -1
  243. package/dist/types/hooks/index.web.d.ts.map +1 -1
  244. package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.native.d.ts +11 -0
  245. package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.native.d.ts.map +1 -0
  246. package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.web.d.ts +12 -0
  247. package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.web.d.ts.map +1 -0
  248. package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts +20 -2
  249. package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts.map +1 -1
  250. package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts +21 -2
  251. package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts.map +1 -1
  252. package/dist/types/hooks/useOnChange.d.ts +3 -3
  253. package/dist/types/hooks/useOnChange.d.ts.map +1 -1
  254. package/dist/types/hooks/useStyles/useStyles.helpers.d.ts +171 -0
  255. package/dist/types/hooks/useStyles/useStyles.helpers.d.ts.map +1 -0
  256. package/dist/types/hooks/useStyles/useStyles.native.d.ts +15 -0
  257. package/dist/types/hooks/useStyles/useStyles.native.d.ts.map +1 -0
  258. package/dist/types/hooks/useStyles/useStyles.types.d.ts +6 -0
  259. package/dist/types/hooks/useStyles/useStyles.types.d.ts.map +1 -0
  260. package/dist/types/hooks/useStyles/useStyles.web.d.ts +11 -0
  261. package/dist/types/hooks/useStyles/useStyles.web.d.ts.map +1 -0
  262. package/dist/types/types/base.d.ts +55 -10
  263. package/dist/types/types/base.d.ts.map +1 -1
  264. package/package.json +5 -6
  265. package/dist/cjs/hooks/useAction/useAction.native.js +0 -18
  266. package/dist/cjs/hooks/useAction/useAction.web.js +0 -21
  267. package/dist/esm/hooks/useAction/useAction.native.js +0 -14
  268. package/dist/esm/hooks/useAction/useAction.web.js +0 -17
  269. package/dist/types/hooks/useAction/types.d.ts +0 -7
  270. package/dist/types/hooks/useAction/types.d.ts.map +0 -1
  271. package/dist/types/hooks/useAction/useAction.native.d.ts +0 -5
  272. package/dist/types/hooks/useAction/useAction.native.d.ts.map +0 -1
  273. package/dist/types/hooks/useAction/useAction.web.d.ts +0 -5
  274. package/dist/types/hooks/useAction/useAction.web.d.ts.map +0 -1
  275. package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts +0 -24
  276. package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts.map +0 -1
  277. /package/dist/cjs/hooks/{useAction/types.js → useStyles/useStyles.types.js} +0 -0
  278. /package/dist/esm/hooks/{useAction/types.js → useStyles/useStyles.types.js} +0 -0
  279. /package/dist/{cjs/hooks/useInteractiveState/useInteractiveState.types.js → native/cjs/components/u/types.js} +0 -0
  280. /package/dist/{esm/hooks/useInteractiveState/useInteractiveState.types.js → native/esm/components/u/types.js} +0 -0
@@ -5,12 +5,13 @@ exports.A = A;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
7
  const index_native_1 = require("../../hooks/index.native");
8
- function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
9
- const cn = (0, index_native_1.useCn)();
10
- const { onAction } = (0, index_native_1.useAction)({
11
- onClick,
12
- onPress,
13
- });
14
- return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { ref: ref, onPress: onAction, disabled: disabled, ...rest, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { className: cn(disabled && 'opacity-60', className), children: children }) }));
8
+ const useCn_1 = require("../../hooks/useCn");
9
+ const index_native_2 = require("../e/index.native");
10
+ function A({ accessibilityLabel, accessibilityRole, accessibilityState, className, children, loading, ref, style, testId, ...restProps }) {
11
+ const cn = (0, useCn_1.useCn)();
12
+ const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
13
+ const { getStylesWithInteraction } = (0, index_native_1.useStyles)();
14
+ const isDisabled = Boolean(disabled || loading);
15
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { ref: ref, disabled: isDisabled, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, testID: testId, ...eventHandlers, ...getStylesWithInteraction({ disabled, style }), children: (0, jsx_runtime_1.jsx)(index_native_2.E, { className: cn(disabled && 'opacity-60', className), style: style, ...restProps, children: children }) }));
15
16
  }
16
17
  exports.Action = A;
@@ -4,12 +4,12 @@ exports.Action = void 0;
4
4
  exports.A = A;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const index_web_1 = require("../../hooks/index.web");
7
- function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
8
- const cn = (0, index_web_1.useCn)();
9
- const { onAction } = (0, index_web_1.useAction)({
10
- onClick,
11
- onPress,
12
- });
13
- return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", disabled: disabled, className: cn('cursor-pointer', disabled && 'opacity-60', className), onClick: onAction, ...rest, children: children }));
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ function A({ className, children, loading, ref, testId, accessibilityLabel, accessibilityRole, accessibilityState, style, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { getStyles } = (0, index_web_1.useStyles)();
11
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
12
+ const isDisabled = Boolean(disabled || loading);
13
+ return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", className: cn('cursor-pointer', disabled && 'opacity-60', className), "aria-disabled": isDisabled || undefined, "aria-busy": loading || undefined, "aria-label": accessibilityLabel, "data-testid": testId, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
14
14
  }
15
15
  exports.Action = A;
@@ -4,10 +4,10 @@ exports.Dialog = void 0;
4
4
  exports.D = D;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
8
- const index_native_2 = require("../e/index.native");
9
- function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, children, ref, ...rest }) {
10
- const cn = (0, index_native_1.useCn)();
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ const index_native_1 = require("../e/index.native");
9
+ function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, children, ref, ...restProps }) {
10
+ const cn = (0, useCn_1.useCn)();
11
11
  const placementClasses = {
12
12
  center: 'items-center justify-center',
13
13
  top: 'items-start justify-center',
@@ -16,13 +16,13 @@ function D({ open, onOpenChange, placement = 'center', className, backdropClassN
16
16
  right: 'items-stretch justify-end',
17
17
  };
18
18
  const containerClasses = cn('flex-1 bg-black/40 flex', placementClasses[placement], containerClassName, backdropClassName);
19
- const contentClasses = cn('bg-background p-4 rounded-lg shadow-lg max-h-[90vh] w-full max-w-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', className, contentClassName);
19
+ const contentClasses = cn('bg-background p-4 rounded-lg shadow-lg max-h-[90vh] w-full max-w-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', contentClassName);
20
20
  const handleRequestClose = (e) => {
21
21
  onOpenChange?.(false);
22
- if (typeof rest.onRequestClose === 'function') {
23
- rest.onRequestClose?.(e);
22
+ if (typeof restProps.onRequestClose === 'function') {
23
+ restProps.onRequestClose?.(e);
24
24
  }
25
25
  };
26
- return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...rest, children: (0, jsx_runtime_1.jsx)(index_native_2.E, { className: containerClasses, children: (0, jsx_runtime_1.jsx)(index_native_2.E, { ref: ref, className: contentClasses, children: children }) }) }));
26
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...restProps, children: (0, jsx_runtime_1.jsx)(index_native_1.E, { className: containerClasses, style: { ...containerStyle, ...backdropStyle }, children: (0, jsx_runtime_1.jsx)(index_native_1.E, { ref: ref, className: contentClasses, style: contentStyle, children: children }) }) }));
27
27
  }
28
28
  exports.Dialog = D;
@@ -4,10 +4,10 @@ exports.Dialog = void 0;
4
4
  exports.D = D;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_dom_1 = require("react-dom");
7
- const index_web_1 = require("../../hooks/index.web");
8
- const index_web_2 = require("../e/index.web");
9
- function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, closeOnBackdropClick = true, children, ref, ...rest }) {
10
- const cn = (0, index_web_1.useCn)();
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ const index_web_1 = require("../e/index.web");
9
+ function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, closeOnBackdropClick = true, children, ref, ...restProps }) {
10
+ const cn = (0, useCn_1.useCn)();
11
11
  if (typeof document === 'undefined')
12
12
  return null;
13
13
  if (!open)
@@ -27,7 +27,12 @@ function D({ open, onOpenChange, placement = 'center', className, backdropClassN
27
27
  }
28
28
  };
29
29
  const backdropClasses = cn('fixed inset-0 z-50 flex bg-black/40', placementClasses[placement], containerClassName, backdropClassName);
30
- const contentClasses = cn('relative max-h-[90vh] w-full max-w-lg overflow-auto rounded-lg bg-background p-4 shadow-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', className, contentClassName);
31
- return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(index_web_2.E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, children: (0, jsx_runtime_1.jsx)("dialog", { ref: ref, "aria-modal": "true", className: contentClasses, ...rest, children: children }) }), document.body);
30
+ const contentClasses = cn('relative max-h-[90vh] w-full max-w-lg overflow-auto rounded-lg bg-background p-4 shadow-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', contentClassName);
31
+ return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(index_web_1.E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, style: {
32
+ ...(containerStyle || {}),
33
+ ...(backdropStyle || {}),
34
+ }, children: (0, jsx_runtime_1.jsx)("div", { ref: ref,
35
+ // biome-ignore lint/a11y/useSemanticElements: <explanation>
36
+ role: "dialog", "aria-modal": "true", className: contentClasses, style: contentStyle, ...restProps, children: children }) }), document.body);
32
37
  }
33
38
  exports.Dialog = D;
@@ -4,17 +4,13 @@ exports.Element = void 0;
4
4
  exports.E = E;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
8
- function E({ className, children, onPress, onClick, ref, ...rest }) {
9
- const cn = (0, index_native_1.useCn)();
10
- const { onAction } = (0, index_native_1.useAction)({
11
- onClick,
12
- onPress,
13
- });
14
- const handleOnPress = () => {
15
- onAction();
16
- return false;
17
- };
18
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, className: cn(className), onStartShouldSetResponder: handleOnPress, ...rest, children: children }));
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ const index_native_1 = require("../../index.native");
9
+ const index_native_2 = require("../t/index.native");
10
+ function E({ className, children, ref, style, ...restProps }) {
11
+ const cn = (0, useCn_1.useCn)();
12
+ const { getStyles } = (0, index_native_1.useStyles)();
13
+ const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
14
+ return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, className: cn(className), ...eventHandlers, ...getStyles({ disabled, style }), children: typeof children === 'string' ? (0, jsx_runtime_1.jsx)(index_native_2.T, { children: children }) : children }));
19
15
  }
20
16
  exports.Element = E;
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Element = void 0;
4
4
  exports.E = E;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_web_1 = require("../../hooks/index.web");
7
- function E({ className, children, onPress, onClick, ref, ...rest }) {
8
- const cn = (0, index_web_1.useCn)();
9
- const { onAction } = (0, index_web_1.useAction)({
10
- onClick,
11
- onPress,
12
- });
13
- return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(className), onClick: onAction, ...rest, children: children }));
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const index_web_1 = require("../../index.web");
8
+ function E({ className, children, ref, role, style, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
11
+ const { getStyles } = (0, index_web_1.useStyles)();
12
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(className), role: role, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
14
13
  }
15
14
  exports.Element = E;
@@ -4,27 +4,25 @@ exports.Input = void 0;
4
4
  exports.I = I;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ const useOnChange_1 = require("../../hooks/useOnChange");
9
+ const index_native_1 = require("../../index.native");
8
10
  const useIUtils_1 = require("./useIUtils");
9
- function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, ...rest }) {
11
+ function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, name, style, ...restProps }) {
10
12
  const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
11
- const cn = (0, index_native_1.useCn)();
12
- const { onChange: handleOnChange } = (0, index_native_1.useOnChange)({
13
+ const cn = (0, useCn_1.useCn)();
14
+ const { onChange: handleOnChange } = (0, useOnChange_1.useOnChange)({
13
15
  onChange,
14
16
  onChangeValue,
15
17
  });
18
+ const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
19
+ const { getStyles } = (0, index_native_1.useStyles)();
16
20
  const effectiveEditable = editable ?? !disabled;
17
21
  const { masterInputType, masterInputKeyboardType } = treatTypeModeAndKeyboardType({
18
22
  inputMode,
19
23
  keyboardType,
20
24
  type,
21
25
  });
22
- const handleChange = (event) => {
23
- if (onChange)
24
- onChange(event);
25
- if (onChangeValue)
26
- onChangeValue(event.nativeEvent.text);
27
- };
28
- return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, ...rest }));
26
+ return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
29
27
  }
30
28
  exports.Input = I;
@@ -3,21 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Input = void 0;
4
4
  exports.I = I;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_web_1 = require("../../hooks/index.web");
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const useOnChange_1 = require("../../hooks/useOnChange");
8
+ const index_web_1 = require("../../index.web");
7
9
  const useIUtils_1 = require("./useIUtils");
8
- function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, ...rest }) {
10
+ function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, style, ...restProps }) {
9
11
  const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
10
- const cn = (0, index_web_1.useCn)();
11
- const { onChange: handleOnChange } = (0, index_web_1.useOnChange)({
12
+ const cn = (0, useCn_1.useCn)();
13
+ const { onChange: handleOnChange } = (0, useOnChange_1.useOnChange)({
12
14
  onChange,
13
15
  onChangeValue,
14
16
  });
17
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
18
+ const { getStyles } = (0, index_web_1.useStyles)();
15
19
  const effectiveDisabled = disabled || editable === false;
16
20
  const { masterInputType, masterInputMode } = treatTypeModeAndKeyboardType({
17
21
  inputMode,
18
22
  keyboardType,
19
23
  type,
20
24
  });
21
- return ((0, jsx_runtime_1.jsx)("input", { ref: ref, type: masterInputType, inputMode: masterInputMode, className: cn('outline-none', effectiveDisabled && 'opacity-60 cursor-not-allowed', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled, ...rest }));
25
+ return ((0, jsx_runtime_1.jsx)("input", { ref: ref, type: masterInputType, inputMode: masterInputMode, className: cn('outline-none', effectiveDisabled && 'opacity-60 cursor-not-allowed', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
22
26
  }
23
27
  exports.Input = I;
@@ -3,15 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Link = void 0;
4
4
  exports.L = L;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_native_1 = require("../../hooks/index.native");
7
- const index_web_1 = require("../../hooks/index.web");
8
- function L({ className, children, to, href, onClick, onPress, preventDefault, ref, ...rest }) {
9
- const cn = (0, index_web_1.useCn)();
10
- const { onAction } = (0, index_native_1.useAction)({
11
- onClick,
12
- onPress,
13
- });
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const index_web_1 = require("../../index.web");
8
+ function L({ className, children, to, href, preventDefault, ref, style, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
11
+ const { getStyles } = (0, index_web_1.useStyles)();
14
12
  const resolvedHref = href ?? to ?? '#';
15
- return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, ...rest, children: children }));
13
+ return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
16
14
  }
17
15
  exports.Link = L;
@@ -4,9 +4,9 @@ exports.Overflow = void 0;
4
4
  exports.O = O;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
8
- function O({ className, children, horizontal, ref, ...rest }) {
9
- const cn = (0, index_native_1.useCn)();
10
- return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...rest, children: children }));
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ function O({ className, children, horizontal, ref, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...restProps, children: children }));
11
11
  }
12
12
  exports.Overflow = O;
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Overflow = void 0;
4
4
  exports.O = O;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_web_1 = require("../../hooks/index.web");
7
- function O({ className, children, horizontal, ref, ...rest }) {
8
- const cn = (0, index_web_1.useCn)();
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const index_web_1 = require("../../index.web");
8
+ function O({ className, children, horizontal, ref, style, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
11
+ const { getStyles } = (0, index_web_1.useStyles)();
9
12
  const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
10
- return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className), ...rest, children: children }));
13
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
11
14
  }
12
15
  exports.Overflow = O;
@@ -4,10 +4,10 @@ exports.Picture = void 0;
4
4
  exports.P = P;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
8
- function P({ className, src, source, ref, ...rest }) {
9
- const cn = (0, index_native_1.useCn)();
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ function P({ className, src, source, ref, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
10
  const finalSource = src != null ? { uri: src } : source;
11
- return ((0, jsx_runtime_1.jsx)(react_native_1.Image, { ref: ref, className: cn(className), source: finalSource, ...rest }));
11
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Image, { ref: ref, className: cn(className), source: finalSource, ...restProps }));
12
12
  }
13
13
  exports.Picture = P;
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Picture = void 0;
4
4
  exports.P = P;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_web_1 = require("../../hooks/index.web");
7
- function P({ alt, className, ref, ...rest }) {
8
- const cn = (0, index_web_1.useCn)();
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const index_web_1 = require("../../index.web");
8
+ function P({ alt, className, ref, style, source, src, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
11
+ const { getStyles } = (0, index_web_1.useStyles)();
9
12
  return (
10
13
  // biome-ignore lint/a11y/useAltText: <explanation>
11
- (0, jsx_runtime_1.jsx)("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), ...rest }));
14
+ (0, jsx_runtime_1.jsx)("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), src: src ?? source, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
12
15
  }
13
16
  exports.Picture = P;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.S = S;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
6
- const index_native_1 = require("../../hooks/index.native");
7
- function S({ className, children, ref, ...rest }) {
8
- const cn = (0, index_native_1.useCn)();
9
- return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaView, { ref: ref, className: cn(className), ...rest, children: children }));
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ function S({ className, children, ref, ...restProps }) {
8
+ const cn = (0, useCn_1.useCn)();
9
+ return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaView, { ref: ref, className: cn(className), ...restProps, children: children }));
10
10
  }
@@ -4,13 +4,12 @@ exports.Text = void 0;
4
4
  exports.T = T;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_native_1 = require("react-native");
7
- const index_native_1 = require("../../hooks/index.native");
8
- function T({ className, children, onClick, onPress, ref, ...rest }) {
9
- const cn = (0, index_native_1.useCn)();
10
- const { onAction } = (0, index_native_1.useAction)({
11
- onClick,
12
- onPress,
13
- });
14
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, className: cn('leading-relaxed', className), onPress: onAction, ...rest, children: children }));
7
+ const useCn_1 = require("../../hooks/useCn");
8
+ const index_native_1 = require("../../index.native");
9
+ function T({ className, children, ref, style, ...restProps }) {
10
+ const cn = (0, useCn_1.useCn)();
11
+ const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
12
+ const { getStyles } = (0, index_native_1.useStyles)();
13
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
15
14
  }
16
15
  exports.Text = T;
@@ -3,14 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Text = void 0;
4
4
  exports.T = T;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const index_web_1 = require("../../hooks/index.web");
7
- function T({ className, children, as = 'span', onClick, onPress, ref, ...rest }) {
8
- const cn = (0, index_web_1.useCn)();
9
- const { onAction } = (0, index_web_1.useAction)({
10
- onClick,
11
- onPress,
12
- });
6
+ const useCn_1 = require("../../hooks/useCn");
7
+ const index_web_1 = require("../../index.web");
8
+ function T({ className, children, as = 'span', ref, style, ...restProps }) {
9
+ const cn = (0, useCn_1.useCn)();
10
+ const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
11
+ const { getStyles } = (0, index_web_1.useStyles)();
13
12
  const Comp = as;
14
- return ((0, jsx_runtime_1.jsx)(Comp, { ref: ref, className: cn('leading-relaxed', className), onClick: onAction, ...rest, children: children }));
13
+ return ((0, jsx_runtime_1.jsx)(Comp, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
15
14
  }
16
15
  exports.Text = T;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorBoundary = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ class ErrorBoundary extends react_1.Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.state = { hasError: false };
10
+ }
11
+ static getDerivedStateFromError() {
12
+ return { hasError: true };
13
+ }
14
+ componentDidCatch(error, errorInfo) {
15
+ this.props.onError?.callback?.(error, errorInfo);
16
+ }
17
+ render() {
18
+ if (this.state.hasError) {
19
+ if (this.props.onError?.render) {
20
+ return this.props.onError.render;
21
+ }
22
+ return (0, jsx_runtime_1.jsx)("h1", { children: "Ocorreu um erro. Por favor, tente novamente mais tarde." });
23
+ }
24
+ return this.props.children;
25
+ }
26
+ }
27
+ exports.ErrorBoundary = ErrorBoundary;
@@ -6,7 +6,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const react_native_1 = require("react-native");
8
8
  const context_1 = require("./context");
9
- function U({ children, config }) {
9
+ const errorBoundary_1 = require("./errorBoundary");
10
+ function U({ children, config, onError }) {
10
11
  const systemColorScheme = react_native_1.Appearance.getColorScheme() ?? 'light';
11
12
  const [colorScheme, setColorScheme] = (0, react_1.useState)(config?.colorScheme ?? 'system');
12
13
  const [locale, setLocale] = (0, react_1.useState)(config?.locale ?? 'en-US');
@@ -18,6 +19,6 @@ function U({ children, config }) {
18
19
  setColorScheme,
19
20
  setLocale,
20
21
  }), [colorScheme, locale, systemColorScheme]);
21
- return ((0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }));
22
+ return ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { onError: onError, children: (0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }) }));
22
23
  }
23
24
  exports.Universe = U;
@@ -5,7 +5,8 @@ exports.U = U;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const context_1 = require("./context");
8
- function U({ children, config }) {
8
+ const errorBoundary_1 = require("./errorBoundary");
9
+ function U({ children, config, onError }) {
9
10
  const [colorScheme, setColorScheme] = (0, react_1.useState)(config?.colorScheme ?? 'system');
10
11
  const [locale, setLocale] = (0, react_1.useState)(config?.locale ?? 'en-US');
11
12
  const value = (0, react_1.useMemo)(() => ({
@@ -15,6 +16,6 @@ function U({ children, config }) {
15
16
  setColorScheme,
16
17
  setLocale,
17
18
  }), [colorScheme, locale]);
18
- return ((0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }));
19
+ return ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { onError: onError, children: (0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }) }));
19
20
  }
20
21
  exports.Universe = U;
@@ -14,8 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./useAction/useAction.web"), exports);
18
17
  __exportStar(require("./useCn"), exports);
19
- __exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
20
18
  __exportStar(require("./useOnChange"), exports);
21
19
  __exportStar(require("./useProps"), exports);
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./useAction/useAction.native"), exports);
18
17
  __exportStar(require("./useCn"), exports);
18
+ __exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.native"), exports);
19
19
  __exportStar(require("./useInteractiveState/useInteractiveState.native"), exports);
20
20
  __exportStar(require("./useOnChange"), exports);
21
21
  __exportStar(require("./useProps"), exports);
22
+ __exportStar(require("./useStyles/useStyles.native"), exports);
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./useAction/useAction.web"), exports);
18
17
  __exportStar(require("./useCn"), exports);
18
+ __exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.web"), exports);
19
19
  __exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
20
20
  __exportStar(require("./useOnChange"), exports);
21
21
  __exportStar(require("./useProps"), exports);
22
+ __exportStar(require("./useStyles/useStyles.web"), exports);
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useInteractiveHandlers = useInteractiveHandlers;
4
+ const react_1 = require("react");
5
+ function useInteractiveHandlers({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
6
+ const offOn = (0, react_1.useRef)('off');
7
+ const eventHandlers = {
8
+ onBlur: (e) => {
9
+ if (disabled) {
10
+ return;
11
+ }
12
+ onBlur?.(e);
13
+ },
14
+ onFocus: (e) => {
15
+ if (disabled) {
16
+ return;
17
+ }
18
+ onFocus?.(e);
19
+ },
20
+ onPress: (e) => {
21
+ if (disabled) {
22
+ return;
23
+ }
24
+ if ((onIn || onOut) && offOn.current === 'off') {
25
+ offOn.current = 'on';
26
+ onIn?.(e);
27
+ }
28
+ if ((onIn || onOut) && offOn.current === 'on') {
29
+ offOn.current = 'off';
30
+ onOut?.(e);
31
+ }
32
+ if (onPress) {
33
+ onPress?.(e);
34
+ return;
35
+ }
36
+ onClick?.(e);
37
+ },
38
+ };
39
+ return {
40
+ disabled,
41
+ eventHandlers,
42
+ };
43
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useInteractiveHandlers = useInteractiveHandlers;
4
+ function useInteractiveHandlers({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
5
+ const eventHandlers = {
6
+ onBlur: (e) => {
7
+ if (disabled) {
8
+ return;
9
+ }
10
+ onBlur?.(e);
11
+ },
12
+ onClick: (e) => {
13
+ if (disabled) {
14
+ return;
15
+ }
16
+ if (onClick) {
17
+ onClick?.(e);
18
+ return;
19
+ }
20
+ onPress?.(e);
21
+ },
22
+ onFocus: (e) => {
23
+ if (disabled) {
24
+ return;
25
+ }
26
+ onFocus?.(e);
27
+ },
28
+ onMouseEnter: (e) => {
29
+ if (disabled) {
30
+ return;
31
+ }
32
+ onIn?.(e);
33
+ },
34
+ onMouseLeave: (e) => {
35
+ if (disabled) {
36
+ return;
37
+ }
38
+ onOut?.(e);
39
+ },
40
+ };
41
+ return {
42
+ disabled,
43
+ eventHandlers,
44
+ };
45
+ }