@chayns-components/core 5.0.0-beta.1365 → 5.0.0-beta.1367
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/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js +1 -1
- package/lib/cjs/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js.map +1 -1
- package/lib/cjs/components/icon/Icon.js.map +1 -1
- package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js +1 -1
- package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
- package/lib/esm/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js +1 -1
- package/lib/esm/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js.map +1 -1
- package/lib/esm/components/icon/Icon.js.map +1 -1
- package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js +1 -1
- package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
- package/lib/types/components/icon/Icon.d.ts +1 -1
- package/package.json +4 -4
package/lib/cjs/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js
CHANGED
|
@@ -98,7 +98,7 @@ const DelayedDropdownContent = ({
|
|
|
98
98
|
duration: ANIMATION_DELAY_MS / 1000,
|
|
99
99
|
type: 'tween'
|
|
100
100
|
},
|
|
101
|
-
inert: !shouldShowContent ? 'true' :
|
|
101
|
+
inert: !shouldShowContent ? 'true' : undefined
|
|
102
102
|
}, children);
|
|
103
103
|
};
|
|
104
104
|
DelayedDropdownContent.displayName = 'DelayedDropdownContent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayedDropdownContent.js","names":["_react","_interopRequireWildcard","require","_DelayedDropdownContent","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ANIMATION_DELAY_MS","AnimationType","DelayedDropdownContent","children","shouldShowContent","onMeasure","coordinates","transform","animationState","setAnimationState","useState","None","ref","useRef","timeoutRef","measureElement","useCallback","current","height","width","x","y","getBoundingClientRect","scrollHeight","element","FadeIn","window","setTimeout","Visible","useEffect","observer","ResizeObserver","observe","disconnect","Hidden","clearTimeout","prevState","FadeOut","refCallback","reference","undefined","createElement","StyledMotionDelayedDropdownContent","$coordinates","$transform","$shouldHideContent","animate","opacity","includes","transition","duration","type","inert","displayName","_default","exports"],"sources":["../../../../../src/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { StyledMotionDelayedDropdownContent } from './DelayedDropdownContent.styles';\nimport {\n DropdownCoordinates,\n DropdownMeasurements,\n DropdownTransform,\n} from '../../../types/dropdown';\n\nconst ANIMATION_DELAY_MS = 200;\n\nenum AnimationType {\n None,\n Hidden,\n Visible,\n FadeIn,\n FadeOut,\n}\n\nexport type DelayedDropdownContentProps = {\n /**\n * The content to be rendered inside the dropdown.\n */\n children: ReactNode;\n /**\n * The absolute coordinates used to position the dropdown.\n */\n coordinates: DropdownCoordinates;\n /**\n * Callback that returns the dimensions of the dropdown after measuring.\n */\n onMeasure?: (measurements: DropdownMeasurements) => void;\n /**\n * Whether the dropdown should be rendered and animated in.\n */\n shouldShowContent: boolean;\n /**\n * CSS transform data (e.g. translate offsets) to apply for positioning.\n */\n transform: DropdownTransform;\n};\n\nconst DelayedDropdownContent: FC<DelayedDropdownContentProps> = ({\n children,\n shouldShowContent,\n onMeasure,\n coordinates,\n transform,\n}) => {\n const [animationState, setAnimationState] = useState<AnimationType>(AnimationType.None);\n\n const ref = useRef<HTMLDivElement>();\n const timeoutRef = useRef<number>();\n\n const measureElement = useCallback(() => {\n if (ref.current) {\n const { height, width, x, y } = ref.current.getBoundingClientRect();\n const { scrollHeight } = ref.current;\n\n if (typeof onMeasure === 'function') {\n onMeasure({\n x,\n y,\n height,\n scrollHeight,\n width,\n element: ref.current,\n });\n }\n\n setAnimationState(AnimationType.FadeIn);\n\n timeoutRef.current = window.setTimeout(() => {\n setAnimationState(AnimationType.Visible);\n }, ANIMATION_DELAY_MS);\n }\n }, [onMeasure]);\n\n useEffect(() => {\n if (!shouldShowContent) return () => {};\n\n const observer = new ResizeObserver(() => {\n measureElement();\n });\n\n if (ref.current) {\n observer.observe(ref.current);\n }\n\n return () => observer.disconnect();\n }, [measureElement, shouldShowContent]);\n\n useEffect(() => {\n if (shouldShowContent) {\n setAnimationState(AnimationType.Hidden);\n } else {\n clearTimeout(timeoutRef.current);\n\n setAnimationState((prevState) => {\n if (prevState === AnimationType.None) {\n return prevState;\n }\n\n return AnimationType.FadeOut;\n });\n\n window.setTimeout(() => {\n setAnimationState(AnimationType.None);\n }, ANIMATION_DELAY_MS);\n }\n }, [measureElement, shouldShowContent]);\n\n const refCallback = useCallback(\n (reference: HTMLDivElement | null) => {\n ref.current = reference ?? undefined;\n measureElement();\n },\n [measureElement],\n );\n\n if (animationState === AnimationType.None) {\n return null;\n }\n\n return (\n <StyledMotionDelayedDropdownContent\n ref={refCallback}\n $coordinates={coordinates}\n $transform={transform}\n $shouldHideContent={animationState === AnimationType.Hidden}\n animate={{\n opacity: [AnimationType.FadeIn, AnimationType.Visible].includes(animationState)\n ? 1\n : 0,\n }}\n transition={{ duration: ANIMATION_DELAY_MS / 1000, type: 'tween' }}\n inert={!shouldShowContent ? 'true' :
|
|
1
|
+
{"version":3,"file":"DelayedDropdownContent.js","names":["_react","_interopRequireWildcard","require","_DelayedDropdownContent","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ANIMATION_DELAY_MS","AnimationType","DelayedDropdownContent","children","shouldShowContent","onMeasure","coordinates","transform","animationState","setAnimationState","useState","None","ref","useRef","timeoutRef","measureElement","useCallback","current","height","width","x","y","getBoundingClientRect","scrollHeight","element","FadeIn","window","setTimeout","Visible","useEffect","observer","ResizeObserver","observe","disconnect","Hidden","clearTimeout","prevState","FadeOut","refCallback","reference","undefined","createElement","StyledMotionDelayedDropdownContent","$coordinates","$transform","$shouldHideContent","animate","opacity","includes","transition","duration","type","inert","displayName","_default","exports"],"sources":["../../../../../src/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { StyledMotionDelayedDropdownContent } from './DelayedDropdownContent.styles';\nimport {\n DropdownCoordinates,\n DropdownMeasurements,\n DropdownTransform,\n} from '../../../types/dropdown';\n\nconst ANIMATION_DELAY_MS = 200;\n\nenum AnimationType {\n None,\n Hidden,\n Visible,\n FadeIn,\n FadeOut,\n}\n\nexport type DelayedDropdownContentProps = {\n /**\n * The content to be rendered inside the dropdown.\n */\n children: ReactNode;\n /**\n * The absolute coordinates used to position the dropdown.\n */\n coordinates: DropdownCoordinates;\n /**\n * Callback that returns the dimensions of the dropdown after measuring.\n */\n onMeasure?: (measurements: DropdownMeasurements) => void;\n /**\n * Whether the dropdown should be rendered and animated in.\n */\n shouldShowContent: boolean;\n /**\n * CSS transform data (e.g. translate offsets) to apply for positioning.\n */\n transform: DropdownTransform;\n};\n\nconst DelayedDropdownContent: FC<DelayedDropdownContentProps> = ({\n children,\n shouldShowContent,\n onMeasure,\n coordinates,\n transform,\n}) => {\n const [animationState, setAnimationState] = useState<AnimationType>(AnimationType.None);\n\n const ref = useRef<HTMLDivElement>();\n const timeoutRef = useRef<number>();\n\n const measureElement = useCallback(() => {\n if (ref.current) {\n const { height, width, x, y } = ref.current.getBoundingClientRect();\n const { scrollHeight } = ref.current;\n\n if (typeof onMeasure === 'function') {\n onMeasure({\n x,\n y,\n height,\n scrollHeight,\n width,\n element: ref.current,\n });\n }\n\n setAnimationState(AnimationType.FadeIn);\n\n timeoutRef.current = window.setTimeout(() => {\n setAnimationState(AnimationType.Visible);\n }, ANIMATION_DELAY_MS);\n }\n }, [onMeasure]);\n\n useEffect(() => {\n if (!shouldShowContent) return () => {};\n\n const observer = new ResizeObserver(() => {\n measureElement();\n });\n\n if (ref.current) {\n observer.observe(ref.current);\n }\n\n return () => observer.disconnect();\n }, [measureElement, shouldShowContent]);\n\n useEffect(() => {\n if (shouldShowContent) {\n setAnimationState(AnimationType.Hidden);\n } else {\n clearTimeout(timeoutRef.current);\n\n setAnimationState((prevState) => {\n if (prevState === AnimationType.None) {\n return prevState;\n }\n\n return AnimationType.FadeOut;\n });\n\n window.setTimeout(() => {\n setAnimationState(AnimationType.None);\n }, ANIMATION_DELAY_MS);\n }\n }, [measureElement, shouldShowContent]);\n\n const refCallback = useCallback(\n (reference: HTMLDivElement | null) => {\n ref.current = reference ?? undefined;\n measureElement();\n },\n [measureElement],\n );\n\n if (animationState === AnimationType.None) {\n return null;\n }\n\n return (\n <StyledMotionDelayedDropdownContent\n ref={refCallback}\n $coordinates={coordinates}\n $transform={transform}\n $shouldHideContent={animationState === AnimationType.Hidden}\n animate={{\n opacity: [AnimationType.FadeIn, AnimationType.Visible].includes(animationState)\n ? 1\n : 0,\n }}\n transition={{ duration: ANIMATION_DELAY_MS / 1000, type: 'tween' }}\n inert={!shouldShowContent ? 'true' : undefined}\n >\n {children}\n </StyledMotionDelayedDropdownContent>\n );\n};\n\nDelayedDropdownContent.displayName = 'DelayedDropdownContent';\n\nexport default DelayedDropdownContent;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAAqF,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CA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CAAC;AAEDD,sBAAsB,CAACmD,WAAW,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhE,OAAA,GAE/CW,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["_clsx","_interopRequireDefault","require","_react","_icon","_Icon","e","__esModule","default","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","$isDisabled","undefined","$isOnClick","$size","map","iconClasses","StyledIcon","$color","includes","$fontSize","$isStacked","key","displayName","_default","exports"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n // const isIconStyleGiven =\n // /fa[srltd]|fa-(?:regular|solid|thin|light|duotone|sharp)/.test(icon);\n //\n // const iconStyle = isIconStyleGiven\n // ? undefined\n // : (theme?.iconStyle as string) ?? 'fa-regular';\n\n const iconClasses = clsx(icon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA8D,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,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UAAU,EAAE,OAAOtB,OAAO,KAAK,UAAU,IAAI,CAACD,UAAW;IACzDE,aAAa,EACT,OAAOA,aAAa,KAAK,UAAU,IAAI,CAACF,UAAU,GAAGS,iBAAiB,GAAGa,SAC5E;IACDnB,WAAW,EAAE,OAAOA,WAAW,KAAK,UAAU,IAAI,CAACH,UAAU,GAAGG,WAAW,GAAGmB,SAAU;IACxFE,KAAK,EAAEpB;EAAK,GAEXL,KAAK,CAAC0B,GAAG,CAAEb,IAAI,IAAK;IACjB,MAAMC,eAAe,GAAG,IAAAC,wBAAkB,EAACF,IAAI,CAAC;;IAEhD;IACA;IACA;IACA;IACA;IACA;;IAEA,MAAMc,WAAW,GAAG,IAAAR,aAAI,EAACN,IAAI,EAAE;MAC3B,aAAa,EAAEG,oBAAoB,IAAIF,eAAe,KAAKS;IAC/D,CAAC,CAAC;IAEF,oBACIhC,MAAA,CAAAK,OAAA,CAAAwB,aAAA,CAAC3B,KAAA,CAAAmC,UAAU;MACP9B,SAAS,EAAE6B,WAAY;MACvBE,MAAM,EAAEhB,IAAI,CAACiB,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,GAAG/B,KAAM;MACtDgC,SAAS,EAAG,CAACjB,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIN,IAAK;MAChE2B,UAAU,EAAEhB,oBAAqB;MACjCiB,GAAG,EAAEpB,IAAK;MACVY,KAAK,EAAEpB;IAAK,CACf,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDR,IAAI,CAACqC,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEXC,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["_clsx","_interopRequireDefault","require","_react","_icon","_Icon","e","__esModule","default","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","getStackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","clsx","createElement","StyledIconWrapper","$isDisabled","undefined","$isOnClick","$size","map","iconClasses","StyledIcon","$color","includes","$fontSize","$isStacked","key","displayName","_default","exports"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n // const isIconStyleGiven =\n // /fa[srltd]|fa-(?:regular|solid|thin|light|duotone|sharp)/.test(icon);\n //\n // const iconStyle = isIconStyleGiven\n // ? undefined\n // : (theme?.iconStyle as string) ?? 'fa-regular';\n\n const iconClasses = clsx(icon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA8D,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA+F9D,MAAMG,IAAmB,GAAGA,CAAC;EACzBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,aAAa;EACbC,WAAW;EACXC,IAAI,GAAG,EAAE;EACTC;AACJ,CAAC,KAAK;EACF,MAAMC,WAA+C,GAAIC,KAAK,IAAK;IAC/D,IAAIF,qBAAqB,EAAE;MACvBE,KAAK,CAACC,eAAe,CAAC,CAAC;IAC3B;IAEA,IAAI,OAAOP,OAAO,KAAK,UAAU,EAAE;MAC/B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,IAAAC,wBAAkB,EAACF,IAAI,CAAC;;IAEhD;IACA;IACA;IACA;IACA;IACA;;IAEA,MAAMc,WAAW,GAAG,IAAAR,aAAI,EAACN,IAAI,EAAE;MAC3B,aAAa,EAAEG,oBAAoB,IAAIF,eAAe,KAAKS;IAC/D,CAAC,CAAC;IAEF,oBACIhC,MAAA,CAAAK,OAAA,CAAAwB,aAAA,CAAC3B,KAAA,CAAAmC,UAAU;MACP9B,SAAS,EAAE6B,WAAY;MACvBE,MAAM,EAAEhB,IAAI,CAACiB,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,GAAG/B,KAAM;MACtDgC,SAAS,EAAG,CAACjB,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIN,IAAK;MAChE2B,UAAU,EAAEhB,oBAAqB;MACjCiB,GAAG,EAAEpB,IAAK;MACVY,KAAK,EAAEpB;IAAK,CACf,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDR,IAAI,CAACqC,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEXC,IAAI","ignoreList":[]}
|
|
@@ -55,7 +55,7 @@ const SearchBoxBody = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
55
55
|
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_SearchBoxBody.StyledSearchBoxBody, {
|
|
56
56
|
onClick: handlePreventDefault,
|
|
57
57
|
ref: ref,
|
|
58
|
-
inert: !shouldShow ? 'true' :
|
|
58
|
+
inert: !shouldShow ? 'true' : undefined
|
|
59
59
|
}, filterButtons && (filterButtons === null || filterButtons === void 0 ? void 0 : filterButtons.length) > 1 && /*#__PURE__*/_react.default.createElement(_SearchBoxBody.StyledSearchBoxBodyHead, {
|
|
60
60
|
ref: headRef,
|
|
61
61
|
$hasScrolled: hasScrolled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBoxBody.js","names":["_react","_interopRequireWildcard","require","_element","_uuid","_searchBox","_FilterButtons","_interopRequireDefault","_SearchBoxBody","_chaynsApi","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SearchBoxBody","forwardRef","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","useState","currentGroupName","setCurrentGroupName","headRef","useRef","browser","useDevice","headSize","useElementSize","uuid","useUuid","headHeight","useMemo","useEffect","element","document","getElementById","length","getCurrentGroupName","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","useCallback","scrollTop","target","createElement","StyledSearchBoxBody","onClick","inert","StyledSearchBoxBodyHead","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","StyledSearchBoxBodyHeadGroupName","replace","StyledSearchBoxBodyContent","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName","_default","exports"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\nimport { useDevice } from 'chayns-api';\nimport { BrowserName } from '../../../types/chayns';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const { browser } = useDevice();\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' : 'false'}\n >\n {filterButtons && filterButtons?.length > 1 && (\n <StyledSearchBoxBodyHead\n ref={headRef}\n $hasScrolled={hasScrolled}\n $hasGroupName={!!currentGroupName}\n >\n {!shouldHideFilterButtons && (\n <FilterButtons\n items={filterButtons}\n size={0}\n onSelect={onGroupSelect}\n selectedItemIds={selectedGroups}\n />\n )}\n <StyledSearchBoxBodyHeadGroupName>\n {currentGroupName.replace('_', '')}\n </StyledSearchBoxBodyHeadGroupName>\n </StyledSearchBoxBodyHead>\n )}\n <StyledSearchBoxBodyContent\n $height={height}\n $headHeight={headHeight}\n key=\"content\"\n id={`searchBoxContent__${uuid}`}\n $browser={(browser as { name: BrowserName })?.name}\n tabIndex={0}\n onScroll={handleScroll}\n >\n {children}\n </StyledSearchBoxBodyContent>\n </StyledSearchBoxBody>\n ),\n [\n browser,\n children,\n currentGroupName,\n filterButtons,\n handleScroll,\n hasScrolled,\n headHeight,\n height,\n onGroupSelect,\n ref,\n selectedGroups,\n shouldHideFilterButtons,\n shouldShow,\n uuid,\n ],\n );\n },\n);\n\nSearchBoxBody.displayName = 'SearchBoxBody';\n\nexport default SearchBoxBody;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAMA,IAAAO,UAAA,GAAAP,OAAA;AAAuC,SAAAK,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAA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,EACVnB,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVe,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDrB,aAAa,CAAC6D,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhF,OAAA,GAE7BiB,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SearchBoxBody.js","names":["_react","_interopRequireWildcard","require","_element","_uuid","_searchBox","_FilterButtons","_interopRequireDefault","_SearchBoxBody","_chaynsApi","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SearchBoxBody","forwardRef","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","useState","currentGroupName","setCurrentGroupName","headRef","useRef","browser","useDevice","headSize","useElementSize","uuid","useUuid","headHeight","useMemo","useEffect","element","document","getElementById","length","getCurrentGroupName","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","useCallback","scrollTop","target","createElement","StyledSearchBoxBody","onClick","inert","undefined","StyledSearchBoxBodyHead","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","StyledSearchBoxBodyHeadGroupName","replace","StyledSearchBoxBodyContent","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName","_default","exports"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\nimport { useDevice } from 'chayns-api';\nimport { BrowserName } from '../../../types/chayns';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const { browser } = useDevice();\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' : undefined}\n >\n {filterButtons && filterButtons?.length > 1 && (\n <StyledSearchBoxBodyHead\n ref={headRef}\n $hasScrolled={hasScrolled}\n $hasGroupName={!!currentGroupName}\n >\n {!shouldHideFilterButtons && (\n <FilterButtons\n items={filterButtons}\n size={0}\n onSelect={onGroupSelect}\n selectedItemIds={selectedGroups}\n />\n )}\n <StyledSearchBoxBodyHeadGroupName>\n {currentGroupName.replace('_', '')}\n </StyledSearchBoxBodyHeadGroupName>\n </StyledSearchBoxBodyHead>\n )}\n <StyledSearchBoxBodyContent\n $height={height}\n $headHeight={headHeight}\n key=\"content\"\n id={`searchBoxContent__${uuid}`}\n $browser={(browser as { name: BrowserName })?.name}\n tabIndex={0}\n onScroll={handleScroll}\n >\n {children}\n </StyledSearchBoxBodyContent>\n </StyledSearchBoxBody>\n ),\n [\n browser,\n children,\n currentGroupName,\n filterButtons,\n handleScroll,\n hasScrolled,\n headHeight,\n height,\n onGroupSelect,\n ref,\n selectedGroups,\n shouldHideFilterButtons,\n shouldShow,\n uuid,\n ],\n );\n },\n);\n\nSearchBoxBody.displayName = 'SearchBoxBody';\n\nexport default SearchBoxBody;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAMA,IAAAO,UAAA,GAAAP,OAAA;AAAuC,SAAAK,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,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AAC,SAAS;IACbC,EAAE,EAAE,qBAAqBpC,IAAI,EAAG;IAChCqC,QAAQ,EAAGzC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAA4B0C,IAAK;IACnDC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAE1B;EAAa,GAEtB9B,QACuB,CACX,CACxB,EACD,CACIY,OAAO,EACPZ,QAAQ,EACRQ,gBAAgB,EAChBX,aAAa,EACbiC,YAAY,EACZzB,WAAW,EACXa,UAAU,EACVnB,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVe,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDrB,aAAa,CAAC8D,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAE7BiB,aAAa","ignoreList":[]}
|
package/lib/esm/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.js
CHANGED
|
@@ -91,7 +91,7 @@ const DelayedDropdownContent = ({
|
|
|
91
91
|
duration: ANIMATION_DELAY_MS / 1000,
|
|
92
92
|
type: 'tween'
|
|
93
93
|
},
|
|
94
|
-
inert: !shouldShowContent ? 'true' :
|
|
94
|
+
inert: !shouldShowContent ? 'true' : undefined
|
|
95
95
|
}, children);
|
|
96
96
|
};
|
|
97
97
|
DelayedDropdownContent.displayName = 'DelayedDropdownContent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayedDropdownContent.js","names":["React","useCallback","useEffect","useRef","useState","StyledMotionDelayedDropdownContent","ANIMATION_DELAY_MS","AnimationType","DelayedDropdownContent","children","shouldShowContent","onMeasure","coordinates","transform","animationState","setAnimationState","None","ref","timeoutRef","measureElement","current","height","width","x","y","getBoundingClientRect","scrollHeight","element","FadeIn","window","setTimeout","Visible","observer","ResizeObserver","observe","disconnect","Hidden","clearTimeout","prevState","FadeOut","refCallback","reference","undefined","createElement","$coordinates","$transform","$shouldHideContent","animate","opacity","includes","transition","duration","type","inert","displayName"],"sources":["../../../../../src/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { StyledMotionDelayedDropdownContent } from './DelayedDropdownContent.styles';\nimport {\n DropdownCoordinates,\n DropdownMeasurements,\n DropdownTransform,\n} from '../../../types/dropdown';\n\nconst ANIMATION_DELAY_MS = 200;\n\nenum AnimationType {\n None,\n Hidden,\n Visible,\n FadeIn,\n FadeOut,\n}\n\nexport type DelayedDropdownContentProps = {\n /**\n * The content to be rendered inside the dropdown.\n */\n children: ReactNode;\n /**\n * The absolute coordinates used to position the dropdown.\n */\n coordinates: DropdownCoordinates;\n /**\n * Callback that returns the dimensions of the dropdown after measuring.\n */\n onMeasure?: (measurements: DropdownMeasurements) => void;\n /**\n * Whether the dropdown should be rendered and animated in.\n */\n shouldShowContent: boolean;\n /**\n * CSS transform data (e.g. translate offsets) to apply for positioning.\n */\n transform: DropdownTransform;\n};\n\nconst DelayedDropdownContent: FC<DelayedDropdownContentProps> = ({\n children,\n shouldShowContent,\n onMeasure,\n coordinates,\n transform,\n}) => {\n const [animationState, setAnimationState] = useState<AnimationType>(AnimationType.None);\n\n const ref = useRef<HTMLDivElement>();\n const timeoutRef = useRef<number>();\n\n const measureElement = useCallback(() => {\n if (ref.current) {\n const { height, width, x, y } = ref.current.getBoundingClientRect();\n const { scrollHeight } = ref.current;\n\n if (typeof onMeasure === 'function') {\n onMeasure({\n x,\n y,\n height,\n scrollHeight,\n width,\n element: ref.current,\n });\n }\n\n setAnimationState(AnimationType.FadeIn);\n\n timeoutRef.current = window.setTimeout(() => {\n setAnimationState(AnimationType.Visible);\n }, ANIMATION_DELAY_MS);\n }\n }, [onMeasure]);\n\n useEffect(() => {\n if (!shouldShowContent) return () => {};\n\n const observer = new ResizeObserver(() => {\n measureElement();\n });\n\n if (ref.current) {\n observer.observe(ref.current);\n }\n\n return () => observer.disconnect();\n }, [measureElement, shouldShowContent]);\n\n useEffect(() => {\n if (shouldShowContent) {\n setAnimationState(AnimationType.Hidden);\n } else {\n clearTimeout(timeoutRef.current);\n\n setAnimationState((prevState) => {\n if (prevState === AnimationType.None) {\n return prevState;\n }\n\n return AnimationType.FadeOut;\n });\n\n window.setTimeout(() => {\n setAnimationState(AnimationType.None);\n }, ANIMATION_DELAY_MS);\n }\n }, [measureElement, shouldShowContent]);\n\n const refCallback = useCallback(\n (reference: HTMLDivElement | null) => {\n ref.current = reference ?? undefined;\n measureElement();\n },\n [measureElement],\n );\n\n if (animationState === AnimationType.None) {\n return null;\n }\n\n return (\n <StyledMotionDelayedDropdownContent\n ref={refCallback}\n $coordinates={coordinates}\n $transform={transform}\n $shouldHideContent={animationState === AnimationType.Hidden}\n animate={{\n opacity: [AnimationType.FadeIn, AnimationType.Visible].includes(animationState)\n ? 1\n : 0,\n }}\n transition={{ duration: ANIMATION_DELAY_MS / 1000, type: 'tween' }}\n inert={!shouldShowContent ? 'true' :
|
|
1
|
+
{"version":3,"file":"DelayedDropdownContent.js","names":["React","useCallback","useEffect","useRef","useState","StyledMotionDelayedDropdownContent","ANIMATION_DELAY_MS","AnimationType","DelayedDropdownContent","children","shouldShowContent","onMeasure","coordinates","transform","animationState","setAnimationState","None","ref","timeoutRef","measureElement","current","height","width","x","y","getBoundingClientRect","scrollHeight","element","FadeIn","window","setTimeout","Visible","observer","ResizeObserver","observe","disconnect","Hidden","clearTimeout","prevState","FadeOut","refCallback","reference","undefined","createElement","$coordinates","$transform","$shouldHideContent","animate","opacity","includes","transition","duration","type","inert","displayName"],"sources":["../../../../../src/components/dropdown-body-wrapper/delayed-dropdown-content/DelayedDropdownContent.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { StyledMotionDelayedDropdownContent } from './DelayedDropdownContent.styles';\nimport {\n DropdownCoordinates,\n DropdownMeasurements,\n DropdownTransform,\n} from '../../../types/dropdown';\n\nconst ANIMATION_DELAY_MS = 200;\n\nenum AnimationType {\n None,\n Hidden,\n Visible,\n FadeIn,\n FadeOut,\n}\n\nexport type DelayedDropdownContentProps = {\n /**\n * The content to be rendered inside the dropdown.\n */\n children: ReactNode;\n /**\n * The absolute coordinates used to position the dropdown.\n */\n coordinates: DropdownCoordinates;\n /**\n * Callback that returns the dimensions of the dropdown after measuring.\n */\n onMeasure?: (measurements: DropdownMeasurements) => void;\n /**\n * Whether the dropdown should be rendered and animated in.\n */\n shouldShowContent: boolean;\n /**\n * CSS transform data (e.g. translate offsets) to apply for positioning.\n */\n transform: DropdownTransform;\n};\n\nconst DelayedDropdownContent: FC<DelayedDropdownContentProps> = ({\n children,\n shouldShowContent,\n onMeasure,\n coordinates,\n transform,\n}) => {\n const [animationState, setAnimationState] = useState<AnimationType>(AnimationType.None);\n\n const ref = useRef<HTMLDivElement>();\n const timeoutRef = useRef<number>();\n\n const measureElement = useCallback(() => {\n if (ref.current) {\n const { height, width, x, y } = ref.current.getBoundingClientRect();\n const { scrollHeight } = ref.current;\n\n if (typeof onMeasure === 'function') {\n onMeasure({\n x,\n y,\n height,\n scrollHeight,\n width,\n element: ref.current,\n });\n }\n\n setAnimationState(AnimationType.FadeIn);\n\n timeoutRef.current = window.setTimeout(() => {\n setAnimationState(AnimationType.Visible);\n }, ANIMATION_DELAY_MS);\n }\n }, [onMeasure]);\n\n useEffect(() => {\n if (!shouldShowContent) return () => {};\n\n const observer = new ResizeObserver(() => {\n measureElement();\n });\n\n if (ref.current) {\n observer.observe(ref.current);\n }\n\n return () => observer.disconnect();\n }, [measureElement, shouldShowContent]);\n\n useEffect(() => {\n if (shouldShowContent) {\n setAnimationState(AnimationType.Hidden);\n } else {\n clearTimeout(timeoutRef.current);\n\n setAnimationState((prevState) => {\n if (prevState === AnimationType.None) {\n return prevState;\n }\n\n return AnimationType.FadeOut;\n });\n\n window.setTimeout(() => {\n setAnimationState(AnimationType.None);\n }, ANIMATION_DELAY_MS);\n }\n }, [measureElement, shouldShowContent]);\n\n const refCallback = useCallback(\n (reference: HTMLDivElement | null) => {\n ref.current = reference ?? undefined;\n measureElement();\n },\n [measureElement],\n );\n\n if (animationState === AnimationType.None) {\n return null;\n }\n\n return (\n <StyledMotionDelayedDropdownContent\n ref={refCallback}\n $coordinates={coordinates}\n $transform={transform}\n $shouldHideContent={animationState === AnimationType.Hidden}\n animate={{\n opacity: [AnimationType.FadeIn, AnimationType.Visible].includes(animationState)\n ? 1\n : 0,\n }}\n transition={{ duration: ANIMATION_DELAY_MS / 1000, type: 'tween' }}\n inert={!shouldShowContent ? 'true' : undefined}\n >\n {children}\n </StyledMotionDelayedDropdownContent>\n );\n};\n\nDelayedDropdownContent.displayName = 'DelayedDropdownContent';\n\nexport default DelayedDropdownContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAmBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACtF,SAASC,kCAAkC,QAAQ,iCAAiC;AAOpF,MAAMC,kBAAkB,GAAG,GAAG;AAAC,IAE1BC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA,EAAbA,aAAa;AA+BlB,MAAMC,sBAAuD,GAAGA,CAAC;EAC7DC,QAAQ;EACRC,iBAAiB;EACjBC,SAAS;EACTC,WAAW;EACXC;AACJ,CAAC,KAAK;EACF,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGX,QAAQ,CAAgBG,aAAa,CAACS,IAAI,CAAC;EAEvF,MAAMC,GAAG,GAAGd,MAAM,CAAiB,CAAC;EACpC,MAAMe,UAAU,GAAGf,MAAM,CAAS,CAAC;EAEnC,MAAMgB,cAAc,GAAGlB,WAAW,CAAC,MAAM;IACrC,IAAIgB,GAAG,CAAC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","getStackSizeFactor","StyledIcon","StyledIconWrapper","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","createElement","$isDisabled","undefined","$isOnClick","$size","map","iconClasses","$color","includes","$fontSize","$isStacked","key","displayName"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n // const isIconStyleGiven =\n // /fa[srltd]|fa-(?:regular|solid|thin|light|duotone|sharp)/.test(icon);\n //\n // const iconStyle = isIconStyleGiven\n // ? undefined\n // : (theme?.iconStyle as string) ?? 'fa-regular';\n\n const iconClasses = clsx(icon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}\n key={icon}\n $size={size}\n />\n );\n })}\n </StyledIconWrapper>\n );\n};\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,OAAOC,KAAK,MAAiC,OAAO;AACpD,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,eAAe;AA+F7D,MAAMC,IAAmB,GAAGA,CAAC;EACzBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPC,aAAa;EACbC,WAAW;EACXC,IAAI,GAAG,EAAE;EACTC;AACJ,CAAC,KAAK;EACF,MAAMC,WAA+C,GAAIC,KAAK,IAAK;IAC/D,IAAIF,qBAAqB,EAAE;MACvBE,KAAK,CAACC,eAAe,CAAC,CAAC;IAC3B;IAEA,IAAI,OAAOP,OAAO,KAAK,UAAU,EAAE;MAC/BA,OAAO,CAACM,KAAK,CAA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;;IAEA,MAAMW,WAAW,GAAGhC,IAAI,CAACqB,IAAI,EAAE;MAC3B,aAAa,EAAEE,oBAAoB,IAAID,eAAe,KAAKM;IAC/D,CAAC,CAAC;IAEF,oBACI3B,KAAA,CAAAyB,aAAA,CAACvB,UAAU;MACPG,SAAS,EAAE0B,WAAY;MACvBC,MAAM,EAAEZ,IAAI,CAACa,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,GAAG3B,KAAM;MACtD4B,SAAS,EAAG,CAACb,eAAe,IAAI,CAAC,IAAIH,kBAAkB,GAAIN,IAAK;MAChEuB,UAAU,EAAEb,oBAAqB;MACjCc,GAAG,EAAEhB,IAAK;MACVS,KAAK,EAAEjB;IAAK,CACf,CAAC;EAEV,CAAC,CACc,CAAC;AAE5B,CAAC;AAEDR,IAAI,CAACiC,WAAW,GAAG,MAAM;AAEzB,eAAejC,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["clsx","React","getStackSizeFactor","StyledIcon","StyledIconWrapper","Icon","className","color","icons","isDisabled","onClick","onDoubleClick","onMouseDown","size","shouldStopPropagation","handleClick","event","stopPropagation","handleDoubleClick","maxStackSizeFactor","forEach","icon","stackSizeFactor","shouldUseStackedIcon","length","wrapperClasses","createElement","$isDisabled","undefined","$isOnClick","$size","map","iconClasses","$color","includes","$fontSize","$isStacked","key","displayName"],"sources":["../../../../src/components/icon/Icon.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React, { FC, MouseEventHandler } from 'react';\nimport { getStackSizeFactor } from '../../utils/icon';\nimport { StyledIcon, StyledIconWrapper } from './Icon.styles';\n\nexport type IconProps = {\n /**\n * Additional class name for the icon wrapper element.\n * @description\n * This class name is applied to the wrapper element that contains the icon. It can be used to\n * style the icon wrapper element.\n * @example\n * <Icon className=\"my-custom-class\" icons={['fa-user']} />\n * @optional\n */\n className?: string;\n /**\n * The color of the icon.\n * @description\n * This property can be used to set the color of the icon. The color is only used for icons that\n * don't have a predefined color (e.g., 'fa-inverse' icons will always be white). If no color is\n * specified, the icon color of the theme or the text color will be used.\n * @example\n * <Icon color=\"red\" icons={['fa-user']} />\n * @optional\n */\n color?: string;\n /**\n * The icon(s) to be displayed.\n * @description\n * This property can be used to set the icon(s) to be displayed. The icon(s) must be specified as\n * an array of strings. Each string must be a valid icon name.\n * @example\n * <Icon icons={['fa-user']} />\n * <Icon icons={['fa fa-circle fa-stack-2x', 'fa fa-french-fries fa-inverse']} />\n */\n icons: string[];\n /**\n * Whether the icon should be disabled.\n * @description\n * This property can be used to disable the icon. When the icon is disabled, it will not be\n * clickable, and it will not emit any events.\n * @example\n * <Icon icons={['fa-user']} isDisabled />\n * @optional\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when the icon is clicked.\n * @description\n * This function is executed when the icon is clicked. It can be used to handle the click event.\n * @example\n * <Icon icons={['fa-user']} onClick={() => console.log('Icon clicked')} />\n * @optional\n */\n onClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is double-clicked.\n * @description\n * This function is executed when the icon is double-clicked. It can be used to handle the\n * double-click event.\n * @example\n * <Icon icons={['fa-user']} onDoubleClick={() => console.log('Icon double-clicked')} />\n * @optional\n */\n onDoubleClick?: MouseEventHandler<HTMLSpanElement>;\n /**\n * Function to be executed when the icon is pressed.\n * @description\n * This function is executed when the icon is pressed. It can be used to handle the mouse down event.\n * @example\n * <Icon icons={['fa-user']} onMouseDown={() => console.log('Icon pressed')} />\n * @optional\n */\n onMouseDown?: MouseEventHandler<HTMLSpanElement>;\n /**\n * The size of the icon.\n * @description\n * This property can be used to set the size of the icon. The size must be specified as a number\n * in pixels.\n * @default 15\n * @example\n * <Icon icons={['fa-user']} size={20} />\n * @optional\n */\n size?: number;\n /**\n * Stops event propagation on click.\n * @description\n * This property can be used to prevent the icon from propagating the click event to its parent\n * elements.\n * @example\n * <Icon icons={['fa-user']} shouldStopPropagation />\n * @optional\n */\n shouldStopPropagation?: boolean;\n};\n\nconst Icon: FC<IconProps> = ({\n className,\n color,\n icons,\n isDisabled,\n onClick,\n onDoubleClick,\n onMouseDown,\n size = 15,\n shouldStopPropagation,\n}) => {\n const handleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n const handleDoubleClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n if (shouldStopPropagation) {\n event.stopPropagation();\n }\n\n if (typeof onDoubleClick === 'function') {\n onDoubleClick(event);\n }\n };\n\n let maxStackSizeFactor = 1;\n\n icons.forEach((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n if (stackSizeFactor && stackSizeFactor > maxStackSizeFactor) {\n maxStackSizeFactor = stackSizeFactor;\n }\n });\n\n const shouldUseStackedIcon = icons.length > 1;\n\n const wrapperClasses = clsx(\n 'beta-chayns-icon',\n shouldUseStackedIcon ? 'fa-stack' : '',\n className,\n );\n\n return (\n <StyledIconWrapper\n className={wrapperClasses}\n $isDisabled={isDisabled}\n onClick={typeof onClick === 'function' && !isDisabled ? handleClick : undefined}\n $isOnClick={typeof onClick === 'function' && !isDisabled}\n onDoubleClick={\n typeof onDoubleClick === 'function' && !isDisabled ? handleDoubleClick : undefined\n }\n onMouseDown={typeof onMouseDown === 'function' && !isDisabled ? onMouseDown : undefined}\n $size={size}\n >\n {icons.map((icon) => {\n const stackSizeFactor = getStackSizeFactor(icon);\n\n // const isIconStyleGiven =\n // /fa[srltd]|fa-(?:regular|solid|thin|light|duotone|sharp)/.test(icon);\n //\n // const iconStyle = isIconStyleGiven\n // ? undefined\n // : (theme?.iconStyle as string) ?? 'fa-regular';\n\n const iconClasses = clsx(icon, {\n 'fa-stack-1x': shouldUseStackedIcon && stackSizeFactor === undefined,\n });\n\n return (\n <StyledIcon\n className={iconClasses}\n $color={icon.includes('fa-inverse') ? 'white' : color}\n $fontSize={((stackSizeFactor || 1) / maxStackSizeFactor) * size}\n $isStacked={shouldUseStackedIcon}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useMemo(() => /*#__PURE__*/React.createElement(StyledSearchBoxBody, {
|
|
48
48
|
onClick: handlePreventDefault,
|
|
49
49
|
ref: ref,
|
|
50
|
-
inert: !shouldShow ? 'true' :
|
|
50
|
+
inert: !shouldShow ? 'true' : undefined
|
|
51
51
|
}, filterButtons && filterButtons?.length > 1 && /*#__PURE__*/React.createElement(StyledSearchBoxBodyHead, {
|
|
52
52
|
ref: headRef,
|
|
53
53
|
$hasScrolled: hasScrolled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBoxBody.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useRef","useState","useElementSize","useUuid","getCurrentGroupName","FilterButtons","StyledSearchBoxBody","StyledSearchBoxBodyContent","StyledSearchBoxBodyHead","StyledSearchBoxBodyHeadGroupName","useDevice","SearchBoxBody","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","currentGroupName","setCurrentGroupName","headRef","browser","headSize","uuid","headHeight","element","document","getElementById","length","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","scrollTop","target","createElement","onClick","inert","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","replace","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\nimport { useDevice } from 'chayns-api';\nimport { BrowserName } from '../../../types/chayns';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const { browser } = useDevice();\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' :
|
|
1
|
+
{"version":3,"file":"SearchBoxBody.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useRef","useState","useElementSize","useUuid","getCurrentGroupName","FilterButtons","StyledSearchBoxBody","StyledSearchBoxBodyContent","StyledSearchBoxBodyHead","StyledSearchBoxBodyHeadGroupName","useDevice","SearchBoxBody","filterButtons","selectedGroups","height","children","shouldShow","onGroupSelect","shouldHideFilterButtons","ref","hasScrolled","setHasScrolled","currentGroupName","setCurrentGroupName","headRef","browser","headSize","uuid","headHeight","element","document","getElementById","length","handlePreventDefault","event","preventDefault","stopPropagation","handleScroll","scrollTop","target","createElement","onClick","inert","undefined","$hasScrolled","$hasGroupName","items","size","onSelect","selectedItemIds","replace","$height","$headHeight","key","id","$browser","name","tabIndex","onScroll","displayName"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEvent,\n UIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useElementSize } from '../../../hooks/element';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IFilterButtonItem } from '../../../types/filterButtons';\nimport { getCurrentGroupName } from '../../../utils/searchBox';\nimport FilterButtons from '../../filter-buttons/FilterButtons';\nimport {\n StyledSearchBoxBody,\n StyledSearchBoxBodyContent,\n StyledSearchBoxBodyHead,\n StyledSearchBoxBodyHeadGroupName,\n} from './SearchBoxBody.styles';\nimport { useDevice } from 'chayns-api';\nimport { BrowserName } from '../../../types/chayns';\n\nexport type SearchBoxBodyProps = {\n children: ReactNode;\n filterButtons?: IFilterButtonItem[];\n selectedGroups?: string[];\n height: number;\n onGroupSelect?: (keys: string[]) => void;\n shouldHideFilterButtons?: boolean;\n shouldShow: boolean;\n};\n\nconst SearchBoxBody = forwardRef<HTMLDivElement, SearchBoxBodyProps>(\n (\n {\n filterButtons,\n selectedGroups,\n height,\n children,\n shouldShow,\n onGroupSelect,\n shouldHideFilterButtons,\n },\n ref,\n ) => {\n const [hasScrolled, setHasScrolled] = useState(false);\n const [currentGroupName, setCurrentGroupName] = useState('');\n\n const headRef = useRef<HTMLDivElement>(null);\n\n const { browser } = useDevice();\n\n const headSize = useElementSize(headRef);\n\n const uuid = useUuid();\n\n const headHeight = useMemo(\n () => (headSize?.height ? headSize.height + 15 : 0),\n [headSize?.height],\n );\n\n useEffect(() => {\n const element = document.getElementById(`searchBoxContent__${uuid}`);\n\n if (\n element &&\n ((selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1)\n ) {\n setCurrentGroupName(getCurrentGroupName(element));\n } else {\n setCurrentGroupName('');\n }\n }, [uuid, children, selectedGroups]);\n\n const handlePreventDefault = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const handleScroll = useCallback(\n (event: UIEvent) => {\n const { scrollTop } = event.target as HTMLDivElement;\n\n setHasScrolled(scrollTop > 1);\n\n if (\n (selectedGroups?.length === 1 && selectedGroups[0] === 'all') ||\n selectedGroups?.length !== 1\n ) {\n setCurrentGroupName(getCurrentGroupName(event.target as HTMLDivElement));\n }\n },\n [selectedGroups],\n );\n\n return useMemo(\n () => (\n <StyledSearchBoxBody\n onClick={handlePreventDefault}\n ref={ref}\n inert={!shouldShow ? 'true' : undefined}\n >\n {filterButtons && filterButtons?.length > 1 && (\n <StyledSearchBoxBodyHead\n ref={headRef}\n $hasScrolled={hasScrolled}\n $hasGroupName={!!currentGroupName}\n >\n {!shouldHideFilterButtons && (\n <FilterButtons\n items={filterButtons}\n size={0}\n onSelect={onGroupSelect}\n selectedItemIds={selectedGroups}\n />\n )}\n <StyledSearchBoxBodyHeadGroupName>\n {currentGroupName.replace('_', '')}\n </StyledSearchBoxBodyHeadGroupName>\n </StyledSearchBoxBodyHead>\n )}\n <StyledSearchBoxBodyContent\n $height={height}\n $headHeight={headHeight}\n key=\"content\"\n id={`searchBoxContent__${uuid}`}\n $browser={(browser as { name: BrowserName })?.name}\n tabIndex={0}\n onScroll={handleScroll}\n >\n {children}\n </StyledSearchBoxBodyContent>\n </StyledSearchBoxBody>\n ),\n [\n browser,\n children,\n currentGroupName,\n filterButtons,\n handleScroll,\n hasScrolled,\n headHeight,\n height,\n onGroupSelect,\n ref,\n selectedGroups,\n shouldHideFilterButtons,\n shouldShow,\n uuid,\n ],\n );\n },\n);\n\nSearchBoxBody.displayName = 'SearchBoxBody';\n\nexport default SearchBoxBody;\n"],"mappings":"AAAA,OAAOA,KAAK,IACRC,UAAU,EAGVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEL,OAAO;AACd,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,OAAO,QAAQ,qBAAqB;AAE7C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,OAAOC,aAAa,MAAM,oCAAoC;AAC9D,SACIC,mBAAmB,EACnBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,gCAAgC,QAC7B,wBAAwB;AAC/B,SAASC,SAAS,QAAQ,YAAY;AAatC,MAAMC,aAAa,gBAAGf,UAAU,CAC5B,CACI;EACIgB,aAAa;EACbC,cAAc;EACdC,MAAM;EACNC,QAAQ;EACRC,UAAU;EACVC,aAAa;EACbC;AACJ,CAAC,EACDC,GAAG,KACF;EACD,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGpB,QAAQ,CAAC,KAAK,CAAC;EACrD,MAAM,CAACqB,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGtB,QAAQ,CAAC,EAAE,CAAC;EAE5D,MAAMuB,OAAO,GAAGxB,MAAM,CAAiB,IAAI,CAAC;EAE5C,MAAM;IAAEyB;EAAQ,CAAC,GAAGf,SAAS,CAAC,CAAC;EAE/B,MAAMgB,QAAQ,GAAGxB,cAAc,CAACsB,OAAO,CAAC;EAExC,MAAMG,IAAI,GAAGxB,OAAO,CAAC,CAAC;EAEtB,MAAMyB,UAAU,GAAG7B,OAAO,CACtB,MAAO2B,QAAQ,EAAEZ,MAAM,GAAGY,QAAQ,CAACZ,MAAM,GAAG,EAAE,GAAG,CAAE,EACnD,CAACY,QAAQ,EAAEZ,MAAM,CACrB,CAAC;EAEDh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ACvCrC,KAAA,CAAA6C,aAAA,CAAChC,uBAAuB;IACpBW,GAAG,EAAEK,OAAQ;IACboB,YAAY,EAAExB,WAAY;IAC1ByB,aAAa,EAAE,CAAC,CAACvB;EAAiB,GAEjC,CAACJ,uBAAuB,iBACrBvB,KAAA,CAAA6C,aAAA,CAACnC,aAAa;IACVyC,KAAK,EAAElC,aAAc;IACrBmC,IAAI,EAAE,CAAE;IACRC,QAAQ,EAAE/B,aAAc;IACxBgC,eAAe,EAAEpC;EAAe,CACnC,CACJ,eACDlB,KAAA,CAAA6C,aAAA,CAAC/B,gCAAgC,QAC5Ba,gBAAgB,CAAC4B,OAAO,CAAC,GAAG,EAAE,EAAE,CACH,CACb,CAC5B,eACDvD,KAAA,CAAA6C,aAAA,CAACjC,0BAA0B;IACvB4C,OAAO,EAAErC,MAAO;IAChBsC,WAAW,EAAExB,UAAW;IACxByB,GAAG,EAAC,SAAS;IACbC,EAAE,EAAE,qBAAqB3B,IAAI,EAAG;IAChC4B,QAAQ,EAAG9B,OAAO,EAA4B+B,IAAK;IACnDC,QAAQ,EAAE,CAAE;IACZC,QAAQ,EAAErB;EAAa,GAEtBtB,QACuB,CACX,CACxB,EACD,CACIU,OAAO,EACPV,QAAQ,EACRO,gBAAgB,EAChBV,aAAa,EACbyB,YAAY,EACZjB,WAAW,EACXQ,UAAU,EACVd,MAAM,EACNG,aAAa,EACbE,GAAG,EACHN,cAAc,EACdK,uBAAuB,EACvBF,UAAU,EACVW,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAEDhB,aAAa,CAACgD,WAAW,GAAG,eAAe;AAE3C,eAAehD,aAAa","ignoreList":[]}
|
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.1367",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@types/styled-components": "^5.1.36",
|
|
63
63
|
"@types/uuid": "^10.0.0",
|
|
64
64
|
"babel-loader": "^9.2.1",
|
|
65
|
-
"chayns-api": "^2.5.
|
|
65
|
+
"chayns-api": "^2.5.6",
|
|
66
66
|
"cross-env": "^7.0.3",
|
|
67
67
|
"lerna": "^8.2.4",
|
|
68
68
|
"react": "^18.3.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typescript": "^5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@chayns/colors": "^2.0.
|
|
74
|
+
"@chayns/colors": "^2.0.1",
|
|
75
75
|
"@chayns/uac-service": "~0.0.62",
|
|
76
76
|
"clsx": "^2.1.1",
|
|
77
77
|
"uuid": "^10.0.0"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "8ba7c504842ddfd07c35bc8542c799843c87044e"
|
|
90
90
|
}
|