@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
@@ -0,0 +1,582 @@
1
+ 'use strict';
2
+
3
+ var React4 = require('react');
4
+ var reactNative = require('react-native');
5
+ var reactNativeGestureHandler = require('react-native-gesture-handler');
6
+ var Animated2 = require('react-native-reanimated');
7
+ var reactNativeSafeAreaContext = require('react-native-safe-area-context');
8
+ var AntDesign = require('@expo/vector-icons/AntDesign');
9
+ var Entypo = require('@expo/vector-icons/Entypo');
10
+ var Feather = require('@expo/vector-icons/Feather');
11
+ var FontAwesome5 = require('@expo/vector-icons/FontAwesome5');
12
+ var MaterialIcons = require('@expo/vector-icons/MaterialIcons');
13
+ var Ionicons = require('@expo/vector-icons/Ionicons');
14
+ var reactNativeSizeMatters = require('react-native-size-matters');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ var React4__default = /*#__PURE__*/_interopDefault(React4);
19
+ var Animated2__default = /*#__PURE__*/_interopDefault(Animated2);
20
+ var AntDesign__default = /*#__PURE__*/_interopDefault(AntDesign);
21
+ var Entypo__default = /*#__PURE__*/_interopDefault(Entypo);
22
+ var Feather__default = /*#__PURE__*/_interopDefault(Feather);
23
+ var FontAwesome5__default = /*#__PURE__*/_interopDefault(FontAwesome5);
24
+ var MaterialIcons__default = /*#__PURE__*/_interopDefault(MaterialIcons);
25
+ var Ionicons__default = /*#__PURE__*/_interopDefault(Ionicons);
26
+
27
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
28
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
29
+ }) : x)(function(x) {
30
+ if (typeof require !== "undefined") return require.apply(this, arguments);
31
+ throw Error('Dynamic require of "' + x + '" is not supported');
32
+ });
33
+ var glyphMapOf = (mod) => mod.glyphMap ?? {};
34
+ var ALL_FAMILIES = [
35
+ { name: "Ionicons", component: Ionicons__default.default, getGlyphMap: () => glyphMapOf(Ionicons__default.default) },
36
+ { name: "MaterialIcons", component: MaterialIcons__default.default, getGlyphMap: () => glyphMapOf(MaterialIcons__default.default) },
37
+ { name: "FontAwesome5", component: FontAwesome5__default.default, getGlyphMap: () => glyphMapOf(FontAwesome5__default.default) },
38
+ { name: "Entypo", component: Entypo__default.default, getGlyphMap: () => glyphMapOf(Entypo__default.default) },
39
+ { name: "AntDesign", component: AntDesign__default.default, getGlyphMap: () => glyphMapOf(AntDesign__default.default) },
40
+ { name: "Feather", component: Feather__default.default, getGlyphMap: () => glyphMapOf(Feather__default.default) }
41
+ ];
42
+ var activeFamilies = ALL_FAMILIES;
43
+ var resolvedCache = null;
44
+ function buildCache() {
45
+ const cache = /* @__PURE__ */ new Map();
46
+ for (const family of activeFamilies) {
47
+ const glyphMap = family.getGlyphMap();
48
+ for (const iconName of Object.keys(glyphMap)) {
49
+ cache.set(iconName, family);
50
+ }
51
+ }
52
+ return cache;
53
+ }
54
+ function resolveFamily(name) {
55
+ if (!resolvedCache) {
56
+ resolvedCache = buildCache();
57
+ }
58
+ return resolvedCache.get(name) ?? null;
59
+ }
60
+ function Icon({ name, size, color, family }) {
61
+ let resolved = null;
62
+ if (family) {
63
+ resolved = ALL_FAMILIES.find((f) => f.name === family) ?? null;
64
+ } else {
65
+ resolved = resolveFamily(name);
66
+ }
67
+ if (!resolved) return null;
68
+ const Component = resolved.component;
69
+ return React4__default.default.createElement(Component, { name, size, color });
70
+ }
71
+ function renderIcon(name, size, color) {
72
+ return React4__default.default.createElement(Icon, { name, size, color });
73
+ }
74
+
75
+ // src/theme/colorUtils.ts
76
+ function hexToRgb(hex) {
77
+ const clean = hex.replace("#", "");
78
+ const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
79
+ if (full.length !== 6) return null;
80
+ return {
81
+ r: parseInt(full.slice(0, 2), 16),
82
+ g: parseInt(full.slice(2, 4), 16),
83
+ b: parseInt(full.slice(4, 6), 16)
84
+ };
85
+ }
86
+ function componentToHex(c) {
87
+ return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
88
+ }
89
+ function rgbToHex(r, g, b) {
90
+ return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
91
+ }
92
+ function withAlphaOnWhite(hex, alpha) {
93
+ const rgb = hexToRgb(hex);
94
+ if (!rgb) return hex;
95
+ const r = rgb.r * alpha + 255 * (1 - alpha);
96
+ const g = rgb.g * alpha + 255 * (1 - alpha);
97
+ const b = rgb.b * alpha + 255 * (1 - alpha);
98
+ return rgbToHex(r, g, b);
99
+ }
100
+ function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
101
+ const rgb = hexToRgb(hex);
102
+ const bg = hexToRgb(bgHex);
103
+ if (!rgb || !bg) return hex;
104
+ const r = rgb.r * alpha + bg.r * (1 - alpha);
105
+ const g = rgb.g * alpha + bg.g * (1 - alpha);
106
+ const b = rgb.b * alpha + bg.b * (1 - alpha);
107
+ return rgbToHex(r, g, b);
108
+ }
109
+ function mixWithBackground(fgHex, bgHex, opacity) {
110
+ const fg = hexToRgb(fgHex);
111
+ const bg = hexToRgb(bgHex);
112
+ if (!fg || !bg) return fgHex;
113
+ const r = fg.r * opacity + bg.r * (1 - opacity);
114
+ const g = fg.g * opacity + bg.g * (1 - opacity);
115
+ const b = fg.b * opacity + bg.b * (1 - opacity);
116
+ return rgbToHex(r, g, b);
117
+ }
118
+ function lighten(hex, amount) {
119
+ return withAlphaOnWhite(hex, 1 - amount);
120
+ }
121
+ function darken(hex, amount) {
122
+ const rgb = hexToRgb(hex);
123
+ if (!rgb) return hex;
124
+ return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
125
+ }
126
+
127
+ // src/theme/colors.ts
128
+ var defaultLight = {
129
+ background: "#ffffff",
130
+ foreground: "#1a1a1a",
131
+ card: "#ffffff",
132
+ primary: "#1a1a1a",
133
+ primaryForeground: "#ffffff",
134
+ // AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
135
+ accent: "#d4561d",
136
+ accentForeground: "#ffffff",
137
+ border: "#dddddd",
138
+ // AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
139
+ destructive: "#c72828",
140
+ destructiveForeground: "#ffffff",
141
+ success: "#1a7a45",
142
+ successForeground: "#ffffff",
143
+ // AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
144
+ warning: "#9a5200",
145
+ warningForeground: "#ffffff"
146
+ };
147
+ function deriveColors(t, scheme) {
148
+ const dark = scheme === "dark";
149
+ const bg = t.background;
150
+ const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
151
+ const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
152
+ const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
153
+ const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
154
+ const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
155
+ const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
156
+ const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
157
+ const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
158
+ const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
159
+ const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
160
+ return {
161
+ ...t,
162
+ foregroundSubtle,
163
+ foregroundMuted,
164
+ surface,
165
+ surfaceStrong,
166
+ destructiveTint,
167
+ destructiveBorder,
168
+ successTint,
169
+ successBorder,
170
+ warningTint,
171
+ warningBorder,
172
+ overlay: t.overlay ?? "rgba(0,0,0,0.45)",
173
+ accentResolved: t.accent ?? t.primary,
174
+ accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
175
+ ring: t.accent ?? t.primary,
176
+ input: t.border,
177
+ separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
178
+ };
179
+ }
180
+
181
+ // src/theme/ThemeProvider.tsx
182
+ var ThemeContext = React4.createContext({
183
+ colors: deriveColors(defaultLight, "light"),
184
+ colorScheme: "light"
185
+ });
186
+ function useTheme() {
187
+ const context = React4.useContext(ThemeContext);
188
+ if (!context) {
189
+ throw new Error("useTheme must be used within a ThemeProvider");
190
+ }
191
+ return context;
192
+ }
193
+ var isWeb = reactNative.Platform.OS === "web";
194
+ var s = isWeb ? (n) => n : reactNativeSizeMatters.scale;
195
+ var vs = isWeb ? (n) => n : reactNativeSizeMatters.verticalScale;
196
+ var SPRINGS = {
197
+ /** Settled transitions for moving indicators — Tabs pill, Switch thumb. */
198
+ glide: { stiffness: 380, damping: 38, mass: 1 }};
199
+ ({
200
+ /** Material-style ease-out — natural deceleration for state changes. */
201
+ standard: Animated2.Easing.bezier(0.2, 0, 0, 1),
202
+ /** Strong ease-out for expanding surfaces (Accordion open). */
203
+ expand: Animated2.Easing.bezier(0.23, 1, 0.32, 1),
204
+ /** Quick ease-in for collapsing. */
205
+ collapse: Animated2.Easing.in(Animated2.Easing.ease)
206
+ });
207
+ var _haptics = null;
208
+ var _hapticsLoaded = false;
209
+ async function getHaptics() {
210
+ if (reactNative.Platform.OS === "web") return null;
211
+ if (!_hapticsLoaded) {
212
+ _hapticsLoaded = true;
213
+ try {
214
+ _haptics = await import('expo-haptics');
215
+ } catch {
216
+ _haptics = null;
217
+ }
218
+ }
219
+ return _haptics;
220
+ }
221
+ var _pulsar = null;
222
+ var _pulsarChecked = false;
223
+ var _pulsarAvailable = false;
224
+ function isPulsarNativeRegistered() {
225
+ try {
226
+ const g = globalThis;
227
+ if (typeof g.__turboModuleProxy === "function") {
228
+ return g.__turboModuleProxy("RNPulsar") != null;
229
+ }
230
+ return reactNative.NativeModules?.RNPulsar != null;
231
+ } catch {
232
+ return false;
233
+ }
234
+ }
235
+ function getPulsar() {
236
+ if (reactNative.Platform.OS === "web") return null;
237
+ if (!_pulsarChecked) {
238
+ _pulsarChecked = true;
239
+ try {
240
+ if (isPulsarNativeRegistered()) {
241
+ _pulsar = __require("react-native-pulsar");
242
+ _pulsarAvailable = true;
243
+ }
244
+ } catch {
245
+ _pulsar = null;
246
+ _pulsarAvailable = false;
247
+ }
248
+ }
249
+ return _pulsarAvailable ? _pulsar : null;
250
+ }
251
+ function selectionAsync() {
252
+ if (reactNative.Platform.OS === "web") return;
253
+ getHaptics().then((h) => {
254
+ if (h) {
255
+ h.selectionAsync();
256
+ } else {
257
+ getPulsar()?.Presets.System.selection();
258
+ }
259
+ });
260
+ }
261
+
262
+ // src/components/PagerDots/PagerDots.tsx
263
+ function Dot({ active, size, activeColor, inactiveColor, onPress, index, total }) {
264
+ const progress = Animated2.useSharedValue(active ? 1 : 0);
265
+ React4.useEffect(() => {
266
+ progress.value = Animated2.withSpring(active ? 1 : 0, SPRINGS.glide);
267
+ }, [active, progress]);
268
+ const animatedStyle = Animated2.useAnimatedStyle(() => ({
269
+ width: size + progress.value * size * 1.5,
270
+ backgroundColor: Animated2.interpolateColor(progress.value, [0, 1], [inactiveColor, activeColor])
271
+ }));
272
+ const dot = /* @__PURE__ */ React4__default.default.createElement(Animated2__default.default.View, { style: [{ height: size, borderRadius: size / 2 }, animatedStyle] });
273
+ if (!onPress) return dot;
274
+ const handlePress = () => {
275
+ selectionAsync();
276
+ onPress();
277
+ };
278
+ return /* @__PURE__ */ React4__default.default.createElement(
279
+ reactNative.TouchableOpacity,
280
+ {
281
+ onPress: handlePress,
282
+ activeOpacity: 0.7,
283
+ touchSoundDisabled: true,
284
+ accessibilityRole: "button",
285
+ accessibilityLabel: `Page ${index + 1} of ${total}${active ? ", current page" : ""}`,
286
+ hitSlop: { top: 8, bottom: 8, left: 4, right: 4 }
287
+ },
288
+ dot
289
+ );
290
+ }
291
+ function PagerDots({
292
+ count,
293
+ activeIndex,
294
+ onDotPress,
295
+ showControls = false,
296
+ dotSize = 8,
297
+ spacing = 8,
298
+ activeColor,
299
+ inactiveColor,
300
+ style
301
+ }) {
302
+ const { colors } = useTheme();
303
+ const resolvedActive = activeColor ?? colors.primary;
304
+ const resolvedInactive = inactiveColor ?? colors.border;
305
+ const size = s(dotSize);
306
+ const hasControls = showControls !== false;
307
+ const canGoPrev = activeIndex > 0;
308
+ const canGoNext = activeIndex < count - 1;
309
+ const handlePrevious = () => {
310
+ if (!canGoPrev) return;
311
+ selectionAsync();
312
+ if (typeof showControls === "object" && showControls.onPrevious) {
313
+ showControls.onPrevious();
314
+ } else if (onDotPress) {
315
+ onDotPress(activeIndex - 1);
316
+ }
317
+ };
318
+ const handleNext = () => {
319
+ if (!canGoNext) return;
320
+ selectionAsync();
321
+ if (typeof showControls === "object" && showControls.onNext) {
322
+ showControls.onNext();
323
+ } else if (onDotPress) {
324
+ onDotPress(activeIndex + 1);
325
+ }
326
+ };
327
+ return /* @__PURE__ */ React4__default.default.createElement(
328
+ reactNative.View,
329
+ {
330
+ style: [styles.container, { gap: s(spacing) }, style],
331
+ accessibilityRole: "adjustable",
332
+ accessibilityLabel: `Page ${activeIndex + 1} of ${count}`
333
+ },
334
+ hasControls && /* @__PURE__ */ React4__default.default.createElement(
335
+ reactNative.TouchableOpacity,
336
+ {
337
+ onPress: handlePrevious,
338
+ disabled: !canGoPrev,
339
+ activeOpacity: 0.7,
340
+ touchSoundDisabled: true,
341
+ accessibilityRole: "button",
342
+ accessibilityLabel: "Previous page",
343
+ hitSlop: { top: 8, bottom: 8, left: 8, right: 8 },
344
+ style: [styles.controlBtn, !canGoPrev && styles.controlBtnDisabled]
345
+ },
346
+ renderIcon("chevron-left", s(18), canGoPrev ? colors.foreground : colors.foregroundMuted)
347
+ ),
348
+ /* @__PURE__ */ React4__default.default.createElement(reactNative.View, { style: [styles.dotsRow, { gap: s(spacing) }] }, Array.from({ length: count }).map((_, i) => /* @__PURE__ */ React4__default.default.createElement(
349
+ Dot,
350
+ {
351
+ key: i,
352
+ active: i === activeIndex,
353
+ size,
354
+ activeColor: resolvedActive,
355
+ inactiveColor: resolvedInactive,
356
+ index: i,
357
+ total: count,
358
+ onPress: onDotPress ? () => onDotPress(i) : void 0
359
+ }
360
+ ))),
361
+ hasControls && /* @__PURE__ */ React4__default.default.createElement(
362
+ reactNative.TouchableOpacity,
363
+ {
364
+ onPress: handleNext,
365
+ disabled: !canGoNext,
366
+ activeOpacity: 0.7,
367
+ touchSoundDisabled: true,
368
+ accessibilityRole: "button",
369
+ accessibilityLabel: "Next page",
370
+ hitSlop: { top: 8, bottom: 8, left: 8, right: 8 },
371
+ style: [styles.controlBtn, !canGoNext && styles.controlBtnDisabled]
372
+ },
373
+ renderIcon("chevron-right", s(18), canGoNext ? colors.foreground : colors.foregroundMuted)
374
+ )
375
+ );
376
+ }
377
+ var styles = reactNative.StyleSheet.create({
378
+ container: {
379
+ flexDirection: "row",
380
+ alignItems: "center",
381
+ justifyContent: "center"
382
+ },
383
+ dotsRow: {
384
+ flexDirection: "row",
385
+ alignItems: "center"
386
+ },
387
+ controlBtn: {
388
+ padding: s(4)
389
+ },
390
+ controlBtnDisabled: {
391
+ opacity: 0.3
392
+ }
393
+ });
394
+
395
+ // src/components/ImageViewer/ImageViewer.tsx
396
+ var MAX_SCALE = 3;
397
+ var DOUBLE_TAP_SCALE = 2.5;
398
+ function ZoomableImage({ source, width, height, onZoomChange }) {
399
+ const scale2 = Animated2.useSharedValue(1);
400
+ const savedScale = Animated2.useSharedValue(1);
401
+ const translateX = Animated2.useSharedValue(0);
402
+ const translateY = Animated2.useSharedValue(0);
403
+ const savedX = Animated2.useSharedValue(0);
404
+ const savedY = Animated2.useSharedValue(0);
405
+ const reportZoom = React4.useCallback((zoomed) => onZoomChange(zoomed), [onZoomChange]);
406
+ const reset = () => {
407
+ "worklet";
408
+ scale2.value = Animated2.withTiming(1);
409
+ savedScale.value = 1;
410
+ translateX.value = Animated2.withTiming(0);
411
+ translateY.value = Animated2.withTiming(0);
412
+ savedX.value = 0;
413
+ savedY.value = 0;
414
+ Animated2.runOnJS(reportZoom)(false);
415
+ };
416
+ const pinch = reactNativeGestureHandler.Gesture.Pinch().onUpdate((e) => {
417
+ scale2.value = Math.max(1, Math.min(savedScale.value * e.scale, MAX_SCALE));
418
+ }).onEnd(() => {
419
+ savedScale.value = scale2.value;
420
+ if (scale2.value <= 1) {
421
+ reset();
422
+ } else {
423
+ Animated2.runOnJS(reportZoom)(true);
424
+ }
425
+ });
426
+ const pan = reactNativeGestureHandler.Gesture.Pan().onUpdate((e) => {
427
+ if (scale2.value <= 1) return;
428
+ translateX.value = savedX.value + e.translationX;
429
+ translateY.value = savedY.value + e.translationY;
430
+ }).onEnd(() => {
431
+ savedX.value = translateX.value;
432
+ savedY.value = translateY.value;
433
+ });
434
+ const doubleTap = reactNativeGestureHandler.Gesture.Tap().numberOfTaps(2).onEnd(() => {
435
+ if (scale2.value > 1) {
436
+ reset();
437
+ } else {
438
+ scale2.value = Animated2.withTiming(DOUBLE_TAP_SCALE);
439
+ savedScale.value = DOUBLE_TAP_SCALE;
440
+ Animated2.runOnJS(reportZoom)(true);
441
+ }
442
+ });
443
+ const composed = reactNativeGestureHandler.Gesture.Exclusive(doubleTap, reactNativeGestureHandler.Gesture.Simultaneous(pinch, pan));
444
+ const animatedStyle = Animated2.useAnimatedStyle(() => ({
445
+ transform: [
446
+ { translateX: translateX.value },
447
+ { translateY: translateY.value },
448
+ { scale: scale2.value }
449
+ ]
450
+ }));
451
+ return /* @__PURE__ */ React4__default.default.createElement(reactNativeGestureHandler.GestureDetector, { gesture: composed }, /* @__PURE__ */ React4__default.default.createElement(Animated2__default.default.View, { style: [{ width, height }, styles2.imageWrap] }, /* @__PURE__ */ React4__default.default.createElement(
452
+ Animated2__default.default.Image,
453
+ {
454
+ source,
455
+ style: [{ width, height }, animatedStyle],
456
+ resizeMode: "contain"
457
+ }
458
+ )));
459
+ }
460
+ function ImageViewer({ images, visible, onClose, initialIndex = 0 }) {
461
+ const { width, height } = reactNative.useWindowDimensions();
462
+ const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
463
+ const [index, setIndex] = React4.useState(initialIndex);
464
+ const [pagingEnabled, setPagingEnabled] = React4.useState(true);
465
+ const scrollRef = React4__default.default.useRef(null);
466
+ React4__default.default.useEffect(() => {
467
+ if (!visible) return;
468
+ const handle = requestAnimationFrame(() => {
469
+ setIndex(initialIndex);
470
+ setPagingEnabled(true);
471
+ scrollRef.current?.scrollTo({ x: initialIndex * width, animated: false });
472
+ });
473
+ return () => cancelAnimationFrame(handle);
474
+ }, [visible, initialIndex, width]);
475
+ const dragY = Animated2.useSharedValue(0);
476
+ const DISMISS_THRESHOLD = height * 0.18;
477
+ const closeViewer = React4.useCallback(() => onClose(), [onClose]);
478
+ const swipeDown = reactNativeGestureHandler.Gesture.Pan().enabled(pagingEnabled).activeOffsetY(12).failOffsetX([-16, 16]).onUpdate((e) => {
479
+ dragY.value = Math.max(0, e.translationY);
480
+ }).onEnd((e) => {
481
+ if (e.translationY > DISMISS_THRESHOLD || e.velocityY > 800) {
482
+ Animated2.runOnJS(closeViewer)();
483
+ } else {
484
+ dragY.value = Animated2.withTiming(0);
485
+ }
486
+ });
487
+ React4__default.default.useEffect(() => {
488
+ if (visible) dragY.value = 0;
489
+ }, [visible, dragY]);
490
+ const dismissStyle = Animated2.useAnimatedStyle(() => ({
491
+ transform: [{ translateY: dragY.value }]
492
+ }));
493
+ const backdropStyle = Animated2.useAnimatedStyle(() => ({
494
+ opacity: 1 - Math.min(dragY.value / (height * 0.5), 0.85)
495
+ }));
496
+ const onMomentumEnd = (e) => {
497
+ const page = Math.round(e.nativeEvent.contentOffset.x / width);
498
+ setIndex(page);
499
+ };
500
+ const goTo = (page) => {
501
+ scrollRef.current?.scrollTo({ x: page * width, animated: true });
502
+ setIndex(page);
503
+ };
504
+ return /* @__PURE__ */ React4__default.default.createElement(reactNative.Modal, { visible, transparent: false, animationType: "fade", onRequestClose: onClose, statusBarTranslucent: true }, /* @__PURE__ */ React4__default.default.createElement(reactNativeGestureHandler.GestureHandlerRootView, { style: styles2.root }, /* @__PURE__ */ React4__default.default.createElement(Animated2__default.default.View, { style: [styles2.backdrop, backdropStyle], pointerEvents: "none" }), /* @__PURE__ */ React4__default.default.createElement(Animated2__default.default.View, { style: [styles2.container, dismissStyle] }, /* @__PURE__ */ React4__default.default.createElement(reactNativeGestureHandler.GestureDetector, { gesture: swipeDown }, /* @__PURE__ */ React4__default.default.createElement(Animated2__default.default.View, { style: styles2.root }, /* @__PURE__ */ React4__default.default.createElement(
505
+ reactNative.ScrollView,
506
+ {
507
+ ref: scrollRef,
508
+ horizontal: true,
509
+ pagingEnabled: true,
510
+ scrollEnabled: pagingEnabled,
511
+ showsHorizontalScrollIndicator: false,
512
+ onMomentumScrollEnd: onMomentumEnd,
513
+ bounces: false
514
+ },
515
+ images.map((source, i) => /* @__PURE__ */ React4__default.default.createElement(
516
+ ZoomableImage,
517
+ {
518
+ key: i,
519
+ source,
520
+ width,
521
+ height,
522
+ onZoomChange: (zoomed) => setPagingEnabled(!zoomed)
523
+ }
524
+ ))
525
+ ))), /* @__PURE__ */ React4__default.default.createElement(
526
+ reactNative.TouchableOpacity,
527
+ {
528
+ style: [styles2.closeButton, { top: insets.top + vs(8) }],
529
+ onPress: onClose,
530
+ activeOpacity: 0.7,
531
+ touchSoundDisabled: true,
532
+ accessibilityRole: "button",
533
+ accessibilityLabel: "Close",
534
+ hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }
535
+ },
536
+ renderIcon("x", 26, "#fff")
537
+ ), images.length > 1 ? /* @__PURE__ */ React4__default.default.createElement(reactNative.View, { style: [styles2.dots, { bottom: insets.bottom + vs(16) }], pointerEvents: "box-none" }, /* @__PURE__ */ React4__default.default.createElement(
538
+ PagerDots,
539
+ {
540
+ count: images.length,
541
+ activeIndex: index,
542
+ onDotPress: goTo,
543
+ activeColor: "#fff",
544
+ inactiveColor: "rgba(255,255,255,0.4)"
545
+ }
546
+ )) : null)));
547
+ }
548
+ var styles2 = reactNative.StyleSheet.create({
549
+ root: {
550
+ flex: 1
551
+ },
552
+ container: {
553
+ flex: 1
554
+ },
555
+ backdrop: {
556
+ ...reactNative.StyleSheet.absoluteFillObject,
557
+ backgroundColor: "#000"
558
+ },
559
+ imageWrap: {
560
+ alignItems: "center",
561
+ justifyContent: "center",
562
+ overflow: "hidden"
563
+ },
564
+ closeButton: {
565
+ position: "absolute",
566
+ right: s(12),
567
+ width: s(40),
568
+ height: s(40),
569
+ borderRadius: s(20),
570
+ backgroundColor: "rgba(0,0,0,0.4)",
571
+ alignItems: "center",
572
+ justifyContent: "center"
573
+ },
574
+ dots: {
575
+ position: "absolute",
576
+ left: 0,
577
+ right: 0,
578
+ alignItems: "center"
579
+ }
580
+ });
581
+
582
+ exports.ImageViewer = ImageViewer;
@@ -0,0 +1,8 @@
1
+ export { ImageViewer } from './chunk-Z4BVUWW6.mjs';
2
+ import './chunk-4K625MVM.mjs';
3
+ import './chunk-EJ7ZPXOH.mjs';
4
+ import './chunk-DVK4G2GT.mjs';
5
+ import './chunk-T7XZ7H7Y.mjs';
6
+ import './chunk-SOYNZDVY.mjs';
7
+ import './chunk-2CE3TQVY.mjs';
8
+ import './chunk-Y6FXYEAI.mjs';
package/dist/Input.mjs CHANGED
@@ -1,6 +1,7 @@
1
- export { Input } from './chunk-L7E7TVEZ.mjs';
2
- import './chunk-7H2OR44A.mjs';
1
+ export { Input } from './chunk-756RAKE4.mjs';
2
+ import './chunk-26BCI223.mjs';
3
+ import './chunk-DVK4G2GT.mjs';
3
4
  import './chunk-T7XZ7H7Y.mjs';
4
- import './chunk-5IKW3VNC.mjs';
5
5
  import './chunk-SOYNZDVY.mjs';
6
6
  import './chunk-2CE3TQVY.mjs';
7
+ import './chunk-Y6FXYEAI.mjs';
@@ -2,3 +2,4 @@ export { LabelValue } from './chunk-A4MDAP7G.mjs';
2
2
  import './chunk-T7XZ7H7Y.mjs';
3
3
  import './chunk-SOYNZDVY.mjs';
4
4
  import './chunk-2CE3TQVY.mjs';
5
+ import './chunk-Y6FXYEAI.mjs';
@@ -2,3 +2,4 @@ export { ListGroup, ListGroupFooter, ListGroupHeader } from './chunk-SOA2Z4RB.mj
2
2
  import './chunk-QY3X2UYR.mjs';
3
3
  import './chunk-SOYNZDVY.mjs';
4
4
  import './chunk-2CE3TQVY.mjs';
5
+ import './chunk-Y6FXYEAI.mjs';