bootstrap-rn 0.3.5 → 0.3.6

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 (58) hide show
  1. package/lib/commonjs/components/Image.js.map +1 -1
  2. package/lib/commonjs/components/forms/RadioGroup.js.map +1 -1
  3. package/lib/commonjs/components/forms/internals/PickerNative.js.map +1 -1
  4. package/lib/commonjs/components/modal/Modal.js +1 -1
  5. package/lib/commonjs/components/modal/Modal.js.map +1 -1
  6. package/lib/commonjs/components/modal/ModalBody.js +1 -1
  7. package/lib/commonjs/components/modal/ModalBody.js.map +1 -1
  8. package/lib/commonjs/components/offcanvas/OffcanvasBody.js.map +1 -1
  9. package/lib/commonjs/style/makeUtilities.js.map +1 -1
  10. package/lib/module/components/Image.js.map +1 -1
  11. package/lib/module/components/forms/RadioGroup.js.map +1 -1
  12. package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
  13. package/lib/module/components/modal/Modal.js +1 -1
  14. package/lib/module/components/modal/Modal.js.map +1 -1
  15. package/lib/module/components/modal/ModalBody.js +1 -1
  16. package/lib/module/components/modal/ModalBody.js.map +1 -1
  17. package/lib/module/components/offcanvas/OffcanvasBody.js.map +1 -1
  18. package/lib/module/style/makeUtilities.js.map +1 -1
  19. package/lib/types/components/forms/Picker.d.ts +4 -4
  20. package/lib/types/components/forms/Picker.d.ts.map +1 -1
  21. package/lib/types/components/forms/PickerItem.d.ts +1 -1
  22. package/lib/types/components/forms/PickerItem.d.ts.map +1 -1
  23. package/lib/types/components/forms/Radio.d.ts +1 -1
  24. package/lib/types/components/forms/Radio.d.ts.map +1 -1
  25. package/lib/types/components/forms/RadioContext.d.ts +2 -2
  26. package/lib/types/components/forms/RadioContext.d.ts.map +1 -1
  27. package/lib/types/components/forms/RadioGroup.d.ts +2 -2
  28. package/lib/types/components/forms/RadioGroup.d.ts.map +1 -1
  29. package/lib/types/components/forms/internals/PickerNative.d.ts.map +1 -1
  30. package/lib/types/components/forms/internals/PickerNativeContext.d.ts +2 -2
  31. package/lib/types/components/forms/internals/PickerNativeContext.d.ts.map +1 -1
  32. package/lib/types/components/forms/internals/PickerNativeItem.d.ts +1 -1
  33. package/lib/types/components/forms/internals/PickerNativeItem.d.ts.map +1 -1
  34. package/lib/types/components/forms/internals/PickerWebItem.d.ts +1 -1
  35. package/lib/types/components/forms/internals/PickerWebItem.d.ts.map +1 -1
  36. package/lib/types/components/modal/Modal.d.ts +3 -4
  37. package/lib/types/components/modal/Modal.d.ts.map +1 -1
  38. package/lib/types/components/modal/ModalBody.d.ts +3 -6
  39. package/lib/types/components/modal/ModalBody.d.ts.map +1 -1
  40. package/lib/types/components/offcanvas/OffcanvasBody.d.ts +3 -4
  41. package/lib/types/components/offcanvas/OffcanvasBody.d.ts.map +1 -1
  42. package/lib/types/style/makeUtilities.d.ts +6 -2
  43. package/lib/types/style/makeUtilities.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/Image.tsx +1 -1
  46. package/src/components/forms/Picker.tsx +191 -191
  47. package/src/components/forms/PickerItem.tsx +32 -32
  48. package/src/components/forms/Radio.tsx +37 -37
  49. package/src/components/forms/RadioContext.ts +13 -13
  50. package/src/components/forms/RadioGroup.tsx +42 -40
  51. package/src/components/forms/internals/PickerNative.tsx +193 -195
  52. package/src/components/forms/internals/PickerNativeContext.ts +14 -14
  53. package/src/components/forms/internals/PickerNativeItem.tsx +59 -59
  54. package/src/components/forms/internals/PickerWebItem.tsx +36 -36
  55. package/src/components/modal/Modal.tsx +234 -233
  56. package/src/components/modal/ModalBody.tsx +52 -56
  57. package/src/components/offcanvas/OffcanvasBody.tsx +64 -66
  58. package/src/style/makeUtilities.ts +79 -76
@@ -1,66 +1,64 @@
1
- import React, { useContext } from 'react';
2
- import { ScrollView as BaseScrollView } from 'react-native';
3
- import css from '../../style/css';
4
- import StyleSheet from '../../style/StyleSheet';
5
- import ScrollView from '../ScrollView';
6
- import { GRID_BREAKPOINTS } from '../../theme/proxies';
7
- import { infix, next } from '../../theme/breakpoints';
8
- import { getStyles, each } from '../../utils';
9
- import NavbarContext from '../navbar/NavbarContext';
10
- import type { ExtendedViewStyle, StyleProp } from '../../types';
11
- import { ViewProps } from '../View';
12
-
13
- export interface OffcanvasBodyProps extends ViewProps {
14
- contentContainerStyle?: StyleProp<ExtendedViewStyle>;
15
- }
16
-
17
- const styles = StyleSheet.create({
18
- '.offcanvas-body': css`
19
- // flex-grow: 1;
20
- padding: $offcanvas-padding-y $offcanvas-padding-x;
21
- // overflow-y: auto;
22
- `,
23
- // Navbar styles
24
- ...each(GRID_BREAKPOINTS, (breakpoint) => ({
25
- [`.navbar-expand${infix(next(breakpoint))} .offcanvas-body`]: css`
26
- @include media-breakpoint-up(${next(breakpoint)}) {
27
- display: flex;
28
- flex-grow: 0;
29
- padding: 0;
30
- // overflow-y: visible;
31
- }
32
- `,
33
- })),
34
- });
35
-
36
- const OffcanvasBody = React.forwardRef<BaseScrollView, OffcanvasBodyProps>(
37
- (props, ref) => {
38
- const { children, style, contentContainerStyle, ...elementProps } = props;
39
-
40
- const navbar = useContext(NavbarContext);
41
-
42
- const contentContainerClasses = getStyles(styles, [
43
- '.offcanvas-body',
44
- navbar &&
45
- navbar.expand &&
46
- `.navbar-expand${
47
- navbar.expand === true ? '' : `-${navbar.expand}`
48
- } .offcanvas-body`,
49
- ]);
50
-
51
- return (
52
- <ScrollView
53
- {...elementProps}
54
- ref={ref}
55
- style={style}
56
- contentContainerStyle={[contentContainerClasses, contentContainerStyle]}
57
- >
58
- {children}
59
- </ScrollView>
60
- );
61
- },
62
- );
63
-
64
- OffcanvasBody.displayName = 'OffcanvasBody';
65
-
66
- export default OffcanvasBody;
1
+ import React, { useContext } from 'react';
2
+ import css from '../../style/css';
3
+ import StyleSheet from '../../style/StyleSheet';
4
+ import ScrollView, { ScrollViewProps, ScrollViewRef } from '../ScrollView';
5
+ import { GRID_BREAKPOINTS } from '../../theme/proxies';
6
+ import { infix, next } from '../../theme/breakpoints';
7
+ import { getStyles, each } from '../../utils';
8
+ import NavbarContext from '../navbar/NavbarContext';
9
+ import type { ExtendedViewStyle, StyleProp } from '../../types';
10
+
11
+ export interface OffcanvasBodyProps extends ScrollViewProps {
12
+ contentContainerStyle?: StyleProp<ExtendedViewStyle>;
13
+ }
14
+
15
+ const styles = StyleSheet.create({
16
+ '.offcanvas-body': css`
17
+ // flex-grow: 1;
18
+ padding: $offcanvas-padding-y $offcanvas-padding-x;
19
+ // overflow-y: auto;
20
+ `,
21
+ // Navbar styles
22
+ ...each(GRID_BREAKPOINTS, (breakpoint) => ({
23
+ [`.navbar-expand${infix(next(breakpoint))} .offcanvas-body`]: css`
24
+ @include media-breakpoint-up(${next(breakpoint)}) {
25
+ display: flex;
26
+ flex-grow: 0;
27
+ padding: 0;
28
+ // overflow-y: visible;
29
+ }
30
+ `,
31
+ })),
32
+ });
33
+
34
+ const OffcanvasBody = React.forwardRef<ScrollViewRef, OffcanvasBodyProps>(
35
+ (props, ref) => {
36
+ const { children, style, contentContainerStyle, ...elementProps } = props;
37
+
38
+ const navbar = useContext(NavbarContext);
39
+
40
+ const contentContainerClasses = getStyles(styles, [
41
+ '.offcanvas-body',
42
+ navbar &&
43
+ navbar.expand &&
44
+ `.navbar-expand${
45
+ navbar.expand === true ? '' : `-${navbar.expand}`
46
+ } .offcanvas-body`,
47
+ ]);
48
+
49
+ return (
50
+ <ScrollView
51
+ {...elementProps}
52
+ ref={ref}
53
+ style={style}
54
+ contentContainerStyle={[contentContainerClasses, contentContainerStyle]}
55
+ >
56
+ {children}
57
+ </ScrollView>
58
+ );
59
+ },
60
+ );
61
+
62
+ OffcanvasBody.displayName = 'OffcanvasBody';
63
+
64
+ export default OffcanvasBody;
@@ -1,76 +1,79 @@
1
- import css from './css';
2
- import { GRID_BREAKPOINTS } from '../theme/proxies';
3
- import utilities from '../theme/utilities';
4
- import { each } from '../utils';
5
- import type { StyleUtility } from '../types';
6
-
7
- export function makeUtility(options: StyleUtility) {
8
- return each(options.values, (key, value) => {
9
- const name = options.class || options.property;
10
- const suffix = key === 'null' ? '' : `-${key}`;
11
-
12
- // We use css as a function, because of ts-styled-plugin error.
13
- //
14
- // Equivalent code:
15
- // css`
16
- // ${options.property}: ${value};
17
- // `
18
-
19
- const styles = {
20
- [`${name}${suffix}`]: css(['', ': ', ';'], options.property, value),
21
- };
22
-
23
- if (!options.responsive) {
24
- return styles;
25
- }
26
-
27
- return {
28
- ...styles,
29
- ...each(GRID_BREAKPOINTS, (breakpoint) => {
30
- if (breakpoint === 'xs') {
31
- return {};
32
- }
33
-
34
- // We use css as a function, because of ts-styled-plugin error.
35
- //
36
- // Equivalent code:
37
- // css`
38
- // @include media-breakpoint-up(${breakpoint}) {
39
- // ${options.property}: ${value};
40
- // }
41
- // `
42
-
43
- return {
44
- [`${name}-${breakpoint}${suffix}`]: css(
45
- ['@include media-breakpoint-up(', ') {\n', ': ', ';\n}'],
46
- breakpoint,
47
- options.property,
48
- value,
49
- ),
50
- };
51
- }),
52
- };
53
- });
54
- }
55
-
56
- export default function makeUtilities(
57
- resolve:
58
- | Record<string, StyleUtility>
59
- | ((u: Record<string, StyleUtility>) => Record<string, StyleUtility>),
60
- ) {
61
- const customUtilities =
62
- typeof resolve === 'function' ? resolve(utilities) : resolve;
63
-
64
- const definitions = Object.values({
65
- ...utilities,
66
- ...customUtilities,
67
- }).reduce((result, utility) => {
68
- if (!utility) {
69
- return result;
70
- }
71
-
72
- return Object.assign(result, makeUtility(utility));
73
- }, {});
74
-
75
- return definitions;
76
- }
1
+ import css from './css';
2
+ import { GRID_BREAKPOINTS } from '../theme/proxies';
3
+ import utilities from '../theme/utilities';
4
+ import { each } from '../utils';
5
+ import type { ExtendedStyle, StyleUtility } from '../types';
6
+
7
+ export function makeUtility(options: StyleUtility) {
8
+ return each(options.values, (key, value) => {
9
+ const name = options.class || options.property;
10
+ const suffix = key === 'null' ? '' : `-${key}`;
11
+
12
+ // We use css as a function, because of ts-styled-plugin error.
13
+ //
14
+ // Equivalent code:
15
+ // css`
16
+ // ${options.property}: ${value};
17
+ // `
18
+
19
+ const styles = {
20
+ [`${name}${suffix}`]: css(['', ': ', ';'], options.property, value),
21
+ };
22
+
23
+ if (!options.responsive) {
24
+ return styles;
25
+ }
26
+
27
+ return {
28
+ ...styles,
29
+ ...each(GRID_BREAKPOINTS, (breakpoint) => {
30
+ if (breakpoint === 'xs') {
31
+ return {};
32
+ }
33
+
34
+ // We use css as a function, because of ts-styled-plugin error.
35
+ //
36
+ // Equivalent code:
37
+ // css`
38
+ // @include media-breakpoint-up(${breakpoint}) {
39
+ // ${options.property}: ${value};
40
+ // }
41
+ // `
42
+
43
+ return {
44
+ [`${name}-${breakpoint}${suffix}`]: css(
45
+ ['@include media-breakpoint-up(', ') {\n', ': ', ';\n}'],
46
+ breakpoint,
47
+ options.property,
48
+ value,
49
+ ),
50
+ };
51
+ }),
52
+ };
53
+ });
54
+ }
55
+
56
+ export default function makeUtilities<T extends string>(
57
+ resolve:
58
+ | { [K in T]: StyleUtility }
59
+ | ((u: Record<string, StyleUtility>) => { [K in T]: StyleUtility }),
60
+ ) {
61
+ const customUtilities =
62
+ typeof resolve === 'function' ? resolve(utilities) : resolve;
63
+
64
+ const definitions = Object.values({
65
+ ...utilities,
66
+ ...customUtilities,
67
+ }).reduce(
68
+ (result, utility) => {
69
+ if (!utility) {
70
+ return result;
71
+ }
72
+
73
+ return Object.assign(result, makeUtility(utility));
74
+ },
75
+ {} as { [K in T]: ExtendedStyle },
76
+ );
77
+
78
+ return definitions;
79
+ }