@agentiffai/design 1.3.19 → 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 +119 -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 +119 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4344,6 +4344,7 @@ var Container10 = styled48__default.default.div`
|
|
|
4344
4344
|
display: flex;
|
|
4345
4345
|
align-items: center;
|
|
4346
4346
|
width: 100%;
|
|
4347
|
+
min-width: 0;
|
|
4347
4348
|
`;
|
|
4348
4349
|
var Input = styled48__default.default.input`
|
|
4349
4350
|
width: 100%;
|
|
@@ -8542,6 +8543,7 @@ var PostPreviewCard = ({
|
|
|
8542
8543
|
isLoading = false
|
|
8543
8544
|
}) => {
|
|
8544
8545
|
const platformConfig = PLATFORM_CONFIGS[post.platform] || PLATFORM_CONFIGS.x;
|
|
8546
|
+
const [imageError, setImageError] = React4.useState(false);
|
|
8545
8547
|
const showSkeleton = isLoading && !post.content;
|
|
8546
8548
|
const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
|
|
8547
8549
|
const currentCharCount = displayContent.length;
|
|
@@ -8591,12 +8593,48 @@ var PostPreviewCard = ({
|
|
|
8591
8593
|
hashtag.replace(/^#/, "")
|
|
8592
8594
|
] }, hashtag)) })
|
|
8593
8595
|
] }),
|
|
8594
|
-
post.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
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
|
+
) }),
|
|
8600
8638
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "No image attached" })
|
|
8601
8639
|
] }),
|
|
8602
8640
|
/* @__PURE__ */ jsxRuntime.jsx(ProgressBarContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarTrack, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10322,6 +10360,11 @@ var ActionButton6 = styled48__default.default.button`
|
|
|
10322
10360
|
animation: ${pulse4} 2s ease-in-out infinite;
|
|
10323
10361
|
`}
|
|
10324
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
|
+
};
|
|
10325
10368
|
function formatNumber2(num) {
|
|
10326
10369
|
if (num >= 1e6) {
|
|
10327
10370
|
return `${(num / 1e6).toFixed(1)}M`;
|
|
@@ -10355,11 +10398,6 @@ var usageLevelColors = {
|
|
|
10355
10398
|
high: "#ff8c00",
|
|
10356
10399
|
critical: tokens.colors.error
|
|
10357
10400
|
};
|
|
10358
|
-
var typeIcons = {
|
|
10359
|
-
input: "\u2191",
|
|
10360
|
-
output: "\u2193",
|
|
10361
|
-
system: "\u2699"
|
|
10362
|
-
};
|
|
10363
10401
|
var typeColors = {
|
|
10364
10402
|
input: tokens.colors.info,
|
|
10365
10403
|
output: tokens.colors.success,
|
|
@@ -10371,13 +10409,38 @@ function TokenUsageCard({
|
|
|
10371
10409
|
transactions,
|
|
10372
10410
|
periodLabel,
|
|
10373
10411
|
onViewAll,
|
|
10374
|
-
className
|
|
10412
|
+
className,
|
|
10413
|
+
loading = false
|
|
10375
10414
|
}) {
|
|
10376
10415
|
const percentage = React4.useMemo(
|
|
10377
10416
|
() => Math.min(currentUsage / maxLimit * 100, 100),
|
|
10378
10417
|
[currentUsage, maxLimit]
|
|
10379
10418
|
);
|
|
10380
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
|
+
}
|
|
10381
10444
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card2, { className, "data-testid": "token-usage-card", children: [
|
|
10382
10445
|
/* @__PURE__ */ jsxRuntime.jsxs(Header4, { children: [
|
|
10383
10446
|
/* @__PURE__ */ jsxRuntime.jsx(Title2, { children: "Token Usage" }),
|
|
@@ -10398,7 +10461,7 @@ function TokenUsageCard({
|
|
|
10398
10461
|
transactions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(TransactionsSection, { children: [
|
|
10399
10462
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionsHeader, { children: "Recent Activity" }),
|
|
10400
10463
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionsList, { children: transactions.slice(0, 5).map((transaction) => /* @__PURE__ */ jsxRuntime.jsxs(TransactionItem, { children: [
|
|
10401
|
-
/* @__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 }) }),
|
|
10402
10465
|
/* @__PURE__ */ jsxRuntime.jsxs(TransactionInfo, { children: [
|
|
10403
10466
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionDescription, { children: transaction.description }),
|
|
10404
10467
|
/* @__PURE__ */ jsxRuntime.jsxs(TransactionMeta, { children: [
|
|
@@ -10495,8 +10558,7 @@ var TransactionsSection = styled48__default.default.div`
|
|
|
10495
10558
|
display: flex;
|
|
10496
10559
|
flex-direction: column;
|
|
10497
10560
|
gap: ${tokens.spacing.sm};
|
|
10498
|
-
padding: ${tokens.spacing.md};
|
|
10499
|
-
padding-top: ${tokens.spacing.sm};
|
|
10561
|
+
padding: ${tokens.spacing.sm} ${tokens.spacing.md} ${tokens.spacing.md};
|
|
10500
10562
|
border-top: 1px solid ${tokens.colors.border.subtle};
|
|
10501
10563
|
`;
|
|
10502
10564
|
var TransactionsHeader = styled48__default.default.h4`
|
|
@@ -10516,8 +10578,14 @@ var TransactionItem = styled48__default.default.div`
|
|
|
10516
10578
|
align-items: center;
|
|
10517
10579
|
gap: ${tokens.spacing.sm};
|
|
10518
10580
|
padding: ${tokens.spacing.sm};
|
|
10519
|
-
background: ${tokens.colors.background.darker};
|
|
10520
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
|
+
}
|
|
10521
10589
|
`;
|
|
10522
10590
|
var TransactionIcon = styled48__default.default.span`
|
|
10523
10591
|
width: 24px;
|
|
@@ -10525,14 +10593,26 @@ var TransactionIcon = styled48__default.default.span`
|
|
|
10525
10593
|
display: flex;
|
|
10526
10594
|
align-items: center;
|
|
10527
10595
|
justify-content: center;
|
|
10528
|
-
|
|
10529
|
-
color: ${({ $type }) => typeColors[$type]};
|
|
10596
|
+
flex-shrink: 0;
|
|
10530
10597
|
background: ${tokens.colors.background.light};
|
|
10531
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
|
+
}
|
|
10532
10611
|
`;
|
|
10533
10612
|
var TransactionInfo = styled48__default.default.div`
|
|
10534
10613
|
flex: 1;
|
|
10535
10614
|
min-width: 0;
|
|
10615
|
+
overflow: hidden;
|
|
10536
10616
|
`;
|
|
10537
10617
|
var TransactionDescription = styled48__default.default.div`
|
|
10538
10618
|
font-size: ${tokens.typography.fontSize.sm};
|
|
@@ -10548,12 +10628,20 @@ var TransactionMeta = styled48__default.default.div`
|
|
|
10548
10628
|
font-size: ${tokens.typography.fontSize.xs};
|
|
10549
10629
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10550
10630
|
color: ${tokens.colors.text.tertiary};
|
|
10631
|
+
overflow: hidden;
|
|
10632
|
+
|
|
10633
|
+
span {
|
|
10634
|
+
overflow: hidden;
|
|
10635
|
+
text-overflow: ellipsis;
|
|
10636
|
+
white-space: nowrap;
|
|
10637
|
+
}
|
|
10551
10638
|
`;
|
|
10552
10639
|
var TransactionTokens = styled48__default.default.span`
|
|
10553
10640
|
font-size: ${tokens.typography.fontSize.sm};
|
|
10554
10641
|
font-weight: ${tokens.typography.fontWeight.medium};
|
|
10555
10642
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10556
10643
|
color: ${({ $type }) => typeColors[$type]};
|
|
10644
|
+
flex-shrink: 0;
|
|
10557
10645
|
`;
|
|
10558
10646
|
var EmptyState4 = styled48__default.default.div`
|
|
10559
10647
|
text-align: center;
|
|
@@ -10580,6 +10668,17 @@ var ViewAllButton = styled48__default.default.button`
|
|
|
10580
10668
|
color: ${tokens.colors.text.primary};
|
|
10581
10669
|
}
|
|
10582
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
|
+
`;
|
|
10583
10682
|
var WorkflowCard = ({
|
|
10584
10683
|
id,
|
|
10585
10684
|
name,
|
|
@@ -11570,7 +11669,7 @@ var spin = styled48.keyframes`
|
|
|
11570
11669
|
transform: rotate(360deg);
|
|
11571
11670
|
}
|
|
11572
11671
|
`;
|
|
11573
|
-
var
|
|
11672
|
+
var pulse6 = styled48.keyframes`
|
|
11574
11673
|
0%, 100% {
|
|
11575
11674
|
opacity: 1;
|
|
11576
11675
|
}
|
|
@@ -11648,7 +11747,7 @@ var IconContainer3 = styled48__default.default.div`
|
|
|
11648
11747
|
animation: ${(props) => {
|
|
11649
11748
|
if (props.$animated) {
|
|
11650
11749
|
if (props.$status === "running") return spin;
|
|
11651
|
-
if (props.$status === "pending") return
|
|
11750
|
+
if (props.$status === "pending") return pulse6;
|
|
11652
11751
|
}
|
|
11653
11752
|
return "none";
|
|
11654
11753
|
}}
|