@addsign/moje-agenda-shared-lib 2.0.76 → 2.0.77
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,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
interface CollapsibleSectionProps {
|
|
2
|
+
interface CollapsibleSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
title: string;
|
|
4
4
|
expanded?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -8,5 +8,5 @@ interface CollapsibleSectionProps {
|
|
|
8
8
|
classNameEnvelope?: string;
|
|
9
9
|
classNameTitle?: string;
|
|
10
10
|
}
|
|
11
|
-
declare const CollapsibleSection: ({ title, expanded, children, onToggle, className, classNameEnvelope, classNameTitle, }: CollapsibleSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const CollapsibleSection: ({ title, expanded, children, onToggle, className, classNameEnvelope, classNameTitle, ...rest }: CollapsibleSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default CollapsibleSection;
|
|
@@ -9,7 +9,8 @@ const CollapsibleSection = ({
|
|
|
9
9
|
onToggle,
|
|
10
10
|
className,
|
|
11
11
|
classNameEnvelope,
|
|
12
|
-
classNameTitle
|
|
12
|
+
classNameTitle,
|
|
13
|
+
...rest
|
|
13
14
|
}) => {
|
|
14
15
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
15
16
|
const isInitialMount = useRef(true);
|
|
@@ -20,7 +21,7 @@ const CollapsibleSection = ({
|
|
|
20
21
|
}
|
|
21
22
|
onToggle == null ? void 0 : onToggle(isExpanded);
|
|
22
23
|
}, [isExpanded, onToggle]);
|
|
23
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-md shadow-lg border", classNameEnvelope), children: [
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-md shadow-lg border", classNameEnvelope), ...rest, children: [
|
|
24
25
|
/* @__PURE__ */ jsxs(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleSection.js","sources":["../../../lib/components/layout/CollapsibleSection.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { MdExpandLess, MdExpandMore } from \"react-icons/md\";\nimport { cn } from \"../../utils/utils\";\n\ninterface CollapsibleSectionProps {\n title: string;\n expanded?: boolean;\n children: React.ReactNode;\n onToggle?: (expanded: boolean) => void;\n\n className?: string;\n classNameEnvelope?: string;\n classNameTitle?: string;\n}\n\nconst CollapsibleSection = ({\n title,\n expanded = true,\n children,\n onToggle,\n className,\n classNameEnvelope,\n classNameTitle,\n}: CollapsibleSectionProps) => {\n const [isExpanded, setIsExpanded] = useState(expanded);\n const isInitialMount = useRef(true);\n\n useEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n return;\n }\n onToggle?.(isExpanded);\n }, [isExpanded, onToggle]);\n\n return (\n <div className={cn(\"rounded-md shadow-lg border\", classNameEnvelope)}>\n <div\n className={cn(\n \"w-full justify-between border-b hover:bg-muted flex py-4 px-5 items-center cursor-pointer\",\n classNameTitle\n )}\n onClick={() => setIsExpanded((prev) => !prev)}\n >\n <div className=\"font-medium text-lg\">{title}</div>\n <div>\n {isExpanded ? (\n <MdExpandLess size={\"24px\"} className=\"text-gray-600\" />\n ) : (\n <MdExpandMore size={\"24px\"} className=\"text-gray-600\" />\n )}\n </div>\n </div>\n {isExpanded && <div className={cn(\"p-5\", className)}>{children}</div>}\n </div>\n );\n};\n\nexport default CollapsibleSection;\n"],"names":[],"mappings":";;;;AAeA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.js","sources":["../../../lib/components/layout/CollapsibleSection.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { MdExpandLess, MdExpandMore } from \"react-icons/md\";\nimport { cn } from \"../../utils/utils\";\n\ninterface CollapsibleSectionProps extends React.HTMLAttributes<HTMLDivElement> {\n title: string;\n expanded?: boolean;\n children: React.ReactNode;\n onToggle?: (expanded: boolean) => void;\n\n className?: string;\n classNameEnvelope?: string;\n classNameTitle?: string;\n}\n\nconst CollapsibleSection = ({\n title,\n expanded = true,\n children,\n onToggle,\n className,\n classNameEnvelope,\n classNameTitle,\n ...rest\n}: CollapsibleSectionProps) => {\n const [isExpanded, setIsExpanded] = useState(expanded);\n const isInitialMount = useRef(true);\n\n useEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n return;\n }\n onToggle?.(isExpanded);\n }, [isExpanded, onToggle]);\n\n return (\n <div className={cn(\"rounded-md shadow-lg border\", classNameEnvelope)} {...rest}>\n <div\n className={cn(\n \"w-full justify-between border-b hover:bg-muted flex py-4 px-5 items-center cursor-pointer\",\n classNameTitle\n )}\n onClick={() => setIsExpanded((prev) => !prev)}\n >\n <div className=\"font-medium text-lg\">{title}</div>\n <div>\n {isExpanded ? (\n <MdExpandLess size={\"24px\"} className=\"text-gray-600\" />\n ) : (\n <MdExpandMore size={\"24px\"} className=\"text-gray-600\" />\n )}\n </div>\n </div>\n {isExpanded && <div className={cn(\"p-5\", className)}>{children}</div>}\n </div>\n );\n};\n\nexport default CollapsibleSection;\n"],"names":[],"mappings":";;;;AAeA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA+B;AAC7B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,QAAQ;AAC/C,QAAA,iBAAiB,OAAO,IAAI;AAElC,YAAU,MAAM;AACd,QAAI,eAAe,SAAS;AAC1B,qBAAe,UAAU;AACzB;AAAA,IACF;AACA,yCAAW;AAAA,EAAU,GACpB,CAAC,YAAY,QAAQ,CAAC;AAGvB,SAAA,qBAAC,SAAI,WAAW,GAAG,+BAA+B,iBAAiB,GAAI,GAAG,MACxE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA,SAAS,MAAM,cAAc,CAAC,SAAS,CAAC,IAAI;AAAA,QAE5C,UAAA;AAAA,UAAC,oBAAA,OAAA,EAAI,WAAU,uBAAuB,UAAM,OAAA;AAAA,8BAC3C,OACE,EAAA,UAAA,aACE,oBAAA,cAAA,EAAa,MAAM,QAAQ,WAAU,iBAAgB,wBAErD,cAAa,EAAA,MAAM,QAAQ,WAAU,gBAAgB,CAAA,GAE1D;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,IACC,kCAAe,OAAI,EAAA,WAAW,GAAG,OAAO,SAAS,GAAI,UAAS;AAAA,EACjE,EAAA,CAAA;AAEJ;"}
|
|
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import { MdExpandLess, MdExpandMore } from "react-icons/md";
|
|
3
3
|
import { cn } from "../../utils/utils";
|
|
4
4
|
|
|
5
|
-
interface CollapsibleSectionProps {
|
|
5
|
+
interface CollapsibleSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
title: string;
|
|
7
7
|
expanded?: boolean;
|
|
8
8
|
children: React.ReactNode;
|
|
@@ -21,6 +21,7 @@ const CollapsibleSection = ({
|
|
|
21
21
|
className,
|
|
22
22
|
classNameEnvelope,
|
|
23
23
|
classNameTitle,
|
|
24
|
+
...rest
|
|
24
25
|
}: CollapsibleSectionProps) => {
|
|
25
26
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
26
27
|
const isInitialMount = useRef(true);
|
|
@@ -34,7 +35,7 @@ const CollapsibleSection = ({
|
|
|
34
35
|
}, [isExpanded, onToggle]);
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
|
-
<div className={cn("rounded-md shadow-lg border", classNameEnvelope)}>
|
|
38
|
+
<div className={cn("rounded-md shadow-lg border", classNameEnvelope)} {...rest}>
|
|
38
39
|
<div
|
|
39
40
|
className={cn(
|
|
40
41
|
"w-full justify-between border-b hover:bg-muted flex py-4 px-5 items-center cursor-pointer",
|