caplink-saas-ui-shared-component-library 1.57.0 → 1.57.2
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.
|
@@ -8,11 +8,13 @@ export type FancyAccordionProps = {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
title: string;
|
|
10
10
|
description?: string;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
onToggle?(): void;
|
|
11
13
|
leftElement?: ReactNode;
|
|
12
14
|
rightElement?: (toggleButtonElement: ReactNode) => JSX.Element;
|
|
13
|
-
status
|
|
14
|
-
style
|
|
15
|
+
status?: FancyAccordionStatusEnum;
|
|
16
|
+
style?: CSSProperties;
|
|
15
17
|
defaultShowDescription?: boolean;
|
|
16
18
|
defaultShowContent?: boolean;
|
|
17
19
|
};
|
|
18
|
-
export declare function FancyAccordion({ className, title, description, status, style, children, leftElement, rightElement, defaultShowDescription, defaultShowContent, }: PropsWithChildren<FancyAccordionProps>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function FancyAccordion({ className, title, description, status, style, children, leftElement, rightElement, defaultShowDescription, defaultShowContent, isOpen, onToggle, }: PropsWithChildren<FancyAccordionProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -24370,47 +24370,55 @@ function l_e({
|
|
|
24370
24370
|
style: s = { width: "100%", maxWidth: 768 },
|
|
24371
24371
|
children: o,
|
|
24372
24372
|
leftElement: i,
|
|
24373
|
-
rightElement: a = (
|
|
24373
|
+
rightElement: a = (f) => /* @__PURE__ */ h.jsx(h.Fragment, { children: f }),
|
|
24374
24374
|
defaultShowDescription: l = !1,
|
|
24375
|
-
defaultShowContent: c = !0
|
|
24375
|
+
defaultShowContent: c = !0,
|
|
24376
|
+
isOpen: u,
|
|
24377
|
+
onToggle: d
|
|
24376
24378
|
}) {
|
|
24377
|
-
const [
|
|
24378
|
-
() =>
|
|
24379
|
-
[
|
|
24380
|
-
),
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24379
|
+
const [f, p] = se(c || u), [m, g] = se(l), [v, y] = se(!0), b = pe(), x = he(() => r === "Loading", [r]), w = he(() => r === "Success", [r]), { ref: C, checkOverflow: E, overflowInfo: _ } = Oq(1), T = he(
|
|
24380
|
+
() => _.hasOverflow || _.numberOfLines > 1,
|
|
24381
|
+
[_.hasOverflow, _.numberOfLines]
|
|
24382
|
+
), N = ne(() => {
|
|
24383
|
+
p((L) => !L), d?.();
|
|
24384
|
+
}, [d]), M = ne(() => {
|
|
24385
|
+
const L = !m;
|
|
24386
|
+
if (g(L), b.current && clearTimeout(b.current), L || v) {
|
|
24387
|
+
y(!1);
|
|
24384
24388
|
return;
|
|
24385
24389
|
}
|
|
24386
|
-
|
|
24387
|
-
|
|
24390
|
+
b.current = setTimeout(() => {
|
|
24391
|
+
y(!0);
|
|
24388
24392
|
}, 200);
|
|
24389
|
-
}, [
|
|
24393
|
+
}, [m, v]);
|
|
24390
24394
|
re(() => () => {
|
|
24391
|
-
|
|
24395
|
+
b.current && clearTimeout(b.current);
|
|
24392
24396
|
}, []);
|
|
24393
|
-
const
|
|
24397
|
+
const R = he(
|
|
24394
24398
|
() => $(
|
|
24395
|
-
"sl-border sl-relative sl-p-4 sl-rounded-lg",
|
|
24396
|
-
|
|
24399
|
+
"sl-border sl-relative sl-p-4 sl-rounded-lg sl-bg-white",
|
|
24400
|
+
w ? "sl-border-success-300" : x ? "" : "sl-border-foreground-v2-100 hover:sl-border-foreground-v2-500",
|
|
24397
24401
|
t
|
|
24398
24402
|
),
|
|
24399
|
-
[
|
|
24400
|
-
),
|
|
24401
|
-
() => o && !
|
|
24403
|
+
[w, x, t]
|
|
24404
|
+
), j = he(
|
|
24405
|
+
() => o && !x ? /* @__PURE__ */ h.jsx(
|
|
24402
24406
|
Xd.button,
|
|
24403
24407
|
{
|
|
24404
24408
|
"data-testid": "fancy-accordion-toggle-button",
|
|
24405
|
-
animate: { rotateX:
|
|
24409
|
+
animate: { rotateX: f ? 0 : 180 },
|
|
24406
24410
|
transition: { ease: "backInOut" },
|
|
24407
24411
|
type: "button",
|
|
24408
|
-
onClick:
|
|
24412
|
+
onClick: N,
|
|
24409
24413
|
children: /* @__PURE__ */ h.jsx(ub, { className: "sl-size-4 sl-text-foreground-v2-500" })
|
|
24410
24414
|
}
|
|
24411
24415
|
) : void 0,
|
|
24412
|
-
[o,
|
|
24413
|
-
)
|
|
24416
|
+
[o, x, f, N]
|
|
24417
|
+
);
|
|
24418
|
+
re(() => {
|
|
24419
|
+
p(c || u);
|
|
24420
|
+
}, [c, u]);
|
|
24421
|
+
const B = he(
|
|
24414
24422
|
() => /* @__PURE__ */ h.jsxs("div", { className: "sl-flex sl-items-start sl-justify-between sl-gap-4", children: [
|
|
24415
24423
|
/* @__PURE__ */ h.jsxs("div", { className: "sl-flex sl-items-start sl-gap-4", children: [
|
|
24416
24424
|
i,
|
|
@@ -24419,6 +24427,7 @@ function l_e({
|
|
|
24419
24427
|
"h3",
|
|
24420
24428
|
{
|
|
24421
24429
|
"data-testid": "fancy-accordion-title",
|
|
24430
|
+
"data-cypress": `task-view-${e}`,
|
|
24422
24431
|
className: $(
|
|
24423
24432
|
"sl-text-xl sl-font-bold sl-text-foreground-v2-700 sl-flex sl-items-center",
|
|
24424
24433
|
n ? "sl-h-auto" : "sl-h-[44px]"
|
|
@@ -24431,16 +24440,16 @@ function l_e({
|
|
|
24431
24440
|
{
|
|
24432
24441
|
"data-testid": "fancy-accordion-description-container",
|
|
24433
24442
|
className: "sl-overflow-hidden sl-w-full sl-h-[22px]",
|
|
24434
|
-
animate: { height:
|
|
24443
|
+
animate: { height: m ? "auto" : 22 },
|
|
24435
24444
|
children: /* @__PURE__ */ h.jsx(
|
|
24436
24445
|
"div",
|
|
24437
24446
|
{
|
|
24438
|
-
ref:
|
|
24447
|
+
ref: C,
|
|
24439
24448
|
className: $(
|
|
24440
24449
|
"sl-w-full sl-relative",
|
|
24441
|
-
!
|
|
24450
|
+
!m && v && "sl-line-clamp-1"
|
|
24442
24451
|
),
|
|
24443
|
-
onResize:
|
|
24452
|
+
onResize: E,
|
|
24444
24453
|
children: /* @__PURE__ */ h.jsx(
|
|
24445
24454
|
ane.Viewer,
|
|
24446
24455
|
{
|
|
@@ -24452,14 +24461,15 @@ function l_e({
|
|
|
24452
24461
|
)
|
|
24453
24462
|
}
|
|
24454
24463
|
),
|
|
24455
|
-
|
|
24464
|
+
T && /* @__PURE__ */ h.jsx(
|
|
24456
24465
|
"button",
|
|
24457
24466
|
{
|
|
24458
24467
|
"data-testid": "fancy-accordion-show-more-button",
|
|
24468
|
+
"data-cypress": `expand-task-${name}`,
|
|
24459
24469
|
type: "button",
|
|
24460
24470
|
className: "sl-text-info-300 sl-text-sm",
|
|
24461
|
-
onClick:
|
|
24462
|
-
children:
|
|
24471
|
+
onClick: M,
|
|
24472
|
+
children: m ? "Ver menos" : "Ver mais"
|
|
24463
24473
|
}
|
|
24464
24474
|
)
|
|
24465
24475
|
] })
|
|
@@ -24469,7 +24479,7 @@ function l_e({
|
|
|
24469
24479
|
{
|
|
24470
24480
|
"data-testid": "fancy-accordion-left-element",
|
|
24471
24481
|
className: "sl-h-[44px] sl-flex sl-items-center sl-shrink-0",
|
|
24472
|
-
children: a(
|
|
24482
|
+
children: a(j)
|
|
24473
24483
|
}
|
|
24474
24484
|
)
|
|
24475
24485
|
] }),
|
|
@@ -24478,42 +24488,42 @@ function l_e({
|
|
|
24478
24488
|
a,
|
|
24479
24489
|
e,
|
|
24480
24490
|
n,
|
|
24481
|
-
f,
|
|
24482
24491
|
m,
|
|
24483
|
-
|
|
24484
|
-
|
|
24492
|
+
v,
|
|
24493
|
+
C,
|
|
24485
24494
|
E,
|
|
24486
24495
|
T,
|
|
24487
|
-
M
|
|
24496
|
+
M,
|
|
24497
|
+
j
|
|
24488
24498
|
]
|
|
24489
|
-
),
|
|
24490
|
-
() => o && !
|
|
24499
|
+
), k = he(
|
|
24500
|
+
() => o && !x ? /* @__PURE__ */ h.jsx(
|
|
24491
24501
|
Xd.div,
|
|
24492
24502
|
{
|
|
24493
24503
|
"data-testid": "fancy-accordion-content",
|
|
24494
24504
|
className: $(
|
|
24495
24505
|
"sl-grid sl-w-full sl-gap-4 sl-overflow-hidden sl-h-auto sl-px-px sl-pb-px sl-text-md sl-text-foreground-v2-600",
|
|
24496
|
-
|
|
24506
|
+
f ? "" : "[&_*]:sl-border-0"
|
|
24497
24507
|
),
|
|
24498
24508
|
animate: {
|
|
24499
|
-
height:
|
|
24500
|
-
marginTop:
|
|
24509
|
+
height: f ? "auto" : 0,
|
|
24510
|
+
marginTop: f ? 16 : 0
|
|
24501
24511
|
},
|
|
24502
24512
|
children: o
|
|
24503
24513
|
}
|
|
24504
24514
|
) : void 0,
|
|
24505
|
-
[o,
|
|
24515
|
+
[o, x, f]
|
|
24506
24516
|
);
|
|
24507
|
-
return /* @__PURE__ */ h.jsxs("div", { "data-testid": "fancy-accordion-container", className:
|
|
24508
|
-
|
|
24517
|
+
return /* @__PURE__ */ h.jsxs("div", { "data-testid": "fancy-accordion-container", className: R, style: s, children: [
|
|
24518
|
+
x && /* @__PURE__ */ h.jsx(
|
|
24509
24519
|
dY,
|
|
24510
24520
|
{
|
|
24511
24521
|
className: "sl-bg-gradient-to-l sl-from-blue-700 sl-via-blue-500 sl-to-blue-200",
|
|
24512
24522
|
size: 140
|
|
24513
24523
|
}
|
|
24514
24524
|
),
|
|
24515
|
-
|
|
24516
|
-
|
|
24525
|
+
B,
|
|
24526
|
+
k
|
|
24517
24527
|
] });
|
|
24518
24528
|
}
|
|
24519
24529
|
function Sp(t) {
|