krl-alfred 1.72.13 → 1.72.15

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.
@@ -14,7 +14,7 @@ exports.AccordionContext = (0, react_1.createContext)({
14
14
  setActive: function (index) { }
15
15
  });
16
16
  var Accordion = function (props) {
17
- var title = props.title, data = props.data, activeIndex = props.activeIndex, showLink = props.showLink, linkText = props.linkText, linkOnClick = props.linkOnClick, collapseAll = props.collapseAll;
17
+ var title = props.title, data = props.data, activeIndex = props.activeIndex, showLink = props.showLink, linkText = props.linkText, linkOnClick = props.linkOnClick, collapseAll = props.collapseAll, size = props.size;
18
18
  var _a = (0, react_1.useState)(0), active = _a[0], setActive = _a[1];
19
19
  (0, react_1.useEffect)(function () {
20
20
  setActive(activeIndex);
@@ -22,7 +22,7 @@ var Accordion = function (props) {
22
22
  return ((0, jsx_runtime_1.jsxs)(Accordion_styled_1.AccordionStyled, { children: [title && (0, jsx_runtime_1.jsx)(Accordion_styled_1.AccordionTitle, { className: "title-bold-16-19", children: title }), (0, jsx_runtime_1.jsx)(Accordion_styled_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(exports.AccordionContext.Provider, { value: {
23
23
  active: active,
24
24
  setActive: setActive
25
- }, children: data === null || data === void 0 ? void 0 : data.map(function (item, key) { return ((0, jsx_runtime_1.jsx)(AccordionItem_1.default, { collapseAll: collapseAll, index: key, title: item.question, content: item.answer }, key)); }) }) }), showLink && ((0, jsx_runtime_1.jsx)(Accordion_styled_1.Footer, { className: "body-bold-14-17", children: (0, jsx_runtime_1.jsx)(TextLink_1.default, { onClick: linkOnClick, children: linkText }) }))] }));
25
+ }, children: data === null || data === void 0 ? void 0 : data.map(function (item, key) { return ((0, jsx_runtime_1.jsx)(AccordionItem_1.default, { size: size, collapseAll: collapseAll, index: key, title: item.question, content: item.answer }, key)); }) }) }), showLink && ((0, jsx_runtime_1.jsx)(Accordion_styled_1.Footer, { className: "body-bold-14-17", children: (0, jsx_runtime_1.jsx)(TextLink_1.default, { onClick: linkOnClick, children: linkText }) }))] }));
26
26
  };
27
27
  Accordion.defaultProps = {
28
28
  activeIndex: 0,
@@ -9,11 +9,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Footer = exports.ItemContent = exports.ItemTitle = exports.Item = exports.Wrapper = exports.AccordionTitle = exports.AccordionStyled = void 0;
11
11
  var styled_components_1 = __importDefault(require("styled-components"));
12
+ var devices_1 = require("../../constants/devices");
12
13
  exports.AccordionStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
13
14
  exports.AccordionTitle = styled_components_1.default.h1(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 1.5rem;\n margin-top: 0;\n"], ["\n margin-bottom: 1.5rem;\n margin-top: 0;\n"])));
14
15
  exports.Wrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\n"], ["\n\n"])));
15
16
  exports.Item = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &:not(:nth-child(1)) {\n margin-top: 1.5rem;\n }\n"], ["\n &:not(:nth-child(1)) {\n margin-top: 1.5rem;\n }\n"])));
16
- exports.ItemTitle = styled_components_1.default.strong(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n"])));
17
- exports.ItemContent = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n transition: all .3s ease;\n overflow: hidden;\n position: relative;\n > div{\n padding: 1rem 2rem 0 0;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n }\n"], ["\n transition: all .3s ease;\n overflow: hidden;\n position: relative;\n > div{\n padding: 1rem 2rem 0 0;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n }\n"])));
17
+ exports.ItemTitle = styled_components_1.default.strong(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n ", "\n\n @media only screen and ", " {\n font-weight: bold;\n font-size: 14px;\n line-height: 17px;\n }\n svg{\n path[stroke-width]{\n stroke-width : 1.5px;\n }\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n ", "\n\n @media only screen and ", " {\n font-weight: bold;\n font-size: 14px;\n line-height: 17px;\n }\n svg{\n path[stroke-width]{\n stroke-width : 1.5px;\n }\n }\n"])), function (props) { return props.size === "large" ? "\n font-weight: bold;\n font-size: 16px;\n line-height: 19px;\n " : "\n font-weight: bold;\n font-size: 14px;\n line-height: 17px;\n "; }, devices_1.devices.lg);
18
+ exports.ItemContent = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n transition: all .3s ease;\n overflow: hidden;\n position: relative;\n\n ", "\n @media only screen and ", " {\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n }\n > div{\n padding: 1rem 2rem 0 0;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n }\n"], ["\n transition: all .3s ease;\n overflow: hidden;\n position: relative;\n\n ", "\n @media only screen and ", " {\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n }\n > div{\n padding: 1rem 2rem 0 0;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n }\n"])), function (props) { return props.size === "large" ? "\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n " : "\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n "; }, devices_1.devices.lg);
18
19
  exports.Footer = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n box-sizing: border-box;\n display: block;\n margin-top: 1.5rem!important;\n"], ["\n box-sizing: border-box;\n display: block;\n margin-top: 1.5rem!important;\n"])));
19
20
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -9,7 +9,7 @@ var Accordion_styled_1 = require("./Accordion.styled");
9
9
  var Accordion_1 = require("./Accordion");
10
10
  var Icon_1 = __importDefault(require("../Icon/Icon"));
11
11
  var AccordionItem = function (props) {
12
- var title = props.title, content = props.content, index = props.index, collapseAll = props.collapseAll;
12
+ var title = props.title, content = props.content, index = props.index, collapseAll = props.collapseAll, size = props.size;
13
13
  var _a = (0, react_1.useContext)(Accordion_1.AccordionContext), active = _a.active, setActive = _a.setActive;
14
14
  var _b = (0, react_1.useState)(0), height = _b[0], setHeight = _b[1];
15
15
  var itemRef = (0, react_1.useRef)();
@@ -27,6 +27,6 @@ var AccordionItem = function (props) {
27
27
  setActiveItem(false);
28
28
  }
29
29
  };
30
- return ((0, jsx_runtime_1.jsxs)(Accordion_styled_1.Item, { children: [(0, jsx_runtime_1.jsxs)(Accordion_styled_1.ItemTitle, { onClick: handleCollapse, className: "body-bold-14-17", children: [(0, jsx_runtime_1.jsx)("div", { children: title }), (0, jsx_runtime_1.jsxs)("div", { children: [" ", (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (active === index || activeItem) ? 'NegativeSmall' : 'PlusSmall', width: "24px", height: "24px" }), " "] })] }), (0, jsx_runtime_1.jsx)(Accordion_styled_1.ItemContent, { ref: itemRef, style: { height: height }, active: (active === index || activeItem), className: "body-regular-14-17", children: (0, jsx_runtime_1.jsx)("div", { children: content }) })] }));
30
+ return ((0, jsx_runtime_1.jsxs)(Accordion_styled_1.Item, { children: [(0, jsx_runtime_1.jsxs)(Accordion_styled_1.ItemTitle, { size: size, onClick: handleCollapse, children: [(0, jsx_runtime_1.jsx)("div", { children: title }), (0, jsx_runtime_1.jsxs)("div", { children: [" ", (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (active === index || activeItem) ? 'NegativeSmall' : 'PlusSmall', width: "24px", height: "24px" }), " "] })] }), (0, jsx_runtime_1.jsx)(Accordion_styled_1.ItemContent, { size: size, ref: itemRef, style: { height: height }, active: (active === index || activeItem), children: (0, jsx_runtime_1.jsx)("div", { children: content }) })] }));
31
31
  };
32
32
  exports.default = AccordionItem;
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sizes = void 0;
4
+ exports.sizes = ['large', 'medium'];
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Default = void 0;
7
7
  var Accordion_1 = __importDefault(require("../Accordion"));
8
8
  var faq_json_1 = __importDefault(require("./../../../jsons/faq.json"));
9
+ var props_1 = require("../../Accordion/props");
9
10
  exports.default = {
10
11
  title: 'Components/Accordion',
11
12
  component: Accordion_1.default,
@@ -13,6 +14,7 @@ exports.default = {
13
14
  argTypes: {
14
15
  collapseAll: { control: 'boolean' },
15
16
  showLink: { control: 'boolean' },
17
+ size: { control: 'select', options: props_1.sizes },
16
18
  }
17
19
  };
18
20
  exports.Default = {
@@ -24,5 +26,6 @@ exports.Default = {
24
26
  activeIndex: null,
25
27
  linkText: "Daha Fazla Soru Göster",
26
28
  linkOnClick: function () { return console.log("test"); },
29
+ size: 'medium'
27
30
  },
28
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "krl-alfred",
3
- "version": "1.72.13",
3
+ "version": "1.72.15",
4
4
  "files": [
5
5
  "dist"
6
6
  ],