@chayns-components/core 5.4.19 → 5.4.20
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/expandable-content/ExpandableContent.js +30 -12
- package/lib/cjs/components/expandable-content/ExpandableContent.js.map +1 -1
- package/lib/cjs/components/expandable-content/ExpandableContent.styles.js +1 -3
- package/lib/cjs/components/expandable-content/ExpandableContent.styles.js.map +1 -1
- package/lib/esm/components/expandable-content/ExpandableContent.js +30 -12
- package/lib/esm/components/expandable-content/ExpandableContent.js.map +1 -1
- package/lib/esm/components/expandable-content/ExpandableContent.styles.js +1 -3
- package/lib/esm/components/expandable-content/ExpandableContent.styles.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,18 +12,36 @@ const ExpandableContent = ({
|
|
|
12
12
|
children,
|
|
13
13
|
isOpen,
|
|
14
14
|
startDelay
|
|
15
|
-
}) => (0, _react2.useMemo)(() =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
}) => (0, _react2.useMemo)(() => {
|
|
16
|
+
const variants = {
|
|
17
|
+
open: {
|
|
18
|
+
height: 'auto',
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
transition: {
|
|
21
|
+
duration: 0.2,
|
|
22
|
+
type: 'tween',
|
|
23
|
+
delay: startDelay
|
|
24
|
+
},
|
|
25
|
+
transitionEnd: {
|
|
26
|
+
overflow: 'visible'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
closed: {
|
|
30
|
+
height: '0px',
|
|
31
|
+
overflow: 'hidden',
|
|
32
|
+
transition: {
|
|
33
|
+
duration: 0.2,
|
|
34
|
+
type: 'tween'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/_react2.default.createElement(_react.AnimatePresence, {
|
|
39
|
+
initial: false
|
|
40
|
+
}, /*#__PURE__*/_react2.default.createElement(_ExpandableContent.StyledMotionExpandableContent, {
|
|
41
|
+
animate: isOpen ? 'open' : 'closed',
|
|
42
|
+
variants: variants
|
|
43
|
+
}, children));
|
|
44
|
+
}, [children, isOpen, startDelay]);
|
|
27
45
|
ExpandableContent.displayName = 'ExpandableContent';
|
|
28
46
|
var _default = exports.default = ExpandableContent;
|
|
29
47
|
//# sourceMappingURL=ExpandableContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableContent.js","names":["_react","require","_react2","_interopRequireWildcard","_ExpandableContent","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExpandableContent","children","isOpen","startDelay","useMemo","
|
|
1
|
+
{"version":3,"file":"ExpandableContent.js","names":["_react","require","_react2","_interopRequireWildcard","_ExpandableContent","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExpandableContent","children","isOpen","startDelay","useMemo","variants","open","height","overflow","transition","duration","type","delay","transitionEnd","closed","createElement","AnimatePresence","initial","StyledMotionExpandableContent","animate","displayName","_default","exports"],"sources":["../../../../src/components/expandable-content/ExpandableContent.tsx"],"sourcesContent":["import { AnimatePresence, Variants } from 'motion/react';\nimport React, { FC, ReactNode, useMemo } from 'react';\nimport { StyledMotionExpandableContent } from './ExpandableContent.styles';\n\nexport type ExpandableContentProps = {\n /**\n * The children that should be animated.\n */\n children: ReactNode;\n /**\n * An optional start delay.\n */\n startDelay?: number;\n /**\n * Whether the content is expanded.\n */\n isOpen: boolean;\n};\n\nconst ExpandableContent: FC<ExpandableContentProps> = ({ children, isOpen, startDelay }) =>\n useMemo(() => {\n const variants: Variants = {\n open: {\n height: 'auto',\n overflow: 'hidden',\n transition: { duration: 0.2, type: 'tween', delay: startDelay },\n transitionEnd: { overflow: 'visible' },\n },\n closed: {\n height: '0px',\n overflow: 'hidden',\n transition: { duration: 0.2, type: 'tween' },\n },\n };\n\n return (\n <AnimatePresence initial={false}>\n <StyledMotionExpandableContent\n animate={isOpen ? 'open' : 'closed'}\n variants={variants}\n >\n {children}\n </StyledMotionExpandableContent>\n </AnimatePresence>\n );\n }, [children, isOpen, startDelay]);\n\nExpandableContent.displayName = 'ExpandableContent';\n\nexport default ExpandableContent;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA2E,SAAAE,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,CA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ponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const StyledMotionExpandableContent = exports.StyledMotionExpandableContent = (0, _styledComponents.default)(_react.motion.div)
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
`;
|
|
10
|
+
const StyledMotionExpandableContent = exports.StyledMotionExpandableContent = (0, _styledComponents.default)(_react.motion.div)``;
|
|
13
11
|
//# sourceMappingURL=ExpandableContent.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableContent.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledMotionExpandableContent","exports","styled","motion","div"],"sources":["../../../../src/components/expandable-content/ExpandableContent.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\n\nexport const StyledMotionExpandableContent = styled(motion.div)
|
|
1
|
+
{"version":3,"file":"ExpandableContent.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledMotionExpandableContent","exports","styled","motion","div"],"sources":["../../../../src/components/expandable-content/ExpandableContent.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\n\nexport const StyledMotionExpandableContent = styled(motion.div)``;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,6BAA6B,GAAAC,OAAA,CAAAD,6BAAA,GAAG,IAAAE,yBAAM,EAACC,aAAM,CAACC,GAAG,CAAC,EAAE","ignoreList":[]}
|
|
@@ -5,18 +5,36 @@ const ExpandableContent = ({
|
|
|
5
5
|
children,
|
|
6
6
|
isOpen,
|
|
7
7
|
startDelay
|
|
8
|
-
}) => useMemo(() =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
}) => useMemo(() => {
|
|
9
|
+
const variants = {
|
|
10
|
+
open: {
|
|
11
|
+
height: 'auto',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
transition: {
|
|
14
|
+
duration: 0.2,
|
|
15
|
+
type: 'tween',
|
|
16
|
+
delay: startDelay
|
|
17
|
+
},
|
|
18
|
+
transitionEnd: {
|
|
19
|
+
overflow: 'visible'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
closed: {
|
|
23
|
+
height: '0px',
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
transition: {
|
|
26
|
+
duration: 0.2,
|
|
27
|
+
type: 'tween'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/React.createElement(AnimatePresence, {
|
|
32
|
+
initial: false
|
|
33
|
+
}, /*#__PURE__*/React.createElement(StyledMotionExpandableContent, {
|
|
34
|
+
animate: isOpen ? 'open' : 'closed',
|
|
35
|
+
variants: variants
|
|
36
|
+
}, children));
|
|
37
|
+
}, [children, isOpen, startDelay]);
|
|
20
38
|
ExpandableContent.displayName = 'ExpandableContent';
|
|
21
39
|
export default ExpandableContent;
|
|
22
40
|
//# sourceMappingURL=ExpandableContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableContent.js","names":["AnimatePresence","React","useMemo","StyledMotionExpandableContent","ExpandableContent","children","isOpen","startDelay","
|
|
1
|
+
{"version":3,"file":"ExpandableContent.js","names":["AnimatePresence","React","useMemo","StyledMotionExpandableContent","ExpandableContent","children","isOpen","startDelay","variants","open","height","overflow","transition","duration","type","delay","transitionEnd","closed","createElement","initial","animate","displayName"],"sources":["../../../../src/components/expandable-content/ExpandableContent.tsx"],"sourcesContent":["import { AnimatePresence, Variants } from 'motion/react';\nimport React, { FC, ReactNode, useMemo } from 'react';\nimport { StyledMotionExpandableContent } from './ExpandableContent.styles';\n\nexport type ExpandableContentProps = {\n /**\n * The children that should be animated.\n */\n children: ReactNode;\n /**\n * An optional start delay.\n */\n startDelay?: number;\n /**\n * Whether the content is expanded.\n */\n isOpen: boolean;\n};\n\nconst ExpandableContent: FC<ExpandableContentProps> = ({ children, isOpen, startDelay }) =>\n useMemo(() => {\n const variants: Variants = {\n open: {\n height: 'auto',\n overflow: 'hidden',\n transition: { duration: 0.2, type: 'tween', delay: startDelay },\n transitionEnd: { overflow: 'visible' },\n },\n closed: {\n height: '0px',\n overflow: 'hidden',\n transition: { duration: 0.2, type: 'tween' },\n },\n };\n\n return (\n <AnimatePresence initial={false}>\n <StyledMotionExpandableContent\n animate={isOpen ? 'open' : 'closed'}\n variants={variants}\n >\n {children}\n </StyledMotionExpandableContent>\n </AnimatePresence>\n );\n }, [children, isOpen, startDelay]);\n\nExpandableContent.displayName = 'ExpandableContent';\n\nexport default ExpandableContent;\n"],"mappings":"AAAA,SAASA,eAAe,QAAkB,cAAc;AACxD,OAAOC,KAAK,IAAmBC,OAAO,QAAQ,OAAO;AACrD,SAASC,6BAA6B,QAAQ,4BAA4B;AAiB1E,MAAMC,iBAA6C,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAW,CAAC,KACnFL,OAAO,CAAC,MAAM;EACV,MAAMM,QAAkB,GAAG;IACvBC,IAAI,EAAE;MACFC,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE,QAAQ;MAClBC,UAAU,EAAE;QAAEC,QAAQ,EAAE,GAAG;QAAEC,IAAI,EAAE,OAAO;QAAEC,KAAK,EAAER;MAAW,CAAC;MAC/DS,aAAa,EAAE;QAAEL,QAAQ,EAAE;MAAU;IACzC,CAAC;IACDM,MAAM,EAAE;MACJP,MAAM,EAAE,KAAK;MACbC,QAAQ,EAAE,QAAQ;MAClBC,UAAU,EAAE;QAAEC,QAAQ,EAAE,GAAG;QAAEC,IAAI,EAAE;MAAQ;IAC/C;EACJ,CAAC;EAED,oBACIb,KAAA,CAAAiB,aAAA,CAAClB,eAAe;IAACmB,OAAO,EAAE;EAAM,gBAC5BlB,KAAA,CAAAiB,aAAA,CAACf,6BAA6B;IAC1BiB,OAAO,EAAEd,MAAM,GAAG,MAAM,GAAG,QAAS;IACpCE,QAAQ,EAAEA;EAAS,GAElBH,QAC0B,CAClB,CAAC;AAE1B,CAAC,EAAE,CAACA,QAAQ,EAAEC,MAAM,EAAEC,UAAU,CAAC,CAAC;AAEtCH,iBAAiB,CAACiB,WAAW,GAAG,mBAAmB;AAEnD,eAAejB,iBAAiB","ignoreList":[]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { motion } from 'motion/react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
export const StyledMotionExpandableContent = styled(motion.div)
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
`;
|
|
3
|
+
export const StyledMotionExpandableContent = styled(motion.div)``;
|
|
6
4
|
//# sourceMappingURL=ExpandableContent.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableContent.styles.js","names":["motion","styled","StyledMotionExpandableContent","div"],"sources":["../../../../src/components/expandable-content/ExpandableContent.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\n\nexport const StyledMotionExpandableContent = styled(motion.div)
|
|
1
|
+
{"version":3,"file":"ExpandableContent.styles.js","names":["motion","styled","StyledMotionExpandableContent","div"],"sources":["../../../../src/components/expandable-content/ExpandableContent.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\n\nexport const StyledMotionExpandableContent = styled(motion.div)``;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,6BAA6B,GAAGD,MAAM,CAACD,MAAM,CAACG,GAAG,CAAC,EAAE","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.20",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "1a89639ade84375f9ad76b81c4adcd81dfddeefd"
|
|
92
92
|
}
|