@chayns-components/core 5.0.0-beta.604 → 5.0.0-beta.606
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/lib/cjs/components/button/Button.js +3 -5
- package/lib/cjs/components/button/Button.js.map +1 -1
- package/lib/cjs/components/button/wait-cursor/WaitCursor.js +18 -0
- package/lib/cjs/components/button/wait-cursor/WaitCursor.js.map +1 -0
- package/lib/cjs/components/button/wait-cursor/WaitCursor.styles.js +53 -0
- package/lib/cjs/components/button/wait-cursor/WaitCursor.styles.js.map +1 -0
- package/lib/cjs/components/small-wait-cursor/SmallWaitCursor.js +4 -24
- package/lib/cjs/components/small-wait-cursor/SmallWaitCursor.js.map +1 -1
- package/lib/cjs/components/small-wait-cursor/SmallWaitCursor.styles.js +6 -17
- package/lib/cjs/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -1
- package/lib/cjs/components/tooltip/Tooltip.js +7 -2
- package/lib/cjs/components/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/components/tooltip/Tooltip.styles.js +14 -3
- package/lib/cjs/components/tooltip/Tooltip.styles.js.map +1 -1
- package/lib/cjs/index.js +1 -13
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/tooltip.js +25 -0
- package/lib/cjs/utils/tooltip.js.map +1 -0
- package/lib/esm/components/button/Button.js +3 -5
- package/lib/esm/components/button/Button.js.map +1 -1
- package/lib/esm/components/button/wait-cursor/WaitCursor.js +14 -0
- package/lib/esm/components/button/wait-cursor/WaitCursor.js.map +1 -0
- package/lib/esm/components/button/wait-cursor/WaitCursor.styles.js +48 -0
- package/lib/esm/components/button/wait-cursor/WaitCursor.styles.js.map +1 -0
- package/lib/esm/components/small-wait-cursor/SmallWaitCursor.js +3 -24
- package/lib/esm/components/small-wait-cursor/SmallWaitCursor.js.map +1 -1
- package/lib/esm/components/small-wait-cursor/SmallWaitCursor.styles.js +10 -36
- package/lib/esm/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -1
- package/lib/esm/components/tooltip/Tooltip.js +8 -3
- package/lib/esm/components/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/components/tooltip/Tooltip.styles.js +14 -1
- package/lib/esm/components/tooltip/Tooltip.styles.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/tooltip.js +18 -0
- package/lib/esm/utils/tooltip.js.map +1 -0
- package/lib/types/components/button/wait-cursor/WaitCursor.d.ts +10 -0
- package/lib/types/components/button/wait-cursor/WaitCursor.styles.d.ts +13 -0
- package/lib/types/components/small-wait-cursor/SmallWaitCursor.d.ts +1 -22
- package/lib/types/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +3 -8
- package/lib/types/components/tooltip/Tooltip.styles.d.ts +6 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/utils/tooltip.d.ts +2 -0
- package/package.json +2 -2
|
@@ -9,8 +9,8 @@ var _framerMotion = require("framer-motion");
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _styledComponents = require("styled-components");
|
|
11
11
|
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
12
|
-
var _SmallWaitCursor = _interopRequireDefault(require("../small-wait-cursor/SmallWaitCursor"));
|
|
13
12
|
var _Button = require("./Button.styles");
|
|
13
|
+
var _WaitCursor = _interopRequireDefault(require("./wait-cursor/WaitCursor"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
const Button = ({
|
|
16
16
|
children,
|
|
@@ -71,10 +71,8 @@ const Button = ({
|
|
|
71
71
|
transition: {
|
|
72
72
|
duration: 0.2
|
|
73
73
|
}
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
75
|
-
|
|
76
|
-
shouldHideBackground: true,
|
|
77
|
-
size: 26
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_WaitCursor.default, {
|
|
75
|
+
shouldHideBackground: true
|
|
78
76
|
})), !shouldShowWaitCursor && children && /*#__PURE__*/_react.default.createElement(_Button.StyledMotionChildrenWrapper, {
|
|
79
77
|
animate: {
|
|
80
78
|
opacity: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["_clsx","_interopRequireDefault","require","_framerMotion","_react","_styledComponents","_Icon","
|
|
1
|
+
{"version":3,"file":"Button.js","names":["_clsx","_interopRequireDefault","require","_framerMotion","_react","_styledComponents","_Icon","_Button","_WaitCursor","obj","__esModule","default","Button","children","className","icon","isDisabled","isSecondary","onClick","shouldShowWaitCursor","shouldStopPropagation","ShouldShowTextAsRobotoMedium","handleClick","event","stopPropagation","buttonClasses","clsx","theme","useTheme","createElement","StyledMotionButton","$ShouldShowTextAsRobotoMedium","disabled","$isDisabled","$hasChildren","$hasIcon","$isSecondary","whileTap","backgroundColor","whileHover","AnimatePresence","initial","StyledIconWrapper","color","icons","StyledMotionWaitCursorWrapper","animate","opacity","width","exit","key","style","overflow","transition","duration","shouldHideBackground","StyledMotionChildrenWrapper","displayName","_default","exports"],"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEventHandler, ReactNode } from 'react';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport {\n StyledIconWrapper,\n StyledMotionButton,\n StyledMotionChildrenWrapper,\n StyledMotionWaitCursorWrapper,\n} from './Button.styles';\nimport WaitCursor from './wait-cursor/WaitCursor';\n\nexport type ButtonProps = {\n /**\n * The label of the button\n */\n children?: ReactNode;\n /**\n * Additional class names for the button element\n */\n className?: string;\n /**\n * An icon that is displayed on the left-hand side of the button text\n */\n icon?: string;\n /**\n * Disables the button so that it cannot be clicked anymore\n */\n isDisabled?: boolean;\n /**\n * Displays the button in the secondary style\n */\n isSecondary?: boolean;\n /**\n * Function to be executed when the button is clicked\n */\n onClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * Whether the text should be 'Roboto Medium'\n */\n ShouldShowTextAsRobotoMedium?: boolean;\n /**\n * Shows a wait cursor instead of button text\n */\n shouldShowWaitCursor?: boolean;\n /**\n * Stops event propagation on click\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Button: FC<ButtonProps> = ({\n children,\n className,\n icon,\n isDisabled,\n isSecondary,\n onClick,\n shouldShowWaitCursor,\n shouldStopPropagation,\n ShouldShowTextAsRobotoMedium = true,\n}) => {\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n onClick(event);\n };\n\n const buttonClasses = clsx('beta-chayns-button ellipsis', className);\n\n const theme: Theme = useTheme();\n\n return (\n <StyledMotionButton\n $ShouldShowTextAsRobotoMedium={ShouldShowTextAsRobotoMedium}\n className={buttonClasses}\n disabled={isDisabled}\n $isDisabled={isDisabled}\n $hasChildren={!!children}\n $hasIcon={typeof icon === 'string' && icon !== ''}\n $isSecondary={isSecondary}\n onClick={handleClick}\n whileTap={\n isDisabled ? {} : { backgroundColor: isSecondary ? theme['201'] : theme['407'] }\n }\n whileHover={\n isDisabled ? {} : { backgroundColor: isSecondary ? theme['203'] : theme['409'] }\n }\n >\n <AnimatePresence initial={false}>\n {icon && (\n <StyledIconWrapper>\n <Icon color=\"white\" icons={[icon]} />\n </StyledIconWrapper>\n )}\n {shouldShowWaitCursor && (\n <StyledMotionWaitCursorWrapper\n animate={{ opacity: 1, width: 40 }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"wait-cursor\"\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n <WaitCursor shouldHideBackground />\n </StyledMotionWaitCursorWrapper>\n )}\n {!shouldShowWaitCursor && children && (\n <StyledMotionChildrenWrapper\n animate={{ opacity: 1, width: 'auto' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"children\"\n // style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n {children}\n </StyledMotionChildrenWrapper>\n )}\n </AnimatePresence>\n </StyledMotionButton>\n );\n};\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAyClD,MAAMG,MAAuB,GAAGA,CAAC;EAC7BC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJC,UAAU;EACVC,WAAW;EACXC,OAAO;EACPC,oBAAoB;EACpBC,qBAAqB;EACrBC,4BAA4B,GAAG;AACnC,CAAC,KAAK;EACF,MAAMC,WAAiD,GAAIC,KAAK,IAAK;IACjE,IAAIH,qBAAqB,EAAE;MACvBG,KAAK,CAACC,eAAe,CAAC,CAAC;IAC3B;IAEAN,OAAO,CAACK,KAAK,CAAC;EAClB,CAAC;EAED,MAAME,aAAa,GAAG,IAAAC,aAAI,EAAC,6BAA6B,EAAEZ,SAAS,CAAC;EAEpE,MAAMa,KAAY,GAAG,IAAAC,0BAAQ,EAAC,CAAC;EAE/B,oBACIxB,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACtB,OAAA,CAAAuB,kBAAkB;IACfC,6BAA6B,EAAEV,4BAA6B;IAC5DP,SAAS,EAAEW,aAAc;IACzBO,QAAQ,EAAEhB,UAAW;IACrBiB,WAAW,EAAEjB,U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AAE;IAAI;EAAE,gBAE9BlD,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACrB,WAAA,CAAAG,OAAU;IAAC4C,oBAAoB;EAAA,CAAE,CACP,CAClC,EACA,CAACpC,oBAAoB,IAAIN,QAAQ,iBAC9BT,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACtB,OAAA,CAAAiD,2BAA2B;IACxBV,OAAO,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAO,CAAE;IACvCC,IAAI,EAAE;MAAEF,OAAO,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE,CAAE;IAC/BP,OAAO,EAAE;MAAEM,OAAO,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE,CAAE;IAClCE,GAAG,EAAC;IACJ;IAAA;IACAG,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,GAE7BzC,QACwB,CAEpB,CACD,CAAC;AAE7B,CAAC;AAEDD,MAAM,CAAC6C,WAAW,GAAG,QAAQ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAEfC,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _WaitCursor = require("./WaitCursor.styles");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const WaitCursor = ({
|
|
11
|
+
shouldHideBackground = false,
|
|
12
|
+
shouldHideWaitCursor = false
|
|
13
|
+
}) => /*#__PURE__*/_react.default.createElement(_WaitCursor.StyledWaitCursor, {
|
|
14
|
+
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
15
|
+
}, /*#__PURE__*/_react.default.createElement(_WaitCursor.StyledWaitCursorWaitCursor, null), !shouldHideBackground && /*#__PURE__*/_react.default.createElement(_WaitCursor.StyledWaitCursorBackground, null));
|
|
16
|
+
WaitCursor.displayName = 'WaitCursor';
|
|
17
|
+
var _default = exports.default = WaitCursor;
|
|
18
|
+
//# sourceMappingURL=WaitCursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitCursor.js","names":["_react","_interopRequireDefault","require","_WaitCursor","obj","__esModule","default","WaitCursor","shouldHideBackground","shouldHideWaitCursor","createElement","StyledWaitCursor","$shouldShowWaitCursor","StyledWaitCursorWaitCursor","StyledWaitCursorBackground","displayName","_default","exports"],"sources":["../../../../../src/components/button/wait-cursor/WaitCursor.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n StyledWaitCursor,\n StyledWaitCursorBackground,\n StyledWaitCursorWaitCursor,\n} from './WaitCursor.styles';\n\nexport type WaitCursorProps = {\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n};\n\nconst WaitCursor: FC<WaitCursorProps> = ({\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n}) => (\n <StyledWaitCursor $shouldShowWaitCursor={!shouldHideWaitCursor}>\n <StyledWaitCursorWaitCursor />\n {!shouldHideBackground && <StyledWaitCursorBackground />}\n </StyledWaitCursor>\n);\n\nWaitCursor.displayName = 'WaitCursor';\n\nexport default WaitCursor;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAI6B,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAU7B,MAAMG,UAA+B,GAAGA,CAAC;EACrCC,oBAAoB,GAAG,KAAK;EAC5BC,oBAAoB,GAAG;AAC3B,CAAC,kBACGT,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,WAAA,CAAAQ,gBAAgB;EAACC,qBAAqB,EAAE,CAACH;AAAqB,gBAC3DT,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,WAAA,CAAAU,0BAA0B,MAAE,CAAC,EAC7B,CAACL,oBAAoB,iBAAIR,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,WAAA,CAAAW,0BAA0B,MAAE,CACzC,CACrB;AAEDP,UAAU,CAACQ,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEvBC,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledWaitCursorWaitCursor = exports.StyledWaitCursorBackground = exports.StyledWaitCursor = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const StyledWaitCursor = exports.StyledWaitCursor = _styledComponents.default.div`
|
|
11
|
+
position: relative;
|
|
12
|
+
height: 26px;
|
|
13
|
+
width: 26px;
|
|
14
|
+
opacity: ${({
|
|
15
|
+
$shouldShowWaitCursor
|
|
16
|
+
}) => $shouldShowWaitCursor ? 1 : 0};
|
|
17
|
+
`;
|
|
18
|
+
const StyledWaitCursorBackground = exports.StyledWaitCursorBackground = _styledComponents.default.div`
|
|
19
|
+
background-color: white;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
box-shadow:
|
|
26
|
+
0 4px 12px 0 rgba(0, 0, 0, 0.2),
|
|
27
|
+
0 1px 1px rgba(0, 0, 0, 0.2);
|
|
28
|
+
`;
|
|
29
|
+
const spin = (0, _styledComponents.keyframes)`
|
|
30
|
+
from {
|
|
31
|
+
transform: rotate(0deg);
|
|
32
|
+
}
|
|
33
|
+
to {
|
|
34
|
+
transform: rotate(360deg);
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const StyledWaitCursorWaitCursor = exports.StyledWaitCursorWaitCursor = _styledComponents.default.div`
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 5px;
|
|
40
|
+
left: 5px;
|
|
41
|
+
z-index: 2;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-width: 3px;
|
|
44
|
+
border-color: white;
|
|
45
|
+
height: ${26 - 10}px;
|
|
46
|
+
width: ${26 - 10}px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
display: inline-block;
|
|
49
|
+
border-top: 3px solid transparent;
|
|
50
|
+
|
|
51
|
+
animation: ${spin} 1s linear infinite;
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=WaitCursor.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledWaitCursor","exports","styled","div","$shouldShowWaitCursor","StyledWaitCursorBackground","spin","keyframes","StyledWaitCursorWaitCursor"],"sources":["../../../../../src/components/button/wait-cursor/WaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledWaitCursorProps = WithTheme<{\n $shouldShowWaitCursor: boolean;\n}>;\n\nexport const StyledWaitCursor = styled.div<StyledWaitCursorProps>`\n position: relative;\n height: 26px;\n width: 26px;\n opacity: ${({ $shouldShowWaitCursor }) => ($shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledWaitCursorBackground = styled.div<StyledWaitCursorBackgroundProps>`\n background-color: white;\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n box-shadow:\n 0 4px 12px 0 rgba(0, 0, 0, 0.2),\n 0 1px 1px rgba(0, 0, 0, 0.2);\n`;\n\ntype StyledWaitCursorWaitCursorProps = WithTheme<unknown>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledWaitCursorWaitCursor = styled.div<StyledWaitCursorWaitCursorProps>`\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: white;\n height: ${26 - 10}px;\n width: ${26 - 10}px;\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} 1s linear infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAsD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAA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AC;AAEM,MAAMC,0BAA0B,GAAAP,OAAA,CAAAO,0BAAA,GAAGN,yBAAM,CAACC,GAAqC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,EAAE,GAAG,EAAG;AACtB,aAAa,EAAE,GAAG,EAAG;AACrB;AACA;AACA;AACA;AACA,iBAAiBG,IAAK;AACtB,CAAC","ignoreList":[]}
|
|
@@ -3,36 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _SmallWaitCursor = require("./SmallWaitCursor.styles");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
// noinspection JSUnusedGlobalSymbols
|
|
11
|
-
let SmallWaitCursorSize = exports.SmallWaitCursorSize = /*#__PURE__*/function (SmallWaitCursorSize) {
|
|
12
|
-
SmallWaitCursorSize[SmallWaitCursorSize["Small"] = 16] = "Small";
|
|
13
|
-
SmallWaitCursorSize[SmallWaitCursorSize["Medium"] = 30] = "Medium";
|
|
14
|
-
return SmallWaitCursorSize;
|
|
15
|
-
}({});
|
|
16
|
-
let SmallWaitCursorSpeed = exports.SmallWaitCursorSpeed = /*#__PURE__*/function (SmallWaitCursorSpeed) {
|
|
17
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Slow"] = 1.5] = "Slow";
|
|
18
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Medium"] = 1] = "Medium";
|
|
19
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Fast"] = 0.5] = "Fast";
|
|
20
|
-
return SmallWaitCursorSpeed;
|
|
21
|
-
}({});
|
|
22
10
|
const SmallWaitCursor = ({
|
|
23
|
-
color,
|
|
24
11
|
shouldHideBackground = false,
|
|
25
|
-
shouldHideWaitCursor = false
|
|
26
|
-
size = SmallWaitCursorSize.Medium,
|
|
27
|
-
speed = SmallWaitCursorSpeed.Medium
|
|
12
|
+
shouldHideWaitCursor = false
|
|
28
13
|
}) => /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursor, {
|
|
29
|
-
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
30
|
-
|
|
31
|
-
}, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorWaitCursor, {
|
|
32
|
-
$color: color,
|
|
33
|
-
$size: size,
|
|
34
|
-
$speed: speed
|
|
35
|
-
}), !shouldHideBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null));
|
|
14
|
+
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
15
|
+
}, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorWaitCursor, null), !shouldHideBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null));
|
|
36
16
|
SmallWaitCursor.displayName = 'SmallWaitCursor';
|
|
37
17
|
var _default = exports.default = SmallWaitCursor;
|
|
38
18
|
//# sourceMappingURL=SmallWaitCursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireDefault","require","_SmallWaitCursor","obj","__esModule","default","
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireDefault","require","_SmallWaitCursor","obj","__esModule","default","SmallWaitCursor","shouldHideBackground","shouldHideWaitCursor","createElement","StyledSmallWaitCursor","$shouldShowWaitCursor","StyledSmallWaitCursorWaitCursor","StyledSmallWaitCursorBackground","displayName","_default","exports"],"sources":["../../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\nexport type SmallWaitCursorProps = {\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n};\n\nconst SmallWaitCursor: FC<SmallWaitCursorProps> = ({\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n}) => (\n <StyledSmallWaitCursor $shouldShowWaitCursor={!shouldHideWaitCursor}>\n <StyledSmallWaitCursorWaitCursor />\n {!shouldHideBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n);\n\nSmallWaitCursor.displayName = 'SmallWaitCursor';\n\nexport default SmallWaitCursor;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIkC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAUlC,MAAMG,eAAyC,GAAGA,CAAC;EAC/CC,oBAAoB,GAAG,KAAK;EAC5BC,oBAAoB,GAAG;AAC3B,CAAC,kBACGT,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,gBAAA,CAAAQ,qBAAqB;EAACC,qBAAqB,EAAE,CAACH;AAAqB,gBAChET,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,gBAAA,CAAAU,+BAA+B,MAAE,CAAC,EAClC,CAACL,oBAAoB,iBAAIR,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,gBAAA,CAAAW,+BAA+B,MAAE,CACzC,CAC1B;AAEDP,eAAe,CAACQ,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEjCC,eAAe","ignoreList":[]}
|
|
@@ -9,12 +9,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
const StyledSmallWaitCursor = exports.StyledSmallWaitCursor = _styledComponents.default.div`
|
|
11
11
|
position: relative;
|
|
12
|
-
height:
|
|
13
|
-
|
|
14
|
-
}) => $size}px;
|
|
15
|
-
width: ${({
|
|
16
|
-
$size
|
|
17
|
-
}) => $size}px;
|
|
12
|
+
height: 30px;
|
|
13
|
+
width: 30px;
|
|
18
14
|
opacity: ${({
|
|
19
15
|
$shouldShowWaitCursor
|
|
20
16
|
}) => $shouldShowWaitCursor ? 1 : 0};
|
|
@@ -46,21 +42,14 @@ const StyledSmallWaitCursorWaitCursor = exports.StyledSmallWaitCursorWaitCursor
|
|
|
46
42
|
border-style: solid;
|
|
47
43
|
border-width: 3px;
|
|
48
44
|
border-color: ${({
|
|
49
|
-
$color,
|
|
50
45
|
theme
|
|
51
|
-
}) =>
|
|
52
|
-
height: ${
|
|
53
|
-
|
|
54
|
-
}) => `${$size - 10}px`};
|
|
55
|
-
width: ${({
|
|
56
|
-
$size
|
|
57
|
-
}) => `${$size - 10}px`};
|
|
46
|
+
}) => theme.primary};
|
|
47
|
+
height: ${30 - 10}px;
|
|
48
|
+
width: ${30 - 10}px;
|
|
58
49
|
border-radius: 50%;
|
|
59
50
|
display: inline-block;
|
|
60
51
|
border-top: 3px solid transparent;
|
|
61
52
|
|
|
62
|
-
animation: ${spin}
|
|
63
|
-
$speed
|
|
64
|
-
}) => $speed}s linear infinite;
|
|
53
|
+
animation: ${spin} 1s linear infinite;
|
|
65
54
|
`;
|
|
66
55
|
//# sourceMappingURL=SmallWaitCursor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledSmallWaitCursor","exports","styled","div","$
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledSmallWaitCursor","exports","styled","div","$shouldShowWaitCursor","StyledSmallWaitCursorBackground","spin","keyframes","StyledSmallWaitCursorWaitCursor","theme","primary"],"sources":["../../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n $shouldShowWaitCursor: boolean;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: 30px;\n width: 30px;\n opacity: ${({ $shouldShowWaitCursor }) => ($shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: white;\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n box-shadow:\n 0 4px 12px 0 rgba(0, 0, 0, 0.2),\n 0 1px 1px rgba(0, 0, 0, 0.2);\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<unknown>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledSmallWaitCursorWaitCursor = styled.div<StyledSmallWaitCursorWaitCursorProps>`\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ theme }: StyledSmallWaitCursorWaitCursorProps) => theme.primary};\n height: ${30 - 10}px;\n width: ${30 - 10}px;\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} 1s linear infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAsD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAO/C,MAAMW,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,yBAAM,CAACC,GAAgC;AAC5E;AACA;AACA;AACA,eAAe,CAAC;EAAEC;AAAsB,CAAC,KAAMA,qBAAqB,GAAG,CAAC,GAAG,CAAG;AAC9E,CAAC;AAIM,MAAMC,+BAA+B,GAAAJ,OAAA,CAAAI,+BAAA,GAAGH,yBAAM,CAACC,GAA0C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,MAAMG,IAAI,GAAG,IAAAC,2BAAS,CAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,+BAA+B,GAAAP,OAAA,CAAAO,+BAAA,GAAGN,yBAAM,CAACC,GAA0C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,CAAC;EAAEM;AAA4C,CAAC,KAAKA,KAAK,CAACC,OAAQ;AACvF,cAAc,EAAE,GAAG,EAAG;AACtB,aAAa,EAAE,GAAG,EAAG;AACrB;AACA;AACA;AACA;AACA,iBAAiBJ,IAAK;AACtB,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _tooltip = require("../../utils/tooltip");
|
|
8
9
|
var _Popup = _interopRequireDefault(require("../popup/Popup"));
|
|
9
10
|
var _TooltipItem = _interopRequireDefault(require("./tooltip-item/TooltipItem"));
|
|
10
11
|
var _Tooltip = require("./Tooltip.styles");
|
|
@@ -30,11 +31,15 @@ const Tooltip = ({
|
|
|
30
31
|
button: item.button
|
|
31
32
|
});
|
|
32
33
|
}, [item, itemWidth]);
|
|
33
|
-
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_Tooltip.StyledTooltip, null, isDisabled ?
|
|
34
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_Tooltip.StyledTooltip, null, isDisabled ? /*#__PURE__*/_react.default.createElement(_Tooltip.StyledTooltipChildren, {
|
|
35
|
+
$isOnlyText: (0, _tooltip.isTextOnlyElement)(children)
|
|
36
|
+
}, children) : /*#__PURE__*/_react.default.createElement(_Popup.default, {
|
|
34
37
|
shouldShowOnHover: true,
|
|
35
38
|
content: content,
|
|
36
39
|
ref: tooltipRef
|
|
37
|
-
},
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_Tooltip.StyledTooltipChildren, {
|
|
41
|
+
$isOnlyText: (0, _tooltip.isTextOnlyElement)(children)
|
|
42
|
+
}, children))), [isDisabled, children, content]);
|
|
38
43
|
};
|
|
39
44
|
Tooltip.displayName = 'Tooltip';
|
|
40
45
|
var _default = exports.default = Tooltip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":["_react","_interopRequireWildcard","require","_Popup","_interopRequireDefault","_TooltipItem","_Tooltip","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Tooltip","item","children","isDisabled","itemWidth","tooltipRef","useRef","content","useMemo","isValidElement","createElement","width","text","headline","imageUrl","button","StyledTooltip","shouldShowOnHover","ref","displayName","_default","exports"],"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, { FC, isValidElement, ReactNode, useMemo, useRef, type CSSProperties } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { ITooltipItem } from '../../types/tooltip';\nimport Popup from '../popup/Popup';\nimport TooltipItem from './tooltip-item/TooltipItem';\nimport { StyledTooltip } from './Tooltip.styles';\n\nexport type TooltipProps = {\n /**\n * The elements that the tooltip should surround.\n */\n children: ReactNode;\n /**\n * The content that should be displayed.\n */\n item: ITooltipItem | ReactNode;\n /**\n * The width of an item.\n */\n itemWidth?: CSSProperties['width'];\n /**\n * whether the tooltip should be shown.\n */\n isDisabled?: boolean;\n};\n\nconst Tooltip: FC<TooltipProps> = ({ item, children, isDisabled, itemWidth }) => {\n const tooltipRef = useRef<PopupRef>(null);\n\n const content = useMemo(() => {\n if (isValidElement(item)) {\n return item;\n }\n\n return (\n <TooltipItem\n width={itemWidth}\n text={(item as ITooltipItem).text}\n headline={(item as ITooltipItem).headline}\n imageUrl={(item as ITooltipItem).imageUrl}\n button={(item as ITooltipItem).button}\n />\n );\n }, [item, itemWidth]);\n\n return useMemo(\n () => (\n <StyledTooltip>\n {isDisabled ? (\n children\n ) : (\n <Popup shouldShowOnHover content={content} ref={tooltipRef}>\n {children}\n </Popup>\n )}\n </StyledTooltip>\n ),\n [isDisabled, children, content],\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport default Tooltip;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAC,sBAAA,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["_react","_interopRequireWildcard","require","_tooltip","_Popup","_interopRequireDefault","_TooltipItem","_Tooltip","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Tooltip","item","children","isDisabled","itemWidth","tooltipRef","useRef","content","useMemo","isValidElement","createElement","width","text","headline","imageUrl","button","StyledTooltip","StyledTooltipChildren","$isOnlyText","isTextOnlyElement","shouldShowOnHover","ref","displayName","_default","exports"],"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, { FC, isValidElement, ReactNode, useMemo, useRef, type CSSProperties } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { ITooltipItem } from '../../types/tooltip';\nimport { isTextOnlyElement } from '../../utils/tooltip';\nimport Popup from '../popup/Popup';\nimport TooltipItem from './tooltip-item/TooltipItem';\nimport { StyledTooltip, StyledTooltipChildren } from './Tooltip.styles';\n\nexport type TooltipProps = {\n /**\n * The elements that the tooltip should surround.\n */\n children: ReactNode;\n /**\n * The content that should be displayed.\n */\n item: ITooltipItem | ReactNode;\n /**\n * The width of an item.\n */\n itemWidth?: CSSProperties['width'];\n /**\n * whether the tooltip should be shown.\n */\n isDisabled?: boolean;\n};\n\nconst Tooltip: FC<TooltipProps> = ({ item, children, isDisabled, itemWidth }) => {\n const tooltipRef = useRef<PopupRef>(null);\n\n const content = useMemo(() => {\n if (isValidElement(item)) {\n return item;\n }\n\n return (\n <TooltipItem\n width={itemWidth}\n text={(item as ITooltipItem).text}\n headline={(item as ITooltipItem).headline}\n imageUrl={(item as ITooltipItem).imageUrl}\n button={(item as ITooltipItem).button}\n />\n );\n }, [item, itemWidth]);\n\n return useMemo(\n () => (\n <StyledTooltip>\n {isDisabled ? (\n <StyledTooltipChildren $isOnlyText={isTextOnlyElement(children)}>\n {children}\n </StyledTooltipChildren>\n ) : (\n <Popup shouldShowOnHover content={content} ref={tooltipRef}>\n <StyledTooltipChildren $isOnlyText={isTextOnlyElement(children)}>\n {children}\n </StyledTooltipChildren>\n </Popup>\n )}\n </StyledTooltip>\n ),\n [isDisabled, children, content],\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport default Tooltip;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAwE,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EA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3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledTooltip = void 0;
|
|
7
|
-
var _styledComponents =
|
|
8
|
-
function
|
|
6
|
+
exports.StyledTooltipChildren = exports.StyledTooltip = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
10
|
const StyledTooltip = exports.StyledTooltip = _styledComponents.default.div``;
|
|
11
|
+
const StyledTooltipChildren = exports.StyledTooltipChildren = _styledComponents.default.div`
|
|
12
|
+
${({
|
|
13
|
+
$isOnlyText,
|
|
14
|
+
theme
|
|
15
|
+
}) => $isOnlyText && (0, _styledComponents.css)`
|
|
16
|
+
border-bottom-width: 1px;
|
|
17
|
+
border-bottom-style: dotted;
|
|
18
|
+
border-bottom-color: ${theme.text};
|
|
19
|
+
`}
|
|
20
|
+
`;
|
|
10
21
|
//# sourceMappingURL=Tooltip.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.js","names":["_styledComponents","
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledTooltip","exports","styled","div","StyledTooltipChildren","$isOnlyText","theme","css","text"],"sources":["../../../../src/components/tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledTooltip = styled.div``;\n\ntype StyledTooltipChildrenProps = WithTheme<{ $isOnlyText: boolean }>;\nexport const StyledTooltipChildren = styled.div<StyledTooltipChildrenProps>`\n ${({ $isOnlyText, theme }: StyledTooltipChildrenProps) =>\n $isOnlyText &&\n css`\n border-bottom-width: 1px;\n border-bottom-style: dotted;\n border-bottom-color: ${theme.text};\n `}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAGzC,MAAMW,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAI,EAAC;AAGlC,MAAMC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,GAAGF,yBAAM,CAACC,GAAgC;AAC5E,MAAM,CAAC;EAAEE,WAAW;EAAEC;AAAkC,CAAC,KACjDD,WAAW,IACX,IAAAE,qBAAG,CAAC;AACZ;AACA;AACA,mCAAmCD,KAAK,CAACE,IAAK;AAC9C,SAAU;AACV,CAAC","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -291,18 +291,6 @@ Object.defineProperty(exports, "SmallWaitCursor", {
|
|
|
291
291
|
return _SmallWaitCursor.default;
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
|
-
Object.defineProperty(exports, "SmallWaitCursorSize", {
|
|
295
|
-
enumerable: true,
|
|
296
|
-
get: function () {
|
|
297
|
-
return _SmallWaitCursor.SmallWaitCursorSize;
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
Object.defineProperty(exports, "SmallWaitCursorSpeed", {
|
|
301
|
-
enumerable: true,
|
|
302
|
-
get: function () {
|
|
303
|
-
return _SmallWaitCursor.SmallWaitCursorSpeed;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
294
|
Object.defineProperty(exports, "TagInput", {
|
|
307
295
|
enumerable: true,
|
|
308
296
|
get: function () {
|
|
@@ -396,7 +384,7 @@ var _SharingBar = _interopRequireDefault(require("./components/sharing-bar/Shari
|
|
|
396
384
|
var _Signature = _interopRequireDefault(require("./components/signature/Signature"));
|
|
397
385
|
var _SliderButton = _interopRequireDefault(require("./components/slider-button/SliderButton"));
|
|
398
386
|
var _Slider = _interopRequireDefault(require("./components/slider/Slider"));
|
|
399
|
-
var _SmallWaitCursor =
|
|
387
|
+
var _SmallWaitCursor = _interopRequireDefault(require("./components/small-wait-cursor/SmallWaitCursor"));
|
|
400
388
|
var _TagInput = _interopRequireDefault(require("./components/tag-input/TagInput"));
|
|
401
389
|
var _TextArea = _interopRequireDefault(require("./components/text-area/TextArea"));
|
|
402
390
|
var _Tooltip = _interopRequireDefault(require("./components/tooltip/Tooltip"));
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_fileDialog","_isTobitEmployee","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem, type ListItemProps } from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_fileDialog","_isTobitEmployee","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem, type ListItemProps } from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport { default as SmallWaitCursor } from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,GAAA,IAAAA,GAAA,CAAAf,UAAA,GAAAe,GAAA,KAAAd,OAAA,EAAAc,GAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isTextOnlyElement = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const isTextOnlyElement = element => {
|
|
9
|
+
if (typeof element === 'string') {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(element)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const validTags = ['p', 'span', 'div'];
|
|
16
|
+
if (!validTags.includes(element.type)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const {
|
|
20
|
+
children
|
|
21
|
+
} = element.props;
|
|
22
|
+
return typeof children === 'string';
|
|
23
|
+
};
|
|
24
|
+
exports.isTextOnlyElement = isTextOnlyElement;
|
|
25
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["_react","require","isTextOnlyElement","element","isValidElement","validTags","includes","type","children","props","exports"],"sources":["../../../src/utils/tooltip.ts"],"sourcesContent":["import { isValidElement, ReactNode, type ReactElement } from 'react';\n\nexport const isTextOnlyElement = (element: ReactNode): boolean => {\n if (typeof element === 'string') {\n return true;\n }\n\n if (!isValidElement(element)) {\n return false;\n }\n\n const validTags = ['p', 'span', 'div'];\n if (!validTags.includes(element.type as string)) {\n return false;\n }\n\n const { children } = (element as ReactElement).props;\n\n return typeof children === 'string';\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,iBAAiB,GAAIC,OAAkB,IAAc;EAC9D,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAI;EACf;EAEA,IAAI,eAAC,IAAAC,qBAAc,EAACD,OAAO,CAAC,EAAE;IAC1B,OAAO,KAAK;EAChB;EAEA,MAAME,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC;EACtC,IAAI,CAACA,SAAS,CAACC,QAAQ,CAACH,OAAO,CAACI,IAAc,CAAC,EAAE;IAC7C,OAAO,KAAK;EAChB;EAEA,MAAM;IAAEC;EAAS,CAAC,GAAIL,OAAO,CAAkBM,KAAK;EAEpD,OAAO,OAAOD,QAAQ,KAAK,QAAQ;AACvC,CAAC;AAACE,OAAA,CAAAR,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -3,8 +3,8 @@ import { AnimatePresence } from 'framer-motion';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useTheme } from 'styled-components';
|
|
5
5
|
import Icon from '../icon/Icon';
|
|
6
|
-
import SmallWaitCursor from '../small-wait-cursor/SmallWaitCursor';
|
|
7
6
|
import { StyledIconWrapper, StyledMotionButton, StyledMotionChildrenWrapper, StyledMotionWaitCursorWrapper } from './Button.styles';
|
|
7
|
+
import WaitCursor from './wait-cursor/WaitCursor';
|
|
8
8
|
const Button = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
children,
|
|
@@ -65,10 +65,8 @@ const Button = _ref => {
|
|
|
65
65
|
transition: {
|
|
66
66
|
duration: 0.2
|
|
67
67
|
}
|
|
68
|
-
}, /*#__PURE__*/React.createElement(
|
|
69
|
-
|
|
70
|
-
shouldHideBackground: true,
|
|
71
|
-
size: 26
|
|
68
|
+
}, /*#__PURE__*/React.createElement(WaitCursor, {
|
|
69
|
+
shouldHideBackground: true
|
|
72
70
|
})), !shouldShowWaitCursor && children && /*#__PURE__*/React.createElement(StyledMotionChildrenWrapper, {
|
|
73
71
|
animate: {
|
|
74
72
|
opacity: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["clsx","AnimatePresence","React","useTheme","Icon","
|
|
1
|
+
{"version":3,"file":"Button.js","names":["clsx","AnimatePresence","React","useTheme","Icon","StyledIconWrapper","StyledMotionButton","StyledMotionChildrenWrapper","StyledMotionWaitCursorWrapper","WaitCursor","Button","_ref","children","className","icon","isDisabled","isSecondary","onClick","shouldShowWaitCursor","shouldStopPropagation","ShouldShowTextAsRobotoMedium","handleClick","event","stopPropagation","buttonClasses","theme","createElement","$ShouldShowTextAsRobotoMedium","disabled","$isDisabled","$hasChildren","$hasIcon","$isSecondary","whileTap","backgroundColor","whileHover","initial","color","icons","animate","opacity","width","exit","key","style","overflow","transition","duration","shouldHideBackground","displayName"],"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEventHandler, ReactNode } from 'react';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport {\n StyledIconWrapper,\n StyledMotionButton,\n StyledMotionChildrenWrapper,\n StyledMotionWaitCursorWrapper,\n} from './Button.styles';\nimport WaitCursor from './wait-cursor/WaitCursor';\n\nexport type ButtonProps = {\n /**\n * The label of the button\n */\n children?: ReactNode;\n /**\n * Additional class names for the button element\n */\n className?: string;\n /**\n * An icon that is displayed on the left-hand side of the button text\n */\n icon?: string;\n /**\n * Disables the button so that it cannot be clicked anymore\n */\n isDisabled?: boolean;\n /**\n * Displays the button in the secondary style\n */\n isSecondary?: boolean;\n /**\n * Function to be executed when the button is clicked\n */\n onClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * Whether the text should be 'Roboto Medium'\n */\n ShouldShowTextAsRobotoMedium?: boolean;\n /**\n * Shows a wait cursor instead of button text\n */\n shouldShowWaitCursor?: boolean;\n /**\n * Stops event propagation on click\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Button: FC<ButtonProps> = ({\n children,\n className,\n icon,\n isDisabled,\n isSecondary,\n onClick,\n shouldShowWaitCursor,\n shouldStopPropagation,\n ShouldShowTextAsRobotoMedium = true,\n}) => {\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n onClick(event);\n };\n\n const buttonClasses = clsx('beta-chayns-button ellipsis', className);\n\n const theme: Theme = useTheme();\n\n return (\n <StyledMotionButton\n $ShouldShowTextAsRobotoMedium={ShouldShowTextAsRobotoMedium}\n className={buttonClasses}\n disabled={isDisabled}\n $isDisabled={isDisabled}\n $hasChildren={!!children}\n $hasIcon={typeof icon === 'string' && icon !== ''}\n $isSecondary={isSecondary}\n onClick={handleClick}\n whileTap={\n isDisabled ? {} : { backgroundColor: isSecondary ? theme['201'] : theme['407'] }\n }\n whileHover={\n isDisabled ? {} : { backgroundColor: isSecondary ? theme['203'] : theme['409'] }\n }\n >\n <AnimatePresence initial={false}>\n {icon && (\n <StyledIconWrapper>\n <Icon color=\"white\" icons={[icon]} />\n </StyledIconWrapper>\n )}\n {shouldShowWaitCursor && (\n <StyledMotionWaitCursorWrapper\n animate={{ opacity: 1, width: 40 }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"wait-cursor\"\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n <WaitCursor shouldHideBackground />\n </StyledMotionWaitCursorWrapper>\n )}\n {!shouldShowWaitCursor && children && (\n <StyledMotionChildrenWrapper\n animate={{ opacity: 1, width: 'auto' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"children\"\n // style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2 }}\n >\n {children}\n </StyledMotionChildrenWrapper>\n )}\n </AnimatePresence>\n </StyledMotionButton>\n );\n};\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,eAAe,QAAQ,eAAe;AAC/C,OAAOC,KAAK,MAA4C,OAAO;AAC/D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;AAE7B,CAAC;AAEDF,MAAM,CAACuC,WAAW,GAAG,QAAQ;AAE7B,eAAevC,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledWaitCursor, StyledWaitCursorBackground, StyledWaitCursorWaitCursor } from './WaitCursor.styles';
|
|
3
|
+
const WaitCursor = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
shouldHideBackground = false,
|
|
6
|
+
shouldHideWaitCursor = false
|
|
7
|
+
} = _ref;
|
|
8
|
+
return /*#__PURE__*/React.createElement(StyledWaitCursor, {
|
|
9
|
+
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
10
|
+
}, /*#__PURE__*/React.createElement(StyledWaitCursorWaitCursor, null), !shouldHideBackground && /*#__PURE__*/React.createElement(StyledWaitCursorBackground, null));
|
|
11
|
+
};
|
|
12
|
+
WaitCursor.displayName = 'WaitCursor';
|
|
13
|
+
export default WaitCursor;
|
|
14
|
+
//# sourceMappingURL=WaitCursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitCursor.js","names":["React","StyledWaitCursor","StyledWaitCursorBackground","StyledWaitCursorWaitCursor","WaitCursor","_ref","shouldHideBackground","shouldHideWaitCursor","createElement","$shouldShowWaitCursor","displayName"],"sources":["../../../../../src/components/button/wait-cursor/WaitCursor.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n StyledWaitCursor,\n StyledWaitCursorBackground,\n StyledWaitCursorWaitCursor,\n} from './WaitCursor.styles';\n\nexport type WaitCursorProps = {\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n};\n\nconst WaitCursor: FC<WaitCursorProps> = ({\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n}) => (\n <StyledWaitCursor $shouldShowWaitCursor={!shouldHideWaitCursor}>\n <StyledWaitCursorWaitCursor />\n {!shouldHideBackground && <StyledWaitCursorBackground />}\n </StyledWaitCursor>\n);\n\nWaitCursor.displayName = 'WaitCursor';\n\nexport default WaitCursor;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SACIC,gBAAgB,EAChBC,0BAA0B,EAC1BC,0BAA0B,QACvB,qBAAqB;AAU5B,MAAMC,UAA+B,GAAGC,IAAA;EAAA,IAAC;IACrCC,oBAAoB,GAAG,KAAK;IAC5BC,oBAAoB,GAAG;EAC3B,CAAC,GAAAF,IAAA;EAAA,oBACGL,KAAA,CAAAQ,aAAA,CAACP,gBAAgB;IAACQ,qBAAqB,EAAE,CAACF;EAAqB,gBAC3DP,KAAA,CAAAQ,aAAA,CAACL,0BAA0B,MAAE,CAAC,EAC7B,CAACG,oBAAoB,iBAAIN,KAAA,CAAAQ,aAAA,CAACN,0BAA0B,MAAE,CACzC,CAAC;AAAA,CACtB;AAEDE,UAAU,CAACM,WAAW,GAAG,YAAY;AAErC,eAAeN,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import styled, { keyframes } from 'styled-components';
|
|
2
|
+
export const StyledWaitCursor = styled.div`
|
|
3
|
+
position: relative;
|
|
4
|
+
height: 26px;
|
|
5
|
+
width: 26px;
|
|
6
|
+
opacity: ${_ref => {
|
|
7
|
+
let {
|
|
8
|
+
$shouldShowWaitCursor
|
|
9
|
+
} = _ref;
|
|
10
|
+
return $shouldShowWaitCursor ? 1 : 0;
|
|
11
|
+
}};
|
|
12
|
+
`;
|
|
13
|
+
export const StyledWaitCursorBackground = styled.div`
|
|
14
|
+
background-color: white;
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
width: 100%;
|
|
18
|
+
position: relative;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
box-shadow:
|
|
21
|
+
0 4px 12px 0 rgba(0, 0, 0, 0.2),
|
|
22
|
+
0 1px 1px rgba(0, 0, 0, 0.2);
|
|
23
|
+
`;
|
|
24
|
+
const spin = keyframes`
|
|
25
|
+
from {
|
|
26
|
+
transform: rotate(0deg);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
transform: rotate(360deg);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
export const StyledWaitCursorWaitCursor = styled.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 5px;
|
|
35
|
+
left: 5px;
|
|
36
|
+
z-index: 2;
|
|
37
|
+
border-style: solid;
|
|
38
|
+
border-width: 3px;
|
|
39
|
+
border-color: white;
|
|
40
|
+
height: ${26 - 10}px;
|
|
41
|
+
width: ${26 - 10}px;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
border-top: 3px solid transparent;
|
|
45
|
+
|
|
46
|
+
animation: ${spin} 1s linear infinite;
|
|
47
|
+
`;
|
|
48
|
+
//# sourceMappingURL=WaitCursor.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitCursor.styles.js","names":["styled","keyframes","StyledWaitCursor","div","_ref","$shouldShowWaitCursor","StyledWaitCursorBackground","spin","StyledWaitCursorWaitCursor"],"sources":["../../../../../src/components/button/wait-cursor/WaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledWaitCursorProps = WithTheme<{\n $shouldShowWaitCursor: boolean;\n}>;\n\nexport const StyledWaitCursor = styled.div<StyledWaitCursorProps>`\n position: relative;\n height: 26px;\n width: 26px;\n opacity: ${({ $shouldShowWaitCursor }) => ($shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledWaitCursorBackground = styled.div<StyledWaitCursorBackgroundProps>`\n background-color: white;\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n box-shadow:\n 0 4px 12px 0 rgba(0, 0, 0, 0.2),\n 0 1px 1px rgba(0, 0, 0, 0.2);\n`;\n\ntype StyledWaitCursorWaitCursorProps = WithTheme<unknown>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledWaitCursorWaitCursor = styled.div<StyledWaitCursorWaitCursorProps>`\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: white;\n height: ${26 - 10}px;\n width: ${26 - 10}px;\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} 1s linear infinite;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAOrD,OAAO,MAAMC,gBAAgB,GAAGF,MAAM,CAACG,GAA2B;AAClE;AACA;AACA;AACA,eAAeC,IAAA;EAAA,IAAC;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAAA,OAAMC,qBAAqB,GAAG,CAAC,GAAG,CAAC;AAAA,CAAE;AAC9E,CAAC;AAID,OAAO,MAAMC,0BAA0B,GAAGN,MAAM,CAACG,GAAqC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,MAAMI,IAAI,GAAGN,SAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMO,0BAA0B,GAAGR,MAAM,CAACG,GAAqC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,EAAE,GAAG,EAAG;AACtB,aAAa,EAAE,GAAG,EAAG;AACrB;AACA;AACA;AACA;AACA,iBAAiBI,IAAK;AACtB,CAAC","ignoreList":[]}
|
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
// noinspection JSUnusedGlobalSymbols
|
|
2
|
-
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { StyledSmallWaitCursor, StyledSmallWaitCursorBackground, StyledSmallWaitCursorWaitCursor } from './SmallWaitCursor.styles';
|
|
5
|
-
export let SmallWaitCursorSize = /*#__PURE__*/function (SmallWaitCursorSize) {
|
|
6
|
-
SmallWaitCursorSize[SmallWaitCursorSize["Small"] = 16] = "Small";
|
|
7
|
-
SmallWaitCursorSize[SmallWaitCursorSize["Medium"] = 30] = "Medium";
|
|
8
|
-
return SmallWaitCursorSize;
|
|
9
|
-
}({});
|
|
10
|
-
export let SmallWaitCursorSpeed = /*#__PURE__*/function (SmallWaitCursorSpeed) {
|
|
11
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Slow"] = 1.5] = "Slow";
|
|
12
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Medium"] = 1] = "Medium";
|
|
13
|
-
SmallWaitCursorSpeed[SmallWaitCursorSpeed["Fast"] = 0.5] = "Fast";
|
|
14
|
-
return SmallWaitCursorSpeed;
|
|
15
|
-
}({});
|
|
16
3
|
const SmallWaitCursor = _ref => {
|
|
17
4
|
let {
|
|
18
|
-
color,
|
|
19
5
|
shouldHideBackground = false,
|
|
20
|
-
shouldHideWaitCursor = false
|
|
21
|
-
size = SmallWaitCursorSize.Medium,
|
|
22
|
-
speed = SmallWaitCursorSpeed.Medium
|
|
6
|
+
shouldHideWaitCursor = false
|
|
23
7
|
} = _ref;
|
|
24
8
|
return /*#__PURE__*/React.createElement(StyledSmallWaitCursor, {
|
|
25
|
-
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
26
|
-
|
|
27
|
-
}, /*#__PURE__*/React.createElement(StyledSmallWaitCursorWaitCursor, {
|
|
28
|
-
$color: color,
|
|
29
|
-
$size: size,
|
|
30
|
-
$speed: speed
|
|
31
|
-
}), !shouldHideBackground && /*#__PURE__*/React.createElement(StyledSmallWaitCursorBackground, null));
|
|
9
|
+
$shouldShowWaitCursor: !shouldHideWaitCursor
|
|
10
|
+
}, /*#__PURE__*/React.createElement(StyledSmallWaitCursorWaitCursor, null), !shouldHideBackground && /*#__PURE__*/React.createElement(StyledSmallWaitCursorBackground, null));
|
|
32
11
|
};
|
|
33
12
|
SmallWaitCursor.displayName = 'SmallWaitCursor';
|
|
34
13
|
export default SmallWaitCursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmallWaitCursor.js","names":["React","StyledSmallWaitCursor","StyledSmallWaitCursorBackground","StyledSmallWaitCursorWaitCursor","
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.js","names":["React","StyledSmallWaitCursor","StyledSmallWaitCursorBackground","StyledSmallWaitCursorWaitCursor","SmallWaitCursor","_ref","shouldHideBackground","shouldHideWaitCursor","createElement","$shouldShowWaitCursor","displayName"],"sources":["../../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\nexport type SmallWaitCursorProps = {\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n};\n\nconst SmallWaitCursor: FC<SmallWaitCursorProps> = ({\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n}) => (\n <StyledSmallWaitCursor $shouldShowWaitCursor={!shouldHideWaitCursor}>\n <StyledSmallWaitCursorWaitCursor />\n {!shouldHideBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n);\n\nSmallWaitCursor.displayName = 'SmallWaitCursor';\n\nexport default SmallWaitCursor;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SACIC,qBAAqB,EACrBC,+BAA+B,EAC/BC,+BAA+B,QAC5B,0BAA0B;AAUjC,MAAMC,eAAyC,GAAGC,IAAA;EAAA,IAAC;IAC/CC,oBAAoB,GAAG,KAAK;IAC5BC,oBAAoB,GAAG;EAC3B,CAAC,GAAAF,IAAA;EAAA,oBACGL,KAAA,CAAAQ,aAAA,CAACP,qBAAqB;IAACQ,qBAAqB,EAAE,CAACF;EAAqB,gBAChEP,KAAA,CAAAQ,aAAA,CAACL,+BAA+B,MAAE,CAAC,EAClC,CAACG,oBAAoB,iBAAIN,KAAA,CAAAQ,aAAA,CAACN,+BAA+B,MAAE,CACzC,CAAC;AAAA,CAC3B;AAEDE,eAAe,CAACM,WAAW,GAAG,iBAAiB;AAE/C,eAAeN,eAAe","ignoreList":[]}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import styled, { keyframes } from 'styled-components';
|
|
2
2
|
export const StyledSmallWaitCursor = styled.div`
|
|
3
3
|
position: relative;
|
|
4
|
-
height:
|
|
5
|
-
|
|
6
|
-
$
|
|
7
|
-
} = _ref;
|
|
8
|
-
return $size;
|
|
9
|
-
}}px;
|
|
10
|
-
width: ${_ref2 => {
|
|
11
|
-
let {
|
|
12
|
-
$size
|
|
13
|
-
} = _ref2;
|
|
14
|
-
return $size;
|
|
15
|
-
}}px;
|
|
16
|
-
opacity: ${_ref3 => {
|
|
4
|
+
height: 30px;
|
|
5
|
+
width: 30px;
|
|
6
|
+
opacity: ${_ref => {
|
|
17
7
|
let {
|
|
18
8
|
$shouldShowWaitCursor
|
|
19
|
-
} =
|
|
9
|
+
} = _ref;
|
|
20
10
|
return $shouldShowWaitCursor ? 1 : 0;
|
|
21
11
|
}};
|
|
22
12
|
`;
|
|
@@ -46,34 +36,18 @@ export const StyledSmallWaitCursorWaitCursor = styled.div`
|
|
|
46
36
|
z-index: 2;
|
|
47
37
|
border-style: solid;
|
|
48
38
|
border-width: 3px;
|
|
49
|
-
border-color: ${
|
|
39
|
+
border-color: ${_ref2 => {
|
|
50
40
|
let {
|
|
51
|
-
$color,
|
|
52
41
|
theme
|
|
53
|
-
} =
|
|
54
|
-
return
|
|
55
|
-
}};
|
|
56
|
-
height: ${_ref5 => {
|
|
57
|
-
let {
|
|
58
|
-
$size
|
|
59
|
-
} = _ref5;
|
|
60
|
-
return `${$size - 10}px`;
|
|
61
|
-
}};
|
|
62
|
-
width: ${_ref6 => {
|
|
63
|
-
let {
|
|
64
|
-
$size
|
|
65
|
-
} = _ref6;
|
|
66
|
-
return `${$size - 10}px`;
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return theme.primary;
|
|
67
44
|
}};
|
|
45
|
+
height: ${30 - 10}px;
|
|
46
|
+
width: ${30 - 10}px;
|
|
68
47
|
border-radius: 50%;
|
|
69
48
|
display: inline-block;
|
|
70
49
|
border-top: 3px solid transparent;
|
|
71
50
|
|
|
72
|
-
animation: ${spin}
|
|
73
|
-
let {
|
|
74
|
-
$speed
|
|
75
|
-
} = _ref7;
|
|
76
|
-
return $speed;
|
|
77
|
-
}}s linear infinite;
|
|
51
|
+
animation: ${spin} 1s linear infinite;
|
|
78
52
|
`;
|
|
79
53
|
//# sourceMappingURL=SmallWaitCursor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmallWaitCursor.styles.js","names":["styled","keyframes","StyledSmallWaitCursor","div","_ref","$
|
|
1
|
+
{"version":3,"file":"SmallWaitCursor.styles.js","names":["styled","keyframes","StyledSmallWaitCursor","div","_ref","$shouldShowWaitCursor","StyledSmallWaitCursorBackground","spin","StyledSmallWaitCursorWaitCursor","_ref2","theme","primary"],"sources":["../../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n $shouldShowWaitCursor: boolean;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: 30px;\n width: 30px;\n opacity: ${({ $shouldShowWaitCursor }) => ($shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: white;\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n box-shadow:\n 0 4px 12px 0 rgba(0, 0, 0, 0.2),\n 0 1px 1px rgba(0, 0, 0, 0.2);\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<unknown>;\n\nconst spin = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nexport const StyledSmallWaitCursorWaitCursor = styled.div<StyledSmallWaitCursorWaitCursorProps>`\n position: absolute;\n top: 5px;\n left: 5px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ theme }: StyledSmallWaitCursorWaitCursorProps) => theme.primary};\n height: ${30 - 10}px;\n width: ${30 - 10}px;\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} 1s linear infinite;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAOrD,OAAO,MAAMC,qBAAqB,GAAGF,MAAM,CAACG,GAAgC;AAC5E;AACA;AACA;AACA,eAAeC,IAAA;EAAA,IAAC;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAAA,OAAMC,qBAAqB,GAAG,CAAC,GAAG,CAAC;AAAA,CAAE;AAC9E,CAAC;AAID,OAAO,MAAMC,+BAA+B,GAAGN,MAAM,CAACG,GAA0C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,MAAMI,IAAI,GAAGN,SAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMO,+BAA+B,GAAGR,MAAM,CAACG,GAA0C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoBM,KAAA;EAAA,IAAC;IAAEC;EAA4C,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK,CAACC,OAAO;AAAA,CAAC;AACvF,cAAc,EAAE,GAAG,EAAG;AACtB,aAAa,EAAE,GAAG,EAAG;AACrB;AACA;AACA;AACA;AACA,iBAAiBJ,IAAK;AACtB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { isValidElement, useMemo, useRef } from 'react';
|
|
2
|
+
import { isTextOnlyElement } from '../../utils/tooltip';
|
|
2
3
|
import Popup from '../popup/Popup';
|
|
3
4
|
import TooltipItem from './tooltip-item/TooltipItem';
|
|
4
|
-
import { StyledTooltip } from './Tooltip.styles';
|
|
5
|
+
import { StyledTooltip, StyledTooltipChildren } from './Tooltip.styles';
|
|
5
6
|
const Tooltip = _ref => {
|
|
6
7
|
let {
|
|
7
8
|
item,
|
|
@@ -22,11 +23,15 @@ const Tooltip = _ref => {
|
|
|
22
23
|
button: item.button
|
|
23
24
|
});
|
|
24
25
|
}, [item, itemWidth]);
|
|
25
|
-
return useMemo(() => /*#__PURE__*/React.createElement(StyledTooltip, null, isDisabled ?
|
|
26
|
+
return useMemo(() => /*#__PURE__*/React.createElement(StyledTooltip, null, isDisabled ? /*#__PURE__*/React.createElement(StyledTooltipChildren, {
|
|
27
|
+
$isOnlyText: isTextOnlyElement(children)
|
|
28
|
+
}, children) : /*#__PURE__*/React.createElement(Popup, {
|
|
26
29
|
shouldShowOnHover: true,
|
|
27
30
|
content: content,
|
|
28
31
|
ref: tooltipRef
|
|
29
|
-
},
|
|
32
|
+
}, /*#__PURE__*/React.createElement(StyledTooltipChildren, {
|
|
33
|
+
$isOnlyText: isTextOnlyElement(children)
|
|
34
|
+
}, children))), [isDisabled, children, content]);
|
|
30
35
|
};
|
|
31
36
|
Tooltip.displayName = 'Tooltip';
|
|
32
37
|
export default Tooltip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":["React","isValidElement","useMemo","useRef","Popup","TooltipItem","StyledTooltip","Tooltip","_ref","item","children","isDisabled","itemWidth","tooltipRef","content","createElement","width","text","headline","imageUrl","button","shouldShowOnHover","ref","displayName"],"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, { FC, isValidElement, ReactNode, useMemo, useRef, type CSSProperties } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { ITooltipItem } from '../../types/tooltip';\nimport Popup from '../popup/Popup';\nimport TooltipItem from './tooltip-item/TooltipItem';\nimport { StyledTooltip } from './Tooltip.styles';\n\nexport type TooltipProps = {\n /**\n * The elements that the tooltip should surround.\n */\n children: ReactNode;\n /**\n * The content that should be displayed.\n */\n item: ITooltipItem | ReactNode;\n /**\n * The width of an item.\n */\n itemWidth?: CSSProperties['width'];\n /**\n * whether the tooltip should be shown.\n */\n isDisabled?: boolean;\n};\n\nconst Tooltip: FC<TooltipProps> = ({ item, children, isDisabled, itemWidth }) => {\n const tooltipRef = useRef<PopupRef>(null);\n\n const content = useMemo(() => {\n if (isValidElement(item)) {\n return item;\n }\n\n return (\n <TooltipItem\n width={itemWidth}\n text={(item as ITooltipItem).text}\n headline={(item as ITooltipItem).headline}\n imageUrl={(item as ITooltipItem).imageUrl}\n button={(item as ITooltipItem).button}\n />\n );\n }, [item, itemWidth]);\n\n return useMemo(\n () => (\n <StyledTooltip>\n {isDisabled ? (\n children\n ) : (\n <Popup shouldShowOnHover content={content} ref={tooltipRef}>\n {children}\n </Popup>\n )}\n </StyledTooltip>\n ),\n [isDisabled, children, content],\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport default Tooltip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,cAAc,EAAaC,OAAO,EAAEC,MAAM,QAA4B,OAAO;AAGjG,OAAOC,KAAK,MAAM,gBAAgB;AAClC,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,aAAa,QAAQ,kBAAkB;
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["React","isValidElement","useMemo","useRef","isTextOnlyElement","Popup","TooltipItem","StyledTooltip","StyledTooltipChildren","Tooltip","_ref","item","children","isDisabled","itemWidth","tooltipRef","content","createElement","width","text","headline","imageUrl","button","$isOnlyText","shouldShowOnHover","ref","displayName"],"sources":["../../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, { FC, isValidElement, ReactNode, useMemo, useRef, type CSSProperties } from 'react';\nimport type { PopupRef } from '../../types/popup';\nimport type { ITooltipItem } from '../../types/tooltip';\nimport { isTextOnlyElement } from '../../utils/tooltip';\nimport Popup from '../popup/Popup';\nimport TooltipItem from './tooltip-item/TooltipItem';\nimport { StyledTooltip, StyledTooltipChildren } from './Tooltip.styles';\n\nexport type TooltipProps = {\n /**\n * The elements that the tooltip should surround.\n */\n children: ReactNode;\n /**\n * The content that should be displayed.\n */\n item: ITooltipItem | ReactNode;\n /**\n * The width of an item.\n */\n itemWidth?: CSSProperties['width'];\n /**\n * whether the tooltip should be shown.\n */\n isDisabled?: boolean;\n};\n\nconst Tooltip: FC<TooltipProps> = ({ item, children, isDisabled, itemWidth }) => {\n const tooltipRef = useRef<PopupRef>(null);\n\n const content = useMemo(() => {\n if (isValidElement(item)) {\n return item;\n }\n\n return (\n <TooltipItem\n width={itemWidth}\n text={(item as ITooltipItem).text}\n headline={(item as ITooltipItem).headline}\n imageUrl={(item as ITooltipItem).imageUrl}\n button={(item as ITooltipItem).button}\n />\n );\n }, [item, itemWidth]);\n\n return useMemo(\n () => (\n <StyledTooltip>\n {isDisabled ? (\n <StyledTooltipChildren $isOnlyText={isTextOnlyElement(children)}>\n {children}\n </StyledTooltipChildren>\n ) : (\n <Popup shouldShowOnHover content={content} ref={tooltipRef}>\n <StyledTooltipChildren $isOnlyText={isTextOnlyElement(children)}>\n {children}\n </StyledTooltipChildren>\n </Popup>\n )}\n </StyledTooltip>\n ),\n [isDisabled, children, content],\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport default Tooltip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,cAAc,EAAaC,OAAO,EAAEC,MAAM,QAA4B,OAAO;AAGjG,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,OAAOC,KAAK,MAAM,gBAAgB;AAClC,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,aAAa,EAAEC,q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led from 'styled-components';
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
2
|
export const StyledTooltip = styled.div``;
|
|
3
|
+
export const StyledTooltipChildren = styled.div`
|
|
4
|
+
${_ref => {
|
|
5
|
+
let {
|
|
6
|
+
$isOnlyText,
|
|
7
|
+
theme
|
|
8
|
+
} = _ref;
|
|
9
|
+
return $isOnlyText && css`
|
|
10
|
+
border-bottom-width: 1px;
|
|
11
|
+
border-bottom-style: dotted;
|
|
12
|
+
border-bottom-color: ${theme.text};
|
|
13
|
+
`;
|
|
14
|
+
}}
|
|
15
|
+
`;
|
|
3
16
|
//# sourceMappingURL=Tooltip.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.js","names":["styled","StyledTooltip","div"],"sources":["../../../../src/components/tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltip = styled.div``;\n"],"mappings":"AAAA,OAAOA,MAAM,
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.js","names":["styled","css","StyledTooltip","div","StyledTooltipChildren","_ref","$isOnlyText","theme","text"],"sources":["../../../../src/components/tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledTooltip = styled.div``;\n\ntype StyledTooltipChildrenProps = WithTheme<{ $isOnlyText: boolean }>;\nexport const StyledTooltipChildren = styled.div<StyledTooltipChildrenProps>`\n ${({ $isOnlyText, theme }: StyledTooltipChildrenProps) =>\n $isOnlyText &&\n css`\n border-bottom-width: 1px;\n border-bottom-style: dotted;\n border-bottom-color: ${theme.text};\n `}\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,OAAO,MAAMC,aAAa,GAAGF,MAAM,CAACG,GAAI,EAAC;AAGzC,OAAO,MAAMC,qBAAqB,GAAGJ,MAAM,CAACG,GAAgC;AAC5E,MAAME,IAAA;EAAA,IAAC;IAAEC,WAAW;IAAEC;EAAkC,CAAC,GAAAF,IAAA;EAAA,OACjDC,WAAW,IACXL,GAAI;AACZ;AACA;AACA,mCAAmCM,KAAK,CAACC,IAAK;AAC9C,SAAS;AAAA,CAAC;AACV,CAAC","ignoreList":[]}
|
package/lib/esm/index.js
CHANGED
|
@@ -38,7 +38,7 @@ export { default as SharingBar } from './components/sharing-bar/SharingBar';
|
|
|
38
38
|
export { default as Signature } from './components/signature/Signature';
|
|
39
39
|
export { default as SliderButton } from './components/slider-button/SliderButton';
|
|
40
40
|
export { default as Slider } from './components/slider/Slider';
|
|
41
|
-
export { default as SmallWaitCursor
|
|
41
|
+
export { default as SmallWaitCursor } from './components/small-wait-cursor/SmallWaitCursor';
|
|
42
42
|
export { default as TagInput } from './components/tag-input/TagInput';
|
|
43
43
|
export { default as TextArea } from './components/text-area/TextArea';
|
|
44
44
|
export { default as Tooltip } from './components/tooltip/Tooltip';
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","ComboBox","ContentCard","ContextMenu","FileInput","FilterButtons","GridImage","Icon","Input","List","ListItemContent","ListItem","MentionFinder","NumberInput","Popup","PopupContent","ProgressBar","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","ComboBox","ContentCard","ContextMenu","FileInput","FilterButtons","GridImage","Icon","Input","List","ListItemContent","ListItem","MentionFinder","NumberInput","Popup","PopupContent","ProgressBar","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ComboBoxDirection","ContentCardType","ContextMenuAlignment","FilterButtonItemShape","FilterButtonSize","ClampPosition","getFileAsArrayBuffer","selectFiles","isTobitEmployee","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem, type ListItemProps } from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport { default as SmallWaitCursor } from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SACIC,WAAW,EACXP,OAAO,IAAIQ,YAAY,QACpB,gDAAgD;AACvD,SAASR,OAAO,IAAIS,KAAK,QAAQ,0BAA0B;AAC3D,SAAST,OAAO,IAAIU,MAAM,QAAQ,4BAA4B;AAC9D,SAASV,OAAO,IAAIW,QAAQ,QAAQ,gCAAgC;AACpE,SAASX,OAAO,IAAIY,mBAAmB,QAAQ,wDAAwD;AAKvG,SAASZ,OAAO,IAAIa,QAAQ,QAAQ,gCAAgC;AAEpE,SAASb,OAAO,IAAIc,WAAW,QAAQ,uCAAuC;AAC9E,SAASd,OAAO,IAAIe,WAAW,QAAQ,uCAAuC;AAC9E,SAASf,OAAO,IAAIgB,SAAS,QAAQ,mCAAmC;AACxE,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,2CAA2C;AACpF,SAASjB,OAAO,IAAIkB,SAAS,QAAQ,mCAAmC;AACxE,SAASlB,OAAO,IAAImB,IAAI,QAAQ,wBAAwB;AACxD,SAASnB,OAAO,IAAIoB,KAAK,QAAQ,0BAA0B;AAC3D,SAASpB,OAAO,IAAIqB,IAAI,QAAQ,wBAAwB;AACxD,SAASrB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,2BAA2B;AACvE,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,oBAAoB,QAAQ,qBAAqB;AAG1D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAU/E,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AACtE,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,UAAU,QAAQ,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isValidElement } from 'react';
|
|
2
|
+
export const isTextOnlyElement = element => {
|
|
3
|
+
if (typeof element === 'string') {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if (! /*#__PURE__*/isValidElement(element)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const validTags = ['p', 'span', 'div'];
|
|
10
|
+
if (!validTags.includes(element.type)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const {
|
|
14
|
+
children
|
|
15
|
+
} = element.props;
|
|
16
|
+
return typeof children === 'string';
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["isValidElement","isTextOnlyElement","element","validTags","includes","type","children","props"],"sources":["../../../src/utils/tooltip.ts"],"sourcesContent":["import { isValidElement, ReactNode, type ReactElement } from 'react';\n\nexport const isTextOnlyElement = (element: ReactNode): boolean => {\n if (typeof element === 'string') {\n return true;\n }\n\n if (!isValidElement(element)) {\n return false;\n }\n\n const validTags = ['p', 'span', 'div'];\n if (!validTags.includes(element.type as string)) {\n return false;\n }\n\n const { children } = (element as ReactElement).props;\n\n return typeof children === 'string';\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAsC,OAAO;AAEpE,OAAO,MAAMC,iBAAiB,GAAIC,OAAkB,IAAc;EAC9D,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAI;EACf;EAEA,IAAI,eAACF,cAAc,CAACE,OAAO,CAAC,EAAE;IAC1B,OAAO,KAAK;EAChB;EAEA,MAAMC,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC;EACtC,IAAI,CAACA,SAAS,CAACC,QAAQ,CAACF,OAAO,CAACG,IAAc,CAAC,EAAE;IAC7C,OAAO,KAAK;EAChB;EAEA,MAAM;IAAEC;EAAS,CAAC,GAAIJ,OAAO,CAAkBK,KAAK;EAEpD,OAAO,OAAOD,QAAQ,KAAK,QAAQ;AACvC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export type WaitCursorProps = {
|
|
3
|
+
shouldHideBackground?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Specifies whether the wait cursor should be displayed.
|
|
6
|
+
*/
|
|
7
|
+
shouldHideWaitCursor?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const WaitCursor: FC<WaitCursorProps>;
|
|
10
|
+
export default WaitCursor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';
|
|
3
|
+
type StyledWaitCursorProps = WithTheme<{
|
|
4
|
+
$shouldShowWaitCursor: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const StyledWaitCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledWaitCursorProps>> & string;
|
|
7
|
+
export declare const StyledWaitCursorBackground: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
8
|
+
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const StyledWaitCursorWaitCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
|
+
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
12
|
+
}>> & string;
|
|
13
|
+
export {};
|
|
@@ -1,31 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare enum SmallWaitCursorSize {
|
|
3
|
-
Small = 16,
|
|
4
|
-
Medium = 30
|
|
5
|
-
}
|
|
6
|
-
export declare enum SmallWaitCursorSpeed {
|
|
7
|
-
Slow = 1.5,
|
|
8
|
-
Medium = 1,
|
|
9
|
-
Fast = 0.5
|
|
10
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
11
2
|
export type SmallWaitCursorProps = {
|
|
12
|
-
color?: CSSProperties['color'];
|
|
13
|
-
/**
|
|
14
|
-
* Specifies whether the wait cursor should be displayed with a background.
|
|
15
|
-
*/
|
|
16
3
|
shouldHideBackground?: boolean;
|
|
17
4
|
/**
|
|
18
5
|
* Specifies whether the wait cursor should be displayed.
|
|
19
6
|
*/
|
|
20
7
|
shouldHideWaitCursor?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.
|
|
23
|
-
*/
|
|
24
|
-
size?: SmallWaitCursorSize | number;
|
|
25
|
-
/**
|
|
26
|
-
* The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.
|
|
27
|
-
*/
|
|
28
|
-
speed?: SmallWaitCursorSpeed;
|
|
29
8
|
};
|
|
30
9
|
declare const SmallWaitCursor: FC<SmallWaitCursorProps>;
|
|
31
10
|
export default SmallWaitCursor;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
3
|
-
import type { SmallWaitCursorProps, SmallWaitCursorSize, SmallWaitCursorSpeed } from './SmallWaitCursor';
|
|
4
3
|
type StyledSmallWaitCursorProps = WithTheme<{
|
|
5
4
|
$shouldShowWaitCursor: boolean;
|
|
6
|
-
$size: SmallWaitCursorSize | number;
|
|
7
5
|
}>;
|
|
8
6
|
export declare const StyledSmallWaitCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSmallWaitCursorProps>> & string;
|
|
9
7
|
export declare const StyledSmallWaitCursorBackground: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
10
8
|
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
11
9
|
}>> & string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$speed: SmallWaitCursorSpeed;
|
|
16
|
-
}>;
|
|
17
|
-
export declare const StyledSmallWaitCursorWaitCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSmallWaitCursorWaitCursorProps>> & string;
|
|
10
|
+
export declare const StyledSmallWaitCursorWaitCursor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
12
|
+
}>> & string;
|
|
18
13
|
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
2
3
|
export declare const StyledTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
type StyledTooltipChildrenProps = WithTheme<{
|
|
5
|
+
$isOnlyText: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StyledTooltipChildren: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledTooltipChildrenProps>> & string;
|
|
8
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { default as Signature } from './components/signature/Signature';
|
|
|
42
42
|
export type { SignatureRef } from './components/signature/Signature';
|
|
43
43
|
export { default as SliderButton } from './components/slider-button/SliderButton';
|
|
44
44
|
export { default as Slider } from './components/slider/Slider';
|
|
45
|
-
export { default as SmallWaitCursor
|
|
45
|
+
export { default as SmallWaitCursor } from './components/small-wait-cursor/SmallWaitCursor';
|
|
46
46
|
export { default as TagInput } from './components/tag-input/TagInput';
|
|
47
47
|
export { default as TextArea } from './components/text-area/TextArea';
|
|
48
48
|
export { default as Tooltip } from './components/tooltip/Tooltip';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.606",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "8ef526915e20f2f57bf154241c3a9c891007c4ee"
|
|
87
87
|
}
|