se-design 0.0.132 → 0.0.133
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.
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/index10.js +16 -16
- package/dist/index10.js.map +1 -1
- package/dist/index26.js +8 -8
- package/dist/index26.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
2
|
export interface ModalProps {
|
|
3
3
|
title?: string;
|
|
4
|
-
content: string;
|
|
4
|
+
content: string | React.ReactNode;
|
|
5
5
|
successButtonText: string;
|
|
6
6
|
cancelButtonText: string;
|
|
7
7
|
successButtonType: 'primary' | 'secondary' | 'negative' | 'negative-secondary';
|
package/dist/index10.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { Icon as
|
|
2
|
+
import { Button as o } from "./index3.js";
|
|
3
|
+
import { Icon as g } from "./index5.js";
|
|
4
4
|
const E = (a) => {
|
|
5
5
|
const {
|
|
6
|
-
title:
|
|
7
|
-
content:
|
|
6
|
+
title: s,
|
|
7
|
+
content: t = "",
|
|
8
8
|
successButtonType: i,
|
|
9
9
|
successButtonDisabled: r = !1,
|
|
10
10
|
showCloseIcon: m = !1,
|
|
11
11
|
cancelButtonType: d,
|
|
12
|
-
successButtonText:
|
|
12
|
+
successButtonText: n,
|
|
13
13
|
cancelButtonText: l,
|
|
14
|
-
cancelAction:
|
|
14
|
+
cancelAction: c,
|
|
15
15
|
successAction: p,
|
|
16
16
|
isOpen: u,
|
|
17
17
|
width: f = "500px"
|
|
18
|
-
} = a;
|
|
18
|
+
} = a, b = typeof t == "string";
|
|
19
19
|
return /* @__PURE__ */ e.createElement("div", {
|
|
20
20
|
className: `se-design-modal fixed inset-0 flex items-start justify-center z-[2000] backdrop-brightness-50 ${u ? "visible" : "invisible pointer-events-none"}`
|
|
21
21
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
@@ -23,24 +23,24 @@ const E = (a) => {
|
|
|
23
23
|
style: {
|
|
24
24
|
width: f
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, s && /* @__PURE__ */ e.createElement("div", {
|
|
27
27
|
className: "text-lg font-semibold"
|
|
28
|
-
},
|
|
28
|
+
}, s), b ? /* @__PURE__ */ e.createElement("p", {
|
|
29
29
|
className: "leading-normal"
|
|
30
|
-
},
|
|
30
|
+
}, t) : t, /* @__PURE__ */ e.createElement("div", {
|
|
31
31
|
className: "flex items-center justify-end gap-4 pt-2"
|
|
32
|
-
}, l && /* @__PURE__ */ e.createElement(
|
|
32
|
+
}, l && /* @__PURE__ */ e.createElement(o, {
|
|
33
33
|
type: d,
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: c,
|
|
35
35
|
label: l
|
|
36
|
-
}),
|
|
36
|
+
}), n && /* @__PURE__ */ e.createElement(o, {
|
|
37
37
|
type: i,
|
|
38
38
|
disabled: r,
|
|
39
39
|
onClick: p,
|
|
40
|
-
label:
|
|
41
|
-
})), m && /* @__PURE__ */ e.createElement(
|
|
40
|
+
label: n
|
|
41
|
+
})), m && /* @__PURE__ */ e.createElement(g, {
|
|
42
42
|
name: "close",
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: c,
|
|
44
44
|
className: "absolute top-8 right-8 cursor-pointer"
|
|
45
45
|
})));
|
|
46
46
|
};
|
package/dist/index10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/components/Modal/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Button } from 'src/components/Button';\nimport { Icon } from '../Icon';\n\nexport interface ModalProps {\n title?: string;\n content: string;\n successButtonText: string;\n cancelButtonText: string;\n successButtonType: 'primary' | 'secondary' | 'negative' | 'negative-secondary';\n cancelButtonType: 'primary' | 'secondary' | 'negative' | 'negative-secondary';\n cancelAction?: () => void;\n successAction?: () => void;\n showCloseIcon?: boolean;\n isOpen: boolean;\n width?: string;\n successButtonDisabled?: boolean;\n}\n\nexport const Modal: FC<ModalProps> = (props) => {\n const {\n title,\n content,\n successButtonType,\n successButtonDisabled = false,\n showCloseIcon = false,\n cancelButtonType,\n successButtonText,\n cancelButtonText,\n cancelAction,\n successAction,\n isOpen,\n width = '500px'\n } = props;\n\n return (\n <div\n className={`se-design-modal fixed inset-0 flex items-start justify-center z-[2000] backdrop-brightness-50 ${isOpen ? 'visible' : 'invisible pointer-events-none'}`}\n >\n <div\n className=\"modal-content flex flex-col gap-3 bg-[var(--color-white)] rounded shadow-lg p-8 mt-10 relative\"\n style={{ width }}\n >\n {title && <div className=\"text-lg font-semibold\">{title}</div>}\n <p className=\"leading-normal\">{content}</p
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/components/Modal/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Button } from 'src/components/Button';\nimport { Icon } from '../Icon';\n\nexport interface ModalProps {\n title?: string;\n content: string | React.ReactNode;\n successButtonText: string;\n cancelButtonText: string;\n successButtonType: 'primary' | 'secondary' | 'negative' | 'negative-secondary';\n cancelButtonType: 'primary' | 'secondary' | 'negative' | 'negative-secondary';\n cancelAction?: () => void;\n successAction?: () => void;\n showCloseIcon?: boolean;\n isOpen: boolean;\n width?: string;\n successButtonDisabled?: boolean;\n}\n\nexport const Modal: FC<ModalProps> = (props) => {\n const {\n title,\n content = '',\n successButtonType,\n successButtonDisabled = false,\n showCloseIcon = false,\n cancelButtonType,\n successButtonText,\n cancelButtonText,\n cancelAction,\n successAction,\n isOpen,\n width = '500px'\n } = props;\n\n const isContentString = typeof content === 'string';\n\n return (\n <div\n className={`se-design-modal fixed inset-0 flex items-start justify-center z-[2000] backdrop-brightness-50 ${isOpen ? 'visible' : 'invisible pointer-events-none'}`}\n >\n <div\n className=\"modal-content flex flex-col gap-3 bg-[var(--color-white)] rounded shadow-lg p-8 mt-10 relative\"\n style={{ width }}\n >\n {title && <div className=\"text-lg font-semibold\">{title}</div>}\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n <div className=\"flex items-center justify-end gap-4 pt-2\">\n {cancelButtonText && <Button type={cancelButtonType} onClick={cancelAction} label={cancelButtonText} />}\n {successButtonText && (\n <Button\n type={successButtonType}\n disabled={successButtonDisabled}\n onClick={successAction}\n label={successButtonText}\n />\n )}\n </div>\n {showCloseIcon && (\n <Icon name=\"close\" onClick={cancelAction} className=\"absolute top-8 right-8 cursor-pointer\" />\n )}\n </div>\n </div>\n );\n};\n"],"names":["React__default","Button","Icon","Modal","props","title","content","successButtonType","successButtonDisabled","showCloseIcon","cancelButtonType","successButtonText","cancelButtonText","cancelAction","successAction","isOpen","width","isContentString","React","createElement","className","style","type","onClick","label","disabled","name"],"mappings":"AAmBO,OAAAA,OAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,MAAMC,IAAyBC,CAAUA,MAAA;AACxC,QAAA;AAAA,IACJC,OAAAA;AAAAA,IACAC,SAAAA,IAAU;AAAA,IACVC,mBAAAA;AAAAA,IACAC,uBAAAA,IAAwB;AAAA,IACxBC,eAAAA,IAAgB;AAAA,IAChBC,kBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA,IAAQ;AAAA,EAAA,IACNZ,GAEEa,IAAkB,OAAOX,KAAY;AAGzCY,SAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAW,iGAAiGL,IAAS,YAAY,+BAA+B;AAAA,EAAA,GAEhKI,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVC,OAAO;AAAA,MAAEL,OAAAA;AAAAA,IAAAA;AAAAA,EAERX,GAAAA,KAASc,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,KAAyBf,CAAW,GAC5DY,IAAkBC,gBAAAA,EAAAC,cAAA,KAAA;AAAA,IAAGC,WAAU;AAAA,KAAkBd,CAAW,IAAIA,GACjEY,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EACZR,GAAAA,KAAoBO,gBAAAA,EAAAA,cAAClB,GAAM;AAAA,IAACqB,MAAMZ;AAAAA,IAAkBa,SAASV;AAAAA,IAAcW,OAAOZ;AAAAA,EAAmB,CAAA,GACrGD,KACCO,gBAAAA,EAAAC,cAAClB,GAAM;AAAA,IACLqB,MAAMf;AAAAA,IACNkB,UAAUjB;AAAAA,IACVe,SAAST;AAAAA,IACTU,OAAOb;AAAAA,EACR,CAAA,CAEA,GACJF,KACCS,gBAAAA,EAAAC,cAACjB,GAAI;AAAA,IAACwB,MAAK;AAAA,IAAQH,SAASV;AAAAA,IAAcO,WAAU;AAAA,EAAyC,CAAA,CAE5F,CACF;AAET;"}
|
package/dist/index26.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var E = Object.defineProperty;
|
|
2
2
|
var h = Object.getOwnPropertySymbols;
|
|
3
3
|
var N = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var b = (a, t, e) => t in a ? E(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e,
|
|
4
|
+
var b = (a, t, e) => t in a ? E(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, l = (a, t) => {
|
|
5
5
|
for (var e in t || (t = {}))
|
|
6
6
|
N.call(t, e) && b(a, e, t[e]);
|
|
7
7
|
if (h)
|
|
@@ -9,7 +9,7 @@ var b = (a, t, e) => t in a ? E(a, t, { enumerable: !0, configurable: !0, writab
|
|
|
9
9
|
_.call(t, e) && b(a, e, t[e]);
|
|
10
10
|
return a;
|
|
11
11
|
};
|
|
12
|
-
import
|
|
12
|
+
import d, { useEffect as i } from "react";
|
|
13
13
|
import { Icon as x } from "./index5.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
const k = (a) => {
|
|
@@ -37,24 +37,24 @@ const k = (a) => {
|
|
|
37
37
|
m && m(u);
|
|
38
38
|
}, [u]);
|
|
39
39
|
const S = () => {
|
|
40
|
-
let n =
|
|
40
|
+
let n = `se-design-sidebar-overlay-container z-[1000] ${r ? "" : "hidden"}`;
|
|
41
41
|
return n += e.length > 0 ? ` ${e}` : "", n += f === "left" ? " left-aligned" : " right-aligned", n += g ? " no-shadow" : "", n += s.length > 0 ? ` ${s}` : "", n += r ? " open-sidebar" : " closed-sidebar", n;
|
|
42
|
-
}, C = () =>
|
|
42
|
+
}, C = () => l(l({}, o), r && (o != null && o.width) ? {
|
|
43
43
|
width: o == null ? void 0 : o.width
|
|
44
44
|
} : {
|
|
45
45
|
width: "0px"
|
|
46
46
|
});
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ d.createElement("div", {
|
|
48
48
|
className: S(),
|
|
49
49
|
style: C(),
|
|
50
50
|
"data-automation-id": y
|
|
51
|
-
}, /* @__PURE__ */
|
|
51
|
+
}, /* @__PURE__ */ d.createElement("div", {
|
|
52
52
|
className: "overlay-content"
|
|
53
|
-
}, p && /* @__PURE__ */
|
|
53
|
+
}, p && /* @__PURE__ */ d.createElement("span", {
|
|
54
54
|
className: "overlay-close",
|
|
55
55
|
onClick: v,
|
|
56
56
|
"data-automation-id": "sidebar_overlay_close"
|
|
57
|
-
}, /* @__PURE__ */
|
|
57
|
+
}, /* @__PURE__ */ d.createElement(x, {
|
|
58
58
|
name: w
|
|
59
59
|
})), t));
|
|
60
60
|
};
|
package/dist/index26.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index26.js","sources":["../src/components/SidebarOverlay/index.tsx"],"sourcesContent":["import React, { FC, useEffect } from 'react';\nimport { Icon } from 'components/Icon';\n\nimport './style.scss';\n\nexport interface SidebarOverlayProps {\n content: React.ReactNode;\n className?: string;\n alignment?: 'left' | 'right';\n style?: React.CSSProperties;\n noShadow?: boolean;\n automationId?: string;\n position?: 'absolute' | 'fixed' | 'relative' | 'static' | '';\n isOpen?: boolean;\n displayCloseSidebar?: boolean;\n closeSidebarIcon?: string;\n onClose?: () => void;\n onSidebarUnmount?: () => void;\n onPathChange?: (route: string) => void;\n currentPath?: string;\n}\n\nexport const SidebarOverlay: FC<SidebarOverlayProps> = (props) => {\n const {
|
|
1
|
+
{"version":3,"file":"index26.js","sources":["../src/components/SidebarOverlay/index.tsx"],"sourcesContent":["import React, { FC, useEffect } from 'react';\nimport { Icon } from 'components/Icon';\n\nimport './style.scss';\n\nexport interface SidebarOverlayProps {\n content: React.ReactNode;\n className?: string;\n alignment?: 'left' | 'right';\n style?: React.CSSProperties;\n noShadow?: boolean;\n automationId?: string;\n position?: 'absolute' | 'fixed' | 'relative' | 'static' | '';\n isOpen?: boolean;\n displayCloseSidebar?: boolean;\n closeSidebarIcon?: string;\n onClose?: () => void;\n onSidebarUnmount?: () => void;\n onPathChange?: (route: string) => void;\n currentPath?: string;\n}\n\nexport const SidebarOverlay: FC<SidebarOverlayProps> = (props) => {\n const {\n content,\n className = '',\n alignment,\n noShadow,\n position = 'fixed',\n isOpen,\n displayCloseSidebar,\n onClose,\n onSidebarUnmount,\n onPathChange,\n style,\n automationId,\n currentPath = '',\n closeSidebarIcon = 'close'\n } = props;\n\n useEffect(() => {\n return () => {\n onSidebarUnmount && onSidebarUnmount();\n };\n }, []);\n\n // This is to prevent the body from scrolling when the sidebar is open\n useEffect(() => {\n document.body.style.overflow = isOpen ? 'hidden' : 'scroll';\n\n return () => {\n document.body.style.overflow = 'auto'; // Cleanup on unmount\n };\n }, [isOpen]);\n\n useEffect(() => {\n onPathChange && onPathChange(currentPath);\n }, [currentPath]);\n\n const getSidebarClassName = () => {\n let defaultClass = `se-design-sidebar-overlay-container z-[1000] ${isOpen ? '' : 'hidden'}`;\n\n defaultClass += className.length > 0 ? ` ${className}` : '';\n defaultClass += alignment === 'left' ? ' left-aligned' : ' right-aligned';\n defaultClass += noShadow ? ' no-shadow' : '';\n defaultClass += position.length > 0 ? ` ${position}` : '';\n defaultClass += isOpen ? ' open-sidebar' : ' closed-sidebar';\n return defaultClass;\n };\n\n const getSidebarStyle = () => {\n return {\n ...style,\n ...(isOpen && style?.width ? { width: style?.width } : { width: '0px' })\n };\n };\n\n return (\n <div className={getSidebarClassName()} style={getSidebarStyle()} data-automation-id={automationId}>\n <div className=\"overlay-content\">\n {displayCloseSidebar && (\n <span className=\"overlay-close\" onClick={onClose} data-automation-id=\"sidebar_overlay_close\">\n <Icon name={closeSidebarIcon} />\n </span>\n )}\n {content}\n </div>\n </div>\n );\n};\n"],"names":["React__default","useEffect","Icon","SidebarOverlay","props","content","className","alignment","noShadow","position","isOpen","displayCloseSidebar","onClose","onSidebarUnmount","onPathChange","style","automationId","currentPath","closeSidebarIcon","document","body","overflow","getSidebarClassName","defaultClass","length","getSidebarStyle","__spreadValues","width","React","createElement","onClick","name"],"mappings":";;;;;;;;;;;AAsBO,OAAAA,KAAA,aAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,OAAA;AAAA,MAAMC,IAA2CC,CAAUA,MAAA;AAC1D,QAAA;AAAA,IACJC,SAAAA;AAAAA,IACAC,WAAAA,IAAY;AAAA,IACZC,WAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,IAAW;AAAA,IACXC,QAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,aAAAA,IAAc;AAAA,IACdC,kBAAAA,IAAmB;AAAA,EAAA,IACjBd;AAEJH,EAAAA,EAAU,MACD,MAAM;AACXY,IAAAA,KAAoBA,EAAiB;AAAA,EACvC,GACC,EAAE,GAGLZ,EAAU,OACRkB,SAASC,KAAKL,MAAMM,WA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