@onehat/ui 0.3.381 → 0.4.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 (440) hide show
  1. package/package.json +37 -9
  2. package/src/Components/Accordion/Accordion.js +22 -17
  3. package/src/Components/Blank.js +1 -3
  4. package/src/Components/Buttons/BackButton.js +21 -12
  5. package/src/Components/Buttons/Button.js +65 -13
  6. package/src/Components/Buttons/CartButtonWithBadge.js +14 -6
  7. package/src/Components/Buttons/IconButton.js +31 -74
  8. package/src/Components/Buttons/PlusMinusButton.js +34 -21
  9. package/src/Components/Buttons/ReloadButton.js +7 -8
  10. package/src/Components/Buttons/SquareButton.js +41 -55
  11. package/src/Components/Container/Container.js +55 -16
  12. package/src/Components/Container/ScreenContainer.js +26 -16
  13. package/src/Components/Container/Splitter.js +38 -25
  14. package/src/Components/Editor/Editor.js +3 -2
  15. package/src/Components/Editor/InlineEditor.js +38 -32
  16. package/src/Components/Filter/DateRange.js +37 -18
  17. package/src/Components/Filter/NumberRange.js +87 -83
  18. package/src/Components/Form/Field/CKEditor/CKEditor.js +4 -4
  19. package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +9 -6
  20. package/src/Components/Form/Field/Color.js +95 -86
  21. package/src/Components/Form/Field/Combo/Combo.js +347 -284
  22. package/src/Components/Form/Field/Combo/PageSizeCombo.js +4 -7
  23. package/src/Components/Form/Field/Date.js +276 -312
  24. package/src/Components/Form/Field/DisplayField.js +11 -5
  25. package/src/Components/Form/Field/File.js +26 -32
  26. package/src/Components/Form/Field/FormikForm.js +1018 -0
  27. package/src/Components/Form/Field/Input.js +91 -41
  28. package/src/Components/Form/Field/Json.js +25 -21
  29. package/src/Components/Form/Field/Number.js +70 -51
  30. package/src/Components/Form/Field/RadioGroup/RadioGroup.js +4 -6
  31. package/src/Components/Form/Field/Select/PageSizeSelect.js +33 -0
  32. package/src/Components/Form/Field/Select/Select.js +109 -0
  33. package/src/Components/Form/Field/Slider.js +38 -30
  34. package/src/Components/Form/Field/Tag/Tag.js +88 -72
  35. package/src/Components/Form/Field/Tag/ValueBox.js +25 -20
  36. package/src/Components/Form/Field/Text.js +21 -12
  37. package/src/Components/Form/Field/TextArea.js +32 -15
  38. package/src/Components/Form/Field/Toggle.js +42 -24
  39. package/src/Components/Form/FieldSet.js +77 -54
  40. package/src/Components/Form/Form.js +491 -268
  41. package/src/Components/Form/Label.js +28 -17
  42. package/src/Components/Gluestack/accordion/index.tsx +394 -0
  43. package/src/Components/Gluestack/actionsheet/index.tsx +619 -0
  44. package/src/Components/Gluestack/alert/index.tsx +310 -0
  45. package/src/Components/Gluestack/alert-dialog/index.tsx +295 -0
  46. package/src/Components/Gluestack/avatar/index.tsx +190 -0
  47. package/src/Components/Gluestack/badge/index.tsx +272 -0
  48. package/src/Components/Gluestack/bottomsheet/index.tsx +294 -0
  49. package/src/Components/Gluestack/box/index.tsx +19 -0
  50. package/src/Components/Gluestack/box/index.web.tsx +18 -0
  51. package/src/Components/Gluestack/box/styles.tsx +10 -0
  52. package/src/Components/Gluestack/button/index.tsx +494 -0
  53. package/src/Components/Gluestack/card/index.tsx +23 -0
  54. package/src/Components/Gluestack/card/index.web.tsx +22 -0
  55. package/src/Components/Gluestack/card/styles.tsx +20 -0
  56. package/src/Components/Gluestack/center/index.tsx +22 -0
  57. package/src/Components/Gluestack/center/index.web.tsx +19 -0
  58. package/src/Components/Gluestack/center/styles.tsx +8 -0
  59. package/src/Components/Gluestack/checkbox/index.tsx +305 -0
  60. package/src/Components/Gluestack/divider/index.tsx +44 -0
  61. package/src/Components/Gluestack/drawer/index.tsx +354 -0
  62. package/src/Components/Gluestack/fab/index.tsx +286 -0
  63. package/src/Components/Gluestack/flat-list/index.tsx +2 -0
  64. package/src/Components/Gluestack/form-control/index.tsx +527 -0
  65. package/src/Components/Gluestack/gluestack-ui-provider/config.ts +332 -0
  66. package/src/Components/Gluestack/gluestack-ui-provider/index.tsx +47 -0
  67. package/src/Components/Gluestack/gluestack-ui-provider/index.web.tsx +94 -0
  68. package/src/Components/Gluestack/gluestack-ui-provider/script.ts +19 -0
  69. package/src/Components/Gluestack/grid/index.tsx +341 -0
  70. package/src/Components/Gluestack/grid/index.web.tsx +65 -0
  71. package/src/Components/Gluestack/grid/styles.tsx +15 -0
  72. package/src/Components/Gluestack/heading/index.tsx +212 -0
  73. package/src/Components/Gluestack/heading/index.web.tsx +203 -0
  74. package/src/Components/Gluestack/heading/styles.tsx +43 -0
  75. package/src/Components/Gluestack/hstack/index.tsx +23 -0
  76. package/src/Components/Gluestack/hstack/index.web.tsx +22 -0
  77. package/src/Components/Gluestack/hstack/styles.tsx +25 -0
  78. package/src/Components/Gluestack/image/index.tsx +52 -0
  79. package/src/Components/Gluestack/image-background/index.tsx +21 -0
  80. package/src/Components/Gluestack/index.js +116 -0
  81. package/src/Components/Gluestack/input/index.tsx +287 -0
  82. package/src/Components/Gluestack/input-accessory-view/index.tsx +2 -0
  83. package/src/Components/Gluestack/keyboard-avoiding-view/index.tsx +2 -0
  84. package/src/Components/Gluestack/link/index.tsx +107 -0
  85. package/src/Components/Gluestack/menu/index.tsx +210 -0
  86. package/src/Components/Gluestack/modal/index.tsx +279 -0
  87. package/src/Components/Gluestack/popover/index.tsx +352 -0
  88. package/src/Components/Gluestack/portal/index.tsx +13 -0
  89. package/src/Components/Gluestack/pressable/index.tsx +46 -0
  90. package/src/Components/Gluestack/progress/index.tsx +164 -0
  91. package/src/Components/Gluestack/radio/index.tsx +304 -0
  92. package/src/Components/Gluestack/refresh-control/index.tsx +2 -0
  93. package/src/Components/Gluestack/safe-area-view/index.tsx +2 -0
  94. package/src/Components/Gluestack/scroll-view/index.tsx +2 -0
  95. package/src/Components/Gluestack/section-list/index.tsx +2 -0
  96. package/src/Components/Gluestack/select/index.tsx +335 -0
  97. package/src/Components/Gluestack/select/select-actionsheet.tsx +584 -0
  98. package/src/Components/Gluestack/skeleton/index.tsx +138 -0
  99. package/src/Components/Gluestack/skeleton/index.web.tsx +103 -0
  100. package/src/Components/Gluestack/skeleton/styles.tsx +35 -0
  101. package/src/Components/Gluestack/slider/index.tsx +283 -0
  102. package/src/Components/Gluestack/spinner/index.tsx +34 -0
  103. package/src/Components/Gluestack/status-bar/index.tsx +2 -0
  104. package/src/Components/Gluestack/switch/index.tsx +55 -0
  105. package/src/Components/Gluestack/table/index.tsx +200 -0
  106. package/src/Components/Gluestack/table/index.web.tsx +142 -0
  107. package/src/Components/Gluestack/table/styles.tsx +44 -0
  108. package/src/Components/Gluestack/text/index.tsx +48 -0
  109. package/src/Components/Gluestack/text/index.web.tsx +45 -0
  110. package/src/Components/Gluestack/text/styles.tsx +47 -0
  111. package/src/Components/Gluestack/textarea/index.tsx +108 -0
  112. package/src/Components/Gluestack/toast/index.tsx +225 -0
  113. package/src/Components/Gluestack/tooltip/index.tsx +125 -0
  114. package/src/Components/Gluestack/utils/use-break-point-value.ts +101 -0
  115. package/src/Components/Gluestack/view/index.tsx +2 -0
  116. package/src/Components/Gluestack/virtualized-list/index.tsx +2 -0
  117. package/src/Components/Gluestack/vstack/index.tsx +24 -0
  118. package/src/Components/Gluestack/vstack/index.web.tsx +23 -0
  119. package/src/Components/Gluestack/vstack/styles.tsx +25 -0
  120. package/src/Components/Grid/Grid.js +192 -135
  121. package/src/Components/Grid/GridHeaderRow.js +51 -59
  122. package/src/Components/Grid/GridRow.js +152 -58
  123. package/src/Components/Grid/HeaderColumnSelectorHandle.js +16 -10
  124. package/src/Components/Grid/HeaderReorderHandle.js +17 -13
  125. package/src/Components/Grid/HeaderResizeHandle.js +17 -13
  126. package/src/Components/Grid/NoRecordsFound.js +15 -18
  127. package/src/Components/Grid/RowDragHandle.js +9 -13
  128. package/src/Components/Hoc/Secondary/withSecondaryEditor.js +14 -9
  129. package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +14 -11
  130. package/src/Components/Hoc/withAlert.js +150 -200
  131. package/src/Components/Hoc/withBlank.js +4 -6
  132. package/src/Components/Hoc/withCollapsible.js +4 -3
  133. package/src/Components/Hoc/withComponent.js +33 -6
  134. package/src/Components/Hoc/withContextMenu.js +133 -141
  135. package/src/Components/Hoc/withData.js +5 -4
  136. package/src/Components/Hoc/withDnd.js +11 -9
  137. package/src/Components/Hoc/withDraggable.js +10 -10
  138. package/src/Components/Hoc/withEditor.js +18 -13
  139. package/src/Components/Hoc/withEvents.js +4 -6
  140. package/src/Components/Hoc/withFilters.js +524 -498
  141. package/src/Components/Hoc/withInlineEditor.js +7 -5
  142. package/src/Components/Hoc/withModal.js +79 -137
  143. package/src/Components/Hoc/withMultiSelection.js +4 -2
  144. package/src/Components/Hoc/withPdfButtons.js +109 -111
  145. package/src/Components/Hoc/withPresetButtons.js +49 -53
  146. package/src/Components/Hoc/withSelection.js +6 -5
  147. package/src/Components/Hoc/withSideEditor.js +12 -6
  148. package/src/Components/Hoc/withTooltip.js +18 -12
  149. package/src/Components/Hoc/withValue.js +6 -5
  150. package/src/Components/Hoc/withWindowedEditor.js +13 -11
  151. package/src/Components/Icons/AddressBook.js +7 -10
  152. package/src/Components/Icons/Alt.js +8 -15
  153. package/src/Components/Icons/AngleLeft.js +7 -14
  154. package/src/Components/Icons/AngleRight.js +7 -14
  155. package/src/Components/Icons/AnglesLeft.js +7 -14
  156. package/src/Components/Icons/AnglesRight.js +7 -14
  157. package/src/Components/Icons/Asterisk.js +7 -10
  158. package/src/Components/Icons/Ban.js +9 -14
  159. package/src/Components/Icons/Bars.js +7 -10
  160. package/src/Components/Icons/BarsStaggered.js +7 -10
  161. package/src/Components/Icons/Bell.js +7 -19
  162. package/src/Components/Icons/BigCircle.js +7 -14
  163. package/src/Components/Icons/Book.js +7 -10
  164. package/src/Components/Icons/BookOpen.js +7 -10
  165. package/src/Components/Icons/Bookmark.js +8 -17
  166. package/src/Components/Icons/Bug.js +7 -10
  167. package/src/Components/Icons/Building.js +7 -10
  168. package/src/Components/Icons/Calendar.js +7 -14
  169. package/src/Components/Icons/Calendar2.js +7 -14
  170. package/src/Components/Icons/CalendarDays.js +7 -14
  171. package/src/Components/Icons/Camera.js +7 -14
  172. package/src/Components/Icons/CaretDown.js +7 -14
  173. package/src/Components/Icons/CaretUp.js +7 -14
  174. package/src/Components/Icons/CartPlus.js +7 -10
  175. package/src/Components/Icons/CartShopping.js +7 -10
  176. package/src/Components/Icons/CashRegister.js +7 -10
  177. package/src/Components/Icons/Certificate.js +7 -10
  178. package/src/Components/Icons/ChartLine.js +7 -10
  179. package/src/Components/Icons/ChartPie.js +7 -10
  180. package/src/Components/Icons/Check.js +7 -10
  181. package/src/Components/Icons/CheckDouble.js +7 -10
  182. package/src/Components/Icons/ChevronDown.js +7 -10
  183. package/src/Components/Icons/ChevronLeft.js +7 -10
  184. package/src/Components/Icons/ChevronRight.js +7 -10
  185. package/src/Components/Icons/ChevronUp.js +7 -10
  186. package/src/Components/Icons/Circle.js +7 -10
  187. package/src/Components/Icons/CircleArrowRight.js +7 -10
  188. package/src/Components/Icons/CircleExclamation.js +7 -14
  189. package/src/Components/Icons/CircleInfo.js +7 -10
  190. package/src/Components/Icons/CircleQuestion.js +7 -10
  191. package/src/Components/Icons/CircleXmark.js +7 -10
  192. package/src/Components/Icons/CircleXmarkRegular.js +7 -10
  193. package/src/Components/Icons/Clipboard.js +7 -14
  194. package/src/Components/Icons/ClipboardCheck.js +7 -17
  195. package/src/Components/Icons/ClipboardList.js +7 -16
  196. package/src/Components/Icons/Clock.js +7 -10
  197. package/src/Components/Icons/ClockRegular.js +7 -10
  198. package/src/Components/Icons/ClockRotateLeft.js +7 -10
  199. package/src/Components/Icons/Clone.js +7 -10
  200. package/src/Components/Icons/Collapse.js +7 -14
  201. package/src/Components/Icons/Comment.js +7 -10
  202. package/src/Components/Icons/CommentDots.js +7 -10
  203. package/src/Components/Icons/CommentRegular.js +7 -10
  204. package/src/Components/Icons/Comments.js +7 -10
  205. package/src/Components/Icons/CommentsRegular.js +7 -10
  206. package/src/Components/Icons/Copyright.js +7 -10
  207. package/src/Components/Icons/Dot.js +10 -15
  208. package/src/Components/Icons/Download.js +11 -0
  209. package/src/Components/Icons/Duplicate.js +7 -14
  210. package/src/Components/Icons/Edit.js +7 -14
  211. package/src/Components/Icons/EllipsisHorizontal.js +7 -16
  212. package/src/Components/Icons/EllipsisVertical.js +7 -14
  213. package/src/Components/Icons/Envelope.js +7 -10
  214. package/src/Components/Icons/EnvelopeRegular.js +7 -10
  215. package/src/Components/Icons/Excel.js +7 -10
  216. package/src/Components/Icons/Exclamation.js +7 -10
  217. package/src/Components/Icons/Expand.js +7 -10
  218. package/src/Components/Icons/Eye.js +7 -14
  219. package/src/Components/Icons/EyeSlash.js +7 -10
  220. package/src/Components/Icons/File.js +7 -14
  221. package/src/Components/Icons/FloppyDiskRegular.js +7 -10
  222. package/src/Components/Icons/Folder.js +7 -10
  223. package/src/Components/Icons/FolderClosed.js +7 -10
  224. package/src/Components/Icons/FolderOpen.js +7 -10
  225. package/src/Components/Icons/FolderTree.js +7 -10
  226. package/src/Components/Icons/FullWidth.js +10 -25
  227. package/src/Components/Icons/Gauge.js +7 -17
  228. package/src/Components/Icons/Gear.js +7 -14
  229. package/src/Components/Icons/Gears.js +7 -10
  230. package/src/Components/Icons/Gift.js +7 -10
  231. package/src/Components/Icons/Grip.js +7 -14
  232. package/src/Components/Icons/GripLines.js +7 -14
  233. package/src/Components/Icons/GripLinesVertical.js +7 -14
  234. package/src/Components/Icons/GripVertical.js +7 -14
  235. package/src/Components/Icons/Hammer.js +7 -10
  236. package/src/Components/Icons/Hand.js +7 -10
  237. package/src/Components/Icons/HighPriority.js +7 -17
  238. package/src/Components/Icons/House.js +7 -10
  239. package/src/Components/Icons/Images.js +7 -10
  240. package/src/Components/Icons/Info.js +7 -10
  241. package/src/Components/Icons/ItunesNote.js +7 -10
  242. package/src/Components/Icons/Js.js +7 -16
  243. package/src/Components/Icons/Leaf.js +7 -10
  244. package/src/Components/Icons/Link.js +7 -9
  245. package/src/Components/Icons/List.js +7 -10
  246. package/src/Components/Icons/ListCheck.js +7 -10
  247. package/src/Components/Icons/LocationDot.js +7 -10
  248. package/src/Components/Icons/Loop.js +7 -14
  249. package/src/Components/Icons/Loop1.js +8 -13
  250. package/src/Components/Icons/LoopAll.js +8 -13
  251. package/src/Components/Icons/LowPriority.js +7 -17
  252. package/src/Components/Icons/MagnifyingGlass.js +7 -10
  253. package/src/Components/Icons/Maximize.js +7 -10
  254. package/src/Components/Icons/MedPriority.js +7 -17
  255. package/src/Components/Icons/Microphone.js +7 -10
  256. package/src/Components/Icons/Minimize.js +7 -10
  257. package/src/Components/Icons/Minus.js +7 -14
  258. package/src/Components/Icons/MobileScreenButton.js +7 -10
  259. package/src/Components/Icons/MoneyBill.js +7 -10
  260. package/src/Components/Icons/MoneyBillWave.js +7 -10
  261. package/src/Components/Icons/Mouth.js +10 -21
  262. package/src/Components/Icons/Music.js +7 -10
  263. package/src/Components/Icons/Na.js +7 -14
  264. package/src/Components/Icons/NoLoop.js +11 -13
  265. package/src/Components/Icons/NoReorderRows.js +17 -22
  266. package/src/Components/Icons/ObjectGroupRegular.js +7 -10
  267. package/src/Components/Icons/Pause.js +7 -10
  268. package/src/Components/Icons/Pdf.js +7 -10
  269. package/src/Components/Icons/Pencil.js +7 -14
  270. package/src/Components/Icons/Phone.js +7 -10
  271. package/src/Components/Icons/Play.js +7 -10
  272. package/src/Components/Icons/Plus.js +7 -14
  273. package/src/Components/Icons/Presentation.js +7 -16
  274. package/src/Components/Icons/Print.js +7 -14
  275. package/src/Components/Icons/Question.js +7 -10
  276. package/src/Components/Icons/Rate-.25x.js +12 -17
  277. package/src/Components/Icons/Rate-.5x.js +11 -16
  278. package/src/Components/Icons/Rate-.75x.js +8 -13
  279. package/src/Components/Icons/Rate-1.25x.js +8 -13
  280. package/src/Components/Icons/Rate-1.5x.js +8 -13
  281. package/src/Components/Icons/Rate-1.75x.js +8 -13
  282. package/src/Components/Icons/Rate-1x.js +11 -16
  283. package/src/Components/Icons/Rate-2x.js +8 -13
  284. package/src/Components/Icons/RateIcon-.25x.js +8 -13
  285. package/src/Components/Icons/RateIcon-.5x.js +11 -16
  286. package/src/Components/Icons/RateIcon-.75x.js +8 -13
  287. package/src/Components/Icons/RateIcon-1.25x.js +8 -13
  288. package/src/Components/Icons/RateIcon-1.5x.js +8 -13
  289. package/src/Components/Icons/RateIcon-1.75x.js +8 -13
  290. package/src/Components/Icons/RateIcon-1x.js +8 -13
  291. package/src/Components/Icons/RateIcon-2x.js +8 -13
  292. package/src/Components/Icons/RectangleXmark.js +7 -10
  293. package/src/Components/Icons/RectangleXmarkRegular.js +7 -10
  294. package/src/Components/Icons/ReorderRows.js +8 -13
  295. package/src/Components/Icons/RightFromBracket.js +7 -10
  296. package/src/Components/Icons/RightLeft.js +7 -10
  297. package/src/Components/Icons/RightToBracket.js +7 -10
  298. package/src/Components/Icons/Rotate.js +7 -14
  299. package/src/Components/Icons/RotateLeft.js +7 -10
  300. package/src/Components/Icons/RotateRight.js +7 -14
  301. package/src/Components/Icons/ScrewdriverWrench.js +7 -10
  302. package/src/Components/Icons/Scroll.js +7 -10
  303. package/src/Components/Icons/Share.js +7 -10
  304. package/src/Components/Icons/Shop.js +7 -10
  305. package/src/Components/Icons/SideBySide.js +7 -20
  306. package/src/Components/Icons/SortDown.js +7 -10
  307. package/src/Components/Icons/SortDownAlt.js +7 -10
  308. package/src/Components/Icons/SortUp.js +7 -10
  309. package/src/Components/Icons/SortUpAlt.js +7 -14
  310. package/src/Components/Icons/Square.js +7 -10
  311. package/src/Components/Icons/SquareCheck.js +7 -10
  312. package/src/Components/Icons/SquareCheckRegular.js +7 -10
  313. package/src/Components/Icons/SquareMinus.js +7 -14
  314. package/src/Components/Icons/SquareRegular.js +7 -10
  315. package/src/Components/Icons/Store.js +7 -10
  316. package/src/Components/Icons/Table.js +7 -16
  317. package/src/Components/Icons/ThumbsDown.js +7 -10
  318. package/src/Components/Icons/ThumbsDownRegular.js +7 -10
  319. package/src/Components/Icons/ThumbsUp.js +7 -10
  320. package/src/Components/Icons/ThumbsUpRegular.js +7 -10
  321. package/src/Components/Icons/Trash.js +7 -14
  322. package/src/Components/Icons/TrashCan.js +7 -14
  323. package/src/Components/Icons/TriangleExclamation.js +7 -14
  324. package/src/Components/Icons/Truck.js +7 -10
  325. package/src/Components/Icons/TruckFast.js +7 -10
  326. package/src/Components/Icons/Upload.js +11 -0
  327. package/src/Components/Icons/UploadDownload.js +11 -11
  328. package/src/Components/Icons/User.js +7 -10
  329. package/src/Components/Icons/UserGroup.js +7 -10
  330. package/src/Components/Icons/UserPlus.js +7 -10
  331. package/src/Components/Icons/UserSecret.js +7 -10
  332. package/src/Components/Icons/Video.js +7 -16
  333. package/src/Components/Icons/X.js +7 -10
  334. package/src/Components/Icons/Xmark.js +7 -10
  335. package/src/Components/Layout/CenterBox.js +13 -9
  336. package/src/Components/Layout/Footer.js +20 -13
  337. package/src/Components/Messages/ConfirmationMessage.js +30 -13
  338. package/src/Components/Messages/ErrorMessage.js +29 -23
  339. package/src/Components/Messages/Loading.js +10 -8
  340. package/src/Components/Messages/OkMessage.js +30 -13
  341. package/src/Components/Messages/Unauthorized.js +5 -8
  342. package/src/Components/Messages/WaitMessage.js +37 -73
  343. package/src/Components/Panel/AccordionGridPanel.js +6 -6
  344. package/src/Components/Panel/FormPanel.js +7 -3
  345. package/src/Components/Panel/Header.js +132 -94
  346. package/src/Components/Panel/Mask.js +4 -4
  347. package/src/Components/Panel/Panel.js +55 -72
  348. package/src/Components/Panel/TabPanel.js +1 -1
  349. package/src/Components/Picker/Picker.js +10 -9
  350. package/src/Components/Report/Report.js +17 -14
  351. package/src/Components/Screens/Manager.js +22 -22
  352. package/src/Components/Tab/TabBar.js +293 -225
  353. package/src/Components/Toolbar/FilterToolbar.js +15 -11
  354. package/src/Components/Toolbar/Pagination.js +51 -46
  355. package/src/Components/Toolbar/PaginationToolbar.js +25 -19
  356. package/src/Components/Toolbar/Toolbar.js +26 -13
  357. package/src/Components/Tooltip/Tooltip.js +35 -0
  358. package/src/Components/Tree/Tree.js +134 -140
  359. package/src/Components/Tree/TreeNode.js +75 -36
  360. package/src/Components/Viewer/Viewer.js +203 -80
  361. package/src/Components/Window/Editor.js +0 -5
  362. package/src/Components/Window/UploadsDownloadsWindow.js +40 -22
  363. package/src/Components/index.js +11 -8
  364. package/src/Constants/Alert.js +0 -0
  365. package/src/Constants/AppStates.js +0 -0
  366. package/src/Constants/Colors.js +13 -0
  367. package/src/Constants/Commands.js +0 -0
  368. package/src/Constants/Date.js +0 -0
  369. package/src/Constants/Dates.js +16 -0
  370. package/src/Constants/Directions.js +0 -0
  371. package/src/Constants/Editor.js +0 -0
  372. package/src/Constants/EditorModes.js +2 -0
  373. package/src/Constants/File.js +0 -0
  374. package/src/Constants/Filters.js +0 -0
  375. package/src/Constants/Grid.js +0 -0
  376. package/src/Constants/Input.js +1 -0
  377. package/src/Constants/MimeTypes.js +0 -0
  378. package/src/Constants/Selection.js +0 -0
  379. package/src/Constants/Styles.js +119 -108
  380. package/src/Constants/Tasks.js +3 -0
  381. package/src/Constants/Tree.js +0 -0
  382. package/src/Constants/UiModes.js +4 -3
  383. package/src/Functions/BankersRound.js +0 -0
  384. package/src/Functions/Cypress/button_functions.js +0 -0
  385. package/src/Functions/Cypress/crud_functions.js +0 -0
  386. package/src/Functions/Cypress/dom_functions.js +0 -0
  387. package/src/Functions/Cypress/grid_functions.js +0 -0
  388. package/src/Functions/Cypress/navigation_functions.js +0 -0
  389. package/src/Functions/Cypress/tree_functions.js +0 -0
  390. package/src/Functions/Cypress/utilities.js +0 -0
  391. package/src/Functions/PlatformDetector.js +0 -0
  392. package/src/Functions/Timer.js +0 -0
  393. package/src/Functions/buildAdditionalButtons.js +5 -5
  394. package/src/Functions/chunkArray.js +0 -0
  395. package/src/Functions/colorConversions.js +74 -0
  396. package/src/Functions/delay.js +0 -0
  397. package/src/Functions/delayUntil.js +0 -0
  398. package/src/Functions/deleteSaved.js +0 -0
  399. package/src/Functions/deleteSecure.js +0 -0
  400. package/src/Functions/downloadInBackground.js +0 -0
  401. package/src/Functions/downloadWithFetch.js +0 -0
  402. package/src/Functions/emptyFn.js +0 -0
  403. package/src/Functions/getComponentFromType.js +0 -0
  404. package/src/Functions/getIconButtonFromConfig.js +5 -9
  405. package/src/Functions/getIsMobile.js +0 -0
  406. package/src/Functions/getNodeIcon.js +28 -0
  407. package/src/Functions/getPref.js +0 -0
  408. package/src/Functions/getSaved.js +0 -0
  409. package/src/Functions/getSecure.js +0 -0
  410. package/src/Functions/getTokenHeaders.js +0 -0
  411. package/src/Functions/gsToHex.js +205 -0
  412. package/src/Functions/ignoreWanings.js +46 -0
  413. package/src/Functions/inArray.js +0 -0
  414. package/src/Functions/isJson.js +0 -0
  415. package/src/Functions/isSerializable.js +0 -0
  416. package/src/Functions/isVideo.js +0 -0
  417. package/src/Functions/jsonValidator.js +0 -0
  418. package/src/Functions/nbToRgb.js +1 -1
  419. package/src/Functions/objectToClassName.js +72 -0
  420. package/src/Functions/parseNotification.js +0 -0
  421. package/src/Functions/processImage.js +0 -0
  422. package/src/Functions/registerReactNativeComponents.js +0 -0
  423. package/src/Functions/registerWebComponents.js +0 -0
  424. package/src/Functions/setCustomInflector.js +0 -0
  425. package/src/Functions/setPref.js +0 -0
  426. package/src/Functions/setProgress.js +0 -0
  427. package/src/Functions/setSaved.js +0 -0
  428. package/src/Functions/setSecure.js +0 -0
  429. package/src/Functions/setThemeOverrides.js +0 -0
  430. package/src/Functions/setUiSavesRepo.js +0 -0
  431. package/src/Functions/sleep.js +0 -0
  432. package/src/Functions/tailwindFunctions.js +384 -0
  433. package/src/Functions/testProps.js +0 -0
  434. package/src/Functions/trackEngagementHit.js +0 -0
  435. package/src/Functions/verifyCompleted.js +0 -0
  436. package/src/Functions/waitFor.js +2 -2
  437. package/src/PlatformImports/Web/Attachments.js +32 -38
  438. package/src/PlatformImports/Web/File.js +38 -31
  439. package/src/UiGlobals.js +8 -1
  440. package/src/Components/Grid/ColumnSelectorWindow.js +0 -125
@@ -0,0 +1,584 @@
1
+ import { H4 } from '@expo/html-elements';
2
+ import { createActionsheet } from '@gluestack-ui/actionsheet';
3
+ import {
4
+ Pressable,
5
+ View,
6
+ Text,
7
+ ScrollView,
8
+ VirtualizedList,
9
+ FlatList,
10
+ SectionList,
11
+ Platform,
12
+ } from 'react-native';
13
+
14
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
15
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
16
+ import { withStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
17
+ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
18
+ import { cssInterop } from 'nativewind';
19
+ import {
20
+ Motion,
21
+ AnimatePresence,
22
+ createMotionAnimatedComponent,
23
+ } from '@legendapp/motion';
24
+
25
+ import React, { useMemo } from 'react';
26
+ import { Svg } from 'react-native-svg';
27
+
28
+ const AnimatedPressable = createMotionAnimatedComponent(Pressable);
29
+
30
+ type IPrimitiveIcon = {
31
+ height?: number | string;
32
+ width?: number | string;
33
+ fill?: string;
34
+ color?: string;
35
+ size?: number | string;
36
+ stroke?: string;
37
+ as?: React.ElementType;
38
+ className?: string;
39
+ };
40
+
41
+ const PrimitiveIcon = React.forwardRef<
42
+ React.ElementRef<typeof Svg>,
43
+ IPrimitiveIcon
44
+ >(({ height, width, fill, color, size, stroke, as: AsComp, ...props }, ref) => {
45
+ const sizeProps = useMemo(() => {
46
+ if (size) return { size };
47
+ if (height && width) return { height, width };
48
+ if (height) return { height };
49
+ if (width) return { width };
50
+ return {};
51
+ }, [size, height, width]);
52
+
53
+ let colorProps = {};
54
+ if (color) {
55
+ colorProps = { ...colorProps, color: color };
56
+ }
57
+ if (stroke) {
58
+ colorProps = { ...colorProps, stroke: stroke };
59
+ }
60
+ if (fill) {
61
+ colorProps = { ...colorProps, fill: fill };
62
+ }
63
+ if (AsComp) {
64
+ return <AsComp ref={ref} {...sizeProps} {...colorProps} {...props} />;
65
+ }
66
+ return (
67
+ <Svg ref={ref} height={height} width={width} {...colorProps} {...props} />
68
+ );
69
+ });
70
+
71
+ export const UIActionsheet = createActionsheet({
72
+ Root: View,
73
+ Content: withStyleContext(Motion.View),
74
+ Item:
75
+ Platform.OS === 'web'
76
+ ? withStyleContext(Pressable)
77
+ : withStyleContextAndStates(Pressable),
78
+ ItemText: Text,
79
+ DragIndicator: View,
80
+ IndicatorWrapper: View,
81
+ Backdrop: AnimatedPressable,
82
+ ScrollView: ScrollView,
83
+ VirtualizedList: VirtualizedList,
84
+ FlatList: FlatList,
85
+ SectionList: SectionList,
86
+ SectionHeaderText: H4,
87
+ Icon: PrimitiveIcon,
88
+ AnimatePresence: AnimatePresence,
89
+ });
90
+
91
+ cssInterop(UIActionsheet, { className: 'style' });
92
+ cssInterop(UIActionsheet.Content, { className: 'style' });
93
+ cssInterop(UIActionsheet.Item, { className: 'style' });
94
+ cssInterop(UIActionsheet.ItemText, { className: 'style' });
95
+ cssInterop(UIActionsheet.DragIndicator, { className: 'style' });
96
+ cssInterop(UIActionsheet.DragIndicatorWrapper, { className: 'style' });
97
+ cssInterop(UIActionsheet.Backdrop, { className: 'style' });
98
+ cssInterop(UIActionsheet.ScrollView, {
99
+ className: 'style',
100
+ contentContainerClassName: 'contentContainerStyle',
101
+ indicatorClassName: 'indicatorStyle',
102
+ });
103
+ cssInterop(UIActionsheet.VirtualizedList, {
104
+ className: 'style',
105
+ ListFooterComponentClassName: 'ListFooterComponentStyle',
106
+ ListHeaderComponentClassName: 'ListHeaderComponentStyle',
107
+ contentContainerClassName: 'contentContainerStyle',
108
+ indicatorClassName: 'indicatorStyle',
109
+ });
110
+ cssInterop(UIActionsheet.FlatList, {
111
+ className: 'style',
112
+ ListFooterComponentClassName: 'ListFooterComponentStyle',
113
+ ListHeaderComponentClassName: 'ListHeaderComponentStyle',
114
+ columnWrapperClassName: 'columnWrapperStyle',
115
+ contentContainerClassName: 'contentContainerStyle',
116
+ indicatorClassName: 'indicatorStyle',
117
+ });
118
+ cssInterop(UIActionsheet.SectionList, { className: 'style' });
119
+ cssInterop(UIActionsheet.SectionHeaderText, { className: 'style' });
120
+ cssInterop(UIActionsheet.Icon, { className: 'style' });
121
+
122
+ const actionsheetStyle = tva({ base: 'w-full h-full web:pointer-events-none' });
123
+
124
+ const actionsheetContentStyle = tva({
125
+ base: 'items-center rounded-tl-3xl rounded-tr-3xl p-2 bg-background-0 web:pointer-events-auto web:select-none shadow-lg',
126
+ });
127
+
128
+ const actionsheetItemStyle = tva({
129
+ base: 'w-full flex-row items-center p-3 rounded-sm data-[disabled=true]:opacity-40 data-[disabled=true]:web:pointer-events-auto data-[disabled=true]:web:cursor-not-allowed hover:bg-background-50 active:bg-background-100 data-[focus=true]:bg-background-100 web:data-[focus-visible=true]:bg-background-100 data-[checked=true]:bg-background-100',
130
+ });
131
+
132
+ const actionsheetItemTextStyle = tva({
133
+ base: 'text-typography-700 font-normal font-body tracking-md text-left mx-2',
134
+ variants: {
135
+ isTruncated: {
136
+ true: '',
137
+ },
138
+ bold: {
139
+ true: 'font-bold',
140
+ },
141
+ underline: {
142
+ true: 'underline',
143
+ },
144
+ strikeThrough: {
145
+ true: 'line-through',
146
+ },
147
+ size: {
148
+ '2xs': 'text-2xs',
149
+ 'xs': 'text-xs',
150
+ 'sm': 'text-sm',
151
+ 'md': 'text-md',
152
+ 'lg': 'text-lg',
153
+ 'xl': 'text-xl',
154
+ '2xl': 'text-2xl',
155
+ '3xl': 'text-3xl',
156
+ '4xl': 'text-4xl',
157
+ '5xl': 'text-5xl',
158
+ '6xl': 'text-6xl',
159
+ },
160
+ },
161
+ defaultVariants: {
162
+ size: 'md',
163
+ },
164
+ });
165
+
166
+ const actionsheetDragIndicatorStyle = tva({
167
+ base: 'w-16 h-1 bg-background-400 rounded-full',
168
+ });
169
+
170
+ const actionsheetDragIndicatorWrapperStyle = tva({
171
+ base: 'w-full py-1 items-center',
172
+ });
173
+
174
+ const actionsheetBackdropStyle = tva({
175
+ base: 'absolute left-0 top-0 right-0 bottom-0 bg-background-dark web:cursor-default web:pointer-events-auto',
176
+ });
177
+
178
+ const actionsheetScrollViewStyle = tva({
179
+ base: 'w-full h-auto',
180
+ });
181
+
182
+ const actionsheetVirtualizedListStyle = tva({
183
+ base: 'w-full h-auto',
184
+ });
185
+
186
+ const actionsheetFlatListStyle = tva({
187
+ base: 'w-full h-auto',
188
+ });
189
+
190
+ const actionsheetSectionListStyle = tva({
191
+ base: 'w-full h-auto',
192
+ });
193
+
194
+ const actionsheetSectionHeaderTextStyle = tva({
195
+ base: 'leading-5 font-bold font-heading my-0 text-typography-500 p-3 uppercase',
196
+ variants: {
197
+ isTruncated: {
198
+ true: '',
199
+ },
200
+ bold: {
201
+ true: 'font-bold',
202
+ },
203
+ underline: {
204
+ true: 'underline',
205
+ },
206
+ strikeThrough: {
207
+ true: 'line-through',
208
+ },
209
+ size: {
210
+ '5xl': 'text-5xl',
211
+ '4xl': 'text-4xl',
212
+ '3xl': 'text-3xl',
213
+ '2xl': 'text-2xl',
214
+ 'xl': 'text-xl',
215
+ 'lg': 'text-lg',
216
+ 'md': 'text-md',
217
+ 'sm': 'text-sm',
218
+ 'xs': 'text-xs',
219
+ },
220
+
221
+ sub: {
222
+ true: 'text-xs',
223
+ },
224
+ italic: {
225
+ true: 'italic',
226
+ },
227
+ highlight: {
228
+ true: 'bg-yellow500',
229
+ },
230
+ },
231
+ defaultVariants: {
232
+ size: 'xs',
233
+ },
234
+ });
235
+
236
+ const actionsheetIconStyle = tva({
237
+ base: 'text-typography-900',
238
+ variants: {
239
+ size: {
240
+ '2xs': 'h-3 w-3',
241
+ 'xs': 'h-3.5 w-3.5',
242
+ 'sm': 'h-4 w-4',
243
+ 'md': 'w-4 h-4',
244
+ 'lg': 'h-5 w-5',
245
+ 'xl': 'h-6 w-6',
246
+ },
247
+ },
248
+ });
249
+
250
+ type IActionsheetProps = VariantProps<typeof actionsheetStyle> &
251
+ React.ComponentProps<typeof UIActionsheet> & { className?: string };
252
+
253
+ type IActionsheetContentProps = VariantProps<typeof actionsheetContentStyle> &
254
+ React.ComponentProps<typeof UIActionsheet.Content> & { className?: string };
255
+
256
+ type IActionsheetItemProps = VariantProps<typeof actionsheetItemStyle> &
257
+ React.ComponentProps<typeof UIActionsheet.Item> & { className?: string };
258
+
259
+ type IActionsheetItemTextProps = VariantProps<typeof actionsheetItemTextStyle> &
260
+ React.ComponentProps<typeof UIActionsheet.ItemText> & { className?: string };
261
+
262
+ type IActionsheetDragIndicatorProps = VariantProps<
263
+ typeof actionsheetDragIndicatorStyle
264
+ > &
265
+ React.ComponentProps<typeof UIActionsheet.DragIndicator> & {
266
+ className?: string;
267
+ };
268
+
269
+ type IActionsheetDragIndicatorWrapperProps = VariantProps<
270
+ typeof actionsheetDragIndicatorWrapperStyle
271
+ > &
272
+ React.ComponentProps<typeof UIActionsheet.DragIndicatorWrapper> & {
273
+ className?: string;
274
+ };
275
+
276
+ type IActionsheetBackdropProps = VariantProps<typeof actionsheetBackdropStyle> &
277
+ React.ComponentProps<typeof UIActionsheet.Backdrop> & {
278
+ className?: string;
279
+ };
280
+
281
+ type IActionsheetScrollViewProps = VariantProps<
282
+ typeof actionsheetScrollViewStyle
283
+ > &
284
+ React.ComponentProps<typeof UIActionsheet.ScrollView> & {
285
+ className?: string;
286
+ };
287
+
288
+ type IActionsheetVirtualizedListProps = VariantProps<
289
+ typeof actionsheetVirtualizedListStyle
290
+ > &
291
+ React.ComponentProps<typeof UIActionsheet.VirtualizedList> & {
292
+ className?: string;
293
+ };
294
+
295
+ type IActionsheetFlatListProps = VariantProps<typeof actionsheetFlatListStyle> &
296
+ React.ComponentProps<typeof UIActionsheet.FlatList> & {
297
+ className?: string;
298
+ };
299
+
300
+ type IActionsheetSectionListProps = VariantProps<
301
+ typeof actionsheetSectionListStyle
302
+ > &
303
+ React.ComponentProps<typeof UIActionsheet.SectionList> & {
304
+ className?: string;
305
+ };
306
+
307
+ type IActionsheetSectionHeaderTextProps = VariantProps<
308
+ typeof actionsheetSectionHeaderTextStyle
309
+ > &
310
+ React.ComponentProps<typeof UIActionsheet.SectionHeaderText> & {
311
+ className?: string;
312
+ };
313
+
314
+ type IActionsheetIconProps = VariantProps<typeof actionsheetIconStyle> &
315
+ React.ComponentProps<typeof UIActionsheet.Icon> & {
316
+ className?: string;
317
+ };
318
+
319
+ const Actionsheet = React.forwardRef<
320
+ React.ElementRef<typeof UIActionsheet>,
321
+ IActionsheetProps
322
+ >(({ className, ...props }, ref) => {
323
+ return (
324
+ <UIActionsheet
325
+ className={actionsheetStyle({
326
+ class: className,
327
+ })}
328
+ ref={ref}
329
+ {...props}
330
+ />
331
+ );
332
+ });
333
+
334
+ const ActionsheetContent = React.forwardRef<
335
+ React.ElementRef<typeof UIActionsheet.Content>,
336
+ IActionsheetContentProps & { className?: string }
337
+ >(({ className, ...props }, ref) => {
338
+ return (
339
+ <UIActionsheet.Content
340
+ className={actionsheetContentStyle({
341
+ class: className,
342
+ })}
343
+ ref={ref}
344
+ {...props}
345
+ />
346
+ );
347
+ });
348
+
349
+ const ActionsheetItem = React.forwardRef<
350
+ React.ElementRef<typeof UIActionsheet.Item>,
351
+ IActionsheetItemProps
352
+ >(({ className, ...props }, ref) => {
353
+ return (
354
+ <UIActionsheet.Item
355
+ className={actionsheetItemStyle({
356
+ class: className,
357
+ })}
358
+ ref={ref}
359
+ {...props}
360
+ />
361
+ );
362
+ });
363
+
364
+ const ActionsheetItemText = React.forwardRef<
365
+ React.ElementRef<typeof UIActionsheet.ItemText>,
366
+ IActionsheetItemTextProps
367
+ >(
368
+ (
369
+ { isTruncated, bold, underline, strikeThrough, size, className, ...props },
370
+ ref
371
+ ) => {
372
+ return (
373
+ <UIActionsheet.ItemText
374
+ className={actionsheetItemTextStyle({
375
+ class: className,
376
+ isTruncated,
377
+ bold,
378
+ underline,
379
+ strikeThrough,
380
+ size,
381
+ })}
382
+ ref={ref}
383
+ {...props}
384
+ />
385
+ );
386
+ }
387
+ );
388
+
389
+ const ActionsheetDragIndicator = React.forwardRef<
390
+ React.ElementRef<typeof UIActionsheet.DragIndicator>,
391
+ IActionsheetDragIndicatorProps
392
+ >(({ className, ...props }, ref) => {
393
+ return (
394
+ <UIActionsheet.DragIndicator
395
+ className={actionsheetDragIndicatorStyle({
396
+ class: className,
397
+ })}
398
+ ref={ref}
399
+ {...props}
400
+ />
401
+ );
402
+ });
403
+
404
+ const ActionsheetDragIndicatorWrapper = React.forwardRef<
405
+ React.ElementRef<typeof UIActionsheet.DragIndicatorWrapper>,
406
+ IActionsheetDragIndicatorWrapperProps
407
+ >(({ className, ...props }, ref) => {
408
+ return (
409
+ <UIActionsheet.DragIndicatorWrapper
410
+ className={actionsheetDragIndicatorWrapperStyle({
411
+ class: className,
412
+ })}
413
+ ref={ref}
414
+ {...props}
415
+ />
416
+ );
417
+ });
418
+
419
+ const ActionsheetBackdrop = React.forwardRef<
420
+ React.ElementRef<typeof UIActionsheet.Backdrop>,
421
+ IActionsheetBackdropProps
422
+ >(({ className, ...props }, ref) => {
423
+ return (
424
+ <UIActionsheet.Backdrop
425
+ initial={{
426
+ opacity: 0,
427
+ }}
428
+ animate={{
429
+ opacity: 0.5,
430
+ }}
431
+ exit={{
432
+ opacity: 0,
433
+ }}
434
+ {...props}
435
+ className={actionsheetBackdropStyle({
436
+ class: className,
437
+ })}
438
+ ref={ref}
439
+ />
440
+ );
441
+ });
442
+
443
+ const ActionsheetScrollView = React.forwardRef<
444
+ React.ElementRef<typeof UIActionsheet.ScrollView>,
445
+ IActionsheetScrollViewProps
446
+ >(({ className, ...props }, ref) => {
447
+ return (
448
+ <UIActionsheet.ScrollView
449
+ className={actionsheetScrollViewStyle({
450
+ class: className,
451
+ })}
452
+ ref={ref}
453
+ {...props}
454
+ />
455
+ );
456
+ });
457
+
458
+ const ActionsheetVirtualizedList = React.forwardRef<
459
+ React.ElementRef<typeof UIActionsheet.VirtualizedList>,
460
+ IActionsheetVirtualizedListProps
461
+ >(({ className, ...props }, ref) => {
462
+ return (
463
+ <UIActionsheet.VirtualizedList
464
+ className={actionsheetVirtualizedListStyle({
465
+ class: className,
466
+ })}
467
+ ref={ref}
468
+ {...props}
469
+ />
470
+ );
471
+ });
472
+
473
+ const ActionsheetFlatList = React.forwardRef<
474
+ React.ElementRef<typeof UIActionsheet.FlatList>,
475
+ IActionsheetFlatListProps
476
+ >(({ className, ...props }, ref) => {
477
+ return (
478
+ <UIActionsheet.FlatList
479
+ className={actionsheetFlatListStyle({
480
+ class: className,
481
+ })}
482
+ ref={ref}
483
+ {...props}
484
+ />
485
+ );
486
+ });
487
+
488
+ const ActionsheetSectionList = React.forwardRef<
489
+ React.ElementRef<typeof UIActionsheet.SectionList>,
490
+ IActionsheetSectionListProps
491
+ >(({ className, ...props }, ref) => {
492
+ return (
493
+ <UIActionsheet.SectionList
494
+ className={actionsheetSectionListStyle({
495
+ class: className,
496
+ })}
497
+ ref={ref}
498
+ {...props}
499
+ />
500
+ );
501
+ });
502
+
503
+ const ActionsheetSectionHeaderText = React.forwardRef<
504
+ React.ElementRef<typeof UIActionsheet.SectionHeaderText>,
505
+ IActionsheetSectionHeaderTextProps
506
+ >(
507
+ (
508
+ {
509
+ className,
510
+ isTruncated,
511
+ bold,
512
+ underline,
513
+ strikeThrough,
514
+ size,
515
+ sub,
516
+ italic,
517
+ highlight,
518
+ ...props
519
+ },
520
+ ref
521
+ ) => {
522
+ return (
523
+ <UIActionsheet.SectionHeaderText
524
+ className={actionsheetSectionHeaderTextStyle({
525
+ class: className,
526
+ isTruncated,
527
+ bold,
528
+ underline,
529
+ strikeThrough,
530
+ size,
531
+ sub,
532
+ italic,
533
+ highlight,
534
+ })}
535
+ ref={ref}
536
+ {...props}
537
+ />
538
+ );
539
+ }
540
+ );
541
+
542
+ const ActionsheetIcon = React.forwardRef<
543
+ React.ElementRef<typeof UIActionsheet.Icon>,
544
+ IActionsheetIconProps
545
+ >(({ className, as: AsComp, size = 'sm', ...props }, ref) => {
546
+ if (AsComp) {
547
+ return (
548
+ <AsComp
549
+ className={actionsheetIconStyle({
550
+ class: className,
551
+ size,
552
+ })}
553
+ ref={ref}
554
+ {...props}
555
+ />
556
+ );
557
+ }
558
+ return (
559
+ <UIActionsheet.Icon
560
+ className={actionsheetIconStyle({
561
+ class: className,
562
+ size,
563
+ })}
564
+ ref={ref}
565
+ {...props}
566
+ />
567
+ );
568
+ });
569
+
570
+ export {
571
+ Actionsheet,
572
+ ActionsheetContent,
573
+ ActionsheetItem,
574
+ ActionsheetItemText,
575
+ ActionsheetDragIndicator,
576
+ ActionsheetDragIndicatorWrapper,
577
+ ActionsheetBackdrop,
578
+ ActionsheetScrollView,
579
+ ActionsheetVirtualizedList,
580
+ ActionsheetFlatList,
581
+ ActionsheetSectionList,
582
+ ActionsheetSectionHeaderText,
583
+ ActionsheetIcon,
584
+ };
@@ -0,0 +1,138 @@
1
+ import React, { forwardRef } from 'react';
2
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
3
+ import { Animated, Easing, Platform, View } from 'react-native';
4
+ import { skeletonStyle, skeletonTextStyle } from './styles';
5
+
6
+ type ISkeletonProps = React.ComponentProps<typeof View> &
7
+ VariantProps<typeof skeletonStyle> & {
8
+ isLoaded?: boolean;
9
+ startColor?: string;
10
+ };
11
+
12
+ type ISkeletonTextProps = React.ComponentProps<typeof View> &
13
+ VariantProps<typeof skeletonTextStyle> & {
14
+ _lines?: number;
15
+ isLoaded?: boolean;
16
+ startColor?: string;
17
+ };
18
+
19
+ const Skeleton = forwardRef<
20
+ React.ElementRef<typeof Animated.View>,
21
+ ISkeletonProps
22
+ >(
23
+ (
24
+ {
25
+ className,
26
+ variant,
27
+ children,
28
+ startColor = 'bg-background-200',
29
+ isLoaded = false,
30
+ speed = 2,
31
+ ...props
32
+ },
33
+ ref
34
+ ) => {
35
+ const pulseAnim = new Animated.Value(1);
36
+ const customTimingFunction = Easing.bezier(0.4, 0, 0.6, 1);
37
+ const fadeDuration = 0.6;
38
+ const animationDuration = (fadeDuration * 10000) / speed; // Convert seconds to milliseconds
39
+
40
+ const pulse = Animated.sequence([
41
+ Animated.timing(pulseAnim, {
42
+ toValue: 1, // Start with opacity 1
43
+ duration: animationDuration / 2, // Third of the animation duration
44
+ easing: customTimingFunction,
45
+ useNativeDriver: Platform.OS !== 'web',
46
+ }),
47
+ Animated.timing(pulseAnim, {
48
+ toValue: 0.75,
49
+ duration: animationDuration / 2, // Third of the animation duration
50
+ easing: customTimingFunction,
51
+ useNativeDriver: Platform.OS !== 'web',
52
+ }),
53
+ Animated.timing(pulseAnim, {
54
+ toValue: 1,
55
+ duration: animationDuration / 2, // Third of the animation duration
56
+ easing: customTimingFunction,
57
+ useNativeDriver: Platform.OS !== 'web',
58
+ }),
59
+ ]);
60
+
61
+ if (!isLoaded) {
62
+ Animated.loop(pulse).start();
63
+ return (
64
+ <Animated.View
65
+ style={{ opacity: pulseAnim }}
66
+ className={`${startColor} ${skeletonStyle({
67
+ variant,
68
+ class: className,
69
+ })}`}
70
+ {...props}
71
+ ref={ref}
72
+ />
73
+ );
74
+ } else {
75
+ Animated.loop(pulse).stop();
76
+
77
+ return children;
78
+ }
79
+ }
80
+ );
81
+
82
+ const SkeletonText = forwardRef<
83
+ React.ElementRef<typeof View>,
84
+ ISkeletonTextProps
85
+ >(
86
+ (
87
+ {
88
+ className,
89
+ _lines,
90
+ isLoaded = false,
91
+ startColor = 'bg-background-200',
92
+ gap = 2,
93
+ children,
94
+ ...props
95
+ },
96
+ ref
97
+ ) => {
98
+ if (!isLoaded) {
99
+ if (_lines) {
100
+ return (
101
+ <View
102
+ className={`${skeletonTextStyle({
103
+ gap,
104
+ })}`}
105
+ ref={ref}
106
+ >
107
+ {Array.from({ length: _lines }).map((_, index) => (
108
+ <Skeleton
109
+ key={index}
110
+ className={`${startColor} ${skeletonTextStyle({
111
+ class: className,
112
+ })}`}
113
+ {...props}
114
+ />
115
+ ))}
116
+ </View>
117
+ );
118
+ } else {
119
+ return (
120
+ <Skeleton
121
+ className={`${startColor} ${skeletonTextStyle({
122
+ class: className,
123
+ })}`}
124
+ {...props}
125
+ ref={ref}
126
+ />
127
+ );
128
+ }
129
+ } else {
130
+ return children;
131
+ }
132
+ }
133
+ );
134
+
135
+ Skeleton.displayName = 'Skeleton';
136
+ SkeletonText.displayName = 'SkeletonText';
137
+
138
+ export { Skeleton, SkeletonText };