@acronis-platform/ui-react 0.57.1 → 0.58.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 (129) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +149 -0
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -0
  3. package/dist/components/ui/bar-chart/bar-chart.js +152 -77
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/button-icon-input/button-icon-input.js +36 -0
  6. package/dist/components/ui/button-icon-input/button-icon-input.js.map +1 -0
  7. package/dist/components/ui/button-menu/button-menu.js +1 -1
  8. package/dist/components/ui/button-menu/button-menu.js.map +1 -1
  9. package/dist/components/ui/card-filter/card-filter.js +40 -27
  10. package/dist/components/ui/card-filter/card-filter.js.map +1 -1
  11. package/dist/components/ui/chart-state/chart-state.js +42 -0
  12. package/dist/components/ui/chart-state/chart-state.js.map +1 -0
  13. package/dist/components/ui/chip/chip.js +13 -13
  14. package/dist/components/ui/chip/chip.js.map +1 -1
  15. package/dist/components/ui/composed-chart/composed-chart.js +107 -0
  16. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
  17. package/dist/components/ui/confidence-cone/confidence-cone.js +195 -0
  18. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -0
  19. package/dist/components/ui/date-range-picker/date-range-picker.js +21 -21
  20. package/dist/components/ui/date-range-picker/date-range-picker.js.map +1 -1
  21. package/dist/components/ui/dialog/dialog.js +250 -78
  22. package/dist/components/ui/dialog/dialog.js.map +1 -1
  23. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +26 -0
  24. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -0
  25. package/dist/components/ui/dropdown-menu/dropdown-menu.js +21 -21
  26. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  27. package/dist/components/ui/filter-search/filter-search.js +91 -90
  28. package/dist/components/ui/filter-search/filter-search.js.map +1 -1
  29. package/dist/components/ui/funnel-chart/funnel-chart.js +87 -0
  30. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -0
  31. package/dist/components/ui/histogram/histogram.js +108 -0
  32. package/dist/components/ui/histogram/histogram.js.map +1 -0
  33. package/dist/components/ui/input-otp/input-otp.js +104 -0
  34. package/dist/components/ui/input-otp/input-otp.js.map +1 -0
  35. package/dist/components/ui/input-password/input-password.js +120 -0
  36. package/dist/components/ui/input-password/input-password.js.map +1 -0
  37. package/dist/components/ui/input-text/input-text.js +9 -9
  38. package/dist/components/ui/input-text/input-text.js.map +1 -1
  39. package/dist/components/ui/line-chart/line-chart.js +206 -0
  40. package/dist/components/ui/line-chart/line-chart.js.map +1 -0
  41. package/dist/components/ui/link/link.js +5 -5
  42. package/dist/components/ui/link/link.js.map +1 -1
  43. package/dist/components/ui/loading/loading.js +79 -0
  44. package/dist/components/ui/loading/loading.js.map +1 -0
  45. package/dist/components/ui/meter/meter.js +93 -0
  46. package/dist/components/ui/meter/meter.js.map +1 -0
  47. package/dist/components/ui/metric/metric.js +185 -0
  48. package/dist/components/ui/metric/metric.js.map +1 -0
  49. package/dist/components/ui/pie-chart/pie-chart.js +113 -0
  50. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -0
  51. package/dist/components/ui/popover/popover.js +57 -27
  52. package/dist/components/ui/popover/popover.js.map +1 -1
  53. package/dist/components/ui/radar-chart/radar-chart.js +74 -0
  54. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -0
  55. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +69 -0
  56. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -0
  57. package/dist/components/ui/scatter-chart/scatter-chart.js +102 -0
  58. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -0
  59. package/dist/components/ui/search/search.js +16 -16
  60. package/dist/components/ui/search/search.js.map +1 -1
  61. package/dist/components/ui/sheet/sheet-details.js +16 -16
  62. package/dist/components/ui/sheet/sheet-details.js.map +1 -1
  63. package/dist/components/ui/spinner/spinner.js.map +1 -1
  64. package/dist/components/ui/timeline/timeline.js +175 -0
  65. package/dist/components/ui/timeline/timeline.js.map +1 -0
  66. package/dist/components/ui/treemap/treemap.js +83 -0
  67. package/dist/components/ui/treemap/treemap.js.map +1 -0
  68. package/dist/components/ui/trend-indicator/trend-indicator.js +97 -0
  69. package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -0
  70. package/dist/index.js +423 -384
  71. package/dist/index.js.map +1 -1
  72. package/dist/react.js +423 -384
  73. package/dist/react.js.map +1 -1
  74. package/dist/src/components/ui/area-chart/area-chart.d.ts +49 -0
  75. package/dist/src/components/ui/area-chart/index.d.ts +1 -0
  76. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  77. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +42 -2
  78. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  79. package/dist/src/components/ui/button-icon-input/button-icon-input.d.ts +21 -0
  80. package/dist/src/components/ui/button-icon-input/index.d.ts +1 -0
  81. package/dist/src/components/ui/card-filter/card-filter.d.ts +5 -0
  82. package/dist/src/components/ui/chart-state/chart-state.d.ts +11 -0
  83. package/dist/src/components/ui/chart-state/index.d.ts +1 -0
  84. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +48 -0
  85. package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
  86. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +79 -0
  87. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -0
  88. package/dist/src/components/ui/dialog/dialog.d.ts +105 -9
  89. package/dist/src/components/ui/dialog/dialog.docs.d.ts +82 -5
  90. package/dist/src/components/ui/dialog/index.d.ts +1 -1
  91. package/dist/src/components/ui/dialog-footer-default/dialog-footer-default.d.ts +11 -0
  92. package/dist/src/components/ui/dialog-footer-default/index.d.ts +1 -0
  93. package/dist/src/components/ui/filter-search/filter-search.d.ts +1 -1
  94. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +39 -0
  95. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -0
  96. package/dist/src/components/ui/histogram/histogram.d.ts +55 -0
  97. package/dist/src/components/ui/histogram/index.d.ts +1 -0
  98. package/dist/src/components/ui/input-otp/index.d.ts +1 -0
  99. package/dist/src/components/ui/input-otp/input-otp.d.ts +23 -0
  100. package/dist/src/components/ui/input-password/index.d.ts +1 -0
  101. package/dist/src/components/ui/input-password/input-password.d.ts +21 -0
  102. package/dist/src/components/ui/line-chart/index.d.ts +1 -0
  103. package/dist/src/components/ui/line-chart/line-chart.d.ts +83 -0
  104. package/dist/src/components/ui/loading/index.d.ts +1 -0
  105. package/dist/src/components/ui/loading/loading.d.ts +13 -0
  106. package/dist/src/components/ui/meter/index.d.ts +1 -0
  107. package/dist/src/components/ui/meter/meter.d.ts +25 -0
  108. package/dist/src/components/ui/metric/index.d.ts +1 -0
  109. package/dist/src/components/ui/metric/metric.d.ts +37 -0
  110. package/dist/src/components/ui/pie-chart/index.d.ts +1 -0
  111. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +54 -0
  112. package/dist/src/components/ui/popover/index.d.ts +1 -1
  113. package/dist/src/components/ui/popover/popover.d.ts +13 -1
  114. package/dist/src/components/ui/radar-chart/index.d.ts +1 -0
  115. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +40 -0
  116. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -0
  117. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +45 -0
  118. package/dist/src/components/ui/scatter-chart/index.d.ts +1 -0
  119. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +50 -0
  120. package/dist/src/components/ui/stack/stack.d.ts +1 -1
  121. package/dist/src/components/ui/timeline/index.d.ts +1 -0
  122. package/dist/src/components/ui/timeline/timeline.d.ts +41 -0
  123. package/dist/src/components/ui/treemap/index.d.ts +1 -0
  124. package/dist/src/components/ui/treemap/treemap.d.ts +44 -0
  125. package/dist/src/components/ui/trend-indicator/index.d.ts +1 -0
  126. package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +32 -0
  127. package/dist/src/index.d.ts +22 -2
  128. package/dist/ui-react.css +1 -1
  129. package/package.json +3 -3
@@ -1,48 +1,61 @@
1
- import { jsxs as i, Fragment as v, jsx as l } from "react/jsx-runtime";
2
- import * as g from "react";
1
+ import { jsxs as l, Fragment as g, jsx as t } from "react/jsx-runtime";
2
+ import * as p from "react";
3
3
  import { mergeProps as m } from "@base-ui/react/merge-props";
4
- import { useRender as p } from "@base-ui/react/use-render";
5
- import { cva as x } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
- import { cn as o } from "../../../lib/utils.js";
7
- const h = x(
4
+ import { useRender as x } from "@base-ui/react/use-render";
5
+ import { cva as h } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
+ import { cn as c } from "../../../lib/utils.js";
7
+ const y = h(
8
8
  "inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors",
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
12
  static: "",
13
13
  "static-empty": "",
14
- clickable: "cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]"
14
+ clickable: "cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[color:var(--ui-card-filter-global-border-color-active)] data-[selected=true]:bg-[var(--ui-card-filter-global-container-color-active)]"
15
15
  }
16
16
  },
17
17
  defaultVariants: {
18
18
  variant: "static"
19
19
  }
20
20
  }
21
- ), y = {
21
+ ), k = {
22
22
  static: "text-[var(--ui-card-filter-static-value-color-idle)]",
23
23
  "static-empty": "text-[var(--ui-card-filter-static-value-color-disabled)]",
24
24
  clickable: "text-[var(--ui-card-filter-clickable-value-color)]"
25
- }, k = g.forwardRef(
26
- ({ className: t, variant: r = "static", label: c, value: s, icon: d, render: n, ...b }, u) => {
27
- const a = r === "static-empty", e = r === "clickable", f = a ? "–" : s;
28
- return p({
29
- render: n,
30
- ref: u,
25
+ }, N = p.forwardRef(
26
+ ({
27
+ className: d,
28
+ variant: r = "static",
29
+ label: s,
30
+ value: n,
31
+ icon: b,
32
+ selected: a,
33
+ render: o,
34
+ ...u
35
+ }, v) => {
36
+ const i = r === "static-empty", e = r === "clickable", f = i ? "–" : n;
37
+ return x({
38
+ render: o,
39
+ ref: v,
31
40
  defaultTagName: e ? "button" : "div",
32
41
  props: m(
33
42
  {
34
- className: o(h({ variant: r }), t),
35
- ...e ? { type: "button" } : {},
36
- children: /* @__PURE__ */ i(v, { children: [
37
- /* @__PURE__ */ l("span", { className: "text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]", children: c }),
38
- /* @__PURE__ */ i("span", { className: "flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0", children: [
39
- !a && d,
40
- /* @__PURE__ */ l(
43
+ className: c(y({ variant: r }), d),
44
+ ...e && !o ? {
45
+ type: "button",
46
+ ...a !== void 0 ? { "aria-pressed": a } : {}
47
+ } : {},
48
+ ...e ? { "data-selected": a ? "true" : void 0 } : {},
49
+ children: /* @__PURE__ */ l(g, { children: [
50
+ /* @__PURE__ */ t("span", { className: "text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]", children: s }),
51
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0", children: [
52
+ !i && b,
53
+ /* @__PURE__ */ t(
41
54
  "span",
42
55
  {
43
- className: o(
56
+ className: c(
44
57
  "text-2xl font-semibold leading-8",
45
- y[r ?? "static"]
58
+ k[r ?? "static"]
46
59
  ),
47
60
  children: f
48
61
  }
@@ -50,14 +63,14 @@ const h = x(
50
63
  ] })
51
64
  ] })
52
65
  },
53
- b
66
+ u
54
67
  )
55
68
  });
56
69
  }
57
70
  );
58
- k.displayName = "CardFilter";
71
+ N.displayName = "CardFilter";
59
72
  export {
60
- k as CardFilter,
61
- h as cardFilterVariants
73
+ N as CardFilter,
74
+ y as cardFilterVariants
62
75
  };
63
76
  //# sourceMappingURL=card-filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card-filter.js","sources":["../../../../src/components/ui/card-filter/card-filter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"CardFilter\" component: a compact stat/filter card — a caption\n// `label` above a content row (optional `icon` + a large `value`). `variant` maps\n// to the Figma `variant` property:\n// • `static` — non-interactive; value in `--ui-card-filter-static-value-color-idle`.\n// • `static-empty` — non-interactive placeholder; no icon, an em-dash value in\n// `--ui-card-filter-static-value-color-disabled`.\n// • `clickable` — interactive (renders a <button>); value in\n// `--ui-card-filter-clickable-value-color`, plus hover / active /\n// focus-visible treatments.\n// Per the Figma constraint (\"if an element is not clickable, it cannot have a state\n// other than Idle\") only `clickable` carries the hover / active / focus state\n// classes — `static` / `static-empty` stay idle. Geometry (224px width, 64px min\n// height, 8px radius, 16/8px padding, 8px content gap, 1px border) and every state\n// color come from the `--ui-card-filter-*` tokens. Focus: a 3px `--ui-focus-primary`\n// ring flush to the edge (no offset), matching the rest of the library.\nconst cardFilterVariants = cva(\n 'inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors',\n {\n variants: {\n variant: {\n static: '',\n 'static-empty': '',\n clickable:\n 'cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n },\n },\n defaultVariants: {\n variant: 'static',\n },\n }\n);\n\n// The value color is the one token that varies by variant rather than by state.\nconst valueColorClass: Record<\n NonNullable<VariantProps<typeof cardFilterVariants>['variant']>,\n string\n> = {\n static: 'text-[var(--ui-card-filter-static-value-color-idle)]',\n 'static-empty': 'text-[var(--ui-card-filter-static-value-color-disabled)]',\n clickable: 'text-[var(--ui-card-filter-clickable-value-color)]',\n};\n\nexport interface CardFilterProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'children'>,\n VariantProps<typeof cardFilterVariants> {\n /** Caption shown above the value. */\n label?: React.ReactNode;\n /** The large value. Ignored for `variant=\"static-empty\"` (shows an em-dash). */\n value?: React.ReactNode;\n /** Optional leading icon (16px) rendered before the value. Hidden for `static-empty`. */\n icon?: React.ReactNode;\n /**\n * Replace the rendered element (`<button>` for `clickable`, otherwise `<div>`)\n * with another element or component (Base UI composition) — e.g. a router link\n * for a clickable filter. The component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A compact stat/filter card: a label, an optional icon, and a prominent value.\n * Use `variant=\"clickable\"` for a filter the user can activate (renders a button);\n * `static` / `static-empty` are presentational.\n */\nconst CardFilter = React.forwardRef<HTMLElement, CardFilterProps>(\n (\n { className, variant = 'static', label, value, icon, render, ...props },\n ref\n ) => {\n const isEmpty = variant === 'static-empty';\n const isClickable = variant === 'clickable';\n const displayValue = isEmpty ? '–' : value;\n\n return useRender({\n render,\n ref,\n defaultTagName: isClickable ? 'button' : 'div',\n props: mergeProps<'button'>(\n {\n className: cn(cardFilterVariants({ variant }), className),\n ...(isClickable ? { type: 'button' as const } : {}),\n children: (\n <>\n <span className=\"text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]\">\n {label}\n </span>\n <span className=\"flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0\">\n {!isEmpty && icon}\n <span\n className={cn(\n 'text-2xl font-semibold leading-8',\n valueColorClass[variant ?? 'static']\n )}\n >\n {displayValue}\n </span>\n </span>\n </>\n ),\n },\n props\n ),\n });\n }\n);\nCardFilter.displayName = 'CardFilter';\n\nexport { CardFilter, cardFilterVariants };\n"],"names":["cardFilterVariants","cva","valueColorClass","CardFilter","React","className","variant","label","value","icon","render","props","ref","isEmpty","isClickable","displayValue","useRender","mergeProps","cn","jsxs","Fragment","jsx"],"mappings":";;;;;;AAsBA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAGMC,IAGF;AAAA,EACF,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,WAAW;AACb,GAyBMC,IAAaC,EAAM;AAAA,EACvB,CACE,EAAE,WAAAC,GAAW,SAAAC,IAAU,UAAU,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,GAAGC,EAAA,GAChEC,MACG;AACH,UAAMC,IAAUP,MAAY,gBACtBQ,IAAcR,MAAY,aAC1BS,IAAeF,IAAU,MAAML;AAErC,WAAOQ,EAAU;AAAA,MACf,QAAAN;AAAA,MACA,KAAAE;AAAA,MACA,gBAAgBE,IAAc,WAAW;AAAA,MACzC,OAAOG;AAAA,QACL;AAAA,UACE,WAAWC,EAAGlB,EAAmB,EAAE,SAAAM,EAAA,CAAS,GAAGD,CAAS;AAAA,UACxD,GAAIS,IAAc,EAAE,MAAM,SAAA,IAAsB,CAAA;AAAA,UAChD,UACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,iFACb,UAAAd,GACH;AAAA,YACA,gBAAAY,EAAC,QAAA,EAAK,WAAU,oGACb,UAAA;AAAA,cAAA,CAACN,KAAWJ;AAAA,cACb,gBAAAY;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWH;AAAA,oBACT;AAAA,oBACAhB,EAAgBI,KAAW,QAAQ;AAAA,kBAAA;AAAA,kBAGpC,UAAAS;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,QAGJJ;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAR,EAAW,cAAc;"}
1
+ {"version":3,"file":"card-filter.js","sources":["../../../../src/components/ui/card-filter/card-filter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"CardFilter\" component: a compact stat/filter card — a caption\n// `label` above a content row (optional `icon` + a large `value`). `variant` maps\n// to the Figma `variant` property:\n// • `static` — non-interactive; value in `--ui-card-filter-static-value-color-idle`.\n// • `static-empty` — non-interactive placeholder; no icon, an em-dash value in\n// `--ui-card-filter-static-value-color-disabled`.\n// • `clickable` — interactive (renders a <button>); value in\n// `--ui-card-filter-clickable-value-color`, plus hover / active /\n// focus-visible treatments.\n// Per the Figma constraint (\"if an element is not clickable, it cannot have a state\n// other than Idle\") only `clickable` carries the hover / active / focus state\n// classes — `static` / `static-empty` stay idle. Geometry (224px width, 64px min\n// height, 8px radius, 16/8px padding, 8px content gap, 1px border) and every state\n// color come from the `--ui-card-filter-*` tokens. Focus: a 3px `--ui-focus-primary`\n// ring flush to the edge (no offset), matching the rest of the library.\nconst cardFilterVariants = cva(\n 'inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors',\n {\n variants: {\n variant: {\n static: '',\n 'static-empty': '',\n clickable:\n 'cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[color:var(--ui-card-filter-global-border-color-active)] data-[selected=true]:bg-[var(--ui-card-filter-global-container-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'static',\n },\n }\n);\n\n// The value color is the one token that varies by variant rather than by state.\nconst valueColorClass: Record<\n NonNullable<VariantProps<typeof cardFilterVariants>['variant']>,\n string\n> = {\n static: 'text-[var(--ui-card-filter-static-value-color-idle)]',\n 'static-empty': 'text-[var(--ui-card-filter-static-value-color-disabled)]',\n clickable: 'text-[var(--ui-card-filter-clickable-value-color)]',\n};\n\nexport interface CardFilterProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'children'>,\n VariantProps<typeof cardFilterVariants> {\n /** Caption shown above the value. */\n label?: React.ReactNode;\n /** The large value. Ignored for `variant=\"static-empty\"` (shows an em-dash). */\n value?: React.ReactNode;\n /** Optional leading icon (16px) rendered before the value. Hidden for `static-empty`. */\n icon?: React.ReactNode;\n /**\n * `clickable` only — applies the selected (active) styling and exposes the\n * card as a pressed toggle (`aria-pressed`). Controlled only.\n */\n selected?: boolean;\n /**\n * Replace the rendered element (`<button>` for `clickable`, otherwise `<div>`)\n * with another element or component (Base UI composition) — e.g. a router link\n * for a clickable filter. The component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A compact stat/filter card: a label, an optional icon, and a prominent value.\n * Use `variant=\"clickable\"` for a filter the user can activate (renders a button);\n * `static` / `static-empty` are presentational.\n */\nconst CardFilter = React.forwardRef<HTMLElement, CardFilterProps>(\n (\n {\n className,\n variant = 'static',\n label,\n value,\n icon,\n selected,\n render,\n ...props\n },\n ref\n ) => {\n const isEmpty = variant === 'static-empty';\n const isClickable = variant === 'clickable';\n const displayValue = isEmpty ? '–' : value;\n\n return useRender({\n render,\n ref,\n defaultTagName: isClickable ? 'button' : 'div',\n props: mergeProps<'button'>(\n {\n className: cn(cardFilterVariants({ variant }), className),\n ...(isClickable && !render\n ? {\n type: 'button' as const,\n ...(selected !== undefined ? { 'aria-pressed': selected } : {}),\n }\n : {}),\n ...(isClickable ? { 'data-selected': selected ? 'true' : undefined } : {}),\n children: (\n <>\n <span className=\"text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]\">\n {label}\n </span>\n <span className=\"flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0\">\n {!isEmpty && icon}\n <span\n className={cn(\n 'text-2xl font-semibold leading-8',\n valueColorClass[variant ?? 'static']\n )}\n >\n {displayValue}\n </span>\n </span>\n </>\n ),\n },\n props\n ),\n });\n }\n);\nCardFilter.displayName = 'CardFilter';\n\nexport { CardFilter, cardFilterVariants };\n"],"names":["cardFilterVariants","cva","valueColorClass","CardFilter","React","className","variant","label","value","icon","selected","render","props","ref","isEmpty","isClickable","displayValue","useRender","mergeProps","cn","jsxs","Fragment","jsx"],"mappings":";;;;;;AAsBA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAGMC,IAGF;AAAA,EACF,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,WAAW;AACb,GA8BMC,IAAaC,EAAM;AAAA,EACvB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUR,MAAY,gBACtBS,IAAcT,MAAY,aAC1BU,IAAeF,IAAU,MAAMN;AAErC,WAAOS,EAAU;AAAA,MACf,QAAAN;AAAA,MACA,KAAAE;AAAA,MACA,gBAAgBE,IAAc,WAAW;AAAA,MACzC,OAAOG;AAAA,QACL;AAAA,UACE,WAAWC,EAAGnB,EAAmB,EAAE,SAAAM,EAAA,CAAS,GAAGD,CAAS;AAAA,UACxD,GAAIU,KAAe,CAACJ,IAChB;AAAA,YACE,MAAM;AAAA,YACN,GAAID,MAAa,SAAY,EAAE,gBAAgBA,EAAA,IAAa,CAAA;AAAA,UAAC,IAE/D,CAAA;AAAA,UACJ,GAAIK,IAAc,EAAE,iBAAiBL,IAAW,SAAS,OAAA,IAAc,CAAA;AAAA,UACvE,UACE,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,iFACb,UAAAf,GACH;AAAA,YACA,gBAAAa,EAAC,QAAA,EAAK,WAAU,oGACb,UAAA;AAAA,cAAA,CAACN,KAAWL;AAAA,cACb,gBAAAa;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWH;AAAA,oBACT;AAAA,oBACAjB,EAAgBI,KAAW,QAAQ;AAAA,kBAAA;AAAA,kBAGpC,UAAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,QAGJJ;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAT,EAAW,cAAc;"}
@@ -0,0 +1,42 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { InboxIcon as m, CircleWarningIcon as c } from "@acronis-platform/icons-react/stroke-mono";
4
+ import { cn as p } from "../../../lib/utils.js";
5
+ import { Spinner as d } from "../spinner/spinner.js";
6
+ const f = {
7
+ loading: "Data is loading…",
8
+ empty: "No data found",
9
+ error: "Something went wrong"
10
+ }, g = s.forwardRef(
11
+ ({ className: o, state: r, message: i, action: t, ...a }, n) => /* @__PURE__ */ l(
12
+ "div",
13
+ {
14
+ ref: n,
15
+ className: p(
16
+ "flex size-full min-h-32 flex-col items-center justify-center gap-2 text-center text-sm leading-6 text-foreground",
17
+ o
18
+ ),
19
+ ...a,
20
+ role: r === "error" ? "alert" : "status",
21
+ "aria-live": r === "error" ? "assertive" : "polite",
22
+ children: [
23
+ r === "loading" && /* @__PURE__ */ e(d, { size: "lg", "aria-hidden": !0 }),
24
+ r === "empty" && /* @__PURE__ */ e(m, { size: 24, className: "text-[var(--ui-glyph-on-status-info)]" }),
25
+ r === "error" && /* @__PURE__ */ e(
26
+ c,
27
+ {
28
+ size: 24,
29
+ className: "text-[var(--ui-glyph-on-status-warning)]"
30
+ }
31
+ ),
32
+ /* @__PURE__ */ e("p", { children: i ?? f[r] }),
33
+ r === "error" && t
34
+ ]
35
+ }
36
+ )
37
+ );
38
+ g.displayName = "ChartState";
39
+ export {
40
+ g as ChartState
41
+ };
42
+ //# sourceMappingURL=chart-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-state.js","sources":["../../../../src/components/ui/chart-state/chart-state.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CircleWarningIcon,\n InboxIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { Spinner } from '../spinner';\n\n// A shared loading / empty / error placeholder for the chart types. A chart can\n// only render once recharts' `ResponsiveContainer` has data and real dimensions,\n// so every type needs the same \"there's nothing to plot yet\" surface — this is\n// that surface, dropped in place of the chart inside the same sized slot.\n//\n// Ported from the Figma InputSelect dropdown states (the reference the task\n// points at) and kept visually in step with the shipped `InputSelectStatus`\n// sibling: the empty / error states use the same 24px glyph + `text-sm` label\n// and the same `--ui-glyph-on-status-*` icon tokens. (Loading uses the shared\n// `Spinner` — brand blue, larger — not the sibling's inline gray ring.) No\n// `--ui-chart-*` tier exists yet, so it themes from existing semantic tokens\n// directly:\n// • label -> text-foreground (--ui-text-on-surface-primary)\n// • empty icon -> --ui-glyph-on-status-info\n// • error icon -> --ui-glyph-on-status-warning\n// • loading -> the shared Spinner (brand action blue)\n// The generic full-page `Empty` component is the larger, page-level sibling;\n// this one is compact and fills a chart slot.\n\nconst DEFAULT_MESSAGE: Record<ChartStateProps['state'], string> = {\n loading: 'Data is loading…',\n empty: 'No data found',\n error: 'Something went wrong',\n};\n\nexport interface ChartStateProps\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n /** Which placeholder to show. Drives the leading glyph and default label. */\n state: 'loading' | 'empty' | 'error';\n /** Overrides the default label for the current `state`. */\n message?: string;\n /** Trailing action (e.g. a \"Try again\" button) — shown for `error` only. */\n action?: React.ReactNode;\n}\n\nconst ChartState = React.forwardRef<HTMLDivElement, ChartStateProps>(\n ({ className, state, message, action, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex size-full min-h-32 flex-col items-center justify-center gap-2 text-center text-sm leading-6 text-foreground',\n className\n )}\n {...props}\n // The status/alert live-region contract is intrinsic to the state, so it\n // wins over any consumer-passed a11y prop (spread above). No `aria-busy`\n // here: this element IS the live region, and some AT defer announcing a\n // busy region's content until busy clears — but this placeholder is\n // unmounted (swapped for the chart) rather than un-busied, so a busy flag\n // would risk swallowing the \"Data is loading…\" announcement. A consumer\n // that wants a busy signal sets `aria-busy` on the chart-slot container.\n role={state === 'error' ? 'alert' : 'status'}\n aria-live={state === 'error' ? 'assertive' : 'polite'}\n >\n {/* aria-hidden: the root is already the loading live region (+ the label),\n so the Spinner's own role=\"status\"/sr-only would double-announce. */}\n {state === 'loading' && <Spinner size=\"lg\" aria-hidden />}\n {state === 'empty' && (\n <InboxIcon size={24} className=\"text-[var(--ui-glyph-on-status-info)]\" />\n )}\n {state === 'error' && (\n <CircleWarningIcon\n size={24}\n className=\"text-[var(--ui-glyph-on-status-warning)]\"\n />\n )}\n <p>{message ?? DEFAULT_MESSAGE[state]}</p>\n {state === 'error' && action}\n </div>\n )\n);\nChartState.displayName = 'ChartState';\n\nexport { ChartState };\n"],"names":["DEFAULT_MESSAGE","ChartState","React","className","state","message","action","props","ref","jsxs","cn","jsx","Spinner","InboxIcon","CircleWarningIcon"],"mappings":";;;;;AA8BA,MAAMA,IAA4D;AAAA,EAChE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AACT,GAYMC,IAAaC,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,SAAAC,GAAS,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MAChD,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGI;AAAA,MAQJ,MAAMH,MAAU,UAAU,UAAU;AAAA,MACpC,aAAWA,MAAU,UAAU,cAAc;AAAA,MAI5C,UAAA;AAAA,QAAAA,MAAU,aAAa,gBAAAO,EAACC,GAAA,EAAQ,MAAK,MAAK,eAAW,IAAC;AAAA,QACtDR,MAAU,WACT,gBAAAO,EAACE,KAAU,MAAM,IAAI,WAAU,yCAAwC;AAAA,QAExET,MAAU,WACT,gBAAAO;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAGd,gBAAAH,EAAC,KAAA,EAAG,UAAAN,KAAWL,EAAgBI,CAAK,GAAE;AAAA,QACrCA,MAAU,WAAWE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG5B;AACAL,EAAW,cAAc;"}
@@ -4,12 +4,12 @@ import { TimesIcon as h } from "@acronis-platform/icons-react/stroke-mono";
4
4
  import { cva as g } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
5
5
  import { cn as m } from "../../../lib/utils.js";
6
6
  const f = g(
7
- "inline-flex h-[var(--ui-chip-global-box-height)] min-w-[var(--ui-chip-global-box-width-min)] items-center justify-center gap-[var(--ui-chip-global-box-gap)] rounded-[var(--ui-chip-global-border-radius)] border-[length:var(--ui-chip-global-border-width)] border-solid border-[var(--ui-chip-global-border-color-idle)] bg-[var(--ui-chip-global-box-color-idle)] px-[var(--ui-chip-global-box-padding-x)] text-sm leading-6 hover:border-[var(--ui-chip-global-border-color-hover)] hover:bg-[var(--ui-chip-global-box-color-hover)] [&_svg]:size-[var(--ui-chip-global-icon-size)] [&_svg]:shrink-0 [&_svg]:text-[var(--ui-chip-global-icon-color)]",
7
+ "inline-flex h-[var(--ui-chip-global-box-height)] min-w-[var(--ui-chip-global-box-width-min)] cursor-pointer items-center justify-center gap-[var(--ui-chip-global-box-gap)] rounded-[var(--ui-chip-global-border-radius)] border-[length:var(--ui-chip-global-border-width)] border-solid border-[var(--ui-chip-global-border-color-idle)] bg-[var(--ui-chip-global-box-color-idle)] px-[var(--ui-chip-global-box-padding-x)] text-sm leading-6 hover:border-[var(--ui-chip-global-border-color-hover)] hover:bg-[var(--ui-chip-global-box-color-hover)] [&_svg]:size-[var(--ui-chip-global-icon-size)] [&_svg]:shrink-0 [&_svg]:pointer-events-none [&_svg]:text-[var(--ui-chip-global-icon-color)]",
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
11
  removable: "text-[var(--ui-chip-removable-label-color)] focus-within:outline-none focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] active:border-[var(--ui-chip-global-border-color-active)] active:bg-[var(--ui-chip-global-box-color-active)]",
12
- selectable: "cursor-pointer text-[var(--ui-chip-selectable-label-color)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[var(--ui-chip-global-border-color-active)] data-[selected=true]:bg-[var(--ui-chip-global-box-color-active)]"
12
+ selectable: "text-[var(--ui-chip-selectable-label-color)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[var(--ui-chip-global-border-color-active)] data-[selected=true]:bg-[var(--ui-chip-global-box-color-active)]"
13
13
  }
14
14
  },
15
15
  defaultVariants: {
@@ -19,23 +19,23 @@ const f = g(
19
19
  ), x = d.forwardRef(
20
20
  ({
21
21
  className: c,
22
- variant: i = "removable",
22
+ variant: e = "removable",
23
23
  icon: t,
24
24
  selected: a,
25
25
  onRemove: b,
26
26
  removeLabel: s = "Remove",
27
- children: u,
28
- onKeyDown: e,
29
- ...n
27
+ children: n,
28
+ onKeyDown: i,
29
+ ...u
30
30
  }, v) => {
31
- const l = i === "selectable";
31
+ const l = e === "selectable";
32
32
  return /* @__PURE__ */ p(
33
33
  "div",
34
34
  {
35
35
  ref: v,
36
- className: m(f({ variant: i }), c),
36
+ className: m(f({ variant: e }), c),
37
37
  onKeyDown: (r) => {
38
- l && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.currentTarget.click()), e == null || e(r);
38
+ l && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.currentTarget.click()), i == null || i(r);
39
39
  },
40
40
  ...l ? {
41
41
  role: "button",
@@ -43,17 +43,17 @@ const f = g(
43
43
  "aria-pressed": !!a,
44
44
  "data-selected": a ? "true" : void 0
45
45
  } : {},
46
- ...n,
46
+ ...u,
47
47
  children: [
48
48
  t,
49
- /* @__PURE__ */ o("span", { className: "min-w-0 truncate", children: u }),
50
- i === "removable" && /* @__PURE__ */ o(
49
+ /* @__PURE__ */ o("span", { className: "min-w-0 truncate", children: n }),
50
+ e === "removable" && /* @__PURE__ */ o(
51
51
  "button",
52
52
  {
53
53
  type: "button",
54
54
  "aria-label": s,
55
55
  onClick: b,
56
- className: "-me-1 flex shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-none",
56
+ className: "-me-1 flex shrink-0 cursor-pointer items-center justify-center rounded-full outline-none focus-visible:outline-none",
57
57
  children: /* @__PURE__ */ o(h, {})
58
58
  }
59
59
  )
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sources":["../../../../src/components/ui/chip/chip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// A compact, interactive label. `variant` mirrors the Figma \"Chip\" `type`:\n// `removable` carries a trailing × (remove) button; `selectable` toggles a\n// selected state. The container fill/border/label/icon all wire to the dedicated\n// `--ui-chip-*` tier from @acronis-platform/tokens-pd; geometry (height, gap,\n// padding, min-width, radius, border width, icon size) is tokenized too.\n// The Figma `state` enum (idle / hover / active / focused) maps to interaction\n// states, not props: `hover:` → the hover tokens, `:focus`/`focus-visible` → the\n// 3px `--ui-focus-primary` ring, and the `active` look is the pressed state for\n// `removable` (`active:`) and the selected state for `selectable`\n// (`data-[selected]`, driven by the `selected` prop).\nconst chipVariants = cva(\n \"inline-flex h-[var(--ui-chip-global-box-height)] min-w-[var(--ui-chip-global-box-width-min)] items-center justify-center gap-[var(--ui-chip-global-box-gap)] rounded-[var(--ui-chip-global-border-radius)] border-[length:var(--ui-chip-global-border-width)] border-solid border-[var(--ui-chip-global-border-color-idle)] bg-[var(--ui-chip-global-box-color-idle)] px-[var(--ui-chip-global-box-padding-x)] text-sm leading-6 hover:border-[var(--ui-chip-global-border-color-hover)] hover:bg-[var(--ui-chip-global-box-color-hover)] [&_svg]:size-[var(--ui-chip-global-icon-size)] [&_svg]:shrink-0 [&_svg]:text-[var(--ui-chip-global-icon-color)]\",\n {\n variants: {\n variant: {\n removable:\n 'text-[var(--ui-chip-removable-label-color)] focus-within:outline-none focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] active:border-[var(--ui-chip-global-border-color-active)] active:bg-[var(--ui-chip-global-box-color-active)]',\n selectable:\n 'cursor-pointer text-[var(--ui-chip-selectable-label-color)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[var(--ui-chip-global-border-color-active)] data-[selected=true]:bg-[var(--ui-chip-global-box-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'removable',\n },\n }\n);\n\nexport interface ChipProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof chipVariants> {\n /** Optional leading icon, rendered at 16px before the label. */\n icon?: React.ReactNode;\n /**\n * `selectable` only — applies the selected (active) styling and exposes the\n * chip as a pressed toggle (`role=\"button\"` + `aria-pressed`).\n */\n selected?: boolean;\n /** `removable` only — called when the trailing remove (×) button is pressed. */\n onRemove?: () => void;\n /** Accessible label for the remove button (`removable`). */\n removeLabel?: string;\n}\n\nconst Chip = React.forwardRef<HTMLDivElement, ChipProps>(\n (\n {\n className,\n variant = 'removable',\n icon,\n selected,\n onRemove,\n removeLabel = 'Remove',\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const selectable = variant === 'selectable';\n return (\n <div\n ref={ref}\n className={cn(chipVariants({ variant }), className)}\n onKeyDown={(event) => {\n // The selectable chip is a div with button semantics; mirror native\n // button activation so Enter/Space fire its click handler.\n if (selectable && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n event.currentTarget.click();\n }\n onKeyDown?.(event);\n }}\n {...(selectable\n ? {\n role: 'button',\n tabIndex: 0,\n 'aria-pressed': Boolean(selected),\n 'data-selected': selected ? 'true' : undefined,\n }\n : {})}\n {...props}\n >\n {icon}\n <span className=\"min-w-0 truncate\">{children}</span>\n {variant === 'removable' && (\n <button\n type=\"button\"\n aria-label={removeLabel}\n onClick={onRemove}\n className=\"-me-1 flex shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-none\"\n >\n <TimesIcon />\n </button>\n )}\n </div>\n );\n }\n);\nChip.displayName = 'Chip';\n\nexport { Chip, chipVariants };\n"],"names":["chipVariants","cva","Chip","React","className","variant","icon","selected","onRemove","removeLabel","children","onKeyDown","props","ref","selectable","jsxs","cn","event","jsx","TimesIcon"],"mappings":";;;;;AAgBA,MAAMA,IAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,WACE;AAAA,QACF,YACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAmBMC,IAAOC,EAAM;AAAA,EACjB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAaT,MAAY;AAC/B,WACE,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAF;AAAA,QACA,WAAWG,EAAGhB,EAAa,EAAE,SAAAK,EAAA,CAAS,GAAGD,CAAS;AAAA,QAClD,WAAW,CAACa,MAAU;AAGpB,UAAIH,MAAeG,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACxDA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA,IAEtBN,KAAA,QAAAA,EAAYM;AAAA,QACd;AAAA,QACC,GAAIH,IACD;AAAA,UACE,MAAM;AAAA,UACN,UAAU;AAAA,UACV,gBAAgB,EAAQP;AAAA,UACxB,iBAAiBA,IAAW,SAAS;AAAA,QAAA,IAEvC,CAAA;AAAA,QACH,GAAGK;AAAA,QAEH,UAAA;AAAA,UAAAN;AAAA,UACD,gBAAAY,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAR,EAAA,CAAS;AAAA,UAC5CL,MAAY,eACX,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAYT;AAAA,cACZ,SAASD;AAAA,cACT,WAAU;AAAA,cAEV,4BAACW,GAAA,CAAA,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAjB,EAAK,cAAc;"}
1
+ {"version":3,"file":"chip.js","sources":["../../../../src/components/ui/chip/chip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// A compact, interactive label. `variant` mirrors the Figma \"Chip\" `type`:\n// `removable` carries a trailing × (remove) button; `selectable` toggles a\n// selected state. The container fill/border/label/icon all wire to the dedicated\n// `--ui-chip-*` tier from @acronis-platform/tokens-pd; geometry (height, gap,\n// padding, min-width, radius, border width, icon size) is tokenized too.\n// The Figma `state` enum (idle / hover / active / focused) maps to interaction\n// states, not props: `hover:` → the hover tokens, `:focus`/`focus-visible` → the\n// 3px `--ui-focus-primary` ring, and the `active` look is the pressed state for\n// `removable` (`active:`) and the selected state for `selectable`\n// (`data-[selected]`, driven by the `selected` prop).\nconst chipVariants = cva(\n \"inline-flex h-[var(--ui-chip-global-box-height)] min-w-[var(--ui-chip-global-box-width-min)] cursor-pointer items-center justify-center gap-[var(--ui-chip-global-box-gap)] rounded-[var(--ui-chip-global-border-radius)] border-[length:var(--ui-chip-global-border-width)] border-solid border-[var(--ui-chip-global-border-color-idle)] bg-[var(--ui-chip-global-box-color-idle)] px-[var(--ui-chip-global-box-padding-x)] text-sm leading-6 hover:border-[var(--ui-chip-global-border-color-hover)] hover:bg-[var(--ui-chip-global-box-color-hover)] [&_svg]:size-[var(--ui-chip-global-icon-size)] [&_svg]:shrink-0 [&_svg]:pointer-events-none [&_svg]:text-[var(--ui-chip-global-icon-color)]\",\n {\n variants: {\n variant: {\n removable:\n 'text-[var(--ui-chip-removable-label-color)] focus-within:outline-none focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] active:border-[var(--ui-chip-global-border-color-active)] active:bg-[var(--ui-chip-global-box-color-active)]',\n selectable:\n 'text-[var(--ui-chip-selectable-label-color)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[var(--ui-chip-global-border-color-active)] data-[selected=true]:bg-[var(--ui-chip-global-box-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'removable',\n },\n }\n);\n\nexport interface ChipProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof chipVariants> {\n /** Optional leading icon, rendered at 16px before the label. */\n icon?: React.ReactNode;\n /**\n * `selectable` only — applies the selected (active) styling and exposes the\n * chip as a pressed toggle (`role=\"button\"` + `aria-pressed`).\n */\n selected?: boolean;\n /** `removable` only — called when the trailing remove (×) button is pressed. */\n onRemove?: () => void;\n /** Accessible label for the remove button (`removable`). */\n removeLabel?: string;\n}\n\nconst Chip = React.forwardRef<HTMLDivElement, ChipProps>(\n (\n {\n className,\n variant = 'removable',\n icon,\n selected,\n onRemove,\n removeLabel = 'Remove',\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const selectable = variant === 'selectable';\n return (\n <div\n ref={ref}\n className={cn(chipVariants({ variant }), className)}\n onKeyDown={(event) => {\n // The selectable chip is a div with button semantics; mirror native\n // button activation so Enter/Space fire its click handler.\n if (selectable && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n event.currentTarget.click();\n }\n onKeyDown?.(event);\n }}\n {...(selectable\n ? {\n role: 'button',\n tabIndex: 0,\n 'aria-pressed': Boolean(selected),\n 'data-selected': selected ? 'true' : undefined,\n }\n : {})}\n {...props}\n >\n {icon}\n <span className=\"min-w-0 truncate\">{children}</span>\n {variant === 'removable' && (\n <button\n type=\"button\"\n aria-label={removeLabel}\n onClick={onRemove}\n className=\"-me-1 flex shrink-0 cursor-pointer items-center justify-center rounded-full outline-none focus-visible:outline-none\"\n >\n <TimesIcon />\n </button>\n )}\n </div>\n );\n }\n);\nChip.displayName = 'Chip';\n\nexport { Chip, chipVariants };\n"],"names":["chipVariants","cva","Chip","React","className","variant","icon","selected","onRemove","removeLabel","children","onKeyDown","props","ref","selectable","jsxs","cn","event","jsx","TimesIcon"],"mappings":";;;;;AAgBA,MAAMA,IAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,WACE;AAAA,QACF,YACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAmBMC,IAAOC,EAAM;AAAA,EACjB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAaT,MAAY;AAC/B,WACE,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAF;AAAA,QACA,WAAWG,EAAGhB,EAAa,EAAE,SAAAK,EAAA,CAAS,GAAGD,CAAS;AAAA,QAClD,WAAW,CAACa,MAAU;AAGpB,UAAIH,MAAeG,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACxDA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA,IAEtBN,KAAA,QAAAA,EAAYM;AAAA,QACd;AAAA,QACC,GAAIH,IACD;AAAA,UACE,MAAM;AAAA,UACN,UAAU;AAAA,UACV,gBAAgB,EAAQP;AAAA,UACxB,iBAAiBA,IAAW,SAAS;AAAA,QAAA,IAEvC,CAAA;AAAA,QACH,GAAGK;AAAA,QAEH,UAAA;AAAA,UAAAN;AAAA,UACD,gBAAAY,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAR,EAAA,CAAS;AAAA,UAC5CL,MAAY,eACX,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAYT;AAAA,cACZ,SAASD;AAAA,cACT,WAAU;AAAA,cAEV,4BAACW,GAAA,CAAA,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAjB,EAAK,cAAc;"}
@@ -0,0 +1,107 @@
1
+ import { jsx as e, jsxs as x } from "react/jsx-runtime";
2
+ import * as K from "react";
3
+ import { ComposedChart as L, CartesianGrid as T, XAxis as N, YAxis as j, Bar as w, Area as B, Line as $ } from "recharts";
4
+ import { cn as z } from "../../../lib/utils.js";
5
+ import { ChartContainer as G, ChartTooltip as M, ChartTooltipContent as W, ChartLegend as X, ChartLegendContent as Y } from "../chart/chart.js";
6
+ const _ = K.forwardRef(
7
+ ({
8
+ className: l,
9
+ config: s,
10
+ data: d,
11
+ series: f,
12
+ xKey: m,
13
+ xAxisLabel: o,
14
+ yAxisLabel: r,
15
+ yUnit: c,
16
+ curve: n = "monotone",
17
+ barRadius: a = 4,
18
+ fillOpacity: p = 0.3,
19
+ showGrid: y = !0,
20
+ showTooltip: h = !0,
21
+ showLegend: C = !0,
22
+ tooltipContent: k,
23
+ ...v
24
+ }, u) => {
25
+ const A = o ? { value: o, position: "insideBottom", offset: 0 } : void 0, g = r ? {
26
+ value: r,
27
+ angle: -90,
28
+ position: "insideLeft",
29
+ style: { textAnchor: "middle" }
30
+ } : void 0;
31
+ return /* @__PURE__ */ e("div", { ref: u, className: z(l), ...v, children: /* @__PURE__ */ e(
32
+ G,
33
+ {
34
+ config: s,
35
+ className: "size-full [&_.recharts-label]:fill-foreground",
36
+ children: /* @__PURE__ */ x(L, { data: d, children: [
37
+ y && /* @__PURE__ */ e(T, { vertical: !1 }),
38
+ /* @__PURE__ */ e(
39
+ N,
40
+ {
41
+ dataKey: m,
42
+ type: "category",
43
+ tickLine: !1,
44
+ axisLine: !1,
45
+ tickMargin: 8,
46
+ height: o ? 48 : void 0,
47
+ label: A
48
+ }
49
+ ),
50
+ /* @__PURE__ */ e(
51
+ j,
52
+ {
53
+ type: "number",
54
+ tickLine: !1,
55
+ axisLine: !1,
56
+ unit: c,
57
+ width: r ? 72 : void 0,
58
+ label: g
59
+ }
60
+ ),
61
+ h && /* @__PURE__ */ e(M, { content: k ?? /* @__PURE__ */ e(W, {}) }),
62
+ C && /* @__PURE__ */ e(X, { content: /* @__PURE__ */ e(Y, {}) }),
63
+ f.map((t) => {
64
+ const i = `var(--color-${t.key})`;
65
+ return t.type === "bar" ? /* @__PURE__ */ e(
66
+ w,
67
+ {
68
+ dataKey: t.key,
69
+ fill: i,
70
+ radius: a > 0 ? [a, a, 0, 0] : void 0,
71
+ isAnimationActive: !1
72
+ },
73
+ t.key
74
+ ) : t.type === "area" ? /* @__PURE__ */ e(
75
+ B,
76
+ {
77
+ type: n,
78
+ dataKey: t.key,
79
+ stroke: i,
80
+ fill: i,
81
+ fillOpacity: p,
82
+ isAnimationActive: !1
83
+ },
84
+ t.key
85
+ ) : /* @__PURE__ */ e(
86
+ $,
87
+ {
88
+ type: n,
89
+ dataKey: t.key,
90
+ stroke: i,
91
+ strokeWidth: 2,
92
+ dot: !1,
93
+ isAnimationActive: !1
94
+ },
95
+ t.key
96
+ );
97
+ })
98
+ ] })
99
+ }
100
+ ) });
101
+ }
102
+ );
103
+ _.displayName = "ComposedChart";
104
+ export {
105
+ _ as ComposedChart
106
+ };
107
+ //# sourceMappingURL=composed-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composed-chart.js","sources":["../../../../src/components/ui/composed-chart/composed-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Area,\n Bar,\n CartesianGrid,\n ComposedChart as RechartsComposedChart,\n Line,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. A composed\n// chart's defining trait is that each series picks its own render type\n// (bar / line / area) over one shared category axis — so, like ScatterChart,\n// there's no single visual \"mode\" to model as a CVA variant (the skill's\n// \"per-series type\"). The variation lives in the `series[].type` list instead.\nexport type ComposedSeriesType = 'bar' | 'line' | 'area';\n\nexport interface ComposedSeries {\n /** Column key to plot — must match a `config` entry; drives its `--color-<key>` paint. */\n key: string;\n /** How this series renders. */\n type: ComposedSeriesType;\n}\n\nexport interface ComposedChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** Row-per-category data. Each object holds `xKey` + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color`, keyed by `series[].key` (imported from\n * the shared `Chart` primitives). Turned into `--color-<key>` custom\n * properties. Colors are caller-supplied — reference an existing semantic\n * `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot, each `{ key, type }` — one bar/line/area per entry. Each key must exist in `config` and every data row. */\n series: ComposedSeries[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */\n yUnit?: string;\n /** Interpolation for the line and area series. */\n curve?: 'linear' | 'monotone' | 'step';\n /** Corner radius on the growing end of bar series. */\n barRadius?: number;\n /** Flat-fill opacity for area series. */\n fillOpacity?: number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst ComposedChart = React.forwardRef<HTMLDivElement, ComposedChartProps>(\n (\n {\n className,\n config,\n data,\n series,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n curve = 'monotone',\n barRadius = 4,\n fillOpacity = 0.3,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsComposedChart data={data as readonly unknown[]}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {/* Rendered in the caller's `series` order — recharts paints children\n back-to-front, so later entries sit on top. Order them so thin\n marks (a line) come after the areas/bars they should overlay. */}\n {series.map((s) => {\n const color = `var(--color-${s.key})`;\n if (s.type === 'bar') {\n return (\n <Bar\n key={s.key}\n dataKey={s.key}\n fill={color}\n radius={\n barRadius > 0\n ? [barRadius, barRadius, 0, 0]\n : undefined\n }\n isAnimationActive={false}\n />\n );\n }\n if (s.type === 'area') {\n return (\n <Area\n key={s.key}\n type={curve}\n dataKey={s.key}\n stroke={color}\n fill={color}\n fillOpacity={fillOpacity}\n isAnimationActive={false}\n />\n );\n }\n return (\n <Line\n key={s.key}\n type={curve}\n dataKey={s.key}\n stroke={color}\n strokeWidth={2}\n dot={false}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsComposedChart>\n </ChartContainer>\n </div>\n );\n }\n);\nComposedChart.displayName = 'ComposedChart';\n\nexport { ComposedChart };\n"],"names":["ComposedChart","React","className","config","data","series","xKey","xAxisLabel","yAxisLabel","yUnit","curve","barRadius","fillOpacity","showGrid","showTooltip","showLegend","tooltipContent","props","ref","xAxisTitle","yAxisTitle","jsx","cn","ChartContainer","jsxs","RechartsComposedChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","s","color","Bar","Area","Line"],"mappings":";;;;;AA4EA,MAAMA,IAAgBC,EAAM;AAAA,EAC1B,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAaZ,IACf,EAAE,OAAOA,GAAY,UAAU,gBAAyB,QAAQ,EAAA,IAChE,QACEa,IAAaZ,IACf;AAAA,MACE,OAAOA;AAAA,MACP,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,EAAE,YAAY,SAAA;AAAA,IAAkB,IAEzC;AAEJ,WACE,gBAAAa,EAAC,SAAI,KAAAH,GAAU,WAAWI,EAAGpB,CAAS,GAAI,GAAGe,GAC3C,UAAA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,QAAApB;AAAA,QACA,WAAU;AAAA,QAEV,UAAA,gBAAAqB,EAACC,KAAsB,MAAArB,GACpB,UAAA;AAAA,UAAAS,KAAY,gBAAAQ,EAACK,GAAA,EAAc,UAAU,GAAA,CAAO;AAAA,UAC7C,gBAAAL;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,SAASrB;AAAA,cACT,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,QAAQC,IAAa,KAAK;AAAA,cAC1B,OAAOY;AAAA,YAAA;AAAA,UAAA;AAAA,UAET,gBAAAE;AAAA,YAACO;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA,cACV,MAAMnB;AAAA,cACN,OAAOD,IAAa,KAAK;AAAA,cACzB,OAAOY;AAAA,YAAA;AAAA,UAAA;AAAA,UAERN,KACC,gBAAAO,EAACQ,GAAA,EAAa,SAASb,KAAkB,gBAAAK,EAACS,KAAoB,GAAI;AAAA,UAEnEf,KAAc,gBAAAM,EAACU,GAAA,EAAY,SAAS,gBAAAV,EAACW,KAAmB,GAAI;AAAA,UAI5D3B,EAAO,IAAI,CAAC4B,MAAM;AACjB,kBAAMC,IAAQ,eAAeD,EAAE,GAAG;AAClC,mBAAIA,EAAE,SAAS,QAEX,gBAAAZ;AAAA,cAACc;AAAA,cAAA;AAAA,gBAEC,SAASF,EAAE;AAAA,gBACX,MAAMC;AAAA,gBACN,QACEvB,IAAY,IACR,CAACA,GAAWA,GAAW,GAAG,CAAC,IAC3B;AAAA,gBAEN,mBAAmB;AAAA,cAAA;AAAA,cARdsB,EAAE;AAAA,YAAA,IAYTA,EAAE,SAAS,SAEX,gBAAAZ;AAAA,cAACe;AAAA,cAAA;AAAA,gBAEC,MAAM1B;AAAA,gBACN,SAASuB,EAAE;AAAA,gBACX,QAAQC;AAAA,gBACR,MAAMA;AAAA,gBACN,aAAAtB;AAAA,gBACA,mBAAmB;AAAA,cAAA;AAAA,cANdqB,EAAE;AAAA,YAAA,IAWX,gBAAAZ;AAAA,cAACgB;AAAA,cAAA;AAAA,gBAEC,MAAM3B;AAAA,gBACN,SAASuB,EAAE;AAAA,gBACX,QAAQC;AAAA,gBACR,aAAa;AAAA,gBACb,KAAK;AAAA,gBACL,mBAAmB;AAAA,cAAA;AAAA,cANdD,EAAE;AAAA,YAAA;AAAA,UASb,CAAC;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAjC,EAAc,cAAc;"}
@@ -0,0 +1,195 @@
1
+ import { jsx as e, jsxs as M } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { ComposedChart as X, CartesianGrid as Y, XAxis as z, YAxis as G, ReferenceArea as S, ReferenceLine as q, Area as T, Line as F } from "recharts";
4
+ import { cn as H } from "../../../lib/utils.js";
5
+ import { ChartContainer as I, ChartTooltip as b, ChartTooltipContent as J, ChartLegend as P, ChartLegendContent as Q } from "../chart/chart.js";
6
+ const u = "__cone";
7
+ function m(t) {
8
+ return t == null ? void 0 : t.filter((a) => a.dataKey !== u);
9
+ }
10
+ function U(t) {
11
+ return function(n) {
12
+ const r = {
13
+ ...n,
14
+ payload: m(n.payload)
15
+ };
16
+ return typeof t == "function" ? c.createElement(
17
+ t,
18
+ r
19
+ ) : c.cloneElement(t, r);
20
+ };
21
+ }
22
+ const V = c.forwardRef(
23
+ ({
24
+ className: t,
25
+ config: a,
26
+ data: n,
27
+ xKey: r,
28
+ actualKey: i,
29
+ forecastKey: p,
30
+ lowerKey: x,
31
+ upperKey: D,
32
+ xAxisLabel: s,
33
+ yAxisLabel: f,
34
+ yUnit: N,
35
+ strokeWidth: v = 2,
36
+ showForecastRegion: L = !0,
37
+ showGrid: O = !0,
38
+ showTooltip: R = !0,
39
+ showLegend: _ = !0,
40
+ tooltipContent: d,
41
+ ...$
42
+ }, B) => {
43
+ var C, g;
44
+ const y = c.useMemo(
45
+ () => d ? U(d) : void 0,
46
+ [d]
47
+ ), E = s ? { value: s, position: "insideBottom", offset: 0 } : void 0, j = f ? {
48
+ value: f,
49
+ angle: -90,
50
+ position: "insideLeft",
51
+ style: { textAnchor: "middle" }
52
+ } : void 0, w = n.map((o) => {
53
+ const A = o[x], k = o[D];
54
+ return {
55
+ ...o,
56
+ [u]: typeof A == "number" && typeof k == "number" ? [A, k] : void 0
57
+ };
58
+ }), l = L ? (C = n.find((o) => typeof o[p] == "number")) == null ? void 0 : C[r] : void 0, h = (g = n[n.length - 1]) == null ? void 0 : g[r];
59
+ return /* @__PURE__ */ e("div", { ref: B, className: H(t), ...$, children: /* @__PURE__ */ e(
60
+ I,
61
+ {
62
+ config: a,
63
+ className: "size-full [&_.recharts-label]:fill-foreground",
64
+ children: /* @__PURE__ */ M(X, { data: w, children: [
65
+ O && /* @__PURE__ */ e(Y, { vertical: !1 }),
66
+ /* @__PURE__ */ e(
67
+ z,
68
+ {
69
+ dataKey: r,
70
+ type: "category",
71
+ tickLine: !1,
72
+ axisLine: !1,
73
+ tickMargin: 8,
74
+ height: s ? 48 : void 0,
75
+ label: E
76
+ }
77
+ ),
78
+ /* @__PURE__ */ e(
79
+ G,
80
+ {
81
+ type: "number",
82
+ tickLine: !1,
83
+ axisLine: !1,
84
+ unit: N,
85
+ width: f ? 72 : void 0,
86
+ label: j
87
+ }
88
+ ),
89
+ l != null && h != null && /* @__PURE__ */ e(
90
+ S,
91
+ {
92
+ x1: l,
93
+ x2: h,
94
+ fill: "var(--ui-background-surface-secondary)",
95
+ fillOpacity: 0.5,
96
+ ifOverflow: "extendDomain"
97
+ }
98
+ ),
99
+ l != null && /* @__PURE__ */ e(
100
+ q,
101
+ {
102
+ x: l,
103
+ stroke: "var(--ui-border-on-surface-border)",
104
+ strokeDasharray: "4 4"
105
+ }
106
+ ),
107
+ R && (y ? (
108
+ // Strips the synthetic band before the caller's tooltip sees it
109
+ // — the `__cone` series feeds the Area, not the tooltip.
110
+ /* @__PURE__ */ e(b, { content: y })
111
+ ) : /* @__PURE__ */ e(
112
+ b,
113
+ {
114
+ content: (o) => /* @__PURE__ */ e(
115
+ J,
116
+ {
117
+ active: o.active,
118
+ label: o.label,
119
+ payload: m(
120
+ o.payload
121
+ )
122
+ }
123
+ )
124
+ }
125
+ )),
126
+ _ && /* @__PURE__ */ e(
127
+ P,
128
+ {
129
+ content: (o) => /* @__PURE__ */ e(
130
+ Q,
131
+ {
132
+ verticalAlign: o.verticalAlign,
133
+ payload: m(
134
+ o.payload
135
+ )
136
+ }
137
+ )
138
+ }
139
+ ),
140
+ /* @__PURE__ */ e(
141
+ T,
142
+ {
143
+ dataKey: u,
144
+ type: "monotone",
145
+ stroke: "none",
146
+ fill: `var(--color-${i})`,
147
+ fillOpacity: 0.15,
148
+ connectNulls: !1,
149
+ dot: !1,
150
+ activeDot: !1,
151
+ isAnimationActive: !1,
152
+ legendType: "none",
153
+ tooltipType: "none"
154
+ }
155
+ ),
156
+ /* @__PURE__ */ e(
157
+ T,
158
+ {
159
+ dataKey: i,
160
+ type: "monotone",
161
+ stroke: `var(--color-${i})`,
162
+ strokeWidth: v,
163
+ fill: `var(--color-${i})`,
164
+ fillOpacity: 0.15,
165
+ dot: !1,
166
+ activeDot: !1,
167
+ connectNulls: !0,
168
+ isAnimationActive: !1
169
+ }
170
+ ),
171
+ /* @__PURE__ */ e(
172
+ F,
173
+ {
174
+ dataKey: p,
175
+ type: "monotone",
176
+ stroke: `var(--color-${i})`,
177
+ strokeWidth: v,
178
+ strokeDasharray: "5 5",
179
+ dot: !1,
180
+ connectNulls: !0,
181
+ isAnimationActive: !1
182
+ }
183
+ )
184
+ ] })
185
+ }
186
+ ) });
187
+ }
188
+ );
189
+ V.displayName = "ConfidenceCone";
190
+ export {
191
+ V as ConfidenceCone,
192
+ U as createConeTooltip,
193
+ m as dropConeBand
194
+ };
195
+ //# sourceMappingURL=confidence-cone.js.map