@chayns-components/core 5.0.0-beta.566 → 5.0.0-beta.569

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.
@@ -11,7 +11,10 @@ const ListItemBody = _ref => {
11
11
  if (containerRef.current) {
12
12
  const resizeObserver = new ResizeObserver(entries => {
13
13
  if (entries && entries[0]) {
14
- const observedHeight = entries[0].contentRect.height;
14
+ const observedHeight = entries[0].contentBoxSize[0]?.blockSize;
15
+ if (!observedHeight) {
16
+ return;
17
+ }
15
18
  setHeight(observedHeight);
16
19
  }
17
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemBody.js","names":["React","useEffect","useRef","useState","StyledMotionListItemBody","ListItemBody","_ref","children","id","containerRef","height","setHeight","current","resizeObserver","ResizeObserver","entries","observedHeight","contentRect","observe","disconnect","createElement","key","animate","opacity","className","exit","initial","transition","type","ref","displayName"],"sources":["../../../../../src/components/list/list-item/list-item-body/ListItemBody.tsx"],"sourcesContent":["import React, { FC, ReactNode, useEffect, useRef, useState } from 'react';\nimport { StyledMotionListItemBody } from './ListItemBody.styles';\n\ninterface ListItemBodyProps {\n children?: ReactNode;\n id: string;\n}\n\nconst ListItemBody: FC<ListItemBodyProps> = ({ children, id }) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number | 'auto'>('auto');\n\n useEffect(() => {\n if (containerRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentRect.height;\n setHeight(observedHeight);\n }\n });\n\n resizeObserver.observe(containerRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledMotionListItemBody\n key={id}\n animate={{ height, opacity: 1 }}\n className=\"beta-chayns-list-item-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n transition={{ type: 'tween' }}\n >\n <div ref={containerRef}>{children}</div>\n </StyledMotion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;IACnCI,UAAU,EAAE;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9B5B,KAAA,CAAAoB,aAAA;IAAKS,GAAG,EAAEpB;EAAa,GAAEF,QAAc,CACjB,CAAC;AAEnC,CAAC;AAEDF,YAAY,CAACyB,WAAW,GAAG,cAAc;AAEzC,eAAezB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"ListItemBody.js","names":["React","useEffect","useRef","useState","StyledMotionListItemBody","ListItemBody","_ref","children","id","containerRef","height","setHeight","current","resizeObserver","ResizeObserver","entries","observedHeight","contentBoxSize","blockSize","observe","disconnect","createElement","key","animate","opacity","className","exit","initial","transition","type","ref","displayName"],"sources":["../../../../../src/components/list/list-item/list-item-body/ListItemBody.tsx"],"sourcesContent":["import React, { FC, ReactNode, useEffect, useRef, useState } from 'react';\nimport { StyledMotionListItemBody } from './ListItemBody.styles';\n\ninterface ListItemBodyProps {\n children?: ReactNode;\n id: string;\n}\n\nconst ListItemBody: FC<ListItemBodyProps> = ({ children, id }) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number | 'auto'>('auto');\n\n useEffect(() => {\n if (containerRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0]) {\n const observedHeight = entries[0].contentBoxSize[0]?.blockSize;\n\n if (!observedHeight) {\n return;\n }\n\n setHeight(observedHeight);\n }\n });\n\n resizeObserver.observe(containerRef.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledMotionListItemBody\n key={id}\n animate={{ height, opacity: 1 }}\n className=\"beta-chayns-list-item-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n transition={{ type: 'tween' }}\n >\n <div ref={containerRef}>{children}</div>\n </StyledMotionListItemBody>\n );\n};\n\nListItemBody.displayName = 'ListItemBody';\n\nexport default ListItemBody;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAmBC,SAAS,EAAEC,MA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E,gBAE9B7B,KAAA,CAAAqB,aAAA;IAAKS,GAAG,EAAErB;EAAa,GAAEF,QAAc,CACjB,CAAC;AAEnC,CAAC;AAEDF,YAAY,CAAC0B,WAAW,GAAG,cAAc;AAEzC,eAAe1B,YAAY","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.566",
3
+ "version": "5.0.0-beta.569",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -45,8 +45,8 @@
45
45
  "@babel/preset-env": "^7.24.4",
46
46
  "@babel/preset-react": "^7.24.1",
47
47
  "@babel/preset-typescript": "^7.24.1",
48
- "@types/react": "^18.2.75",
49
- "@types/react-dom": "^18.2.24",
48
+ "@types/react": "^18.2.79",
49
+ "@types/react-dom": "^18.2.25",
50
50
  "@types/styled-components": "^5.1.34",
51
51
  "@types/uuid": "^9.0.8",
52
52
  "babel-loader": "^9.1.3",
@@ -54,7 +54,7 @@
54
54
  "react": "^18.2.0",
55
55
  "react-dom": "^18.2.0",
56
56
  "styled-components": "^6.1.8",
57
- "typescript": "^5.4.4"
57
+ "typescript": "^5.4.5"
58
58
  },
59
59
  "dependencies": {
60
60
  "@chayns/colors": "^2.0.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "91303a4d62f74817fd4cba29e72c0dfe02f05925"
76
+ "gitHead": "afcc4ca1bd7c44a8831725e453db9fa9579cb6a3"
77
77
  }