tfy-web-components 0.0.14 → 0.0.16
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/{classNames-f3c6f58e.js → classNames-CC5emYUV.js} +1 -1
- package/dist/{classNames-f3c6f58e.js.map → classNames-CC5emYUV.js.map} +1 -1
- package/dist/colors.d.ts +2 -0
- package/dist/components/atoms/Button.es.js +1 -9
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/IconButton.es.js +1 -10
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.es.js +1 -5
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Spinner.es.js +1 -3
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Tooltip.es.js +1 -3
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/CustomDrawer.es.js +2 -5
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/theme/backgroundColor.es.js.map +1 -1
- package/dist/components/theme/backgroundImage.es.js.map +1 -1
- package/dist/components/theme/colors.d.ts +2 -0
- package/dist/components/theme/colors.es.js +2 -0
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/components/theme/dropShadow.es.js.map +1 -1
- package/dist/components/theme/keyframes.es.js.map +1 -1
- package/dist/components/theme/lightColorPlugin.es.js.map +1 -1
- package/dist/components/theme/theme.d.ts +21 -3
- package/dist/components/theme/theme.es.js +33 -9
- package/dist/components/theme/theme.es.js.map +1 -1
- package/dist/components/theme/useTheme.d.ts +3 -3
- package/dist/components/theme/useTheme.es.js +49 -15
- package/dist/components/theme/useTheme.es.js.map +1 -1
- package/dist/components/theme/utils.es.js +69 -111
- package/dist/components/theme/utils.es.js.map +1 -1
- package/dist/index.es.js +0 -6
- package/dist/index.es.js.map +1 -1
- package/dist/theme.d.ts +24 -3
- package/dist/useTheme.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classNames-
|
|
1
|
+
{"version":3,"file":"classNames-CC5emYUV.js","sources":["../src/utils/classNames.ts"],"sourcesContent":["import cn, { Argument } from 'classnames'\nimport { twMerge } from 'tailwind-merge'\n\nexport default function classNames(...args: Argument[]) {\n return twMerge(cn(args))\n}\n"],"names":[],"mappings":";;AAGA,SAAwB,cAAc,MAAkB;AACtD,SAAO,QAAQ,GAAG,IAAI,CAAC;AACzB;"}
|
package/dist/colors.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export declare const darkPalette: {
|
|
|
58
58
|
100: string;
|
|
59
59
|
150: string;
|
|
60
60
|
200: string;
|
|
61
|
+
'200original': string;
|
|
61
62
|
350: string;
|
|
62
63
|
375: string;
|
|
63
64
|
500: string;
|
|
@@ -154,6 +155,7 @@ export declare const lightPalette: {
|
|
|
154
155
|
100: string;
|
|
155
156
|
150: string;
|
|
156
157
|
200: string;
|
|
158
|
+
'200original': string;
|
|
157
159
|
350: string;
|
|
158
160
|
375: string;
|
|
159
161
|
500: string;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import { c as classNames } from "../../classNames-
|
|
3
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
4
4
|
import IconProvider from "./IconProvider.es.js";
|
|
5
5
|
import { LightTooltip, DarkTooltip } from "./Tooltip.es.js";
|
|
6
|
-
import "classnames";
|
|
7
|
-
import "tailwind-merge";
|
|
8
|
-
import "@fortawesome/react-fontawesome";
|
|
9
|
-
import "../theme/useTheme.es.js";
|
|
10
|
-
import "../theme/theme.es.js";
|
|
11
|
-
import "../theme/colors.es.js";
|
|
12
|
-
import "@mui/material/styles/styled";
|
|
13
|
-
import "@mui/material/Tooltip";
|
|
14
6
|
const iconSizeMap = {
|
|
15
7
|
small: 0.75,
|
|
16
8
|
large: 0.875
|
|
@@ -1 +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;AAA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pD;AAED,MAAM,kBAAkBA,eAAM,WAA2C,CAAC,OAAO,QAC9E,oBAAA,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,YAAY,CAAA,CACtD;AAED,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;"}
|
|
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;AACpB,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AA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA,aAAW;AAAA,QAEV,UAAA;AAAA,UAAA,CAAC,eAAe;AAAA,UAChB;AAAA,UACA,eAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEpB;AAAA,EAEJ;AACF;AAEA,MAAM,cAAcA,eAAM,WAA2C,CAAC,OAAO,QAC3E,oBAAC,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,SAAQ,CAClD;AAED,MAAM,gBAAgBA,eAAM,WAA2C,CAAC,OAAO,QAC7E,oBAAC,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,WAAU,CACpD;AAED,MAAM,kBAAkBA,eAAM,WAA2C,CAAC,OAAO,QAC/E,oBAAC,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,aAAY,CACtD;AAED,MAAM,iBAAiBA,eAAM,WAA2C,CAAC,OAAO,QAC9E,oBAAC,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,YAAW,CACrD;AAED,MAAM,oBAAoBA,eAAM,WAA2C,CAAC,OAAO,QACjF,oBAAC,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,eAAc,CACxD;AAED,MAAM,SAAS;AAEf,OAAO,cAAc;AAErB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,cAAc;"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c as classNames } from "../../classNames-
|
|
2
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
3
3
|
import IconProvider from "./IconProvider.es.js";
|
|
4
4
|
import { DarkTooltip } from "./Tooltip.es.js";
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "tailwind-merge";
|
|
7
|
-
import "react";
|
|
8
|
-
import "@fortawesome/react-fontawesome";
|
|
9
|
-
import "../theme/useTheme.es.js";
|
|
10
|
-
import "../theme/theme.es.js";
|
|
11
|
-
import "../theme/colors.es.js";
|
|
12
|
-
import "@mui/material/styles/styled";
|
|
13
|
-
import "@mui/material/Tooltip";
|
|
14
5
|
const IconButton = ({ icon, iconSize, onClick, disabled, tooltip }) => {
|
|
15
6
|
const classes = classNames("text-gray-450 hover:text-gray-750 cursor-pointer w-3", {
|
|
16
7
|
"text-gray-450 hover:text-gray-450 pointer-event-none opacity-40": disabled
|
|
@@ -1 +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":"
|
|
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":";;;;AAgBA,MAAM,aAAwC,CAAC,EAAE,MAAM,UAAU,SAAS,UAAU,cAAc;AAChG,QAAM,UAAU,WAAW,wDAAwD;AAAA,IACjF,mEAAmE;AAAA,EAAA,CACpE;AAED,6BACG,aAAA,EAAY,OAAO,SAClB,UAAA,oBAAC,UAAK,WAAU,gBACd,UAAA,oBAAC,cAAA,EAAa,MAAY,MAAM,UAAU,SAAkB,WAAW,QAAA,CAAS,GAClF,GACF;AAEJ;"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { forwardRef, Suspense } from "react";
|
|
3
3
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { c as classNames } from "../../classNames-
|
|
4
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
5
5
|
import { useTheme } from "../theme/useTheme.es.js";
|
|
6
|
-
import "classnames";
|
|
7
|
-
import "tailwind-merge";
|
|
8
|
-
import "../theme/theme.es.js";
|
|
9
|
-
import "../theme/colors.es.js";
|
|
10
6
|
const IMG_ICONS_MAP = {};
|
|
11
7
|
const registerImgIcons = (iconMap) => {
|
|
12
8
|
Object.assign(IMG_ICONS_MAP, iconMap);
|
|
@@ -1 +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\nimport useTheme from '../theme/useTheme'\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\nfunction addDarkSuffix(url: string): string {\n const urlObj = new URL(url)\n const parts = urlObj.pathname.split('/')\n const filename = parts.pop()\n\n if (!filename) {\n return url + '-dark'\n }\n\n const dotIndex = filename.lastIndexOf('.')\n let newFilename: string\n\n if (dotIndex !== -1) {\n newFilename = filename.slice(0, dotIndex) + '-dark' + filename.slice(dotIndex)\n } else {\n newFilename = filename + '-dark'\n }\n\n parts.push(newFilename)\n urlObj.pathname = parts.join('/')\n return urlObj.toString()\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 { isDark } = useTheme()\n let themeAwareImgIcon: string | null = null\n let fallbackImgIcon: string | null = null\n\n if (typeof icon === 'string' && icon.startsWith('http')) {\n themeAwareImgIcon = isDark ? addDarkSuffix(icon) : icon\n fallbackImgIcon = icon\n } else if (typeof icon === 'string' && IMG_ICONS_MAP[icon as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon}-dark`] ?? IMG_ICONS_MAP[icon as string]\n : IMG_ICONS_MAP[icon as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon as string]\n } else if (Array.isArray(icon) && icon[1] && IMG_ICONS_MAP[icon[1] as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon[1]}-dark`] ?? IMG_ICONS_MAP[icon[1] as string]\n : IMG_ICONS_MAP[icon[1] as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon[1] as string]\n }\n\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 themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={themeAwareImgIcon}\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n onError={(e) => {\n e.currentTarget.src = fallbackImgIcon as string\n }}\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":"
|
|
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\nimport useTheme from '../theme/useTheme'\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\nfunction addDarkSuffix(url: string): string {\n const urlObj = new URL(url)\n const parts = urlObj.pathname.split('/')\n const filename = parts.pop()\n\n if (!filename) {\n return url + '-dark'\n }\n\n const dotIndex = filename.lastIndexOf('.')\n let newFilename: string\n\n if (dotIndex !== -1) {\n newFilename = filename.slice(0, dotIndex) + '-dark' + filename.slice(dotIndex)\n } else {\n newFilename = filename + '-dark'\n }\n\n parts.push(newFilename)\n urlObj.pathname = parts.join('/')\n return urlObj.toString()\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 { isDark } = useTheme()\n let themeAwareImgIcon: string | null = null\n let fallbackImgIcon: string | null = null\n\n if (typeof icon === 'string' && icon.startsWith('http')) {\n themeAwareImgIcon = isDark ? addDarkSuffix(icon) : icon\n fallbackImgIcon = icon\n } else if (typeof icon === 'string' && IMG_ICONS_MAP[icon as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon}-dark`] ?? IMG_ICONS_MAP[icon as string]\n : IMG_ICONS_MAP[icon as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon as string]\n } else if (Array.isArray(icon) && icon[1] && IMG_ICONS_MAP[icon[1] as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon[1]}-dark`] ?? IMG_ICONS_MAP[icon[1] as string]\n : IMG_ICONS_MAP[icon[1] as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon[1] as string]\n }\n\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 themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={themeAwareImgIcon}\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n onError={(e) => {\n e.currentTarget.src = fallbackImgIcon as string\n }}\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":";;;;;AASA,MAAM,gBAA4B,CAAA;AAC3B,MAAM,mBAAmB,CAAC,YAAwB;AACvD,SAAO,OAAO,eAAe,OAAO;AACtC;AAMA,MAAM,mBAAkC,CAAA;AACjC,MAAM,gBAAgB,CAAC,YAA2B;AACvD,SAAO,OAAO,kBAAkB,OAAO;AACzC;AAEA,MAAM,oBAAwD;AAAA,EAC5D,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,SAAS;AACX;AAsBA,MAAM,cAAc,CAAC,EAAE,MAAM,GAAG,YAA8B;AAC5D,QAAM,eAAe,iBAAiB,IAAI;AAC1C,SACE,oBAAC,UAAA,EAAS,UAAU,oBAAC,QAAA,CAAA,CAAK,GACxB,UAAA,oBAAC,cAAA,EAAc,GAAG,MAAA,CAAO,EAAA,CAC3B;AAEJ;AAEA,SAAS,cAAc,KAAqB;AAC1C,QAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,QAAM,QAAQ,OAAO,SAAS,MAAM,GAAG;AACvC,QAAM,WAAW,MAAM,IAAA;AAEvB,MAAI,CAAC,UAAU;AACb,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,WAAW,SAAS,YAAY,GAAG;AACzC,MAAI;AAEJ,MAAI,aAAa,IAAI;AACnB,kBAAc,SAAS,MAAM,GAAG,QAAQ,IAAI,UAAU,SAAS,MAAM,QAAQ;AAAA,EAC/E,OAAO;AACL,kBAAc,WAAW;AAAA,EAC3B;AAEA,QAAM,KAAK,WAAW;AACtB,SAAO,WAAW,MAAM,KAAK,GAAG;AAChC,SAAO,OAAO,SAAA;AAChB;A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G,WAAsB,IAE1G;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI,MAAA;AAAA,MAC1C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAA,iBAAeA,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,KAAK,CAAE;AACnG;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c as classNames } from "../../classNames-
|
|
3
|
-
import "classnames";
|
|
4
|
-
import "tailwind-merge";
|
|
2
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
5
3
|
const Spinner = ({ className, small, big, medium, center, type = "normal" }) => {
|
|
6
4
|
const isDefault = () => type === "normal";
|
|
7
5
|
const classes = classNames({
|
|
@@ -1 +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":"
|
|
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":";;AAYA,MAAM,UAAkC,CAAC,EAAE,WAAW,OAAO,KAAK,QAAQ,QAAQ,OAAO,eAAe;AACtG,QAAM,YAAY,MAAM,SAAS;AAEjC,QAAM,UAAU,WAAW;AAAA,IACzB,yDAAyD;AAAA,IACzD,wBAAwB,UAAA;AAAA,IACxB,+BAA+B,UAAA,KAAe,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,MAAA;AAAA,IACN;AACE,aACE,oBAAC,OAAA,EAAI,WAAW,SAAS,MAAK,UAC5B,UAAA,oBAAC,QAAA,EAAK,WAAU,aAAY,UAAA,aAAA,CAAU,GACxC;AAAA,EAAA;AAGR;"}
|
|
@@ -2,9 +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 { c as classNames } from "../../classNames-
|
|
6
|
-
import "classnames";
|
|
7
|
-
import "tailwind-merge";
|
|
5
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
8
6
|
const getSize = (size) => {
|
|
9
7
|
let height = 380;
|
|
10
8
|
let width = 250;
|
|
@@ -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 = 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":"
|
|
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,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,K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EACnC,OAAO,CAAC,EAAE,WAAW,GAAG,YACtB,oBAAC,SAAA,EAAQ,sBAAoB,MAAE,GAAG,OAAO,SAAS,EAAE,QAAQ,WAAW,SAAS,mBAAA,EAAmB,CAAG,CACvG,EAAE,CAAC,EAAE,WAAW;AACf,UAAM,EAAE,OAAO,WAAW,QAAQ,IAAI;AACtC,WAAO;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,MAAA;AAAA,IACV;AAAA,EAEJ,CAAC;AACH;"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { useState, useRef, useMemo, useEffect } from "react";
|
|
3
3
|
import Drawer from "@mui/material/Drawer";
|
|
4
|
-
import { c as classNames } from "../../classNames-
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "tailwind-merge";
|
|
4
|
+
import { c as classNames } from "../../classNames-CC5emYUV.js";
|
|
7
5
|
const CustomDrawerContext = React__default.createContext({});
|
|
8
6
|
const CustomDrawer = ({
|
|
9
7
|
anchor = "right",
|
|
@@ -50,8 +48,7 @@ const CustomDrawer = ({
|
|
|
50
48
|
onKeyDown: (e) => {
|
|
51
49
|
const { isPreventEscape, onEscape } = contextRef.current || {};
|
|
52
50
|
if (e.key === "Escape") {
|
|
53
|
-
if (!isPreventEscape)
|
|
54
|
-
;
|
|
51
|
+
if (!isPreventEscape) ;
|
|
55
52
|
else {
|
|
56
53
|
onEscape == null ? void 0 : onEscape();
|
|
57
54
|
}
|
|
@@ -1 +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":"
|
|
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,CAAA,CAAE;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;AAE/E,QAAM,aAAa,OAAoB,EAAE;AACzC,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL,qBAAqB,CAAC,OAAqB,eAAyB;AAClE,mBAAW,UAAU,aAAa,KAAK,EAAE,GAAI,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A,YAGD,kBACC,oBAAC,OAAA,EAAI,WAAW,WAAW,UAAU,iBAAiB,kBAAkB,GACtE,UAAA,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,cAAe,UAAS,EAAA,CAC/D;AAAA,UAAA;AAAA,QAAA,EAEJ,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,wBACC,qBAAA,UAAA,EAAE,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,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1 +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":"
|
|
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":"AAAO,MAAM,kBAAkB,CAAC,WAAiD;AAAA,EAC/E,KAAK,MAAM,gBAAgB;AAC7B;"}
|
|
@@ -1 +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":"
|
|
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":"AAAO,MAAM,kBAAkB,CAAC,WAAiD;AAAA,EAC/E,qBAAqB,6BAA6B,MAAM,mBAAmB,CAAC,KAAK,MAAM,iBAAiB,CAAC,KAAK;AAAA,IAC5G;AAAA,EAAA,CACD;AAAA,EACD,yBAAyB,2BAA2B,MAAM,oBAAoB,CAAC,YAAY;AAAA,IACzF;AAAA,EAAA,CACD;AAAA,EACD,iBAAiB,2BAA2B,MAAM,oBAAoB,CAAC,YAAY,MAAM,gBAAgB,CAAC;AAAA,EAC1G,wBAAwB,yBAAyB,MAAM,oBAAoB,CAAC,YAAY;AAAA,IACtF;AAAA,EAAA,CACD;AAAA,EACD,2BAA2B,2BAA2B,MAAM,cAAc,CAAC,YAAY;AAAA,IACrF;AAAA,EAAA,CACD;AAAA,EACD,gCAAgC,0BAA0B;AAAA,IACxD;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -58,6 +58,7 @@ export declare const lightPalette: {
|
|
|
58
58
|
100: string;
|
|
59
59
|
150: string;
|
|
60
60
|
200: string;
|
|
61
|
+
'200original': string;
|
|
61
62
|
350: string;
|
|
62
63
|
375: string;
|
|
63
64
|
500: string;
|
|
@@ -153,6 +154,7 @@ export declare const darkPalette: {
|
|
|
153
154
|
100: string;
|
|
154
155
|
150: string;
|
|
155
156
|
200: string;
|
|
157
|
+
'200original': string;
|
|
156
158
|
350: string;
|
|
157
159
|
375: string;
|
|
158
160
|
500: string;
|
|
@@ -58,6 +58,7 @@ const lightPalette = {
|
|
|
58
58
|
100: "#e0e7ff",
|
|
59
59
|
150: "#CEE0F8",
|
|
60
60
|
200: "#818cf8",
|
|
61
|
+
"200original": "#BFDBFE",
|
|
61
62
|
350: "#A8C3E8",
|
|
62
63
|
375: "#82A0CE",
|
|
63
64
|
500: "#BBD2F1",
|
|
@@ -154,6 +155,7 @@ const darkPalette = {
|
|
|
154
155
|
100: "#1e2a3a",
|
|
155
156
|
150: "#263445",
|
|
156
157
|
200: "#3b82f6",
|
|
158
|
+
"200original": "#BFDBFE",
|
|
157
159
|
350: "#60a5fa",
|
|
158
160
|
375: "#7dd3fc",
|
|
159
161
|
500: "#60a5fa",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.es.js","sources":["../../../src/components/theme/colors.ts"],"sourcesContent":["export const lightPalette = {\n gray: {\n 16: '#162236',\n 25: '#F5FAFF',\n 50: '#fafcff',\n 75: '#F9FAFB',\n 100: '#F0F7FF',\n 125: '#ECF5FF',\n 150: '#E8F2FE',\n 200: '#E0ECFD',\n 250: '#CEE0F8',\n 275: '#F0F7FF',\n 300: '#A8C3E8',\n 350: '#95B2DD',\n 375: '#AAAAAA',\n '400original': '#9ca3af',\n 400: '#82A0CE',\n 450: '#6F8EBD',\n 500: '#5E7BAA',\n 550: '#4D6896',\n 600: '#3E5680',\n 650: '#31456A',\n 700: '#263755',\n 750: '#1C2A42',\n 800: '#0E1623',\n 850: '#090F17',\n 900: '#05090E',\n 950: '#030407',\n 1000: '#010202',\n disabled: '#f2f2f2',\n whitesmoke: '#fafafa',\n },\n indigo: {\n 500: '#6366F1',\n 525: '#3A47F9',\n 550: '#5429FF',\n 700: '#4338CA',\n 725: '#2300F7',\n 750: '#5501E1',\n 850: '#2900CE',\n },\n yellow: {\n '50light': '#FFFBEB',\n 100: '#FEF3C7',\n '200dark': '#FDE68A',\n 500: '#F59E0B',\n },\n skyblue: '#F5FAFF',\n blue: {\n 25: '#F5F9FF',\n 45: '#F0F7FF',\n primary: '#481DF1',\n secondary: '#93C5FD',\n 'secondary-light': '#0EA5E9',\n purple: '#5501E1',\n 'purple-2': '#0047ff',\n 'purple-3': '#2900CE',\n 100: '#e0e7ff',\n 150: '#CEE0F8',\n 200: '#818cf8',\n 350: '#A8C3E8',\n 375: '#82A0CE',\n 500: '#BBD2F1',\n 550: '#2F85F4',\n '500original': '#3b82f6',\n 600: '#2563EB',\n 650: '#4D6896',\n 725: '#3E5680',\n },\n green: {\n 600: '#059669',\n },\n fuchsia: {\n 100: '#FAE8FF',\n 500: '#F0449D',\n },\n violet: {\n 500: '#4F46E5',\n },\n red: {\n 500: '#EF4444',\n 650: '#E10101',\n 50: '#FEF2F2',\n },\n orange: {\n 100: '#FFEDD5',\n 650: '#FA2A00',\n },\n amber: {\n 450: '#FF9D00',\n },\n white: '#ffffff',\n black: '#09090B',\n background: '#fafcff',\n}\n\nexport const darkPalette = {\n gray: {\n 16: '#E4E4E7',\n 25: '#1e1e1e',\n 50: '#000000',\n 75: '#2a2a2a',\n 100: '#101013',\n 125: '#141417',\n 150: '#18181B',\n 200: '#1F1F22',\n 250: '#27272A',\n 275: '#343439',\n 300: '#3F3F46',\n 350: '#494950',\n 375: '#757575',\n 400: '#52525B',\n '400original': '#52525B',\n 450: '#616167',\n 500: '#71717A',\n 550: '#8C8C92',\n 600: '#A1A1AA',\n 650: '#B8B8BE',\n 700: '#D4D4D8',\n 750: '#DFDFE2',\n 800: '#ECECEE',\n 850: '#F4F4F5',\n 900: '#F7F7F8',\n 950: '#FAFAFA',\n 1000: '#FDFDFD', // Light text on dark backgrounds\n disabled: '#222225',\n whitesmoke: '#1a1a1a',\n },\n indigo: {\n 500: '#6366F1',\n 525: '#3A47F9',\n 550: '#5429FF',\n 700: '#4338CA',\n 725: '#2300F7',\n 750: '#5501E1',\n 850: '#2900CE',\n },\n yellow: {\n '50light': '#FFFBEB',\n 100: '#FEF3C7',\n '200dark': '#FDE68A',\n 500: '#F59E0B',\n },\n skyblue: '#1e2538',\n blue: {\n 25: '#1a1f2e',\n 45: '#1e2437',\n primary: '#6366f1',\n secondary: '#60a5fa',\n 'secondary-light': '#38bdf8',\n purple: '#8b5cf6',\n 'purple-2': '#3b82f6',\n 'purple-3': '#6366f1',\n 100: '#1e2a3a',\n 150: '#263445',\n 200: '#3b82f6',\n 350: '#60a5fa',\n 375: '#7dd3fc',\n 500: '#60a5fa',\n 550: '#3b82f6',\n '500original': '#3b82f6',\n 600: '#2563eb',\n 650: '#1d4ed8',\n 725: '#1e40af',\n },\n green: {\n 600: '#059669',\n },\n fuchsia: {\n 100: '#FAE8FF',\n 500: '#F0449D',\n },\n violet: {\n 500: '#4F46E5',\n },\n red: {\n 500: '#EF4444',\n 650: '#E10101',\n 50: '#FEF2F2',\n },\n orange: {\n 100: '#FFEDD5',\n 650: '#FA2A00',\n },\n amber: {\n 450: '#FF9D00',\n },\n white: '#1F1F22',\n black: '#ffffff',\n background: '#18181B',\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,
|
|
1
|
+
{"version":3,"file":"colors.es.js","sources":["../../../src/components/theme/colors.ts"],"sourcesContent":["export const lightPalette = {\n gray: {\n 16: '#162236',\n 25: '#F5FAFF',\n 50: '#fafcff',\n 75: '#F9FAFB',\n 100: '#F0F7FF',\n 125: '#ECF5FF',\n 150: '#E8F2FE',\n 200: '#E0ECFD',\n 250: '#CEE0F8',\n 275: '#F0F7FF',\n 300: '#A8C3E8',\n 350: '#95B2DD',\n 375: '#AAAAAA',\n '400original': '#9ca3af',\n 400: '#82A0CE',\n 450: '#6F8EBD',\n 500: '#5E7BAA',\n 550: '#4D6896',\n 600: '#3E5680',\n 650: '#31456A',\n 700: '#263755',\n 750: '#1C2A42',\n 800: '#0E1623',\n 850: '#090F17',\n 900: '#05090E',\n 950: '#030407',\n 1000: '#010202',\n disabled: '#f2f2f2',\n whitesmoke: '#fafafa',\n },\n indigo: {\n 500: '#6366F1',\n 525: '#3A47F9',\n 550: '#5429FF',\n 700: '#4338CA',\n 725: '#2300F7',\n 750: '#5501E1',\n 850: '#2900CE',\n },\n yellow: {\n '50light': '#FFFBEB',\n 100: '#FEF3C7',\n '200dark': '#FDE68A',\n 500: '#F59E0B',\n },\n skyblue: '#F5FAFF',\n blue: {\n 25: '#F5F9FF',\n 45: '#F0F7FF',\n primary: '#481DF1',\n secondary: '#93C5FD',\n 'secondary-light': '#0EA5E9',\n purple: '#5501E1',\n 'purple-2': '#0047ff',\n 'purple-3': '#2900CE',\n 100: '#e0e7ff',\n 150: '#CEE0F8',\n 200: '#818cf8',\n '200original': '#BFDBFE',\n 350: '#A8C3E8',\n 375: '#82A0CE',\n 500: '#BBD2F1',\n 550: '#2F85F4',\n '500original': '#3b82f6',\n 600: '#2563EB',\n 650: '#4D6896',\n 725: '#3E5680',\n },\n green: {\n 600: '#059669',\n },\n fuchsia: {\n 100: '#FAE8FF',\n 500: '#F0449D',\n },\n violet: {\n 500: '#4F46E5',\n },\n red: {\n 500: '#EF4444',\n 650: '#E10101',\n 50: '#FEF2F2',\n },\n orange: {\n 100: '#FFEDD5',\n 650: '#FA2A00',\n },\n amber: {\n 450: '#FF9D00',\n },\n white: '#ffffff',\n black: '#09090B',\n background: '#fafcff',\n}\n\nexport const darkPalette = {\n gray: {\n 16: '#E4E4E7',\n 25: '#1e1e1e',\n 50: '#000000',\n 75: '#2a2a2a',\n 100: '#101013',\n 125: '#141417',\n 150: '#18181B',\n 200: '#1F1F22',\n 250: '#27272A',\n 275: '#343439',\n 300: '#3F3F46',\n 350: '#494950',\n 375: '#757575',\n 400: '#52525B',\n '400original': '#52525B',\n 450: '#616167',\n 500: '#71717A',\n 550: '#8C8C92',\n 600: '#A1A1AA',\n 650: '#B8B8BE',\n 700: '#D4D4D8',\n 750: '#DFDFE2',\n 800: '#ECECEE',\n 850: '#F4F4F5',\n 900: '#F7F7F8',\n 950: '#FAFAFA',\n 1000: '#FDFDFD', // Light text on dark backgrounds\n disabled: '#222225',\n whitesmoke: '#1a1a1a',\n },\n indigo: {\n 500: '#6366F1',\n 525: '#3A47F9',\n 550: '#5429FF',\n 700: '#4338CA',\n 725: '#2300F7',\n 750: '#5501E1',\n 850: '#2900CE',\n },\n yellow: {\n '50light': '#FFFBEB',\n 100: '#FEF3C7',\n '200dark': '#FDE68A',\n 500: '#F59E0B',\n },\n skyblue: '#1e2538',\n blue: {\n 25: '#1a1f2e',\n 45: '#1e2437',\n primary: '#6366f1',\n secondary: '#60a5fa',\n 'secondary-light': '#38bdf8',\n purple: '#8b5cf6',\n 'purple-2': '#3b82f6',\n 'purple-3': '#6366f1',\n 100: '#1e2a3a',\n 150: '#263445',\n 200: '#3b82f6',\n '200original': '#BFDBFE',\n 350: '#60a5fa',\n 375: '#7dd3fc',\n 500: '#60a5fa',\n 550: '#3b82f6',\n '500original': '#3b82f6',\n 600: '#2563eb',\n 650: '#1d4ed8',\n 725: '#1e40af',\n },\n green: {\n 600: '#059669',\n },\n fuchsia: {\n 100: '#FAE8FF',\n 500: '#F0449D',\n },\n violet: {\n 500: '#4F46E5',\n },\n red: {\n 500: '#EF4444',\n 650: '#E10101',\n 50: '#FEF2F2',\n },\n orange: {\n 100: '#FFEDD5',\n 650: '#FA2A00',\n },\n amber: {\n 450: '#FF9D00',\n },\n white: '#1F1F22',\n black: '#ffffff',\n background: '#18181B',\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,K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N,KAAK;AAAA,EAAA;AAAA,EAEP,KAAK;AAAA,IACH,KAAK;AAAA,IACL,KAAK;AAAA,IACL,IAAI;AAAA,EAAA;AAAA,EAEN,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,OAAO;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AACd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropShadow.es.js","sources":["../../../src/components/theme/dropShadow.ts"],"sourcesContent":["export const dropShadow = (theme: (path: string) => string | undefined) => ({\n xl: [`px 2px 6px ${theme('colors.blue.dark / 6%')}`, `0px 8px 20px ${theme('colors.blue.dark / 10%')}`],\n})\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropShadow.es.js","sources":["../../../src/components/theme/dropShadow.ts"],"sourcesContent":["export const dropShadow = (theme: (path: string) => string | undefined) => ({\n xl: [`px 2px 6px ${theme('colors.blue.dark / 6%')}`, `0px 8px 20px ${theme('colors.blue.dark / 10%')}`],\n})\n"],"names":[],"mappings":"AAAO,MAAM,aAAa,CAAC,WAAiD;AAAA,EAC1E,IAAI,CAAC,cAAc,MAAM,uBAAuB,CAAC,IAAI,gBAAgB,MAAM,wBAAwB,CAAC,EAAE;AACxG;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyframes.es.js","sources":["../../../src/components/theme/keyframes.ts"],"sourcesContent":["export const keyframes = {\n fadeOut: {\n from: { opacity: '1' },\n to: { opacity: '0' },\n },\n fadeIn: {\n from: { opacity: '0' },\n to: { opacity: '1' },\n },\n}\n"],"names":[],"mappings":"AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"keyframes.es.js","sources":["../../../src/components/theme/keyframes.ts"],"sourcesContent":["export const keyframes = {\n fadeOut: {\n from: { opacity: '1' },\n to: { opacity: '0' },\n },\n fadeIn: {\n from: { opacity: '0' },\n to: { opacity: '1' },\n },\n}\n"],"names":[],"mappings":"AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,MAAM,EAAE,SAAS,IAAA;AAAA,IACjB,IAAI,EAAE,SAAS,IAAA;AAAA,EAAI;AAAA,EAErB,QAAQ;AAAA,IACN,MAAM,EAAE,SAAS,IAAA;AAAA,IACjB,IAAI,EAAE,SAAS,IAAA;AAAA,EAAI;AAEvB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightColorPlugin.es.js","sources":["../../../src/components/theme/lightColorPlugin.ts"],"sourcesContent":["import { lightPalette } from './colors'\n\ntype ColorValue = string | Record<string, any>\ntype FlattenedColors = Record<string, string>\ntype UtilityObject = Record<string, Record<string, string>>\ntype DirectionProperties = string | string[]\n\nfunction flattenColors(colors: ColorValue, prefix = ''): FlattenedColors {\n const result: FlattenedColors = {}\n\n for (const [key, value] of Object.entries(colors)) {\n const newKey = prefix ? `${prefix}-${key}` : key\n\n if (typeof value === 'string') {\n result[newKey] = value\n } else if (typeof value === 'object' && value !== null) {\n Object.assign(result, flattenColors(value, newKey))\n }\n }\n\n return result\n}\n\nfunction generateColorUtilities(property: string, prefix: string, colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.${prefix}-light-${colorKey}`] = {\n [property]: colorValue,\n }\n }\n\n return utilities\n}\n\nfunction generateBorderUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n Object.assign(utilities, generateColorUtilities('border-color', 'border', colors))\n\n const directions: Record<string, DirectionProperties> = {\n t: 'border-top-color',\n r: 'border-right-color',\n b: 'border-bottom-color',\n l: 'border-left-color',\n x: ['border-left-color', 'border-right-color'],\n y: ['border-top-color', 'border-bottom-color'],\n }\n\n for (const [dirKey, properties] of Object.entries(directions)) {\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n const className = `.border-${dirKey}-light-${colorKey}`\n\n if (Array.isArray(properties)) {\n utilities[className] = {}\n properties.forEach((prop) => {\n utilities[className][prop] = colorValue\n })\n } else {\n utilities[className] = {\n [properties]: colorValue,\n }\n }\n }\n }\n\n return utilities\n}\n\nfunction generateDivideUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.divide-light-${colorKey} > :not([hidden]) ~ :not([hidden])`] = {\n 'border-color': colorValue,\n }\n }\n\n return utilities\n}\n\nfunction generateRingUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.ring-light-${colorKey}`] = {\n '--tw-ring-color': colorValue,\n }\n\n utilities[`.ring-offset-light-${colorKey}`] = {\n '--tw-ring-offset-color': colorValue,\n }\n }\n\n return utilities\n}\nexport const createLightColorPlugin = (plugin: any) => {\n return plugin(function ({ addUtilities }: any) {\n const flatColors = flattenColors(lightPalette)\n\n const utilities = {\n ...generateColorUtilities('background-color', 'bg', flatColors),\n ...generateColorUtilities('color', 'text', flatColors),\n ...generateBorderUtilities(flatColors),\n ...generateDivideUtilities(flatColors),\n ...generateRingUtilities(flatColors),\n ...generateColorUtilities('fill', 'fill', flatColors),\n ...generateColorUtilities('stroke', 'stroke', flatColors),\n ...generateColorUtilities('accent-color', 'accent', flatColors),\n ...generateColorUtilities('caret-color', 'caret', flatColors),\n }\n\n addUtilities(utilities)\n })\n}\n"],"names":[],"mappings":";AAOA,SAAS,cAAc,QAAoB,SAAS,IAAqB;AACvE,QAAM,SAA0B,CAAA;AAEhC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,UAAM,SAAS,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"lightColorPlugin.es.js","sources":["../../../src/components/theme/lightColorPlugin.ts"],"sourcesContent":["import { lightPalette } from './colors'\n\ntype ColorValue = string | Record<string, any>\ntype FlattenedColors = Record<string, string>\ntype UtilityObject = Record<string, Record<string, string>>\ntype DirectionProperties = string | string[]\n\nfunction flattenColors(colors: ColorValue, prefix = ''): FlattenedColors {\n const result: FlattenedColors = {}\n\n for (const [key, value] of Object.entries(colors)) {\n const newKey = prefix ? `${prefix}-${key}` : key\n\n if (typeof value === 'string') {\n result[newKey] = value\n } else if (typeof value === 'object' && value !== null) {\n Object.assign(result, flattenColors(value, newKey))\n }\n }\n\n return result\n}\n\nfunction generateColorUtilities(property: string, prefix: string, colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.${prefix}-light-${colorKey}`] = {\n [property]: colorValue,\n }\n }\n\n return utilities\n}\n\nfunction generateBorderUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n Object.assign(utilities, generateColorUtilities('border-color', 'border', colors))\n\n const directions: Record<string, DirectionProperties> = {\n t: 'border-top-color',\n r: 'border-right-color',\n b: 'border-bottom-color',\n l: 'border-left-color',\n x: ['border-left-color', 'border-right-color'],\n y: ['border-top-color', 'border-bottom-color'],\n }\n\n for (const [dirKey, properties] of Object.entries(directions)) {\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n const className = `.border-${dirKey}-light-${colorKey}`\n\n if (Array.isArray(properties)) {\n utilities[className] = {}\n properties.forEach((prop) => {\n utilities[className][prop] = colorValue\n })\n } else {\n utilities[className] = {\n [properties]: colorValue,\n }\n }\n }\n }\n\n return utilities\n}\n\nfunction generateDivideUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.divide-light-${colorKey} > :not([hidden]) ~ :not([hidden])`] = {\n 'border-color': colorValue,\n }\n }\n\n return utilities\n}\n\nfunction generateRingUtilities(colors: FlattenedColors): UtilityObject {\n const utilities: UtilityObject = {}\n\n for (const [colorKey, colorValue] of Object.entries(colors)) {\n utilities[`.ring-light-${colorKey}`] = {\n '--tw-ring-color': colorValue,\n }\n\n utilities[`.ring-offset-light-${colorKey}`] = {\n '--tw-ring-offset-color': colorValue,\n }\n }\n\n return utilities\n}\nexport const createLightColorPlugin = (plugin: any) => {\n return plugin(function ({ addUtilities }: any) {\n const flatColors = flattenColors(lightPalette)\n\n const utilities = {\n ...generateColorUtilities('background-color', 'bg', flatColors),\n ...generateColorUtilities('color', 'text', flatColors),\n ...generateBorderUtilities(flatColors),\n ...generateDivideUtilities(flatColors),\n ...generateRingUtilities(flatColors),\n ...generateColorUtilities('fill', 'fill', flatColors),\n ...generateColorUtilities('stroke', 'stroke', flatColors),\n ...generateColorUtilities('accent-color', 'accent', flatColors),\n ...generateColorUtilities('caret-color', 'caret', flatColors),\n }\n\n addUtilities(utilities)\n })\n}\n"],"names":[],"mappings":";AAOA,SAAS,cAAc,QAAoB,SAAS,IAAqB;AACvE,QAAM,SAA0B,CAAA;AAEhC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,UAAM,SAAS,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAE7C,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO,MAAM,IAAI;AAAA,IACnB,WAAW,OAAO,UAAU,YAAY,UAAU,MAAM;AACtD,aAAO,OAAO,QAAQ,cAAc,OAAO,MAAM,CAAC;AAAA,IACpD;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,uBAAuB,UAAkB,QAAgB,QAAwC;AACxG,QAAM,YAA2B,CAAA;AAEjC,aAAW,CAAC,UAAU,UAAU,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC3D,cAAU,IAAI,MAAM,UAAU,QAAQ,EAAE,IAAI;AAAA,MAC1C,CAAC,QAAQ,GAAG;AAAA,IAAA;AAAA,EAEhB;AAEA,SAAO;AACT;AAEA,SAAS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AAAA,EAE9B;AAEA,SAAO;AACT;AACO,MAAM,yBAAyB,CAAC,WAAgB;AACrD,SAAO,OAAO,SAAU,EAAE,gBAAqB;AAC7C,UAAM,aAAa,cAAc,YAAY;AAE7C,UAAM,YAAY;AAAA,MAChB,GAAG,uBAAuB,oBAAoB,MAAM,UAAU;AAAA,MAC9D,GAAG,uBAAuB,SAAS,QAAQ,UAAU;AAAA,MACrD,GAAG,wBAAwB,UAAU;AAAA,MACrC,GAAG,wBAAwB,UAAU;AAAA,MACrC,GAAG,sBAAsB,UAAU;AAAA,MACnC,GAAG,uBAAuB,QAAQ,QAAQ,UAAU;AAAA,MACpD,GAAG,uBAAuB,UAAU,UAAU,UAAU;AAAA,MACxD,GAAG,uBAAuB,gBAAgB,UAAU,UAAU;AAAA,MAC9D,GAAG,uBAAuB,eAAe,SAAS,UAAU;AAAA,IAAA;AAG9D,iBAAa,SAAS;AAAA,EACxB,CAAC;AACH;"}
|
|
@@ -4,8 +4,25 @@ export declare const injectThemes: (lightTheme: any, darkTheme: any) => void;
|
|
|
4
4
|
export declare const getTailwindColors: () => any;
|
|
5
5
|
export declare const colors: any;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Get system theme preference
|
|
8
|
+
* @returns 'light' or 'dark' based on system preference
|
|
9
|
+
*/
|
|
10
|
+
export declare const getSystemTheme: () => ThemeMode;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve theme preference to actual theme mode
|
|
13
|
+
* @param preference - 'light', 'dark', or 'system'
|
|
14
|
+
* @returns 'light' or 'dark'
|
|
15
|
+
*/
|
|
16
|
+
export declare const resolveThemeMode: (preference: ThemeModePreference) => ThemeMode;
|
|
17
|
+
/**
|
|
18
|
+
* Apply theme mode to DOM without persisting to localStorage
|
|
19
|
+
* @param theme - 'light' or 'dark'
|
|
20
|
+
*/
|
|
21
|
+
export declare const applyThemeMode: (theme: ThemeMode) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Set theme mode (with localStorage persistence)
|
|
8
24
|
* @param theme - 'light' or 'dark'
|
|
25
|
+
* @deprecated Use applyThemeMode for backend-managed themes
|
|
9
26
|
*/
|
|
10
27
|
export declare const setThemeMode: (theme: ThemeMode) => void;
|
|
11
28
|
export declare const getThemeMode: (tenantPrefered?: ThemeModePreference) => ThemeMode;
|
|
@@ -14,10 +31,11 @@ export declare const getThemeMode: (tenantPrefered?: ThemeModePreference) => The
|
|
|
14
31
|
*/
|
|
15
32
|
export declare const toggleThemeMode: () => ThemeMode;
|
|
16
33
|
/**
|
|
17
|
-
* Initialize theme based on
|
|
34
|
+
* Initialize theme based on user preference
|
|
18
35
|
* Call this once when your app starts
|
|
36
|
+
* @param userPreference - User's theme preference from backend (defaults to 'system')
|
|
19
37
|
*/
|
|
20
|
-
export declare const initializeTheme: (
|
|
38
|
+
export declare const initializeTheme: (userPreference?: ThemeModePreference) => ThemeMode;
|
|
21
39
|
/**
|
|
22
40
|
* Check if current theme is dark mode
|
|
23
41
|
*/
|
|
@@ -70,9 +70,23 @@ const safeLocalStorage = {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
const
|
|
74
|
-
if (!isBrowser)
|
|
75
|
-
|
|
73
|
+
const getSystemTheme = () => {
|
|
74
|
+
if (!isBrowser) return "light";
|
|
75
|
+
try {
|
|
76
|
+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
77
|
+
return prefersDark ? "dark" : "light";
|
|
78
|
+
} catch {
|
|
79
|
+
return "light";
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const resolveThemeMode = (preference) => {
|
|
83
|
+
if (preference === "system") {
|
|
84
|
+
return getSystemTheme();
|
|
85
|
+
}
|
|
86
|
+
return preference;
|
|
87
|
+
};
|
|
88
|
+
const applyThemeMode = (theme) => {
|
|
89
|
+
if (!isBrowser) return;
|
|
76
90
|
try {
|
|
77
91
|
document.documentElement.setAttribute("data-theme", theme);
|
|
78
92
|
if (theme === "dark") {
|
|
@@ -80,14 +94,21 @@ const setThemeMode = (theme) => {
|
|
|
80
94
|
} else {
|
|
81
95
|
document.documentElement.classList.remove("dark");
|
|
82
96
|
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.warn("Failed to apply theme mode:", error);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const setThemeMode = (theme) => {
|
|
102
|
+
if (!isBrowser) return;
|
|
103
|
+
try {
|
|
104
|
+
applyThemeMode(theme);
|
|
83
105
|
safeLocalStorage.setItem("theme-mode", theme);
|
|
84
106
|
} catch (error) {
|
|
85
107
|
console.warn("Failed to set theme mode:", error);
|
|
86
108
|
}
|
|
87
109
|
};
|
|
88
110
|
const getThemeMode = (tenantPrefered = "system") => {
|
|
89
|
-
if (!isBrowser)
|
|
90
|
-
return "light";
|
|
111
|
+
if (!isBrowser) return "light";
|
|
91
112
|
const stored = safeLocalStorage.getItem("theme-mode");
|
|
92
113
|
if (stored === "light" || stored === "dark") {
|
|
93
114
|
return stored;
|
|
@@ -108,28 +129,31 @@ const toggleThemeMode = () => {
|
|
|
108
129
|
setThemeMode(newTheme);
|
|
109
130
|
return newTheme;
|
|
110
131
|
};
|
|
111
|
-
const initializeTheme = (
|
|
112
|
-
const
|
|
132
|
+
const initializeTheme = (userPreference = "system") => {
|
|
133
|
+
const resolvedTheme = resolveThemeMode(userPreference);
|
|
113
134
|
if (isBrowser) {
|
|
114
135
|
try {
|
|
115
136
|
injectThemes(lightPalette, darkPalette);
|
|
116
|
-
|
|
137
|
+
applyThemeMode(resolvedTheme);
|
|
117
138
|
} catch (error) {
|
|
118
139
|
console.warn("Failed to initialize theme:", error);
|
|
119
140
|
}
|
|
120
141
|
}
|
|
121
|
-
return
|
|
142
|
+
return resolvedTheme;
|
|
122
143
|
};
|
|
123
144
|
const isDarkMode = () => {
|
|
124
145
|
return getThemeMode() === "dark";
|
|
125
146
|
};
|
|
126
147
|
export {
|
|
148
|
+
applyThemeMode,
|
|
127
149
|
colors,
|
|
150
|
+
getSystemTheme,
|
|
128
151
|
getTailwindColors,
|
|
129
152
|
getThemeMode,
|
|
130
153
|
initializeTheme,
|
|
131
154
|
injectThemes,
|
|
132
155
|
isDarkMode,
|
|
156
|
+
resolveThemeMode,
|
|
133
157
|
setThemeMode,
|
|
134
158
|
toggleThemeMode
|
|
135
159
|
};
|