@chayns-components/core 5.0.0-beta.44 → 5.0.0-beta.45
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/components/accordion/accordion-body/AccordionBody.d.ts +7 -1
- package/lib/components/accordion/accordion-body/AccordionBody.js +4 -2
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +13 -2
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +3 -0
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
declare
|
|
2
|
+
export declare type AccordionBodyProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Maximum height of the element. This automatically makes the content of the element scrollable.
|
|
5
|
+
*/
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
};
|
|
8
|
+
declare const AccordionBody: FC<AccordionBodyProps>;
|
|
3
9
|
export default AccordionBody;
|
|
@@ -10,7 +10,8 @@ var _AccordionBody = require("./AccordionBody.styles");
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const AccordionBody = _ref => {
|
|
12
12
|
let {
|
|
13
|
-
children
|
|
13
|
+
children,
|
|
14
|
+
maxHeight
|
|
14
15
|
} = _ref;
|
|
15
16
|
return /*#__PURE__*/_react.default.createElement(_AccordionBody.StyledMotionAccordionBody, {
|
|
16
17
|
animate: {
|
|
@@ -25,7 +26,8 @@ const AccordionBody = _ref => {
|
|
|
25
26
|
initial: {
|
|
26
27
|
height: 0,
|
|
27
28
|
opacity: 0
|
|
28
|
-
}
|
|
29
|
+
},
|
|
30
|
+
maxHeight: maxHeight
|
|
29
31
|
}, /*#__PURE__*/_react.default.createElement(_AccordionGroup.AccordionGroupContext.Provider, {
|
|
30
32
|
value: {
|
|
31
33
|
openAccordionUuid: undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.js","names":["AccordionBody","children","height","opacity","openAccordionUuid","undefined","displayName"],"sources":["../../../../src/components/accordion/accordion-body/AccordionBody.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { AccordionGroupContext } from '../accordion-group/AccordionGroup';\nimport { StyledMotionAccordionBody } from './AccordionBody.styles';\n\nconst AccordionBody: FC = ({ children }) => (\n <StyledMotionAccordionBody\n animate={{ height: 'auto', opacity: 1 }}\n className=\"beta-chayns-accordion-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n >\n <AccordionGroupContext.Provider value={{ openAccordionUuid: undefined }}>\n {children}\n </AccordionGroupContext.Provider>\n </StyledMotionAccordionBody>\n);\n\nAccordionBody.displayName = 'AccordionBody';\n\nexport default AccordionBody;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAmE;
|
|
1
|
+
{"version":3,"file":"AccordionBody.js","names":["AccordionBody","children","maxHeight","height","opacity","openAccordionUuid","undefined","displayName"],"sources":["../../../../src/components/accordion/accordion-body/AccordionBody.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { AccordionGroupContext } from '../accordion-group/AccordionGroup';\nimport { StyledMotionAccordionBody } from './AccordionBody.styles';\n\nexport type AccordionBodyProps = {\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight?: number;\n};\n\nconst AccordionBody: FC<AccordionBodyProps> = ({ children, maxHeight }) => (\n <StyledMotionAccordionBody\n animate={{ height: 'auto', opacity: 1 }}\n className=\"beta-chayns-accordion-body\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n maxHeight={maxHeight}\n >\n <AccordionGroupContext.Provider value={{ openAccordionUuid: undefined }}>\n {children}\n </AccordionGroupContext.Provider>\n </StyledMotionAccordionBody>\n);\n\nAccordionBody.displayName = 'AccordionBody';\n\nexport default AccordionBody;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAmE;AASnE,MAAMA,aAAqC,GAAG;EAAA,IAAC;IAAEC,QAAQ;IAAEC;EAAU,CAAC;EAAA,oBAClE,6BAAC,wCAAyB;IACtB,OAAO,EAAE;MAAEC,MAAM,EAAE,MAAM;MAAEC,OAAO,EAAE;IAAE,CAAE;IACxC,SAAS,EAAC,4BAA4B;IACtC,IAAI,EAAE;MAAED,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IAChC,OAAO,EAAE;MAAED,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IACnC,SAAS,EAAEF;EAAU,gBAErB,6BAAC,qCAAqB,CAAC,QAAQ;IAAC,KAAK,EAAE;MAAEG,iBAAiB,EAAEC;IAAU;EAAE,GACnEL,QAAQ,CACoB,CACT;AAAA,CAC/B;AAEDD,aAAa,CAACO,WAAW,GAAG,eAAe;AAAC,eAE7BP,aAAa;AAAA"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AccordionBodyProps } from './AccordionBody';
|
|
2
|
+
declare type StyledMotionAccordionBodyProps = Pick<AccordionBodyProps, 'maxHeight'>;
|
|
3
|
+
export declare const StyledMotionAccordionBody: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, StyledMotionAccordionBodyProps, never>;
|
|
4
|
+
export {};
|
|
@@ -5,10 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.StyledMotionAccordionBody = void 0;
|
|
7
7
|
var _framerMotion = require("framer-motion");
|
|
8
|
-
var _styledComponents =
|
|
9
|
-
function
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
11
|
const StyledMotionAccordionBody = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
11
12
|
overflow: hidden;
|
|
13
|
+
|
|
14
|
+
${_ref => {
|
|
15
|
+
let {
|
|
16
|
+
maxHeight
|
|
17
|
+
} = _ref;
|
|
18
|
+
return typeof maxHeight === 'number' && (0, _styledComponents.css)`
|
|
19
|
+
max-height: ${maxHeight}px;
|
|
20
|
+
overflow-y: scroll;
|
|
21
|
+
`;
|
|
22
|
+
}}
|
|
12
23
|
`;
|
|
13
24
|
exports.StyledMotionAccordionBody = StyledMotionAccordionBody;
|
|
14
25
|
//# sourceMappingURL=AccordionBody.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.styles.js","names":["StyledMotionAccordionBody","styled","motion","div"],"sources":["../../../../src/components/accordion/accordion-body/AccordionBody.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nexport const StyledMotionAccordionBody = styled(motion.div)
|
|
1
|
+
{"version":3,"file":"AccordionBody.styles.js","names":["StyledMotionAccordionBody","styled","motion","div","maxHeight","css"],"sources":["../../../../src/components/accordion/accordion-body/AccordionBody.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport type { AccordionBodyProps } from './AccordionBody';\n\ntype StyledMotionAccordionBodyProps = Pick<AccordionBodyProps, 'maxHeight'>;\n\nexport const StyledMotionAccordionBody = styled(motion.div)<StyledMotionAccordionBodyProps>`\n overflow: hidden;\n\n ${({ maxHeight }) =>\n typeof maxHeight === 'number' &&\n css`\n max-height: ${maxHeight}px;\n overflow-y: scroll;\n `}\n`;\n"],"mappings":";;;;;;AAAA;AACA;AAAgD;AAAA;AAKzC,MAAMA,yBAAyB,GAAG,IAAAC,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAAkC;AAC5F;AACA;AACA,MAAM;EAAA,IAAC;IAAEC;EAAU,CAAC;EAAA,OACZ,OAAOA,SAAS,KAAK,QAAQ,IAC7B,IAAAC,qBAAG,CAAC;AACZ,0BAA0BD,SAAU;AACpC;AACA,SAAS;AAAA,CAAC;AACV,CAAC;AAAC"}
|
|
@@ -4,6 +4,9 @@ export declare type AccordionContentProps = {
|
|
|
4
4
|
* The content of the accordion content element
|
|
5
5
|
*/
|
|
6
6
|
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Maximum height of the element. This automatically makes the content of the element scrollable.
|
|
9
|
+
*/
|
|
7
10
|
maxHeight?: number;
|
|
8
11
|
};
|
|
9
12
|
declare const AccordionContent: FC<AccordionContentProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContent.js","names":["AccordionContent","children","maxHeight","isWrapped","displayName"],"sources":["../../../../src/components/accordion/accordion-content/AccordionContent.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { AccordionContext } from '../Accordion';\nimport { StyledAccordionContent } from './AccordionContent.styles';\n\nexport type AccordionContentProps = {\n /**\n * The content of the accordion content element\n */\n children: ReactNode;\n maxHeight?: number;\n};\n\nconst AccordionContent: FC<AccordionContentProps> = ({ children, maxHeight }) => (\n <AccordionContext.Consumer>\n {({ isWrapped }) => (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content\"\n isWrapped={isWrapped}\n maxHeight={maxHeight}\n >\n {children}\n </StyledAccordionContent>\n )}\n </AccordionContext.Consumer>\n);\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAmE;
|
|
1
|
+
{"version":3,"file":"AccordionContent.js","names":["AccordionContent","children","maxHeight","isWrapped","displayName"],"sources":["../../../../src/components/accordion/accordion-content/AccordionContent.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { AccordionContext } from '../Accordion';\nimport { StyledAccordionContent } from './AccordionContent.styles';\n\nexport type AccordionContentProps = {\n /**\n * The content of the accordion content element\n */\n children: ReactNode;\n /**\n * Maximum height of the element. This automatically makes the content of the element scrollable.\n */\n maxHeight?: number;\n};\n\nconst AccordionContent: FC<AccordionContentProps> = ({ children, maxHeight }) => (\n <AccordionContext.Consumer>\n {({ isWrapped }) => (\n <StyledAccordionContent\n className=\"beta-chayns-accordion-content\"\n isWrapped={isWrapped}\n maxHeight={maxHeight}\n >\n {children}\n </StyledAccordionContent>\n )}\n </AccordionContext.Consumer>\n);\n\nAccordionContent.displayName = 'AccordionContent';\n\nexport default AccordionContent;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAmE;AAanE,MAAMA,gBAA2C,GAAG;EAAA,IAAC;IAAEC,QAAQ;IAAEC;EAAU,CAAC;EAAA,oBACxE,6BAAC,2BAAgB,CAAC,QAAQ,QACrB;IAAA,IAAC;MAAEC;IAAU,CAAC;IAAA,oBACX,6BAAC,wCAAsB;MACnB,SAAS,EAAC,+BAA+B;MACzC,SAAS,EAAEA,SAAU;MACrB,SAAS,EAAED;IAAU,GAEpBD,QAAQ,CACY;EAAA,CAC5B,CACuB;AAAA,CAC/B;AAEDD,gBAAgB,CAACI,WAAW,GAAG,kBAAkB;AAAC,eAEnCJ,gBAAgB;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.45",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chayns",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "c2d9c44034d2227ef2940d80f5a2e57ecddc0cb2"
|
|
66
66
|
}
|