@parto-system-design/ui 1.1.19 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/components/ui/alert-rule-card.d.cts +1 -1
  2. package/dist/components/ui/alert-rule-card.d.ts +1 -1
  3. package/dist/components/ui/badge.d.cts +1 -1
  4. package/dist/components/ui/badge.d.ts +1 -1
  5. package/dist/components/ui/button.d.cts +2 -2
  6. package/dist/components/ui/button.d.ts +2 -2
  7. package/dist/components/ui/concept-card.cjs +40 -12
  8. package/dist/components/ui/concept-card.d.cts +2 -2
  9. package/dist/components/ui/concept-card.d.ts +2 -2
  10. package/dist/components/ui/concept-card.js +40 -12
  11. package/dist/components/ui/page-card.d.cts +2 -2
  12. package/dist/components/ui/page-card.d.ts +2 -2
  13. package/dist/components/ui/switch.d.cts +1 -1
  14. package/dist/components/ui/switch.d.ts +1 -1
  15. package/dist/{concept-card-D7PfDkNR.d.ts → concept-card-DX5zRCk2.d.ts} +15 -4
  16. package/dist/{concept-card-BU8JL-gj.d.cts → concept-card-dZeBeup5.d.cts} +15 -4
  17. package/dist/{i18n-DD3DMY8O.d.cts → i18n-B4rvgH-T.d.cts} +1 -1
  18. package/dist/{i18n-UEClNsBy.d.ts → i18n-CZQ2kPWD.d.ts} +1 -1
  19. package/dist/index.cjs +49 -23
  20. package/dist/index.d.cts +20 -9
  21. package/dist/index.d.ts +20 -9
  22. package/dist/index.js +49 -23
  23. package/dist/{page-card-sIE4lvnb.d.ts → page-card-CU6_AmNR.d.ts} +1 -1
  24. package/dist/{page-card-DjztZrFM.d.cts → page-card-DWBUZYwM.d.cts} +1 -1
  25. package/dist/{server-FTUA8opZ.d.cts → server-BxuDPPiW.d.cts} +1 -1
  26. package/dist/{server-m6tiB6DB.d.ts → server-Cfw5kIug.d.ts} +1 -1
  27. package/dist/server.d.cts +2 -2
  28. package/dist/server.d.ts +2 -2
  29. package/package.json +1 -1
@@ -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,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const badgeVariants: (props?: ({
6
6
  variant?: "warning" | "success" | "default" | "outline" | "destructive" | "secondary" | "brand" | null | undefined;
7
- size?: "small" | "xs" | "sm" | "md" | "lg" | "large" | "tiny" | null | undefined;
7
+ size?: "xs" | "sm" | "md" | "lg" | "small" | "large" | "tiny" | null | undefined;
8
8
  dot?: boolean | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const badgeVariants: (props?: ({
6
6
  variant?: "warning" | "success" | "default" | "outline" | "destructive" | "secondary" | "brand" | null | undefined;
7
- size?: "small" | "xs" | "sm" | "md" | "lg" | "large" | "tiny" | null | undefined;
7
+ size?: "xs" | "sm" | "md" | "lg" | "small" | "large" | "tiny" | null | undefined;
8
8
  dot?: boolean | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
@@ -4,7 +4,7 @@ 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?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
@@ -12,7 +12,7 @@ declare const buttonVariants: (props?: ({
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?: "warning" | "link" | "text" | "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,7 +4,7 @@ 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?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
@@ -12,7 +12,7 @@ declare const buttonVariants: (props?: ({
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?: "warning" | "link" | "text" | "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';
@@ -4,7 +4,7 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const switchRootVariants: (props?: ({
7
- size?: "small" | "medium" | "sm" | "md" | "lg" | "large" | null | undefined;
7
+ size?: "medium" | "sm" | "md" | "lg" | "small" | "large" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, VariantProps<typeof switchRootVariants> {
10
10
  }
@@ -4,7 +4,7 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const switchRootVariants: (props?: ({
7
- size?: "small" | "medium" | "sm" | "md" | "lg" | "large" | null | undefined;
7
+ size?: "medium" | "sm" | "md" | "lg" | "small" | "large" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, VariantProps<typeof switchRootVariants> {
10
10
  }
@@ -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 };