@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,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Checkbox = void 0;
|
|
40
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
41
|
-
var common_1 = require("@codeleap/common");
|
|
42
|
-
var View_1 = require("../View");
|
|
43
|
-
var Text_1 = require("../Text");
|
|
44
|
-
__exportStar(require("./styles"), exports);
|
|
45
|
-
var Checkbox = function (checkboxProps) {
|
|
46
|
-
var checked = checkboxProps.checked, onValueChange = checkboxProps.onValueChange, _a = checkboxProps.variants, variants = _a === void 0 ? [] : _a, _b = checkboxProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, label = checkboxProps.label, onChange = checkboxProps.onChange, styles = checkboxProps.styles, props = __rest(checkboxProps, ["checked", "onValueChange", "variants", "responsiveVariants", "label", "onChange", "styles"]);
|
|
47
|
-
function handleChange(e, value) {
|
|
48
|
-
var isChecked = common_1.TypeGuards.isBoolean(value) ? value : e.target.checked;
|
|
49
|
-
if (e) {
|
|
50
|
-
onChange && onChange(e);
|
|
51
|
-
}
|
|
52
|
-
onValueChange && onValueChange(isChecked);
|
|
53
|
-
}
|
|
54
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('Checkbox', {
|
|
55
|
-
responsiveVariants: responsiveVariants,
|
|
56
|
-
variants: variants,
|
|
57
|
-
styles: styles,
|
|
58
|
-
});
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ component: 'label', css: __assign({}, variantStyles.wrapper) }, { children: [(0, jsx_runtime_1.jsx)("input", __assign({}, props, { css: variantStyles.input, onChange: handleChange, type: 'checkbox', checked: checked })), (0, jsx_runtime_1.jsx)("span", { className: 'checkbox-label', onClick: function () { return handleChange(null, !checked); }, css: __assign(__assign({}, variantStyles.checkmarkWrapper), { '&:after': __assign({}, variantStyles.checkmark) }) }), typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: label, styles: { text: variantStyles.label } })) : (label)] })));
|
|
60
|
-
};
|
|
61
|
-
exports.Checkbox = Checkbox;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
+
t[p] = s[p];
|
|
31
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
+
t[p[i]] = s[p[i]];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Checkbox = void 0;
|
|
40
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
41
|
+
var common_1 = require("@codeleap/common");
|
|
42
|
+
var View_1 = require("../View");
|
|
43
|
+
var Text_1 = require("../Text");
|
|
44
|
+
__exportStar(require("./styles"), exports);
|
|
45
|
+
var Checkbox = function (checkboxProps) {
|
|
46
|
+
var checked = checkboxProps.checked, onValueChange = checkboxProps.onValueChange, _a = checkboxProps.variants, variants = _a === void 0 ? [] : _a, _b = checkboxProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, label = checkboxProps.label, onChange = checkboxProps.onChange, styles = checkboxProps.styles, props = __rest(checkboxProps, ["checked", "onValueChange", "variants", "responsiveVariants", "label", "onChange", "styles"]);
|
|
47
|
+
function handleChange(e, value) {
|
|
48
|
+
var isChecked = common_1.TypeGuards.isBoolean(value) ? value : e.target.checked;
|
|
49
|
+
if (e) {
|
|
50
|
+
onChange && onChange(e);
|
|
51
|
+
}
|
|
52
|
+
onValueChange && onValueChange(isChecked);
|
|
53
|
+
}
|
|
54
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Checkbox', {
|
|
55
|
+
responsiveVariants: responsiveVariants,
|
|
56
|
+
variants: variants,
|
|
57
|
+
styles: styles,
|
|
58
|
+
});
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ component: 'label', css: __assign({}, variantStyles.wrapper) }, { children: [(0, jsx_runtime_1.jsx)("input", __assign({}, props, { css: variantStyles.input, onChange: handleChange, type: 'checkbox', checked: checked })), (0, jsx_runtime_1.jsx)("span", { className: 'checkbox-label', onClick: function () { return handleChange(null, !checked); }, css: __assign(__assign({}, variantStyles.checkmarkWrapper), { '&:after': __assign({}, variantStyles.checkmark) }) }), typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: label, styles: { text: variantStyles.label } })) : (label)] })));
|
|
60
|
+
};
|
|
61
|
+
exports.Checkbox = Checkbox;
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
export declare type WebCheckboxComposition = 'wrapper' | 'label' | 'input' | 'checkmark' | 'checkmarkWrapper';
|
|
2
|
-
export declare const WebCheckboxStyles: {
|
|
3
|
-
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
4
|
-
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
5
|
-
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
6
|
-
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
7
|
-
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
8
|
-
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
9
|
-
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
10
|
-
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
11
|
-
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
12
|
-
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
13
|
-
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
14
|
-
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
15
|
-
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
16
|
-
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
17
|
-
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
18
|
-
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
19
|
-
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
20
|
-
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
21
|
-
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
22
|
-
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
23
|
-
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
24
|
-
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
25
|
-
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
26
|
-
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
27
|
-
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
28
|
-
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
29
|
-
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
30
|
-
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
31
|
-
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
32
|
-
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
33
|
-
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
34
|
-
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
35
|
-
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
36
|
-
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
37
|
-
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
38
|
-
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
39
|
-
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
40
|
-
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
41
|
-
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
42
|
-
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
43
|
-
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
44
|
-
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
45
|
-
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
46
|
-
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
47
|
-
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
48
|
-
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
49
|
-
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
50
|
-
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
51
|
-
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
52
|
-
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
53
|
-
};
|
|
1
|
+
export declare type WebCheckboxComposition = 'wrapper' | 'label' | 'input' | 'checkmark' | 'checkmarkWrapper';
|
|
2
|
+
export declare const WebCheckboxStyles: {
|
|
3
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
4
|
+
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
5
|
+
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
6
|
+
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
7
|
+
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
8
|
+
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
9
|
+
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
10
|
+
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
11
|
+
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
12
|
+
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
13
|
+
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
14
|
+
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
15
|
+
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
16
|
+
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
17
|
+
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
18
|
+
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
19
|
+
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
20
|
+
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
21
|
+
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
22
|
+
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
23
|
+
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
24
|
+
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
25
|
+
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
26
|
+
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
27
|
+
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
28
|
+
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
29
|
+
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
30
|
+
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
31
|
+
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
32
|
+
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
33
|
+
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
34
|
+
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
35
|
+
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
36
|
+
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
37
|
+
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
38
|
+
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
39
|
+
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
40
|
+
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
41
|
+
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
42
|
+
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
43
|
+
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
44
|
+
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
45
|
+
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
46
|
+
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
47
|
+
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
48
|
+
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
49
|
+
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
50
|
+
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
51
|
+
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
52
|
+
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebCheckboxComposition, any>>;
|
|
53
|
+
};
|
|
@@ -1,64 +1,64 @@
|
|
|
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.WebCheckboxStyles = void 0;
|
|
15
|
-
var common_1 = require("@codeleap/common");
|
|
16
|
-
var createCheckboxStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
-
var presets = (0, common_1.includePresets)(function (styles) { return createCheckboxStyle(function () { return ({ wrapper: styles }); }); });
|
|
18
|
-
exports.WebCheckboxStyles = __assign(__assign({}, presets), { default: createCheckboxStyle(function (theme) { return ({
|
|
19
|
-
wrapper: {
|
|
20
|
-
display: 'flex',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
position: 'relative',
|
|
23
|
-
cursor: 'pointer',
|
|
24
|
-
minHeight: '18px',
|
|
25
|
-
minWidth: '18px',
|
|
26
|
-
'.checkbox-label': {
|
|
27
|
-
height: '18px',
|
|
28
|
-
width: '18px',
|
|
29
|
-
border: "1px solid ".concat(theme.colors.gray),
|
|
30
|
-
borderRadius: theme.borderRadius.small,
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
overflow: 'hidden',
|
|
33
|
-
top: '50%',
|
|
34
|
-
transform: 'translateY(-50%)',
|
|
35
|
-
transition: 'background 0.3s ease',
|
|
36
|
-
':after': {
|
|
37
|
-
content: '""',
|
|
38
|
-
border: "2px solid ".concat(theme.colors.white),
|
|
39
|
-
borderLeftColor: 'transparent',
|
|
40
|
-
borderTopColor: 'transparent',
|
|
41
|
-
height: '40%',
|
|
42
|
-
width: '20%',
|
|
43
|
-
position: 'absolute',
|
|
44
|
-
left: '50%',
|
|
45
|
-
top: '40%',
|
|
46
|
-
transform: 'translate(-50%,-50%) rotate(45deg) scale(0)',
|
|
47
|
-
transition: 'transform 0.2s ease',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
label: __assign({}, theme.spacing.marginLeft(1)),
|
|
52
|
-
input: {
|
|
53
|
-
visibility: 'hidden',
|
|
54
|
-
height: 0,
|
|
55
|
-
width: 0,
|
|
56
|
-
'&:checked + .checkbox-label': {
|
|
57
|
-
'&:after': {
|
|
58
|
-
transform: 'translate(-50%,-50%) rotate(45deg) scale(1)',
|
|
59
|
-
},
|
|
60
|
-
background: theme.colors.primary,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}); }) });
|
|
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.WebCheckboxStyles = void 0;
|
|
15
|
+
var common_1 = require("@codeleap/common");
|
|
16
|
+
var createCheckboxStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
+
var presets = (0, common_1.includePresets)(function (styles) { return createCheckboxStyle(function () { return ({ wrapper: styles }); }); });
|
|
18
|
+
exports.WebCheckboxStyles = __assign(__assign({}, presets), { default: createCheckboxStyle(function (theme) { return ({
|
|
19
|
+
wrapper: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
position: 'relative',
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
minHeight: '18px',
|
|
25
|
+
minWidth: '18px',
|
|
26
|
+
'.checkbox-label': {
|
|
27
|
+
height: '18px',
|
|
28
|
+
width: '18px',
|
|
29
|
+
border: "1px solid ".concat(theme.colors.gray),
|
|
30
|
+
borderRadius: theme.borderRadius.small,
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
top: '50%',
|
|
34
|
+
transform: 'translateY(-50%)',
|
|
35
|
+
transition: 'background 0.3s ease',
|
|
36
|
+
':after': {
|
|
37
|
+
content: '""',
|
|
38
|
+
border: "2px solid ".concat(theme.colors.white),
|
|
39
|
+
borderLeftColor: 'transparent',
|
|
40
|
+
borderTopColor: 'transparent',
|
|
41
|
+
height: '40%',
|
|
42
|
+
width: '20%',
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
left: '50%',
|
|
45
|
+
top: '40%',
|
|
46
|
+
transform: 'translate(-50%,-50%) rotate(45deg) scale(0)',
|
|
47
|
+
transition: 'transform 0.2s ease',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
label: __assign({}, theme.spacing.marginLeft(1)),
|
|
52
|
+
input: {
|
|
53
|
+
visibility: 'hidden',
|
|
54
|
+
height: 0,
|
|
55
|
+
width: 0,
|
|
56
|
+
'&:checked + .checkbox-label': {
|
|
57
|
+
'&:after': {
|
|
58
|
+
transform: 'translate(-50%,-50%) rotate(45deg) scale(1)',
|
|
59
|
+
},
|
|
60
|
+
background: theme.colors.primary,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
}); }) });
|
|
64
64
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ViewProps } from './View';
|
|
2
|
-
import { ElementType } from 'react';
|
|
3
|
-
export declare type CollapseAxis = 'horizontal' | 'vertical';
|
|
4
|
-
export declare type GetCollapseStylesArgs = {
|
|
5
|
-
direction?: CollapseAxis;
|
|
6
|
-
value: string | number;
|
|
7
|
-
animation?: string;
|
|
8
|
-
scroll?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare type CollapseComposition = 'wrapper' | 'wrapper:open' | 'wrapper:hidden';
|
|
11
|
-
export declare function getCollapseStyles<TCSS = React.CSSProperties, Return extends Record<CollapseComposition, TCSS> = Record<CollapseComposition, TCSS>>(args: GetCollapseStylesArgs): Return;
|
|
12
|
-
export declare type CollapseProps<T extends ElementType = 'div'> = ViewProps<T> & {
|
|
13
|
-
open: boolean;
|
|
14
|
-
scroll?: boolean;
|
|
15
|
-
size?: string | number;
|
|
16
|
-
direction?: CollapseAxis;
|
|
17
|
-
animation?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const Collapse: React.FC<CollapseProps>;
|
|
20
|
-
export {};
|
|
1
|
+
import { ViewProps } from './View';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
export declare type CollapseAxis = 'horizontal' | 'vertical';
|
|
4
|
+
export declare type GetCollapseStylesArgs = {
|
|
5
|
+
direction?: CollapseAxis;
|
|
6
|
+
value: string | number;
|
|
7
|
+
animation?: string;
|
|
8
|
+
scroll?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare type CollapseComposition = 'wrapper' | 'wrapper:open' | 'wrapper:hidden';
|
|
11
|
+
export declare function getCollapseStyles<TCSS = React.CSSProperties, Return extends Record<CollapseComposition, TCSS> = Record<CollapseComposition, TCSS>>(args: GetCollapseStylesArgs): Return;
|
|
12
|
+
export declare type CollapseProps<T extends ElementType = 'div'> = ViewProps<T> & {
|
|
13
|
+
open: boolean;
|
|
14
|
+
scroll?: boolean;
|
|
15
|
+
size?: string | number;
|
|
16
|
+
direction?: CollapseAxis;
|
|
17
|
+
animation?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const Collapse: React.FC<CollapseProps>;
|
|
20
|
+
export {};
|
|
@@ -1,68 +1,68 @@
|
|
|
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.Collapse = exports.getCollapseStyles = void 0;
|
|
26
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
-
var common_1 = require("@codeleap/common");
|
|
28
|
-
var Scroll_1 = require("./Scroll");
|
|
29
|
-
var View_1 = require("./View");
|
|
30
|
-
function getCollapseStyles(args) {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
var _c = args.direction, direction = _c === void 0 ? 'vertical' : _c, value = args.value, _d = args.animation, animation = _d === void 0 ? '0.3s ease' : _d, _e = args.scroll, scroll = _e === void 0 ? false : _e;
|
|
33
|
-
var dimension = direction === 'horizontal' ? 'width' : 'height';
|
|
34
|
-
var capitalizedDimension = (0, common_1.capitalize)(dimension);
|
|
35
|
-
var overflowOpen = scroll ? 'auto' : 'hidden';
|
|
36
|
-
var axis = direction === 'vertical' ? 'Y' : 'X';
|
|
37
|
-
return {
|
|
38
|
-
'wrapper:closed': (_a = {},
|
|
39
|
-
_a["max".concat(capitalizedDimension)] = '0px',
|
|
40
|
-
_a["overflow".concat(axis)] = 'hidden',
|
|
41
|
-
_a),
|
|
42
|
-
'wrapper:open': (_b = {},
|
|
43
|
-
_b["max".concat(capitalizedDimension)] = common_1.TypeGuards.isString(value) ? value : "".concat(value, "px"),
|
|
44
|
-
_b["overflow".concat(axis)] = overflowOpen,
|
|
45
|
-
_b),
|
|
46
|
-
wrapper: {
|
|
47
|
-
height: 'auto',
|
|
48
|
-
transition: "max-".concat(dimension, " ").concat(animation),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
exports.getCollapseStyles = getCollapseStyles;
|
|
53
|
-
var Collapse = function (_a) {
|
|
54
|
-
var open = _a.open, _b = _a.size, size = _b === void 0 ? 1000 : _b, _c = _a.scroll, scroll = _c === void 0 ? false : _c, children = _a.children, direction = _a.direction, animation = _a.animation, props = __rest(_a, ["open", "size", "scroll", "children", "direction", "animation"]);
|
|
55
|
-
var Component = scroll ? Scroll_1.Scroll : View_1.View;
|
|
56
|
-
var styles = getCollapseStyles({
|
|
57
|
-
value: size,
|
|
58
|
-
direction: direction,
|
|
59
|
-
animation: animation,
|
|
60
|
-
});
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
return (0, jsx_runtime_1.jsx)(Component, __assign({ css: [
|
|
63
|
-
styles.wrapper,
|
|
64
|
-
open ? styles['wrapper:open'] : styles['wrapper:closed'],
|
|
65
|
-
] }, props, { children: children }));
|
|
66
|
-
};
|
|
67
|
-
exports.Collapse = Collapse;
|
|
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.Collapse = exports.getCollapseStyles = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
+
var common_1 = require("@codeleap/common");
|
|
28
|
+
var Scroll_1 = require("./Scroll");
|
|
29
|
+
var View_1 = require("./View");
|
|
30
|
+
function getCollapseStyles(args) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
var _c = args.direction, direction = _c === void 0 ? 'vertical' : _c, value = args.value, _d = args.animation, animation = _d === void 0 ? '0.3s ease' : _d, _e = args.scroll, scroll = _e === void 0 ? false : _e;
|
|
33
|
+
var dimension = direction === 'horizontal' ? 'width' : 'height';
|
|
34
|
+
var capitalizedDimension = (0, common_1.capitalize)(dimension);
|
|
35
|
+
var overflowOpen = scroll ? 'auto' : 'hidden';
|
|
36
|
+
var axis = direction === 'vertical' ? 'Y' : 'X';
|
|
37
|
+
return {
|
|
38
|
+
'wrapper:closed': (_a = {},
|
|
39
|
+
_a["max".concat(capitalizedDimension)] = '0px',
|
|
40
|
+
_a["overflow".concat(axis)] = 'hidden',
|
|
41
|
+
_a),
|
|
42
|
+
'wrapper:open': (_b = {},
|
|
43
|
+
_b["max".concat(capitalizedDimension)] = common_1.TypeGuards.isString(value) ? value : "".concat(value, "px"),
|
|
44
|
+
_b["overflow".concat(axis)] = overflowOpen,
|
|
45
|
+
_b),
|
|
46
|
+
wrapper: {
|
|
47
|
+
height: 'auto',
|
|
48
|
+
transition: "max-".concat(dimension, " ").concat(animation),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.getCollapseStyles = getCollapseStyles;
|
|
53
|
+
var Collapse = function (_a) {
|
|
54
|
+
var open = _a.open, _b = _a.size, size = _b === void 0 ? 1000 : _b, _c = _a.scroll, scroll = _c === void 0 ? false : _c, children = _a.children, direction = _a.direction, animation = _a.animation, props = __rest(_a, ["open", "size", "scroll", "children", "direction", "animation"]);
|
|
55
|
+
var Component = scroll ? Scroll_1.Scroll : View_1.View;
|
|
56
|
+
var styles = getCollapseStyles({
|
|
57
|
+
value: size,
|
|
58
|
+
direction: direction,
|
|
59
|
+
animation: animation,
|
|
60
|
+
});
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
return (0, jsx_runtime_1.jsx)(Component, __assign({ css: [
|
|
63
|
+
styles.wrapper,
|
|
64
|
+
open ? styles['wrapper:open'] : styles['wrapper:closed'],
|
|
65
|
+
] }, props, { children: children }));
|
|
66
|
+
};
|
|
67
|
+
exports.Collapse = Collapse;
|
|
68
68
|
//# sourceMappingURL=Collapse.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentVariants, ContentViewStyles, ViewComposition } from '@codeleap/common';
|
|
3
|
-
import { ViewProps } from './View';
|
|
4
|
-
import { StylesOf } from '../types/utility';
|
|
5
|
-
export declare type ContentViewProps = Omit<ViewProps<'div'>, 'variants' | 'responsiveVariants'> & {
|
|
6
|
-
placeholderMsg: string;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
styles?: StylesOf<ViewComposition>;
|
|
9
|
-
} & ComponentVariants<typeof ContentViewStyles>;
|
|
10
|
-
export declare const ContentView: React.FC<ContentViewProps>;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentVariants, ContentViewStyles, ViewComposition } from '@codeleap/common';
|
|
3
|
+
import { ViewProps } from './View';
|
|
4
|
+
import { StylesOf } from '../types/utility';
|
|
5
|
+
export declare type ContentViewProps = Omit<ViewProps<'div'>, 'variants' | 'responsiveVariants'> & {
|
|
6
|
+
placeholderMsg: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
styles?: StylesOf<ViewComposition>;
|
|
9
|
+
} & ComponentVariants<typeof ContentViewStyles>;
|
|
10
|
+
export declare const ContentView: React.FC<ContentViewProps>;
|