oolib 2.91.0 → 2.92.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.
Files changed (27) hide show
  1. package/dist/components/Dropdowns/DropdownMulti/index.js +1 -1
  2. package/dist/components/Dropdowns/DropdownSingle/index.js +1 -1
  3. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +2 -1
  4. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +3 -3
  5. package/dist/components/Dropdowns/comps/OptionContent/index.js +6 -4
  6. package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +5 -2
  7. package/dist/components/Dropdowns/comps/SelectDropdown/index.js +1 -1
  8. package/dist/components/Dropdowns/utils/genIcon.d.ts +5 -1
  9. package/dist/components/Dropdowns/utils/genIcon.js +3 -2
  10. package/dist/components/Dropdowns/utils/genProfileImg.js +1 -1
  11. package/dist/components/EmptyStates2/comps/EmptyStatesRenderer.d.ts +10 -0
  12. package/dist/components/EmptyStates2/comps/EmptyStatesRenderer.js +75 -0
  13. package/dist/components/EmptyStates2/config/index.d.ts +89 -0
  14. package/dist/components/EmptyStates2/config/index.js +237 -0
  15. package/dist/components/EmptyStates2/index.d.ts +7 -0
  16. package/dist/components/EmptyStates2/index.js +27 -0
  17. package/dist/components/Modals/Modal/index.d.ts +3 -1
  18. package/dist/components/Modals/Modal/index.js +5 -4
  19. package/dist/components/Modals/ModalConfirm/index.d.ts +3 -1
  20. package/dist/components/Modals/ModalConfirm/index.js +4 -4
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +2 -2
  23. package/package.json +1 -1
  24. package/dist/components/EmptyStates/config.d.ts +0 -135
  25. package/dist/components/EmptyStates/config.js +0 -144
  26. package/dist/components/EmptyStates/index.d.ts +0 -11
  27. package/dist/components/EmptyStates/index.js +0 -66
@@ -137,7 +137,7 @@ function DropdownMulti(_a) {
137
137
  if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
138
138
  return null;
139
139
  return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { return (0, genTagComp_1.genTagComp)(id, d, { display: true, invert: invert, theme: theme }); }))) : (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" } }, value.map(function (v, i) { return (react_1.default.createElement(react_1.Fragment, null,
140
- react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: v, invert: invert, injectComma: i !== value.length - 1 }))); })));
140
+ react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: v, invert: invert, injectComma: i !== value.length - 1, S: S }))); })));
141
141
  };
142
142
  var _e = (0, react_1.useState)(false), focusSelectTagsInput = _e[0], setFocusSelectTagsInput = _e[1];
143
143
  var genSelectTagsInput = function () { return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, __assign({}, {
@@ -159,7 +159,7 @@ function DropdownSingle(_a) {
159
159
  var genDisplayComp = function () {
160
160
  if (!value)
161
161
  return null;
162
- return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, invert: invert, theme: theme }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, __assign({}, { value: value, invert: invert })));
162
+ return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, invert: invert, theme: theme }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, __assign({}, { value: value, invert: invert, S: S })));
163
163
  };
164
164
  return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp", " ").concat(invert ? "-invert-" : ""), style: style },
165
165
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props) /** in other words, props. */)),
@@ -1,6 +1,7 @@
1
- export function DisplayCompSingle({ value, invert, injectComma }: {
1
+ export function DisplayCompSingle({ value, invert, injectComma, S }: {
2
2
  value: any;
3
3
  invert: any;
4
4
  injectComma: any;
5
+ S: any;
5
6
  }): React.JSX.Element;
6
7
  import React from "react";
@@ -23,14 +23,14 @@ var genLinkOrText_1 = require("../../utils/genLinkOrText");
23
23
  var styled_components_1 = require("styled-components");
24
24
  var genProfileImg_1 = require("../../utils/genProfileImg");
25
25
  var DisplayCompSingle = function (_a) {
26
- var value = _a.value, invert = _a.invert, injectComma = _a.injectComma;
26
+ var value = _a.value, invert = _a.invert, injectComma = _a.injectComma, S = _a.S;
27
27
  var theme = (0, styled_components_1.useTheme)();
28
28
  if (!value)
29
29
  return null;
30
30
  return (react_1.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: '1rem' } },
31
- (0, genIcon_1.genIcon)(value === null || value === void 0 ? void 0 : value.icon),
31
+ (0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, invert: invert, S: S }),
32
32
  (0, genProfileImg_1.genProfileImg)(__assign(__assign({}, value), { invert: invert, theme: theme })),
33
- (0, genLinkOrText_1.genLinkOrText)(value, function (display, link) { return (react_1.default.createElement(Typo_1.SANS_3, null,
33
+ (0, genLinkOrText_1.genLinkOrText)(value, function (display, link) { return (react_1.default.createElement(Typo_1.SANS_3, { invert: invert },
34
34
  link
35
35
  ? react_1.default.createElement(OKELink_1.OKELink, { invert: invert, to: link }, display)
36
36
  : display,
@@ -18,13 +18,15 @@ var OptionContent = function (_a) {
18
18
  var image = option.image, display = option.display, icon = option.icon, desc = option.desc, color = option.color;
19
19
  return (react_1.default.createElement("div", { style: {
20
20
  display: "flex",
21
- alignItems: "center",
21
+ alignItems: "flex-start",
22
22
  gap: "1rem",
23
23
  maxWidth: "36rem",
24
24
  } },
25
- image && (0, genProfileImg_1.genProfileImg)({ image: image, display: display, invert: invert, theme: theme }),
26
- icon && (0, genIcon_1.genIcon)(icon),
27
- color && (0, genColor_1.genColor)({ color: color }),
25
+ (image || icon || color) &&
26
+ react_1.default.createElement("div", { style: { marginTop: desc && '0.2rem', display: 'flex', alignContent: 'center' } },
27
+ image && (0, genProfileImg_1.genProfileImg)({ image: image, display: display, invert: invert, theme: theme }),
28
+ icon && (0, genIcon_1.genIcon)({ icon: icon, invert: invert, S: S }),
29
+ color && (0, genColor_1.genColor)({ color: color })),
28
30
  react_1.default.createElement("div", null,
29
31
  react_1.default.createElement(TypoComp, { invert: invert, semibold: desc ? true : false, className: "OKE-Dropdown__optionText ".concat(optionsClassName || "") }, (0, getText_1.getText)(display)),
30
32
  desc && (react_1.default.createElement(TypoComp, { invert: invert, className: "OKE-Dropdown__optionDesc" }, (0, getText_1.getText)(desc))))));
@@ -33,10 +33,13 @@ var themes_1 = require("../../../../themes");
33
33
  var mixins_1 = require("../../../../themes/mixins");
34
34
  var utilsOolib_1 = require("../../../../utilsOolib");
35
35
  var globalVariables_1 = require("../../../../globalStyles/globalVariables");
36
- exports.StyledOption = styled_components_1.default.li(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 1rem 2rem;\n ", "\n ", ";\n\n background-color: ", ";\n\n ", "\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: 1rem 2rem;\n ", "\n ", ";\n\n background-color: ", ";\n\n ", "\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
36
+ exports.StyledOption = styled_components_1.default.li(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: ", ";\n ", "\n ", ";\n\n background-color: ", ";\n\n ", "\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: ", ";\n ", "\n ", ";\n\n background-color: ", ";\n\n ", "\n\n &:first-of-type {\n margin-top: 1rem;\n }\n\n &:last-of-type {\n margin-bottom: 1rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
37
+ var S = _a.S;
38
+ return S ? '0.5rem 2rem' : ' 1rem 2rem';
39
+ }, function (_a) {
37
40
  var S = _a.S;
38
41
  return !S
39
- ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n \n min-height: 4rem;\n "], ["\n \n min-height: 4rem;\n "]))) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 3rem;\n "], ["\n height: 3rem;\n "])));
42
+ ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n \n min-height: 4rem;\n "], ["\n \n min-height: 4rem;\n "]))) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n /* height: 3rem; */\n "], ["\n /* height: 3rem; */\n "])));
40
43
  }, (0, mixins_1.transition)('background-color'), function (_a) {
41
44
  var isFocussed = _a.isFocussed, isSelected = _a.isSelected, theme = _a.theme, invert = _a.invert;
42
45
  return isSelected
@@ -49,7 +49,7 @@ var SelectDropdown = function (_a) {
49
49
  react_1.default.createElement("div", null,
50
50
  react_1.default.createElement("div", { style: { display: "flex", gap: "1rem", alignItems: "center" } },
51
51
  showElem('color') && (0, genColor_1.genColor)({ color: value === null || value === void 0 ? void 0 : value.color }),
52
- showElem("icon") && (0, genIcon_1.genIcon)(value === null || value === void 0 ? void 0 : value.icon),
52
+ showElem("icon") && (0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, invert: invert, S: S }),
53
53
  showElem("display") && (react_1.default.createElement(TypoComp
54
54
  // semibold={
55
55
  // dropdownSelectText.desc && showElem("desc") ? true : undefined
@@ -1,2 +1,6 @@
1
- export function genIcon(icon: any): React.JSX.Element;
1
+ export function genIcon({ icon, invert, S }: {
2
+ icon: any;
3
+ invert: any;
4
+ S: any;
5
+ }): React.JSX.Element;
2
6
  import React from "react";
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.genIcon = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var icons_1 = require("../../../icons");
9
- var genIcon = function (icon) {
9
+ var genIcon = function (_a) {
10
+ var icon = _a.icon, invert = _a.invert, S = _a.S;
10
11
  if (!icon)
11
12
  return null;
12
13
  var IconComp = icons_1.icons[icon];
13
14
  if (!IconComp)
14
15
  return null;
15
- return react_1.default.createElement(IconComp, { size: 20 });
16
+ return react_1.default.createElement(IconComp, { size: S ? 15 : 20, style: { color: invert ? 'white' : 'unset' } });
16
17
  };
17
18
  exports.genIcon = genIcon;
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
8
8
  var ProfileImageInput_1 = require("../../ImageInput/derivedComps/ProfileImageInput");
9
9
  var genProfileImg = function (_a) {
10
10
  var image = _a.image, display = _a.display, invert = _a.invert;
11
- return (react_1.default.createElement("div", { style: { flex: "0 0 auto" } },
11
+ return (react_1.default.createElement("div", { style: { flex: "0 0 auto", display: 'flex', alignItems: 'start' }, id: "test" },
12
12
  react_1.default.createElement(ProfileImageInput_1.ProfileImageInput, { readOnly: true, value: image, imageTitle: display, size: 20, invert: invert })));
13
13
  };
14
14
  exports.genProfileImg = genProfileImg;
@@ -0,0 +1,10 @@
1
+ export function EmptyStatesRenderer({ image: _image, align, title: _title, subtitle: _subtitle, link, button, onClick, }: {
2
+ image: any;
3
+ align?: string;
4
+ title: any;
5
+ subtitle: any;
6
+ link: any;
7
+ button: any;
8
+ onClick: any;
9
+ }): React.JSX.Element;
10
+ import React from "react";
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.EmptyStatesRenderer = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var styled_components_1 = __importDefault(require("styled-components"));
24
+ var congratulationsImg_svg_1 = __importDefault(require("../../../assets/images/congratulationsImg.svg"));
25
+ var contentListing_svg_1 = __importDefault(require("../../../assets/images/contentListing.svg"));
26
+ var dashboardListing_svg_1 = __importDefault(require("../../../assets/images/dashboardListing.svg"));
27
+ var draftsListing_svg_1 = __importDefault(require("../../../assets/images/draftsListing.svg"));
28
+ var inPublishedSearch_svg_1 = __importDefault(require("../../../assets/images/inPublishedSearch.svg"));
29
+ var learningModule_svg_1 = __importDefault(require("../../../assets/images/learningModule.svg"));
30
+ var mailBoxImg_svg_1 = __importDefault(require("../../../assets/images/mailBoxImg.svg"));
31
+ var moderationListing_svg_1 = __importDefault(require("../../../assets/images/moderationListing.svg"));
32
+ var publishedListing_svg_1 = __importDefault(require("../../../assets/images/publishedListing.svg"));
33
+ var searchDashBoardListing_svg_1 = __importDefault(require("../../../assets/images/searchDashBoardListing.svg"));
34
+ var searchListing_svg_1 = __importDefault(require("../../../assets/images/searchListing.svg"));
35
+ var Buttons_1 = require("../../Buttons");
36
+ var Container_1 = require("../../Container");
37
+ var OKELink_1 = require("../../OKELink");
38
+ var Typo_1 = require("../../Typo");
39
+ var Wrappers_1 = require("../../Wrappers");
40
+ var mixins_1 = require("../../../themes/mixins");
41
+ var StyledFlexWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: ", ";\n gap: 2rem;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: ", ";\n gap: 2rem;\n"])), function (_a) {
42
+ var align = _a.align;
43
+ return (align === "center" ? "center" : "flex-start");
44
+ });
45
+ var StyledContainer = (0, styled_components_1.default)(Container_1.Container)(templateObject_2 || (templateObject_2 = __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.align === "center" ? "2rem 0rem" : "4rem 0"); }, function (props) { return props.align === "center" && "flex"; }, function (props) { return props.align === "center" && "center"; }, (0, mixins_1.mediaQuery)("sm"), function (props) { return (props.align === "center" ? "4rem 0" : "6rem 0"); });
46
+ var EmptyStatesRenderer = function (_a) {
47
+ var _image = _a.image, _b = _a.align, align = _b === void 0 ? "center" : _b, _title = _a.title, _subtitle = _a.subtitle, link = _a.link, button = _a.button, onClick = _a.onClick;
48
+ var imagesLookup = {
49
+ publishedListing: publishedListing_svg_1.default,
50
+ contentListing: contentListing_svg_1.default,
51
+ draftsListing: draftsListing_svg_1.default,
52
+ moderationListing: moderationListing_svg_1.default,
53
+ inPublishedSearch: inPublishedSearch_svg_1.default,
54
+ learningModule: learningModule_svg_1.default,
55
+ searchListing: searchListing_svg_1.default,
56
+ mailBoxImg: mailBoxImg_svg_1.default,
57
+ congratulationsImg: congratulationsImg_svg_1.default,
58
+ searchDashBoardListing: searchDashBoardListing_svg_1.default,
59
+ dashboardListing: dashboardListing_svg_1.default,
60
+ };
61
+ //basically image prop can be either the src string or an object with more properties
62
+ var image = typeof _image === "string" ? { src: _image } : _image; // src + style
63
+ var title = typeof _title === "string" ? { text: _title } : _title; // text + style
64
+ var subtitle = typeof _subtitle === "string" ? { text: _subtitle } : _subtitle; // text + style
65
+ return (react_1.default.createElement(StyledContainer, { align: align },
66
+ react_1.default.createElement(Wrappers_1.Wrapper650, { style: { margin: align === "center" ? "auto" : 0 } },
67
+ (image === null || image === void 0 ? void 0 : image.src) && (react_1.default.createElement("img", { src: imagesLookup[image.src], alt: "", style: __assign({ opacity: 0.5, height: "12rem", width: "auto" }, (image.style || {})) })),
68
+ (title === null || title === void 0 ? void 0 : title.text) && (react_1.default.createElement(Typo_1.SERIF_5_6, { style: title.style }, title.text)),
69
+ (subtitle === null || subtitle === void 0 ? void 0 : subtitle.text) && (react_1.default.createElement(Typo_1.SANS_3_4, { style: subtitle.style }, subtitle.text)),
70
+ link && (react_1.default.createElement(Typo_1.SANS_3, { style: { paddingTop: '1rem' } },
71
+ react_1.default.createElement(OKELink_1.OKELink, { text: link.text, onClick: onClick }))),
72
+ button && (react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: onClick, style: { marginTop: "2rem" } }, button.text)))));
73
+ };
74
+ exports.EmptyStatesRenderer = EmptyStatesRenderer;
75
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,89 @@
1
+ export function getConfig(preset: any, contentTypeTitle: any, commaSeparatedTags: any): {
2
+ align: string;
3
+ image: {
4
+ src: string;
5
+ style: {
6
+ height: number;
7
+ opacity: number;
8
+ };
9
+ };
10
+ title: string;
11
+ subtitle: string;
12
+ imageSize?: undefined;
13
+ button?: undefined;
14
+ link?: undefined;
15
+ } | {
16
+ align: string;
17
+ image: {
18
+ src: string;
19
+ style: {
20
+ height: number;
21
+ opacity: number;
22
+ };
23
+ };
24
+ imageSize: number;
25
+ title: string;
26
+ subtitle: string;
27
+ button?: undefined;
28
+ link?: undefined;
29
+ } | {
30
+ align: string;
31
+ image: {
32
+ src: string;
33
+ style: {
34
+ height: number;
35
+ opacity?: undefined;
36
+ };
37
+ };
38
+ title: string;
39
+ subtitle: string;
40
+ button: {
41
+ text: string;
42
+ };
43
+ imageSize?: undefined;
44
+ link?: undefined;
45
+ } | {
46
+ align: string;
47
+ image: {
48
+ src: string;
49
+ style: {
50
+ height: number;
51
+ opacity?: undefined;
52
+ };
53
+ };
54
+ title: string;
55
+ subtitle: string;
56
+ imageSize?: undefined;
57
+ button?: undefined;
58
+ link?: undefined;
59
+ } | {
60
+ align: string;
61
+ image: {
62
+ src: string;
63
+ style: {
64
+ opacity: number;
65
+ height?: undefined;
66
+ };
67
+ };
68
+ title: string;
69
+ subtitle: string;
70
+ link: {
71
+ text: string;
72
+ };
73
+ imageSize?: undefined;
74
+ button?: undefined;
75
+ } | {
76
+ align: string;
77
+ image: {
78
+ src: string;
79
+ style: {
80
+ opacity: number;
81
+ height?: undefined;
82
+ };
83
+ };
84
+ title: string;
85
+ subtitle: string;
86
+ imageSize?: undefined;
87
+ button?: undefined;
88
+ link?: undefined;
89
+ };
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfig = void 0;
4
+ var getConfig = function (preset, contentTypeTitle, commaSeparatedTags) {
5
+ switch (preset) {
6
+ case "multipleCollectionsListing":
7
+ return {
8
+ align: "center",
9
+ image: {
10
+ src: "contentListing",
11
+ style: {
12
+ height: 80,
13
+ opacity: 0.6,
14
+ },
15
+ },
16
+ title: "No tags added",
17
+ subtitle: "Publishing under ".concat(commaSeparatedTags, " shows all tagged content here, You can edit published content in future, when required."),
18
+ };
19
+ case "multiplePublishingListing":
20
+ return {
21
+ align: "center",
22
+ image: {
23
+ src: "contentListing",
24
+ style: {
25
+ height: 80,
26
+ opacity: 0.6,
27
+ },
28
+ },
29
+ title: "No Content Added",
30
+ subtitle: "Once you publish content on the platform, it shows up here. You can edit published content in future, when required. ",
31
+ };
32
+ case "singlePublishingListing":
33
+ return {
34
+ align: "center",
35
+ image: {
36
+ src: "contentListing",
37
+ style: {
38
+ height: 80,
39
+ opacity: 0.6,
40
+ },
41
+ },
42
+ title: "No ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " Added"),
43
+ subtitle: "Publishing under ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required."),
44
+ };
45
+ case "singleCollectionsListing":
46
+ return {
47
+ align: "center",
48
+ image: {
49
+ src: "contentListing",
50
+ style: {
51
+ height: 80,
52
+ opacity: 0.6,
53
+ },
54
+ },
55
+ imageSize: 80,
56
+ title: "No ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " Added"),
57
+ subtitle: "Publishing under ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required."),
58
+ };
59
+ case "profileListing":
60
+ return {
61
+ align: "center",
62
+ image: {
63
+ src: "contentListing",
64
+ style: {
65
+ height: 80,
66
+ opacity: 0.6,
67
+ },
68
+ },
69
+ title: "No Profile Added",
70
+ subtitle: "Once you publish any profile on the platform, it shows up here. You can edit profile content in future, when required. ",
71
+ };
72
+ case "notificationEmpty":
73
+ return {
74
+ align: "center",
75
+ image: {
76
+ src: "mailBoxImg",
77
+ style: {
78
+ height: 80,
79
+ opacity: 0.6,
80
+ },
81
+ },
82
+ title: "No Notifications Yet",
83
+ subtitle: "All updates,notifications and alerts will be displayed here ",
84
+ };
85
+ case "dashboardListing":
86
+ return {
87
+ align: "center",
88
+ image: {
89
+ src: "dashboardListing",
90
+ style: {
91
+ height: 80,
92
+ opacity: 0.6,
93
+ },
94
+ },
95
+ title: "No Data Added",
96
+ subtitle: "Currently, no data is available. Start exploring insights once data is populated ",
97
+ };
98
+ case "successFullyPublish":
99
+ return {
100
+ align: "center",
101
+ image: {
102
+ src: "congratulationsImg",
103
+ style: {
104
+ height: 150,
105
+ opacity: 1,
106
+ },
107
+ },
108
+ title: "Content Published Successfully",
109
+ subtitle: " ",
110
+ };
111
+ case "draftsListing":
112
+ return {
113
+ align: "left",
114
+ image: {
115
+ src: "draftsListing",
116
+ style: {
117
+ height: 80,
118
+ },
119
+ },
120
+ title: "No Drafts Found",
121
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
122
+ button: {
123
+ // route: "/choose-template",
124
+ text: "Start Writing",
125
+ },
126
+ };
127
+ case "publishedListing":
128
+ return {
129
+ align: "left",
130
+ image: {
131
+ src: "publishedListing",
132
+ style: {
133
+ height: 80,
134
+ },
135
+ },
136
+ title: "No published content found",
137
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
138
+ button: {
139
+ // route: "/choose-template",
140
+ text: "Start Writing",
141
+ },
142
+ };
143
+ case "inModerationListing":
144
+ return {
145
+ align: "left",
146
+ image: {
147
+ src: "moderationListing",
148
+ style: {
149
+ height: 80,
150
+ },
151
+ },
152
+ title: "No content sent for moderation",
153
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
154
+ button: {
155
+ // route: "/choose-template",
156
+ text: "Start Writing",
157
+ },
158
+ };
159
+ case "underMyModeration":
160
+ return {
161
+ align: "left",
162
+ image: {
163
+ src: "moderationListing",
164
+ style: {
165
+ height: 80,
166
+ },
167
+ },
168
+ title: "No published content under my moderation",
169
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
170
+ };
171
+ case "underOthersModeration":
172
+ return {
173
+ align: "left",
174
+ image: {
175
+ src: "moderationListing",
176
+ style: {
177
+ height: 80,
178
+ },
179
+ },
180
+ title: "No published content under others moderation",
181
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
182
+ };
183
+ case "awaitingMod":
184
+ return {
185
+ align: "left",
186
+ image: {
187
+ src: "moderationListing",
188
+ style: {
189
+ height: 80,
190
+ },
191
+ },
192
+ title: "No published content under awaiting moderation",
193
+ subtitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
194
+ };
195
+ case "searchListing":
196
+ return {
197
+ align: "center",
198
+ image: {
199
+ src: "searchListing",
200
+ style: {
201
+ opacity: 0.6,
202
+ },
203
+ },
204
+ title: "Cant find any content for ".concat(contentTypeTitle),
205
+ subtitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly",
206
+ link: {
207
+ // onClick: action,
208
+ text: "Clear Search",
209
+ },
210
+ };
211
+ case "searchDashBoardListing":
212
+ return {
213
+ align: "center",
214
+ image: {
215
+ src: "searchDashBoardListing",
216
+ style: {
217
+ opacity: 0.6,
218
+ },
219
+ },
220
+ title: "No search results found",
221
+ subtitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly ",
222
+ };
223
+ case "learningModule":
224
+ return {
225
+ align: "center",
226
+ image: {
227
+ src: "learningModule",
228
+ style: {
229
+ opacity: 0.6,
230
+ },
231
+ },
232
+ title: "No lesson added",
233
+ subtitle: "Looks like no lesson module has been assigned to you. Reach out to your Change leader and discuss what modules you'd like to study. ",
234
+ };
235
+ }
236
+ };
237
+ exports.getConfig = getConfig;
@@ -0,0 +1,7 @@
1
+ export function EmptyStates({ preset, contentTypeTitle, tags, onClick, }: {
2
+ preset?: string;
3
+ contentTypeTitle: any;
4
+ tags: any;
5
+ onClick: any;
6
+ }): React.JSX.Element;
7
+ import React from "react";
@@ -0,0 +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.EmptyStates = void 0;
18
+ var react_1 = __importDefault(require("react"));
19
+ var EmptyStatesRenderer_1 = require("./comps/EmptyStatesRenderer");
20
+ var config_1 = require("./config");
21
+ var EmptyStates = function (_a) {
22
+ var _b = _a.preset, preset = _b === void 0 ? "multiplePublishingListing" : _b, contentTypeTitle = _a.contentTypeTitle, tags = _a.tags, onClick = _a.onClick;
23
+ var commaSeparatedTags = tags === null || tags === void 0 ? void 0 : tags.map(function (item) { return item.toLowerCase(); }).join(',');
24
+ var _c = (0, config_1.getConfig)(preset, contentTypeTitle, commaSeparatedTags), image = _c.image, title = _c.title, subtitle = _c.subtitle, link = _c.link, button = _c.button, align = _c.align;
25
+ return (react_1.default.createElement(EmptyStatesRenderer_1.EmptyStatesRenderer, __assign({}, { image: image, align: align, title: title, subtitle: subtitle, link: link, button: button, onClick: onClick })));
26
+ };
27
+ exports.EmptyStates = EmptyStates;
@@ -1,4 +1,4 @@
1
- export function Modal({ title, onClose, children, linkTo, desktopWidth, headerStyle, subtitle, fitToContentHeight, invert, overflowVisible, showActionPanel, onCloseText, onConfirm, onConfirmText, alignActions }: {
1
+ export function Modal({ title, onClose, children, linkTo, desktopWidth, headerStyle, subtitle, fitToContentHeight, invert, overflowVisible, showActionPanel, onCloseText, onConfirm, showCloseBtn, onConfirmText, showConfirmBtn, alignActions }: {
2
2
  title: any;
3
3
  onClose: any;
4
4
  children: any;
@@ -12,6 +12,8 @@ export function Modal({ title, onClose, children, linkTo, desktopWidth, headerSt
12
12
  showActionPanel?: boolean;
13
13
  onCloseText?: string;
14
14
  onConfirm: any;
15
+ showCloseBtn?: boolean;
15
16
  onConfirmText?: string;
17
+ showConfirmBtn?: boolean;
16
18
  alignActions?: string;
17
19
  }): any;
@@ -48,12 +48,12 @@ var Divider_1 = require("../../Divider");
48
48
  var Modal = function (_a) {
49
49
  var title = _a.title, onClose = _a.onClose, children = _a.children, linkTo = _a.linkTo, _b = _a.desktopWidth, desktopWidth = _b === void 0 ? "80%" : _b, _c = _a.headerStyle, headerStyle = _c === void 0 ? "style1" : _c, subtitle = _a.subtitle, // used only in header style 2
50
50
  _d = _a.fitToContentHeight, // used only in header style 2
51
- fitToContentHeight = _d === void 0 ? false : _d, invert = _a.invert, overflowVisible = _a.overflowVisible, _e = _a.showActionPanel, showActionPanel = _e === void 0 ? false : _e, _f = _a.onCloseText, onCloseText = _f === void 0 ? "Close" : _f, onConfirm = _a.onConfirm, _g = _a.onConfirmText, onConfirmText = _g === void 0 ? "Confirm" : _g, _h = _a.alignActions, alignActions = _h === void 0 ? "right" : _h;
51
+ fitToContentHeight = _d === void 0 ? false : _d, invert = _a.invert, overflowVisible = _a.overflowVisible, _e = _a.showActionPanel, showActionPanel = _e === void 0 ? false : _e, _f = _a.onCloseText, onCloseText = _f === void 0 ? "Close" : _f, onConfirm = _a.onConfirm, _g = _a.showCloseBtn, showCloseBtn = _g === void 0 ? true : _g, _h = _a.onConfirmText, onConfirmText = _h === void 0 ? "Confirm" : _h, _j = _a.showConfirmBtn, showConfirmBtn = _j === void 0 ? true : _j, _k = _a.alignActions, alignActions = _k === void 0 ? "right" : _k;
52
52
  var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
53
53
  var handleClose = function () { return onClose(); };
54
54
  var initAnimPos = { marginTop: "100vh", opacity: 0 };
55
55
  var endAnimPos = { marginTop: 0, opacity: 1 };
56
- var _j = (0, react_1.useState)(endAnimPos), animPos = _j[0], setAnimPos = _j[1];
56
+ var _l = (0, react_1.useState)(endAnimPos), animPos = _l[0], setAnimPos = _l[1];
57
57
  (0, react_1.useEffect)(function () {
58
58
  document.body.style.overflow = "hidden";
59
59
  return function () { return (document.body.style.overflow = "unset"); };
@@ -83,10 +83,11 @@ var Modal = function (_a) {
83
83
  react_1.default.createElement("div", { style: { position: 'sticky', bottom: headerStyle === 'style1' ? 0 : '2.2rem' } },
84
84
  react_1.default.createElement(Divider_1.Divider, null),
85
85
  react_1.default.createElement(styled_1.StyledActionButtonsWrapper, { alignActions: alignActions },
86
- typeof onConfirm === 'function'
86
+ showConfirmBtn &&
87
+ typeof onConfirm === 'function'
87
88
  ? react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: onConfirm }, onConfirmText) // In some cases we want to pass button directly to the component as prop
88
89
  : onConfirm,
89
- react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: onClose }, onCloseText)))))); };
90
+ showCloseBtn && react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: onClose }, onCloseText)))))); };
90
91
  return ((0, react_dom_1.createPortal)(react_1.default.createElement(styled_1.StyledModalLargeBg, null,
91
92
  react_1.default.createElement(styled_1.StyledModalLargeBgColor, { initial: { opacity: initAnimPos.opacity }, animate: { opacity: animPos.opacity }, transition: {
92
93
  type: "tween",
@@ -1,9 +1,11 @@
1
- export function ModalConfirm({ title, subTitle, children, onClose, onCloseText, onConfirm, onConfirmText, alignActions }: {
1
+ export function ModalConfirm({ title, subTitle, children, onClose, onCloseText, showConfirmBtn, showCloseBtn, onConfirm, onConfirmText, alignActions }: {
2
2
  title: any;
3
3
  subTitle: any;
4
4
  children: any;
5
5
  onClose: any;
6
6
  onCloseText?: string;
7
+ showConfirmBtn?: boolean;
8
+ showCloseBtn?: boolean;
7
9
  onConfirm: any;
8
10
  onConfirmText?: string;
9
11
  alignActions?: string;
@@ -32,11 +32,11 @@ var Buttons_1 = require("../../Buttons");
32
32
  var Typo_1 = require("../../Typo");
33
33
  var styled_1 = require("./styled");
34
34
  var ModalConfirm = function (_a) {
35
- var title = _a.title, subTitle = _a.subTitle, children = _a.children, onClose = _a.onClose, _b = _a.onCloseText, onCloseText = _b === void 0 ? "Cancel" : _b, onConfirm = _a.onConfirm, _c = _a.onConfirmText, onConfirmText = _c === void 0 ? "Delete" : _c, _d = _a.alignActions, alignActions = _d === void 0 ? "left" : _d;
35
+ var title = _a.title, subTitle = _a.subTitle, children = _a.children, onClose = _a.onClose, _b = _a.onCloseText, onCloseText = _b === void 0 ? "Cancel" : _b, _c = _a.showConfirmBtn, showConfirmBtn = _c === void 0 ? true : _c, _d = _a.showCloseBtn, showCloseBtn = _d === void 0 ? true : _d, onConfirm = _a.onConfirm, _e = _a.onConfirmText, onConfirmText = _e === void 0 ? "Delete" : _e, _f = _a.alignActions, alignActions = _f === void 0 ? "left" : _f;
36
36
  var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
37
37
  var initAnimPos = { marginTop: "100vh", opacity: 0, translateY: "100%" };
38
38
  var endAnimPos = { marginTop: 0, opacity: 1, translateY: 0 };
39
- var _e = (0, react_1.useState)(endAnimPos), animPos = _e[0], setAnimPos = _e[1];
39
+ var _g = (0, react_1.useState)(endAnimPos), animPos = _g[0], setAnimPos = _g[1];
40
40
  (0, react_1.useEffect)(function () {
41
41
  document.body.style.overflow = "hidden";
42
42
  return function () { return (document.body.style.overflow = "unset"); };
@@ -52,8 +52,8 @@ var ModalConfirm = function (_a) {
52
52
  react_1.default.createElement(SubTitleText, null, subTitle))),
53
53
  react_1.default.createElement("div", { style: { marginTop: (title || subTitle) && "2rem" } }, children ? children : null),
54
54
  react_1.default.createElement(styled_1.StyledFlexWrapper, { style: { marginTop: (children) && "2rem" }, alignActions: alignActions },
55
- react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: onConfirm }, onConfirmText),
56
- react_1.default.createElement(Buttons_1.ButtonSecondary, { onClick: onClose }, onCloseText))))); };
55
+ showConfirmBtn && react_1.default.createElement(Buttons_1.ButtonPrimary, { onClick: onConfirm }, onConfirmText),
56
+ showCloseBtn && react_1.default.createElement(Buttons_1.ButtonSecondary, { onClick: onClose }, onCloseText))))); };
57
57
  return ((0, react_dom_1.createPortal)(react_1.default.createElement(styled_1.StyledModalConfirm, { initial: { opacity: initAnimPos.opacity }, animate: { opacity: animPos.opacity }, transition: { type: "tween", ease: "easeOut" }, onClick: function () { return onClose(); } }, screenWidth < (0, mixins_1.getBreakPoint)("sm") ? (react_1.default.createElement(styled_1.StyledModalConfirmContentWrapper, { initial: initAnimPos, animate: animPos, transition: {
58
58
  type: "tween",
59
59
  ease: "easeOut",
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export { ModalConfirm } from "./components/Modals/ModalConfirm";
31
31
  export { ModalForms } from "./components/Modals/derivedComps/ModalForms";
32
32
  export { Modal } from "./components/Modals/Modal";
33
33
  export { ModalSmall } from "./components/Modals/derivedComps/ModalSmall";
34
- export { EmptyStates } from "./components/EmptyStates";
34
+ export { EmptyStates } from "./components/EmptyStates2";
35
35
  export { HomeCover } from "./components/HomeCover";
36
36
  export { PageScrollIndicator } from "./components/PageScrollIndicator";
37
37
  export { BarChart } from "./components/dataViz/comps/BarChart";
package/dist/index.js CHANGED
@@ -76,8 +76,8 @@ var Modal_1 = require("./components/Modals/Modal");
76
76
  Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return Modal_1.Modal; } });
77
77
  var ModalSmall_1 = require("./components/Modals/derivedComps/ModalSmall");
78
78
  Object.defineProperty(exports, "ModalSmall", { enumerable: true, get: function () { return ModalSmall_1.ModalSmall; } });
79
- var EmptyStates_1 = require("./components/EmptyStates");
80
- Object.defineProperty(exports, "EmptyStates", { enumerable: true, get: function () { return EmptyStates_1.EmptyStates; } });
79
+ var EmptyStates2_1 = require("./components/EmptyStates2");
80
+ Object.defineProperty(exports, "EmptyStates", { enumerable: true, get: function () { return EmptyStates2_1.EmptyStates; } });
81
81
  var HomeCover_1 = require("./components/HomeCover");
82
82
  Object.defineProperty(exports, "HomeCover", { enumerable: true, get: function () { return HomeCover_1.HomeCover; } });
83
83
  var PageScrollIndicator_1 = require("./components/PageScrollIndicator");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.91.0",
3
+ "version": "2.92.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,135 +0,0 @@
1
- export function emptyStatesConfig({ contentTypeTitle, tags }?: {
2
- contentTypeTitle?: string;
3
- tags?: any[];
4
- }): {
5
- multipleCollectionsListing: {
6
- layout: string;
7
- img: string;
8
- imgSize: number;
9
- title: string;
10
- subTitle: string;
11
- };
12
- singlePublishingListing: {
13
- layout: string;
14
- img: string;
15
- imgSize: number;
16
- title: string;
17
- subTitle: string;
18
- };
19
- multiplePublishingListing: {
20
- layout: string;
21
- img: string;
22
- imgSize: number;
23
- title: string;
24
- subTitle: string;
25
- };
26
- singleCollectionsListing: {
27
- layout: string;
28
- img: string;
29
- imgSize: number;
30
- title: string;
31
- subTitle: string;
32
- };
33
- profileListing: {
34
- layout: string;
35
- img: string;
36
- imgSize: number;
37
- title: string;
38
- subTitle: string;
39
- };
40
- notificationEmpty: {
41
- layout: string;
42
- img: string;
43
- imgSize: number;
44
- opacity: number;
45
- title: string;
46
- subTitle: string;
47
- };
48
- dashboardListing: {
49
- layout: string;
50
- img: string;
51
- imgSize: number;
52
- title: string;
53
- subTitle: string;
54
- };
55
- successFullyPublish: {
56
- layout: string;
57
- img: string;
58
- imgSize: number;
59
- opacity: number;
60
- title: string;
61
- subTitle: string;
62
- };
63
- draftsListing: {
64
- layout: string;
65
- img: string;
66
- imgSize: number;
67
- title: string;
68
- subTitle: string;
69
- action: {
70
- btnText: string;
71
- };
72
- };
73
- publishedListing: {
74
- layout: string;
75
- img: string;
76
- imgSize: number;
77
- title: string;
78
- subTitle: string;
79
- action: {
80
- btnText: string;
81
- };
82
- };
83
- inModerationListing: {
84
- layout: string;
85
- img: string;
86
- imgSize: number;
87
- title: string;
88
- subTitle: string;
89
- action: {
90
- btnText: string;
91
- };
92
- };
93
- underMyModeration: {
94
- layout: string;
95
- img: string;
96
- imgSize: number;
97
- title: string;
98
- subTitle: string;
99
- };
100
- underOthersModeration: {
101
- layout: string;
102
- img: string;
103
- imgSize: number;
104
- title: string;
105
- subTitle: string;
106
- };
107
- awaitingMod: {
108
- layout: string;
109
- img: string;
110
- imgSize: number;
111
- title: string;
112
- subTitle: string;
113
- };
114
- searchListing: {
115
- layout: string;
116
- img: string;
117
- title: string;
118
- subTitle: string;
119
- additionalAction: {
120
- text: string;
121
- };
122
- };
123
- searchDashBoardListing: {
124
- layout: string;
125
- img: string;
126
- title: string;
127
- subTitle: string;
128
- };
129
- learningModule: {
130
- layout: string;
131
- img: string;
132
- title: string;
133
- subTitle: string;
134
- };
135
- };
@@ -1,144 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.emptyStatesConfig = void 0;
4
- var emptyStatesConfig = function (_a) {
5
- var _b = _a === void 0 ? {} : _a, _c = _b.contentTypeTitle, contentTypeTitle = _c === void 0 ? "default" : _c, _d = _b.tags, tags = _d === void 0 ? [] : _d;
6
- var commaSeparatedTags = tags.map(function (item) { return item.toLowerCase(); }).join(',');
7
- return {
8
- multipleCollectionsListing: {
9
- layout: "center",
10
- img: "contentListing",
11
- imgSize: 80,
12
- title: "No tags added",
13
- subTitle: "Publishing under ".concat(commaSeparatedTags, " shows all tagged content here, You can edit published content in future, when required.")
14
- },
15
- singlePublishingListing: {
16
- layout: "center",
17
- img: "contentListing",
18
- imgSize: 80,
19
- title: "No ".concat(contentTypeTitle.toLowerCase(), " Added"),
20
- subTitle: "Publishing under ".concat(contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required.")
21
- },
22
- multiplePublishingListing: {
23
- layout: "center",
24
- img: "contentListing",
25
- imgSize: 80,
26
- title: "No Content Added",
27
- subTitle: "Once you publish content on the platform, it shows up here. You can edit published content in future, when required. "
28
- },
29
- singleCollectionsListing: {
30
- layout: "center",
31
- img: "contentListing",
32
- imgSize: 80,
33
- title: "No ".concat(contentTypeTitle.toLowerCase(), " Added"),
34
- subTitle: "Publishing under ".concat(contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required.")
35
- },
36
- profileListing: {
37
- layout: "center",
38
- img: "contentListing",
39
- imgSize: 80,
40
- title: "No Profile Added",
41
- subTitle: "Once you publish any profile on the platform, it shows up here. You can edit profile content in future, when required. "
42
- },
43
- notificationEmpty: {
44
- layout: "center",
45
- img: "mailBoxImg",
46
- imgSize: 80,
47
- opacity: 0.6,
48
- title: "No Notifications Yet",
49
- subTitle: "All updates,notifications and alerts will be displayed here "
50
- },
51
- dashboardListing: {
52
- layout: "center",
53
- img: "dashboardListing",
54
- imgSize: 80,
55
- title: "No Data Added",
56
- subTitle: "Currently, no data is available. Start exploring insights once data is populated "
57
- },
58
- successFullyPublish: {
59
- layout: "center",
60
- img: "congratulationsImg",
61
- imgSize: 150,
62
- opacity: 1,
63
- title: "Content Published Successfully",
64
- subTitle: " "
65
- },
66
- draftsListing: {
67
- layout: "left",
68
- img: "draftsListing",
69
- imgSize: 80,
70
- title: "No Drafts Found",
71
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
72
- action: {
73
- // route: "/choose-template",
74
- btnText: "Start Writing",
75
- }
76
- },
77
- publishedListing: {
78
- layout: "left",
79
- img: "publishedListing",
80
- imgSize: 80,
81
- title: "No published content found",
82
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
83
- action: {
84
- // route: "/choose-template",
85
- btnText: "Start Writing",
86
- }
87
- },
88
- inModerationListing: {
89
- layout: "left",
90
- img: "moderationListing",
91
- imgSize: 80,
92
- title: "No content sent for moderation",
93
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required.",
94
- action: {
95
- // route: "/choose-template",
96
- btnText: "Start Writing",
97
- }
98
- },
99
- underMyModeration: {
100
- layout: "left",
101
- img: "moderationListing",
102
- imgSize: 80,
103
- title: "No published content under my moderation",
104
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
105
- },
106
- underOthersModeration: {
107
- layout: "left",
108
- img: "moderationListing",
109
- imgSize: 80,
110
- title: "No published content under others moderation",
111
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
112
- },
113
- awaitingMod: {
114
- layout: "left",
115
- img: "moderationListing",
116
- imgSize: 80,
117
- title: "No published content under awaiting moderation",
118
- subTitle: "Once you publish any content on the platform, it shows up here. You can edit published content in future, when required."
119
- },
120
- searchListing: {
121
- layout: "center",
122
- img: "searchListing",
123
- title: "Cant find any content for",
124
- subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly",
125
- additionalAction: {
126
- // onClick: action,
127
- text: 'Clear Search'
128
- }
129
- },
130
- searchDashBoardListing: {
131
- layout: "center",
132
- img: "searchDashBoardListing",
133
- title: "No search results found",
134
- subTitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly "
135
- },
136
- learningModule: {
137
- layout: "center",
138
- img: "learningModule",
139
- title: "No lesson added",
140
- subTitle: "Looks like no lesson module has been assigned to you. Reach out to your Change leader and discuss what modules you'd like to study. "
141
- }
142
- };
143
- };
144
- exports.emptyStatesConfig = emptyStatesConfig;
@@ -1,11 +0,0 @@
1
- export function EmptyStates({ preset, actionOnClick, additionalActionOnClick, titleStyle, subTitleStyle, title: titleProp, contentTypeTitle, tags }: {
2
- preset: any;
3
- actionOnClick: any;
4
- additionalActionOnClick: any;
5
- titleStyle: any;
6
- subTitleStyle: any;
7
- title: any;
8
- contentTypeTitle: any;
9
- tags: any;
10
- }): React.JSX.Element;
11
- import React from "react";
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.EmptyStates = void 0;
11
- var react_1 = __importDefault(require("react"));
12
- var Container_1 = require("../Container");
13
- var Typo_1 = require("../Typo");
14
- var Buttons_1 = require("../Buttons");
15
- var mixins_1 = require("../../themes/mixins");
16
- var Wrappers_1 = require("../Wrappers");
17
- var OKELink_1 = require("../OKELink");
18
- var Paddings_1 = require("../Paddings");
19
- var config_1 = require("./config");
20
- var publishedListing_svg_1 = __importDefault(require("../../assets/images/publishedListing.svg"));
21
- var contentListing_svg_1 = __importDefault(require("../../assets/images/contentListing.svg"));
22
- var draftsListing_svg_1 = __importDefault(require("../../assets/images/draftsListing.svg"));
23
- var moderationListing_svg_1 = __importDefault(require("../../assets/images/moderationListing.svg"));
24
- var inPublishedSearch_svg_1 = __importDefault(require("../../assets/images/inPublishedSearch.svg"));
25
- var learningModule_svg_1 = __importDefault(require("../../assets/images/learningModule.svg"));
26
- var searchListing_svg_1 = __importDefault(require("../../assets/images/searchListing.svg"));
27
- var mailBoxImg_svg_1 = __importDefault(require("../../assets/images/mailBoxImg.svg"));
28
- var congratulationsImg_svg_1 = __importDefault(require("../../assets/images/congratulationsImg.svg"));
29
- var searchDashBoardListing_svg_1 = __importDefault(require("../../assets/images/searchDashBoardListing.svg"));
30
- var dashboardListing_svg_1 = __importDefault(require("../../assets/images/dashboardListing.svg"));
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"); });
33
- var EmptyStates = function (_a) {
34
- var preset = _a.preset, actionOnClick = _a.actionOnClick, additionalActionOnClick = _a.additionalActionOnClick, titleStyle = _a.titleStyle, subTitleStyle = _a.subTitleStyle, titleProp = _a.title, contentTypeTitle = _a.contentTypeTitle, tags = _a.tags;
35
- var _b = (0, config_1.emptyStatesConfig)({ contentTypeTitle: contentTypeTitle, tags: tags })[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
37
- var imgConfig = {
38
- publishedListing: publishedListing_svg_1.default,
39
- contentListing: contentListing_svg_1.default,
40
- draftsListing: draftsListing_svg_1.default,
41
- moderationListing: moderationListing_svg_1.default,
42
- inPublishedSearch: inPublishedSearch_svg_1.default,
43
- learningModule: learningModule_svg_1.default,
44
- searchListing: searchListing_svg_1.default,
45
- mailBoxImg: mailBoxImg_svg_1.default,
46
- congratulationsImg: congratulationsImg_svg_1.default,
47
- searchDashBoardListing: searchDashBoardListing_svg_1.default,
48
- dashboardListing: dashboardListing_svg_1.default,
49
- };
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" });
52
- return (react_1.default.createElement(StyledContainer, { layout: layout },
53
- react_1.default.createElement(Wrappers_1.Wrapper650, { style: { margin: layout === "center" ? "auto" : 0 } },
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",
57
- } })),
58
- title && react_1.default.createElement(Title, null, title),
59
- subTitle && react_1.default.createElement(SubTitle, null, subTitle),
60
- additionalAction && (react_1.default.createElement(Paddings_1.PaddingTop10, null,
61
- react_1.default.createElement(Typo_1.SANS_3, null,
62
- react_1.default.createElement(OKELink_1.OKELink, { to: "#", onClick: additionalActionOnClick }, additionalAction.text))))),
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))));
64
- };
65
- exports.EmptyStates = EmptyStates;
66
- var templateObject_1, templateObject_2, templateObject_3;