@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.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
@@ -8536,6 +8536,7 @@ var PostPreviewCard = ({
8536
8536
  isLoading = false
8537
8537
  }) => {
8538
8538
  const platformConfig = PLATFORM_CONFIGS[post.platform] || PLATFORM_CONFIGS.x;
8539
+ const [imageError, setImageError] = useState(false);
8539
8540
  const showSkeleton = isLoading && !post.content;
8540
8541
  const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
8541
8542
  const currentCharCount = displayContent.length;
@@ -8585,12 +8586,48 @@ var PostPreviewCard = ({
8585
8586
  hashtag.replace(/^#/, "")
8586
8587
  ] }, hashtag)) })
8587
8588
  ] }),
8588
- post.imageUrl ? /* @__PURE__ */ jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsx(ImagePreview, { src: post.imageUrl, alt: "Post image preview" }) }) : ["instagram", "linkedin", "facebook", "youtube"].includes(post.platform) && /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
8589
- /* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
8590
- /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
8591
- /* @__PURE__ */ jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
8592
- /* @__PURE__ */ jsx("polyline", { points: "21 15 16 10 5 21" })
8593
- ] }) }),
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
+ ) }),
8594
8631
  /* @__PURE__ */ jsx("span", { children: "No image attached" })
8595
8632
  ] }),
8596
8633
  /* @__PURE__ */ jsx(ProgressBarContainer, { children: /* @__PURE__ */ jsx(ProgressBarTrack, { children: /* @__PURE__ */ jsx(
@@ -10316,6 +10353,11 @@ var ActionButton6 = styled48.button`
10316
10353
  animation: ${pulse4} 2s ease-in-out infinite;
10317
10354
  `}
10318
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
+ };
10319
10361
  function formatNumber2(num) {
10320
10362
  if (num >= 1e6) {
10321
10363
  return `${(num / 1e6).toFixed(1)}M`;
@@ -10349,11 +10391,6 @@ var usageLevelColors = {
10349
10391
  high: "#ff8c00",
10350
10392
  critical: tokens.colors.error
10351
10393
  };
10352
- var typeIcons = {
10353
- input: "\u2191",
10354
- output: "\u2193",
10355
- system: "\u2699"
10356
- };
10357
10394
  var typeColors = {
10358
10395
  input: tokens.colors.info,
10359
10396
  output: tokens.colors.success,
@@ -10365,13 +10402,38 @@ function TokenUsageCard({
10365
10402
  transactions,
10366
10403
  periodLabel,
10367
10404
  onViewAll,
10368
- className
10405
+ className,
10406
+ loading = false
10369
10407
  }) {
10370
10408
  const percentage = useMemo(
10371
10409
  () => Math.min(currentUsage / maxLimit * 100, 100),
10372
10410
  [currentUsage, maxLimit]
10373
10411
  );
10374
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
+ }
10375
10437
  return /* @__PURE__ */ jsxs(Card2, { className, "data-testid": "token-usage-card", children: [
10376
10438
  /* @__PURE__ */ jsxs(Header4, { children: [
10377
10439
  /* @__PURE__ */ jsx(Title2, { children: "Token Usage" }),
@@ -10392,7 +10454,7 @@ function TokenUsageCard({
10392
10454
  transactions.length > 0 && /* @__PURE__ */ jsxs(TransactionsSection, { children: [
10393
10455
  /* @__PURE__ */ jsx(TransactionsHeader, { children: "Recent Activity" }),
10394
10456
  /* @__PURE__ */ jsx(TransactionsList, { children: transactions.slice(0, 5).map((transaction) => /* @__PURE__ */ jsxs(TransactionItem, { children: [
10395
- /* @__PURE__ */ jsx(TransactionIcon, { $type: transaction.type, children: typeIcons[transaction.type] }),
10457
+ /* @__PURE__ */ jsx(TransactionIcon, { $type: transaction.type, children: /* @__PURE__ */ jsx("img", { src: TYPE_ICONS[transaction.type], alt: "", width: 14, height: 14 }) }),
10396
10458
  /* @__PURE__ */ jsxs(TransactionInfo, { children: [
10397
10459
  /* @__PURE__ */ jsx(TransactionDescription, { children: transaction.description }),
10398
10460
  /* @__PURE__ */ jsxs(TransactionMeta, { children: [
@@ -10489,8 +10551,7 @@ var TransactionsSection = styled48.div`
10489
10551
  display: flex;
10490
10552
  flex-direction: column;
10491
10553
  gap: ${tokens.spacing.sm};
10492
- padding: ${tokens.spacing.md};
10493
- padding-top: ${tokens.spacing.sm};
10554
+ padding: ${tokens.spacing.sm} ${tokens.spacing.md} ${tokens.spacing.md};
10494
10555
  border-top: 1px solid ${tokens.colors.border.subtle};
10495
10556
  `;
10496
10557
  var TransactionsHeader = styled48.h4`
@@ -10510,8 +10571,14 @@ var TransactionItem = styled48.div`
10510
10571
  align-items: center;
10511
10572
  gap: ${tokens.spacing.sm};
10512
10573
  padding: ${tokens.spacing.sm};
10513
- background: ${tokens.colors.background.darker};
10514
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
+ }
10515
10582
  `;
10516
10583
  var TransactionIcon = styled48.span`
10517
10584
  width: 24px;
@@ -10519,14 +10586,26 @@ var TransactionIcon = styled48.span`
10519
10586
  display: flex;
10520
10587
  align-items: center;
10521
10588
  justify-content: center;
10522
- font-size: ${tokens.typography.fontSize.sm};
10523
- color: ${({ $type }) => typeColors[$type]};
10589
+ flex-shrink: 0;
10524
10590
  background: ${tokens.colors.background.light};
10525
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
+ }
10526
10604
  `;
10527
10605
  var TransactionInfo = styled48.div`
10528
10606
  flex: 1;
10529
10607
  min-width: 0;
10608
+ overflow: hidden;
10530
10609
  `;
10531
10610
  var TransactionDescription = styled48.div`
10532
10611
  font-size: ${tokens.typography.fontSize.sm};
@@ -10542,12 +10621,20 @@ var TransactionMeta = styled48.div`
10542
10621
  font-size: ${tokens.typography.fontSize.xs};
10543
10622
  font-family: ${tokens.typography.fontFamily.primary};
10544
10623
  color: ${tokens.colors.text.tertiary};
10624
+ overflow: hidden;
10625
+
10626
+ span {
10627
+ overflow: hidden;
10628
+ text-overflow: ellipsis;
10629
+ white-space: nowrap;
10630
+ }
10545
10631
  `;
10546
10632
  var TransactionTokens = styled48.span`
10547
10633
  font-size: ${tokens.typography.fontSize.sm};
10548
10634
  font-weight: ${tokens.typography.fontWeight.medium};
10549
10635
  font-family: ${tokens.typography.fontFamily.primary};
10550
10636
  color: ${({ $type }) => typeColors[$type]};
10637
+ flex-shrink: 0;
10551
10638
  `;
10552
10639
  var EmptyState4 = styled48.div`
10553
10640
  text-align: center;
@@ -10574,6 +10661,17 @@ var ViewAllButton = styled48.button`
10574
10661
  color: ${tokens.colors.text.primary};
10575
10662
  }
10576
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
+ `;
10577
10675
  var WorkflowCard = ({
10578
10676
  id,
10579
10677
  name,
@@ -11564,7 +11662,7 @@ var spin = keyframes`
11564
11662
  transform: rotate(360deg);
11565
11663
  }
11566
11664
  `;
11567
- var pulse5 = keyframes`
11665
+ var pulse6 = keyframes`
11568
11666
  0%, 100% {
11569
11667
  opacity: 1;
11570
11668
  }
@@ -11642,7 +11740,7 @@ var IconContainer3 = styled48.div`
11642
11740
  animation: ${(props) => {
11643
11741
  if (props.$animated) {
11644
11742
  if (props.$status === "running") return spin;
11645
- if (props.$status === "pending") return pulse5;
11743
+ if (props.$status === "pending") return pulse6;
11646
11744
  }
11647
11745
  return "none";
11648
11746
  }}