@codeleap/mobile 1.9.28 → 1.9.29
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/dist/components/Backdrop.d.ts +66 -0
- package/dist/components/Backdrop.js +70 -0
- package/dist/components/Backdrop.js.map +1 -0
- package/dist/components/Button.d.ts +3 -3
- package/dist/components/Button.js.map +1 -1
- package/dist/components/FileInput.js +0 -2
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Image.js +2 -2
- package/dist/components/Image.js.map +1 -1
- package/dist/components/List.d.ts +23 -4
- package/dist/components/List.js +17 -1
- package/dist/components/List.js.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +26 -27
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +3 -9
- package/dist/components/Modal/styles.js +26 -17
- package/dist/components/Modal/styles.js.map +1 -1
- package/dist/components/NewModal/index.d.ts +27 -0
- package/dist/components/NewModal/index.js +99 -0
- package/dist/components/NewModal/index.js.map +1 -0
- package/dist/components/NewModal/styles.d.ts +57 -0
- package/dist/components/NewModal/styles.js +58 -0
- package/dist/components/NewModal/styles.js.map +1 -0
- package/dist/components/Overlay.js +13 -9
- package/dist/components/Overlay.js.map +1 -1
- package/dist/components/Scroll.d.ts +4 -2
- package/dist/components/Scroll.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +42 -0
- package/dist/components/SegmentedControl/index.js +137 -0
- package/dist/components/SegmentedControl/index.js.map +1 -0
- package/dist/components/SegmentedControl/styles.d.ts +54 -0
- package/dist/components/SegmentedControl/styles.js +36 -0
- package/dist/components/SegmentedControl/styles.js.map +1 -0
- package/dist/components/SegmentedControl.d.ts +5 -0
- package/dist/components/SegmentedControl.js +32 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Text.d.ts +8 -3
- package/dist/components/Text.js +12 -5
- package/dist/components/Text.js.map +1 -1
- package/dist/components/TextInput.d.ts +4 -2
- package/dist/components/TextInput.js +2 -2
- package/dist/components/TextInput.js.map +1 -1
- package/dist/components/Touchable.d.ts +5 -3
- package/dist/components/Touchable.js +26 -19
- package/dist/components/Touchable.js.map +1 -1
- package/dist/components/View.js +1 -1
- package/dist/components/View.js.map +1 -1
- package/dist/components/_Modal/index.d.ts +27 -0
- package/dist/components/_Modal/index.js +114 -0
- package/dist/components/_Modal/index.js.map +1 -0
- package/dist/components/_Modal/styles.d.ts +64 -0
- package/dist/components/_Modal/styles.js +60 -0
- package/dist/components/_Modal/styles.js.map +1 -0
- package/dist/components/components.d.ts +2 -0
- package/dist/components/components.js +2 -0
- package/dist/components/components.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/ModalManager/components.d.ts +5 -5
- package/dist/utils/ModalManager/components.js +16 -9
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.d.ts +8 -3
- package/dist/utils/ModalManager/context.js +47 -23
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.d.ts +3 -7
- package/dist/utils/ModalManager/index.js +1 -1
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/PermissionManager/components.d.ts +18 -0
- package/dist/utils/PermissionManager/components.js +52 -0
- package/dist/utils/PermissionManager/components.js.map +1 -0
- package/dist/utils/PermissionManager/context.d.ts +52 -0
- package/dist/utils/PermissionManager/context.js +325 -0
- package/dist/utils/PermissionManager/context.js.map +1 -0
- package/dist/utils/PermissionManager/index.d.ts +4 -0
- package/dist/utils/PermissionManager/index.js +9 -0
- package/dist/utils/PermissionManager/index.js.map +1 -0
- package/dist/utils/PermissionManager/types.d.ts +13 -0
- package/dist/utils/PermissionManager/types.js +3 -0
- package/dist/utils/PermissionManager/types.js.map +1 -0
- package/dist/utils/hooks.d.ts +6 -0
- package/dist/utils/hooks.js +62 -0
- package/dist/utils/hooks.js.map +1 -0
- package/package.json +1 -1
- package/src/components/Backdrop.tsx +77 -0
- package/src/components/Button.tsx +3 -2
- package/src/components/FileInput.tsx +2 -2
- package/src/components/Image.tsx +3 -2
- package/src/components/List.tsx +44 -5
- package/src/components/Modal/index.tsx +38 -49
- package/src/components/Modal/styles.ts +35 -31
- package/src/components/Overlay.tsx +22 -13
- package/src/components/Scroll.tsx +3 -1
- package/src/components/SegmentedControl/index.tsx +182 -0
- package/src/components/SegmentedControl/styles.ts +65 -0
- package/src/components/Select/index.tsx +1 -2
- package/src/components/Text.tsx +23 -10
- package/src/components/TextInput.tsx +4 -2
- package/src/components/Touchable.tsx +31 -20
- package/src/components/View.tsx +1 -1
- package/src/components/_Modal/index.tsx +162 -0
- package/src/components/_Modal/styles.ts +125 -0
- package/src/components/components.ts +3 -0
- package/src/index.ts +6 -0
- package/src/modules/imageCropPicker.d.ts +497 -0
- package/src/modules/index.d.ts +186 -0
- package/src/utils/ModalManager/components.tsx +20 -9
- package/src/utils/ModalManager/context.tsx +69 -30
- package/src/utils/ModalManager/index.ts +6 -2
- package/src/utils/PermissionManager/context.tsx +299 -0
- package/src/utils/PermissionManager/index.ts +20 -0
- package/src/utils/PermissionManager/types.ts +24 -0
- package/src/utils/hooks.ts +65 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare type SegmentedControlStates = 'selected';
|
|
2
|
+
export declare type SegmentedControlComposition = 'selectedBubble' | 'wrapper' | 'scroll' | 'scrollContent' | 'text' | `text:${SegmentedControlStates}` | 'button' | `button:${SegmentedControlStates}`;
|
|
3
|
+
export declare const SegmentedControlStyles: {
|
|
4
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
5
|
+
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
6
|
+
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
7
|
+
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
8
|
+
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
9
|
+
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
10
|
+
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
11
|
+
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
12
|
+
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
13
|
+
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
14
|
+
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
15
|
+
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
16
|
+
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
17
|
+
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
18
|
+
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
19
|
+
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
20
|
+
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
21
|
+
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
22
|
+
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
23
|
+
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
24
|
+
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
25
|
+
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
26
|
+
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
27
|
+
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
28
|
+
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
29
|
+
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
30
|
+
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
31
|
+
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
32
|
+
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
33
|
+
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
34
|
+
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
35
|
+
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
36
|
+
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
37
|
+
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
38
|
+
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
39
|
+
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
40
|
+
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
41
|
+
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
42
|
+
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
43
|
+
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
44
|
+
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
45
|
+
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
46
|
+
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
47
|
+
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
48
|
+
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
49
|
+
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
50
|
+
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
51
|
+
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
52
|
+
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
53
|
+
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<SegmentedControlComposition, any>>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SegmentedControlStyles = void 0;
|
|
15
|
+
var common_1 = require("@codeleap/common");
|
|
16
|
+
var createSegmentedControlStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
+
var presets = (0, common_1.includePresets)(function (style) { return createSegmentedControlStyle(function () { return ({ scrollContent: style }); }); });
|
|
18
|
+
exports.SegmentedControlStyles = __assign(__assign({}, presets), { default: createSegmentedControlStyle(function (theme) {
|
|
19
|
+
return {
|
|
20
|
+
text: {
|
|
21
|
+
color: theme.colors.text,
|
|
22
|
+
},
|
|
23
|
+
'text:selected': {
|
|
24
|
+
color: theme.colors.white,
|
|
25
|
+
},
|
|
26
|
+
scroll: {
|
|
27
|
+
height: theme.values.buttons.default.height,
|
|
28
|
+
// borderRadius: Theme.borderRadius.large,
|
|
29
|
+
},
|
|
30
|
+
scrollContent: __assign({}, theme.spacing.paddingHorizontal(2)),
|
|
31
|
+
button: __assign(__assign(__assign(__assign({ backgroundColor: 'transparent' }, theme.presets.alignCenter), { color: 'red' }), theme.spacing.padding(2)), theme.presets.justifyCenter),
|
|
32
|
+
selectedBubble: __assign(__assign({ position: 'absolute', zIndex: -1 }, theme.spacing.padding(2)), { maxHeight: 50, minHeight: 50, borderRadius: theme.borderRadius.large, backgroundColor: theme.colors.primary }),
|
|
33
|
+
wrapper: __assign(__assign({ borderRadius: theme.borderRadius.large, backgroundColor: theme.colors.backgroundSecondary }, theme.presets.row), { position: 'relative' }),
|
|
34
|
+
};
|
|
35
|
+
}) });
|
|
36
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA8E;AAc9E,IAAM,2BAA2B,GAAG,IAAA,oCAA2B,GAA+B,CAAA;AAE9F,IAAM,OAAO,GAAG,IAAA,uBAAc,EAAC,UAAC,KAAK,IAAK,OAAA,2BAA2B,CAAC,cAAM,OAAA,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,EAA1B,CAA0B,CAAC,EAA7D,CAA6D,CAAC,CAAA;AAE3F,QAAA,sBAAsB,yBAC9B,OAAO,KACV,OAAO,EAAE,2BAA2B,CAAC,UAAC,KAAK;QAEzC,OAAO;YAEL,IAAI,EAAE;gBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;aACzB;YACD,eAAe,EAAE;gBACf,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;aAC1B;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM;gBAC3C,0CAA0C;aAC3C;YACD,aAAa,eAER,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACtC;YACD,MAAM,wCACJ,eAAe,EAAE,aAAa,IAC3B,KAAK,CAAC,OAAO,CAAC,WAAW,KAC5B,KAAK,EAAE,KAAK,KACT,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GACxB,KAAK,CAAC,OAAO,CAAC,aAAa,CAC/B;YACD,cAAc,sBACZ,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,CAAC,CAAC,IACP,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAC3B,SAAS,EAAE,EAAE,EACb,SAAS,EAAE,EAAE,EACb,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,EACtC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,GACtC;YACD,OAAO,sBACL,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,EACtC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB,IAC9C,KAAK,CAAC,OAAO,CAAC,GAAG,KACpB,QAAQ,EAAE,UAAU,GACrB;SAEF,CAAA;IAEH,CAAC,CAAC,IACH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ScrollProps } from './Scroll';
|
|
3
|
+
export declare type SegmentedControlRef = {};
|
|
4
|
+
export declare type SegmentedControlProps = ScrollProps & {};
|
|
5
|
+
export declare const SegmentedControl: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<SegmentedControlRef>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SegmentedControl = void 0;
|
|
15
|
+
var react_1 = require("react");
|
|
16
|
+
var Scroll_1 = require("./Scroll");
|
|
17
|
+
var react_native_1 = require("react-native");
|
|
18
|
+
var common_1 = require("@codeleap/common");
|
|
19
|
+
exports.SegmentedControl = React.forwardRef(function (props, ref) {
|
|
20
|
+
var styles = props.styles, variants = props.variants, scrollProps = __rest(props, ["styles", "variants"]);
|
|
21
|
+
var scrollRef = (0, react_1.useRef)(null);
|
|
22
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('u:SegmentedControl', {
|
|
23
|
+
styles: styles,
|
|
24
|
+
transform: react_native_1.StyleSheet.flatten,
|
|
25
|
+
variants: variants,
|
|
26
|
+
});
|
|
27
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({}); });
|
|
28
|
+
return (<Scroll_1.Scroll horizontal showsHorizontalScrollIndicator={false} style={variantStyles.scroll} contentContainerStyle={variantStyles.scrollContent} ref={scrollRef} {...scrollProps}>
|
|
29
|
+
|
|
30
|
+
</Scroll_1.Scroll>);
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../src/components/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAAmD;AACnD,mCAA8C;AAK9C,6CAAyC;AACzC,2CAA2D;AAU9C,QAAA,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAA6C,UAAC,KAAK,EAAE,GAAG;IAEpG,IAAA,MAAM,GAGJ,KAAK,OAHD,EACN,QAAQ,GAEN,KAAK,SAFC,EACL,WAAW,UACZ,KAAK,EAJH,sBAIL,CADe,CACP;IAET,IAAM,SAAS,GAAG,IAAA,cAAM,EAAU,IAAI,CAAC,CAAA;IAEvC,IAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,oBAAoB,EAAE;QACnE,MAAM,QAAA;QACN,SAAS,EAAE,yBAAU,CAAC,OAAO;QAC7B,QAAQ,UAAA;KACT,CAAC,CAAA;IAEF,IAAA,2BAAmB,EAAC,GAAG,EAAE,cAAM,OAAA,CAAC,EAAE,CAAC,EAAJ,CAAI,CAAC,CAAA;IAEpC,OAAO,CACL,CAAC,eAAM,CACL,UAAU,CACV,8BAA8B,CAAC,CAAC,KAAK,CAAC,CACtC,KAAK,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAC5B,qBAAqB,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAEnD,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,IAAI,WAAW,CAAC,CAGlB;;IAAA,EAAE,eAAM,CAAC,CACV,CAAA;AAEH,CAAC,CAAC,CAAA"}
|
|
@@ -87,7 +87,7 @@ var Select = function (selectProps) {
|
|
|
87
87
|
return <>
|
|
88
88
|
<TextInput_1.TextInput caretHidden value={selectedLabel} rightIcon={{
|
|
89
89
|
name: arrowIconName,
|
|
90
|
-
}} editable={false} touchableWrapper
|
|
90
|
+
}} editable={false} touchableWrapper wrapperProps={{
|
|
91
91
|
debugName: 'Select',
|
|
92
92
|
onPress: close,
|
|
93
93
|
}} pointerEvents={'none'} label={label} debugName={'Select input'} styles={inputStyles} style={style} {...textInputProps}/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAgI;AAChI,6CAAsC;AACtC,6CAAgD;AAChD,oCAAkC;AAClC,oCAAkC;AAClC,0CAAoD;AACpD,0CAAwC;AACxC,gCAA4C;AAIrC,IAAM,MAAM,GAAG,UAAmC,WAAgC;IAErF,IAAA,KAAK,GAwBH,WAAW,MAxBR,EACL,aAAa,GAuBX,WAAW,cAvBA,EACb,KAAK,GAsBH,WAAW,MAtBR,EACL,KAqBE,WAAW,OArBF,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,OAAO,GAoBL,WAAW,QApBN,EAC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KAAK,CAAC,CAAC;oBACjC,aAAa,CAAC,SAAS;oBACvB,UAAU,IAAI,aAAa,CAAC,oBAAoB,CAAC;iBAClD,CAAC,CAAC,OAAO,CAAC,CAAC,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAlB,CAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,iBAAU,IAAI,CAAC,KAAK,CAAE,CAAC,CACtE;kBAAA,CAAC,sBAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,EAAE,UAAU,IAAI,aAAa,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAC7H;gBAAA,EAAE,qBAAS,CAAC,CAAA;QACd,CAAC,CAAC,CAEN;UAAA,EAAE,aAAa,CAEf;;UAAA,CACE,MAAM,IAAI,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAC/C;cAAA,CAAC,MAAM,CACT;YAAA,EAAE,WAAI,CAAC,CAEX;QAAA,EAAE,WAAI,CACR;MAAA,EAAE,WAAI,CACR;IAAA,EAAE,oBAAK,CACT;EAAA,GAAG,CAAA;AACL,CAAC,CAAA;AAnLY,QAAA,MAAM,UAmLlB;AAED,2CAAwB;AACxB,0CAAuB"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { ComponentVariants, BaseViewProps, TextStyles } from '@codeleap/common';
|
|
4
|
-
import { Text as NativeText } from 'react-native';
|
|
4
|
+
import { Animated, Text as NativeText } from 'react-native';
|
|
5
|
+
import { MotiProps } from 'moti';
|
|
5
6
|
export declare type TextProps = ComponentPropsWithoutRef<typeof NativeText> & {
|
|
6
7
|
text?: string;
|
|
7
8
|
variants?: ComponentVariants<typeof TextStyles>['variants'];
|
|
8
|
-
|
|
9
|
+
animated?: boolean;
|
|
10
|
+
colorChangeConfig?: Partial<Animated.TimingAnimationConfig>;
|
|
11
|
+
} & BaseViewProps & MotiProps;
|
|
9
12
|
export declare const Text: React.ForwardRefExoticComponent<import("react-native").TextProps & {
|
|
10
13
|
text?: string;
|
|
11
14
|
variants?: ComponentVariants<typeof TextStyles>['variants'];
|
|
12
|
-
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
colorChangeConfig?: Partial<Animated.TimingAnimationConfig>;
|
|
17
|
+
} & BaseViewProps & MotiProps<any, import("moti").StyleValueWithReplacedTransforms<any>, Partial<import("moti").StyleValueWithSequenceArraysWithoutTransform<import("moti").StyleValueWithReplacedTransforms<any>, string | number | symbol, string | number | symbol> & import("moti").StyleValueWithSequenceArraysWithTransform>> & React.RefAttributes<NativeText>>;
|
package/dist/components/Text.js
CHANGED
|
@@ -39,15 +39,22 @@ var React = __importStar(require("react"));
|
|
|
39
39
|
var react_1 = require("react");
|
|
40
40
|
var common_1 = require("@codeleap/common");
|
|
41
41
|
var react_native_1 = require("react-native");
|
|
42
|
+
var moti_1 = require("moti");
|
|
43
|
+
var hooks_1 = require("../utils/hooks");
|
|
44
|
+
var MotiText = react_native_1.Animated.createAnimatedComponent(moti_1.MotiText);
|
|
42
45
|
exports.Text = (0, react_1.forwardRef)(function (textProps, ref) {
|
|
43
|
-
var _a = textProps.variants, variants = _a === void 0 ? [] : _a, text = textProps.text, style = textProps.style, props = __rest(textProps, ["variants", "text", "style"]);
|
|
46
|
+
var _a = textProps.variants, variants = _a === void 0 ? [] : _a, text = textProps.text, children = textProps.children, style = textProps.style, colorChangeConfig = textProps.colorChangeConfig, props = __rest(textProps, ["variants", "text", "children", "style", "colorChangeConfig"]);
|
|
44
47
|
var variantStyles = (0, common_1.useDefaultComponentStyle)('Text', {
|
|
45
48
|
variants: variants,
|
|
46
49
|
rootElement: 'text',
|
|
47
50
|
});
|
|
48
|
-
var styles = [variantStyles.text, style];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
var styles = react_native_1.StyleSheet.flatten([variantStyles.text, style]);
|
|
52
|
+
var animatedColor = (0, hooks_1.useAnimateColor)(styles.color, colorChangeConfig);
|
|
53
|
+
var Component = textProps.animated ? MotiText : react_native_1.Text;
|
|
54
|
+
var colorStyle = { color: props.animated ? animatedColor : styles.color };
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
return <Component {...props} style={[styles, colorStyle]} ref={ref}>
|
|
57
|
+
{text || children}
|
|
58
|
+
</Component>;
|
|
52
59
|
});
|
|
53
60
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,+BAA4D;AAC5D,2CAKyB;AACzB,
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,+BAA4D;AAC5D,2CAKyB;AACzB,6CAAuE;AACvE,6BAAuD;AACvD,wCAAgD;AAQhD,IAAM,QAAQ,GAAG,uBAAQ,CAAC,uBAAuB,CAAC,eAAS,CAAC,CAAA;AAE/C,QAAA,IAAI,GAAG,IAAA,kBAAU,EAAwB,UAAC,SAAS,EAAE,GAAG;IAC3D,IAAA,KAAsE,SAAS,SAAlE,EAAb,QAAQ,mBAAG,EAAE,KAAA,EAAE,IAAI,GAAmD,SAAS,KAA5D,EAAE,QAAQ,GAAyC,SAAS,SAAlD,EAAE,KAAK,GAAkC,SAAS,MAA3C,EAAE,iBAAiB,GAAe,SAAS,kBAAxB,EAAK,KAAK,UAAK,SAAS,EAAjF,8DAAqE,CAAF,CAAc;IAEvF,IAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,MAAM,EAAE;QACrD,QAAQ,UAAA;QACR,WAAW,EAAE,MAAM;KACpB,CAAC,CAAA;IAEF,IAAM,MAAM,GAAG,yBAAU,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAE9D,IAAM,aAAa,GAAG,IAAA,uBAAe,EAAC,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAA;IAEtE,IAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAU,CAAA;IAE5D,IAAM,UAAU,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;IAE3E,aAAa;IACb,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CACjE;IAAA,CAAC,IAAI,IAAI,QAAQ,CACnB;EAAA,EAAE,SAAS,CAAC,CAAA;AAEd,CAAC,CAAC,CAAA"}
|
|
@@ -29,7 +29,8 @@ export declare type TextInputProps = Partial<TextInputMaskProps> & ComponentVari
|
|
|
29
29
|
touchableWrapper?: boolean;
|
|
30
30
|
onPress?: () => void;
|
|
31
31
|
masking?: FormTypes.TextField['masking'];
|
|
32
|
-
innerWrapperProps?:
|
|
32
|
+
innerWrapperProps?: ViewProps;
|
|
33
|
+
wrapperProps?: TouchableProps | ViewProps;
|
|
33
34
|
onChangeMask?: TextInputMaskProps['onChangeText'];
|
|
34
35
|
required?: boolean;
|
|
35
36
|
};
|
|
@@ -159,7 +160,8 @@ export declare const TextInput: React.ForwardRefExoticComponent<Partial<TextInpu
|
|
|
159
160
|
touchableWrapper?: boolean;
|
|
160
161
|
onPress?: () => void;
|
|
161
162
|
masking?: FormTypes.TextField['masking'];
|
|
162
|
-
innerWrapperProps?:
|
|
163
|
+
innerWrapperProps?: ViewProps;
|
|
164
|
+
wrapperProps?: TouchableProps | ViewProps;
|
|
163
165
|
onChangeMask?: TextInputMaskProps['onChangeText'];
|
|
164
166
|
required?: boolean;
|
|
165
167
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -57,7 +57,7 @@ var Touchable_1 = require("./Touchable");
|
|
|
57
57
|
var textInputMask_1 = require("../modules/textInputMask");
|
|
58
58
|
exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
59
59
|
var _a, _b;
|
|
60
|
-
var onChange = rawprops.onChange, type = rawprops.type, value = rawprops.value, onChangeText = rawprops.onChangeText, disabled = rawprops.disabled, edited = rawprops.edited, onFocus = rawprops.onFocus, onBlur = rawprops.onBlur, variants = rawprops.variants, label = rawprops.label, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, touchableWrapper = rawprops.touchableWrapper, innerWrapperProps = rawprops.innerWrapperProps, _c = rawprops.masking, masking = _c === void 0 ? null : _c, onChangeMask = rawprops.onChangeMask, debugName = rawprops.debugName, _d = rawprops.required, required = _d === void 0 ? false : _d, props = __rest(rawprops, ["onChange", "type", "value", "onChangeText", "disabled", "edited", "onFocus", "onBlur", "variants", "label", "leftIcon", "rightIcon", "styles", "validate", "password", "visibilityToggle", "touchableWrapper", "innerWrapperProps", "masking", "onChangeMask", "debugName", "required"]);
|
|
60
|
+
var onChange = rawprops.onChange, type = rawprops.type, value = rawprops.value, onChangeText = rawprops.onChangeText, disabled = rawprops.disabled, edited = rawprops.edited, onFocus = rawprops.onFocus, onBlur = rawprops.onBlur, variants = rawprops.variants, label = rawprops.label, wrapperProps = rawprops.wrapperProps, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, touchableWrapper = rawprops.touchableWrapper, innerWrapperProps = rawprops.innerWrapperProps, _c = rawprops.masking, masking = _c === void 0 ? null : _c, onChangeMask = rawprops.onChangeMask, debugName = rawprops.debugName, _d = rawprops.required, required = _d === void 0 ? false : _d, props = __rest(rawprops, ["onChange", "type", "value", "onChangeText", "disabled", "edited", "onFocus", "onBlur", "variants", "label", "wrapperProps", "leftIcon", "rightIcon", "styles", "validate", "password", "visibilityToggle", "touchableWrapper", "innerWrapperProps", "masking", "onChangeMask", "debugName", "required"]);
|
|
61
61
|
var _e = (0, react_1.useState)(false), isFocused = _e[0], setFocus = _e[1];
|
|
62
62
|
var _f = (0, react_1.useState)(edited), editedState = _f[0], setEdited = _f[1];
|
|
63
63
|
var input = (0, react_1.useRef)(null);
|
|
@@ -119,7 +119,7 @@ exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
|
119
119
|
(_b = (_a = input.current) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
return (<Touchable_1.Touchable style={getStyles('wrapper')} debugName={debugName} onPress={handlePress} {...
|
|
122
|
+
return (<Touchable_1.Touchable style={getStyles('wrapper')} debugName={debugName} onPress={handlePress} {...wrapperProps}>
|
|
123
123
|
<exports.InputLabel label={label} style={getStyles('label')} asteriskStyle={getStyles('requiredAsterisk')} wrapperStyle={getStyles('labelWrapper')} required={required}/>
|
|
124
124
|
<View_1.View style={getStyles('innerWrapper')} {...innerWrapperProps}>
|
|
125
125
|
<exports.InputIcon {...leftIcon} style={leftIconStyle} wrapperStyle={buttonIconWrapperStyle}/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CASyB;AACzB,+BAAmG;AACnG,+BAA6B;AAC7B,+BAAwC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AE,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,oBAAmB,EAAnB,YAAY,mBAAG,IAAI,KAAA;IAChI,IAAM,WAAW,GAAG,IAAA,iCAAwB,EAAC,WAAW,EAAE;QACxD,QAAQ,UAAA;QAAE,MAAM,QAAA;QAAE,SAAS,EAAE,yBAAU,CAAC,OAAO;KAChD,CAAC,CAAA;IAEF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,QAAQ,OAAO,KAAK,EAAE;QACpB,KAAK,QAAQ;YACX,OAAO,CAAC,WAAI,CAAC,KAAK,CAAC,CAAE,YAAY,IAAI,WAAW,CAAC,YAAY,CAAC,CAC5D;QAAA,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EACrD;QAAA,CAAC,QAAQ,IAAI,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,aAAa,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CACzF;MAAA,EAAE,WAAI,CAAC,CAAA;QACT,KAAK,QAAQ;YACX,OAAO,KAAK,CAAA;QACd;YACE,OAAO,IAAI,CAAA;KACd;AACH,CAAC,CAAA;AAlBY,QAAA,UAAU,cAkBtB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { ComponentVariants, BaseViewProps, ViewStyles, AnyFunction } from '@codeleap/common';
|
|
4
|
-
import {
|
|
5
|
-
export declare type TouchableProps = Omit<ComponentPropsWithoutRef<typeof
|
|
4
|
+
import { Pressable, View } from 'react-native';
|
|
5
|
+
export declare type TouchableProps = Omit<ComponentPropsWithoutRef<typeof Pressable>, 'onPress'> & {
|
|
6
6
|
variants?: ComponentVariants<typeof ViewStyles>['variants'];
|
|
7
7
|
component?: any;
|
|
8
|
-
ref?: React.Ref<
|
|
8
|
+
ref?: React.Ref<View>;
|
|
9
9
|
debugName: string;
|
|
10
|
+
activeOpacity?: number;
|
|
10
11
|
debugComponent?: string;
|
|
12
|
+
feedbackVariant?: 'opacity' | 'none' | 'highlight';
|
|
11
13
|
onPress?: AnyFunction;
|
|
12
14
|
} & BaseViewProps;
|
|
13
15
|
export declare const Touchable: React.FC<TouchableProps>;
|
|
@@ -41,36 +41,43 @@ var common_1 = require("@codeleap/common");
|
|
|
41
41
|
var react_native_1 = require("react-native");
|
|
42
42
|
var react_native_animatable_1 = require("react-native-animatable");
|
|
43
43
|
exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
44
|
-
var _a = touchableProps.variants, variants = _a === void 0 ? [] : _a, children = touchableProps.children, onPress = touchableProps.onPress, style = touchableProps.style, debugName = touchableProps.debugName, debugComponent = touchableProps.debugComponent, props = __rest(touchableProps, ["variants", "children", "onPress", "style", "debugName", "debugComponent"]);
|
|
44
|
+
var _a = touchableProps.variants, variants = _a === void 0 ? [] : _a, children = touchableProps.children, onPress = touchableProps.onPress, style = touchableProps.style, _b = touchableProps.activeOpacity, activeOpacity = _b === void 0 ? 0.5 : _b, debugName = touchableProps.debugName, debugComponent = touchableProps.debugComponent, _c = touchableProps.feedbackVariant, feedbackVariant = _c === void 0 ? 'opacity' : _c, props = __rest(touchableProps, ["variants", "children", "onPress", "style", "activeOpacity", "debugName", "debugComponent", "feedbackVariant"]);
|
|
45
45
|
var variantStyles = (0, common_1.useDefaultComponentStyle)('View', {
|
|
46
46
|
variants: variants,
|
|
47
47
|
});
|
|
48
|
-
var
|
|
49
|
-
var activeLogger = null;
|
|
50
|
-
try {
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
if (global === null || global === void 0 ? void 0 : global.logger) {
|
|
53
|
-
// @ts-ignore
|
|
54
|
-
activeLogger = global.logger;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
activeLogger = contextLogger;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
console.log('Error getting Touchable logger');
|
|
62
|
-
}
|
|
48
|
+
var logger = (0, common_1.useCodeleapContext)().logger;
|
|
63
49
|
var press = function () {
|
|
64
50
|
if (!onPress) {
|
|
65
51
|
throw { message: 'No onPress passed to touchable', touchableProps: touchableProps };
|
|
66
52
|
}
|
|
67
|
-
|
|
53
|
+
logger.log("<".concat(debugComponent || 'Touchable', "/> pressed"), debugName || variants, 'User interaction');
|
|
68
54
|
onPress && onPress();
|
|
69
55
|
};
|
|
70
56
|
var styles = [variantStyles.wrapper, style];
|
|
71
|
-
|
|
57
|
+
function getFeedbackStyle(pressed, variant) {
|
|
58
|
+
switch (variant) {
|
|
59
|
+
case 'highlight':
|
|
60
|
+
return {
|
|
61
|
+
backgroundColor: pressed ? '#e0e0e0' : 'transparent',
|
|
62
|
+
};
|
|
63
|
+
break;
|
|
64
|
+
case 'opacity':
|
|
65
|
+
return {
|
|
66
|
+
opacity: pressed ? activeOpacity : 1,
|
|
67
|
+
};
|
|
68
|
+
case 'none':
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return (<react_native_1.Pressable onPress={press} style={function (_a) {
|
|
73
|
+
var pressed = _a.pressed;
|
|
74
|
+
return ([
|
|
75
|
+
getFeedbackStyle(pressed, feedbackVariant),
|
|
76
|
+
styles,
|
|
77
|
+
]);
|
|
78
|
+
}} {...props} ref={ref}>
|
|
72
79
|
{children}
|
|
73
|
-
</react_native_1.
|
|
80
|
+
</react_native_1.Pressable>);
|
|
74
81
|
});
|
|
75
82
|
exports.AnimatedTouchable = (0, react_native_animatable_1.createAnimatableComponent)(exports.Touchable);
|
|
76
83
|
//# sourceMappingURL=Touchable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Touchable.js","sourceRoot":"","sources":["../../src/components/Touchable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;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IAE7C,SAAS,gBAAgB,CAAC,OAAe,EAAE,OAA0C;QACnF,QAAQ,OAAO,EAAE;YACf,KAAK,WAAW;gBACd,OAAO;oBACL,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa;iBACrD,CAAA;gBACD,MAAK;YACP,KAAK,SAAS;gBACZ,OAAO;oBACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;iBACrC,CAAA;YACH,KAAK,MAAM;gBACT,OAAO,EAAE,CAAA;SACZ;IACH,CAAC;IAED,OAAO,CACL,CAAC,wBAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,UAAC,EAAW;gBAAT,OAAO,aAAA;YAAO,OAAA,CAAC;gBAClD,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC1C,MAAM;aACP,CAAC;QAHiD,CAGjD,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CACtB;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,wBAAS,CAAC,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEW,QAAA,iBAAiB,GAAG,IAAA,mDAAyB,EAAC,iBAAS,CAAgC,CAAA"}
|
package/dist/components/View.js
CHANGED
|
@@ -47,7 +47,7 @@ exports.View = (0, react_1.forwardRef)(function (viewProps, ref) {
|
|
|
47
47
|
responsiveVariants: responsiveVariants,
|
|
48
48
|
variants: variants,
|
|
49
49
|
});
|
|
50
|
-
var Component = animated ? moti_1.MotiView : component || react_native_1.View;
|
|
50
|
+
var Component = animated ? moti_1.MotiView : (component || react_native_1.View);
|
|
51
51
|
return (<Component style={[variantStyles.wrapper, style]} ref={ref} {...props}>
|
|
52
52
|
{children}
|
|
53
53
|
</Component>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.js","sourceRoot":"","sources":["../../src/components/View.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N,EACL,OAAO,GAIL,SAAS,QAJJ,EACP,SAAS,GAGP,SAAS,UAHF,EACT,KAEE,SAAS,SAFK,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EACb,KAAK,UACN,SAAS,EATP,2FASL,CADS,CACG;IAEb,IAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,MAAM,EAAE;QACrD,kBAAkB,oBAAA;QAClB,QAAQ,UAAA;KACT,CAAC,CAAA;IACF,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,mBAAU,CAAC,CAAA;IAEjE,OAAO,CACL,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CACpE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEW,QAAA,YAAY,GAAG,UAAU,CAAC,yBAAyB,CAC9D,YAAI,CAGL,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewProps } from '../View';
|
|
3
|
+
import { ButtonProps } from '../Button';
|
|
4
|
+
import { ComponentVariants, IconPlaceholder } from '@codeleap/common';
|
|
5
|
+
import { MobileModalComposition, MobileModalStyles } from './styles';
|
|
6
|
+
import { StylesOf } from '../../types/utility';
|
|
7
|
+
export * from './styles';
|
|
8
|
+
export declare type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
|
|
9
|
+
variants?: ComponentVariants<typeof MobileModalStyles>['variants'];
|
|
10
|
+
styles?: StylesOf<MobileModalComposition>;
|
|
11
|
+
dismissOnBackdrop?: boolean;
|
|
12
|
+
buttonProps?: ButtonProps;
|
|
13
|
+
accessible?: boolean;
|
|
14
|
+
showClose?: boolean;
|
|
15
|
+
closable?: boolean;
|
|
16
|
+
footer?: React.ReactNode;
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
debugName?: string;
|
|
19
|
+
closeIconName?: IconPlaceholder;
|
|
20
|
+
visible: boolean;
|
|
21
|
+
toggle?: () => void;
|
|
22
|
+
zIndex?: number;
|
|
23
|
+
scroll?: boolean;
|
|
24
|
+
keyboardAware?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
27
|
+
export default Modal;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
+
};
|
|
39
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
40
|
+
var t = {};
|
|
41
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
42
|
+
t[p] = s[p];
|
|
43
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
44
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
45
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
46
|
+
t[p[i]] = s[p[i]];
|
|
47
|
+
}
|
|
48
|
+
return t;
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Modal = void 0;
|
|
52
|
+
var React = __importStar(require("react"));
|
|
53
|
+
var View_1 = require("../View");
|
|
54
|
+
var Button_1 = require("../Button");
|
|
55
|
+
var Scroll_1 = require("../Scroll");
|
|
56
|
+
var common_1 = require("@codeleap/common");
|
|
57
|
+
var react_native_1 = require("react-native");
|
|
58
|
+
var Touchable_1 = require("../Touchable");
|
|
59
|
+
var Text_1 = require("../Text");
|
|
60
|
+
var Animated_1 = require("../Animated");
|
|
61
|
+
__exportStar(require("./styles"), exports);
|
|
62
|
+
var Modal = function (modalProps) {
|
|
63
|
+
var _a = modalProps.variants, variants = _a === void 0 ? [] : _a, _b = modalProps.styles, styles = _b === void 0 ? {} : _b, visible = modalProps.visible, showClose = modalProps.showClose, _c = modalProps.closable, closable = _c === void 0 ? true : _c, title = modalProps.title, footer = modalProps.footer, children = modalProps.children, _d = modalProps.toggle, toggle = _d === void 0 ? function () { return null; } : _d, _e = modalProps.dismissOnBackdrop, dismissOnBackdrop = _e === void 0 ? true : _e, _f = modalProps.closeIconName, closeIconName = _f === void 0 ? 'close' : _f, debugName = modalProps.debugName, _g = modalProps.scroll, scroll = _g === void 0 ? true : _g, _h = modalProps.keyboardAware, keyboardAware = _h === void 0 ? true : _h, _j = modalProps.zIndex, zIndex = _j === void 0 ? null : _j, props = __rest(modalProps, ["variants", "styles", "visible", "showClose", "closable", "title", "footer", "children", "toggle", "dismissOnBackdrop", "closeIconName", "debugName", "scroll", "keyboardAware", "zIndex"]);
|
|
64
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Modal', {
|
|
65
|
+
variants: variants,
|
|
66
|
+
transform: react_native_1.StyleSheet.flatten,
|
|
67
|
+
styles: styles,
|
|
68
|
+
});
|
|
69
|
+
function getStyles(key) {
|
|
70
|
+
var s = [
|
|
71
|
+
variantStyles[key],
|
|
72
|
+
styles[key],
|
|
73
|
+
visible ? variantStyles[key + ':visible'] : {},
|
|
74
|
+
visible ? styles[key + ':visible'] : {},
|
|
75
|
+
];
|
|
76
|
+
return s;
|
|
77
|
+
}
|
|
78
|
+
var buttonStyles = React.useMemo(function () {
|
|
79
|
+
var buttonEntries = {};
|
|
80
|
+
for (var _i = 0, _a = Object.entries(variantStyles); _i < _a.length; _i++) {
|
|
81
|
+
var _b = _a[_i], key = _b[0], style = _b[1];
|
|
82
|
+
if (key.startsWith('closeButton')) {
|
|
83
|
+
buttonEntries[(0, common_1.capitalize)(key.replace('closeButton', ''), true)] = style;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return buttonEntries;
|
|
87
|
+
}, [variantStyles]);
|
|
88
|
+
var boxAnimation = {
|
|
89
|
+
hidden: __assign(__assign({}, variantStyles['box:pose']), styles['box:pose']),
|
|
90
|
+
visible: __assign(__assign({}, variantStyles['box:pose:visible']), styles['box:pose:visible']),
|
|
91
|
+
};
|
|
92
|
+
var wrapperStyle = react_native_1.StyleSheet.flatten(getStyles('wrapper'));
|
|
93
|
+
return (<View_1.View style={[wrapperStyle, { zIndex: typeof zIndex === 'number' ? zIndex : wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.zIndex }]} pointerEvents={visible ? 'auto' : 'none'}>
|
|
94
|
+
<View_1.AnimatedView style={getStyles('overlay')} transition={'opacity'}/>
|
|
95
|
+
<Scroll_1.Scroll style={getStyles('innerWrapper')} contentContainerStyle={getStyles('innerWrapperScroll')} scrollEnabled={scroll} keyboardAware={keyboardAware}>
|
|
96
|
+
{dismissOnBackdrop && (<Touchable_1.Touchable debugName={"".concat(debugName, " modal backdrop")} activeOpacity={1} onPress={function () { return toggle(); }} style={getStyles('touchableBackdrop')}/>)}
|
|
97
|
+
<Animated_1.Animated component='View' config={boxAnimation} pose={visible ? 'visible' : 'hidden'} style={getStyles('box')}>
|
|
98
|
+
{(title || showClose) && (<View_1.View style={getStyles('header')}>
|
|
99
|
+
{typeof title === 'string' ? (<Text_1.Text text={title} style={getStyles('title')}/>) : (title)}
|
|
100
|
+
|
|
101
|
+
{showClose && closable && (<Button_1.Button debugName={"".concat(debugName, " modal close button")} icon={closeIconName} variants={['icon']} onPress={toggle} styles={buttonStyles}/>)}
|
|
102
|
+
</View_1.View>)}
|
|
103
|
+
|
|
104
|
+
<View_1.View style={getStyles('body')}>{children}</View_1.View>
|
|
105
|
+
{footer && (<View_1.View style={getStyles('footer')}>
|
|
106
|
+
{typeof footer === 'string' ? <Text_1.Text text={footer}/> : footer}
|
|
107
|
+
</View_1.View>)}
|
|
108
|
+
</Animated_1.Animated>
|
|
109
|
+
</Scroll_1.Scroll>
|
|
110
|
+
</View_1.View>);
|
|
111
|
+
};
|
|
112
|
+
exports.Modal = Modal;
|
|
113
|
+
exports.default = exports.Modal;
|
|
114
|
+
//# sourceMappingURL=index.js.map
|