se-design 0.0.95 → 0.0.97
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/colors.css +1 -0
- package/dist/assets/icons/back.svg +4 -0
- package/dist/assets/icons/close.svg +4 -0
- package/dist/assets/icons/down.svg +3 -0
- package/dist/assets/icons/hamburger.svg +5 -0
- package/dist/assets/icons/kebab-menu-blue.svg +8 -0
- package/dist/assets/icons/kebab-menu.svg +8 -0
- package/dist/assets/icons/pages.svg +4 -0
- package/dist/assets/icons/tick.svg +3 -0
- package/dist/assets/src/components/SidebarOverlay/style.css +1 -0
- package/dist/assets/src/components/TableContentLoader/style.css +1 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/Button/Button.stories.d.ts +2 -2
- package/dist/components/Button/index.d.ts +2 -3
- package/dist/components/Checkbox/index.d.ts +9 -0
- 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 +6 -0
- package/dist/components/HamburgerMenu/index.d.ts +10 -0
- package/dist/components/Header/index.d.ts +8 -0
- package/dist/components/Icon/Icon.stories.d.ts +1 -2
- package/dist/components/Icon/{Icon.d.ts → index.d.ts} +0 -1
- 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 +1 -2
- package/dist/components/Modal/{Modal.d.ts → 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 +1 -2
- package/dist/components/SplitButton/{SplitButton.d.ts → index.d.ts} +1 -2
- package/dist/components/TableContentLoader/index.d.ts +7 -0
- package/dist/components/TableLayout/index.d.ts +24 -0
- package/dist/components/Tag/{Tag.d.ts → index.d.ts} +0 -1
- package/dist/components/Toggle/{Toggle.d.ts → index.d.ts} +0 -2
- package/dist/components/index.d.ts +17 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -17
- package/dist/index.js.map +1 -1
- package/dist/index10.js +23 -15
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +31 -4
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +22 -6
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +5 -155
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +63 -7
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +12 -2
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +38 -26
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +33 -605
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +10 -10
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +18 -9
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +32 -5
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +45 -167
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +7 -11
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +23 -2
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +6 -2
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +1 -5
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +2 -6
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +2 -38
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +2 -2
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +2 -8
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +2 -327
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +2 -50
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +2 -2
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +147 -74
- package/dist/index33.js.map +1 -1
- package/dist/index36.js +2 -8
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +32 -4
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +397 -44
- package/dist/index38.js.map +1 -1
- package/dist/index4.js +41 -7
- package/dist/index4.js.map +1 -1
- package/dist/index41.js +13 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +13 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +8 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +173 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +14 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +9 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +9 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +41 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +5 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +14 -36
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +11 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +330 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +53 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +5 -0
- package/dist/index53.js.map +1 -0
- package/dist/index54.js +79 -0
- package/dist/index54.js.map +1 -0
- package/dist/{index34.js → index55.js} +9 -9
- package/dist/{index34.js.map → index55.js.map} +1 -1
- package/dist/{index35.js → index56.js} +1 -1
- package/dist/{index35.js.map → index56.js.map} +1 -1
- package/dist/index57.js +11 -0
- package/dist/index57.js.map +1 -0
- package/dist/index58.js +8 -0
- package/dist/index58.js.map +1 -0
- package/dist/index59.js +55 -0
- package/dist/index59.js.map +1 -0
- package/dist/index6.js +35 -38
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +5 -0
- package/dist/index60.js.map +1 -0
- package/dist/index61.js +5 -0
- package/dist/index61.js.map +1 -0
- package/dist/index7.js +40 -3
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +3 -23
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +23 -29
- package/dist/index9.js.map +1 -1
- package/package.json +11 -5
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index10.cjs +0 -2
- package/dist/index10.cjs.map +0 -1
- package/dist/index11.cjs +0 -2
- package/dist/index11.cjs.map +0 -1
- package/dist/index12.cjs +0 -2
- package/dist/index12.cjs.map +0 -1
- package/dist/index13.cjs +0 -2
- package/dist/index13.cjs.map +0 -1
- package/dist/index14.cjs +0 -2
- package/dist/index14.cjs.map +0 -1
- package/dist/index15.cjs +0 -2
- package/dist/index15.cjs.map +0 -1
- package/dist/index16.cjs +0 -10
- package/dist/index16.cjs.map +0 -1
- package/dist/index17.cjs +0 -23
- package/dist/index17.cjs.map +0 -1
- package/dist/index18.cjs +0 -2
- package/dist/index18.cjs.map +0 -1
- package/dist/index19.cjs +0 -2
- package/dist/index19.cjs.map +0 -1
- package/dist/index20.cjs +0 -2
- package/dist/index20.cjs.map +0 -1
- package/dist/index21.cjs +0 -2
- package/dist/index21.cjs.map +0 -1
- package/dist/index22.cjs +0 -2
- package/dist/index22.cjs.map +0 -1
- package/dist/index23.cjs +0 -2
- package/dist/index23.cjs.map +0 -1
- package/dist/index24.cjs +0 -2
- package/dist/index24.cjs.map +0 -1
- package/dist/index25.cjs +0 -2
- package/dist/index25.cjs.map +0 -1
- package/dist/index26.cjs +0 -2
- package/dist/index26.cjs.map +0 -1
- package/dist/index27.cjs +0 -6
- package/dist/index27.cjs.map +0 -1
- package/dist/index28.cjs +0 -2
- package/dist/index28.cjs.map +0 -1
- package/dist/index29.cjs +0 -2
- package/dist/index29.cjs.map +0 -1
- package/dist/index3.cjs +0 -2
- package/dist/index3.cjs.map +0 -1
- package/dist/index3.js +0 -36
- package/dist/index3.js.map +0 -1
- package/dist/index30.cjs +0 -3
- package/dist/index30.cjs.map +0 -1
- package/dist/index31.cjs +0 -2
- package/dist/index31.cjs.map +0 -1
- package/dist/index32.cjs +0 -2
- package/dist/index32.cjs.map +0 -1
- package/dist/index33.cjs +0 -9
- package/dist/index33.cjs.map +0 -1
- package/dist/index34.cjs +0 -9
- package/dist/index34.cjs.map +0 -1
- package/dist/index35.cjs +0 -6
- package/dist/index35.cjs.map +0 -1
- package/dist/index36.cjs +0 -2
- package/dist/index36.cjs.map +0 -1
- package/dist/index37.cjs +0 -2
- package/dist/index37.cjs.map +0 -1
- package/dist/index38.cjs +0 -2
- package/dist/index38.cjs.map +0 -1
- package/dist/index39.cjs +0 -2
- package/dist/index39.cjs.map +0 -1
- package/dist/index4.cjs +0 -2
- package/dist/index4.cjs.map +0 -1
- package/dist/index40.cjs +0 -2
- package/dist/index40.cjs.map +0 -1
- package/dist/index5.cjs +0 -2
- package/dist/index5.cjs.map +0 -1
- package/dist/index6.cjs +0 -5
- package/dist/index6.cjs.map +0 -1
- package/dist/index7.cjs +0 -2
- package/dist/index7.cjs.map +0 -1
- package/dist/index8.cjs +0 -2
- package/dist/index8.cjs.map +0 -1
- package/dist/index9.cjs +0 -5
- package/dist/index9.cjs.map +0 -1
- /package/dist/components/Tooltip/{Tooltip.d.ts → index.d.ts} +0 -0
package/dist/index11.js
CHANGED
@@ -1,7 +1,34 @@
|
|
1
|
-
import { j as r } from "./
|
2
|
-
import {
|
3
|
-
const
|
1
|
+
import { j as r } from "./index24.js";
|
2
|
+
import { useState as p, useRef as d, useEffect as a } from "react";
|
3
|
+
const u = ({ content: l, tooltipSrc: c, position: t = "bottom-center", displayOn: o = "hover" }) => {
|
4
|
+
const [i, f] = p(o === "always-on"), s = d(null);
|
5
|
+
a(() => {
|
6
|
+
const e = s.current;
|
7
|
+
e && (t == "bottom-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:top-[-7px]")) : t == "bottom-left" ? (e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:top-[-7px]")) : t == "bottom-right" ? (e.setAttribute("style", "right: 0;"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:top-[-7px]")) : t == "left" ? (e.setAttribute("style", "right: calc(100% + 10px);top:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-0px")) : t == "right" && (e.setAttribute("style", "left: calc(100% + 10px);top:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-0px")), o == "hover" && e.classList.add("group-hover:visible"));
|
8
|
+
}, [l]), a(() => {
|
9
|
+
const e = s.current;
|
10
|
+
e && (i ? e.classList.remove("invisible") : e.classList.add("invisible"));
|
11
|
+
}, [i]);
|
12
|
+
const n = () => {
|
13
|
+
o == "click" && f((e) => !e);
|
14
|
+
};
|
15
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "group relative", onClick: n, children: [
|
16
|
+
/* @__PURE__ */ r.jsx("div", { className: "cursor-pointer", id: "tooltip-trigger", children: c }),
|
17
|
+
/* @__PURE__ */ r.jsx(
|
18
|
+
"div",
|
19
|
+
{
|
20
|
+
ref: s,
|
21
|
+
id: "tooltip-content",
|
22
|
+
className: `flex justify-center px-3 py-2 min-w-24 max-w-60
|
23
|
+
absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-xs rounded-[3px]
|
24
|
+
before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block
|
25
|
+
before:absolute before:rounded-tl-sm before:rotate-45`,
|
26
|
+
children: l
|
27
|
+
}
|
28
|
+
)
|
29
|
+
] });
|
30
|
+
};
|
4
31
|
export {
|
5
|
-
|
32
|
+
u as Tooltip
|
6
33
|
};
|
7
34
|
//# sourceMappingURL=index11.js.map
|
package/dist/index11.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index11.js","sources":["../src/components/
|
1
|
+
{"version":3,"file":"index11.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import { useEffect, useState, useRef } from \"react\";\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string;\n /**\n * Tooltip position\n */\n position?: \"bottom-center\" | \"bottom-left\" | \"bottom-right\" | \"left\" | \"right\";\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n}\n\nexport const Tooltip = ({ content, tooltipSrc, position = 'bottom-center', displayOn = 'hover' }: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(displayOn === 'always-on');\n const tooltipContentRef = useRef<HTMLDivElement>(null);;\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if(!tooltipContent) {\n return\n }\n \n if(position == 'bottom-center') {\n tooltipContent.setAttribute(\"style\", `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if(position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if(position == 'bottom-right') {\n tooltipContent.setAttribute(\"style\", `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if(position == 'left') {\n tooltipContent.setAttribute(\"style\", `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-0px`);\n } else if(position == 'right') {\n tooltipContent.setAttribute(\"style\", `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-0px`);\n }\n\n if(displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if(!tooltipContent) {\n return;\n }\n if(displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip])\n\n const onTooltipSrcClick = () => {\n if(displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip)\n }\n }\n\n return (\n <div className=\"group relative\" onClick={onTooltipSrcClick}>\n <div className=\"cursor-pointer\" id=\"tooltip-trigger\">\n {tooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id=\"tooltip-content\"\n className=\"flex justify-center px-3 py-2 min-w-24 max-w-60\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-xs rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45\"\n >\n {content}\n </div>\n </div>\n );\n};\n"],"names":["jsxRuntimeExports","useState","useRef","useEffect","Tooltip","content","tooltipSrc","position","displayOn","displayTooltip","setDisplayTooltip","tooltipContentRef","tooltipContent","onTooltipSrcClick","jsxs","jsx"],"mappings":"AAqBa,SAAA,KAAAA,SAAA;AAAA,SAAA,YAAAC,GAAA,UAAAC,GAAA,aAAAC,SAAA;AAAA,MAAAC,IAAU,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,UAAAC,IAAW,iBAAiB,WAAAC,IAAY,cAA4B;AACjH,QAAM,CAACC,GAAgBC,CAAiB,IAAIT,EAASO,MAAc,WAAW,GACxEG,IAAoBT,EAAuB,IAAI;AAErD,EAAAC,EAAU,MAAM;AACd,UAAMS,IAAiBD,EAAkB;AAEzC,IAAIC,MAIDL,KAAY,mBACEK,EAAA,aAAa,SAAS,wCAAwC,GAC9DA,EAAA,UAAU,IAAI,6BAA6B,GAC3CA,EAAA,UAAU,IAAI,mBAAmB,KACxCL,KAAY,iBACLK,EAAA,UAAU,IAAI,6BAA6B,GAC3CA,EAAA,UAAU,IAAI,mBAAmB,KACxCL,KAAY,kBACLK,EAAA,aAAa,SAAS,WAAW,GACjCA,EAAA,UAAU,IAAI,8BAA8B,GAC5CA,EAAA,UAAU,IAAI,mBAAmB,KACxCL,KAAY,UACLK,EAAA,aAAa,SAAS,iCAAiC,GACvDA,EAAA,UAAU,IAAI,qBAAqB,GACnCA,EAAA,UAAU,IAAI,gBAAgB,KACrCL,KAAY,YACLK,EAAA,aAAa,SAAS,gCAAgC,GACtDA,EAAA,UAAU,IAAI,oBAAoB,GAClCA,EAAA,UAAU,IAAI,gBAAgB,IAG5CJ,KAAa,WACCI,EAAA,UAAU,IAAI,qBAAqB;AAAA,EACpD,GACC,CAACP,CAAO,CAAC,GAEZF,EAAU,MAAM;AACd,UAAMS,IAAiBD,EAAkB;AAEzC,IAAIC,MAGDH,IACcG,EAAA,UAAU,OAAO,WAAW,IAE5BA,EAAA,UAAU,IAAI,WAAW;AAAA,EAC1C,GACC,CAACH,CAAc,CAAC;AAEnB,QAAMI,IAAoB,MAAM;AAC9B,IAAGL,KAAa,WACIE,EAAA,CAACD,MAAmB,CAACA,CAAc;AAAA,EAEzD;AAEA,SACGK,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAU,kBAAiB,SAASD,GACvC,UAAA;AAAA,IAAAE,gBAAAA,MAAC,OAAI,EAAA,WAAU,kBAAiB,IAAG,mBAChC,UACHT,GAAA;AAAA,IACAS,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAKJ;AAAA,QACL,IAAG;AAAA,QACH,WAAU;AAAA;AAAA;AAAA;AAAA,QAKT,UAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;"}
|
package/dist/index12.js
CHANGED
@@ -1,9 +1,25 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
1
|
+
import { j as r } from "./index24.js";
|
2
|
+
import { Tag as l } from "./index8.js";
|
3
|
+
import { Icon as m } from "./index5.js";
|
4
|
+
const j = (i) => {
|
5
|
+
const { label: s = "", icon: e, tag: o = "", iconPosition: t = "right", onClick: n } = i, c = (a) => /* @__PURE__ */ r.jsx(m, { name: a });
|
6
|
+
return /* @__PURE__ */ r.jsxs(
|
7
|
+
"div",
|
8
|
+
{
|
9
|
+
className: "flex items-center justify-between p-2 text-[var(--color-gray-900)] hover:bg-[var(--color-blue-100)] cursor-pointer rounded-[6px] gap-2",
|
10
|
+
onClick: () => n && n({ label: s, tag: o, icon: e, iconPosition: t }),
|
11
|
+
children: [
|
12
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-1", children: [
|
13
|
+
t === "left" && e && c(e),
|
14
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-[var(--color-gray-900)]", children: s }),
|
15
|
+
t === "right" && e && c(e)
|
16
|
+
] }),
|
17
|
+
o && /* @__PURE__ */ r.jsx(l, { label: o })
|
18
|
+
]
|
19
|
+
}
|
20
|
+
);
|
21
|
+
};
|
6
22
|
export {
|
7
|
-
|
23
|
+
j as MenuItem
|
8
24
|
};
|
9
25
|
//# sourceMappingURL=index12.js.map
|
package/dist/index12.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index12.js","sources":["../
|
1
|
+
{"version":3,"file":"index12.js","sources":["../src/components/MenuItem/index.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { Tag } from 'components/Tag';\nimport { Icon } from 'components/Icon';\n\nexport type MenuItemProps = {\n label: string;\n tag?: string;\n isDisabled?: boolean;\n activeItem?: string;\n icon?: string;\n iconPosition?: 'left' | 'right';\n onClick?: (item: MenuItemProps) => void;\n};\n\nexport const MenuItem: FC<MenuItemProps> = (props) => {\n const { label = '', icon, tag = '', iconPosition = \"right\", onClick } = props;\n\n const getIconJsx = (icon: string) => {\n return <Icon name={icon} />\n }\n\n return (\n <div\n className=\"flex items-center justify-between p-2 text-[var(--color-gray-900)] hover:bg-[var(--color-blue-100)] cursor-pointer rounded-[6px] gap-2\"\n onClick={() => onClick && onClick({label, tag, icon, iconPosition})}\n >\n <div className='flex items-center gap-1'>\n {iconPosition === 'left' && icon && getIconJsx(icon)}\n <span className=\"text-[var(--color-gray-900)]\">{label}</span>\n {iconPosition === 'right' && icon && getIconJsx(icon)}\n </div>\n {tag && <Tag label={tag} />}\n </div>\n );\n};\n"],"names":["jsxRuntimeExports","Tag","Icon","MenuItem","props","label","icon","tag","iconPosition","onClick","getIconJsx","jsx","jsxs"],"mappings":"AAca,SAAA,KAAAA,SAAA;AAAA,SAAA,OAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,MAAAC,IAA8B,CAACC,MAAU;AAC9C,QAAA,EAAE,OAAAC,IAAQ,IAAI,MAAAC,GAAM,KAAAC,IAAM,IAAI,cAAAC,IAAe,SAAS,SAAAC,EAAA,IAAYL,GAElEM,IAAa,CAACJ,MACXK,gBAAAA,EAAA,IAACT,GAAK,EAAA,MAAMI,EAAM,CAAA;AAIzB,SAAAM,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,SAAS,MAAMH,KAAWA,EAAQ,EAAC,OAAAJ,GAAO,KAAAE,GAAK,MAAAD,GAAM,cAAAE,GAAa;AAAA,MAElE,UAAA;AAAA,QAACI,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,UAAiBJ,MAAA,UAAUF,KAAQI,EAAWJ,CAAI;AAAA,UAClDK,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,gCAAgC,UAAMN,GAAA;AAAA,UACrDG,MAAiB,WAAWF,KAAQI,EAAWJ,CAAI;AAAA,QAAA,GACtD;AAAA,QACCC,KAAOI,gBAAAA,EAAAA,IAACV,GAAI,EAAA,OAAOM,EAAK,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3B;AAEJ;"}
|
package/dist/index13.js
CHANGED
@@ -1,158 +1,8 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
5
|
-
import { p as t } from "./index22.js";
|
6
|
-
import * as h from "react";
|
7
|
-
var O = function(s) {
|
8
|
-
var o = (s == null ? void 0 : s.ownerDocument) || document;
|
9
|
-
return o.defaultView || window;
|
10
|
-
}, U = function(s, o) {
|
11
|
-
for (var r in s)
|
12
|
-
if (!(r in o))
|
13
|
-
return !0;
|
14
|
-
for (var e in o)
|
15
|
-
if (s[e] !== o[e])
|
16
|
-
return !0;
|
17
|
-
return !1;
|
18
|
-
}, H = ["afterInjection", "beforeInjection", "desc", "evalScripts", "fallback", "httpRequestWithCredentials", "loading", "renumerateIRIElements", "src", "title", "useRequestCache", "wrapper"], v = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xlink", V = /* @__PURE__ */ function(c) {
|
19
|
-
function s() {
|
20
|
-
for (var r, e = arguments.length, n = new Array(e), a = 0; a < e; a++)
|
21
|
-
n[a] = arguments[a];
|
22
|
-
return r = c.call.apply(c, [this].concat(n)) || this, r.initialState = {
|
23
|
-
hasError: !1,
|
24
|
-
isLoading: !0
|
25
|
-
}, r.state = r.initialState, r._isMounted = !1, r.reactWrapper = void 0, r.nonReactWrapper = void 0, r.refCallback = function(u) {
|
26
|
-
r.reactWrapper = u;
|
27
|
-
}, r;
|
28
|
-
}
|
29
|
-
D(s, c);
|
30
|
-
var o = s.prototype;
|
31
|
-
return o.renderSVG = function() {
|
32
|
-
var e = this;
|
33
|
-
if (this.reactWrapper instanceof O(this.reactWrapper).Node) {
|
34
|
-
var n = this.props, a = n.desc, u = n.evalScripts, S = n.httpRequestWithCredentials, E = n.renumerateIRIElements, G = n.src, b = n.title, g = n.useRequestCache, w = this.props.onError, x = this.props.beforeInjection, y = this.props.afterInjection, f = this.props.wrapper, l, p;
|
35
|
-
f === "svg" ? (l = document.createElementNS(v, f), l.setAttribute("xmlns", v), l.setAttribute("xmlns:xlink", q), p = document.createElementNS(v, f)) : (l = document.createElement(f), p = document.createElement(f)), l.appendChild(p), p.dataset.src = G, this.nonReactWrapper = this.reactWrapper.appendChild(l);
|
36
|
-
var I = function(i) {
|
37
|
-
if (e.removeSVG(), !e._isMounted) {
|
38
|
-
w(i);
|
39
|
-
return;
|
40
|
-
}
|
41
|
-
e.setState(function() {
|
42
|
-
return {
|
43
|
-
hasError: !0,
|
44
|
-
isLoading: !1
|
45
|
-
};
|
46
|
-
}, function() {
|
47
|
-
w(i);
|
48
|
-
});
|
49
|
-
}, L = function(i, d) {
|
50
|
-
if (i) {
|
51
|
-
I(i);
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
e._isMounted && e.setState(function() {
|
55
|
-
return {
|
56
|
-
isLoading: !1
|
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 R = i.querySelector(":scope > title");
|
74
|
-
R && i.removeChild(R);
|
75
|
-
var j = document.createElement("title");
|
76
|
-
j.innerHTML = b, i.prepend(j);
|
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(C({}, 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;
|
109
|
-
e.afterInjection, e.beforeInjection, e.desc, e.evalScripts;
|
110
|
-
var n = e.fallback;
|
111
|
-
e.httpRequestWithCredentials;
|
112
|
-
var a = e.loading;
|
113
|
-
e.renumerateIRIElements, e.src, e.title, e.useRequestCache;
|
114
|
-
var u = e.wrapper, S = N(e, H), E = u;
|
115
|
-
return /* @__PURE__ */ h.createElement(E, C({}, S, {
|
116
|
-
ref: this.refCallback
|
117
|
-
}, u === "svg" ? {
|
118
|
-
xmlns: v,
|
119
|
-
xmlnsXlink: q
|
120
|
-
} : {}), this.state.isLoading && a && /* @__PURE__ */ h.createElement(a, null), this.state.hasError && n && /* @__PURE__ */ h.createElement(n, null));
|
121
|
-
}, s;
|
122
|
-
}(h.Component);
|
123
|
-
V.defaultProps = {
|
124
|
-
afterInjection: function() {
|
125
|
-
},
|
126
|
-
beforeInjection: function() {
|
127
|
-
},
|
128
|
-
desc: "",
|
129
|
-
evalScripts: "never",
|
130
|
-
fallback: null,
|
131
|
-
httpRequestWithCredentials: !1,
|
132
|
-
loading: null,
|
133
|
-
onError: function() {
|
134
|
-
},
|
135
|
-
renumerateIRIElements: !0,
|
136
|
-
title: "",
|
137
|
-
useRequestCache: !0,
|
138
|
-
wrapper: "div"
|
139
|
-
};
|
140
|
-
V.propTypes = {
|
141
|
-
afterInjection: t.func,
|
142
|
-
beforeInjection: t.func,
|
143
|
-
desc: t.string,
|
144
|
-
evalScripts: t.oneOf(["always", "once", "never"]),
|
145
|
-
fallback: t.oneOfType([t.func, t.object, t.string]),
|
146
|
-
httpRequestWithCredentials: t.bool,
|
147
|
-
loading: t.oneOfType([t.func, t.object, t.string]),
|
148
|
-
onError: t.func,
|
149
|
-
renumerateIRIElements: t.bool,
|
150
|
-
src: t.string.isRequired,
|
151
|
-
title: t.string,
|
152
|
-
useRequestCache: t.bool,
|
153
|
-
wrapper: t.oneOf(["div", "span", "svg"])
|
154
|
-
};
|
1
|
+
import { j as m } from "./index24.js";
|
2
|
+
import { createElement as t } from "react";
|
3
|
+
import { MenuItem as s } from "./index12.js";
|
4
|
+
const n = ({ items: r }) => /* @__PURE__ */ m.jsx("div", { className: "border border-[var(--color-gray-200)] rounded shadow-md px-1 py-2", children: r.map((e, o) => /* @__PURE__ */ t(s, { ...e, key: `item-${o}` })) });
|
155
5
|
export {
|
156
|
-
|
6
|
+
n as MenuList
|
157
7
|
};
|
158
8
|
//# sourceMappingURL=index13.js.map
|
package/dist/index13.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index13.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":["ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_inheritsLoose","_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","SVGInjector","_this$nonReactWrapper","prevProps","_this3","_extends","_this$props2","Fallback","Loading","rest","_objectWithoutPropertiesLoose","Wrapper","React","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":";;;;;;AAQA,IAAIA,IAAc,SAAqBC,GAAM;AAC3C,MAAIC,KAAOD,KAAQ,OAAO,SAASA,EAAK,kBAAkB;AAC1D,SAAOC,EAAI,eAAe;AAC5B,GAGIC,IAAiB,SAAwBC,GAAGC,GAAG;AACjD,WAASC,KAAKF;AACZ,QAAI,EAAEE,KAAKD;AACT,aAAO;AAGX,WAASE,KAAMF;AACb,QAAID,EAAEG,CAAE,MAAMF,EAAEE,CAAE;AAChB,aAAO;AAGX,SAAO;AACT,GAEIC,IAAY,CAAC,kBAAkB,mBAAmB,QAAQ,eAAe,YAAY,8BAA8B,WAAW,yBAAyB,OAAO,SAAS,mBAAmB,SAAS,GACnMC,IAAe,8BACfC,IAAiB,gCACjBC,IAAwB,yBAAUC,GAAkB;AACtD,WAASD,IAAW;AAElB,aADIE,GACKC,IAAO,UAAU,QAAQC,IAAO,IAAI,MAAMD,CAAI,GAAGE,IAAO,GAAGA,IAAOF,GAAME;AAC/E,MAAAD,EAAKC,CAAI,IAAI,UAAUA,CAAI;AAE7B,WAAAH,IAAQD,EAAiB,KAAK,MAAMA,GAAkB,CAAC,IAAI,EAAE,OAAOG,CAAI,CAAC,KAAK,MAC9EF,EAAM,eAAe;AAAA,MACnB,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,GACSxC;AACT,EAAE6C,EAAM,SAAS;AACjB7C,EAAS,eAAe;AAAA,EACtB,gBAAgB,WAA0B;AAAA,EAEzC;AAAA,EACD,iBAAiB,WAA2B;AAAA,EAE3C;AAAA,EACD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV,4BAA4B;AAAA,EAC5B,SAAS;AAAA,EACT,SAAS,WAAmB;AAAA,EAE3B;AAAA,EACD,uBAAuB;AAAA,EACvB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,SAAS;AACX;AACAA,EAAS,YAAY;AAAA,EACnB,gBAAgB8C,EAAc;AAAA,EAC9B,iBAAiBA,EAAc;AAAA,EAC/B,MAAMC,EAAgB;AAAA,EACtB,aAAaC,EAAAA,MAAgB,CAAC,UAAU,QAAQ,OAAO,CAAC;AAAA,EACxD,UAAUC,EAAAA,UAAoB,CAACH,EAAc,MAAEI,EAAgB,QAAEH,EAAgB,MAAA,CAAC;AAAA,EAClF,4BAA4BI,EAAc;AAAA,EAC1C,SAASF,EAAAA,UAAoB,CAACH,EAAc,MAAEI,EAAgB,QAAEH,EAAgB,MAAA,CAAC;AAAA,EACjF,SAASD,EAAc;AAAA,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":"index13.js","sources":["../src/components/MenuList/index.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { MenuItem, MenuItemProps } from 'src/components/MenuItem';\n\nexport type MenuListProps = {\n items: MenuItemProps[];\n};\n\nexport const MenuList: FC<MenuListProps> = ({ items }) => {\n return (\n <div className=\"border border-[var(--color-gray-200)] rounded shadow-md px-1 py-2\">\n {items.map((item, i) => (\n <MenuItem {...item} key={`item-${i}`} />\n ))}\n </div>\n );\n};\n"],"names":["jsxRuntimeExports","createElement","MenuItem","MenuList","items","item","i"],"mappings":"AAOO,SAAA,KAAAA,SAAA;AAAA,SAAA,iBAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,MAAMC,IAA8B,CAAC,EAAE,OAAAC,8BAEzC,OAAI,EAAA,WAAU,qEACZ,UAAMA,EAAA,IAAI,CAACC,GAAMC,MACf,gBAAAL,EAAAC,GAAA,EAAU,GAAGG,GAAM,KAAK,QAAQC,CAAC,IAAI,CACvC,GACH;"}
|
package/dist/index14.js
CHANGED
@@ -1,10 +1,66 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
"
|
5
|
-
"
|
6
|
-
|
1
|
+
import { j as i } from "./index24.js";
|
2
|
+
import { forwardRef as P, useState as k, useRef as p, useEffect as w, useImperativeHandle as R } from "react";
|
3
|
+
const L = P(({
|
4
|
+
className: r = "",
|
5
|
+
automationId: f = "",
|
6
|
+
position: u = "bottom-center",
|
7
|
+
popoverContentAutomationId: d = "",
|
8
|
+
contentWidth: m = "max",
|
9
|
+
renderPopoverContents: v,
|
10
|
+
renderPopoverSrcElement: b,
|
11
|
+
onPopoverToggle: n,
|
12
|
+
...g
|
13
|
+
}, y) => {
|
14
|
+
const [o, t] = k(!1), s = p(null), h = p(null);
|
15
|
+
w(() => {
|
16
|
+
if (n && n(o), o)
|
17
|
+
return document.body.addEventListener("click", a), () => document.body.removeEventListener("click", a);
|
18
|
+
}, [o]);
|
19
|
+
const a = (e) => {
|
20
|
+
const c = s.current;
|
21
|
+
if (!c) return;
|
22
|
+
const C = e.target;
|
23
|
+
c.contains(C) || t(!1);
|
24
|
+
}, l = () => {
|
25
|
+
t((e) => !e);
|
26
|
+
};
|
27
|
+
R(y, () => ({ togglePopup: l }), []);
|
28
|
+
const x = {
|
29
|
+
"bottom-left": { left: "0" },
|
30
|
+
"bottom-right": { right: "0" },
|
31
|
+
"bottom-center": { left: "50%", transform: "translateX(-50%)" }
|
32
|
+
};
|
33
|
+
return /* @__PURE__ */ i.jsxs(
|
34
|
+
"div",
|
35
|
+
{
|
36
|
+
className: "popover-wrapper cursor-pointer relative" + (r.length > 0 ? ` ${r}` : "") + (o ? " open" : ""),
|
37
|
+
ref: s,
|
38
|
+
onClick: l,
|
39
|
+
"data-automation-id": f,
|
40
|
+
...g,
|
41
|
+
children: [
|
42
|
+
b({ displayPopover: o }),
|
43
|
+
o && /* @__PURE__ */ i.jsx(
|
44
|
+
"div",
|
45
|
+
{
|
46
|
+
className: `popover-content absolute shadow-md top-full border rounded-md z-[1000] ${m == "full" ? "w-full" : "w-max"}`,
|
47
|
+
style: {
|
48
|
+
borderColor: "var(--color-gray-200)",
|
49
|
+
color: "var(--color-gray-900)",
|
50
|
+
backgroundColor: "var(--color-white)",
|
51
|
+
...x[u]
|
52
|
+
},
|
53
|
+
onClick: (e) => e.stopPropagation(),
|
54
|
+
ref: h,
|
55
|
+
"data-automation-id": d,
|
56
|
+
children: v({ closePopoverCb: () => t(!1) })
|
57
|
+
}
|
58
|
+
)
|
59
|
+
]
|
60
|
+
}
|
61
|
+
);
|
62
|
+
});
|
7
63
|
export {
|
8
|
-
|
64
|
+
L as Popover
|
9
65
|
};
|
10
66
|
//# sourceMappingURL=index14.js.map
|
package/dist/index14.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/Popover/index.tsx"],"sourcesContent":["import { useState, useRef, ReactNode, useEffect, forwardRef, ForwardedRef, useImperativeHandle } from 'react';\n\n\nexport interface PopoverHandle {\n togglePopup: () => void;\n}\n\nexport interface PopoverProps {\n className?: string;\n automationId?: string;\n popoverContentAutomationId?: string;\n renderPopoverContents: (props: { closePopoverCb: () => void }) => ReactNode;\n renderPopoverSrcElement: (props: { displayPopover: boolean }) => ReactNode;\n position?: \"bottom-center\" | \"bottom-left\" | \"bottom-right\";\n onPopoverToggle?: (displayPopover: boolean) => void;\n contentWidth?: 'full' | 'max';\n}\n\nexport const Popover = forwardRef<PopoverHandle, PopoverProps>(({ \n className = '',\n automationId = '',\n position = 'bottom-center',\n popoverContentAutomationId = '',\n contentWidth = 'max',\n renderPopoverContents,\n renderPopoverSrcElement,\n onPopoverToggle,\n ...props\n}, ref: ForwardedRef<PopoverHandle>) => {\n const [displayPopover, setDisplayPopover] = useState(false);\n const srcElementRef = useRef<HTMLDivElement>(null);\n const popoverContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if(onPopoverToggle) {\n onPopoverToggle(displayPopover);\n }\n if (displayPopover) {\n document.body.addEventListener('click', clickListener);\n return () => document.body.removeEventListener('click', clickListener);\n }\n }, [displayPopover]);\n \n const clickListener = (event: MouseEvent) => {\n const currentDropRef = srcElementRef.current;\n if (!currentDropRef) return;\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n if (!isSourcePopover) {\n setDisplayPopover(false);\n }\n };\n\n const togglePopup = () => {\n setDisplayPopover((displayPopover) => !displayPopover);\n };\n\n useImperativeHandle(ref, () => ({ togglePopup }), []);\n\n const popoverContentStyle = {\n 'bottom-left': {left: '0'},\n 'bottom-right': {right: '0'},\n 'bottom-center': {left: '50%', transform: 'translateX(-50%)'} \n }\n\n return (\n <div\n className={'popover-wrapper cursor-pointer relative' + (className.length > 0 ? ` ${className}` : '') + (displayPopover ? ' open' : '')}\n ref={srcElementRef}\n onClick={togglePopup}\n data-automation-id={automationId}\n {...props}\n >\n {renderPopoverSrcElement({ displayPopover })}\n {displayPopover && (\n <div\n className={`popover-content absolute shadow-md top-full border rounded-md z-[1000] ${contentWidth == 'full' ? 'w-full' : 'w-max'}`}\n style={{\n borderColor: 'var(--color-gray-200)',\n color: 'var(--color-gray-900)',\n backgroundColor: 'var(--color-white)',\n ...popoverContentStyle[position]\n }}\n onClick={(e) => e.stopPropagation()}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>\n )}\n </div>\n );\n});\n"],"names":["jsxRuntimeExports","forwardRef","useState","useRef","useEffect","useImperativeHandle","Popover","className","automationId","position","popoverContentAutomationId","contentWidth","renderPopoverContents","renderPopoverSrcElement","onPopoverToggle","props","ref","displayPopover","setDisplayPopover","srcElementRef","popoverContentRef","clickListener","event","currentDropRef","target","togglePopup","popoverContentStyle","jsxs","jsx"],"mappings":"AAkBa,SAAA,KAAAA,SAAA;AAAA,SAAA,cAAAC,GAAA,YAAAC,GAAA,UAAAC,GAAA,aAAAC,GAAA,uBAAAC,SAAA;AAAA,MAAAC,IAAUL,EAAwC,CAAC;AAAA,EAC9D,WAAAM,IAAY;AAAA,EACZ,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,4BAAAC,IAA6B;AAAA,EAC7B,cAAAC,IAAe;AAAA,EACf,uBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,GAAGC;AACL,GAAGC,MAAqC;AACtC,QAAM,CAACC,GAAgBC,CAAiB,IAAIhB,EAAS,EAAK,GACpDiB,IAAgBhB,EAAuB,IAAI,GAC3CiB,IAAoBjB,EAAuB,IAAI;AAErD,EAAAC,EAAU,MAAM;AAId,QAHGU,KACDA,EAAgBG,CAAc,GAE5BA;AACO,sBAAA,KAAK,iBAAiB,SAASI,CAAa,GAC9C,MAAM,SAAS,KAAK,oBAAoB,SAASA,CAAa;AAAA,EACvE,GACC,CAACJ,CAAc,CAAC;AAEb,QAAAI,IAAgB,CAACC,MAAsB;AAC3C,UAAMC,IAAiBJ,EAAc;AACrC,QAAI,CAACI,EAAgB;AAErB,UAAMC,IAASF,EAAM;AAGrB,IAFwBC,EAAe,SAASC,CAAM,KAGpDN,EAAkB,EAAK;AAAA,EAE3B,GAEMO,IAAc,MAAM;AACN,IAAAP,EAAA,CAACD,MAAmB,CAACA,CAAc;AAAA,EACvD;AAEA,EAAAZ,EAAoBW,GAAK,OAAO,EAAE,aAAAS,EAAY,IAAI,CAAA,CAAE;AAEpD,QAAMC,IAAuB;AAAA,IAC3B,eAAe,EAAC,MAAM,IAAG;AAAA,IACzB,gBAAgB,EAAC,OAAO,IAAG;AAAA,IAC3B,iBAAiB,EAAC,MAAM,OAAO,WAAW,mBAAkB;AAAA,EAC9D;AAGE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,6CAA6CpB,EAAU,SAAS,IAAI,IAAIA,CAAS,KAAK,OAAOU,IAAiB,UAAU;AAAA,MACnI,KAAKE;AAAA,MACL,SAASM;AAAA,MACT,sBAAoBjB;AAAA,MACnB,GAAGO;AAAA,MAEH,UAAA;AAAA,QAAwBF,EAAA,EAAE,gBAAAI,GAAgB;AAAA,QAC1CA,KACCW,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,0EAA0EjB,KAAgB,SAAS,WAAW,OAAO;AAAA,YAChI,OAAO;AAAA,cACL,aAAa;AAAA,cACb,OAAO;AAAA,cACP,iBAAiB;AAAA,cACjB,GAAGe,EAAoBjB,CAAQ;AAAA,YACjC;AAAA,YACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,YAClC,KAAKW;AAAA,YACL,sBAAoBV;AAAA,YAEnB,YAAsB,EAAE,gBAAgB,MAAMQ,EAAkB,EAAK,EAAG,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3E;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;"}
|
package/dist/index15.js
CHANGED
@@ -1,5 +1,15 @@
|
|
1
|
-
|
1
|
+
import { j as e } from "./index24.js";
|
2
|
+
const i = ({
|
3
|
+
leftContainer: r,
|
4
|
+
centerContainer: x,
|
5
|
+
rightContainer: s,
|
6
|
+
...t
|
7
|
+
}) => /* @__PURE__ */ e.jsxs("header", { className: `sticky top-0 h-[35px] w-full z-[1000] bg-gradient-to-r from-[#48AFF1] to-[#5F79AC] flex justify-between items-center ${(t == null ? void 0 : t.type) === "fixed" ? "fixed left-0 right-0 top-0" : ""}`, children: [
|
8
|
+
r && /* @__PURE__ */ e.jsx(e.Fragment, { children: r }),
|
9
|
+
x && /* @__PURE__ */ e.jsx(e.Fragment, { children: x }),
|
10
|
+
s && /* @__PURE__ */ e.jsx(e.Fragment, { children: s })
|
11
|
+
] });
|
2
12
|
export {
|
3
|
-
|
13
|
+
i as Header
|
4
14
|
};
|
5
15
|
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index15.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/Header/index.tsx"],"sourcesContent":["import { FC } from 'react';\n\nexport interface HeaderProps {\n leftContainer?: React.ReactNode;\n centerContainer?: React.ReactNode;\n rightContainer?: React.ReactNode;\n type?: string;\n}\n\nexport const Header: FC<HeaderProps> = ({\n leftContainer,\n centerContainer,\n rightContainer,\n ...props\n}) => {\n return (\n <header className={`sticky top-0 h-[35px] w-full z-[1000] bg-gradient-to-r from-[#48AFF1] to-[#5F79AC] flex justify-between items-center ${\n props?.type === 'fixed' ? 'fixed left-0 right-0 top-0' : ''\n }`}>\n {leftContainer && <>{leftContainer}</>}\n {centerContainer && <>{centerContainer}</>}\n {rightContainer && <>{rightContainer}</>}\n </header>\n );\n};\n"],"names":["Header","leftContainer","centerContainer","rightContainer","props","jsxs"],"mappings":";AASO,MAAMA,IAA0B,CAAC;AAAA,EACtC,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAA,KAAC,YAAO,WAAW,yHACjBD,KAAA,gBAAAA,EAAO,UAAS,UAAU,+BAA+B,EAC3D,IACG,UAAA;AAAA,EAAAH,yCAAoB,UAAcA,EAAA,CAAA;AAAA,EAClCC,yCAAsB,UAAgBA,EAAA,CAAA;AAAA,EACtCC,yCAAqB,UAAeA,EAAA,CAAA;AAAA,GACvC;"}
|
package/dist/index16.js
CHANGED
@@ -1,29 +1,41 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
1
|
+
import { j as e } from "./index24.js";
|
2
|
+
import { createElement as m } from "react";
|
3
|
+
import { Popover as h } from "./index14.js";
|
4
|
+
import { MenuItem as l } from "./index12.js";
|
5
|
+
const j = ({
|
6
|
+
menuItems: n,
|
7
|
+
className: i = "",
|
8
|
+
automationId: s = "",
|
9
|
+
popoverContentAutomationId: d = "",
|
10
|
+
onMenuItemClick: t
|
11
|
+
}) => {
|
12
|
+
const a = (o, r) => {
|
13
|
+
t && t(o), r();
|
14
|
+
};
|
15
|
+
return /* @__PURE__ */ e.jsx(
|
16
|
+
h,
|
17
|
+
{
|
18
|
+
className: i,
|
19
|
+
position: "bottom-left",
|
20
|
+
automationId: s,
|
21
|
+
popoverContentAutomationId: d,
|
22
|
+
renderPopoverSrcElement: ({ displayPopover: o }) => /* @__PURE__ */ e.jsx("div", { className: `${o ? "bg-[rgba(0,0,0,0.20)]" : ""} hover:bg-[rgba(0,0,0,0.20)] rounded-[6px] transition-all duration-300`, children: /* @__PURE__ */ e.jsxs("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
23
|
+
/* @__PURE__ */ e.jsx("path", { d: "M6 8.25H22", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
24
|
+
/* @__PURE__ */ e.jsx("path", { d: "M6 14H22", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
25
|
+
/* @__PURE__ */ e.jsx("path", { d: "M6 19.75H22", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
26
|
+
] }) }),
|
27
|
+
renderPopoverContents: ({ closePopoverCb: o }) => /* @__PURE__ */ e.jsx("div", { className: "min-w-[212px]", children: n.map((r, p) => /* @__PURE__ */ m(
|
28
|
+
l,
|
29
|
+
{
|
30
|
+
...r,
|
31
|
+
key: `item-${p}`,
|
32
|
+
onClick: () => a(r, o)
|
33
|
+
}
|
34
|
+
)) })
|
35
|
+
}
|
36
|
+
);
|
37
|
+
};
|
26
38
|
export {
|
27
|
-
|
39
|
+
j as HamburgerMenu
|
28
40
|
};
|
29
41
|
//# sourceMappingURL=index16.js.map
|
package/dist/index16.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index16.js","sources":["../
|
1
|
+
{"version":3,"file":"index16.js","sources":["../src/components/HamburgerMenu/index.tsx"],"sourcesContent":["import { FC } from 'react';\n\nimport { Popover } from 'src/components/Popover';\nimport { MenuItem, MenuItemProps } from 'src/components/MenuItem';\n\nexport interface HamburgerMenuProps {\n menuItems: MenuItemProps[];\n className?: string;\n automationId?: string;\n popoverContentAutomationId?: string;\n onMenuItemClick?: (item: MenuItemProps) => void;\n}\n\nexport const HamburgerMenu: FC<HamburgerMenuProps> = ({\n menuItems,\n className = '',\n automationId = '',\n popoverContentAutomationId = '',\n onMenuItemClick\n}) => {\n const handleMenuItemClick = (item: MenuItemProps, closePopoverCb: () => void) => {\n if(onMenuItemClick) {\n onMenuItemClick(item);\n }\n closePopoverCb();\n }\n return (\n <Popover\n className={className}\n position='bottom-left'\n automationId={automationId}\n popoverContentAutomationId={popoverContentAutomationId}\n renderPopoverSrcElement={({ displayPopover }) => (\n <div className={`${displayPopover ? 'bg-[rgba(0,0,0,0.20)]' : ''} hover:bg-[rgba(0,0,0,0.20)] rounded-[6px] transition-all duration-300`}>\n <svg width=\"28\" height=\"28\" viewBox=\"0 0 28 28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 8.25H22\" stroke=\"white\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M6 14H22\" stroke=\"white\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M6 19.75H22\" stroke=\"white\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </div>\n )}\n renderPopoverContents={({ closePopoverCb }) => (\n <div className=\"min-w-[212px]\">\n {menuItems.map((item, index) => (\n <MenuItem {...item} key={`item-${index}`}\n onClick={() => handleMenuItemClick(item, closePopoverCb)}\n />\n ))}\n </div>\n )}\n />\n );\n};\n"],"names":["HamburgerMenu","menuItems","className","automationId","popoverContentAutomationId","onMenuItemClick","handleMenuItemClick","item","closePopoverCb","jsx","Popover","displayPopover","jsxs","index","createElement","MenuItem"],"mappings":";;;;AAaO,MAAMA,IAAwC,CAAC;AAAA,EACpD,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAAC,IAAe;AAAA,EACf,4BAAAC,IAA6B;AAAA,EAC7B,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAsB,CAACC,GAAqBC,MAA+B;AAC/E,IAAGH,KACDA,EAAgBE,CAAI,GAEPC,EAAA;AAAA,EACjB;AAEE,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAR;AAAA,MACA,UAAS;AAAA,MACT,cAAAC;AAAA,MACA,4BAAAC;AAAA,MACA,yBAAyB,CAAC,EAAE,gBAAAO,8BACzB,OAAI,EAAA,WAAW,GAAGA,IAAiB,0BAA0B,EAAE,0EAC5D,UAACC,gBAAAA,EAAA,KAAA,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAC9D,UAAA;AAAA,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