krl-alfred 1.77.2 → 1.77.3
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.
|
@@ -12,18 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var react_1 = require("react");
|
|
16
15
|
var ListGroup_styled_1 = require("./ListGroup.styled");
|
|
17
16
|
var ListGroup = function (props) {
|
|
18
17
|
var data = props.data;
|
|
19
|
-
var _a = (0, react_1.useState)(''), link = _a[0], setLink = _a[1];
|
|
20
|
-
(0, react_1.useEffect)(function () {
|
|
21
|
-
var _a;
|
|
22
|
-
setLink((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href);
|
|
23
|
-
}, []);
|
|
24
18
|
return ((0, jsx_runtime_1.jsx)(ListGroup_styled_1.ListGroupStyled, { children: data === null || data === void 0 ? void 0 : data.map(function (item, key) {
|
|
25
|
-
|
|
26
|
-
return (0, jsx_runtime_1.jsx)(ListGroup_styled_1.ListGroupItem, { children: (0, jsx_runtime_1.jsx)(ListGroup_styled_1.ListGroupItemButton, __assign({ "$isActive": (_a = link === null || link === void 0 ? void 0 : link.split('/')) === null || _a === void 0 ? void 0 : _a.includes(item["slug"]), onClick: item.onClick, "$hasNotification": item.hasNotification }, { children: item.title })) }, key);
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(ListGroup_styled_1.ListGroupItem, { children: (0, jsx_runtime_1.jsx)(ListGroup_styled_1.ListGroupItemButton, __assign({ "$isActive": item.isActive, onClick: item.onClick, "$hasNotification": item.hasNotification }, { children: item.title })) }, key);
|
|
27
20
|
}) }));
|
|
28
21
|
};
|
|
29
22
|
ListGroup.defaultProps = {};
|
|
@@ -11,5 +11,5 @@ exports.ListGroupItemButton = exports.ListGroupItem = exports.ListGroupStyled =
|
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
exports.ListGroupStyled = styled_components_1.default.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n padding: 0;\n margin: 0;\n"], ["\n display: block;\n padding: 0;\n margin: 0;\n"])));
|
|
13
13
|
exports.ListGroupItem = styled_components_1.default.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0;\n margin: 0; \n display: block;\n + li {\n margin-top: 1rem;\n }\n"], ["\n padding: 0;\n margin: 0; \n display: block;\n + li {\n margin-top: 1rem;\n }\n"])));
|
|
14
|
-
exports.ListGroupItemButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 1.5rem;\n margin: 0;\n height: 67px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: 0.5rem;\n background-color: ", ";\n cursor: pointer;\n color: ", ";\n border: 0;\n width: 100%;\n position: relative;\n outline: none;\n font:var(--title-bold-16-19);\n transition: all .2s ease;\n &:before{\n content: \"\";\n position: absolute;\n inset: 0;\n user-select: none;\n pointer-events: none;\n border-radius: inherit;\n border: ", ";\n
|
|
14
|
+
exports.ListGroupItemButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 1.5rem;\n margin: 0;\n height: 67px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: 0.5rem;\n background-color: ", ";\n cursor: pointer;\n color: ", ";\n border: 0;\n width: 100%;\n position: relative;\n outline: none;\n font:var(--title-bold-16-19);\n transition: all .2s ease;\n &:before{\n content: \"\";\n position: absolute;\n inset: 0;\n user-select: none;\n pointer-events: none;\n border-radius: inherit;\n border: ", ";\n }\n ", "\n ", "\n"], ["\n padding: 0 1.5rem;\n margin: 0;\n height: 67px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: 0.5rem;\n background-color: ", ";\n cursor: pointer;\n color: ", ";\n border: 0;\n width: 100%;\n position: relative;\n outline: none;\n font:var(--title-bold-16-19);\n transition: all .2s ease;\n &:before{\n content: \"\";\n position: absolute;\n inset: 0;\n user-select: none;\n pointer-events: none;\n border-radius: inherit;\n border: ", ";\n }\n ", "\n ", "\n"])), function (props) { return props.$isActive ? "#fff" : "var(--dark-opacity-3)"; }, function (props) { return props.$isActive ? "var(--primary)" : "var(--dark)"; }, function (props) { return props.$isActive ? "2px solid var(--primary)" : "none"; }, function (props) { return !props.$isActive && "\n &:hover{\n background-color: var(--primary-opacity-5);\n color: var(--primary);\n }\n "; }, function (props) { return props.$hasNotification && "\n \n &:after{\n content: \"\";\n position: absolute;\n right : 1.5rem;\n top:50%;\n transform:translateY(-50%);\n width:16px;\n height:16px;\n background-color:var(--primary);\n border-radius:50%;\n }\n "; });
|
|
15
15
|
var templateObject_1, templateObject_2, templateObject_3;
|