@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
@@ -0,0 +1,153 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../utils/cn.mjs";
5
+ import { usePrefersReducedMotion } from "../../utils/usePrefersReducedMotion.mjs";
6
+ const DEFAULT_DURATION_MS = 500;
7
+ const defaultFormat = (value) => String(Math.round(value));
8
+ const easeOutCubic = (t) => 1 - (1 - t) ** 3;
9
+ const DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
10
+ const isDigit = (char) => char >= "0" && char <= "9";
11
+ const AnimatedNumber = React.forwardRef(
12
+ ({
13
+ value,
14
+ format = defaultFormat,
15
+ variant = "count",
16
+ durationMs = DEFAULT_DURATION_MS,
17
+ className,
18
+ ...props
19
+ }, ref) => {
20
+ const reducedMotion = usePrefersReducedMotion();
21
+ if (variant === "roll") {
22
+ return /* @__PURE__ */ jsx(
23
+ RollingNumber,
24
+ {
25
+ ref,
26
+ value,
27
+ format,
28
+ durationMs: reducedMotion ? 0 : durationMs,
29
+ className,
30
+ ...props
31
+ }
32
+ );
33
+ }
34
+ return /* @__PURE__ */ jsx(
35
+ CountingNumber,
36
+ {
37
+ ref,
38
+ value,
39
+ format,
40
+ durationMs: reducedMotion ? 0 : durationMs,
41
+ className,
42
+ ...props
43
+ }
44
+ );
45
+ }
46
+ );
47
+ AnimatedNumber.displayName = "AnimatedNumber";
48
+ const CountingNumber = React.forwardRef(
49
+ ({ value, format, durationMs, className, ...props }, ref) => {
50
+ const [displayValue, setDisplayValue] = React.useState(value);
51
+ const displayRef = React.useRef(value);
52
+ React.useEffect(() => {
53
+ const from = displayRef.current;
54
+ if (from === value || durationMs === 0) {
55
+ displayRef.current = value;
56
+ setDisplayValue(value);
57
+ return;
58
+ }
59
+ let frame = 0;
60
+ let start;
61
+ const step = (now) => {
62
+ start ??= now;
63
+ const progress = Math.min((now - start) / durationMs, 1);
64
+ const next = from + (value - from) * easeOutCubic(progress);
65
+ displayRef.current = next;
66
+ setDisplayValue(next);
67
+ if (progress < 1) {
68
+ frame = requestAnimationFrame(step);
69
+ }
70
+ };
71
+ frame = requestAnimationFrame(step);
72
+ return () => cancelAnimationFrame(frame);
73
+ }, [value, durationMs]);
74
+ return /* @__PURE__ */ jsx("span", { ref, className: cn("tabular-nums", className), ...props, children: format(displayValue) });
75
+ }
76
+ );
77
+ CountingNumber.displayName = "AnimatedNumber.Counting";
78
+ const RollingNumber = React.forwardRef(
79
+ ({ value, format, durationMs, className, ...props }, ref) => {
80
+ const display = format(value);
81
+ const characters = React.useMemo(() => Array.from(display), [display]);
82
+ const contentRef = React.useRef(null);
83
+ const [boxWidth, setBoxWidth] = React.useState();
84
+ const hasMeasured = boxWidth !== void 0;
85
+ React.useLayoutEffect(() => {
86
+ const node = contentRef.current;
87
+ if (!node || !display) {
88
+ return;
89
+ }
90
+ const measure = () => {
91
+ const measured = node.scrollWidth;
92
+ if (measured) {
93
+ setBoxWidth(measured);
94
+ }
95
+ };
96
+ measure();
97
+ if (typeof ResizeObserver === "undefined") {
98
+ return;
99
+ }
100
+ const observer = new ResizeObserver(measure);
101
+ observer.observe(node);
102
+ return () => observer.disconnect();
103
+ }, [display]);
104
+ return /* @__PURE__ */ jsxs(
105
+ "span",
106
+ {
107
+ ref,
108
+ className: cn("inline-flex overflow-hidden tabular-nums", className),
109
+ style: {
110
+ width: boxWidth,
111
+ transitionProperty: "width",
112
+ transitionDuration: hasMeasured ? `${durationMs}ms` : "0ms",
113
+ transitionTimingFunction: "cubic-bezier(0.22, 1, 0.36, 1)"
114
+ },
115
+ ...props,
116
+ children: [
117
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: display }),
118
+ /* @__PURE__ */ jsx("span", { ref: contentRef, "aria-hidden": true, className: "inline-flex whitespace-pre", children: characters.map(
119
+ (char, index) => isDigit(char) ? /* @__PURE__ */ jsx(
120
+ "span",
121
+ {
122
+ className: "relative inline-block overflow-hidden",
123
+ style: { height: "1em", lineHeight: "1em" },
124
+ children: /* @__PURE__ */ jsx(
125
+ "span",
126
+ {
127
+ className: "flex flex-col",
128
+ style: {
129
+ transform: `translateY(-${Number(char) * 10}%)`,
130
+ transitionProperty: "transform",
131
+ transitionDuration: `${durationMs}ms`,
132
+ transitionTimingFunction: "cubic-bezier(0.22, 1, 0.36, 1)"
133
+ },
134
+ children: DIGITS.map((digit) => /* @__PURE__ */ jsx("span", { style: { height: "1em", lineHeight: "1em" }, children: digit }, digit))
135
+ }
136
+ )
137
+ },
138
+ `digit-${index}`
139
+ ) : (
140
+ // biome-ignore lint/suspicious/noArrayIndexKey: same positional identity as the digit columns
141
+ /* @__PURE__ */ jsx("span", { children: char }, `separator-${index}`)
142
+ )
143
+ ) })
144
+ ]
145
+ }
146
+ );
147
+ }
148
+ );
149
+ RollingNumber.displayName = "AnimatedNumber.Rolling";
150
+ export {
151
+ AnimatedNumber
152
+ };
153
+ //# sourceMappingURL=AnimatedNumber.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimatedNumber.mjs","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":[],"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,iBAAiB,MAAM;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,gBAAgB,wBAAA;AAEtB,QAAI,YAAY,QAAQ;AACtB,aACE;AAAA,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,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,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AAoB,GAAG,UAAU;AAAA,sBACjC,0BAA0B;AAAA,oBAAA;AAAA,oBAG3B,UAAA,OAAO,IAAI,CAAC,8BACV,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,cAsBrB,oBAAC,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;"}
@@ -3,11 +3,33 @@ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../utils/cn.mjs";
5
5
  import { Loader } from "../Loader/Loader.mjs";
6
+ import { ChartSkeleton } from "./ChartSkeleton.mjs";
6
7
  const ChartLoadingOverlay = React.forwardRef(
7
- ({ loading = false, children, className, ...props }, ref) => {
8
+ ({
9
+ loading = false,
10
+ variant = "area",
11
+ loadingLabel = "Loading chart",
12
+ children,
13
+ className,
14
+ ...props
15
+ }, ref) => {
8
16
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative", className), ...props, children: [
9
17
  children,
10
- loading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-surface-primary/60", children: /* @__PURE__ */ jsx(Loader, { show: true, center: true }) })
18
+ loading && /* @__PURE__ */ jsx(
19
+ "div",
20
+ {
21
+ className: cn(
22
+ "absolute inset-0 z-10 flex items-center justify-center",
23
+ variant ? "bg-background-primary" : "bg-surface-primary/60"
24
+ ),
25
+ ...variant && {
26
+ role: "status",
27
+ "aria-busy": true,
28
+ "aria-label": loadingLabel
29
+ },
30
+ children: variant ? /* @__PURE__ */ jsx(ChartSkeleton, { variant }) : /* @__PURE__ */ jsx(Loader, { show: true, center: true })
31
+ }
32
+ )
11
33
  ] });
12
34
  }
13
35
  );
@@ -1 +1 @@
1
- {"version":3,"file":"ChartLoadingOverlay.mjs","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":[],"mappings":";;;;;AA0BO,MAAM,sBAAsB,MAAM;AAAA,EACvC,CAAC,EAAE,UAAU,OAAO,UAAU,WAAW,GAAG,MAAA,GAAS,QAAQ;AAC3D,WACE,qBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OACtD,UAAA;AAAA,MAAA;AAAA,MACA,WACC,oBAAC,OAAA,EAAI,WAAU,gFACb,UAAA,oBAAC,QAAA,EAAO,MAAI,MAAC,QAAM,KAAA,CAAC,EAAA,CACtB;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;"}
1
+ {"version":3,"file":"ChartLoadingOverlay.mjs","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":[],"mappings":";;;;;;AA2CO,MAAM,sBAAsB,MAAM;AAAA,EACvC,CACE;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACE,qBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OACtD,UAAA;AAAA,MAAA;AAAA,MACA,WACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,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,UAAU,oBAAC,eAAA,EAAc,QAAA,CAAkB,wBAAM,QAAA,EAAO,MAAI,MAAC,QAAM,KAAA,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IACvE,GAEJ;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;"}
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { AreaChart, YAxis, Area } from "recharts";
5
+ import { cn } from "../../utils/cn.mjs";
6
+ import { ChartContainer } from "./ChartContainer.mjs";
7
+ const CHART_COLORS = {
8
+ red: "var(--color-special-chart-red)",
9
+ teal: "var(--color-special-chart-teal)"
10
+ };
11
+ const ChartMetricTrend = React.forwardRef(
12
+ ({ value, color, series, className, ...props }, ref) => {
13
+ const points = series && series.length > 1 ? series : [value, value];
14
+ const chartData = points.map((point, index) => ({ index, value: point }));
15
+ const chartConfig = { value: { color: CHART_COLORS[color] } };
16
+ const gradientId = `metric-trend-gradient-${React.useId().replace(/:/g, "")}`;
17
+ return (
18
+ // 106px is the design's `V2 Area Chart Item` slot height.
19
+ /* @__PURE__ */ jsx(
20
+ ChartContainer,
21
+ {
22
+ ref,
23
+ config: chartConfig,
24
+ className: cn("block aspect-auto h-[106px] w-full", className),
25
+ ...props,
26
+ children: /* @__PURE__ */ jsxs(AreaChart, { data: chartData, margin: { top: 4, bottom: 0, left: 0, right: 0 }, children: [
27
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
28
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "var(--color-value)", stopOpacity: 0.3 }),
29
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "var(--color-value)", stopOpacity: 0 })
30
+ ] }) }),
31
+ /* @__PURE__ */ jsx(YAxis, { hide: true, domain: ["dataMin - 1", "dataMax + 1"] }),
32
+ /* @__PURE__ */ jsx(
33
+ Area,
34
+ {
35
+ type: "monotone",
36
+ dataKey: "value",
37
+ stroke: "var(--color-value)",
38
+ strokeWidth: 2,
39
+ fill: `url(#${gradientId})`,
40
+ dot: false,
41
+ isAnimationActive: false
42
+ }
43
+ )
44
+ ] })
45
+ }
46
+ )
47
+ );
48
+ }
49
+ );
50
+ ChartMetricTrend.displayName = "ChartMetricTrend";
51
+ export {
52
+ ChartMetricTrend
53
+ };
54
+ //# sourceMappingURL=ChartMetricTrend.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartMetricTrend.mjs","sources":["../../../src/components/Chart/ChartMetricTrend.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Area, AreaChart, YAxis } from \"recharts\";\nimport { cn } from \"../../utils/cn\";\nimport { ChartContainer } from \"./ChartContainer\";\nimport type { ChartConfig } from \"./types\";\n\n/**\n * Each card carries its own gradient in the design: red on Retention Rate,\n * green on Average Fan Lifetime. The DS has no `special-chart-green`, so the\n * green maps to `teal` (#28ba8e) — the emerald in the Figma render, as opposed\n * to `lime` (#8fcb3a), which is yellow-green.\n */\nexport type ChartMetricTrendColor = \"red\" | \"teal\";\n\nconst CHART_COLORS: Record<ChartMetricTrendColor, string> = {\n red: \"var(--color-special-chart-red)\",\n teal: \"var(--color-special-chart-teal)\",\n};\n\n/** Props for {@link ChartMetricTrend}. */\nexport interface ChartMetricTrendProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current value. Also the flat-line height when `series` is absent. */\n value: number;\n /** Gradient and stroke colour. */\n color: ChartMetricTrendColor;\n /** History to plot. Needs more than one point to draw a shape. */\n series?: number[];\n}\n\n/**\n * The small area chart inside a metric tile, per the `V2 Area Chart Item` slot of\n * the Figma insight card.\n *\n * `series` is optional because the endpoints behind these cards often return a\n * single scalar with no history. With nothing to plot the chart draws a flat line\n * at the current value rather than collapsing the slot, so the card keeps the\n * height and shape the design gives it. The line is deliberately level rather\n * than shaped, so it asserts no history that the data cannot support.\n *\n * @example\n * ```tsx\n * <ChartMetricTrend value={42} color=\"teal\" />\n * ```\n */\nexport const ChartMetricTrend = React.forwardRef<HTMLDivElement, ChartMetricTrendProps>(\n ({ value, color, series, className, ...props }, ref) => {\n const points = series && series.length > 1 ? series : [value, value];\n const chartData = points.map((point, index) => ({ index, value: point }));\n const chartConfig: ChartConfig = { value: { color: CHART_COLORS[color] } };\n // Per instance, not per colour: two same-colour cards would otherwise emit the\n // same id and every `url(#...)` in the document would resolve to whichever\n // rendered first. `useId` emits colons, which are legal in an `id` but break\n // `querySelector`, so strip them.\n const gradientId = `metric-trend-gradient-${React.useId().replace(/:/g, \"\")}`;\n\n return (\n // 106px is the design's `V2 Area Chart Item` slot height.\n <ChartContainer\n ref={ref}\n config={chartConfig}\n className={cn(\"block aspect-auto h-[106px] w-full\", className)}\n {...props}\n >\n <AreaChart data={chartData} margin={{ top: 4, bottom: 0, left: 0, right: 0 }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"var(--color-value)\" stopOpacity={0.3} />\n <stop offset=\"100%\" stopColor=\"var(--color-value)\" stopOpacity={0} />\n </linearGradient>\n </defs>\n {/*\n * Padded domain so a flat line sits inside the plot area instead of\n * along its floor, where it would read as a zero value.\n */}\n <YAxis hide domain={[\"dataMin - 1\", \"dataMax + 1\"]} />\n <Area\n type=\"monotone\"\n dataKey=\"value\"\n stroke=\"var(--color-value)\"\n strokeWidth={2}\n fill={`url(#${gradientId})`}\n dot={false}\n isAnimationActive={false}\n />\n </AreaChart>\n </ChartContainer>\n );\n },\n);\n\nChartMetricTrend.displayName = \"ChartMetricTrend\";\n"],"names":[],"mappings":";;;;;;AAcA,MAAM,eAAsD;AAAA,EAC1D,KAAK;AAAA,EACL,MAAM;AACR;AA2BO,MAAM,mBAAmB,MAAM;AAAA,EACpC,CAAC,EAAE,OAAO,OAAO,QAAQ,WAAW,GAAG,MAAA,GAAS,QAAQ;AACtD,UAAM,SAAS,UAAU,OAAO,SAAS,IAAI,SAAS,CAAC,OAAO,KAAK;AACnE,UAAM,YAAY,OAAO,IAAI,CAAC,OAAO,WAAW,EAAE,OAAO,OAAO,MAAA,EAAQ;AACxE,UAAM,cAA2B,EAAE,OAAO,EAAE,OAAO,aAAa,KAAK,IAAE;AAKvE,UAAM,aAAa,yBAAyB,MAAM,MAAA,EAAQ,QAAQ,MAAM,EAAE,CAAC;AAE3E;AAAA;AAAA,MAEE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,QAAQ;AAAA,UACR,WAAW,GAAG,sCAAsC,SAAS;AAAA,UAC5D,GAAG;AAAA,UAEJ,UAAA,qBAAC,WAAA,EAAU,MAAM,WAAW,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,KACvE,UAAA;AAAA,YAAA,oBAAC,QAAA,EACC,UAAA,qBAAC,kBAAA,EAAe,IAAI,YAAY,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KACtD,UAAA;AAAA,cAAA,oBAAC,UAAK,QAAO,MAAK,WAAU,sBAAqB,aAAa,KAAK;AAAA,kCAClE,QAAA,EAAK,QAAO,QAAO,WAAU,sBAAqB,aAAa,EAAA,CAAG;AAAA,YAAA,EAAA,CACrE,EAAA,CACF;AAAA,YAKA,oBAAC,SAAM,MAAI,MAAC,QAAQ,CAAC,eAAe,aAAa,GAAG;AAAA,YACpD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,QAAO;AAAA,gBACP,aAAa;AAAA,gBACb,MAAM,QAAQ,UAAU;AAAA,gBACxB,KAAK;AAAA,gBACL,mBAAmB;AAAA,cAAA;AAAA,YAAA;AAAA,UACrB,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAGN;AACF;AAEA,iBAAiB,cAAc;"}
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../utils/cn.mjs";
5
+ import { Skeleton } from "../Skeleton/Skeleton.mjs";
6
+ const BAR_HEIGHTS = ["45%", "70%", "55%", "85%", "60%", "95%", "75%"];
7
+ const barHeight = (index) => BAR_HEIGHTS[index % BAR_HEIGHTS.length];
8
+ const LABEL_WIDTHS = ["w-24", "w-32", "w-20", "w-28", "w-24"];
9
+ const labelWidth = (index) => LABEL_WIDTHS[index % LABEL_WIDTHS.length];
10
+ const Bar = ({ className }) => /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "rounded", className });
11
+ const TableSkeleton = ({ rows }) => /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col", children: [
12
+ /* @__PURE__ */ jsxs("div", { className: "flex h-8 items-center gap-3", children: [
13
+ /* @__PURE__ */ jsx(Bar, { className: "h-3 w-4" }),
14
+ /* @__PURE__ */ jsx(Bar, { className: "h-3 w-16" }),
15
+ /* @__PURE__ */ jsx(Bar, { className: "ml-auto h-3 w-12" })
16
+ ] }),
17
+ Array.from({ length: rows }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "flex h-12 items-center gap-3", children: [
18
+ /* @__PURE__ */ jsx(Bar, { className: "h-4 w-4" }),
19
+ /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "circular", className: "size-6 shrink-0" }),
20
+ /* @__PURE__ */ jsx(Bar, { className: cn("h-4", labelWidth(index)) }),
21
+ /* @__PURE__ */ jsx(Bar, { className: "ml-auto h-4 w-16" })
22
+ ] }, `table-row-${index}`))
23
+ ] });
24
+ const RowsSkeleton = ({ rows }) => /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-4", children: Array.from({ length: rows }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-2", children: [
25
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [
26
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
27
+ /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "circular", className: "size-5 shrink-0" }),
28
+ /* @__PURE__ */ jsx(Bar, { className: cn("h-4", labelWidth(index)) })
29
+ ] }),
30
+ /* @__PURE__ */ jsx(Bar, { className: "h-4 w-10 shrink-0" })
31
+ ] }),
32
+ /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "rounded", className: "h-2 w-full rounded-full" })
33
+ ] }, `row-${index}`)) });
34
+ const ChartSkeleton = React.forwardRef(
35
+ ({ variant = "area", rows, className, ...props }, ref) => {
36
+ const rowCount = rows ?? 5;
37
+ const bars = rows ?? BAR_HEIGHTS.length;
38
+ if (variant === "table" || variant === "rows") {
39
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), ...props, children: variant === "table" ? /* @__PURE__ */ jsx(TableSkeleton, { rows: rowCount }) : /* @__PURE__ */ jsx(RowsSkeleton, { rows: rowCount }) });
40
+ }
41
+ if (variant === "circular") {
42
+ return /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ ref,
46
+ className: cn("flex size-full items-center justify-center", className),
47
+ ...props,
48
+ children: /* @__PURE__ */ jsx("div", { className: "aspect-square h-full", children: /* @__PURE__ */ jsx(
49
+ Skeleton,
50
+ {
51
+ animation: "wave",
52
+ variant: "circular",
53
+ className: "size-full [mask-image:radial-gradient(circle,transparent_27%,black_28%)]"
54
+ }
55
+ ) })
56
+ }
57
+ );
58
+ }
59
+ if (variant === "bar") {
60
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("flex size-full items-end gap-2", className), ...props, children: Array.from({ length: bars }, (_, index) => /* @__PURE__ */ jsx(
61
+ Skeleton,
62
+ {
63
+ animation: "wave",
64
+ variant: "rounded",
65
+ className: "flex-1",
66
+ height: barHeight(index)
67
+ },
68
+ `bar-${index}`
69
+ )) });
70
+ }
71
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("size-full", className), ...props, children: /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "rounded", className: "size-full" }) });
72
+ }
73
+ );
74
+ ChartSkeleton.displayName = "ChartSkeleton";
75
+ export {
76
+ ChartSkeleton
77
+ };
78
+ //# sourceMappingURL=ChartSkeleton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartSkeleton.mjs","sources":["../../../src/components/Chart/ChartSkeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Skeleton } from \"../Skeleton/Skeleton\";\n\n/**\n * Shape the skeleton should imitate while data loads. `area` and `line` render\n * the same filled band — a continuous series reads better as a band than as\n * discrete bars. `table` and `rows` stand in for the two list bodies an insight\n * card can hold rather than a chart: a ranked table, and a breakdown of labelled\n * bars.\n */\nexport type ChartSkeletonVariant = \"area\" | \"line\" | \"bar\" | \"circular\" | \"table\" | \"rows\";\n\n/** Props for {@link ChartSkeleton}. */\nexport interface ChartSkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Which shape to imitate. @default \"area\" */\n variant?: ChartSkeletonVariant;\n /**\n * How many items to draw: rows for `table` and `rows`, bars for `bar`. Match\n * the count the loaded card will show, so the card does not resize once the\n * real content arrives. Defaults to 5 rows, or 7 bars.\n */\n rows?: number;\n}\n\n/** Varying bar heights, so the series does not read as a solid block. */\nconst BAR_HEIGHTS = [\"45%\", \"70%\", \"55%\", \"85%\", \"60%\", \"95%\", \"75%\"];\n\nconst barHeight = (index: number) => BAR_HEIGHTS[index % BAR_HEIGHTS.length];\n\n/** Varying label widths, so the rows do not read as a single solid block. */\nconst LABEL_WIDTHS = [\"w-24\", \"w-32\", \"w-20\", \"w-28\", \"w-24\"];\n\nconst labelWidth = (index: number) => LABEL_WIDTHS[index % LABEL_WIDTHS.length];\n\nconst Bar = ({ className }: { className?: string }) => (\n <Skeleton animation=\"wave\" variant=\"rounded\" className={className} />\n);\n\n/**\n * A ranked table: the header, then one 48px row per entry holding a rank, an\n * avatar and handle, and a value at the end — the columns {@link ChartCard}'s\n * table bodies use.\n */\nconst TableSkeleton = ({ rows }: { rows: number }) => (\n <div className=\"flex w-full flex-col\">\n <div className=\"flex h-8 items-center gap-3\">\n <Bar className=\"h-3 w-4\" />\n <Bar className=\"h-3 w-16\" />\n <Bar className=\"ml-auto h-3 w-12\" />\n </div>\n {Array.from({ length: rows }, (_, index) => (\n <div key={`table-row-${index}`} className=\"flex h-12 items-center gap-3\">\n <Bar className=\"h-4 w-4\" />\n <Skeleton animation=\"wave\" variant=\"circular\" className=\"size-6 shrink-0\" />\n <Bar className={cn(\"h-4\", labelWidth(index))} />\n <Bar className=\"ml-auto h-4 w-16\" />\n </div>\n ))}\n </div>\n);\n\n/**\n * A breakdown list: per row a leading glyph and label with its share at the far\n * end, then the bar underneath. Mirrors `Demographics`, down to its 8px inner gap\n * and 8px `medium` bar, so the swap to real rows is invisible.\n */\nconst RowsSkeleton = ({ rows }: { rows: number }) => (\n <div className=\"flex w-full flex-col gap-4\">\n {Array.from({ length: rows }, (_, index) => (\n <div key={`row-${index}`} className=\"flex w-full flex-col gap-2\">\n <div className=\"flex w-full items-center justify-between gap-2\">\n <span className=\"flex items-center gap-2\">\n <Skeleton animation=\"wave\" variant=\"circular\" className=\"size-5 shrink-0\" />\n <Bar className={cn(\"h-4\", labelWidth(index))} />\n </span>\n <Bar className=\"h-4 w-10 shrink-0\" />\n </div>\n <Skeleton animation=\"wave\" variant=\"rounded\" className=\"h-2 w-full rounded-full\" />\n </div>\n ))}\n </div>\n);\n\n/**\n * A wave-animated placeholder shaped like the content it stands in for — a chart\n * series, a ranked table, or a breakdown of labelled bars. Use it while data\n * loads instead of a generic spinner, so the layout does not visibly shift once\n * the real content renders.\n *\n * For a chart body, pass it to {@link ChartLoadingOverlay} via its `variant` prop\n * rather than rendering it directly. For a card body, pass it to `ChartCard`'s\n * `skeleton` prop.\n *\n * @example\n * ```tsx\n * <ChartSkeleton variant=\"bar\" className=\"h-48\" />\n * <ChartSkeleton variant=\"table\" rows={5} />\n * ```\n */\nexport const ChartSkeleton = React.forwardRef<HTMLDivElement, ChartSkeletonProps>(\n ({ variant = \"area\", rows, className, ...props }, ref) => {\n // Resolved per variant so `rows` can drive the bar count without moving the bar\n // default from 7 to the list default of 5.\n const rowCount = rows ?? 5;\n const bars = rows ?? BAR_HEIGHTS.length;\n\n if (variant === \"table\" || variant === \"rows\") {\n return (\n <div ref={ref} className={cn(\"w-full\", className)} {...props}>\n {variant === \"table\" ? (\n <TableSkeleton rows={rowCount} />\n ) : (\n <RowsSkeleton rows={rowCount} />\n )}\n </div>\n );\n }\n\n if (variant === \"circular\") {\n return (\n <div\n ref={ref}\n className={cn(\"flex size-full items-center justify-center\", className)}\n {...props}\n >\n <div className=\"aspect-square h-full\">\n {/*\n * The hole is masked out rather than painted over. A disc filled with a\n * surface colour only disappears on a surface of exactly that colour, and\n * this renders standalone via `ChartCard`'s `skeleton` prop as well as\n * inside `ChartLoadingOverlay`, so it cannot assume what is underneath.\n */}\n <Skeleton\n animation=\"wave\"\n variant=\"circular\"\n className=\"size-full [mask-image:radial-gradient(circle,transparent_27%,black_28%)]\"\n />\n </div>\n </div>\n );\n }\n\n if (variant === \"bar\") {\n return (\n <div ref={ref} className={cn(\"flex size-full items-end gap-2\", className)} {...props}>\n {Array.from({ length: bars }, (_, index) => (\n <Skeleton\n key={`bar-${index}`}\n animation=\"wave\"\n variant=\"rounded\"\n className=\"flex-1\"\n height={barHeight(index)}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn(\"size-full\", className)} {...props}>\n <Skeleton animation=\"wave\" variant=\"rounded\" className=\"size-full\" />\n </div>\n );\n },\n);\n\nChartSkeleton.displayName = \"ChartSkeleton\";\n"],"names":[],"mappings":";;;;;AA0BA,MAAM,cAAc,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK;AAEpE,MAAM,YAAY,CAAC,UAAkB,YAAY,QAAQ,YAAY,MAAM;AAG3E,MAAM,eAAe,CAAC,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAE5D,MAAM,aAAa,CAAC,UAAkB,aAAa,QAAQ,aAAa,MAAM;AAE9E,MAAM,MAAM,CAAC,EAAE,UAAA,MACb,oBAAC,UAAA,EAAS,WAAU,QAAO,SAAQ,WAAU,UAAA,CAAsB;AAQrE,MAAM,gBAAgB,CAAC,EAAE,WACvB,qBAAC,OAAA,EAAI,WAAU,wBACb,UAAA;AAAA,EAAA,qBAAC,OAAA,EAAI,WAAU,+BACb,UAAA;AAAA,IAAA,oBAAC,KAAA,EAAI,WAAU,UAAA,CAAU;AAAA,IACzB,oBAAC,KAAA,EAAI,WAAU,WAAA,CAAW;AAAA,IAC1B,oBAAC,K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AEjC,QAAI,YAAY,WAAW,YAAY,QAAQ;AAC7C,aACE,oBAAC,SAAI,KAAU,WAAW,GAAG,UAAU,SAAS,GAAI,GAAG,OACpD,sBAAY,UACX,oBAAC,iBAAc,MAAM,SAAA,CAAU,IAE/B,oBAAC,cAAA,EAAa,MAAM,SAAA,CAAU,EAAA,CAElC;AAAA,IAEJ;AAEA,QAAI,YAAY,YAAY;AAC1B,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,8CAA8C,SAAS;AAAA,UACpE,GAAG;AAAA,UAEJ,UAAA,oBAAC,OAAA,EAAI,WAAU,wBAOb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR,WAAU;AAAA,YAAA;AAAA,UAAA,EACZ,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN;AAEA,QAAI,YAAY,OAAO;AACrB,iCACG,OAAA,EAAI,KAAU,WAAW,GAAG,kCAAkC,SAAS,GAAI,GAAG,OAC5E,UAAA,MAAM,KAAK,EAAE,QAAQ,QAAQ,CAAC,GAAG,UAChC;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,QAAQ,UAAU,KAAK;AAAA,QAAA;AAAA,QAJlB,OAAO,KAAK;AAAA,MAAA,CAMpB,GACH;AAAA,IAEJ;AAEA,+BACG,OAAA,EAAI,KAAU,WAAW,GAAG,aAAa,SAAS,GAAI,GAAG,OACxD,UAAA,oBAAC,YAAS,WAAU,QAAO,SAAQ,WAAU,WAAU,aAAY,GACrE;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;"}
@@ -13,6 +13,7 @@ const Chip = React.forwardRef(
13
13
  disabled = false,
14
14
  leftDot = false,
15
15
  dotted = false,
16
+ outlined = false,
16
17
  leftIcon,
17
18
  rightIcon,
18
19
  notificationLabel,
@@ -27,13 +28,19 @@ const Chip = React.forwardRef(
27
28
  const isInteractive = !!onClick && !asChild;
28
29
  const Comp = asChild ? Slot : isInteractive ? "button" : "span";
29
30
  const isDark = variant === "dark";
30
- const showDottedBorder = !isDark && dotted && !selected && !asChild;
31
+ const isDotted = !isDark && dotted;
32
+ const isSolid = !isDark && !dotted && !outlined;
33
+ const isOutlined = !isDark && !dotted && outlined;
34
+ const showDottedBorder = isDotted && !selected && !asChild;
31
35
  const dottedBorder = showDottedBorder ? /* @__PURE__ */ jsx(
32
36
  "svg",
33
37
  {
34
38
  "aria-hidden": "true",
35
39
  className: cn(
36
- "pointer-events-none absolute inset-0 size-full overflow-visible",
40
+ // `-1px` spans the reserved transparent border rather than the padding box
41
+ // inside it, so the dash lands on the same ring as the solid border it
42
+ // becomes when selected.
43
+ "pointer-events-none absolute -top-px -left-px h-[calc(100%+2px)] w-[calc(100%+2px)] overflow-visible",
37
44
  disabled ? "text-buttons-chip-disabled" : "text-buttons-chip-dotted-default",
38
45
  isInteractive && !disabled && "group-hover:text-buttons-chip-dotted-hover-stroke group-active:text-buttons-chip-dotted-hover-stroke"
39
46
  ),
@@ -66,20 +73,39 @@ const Chip = React.forwardRef(
66
73
  size === "40" && "typography-body-small-14px-semibold h-10 py-2.5",
67
74
  // Variant colors
68
75
  isDark && "bg-neutral-alphas-600 text-content-always-white",
69
- !isDark && selected && !dotted && "bg-buttons-chip-active text-content-primary-inverted",
76
+ (isSolid || isOutlined) && selected && "bg-buttons-chip-active text-content-primary-inverted",
70
77
  // Active + dotted is a subtle filled state with a solid (non-dashed) border.
71
- !isDark && selected && dotted && "border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary",
72
- !isDark && !selected && !dotted && "bg-buttons-chip-default text-content-primary",
78
+ isDotted && selected && "border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary",
79
+ isSolid && !selected && "bg-buttons-chip-default text-content-primary",
80
+ // Outlined: the same token as a 1px stroke rather than a fill. The border
81
+ // is declared in BOTH states and only changes colour, going transparent
82
+ // once selected. It cannot be dropped on selection: `border-box` constrains
83
+ // only explicitly sized axes, and a chip's width is intrinsic, so losing the
84
+ // border would narrow the chip by 2px and reflow the whole row on every
85
+ // click. Height is safe either way because `h-8` is explicit.
86
+ isOutlined && "border border-solid",
87
+ isOutlined && !selected && "border-buttons-chip-default bg-transparent text-content-primary",
88
+ isOutlined && selected && "border-transparent",
73
89
  // Dotted (non-selected): the dashed border is drawn via SVG (`dottedBorder`).
74
90
  // `group` lets that SVG react to hover/active. `asChild` keeps a CSS dashed
75
91
  // border fallback since the SVG is only rendered in the default path.
76
- !isDark && !selected && dotted && "bg-transparent text-content-primary",
77
- !isDark && !selected && dotted && !asChild && "group",
78
- asChild && !isDark && !selected && dotted && (disabled ? "border border-buttons-chip-disabled border-dashed" : "border border-buttons-chip-dotted-default border-dashed"),
92
+ isDotted && !selected && "bg-transparent text-content-primary",
93
+ isDotted && !selected && !asChild && "group",
94
+ // The SVG path draws no CSS border, so selecting one used to add 1px and
95
+ // widen the chip by 2px, shifting the row on every toggle. Reserving a
96
+ // transparent border also puts the dash on the same ring as the solid
97
+ // border it becomes. The `asChild` path already has a real border below.
98
+ isDotted && !selected && !asChild && "border border-transparent border-solid",
99
+ isDotted && !selected && asChild && (disabled ? "border border-buttons-chip-disabled border-dashed" : "border border-buttons-chip-dotted-default border-dashed"),
79
100
  // Interactive
80
101
  isInteractive && !disabled && "cursor-pointer",
81
- isInteractive && !disabled && !isDark && !selected && !dotted && "hover:bg-buttons-chip-hover",
82
- isInteractive && !disabled && !isDark && !selected && dotted && "hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50",
102
+ isInteractive && !disabled && isSolid && !selected && "hover:bg-buttons-chip-hover",
103
+ // Outlined darkens its stroke rather than filling. `buttons-chip-hover` is
104
+ // the one-step darkening for chips, but as a fill it is 20% over a 10%
105
+ // stroke, so it swallows the outline the variant exists to show. Moved onto
106
+ // the border, over `interaction-hover`, the atomic hover surface.
107
+ isInteractive && !disabled && isOutlined && !selected && "hover:border-buttons-chip-hover hover:bg-interaction-hover",
108
+ isInteractive && !disabled && isDotted && !selected && "hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50",
83
109
  // Focus
84
110
  "focus-visible:shadow-focus-ring focus-visible:outline-none",
85
111
  // Disabled
@@ -87,7 +113,10 @@ const Chip = React.forwardRef(
87
113
  disabled && !isDark && "pointer-events-none text-content-disabled",
88
114
  // Solid (non-dotted) disabled chips get a muted fill; dotted ones stay
89
115
  // transparent with their dashed border (drawn via SVG).
90
- disabled && !isDark && !dotted && "bg-buttons-chip-disabled",
116
+ disabled && (isSolid || isOutlined && selected) && "bg-buttons-chip-disabled",
117
+ // Unselected outlined greys only its stroke. Selected is already filled, so
118
+ // it takes the muted fill above and keeps `border-transparent` for its width.
119
+ disabled && isOutlined && !selected && "border-buttons-chip-disabled",
91
120
  className
92
121
  ),
93
122
  ...isInteractive && {
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountVariant } from \"../Count/Count\";\n\n/** Visual variant of the chip. */\nexport type ChipVariant = \"rounded\" | \"square\" | \"dark\";\n/** Height of the chip in pixels. */\nexport type ChipSize = \"32\" | \"40\";\n\nexport interface ChipProps extends React.HTMLAttributes<HTMLElement> {\n /** Visual variant of the chip. @default \"rounded\" */\n variant?: ChipVariant;\n /** Height of the chip in pixels. @default \"32\" */\n size?: ChipSize;\n /** Whether the chip is in a selected (pressed) state. @default false */\n selected?: boolean;\n /** Whether the chip is disabled. @default false */\n disabled?: boolean;\n /** Whether to show a coloured status dot at the leading edge. @default false */\n leftDot?: boolean;\n /**\n * Whether the chip uses a dashed border for add/create affordances.\n * When `selected`, it becomes a subtle filled state with a solid border.\n * Has no effect when `variant=\"dark\"`.\n * @default false\n */\n dotted?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Notification badge content (e.g. `\"99+\"`). Passed as a string for i18n support. */\n notificationLabel?: string;\n /** Numeric value for the notification badge. Uses the `Count` component for overflow formatting. Takes precedence over `notificationLabel` when both are provided. */\n notificationCount?: number;\n /** Maximum value before the badge shows overflow (e.g. `\"9+\"`). Only applies when `notificationCount` is set. @default 99 */\n notificationMax?: number;\n /** Colour variant of the notification badge. @default \"brand\" */\n notificationVariant?: CountVariant;\n /** Click handler — when provided, the chip renders as a `<button>` for accessibility. */\n onClick?: React.MouseEventHandler<HTMLElement>;\n /** Merge props onto a child element instead of rendering a wrapper. @default false */\n asChild?: boolean;\n}\n\n/**\n * A compact element for filters, tags, or toggleable actions. When an `onClick`\n * handler is provided, the chip renders as an interactive `<button>` with\n * `aria-pressed` support.\n *\n * @example\n * ```tsx\n * <Chip selected onClick={toggle}>Music</Chip>\n * ```\n */\nexport const Chip = React.forwardRef<HTMLButtonElement, ChipProps>(\n (\n {\n className,\n variant = \"rounded\",\n size = \"32\",\n selected = false,\n disabled = false,\n leftDot = false,\n dotted = false,\n leftIcon,\n rightIcon,\n notificationLabel,\n notificationCount,\n notificationMax,\n notificationVariant = \"brand\",\n onClick,\n asChild = false,\n children,\n ...props\n },\n ref,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Variant-heavy UI component\n ) => {\n const isInteractive = !!onClick && !asChild;\n const Comp = asChild ? Slot : isInteractive ? \"button\" : \"span\";\n const isDark = variant === \"dark\";\n\n // The dashed border is drawn as an SVG so the dash length matches the design\n // spec (8/8 for the 40px square, 6/6 otherwise). CSS `border-dashed` only\n // renders browser-default dash lengths, which are too short. The stroke colour\n // is driven by `currentColor`, and `group-hover`/`group-active` react to the\n // chip's interactive states. Rendered only in the default (non-`asChild`) path.\n const showDottedBorder = !isDark && dotted && !selected && !asChild;\n const dottedBorder = showDottedBorder ? (\n <svg\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 size-full overflow-visible\",\n disabled ? \"text-buttons-chip-disabled\" : \"text-buttons-chip-dotted-default\",\n isInteractive &&\n !disabled &&\n \"group-hover:text-buttons-chip-dotted-hover-stroke group-active:text-buttons-chip-dotted-hover-stroke\",\n )}\n >\n <rect\n x=\"0.5\"\n y=\"0.5\"\n rx={variant === \"square\" ? 7.5 : size === \"40\" ? 19.5 : 15.5}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeDasharray={variant === \"square\" && size === \"40\" ? \"8 8\" : \"6 6\"}\n style={{ width: \"calc(100% - 1px)\", height: \"calc(100% - 1px)\" }}\n />\n </svg>\n ) : null;\n\n return (\n <Comp\n ref={ref}\n data-testid=\"chip\"\n className={cn(\n \"relative inline-flex min-w-0 items-center justify-center whitespace-nowrap motion-safe:transition-colors motion-safe:duration-150\",\n // Shape\n variant === \"square\" ? \"rounded-xs\" : \"rounded-full\",\n // Size (32px uses 12px text, 40px uses 14px text per the design spec)\n size === \"32\" && \"typography-description-12px-semibold h-8 py-1\",\n size === \"40\" && \"typography-body-small-14px-semibold h-10 py-2.5\",\n // Variant colors\n isDark && \"bg-neutral-alphas-600 text-content-always-white\",\n !isDark && selected && !dotted && \"bg-buttons-chip-active text-content-primary-inverted\",\n // Active + dotted is a subtle filled state with a solid (non-dashed) border.\n !isDark &&\n selected &&\n dotted &&\n \"border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary\",\n !isDark && !selected && !dotted && \"bg-buttons-chip-default text-content-primary\",\n // Dotted (non-selected): the dashed border is drawn via SVG (`dottedBorder`).\n // `group` lets that SVG react to hover/active. `asChild` keeps a CSS dashed\n // border fallback since the SVG is only rendered in the default path.\n !isDark && !selected && dotted && \"bg-transparent text-content-primary\",\n !isDark && !selected && dotted && !asChild && \"group\",\n asChild &&\n !isDark &&\n !selected &&\n dotted &&\n (disabled\n ? \"border border-buttons-chip-disabled border-dashed\"\n : \"border border-buttons-chip-dotted-default border-dashed\"),\n // Interactive\n isInteractive && !disabled && \"cursor-pointer\",\n isInteractive &&\n !disabled &&\n !isDark &&\n !selected &&\n !dotted &&\n \"hover:bg-buttons-chip-hover\",\n isInteractive &&\n !disabled &&\n !isDark &&\n !selected &&\n dotted &&\n \"hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50\",\n // Focus\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n // Disabled\n disabled && isDark && \"pointer-events-none opacity-50\",\n disabled && !isDark && \"pointer-events-none text-content-disabled\",\n // Solid (non-dotted) disabled chips get a muted fill; dotted ones stay\n // transparent with their dashed border (drawn via SVG).\n disabled && !isDark && !dotted && \"bg-buttons-chip-disabled\",\n className,\n )}\n {...(isInteractive && {\n type: \"button\" as const,\n disabled,\n \"aria-pressed\": selected,\n onClick,\n })}\n {...(!isInteractive && disabled && { \"aria-disabled\": true })}\n {...(selected && { \"data-selected\": \"\" })}\n {...props}\n >\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <>\n {dottedBorder}\n <span className=\"flex min-w-0 items-center gap-0.5 overflow-hidden px-3\">\n {leftDot && (\n <span className=\"size-2 shrink-0 rounded-full bg-current\" aria-hidden=\"true\" />\n )}\n {leftIcon && (\n <span className=\"flex shrink-0 items-center justify-center\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n <span className=\"min-w-0 truncate\">{children}</span>\n {rightIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n </span>\n {(notificationCount != null || notificationLabel) && (\n <Count\n variant={notificationVariant}\n size=\"32\"\n className={cn(\n // V2 Notification Count: 20px high/min-width, caption 12,\n // 4px horizontal and 2px vertical padding, rounded-md.\n \"absolute top-[-4px] rounded-md px-1 py-0.5\",\n // Anchor the leading edge so wider values grow away from the label.\n size === \"40\" ? \"left-[calc(100%_-_16px)]\" : \"left-[calc(100%_-_11px)]\",\n )}\n value={notificationCount ?? 0}\n max={notificationMax}\n >\n {notificationCount == null ? notificationLabel : undefined}\n </Count>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\n\nChip.displayName = \"Chip\";\n"],"names":[],"mappings":";;;;;;AAwDO,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QAEG;AACH,UAAM,gBAAgB,CAAC,CAAC,WAAW,CAAC;AACpC,UAAM,OAAO,UAAU,OAAO,gBAAgB,WAAW;AACzD,UAAM,SAAS,YAAY;AAO3B,UAAM,mBAAmB,CAAC,UAAU,UAAU,CAAC,YAAY,CAAC;AAC5D,UAAM,eAAe,mBACnB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA,WAAW,+BAA+B;AAAA,UAC1C,iBACE,CAAC,YACD;AAAA,QAAA;AAAA,QAGJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAE;AAAA,YACF,GAAE;AAAA,YACF,IAAI,YAAY,WAAW,MAAM,SAAS,OAAO,OAAO;AAAA,YACxD,MAAK;AAAA,YACL,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,iBAAiB,YAAY,YAAY,SAAS,OAAO,QAAQ;AAAA,YACjE,OAAO,EAAE,OAAO,oBAAoB,QAAQ,mBAAA;AAAA,UAAmB;AAAA,QAAA;AAAA,MACjE;AAAA,IAAA,IAEA;AAEJ,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA;AAAA,UAEA,YAAY,WAAW,eAAe;AAAA;AAAA,UA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S;AAAA,YAC5C,aACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,eAAY;AAAA,gBAEX,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GAEJ;AAAA,WACE,qBAAqB,QAAQ,sBAC7B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,MAAK;AAAA,cACL,WAAW;AAAA;AAAA;AAAA,gBAGT;AAAA;AAAA,gBAEA,SAAS,OAAO,6BAA6B;AAAA,cAAA;AAAA,cAE/C,OAAO,qBAAqB;AAAA,cAC5B,KAAK;AAAA,cAEJ,UAAA,qBAAqB,OAAO,oBAAoB;AAAA,YAAA;AAAA,UAAA;AAAA,QACnD,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,KAAK,cAAc;"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountVariant } from \"../Count/Count\";\n\n/** Visual variant of the chip. */\nexport type ChipVariant = \"rounded\" | \"square\" | \"dark\";\n/** Height of the chip in pixels. */\nexport type ChipSize = \"32\" | \"40\";\n\nexport interface ChipProps extends React.HTMLAttributes<HTMLElement> {\n /** Visual variant of the chip. @default \"rounded\" */\n variant?: ChipVariant;\n /** Height of the chip in pixels. @default \"32\" */\n size?: ChipSize;\n /** Whether the chip is in a selected (pressed) state. @default false */\n selected?: boolean;\n /** Whether the chip is disabled. @default false */\n disabled?: boolean;\n /** Whether to show a coloured status dot at the leading edge. @default false */\n leftDot?: boolean;\n /**\n * Whether the chip uses a dashed border for add/create affordances.\n * When `selected`, it becomes a subtle filled state with a solid border.\n * Has no effect when `variant=\"dark\"`.\n * @default false\n */\n dotted?: boolean;\n /**\n * Draws the unselected state as a 1px `buttons-chip-default` outline over a\n * transparent background instead of filling with that same token. This is the\n * Figma `V2 Insights Chips` treatment, used where chips sit over a chart and a\n * row of solid fills would compete with the plotted series. The selected state\n * is unaffected — it stays filled — as are the `dark` and `dotted` variants.\n * @default false\n */\n outlined?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Notification badge content (e.g. `\"99+\"`). Passed as a string for i18n support. */\n notificationLabel?: string;\n /** Numeric value for the notification badge. Uses the `Count` component for overflow formatting. Takes precedence over `notificationLabel` when both are provided. */\n notificationCount?: number;\n /** Maximum value before the badge shows overflow (e.g. `\"9+\"`). Only applies when `notificationCount` is set. @default 99 */\n notificationMax?: number;\n /** Colour variant of the notification badge. @default \"brand\" */\n notificationVariant?: CountVariant;\n /** Click handler — when provided, the chip renders as a `<button>` for accessibility. */\n onClick?: React.MouseEventHandler<HTMLElement>;\n /** Merge props onto a child element instead of rendering a wrapper. @default false */\n asChild?: boolean;\n}\n\n/**\n * A compact element for filters, tags, or toggleable actions. When an `onClick`\n * handler is provided, the chip renders as an interactive `<button>` with\n * `aria-pressed` support.\n *\n * @example\n * ```tsx\n * <Chip selected onClick={toggle}>Music</Chip>\n * ```\n */\nexport const Chip = React.forwardRef<HTMLButtonElement, ChipProps>(\n (\n {\n className,\n variant = \"rounded\",\n size = \"32\",\n selected = false,\n disabled = false,\n leftDot = false,\n dotted = false,\n outlined = false,\n leftIcon,\n rightIcon,\n notificationLabel,\n notificationCount,\n notificationMax,\n notificationVariant = \"brand\",\n onClick,\n asChild = false,\n children,\n ...props\n },\n ref,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Variant-heavy UI component\n ) => {\n const isInteractive = !!onClick && !asChild;\n const Comp = asChild ? Slot : isInteractive ? \"button\" : \"span\";\n const isDark = variant === \"dark\";\n // Precedence between the three treatments, named once rather than re-derived per\n // rule: `dark` owns its own palette, `dotted` wins over `outlined`, and what is\n // left is the normal chip, either filled or outlined.\n const isDotted = !isDark && dotted;\n const isSolid = !isDark && !dotted && !outlined;\n const isOutlined = !isDark && !dotted && outlined;\n\n // The dashed border is drawn as an SVG so the dash length matches the design\n // spec (8/8 for the 40px square, 6/6 otherwise). CSS `border-dashed` only\n // renders browser-default dash lengths, which are too short. The stroke colour\n // is driven by `currentColor`, and `group-hover`/`group-active` react to the\n // chip's interactive states. Rendered only in the default (non-`asChild`) path.\n const showDottedBorder = isDotted && !selected && !asChild;\n const dottedBorder = showDottedBorder ? (\n <svg\n aria-hidden=\"true\"\n className={cn(\n // `-1px` spans the reserved transparent border rather than the padding box\n // inside it, so the dash lands on the same ring as the solid border it\n // becomes when selected.\n \"pointer-events-none absolute -top-px -left-px h-[calc(100%+2px)] w-[calc(100%+2px)] overflow-visible\",\n disabled ? \"text-buttons-chip-disabled\" : \"text-buttons-chip-dotted-default\",\n isInteractive &&\n !disabled &&\n \"group-hover:text-buttons-chip-dotted-hover-stroke group-active:text-buttons-chip-dotted-hover-stroke\",\n )}\n >\n <rect\n x=\"0.5\"\n y=\"0.5\"\n rx={variant === \"square\" ? 7.5 : size === \"40\" ? 19.5 : 15.5}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeDasharray={variant === \"square\" && size === \"40\" ? \"8 8\" : \"6 6\"}\n style={{ width: \"calc(100% - 1px)\", height: \"calc(100% - 1px)\" }}\n />\n </svg>\n ) : null;\n\n return (\n <Comp\n ref={ref}\n data-testid=\"chip\"\n className={cn(\n \"relative inline-flex min-w-0 items-center justify-center whitespace-nowrap motion-safe:transition-colors motion-safe:duration-150\",\n // Shape\n variant === \"square\" ? \"rounded-xs\" : \"rounded-full\",\n // Size (32px uses 12px text, 40px uses 14px text per the design spec)\n size === \"32\" && \"typography-description-12px-semibold h-8 py-1\",\n size === \"40\" && \"typography-body-small-14px-semibold h-10 py-2.5\",\n // Variant colors\n isDark && \"bg-neutral-alphas-600 text-content-always-white\",\n (isSolid || isOutlined) &&\n selected &&\n \"bg-buttons-chip-active text-content-primary-inverted\",\n // Active + dotted is a subtle filled state with a solid (non-dashed) border.\n isDotted &&\n selected &&\n \"border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary\",\n isSolid && !selected && \"bg-buttons-chip-default text-content-primary\",\n // Outlined: the same token as a 1px stroke rather than a fill. The border\n // is declared in BOTH states and only changes colour, going transparent\n // once selected. It cannot be dropped on selection: `border-box` constrains\n // only explicitly sized axes, and a chip's width is intrinsic, so losing the\n // border would narrow the chip by 2px and reflow the whole row on every\n // click. Height is safe either way because `h-8` is explicit.\n isOutlined && \"border border-solid\",\n isOutlined &&\n !selected &&\n \"border-buttons-chip-default bg-transparent text-content-primary\",\n isOutlined && selected && \"border-transparent\",\n // Dotted (non-selected): the dashed border is drawn via SVG (`dottedBorder`).\n // `group` lets that SVG react to hover/active. `asChild` keeps a CSS dashed\n // border fallback since the SVG is only rendered in the default path.\n isDotted && !selected && \"bg-transparent text-content-primary\",\n isDotted && !selected && !asChild && \"group\",\n // The SVG path draws no CSS border, so selecting one used to add 1px and\n // widen the chip by 2px, shifting the row on every toggle. Reserving a\n // transparent border also puts the dash on the same ring as the solid\n // border it becomes. The `asChild` path already has a real border below.\n isDotted && !selected && !asChild && \"border border-transparent border-solid\",\n isDotted &&\n !selected &&\n asChild &&\n (disabled\n ? \"border border-buttons-chip-disabled border-dashed\"\n : \"border border-buttons-chip-dotted-default border-dashed\"),\n // Interactive\n isInteractive && !disabled && \"cursor-pointer\",\n isInteractive && !disabled && isSolid && !selected && \"hover:bg-buttons-chip-hover\",\n // Outlined darkens its stroke rather than filling. `buttons-chip-hover` is\n // the one-step darkening for chips, but as a fill it is 20% over a 10%\n // stroke, so it swallows the outline the variant exists to show. Moved onto\n // the border, over `interaction-hover`, the atomic hover surface.\n isInteractive &&\n !disabled &&\n isOutlined &&\n !selected &&\n \"hover:border-buttons-chip-hover hover:bg-interaction-hover\",\n isInteractive &&\n !disabled &&\n isDotted &&\n !selected &&\n \"hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50\",\n // Focus\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n // Disabled\n disabled && isDark && \"pointer-events-none opacity-50\",\n disabled && !isDark && \"pointer-events-none text-content-disabled\",\n // Solid (non-dotted) disabled chips get a muted fill; dotted ones stay\n // transparent with their dashed border (drawn via SVG).\n disabled && (isSolid || (isOutlined && selected)) && \"bg-buttons-chip-disabled\",\n // Unselected outlined greys only its stroke. Selected is already filled, so\n // it takes the muted fill above and keeps `border-transparent` for its width.\n disabled && isOutlined && !selected && \"border-buttons-chip-disabled\",\n className,\n )}\n {...(isInteractive && {\n type: \"button\" as const,\n disabled,\n \"aria-pressed\": selected,\n onClick,\n })}\n {...(!isInteractive && disabled && { \"aria-disabled\": true })}\n {...(selected && { \"data-selected\": \"\" })}\n {...props}\n >\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <>\n {dottedBorder}\n <span className=\"flex min-w-0 items-center gap-0.5 overflow-hidden px-3\">\n {leftDot && (\n <span className=\"size-2 shrink-0 rounded-full bg-current\" aria-hidden=\"true\" />\n )}\n {leftIcon && (\n <span className=\"flex shrink-0 items-center justify-center\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n <span className=\"min-w-0 truncate\">{children}</span>\n {rightIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n </span>\n {(notificationCount != null || notificationLabel) && (\n <Count\n variant={notificationVariant}\n size=\"32\"\n className={cn(\n // V2 Notification Count: 20px high/min-width, caption 12,\n // 4px horizontal and 2px vertical padding, rounded-md.\n \"absolute top-[-4px] rounded-md px-1 py-0.5\",\n // Anchor the leading edge so wider values grow away from the label.\n size === \"40\" ? \"left-[calc(100%_-_16px)]\" : \"left-[calc(100%_-_11px)]\",\n )}\n value={notificationCount ?? 0}\n max={notificationMax}\n >\n {notificationCount == null ? notificationLabel : undefined}\n </Count>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\n\nChip.displayName =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