@chayns-components/core 5.0.0-beta.45 → 5.0.0-beta.46

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.
@@ -3,6 +3,11 @@ export declare const AccordionContext: React.Context<{
3
3
  isWrapped: boolean;
4
4
  }>;
5
5
  export declare type AccordionProps = {
6
+ /**
7
+ * Maximum height of the accordion body element. This automatically makes the content of the
8
+ * body element scrollable.
9
+ */
10
+ bodyMaxHeight?: number;
6
11
  /**
7
12
  * The content of the accordion body
8
13
  */
@@ -21,6 +21,7 @@ exports.AccordionContext = AccordionContext;
21
21
  AccordionContext.displayName = 'AccordionContext';
22
22
  const Accordion = _ref => {
23
23
  let {
24
+ bodyMaxHeight,
24
25
  children,
25
26
  icon,
26
27
  isDefaultOpen = false,
@@ -106,7 +107,9 @@ const Accordion = _ref => {
106
107
  titleElement: titleElement
107
108
  }), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
108
109
  initial: false
109
- }, isOpen && /*#__PURE__*/_react.default.createElement(_AccordionBody.default, null, children)))));
110
+ }, isOpen && /*#__PURE__*/_react.default.createElement(_AccordionBody.default, {
111
+ maxHeight: bodyMaxHeight
112
+ }, children)))));
110
113
  };
111
114
  Accordion.displayName = 'Accordion';
112
115
  var _default = Accordion;
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","names":["AccordionContext","React","createContext","isWrapped","displayName","Accordion","children","icon","isDefaultOpen","isDisabled","isFixed","isTitleGreyed","onClose","onOpen","onSearchChange","rightElement","searchIcon","searchPlaceholder","shouldHideBackground","title","titleElement","openAccordionUuid","updateOpenAccordionUuid","useContext","AccordionGroupContext","isParentWrapped","isAccordionOpen","setIsAccordionOpen","useState","uuid","useUuid","isInitialRenderRef","useRef","isInGroup","isOpen","handleHeadClick","useCallback","currentIsAccordionOpen","useEffect","current","shouldOnlyOpen","type"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { StyledAccordion } from './Accordion.styles';\n\nexport const AccordionContext = React.createContext({ isWrapped: false });\n\nAccordionContext.displayName = 'AccordionContext';\n\nexport type AccordionProps = {\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * This value must be set for nested Accordions. This adjusts the style of\n * the head and the padding of the content.\n */\n isWrapped?: boolean;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * Icon to be displayed on the right side in the search input\n */\n searchIcon?: string[];\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isTitleGreyed = false,\n isWrapped = false,\n onClose,\n onOpen,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n shouldHideBackground = false,\n title,\n titleElement,\n}) => {\n const { openAccordionUuid, updateOpenAccordionUuid } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const isInGroup = typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpen === 'function') {\n onOpen();\n }\n } else if (typeof onClose === 'function') {\n onClose();\n }\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isDefaultOpen && typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n return (\n <StyledAccordion\n className=\"beta-chayns-accordion\"\n isOpen={isOpen}\n isParentWrapped={isParentWrapped}\n isWrapped={isWrapped}\n shouldHideBackground={shouldHideBackground}\n >\n <AccordionContext.Provider value={{ isWrapped }}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n icon={icon}\n isOpen={isOpen}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchIcon={searchIcon}\n searchPlaceholder={searchPlaceholder}\n title={title}\n titleElement={titleElement}\n />\n <AnimatePresence initial={false}>\n {isOpen && <AccordionBody>{children}</AccordionBody>}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":";;;;;;AAAA;AACA;AAUA;AACA;AACA;AACA;AACA;AAAqD;AAAA;AAAA;AAE9C,MAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAa,CAAC;EAAEC,SAAS,EAAE;AAAM,CAAC,CAAC;AAAC;AAE1EH,gBAAgB,CAACI,WAAW,GAAG,kBAAkB;AAyEjD,MAAMC,SAA6B,GAAG,QAiBhC;EAAA,IAjBiC;IACnCC,QAAQ;IACRC,IAAI;IACJC,aAAa,GAAG,KAAK;IACrBC,UAAU,GAAG,KAAK;IAClBC,OAAO,GAAG,KAAK;IACfC,aAAa,GAAG,KAAK;IACrBR,SAAS,GAAG,KAAK;IACjBS,OAAO;IACPC,MAAM;IACNC,cAAc;IACdC,YAAY;IACZC,UAAU;IACVC,iBAAiB;IACjBC,oBAAoB,GAAG,KAAK;IAC5BC,KAAK;IACLC;EACJ,CAAC;EACG,MAAM;IAAEC,iBAAiB;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAU,EAACC,qCAAqB,CAAC;EACxF,MAAM;IAAErB,SAAS,EAAEsB;EAAgB,CAAC,GAAG,IAAAF,iBAAU,EAACvB,gBAAgB,CAAC;EAEnE,MAAM,CAAC0B,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAAUpB,aAAa,CAAC;EAE9E,MAAMqB,IAAI,GAAG,IAAAC,aAAO,GAAE;EAEtB,MAAMC,kBAAkB,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAEvC,MAAMC,SAAS,GAAG,OAAOX,uBAAuB,KAAK,UAAU;EAE/D,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,gBAC5C,6BAAC,0BAAY;IAAC,UAAU,EAAE;MAAEsC,IAAI,EAAE;IAAQ;EAAE,gBACxC,6BAAC,sBAAa;IACV,IAAI,EAAElC,IAAK;IACX,MAAM,EAAE2B,MAAO;IACf,OAAO,EAAExB,OAAQ;IACjB,aAAa,EAAEC,aAAa,IAAIF,UAAW;IAC3C,SAAS,EAAEN,SAAU;IACrB,OAAO,EAAEgC,eAAgB;IACzB,cAAc,EAAErB,cAAe;IAC/B,YAAY,EAAEC,YAAa;IAC3B,UAAU,EAAEC,UAAW;IACvB,iBAAiB,EAAEC,iBAAkB;IACrC,KAAK,EAAEE,KAAM;IACb,YAAY,EAAEC;EAAa,EAC7B,eACF,6BAAC,6BAAe;IAAC,OAAO,EAAE;EAAM,GAC3Bc,MAAM,iBAAI,6BAAC,sBAAa,QAAE5B,QAAQ,CAAiB,CACtC,CACP,CACS,CACd;AAE1B,CAAC;AAEDD,SAAS,CAACD,WAAW,GAAG,WAAW;AAAC,eAErBC,SAAS;AAAA"}
1
+ {"version":3,"file":"Accordion.js","names":["AccordionContext","React","createContext","isWrapped","displayName","Accordion","bodyMaxHeight","children","icon","isDefaultOpen","isDisabled","isFixed","isTitleGreyed","onClose","onOpen","onSearchChange","rightElement","searchIcon","searchPlaceholder","shouldHideBackground","title","titleElement","openAccordionUuid","updateOpenAccordionUuid","useContext","AccordionGroupContext","isParentWrapped","isAccordionOpen","setIsAccordionOpen","useState","uuid","useUuid","isInitialRenderRef","useRef","isInGroup","isOpen","handleHeadClick","useCallback","currentIsAccordionOpen","useEffect","current","shouldOnlyOpen","type"],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n FC,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../hooks/uuid';\nimport AccordionBody from './accordion-body/AccordionBody';\nimport { AccordionGroupContext } from './accordion-group/AccordionGroup';\nimport AccordionHead from './accordion-head/AccordionHead';\nimport { StyledAccordion } from './Accordion.styles';\n\nexport const AccordionContext = React.createContext({ isWrapped: false });\n\nAccordionContext.displayName = 'AccordionContext';\n\nexport type AccordionProps = {\n /**\n * Maximum height of the accordion body element. This automatically makes the content of the\n * body element scrollable.\n */\n bodyMaxHeight?: number;\n /**\n * The content of the accordion body\n */\n children: ReactNode;\n /**\n * The icon that is displayed in front of the title\n */\n icon?: string;\n /**\n * This can be used to automatically expand the Accordion during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This will disable the Accordion so that it cannot be opened and will gray out the title.\n */\n isDisabled?: boolean;\n /**\n * This can be used so that the Accordion cannot be opened or closed.\n * In addition, in this case the icon is exchanged to mark the Accordions.\n */\n isFixed?: boolean;\n /**\n * This will gray out the title of the Accordion to indicate hidden content, for example.\n */\n isTitleGreyed?: boolean;\n /**\n * This value must be set for nested Accordions. This adjusts the style of\n * the head and the padding of the content.\n */\n isWrapped?: boolean;\n /**\n * Function that is executed when the accordion will be closed.\n */\n onClose?: VoidFunction;\n /**\n * Function that is executed when the accordion will be opened.\n */\n onOpen?: VoidFunction;\n /**\n * Function that is executed when the text of the search in the accordion\n * head changes. When this function is given, the search field is displayed\n * in the Accordion Head.\n */\n onSearchChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Content to be displayed on the right side in the head of the Accordion\n */\n rightElement?: ReactNode;\n /**\n * Icon to be displayed on the right side in the search input\n */\n searchIcon?: string[];\n /**\n * The placeholder to be used for the search\n */\n searchPlaceholder?: string;\n /**\n * This will hide the background color of the accordion\n */\n shouldHideBackground?: boolean;\n /**\n * Title of the Accordion displayed in the head\n */\n title: string;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n};\n\nconst Accordion: FC<AccordionProps> = ({\n bodyMaxHeight,\n children,\n icon,\n isDefaultOpen = false,\n isDisabled = false,\n isFixed = false,\n isTitleGreyed = false,\n isWrapped = false,\n onClose,\n onOpen,\n onSearchChange,\n rightElement,\n searchIcon,\n searchPlaceholder,\n shouldHideBackground = false,\n title,\n titleElement,\n}) => {\n const { openAccordionUuid, updateOpenAccordionUuid } = useContext(AccordionGroupContext);\n const { isWrapped: isParentWrapped } = useContext(AccordionContext);\n\n const [isAccordionOpen, setIsAccordionOpen] = useState<boolean>(isDefaultOpen);\n\n const uuid = useUuid();\n\n const isInitialRenderRef = useRef(true);\n\n const isInGroup = typeof updateOpenAccordionUuid === 'function';\n\n const isOpen = isInGroup ? openAccordionUuid === uuid : isAccordionOpen;\n\n const handleHeadClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n\n if (typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid);\n }\n\n setIsAccordionOpen((currentIsAccordionOpen) => !currentIsAccordionOpen);\n }, [isDisabled, updateOpenAccordionUuid, uuid]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isOpen) {\n if (typeof onOpen === 'function') {\n onOpen();\n }\n } else if (typeof onClose === 'function') {\n onClose();\n }\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isDefaultOpen && typeof updateOpenAccordionUuid === 'function') {\n updateOpenAccordionUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenAccordionUuid, uuid]);\n\n return (\n <StyledAccordion\n className=\"beta-chayns-accordion\"\n isOpen={isOpen}\n isParentWrapped={isParentWrapped}\n isWrapped={isWrapped}\n shouldHideBackground={shouldHideBackground}\n >\n <AccordionContext.Provider value={{ isWrapped }}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AccordionHead\n icon={icon}\n isOpen={isOpen}\n isFixed={isFixed}\n isTitleGreyed={isTitleGreyed || isDisabled}\n isWrapped={isWrapped}\n onClick={handleHeadClick}\n onSearchChange={onSearchChange}\n rightElement={rightElement}\n searchIcon={searchIcon}\n searchPlaceholder={searchPlaceholder}\n title={title}\n titleElement={titleElement}\n />\n <AnimatePresence initial={false}>\n {isOpen && (\n <AccordionBody maxHeight={bodyMaxHeight}>{children}</AccordionBody>\n )}\n </AnimatePresence>\n </MotionConfig>\n </AccordionContext.Provider>\n </StyledAccordion>\n );\n};\n\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\n"],"mappings":";;;;;;AAAA;AACA;AAUA;AACA;AACA;AACA;AACA;AAAqD;AAAA;AAAA;AAE9C,MAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAa,CAAC;EAAEC,SAAS,EAAE;AAAM,CAAC,CAAC;AAAC;AAE1EH,gBAAgB,CAACI,WAAW,GAAG,kBAAkB;AA8EjD,MAAMC,SAA6B,GAAG,QAkBhC;EAAA,IAlBiC;IACnCC,aAAa;IACbC,QAAQ;IACRC,IAAI;IACJC,aAAa,GAAG,KAAK;IACrBC,UAAU,GAAG,KAAK;IAClBC,OAAO,GAAG,KAAK;IACfC,aAAa,GAAG,KAAK;IACrBT,SAAS,GAAG,KAAK;IACjBU,OAAO;IACPC,MAAM;IACNC,cAAc;IACdC,YAAY;IACZC,UAAU;IACVC,iBAAiB;IACjBC,oBAAoB,GAAG,KAAK;IAC5BC,KAAK;IACLC;EACJ,CAAC;EACG,MAAM;IAAEC,iBAAiB;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAU,EAACC,qCAAqB,CAAC;EACxF,MAAM;IAAEtB,SAAS,EAAEuB;EAAgB,CAAC,GAAG,IAAAF,iBAAU,EAACxB,gBAAgB,CAAC;EAEnE,MAAM,CAAC2B,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAAUpB,aAAa,CAAC;EAE9E,MAAMqB,IAAI,GAAG,IAAAC,aAAO,GAAE;EAEtB,MAAMC,kBAAkB,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAEvC,MAAMC,SAAS,GAAG,OAAOX,uBAAuB,KAAK,UAAU;EAE/D,MAAMY,MAAM,GAAGD,SAAS,GAAGZ,iBAAiB,KAAKQ,IAAI,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,EAAE;IAAQ;EAAE,gBACxC,6BAAC,sBAAa;IACV,IAAI,EAAElC,IAAK;IACX,MAAM,EAAE2B,MAAO;IACf,OAAO,EAAExB,OAAQ;IACjB,aAAa,EAAEC,aAAa,IAAIF,UAAW;IAC3C,SAAS,EAAEP,SAAU;IACrB,OAAO,EAAEiC,eAAgB;IACzB,cAAc,EAAErB,cAAe;IAC/B,YAAY,EAAEC,YAAa;IAC3B,UAAU,EAAEC,UAAW;IACvB,iBAAiB,EAAEC,iBAAkB;IACrC,KAAK,EAAEE,KAAM;IACb,YAAY,EAAEC;EAAa,EAC7B,eACF,6BAAC,6BAAe;IAAC,OAAO,EAAE;EAAM,GAC3Bc,MAAM,iBACH,6BAAC,sBAAa;IAAC,SAAS,EAAE7B;EAAc,GAAEC,QAAQ,CACrD,CACa,CACP,CACS,CACd;AAE1B,CAAC;AAEDF,SAAS,CAACD,WAAW,GAAG,WAAW;AAAC,eAErBC,SAAS;AAAA"}
@@ -1,9 +1,10 @@
1
1
  import { FC } from 'react';
2
+ import type { AccordionProps } from '../Accordion';
2
3
  export declare type AccordionBodyProps = {
3
4
  /**
4
5
  * Maximum height of the element. This automatically makes the content of the element scrollable.
5
6
  */
6
- maxHeight?: number;
7
+ maxHeight: AccordionProps['bodyMaxHeight'];
7
8
  };
8
9
  declare const AccordionBody: FC<AccordionBodyProps>;
9
10
  export default AccordionBody;
@@ -1 +1 @@
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
+ {"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 type { AccordionProps } from '../Accordion';\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: AccordionProps['bodyMaxHeight'];\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;AAEA;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.45",
3
+ "version": "5.0.0-beta.46",
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": "c2d9c44034d2227ef2940d80f5a2e57ecddc0cb2"
65
+ "gitHead": "c3a95cec946b061e76794296f168a52cd8176cae"
66
66
  }