@retray-dev/ui-kit 7.0.1 → 9.0.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 (234) hide show
  1. package/COMPONENTS.md +554 -11
  2. package/EXAMPLES.md +2 -2
  3. package/README.md +14 -8
  4. package/dist/Accordion.js +57 -5
  5. package/dist/Accordion.mjs +4 -3
  6. package/dist/AlertBanner.js +4 -1
  7. package/dist/AlertBanner.mjs +3 -2
  8. package/dist/AppHeader.d.mts +40 -0
  9. package/dist/AppHeader.d.ts +40 -0
  10. package/dist/AppHeader.js +515 -0
  11. package/dist/AppHeader.mjs +10 -0
  12. package/dist/Avatar.js +39 -29
  13. package/dist/Avatar.mjs +2 -1
  14. package/dist/Badge.js +11 -1
  15. package/dist/Badge.mjs +2 -1
  16. package/dist/Button.d.mts +8 -3
  17. package/dist/Button.d.ts +8 -3
  18. package/dist/Button.js +126 -108
  19. package/dist/Button.mjs +6 -5
  20. package/dist/ButtonGroup.mjs +1 -0
  21. package/dist/Card.js +90 -70
  22. package/dist/Card.mjs +5 -4
  23. package/dist/CategoryStrip.js +79 -22
  24. package/dist/CategoryStrip.mjs +6 -6
  25. package/dist/Checkbox.js +118 -86
  26. package/dist/Checkbox.mjs +5 -5
  27. package/dist/Chip.js +113 -80
  28. package/dist/Chip.mjs +5 -5
  29. package/dist/ConfirmDialog.js +140 -110
  30. package/dist/ConfirmDialog.mjs +7 -6
  31. package/dist/CurrencyDisplay.mjs +1 -0
  32. package/dist/CurrencyInput.d.mts +1 -1
  33. package/dist/CurrencyInput.d.ts +1 -1
  34. package/dist/CurrencyInput.js +9 -5
  35. package/dist/CurrencyInput.mjs +5 -4
  36. package/dist/DetailRow.mjs +1 -0
  37. package/dist/EmptyState.js +131 -111
  38. package/dist/EmptyState.mjs +7 -6
  39. package/dist/ErrorBoundary.d.mts +42 -0
  40. package/dist/ErrorBoundary.d.ts +42 -0
  41. package/dist/ErrorBoundary.js +351 -0
  42. package/dist/ErrorBoundary.mjs +7 -0
  43. package/dist/Form.mjs +1 -0
  44. package/dist/HolographicCard.d.mts +55 -0
  45. package/dist/HolographicCard.d.ts +55 -0
  46. package/dist/HolographicCard.js +316 -0
  47. package/dist/HolographicCard.mjs +191 -0
  48. package/dist/IconButton.d.mts +8 -3
  49. package/dist/IconButton.d.ts +8 -3
  50. package/dist/IconButton.js +115 -98
  51. package/dist/IconButton.mjs +5 -4
  52. package/dist/ImageViewer.d.mts +23 -0
  53. package/dist/ImageViewer.d.ts +23 -0
  54. package/dist/ImageViewer.js +582 -0
  55. package/dist/ImageViewer.mjs +8 -0
  56. package/dist/Input.mjs +4 -3
  57. package/dist/LabelValue.mjs +1 -0
  58. package/dist/ListGroup.mjs +1 -0
  59. package/dist/ListItem.js +131 -117
  60. package/dist/ListItem.mjs +6 -5
  61. package/dist/MediaCard.js +54 -6
  62. package/dist/MediaCard.mjs +6 -5
  63. package/dist/MenuGroup.mjs +1 -0
  64. package/dist/MenuItem.js +91 -79
  65. package/dist/MenuItem.mjs +6 -5
  66. package/dist/MonthPicker.d.mts +10 -2
  67. package/dist/MonthPicker.d.ts +10 -2
  68. package/dist/MonthPicker.js +80 -17
  69. package/dist/MonthPicker.mjs +3 -2
  70. package/dist/PagerDots.d.mts +35 -0
  71. package/dist/PagerDots.d.ts +35 -0
  72. package/dist/PagerDots.js +392 -0
  73. package/dist/PagerDots.mjs +7 -0
  74. package/dist/Pressable.d.mts +5 -5
  75. package/dist/Pressable.d.ts +5 -5
  76. package/dist/Pressable.js +97 -86
  77. package/dist/Pressable.mjs +5 -4
  78. package/dist/PricingCard.d.mts +50 -0
  79. package/dist/PricingCard.d.ts +50 -0
  80. package/dist/PricingCard.js +636 -0
  81. package/dist/PricingCard.mjs +11 -0
  82. package/dist/Progress.mjs +3 -2
  83. package/dist/RadioGroup.js +81 -30
  84. package/dist/RadioGroup.mjs +5 -5
  85. package/dist/RetrayProvider.d.mts +2 -0
  86. package/dist/RetrayProvider.d.ts +2 -0
  87. package/dist/RetrayProvider.js +214 -0
  88. package/dist/RetrayProvider.mjs +5 -0
  89. package/dist/Select.js +51 -4
  90. package/dist/Select.mjs +5 -4
  91. package/dist/SelectableGrid.d.mts +44 -0
  92. package/dist/SelectableGrid.d.ts +44 -0
  93. package/dist/SelectableGrid.js +448 -0
  94. package/dist/SelectableGrid.mjs +9 -0
  95. package/dist/Separator.mjs +1 -0
  96. package/dist/Sheet.d.mts +13 -1
  97. package/dist/Sheet.d.ts +13 -1
  98. package/dist/Sheet.js +115 -5
  99. package/dist/Sheet.mjs +4 -2
  100. package/dist/Skeleton.d.mts +50 -0
  101. package/dist/Skeleton.d.ts +50 -0
  102. package/dist/Skeleton.js +61 -0
  103. package/dist/Skeleton.mjs +4 -2
  104. package/dist/Slider.js +51 -4
  105. package/dist/Slider.mjs +3 -2
  106. package/dist/Spinner.js +28 -7
  107. package/dist/Spinner.mjs +2 -1
  108. package/dist/Switch.js +98 -48
  109. package/dist/Switch.mjs +4 -3
  110. package/dist/TabBar.d.mts +42 -0
  111. package/dist/TabBar.d.ts +42 -0
  112. package/dist/TabBar.js +361 -0
  113. package/dist/TabBar.mjs +6 -0
  114. package/dist/Tabs.js +92 -62
  115. package/dist/Tabs.mjs +5 -4
  116. package/dist/Text.js +16 -0
  117. package/dist/Text.mjs +2 -1
  118. package/dist/Textarea.mjs +4 -3
  119. package/dist/Toast.d.mts +7 -7
  120. package/dist/Toast.d.ts +7 -7
  121. package/dist/Toast.mjs +1 -0
  122. package/dist/Toggle.d.mts +6 -3
  123. package/dist/Toggle.d.ts +6 -3
  124. package/dist/Toggle.js +135 -120
  125. package/dist/Toggle.mjs +5 -5
  126. package/dist/VirtualList.mjs +1 -0
  127. package/dist/{chunk-7H2OR44A.mjs → chunk-26BCI223.mjs} +1 -1
  128. package/dist/{chunk-CRYBX2CM.mjs → chunk-2TFTAWVJ.mjs} +44 -59
  129. package/dist/chunk-3DKJ2GIC.mjs +30 -0
  130. package/dist/{chunk-KWCPOM6W.mjs → chunk-3U4SSNWP.mjs} +32 -48
  131. package/dist/chunk-4I7D47FH.mjs +139 -0
  132. package/dist/chunk-4K625MVM.mjs +142 -0
  133. package/dist/{chunk-MN7OG7IY.mjs → chunk-6OAZJ577.mjs} +6 -4
  134. package/dist/{chunk-L7E7TVEZ.mjs → chunk-756RAKE4.mjs} +2 -2
  135. package/dist/{chunk-HSPSMN6U.mjs → chunk-7QHVVCB3.mjs} +2 -2
  136. package/dist/{chunk-URLL5JBR.mjs → chunk-A3A6KNQN.mjs} +3 -3
  137. package/dist/chunk-AJ7ZDNBT.mjs +120 -0
  138. package/dist/{chunk-FTLJOUOQ.mjs → chunk-AV4EMIRH.mjs} +25 -28
  139. package/dist/chunk-AZJF2BLK.mjs +115 -0
  140. package/dist/chunk-BNP626TY.mjs +159 -0
  141. package/dist/{chunk-5IKW3VNC.mjs → chunk-DVK4G2GT.mjs} +17 -1
  142. package/dist/{chunk-6LQYY7HC.mjs → chunk-EH745HE5.mjs} +2 -2
  143. package/dist/chunk-EJ7ZPXOH.mjs +163 -0
  144. package/dist/{chunk-RKLHUDZS.mjs → chunk-GD6KXMG5.mjs} +29 -15
  145. package/dist/{chunk-RR2VQLKE.mjs → chunk-GQYFLP3D.mjs} +14 -17
  146. package/dist/{chunk-Y6MXOREN.mjs → chunk-ID72TK46.mjs} +8 -17
  147. package/dist/{chunk-NQGVLMWG.mjs → chunk-JMOZEC77.mjs} +1 -1
  148. package/dist/{chunk-GCWOGZYL.mjs → chunk-JT7HKXRB.mjs} +39 -29
  149. package/dist/{chunk-LWG526VX.mjs → chunk-KIHCWCWL.mjs} +47 -62
  150. package/dist/chunk-LXJIIOYQ.mjs +104 -0
  151. package/dist/{chunk-SBZYEV4S.mjs → chunk-M6ZXVBTK.mjs} +5 -2
  152. package/dist/{chunk-XDMN67KV.mjs → chunk-MAC465BB.mjs} +10 -8
  153. package/dist/chunk-MBMXYJJV.mjs +36 -0
  154. package/dist/chunk-MLF3EZFW.mjs +119 -0
  155. package/dist/chunk-NA7PARID.mjs +147 -0
  156. package/dist/{chunk-QXGYKWI7.mjs → chunk-O3HA6TYM.mjs} +9 -4
  157. package/dist/{chunk-63357L2X.mjs → chunk-OB4JUQ3O.mjs} +1 -1
  158. package/dist/{chunk-AU2VDY4P.mjs → chunk-PFZTM6D5.mjs} +52 -4
  159. package/dist/chunk-QKH5ZOD5.mjs +97 -0
  160. package/dist/{chunk-KZJRQOIU.mjs → chunk-TERDKCLE.mjs} +11 -1
  161. package/dist/{chunk-U4N7WF4Z.mjs → chunk-UREA2GYY.mjs} +28 -23
  162. package/dist/{chunk-TAJ2PQ2O.mjs → chunk-VGTDN7SW.mjs} +7 -6
  163. package/dist/{chunk-URDE3EUU.mjs → chunk-VQ57HWPL.mjs} +27 -15
  164. package/dist/chunk-WBOOUHSS.mjs +62 -0
  165. package/dist/{chunk-GNGLDL6Z.mjs → chunk-WJLKJMKR.mjs} +18 -0
  166. package/dist/{chunk-YZJAFS4P.mjs → chunk-X4G6APW6.mjs} +22 -19
  167. package/dist/chunk-Y6FXYEAI.mjs +8 -0
  168. package/dist/chunk-YFZ3ELX5.mjs +16 -0
  169. package/dist/{chunk-QCNARS3X.mjs → chunk-YNROWHQJ.mjs} +1 -1
  170. package/dist/chunk-Z4BVUWW6.mjs +196 -0
  171. package/dist/{chunk-GPOUINK5.mjs → chunk-ZJKGQMYH.mjs} +10 -27
  172. package/dist/index-wt-orHUi.d.mts +85 -0
  173. package/dist/index-wt-orHUi.d.ts +85 -0
  174. package/dist/index.d.mts +59 -51
  175. package/dist/index.d.ts +59 -51
  176. package/dist/index.js +1940 -744
  177. package/dist/index.mjs +49 -39
  178. package/package.json +35 -5
  179. package/src/components/Accordion/Accordion.tsx +12 -1
  180. package/src/components/AlertBanner/AlertBanner.tsx +5 -0
  181. package/src/components/AppHeader/AppHeader.tsx +172 -0
  182. package/src/components/AppHeader/index.ts +1 -0
  183. package/src/components/Avatar/Avatar.tsx +10 -2
  184. package/src/components/Badge/Badge.tsx +8 -1
  185. package/src/components/Button/Button.tsx +20 -27
  186. package/src/components/Card/Card.tsx +12 -23
  187. package/src/components/CategoryStrip/CategoryStrip.tsx +17 -21
  188. package/src/components/Checkbox/Checkbox.tsx +26 -40
  189. package/src/components/Chip/Chip.tsx +24 -33
  190. package/src/components/CurrencyInput/CurrencyInput.tsx +10 -8
  191. package/src/components/EmptyState/EmptyState.tsx +2 -1
  192. package/src/components/ErrorBoundary/ErrorBoundary.tsx +153 -0
  193. package/src/components/ErrorBoundary/index.ts +1 -0
  194. package/src/components/HolographicCard/HolographicCard.tsx +315 -0
  195. package/src/components/HolographicCard/index.ts +1 -0
  196. package/src/components/IconButton/IconButton.tsx +19 -27
  197. package/src/components/ImageViewer/ImageViewer.tsx +290 -0
  198. package/src/components/ImageViewer/index.ts +1 -0
  199. package/src/components/ListItem/ListItem.tsx +70 -67
  200. package/src/components/MediaCard/MediaCard.tsx +8 -2
  201. package/src/components/MenuItem/MenuItem.tsx +10 -25
  202. package/src/components/MonthPicker/MonthPicker.tsx +39 -13
  203. package/src/components/MonthPicker/index.ts +1 -1
  204. package/src/components/PagerDots/PagerDots.tsx +200 -0
  205. package/src/components/PagerDots/index.ts +1 -0
  206. package/src/components/Pressable/Pressable.tsx +19 -35
  207. package/src/components/PricingCard/PricingCard.tsx +220 -0
  208. package/src/components/PricingCard/index.ts +1 -0
  209. package/src/components/RadioGroup/RadioGroup.tsx +14 -27
  210. package/src/components/RetrayProvider/RetrayProvider.tsx +59 -0
  211. package/src/components/RetrayProvider/index.ts +1 -0
  212. package/src/components/SelectableGrid/SelectableGrid.tsx +205 -0
  213. package/src/components/SelectableGrid/index.ts +1 -0
  214. package/src/components/Sheet/Sheet.tsx +65 -1
  215. package/src/components/Skeleton/Skeleton.tsx +142 -1
  216. package/src/components/Spinner/Spinner.tsx +17 -2
  217. package/src/components/Switch/Switch.tsx +30 -58
  218. package/src/components/TabBar/TabBar.tsx +169 -0
  219. package/src/components/TabBar/index.ts +1 -0
  220. package/src/components/Tabs/Tabs.tsx +23 -26
  221. package/src/components/Text/Text.tsx +2 -0
  222. package/src/components/Toggle/Toggle.tsx +35 -51
  223. package/src/fonts.ts +4 -1
  224. package/src/index.ts +23 -2
  225. package/src/utils/animations.ts +29 -1
  226. package/src/utils/fontGuard.ts +34 -0
  227. package/src/utils/haptics.ts +211 -9
  228. package/src/utils/pressable.ts +66 -0
  229. package/dist/chunk-76PFOSM2.mjs +0 -41
  230. package/dist/chunk-DITNP6PL.mjs +0 -106
  231. package/dist/chunk-JBLL7U3U.mjs +0 -64
  232. package/dist/chunk-LG4DO3DK.mjs +0 -174
  233. package/dist/chunk-RMMK64W5.mjs +0 -54
  234. package/dist/chunk-RTC3CFXF.mjs +0 -29
@@ -3,6 +3,7 @@
3
3
  var React2 = require('react');
4
4
  var reactNative = require('react-native');
5
5
  var Animated = require('react-native-reanimated');
6
+ var reactNativeEase = require('react-native-ease');
6
7
  var reactNativeSizeMatters = require('react-native-size-matters');
7
8
 
8
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -10,18 +11,65 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
11
  var React2__default = /*#__PURE__*/_interopDefault(React2);
11
12
  var Animated__default = /*#__PURE__*/_interopDefault(Animated);
12
13
 
13
- // src/components/RadioGroup/RadioGroup.tsx
14
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
15
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
16
+ }) : x)(function(x) {
17
+ if (typeof require !== "undefined") return require.apply(this, arguments);
18
+ throw Error('Dynamic require of "' + x + '" is not supported');
19
+ });
14
20
  var _haptics = null;
21
+ var _hapticsLoaded = false;
15
22
  async function getHaptics() {
16
23
  if (reactNative.Platform.OS === "web") return null;
17
- if (!_haptics) {
18
- _haptics = await import('expo-haptics');
24
+ if (!_hapticsLoaded) {
25
+ _hapticsLoaded = true;
26
+ try {
27
+ _haptics = await import('expo-haptics');
28
+ } catch {
29
+ _haptics = null;
30
+ }
19
31
  }
20
32
  return _haptics;
21
33
  }
34
+ var _pulsar = null;
35
+ var _pulsarChecked = false;
36
+ var _pulsarAvailable = false;
37
+ function isPulsarNativeRegistered() {
38
+ try {
39
+ const g = globalThis;
40
+ if (typeof g.__turboModuleProxy === "function") {
41
+ return g.__turboModuleProxy("RNPulsar") != null;
42
+ }
43
+ return reactNative.NativeModules?.RNPulsar != null;
44
+ } catch {
45
+ return false;
46
+ }
47
+ }
48
+ function getPulsar() {
49
+ if (reactNative.Platform.OS === "web") return null;
50
+ if (!_pulsarChecked) {
51
+ _pulsarChecked = true;
52
+ try {
53
+ if (isPulsarNativeRegistered()) {
54
+ _pulsar = __require("react-native-pulsar");
55
+ _pulsarAvailable = true;
56
+ }
57
+ } catch {
58
+ _pulsar = null;
59
+ _pulsarAvailable = false;
60
+ }
61
+ }
62
+ return _pulsarAvailable ? _pulsar : null;
63
+ }
22
64
  function selectionAsync() {
23
65
  if (reactNative.Platform.OS === "web") return;
24
- getHaptics().then((h) => h?.selectionAsync());
66
+ getHaptics().then((h) => {
67
+ if (h) {
68
+ h.selectionAsync();
69
+ } else {
70
+ getPulsar()?.Presets.System.selection();
71
+ }
72
+ });
25
73
  }
26
74
 
27
75
  // src/theme/colorUtils.ts
@@ -150,20 +198,28 @@ var mvs = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateVerticalSca
150
198
  var SPRINGS = {
151
199
  /** Tight, premium press feel — Buttons, Toggle, Tabs triggers. */
152
200
  pressIn: { stiffness: 600, damping: 35, mass: 0.8 },
153
- pressOut: { stiffness: 280, damping: 22, mass: 0.8 },
154
- /** Elastic indicator — Switch thumb, RadioGroup dot. */
155
- elastic: { stiffness: 320, damping: 22, mass: 0.7 }
156
- };
201
+ pressOut: { stiffness: 280, damping: 22, mass: 0.8 }};
157
202
  var TIMINGS = {
158
203
  /** Color/opacity transitions on toggles, checkboxes, switches. */
159
204
  state: { duration: 160 }};
160
- var EASINGS = {
205
+ ({
161
206
  /** Material-style ease-out — natural deceleration for state changes. */
162
207
  standard: Animated.Easing.bezier(0.2, 0, 0, 1),
163
208
  /** Strong ease-out for expanding surfaces (Accordion open). */
164
209
  expand: Animated.Easing.bezier(0.23, 1, 0.32, 1),
165
210
  /** Quick ease-in for collapsing. */
166
211
  collapse: Animated.Easing.in(Animated.Easing.ease)
212
+ });
213
+ var COLOR_TRANSITION = {
214
+ type: "timing",
215
+ duration: TIMINGS.state.duration,
216
+ easing: [0.2, 0, 0, 1]
217
+ };
218
+ var SPRING_ELASTIC = {
219
+ type: "spring",
220
+ stiffness: 320,
221
+ damping: 22,
222
+ mass: 0.7
167
223
  };
168
224
  var PRESS_SCALE = {
169
225
  button: 0.95};
@@ -208,14 +264,6 @@ function usePressScale({
208
264
  hoverHandlers
209
265
  };
210
266
  }
211
- function useColorTransition(active, options = {}) {
212
- const { duration = TIMINGS.state.duration } = options;
213
- const progress = Animated.useSharedValue(active ? 1 : 0);
214
- React2.useEffect(() => {
215
- progress.value = Animated.withTiming(active ? 1 : 0, { duration, easing: EASINGS.standard });
216
- }, [active, duration, progress]);
217
- return progress;
218
- }
219
267
 
220
268
  // src/components/RadioGroup/RadioGroup.tsx
221
269
  function RadioItem({
@@ -228,18 +276,6 @@ function RadioItem({
228
276
  pressScale: PRESS_SCALE.button,
229
277
  disabled: option.disabled
230
278
  });
231
- const colorProgress = useColorTransition(selected);
232
- const dotScale = Animated.useSharedValue(selected ? 1 : 0);
233
- React2.useEffect(() => {
234
- dotScale.value = Animated.withSpring(selected ? 1 : 0, SPRINGS.elastic);
235
- }, [selected, dotScale]);
236
- const radioStyle = Animated.useAnimatedStyle(() => ({
237
- borderColor: Animated.interpolateColor(colorProgress.value, [0, 1], [colors.border, colors.primary])
238
- }));
239
- const dotStyle = Animated.useAnimatedStyle(() => ({
240
- transform: [{ scale: dotScale.value }],
241
- opacity: dotScale.value
242
- }));
243
279
  return (
244
280
  // AUDIT FIX: opacity was applied only to the radio circle, leaving the label
245
281
  // at full opacity when disabled. The whole row now dims uniformly so users
@@ -263,7 +299,22 @@ function RadioItem({
263
299
  accessibilityLabel: option.label,
264
300
  accessibilityState: { checked: selected, disabled: !!option.disabled }
265
301
  },
266
- /* @__PURE__ */ React2__default.default.createElement(Animated__default.default.View, { style: scaleStyle }, /* @__PURE__ */ React2__default.default.createElement(Animated__default.default.View, { style: [styles.radio, radioStyle] }, /* @__PURE__ */ React2__default.default.createElement(Animated__default.default.View, { style: [styles.dot, { backgroundColor: colors.primary }, dotStyle] }))),
302
+ /* @__PURE__ */ React2__default.default.createElement(Animated__default.default.View, { style: scaleStyle }, /* @__PURE__ */ React2__default.default.createElement(
303
+ reactNativeEase.EaseView,
304
+ {
305
+ style: styles.radio,
306
+ animate: { borderColor: selected ? colors.primary : colors.border },
307
+ transition: COLOR_TRANSITION
308
+ },
309
+ /* @__PURE__ */ React2__default.default.createElement(
310
+ reactNativeEase.EaseView,
311
+ {
312
+ style: [styles.dot, { backgroundColor: colors.primary }],
313
+ animate: { scale: selected ? 1 : 0, opacity: selected ? 1 : 0 },
314
+ transition: SPRING_ELASTIC
315
+ }
316
+ )
317
+ )),
267
318
  /* @__PURE__ */ React2__default.default.createElement(
268
319
  reactNative.Text,
269
320
  {
@@ -1,7 +1,7 @@
1
- export { RadioGroup } from './chunk-YZJAFS4P.mjs';
2
- import './chunk-7H2OR44A.mjs';
3
- import './chunk-QCNARS3X.mjs';
4
- import './chunk-RTC3CFXF.mjs';
5
- import './chunk-5IKW3VNC.mjs';
1
+ export { RadioGroup } from './chunk-X4G6APW6.mjs';
2
+ import './chunk-YNROWHQJ.mjs';
3
+ import './chunk-EJ7ZPXOH.mjs';
4
+ import './chunk-DVK4G2GT.mjs';
6
5
  import './chunk-SOYNZDVY.mjs';
7
6
  import './chunk-2CE3TQVY.mjs';
7
+ import './chunk-Y6FXYEAI.mjs';
@@ -0,0 +1,2 @@
1
+ export { c as RetrayProvider, d as RetrayProviderProps } from './index-wt-orHUi.mjs';
2
+ import 'react';
@@ -0,0 +1,2 @@
1
+ export { c as RetrayProvider, d as RetrayProviderProps } from './index-wt-orHUi.js';
2
+ import 'react';
@@ -0,0 +1,214 @@
1
+ 'use strict';
2
+
3
+ var React3 = require('react');
4
+ var reactNative = require('react-native');
5
+ var reactNativeSafeAreaContext = require('react-native-safe-area-context');
6
+ var reactNativeGestureHandler = require('react-native-gesture-handler');
7
+ var bottomSheet = require('@gorhom/bottom-sheet');
8
+ var sonnerNative = require('sonner-native');
9
+ var reactNativeSizeMatters = require('react-native-size-matters');
10
+
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ var React3__default = /*#__PURE__*/_interopDefault(React3);
14
+
15
+ // src/components/RetrayProvider/RetrayProvider.tsx
16
+
17
+ // src/theme/colorUtils.ts
18
+ function hexToRgb(hex) {
19
+ const clean = hex.replace("#", "");
20
+ const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
21
+ if (full.length !== 6) return null;
22
+ return {
23
+ r: parseInt(full.slice(0, 2), 16),
24
+ g: parseInt(full.slice(2, 4), 16),
25
+ b: parseInt(full.slice(4, 6), 16)
26
+ };
27
+ }
28
+ function componentToHex(c) {
29
+ return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
30
+ }
31
+ function rgbToHex(r, g, b) {
32
+ return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
33
+ }
34
+ function withAlphaOnWhite(hex, alpha) {
35
+ const rgb = hexToRgb(hex);
36
+ if (!rgb) return hex;
37
+ const r = rgb.r * alpha + 255 * (1 - alpha);
38
+ const g = rgb.g * alpha + 255 * (1 - alpha);
39
+ const b = rgb.b * alpha + 255 * (1 - alpha);
40
+ return rgbToHex(r, g, b);
41
+ }
42
+ function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
43
+ const rgb = hexToRgb(hex);
44
+ const bg = hexToRgb(bgHex);
45
+ if (!rgb || !bg) return hex;
46
+ const r = rgb.r * alpha + bg.r * (1 - alpha);
47
+ const g = rgb.g * alpha + bg.g * (1 - alpha);
48
+ const b = rgb.b * alpha + bg.b * (1 - alpha);
49
+ return rgbToHex(r, g, b);
50
+ }
51
+ function mixWithBackground(fgHex, bgHex, opacity) {
52
+ const fg = hexToRgb(fgHex);
53
+ const bg = hexToRgb(bgHex);
54
+ if (!fg || !bg) return fgHex;
55
+ const r = fg.r * opacity + bg.r * (1 - opacity);
56
+ const g = fg.g * opacity + bg.g * (1 - opacity);
57
+ const b = fg.b * opacity + bg.b * (1 - opacity);
58
+ return rgbToHex(r, g, b);
59
+ }
60
+ function lighten(hex, amount) {
61
+ return withAlphaOnWhite(hex, 1 - amount);
62
+ }
63
+ function darken(hex, amount) {
64
+ const rgb = hexToRgb(hex);
65
+ if (!rgb) return hex;
66
+ return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
67
+ }
68
+
69
+ // src/theme/colors.ts
70
+ var defaultLight = {
71
+ background: "#ffffff",
72
+ foreground: "#1a1a1a",
73
+ card: "#ffffff",
74
+ primary: "#1a1a1a",
75
+ primaryForeground: "#ffffff",
76
+ // AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
77
+ accent: "#d4561d",
78
+ accentForeground: "#ffffff",
79
+ border: "#dddddd",
80
+ // AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
81
+ destructive: "#c72828",
82
+ destructiveForeground: "#ffffff",
83
+ success: "#1a7a45",
84
+ successForeground: "#ffffff",
85
+ // AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
86
+ warning: "#9a5200",
87
+ warningForeground: "#ffffff"
88
+ };
89
+ var defaultDark = {
90
+ background: "#0f0f0f",
91
+ foreground: "#fafafa",
92
+ card: "#1c1c1c",
93
+ primary: "#fafafa",
94
+ primaryForeground: "#0f0f0f",
95
+ // AUDIT FIX: lighter accent for dark surfaces (warm amber-orange)
96
+ accent: "#e87645",
97
+ accentForeground: "#ffffff",
98
+ border: "#303030",
99
+ destructive: "#ef5350",
100
+ destructiveForeground: "#ffffff",
101
+ success: "#2e7d52",
102
+ successForeground: "#ffffff",
103
+ // AUDIT FIX: brighter amber for dark-bg visibility; dark text for contrast
104
+ // #f5a623 on #0f0f0f = 8.6:1 ✓ as indicator; #0f0f0f text on #f5a623 = 8.6:1 ✓
105
+ warning: "#f5a623",
106
+ warningForeground: "#0f0f0f"
107
+ };
108
+ function deriveColors(t, scheme) {
109
+ const dark = scheme === "dark";
110
+ const bg = t.background;
111
+ const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
112
+ const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
113
+ const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
114
+ const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
115
+ const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
116
+ const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
117
+ const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
118
+ const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
119
+ const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
120
+ const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
121
+ return {
122
+ ...t,
123
+ foregroundSubtle,
124
+ foregroundMuted,
125
+ surface,
126
+ surfaceStrong,
127
+ destructiveTint,
128
+ destructiveBorder,
129
+ successTint,
130
+ successBorder,
131
+ warningTint,
132
+ warningBorder,
133
+ overlay: t.overlay ?? "rgba(0,0,0,0.45)",
134
+ accentResolved: t.accent ?? t.primary,
135
+ accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
136
+ ring: t.accent ?? t.primary,
137
+ input: t.border,
138
+ separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
139
+ };
140
+ }
141
+
142
+ // src/theme/ThemeProvider.tsx
143
+ var ThemeContext = React3.createContext({
144
+ colors: deriveColors(defaultLight, "light"),
145
+ colorScheme: "light"
146
+ });
147
+ function ThemeProvider({ children, theme, colorScheme = "system" }) {
148
+ const systemScheme = reactNative.useColorScheme() ?? "light";
149
+ const resolvedScheme = colorScheme === "system" ? systemScheme : colorScheme;
150
+ const colors = React3.useMemo(() => {
151
+ const base = resolvedScheme === "dark" ? defaultDark : defaultLight;
152
+ const override = resolvedScheme === "dark" ? theme?.dark : theme?.light;
153
+ const merged = override ? { ...base, ...override } : base;
154
+ return deriveColors(merged, resolvedScheme);
155
+ }, [resolvedScheme, theme]);
156
+ return /* @__PURE__ */ React3__default.default.createElement(ThemeContext.Provider, { value: { colors, colorScheme: resolvedScheme } }, children);
157
+ }
158
+ function useTheme() {
159
+ const context = React3.useContext(ThemeContext);
160
+ if (!context) {
161
+ throw new Error("useTheme must be used within a ThemeProvider");
162
+ }
163
+ return context;
164
+ }
165
+ var isWeb = reactNative.Platform.OS === "web";
166
+ var s = isWeb ? (n) => n : reactNativeSizeMatters.scale;
167
+ var vs = isWeb ? (n) => n : reactNativeSizeMatters.verticalScale;
168
+ var ms = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateScale;
169
+
170
+ // src/components/Toast/Toast.tsx
171
+ function ToastProvider({ children }) {
172
+ const { colorScheme } = useTheme();
173
+ const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
174
+ return /* @__PURE__ */ React3__default.default.createElement(React3__default.default.Fragment, null, children, /* @__PURE__ */ React3__default.default.createElement(
175
+ sonnerNative.Toaster,
176
+ {
177
+ theme: colorScheme,
178
+ position: "top-center",
179
+ richColors: true,
180
+ gap: vs(8),
181
+ offset: insets.top + vs(8),
182
+ visibleToasts: 3,
183
+ closeButton: false,
184
+ swipeToDismissDirection: "up",
185
+ duration: 4e3,
186
+ toastOptions: {
187
+ style: {
188
+ borderRadius: ms(12),
189
+ paddingHorizontal: s(12),
190
+ paddingVertical: vs(10)
191
+ },
192
+ titleStyle: {
193
+ fontFamily: "Sohne-Medium",
194
+ fontSize: ms(13)
195
+ },
196
+ descriptionStyle: {
197
+ fontFamily: "Sohne-Regular",
198
+ fontSize: ms(12),
199
+ opacity: 0.85
200
+ }
201
+ }
202
+ }
203
+ ));
204
+ }
205
+
206
+ // src/components/RetrayProvider/RetrayProvider.tsx
207
+ function RetrayProvider({ children, theme, colorScheme = "system" }) {
208
+ return /* @__PURE__ */ React3__default.default.createElement(reactNativeSafeAreaContext.SafeAreaProvider, { initialMetrics: reactNativeSafeAreaContext.initialWindowMetrics }, /* @__PURE__ */ React3__default.default.createElement(reactNativeGestureHandler.GestureHandlerRootView, { style: styles.root }, /* @__PURE__ */ React3__default.default.createElement(ThemeProvider, { theme, colorScheme }, /* @__PURE__ */ React3__default.default.createElement(bottomSheet.BottomSheetModalProvider, null, /* @__PURE__ */ React3__default.default.createElement(ToastProvider, null, children)))));
209
+ }
210
+ var styles = reactNative.StyleSheet.create({
211
+ root: { flex: 1 }
212
+ });
213
+
214
+ exports.RetrayProvider = RetrayProvider;
@@ -0,0 +1,5 @@
1
+ export { RetrayProvider } from './chunk-YFZ3ELX5.mjs';
2
+ import './chunk-2UYENBLV.mjs';
3
+ import './chunk-SOYNZDVY.mjs';
4
+ import './chunk-2CE3TQVY.mjs';
5
+ import './chunk-Y6FXYEAI.mjs';
package/dist/Select.js CHANGED
@@ -12,18 +12,65 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
  var React2__default = /*#__PURE__*/_interopDefault(React2);
13
13
  var Animated__default = /*#__PURE__*/_interopDefault(Animated);
14
14
 
15
- // src/components/Select/Select.tsx
15
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
+ }) : x)(function(x) {
18
+ if (typeof require !== "undefined") return require.apply(this, arguments);
19
+ throw Error('Dynamic require of "' + x + '" is not supported');
20
+ });
16
21
  var _haptics = null;
22
+ var _hapticsLoaded = false;
17
23
  async function getHaptics() {
18
24
  if (reactNative.Platform.OS === "web") return null;
19
- if (!_haptics) {
20
- _haptics = await import('expo-haptics');
25
+ if (!_hapticsLoaded) {
26
+ _hapticsLoaded = true;
27
+ try {
28
+ _haptics = await import('expo-haptics');
29
+ } catch {
30
+ _haptics = null;
31
+ }
21
32
  }
22
33
  return _haptics;
23
34
  }
35
+ var _pulsar = null;
36
+ var _pulsarChecked = false;
37
+ var _pulsarAvailable = false;
38
+ function isPulsarNativeRegistered() {
39
+ try {
40
+ const g = globalThis;
41
+ if (typeof g.__turboModuleProxy === "function") {
42
+ return g.__turboModuleProxy("RNPulsar") != null;
43
+ }
44
+ return reactNative.NativeModules?.RNPulsar != null;
45
+ } catch {
46
+ return false;
47
+ }
48
+ }
49
+ function getPulsar() {
50
+ if (reactNative.Platform.OS === "web") return null;
51
+ if (!_pulsarChecked) {
52
+ _pulsarChecked = true;
53
+ try {
54
+ if (isPulsarNativeRegistered()) {
55
+ _pulsar = __require("react-native-pulsar");
56
+ _pulsarAvailable = true;
57
+ }
58
+ } catch {
59
+ _pulsar = null;
60
+ _pulsarAvailable = false;
61
+ }
62
+ }
63
+ return _pulsarAvailable ? _pulsar : null;
64
+ }
24
65
  function selectionAsync() {
25
66
  if (reactNative.Platform.OS === "web") return;
26
- getHaptics().then((h) => h?.selectionAsync());
67
+ getHaptics().then((h) => {
68
+ if (h) {
69
+ h.selectionAsync();
70
+ } else {
71
+ getPulsar()?.Presets.System.selection();
72
+ }
73
+ });
27
74
  }
28
75
 
29
76
  // src/theme/colorUtils.ts
package/dist/Select.mjs CHANGED
@@ -1,6 +1,7 @@
1
- export { Select } from './chunk-URLL5JBR.mjs';
2
- import './chunk-QCNARS3X.mjs';
3
- import './chunk-RTC3CFXF.mjs';
4
- import './chunk-5IKW3VNC.mjs';
1
+ export { Select } from './chunk-A3A6KNQN.mjs';
2
+ import './chunk-YNROWHQJ.mjs';
3
+ import './chunk-EJ7ZPXOH.mjs';
4
+ import './chunk-DVK4G2GT.mjs';
5
5
  import './chunk-SOYNZDVY.mjs';
6
6
  import './chunk-2CE3TQVY.mjs';
7
+ import './chunk-Y6FXYEAI.mjs';
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { ViewStyle } from 'react-native';
3
+
4
+ interface SelectableGridItem<T extends string | number = string> {
5
+ /** Unique value emitted on selection. */
6
+ value: T;
7
+ /** Label rendered under the icon. */
8
+ label?: string;
9
+ /** Icon name resolved via the icon registry. */
10
+ iconName?: string;
11
+ /** Custom icon node — overrides `iconName`. */
12
+ icon?: React.ReactNode;
13
+ disabled?: boolean;
14
+ }
15
+ interface SelectableGridProps<T extends string | number = string> {
16
+ items: SelectableGridItem<T>[];
17
+ /** Selected value(s). Array when `multiple`. */
18
+ value: T | T[] | null;
19
+ onChange: (value: T) => void;
20
+ /** Allow multiple selections. `value` should be an array. Defaults to false. */
21
+ multiple?: boolean;
22
+ /** Columns per row. Defaults to 4. Ignored when `orientation='horizontal'`. */
23
+ numColumns?: number;
24
+ /** Gap between cells (dp). Defaults to 12. */
25
+ gap?: number;
26
+ /** Layout orientation. 'grid' (default) wraps into rows. 'horizontal' creates a single scrollable row. */
27
+ orientation?: 'grid' | 'horizontal';
28
+ style?: ViewStyle;
29
+ }
30
+ /**
31
+ * Grid of selectable cells (icon + label) — for store / category / emoji pickers
32
+ * where a list would be the wrong shape. Single or multi select.
33
+ *
34
+ * @example
35
+ * <SelectableGrid
36
+ * items={categories}
37
+ * value={selected}
38
+ * onChange={setSelected}
39
+ * numColumns={4}
40
+ * />
41
+ */
42
+ declare function SelectableGrid<T extends string | number = string>({ items, value, onChange, multiple, numColumns, gap, orientation, style, }: SelectableGridProps<T>): React.JSX.Element;
43
+
44
+ export { SelectableGrid, type SelectableGridItem, type SelectableGridProps };
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { ViewStyle } from 'react-native';
3
+
4
+ interface SelectableGridItem<T extends string | number = string> {
5
+ /** Unique value emitted on selection. */
6
+ value: T;
7
+ /** Label rendered under the icon. */
8
+ label?: string;
9
+ /** Icon name resolved via the icon registry. */
10
+ iconName?: string;
11
+ /** Custom icon node — overrides `iconName`. */
12
+ icon?: React.ReactNode;
13
+ disabled?: boolean;
14
+ }
15
+ interface SelectableGridProps<T extends string | number = string> {
16
+ items: SelectableGridItem<T>[];
17
+ /** Selected value(s). Array when `multiple`. */
18
+ value: T | T[] | null;
19
+ onChange: (value: T) => void;
20
+ /** Allow multiple selections. `value` should be an array. Defaults to false. */
21
+ multiple?: boolean;
22
+ /** Columns per row. Defaults to 4. Ignored when `orientation='horizontal'`. */
23
+ numColumns?: number;
24
+ /** Gap between cells (dp). Defaults to 12. */
25
+ gap?: number;
26
+ /** Layout orientation. 'grid' (default) wraps into rows. 'horizontal' creates a single scrollable row. */
27
+ orientation?: 'grid' | 'horizontal';
28
+ style?: ViewStyle;
29
+ }
30
+ /**
31
+ * Grid of selectable cells (icon + label) — for store / category / emoji pickers
32
+ * where a list would be the wrong shape. Single or multi select.
33
+ *
34
+ * @example
35
+ * <SelectableGrid
36
+ * items={categories}
37
+ * value={selected}
38
+ * onChange={setSelected}
39
+ * numColumns={4}
40
+ * />
41
+ */
42
+ declare function SelectableGrid<T extends string | number = string>({ items, value, onChange, multiple, numColumns, gap, orientation, style, }: SelectableGridProps<T>): React.JSX.Element;
43
+
44
+ export { SelectableGrid, type SelectableGridItem, type SelectableGridProps };