@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.
@@ -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
  };
@@ -69,5 +69,9 @@ export const AccordionItemStyled = styled.div `
69
69
  border-left: 1px solid var(--neutral-neutral-4);
70
70
  border-bottom: none;
71
71
  color: black;
72
+
73
+ &.no-padding {
74
+ padding: 0;
75
+ }
72
76
  }
73
77
  `;
@@ -70,5 +70,9 @@ export const AccordionItemStyled = styled.div`
70
70
  border-left: 1px solid var(--neutral-neutral-4);
71
71
  border-bottom: none;
72
72
  color: black;
73
+
74
+ &.no-padding {
75
+ padding: 0;
76
+ }
73
77
  }
74
78
  `
@@ -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}
@@ -1,4 +1,5 @@
1
1
  export interface AccordionItemProps {
2
+ noPadding?: boolean;
2
3
  accordionRightContent?: React.ReactNode;
3
4
  children?: React.ReactNode;
4
5
  defaultHeightItem?: number;
@@ -1,4 +1,5 @@
1
1
  export interface AccordionItemProps {
2
+ noPadding?: boolean
2
3
  accordionRightContent?: React.ReactNode
3
4
  children?: React.ReactNode
4
5
  defaultHeightItem?: number
@@ -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
  };
@@ -21,6 +21,7 @@ export const Accordion = ({
21
21
  <AccordionStyled>
22
22
  {data.map((item, index) => (
23
23
  <AccordionItem
24
+ noPadding={item?.noPadding}
24
25
  accordionRightContent={item?.accordionRightContent}
25
26
  defaultHeightItem={defaultHeightItem}
26
27
  index={index}
@@ -3,6 +3,7 @@ interface AccordionItem {
3
3
  children?: React.ReactNode;
4
4
  onClick?: () => void;
5
5
  title?: string;
6
+ noPadding?: boolean;
6
7
  }
7
8
  export interface AccordionProps {
8
9
  data: AccordionItem[];
@@ -3,6 +3,7 @@ interface AccordionItem {
3
3
  children?: React.ReactNode
4
4
  onClick?: () => void
5
5
  title?: string
6
+ noPadding?: boolean
6
7
  }
7
8
 
8
9
  export interface AccordionProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.100.3",
3
+ "version": "7.102.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",