@codeleap/web 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActivityIndicator/index.js +2 -2
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.d.ts +47 -43
- package/dist/components/ActivityIndicator/styles.js.map +1 -1
- package/dist/components/Button.d.ts +4 -3
- package/dist/components/Button.js +9 -5
- package/dist/components/Button.js.map +1 -1
- package/dist/components/CenterWrapper.js +1 -1
- package/dist/components/CenterWrapper.js.map +1 -1
- package/dist/components/Checkbox/index.js +3 -3
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +47 -43
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/ContentView.d.ts +1 -1
- package/dist/components/ContentView.js +5 -5
- package/dist/components/ContentView.js.map +1 -1
- package/dist/components/Drawer.js +2 -3
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/FileInput.js +1 -1
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/HorizontalScroll.js.map +1 -1
- package/dist/components/Icon.d.ts +7 -8
- package/dist/components/Icon.js +25 -9
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/Link.js +3 -13
- package/dist/components/Link.js.map +1 -1
- package/dist/components/List.d.ts +18 -0
- package/dist/components/{FlatList.js → List.js} +9 -9
- package/dist/components/List.js.map +1 -0
- package/dist/components/Modal/index.js +2 -4
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +50 -45
- package/dist/components/Modal/styles.js.map +1 -1
- package/dist/components/Overlay.js +2 -2
- package/dist/components/Overlay.js.map +1 -1
- package/dist/components/RadioInput/index.js +6 -4
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +48 -44
- package/dist/components/RadioInput/styles.js.map +1 -1
- package/dist/components/{PageRouter → RouterPage}/Menu.d.ts +0 -0
- package/dist/components/{PageRouter → RouterPage}/Menu.js +3 -3
- package/dist/components/RouterPage/Menu.js.map +1 -0
- package/dist/components/{PageRouter → RouterPage}/MenuItem.d.ts +3 -2
- package/dist/components/{PageRouter → RouterPage}/MenuItem.js +6 -6
- package/dist/components/RouterPage/MenuItem.js.map +1 -0
- package/dist/components/{PageRouter → RouterPage}/Router.d.ts +0 -0
- package/dist/components/{PageRouter → RouterPage}/Router.js +1 -1
- package/dist/components/RouterPage/Router.js.map +1 -0
- package/dist/components/{PageRouter → RouterPage}/index.d.ts +6 -4
- package/dist/components/{PageRouter → RouterPage}/index.js +8 -3
- package/dist/components/RouterPage/index.js.map +1 -0
- package/dist/components/RouterPage/styles.d.ts +51 -0
- package/dist/components/RouterPage/styles.js +84 -0
- package/dist/components/RouterPage/styles.js.map +1 -0
- package/dist/components/Scroll.d.ts +5 -0
- package/dist/components/Scroll.js +24 -0
- package/dist/components/Scroll.js.map +1 -0
- package/dist/components/Select/Custom.js +9 -14
- package/dist/components/Select/Custom.js.map +1 -1
- package/dist/components/Select/Native.js +2 -2
- package/dist/components/Select/Native.js.map +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +1 -1
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +1 -1
- package/dist/components/Slider.js.map +1 -1
- package/dist/components/Text.js +4 -2
- package/dist/components/Text.js.map +1 -1
- package/dist/components/TextInput.d.ts +102 -94
- package/dist/components/TextInput.js +22 -13
- package/dist/components/TextInput.js.map +1 -1
- package/dist/components/Tooltip.js +4 -4
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Touchable.js +3 -2
- package/dist/components/Touchable.js.map +1 -1
- package/dist/components/View.d.ts +1 -0
- package/dist/components/View.js +21 -6
- package/dist/components/View.js.map +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/Toast.d.ts +15 -0
- package/dist/lib/Toast.js +21 -0
- package/dist/lib/Toast.js.map +1 -0
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/utils/cookies.d.ts +3 -3
- package/dist/lib/utils/cookies.js +3 -3
- package/dist/lib/utils/cookies.js.map +1 -1
- package/dist/lib/utils/pollyfils/scroll.js +2 -2
- package/dist/lib/utils/pollyfils/scroll.js.map +1 -1
- package/dist/lib/utils/stopPropagation.js +1 -2
- package/dist/lib/utils/stopPropagation.js.map +1 -1
- package/package.json +7 -4
- package/CHANGELOG.md +0 -10
- package/dist/components/FlatList.d.ts +0 -18
- package/dist/components/FlatList.js.map +0 -1
- package/dist/components/PageRouter/Menu.js.map +0 -1
- package/dist/components/PageRouter/MenuItem.js.map +0 -1
- package/dist/components/PageRouter/Router.js.map +0 -1
- package/dist/components/PageRouter/index.js.map +0 -1
|
@@ -20,17 +20,17 @@ var MenuItem_1 = require("./MenuItem");
|
|
|
20
20
|
var common_1 = require("@codeleap/common");
|
|
21
21
|
var TabsWrapper = function (_a) {
|
|
22
22
|
var children = _a.children, styles = _a.styles;
|
|
23
|
-
var Theme = (0, common_1.
|
|
23
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
24
24
|
var isMobile = Theme.hooks.down('small');
|
|
25
25
|
var wrapperStyle = isMobile ? styles.topMenu : styles.sideMenu;
|
|
26
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 }), void 0) }), void 0) }, void 0) }), void 0);
|
|
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 }), void 0) }), void 0) }, void 0) }), void 0));
|
|
28
28
|
}
|
|
29
29
|
return (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: [wrapperStyle] }, { children: children }), void 0);
|
|
30
30
|
};
|
|
31
31
|
var Menu = function (_a) {
|
|
32
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); }) }), void 0);
|
|
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)); }) }), void 0));
|
|
34
34
|
};
|
|
35
35
|
exports.Menu = Menu;
|
|
36
36
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/RouterPage/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gCAA8B;AAC9B,kDAAgD;AAChD,wDAAsD;AACtD,uCAAoD;AACpD,2CAAsE;AAGtE,IAAM,WAAW,GAAG,UAAC,EAAoB;QAAlB,QAAQ,cAAA,EAAE,MAAM,YAAA;IAC7B,IAAA,KAAK,GAAK,IAAA,2BAAkB,GAAE,MAAzB,CAAyB;IACtC,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAE1C,IAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAA;IAEhE,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,uBAAC,WAAI,aAAC,GAAG,EAAE,CAAC,YAAY,CAAC,gBACvB,uBAAC,6BAAa,cACZ,uBAAC,WAAI,aAAC,GAAG,EAAE,MAAM,CAAC,UAAU,gBAC1B,uBAAC,mCAAgB,aAAC,GAAG,EAAE,MAAM,CAAC,gBAAgB,gBAC3C,QAAQ,YACQ,YACd,WACO,YACX,CACR,CAAA;KACF;IAED,OAAO,uBAAC,WAAI,aAAC,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAG,QAAQ,YAAQ,CAAA;AACrD,CAAC,CAAA;AAOM,IAAM,IAAI,GAA8B,UAAC,EAAiB;QAAf,KAAK,WAAA,EAAE,MAAM,YAAA;IAC7D,OAAO,CACL,uBAAC,WAAW,aAAC,MAAM,EAAE,MAAM,gBACxB,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,CACnB,uBAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,EAAkB,MAAM,EAAE,MAAM,IAAzB,IAAI,CAAC,IAAI,CAAoB,CACzD,EAFoB,CAEpB,CAAC,YACU,CACf,CAAA;AACH,CAAC,CAAA;AARY,QAAA,IAAI,QAQhB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconPlaceholder, StylesOf } from '@codeleap/common';
|
|
3
|
+
import { MenuComposition } from './styles';
|
|
3
4
|
export declare type MenuItemProps = {
|
|
4
5
|
data: {
|
|
5
|
-
icon:
|
|
6
|
+
icon: IconPlaceholder;
|
|
6
7
|
title: string;
|
|
7
8
|
path: string;
|
|
8
9
|
};
|
|
@@ -19,24 +19,24 @@ var Link_1 = require("../Link");
|
|
|
19
19
|
var common_1 = require("@codeleap/common");
|
|
20
20
|
var utils_1 = require("../../lib/utils");
|
|
21
21
|
var gatsby_plugin_intl_1 = require("gatsby-plugin-intl");
|
|
22
|
-
var RouterLink = function (props) { return (0, jsx_runtime_1.jsx)(Link_1.Link, __assign({ component: gatsby_plugin_intl_1.Link }, props), void 0); };
|
|
22
|
+
var RouterLink = function (props) { return ((0, jsx_runtime_1.jsx)(Link_1.Link, __assign({ component: gatsby_plugin_intl_1.Link }, props), void 0)); };
|
|
23
23
|
var MenuItem = function (props) {
|
|
24
24
|
var styles = props.styles;
|
|
25
25
|
var _a = props.data, title = _a.title, path = _a.path, icon = _a.icon;
|
|
26
26
|
var pathname = (0, utils_1.url)().pathname;
|
|
27
27
|
var selected = pathname.includes(path);
|
|
28
|
-
var Theme = (0, common_1.
|
|
28
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
29
29
|
var isMobile = Theme.hooks.down('small');
|
|
30
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: [
|
|
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
32
|
styles['menuItem:text:mobile'],
|
|
33
33
|
selected && styles['menuItem:text:selected'],
|
|
34
|
-
],
|
|
34
|
+
], text: title }, void 0), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon:mobile']), selected && styles['menuItem:icon:mobile:selected']) }, void 0)] }), void 0));
|
|
35
35
|
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon }, void 0), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(RouterLink, __assign({ to: path }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon, style: __assign(__assign({}, styles['menuItem:icon']), selected && styles['menuItem:icon:selected']) }, void 0), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: 'p3', css: [
|
|
37
37
|
styles['menuItem:text'],
|
|
38
38
|
selected && styles['menuItem:text:selected'],
|
|
39
|
-
],
|
|
39
|
+
], text: title }, void 0)] }), void 0));
|
|
40
40
|
};
|
|
41
41
|
exports.MenuItem = MenuItem;
|
|
42
42
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../../../src/components/RouterPage/MenuItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gCAA8B;AAC9B,gCAA8B;AAC9B,gCAA8B;AAC9B,2CAKyB;AACzB,yCAAqC;AACrC,yDAAqD;AAGrD,IAAM,UAAU,GAAkB,UAAC,KAAK,IAAK,OAAA,CAC3C,uBAAC,WAAI,aAAC,SAAS,EAAE,yBAAQ,IAAM,KAAK,UAAI,CACzC,EAF4C,CAE5C,CAAA;AAWM,IAAM,QAAQ,GAA4B,UAAC,KAAK;IAC7C,IAAA,MAAM,GAAK,KAAK,OAAV,CAAU;IAClB,IAAA,KAAwB,KAAK,CAAC,IAAI,EAAhC,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,IAAI,UAAe,CAAA;IAEhC,IAAA,QAAQ,GAAK,IAAA,WAAG,GAAE,SAAV,CAAU;IAE1B,IAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChC,IAAA,KAAK,GAAK,IAAA,2BAAkB,GAAE,MAAzB,CAAyB;IACtC,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAE1C,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,wBAAC,UAAU,aAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,iBACpD,uBAAC,WAAI,IACH,OAAO,EAAE,IAAI,EACb,GAAG,EAAE;wBACH,MAAM,CAAC,sBAAsB,CAAC;wBAC9B,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC;qBAC7C,EACD,IAAI,EAAE,KAAK,WACX,EACF,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,wBAClB,MAAM,CAAC,sBAAsB,CAAC,GAC9B,QAAQ,IAAI,MAAM,CAAC,+BAA+B,CAAC,YACpD,aACO,CACd,CAAA;KACF;IAED,OAAO,CACL,wBAAC,UAAU,aAAC,EAAE,EAAE,IAAI,iBAClB,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,wBAClB,MAAM,CAAC,eAAe,CAAC,GACvB,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC,YAC7C,EACJ,uBAAC,WAAI,IACH,OAAO,EAAE,IAAI,EACb,GAAG,EAAE;oBACH,MAAM,CAAC,eAAe,CAAC;oBACvB,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC;iBAC7C,EACD,IAAI,EAAE,KAAK,WACX,aACS,CACd,CAAA;AACH,CAAC,CAAA;AA7CY,QAAA,QAAQ,YA6CpB"}
|
|
File without changes
|
|
@@ -21,7 +21,7 @@ var router_1 = require("@reach/router");
|
|
|
21
21
|
var Router = function (props) {
|
|
22
22
|
var children = props.children, style = props.style, basePath = props.basePath, defaultPath = props.defaultPath;
|
|
23
23
|
var base = "/:language".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
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(router_1.Router, __assign({ basepath: base }, { children: children }), void 0) }, void 0));
|
|
25
25
|
};
|
|
26
26
|
exports.Router = Router;
|
|
27
27
|
//# sourceMappingURL=Router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/components/RouterPage/Router.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,wCAAqD;AAQ9C,IAAM,MAAM,GAA0B,UAAC,KAAK;IACzC,IAAA,QAAQ,GAAmC,KAAK,SAAxC,EAAE,KAAK,GAA4B,KAAK,MAAjC,EAAE,QAAQ,GAAkB,KAAK,SAAvB,EAAE,WAAW,GAAK,KAAK,YAAV,CAAU;IACxD,IAAM,IAAI,GAAG,oBAAa,QAAQ,CAAE,CAAA;IAEpC,OAAO,CACL,uBAAC,eAAK,CAAC,QAAQ,cACb,uBAAC,eAAW,aAAC,QAAQ,EAAE,IAAI,gBAAG,QAAQ,YAAe,WACtC,CAClB,CAAA;AACH,CAAC,CAAA;AATY,QAAA,MAAM,UASlB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentVariants, IconPlaceholder
|
|
2
|
+
import { ComponentVariants, IconPlaceholder } from '@codeleap/common';
|
|
3
3
|
import { StylesOf } from '../../types/utility';
|
|
4
|
+
import { RouterPageComposition, RouterPageStyles } from './styles';
|
|
5
|
+
export * from './styles';
|
|
4
6
|
export declare type RouteProps = {
|
|
5
7
|
title?: string;
|
|
6
8
|
path?: string;
|
|
7
9
|
menuIcon?: IconPlaceholder;
|
|
8
10
|
};
|
|
9
11
|
declare type ContentProps = {
|
|
10
|
-
styles: StylesOf<
|
|
12
|
+
styles: StylesOf<RouterPageComposition>;
|
|
11
13
|
menuItems: {
|
|
12
14
|
icon: string;
|
|
13
15
|
title: string;
|
|
@@ -19,8 +21,8 @@ export * from './Menu';
|
|
|
19
21
|
export * from './MenuItem';
|
|
20
22
|
declare type RouterPageProps = {
|
|
21
23
|
basePath: string;
|
|
22
|
-
styles?: StylesOf<
|
|
24
|
+
styles?: StylesOf<RouterPageComposition>;
|
|
23
25
|
title?: string;
|
|
24
26
|
renderContentWrapper?: React.FC<ContentProps>;
|
|
25
|
-
} & ComponentVariants<typeof
|
|
27
|
+
} & ComponentVariants<typeof RouterPageStyles>;
|
|
26
28
|
export declare const RouterPage: React.FC<RouterPageProps>;
|
|
@@ -42,6 +42,7 @@ var Router_1 = require("./Router");
|
|
|
42
42
|
var common_1 = require("@codeleap/common");
|
|
43
43
|
var react_helmet_1 = require("react-helmet");
|
|
44
44
|
var utils_1 = require("../../lib/utils");
|
|
45
|
+
__exportStar(require("./styles"), exports);
|
|
45
46
|
__exportStar(require("./Router"), exports);
|
|
46
47
|
__exportStar(require("./Menu"), exports);
|
|
47
48
|
__exportStar(require("./MenuItem"), exports);
|
|
@@ -67,14 +68,18 @@ var RouterPage = function (props) {
|
|
|
67
68
|
defaultPath: defaultPath,
|
|
68
69
|
};
|
|
69
70
|
}, [children]), menuItems = _a.menuItems, defaultPath = _a.defaultPath;
|
|
70
|
-
var variantStyles = (0, common_1.
|
|
71
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('u:RouterPage', {
|
|
72
|
+
variants: variants,
|
|
73
|
+
responsiveVariants: responsiveVariants,
|
|
74
|
+
styles: styles,
|
|
75
|
+
});
|
|
71
76
|
var currentPage = menuItems.find(function (_a) {
|
|
72
77
|
var path = _a.path;
|
|
73
78
|
return pathName.includes(path);
|
|
74
79
|
});
|
|
75
80
|
var Content = renderContentWrapper;
|
|
76
|
-
return (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: (pageGroupTitle ? "".concat(pageGroupTitle, " | ") : '') +
|
|
77
|
-
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, { children: [(0, jsx_runtime_1.jsx)(react_helmet_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: (pageGroupTitle ? "".concat(pageGroupTitle, " | ") : '') +
|
|
82
|
+
(currentPage ? currentPage === null || currentPage === void 0 ? void 0 : currentPage.title : '') }, void 0) }, void 0), renderContentWrapper ? ((0, jsx_runtime_1.jsx)(Content, __assign({ styles: variantStyles, menuItems: menuItems }, { children: (0, jsx_runtime_1.jsx)(Router_1.Router, __assign({ defaultPath: defaultPath, basePath: basePath, style: variantStyles.router }, { children: children }), void 0) }), void 0)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [currentPage.showMenu ? (0, jsx_runtime_1.jsx)(Menu_1.Menu, { items: menuItems, styles: variantStyles }, void 0) : null, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: variantStyles.content }, { children: (0, jsx_runtime_1.jsx)(Router_1.Router, __assign({ defaultPath: defaultPath, basePath: basePath, style: variantStyles.router }, { children: children }), void 0) }), void 0)] }, void 0))] }), void 0));
|
|
78
83
|
};
|
|
79
84
|
exports.RouterPage = RouterPage;
|
|
80
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RouterPage/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA8B;AAC9B,6CAAsC;AAEtC,+BAA6B;AAC7B,mCAAiC;AACjC,2CAKyB;AAEzB,6CAAqC;AACrC,yCAAqC;AAGrC,2CAAwB;AAexB,2CAAwB;AACxB,yCAAsB;AACtB,6CAA0B;AASnB,IAAM,UAAU,GAA8B,UAAC,KAAK;IAEvD,IAAA,QAAQ,GAON,KAAK,SAPC,EACR,QAAQ,GAMN,KAAK,SANC,EACR,QAAQ,GAKN,KAAK,SALC,EACD,cAAc,GAInB,KAAK,MAJc,EACrB,kBAAkB,GAGhB,KAAK,mBAHW,EAClB,MAAM,GAEJ,KAAK,OAFD,EACN,oBAAoB,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AAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;IAAvB,CAAuB,CAAC,CAAA;IAEzE,IAAM,OAAO,GAAG,oBAAoB,CAAA;IACpC,OAAO,CACL,wBAAC,WAAI,aAAC,GAAG,EAAE,aAAa,CAAC,OAAO,iBAC9B,uBAAC,qBAAM,cACL,4CACG,CAAC,cAAc,CAAC,CAAC,CAAC,UAAG,cAAc,QAAK,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC7C,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,WACnC,WACD,EACR,oBAAoB,CAAC,CAAC,CAAC,CACtB,uBAAC,OAAO,aAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,gBAClD,uBAAC,eAAM,aACL,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,CAAC,MAAM,gBAE1B,QAAQ,YACF,YACD,CACX,CAAC,CAAC,CAAC,CACF,6DACG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAE,uBAAC,WAAI,IAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,WAAI,CAAC,CAAC,CAAC,IAAI,EACjF,uBAAC,WAAI,aAAC,GAAG,EAAE,aAAa,CAAC,OAAO,gBAC9B,uBAAC,eAAM,aACL,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,aAAa,CAAC,MAAM,gBAE1B,QAAQ,YACF,YACJ,YACN,CACJ,aACI,CACR,CAAA;AACH,CAAC,CAAA;AAlFY,QAAA,UAAU,cAkFtB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare type MenuComposition = 'wrapper' | 'menuItem' | 'menuItem:mobile' | 'menuItem:icon' | 'menuItem:icon:selected' | 'menuItem:text' | 'menuItem:text:mobile' | 'menuItem:icon:mobile' | 'menuItem:icon:mobile:selected' | 'menuItem:text:selected' | 'sideMenu' | 'topMenu' | 'horizontalScroll';
|
|
2
|
+
export declare type RouterPageComposition = 'content' | 'router' | MenuComposition;
|
|
3
|
+
export declare const RouterPageStyles: {
|
|
4
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
5
|
+
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
6
|
+
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
7
|
+
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
8
|
+
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
9
|
+
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
10
|
+
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
11
|
+
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
12
|
+
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
13
|
+
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
14
|
+
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
15
|
+
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
16
|
+
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
17
|
+
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
18
|
+
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
19
|
+
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
20
|
+
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
21
|
+
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
22
|
+
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
23
|
+
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
24
|
+
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
25
|
+
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
26
|
+
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
27
|
+
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
28
|
+
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
29
|
+
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
30
|
+
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
31
|
+
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
32
|
+
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
33
|
+
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
34
|
+
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
35
|
+
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
36
|
+
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
37
|
+
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
38
|
+
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
39
|
+
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
40
|
+
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
41
|
+
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
42
|
+
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
43
|
+
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
44
|
+
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
45
|
+
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
46
|
+
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
47
|
+
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
48
|
+
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
49
|
+
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
50
|
+
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<RouterPageComposition, any>>;
|
|
51
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
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.RouterPageStyles = void 0;
|
|
15
|
+
var common_1 = require("@codeleap/common");
|
|
16
|
+
var createRouterPageStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
|
+
var presets = (0, common_1.includePresets)(function (styles) { return createRouterPageStyle(function () { return ({ topMenu: styles, sideMenu: styles }); }); });
|
|
18
|
+
exports.RouterPageStyles = __assign(__assign({}, presets), { default: createRouterPageStyle(function (Theme) {
|
|
19
|
+
var _a;
|
|
20
|
+
return ({
|
|
21
|
+
menuItem: {
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
padding: Theme.spacing.value(2.5),
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
borderRadius: Theme.borderRadius.medium,
|
|
26
|
+
borderWidth: 1,
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
// ...Theme.debug('red'),
|
|
29
|
+
borderColor: 'transparent',
|
|
30
|
+
width: Theme.spacing.value(5),
|
|
31
|
+
height: Theme.spacing.value(5),
|
|
32
|
+
margin: 2,
|
|
33
|
+
'&:hover': {
|
|
34
|
+
background: Theme.colors.gray,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
'menuItem:mobile': __assign(__assign({ display: 'flex' }, Theme.presets.center), { flexDirection: 'column-reverse', justifyContent: 'space-between' }),
|
|
38
|
+
'menuItem:mobile:text': {
|
|
39
|
+
color: Theme.colors.black,
|
|
40
|
+
padding: Theme.spacing.value(1),
|
|
41
|
+
textTransform: 'uppercase',
|
|
42
|
+
},
|
|
43
|
+
'menuItem:text': {
|
|
44
|
+
fontWeight: '500',
|
|
45
|
+
color: Theme.colors.primary,
|
|
46
|
+
textTransform: 'uppercase',
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
},
|
|
49
|
+
'menuItem:text:selected': {
|
|
50
|
+
fontWeight: 'bold',
|
|
51
|
+
color: Theme.colors.gray,
|
|
52
|
+
},
|
|
53
|
+
sideMenu: (_a = {
|
|
54
|
+
borderRadius: Theme.borderRadius.medium,
|
|
55
|
+
boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.16)',
|
|
56
|
+
marginRight: Theme.spacing.value(6),
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
height: '100%',
|
|
61
|
+
width: Theme.spacing.value(11),
|
|
62
|
+
flexShrink: 0,
|
|
63
|
+
flexGrow: 0
|
|
64
|
+
},
|
|
65
|
+
_a[Theme.media.down('xlarge')] = {
|
|
66
|
+
marginRight: Theme.spacing.value(4),
|
|
67
|
+
},
|
|
68
|
+
_a[Theme.media.down('large')] = {
|
|
69
|
+
marginRight: Theme.spacing.value(3),
|
|
70
|
+
width: 90,
|
|
71
|
+
},
|
|
72
|
+
_a),
|
|
73
|
+
topMenu: {
|
|
74
|
+
width: '100%',
|
|
75
|
+
backgroundColor: Theme.colors.white,
|
|
76
|
+
height: 80,
|
|
77
|
+
},
|
|
78
|
+
horizontalScroll: {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
justifyContent: 'space-between',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}) });
|
|
84
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/RouterPage/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA8E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
import { ViewProps } from './View';
|
|
4
|
+
export declare const ScrollCP: <T extends ElementType<any> = "div">(props: ViewProps<T>, ref: Ref<any>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const Scroll: <T extends ElementType<any> = "div">(props: ViewProps<T>) => ReactElement;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.Scroll = exports.ScrollCP = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
var react_1 = require("react");
|
|
18
|
+
var View_1 = require("./View");
|
|
19
|
+
var ScrollCP = function (props, ref) {
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(View_1.View, __assign({}, props, { ref: ref, scroll: true }), void 0));
|
|
21
|
+
};
|
|
22
|
+
exports.ScrollCP = ScrollCP;
|
|
23
|
+
exports.Scroll = (0, react_1.forwardRef)(exports.ScrollCP);
|
|
24
|
+
//# sourceMappingURL=Scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scroll.js","sourceRoot":"","sources":["../../src/components/Scroll.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,eAAe;AACf,+BAKc;AACd,+BAAwC;AAGjC,IAAM,QAAQ,GAAG,UACtB,KAAmB,EACnB,GAAa;IAGb,OAAO,CACL,uBAAC,WAAI,eACC,KAAK,IACT,GAAG,EAAE,GAAG,EACR,MAAM,kBACN,CAEH,CAAA;AACH,CAAC,CAAA;AAbY,QAAA,QAAQ,YAapB;AAEY,QAAA,MAAM,GAAG,IAAA,kBAAU,EAAC,gBAAQ,CAExB,CAAA"}
|
|
@@ -36,18 +36,11 @@ var hooks_1 = require("../../lib/hooks");
|
|
|
36
36
|
var uuid_1 = require("uuid");
|
|
37
37
|
var SelectItem = function (_a) {
|
|
38
38
|
var styles = _a.styles, iconName = _a.iconName, onPress = _a.onPress, label = _a.label, inList = _a.inList;
|
|
39
|
-
return (0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, __assign({ onPress: onPress, css: inList ? [
|
|
40
|
-
styles.itemWrapper,
|
|
41
|
-
] : [
|
|
42
|
-
styles.buttonWrapper,
|
|
43
|
-
] }, { children: [typeof label === 'string' ?
|
|
44
|
-
(0, jsx_runtime_1.jsx)(Text_1.Text, { text: label, css: inList ? styles.itemText : styles.buttonText }, void 0)
|
|
45
|
-
: label, !inList &&
|
|
46
|
-
(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: iconName, style: styles.buttonIcon }, void 0)] }), void 0);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, __assign({ onPress: onPress, css: inList ? [styles.itemWrapper] : [styles.buttonWrapper] }, { children: [typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: label, css: inList ? styles.itemText : styles.buttonText }, void 0)) : (label), !inList && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: iconName, style: styles.buttonIcon }, void 0))] }), void 0));
|
|
47
40
|
};
|
|
48
41
|
var InputWrapper = function (props) {
|
|
49
42
|
var styles = props.styles, label = props.label, children = props.children, currentContent = props.currentContent, open = props.open, id = props.id, error = props.error, wrapperProps = __rest(props, ["styles", "label", "children", "currentContent", "open", "id", "error"]);
|
|
50
|
-
return (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.wrapper }, wrapperProps, { children: [(0, jsx_runtime_1.jsx)(TextInput_1.InputLabel, { label: label, style: styles.label }, void 0), (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.inputWrapper, id: id }, { children: [currentContent, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.list }, { children: children }), void 0)] }), void 0), (0, jsx_runtime_1.jsx)(TextInput_1.FormError, { message: error.message, style: styles.error }, void 0)] }), void 0);
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.wrapper }, wrapperProps, { children: [(0, jsx_runtime_1.jsx)(TextInput_1.InputLabel, { label: label, style: styles.label }, void 0), (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.inputWrapper, id: id }, { children: [currentContent, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.list }, { children: children }), void 0)] }), void 0), (0, jsx_runtime_1.jsx)(TextInput_1.FormError, { message: error.message, style: styles.error }, void 0)] }), void 0));
|
|
51
44
|
};
|
|
52
45
|
var CustomSelect = function (selectProps) {
|
|
53
46
|
var _a = selectProps.options, options = _a === void 0 ? [] : _a, value = selectProps.value, onValueChange = selectProps.onValueChange, renderCurrentlySelected = selectProps.renderCurrentlySelected, renderItem = selectProps.renderItem, placeholder = selectProps.placeholder, onDropdownToggle = selectProps.onDropdownToggle, variants = selectProps.variants, responsiveVariants = selectProps.responsiveVariants, styles = selectProps.styles, validate = selectProps.validate, disabled = selectProps.disabled, arrowIconName = selectProps.arrowIconName, props = __rest(selectProps, ["options", "value", "onValueChange", "renderCurrentlySelected", "renderItem", "placeholder", "onDropdownToggle", "variants", "responsiveVariants", "styles", "validate", "disabled", "arrowIconName"]);
|
|
@@ -65,15 +58,17 @@ var CustomSelect = function (selectProps) {
|
|
|
65
58
|
setOpen(false);
|
|
66
59
|
}
|
|
67
60
|
}, { customId: inputId, deps: [] });
|
|
68
|
-
var variantStyles = (0, common_1.
|
|
61
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
69
62
|
styles: styles,
|
|
70
63
|
variants: variants,
|
|
71
64
|
responsiveVariants: responsiveVariants,
|
|
72
65
|
});
|
|
73
66
|
var CurrentContent = renderCurrentlySelected || SelectItem;
|
|
74
67
|
var Item = renderItem || SelectItem;
|
|
75
|
-
var isValueEmpty =
|
|
76
|
-
var currentOption = isValueEmpty
|
|
68
|
+
var isValueEmpty = value === null || typeof value === 'undefined';
|
|
69
|
+
var currentOption = isValueEmpty
|
|
70
|
+
? { label: placeholder, value: value }
|
|
71
|
+
: { label: optionLabelMap[value], value: value };
|
|
77
72
|
(0, common_1.onUpdate)(function () {
|
|
78
73
|
onDropdownToggle === null || onDropdownToggle === void 0 ? void 0 : onDropdownToggle(isOpen);
|
|
79
74
|
}, [isOpen]);
|
|
@@ -82,7 +77,7 @@ var CustomSelect = function (selectProps) {
|
|
|
82
77
|
if (append === void 0) { append = {}; }
|
|
83
78
|
return __assign(__assign(__assign(__assign(__assign(__assign({}, variantStyles[key]), (0, common_1.optionalObject)(isOpen, variantStyles["".concat(key, ":open")], {})), (0, common_1.optionalObject)(isHovering, variantStyles["".concat(key, ":hover")], {})), (0, common_1.optionalObject)(showError, variantStyles["".concat(key, ":error")], {})), (0, common_1.optionalObject)(disabled, variantStyles["".concat(key, ":disabled")], {})), append);
|
|
84
79
|
}
|
|
85
|
-
return (0, jsx_runtime_1.jsx)(InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
86
81
|
buttonIcon: getStyles('buttonIcon'),
|
|
87
82
|
buttonText: getStyles('buttonText'),
|
|
88
83
|
buttonWrapper: getStyles('buttonWrapper'),
|
|
@@ -98,7 +93,7 @@ var CustomSelect = function (selectProps) {
|
|
|
98
93
|
}, selected: item.value === value, key: item.value, styles: {
|
|
99
94
|
itemText: getStyles('itemText', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemText:selected'], {}))),
|
|
100
95
|
itemWrapper: getStyles('itemWrapper', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemWrapper:selected'], {}))),
|
|
101
|
-
} }))); }) }), void 0);
|
|
96
|
+
} }))); }) }), void 0));
|
|
102
97
|
};
|
|
103
98
|
exports.CustomSelect = CustomSelect;
|
|
104
99
|
//# sourceMappingURL=Custom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Custom.js","sourceRoot":"","sources":["../../../src/components/Select/Custom.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Custom.js","sourceRoot":"","sources":["../../../src/components/Select/Custom.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAQyB;AACzB,+BAAuC;AACvC,0CAAoD;AACpD,gCAA8B;AAC9B,0CAAwC;AACxC,gCAA8B;AAC9B,gCAA8B;AAC9B,yCAAiD;AAIjD,6BAAyB;AACzB,IAAM,UAAU,GAEZ,UAAC,EAA4C;QAA1C,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA;IAC7C,OAAO,CACL,wBAAC,qBAAS,aACR,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,iBAE1D,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC3B,uBAAC,WAAI,IAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,WAAI,CAC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eAAe,CAAC;aAC1C,EACD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,aAAa,IAAI,aAAa,YACxC,EAEJ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE;YACN,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAC7B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;YACzB,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC;YACvC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;YACvB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;SAC1B,IACG,KAAK,IACT,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,WAAW,gBAEnB,OAAO,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,CACrB,2BAAC,IAAI,eACC,IAAI,IACR,MAAM,QACN,OAAO,EAAE;gBACP,OAAO,CAAC,KAAK,CAAC,CAAA;gBACd,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC3B,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC9B,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,MAAM,EAAE;gBACN,QAAQ,EAAE,SAAS,CAAC,UAAU,eACzB,IAAA,uBAAc,EACf,IAAI,CAAC,KAAK,KAAK,KAAK,EACpB,aAAa,CAAC,mBAAmB,CAAC,EAClC,EAAE,CACH,EACD;gBACF,WAAW,EAAE,SAAS,CAAC,aAAa,eAC/B,IAAA,uBAAc,EACf,IAAI,CAAC,KAAK,KAAK,KAAK,EACpB,aAAa,CAAC,sBAAsB,CAAC,EACrC,EAAE,CACH,EACD;aACH,IACD,CACH,EA3BsB,CA2BtB,CAAC,YACW,CAChB,CAAA;AACH,CAAC,CAAA;AAlIY,QAAA,YAAY,gBAkIxB"}
|
|
@@ -29,7 +29,7 @@ var View_1 = require("../View");
|
|
|
29
29
|
var Text_1 = require("../Text");
|
|
30
30
|
var NativeSelect = function (selectProps) {
|
|
31
31
|
var _a = selectProps.variants, variants = _a === void 0 ? [] : _a, _b = selectProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, options = selectProps.options, styles = selectProps.styles, label = selectProps.label, onValueChange = selectProps.onValueChange, wrapperProps = selectProps.wrapperProps, value = selectProps.value, props = __rest(selectProps, ["variants", "responsiveVariants", "options", "styles", "label", "onValueChange", "wrapperProps", "value"]);
|
|
32
|
-
var variantStyles = (0, common_1.
|
|
32
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
33
33
|
responsiveVariants: responsiveVariants,
|
|
34
34
|
variants: variants,
|
|
35
35
|
styles: styles,
|
|
@@ -38,7 +38,7 @@ var NativeSelect = function (selectProps) {
|
|
|
38
38
|
props.onChange && props.onChange(e);
|
|
39
39
|
onValueChange && onValueChange(e.target.value);
|
|
40
40
|
}
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, wrapperProps, { children: [label ? (typeof label === 'string' ? (0, jsx_runtime_1.jsx)(Text_1.Text, { css: variantStyles.label, text: label }, void 0) : label) : null, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ component: 'select', css: variantStyles.select }, props, { onChange: handleChange }, { children: options.map(function (option, index) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: option.value, selected: value == option.value }, { children: option.label }), index)); }) }), void 0)] }), void 0));
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, wrapperProps, { children: [label ? (typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { css: variantStyles.label, text: label }, void 0)) : (label)) : null, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ component: 'select', css: variantStyles.select }, props, { onChange: handleChange }, { children: options.map(function (option, index) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: option.value, selected: value == option.value }, { children: option.label }), index)); }) }), void 0)] }), void 0));
|
|
42
42
|
};
|
|
43
43
|
exports.NativeSelect = NativeSelect;
|
|
44
44
|
//# sourceMappingURL=Native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Native.js","sourceRoot":"","sources":["../../../src/components/Select/Native.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"Native.js","sourceRoot":"","sources":["../../../src/components/Select/Native.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAMyB;AAEzB,gCAAyC;AACzC,gCAA8B;AAgBvB,IAAM,YAAY,GAAG,UAAC,WAA8B;IAEvD,IAAA,KASE,WAAW,SATA,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,KAQE,WAAW,mBARU,EAAvB,kBAAkB,mBAAG,EAAE,KAAA,EACvB,OAAO,GAOL,WAAW,QAPN,EACP,MAAM,GAMJ,WAAW,OANP,EACN,KAAK,GAKH,WAAW,MALR,EACL,aAAa,GAIX,WAAW,cAJA,EACb,YAAY,GAGV,WAAW,aAHD,EACZ,KAAK,GAEH,WAAW,MAFR,EACF,KAAK,UACN,WAAW,EAVT,0GAUL,CADS,CACK;IAEf,IAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,QAAQ,EAAE;QACvD,kBAAkB,oBAAA;QAClB,QAAQ,UAAA;QACR,MAAM,QAAA;KACP,CAAC,CAAA;IACF,SAAS,YAAY,CAAC,CAAC;QACrB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACnC,aAAa,IAAI,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,CACL,wBAAC,WAAI,aAAC,GAAG,EAAE,aAAa,CAAC,OAAO,IAAM,YAAY,eAC/C,KAAK,CAAC,CAAC,CAAC,CACP,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC1B,uBAAC,WAAI,IAAC,GAAG,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,WAAI,CAChD,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACF,CAAC,CAAC,CAAC,IAAI,EACR,uBAAC,WAAI,aACH,SAAS,EAAC,QAAQ,EAClB,GAAG,EAAE,aAAa,CAAC,MAAM,IACrB,KAAK,IACT,QAAQ,EAAE,YAAY,gBAErB,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,KAAK,IAAK,OAAA,CAC9B,4CACE,KAAK,EAAE,MAAM,CAAC,KAAK,EAEnB,QAAQ,EAAE,KAAK,IAAI,MAAM,CAAC,KAAK,gBAE9B,MAAM,CAAC,KAAK,KAHR,KAAK,CAIH,CACV,EAR+B,CAQ/B,CAAC,YACG,aACF,CACR,CAAA;AACH,CAAC,CAAA;AAjDY,QAAA,YAAY,gBAiDxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuC;AACvC,mCAA0D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuC;AACvC,mCAA0D;AAW1D,0CAAuB;AACvB,2CAAwB;AAEjB,IAAM,MAAM,GAAG,UACpB,KAAqB;IAErB,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC3B,OAAO,uBAAC,qBAAY,eAAK,KAAK,UAAI,CAAA;KACnC;IAED,OAAO,uBAAC,qBAAY,eAAK,KAAK,UAAI,CAAA;AACpC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare type WebSelectParts = 'wrapper' | 'label' | 'inputWrapper' | 'list' | 'itemWrapper' | 'itemWrapper:selected' | 'itemText' | 'itemText:selected' | 'buttonWrapper' | 'buttonText' | 'buttonIcon' | 'error';
|
|
2
2
|
export declare type WebSelectComposition = `${WebSelectParts}:hover` | `${WebSelectParts}:open` | `${WebSelectParts}:error` | `${WebSelectParts}:disabled` | WebSelectParts;
|
|
3
3
|
export declare const WebSelectStyles: {
|
|
4
|
-
default: (theme: import("@codeleap/common").
|
|
4
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebSelectComposition, any>>;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Select/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA8D;AAuB9D,IAAM,iBAAiB,GAAG,IAAA,oCAA2B,GAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Select/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA8D;AAuB9D,IAAM,iBAAiB,GAAG,IAAA,oCAA2B,GAAwB,CAAA;AAEhE,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,iBAAiB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACrC,OAAO,EAAE;YACP,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;SACxB;QACD,KAAK,eACA,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CACjC;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,UAAU;SACrB;QAED,IAAI,wCACF,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,IAE/B,KAAK,CAAC,OAAO,CAAC,MAAM,KACvB,SAAS,EAAE,QAAQ,EAEnB,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,CAA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;SAC5B;QACD,KAAK,EAAE;YACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;SAC7B;KACF,CAAC,EA9EoC,CA8EpC,CAAC;CACJ,CAAA"}
|
|
@@ -21,6 +21,6 @@ export declare type CustomSelectProps<T> = {
|
|
|
21
21
|
renderCurrentlySelected?: SelectRenderFN<T>;
|
|
22
22
|
styles?: StylesOf<WebSelectComposition>;
|
|
23
23
|
disabled?: boolean;
|
|
24
|
-
validate?: FormTypes.
|
|
24
|
+
validate?: FormTypes.ValidatorFunctionWithoutForm<any> | string;
|
|
25
25
|
arrowIconName?: IconPlaceholder;
|
|
26
26
|
} & ComponentVariants<typeof WebSelectStyles>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/components/Slider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/components/Slider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAkE;AAI3D,IAAM,MAAM,GAA0B,UAAC,WAAW;IACvD,IAAW,KAAK,UAAK,WAAW,EAA1B,EAAY,CAAc,CAAA;IAEhC,OAAO,uBAAC,mBAAQ,eAAK,KAAK,UAAI,CAAA;AAChC,CAAC,CAAA;AAJY,QAAA,MAAM,UAIlB"}
|
package/dist/components/Text.js
CHANGED
|
@@ -27,13 +27,15 @@ var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
27
27
|
var common_1 = require("@codeleap/common");
|
|
28
28
|
var Text = function (textProps) {
|
|
29
29
|
var _a = textProps.variants, variants = _a === void 0 ? [] : _a, _b = textProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, text = textProps.text, children = textProps.children, _c = textProps.component, component = _c === void 0 ? 'p' : _c, styles = textProps.styles, props = __rest(textProps, ["variants", "responsiveVariants", "text", "children", "component", "styles"]);
|
|
30
|
-
var variantStyles = (0, common_1.
|
|
30
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Text', {
|
|
31
31
|
rootElement: 'text',
|
|
32
32
|
responsiveVariants: responsiveVariants,
|
|
33
33
|
variants: variants,
|
|
34
|
+
styles: styles,
|
|
34
35
|
});
|
|
35
36
|
var Component = component;
|
|
36
|
-
|
|
37
|
+
var a = __assign(__assign({}, variantStyles.text), props.style);
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Component, __assign({ css: a }, props, { children: text || children }), void 0));
|
|
37
39
|
};
|
|
38
40
|
exports.Text = Text;
|
|
39
41
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAKyB;AAWlB,IAAM,IAAI,GAAG,UAAwB,SAAuB;IAE/D,IAAA,KAOE,SAAS,SAPE,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,KAME,SAAS,mBANY,EAAvB,kBAAkB,mBAAG,EAAE,KAAA,EACvB,IAAI,GAKF,SAAS,KALP,EACJ,QAAQ,GAIN,SAAS,SAJH,EACR,KAGE,SAAS,UAHI,EAAf,SAAS,mBAAG,GAAG,KAAA,EACf,MAAM,GAEJ,SAAS,OAFL,EACH,KAAK,UACN,SAAS,EARP,6EAQL,CADS,CACG;IACb,IAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,MAAM,EAAE;QACrD,WAAW,EAAE,MAAM;QACnB,kBAAkB,oBAAA;QAClB,QAAQ,UAAA;QACR,MAAM,QAAA;KACP,CAAC,CAAA;IAEF,IAAM,SAAS,GAAG,SAAS,CAAA;IAG3B,IAAM,CAAC,yBAAO,aAAa,CAAC,IAAI,GAAK,KAAK,CAAC,KAAK,CAAC,CAAA;IACjD,OAAO,CACL,uBAAC,SAAS,aACR,GAAG,EAAE,CAAC,IACF,KAAK,cAER,IAAI,IAAI,QAAQ,YACP,CACb,CAAA;AACH,CAAC,CAAA;AA7BY,QAAA,IAAI,QA6BhB"}
|