@fanvue/ui 3.23.0 → 3.24.0

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 (109) hide show
  1. package/dist/charts.d.ts +94 -4
  2. package/dist/charts.mjs +4 -0
  3. package/dist/charts.mjs.map +1 -1
  4. package/dist/cjs/charts.cjs +4 -0
  5. package/dist/cjs/charts.cjs.map +1 -1
  6. package/dist/cjs/components/AiButton/AiButton.cjs +170 -0
  7. package/dist/cjs/components/AiButton/AiButton.cjs.map +1 -0
  8. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs +170 -0
  9. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs.map +1 -0
  10. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +24 -2
  11. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  12. package/dist/cjs/components/Chart/ChartMetricTrend.cjs +71 -0
  13. package/dist/cjs/components/Chart/ChartMetricTrend.cjs.map +1 -0
  14. package/dist/cjs/components/Chart/ChartSkeleton.cjs +95 -0
  15. package/dist/cjs/components/Chart/ChartSkeleton.cjs.map +1 -0
  16. package/dist/cjs/components/Chip/Chip.cjs +40 -11
  17. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  18. package/dist/cjs/components/CountryFlag/CountryFlag.cjs +91 -0
  19. package/dist/cjs/components/CountryFlag/CountryFlag.cjs.map +1 -0
  20. package/dist/cjs/components/CountryFlag/flagShapes.cjs +3358 -0
  21. package/dist/cjs/components/CountryFlag/flagShapes.cjs.map +1 -0
  22. package/dist/cjs/components/CyclingText/CyclingText.cjs +9 -26
  23. package/dist/cjs/components/CyclingText/CyclingText.cjs.map +1 -1
  24. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs +53 -0
  25. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs.map +1 -0
  26. package/dist/cjs/components/Demographics/Demographics.cjs +39 -0
  27. package/dist/cjs/components/Demographics/Demographics.cjs.map +1 -0
  28. package/dist/cjs/components/Drawer/Drawer.cjs +9 -1
  29. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  30. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +122 -16
  31. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
  32. package/dist/cjs/components/IconButton/IconButton.cjs +11 -1
  33. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  34. package/dist/cjs/components/ProgressBar/ProgressBar.cjs +9 -1
  35. package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
  36. package/dist/cjs/components/Tabs/TabsList.cjs +123 -91
  37. package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
  38. package/dist/cjs/components/Tooltip/Tooltip.cjs +36 -25
  39. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  40. package/dist/cjs/components/Tooltip/TooltipLabel.cjs +71 -0
  41. package/dist/cjs/components/Tooltip/TooltipLabel.cjs.map +1 -0
  42. package/dist/cjs/components/TrendPill/TrendPill.cjs +46 -0
  43. package/dist/cjs/components/TrendPill/TrendPill.cjs.map +1 -0
  44. package/dist/cjs/components/UserItem/UserItem.cjs +7 -2
  45. package/dist/cjs/components/UserItem/UserItem.cjs.map +1 -1
  46. package/dist/cjs/components/UserItem/UserItemTrailing.cjs +34 -0
  47. package/dist/cjs/components/UserItem/UserItemTrailing.cjs.map +1 -0
  48. package/dist/cjs/flags.cjs +6 -0
  49. package/dist/cjs/flags.cjs.map +1 -0
  50. package/dist/cjs/index.cjs +13 -0
  51. package/dist/cjs/index.cjs.map +1 -1
  52. package/dist/cjs/{components/CyclingText → utils}/usePrefersReducedMotion.cjs +14 -14
  53. package/dist/cjs/utils/usePrefersReducedMotion.cjs.map +1 -0
  54. package/dist/components/AiButton/AiButton.mjs +153 -0
  55. package/dist/components/AiButton/AiButton.mjs.map +1 -0
  56. package/dist/components/AnimatedNumber/AnimatedNumber.mjs +153 -0
  57. package/dist/components/AnimatedNumber/AnimatedNumber.mjs.map +1 -0
  58. package/dist/components/Chart/ChartLoadingOverlay.mjs +24 -2
  59. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  60. package/dist/components/Chart/ChartMetricTrend.mjs +54 -0
  61. package/dist/components/Chart/ChartMetricTrend.mjs.map +1 -0
  62. package/dist/components/Chart/ChartSkeleton.mjs +78 -0
  63. package/dist/components/Chart/ChartSkeleton.mjs.map +1 -0
  64. package/dist/components/Chip/Chip.mjs +40 -11
  65. package/dist/components/Chip/Chip.mjs.map +1 -1
  66. package/dist/components/CountryFlag/CountryFlag.mjs +74 -0
  67. package/dist/components/CountryFlag/CountryFlag.mjs.map +1 -0
  68. package/dist/components/CountryFlag/flagShapes.mjs +3358 -0
  69. package/dist/components/CountryFlag/flagShapes.mjs.map +1 -0
  70. package/dist/components/CyclingText/CyclingText.mjs +9 -26
  71. package/dist/components/CyclingText/CyclingText.mjs.map +1 -1
  72. package/dist/components/CyclingText/useCyclingMotion.mjs +36 -0
  73. package/dist/components/CyclingText/useCyclingMotion.mjs.map +1 -0
  74. package/dist/components/Demographics/Demographics.mjs +22 -0
  75. package/dist/components/Demographics/Demographics.mjs.map +1 -0
  76. package/dist/components/Drawer/Drawer.mjs +9 -1
  77. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  78. package/dist/components/DropdownMenu/DropdownMenu.mjs +122 -16
  79. package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
  80. package/dist/components/IconButton/IconButton.mjs +11 -1
  81. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  82. package/dist/components/ProgressBar/ProgressBar.mjs +9 -1
  83. package/dist/components/ProgressBar/ProgressBar.mjs.map +1 -1
  84. package/dist/components/Tabs/TabsList.mjs +123 -91
  85. package/dist/components/Tabs/TabsList.mjs.map +1 -1
  86. package/dist/components/Tooltip/Tooltip.mjs +37 -26
  87. package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
  88. package/dist/components/Tooltip/TooltipLabel.mjs +54 -0
  89. package/dist/components/Tooltip/TooltipLabel.mjs.map +1 -0
  90. package/dist/components/TrendPill/TrendPill.mjs +29 -0
  91. package/dist/components/TrendPill/TrendPill.mjs.map +1 -0
  92. package/dist/components/UserItem/UserItem.mjs +7 -2
  93. package/dist/components/UserItem/UserItem.mjs.map +1 -1
  94. package/dist/components/UserItem/UserItemTrailing.mjs +17 -0
  95. package/dist/components/UserItem/UserItemTrailing.mjs.map +1 -0
  96. package/dist/flags.d.ts +59 -0
  97. package/dist/flags.mjs +6 -0
  98. package/dist/flags.mjs.map +1 -0
  99. package/dist/index.d.ts +381 -11
  100. package/dist/index.mjs +14 -1
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/styles/base.css +166 -0
  103. package/dist/styles/theme.css +12 -0
  104. package/dist/utils/usePrefersReducedMotion.mjs +22 -0
  105. package/dist/utils/usePrefersReducedMotion.mjs.map +1 -0
  106. package/package.json +13 -2
  107. package/dist/cjs/components/CyclingText/usePrefersReducedMotion.cjs.map +0 -1
  108. package/dist/components/CyclingText/usePrefersReducedMotion.mjs +0 -22
  109. package/dist/components/CyclingText/usePrefersReducedMotion.mjs.map +0 -1
package/dist/charts.d.ts CHANGED
@@ -193,13 +193,16 @@ export declare interface ChartLegendContentProps extends React_2.HTMLAttributes<
193
193
  }
194
194
 
195
195
  /**
196
- * A positioned overlay that displays a loading spinner on top of chart content.
197
- * The children are always rendered to maintain layout dimensions; the overlay
198
- * covers them with a semi-transparent background and a centered spinner.
196
+ * A positioned overlay shown on top of chart content while it loads. The children
197
+ * are always rendered to maintain layout dimensions.
198
+ *
199
+ * By default the overlay is opaque and shows a wave-animated
200
+ * {@link ChartSkeleton} shaped like the chart. At `variant={false}` it falls back
201
+ * to a semi-transparent wash with a centred spinner.
199
202
  *
200
203
  * @example
201
204
  * ```tsx
202
- * <ChartLoadingOverlay loading={isFetching}>
205
+ * <ChartLoadingOverlay loading={isFetching} variant="area">
203
206
  * <ChartContainer config={config} className="min-h-48">
204
207
  * <LineChart data={data}>...</LineChart>
205
208
  * </ChartContainer>
@@ -212,10 +215,58 @@ export declare const ChartLoadingOverlay: React_2.ForwardRefExoticComponent<Char
212
215
  export declare interface ChartLoadingOverlayProps extends React_2.HTMLAttributes<HTMLDivElement> {
213
216
  /** Whether to show the loading overlay. @default false */
214
217
  loading?: boolean;
218
+ /**
219
+ * Shape of the wave-animated {@link ChartSkeleton} shown while loading. Set it
220
+ * to match the chart underneath — `circular` for pie/radial, `bar` for bar
221
+ * charts. Pass `false` to fall back to the legacy centred spinner.
222
+ * @default "area"
223
+ */
224
+ variant?: ChartSkeletonVariant | false;
225
+ /**
226
+ * Accessible name for the loading region, announced while `loading` is true.
227
+ * Pass a translated string for i18n. Only applies to the skeleton path; the
228
+ * `variant={false}` spinner carries its own label. @default "Loading chart"
229
+ */
230
+ loadingLabel?: string;
215
231
  /** Chart content to render underneath the overlay. */
216
232
  children: React_2.ReactNode;
217
233
  }
218
234
 
235
+ /**
236
+ * The small area chart inside a metric tile, per the `V2 Area Chart Item` slot of
237
+ * the Figma insight card.
238
+ *
239
+ * `series` is optional because the endpoints behind these cards often return a
240
+ * single scalar with no history. With nothing to plot the chart draws a flat line
241
+ * at the current value rather than collapsing the slot, so the card keeps the
242
+ * height and shape the design gives it. The line is deliberately level rather
243
+ * than shaped, so it asserts no history that the data cannot support.
244
+ *
245
+ * @example
246
+ * ```tsx
247
+ * <ChartMetricTrend value={42} color="teal" />
248
+ * ```
249
+ */
250
+ export declare const ChartMetricTrend: React_2.ForwardRefExoticComponent<ChartMetricTrendProps & React_2.RefAttributes<HTMLDivElement>>;
251
+
252
+ /**
253
+ * Each card carries its own gradient in the design: red on Retention Rate,
254
+ * green on Average Fan Lifetime. The DS has no `special-chart-green`, so the
255
+ * green maps to `teal` (#28ba8e) — the emerald in the Figma render, as opposed
256
+ * to `lime` (#8fcb3a), which is yellow-green.
257
+ */
258
+ export declare type ChartMetricTrendColor = "red" | "teal";
259
+
260
+ /** Props for {@link ChartMetricTrend}. */
261
+ export declare interface ChartMetricTrendProps extends React_2.HTMLAttributes<HTMLDivElement> {
262
+ /** Current value. Also the flat-line height when `series` is absent. */
263
+ value: number;
264
+ /** Gradient and stroke colour. */
265
+ color: ChartMetricTrendColor;
266
+ /** History to plot. Needs more than one point to draw a shape. */
267
+ series?: number[];
268
+ }
269
+
219
270
  /**
220
271
  * A side legend for pie/donut charts that shows each slice's label,
221
272
  * formatted value, and a proportional progress bar.
@@ -295,6 +346,45 @@ export declare interface ChartSeriesToggleProps extends React_2.HTMLAttributes<H
295
346
  onValueChange: (value: Set<string>) => void;
296
347
  }
297
348
 
349
+ /**
350
+ * A wave-animated placeholder shaped like the content it stands in for — a chart
351
+ * series, a ranked table, or a breakdown of labelled bars. Use it while data
352
+ * loads instead of a generic spinner, so the layout does not visibly shift once
353
+ * the real content renders.
354
+ *
355
+ * For a chart body, pass it to {@link ChartLoadingOverlay} via its `variant` prop
356
+ * rather than rendering it directly. For a card body, pass it to `ChartCard`'s
357
+ * `skeleton` prop.
358
+ *
359
+ * @example
360
+ * ```tsx
361
+ * <ChartSkeleton variant="bar" className="h-48" />
362
+ * <ChartSkeleton variant="table" rows={5} />
363
+ * ```
364
+ */
365
+ export declare const ChartSkeleton: React_2.ForwardRefExoticComponent<ChartSkeletonProps & React_2.RefAttributes<HTMLDivElement>>;
366
+
367
+ /** Props for {@link ChartSkeleton}. */
368
+ export declare interface ChartSkeletonProps extends React_2.HTMLAttributes<HTMLDivElement> {
369
+ /** Which shape to imitate. @default "area" */
370
+ variant?: ChartSkeletonVariant;
371
+ /**
372
+ * How many items to draw: rows for `table` and `rows`, bars for `bar`. Match
373
+ * the count the loaded card will show, so the card does not resize once the
374
+ * real content arrives. Defaults to 5 rows, or 7 bars.
375
+ */
376
+ rows?: number;
377
+ }
378
+
379
+ /**
380
+ * Shape the skeleton should imitate while data loads. `area` and `line` render
381
+ * the same filled band — a continuous series reads better as a band than as
382
+ * discrete bars. `table` and `rows` stand in for the two list bodies an insight
383
+ * card can hold rather than a chart: a ranked table, and a breakdown of labelled
384
+ * bars.
385
+ */
386
+ export declare type ChartSkeletonVariant = "area" | "line" | "bar" | "circular" | "table" | "rows";
387
+
298
388
  /**
299
389
  * Injects a scoped `<style>` tag that maps each config entry to a
300
390
  * `--color-{key}` CSS custom property, with light/dark theme support.
package/dist/charts.mjs CHANGED
@@ -4,8 +4,10 @@ import { ChartCenterLabel } from "./components/Chart/ChartCenterLabel.mjs";
4
4
  import { ChartContainer } from "./components/Chart/ChartContainer.mjs";
5
5
  import { ChartLegend, ChartLegendContent } from "./components/Chart/ChartLegend.mjs";
6
6
  import { ChartLoadingOverlay } from "./components/Chart/ChartLoadingOverlay.mjs";
7
+ import { ChartMetricTrend } from "./components/Chart/ChartMetricTrend.mjs";
7
8
  import { ChartPieLegend } from "./components/Chart/ChartPieLegend.mjs";
8
9
  import { ChartSeriesToggle } from "./components/Chart/ChartSeriesToggle.mjs";
10
+ import { ChartSkeleton } from "./components/Chart/ChartSkeleton.mjs";
9
11
  import { ChartStyle } from "./components/Chart/ChartStyle.mjs";
10
12
  import { ChartTooltip, ChartTooltipContent } from "./components/Chart/ChartTooltip.mjs";
11
13
  import { resolveConfigEntry } from "./components/Chart/chartUtils.mjs";
@@ -17,8 +19,10 @@ export {
17
19
  ChartLegend,
18
20
  ChartLegendContent,
19
21
  ChartLoadingOverlay,
22
+ ChartMetricTrend,
20
23
  ChartPieLegend,
21
24
  ChartSeriesToggle,
25
+ ChartSkeleton,
22
26
  ChartStyle,
23
27
  ChartTooltip,
24
28
  ChartTooltipContent,
@@ -1 +1 @@
1
- {"version":3,"file":"charts.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"charts.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -6,8 +6,10 @@ const ChartCenterLabel = require("./components/Chart/ChartCenterLabel.cjs");
6
6
  const ChartContainer = require("./components/Chart/ChartContainer.cjs");
7
7
  const ChartLegend = require("./components/Chart/ChartLegend.cjs");
8
8
  const ChartLoadingOverlay = require("./components/Chart/ChartLoadingOverlay.cjs");
9
+ const ChartMetricTrend = require("./components/Chart/ChartMetricTrend.cjs");
9
10
  const ChartPieLegend = require("./components/Chart/ChartPieLegend.cjs");
10
11
  const ChartSeriesToggle = require("./components/Chart/ChartSeriesToggle.cjs");
12
+ const ChartSkeleton = require("./components/Chart/ChartSkeleton.cjs");
11
13
  const ChartStyle = require("./components/Chart/ChartStyle.cjs");
12
14
  const ChartTooltip = require("./components/Chart/ChartTooltip.cjs");
13
15
  const chartUtils = require("./components/Chart/chartUtils.cjs");
@@ -18,8 +20,10 @@ exports.ChartContainer = ChartContainer.ChartContainer;
18
20
  exports.ChartLegend = ChartLegend.ChartLegend;
19
21
  exports.ChartLegendContent = ChartLegend.ChartLegendContent;
20
22
  exports.ChartLoadingOverlay = ChartLoadingOverlay.ChartLoadingOverlay;
23
+ exports.ChartMetricTrend = ChartMetricTrend.ChartMetricTrend;
21
24
  exports.ChartPieLegend = ChartPieLegend.ChartPieLegend;
22
25
  exports.ChartSeriesToggle = ChartSeriesToggle.ChartSeriesToggle;
26
+ exports.ChartSkeleton = ChartSkeleton.ChartSkeleton;
23
27
  exports.ChartStyle = ChartStyle.ChartStyle;
24
28
  exports.ChartTooltip = ChartTooltip.ChartTooltip;
25
29
  exports.ChartTooltipContent = ChartTooltip.ChartTooltipContent;
@@ -1 +1 @@
1
- {"version":3,"file":"charts.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"charts.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const React = require("react");
6
+ const cn = require("../../utils/cn.cjs");
7
+ const AIIcon = require("../Icons/AIIcon.cjs");
8
+ function _interopNamespaceDefault(e) {
9
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
+ if (e) {
11
+ for (const k in e) {
12
+ if (k !== "default") {
13
+ const d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: () => e[k]
17
+ });
18
+ }
19
+ }
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
+ const sizeVariants = {
26
+ // At 24 the label steps down to the 12px description scale: the 14px label
27
+ // Button uses at this height leaves the glyph and text crowding a 24px box,
28
+ // since 16px is the smallest authored icon geometry and cannot step down with it.
29
+ "24": "h-6 gap-1 px-2 py-1 typography-description-12px-semibold",
30
+ "32": "h-8 gap-2 px-3 py-[7px] typography-body-small-14px-semibold",
31
+ "40": "h-10 gap-2 px-4 py-2 typography-body-default-16px-semibold"
32
+ };
33
+ const iconSizeVariants = {
34
+ "24": 16,
35
+ "32": 16,
36
+ "40": 24
37
+ };
38
+ const iconScaleVariants = {
39
+ "24": "[&_svg]:size-3.5",
40
+ "32": "",
41
+ "40": ""
42
+ };
43
+ const LETTER_STAGGER = 0.08;
44
+ const trackPointer = (event) => {
45
+ const { left, width } = event.currentTarget.getBoundingClientRect();
46
+ event.currentTarget.style.setProperty("--fv-ai-x", `${(event.clientX - left) / width * 100}%`);
47
+ };
48
+ const ShimmerLabel = ({ text, disabled }) => /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: Array.from(text).map((character, index) => /* @__PURE__ */ jsxRuntime.jsx(
49
+ "span",
50
+ {
51
+ className: cn.cn(
52
+ "inline-block whitespace-pre text-content-secondary",
53
+ // Gated in JS rather than with a `group-disabled/ai:` override, because
54
+ // that would rely on the generated rule ordering to beat `group-hover`.
55
+ // A faded control that still shimmers and still lights up green under the
56
+ // cursor reads as busy rather than unavailable.
57
+ !disabled && [
58
+ "[animation:fv-ai-letter_2s_ease-in-out_infinite]",
59
+ "group-hover/ai:text-content-primary group-hover/ai:[animation:none]",
60
+ // On focus each letter blows up and settles, then the idle shimmer
61
+ // resumes underneath it — the two animations are sequenced by delay.
62
+ "group-focus-visible/ai:[animation:fv-ai-letter-focus_1s_ease-in-out,fv-ai-letter_1.2s_ease-in-out_infinite_1s]",
63
+ "group-active/ai:text-content-primary group-active/ai:[animation:none]",
64
+ "group-active/ai:[text-shadow:0_0_4px_var(--color-content-primary)]"
65
+ ],
66
+ "motion-reduce:[animation:none]"
67
+ ),
68
+ style: { animationDelay: `${index * LETTER_STAGGER}s` },
69
+ children: character
70
+ },
71
+ `${character}-${index}`
72
+ )) });
73
+ const AiButton = React__namespace.forwardRef(
74
+ ({
75
+ label,
76
+ activeLabel,
77
+ active = false,
78
+ size = "32",
79
+ icon,
80
+ type = "button",
81
+ className,
82
+ disabled,
83
+ onPointerMove,
84
+ onPointerLeave,
85
+ ...props
86
+ }, ref) => {
87
+ const resolvedActiveLabel = activeLabel ?? label;
88
+ return /* @__PURE__ */ jsxRuntime.jsxs(
89
+ "button",
90
+ {
91
+ ref,
92
+ type,
93
+ disabled,
94
+ "aria-label": props["aria-label"] ?? (active ? resolvedActiveLabel : label),
95
+ "aria-busy": active || void 0,
96
+ onPointerMove: (event) => {
97
+ trackPointer(event);
98
+ onPointerMove?.(event);
99
+ },
100
+ onPointerLeave: (event) => {
101
+ event.currentTarget.style.removeProperty("--fv-ai-x");
102
+ onPointerLeave?.(event);
103
+ },
104
+ className: cn.cn(
105
+ "fv-ai-button",
106
+ "group/ai inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full",
107
+ "border border-border-primary bg-background-primary",
108
+ // Matched to the rim and sheen so the whole treatment arrives as one
109
+ // movement — at the old 300ms the outline landed ahead of the glow.
110
+ "transition-[background-color,border-color] duration-[400ms] ease-out",
111
+ "hover:border-brand-primary-default",
112
+ "focus-visible:outline-none",
113
+ "active:border-brand-primary-hover active:bg-brand-primary-muted",
114
+ "disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border-primary",
115
+ sizeVariants[size],
116
+ className
117
+ ),
118
+ ...props,
119
+ children: [
120
+ /* @__PURE__ */ jsxRuntime.jsx(
121
+ "span",
122
+ {
123
+ className: cn.cn(
124
+ "flex shrink-0 items-center text-content-primary",
125
+ iconScaleVariants[size],
126
+ "[filter:drop-shadow(0_0_2px_color-mix(in_srgb,var(--color-content-primary)_60%,transparent))]",
127
+ // Same reasoning as the letters: no flicker and no green lift once the
128
+ // button is unavailable.
129
+ !disabled && [
130
+ "[animation:fv-ai-flicker_2s_linear_infinite] [animation-delay:0.5s]",
131
+ // Settles solid on hover, lit green from below like the sheen.
132
+ "group-hover/ai:[animation:none]",
133
+ "group-hover/ai:[filter:drop-shadow(0_0_3px_var(--color-brand-primary-default))_drop-shadow(0_-4px_6px_color-mix(in_srgb,var(--color-content-always-black)_60%,transparent))]",
134
+ "group-focus-visible/ai:[animation-duration:1.2s] group-focus-visible/ai:[animation-delay:0.2s]"
135
+ ],
136
+ "motion-reduce:[animation:none]"
137
+ ),
138
+ children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(AIIcon.AIIcon, { size: iconSizeVariants[size], filled: true })
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "grid", children: [
142
+ /* @__PURE__ */ jsxRuntime.jsx(
143
+ "span",
144
+ {
145
+ className: cn.cn(
146
+ "col-start-1 row-start-1 transition-opacity duration-300",
147
+ active ? "opacity-0" : "opacity-100"
148
+ ),
149
+ children: /* @__PURE__ */ jsxRuntime.jsx(ShimmerLabel, { text: label, disabled })
150
+ }
151
+ ),
152
+ /* @__PURE__ */ jsxRuntime.jsx(
153
+ "span",
154
+ {
155
+ className: cn.cn(
156
+ "col-start-1 row-start-1 transition-opacity duration-300",
157
+ active ? "opacity-100" : "opacity-0"
158
+ ),
159
+ children: /* @__PURE__ */ jsxRuntime.jsx(ShimmerLabel, { text: resolvedActiveLabel, disabled })
160
+ }
161
+ )
162
+ ] })
163
+ ]
164
+ }
165
+ );
166
+ }
167
+ );
168
+ AiButton.displayName = "AiButton";
169
+ exports.AiButton = AiButton;
170
+ //# sourceMappingURL=AiButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiButton.cjs","sources":["../../../../src/components/AiButton/AiButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport type { IconSize } from \"../Icons/types\";\n\n/** Height, padding and label typography, matching {@link Button}'s scale. */\nexport type AiButtonSize = \"24\" | \"32\" | \"40\";\n\nconst sizeVariants: Record<AiButtonSize, string> = {\n // At 24 the label steps down to the 12px description scale: the 14px label\n // Button uses at this height leaves the glyph and text crowding a 24px box,\n // since 16px is the smallest authored icon geometry and cannot step down with it.\n \"24\": \"h-6 gap-1 px-2 py-1 typography-description-12px-semibold\",\n \"32\": \"h-8 gap-2 px-3 py-[7px] typography-body-small-14px-semibold\",\n \"40\": \"h-10 gap-2 px-4 py-2 typography-body-default-16px-semibold\",\n};\n\nconst iconSizeVariants: Record<AiButtonSize, IconSize> = {\n \"24\": 16,\n \"32\": 16,\n \"40\": 24,\n};\n\n/**\n * Optical size, applied on top of the authored geometry. Only 16, 24 and 32 have\n * dedicated paths, so the 24 button renders the 16px glyph down at 14 to sit with\n * its 12px label rather than towering over it.\n */\nconst iconScaleVariants: Record<AiButtonSize, string> = {\n \"24\": \"[&_svg]:size-3.5\",\n \"32\": \"\",\n \"40\": \"\",\n};\n\n/** Delay between adjacent letters, in seconds. */\nconst LETTER_STAGGER = 0.08;\n\n/**\n * Points the bottom sheen at the cursor by writing its x offset, as a percentage\n * of the button's width, straight to the DOM node. Deliberately not React state:\n * this fires every pointer-move frame, and a re-render per frame would both cost\n * more than the paint and leave the glow trailing the cursor.\n */\nconst trackPointer = (event: React.PointerEvent<HTMLButtonElement>) => {\n const { left, width } = event.currentTarget.getBoundingClientRect();\n event.currentTarget.style.setProperty(\"--fv-ai-x\", `${((event.clientX - left) / width) * 100}%`);\n};\n\n/** Props for {@link AiButton}. */\nexport interface AiButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"type\"> {\n /** Resting label. Also the accessible name unless `aria-label` is given. */\n label: string;\n /** Label shown while `active`. Falls back to {@link label}. */\n activeLabel?: string;\n /** Swap to {@link activeLabel} and keep the shimmer running. @default false */\n active?: boolean;\n /** @default \"32\" */\n size?: AiButtonSize;\n /** Replace the leading AI glyph. */\n icon?: React.ReactNode;\n /** @default \"button\" */\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\n/**\n * Renders one `<span>` per character so each can carry its own animation delay.\n * The run is hidden from assistive tech — the button's accessible name comes from\n * its `aria-label`, so a screen reader says \"Analyse\" rather than spelling it out.\n */\nconst ShimmerLabel: React.FC<{ text: string; disabled?: boolean }> = ({ text, disabled }) => (\n <span aria-hidden=\"true\">\n {Array.from(text).map((character, index) => (\n <span\n key={`${character}-${index}`}\n className={cn(\n \"inline-block whitespace-pre text-content-secondary\",\n // Gated in JS rather than with a `group-disabled/ai:` override, because\n // that would rely on the generated rule ordering to beat `group-hover`.\n // A faded control that still shimmers and still lights up green under the\n // cursor reads as busy rather than unavailable.\n !disabled && [\n \"[animation:fv-ai-letter_2s_ease-in-out_infinite]\",\n \"group-hover/ai:text-content-primary group-hover/ai:[animation:none]\",\n // On focus each letter blows up and settles, then the idle shimmer\n // resumes underneath it — the two animations are sequenced by delay.\n \"group-focus-visible/ai:[animation:fv-ai-letter-focus_1s_ease-in-out,fv-ai-letter_1.2s_ease-in-out_infinite_1s]\",\n \"group-active/ai:text-content-primary group-active/ai:[animation:none]\",\n \"group-active/ai:[text-shadow:0_0_4px_var(--color-content-primary)]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n style={{ animationDelay: `${index * LETTER_STAGGER}s` }}\n >\n {character}\n </span>\n ))}\n </span>\n);\n\n/**\n * A pill button for AI actions. The label shimmers letter by letter and the glyph\n * flickers at rest; on hover both settle and the green treatment eases in together\n * — outline, rim and a sheen pooling along the bottom edge under the cursor, which\n * follows it across the button. On focus each letter blooms once before the shimmer\n * resumes. The lit rim and sheen come from the `fv-ai-button` utility in `base.css`.\n *\n * It shares {@link Button}'s geometry — `rounded-full`, the same heights and label\n * typography — so it sits alongside one without looking foreign. Both labels are\n * rendered stacked in a single grid cell, so swapping to `active` crossfades\n * without the button changing width.\n *\n * Honours `prefers-reduced-motion`: the shimmer and flicker are dropped and the\n * label renders in its settled state.\n *\n * @example\n * ```tsx\n * <AiButton label=\"Analyse\" activeLabel=\"Analysing\" active={isPending} onClick={run} />\n * ```\n */\nexport const AiButton = React.forwardRef<HTMLButtonElement, AiButtonProps>(\n (\n {\n label,\n activeLabel,\n active = false,\n size = \"32\",\n icon,\n type = \"button\",\n className,\n disabled,\n onPointerMove,\n onPointerLeave,\n ...props\n },\n ref,\n ) => {\n const resolvedActiveLabel = activeLabel ?? label;\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n aria-label={props[\"aria-label\"] ?? (active ? resolvedActiveLabel : label)}\n aria-busy={active || undefined}\n onPointerMove={(event) => {\n trackPointer(event);\n onPointerMove?.(event);\n }}\n // Drop back to the utility's centred default, so a keyboard focus after\n // the pointer has left does not light up wherever the cursor last was.\n onPointerLeave={(event) => {\n event.currentTarget.style.removeProperty(\"--fv-ai-x\");\n onPointerLeave?.(event);\n }}\n className={cn(\n \"fv-ai-button\",\n \"group/ai inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full\",\n \"border border-border-primary bg-background-primary\",\n // Matched to the rim and sheen so the whole treatment arrives as one\n // movement — at the old 300ms the outline landed ahead of the glow.\n \"transition-[background-color,border-color] duration-[400ms] ease-out\",\n \"hover:border-brand-primary-default\",\n \"focus-visible:outline-none\",\n \"active:border-brand-primary-hover active:bg-brand-primary-muted\",\n \"disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border-primary\",\n sizeVariants[size],\n className,\n )}\n {...props}\n >\n <span\n className={cn(\n \"flex shrink-0 items-center text-content-primary\",\n iconScaleVariants[size],\n \"[filter:drop-shadow(0_0_2px_color-mix(in_srgb,var(--color-content-primary)_60%,transparent))]\",\n // Same reasoning as the letters: no flicker and no green lift once the\n // button is unavailable.\n !disabled && [\n \"[animation:fv-ai-flicker_2s_linear_infinite] [animation-delay:0.5s]\",\n // Settles solid on hover, lit green from below like the sheen.\n \"group-hover/ai:[animation:none]\",\n \"group-hover/ai:[filter:drop-shadow(0_0_3px_var(--color-brand-primary-default))_drop-shadow(0_-4px_6px_color-mix(in_srgb,var(--color-content-always-black)_60%,transparent))]\",\n \"group-focus-visible/ai:[animation-duration:1.2s] group-focus-visible/ai:[animation-delay:0.2s]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n >\n {icon ?? <AIIcon size={iconSizeVariants[size]} filled />}\n </span>\n {/* Both labels occupy one grid cell so the button keeps the width of the\n longer of the two and the swap never reflows the row around it. */}\n <span className=\"grid\">\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-0\" : \"opacity-100\",\n )}\n >\n <ShimmerLabel text={label} disabled={disabled} />\n </span>\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <ShimmerLabel text={resolvedActiveLabel} disabled={disabled} />\n </span>\n </span>\n </button>\n );\n },\n);\n\nAiButton.displayName = \"AiButton\";\n"],"names":["jsx","cn","React","jsxs","AIIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,eAA6C;AAAA;AAAA;AAAA;AAAA,EAIjD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,mBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAOA,MAAM,oBAA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AA;AAAA,EAGN;AACF;AAEA,SAAS,cAAc;;"}
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const React = require("react");
6
+ const cn = require("../../utils/cn.cjs");
7
+ const usePrefersReducedMotion = require("../../utils/usePrefersReducedMotion.cjs");
8
+ function _interopNamespaceDefault(e) {
9
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
+ if (e) {
11
+ for (const k in e) {
12
+ if (k !== "default") {
13
+ const d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: () => e[k]
17
+ });
18
+ }
19
+ }
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
+ const DEFAULT_DURATION_MS = 500;
26
+ const defaultFormat = (value) => String(Math.round(value));
27
+ const easeOutCubic = (t) => 1 - (1 - t) ** 3;
28
+ const DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
29
+ const isDigit = (char) => char >= "0" && char <= "9";
30
+ const AnimatedNumber = React__namespace.forwardRef(
31
+ ({
32
+ value,
33
+ format = defaultFormat,
34
+ variant = "count",
35
+ durationMs = DEFAULT_DURATION_MS,
36
+ className,
37
+ ...props
38
+ }, ref) => {
39
+ const reducedMotion = usePrefersReducedMotion.usePrefersReducedMotion();
40
+ if (variant === "roll") {
41
+ return /* @__PURE__ */ jsxRuntime.jsx(
42
+ RollingNumber,
43
+ {
44
+ ref,
45
+ value,
46
+ format,
47
+ durationMs: reducedMotion ? 0 : durationMs,
48
+ className,
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+ return /* @__PURE__ */ jsxRuntime.jsx(
54
+ CountingNumber,
55
+ {
56
+ ref,
57
+ value,
58
+ format,
59
+ durationMs: reducedMotion ? 0 : durationMs,
60
+ className,
61
+ ...props
62
+ }
63
+ );
64
+ }
65
+ );
66
+ AnimatedNumber.displayName = "AnimatedNumber";
67
+ const CountingNumber = React__namespace.forwardRef(
68
+ ({ value, format, durationMs, className, ...props }, ref) => {
69
+ const [displayValue, setDisplayValue] = React__namespace.useState(value);
70
+ const displayRef = React__namespace.useRef(value);
71
+ React__namespace.useEffect(() => {
72
+ const from = displayRef.current;
73
+ if (from === value || durationMs === 0) {
74
+ displayRef.current = value;
75
+ setDisplayValue(value);
76
+ return;
77
+ }
78
+ let frame = 0;
79
+ let start;
80
+ const step = (now) => {
81
+ start ??= now;
82
+ const progress = Math.min((now - start) / durationMs, 1);
83
+ const next = from + (value - from) * easeOutCubic(progress);
84
+ displayRef.current = next;
85
+ setDisplayValue(next);
86
+ if (progress < 1) {
87
+ frame = requestAnimationFrame(step);
88
+ }
89
+ };
90
+ frame = requestAnimationFrame(step);
91
+ return () => cancelAnimationFrame(frame);
92
+ }, [value, durationMs]);
93
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn.cn("tabular-nums", className), ...props, children: format(displayValue) });
94
+ }
95
+ );
96
+ CountingNumber.displayName = "AnimatedNumber.Counting";
97
+ const RollingNumber = React__namespace.forwardRef(
98
+ ({ value, format, durationMs, className, ...props }, ref) => {
99
+ const display = format(value);
100
+ const characters = React__namespace.useMemo(() => Array.from(display), [display]);
101
+ const contentRef = React__namespace.useRef(null);
102
+ const [boxWidth, setBoxWidth] = React__namespace.useState();
103
+ const hasMeasured = boxWidth !== void 0;
104
+ React__namespace.useLayoutEffect(() => {
105
+ const node = contentRef.current;
106
+ if (!node || !display) {
107
+ return;
108
+ }
109
+ const measure = () => {
110
+ const measured = node.scrollWidth;
111
+ if (measured) {
112
+ setBoxWidth(measured);
113
+ }
114
+ };
115
+ measure();
116
+ if (typeof ResizeObserver === "undefined") {
117
+ return;
118
+ }
119
+ const observer = new ResizeObserver(measure);
120
+ observer.observe(node);
121
+ return () => observer.disconnect();
122
+ }, [display]);
123
+ return /* @__PURE__ */ jsxRuntime.jsxs(
124
+ "span",
125
+ {
126
+ ref,
127
+ className: cn.cn("inline-flex overflow-hidden tabular-nums", className),
128
+ style: {
129
+ width: boxWidth,
130
+ transitionProperty: "width",
131
+ transitionDuration: hasMeasured ? `${durationMs}ms` : "0ms",
132
+ transitionTimingFunction: "cubic-bezier(0.22, 1, 0.36, 1)"
133
+ },
134
+ ...props,
135
+ children: [
136
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: display }),
137
+ /* @__PURE__ */ jsxRuntime.jsx("span", { ref: contentRef, "aria-hidden": true, className: "inline-flex whitespace-pre", children: characters.map(
138
+ (char, index) => isDigit(char) ? /* @__PURE__ */ jsxRuntime.jsx(
139
+ "span",
140
+ {
141
+ className: "relative inline-block overflow-hidden",
142
+ style: { height: "1em", lineHeight: "1em" },
143
+ children: /* @__PURE__ */ jsxRuntime.jsx(
144
+ "span",
145
+ {
146
+ className: "flex flex-col",
147
+ style: {
148
+ transform: `translateY(-${Number(char) * 10}%)`,
149
+ transitionProperty: "transform",
150
+ transitionDuration: `${durationMs}ms`,
151
+ transitionTimingFunction: "cubic-bezier(0.22, 1, 0.36, 1)"
152
+ },
153
+ children: DIGITS.map((digit) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { height: "1em", lineHeight: "1em" }, children: digit }, digit))
154
+ }
155
+ )
156
+ },
157
+ `digit-${index}`
158
+ ) : (
159
+ // biome-ignore lint/suspicious/noArrayIndexKey: same positional identity as the digit columns
160
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: char }, `separator-${index}`)
161
+ )
162
+ ) })
163
+ ]
164
+ }
165
+ );
166
+ }
167
+ );
168
+ RollingNumber.displayName = "AnimatedNumber.Rolling";
169
+ exports.AnimatedNumber = AnimatedNumber;
170
+ //# sourceMappingURL=AnimatedNumber.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimatedNumber.cjs","sources":["../../../../src/components/AnimatedNumber/AnimatedNumber.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { usePrefersReducedMotion } from \"@/utils/usePrefersReducedMotion\";\n\n/** How a value change is animated. */\nexport type AnimatedNumberVariant =\n /**\n * Per-digit odometer: each digit column slides to its new value and the box\n * width eases when the digit count changes. Reads as mechanical, so it suits\n * a single headline figure rather than a grid of them.\n */\n | \"roll\"\n /**\n * Interpolates the value and re-formats it each frame, so the whole number\n * counts from old to new. Calmer than `roll` when several figures on a page\n * change at once.\n */\n | \"count\";\n\n/** Props for {@link AnimatedNumber}. */\nexport interface AnimatedNumberProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n /** The value to display. Animates whenever this changes. */\n value: number;\n /**\n * Turns the value into the displayed string. Receives interpolated values in\n * the `count` variant, so it must handle non-integers.\n * @default String(Math.round(value))\n */\n format?: (value: number) => string;\n /** Which animation to run. @default \"count\" */\n variant?: AnimatedNumberVariant;\n /** Animation duration in milliseconds. @default 500 */\n durationMs?: number;\n}\n\nconst DEFAULT_DURATION_MS = 500;\n\nconst defaultFormat = (value: number) => String(Math.round(value));\n\n/** Decelerating ease, so the value settles rather than stopping abruptly. */\nconst easeOutCubic = (t: number) => 1 - (1 - t) ** 3;\n\nconst DIGITS = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n\nconst isDigit = (char: string) => char >= \"0\" && char <= \"9\";\n\n/**\n * Animates a number when its value changes, either by rolling each digit like\n * an odometer or by counting through the intermediate values.\n *\n * Both variants collapse to an instant swap under\n * `prefers-reduced-motion: reduce`.\n *\n * The rolling variant stacks all ten digits in each column, so the visual is\n * hidden from assistive technology and the formatted value is exposed once as\n * text instead.\n *\n * @example\n * ```tsx\n * // Headline figure\n * <AnimatedNumber value={totalGross} format={formatPrice} variant=\"roll\" />\n *\n * // Supporting figure\n * <AnimatedNumber value={activeFans} variant=\"count\" />\n * ```\n */\nexport const AnimatedNumber = React.forwardRef<HTMLSpanElement, AnimatedNumberProps>(\n (\n {\n value,\n format = defaultFormat,\n variant = \"count\",\n durationMs = DEFAULT_DURATION_MS,\n className,\n ...props\n },\n ref,\n ) => {\n const reducedMotion = usePrefersReducedMotion();\n\n if (variant === \"roll\") {\n return (\n <RollingNumber\n ref={ref}\n value={value}\n format={format}\n durationMs={reducedMotion ? 0 : durationMs}\n className={className}\n {...props}\n />\n );\n }\n\n return (\n <CountingNumber\n ref={ref}\n value={value}\n format={format}\n durationMs={reducedMotion ? 0 : durationMs}\n className={className}\n {...props}\n />\n );\n },\n);\n\nAnimatedNumber.displayName = \"AnimatedNumber\";\n\ntype VariantProps = Omit<AnimatedNumberProps, \"variant\" | \"format\" | \"durationMs\"> & {\n format: (value: number) => string;\n durationMs: number;\n};\n\nconst CountingNumber = React.forwardRef<HTMLSpanElement, VariantProps>(\n ({ value, format, durationMs, className, ...props }, ref) => {\n const [displayValue, setDisplayValue] = React.useState(value);\n // Tracks what is on screen, so an interrupted tween resumes from there. Storing\n // the abandoned *target* instead would start the next tween from a number that\n // was never displayed, which shows as a jump to the old target before counting\n // on — a refetch or filter change landing mid-animation is enough to hit it.\n const displayRef = React.useRef(value);\n\n React.useEffect(() => {\n const from = displayRef.current;\n if (from === value || durationMs === 0) {\n displayRef.current = value;\n setDisplayValue(value);\n return;\n }\n\n let frame = 0;\n let start: number | undefined;\n\n const step = (now: number) => {\n start ??= now;\n const progress = Math.min((now - start) / durationMs, 1);\n const next = from + (value - from) * easeOutCubic(progress);\n displayRef.current = next;\n setDisplayValue(next);\n if (progress < 1) {\n frame = requestAnimationFrame(step);\n }\n };\n\n frame = requestAnimationFrame(step);\n return () => cancelAnimationFrame(frame);\n }, [value, durationMs]);\n\n return (\n <span ref={ref} className={cn(\"tabular-nums\", className)} {...props}>\n {format(displayValue)}\n </span>\n );\n },\n);\n\nCountingNumber.displayName = \"AnimatedNumber.Counting\";\n\nconst RollingNumber = React.forwardRef<HTMLSpanElement, VariantProps>(\n ({ value, format, durationMs, className, ...props }, ref) => {\n const display = format(value);\n const characters = React.useMemo(() => Array.from(display), [display]);\n\n // Lock the box to its measured width so a change in digit count eases\n // instead of snapping: `width: auto` cannot be transitioned.\n const contentRef = React.useRef<HTMLSpanElement>(null);\n const [boxWidth, setBoxWidth] = React.useState<number>();\n\n // On the render where the width is still `auto` there is nothing to\n // transition from, so the duration is zeroed. This is belt-and-braces rather\n // than load-bearing: `auto` to a length is not interpolatable, so no\n // transition would run either way.\n const hasMeasured = boxWidth !== undefined;\n\n // Re-measure rather than measuring once per `display`: the box is\n // `overflow-hidden`, so a web font landing after the first measurement leaves\n // the locked width too narrow for the wider glyphs and clips the number until\n // the value next changes, which for a headline figure may be never. Observing\n // covers a container change too. Same approach as `useCyclingTextTrackWidth`.\n React.useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node || !display) {\n return;\n }\n\n const measure = () => {\n const measured = node.scrollWidth;\n if (measured) {\n setBoxWidth(measured);\n }\n };\n\n measure();\n\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, [display]);\n\n return (\n <span\n ref={ref}\n className={cn(\"inline-flex overflow-hidden tabular-nums\", className)}\n style={{\n width: boxWidth,\n transitionProperty: \"width\",\n transitionDuration: hasMeasured ? `${durationMs}ms` : \"0ms\",\n transitionTimingFunction: \"cubic-bezier(0.22, 1, 0.36, 1)\",\n }}\n {...props}\n >\n {/* The digit columns list 0-9 apiece, which assistive tech would read\n out in full, so expose the formatted value as text instead. */}\n <span className=\"sr-only\">{display}</span>\n <span ref={contentRef} aria-hidden className=\"inline-flex whitespace-pre\">\n {characters.map((char, index) =>\n isDigit(char) ? (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: a column is a position in the number, so it must keep its identity (and animate) when its digit changes\n key={`digit-${index}`}\n className=\"relative inline-block overflow-hidden\"\n style={{ height: \"1em\", lineHeight: \"1em\" }}\n >\n <span\n className=\"flex flex-col\"\n style={{\n transform: `translateY(-${Number(char) * 10}%)`,\n transitionProperty: \"transform\",\n transitionDuration: `${durationMs}ms`,\n transitionTimingFunction: \"cubic-bezier(0.22, 1, 0.36, 1)\",\n }}\n >\n {DIGITS.map((digit) => (\n <span key={digit} style={{ height: \"1em\", lineHeight: \"1em\" }}>\n {digit}\n </span>\n ))}\n </span>\n </span>\n ) : (\n // biome-ignore lint/suspicious/noArrayIndexKey: same positional identity as the digit columns\n <span key={`separator-${index}`}>{char}</span>\n ),\n )}\n </span>\n </span>\n );\n },\n);\n\nRollingNumber.displayName = \"AnimatedNumber.Rolling\";\n"],"names":["React","usePrefersReducedMotion","jsx","cn","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,sBAAsB;AAE5B,MAAM,gBAAgB,CAAC,UAAkB,OAAO,KAAK,MAAM,KAAK,CAAC;AAGjE,MAAM,eAAe,CAAC,MAAc,KAAK,IAAI,MAAM;AAEnD,MAAM,SAAS,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAEhE,MAAM,UAAU,CAAC,SAAiB,QAAQ,OAAO,QAAQ;AAsBlD,MAAM,iBAAiBA,iBAAM;AAAA,EAClC,CACE;AAAA,IACE;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,gBAAgBC,wBAAAA,wBAAA;AAEtB,QAAI,YAAY,QAAQ;AACtB,aACEC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,YAAY,gBAAgB,IAAI;AAAA,UAChC;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IAGV;AAEA,WACEA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,gBAAg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I,EAAE;AAAA,sBAC3C,oBAAoB;AAAA,sBACpB,oBAAoB,GAAG,UAAU;AAAA,sBACjC,0BAA0B;AAAA,oBAAA;AAAA,oBAG3B,UAAA,OAAO,IAAI,CAAC,yCACV,QAAA,EAAiB,OAAO,EAAE,QAAQ,OAAO,YAAY,MAAA,GACnD,UAAA,MAAA,GADQ,KAEX,CACD;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,cAlBK,SAAS,KAAK;AAAA,YAAA;AAAA;AAAA,cAsBrBA,2BAAAA,IAAC,QAAA,EAAiC,UAAA,KAAA,GAAvB,aAAa,KAAK,EAAU;AAAA;AAAA,UAAA,EAE3C,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,cAAc,cAAc;;"}
@@ -5,6 +5,7 @@ const jsxRuntime = require("react/jsx-runtime");
5
5
  const React = require("react");
6
6
  const cn = require("../../utils/cn.cjs");
7
7
  const Loader = require("../Loader/Loader.cjs");
8
+ const ChartSkeleton = require("./ChartSkeleton.cjs");
8
9
  function _interopNamespaceDefault(e) {
9
10
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
11
  if (e) {
@@ -23,10 +24,31 @@ function _interopNamespaceDefault(e) {
23
24
  }
24
25
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
26
  const ChartLoadingOverlay = React__namespace.forwardRef(
26
- ({ loading = false, children, className, ...props }, ref) => {
27
+ ({
28
+ loading = false,
29
+ variant = "area",
30
+ loadingLabel = "Loading chart",
31
+ children,
32
+ className,
33
+ ...props
34
+ }, ref) => {
27
35
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn.cn("relative", className), ...props, children: [
28
36
  children,
29
- loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-surface-primary/60", children: /* @__PURE__ */ jsxRuntime.jsx(Loader.Loader, { show: true, center: true }) })
37
+ loading && /* @__PURE__ */ jsxRuntime.jsx(
38
+ "div",
39
+ {
40
+ className: cn.cn(
41
+ "absolute inset-0 z-10 flex items-center justify-center",
42
+ variant ? "bg-background-primary" : "bg-surface-primary/60"
43
+ ),
44
+ ...variant && {
45
+ role: "status",
46
+ "aria-busy": true,
47
+ "aria-label": loadingLabel
48
+ },
49
+ children: variant ? /* @__PURE__ */ jsxRuntime.jsx(ChartSkeleton.ChartSkeleton, { variant }) : /* @__PURE__ */ jsxRuntime.jsx(Loader.Loader, { show: true, center: true })
50
+ }
51
+ )
30
52
  ] });
31
53
  }
32
54
  );
@@ -1 +1 @@
1
- {"version":3,"file":"ChartLoadingOverlay.cjs","sources":["../../../../src/components/Chart/ChartLoadingOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Loader } from \"../Loader/Loader\";\n\n/** Props for {@link ChartLoadingOverlay}. */\nexport interface ChartLoadingOverlayProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether to show the loading overlay. @default false */\n loading?: boolean;\n /** Chart content to render underneath the overlay. */\n children: React.ReactNode;\n}\n\n/**\n * A positioned overlay that displays a loading spinner on top of chart content.\n * The children are always rendered to maintain layout dimensions; the overlay\n * covers them with a semi-transparent background and a centered spinner.\n *\n * @example\n * ```tsx\n * <ChartLoadingOverlay loading={isFetching}>\n * <ChartContainer config={config} className=\"min-h-48\">\n * <LineChart data={data}>...</LineChart>\n * </ChartContainer>\n * </ChartLoadingOverlay>\n * ```\n */\nexport const ChartLoadingOverlay = React.forwardRef<HTMLDivElement, ChartLoadingOverlayProps>(\n ({ loading = false, children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn(\"relative\", className)} {...props}>\n {children}\n {loading && (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-surface-primary/60\">\n <Loader show center />\n </div>\n )}\n </div>\n );\n },\n);\n\nChartLoadingOverlay.displayName = \"ChartLoadingOverlay\";\n"],"names":["React","jsxs","cn","jsx","Loader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,sBAAsBA,iBAAM;AAAA,EACvC,CAAC,EAAE,UAAU,OAAO,UAAU,WAAW,GAAG,MAAA,GAAS,QAAQ;AAC3D,WACEC,gCAAC,SAAI,KAAU,WAAWC,MAAG,YAAY,SAAS,GAAI,GAAG,OACtD,UAAA;AAAA,MAAA;AAAA,MACA,WACCC,2BAAAA,IAAC,OAAA,EAAI,WAAU,gFACb,UAAAA,2BAAAA,IAACC,OAAAA,QAAA,EAAO,MAAI,MAAC,QAAM,KAAA,CAAC,EAAA,CACtB;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;;"}
1
+ {"version":3,"file":"ChartLoadingOverlay.cjs","sources":["../../../../src/components/Chart/ChartLoadingOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Loader } from \"../Loader/Loader\";\nimport { ChartSkeleton, type ChartSkeletonVariant } from \"./ChartSkeleton\";\n\n/** Props for {@link ChartLoadingOverlay}. */\nexport interface ChartLoadingOverlayProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Whether to show the loading overlay. @default false */\n loading?: boolean;\n /**\n * Shape of the wave-animated {@link ChartSkeleton} shown while loading. Set it\n * to match the chart underneath — `circular` for pie/radial, `bar` for bar\n * charts. Pass `false` to fall back to the legacy centred spinner.\n * @default \"area\"\n */\n variant?: ChartSkeletonVariant | false;\n /**\n * Accessible name for the loading region, announced while `loading` is true.\n * Pass a translated string for i18n. Only applies to the skeleton path; the\n * `variant={false}` spinner carries its own label. @default \"Loading chart\"\n */\n loadingLabel?: string;\n /** Chart content to render underneath the overlay. */\n children: React.ReactNode;\n}\n\n/**\n * A positioned overlay shown on top of chart content while it loads. The children\n * are always rendered to maintain layout dimensions.\n *\n * By default the overlay is opaque and shows a wave-animated\n * {@link ChartSkeleton} shaped like the chart. At `variant={false}` it falls back\n * to a semi-transparent wash with a centred spinner.\n *\n * @example\n * ```tsx\n * <ChartLoadingOverlay loading={isFetching} variant=\"area\">\n * <ChartContainer config={config} className=\"min-h-48\">\n * <LineChart data={data}>...</LineChart>\n * </ChartContainer>\n * </ChartLoadingOverlay>\n * ```\n */\nexport const ChartLoadingOverlay = React.forwardRef<HTMLDivElement, ChartLoadingOverlayProps>(\n (\n {\n loading = false,\n variant = \"area\",\n loadingLabel = \"Loading chart\",\n children,\n className,\n ...props\n },\n ref,\n ) => {\n return (\n <div ref={ref} className={cn(\"relative\", className)} {...props}>\n {children}\n {loading && (\n <div\n className={cn(\n \"absolute inset-0 z-10 flex items-center justify-center\",\n variant ? \"bg-background-primary\" : \"bg-surface-primary/60\",\n )}\n // Every `Skeleton` is `aria-hidden`, so without this the skeleton path\n // announces nothing where the spinner announced through its `<output>`.\n // This is the contract `Skeleton`'s own doc comment asks callers to honour.\n // Scoped to the skeleton path deliberately: adding it to the spinner path\n // would nest a live region inside a live region and risk a double\n // announcement.\n {...(variant && {\n role: \"status\",\n \"aria-busy\": true,\n \"aria-label\": loadingLabel,\n })}\n >\n {variant ? <ChartSkeleton variant={variant} /> : <Loader show center />}\n </div>\n )}\n </div>\n );\n },\n);\n\nChartLoadingOverlay.displayName = \"ChartLoadingOverlay\";\n"],"names":["React","jsxs","cn","jsx","ChartSkeleton","Loader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CO,MAAM,sBAAsBA,iBAAM;AAAA,EACvC,CACE;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACEC,gCAAC,SAAI,KAAU,WAAWC,MAAG,YAAY,SAAS,GAAI,GAAG,OACtD,UAAA;AAAA,MAAA;AAAA,MACA,WACCC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWD,GAAAA;AAAAA,YACT;AAAA,YACA,UAAU,0BAA0B;AAAA,UAAA;AAAA,UAQrC,GAAI,WAAW;AAAA,YACd,MAAM;AAAA,YACN,aAAa;AAAA,YACb,cAAc;AAAA,UAAA;AAAA,UAGf,UAAA,UAAUC,2BAAAA,IAACC,cAAAA,eAAA,EAAc,QAAA,CAAkB,mCAAMC,OAAAA,QAAA,EAAO,MAAI,MAAC,QAAM,KAAA,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IACvE,GAEJ;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;;"}