@chayns-components/core 5.0.0-beta.211 → 5.0.0-beta.215

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.
@@ -64,7 +64,7 @@ const Button = _ref => {
64
64
  }
65
65
  }, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.default, {
66
66
  color: "white",
67
- shouldShowBackground: false,
67
+ shouldHideBackground: true,
68
68
  size: _SmallWaitCursor.SmallWaitCursorSize.Small
69
69
  })) : /*#__PURE__*/_react.default.createElement(_Button.StyledMotionChildrenWrapper, {
70
70
  animate: {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["_clsx","_interopRequireDefault","require","_framerMotion","_react","_Icon","_SmallWaitCursor","_interopRequireWildcard","_Button","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Button","_ref","children","className","icon","isDisabled","isSecondary","onClick","shouldShowWaitCursor","shouldStopPropagation","handleClick","event","stopPropagation","buttonClasses","clsx","createElement","StyledButton","disabled","hasIcon","AnimatePresence","initial","StyledIconWrapper","color","icons","StyledMotionWaitCursorWrapper","animate","opacity","width","exit","style","overflow","transition","duration","shouldShowBackground","size","SmallWaitCursorSize","Small","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 Icon from '../icon/Icon';\nimport SmallWaitCursor, { SmallWaitCursorSize } from '../small-wait-cursor/SmallWaitCursor';\nimport {\n StyledButton,\n StyledIconWrapper,\n StyledMotionChildrenWrapper,\n StyledMotionWaitCursorWrapper,\n} from './Button.styles';\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 * 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}) => {\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 return (\n <StyledButton\n className={buttonClasses}\n disabled={isDisabled}\n hasIcon={typeof icon === 'string' && icon !== ''}\n isSecondary={isSecondary}\n onClick={handleClick}\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 <SmallWaitCursor\n color=\"white\"\n shouldShowBackground={false}\n size={SmallWaitCursorSize.Small}\n />\n </StyledMotionWaitCursorWrapper>\n ) : (\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 </Styled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AAwC,OAAA,CAAAvD,OAAA,GAAAsD,QAAA"}
1
+ {"version":3,"file":"Button.js","names":["_clsx","_interopRequireDefault","require","_framerMotion","_react","_Icon","_SmallWaitCursor","_interopRequireWildcard","_Button","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Button","_ref","children","className","icon","isDisabled","isSecondary","onClick","shouldShowWaitCursor","shouldStopPropagation","handleClick","event","stopPropagation","buttonClasses","clsx","createElement","StyledButton","disabled","hasIcon","AnimatePresence","initial","StyledIconWrapper","color","icons","StyledMotionWaitCursorWrapper","animate","opacity","width","exit","style","overflow","transition","duration","shouldHideBackground","size","SmallWaitCursorSize","Small","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 Icon from '../icon/Icon';\nimport SmallWaitCursor, { SmallWaitCursorSize } from '../small-wait-cursor/SmallWaitCursor';\nimport {\n StyledButton,\n StyledIconWrapper,\n StyledMotionChildrenWrapper,\n StyledMotionWaitCursorWrapper,\n} from './Button.styles';\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 * 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}) => {\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 return (\n <StyledButton\n className={buttonClasses}\n disabled={isDisabled}\n hasIcon={typeof icon === 'string' && icon !== ''}\n isSecondary={isSecondary}\n onClick={handleClick}\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 <SmallWaitCursor\n color=\"white\"\n shouldHideBackground\n size={SmallWaitCursorSize.Small}\n />\n </StyledMotionWaitCursorWrapper>\n ) : (\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 </StyledButton>\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,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKyB,SAAAO,yBAAAC,WAAA,eAAAC,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AAE,CAAE;IAClCjC,GAAG,EAAC,aAAa;IACjBmC,KAAK,EAAE;MAAEC,QAAQ,EAAE;IAAS,CAAE;IAC9BC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE9B3D,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACxC,gBAAA,CAAAU,OAAe;IACZqC,KAAK,EAAC,OAAO;IACbW,oBAAoB;IACpBC,IAAI,EAAEC,oCAAmB,CAACC;EAAM,CACnC,CAC0B,CAAC,gBAEhC/D,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACtC,OAAA,CAAA4D,2BAA2B;IACxBZ,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;IAClCjC,GAAG,EAAC,UAAU;IACdmC,KAAK,EAAE;MAAEC,QAAQ,EAAE;IAAS,CAAE;IAC9BC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,GAE7B9B,QACwB,CAEpB,CACP,CAAC;AAEvB,CAAC;AAEDF,MAAM,CAACsC,WAAW,GAAG,QAAQ;AAAC,IAAAC,QAAA,GAEfvC,MAAM;AAAAwC,OAAA,CAAAvD,OAAA,GAAAsD,QAAA"}
@@ -5,6 +5,10 @@ export type RadioButtonProps = {
5
5
  * Whether the radio button should be checked.
6
6
  */
7
7
  isChecked?: boolean;
8
+ /**
9
+ * whether the RadioButton should be shown.
10
+ */
11
+ isDisabled?: boolean;
8
12
  /**
9
13
  * The id of the radio button.
10
14
  */
@@ -14,7 +14,8 @@ const RadioButton = _ref => {
14
14
  isChecked,
15
15
  label,
16
16
  onChange,
17
- id
17
+ id,
18
+ isDisabled = false
18
19
  } = _ref;
19
20
  const {
20
21
  selectedRadioButtonId,
@@ -41,18 +42,24 @@ const RadioButton = _ref => {
41
42
  }
42
43
  }, [id, isMarked, onChange]);
43
44
  const handleClick = (0, _react.useCallback)(() => {
45
+ if (isDisabled) {
46
+ return;
47
+ }
44
48
  if (typeof updateSelectedRadioButtonId === 'function') {
45
49
  updateSelectedRadioButtonId(id);
46
50
  }
47
51
  setInternalIsChecked(prevState => !prevState);
48
- }, [id, updateSelectedRadioButtonId]);
49
- const handleMouseEnter = () => {
50
- setIsHovered(true);
51
- };
52
+ }, [id, isDisabled, updateSelectedRadioButtonId]);
53
+ const handleMouseEnter = (0, _react.useCallback)(() => {
54
+ if (!isDisabled) {
55
+ setIsHovered(true);
56
+ }
57
+ }, [isDisabled]);
52
58
  const handleMouseLeave = () => {
53
59
  setIsHovered(false);
54
60
  };
55
61
  return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButton, {
62
+ isDisabled: isDisabled,
56
63
  onClick: handleClick,
57
64
  onMouseEnter: handleMouseEnter,
58
65
  onMouseLeave: handleMouseLeave
@@ -62,10 +69,11 @@ const RadioButton = _ref => {
62
69
  isHovered: isHovered,
63
70
  isSelected: isMarked
64
71
  })), /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonCheckBox, {
72
+ disabled: isDisabled,
65
73
  type: "radio",
66
74
  checked: isMarked,
67
75
  onChange: () => {}
68
- }), label && /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonLabel, null, label)), [handleClick, isHovered, isMarked, label]);
76
+ }), label && /*#__PURE__*/_react.default.createElement(_RadioButton.StyledRadioButtonLabel, null, label)), [handleClick, handleMouseEnter, isDisabled, isHovered, isMarked, label]);
69
77
  };
70
78
  RadioButton.displayName = 'RadioButton';
71
79
  var _default = RadioButton;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","names":["_react","_interopRequireWildcard","require","_RadioButtonGroup","_RadioButton","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RadioButton","_ref","isChecked","label","onChange","id","selectedRadioButtonId","updateSelectedRadioButtonId","useContext","RadioButtonGroupContext","internalIsChecked","setInternalIsChecked","useState","isHovered","setIsHovered","isInGroup","isMarked","isInitialRenderRef","useRef","useEffect","current","handleClick","useCallback","prevState","handleMouseEnter","handleMouseLeave","useMemo","createElement","StyledRadioButton","onClick","onMouseEnter","onMouseLeave","StyledRadioButtonPseudoCheckBox","StyledRadioButtonCheckBoxMark","isSelected","StyledRadioButtonCheckBox","type","checked","StyledRadioButtonLabel","displayName","_default","exports"],"sources":["../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import React, { FC, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { RadioButtonGroupContext } from './radio-button-group/RadioButtonGroup';\nimport {\n StyledRadioButton,\n StyledRadioButtonCheckBox,\n StyledRadioButtonCheckBoxMark,\n StyledRadioButtonLabel,\n StyledRadioButtonPseudoCheckBox,\n} from './RadioButton.styles';\nimport type { RadioButtonItem } from './types';\n\nexport type RadioButtonProps = {\n /**\n * Whether the radio button should be checked.\n */\n isChecked?: boolean;\n /**\n * The id of the radio button.\n */\n id: string;\n /**\n * The label that should be displayed next to the radio button.\n */\n label?: string;\n /**\n * Function to be executed when a button is checked.\n */\n onChange?: (item: RadioButtonItem) => void;\n};\n\nconst RadioButton: FC<RadioButtonProps> = ({ isChecked, label, onChange, id }) => {\n const { selectedRadioButtonId, updateSelectedRadioButtonId } =\n useContext(RadioButtonGroupContext);\n\n const [internalIsChecked, setInternalIsChecked] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const isInGroup = typeof updateSelectedRadioButtonId === 'function';\n\n const isMarked = isInGroup ? selectedRadioButtonId === id : internalIsChecked;\n\n const isInitialRenderRef = useRef(true);\n\n useEffect(() => {\n if (isChecked) {\n setInternalIsChecked(isChecked);\n }\n }, [isChecked]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (typeof onChange === 'function') {\n onChange({ isChecked: isMarked, id });\n }\n }, [id, isMarked, onChange]);\n\n const handleClick = useCallback(() => {\n if (typeof updateSelectedRadioButtonId === 'function') {\n updateSelectedRadioButtonId(id);\n }\n\n setInternalIsChecked((prevState) => !prevState);\n }, [id, updateSelectedRadioButtonId]);\n\n const handleMouseEnter = () => {\n setIsHovered(true);\n };\n\n const handleMouseLeave = () => {\n setIsHovered(false);\n };\n\n return useMemo(\n () => (\n <StyledRadioButton\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <StyledRadioButtonPseudoCheckBox isChecked={isMarked}>\n <StyledRadioButtonCheckBoxMark isHovered={isHovered} isSelected={isMarked} />\n </StyledRadioButtonPseudoCheckBox>\n <StyledRadioButtonCheckBox type=\"radio\" checked={isMarked} onChange={() => {}} />\n {label && <StyledRadioButtonLabel>{label}</StyledRadioButtonLabel>}\n </StyledRadioButton>\n ),\n [handleClick, isHovered, isMarked, label]\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAM8B,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,O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BAA+B;IAAC9B,SAAS,EAAEc;EAAS,gBACjD3C,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAAClD,YAAA,CAAAwD,6BAA6B;IAACpB,SAAS,EAAEA,SAAU;IAACqB,UAAU,EAAElB;EAAS,CAAE,CAC/C,CAAC,eAClC3C,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAAClD,YAAA,CAAA0D,yBAAyB;IAACC,IAAI,EAAC,OAAO;IAACC,OAAO,EAAErB,QAAS;IAACZ,QAAQ,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAE,CAAC,EAChFD,KAAK,iBAAI9B,MAAA,CAAAY,OAAA,CAAA0C,aAAA,CAAClD,YAAA,CAAA6D,sBAAsB,QAAEnC,KAA8B,CAClD,CACtB,EACD,CAACkB,WAAW,EAAER,SAAS,EAAEG,QAAQ,EAAEb,KAAK,CAC5C,CAAC;AACL,CAAC;AAEDH,WAAW,CAACuC,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAEzBxC,WAAW;AAAAyC,OAAA,CAAAxD,OAAA,GAAAuD,QAAA"}
1
+ {"version":3,"file":"RadioButton.js","names":["_react","_interopRequireWildcard","require","_RadioButtonGroup","_RadioButton","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RadioButton","_ref","isChecked","label","onChange","id","isDisabled","selectedRadioButtonId","updateSelectedRadioButtonId","useContext","RadioButtonGroupContext","internalIsChecked","setInternalIsChecked","useState","isHovered","setIsHovered","isInGroup","isMarked","isInitialRenderRef","useRef","useEffect","current","handleClick","useCallback","prevState","handleMouseEnter","handleMouseLeave","useMemo","createElement","StyledRadioButton","onClick","onMouseEnter","onMouseLeave","StyledRadioButtonPseudoCheckBox","StyledRadioButtonCheckBoxMark","isSelected","StyledRadioButtonCheckBox","disabled","type","checked","StyledRadioButtonLabel","displayName","_default","exports"],"sources":["../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import React, { FC, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { RadioButtonGroupContext } from './radio-button-group/RadioButtonGroup';\nimport {\n StyledRadioButton,\n StyledRadioButtonCheckBox,\n StyledRadioButtonCheckBoxMark,\n StyledRadioButtonLabel,\n StyledRadioButtonPseudoCheckBox,\n} from './RadioButton.styles';\nimport type { RadioButtonItem } from './types';\n\nexport type RadioButtonProps = {\n /**\n * Whether the radio button should be checked.\n */\n isChecked?: boolean;\n /**\n * whether the RadioButton should be shown.\n */\n isDisabled?: boolean;\n /**\n * The id of the radio button.\n */\n id: string;\n /**\n * The label that should be displayed next to the radio button.\n */\n label?: string;\n /**\n * Function to be executed when a button is checked.\n */\n onChange?: (item: RadioButtonItem) => void;\n};\n\nconst RadioButton: FC<RadioButtonProps> = ({\n isChecked,\n label,\n onChange,\n id,\n isDisabled = false,\n}) => {\n const { selectedRadioButtonId, updateSelectedRadioButtonId } =\n useContext(RadioButtonGroupContext);\n\n const [internalIsChecked, setInternalIsChecked] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n\n const isInGroup = typeof updateSelectedRadioButtonId === 'function';\n\n const isMarked = isInGroup ? selectedRadioButtonId === id : internalIsChecked;\n\n const isInitialRenderRef = useRef(true);\n\n useEffect(() => {\n if (isChecked) {\n setInternalIsChecked(isChecked);\n }\n }, [isChecked]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (typeof onChange === 'function') {\n onChange({ isChecked: isMarked, id });\n }\n }, [id, isMarked, onChange]);\n\n const handleClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateSelectedRadioButtonId === 'function') {\n updateSelectedRadioButtonId(id);\n }\n\n setInternalIsChecked((prevState) => !prevState);\n }, [id, isDisabled, updateSelectedRadioButtonId]);\n\n const handleMouseEnter = useCallback(() => {\n if (!isDisabled) {\n setIsHovered(true);\n }\n }, [isDisabled]);\n\n const handleMouseLeave = () => {\n setIsHovered(false);\n };\n\n return useMemo(\n () => (\n <StyledRadioButton\n isDisabled={isDisabled}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <StyledRadioButtonPseudoCheckBox isChecked={isMarked}>\n <StyledRadioButtonCheckBoxMark isHovered={isHovered} isSelected={isMarked} />\n </StyledRadioButtonPseudoCheckBox>\n <StyledRadioButtonCheckBox\n disabled={isDisabled}\n type=\"radio\"\n checked={isMarked}\n onChange={() => {}}\n />\n {label && <StyledRadioButtonLabel>{label}</StyledRadioButtonLabel>}\n </StyledRadioButton>\n ),\n [handleClick, handleMouseEnter, isDisabled, isHovered, isMarked, label]\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAM8B,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,W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,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAAyD,6BAA6B;IAACpB,SAAS,EAAEA,SAAU;IAACqB,UAAU,EAAElB;EAAS,CAAE,CAC/C,CAAC,eAClC5C,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAA2D,yBAAyB;IACtBC,QAAQ,EAAE/B,UAAW;IACrBgC,IAAI,EAAC,OAAO;IACZC,OAAO,EAAEtB,QAAS;IAClBb,QAAQ,EAAEA,CAAA,KAAM,CAAC;EAAE,CACtB,CAAC,EACDD,KAAK,iBAAI9B,MAAA,CAAAY,OAAA,CAAA2C,aAAA,CAACnD,YAAA,CAAA+D,sBAAsB,QAAErC,KAA8B,CAClD,CACtB,EACD,CAACmB,WAAW,EAAEG,gBAAgB,EAAEnB,UAAU,EAAEQ,SAAS,EAAEG,QAAQ,EAAEd,KAAK,CAC1E,CAAC;AACL,CAAC;AAEDH,WAAW,CAACyC,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAEzB1C,WAAW;AAAA2C,OAAA,CAAA1D,OAAA,GAAAyD,QAAA"}
@@ -1,4 +1,8 @@
1
- export declare const StyledRadioButton: import("styled-components").StyledComponent<"span", any, {}, never>;
1
+ export declare const StyledRadioButton: import("styled-components").StyledComponent<"span", any, {
2
+ isDisabled: boolean;
3
+ } & {
4
+ theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
5
+ }, never>;
2
6
  export declare const StyledRadioButtonCheckBox: import("styled-components").StyledComponent<"input", any, {
3
7
  theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
4
8
  }, never>;
@@ -10,11 +10,22 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
10
10
  const StyledRadioButton = _styledComponents.default.span`
11
11
  display: flex;
12
12
  gap: 5px;
13
- cursor: pointer;
14
13
  user-select: none;
15
14
  width: fit-content;
16
15
  align-items: center;
17
16
  position: relative;
17
+ cursor: ${_ref => {
18
+ let {
19
+ isDisabled
20
+ } = _ref;
21
+ return isDisabled ? 'default !important' : 'pointer';
22
+ }};
23
+ opacity: ${_ref2 => {
24
+ let {
25
+ isDisabled
26
+ } = _ref2;
27
+ return isDisabled ? 0.5 : 1;
28
+ }};
18
29
  `;
19
30
  exports.StyledRadioButton = StyledRadioButton;
20
31
  const StyledRadioButtonCheckBox = _styledComponents.default.input`
@@ -22,11 +33,11 @@ const StyledRadioButtonCheckBox = _styledComponents.default.input`
22
33
  `;
23
34
  exports.StyledRadioButtonCheckBox = StyledRadioButtonCheckBox;
24
35
  const StyledRadioButtonPseudoCheckBox = _styledComponents.default.div`
25
- background-color: ${_ref => {
36
+ background-color: ${_ref3 => {
26
37
  let {
27
38
  theme,
28
39
  isChecked
29
- } = _ref;
40
+ } = _ref3;
30
41
  return isChecked ? theme.secondary : theme['secondary-103'];
31
42
  }};
32
43
  opacity: 0.5;
@@ -45,7 +56,7 @@ const StyledRadioButtonCheckBoxMark = _styledComponents.default.span`
45
56
  background-color: transparent;
46
57
  position: absolute;
47
58
  top: 0;
48
- left: 3px;
59
+ left: 2.925px;
49
60
  display: inline-block;
50
61
  transform: rotate(35deg);
51
62
  height: 9px;
@@ -56,11 +67,11 @@ const StyledRadioButtonCheckBoxMark = _styledComponents.default.span`
56
67
  border-left: transparent;
57
68
  z-index: 2;
58
69
 
59
- ${_ref2 => {
70
+ ${_ref4 => {
60
71
  let {
61
72
  isHovered,
62
73
  isSelected
63
- } = _ref2;
74
+ } = _ref4;
64
75
  if (isSelected) {
65
76
  return (0, _styledComponents.css)`
66
77
  opacity: 1;
@@ -78,10 +89,10 @@ const StyledRadioButtonCheckBoxMark = _styledComponents.default.span`
78
89
  `;
79
90
  exports.StyledRadioButtonCheckBoxMark = StyledRadioButtonCheckBoxMark;
80
91
  const StyledRadioButtonLabel = _styledComponents.default.p`
81
- color: ${_ref3 => {
92
+ color: ${_ref5 => {
82
93
  let {
83
94
  theme
84
- } = _ref3;
95
+ } = _ref5;
85
96
  return theme.text;
86
97
  }};
87
98
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledRadioButton","styled","span","exports","StyledRadioButtonCheckBox","input","StyledRadioButtonPseudoCheckBox","div","_ref","theme","isChecked","secondary","StyledRadioButtonCheckBoxMark","_ref2","isHovered","isSelected","css","StyledRadioButtonLabel","p","_ref3","text"],"sources":["../../../src/components/radio-button/RadioButton.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledRadioButton = styled.span`\n display: flex;\n gap: 5px;\n cursor: pointer;\n user-select: none;\n width: fit-content;\n align-items: center;\n position: relative;\n`;\n\ntype StyledRadioButtonCheckBoxProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonCheckBox = styled.input<StyledRadioButtonCheckBoxProps>`\n opacity: 0;\n`;\n\ntype StyledRadioButtonPseudoCheckBoxProps = WithTheme<{ isChecked: boolean }>;\n\nexport const StyledRadioButtonPseudoCheckBox = styled.div<StyledRadioButtonPseudoCheckBoxProps>`\n background-color: ${({ theme, isChecked }: StyledRadioButtonPseudoCheckBoxProps) =>\n isChecked ? theme.secondary : theme['secondary-103']};\n opacity: 0.5;\n border: 1px solid rgba(160, 160, 160, 0.3);\n width: 13px;\n height: 13px;\n position: absolute;\n border-radius: 100%;\n top: 22%;\n left: -1%;\n cursor: pointer !important;\n`;\n\ntype StyledRadioButtonCheckBoxMarkProps = WithTheme<{\n isHovered: boolean;\n isSelected: boolean;\n}>;\n\nexport const StyledRadioButtonCheckBoxMark = styled.span<StyledRadioButtonCheckBoxMarkProps>`\n cursor: pointer;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 3px;\n display: inline-block;\n transform: rotate(35deg);\n height: 9px;\n width: 5px;\n border-bottom: 2px solid white;\n border-right: 2px solid white;\n border-top: transparent;\n border-left: transparent;\n z-index: 2;\n\n ${({ isHovered, isSelected }) => {\n if (isSelected) {\n return css`\n opacity: 1;\n `;\n }\n\n if (isHovered) {\n return css`\n opacity: 0.5;\n `;\n }\n\n return css`\n opacity: 0;\n `;\n }}\n`;\n\ntype StyledRadioButtonLabelProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonLabel = styled.p<StyledRadioButtonLabelProps>`\n color: ${({ theme }: StyledRadioButtonLabelProps) => theme.text};\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,I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AO,IAAAA,qBAAG,CAAC;AACnB;AACA,SAAS;AACL,CAAE;AACN,CAAC;AAACb,OAAA,CAAAS,6BAAA,GAAAA,6BAAA;AAIK,MAAMK,sBAAsB,GAAGhB,yBAAM,CAACiB,CAA+B;AAC5E,aAAaC,KAAA;EAAA,IAAC;IAAEV;EAAmC,CAAC,GAAAU,KAAA;EAAA,OAAKV,KAAK,CAACW,IAAI;AAAA,CAAC;AACpE,CAAC;AAACjB,OAAA,CAAAc,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"file":"RadioButton.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledRadioButton","styled","span","_ref","isDisabled","_ref2","exports","StyledRadioButtonCheckBox","input","StyledRadioButtonPseudoCheckBox","div","_ref3","theme","isChecked","secondary","StyledRadioButtonCheckBoxMark","_ref4","isHovered","isSelected","css","StyledRadioButtonLabel","p","_ref5","text"],"sources":["../../../src/components/radio-button/RadioButton.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledRadioButtonProps = WithTheme<{ isDisabled: boolean }>;\n\nexport const StyledRadioButton = styled.span<StyledRadioButtonProps>`\n display: flex;\n gap: 5px;\n user-select: none;\n width: fit-content;\n align-items: center;\n position: relative;\n cursor: ${({ isDisabled }: StyledRadioButtonProps) =>\n isDisabled ? 'default !important' : 'pointer'};\n opacity: ${({ isDisabled }: StyledRadioButtonProps) => (isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledRadioButtonCheckBoxProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonCheckBox = styled.input<StyledRadioButtonCheckBoxProps>`\n opacity: 0;\n`;\n\ntype StyledRadioButtonPseudoCheckBoxProps = WithTheme<{ isChecked: boolean }>;\n\nexport const StyledRadioButtonPseudoCheckBox = styled.div<StyledRadioButtonPseudoCheckBoxProps>`\n background-color: ${({ theme, isChecked }: StyledRadioButtonPseudoCheckBoxProps) =>\n isChecked ? theme.secondary : theme['secondary-103']};\n opacity: 0.5;\n border: 1px solid rgba(160, 160, 160, 0.3);\n width: 13px;\n height: 13px;\n position: absolute;\n border-radius: 100%;\n top: 22%;\n left: -1%;\n cursor: pointer !important;\n`;\n\ntype StyledRadioButtonCheckBoxMarkProps = WithTheme<{\n isHovered: boolean;\n isSelected: boolean;\n}>;\n\nexport const StyledRadioButtonCheckBoxMark = styled.span<StyledRadioButtonCheckBoxMarkProps>`\n cursor: pointer;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 2.925px;\n display: inline-block;\n transform: rotate(35deg);\n height: 9px;\n width: 5px;\n border-bottom: 2px solid white;\n border-right: 2px solid white;\n border-top: transparent;\n border-left: transparent;\n z-index: 2;\n\n ${({ isHovered, isSelected }) => {\n if (isSelected) {\n return css`\n opacity: 1;\n `;\n }\n\n if (isHovered) {\n return css`\n opacity: 0.5;\n `;\n }\n\n return css`\n opacity: 0;\n `;\n }}\n`;\n\ntype StyledRadioButtonLabelProps = WithTheme<unknown>;\n\nexport const StyledRadioButtonLabel = styled.p<StyledRadioButtonLabelProps>`\n color: ${({ theme }: StyledRadioButtonLabelProps) => theme.text};\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAA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;AAACF,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAIK,MAAME,+BAA+B,GAAGR,yBAAM,CAACS,GAA0C;AAChG,wBAAwBC,KAAA;EAAA,IAAC;IAAEC,KAAK;IAAEC;EAAgD,CAAC,GAAAF,KAAA;EAAA,OAC3EE,SAAS,GAAGD,KAAK,CAACE,SAAS,GAAGF,KAAK,CAAC,eAAe,CAAC;AAAA,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACN,OAAA,CAAAG,+BAAA,GAAAA,+BAAA;AAOK,MAAMM,6BAA6B,GAAGd,yBAAM,CAACC,IAAyC;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMc,KAAA,IAA+B;EAAA,IAA9B;IAAEC,SAAS;IAAEC;EAAW,CAAC,GAAAF,KAAA;EACxB,IAAIE,UAAU,EAAE;IACZ,OAAO,IAAAC,qBAAG,CAAC;AACvB;AACA,aAAa;EACL;EAEA,IAAIF,SAAS,EAAE;IACX,OAAO,IAAAE,qBAAG,CAAC;AACvB;AACA,aAAa;EACL;EAEA,OAAO,IAAAA,qBAAG,CAAC;AACnB;AACA,SAAS;AACL,CAAE;AACN,CAAC;AAACb,OAAA,CAAAS,6BAAA,GAAAA,6BAAA;AAIK,MAAMK,sBAAsB,GAAGnB,yBAAM,CAACoB,CAA+B;AAC5E,aAAaC,KAAA;EAAA,IAAC;IAAEV;EAAmC,CAAC,GAAAU,KAAA;EAAA,OAAKV,KAAK,CAACW,IAAI;AAAA,CAAC;AACpE,CAAC;AAACjB,OAAA,CAAAc,sBAAA,GAAAA,sBAAA"}
@@ -98,6 +98,7 @@ const SearchBox = _ref => {
98
98
  }, [onSelect]);
99
99
  const content = (0, _react.useMemo)(() => {
100
100
  const items = [];
101
+ matchingItems.sort((a, b) => a.text.localeCompare(b.text));
101
102
  matchingItems.forEach(_ref3 => {
102
103
  let {
103
104
  id,
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_calculate","_Input","_interopRequireDefault","_SearchBoxItem","_SearchBox","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SearchBox","_ref","placeholder","list","onChange","onBlur","onSelect","matchingItems","setMatchingItems","useState","value","setValue","isAnimating","setIsAnimating","height","setHeight","boxRef","useRef","contentRef","handleOutsideClick","useCallback","event","current","contains","target","useEffect","document","addEventListener","removeEventListener","textArray","map","_ref2","text","calculateContentHeight","handleChange","searchedItems","searchList","items","searchString","length","handleBlur","handleSelect","item","content","useMemo","forEach","_ref3","id","push","createElement","StyledSearchBox","ref","AnimatePresence","initial","StyledMotionSearchBoxBody","opacity","animate","transition","duration","type","displayName","_default","exports"],"sources":["../../../src/components/search-box/SearchBox.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n FocusEvent,\n FocusEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { calculateContentHeight } from '../../utils/calculate';\nimport Input from '../input/Input';\nimport SearchBoxItem from './search-box-item/SearchBoxItem';\nimport { StyledMotionSearchBoxBody, StyledSearchBox } from './SearchBox.styles';\nimport type { ISearchBoxItem } from './types';\nimport { searchList } from './utils';\n\nexport type SearchBoxProps = {\n /**\n * A list of items that can be searched.\n */\n list: ISearchBoxItem[];\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * Function to be executed when the input lost focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when an item is selected.\n */\n onSelect?: (item: ISearchBoxItem) => void;\n};\n\nconst SearchBox: FC<SearchBoxProps> = ({ placeholder, list, onChange, onBlur, onSelect }) => {\n const [matchingItems, setMatchingItems] = useState<ISearchBoxItem[]>([]);\n const [value, setValue] = useState('');\n const [isAnimating, setIsAnimating] = useState(false);\n const [height, setHeight] = useState<number>(0);\n\n const boxRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n /**\n * This function closes the list of items\n */\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n if (boxRef.current && !boxRef.current.contains(event.target as Node)) {\n setIsAnimating(false);\n }\n },\n [boxRef]\n );\n\n /**\n * This hook listens for clicks\n */\n useEffect(() => {\n document.addEventListener('click', handleOutsideClick);\n\n return () => {\n document.removeEventListener('click', handleOutsideClick);\n };\n }, [handleOutsideClick, boxRef]);\n\n /**\n * This hook calculates the greatest width\n */\n useEffect(() => {\n const textArray = list.map(({ text }) => text);\n\n setHeight(calculateContentHeight(textArray));\n }, [list, placeholder]);\n\n /**\n * This function handles changes of the input\n */\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const searchedItems = searchList({ items: list, searchString: event.target.value });\n\n setMatchingItems(searchedItems);\n setIsAnimating(searchedItems.length !== 0);\n setValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [list, onChange]\n );\n\n /**\n * This function handles the blur event of the input\n */\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n if (typeof onBlur === 'function') {\n onBlur(event);\n }\n },\n [onBlur]\n );\n\n /**\n * This function handles the item selection\n */\n const handleSelect = useCallback(\n (item: ISearchBoxItem) => {\n setValue(item.text);\n setIsAnimating(false);\n\n if (typeof onSelect === 'function') {\n onSelect(item);\n }\n },\n [onSelect]\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n matchingItems.forEach(({ id, text }) => {\n items.push(<SearchBoxItem key={id} text={text} id={id} onSelect={handleSelect} />);\n });\n\n return items;\n }, [handleSelect, matchingItems]);\n\n return useMemo(\n () => (\n <StyledSearchBox ref={boxRef}>\n <Input\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n value={value}\n />\n <AnimatePresence initial={false}>\n <StyledMotionSearchBoxBody\n key=\"content\"\n height={height}\n initial={{ height: 0, opacity: 0 }}\n animate={\n isAnimating\n ? { height: 'fit-content', opacity: 1 }\n : { height: 0, opacity: 0 }\n }\n transition={{\n duration: 0.2,\n type: 'tween',\n }}\n >\n <div ref={contentRef}>{content}</div>\n </StyledMotionSearchBoxBody>\n </AnimatePresence>\n </StyledSearchBox>\n ),\n [content, handleBlur, handleChange, height, isAnimating, placeholder, value]\n );\n};\n\nSearchBox.displayName = 'SearchBox';\n\nexport default SearchBox;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAaA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AAAqC,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAO,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA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","_Input","_interopRequireDefault","_SearchBoxItem","_SearchBox","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SearchBox","_ref","placeholder","list","onChange","onBlur","onSelect","matchingItems","setMatchingItems","useState","value","setValue","isAnimating","setIsAnimating","height","setHeight","boxRef","useRef","contentRef","handleOutsideClick","useCallback","event","current","contains","target","useEffect","document","addEventListener","removeEventListener","textArray","map","_ref2","text","calculateContentHeight","handleChange","searchedItems","searchList","items","searchString","length","handleBlur","handleSelect","item","content","useMemo","sort","a","b","localeCompare","forEach","_ref3","id","push","createElement","StyledSearchBox","ref","AnimatePresence","initial","StyledMotionSearchBoxBody","opacity","animate","transition","duration","type","displayName","_default","exports"],"sources":["../../../src/components/search-box/SearchBox.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n FocusEvent,\n FocusEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { calculateContentHeight } from '../../utils/calculate';\nimport Input from '../input/Input';\nimport SearchBoxItem from './search-box-item/SearchBoxItem';\nimport { StyledMotionSearchBoxBody, StyledSearchBox } from './SearchBox.styles';\nimport type { ISearchBoxItem } from './types';\nimport { searchList } from './utils';\n\nexport type SearchBoxProps = {\n /**\n * A list of items that can be searched.\n */\n list: ISearchBoxItem[];\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * Function to be executed when the input lost focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when an item is selected.\n */\n onSelect?: (item: ISearchBoxItem) => void;\n};\n\nconst SearchBox: FC<SearchBoxProps> = ({ placeholder, list, onChange, onBlur, onSelect }) => {\n const [matchingItems, setMatchingItems] = useState<ISearchBoxItem[]>([]);\n const [value, setValue] = useState('');\n const [isAnimating, setIsAnimating] = useState(false);\n const [height, setHeight] = useState<number>(0);\n\n const boxRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n /**\n * This function closes the list of items\n */\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n if (boxRef.current && !boxRef.current.contains(event.target as Node)) {\n setIsAnimating(false);\n }\n },\n [boxRef]\n );\n\n /**\n * This hook listens for clicks\n */\n useEffect(() => {\n document.addEventListener('click', handleOutsideClick);\n\n return () => {\n document.removeEventListener('click', handleOutsideClick);\n };\n }, [handleOutsideClick, boxRef]);\n\n /**\n * This hook calculates the greatest width\n */\n useEffect(() => {\n const textArray = list.map(({ text }) => text);\n\n setHeight(calculateContentHeight(textArray));\n }, [list, placeholder]);\n\n /**\n * This function handles changes of the input\n */\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const searchedItems = searchList({ items: list, searchString: event.target.value });\n\n setMatchingItems(searchedItems);\n setIsAnimating(searchedItems.length !== 0);\n setValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [list, onChange]\n );\n\n /**\n * This function handles the blur event of the input\n */\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n if (typeof onBlur === 'function') {\n onBlur(event);\n }\n },\n [onBlur]\n );\n\n /**\n * This function handles the item selection\n */\n const handleSelect = useCallback(\n (item: ISearchBoxItem) => {\n setValue(item.text);\n setIsAnimating(false);\n\n if (typeof onSelect === 'function') {\n onSelect(item);\n }\n },\n [onSelect]\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n matchingItems.sort((a, b) => a.text.localeCompare(b.text));\n\n matchingItems.forEach(({ id, text }) => {\n items.push(<SearchBoxItem key={id} text={text} id={id} onSelect={handleSelect} />);\n });\n\n return items;\n }, [handleSelect, matchingItems]);\n\n return useMemo(\n () => (\n <StyledSearchBox ref={boxRef}>\n <Input\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n value={value}\n />\n <AnimatePresence initial={false}>\n <StyledMotionSearchBoxBody\n key=\"content\"\n height={height}\n initial={{ height: 0, opacity: 0 }}\n animate={\n isAnimating\n ? { height: 'fit-content', opacity: 1 }\n : { height: 0, opacity: 0 }\n }\n transition={{\n duration: 0.2,\n type: 'tween',\n }}\n >\n <div ref={contentRef}>{content}</div>\n </StyledMotionSearchBoxBody>\n </AnimatePresence>\n </StyledSearchBox>\n ),\n [content, handleBlur, handleChange, height, isAnimating, placeholder, value]\n );\n};\n\nSearchBox.displayName = 'SearchBox';\n\nexport default SearchBox;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAaA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AAAqC,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAO,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,w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E,SAAS;AAAAkE,OAAA,CAAAtF,OAAA,GAAAqF,QAAA"}
@@ -13,11 +13,11 @@ export type SmallWaitCursorProps = {
13
13
  /**
14
14
  * Specifies whether the wait cursor should be displayed with a background.
15
15
  */
16
- shouldShowBackground?: boolean;
16
+ shouldHideBackground?: boolean;
17
17
  /**
18
18
  * Specifies whether the wait cursor should be displayed.
19
19
  */
20
- shouldShowWaitCursor?: boolean;
20
+ shouldHideWaitCursor?: boolean;
21
21
  /**
22
22
  * The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.
23
23
  */
@@ -24,22 +24,20 @@ exports.SmallWaitCursorSpeed = SmallWaitCursorSpeed;
24
24
  const SmallWaitCursor = _ref => {
25
25
  let {
26
26
  color,
27
- shouldShowWaitCursor = true,
28
- // TODO: Revert prop to hide wait cursor
29
- shouldShowBackground = true,
30
- // TODO: Revert prop to hide background
27
+ shouldHideBackground = false,
28
+ shouldHideWaitCursor = false,
31
29
  size = SmallWaitCursorSize.Medium,
32
30
  speed = SmallWaitCursorSpeed.Medium
33
31
  } = _ref;
34
32
  return /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursor, {
35
- shouldShowWaitCursor: shouldShowWaitCursor,
33
+ shouldShowWaitCursor: !shouldHideWaitCursor,
36
34
  size: size
37
35
  }, /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorWaitCursor, {
38
36
  color: color,
39
- shouldShowBackground: shouldShowBackground,
37
+ shouldHideBackground: shouldHideBackground,
40
38
  size: size,
41
39
  speed: speed
42
- }), shouldShowBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null));
40
+ }), !shouldHideBackground && /*#__PURE__*/_react.default.createElement(_SmallWaitCursor.StyledSmallWaitCursorBackground, null));
43
41
  };
44
42
  SmallWaitCursor.displayName = 'SmallWaitCursor';
45
43
  var _default = SmallWaitCursor;
@@ -1 +1 @@
1
- {"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireDefault","require","_SmallWaitCursor","obj","__esModule","default","SmallWaitCursorSize","exports","SmallWaitCursorSpeed","SmallWaitCursor","_ref","color","shouldShowWaitCursor","shouldShowBackground","size","Medium","speed","createElement","StyledSmallWaitCursor","StyledSmallWaitCursorWaitCursor","StyledSmallWaitCursorBackground","displayName","_default"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nimport React, { CSSProperties, FC } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\nexport enum SmallWaitCursorSize {\n Small = 16,\n Medium = 30,\n}\n\nexport enum SmallWaitCursorSpeed {\n Slow = 1.5,\n Medium = 1,\n Fast = 0.5,\n}\n\nexport type SmallWaitCursorProps = {\n color?: CSSProperties['color'];\n /**\n * Specifies whether the wait cursor should be displayed with a background.\n */\n shouldShowBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldShowWaitCursor?: boolean;\n /**\n * The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.\n */\n size?: SmallWaitCursorSize;\n /**\n * The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.\n */\n speed?: SmallWaitCursorSpeed;\n};\n\nconst SmallWaitCursor: FC<SmallWaitCursorProps> = ({\n color,\n shouldShowWaitCursor = true, // TODO: Revert prop to hide wait cursor\n shouldShowBackground = true, // TODO: Revert prop to hide background\n size = SmallWaitCursorSize.Medium,\n speed = SmallWaitCursorSpeed.Medium,\n}) => (\n <StyledSmallWaitCursor shouldShowWaitCursor={shouldShowWaitCursor} size={size}>\n <StyledSmallWaitCursorWaitCursor\n color={color}\n shouldShowBackground={shouldShowBackground}\n size={size}\n speed={speed}\n />\n {shouldShowBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n);\n\nSmallWaitCursor.displayName = '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,aAAA,CAACf,gBAAA,CAAAkB,+BAA+B,MAAE,CACxC,CAAC;AAAA,CAC3B;AAEDX,eAAe,CAACY,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAEjCb,eAAe;AAAAF,OAAA,CAAAF,OAAA,GAAAiB,QAAA"}
1
+ {"version":3,"file":"SmallWaitCursor.js","names":["_react","_interopRequireDefault","require","_SmallWaitCursor","obj","__esModule","default","SmallWaitCursorSize","exports","SmallWaitCursorSpeed","SmallWaitCursor","_ref","color","shouldHideBackground","shouldHideWaitCursor","size","Medium","speed","createElement","StyledSmallWaitCursor","shouldShowWaitCursor","StyledSmallWaitCursorWaitCursor","StyledSmallWaitCursorBackground","displayName","_default"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.tsx"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nimport React, { CSSProperties, FC } from 'react';\nimport {\n StyledSmallWaitCursor,\n StyledSmallWaitCursorBackground,\n StyledSmallWaitCursorWaitCursor,\n} from './SmallWaitCursor.styles';\n\nexport enum SmallWaitCursorSize {\n Small = 16,\n Medium = 30,\n}\n\nexport enum SmallWaitCursorSpeed {\n Slow = 1.5,\n Medium = 1,\n Fast = 0.5,\n}\n\nexport type SmallWaitCursorProps = {\n color?: CSSProperties['color'];\n /**\n * Specifies whether the wait cursor should be displayed with a background.\n */\n shouldHideBackground?: boolean;\n /**\n * Specifies whether the wait cursor should be displayed.\n */\n shouldHideWaitCursor?: boolean;\n /**\n * The size of the wait cursor in pixels. Use the SmallWaitCursorSize enum for this prop.\n */\n size?: SmallWaitCursorSize;\n /**\n * The speed of the animation in seconds. Use the SmallWaitCursorSpeed enum for this prop.\n */\n speed?: SmallWaitCursorSpeed;\n};\n\nconst SmallWaitCursor: FC<SmallWaitCursorProps> = ({\n color,\n shouldHideBackground = false,\n shouldHideWaitCursor = false,\n size = SmallWaitCursorSize.Medium,\n speed = SmallWaitCursorSpeed.Medium,\n}) => (\n <StyledSmallWaitCursor shouldShowWaitCursor={!shouldHideWaitCursor} size={size}>\n <StyledSmallWaitCursorWaitCursor\n color={color}\n shouldHideBackground={shouldHideBackground}\n size={size}\n speed={speed}\n />\n {!shouldHideBackground && <StyledSmallWaitCursorBackground />}\n </StyledSmallWaitCursor>\n);\n\nSmallWaitCursor.displayName = 'SmallWaitCursor';\n\nexport default SmallWaitCursor;\n"],"mappings":";;;;;;AAEA,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;AAPlC;AAAA,IASYG,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAAC,OAAA,CAAAD,mBAAA,GAAAA,mBAAA;AAAA,IAKnBE,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAAD,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AA0BhC,MAAMC,eAAyC,GAAGC,IAAA;EAAA,IAAC;IAC/CC,KAAK;IACLC,oBAAoB,GAAG,KAAK;IAC5BC,oBAAoB,GAAG,KAAK;IAC5BC,IAAI,GAAGR,mBAAmB,CAACS,MAAM;IACjCC,KAAK,GAAGR,oBAAoB,CAACO;EACjC,CAAC,GAAAL,IAAA;EAAA,oBACGX,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,gBAAA,CAAAgB,qBAAqB;IAACC,oBAAoB,EAAE,CAACN,oBAAqB;IAACC,IAAI,EAAEA;EAAK,gBAC3Ef,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,gBAAA,CAAAkB,+BAA+B;IAC5BT,KAAK,EAAEA,KAAM;IACbC,oBAAoB,EAAEA,oBAAqB;IAC3CE,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA;EAAM,CAChB,CAAC,EACD,CAACJ,oBAAoB,iBAAIb,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,gBAAA,CAAAmB,+BAA+B,MAAE,CACzC,CAAC;AAAA,CAC3B;AAEDZ,eAAe,CAACa,WAAW,GAAG,iBAAiB;AAAC,IAAAC,QAAA,GAEjCd,eAAe;AAAAF,OAAA,CAAAF,OAAA,GAAAkB,QAAA"}
@@ -10,7 +10,7 @@ export declare const StyledSmallWaitCursorBackground: import("styled-components"
10
10
  }, never>;
11
11
  export declare const StyledSmallWaitCursorWaitCursor: import("styled-components").StyledComponent<"div", any, {
12
12
  color: SmallWaitCursorProps['color'];
13
- shouldShowBackground: SmallWaitCursorProps['shouldShowBackground'];
13
+ shouldHideBackground: SmallWaitCursorProps['shouldHideBackground'];
14
14
  size: SmallWaitCursorSize;
15
15
  speed: SmallWaitCursorSpeed;
16
16
  } & {
@@ -56,15 +56,15 @@ const StyledSmallWaitCursorWaitCursor = _styledComponents.default.div`
56
56
  position: absolute;
57
57
  top: ${_ref5 => {
58
58
  let {
59
- shouldShowBackground
59
+ shouldHideBackground
60
60
  } = _ref5;
61
- return shouldShowBackground ? 5 : 0;
61
+ return shouldHideBackground ? 0 : 5;
62
62
  }}px;
63
63
  left: ${_ref6 => {
64
64
  let {
65
- shouldShowBackground
65
+ shouldHideBackground
66
66
  } = _ref6;
67
- return shouldShowBackground ? 5 : 0;
67
+ return shouldHideBackground ? 0 : 5;
68
68
  }}px;
69
69
  z-index: 2;
70
70
  border-style: solid;
@@ -78,17 +78,17 @@ const StyledSmallWaitCursorWaitCursor = _styledComponents.default.div`
78
78
  }};
79
79
  height: ${_ref8 => {
80
80
  let {
81
- shouldShowBackground,
81
+ shouldHideBackground,
82
82
  size
83
83
  } = _ref8;
84
- return shouldShowBackground ? `${size - 10}px` : '100%';
84
+ return shouldHideBackground ? '100%' : `${size - 10}px`;
85
85
  }};
86
86
  width: ${_ref9 => {
87
87
  let {
88
- shouldShowBackground,
88
+ shouldHideBackground,
89
89
  size
90
90
  } = _ref9;
91
- return shouldShowBackground ? `${size - 10}px` : '100%';
91
+ return shouldHideBackground ? '100%' : `${size - 10}px`;
92
92
  }};
93
93
  border-radius: 50%;
94
94
  display: inline-block;
@@ -1 +1 @@
1
- {"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledSmallWaitCursor","styled","div","_ref","size","_ref2","_ref3","shouldShowWaitCursor","exports","StyledSmallWaitCursorBackground","_ref4","theme","spin","keyframes","StyledSmallWaitCursorWaitCursor","_ref5","shouldShowBackground","_ref6","_ref7","color","headline","_ref8","_ref9","_ref10","speed"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type {\n SmallWaitCursorProps,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './SmallWaitCursor';\nimport {} from './SmallWaitCursor';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n shouldShowWaitCursor: boolean;\n size: SmallWaitCursorSize;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n opacity: ${({ shouldShowWaitCursor }) => (shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: ${({ theme }: StyledSmallWaitCursorBackgroundProps) => theme['100']};\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<{\n color: SmallWaitCursorProps['color'];\n shouldShowBackground: SmallWaitCursorProps['shouldShowBackground'];\n size: SmallWaitCursorSize;\n speed: SmallWaitCursorSpeed;\n}>;\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: ${({ shouldShowBackground }) => (shouldShowBackground ? 5 : 0)}px;\n left: ${({ shouldShowBackground }) => (shouldShowBackground ? 5 : 0)}px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ color, theme }: StyledSmallWaitCursorWaitCursorProps) =>\n color ?? theme.headline};\n height: ${({ shouldShowBackground, size }) =>\n shouldShowBackground ? `${size - 10}px` : '100%'};\n width: ${({ shouldShowBackground, size }) =>\n shouldShowBackground ? `${size - 10}px` : '100%'};\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} ${({ speed }) => speed}s linear infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOAA,OAAA;AAAmC,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAA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,GAAAA,+BAAA"}
1
+ {"version":3,"file":"SmallWaitCursor.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledSmallWaitCursor","styled","div","_ref","size","_ref2","_ref3","shouldShowWaitCursor","exports","StyledSmallWaitCursorBackground","_ref4","theme","spin","keyframes","StyledSmallWaitCursorWaitCursor","_ref5","shouldHideBackground","_ref6","_ref7","color","headline","_ref8","_ref9","_ref10","speed"],"sources":["../../../src/components/small-wait-cursor/SmallWaitCursor.styles.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type {\n SmallWaitCursorProps,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './SmallWaitCursor';\nimport {} from './SmallWaitCursor';\n\ntype StyledSmallWaitCursorProps = WithTheme<{\n shouldShowWaitCursor: boolean;\n size: SmallWaitCursorSize;\n}>;\n\nexport const StyledSmallWaitCursor = styled.div<StyledSmallWaitCursorProps>`\n position: relative;\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n opacity: ${({ shouldShowWaitCursor }) => (shouldShowWaitCursor ? 1 : 0)};\n`;\n\ntype StyledSmallWaitCursorBackgroundProps = WithTheme<unknown>;\n\nexport const StyledSmallWaitCursorBackground = styled.div<StyledSmallWaitCursorBackgroundProps>`\n background-color: ${({ theme }: StyledSmallWaitCursorBackgroundProps) => theme['100']};\n border-radius: 50%;\n height: 100%;\n width: 100%;\n position: relative;\n z-index: 1;\n`;\n\ntype StyledSmallWaitCursorWaitCursorProps = WithTheme<{\n color: SmallWaitCursorProps['color'];\n shouldHideBackground: SmallWaitCursorProps['shouldHideBackground'];\n size: SmallWaitCursorSize;\n speed: SmallWaitCursorSpeed;\n}>;\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: ${({ shouldHideBackground }) => (shouldHideBackground ? 0 : 5)}px;\n left: ${({ shouldHideBackground }) => (shouldHideBackground ? 0 : 5)}px;\n z-index: 2;\n border-style: solid;\n border-width: 3px;\n border-color: ${({ color, theme }: StyledSmallWaitCursorWaitCursorProps) =>\n color ?? theme.headline};\n height: ${({ shouldHideBackground, size }) =>\n shouldHideBackground ? '100%' : `${size - 10}px`};\n width: ${({ shouldHideBackground, size }) =>\n shouldHideBackground ? '100%' : `${size - 10}px`};\n border-radius: 50%;\n display: inline-block;\n border-top: 3px solid transparent;\n\n animation: ${spin} ${({ speed }) => speed}s linear infinite;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOAA,OAAA;AAAmC,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,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MC,+BAA+B,GAAGb,yBAAM,CAACC,GAA0C;AAChG;AACA,WAAWa,KAAA;EAAA,IAAC;IAAEC;EAAqB,CAAC,GAAAD,KAAA;EAAA,OAAMC,oBAAoB,GAAG,CAAC,GAAG,CAAC;AAAA,CAAE;AACxE,YAAYC,KAAA;EAAA,IAAC;IAAED;EAAqB,CAAC,GAAAC,KAAA;EAAA,OAAMD,oBAAoB,GAAG,CAAC,GAAG,CAAC;AAAA,CAAE;AACzE;AACA;AACA;AACA,oBAAoBE,KAAA;EAAA,IAAC;IAAEC,KAAK;IAAER;EAA4C,CAAC,GAAAO,KAAA;EAAA,OACnEC,KAAK,aAALA,KAAK,cAALA,KAAK,GAAIR,KAAK,CAACS,QAAQ;AAAA,CAAC;AAChC,cAAcC,KAAA;EAAA,IAAC;IAAEL,oBAAoB;IAAEZ;EAAK,CAAC,GAAAiB,KAAA;EAAA,OACrCL,oBAAoB,GAAG,MAAM,GAAI,GAAEZ,IAAI,GAAG,EAAG,IAAG;AAAA,CAAC;AACzD,aAAakB,KAAA;EAAA,IAAC;IAAEN,oBAAoB;IAAEZ;EAAK,CAAC,GAAAkB,KAAA;EAAA,OACpCN,oBAAoB,GAAG,MAAM,GAAI,GAAEZ,IAAI,GAAG,EAAG,IAAG;AAAA,CAAC;AACzD;AACA;AACA;AACA;AACA,iBAAiBQ,IAAK,IAAGW,MAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,MAAA;EAAA,OAAKC,KAAK;AAAA,CAAC;AAC9C,CAAC;AAAChB,OAAA,CAAAM,+BAAA,GAAAA,+BAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.211",
3
+ "version": "5.0.0-beta.215",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "keywords": [
6
6
  "chayns",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "4544061ed9b829654b5fd385014285613b6e2b56"
68
+ "gitHead": "7de916b0bf3666819686bae4cc3bf900f378a498"
69
69
  }