bootstrap-rn 0.4.6 → 0.4.7

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 (287) hide show
  1. package/lib/module/Context.js.map +1 -1
  2. package/lib/module/Provider.js +3 -7
  3. package/lib/module/Provider.js.map +1 -1
  4. package/lib/module/components/Body.js +8 -1
  5. package/lib/module/components/Body.js.map +1 -1
  6. package/lib/module/components/buttons/Button.js +10 -8
  7. package/lib/module/components/buttons/Button.js.map +1 -1
  8. package/lib/module/components/close/CloseButton.js +7 -3
  9. package/lib/module/components/close/CloseButton.js.map +1 -1
  10. package/lib/module/components/collapse/useCollapse.js +2 -3
  11. package/lib/module/components/collapse/useCollapse.js.map +1 -1
  12. package/lib/module/components/dropdown/Dropdown.js +1 -2
  13. package/lib/module/components/dropdown/Dropdown.js.map +1 -1
  14. package/lib/module/components/dropdown/DropdownContext.js.map +1 -1
  15. package/lib/module/components/dropdown/DropdownMenu.js +33 -59
  16. package/lib/module/components/dropdown/DropdownMenu.js.map +1 -1
  17. package/lib/module/components/dropdown/useDismissDropdown.js +5 -4
  18. package/lib/module/components/dropdown/useDismissDropdown.js.map +1 -1
  19. package/lib/module/components/dropdown/useDropdown.js +35 -11
  20. package/lib/module/components/dropdown/useDropdown.js.map +1 -1
  21. package/lib/module/components/dropdown/useToggleDropdown.js +4 -6
  22. package/lib/module/components/dropdown/useToggleDropdown.js.map +1 -1
  23. package/lib/module/components/forms/FormCheckInput.js +1 -1
  24. package/lib/module/components/forms/Input.js +1 -1
  25. package/lib/module/components/forms/internals/PickerNative.js +1 -1
  26. package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
  27. package/lib/module/components/helpers/BackdropHandler.js +6 -92
  28. package/lib/module/components/helpers/BackdropHandler.js.map +1 -1
  29. package/lib/module/components/helpers/BackdropHandler.web.js +8 -0
  30. package/lib/module/components/helpers/BackdropHandler.web.js.map +1 -0
  31. package/lib/module/components/helpers/Dialog.js +29 -0
  32. package/lib/module/components/helpers/Dialog.js.map +1 -0
  33. package/lib/module/components/helpers/Dialog.web.js +117 -0
  34. package/lib/module/components/helpers/Dialog.web.js.map +1 -0
  35. package/lib/module/components/helpers/Portal.js +5 -0
  36. package/lib/module/components/helpers/Portal.js.map +1 -0
  37. package/lib/module/components/helpers/Portal.web.js +16 -0
  38. package/lib/module/components/helpers/Portal.web.js.map +1 -0
  39. package/lib/module/components/helpers/PortalHost.js +5 -0
  40. package/lib/module/components/helpers/PortalHost.js.map +1 -0
  41. package/lib/module/components/helpers/PortalHost.web.js +15 -0
  42. package/lib/module/components/helpers/PortalHost.web.js.map +1 -0
  43. package/lib/module/components/modal/Modal.js +58 -48
  44. package/lib/module/components/modal/Modal.js.map +1 -1
  45. package/lib/module/components/modal/ModalContext.js.map +1 -1
  46. package/lib/module/components/modal/ModalTitle.js +6 -0
  47. package/lib/module/components/modal/ModalTitle.js.map +1 -1
  48. package/lib/module/components/modal/useModal.js +4 -13
  49. package/lib/module/components/modal/useModal.js.map +1 -1
  50. package/lib/module/components/nav/useTabbable.js +2 -3
  51. package/lib/module/components/nav/useTabbable.js.map +1 -1
  52. package/lib/module/components/navbar/NavbarToggler.js +1 -1
  53. package/lib/module/components/navbar/useNavbar.js +2 -3
  54. package/lib/module/components/navbar/useNavbar.js.map +1 -1
  55. package/lib/module/components/offcanvas/Offcanvas.js +84 -82
  56. package/lib/module/components/offcanvas/Offcanvas.js.map +1 -1
  57. package/lib/module/components/offcanvas/OffcanvasContext.js.map +1 -1
  58. package/lib/module/components/offcanvas/OffcanvasTitle.js +6 -0
  59. package/lib/module/components/offcanvas/OffcanvasTitle.js.map +1 -1
  60. package/lib/module/components/offcanvas/useOffcanvas.js +6 -14
  61. package/lib/module/components/offcanvas/useOffcanvas.js.map +1 -1
  62. package/lib/module/components/pagination/PaginationItem.js +39 -39
  63. package/lib/module/components/popover/Popover.js +6 -8
  64. package/lib/module/components/popover/Popover.js.map +1 -1
  65. package/lib/module/components/popover/PopoverArrow.js +18 -9
  66. package/lib/module/components/popover/PopoverArrow.js.map +1 -1
  67. package/lib/module/components/popover/PopoverContext.js.map +1 -1
  68. package/lib/module/components/popover/injectPopover.js +48 -45
  69. package/lib/module/components/popover/injectPopover.js.map +1 -1
  70. package/lib/module/components/tooltip/Tooltip.js +7 -23
  71. package/lib/module/components/tooltip/Tooltip.js.map +1 -1
  72. package/lib/module/components/tooltip/TooltipArrow.js +22 -12
  73. package/lib/module/components/tooltip/TooltipArrow.js.map +1 -1
  74. package/lib/module/components/tooltip/TooltipContext.js.map +1 -1
  75. package/lib/module/components/tooltip/injectTooltip.js +46 -42
  76. package/lib/module/components/tooltip/injectTooltip.js.map +1 -1
  77. package/lib/module/hooks/useBackgroundNative.js.map +1 -1
  78. package/lib/module/hooks/useFocusRing.js +13 -0
  79. package/lib/module/hooks/useFocusRing.js.map +1 -0
  80. package/lib/module/hooks/useFocusRing.web.js +5 -0
  81. package/lib/module/hooks/useFocusRing.web.js.map +1 -0
  82. package/lib/module/hooks/useInteractionState.js +11 -11
  83. package/lib/module/hooks/useInteractionState.js.map +1 -1
  84. package/lib/module/hooks/useOverlay.js +121 -0
  85. package/lib/module/hooks/useOverlay.js.map +1 -0
  86. package/lib/module/hooks/useOverlay.web.js +113 -0
  87. package/lib/module/hooks/useOverlay.web.js.map +1 -0
  88. package/lib/module/hooks/useScrollbarEffects.js +7 -60
  89. package/lib/module/hooks/useScrollbarEffects.js.map +1 -1
  90. package/lib/module/hooks/useScrollbarEffects.web.js +59 -0
  91. package/lib/module/hooks/useScrollbarEffects.web.js.map +1 -0
  92. package/lib/module/index.js +3 -3
  93. package/lib/module/index.js.map +1 -1
  94. package/lib/module/style/StyleSheet.js +1 -3
  95. package/lib/module/style/StyleSheet.js.map +1 -1
  96. package/lib/module/theme/variables.js +9 -9
  97. package/lib/module/utils.js +0 -11
  98. package/lib/module/utils.js.map +1 -1
  99. package/lib/typescript/Context.d.ts +0 -1
  100. package/lib/typescript/Context.d.ts.map +1 -1
  101. package/lib/typescript/Provider.d.ts.map +1 -1
  102. package/lib/typescript/components/Body.d.ts.map +1 -1
  103. package/lib/typescript/components/Link.d.ts +1 -1
  104. package/lib/typescript/components/Link.d.ts.map +1 -1
  105. package/lib/typescript/components/Pressable.d.ts +1 -1
  106. package/lib/typescript/components/Pressable.d.ts.map +1 -1
  107. package/lib/typescript/components/TextInput.d.ts +3 -3
  108. package/lib/typescript/components/TextInput.d.ts.map +1 -1
  109. package/lib/typescript/components/buttons/Button.d.ts +1 -1
  110. package/lib/typescript/components/buttons/Button.d.ts.map +1 -1
  111. package/lib/typescript/components/close/CloseButton.d.ts +1 -1
  112. package/lib/typescript/components/close/CloseButton.d.ts.map +1 -1
  113. package/lib/typescript/components/collapse/useCollapse.d.ts.map +1 -1
  114. package/lib/typescript/components/dropdown/Dropdown.d.ts +0 -1
  115. package/lib/typescript/components/dropdown/Dropdown.d.ts.map +1 -1
  116. package/lib/typescript/components/dropdown/DropdownContext.d.ts +14 -3
  117. package/lib/typescript/components/dropdown/DropdownContext.d.ts.map +1 -1
  118. package/lib/typescript/components/dropdown/DropdownMenu.d.ts +0 -1
  119. package/lib/typescript/components/dropdown/DropdownMenu.d.ts.map +1 -1
  120. package/lib/typescript/components/dropdown/useDismissDropdown.d.ts +1 -1
  121. package/lib/typescript/components/dropdown/useDismissDropdown.d.ts.map +1 -1
  122. package/lib/typescript/components/dropdown/useDropdown.d.ts +38 -4
  123. package/lib/typescript/components/dropdown/useDropdown.d.ts.map +1 -1
  124. package/lib/typescript/components/dropdown/useToggleDropdown.d.ts +4 -3
  125. package/lib/typescript/components/dropdown/useToggleDropdown.d.ts.map +1 -1
  126. package/lib/typescript/components/forms/Picker.d.ts +1 -1
  127. package/lib/typescript/components/forms/internals/PickerNative.d.ts +1 -1
  128. package/lib/typescript/components/forms/internals/PickerNative.d.ts.map +1 -1
  129. package/lib/typescript/components/forms/internals/PickerWeb.d.ts +1 -1
  130. package/lib/typescript/components/forms/internals/PickerWeb.d.ts.map +1 -1
  131. package/lib/typescript/components/helpers/BackdropHandler.d.ts +2 -11
  132. package/lib/typescript/components/helpers/BackdropHandler.d.ts.map +1 -1
  133. package/lib/typescript/components/helpers/BackdropHandler.web.d.ts +3 -0
  134. package/lib/typescript/components/helpers/BackdropHandler.web.d.ts.map +1 -0
  135. package/lib/typescript/components/helpers/Dialog.d.ts +15 -0
  136. package/lib/typescript/components/helpers/Dialog.d.ts.map +1 -0
  137. package/lib/typescript/components/helpers/Dialog.web.d.ts +15 -0
  138. package/lib/typescript/components/helpers/Dialog.web.d.ts.map +1 -0
  139. package/lib/typescript/components/helpers/Portal.d.ts +8 -0
  140. package/lib/typescript/components/helpers/Portal.d.ts.map +1 -0
  141. package/lib/typescript/components/helpers/Portal.web.d.ts +8 -0
  142. package/lib/typescript/components/helpers/Portal.web.d.ts.map +1 -0
  143. package/lib/typescript/components/helpers/PortalHost.d.ts +6 -0
  144. package/lib/typescript/components/helpers/PortalHost.d.ts.map +1 -0
  145. package/lib/typescript/components/helpers/PortalHost.web.d.ts +7 -0
  146. package/lib/typescript/components/helpers/PortalHost.web.d.ts.map +1 -0
  147. package/lib/typescript/components/list-group/ListGroup.d.ts +1 -1
  148. package/lib/typescript/components/list-group/ListGroupItemAction.d.ts +1 -1
  149. package/lib/typescript/components/list-group/ListGroupItemAction.d.ts.map +1 -1
  150. package/lib/typescript/components/modal/Modal.d.ts +1 -1
  151. package/lib/typescript/components/modal/Modal.d.ts.map +1 -1
  152. package/lib/typescript/components/modal/ModalContext.d.ts +1 -0
  153. package/lib/typescript/components/modal/ModalContext.d.ts.map +1 -1
  154. package/lib/typescript/components/modal/ModalTitle.d.ts.map +1 -1
  155. package/lib/typescript/components/modal/useModal.d.ts +2 -1
  156. package/lib/typescript/components/modal/useModal.d.ts.map +1 -1
  157. package/lib/typescript/components/nav/Nav.d.ts +1 -1
  158. package/lib/typescript/components/nav/NavLink.d.ts +1 -1
  159. package/lib/typescript/components/nav/NavLink.d.ts.map +1 -1
  160. package/lib/typescript/components/nav/useTabbable.d.ts.map +1 -1
  161. package/lib/typescript/components/navbar/Navbar.d.ts +2 -2
  162. package/lib/typescript/components/navbar/NavbarBrand.d.ts +1 -1
  163. package/lib/typescript/components/navbar/NavbarBrand.d.ts.map +1 -1
  164. package/lib/typescript/components/navbar/NavbarToggler.d.ts +1 -1
  165. package/lib/typescript/components/navbar/NavbarToggler.d.ts.map +1 -1
  166. package/lib/typescript/components/navbar/useNavbar.d.ts.map +1 -1
  167. package/lib/typescript/components/offcanvas/Offcanvas.d.ts +1 -4
  168. package/lib/typescript/components/offcanvas/Offcanvas.d.ts.map +1 -1
  169. package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts +3 -1
  170. package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts.map +1 -1
  171. package/lib/typescript/components/offcanvas/OffcanvasTitle.d.ts.map +1 -1
  172. package/lib/typescript/components/offcanvas/useOffcanvas.d.ts +3 -1
  173. package/lib/typescript/components/offcanvas/useOffcanvas.d.ts.map +1 -1
  174. package/lib/typescript/components/popover/Popover.d.ts +3 -4
  175. package/lib/typescript/components/popover/Popover.d.ts.map +1 -1
  176. package/lib/typescript/components/popover/PopoverArrow.d.ts.map +1 -1
  177. package/lib/typescript/components/popover/PopoverContext.d.ts +3 -4
  178. package/lib/typescript/components/popover/PopoverContext.d.ts.map +1 -1
  179. package/lib/typescript/components/popover/injectPopover.d.ts +5 -7
  180. package/lib/typescript/components/popover/injectPopover.d.ts.map +1 -1
  181. package/lib/typescript/components/tooltip/Tooltip.d.ts +3 -4
  182. package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -1
  183. package/lib/typescript/components/tooltip/TooltipArrow.d.ts.map +1 -1
  184. package/lib/typescript/components/tooltip/TooltipContext.d.ts +3 -4
  185. package/lib/typescript/components/tooltip/TooltipContext.d.ts.map +1 -1
  186. package/lib/typescript/components/tooltip/injectTooltip.d.ts +5 -7
  187. package/lib/typescript/components/tooltip/injectTooltip.d.ts.map +1 -1
  188. package/lib/typescript/hooks/useBackgroundNative.d.ts.map +1 -1
  189. package/lib/typescript/hooks/useFocusRing.d.ts +3 -0
  190. package/lib/typescript/hooks/useFocusRing.d.ts.map +1 -0
  191. package/lib/typescript/hooks/useFocusRing.web.d.ts +3 -0
  192. package/lib/typescript/hooks/useFocusRing.web.d.ts.map +1 -0
  193. package/lib/typescript/hooks/useInteractionState.d.ts +7 -7
  194. package/lib/typescript/hooks/useInteractionState.d.ts.map +1 -1
  195. package/lib/typescript/hooks/useOverlay.d.ts +64 -0
  196. package/lib/typescript/hooks/useOverlay.d.ts.map +1 -0
  197. package/lib/typescript/hooks/useOverlay.web.d.ts +37 -0
  198. package/lib/typescript/hooks/useOverlay.web.d.ts.map +1 -0
  199. package/lib/typescript/hooks/useScrollbarEffects.d.ts.map +1 -1
  200. package/lib/typescript/hooks/useScrollbarEffects.web.d.ts +7 -0
  201. package/lib/typescript/hooks/useScrollbarEffects.web.d.ts.map +1 -0
  202. package/lib/typescript/index.d.ts +5 -4
  203. package/lib/typescript/index.d.ts.map +1 -1
  204. package/lib/typescript/style/StyleSheet.d.ts.map +1 -1
  205. package/lib/typescript/types.d.ts +12 -6
  206. package/lib/typescript/types.d.ts.map +1 -1
  207. package/lib/typescript/utils.d.ts +2 -3
  208. package/lib/typescript/utils.d.ts.map +1 -1
  209. package/package.json +92 -85
  210. package/src/Context.ts +37 -38
  211. package/src/Provider.tsx +61 -66
  212. package/src/components/Body.tsx +16 -1
  213. package/src/components/TextInput.tsx +66 -66
  214. package/src/components/buttons/Button.tsx +381 -379
  215. package/src/components/close/CloseButton.tsx +142 -138
  216. package/src/components/collapse/useCollapse.ts +25 -26
  217. package/src/components/dropdown/Dropdown.tsx +77 -80
  218. package/src/components/dropdown/DropdownContext.ts +14 -3
  219. package/src/components/dropdown/DropdownMenu.tsx +243 -284
  220. package/src/components/dropdown/useDismissDropdown.ts +30 -29
  221. package/src/components/dropdown/useDropdown.ts +55 -38
  222. package/src/components/dropdown/useToggleDropdown.ts +31 -32
  223. package/src/components/forms/FormCheckInput.tsx +268 -268
  224. package/src/components/forms/Input.tsx +220 -220
  225. package/src/components/forms/internals/PickerNative.tsx +9 -10
  226. package/src/components/helpers/BackdropHandler.tsx +5 -119
  227. package/src/components/helpers/BackdropHandler.web.tsx +6 -0
  228. package/src/components/helpers/Dialog.tsx +49 -0
  229. package/src/components/helpers/Dialog.web.tsx +145 -0
  230. package/src/components/helpers/Portal.tsx +10 -0
  231. package/src/components/helpers/Portal.web.tsx +22 -0
  232. package/src/components/helpers/PortalHost.tsx +7 -0
  233. package/src/components/helpers/PortalHost.web.tsx +14 -0
  234. package/src/components/modal/Modal.tsx +60 -48
  235. package/src/components/modal/ModalContext.ts +12 -11
  236. package/src/components/modal/ModalTitle.tsx +41 -31
  237. package/src/components/modal/useModal.ts +13 -25
  238. package/src/components/nav/useTabbable.ts +31 -32
  239. package/src/components/navbar/NavbarToggler.tsx +130 -130
  240. package/src/components/navbar/useNavbar.ts +30 -31
  241. package/src/components/offcanvas/Offcanvas.tsx +91 -92
  242. package/src/components/offcanvas/OffcanvasContext.ts +13 -11
  243. package/src/components/offcanvas/OffcanvasTitle.tsx +43 -33
  244. package/src/components/offcanvas/useOffcanvas.ts +12 -20
  245. package/src/components/pagination/PaginationItem.tsx +139 -139
  246. package/src/components/popover/Popover.tsx +87 -90
  247. package/src/components/popover/PopoverArrow.tsx +22 -6
  248. package/src/components/popover/PopoverContext.ts +13 -18
  249. package/src/components/popover/injectPopover.tsx +63 -55
  250. package/src/components/tooltip/Tooltip.tsx +79 -98
  251. package/src/components/tooltip/TooltipArrow.tsx +26 -8
  252. package/src/components/tooltip/TooltipContext.ts +13 -18
  253. package/src/components/tooltip/injectTooltip.tsx +62 -53
  254. package/src/hooks/useAction.ts +78 -78
  255. package/src/hooks/useBackgroundNative.tsx +6 -4
  256. package/src/hooks/useFocusRing.ts +13 -0
  257. package/src/hooks/useFocusRing.web.ts +3 -0
  258. package/src/hooks/useInteractionState.ts +75 -81
  259. package/src/hooks/useOverlay.ts +197 -0
  260. package/src/hooks/useOverlay.web.ts +190 -0
  261. package/src/hooks/useScrollbarEffects.ts +5 -83
  262. package/src/hooks/useScrollbarEffects.web.ts +83 -0
  263. package/src/index.ts +5 -5
  264. package/src/style/StyleSheet.ts +2 -5
  265. package/src/theme/variables.ts +1420 -1420
  266. package/src/types.ts +14 -14
  267. package/src/utils.ts +4 -22
  268. package/lib/module/components/SafeAreaView.js +0 -42
  269. package/lib/module/components/SafeAreaView.js.map +0 -1
  270. package/lib/module/components/helpers/Overlay.js +0 -50
  271. package/lib/module/components/helpers/Overlay.js.map +0 -1
  272. package/lib/module/hooks/useIdentifier.js +0 -14
  273. package/lib/module/hooks/useIdentifier.js.map +0 -1
  274. package/lib/module/hooks/useTrigger.js +0 -97
  275. package/lib/module/hooks/useTrigger.js.map +0 -1
  276. package/lib/typescript/components/SafeAreaView.d.ts +0 -12
  277. package/lib/typescript/components/SafeAreaView.d.ts.map +0 -1
  278. package/lib/typescript/components/helpers/Overlay.d.ts +0 -28
  279. package/lib/typescript/components/helpers/Overlay.d.ts.map +0 -1
  280. package/lib/typescript/hooks/useIdentifier.d.ts +0 -2
  281. package/lib/typescript/hooks/useIdentifier.d.ts.map +0 -1
  282. package/lib/typescript/hooks/useTrigger.d.ts +0 -33
  283. package/lib/typescript/hooks/useTrigger.d.ts.map +0 -1
  284. package/src/components/SafeAreaView.tsx +0 -64
  285. package/src/components/helpers/Overlay.tsx +0 -81
  286. package/src/hooks/useIdentifier.ts +0 -15
  287. package/src/hooks/useTrigger.ts +0 -141
@@ -1,13 +1,12 @@
1
- import type { ExtendedStyle, ThemeVariables, StyleValue, PlacementAxis, TransformedPlacementAxis } from './types';
1
+ import type { ExtendedStyle, ThemeVariables, StyleValue } from './types';
2
2
  export declare function each<T extends Record<string, string | ((t: ThemeVariables) => StyleValue)>>(source: T, apply: (key: keyof T, resolve: (t: ThemeVariables) => StyleValue) => Record<string, any>): Record<string, any>;
3
3
  export declare function normalize(value: object[]): object;
4
4
  export declare function makeProxy<T extends (string | number)[]>(name: string, keys: T): { [key in T[number]]: (t: ThemeVariables) => StyleValue; };
5
5
  export declare function makeArray(length: number, callback: (index: number) => object): object[];
6
6
  type FalsyValue = false | undefined | null | '' | 0;
7
7
  export declare function getStyles<T extends string>(styles: Record<string, ExtendedStyle>, keys: (T | FalsyValue)[]): ExtendedStyle[];
8
- export declare function concatRefs<T>(...refs: React.Ref<T>[]): React.Ref<T>;
8
+ export declare function concatRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.Ref<T>;
9
9
  export declare function optional(condition: boolean, value: object): object | undefined;
10
10
  export declare function getElementId(identifier: string, name: string): string;
11
- export declare function transformPlacement(placement: PlacementAxis): TransformedPlacementAxis;
12
11
  export {};
13
12
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,aAAa,EACb,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,IAAI,CAClB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,CAAC,CAAC,EAEtE,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CACL,GAAG,EAAE,MAAM,CAAC,EACZ,OAAO,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,KAEvC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,uBAQzB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAExC;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACrD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,MAOI,GAAG,oBAAoB,cAAc,KAAK,UAAU,IAEhE;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,YAE5E;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;AAEpD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACrC,IAAI,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,mBAKzB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAWnE;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAEzD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAE5D;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,aAAa,GACvB,wBAAwB,CAS1B"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEzE,wBAAgB,IAAI,CAClB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,CAAC,CAAC,EAEtE,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CACL,GAAG,EAAE,MAAM,CAAC,EACZ,OAAO,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,KAEvC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,uBAQzB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAExC;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACrD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,MAOI,GAAG,oBAAoB,cAAc,KAAK,UAAU,IAEhE;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,YAE5E;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;AAEpD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACrC,IAAI,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,mBAKzB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GACpC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAWd;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAEzD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAE5D"}
package/package.json CHANGED
@@ -1,85 +1,92 @@
1
- {
2
- "name": "bootstrap-rn",
3
- "version": "0.4.6",
4
- "description": "Bootstrap RN provides Bootstrap components for React Native.",
5
- "author": "Markus Wetzel <markuswetzel@gmx.net>",
6
- "license": "MIT",
7
- "keywords": [
8
- "react",
9
- "native",
10
- "react-native",
11
- "bootstrap",
12
- "ui",
13
- "style"
14
- ],
15
- "repository": "https://github.com/examunity/bootstrap-rn.git",
16
- "bugs": {
17
- "url": "https://github.com/examunity/bootstrap-rn/issues"
18
- },
19
- "main": "lib/module/index.js",
20
- "module": "lib/module/index.js",
21
- "source": "src/index.ts",
22
- "types": "./lib/typescript/index.d.ts",
23
- "scripts": {
24
- "check-types": "tsc --noEmit",
25
- "build": "bob build",
26
- "prepare": "packsy validate && yarn build",
27
- "lint": "packsy pre-commit && yarn check-types"
28
- },
29
- "files": [
30
- "src",
31
- "lib"
32
- ],
33
- "dependencies": {
34
- "@react-native-aria/focus": "^0.2.7",
35
- "@react-native-aria/overlays": "^0.3.5",
36
- "css-to-react-native": "^3.2.0",
37
- "tiny-invariant": "^1.3.1"
38
- },
39
- "devDependencies": {
40
- "@types/react": "~19.0.10",
41
- "cpy-cli": "^5.0.0",
42
- "packsy": "^0.2.4",
43
- "react": "19.0.0",
44
- "react-dom": "19.0.0",
45
- "react-native": "0.79.2",
46
- "react-native-builder-bob": "^0.40.10",
47
- "react-native-svg": "15.11.2",
48
- "react-native-web": "^0.20.0",
49
- "typescript": "~5.8.3"
50
- },
51
- "peerDependencies": {
52
- "@types/react": ">=17",
53
- "react": ">=17",
54
- "react-dom": ">=17",
55
- "react-native": ">=0.63.0",
56
- "react-native-svg": ">=12.3.0"
57
- },
58
- "peerDependenciesMeta": {
59
- "@types/react": {
60
- "optional": true
61
- }
62
- },
63
- "husky": {
64
- "hooks": {
65
- "pre-commit": "packsy pre-commit"
66
- }
67
- },
68
- "react-native-builder-bob": {
69
- "source": "src",
70
- "output": "lib",
71
- "targets": [
72
- [
73
- "module",
74
- {
75
- "esm": true
76
- }
77
- ],
78
- "typescript"
79
- ]
80
- },
81
- "engines": {
82
- "node": ">= 8",
83
- "npm": ">= 5"
84
- }
85
- }
1
+ {
2
+ "name": "bootstrap-rn",
3
+ "version": "0.4.7",
4
+ "description": "Bootstrap RN provides Bootstrap components for React Native.",
5
+ "author": "Markus Wetzel <markuswetzel@gmx.net>",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "react",
9
+ "native",
10
+ "react-native",
11
+ "bootstrap",
12
+ "ui",
13
+ "style"
14
+ ],
15
+ "repository": "https://github.com/examunity/bootstrap-rn.git",
16
+ "bugs": {
17
+ "url": "https://github.com/examunity/bootstrap-rn/issues"
18
+ },
19
+ "main": "lib/module/index.js",
20
+ "module": "lib/module/index.js",
21
+ "source": "src/index.ts",
22
+ "types": "./lib/typescript/index.d.ts",
23
+ "scripts": {
24
+ "check-types": "tsc --noEmit",
25
+ "build": "bob build",
26
+ "prepare": "packsy validate && yarn build",
27
+ "lint": "packsy pre-commit && yarn check-types"
28
+ },
29
+ "files": [
30
+ "src",
31
+ "lib"
32
+ ],
33
+ "dependencies": {
34
+ "@floating-ui/react": "^0.27.16",
35
+ "@react-aria/focus": "^3.21.3",
36
+ "@rn-primitives/hooks": "^1.3.0",
37
+ "@rn-primitives/portal": "^1.3.0",
38
+ "css-to-react-native": "^3.2.0",
39
+ "tiny-invariant": "^1.3.1"
40
+ },
41
+ "devDependencies": {
42
+ "@types/react": "~19.1.10",
43
+ "@types/react-dom": "~19.1.10",
44
+ "packsy": "^0.2.5",
45
+ "react": "19.1.0",
46
+ "react-dom": "19.1.0",
47
+ "react-native": "0.81.5",
48
+ "react-native-builder-bob": "^0.40.17",
49
+ "react-native-safe-area-context": "~5.6.0",
50
+ "react-native-svg": "15.12.1",
51
+ "react-native-web": "^0.21.0",
52
+ "typescript": "~5.9.2"
53
+ },
54
+ "peerDependencies": {
55
+ "react": ">=19",
56
+ "react-dom": ">=19",
57
+ "react-native": ">=0.78",
58
+ "react-native-safe-area-context": ">=5",
59
+ "react-native-svg": ">=15",
60
+ "react-native-web": ">=0.20"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "react-dom": {
64
+ "optional": true
65
+ },
66
+ "react-native-web": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "husky": {
71
+ "hooks": {
72
+ "pre-commit": "packsy pre-commit"
73
+ }
74
+ },
75
+ "react-native-builder-bob": {
76
+ "source": "src",
77
+ "output": "lib",
78
+ "targets": [
79
+ [
80
+ "module",
81
+ {
82
+ "esm": true
83
+ }
84
+ ],
85
+ "typescript"
86
+ ]
87
+ },
88
+ "engines": {
89
+ "node": ">= 16",
90
+ "npm": ">= 8"
91
+ }
92
+ }
package/src/Context.ts CHANGED
@@ -1,38 +1,37 @@
1
- import React from 'react';
2
- import { View as BaseView } from 'react-native';
3
- import type { ExtendedStyle, Viewport } from './types';
4
-
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- type ModifierProps = any;
7
-
8
- export type Modifier = (
9
- props: ModifierProps,
10
- ref: React.Ref<unknown>,
11
- ) => ModifierProps & { ref?: React.Ref<unknown> };
12
-
13
- export type Modifiers = {
14
- useFormField?: Modifier;
15
- useTabbable?: Modifier;
16
- useActionable?: Modifier;
17
- };
18
-
19
- export type BootstrapRNContextType = {
20
- utilities: Record<string, ExtendedStyle>;
21
- modifiers: Modifiers;
22
- scrollbars: {
23
- hide: () => void;
24
- show: () => void;
25
- };
26
- fixed: React.RefObject<BaseView>[];
27
- getViewport(): Viewport;
28
- addFixedElement: (ref: unknown) => {
29
- remove: () => void;
30
- };
31
- generateKey(prefix: string): string;
32
- };
33
-
34
- const Context = React.createContext<BootstrapRNContextType | null>(null);
35
-
36
- Context.displayName = 'BootstrapRNContext';
37
-
38
- export default Context;
1
+ import React from 'react';
2
+ import { View as BaseView } from 'react-native';
3
+ import type { ExtendedStyle, Viewport } from './types';
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ type ModifierProps = any;
7
+
8
+ export type Modifier = (
9
+ props: ModifierProps,
10
+ ref: React.Ref<unknown>,
11
+ ) => ModifierProps & { ref?: React.Ref<unknown> };
12
+
13
+ export type Modifiers = {
14
+ useFormField?: Modifier;
15
+ useTabbable?: Modifier;
16
+ useActionable?: Modifier;
17
+ };
18
+
19
+ export type BootstrapRNContextType = {
20
+ utilities: Record<string, ExtendedStyle>;
21
+ modifiers: Modifiers;
22
+ scrollbars: {
23
+ hide: () => void;
24
+ show: () => void;
25
+ };
26
+ fixed: React.RefObject<BaseView>[];
27
+ getViewport(): Viewport;
28
+ addFixedElement: (ref: unknown) => {
29
+ remove: () => void;
30
+ };
31
+ };
32
+
33
+ const Context = React.createContext<BootstrapRNContextType | null>(null);
34
+
35
+ Context.displayName = 'BootstrapRNContext';
36
+
37
+ export default Context;
package/src/Provider.tsx CHANGED
@@ -1,66 +1,61 @@
1
- import React, { useMemo, useRef } from 'react';
2
- import { View as BaseView } from 'react-native';
3
- import { OverlayProvider } from '@react-native-aria/overlays';
4
- import useViewport from './hooks/useViewport';
5
- import useScrollbarEffects from './hooks/useScrollbarEffects';
6
- import Context, { Modifiers } from './Context';
7
- import type { ExtendedStyle, Viewport } from './types';
8
-
9
- type ProviderProps = {
10
- children: React.ReactNode;
11
- utilities?: Record<string, ExtendedStyle>;
12
- modifiers?: Modifiers;
13
- ssrViewport: Viewport;
14
- };
15
-
16
- function Provider({
17
- children,
18
- utilities = {},
19
- modifiers = {},
20
- ssrViewport,
21
- }: ProviderProps) {
22
- const viewport = useViewport(ssrViewport);
23
-
24
- const fixed: React.RefObject<BaseView>[] = useMemo(() => [], []);
25
-
26
- const counter = useRef(0);
27
-
28
- const scrollbars = useScrollbarEffects(fixed);
29
-
30
- const context = useMemo(
31
- () => ({
32
- utilities,
33
- modifiers,
34
- scrollbars,
35
- fixed,
36
- getViewport() {
37
- return viewport;
38
- },
39
- addFixedElement(ref: React.RefObject<BaseView>) {
40
- fixed.push(ref);
41
-
42
- return {
43
- remove() {
44
- const index = fixed.findIndex((item) => item === ref);
45
-
46
- fixed.splice(index, 1);
47
- },
48
- };
49
- },
50
- generateKey(prefix: string) {
51
- counter.current += 1;
52
-
53
- return `ui-${prefix}-${counter.current}`;
54
- },
55
- }),
56
- [utilities, modifiers, scrollbars, fixed, viewport, fixed, counter],
57
- );
58
-
59
- return (
60
- <Context.Provider value={context}>
61
- <OverlayProvider>{children}</OverlayProvider>
62
- </Context.Provider>
63
- );
64
- }
65
-
66
- export default Provider;
1
+ import React, { useMemo, useRef } from 'react';
2
+ import { View as BaseView } from 'react-native';
3
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
4
+ import useViewport from './hooks/useViewport';
5
+ import useScrollbarEffects from './hooks/useScrollbarEffects';
6
+ import Context, { Modifiers } from './Context';
7
+ import type { ExtendedStyle, Viewport } from './types';
8
+
9
+ type ProviderProps = {
10
+ children: React.ReactNode;
11
+ utilities?: Record<string, ExtendedStyle>;
12
+ modifiers?: Modifiers;
13
+ ssrViewport: Viewport;
14
+ };
15
+
16
+ function Provider({
17
+ children,
18
+ utilities = {},
19
+ modifiers = {},
20
+ ssrViewport,
21
+ }: ProviderProps) {
22
+ const viewport = useViewport(ssrViewport);
23
+
24
+ const fixed: React.RefObject<BaseView>[] = useMemo(() => [], []);
25
+
26
+ const counter = useRef(0);
27
+
28
+ const scrollbars = useScrollbarEffects(fixed);
29
+
30
+ const context = useMemo(
31
+ () => ({
32
+ utilities,
33
+ modifiers,
34
+ scrollbars,
35
+ fixed,
36
+ getViewport() {
37
+ return viewport;
38
+ },
39
+ addFixedElement(ref: React.RefObject<BaseView>) {
40
+ fixed.push(ref);
41
+
42
+ return {
43
+ remove() {
44
+ const index = fixed.findIndex((item) => item === ref);
45
+
46
+ fixed.splice(index, 1);
47
+ },
48
+ };
49
+ },
50
+ }),
51
+ [utilities, modifiers, scrollbars, fixed, viewport, fixed, counter],
52
+ );
53
+
54
+ return (
55
+ <Context.Provider value={context}>
56
+ <SafeAreaProvider>{children}</SafeAreaProvider>
57
+ </Context.Provider>
58
+ );
59
+ }
60
+
61
+ export default Provider;
@@ -1,4 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
2
3
  import StyleSheet from '../style/StyleSheet';
3
4
  import css from '../style/css';
4
5
  import { getStyles } from '../utils';
@@ -29,7 +30,21 @@ const Body = React.forwardRef<ViewRef, BodyProps>((props, ref) => {
29
30
 
30
31
  const media = useMedia();
31
32
 
32
- const resolveStyle = useStyle([classes, style], styleName);
33
+ const insets = useSafeAreaInsets();
34
+
35
+ const resolveStyle = useStyle(
36
+ [
37
+ classes,
38
+ {
39
+ marginTop: insets.top,
40
+ marginBottom: insets.bottom,
41
+ marginRight: insets.right,
42
+ marginLeft: insets.left,
43
+ },
44
+ style,
45
+ ],
46
+ styleName,
47
+ );
33
48
  const resolveTextStyle = useStyle([textClasses, textStyle]);
34
49
 
35
50
  const contextValue = useMemo(
@@ -1,66 +1,66 @@
1
- import React, { useState } from 'react';
2
- import {
3
- TextInput as BaseTextInput,
4
- TextInputProps as BaseTextInputProps,
5
- TextInputFocusEventData,
6
- NativeSyntheticEvent,
7
- } from 'react-native';
8
- import useMedia from '../hooks/useMedia';
9
- import useStyle from '../hooks/useStyle';
10
- import type { ExtendedTextStyle, StyleProp, StyleName } from '../types';
11
-
12
- export type TextInputRef = BaseTextInput;
13
-
14
- export interface TextInputProps extends Omit<BaseTextInputProps, 'style'> {
15
- onFocus?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
16
- onBlur?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
17
- autoFocus?: boolean;
18
- style?: StyleProp<ExtendedTextStyle>;
19
- styleName?: StyleName;
20
- disabled?: boolean;
21
- readOnly?: boolean;
22
- // Info: Property is not on BaseTextInputProps yet.
23
- rows?: number;
24
- }
25
-
26
- const TextInput = React.forwardRef<TextInputRef, TextInputProps>(
27
- (props, ref) => {
28
- const {
29
- onFocus = () => {},
30
- onBlur = () => {},
31
- autoFocus = false,
32
- style,
33
- styleName,
34
- ...elementProps
35
- } = props;
36
-
37
- const [focused, setFocused] = useState(autoFocus);
38
-
39
- const media = useMedia();
40
- const resolveStyle = useStyle(style, styleName);
41
-
42
- return (
43
- <BaseTextInput
44
- {...elementProps}
45
- ref={ref}
46
- onFocus={(event) => {
47
- setFocused(true);
48
- onFocus(event);
49
- }}
50
- onBlur={(event) => {
51
- setFocused(false);
52
- onBlur(event);
53
- }}
54
- autoFocus={autoFocus}
55
- style={resolveStyle({
56
- media,
57
- interaction: { focus: focused, focusVisible: focused },
58
- })}
59
- />
60
- );
61
- },
62
- );
63
-
64
- TextInput.displayName = 'TextInput';
65
-
66
- export default TextInput;
1
+ import React, { useState } from 'react';
2
+ import {
3
+ TextInput as BaseTextInput,
4
+ TextInputProps as BaseTextInputProps,
5
+ FocusEvent,
6
+ BlurEvent,
7
+ } from 'react-native';
8
+ import useMedia from '../hooks/useMedia';
9
+ import useStyle from '../hooks/useStyle';
10
+ import type { ExtendedTextStyle, StyleProp, StyleName } from '../types';
11
+
12
+ export type TextInputRef = BaseTextInput;
13
+
14
+ export interface TextInputProps extends Omit<BaseTextInputProps, 'style'> {
15
+ onFocus?: (e: FocusEvent) => void;
16
+ onBlur?: (e: BlurEvent) => void;
17
+ autoFocus?: boolean;
18
+ style?: StyleProp<ExtendedTextStyle>;
19
+ styleName?: StyleName;
20
+ disabled?: boolean;
21
+ readOnly?: boolean;
22
+ // Info: Property is not on BaseTextInputProps yet.
23
+ rows?: number;
24
+ }
25
+
26
+ const TextInput = React.forwardRef<TextInputRef, TextInputProps>(
27
+ (props, ref) => {
28
+ const {
29
+ onFocus = () => {},
30
+ onBlur = () => {},
31
+ autoFocus = false,
32
+ style,
33
+ styleName,
34
+ ...elementProps
35
+ } = props;
36
+
37
+ const [focused, setFocused] = useState(autoFocus);
38
+
39
+ const media = useMedia();
40
+ const resolveStyle = useStyle(style, styleName);
41
+
42
+ return (
43
+ <BaseTextInput
44
+ {...elementProps}
45
+ ref={ref}
46
+ onFocus={(event) => {
47
+ setFocused(true);
48
+ onFocus(event);
49
+ }}
50
+ onBlur={(event) => {
51
+ setFocused(false);
52
+ onBlur(event);
53
+ }}
54
+ autoFocus={autoFocus}
55
+ style={resolveStyle({
56
+ media,
57
+ interaction: { focus: focused, focusVisible: focused },
58
+ })}
59
+ />
60
+ );
61
+ },
62
+ );
63
+
64
+ TextInput.displayName = 'TextInput';
65
+
66
+ export default TextInput;