@agentiffai/design 1.3.20 → 1.3.21
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/index.cjs +118 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +118 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8543,6 +8543,7 @@ var PostPreviewCard = ({
|
|
|
8543
8543
|
isLoading = false
|
|
8544
8544
|
}) => {
|
|
8545
8545
|
const platformConfig = PLATFORM_CONFIGS[post.platform] || PLATFORM_CONFIGS.x;
|
|
8546
|
+
const [imageError, setImageError] = React4.useState(false);
|
|
8546
8547
|
const showSkeleton = isLoading && !post.content;
|
|
8547
8548
|
const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
|
|
8548
8549
|
const currentCharCount = displayContent.length;
|
|
@@ -8592,12 +8593,48 @@ var PostPreviewCard = ({
|
|
|
8592
8593
|
hashtag.replace(/^#/, "")
|
|
8593
8594
|
] }, hashtag)) })
|
|
8594
8595
|
] }),
|
|
8595
|
-
post.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8596
|
+
post.imageUrl && !imageError ? /* @__PURE__ */ jsxRuntime.jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8597
|
+
ImagePreview,
|
|
8598
|
+
{
|
|
8599
|
+
src: post.imageUrl,
|
|
8600
|
+
alt: "Post image preview",
|
|
8601
|
+
onError: () => setImageError(true)
|
|
8602
|
+
}
|
|
8603
|
+
) }) : post.imageUrl && imageError ? /* @__PURE__ */ jsxRuntime.jsxs(ImagePlaceholder, { children: [
|
|
8604
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8605
|
+
"svg",
|
|
8606
|
+
{
|
|
8607
|
+
viewBox: "0 0 24 24",
|
|
8608
|
+
fill: "none",
|
|
8609
|
+
stroke: "currentColor",
|
|
8610
|
+
strokeWidth: "2",
|
|
8611
|
+
role: "img",
|
|
8612
|
+
"aria-label": "Image unavailable",
|
|
8613
|
+
children: [
|
|
8614
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
8615
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
8616
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "21 15 16 10 5 21" })
|
|
8617
|
+
]
|
|
8618
|
+
}
|
|
8619
|
+
) }),
|
|
8620
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Image unavailable" })
|
|
8621
|
+
] }) : ["instagram", "linkedin", "facebook", "youtube"].includes(post.platform) && /* @__PURE__ */ jsxRuntime.jsxs(ImagePlaceholder, { children: [
|
|
8622
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8623
|
+
"svg",
|
|
8624
|
+
{
|
|
8625
|
+
viewBox: "0 0 24 24",
|
|
8626
|
+
fill: "none",
|
|
8627
|
+
stroke: "currentColor",
|
|
8628
|
+
strokeWidth: "2",
|
|
8629
|
+
role: "img",
|
|
8630
|
+
"aria-label": "No image attached",
|
|
8631
|
+
children: [
|
|
8632
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
8633
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
8634
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "21 15 16 10 5 21" })
|
|
8635
|
+
]
|
|
8636
|
+
}
|
|
8637
|
+
) }),
|
|
8601
8638
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "No image attached" })
|
|
8602
8639
|
] }),
|
|
8603
8640
|
/* @__PURE__ */ jsxRuntime.jsx(ProgressBarContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarTrack, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10323,6 +10360,11 @@ var ActionButton6 = styled48__default.default.button`
|
|
|
10323
10360
|
animation: ${pulse4} 2s ease-in-out infinite;
|
|
10324
10361
|
`}
|
|
10325
10362
|
`;
|
|
10363
|
+
var TYPE_ICONS = {
|
|
10364
|
+
input: "/assets/icon-set/Icon-arrow-up-fill.svg",
|
|
10365
|
+
output: "/assets/icon-set/Icon-download-2-fill.svg",
|
|
10366
|
+
system: "/assets/icon-set/Icon-settings-3-fill.svg"
|
|
10367
|
+
};
|
|
10326
10368
|
function formatNumber2(num) {
|
|
10327
10369
|
if (num >= 1e6) {
|
|
10328
10370
|
return `${(num / 1e6).toFixed(1)}M`;
|
|
@@ -10356,11 +10398,6 @@ var usageLevelColors = {
|
|
|
10356
10398
|
high: "#ff8c00",
|
|
10357
10399
|
critical: tokens.colors.error
|
|
10358
10400
|
};
|
|
10359
|
-
var typeIcons = {
|
|
10360
|
-
input: "\u2191",
|
|
10361
|
-
output: "\u2193",
|
|
10362
|
-
system: "\u2699"
|
|
10363
|
-
};
|
|
10364
10401
|
var typeColors = {
|
|
10365
10402
|
input: tokens.colors.info,
|
|
10366
10403
|
output: tokens.colors.success,
|
|
@@ -10372,13 +10409,38 @@ function TokenUsageCard({
|
|
|
10372
10409
|
transactions,
|
|
10373
10410
|
periodLabel,
|
|
10374
10411
|
onViewAll,
|
|
10375
|
-
className
|
|
10412
|
+
className,
|
|
10413
|
+
loading = false
|
|
10376
10414
|
}) {
|
|
10377
10415
|
const percentage = React4.useMemo(
|
|
10378
10416
|
() => Math.min(currentUsage / maxLimit * 100, 100),
|
|
10379
10417
|
[currentUsage, maxLimit]
|
|
10380
10418
|
);
|
|
10381
10419
|
const usageLevel = React4.useMemo(() => getUsageLevel(percentage), [percentage]);
|
|
10420
|
+
if (loading) {
|
|
10421
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card2, { className, "data-testid": "token-usage-card-loading", children: [
|
|
10422
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Header4, { children: [
|
|
10423
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "120px", $height: "20px" }),
|
|
10424
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "80px", $height: "16px" })
|
|
10425
|
+
] }),
|
|
10426
|
+
/* @__PURE__ */ jsxRuntime.jsxs(UsageSection, { children: [
|
|
10427
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "160px", $height: "28px" }),
|
|
10428
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "100%", $height: "8px", $radius: tokens.borderRadius.full }),
|
|
10429
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "80px", $height: "14px" })
|
|
10430
|
+
] }),
|
|
10431
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TransactionsSection, { children: [
|
|
10432
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "100px", $height: "14px" }),
|
|
10433
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionsList, { children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(TransactionItem, { children: [
|
|
10434
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "24px", $height: "24px", $radius: tokens.borderRadius.sm }),
|
|
10435
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TransactionInfo, { children: [
|
|
10436
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "70%", $height: "14px" }),
|
|
10437
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "50%", $height: "12px" })
|
|
10438
|
+
] }),
|
|
10439
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { $width: "32px", $height: "14px" })
|
|
10440
|
+
] }, i)) })
|
|
10441
|
+
] })
|
|
10442
|
+
] });
|
|
10443
|
+
}
|
|
10382
10444
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card2, { className, "data-testid": "token-usage-card", children: [
|
|
10383
10445
|
/* @__PURE__ */ jsxRuntime.jsxs(Header4, { children: [
|
|
10384
10446
|
/* @__PURE__ */ jsxRuntime.jsx(Title2, { children: "Token Usage" }),
|
|
@@ -10399,7 +10461,7 @@ function TokenUsageCard({
|
|
|
10399
10461
|
transactions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(TransactionsSection, { children: [
|
|
10400
10462
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionsHeader, { children: "Recent Activity" }),
|
|
10401
10463
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionsList, { children: transactions.slice(0, 5).map((transaction) => /* @__PURE__ */ jsxRuntime.jsxs(TransactionItem, { children: [
|
|
10402
|
-
/* @__PURE__ */ jsxRuntime.jsx(TransactionIcon, { $type: transaction.type, children:
|
|
10464
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionIcon, { $type: transaction.type, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: TYPE_ICONS[transaction.type], alt: "", width: 14, height: 14 }) }),
|
|
10403
10465
|
/* @__PURE__ */ jsxRuntime.jsxs(TransactionInfo, { children: [
|
|
10404
10466
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionDescription, { children: transaction.description }),
|
|
10405
10467
|
/* @__PURE__ */ jsxRuntime.jsxs(TransactionMeta, { children: [
|
|
@@ -10496,8 +10558,7 @@ var TransactionsSection = styled48__default.default.div`
|
|
|
10496
10558
|
display: flex;
|
|
10497
10559
|
flex-direction: column;
|
|
10498
10560
|
gap: ${tokens.spacing.sm};
|
|
10499
|
-
padding: ${tokens.spacing.md};
|
|
10500
|
-
padding-top: ${tokens.spacing.sm};
|
|
10561
|
+
padding: ${tokens.spacing.sm} ${tokens.spacing.md} ${tokens.spacing.md};
|
|
10501
10562
|
border-top: 1px solid ${tokens.colors.border.subtle};
|
|
10502
10563
|
`;
|
|
10503
10564
|
var TransactionsHeader = styled48__default.default.h4`
|
|
@@ -10517,8 +10578,14 @@ var TransactionItem = styled48__default.default.div`
|
|
|
10517
10578
|
align-items: center;
|
|
10518
10579
|
gap: ${tokens.spacing.sm};
|
|
10519
10580
|
padding: ${tokens.spacing.sm};
|
|
10520
|
-
background: ${tokens.colors.background.darker};
|
|
10521
10581
|
border-radius: ${tokens.borderRadius.sm};
|
|
10582
|
+
min-width: 0;
|
|
10583
|
+
overflow: hidden;
|
|
10584
|
+
transition: background-color ${tokens.transitions.fast};
|
|
10585
|
+
|
|
10586
|
+
&:hover {
|
|
10587
|
+
background-color: ${tokens.colors.surface.overlayHover};
|
|
10588
|
+
}
|
|
10522
10589
|
`;
|
|
10523
10590
|
var TransactionIcon = styled48__default.default.span`
|
|
10524
10591
|
width: 24px;
|
|
@@ -10526,14 +10593,26 @@ var TransactionIcon = styled48__default.default.span`
|
|
|
10526
10593
|
display: flex;
|
|
10527
10594
|
align-items: center;
|
|
10528
10595
|
justify-content: center;
|
|
10529
|
-
|
|
10530
|
-
color: ${({ $type }) => typeColors[$type]};
|
|
10596
|
+
flex-shrink: 0;
|
|
10531
10597
|
background: ${tokens.colors.background.light};
|
|
10532
10598
|
border-radius: ${tokens.borderRadius.sm};
|
|
10599
|
+
|
|
10600
|
+
img {
|
|
10601
|
+
filter: ${({ $type }) => {
|
|
10602
|
+
if ($type === "input") {
|
|
10603
|
+
return "brightness(0) saturate(100%) invert(55%) sepia(83%) saturate(1956%) hue-rotate(190deg) brightness(101%) contrast(101%)";
|
|
10604
|
+
}
|
|
10605
|
+
if ($type === "output") {
|
|
10606
|
+
return "brightness(0) saturate(100%) invert(73%) sepia(34%) saturate(547%) hue-rotate(99deg) brightness(91%) contrast(89%)";
|
|
10607
|
+
}
|
|
10608
|
+
return "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(85%)";
|
|
10609
|
+
}};
|
|
10610
|
+
}
|
|
10533
10611
|
`;
|
|
10534
10612
|
var TransactionInfo = styled48__default.default.div`
|
|
10535
10613
|
flex: 1;
|
|
10536
10614
|
min-width: 0;
|
|
10615
|
+
overflow: hidden;
|
|
10537
10616
|
`;
|
|
10538
10617
|
var TransactionDescription = styled48__default.default.div`
|
|
10539
10618
|
font-size: ${tokens.typography.fontSize.sm};
|
|
@@ -10549,12 +10628,20 @@ var TransactionMeta = styled48__default.default.div`
|
|
|
10549
10628
|
font-size: ${tokens.typography.fontSize.xs};
|
|
10550
10629
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10551
10630
|
color: ${tokens.colors.text.tertiary};
|
|
10631
|
+
overflow: hidden;
|
|
10632
|
+
|
|
10633
|
+
span {
|
|
10634
|
+
overflow: hidden;
|
|
10635
|
+
text-overflow: ellipsis;
|
|
10636
|
+
white-space: nowrap;
|
|
10637
|
+
}
|
|
10552
10638
|
`;
|
|
10553
10639
|
var TransactionTokens = styled48__default.default.span`
|
|
10554
10640
|
font-size: ${tokens.typography.fontSize.sm};
|
|
10555
10641
|
font-weight: ${tokens.typography.fontWeight.medium};
|
|
10556
10642
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10557
10643
|
color: ${({ $type }) => typeColors[$type]};
|
|
10644
|
+
flex-shrink: 0;
|
|
10558
10645
|
`;
|
|
10559
10646
|
var EmptyState4 = styled48__default.default.div`
|
|
10560
10647
|
text-align: center;
|
|
@@ -10581,6 +10668,17 @@ var ViewAllButton = styled48__default.default.button`
|
|
|
10581
10668
|
color: ${tokens.colors.text.primary};
|
|
10582
10669
|
}
|
|
10583
10670
|
`;
|
|
10671
|
+
var pulse5 = styled48.keyframes`
|
|
10672
|
+
0%, 100% { opacity: 1; }
|
|
10673
|
+
50% { opacity: 0.4; }
|
|
10674
|
+
`;
|
|
10675
|
+
var SkeletonBlock = styled48__default.default.div`
|
|
10676
|
+
width: ${({ $width }) => $width};
|
|
10677
|
+
height: ${({ $height }) => $height};
|
|
10678
|
+
background: ${tokens.colors.background.light};
|
|
10679
|
+
border-radius: ${({ $radius }) => $radius || tokens.borderRadius.sm};
|
|
10680
|
+
animation: ${pulse5} 1.5s ease-in-out infinite;
|
|
10681
|
+
`;
|
|
10584
10682
|
var WorkflowCard = ({
|
|
10585
10683
|
id,
|
|
10586
10684
|
name,
|
|
@@ -11571,7 +11669,7 @@ var spin = styled48.keyframes`
|
|
|
11571
11669
|
transform: rotate(360deg);
|
|
11572
11670
|
}
|
|
11573
11671
|
`;
|
|
11574
|
-
var
|
|
11672
|
+
var pulse6 = styled48.keyframes`
|
|
11575
11673
|
0%, 100% {
|
|
11576
11674
|
opacity: 1;
|
|
11577
11675
|
}
|
|
@@ -11649,7 +11747,7 @@ var IconContainer3 = styled48__default.default.div`
|
|
|
11649
11747
|
animation: ${(props) => {
|
|
11650
11748
|
if (props.$animated) {
|
|
11651
11749
|
if (props.$status === "running") return spin;
|
|
11652
|
-
if (props.$status === "pending") return
|
|
11750
|
+
if (props.$status === "pending") return pulse6;
|
|
11653
11751
|
}
|
|
11654
11752
|
return "none";
|
|
11655
11753
|
}}
|