@codeleap/web 1.0.1 → 1.1.0
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/.turbo/turbo-build.log +2 -1
- package/dist/components/ActivityIndicator/index.d.ts +0 -1
- package/dist/components/ActivityIndicator/styles.d.ts +5 -1
- package/dist/components/{Checkbox.d.ts → Checkbox/index.d.ts} +4 -3
- package/dist/components/{Checkbox.js → Checkbox/index.js} +14 -3
- 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/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 +4 -2
- package/src/components/{Checkbox.tsx → Checkbox/index.tsx} +10 -9
- package/src/components/Checkbox/styles.ts +57 -0
- package/src/components/ContentView.tsx +1 -1
- package/src/components/FileInput.tsx +2 -2
- package/src/components/Icon.tsx +10 -7
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/PageRouter/MenuItem.tsx +4 -2
- package/src/components/RadioInput/index.tsx +2 -2
- package/src/components/TextInput.tsx +9 -5
- package/dist/components/Checkbox.js.map +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
|
@@ -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,EAC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,WAAA,EAAE,MAAM,YAAA;IAC7E,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,IAAI,MAAM,EAAC;QAET,OAAO,uBAAC,eAAM,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAM,OAAA,MAAM,EAAE,EAAR,CAAQ,EAAG,MAAM,EAAE;gBAC3D,IAAI,EAAE,KAAK;aACZ,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,WAAG,CAAA;KACzB;IAED,OAAO,uBAAC,OAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,WAAG,CAAA;AAC1C,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.0
|
|
3
|
+
"version": "1.1.0",
|
|
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,8 +8,10 @@
|
|
|
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",
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { jsx } from '@emotion/react'
|
|
3
|
-
import {
|
|
4
|
+
import { ComponentVariants, StylesOf, useComponentStyle, useStyle } from '@codeleap/common'
|
|
4
5
|
import { ComponentPropsWithRef } from 'react'
|
|
5
|
-
import { View } from '
|
|
6
|
-
import { Text } from '
|
|
7
|
-
|
|
6
|
+
import { View } from '../View'
|
|
7
|
+
import { Text } from '../Text'
|
|
8
|
+
import {WebCheckboxComposition, WebCheckboxStyles as CheckboxStyles} from './styles'
|
|
8
9
|
type NativeCheckboxProps = ComponentPropsWithRef<'input'>
|
|
9
|
-
|
|
10
|
+
export * from './styles'
|
|
10
11
|
export type CheckboxProps = NativeCheckboxProps & {
|
|
11
|
-
checked?:boolean
|
|
12
|
+
checked?:boolean
|
|
12
13
|
onValueChange?: (checked:boolean) => any
|
|
13
14
|
label?: React.ReactNode
|
|
14
|
-
styles?:StylesOf<
|
|
15
|
+
styles?:StylesOf<WebCheckboxComposition>
|
|
15
16
|
} & ComponentVariants<typeof CheckboxStyles>
|
|
16
17
|
|
|
17
18
|
export const Checkbox = (checkboxProps:CheckboxProps) => {
|
|
@@ -22,11 +23,11 @@ export const Checkbox = (checkboxProps:CheckboxProps) => {
|
|
|
22
23
|
onValueChange && onValueChange(e.target.checked)
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const variantStyles
|
|
26
|
+
const variantStyles = useComponentStyle('Checkbox', {
|
|
26
27
|
responsiveVariants,
|
|
27
28
|
variants,
|
|
28
29
|
styles,
|
|
29
|
-
})
|
|
30
|
+
}) as StylesOf<WebCheckboxComposition>
|
|
30
31
|
|
|
31
32
|
const {logger} = useStyle()
|
|
32
33
|
logger.log('Checkbox Style', variantStyles, 'Style')
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {createDefaultVariantFactory, includePresets} from '@codeleap/common'
|
|
2
|
+
export type WebCheckboxComposition = 'wrapper' | 'label' | 'input' | 'checkmark' | 'checkmarkWrapper';
|
|
3
|
+
|
|
4
|
+
const createCheckboxStyle = createDefaultVariantFactory<WebCheckboxComposition>()
|
|
5
|
+
|
|
6
|
+
const presets = includePresets((styles) => createCheckboxStyle(() => ({ wrapper: styles })))
|
|
7
|
+
|
|
8
|
+
export const WebCheckboxStyles = {
|
|
9
|
+
...presets,
|
|
10
|
+
default: createCheckboxStyle((theme) => ({
|
|
11
|
+
wrapper: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
position: 'relative',
|
|
15
|
+
cursor: 'pointer',
|
|
16
|
+
'.checkbox-label': {
|
|
17
|
+
height: '18px',
|
|
18
|
+
width: '18px',
|
|
19
|
+
border: `1px solid ${theme.colors.gray}`,
|
|
20
|
+
borderRadius: theme.borderRadius.small,
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
transition: 'background 0.3s ease',
|
|
24
|
+
':after': {
|
|
25
|
+
content: '""',
|
|
26
|
+
border: `2px solid ${theme.colors.white}`,
|
|
27
|
+
borderLeftColor: 'transparent',
|
|
28
|
+
borderTopColor: 'transparent',
|
|
29
|
+
height: '40%',
|
|
30
|
+
width: '20%',
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
left: '50%',
|
|
33
|
+
top: '40%',
|
|
34
|
+
|
|
35
|
+
transform: 'translate(-50%,-50%) rotate(45deg) scale(0)',
|
|
36
|
+
transition: 'transform 0.2s ease',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
},
|
|
41
|
+
label: {
|
|
42
|
+
...theme.spacing.marginLeft(1),
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
input: {
|
|
47
|
+
visibility: 'hidden',
|
|
48
|
+
'&:checked + .checkbox-label': {
|
|
49
|
+
'&:after': {
|
|
50
|
+
transform: 'translate(-50%,-50%) rotate(45deg) scale(1)',
|
|
51
|
+
},
|
|
52
|
+
background: theme.colors.primary,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
})),
|
|
56
|
+
|
|
57
|
+
}
|
|
@@ -30,7 +30,7 @@ export const ContentView:React.FC<ContentViewProps> = (rawProps) => {
|
|
|
30
30
|
})
|
|
31
31
|
|
|
32
32
|
if (loading){
|
|
33
|
-
return <WrapContent {...props} css={variantStyle.wrapper}>
|
|
33
|
+
return <WrapContent {...props} css={{...variantStyle.wrapper}}>
|
|
34
34
|
<ActivityIndicator css={variantStyle.loader}/>
|
|
35
35
|
</WrapContent>
|
|
36
36
|
}
|
|
@@ -11,7 +11,7 @@ type FileInputProps= Omit<ComponentPropsWithoutRef<'input'>, 'type'> & {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
export const FileInput = React.forwardRef<FileInputRef, FileInputProps>((inputProps, ref) => {
|
|
16
16
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@ export const FileInput = React.forwardRef<FileInputRef, FileInputProps>((inputPr
|
|
|
28
28
|
function handleChange(e:React.ChangeEvent<HTMLInputElement>){
|
|
29
29
|
if (!e.target.files.length) return
|
|
30
30
|
inputProps.onChange && inputProps.onChange(e)
|
|
31
|
-
const fileArray = Array.from(e.target?.files||[])
|
|
31
|
+
const fileArray = Array.from(e.target?.files||[]) as File[]
|
|
32
32
|
|
|
33
33
|
const files:WebInputFile[] = fileArray.map((obj) => ({
|
|
34
34
|
file: obj,
|
package/src/components/Icon.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconPlaceholder, useStyle } from '@codeleap/common'
|
|
1
|
+
import { ComponentVariants, IconPlaceholder, useComponentStyle, useStyle, IconStyles } from '@codeleap/common'
|
|
2
2
|
|
|
3
3
|
export type IconProps = {
|
|
4
4
|
name:IconPlaceholder
|
|
@@ -8,19 +8,22 @@ export type IconProps = {
|
|
|
8
8
|
width?:string|number
|
|
9
9
|
height?:string|number
|
|
10
10
|
}
|
|
11
|
+
} & ComponentVariants<typeof IconStyles>
|
|
11
12
|
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const Icon:React.FC<IconProps> = ({name, style}) => {
|
|
15
|
-
const {Theme} = useStyle()
|
|
13
|
+
export const Icon:React.FC<IconProps> = ({name, style, responsiveVariants, variants}) => {
|
|
14
|
+
const {Theme, logger} = useStyle()
|
|
16
15
|
if (!name) return null
|
|
17
16
|
const Component = Theme?.icons?.[name]
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
|
|
20
19
|
|
|
20
|
+
const variantStyles = useComponentStyle('Icon', {
|
|
21
|
+
variants,
|
|
22
|
+
responsiveVariants,
|
|
23
|
+
})
|
|
21
24
|
if (!Component) {
|
|
22
25
|
logger.warn('Icon', `No icon found in theme for name "${name}"`, 'Component')
|
|
23
26
|
return null
|
|
24
27
|
}
|
|
25
|
-
return <Component style={style}/>
|
|
28
|
+
return <Component style={{...variantStyles.icon, ...style}}/>
|
|
26
29
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import { Text } from '../Text'
|
|
2
3
|
import { Icon } from '../Icon'
|
|
3
|
-
import { Link
|
|
4
|
+
import { Link } from '../Link'
|
|
4
5
|
import { IconPlaceholder, MenuComposition, StylesOf, useStyle } from '@codeleap/common';
|
|
5
6
|
import { url } from '../../lib/utils';
|
|
6
7
|
import {Link as IntlLink} from 'gatsby-plugin-intl'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
const RouterLink:React.FC<any> = (props) => <Link component={IntlLink} {...props}/>
|
|
9
11
|
|
|
10
12
|
export type MenuItemProps = {
|
|
11
13
|
data: {
|
|
@@ -17,10 +17,10 @@ const getRadioStyle = (props) => useComponentStyle('RadioInput', props)
|
|
|
17
17
|
export type RadioButtonProps = Omit<ComponentPropsWithoutRef<'input'>, 'style'> & {
|
|
18
18
|
item: RadioItem
|
|
19
19
|
select: () => void
|
|
20
|
-
style:
|
|
20
|
+
style: StylesOf<RadioInputComposition>
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export type RadioGroupProps<T> = {
|
|
23
|
+
export type RadioGroupProps<T> = {
|
|
24
24
|
options: RadioItem<T>[]
|
|
25
25
|
value: T
|
|
26
26
|
onValueChange(value:T):void
|
|
@@ -70,7 +70,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>((rawprops,
|
|
|
70
70
|
...props
|
|
71
71
|
} = rawprops
|
|
72
72
|
|
|
73
|
-
const [
|
|
73
|
+
const [focused, setFocus] = useState(false)
|
|
74
74
|
const [editedState, setEdited] = useState(edited)
|
|
75
75
|
const [error, setError] = useState<ReturnType<FormTypes.ValidatorFunction>>({
|
|
76
76
|
valid: true,
|
|
@@ -132,24 +132,28 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>((rawprops,
|
|
|
132
132
|
const leftIconStyle = {
|
|
133
133
|
...variantStyles.icon,
|
|
134
134
|
...(showError ? variantStyles['icon:error'] : {} ),
|
|
135
|
+
...(focused ? variantStyles['icon:focus'] : {} ),
|
|
135
136
|
...variantStyles.leftIcon,
|
|
136
137
|
...(showError ? variantStyles['leftIcon:error'] : {} ),
|
|
138
|
+
...(focused ? variantStyles['leftIcon:focus'] : {}),
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
const rightIconStyle = {
|
|
140
142
|
...variantStyles.icon,
|
|
143
|
+
...(focused ? variantStyles['icon:focus'] : {}),
|
|
141
144
|
...(showError ? variantStyles['icon:error'] : {} ),
|
|
142
145
|
...variantStyles.rightIcon,
|
|
143
146
|
...(showError ? variantStyles['rightIcon:error'] : {} ),
|
|
147
|
+
...(focused ? variantStyles['rightIcon:focus'] : {}),
|
|
144
148
|
}
|
|
145
149
|
|
|
146
150
|
return (
|
|
147
151
|
<View
|
|
148
|
-
css={[variantStyles.wrapper, showError && variantStyles['wrapper:error']]}
|
|
152
|
+
css={[variantStyles.wrapper, focused && variantStyles['wrapper:focus'], showError && variantStyles['wrapper:error']]}
|
|
149
153
|
>
|
|
150
154
|
<InputLabel label={label} style={variantStyles.label}/>
|
|
151
155
|
|
|
152
|
-
<
|
|
156
|
+
<View css={[variantStyles.innerWrapper, focused && variantStyles['innerWrapper:focus'], showError && variantStyles['innerWrapper:error']]}>
|
|
153
157
|
|
|
154
158
|
|
|
155
159
|
<InputIcon {...leftIcon} style={leftIconStyle}/>
|
|
@@ -163,7 +167,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>((rawprops,
|
|
|
163
167
|
onBlur={handleBlur}
|
|
164
168
|
rows={4}
|
|
165
169
|
{...props}
|
|
166
|
-
css={[variantStyles.textField, showError && variantStyles['textField:error']]}
|
|
170
|
+
css={[variantStyles.textField, focused && variantStyles['textField:focus'], showError && variantStyles['textField:error']]}
|
|
167
171
|
/>
|
|
168
172
|
{
|
|
169
173
|
visibilityToggle ?
|
|
@@ -173,7 +177,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>((rawprops,
|
|
|
173
177
|
:
|
|
174
178
|
<InputIcon {...rightIcon} style={rightIconStyle}/>
|
|
175
179
|
}
|
|
176
|
-
</
|
|
180
|
+
</View>
|
|
177
181
|
|
|
178
182
|
<FormError message={error.message} css={{
|
|
179
183
|
...variantStyles.error,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAAgI;AAEhI,+BAA6B;AAC7B,+BAA6B;AAWtB,IAAM,QAAQ,GAAG,UAAC,aAA2B;IAC3C,IAAA,OAAO,GAA6F,aAAa,QAA1G,EAAE,aAAa,GAA8E,aAAa,cAA3F,EAAE,KAA4E,aAAa,SAA7E,EAAZ,QAAQ,mBAAE,EAAE,KAAA,EAAE,KAA8D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|
|
|
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 {};
|