@codeleap/web 2.0.1 → 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/Multi.d.ts +3 -3
- package/dist/components/Select/Multi.js +104 -104
- 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 -12
- package/dist/components/Select/index.js +43 -43
- 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 -49
- 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 -121
- 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 -28
- package/dist/lib/hooks.js +182 -182
- 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,55 +1,55 @@
|
|
|
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.RadioGroup = exports.RadioButton = exports.WebRadioInputStyles = void 0;
|
|
26
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
-
var react_1 = require("react");
|
|
28
|
-
var uuid_1 = require("uuid");
|
|
29
|
-
var Text_1 = require("../Text");
|
|
30
|
-
var Touchable_1 = require("../Touchable");
|
|
31
|
-
var common_1 = require("@codeleap/common");
|
|
32
|
-
var View_1 = require("../View");
|
|
33
|
-
var styles_1 = require("./styles");
|
|
34
|
-
Object.defineProperty(exports, "WebRadioInputStyles", { enumerable: true, get: function () { return styles_1.WebRadioInputStyles; } });
|
|
35
|
-
var getRadioStyle = function (props) { return (0, common_1.useDefaultComponentStyle)('RadioInput', props); };
|
|
36
|
-
var RadioButton = function (_a) {
|
|
37
|
-
var item = _a.item, select = _a.select, style = _a.style, checked = _a.checked, props = __rest(_a, ["item", "select", "style", "checked"]);
|
|
38
|
-
var styleByState = checked
|
|
39
|
-
? style['button:checked']
|
|
40
|
-
: style['button:unchecked'];
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, __assign({ onPress: select, css: style.itemWrapper }, { children: [(0, jsx_runtime_1.jsx)(View_1.View, { css: __assign(__assign(__assign({}, style.button), styleByState), { '&:after': __assign(__assign({}, style['button:mark']), styleByState === null || styleByState === void 0 ? void 0 : styleByState['&:after']) }) }), typeof item.label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: item.label, css: style.itemText })) : (item.label)] })));
|
|
42
|
-
};
|
|
43
|
-
exports.RadioButton = RadioButton;
|
|
44
|
-
var RadioGroup = function (radioGroupProps) {
|
|
45
|
-
var options = radioGroupProps.options, value = radioGroupProps.value, onValueChange = radioGroupProps.onValueChange, label = radioGroupProps.label, responsiveVariants = radioGroupProps.responsiveVariants, variants = radioGroupProps.variants, styles = radioGroupProps.styles;
|
|
46
|
-
var radioName = (0, react_1.useRef)((0, uuid_1.v4)()).current;
|
|
47
|
-
var radioStyle = getRadioStyle({
|
|
48
|
-
responsiveVariants: responsiveVariants,
|
|
49
|
-
variants: variants,
|
|
50
|
-
styles: styles,
|
|
51
|
-
});
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: radioStyle.wrapper }, { children: [typeof label === 'string' ? (0, jsx_runtime_1.jsx)(Text_1.Text, { text: label }) : label, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: radioStyle.listWrapper }, { children: options === null || options === void 0 ? void 0 : options.map(function (item, idx) { return ((0, jsx_runtime_1.jsx)(exports.RadioButton, { item: item, style: radioStyle, name: radioName, checked: value === item.value, select: function () { return onValueChange(item.value); } }, idx)); }) }))] })));
|
|
53
|
-
};
|
|
54
|
-
exports.RadioGroup = RadioGroup;
|
|
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.RadioGroup = exports.RadioButton = exports.WebRadioInputStyles = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var uuid_1 = require("uuid");
|
|
29
|
+
var Text_1 = require("../Text");
|
|
30
|
+
var Touchable_1 = require("../Touchable");
|
|
31
|
+
var common_1 = require("@codeleap/common");
|
|
32
|
+
var View_1 = require("../View");
|
|
33
|
+
var styles_1 = require("./styles");
|
|
34
|
+
Object.defineProperty(exports, "WebRadioInputStyles", { enumerable: true, get: function () { return styles_1.WebRadioInputStyles; } });
|
|
35
|
+
var getRadioStyle = function (props) { return (0, common_1.useDefaultComponentStyle)('RadioInput', props); };
|
|
36
|
+
var RadioButton = function (_a) {
|
|
37
|
+
var item = _a.item, select = _a.select, style = _a.style, checked = _a.checked, props = __rest(_a, ["item", "select", "style", "checked"]);
|
|
38
|
+
var styleByState = checked
|
|
39
|
+
? style['button:checked']
|
|
40
|
+
: style['button:unchecked'];
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, __assign({ onPress: select, css: style.itemWrapper }, { children: [(0, jsx_runtime_1.jsx)(View_1.View, { css: __assign(__assign(__assign({}, style.button), styleByState), { '&:after': __assign(__assign({}, style['button:mark']), styleByState === null || styleByState === void 0 ? void 0 : styleByState['&:after']) }) }), typeof item.label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: item.label, css: style.itemText })) : (item.label)] })));
|
|
42
|
+
};
|
|
43
|
+
exports.RadioButton = RadioButton;
|
|
44
|
+
var RadioGroup = function (radioGroupProps) {
|
|
45
|
+
var options = radioGroupProps.options, value = radioGroupProps.value, onValueChange = radioGroupProps.onValueChange, label = radioGroupProps.label, responsiveVariants = radioGroupProps.responsiveVariants, variants = radioGroupProps.variants, styles = radioGroupProps.styles;
|
|
46
|
+
var radioName = (0, react_1.useRef)((0, uuid_1.v4)()).current;
|
|
47
|
+
var radioStyle = getRadioStyle({
|
|
48
|
+
responsiveVariants: responsiveVariants,
|
|
49
|
+
variants: variants,
|
|
50
|
+
styles: styles,
|
|
51
|
+
});
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: radioStyle.wrapper }, { children: [typeof label === 'string' ? (0, jsx_runtime_1.jsx)(Text_1.Text, { text: label }) : label, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: radioStyle.listWrapper }, { children: options === null || options === void 0 ? void 0 : options.map(function (item, idx) { return ((0, jsx_runtime_1.jsx)(exports.RadioButton, { item: item, style: radioStyle, name: radioName, checked: value === item.value, select: function () { return onValueChange(item.value); } }, idx)); }) }))] })));
|
|
53
|
+
};
|
|
54
|
+
exports.RadioGroup = RadioGroup;
|
|
55
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { RadioInputComposition } from '@codeleap/common';
|
|
2
|
-
export declare const WebRadioInputStyles: {
|
|
3
|
-
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
4
|
-
square: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
5
|
-
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
6
|
-
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
7
|
-
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
8
|
-
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
9
|
-
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
10
|
-
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
11
|
-
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
12
|
-
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
13
|
-
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
14
|
-
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
15
|
-
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
16
|
-
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
17
|
-
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
18
|
-
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
19
|
-
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
20
|
-
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
21
|
-
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
22
|
-
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
23
|
-
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
24
|
-
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
25
|
-
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
26
|
-
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
27
|
-
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
28
|
-
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
29
|
-
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
30
|
-
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
31
|
-
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
32
|
-
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
33
|
-
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
34
|
-
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
35
|
-
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
36
|
-
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
37
|
-
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
38
|
-
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
39
|
-
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
40
|
-
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
41
|
-
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
42
|
-
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
43
|
-
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
44
|
-
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
45
|
-
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
46
|
-
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
47
|
-
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
48
|
-
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
49
|
-
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
50
|
-
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
51
|
-
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
52
|
-
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
53
|
-
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
54
|
-
};
|
|
1
|
+
import { RadioInputComposition } from '@codeleap/common';
|
|
2
|
+
export declare const WebRadioInputStyles: {
|
|
3
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
4
|
+
square: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
5
|
+
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
6
|
+
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
7
|
+
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
8
|
+
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
9
|
+
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
10
|
+
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
11
|
+
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
12
|
+
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
13
|
+
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
14
|
+
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
15
|
+
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
16
|
+
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
17
|
+
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
18
|
+
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
19
|
+
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
20
|
+
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
21
|
+
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
22
|
+
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
23
|
+
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
24
|
+
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
25
|
+
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
26
|
+
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
27
|
+
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
28
|
+
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
29
|
+
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
30
|
+
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
31
|
+
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
32
|
+
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
33
|
+
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
34
|
+
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
35
|
+
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
36
|
+
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
37
|
+
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
38
|
+
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
39
|
+
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
40
|
+
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
41
|
+
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
42
|
+
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
43
|
+
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
44
|
+
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
45
|
+
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
46
|
+
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
47
|
+
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
48
|
+
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
49
|
+
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
50
|
+
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
51
|
+
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
52
|
+
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
53
|
+
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RadioInputComposition, any>>;
|
|
54
|
+
};
|
|
@@ -1,44 +1,44 @@
|
|
|
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.WebRadioInputStyles = void 0;
|
|
15
|
-
var common_1 = require("@codeleap/common");
|
|
16
|
-
var createRadioStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
-
var defaultStyles = common_1.RadioInputStyles.default;
|
|
18
|
-
exports.WebRadioInputStyles = __assign(__assign({}, common_1.RadioInputStyles), { default: createRadioStyle(function (theme) {
|
|
19
|
-
var style = defaultStyles(theme);
|
|
20
|
-
return __assign(__assign({}, style), { itemWrapper: __assign(__assign({}, style.itemWrapper), { cursor: 'pointer' }), button: __assign({ height: '1em', width: '1em', borderRadius: theme.borderRadius.large, border: theme.border.primary(1), position: 'relative' }, theme.spacing.marginRight(1)), 'button:mark': {
|
|
21
|
-
background: theme.colors.primary,
|
|
22
|
-
content: '""',
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
left: '50%',
|
|
25
|
-
top: '50%',
|
|
26
|
-
transform: 'translate(-50%,-50%)',
|
|
27
|
-
borderRadius: theme.borderRadius.large,
|
|
28
|
-
height: '50%',
|
|
29
|
-
width: '50%',
|
|
30
|
-
visibility: 'hidden',
|
|
31
|
-
}, 'button:checked': {
|
|
32
|
-
'&:after': {
|
|
33
|
-
visibility: 'visible',
|
|
34
|
-
},
|
|
35
|
-
} });
|
|
36
|
-
}), square: createRadioStyle(function () { return ({
|
|
37
|
-
'button:mark': {
|
|
38
|
-
borderRadius: '1px',
|
|
39
|
-
},
|
|
40
|
-
button: {
|
|
41
|
-
borderRadius: '1px',
|
|
42
|
-
},
|
|
43
|
-
}); }) });
|
|
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.WebRadioInputStyles = void 0;
|
|
15
|
+
var common_1 = require("@codeleap/common");
|
|
16
|
+
var createRadioStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
+
var defaultStyles = common_1.RadioInputStyles.default;
|
|
18
|
+
exports.WebRadioInputStyles = __assign(__assign({}, common_1.RadioInputStyles), { default: createRadioStyle(function (theme) {
|
|
19
|
+
var style = defaultStyles(theme);
|
|
20
|
+
return __assign(__assign({}, style), { itemWrapper: __assign(__assign({}, style.itemWrapper), { cursor: 'pointer' }), button: __assign({ height: '1em', width: '1em', borderRadius: theme.borderRadius.large, border: theme.border.primary(1), position: 'relative' }, theme.spacing.marginRight(1)), 'button:mark': {
|
|
21
|
+
background: theme.colors.primary,
|
|
22
|
+
content: '""',
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
left: '50%',
|
|
25
|
+
top: '50%',
|
|
26
|
+
transform: 'translate(-50%,-50%)',
|
|
27
|
+
borderRadius: theme.borderRadius.large,
|
|
28
|
+
height: '50%',
|
|
29
|
+
width: '50%',
|
|
30
|
+
visibility: 'hidden',
|
|
31
|
+
}, 'button:checked': {
|
|
32
|
+
'&:after': {
|
|
33
|
+
visibility: 'visible',
|
|
34
|
+
},
|
|
35
|
+
} });
|
|
36
|
+
}), square: createRadioStyle(function () { return ({
|
|
37
|
+
'button:mark': {
|
|
38
|
+
borderRadius: '1px',
|
|
39
|
+
},
|
|
40
|
+
button: {
|
|
41
|
+
borderRadius: '1px',
|
|
42
|
+
},
|
|
43
|
+
}); }) });
|
|
44
44
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MenuItemProps } from './MenuItem';
|
|
3
|
-
import { MenuComposition } from '@codeleap/common';
|
|
4
|
-
import { StylesOf } from '../../types/utility';
|
|
5
|
-
declare type RouterMenuProps = {
|
|
6
|
-
items: MenuItemProps['data'][];
|
|
7
|
-
styles?: StylesOf<MenuComposition>;
|
|
8
|
-
};
|
|
9
|
-
export declare const Menu: React.FC<RouterMenuProps>;
|
|
10
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuItemProps } from './MenuItem';
|
|
3
|
+
import { MenuComposition } from '@codeleap/common';
|
|
4
|
+
import { StylesOf } from '../../types/utility';
|
|
5
|
+
declare type RouterMenuProps = {
|
|
6
|
+
items: MenuItemProps['data'][];
|
|
7
|
+
styles?: StylesOf<MenuComposition>;
|
|
8
|
+
};
|
|
9
|
+
export declare const Menu: React.FC<RouterMenuProps>;
|
|
10
|
+
export {};
|
|
@@ -1,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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Menu = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
var View_1 = require("../View");
|
|
17
|
-
var CenterWrapper_1 = require("../CenterWrapper");
|
|
18
|
-
var HorizontalScroll_1 = require("../HorizontalScroll");
|
|
19
|
-
var MenuItem_1 = require("./MenuItem");
|
|
20
|
-
var common_1 = require("@codeleap/common");
|
|
21
|
-
var TabsWrapper = function (_a) {
|
|
22
|
-
var children = _a.children, styles = _a.styles;
|
|
23
|
-
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
24
|
-
var isMobile = Theme.hooks.down('small');
|
|
25
|
-
var wrapperStyle = isMobile ? styles.topMenu : styles.sideMenu;
|
|
26
|
-
if (isMobile) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: (0, jsx_runtime_1.jsx)(CenterWrapper_1.CenterWrapper, { children: (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.mobileMenu }, { children: (0, jsx_runtime_1.jsx)(HorizontalScroll_1.HorizontalScroll, __assign({ css: styles.horizontalScroll }, { children: children })) })) }) })));
|
|
28
|
-
}
|
|
29
|
-
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: children }));
|
|
30
|
-
};
|
|
31
|
-
var Menu = function (_a) {
|
|
32
|
-
var items = _a.items, styles = _a.styles;
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(TabsWrapper, __assign({ styles: styles }, { children: items.map(function (data) { return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { data: data, styles: styles }, data.path)); }) })));
|
|
34
|
-
};
|
|
35
|
-
exports.Menu = Menu;
|
|
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.Menu = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
+
var View_1 = require("../View");
|
|
17
|
+
var CenterWrapper_1 = require("../CenterWrapper");
|
|
18
|
+
var HorizontalScroll_1 = require("../HorizontalScroll");
|
|
19
|
+
var MenuItem_1 = require("./MenuItem");
|
|
20
|
+
var common_1 = require("@codeleap/common");
|
|
21
|
+
var TabsWrapper = function (_a) {
|
|
22
|
+
var children = _a.children, styles = _a.styles;
|
|
23
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
24
|
+
var isMobile = Theme.hooks.down('small');
|
|
25
|
+
var wrapperStyle = isMobile ? styles.topMenu : styles.sideMenu;
|
|
26
|
+
if (isMobile) {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: (0, jsx_runtime_1.jsx)(CenterWrapper_1.CenterWrapper, { children: (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.mobileMenu }, { children: (0, jsx_runtime_1.jsx)(HorizontalScroll_1.HorizontalScroll, __assign({ css: styles.horizontalScroll }, { children: children })) })) }) })));
|
|
28
|
+
}
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: children }));
|
|
30
|
+
};
|
|
31
|
+
var Menu = function (_a) {
|
|
32
|
+
var items = _a.items, styles = _a.styles;
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(TabsWrapper, __assign({ styles: styles }, { children: items.map(function (data) { return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { data: data, styles: styles }, data.path)); }) })));
|
|
34
|
+
};
|
|
35
|
+
exports.Menu = Menu;
|
|
36
36
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconPlaceholder, StylesOf } from '@codeleap/common';
|
|
3
|
-
import { MenuComposition } from './styles';
|
|
4
|
-
export declare type MenuItemProps = {
|
|
5
|
-
data: {
|
|
6
|
-
icon: IconPlaceholder;
|
|
7
|
-
title: string;
|
|
8
|
-
path: string;
|
|
9
|
-
};
|
|
10
|
-
styles: StylesOf<MenuComposition>;
|
|
11
|
-
};
|
|
12
|
-
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconPlaceholder, StylesOf } from '@codeleap/common';
|
|
3
|
+
import { MenuComposition } from './styles';
|
|
4
|
+
export declare type MenuItemProps = {
|
|
5
|
+
data: {
|
|
6
|
+
icon: IconPlaceholder;
|
|
7
|
+
title: string;
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
styles: StylesOf<MenuComposition>;
|
|
11
|
+
};
|
|
12
|
+
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.MenuItem = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
var Text_1 = require("../Text");
|
|
17
|
-
var Icon_1 = require("../Icon");
|
|
18
|
-
var Link_1 = require("../Link");
|
|
19
|
-
var common_1 = require("@codeleap/common");
|
|
20
|
-
var utils_1 = require("../../lib/utils");
|
|
21
|
-
var gatsby_1 = require("gatsby");
|
|
22
|
-
var RouterLink = function (props) { return ((0, jsx_runtime_1.jsx)(Link_1.Link, __assign({ component: gatsby_1.Link }, props))); };
|
|
23
|
-
var MenuItem = function (props) {
|
|
24
|
-
var styles = props.styles;
|
|
25
|
-
var _a = props.data, title = _a.title, path = _a.path, icon = _a.icon;
|
|
26
|
-
var pathname = (0, utils_1.url)().pathname;
|
|
27
|
-
var selected = pathname.includes(path);
|
|
28
|
-
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
29
|
-
var isMobile = Theme.hooks.down('small');
|
|
30
|
-
if (isMobile) {
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path, css: [styles['menuItem:mobile']] }, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
32
|
-
styles['menuItem:text:mobile'],
|
|
33
|
-
selected && styles['menuItem:text:selected'],
|
|
34
|
-
], text: title }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon:mobile']), selected && styles['menuItem:icon:mobile:selected']) })] })));
|
|
35
|
-
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path, css: [styles.menuItem] }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon']), selected && styles['menuItem:icon:selected']) }), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
37
|
-
styles['menuItem:text'],
|
|
38
|
-
selected && styles['menuItem:text:selected'],
|
|
39
|
-
], text: title })] })));
|
|
40
|
-
};
|
|
41
|
-
exports.MenuItem = MenuItem;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.MenuItem = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
+
var Text_1 = require("../Text");
|
|
17
|
+
var Icon_1 = require("../Icon");
|
|
18
|
+
var Link_1 = require("../Link");
|
|
19
|
+
var common_1 = require("@codeleap/common");
|
|
20
|
+
var utils_1 = require("../../lib/utils");
|
|
21
|
+
var gatsby_1 = require("gatsby");
|
|
22
|
+
var RouterLink = function (props) { return ((0, jsx_runtime_1.jsx)(Link_1.Link, __assign({ component: gatsby_1.Link }, props))); };
|
|
23
|
+
var MenuItem = function (props) {
|
|
24
|
+
var styles = props.styles;
|
|
25
|
+
var _a = props.data, title = _a.title, path = _a.path, icon = _a.icon;
|
|
26
|
+
var pathname = (0, utils_1.url)().pathname;
|
|
27
|
+
var selected = pathname.includes(path);
|
|
28
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
29
|
+
var isMobile = Theme.hooks.down('small');
|
|
30
|
+
if (isMobile) {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path, css: [styles['menuItem:mobile']] }, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
32
|
+
styles['menuItem:text:mobile'],
|
|
33
|
+
selected && styles['menuItem:text:selected'],
|
|
34
|
+
], text: title }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon:mobile']), selected && styles['menuItem:icon:mobile:selected']) })] })));
|
|
35
|
+
}
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path, css: [styles.menuItem] }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon']), selected && styles['menuItem:icon:selected']) }), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
37
|
+
styles['menuItem:text'],
|
|
38
|
+
selected && styles['menuItem:text:selected'],
|
|
39
|
+
], text: title })] })));
|
|
40
|
+
};
|
|
41
|
+
exports.MenuItem = MenuItem;
|
|
42
42
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type RouterProps = {
|
|
3
|
-
basePath: string;
|
|
4
|
-
style?: any;
|
|
5
|
-
defaultPath?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const Router: React.FC<RouterProps>;
|
|
8
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type RouterProps = {
|
|
3
|
+
basePath: string;
|
|
4
|
+
style?: any;
|
|
5
|
+
defaultPath?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const Router: React.FC<RouterProps>;
|
|
8
|
+
export {};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Router = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var router_1 = require("@reach/router");
|
|
21
|
-
var Router = function (props) {
|
|
22
|
-
var children = props.children, style = props.style, basePath = props.basePath, defaultPath = props.defaultPath;
|
|
23
|
-
var base = "".concat(basePath);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(router_1.Router, __assign({ basepath: base, style: style }, { children: children })) }));
|
|
25
|
-
};
|
|
26
|
-
exports.Router = Router;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Router = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
+
var react_1 = __importDefault(require("react"));
|
|
20
|
+
var router_1 = require("@reach/router");
|
|
21
|
+
var Router = function (props) {
|
|
22
|
+
var children = props.children, style = props.style, basePath = props.basePath, defaultPath = props.defaultPath;
|
|
23
|
+
var base = "".concat(basePath);
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(router_1.Router, __assign({ basepath: base, style: style }, { children: children })) }));
|
|
25
|
+
};
|
|
26
|
+
exports.Router = Router;
|
|
27
27
|
//# sourceMappingURL=Router.js.map
|