@ludo.ninja/components 2.3.82 → 2.3.84

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.
@@ -34,7 +34,7 @@ const OpportunityDropDown = ({ opportunity }) => {
34
34
  // };
35
35
  const onShareClick = (event) => {
36
36
  event.preventDefault();
37
- openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }));
37
+ openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }), true);
38
38
  };
39
39
  const onReportClick = () => {
40
40
  const opportunityId = opportunity.opportunityId ? `ID: ${opportunity.opportunityId}` : "";
@@ -101,6 +101,7 @@ exports.useUiStore = (0, traditional_1.createWithEqualityFn)()((setState) => ({
101
101
  //modals
102
102
  contentModals: null,
103
103
  stylesModals: null,
104
+ modalWithoutCloseIcon: false,
104
105
  addStylesModals: (styles) => {
105
106
  setState({ stylesModals: styles });
106
107
  },
@@ -24,12 +24,13 @@ export interface IUiStore {
24
24
  stylesModals: null | CSSProperties;
25
25
  addStylesModals: (styles: CSSProperties) => void;
26
26
  isModalOpen: boolean;
27
- openModal: (component: JSX.Element) => void;
27
+ openModal: (component: JSX.Element, withoutCloseIcon?: boolean) => void;
28
28
  closeModal: () => void;
29
29
  isModalSidebarOpen: boolean;
30
- openModalSidebar: (component: JSX.Element) => void;
30
+ openModalSidebar: (component: JSX.Element, withoutCloseIcon?: boolean) => void;
31
31
  closeModalSidebar: () => void;
32
32
  isOpenModalSidebarPortal: boolean;
33
- openModalSidebarPortal: (component: JSX.Element) => void;
33
+ modalWithoutCloseIcon: boolean;
34
+ openModalSidebarPortal: (component: JSX.Element, withoutCloseIcon?: boolean) => void;
34
35
  closeModalSidebarPortal: () => void;
35
36
  }
@@ -4,12 +4,13 @@ exports.builderModal = void 0;
4
4
  const utils_1 = require("@ludo.ninja/utils");
5
5
  const builderModal = (fields, setState) => ({
6
6
  [fields.trigger]: false,
7
- [fields.opener]: (component) => {
7
+ [fields.opener]: (component, withoutCloseIcon) => {
8
8
  (0, utils_1.rootAddOverflow)();
9
9
  setState({
10
10
  contentModals: component,
11
11
  isOverlayActive: true,
12
12
  [fields.trigger]: true,
13
+ modalWithoutCloseIcon: Boolean(withoutCloseIcon)
13
14
  });
14
15
  },
15
16
  [fields.closer]: () => {
@@ -18,8 +18,11 @@ const moreBtnVertical_svg_1 = __importDefault(require("../../../../public/creati
18
18
  const colors_2 = require("@ludo.ninja/ui/build/styles/colors");
19
19
  // Styles
20
20
  exports.StyledCardShowMore = styled_components_1.default.div `
21
+ flex-grow: 1;
22
+ text-align: end;
21
23
  .cardShowMore {
22
24
  position: relative;
25
+ display: inline-block;
23
26
  cursor: pointer;
24
27
  z-index: 100;
25
28
  svg {
@@ -36,10 +36,15 @@ const StyledModal = styled_components_1.default.div `
36
36
  .modalContent {
37
37
  max-height: calc(var(--app-height) - 20px - 16px - 16px - 24px);
38
38
  overflow-y: auto;
39
+ margin-top: 14px !important
40
+ }
41
+ .modalCloseIcon {
42
+ display: inline-block !important;
39
43
  }
40
44
  }
41
45
 
42
46
  .modalCloseIcon {
47
+ display: ${({ withoutCloseIcon }) => withoutCloseIcon ? 'none' : 'inline-block'};
43
48
  position: absolute;
44
49
  top: 16px;
45
50
  right: 16px;
@@ -47,7 +52,7 @@ const StyledModal = styled_components_1.default.div `
47
52
  }
48
53
 
49
54
  .modalContent {
50
- margin-top: 24px;
55
+ margin-top: ${({ withoutCloseIcon }) => withoutCloseIcon ? 'unset' : '24px'};
51
56
  }
52
57
 
53
58
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
@@ -69,14 +74,15 @@ const StyledModal = styled_components_1.default.div `
69
74
  }
70
75
  `;
71
76
  const Modal = () => {
72
- const { contentModals, isModalOpen, closeModal, stylesModals } = (0, ui_1.useUiStore)((state) => ({
77
+ const { contentModals, isModalOpen, closeModal, stylesModals, withoutCloseIcon } = (0, ui_1.useUiStore)((state) => ({
73
78
  contentModals: state.contentModals,
74
79
  stylesModals: state.stylesModals,
75
80
  isModalOpen: state.isModalOpen,
76
81
  closeModal: state.closeModal,
82
+ withoutCloseIcon: state.modalWithoutCloseIcon,
77
83
  }));
78
84
  if (!isModalOpen)
79
85
  return null;
80
- return ((0, jsx_runtime_1.jsxs)(StyledModal, { style: stylesModals ? stylesModals : undefined, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: contentModals })] }));
86
+ return ((0, jsx_runtime_1.jsxs)(StyledModal, { style: stylesModals ? stylesModals : undefined, withoutCloseIcon: withoutCloseIcon, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: contentModals })] }));
81
87
  };
82
88
  exports.default = Modal;
@@ -34,14 +34,15 @@ const ui_1 = require("../../../store/ui");
34
34
  const ModalSidebarPortal = (0, dynamic_1.default)(() => Promise.resolve().then(() => __importStar(require('./ModalSidebarPortal'))).then((_) => _.ModalSidebarPortal));
35
35
  // minimize dom tree for optimize virtualization
36
36
  const CreatorModalSidebarPortal = () => {
37
- const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals } = (0, ui_1.useUiStore)((state) => ({
37
+ const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals, withoutCloseIcon } = (0, ui_1.useUiStore)((state) => ({
38
38
  isOpenModalSidebarPortal: state.isOpenModalSidebarPortal,
39
39
  closeModalSidebarPortal: state.closeModalSidebarPortal,
40
40
  contentModals: state.contentModals,
41
+ withoutCloseIcon: state.modalWithoutCloseIcon,
41
42
  }));
42
43
  if (!isOpenModalSidebarPortal) {
43
44
  return null;
44
45
  }
45
- return ((0, jsx_runtime_1.jsx)(ModalSidebarPortal, { closeModal: closeModalSidebarPortal, component: contentModals }));
46
+ return ((0, jsx_runtime_1.jsx)(ModalSidebarPortal, { closeModal: closeModalSidebarPortal, component: contentModals, withoutCloseIcon: withoutCloseIcon }));
46
47
  };
47
48
  exports.CreatorModalSidebarPortal = CreatorModalSidebarPortal;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- export declare const ModalSidebarPortal: ({ component, closeModal }: {
2
+ export declare const ModalSidebarPortal: ({ component, closeModal, withoutCloseIcon, }: {
3
3
  component: ReactNode;
4
4
  closeModal: () => void;
5
+ withoutCloseIcon?: boolean;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,5 @@ const index_1 = require("./index");
6
6
  const constants_1 = require("@ludo.ninja/core/build/constants");
7
7
  const utils_1 = require("@ludo.ninja/utils");
8
8
  // minimize dom tree for optimize virtualization
9
- const ModalSidebarPortal = ({ component, closeModal }) => ((0, jsx_runtime_1.jsx)(utils_1.PortalCreator, { children: (0, jsx_runtime_1.jsxs)(index_1.StyledModalSidebar, { children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: component })] }) }));
9
+ const ModalSidebarPortal = ({ component, closeModal, withoutCloseIcon, }) => ((0, jsx_runtime_1.jsx)(utils_1.PortalCreator, { children: (0, jsx_runtime_1.jsxs)(index_1.StyledModalSidebar, { withoutCloseIcon: withoutCloseIcon, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: component })] }) }));
10
10
  exports.ModalSidebarPortal = ModalSidebarPortal;
@@ -1,3 +1,5 @@
1
- export declare const StyledModalSidebar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const StyledModalSidebar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
+ withoutCloseIcon?: boolean;
3
+ }, never>;
2
4
  declare const ModalSidebar: () => import("react/jsx-runtime").JSX.Element | null;
3
5
  export default ModalSidebar;
@@ -33,9 +33,16 @@ exports.StyledModalSidebar = styled_components_1.default.div `
33
33
  right: 0;
34
34
  bottom: 0;
35
35
  transform: none;
36
+ .modalCloseIcon {
37
+ display: inline-block !important;
38
+ }
39
+ .modalContent {
40
+ margin-top: 14px !important;};
41
+ }
36
42
  }
37
43
 
38
44
  .modalCloseIcon {
45
+ display: ${({ withoutCloseIcon }) => withoutCloseIcon ? 'none' : 'inline-block'};
39
46
  position: absolute;
40
47
  top: 16px;
41
48
  right: 16px;
@@ -43,7 +50,7 @@ exports.StyledModalSidebar = styled_components_1.default.div `
43
50
  }
44
51
 
45
52
  .modalContent {
46
- margin-top: 24px;
53
+ margin-top: ${({ withoutCloseIcon }) => withoutCloseIcon ? 'unset' : '24px'};
47
54
  }
48
55
 
49
56
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
@@ -63,13 +70,14 @@ exports.StyledModalSidebar = styled_components_1.default.div `
63
70
  }
64
71
  `;
65
72
  const ModalSidebar = () => {
66
- const { contentModals, isModalSidebarOpen, closeModalSidebar } = (0, ui_1.useUiStore)((state) => ({
73
+ const { contentModals, isModalSidebarOpen, closeModalSidebar, withoutCloseIcon } = (0, ui_1.useUiStore)((state) => ({
67
74
  contentModals: state.contentModals,
68
75
  isModalSidebarOpen: state.isModalSidebarOpen,
69
76
  closeModalSidebar: state.closeModalSidebar,
77
+ withoutCloseIcon: state.modalWithoutCloseIcon,
70
78
  }));
71
79
  if (!isModalSidebarOpen)
72
80
  return null;
73
- return ((0, jsx_runtime_1.jsxs)(exports.StyledModalSidebar, { children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModalSidebar }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: contentModals })] }));
81
+ return ((0, jsx_runtime_1.jsxs)(exports.StyledModalSidebar, { withoutCloseIcon: withoutCloseIcon, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModalSidebar }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: contentModals })] }));
74
82
  };
75
83
  exports.default = ModalSidebar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.82",
3
+ "version": "2.3.84",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",