@parto-system-design/ui 1.0.1 → 1.0.3

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 CHANGED
@@ -886,7 +886,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
886
886
  cursor-pointer
887
887
  inline-flex
888
888
  items-center
889
- space-x-2
889
+ gap-2
890
890
  text-center
891
891
  font-regular
892
892
  ease-out
@@ -4810,13 +4810,13 @@ function InstagramPostCaption({
4810
4810
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn(
4811
4811
  "px-4 py-2",
4812
4812
  variant === "horizontal" && "overflow-visible"
4813
- ), dir: "rtl", children: [
4813
+ ), children: [
4814
4814
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4815
4815
  "p",
4816
4816
  {
4817
4817
  ref: textRef,
4818
4818
  className: cn(
4819
- "text-sm leading-relaxed text-right",
4819
+ "text-sm leading-relaxed text-start",
4820
4820
  !isExpanded && variant === "vertical" && "line-clamp-3"
4821
4821
  // No line clamp for horizontal variant - show full text
4822
4822
  ),
@@ -5144,6 +5144,7 @@ var InstagramPost = React17.forwardRef(
5144
5144
  onOpenInstagram,
5145
5145
  instagramUrl,
5146
5146
  placeholderText,
5147
+ dir,
5147
5148
  ...props
5148
5149
  }, ref) => {
5149
5150
  const isVertical = variant === "vertical";
@@ -5151,8 +5152,8 @@ var InstagramPost = React17.forwardRef(
5151
5152
  "div",
5152
5153
  {
5153
5154
  ref,
5154
- className: cn(instagramPostVariants({ variant }), className, "group"),
5155
- dir: isVertical ? "ltr" : "rtl",
5155
+ className: cn(instagramPostVariants({ variant }), className, "group", isVertical && "flex flex-col h-full"),
5156
+ dir,
5156
5157
  ...props,
5157
5158
  children: [
5158
5159
  showActions && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
@@ -5168,7 +5169,7 @@ var InstagramPost = React17.forwardRef(
5168
5169
  ),
5169
5170
  isVertical ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
5170
5171
  showProfile && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InstagramPostProfile, { profile, variant: variant || "vertical", avatarUrl }),
5171
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5172
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mt-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5172
5173
  InstagramPostMedia,
5173
5174
  {
5174
5175
  media,
@@ -5176,7 +5177,7 @@ var InstagramPost = React17.forwardRef(
5176
5177
  variant: variant || "vertical",
5177
5178
  placeholderText
5178
5179
  }
5179
- ),
5180
+ ) }),
5180
5181
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5181
5182
  InstagramPostStats,
5182
5183
  {
@@ -5190,13 +5191,13 @@ var InstagramPost = React17.forwardRef(
5190
5191
  }
5191
5192
  ),
5192
5193
  showCaption && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InstagramPostCaption, { caption, variant: variant || "vertical" }),
5193
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5194
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mt-auto w-full", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5194
5195
  InstagramPostTime,
5195
5196
  {
5196
5197
  publishTime,
5197
5198
  timeFormat
5198
5199
  }
5199
- )
5200
+ ) })
5200
5201
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
5201
5202
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5202
5203
  InstagramPostMedia,
@@ -5222,13 +5223,13 @@ var InstagramPost = React17.forwardRef(
5222
5223
  }
5223
5224
  ),
5224
5225
  showCaption && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InstagramPostCaption, { caption, variant: variant || "horizontal" }),
5225
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5226
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mt-auto w-full", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5226
5227
  InstagramPostTime,
5227
5228
  {
5228
5229
  publishTime,
5229
5230
  timeFormat
5230
5231
  }
5231
- )
5232
+ ) })
5232
5233
  ] })
5233
5234
  ] })
5234
5235
  ]
@@ -6899,12 +6900,18 @@ var EngagementRate = React22.forwardRef(
6899
6900
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6900
6901
  "div",
6901
6902
  {
6902
- className: "absolute -top-2 transform -translate-x-1/2 transition-all duration-500 z-10",
6903
+ className: "absolute -top-1 transform -translate-x-1/2 transition-all duration-500 z-10",
6903
6904
  style: { left: `${adjustedTrianglePosition}%` },
6904
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "relative", children: [
6905
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-0 h-0 border-l-[20px] rotate-180 border-r-[20px] border-b-[24px] border-l-transparent border-r-transparent border-b-background transition-transform duration-300" }),
6906
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-0 h-0 border-l-[12px] rotate-180 border-r-[12px] border-b-[16px] border-l-transparent border-r-transparent border-b-foreground transition-transform duration-300 absolute top-[4px] left-1/2 transform -translate-x-1/2" })
6907
- ] })
6905
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6906
+ "svg",
6907
+ {
6908
+ width: "20",
6909
+ height: "14",
6910
+ viewBox: "0 0 20 14",
6911
+ className: "fill-primary text-primary transition-transform duration-300",
6912
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("path", { d: "M10 14L0 0H20L10 14Z" })
6913
+ }
6914
+ )
6908
6915
  }
6909
6916
  )
6910
6917
  ] })
@@ -9330,6 +9337,7 @@ function PartoHeatMap({
9330
9337
 
9331
9338
  // src/components/charts/PartoWordCloud.tsx
9332
9339
  var React32 = __toESM(require("react"), 1);
9340
+ var import_react_dom3 = require("react-dom");
9333
9341
  var import_wordcloud = require("@visx/wordcloud");
9334
9342
  var import_scale = require("@visx/scale");
9335
9343
  var import_text = require("@visx/text");
@@ -9386,28 +9394,25 @@ function PartoWordCloud({
9386
9394
  return fontScale(datum.value);
9387
9395
  };
9388
9396
  const handleMouseMove = (event, text, value) => {
9389
- if (containerRef.current) {
9390
- const containerRect = containerRef.current.getBoundingClientRect();
9391
- const x = event.clientX - containerRect.left;
9392
- const y = event.clientY - containerRect.top;
9393
- setHovered({
9394
- text,
9395
- value,
9396
- x,
9397
- y,
9398
- color: primaryColor
9399
- });
9400
- }
9397
+ const x = event.clientX;
9398
+ const y = event.clientY;
9399
+ setHovered({
9400
+ text,
9401
+ value,
9402
+ x,
9403
+ y,
9404
+ color: primaryColor
9405
+ });
9401
9406
  };
9402
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
9407
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
9403
9408
  "div",
9404
9409
  {
9405
9410
  ref: containerRef,
9406
9411
  className,
9407
9412
  style: { position: "relative", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center" },
9408
9413
  dir: "rtl",
9409
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { style: { position: "relative", width, height, display: "flex", alignItems: "center", justifyContent: "center" }, children: [
9410
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
9414
+ children: [
9415
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { style: { position: "relative", width, height, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
9411
9416
  import_wordcloud.Wordcloud,
9412
9417
  {
9413
9418
  words: formattedWords,
@@ -9445,29 +9450,33 @@ function PartoWordCloud({
9445
9450
  ) }, w.text);
9446
9451
  })
9447
9452
  }
9448
- ),
9449
- hovered && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
9450
- "div",
9451
- {
9452
- className: "pointer-events-none absolute z-50",
9453
- style: {
9454
- left: `${hovered.x}px`,
9455
- top: `${hovered.y - 50}px`,
9456
- transform: "translateX(-50%)"
9457
- },
9458
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", children: [
9459
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center gap-2", children: [
9460
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "h-2.5 w-2.5 rounded-[2px]", style: { backgroundColor: hovered.color } }),
9461
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "font-medium", children: hovered.text })
9462
- ] }),
9463
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center justify-between", children: [
9464
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-muted-foreground", children: "\u062A\u0639\u062F\u0627\u062F" }),
9465
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "font-mono font-medium tabular-nums", children: hovered.value.toLocaleString("fa-IR") })
9453
+ ) }),
9454
+ hovered && typeof document !== "undefined" && (0, import_react_dom3.createPortal)(
9455
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
9456
+ "div",
9457
+ {
9458
+ className: "pointer-events-none fixed z-[9999]",
9459
+ dir: "ltr",
9460
+ style: {
9461
+ left: `${hovered.x}px`,
9462
+ top: `${hovered.y - 10}px`,
9463
+ transform: "translate(-50%, -100%)"
9464
+ },
9465
+ children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", dir: "rtl", children: [
9466
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center gap-2", children: [
9467
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "h-2.5 w-2.5 rounded-[2px]", style: { backgroundColor: hovered.color } }),
9468
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "font-medium", children: hovered.text })
9469
+ ] }),
9470
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center justify-between", children: [
9471
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-muted-foreground", children: "\u062A\u0639\u062F\u0627\u062F" }),
9472
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "font-mono font-medium tabular-nums", children: hovered.value.toLocaleString("fa-IR") })
9473
+ ] })
9466
9474
  ] })
9467
- ] })
9468
- }
9475
+ }
9476
+ ),
9477
+ document.body
9469
9478
  )
9470
- ] })
9479
+ ]
9471
9480
  }
9472
9481
  );
9473
9482
  }