se-design 0.0.108 → 0.0.109
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/assets/icons/rounded-plus.svg +11 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/Avatar/index.d.ts +10 -0
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/index100.js +2 -149
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +5 -0
- package/dist/index101.js.map +1 -0
- package/dist/index102.js +152 -0
- package/dist/index102.js.map +1 -0
- package/dist/index118.js +1232 -9
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +9 -4
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +10 -170
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +5 -11
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +170 -6
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +11 -6
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +5 -37
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +6 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +37 -7
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -327
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +7 -49
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +327 -2
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +45 -71
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -93
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +72 -48
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +92 -7
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +51 -4
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +7 -51
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +5 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +52 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +5 -0
- package/dist/index138.js.map +1 -0
- package/dist/index139.js +5 -0
- package/dist/index139.js.map +1 -0
- package/dist/index22.js +18 -18
- package/dist/index22.js.map +1 -1
- package/dist/index27.js +7 -7
- package/dist/index27.js.map +1 -1
- package/dist/index29.js +19 -19
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index3.js.map +1 -1
- package/dist/index38.js +1 -1
- package/dist/index38.js.map +1 -1
- package/dist/index4.js +79 -77
- package/dist/index4.js.map +1 -1
- package/dist/index41.js +1 -1
- package/dist/index43.js +29 -2
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +1 -1
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +1 -1
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +1 -1
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +1 -1
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +1 -1
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +1 -1
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +1 -1
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +1 -1
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +1 -1
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +1 -1
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +1 -1
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +1 -1
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +1 -1
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +2 -2
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +2 -2
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +1 -1
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +1 -1
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +1 -1
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +1 -1
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +2 -2
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +2 -2
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +1 -1
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +1 -1
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +1 -1
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +1 -1
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +1 -1
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +1 -1
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +1 -1
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +1 -1
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +1 -1
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +1 -1
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +1 -1
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +1 -1
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +1 -1
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +1 -1
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +2 -2
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +2 -2
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +2 -2
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +1 -1
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -1
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +2 -2
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +2 -2
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +2 -2
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +2 -2
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +2 -2
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -1
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +2 -2
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +2 -2
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index116.js +0 -1236
- package/dist/index116.js.map +0 -1
- package/dist/index117.js +0 -13
- package/dist/index117.js.map +0 -1
package/dist/index137.js
CHANGED
@@ -1,5 +1,55 @@
|
|
1
|
-
|
1
|
+
import { __require as E } from "./index135.js";
|
2
|
+
import { __require as _ } from "./index136.js";
|
3
|
+
var f, v;
|
4
|
+
function P() {
|
5
|
+
if (v) return f;
|
6
|
+
v = 1;
|
7
|
+
var o = function() {
|
8
|
+
};
|
9
|
+
if (process.env.NODE_ENV !== "production") {
|
10
|
+
var y = E(), t = {}, d = _();
|
11
|
+
o = function(n) {
|
12
|
+
var a = "Warning: " + n;
|
13
|
+
typeof console != "undefined" && console.error(a);
|
14
|
+
try {
|
15
|
+
throw new Error(a);
|
16
|
+
} catch (i) {
|
17
|
+
}
|
18
|
+
};
|
19
|
+
}
|
20
|
+
function u(n, a, i, s, c) {
|
21
|
+
if (process.env.NODE_ENV !== "production") {
|
22
|
+
for (var e in n)
|
23
|
+
if (d(n, e)) {
|
24
|
+
var r;
|
25
|
+
try {
|
26
|
+
if (typeof n[e] != "function") {
|
27
|
+
var h = Error(
|
28
|
+
(s || "React class") + ": " + i + " type `" + e + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[e] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
29
|
+
);
|
30
|
+
throw h.name = "Invariant Violation", h;
|
31
|
+
}
|
32
|
+
r = n[e](a, e, s, i, null, y);
|
33
|
+
} catch (l) {
|
34
|
+
r = l;
|
35
|
+
}
|
36
|
+
if (r && !(r instanceof Error) && o(
|
37
|
+
(s || "React class") + ": type specification of " + i + " `" + e + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof r + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
38
|
+
), r instanceof Error && !(r.message in t)) {
|
39
|
+
t[r.message] = !0;
|
40
|
+
var p = c ? c() : "";
|
41
|
+
o(
|
42
|
+
"Failed " + i + " type: " + r.message + (p != null ? p : "")
|
43
|
+
);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return u.resetWarningCache = function() {
|
49
|
+
process.env.NODE_ENV !== "production" && (t = {});
|
50
|
+
}, f = u, f;
|
51
|
+
}
|
2
52
|
export {
|
3
|
-
|
53
|
+
P as __require
|
4
54
|
};
|
5
55
|
//# sourceMappingURL=index137.js.map
|
package/dist/index137.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index137.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
1
|
+
{"version":3,"file":"index137.js","sources":["../node_modules/prop-types/checkPropTypes.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n"],"names":["printWarning","ReactPropTypesSecret","require$$0","loggedTypeFailures","has","require$$1","text","message","x","checkPropTypes","typeSpecs","values","location","componentName","getStack","typeSpecName","error","err","ex","stack","checkPropTypes_1"],"mappings":";;;;;;AASA,MAAIA,IAAe,WAAW;AAAA,EAAE;AAEhC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAIC,IAAuBC,EAAqC,GAC5DC,IAAqB,CAAE,GACvBC,IAAMC,EAAoB;AAE9B,IAAAL,IAAe,SAASM,GAAM;AAC5B,UAAIC,IAAU,cAAcD;AAC5B,MAAI,OAAO,WAAY,eACrB,QAAQ,MAAMC,CAAO;AAEvB,UAAI;AAIF,cAAM,IAAI,MAAMA,CAAO;AAAA,MACxB,SAAQC,GAAG;AAAA,MAAA;AAAA,IACb;AAAA;AAcH,WAASC,EAAeC,GAAWC,GAAQC,GAAUC,GAAeC,GAAU;AAC5E,QAAI,QAAQ,IAAI,aAAa;AAC3B,eAASC,KAAgBL;AACvB,YAAIN,EAAIM,GAAWK,CAAY,GAAG;AAChC,cAAIC;AAIJ,cAAI;AAGF,gBAAI,OAAON,EAAUK,CAAY,KAAM,YAAY;AACjD,kBAAIE,IAAM;AAAA,iBACPJ,KAAiB,iBAAiB,OAAOD,IAAW,YAAYG,IAAe,+FACC,OAAOL,EAAUK,CAAY,IAAI;AAAA,cAEnH;AACD,oBAAAE,EAAI,OAAO,uBACLA;AAAA;AAER,YAAAD,IAAQN,EAAUK,CAAY,EAAEJ,GAAQI,GAAcF,GAAeD,GAAU,MAAMX,CAAoB;AAAA,UAC1G,SAAQiB,GAAI;AACX,YAAAF,IAAQE;AAAA;AAYV,cAVIF,KAAS,EAAEA,aAAiB,UAC9BhB;AAAA,aACGa,KAAiB,iBAAiB,6BACnCD,IAAW,OAAOG,IAAe,6FAC6B,OAAOC,IAAQ;AAAA,UAI9E,GAECA,aAAiB,SAAS,EAAEA,EAAM,WAAWb,IAAqB;AAGpE,YAAAA,EAAmBa,EAAM,OAAO,IAAI;AAEpC,gBAAIG,IAAQL,IAAWA,EAAQ,IAAK;AAEpC,YAAAd;AAAA,cACE,YAAYY,IAAW,YAAYI,EAAM,WAAWG,KAAS,OAAOA,IAAQ;AAAA,YAC7E;AAAA;;;;AAYX,SAAAV,EAAe,oBAAoB,WAAW;AAC5C,IAAI,QAAQ,IAAI,aAAa,iBAC3BN,IAAqB,CAAE;AAAA,KAI3BiB,IAAiBX;;","x_google_ignoreList":[0]}
|
package/dist/index138.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index138.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index139.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index139.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index22.js
CHANGED
@@ -1,58 +1,58 @@
|
|
1
|
-
var
|
1
|
+
var $ = Object.defineProperty, P = Object.defineProperties;
|
2
2
|
var I = Object.getOwnPropertyDescriptors;
|
3
3
|
var g = Object.getOwnPropertySymbols;
|
4
4
|
var O = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
|
5
|
-
var E = (e, t, l) => t in e ?
|
5
|
+
var E = (e, t, l) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l, S = (e, t) => {
|
6
6
|
for (var l in t || (t = {}))
|
7
7
|
O.call(t, l) && E(e, l, t[l]);
|
8
8
|
if (g)
|
9
9
|
for (var l of g(t))
|
10
10
|
R.call(t, l) && E(e, l, t[l]);
|
11
11
|
return e;
|
12
|
-
}, b = (e, t) =>
|
13
|
-
import c, { useState as
|
12
|
+
}, b = (e, t) => P(e, I(t));
|
13
|
+
import c, { useState as x, useRef as T, useEffect as _ } from "react";
|
14
14
|
import { Popover as j } from "./index16.js";
|
15
|
-
import { Icon as
|
15
|
+
import { Icon as C } from "./index4.js";
|
16
16
|
const z = (e) => {
|
17
|
-
const [t, l] =
|
17
|
+
const [t, l] = x(!1), [r, f] = x(() => (e == null ? void 0 : e.defaultSelectedValue) || {}), v = T(null), {
|
18
18
|
selectBy: m = "",
|
19
19
|
optionsUniqueBy: d = "",
|
20
|
-
displaySelected:
|
20
|
+
displaySelected: D = !1,
|
21
21
|
dropDownOptions: i,
|
22
|
-
defaultText:
|
22
|
+
defaultText: y = "Select"
|
23
23
|
} = e;
|
24
24
|
_(() => {
|
25
25
|
f((e == null ? void 0 : e.defaultSelectedValue) || {});
|
26
26
|
}, [e == null ? void 0 : e.defaultSelectedValue]);
|
27
|
-
const
|
27
|
+
const h = (n) => {
|
28
28
|
var a, o;
|
29
29
|
f(n), (a = v.current) == null || a.togglePopover(), (o = e == null ? void 0 : e.onOptionClick) == null || o.call(e, n);
|
30
|
-
},
|
30
|
+
}, w = (n) => e != null && e.renderOptionChip ? e == null ? void 0 : e.renderOptionChip(n) : /* @__PURE__ */ c.createElement("span", {
|
31
31
|
className: "option-chip"
|
32
|
-
}, n[m] ||
|
33
|
-
const a = n[m], o = r[m] ||
|
32
|
+
}, n[m] || y), s = (n) => {
|
33
|
+
const a = n[m], o = r[m] || y, V = d != null && d.length ? n[d] == r[d] : !0, u = D && a === o && V;
|
34
34
|
return /* @__PURE__ */ c.createElement("div", {
|
35
35
|
key: `$drop-option-${a}`,
|
36
36
|
className: `option px-3 py-2 hover:bg-gray-100 cursor-pointer flex items-center justify-between ${u ? "selected" : ""}`,
|
37
|
-
onClick: () =>
|
38
|
-
},
|
37
|
+
onClick: () => h(n)
|
38
|
+
}, w(b(S({}, n), {
|
39
39
|
isOptionSelected: u
|
40
|
-
})), u && /* @__PURE__ */ c.createElement(
|
40
|
+
})), u && /* @__PURE__ */ c.createElement(C, {
|
41
41
|
name: "checkmark"
|
42
42
|
}));
|
43
43
|
}, N = () => /* @__PURE__ */ c.createElement("div", {
|
44
44
|
className: "dropdown-content dropdown-options"
|
45
|
-
}, i == null ? void 0 : i.map((n) =>
|
45
|
+
}, i == null ? void 0 : i.map((n) => s(n))), k = () => {
|
46
46
|
const a = `dropdown-src-element flex px-3 py-2 border rounded-md ${t ? "border-[var(--color-gray-900)]" : "border-[var(--color-gray-200)]"}`;
|
47
47
|
return /* @__PURE__ */ c.createElement("div", {
|
48
48
|
className: a
|
49
|
-
},
|
49
|
+
}, w(r), /* @__PURE__ */ c.createElement(C, {
|
50
50
|
name: "down",
|
51
51
|
className: `ml-auto ${t ? "rotate-180" : ""} transition-transform`
|
52
52
|
}));
|
53
53
|
};
|
54
54
|
return /* @__PURE__ */ c.createElement("div", {
|
55
|
-
className:
|
55
|
+
className: `se-design-dropdown-container ${e == null ? void 0 : e.className}`,
|
56
56
|
style: e == null ? void 0 : e.style
|
57
57
|
}, (e == null ? void 0 : e.label) && /* @__PURE__ */ c.createElement("div", {
|
58
58
|
className: "se-design-dropdown-label mb-[3px] text-[var(--color-gray-700)] text-sm"
|
package/dist/index22.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index22.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n type: 'select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue) => React.ReactNode;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n const [selectedDropDownValue, setSelectedDropDownValue] = useState<DropdownValue>(\n () => props?.defaultSelectedValue || {}\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select'\n } = props;\n\n useEffect(() => {\n setSelectedDropDownValue(props?.defaultSelectedValue || {});\n }, [props?.defaultSelectedValue]);\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValue(dropDownOption);\n popoverRef.current?.togglePopover();\n props?.onOptionClick?.(dropDownOption);\n };\n\n const optionChip = (option: DropdownValue) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option);\n }\n return <span className={`option-chip`}>{option[selectBy] || defaultText}</span>;\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValue[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValue[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n return (\n <div\n key={`$drop-option-${optionTxt}`}\n className={`option px-3 py-2 hover:bg-gray-100 cursor-pointer flex items-center justify-between ${isOptionSelected ? 'selected' : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n >\n {optionChip({ ...dropDownOption, isOptionSelected })}\n {isOptionSelected && <Icon name=\"checkmark\" />}\n </div>\n );\n };\n\n const renderDropdownContents = () => {\n return (\n <div className=\"dropdown-content dropdown-options\">\n {dropDownOptions?.map((dropDownOption) => dropDownOptionJsx(dropDownOption))}\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen ? 'border-[var(--color-gray-900)]' : 'border-[var(--color-gray-200)]';\n const
|
1
|
+
{"version":3,"file":"index22.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n type: 'select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue) => React.ReactNode;\n className?: string;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n const [selectedDropDownValue, setSelectedDropDownValue] = useState<DropdownValue>(\n () => props?.defaultSelectedValue || {}\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select'\n } = props;\n\n useEffect(() => {\n setSelectedDropDownValue(props?.defaultSelectedValue || {});\n }, [props?.defaultSelectedValue]);\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValue(dropDownOption);\n popoverRef.current?.togglePopover();\n props?.onOptionClick?.(dropDownOption);\n };\n\n const optionChip = (option: DropdownValue) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option);\n }\n return <span className={`option-chip`}>{option[selectBy] || defaultText}</span>;\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValue[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValue[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n return (\n <div\n key={`$drop-option-${optionTxt}`}\n className={`option px-3 py-2 hover:bg-gray-100 cursor-pointer flex items-center justify-between ${isOptionSelected ? 'selected' : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n >\n {optionChip({ ...dropDownOption, isOptionSelected })}\n {isOptionSelected && <Icon name=\"checkmark\" />}\n </div>\n );\n };\n\n const renderDropdownContents = () => {\n return (\n <div className=\"dropdown-content dropdown-options\">\n {dropDownOptions?.map((dropDownOption) => dropDownOptionJsx(dropDownOption))}\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen ? 'border-[var(--color-gray-900)]' : 'border-[var(--color-gray-200)]';\n const dropDownSelectClass = `dropdown-src-element flex px-3 py-2 border rounded-md ${borderColor}`;\n\n return (\n <div className={dropDownSelectClass}>\n {optionChip(selectedDropDownValue)}\n <Icon name=\"down\" className={`ml-auto ${isDropDownOpen ? 'rotate-180' : ''} transition-transform`} />\n </div>\n );\n };\n\n return (\n <div className={`se-design-dropdown-container ${props?.className}`} style={props?.style}>\n {props?.label && (\n <div className=\"se-design-dropdown-label mb-[3px] text-[var(--color-gray-700)] text-sm\">{props?.label}</div>\n )}\n <div style={props?.style}>\n <Popover\n ref={popoverRef}\n renderPopoverContents={renderDropdownContents}\n contentWidth={'full'}\n renderPopoverSrcElement={renderDropdownSelect}\n onPopoverToggle={(value) => setIsDropDownOpen(value)}\n />\n </div>\n </div>\n );\n};\n"],"names":["React__default","useState","useRef","useEffect","Popover","Icon","Dropdown","props","isDropDownOpen","setIsDropDownOpen","selectedDropDownValue","setSelectedDropDownValue","defaultSelectedValue","popoverRef","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","handleDropDownOptionClick","dropDownOption","_a","_b","current","togglePopover","onOptionClick","optionChip","option","renderOptionChip","React","createElement","className","dropDownOptionJsx","optionTxt","dropDownSelectedValue","selectByUniqueId","length","isOptionSelected","key","onClick","__spreadProps","__spreadValues","name","renderDropdownContents","map","renderDropdownSelect","dropDownSelectClass","style","label","ref","renderPopoverContents","contentWidth","renderPopoverSrcElement","onPopoverToggle","value"],"mappings":";;;;;;;;;;;;AAwBO,OAAAA,KAAA,YAAAC,GAAA,UAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,MAAMC,IAA+BC,CAAUA,MAAA;AACpD,QAAM,CAACC,GAAgBC,CAAiB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IACzBQ,iBAAkBC,CAAU7C,MAAAA,EAAkB6C,CAAK;AAAA,EACpD,CAAA,CACE,CACF;AAET;"}
|
package/dist/index27.js
CHANGED
@@ -23,10 +23,10 @@ const n = {
|
|
23
23
|
onBannerClick: o,
|
24
24
|
ctaText: l,
|
25
25
|
hasLinkCta: g,
|
26
|
-
onCtaClick:
|
26
|
+
onCtaClick: c,
|
27
27
|
hasButtonCta: x,
|
28
28
|
buttonType: f = "secondary"
|
29
|
-
} = t,
|
29
|
+
} = t, s = () => a && /* @__PURE__ */ e.createElement("div", {
|
30
30
|
className: `${n.bannerImageCtn} banner-image-ctn min-h-full`,
|
31
31
|
onClick: o
|
32
32
|
}, /* @__PURE__ */ e.createElement("img", {
|
@@ -38,7 +38,7 @@ const n = {
|
|
38
38
|
style: {
|
39
39
|
backgroundColor: m
|
40
40
|
}
|
41
|
-
}, r === "left" &&
|
41
|
+
}, r === "left" && s(), /* @__PURE__ */ e.createElement("div", {
|
42
42
|
className: `${n.bannerContentCtn} ${a ? "w-[70%]" : "w-[100%]"} banner-content-ctn`,
|
43
43
|
onClick: o
|
44
44
|
}, /* @__PURE__ */ e.createElement("span", {
|
@@ -47,14 +47,14 @@ const n = {
|
|
47
47
|
className: "banner-description"
|
48
48
|
}, b), g && /* @__PURE__ */ e.createElement("span", {
|
49
49
|
className: n.bannerLinkCta,
|
50
|
-
onClick:
|
50
|
+
onClick: c
|
51
51
|
}, l), x && /* @__PURE__ */ e.createElement(N, {
|
52
52
|
type: f,
|
53
53
|
size: "sm",
|
54
54
|
label: l,
|
55
|
-
onClick:
|
56
|
-
|
57
|
-
})), r === "right" &&
|
55
|
+
onClick: c,
|
56
|
+
className: n.bannerButton
|
57
|
+
})), r === "right" && s(), /* @__PURE__ */ e.createElement("span", {
|
58
58
|
className: n.bannerCloseIconCtn,
|
59
59
|
onClick: d
|
60
60
|
}, p && /* @__PURE__ */ e.createElement(h, {
|
package/dist/index27.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index27.js","sources":["../src/components/Banner/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { Icon } from 'components/Icon';\nimport { Button } from 'components/Button';\nimport './style.scss';\n\nexport interface BannerProps {\n bannerClassName?: string | '';\n bannerBgColor?: string | '';\n title: string | '';\n description: string | '';\n hasImage?: boolean | false;\n imagePosition?: 'left' | 'right' | '';\n bannerImage: string | '';\n hasCloseIcon?: boolean | false;\n closeIconName: string | '';\n onClose: () => void | (() => {});\n onBannerClick?: () => void | (() => {});\n hasButtonCta?: boolean | false;\n buttonType?: 'primary' | 'secondary' | 'link';\n hasLinkCta?: boolean | false;\n ctaText: string | '';\n onCtaClick: () => void | (() => {});\n}\n\nconst classNames: Map = {\n bannerCtn: `relative rounded-[12px] flex pr-3.5 cursor-pointer`,\n bannerContentCtn: 'pt-5 pl-6 pb-5 pr-2 flex flex-col gap-2',\n bannerLinkCta: 'text-[#1088e7] cursor-pointer text-base leading-6 underline hover: text-[#0078d4]',\n bannerImageCtn: 'w-[30%] flex mr-5 justify-end cursor-pointer',\n bannerCloseIconCtn:\n 'absolute top-[12px] right-[12px] cursor-pointer hover:bg-[var(--color-gray-100)] rounded-full p-1',\n bannerButton: 'self-start'\n};\n\nexport const Banner: FC<BannerProps> = (props) => {\n const {\n bannerClassName,\n bannerBgColor,\n title,\n description,\n hasImage,\n imagePosition = 'right',\n hasCloseIcon,\n closeIconName,\n onClose,\n onBannerClick,\n ctaText,\n hasLinkCta,\n onCtaClick,\n hasButtonCta,\n buttonType = 'secondary'\n } = props;\n\n const renderImage = () =>\n hasImage && (\n <div className={`${classNames.bannerImageCtn} banner-image-ctn min-h-full`} onClick={onBannerClick}>\n <img src={props.bannerImage} className=\"max-w-[initial] h-[initial] max-h-[150px] object-contain\" />\n </div>\n );\n\n return (\n <div className={`${classNames.bannerCtn} ${bannerClassName} banner-ctn`} style={{ backgroundColor: bannerBgColor }}>\n {imagePosition === 'left' && renderImage()}\n <div\n className={`${classNames.bannerContentCtn} ${hasImage ? 'w-[70%]' : 'w-[100%]'} banner-content-ctn`}\n onClick={onBannerClick}\n >\n <span className=\"banner-title\">{title}</span>\n <span className=\"banner-description\">{description}</span>\n {hasLinkCta && (\n <span className={classNames.bannerLinkCta} onClick={onCtaClick}>\n {ctaText}\n </span>\n )}\n {hasButtonCta && (\n <Button\n type={buttonType}\n size=\"sm\"\n label={ctaText}\n onClick={onCtaClick}\n
|
1
|
+
{"version":3,"file":"index27.js","sources":["../src/components/Banner/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { Icon } from 'components/Icon';\nimport { Button } from 'components/Button';\nimport './style.scss';\n\nexport interface BannerProps {\n bannerClassName?: string | '';\n bannerBgColor?: string | '';\n title: string | '';\n description: string | '';\n hasImage?: boolean | false;\n imagePosition?: 'left' | 'right' | '';\n bannerImage: string | '';\n hasCloseIcon?: boolean | false;\n closeIconName: string | '';\n onClose: () => void | (() => {});\n onBannerClick?: () => void | (() => {});\n hasButtonCta?: boolean | false;\n buttonType?: 'primary' | 'secondary' | 'link';\n hasLinkCta?: boolean | false;\n ctaText: string | '';\n onCtaClick: () => void | (() => {});\n}\n\nconst classNames: Map = {\n bannerCtn: `relative rounded-[12px] flex pr-3.5 cursor-pointer`,\n bannerContentCtn: 'pt-5 pl-6 pb-5 pr-2 flex flex-col gap-2',\n bannerLinkCta: 'text-[#1088e7] cursor-pointer text-base leading-6 underline hover: text-[#0078d4]',\n bannerImageCtn: 'w-[30%] flex mr-5 justify-end cursor-pointer',\n bannerCloseIconCtn:\n 'absolute top-[12px] right-[12px] cursor-pointer hover:bg-[var(--color-gray-100)] rounded-full p-1',\n bannerButton: 'self-start'\n};\n\nexport const Banner: FC<BannerProps> = (props) => {\n const {\n bannerClassName,\n bannerBgColor,\n title,\n description,\n hasImage,\n imagePosition = 'right',\n hasCloseIcon,\n closeIconName,\n onClose,\n onBannerClick,\n ctaText,\n hasLinkCta,\n onCtaClick,\n hasButtonCta,\n buttonType = 'secondary'\n } = props;\n\n const renderImage = () =>\n hasImage && (\n <div className={`${classNames.bannerImageCtn} banner-image-ctn min-h-full`} onClick={onBannerClick}>\n <img src={props.bannerImage} className=\"max-w-[initial] h-[initial] max-h-[150px] object-contain\" />\n </div>\n );\n\n return (\n <div className={`${classNames.bannerCtn} ${bannerClassName} banner-ctn`} style={{ backgroundColor: bannerBgColor }}>\n {imagePosition === 'left' && renderImage()}\n <div\n className={`${classNames.bannerContentCtn} ${hasImage ? 'w-[70%]' : 'w-[100%]'} banner-content-ctn`}\n onClick={onBannerClick}\n >\n <span className=\"banner-title\">{title}</span>\n <span className=\"banner-description\">{description}</span>\n {hasLinkCta && (\n <span className={classNames.bannerLinkCta} onClick={onCtaClick}>\n {ctaText}\n </span>\n )}\n {hasButtonCta && (\n <Button\n type={buttonType}\n size=\"sm\"\n label={ctaText}\n onClick={onCtaClick}\n className={classNames.bannerButton}\n />\n )}\n </div>\n {imagePosition === 'right' && renderImage()}\n <span className={classNames.bannerCloseIconCtn} onClick={onClose}>\n {hasCloseIcon && <Icon name={closeIconName} />}\n </span>\n </div>\n );\n};\n"],"names":["React__default","Icon","Button","classNames","bannerCtn","bannerContentCtn","bannerLinkCta","bannerImageCtn","bannerCloseIconCtn","bannerButton","Banner","props","bannerClassName","bannerBgColor","title","description","hasImage","imagePosition","hasCloseIcon","closeIconName","onClose","onBannerClick","ctaText","hasLinkCta","onCtaClick","hasButtonCta","buttonType","renderImage","React","createElement","className","onClick","src","bannerImage","style","backgroundColor","type","size","label","name"],"mappings":"AAyBA,OAAAA,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,OAAA;AAAA,MAAMC,IAAkB;AAAA,EACtBC,WAAW;AAAA,EACXC,kBAAkB;AAAA,EAClBC,eAAe;AAAA,EACfC,gBAAgB;AAAA,EAChBC,oBACE;AAAA,EACFC,cAAc;AAChB,GAEaC,IAA2BC,CAAUA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AAA,EAAAC,cAAC3B,GAAM;AAAA,IACLkC,MAAMV;AAAAA,IACNW,MAAK;AAAA,IACLC,OAAOhB;AAAAA,IACPS,SAASP;AAAAA,IACTM,WAAW3B,EAAWM;AAAAA,EAAAA,CACvB,CAEA,GACJQ,MAAkB,WAAWU,EAAY,GAC1CE,gBAAAA,EAAAA,cAAA,QAAA;AAAA,IAAMC,WAAW3B,EAAWK;AAAAA,IAAoBuB,SAASX;AAAAA,EACtDF,GAAAA,KAAgBW,gBAAAA,EAAAA,cAAC5B,GAAI;AAAA,IAACsC,MAAMpB;AAAAA,EAAgB,CAAA,CACzC,CACH;AAET;"}
|
package/dist/index29.js
CHANGED
@@ -28,31 +28,31 @@ const t = {
|
|
28
28
|
widgetImage: p,
|
29
29
|
hasImage: f = !1,
|
30
30
|
hasButtonCta: n = !1,
|
31
|
-
hasLinkCta:
|
32
|
-
ctaText:
|
31
|
+
hasLinkCta: i = !1,
|
32
|
+
ctaText: o = "",
|
33
33
|
hasBadge: x = !1,
|
34
|
-
badgeText:
|
35
|
-
buttonBgColor:
|
34
|
+
badgeText: w = "",
|
35
|
+
buttonBgColor: u = "secondary",
|
36
36
|
onCtaClick: b,
|
37
37
|
onWidgetClick: v,
|
38
|
-
webinarDateInfo:
|
39
|
-
webinarSpeaker:
|
38
|
+
webinarDateInfo: c,
|
39
|
+
webinarSpeaker: s
|
40
40
|
}) => {
|
41
|
-
const
|
42
|
-
label:
|
41
|
+
const E = x && /* @__PURE__ */ e.createElement(I, {
|
42
|
+
label: w,
|
43
43
|
className: t.widgetBadge,
|
44
44
|
bgColor: "var(--color-yellow-50)",
|
45
45
|
textColor: "var(--color-yellow-400)",
|
46
46
|
fontWeight: "normal"
|
47
|
-
}), m = (
|
47
|
+
}), m = (i || n) && /* @__PURE__ */ e.createElement(e.Fragment, null, i && /* @__PURE__ */ e.createElement("span", {
|
48
48
|
className: t.widgetLinkCta
|
49
|
-
},
|
50
|
-
type:
|
49
|
+
}, o), n && /* @__PURE__ */ e.createElement(N, {
|
50
|
+
type: u,
|
51
51
|
size: "md",
|
52
|
-
label:
|
53
|
-
|
52
|
+
label: o,
|
53
|
+
className: `${t.widgetButtonCta} mt-[4px]`,
|
54
54
|
onClick: b
|
55
|
-
})),
|
55
|
+
})), C = f && /* @__PURE__ */ e.createElement("div", {
|
56
56
|
className: `${t.widgetImageCtn} widget-image-ctn`
|
57
57
|
}, /* @__PURE__ */ e.createElement("img", {
|
58
58
|
src: p,
|
@@ -61,29 +61,29 @@ const t = {
|
|
61
61
|
return /* @__PURE__ */ e.createElement("div", {
|
62
62
|
className: `${t.widgetCtn} ${g} widget-ctn`,
|
63
63
|
onClick: v
|
64
|
-
}, a !== "general" &&
|
64
|
+
}, a !== "general" && C, /* @__PURE__ */ e.createElement("div", {
|
65
65
|
className: t.descriptionCtn
|
66
|
-
}, a !== "general" &&
|
66
|
+
}, a !== "general" && E, a !== "request-feature" && /* @__PURE__ */ e.createElement("span", {
|
67
67
|
className: `${t.widgetTitle} widget-title`
|
68
68
|
}, r), ["promotion", "general"].includes(a) && /* @__PURE__ */ e.createElement("span", {
|
69
69
|
className: `${t.widgetDescription} widget-description`
|
70
70
|
}, l), a === "webinar" && /* @__PURE__ */ e.createElement("div", {
|
71
71
|
className: t.webinarInfoCtn
|
72
|
-
},
|
72
|
+
}, s && /* @__PURE__ */ e.createElement("div", {
|
73
73
|
className: `${t.webinarDescriptionInfo} align-baseline`
|
74
74
|
}, /* @__PURE__ */ e.createElement(d, {
|
75
75
|
name: "people",
|
76
76
|
className: "relative top-[2px]"
|
77
77
|
}), /* @__PURE__ */ e.createElement("span", {
|
78
78
|
className: t.webinarSpeaker
|
79
|
-
},
|
79
|
+
}, s)), c && /* @__PURE__ */ e.createElement("div", {
|
80
80
|
className: `${t.webinarTimeInfo} align-baseline mb-[4px]`
|
81
81
|
}, /* @__PURE__ */ e.createElement(d, {
|
82
82
|
name: "clock",
|
83
83
|
className: "relative top-[2px]"
|
84
84
|
}), /* @__PURE__ */ e.createElement("span", {
|
85
85
|
className: t.webinarDate
|
86
|
-
},
|
86
|
+
}, c))), a === "request-feature" ? /* @__PURE__ */ e.createElement("div", {
|
87
87
|
className: t.requestFeatureCtn
|
88
88
|
}, /* @__PURE__ */ e.createElement("div", {
|
89
89
|
className: t.requestFeatureImageCtn
|
package/dist/index29.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index29.js","sources":["../src/components/Widget/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Map } from \"../../utils/common.types\";\nimport { Button } from \"../Button\";\nimport { Badge } from \"../Badge\";\nimport { Icon } from \"../Icon\";\nimport \"./style.scss\";\n\nexport interface WidgetProps {\n widgetClassName?: string;\n widgetType?: \"promotion\" | \"webinar\" | \"request-feature\" | \"general\";\n widgetTitle?: string;\n hasBadge?: boolean;\n webinarSpeaker?: string;\n badgeText?: string;\n widgetDescription?: string;\n webinarDateInfo?: string;\n hasImage?: boolean;\n widgetImage?: string;\n hasButtonCta?: boolean;\n buttonBgColor?: 'primary' | 'secondary';\n hasLinkCta?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n onWidgetClick?: () => void;\n}\n\nconst className: Map = {\n widgetCtn: 'flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]',\n widgetImageCtn: 'cursor-pointer',\n descriptionCtn: 'p-4 flex flex-col',\n widgetTitle: 'text-[var(--color-gray-900)] mt-[4px] mb-[8px]',\n widgetDescription: 'text-[var(--color-gray-700)] mb-[4px]',\n widgetLinkCta: 'text-[var(--color-blue-500)] cursor-pointer hover:text-[var(--color-blue-600)]',\n widgetButtonCta: 'self-start',\n widgetBadge: 'w-fit',\n webinarInfoCtn: 'flex flex-col gap-2',\n webinarSpeaker: 'text-[var(--color-gray-700)]',\n webinarDate: 'text-[var(--color-gray-700)]',\n webinarDescriptionInfo: 'flex gap-2',\n webinarTimeInfo: 'flex gap-2',\n requestFeatureCtn: 'flex gap-[12px]',\n requestFeatureImageCtn: 'w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]',\n requestFeatureDescriptionCtn: 'flex flex-col',\n};\n\nexport const Widget: FC<WidgetProps> = ({\n widgetClassName = \"\",\n widgetType,\n widgetTitle,\n widgetDescription,\n widgetImage,\n hasImage = false,\n hasButtonCta = false,\n hasLinkCta = false,\n ctaText = \"\",\n hasBadge = false,\n badgeText = \"\",\n buttonBgColor = 'secondary',\n onCtaClick,\n onWidgetClick,\n webinarDateInfo,\n webinarSpeaker,\n}) => {\n\n const renderBadge = hasBadge && (\n <Badge\n label={badgeText}\n className={className.widgetBadge}\n bgColor=\"var(--color-yellow-50)\"\n textColor=\"var(--color-yellow-400)\"\n fontWeight=\"normal\"\n />\n );\n\n const renderCTA = (hasLinkCta || hasButtonCta) && (\n <React.Fragment>\n {hasLinkCta && <span className={className.widgetLinkCta}>{ctaText}</span>}\n {hasButtonCta && <Button type={buttonBgColor} size=\"md\" label={ctaText}
|
1
|
+
{"version":3,"file":"index29.js","sources":["../src/components/Widget/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Map } from \"../../utils/common.types\";\nimport { Button } from \"../Button\";\nimport { Badge } from \"../Badge\";\nimport { Icon } from \"../Icon\";\nimport \"./style.scss\";\n\nexport interface WidgetProps {\n widgetClassName?: string;\n widgetType?: \"promotion\" | \"webinar\" | \"request-feature\" | \"general\";\n widgetTitle?: string;\n hasBadge?: boolean;\n webinarSpeaker?: string;\n badgeText?: string;\n widgetDescription?: string;\n webinarDateInfo?: string;\n hasImage?: boolean;\n widgetImage?: string;\n hasButtonCta?: boolean;\n buttonBgColor?: 'primary' | 'secondary';\n hasLinkCta?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n onWidgetClick?: () => void;\n}\n\nconst className: Map = {\n widgetCtn: 'flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]',\n widgetImageCtn: 'cursor-pointer',\n descriptionCtn: 'p-4 flex flex-col',\n widgetTitle: 'text-[var(--color-gray-900)] mt-[4px] mb-[8px]',\n widgetDescription: 'text-[var(--color-gray-700)] mb-[4px]',\n widgetLinkCta: 'text-[var(--color-blue-500)] cursor-pointer hover:text-[var(--color-blue-600)]',\n widgetButtonCta: 'self-start',\n widgetBadge: 'w-fit',\n webinarInfoCtn: 'flex flex-col gap-2',\n webinarSpeaker: 'text-[var(--color-gray-700)]',\n webinarDate: 'text-[var(--color-gray-700)]',\n webinarDescriptionInfo: 'flex gap-2',\n webinarTimeInfo: 'flex gap-2',\n requestFeatureCtn: 'flex gap-[12px]',\n requestFeatureImageCtn: 'w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]',\n requestFeatureDescriptionCtn: 'flex flex-col',\n};\n\nexport const Widget: FC<WidgetProps> = ({\n widgetClassName = \"\",\n widgetType,\n widgetTitle,\n widgetDescription,\n widgetImage,\n hasImage = false,\n hasButtonCta = false,\n hasLinkCta = false,\n ctaText = \"\",\n hasBadge = false,\n badgeText = \"\",\n buttonBgColor = 'secondary',\n onCtaClick,\n onWidgetClick,\n webinarDateInfo,\n webinarSpeaker,\n}) => {\n\n const renderBadge = hasBadge && (\n <Badge\n label={badgeText}\n className={className.widgetBadge}\n bgColor=\"var(--color-yellow-50)\"\n textColor=\"var(--color-yellow-400)\"\n fontWeight=\"normal\"\n />\n );\n\n const renderCTA = (hasLinkCta || hasButtonCta) && (\n <React.Fragment>\n {hasLinkCta && <span className={className.widgetLinkCta}>{ctaText}</span>}\n {hasButtonCta && <Button type={buttonBgColor} size=\"md\" label={ctaText} className={`${className.widgetButtonCta} mt-[4px]`} onClick={onCtaClick} />}\n </React.Fragment>\n );\n\n const renderImage = hasImage && (\n <div className={`${className.widgetImageCtn} widget-image-ctn`}>\n <img src={widgetImage} alt=\"widget-image\"/>\n </div>\n );\n\n return (\n <div className={`${className.widgetCtn} ${widgetClassName} widget-ctn`} onClick={onWidgetClick}>\n {widgetType !== \"general\" && renderImage}\n <div className={className.descriptionCtn}>\n {widgetType !== \"general\" && renderBadge}\n {widgetType !== \"request-feature\" && <span className={`${className.widgetTitle} widget-title`}>{widgetTitle}</span>}\n\n {[\"promotion\", \"general\"].includes(widgetType!) && (\n <span className={`${className.widgetDescription} widget-description`}>{widgetDescription}</span>\n )}\n\n {widgetType === \"webinar\" && (\n <div className={className.webinarInfoCtn}>\n {webinarSpeaker && (\n <div className={`${className.webinarDescriptionInfo} align-baseline`}>\n <Icon name=\"people\" className=\"relative top-[2px]\" />\n <span className={className.webinarSpeaker}>{webinarSpeaker}</span>\n </div>\n )}\n {webinarDateInfo && (\n <div className={`${className.webinarTimeInfo} align-baseline mb-[4px]`}>\n <Icon name=\"clock\" className=\"relative top-[2px]\" />\n <span className={className.webinarDate}>{webinarDateInfo}</span>\n </div>\n )}\n </div>\n )}\n\n {widgetType === \"request-feature\" ? (\n <div className={className.requestFeatureCtn}>\n <div className={className.requestFeatureImageCtn} />\n <div className={className.requestFeatureDescriptionCtn}>\n <span className={`${className.widgetTitle} widget-title`}>{widgetTitle}</span>\n <span className={`${className.widgetDescription} widget-description`}>{widgetDescription}</span>\n {renderCTA}\n </div>\n </div>\n ) : (\n renderCTA\n )}\n </div>\n </div>\n );\n};\n\nexport default Widget;"],"names":["React__default","Button","Badge","Icon","className","widgetCtn","widgetImageCtn","descriptionCtn","widgetTitle","widgetDescription","widgetLinkCta","widgetButtonCta","widgetBadge","webinarInfoCtn","webinarSpeaker","webinarDate","webinarDescriptionInfo","webinarTimeInfo","requestFeatureCtn","requestFeatureImageCtn","requestFeatureDescriptionCtn","Widget","widgetClassName","widgetType","widgetImage","hasImage","hasButtonCta","hasLinkCta","ctaText","hasBadge","badgeText","buttonBgColor","onCtaClick","onWidgetClick","webinarDateInfo","renderBadge","createElement","label","bgColor","textColor","fontWeight","renderCTA","React","Fragment","type","size","onClick","renderImage","src","alt","includes","name"],"mappings":"AA0BA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AAA,IAAMhC,WAAWA,EAAUU;AAAAA,EAAAA,GAAiBA,CAAqB,CAC9D,GAEJoB,KACEQ,gBAAAA,EAAAN,cAAA,OAAA;AAAA,IAAKhC,WAAW,GAAGA,EAAUa,eAAe;AAAA,EAAA,GAC3CmB,gBAAAA,EAAAA,cAACjC,GAAI;AAAA,IAACgD,MAAK;AAAA,IAAQ/C,WAAU;AAAA,EAAA,CAAsB,GACnDgC,gBAAAA,EAAAA,cAAA,QAAA;AAAA,IAAMhC,WAAWA,EAAUW;AAAAA,EAAAA,GAAcmB,CAAsB,CAC5D,CAEJ,GAGNX,MAAe,oBACda,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKhC,WAAWA,EAAUc;AAAAA,EAAAA,GACxBkB,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKhC,WAAWA,EAAUe;AAAAA,EAAAA,CAAyB,GACnDiB,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKhC,WAAWA,EAAUgB;AAAAA,EAAAA,GACxBgB,gBAAAA,EAAAA,cAAA,QAAA;AAAA,IAAMhC,WAAW,GAAGA,EAAUI,WAAW;AAAA,EAAkBA,GAAAA,CAAkB,GAC7EkC,gBAAAA,EAAAN,cAAA,QAAA;AAAA,IAAMhC,WAAW,GAAGA,EAAUK,iBAAiB;AAAA,KAAwBA,CAAwB,GAC9FgC,CACE,CACF,IAELA,CAEC,CACF;AAET;"}
|
package/dist/index3.js
CHANGED
@@ -43,7 +43,7 @@ const t = "focus-visible:outline outline-2 outline-[var(--color-blue-400)] outli
|
|
43
43
|
icon: r = "",
|
44
44
|
iconPosition: c = "left",
|
45
45
|
disabled: u = !1,
|
46
|
-
|
46
|
+
className: i = ""
|
47
47
|
} = v, m = b(v, [
|
48
48
|
"type",
|
49
49
|
"size",
|
@@ -51,7 +51,7 @@ const t = "focus-visible:outline outline-2 outline-[var(--color-blue-400)] outli
|
|
51
51
|
"icon",
|
52
52
|
"iconPosition",
|
53
53
|
"disabled",
|
54
|
-
"
|
54
|
+
"className"
|
55
55
|
]);
|
56
56
|
const p = e !== "link" ? g[a] : "";
|
57
57
|
return /* @__PURE__ */ l.createElement("button", n({
|
package/dist/index3.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { Icon } from '../Icon';\n\nexport interface ButtonProps {\n /**\n * Type of the button\n */\n type?: 'primary' | 'secondary' | 'negative' | 'negative-secondary' | 'purchase' | 'purchase-secondary' | 'link';\n /**\n * Size of the button\n */\n size?: 'sm' | 'md' | 'smRow';\n /**\n * Button contents\n */\n label: string | '';\n /**\n * Icon name\n */\n icon?: string;\n /**\n * Icon position\n */\n iconPosition?: 'left' | 'right';\n /**\n * Disabled state\n */\n disabled?: boolean;\n /**\n * Optional click handler\n */\n onClick?: () => void;\n /**\n * Custom class name\n */\n
|
1
|
+
{"version":3,"file":"index3.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { Icon } from '../Icon';\n\nexport interface ButtonProps {\n /**\n * Type of the button\n */\n type?: 'primary' | 'secondary' | 'negative' | 'negative-secondary' | 'purchase' | 'purchase-secondary' | 'link';\n /**\n * Size of the button\n */\n size?: 'sm' | 'md' | 'smRow';\n /**\n * Button contents\n */\n label: string | '';\n /**\n * Icon name\n */\n icon?: string;\n /**\n * Icon position\n */\n iconPosition?: 'left' | 'right';\n /**\n * Disabled state\n */\n disabled?: boolean;\n /**\n * Optional click handler\n */\n onClick?: () => void;\n /**\n * Custom class name\n */\n className?: string;\n}\n\nconst focusClass = 'focus-visible:outline outline-2 outline-[var(--color-blue-400)] outline-offset-2';\nconst disabledClassNames: Map = {\n primary: 'bg-[var(--color-gray-200)] text-[var(--color-gray-600)] pointer-events-none cursor-not-allowed',\n secondary:\n 'text-[var(--color-gray-600)] border border-[var(--color-gray-300)] pointer-events-none cursor-not-allowed',\n link: 'text-[var(--color-gray-600)] pointer-events-none cursor-not-allowed'\n};\nconst classNames: Map = {\n primary: `bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-600)] ${focusClass}`,\n secondary: `bg-[var(--color-white)] text-[var(--color-gray-800)] hover:bg-[var(--color-gray-50)] border border-[var(--color-gray-400)] hover:border-[var(--color-gray-500)] ${focusClass}`,\n purchase: `bg-[var(--color-green-500)] text-[var(--color-white)] hover:bg-[var(--color-green-700)] border border-[var(--color-green-300)] ${focusClass}`,\n 'purchase-secondary': `bg-[var(--color-green-50)] text-[var(--color-green-500)] hover:bg-[var(--color-green-400)] border border-[var(--color-green-500)] hover:border-[var(--color-green-700)] ${focusClass}`,\n negative: `bg-[var(--color-red-500)] text-[var(--color-white)] hover:bg-[var(--color-red-500)] border border-[var(--color-red-500)] hover:border-[var(--color-red-500)] ${focusClass}`,\n 'negative-secondary': `bg-[var(--color-red-50)] text-[var(--color-red-500)] hover:bg-[var(--color-red-50)] border border-[var(--color-red-500)] hover:border-[var(--color-red-500)] ${focusClass}`,\n link: `text-[var(--color-blue-500)] px-0 py-0 hover:text-[var(--color-blue-600)] ${focusClass}`,\n sm: 'px-3 py-1',\n md: 'px-4 py-2',\n smRow: 'px-3 py-0.5'\n};\n\nexport const Button: FC<ButtonProps> = ({\n type = 'primary',\n size = 'md',\n label = '',\n icon = '',\n iconPosition = 'left',\n disabled = false,\n className = '',\n ...props\n}) => {\n const sizeClassName = type !== 'link' ? classNames[size] : '';\n\n return (\n <button\n type=\"button\"\n className={`rounded-[6px] text-base font-normal flex gap-1 items-center min-w-fit ${sizeClassName} ${disabled ? disabledClassNames[type] : classNames[type]} ${className}`}\n {...props}\n >\n {icon && iconPosition === 'left' && <Icon name={icon} className=\"\" />}\n {label}\n {icon && iconPosition === 'right' && <Icon name={icon} className=\"\" />}\n </button>\n );\n};\n"],"names":["focusClass","disabledClassNames","primary","secondary","link","classNames","purchase","negative","sm","md","smRow","Button","_a","_b","type","size","label","icon","iconPosition","disabled","className","props","sizeClassName","React","createElement","_extends","Icon","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAMA,IAAa,oFACbC,IAA0B;AAAA,EAC9BC,SAAS;AAAA,EACTC,WACE;AAAA,EACFC,MAAM;AACR,GACMC,IAAkB;AAAA,EACtBH,SAAS,yFAAyFF,CAAU;AAAA,EAC5GG,WAAW,mKAAmKH,CAAU;AAAA,EACxLM,UAAU,kIAAkIN,CAAU;AAAA,EACtJ,sBAAsB,2KAA2KA,CAAU;AAAA,EAC3MO,UAAU,gKAAgKP,CAAU;AAAA,EACpL,sBAAsB,gKAAgKA,CAAU;AAAA,EAChMI,MAAM,8EAA8EJ,CAAU;AAAA,EAC9FQ,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,OAAO;AACT,GAEaC,IAA0BA,CAACC,MASlC;AATkC,MAAAC,IAAAD,GACtCE;AAAAA,UAAAA,IAAO;AAAA,IACPC,MAAAA,IAAO;AAAA,IACPC,OAAAA,IAAQ;AAAA,IACRC,MAAAA,IAAO;AAAA,IACPC,cAAAA,IAAe;AAAA,IACfC,UAAAA,IAAW;AAAA,IACXC,WAAAA,IAAY;AAAA,MAP0BP,GAQnCQ,IAAAA,EARmCR,GAQnCQ;AAAAA,IAPHP;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA;AAGA,QAAME,IAAgBR,MAAS,SAAST,EAAWU,CAAI,IAAI;AAGzDQ,SAAAA,gBAAAA,EAAAC,cAAA,UAAAC,EAAA;AAAA,IACEX,MAAK;AAAA,IACLM,WAAW,yEAAyEE,CAAa,IAAIH,IAAWlB,EAAmBa,CAAI,IAAIT,EAAWS,CAAI,CAAC,IAAIM,CAAS;AAAA,EAAA,GACpKC,CAAK,GAERJ,KAAQC,MAAiB,UAAUK,gBAAAA,EAAAC,cAACE,GAAI;AAAA,IAACC,MAAMV;AAAAA,IAAMG,WAAU;AAAA,EAAA,CAAI,GACnEJ,GACAC,KAAQC,MAAiB,WAAWK,gBAAAA,EAAAC,cAACE,GAAI;AAAA,IAACC,MAAMV;AAAAA,IAAMG,WAAU;AAAA,EAAA,CAAI,CAC/D;AAEZ;"}
|
package/dist/index38.js
CHANGED
package/dist/index38.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index38.js","sources":["../src/components/MessageBar/index.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { Map } from 'src/utils/common.types';\nimport { Icon } from '../Icon';\nimport { Button } from '../Button';\nimport './style.scss';\n\nexport interface MessageBarProps {\n messageBarCtnClassName?: string;\n messageBarType: 'info' | 'alert' | 'nudge';\n message: string;\n hasCloseIcon?: boolean;\n hasButton?: boolean,\n buttonLabel: string | '',\n buttonOnClick?: () => void,\n handleClose?: () => void,\n}\n\nconst classNames: Map = {\n messageBarCtn: \"min-h-[45px] fixed top-0 w-full flex items-center justify-center py-2\",\n messageCtn: \"flex items-center justify-center gap-2 flex-wrap px-4 pr-12\",\n info: \"bg-[var(--color-yellow-50)]\",\n alert: \"bg-[var(--color-red-500)]\",\n nudge: \"bg-[var(--color-blue-500)]\",\n infoMessage: \"text-[var(--color-yellow-700)] text-center\", \n alertMessage: \"text-[var(--color-white)] text-center\",\n closeIconCtn: \"absolute right-[12px] cursor-pointer cursor-pointer hover:bg-[var(--color-gray-500)] rounded-full p-1\",\n customInfoClassBtn: \"bg-[var(--color-yellow-50)] text-[var(--color-yellow-700)] hover:bg-[var(--color-yellow-50)] border border-[var(--color-yellow-700)] hover:border-[var(--color-yellow-900)]\",\n customAlertClassBtn: \"bg-[var(--color-red-500)] text-[var(--color-white)] hover:bg-[var(--color-red-500)] border border-[var(--color-white)] hover:border-[var(--color-white)]\",\n customNudgeClassBtn: \"bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-500)] border border-[var(--color-white)] hover:border-[var(--color-white)]\",\n};\n\nexport const MessageBar: FC<MessageBarProps> = ({\n messageBarCtnClassName = \"\",\n messageBarType = 'info',\n message = '',\n hasCloseIcon = false,\n hasButton = false,\n buttonLabel = '',\n buttonOnClick = () => {},\n handleClose = () => {},\n}) => {\n const [visible, setVisible] = useState(true);\n\n const handleClickOnCloseIcon = React.useCallback(() => {\n setVisible(false);\n const timer = setTimeout(() => {\n handleClose?.();\n }, 300);\n return () => clearTimeout(timer);\n }, [handleClose]);\n\n const messageClass = messageBarType === 'info' ? classNames.infoMessage : classNames.alertMessage;\n \n const buttonClassName = React.useMemo(() => {\n switch(messageBarType) {\n case 'info': return classNames.customInfoClassBtn;\n case 'alert': return classNames.customAlertClassBtn;\n case 'nudge': return classNames.customNudgeClassBtn;\n default: return '';\n }\n }, [messageBarType]);\n\n const iconName = messageBarType === 'info' ? \"info-brown\" : \"info-white\";\n const closeIconName = messageBarType === 'info' ? \"close\" : \"white-close\";\n\n return (\n <div className={`se-design-message-bar ${messageBarCtnClassName} ${classNames.messageBarCtn} ${classNames[messageBarType]} ${visible ? \"show\" : \"hide\"}`}>\n <div className={classNames.messageCtn}>\n <div className=\"inline-flex items-center\">\n <span className={messageClass}>\n <Icon name={iconName} className=\"inline-block h-fit relative top-[3px] mr-1\"/>\n {message}\n {hasButton && (\n <Button \n label={buttonLabel} \n type='primary' \n size=\"sm\" \n onClick={buttonOnClick}\n
|
1
|
+
{"version":3,"file":"index38.js","sources":["../src/components/MessageBar/index.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { Map } from 'src/utils/common.types';\nimport { Icon } from '../Icon';\nimport { Button } from '../Button';\nimport './style.scss';\n\nexport interface MessageBarProps {\n messageBarCtnClassName?: string;\n messageBarType: 'info' | 'alert' | 'nudge';\n message: string;\n hasCloseIcon?: boolean;\n hasButton?: boolean,\n buttonLabel: string | '',\n buttonOnClick?: () => void,\n handleClose?: () => void,\n}\n\nconst classNames: Map = {\n messageBarCtn: \"min-h-[45px] fixed top-0 w-full flex items-center justify-center py-2\",\n messageCtn: \"flex items-center justify-center gap-2 flex-wrap px-4 pr-12\",\n info: \"bg-[var(--color-yellow-50)]\",\n alert: \"bg-[var(--color-red-500)]\",\n nudge: \"bg-[var(--color-blue-500)]\",\n infoMessage: \"text-[var(--color-yellow-700)] text-center\", \n alertMessage: \"text-[var(--color-white)] text-center\",\n closeIconCtn: \"absolute right-[12px] cursor-pointer cursor-pointer hover:bg-[var(--color-gray-500)] rounded-full p-1\",\n customInfoClassBtn: \"bg-[var(--color-yellow-50)] text-[var(--color-yellow-700)] hover:bg-[var(--color-yellow-50)] border border-[var(--color-yellow-700)] hover:border-[var(--color-yellow-900)]\",\n customAlertClassBtn: \"bg-[var(--color-red-500)] text-[var(--color-white)] hover:bg-[var(--color-red-500)] border border-[var(--color-white)] hover:border-[var(--color-white)]\",\n customNudgeClassBtn: \"bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-500)] border border-[var(--color-white)] hover:border-[var(--color-white)]\",\n};\n\nexport const MessageBar: FC<MessageBarProps> = ({\n messageBarCtnClassName = \"\",\n messageBarType = 'info',\n message = '',\n hasCloseIcon = false,\n hasButton = false,\n buttonLabel = '',\n buttonOnClick = () => {},\n handleClose = () => {},\n}) => {\n const [visible, setVisible] = useState(true);\n\n const handleClickOnCloseIcon = React.useCallback(() => {\n setVisible(false);\n const timer = setTimeout(() => {\n handleClose?.();\n }, 300);\n return () => clearTimeout(timer);\n }, [handleClose]);\n\n const messageClass = messageBarType === 'info' ? classNames.infoMessage : classNames.alertMessage;\n \n const buttonClassName = React.useMemo(() => {\n switch(messageBarType) {\n case 'info': return classNames.customInfoClassBtn;\n case 'alert': return classNames.customAlertClassBtn;\n case 'nudge': return classNames.customNudgeClassBtn;\n default: return '';\n }\n }, [messageBarType]);\n\n const iconName = messageBarType === 'info' ? \"info-brown\" : \"info-white\";\n const closeIconName = messageBarType === 'info' ? \"close\" : \"white-close\";\n\n return (\n <div className={`se-design-message-bar ${messageBarCtnClassName} ${classNames.messageBarCtn} ${classNames[messageBarType]} ${visible ? \"show\" : \"hide\"}`}>\n <div className={classNames.messageCtn}>\n <div className=\"inline-flex items-center\">\n <span className={messageClass}>\n <Icon name={iconName} className=\"inline-block h-fit relative top-[3px] mr-1\"/>\n {message}\n {hasButton && (\n <Button \n label={buttonLabel} \n type='primary' \n size=\"sm\" \n onClick={buttonOnClick}\n className={`${buttonClassName} ml-2 alert-btn`}\n />\n )}\n </span>\n </div>\n </div>\n {hasCloseIcon && (\n <Icon \n name={closeIconName} \n className={classNames.closeIconCtn} \n onClick={handleClickOnCloseIcon} \n />\n )}\n </div>\n );\n};\n\nexport default MessageBar;"],"names":["React__default","useState","Icon","Button","classNames","messageBarCtn","messageCtn","info","alert","nudge","infoMessage","alertMessage","closeIconCtn","customInfoClassBtn","customAlertClassBtn","customNudgeClassBtn","MessageBar","messageBarCtnClassName","messageBarType","message","hasCloseIcon","hasButton","buttonLabel","buttonOnClick","handleClose","visible","setVisible","handleClickOnCloseIcon","React","useCallback","timer","setTimeout","clearTimeout","messageClass","buttonClassName","useMemo","iconName","closeIconName","createElement","className","name","label","type","size","onClick"],"mappings":"AAiBA,OAAAA,KAAA,YAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,OAAA;AAAA,MAAMC,IAAkB;AAAA,EACtBC,eAAe;AAAA,EACfC,YAAY;AAAA,EACZC,MAAM;AAAA,EACNC,OAAO;AAAA,EACPC,OAAO;AAAA,EACPC,aAAa;AAAA,EACbC,cAAc;AAAA,EACdC,cAAc;AAAA,EACdC,oBAAoB;AAAA,EACpBC,qBAAqB;AAAA,EACrBC,qBAAqB;AACvB,GAEaC,IAAkCA,CAAC;AAAA,EAC9CC,wBAAAA,IAAyB;AAAA,EACzBC,gBAAAA,IAAiB;AAAA,EACjBC,SAAAA,IAAU;AAAA,EACVC,cAAAA,IAAe;AAAA,EACfC,WAAAA,IAAY;AAAA,EACZC,aAAAA,IAAc;AAAA,E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