@chayns-components/core 5.3.8 → 5.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +61 -2
- package/lib/cjs/components/list/list-item/ListItem.js +6 -1
- package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.styles.js +7 -4
- package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/cjs/components/masonry/Masonry.context.js +17 -0
- package/lib/cjs/components/masonry/Masonry.context.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.hooks.js +53 -0
- package/lib/cjs/components/masonry/Masonry.hooks.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.js +81 -0
- package/lib/cjs/components/masonry/Masonry.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.styles.js +16 -0
- package/lib/cjs/components/masonry/Masonry.styles.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.types.js +6 -0
- package/lib/cjs/components/masonry/Masonry.types.js.map +1 -0
- package/lib/cjs/components/masonry/Masonry.utils.js +121 -0
- package/lib/cjs/components/masonry/Masonry.utils.js.map +1 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.js +77 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.js.map +1 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js +17 -0
- package/lib/cjs/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
- package/lib/cjs/hooks/element.js +12 -1
- package/lib/cjs/hooks/element.js.map +1 -1
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.js +6 -1
- package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.styles.js +7 -4
- package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/esm/components/masonry/Masonry.context.js +10 -0
- package/lib/esm/components/masonry/Masonry.context.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.hooks.js +44 -0
- package/lib/esm/components/masonry/Masonry.hooks.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.js +74 -0
- package/lib/esm/components/masonry/Masonry.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.styles.js +9 -0
- package/lib/esm/components/masonry/Masonry.styles.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.types.js +2 -0
- package/lib/esm/components/masonry/Masonry.types.js.map +1 -0
- package/lib/esm/components/masonry/Masonry.utils.js +110 -0
- package/lib/esm/components/masonry/Masonry.utils.js.map +1 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.js +69 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.js.map +1 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js +10 -0
- package/lib/esm/components/masonry/masonry-item/MasonryItem.styles.js.map +1 -0
- package/lib/esm/hooks/element.js +10 -0
- package/lib/esm/hooks/element.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/types/components/list/list-item/ListItem.d.ts +4 -0
- package/lib/types/components/list/list-item/ListItem.styles.d.ts +6 -2
- package/lib/types/components/masonry/Masonry.context.d.ts +3 -0
- package/lib/types/components/masonry/Masonry.d.ts +3 -0
- package/lib/types/components/masonry/Masonry.hooks.d.ts +22 -0
- package/lib/types/components/masonry/Masonry.styles.d.ts +5 -0
- package/lib/types/components/masonry/Masonry.types.d.ts +40 -0
- package/lib/types/components/masonry/Masonry.utils.d.ts +22 -0
- package/lib/types/components/masonry/masonry-item/MasonryItem.d.ts +5 -0
- package/lib/types/components/masonry/masonry-item/MasonryItem.styles.d.ts +5 -0
- package/lib/types/hooks/element.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @chayns-components/core
|
|
2
2
|
|
|
3
|
-
React component package providing
|
|
3
|
+
React component package providing 46 documented components for chayns applications.
|
|
4
4
|
|
|
5
|
-
Documented components: `Accordion`, `AmountControl`, `AnimatedNumber`, `Badge`, `Button`, `Checkbox`, `ComboBox`, `ContentCard`, `ContextMenu`, `ExpandableContent`, `FileInput`, `FileList`, `FileSelect`, `Filter`, `FilterButtons`, `GridImage`, `GroupedImage`, `HighlightSlider`, `Icon`, `Input`, `List`, `MentionFinder`, `MultiActionButton`, `NumberInput`, `Popup`, `ProgressBar`, `RadioButton`, `ScrollView`, `SearchBox`, `SearchInput`, `SelectButton`, `SetupWizard`, `SetupWizardItem`, `SharingBar`, `SharingButton`, `Signature`, `Skeleton`, `Slider`, `SliderButton`, `SmallWaitCursor`, `TagInput`, `TextArea`, `Tooltip`, `Truncation`, `VerificationBadge`.
|
|
5
|
+
Documented components: `Accordion`, `AmountControl`, `AnimatedNumber`, `Badge`, `Button`, `Checkbox`, `ComboBox`, `ContentCard`, `ContextMenu`, `ExpandableContent`, `FileInput`, `FileList`, `FileSelect`, `Filter`, `FilterButtons`, `GridImage`, `GroupedImage`, `HighlightSlider`, `Icon`, `Input`, `List`, `Masonry`, `MentionFinder`, `MultiActionButton`, `NumberInput`, `Popup`, `ProgressBar`, `RadioButton`, `ScrollView`, `SearchBox`, `SearchInput`, `SelectButton`, `SetupWizard`, `SetupWizardItem`, `SharingBar`, `SharingButton`, `Signature`, `Skeleton`, `Slider`, `SliderButton`, `SmallWaitCursor`, `TagInput`, `TextArea`, `Tooltip`, `Truncation`, `VerificationBadge`.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -39,6 +39,7 @@ import { Accordion, AmountControl, AnimatedNumber } from '@chayns-components/cor
|
|
|
39
39
|
- `Icon`
|
|
40
40
|
- `Input`
|
|
41
41
|
- `List`
|
|
42
|
+
- `Masonry`
|
|
42
43
|
- `MentionFinder`
|
|
43
44
|
- `MultiActionButton`
|
|
44
45
|
- `NumberInput`
|
|
@@ -3006,6 +3007,64 @@ No additional exported types documented.
|
|
|
3006
3007
|
|
|
3007
3008
|
### Anti Patterns
|
|
3008
3009
|
|
|
3010
|
+
- Avoid imports from internal paths such as `@chayns-components/core/src/...`; always use the public package export.
|
|
3011
|
+
## Masonry
|
|
3012
|
+
|
|
3013
|
+
`Masonry` is exported by `@chayns-components/core` and should be imported from the public package entry point.
|
|
3014
|
+
|
|
3015
|
+
### Import
|
|
3016
|
+
|
|
3017
|
+
```ts
|
|
3018
|
+
import { Masonry } from '@chayns-components/core';
|
|
3019
|
+
```
|
|
3020
|
+
|
|
3021
|
+
### Examples
|
|
3022
|
+
|
|
3023
|
+
#### General
|
|
3024
|
+
|
|
3025
|
+
```tsx
|
|
3026
|
+
<Masonry
|
|
3027
|
+
gap={16}
|
|
3028
|
+
columnWidth={160}
|
|
3029
|
+
rowHeight={80}
|
|
3030
|
+
/>
|
|
3031
|
+
```
|
|
3032
|
+
|
|
3033
|
+
#### Packed
|
|
3034
|
+
|
|
3035
|
+
```tsx
|
|
3036
|
+
<Masonry
|
|
3037
|
+
gap={16}
|
|
3038
|
+
columnWidth={160}
|
|
3039
|
+
rowHeight={80}
|
|
3040
|
+
/>
|
|
3041
|
+
```
|
|
3042
|
+
|
|
3043
|
+
#### Dynamic
|
|
3044
|
+
|
|
3045
|
+
```tsx
|
|
3046
|
+
<Masonry
|
|
3047
|
+
gap={16}
|
|
3048
|
+
columnWidth={160}
|
|
3049
|
+
rowHeight={80}
|
|
3050
|
+
/>
|
|
3051
|
+
```
|
|
3052
|
+
|
|
3053
|
+
### Props
|
|
3054
|
+
|
|
3055
|
+
No prop documentation available.
|
|
3056
|
+
|
|
3057
|
+
### Types
|
|
3058
|
+
|
|
3059
|
+
No additional exported types documented.
|
|
3060
|
+
|
|
3061
|
+
### Usage Notes
|
|
3062
|
+
|
|
3063
|
+
- Import `Masonry` directly from `@chayns-components/core` instead of internal source paths.
|
|
3064
|
+
- Start with one of the documented Storybook examples and adapt the props incrementally for your use case.
|
|
3065
|
+
|
|
3066
|
+
### Anti Patterns
|
|
3067
|
+
|
|
3009
3068
|
- Avoid imports from internal paths such as `@chayns-components/core/src/...`; always use the public package export.
|
|
3010
3069
|
## MentionFinder
|
|
3011
3070
|
|
|
@@ -14,6 +14,7 @@ var _ListItemBody = _interopRequireDefault(require("./list-item-body/ListItemBod
|
|
|
14
14
|
var _ListItemHead = _interopRequireDefault(require("./list-item-head/ListItemHead"));
|
|
15
15
|
var _ListItem = require("./ListItem.styles");
|
|
16
16
|
var _Tooltip = _interopRequireDefault(require("../../tooltip/Tooltip"));
|
|
17
|
+
var _element = require("../../../hooks/element");
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
20
|
const ListItem = /*#__PURE__*/(0, _react2.forwardRef)(({
|
|
@@ -52,7 +53,8 @@ const ListItem = /*#__PURE__*/(0, _react2.forwardRef)(({
|
|
|
52
53
|
onSizeChange,
|
|
53
54
|
titleElement,
|
|
54
55
|
shouldDisableAnimation = false,
|
|
55
|
-
cornerElement
|
|
56
|
+
cornerElement,
|
|
57
|
+
isSelected = false
|
|
56
58
|
}, ref) => {
|
|
57
59
|
const {
|
|
58
60
|
isAnyItemExpandable,
|
|
@@ -66,6 +68,7 @@ const ListItem = /*#__PURE__*/(0, _react2.forwardRef)(({
|
|
|
66
68
|
const areaProvider = (0, _react2.useContext)(_AreaContextProvider.AreaContext);
|
|
67
69
|
const isInitialRenderRef = (0, _react2.useRef)(true);
|
|
68
70
|
const listItemRef = (0, _react2.useRef)(null);
|
|
71
|
+
const isInDialog = (0, _element.useIsInsideDialog)(listItemRef);
|
|
69
72
|
const uuid = (0, _uuid.useUuid)();
|
|
70
73
|
const isExpandable = children !== undefined;
|
|
71
74
|
const isItemOpen = isOpen ?? openItemUuid === uuid;
|
|
@@ -144,6 +147,8 @@ const ListItem = /*#__PURE__*/(0, _react2.forwardRef)(({
|
|
|
144
147
|
$isInAccordion: typeof isParentAccordionWrapped === 'boolean' && !areaProvider.shouldDisableListItemPadding,
|
|
145
148
|
$isOpen: isItemOpen,
|
|
146
149
|
$isWrapped: isWrapped,
|
|
150
|
+
$isInDialog: isInDialog,
|
|
151
|
+
$isSelected: isSelected,
|
|
147
152
|
$shouldChangeColor: areaProvider.shouldChangeColor,
|
|
148
153
|
$shouldForceBackground: shouldForceBackground,
|
|
149
154
|
$shouldForceBottomLine: shouldForceBottomLine,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","names":["_react","require","_react2","_interopRequireWildcard","_uuid","_Accordion","_AreaContextProvider","_List","_ListItemBody","_interopRequireDefault","_ListItemHead","_ListItem","_Tooltip","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItem","forwardRef","backgroundColor","careOfLocationId","children","cornerImage","hoverItem","icons","imageBackground","images","isDefaultOpen","isOpen","isTitleGreyed","leftElements","onClick","onClose","onLongPress","onOpen","rightElements","shouldShowTooltipOnTitleOverflow","shouldForceBackground","shouldForceBottomLine","shouldForceHover","shouldHideBottomLine","shouldOpenImageOnClick","shouldHideImageOrIconBackground","shouldHideIndicator","shouldPreventLayoutAnimation","shouldRenderClosed","shouldShowRoundImageOrIcon","shouldShowSeparatorBelow","subtitle","title","onImageError","onSizeChange","titleElement","shouldDisableAnimation","cornerElement","ref","isAnyItemExpandable","isWrapped","openItemUuid","updateOpenItemUuid","useContext","ListContext","isParentAccordionWrapped","AccordionContext","areaProvider","AreaContext","isInitialRenderRef","useRef","listItemRef","uuid","useUuid","isExpandable","undefined","isItemOpen","onCloseRef","onOpenRef","shouldEnableTooltip","setShouldEnableTooltip","useState","titleWidth","setTitleWidth","titleMaxWidth","setTitleMaxWidth","useEffect","current","handleHeadClick","useCallback","event","shouldOnlyOpen","isClickable","useImperativeHandle","handleTitleWidthChange","width","maxWidth","createElement","StyledListItem","as","motion","div","animate","height","opacity","className","exit","initial","key","layout","$backgroundColor","$isClickable","$isInAccordion","shouldDisableListItemPadding","$isOpen","$isWrapped","$shouldChangeColor","shouldChangeColor","$shouldForceBackground","$shouldForceBottomLine","$shouldHideBottomLine","$shouldHideIndicator","$shouldShowSeparatorBelow","shouldUseFullWidth","isDisabled","item","StyledListItemTooltip","style","cursor","onTitleWidthChange","AnimatePresence","id","shouldHideBody","displayName","_default","exports"],"sources":["../../../../../src/components/list/list-item/ListItem.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IListItemRightElements } from '../../../types/list';\nimport { AccordionContext } from '../../accordion/Accordion';\nimport AreaContextProvider, { AreaContext } from '../../area-provider/AreaContextProvider';\nimport { ListContext } from '../List';\nimport ListItemBody from './list-item-body/ListItemBody';\nimport ListItemHead from './list-item-head/ListItemHead';\nimport { StyledListItem, StyledListItemTooltip } from './ListItem.styles';\nimport Tooltip from '../../tooltip/Tooltip';\n\nexport type ListItemElements = [ReactNode, ...ReactNode[]];\n\nexport interface ListItemSize {\n titleWidth: number;\n titleMaxWidth: number;\n}\n\nexport type ListItemProps = {\n /**\n * The background color of the `ListItem`.\n */\n backgroundColor?: CSSProperties['backgroundColor'];\n /**\n * DEPRECATED: Use `cornerImage` instead.\n */\n careOfLocationId?: number;\n /**\n * The content of the `ListItem` body. When the `ListItem` has children,\n * it can be opened and also gets an icon as an indicator automatically.\n */\n children?: ReactNode;\n /**\n * The image that is displayed in the bottom right corner of the grouped image of list item.\n */\n cornerImage?: string;\n /**\n * Element that is displayed when hovering over the `ListItem` on the right\n * side. On mobile devices, this element is not displayed.\n */\n hoverItem?: ReactNode;\n /**\n * The FontAwesome or tobit icons to render like an image on the left side\n * of the header. Multiple icons are stacked. See the `Icon` component\n * documentation for more information.\n */\n icons?: string[];\n /**\n * The background of the image. This is only used if images are passed.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * A list of image URLs that are displayed on the left side of the header.\n * If multiple URLs are passed, the image is assembled from the first three\n * image URLs as a puzzle.\n */\n images?: string[];\n /**\n * This can be used to automatically expand the `ListItem` during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This overrides the internal opening state of the item and makes it controlled.\n */\n isOpen?: boolean;\n /**\n * Whether the ListItem locks disabled but has full functionality.\n */\n isTitleGreyed?: boolean;\n /**\n * Elements that are displayed on the left side of the header. If multiple\n * elements are specified, they are displayed one aside the other.\n */\n leftElements?: ListItemElements;\n /**\n * Function to be executed when the header of the `ListItem` was clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the header of the `ListItem` is pressed for\n * 400 milliseconds.\n */\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is opened.\n */\n onOpen?: VoidFunction;\n /**\n * Elements that are displayed on the right side of the header. If multiple\n * elements are specified, they are displayed one below the other.\n */\n rightElements?: IListItemRightElements;\n /**\n * This will force the background color of the ListItem to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * Whether the line should be forced, e.g., so that it is also displayed if the item is the last element in the list.\n */\n shouldForceBottomLine?: boolean;\n /**\n * Whether the hover item should be forced.\n */\n shouldForceHover?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * Whether the background and border of the shape on which the image or icon of the element is displayed should be\n * hidden.\n */\n shouldHideImageOrIconBackground?: boolean;\n /**\n * If the `ListItem` is expandable, the indicator is displayed on the left\n * side of the header. If this property is set to true, the indicator is\n * hidden.\n */\n shouldHideIndicator?: boolean;\n /**\n * Whether the image should be opened on click.\n */\n shouldOpenImageOnClick?: boolean;\n /**\n * Whether the layout animation should be prevented. This is useful when the\n * `ListItem` is used in a list with a lot of items and the layout animation\n * is not desired.\n */\n shouldPreventLayoutAnimation?: boolean;\n /**\n * This will render the ListItem closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the image or icon should be displayed in a round shape. This should always be used for images of persons.\n */\n shouldShowRoundImageOrIcon?: boolean;\n /**\n * Whether a separator should be displayed below this item. In this case, the border is displayed thicker than normal.\n */\n shouldShowSeparatorBelow?: boolean;\n /**\n * Whether a Tooltip should be displayed on hover if the title is cut.\n */\n shouldShowTooltipOnTitleOverflow?: boolean;\n /**\n * Subtitle of the `ListItem` displayed in the head below the title\n */\n subtitle?: ReactNode;\n /**\n * Title of the `ListItem` displayed in the head\n */\n title: ReactNode;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * Whether the ListItem Animation should be disabled.\n */\n shouldDisableAnimation?: 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 * Function to be executed if the size are changed.\n */\n onSizeChange?: (sizes: ListItemSize) => void;\n};\n\nexport type ListItemRef = ListItemSize;\n\nconst ListItem = forwardRef<ListItemRef, ListItemProps>(\n (\n {\n backgroundColor,\n careOfLocationId,\n children,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isDefaultOpen,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onClose,\n onLongPress,\n onOpen,\n rightElements,\n shouldShowTooltipOnTitleOverflow = false,\n shouldForceBackground = false,\n shouldForceBottomLine = false,\n shouldForceHover = false,\n shouldHideBottomLine = false,\n shouldOpenImageOnClick = false,\n shouldHideImageOrIconBackground,\n shouldHideIndicator = false,\n shouldPreventLayoutAnimation = false,\n shouldRenderClosed = false,\n shouldShowRoundImageOrIcon,\n shouldShowSeparatorBelow = false,\n subtitle,\n title,\n onImageError,\n onSizeChange,\n titleElement,\n shouldDisableAnimation = false,\n cornerElement,\n },\n ref,\n ) => {\n const { isAnyItemExpandable, isWrapped, openItemUuid, updateOpenItemUuid } =\n useContext(ListContext);\n\n const { isWrapped: isParentAccordionWrapped } = useContext(AccordionContext);\n\n const areaProvider = useContext(AreaContext);\n\n const isInitialRenderRef = useRef(true);\n\n const listItemRef = useRef<HTMLDivElement>(null);\n\n const uuid = useUuid();\n\n const isExpandable = children !== undefined;\n const isItemOpen = isOpen ?? openItemUuid === uuid;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n const [shouldEnableTooltip, setShouldEnableTooltip] = useState(false);\n const [titleWidth, setTitleWidth] = useState(0);\n const [titleMaxWidth, setTitleMaxWidth] = useState(0);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isItemOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isItemOpen]);\n\n const handleHeadClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n if (isExpandable) {\n updateOpenItemUuid(uuid);\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n },\n [isExpandable, onClick, updateOpenItemUuid, uuid],\n );\n\n useEffect(() => {\n if (isDefaultOpen) {\n updateOpenItemUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenItemUuid, uuid]);\n\n const isClickable = typeof onClick === 'function' || isExpandable;\n\n useEffect(() => {\n if (typeof onSizeChange === 'function') {\n onSizeChange({\n titleWidth,\n titleMaxWidth,\n });\n }\n }, [onSizeChange, titleMaxWidth, titleWidth]);\n\n useImperativeHandle(\n ref,\n () => ({\n titleWidth,\n titleMaxWidth,\n }),\n [titleMaxWidth, titleWidth],\n );\n\n const handleTitleWidthChange = useCallback((width: number, maxWidth: number) => {\n setTitleWidth(width);\n setTitleMaxWidth(maxWidth);\n }, []);\n\n return (\n <StyledListItem\n as={shouldDisableAnimation ? undefined : motion.div}\n animate={shouldDisableAnimation ? undefined : { height: 'auto', opacity: 1 }}\n className=\"beta-chayns-list-item\"\n exit={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n initial={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n key={`list-item-${uuid}`}\n ref={listItemRef}\n layout={\n shouldPreventLayoutAnimation || shouldDisableAnimation ? undefined : 'position'\n }\n $backgroundColor={backgroundColor}\n $isClickable={isClickable}\n $isInAccordion={\n typeof isParentAccordionWrapped === 'boolean' &&\n !areaProvider.shouldDisableListItemPadding\n }\n $isOpen={isItemOpen}\n $isWrapped={isWrapped}\n $shouldChangeColor={areaProvider.shouldChangeColor}\n $shouldForceBackground={shouldForceBackground}\n $shouldForceBottomLine={shouldForceBottomLine}\n $shouldHideBottomLine={shouldHideBottomLine}\n $shouldHideIndicator={shouldHideIndicator}\n $shouldShowSeparatorBelow={shouldShowSeparatorBelow}\n >\n <Tooltip\n shouldUseFullWidth\n isDisabled={!shouldShowTooltipOnTitleOverflow || !shouldEnableTooltip}\n item={\n <StyledListItemTooltip\n style={{ cursor: 'default' }}\n key={`list-item-tooltip-${uuid}`}\n >\n {title}\n </StyledListItemTooltip>\n }\n >\n <ListItemHead\n hoverItem={hoverItem}\n careOfLocationId={careOfLocationId}\n cornerElement={cornerElement}\n cornerImage={cornerImage}\n icons={icons}\n imageBackground={imageBackground}\n images={images}\n isAnyItemExpandable={isAnyItemExpandable}\n isExpandable={isExpandable}\n isOpen={isItemOpen}\n isTitleGreyed={isTitleGreyed}\n leftElements={leftElements}\n onClick={isClickable ? handleHeadClick : undefined}\n onLongPress={onLongPress}\n shouldForceHover={shouldForceHover}\n rightElements={rightElements}\n shouldHideImageOrIconBackground={shouldHideImageOrIconBackground}\n shouldHideIndicator={shouldHideIndicator}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldShowRoundImageOrIcon={shouldShowRoundImageOrIcon}\n subtitle={subtitle}\n title={title}\n onTitleWidthChange={handleTitleWidthChange}\n titleElement={titleElement}\n setShouldEnableTooltip={setShouldEnableTooltip}\n shouldDisableAnimation={shouldDisableAnimation}\n onImageError={onImageError}\n />\n </Tooltip>\n <AnimatePresence initial={false}>\n {isExpandable && (isItemOpen || shouldRenderClosed) && (\n <ListItemBody\n id={uuid}\n key={`listItemBody-${uuid}`}\n shouldHideBody={shouldRenderClosed && !isItemOpen}\n >\n <AreaContextProvider>{children}</AreaContextProvider>\n </ListItemBody>\n )}\n </AnimatePresence>\n </StyledListItem>\n );\n },\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAcA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAH,sBAAA,CAAAR,OAAA;AAA4C,SAAAQ,uBAAAI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AC3BC,OAAO,EAAE0D,WAAW,GAAGJ,eAAe,GAAGb,SAAU;IACnDvC,WAAW,EAAEA,WAAY;IACzBM,gBAAgB,EAAEA,gBAAiB;IACnCJ,aAAa,EAAEA,aAAc;IAC7BO,+BAA+B,EAAEA,+BAAgC;IACjEC,mBAAmB,EAAEA,mBAAoB;IACzCF,sBAAsB,EAAEA,sBAAuB;IAC/CK,0BAA0B,EAAEA,0BAA2B;IACvDE,QAAQ,EAAEA,QAAS;IACnBC,KAAK,EAAEA,KAAM;IACb6E,kBAAkB,EAAEnC,sBAAuB;IAC3CvC,YAAY,EAAEA,YAAa;IAC3ByB,sBAAsB,EAAEA,sBAAuB;IAC/CxB,sBAAsB,EAAEA,sBAAuB;IAC/CH,YAAY,EAAEA;EAAa,CAC9B,CACI,CAAC,eACV/D,OAAA,CAAAa,OAAA,CAAA8F,aAAA,CAAC7G,MAAA,CAAA8I,eAAe;IAACvB,OAAO,EAAE;EAAM,GAC3BjC,YAAY,KAAKE,UAAU,IAAI5B,kBAAkB,CAAC,iBAC/C1D,OAAA,CAAAa,OAAA,CAAA8F,aAAA,CAACrG,aAAA,CAAAO,OAAY;IACTgI,EAAE,EAAE3D,IAAK;IACToC,GAAG,EAAE,gBAAgBpC,IAAI,EAAG;IAC5B4D,cAAc,EAAEpF,kBAAkB,IAAI,CAAC4B;EAAW,gBAElDtF,OAAA,CAAAa,OAAA,CAAA8F,aAAA,CAACvG,oBAAA,CAAAS,OAAmB,QAAEqB,QAA8B,CAC1C,CAEL,CACL,CAAC;AAEzB,CACJ,CAAC;AAEDJ,QAAQ,CAACiH,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApI,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListItem.js","names":["_react","require","_react2","_interopRequireWildcard","_uuid","_Accordion","_AreaContextProvider","_List","_ListItemBody","_interopRequireDefault","_ListItemHead","_ListItem","_Tooltip","_element","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItem","forwardRef","backgroundColor","careOfLocationId","children","cornerImage","hoverItem","icons","imageBackground","images","isDefaultOpen","isOpen","isTitleGreyed","leftElements","onClick","onClose","onLongPress","onOpen","rightElements","shouldShowTooltipOnTitleOverflow","shouldForceBackground","shouldForceBottomLine","shouldForceHover","shouldHideBottomLine","shouldOpenImageOnClick","shouldHideImageOrIconBackground","shouldHideIndicator","shouldPreventLayoutAnimation","shouldRenderClosed","shouldShowRoundImageOrIcon","shouldShowSeparatorBelow","subtitle","title","onImageError","onSizeChange","titleElement","shouldDisableAnimation","cornerElement","isSelected","ref","isAnyItemExpandable","isWrapped","openItemUuid","updateOpenItemUuid","useContext","ListContext","isParentAccordionWrapped","AccordionContext","areaProvider","AreaContext","isInitialRenderRef","useRef","listItemRef","isInDialog","useIsInsideDialog","uuid","useUuid","isExpandable","undefined","isItemOpen","onCloseRef","onOpenRef","shouldEnableTooltip","setShouldEnableTooltip","useState","titleWidth","setTitleWidth","titleMaxWidth","setTitleMaxWidth","useEffect","current","handleHeadClick","useCallback","event","shouldOnlyOpen","isClickable","useImperativeHandle","handleTitleWidthChange","width","maxWidth","createElement","StyledListItem","as","motion","div","animate","height","opacity","className","exit","initial","key","layout","$backgroundColor","$isClickable","$isInAccordion","shouldDisableListItemPadding","$isOpen","$isWrapped","$isInDialog","$isSelected","$shouldChangeColor","shouldChangeColor","$shouldForceBackground","$shouldForceBottomLine","$shouldHideBottomLine","$shouldHideIndicator","$shouldShowSeparatorBelow","shouldUseFullWidth","isDisabled","item","StyledListItemTooltip","style","cursor","onTitleWidthChange","AnimatePresence","id","shouldHideBody","displayName","_default","exports"],"sources":["../../../../../src/components/list/list-item/ListItem.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IListItemRightElements } from '../../../types/list';\nimport { AccordionContext } from '../../accordion/Accordion';\nimport AreaContextProvider, { AreaContext } from '../../area-provider/AreaContextProvider';\nimport { ListContext } from '../List';\nimport ListItemBody from './list-item-body/ListItemBody';\nimport ListItemHead from './list-item-head/ListItemHead';\nimport { StyledListItem, StyledListItemTooltip } from './ListItem.styles';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { useIsInsideDialog } from '../../../hooks/element';\n\nexport type ListItemElements = [ReactNode, ...ReactNode[]];\n\nexport interface ListItemSize {\n titleWidth: number;\n titleMaxWidth: number;\n}\n\nexport type ListItemProps = {\n /**\n * The background color of the `ListItem`.\n */\n backgroundColor?: CSSProperties['backgroundColor'];\n /**\n * DEPRECATED: Use `cornerImage` instead.\n */\n careOfLocationId?: number;\n /**\n * The content of the `ListItem` body. When the `ListItem` has children,\n * it can be opened and also gets an icon as an indicator automatically.\n */\n children?: ReactNode;\n /**\n * The image that is displayed in the bottom right corner of the grouped image of list item.\n */\n cornerImage?: string;\n /**\n * Element that is displayed when hovering over the `ListItem` on the right\n * side. On mobile devices, this element is not displayed.\n */\n hoverItem?: ReactNode;\n /**\n * The FontAwesome or tobit icons to render like an image on the left side\n * of the header. Multiple icons are stacked. See the `Icon` component\n * documentation for more information.\n */\n icons?: string[];\n /**\n * The background of the image. This is only used if images are passed.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * A list of image URLs that are displayed on the left side of the header.\n * If multiple URLs are passed, the image is assembled from the first three\n * image URLs as a puzzle.\n */\n images?: string[];\n /**\n * This can be used to automatically expand the `ListItem` during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This overrides the internal opening state of the item and makes it controlled.\n */\n isOpen?: boolean;\n /**\n * Whether the ListItem locks disabled but has full functionality.\n */\n isTitleGreyed?: boolean;\n /**\n * Whether the item is selected.\n */\n isSelected?: boolean;\n /**\n * Elements that are displayed on the left side of the header. If multiple\n * elements are specified, they are displayed one aside the other.\n */\n leftElements?: ListItemElements;\n /**\n * Function to be executed when the header of the `ListItem` was clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the header of the `ListItem` is pressed for\n * 400 milliseconds.\n */\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is opened.\n */\n onOpen?: VoidFunction;\n /**\n * Elements that are displayed on the right side of the header. If multiple\n * elements are specified, they are displayed one below the other.\n */\n rightElements?: IListItemRightElements;\n /**\n * This will force the background color of the ListItem to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * Whether the line should be forced, e.g., so that it is also displayed if the item is the last element in the list.\n */\n shouldForceBottomLine?: boolean;\n /**\n * Whether the hover item should be forced.\n */\n shouldForceHover?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * Whether the background and border of the shape on which the image or icon of the element is displayed should be\n * hidden.\n */\n shouldHideImageOrIconBackground?: boolean;\n /**\n * If the `ListItem` is expandable, the indicator is displayed on the left\n * side of the header. If this property is set to true, the indicator is\n * hidden.\n */\n shouldHideIndicator?: boolean;\n /**\n * Whether the image should be opened on click.\n */\n shouldOpenImageOnClick?: boolean;\n /**\n * Whether the layout animation should be prevented. This is useful when the\n * `ListItem` is used in a list with a lot of items and the layout animation\n * is not desired.\n */\n shouldPreventLayoutAnimation?: boolean;\n /**\n * This will render the ListItem closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the image or icon should be displayed in a round shape. This should always be used for images of persons.\n */\n shouldShowRoundImageOrIcon?: boolean;\n /**\n * Whether a separator should be displayed below this item. In this case, the border is displayed thicker than normal.\n */\n shouldShowSeparatorBelow?: boolean;\n /**\n * Whether a Tooltip should be displayed on hover if the title is cut.\n */\n shouldShowTooltipOnTitleOverflow?: boolean;\n /**\n * Subtitle of the `ListItem` displayed in the head below the title\n */\n subtitle?: ReactNode;\n /**\n * Title of the `ListItem` displayed in the head\n */\n title: ReactNode;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * Whether the ListItem Animation should be disabled.\n */\n shouldDisableAnimation?: 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 * Function to be executed if the size are changed.\n */\n onSizeChange?: (sizes: ListItemSize) => void;\n};\n\nexport type ListItemRef = ListItemSize;\n\nconst ListItem = forwardRef<ListItemRef, ListItemProps>(\n (\n {\n backgroundColor,\n careOfLocationId,\n children,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isDefaultOpen,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onClose,\n onLongPress,\n onOpen,\n rightElements,\n shouldShowTooltipOnTitleOverflow = false,\n shouldForceBackground = false,\n shouldForceBottomLine = false,\n shouldForceHover = false,\n shouldHideBottomLine = false,\n shouldOpenImageOnClick = false,\n shouldHideImageOrIconBackground,\n shouldHideIndicator = false,\n shouldPreventLayoutAnimation = false,\n shouldRenderClosed = false,\n shouldShowRoundImageOrIcon,\n shouldShowSeparatorBelow = false,\n subtitle,\n title,\n onImageError,\n onSizeChange,\n titleElement,\n shouldDisableAnimation = false,\n cornerElement,\n isSelected = false,\n },\n ref,\n ) => {\n const { isAnyItemExpandable, isWrapped, openItemUuid, updateOpenItemUuid } =\n useContext(ListContext);\n\n const { isWrapped: isParentAccordionWrapped } = useContext(AccordionContext);\n\n const areaProvider = useContext(AreaContext);\n\n const isInitialRenderRef = useRef(true);\n\n const listItemRef = useRef<HTMLDivElement>(null);\n\n const isInDialog = useIsInsideDialog<HTMLDivElement>(listItemRef);\n\n const uuid = useUuid();\n\n const isExpandable = children !== undefined;\n const isItemOpen = isOpen ?? openItemUuid === uuid;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n const [shouldEnableTooltip, setShouldEnableTooltip] = useState(false);\n const [titleWidth, setTitleWidth] = useState(0);\n const [titleMaxWidth, setTitleMaxWidth] = useState(0);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isItemOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isItemOpen]);\n\n const handleHeadClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n if (isExpandable) {\n updateOpenItemUuid(uuid);\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n },\n [isExpandable, onClick, updateOpenItemUuid, uuid],\n );\n\n useEffect(() => {\n if (isDefaultOpen) {\n updateOpenItemUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenItemUuid, uuid]);\n\n const isClickable = typeof onClick === 'function' || isExpandable;\n\n useEffect(() => {\n if (typeof onSizeChange === 'function') {\n onSizeChange({\n titleWidth,\n titleMaxWidth,\n });\n }\n }, [onSizeChange, titleMaxWidth, titleWidth]);\n\n useImperativeHandle(\n ref,\n () => ({\n titleWidth,\n titleMaxWidth,\n }),\n [titleMaxWidth, titleWidth],\n );\n\n const handleTitleWidthChange = useCallback((width: number, maxWidth: number) => {\n setTitleWidth(width);\n setTitleMaxWidth(maxWidth);\n }, []);\n\n return (\n <StyledListItem\n as={shouldDisableAnimation ? undefined : motion.div}\n animate={shouldDisableAnimation ? undefined : { height: 'auto', opacity: 1 }}\n className=\"beta-chayns-list-item\"\n exit={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n initial={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n key={`list-item-${uuid}`}\n ref={listItemRef}\n layout={\n shouldPreventLayoutAnimation || shouldDisableAnimation ? undefined : 'position'\n }\n $backgroundColor={backgroundColor}\n $isClickable={isClickable}\n $isInAccordion={\n typeof isParentAccordionWrapped === 'boolean' &&\n !areaProvider.shouldDisableListItemPadding\n }\n $isOpen={isItemOpen}\n $isWrapped={isWrapped}\n $isInDialog={isInDialog}\n $isSelected={isSelected}\n $shouldChangeColor={areaProvider.shouldChangeColor}\n $shouldForceBackground={shouldForceBackground}\n $shouldForceBottomLine={shouldForceBottomLine}\n $shouldHideBottomLine={shouldHideBottomLine}\n $shouldHideIndicator={shouldHideIndicator}\n $shouldShowSeparatorBelow={shouldShowSeparatorBelow}\n >\n <Tooltip\n shouldUseFullWidth\n isDisabled={!shouldShowTooltipOnTitleOverflow || !shouldEnableTooltip}\n item={\n <StyledListItemTooltip\n style={{ cursor: 'default' }}\n key={`list-item-tooltip-${uuid}`}\n >\n {title}\n </StyledListItemTooltip>\n }\n >\n <ListItemHead\n hoverItem={hoverItem}\n careOfLocationId={careOfLocationId}\n cornerElement={cornerElement}\n cornerImage={cornerImage}\n icons={icons}\n imageBackground={imageBackground}\n images={images}\n isAnyItemExpandable={isAnyItemExpandable}\n isExpandable={isExpandable}\n isOpen={isItemOpen}\n isTitleGreyed={isTitleGreyed}\n leftElements={leftElements}\n onClick={isClickable ? handleHeadClick : undefined}\n onLongPress={onLongPress}\n shouldForceHover={shouldForceHover}\n rightElements={rightElements}\n shouldHideImageOrIconBackground={shouldHideImageOrIconBackground}\n shouldHideIndicator={shouldHideIndicator}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldShowRoundImageOrIcon={shouldShowRoundImageOrIcon}\n subtitle={subtitle}\n title={title}\n onTitleWidthChange={handleTitleWidthChange}\n titleElement={titleElement}\n setShouldEnableTooltip={setShouldEnableTooltip}\n shouldDisableAnimation={shouldDisableAnimation}\n onImageError={onImageError}\n />\n </Tooltip>\n <AnimatePresence initial={false}>\n {isExpandable && (isItemOpen || shouldRenderClosed) && (\n <ListItemBody\n id={uuid}\n key={`listItemBody-${uuid}`}\n shouldHideBody={shouldRenderClosed && !isItemOpen}\n >\n <AreaContextProvider>{children}</AreaContextProvider>\n </ListItemBody>\n )}\n </AnimatePresence>\n </StyledListItem>\n );\n },\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAcA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AAA2D,SAAAQ,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,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,C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3B4B,sBAAsB,EAAEA,sBAAuB;IAC/C3B,sBAAsB,EAAEA,sBAAuB;IAC/CH,YAAY,EAAEA;EAAa,CAC9B,CACI,CAAC,eACVhE,OAAA,CAAAc,OAAA,CAAAiG,aAAA,CAACjH,MAAA,CAAAoJ,eAAe;IAACzB,OAAO,EAAE;EAAM,GAC3BjC,YAAY,KAAKE,UAAU,IAAI/B,kBAAkB,CAAC,iBAC/C3D,OAAA,CAAAc,OAAA,CAAAiG,aAAA,CAACzG,aAAA,CAAAQ,OAAY;IACTqI,EAAE,EAAE7D,IAAK;IACToC,GAAG,EAAE,gBAAgBpC,IAAI,EAAG;IAC5B8D,cAAc,EAAEzF,kBAAkB,IAAI,CAAC+B;EAAW,gBAElD1F,OAAA,CAAAc,OAAA,CAAAiG,aAAA,CAAC3G,oBAAA,CAAAU,OAAmB,QAAEqB,QAA8B,CAC1C,CAEL,CACL,CAAC;AAEzB,CACJ,CAAC;AAEDJ,QAAQ,CAACsH,WAAW,GAAG,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzI,OAAA,GAEnBiB,QAAQ","ignoreList":[]}
|
|
@@ -22,10 +22,12 @@ const StyledListItem = exports.StyledListItem = _styledComponents.default.div`
|
|
|
22
22
|
$isOpen,
|
|
23
23
|
$shouldChangeColor,
|
|
24
24
|
$shouldForceBackground,
|
|
25
|
-
theme
|
|
26
|
-
|
|
25
|
+
theme,
|
|
26
|
+
$isInDialog,
|
|
27
|
+
$isSelected
|
|
28
|
+
}) => (!$isInAccordion && $isOpen || $shouldForceBackground || $isSelected) && (0, _styledComponents.css)`
|
|
27
29
|
background-color: rgba(
|
|
28
|
-
${$shouldChangeColor ? theme['102-rgb'] : theme['100-rgb']},
|
|
30
|
+
${$shouldChangeColor || $isInDialog ? theme['102-rgb'] : theme['100-rgb']},
|
|
29
31
|
${theme.cardBackgroundOpacity}
|
|
30
32
|
);
|
|
31
33
|
`}
|
|
@@ -43,11 +45,12 @@ const StyledListItem = exports.StyledListItem = _styledComponents.default.div`
|
|
|
43
45
|
$isClickable,
|
|
44
46
|
$isInAccordion,
|
|
45
47
|
$shouldChangeColor,
|
|
48
|
+
$isInDialog,
|
|
46
49
|
theme
|
|
47
50
|
}) => $isClickable && !$isInAccordion && (0, _styledComponents.css)`
|
|
48
51
|
&&:hover {
|
|
49
52
|
background-color: rgba(
|
|
50
|
-
${$shouldChangeColor ? theme['102-rgb'] : theme['100-rgb']},
|
|
53
|
+
${$shouldChangeColor || $isInDialog ? theme['102-rgb'] : theme['100-rgb']},
|
|
51
54
|
${theme.cardBackgroundOpacity}
|
|
52
55
|
);
|
|
53
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItem","exports","styled","div","$isInAccordion","$shouldHideIndicator","css","$isOpen","$shouldChangeColor","$shouldForceBackground","theme","cardBackgroundOpacity","$backgroundColor","$isClickable","$isWrapped","$shouldHideBottomLine","$shouldForceBottomLine","$shouldShowSeparatorBelow","accordionLines","undefined","StyledListItemTooltip"],"sources":["../../../../../src/components/list/list-item/ListItem.styles.ts"],"sourcesContent":["import type { HTMLMotionProps } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { Theme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport { CSSProperties } from 'react';\n\ntype StyledListItemProps = HTMLMotionProps<'div'> & {\n $backgroundColor?: CSSProperties['backgroundColor'];\n $isClickable: boolean;\n $isInAccordion: boolean;\n $isOpen: boolean;\n $isWrapped: boolean;\n $shouldChangeColor?: boolean;\n $shouldForceBackground?: boolean;\n $shouldForceBottomLine?: boolean;\n $shouldHideBottomLine: boolean;\n $shouldHideIndicator: boolean;\n $shouldShowSeparatorBelow: boolean;\n};\n\nexport const StyledListItem = styled.div<StyledListItemProps>`\n overflow: hidden;\n transition: background-color 0.3s ease;\n\n ${({ $isInAccordion, $shouldHideIndicator }: StyledListItemProps) =>\n $isInAccordion &&\n css`\n padding-left: ${$shouldHideIndicator ? '16px' : '8px'};\n `}\n\n ${({\n $isInAccordion,\n $isOpen,\n $shouldChangeColor,\n $shouldForceBackground,\n theme,\n }: StyledListItemProps & {\n theme: Theme;\n }) =>\n ((!$isInAccordion && $isOpen) || $shouldForceBackground) &&\n css`\n background-color: rgba(\n ${$shouldChangeColor ? theme['102-rgb'] : theme['100-rgb']},\n ${theme.cardBackgroundOpacity}\n );\n `}\n\n ${({ $backgroundColor, $isInAccordion, $isOpen, $shouldForceBackground }) =>\n $backgroundColor &&\n ((!$isInAccordion && $isOpen) || $shouldForceBackground) &&\n css`\n background-color: ${$backgroundColor} !important;\n `}\n\n ${({\n $isClickable,\n $isInAccordion,\n $shouldChangeColor,\n theme,\n }: StyledListItemProps & {\n theme: Theme;\n }) =>\n $isClickable &&\n !$isInAccordion &&\n css`\n &&:hover {\n background-color: rgba(\n ${$shouldChangeColor ? theme['102-rgb'] : theme['100-rgb']},\n ${theme.cardBackgroundOpacity}\n );\n }\n `}\n\n ${({\n $isInAccordion,\n $isOpen,\n $isWrapped,\n $shouldHideBottomLine,\n $shouldForceBottomLine,\n $shouldShowSeparatorBelow,\n theme,\n }: StyledListItemProps & { theme: Theme }) => {\n if (\n $shouldShowSeparatorBelow ||\n ((!$isOpen || $isWrapped || $isInAccordion) &&\n theme.accordionLines &&\n !$shouldHideBottomLine)\n ) {\n if ($shouldForceBottomLine) {\n return css`\n border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid\n rgba(${theme['headline-rgb']}, 1);\n `;\n }\n\n return css`\n &&:not(:last-child) {\n border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid\n rgba(${theme['headline-rgb']}, 1);\n }\n `;\n }\n\n return undefined;\n }}\n\n ${({ $isWrapped }) =>\n $isWrapped &&\n css`\n padding-left: 26px;\n `}\n`;\n\nexport const StyledListItemTooltip = styled.div`\n padding: 6px;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"ListItem.styles.js","names":["_styledComponents","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItem","exports","styled","div","$isInAccordion","$shouldHideIndicator","css","$isOpen","$shouldChangeColor","$shouldForceBackground","theme","$isInDialog","$isSelected","cardBackgroundOpacity","$backgroundColor","$isClickable","$isWrapped","$shouldHideBottomLine","$shouldForceBottomLine","$shouldShowSeparatorBelow","accordionLines","undefined","StyledListItemTooltip"],"sources":["../../../../../src/components/list/list-item/ListItem.styles.ts"],"sourcesContent":["import type { HTMLMotionProps } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { Theme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport { CSSProperties } from 'react';\n\ntype StyledListItemProps = HTMLMotionProps<'div'> & {\n $backgroundColor?: CSSProperties['backgroundColor'];\n $isClickable: boolean;\n $isInAccordion: boolean;\n $isOpen: boolean;\n $isWrapped: boolean;\n $shouldChangeColor?: boolean;\n $shouldForceBackground?: boolean;\n $shouldForceBottomLine?: boolean;\n $shouldHideBottomLine: boolean;\n $shouldHideIndicator: boolean;\n $shouldShowSeparatorBelow: boolean;\n $isInDialog: boolean;\n $isSelected: boolean;\n};\n\nexport const StyledListItem = styled.div<StyledListItemProps>`\n overflow: hidden;\n transition: background-color 0.3s ease;\n\n ${({ $isInAccordion, $shouldHideIndicator }: StyledListItemProps) =>\n $isInAccordion &&\n css`\n padding-left: ${$shouldHideIndicator ? '16px' : '8px'};\n `}\n\n ${({\n $isInAccordion,\n $isOpen,\n $shouldChangeColor,\n $shouldForceBackground,\n theme,\n $isInDialog,\n $isSelected,\n }: StyledListItemProps & {\n theme: Theme;\n }) =>\n ((!$isInAccordion && $isOpen) || $shouldForceBackground || $isSelected) &&\n css`\n background-color: rgba(\n ${$shouldChangeColor || $isInDialog ? theme['102-rgb'] : theme['100-rgb']},\n ${theme.cardBackgroundOpacity}\n );\n `}\n\n ${({ $backgroundColor, $isInAccordion, $isOpen, $shouldForceBackground }) =>\n $backgroundColor &&\n ((!$isInAccordion && $isOpen) || $shouldForceBackground) &&\n css`\n background-color: ${$backgroundColor} !important;\n `}\n\n ${({\n $isClickable,\n $isInAccordion,\n $shouldChangeColor,\n $isInDialog,\n theme,\n }: StyledListItemProps & {\n theme: Theme;\n }) =>\n $isClickable &&\n !$isInAccordion &&\n css`\n &&:hover {\n background-color: rgba(\n ${$shouldChangeColor || $isInDialog ? theme['102-rgb'] : theme['100-rgb']},\n ${theme.cardBackgroundOpacity}\n );\n }\n `}\n\n ${({\n $isInAccordion,\n $isOpen,\n $isWrapped,\n $shouldHideBottomLine,\n $shouldForceBottomLine,\n $shouldShowSeparatorBelow,\n theme,\n }: StyledListItemProps & { theme: Theme }) => {\n if (\n $shouldShowSeparatorBelow ||\n ((!$isOpen || $isWrapped || $isInAccordion) &&\n theme.accordionLines &&\n !$shouldHideBottomLine)\n ) {\n if ($shouldForceBottomLine) {\n return css`\n border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid\n rgba(${theme['headline-rgb']}, 1);\n `;\n }\n\n return css`\n &&:not(:last-child) {\n border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid\n rgba(${theme['headline-rgb']}, 1);\n }\n `;\n }\n\n return undefined;\n }}\n\n ${({ $isWrapped }) =>\n $isWrapped &&\n css`\n padding-left: 26px;\n `}\n`;\n\nexport const StyledListItemTooltip = styled.div`\n padding: 6px;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAA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C","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMasonryContext = exports.MasonryContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const MasonryContext = exports.MasonryContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
9
|
+
const useMasonryContext = () => {
|
|
10
|
+
const context = (0, _react.useContext)(MasonryContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('Masonry.Item must be used inside Masonry.');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
exports.useMasonryContext = useMasonryContext;
|
|
17
|
+
//# sourceMappingURL=Masonry.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Masonry.context.js","names":["_react","require","MasonryContext","exports","createContext","undefined","useMasonryContext","context","useContext","Error"],"sources":["../../../../src/components/masonry/Masonry.context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport { MasonryContextValue } from './Masonry.types';\n\nexport const MasonryContext = createContext<MasonryContextValue | undefined>(undefined);\n\nexport const useMasonryContext = () => {\n const context = useContext(MasonryContext);\n\n if (!context) {\n throw new Error('Masonry.Item must be used inside Masonry.');\n }\n\n return context;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,oBAAa,EAAkCC,SAAS,CAAC;AAEhF,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACnC,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACN,cAAc,CAAC;EAE1C,IAAI,CAACK,OAAO,EAAE;IACV,MAAM,IAAIE,KAAK,CAAC,2CAA2C,CAAC;EAChE;EAEA,OAAOF,OAAO;AAClB,CAAC;AAACJ,OAAA,CAAAG,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMasonryLayout = exports.useMasonryItems = exports.useMasonryColumnCount = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _Masonry = require("./Masonry.utils");
|
|
9
|
+
const useMasonryItems = ({
|
|
10
|
+
children
|
|
11
|
+
}) => (0, _react.useMemo)(() => _react.Children.toArray(children), [children]);
|
|
12
|
+
exports.useMasonryItems = useMasonryItems;
|
|
13
|
+
const useMasonryLayout = ({
|
|
14
|
+
items,
|
|
15
|
+
itemHeights,
|
|
16
|
+
columnCount,
|
|
17
|
+
columnWidth,
|
|
18
|
+
rowHeight,
|
|
19
|
+
gap
|
|
20
|
+
}) => (0, _react.useMemo)(() => {
|
|
21
|
+
const layoutItems = items.map((item, index) => {
|
|
22
|
+
const key = (0, _Masonry.getMasonryItemKey)(item, index);
|
|
23
|
+
const height = itemHeights[key] ?? rowHeight;
|
|
24
|
+
return {
|
|
25
|
+
key,
|
|
26
|
+
columns: item.props.columns ?? 1,
|
|
27
|
+
rows: (0, _Masonry.calculateRowSpan)({
|
|
28
|
+
height,
|
|
29
|
+
rowHeight,
|
|
30
|
+
gap
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
return (0, _Masonry.packMasonryGrid)({
|
|
35
|
+
items: layoutItems,
|
|
36
|
+
columnCount,
|
|
37
|
+
columnWidth,
|
|
38
|
+
rowHeight,
|
|
39
|
+
gap
|
|
40
|
+
});
|
|
41
|
+
}, [items, itemHeights, columnCount, columnWidth, rowHeight, gap]);
|
|
42
|
+
exports.useMasonryLayout = useMasonryLayout;
|
|
43
|
+
const useMasonryColumnCount = ({
|
|
44
|
+
containerWidth,
|
|
45
|
+
columnWidth,
|
|
46
|
+
gap
|
|
47
|
+
}) => (0, _react.useMemo)(() => (0, _Masonry.calculateColumnCount)({
|
|
48
|
+
containerWidth,
|
|
49
|
+
columnWidth,
|
|
50
|
+
gap
|
|
51
|
+
}), [containerWidth, columnWidth, gap]);
|
|
52
|
+
exports.useMasonryColumnCount = useMasonryColumnCount;
|
|
53
|
+
//# sourceMappingURL=Masonry.hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Masonry.hooks.js","names":["_react","require","_Masonry","useMasonryItems","children","useMemo","Children","toArray","exports","useMasonryLayout","items","itemHeights","columnCount","columnWidth","rowHeight","gap","layoutItems","map","item","index","key","getMasonryItemKey","height","columns","props","rows","calculateRowSpan","packMasonryGrid","useMasonryColumnCount","containerWidth","calculateColumnCount"],"sources":["../../../../src/components/masonry/Masonry.hooks.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react';\nimport { MasonryChild, MasonryItemProps, MasonryLayoutItem } from './Masonry.types';\nimport {\n calculateColumnCount,\n calculateRowSpan,\n getMasonryItemKey,\n packMasonryGrid,\n} from './Masonry.utils';\n\ninterface UseMasonryItemsParams {\n children: ReactNode;\n}\n\nexport const useMasonryItems = ({ children }: UseMasonryItemsParams) =>\n useMemo(() => Children.toArray(children) as MasonryChild[], [children]);\n\ninterface UseMasonryLayoutParams {\n items: MasonryChild[];\n itemHeights: Record<string, number>;\n columnCount: number;\n columnWidth: number;\n rowHeight: number;\n gap: number;\n}\n\nexport const useMasonryLayout = ({\n items,\n itemHeights,\n columnCount,\n columnWidth,\n rowHeight,\n gap,\n}: UseMasonryLayoutParams) =>\n useMemo(() => {\n const layoutItems: MasonryLayoutItem[] = items.map((item, index) => {\n const key = getMasonryItemKey(item as React.ReactElement<MasonryItemProps>, index);\n\n const height = itemHeights[key] ?? rowHeight;\n\n return {\n key,\n columns: item.props.columns ?? 1,\n rows: calculateRowSpan({\n height,\n rowHeight,\n gap,\n }),\n };\n });\n\n return packMasonryGrid({\n items: layoutItems,\n columnCount,\n columnWidth,\n rowHeight,\n gap,\n });\n }, [items, itemHeights, columnCount, columnWidth, rowHeight, gap]);\n\ninterface UseMasonryColumnCountParams {\n containerWidth: number;\n columnWidth: number;\n gap: number;\n}\n\nexport const useMasonryColumnCount = ({\n containerWidth,\n columnWidth,\n gap,\n}: UseMasonryColumnCountParams) =>\n useMemo(\n () =>\n calculateColumnCount({\n containerWidth,\n columnWidth,\n gap,\n }),\n [containerWidth, columnWidth, gap],\n );\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAWO,MAAME,eAAe,GAAGA,CAAC;EAAEC;AAAgC,CAAC,KAC/D,IAAAC,cAAO,EAAC,MAAMC,eAAQ,CAACC,OAAO,CAACH,QAAQ,CAAmB,EAAE,CAACA,QAAQ,CAAC,CAAC;AAACI,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAWrE,MAAMM,gBAAgB,GAAGA,CAAC;EAC7BC,KAAK;EACLC,WAAW;EACXC,WAAW;EACXC,WAAW;EACXC,SAAS;EACTC;AACoB,CAAC,KACrB,IAAAV,cAAO,EAAC,MAAM;EACV,MAAMW,WAAgC,GAAGN,KAAK,CAACO,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IAChE,MAAMC,GAAG,GAAG,IAAAC,0BAAiB,EAACH,IAAI,EAA0CC,KAAK,CAAC;IAElF,MAAMG,MAAM,GAAGX,WAAW,CAACS,GAAG,CAAC,IAAIN,SAAS;IAE5C,OAAO;MACHM,GAAG;MACHG,OAAO,EAAEL,IAAI,CAACM,KAAK,CAACD,OAAO,IAAI,CAAC;MAChCE,IAAI,EAAE,IAAAC,yBAAgB,EAAC;QACnBJ,MAAM;QACNR,SAAS;QACTC;MACJ,CAAC;IACL,CAAC;EACL,CAAC,CAAC;EAEF,OAAO,IAAAY,wBAAe,EAAC;IACnBjB,KAAK,EAAEM,WAAW;IAClBJ,WAAW;IACXC,WAAW;IACXC,SAAS;IACTC;EACJ,CAAC,CAAC;AACN,CAAC,EAAE,CAACL,KAAK,EAAEC,WAAW,EAAEC,WAAW,EAAEC,WAAW,EAAEC,SAAS,EAAEC,GAAG,CAAC,CAAC;AAACP,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAQhE,MAAMmB,qBAAqB,GAAGA,CAAC;EAClCC,cAAc;EACdhB,WAAW;EACXE;AACyB,CAAC,KAC1B,IAAAV,cAAO,EACH,MACI,IAAAyB,6BAAoB,EAAC;EACjBD,cAAc;EACdhB,WAAW;EACXE;AACJ,CAAC,CAAC,EACN,CAACc,cAAc,EAAEhB,WAAW,EAAEE,GAAG,CACrC,CAAC;AAACP,OAAA,CAAAoB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _react2 = require("motion/react");
|
|
9
|
+
var _element = require("../../hooks/element");
|
|
10
|
+
var _Masonry = require("./Masonry.context");
|
|
11
|
+
var _Masonry2 = require("./Masonry.styles");
|
|
12
|
+
var _Masonry3 = require("./Masonry.hooks");
|
|
13
|
+
var _Masonry4 = require("./Masonry.utils");
|
|
14
|
+
var _MasonryItem = _interopRequireWildcard(require("./masonry-item/MasonryItem"));
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const MasonryBase = ({
|
|
17
|
+
children,
|
|
18
|
+
gap = 8,
|
|
19
|
+
columnWidth = 80,
|
|
20
|
+
rowHeight = 80
|
|
21
|
+
}) => {
|
|
22
|
+
const ref = (0, _react.useRef)(null);
|
|
23
|
+
const size = (0, _element.useElementSize)(ref);
|
|
24
|
+
const containerWidth = (size === null || size === void 0 ? void 0 : size.width) ?? 0;
|
|
25
|
+
const [itemHeights, setItemHeights] = (0, _react.useState)({});
|
|
26
|
+
const items = (0, _Masonry3.useMasonryItems)({
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
const columnCount = (0, _Masonry3.useMasonryColumnCount)({
|
|
30
|
+
containerWidth,
|
|
31
|
+
columnWidth,
|
|
32
|
+
gap
|
|
33
|
+
});
|
|
34
|
+
const layout = (0, _Masonry3.useMasonryLayout)({
|
|
35
|
+
items,
|
|
36
|
+
itemHeights,
|
|
37
|
+
columnCount,
|
|
38
|
+
columnWidth,
|
|
39
|
+
rowHeight,
|
|
40
|
+
gap
|
|
41
|
+
});
|
|
42
|
+
const registerItem = (0, _react.useCallback)((key, height) => {
|
|
43
|
+
setItemHeights(currentHeights => {
|
|
44
|
+
if (currentHeights[key] === height) {
|
|
45
|
+
return currentHeights;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...currentHeights,
|
|
49
|
+
[key]: height
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}, []);
|
|
53
|
+
const contextValue = (0, _react.useMemo)(() => ({
|
|
54
|
+
registerItem
|
|
55
|
+
}), [registerItem]);
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_Masonry.MasonryContext.Provider, {
|
|
57
|
+
value: contextValue
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_Masonry2.StyledMasonry, {
|
|
59
|
+
ref: ref,
|
|
60
|
+
$height: layout.height
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_react2.AnimatePresence, null, items.map((item, index) => {
|
|
62
|
+
const key = (0, _Masonry4.getMasonryItemKey)(item, index);
|
|
63
|
+
const packedItem = layout.items[key];
|
|
64
|
+
if (!packedItem) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_MasonryItem.InternalMasonryItem, {
|
|
68
|
+
key: key,
|
|
69
|
+
itemKey: key,
|
|
70
|
+
x: packedItem.x,
|
|
71
|
+
y: packedItem.y,
|
|
72
|
+
width: packedItem.width
|
|
73
|
+
}, item.props.children);
|
|
74
|
+
}))));
|
|
75
|
+
};
|
|
76
|
+
MasonryBase.displayName = 'Masonry';
|
|
77
|
+
const Masonry = Object.assign(MasonryBase, {
|
|
78
|
+
Item: _MasonryItem.default
|
|
79
|
+
});
|
|
80
|
+
var _default = exports.default = Masonry;
|
|
81
|
+
//# sourceMappingURL=Masonry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Masonry.js","names":["_react","_interopRequireWildcard","require","_react2","_element","_Masonry","_Masonry2","_Masonry3","_Masonry4","_MasonryItem","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","MasonryBase","children","gap","columnWidth","rowHeight","ref","useRef","size","useElementSize","containerWidth","width","itemHeights","setItemHeights","useState","items","useMasonryItems","columnCount","useMasonryColumnCount","layout","useMasonryLayout","registerItem","useCallback","key","height","currentHeights","contextValue","useMemo","createElement","MasonryContext","Provider","value","StyledMasonry","$height","AnimatePresence","map","item","index","getMasonryItemKey","packedItem","InternalMasonryItem","itemKey","x","y","props","displayName","Masonry","assign","Item","MasonryItem","_default","exports"],"sources":["../../../../src/components/masonry/Masonry.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useRef, useState } from 'react';\nimport { AnimatePresence } from 'motion/react';\nimport { useElementSize } from '../../hooks/element';\nimport { MasonryComponent, MasonryItemProps, MasonryProps } from './Masonry.types';\nimport { MasonryContext } from './Masonry.context';\nimport { StyledMasonry } from './Masonry.styles';\nimport { useMasonryColumnCount, useMasonryItems, useMasonryLayout } from './Masonry.hooks';\nimport { getMasonryItemKey } from './Masonry.utils';\nimport MasonryItem, { InternalMasonryItem } from './masonry-item/MasonryItem';\n\nconst MasonryBase: FC<MasonryProps> = ({ children, gap = 8, columnWidth = 80, rowHeight = 80 }) => {\n const ref = useRef<HTMLDivElement | null>(null);\n const size = useElementSize(ref);\n\n const containerWidth = size?.width ?? 0;\n\n const [itemHeights, setItemHeights] = useState<Record<string, number>>({});\n\n const items = useMasonryItems({ children });\n\n const columnCount = useMasonryColumnCount({\n containerWidth,\n columnWidth,\n gap,\n });\n\n const layout = useMasonryLayout({\n items,\n itemHeights,\n columnCount,\n columnWidth,\n rowHeight,\n gap,\n });\n\n const registerItem = useCallback((key: string, height: number) => {\n setItemHeights((currentHeights) => {\n if (currentHeights[key] === height) {\n return currentHeights;\n }\n\n return {\n ...currentHeights,\n [key]: height,\n };\n });\n }, []);\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n );\n\n return (\n <MasonryContext.Provider value={contextValue}>\n <StyledMasonry ref={ref} $height={layout.height}>\n <AnimatePresence>\n {items.map((item, index) => {\n const key = getMasonryItemKey(\n item as React.ReactElement<MasonryItemProps>,\n index,\n );\n\n const packedItem = layout.items[key];\n\n if (!packedItem) {\n return null;\n }\n\n return (\n <InternalMasonryItem\n key={key}\n itemKey={key}\n x={packedItem.x}\n y={packedItem.y}\n width={packedItem.width}\n >\n {item.props.children}\n </InternalMasonryItem>\n );\n })}\n </AnimatePresence>\n </StyledMasonry>\n </MasonryContext.Provider>\n );\n};\n\nMasonryBase.displayName = 'Masonry';\n\nconst Masonry = Object.assign(MasonryBase, {\n Item: MasonryItem,\n}) as MasonryComponent;\n\nexport default Masonry;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAC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A,CAAAoB,OAAA,CAAAoC,aAAA,CAAClD,SAAA,CAAAsD,aAAa;IAAC1B,GAAG,EAAEA,GAAI;IAAC2B,OAAO,EAAEd,MAAM,CAACK;EAAO,gBAC5CpD,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACrD,OAAA,CAAA2D,eAAe,QACXnB,KAAK,CAACoB,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IACxB,MAAMd,GAAG,GAAG,IAAAe,2BAAiB,EACzBF,IAAI,EACJC,KACJ,CAAC;IAED,MAAME,UAAU,GAAGpB,MAAM,CAACJ,KAAK,CAACQ,GAAG,CAAC;IAEpC,IAAI,CAACgB,UAAU,EAAE;MACb,OAAO,IAAI;IACf;IAEA,oBACInE,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAAC/C,YAAA,CAAA2D,mBAAmB;MAChBjB,GAAG,EAAEA,GAAI;MACTkB,OAAO,EAAElB,GAAI;MACbmB,CAAC,EAAEH,UAAU,CAACG,CAAE;MAChBC,CAAC,EAAEJ,UAAU,CAACI,CAAE;MAChBhC,KAAK,EAAE4B,UAAU,CAAC5B;IAAM,GAEvByB,IAAI,CAACQ,KAAK,CAAC1C,QACK,CAAC;EAE9B,CAAC,CACY,CACN,CACM,CAAC;AAElC,CAAC;AAEDD,WAAW,CAAC4C,WAAW,GAAG,SAAS;AAEnC,MAAMC,OAAO,GAAGhD,MAAM,CAACiD,MAAM,CAAC9C,WAAW,EAAE;EACvC+C,IAAI,EAAEC;AACV,CAAC,CAAqB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAERsD,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMasonry = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const StyledMasonry = exports.StyledMasonry = _styledComponents.default.div`
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: ${({
|
|
13
|
+
$height
|
|
14
|
+
}) => $height}px;
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=Masonry.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Masonry.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledMasonry","exports","styled","div","$height"],"sources":["../../../../src/components/masonry/Masonry.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledMasonry = styled.div<{ $height: number }>`\n position: relative;\n width: 100%;\n height: ${({ $height }) => $height}px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAwB;AAC5D;AACA;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Masonry.types.js","names":[],"sources":["../../../../src/components/masonry/Masonry.types.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\n\nexport interface MasonryProps {\n children: ReactNode;\n gap?: number;\n columnWidth?: number;\n rowHeight?: number;\n}\n\nexport interface MasonryItemProps {\n children: ReactNode;\n columns?: number;\n}\n\nexport interface MasonryContextValue {\n registerItem: (key: string, height: number) => void;\n}\n\nexport interface MasonryLayoutItem {\n key: string;\n columns: number;\n rows: number;\n}\n\nexport interface PackedMasonryItem {\n key: string;\n x: number;\n y: number;\n width: number;\n}\n\nexport interface PackedMasonryGrid {\n items: Record<string, PackedMasonryItem>;\n height: number;\n}\n\nexport interface InternalMasonryItemProps {\n children: ReactNode;\n itemKey: string;\n x: number;\n y: number;\n width: number;\n}\n\nexport type MasonryChild = ReactElement<MasonryItemProps>;\n\nexport type MasonryComponent = React.FC<MasonryProps> & {\n Item: React.FC<MasonryItemProps>;\n};\n"],"mappings":"","ignoreList":[]}
|