@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.d.cts
CHANGED
|
@@ -700,7 +700,9 @@ interface TokenUsageCardProps {
|
|
|
700
700
|
periodLabel: string;
|
|
701
701
|
onViewAll?: () => void;
|
|
702
702
|
className?: string;
|
|
703
|
+
/** Show loading skeleton state */
|
|
704
|
+
loading?: boolean;
|
|
703
705
|
}
|
|
704
|
-
declare function TokenUsageCard({ currentUsage, maxLimit, transactions, periodLabel, onViewAll, className, }: TokenUsageCardProps): React__default.ReactElement;
|
|
706
|
+
declare function TokenUsageCard({ currentUsage, maxLimit, transactions, periodLabel, onViewAll, className, loading, }: TokenUsageCardProps): React__default.ReactElement;
|
|
705
707
|
|
|
706
708
|
export { type ApprovalStatus, AssistantThinking, type AssistantThinkingProps, CATEGORY_CONFIGS, type CategoryConfig, ChatInput, type ChatInputProps, ConnectionStatusBadge, type ConnectionStatusBadgeProps, DarkNotificationCard, type EngagementOpportunity, type EngagementStatus, IntegrationCard, type IntegrationCardProps, NotificationCard, type NotificationCardProps, type NotificationItem, type NotificationSection, PLATFORM_CONFIGS, type Platform, PlatformCarousel, type PlatformCarouselProps, type PlatformConfig, PlatformGrid, type PlatformGridProps, PostApprovalControls, type PostApprovalControlsProps, PostPreviewCard, type PostPreviewCardProps, type PostViewMode, type ProgressCategory, type ProposedPost, RedditEngagementControls, type RedditEngagementControlsProps, RedditOpportunityCard, type RedditOpportunityCardProps, type ReplyTone, SecretInput, type SecretInputProps, SocialMediaCanvas, type SocialMediaCanvasProps, type TokenTransaction, TokenUsageCard, type TokenUsageCardProps, UserMessage, type UserMessageProps, categorizeProgress, getCategoryColor, getCategoryIcon, getCharacterCount, getCharacterLimitColor, getCharacterLimitPercentage, isWithinCharLimit, normalizePlatform };
|
package/dist/index.d.ts
CHANGED
|
@@ -700,7 +700,9 @@ interface TokenUsageCardProps {
|
|
|
700
700
|
periodLabel: string;
|
|
701
701
|
onViewAll?: () => void;
|
|
702
702
|
className?: string;
|
|
703
|
+
/** Show loading skeleton state */
|
|
704
|
+
loading?: boolean;
|
|
703
705
|
}
|
|
704
|
-
declare function TokenUsageCard({ currentUsage, maxLimit, transactions, periodLabel, onViewAll, className, }: TokenUsageCardProps): React__default.ReactElement;
|
|
706
|
+
declare function TokenUsageCard({ currentUsage, maxLimit, transactions, periodLabel, onViewAll, className, loading, }: TokenUsageCardProps): React__default.ReactElement;
|
|
705
707
|
|
|
706
708
|
export { type ApprovalStatus, AssistantThinking, type AssistantThinkingProps, CATEGORY_CONFIGS, type CategoryConfig, ChatInput, type ChatInputProps, ConnectionStatusBadge, type ConnectionStatusBadgeProps, DarkNotificationCard, type EngagementOpportunity, type EngagementStatus, IntegrationCard, type IntegrationCardProps, NotificationCard, type NotificationCardProps, type NotificationItem, type NotificationSection, PLATFORM_CONFIGS, type Platform, PlatformCarousel, type PlatformCarouselProps, type PlatformConfig, PlatformGrid, type PlatformGridProps, PostApprovalControls, type PostApprovalControlsProps, PostPreviewCard, type PostPreviewCardProps, type PostViewMode, type ProgressCategory, type ProposedPost, RedditEngagementControls, type RedditEngagementControlsProps, RedditOpportunityCard, type RedditOpportunityCardProps, type ReplyTone, SecretInput, type SecretInputProps, SocialMediaCanvas, type SocialMediaCanvasProps, type TokenTransaction, TokenUsageCard, type TokenUsageCardProps, UserMessage, type UserMessageProps, categorizeProgress, getCategoryColor, getCategoryIcon, getCharacterCount, getCharacterLimitColor, getCharacterLimitPercentage, isWithinCharLimit, normalizePlatform };
|
package/dist/index.js
CHANGED
|
@@ -4337,6 +4337,7 @@ var Container10 = styled48.div`
|
|
|
4337
4337
|
display: flex;
|
|
4338
4338
|
align-items: center;
|
|
4339
4339
|
width: 100%;
|
|
4340
|
+
min-width: 0;
|
|
4340
4341
|
`;
|
|
4341
4342
|
var Input = styled48.input`
|
|
4342
4343
|
width: 100%;
|
|
@@ -8535,6 +8536,7 @@ var PostPreviewCard = ({
|
|
|
8535
8536
|
isLoading = false
|
|
8536
8537
|
}) => {
|
|
8537
8538
|
const platformConfig = PLATFORM_CONFIGS[post.platform] || PLATFORM_CONFIGS.x;
|
|
8539
|
+
const [imageError, setImageError] = useState(false);
|
|
8538
8540
|
const showSkeleton = isLoading && !post.content;
|
|
8539
8541
|
const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
|
|
8540
8542
|
const currentCharCount = displayContent.length;
|
|
@@ -8584,12 +8586,48 @@ var PostPreviewCard = ({
|
|
|
8584
8586
|
hashtag.replace(/^#/, "")
|
|
8585
8587
|
] }, hashtag)) })
|
|
8586
8588
|
] }),
|
|
8587
|
-
post.imageUrl ? /* @__PURE__ */ jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsx(
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8589
|
+
post.imageUrl && !imageError ? /* @__PURE__ */ jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsx(
|
|
8590
|
+
ImagePreview,
|
|
8591
|
+
{
|
|
8592
|
+
src: post.imageUrl,
|
|
8593
|
+
alt: "Post image preview",
|
|
8594
|
+
onError: () => setImageError(true)
|
|
8595
|
+
}
|
|
8596
|
+
) }) : post.imageUrl && imageError ? /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
|
|
8597
|
+
/* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
|
|
8598
|
+
"svg",
|
|
8599
|
+
{
|
|
8600
|
+
viewBox: "0 0 24 24",
|
|
8601
|
+
fill: "none",
|
|
8602
|
+
stroke: "currentColor",
|
|
8603
|
+
strokeWidth: "2",
|
|
8604
|
+
role: "img",
|
|
8605
|
+
"aria-label": "Image unavailable",
|
|
8606
|
+
children: [
|
|
8607
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
8608
|
+
/* @__PURE__ */ jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
8609
|
+
/* @__PURE__ */ jsx("polyline", { points: "21 15 16 10 5 21" })
|
|
8610
|
+
]
|
|
8611
|
+
}
|
|
8612
|
+
) }),
|
|
8613
|
+
/* @__PURE__ */ jsx("span", { children: "Image unavailable" })
|
|
8614
|
+
] }) : ["instagram", "linkedin", "facebook", "youtube"].includes(post.platform) && /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
|
|
8615
|
+
/* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
|
|
8616
|
+
"svg",
|
|
8617
|
+
{
|
|
8618
|
+
viewBox: "0 0 24 24",
|
|
8619
|
+
fill: "none",
|
|
8620
|
+
stroke: "currentColor",
|
|
8621
|
+
strokeWidth: "2",
|
|
8622
|
+
role: "img",
|
|
8623
|
+
"aria-label": "No image attached",
|
|
8624
|
+
children: [
|
|
8625
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
8626
|
+
/* @__PURE__ */ jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
8627
|
+
/* @__PURE__ */ jsx("polyline", { points: "21 15 16 10 5 21" })
|
|
8628
|
+
]
|
|
8629
|
+
}
|
|
8630
|
+
) }),
|
|
8593
8631
|
/* @__PURE__ */ jsx("span", { children: "No image attached" })
|
|
8594
8632
|
] }),
|
|
8595
8633
|
/* @__PURE__ */ jsx(ProgressBarContainer, { children: /* @__PURE__ */ jsx(ProgressBarTrack, { children: /* @__PURE__ */ jsx(
|
|
@@ -10315,6 +10353,11 @@ var ActionButton6 = styled48.button`
|
|
|
10315
10353
|
animation: ${pulse4} 2s ease-in-out infinite;
|
|
10316
10354
|
`}
|
|
10317
10355
|
`;
|
|
10356
|
+
var TYPE_ICONS = {
|
|
10357
|
+
input: "/assets/icon-set/Icon-arrow-up-fill.svg",
|
|
10358
|
+
output: "/assets/icon-set/Icon-download-2-fill.svg",
|
|
10359
|
+
system: "/assets/icon-set/Icon-settings-3-fill.svg"
|
|
10360
|
+
};
|
|
10318
10361
|
function formatNumber2(num) {
|
|
10319
10362
|
if (num >= 1e6) {
|
|
10320
10363
|
return `${(num / 1e6).toFixed(1)}M`;
|
|
@@ -10348,11 +10391,6 @@ var usageLevelColors = {
|
|
|
10348
10391
|
high: "#ff8c00",
|
|
10349
10392
|
critical: tokens.colors.error
|
|
10350
10393
|
};
|
|
10351
|
-
var typeIcons = {
|
|
10352
|
-
input: "\u2191",
|
|
10353
|
-
output: "\u2193",
|
|
10354
|
-
system: "\u2699"
|
|
10355
|
-
};
|
|
10356
10394
|
var typeColors = {
|
|
10357
10395
|
input: tokens.colors.info,
|
|
10358
10396
|
output: tokens.colors.success,
|
|
@@ -10364,13 +10402,38 @@ function TokenUsageCard({
|
|
|
10364
10402
|
transactions,
|
|
10365
10403
|
periodLabel,
|
|
10366
10404
|
onViewAll,
|
|
10367
|
-
className
|
|
10405
|
+
className,
|
|
10406
|
+
loading = false
|
|
10368
10407
|
}) {
|
|
10369
10408
|
const percentage = useMemo(
|
|
10370
10409
|
() => Math.min(currentUsage / maxLimit * 100, 100),
|
|
10371
10410
|
[currentUsage, maxLimit]
|
|
10372
10411
|
);
|
|
10373
10412
|
const usageLevel = useMemo(() => getUsageLevel(percentage), [percentage]);
|
|
10413
|
+
if (loading) {
|
|
10414
|
+
return /* @__PURE__ */ jsxs(Card2, { className, "data-testid": "token-usage-card-loading", children: [
|
|
10415
|
+
/* @__PURE__ */ jsxs(Header4, { children: [
|
|
10416
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "120px", $height: "20px" }),
|
|
10417
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "80px", $height: "16px" })
|
|
10418
|
+
] }),
|
|
10419
|
+
/* @__PURE__ */ jsxs(UsageSection, { children: [
|
|
10420
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "160px", $height: "28px" }),
|
|
10421
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "100%", $height: "8px", $radius: tokens.borderRadius.full }),
|
|
10422
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "80px", $height: "14px" })
|
|
10423
|
+
] }),
|
|
10424
|
+
/* @__PURE__ */ jsxs(TransactionsSection, { children: [
|
|
10425
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "100px", $height: "14px" }),
|
|
10426
|
+
/* @__PURE__ */ jsx(TransactionsList, { children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs(TransactionItem, { children: [
|
|
10427
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "24px", $height: "24px", $radius: tokens.borderRadius.sm }),
|
|
10428
|
+
/* @__PURE__ */ jsxs(TransactionInfo, { children: [
|
|
10429
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "70%", $height: "14px" }),
|
|
10430
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "50%", $height: "12px" })
|
|
10431
|
+
] }),
|
|
10432
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { $width: "32px", $height: "14px" })
|
|
10433
|
+
] }, i)) })
|
|
10434
|
+
] })
|
|
10435
|
+
] });
|
|
10436
|
+
}
|
|
10374
10437
|
return /* @__PURE__ */ jsxs(Card2, { className, "data-testid": "token-usage-card", children: [
|
|
10375
10438
|
/* @__PURE__ */ jsxs(Header4, { children: [
|
|
10376
10439
|
/* @__PURE__ */ jsx(Title2, { children: "Token Usage" }),
|
|
@@ -10391,7 +10454,7 @@ function TokenUsageCard({
|
|
|
10391
10454
|
transactions.length > 0 && /* @__PURE__ */ jsxs(TransactionsSection, { children: [
|
|
10392
10455
|
/* @__PURE__ */ jsx(TransactionsHeader, { children: "Recent Activity" }),
|
|
10393
10456
|
/* @__PURE__ */ jsx(TransactionsList, { children: transactions.slice(0, 5).map((transaction) => /* @__PURE__ */ jsxs(TransactionItem, { children: [
|
|
10394
|
-
/* @__PURE__ */ jsx(TransactionIcon, { $type: transaction.type, children:
|
|
10457
|
+
/* @__PURE__ */ jsx(TransactionIcon, { $type: transaction.type, children: /* @__PURE__ */ jsx("img", { src: TYPE_ICONS[transaction.type], alt: "", width: 14, height: 14 }) }),
|
|
10395
10458
|
/* @__PURE__ */ jsxs(TransactionInfo, { children: [
|
|
10396
10459
|
/* @__PURE__ */ jsx(TransactionDescription, { children: transaction.description }),
|
|
10397
10460
|
/* @__PURE__ */ jsxs(TransactionMeta, { children: [
|
|
@@ -10488,8 +10551,7 @@ var TransactionsSection = styled48.div`
|
|
|
10488
10551
|
display: flex;
|
|
10489
10552
|
flex-direction: column;
|
|
10490
10553
|
gap: ${tokens.spacing.sm};
|
|
10491
|
-
padding: ${tokens.spacing.md};
|
|
10492
|
-
padding-top: ${tokens.spacing.sm};
|
|
10554
|
+
padding: ${tokens.spacing.sm} ${tokens.spacing.md} ${tokens.spacing.md};
|
|
10493
10555
|
border-top: 1px solid ${tokens.colors.border.subtle};
|
|
10494
10556
|
`;
|
|
10495
10557
|
var TransactionsHeader = styled48.h4`
|
|
@@ -10509,8 +10571,14 @@ var TransactionItem = styled48.div`
|
|
|
10509
10571
|
align-items: center;
|
|
10510
10572
|
gap: ${tokens.spacing.sm};
|
|
10511
10573
|
padding: ${tokens.spacing.sm};
|
|
10512
|
-
background: ${tokens.colors.background.darker};
|
|
10513
10574
|
border-radius: ${tokens.borderRadius.sm};
|
|
10575
|
+
min-width: 0;
|
|
10576
|
+
overflow: hidden;
|
|
10577
|
+
transition: background-color ${tokens.transitions.fast};
|
|
10578
|
+
|
|
10579
|
+
&:hover {
|
|
10580
|
+
background-color: ${tokens.colors.surface.overlayHover};
|
|
10581
|
+
}
|
|
10514
10582
|
`;
|
|
10515
10583
|
var TransactionIcon = styled48.span`
|
|
10516
10584
|
width: 24px;
|
|
@@ -10518,14 +10586,26 @@ var TransactionIcon = styled48.span`
|
|
|
10518
10586
|
display: flex;
|
|
10519
10587
|
align-items: center;
|
|
10520
10588
|
justify-content: center;
|
|
10521
|
-
|
|
10522
|
-
color: ${({ $type }) => typeColors[$type]};
|
|
10589
|
+
flex-shrink: 0;
|
|
10523
10590
|
background: ${tokens.colors.background.light};
|
|
10524
10591
|
border-radius: ${tokens.borderRadius.sm};
|
|
10592
|
+
|
|
10593
|
+
img {
|
|
10594
|
+
filter: ${({ $type }) => {
|
|
10595
|
+
if ($type === "input") {
|
|
10596
|
+
return "brightness(0) saturate(100%) invert(55%) sepia(83%) saturate(1956%) hue-rotate(190deg) brightness(101%) contrast(101%)";
|
|
10597
|
+
}
|
|
10598
|
+
if ($type === "output") {
|
|
10599
|
+
return "brightness(0) saturate(100%) invert(73%) sepia(34%) saturate(547%) hue-rotate(99deg) brightness(91%) contrast(89%)";
|
|
10600
|
+
}
|
|
10601
|
+
return "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(85%)";
|
|
10602
|
+
}};
|
|
10603
|
+
}
|
|
10525
10604
|
`;
|
|
10526
10605
|
var TransactionInfo = styled48.div`
|
|
10527
10606
|
flex: 1;
|
|
10528
10607
|
min-width: 0;
|
|
10608
|
+
overflow: hidden;
|
|
10529
10609
|
`;
|
|
10530
10610
|
var TransactionDescription = styled48.div`
|
|
10531
10611
|
font-size: ${tokens.typography.fontSize.sm};
|
|
@@ -10541,12 +10621,20 @@ var TransactionMeta = styled48.div`
|
|
|
10541
10621
|
font-size: ${tokens.typography.fontSize.xs};
|
|
10542
10622
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10543
10623
|
color: ${tokens.colors.text.tertiary};
|
|
10624
|
+
overflow: hidden;
|
|
10625
|
+
|
|
10626
|
+
span {
|
|
10627
|
+
overflow: hidden;
|
|
10628
|
+
text-overflow: ellipsis;
|
|
10629
|
+
white-space: nowrap;
|
|
10630
|
+
}
|
|
10544
10631
|
`;
|
|
10545
10632
|
var TransactionTokens = styled48.span`
|
|
10546
10633
|
font-size: ${tokens.typography.fontSize.sm};
|
|
10547
10634
|
font-weight: ${tokens.typography.fontWeight.medium};
|
|
10548
10635
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
10549
10636
|
color: ${({ $type }) => typeColors[$type]};
|
|
10637
|
+
flex-shrink: 0;
|
|
10550
10638
|
`;
|
|
10551
10639
|
var EmptyState4 = styled48.div`
|
|
10552
10640
|
text-align: center;
|
|
@@ -10573,6 +10661,17 @@ var ViewAllButton = styled48.button`
|
|
|
10573
10661
|
color: ${tokens.colors.text.primary};
|
|
10574
10662
|
}
|
|
10575
10663
|
`;
|
|
10664
|
+
var pulse5 = keyframes`
|
|
10665
|
+
0%, 100% { opacity: 1; }
|
|
10666
|
+
50% { opacity: 0.4; }
|
|
10667
|
+
`;
|
|
10668
|
+
var SkeletonBlock = styled48.div`
|
|
10669
|
+
width: ${({ $width }) => $width};
|
|
10670
|
+
height: ${({ $height }) => $height};
|
|
10671
|
+
background: ${tokens.colors.background.light};
|
|
10672
|
+
border-radius: ${({ $radius }) => $radius || tokens.borderRadius.sm};
|
|
10673
|
+
animation: ${pulse5} 1.5s ease-in-out infinite;
|
|
10674
|
+
`;
|
|
10576
10675
|
var WorkflowCard = ({
|
|
10577
10676
|
id,
|
|
10578
10677
|
name,
|
|
@@ -11563,7 +11662,7 @@ var spin = keyframes`
|
|
|
11563
11662
|
transform: rotate(360deg);
|
|
11564
11663
|
}
|
|
11565
11664
|
`;
|
|
11566
|
-
var
|
|
11665
|
+
var pulse6 = keyframes`
|
|
11567
11666
|
0%, 100% {
|
|
11568
11667
|
opacity: 1;
|
|
11569
11668
|
}
|
|
@@ -11641,7 +11740,7 @@ var IconContainer3 = styled48.div`
|
|
|
11641
11740
|
animation: ${(props) => {
|
|
11642
11741
|
if (props.$animated) {
|
|
11643
11742
|
if (props.$status === "running") return spin;
|
|
11644
|
-
if (props.$status === "pending") return
|
|
11743
|
+
if (props.$status === "pending") return pulse6;
|
|
11645
11744
|
}
|
|
11646
11745
|
return "none";
|
|
11647
11746
|
}}
|