se-design 0.0.95 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.stories.d.ts +1 -0
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts +9 -0
- package/dist/components/HamburgerMenu/HamburgerMenu.stories.d.ts +7 -0
- package/dist/components/HamburgerMenu/index.d.ts +11 -0
- package/dist/components/Header/index.d.ts +9 -0
- package/dist/components/Icon/Icon.stories.d.ts +1 -1
- package/dist/components/Modal/Modal.stories.d.ts +1 -1
- package/dist/components/Popup/index.d.ts +15 -0
- package/dist/components/SplitButton/SplitButton.stories.d.ts +1 -1
- package/dist/components/TableLayout/index.d.ts +24 -0
- package/dist/components/index.d.ts +11 -6
- package/dist/index.js +27 -17
- package/dist/index.js.map +1 -1
- package/dist/index10.js +31 -15
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +15 -4
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +4 -6
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +53 -152
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +12 -7
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +34 -2
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +33 -26
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +10 -606
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +6 -10
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +148 -9
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +8 -5
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +2 -170
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +26 -11
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +606 -2
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +10 -2
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +8 -4
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +4 -5
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +168 -36
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +11 -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 +5 -49
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +6 -2
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +34 -72
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +2 -93
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +5 -49
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +326 -7
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +49 -4
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +2 -52
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +76 -2
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +34 -8
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +93 -2
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +55 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +11 -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 +55 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +5 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +5 -0
- package/dist/index46.js.map +1 -0
- package/dist/index5.js +7 -36
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +35 -38
- package/dist/index6.js.map +1 -1
- 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 +22 -30
- package/dist/index9.js.map +1 -1
- package/dist/public/colors.css +1 -0
- package/dist/public/icons/back.svg +4 -0
- package/dist/public/icons/close.svg +4 -0
- package/dist/public/icons/down.svg +3 -0
- package/dist/public/icons/hamburger.svg +5 -0
- package/dist/public/icons/pages.svg +4 -0
- package/dist/public/icons/tick.svg +3 -0
- package/dist/public/style.css +1 -0
- package/package.json +8 -3
- package/dist/assets/style.css +0 -1
- 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/Icon/{Icon.d.ts → index.d.ts} +0 -0
- /package/dist/components/Modal/{Modal.d.ts → index.d.ts} +0 -0
- /package/dist/components/SplitButton/{SplitButton.d.ts → index.d.ts} +0 -0
- /package/dist/components/Tag/{Tag.d.ts → index.d.ts} +0 -0
- /package/dist/components/Toggle/{Toggle.d.ts → index.d.ts} +0 -0
- /package/dist/components/Tooltip/{Tooltip.d.ts → index.d.ts} +0 -0
@@ -4,7 +4,7 @@ export interface ButtonProps {
|
|
4
4
|
/**
|
5
5
|
* Type of the button
|
6
6
|
*/
|
7
|
-
type?: 'primary' | 'secondary' | 'negative' | 'negative-secondary' | 'purchase' | 'purchase-secondary';
|
7
|
+
type?: 'primary' | 'secondary' | 'negative' | 'negative-secondary' | 'purchase' | 'purchase-secondary' | 'secondary-link';
|
8
8
|
/**
|
9
9
|
* Size of the button
|
10
10
|
*/
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { MenuItemProps } from '../../../../../../../../src/components/MenuItem';
|
3
|
+
|
4
|
+
export interface HamburgerMenuProps {
|
5
|
+
menuItems: MenuItemProps[];
|
6
|
+
className?: string;
|
7
|
+
automationId?: string;
|
8
|
+
popupContentAutomationId?: string;
|
9
|
+
onMenuItemClick?: (label: string) => void;
|
10
|
+
}
|
11
|
+
export declare const HamburgerMenu: FC<HamburgerMenuProps>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
2
|
+
|
3
|
+
export interface PopupProps {
|
4
|
+
className?: string;
|
5
|
+
automationId?: string;
|
6
|
+
popupContentAutomationId?: string;
|
7
|
+
renderPopupContents: (props: {
|
8
|
+
closePopupCb: () => void;
|
9
|
+
}) => ReactNode;
|
10
|
+
renderPopupSrcElement: (props: {
|
11
|
+
displayPopup: boolean;
|
12
|
+
}) => ReactNode;
|
13
|
+
position?: "bottom-center" | "bottom-left" | "bottom-right";
|
14
|
+
}
|
15
|
+
export declare const Popup: FC<PopupProps>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
2
|
+
|
3
|
+
export interface TableLayoutProps {
|
4
|
+
className?: string;
|
5
|
+
automationId?: string;
|
6
|
+
loading: boolean;
|
7
|
+
headerData: any[];
|
8
|
+
tableData: any[];
|
9
|
+
headerColSpan?: number;
|
10
|
+
renderTableContentLoader?: (noOfColumns: number) => ReactNode;
|
11
|
+
getTableHeaders: (props: {
|
12
|
+
headerData: any[];
|
13
|
+
sortData: any;
|
14
|
+
onSortUiUpdate: any;
|
15
|
+
}) => ReactNode;
|
16
|
+
getTableBody: (props: {
|
17
|
+
tableData: any[];
|
18
|
+
onRowClick: any;
|
19
|
+
loading: boolean;
|
20
|
+
}) => ReactNode;
|
21
|
+
onSortUiUpdate: (newSortData: any) => void;
|
22
|
+
onRowClick: (rowData: any) => void;
|
23
|
+
}
|
24
|
+
export declare const TableLayout: FC<TableLayoutProps>;
|
@@ -1,9 +1,14 @@
|
|
1
1
|
export { Button } from './Button';
|
2
|
-
export { Icon } from './Icon
|
3
|
-
export { SplitButton } from './SplitButton
|
4
|
-
export { Toggle } from './Toggle
|
5
|
-
export { Tag } from './Tag
|
6
|
-
export { Modal } from './Modal
|
7
|
-
export { Tooltip } from './Tooltip
|
2
|
+
export { Icon } from './Icon';
|
3
|
+
export { SplitButton } from './SplitButton';
|
4
|
+
export { Toggle } from './Toggle';
|
5
|
+
export { Tag } from './Tag';
|
6
|
+
export { Modal } from './Modal';
|
7
|
+
export { Tooltip } from './Tooltip';
|
8
8
|
export { MenuItem } from './MenuItem';
|
9
9
|
export { MenuList } from './MenuList';
|
10
|
+
export { Popup } from './Popup';
|
11
|
+
export { Header } from './Header';
|
12
|
+
export { HamburgerMenu } from './HamburgerMenu';
|
13
|
+
export { TableLayout } from './TableLayout';
|
14
|
+
export { Checkbox } from './Checkbox';
|
package/dist/index.js
CHANGED
@@ -1,22 +1,32 @@
|
|
1
1
|
/* empty css */
|
2
|
-
import { Button as
|
3
|
-
import { Icon as m } from "./
|
4
|
-
import { SplitButton as
|
5
|
-
import { Toggle as
|
6
|
-
import { Tag as
|
7
|
-
import { Modal as
|
8
|
-
import { Tooltip as
|
9
|
-
import { MenuItem as
|
10
|
-
import { MenuList as
|
2
|
+
import { Button as t } from "./index4.js";
|
3
|
+
import { Icon as m } from "./index5.js";
|
4
|
+
import { SplitButton as f } from "./index6.js";
|
5
|
+
import { Toggle as a } from "./index7.js";
|
6
|
+
import { Tag as l } from "./index8.js";
|
7
|
+
import { Modal as i } from "./index9.js";
|
8
|
+
import { Tooltip as T } from "./index10.js";
|
9
|
+
import { MenuItem as c } from "./index11.js";
|
10
|
+
import { MenuList as B } from "./index12.js";
|
11
|
+
import { Popup as I } from "./index13.js";
|
12
|
+
import { Header as h } from "./index14.js";
|
13
|
+
import { HamburgerMenu as s } from "./index15.js";
|
14
|
+
import { TableLayout as C } from "./index16.js";
|
15
|
+
import { Checkbox as S } from "./index17.js";
|
11
16
|
export {
|
12
|
-
|
17
|
+
t as Button,
|
18
|
+
S as Checkbox,
|
19
|
+
s as HamburgerMenu,
|
20
|
+
h as Header,
|
13
21
|
m as Icon,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
c as MenuItem,
|
23
|
+
B as MenuList,
|
24
|
+
i as Modal,
|
25
|
+
I as Popup,
|
26
|
+
f as SplitButton,
|
27
|
+
C as TableLayout,
|
28
|
+
l as Tag,
|
29
|
+
a as Toggle,
|
30
|
+
T as Tooltip
|
21
31
|
};
|
22
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/dist/index10.js
CHANGED
@@ -1,18 +1,34 @@
|
|
1
|
-
import { j as
|
2
|
-
import {
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import { j as r } from "./index18.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
|
+
};
|
15
31
|
export {
|
16
|
-
|
32
|
+
u as Tooltip
|
17
33
|
};
|
18
34
|
//# sourceMappingURL=index10.js.map
|
package/dist/index10.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/components/
|
1
|
+
{"version":3,"file":"index10.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,EACvD;AAGF,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,IACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
package/dist/index11.js
CHANGED
@@ -1,7 +1,18 @@
|
|
1
|
-
import { j as r } from "./
|
2
|
-
import {
|
3
|
-
const
|
1
|
+
import { j as r } from "./index18.js";
|
2
|
+
import { Tag as s } from "./index8.js";
|
3
|
+
const l = ({ label: t, tag: e, onClick: o = () => {
|
4
|
+
} }) => /* @__PURE__ */ r.jsxs(
|
5
|
+
"div",
|
6
|
+
{
|
7
|
+
className: "flex items-center justify-between px-4 py-3 text-[var(--color-gray-900)] hover:bg-[var(--color-blue-100)] cursor-pointer first:rounded-t last:rounded-b gap-2",
|
8
|
+
onClick: o,
|
9
|
+
children: [
|
10
|
+
/* @__PURE__ */ r.jsx("div", { children: t }),
|
11
|
+
e && /* @__PURE__ */ r.jsx(s, { label: e })
|
12
|
+
]
|
13
|
+
}
|
14
|
+
);
|
4
15
|
export {
|
5
|
-
|
16
|
+
l as MenuItem
|
6
17
|
};
|
7
18
|
//# 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/MenuItem/index.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { Tag } from 'src/components/Tag';\n\nexport type MenuItemProps = {\n label: string;\n tag?: string;\n onClick?: () => void;\n};\n\nexport const MenuItem: FC<MenuItemProps> = ({ label, tag, onClick = () => {} }) => {\n return (\n <div\n className=\"flex items-center justify-between px-4 py-3 text-[var(--color-gray-900)] hover:bg-[var(--color-blue-100)] cursor-pointer first:rounded-t last:rounded-b gap-2\"\n onClick={onClick}\n >\n <div>{label}</div>\n {tag && <Tag label={tag} />}\n </div>\n );\n};\n"],"names":["MenuItem","label","tag","onClick","jsxs","jsx","Tag"],"mappings":";;AASO,MAAMA,IAA8B,CAAC,EAAE,OAAAC,GAAO,KAAAC,GAAK,SAAAC,IAAU,MAAM;AAAC,QAEvEC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,SAAAD;AAAA,IAEA,UAAA;AAAA,MAAAE,gBAAAA,EAAAA,IAAC,SAAK,UAAMJ,EAAA,CAAA;AAAA,MACXC,KAAOG,gBAAAA,EAAAA,IAACC,GAAI,EAAA,OAAOJ,EAAK,CAAA;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
package/dist/index12.js
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
process.env.NODE_ENV === "production" ? e.exports = r() : e.exports = o();
|
5
|
-
var m = e.exports;
|
1
|
+
import { j as r } from "./index18.js";
|
2
|
+
import { MenuItem as s } from "./index11.js";
|
3
|
+
const d = ({ items: o }) => /* @__PURE__ */ r.jsx("div", { className: "border border-[var(--color-gray-200)] rounded shadow-md", children: o.map((e) => /* @__PURE__ */ r.jsx(s, { ...e })) });
|
6
4
|
export {
|
7
|
-
|
5
|
+
d as MenuList
|
8
6
|
};
|
9
7
|
//# 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/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\">\n {items.map((item) => (\n <MenuItem {...item} />\n ))}\n </div>\n );\n};\n"],"names":["jsxRuntimeExports","MenuItem","MenuList","items","jsx","item"],"mappings":"AAOO,SAAA,KAAAA,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,MAAMC,IAA8B,CAAC,EAAE,OAAAC,QAEzCC,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,2DACZ,UAAMD,EAAA,IAAI,CAACE,MACTD,gBAAAA,EAAA,IAAAH,GAAA,EAAU,GAAGI,EAAM,CAAA,CACrB,EACH,CAAA;"}
|
package/dist/index13.js
CHANGED
@@ -1,158 +1,59 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
return
|
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
|
-
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);
|
1
|
+
import { j as a } from "./index18.js";
|
2
|
+
import { useState as b, useRef as i, useEffect as P } from "react";
|
3
|
+
const x = ({
|
4
|
+
className: r = "",
|
5
|
+
automationId: u = "",
|
6
|
+
position: n = "",
|
7
|
+
popupContentAutomationId: f = "",
|
8
|
+
renderPopupContents: d,
|
9
|
+
renderPopupSrcElement: m,
|
10
|
+
...g
|
11
|
+
}) => {
|
12
|
+
const [e, t] = b(!1), s = i(null), l = i(null);
|
13
|
+
P(() => {
|
14
|
+
if (e) {
|
15
|
+
const o = l.current;
|
16
|
+
return o ? (n == "bottom-left" ? o.style.left = "0" : n == "bottom-right" ? o.style.right = "0" : (o.style.left = "50%", o.style.transform = "translateX(-50%)"), document.body.addEventListener("click", c), () => document.body.removeEventListener("click", c)) : void 0;
|
17
|
+
}
|
18
|
+
}, [e]);
|
19
|
+
const c = (o) => {
|
20
|
+
const p = s.current;
|
21
|
+
if (!p) return;
|
22
|
+
const y = o.target;
|
23
|
+
p.contains(y) || t(!1);
|
24
|
+
}, v = () => {
|
25
|
+
t((o) => !o);
|
26
|
+
};
|
27
|
+
return /* @__PURE__ */ a.jsxs(
|
28
|
+
"div",
|
29
|
+
{
|
30
|
+
className: "popup-wrapper cursor-pointer relative" + (r.length > 0 ? ` ${r}` : "") + (e ? " open" : ""),
|
31
|
+
ref: s,
|
32
|
+
onClick: v,
|
33
|
+
"data-automation-id": u,
|
34
|
+
...g,
|
35
|
+
children: [
|
36
|
+
m({ displayPopup: e }),
|
37
|
+
e && /* @__PURE__ */ a.jsx(
|
38
|
+
"div",
|
39
|
+
{
|
40
|
+
className: "popup-content absolute p-2 shadow-md top-full border rounded-md w-max",
|
41
|
+
style: {
|
42
|
+
borderColor: "var(--color-gray-200)",
|
43
|
+
color: "var(--color-gray-900)",
|
44
|
+
backgroundColor: "var(--color-white)"
|
45
|
+
},
|
46
|
+
onClick: (o) => o.stopPropagation(),
|
47
|
+
ref: l,
|
48
|
+
"data-automation-id": f,
|
49
|
+
children: d({ closePopupCb: () => t(!1) })
|
63
50
|
}
|
64
|
-
|
65
|
-
|
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
|
-
});
|
51
|
+
)
|
52
|
+
]
|
92
53
|
}
|
93
|
-
|
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"])
|
54
|
+
);
|
154
55
|
};
|
155
56
|
export {
|
156
|
-
|
57
|
+
x as Popup
|
157
58
|
};
|
158
59
|
//# 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,UAAU;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C;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/Popup/index.tsx"],"sourcesContent":["import { FC, useState, useRef, ReactNode, useEffect } from 'react';\n\nexport interface PopupProps {\n className?: string;\n automationId?: string;\n popupContentAutomationId?: string;\n renderPopupContents: (props: { closePopupCb: () => void }) => ReactNode;\n renderPopupSrcElement: (props: { displayPopup: boolean }) => ReactNode;\n position?: \"bottom-center\" | \"bottom-left\" | \"bottom-right\";\n}\n\nexport const Popup: FC<PopupProps> = ({\n className = '',\n automationId = '',\n position = '',\n popupContentAutomationId = '',\n renderPopupContents,\n renderPopupSrcElement,\n ...props\n}) => {\n const [displayPopup, setDisplayPopup] = useState(false);\n const srcElementRef = useRef<HTMLDivElement>(null);\n const popupContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (displayPopup) {\n const popupContent = popupContentRef.current;\n\n if(!popupContent) {\n return\n }\n if(position == 'bottom-left') {\n popupContent.style.left = '0';\n } else if(position == 'bottom-right') {\n popupContent.style.right = '0';\n } else {\n popupContent.style.left = '50%';\n popupContent.style.transform = 'translateX(-50%)';\n }\n\n document.body.addEventListener('click', clickListener);\n return () => document.body.removeEventListener('click', clickListener);\n }\n }, [displayPopup]);\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 setDisplayPopup(false);\n }\n };\n\n const togglePopup = () => {\n setDisplayPopup((displayPopup) => !displayPopup);\n };\n\n return (\n <div\n className={'popup-wrapper cursor-pointer relative' + (className.length > 0 ? ` ${className}` : '') + (displayPopup ? ' open' : '')}\n ref={srcElementRef}\n onClick={togglePopup}\n data-automation-id={automationId}\n {...props}\n >\n {renderPopupSrcElement({ displayPopup })}\n {displayPopup && (\n <div\n className={`popup-content absolute p-2 shadow-md top-full border rounded-md w-max`}\n style={{\n borderColor: 'var(--color-gray-200)',\n color: 'var(--color-gray-900)',\n backgroundColor: 'var(--color-white)'\n }}\n onClick={(e) => e.stopPropagation()}\n ref={popupContentRef}\n data-automation-id={popupContentAutomationId}\n >\n {renderPopupContents({ closePopupCb: () => setDisplayPopup(false) })}\n </div>\n )}\n </div>\n );\n};\n"],"names":["Popup","className","automationId","position","popupContentAutomationId","renderPopupContents","renderPopupSrcElement","props","displayPopup","setDisplayPopup","useState","srcElementRef","useRef","popupContentRef","useEffect","popupCont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AAE,cAAAE,GAAc;AAAA,QACtCA,KACCc,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,YACX,OAAO;AAAA,cACL,aAAa;AAAA,cACb,OAAO;AAAA,cACP,iBAAiB;AAAA,YACnB;AAAA,YACA,SAAS,CAACC,MAAMA,EAAE,gBAAgB;AAAA,YAClC,KAAKV;AAAA,YACL,sBAAoBT;AAAA,YAEnB,YAAoB,EAAE,cAAc,MAAMK,EAAgB,EAAK,GAAG;AAAA,UAAA;AAAA,QACrE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
package/dist/index14.js
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { j as e } from "./index18.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
|
+
] });
|
7
12
|
export {
|
8
|
-
|
13
|
+
i as Header
|
9
14
|
};
|
10
15
|
//# sourceMappingURL=index14.js.map
|