tfy-web-components 0.0.8 → 0.0.10
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 +1 -31
- 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 +5 -43
- 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.d.ts +3 -5
- package/dist/components/atoms/Tooltip.es.js +1 -3
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/atoms/stories/Button.stories.d.ts +25 -0
- package/dist/components/molecules/CustomDrawer.es.js +1 -3
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/theme/backgroundImage.d.ts +0 -1
- package/dist/components/theme/backgroundImage.es.js +1 -4
- package/dist/components/theme/backgroundImage.es.js.map +1 -1
- package/dist/components/theme/colors.d.ts +4 -133
- package/dist/components/theme/colors.es.js +9 -140
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/components/theme/index.d.ts +59 -1
- package/dist/components/theme/index.es.js +2 -0
- package/dist/components/theme/index.es.js.map +1 -1
- package/dist/components/theme/utils.d.ts +59 -1
- package/dist/components/theme/utils.es.js +1 -754
- package/dist/components/theme/utils.es.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +0 -6
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/lodash-es/_Hash.es.js +22 -0
- package/dist/node_modules/lodash-es/_Hash.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_ListCache.es.js +22 -0
- package/dist/node_modules/lodash-es/_ListCache.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_Map.es.js +8 -0
- package/dist/node_modules/lodash-es/_Map.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_MapCache.es.js +22 -0
- package/dist/node_modules/lodash-es/_MapCache.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_Stack.es.js +19 -0
- package/dist/node_modules/lodash-es/_Stack.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_Symbol.es.js +7 -0
- package/dist/node_modules/lodash-es/_Symbol.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_Uint8Array.es.js +7 -0
- package/dist/node_modules/lodash-es/_Uint8Array.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_apply.es.js +17 -0
- package/dist/node_modules/lodash-es/_apply.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.es.js +25 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.es.js +11 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_assignValue.es.js +14 -0
- package/dist/node_modules/lodash-es/_assignValue.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_assocIndexOf.es.js +14 -0
- package/dist/node_modules/lodash-es/_assocIndexOf.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.es.js +17 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseCreate.es.js +23 -0
- package/dist/node_modules/lodash-es/_baseCreate.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseFor.es.js +7 -0
- package/dist/node_modules/lodash-es/_baseFor.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseGetTag.es.js +15 -0
- package/dist/node_modules/lodash-es/_baseGetTag.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.es.js +10 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseIsNative.es.js +23 -0
- package/dist/node_modules/lodash-es/_baseIsNative.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.es.js +15 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.es.js +21 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseMerge.es.js +28 -0
- package/dist/node_modules/lodash-es/_baseMerge.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.es.js +62 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseRest.es.js +10 -0
- package/dist/node_modules/lodash-es/_baseRest.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseSetToString.es.js +16 -0
- package/dist/node_modules/lodash-es/_baseSetToString.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseTimes.es.js +11 -0
- package/dist/node_modules/lodash-es/_baseTimes.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_baseUnary.es.js +9 -0
- package/dist/node_modules/lodash-es/_baseUnary.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.es.js +10 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.es.js +17 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.es.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_copyArray.es.js +12 -0
- package/dist/node_modules/lodash-es/_copyArray.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_copyObject.es.js +24 -0
- package/dist/node_modules/lodash-es/_copyObject.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_coreJsData.es.js +7 -0
- package/dist/node_modules/lodash-es/_coreJsData.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_createAssigner.es.js +24 -0
- package/dist/node_modules/lodash-es/_createAssigner.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_createBaseFor.es.js +16 -0
- package/dist/node_modules/lodash-es/_createBaseFor.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_defineProperty.es.js +14 -0
- package/dist/node_modules/lodash-es/_defineProperty.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_freeGlobal.es.js +6 -0
- package/dist/node_modules/lodash-es/_freeGlobal.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_getMapData.es.js +9 -0
- package/dist/node_modules/lodash-es/_getMapData.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_getNative.es.js +10 -0
- package/dist/node_modules/lodash-es/_getNative.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_getPrototype.es.js +7 -0
- package/dist/node_modules/lodash-es/_getPrototype.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_getRawTag.es.js +26 -0
- package/dist/node_modules/lodash-es/_getRawTag.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_getValue.es.js +7 -0
- package/dist/node_modules/lodash-es/_getValue.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_hashClear.es.js +9 -0
- package/dist/node_modules/lodash-es/_hashClear.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_hashDelete.es.js +9 -0
- package/dist/node_modules/lodash-es/_hashDelete.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_hashGet.es.js +16 -0
- package/dist/node_modules/lodash-es/_hashGet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_hashHas.es.js +11 -0
- package/dist/node_modules/lodash-es/_hashHas.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_hashSet.es.js +12 -0
- package/dist/node_modules/lodash-es/_hashSet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_initCloneObject.es.js +10 -0
- package/dist/node_modules/lodash-es/_initCloneObject.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_isIndex.es.js +11 -0
- package/dist/node_modules/lodash-es/_isIndex.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.es.js +18 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_isKeyable.es.js +8 -0
- package/dist/node_modules/lodash-es/_isKeyable.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_isMasked.es.js +12 -0
- package/dist/node_modules/lodash-es/_isMasked.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_isPrototype.es.js +9 -0
- package/dist/node_modules/lodash-es/_isPrototype.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_listCacheClear.es.js +8 -0
- package/dist/node_modules/lodash-es/_listCacheClear.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_listCacheDelete.es.js +21 -0
- package/dist/node_modules/lodash-es/_listCacheDelete.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_listCacheGet.es.js +9 -0
- package/dist/node_modules/lodash-es/_listCacheGet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_listCacheHas.es.js +8 -0
- package/dist/node_modules/lodash-es/_listCacheHas.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_listCacheSet.es.js +15 -0
- package/dist/node_modules/lodash-es/_listCacheSet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_mapCacheClear.es.js +15 -0
- package/dist/node_modules/lodash-es/_mapCacheClear.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_mapCacheDelete.es.js +10 -0
- package/dist/node_modules/lodash-es/_mapCacheDelete.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_mapCacheGet.es.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheGet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_mapCacheHas.es.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheHas.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_mapCacheSet.es.js +11 -0
- package/dist/node_modules/lodash-es/_mapCacheSet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_nativeCreate.es.js +7 -0
- package/dist/node_modules/lodash-es/_nativeCreate.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.es.js +13 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_nodeUtil.es.js +20 -0
- package/dist/node_modules/lodash-es/_nodeUtil.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_objectToString.es.js +9 -0
- package/dist/node_modules/lodash-es/_objectToString.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_overArg.es.js +9 -0
- package/dist/node_modules/lodash-es/_overArg.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_overRest.es.js +22 -0
- package/dist/node_modules/lodash-es/_overRest.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_root.es.js +8 -0
- package/dist/node_modules/lodash-es/_root.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_safeGet.es.js +13 -0
- package/dist/node_modules/lodash-es/_safeGet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_setToString.es.js +8 -0
- package/dist/node_modules/lodash-es/_setToString.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_shortOut.es.js +21 -0
- package/dist/node_modules/lodash-es/_shortOut.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_stackClear.es.js +9 -0
- package/dist/node_modules/lodash-es/_stackClear.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_stackDelete.es.js +9 -0
- package/dist/node_modules/lodash-es/_stackDelete.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_stackGet.es.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_stackHas.es.js +7 -0
- package/dist/node_modules/lodash-es/_stackHas.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_stackSet.es.js +23 -0
- package/dist/node_modules/lodash-es/_stackSet.es.js.map +1 -0
- package/dist/node_modules/lodash-es/_toSource.es.js +19 -0
- package/dist/node_modules/lodash-es/_toSource.es.js.map +1 -0
- package/dist/node_modules/lodash-es/constant.es.js +9 -0
- package/dist/node_modules/lodash-es/constant.es.js.map +1 -0
- package/dist/node_modules/lodash-es/eq.es.js +7 -0
- package/dist/node_modules/lodash-es/eq.es.js.map +1 -0
- package/dist/node_modules/lodash-es/identity.es.js +7 -0
- package/dist/node_modules/lodash-es/identity.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isArguments.es.js +15 -0
- package/dist/node_modules/lodash-es/isArguments.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isArray.es.js +6 -0
- package/dist/node_modules/lodash-es/isArray.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isArrayLike.es.js +9 -0
- package/dist/node_modules/lodash-es/isArrayLike.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.es.js +9 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isBuffer.es.js +13 -0
- package/dist/node_modules/lodash-es/isBuffer.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isFunction.es.js +14 -0
- package/dist/node_modules/lodash-es/isFunction.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isLength.es.js +8 -0
- package/dist/node_modules/lodash-es/isLength.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isObject.es.js +8 -0
- package/dist/node_modules/lodash-es/isObject.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isObjectLike.es.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isPlainObject.es.js +23 -0
- package/dist/node_modules/lodash-es/isPlainObject.es.js.map +1 -0
- package/dist/node_modules/lodash-es/isTypedArray.es.js +10 -0
- package/dist/node_modules/lodash-es/isTypedArray.es.js.map +1 -0
- package/dist/node_modules/lodash-es/keysIn.es.js +10 -0
- package/dist/node_modules/lodash-es/keysIn.es.js.map +1 -0
- package/dist/node_modules/lodash-es/merge.es.js +10 -0
- package/dist/node_modules/lodash-es/merge.es.js.map +1 -0
- package/dist/node_modules/lodash-es/stubFalse.es.js +7 -0
- package/dist/node_modules/lodash-es/stubFalse.es.js.map +1 -0
- package/dist/node_modules/lodash-es/toPlainObject.es.js +9 -0
- package/dist/node_modules/lodash-es/toPlainObject.es.js.map +1 -0
- package/dist/{classNames-f3c6f58e.js → src/utils/classNames.es.js} +2 -2
- package/dist/{classNames-f3c6f58e.js.map → src/utils/classNames.es.js.map} +1 -1
- package/dist/utils/classNames.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Button.d.ts +0 -62
- package/dist/CustomDrawer.d.ts +0 -30
- package/dist/IconButton.d.ts +0 -15
- package/dist/IconProvider.d.ts +0 -39
- package/dist/Spinner.d.ts +0 -15
- package/dist/Tooltip.d.ts +0 -28
- package/dist/animation.d.ts +0 -6
- package/dist/backgroundColor.d.ts +0 -5
- package/dist/backgroundImage.d.ts +0 -10
- package/dist/borderWidth.d.ts +0 -6
- package/dist/colors.d.ts +0 -191
- package/dist/components/theme/lightColorPlugin.js.d.ts +0 -1
- package/dist/components/theme/lightColorPlugin.js.es.js +0 -91
- package/dist/components/theme/lightColorPlugin.js.es.js.map +0 -1
- package/dist/components/theme/tailwindScrollbar.js.d.ts +0 -1
- package/dist/components/theme/tailwindScrollbar.js.es.js +0 -81
- package/dist/components/theme/tailwindScrollbar.js.es.js.map +0 -1
- package/dist/components/theme/theme.d.ts +0 -23
- package/dist/components/theme/theme.es.js +0 -128
- package/dist/components/theme/theme.es.js.map +0 -1
- package/dist/components/theme/useTheme.d.ts +0 -14
- package/dist/components/theme/useTheme.es.js +0 -40
- package/dist/components/theme/useTheme.es.js.map +0 -1
- package/dist/cursor.d.ts +0 -5
- package/dist/dropShadow.d.ts +0 -5
- package/dist/flexGrow.d.ts +0 -5
- package/dist/fontSize.d.ts +0 -8
- package/dist/height.d.ts +0 -8
- package/dist/keyframes.d.ts +0 -20
- package/dist/lightColorPlugin.js.d.ts +0 -1
- package/dist/maxHeight.d.ts +0 -6
- package/dist/plugin-06dc459f.js +0 -61
- package/dist/plugin-06dc459f.js.map +0 -1
- package/dist/screens.d.ts +0 -8
- package/dist/tailwindScrollbar.js.d.ts +0 -1
- package/dist/theme.d.ts +0 -33
- package/dist/transitionProperty.d.ts +0 -6
- package/dist/useTheme.d.ts +0 -22
- package/dist/utils.d.ts +0 -79
- package/dist/zIndex.d.ts +0 -5
package/dist/..d.ts
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const CustomDrawer: React_2.FC<DrawerProps>;
|
|
4
|
-
|
|
5
|
-
declare interface DrawerProps {
|
|
6
|
-
children: React_2.ReactNode | JSX.Element | string;
|
|
7
|
-
anchor?: 'right' | 'left' | 'top' | 'bottom' | undefined;
|
|
8
|
-
open: boolean;
|
|
9
|
-
inner?: boolean;
|
|
10
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
11
|
-
width?: string;
|
|
12
|
-
bodyClassName?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
overflowY?: boolean;
|
|
15
|
-
confirmOnClose?: boolean;
|
|
16
|
-
confirmOnCloseMessage?: string;
|
|
17
|
-
onClose: () => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export declare const Spinner: React_2.FC<SpinnerProps>;
|
|
21
|
-
|
|
22
|
-
declare interface SpinnerProps {
|
|
23
|
-
className?: string;
|
|
24
|
-
small?: boolean;
|
|
25
|
-
big?: boolean;
|
|
26
|
-
medium?: boolean;
|
|
27
|
-
center?: boolean;
|
|
28
|
-
type?: 'normal';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { }
|
|
1
|
+
export * from './index'
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import
|
|
3
|
+
import classNames from "../../src/utils/classNames.es.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,SAA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,aAAW;AAAA,QAEV,UAAA;AAAA,UAAA,CAAC,eAAe;AAAA,UAChB;AAAA,UACA,eAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IAEpB,EAAA,CAAA;AAAA,EAEJ;AACF;AAEA,MAAM,cAAcA,eAAM,WAA2C,CAAC,OAAO,QAC1E,oBAAA,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,QAAQ,CAAA,CAClD;AAED,MAAM,gBAAgBA,eAAM,WAA2C,CAAC,OAAO,QAC5E,oBAAA,YAAA,EAAY,GAAG,OAAO,KAAU,SAAQ,UAAU,CAAA,CACpD;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;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,aAAa,QAAQ,CAAC,CAAC;AAE7B,UAAM,iBAAiB;AAAA,MACrB,SAAS,WAAW,2BAA2B;AAAA,QAC7C,qBAAqB,CAAC;AAAA,MAAA,CACvB;AAAA,MACD,WAAW,WAAW,iDAAiD;AAAA,QACrE,4DAA4D,CAAC;AAAA,MAAA,CAC9D;AAAA,MACD,OAAO,WAAW,wDAAwD;AAAA,QACxE,qBAAqB,CAAC;AAAA,MAAA,CACvB;AA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;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
|
|
2
|
+
import classNames from "../../src/utils/classNames.es.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":";;;;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;"}
|
|
@@ -1,12 +1,7 @@
|
|
|
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
|
|
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";
|
|
4
|
+
import classNames from "../../src/utils/classNames.es.js";
|
|
10
5
|
const IMG_ICONS_MAP = {};
|
|
11
6
|
const registerImgIcons = (iconMap) => {
|
|
12
7
|
Object.assign(IMG_ICONS_MAP, iconMap);
|
|
@@ -25,24 +20,6 @@ const DynamicIcon = ({ name, ...props }) => {
|
|
|
25
20
|
const IconToRender = CUSTOM_ICONS_MAP[name];
|
|
26
21
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", {}), children: /* @__PURE__ */ jsx(IconToRender, { ...props }) });
|
|
27
22
|
};
|
|
28
|
-
function addDarkSuffix(url) {
|
|
29
|
-
const urlObj = new URL(url);
|
|
30
|
-
const parts = urlObj.pathname.split("/");
|
|
31
|
-
const filename = parts.pop();
|
|
32
|
-
if (!filename) {
|
|
33
|
-
return url + "-dark";
|
|
34
|
-
}
|
|
35
|
-
const dotIndex = filename.lastIndexOf(".");
|
|
36
|
-
let newFilename;
|
|
37
|
-
if (dotIndex !== -1) {
|
|
38
|
-
newFilename = filename.slice(0, dotIndex) + "-dark" + filename.slice(dotIndex);
|
|
39
|
-
} else {
|
|
40
|
-
newFilename = filename + "-dark";
|
|
41
|
-
}
|
|
42
|
-
parts.push(newFilename);
|
|
43
|
-
urlObj.pathname = parts.join("/");
|
|
44
|
-
return urlObj.toString();
|
|
45
|
-
}
|
|
46
23
|
const IconProvider = ({
|
|
47
24
|
icon,
|
|
48
25
|
color,
|
|
@@ -53,32 +30,17 @@ const IconProvider = ({
|
|
|
53
30
|
forwardedRef,
|
|
54
31
|
nativeProps = {}
|
|
55
32
|
}) => {
|
|
56
|
-
const
|
|
57
|
-
let themeAwareImgIcon = null;
|
|
58
|
-
let fallbackImgIcon = null;
|
|
59
|
-
if (typeof icon === "string" && icon.startsWith("http")) {
|
|
60
|
-
themeAwareImgIcon = isDark ? addDarkSuffix(icon) : icon;
|
|
61
|
-
fallbackImgIcon = icon;
|
|
62
|
-
} else if (typeof icon === "string" && IMG_ICONS_MAP[icon]) {
|
|
63
|
-
themeAwareImgIcon = isDark ? IMG_ICONS_MAP[`${icon}-dark`] ?? IMG_ICONS_MAP[icon] : IMG_ICONS_MAP[icon];
|
|
64
|
-
fallbackImgIcon = IMG_ICONS_MAP[icon];
|
|
65
|
-
} else if (Array.isArray(icon) && icon[1] && IMG_ICONS_MAP[icon[1]]) {
|
|
66
|
-
themeAwareImgIcon = isDark ? IMG_ICONS_MAP[`${icon[1]}-dark`] ?? IMG_ICONS_MAP[icon[1]] : IMG_ICONS_MAP[icon[1]];
|
|
67
|
-
fallbackImgIcon = IMG_ICONS_MAP[icon[1]];
|
|
68
|
-
}
|
|
33
|
+
const imgIcon = typeof icon === "string" && icon.startsWith("http") ? icon : IMG_ICONS_MAP[icon];
|
|
69
34
|
const faIcon = FA_ICON_ALIAS_MAP[icon] || icon;
|
|
70
35
|
const iconStyles = width ? { width: `${width}rem`, height: "auto" } : { height: `${size}rem`, width: "auto" };
|
|
71
|
-
return
|
|
36
|
+
return imgIcon ? /* @__PURE__ */ jsx(
|
|
72
37
|
"img",
|
|
73
38
|
{
|
|
74
39
|
ref: forwardedRef,
|
|
75
|
-
src:
|
|
40
|
+
src: imgIcon,
|
|
76
41
|
style: iconStyles,
|
|
77
42
|
className: classNames(className),
|
|
78
|
-
onClick
|
|
79
|
-
onError: (e) => {
|
|
80
|
-
e.currentTarget.src = fallbackImgIcon;
|
|
81
|
-
}
|
|
43
|
+
onClick
|
|
82
44
|
}
|
|
83
45
|
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(DynamicIcon, { onClick, style: { ...iconStyles, color }, name: String(icon), className }) : /* @__PURE__ */ jsx(
|
|
84
46
|
FontAwesomeIcon,
|
|
@@ -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\
|
|
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,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;AACtD,QAAA,eAAe,iBAAiB,IAAI;AAExC,SAAA,oBAAC,UAAS,EAAA,UAAW,oBAAA,QAAA,CAAK,CAAA,GACxB,UAAC,oBAAA,cAAA,EAAc,GAAG,MAAO,CAAA,EAC3B,CAAA;AAEJ;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC;AACjB,MAAiB;AACT,QAAA,UAAU,OAAO,SAAS,YAAY,KAAK,WAAW,MAAM,IAAI,OAAO,cAAc,IAAc;AACnG,QAAA,SAAS,kBAAkB,IAAc,KAAK;AAEpD,QAAM,aAAa,QAAQ,EAAE,OAAO,GAAG,KAAK,OAAO,QAAQ,OAAO,IAAI,EAAE,QAAQ,GAAG,IAAI,OAAO,OAAO;AAErG,SAAO,UACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,KAAK;AAAA,MACL,OAAO;AAAA,MACP,WAAW,WAAW,SAAS;AAAA,MAC/B;AAAA,IAAA;AAAA,EAAA,IAEA,iBAAiB,IAAc,IAChC,oBAAA,aAAA,EAAY,SAAkB,OAAO,EAAE,GAAG,YAAY,MAAS,GAAA,MAAM,OAAO,IAAI,GAAG,UAAsB,CAAA,IAE1G;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI,MAAM;AAAA,MAChD,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAeA,iBAAAA,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,IAAA,CAAK,CAAE;AACnG;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import "classnames";
|
|
4
|
-
import "tailwind-merge";
|
|
2
|
+
import classNames from "../../src/utils/classNames.es.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":";;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;"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
|
-
import { MUIStyledCommonProps } from '@mui/system';
|
|
3
1
|
import * as React from 'react';
|
|
4
2
|
import { TooltipProps } from '@mui/material/Tooltip';
|
|
5
3
|
export type Sizes = 'large' | 'variable' | 'medium' | 'fit';
|
|
@@ -10,12 +8,12 @@ export type CustomTooltipProps = TooltipProps & {
|
|
|
10
8
|
export declare const LightTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
11
9
|
size?: Sizes | undefined;
|
|
12
10
|
border?: boolean | undefined;
|
|
13
|
-
} & MUIStyledCommonProps<Theme>>;
|
|
11
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>>;
|
|
14
12
|
export declare const DarkTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
15
13
|
size?: Sizes | undefined;
|
|
16
14
|
border?: boolean | undefined;
|
|
17
|
-
} & MUIStyledCommonProps<Theme>>;
|
|
15
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>>;
|
|
18
16
|
export declare const UnstyledTooltip: React.NamedExoticComponent<TooltipProps & {
|
|
19
17
|
size?: Sizes | undefined;
|
|
20
18
|
border?: boolean | undefined;
|
|
21
|
-
} & MUIStyledCommonProps<Theme>>;
|
|
19
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>>;
|
|
@@ -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
|
|
6
|
-
import "classnames";
|
|
7
|
-
import "tailwind-merge";
|
|
5
|
+
import classNames from "../../src/utils/classNames.es.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,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,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AAAA,QACV,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,WAAW;AAAA,QACX,cAAc;AAAA,QACd,UAAU;AAAA,QACV,SAAS;AAAA,MACX;AAAA,IAAA;AAAA,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,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
import { ButtonProps } from '../Button';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import("react").ForwardRefExoticComponent<ButtonProps> & {
|
|
7
|
+
Ghost: import("react").ForwardRefExoticComponent<ButtonProps>;
|
|
8
|
+
Primary: import("react").ForwardRefExoticComponent<ButtonProps>;
|
|
9
|
+
Secondary: import("react").ForwardRefExoticComponent<ButtonProps>;
|
|
10
|
+
Tertiary: import("react").ForwardRefExoticComponent<ButtonProps>;
|
|
11
|
+
Destructive: import("react").ForwardRefExoticComponent<ButtonProps>;
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export declare const Primary: StoryObj<typeof meta>;
|
|
20
|
+
export declare const Secondary: StoryObj<typeof meta>;
|
|
21
|
+
export declare const Tertiary: StoryObj<typeof meta>;
|
|
22
|
+
export declare const Destructive: StoryObj<typeof meta>;
|
|
23
|
+
export declare const Ghost: StoryObj<typeof meta>;
|
|
24
|
+
export declare const ButtonWithIcon: StoryObj<typeof meta>;
|
|
25
|
+
export declare const ButtonWithIconOnly: StoryObj<typeof meta>;
|
|
@@ -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
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "tailwind-merge";
|
|
4
|
+
import classNames from "../../src/utils/classNames.es.js";
|
|
7
5
|
const CustomDrawerContext = React__default.createContext({});
|
|
8
6
|
const CustomDrawer = ({
|
|
9
7
|
anchor = "right",
|
|
@@ -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,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;AAAA,EAAA;AAGvB,YAAU,MAAM;AACd,4BAAwB,cAAc;AACtC,QAAI,CAAC,MAAM;AACT,iCAA2B,KAAK;AAAA,IAClC;AAAA,EAAA,GACC,CAAC,gBAAgB,IAAI,CAAC;AAEzB,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS,QAAS,uBAAuB,MAAM,2BAA2B,IAAI,IAAI,UAAW;AA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(theme) => ({
|
|
|
11
11
|
)} 111.1%)`,
|
|
12
12
|
"new-deployment-gradient": `linear-gradient(180deg, ${theme("colors.white")} 30.17%, ${theme(
|
|
13
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%)`
|
|
14
|
+
)} 100%)`
|
|
18
15
|
});
|
|
19
16
|
export {
|
|
20
17
|
backgroundImage
|
|
@@ -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
|
|
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})\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;AACH;"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const colors: {
|
|
2
2
|
gray: {
|
|
3
3
|
16: string;
|
|
4
4
|
25: string;
|
|
5
5
|
50: string;
|
|
6
|
-
75: string;
|
|
7
6
|
100: string;
|
|
8
|
-
125: string;
|
|
9
7
|
150: string;
|
|
10
8
|
200: string;
|
|
9
|
+
225: string;
|
|
11
10
|
250: string;
|
|
12
|
-
275: string;
|
|
13
11
|
300: string;
|
|
14
12
|
350: string;
|
|
15
|
-
375: string;
|
|
16
13
|
400: string;
|
|
17
14
|
450: string;
|
|
18
15
|
500: string;
|
|
@@ -27,16 +24,9 @@ export declare const lightPalette: {
|
|
|
27
24
|
950: string;
|
|
28
25
|
1000: string;
|
|
29
26
|
disabled: string;
|
|
30
|
-
whitesmoke: string;
|
|
31
27
|
};
|
|
32
28
|
indigo: {
|
|
33
29
|
500: string;
|
|
34
|
-
525: string;
|
|
35
|
-
550: string;
|
|
36
|
-
700: string;
|
|
37
|
-
725: string;
|
|
38
|
-
750: string;
|
|
39
|
-
850: string;
|
|
40
30
|
};
|
|
41
31
|
yellow: {
|
|
42
32
|
'50light': string;
|
|
@@ -46,143 +36,24 @@ export declare const lightPalette: {
|
|
|
46
36
|
};
|
|
47
37
|
skyblue: string;
|
|
48
38
|
blue: {
|
|
49
|
-
|
|
50
|
-
45: string;
|
|
39
|
+
10: string;
|
|
51
40
|
primary: string;
|
|
52
41
|
secondary: string;
|
|
53
|
-
'secondary-light': string;
|
|
54
42
|
purple: string;
|
|
55
43
|
'purple-2': string;
|
|
56
44
|
'purple-3': string;
|
|
57
45
|
100: string;
|
|
58
|
-
150: string;
|
|
59
46
|
200: string;
|
|
60
|
-
350: string;
|
|
61
|
-
375: string;
|
|
62
47
|
500: string;
|
|
63
|
-
550: string;
|
|
64
48
|
'500original': string;
|
|
65
|
-
600: string;
|
|
66
49
|
650: string;
|
|
67
|
-
725: string;
|
|
68
|
-
};
|
|
69
|
-
green: {
|
|
70
50
|
600: string;
|
|
71
|
-
|
|
72
|
-
fuchsia: {
|
|
73
|
-
100: string;
|
|
74
|
-
500: string;
|
|
75
|
-
};
|
|
76
|
-
violet: {
|
|
77
|
-
500: string;
|
|
78
|
-
};
|
|
79
|
-
red: {
|
|
80
|
-
500: string;
|
|
81
|
-
650: string;
|
|
82
|
-
50: string;
|
|
83
|
-
};
|
|
84
|
-
orange: {
|
|
85
|
-
100: string;
|
|
86
|
-
650: string;
|
|
87
|
-
};
|
|
88
|
-
amber: {
|
|
89
|
-
450: string;
|
|
90
|
-
};
|
|
91
|
-
white: string;
|
|
92
|
-
black: string;
|
|
93
|
-
background: string;
|
|
94
|
-
};
|
|
95
|
-
export declare const darkPalette: {
|
|
96
|
-
gray: {
|
|
97
|
-
16: string;
|
|
98
|
-
25: string;
|
|
99
|
-
50: string;
|
|
100
|
-
75: string;
|
|
101
|
-
100: string;
|
|
102
|
-
125: string;
|
|
103
|
-
150: string;
|
|
104
|
-
200: string;
|
|
105
|
-
250: string;
|
|
106
|
-
275: string;
|
|
107
|
-
300: string;
|
|
108
|
-
350: string;
|
|
109
|
-
375: string;
|
|
110
|
-
400: string;
|
|
111
|
-
450: string;
|
|
112
|
-
500: string;
|
|
113
|
-
550: string;
|
|
114
|
-
600: string;
|
|
115
|
-
650: string;
|
|
116
|
-
700: string;
|
|
117
|
-
750: string;
|
|
118
|
-
800: string;
|
|
119
|
-
850: string;
|
|
120
|
-
900: string;
|
|
121
|
-
950: string;
|
|
122
|
-
1000: string;
|
|
123
|
-
disabled: string;
|
|
124
|
-
whitesmoke: string;
|
|
125
|
-
};
|
|
126
|
-
indigo: {
|
|
127
|
-
500: string;
|
|
128
|
-
525: string;
|
|
129
|
-
550: string;
|
|
130
|
-
700: string;
|
|
131
|
-
725: string;
|
|
132
|
-
750: string;
|
|
133
|
-
850: string;
|
|
134
|
-
};
|
|
135
|
-
yellow: {
|
|
136
|
-
'50light': string;
|
|
137
|
-
100: string;
|
|
138
|
-
'200dark': string;
|
|
139
|
-
500: string;
|
|
140
|
-
};
|
|
141
|
-
skyblue: string;
|
|
142
|
-
blue: {
|
|
143
|
-
25: string;
|
|
144
|
-
45: string;
|
|
145
|
-
primary: string;
|
|
146
|
-
secondary: string;
|
|
147
|
-
'secondary-light': string;
|
|
148
|
-
purple: string;
|
|
149
|
-
'purple-2': string;
|
|
150
|
-
'purple-3': string;
|
|
151
|
-
100: string;
|
|
152
|
-
150: string;
|
|
153
|
-
200: string;
|
|
154
|
-
350: string;
|
|
155
|
-
375: string;
|
|
156
|
-
500: string;
|
|
157
|
-
550: string;
|
|
158
|
-
'500original': string;
|
|
159
|
-
600: string;
|
|
160
|
-
650: string;
|
|
161
|
-
725: string;
|
|
51
|
+
dark: string;
|
|
162
52
|
};
|
|
163
53
|
green: {
|
|
164
54
|
600: string;
|
|
165
55
|
};
|
|
166
|
-
fuchsia: {
|
|
167
|
-
100: string;
|
|
168
|
-
500: string;
|
|
169
|
-
};
|
|
170
56
|
violet: {
|
|
171
57
|
500: string;
|
|
172
58
|
};
|
|
173
|
-
red: {
|
|
174
|
-
500: string;
|
|
175
|
-
650: string;
|
|
176
|
-
50: string;
|
|
177
|
-
};
|
|
178
|
-
orange: {
|
|
179
|
-
100: string;
|
|
180
|
-
650: string;
|
|
181
|
-
};
|
|
182
|
-
amber: {
|
|
183
|
-
450: string;
|
|
184
|
-
};
|
|
185
|
-
white: string;
|
|
186
|
-
black: string;
|
|
187
|
-
background: string;
|
|
188
59
|
};
|