@npm_leadtech/legal-lib-components 7.56.11 → 7.58.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.
@@ -835,7 +835,7 @@ html[data-theme=lawdistrict] .e-button.--primary-3 {
835
835
  border: 2px solid var(--button);
836
836
  color: var(--others-white);
837
837
  font-weight: bold;
838
- height: 100%;
838
+ max-height: 100%;
839
839
  }
840
840
  .e-button.--primary-1:hover {
841
841
  background-color: var(--button-hover);
@@ -1853,7 +1853,7 @@ h2.react-datepicker__current-month {
1853
1853
  display: flex;
1854
1854
  height: 42px;
1855
1855
  justify-content: center;
1856
- width: 80px;
1856
+ min-width: 80px;
1857
1857
  }
1858
1858
  .e-radio.tabs .e-radio__inner .radio-item-container:hover {
1859
1859
  background: var(--neutral-neutral-4);
@@ -73,7 +73,7 @@ html[data-theme='lawdistrict'] {
73
73
  border: 2px solid var(--button);
74
74
  color: get-color(others, white);
75
75
  font-weight: bold;
76
- height: 100%;
76
+ max-height: 100%;
77
77
 
78
78
  &:hover {
79
79
  background-color: var(--button-hover);
@@ -41,7 +41,7 @@
41
41
  display: flex;
42
42
  height: 42px;
43
43
  justify-content: center;
44
- width: 80px;
44
+ min-width: 80px;
45
45
 
46
46
  &:hover {
47
47
  background: var(--neutral-neutral-4);
@@ -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: ({ accordionRightContent, children, defaultHeightItem, index, isOpen, onClick, title }: AccordionItemProps) => React.JSX.Element;
@@ -1,41 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable @typescript-eslint/no-unused-expressions */
3
- import React, { useEffect, useRef } from 'react';
3
+ import { 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 = ({ accordionRightContent, children, defaultHeightItem = 416, index, isOpen, onClick, title }) => {
7
7
  const contenReftHeight = useRef(null);
8
8
  const { state } = useStateDataAccordionItem(index);
9
9
  const { dispatch } = useDispatchDataAccordionItem();
10
- const [heightAccordionItem, setHeightAccordionItem] = React.useState(defaultHeightItem);
11
10
  useEffect(() => {
12
11
  if (state.locked.actionType === 'unlocked') {
13
12
  onClick();
14
13
  dispatch({ type: 'unlocked', accordionItem: index, resetAction: 'default' });
15
14
  }
16
15
  }, [state.locked.actionType]);
17
- useEffect(() => {
18
- let intervalId;
19
- if (heightAutoChange) {
20
- intervalId = setInterval(() => {
21
- const height = contenReftHeight.current?.children[0].getBoundingClientRect().height ?? defaultHeightItem;
22
- if (heightAccordionItem !== height) {
23
- setHeightAccordionItem(height);
24
- }
25
- }, 500);
26
- }
27
- else {
28
- setHeightAccordionItem(contenReftHeight?.current?.scrollHeight ?? defaultHeightItem);
29
- }
30
- return () => {
31
- if (intervalId !== undefined) {
32
- clearInterval(intervalId);
33
- }
34
- };
35
- }, []);
36
16
  return (_jsxs(AccordionItemStyled, { className: 'accordion__container', children: [_jsxs("button", { className: `accordion__button
37
17
  ${state.handler === 'success' ? '--success' : ''}
38
18
  ${state.locked.isLocked ? '--locked' : ''}`, onClick: () => {
39
19
  !state.locked.isLocked && onClick();
40
- }, 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 })] }));
20
+ }, 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: contenReftHeight?.current?.scrollHeight ?? defaultHeightItem } : { height: '0px' }, children: children })] }));
41
21
  };
@@ -12,13 +12,11 @@ export const AccordionItem = ({
12
12
  index,
13
13
  isOpen,
14
14
  onClick,
15
- title,
16
- heightAutoChange = false
15
+ title
17
16
  }: AccordionItemProps): React.JSX.Element => {
18
17
  const contenReftHeight = useRef<HTMLInputElement>(null)
19
18
  const { state } = useStateDataAccordionItem(index)
20
19
  const { dispatch } = useDispatchDataAccordionItem()
21
- const [heightAccordionItem, setHeightAccordionItem] = React.useState<number>(defaultHeightItem)
22
20
 
23
21
  useEffect(() => {
24
22
  if (state.locked.actionType === 'unlocked') {
@@ -27,25 +25,6 @@ export const AccordionItem = ({
27
25
  }
28
26
  }, [state.locked.actionType])
29
27
 
30
- useEffect(() => {
31
- let intervalId: ReturnType<typeof setInterval> | undefined
32
- if (heightAutoChange) {
33
- intervalId = setInterval(() => {
34
- const height = contenReftHeight.current?.children[0].getBoundingClientRect().height ?? defaultHeightItem
35
- if (heightAccordionItem !== height) {
36
- setHeightAccordionItem(height)
37
- }
38
- }, 500)
39
- } else {
40
- setHeightAccordionItem(contenReftHeight?.current?.scrollHeight ?? defaultHeightItem)
41
- }
42
- return () => {
43
- if (intervalId !== undefined) {
44
- clearInterval(intervalId)
45
- }
46
- }
47
- }, [])
48
-
49
28
  return (
50
29
  <AccordionItemStyled className='accordion__container'>
51
30
  <button
@@ -63,7 +42,7 @@ export const AccordionItem = ({
63
42
  <div
64
43
  ref={contenReftHeight}
65
44
  className={`accordion__content ${!isOpen ? '--closed' : ''}`}
66
- style={isOpen ? { height: heightAccordionItem } : { height: '0px' }}
45
+ style={isOpen ? { height: contenReftHeight?.current?.scrollHeight ?? defaultHeightItem } : { height: '0px' }}
67
46
  >
68
47
  {children}
69
48
  </div>
@@ -6,5 +6,4 @@ export interface AccordionItemProps {
6
6
  isOpen?: boolean;
7
7
  onClick: () => void;
8
8
  title?: string;
9
- heightAutoChange?: boolean;
10
9
  }
@@ -6,5 +6,4 @@ export interface AccordionItemProps {
6
6
  isOpen?: boolean
7
7
  onClick: () => void
8
8
  title?: string
9
- heightAutoChange?: boolean
10
9
  }
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type AccordionProps } from './AccordionProps.types';
3
- export declare const Accordion: ({ data, defaultActiveIndex, defaultHeightItem, heightAutoChange }: AccordionProps) => React.JSX.Element;
3
+ export declare const Accordion: ({ data, defaultActiveIndex, defaultHeightItem }: AccordionProps) => React.JSX.Element;
@@ -3,12 +3,12 @@ import { useState } from 'react';
3
3
  import { AccordionItem } from '../../molecules';
4
4
  import { AccordionProvider } from './Accordion.context';
5
5
  import { AccordionStyled } from './Accordion.styled';
6
- export const Accordion = ({ data, defaultActiveIndex = 0, defaultHeightItem, heightAutoChange = false }) => {
6
+ export const Accordion = ({ data, defaultActiveIndex = 0, defaultHeightItem }) => {
7
7
  const [activeIndex, setActiveIndex] = useState(defaultActiveIndex);
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, heightAutoChange: heightAutoChange, index: index, isOpen: activeIndex === index, onClick: () => {
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: () => {
12
12
  handleItemClick(index);
13
13
  }, title: item.title, children: item.children }, index))) }) }));
14
14
  };
@@ -4,12 +4,7 @@ import { type AccordionProps } from './AccordionProps.types'
4
4
  import { AccordionProvider } from './Accordion.context'
5
5
  import { AccordionStyled } from './Accordion.styled'
6
6
 
7
- export const Accordion = ({
8
- data,
9
- defaultActiveIndex = 0,
10
- defaultHeightItem,
11
- heightAutoChange = false
12
- }: AccordionProps): React.JSX.Element => {
7
+ export const Accordion = ({ data, defaultActiveIndex = 0, defaultHeightItem }: AccordionProps): React.JSX.Element => {
13
8
  const [activeIndex, setActiveIndex] = useState(defaultActiveIndex)
14
9
 
15
10
  const handleItemClick = (index: number): void => {
@@ -23,7 +18,6 @@ export const Accordion = ({
23
18
  <AccordionItem
24
19
  accordionRightContent={item?.accordionRightContent}
25
20
  defaultHeightItem={defaultHeightItem}
26
- heightAutoChange={heightAutoChange}
27
21
  index={index}
28
22
  isOpen={activeIndex === index}
29
23
  key={index}
@@ -8,6 +8,5 @@ export interface AccordionProps {
8
8
  data: AccordionItem[];
9
9
  defaultActiveIndex?: number;
10
10
  defaultHeightItem?: number;
11
- heightAutoChange?: boolean;
12
11
  }
13
12
  export {};
@@ -9,5 +9,4 @@ export interface AccordionProps {
9
9
  data: AccordionItem[]
10
10
  defaultActiveIndex?: number
11
11
  defaultHeightItem?: number
12
- heightAutoChange?: boolean
13
12
  }
@@ -8,6 +8,8 @@ export const CardFunctionalityStyled = styled.article `
8
8
  gap: var(--global-gap);
9
9
  padding: 1em;
10
10
  width: 100%;
11
+ justify-content: space-between;
12
+
11
13
  @media ${device.laptop} {
12
14
  width: 50%;
13
15
  }
@@ -53,7 +55,7 @@ export const CardFunctionalityStyled = styled.article `
53
55
 
54
56
  .tags {
55
57
  display: flex;
56
- gap: 2rem;
58
+ gap: 0.5rem;
57
59
  flex-wrap: wrap;
58
60
  }
59
61
  }
@@ -9,6 +9,8 @@ export const CardFunctionalityStyled = styled.article`
9
9
  gap: var(--global-gap);
10
10
  padding: 1em;
11
11
  width: 100%;
12
+ justify-content: space-between;
13
+
12
14
  @media ${device.laptop} {
13
15
  width: 50%;
14
16
  }
@@ -54,7 +56,7 @@ export const CardFunctionalityStyled = styled.article`
54
56
 
55
57
  .tags {
56
58
  display: flex;
57
- gap: 2rem;
59
+ gap: 0.5rem;
58
60
  flex-wrap: wrap;
59
61
  }
60
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.56.11",
3
+ "version": "7.58.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",