tfy-web-components 0.0.5 → 0.0.6
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/..d.ts +31 -0
- package/dist/Button.d.ts +62 -0
- package/dist/CustomDrawer.d.ts +30 -0
- package/dist/IconButton.d.ts +15 -0
- package/dist/IconProvider.d.ts +39 -0
- package/dist/Spinner.d.ts +15 -0
- package/dist/Tooltip.d.ts +28 -0
- package/dist/animation.d.ts +6 -0
- package/dist/backgroundColor.d.ts +5 -0
- package/dist/backgroundImage.d.ts +10 -0
- package/dist/borderWidth.d.ts +6 -0
- package/dist/classNames-f3c6f58e.js +9 -0
- package/dist/classNames-f3c6f58e.js.map +1 -0
- package/dist/colors.d.ts +191 -0
- package/dist/components/atoms/Button.d.ts +42 -0
- package/dist/components/atoms/Button.es.js +147 -0
- package/dist/components/atoms/Button.es.js.map +1 -0
- package/dist/components/atoms/IconButton.d.ts +11 -0
- package/dist/components/atoms/IconButton.es.js +20 -0
- package/dist/components/atoms/IconButton.es.js.map +1 -0
- package/dist/components/atoms/IconProvider.d.ts +29 -0
- package/dist/components/atoms/IconProvider.es.js +67 -0
- package/dist/components/atoms/IconProvider.es.js.map +1 -0
- package/dist/components/atoms/Spinner.d.ts +11 -0
- package/dist/components/atoms/Spinner.es.js +28 -0
- package/dist/components/atoms/Spinner.es.js.map +1 -0
- package/dist/components/atoms/Tooltip.d.ts +21 -0
- package/dist/components/atoms/Tooltip.es.js +118 -0
- package/dist/components/atoms/Tooltip.es.js.map +1 -0
- package/dist/components/molecules/CustomDrawer.d.ts +24 -0
- package/dist/components/molecules/CustomDrawer.es.js +114 -0
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -0
- package/dist/components/theme/animation.d.ts +4 -0
- package/dist/components/theme/animation.es.js +8 -0
- package/dist/components/theme/animation.es.js.map +1 -0
- package/dist/components/theme/backgroundColor.d.ts +3 -0
- package/dist/components/theme/backgroundColor.es.js +7 -0
- package/dist/components/theme/backgroundColor.es.js.map +1 -0
- package/dist/components/theme/backgroundImage.d.ts +8 -0
- package/dist/components/theme/backgroundImage.es.js +22 -0
- package/dist/components/theme/backgroundImage.es.js.map +1 -0
- package/dist/components/theme/borderWidth.d.ts +4 -0
- package/dist/components/theme/borderWidth.es.js +8 -0
- package/dist/components/theme/borderWidth.es.js.map +1 -0
- package/dist/components/theme/colors.d.ts +188 -0
- package/dist/components/theme/colors.es.js +194 -0
- package/dist/components/theme/colors.es.js.map +1 -0
- package/dist/components/theme/cursor.d.ts +3 -0
- package/dist/components/theme/cursor.es.js +7 -0
- package/dist/components/theme/cursor.es.js.map +1 -0
- package/dist/components/theme/dropShadow.d.ts +3 -0
- package/dist/components/theme/dropShadow.es.js +7 -0
- package/dist/components/theme/dropShadow.es.js.map +1 -0
- package/dist/components/theme/flexGrow.d.ts +3 -0
- package/dist/components/theme/flexGrow.es.js +7 -0
- package/dist/components/theme/flexGrow.es.js.map +1 -0
- package/dist/components/theme/fontSize.d.ts +6 -0
- package/dist/components/theme/fontSize.es.js +10 -0
- package/dist/components/theme/fontSize.es.js.map +1 -0
- package/dist/components/theme/height.d.ts +6 -0
- package/dist/components/theme/height.es.js +10 -0
- package/dist/components/theme/height.es.js.map +1 -0
- package/dist/components/theme/index.d.ts +78 -0
- package/dist/components/theme/index.es.js +35 -0
- package/dist/components/theme/index.es.js.map +1 -0
- package/dist/components/theme/keyframes.d.ts +18 -0
- package/dist/components/theme/keyframes.es.js +14 -0
- package/dist/components/theme/keyframes.es.js.map +1 -0
- package/dist/components/theme/lightColorPlugin.js.d.ts +1 -0
- package/dist/components/theme/lightColorPlugin.js.es.js +91 -0
- package/dist/components/theme/lightColorPlugin.js.es.js.map +1 -0
- package/dist/components/theme/maxHeight.d.ts +4 -0
- package/dist/components/theme/maxHeight.es.js +8 -0
- package/dist/components/theme/maxHeight.es.js.map +1 -0
- package/dist/components/theme/screens.d.ts +6 -0
- package/dist/components/theme/screens.es.js +10 -0
- package/dist/components/theme/screens.es.js.map +1 -0
- package/dist/components/theme/tailwindScrollbar.js.d.ts +1 -0
- package/dist/components/theme/tailwindScrollbar.js.es.js +81 -0
- package/dist/components/theme/tailwindScrollbar.js.es.js.map +1 -0
- package/dist/components/theme/theme.d.ts +23 -0
- package/dist/components/theme/theme.es.js +128 -0
- package/dist/components/theme/theme.es.js.map +1 -0
- package/dist/components/theme/transitionProperty.d.ts +4 -0
- package/dist/components/theme/transitionProperty.es.js +8 -0
- package/dist/components/theme/transitionProperty.es.js.map +1 -0
- package/dist/components/theme/useTheme.d.ts +14 -0
- package/dist/components/theme/useTheme.es.js +40 -0
- package/dist/components/theme/useTheme.es.js.map +1 -0
- package/dist/components/theme/utils.d.ts +77 -0
- package/dist/components/theme/utils.es.js +762 -0
- package/dist/components/theme/utils.es.js.map +1 -0
- package/dist/components/theme/zIndex.d.ts +3 -0
- package/dist/components/theme/zIndex.es.js +7 -0
- package/dist/components/theme/zIndex.es.js.map +1 -0
- package/dist/cursor.d.ts +5 -0
- package/dist/dropShadow.d.ts +5 -0
- package/dist/flexGrow.d.ts +5 -0
- package/dist/fontSize.d.ts +8 -0
- package/dist/height.d.ts +8 -0
- package/dist/index.es.js +13 -0
- package/dist/index.es.js.map +1 -0
- package/dist/keyframes.d.ts +20 -0
- package/dist/lightColorPlugin.js.d.ts +1 -0
- package/dist/maxHeight.d.ts +6 -0
- package/dist/plugin-06dc459f.js +61 -0
- package/dist/plugin-06dc459f.js.map +1 -0
- package/dist/screens.d.ts +8 -0
- package/dist/tailwindScrollbar.js.d.ts +1 -0
- package/dist/theme.d.ts +33 -0
- package/dist/transitionProperty.d.ts +6 -0
- package/dist/useTheme.d.ts +22 -0
- package/dist/utils.d.ts +79 -0
- package/dist/zIndex.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.es.js","sources":["../../../src/components/atoms/Button.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport type { FontAwesomeIconProps } from '@fortawesome/react-fontawesome'\n\nimport classNames from '@/utils/classNames'\n\nimport IconProvider from './IconProvider'\nimport { CustomTooltipProps, DarkTooltip, LightTooltip } from './Tooltip'\n\ntype TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {\n disabledTitle?: ReactNode\n}\nexport type ButtonSize = 'large' | 'small'\n\nexport interface ButtonProps {\n id?: string\n icon?: FontAwesomeIconProps['icon'] | string\n text?: React.ReactNode | JSX.Element | string\n block?: boolean\n disabled?: boolean\n loading?: boolean\n dataTestId?: string\n iconToRight?: boolean\n variant?: 'primary' | 'secondary' | 'ghost' | 'tertiary' | 'destructive'\n size?: ButtonSize\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void\n iconClasses?: string\n type?: 'submit' | 'reset' | 'button'\n tooltipProps?: TooltipProps\n iconSize?: number\n removeIconContainer?: boolean\n isMenuItem?: boolean\n useLightTooltip?: boolean\n}\n\nconst iconSizeMap = {\n small: 0.75,\n large: 0.875,\n}\n\ntype ButtonComponent = React.ForwardRefExoticComponent<ButtonProps> & {\n Ghost: React.ForwardRefExoticComponent<ButtonProps>\n Primary: React.ForwardRefExoticComponent<ButtonProps>\n Secondary: React.ForwardRefExoticComponent<ButtonProps>\n Tertiary: React.ForwardRefExoticComponent<ButtonProps>\n Destructive: React.ForwardRefExoticComponent<ButtonProps>\n}\n\ntype WrapperProps = {\n condition: boolean\n tooltipWrapper: (children: ReactElement) => JSX.Element\n children: ReactElement\n}\n\nconst getIconContainerSize = (size: ButtonSize, isGhostOrTertiary: boolean, removeContainer: boolean) => {\n const baseClasses = 'flex items-center justify-center'\n\n if (isGhostOrTertiary) {\n return size === 'large' ? `h-3.5 w-3.5 ${baseClasses}` : `h-3 w-3 ${baseClasses}`\n }\n\n if (size === 'large') {\n const width = removeContainer ? 'w-2.5' : 'w-4'\n return `h-4 ${width} ${baseClasses}`\n }\n\n return `h-2.5 w-2.5 ${baseClasses}`\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ condition, tooltipWrapper, children }) =>\n condition ? tooltipWrapper(children) : <div className={''}>{children}</div>\n\n// TODO: icon related all configs should be clubbed together.\n// Why is iconClasses needed?\n// That control shouldn't be provided.\nconst ButtonBase = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n text,\n icon,\n block = false,\n disabled = false,\n loading = false,\n dataTestId,\n iconToRight = false,\n variant = 'primary',\n size = 'large',\n onClick,\n iconClasses,\n tooltipProps,\n iconSize,\n type,\n removeIconContainer = false,\n isMenuItem,\n id,\n useLightTooltip = false,\n },\n ref,\n ) => {\n const isDisabled = loading || disabled\n const isIconOnly = text && !!icon\n\n const variantClasses = {\n primary: classNames('bg-gray-1000 text-white', {\n 'hover:bg-gray-750': !isDisabled,\n }),\n secondary: classNames('bg-white text-gray-750 border border-gray-250', {\n 'hover:bg-gray-750 hover:text-white hover:border-gray-750': !isDisabled,\n }),\n ghost: classNames('bg-transparent text-gray-750 border-none shadow-none', {\n 'hover:bg-gray-150': !isDisabled,\n }),\n tertiary: classNames('bg-white border text-gray-550 border-gray-250 font-work', {\n 'hover:border-gray-550': !isDisabled,\n }),\n destructive: classNames('bg-white text-rose-500 border border-gray-250', {\n 'hover:bg-rose-500 hover:text-white hover:border-rose-500': !isDisabled,\n }),\n }\n\n const sizeClasses = {\n large: `h-8 ${isIconOnly ? 'px-[0.4375rem]' : 'px-2.5'} text-sm`,\n small: 'h-6 px-1.5 gap-1 text-xs',\n }\n\n const iconContainer = {\n large: getIconContainerSize('large', ['tertiary', 'ghost'].includes(variant), removeIconContainer),\n small: getIconContainerSize('small', ['tertiary', 'ghost'].includes(variant), removeIconContainer),\n }\n\n const classes = classNames(\n 'group/btn shadow-sm gap-2 font-medium flex relative items-center justify-center outline-none transition-all duration-150 rounded-sm whitespace-nowrap font-lab',\n 'disabled:cursor-not-allowed disabled:opacity-40',\n variantClasses[variant],\n sizeClasses[size],\n {\n 'justify-start w-full': isMenuItem,\n 'w-full': block,\n },\n )\n\n const iconClassVariant = {\n primary: 'text-white',\n secondary: isDisabled ? 'text-gray-500' : 'text-gray-500 group-hover/btn:text-white',\n ghost: 'text-gray-750',\n tertiary: 'text-gray-550',\n destructive: isDisabled ? '' : 'group-hover/btn:text-white',\n }\n\n const iconClass = classNames(iconClassVariant[variant], iconContainer[size], {\n [`${iconClasses}`]: iconClasses,\n })\n\n const tooltipWrapper = (children: ReactElement) =>\n disabled || useLightTooltip ? (\n <LightTooltip\n title={tooltipProps?.disabledTitle || tooltipProps?.title}\n placement={tooltipProps?.placement}\n size={tooltipProps?.size}\n >\n {children}\n </LightTooltip>\n ) : (\n <DarkTooltip title={tooltipProps?.title} placement={tooltipProps?.placement} size={tooltipProps?.size}>\n {children}\n </DarkTooltip>\n )\n\n const iconComp = icon && (\n <div className={iconClass}>\n <IconProvider icon={icon} size={iconSize || iconSizeMap[size]} />\n </div>\n )\n\n const spinnerComp = (\n <div className={iconClass}>\n <IconProvider icon=\"fa-spinner\" className=\"fa-spin\" size={iconSizeMap[size]} />\n </div>\n )\n\n const renderedIcon = loading ? spinnerComp : iconComp\n\n return (\n <Wrapper condition={!!tooltipProps?.title || !!tooltipProps?.disabledTitle} tooltipWrapper={tooltipWrapper}>\n <button\n id={id}\n type={type}\n onClick={onClick}\n className={classes}\n disabled={isDisabled}\n ref={ref}\n data-test={dataTestId}\n >\n {!iconToRight && renderedIcon}\n {text}\n {iconToRight && renderedIcon}\n </button>\n </Wrapper>\n )\n },\n)\n\nconst GhostButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (\n <ButtonBase {...props} ref={ref} variant=\"ghost\" />\n))\n\nconst PrimaryButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (\n <ButtonBase {...props} ref={ref} variant=\"primary\" />\n))\n\nconst SecondaryButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (\n <ButtonBase {...props} ref={ref} variant=\"secondary\" />\n))\n\nconst TertiaryButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (\n <ButtonBase {...props} ref={ref} variant=\"tertiary\" />\n))\n\nconst DestructiveButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (\n <ButtonBase {...props} ref={ref} variant=\"destructive\" />\n))\n\nconst Button = ButtonBase as ButtonComponent\n\nButton.displayName = 'Button'\n\nButton.Ghost = GhostButton\nButton.Primary = PrimaryButton\nButton.Secondary = SecondaryButton\nButton.Tertiary = TertiaryButton\nButton.Destructive = DestructiveButton\n\nexport { Button, DestructiveButton, GhostButton, PrimaryButton, SecondaryButton, TertiaryButton }\nexport default Button\n"],"names":["React"],"mappings":";;;;;;;;;;AAkCA,MAAM,cAAc;AAAA,EAClB,OAAO;AAAA,EACP,OAAO;AACT;AAgBA,MAAM,uBAAuB,CAAC,MAAkB,mBAA4B,oBAA6B;AACvG,QAAM,cAAc;AAEpB,MAAI,mBAAmB;AACrB,WAAO,SAAS,UAAU,eAAe,WAAW,KAAK,WAAW,WAAW;AAAA,EACjF;AAEA,MAAI,SAAS,SAAS;AACd,UAAA,QAAQ,kBAAkB,UAAU;AACnC,WAAA,OAAO,KAAK,IAAI,WAAW;AAAA,EACpC;AAEA,SAAO,eAAe,WAAW;AACnC;AAEA,MAAM,UAAkC,CAAC,EAAE,WAAW,gBAAgB,SAAS,MAC7E,YAAY,eAAe,QAAQ,IAAI,oBAAC,OAAI,EAAA,WAAW,IAAK,SAAS,CAAA;AAKvE,MAAM,aAAaA,eAAM;AAAA,EACvB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA,cAAc;AAAA,IACd,UAAU;AAAA,IACV,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,KAEpB,QACG;AACH,UAAM,aAAa,WAAW;AACxB,UAAA,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ED,MAAM,iBAAiBA,eAAM,WAA2C,CAAC,OAAO,QAC7E,oBAAA,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,WAAW,CAAA,CACrD;AAED,MAAM,oBAAoBA,eAAM,WAA2C,CAAC,OAAO,QAChF,oBAAA,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,cAAc,CAAA,CACxD;AAED,MAAM,SAAS;AAEf,OAAO,cAAc;AAErB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,cAAc;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
interface IconButtonProps {
|
|
4
|
+
icon: string | IconProp;
|
|
5
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
6
|
+
iconSize?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const IconButton: React.FC<IconButtonProps>;
|
|
11
|
+
export default IconButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../classNames-f3c6f58e.js";
|
|
3
|
+
import IconProvider from "./IconProvider.es.js";
|
|
4
|
+
import { DarkTooltip } from "./Tooltip.es.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
import "react";
|
|
8
|
+
import "@fortawesome/react-fontawesome";
|
|
9
|
+
import "@mui/material/styles/styled";
|
|
10
|
+
import "@mui/material/Tooltip";
|
|
11
|
+
const IconButton = ({ icon, iconSize, onClick, disabled, tooltip }) => {
|
|
12
|
+
const classes = classNames("text-gray-450 hover:text-gray-750 cursor-pointer w-3", {
|
|
13
|
+
"text-gray-450 hover:text-gray-450 pointer-event-none opacity-40": disabled
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ jsx(DarkTooltip, { title: tooltip, children: /* @__PURE__ */ jsx("span", { className: "leading-none", children: /* @__PURE__ */ jsx(IconProvider, { icon, size: iconSize, onClick, className: classes }) }) });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
IconButton as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=IconButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.es.js","sources":["../../../src/components/atoms/IconButton.tsx"],"sourcesContent":["import React from 'react'\nimport { IconProp } from '@fortawesome/fontawesome-svg-core'\n\nimport classNames from '@/utils/classNames'\n\nimport IconProvider from './IconProvider'\nimport { DarkTooltip } from './Tooltip'\n\ninterface IconButtonProps {\n icon: string | IconProp\n onClick?: (e: React.MouseEvent) => void\n iconSize?: number\n disabled?: boolean\n tooltip?: string\n}\n\nconst IconButton: React.FC<IconButtonProps> = ({ icon, iconSize, onClick, disabled, tooltip }) => {\n const classes = classNames('text-gray-450 hover:text-gray-750 cursor-pointer w-3', {\n 'text-gray-450 hover:text-gray-450 pointer-event-none opacity-40': disabled,\n })\n\n return (\n <DarkTooltip title={tooltip}>\n <span className=\"leading-none\">\n <IconProvider icon={icon} size={iconSize} onClick={onClick} className={classes} />\n </span>\n </DarkTooltip>\n )\n}\n\nexport default IconButton\n"],"names":[],"mappings":";;;;;;;;;;AAgBM,MAAA,aAAwC,CAAC,EAAE,MAAM,UAAU,SAAS,UAAU,cAAc;AAC1F,QAAA,UAAU,WAAW,wDAAwD;AAAA,IACjF,mEAAmE;AAAA,EAAA,CACpE;AAED,6BACG,aAAY,EAAA,OAAO,SAClB,UAAA,oBAAC,UAAK,WAAU,gBACd,UAAC,oBAAA,cAAA,EAAa,MAAY,MAAM,UAAU,SAAkB,WAAW,QAAA,CAAS,EAClF,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
|
|
4
|
+
type ImgIconMap = {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const registerImgIcons: (iconMap: ImgIconMap) => void;
|
|
8
|
+
type CustomIcon = React.ComponentType<CustomIconProps>;
|
|
9
|
+
type CustomIconMap = {
|
|
10
|
+
[key: string]: React.LazyExoticComponent<CustomIcon> | CustomIcon;
|
|
11
|
+
};
|
|
12
|
+
export declare const registerIcons: (iconMap: CustomIconMap) => void;
|
|
13
|
+
interface IconProps {
|
|
14
|
+
icon: string | IconProp;
|
|
15
|
+
color?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
18
|
+
size?: number;
|
|
19
|
+
width?: number;
|
|
20
|
+
forwardedRef?: React.Ref<HTMLElement>;
|
|
21
|
+
nativeProps?: Partial<FontAwesomeIconProps>;
|
|
22
|
+
}
|
|
23
|
+
type CustomIconProps = {
|
|
24
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
};
|
|
28
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLElement>>>;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { forwardRef, Suspense } from "react";
|
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { c as classNames } from "../../classNames-f3c6f58e.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
const IMG_ICONS_MAP = {};
|
|
8
|
+
const registerImgIcons = (iconMap) => {
|
|
9
|
+
Object.assign(IMG_ICONS_MAP, iconMap);
|
|
10
|
+
};
|
|
11
|
+
const CUSTOM_ICONS_MAP = {};
|
|
12
|
+
const registerIcons = (iconMap) => {
|
|
13
|
+
Object.assign(CUSTOM_ICONS_MAP, iconMap);
|
|
14
|
+
};
|
|
15
|
+
const FA_ICON_ALIAS_MAP = {
|
|
16
|
+
github: "fa-brands fa-github",
|
|
17
|
+
gitlab: "fa-brands fa-gitlab",
|
|
18
|
+
bitbucket: "fa-brands fa-bitbucket",
|
|
19
|
+
jenkins: "fa-brands fa-jenkins"
|
|
20
|
+
};
|
|
21
|
+
const DynamicIcon = ({ name, ...props }) => {
|
|
22
|
+
const IconToRender = CUSTOM_ICONS_MAP[name];
|
|
23
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", {}), children: /* @__PURE__ */ jsx(IconToRender, { ...props }) });
|
|
24
|
+
};
|
|
25
|
+
const IconProvider = ({
|
|
26
|
+
icon,
|
|
27
|
+
color,
|
|
28
|
+
size = 0.75,
|
|
29
|
+
width,
|
|
30
|
+
className,
|
|
31
|
+
onClick,
|
|
32
|
+
forwardedRef,
|
|
33
|
+
nativeProps = {}
|
|
34
|
+
}) => {
|
|
35
|
+
const imgIcon = typeof icon === "string" && icon.startsWith("http") ? icon : IMG_ICONS_MAP[icon];
|
|
36
|
+
const faIcon = FA_ICON_ALIAS_MAP[icon] || icon;
|
|
37
|
+
const iconStyles = width ? { width: `${width}rem`, height: "auto" } : { height: `${size}rem`, width: "auto" };
|
|
38
|
+
return imgIcon ? /* @__PURE__ */ jsx(
|
|
39
|
+
"img",
|
|
40
|
+
{
|
|
41
|
+
ref: forwardedRef,
|
|
42
|
+
src: imgIcon,
|
|
43
|
+
style: iconStyles,
|
|
44
|
+
className: classNames(className),
|
|
45
|
+
onClick
|
|
46
|
+
}
|
|
47
|
+
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(DynamicIcon, { onClick, style: { ...iconStyles, color }, name: String(icon), className }) : /* @__PURE__ */ jsx(
|
|
48
|
+
FontAwesomeIcon,
|
|
49
|
+
{
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
icon: faIcon,
|
|
52
|
+
style: { color, fontSize: `${width ?? size}rem` },
|
|
53
|
+
className: classNames("text-xs", className),
|
|
54
|
+
onClick,
|
|
55
|
+
...nativeProps
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
const IconProvider$1 = React__default.memo(
|
|
60
|
+
forwardRef((props, ref) => /* @__PURE__ */ jsx(IconProvider, { ...props, forwardedRef: ref }))
|
|
61
|
+
);
|
|
62
|
+
export {
|
|
63
|
+
IconProvider$1 as default,
|
|
64
|
+
registerIcons,
|
|
65
|
+
registerImgIcons
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=IconProvider.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconProvider.es.js","sources":["../../../src/components/atoms/IconProvider.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, Suspense } from 'react'\nimport { IconProp } from '@fortawesome/fontawesome-svg-core'\nimport { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome'\n\nimport classNames from '@/utils/classNames'\n\ntype ImgIconMap = { [key: string]: string }\nconst IMG_ICONS_MAP: ImgIconMap = {}\nexport const registerImgIcons = (iconMap: ImgIconMap) => {\n Object.assign(IMG_ICONS_MAP, iconMap)\n}\n\ntype CustomIcon = React.ComponentType<CustomIconProps>\ntype CustomIconMap = {\n [key: string]: React.LazyExoticComponent<CustomIcon> | CustomIcon\n}\nconst CUSTOM_ICONS_MAP: CustomIconMap = {}\nexport const registerIcons = (iconMap: CustomIconMap) => {\n Object.assign(CUSTOM_ICONS_MAP, iconMap)\n}\n\nconst FA_ICON_ALIAS_MAP: { readonly [key: string]: string } = {\n github: 'fa-brands fa-github',\n gitlab: 'fa-brands fa-gitlab',\n bitbucket: 'fa-brands fa-bitbucket',\n jenkins: 'fa-brands fa-jenkins',\n}\n\ninterface IconProps {\n icon: string | IconProp\n color?: string\n className?: string\n onClick?: (e: React.MouseEvent) => void\n size?: number\n width?: number\n forwardedRef?: React.Ref<HTMLElement>\n nativeProps?: Partial<FontAwesomeIconProps>\n}\n\ntype CustomIconProps = {\n onClick?: (e: React.MouseEvent) => void\n className?: string\n style?: React.CSSProperties\n}\ntype DynamicIconProps = CustomIconProps & {\n name: string\n}\n\nconst DynamicIcon = ({ name, ...props }: DynamicIconProps) => {\n const IconToRender = CUSTOM_ICONS_MAP[name]\n return (\n <Suspense fallback={<span />}>\n <IconToRender {...props} />\n </Suspense>\n )\n}\n\nconst IconProvider = ({\n icon,\n color,\n size = 0.75,\n width,\n className,\n onClick,\n forwardedRef,\n nativeProps = {},\n}: IconProps) => {\n const imgIcon = typeof icon === 'string' && icon.startsWith('http') ? icon : IMG_ICONS_MAP[icon as string]\n const faIcon = FA_ICON_ALIAS_MAP[icon as string] || icon\n\n const iconStyles = width ? { width: `${width}rem`, height: 'auto' } : { height: `${size}rem`, width: 'auto' }\n\n return imgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={imgIcon}\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n />\n ) : CUSTOM_ICONS_MAP[icon as string] ? (\n <DynamicIcon onClick={onClick} style={{ ...iconStyles, color }} name={String(icon)} className={className} />\n ) : (\n <FontAwesomeIcon\n ref={forwardedRef as ForwardedRef<SVGSVGElement>}\n icon={faIcon as IconProp}\n style={{ color, fontSize: `${width ?? size}rem` }}\n className={classNames('text-xs', className)}\n onClick={onClick}\n {...nativeProps}\n />\n )\n}\n\nexport default React.memo(\n forwardRef<HTMLElement, IconProps>((props, ref) => <IconProvider {...props} forwardedRef={ref} />),\n)\n"],"names":["React"],"mappings":";;;;;;AAOA,MAAM,gBAA4B,CAAA;AACrB,MAAA,mBAAmB,CAAC,YAAwB;AAChD,SAAA,OAAO,eAAe,OAAO;AACtC;AAMA,MAAM,mBAAkC,CAAA;AAC3B,MAAA,gBAAgB,CAAC,YAA2B;AAChD,SAAA,OAAO,kB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M;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,IAAA,CAAK,CAAE;AACnG;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../classNames-f3c6f58e.js";
|
|
3
|
+
import "classnames";
|
|
4
|
+
import "tailwind-merge";
|
|
5
|
+
const Spinner = ({ className, small, big, medium, center, type = "normal" }) => {
|
|
6
|
+
const isDefault = () => type === "normal";
|
|
7
|
+
const classes = classNames({
|
|
8
|
+
"animate-spin ease-linear rounded-full overflow-hidden": true,
|
|
9
|
+
"border-gray-200 btop": isDefault(),
|
|
10
|
+
"border-4 border-t-4 h-8 w-8": isDefault() && !small && !medium && !big,
|
|
11
|
+
"h-4 w-4": small,
|
|
12
|
+
"border-2 border-t-2": isDefault() && small,
|
|
13
|
+
"h-12 w-12": medium,
|
|
14
|
+
"border-4 border-t-4": isDefault() && medium,
|
|
15
|
+
"h-20 w-20": big,
|
|
16
|
+
"border-8 border-t-8 ": isDefault() && big,
|
|
17
|
+
"m-auto": center,
|
|
18
|
+
[`${className}`]: className
|
|
19
|
+
});
|
|
20
|
+
switch (type) {
|
|
21
|
+
default:
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: classes, role: "status", children: /* @__PURE__ */ jsx("span", { className: "invisible", children: "Loading..." }) });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
Spinner as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=Spinner.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.es.js","sources":["../../../src/components/atoms/Spinner.tsx"],"sourcesContent":["import React from 'react'\n\nimport classNames from '@/utils/classNames'\n\nexport interface SpinnerProps {\n className?: string\n small?: boolean\n big?: boolean\n medium?: boolean\n center?: boolean\n type?: 'normal'\n}\nconst Spinner: React.FC<SpinnerProps> = ({ className, small, big, medium, center, type = 'normal' }) => {\n const isDefault = () => type === 'normal'\n\n const classes = classNames({\n 'animate-spin ease-linear rounded-full overflow-hidden': true,\n 'border-gray-200 btop': isDefault(),\n 'border-4 border-t-4 h-8 w-8': isDefault() && !small && !medium && !big,\n 'h-4 w-4': small,\n 'border-2 border-t-2': isDefault() && small,\n 'h-12 w-12': medium,\n 'border-4 border-t-4': isDefault() && medium,\n 'h-20 w-20': big,\n 'border-8 border-t-8 ': isDefault() && big,\n 'm-auto': center,\n [`${className}`]: className,\n })\n\n switch (type) {\n default:\n return (\n <div className={classes} role=\"status\">\n <span className=\"invisible\">Loading...</span>\n </div>\n )\n }\n}\n\nexport default Spinner\n"],"names":[],"mappings":";;;;AAYM,MAAA,UAAkC,CAAC,EAAE,WAAW,OAAO,KAAK,QAAQ,QAAQ,OAAO,eAAe;AAChG,QAAA,YAAY,MAAM,SAAS;AAEjC,QAAM,UAAU,WAAW;AAAA,IACzB,yDAAyD;AAAA,IACzD,wBAAwB,UAAU;AAAA,IAClC,+BAA+B,UAAU,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;AAAA,IACpE,WAAW;AAAA,IACX,uBAAuB,eAAe;AAAA,IACtC,aAAa;AAAA,IACb,uBAAuB,eAAe;AAAA,IACtC,aAAa;AAAA,IACb,wBAAwB,eAAe;AAAA,IACvC,UAAU;AAAA,IACV,CAAC,GAAG,SAAS,EAAE,GAAG;AAAA,EAAA,CACnB;AAED,UAAQ,MAAM;AAAA,IACZ;AAEI,aAAA,oBAAC,OAAI,EAAA,WAAW,SAAS,MAAK,UAC5B,UAAA,oBAAC,QAAK,EAAA,WAAU,aAAY,UAAA,aAAA,CAAU,EACxC,CAAA;AAAA,EAEN;AACF;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
import { MUIStyledCommonProps } from '@mui/system';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
5
|
+
export type Sizes = 'large' | 'variable' | 'medium' | 'fit';
|
|
6
|
+
export type CustomTooltipProps = TooltipProps & {
|
|
7
|
+
size?: Sizes;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const LightTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
11
|
+
size?: Sizes | undefined;
|
|
12
|
+
border?: boolean | undefined;
|
|
13
|
+
} & MUIStyledCommonProps<Theme>>;
|
|
14
|
+
export declare const DarkTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
15
|
+
size?: Sizes | undefined;
|
|
16
|
+
border?: boolean | undefined;
|
|
17
|
+
} & MUIStyledCommonProps<Theme>>;
|
|
18
|
+
export declare const UnstyledTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
19
|
+
size?: Sizes | undefined;
|
|
20
|
+
border?: boolean | undefined;
|
|
21
|
+
} & MUIStyledCommonProps<Theme>>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import styled from "@mui/material/styles/styled";
|
|
4
|
+
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
|
5
|
+
import { c as classNames } from "../../classNames-f3c6f58e.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "tailwind-merge";
|
|
8
|
+
const getSize = (size) => {
|
|
9
|
+
let height = 380;
|
|
10
|
+
let width = 250;
|
|
11
|
+
let font = 12;
|
|
12
|
+
switch (size) {
|
|
13
|
+
case "large":
|
|
14
|
+
width = 420;
|
|
15
|
+
height = 400;
|
|
16
|
+
font = 14;
|
|
17
|
+
break;
|
|
18
|
+
case "medium":
|
|
19
|
+
width = 360;
|
|
20
|
+
height = 300;
|
|
21
|
+
font = 14;
|
|
22
|
+
break;
|
|
23
|
+
case "variable":
|
|
24
|
+
width = "none";
|
|
25
|
+
height = "none";
|
|
26
|
+
case "fit":
|
|
27
|
+
width = "fit-content";
|
|
28
|
+
height = "none";
|
|
29
|
+
}
|
|
30
|
+
return { height, width, font };
|
|
31
|
+
};
|
|
32
|
+
const LightTooltip = React.memo(
|
|
33
|
+
styled(({ className, classes, border, ...props }) => /* @__PURE__ */ jsx(
|
|
34
|
+
Tooltip,
|
|
35
|
+
{
|
|
36
|
+
disableFocusListener: true,
|
|
37
|
+
...props,
|
|
38
|
+
classes: {
|
|
39
|
+
popper: className,
|
|
40
|
+
...classes,
|
|
41
|
+
tooltip: classNames(classes == null ? void 0 : classes.tooltip, "custom-scrollbar")
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
))(({ size, theme, border }) => {
|
|
45
|
+
const { height, width, font } = getSize(size);
|
|
46
|
+
return {
|
|
47
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
48
|
+
backgroundColor: "#ffffff",
|
|
49
|
+
color: theme.palette.grey[900],
|
|
50
|
+
fontWeight: 500,
|
|
51
|
+
fontSize: font,
|
|
52
|
+
maxHeight: height,
|
|
53
|
+
minWidth: width,
|
|
54
|
+
width: "auto",
|
|
55
|
+
boxShadow: "0px 2px 6px rgba(0, 52, 102, 0.06), 0px 8px 20px rgba(0, 52, 102, 0.1)",
|
|
56
|
+
borderRadius: "0.375rem",
|
|
57
|
+
overflow: "auto",
|
|
58
|
+
padding: "0.375rem 0.5rem",
|
|
59
|
+
border: border ? "0.0625rem solid #E0ECFD" : "0px solid"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
const DarkTooltip = React.memo(
|
|
65
|
+
styled(({ className, classes, ...props }) => /* @__PURE__ */ jsx(
|
|
66
|
+
Tooltip,
|
|
67
|
+
{
|
|
68
|
+
disableFocusListener: true,
|
|
69
|
+
...props,
|
|
70
|
+
classes: {
|
|
71
|
+
popper: className,
|
|
72
|
+
...classes,
|
|
73
|
+
tooltip: classNames(classes == null ? void 0 : classes.tooltip, "custom-scrollbar")
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
))(({ size, theme }) => {
|
|
77
|
+
const { height, width, font } = getSize(size);
|
|
78
|
+
return {
|
|
79
|
+
[`& .${tooltipClasses.arrow}`]: {
|
|
80
|
+
color: theme.palette.common.black
|
|
81
|
+
},
|
|
82
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
83
|
+
backgroundColor: theme.palette.common.black,
|
|
84
|
+
color: theme.palette.grey[200],
|
|
85
|
+
fontWeight: 500,
|
|
86
|
+
fontSize: font,
|
|
87
|
+
width: "auto",
|
|
88
|
+
maxWidth: width,
|
|
89
|
+
maxHeight: height,
|
|
90
|
+
boxShadow: "0px 2px 6px rgba(0, 52, 102, 0.06), 0px 8px 20px rgba(0, 52, 102, 0.1)",
|
|
91
|
+
borderRadius: "0.375rem",
|
|
92
|
+
overflow: "auto",
|
|
93
|
+
padding: "0.375rem 0.5rem"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
const UnstyledTooltip = React.memo(
|
|
99
|
+
styled(({ className, ...props }) => /* @__PURE__ */ jsx(Tooltip, { disableFocusListener: true, ...props, classes: { popper: className, tooltip: "custom-scrollbar" } }))(({ size }) => {
|
|
100
|
+
const { width, height } = getSize(size);
|
|
101
|
+
return {
|
|
102
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
103
|
+
backgroundColor: "transparent",
|
|
104
|
+
color: "rgba(0, 0, 0, 0.87)",
|
|
105
|
+
maxWidth: width,
|
|
106
|
+
width: "auto",
|
|
107
|
+
maxHeight: height,
|
|
108
|
+
border: "none"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
export {
|
|
114
|
+
DarkTooltip,
|
|
115
|
+
LightTooltip,
|
|
116
|
+
UnstyledTooltip
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=Tooltip.es.js.map
|
|
@@ -0,0 +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 = TooltipProps & {\n size?: Sizes\n border?: boolean\n}\n\n// todo: values should rely on root font size\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: '#ffffff',\n color: theme.palette.grey[900],\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: theme.palette.common.black,\n color: theme.palette.grey[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: 'rgba(0, 0, 0, 0.87)',\n maxWidth: width,\n width: 'auto',\n maxHeight: height,\n border: 'none',\n },\n }\n }),\n)\n"],"names":[],"mappings":";;;;;;;AAcA,MAAM,UAAU,CAAC,SAAiB;AAChC,MAAI,SAA0B;AAC9B,MAAI,QAAyB;AAC7B,MAAI,OAAO;AACX,UAAQ,MAAM;AAAA,IACZ,KAAK;AACK,cAAA;AACC,eAAA;AACF,aAAA;AACP;AAAA,IACF,KAAK;AACK,cAAA;AACC,eAAA;AACF,aAAA;AACP;AAAA,IACF,KAAK;AACK,cAAA;AACC,eAAA;AAAA,IACX,KAAK;AACK,cAAA;AACC,eAAA;AAAA,EACb;AACO,SAAA,EAAE,QAAQ,OAAO;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,MAC1D;AAAA,IAAA;AAAA,EAEH,CAAA,EAAE,CAAC,E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AAA,EACF,CACD;AACH;AAEO,MAAM,kBAAkB,MAAM;AAAA,EACnC,OAAO,CAAC,EAAE,WAAW,GAAG,YACtB,oBAAC,SAAQ,EAAA,sBAAoB,MAAE,GAAG,OAAO,SAAS,EAAE,QAAQ,WAAW,SAAS,mBAAsB,EAAA,CAAA,CACvG,EAAE,CAAC,EAAE,WAAW;AACf,UAAM,EAAE,OAAO,OAAO,IAAI,QAAQ,IAAI;AAC/B,WAAA;AAAA,MACL,CAAC,MAAM,eAAe,OAAO,EAAE,GAAG;AAAA,QAChC,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP,UAAU;AAAA,QACV,OAAO;AAAA,QACP,WAAW;AAAA,QACX,QAAQ;AAAA,MACV;AAAA,IAAA;AAAA,EACF,CACD;AACH;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ContextType = {
|
|
3
|
+
isPreventEscape?: boolean;
|
|
4
|
+
confirmOnClose?: boolean;
|
|
5
|
+
onEscape?: () => void;
|
|
6
|
+
updateDrawerContext?: (_?: ContextType, clearState?: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const CustomDrawerContext: React.Context<ContextType>;
|
|
9
|
+
interface DrawerProps {
|
|
10
|
+
children: React.ReactNode | JSX.Element | string;
|
|
11
|
+
anchor?: 'right' | 'left' | 'top' | 'bottom' | undefined;
|
|
12
|
+
open: boolean;
|
|
13
|
+
inner?: boolean;
|
|
14
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
15
|
+
width?: string;
|
|
16
|
+
bodyClassName?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
overflowY?: boolean;
|
|
19
|
+
confirmOnClose?: boolean;
|
|
20
|
+
confirmOnCloseMessage?: string;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const CustomDrawer: React.FC<DrawerProps>;
|
|
24
|
+
export default CustomDrawer;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useState, useRef, useMemo, useEffect } from "react";
|
|
3
|
+
import Drawer from "@mui/material/Drawer";
|
|
4
|
+
import { c as classNames } from "../../classNames-f3c6f58e.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
const CustomDrawerContext = React__default.createContext({});
|
|
8
|
+
const CustomDrawer = ({
|
|
9
|
+
anchor = "right",
|
|
10
|
+
children,
|
|
11
|
+
open,
|
|
12
|
+
inner,
|
|
13
|
+
size = "medium",
|
|
14
|
+
width,
|
|
15
|
+
bodyClassName,
|
|
16
|
+
className = "",
|
|
17
|
+
overflowY,
|
|
18
|
+
confirmOnClose,
|
|
19
|
+
confirmOnCloseMessage,
|
|
20
|
+
onClose
|
|
21
|
+
}) => {
|
|
22
|
+
const [isCloseConfirmationOpen, setIsCloseConfirmationOpen] = useState(false);
|
|
23
|
+
const [shouldConfirmOnClose, setShouldConfirmOnClose] = useState(confirmOnClose);
|
|
24
|
+
const contextRef = useRef({});
|
|
25
|
+
const contextValue = useMemo(
|
|
26
|
+
() => ({
|
|
27
|
+
updateDrawerContext: (state, clearState) => {
|
|
28
|
+
contextRef.current = clearState ? {} : { ...contextRef.current ?? {}, ...state };
|
|
29
|
+
if ((state == null ? void 0 : state.confirmOnClose) !== shouldConfirmOnClose) {
|
|
30
|
+
setShouldConfirmOnClose(state == null ? void 0 : state.confirmOnClose);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
[shouldConfirmOnClose]
|
|
35
|
+
);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setShouldConfirmOnClose(confirmOnClose);
|
|
38
|
+
if (!open) {
|
|
39
|
+
setIsCloseConfirmationOpen(false);
|
|
40
|
+
}
|
|
41
|
+
}, [confirmOnClose, open]);
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
Drawer,
|
|
45
|
+
{
|
|
46
|
+
anchor,
|
|
47
|
+
open,
|
|
48
|
+
onClose: inner ? shouldConfirmOnClose ? () => setIsCloseConfirmationOpen(true) : onClose : void 0,
|
|
49
|
+
className: classNames("feature-importance custom-drawer", className),
|
|
50
|
+
onKeyDown: (e) => {
|
|
51
|
+
const { isPreventEscape, onEscape } = contextRef.current || {};
|
|
52
|
+
if (e.key === "Escape") {
|
|
53
|
+
if (!isPreventEscape)
|
|
54
|
+
;
|
|
55
|
+
else {
|
|
56
|
+
onEscape == null ? void 0 : onEscape();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onClick: (e) => {
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
},
|
|
63
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: classNames(
|
|
67
|
+
"flex-1 bg-gray-50 min-h-[100vh] feature-content",
|
|
68
|
+
width ?? {
|
|
69
|
+
"w-[46vw]": size === "medium" && inner,
|
|
70
|
+
"w-[52vw]": size === "medium" && !inner,
|
|
71
|
+
"w-[30vw]": size === "small" && inner,
|
|
72
|
+
"w-[35vw]": size === "small" && !inner,
|
|
73
|
+
"w-[65vw]": size === "large" && inner,
|
|
74
|
+
"w-[70vw]": size === "large" && !inner,
|
|
75
|
+
"w-[80vw]": size === "xlarge" && inner,
|
|
76
|
+
"w-[85vw]": size === "xlarge" && !inner
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"overflow-y-scroll custom-scrollbar": overflowY
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
children: open && /* @__PURE__ */ jsx("div", { className: classNames("h-full", bodyClassName ?? "my-3 mx-5 mb-1.5"), children: /* @__PURE__ */ jsx(CustomDrawerContext.Provider, { value: contextValue, children }) })
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
shouldConfirmOnClose && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
+
"following code will be added here ",
|
|
89
|
+
confirmOnCloseMessage && false,
|
|
90
|
+
`
|
|
91
|
+
<Alert
|
|
92
|
+
title="Warning"
|
|
93
|
+
message={
|
|
94
|
+
confirmOnCloseMessage ||
|
|
95
|
+
'Closing this drawer will discard all changes. Are you sure you want to close it?'
|
|
96
|
+
}
|
|
97
|
+
onConfirm={async () => {
|
|
98
|
+
setIsCloseConfirmationOpen(false)
|
|
99
|
+
}}
|
|
100
|
+
onClose={() => setIsCloseConfirmationOpen(false)}
|
|
101
|
+
onCloseAfterConfirm={onClose}
|
|
102
|
+
confirmButtonText="Yes"
|
|
103
|
+
open={isCloseConfirmationOpen}
|
|
104
|
+
/>
|
|
105
|
+
`,
|
|
106
|
+
isCloseConfirmationOpen
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
CustomDrawerContext,
|
|
112
|
+
CustomDrawer as default
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=CustomDrawer.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomDrawer.es.js","sources":["../../../src/components/molecules/CustomDrawer.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react'\nimport Drawer from '@mui/material/Drawer'\n\nimport classNames from '@/utils/classNames'\n\ntype ContextType = {\n isPreventEscape?: boolean\n confirmOnClose?: boolean\n onEscape?: () => void\n updateDrawerContext?: (_?: ContextType, clearState?: boolean) => void\n}\n\nexport const CustomDrawerContext = React.createContext<ContextType>({})\n\ninterface DrawerProps {\n children: React.ReactNode | JSX.Element | string\n anchor?: 'right' | 'left' | 'top' | 'bottom' | undefined\n open: boolean\n inner?: boolean\n size?: 'small' | 'medium' | 'large' | 'xlarge'\n width?: string\n bodyClassName?: string\n className?: string\n overflowY?: boolean\n confirmOnClose?: boolean\n confirmOnCloseMessage?: string\n onClose: () => void\n}\n\nconst CustomDrawer: React.FC<DrawerProps> = ({\n anchor = 'right',\n children,\n open,\n inner,\n size = 'medium',\n width,\n bodyClassName,\n className = '',\n overflowY,\n confirmOnClose,\n confirmOnCloseMessage,\n onClose,\n}) => {\n const [isCloseConfirmationOpen, setIsCloseConfirmationOpen] = useState(false)\n const [shouldConfirmOnClose, setShouldConfirmOnClose] = useState(confirmOnClose)\n\n const contextRef = useRef<ContextType>({})\n const contextValue = useMemo<ContextType>(\n () => ({\n updateDrawerContext: (state?: ContextType, clearState?: boolean) => {\n contextRef.current = clearState ? {} : { ...(contextRef.current ?? {}), ...state }\n if (state?.confirmOnClose !== shouldConfirmOnClose) {\n setShouldConfirmOnClose(state?.confirmOnClose)\n }\n },\n }),\n [shouldConfirmOnClose],\n )\n\n useEffect(() => {\n setShouldConfirmOnClose(confirmOnClose)\n if (!open) {\n setIsCloseConfirmationOpen(false)\n }\n }, [confirmOnClose, open])\n\n return (\n <>\n <Drawer\n anchor={anchor}\n open={open}\n onClose={inner ? (shouldConfirmOnClose ? () => setIsCloseConfirmationOpen(true) : onClose) : undefined}\n className={classNames('feature-importance custom-drawer', className)}\n onKeyDown={(e) => {\n const { isPreventEscape, onEscape } = contextRef.current || {}\n if (e.key === 'Escape') {\n if (!isPreventEscape) {\n // TODO: Fix this, do not close drawer when escape is pressed\n // onClose()\n } else {\n onEscape?.()\n }\n }\n }}\n onClick={(e) => {\n e.stopPropagation()\n }}\n >\n <div className=\"flex overflow-hidden\">\n <div\n className={classNames(\n 'flex-1 bg-gray-50 min-h-[100vh] feature-content',\n width ?? {\n 'w-[46vw]': size === 'medium' && inner,\n 'w-[52vw]': size === 'medium' && !inner,\n 'w-[30vw]': size === 'small' && inner,\n 'w-[35vw]': size === 'small' && !inner,\n 'w-[65vw]': size === 'large' && inner,\n 'w-[70vw]': size === 'large' && !inner,\n 'w-[80vw]': size === 'xlarge' && inner,\n 'w-[85vw]': size === 'xlarge' && !inner,\n },\n {\n 'overflow-y-scroll custom-scrollbar': overflowY,\n },\n )}\n >\n {open && (\n <div className={classNames('h-full', bodyClassName ?? 'my-3 mx-5 mb-1.5')}>\n <CustomDrawerContext.Provider value={contextValue}>{children}</CustomDrawerContext.Provider>\n </div>\n )}\n </div>\n </div>\n </Drawer>\n {shouldConfirmOnClose && (\n <>\n following code will be added here {confirmOnCloseMessage && false}\n {`\n <Alert\n title=\"Warning\"\n message={\n confirmOnCloseMessage ||\n 'Closing this drawer will discard all changes. Are you sure you want to close it?'\n }\n onConfirm={async () => {\n setIsCloseConfirmationOpen(false)\n }}\n onClose={() => setIsCloseConfirmationOpen(false)}\n onCloseAfterConfirm={onClose}\n confirmButtonText=\"Yes\"\n open={isCloseConfirmationOpen}\n />\n `}\n {isCloseConfirmationOpen}\n </>\n )}\n </>\n )\n}\n\nexport default CustomDrawer\n"],"names":["React"],"mappings":";;;;;;AAYO,MAAM,sBAAsBA,eAAM,cAA2B,EAAE;AAiBtE,MAAM,eAAsC,CAAC;AAAA,EAC3C,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,SAAS,KAAK;AAC5E,QAAM,CAAC,sBAAsB,uBAAuB,IAAI,SAAS,cAAc;AAEzE,QAAA,aAAa,OAAoB,CAAA,CAAE;AACzC,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL,qBAAqB,CAAC,OAAqB,eAAyB;AACvD,mBAAA,UAAU,aAAa,KAAK,EAAE,GAAI,WAAW,WAAW,CAAA,GAAK,GAAG;AACvE,aAAA,+BAAO,oBAAmB,sBAAsB;AAClD,kCAAwB,+BAAO,cAAc;AAAA,QAC/C;AAAA,MACF;AAAA,IAAA;AAAA,IAEF,CAAC,oBAAoB;A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AA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,IACC,wBACG,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACmC,yBAAyB;AAAA,MAC3D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAgBA;AAAA,IAAA,GACH;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.es.js","sources":["../../../src/components/theme/animation.ts"],"sourcesContent":["export const animation = {\n fadeOut: 'fadeOut 250ms ease-in-out',\n fadeIn: 'fadeIn 250ms ease-in-out',\n}\n"],"names":[],"mappings":"AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,QAAQ;AACV;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundColor.es.js","sources":["../../../src/components/theme/backgroundColor.ts"],"sourcesContent":["export const backgroundColor = (theme: (path: string) => string | undefined) => ({\n app: theme('colors.gray.50'),\n})\n"],"names":[],"mappings":"AAAa,MAAA,kBAAkB,CAAC,WAAiD;AAAA,EAC/E,KAAK,MAAM,gBAAgB;AAC7B;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const backgroundImage: (theme: (path: string) => string | undefined) => {
|
|
2
|
+
'blue-red-gradient': string;
|
|
3
|
+
'white-indigo-gradient': string;
|
|
4
|
+
'chat-template': string;
|
|
5
|
+
'blue-linear-gradient': string;
|
|
6
|
+
'new-deployment-gradient': string;
|
|
7
|
+
'new-deployment-gradient-text': string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const backgroundImage = (theme) => ({
|
|
2
|
+
"blue-red-gradient": `linear-gradient(to right, ${theme("colors.violet.500")}, ${theme("colors.rose.400")}, ${theme(
|
|
3
|
+
"colors.blue.600"
|
|
4
|
+
)})`,
|
|
5
|
+
"white-indigo-gradient": `linear-gradient(186deg, ${theme("colors.white / 10%")} 35.98%, ${theme(
|
|
6
|
+
"colors.indigo.500 / 19%"
|
|
7
|
+
)} 96.63%)`,
|
|
8
|
+
"chat-template": `linear-gradient(179deg, ${theme("colors.white / 10%")} 45.13%, ${theme("colors.blue.10")} 99.12%)`,
|
|
9
|
+
"blue-linear-gradient": `linear-gradient(0deg, ${theme("colors.blue.purple")} 40.19%, ${theme(
|
|
10
|
+
"colors.blue.650"
|
|
11
|
+
)} 111.1%)`,
|
|
12
|
+
"new-deployment-gradient": `linear-gradient(180deg, ${theme("colors.white")} 30.17%, ${theme(
|
|
13
|
+
"colors.gray.100"
|
|
14
|
+
)} 100%)`,
|
|
15
|
+
"new-deployment-gradient-text": `linear-gradient(91deg, ${theme(
|
|
16
|
+
"colors.gray.1000"
|
|
17
|
+
)} 25.01%, #8B5CF6 73.45%, #6366F1 98.96%)`
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
backgroundImage
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=backgroundImage.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundImage.es.js","sources":["../../../src/components/theme/backgroundImage.ts"],"sourcesContent":["export const backgroundImage = (theme: (path: string) => string | undefined) => ({\n 'blue-red-gradient': `linear-gradient(to right, ${theme('colors.violet.500')}, ${theme('colors.rose.400')}, ${theme(\n 'colors.blue.600',\n )})`,\n 'white-indigo-gradient': `linear-gradient(186deg, ${theme('colors.white / 10%')} 35.98%, ${theme(\n 'colors.indigo.500 / 19%',\n )} 96.63%)`,\n 'chat-template': `linear-gradient(179deg, ${theme('colors.white / 10%')} 45.13%, ${theme('colors.blue.10')} 99.12%)`,\n 'blue-linear-gradient': `linear-gradient(0deg, ${theme('colors.blue.purple')} 40.19%, ${theme(\n 'colors.blue.650',\n )} 111.1%)`,\n 'new-deployment-gradient': `linear-gradient(180deg, ${theme('colors.white')} 30.17%, ${theme(\n 'colors.gray.100',\n )} 100%)`,\n 'new-deployment-gradient-text': `linear-gradient(91deg, ${theme(\n 'colors.gray.1000',\n )} 25.01%, #8B5CF6 73.45%, #6366F1 98.96%)`,\n})\n"],"names":[],"mappings":"AAAa,MAAA,kBAAkB,CAAC,WAAiD;AAAA,EAC/E,qBAAqB,6BAA6B,MAAM,mBAAmB,CAAC,KAAK,MAAM,iBAAiB,CAAC,KAAK;AAAA,IAC5G;AAAA,EACD,CAAA;AAAA,EACD,yBAAyB,2BAA2B,MAAM,oBAAoB,CAAC,YAAY;AAAA,IACzF;AAAA,EACD,CAAA;AAAA,EACD,iBAAiB,2BAA2B,MAAM,oBAAoB,CAAC,YAAY,MAAM,gBAAgB,CAAC;AAAA,EAC1G,wBAAwB,yBAAyB,MAAM,oBAAoB,CAAC,YAAY;AAAA,IACtF;AAAA,EACD,CAAA;AAAA,EACD,2BAA2B,2BAA2B,MAAM,cAAc,CAAC,YAAY;AAAA,IACrF;AAAA,EACD,CAAA;AAAA,EACD,gCAAgC,0BAA0B;AAAA,IACxD;AAAA,EACD,CAAA;AACH;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borderWidth.es.js","sources":["../../../src/components/theme/borderWidth.ts"],"sourcesContent":["export const borderWidth = {\n DEFAULT: '0.0625rem',\n 1: '0.0625rem',\n}\n"],"names":[],"mappings":"AAAO,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,GAAG;AACL;"}
|