@npm_leadtech/legal-lib-components 7.100.3 → 7.102.0
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/dist/src/components/molecules/AccordionItem/AccordionItem.d.ts +1 -1
- package/dist/src/components/molecules/AccordionItem/AccordionItem.js +2 -2
- package/dist/src/components/molecules/AccordionItem/AccordionItem.styled.js +4 -0
- package/dist/src/components/molecules/AccordionItem/AccordionItem.styled.ts +4 -0
- package/dist/src/components/molecules/AccordionItem/AccordionItem.tsx +2 -1
- package/dist/src/components/molecules/AccordionItem/AccordionItemProps.types.d.ts +1 -0
- package/dist/src/components/molecules/AccordionItem/AccordionItemProps.types.ts +1 -0
- package/dist/src/components/organisms/Accordion/Accordion.js +1 -1
- package/dist/src/components/organisms/Accordion/Accordion.tsx +1 -0
- package/dist/src/components/organisms/Accordion/AccordionProps.types.d.ts +1 -0
- package/dist/src/components/organisms/Accordion/AccordionProps.types.ts +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AccordionItemProps } from './AccordionItemProps.types';
|
|
3
|
-
export declare const AccordionItem: ({ accordionRightContent, children, defaultHeightItem, index, isOpen, onClick, title, heightAutoChange }: AccordionItemProps) => React.JSX.Element;
|
|
3
|
+
export declare const AccordionItem: ({ noPadding, accordionRightContent, children, defaultHeightItem, index, isOpen, onClick, title, heightAutoChange }: AccordionItemProps) => React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React, { useEffect, useRef } from 'react';
|
|
4
4
|
import { useDispatchDataAccordionItem, useStateDataAccordionItem } from '../../organisms/Accordion/Accordion.context';
|
|
5
5
|
import { AccordionItemStyled } from './AccordionItem.styled';
|
|
6
|
-
export const AccordionItem = ({ accordionRightContent, children, defaultHeightItem = 416, index, isOpen, onClick, title, heightAutoChange = false }) => {
|
|
6
|
+
export const AccordionItem = ({ noPadding = false, accordionRightContent, children, defaultHeightItem = 416, index, isOpen, onClick, title, heightAutoChange = false }) => {
|
|
7
7
|
const contenReftHeight = useRef(null);
|
|
8
8
|
const { state } = useStateDataAccordionItem(index);
|
|
9
9
|
const { dispatch } = useDispatchDataAccordionItem();
|
|
@@ -40,5 +40,5 @@ export const AccordionItem = ({ accordionRightContent, children, defaultHeightIt
|
|
|
40
40
|
${state.handler === 'success' ? '--success' : ''}
|
|
41
41
|
${state.locked.isLocked ? '--locked' : ''}`, onClick: () => {
|
|
42
42
|
!state.locked.isLocked && onClick();
|
|
43
|
-
}, children: [_jsx("p", { className: `accordion__title ${state.locked.isLocked ? '--locked' : ''}`, children: title }), accordionRightContent] }), _jsx("div", { ref: contenReftHeight, className: `accordion__content ${!isOpen ? '--closed' : ''}`, style: isOpen ? { height: heightAccordionItem } : { height: '0px' }, children: children })] }));
|
|
43
|
+
}, children: [_jsx("p", { className: `accordion__title ${state.locked.isLocked ? '--locked' : ''}`, children: title }), accordionRightContent] }), _jsx("div", { ref: contenReftHeight, className: `accordion__content ${!isOpen ? '--closed' : ''} ${noPadding ? 'no-padding' : ''}`, style: isOpen ? { height: heightAccordionItem } : { height: '0px' }, children: children })] }));
|
|
44
44
|
};
|
|
@@ -6,6 +6,7 @@ import { type AccordionItemProps } from './AccordionItemProps.types'
|
|
|
6
6
|
import { AccordionItemStyled } from './AccordionItem.styled'
|
|
7
7
|
|
|
8
8
|
export const AccordionItem = ({
|
|
9
|
+
noPadding = false,
|
|
9
10
|
accordionRightContent,
|
|
10
11
|
children,
|
|
11
12
|
defaultHeightItem = 416,
|
|
@@ -67,7 +68,7 @@ export const AccordionItem = ({
|
|
|
67
68
|
|
|
68
69
|
<div
|
|
69
70
|
ref={contenReftHeight}
|
|
70
|
-
className={`accordion__content ${!isOpen ? '--closed' : ''}`}
|
|
71
|
+
className={`accordion__content ${!isOpen ? '--closed' : ''} ${noPadding ? 'no-padding' : ''}`}
|
|
71
72
|
style={isOpen ? { height: heightAccordionItem } : { height: '0px' }}
|
|
72
73
|
>
|
|
73
74
|
{children}
|
|
@@ -8,7 +8,7 @@ export const Accordion = ({ data, defaultActiveIndex = 0, defaultHeightItem, hei
|
|
|
8
8
|
const handleItemClick = (index) => {
|
|
9
9
|
setActiveIndex((prevIndex) => (prevIndex === index ? -1 : index));
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(AccordionProvider, { elements: data.length, children: _jsx(AccordionStyled, { children: data.map((item, index) => (_jsx(AccordionItem, { accordionRightContent: item?.accordionRightContent, defaultHeightItem: defaultHeightItem, index: index, isOpen: activeIndex === index, onClick: () => {
|
|
11
|
+
return (_jsx(AccordionProvider, { elements: data.length, children: _jsx(AccordionStyled, { children: data.map((item, index) => (_jsx(AccordionItem, { noPadding: item?.noPadding, accordionRightContent: item?.accordionRightContent, defaultHeightItem: defaultHeightItem, index: index, isOpen: activeIndex === index, onClick: () => {
|
|
12
12
|
handleItemClick(index);
|
|
13
13
|
}, title: item.title, heightAutoChange: heightAutoChange, children: item.children }, index))) }) }));
|
|
14
14
|
};
|