@agentiffai/design 1.3.21 → 1.3.23

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
@@ -443,6 +443,8 @@ interface PostPreviewCardProps {
443
443
  onContentChange?: (content: string) => void;
444
444
  /** Show loading skeleton when content is being generated */
445
445
  isLoading?: boolean;
446
+ /** Callback to change/add an image. When provided, image areas become clickable. */
447
+ onImageChange?: () => void;
446
448
  }
447
449
  declare const PostPreviewCard: React__default.FC<PostPreviewCardProps>;
448
450
 
@@ -464,6 +466,8 @@ interface PlatformCarouselProps {
464
466
  onEditContentChange?: (content: string) => void;
465
467
  /** Whether content is being loaded/generated */
466
468
  isLoading?: boolean;
469
+ /** Callback when user requests to change/add an image for a post */
470
+ onImageChangeRequest?: (index: number) => void;
467
471
  }
468
472
  declare const PlatformCarousel: React__default.FC<PlatformCarouselProps>;
469
473
 
@@ -488,6 +492,8 @@ interface PlatformGridProps {
488
492
  activeIndex?: number;
489
493
  /** Callback when a post is clicked/selected */
490
494
  onActiveChange?: (index: number) => void;
495
+ /** Callback when user requests to change/add an image for a post */
496
+ onImageChangeRequest?: (index: number) => void;
491
497
  }
492
498
  /**
493
499
  * PlatformGrid displays all proposed posts in a responsive grid layout.
@@ -531,6 +537,8 @@ interface SocialMediaCanvasProps {
531
537
  isLoading?: boolean;
532
538
  /** Currently active post index (for grid mode) */
533
539
  activeIndex?: number;
540
+ /** Callback when user requests to change/add an image for a post */
541
+ onImageChangeRequest?: (index: number) => void;
534
542
  }
535
543
  /**
536
544
  * SocialMediaCanvas displays social media post previews in carousel or grid mode.
package/dist/index.d.ts CHANGED
@@ -443,6 +443,8 @@ interface PostPreviewCardProps {
443
443
  onContentChange?: (content: string) => void;
444
444
  /** Show loading skeleton when content is being generated */
445
445
  isLoading?: boolean;
446
+ /** Callback to change/add an image. When provided, image areas become clickable. */
447
+ onImageChange?: () => void;
446
448
  }
447
449
  declare const PostPreviewCard: React__default.FC<PostPreviewCardProps>;
448
450
 
@@ -464,6 +466,8 @@ interface PlatformCarouselProps {
464
466
  onEditContentChange?: (content: string) => void;
465
467
  /** Whether content is being loaded/generated */
466
468
  isLoading?: boolean;
469
+ /** Callback when user requests to change/add an image for a post */
470
+ onImageChangeRequest?: (index: number) => void;
467
471
  }
468
472
  declare const PlatformCarousel: React__default.FC<PlatformCarouselProps>;
469
473
 
@@ -488,6 +492,8 @@ interface PlatformGridProps {
488
492
  activeIndex?: number;
489
493
  /** Callback when a post is clicked/selected */
490
494
  onActiveChange?: (index: number) => void;
495
+ /** Callback when user requests to change/add an image for a post */
496
+ onImageChangeRequest?: (index: number) => void;
491
497
  }
492
498
  /**
493
499
  * PlatformGrid displays all proposed posts in a responsive grid layout.
@@ -531,6 +537,8 @@ interface SocialMediaCanvasProps {
531
537
  isLoading?: boolean;
532
538
  /** Currently active post index (for grid mode) */
533
539
  activeIndex?: number;
540
+ /** Callback when user requests to change/add an image for a post */
541
+ onImageChangeRequest?: (index: number) => void;
534
542
  }
535
543
  /**
536
544
  * SocialMediaCanvas displays social media post previews in carousel or grid mode.
package/dist/index.js CHANGED
@@ -2225,7 +2225,7 @@ var TabPanelWrapper = styled48.div`
2225
2225
  overflow-y: auto;
2226
2226
  overflow-x: hidden; // Prevent horizontal overflow
2227
2227
  scrollbar-gutter: stable; // Always reserve space for scrollbar to prevent width jump
2228
- background-color: ${tokens.colors.surface.overlay};
2228
+ background-color: ${tokens.colors.background.dark};
2229
2229
  min-height: 0; // Enable proper flex shrinking and scrolling
2230
2230
 
2231
2231
  @media (max-width: ${tokens.breakpoints.mobile}px) {
@@ -8533,7 +8533,8 @@ var PostPreviewCard = ({
8533
8533
  isEditing = false,
8534
8534
  editContent,
8535
8535
  onContentChange,
8536
- isLoading = false
8536
+ isLoading = false,
8537
+ onImageChange
8537
8538
  }) => {
8538
8539
  const platformConfig = PLATFORM_CONFIGS[post.platform] || PLATFORM_CONFIGS.x;
8539
8540
  const [imageError, setImageError] = useState(false);
@@ -8586,14 +8587,42 @@ var PostPreviewCard = ({
8586
8587
  hashtag.replace(/^#/, "")
8587
8588
  ] }, hashtag)) })
8588
8589
  ] }),
8589
- post.imageUrl && !imageError ? /* @__PURE__ */ jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsx(
8590
+ post.imageUrl && !imageError ? onImageChange ? /* @__PURE__ */ jsx(ImageChangeButton, { type: "button", onClick: onImageChange, "aria-label": "Change image", children: /* @__PURE__ */ jsxs(ImagePreviewContainer, { children: [
8591
+ /* @__PURE__ */ jsx(
8592
+ ImagePreview,
8593
+ {
8594
+ src: post.imageUrl,
8595
+ alt: "Post image preview",
8596
+ onError: () => setImageError(true)
8597
+ }
8598
+ ),
8599
+ /* @__PURE__ */ jsx(ImageOverlay, { children: /* @__PURE__ */ jsx(OverlayText, { children: "Change image" }) })
8600
+ ] }) }) : /* @__PURE__ */ jsx(ImagePreviewContainer, { children: /* @__PURE__ */ jsx(
8590
8601
  ImagePreview,
8591
8602
  {
8592
8603
  src: post.imageUrl,
8593
8604
  alt: "Post image preview",
8594
8605
  onError: () => setImageError(true)
8595
8606
  }
8596
- ) }) : post.imageUrl && imageError ? /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
8607
+ ) }) : post.imageUrl && imageError ? onImageChange ? /* @__PURE__ */ jsx(ImageChangeButton, { type: "button", onClick: onImageChange, "aria-label": "Replace image", children: /* @__PURE__ */ jsxs(ImagePlaceholder, { $clickable: true, children: [
8608
+ /* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
8609
+ "svg",
8610
+ {
8611
+ viewBox: "0 0 24 24",
8612
+ fill: "none",
8613
+ stroke: "currentColor",
8614
+ strokeWidth: "2",
8615
+ role: "img",
8616
+ "aria-label": "Image unavailable",
8617
+ children: [
8618
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
8619
+ /* @__PURE__ */ jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
8620
+ /* @__PURE__ */ jsx("polyline", { points: "21 15 16 10 5 21" })
8621
+ ]
8622
+ }
8623
+ ) }),
8624
+ /* @__PURE__ */ jsx("span", { children: "Tap to replace image" })
8625
+ ] }) }) : /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
8597
8626
  /* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
8598
8627
  "svg",
8599
8628
  {
@@ -8611,7 +8640,25 @@ var PostPreviewCard = ({
8611
8640
  }
8612
8641
  ) }),
8613
8642
  /* @__PURE__ */ jsx("span", { children: "Image unavailable" })
8614
- ] }) : ["instagram", "linkedin", "facebook", "youtube"].includes(post.platform) && /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
8643
+ ] }) : ["instagram", "linkedin", "facebook", "youtube"].includes(post.platform) && (onImageChange ? /* @__PURE__ */ jsx(ImageChangeButton, { type: "button", onClick: onImageChange, "aria-label": "Add image", children: /* @__PURE__ */ jsxs(ImagePlaceholder, { $clickable: true, children: [
8644
+ /* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
8645
+ "svg",
8646
+ {
8647
+ viewBox: "0 0 24 24",
8648
+ fill: "none",
8649
+ stroke: "currentColor",
8650
+ strokeWidth: "2",
8651
+ role: "img",
8652
+ "aria-label": "Add image",
8653
+ children: [
8654
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
8655
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "16" }),
8656
+ /* @__PURE__ */ jsx("line", { x1: "8", y1: "12", x2: "16", y2: "12" })
8657
+ ]
8658
+ }
8659
+ ) }),
8660
+ /* @__PURE__ */ jsx("span", { children: "Tap to add image" })
8661
+ ] }) }) : /* @__PURE__ */ jsxs(ImagePlaceholder, { children: [
8615
8662
  /* @__PURE__ */ jsx(PlaceholderIcon, { children: /* @__PURE__ */ jsxs(
8616
8663
  "svg",
8617
8664
  {
@@ -8629,7 +8676,7 @@ var PostPreviewCard = ({
8629
8676
  }
8630
8677
  ) }),
8631
8678
  /* @__PURE__ */ jsx("span", { children: "No image attached" })
8632
- ] }),
8679
+ ] })),
8633
8680
  /* @__PURE__ */ jsx(ProgressBarContainer, { children: /* @__PURE__ */ jsx(ProgressBarTrack, { children: /* @__PURE__ */ jsx(
8634
8681
  ProgressBarFill2,
8635
8682
  {
@@ -8790,7 +8837,17 @@ var ProgressBarFill2 = styled48.div`
8790
8837
  return tokens.colors.success;
8791
8838
  }};
8792
8839
  `;
8840
+ var ImageChangeButton = styled48.button`
8841
+ display: block;
8842
+ width: 100%;
8843
+ padding: 0;
8844
+ border: none;
8845
+ background: none;
8846
+ cursor: pointer;
8847
+ -webkit-tap-highlight-color: transparent;
8848
+ `;
8793
8849
  var ImagePreviewContainer = styled48.div`
8850
+ position: relative;
8794
8851
  margin-bottom: ${tokens.spacing.sm};
8795
8852
  border-radius: ${tokens.borderRadius.sm};
8796
8853
  overflow: hidden;
@@ -8803,6 +8860,30 @@ var ImagePreview = styled48.img`
8803
8860
  object-fit: cover;
8804
8861
  display: block;
8805
8862
  `;
8863
+ var ImageOverlay = styled48.div`
8864
+ position: absolute;
8865
+ inset: 0;
8866
+ background: rgba(0, 0, 0, 0.5);
8867
+ display: flex;
8868
+ align-items: center;
8869
+ justify-content: center;
8870
+ opacity: 0;
8871
+ transition: opacity ${tokens.transitions.fast};
8872
+
8873
+ ${ImageChangeButton}:hover &,
8874
+ ${ImageChangeButton}:focus-visible & {
8875
+ opacity: 1;
8876
+ }
8877
+
8878
+ @media (hover: none) {
8879
+ opacity: 0.6;
8880
+ }
8881
+ `;
8882
+ var OverlayText = styled48.span`
8883
+ color: white;
8884
+ font-size: ${tokens.typography.fontSize.sm};
8885
+ font-weight: ${tokens.typography.fontWeight.semibold};
8886
+ `;
8806
8887
  var ImagePlaceholder = styled48.div`
8807
8888
  width: 100%;
8808
8889
  height: 200px;
@@ -8822,8 +8903,16 @@ var ImagePlaceholder = styled48.div`
8822
8903
  gap: ${tokens.spacing.sm};
8823
8904
  color: white;
8824
8905
  font-size: ${tokens.typography.fontSize.sm};
8825
- opacity: 0.8;
8906
+ opacity: ${({ $clickable }) => $clickable ? 0.9 : 0.8};
8826
8907
  margin-bottom: ${tokens.spacing.sm};
8908
+ transition: opacity ${tokens.transitions.fast};
8909
+
8910
+ ${({ $clickable }) => $clickable && `
8911
+ ${ImageChangeButton}:hover &,
8912
+ ${ImageChangeButton}:focus-visible & {
8913
+ opacity: 1;
8914
+ }
8915
+ `}
8827
8916
  `;
8828
8917
  var PlaceholderIcon = styled48.div`
8829
8918
  width: 48px;
@@ -8872,7 +8961,8 @@ var PlatformCarousel = ({
8872
8961
  editingIndex,
8873
8962
  editContent,
8874
8963
  onEditContentChange,
8875
- isLoading = false
8964
+ isLoading = false,
8965
+ onImageChangeRequest
8876
8966
  }) => {
8877
8967
  const [activeIndex, setActiveIndex] = useState(0);
8878
8968
  useEffect(() => {
@@ -8932,7 +9022,8 @@ var PlatformCarousel = ({
8932
9022
  isEditing,
8933
9023
  editContent: isEditing ? editContent : void 0,
8934
9024
  onContentChange: isEditing ? onEditContentChange : void 0,
8935
- isLoading
9025
+ isLoading,
9026
+ onImageChange: onImageChangeRequest ? () => onImageChangeRequest(index) : void 0
8936
9027
  }
8937
9028
  ) }, `slide-${post.platform}-${index}`);
8938
9029
  }) }),
@@ -9064,7 +9155,8 @@ var PlatformGrid = ({
9064
9155
  onEditContentChange,
9065
9156
  isLoading = false,
9066
9157
  activeIndex = 0,
9067
- onActiveChange
9158
+ onActiveChange,
9159
+ onImageChangeRequest
9068
9160
  }) => {
9069
9161
  if (posts.length === 0) {
9070
9162
  return /* @__PURE__ */ jsx(EmptyState2, { children: /* @__PURE__ */ jsx(EmptyStateText, { children: "No posts to display" }) });
@@ -9096,7 +9188,8 @@ var PlatformGrid = ({
9096
9188
  isEditing,
9097
9189
  editContent: isEditing ? editContent : void 0,
9098
9190
  onContentChange: isEditing ? onEditContentChange : void 0,
9099
- isLoading
9191
+ isLoading,
9192
+ onImageChange: onImageChangeRequest ? () => onImageChangeRequest(index) : void 0
9100
9193
  }
9101
9194
  )
9102
9195
  },
@@ -9288,7 +9381,8 @@ var SocialMediaCanvas = ({
9288
9381
  editContent,
9289
9382
  onEditContentChange,
9290
9383
  isLoading = false,
9291
- activeIndex = 0
9384
+ activeIndex = 0,
9385
+ onImageChangeRequest
9292
9386
  }) => {
9293
9387
  const [viewMode, setViewMode] = useState(initialViewMode);
9294
9388
  const handleActiveChange = (index) => {
@@ -9345,7 +9439,8 @@ var SocialMediaCanvas = ({
9345
9439
  editingIndex,
9346
9440
  editContent,
9347
9441
  onEditContentChange,
9348
- isLoading
9442
+ isLoading,
9443
+ onImageChangeRequest
9349
9444
  }
9350
9445
  ) : /* @__PURE__ */ jsx(
9351
9446
  PlatformGrid,
@@ -9356,7 +9451,8 @@ var SocialMediaCanvas = ({
9356
9451
  onEditContentChange,
9357
9452
  isLoading,
9358
9453
  activeIndex,
9359
- onActiveChange: handleActiveChange
9454
+ onActiveChange: handleActiveChange,
9455
+ onImageChangeRequest
9360
9456
  }
9361
9457
  ) })
9362
9458
  ] });
@@ -10476,18 +10572,20 @@ var Card2 = styled48.div`
10476
10572
  display: flex;
10477
10573
  flex-direction: column;
10478
10574
  background: ${tokens.colors.background.darker};
10479
- border-radius: ${tokens.borderRadius.xl};
10480
10575
  border: 1px solid ${tokens.colors.border.default};
10576
+ border-radius: ${tokens.borderRadius.xl};
10577
+ height: 100%;
10481
10578
  overflow: hidden;
10482
10579
  `;
10483
10580
  var Header4 = styled48.div`
10484
10581
  display: flex;
10485
10582
  justify-content: space-between;
10486
10583
  align-items: center;
10487
- padding: ${tokens.spacing.sm} ${tokens.spacing.md};
10584
+ padding: 0 0.5rem;
10488
10585
  background: ${tokens.colors.background.darker};
10489
10586
  border-bottom: 1px solid ${tokens.colors.border.default};
10490
10587
  min-height: 48px;
10588
+ flex-shrink: 0;
10491
10589
  `;
10492
10590
  var Title2 = styled48.h3`
10493
10591
  margin: 0;
@@ -10553,6 +10651,9 @@ var TransactionsSection = styled48.div`
10553
10651
  gap: ${tokens.spacing.sm};
10554
10652
  padding: ${tokens.spacing.sm} ${tokens.spacing.md} ${tokens.spacing.md};
10555
10653
  border-top: 1px solid ${tokens.colors.border.subtle};
10654
+ flex: 1;
10655
+ overflow-y: auto;
10656
+ min-height: 0;
10556
10657
  `;
10557
10658
  var TransactionsHeader = styled48.h4`
10558
10659
  margin: 0;
@@ -10564,20 +10665,23 @@ var TransactionsHeader = styled48.h4`
10564
10665
  var TransactionsList = styled48.div`
10565
10666
  display: flex;
10566
10667
  flex-direction: column;
10567
- gap: ${tokens.spacing.xs};
10668
+ gap: ${tokens.spacing.sm};
10568
10669
  `;
10569
10670
  var TransactionItem = styled48.div`
10570
10671
  display: flex;
10571
10672
  align-items: center;
10572
10673
  gap: ${tokens.spacing.sm};
10573
10674
  padding: ${tokens.spacing.sm};
10574
- border-radius: ${tokens.borderRadius.sm};
10675
+ background: ${tokens.colors.background.dark};
10676
+ border-radius: ${tokens.borderRadius.lg};
10677
+ border: 1px solid ${tokens.colors.border.default};
10575
10678
  min-width: 0;
10576
10679
  overflow: hidden;
10577
- transition: background-color ${tokens.transitions.fast};
10680
+ transition: border-color ${tokens.transitions.fast},
10681
+ background-color ${tokens.transitions.fast};
10578
10682
 
10579
10683
  &:hover {
10580
- background-color: ${tokens.colors.surface.overlayHover};
10684
+ border-color: ${tokens.colors.border.hover};
10581
10685
  }
10582
10686
  `;
10583
10687
  var TransactionIcon = styled48.span`
@@ -10771,7 +10875,6 @@ var Card3 = styled48.button`
10771
10875
  }
10772
10876
 
10773
10877
  &:disabled {
10774
- opacity: 0.5;
10775
10878
  cursor: not-allowed;
10776
10879
  }
10777
10880
  `;