se-design 0.0.96 → 0.0.98
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/kebab-menu-blue.svg +8 -0
- package/dist/assets/icons/kebab-menu.svg +8 -0
- package/dist/assets/style.css +1 -0
- package/dist/components/Button/Button.stories.d.ts +1 -2
- package/dist/components/Button/index.d.ts +2 -3
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/ColorCodedLabel/index.d.ts +8 -0
- package/dist/components/Dropdown/index.d.ts +19 -0
- package/dist/components/HamburgerMenu/HamburgerMenu.stories.d.ts +0 -1
- package/dist/components/HamburgerMenu/index.d.ts +3 -4
- package/dist/components/Header/index.d.ts +1 -2
- package/dist/components/Icon/Icon.stories.d.ts +0 -1
- package/dist/components/Icon/index.d.ts +1 -2
- package/dist/components/KebabMenu/KebabMenu.stories.d.ts +8 -0
- package/dist/components/KebabMenu/index.d.ts +11 -0
- package/dist/components/LabelChip/index.d.ts +10 -0
- package/dist/components/MenuItem/index.d.ts +5 -2
- package/dist/components/MenuList/index.d.ts +1 -2
- package/dist/components/Modal/Modal.stories.d.ts +0 -1
- package/dist/components/Modal/index.d.ts +0 -1
- package/dist/components/Popover/index.d.ts +19 -0
- package/dist/components/SidebarOverlay/index.d.ts +17 -0
- package/dist/components/SplitButton/SplitButton.stories.d.ts +0 -1
- package/dist/components/SplitButton/index.d.ts +1 -2
- package/dist/components/TableContentLoader/index.d.ts +7 -0
- package/dist/components/TableLayout/index.d.ts +2 -2
- package/dist/components/Tabs/index.d.ts +14 -0
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/Toggle/index.d.ts +0 -1
- package/dist/components/Tooltip/index.d.ts +2 -1
- package/dist/components/index.d.ts +8 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -25
- package/dist/index.js.map +1 -1
- package/dist/index10.js +24 -24
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +30 -15
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +19 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +97 -53
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +27 -12
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +66 -33
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +70 -31
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +20 -8
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +23 -6
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +58 -148
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +135 -8
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +19 -2
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +45 -26
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +30 -606
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +2 -10
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +1 -9
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +2 -5
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +2 -170
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +2 -11
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +2 -2
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +69 -0
- package/dist/index3.js.map +1 -0
- package/dist/index30.js +2 -2
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +1 -5
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +149 -6
- package/dist/index32.js.map +1 -1
- package/dist/index35.js +9 -7
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +9 -326
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +4 -49
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +170 -2
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +11 -76
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +32 -34
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +5 -92
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +5 -51
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +37 -7
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +2 -5
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +7 -51
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +327 -2
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +50 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +5 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +79 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +96 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +63 -7
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +55 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +11 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +8 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +55 -0
- package/dist/index53.js.map +1 -0
- package/dist/index54.js +5 -0
- package/dist/index54.js.map +1 -0
- package/dist/index55.js +5 -0
- package/dist/index55.js.map +1 -0
- package/dist/index6.js +24 -35
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +7 -40
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +28 -3
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +30 -19
- package/dist/index9.js.map +1 -1
- package/package.json +16 -10
- package/dist/components/Popup/index.d.ts +0 -15
- package/dist/index33.js +0 -41
- package/dist/index33.js.map +0 -1
- package/dist/index34.js +0 -5
- package/dist/index34.js.map +0 -1
- package/dist/public/colors.css +0 -1
- package/dist/public/style.css +0 -1
- /package/dist/{public → assets}/icons/back.svg +0 -0
- /package/dist/{public → assets}/icons/close.svg +0 -0
- /package/dist/{public → assets}/icons/down.svg +0 -0
- /package/dist/{public → assets}/icons/hamburger.svg +0 -0
- /package/dist/{public → assets}/icons/pages.svg +0 -0
- /package/dist/{public → assets}/icons/tick.svg +0 -0
package/dist/index17.js
CHANGED
@@ -1,13 +1,25 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import u, { useState as h } from "react";
|
2
|
+
const g = ({
|
3
|
+
className: a = "",
|
4
|
+
automationId: c = "",
|
5
|
+
defaultChecked: l = !1,
|
6
|
+
disabled: o = !1,
|
7
|
+
onChange: r
|
8
|
+
}) => {
|
9
|
+
const [e, n] = h(l), s = () => {
|
5
10
|
const t = !e;
|
6
|
-
|
7
|
-
}, d = e ? "text-[var(--color-blue-500)]" : "text-[var(--color-white)]";
|
8
|
-
return /* @__PURE__ */
|
11
|
+
n(t), r && r(t);
|
12
|
+
}, d = o ? "bg-[var(--color-gray-600)] text-[var(--color-gray-600)] hover:text-[var(--color-gray-600)] bg-[var(--color-gray-600)] cursor-not-allowed" : e ? "text-[var(--color-blue-500)]" : "text-[var(--color-white)]";
|
13
|
+
return /* @__PURE__ */ u.createElement("input", {
|
14
|
+
type: "checkbox",
|
15
|
+
className: `${a} block w-4 h-4 ${d} hover:text-[var(--color-blue-600)] border-[var(--color-gray-500)] rounded-md focus:ring-transparent cursor-pointer`,
|
16
|
+
"data-automation-id": c,
|
17
|
+
checked: e,
|
18
|
+
onChange: s,
|
19
|
+
disabled: o
|
20
|
+
});
|
9
21
|
};
|
10
22
|
export {
|
11
|
-
|
23
|
+
g as Checkbox
|
12
24
|
};
|
13
25
|
//# sourceMappingURL=index17.js.map
|
package/dist/index17.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index17.js","sources":["../src/components/Checkbox/index.tsx"],"sourcesContent":["import { FC, useState } from 'react';\n\nexport interface CheckboxProps {\n className?: string;\n automationId?: string;\n defaultChecked?: boolean;\n onChange?: (checked: boolean) => void;\n}\n\nexport const Checkbox: FC<CheckboxProps> = ({ className = '', automationId = '', defaultChecked = false, onChange }) => {\n const [isChecked, setIsChecked] = useState(defaultChecked);\n\n const handleClick = () => {\n const newCheckedState = !isChecked;\n setIsChecked(newCheckedState);\n if(onChange) {\n onChange(newCheckedState);\n }\n }\n const backgroundColor = isChecked ? 'text-[var(--color-blue-500)]' : 'text-[var(--color-white)]';\n \n return <input type=\"checkbox\" className={`${className} w-4 h-4 ${backgroundColor} hover:text-[var(--color-blue-600)] border-[var(--color-gray-500)] rounded-md focus:ring-transparent cursor-pointer`} data-automation-id={automationId} checked={isChecked} onChange={handleClick} />;\n};\n"],"names":["
|
1
|
+
{"version":3,"file":"index17.js","sources":["../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\n\nexport interface CheckboxProps {\n className?: string;\n automationId?: string;\n defaultChecked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nexport const Checkbox: FC<CheckboxProps> = ({ className = '', automationId = '', defaultChecked = false, disabled = false, onChange }) => {\n const [isChecked, setIsChecked] = useState(defaultChecked);\n\n const handleClick = () => {\n const newCheckedState = !isChecked;\n setIsChecked(newCheckedState);\n if(onChange) {\n onChange(newCheckedState);\n }\n }\n const backgroundColor = disabled ? 'bg-[var(--color-gray-600)] text-[var(--color-gray-600)] hover:text-[var(--color-gray-600)] bg-[var(--color-gray-600)] cursor-not-allowed' : isChecked ? 'text-[var(--color-blue-500)]' : 'text-[var(--color-white)]';\n \n return <input type=\"checkbox\" className={`${className} block w-4 h-4 ${backgroundColor} hover:text-[var(--color-blue-600)] border-[var(--color-gray-500)] rounded-md focus:ring-transparent cursor-pointer`} data-automation-id={automationId} checked={isChecked} onChange={handleClick} disabled={disabled} />;\n};\n"],"names":["Checkbox","className","automationId","defaultChecked","disabled","onChange","isChecked","setIsChecked","useState","handleClick","newCheckedState","backgroundColor","React","createElement","type","checked"],"mappings":";AAUO,MAAMA,IAA8BA,CAAC;AAAA,EAAEC,WAAAA,IAAY;AAAA,EAAIC,cAAAA,IAAe;AAAA,EAAIC,gBAAAA,IAAiB;AAAA,EAAOC,UAAAA,IAAW;AAAA,EAAOC,UAAAA;AAAS,MAAM;AACtI,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAASL,CAAc,GAEnDM,IAAcA,MAAM;AACtB,UAAMC,IAAkB,CAACJ;AACzBC,IAAAA,EAAaG,CAAe,GACzBL,KACCA,EAASK,CAAe;AAAA,EAEhC,GACMC,IAAkBP,IAAW,6IAA6IE,IAAY,iCAAiC;AAExNM,SAAAA,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IAAOC,MAAK;AAAA,IAAWb,WAAW,GAAGA,CAAS,kBAAkBU,CAAe;AAAA,IAAuH,sBAAoBT;AAAAA,IAAca,SAAST;AAAAA,IAAWD,UAAUI;AAAAA,IAAaL,UAAAA;AAAAA,EAAAA,CAAqB;AACjT;"}
|
package/dist/index18.js
CHANGED
@@ -1,9 +1,26 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import e from "react";
|
2
|
+
import { Tag as n } from "./index7.js";
|
3
|
+
const s = (a) => {
|
4
|
+
const {
|
5
|
+
label: o,
|
6
|
+
color: l,
|
7
|
+
onClick: r = () => {
|
8
|
+
},
|
9
|
+
tag: t
|
10
|
+
} = a;
|
11
|
+
return /* @__PURE__ */ e.createElement("div", {
|
12
|
+
className: "flex items-center gap-2",
|
13
|
+
onClick: r
|
14
|
+
}, l && /* @__PURE__ */ e.createElement("span", {
|
15
|
+
className: "w-[15px] h-[15px] rounded-[3px] inline-block",
|
16
|
+
style: {
|
17
|
+
backgroundColor: l
|
18
|
+
}
|
19
|
+
}), /* @__PURE__ */ e.createElement("div", null, o), t && /* @__PURE__ */ e.createElement(n, {
|
20
|
+
label: t
|
21
|
+
}));
|
22
|
+
};
|
6
23
|
export {
|
7
|
-
|
24
|
+
s as ColorCodedLabel
|
8
25
|
};
|
9
26
|
//# sourceMappingURL=index18.js.map
|
package/dist/index18.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index18.js","sources":["../
|
1
|
+
{"version":3,"file":"index18.js","sources":["../src/components/ColorCodedLabel/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Tag } from 'src/components/Tag';\n\nexport type ColorCodedLabelProps = {\n label: string;\n tag?: string;\n color?: string;\n onClick?: () => void;\n};\n\nexport const ColorCodedLabel: FC<ColorCodedLabelProps> = (props) => {\n const { label, color, onClick = () => {}, tag } = props;\n return (\n <div\n className=\"flex items-center gap-2\"\n onClick={onClick}\n >\n {color && <span className=\"w-[15px] h-[15px] rounded-[3px] inline-block\" style={{ backgroundColor: color }}></span>}\n <div>{label}</div>\n {tag && <Tag label={tag} />}\n </div>\n );\n};\n"],"names":["React__default","Tag","ColorCodedLabel","props","label","color","onClick","tag","React","createElement","className","style","backgroundColor"],"mappings":"AAUO,OAAAA,OAAA;AAAA,SAAA,OAAAC,SAAA;AAAA,MAAMC,IAA6CC,CAAUA,MAAA;AAC5D,QAAA;AAAA,IAAEC,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAAOC,SAAAA,IAAUA,MAAM;AAAA,IAAC;AAAA,IAAGC,KAAAA;AAAAA,EAAAA,IAAQJ;AAEhDK,SAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVJ,SAAAA;AAAAA,EAECD,GAAAA,KAASI,gBAAAA,EAAAA,cAAA,QAAA;AAAA,IAAMC,WAAU;AAAA,IAA+CC,OAAO;AAAA,MAAEC,iBAAiBP;AAAAA,IAAAA;AAAAA,EAAe,CAAA,GAClHG,gBAAAA,EAAAC,cAAML,OAAAA,MAAAA,CAAW,GAChBG,KAAOE,gBAAAA,EAAAA,cAACR,GAAG;AAAA,IAACG,OAAOG;AAAAA,EAAAA,CAAM,CACvB;AAET;"}
|
package/dist/index19.js
CHANGED
@@ -1,152 +1,62 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
}, function() {
|
59
|
-
try {
|
60
|
-
y(d);
|
61
|
-
} catch (m) {
|
62
|
-
I(m);
|
63
|
-
}
|
64
|
-
});
|
65
|
-
}, M = function(i) {
|
66
|
-
if (i.setAttribute("role", "img"), a) {
|
67
|
-
var d = i.querySelector(":scope > desc");
|
68
|
-
d && i.removeChild(d);
|
69
|
-
var m = document.createElement("desc");
|
70
|
-
m.innerHTML = a, i.prepend(m);
|
71
|
-
}
|
72
|
-
if (b) {
|
73
|
-
var j = i.querySelector(":scope > title");
|
74
|
-
j && i.removeChild(j);
|
75
|
-
var C = document.createElement("title");
|
76
|
-
C.innerHTML = b, i.prepend(C);
|
77
|
-
}
|
78
|
-
try {
|
79
|
-
x(i);
|
80
|
-
} catch (k) {
|
81
|
-
I(k);
|
82
|
-
}
|
83
|
-
};
|
84
|
-
A(p, {
|
85
|
-
afterEach: L,
|
86
|
-
beforeEach: M,
|
87
|
-
cacheRequests: g,
|
88
|
-
evalScripts: u,
|
89
|
-
httpRequestWithCredentials: S,
|
90
|
-
renumerateIRIElements: E
|
91
|
-
});
|
92
|
-
}
|
93
|
-
}, o.removeSVG = function() {
|
94
|
-
var e;
|
95
|
-
(e = this.nonReactWrapper) != null && e.parentNode && (this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper), this.nonReactWrapper = null);
|
96
|
-
}, o.componentDidMount = function() {
|
97
|
-
this._isMounted = !0, this.renderSVG();
|
98
|
-
}, o.componentDidUpdate = function(e) {
|
99
|
-
var n = this;
|
100
|
-
U(R({}, e), this.props) && this.setState(function() {
|
101
|
-
return n.initialState;
|
102
|
-
}, function() {
|
103
|
-
n.removeSVG(), n.renderSVG();
|
104
|
-
});
|
105
|
-
}, o.componentWillUnmount = function() {
|
106
|
-
this._isMounted = !1, this.removeSVG();
|
107
|
-
}, o.render = function() {
|
108
|
-
var e = this.props, n = e.fallback, a = e.loading, u = e.wrapper, S = N(e, H), E = u;
|
109
|
-
return /* @__PURE__ */ h.createElement(E, R({}, S, {
|
110
|
-
ref: this.refCallback
|
111
|
-
}, u === "svg" ? {
|
112
|
-
xmlns: v,
|
113
|
-
xmlnsXlink: q
|
114
|
-
} : {}), this.state.isLoading && a && /* @__PURE__ */ h.createElement(a, null), this.state.hasError && n && /* @__PURE__ */ h.createElement(n, null));
|
115
|
-
}, s;
|
116
|
-
}(h.Component);
|
117
|
-
V.defaultProps = {
|
118
|
-
afterInjection: function() {
|
119
|
-
},
|
120
|
-
beforeInjection: function() {
|
121
|
-
},
|
122
|
-
desc: "",
|
123
|
-
evalScripts: "never",
|
124
|
-
fallback: null,
|
125
|
-
httpRequestWithCredentials: !1,
|
126
|
-
loading: null,
|
127
|
-
onError: function() {
|
128
|
-
},
|
129
|
-
renumerateIRIElements: !0,
|
130
|
-
title: "",
|
131
|
-
useRequestCache: !0,
|
132
|
-
wrapper: "div"
|
133
|
-
};
|
134
|
-
V.propTypes = {
|
135
|
-
afterInjection: t.func,
|
136
|
-
beforeInjection: t.func,
|
137
|
-
desc: t.string,
|
138
|
-
evalScripts: t.oneOf(["always", "once", "never"]),
|
139
|
-
fallback: t.oneOfType([t.func, t.object, t.string]),
|
140
|
-
httpRequestWithCredentials: t.bool,
|
141
|
-
loading: t.oneOfType([t.func, t.object, t.string]),
|
142
|
-
onError: t.func,
|
143
|
-
renumerateIRIElements: t.bool,
|
144
|
-
src: t.string.isRequired,
|
145
|
-
title: t.string,
|
146
|
-
useRequestCache: t.bool,
|
147
|
-
wrapper: t.oneOf(["div", "span", "svg"])
|
1
|
+
var $ = Object.defineProperty, k = Object.defineProperties;
|
2
|
+
var V = Object.getOwnPropertyDescriptors;
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
4
|
+
var I = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
5
|
+
var y = (e, t, o) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, C = (e, t) => {
|
6
|
+
for (var o in t || (t = {}))
|
7
|
+
I.call(t, o) && y(e, o, t[o]);
|
8
|
+
if (w)
|
9
|
+
for (var o of w(t))
|
10
|
+
O.call(t, o) && y(e, o, t[o]);
|
11
|
+
return e;
|
12
|
+
}, D = (e, t) => k(e, V(t));
|
13
|
+
import r, { useState as S, useRef as R } from "react";
|
14
|
+
import { Popover as T } from "./index13.js";
|
15
|
+
import { Icon as _ } from "./index4.js";
|
16
|
+
const q = (e) => {
|
17
|
+
const [t, o] = S(!1), [d, g] = S(() => (e == null ? void 0 : e.defaultSelectedValue) || {}), u = R(null), {
|
18
|
+
selectBy: i = "",
|
19
|
+
optionsUniqueBy: c = "",
|
20
|
+
displaySelected: E = !1,
|
21
|
+
dropDownOptions: m,
|
22
|
+
defaultText: f = "Select"
|
23
|
+
} = e, h = (n) => {
|
24
|
+
var l, a;
|
25
|
+
g(n), (l = u.current) == null || l.togglePopup(), (a = e == null ? void 0 : e.onOptionClick) == null || a.call(e, n);
|
26
|
+
}, v = (n) => e != null && e.renderOptionChip ? e == null ? void 0 : e.renderOptionChip(n) : /* @__PURE__ */ r.createElement("span", {
|
27
|
+
className: "option-chip"
|
28
|
+
}, n[i] || f), x = (n) => {
|
29
|
+
const l = n[i], a = d[i] || f, P = c != null && c.length ? n[c] == d[c] : !0, s = E && l === a && P;
|
30
|
+
return /* @__PURE__ */ r.createElement("div", {
|
31
|
+
key: `$drop-option-${l}`,
|
32
|
+
className: `option px-3 py-2 hover:bg-gray-100 cursor-pointer flex items-center justify-between ${s ? "selected" : ""}`,
|
33
|
+
onClick: () => h(n)
|
34
|
+
}, v(D(C({}, n), {
|
35
|
+
isOptionSelected: s
|
36
|
+
})), s && /* @__PURE__ */ r.createElement("div", null, "✓"));
|
37
|
+
}, b = () => /* @__PURE__ */ r.createElement("div", {
|
38
|
+
className: "dropdown-content dropdown-options"
|
39
|
+
}, m == null ? void 0 : m.map((n) => x(n))), N = () => {
|
40
|
+
const l = `dropdown-src-element flex px-3 py-2 border rounded-md ${t ? "border-[var(--color-gray-900)]" : "border-[var(--color-gray-200)]"}`;
|
41
|
+
return /* @__PURE__ */ r.createElement("div", {
|
42
|
+
className: l
|
43
|
+
}, v(d), /* @__PURE__ */ r.createElement(_, {
|
44
|
+
name: "down",
|
45
|
+
className: `ml-auto ${t ? "rotate-180" : ""} transition-transform`
|
46
|
+
}));
|
47
|
+
};
|
48
|
+
return /* @__PURE__ */ r.createElement("div", {
|
49
|
+
className: "dropdown-container",
|
50
|
+
style: e == null ? void 0 : e.style
|
51
|
+
}, /* @__PURE__ */ r.createElement(T, {
|
52
|
+
ref: u,
|
53
|
+
renderPopoverContents: b,
|
54
|
+
contentWidth: "full",
|
55
|
+
renderPopoverSrcElement: N,
|
56
|
+
onPopoverToggle: (n) => o(n)
|
57
|
+
}));
|
148
58
|
};
|
149
59
|
export {
|
150
|
-
|
60
|
+
q as Dropdown
|
151
61
|
};
|
152
62
|
//# sourceMappingURL=index19.js.map
|
package/dist/index19.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index19.js","sources":["../node_modules/react-svg/dist/react-svg.esm.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport { SVGInjector } from '@tanem/svg-injector';\nimport * as PropTypes from 'prop-types';\nimport * as React from 'react';\n\n// Hat-tip: https://github.com/mui/material-ui/tree/master/packages/mui-utils/src.\nvar ownerWindow = function ownerWindow(node) {\n var doc = (node == null ? void 0 : node.ownerDocument) || document;\n return doc.defaultView || window;\n};\n\n// Hat-tip: https://github.com/developit/preact-compat/blob/master/src/index.js#L402.\nvar shallowDiffers = function shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) {\n return true;\n }\n }\n for (var _i in b) {\n if (a[_i] !== b[_i]) {\n return true;\n }\n }\n return false;\n};\n\nvar _excluded = [\"afterInjection\", \"beforeInjection\", \"desc\", \"evalScripts\", \"fallback\", \"httpRequestWithCredentials\", \"loading\", \"renumerateIRIElements\", \"src\", \"title\", \"useRequestCache\", \"wrapper\"];\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar ReactSVG = /*#__PURE__*/function (_React$Component) {\n function ReactSVG() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.initialState = {\n hasError: false,\n isLoading: true\n };\n _this.state = _this.initialState;\n _this._isMounted = false;\n _this.reactWrapper = void 0;\n _this.nonReactWrapper = void 0;\n _this.refCallback = function (reactWrapper) {\n _this.reactWrapper = reactWrapper;\n };\n return _this;\n }\n _inheritsLoose(ReactSVG, _React$Component);\n var _proto = ReactSVG.prototype;\n _proto.renderSVG = function renderSVG() {\n var _this2 = this;\n /* istanbul ignore else */\n if (this.reactWrapper instanceof ownerWindow(this.reactWrapper).Node) {\n var _this$props = this.props,\n desc = _this$props.desc,\n evalScripts = _this$props.evalScripts,\n httpRequestWithCredentials = _this$props.httpRequestWithCredentials,\n renumerateIRIElements = _this$props.renumerateIRIElements,\n src = _this$props.src,\n title = _this$props.title,\n useRequestCache = _this$props.useRequestCache;\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n var onError = this.props.onError;\n var beforeInjection = this.props.beforeInjection;\n var afterInjection = this.props.afterInjection;\n var wrapper = this.props.wrapper;\n var nonReactWrapper;\n var nonReactTarget;\n if (wrapper === 'svg') {\n nonReactWrapper = document.createElementNS(svgNamespace, wrapper);\n nonReactWrapper.setAttribute('xmlns', svgNamespace);\n nonReactWrapper.setAttribute('xmlns:xlink', xlinkNamespace);\n nonReactTarget = document.createElementNS(svgNamespace, wrapper);\n } else {\n nonReactWrapper = document.createElement(wrapper);\n nonReactTarget = document.createElement(wrapper);\n }\n nonReactWrapper.appendChild(nonReactTarget);\n nonReactTarget.dataset.src = src;\n this.nonReactWrapper = this.reactWrapper.appendChild(nonReactWrapper);\n var handleError = function handleError(error) {\n _this2.removeSVG();\n if (!_this2._isMounted) {\n onError(error);\n return;\n }\n _this2.setState(function () {\n return {\n hasError: true,\n isLoading: false\n };\n }, function () {\n onError(error);\n });\n };\n var afterEach = function afterEach(error, svg) {\n if (error) {\n handleError(error);\n return;\n }\n // TODO (Tane): It'd be better to cleanly unsubscribe from SVGInjector\n // callbacks instead of tracking a property like this.\n if (_this2._isMounted) {\n _this2.setState(function () {\n return {\n isLoading: false\n };\n }, function () {\n try {\n afterInjection(svg);\n } catch (afterInjectionError) {\n handleError(afterInjectionError);\n }\n });\n }\n };\n var beforeEach = function beforeEach(svg) {\n svg.setAttribute('role', 'img');\n if (desc) {\n var originalDesc = svg.querySelector(':scope > desc');\n if (originalDesc) {\n svg.removeChild(originalDesc);\n }\n var newDesc = document.createElement('desc');\n newDesc.innerHTML = desc;\n svg.prepend(newDesc);\n }\n if (title) {\n var originalTitle = svg.querySelector(':scope > title');\n if (originalTitle) {\n svg.removeChild(originalTitle);\n }\n var newTitle = document.createElement('title');\n newTitle.innerHTML = title;\n svg.prepend(newTitle);\n }\n try {\n beforeInjection(svg);\n } catch (error) {\n handleError(error);\n }\n };\n SVGInjector(nonReactTarget, {\n afterEach: afterEach,\n beforeEach: beforeEach,\n cacheRequests: useRequestCache,\n evalScripts: evalScripts,\n httpRequestWithCredentials: httpRequestWithCredentials,\n renumerateIRIElements: renumerateIRIElements\n });\n }\n };\n _proto.removeSVG = function removeSVG() {\n var _this$nonReactWrapper;\n if ((_this$nonReactWrapper = this.nonReactWrapper) != null && _this$nonReactWrapper.parentNode) {\n this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper);\n this.nonReactWrapper = null;\n }\n };\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.renderSVG();\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this3 = this;\n if (shallowDiffers(_extends({}, prevProps), this.props)) {\n this.setState(function () {\n return _this3.initialState;\n }, function () {\n _this3.removeSVG();\n _this3.renderSVG();\n });\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeSVG();\n };\n _proto.render = function render() {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n var _this$props2 = this.props;\n _this$props2.afterInjection;\n _this$props2.beforeInjection;\n _this$props2.desc;\n _this$props2.evalScripts;\n var Fallback = _this$props2.fallback;\n _this$props2.httpRequestWithCredentials;\n var Loading = _this$props2.loading;\n _this$props2.renumerateIRIElements;\n _this$props2.src;\n _this$props2.title;\n _this$props2.useRequestCache;\n var wrapper = _this$props2.wrapper,\n rest = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n /* eslint-enable @typescript-eslint/no-unused-vars */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var Wrapper = wrapper;\n return /*#__PURE__*/React.createElement(Wrapper, _extends({}, rest, {\n ref: this.refCallback\n }, wrapper === 'svg' ? {\n xmlns: svgNamespace,\n xmlnsXlink: xlinkNamespace\n } : {}), this.state.isLoading && Loading && /*#__PURE__*/React.createElement(Loading, null), this.state.hasError && Fallback && /*#__PURE__*/React.createElement(Fallback, null));\n };\n return ReactSVG;\n}(React.Component);\nReactSVG.defaultProps = {\n afterInjection: function afterInjection() {\n return undefined;\n },\n beforeInjection: function beforeInjection() {\n return undefined;\n },\n desc: '',\n evalScripts: 'never',\n fallback: null,\n httpRequestWithCredentials: false,\n loading: null,\n onError: function onError() {\n return undefined;\n },\n renumerateIRIElements: true,\n title: '',\n useRequestCache: true,\n wrapper: 'div'\n};\nReactSVG.propTypes = {\n afterInjection: PropTypes.func,\n beforeInjection: PropTypes.func,\n desc: PropTypes.string,\n evalScripts: PropTypes.oneOf(['always', 'once', 'never']),\n fallback: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n httpRequestWithCredentials: PropTypes.bool,\n loading: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n onError: PropTypes.func,\n renumerateIRIElements: PropTypes.bool,\n src: PropTypes.string.isRequired,\n title: PropTypes.string,\n useRequestCache: PropTypes.bool,\n wrapper: PropTypes.oneOf(['div', 'span', 'svg'])\n} ;\n\nexport { ReactSVG };\n//# sourceMappingURL=react-svg.esm.js.map\n"],"names":["_objectWithoutPropertiesLoose","_extends","_inheritsLoose","SVGInjector","propTypesExports","React","ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_proto","_this2","_this$props","desc","evalScripts","httpRequestWithCredentials","renumerateIRIElements","src","title","useRequestCache","onError","beforeInjection","afterInjection","wrapper","nonReactWrapper","nonReactTarget","handleError","error","afterEach","svg","afterInjectionError","beforeEach","originalDesc","newDesc","originalTitle","newTitle","_this$nonReactWrapper","prevProps","_this3","_this$props2","Fallback","Loading","rest","Wrapper","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":"AAOA,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,KAAAC,SAAA;AAAA,YAAAC,OAAA;AACA,IAAIC,IAAc,SAAqBC,GAAM;AAC3C,MAAIC,KAAOD,KAAQ,OAAO,SAASA,EAAK,kBAAkB;AAC1D,SAAOC,EAAI,eAAe;AAC5B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,EACvB,uBAAuBK,EAAc;AAAA,EACrC,KAAKJ,EAAgB,OAAC;AAAA,EACtB,OAAOA,EAAgB;AAAA,EACvB,iBAAiBI,EAAc;AAAA,EAC/B,SAASH,EAAAA,MAAgB,CAAC,OAAO,QAAQ,KAAK,CAAC;AACjD;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index19.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef } 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>(() => props?.defaultSelectedValue || {});\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n\n const { selectBy = '', optionsUniqueBy = '', displaySelected = false, dropDownOptions, defaultText = 'Select' } = props;\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValue(dropDownOption);\n popoverRef.current?.togglePopup();\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 <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 && <div>✓</div>}\n </div>;\n }\n\n const renderDropdownContents = () => {\n return <div className=\"dropdown-content dropdown-options\">{dropDownOptions?.map((dropDownOption) => dropDownOptionJsx(dropDownOption))}</div>;\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen ? 'border-[var(--color-gray-900)]' : 'border-[var(--color-gray-200)]';\n const drowDownSelectClass = `dropdown-src-element flex px-3 py-2 border rounded-md ${borderColor}`;\n\n return <div className={drowDownSelectClass}>\n {optionChip(selectedDropDownValue)}\n <Icon name=\"down\" className={`ml-auto ${isDropDownOpen ? 'rotate-180' : ''} transition-transform`} />\n </div>;\n };\n\n return (\n <div className=\"dropdown-container\" style={props?.style}>\n <Popover ref={popoverRef} renderPopoverContents={renderDropdownContents} contentWidth={'full'} renderPopoverSrcElement={renderDropdownSelect} onPopoverToggle={(value) => setIsDropDownOpen(value)} />\n </div>\n );\n};\n"],"names":["React__default","useState","useRef","Popover","Icon","Dropdown","props","isDropDownOpen","setIsDropDownOpen","selectedDropDownValue","setSelectedDropDownValue","defaultSelectedValue","popoverRef","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","handleDropDownOptionClick","dropDownOption","_a","_b","current","togglePopup","onOptionClick","optionChip","option","renderOptionChip","React","createElement","className","dropDownOptionJsx","optionTxt","dropDownSelectedValue","selectByUniqueId","length","isOptionSelected","key","onClick","__spreadProps","__spreadValues","renderDropdownContents","map","renderDropdownSelect","drowDownSelectClass","name","style","ref","renderPopoverContents","contentWidth","renderPopoverSrcElement","onPopoverToggle","value"],"mappings":";;;;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|
4
|
+
menuItems: n,
|
5
|
+
onMenuItemClick: o,
|
6
|
+
activeItem: l = "",
|
7
|
+
variant: a = "primary",
|
8
|
+
className: C = "",
|
9
|
+
automationId: i = ""
|
10
|
+
}) => {
|
11
|
+
const s = () => {
|
12
|
+
switch (a) {
|
13
|
+
case "primary":
|
14
|
+
return /* @__PURE__ */ e.createElement("svg", {
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
16
|
+
width: "24",
|
17
|
+
height: "24",
|
18
|
+
viewBox: "0 0 24 24",
|
19
|
+
fill: "none"
|
20
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
21
|
+
d: "M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",
|
22
|
+
fill: "#5E6673"
|
23
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
24
|
+
d: "M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",
|
25
|
+
fill: "#5E6673"
|
26
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
27
|
+
d: "M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",
|
28
|
+
fill: "#5E6673"
|
29
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
30
|
+
d: "M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",
|
31
|
+
stroke: "#5E6673",
|
32
|
+
"stroke-linecap": "round",
|
33
|
+
"stroke-linejoin": "round"
|
34
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
35
|
+
d: "M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",
|
36
|
+
stroke: "#5E6673",
|
37
|
+
"stroke-linecap": "round",
|
38
|
+
"stroke-linejoin": "round"
|
39
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
40
|
+
d: "M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",
|
41
|
+
stroke: "#5E6673",
|
42
|
+
"stroke-linecap": "round",
|
43
|
+
"stroke-linejoin": "round"
|
44
|
+
}));
|
45
|
+
case "secondary":
|
46
|
+
return /* @__PURE__ */ e.createElement("svg", {
|
47
|
+
xmlns: "http://www.w3.org/2000/svg",
|
48
|
+
width: "24",
|
49
|
+
height: "24",
|
50
|
+
viewBox: "0 0 24 24",
|
51
|
+
fill: "none"
|
52
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
53
|
+
d: "M12 14C12.5523 14 13 13.5523 13 13C13 12.4477 12.5523 12 12 12C11.4477 12 11 12.4477 11 13C11 13.5523 11.4477 14 12 14Z",
|
54
|
+
fill: "#1088E7"
|
55
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
56
|
+
d: "M19 14C19.5523 14 20 13.5523 20 13C20 12.4477 19.5523 12 19 12C18.4477 12 18 12.4477 18 13C18 13.5523 18.4477 14 19 14Z",
|
57
|
+
fill: "#1088E7"
|
58
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
59
|
+
d: "M5 14C5.55228 14 6 13.5523 6 13C6 12.4477 5.55228 12 5 12C4.44772 12 4 12.4477 4 13C4 13.5523 4.44772 14 5 14Z",
|
60
|
+
fill: "#1088E7"
|
61
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
62
|
+
d: "M12 14C12.5523 14 13 13.5523 13 13C13 12.4477 12.5523 12 12 12C11.4477 12 11 12.4477 11 13C11 13.5523 11.4477 14 12 14Z",
|
63
|
+
stroke: "#1088E7",
|
64
|
+
strokeLinecap: "round",
|
65
|
+
strokeLinejoin: "round"
|
66
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
67
|
+
d: "M19 14C19.5523 14 20 13.5523 20 13C20 12.4477 19.5523 12 19 12C18.4477 12 18 12.4477 18 13C18 13.5523 18.4477 14 19 14Z",
|
68
|
+
stroke: "#1088E7",
|
69
|
+
strokeLinecap: "round",
|
70
|
+
strokeLinejoin: "round"
|
71
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
72
|
+
d: "M5 14C5.55228 14 6 13.5523 6 13C6 12.4477 5.55228 12 5 12C4.44772 12 4 12.4477 4 13C4 13.5523 4.44772 14 5 14Z",
|
73
|
+
stroke: "#1088E7",
|
74
|
+
strokeLinecap: "round",
|
75
|
+
strokeLinejoin: "round"
|
76
|
+
}));
|
77
|
+
default:
|
78
|
+
return /* @__PURE__ */ e.createElement("svg", {
|
79
|
+
xmlns: "http://www.w3.org/2000/svg",
|
80
|
+
width: "24",
|
81
|
+
height: "24",
|
82
|
+
viewBox: "0 0 24 24",
|
83
|
+
fill: "none"
|
84
|
+
}, /* @__PURE__ */ e.createElement("path", {
|
85
|
+
d: "M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",
|
86
|
+
fill: "#5E6673"
|
87
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
88
|
+
d: "M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",
|
89
|
+
fill: "#5E6673"
|
90
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
91
|
+
d: "M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",
|
92
|
+
fill: "#5E6673"
|
93
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
94
|
+
d: "M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",
|
95
|
+
stroke: "#5E6673",
|
96
|
+
"stroke-linecap": "round",
|
97
|
+
"stroke-linejoin": "round"
|
98
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
99
|
+
d: "M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",
|
100
|
+
stroke: "#5E6673",
|
101
|
+
"stroke-linecap": "round",
|
102
|
+
"stroke-linejoin": "round"
|
103
|
+
}), /* @__PURE__ */ e.createElement("path", {
|
104
|
+
d: "M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",
|
105
|
+
stroke: "#5E6673",
|
106
|
+
"stroke-linecap": "round",
|
107
|
+
"stroke-linejoin": "round"
|
108
|
+
}));
|
109
|
+
}
|
110
|
+
};
|
111
|
+
return /* @__PURE__ */ e.createElement(c, {
|
112
|
+
className: C,
|
113
|
+
position: "bottom-left",
|
114
|
+
automationId: i,
|
115
|
+
renderPopoverSrcElement: ({
|
116
|
+
displayPopover: r
|
117
|
+
}) => /* @__PURE__ */ e.createElement("div", {
|
118
|
+
className: `${r ? "bg-[var(--color-blue-100)]" : ""} hover:bg-[var(--color-blue-100)] rounded-[6px] transition-all duration-300 w-max`
|
119
|
+
}, s()),
|
120
|
+
renderPopoverContents: ({
|
121
|
+
closePopoverCb: r
|
122
|
+
}) => /* @__PURE__ */ e.createElement("div", {
|
123
|
+
className: "min-w-[212px]"
|
124
|
+
}, n.map((t, d) => /* @__PURE__ */ e.createElement("div", {
|
125
|
+
key: d,
|
126
|
+
className: "w-full text-left p-2",
|
127
|
+
onClick: () => {
|
128
|
+
o && !t.isDisabled && o(t.label), !t.isDisabled && r();
|
129
|
+
}
|
130
|
+
}, /* @__PURE__ */ e.createElement("p", {
|
131
|
+
className: `py-2 px-1 hover:bg-[var(--color-blue-100)] rounded-[6px] ${l.toLowerCase() === t.label.toLowerCase() ? "bg-[var(--color-blue-100)]" : ""} ${t.isDisabled ? "text-[var(--color-gray-600)] hover:bg-transparent cursor-not-allowed" : ""}`
|
132
|
+
}, t.label))))
|
133
|
+
});
|
134
|
+
};
|
8
135
|
export {
|
9
|
-
|
136
|
+
m as KebabMenu
|
10
137
|
};
|
11
138
|
//# sourceMappingURL=index20.js.map
|
package/dist/index20.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index20.js","sources":["../src/
|
1
|
+
{"version":3,"file":"index20.js","sources":["../src/components/KebabMenu/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { Popover } from 'src/components/Popover';\nimport { MenuItemProps } from 'src/components/MenuItem';\n// import { Icon } from 'src/components/Icon';\n\nexport interface KebabMenuProps {\n className?: string;\n automationId?: string;\n menuItems: MenuItemProps[];\n variant?: 'primary' | 'secondary';\n onMenuItemClick?: (label: string) => void;\n activeItem?: string;\n}\n\nexport const KebabMenu: FC<KebabMenuProps> = ({ menuItems, onMenuItemClick, activeItem='', variant = 'primary', className = '', automationId = '' }) => {\n const getIcon = () => {\n // TODO: Use Icon component once SVG issue is resolved\n switch(variant) {\n case 'primary':\n return <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z\" fill=\"#5E6673\"/>\n <path d=\"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z\" fill=\"#5E6673\"/>\n <path d=\"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z\" fill=\"#5E6673\"/>\n <path d=\"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n case 'secondary':\n return <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M12 14C12.5523 14 13 13.5523 13 13C13 12.4477 12.5523 12 12 12C11.4477 12 11 12.4477 11 13C11 13.5523 11.4477 14 12 14Z\" fill=\"#1088E7\"/>\n <path d=\"M19 14C19.5523 14 20 13.5523 20 13C20 12.4477 19.5523 12 19 12C18.4477 12 18 12.4477 18 13C18 13.5523 18.4477 14 19 14Z\" fill=\"#1088E7\"/>\n <path d=\"M5 14C5.55228 14 6 13.5523 6 13C6 12.4477 5.55228 12 5 12C4.44772 12 4 12.4477 4 13C4 13.5523 4.44772 14 5 14Z\" fill=\"#1088E7\"/>\n <path d=\"M12 14C12.5523 14 13 13.5523 13 13C13 12.4477 12.5523 12 12 12C11.4477 12 11 12.4477 11 13C11 13.5523 11.4477 14 12 14Z\" stroke=\"#1088E7\"strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M19 14C19.5523 14 20 13.5523 20 13C20 12.4477 19.5523 12 19 12C18.4477 12 18 12.4477 18 13C18 13.5523 18.4477 14 19 14Z\" stroke=\"#1088E7\"strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M5 14C5.55228 14 6 13.5523 6 13C6 12.4477 5.55228 12 5 12C4.44772 12 4 12.4477 4 13C4 13.5523 4.44772 14 5 14Z\" stroke=\"#1088E7\"strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n default:\n return <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z\" fill=\"#5E6673\"/>\n <path d=\"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z\" fill=\"#5E6673\"/>\n <path d=\"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z\" fill=\"#5E6673\"/>\n <path d=\"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z\" stroke=\"#5E6673\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n }\n }\n return <Popover\n className={className}\n position='bottom-left'\n automationId={automationId}\n renderPopoverSrcElement={({ displayPopover }) => (\n <div className={`${displayPopover ? 'bg-[var(--color-blue-100)]' : ''} hover:bg-[var(--color-blue-100)] rounded-[6px] transition-all duration-300 w-max`}>\n {getIcon()}\n </div>\n )}\n renderPopoverContents={({ closePopoverCb }) => (\n <div className=\"min-w-[212px]\">\n {menuItems.map((item, index) => (\n <div key={index} className='w-full text-left p-2' onClick={() => {\n if(onMenuItemClick && !item.isDisabled) {\n onMenuItemClick(item.label);\n }\n !item.isDisabled && closePopoverCb()}}>\n <p className={`py-2 px-1 hover:bg-[var(--color-blue-100)] rounded-[6px] ${activeItem.toLowerCase() === item.label.toLowerCase() ? 'bg-[var(--color-blue-100)]' : ''} ${item.isDisabled ? 'text-[var(--color-gray-600)] hover:bg-transparent cursor-not-allowed' : ''}`}>{item.label}</p></div>\n ))}\n </div>\n )}\n />\n};\n"],"names":["KebabMenu","menuItems","onMenuItemClick","activeItem","variant","className","automationId","getIcon","React","createElement","xmlns","width","height","viewBox","fill","d","stroke","strokeLinecap","strokeLinejoin","Popover","position","renderPopoverSrcElement","displayPopover","renderPopoverContents","closePopoverCb","map","item","index","key","onClick","isDisabled","label","toLowerCase"],"mappings":";;AAeO,MAAMA,IAAgCA,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAWC,iBAAAA;AAAAA,EAAiBC,YAAAA,IAAW;AAAA,EAAIC,SAAAA,IAAU;AAAA,EAAWC,WAAAA,IAAY;AAAA,EAAIC,cAAAA,IAAe;AAAG,MAAM;AACpJ,QAAMC,IAAUA,MAAM;AAElB,YAAOH,GAAO;AAAA,MACV,KAAK;AACMI,eAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,UAAKC,OAAM;AAAA,UAA6BC,OAAM;AAAA,UAAKC,QAAO;AAAA,UAAKC,SAAQ;AAAA,UAAYC,MAAK;AAAA,QAAA,GAC/FL,gBAAAA,EAAAA,cAAA,QAAA;AAAA,UAAMM,GAAE;AAAA,UAA0HD,MAAK;AAAA,QAAA,CAAU,GACjJL,gBAAAA,EAAAA,cAAA,QAAA;AAAA,UAAMM,GAAE;AAAA,UAA0HD,MAAK;AAAA,QAAA,CAAU,GACjJL,gB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+B,EAAE;AAAA,IAAoF,GACpJf,GACA;AAAA,IAEPgB,uBAAuBA,CAAC;AAAA,MAAEC,gBAAAA;AAAAA,IAAAA,MACxBf,gBAAAA,EAAAA,cAAA,OAAA;AAAA,MAAKJ,WAAU;AAAA,IAAA,GACZJ,EAAUwB,IAAI,CAACC,GAAMC,MACpBnB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKmB,KAAKD;AAAAA,MAAOtB,WAAU;AAAA,MAAuBwB,SAASA,MAAM;AAC1D3B,QAAAA,KAAmB,CAACwB,EAAKI,cACxB5B,EAAgBwB,EAAKK,KAAK,GAE3BL,CAAAA,EAAKI,cAAcN,EAAe;AAAA,MAAA;AAAA,IAAC,GACtCf,gBAAAA,EAAAA,cAAA,KAAA;AAAA,MAAGJ,WAAW,4DAA4DF,EAAW6B,kBAAkBN,EAAKK,MAAMC,YAAY,IAAI,+BAA+B,EAAE,IAAIN,EAAKI,aAAa,yEAAyE,EAAE;AAAA,IAAA,GAAKJ,EAAKK,KAAS,CAAM,CAClS,CACE;AAAA,EAAA,CAER;AACL;"}
|
package/dist/index21.js
CHANGED
@@ -1,5 +1,22 @@
|
|
1
|
-
|
1
|
+
import e from "react";
|
2
|
+
/* empty css */
|
3
|
+
const d = (a) => {
|
4
|
+
const {
|
5
|
+
noOfRows: n = 2,
|
6
|
+
noOfColumns: o = 4,
|
7
|
+
colSpan: r = [2, 0, 0]
|
8
|
+
} = a;
|
9
|
+
return [...Array(n)].map((m, l) => /* @__PURE__ */ e.createElement("tr", {
|
10
|
+
key: `tr-${l}`,
|
11
|
+
className: "table-content-loader"
|
12
|
+
}, [...Array(o)].map((c, t) => /* @__PURE__ */ e.createElement("td", {
|
13
|
+
colSpan: r[t],
|
14
|
+
key: `td-${t}`
|
15
|
+
}, /* @__PURE__ */ e.createElement("div", {
|
16
|
+
className: "loading-animation"
|
17
|
+
})))));
|
18
|
+
};
|
2
19
|
export {
|
3
|
-
|
20
|
+
d as TableContentLoader
|
4
21
|
};
|
5
22
|
//# sourceMappingURL=index21.js.map
|
package/dist/index21.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index21.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
1
|
+
{"version":3,"file":"index21.js","sources":["../src/components/TableContentLoader/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport './style.scss';\n\nexport interface TableContentLoaderProps {\n noOfRows?: number;\n noOfColumns?: number;\n colSpan?: number[];\n}\n\nexport const TableContentLoader: FC<TableContentLoaderProps> = (props) => {\n const { noOfRows = 2, noOfColumns = 4, colSpan = [2, 0, 0] } = props;\n\n return [...Array(noOfRows)].map((_, index) => (\n <tr key={`tr-${index}`} className=\"table-content-loader\">\n {[...Array(noOfColumns)].map((_, idx) => (\n <td colSpan={colSpan[idx]} key={`td-${idx}`}>\n <div className=\"loading-animation\"></div>\n </td>\n ))}\n </tr>\n ));\n};\n"],"names":["React__default","TableContentLoader","props","noOfRows","noOfColumns","colSpan","Array","map","_","index","createElement","key","className","idx","React"],"mappings":"AASO,OAAAA,OAAA;AAAA,OAAA;AAAA,MAAMC,IAAmDC,CAAUA,MAAA;AAClE,QAAA;AAAA,IAAEC,UAAAA,IAAW;AAAA,IAAGC,aAAAA,IAAc;AAAA,IAAGC,SAAAA,IAAU,CAAC,GAAG,GAAG,CAAC;AAAA,EAAA,IAAMH;AAE/D,SAAO,CAAC,GAAGI,MAAMH,CAAQ,CAAC,EAAEI,IAAI,CAACC,GAAGC,MAClCC,gBAAAA,EAAAA,cAAA,MAAA;AAAA,IAAIC,KAAK,MAAMF,CAAK;AAAA,IAAIG,WAAU;AAAA,EAC/B,GAAA,CAAC,GAAGN,MAAMF,CAAW,CAAC,EAAEG,IAAI,CAACC,GAAGK,MAC/BC,gBAAAA,EAAAJ,cAAA,MAAA;AAAA,IAAIL,SAASA,EAAQQ,CAAG;AAAA,IAAGF,KAAK,MAAME,CAAG;AAAA,EAAA,GACvCH,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,CAAyB,CACtC,CACL,CACC,CACL;AACH;"}
|