tfy-web-components 0.0.17 → 0.0.19
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/README.md +19 -0
- package/dist/Accordion.d.ts +58 -0
- package/dist/Badge.d.ts +46 -0
- package/dist/Button.d.ts +4 -2
- package/dist/CopyField.d.ts +81 -0
- package/dist/Dialog.d.ts +18 -0
- package/dist/IconProvider.d.ts +4 -2
- package/dist/Input.d.ts +27 -0
- package/dist/Notification-BT4CZ69U.js +39 -0
- package/dist/Notification-BT4CZ69U.js.map +1 -0
- package/dist/Notification.d.ts +12 -0
- package/dist/Notify.d.ts +4 -0
- package/dist/Switch.d.ts +20 -0
- package/dist/TabButton.d.ts +20 -0
- package/dist/TabPanel.d.ts +14 -0
- package/dist/Tooltip.d.ts +9 -5
- package/dist/_commonjsHelpers-CcAunmGO.js +34 -0
- package/dist/_commonjsHelpers-CcAunmGO.js.map +1 -0
- package/dist/components/atoms/Accordion.d.ts +48 -0
- package/dist/components/atoms/Accordion.es.js +98 -0
- package/dist/components/atoms/Accordion.es.js.map +1 -0
- package/dist/components/atoms/Badge.d.ts +35 -0
- package/dist/components/atoms/Badge.es.js +50 -0
- package/dist/components/atoms/Badge.es.js.map +1 -0
- package/dist/components/atoms/Button.d.ts +4 -5
- package/dist/components/atoms/Button.es.js +107 -25
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/IconButton.d.ts +1 -1
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.d.ts +3 -2
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Notification.d.ts +9 -0
- package/dist/components/atoms/Notification.es.js +6 -0
- package/dist/components/atoms/Notification.es.js.map +1 -0
- package/dist/components/atoms/Spinner.es.js +1 -1
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Switch.d.ts +16 -0
- package/dist/components/atoms/Switch.es.js +79 -0
- package/dist/components/atoms/Switch.es.js.map +1 -0
- package/dist/components/atoms/TabButton.d.ts +14 -0
- package/dist/components/atoms/TabButton.es.js +34 -0
- package/dist/components/atoms/TabButton.es.js.map +1 -0
- package/dist/components/atoms/TabPanel.d.ts +10 -0
- package/dist/components/atoms/TabPanel.es.js +20 -0
- package/dist/components/atoms/TabPanel.es.js.map +1 -0
- package/dist/components/atoms/Tooltip.d.ts +8 -5
- package/dist/components/atoms/Tooltip.es.js +6 -5
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/CopyField.d.ts +38 -0
- package/dist/components/molecules/CopyField.es.js +74195 -0
- package/dist/components/molecules/CopyField.es.js.map +1 -0
- package/dist/components/molecules/Dialog.d.ts +14 -0
- package/dist/components/molecules/Dialog.es.js +6463 -0
- package/dist/components/molecules/Dialog.es.js.map +1 -0
- package/dist/components/molecules/Input.d.ts +23 -0
- package/dist/components/molecules/Input.es.js +12 -0
- package/dist/components/molecules/Input.es.js.map +1 -0
- package/dist/components/molecules/Notify.d.ts +1 -0
- package/dist/components/molecules/Notify.es.js +1058 -0
- package/dist/components/molecules/Notify.es.js.map +1 -0
- package/dist/components/theme/index.d.ts +1 -0
- package/dist/components/theme/index.es.js +3 -1
- package/dist/components/theme/index.es.js.map +1 -1
- package/dist/components/theme/utils.es.js +9 -175
- package/dist/components/theme/utils.es.js.map +1 -1
- package/dist/isTypedArray-CoDTnA8U.js +185 -0
- package/dist/isTypedArray-CoDTnA8U.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.es.js","sources":["../../../src/utils/getRootFontSize.ts","../../../src/contexts/RootFontSizeContext.tsx","../../../src/components/atoms/Switch.tsx"],"sourcesContent":["const getRootFontSize = (): number => {\n const width = window.innerWidth\n switch (true) {\n case width >= 3840:\n return 32\n case width >= 2880:\n return 24\n case width >= 2400:\n return 20\n default:\n return 16\n }\n}\n\nexport default getRootFontSize\n","import React, { createContext, useContext, useEffect, useState } from 'react'\nimport _throttle from 'lodash-es/throttle'\n\nimport getRootFontSize from '@/utils/getRootFontSize'\n\ninterface RootFontSizeContextType {\n rootFontSize: number\n}\n\nconst RootFontSizeContext = createContext<RootFontSizeContextType>({\n rootFontSize: getRootFontSize(),\n})\n\nexport const useRootFontSize = () => useContext(RootFontSizeContext)\n\nexport const RootFontSizeProvider: React.FC<React.PropsWithChildren> = ({ children }) => {\n const [fontSize, setFontSize] = useState(getRootFontSize())\n\n useEffect(() => {\n const handleResize = () => {\n const newFontSize = getRootFontSize()\n // Only when a breakpoint is crossed, call setState\n if (newFontSize !== fontSize) {\n setFontSize(newFontSize)\n }\n }\n const throttledHandleResize = _throttle(handleResize, 1000)\n\n window.addEventListener('resize', throttledHandleResize)\n return () => window.removeEventListener('resize', throttledHandleResize)\n }, [fontSize])\n\n return <RootFontSizeContext.Provider value={{ rootFontSize: fontSize }}>{children}</RootFontSizeContext.Provider>\n}\n","import styled from '@mui/material/styles/styled'\nimport NativeSwitch from '@mui/material/Switch'\n\nimport { colors } from '@/components/theme/theme'\nimport useTheme from '@/components/theme/useTheme'\n\nimport { useRootFontSize } from '@/contexts/RootFontSizeContext'\n\ninterface InputHTMLAttributesExtended extends React.InputHTMLAttributes<HTMLInputElement> {\n 'data-test'?: string\n}\n\nexport interface StyledSwitchProps {\n inputProps?: InputHTMLAttributesExtended\n widthMultiple?: number\n heightMultiple?: number\n thumbWidthMultiple?: number\n}\n\nconst getDimensions = (\n widthMultiple: number,\n heightMultiple: number,\n thumbWidthMultiple: number,\n rootFontSize: number,\n) => {\n const WIDTH = widthMultiple * rootFontSize\n const HEIGHT = heightMultiple * rootFontSize\n const THUMB_WIDTH = thumbWidthMultiple * rootFontSize\n\n return { WIDTH, HEIGHT, THUMB_WIDTH }\n}\n\nconst Switch = styled(NativeSwitch, {\n shouldForwardProp: (prop: string) => !['widthMultiple', 'heightMultiple', 'thumbWidthMultiple'].includes(prop),\n})<StyledSwitchProps>(({ theme, widthMultiple = 2, heightMultiple = 1, thumbWidthMultiple = 0.9375 }) => {\n const { isDark } = useTheme()\n const { rootFontSize } = useRootFontSize()\n const { WIDTH, HEIGHT, THUMB_WIDTH } = getDimensions(widthMultiple, heightMultiple, thumbWidthMultiple, rootFontSize)\n return {\n width: WIDTH,\n height: HEIGHT,\n padding: 0,\n display: 'flex',\n '&:active': {\n '& .MuiSwitch-thumb': {\n width: THUMB_WIDTH,\n },\n '& .MuiSwitch-switchBase.Mui-checked': {\n transform: 'translateX(1rem)',\n },\n },\n '& .MuiSwitch-switchBase': {\n padding: 2,\n '&.Mui-checked': {\n transform: `translateX(${WIDTH - THUMB_WIDTH - 1}px)`,\n color: '#fff',\n '& + .MuiSwitch-track': {\n opacity: 1,\n background: isDark\n ? colors.indigo[500]\n : 'radial-gradient(84.37% 84.37% at 50% 100%, #2900CE 0%, #5429FF 100%), linear-gradient(0deg, #5501E1 40.19%, #2F5FFF 111.1%)',\n },\n },\n },\n '& .MuiSwitch-thumb': {\n boxShadow: '0 0.125rem 0.25rem 0 rgb(0 35 11 / 20%)',\n width: '0.75rem',\n height: '0.75rem',\n borderRadius: '0.375rem',\n transition: theme.transitions.create(['width'], {\n duration: 200,\n }),\n },\n '& .MuiSwitch-track': {\n borderRadius: '0.5rem',\n opacity: 1,\n backgroundColor: isDark ? colors.gray[500] : colors.gray[200],\n boxSizing: 'border-box',\n },\n }\n})\n\nexport default Switch\n"],"names":[],"mappings":";;;;;AAAA,MAAM,kBAAkB,MAAc;AACpC,QAAM,QAAQ,OAAO;AACrB,UAAQ,MAAA;AAAA,IACN,KAAK,SAAS;AACZ,aAAO;AAAA,IACT,KAAK,SAAS;AACZ,aAAO;AAAA,IACT,KAAK,SAAS;AACZ,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;ACHA,MAAM,sBAAsB,cAAuC;AAAA,EACjE,cAAc,gBAAA;AAChB,CAAC;AAEM,MAAM,kBAAkB,MAAM,WAAW,mBAAmB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iBAAiB,SAAS,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,GAAG;AAAA,MAC5D,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Tab from '@mui/material/Tab';
|
|
3
|
+
import { IconProp } from './IconProvider';
|
|
4
|
+
export type TabButtonProps = React.ComponentProps<typeof Tab> & {
|
|
5
|
+
id: string;
|
|
6
|
+
icon?: IconProp;
|
|
7
|
+
text: string | React.ReactNode;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
textClassName?: string;
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const TabButton: React.FC<TabButtonProps>;
|
|
14
|
+
export default TabButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Tab from "@mui/material/Tab";
|
|
3
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
4
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
5
|
+
import IconProvider from "./IconProvider.es.js";
|
|
6
|
+
const TabButton = ({ icon, text, tooltip, textClassName, iconSize, isActive, ...props }) => /* @__PURE__ */ jsx(
|
|
7
|
+
Tab,
|
|
8
|
+
{
|
|
9
|
+
sx: {
|
|
10
|
+
padding: "0.75rem 1rem",
|
|
11
|
+
maxWidth: "22.5rem",
|
|
12
|
+
minWidth: "5.625rem"
|
|
13
|
+
},
|
|
14
|
+
label: /* @__PURE__ */ jsxs("span", { className: classNames("flex items-center gap-2", props.disabled ? "opacity-50" : ""), children: [
|
|
15
|
+
icon && /* @__PURE__ */ jsx(
|
|
16
|
+
IconProvider,
|
|
17
|
+
{
|
|
18
|
+
icon,
|
|
19
|
+
className: classNames(
|
|
20
|
+
`text-blue-375 dark:text-gray-500 fill-blue-375 dark:fill-light-blue-375 ${isActive ? "dark:text-indigo-500" : ""}`,
|
|
21
|
+
{ isActive: "" }
|
|
22
|
+
),
|
|
23
|
+
size: iconSize || 1
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(Tooltip, { title: tooltip || "", placement: "bottom", disableHoverListener: tooltip === void 0 ? true : false, children: /* @__PURE__ */ jsx("span", { className: classNames("text-base font-lab capitalize", textClassName), children: text }) })
|
|
27
|
+
] }),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
TabButton as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=TabButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabButton.es.js","sources":["../../../src/components/atoms/TabButton.tsx"],"sourcesContent":["import React from 'react'\nimport Tab from '@mui/material/Tab'\nimport Tooltip from '@mui/material/Tooltip'\n\nimport classNames from '@/utils/classNames'\n\nimport { IconProp } from './IconProvider'\nimport IconProvider from './IconProvider'\n\nexport type TabButtonProps = React.ComponentProps<typeof Tab> & {\n id: string\n icon?: IconProp\n text: string | React.ReactNode\n tooltip?: string\n textClassName?: string\n iconSize?: number\n isActive?: boolean\n}\n\nconst TabButton: React.FC<TabButtonProps> = ({ icon, text, tooltip, textClassName, iconSize, isActive, ...props }) => (\n <Tab\n sx={{\n padding: '0.75rem 1rem',\n maxWidth: '22.5rem',\n minWidth: '5.625rem',\n }}\n label={\n <span className={classNames('flex items-center gap-2', props.disabled ? 'opacity-50' : '')}>\n {icon && (\n <IconProvider\n icon={icon}\n className={classNames(\n `text-blue-375 dark:text-gray-500 fill-blue-375 dark:fill-light-blue-375 ${\n isActive ? 'dark:text-indigo-500' : ''\n }`,\n { isActive: '' },\n )}\n size={iconSize || 1}\n />\n )}\n <Tooltip title={tooltip || ''} placement=\"bottom\" disableHoverListener={tooltip === undefined ? true : false}>\n <span className={classNames('text-base font-lab capitalize', textClassName)}>{text}</span>\n </Tooltip>\n </span>\n }\n {...props}\n />\n)\n\nexport default TabButton\n"],"names":[],"mappings":";;;;;AAmBA,MAAM,YAAsC,CAAC,EAAE,MAAM,MAAM,SAAS,eAAe,UAAU,UAAU,GAAG,MAAA,MACxG;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,IAAI;AAAA,MACF,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ,OACE,qBAAC,QAAA,EAAK,WAAW,WAAW,2BAA2B,MAAM,WAAW,eAAe,EAAE,GACtF,UAAA;AAAA,MAAA,QACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW;AAAA,YACT,2EACE,WAAW,yBAAyB,EACtC;AAAA,YACA,EAAE,UAAU,GAAA;AAAA,UAAG;AAAA,UAEjB,MAAM,YAAY;AAAA,QAAA;AAAA,MAAA;AAAA,MAGtB,oBAAC,WAAQ,OAAO,WAAW,IAAI,WAAU,UAAS,sBAAsB,YAAY,SAAY,OAAO,OACrG,UAAA,oBAAC,UAAK,WAAW,WAAW,iCAAiC,aAAa,GAAI,gBAAK,EAAA,CACrF;AAAA,IAAA,GACF;AAAA,IAED,GAAG;AAAA,EAAA;AACN;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
3
|
+
const TabPanel = ({ children, id, isActive, className, activeClassName, ...other }) => {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
role: "tabpanel",
|
|
8
|
+
hidden: !isActive,
|
|
9
|
+
id: `simple-tabpanel-${id}`,
|
|
10
|
+
"aria-labelledby": `simple-tab-${id}`,
|
|
11
|
+
...other,
|
|
12
|
+
className: classNames(className, isActive && activeClassName),
|
|
13
|
+
children: isActive && children
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
TabPanel as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=TabPanel.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.es.js","sources":["../../../src/components/atoms/TabPanel.tsx"],"sourcesContent":["import React from 'react'\n\nimport classNames from '@/utils/classNames'\n\nexport interface TabPanelProps {\n children: React.ReactNode\n id: string\n isActive?: boolean\n className?: string\n activeClassName?: string\n}\n\nconst TabPanel: React.FC<TabPanelProps> = ({ children, id, isActive, className, activeClassName, ...other }) => {\n return (\n <div\n role=\"tabpanel\"\n hidden={!isActive}\n id={`simple-tabpanel-${id}`}\n aria-labelledby={`simple-tab-${id}`}\n {...other}\n className={classNames(className, isActive && activeClassName)}\n >\n {isActive && children}\n </div>\n )\n}\n\nexport default TabPanel\n"],"names":[],"mappings":";;AAYA,MAAM,WAAoC,CAAC,EAAE,UAAU,IAAI,UAAU,WAAW,iBAAiB,GAAG,YAAY;AAC9G,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,QAAQ,CAAC;AAAA,MACT,IAAI,mBAAmB,EAAE;AAAA,MACzB,mBAAiB,cAAc,EAAE;AAAA,MAChC,GAAG;AAAA,MACJ,WAAW,WAAW,WAAW,YAAY,eAAe;AAAA,MAE3D,UAAA,YAAY;AAAA,IAAA;AAAA,EAAA;AAGnB;"}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { Theme } from '@mui/material';
|
|
2
2
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
import { type TooltipProps as MuiTooltipProps } from '@mui/material/Tooltip';
|
|
5
5
|
export type Sizes = 'large' | 'variable' | 'medium' | 'fit';
|
|
6
|
-
export type CustomTooltipProps =
|
|
6
|
+
export type CustomTooltipProps = MuiTooltipProps & {
|
|
7
7
|
size?: Sizes;
|
|
8
8
|
border?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {
|
|
11
|
+
disabledTitle?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare const LightTooltip: React.NamedExoticComponent<MuiTooltipProps & {
|
|
11
14
|
size?: Sizes | undefined;
|
|
12
15
|
border?: boolean | undefined;
|
|
13
16
|
} & MUIStyledCommonProps<Theme>>;
|
|
14
|
-
export declare const DarkTooltip: React.NamedExoticComponent<
|
|
17
|
+
export declare const DarkTooltip: React.NamedExoticComponent<MuiTooltipProps & {
|
|
15
18
|
size?: Sizes | undefined;
|
|
16
19
|
border?: boolean | undefined;
|
|
17
20
|
} & MUIStyledCommonProps<Theme>>;
|
|
18
|
-
export declare const UnstyledTooltip: React.NamedExoticComponent<
|
|
21
|
+
export declare const UnstyledTooltip: React.NamedExoticComponent<MuiTooltipProps & {
|
|
19
22
|
size?: Sizes | undefined;
|
|
20
23
|
border?: boolean | undefined;
|
|
21
24
|
} & MUIStyledCommonProps<Theme>>;
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import styled from "@mui/material/styles/styled";
|
|
4
4
|
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
|
5
|
+
import { colors } from "../theme/theme.es.js";
|
|
5
6
|
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
6
7
|
const getSize = (size) => {
|
|
7
8
|
let height = 380;
|
|
@@ -43,8 +44,8 @@ const LightTooltip = React.memo(
|
|
|
43
44
|
const { height, width, font } = getSize(size);
|
|
44
45
|
return {
|
|
45
46
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
46
|
-
backgroundColor:
|
|
47
|
-
color:
|
|
47
|
+
backgroundColor: colors.gray[50],
|
|
48
|
+
color: colors.gray[1e3],
|
|
48
49
|
fontWeight: 500,
|
|
49
50
|
fontSize: font,
|
|
50
51
|
maxHeight: height,
|
|
@@ -78,8 +79,8 @@ const DarkTooltip = React.memo(
|
|
|
78
79
|
color: theme.palette.common.black
|
|
79
80
|
},
|
|
80
81
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
81
|
-
backgroundColor:
|
|
82
|
-
color:
|
|
82
|
+
backgroundColor: colors.gray[1e3],
|
|
83
|
+
color: colors.gray[200],
|
|
83
84
|
fontWeight: 500,
|
|
84
85
|
fontSize: font,
|
|
85
86
|
width: "auto",
|
|
@@ -99,7 +100,7 @@ const UnstyledTooltip = React.memo(
|
|
|
99
100
|
return {
|
|
100
101
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
101
102
|
backgroundColor: "transparent",
|
|
102
|
-
color:
|
|
103
|
+
color: colors.gray[1e3],
|
|
103
104
|
maxWidth: width,
|
|
104
105
|
width: "auto",
|
|
105
106
|
maxHeight: height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.es.js","sources":["../../../src/components/atoms/Tooltip.tsx"],"sourcesContent":["import * as React from 'react'\nimport styled from '@mui/material/styles/styled'\nimport Tooltip, { tooltipClasses, TooltipProps } from '@mui/material/Tooltip'\n\nimport classNames from '@/utils/classNames'\n\nexport type Sizes = 'large' | 'variable' | 'medium' | 'fit'\n\nexport type CustomTooltipProps =
|
|
1
|
+
{"version":3,"file":"Tooltip.es.js","sources":["../../../src/components/atoms/Tooltip.tsx"],"sourcesContent":["import * as React from 'react'\nimport styled from '@mui/material/styles/styled'\nimport Tooltip, { tooltipClasses, type TooltipProps as MuiTooltipProps } from '@mui/material/Tooltip'\n\nimport { colors } from '@/components/theme/theme'\n\nimport classNames from '@/utils/classNames'\n\nexport type Sizes = 'large' | 'variable' | 'medium' | 'fit'\n\nexport type CustomTooltipProps = MuiTooltipProps & {\n size?: Sizes\n border?: boolean\n}\n\nexport type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {\n disabledTitle?: React.ReactNode\n}\n\nconst getSize = (size?: Sizes) => {\n let height: string | number = 380\n let width: string | number = 250\n let font = 12\n switch (size) {\n case 'large':\n width = 420\n height = 400\n font = 14\n break\n case 'medium':\n width = 360\n height = 300\n font = 14\n break\n case 'variable':\n width = 'none'\n height = 'none'\n case 'fit':\n width = 'fit-content'\n height = 'none'\n }\n return { height, width, font }\n}\n\nexport const LightTooltip = React.memo(\n styled(({ className, classes, border, ...props }: CustomTooltipProps) => (\n <Tooltip\n disableFocusListener\n {...props}\n classes={{\n popper: className,\n ...classes,\n tooltip: classNames(classes?.tooltip, 'custom-scrollbar'),\n }}\n />\n ))(({ size, theme, border }) => {\n const { height, width, font } = getSize(size)\n return {\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: colors.gray[50],\n color: colors.gray[1000],\n fontWeight: 500,\n fontSize: font,\n maxHeight: height,\n minWidth: width,\n width: 'auto',\n boxShadow: '0px 2px 6px rgba(0, 52, 102, 0.06), 0px 8px 20px rgba(0, 52, 102, 0.1)',\n borderRadius: '0.375rem',\n overflow: 'auto',\n padding: '0.375rem 0.5rem',\n border: border ? '0.0625rem solid #E0ECFD' : '0px solid',\n },\n }\n }),\n)\n\nexport const DarkTooltip = React.memo(\n styled(({ className, classes, ...props }: CustomTooltipProps) => (\n <Tooltip\n disableFocusListener\n {...props}\n classes={{\n popper: className,\n ...classes,\n tooltip: classNames(classes?.tooltip, 'custom-scrollbar'),\n }}\n />\n ))(({ size, theme }) => {\n const { height, width, font } = getSize(size)\n return {\n [`& .${tooltipClasses.arrow}`]: {\n color: theme.palette.common.black,\n },\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: colors.gray[1000],\n color: colors.gray[200],\n fontWeight: 500,\n fontSize: font,\n width: 'auto',\n maxWidth: width,\n maxHeight: height,\n boxShadow: '0px 2px 6px rgba(0, 52, 102, 0.06), 0px 8px 20px rgba(0, 52, 102, 0.1)',\n borderRadius: '0.375rem',\n overflow: 'auto',\n padding: '0.375rem 0.5rem',\n },\n }\n }),\n)\n\nexport const UnstyledTooltip = React.memo(\n styled(({ className, ...props }: CustomTooltipProps) => (\n <Tooltip disableFocusListener {...props} classes={{ popper: className, tooltip: 'custom-scrollbar' }} />\n ))(({ size }) => {\n const { width, height } = getSize(size)\n return {\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: 'transparent',\n color: colors.gray[1000],\n maxWidth: width,\n width: 'auto',\n maxHeight: height,\n border: 'none',\n },\n }\n }),\n)\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,UAAU,CAAC,SAAiB;AAChC,MAAI,SAA0B;AAC9B,MAAI,QAAyB;AAC7B,MAAI,OAAO;AACX,UAAQ,MAAA;AAAA,IACN,KAAK;AACH,cAAQ;AACR,eAAS;AACT,aAAO;AACP;AAAA,IACF,KAAK;AACH,cAAQ;AACR,eAAS;AACT,aAAO;AACP;AAAA,IACF,KAAK;AACH,cAAQ;AACR,eAAS;AAAA,IACX,KAAK;AACH,cAAQ;AACR,eAAS;AAAA,EAAA;AAEb,SAAO,EAAE,QAAQ,OAAO,KAAA;AAC1B;AAEO,MAAM,eAAe,MAAM;AAAA,EAChC,OAAO,CAAC,EAAE,WAAW,SAAS,QAAQ,GAAG,YACvC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,sBAAoB;AAAA,MACnB,GAAG;AAAA,MACJ,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,SAAS,WAAW,mCAAS,SAAS,kBAAkB;AAAA,MAAA;AAAA,IAC1D;AAAA,EAAA,CAEH,EAAE,CAAC,EAAE,MAAM,OAAO,aAAa;AAC9B,UAAM,EAAE,QAAQ,OAAO,KAAA,IAAS,QAAQ,IAAI;AAC5C,WAAO;AAAA,MACL,CAAC,MAAM,eAAe,OAAO,EAAE,GAAG;AAAA,QAChC,iBAAiB,OAAO,KAAK,EAAE;AAAA,QAC/B,OAAO,OAAO,KAAK,GAAI;AAAA,QACvB,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,WAAW;AAAA,QACX,U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;AAAA,MACL,CAAC,MAAM,eAAe,OAAO,EAAE,GAAG;AAAA,QAChC,iBAAiB;AAAA,QACjB,OAAO,OAAO,KAAK,GAAI;AAAA,QACvB,UAAU;AAAA,QACV,OAAO;AAAA,QACP,WAAW;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EAEJ,CAAC;AACH;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { ButtonSize } from '../atoms/Button';
|
|
4
|
+
import { type ButtonProps } from '../atoms/Button';
|
|
5
|
+
interface CopyFieldProps {
|
|
6
|
+
children?: string | JSX.Element;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
rawValue?: string;
|
|
9
|
+
after?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
btnClass?: string;
|
|
13
|
+
btnTextClass?: string;
|
|
14
|
+
iconClass?: string;
|
|
15
|
+
initialText?: string | React.ReactNode | JSX.Element;
|
|
16
|
+
bgClass?: string;
|
|
17
|
+
tooltipTitle?: string | JSX.Element;
|
|
18
|
+
dataTestPrefix?: string;
|
|
19
|
+
wrapperDataTestId?: string;
|
|
20
|
+
btnProps?: ButtonProps;
|
|
21
|
+
beforeCopy?: () => Promise<string>;
|
|
22
|
+
onCopy?: () => void;
|
|
23
|
+
icon?: null | IconProp;
|
|
24
|
+
buttonSize?: ButtonSize;
|
|
25
|
+
isIconButton?: boolean;
|
|
26
|
+
iconSize?: number;
|
|
27
|
+
isGhostButton?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare const CopyField: React.FC<CopyFieldProps>;
|
|
30
|
+
export declare const CopyInputField: React.FC<{
|
|
31
|
+
copyProps: CopyFieldProps;
|
|
32
|
+
className?: string;
|
|
33
|
+
inputClassName?: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const CopyFieldHighlighted: React.FC<{
|
|
36
|
+
text: string;
|
|
37
|
+
}>;
|
|
38
|
+
export default CopyField;
|