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.
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/forms/RadioGroup.js.map +1 -1
- package/lib/commonjs/components/forms/internals/PickerNative.js.map +1 -1
- package/lib/commonjs/components/modal/Modal.js +1 -1
- package/lib/commonjs/components/modal/Modal.js.map +1 -1
- package/lib/commonjs/components/modal/ModalBody.js +1 -1
- package/lib/commonjs/components/modal/ModalBody.js.map +1 -1
- package/lib/commonjs/components/offcanvas/OffcanvasBody.js.map +1 -1
- package/lib/commonjs/style/makeUtilities.js.map +1 -1
- package/lib/module/components/Image.js.map +1 -1
- package/lib/module/components/forms/RadioGroup.js.map +1 -1
- package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
- package/lib/module/components/modal/Modal.js +1 -1
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/module/components/modal/ModalBody.js +1 -1
- package/lib/module/components/modal/ModalBody.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasBody.js.map +1 -1
- package/lib/module/style/makeUtilities.js.map +1 -1
- package/lib/types/components/forms/Picker.d.ts +4 -4
- package/lib/types/components/forms/Picker.d.ts.map +1 -1
- package/lib/types/components/forms/PickerItem.d.ts +1 -1
- package/lib/types/components/forms/PickerItem.d.ts.map +1 -1
- package/lib/types/components/forms/Radio.d.ts +1 -1
- package/lib/types/components/forms/Radio.d.ts.map +1 -1
- package/lib/types/components/forms/RadioContext.d.ts +2 -2
- package/lib/types/components/forms/RadioContext.d.ts.map +1 -1
- package/lib/types/components/forms/RadioGroup.d.ts +2 -2
- package/lib/types/components/forms/RadioGroup.d.ts.map +1 -1
- package/lib/types/components/forms/internals/PickerNative.d.ts.map +1 -1
- package/lib/types/components/forms/internals/PickerNativeContext.d.ts +2 -2
- package/lib/types/components/forms/internals/PickerNativeContext.d.ts.map +1 -1
- package/lib/types/components/forms/internals/PickerNativeItem.d.ts +1 -1
- package/lib/types/components/forms/internals/PickerNativeItem.d.ts.map +1 -1
- package/lib/types/components/forms/internals/PickerWebItem.d.ts +1 -1
- package/lib/types/components/forms/internals/PickerWebItem.d.ts.map +1 -1
- package/lib/types/components/modal/Modal.d.ts +3 -4
- package/lib/types/components/modal/Modal.d.ts.map +1 -1
- package/lib/types/components/modal/ModalBody.d.ts +3 -6
- package/lib/types/components/modal/ModalBody.d.ts.map +1 -1
- package/lib/types/components/offcanvas/OffcanvasBody.d.ts +3 -4
- package/lib/types/components/offcanvas/OffcanvasBody.d.ts.map +1 -1
- package/lib/types/style/makeUtilities.d.ts +6 -2
- package/lib/types/style/makeUtilities.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Image.tsx +1 -1
- package/src/components/forms/Picker.tsx +191 -191
- package/src/components/forms/PickerItem.tsx +32 -32
- package/src/components/forms/Radio.tsx +37 -37
- package/src/components/forms/RadioContext.ts +13 -13
- package/src/components/forms/RadioGroup.tsx +42 -40
- package/src/components/forms/internals/PickerNative.tsx +193 -195
- package/src/components/forms/internals/PickerNativeContext.ts +14 -14
- package/src/components/forms/internals/PickerNativeItem.tsx +59 -59
- package/src/components/forms/internals/PickerWebItem.tsx +36 -36
- package/src/components/modal/Modal.tsx +234 -233
- package/src/components/modal/ModalBody.tsx +52 -56
- package/src/components/offcanvas/OffcanvasBody.tsx +64 -66
- package/src/style/makeUtilities.ts +79 -76
|
@@ -1,66 +1,64 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
|
59
|
-
| ((u: 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(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
}
|