oolib 2.69.0 → 2.69.2

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.
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BannerInfo = exports.BannerAlert = void 0;
27
27
  var react_1 = __importStar(require("react"));
28
28
  var index_styled_1 = require("./index.styled");
29
+ var react_router_dom_1 = require("react-router-dom");
29
30
  var Buttons_1 = require("../Buttons");
30
31
  var icons_1 = require("../../icons");
31
32
  var Typo_1 = require("../Typo");
@@ -61,12 +62,17 @@ var Banner = function (_a) {
61
62
  handleRemove(e, id);
62
63
  }, 300);
63
64
  };
65
+ var genCTA = function (cta) {
66
+ var LinkWrapper = cta.to ? react_router_dom_1.Link : react_1.Fragment; //sometimes we wanna pass the cta as a 'to' string rather than a action function so that it is serializable
67
+ return (react_1.default.createElement(LinkWrapper, { to: cta.to },
68
+ react_1.default.createElement(Buttons_1.ButtonSecondary, { style: { marginTop: "0.5rem", marginBottom: "0.5rem" }, S: true, onClick: !cta.to && cta.action, invert: color === "dark" ? true : false }, cta === null || cta === void 0 ? void 0 : cta.text)));
69
+ };
64
70
  return (react_1.default.createElement(index_styled_1.BannerAnimateStyled, { key: id, ref: ContainerRef, height: height },
65
71
  react_1.default.createElement(index_styled_1.BannerWrapperStyled, { bottomStroke: bottomStroke, color: color },
66
72
  react_1.default.createElement(index_styled_1.BannerStyled, null,
67
73
  showIcon && react_1.default.createElement(DisplayIcon, { color: color }),
68
74
  react_1.default.createElement(Typo_1.SANS_2, null, msg),
69
- cta && (react_1.default.createElement(Buttons_1.ButtonSecondary, { style: { marginTop: "0.5rem", marginBottom: "0.5rem" }, S: true, onClick: cta.action, invert: color === "dark" ? true : false }, cta === null || cta === void 0 ? void 0 : cta.text))),
75
+ cta && genCTA(cta)),
70
76
  hideCloseButton !== true && react_1.default.createElement(Buttons_1.ButtonGhost, { S: true, icon: "X", invert: color === "dark" ? true : false, onClick: function (e) { return remove(e, id); } }))));
71
77
  };
72
78
  var BannerAlert = function (_a) {
@@ -43,7 +43,7 @@ exports.emptyStatesConfig = {
43
43
  img: "congratulationsImg",
44
44
  imgSize: 150,
45
45
  opacity: 1,
46
- title: "Content Published SuccessFully",
46
+ title: "Content Published Successfully",
47
47
  subTitle: " "
48
48
  },
49
49
  draftsListing: {
@@ -1,8 +1,9 @@
1
- export function EmptyStates({ preset, actionOnClick, additionalActionOnClick, titleStyle, subTitleStyle }: {
1
+ export function EmptyStates({ preset, actionOnClick, additionalActionOnClick, titleStyle, subTitleStyle, title: titleProp }: {
2
2
  preset: any;
3
3
  actionOnClick: any;
4
4
  additionalActionOnClick: any;
5
5
  titleStyle: any;
6
6
  subTitleStyle: any;
7
+ title: any;
7
8
  }): React.JSX.Element;
8
9
  import React from "react";
@@ -29,10 +29,11 @@ var congratulationsImg_svg_1 = __importDefault(require("../../assets/images/cong
29
29
  var searchDashBoardListing_svg_1 = __importDefault(require("../../assets/images/searchDashBoardListing.svg"));
30
30
  var dashboardListing_svg_1 = __importDefault(require("../../assets/images/dashboardListing.svg"));
31
31
  var styled_components_1 = __importDefault(require("styled-components"));
32
- var StyledContainer = (0, styled_components_1.default)(Container_1.Container)(templateObject_1 || (templateObject_1 = __makeTemplateObject([" \n padding: ", "; \n display: ", ";\n justify-content: 'center'; \n text-align: ", ";\n \n ", "{\n padding: ", ";\n }\n"], [" \n padding: ", "; \n display: ", ";\n justify-content: 'center'; \n text-align: ", ";\n \n ", "{\n padding: ", ";\n }\n"])), function (props) { return props.layout === "center" ? '2rem 0rem' : '4rem 0'; }, function (props) { return props.layout === "center" && "flex"; }, function (props) { return props.layout === "center" && "center"; }, (0, mixins_1.mediaQuery)("sm"), function (props) { return props.layout === "center" ? "4rem 0" : "6rem 0"; });
32
+ var StyledContainer = (0, styled_components_1.default)(Container_1.Container)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n display: ", ";\n justify-content: \"center\";\n text-align: ", ";\n\n ", " {\n padding: ", ";\n }\n"], ["\n padding: ", ";\n display: ", ";\n justify-content: \"center\";\n text-align: ", ";\n\n ", " {\n padding: ", ";\n }\n"])), function (props) { return (props.layout === "center" ? "2rem 0rem" : "4rem 0"); }, function (props) { return props.layout === "center" && "flex"; }, function (props) { return props.layout === "center" && "center"; }, (0, mixins_1.mediaQuery)("sm"), function (props) { return (props.layout === "center" ? "4rem 0" : "6rem 0"); });
33
33
  var EmptyStates = function (_a) {
34
- var preset = _a.preset, actionOnClick = _a.actionOnClick, additionalActionOnClick = _a.additionalActionOnClick, titleStyle = _a.titleStyle, subTitleStyle = _a.subTitleStyle;
35
- var _b = config_1.emptyStatesConfig[preset], img = _b.img, imgSize = _b.imgSize, title = _b.title, subTitle = _b.subTitle, action = _b.action, additionalAction = _b.additionalAction, layout = _b.layout, opacity = _b.opacity;
34
+ var preset = _a.preset, actionOnClick = _a.actionOnClick, additionalActionOnClick = _a.additionalActionOnClick, titleStyle = _a.titleStyle, subTitleStyle = _a.subTitleStyle, titleProp = _a.title;
35
+ var _b = config_1.emptyStatesConfig[preset], img = _b.img, imgSize = _b.imgSize, titleConfig = _b.title, subTitle = _b.subTitle, action = _b.action, additionalAction = _b.additionalAction, layout = _b.layout, opacity = _b.opacity;
36
+ var title = titleProp || titleConfig; //if a title prop is provided, it overrides title from config
36
37
  var imgConfig = {
37
38
  publishedListing: publishedListing_svg_1.default,
38
39
  contentListing: contentListing_svg_1.default,
@@ -44,22 +45,22 @@ var EmptyStates = function (_a) {
44
45
  mailBoxImg: mailBoxImg_svg_1.default,
45
46
  congratulationsImg: congratulationsImg_svg_1.default,
46
47
  searchDashBoardListing: searchDashBoardListing_svg_1.default,
47
- dashboardListing: dashboardListing_svg_1.default
48
+ dashboardListing: dashboardListing_svg_1.default,
48
49
  };
49
- var Title = (0, styled_components_1.default)(Typo_1.SERIF_5_6)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), titleStyle ? titleStyle : { marginTop: '2rem' });
50
- var SubTitle = (0, styled_components_1.default)(Typo_1.SANS_3_4)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n\n"], ["\n ", "\n\n"])), subTitleStyle ? subTitleStyle : { marginTop: '1rem' });
50
+ var Title = (0, styled_components_1.default)(Typo_1.SERIF_5_6)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), titleStyle ? titleStyle : { marginTop: "2rem" });
51
+ var SubTitle = (0, styled_components_1.default)(Typo_1.SANS_3_4)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), subTitleStyle ? subTitleStyle : { marginTop: "1rem" });
51
52
  return (react_1.default.createElement(StyledContainer, { layout: layout },
52
53
  react_1.default.createElement(Wrappers_1.Wrapper650, { style: { margin: layout === "center" ? "auto" : 0 } },
53
- img && (react_1.default.createElement("img", { src: imgConfig[img], alt: '', style: {
54
- opacity: opacity ? opacity : layout === "center" ? '0.6' : '0.5',
55
- height: imgSize ? imgSize + 'px' : '120px',
54
+ img && (react_1.default.createElement("img", { src: imgConfig[img], alt: "", style: {
55
+ opacity: opacity ? opacity : layout === "center" ? "0.6" : "0.5",
56
+ height: imgSize ? imgSize + "px" : "120px",
56
57
  } })),
57
58
  title && react_1.default.createElement(Title, null, title),
58
59
  subTitle && react_1.default.createElement(SubTitle, null, subTitle),
59
60
  additionalAction && (react_1.default.createElement(Paddings_1.PaddingTop10, null,
60
61
  react_1.default.createElement(Typo_1.SANS_3, null,
61
62
  react_1.default.createElement(OKELink_1.OKELink, { to: "#", onClick: additionalActionOnClick }, additionalAction.text))))),
62
- action && (react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: actionOnClick, style: { marginTop: '2rem', opacity: '1' } }, action === null || action === void 0 ? void 0 : action.btnText))));
63
+ action && (react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: actionOnClick, style: { marginTop: "2rem", opacity: "1" } }, action === null || action === void 0 ? void 0 : action.btnText))));
63
64
  };
64
65
  exports.EmptyStates = EmptyStates;
65
66
  var templateObject_1, templateObject_2, templateObject_3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.69.0",
3
+ "version": "2.69.2",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",