@codeleap/web 2.0.0 → 2.3.12
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 +12 -12
- package/dist/components/ActivityIndicator/index.js +60 -60
- package/dist/components/ActivityIndicator/styles.d.ts +53 -53
- package/dist/components/ActivityIndicator/styles.js +21 -21
- package/dist/components/Button.d.ts +18 -18
- package/dist/components/Button.js +66 -66
- package/dist/components/CenterWrapper.d.ts +7 -7
- package/dist/components/CenterWrapper.js +27 -27
- package/dist/components/Checkbox/index.d.ts +12 -12
- package/dist/components/Checkbox/index.js +61 -61
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +63 -63
- package/dist/components/Collapse.d.ts +20 -20
- package/dist/components/Collapse.js +67 -67
- package/dist/components/ContentView.d.ts +10 -10
- package/dist/components/ContentView.js +51 -51
- package/dist/components/Drawer.d.ts +23 -23
- package/dist/components/Drawer.js +72 -72
- package/dist/components/FileInput.d.ts +8 -8
- package/dist/components/FileInput.js +72 -72
- package/dist/components/HorizontalScroll.d.ts +3 -3
- package/dist/components/HorizontalScroll.js +41 -41
- package/dist/components/Icon.d.ts +8 -8
- package/dist/components/Icon.js +54 -54
- package/dist/components/Link.d.ts +7 -7
- package/dist/components/Link.js +62 -62
- package/dist/components/List.d.ts +18 -18
- package/dist/components/List.js +51 -51
- package/dist/components/Modal/index.d.ts +21 -21
- package/dist/components/Modal/index.js +119 -119
- package/dist/components/Modal/styles.d.ts +56 -56
- package/dist/components/Modal/styles.js +35 -35
- package/dist/components/Overlay.d.ts +10 -10
- package/dist/components/Overlay.js +40 -40
- package/dist/components/RadioInput/index.d.ts +21 -21
- package/dist/components/RadioInput/index.js +54 -54
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +43 -43
- package/dist/components/RouterPage/Menu.d.ts +10 -10
- package/dist/components/RouterPage/Menu.js +35 -35
- package/dist/components/RouterPage/MenuItem.d.ts +12 -12
- package/dist/components/RouterPage/MenuItem.js +41 -41
- package/dist/components/RouterPage/Router.d.ts +8 -8
- package/dist/components/RouterPage/Router.js +26 -26
- package/dist/components/RouterPage/index.d.ts +29 -29
- package/dist/components/RouterPage/index.js +88 -88
- package/dist/components/RouterPage/styles.d.ts +54 -54
- package/dist/components/RouterPage/styles.js +86 -86
- package/dist/components/Scroll.d.ts +5 -5
- package/dist/components/Scroll.js +23 -23
- package/dist/components/Select/Custom.d.ts +8 -8
- package/dist/components/Select/Custom.js +103 -103
- package/dist/components/Select/Custom.js.map +1 -1
- package/dist/components/Select/Multi.d.ts +3 -0
- package/dist/components/Select/Multi.js +105 -0
- package/dist/components/Select/Multi.js.map +1 -0
- package/dist/components/Select/Native.d.ts +17 -17
- package/dist/components/Select/Native.js +43 -43
- package/dist/components/Select/index.d.ts +12 -11
- package/dist/components/Select/index.js +43 -41
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +5 -5
- package/dist/components/Select/styles.js +56 -56
- package/dist/components/Select/types.d.ts +49 -31
- package/dist/components/Select/types.js +2 -2
- package/dist/components/Slider.d.ts +5 -5
- package/dist/components/Slider.js +35 -35
- package/dist/components/Text.d.ts +9 -9
- package/dist/components/Text.js +40 -40
- package/dist/components/TextInput.d.ts +150 -150
- package/dist/components/TextInput.js +124 -124
- package/dist/components/Tooltip.d.ts +12 -12
- package/dist/components/Tooltip.js +121 -123
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Touchable.d.ts +15 -15
- package/dist/components/Touchable.js +51 -51
- package/dist/components/View.d.ts +10 -10
- package/dist/components/View.js +61 -61
- package/dist/components/index.d.ts +24 -24
- package/dist/components/index.js +40 -40
- package/dist/index.d.ts +6 -6
- package/dist/index.js +28 -28
- package/dist/lib/OSAlert.d.ts +21 -21
- package/dist/lib/OSAlert.js +139 -139
- package/dist/lib/Toast.d.ts +13 -13
- package/dist/lib/Toast.js +31 -31
- package/dist/lib/hooks.d.ts +28 -33
- package/dist/lib/hooks.js +182 -154
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/logger.d.ts +2 -2
- package/dist/lib/logger.js +15 -15
- package/dist/lib/utils/cookies.d.ts +6 -6
- package/dist/lib/utils/cookies.js +14 -14
- package/dist/lib/utils/index.d.ts +4 -4
- package/dist/lib/utils/index.js +26 -26
- package/dist/lib/utils/pollyfils/scroll.d.ts +1 -1
- package/dist/lib/utils/pollyfils/scroll.js +65 -65
- package/dist/lib/utils/stopPropagation.d.ts +1 -1
- package/dist/lib/utils/stopPropagation.js +19 -19
- package/dist/types/utility.d.ts +2 -2
- package/dist/types/utility.js +2 -2
- package/package.json +47 -47
|
@@ -1,57 +1,57 @@
|
|
|
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.WebSelectStyles = void 0;
|
|
15
|
-
var common_1 = require("@codeleap/common");
|
|
16
|
-
var createSelectStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
-
exports.WebSelectStyles = {
|
|
18
|
-
default: createSelectStyle(function (Theme) { return ({
|
|
19
|
-
wrapper: {
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
},
|
|
23
|
-
label: __assign({}, Theme.spacing.marginBottom(1)),
|
|
24
|
-
inputWrapper: {
|
|
25
|
-
position: 'relative',
|
|
26
|
-
},
|
|
27
|
-
list: __assign(__assign(__assign(__assign({ position: 'absolute', left: 0, right: 0, display: 'flex', top: '110%', backgroundColor: Theme.colors.gray }, Theme.presets.column), { overflowY: 'hidden', transition: 'all 0.5s ease', maxHeight: 0 }), Theme.border.create({
|
|
28
|
-
width: 0,
|
|
29
|
-
color: 'transparent',
|
|
30
|
-
})), { borderRadius: Theme.borderRadius.small }),
|
|
31
|
-
'list:open': __assign({ maxHeight: '500%', overflowY: 'auto' }, Theme.border.primary(1)),
|
|
32
|
-
itemText: {},
|
|
33
|
-
itemWrapper: __assign(__assign({}, Theme.spacing.padding(0.5)), { cursor: 'pointer', display: 'flex', '&:hover': {
|
|
34
|
-
backgroundColor: '#0002',
|
|
35
|
-
} }),
|
|
36
|
-
'itemText:selected': {},
|
|
37
|
-
'itemWrapper:selected': {
|
|
38
|
-
backgroundColor: Theme.colors.primary,
|
|
39
|
-
'&:hover': {
|
|
40
|
-
backgroundColor: Theme.colors.primary,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
buttonWrapper: __assign(__assign(__assign(__assign(__assign({}, Theme.border.primary(1)), Theme.presets.fullWidth), Theme.presets.alignCenter), Theme.spacing.padding(0.5)), { backgroundColor: Theme.colors.gray, borderRadius: Theme.borderRadius.small, cursor: 'pointer', display: 'flex' }),
|
|
44
|
-
'button:open': {},
|
|
45
|
-
buttonText: {
|
|
46
|
-
flex: 1,
|
|
47
|
-
},
|
|
48
|
-
buttonIcon: __assign({ height: 24, width: 24, color: Theme.colors.white, transition: 'all 0.2s ease' }, Theme.spacing.marginLeft('auto')),
|
|
49
|
-
'buttonIcon:open': {
|
|
50
|
-
transform: 'rotate(180deg)',
|
|
51
|
-
},
|
|
52
|
-
error: {
|
|
53
|
-
color: Theme.colors.negative,
|
|
54
|
-
},
|
|
55
|
-
}); }),
|
|
56
|
-
};
|
|
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.WebSelectStyles = void 0;
|
|
15
|
+
var common_1 = require("@codeleap/common");
|
|
16
|
+
var createSelectStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
+
exports.WebSelectStyles = {
|
|
18
|
+
default: createSelectStyle(function (Theme) { return ({
|
|
19
|
+
wrapper: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
},
|
|
23
|
+
label: __assign({}, Theme.spacing.marginBottom(1)),
|
|
24
|
+
inputWrapper: {
|
|
25
|
+
position: 'relative',
|
|
26
|
+
},
|
|
27
|
+
list: __assign(__assign(__assign(__assign({ position: 'absolute', left: 0, right: 0, display: 'flex', top: '110%', backgroundColor: Theme.colors.gray }, Theme.presets.column), { overflowY: 'hidden', transition: 'all 0.5s ease', maxHeight: 0 }), Theme.border.create({
|
|
28
|
+
width: 0,
|
|
29
|
+
color: 'transparent',
|
|
30
|
+
})), { borderRadius: Theme.borderRadius.small }),
|
|
31
|
+
'list:open': __assign({ maxHeight: '500%', overflowY: 'auto' }, Theme.border.primary(1)),
|
|
32
|
+
itemText: {},
|
|
33
|
+
itemWrapper: __assign(__assign({}, Theme.spacing.padding(0.5)), { cursor: 'pointer', display: 'flex', '&:hover': {
|
|
34
|
+
backgroundColor: '#0002',
|
|
35
|
+
} }),
|
|
36
|
+
'itemText:selected': {},
|
|
37
|
+
'itemWrapper:selected': {
|
|
38
|
+
backgroundColor: Theme.colors.primary,
|
|
39
|
+
'&:hover': {
|
|
40
|
+
backgroundColor: Theme.colors.primary,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
buttonWrapper: __assign(__assign(__assign(__assign(__assign({}, Theme.border.primary(1)), Theme.presets.fullWidth), Theme.presets.alignCenter), Theme.spacing.padding(0.5)), { backgroundColor: Theme.colors.gray, borderRadius: Theme.borderRadius.small, cursor: 'pointer', display: 'flex' }),
|
|
44
|
+
'button:open': {},
|
|
45
|
+
buttonText: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
},
|
|
48
|
+
buttonIcon: __assign({ height: 24, width: 24, color: Theme.colors.white, transition: 'all 0.2s ease' }, Theme.spacing.marginLeft('auto')),
|
|
49
|
+
'buttonIcon:open': {
|
|
50
|
+
transform: 'rotate(180deg)',
|
|
51
|
+
},
|
|
52
|
+
error: {
|
|
53
|
+
color: Theme.colors.negative,
|
|
54
|
+
},
|
|
55
|
+
}); }),
|
|
56
|
+
};
|
|
57
57
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ComponentVariants, FormTypes, IconPlaceholder } from '@codeleap/common';
|
|
3
|
-
import { StylesOf } from '../../types/utility';
|
|
4
|
-
import { WebSelectComposition, WebSelectStyles } from './styles';
|
|
5
|
-
export declare type SelectRenderFNProps<T> = CustomSelectProps<T>['options'][number] & {
|
|
6
|
-
styles: StylesOf<WebSelectComposition>;
|
|
7
|
-
onPress: () => void;
|
|
8
|
-
selected?: boolean;
|
|
9
|
-
inList?: boolean;
|
|
10
|
-
open?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare type SelectRenderFN<T> = (props: SelectRenderFNProps<T>) => JSX.Element;
|
|
13
|
-
export declare type CustomSelectProps<T = any> = {
|
|
14
|
-
value: T;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
label?: FormTypes.Label;
|
|
17
|
-
options?: {
|
|
18
|
-
value: T;
|
|
19
|
-
label?: FormTypes.Label;
|
|
20
|
-
icon?: IconPlaceholder;
|
|
21
|
-
}[];
|
|
22
|
-
onDropdownToggle?: (isOpen?: boolean) => void;
|
|
23
|
-
onValueChange?: (value: T) => void;
|
|
24
|
-
renderItem?: SelectRenderFN<T>;
|
|
25
|
-
renderCurrentlySelected?: SelectRenderFN<T>;
|
|
26
|
-
styles?: StylesOf<WebSelectComposition>;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
validate?: FormTypes.ValidatorFunctionWithoutForm<any> | string;
|
|
29
|
-
arrowIconName?: IconPlaceholder;
|
|
30
|
-
autoClose?: boolean;
|
|
31
|
-
} & ComponentVariants<typeof WebSelectStyles>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentVariants, FormTypes, IconPlaceholder } from '@codeleap/common';
|
|
3
|
+
import { StylesOf } from '../../types/utility';
|
|
4
|
+
import { WebSelectComposition, WebSelectStyles } from './styles';
|
|
5
|
+
export declare type SelectRenderFNProps<T> = CustomSelectProps<T>['options'][number] & {
|
|
6
|
+
styles: StylesOf<WebSelectComposition>;
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
inList?: boolean;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type SelectRenderFN<T> = (props: SelectRenderFNProps<T>) => JSX.Element;
|
|
13
|
+
export declare type CustomSelectProps<T = any> = {
|
|
14
|
+
value: T;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
label?: FormTypes.Label;
|
|
17
|
+
options?: {
|
|
18
|
+
value: T;
|
|
19
|
+
label?: FormTypes.Label;
|
|
20
|
+
icon?: IconPlaceholder;
|
|
21
|
+
}[];
|
|
22
|
+
onDropdownToggle?: (isOpen?: boolean) => void;
|
|
23
|
+
onValueChange?: (value: T) => void;
|
|
24
|
+
renderItem?: SelectRenderFN<T>;
|
|
25
|
+
renderCurrentlySelected?: SelectRenderFN<T>;
|
|
26
|
+
styles?: StylesOf<WebSelectComposition>;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
validate?: FormTypes.ValidatorFunctionWithoutForm<any> | string;
|
|
29
|
+
arrowIconName?: IconPlaceholder;
|
|
30
|
+
autoClose?: boolean;
|
|
31
|
+
} & ComponentVariants<typeof WebSelectStyles>;
|
|
32
|
+
export declare type MultiSelectProps<T = any> = {
|
|
33
|
+
value: T[];
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
label?: FormTypes.Label;
|
|
36
|
+
options?: {
|
|
37
|
+
value: T;
|
|
38
|
+
label?: FormTypes.Label;
|
|
39
|
+
icon?: IconPlaceholder;
|
|
40
|
+
}[];
|
|
41
|
+
onDropdownToggle?: (isOpen?: boolean) => void;
|
|
42
|
+
onValueChange?: (value: T[]) => void;
|
|
43
|
+
renderItem?: SelectRenderFN<T>;
|
|
44
|
+
renderCurrentlySelected?: SelectRenderFN<T>;
|
|
45
|
+
styles?: StylesOf<WebSelectComposition>;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
validate?: FormTypes.ValidatorFunctionWithoutForm<any> | string;
|
|
48
|
+
arrowIconName?: IconPlaceholder;
|
|
49
|
+
} & ComponentVariants<typeof WebSelectStyles>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SliderProps as RCSliderProps } from 'rc-slider';
|
|
3
|
-
declare type SliderProps = RCSliderProps & {};
|
|
4
|
-
export declare const Slider: React.FC<SliderProps>;
|
|
5
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SliderProps as RCSliderProps } from 'rc-slider';
|
|
3
|
+
declare type SliderProps = RCSliderProps & {};
|
|
4
|
+
export declare const Slider: React.FC<SliderProps>;
|
|
5
|
+
export {};
|
|
@@ -1,36 +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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.Slider = void 0;
|
|
29
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
-
var rc_slider_1 = __importDefault(require("rc-slider"));
|
|
31
|
-
var Slider = function (sliderProps) {
|
|
32
|
-
var props = __rest(sliderProps, []);
|
|
33
|
-
return (0, jsx_runtime_1.jsx)(rc_slider_1.default, __assign({}, props));
|
|
34
|
-
};
|
|
35
|
-
exports.Slider = Slider;
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Slider = void 0;
|
|
29
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
+
var rc_slider_1 = __importDefault(require("rc-slider"));
|
|
31
|
+
var Slider = function (sliderProps) {
|
|
32
|
+
var props = __rest(sliderProps, []);
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(rc_slider_1.default, __assign({}, props));
|
|
34
|
+
};
|
|
35
|
+
exports.Slider = Slider;
|
|
36
36
|
//# sourceMappingURL=Slider.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ComponentVariants, TextComposition, TextStyles } from '@codeleap/common';
|
|
2
|
-
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
3
|
-
import { StylesOf } from '../types/utility';
|
|
4
|
-
export declare type TextProps<T extends ElementType> = {
|
|
5
|
-
component?: T;
|
|
6
|
-
text?: string;
|
|
7
|
-
styles?: StylesOf<TextComposition>;
|
|
8
|
-
} & ComponentPropsWithoutRef<T> & ComponentVariants<typeof TextStyles>;
|
|
9
|
-
export declare const Text: <T extends ElementType<any>>(textProps: TextProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { ComponentVariants, TextComposition, TextStyles } from '@codeleap/common';
|
|
2
|
+
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
3
|
+
import { StylesOf } from '../types/utility';
|
|
4
|
+
export declare type TextProps<T extends ElementType> = {
|
|
5
|
+
component?: T;
|
|
6
|
+
text?: string;
|
|
7
|
+
styles?: StylesOf<TextComposition>;
|
|
8
|
+
} & ComponentPropsWithoutRef<T> & ComponentVariants<typeof TextStyles>;
|
|
9
|
+
export declare const Text: <T extends ElementType<any>>(textProps: TextProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/dist/components/Text.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.Text = void 0;
|
|
26
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
-
var common_1 = require("@codeleap/common");
|
|
28
|
-
var Text = function (textProps) {
|
|
29
|
-
var _a = textProps.variants, variants = _a === void 0 ? [] : _a, _b = textProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, text = textProps.text, children = textProps.children, _c = textProps.component, component = _c === void 0 ? 'p' : _c, styles = textProps.styles, props = __rest(textProps, ["variants", "responsiveVariants", "text", "children", "component", "styles"]);
|
|
30
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('Text', {
|
|
31
|
-
rootElement: 'text',
|
|
32
|
-
responsiveVariants: responsiveVariants,
|
|
33
|
-
variants: variants,
|
|
34
|
-
styles: styles,
|
|
35
|
-
});
|
|
36
|
-
var Component = component;
|
|
37
|
-
var a = __assign(__assign({}, variantStyles.text), props.style);
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(Component, __assign({ css: a }, props, { children: text || children })));
|
|
39
|
-
};
|
|
40
|
-
exports.Text = Text;
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Text = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
+
var common_1 = require("@codeleap/common");
|
|
28
|
+
var Text = function (textProps) {
|
|
29
|
+
var _a = textProps.variants, variants = _a === void 0 ? [] : _a, _b = textProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, text = textProps.text, children = textProps.children, _c = textProps.component, component = _c === void 0 ? 'p' : _c, styles = textProps.styles, props = __rest(textProps, ["variants", "responsiveVariants", "text", "children", "component", "styles"]);
|
|
30
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Text', {
|
|
31
|
+
rootElement: 'text',
|
|
32
|
+
responsiveVariants: responsiveVariants,
|
|
33
|
+
variants: variants,
|
|
34
|
+
styles: styles,
|
|
35
|
+
});
|
|
36
|
+
var Component = component;
|
|
37
|
+
var a = __assign(__assign({}, variantStyles.text), props.style);
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Component, __assign({ css: a }, props, { children: text || children })));
|
|
39
|
+
};
|
|
40
|
+
exports.Text = Text;
|
|
41
41
|
//# sourceMappingURL=Text.js.map
|