@retray-dev/ui-kit 10.2.0 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/COMPONENTS.md +384 -40
  2. package/README.md +14 -5
  3. package/dist/Accordion.d.mts +6 -0
  4. package/dist/Accordion.d.ts +6 -0
  5. package/dist/Accordion.js +16 -0
  6. package/dist/Accordion.mjs +2 -2
  7. package/dist/AlertBanner.js +2 -0
  8. package/dist/AlertBanner.mjs +2 -2
  9. package/dist/AppHeader.js +2 -0
  10. package/dist/AppHeader.mjs +3 -3
  11. package/dist/Avatar.js +2 -0
  12. package/dist/Avatar.mjs +2 -2
  13. package/dist/Badge.js +2 -0
  14. package/dist/Badge.mjs +2 -2
  15. package/dist/Button.js +17 -17
  16. package/dist/Button.mjs +2 -2
  17. package/dist/Card.js +2 -0
  18. package/dist/Card.mjs +2 -2
  19. package/dist/CategoryStrip.js +2 -0
  20. package/dist/CategoryStrip.mjs +2 -2
  21. package/dist/Checkbox.js +2 -0
  22. package/dist/Checkbox.mjs +2 -2
  23. package/dist/Chip.js +2 -0
  24. package/dist/Chip.mjs +2 -2
  25. package/dist/ConfirmDialog.d.mts +1 -6
  26. package/dist/ConfirmDialog.d.ts +1 -6
  27. package/dist/ConfirmDialog.js +53 -41
  28. package/dist/ConfirmDialog.mjs +3 -3
  29. package/dist/CurrencyDisplay.js +2 -0
  30. package/dist/CurrencyDisplay.mjs +2 -2
  31. package/dist/CurrencyInput.d.mts +3 -8
  32. package/dist/CurrencyInput.d.ts +3 -8
  33. package/dist/CurrencyInput.js +5 -1
  34. package/dist/CurrencyInput.mjs +3 -3
  35. package/dist/DetailRow.js +2 -0
  36. package/dist/DetailRow.mjs +2 -2
  37. package/dist/EmptyState.js +17 -17
  38. package/dist/EmptyState.mjs +3 -3
  39. package/dist/ErrorBoundary.js +2 -0
  40. package/dist/ErrorBoundary.mjs +2 -2
  41. package/dist/Form.js +2 -0
  42. package/dist/Form.mjs +2 -2
  43. package/dist/IconButton.js +2 -0
  44. package/dist/IconButton.mjs +2 -2
  45. package/dist/IconPicker.js +677 -248
  46. package/dist/IconPicker.mjs +3 -2
  47. package/dist/ImageUpload.d.mts +3 -1
  48. package/dist/ImageUpload.d.ts +3 -1
  49. package/dist/ImageUpload.js +10 -3
  50. package/dist/ImageUpload.mjs +3 -3
  51. package/dist/ImageViewer.js +2 -0
  52. package/dist/ImageViewer.mjs +4 -4
  53. package/dist/Input.js +2 -0
  54. package/dist/Input.mjs +2 -2
  55. package/dist/LabelValue.js +2 -0
  56. package/dist/LabelValue.mjs +2 -2
  57. package/dist/ListGroup.js +2 -0
  58. package/dist/ListGroup.mjs +2 -2
  59. package/dist/ListItem.d.mts +7 -7
  60. package/dist/ListItem.d.ts +7 -7
  61. package/dist/ListItem.js +14 -7
  62. package/dist/ListItem.mjs +2 -2
  63. package/dist/MediaCard.js +2 -0
  64. package/dist/MediaCard.mjs +2 -2
  65. package/dist/MenuGroup.js +2 -0
  66. package/dist/MenuGroup.mjs +2 -2
  67. package/dist/MenuItem.js +2 -0
  68. package/dist/MenuItem.mjs +2 -2
  69. package/dist/MonthPicker.js +2 -0
  70. package/dist/MonthPicker.mjs +2 -2
  71. package/dist/NumberStepper.js +2 -0
  72. package/dist/NumberStepper.mjs +2 -2
  73. package/dist/PagerDots.js +2 -0
  74. package/dist/PagerDots.mjs +2 -2
  75. package/dist/Pressable.d.mts +15 -7
  76. package/dist/Pressable.d.ts +15 -7
  77. package/dist/Pressable.js +7 -3
  78. package/dist/Pressable.mjs +1 -1
  79. package/dist/PricingCard.js +17 -17
  80. package/dist/PricingCard.mjs +4 -4
  81. package/dist/Progress.js +2 -0
  82. package/dist/Progress.mjs +2 -2
  83. package/dist/RadioGroup.js +2 -0
  84. package/dist/RadioGroup.mjs +2 -2
  85. package/dist/RetrayProvider.d.mts +1 -1
  86. package/dist/RetrayProvider.d.ts +1 -1
  87. package/dist/RetrayProvider.js +2 -0
  88. package/dist/RetrayProvider.mjs +3 -3
  89. package/dist/Select.js +2 -0
  90. package/dist/Select.mjs +2 -2
  91. package/dist/SelectableCard.d.mts +27 -0
  92. package/dist/SelectableCard.d.ts +27 -0
  93. package/dist/SelectableCard.js +511 -0
  94. package/dist/SelectableCard.mjs +8 -0
  95. package/dist/SelectableGrid.js +2 -0
  96. package/dist/SelectableGrid.mjs +2 -2
  97. package/dist/Separator.js +2 -0
  98. package/dist/Separator.mjs +2 -2
  99. package/dist/Sheet.d.mts +4 -46
  100. package/dist/Sheet.d.ts +4 -46
  101. package/dist/Sheet.js +55 -115
  102. package/dist/Sheet.mjs +2 -3
  103. package/dist/SheetSelect.js +2 -0
  104. package/dist/SheetSelect.mjs +2 -2
  105. package/dist/Skeleton.d.mts +3 -1
  106. package/dist/Skeleton.d.ts +3 -1
  107. package/dist/Skeleton.js +5 -2
  108. package/dist/Skeleton.mjs +2 -2
  109. package/dist/Slider.js +2 -0
  110. package/dist/Slider.mjs +2 -2
  111. package/dist/Spinner.js +2 -0
  112. package/dist/Spinner.mjs +2 -2
  113. package/dist/Stats.d.mts +33 -0
  114. package/dist/Stats.d.ts +33 -0
  115. package/dist/Stats.js +453 -0
  116. package/dist/Stats.mjs +9 -0
  117. package/dist/Switch.js +2 -0
  118. package/dist/Switch.mjs +2 -2
  119. package/dist/TabBar.js +2 -0
  120. package/dist/TabBar.mjs +2 -2
  121. package/dist/Tabs.js +2 -0
  122. package/dist/Tabs.mjs +2 -2
  123. package/dist/Text.d.mts +3 -1
  124. package/dist/Text.d.ts +3 -1
  125. package/dist/Text.js +5 -3
  126. package/dist/Text.mjs +2 -2
  127. package/dist/Textarea.js +2 -0
  128. package/dist/Textarea.mjs +2 -2
  129. package/dist/Toast.js +2 -0
  130. package/dist/Toast.mjs +2 -2
  131. package/dist/Toggle.js +2 -0
  132. package/dist/Toggle.mjs +2 -2
  133. package/dist/{chunk-U2XJFYED.mjs → chunk-2BA3JMKK.mjs} +1 -1
  134. package/dist/{chunk-NMU5FMQJ.mjs → chunk-2HFD4IHU.mjs} +4 -2
  135. package/dist/{chunk-S2R7UVOE.mjs → chunk-2LG326TT.mjs} +1 -1
  136. package/dist/chunk-2P2CB235.mjs +236 -0
  137. package/dist/{chunk-6L4G6PBT.mjs → chunk-3XCFYSX4.mjs} +1 -1
  138. package/dist/{chunk-HTHGSXFG.mjs → chunk-4J2PXL36.mjs} +16 -18
  139. package/dist/{chunk-BEMIQXXU.mjs → chunk-4OORJ2DY.mjs} +1 -1
  140. package/dist/chunk-4XOB5TTD.mjs +166 -0
  141. package/dist/{chunk-FCSSQK3L.mjs → chunk-57V2LXCK.mjs} +1 -1
  142. package/dist/{chunk-6Q64UFIA.mjs → chunk-7AFZWSCI.mjs} +1 -1
  143. package/dist/{chunk-IX3NYLYQ.mjs → chunk-7ELGZ66G.mjs} +1 -1
  144. package/dist/{chunk-GD6KXMG5.mjs → chunk-AENAVIKT.mjs} +1 -1
  145. package/dist/{chunk-ID72TK46.mjs → chunk-BXF4AMHY.mjs} +1 -1
  146. package/dist/{chunk-SOA2Z4RB.mjs → chunk-C43HRKXH.mjs} +1 -1
  147. package/dist/{chunk-TZDGAP5N.mjs → chunk-CF27NBXO.mjs} +11 -6
  148. package/dist/{chunk-SXLKNTA4.mjs → chunk-DF7JA72E.mjs} +1 -1
  149. package/dist/{chunk-AJRVDP2H.mjs → chunk-E5UKLSJZ.mjs} +3 -3
  150. package/dist/{chunk-MBMXYJJV.mjs → chunk-E7NEHHXV.mjs} +7 -3
  151. package/dist/{chunk-VKID2D2I.mjs → chunk-EDLCGYIO.mjs} +13 -8
  152. package/dist/{chunk-BUMAMSTZ.mjs → chunk-ELGEOM7I.mjs} +1 -1
  153. package/dist/{chunk-DYT7BG5I.mjs → chunk-F3YTWO3T.mjs} +1 -1
  154. package/dist/{chunk-VF2ATYN3.mjs → chunk-GH67YXG6.mjs} +1 -1
  155. package/dist/{chunk-WJLKJMKR.mjs → chunk-GUTDFUNF.mjs} +4 -4
  156. package/dist/{chunk-6SECQ2ZF.mjs → chunk-HC4VVCWY.mjs} +2 -2
  157. package/dist/{chunk-A3A6KNQN.mjs → chunk-HEDQPK4I.mjs} +1 -1
  158. package/dist/{chunk-GQYFLP3D.mjs → chunk-IVSRW4HS.mjs} +1 -1
  159. package/dist/{chunk-KOO4WITD.mjs → chunk-KSUWPU2F.mjs} +1 -1
  160. package/dist/{chunk-WBOOUHSS.mjs → chunk-LIS6I5UP.mjs} +1 -1
  161. package/dist/{chunk-X4G6APW6.mjs → chunk-LNPKGWBG.mjs} +1 -1
  162. package/dist/{chunk-T2KCAHOS.mjs → chunk-LOBLCFMN.mjs} +1 -1
  163. package/dist/{chunk-ELXBDILQ.mjs → chunk-LPV4NJJK.mjs} +2 -2
  164. package/dist/{chunk-Y2NS74WS.mjs → chunk-M3C7XM2M.mjs} +53 -99
  165. package/dist/{chunk-BRKYVJVV.mjs → chunk-MEPSKGBO.mjs} +1 -1
  166. package/dist/{chunk-TBNZHU6C.mjs → chunk-MVMGPZN6.mjs} +2 -2
  167. package/dist/{chunk-YJ7I257J.mjs → chunk-NHDI3VQB.mjs} +15 -1
  168. package/dist/{chunk-Z6SFHN6T.mjs → chunk-NJG7DHVF.mjs} +1 -1
  169. package/dist/{chunk-RYZC432S.mjs → chunk-NLZY4TXU.mjs} +1 -1
  170. package/dist/{chunk-ZZ2R6KZ3.mjs → chunk-OLVJFKXS.mjs} +1 -1
  171. package/dist/{chunk-AJ7ZDNBT.mjs → chunk-QDAZGZUF.mjs} +4 -3
  172. package/dist/{chunk-JT7HKXRB.mjs → chunk-QOLWA2PW.mjs} +1 -1
  173. package/dist/{chunk-WYEUNUTP.mjs → chunk-QXDGGOLC.mjs} +38 -25
  174. package/dist/{chunk-JMOZEC77.mjs → chunk-RJNLAH76.mjs} +1 -1
  175. package/dist/{chunk-WF2XDFRK.mjs → chunk-RMRS44MQ.mjs} +1 -1
  176. package/dist/chunk-SAWUXP3A.mjs +1114 -0
  177. package/dist/{chunk-OB4JUQ3O.mjs → chunk-TS7DGUIR.mjs} +1 -1
  178. package/dist/{chunk-AV4EMIRH.mjs → chunk-UBUXUMER.mjs} +1 -1
  179. package/dist/{chunk-IRRY3CRZ.mjs → chunk-ULGNQPNE.mjs} +1 -1
  180. package/dist/{chunk-7LWRKMF5.mjs → chunk-UNNRUJTM.mjs} +1 -1
  181. package/dist/{chunk-TB6SD2FT.mjs → chunk-UQ4742ET.mjs} +1 -1
  182. package/dist/{chunk-MX6HRKMI.mjs → chunk-VJBUCITV.mjs} +1 -1
  183. package/dist/{chunk-2UYENBLV.mjs → chunk-YMYIEVZP.mjs} +1 -1
  184. package/dist/{chunk-SOYNZDVY.mjs → chunk-YTXRIXNZ.mjs} +8 -1
  185. package/dist/{chunk-YFZ3ELX5.mjs → chunk-ZIMY2QUM.mjs} +2 -2
  186. package/dist/{chunk-Z4VHZ7B5.mjs → chunk-ZR6HSEAB.mjs} +1 -1
  187. package/dist/fonts.d.mts +1 -7
  188. package/dist/fonts.d.ts +1 -7
  189. package/dist/fonts.js +0 -2
  190. package/dist/fonts.mjs +1 -2
  191. package/dist/{index-wt-orHUi.d.ts → index-CY34hxPN.d.mts} +1 -0
  192. package/dist/{index-wt-orHUi.d.mts → index-CY34hxPN.d.ts} +1 -0
  193. package/dist/index.d.mts +7 -3
  194. package/dist/index.d.ts +7 -3
  195. package/dist/index.js +1517 -761
  196. package/dist/index.mjs +54 -52
  197. package/package.json +3 -3
  198. package/src/components/Accordion/Accordion.tsx +20 -0
  199. package/src/components/Button/Button.tsx +29 -26
  200. package/src/components/ConfirmDialog/ConfirmDialog.tsx +47 -31
  201. package/src/components/CurrencyInput/CurrencyInput.tsx +4 -7
  202. package/src/components/IconPicker/IconPicker.tsx +124 -112
  203. package/src/components/ImageUpload/ImageUpload.tsx +10 -3
  204. package/src/components/ListItem/ListItem.tsx +43 -28
  205. package/src/components/Pressable/Pressable.tsx +20 -8
  206. package/src/components/SelectableCard/SelectableCard.tsx +304 -0
  207. package/src/components/SelectableCard/index.ts +1 -0
  208. package/src/components/Sheet/Sheet.tsx +72 -173
  209. package/src/components/Skeleton/Skeleton.tsx +5 -2
  210. package/src/components/Stats/Stats.tsx +254 -0
  211. package/src/components/Stats/index.ts +2 -0
  212. package/src/components/Text/Text.tsx +4 -2
  213. package/src/fonts.ts +0 -7
  214. package/src/index.ts +5 -0
  215. package/src/theme/colorUtils.ts +9 -0
  216. package/src/theme/colors.ts +7 -0
  217. package/src/theme/types.ts +4 -1
  218. package/src/utils/curatedIcons.ts +698 -135
  219. package/src/utils/fontGuard.ts +2 -1
  220. package/dist/chunk-53Z3NYGE.mjs +0 -742
@@ -1,742 +0,0 @@
1
- import { selectionAsync, impactMedium } from './chunk-EJ7ZPXOH.mjs';
2
- import { RADIUS } from './chunk-QY3X2UYR.mjs';
3
- import { renderIcon } from './chunk-KA7LTET3.mjs';
4
- import { useTheme } from './chunk-SOYNZDVY.mjs';
5
- import { s, vs, ms } from './chunk-2CE3TQVY.mjs';
6
- import React, { useRef, useState, useId, useMemo, useEffect, useCallback } from 'react';
7
- import { Dimensions, StyleSheet, TouchableOpacity, View, Text } from 'react-native';
8
- import { ScrollView } from 'react-native-gesture-handler';
9
- import { BottomSheetBackdrop, BottomSheetModal, BottomSheetScrollView } from '@gorhom/bottom-sheet';
10
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
11
-
12
- // src/utils/curatedIcons.ts
13
- var CURATED_ICONS = [
14
- {
15
- name: "food",
16
- label: "Food",
17
- labelEs: "Comida",
18
- categoryIcon: "coffee",
19
- icons: [
20
- // Bebidas
21
- "coffee",
22
- "wine-glass",
23
- "beer",
24
- "cocktail",
25
- "mug-hot",
26
- "glass-cheers",
27
- "wine",
28
- // Comidas
29
- "restaurant",
30
- "hamburger",
31
- "pizza-slice",
32
- "ice-cream",
33
- "cake",
34
- "egg",
35
- "fish",
36
- "bread-slice",
37
- "cookie",
38
- "cheese",
39
- "carrot",
40
- "hotdog",
41
- // Cocina / utilidades
42
- "utensils",
43
- // Delivery / pedidos
44
- "shopping-bag",
45
- "clock",
46
- "star",
47
- "heart",
48
- "map-pin",
49
- "phone"
50
- ]
51
- },
52
- {
53
- name: "sports",
54
- label: "Sports",
55
- labelEs: "Deportes",
56
- categoryIcon: "activity",
57
- icons: [
58
- // Deportes específicos
59
- "futbol",
60
- "dumbbell",
61
- "running",
62
- "bicycle",
63
- "heartbeat",
64
- "fitness-center",
65
- // Competencia / logros
66
- "target",
67
- "award",
68
- "flag",
69
- "star",
70
- "zap",
71
- // Bienestar
72
- "heart",
73
- "clock",
74
- "activity",
75
- "sun",
76
- "user",
77
- "users"
78
- ]
79
- },
80
- {
81
- name: "business",
82
- label: "Business",
83
- labelEs: "Negocios",
84
- categoryIcon: "briefcase",
85
- icons: [
86
- "shopping-cart",
87
- "shopping-bag",
88
- "credit-card",
89
- "dollar-sign",
90
- "percent",
91
- "briefcase",
92
- "truck",
93
- "package",
94
- "gift",
95
- "bar-chart",
96
- "bar-chart-2",
97
- "pie-chart",
98
- "trending-up",
99
- "trending-down",
100
- "activity",
101
- "tag",
102
- "bookmark",
103
- "pocket"
104
- ]
105
- },
106
- {
107
- name: "objects",
108
- label: "Objects",
109
- labelEs: "Objetos",
110
- categoryIcon: "folder",
111
- icons: [
112
- "file",
113
- "file-text",
114
- "file-plus",
115
- "file-minus",
116
- "folder",
117
- "folder-plus",
118
- "folder-minus",
119
- "lock",
120
- "unlock",
121
- "key",
122
- "shield",
123
- "shield-off",
124
- "settings",
125
- "sliders",
126
- "toggle-left",
127
- "toggle-right",
128
- "tool",
129
- "printer",
130
- "database",
131
- "server",
132
- "hard-drive",
133
- "cpu",
134
- "paperclip",
135
- "aperture",
136
- "box",
137
- "radio"
138
- ]
139
- },
140
- {
141
- name: "status",
142
- label: "Status",
143
- labelEs: "Estado",
144
- categoryIcon: "alert-circle",
145
- icons: [
146
- "alert-circle",
147
- "alert-triangle",
148
- "alert-octagon",
149
- "info",
150
- "help-circle",
151
- "bell",
152
- "bell-off",
153
- "eye",
154
- "eye-off",
155
- "flag",
156
- "zap",
157
- "zap-off",
158
- "loader",
159
- "clock",
160
- "watch"
161
- ]
162
- },
163
- {
164
- name: "actions",
165
- label: "Actions",
166
- labelEs: "Acciones",
167
- categoryIcon: "edit-3",
168
- icons: [
169
- "plus",
170
- "plus-circle",
171
- "plus-square",
172
- "minus",
173
- "minus-circle",
174
- "minus-square",
175
- "x",
176
- "x-circle",
177
- "x-square",
178
- "x-octagon",
179
- "check",
180
- "check-circle",
181
- "check-square",
182
- "edit",
183
- "edit-2",
184
- "edit-3",
185
- "trash",
186
- "trash-2",
187
- "copy",
188
- "clipboard",
189
- "scissors",
190
- "download",
191
- "download-cloud",
192
- "upload",
193
- "upload-cloud",
194
- "share",
195
- "share-2",
196
- "link",
197
- "link-2",
198
- "search",
199
- "zoom-in",
200
- "zoom-out",
201
- "save",
202
- "archive",
203
- "log-in",
204
- "log-out",
205
- "power",
206
- "refresh-cw",
207
- "rotate-cw",
208
- "slash"
209
- ]
210
- },
211
- {
212
- name: "communication",
213
- label: "Communication",
214
- labelEs: "Comunicaci\xF3n",
215
- categoryIcon: "message-circle",
216
- icons: [
217
- "mail",
218
- "message-circle",
219
- "message-square",
220
- "send",
221
- "phone",
222
- "phone-call",
223
- "phone-incoming",
224
- "phone-outgoing",
225
- "phone-missed",
226
- "phone-off",
227
- "phone-forwarded",
228
- "at-sign",
229
- "inbox",
230
- "user",
231
- "user-plus",
232
- "user-minus",
233
- "user-check",
234
- "user-x",
235
- "users",
236
- "smile",
237
- "frown",
238
- "meh",
239
- "heart",
240
- "thumbs-up",
241
- "thumbs-down",
242
- "star",
243
- "award"
244
- ]
245
- },
246
- {
247
- name: "navigation",
248
- label: "Navigation",
249
- labelEs: "Navegaci\xF3n",
250
- categoryIcon: "compass",
251
- icons: [
252
- "arrow-up",
253
- "arrow-down",
254
- "arrow-left",
255
- "arrow-right",
256
- "arrow-up-left",
257
- "arrow-up-right",
258
- "arrow-down-left",
259
- "arrow-down-right",
260
- "chevron-up",
261
- "chevron-down",
262
- "chevron-left",
263
- "chevron-right",
264
- "chevrons-up",
265
- "chevrons-down",
266
- "chevrons-left",
267
- "chevrons-right",
268
- "corner-up-left",
269
- "corner-up-right",
270
- "corner-down-left",
271
- "corner-down-right",
272
- "corner-left-up",
273
- "corner-left-down",
274
- "corner-right-up",
275
- "corner-right-down",
276
- "refresh-cw",
277
- "refresh-ccw",
278
- "rotate-cw",
279
- "rotate-ccw",
280
- "navigation",
281
- "navigation-2",
282
- "compass",
283
- "map",
284
- "map-pin",
285
- "target",
286
- "crosshair",
287
- "home",
288
- "maximize",
289
- "maximize-2",
290
- "minimize",
291
- "minimize-2",
292
- "external-link",
293
- "move",
294
- "anchor"
295
- ]
296
- },
297
- {
298
- name: "media",
299
- label: "Media",
300
- labelEs: "Medios",
301
- categoryIcon: "image",
302
- icons: [
303
- "image",
304
- "film",
305
- "video",
306
- "video-off",
307
- "play",
308
- "play-circle",
309
- "pause",
310
- "pause-circle",
311
- "square",
312
- "stop-circle",
313
- "music",
314
- "headphones",
315
- "speaker",
316
- "camera",
317
- "camera-off",
318
- "mic",
319
- "mic-off",
320
- "volume",
321
- "volume-1",
322
- "volume-2",
323
- "volume-x",
324
- "fast-forward",
325
- "rewind",
326
- "skip-forward",
327
- "skip-back",
328
- "repeat",
329
- "shuffle",
330
- "disc"
331
- ]
332
- },
333
- {
334
- name: "layout",
335
- label: "Layout",
336
- labelEs: "Dise\xF1o",
337
- categoryIcon: "grid",
338
- icons: [
339
- "menu",
340
- "more-horizontal",
341
- "more-vertical",
342
- "grid",
343
- "columns",
344
- "sidebar",
345
- "layout",
346
- "list",
347
- "align-left",
348
- "align-center",
349
- "align-right",
350
- "align-justify",
351
- "bold",
352
- "italic",
353
- "underline",
354
- "type",
355
- "filter",
356
- "crop",
357
- "layers",
358
- "hash",
359
- "table",
360
- "trello",
361
- "circle",
362
- "square",
363
- "triangle",
364
- "hexagon",
365
- "octagon",
366
- "feather",
367
- "pen-tool"
368
- ]
369
- },
370
- {
371
- name: "nature",
372
- label: "Nature",
373
- labelEs: "Naturaleza",
374
- categoryIcon: "sun",
375
- icons: [
376
- "sun",
377
- "sunrise",
378
- "sunset",
379
- "moon",
380
- "cloud",
381
- "cloud-drizzle",
382
- "cloud-lightning",
383
- "cloud-off",
384
- "cloud-rain",
385
- "cloud-snow",
386
- "wind",
387
- "umbrella",
388
- "thermometer",
389
- "droplet",
390
- "life-buoy"
391
- ]
392
- },
393
- {
394
- name: "brands",
395
- label: "Brands",
396
- labelEs: "Marcas",
397
- categoryIcon: "globe",
398
- icons: [
399
- "github",
400
- "gitlab",
401
- "twitter",
402
- "facebook",
403
- "instagram",
404
- "linkedin",
405
- "youtube",
406
- "dribbble",
407
- "twitch",
408
- "slack",
409
- "figma",
410
- "framer",
411
- "chrome",
412
- "codepen",
413
- "codesandbox",
414
- "globe",
415
- "rss",
416
- "airplay",
417
- "cast",
418
- "bluetooth",
419
- "wifi",
420
- "wifi-off",
421
- "battery",
422
- "battery-charging",
423
- "monitor",
424
- "tablet",
425
- "smartphone",
426
- "tv"
427
- ]
428
- }
429
- ];
430
- var ALL_CURATED_ICONS = [
431
- ...new Set(CURATED_ICONS.flatMap((c) => c.icons))
432
- ];
433
-
434
- // src/components/IconPicker/IconPicker.tsx
435
- var NUM_COLUMNS = 6;
436
- var GAP = 6;
437
- var TRIGGER_SIZE = s(56);
438
- var SCREEN_HEIGHT = Dimensions.get("window").height;
439
- function IconCell({ name, selected, size, onPress }) {
440
- const { colors } = useTheme();
441
- const handlePress = () => {
442
- selectionAsync();
443
- onPress();
444
- };
445
- const iconColor = selected ? colors.primaryForeground : colors.foreground;
446
- const bg = selected ? colors.primary : "transparent";
447
- return /* @__PURE__ */ React.createElement(
448
- TouchableOpacity,
449
- {
450
- onPress: handlePress,
451
- activeOpacity: 0.6,
452
- touchSoundDisabled: true,
453
- accessibilityRole: "button",
454
- accessibilityState: { selected },
455
- accessibilityLabel: name,
456
- style: [styles.cell, { width: size, height: size, backgroundColor: bg }]
457
- },
458
- renderIcon(name, ms(20), iconColor)
459
- );
460
- }
461
- var IconCellMemo = React.memo(IconCell);
462
- function IconPicker({
463
- value,
464
- onChange,
465
- label,
466
- error,
467
- hint,
468
- disabled = false,
469
- numColumns = NUM_COLUMNS,
470
- gap = GAP,
471
- style
472
- }) {
473
- const { colors } = useTheme();
474
- const insets = useSafeAreaInsets();
475
- const sheetRef = useRef(null);
476
- const catScrollRef = useRef(null);
477
- const [open, setOpen] = useState(false);
478
- const [activeCategory, setActiveCategory] = useState(null);
479
- const [containerWidth, setContainerWidth] = useState(() => Dimensions.get("window").width - s(16) * 2);
480
- const sheetName = useId();
481
- const activeIcons = useMemo(() => {
482
- if (activeCategory) {
483
- return CURATED_ICONS.find((c) => c.name === activeCategory)?.icons ?? ALL_CURATED_ICONS;
484
- }
485
- return ALL_CURATED_ICONS;
486
- }, [activeCategory]);
487
- const gapPx = s(gap);
488
- const cellSize = containerWidth > 0 ? Math.floor((containerWidth - gapPx * (numColumns - 1)) / numColumns) : 0;
489
- const rows = useMemo(() => {
490
- const result = [];
491
- for (let i = 0; i < activeIcons.length; i += numColumns) {
492
- result.push(activeIcons.slice(i, i + numColumns));
493
- }
494
- return result;
495
- }, [activeIcons, numColumns]);
496
- useEffect(() => {
497
- if (open) {
498
- impactMedium();
499
- sheetRef.current?.present();
500
- } else {
501
- sheetRef.current?.dismiss();
502
- }
503
- }, [open]);
504
- const handleSelect = useCallback(
505
- (iconName) => {
506
- onChange(iconName);
507
- setOpen(false);
508
- setActiveCategory(null);
509
- },
510
- [onChange]
511
- );
512
- const handleOpen = useCallback(() => {
513
- if (disabled) return;
514
- setActiveCategory(null);
515
- setOpen(true);
516
- }, [disabled]);
517
- const handleClose = useCallback(() => {
518
- setOpen(false);
519
- setActiveCategory(null);
520
- }, []);
521
- const renderBackdrop = useCallback(
522
- (props) => /* @__PURE__ */ React.createElement(BottomSheetBackdrop, { ...props, disappearsOnIndex: -1, appearsOnIndex: 0, pressBehavior: "close" }),
523
- []
524
- );
525
- const selectedIcon = value ? renderIcon(value, ms(28), colors.foreground) : null;
526
- return /* @__PURE__ */ React.createElement(View, { style: [styles.triggerContainer, style] }, label ? /* @__PURE__ */ React.createElement(Text, { style: [styles.triggerLabel, { color: colors.foreground }], allowFontScaling: true }, label) : null, /* @__PURE__ */ React.createElement(
527
- TouchableOpacity,
528
- {
529
- onPress: handleOpen,
530
- disabled,
531
- activeOpacity: 0.7,
532
- touchSoundDisabled: true,
533
- accessibilityRole: "button",
534
- accessibilityLabel: label ?? "Seleccionar icono",
535
- accessibilityState: { disabled },
536
- style: [
537
- styles.trigger,
538
- {
539
- backgroundColor: disabled ? colors.surface : colors.background,
540
- width: TRIGGER_SIZE,
541
- height: TRIGGER_SIZE,
542
- borderColor: error ? colors.destructive : value ? colors.primary : colors.border
543
- },
544
- disabled && styles.triggerDisabled
545
- ]
546
- },
547
- selectedIcon ?? renderIcon("plus", ms(24), colors.foregroundMuted)
548
- ), error ? /* @__PURE__ */ React.createElement(
549
- Text,
550
- {
551
- style: [styles.helperText, { color: colors.destructive }],
552
- allowFontScaling: true,
553
- accessibilityLiveRegion: "polite"
554
- },
555
- error
556
- ) : null, !error && hint ? /* @__PURE__ */ React.createElement(Text, { style: [styles.helperText, { color: colors.foregroundMuted }], allowFontScaling: true }, hint) : null, /* @__PURE__ */ React.createElement(
557
- BottomSheetModal,
558
- {
559
- ref: sheetRef,
560
- name: sheetName,
561
- onDismiss: handleClose,
562
- enableDynamicSizing: true,
563
- maxDynamicContentSize: SCREEN_HEIGHT * 0.7,
564
- backdropComponent: renderBackdrop,
565
- backgroundStyle: [styles.sheetBackground, { backgroundColor: colors.card }],
566
- handleIndicatorStyle: [styles.handle, { backgroundColor: colors.border }],
567
- enablePanDownToClose: true,
568
- topInset: insets.top,
569
- android_keyboardInputMode: "adjustPan"
570
- },
571
- /* @__PURE__ */ React.createElement(
572
- BottomSheetScrollView,
573
- {
574
- contentContainerStyle: styles.sheetContent,
575
- showsVerticalScrollIndicator: true
576
- },
577
- /* @__PURE__ */ React.createElement(Text, { style: [styles.sectionLabel, { color: colors.foregroundSubtle }], allowFontScaling: true }, "Categor\xEDas"),
578
- /* @__PURE__ */ React.createElement(
579
- ScrollView,
580
- {
581
- ref: catScrollRef,
582
- horizontal: true,
583
- showsHorizontalScrollIndicator: false,
584
- contentContainerStyle: styles.categoryStrip,
585
- style: styles.categoryScroll
586
- },
587
- /* @__PURE__ */ React.createElement(
588
- TouchableOpacity,
589
- {
590
- onPress: () => setActiveCategory(null),
591
- activeOpacity: 0.7,
592
- touchSoundDisabled: true,
593
- accessibilityRole: "button",
594
- accessibilityLabel: "Todos",
595
- accessibilityState: { selected: activeCategory === null },
596
- style: [
597
- styles.categoryChip,
598
- {
599
- backgroundColor: activeCategory === null ? colors.primary : colors.surface,
600
- borderColor: activeCategory === null ? colors.primary : colors.border
601
- }
602
- ]
603
- },
604
- /* @__PURE__ */ React.createElement(View, { style: styles.categoryChipInner }, renderIcon("grid", ms(14), activeCategory === null ? colors.primaryForeground : colors.foregroundSubtle), /* @__PURE__ */ React.createElement(
605
- Text,
606
- {
607
- style: [
608
- styles.categoryChipText,
609
- { color: activeCategory === null ? colors.primaryForeground : colors.foreground }
610
- ],
611
- allowFontScaling: true,
612
- numberOfLines: 1
613
- },
614
- "Todos"
615
- ))
616
- ),
617
- CURATED_ICONS.map((cat) => /* @__PURE__ */ React.createElement(
618
- TouchableOpacity,
619
- {
620
- key: cat.name,
621
- onPress: () => setActiveCategory(cat.name),
622
- activeOpacity: 0.7,
623
- touchSoundDisabled: true,
624
- accessibilityRole: "button",
625
- accessibilityLabel: cat.labelEs,
626
- accessibilityState: { selected: activeCategory === cat.name },
627
- style: [
628
- styles.categoryChip,
629
- {
630
- backgroundColor: activeCategory === cat.name ? colors.primary : colors.surface,
631
- borderColor: activeCategory === cat.name ? colors.primary : colors.border
632
- }
633
- ]
634
- },
635
- /* @__PURE__ */ React.createElement(View, { style: styles.categoryChipInner }, renderIcon(cat.categoryIcon, ms(14), activeCategory === cat.name ? colors.primaryForeground : colors.foregroundSubtle), /* @__PURE__ */ React.createElement(
636
- Text,
637
- {
638
- style: [
639
- styles.categoryChipText,
640
- { color: activeCategory === cat.name ? colors.primaryForeground : colors.foreground }
641
- ],
642
- allowFontScaling: true,
643
- numberOfLines: 1
644
- },
645
- cat.labelEs
646
- ))
647
- ))
648
- ),
649
- /* @__PURE__ */ React.createElement(View, { style: [styles.separator, { backgroundColor: colors.border }] }),
650
- /* @__PURE__ */ React.createElement(View, { style: styles.gridContainer, onLayout: (e) => setContainerWidth(e.nativeEvent.layout.width) }, cellSize > 0 ? rows.map((row, i) => /* @__PURE__ */ React.createElement(View, { key: row[0] ?? `row-${i}`, style: [styles.row, { marginBottom: gapPx }] }, row.map((name) => /* @__PURE__ */ React.createElement(
651
- IconCellMemo,
652
- {
653
- key: name,
654
- name,
655
- selected: value === name,
656
- size: cellSize,
657
- onPress: () => handleSelect(name)
658
- }
659
- )), Array.from({ length: numColumns - row.length }).map((_, j) => /* @__PURE__ */ React.createElement(View, { key: `spacer-${j}`, style: { width: cellSize, height: cellSize } })))) : null)
660
- )
661
- ));
662
- }
663
- var styles = StyleSheet.create({
664
- triggerContainer: {
665
- gap: vs(8)
666
- },
667
- triggerLabel: {
668
- fontFamily: "Sohne-Medium",
669
- fontSize: ms(14)
670
- },
671
- trigger: {
672
- borderRadius: RADIUS.md,
673
- borderWidth: 1,
674
- alignItems: "center",
675
- justifyContent: "center"
676
- },
677
- triggerDisabled: {
678
- opacity: 0.6
679
- },
680
- helperText: {
681
- fontFamily: "Sohne-Regular",
682
- fontSize: ms(13)
683
- },
684
- sheetBackground: {
685
- borderTopLeftRadius: ms(16),
686
- borderTopRightRadius: ms(16)
687
- },
688
- handle: {
689
- width: s(36),
690
- height: vs(4),
691
- borderRadius: ms(2)
692
- },
693
- sheetContent: {
694
- paddingHorizontal: s(16),
695
- paddingBottom: vs(24)
696
- },
697
- sectionLabel: {
698
- fontFamily: "Sohne-Medium",
699
- fontSize: ms(12),
700
- marginBottom: vs(8),
701
- textTransform: "uppercase",
702
- letterSpacing: 0.5
703
- },
704
- categoryScroll: {
705
- flexGrow: 0,
706
- flexShrink: 0
707
- },
708
- categoryStrip: {
709
- gap: s(8)
710
- },
711
- categoryChip: {
712
- borderRadius: RADIUS.full,
713
- borderWidth: 1,
714
- paddingVertical: vs(6),
715
- paddingHorizontal: s(12)
716
- },
717
- categoryChipInner: {
718
- flexDirection: "row",
719
- alignItems: "center",
720
- gap: s(6)
721
- },
722
- categoryChipText: {
723
- fontFamily: "Sohne-Medium",
724
- fontSize: ms(12)
725
- },
726
- separator: {
727
- height: StyleSheet.hairlineWidth,
728
- marginVertical: vs(12)
729
- },
730
- gridContainer: {},
731
- row: {
732
- flexDirection: "row",
733
- gap: GAP
734
- },
735
- cell: {
736
- borderRadius: RADIUS.md,
737
- alignItems: "center",
738
- justifyContent: "center"
739
- }
740
- });
741
-
742
- export { IconPicker };