@parto-system-design/ui 1.1.19 → 1.1.20

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from '../../utils-Czyp5Ned.cjs';
3
- import { S as SeverityKey } from '../../i18n-DD3DMY8O.cjs';
3
+ import { S as SeverityKey } from '../../i18n-B4rvgH-T.cjs';
4
4
  import 'clsx';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from '../../utils-Czyp5Ned.js';
3
- import { S as SeverityKey } from '../../i18n-UEClNsBy.js';
3
+ import { S as SeverityKey } from '../../i18n-CZQ2kPWD.js';
4
4
  import 'clsx';
5
5
 
6
6
  /**
@@ -4,15 +4,15 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
7
+ variant?: "link" | "text" | "warning" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
+ size?: "icon" | "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
11
11
  rounded?: boolean | null | undefined;
12
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
13
  type LoadingVariantProps = VariantProps<typeof loadingVariants>;
14
14
  declare const loadingVariants: (props?: ({
15
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
15
+ variant?: "link" | "text" | "warning" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
16
16
  loading?: boolean | "default" | null | undefined;
17
17
  } & class_variance_authority_types.ClassProp) | undefined) => string;
18
18
  interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, Omit<ButtonVariantProps, 'disabled'>, Omit<LoadingVariantProps, 'variant'> {
@@ -4,15 +4,15 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
7
+ variant?: "link" | "text" | "warning" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
+ size?: "icon" | "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
11
11
  rounded?: boolean | null | undefined;
12
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
13
  type LoadingVariantProps = VariantProps<typeof loadingVariants>;
14
14
  declare const loadingVariants: (props?: ({
15
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
15
+ variant?: "link" | "text" | "warning" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
16
16
  loading?: boolean | "default" | null | undefined;
17
17
  } & class_variance_authority_types.ClassProp) | undefined) => string;
18
18
  interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, Omit<ButtonVariantProps, 'disabled'>, Omit<LoadingVariantProps, 'variant'> {
@@ -127,7 +127,14 @@ var flowLabels = {
127
127
  grey: "Grey"
128
128
  }
129
129
  };
130
- (() => {
130
+ var FLOW_VALUE_MAP = {
131
+ 1: "pro-gov",
132
+ 2: "internal-critic",
133
+ 3: "internal-opponent",
134
+ 4: "external-opponent",
135
+ 5: "grey"
136
+ };
137
+ var FLOW_LABEL_LOOKUP = (() => {
131
138
  const map = {};
132
139
  for (const key of FLOW_KEYS) map[key] = key;
133
140
  for (const locale of Object.keys(flowLabels)) {
@@ -137,6 +144,14 @@ var flowLabels = {
137
144
  }
138
145
  return map;
139
146
  })();
147
+ function resolveFlow(input) {
148
+ if (input == null) return null;
149
+ if (typeof input === "number") return FLOW_VALUE_MAP[input] ?? null;
150
+ const raw = String(input).trim();
151
+ if (raw === "") return null;
152
+ if (/^\d+$/.test(raw)) return FLOW_VALUE_MAP[Number(raw)] ?? null;
153
+ return FLOW_LABEL_LOOKUP[raw.toLowerCase()] ?? null;
154
+ }
140
155
  var STATUS_KEYS = ["critical", "warning", "middle", "low"];
141
156
  var statusLabels = {
142
157
  fa: { critical: "\u0628\u062D\u0631\u0627\u0646\u06CC", warning: "\u0647\u0634\u062F\u0627\u0631", middle: "\u0645\u062A\u0648\u0633\u0637", low: "\u067E\u0627\u06CC\u06CC\u0646" },
@@ -309,12 +324,24 @@ var SeverityBadge = React__namespace.forwardRef(
309
324
  }
310
325
  );
311
326
  SeverityBadge.displayName = "SeverityBadge";
312
- function calcPercents(data) {
313
- const total = FLOW_KEYS.reduce((s, k) => s + (data[k] ?? 0), 0);
327
+ function normalizeFlowData(data) {
328
+ const counts = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
329
+ if (Array.isArray(data)) {
330
+ for (const item of data) {
331
+ const key = resolveFlow(item.type);
332
+ if (key) counts[key] += item.value ?? 0;
333
+ }
334
+ } else {
335
+ for (const k of FLOW_KEYS) counts[k] = data[k] ?? 0;
336
+ }
337
+ return counts;
338
+ }
339
+ function calcPercents(counts) {
340
+ const total = FLOW_KEYS.reduce((s, k) => s + counts[k], 0);
314
341
  const result = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
315
342
  if (total === 0) return result;
316
- const floats = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).map((k) => {
317
- const v = (data[k] ?? 0) / total * 100;
343
+ const floats = FLOW_KEYS.filter((k) => counts[k] > 0).map((k) => {
344
+ const v = counts[k] / total * 100;
318
345
  return { k, floor: Math.floor(v), rem: v - Math.floor(v) };
319
346
  });
320
347
  const remaining = 100 - floats.reduce((s, f) => s + f.floor, 0);
@@ -345,7 +372,8 @@ var FlowDistribution = React__namespace.forwardRef(
345
372
  ...props
346
373
  }, ref) => {
347
374
  const labels = flowLabels[locale] ?? flowLabels.fa;
348
- const percents = calcPercents(data);
375
+ const counts = normalizeFlowData(data);
376
+ const percents = calcPercents(counts);
349
377
  const percentSign = locale === "en" ? "%" : "\u066A";
350
378
  if (isLoading) {
351
379
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: variant === "stacked" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 w-full rounded-full bg-muted animate-pulse" }) : variant === "compact" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 w-20 rounded-full bg-muted animate-pulse" }, i)) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -355,7 +383,7 @@ var FlowDistribution = React__namespace.forwardRef(
355
383
  ] }, i)) }) });
356
384
  }
357
385
  if (variant === "stacked") {
358
- const active = STACKED_ORDER.filter((k) => (data[k] ?? 0) > 0);
386
+ const active = STACKED_ORDER.filter((k) => counts[k] > 0);
359
387
  const srLabel = active.map((k) => `${labels[k]} ${convertToLocalNumbers(percents[k], locale)}${percentSign}`).join("\u060C ");
360
388
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: [
361
389
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-3 w-full overflow-hidden rounded-full bg-muted", role: "img", "aria-label": srLabel, children: active.map((k) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -381,14 +409,14 @@ var FlowDistribution = React__namespace.forwardRef(
381
409
  ] }),
382
410
  showCounts && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
383
411
  "(",
384
- convertToLocalNumbers(data[k] ?? 0, locale),
412
+ convertToLocalNumbers(counts[k], locale),
385
413
  ")"
386
414
  ] })
387
415
  ] }, k)) })
388
416
  ] });
389
417
  }
390
418
  if (variant === "compact") {
391
- const active = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
419
+ const active = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
392
420
  return /* @__PURE__ */ jsxRuntime.jsx(
393
421
  "div",
394
422
  {
@@ -412,7 +440,7 @@ var FlowDistribution = React__namespace.forwardRef(
412
440
  ] }),
413
441
  showCounts && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
414
442
  "(",
415
- convertToLocalNumbers(data[k] ?? 0, locale),
443
+ convertToLocalNumbers(counts[k], locale),
416
444
  ")"
417
445
  ] })
418
446
  ]
@@ -422,7 +450,7 @@ var FlowDistribution = React__namespace.forwardRef(
422
450
  }
423
451
  );
424
452
  }
425
- const sorted = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
453
+ const sorted = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
426
454
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-1.5", className), ...props, children: sorted.map((k) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
427
455
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-24 shrink-0 text-xs text-foreground-light text-end", children: labels[k] }),
428
456
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex-1 h-2 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -445,7 +473,7 @@ var FlowDistribution = React__namespace.forwardRef(
445
473
  {
446
474
  className: "w-12 shrink-0 text-xs font-medium tabular-nums text-start",
447
475
  style: { color: `var(${tokenVar3(k)})` },
448
- children: showCounts ? convertToLocalNumbers((data[k] ?? 0).toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
476
+ children: showCounts ? convertToLocalNumbers(counts[k].toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
449
477
  }
450
478
  )
451
479
  ] }, k)) });
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
2
  import '../../utils-Czyp5Ned.cjs';
3
- export { C as ConceptCard, a as ConceptCardProps } from '../../concept-card-BU8JL-gj.cjs';
4
- import '../../i18n-DD3DMY8O.cjs';
3
+ export { C as ConceptCard, a as ConceptCardProps } from '../../concept-card-dZeBeup5.cjs';
4
+ import '../../i18n-B4rvgH-T.cjs';
5
5
  import 'clsx';
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
2
  import '../../utils-Czyp5Ned.js';
3
- export { C as ConceptCard, a as ConceptCardProps } from '../../concept-card-D7PfDkNR.js';
4
- import '../../i18n-UEClNsBy.js';
3
+ export { C as ConceptCard, a as ConceptCardProps } from '../../concept-card-DX5zRCk2.js';
4
+ import '../../i18n-CZQ2kPWD.js';
5
5
  import 'clsx';
@@ -104,7 +104,14 @@ var flowLabels = {
104
104
  grey: "Grey"
105
105
  }
106
106
  };
107
- (() => {
107
+ var FLOW_VALUE_MAP = {
108
+ 1: "pro-gov",
109
+ 2: "internal-critic",
110
+ 3: "internal-opponent",
111
+ 4: "external-opponent",
112
+ 5: "grey"
113
+ };
114
+ var FLOW_LABEL_LOOKUP = (() => {
108
115
  const map = {};
109
116
  for (const key of FLOW_KEYS) map[key] = key;
110
117
  for (const locale of Object.keys(flowLabels)) {
@@ -114,6 +121,14 @@ var flowLabels = {
114
121
  }
115
122
  return map;
116
123
  })();
124
+ function resolveFlow(input) {
125
+ if (input == null) return null;
126
+ if (typeof input === "number") return FLOW_VALUE_MAP[input] ?? null;
127
+ const raw = String(input).trim();
128
+ if (raw === "") return null;
129
+ if (/^\d+$/.test(raw)) return FLOW_VALUE_MAP[Number(raw)] ?? null;
130
+ return FLOW_LABEL_LOOKUP[raw.toLowerCase()] ?? null;
131
+ }
117
132
  var STATUS_KEYS = ["critical", "warning", "middle", "low"];
118
133
  var statusLabels = {
119
134
  fa: { critical: "\u0628\u062D\u0631\u0627\u0646\u06CC", warning: "\u0647\u0634\u062F\u0627\u0631", middle: "\u0645\u062A\u0648\u0633\u0637", low: "\u067E\u0627\u06CC\u06CC\u0646" },
@@ -286,12 +301,24 @@ var SeverityBadge = React.forwardRef(
286
301
  }
287
302
  );
288
303
  SeverityBadge.displayName = "SeverityBadge";
289
- function calcPercents(data) {
290
- const total = FLOW_KEYS.reduce((s, k) => s + (data[k] ?? 0), 0);
304
+ function normalizeFlowData(data) {
305
+ const counts = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
306
+ if (Array.isArray(data)) {
307
+ for (const item of data) {
308
+ const key = resolveFlow(item.type);
309
+ if (key) counts[key] += item.value ?? 0;
310
+ }
311
+ } else {
312
+ for (const k of FLOW_KEYS) counts[k] = data[k] ?? 0;
313
+ }
314
+ return counts;
315
+ }
316
+ function calcPercents(counts) {
317
+ const total = FLOW_KEYS.reduce((s, k) => s + counts[k], 0);
291
318
  const result = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
292
319
  if (total === 0) return result;
293
- const floats = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).map((k) => {
294
- const v = (data[k] ?? 0) / total * 100;
320
+ const floats = FLOW_KEYS.filter((k) => counts[k] > 0).map((k) => {
321
+ const v = counts[k] / total * 100;
295
322
  return { k, floor: Math.floor(v), rem: v - Math.floor(v) };
296
323
  });
297
324
  const remaining = 100 - floats.reduce((s, f) => s + f.floor, 0);
@@ -322,7 +349,8 @@ var FlowDistribution = React.forwardRef(
322
349
  ...props
323
350
  }, ref) => {
324
351
  const labels = flowLabels[locale] ?? flowLabels.fa;
325
- const percents = calcPercents(data);
352
+ const counts = normalizeFlowData(data);
353
+ const percents = calcPercents(counts);
326
354
  const percentSign = locale === "en" ? "%" : "\u066A";
327
355
  if (isLoading) {
328
356
  return /* @__PURE__ */ jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: variant === "stacked" ? /* @__PURE__ */ jsx("div", { className: "h-3 w-full rounded-full bg-muted animate-pulse" }) : variant === "compact" ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("div", { className: "h-5 w-20 rounded-full bg-muted animate-pulse" }, i)) }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -332,7 +360,7 @@ var FlowDistribution = React.forwardRef(
332
360
  ] }, i)) }) });
333
361
  }
334
362
  if (variant === "stacked") {
335
- const active = STACKED_ORDER.filter((k) => (data[k] ?? 0) > 0);
363
+ const active = STACKED_ORDER.filter((k) => counts[k] > 0);
336
364
  const srLabel = active.map((k) => `${labels[k]} ${convertToLocalNumbers(percents[k], locale)}${percentSign}`).join("\u060C ");
337
365
  return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: [
338
366
  /* @__PURE__ */ jsx("div", { className: "flex h-3 w-full overflow-hidden rounded-full bg-muted", role: "img", "aria-label": srLabel, children: active.map((k) => /* @__PURE__ */ jsx(
@@ -358,14 +386,14 @@ var FlowDistribution = React.forwardRef(
358
386
  ] }),
359
387
  showCounts && /* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
360
388
  "(",
361
- convertToLocalNumbers(data[k] ?? 0, locale),
389
+ convertToLocalNumbers(counts[k], locale),
362
390
  ")"
363
391
  ] })
364
392
  ] }, k)) })
365
393
  ] });
366
394
  }
367
395
  if (variant === "compact") {
368
- const active = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
396
+ const active = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
369
397
  return /* @__PURE__ */ jsx(
370
398
  "div",
371
399
  {
@@ -389,7 +417,7 @@ var FlowDistribution = React.forwardRef(
389
417
  ] }),
390
418
  showCounts && /* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
391
419
  "(",
392
- convertToLocalNumbers(data[k] ?? 0, locale),
420
+ convertToLocalNumbers(counts[k], locale),
393
421
  ")"
394
422
  ] })
395
423
  ]
@@ -399,7 +427,7 @@ var FlowDistribution = React.forwardRef(
399
427
  }
400
428
  );
401
429
  }
402
- const sorted = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
430
+ const sorted = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
403
431
  return /* @__PURE__ */ jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-1.5", className), ...props, children: sorted.map((k) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
404
432
  /* @__PURE__ */ jsx("span", { className: "w-24 shrink-0 text-xs text-foreground-light text-end", children: labels[k] }),
405
433
  /* @__PURE__ */ jsx("div", { className: "relative flex-1 h-2 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx(
@@ -422,7 +450,7 @@ var FlowDistribution = React.forwardRef(
422
450
  {
423
451
  className: "w-12 shrink-0 text-xs font-medium tabular-nums text-start",
424
452
  style: { color: `var(${tokenVar3(k)})` },
425
- children: showCounts ? convertToLocalNumbers((data[k] ?? 0).toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
453
+ children: showCounts ? convertToLocalNumbers(counts[k].toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
426
454
  }
427
455
  )
428
456
  ] }, k)) });
@@ -1,7 +1,7 @@
1
1
  import 'react';
2
2
  import '../../utils-Czyp5Ned.cjs';
3
3
  import './social-platform-badge.cjs';
4
- export { P as PageCard, d as PageCardContentMix, e as PageCardProps } from '../../page-card-DjztZrFM.cjs';
5
- import '../../i18n-DD3DMY8O.cjs';
4
+ export { P as PageCard, d as PageCardContentMix, e as PageCardProps } from '../../page-card-DWBUZYwM.cjs';
5
+ import '../../i18n-B4rvgH-T.cjs';
6
6
  import 'clsx';
7
7
  import 'class-variance-authority/types';
@@ -1,7 +1,7 @@
1
1
  import 'react';
2
2
  import '../../utils-Czyp5Ned.js';
3
3
  import './social-platform-badge.js';
4
- export { P as PageCard, d as PageCardContentMix, e as PageCardProps } from '../../page-card-sIE4lvnb.js';
5
- import '../../i18n-UEClNsBy.js';
4
+ export { P as PageCard, d as PageCardContentMix, e as PageCardProps } from '../../page-card-CU6_AmNR.js';
5
+ import '../../i18n-CZQ2kPWD.js';
6
6
  import 'clsx';
7
7
  import 'class-variance-authority/types';
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const skeletonVariants: (props?: ({
6
- shape?: "circle" | "rect" | "line" | "text" | null | undefined;
6
+ shape?: "text" | "circle" | "rect" | "line" | null | undefined;
7
7
  size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const skeletonVariants: (props?: ({
6
- shape?: "circle" | "rect" | "line" | "text" | null | undefined;
6
+ shape?: "text" | "circle" | "rect" | "line" | null | undefined;
7
7
  size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
@@ -1,10 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from './utils-Czyp5Ned.js';
3
- import { F as FlowKey, a as StatusKey, S as SeverityKey } from './i18n-UEClNsBy.js';
3
+ import { F as FlowInput, b as FlowKey, a as StatusKey, S as SeverityKey } from './i18n-CZQ2kPWD.js';
4
4
 
5
- type FlowData = Partial<Record<FlowKey, number>>;
5
+ /** A single flow entry: `type` accepts a key, a numeric code `1–5`, or a label. */
6
+ interface FlowDataItem {
7
+ /** Flow identity — `FlowKey` (`'pro-gov'`…), numeric code `1–5`, or localized label. */
8
+ type: FlowInput;
9
+ /** Numeric count for this flow. */
10
+ value: number;
11
+ }
12
+ /**
13
+ * Flow counts. Either an array of `{ type, value }` entries (type as a key,
14
+ * a numeric code `1–5`, or a label) or a keyed object `{ 'pro-gov': 420, … }`.
15
+ */
16
+ type FlowData = FlowDataItem[] | Partial<Record<FlowKey, number>>;
6
17
  interface FlowDistributionProps extends React.HTMLAttributes<HTMLDivElement> {
7
- /** Flow counts (auto-normalized). Missing keys treated as 0. */
18
+ /** Flow counts (auto-normalized). Missing flows treated as 0. */
8
19
  data: FlowData;
9
20
  /** Display mode */
10
21
  variant?: 'bars' | 'stacked' | 'compact';
@@ -80,4 +91,4 @@ interface ConceptCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
80
91
  }
81
92
  declare const ConceptCard: React.ForwardRefExoticComponent<ConceptCardProps & React.RefAttributes<HTMLDivElement>>;
82
93
 
83
- export { ConceptCard as C, type FlowData as F, type SentimentData as S, type ConceptCardProps as a, FlowDistribution as b, type FlowDistributionProps as c, SentimentDistribution as d, type SentimentDistributionProps as e };
94
+ export { ConceptCard as C, type FlowData as F, type SentimentData as S, type ConceptCardProps as a, type FlowDataItem as b, FlowDistribution as c, type FlowDistributionProps as d, SentimentDistribution as e, type SentimentDistributionProps as f };
@@ -1,10 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from './utils-Czyp5Ned.cjs';
3
- import { F as FlowKey, a as StatusKey, S as SeverityKey } from './i18n-DD3DMY8O.cjs';
3
+ import { F as FlowInput, b as FlowKey, a as StatusKey, S as SeverityKey } from './i18n-B4rvgH-T.cjs';
4
4
 
5
- type FlowData = Partial<Record<FlowKey, number>>;
5
+ /** A single flow entry: `type` accepts a key, a numeric code `1–5`, or a label. */
6
+ interface FlowDataItem {
7
+ /** Flow identity — `FlowKey` (`'pro-gov'`…), numeric code `1–5`, or localized label. */
8
+ type: FlowInput;
9
+ /** Numeric count for this flow. */
10
+ value: number;
11
+ }
12
+ /**
13
+ * Flow counts. Either an array of `{ type, value }` entries (type as a key,
14
+ * a numeric code `1–5`, or a label) or a keyed object `{ 'pro-gov': 420, … }`.
15
+ */
16
+ type FlowData = FlowDataItem[] | Partial<Record<FlowKey, number>>;
6
17
  interface FlowDistributionProps extends React.HTMLAttributes<HTMLDivElement> {
7
- /** Flow counts (auto-normalized). Missing keys treated as 0. */
18
+ /** Flow counts (auto-normalized). Missing flows treated as 0. */
8
19
  data: FlowData;
9
20
  /** Display mode */
10
21
  variant?: 'bars' | 'stacked' | 'compact';
@@ -80,4 +91,4 @@ interface ConceptCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
80
91
  }
81
92
  declare const ConceptCard: React.ForwardRefExoticComponent<ConceptCardProps & React.RefAttributes<HTMLDivElement>>;
82
93
 
83
- export { ConceptCard as C, type FlowData as F, type SentimentData as S, type ConceptCardProps as a, FlowDistribution as b, type FlowDistributionProps as c, SentimentDistribution as d, type SentimentDistributionProps as e };
94
+ export { ConceptCard as C, type FlowData as F, type SentimentData as S, type ConceptCardProps as a, type FlowDataItem as b, FlowDistribution as c, type FlowDistributionProps as d, SentimentDistribution as e, type SentimentDistributionProps as f };
@@ -432,4 +432,4 @@ type UIStrings = Record<UIStringKeys, string>;
432
432
  */
433
433
  declare function getUIStrings(locale?: SupportedLocale): UIStrings;
434
434
 
435
- export { sentimentLabels as $, type ActionStatusKey as A, UI_STRINGS as B, actionStatusLabels as C, actionTypeLabels as D, type EntityHealthKey as E, type FlowKey as F, actionTypeVerbs as G, emotionLabels as H, engagementUiTranslations as I, type JobStatusKey as J, entityHealthLabels as K, type Locale as L, entityHealthPriority as M, flowLabels as N, formatRelativeLocaleTime as O, formatTimeRemaining as P, getUIStrings as Q, isActiveJobStatus as R, type SeverityKey as S, isCriticalEntityHealth as T, type UIStringKeys as U, isRTL as V, jobStatusLabels as W, resolveEmotion as X, resolveFlow as Y, resolveSeverity as Z, resolveStatus as _, type StatusKey as a, severityLabels as a0, stageStatusLabels as a1, statusLabels as a2, type ActionTypeKey as b, type EmotionKey as c, type StageStatusKey as d, type EmotionInput as e, type FlowInput as f, type StatusInput as g, type SeverityInput as h, ACTION_STATUS_KEYS as i, ACTION_TYPE_KEYS as j, EMOTION_KEYS as k, EMOTION_KEY_TO_VALUE as l, EMOTION_VALUE_MAP as m, ENTITY_HEALTH_KEYS as n, FLOW_KEYS as o, FLOW_KEY_TO_VALUE as p, FLOW_VALUE_MAP as q, JOB_STATUS_KEYS as r, SEVERITY_KEYS as s, SEVERITY_KEY_TO_VALUE as t, SEVERITY_VALUE_MAP as u, STAGE_STATUS_KEYS as v, STATUS_KEYS as w, STATUS_KEY_TO_VALUE as x, STATUS_VALUE_MAP as y, type UIStrings as z };
435
+ export { sentimentLabels as $, type ActionStatusKey as A, UI_STRINGS as B, actionStatusLabels as C, actionTypeLabels as D, type EntityHealthKey as E, type FlowInput as F, actionTypeVerbs as G, emotionLabels as H, engagementUiTranslations as I, type JobStatusKey as J, entityHealthLabels as K, type Locale as L, entityHealthPriority as M, flowLabels as N, formatRelativeLocaleTime as O, formatTimeRemaining as P, getUIStrings as Q, isActiveJobStatus as R, type SeverityKey as S, isCriticalEntityHealth as T, type UIStringKeys as U, isRTL as V, jobStatusLabels as W, resolveEmotion as X, resolveFlow as Y, resolveSeverity as Z, resolveStatus as _, type StatusKey as a, severityLabels as a0, stageStatusLabels as a1, statusLabels as a2, type FlowKey as b, type ActionTypeKey as c, type EmotionKey as d, type StageStatusKey as e, type EmotionInput as f, type StatusInput as g, type SeverityInput as h, ACTION_STATUS_KEYS as i, ACTION_TYPE_KEYS as j, EMOTION_KEYS as k, EMOTION_KEY_TO_VALUE as l, EMOTION_VALUE_MAP as m, ENTITY_HEALTH_KEYS as n, FLOW_KEYS as o, FLOW_KEY_TO_VALUE as p, FLOW_VALUE_MAP as q, JOB_STATUS_KEYS as r, SEVERITY_KEYS as s, SEVERITY_KEY_TO_VALUE as t, SEVERITY_VALUE_MAP as u, STAGE_STATUS_KEYS as v, STATUS_KEYS as w, STATUS_KEY_TO_VALUE as x, STATUS_VALUE_MAP as y, type UIStrings as z };
@@ -432,4 +432,4 @@ type UIStrings = Record<UIStringKeys, string>;
432
432
  */
433
433
  declare function getUIStrings(locale?: SupportedLocale): UIStrings;
434
434
 
435
- export { sentimentLabels as $, type ActionStatusKey as A, UI_STRINGS as B, actionStatusLabels as C, actionTypeLabels as D, type EntityHealthKey as E, type FlowKey as F, actionTypeVerbs as G, emotionLabels as H, engagementUiTranslations as I, type JobStatusKey as J, entityHealthLabels as K, type Locale as L, entityHealthPriority as M, flowLabels as N, formatRelativeLocaleTime as O, formatTimeRemaining as P, getUIStrings as Q, isActiveJobStatus as R, type SeverityKey as S, isCriticalEntityHealth as T, type UIStringKeys as U, isRTL as V, jobStatusLabels as W, resolveEmotion as X, resolveFlow as Y, resolveSeverity as Z, resolveStatus as _, type StatusKey as a, severityLabels as a0, stageStatusLabels as a1, statusLabels as a2, type ActionTypeKey as b, type EmotionKey as c, type StageStatusKey as d, type EmotionInput as e, type FlowInput as f, type StatusInput as g, type SeverityInput as h, ACTION_STATUS_KEYS as i, ACTION_TYPE_KEYS as j, EMOTION_KEYS as k, EMOTION_KEY_TO_VALUE as l, EMOTION_VALUE_MAP as m, ENTITY_HEALTH_KEYS as n, FLOW_KEYS as o, FLOW_KEY_TO_VALUE as p, FLOW_VALUE_MAP as q, JOB_STATUS_KEYS as r, SEVERITY_KEYS as s, SEVERITY_KEY_TO_VALUE as t, SEVERITY_VALUE_MAP as u, STAGE_STATUS_KEYS as v, STATUS_KEYS as w, STATUS_KEY_TO_VALUE as x, STATUS_VALUE_MAP as y, type UIStrings as z };
435
+ export { sentimentLabels as $, type ActionStatusKey as A, UI_STRINGS as B, actionStatusLabels as C, actionTypeLabels as D, type EntityHealthKey as E, type FlowInput as F, actionTypeVerbs as G, emotionLabels as H, engagementUiTranslations as I, type JobStatusKey as J, entityHealthLabels as K, type Locale as L, entityHealthPriority as M, flowLabels as N, formatRelativeLocaleTime as O, formatTimeRemaining as P, getUIStrings as Q, isActiveJobStatus as R, type SeverityKey as S, isCriticalEntityHealth as T, type UIStringKeys as U, isRTL as V, jobStatusLabels as W, resolveEmotion as X, resolveFlow as Y, resolveSeverity as Z, resolveStatus as _, type StatusKey as a, severityLabels as a0, stageStatusLabels as a1, statusLabels as a2, type FlowKey as b, type ActionTypeKey as c, type EmotionKey as d, type StageStatusKey as e, type EmotionInput as f, type StatusInput as g, type SeverityInput as h, ACTION_STATUS_KEYS as i, ACTION_TYPE_KEYS as j, EMOTION_KEYS as k, EMOTION_KEY_TO_VALUE as l, EMOTION_VALUE_MAP as m, ENTITY_HEALTH_KEYS as n, FLOW_KEYS as o, FLOW_KEY_TO_VALUE as p, FLOW_VALUE_MAP as q, JOB_STATUS_KEYS as r, SEVERITY_KEYS as s, SEVERITY_KEY_TO_VALUE as t, SEVERITY_VALUE_MAP as u, STAGE_STATUS_KEYS as v, STATUS_KEYS as w, STATUS_KEY_TO_VALUE as x, STATUS_VALUE_MAP as y, type UIStrings as z };
package/dist/index.cjs CHANGED
@@ -7376,12 +7376,24 @@ var StatusBadge = React127__namespace.forwardRef(
7376
7376
  }
7377
7377
  );
7378
7378
  StatusBadge.displayName = "StatusBadge";
7379
- function calcPercents(data) {
7380
- const total = FLOW_KEYS.reduce((s, k) => s + (data[k] ?? 0), 0);
7379
+ function normalizeFlowData(data) {
7380
+ const counts = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
7381
+ if (Array.isArray(data)) {
7382
+ for (const item of data) {
7383
+ const key = resolveFlow(item.type);
7384
+ if (key) counts[key] += item.value ?? 0;
7385
+ }
7386
+ } else {
7387
+ for (const k of FLOW_KEYS) counts[k] = data[k] ?? 0;
7388
+ }
7389
+ return counts;
7390
+ }
7391
+ function calcPercents(counts) {
7392
+ const total = FLOW_KEYS.reduce((s, k) => s + counts[k], 0);
7381
7393
  const result = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
7382
7394
  if (total === 0) return result;
7383
- const floats = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).map((k) => {
7384
- const v = (data[k] ?? 0) / total * 100;
7395
+ const floats = FLOW_KEYS.filter((k) => counts[k] > 0).map((k) => {
7396
+ const v = counts[k] / total * 100;
7385
7397
  return { k, floor: Math.floor(v), rem: v - Math.floor(v) };
7386
7398
  });
7387
7399
  const remaining = 100 - floats.reduce((s, f) => s + f.floor, 0);
@@ -7412,7 +7424,8 @@ var FlowDistribution = React127__namespace.forwardRef(
7412
7424
  ...props
7413
7425
  }, ref) => {
7414
7426
  const labels = flowLabels[locale] ?? flowLabels.fa;
7415
- const percents = calcPercents(data);
7427
+ const counts = normalizeFlowData(data);
7428
+ const percents = calcPercents(counts);
7416
7429
  const percentSign = locale === "en" ? "%" : "\u066A";
7417
7430
  if (isLoading) {
7418
7431
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: variant === "stacked" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 w-full rounded-full bg-muted animate-pulse" }) : variant === "compact" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 w-20 rounded-full bg-muted animate-pulse" }, i)) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -7422,7 +7435,7 @@ var FlowDistribution = React127__namespace.forwardRef(
7422
7435
  ] }, i)) }) });
7423
7436
  }
7424
7437
  if (variant === "stacked") {
7425
- const active = STACKED_ORDER.filter((k) => (data[k] ?? 0) > 0);
7438
+ const active = STACKED_ORDER.filter((k) => counts[k] > 0);
7426
7439
  const srLabel = active.map((k) => `${labels[k]} ${convertToLocalNumbers(percents[k], locale)}${percentSign}`).join("\u060C ");
7427
7440
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: [
7428
7441
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-3 w-full overflow-hidden rounded-full bg-muted", role: "img", "aria-label": srLabel, children: active.map((k) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -7448,14 +7461,14 @@ var FlowDistribution = React127__namespace.forwardRef(
7448
7461
  ] }),
7449
7462
  showCounts && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
7450
7463
  "(",
7451
- convertToLocalNumbers(data[k] ?? 0, locale),
7464
+ convertToLocalNumbers(counts[k], locale),
7452
7465
  ")"
7453
7466
  ] })
7454
7467
  ] }, k)) })
7455
7468
  ] });
7456
7469
  }
7457
7470
  if (variant === "compact") {
7458
- const active = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
7471
+ const active = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
7459
7472
  return /* @__PURE__ */ jsxRuntime.jsx(
7460
7473
  "div",
7461
7474
  {
@@ -7479,7 +7492,7 @@ var FlowDistribution = React127__namespace.forwardRef(
7479
7492
  ] }),
7480
7493
  showCounts && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
7481
7494
  "(",
7482
- convertToLocalNumbers(data[k] ?? 0, locale),
7495
+ convertToLocalNumbers(counts[k], locale),
7483
7496
  ")"
7484
7497
  ] })
7485
7498
  ]
@@ -7489,7 +7502,7 @@ var FlowDistribution = React127__namespace.forwardRef(
7489
7502
  }
7490
7503
  );
7491
7504
  }
7492
- const sorted = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
7505
+ const sorted = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
7493
7506
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-1.5", className), ...props, children: sorted.map((k) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7494
7507
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-24 shrink-0 text-xs text-foreground-light text-end", children: labels[k] }),
7495
7508
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex-1 h-2 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -7512,7 +7525,7 @@ var FlowDistribution = React127__namespace.forwardRef(
7512
7525
  {
7513
7526
  className: "w-12 shrink-0 text-xs font-medium tabular-nums text-start",
7514
7527
  style: { color: `var(${tokenVar3(k)})` },
7515
- children: showCounts ? convertToLocalNumbers((data[k] ?? 0).toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
7528
+ children: showCounts ? convertToLocalNumbers(counts[k].toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
7516
7529
  }
7517
7530
  )
7518
7531
  ] }, k)) });
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { S as SupportedLocale } from './utils-Czyp5Ned.cjs';
2
2
  export { c as cn, a as convertToLocalNumbers, f as formatAbsoluteTime, b as formatLargeNumber, d as formatNumber, e as formatRelativeTime } from './utils-Czyp5Ned.cjs';
3
- import { I as IranProvinceSlug, C as Country, P as PostData, a as PostView, b as PostAction, c as PostMediaItem, d as PostAuthor, e as PostPlatform, f as PostSentiment, g as PostEnrichmentFlags, h as PostDensity, i as PostOutlet, j as PostBodyData, S as StoryItem, k as PostMetrics, l as PostSeverity, m as PostCluster, n as PostRepostInfo, o as PostThreadInfo, p as PostUrlPreview$1, q as PostBulkAction, r as PostDetails, s as PostComment } from './server-FTUA8opZ.cjs';
4
- export { t as COUNTRIES, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, J as PlatformMetadata, K as PostAiAnalysis, M as PostAiEntity, N as PostAuthorityTier, O as PostCommentAuthor, Q as PostEmotion, R as PostFlags, T as PostFlow, U as PostIntent, V as PostMediaSensitivity, W as PostMediaStatus, X as PostSource, Y as PostSourceCategory, Z as PostStatus, _ as ReactionBreakdown, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, ap as sourceCategory, aq as toEnglishDigits, ar as toPersianDigits } from './server-FTUA8opZ.cjs';
5
- import { A as ActionStatusKey, b as ActionTypeKey, E as EntityHealthKey, J as JobStatusKey, c as EmotionKey, F as FlowKey, d as StageStatusKey, e as EmotionInput, f as FlowInput, g as StatusInput, h as SeverityInput, a as StatusKey } from './i18n-DD3DMY8O.cjs';
6
- export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, r as JOB_STATUS_KEYS, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, S as SeverityKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-DD3DMY8O.cjs';
3
+ import { I as IranProvinceSlug, C as Country, P as PostData, a as PostView, b as PostAction, c as PostMediaItem, d as PostAuthor, e as PostPlatform, f as PostSentiment, g as PostEnrichmentFlags, h as PostDensity, i as PostOutlet, j as PostBodyData, S as StoryItem, k as PostMetrics, l as PostSeverity, m as PostCluster, n as PostRepostInfo, o as PostThreadInfo, p as PostUrlPreview$1, q as PostBulkAction, r as PostDetails, s as PostComment } from './server-BxuDPPiW.cjs';
4
+ export { t as COUNTRIES, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, J as PlatformMetadata, K as PostAiAnalysis, M as PostAiEntity, N as PostAuthorityTier, O as PostCommentAuthor, Q as PostEmotion, R as PostFlags, T as PostFlow, U as PostIntent, V as PostMediaSensitivity, W as PostMediaStatus, X as PostSource, Y as PostSourceCategory, Z as PostStatus, _ as ReactionBreakdown, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, ap as sourceCategory, aq as toEnglishDigits, ar as toPersianDigits } from './server-BxuDPPiW.cjs';
5
+ import { A as ActionStatusKey, c as ActionTypeKey, E as EntityHealthKey, J as JobStatusKey, d as EmotionKey, b as FlowKey, e as StageStatusKey, f as EmotionInput, F as FlowInput, g as StatusInput, h as SeverityInput, a as StatusKey } from './i18n-B4rvgH-T.cjs';
6
+ export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, r as JOB_STATUS_KEYS, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, S as SeverityKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-B4rvgH-T.cjs';
7
7
  import * as React$1 from 'react';
8
8
  import { LucideIcon } from 'lucide-react';
9
9
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './components/ui/accordion.cjs';
@@ -32,8 +32,8 @@ export { DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHead
32
32
  import { HotkeyCombo } from './hooks/use-hotkeys.cjs';
33
33
  export { UseHotkeysOptions, formatHotkey, useHotkeys } from './hooks/use-hotkeys.cjs';
34
34
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
35
- import { F as FlowData, S as SentimentData } from './concept-card-BU8JL-gj.cjs';
36
- export { C as ConceptCard, a as ConceptCardProps, b as FlowDistribution, c as FlowDistributionProps, d as SentimentDistribution, e as SentimentDistributionProps } from './concept-card-BU8JL-gj.cjs';
35
+ import { F as FlowData, S as SentimentData } from './concept-card-dZeBeup5.cjs';
36
+ export { C as ConceptCard, a as ConceptCardProps, b as FlowDataItem, c as FlowDistribution, d as FlowDistributionProps, e as SentimentDistribution, f as SentimentDistributionProps } from './concept-card-dZeBeup5.cjs';
37
37
  import { DateRange } from 'react-day-picker';
38
38
  import { Drawer as Drawer$1 } from 'vaul';
39
39
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/ui/dropdown-menu.cjs';
@@ -48,7 +48,7 @@ export { IranProvinceCell, IranProvinceHeat, IranProvinceHeatProps, IranProvince
48
48
  import { OTPInput } from 'input-otp';
49
49
  import * as MenubarPrimitive from '@radix-ui/react-menubar';
50
50
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
51
- export { B as BotDetectionData, a as BotDetectionKey, b as BotDetectionMeter, c as BotDetectionMeterProps, P as PageCard, d as PageCardContentMix, e as PageCardProps } from './page-card-DjztZrFM.cjs';
51
+ export { B as BotDetectionData, a as BotDetectionKey, b as BotDetectionMeter, c as BotDetectionMeterProps, P as PageCard, d as PageCardContentMix, e as PageCardProps } from './page-card-DWBUZYwM.cjs';
52
52
  export { PageHeader, PageHeaderProps } from './components/ui/page-header.cjs';
53
53
  export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/ui/popover.cjs';
54
54
  export { Progress, ProgressProps } from './components/ui/progress.cjs';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { S as SupportedLocale } from './utils-Czyp5Ned.js';
2
2
  export { c as cn, a as convertToLocalNumbers, f as formatAbsoluteTime, b as formatLargeNumber, d as formatNumber, e as formatRelativeTime } from './utils-Czyp5Ned.js';
3
- import { I as IranProvinceSlug, C as Country, P as PostData, a as PostView, b as PostAction, c as PostMediaItem, d as PostAuthor, e as PostPlatform, f as PostSentiment, g as PostEnrichmentFlags, h as PostDensity, i as PostOutlet, j as PostBodyData, S as StoryItem, k as PostMetrics, l as PostSeverity, m as PostCluster, n as PostRepostInfo, o as PostThreadInfo, p as PostUrlPreview$1, q as PostBulkAction, r as PostDetails, s as PostComment } from './server-m6tiB6DB.js';
4
- export { t as COUNTRIES, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, J as PlatformMetadata, K as PostAiAnalysis, M as PostAiEntity, N as PostAuthorityTier, O as PostCommentAuthor, Q as PostEmotion, R as PostFlags, T as PostFlow, U as PostIntent, V as PostMediaSensitivity, W as PostMediaStatus, X as PostSource, Y as PostSourceCategory, Z as PostStatus, _ as ReactionBreakdown, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, ap as sourceCategory, aq as toEnglishDigits, ar as toPersianDigits } from './server-m6tiB6DB.js';
5
- import { A as ActionStatusKey, b as ActionTypeKey, E as EntityHealthKey, J as JobStatusKey, c as EmotionKey, F as FlowKey, d as StageStatusKey, e as EmotionInput, f as FlowInput, g as StatusInput, h as SeverityInput, a as StatusKey } from './i18n-UEClNsBy.js';
6
- export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, r as JOB_STATUS_KEYS, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, S as SeverityKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-UEClNsBy.js';
3
+ import { I as IranProvinceSlug, C as Country, P as PostData, a as PostView, b as PostAction, c as PostMediaItem, d as PostAuthor, e as PostPlatform, f as PostSentiment, g as PostEnrichmentFlags, h as PostDensity, i as PostOutlet, j as PostBodyData, S as StoryItem, k as PostMetrics, l as PostSeverity, m as PostCluster, n as PostRepostInfo, o as PostThreadInfo, p as PostUrlPreview$1, q as PostBulkAction, r as PostDetails, s as PostComment } from './server-Cfw5kIug.js';
4
+ export { t as COUNTRIES, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, J as PlatformMetadata, K as PostAiAnalysis, M as PostAiEntity, N as PostAuthorityTier, O as PostCommentAuthor, Q as PostEmotion, R as PostFlags, T as PostFlow, U as PostIntent, V as PostMediaSensitivity, W as PostMediaStatus, X as PostSource, Y as PostSourceCategory, Z as PostStatus, _ as ReactionBreakdown, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, ap as sourceCategory, aq as toEnglishDigits, ar as toPersianDigits } from './server-Cfw5kIug.js';
5
+ import { A as ActionStatusKey, c as ActionTypeKey, E as EntityHealthKey, J as JobStatusKey, d as EmotionKey, b as FlowKey, e as StageStatusKey, f as EmotionInput, F as FlowInput, g as StatusInput, h as SeverityInput, a as StatusKey } from './i18n-CZQ2kPWD.js';
6
+ export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, r as JOB_STATUS_KEYS, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, S as SeverityKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-CZQ2kPWD.js';
7
7
  import * as React$1 from 'react';
8
8
  import { LucideIcon } from 'lucide-react';
9
9
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './components/ui/accordion.js';
@@ -32,8 +32,8 @@ export { DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHead
32
32
  import { HotkeyCombo } from './hooks/use-hotkeys.js';
33
33
  export { UseHotkeysOptions, formatHotkey, useHotkeys } from './hooks/use-hotkeys.js';
34
34
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
35
- import { F as FlowData, S as SentimentData } from './concept-card-D7PfDkNR.js';
36
- export { C as ConceptCard, a as ConceptCardProps, b as FlowDistribution, c as FlowDistributionProps, d as SentimentDistribution, e as SentimentDistributionProps } from './concept-card-D7PfDkNR.js';
35
+ import { F as FlowData, S as SentimentData } from './concept-card-DX5zRCk2.js';
36
+ export { C as ConceptCard, a as ConceptCardProps, b as FlowDataItem, c as FlowDistribution, d as FlowDistributionProps, e as SentimentDistribution, f as SentimentDistributionProps } from './concept-card-DX5zRCk2.js';
37
37
  import { DateRange } from 'react-day-picker';
38
38
  import { Drawer as Drawer$1 } from 'vaul';
39
39
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/ui/dropdown-menu.js';
@@ -48,7 +48,7 @@ export { IranProvinceCell, IranProvinceHeat, IranProvinceHeatProps, IranProvince
48
48
  import { OTPInput } from 'input-otp';
49
49
  import * as MenubarPrimitive from '@radix-ui/react-menubar';
50
50
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
51
- export { B as BotDetectionData, a as BotDetectionKey, b as BotDetectionMeter, c as BotDetectionMeterProps, P as PageCard, d as PageCardContentMix, e as PageCardProps } from './page-card-sIE4lvnb.js';
51
+ export { B as BotDetectionData, a as BotDetectionKey, b as BotDetectionMeter, c as BotDetectionMeterProps, P as PageCard, d as PageCardContentMix, e as PageCardProps } from './page-card-CU6_AmNR.js';
52
52
  export { PageHeader, PageHeaderProps } from './components/ui/page-header.js';
53
53
  export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/ui/popover.js';
54
54
  export { Progress, ProgressProps } from './components/ui/progress.js';
package/dist/index.js CHANGED
@@ -7327,12 +7327,24 @@ var StatusBadge = React127.forwardRef(
7327
7327
  }
7328
7328
  );
7329
7329
  StatusBadge.displayName = "StatusBadge";
7330
- function calcPercents(data) {
7331
- const total = FLOW_KEYS.reduce((s, k) => s + (data[k] ?? 0), 0);
7330
+ function normalizeFlowData(data) {
7331
+ const counts = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
7332
+ if (Array.isArray(data)) {
7333
+ for (const item of data) {
7334
+ const key = resolveFlow(item.type);
7335
+ if (key) counts[key] += item.value ?? 0;
7336
+ }
7337
+ } else {
7338
+ for (const k of FLOW_KEYS) counts[k] = data[k] ?? 0;
7339
+ }
7340
+ return counts;
7341
+ }
7342
+ function calcPercents(counts) {
7343
+ const total = FLOW_KEYS.reduce((s, k) => s + counts[k], 0);
7332
7344
  const result = Object.fromEntries(FLOW_KEYS.map((k) => [k, 0]));
7333
7345
  if (total === 0) return result;
7334
- const floats = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).map((k) => {
7335
- const v = (data[k] ?? 0) / total * 100;
7346
+ const floats = FLOW_KEYS.filter((k) => counts[k] > 0).map((k) => {
7347
+ const v = counts[k] / total * 100;
7336
7348
  return { k, floor: Math.floor(v), rem: v - Math.floor(v) };
7337
7349
  });
7338
7350
  const remaining = 100 - floats.reduce((s, f) => s + f.floor, 0);
@@ -7363,7 +7375,8 @@ var FlowDistribution = React127.forwardRef(
7363
7375
  ...props
7364
7376
  }, ref) => {
7365
7377
  const labels = flowLabels[locale] ?? flowLabels.fa;
7366
- const percents = calcPercents(data);
7378
+ const counts = normalizeFlowData(data);
7379
+ const percents = calcPercents(counts);
7367
7380
  const percentSign = locale === "en" ? "%" : "\u066A";
7368
7381
  if (isLoading) {
7369
7382
  return /* @__PURE__ */ jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: variant === "stacked" ? /* @__PURE__ */ jsx("div", { className: "h-3 w-full rounded-full bg-muted animate-pulse" }) : variant === "compact" ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("div", { className: "h-5 w-20 rounded-full bg-muted animate-pulse" }, i)) }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -7373,7 +7386,7 @@ var FlowDistribution = React127.forwardRef(
7373
7386
  ] }, i)) }) });
7374
7387
  }
7375
7388
  if (variant === "stacked") {
7376
- const active = STACKED_ORDER.filter((k) => (data[k] ?? 0) > 0);
7389
+ const active = STACKED_ORDER.filter((k) => counts[k] > 0);
7377
7390
  const srLabel = active.map((k) => `${labels[k]} ${convertToLocalNumbers(percents[k], locale)}${percentSign}`).join("\u060C ");
7378
7391
  return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-2", className), ...props, children: [
7379
7392
  /* @__PURE__ */ jsx("div", { className: "flex h-3 w-full overflow-hidden rounded-full bg-muted", role: "img", "aria-label": srLabel, children: active.map((k) => /* @__PURE__ */ jsx(
@@ -7399,14 +7412,14 @@ var FlowDistribution = React127.forwardRef(
7399
7412
  ] }),
7400
7413
  showCounts && /* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
7401
7414
  "(",
7402
- convertToLocalNumbers(data[k] ?? 0, locale),
7415
+ convertToLocalNumbers(counts[k], locale),
7403
7416
  ")"
7404
7417
  ] })
7405
7418
  ] }, k)) })
7406
7419
  ] });
7407
7420
  }
7408
7421
  if (variant === "compact") {
7409
- const active = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
7422
+ const active = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
7410
7423
  return /* @__PURE__ */ jsx(
7411
7424
  "div",
7412
7425
  {
@@ -7430,7 +7443,7 @@ var FlowDistribution = React127.forwardRef(
7430
7443
  ] }),
7431
7444
  showCounts && /* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
7432
7445
  "(",
7433
- convertToLocalNumbers(data[k] ?? 0, locale),
7446
+ convertToLocalNumbers(counts[k], locale),
7434
7447
  ")"
7435
7448
  ] })
7436
7449
  ]
@@ -7440,7 +7453,7 @@ var FlowDistribution = React127.forwardRef(
7440
7453
  }
7441
7454
  );
7442
7455
  }
7443
- const sorted = FLOW_KEYS.filter((k) => (data[k] ?? 0) > 0).sort((a, b) => (data[b] ?? 0) - (data[a] ?? 0));
7456
+ const sorted = FLOW_KEYS.filter((k) => counts[k] > 0).sort((a, b) => counts[b] - counts[a]);
7444
7457
  return /* @__PURE__ */ jsx("div", { ref, "data-slot": "flow-distribution", className: cn("space-y-1.5", className), ...props, children: sorted.map((k) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7445
7458
  /* @__PURE__ */ jsx("span", { className: "w-24 shrink-0 text-xs text-foreground-light text-end", children: labels[k] }),
7446
7459
  /* @__PURE__ */ jsx("div", { className: "relative flex-1 h-2 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx(
@@ -7463,7 +7476,7 @@ var FlowDistribution = React127.forwardRef(
7463
7476
  {
7464
7477
  className: "w-12 shrink-0 text-xs font-medium tabular-nums text-start",
7465
7478
  style: { color: `var(${tokenVar3(k)})` },
7466
- children: showCounts ? convertToLocalNumbers((data[k] ?? 0).toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
7479
+ children: showCounts ? convertToLocalNumbers(counts[k].toLocaleString(), locale) : `${convertToLocalNumbers(percents[k], locale)}${percentSign}`
7467
7480
  }
7468
7481
  )
7469
7482
  ] }, k)) });
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from './utils-Czyp5Ned.js';
3
3
  import { SocialPlatform } from './components/ui/social-platform-badge.js';
4
- import { a as StatusKey } from './i18n-UEClNsBy.js';
4
+ import { a as StatusKey } from './i18n-CZQ2kPWD.js';
5
5
 
6
6
  type BotDetectionKey = 'real' | 'suspicious' | 'bot';
7
7
  interface BotDetectionData {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { S as SupportedLocale } from './utils-Czyp5Ned.cjs';
3
3
  import { SocialPlatform } from './components/ui/social-platform-badge.cjs';
4
- import { a as StatusKey } from './i18n-DD3DMY8O.cjs';
4
+ import { a as StatusKey } from './i18n-B4rvgH-T.cjs';
5
5
 
6
6
  type BotDetectionKey = 'real' | 'suspicious' | 'bot';
7
7
  interface BotDetectionData {
@@ -1,5 +1,5 @@
1
1
  import { S as SupportedLocale } from './utils-Czyp5Ned.cjs';
2
- import './i18n-DD3DMY8O.cjs';
2
+ import './i18n-B4rvgH-T.cjs';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import { SocialPlatform } from './components/ui/social-platform-badge.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { S as SupportedLocale } from './utils-Czyp5Ned.js';
2
- import './i18n-UEClNsBy.js';
2
+ import './i18n-CZQ2kPWD.js';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import { SocialPlatform } from './components/ui/social-platform-badge.js';
5
5
 
package/dist/server.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { S as SupportedLocale, c as cn, a as convertToLocalNumbers, f as formatAbsoluteTime, b as formatLargeNumber, d as formatNumber, e as formatRelativeTime } from './utils-Czyp5Ned.cjs';
2
- export { t as COUNTRIES, C as Country, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, I as IranProvinceSlug, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, aq as toEnglishDigits, ar as toPersianDigits } from './server-FTUA8opZ.cjs';
3
- export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, A as ActionStatusKey, b as ActionTypeKey, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, e as EmotionInput, c as EmotionKey, E as EntityHealthKey, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, f as FlowInput, F as FlowKey, r as JOB_STATUS_KEYS, J as JobStatusKey, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, h as SeverityInput, S as SeverityKey, d as StageStatusKey, g as StatusInput, a as StatusKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-DD3DMY8O.cjs';
2
+ export { t as COUNTRIES, C as Country, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, I as IranProvinceSlug, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, aq as toEnglishDigits, ar as toPersianDigits } from './server-BxuDPPiW.cjs';
3
+ export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, A as ActionStatusKey, c as ActionTypeKey, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, f as EmotionInput, d as EmotionKey, E as EntityHealthKey, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, F as FlowInput, b as FlowKey, r as JOB_STATUS_KEYS, J as JobStatusKey, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, h as SeverityInput, S as SeverityKey, e as StageStatusKey, g as StatusInput, a as StatusKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-B4rvgH-T.cjs';
4
4
  import 'clsx';
5
5
  import 'lucide-react';
6
6
  import './components/ui/social-platform-badge.cjs';
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { S as SupportedLocale, c as cn, a as convertToLocalNumbers, f as formatAbsoluteTime, b as formatLargeNumber, d as formatNumber, e as formatRelativeTime } from './utils-Czyp5Ned.js';
2
- export { t as COUNTRIES, C as Country, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, I as IranProvinceSlug, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, aq as toEnglishDigits, ar as toPersianDigits } from './server-m6tiB6DB.js';
3
- export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, A as ActionStatusKey, b as ActionTypeKey, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, e as EmotionInput, c as EmotionKey, E as EntityHealthKey, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, f as FlowInput, F as FlowKey, r as JOB_STATUS_KEYS, J as JobStatusKey, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, h as SeverityInput, S as SeverityKey, d as StageStatusKey, g as StatusInput, a as StatusKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-UEClNsBy.js';
2
+ export { t as COUNTRIES, C as Country, u as CountryCode, E as ENGAGEMENT_RANGES, v as EngagementRange, w as EngagementRangeWithDisplay, x as EngagementTier, F as FollowerGroup, G as GROUP_LABELS, y as IRAN_PROVINCES, z as IranProvince, I as IranProvinceSlug, L as LegacySize, A as PERSIAN_MONTHS, B as PERSIAN_MONTHS_SHORT, D as PERSIAN_WEEKDAYS, H as PERSIAN_WEEKDAYS_SHORT, $ as SizeWithLegacy, a0 as StandardSize, a1 as TIER_LABELS, a2 as countryFlag, a3 as findCountry, a4 as findProvince, a5 as formatJalaliDate, a6 as formatPersianDateRange, a7 as getCountryLabel, a8 as getCurrentRangeIndex, a9 as getEngagementRanges, aa as getFollowerGroup, ab as getMetricLabel, ac as getPersianDay, ad as getPersianMonth, ae as getPersianMonthName, af as getPersianMonthNameShort, ag as getPersianMonthsForDropdown, ah as getPersianWeekdayName, ai as getPersianYear, aj as getPersianYearsForDropdown, ak as getPostSourceConfig, al as getProvinceLabel, am as getSourceColorVar, an as jalaliToGregorian, ao as normalizeSize, aq as toEnglishDigits, ar as toPersianDigits } from './server-Cfw5kIug.js';
3
+ export { i as ACTION_STATUS_KEYS, j as ACTION_TYPE_KEYS, A as ActionStatusKey, c as ActionTypeKey, k as EMOTION_KEYS, l as EMOTION_KEY_TO_VALUE, m as EMOTION_VALUE_MAP, n as ENTITY_HEALTH_KEYS, f as EmotionInput, d as EmotionKey, E as EntityHealthKey, o as FLOW_KEYS, p as FLOW_KEY_TO_VALUE, q as FLOW_VALUE_MAP, F as FlowInput, b as FlowKey, r as JOB_STATUS_KEYS, J as JobStatusKey, L as Locale, s as SEVERITY_KEYS, t as SEVERITY_KEY_TO_VALUE, u as SEVERITY_VALUE_MAP, v as STAGE_STATUS_KEYS, w as STATUS_KEYS, x as STATUS_KEY_TO_VALUE, y as STATUS_VALUE_MAP, h as SeverityInput, S as SeverityKey, e as StageStatusKey, g as StatusInput, a as StatusKey, U as UIStringKeys, z as UIStrings, B as UI_STRINGS, C as actionStatusLabels, D as actionTypeLabels, G as actionTypeVerbs, H as emotionLabels, I as engagementUiTranslations, K as entityHealthLabels, M as entityHealthPriority, N as flowLabels, O as formatRelativeLocaleTime, P as formatTimeRemaining, Q as getUIStrings, R as isActiveJobStatus, T as isCriticalEntityHealth, V as isRTL, W as jobStatusLabels, X as resolveEmotion, Y as resolveFlow, Z as resolveSeverity, _ as resolveStatus, $ as sentimentLabels, a0 as severityLabels, a1 as stageStatusLabels, a2 as statusLabels } from './i18n-CZQ2kPWD.js';
4
4
  import 'clsx';
5
5
  import 'lucide-react';
6
6
  import './components/ui/social-platform-badge.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parto-system-design/ui",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "Persian-first, RTL-native React component library for public-opinion monitoring (افکارسنجی), social listening, and influencer analytics — Supabase-style design language adapted for Farsi typography.",
5
5
  "license": "MIT",
6
6
  "author": "Parto Design System contributors",