@codeleap/web 1.0.1 → 1.1.3
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/ActivityIndicator/index.d.ts +0 -1
- package/dist/components/ActivityIndicator/styles.d.ts +5 -1
- package/dist/components/Checkbox/index.d.ts +12 -0
- package/dist/components/Checkbox/index.js +57 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Checkbox/styles.d.ts +46 -0
- package/dist/components/Checkbox/styles.js +58 -0
- package/dist/components/Checkbox/styles.js.map +1 -0
- package/dist/components/ContentView.d.ts +0 -1
- package/dist/components/ContentView.js +1 -1
- package/dist/components/ContentView.js.map +1 -1
- package/dist/components/FileInput.d.ts +1 -5
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Icon.d.ts +2 -3
- package/dist/components/Icon.js +18 -4
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/Modal/styles.d.ts +5 -1
- package/dist/components/Overlay.d.ts +0 -1
- package/dist/components/PageRouter/Menu.d.ts +0 -1
- package/dist/components/PageRouter/MenuItem.d.ts +1 -1
- package/dist/components/PageRouter/MenuItem.js.map +1 -1
- package/dist/components/PageRouter/Router.js +1 -1
- package/dist/components/PageRouter/Router.js.map +1 -1
- package/dist/components/PageRouter/index.js +1 -1
- package/dist/components/PageRouter/index.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +1 -42
- package/dist/components/RadioInput/styles.d.ts +5 -1
- package/dist/components/Slider.d.ts +0 -1
- package/dist/components/Text.d.ts +1 -1
- package/dist/components/TextInput.d.ts +1 -89
- package/dist/components/TextInput.js +4 -4
- package/dist/components/TextInput.js.map +1 -1
- package/dist/components/Touchable.d.ts +2 -2
- package/dist/components/View.d.ts +3 -3
- package/dist/lib/hooks.d.ts +1 -1
- package/package.json +6 -3
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -3
- package/.turbo/turbo-build.log +0 -1
- package/dist/components/Tooltip-old.d.ts +0 -11
- package/dist/components/Tooltip-old.js +0 -151
- package/dist/components/Tooltip-old.js.map +0 -1
- package/dist/components/router/Menu.d.ts +0 -10
- package/dist/components/router/Menu.js +0 -39
- package/dist/components/router/Menu.js.map +0 -1
- package/dist/components/router/MenuItem.d.ts +0 -11
- package/dist/components/router/MenuItem.js +0 -42
- package/dist/components/router/MenuItem.js.map +0 -1
- package/dist/components/router/Router.d.ts +0 -8
- package/dist/components/router/Router.js +0 -28
- package/dist/components/router/Router.js.map +0 -1
- package/dist/components/router/index.d.ts +0 -14
- package/dist/components/router/index.js +0 -69
- package/dist/components/router/index.js.map +0 -1
- package/src/components/ActivityIndicator/index.tsx +0 -55
- package/src/components/ActivityIndicator/styles.ts +0 -18
- package/src/components/Button.tsx +0 -67
- package/src/components/CenterWrapper.tsx +0 -24
- package/src/components/Checkbox.tsx +0 -46
- package/src/components/ContentView.tsx +0 -48
- package/src/components/Drawer.tsx +0 -114
- package/src/components/FileInput.tsx +0 -48
- package/src/components/FlatList.tsx +0 -77
- package/src/components/HorizontalScroll.tsx +0 -24
- package/src/components/Icon.tsx +0 -26
- package/src/components/Link.tsx +0 -51
- package/src/components/Modal/index.tsx +0 -150
- package/src/components/Modal/styles.ts +0 -49
- package/src/components/Overlay.tsx +0 -25
- package/src/components/PageRouter/Menu.tsx +0 -49
- package/src/components/PageRouter/MenuItem.tsx +0 -55
- package/src/components/PageRouter/Router.tsx +0 -23
- package/src/components/PageRouter/index.tsx +0 -81
- package/src/components/RadioInput/index.tsx +0 -72
- package/src/components/RadioInput/styles.ts +0 -57
- package/src/components/Select.tsx +0 -60
- package/src/components/Slider.tsx +0 -14
- package/src/components/Text.tsx +0 -27
- package/src/components/TextInput.tsx +0 -219
- package/src/components/Tooltip.tsx +0 -138
- package/src/components/Touchable.tsx +0 -47
- package/src/components/View.tsx +0 -54
- package/src/components/index.ts +0 -23
- package/src/index.ts +0 -4
- package/src/lib/hooks.ts +0 -59
- package/src/lib/logger.ts +0 -15
- package/src/lib/utils/cookies.ts +0 -19
- package/src/lib/utils/index.ts +0 -4
- package/src/lib/utils/pollyfils/scroll.ts +0 -59
- package/src/lib/utils/stopPropagation.ts +0 -17
- package/src/types/utility.ts +0 -4
- package/tsconfig.json +0 -42
|
@@ -23,95 +23,7 @@ export declare type TextInputProps = ComponentVariants<typeof TextInputStyles> &
|
|
|
23
23
|
password?: boolean;
|
|
24
24
|
visibilityToggle?: boolean;
|
|
25
25
|
};
|
|
26
|
-
export declare const TextInput:
|
|
27
|
-
default: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
28
|
-
/** @jsx jsx */
|
|
29
|
-
line: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
30
|
-
box: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
31
|
-
pill: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
32
|
-
fixed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
33
|
-
hidden: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
34
|
-
block: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
35
|
-
flex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
36
|
-
absolute: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
37
|
-
sticky: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
38
|
-
row: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
39
|
-
center: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
40
|
-
column: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
41
|
-
wrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
42
|
-
inline: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
43
|
-
inlineFlex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
44
|
-
full: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
45
|
-
noWrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
46
|
-
fullWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
47
|
-
fullHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
48
|
-
fullView: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
49
|
-
fullViewWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
50
|
-
fullViewHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
51
|
-
whole: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
52
|
-
centerRow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
53
|
-
listStyles: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
54
|
-
alignStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
55
|
-
alignEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
56
|
-
alignCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
57
|
-
justifyStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
58
|
-
justifyEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
59
|
-
justifyCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
60
|
-
justifySpaceBetween: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
61
|
-
textRight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
62
|
-
textLeft: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
63
|
-
textCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
64
|
-
blur: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
65
|
-
elevated: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
66
|
-
neumorphism: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
67
|
-
scrollX: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
68
|
-
scrollY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
69
|
-
scrollXY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
70
|
-
}, import("@codeleap/common").EnhancedTheme<any>, import("@codeleap/common").VariantProp<{
|
|
71
|
-
default: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
72
|
-
/** @jsx jsx */
|
|
73
|
-
line: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
74
|
-
box: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
75
|
-
pill: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
76
|
-
fixed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
77
|
-
hidden: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
78
|
-
block: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
79
|
-
flex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
80
|
-
absolute: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
81
|
-
sticky: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
82
|
-
row: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
83
|
-
center: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
84
|
-
column: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
85
|
-
wrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
86
|
-
inline: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
87
|
-
inlineFlex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
88
|
-
full: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
89
|
-
noWrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
90
|
-
fullWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
91
|
-
fullHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
92
|
-
fullView: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
93
|
-
fullViewWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
94
|
-
fullViewHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
95
|
-
whole: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
96
|
-
centerRow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
97
|
-
listStyles: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
98
|
-
alignStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
99
|
-
alignEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
100
|
-
alignCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
101
|
-
justifyStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
102
|
-
justifyEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
103
|
-
justifyCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
104
|
-
justifySpaceBetween: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
105
|
-
textRight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
106
|
-
textLeft: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
107
|
-
textCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
108
|
-
blur: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
109
|
-
elevated: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
110
|
-
neumorphism: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
111
|
-
scrollX: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
112
|
-
scrollY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
113
|
-
scrollXY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
114
|
-
}>> | "multiline" | "onChangeText" | "edited" | "validate" | "visibilityToggle"> & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export declare const TextInput: any;
|
|
115
27
|
export declare const InputIcon: React.FC<{
|
|
116
28
|
style: any;
|
|
117
29
|
} & IconProp>;
|
|
@@ -36,7 +36,7 @@ var Button_1 = require("./Button");
|
|
|
36
36
|
var _1 = require(".");
|
|
37
37
|
exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
38
38
|
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, multiline = rawprops.multiline, responsiveVariants = rawprops.responsiveVariants, variants = rawprops.variants, label = rawprops.label, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, props = __rest(rawprops, ["onChange", "type", "value", "onChangeText", "disabled", "edited", "onFocus", "onBlur", "multiline", "responsiveVariants", "variants", "label", "leftIcon", "rightIcon", "styles", "validate", "password", "visibilityToggle"]);
|
|
39
|
-
var _a = (0, react_1.useState)(false),
|
|
39
|
+
var _a = (0, react_1.useState)(false), focused = _a[0], setFocus = _a[1];
|
|
40
40
|
var _b = (0, react_1.useState)(edited), editedState = _b[0], setEdited = _b[1];
|
|
41
41
|
var _c = (0, react_1.useState)({
|
|
42
42
|
valid: true,
|
|
@@ -82,9 +82,9 @@ exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
|
82
82
|
var showError = (!error.valid && error.message);
|
|
83
83
|
var inputType = type || password ? 'password' : 'text';
|
|
84
84
|
var inputVisibilityType = textIsVisible ? 'text' : 'password';
|
|
85
|
-
var leftIconStyle = __assign(__assign(__assign(__assign({}, variantStyles.icon), (showError ? variantStyles['icon:error'] : {})), variantStyles.leftIcon), (showError ? variantStyles['leftIcon:error'] : {}));
|
|
86
|
-
var rightIconStyle = __assign(__assign(__assign(__assign({}, variantStyles.icon), (showError ? variantStyles['icon:error'] : {})), variantStyles.rightIcon), (showError ? variantStyles['rightIcon:error'] : {}));
|
|
87
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: [variantStyles.wrapper, showError && variantStyles['wrapper:error']] }, { children: [(0, jsx_runtime_1.jsx)(exports.InputLabel, { label: label, style: variantStyles.label }, void 0), (0, jsx_runtime_1.jsxs)(
|
|
85
|
+
var leftIconStyle = __assign(__assign(__assign(__assign(__assign(__assign({}, variantStyles.icon), (showError ? variantStyles['icon:error'] : {})), (focused ? variantStyles['icon:focus'] : {})), variantStyles.leftIcon), (showError ? variantStyles['leftIcon:error'] : {})), (focused ? variantStyles['leftIcon:focus'] : {}));
|
|
86
|
+
var rightIconStyle = __assign(__assign(__assign(__assign(__assign(__assign({}, variantStyles.icon), (focused ? variantStyles['icon:focus'] : {})), (showError ? variantStyles['icon:error'] : {})), variantStyles.rightIcon), (showError ? variantStyles['rightIcon:error'] : {})), (focused ? variantStyles['rightIcon:focus'] : {}));
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: [variantStyles.wrapper, focused && variantStyles['wrapper:focus'], showError && variantStyles['wrapper:error']] }, { children: [(0, jsx_runtime_1.jsx)(exports.InputLabel, { label: label, style: variantStyles.label }, void 0), (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: [variantStyles.innerWrapper, focused && variantStyles['innerWrapper:focus'], showError && variantStyles['innerWrapper:error']] }, { children: [(0, jsx_runtime_1.jsx)(exports.InputIcon, __assign({}, leftIcon, { style: leftIconStyle }), void 0), (0, jsx_runtime_1.jsx)(InputElement, __assign({ ref: input, type: visibilityToggle ? inputVisibilityType : inputType, onChange: handleChange, value: value, disabled: disabled, onFocus: handleFocus, onBlur: handleBlur, rows: 4 }, props, { css: [variantStyles.textField, focused && variantStyles['textField:focus'], showError && variantStyles['textField:error']] }), void 0), visibilityToggle ?
|
|
88
88
|
(0, jsx_runtime_1.jsx)(exports.InputIcon, { name: (textIsVisible ? 'input-visiblity:visible' : 'input-visiblity:hidden'), action: function () { return setTextVisible(); }, style: rightIconStyle }, void 0)
|
|
89
89
|
:
|
|
90
90
|
(0, jsx_runtime_1.jsx)(exports.InputIcon, __assign({}, rightIcon, { style: rightIconStyle }), void 0)] }), void 0), (0, jsx_runtime_1.jsx)(FormError, { message: error.message, css: __assign({}, variantStyles.error) }, void 0)] }), void 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAU8C;AAC9C,+BAA2G;AAC3G,oFAAsD;AACtD,+BAA8B;AAC9B,+BAA+B;AAC/B,mCAAkC;AAMlC,sBAAyB;AA4BZ,QAAA,SAAS,GAAG,IAAA,kBAAU,EAAmC,UAAC,QAAQ,EAAE,QAAQ;IAErF,IAAA,QAAQ,GAmBN,QAAQ,SAnBF,EACR,IAAI,GAkBF,QAAQ,KAlBN,EACJ,KAAK,GAiBH,QAAQ,MAjBL,EACL,YAAY,GAgBV,QAAQ,aAhBE,EACZ,QAAQ,GAeN,QAAQ,SAfF,EACR,MAAM,GAcJ,QAAQ,OAdJ,EACN,OAAO,GAaL,QAAQ,QAbH,EACP,MAAM,GAYJ,QAAQ,OAZJ,EACN,SAAS,GAWP,QAAQ,UAXD,EACT,kBAAkB,GAUhB,QAAQ,mBAVQ,EAClB,QAAQ,GASN,QAAQ,SATF,EACR,KAAK,GAQH,QAAQ,MARL,EACL,QAAQ,GAON,QAAQ,SAPF,EACR,SAAS,GAMP,QAAQ,UAND,EACT,MAAM,GAKJ,QAAQ,OALJ,EACN,QAAQ,GAIN,QAAQ,SAJF,EACR,QAAQ,GAGN,QAAQ,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1C,CAAC,CAAA;AAXY,QAAA,SAAS,aAWrB;AACM,IAAM,UAAU,GAAG,UAAC,EAAc;QAAb,KAAK,WAAA,EAAE,KAAK,WAAA;IACtC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,QAAQ,OAAO,KAAK,EAAC;QACnB,KAAK,QAAQ;YACX,OAAO,uBAAC,WAAI,IAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,WAAG,CAAA;QAC7D,KAAK,QAAQ;YAEX,OAAO,KAAK,CAAA;QACd;YACE,OAAO,IAAI,CAAA;KACd;AACH,CAAC,CAAA;AAZY,QAAA,UAAU,cAYtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { AnyFunction } from '@codeleap/common';
|
|
3
3
|
import { CSSObject } from '@emotion/react';
|
|
4
|
-
import
|
|
4
|
+
import { ComponentPropsWithRef, ElementType } from 'react';
|
|
5
5
|
export declare type TouchableProps<T extends ElementType> = ComponentPropsWithRef<T> & {
|
|
6
6
|
css?: CSSObject;
|
|
7
7
|
component?: T;
|
|
@@ -9,4 +9,4 @@ export declare type TouchableProps<T extends ElementType> = ComponentPropsWithRe
|
|
|
9
9
|
propagate?: boolean;
|
|
10
10
|
onPress?: AnyFunction;
|
|
11
11
|
};
|
|
12
|
-
export declare const Touchable: <T extends
|
|
12
|
+
export declare const Touchable: <T extends ElementType = <T_1 extends ElementType = "div">(props: any) => ReactElement>(touchableProps: any) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentVariants, ViewStyles, BaseViewProps } from '@codeleap/common';
|
|
2
|
-
import { ComponentPropsWithRef, ElementType,
|
|
2
|
+
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
3
|
export declare type ViewProps<T extends ElementType> = ComponentPropsWithRef<T> & ComponentVariants<typeof ViewStyles> & {
|
|
4
4
|
component?: T;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
css?: any;
|
|
7
7
|
} & BaseViewProps;
|
|
8
|
-
export declare const ViewCP: <T extends ElementType
|
|
9
|
-
export declare const View: <T extends ElementType
|
|
8
|
+
export declare const ViewCP: <T extends ElementType = "div">(viewProps: any, ref: Ref<any>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const View: <T extends ElementType = "div">(props: any) => ReactElement;
|
package/dist/lib/hooks.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "git@github.com:codeleap-uk/codeleap-lib.git",
|
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
"license": "UNLICENSED",
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@codeleap/config": "*",
|
|
11
|
+
"@types/react-dom": "^17.0.11",
|
|
11
12
|
"@types/react-window": "^1.8.5",
|
|
12
|
-
"react": "^17.0.2"
|
|
13
|
+
"react": "^17.0.2",
|
|
14
|
+
"react-dom": "^17.0.2"
|
|
13
15
|
},
|
|
14
16
|
"scripts": {
|
|
15
17
|
"build": "tsc --build",
|
|
16
|
-
"lint": "./node_modules/.bin/eslint -c .eslintrc.js \"./src/**/*.{ts,tsx,js,jsx}\""
|
|
18
|
+
"lint": "./node_modules/.bin/eslint -c .eslintrc.js \"./src/**/*.{ts,tsx,js,jsx}\"",
|
|
19
|
+
"publish": "npm publish"
|
|
17
20
|
},
|
|
18
21
|
"dependencies": {
|
|
19
22
|
"@emotion/css": "^11.7.1",
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$ tsc --build
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ComponentVariants, TooltipComposition, TooltipStyles } from '@codeleap/common';
|
|
3
|
-
import { StylesOf } from '../types/utility';
|
|
4
|
-
declare type TooltipPosition = 'left' | 'top' | 'bottom' | 'right';
|
|
5
|
-
export declare type TooltipProps = {
|
|
6
|
-
position?: TooltipPosition;
|
|
7
|
-
styles?: StylesOf<TooltipComposition>;
|
|
8
|
-
showOn?: 'click' | 'hover';
|
|
9
|
-
} & ComponentVariants<typeof TooltipStyles>;
|
|
10
|
-
export declare const Tooltip: React.FC<TooltipProps>;
|
|
11
|
-
export {};
|
|
@@ -1,151 +0,0 @@
|
|
|
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.Tooltip = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
var common_1 = require("@codeleap/common");
|
|
17
|
-
var react_1 = require("react");
|
|
18
|
-
var View_1 = require("./View");
|
|
19
|
-
var arrowPositionStyles = {
|
|
20
|
-
left: {
|
|
21
|
-
right: "100%",
|
|
22
|
-
top: '50%',
|
|
23
|
-
transform: 'translate(50%,-50%)',
|
|
24
|
-
},
|
|
25
|
-
right: {
|
|
26
|
-
left: "100%",
|
|
27
|
-
top: '50%',
|
|
28
|
-
transform: 'translate(-50%,-50%)',
|
|
29
|
-
},
|
|
30
|
-
bottom: {
|
|
31
|
-
left: '50%',
|
|
32
|
-
top: "100%",
|
|
33
|
-
transform: 'translate(-50%,-50%)',
|
|
34
|
-
},
|
|
35
|
-
top: {
|
|
36
|
-
left: '50%',
|
|
37
|
-
bottom: "100%",
|
|
38
|
-
transform: 'translate(-50%,50%)',
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
var tooltipPositionStyles = {
|
|
42
|
-
left: function (arrow, visible) {
|
|
43
|
-
if (arrow === void 0) { arrow = 0; }
|
|
44
|
-
if (visible === void 0) { visible = false; }
|
|
45
|
-
return ({
|
|
46
|
-
right: "calc(100% + ".concat(arrow, "px)"),
|
|
47
|
-
top: '50%',
|
|
48
|
-
transform: "translate(0%,-50%) scale(".concat(visible ? '1' : '0', ")"),
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
right: function (arrow, visible) {
|
|
52
|
-
if (arrow === void 0) { arrow = 0; }
|
|
53
|
-
if (visible === void 0) { visible = false; }
|
|
54
|
-
return ({
|
|
55
|
-
left: "calc(100% + ".concat(arrow, "px)"),
|
|
56
|
-
top: '50%',
|
|
57
|
-
transform: "translate(0%,-50%) scale(".concat(visible ? '1' : '0', ")"),
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
bottom: function (arrow, visible) {
|
|
61
|
-
if (arrow === void 0) { arrow = 0; }
|
|
62
|
-
if (visible === void 0) { visible = false; }
|
|
63
|
-
return ({
|
|
64
|
-
left: '50%',
|
|
65
|
-
top: "calc(100% + ".concat(arrow, "px)"),
|
|
66
|
-
transform: "translate(-50%,0%) scale(".concat(visible ? '1' : '0', ")"),
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
top: function (arrow, visible) {
|
|
70
|
-
if (arrow === void 0) { arrow = 0; }
|
|
71
|
-
if (visible === void 0) { visible = false; }
|
|
72
|
-
return ({
|
|
73
|
-
left: '50%',
|
|
74
|
-
bottom: "calc(100% + ".concat(arrow, "px)"),
|
|
75
|
-
transform: "translate(-50%,0%) scale(".concat(visible ? '1' : '0', ")"),
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
var invert = function (pos) {
|
|
80
|
-
if (['top', 'bottom'].includes(pos))
|
|
81
|
-
return pos === 'top' ? 'bottom' : 'top';
|
|
82
|
-
if (['left', 'right'].includes(pos))
|
|
83
|
-
return pos === 'left' ? 'right' : 'left';
|
|
84
|
-
};
|
|
85
|
-
var Tooltip = function (props) {
|
|
86
|
-
var children = props.children, position = props.position, styles = props.styles, variants = props.variants, responsiveVariants = props.responsiveVariants, showOn = props.showOn;
|
|
87
|
-
var tooltipRef = (0, react_1.useRef)(null);
|
|
88
|
-
var _a = (0, common_1.useBooleanToggle)(false), isVisible = _a[0], setVisible = _a[1];
|
|
89
|
-
var _b = (0, react_1.useState)(false), isCursorOnTooltip = _b[0], setCursorOnTooltip = _b[1];
|
|
90
|
-
(0, common_1.onUpdate)(function () {
|
|
91
|
-
if (tooltipRef.current) {
|
|
92
|
-
var parent_1 = tooltipRef.current.parentElement;
|
|
93
|
-
if (!parent_1.style.position || parent_1.style.position === 'static') {
|
|
94
|
-
parent_1.style.setProperty('position', 'relative');
|
|
95
|
-
}
|
|
96
|
-
if (showOn === 'click') {
|
|
97
|
-
var onOutsideClick_1 = function (e) {
|
|
98
|
-
var isToolTipOrParent = [
|
|
99
|
-
parent_1.isSameNode(e.target),
|
|
100
|
-
parent_1.contains(e.target),
|
|
101
|
-
tooltipRef.current.isSameNode(e.target),
|
|
102
|
-
tooltipRef.current.contains(e.target),
|
|
103
|
-
].some(function (a) { return a; });
|
|
104
|
-
if (isToolTipOrParent) {
|
|
105
|
-
if (!isVisible) {
|
|
106
|
-
setVisible();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else if (isVisible) {
|
|
110
|
-
setVisible(false);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
document.addEventListener('click', onOutsideClick_1);
|
|
114
|
-
return function () {
|
|
115
|
-
document.removeEventListener('click', onOutsideClick_1);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
var onEnter_1 = function () { return setVisible(true); };
|
|
120
|
-
var onLeave_1 = function () {
|
|
121
|
-
if (isCursorOnTooltip)
|
|
122
|
-
return;
|
|
123
|
-
setVisible(false);
|
|
124
|
-
};
|
|
125
|
-
parent_1.addEventListener('mouseenter', onEnter_1);
|
|
126
|
-
parent_1.addEventListener('mouseleave', onLeave_1);
|
|
127
|
-
return function () {
|
|
128
|
-
parent_1.removeEventListener('mouseenter', onEnter_1);
|
|
129
|
-
parent_1.removeEventListener('mouseleave', onLeave_1);
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}, [showOn, isVisible, isCursorOnTooltip]);
|
|
134
|
-
var debouncedVisible = (0, common_1.useDebounce)(isVisible, 100);
|
|
135
|
-
var arrowPos = arrowPositionStyles[invert(position)];
|
|
136
|
-
var variantStyles = (0, common_1.useComponentStyle)('Tooltip', {
|
|
137
|
-
responsiveVariants: responsiveVariants,
|
|
138
|
-
variants: variants,
|
|
139
|
-
styles: styles
|
|
140
|
-
});
|
|
141
|
-
var style = __assign(__assign(__assign(__assign({ position: 'absolute',
|
|
142
|
-
// visibility: isVisible ? 'visible' :'hidden',
|
|
143
|
-
zIndex: 10, transition: 'transform 0.2s ease' }, variantStyles.wrapper), { '&:after': __assign(__assign(__assign(__assign({}, variantStyles.arrow), { content: '""', position: 'absolute', background: 'black', height: 10, width: 10 }), arrowPos), { transform: arrowPos.transform + ' rotate(45deg)' }) }), styles), tooltipPositionStyles[position](10, debouncedVisible));
|
|
144
|
-
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: style, ref: tooltipRef, onHover: function (hovering) {
|
|
145
|
-
setCursorOnTooltip(hovering);
|
|
146
|
-
if (showOn === 'hover' && debouncedVisible && !hovering)
|
|
147
|
-
setVisible(false);
|
|
148
|
-
} }, { children: children }), void 0);
|
|
149
|
-
};
|
|
150
|
-
exports.Tooltip = Tooltip;
|
|
151
|
-
//# sourceMappingURL=Tooltip-old.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip-old.js","sourceRoot":"","sources":["../../src/components/Tooltip-old.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,2CAAmJ;AACnJ,+BAAwC;AAExC,+BAA6B;AAK7B,IAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,qBAAqB;KACjC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,sBAAsB;KAClC;IACD,MAAM,EAAE;QACN,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,sBAAsB;KAClC;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,qBAAqB;KACjC;CACF,CAAA;AAED,IAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE,UAAC,KAAS,EAAE,OAAe;QAA1B,sBAAA,EAAA,SAAS;QAAE,wBAAA,EAAA,eAAe;QAAK,OAAA,CAAC;YACrC,KAAK,EAAE,sBAAe,KAAK,QAAK;YAChC,GAAG,EAAE,KAAK;YACV,SAAS,EAAE,mCAA4B,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAI;SAC/D,CAAC;IAJoC,CAIpC;IACF,KAAK,EAAE,UAAC,KAAS,EAAE,OAAe;QAA1B,sBAAA,EAAA,SAAS;QAAE,wBAAA,EAAA,eAAe;QAAK,OAAA,CAAC;YACtC,IAAI,EAAE,sBAAe,KAAK,QAAK;YAC/B,GAAG,EAAE,KAAK;YACV,SAAS,EAAE,mCAA4B,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAI;SAC/D,CAAC;IAJqC,CAIrC;IACF,MAA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E,EAAE,KACN,QAAQ,KACX,SAAS,EAAE,QAAQ,CAAC,SAAS,GAAG,gBAAgB,QAE/C,MAAM,GACN,qBAAqB,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAC5C,CAAA;IACd,OAAO,uBAAC,WAAI,aAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAC,QAAQ;YAC1D,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YAC5B,IAAI,MAAM,KAAK,OAAO,IAAI,gBAAgB,IAAI,CAAC,QAAQ;gBAAE,UAAU,CAAC,KAAK,CAAC,CAAA;QAC5E,CAAC,gBACE,QAAQ,YACJ,CAAA;AACT,CAAC,CAAA;AAnGY,QAAA,OAAO,WAmGnB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MenuItemProps } from './MenuItem';
|
|
3
|
-
import { MenuComposition } from '@codeleap/common';
|
|
4
|
-
import { StylesOf } from '../../types/utility';
|
|
5
|
-
declare type RouterMenuProps = {
|
|
6
|
-
items: MenuItemProps['data'][];
|
|
7
|
-
styles?: StylesOf<MenuComposition>;
|
|
8
|
-
};
|
|
9
|
-
export declare const Menu: React.FC<RouterMenuProps>;
|
|
10
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Menu = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var View_1 = require("../View");
|
|
20
|
-
var CenterWrapper_1 = require("../CenterWrapper");
|
|
21
|
-
var HorizontalScroll_1 = __importDefault(require("../HorizontalScroll"));
|
|
22
|
-
var MenuItem_1 = require("./MenuItem");
|
|
23
|
-
var common_1 = require("@codeleap/common");
|
|
24
|
-
var TabsWrapper = function (_a) {
|
|
25
|
-
var children = _a.children, styles = _a.styles;
|
|
26
|
-
var Theme = (0, common_1.useStyle)().Theme;
|
|
27
|
-
var isMobile = Theme.hooks.down('small');
|
|
28
|
-
var wrapperStyle = isMobile ? styles.topMenu : styles.sideMenu;
|
|
29
|
-
if (isMobile) {
|
|
30
|
-
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: (0, jsx_runtime_1.jsx)(CenterWrapper_1.CenterWrapper, { children: (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.mobileMenu }, { children: (0, jsx_runtime_1.jsx)(HorizontalScroll_1.default, __assign({ css: styles.horizontalScroll }, { children: children }), void 0) }), void 0) }, void 0) }), void 0);
|
|
31
|
-
}
|
|
32
|
-
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: children }), void 0);
|
|
33
|
-
};
|
|
34
|
-
var Menu = function (_a) {
|
|
35
|
-
var items = _a.items, styles = _a.styles;
|
|
36
|
-
return (0, jsx_runtime_1.jsx)(TabsWrapper, __assign({ styles: styles }, { children: items.map(function (data) { return (0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { data: data, styles: styles }, data.path); }) }), void 0);
|
|
37
|
-
};
|
|
38
|
-
exports.Menu = Menu;
|
|
39
|
-
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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 -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IconPlaceholder, MenuComposition, StylesOf } from '@codeleap/common';
|
|
3
|
-
export declare type MenuItemProps = {
|
|
4
|
-
data: {
|
|
5
|
-
icon: IconPlaceholder;
|
|
6
|
-
title: string;
|
|
7
|
-
path: string;
|
|
8
|
-
};
|
|
9
|
-
styles: StylesOf<MenuComposition>;
|
|
10
|
-
};
|
|
11
|
-
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
@@ -1,42 +0,0 @@
|
|
|
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.MenuItem = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
var Text_1 = require("../Text");
|
|
17
|
-
var Icon_1 = require("../Icon");
|
|
18
|
-
var Link_1 = require("../Link");
|
|
19
|
-
var common_1 = require("@codeleap/common");
|
|
20
|
-
var utils_1 = require("../../lib/utils");
|
|
21
|
-
var gatsby_plugin_intl_1 = require("gatsby-plugin-intl");
|
|
22
|
-
var RouterLink = function (props) { return (0, jsx_runtime_1.jsx)(Link_1.Link, __assign({ component: gatsby_plugin_intl_1.Link }, props), void 0); };
|
|
23
|
-
var MenuItem = function (props) {
|
|
24
|
-
var styles = props.styles;
|
|
25
|
-
var _a = props.data, title = _a.title, path = _a.path, icon = _a.icon;
|
|
26
|
-
var pathname = (0, utils_1.url)().pathname;
|
|
27
|
-
var selected = pathname.includes(path);
|
|
28
|
-
var Theme = (0, common_1.useStyle)().Theme;
|
|
29
|
-
var isMobile = Theme.hooks.down('small');
|
|
30
|
-
if (isMobile) {
|
|
31
|
-
return (0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path, css: [styles['menuItem:mobile']] }, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
32
|
-
styles['menuItem:text:mobile'],
|
|
33
|
-
selected && styles['menuItem:text:selected'],
|
|
34
|
-
], msg: title }, void 0), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon }, void 0)] }), void 0);
|
|
35
|
-
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon }, void 0), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
37
|
-
styles['menuItem:text'],
|
|
38
|
-
selected && styles['menuItem:text:selected'],
|
|
39
|
-
], msg: title }, void 0)] }), void 0));
|
|
40
|
-
};
|
|
41
|
-
exports.MenuItem = MenuItem;
|
|
42
|
-
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../../../src/components/router/MenuItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gCAA8B;AAC9B,gCAA8B;AAC9B,gCAAyC;AACzC,2CAAwF;AACxF,yCAAsC;AACtC,yDAAmD;AAEnD,IAAM,UAAU,GAAwC,UAAC,KAAK,IAAK,OAAA,uBAAC,WAAI,aAAC,SAAS,EAAE,yBAAQ,IAAM,KAAK,UAAG,EAAvC,CAAuC,CAAA;AAWnG,IAAM,QAAQ,GAA2B,UAAC,KAAK;IAC5C,IAAA,MAAM,GAAI,KAAK,OAAT,CAAS;IACjB,IAAA,KAAwB,KAAK,CAAC,IAAI,EAAhC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,IAAI,UAAe,CAAC;IAEjC,IAAA,QAAQ,GAAK,IAAA,WAAG,GAAE,SAAV,CAAW;IAE3B,IAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,IAAA,KAAK,GAAK,IAAA,iBAAQ,GAAE,MAAf,CAAe;IAC5B,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAE1C,IAAI,QAAQ,EAAC;QACX,OAAS,wBAAC,UAAU,aAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,iBAC9D,uBAAC,WAAI,IACH,OAAO,EAAE,IAAI,EACb,GAAG,EAAE;wBACH,MAAM,CAAC,sBAAsB,CAAC;wBAC9B,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC;qBAC7C,EACD,GAAG,EAAE,KAAK,WACV,EACF,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,WAAI,aACT,CAAA;KACd;IAED,OAAO,CAAC,wBAAC,UAAU,aAAC,EAAE,EAAE,IAAI,iBAC1B,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,WAAI,EACpB,uBAAC,WAAI,IACH,OAAO,EAAE,IAAI,EACb,GAAG,EAAE;oBACH,MAAM,CAAC,eAAe,CAAC;oBACvB,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC;iBAC7C,EACD,GAAG,EAAE,KAAK,WACV,aACS,CACZ,CAAC;AACJ,CAAC,CAAA;AApCY,QAAA,QAAQ,YAoCpB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Router = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var router_1 = require("@reach/router");
|
|
21
|
-
var react_helmet_1 = require("react-helmet");
|
|
22
|
-
var Router = function (props) {
|
|
23
|
-
var children = props.children, style = props.style, basePath = props.basePath, defaultPath = props.defaultPath;
|
|
24
|
-
var base = "/:language".concat(basePath);
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, {}, void 0), (0, jsx_runtime_1.jsx)(router_1.Router, __assign({ basepath: base }, { children: children }), void 0)] }, void 0));
|
|
26
|
-
};
|
|
27
|
-
exports.Router = Router;
|
|
28
|
-
//# sourceMappingURL=Router.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/components/router/Router.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,wCAAsD;AACtD,6CAAsC;AAS/B,IAAM,MAAM,GAA0B,UAAC,KAAK;IACzC,IAAA,QAAQ,GAAmC,KAAK,SAAxC,EAAE,KAAK,GAA4B,KAAK,MAAjC,EAAE,QAAQ,GAAkB,KAAK,SAAvB,EAAE,WAAW,GAAK,KAAK,YAAV,CAAW;IACzD,IAAM,IAAI,GAAG,oBAAa,QAAQ,CAAE,CAAC;IAGrC,OAAO,CACL,wBAAC,eAAK,CAAC,QAAQ,eACb,uBAAC,qBAAM,aACE,EACT,uBAAC,eAAW,aAAC,QAAQ,EAAE,IAAI,gBACxB,QAAQ,YACG,YACC,CAClB,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,MAAM,UAcjB"}
|