@chayns-components/core 5.4.16 → 5.4.18
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/combobox/ComboBox.types.js.map +1 -1
- package/lib/cjs/components/grouped-image/GroupedImage.js +10 -4
- package/lib/cjs/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/cjs/components/skeleton/base-skeleton/BaseSkeleton.js.map +1 -1
- package/lib/esm/components/combobox/ComboBox.types.js.map +1 -1
- package/lib/esm/components/grouped-image/GroupedImage.js +10 -4
- package/lib/esm/components/grouped-image/GroupedImage.js.map +1 -1
- package/lib/esm/components/skeleton/base-skeleton/BaseSkeleton.js.map +1 -1
- package/lib/types/components/combobox/ComboBox.types.d.ts +2 -2
- package/lib/types/components/skeleton/base-skeleton/BaseSkeleton.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize","exports"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler,
|
|
1
|
+
{"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize","exports"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactNode, type JSX } from 'react';\nimport { CSSPropertiesWithVars } from 'styled-components/dist/types';\nimport { DropdownDirection } from '../../types/dropdown';\n\n/**\n * Ref interface for the `ComboBox` component.\n */\nexport interface ComboBoxRef {\n /**\n * Hides the dropdown content.\n */\n hide: VoidFunction;\n /**\n * Shows the dropdown content.\n */\n show: VoidFunction;\n}\n\n/**\n * A grouped list definition used by the `ComboBox` component.\n */\nexport interface IComboBoxItems {\n /**\n * Optional group label shown above the list.\n */\n groupName?: string;\n /**\n * The items that should be rendered inside the group.\n */\n list: Array<IComboBoxItem>;\n /**\n * Whether the items in this group should use round images.\n */\n shouldShowRoundImage?: boolean;\n}\n\n/**\n * Optional text styling configuration for a combobox item.\n */\nexport interface ComboBoxTextStyles {\n /**\n * The HTML tag that should be used for the text wrapper.\n */\n tagName?: keyof JSX.IntrinsicElements;\n /**\n * Additional inline styles applied to the text wrapper.\n */\n styles?: CSSPropertiesWithVars;\n /**\n * Additional class name applied to the text wrapper.\n */\n className?: string;\n}\n\n/**\n * Single selectable item configuration for the `ComboBox` component.\n */\nexport interface IComboBoxItem {\n /**\n * Optional icon classes rendered before the text.\n */\n icons?: string[];\n /**\n * Optional background style used for the image placeholder.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Optional image URL rendered for the item.\n */\n imageUrl?: string;\n /**\n * Whether the item should be disabled.\n */\n isDisabled?: boolean;\n /**\n * Optional element rendered on the right side of the item.\n */\n rightElement?: ReactNode;\n /**\n * Optional secondary text rendered below the main text.\n */\n subtext?: string;\n /**\n * Optional suffix element rendered after the text.\n */\n suffixElement?: ReactNode;\n /**\n * Main label of the item.\n */\n text: string;\n /**\n * Stable item value used for selection and matching.\n */\n value: string | number;\n /**\n * Optional text styling overrides for the item label.\n */\n textStyles?: ComboBoxTextStyles;\n}\n\n/**\n * Available size variants for the `ComboBox` header.\n */\nexport enum ComboBoxSize {\n /**\n * Standard height and spacing.\n */\n NORMAL = 'normal',\n /**\n * Compact height and spacing.\n */\n SMALL = 'small',\n}\n\n/**\n * Props for the `ComboBox` component.\n */\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n * @default undefined\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n * @default undefined\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n * @default DropdownDirection.RIGHT\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n * @default undefined\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n * @default 280\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n * @default undefined\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n * @default undefined\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n * @default undefined\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n * @default undefined\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * Function to be executed when the content of the `ComboBox` is shown.\n * @default undefined\n */\n onShow?: () => void;\n /**\n * Function to be executed when the content of the `ComboBox` is hidden.\n * @default undefined\n */\n onHide?: () => void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n * @default undefined\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n * @default undefined\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n * @default false\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n * @default false\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n * @default false\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n * @default false\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n * @default false\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n * @default false\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n * @default false\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n /**\n * Whether the outside events should be captured.\n * @default undefined\n */\n shouldCaptureEvents?: boolean;\n /**\n * The size of the ComboBox.\n * @default ComboBoxSize.NORMAL\n */\n size?: ComboBoxSize;\n /**\n * Optional min width for the prefix element.\n * @default undefined\n */\n prefixMinWidth?: number;\n};\n"],"mappings":";;;;;;AAIA;AACA;AACA;AAYA;AACA;AACA;AAgBA;AACA;AACA;AAgBA;AACA;AACA;AA4CA;AACA;AACA;AAFA,IAGYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EACpB;AACJ;AACA;EAHYA,YAAY;EAKpB;AACJ;AACA;EAPYA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAWxB;AACA;AACA","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ var _uuid = require("../../hooks/uuid");
|
|
|
11
11
|
var _SecondImageClipPath = _interopRequireDefault(require("./clip-paths/SecondImageClipPath"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';
|
|
14
|
-
const IMAGE_SERVICE_PARAM_PATTERN = /^(?:
|
|
14
|
+
const IMAGE_SERVICE_PARAM_PATTERN = /^(?:[whsbd]\d+|f(?:webp|avif|json|none)|c(?:c|f)|m(?:cr|sd|ct|pd|cv))$/i;
|
|
15
15
|
const getGroupedImageDisplayUrl = (url, size) => {
|
|
16
16
|
try {
|
|
17
17
|
const urlObject = new URL(url);
|
|
@@ -26,11 +26,17 @@ const getGroupedImageDisplayUrl = (url, size) => {
|
|
|
26
26
|
const extensionIndex = fileName.lastIndexOf('.');
|
|
27
27
|
const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';
|
|
28
28
|
const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;
|
|
29
|
-
const parameterSegment = fileBaseName.split('_').pop();
|
|
29
|
+
const parameterSegment = fileBaseName.split('_').pop() ?? '';
|
|
30
30
|
const hasImageServiceParameters = Boolean(parameterSegment && parameterSegment !== fileBaseName && parameterSegment.split('-').every(parameter => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)));
|
|
31
|
-
const normalizedFileBaseName = hasImageServiceParameters ? fileBaseName.slice(0, fileBaseName.lastIndexOf('_')) : fileBaseName;
|
|
32
31
|
const normalizedSize = Math.max(1, Math.round(size));
|
|
33
|
-
|
|
32
|
+
if (hasImageServiceParameters) {
|
|
33
|
+
const fileBaseNameWithoutParams = fileBaseName.slice(0, fileBaseName.lastIndexOf('_'));
|
|
34
|
+
const preservedParams = parameterSegment.split('-').filter(p => !/^[whs]\d+$/i.test(p));
|
|
35
|
+
const newParams = [...preservedParams, `w${normalizedSize}`, `h${normalizedSize}`];
|
|
36
|
+
pathSegments.push(`${fileBaseNameWithoutParams}_${newParams.join('-')}${extension}`);
|
|
37
|
+
} else {
|
|
38
|
+
pathSegments.push(`${fileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`);
|
|
39
|
+
}
|
|
34
40
|
urlObject.pathname = pathSegments.join('/');
|
|
35
41
|
return urlObject.toString();
|
|
36
42
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedImage.js","names":["_react","_interopRequireDefault","require","_GroupedImage","_CareOfClipPath","_uuid","_SecondImageClipPath","e","__esModule","default","GROUPED_IMAGE_SERVICE_ORIGIN","IMAGE_SERVICE_PARAM_PATTERN","getGroupedImageDisplayUrl","url","size","urlObject","URL","origin","pathSegments","pathname","split","fileName","pop","extensionIndex","lastIndexOf","extension","slice","fileBaseName","parameterSegment","hasImageServiceParameters","Boolean","every","parameter","test","normalizedFileBaseName","normalizedSize","Math","max","round","push","join","toString","GroupedImage","cornerImage","height","imageBackground","images","onClick","shouldPreventBackground","shouldShowRoundImage","cornerElement","onImageError","hasCornerImage","hasCornerElement","hasMultipleImages","length","uuid","useUuid","cornerImageDisplayUrl","undefined","imageElements","map","src","index","createElement","StyledGroupImageElement","$background","$isSecondImage","$hasCornerImage","$hasMultipleImages","$shouldPreventBackground","$shouldShowRoundImage","$uuid","key","width","viewBox","xmlns","preserveAspectRatio","alt","onError","event","StyledGroupedImage","$height","imageFactors","StyledCornerImage","StyledCornerElement","displayName","_default","exports"],"sources":["../../../../src/components/grouped-image/GroupedImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, ReactNode, SyntheticEvent } from 'react';\nimport {\n StyledCornerElement,\n StyledCornerImage,\n StyledGroupedImage,\n StyledGroupImageElement,\n} from './GroupedImage.styles';\nimport CareOfClipPath from './clip-paths/CareOfClipPath';\nimport { useUuid } from '../../hooks/uuid';\nimport SecondImageClipPath from './clip-paths/SecondImageClipPath';\n\nconst GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';\nconst IMAGE_SERVICE_PARAM_PATTERN = /^(?:m(?:scale|crop|shortedgescale)|[whsbd]\\d+)$/i;\n\ninterface GroupedImageProps {\n /**\n * Optional image to display in the bottom right corner of the grouped image.\n */\n cornerImage?: string;\n /**\n * Height of the grouped image container.\n */\n height?: number;\n /**\n * Background for the single images.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Array of image URLs to display in the grouped image. If only one image is provided, it will be displayed as a full image.\n */\n images: string[];\n /**\n * Optional click handler for the grouped image.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Whether to prevent the background of the images from being set.\n */\n shouldPreventBackground?: boolean;\n /**\n * Whether to show the images in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n}\n\nconst getGroupedImageDisplayUrl = (url: string, size: number): string => {\n try {\n const urlObject = new URL(url);\n\n if (urlObject.origin !== GROUPED_IMAGE_SERVICE_ORIGIN) {\n return url;\n }\n\n const pathSegments = urlObject.pathname.split('/');\n const fileName = pathSegments.pop();\n\n if (!fileName) {\n return url;\n }\n\n const extensionIndex = fileName.lastIndexOf('.');\n const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';\n const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;\n const parameterSegment = fileBaseName.split('_').pop();\n const hasImageServiceParameters = Boolean(\n parameterSegment &&\n parameterSegment !== fileBaseName &&\n parameterSegment\n .split('-')\n .every((parameter) => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)),\n );\n const normalizedFileBaseName = hasImageServiceParameters\n ? fileBaseName.slice(0, fileBaseName.lastIndexOf('_'))\n : fileBaseName;\n const normalizedSize = Math.max(1, Math.round(size));\n\n pathSegments.push(\n `${normalizedFileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`,\n );\n urlObject.pathname = pathSegments.join('/');\n\n return urlObject.toString();\n } catch {\n return url;\n }\n};\n\nconst GroupedImage: FC<GroupedImageProps> = ({\n cornerImage,\n height = 40,\n imageBackground,\n images,\n onClick,\n shouldPreventBackground = false,\n shouldShowRoundImage = false,\n cornerElement,\n onImageError,\n}) => {\n const hasCornerImage = Boolean(cornerImage);\n const hasCornerElement = Boolean(cornerElement);\n const hasMultipleImages = images.length > 1;\n const uuid = useUuid();\n const cornerImageDisplayUrl = cornerImage\n ? getGroupedImageDisplayUrl(cornerImage, height)\n : undefined;\n\n const imageElements = images.slice(0, 2).map((src, index) => (\n <StyledGroupImageElement\n $background={imageBackground}\n $isSecondImage={index === 1}\n $hasCornerImage={hasCornerImage}\n $hasMultipleImages={hasMultipleImages}\n $shouldPreventBackground={shouldPreventBackground}\n $shouldShowRoundImage={shouldShowRoundImage}\n $uuid={uuid}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 40 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <foreignObject width=\"40\" height=\"40\">\n <img\n alt={`image--${index}`}\n src={getGroupedImageDisplayUrl(src, height)}\n onError={(event) =>\n typeof onImageError === 'function' && onImageError(event, index)\n }\n />\n </foreignObject>\n </svg>\n </StyledGroupImageElement>\n ));\n\n return (\n <StyledGroupedImage onClick={onClick} $height={height}>\n {hasCornerImage && (\n <CareOfClipPath\n height={height}\n uuid={uuid}\n imageFactors={hasMultipleImages ? [0.76, 0.8] : [1]}\n />\n )}\n {hasMultipleImages && (\n <SecondImageClipPath\n height={height}\n uuid={uuid}\n shouldShowRoundImage={shouldShowRoundImage}\n />\n )}\n\n {imageElements}\n\n {hasCornerImage && (\n <StyledCornerImage\n $background={imageBackground}\n $shouldPreventBackground={shouldPreventBackground}\n $hasMultipleImages={hasMultipleImages}\n src={cornerImageDisplayUrl}\n key=\"corner-image\"\n />\n )}\n {hasCornerElement && <StyledCornerElement>{cornerElement}</StyledCornerElement>}\n </StyledGroupedImage>\n );\n};\n\nGroupedImage.displayName = 'GroupedImage';\n\nexport default GroupedImage;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE,MAAMG,4BAA4B,GAAG,qBAAqB;AAC1D,MAAMC,2BAA2B,GAAG,kDAAkD;AAyCtF,MAAMC,yBAAyB,GAAGA,CAACC,GAAW,EAAEC,IAAY,KAAa;EACrE,IAAI;IACA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAACH,GAAG,CAAC;IAE9B,IAAIE,SAAS,CAACE,MAAM,KAAKP,4BAA4B,EAAE;MACnD,OAAOG,GAAG;IACd;IAEA,MAAMK,YAAY,GAAGH,SAAS,CAACI,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC;IAClD,MAAMC,QAAQ,GAAGH,YAAY,CAACI,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C,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/E,OAAA,GAE3BiC,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"GroupedImage.js","names":["_react","_interopRequireDefault","require","_GroupedImage","_CareOfClipPath","_uuid","_SecondImageClipPath","e","__esModule","default","GROUPED_IMAGE_SERVICE_ORIGIN","IMAGE_SERVICE_PARAM_PATTERN","getGroupedImageDisplayUrl","url","size","urlObject","URL","origin","pathSegments","pathname","split","fileName","pop","extensionIndex","lastIndexOf","extension","slice","fileBaseName","parameterSegment","hasImageServiceParameters","Boolean","every","parameter","test","normalizedSize","Math","max","round","fileBaseNameWithoutParams","preservedParams","filter","p","newParams","push","join","toString","GroupedImage","cornerImage","height","imageBackground","images","onClick","shouldPreventBackground","shouldShowRoundImage","cornerElement","onImageError","hasCornerImage","hasCornerElement","hasMultipleImages","length","uuid","useUuid","cornerImageDisplayUrl","undefined","imageElements","map","src","index","createElement","StyledGroupImageElement","$background","$isSecondImage","$hasCornerImage","$hasMultipleImages","$shouldPreventBackground","$shouldShowRoundImage","$uuid","key","width","viewBox","xmlns","preserveAspectRatio","alt","onError","event","StyledGroupedImage","$height","imageFactors","StyledCornerImage","StyledCornerElement","displayName","_default","exports"],"sources":["../../../../src/components/grouped-image/GroupedImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, ReactNode, SyntheticEvent } from 'react';\nimport {\n StyledCornerElement,\n StyledCornerImage,\n StyledGroupedImage,\n StyledGroupImageElement,\n} from './GroupedImage.styles';\nimport CareOfClipPath from './clip-paths/CareOfClipPath';\nimport { useUuid } from '../../hooks/uuid';\nimport SecondImageClipPath from './clip-paths/SecondImageClipPath';\n\nconst GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';\nconst IMAGE_SERVICE_PARAM_PATTERN =\n /^(?:[whsbd]\\d+|f(?:webp|avif|json|none)|c(?:c|f)|m(?:cr|sd|ct|pd|cv))$/i;\n\ninterface GroupedImageProps {\n /**\n * Optional image to display in the bottom right corner of the grouped image.\n */\n cornerImage?: string;\n /**\n * Height of the grouped image container.\n */\n height?: number;\n /**\n * Background for the single images.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Array of image URLs to display in the grouped image. If only one image is provided, it will be displayed as a full image.\n */\n images: string[];\n /**\n * Optional click handler for the grouped image.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Whether to prevent the background of the images from being set.\n */\n shouldPreventBackground?: boolean;\n /**\n * Whether to show the images in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n}\n\nconst getGroupedImageDisplayUrl = (url: string, size: number): string => {\n try {\n const urlObject = new URL(url);\n\n if (urlObject.origin !== GROUPED_IMAGE_SERVICE_ORIGIN) {\n return url;\n }\n\n const pathSegments = urlObject.pathname.split('/');\n const fileName = pathSegments.pop();\n\n if (!fileName) {\n return url;\n }\n\n const extensionIndex = fileName.lastIndexOf('.');\n const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';\n const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;\n const parameterSegment = fileBaseName.split('_').pop() ?? '';\n const hasImageServiceParameters = Boolean(\n parameterSegment &&\n parameterSegment !== fileBaseName &&\n parameterSegment\n .split('-')\n .every((parameter) => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)),\n );\n const normalizedSize = Math.max(1, Math.round(size));\n\n if (hasImageServiceParameters) {\n const fileBaseNameWithoutParams = fileBaseName.slice(0, fileBaseName.lastIndexOf('_'));\n const preservedParams = parameterSegment\n .split('-')\n .filter((p) => !/^[whs]\\d+$/i.test(p));\n const newParams = [...preservedParams, `w${normalizedSize}`, `h${normalizedSize}`];\n pathSegments.push(`${fileBaseNameWithoutParams}_${newParams.join('-')}${extension}`);\n } else {\n pathSegments.push(`${fileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`);\n }\n urlObject.pathname = pathSegments.join('/');\n\n return urlObject.toString();\n } catch {\n return url;\n }\n};\n\nconst GroupedImage: FC<GroupedImageProps> = ({\n cornerImage,\n height = 40,\n imageBackground,\n images,\n onClick,\n shouldPreventBackground = false,\n shouldShowRoundImage = false,\n cornerElement,\n onImageError,\n}) => {\n const hasCornerImage = Boolean(cornerImage);\n const hasCornerElement = Boolean(cornerElement);\n const hasMultipleImages = images.length > 1;\n const uuid = useUuid();\n const cornerImageDisplayUrl = cornerImage\n ? getGroupedImageDisplayUrl(cornerImage, height)\n : undefined;\n\n const imageElements = images.slice(0, 2).map((src, index) => (\n <StyledGroupImageElement\n $background={imageBackground}\n $isSecondImage={index === 1}\n $hasCornerImage={hasCornerImage}\n $hasMultipleImages={hasMultipleImages}\n $shouldPreventBackground={shouldPreventBackground}\n $shouldShowRoundImage={shouldShowRoundImage}\n $uuid={uuid}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 40 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <foreignObject width=\"40\" height=\"40\">\n <img\n alt={`image--${index}`}\n src={getGroupedImageDisplayUrl(src, height)}\n onError={(event) =>\n typeof onImageError === 'function' && onImageError(event, index)\n }\n />\n </foreignObject>\n </svg>\n </StyledGroupImageElement>\n ));\n\n return (\n <StyledGroupedImage onClick={onClick} $height={height}>\n {hasCornerImage && (\n <CareOfClipPath\n height={height}\n uuid={uuid}\n imageFactors={hasMultipleImages ? [0.76, 0.8] : [1]}\n />\n )}\n {hasMultipleImages && (\n <SecondImageClipPath\n height={height}\n uuid={uuid}\n shouldShowRoundImage={shouldShowRoundImage}\n />\n )}\n\n {imageElements}\n\n {hasCornerImage && (\n <StyledCornerImage\n $background={imageBackground}\n $shouldPreventBackground={shouldPreventBackground}\n $hasMultipleImages={hasMultipleImages}\n src={cornerImageDisplayUrl}\n key=\"corner-image\"\n />\n )}\n {hasCornerElement && <StyledCornerElement>{cornerElement}</StyledCornerElement>}\n </StyledGroupedImage>\n );\n};\n\nGroupedImage.displayName = 'GroupedImage';\n\nexport default GroupedImage;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnE,MAAMG,4BAA4B,GAAG,qBAAqB;AAC1D,MAAMC,2BAA2B,GAC7B,yEAAyE;AAyC7E,MAAMC,yBAAyB,GAAGA,CAACC,GAAW,EAAEC,IAAY,KAAa;EACrE,IAAI;IACA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAACH,GAAG,CAAC;IAE9B,IAAIE,SAAS,CAACE,MAAM,KAAKP,4BAA4B,EAAE;MACnD,OAAOG,GAAG;IACd;IAEA,MAAMK,YAAY,GAAGH,SAAS,CAACI,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC;IAClD,MAAMC,QAAQ,GAAGH,YAAY,CAACI,GAAG,CAAC,CAAC;IAEnC,IAAI,CAACD,QAAQ,EAAE;MACX,OAAOR,GAAG;IACd;IAEA,MAAMU,cAAc,GAAGF,QAAQ,CAACG,WAAW,CAAC,GAAG,CAAC;IAChD,MAAMC,SAAS,GAAGF,cAAc,GAAG,CAAC,CAAC,GAAGF,QAAQ,CAACK,KAAK,CAACH,cAAc,CAAC,GAAG,EAAE;IAC3E,MAAMI,YAAY,GAAGJ,cAAc,GAAG,CAAC,CAAC,GAAGF,QAAQ,CAACK,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,CAAAsF,mBAAmB,QAAEnC,aAAmC,CAC9D,CAAC;AAE7B,CAAC;AAEDR,YAAY,CAAC4C,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAE3BqC,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSkeleton.js","names":["_react","_interopRequireWildcard","require","_BaseSkeleton","_types","_SkeletonProvider","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseSkeleton","exports","forwardRef","baseColor","highlightColor","animationType","height","style","width","className","borderRadius","as","children","ref","values","useSkeletonContext","animationStyle","useSkeletonAnimation","resolvedAnimationType","createElement","StyledBaseSkeleton","$backgroundColor","$borderRadius","$height","$width","$shouldUseNativeTag","SkeletonAnimationType","SHIMMER","StyledMotionBaseSkeletonShimmer","$color","PULSE","StyledMotionBaseSkeletonPulse","displayName","_default"],"sources":["../../../../../src/components/skeleton/base-skeleton/BaseSkeleton.tsx"],"sourcesContent":["import React, { forwardRef,
|
|
1
|
+
{"version":3,"file":"BaseSkeleton.js","names":["_react","_interopRequireWildcard","require","_BaseSkeleton","_types","_SkeletonProvider","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseSkeleton","exports","forwardRef","baseColor","highlightColor","animationType","height","style","width","className","borderRadius","as","children","ref","values","useSkeletonContext","animationStyle","useSkeletonAnimation","resolvedAnimationType","createElement","StyledBaseSkeleton","$backgroundColor","$borderRadius","$height","$width","$shouldUseNativeTag","SkeletonAnimationType","SHIMMER","StyledMotionBaseSkeletonShimmer","$color","PULSE","StyledMotionBaseSkeletonPulse","displayName","_default"],"sources":["../../../../../src/components/skeleton/base-skeleton/BaseSkeleton.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, type JSX } from 'react';\nimport {\n StyledBaseSkeleton,\n StyledMotionBaseSkeletonPulse,\n StyledMotionBaseSkeletonShimmer,\n} from './BaseSkeleton.styles';\nimport { BaseSkeletonConfig, SkeletonAnimationType } from '../types';\nimport { useSkeletonAnimation, useSkeletonContext } from '../skeleton-provider/SkeletonProvider';\n\nexport interface BaseSkeletonProps extends BaseSkeletonConfig {\n width: number | string;\n height: number | string;\n as?: keyof JSX.IntrinsicElements;\n children?: ReactNode;\n}\n\nexport const BaseSkeleton = forwardRef<HTMLDivElement, BaseSkeletonProps>(\n (\n {\n baseColor,\n highlightColor,\n animationType,\n height,\n style,\n width,\n className,\n borderRadius,\n as,\n children,\n },\n ref,\n ) => {\n const values = useSkeletonContext();\n const animationStyle = useSkeletonAnimation();\n\n const resolvedAnimationType = animationType ?? values.animationType;\n\n return (\n <StyledBaseSkeleton\n as={as}\n ref={ref}\n className={className}\n style={style}\n $backgroundColor={baseColor ?? values.baseColor}\n $borderRadius={borderRadius ?? values.borderRadius}\n $height={height}\n $width={width}\n $shouldUseNativeTag={!!as}\n >\n {resolvedAnimationType === SkeletonAnimationType.SHIMMER && (\n <StyledMotionBaseSkeletonShimmer\n $color={highlightColor ?? values.highlightColor}\n style={animationStyle}\n />\n )}\n {resolvedAnimationType === SkeletonAnimationType.PULSE && (\n <StyledMotionBaseSkeletonPulse\n $color={highlightColor ?? values.highlightColor}\n style={animationStyle}\n />\n )}\n {children}\n </StyledBaseSkeleton>\n );\n },\n);\n\nBaseSkeleton.displayName = 'BaseSkeleton';\n\nexport default BaseSkeleton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAAiG,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YA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AA,CAAAgB,OAAA,CAAA4B,aAAA,CAACzC,aAAA,CAAA0C,kBAAkB;IACfT,EAAE,EAAEA,EAAG;IACPE,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEA,SAAU;IACrBF,KAAK,EAAEA,KAAM;IACbc,gBAAgB,EAAElB,SAAS,IAAIW,MAAM,CAACX,SAAU;IAChDmB,aAAa,EAAEZ,YAAY,IAAII,MAAM,CAACJ,YAAa;IACnDa,OAAO,EAAEjB,MAAO;IAChBkB,MAAM,EAAEhB,KAAM;IACdiB,mBAAmB,EAAE,CAAC,CAACd;EAAG,GAEzBO,qBAAqB,KAAKQ,4BAAqB,CAACC,OAAO,iBACpDpD,MAAA,CAAAgB,OAAA,CAAA4B,aAAA,CAACzC,aAAA,CAAAkD,+BAA+B;IAC5BC,MAAM,EAAEzB,cAAc,IAAIU,MAAM,CAACV,cAAe;IAChDG,KAAK,EAAES;EAAe,CACzB,CACJ,EACAE,qBAAqB,KAAKQ,4BAAqB,CAACI,KAAK,iBAClDvD,MAAA,CAAAgB,OAAA,CAAA4B,aAAA,CAACzC,aAAA,CAAAqD,6BAA6B;IAC1BF,MAAM,EAAEzB,cAAc,IAAIU,MAAM,CAACV,cAAe;IAChDG,KAAK,EAAES;EAAe,CACzB,CACJ,EACAJ,QACe,CAAC;AAE7B,CACJ,CAAC;AAEDZ,YAAY,CAACgC,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAhC,OAAA,CAAAV,OAAA,GAE3BS,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler,
|
|
1
|
+
{"version":3,"file":"ComboBox.types.js","names":["ComboBoxSize"],"sources":["../../../../src/components/combobox/ComboBox.types.ts"],"sourcesContent":["import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactNode, type JSX } from 'react';\nimport { CSSPropertiesWithVars } from 'styled-components/dist/types';\nimport { DropdownDirection } from '../../types/dropdown';\n\n/**\n * Ref interface for the `ComboBox` component.\n */\nexport interface ComboBoxRef {\n /**\n * Hides the dropdown content.\n */\n hide: VoidFunction;\n /**\n * Shows the dropdown content.\n */\n show: VoidFunction;\n}\n\n/**\n * A grouped list definition used by the `ComboBox` component.\n */\nexport interface IComboBoxItems {\n /**\n * Optional group label shown above the list.\n */\n groupName?: string;\n /**\n * The items that should be rendered inside the group.\n */\n list: Array<IComboBoxItem>;\n /**\n * Whether the items in this group should use round images.\n */\n shouldShowRoundImage?: boolean;\n}\n\n/**\n * Optional text styling configuration for a combobox item.\n */\nexport interface ComboBoxTextStyles {\n /**\n * The HTML tag that should be used for the text wrapper.\n */\n tagName?: keyof JSX.IntrinsicElements;\n /**\n * Additional inline styles applied to the text wrapper.\n */\n styles?: CSSPropertiesWithVars;\n /**\n * Additional class name applied to the text wrapper.\n */\n className?: string;\n}\n\n/**\n * Single selectable item configuration for the `ComboBox` component.\n */\nexport interface IComboBoxItem {\n /**\n * Optional icon classes rendered before the text.\n */\n icons?: string[];\n /**\n * Optional background style used for the image placeholder.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Optional image URL rendered for the item.\n */\n imageUrl?: string;\n /**\n * Whether the item should be disabled.\n */\n isDisabled?: boolean;\n /**\n * Optional element rendered on the right side of the item.\n */\n rightElement?: ReactNode;\n /**\n * Optional secondary text rendered below the main text.\n */\n subtext?: string;\n /**\n * Optional suffix element rendered after the text.\n */\n suffixElement?: ReactNode;\n /**\n * Main label of the item.\n */\n text: string;\n /**\n * Stable item value used for selection and matching.\n */\n value: string | number;\n /**\n * Optional text styling overrides for the item label.\n */\n textStyles?: ComboBoxTextStyles;\n}\n\n/**\n * Available size variants for the `ComboBox` header.\n */\nexport enum ComboBoxSize {\n /**\n * Standard height and spacing.\n */\n NORMAL = 'normal',\n /**\n * Compact height and spacing.\n */\n SMALL = 'small',\n}\n\n/**\n * Props for the `ComboBox` component.\n */\nexport type ComboBoxProps = {\n /**\n * The width of the body.\n * @default undefined\n */\n bodyWidth?: number;\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n * @default undefined\n */\n container?: Element;\n /**\n * The direction in which the combobox should open.\n * @default DropdownDirection.RIGHT\n */\n direction?: DropdownDirection;\n /**\n * The value of the optional input.\n * @default undefined\n */\n inputValue?: string;\n /**\n * Whether the combobox should be disabled.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * The list of the items that should be displayed.\n */\n lists: IComboBoxItems[];\n /**\n * The maximum height of the combobox content.\n * @default 280\n */\n maxHeight?: number;\n /**\n * Function to be executed when the value of the optional input is changed.\n * @default undefined\n */\n onInputChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input lost its focus.\n * @default undefined\n */\n onInputBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the optional input gets its focus.\n * @default undefined\n */\n onInputFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.\n * @default undefined\n */\n onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;\n /**\n * Function to be executed when the content of the `ComboBox` is shown.\n * @default undefined\n */\n onShow?: () => void;\n /**\n * Function to be executed when the content of the `ComboBox` is hidden.\n * @default undefined\n */\n onHide?: () => void;\n /**\n * A text that should be displayed when no item is selected.\n */\n placeholder: string;\n /**\n * A prefix that should be displayed before the placeholder.\n * @default undefined\n */\n prefix?: string;\n /**\n * An item that should be preselected.\n * @default undefined\n */\n selectedItem?: IComboBoxItem;\n /**\n * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.\n * @default false\n */\n shouldShowBigImage?: boolean;\n /**\n * If true, a clear icon is displayed at the end of the combo box if an item is selected.\n * @default false\n */\n shouldShowClearIcon?: boolean;\n /**\n * Whether the background should be transparent.\n * @default false\n */\n shouldShowTransparentBackground?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n * @default false\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the width of the ComboBox should be the width of the current item.\n * @default false\n */\n shouldUseCurrentItemWidth?: boolean;\n /**\n * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.\n * @default false\n */\n shouldUseFullWidth?: boolean;\n /**\n * If true, the dropdown will use the maximum width of the items.\n * @default false\n */\n shouldDropDownUseMaxItemWidth?: boolean;\n /**\n * Whether the outside events should be captured.\n * @default undefined\n */\n shouldCaptureEvents?: boolean;\n /**\n * The size of the ComboBox.\n * @default ComboBoxSize.NORMAL\n */\n size?: ComboBoxSize;\n /**\n * Optional min width for the prefix element.\n * @default undefined\n */\n prefixMinWidth?: number;\n};\n"],"mappings":"AAIA;AACA;AACA;;AAYA;AACA;AACA;;AAgBA;AACA;AACA;;AAgBA;AACA;AACA;;AA4CA;AACA;AACA;AACA,WAAYA,YAAY,0BAAZA,YAAY;EACpB;AACJ;AACA;EAHYA,YAAY;EAKpB;AACJ;AACA;EAPYA,YAAY;EAAA,OAAZA,YAAY;AAAA;;AAWxB;AACA;AACA","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ import CareOfClipPath from './clip-paths/CareOfClipPath';
|
|
|
4
4
|
import { useUuid } from '../../hooks/uuid';
|
|
5
5
|
import SecondImageClipPath from './clip-paths/SecondImageClipPath';
|
|
6
6
|
const GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';
|
|
7
|
-
const IMAGE_SERVICE_PARAM_PATTERN = /^(?:
|
|
7
|
+
const IMAGE_SERVICE_PARAM_PATTERN = /^(?:[whsbd]\d+|f(?:webp|avif|json|none)|c(?:c|f)|m(?:cr|sd|ct|pd|cv))$/i;
|
|
8
8
|
const getGroupedImageDisplayUrl = (url, size) => {
|
|
9
9
|
try {
|
|
10
10
|
const urlObject = new URL(url);
|
|
@@ -19,11 +19,17 @@ const getGroupedImageDisplayUrl = (url, size) => {
|
|
|
19
19
|
const extensionIndex = fileName.lastIndexOf('.');
|
|
20
20
|
const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';
|
|
21
21
|
const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;
|
|
22
|
-
const parameterSegment = fileBaseName.split('_').pop();
|
|
22
|
+
const parameterSegment = fileBaseName.split('_').pop() ?? '';
|
|
23
23
|
const hasImageServiceParameters = Boolean(parameterSegment && parameterSegment !== fileBaseName && parameterSegment.split('-').every(parameter => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)));
|
|
24
|
-
const normalizedFileBaseName = hasImageServiceParameters ? fileBaseName.slice(0, fileBaseName.lastIndexOf('_')) : fileBaseName;
|
|
25
24
|
const normalizedSize = Math.max(1, Math.round(size));
|
|
26
|
-
|
|
25
|
+
if (hasImageServiceParameters) {
|
|
26
|
+
const fileBaseNameWithoutParams = fileBaseName.slice(0, fileBaseName.lastIndexOf('_'));
|
|
27
|
+
const preservedParams = parameterSegment.split('-').filter(p => !/^[whs]\d+$/i.test(p));
|
|
28
|
+
const newParams = [...preservedParams, `w${normalizedSize}`, `h${normalizedSize}`];
|
|
29
|
+
pathSegments.push(`${fileBaseNameWithoutParams}_${newParams.join('-')}${extension}`);
|
|
30
|
+
} else {
|
|
31
|
+
pathSegments.push(`${fileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`);
|
|
32
|
+
}
|
|
27
33
|
urlObject.pathname = pathSegments.join('/');
|
|
28
34
|
return urlObject.toString();
|
|
29
35
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedImage.js","names":["React","StyledCornerElement","StyledCornerImage","StyledGroupedImage","StyledGroupImageElement","CareOfClipPath","useUuid","SecondImageClipPath","GROUPED_IMAGE_SERVICE_ORIGIN","IMAGE_SERVICE_PARAM_PATTERN","getGroupedImageDisplayUrl","url","size","urlObject","URL","origin","pathSegments","pathname","split","fileName","pop","extensionIndex","lastIndexOf","extension","slice","fileBaseName","parameterSegment","hasImageServiceParameters","Boolean","every","parameter","test","normalizedFileBaseName","normalizedSize","Math","max","round","push","join","toString","GroupedImage","cornerImage","height","imageBackground","images","onClick","shouldPreventBackground","shouldShowRoundImage","cornerElement","onImageError","hasCornerImage","hasCornerElement","hasMultipleImages","length","uuid","cornerImageDisplayUrl","undefined","imageElements","map","src","index","createElement","$background","$isSecondImage","$hasCornerImage","$hasMultipleImages","$shouldPreventBackground","$shouldShowRoundImage","$uuid","key","width","viewBox","xmlns","preserveAspectRatio","alt","onError","event","$height","imageFactors","displayName"],"sources":["../../../../src/components/grouped-image/GroupedImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, ReactNode, SyntheticEvent } from 'react';\nimport {\n StyledCornerElement,\n StyledCornerImage,\n StyledGroupedImage,\n StyledGroupImageElement,\n} from './GroupedImage.styles';\nimport CareOfClipPath from './clip-paths/CareOfClipPath';\nimport { useUuid } from '../../hooks/uuid';\nimport SecondImageClipPath from './clip-paths/SecondImageClipPath';\n\nconst GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';\nconst IMAGE_SERVICE_PARAM_PATTERN = /^(?:m(?:scale|crop|shortedgescale)|[whsbd]\\d+)$/i;\n\ninterface GroupedImageProps {\n /**\n * Optional image to display in the bottom right corner of the grouped image.\n */\n cornerImage?: string;\n /**\n * Height of the grouped image container.\n */\n height?: number;\n /**\n * Background for the single images.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Array of image URLs to display in the grouped image. If only one image is provided, it will be displayed as a full image.\n */\n images: string[];\n /**\n * Optional click handler for the grouped image.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Whether to prevent the background of the images from being set.\n */\n shouldPreventBackground?: boolean;\n /**\n * Whether to show the images in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n}\n\nconst getGroupedImageDisplayUrl = (url: string, size: number): string => {\n try {\n const urlObject = new URL(url);\n\n if (urlObject.origin !== GROUPED_IMAGE_SERVICE_ORIGIN) {\n return url;\n }\n\n const pathSegments = urlObject.pathname.split('/');\n const fileName = pathSegments.pop();\n\n if (!fileName) {\n return url;\n }\n\n const extensionIndex = fileName.lastIndexOf('.');\n const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';\n const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;\n const parameterSegment = fileBaseName.split('_').pop();\n const hasImageServiceParameters = Boolean(\n parameterSegment &&\n parameterSegment !== fileBaseName &&\n parameterSegment\n .split('-')\n .every((parameter) => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)),\n );\n const normalizedFileBaseName = hasImageServiceParameters\n ? fileBaseName.slice(0, fileBaseName.lastIndexOf('_'))\n : fileBaseName;\n const normalizedSize = Math.max(1, Math.round(size));\n\n pathSegments.push(\n `${normalizedFileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`,\n );\n urlObject.pathname = pathSegments.join('/');\n\n return urlObject.toString();\n } catch {\n return url;\n }\n};\n\nconst GroupedImage: FC<GroupedImageProps> = ({\n cornerImage,\n height = 40,\n imageBackground,\n images,\n onClick,\n shouldPreventBackground = false,\n shouldShowRoundImage = false,\n cornerElement,\n onImageError,\n}) => {\n const hasCornerImage = Boolean(cornerImage);\n const hasCornerElement = Boolean(cornerElement);\n const hasMultipleImages = images.length > 1;\n const uuid = useUuid();\n const cornerImageDisplayUrl = cornerImage\n ? getGroupedImageDisplayUrl(cornerImage, height)\n : undefined;\n\n const imageElements = images.slice(0, 2).map((src, index) => (\n <StyledGroupImageElement\n $background={imageBackground}\n $isSecondImage={index === 1}\n $hasCornerImage={hasCornerImage}\n $hasMultipleImages={hasMultipleImages}\n $shouldPreventBackground={shouldPreventBackground}\n $shouldShowRoundImage={shouldShowRoundImage}\n $uuid={uuid}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 40 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <foreignObject width=\"40\" height=\"40\">\n <img\n alt={`image--${index}`}\n src={getGroupedImageDisplayUrl(src, height)}\n onError={(event) =>\n typeof onImageError === 'function' && onImageError(event, index)\n }\n />\n </foreignObject>\n </svg>\n </StyledGroupImageElement>\n ));\n\n return (\n <StyledGroupedImage onClick={onClick} $height={height}>\n {hasCornerImage && (\n <CareOfClipPath\n height={height}\n uuid={uuid}\n imageFactors={hasMultipleImages ? [0.76, 0.8] : [1]}\n />\n )}\n {hasMultipleImages && (\n <SecondImageClipPath\n height={height}\n uuid={uuid}\n shouldShowRoundImage={shouldShowRoundImage}\n />\n )}\n\n {imageElements}\n\n {hasCornerImage && (\n <StyledCornerImage\n $background={imageBackground}\n $shouldPreventBackground={shouldPreventBackground}\n $hasMultipleImages={hasMultipleImages}\n src={cornerImageDisplayUrl}\n key=\"corner-image\"\n />\n )}\n {hasCornerElement && <StyledCornerElement>{cornerElement}</StyledCornerElement>}\n </StyledGroupedImage>\n );\n};\n\nGroupedImage.displayName = 'GroupedImage';\n\nexport default GroupedImage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA2E,OAAO;AAC9F,SACIC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,QACpB,uBAAuB;AAC9B,OAAOC,cAAc,MAAM,6BAA6B;AACxD,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,OAAOC,mBAAmB,MAAM,kCAAkC;AAElE,MAAMC,4BAA4B,GAAG,qBAAqB;AAC1D,MAAMC,2BAA2B,GAAG,kDAAkD;AAyCtF,MAAMC,yBAAyB,GAAGA,CAACC,GAAW,EAAEC,IAAY,KAAa;EACrE,IAAI;IACA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAACH,GAAG,CAAC;IAE9B,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,eAAevC,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"GroupedImage.js","names":["React","StyledCornerElement","StyledCornerImage","StyledGroupedImage","StyledGroupImageElement","CareOfClipPath","useUuid","SecondImageClipPath","GROUPED_IMAGE_SERVICE_ORIGIN","IMAGE_SERVICE_PARAM_PATTERN","getGroupedImageDisplayUrl","url","size","urlObject","URL","origin","pathSegments","pathname","split","fileName","pop","extensionIndex","lastIndexOf","extension","slice","fileBaseName","parameterSegment","hasImageServiceParameters","Boolean","every","parameter","test","normalizedSize","Math","max","round","fileBaseNameWithoutParams","preservedParams","filter","p","newParams","push","join","toString","GroupedImage","cornerImage","height","imageBackground","images","onClick","shouldPreventBackground","shouldShowRoundImage","cornerElement","onImageError","hasCornerImage","hasCornerElement","hasMultipleImages","length","uuid","cornerImageDisplayUrl","undefined","imageElements","map","src","index","createElement","$background","$isSecondImage","$hasCornerImage","$hasMultipleImages","$shouldPreventBackground","$shouldShowRoundImage","$uuid","key","width","viewBox","xmlns","preserveAspectRatio","alt","onError","event","$height","imageFactors","displayName"],"sources":["../../../../src/components/grouped-image/GroupedImage.tsx"],"sourcesContent":["import React, { CSSProperties, FC, MouseEventHandler, ReactNode, SyntheticEvent } from 'react';\nimport {\n StyledCornerElement,\n StyledCornerImage,\n StyledGroupedImage,\n StyledGroupImageElement,\n} from './GroupedImage.styles';\nimport CareOfClipPath from './clip-paths/CareOfClipPath';\nimport { useUuid } from '../../hooks/uuid';\nimport SecondImageClipPath from './clip-paths/SecondImageClipPath';\n\nconst GROUPED_IMAGE_SERVICE_ORIGIN = 'https://tsimg.cloud';\nconst IMAGE_SERVICE_PARAM_PATTERN =\n /^(?:[whsbd]\\d+|f(?:webp|avif|json|none)|c(?:c|f)|m(?:cr|sd|ct|pd|cv))$/i;\n\ninterface GroupedImageProps {\n /**\n * Optional image to display in the bottom right corner of the grouped image.\n */\n cornerImage?: string;\n /**\n * Height of the grouped image container.\n */\n height?: number;\n /**\n * Background for the single images.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * Array of image URLs to display in the grouped image. If only one image is provided, it will be displayed as a full image.\n */\n images: string[];\n /**\n * Optional click handler for the grouped image.\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Whether to prevent the background of the images from being set.\n */\n shouldPreventBackground?: boolean;\n /**\n * Whether to show the images in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n}\n\nconst getGroupedImageDisplayUrl = (url: string, size: number): string => {\n try {\n const urlObject = new URL(url);\n\n if (urlObject.origin !== GROUPED_IMAGE_SERVICE_ORIGIN) {\n return url;\n }\n\n const pathSegments = urlObject.pathname.split('/');\n const fileName = pathSegments.pop();\n\n if (!fileName) {\n return url;\n }\n\n const extensionIndex = fileName.lastIndexOf('.');\n const extension = extensionIndex > -1 ? fileName.slice(extensionIndex) : '';\n const fileBaseName = extensionIndex > -1 ? fileName.slice(0, extensionIndex) : fileName;\n const parameterSegment = fileBaseName.split('_').pop() ?? '';\n const hasImageServiceParameters = Boolean(\n parameterSegment &&\n parameterSegment !== fileBaseName &&\n parameterSegment\n .split('-')\n .every((parameter) => IMAGE_SERVICE_PARAM_PATTERN.test(parameter)),\n );\n const normalizedSize = Math.max(1, Math.round(size));\n\n if (hasImageServiceParameters) {\n const fileBaseNameWithoutParams = fileBaseName.slice(0, fileBaseName.lastIndexOf('_'));\n const preservedParams = parameterSegment\n .split('-')\n .filter((p) => !/^[whs]\\d+$/i.test(p));\n const newParams = [...preservedParams, `w${normalizedSize}`, `h${normalizedSize}`];\n pathSegments.push(`${fileBaseNameWithoutParams}_${newParams.join('-')}${extension}`);\n } else {\n pathSegments.push(`${fileBaseName}_w${normalizedSize}-h${normalizedSize}${extension}`);\n }\n urlObject.pathname = pathSegments.join('/');\n\n return urlObject.toString();\n } catch {\n return url;\n }\n};\n\nconst GroupedImage: FC<GroupedImageProps> = ({\n cornerImage,\n height = 40,\n imageBackground,\n images,\n onClick,\n shouldPreventBackground = false,\n shouldShowRoundImage = false,\n cornerElement,\n onImageError,\n}) => {\n const hasCornerImage = Boolean(cornerImage);\n const hasCornerElement = Boolean(cornerElement);\n const hasMultipleImages = images.length > 1;\n const uuid = useUuid();\n const cornerImageDisplayUrl = cornerImage\n ? getGroupedImageDisplayUrl(cornerImage, height)\n : undefined;\n\n const imageElements = images.slice(0, 2).map((src, index) => (\n <StyledGroupImageElement\n $background={imageBackground}\n $isSecondImage={index === 1}\n $hasCornerImage={hasCornerImage}\n $hasMultipleImages={hasMultipleImages}\n $shouldPreventBackground={shouldPreventBackground}\n $shouldShowRoundImage={shouldShowRoundImage}\n $uuid={uuid}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 40 40\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <foreignObject width=\"40\" height=\"40\">\n <img\n alt={`image--${index}`}\n src={getGroupedImageDisplayUrl(src, height)}\n onError={(event) =>\n typeof onImageError === 'function' && onImageError(event, index)\n }\n />\n </foreignObject>\n </svg>\n </StyledGroupImageElement>\n ));\n\n return (\n <StyledGroupedImage onClick={onClick} $height={height}>\n {hasCornerImage && (\n <CareOfClipPath\n height={height}\n uuid={uuid}\n imageFactors={hasMultipleImages ? [0.76, 0.8] : [1]}\n />\n )}\n {hasMultipleImages && (\n <SecondImageClipPath\n height={height}\n uuid={uuid}\n shouldShowRoundImage={shouldShowRoundImage}\n />\n )}\n\n {imageElements}\n\n {hasCornerImage && (\n <StyledCornerImage\n $background={imageBackground}\n $shouldPreventBackground={shouldPreventBackground}\n $hasMultipleImages={hasMultipleImages}\n src={cornerImageDisplayUrl}\n key=\"corner-image\"\n />\n )}\n {hasCornerElement && <StyledCornerElement>{cornerElement}</StyledCornerElement>}\n </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EAAEhB,KAAK;EAClE,CACJ,CACU,CACd,CACgB,CAC5B,CAAC;EAEF,oBACIhE,KAAA,CAAAiE,aAAA,CAAC9D,kBAAkB;IAAC8C,OAAO,EAAEA,OAAQ;IAACgC,OAAO,EAAEnC;EAAO,GACjDQ,cAAc,iBACXtD,KAAA,CAAAiE,aAAA,CAAC5D,cAAc;IACXyC,MAAM,EAAEA,MAAO;IACfY,IAAI,EAAEA,IAAK;IACXwB,YAAY,EAAE1B,iBAAiB,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;EAAE,CACvD,CACJ,EACAA,iBAAiB,iBACdxD,KAAA,CAAAiE,aAAA,CAAC1D,mBAAmB;IAChBuC,MAAM,EAAEA,MAAO;IACfY,IAAI,EAAEA,IAAK;IACXP,oBAAoB,EAAEA;EAAqB,CAC9C,CACJ,EAEAU,aAAa,EAEbP,cAAc,iBACXtD,KAAA,CAAAiE,aAAA,CAAC/D,iBAAiB;IACdgE,WAAW,EAAEnB,eAAgB;IAC7BuB,wBAAwB,EAAEpB,uBAAwB;IAClDmB,kBAAkB,EAAEb,iBAAkB;IACtCO,GAAG,EAAEJ,qBAAsB;IAC3Bc,GAAG,EAAC;EAAc,CACrB,CACJ,EACAlB,gBAAgB,iBAAIvD,KAAA,CAAAiE,aAAA,CAAChE,mBAAmB,QAAEmD,aAAmC,CAC9D,CAAC;AAE7B,CAAC;AAEDR,YAAY,CAACuC,WAAW,GAAG,cAAc;AAEzC,eAAevC,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSkeleton.js","names":["React","forwardRef","StyledBaseSkeleton","StyledMotionBaseSkeletonPulse","StyledMotionBaseSkeletonShimmer","SkeletonAnimationType","useSkeletonAnimation","useSkeletonContext","BaseSkeleton","baseColor","highlightColor","animationType","height","style","width","className","borderRadius","as","children","ref","values","animationStyle","resolvedAnimationType","createElement","$backgroundColor","$borderRadius","$height","$width","$shouldUseNativeTag","SHIMMER","$color","PULSE","displayName"],"sources":["../../../../../src/components/skeleton/base-skeleton/BaseSkeleton.tsx"],"sourcesContent":["import React, { forwardRef,
|
|
1
|
+
{"version":3,"file":"BaseSkeleton.js","names":["React","forwardRef","StyledBaseSkeleton","StyledMotionBaseSkeletonPulse","StyledMotionBaseSkeletonShimmer","SkeletonAnimationType","useSkeletonAnimation","useSkeletonContext","BaseSkeleton","baseColor","highlightColor","animationType","height","style","width","className","borderRadius","as","children","ref","values","animationStyle","resolvedAnimationType","createElement","$backgroundColor","$borderRadius","$height","$width","$shouldUseNativeTag","SHIMMER","$color","PULSE","displayName"],"sources":["../../../../../src/components/skeleton/base-skeleton/BaseSkeleton.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, type JSX } from 'react';\nimport {\n StyledBaseSkeleton,\n StyledMotionBaseSkeletonPulse,\n StyledMotionBaseSkeletonShimmer,\n} from './BaseSkeleton.styles';\nimport { BaseSkeletonConfig, SkeletonAnimationType } from '../types';\nimport { useSkeletonAnimation, useSkeletonContext } from '../skeleton-provider/SkeletonProvider';\n\nexport interface BaseSkeletonProps extends BaseSkeletonConfig {\n width: number | string;\n height: number | string;\n as?: keyof JSX.IntrinsicElements;\n children?: ReactNode;\n}\n\nexport const BaseSkeleton = forwardRef<HTMLDivElement, BaseSkeletonProps>(\n (\n {\n baseColor,\n highlightColor,\n animationType,\n height,\n style,\n width,\n className,\n borderRadius,\n as,\n children,\n },\n ref,\n ) => {\n const values = useSkeletonContext();\n const animationStyle = useSkeletonAnimation();\n\n const resolvedAnimationType = animationType ?? values.animationType;\n\n return (\n <StyledBaseSkeleton\n as={as}\n ref={ref}\n className={className}\n style={style}\n $backgroundColor={baseColor ?? values.baseColor}\n $borderRadius={borderRadius ?? values.borderRadius}\n $height={height}\n $width={width}\n $shouldUseNativeTag={!!as}\n >\n {resolvedAnimationType === SkeletonAnimationType.SHIMMER && (\n <StyledMotionBaseSkeletonShimmer\n $color={highlightColor ?? values.highlightColor}\n style={animationStyle}\n />\n )}\n {resolvedAnimationType === SkeletonAnimationType.PULSE && (\n <StyledMotionBaseSkeletonPulse\n $color={highlightColor ?? values.highlightColor}\n style={animationStyle}\n />\n )}\n {children}\n </StyledBaseSkeleton>\n );\n },\n);\n\nBaseSkeleton.displayName = 'BaseSkeleton';\n\nexport default BaseSkeleton;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAA6B,OAAO;AAC9D,SACIC,kBAAkB,EAClBC,6BAA6B,EAC7BC,+BAA+B,QAC5B,uBAAuB;AAC9B,SAA6BC,qBAAqB,QAAQ,UAAU;AACpE,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,uCAAuC;AAShG,OAAO,MAAMC,YAAY,gBAAGP,UAAU,CAClC,CACI;EACIQ,SAAS;EACTC,cAAc;EACdC,aAAa;EACbC,MAAM;EACNC,KAAK;EACLC,KAAK;EACLC,SAAS;EACTC,YAAY;EACZC,EAAE;EACFC;AACJ,CAAC,EACDC,GAAG,KACF;EACD,MAAMC,MAAM,GAAGb,kBAAkB,CAAC,CAAC;EACnC,MAAMc,cAAc,GAAGf,oBAAoB,CAAC,CAAC;EAE7C,MAAMgB,qBAAqB,GAAGX,aAAa,IAAIS,MAAM,CAACT,aAAa;EAEnE,oBACIX,KAAA,CAAAuB,aAAA,CAACrB,kBAAkB;IACfe,EAAE,EAAEA,EAAG;IACPE,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEA,SAAU;IACrBF,KAAK,EAAEA,KAAM;IACbW,gBAAgB,EAAEf,SAAS,IAAIW,MAAM,CAACX,SAAU;IAChDgB,aAAa,EAAET,YAAY,IAAII,MAAM,CAACJ,YAAa;IACnDU,OAAO,EAAEd,MAAO;IAChBe,MAAM,EAAEb,KAAM;IACdc,mBAAmB,EAAE,CAAC,CAACX;EAAG,GAEzBK,qBAAqB,KAAKjB,qBAAqB,CAACwB,OAAO,iBACpD7B,KAAA,CAAAuB,aAAA,CAACnB,+BAA+B;IAC5B0B,MAAM,EAAEpB,cAAc,IAAIU,MAAM,CAACV,cAAe;IAChDG,KAAK,EAAEQ;EAAe,CACzB,CACJ,EACAC,qBAAqB,KAAKjB,qBAAqB,CAAC0B,KAAK,iBAClD/B,KAAA,CAAAuB,aAAA,CAACpB,6BAA6B;IAC1B2B,MAAM,EAAEpB,cAAc,IAAIU,MAAM,CAACV,cAAe;IAChDG,KAAK,EAAEQ;EAAe,CACzB,CACJ,EACAH,QACe,CAAC;AAE7B,CACJ,CAAC;AAEDV,YAAY,CAACwB,WAAW,GAAG,cAAc;AAEzC,eAAexB,YAAY","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEventHandler, CSSProperties, FocusEventHandler,
|
|
1
|
+
import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactNode, type JSX } from 'react';
|
|
2
2
|
import { CSSPropertiesWithVars } from 'styled-components/dist/types';
|
|
3
3
|
import { DropdownDirection } from '../../types/dropdown';
|
|
4
4
|
/**
|
|
@@ -38,7 +38,7 @@ export interface ComboBoxTextStyles {
|
|
|
38
38
|
/**
|
|
39
39
|
* The HTML tag that should be used for the text wrapper.
|
|
40
40
|
*/
|
|
41
|
-
tagName?: keyof
|
|
41
|
+
tagName?: keyof JSX.IntrinsicElements;
|
|
42
42
|
/**
|
|
43
43
|
* Additional inline styles applied to the text wrapper.
|
|
44
44
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode, type JSX } from 'react';
|
|
2
2
|
import { BaseSkeletonConfig } from '../types';
|
|
3
3
|
export interface BaseSkeletonProps extends BaseSkeletonConfig {
|
|
4
4
|
width: number | string;
|
|
5
5
|
height: number | string;
|
|
6
|
-
as?: keyof
|
|
6
|
+
as?: keyof JSX.IntrinsicElements;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare const BaseSkeleton: React.ForwardRefExoticComponent<BaseSkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.18",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typescript": "^5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@chayns-components/textstring": "^5.4.
|
|
74
|
+
"@chayns-components/textstring": "^5.4.17",
|
|
75
75
|
"@chayns/colors": "^2.0.2",
|
|
76
76
|
"@chayns/uac-service": "~0.0.62",
|
|
77
77
|
"clsx": "^2.1.1",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "299097370936bd0a7b1c8872ed479947b0c2c693"
|
|
92
92
|
}
|