@brightlocal/ui-components 2.27.0 → 3.1.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 (289) hide show
  1. package/README.md +7 -1
  2. package/component-meta.json +568 -143
  3. package/deprecations.json +298 -1
  4. package/dist/accordion.cjs +1 -1
  5. package/dist/accordion.d.ts +36 -0
  6. package/dist/accordion.d.ts.map +1 -1
  7. package/dist/accordion.js +74 -61
  8. package/dist/alert-dialog.cjs +1 -1
  9. package/dist/alert-dialog.js +18 -18
  10. package/dist/alert.cjs +1 -1
  11. package/dist/alert.d.ts +11 -1
  12. package/dist/alert.d.ts.map +1 -1
  13. package/dist/alert.js +31 -28
  14. package/dist/avatar.cjs +1 -1
  15. package/dist/avatar.js +4 -4
  16. package/dist/badge.cjs +1 -1
  17. package/dist/badge.d.ts.map +1 -1
  18. package/dist/badge.js +15 -11
  19. package/dist/blocks/empty-state.cjs +1 -0
  20. package/dist/blocks/empty-state.d.ts +172 -0
  21. package/dist/blocks/empty-state.d.ts.map +1 -0
  22. package/dist/blocks/empty-state.js +147 -0
  23. package/dist/blocks/input-list.cjs +2 -2
  24. package/dist/blocks/input-list.d.ts.map +1 -1
  25. package/dist/blocks/input-list.js +124 -108
  26. package/dist/blocks/progress-state.cjs +1 -0
  27. package/dist/blocks/{progress-screen.d.ts → progress-state.d.ts} +30 -18
  28. package/dist/blocks/progress-state.d.ts.map +1 -0
  29. package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
  30. package/dist/blocks/sidebar.cjs +1 -1
  31. package/dist/blocks/sidebar.d.ts.map +1 -1
  32. package/dist/blocks/sidebar.js +160 -161
  33. package/dist/breadcrumb.cjs +1 -1
  34. package/dist/breadcrumb.js +1 -1
  35. package/dist/button-group.cjs +1 -0
  36. package/dist/button-group.d.ts +36 -0
  37. package/dist/button-group.d.ts.map +1 -0
  38. package/dist/button-group.js +47 -0
  39. package/dist/button.cjs +1 -1
  40. package/dist/button.js +12 -12
  41. package/dist/calendar.cjs +1 -1
  42. package/dist/calendar.d.ts.map +1 -1
  43. package/dist/calendar.js +37 -38
  44. package/dist/callout.cjs +1 -1
  45. package/dist/callout.d.ts +24 -2
  46. package/dist/callout.d.ts.map +1 -1
  47. package/dist/callout.js +57 -55
  48. package/dist/card.cjs +1 -1
  49. package/dist/card.d.ts +42 -3
  50. package/dist/card.d.ts.map +1 -1
  51. package/dist/card.js +102 -91
  52. package/dist/chart-empty.cjs +1 -0
  53. package/dist/chart-empty.d.ts +59 -0
  54. package/dist/chart-empty.d.ts.map +1 -0
  55. package/dist/chart-empty.js +29 -0
  56. package/dist/chart.cjs +6 -6
  57. package/dist/chart.d.ts +46 -13
  58. package/dist/chart.d.ts.map +1 -1
  59. package/dist/chart.js +172 -157
  60. package/dist/chip.cjs +1 -1
  61. package/dist/chip.d.ts +38 -4
  62. package/dist/chip.d.ts.map +1 -1
  63. package/dist/chip.js +100 -84
  64. package/dist/combobox.cjs +2 -2
  65. package/dist/combobox.d.ts.map +1 -1
  66. package/dist/combobox.js +81 -79
  67. package/dist/command.cjs +1 -1
  68. package/dist/command.d.ts +23 -1
  69. package/dist/command.d.ts.map +1 -1
  70. package/dist/command.js +248 -225
  71. package/dist/context-menu.cjs +1 -1
  72. package/dist/context-menu.d.ts.map +1 -1
  73. package/dist/context-menu.js +26 -29
  74. package/dist/data-table.cjs +1 -1
  75. package/dist/data-table.d.ts +75 -10
  76. package/dist/data-table.d.ts.map +1 -1
  77. package/dist/data-table.js +346 -334
  78. package/dist/date-picker.cjs +1 -1
  79. package/dist/date-picker.d.ts +13 -5
  80. package/dist/date-picker.d.ts.map +1 -1
  81. package/dist/date-picker.js +54 -53
  82. package/dist/description.cjs +1 -1
  83. package/dist/description.js +5 -5
  84. package/dist/dialog.cjs +1 -1
  85. package/dist/dialog.js +20 -20
  86. package/dist/drawer.cjs +1 -1
  87. package/dist/drawer.d.ts.map +1 -1
  88. package/dist/drawer.js +8 -11
  89. package/dist/dropdown-menu.cjs +1 -1
  90. package/dist/dropdown-menu.d.ts.map +1 -1
  91. package/dist/dropdown-menu.js +17 -20
  92. package/dist/field.cjs +1 -1
  93. package/dist/field.d.ts +8 -1
  94. package/dist/field.d.ts.map +1 -1
  95. package/dist/field.js +96 -65
  96. package/dist/global-layout.cjs +1 -1
  97. package/dist/global-layout.d.ts +130 -12
  98. package/dist/global-layout.d.ts.map +1 -1
  99. package/dist/global-layout.js +146 -127
  100. package/dist/grid.cjs +1 -0
  101. package/dist/grid.d.ts +56 -0
  102. package/dist/grid.d.ts.map +1 -0
  103. package/dist/grid.js +32 -0
  104. package/dist/header.d.ts +13 -0
  105. package/dist/header.d.ts.map +1 -1
  106. package/dist/hooks/use-delayed-pending.cjs +1 -0
  107. package/dist/hooks/use-delayed-pending.d.ts +34 -0
  108. package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
  109. package/dist/hooks/use-delayed-pending.js +17 -0
  110. package/dist/hooks/use-mobile.cjs +1 -0
  111. package/dist/hooks/use-mobile.js +8 -0
  112. package/dist/hover-card.cjs +1 -1
  113. package/dist/hover-card.js +13 -13
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.d.ts +9 -1
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +554 -527
  118. package/dist/input-chip.cjs +1 -1
  119. package/dist/input-chip.js +25 -25
  120. package/dist/input-group.cjs +1 -1
  121. package/dist/input-group.js +9 -9
  122. package/dist/input-otp.cjs +1 -1
  123. package/dist/input-otp.js +9 -9
  124. package/dist/input-password.cjs +1 -1
  125. package/dist/input-password.d.ts +17 -9
  126. package/dist/input-password.d.ts.map +1 -1
  127. package/dist/input-password.js +73 -72
  128. package/dist/input.cjs +1 -1
  129. package/dist/input.js +9 -9
  130. package/dist/label.cjs +1 -1
  131. package/dist/label.d.ts.map +1 -1
  132. package/dist/label.js +25 -28
  133. package/dist/lib/block-illustration.cjs +1 -0
  134. package/dist/lib/block-illustration.d.ts +28 -0
  135. package/dist/lib/block-illustration.d.ts.map +1 -0
  136. package/dist/lib/block-illustration.js +21 -0
  137. package/dist/lib/empty-canvas.cjs +1 -0
  138. package/dist/lib/empty-canvas.d.ts +27 -0
  139. package/dist/lib/empty-canvas.d.ts.map +1 -0
  140. package/dist/lib/empty-canvas.js +62 -0
  141. package/dist/lib/empty-chip.cjs +1 -0
  142. package/dist/lib/empty-chip.d.ts +4 -0
  143. package/dist/lib/empty-chip.d.ts.map +1 -0
  144. package/dist/lib/empty-chip.js +13 -0
  145. package/dist/lib/optical-center.cjs +1 -0
  146. package/dist/lib/optical-center.d.ts +12 -0
  147. package/dist/lib/optical-center.d.ts.map +1 -0
  148. package/dist/lib/optical-center.js +11 -0
  149. package/dist/lib/utils.cjs +1 -1
  150. package/dist/lib/utils.d.ts.map +1 -1
  151. package/dist/lib/utils.js +28 -5
  152. package/dist/list.cjs +1 -1
  153. package/dist/list.d.ts.map +1 -1
  154. package/dist/list.js +62 -58
  155. package/dist/map.cjs +1 -1
  156. package/dist/map.d.ts +60 -2
  157. package/dist/map.d.ts.map +1 -1
  158. package/dist/map.js +187 -164
  159. package/dist/media-empty.cjs +1 -0
  160. package/dist/media-empty.d.ts +72 -0
  161. package/dist/media-empty.d.ts.map +1 -0
  162. package/dist/media-empty.js +45 -0
  163. package/dist/menubar.cjs +1 -1
  164. package/dist/menubar.d.ts.map +1 -1
  165. package/dist/menubar.js +17 -20
  166. package/dist/navigation-menu.cjs +1 -1
  167. package/dist/navigation-menu.js +7 -7
  168. package/dist/pagination.cjs +1 -1
  169. package/dist/pagination.d.ts +130 -1
  170. package/dist/pagination.d.ts.map +1 -1
  171. package/dist/pagination.js +193 -102
  172. package/dist/progress.cjs +1 -1
  173. package/dist/progress.d.ts +2 -26
  174. package/dist/progress.d.ts.map +1 -1
  175. package/dist/progress.js +79 -118
  176. package/dist/scroll-area.cjs +1 -1
  177. package/dist/scroll-area.d.ts +15 -6
  178. package/dist/scroll-area.d.ts.map +1 -1
  179. package/dist/scroll-area.js +38 -36
  180. package/dist/select.cjs +2 -2
  181. package/dist/select.d.ts +13 -2
  182. package/dist/select.d.ts.map +1 -1
  183. package/dist/select.js +92 -87
  184. package/dist/separator.cjs +1 -1
  185. package/dist/separator.js +8 -8
  186. package/dist/sheet.cjs +1 -1
  187. package/dist/sheet.js +2 -2
  188. package/dist/skeleton.cjs +1 -1
  189. package/dist/skeleton.d.ts +38 -3
  190. package/dist/skeleton.d.ts.map +1 -1
  191. package/dist/skeleton.js +43 -20
  192. package/dist/sonner.cjs +1 -1
  193. package/dist/sonner.js +26 -26
  194. package/dist/stepper.cjs +1 -1
  195. package/dist/stepper.js +40 -40
  196. package/dist/table.cjs +1 -1
  197. package/dist/table.d.ts.map +1 -1
  198. package/dist/table.js +31 -28
  199. package/dist/tabs.cjs +1 -1
  200. package/dist/tabs.js +1 -1
  201. package/dist/text-reveal-motion.d.ts +10 -0
  202. package/dist/text-reveal-motion.d.ts.map +1 -1
  203. package/dist/textarea.cjs +1 -1
  204. package/dist/textarea.js +11 -11
  205. package/dist/toggle.cjs +1 -1
  206. package/dist/toggle.js +8 -8
  207. package/dist/tooltip.cjs +1 -1
  208. package/dist/tooltip.js +8 -8
  209. package/dist/typography-heading.cjs +1 -0
  210. package/dist/typography-heading.d.ts +129 -0
  211. package/dist/typography-heading.d.ts.map +1 -0
  212. package/dist/typography-heading.js +95 -0
  213. package/dist/typography-text.cjs +1 -0
  214. package/dist/typography-text.d.ts +127 -0
  215. package/dist/typography-text.d.ts.map +1 -0
  216. package/dist/typography-text.js +92 -0
  217. package/dist/typography.d.ts +13 -0
  218. package/dist/typography.d.ts.map +1 -1
  219. package/package.json +35 -7
  220. package/src/blocks/empty-state.tsx +412 -0
  221. package/src/blocks/input-list.tsx +66 -36
  222. package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
  223. package/src/blocks/sidebar.tsx +25 -26
  224. package/src/components/accordion.tsx +82 -27
  225. package/src/components/alert-dialog.tsx +2 -2
  226. package/src/components/alert.tsx +27 -13
  227. package/src/components/avatar.tsx +1 -1
  228. package/src/components/badge.tsx +8 -4
  229. package/src/components/breadcrumb.tsx +1 -1
  230. package/src/components/button-group.tsx +112 -0
  231. package/src/components/button.tsx +4 -4
  232. package/src/components/calendar.tsx +5 -6
  233. package/src/components/callout.tsx +48 -15
  234. package/src/components/card.tsx +89 -19
  235. package/src/components/chart-empty.tsx +116 -0
  236. package/src/components/chart.tsx +103 -32
  237. package/src/components/chip.tsx +88 -13
  238. package/src/components/combobox.tsx +12 -10
  239. package/src/components/command.tsx +64 -13
  240. package/src/components/context-menu.tsx +6 -9
  241. package/src/components/data-table.tsx +135 -20
  242. package/src/components/date-picker.tsx +18 -7
  243. package/src/components/description.tsx +1 -1
  244. package/src/components/dialog.tsx +2 -2
  245. package/src/components/drawer.tsx +2 -5
  246. package/src/components/dropdown-menu.tsx +8 -11
  247. package/src/components/field.tsx +89 -16
  248. package/src/components/global-layout.tsx +210 -39
  249. package/src/components/grid.tsx +130 -0
  250. package/src/components/header.tsx +13 -0
  251. package/src/components/hover-card.tsx +1 -1
  252. package/src/components/input-chip.tsx +1 -1
  253. package/src/components/input-group.tsx +1 -1
  254. package/src/components/input-otp.tsx +1 -1
  255. package/src/components/input-password.tsx +24 -12
  256. package/src/components/input.tsx +1 -1
  257. package/src/components/label.tsx +10 -13
  258. package/src/components/list.tsx +13 -9
  259. package/src/components/map.tsx +101 -5
  260. package/src/components/media-empty.tsx +156 -0
  261. package/src/components/menubar.tsx +7 -10
  262. package/src/components/navigation-menu.tsx +1 -1
  263. package/src/components/pagination.tsx +286 -1
  264. package/src/components/progress.tsx +35 -113
  265. package/src/components/scroll-area.tsx +23 -10
  266. package/src/components/select.tsx +35 -10
  267. package/src/components/separator.tsx +1 -1
  268. package/src/components/sheet.tsx +2 -2
  269. package/src/components/skeleton.tsx +78 -7
  270. package/src/components/sonner.tsx +2 -2
  271. package/src/components/stepper.tsx +3 -3
  272. package/src/components/table.tsx +6 -3
  273. package/src/components/tabs.tsx +1 -1
  274. package/src/components/text-reveal-motion.tsx +10 -0
  275. package/src/components/textarea.tsx +1 -1
  276. package/src/components/toggle.tsx +1 -1
  277. package/src/components/tooltip.tsx +1 -1
  278. package/src/components/typography-heading.tsx +253 -0
  279. package/src/components/typography-text.tsx +250 -0
  280. package/src/components/typography.tsx +13 -0
  281. package/src/hooks/use-delayed-pending.ts +60 -0
  282. package/src/index.ts +11 -1
  283. package/src/lib/block-illustration.tsx +88 -0
  284. package/src/lib/empty-canvas.tsx +128 -0
  285. package/src/lib/empty-chip.ts +24 -0
  286. package/src/lib/optical-center.tsx +45 -0
  287. package/src/lib/utils.ts +26 -0
  288. package/dist/blocks/progress-screen.cjs +0 -1
  289. package/dist/blocks/progress-screen.d.ts.map +0 -1
package/dist/chart.js CHANGED
@@ -1,22 +1,22 @@
1
- import { jsxs as x, jsx as s, Fragment as w } from "react/jsx-runtime";
1
+ import { jsxs as b, jsx as s, Fragment as S } from "react/jsx-runtime";
2
2
  import * as k from "react";
3
3
  import * as N from "recharts";
4
- import { Area as J, AreaChart as Q, Bar as U, BarChart as Z, CartesianGrid as F, Cell as K, Label as ee, Legend as re, Tooltip as te, Customized as ne, LabelList as ae, Line as le, LineChart as oe, Pie as se, PieChart as ie, PolarAngleAxis as ce, PolarGrid as de, PolarRadiusAxis as ue, Radar as he, RadarChart as fe, RadialBar as pe, RadialBarChart as me, Rectangle as ge, ReferenceLine as Ce, ResponsiveContainer as xe, Sector as ve, XAxis as be, YAxis as ke } from "recharts";
4
+ import { Area as J, AreaChart as Q, Bar as U, BarChart as Z, CartesianGrid as K, Cell as ee, Label as te, Legend as re, Tooltip as ne, Customized as ae, LabelList as le, Line as oe, LineChart as se, Pie as ie, PieChart as ce, PolarAngleAxis as de, PolarGrid as ue, PolarRadiusAxis as he, Radar as fe, RadarChart as pe, RadialBar as me, RadialBarChart as ge, Rectangle as Ce, ReferenceLine as be, ResponsiveContainer as xe, Sector as ve, XAxis as ke, YAxis as Ne } from "recharts";
5
5
  import { cn as p } from "@brightlocal/ui-components/lib/utils";
6
- const $ = k.createContext(null);
6
+ const R = k.createContext(null);
7
7
  function P() {
8
- const n = k.useContext($);
9
- if (!n)
8
+ const t = k.useContext(R);
9
+ if (!t)
10
10
  throw new Error("useChart must be used within a <ChartContainer />");
11
- return n;
11
+ return t;
12
12
  }
13
- const S = k.forwardRef(
13
+ const j = k.forwardRef(
14
14
  ({
15
- id: n,
15
+ id: t,
16
16
  className: r,
17
17
  children: l,
18
18
  config: e,
19
- dataHook: t,
19
+ dataHook: n,
20
20
  width: a,
21
21
  height: o,
22
22
  minWidth: d,
@@ -26,23 +26,23 @@ const S = k.forwardRef(
26
26
  trackingLabel: g,
27
27
  ...m
28
28
  }, C) => {
29
- const v = k.useId(), f = `chart-${n || v.replace(/:/g, "")}`;
30
- return /* @__PURE__ */ s($.Provider, { value: { config: e }, children: /* @__PURE__ */ x(
29
+ const x = k.useId(), f = `chart-${t || x.replace(/:/g, "")}`;
30
+ return /* @__PURE__ */ s(R.Provider, { value: { config: e }, children: /* @__PURE__ */ b(
31
31
  "div",
32
32
  {
33
33
  ref: C,
34
34
  className: p(
35
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none",
35
+ "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background text-body-xs flex aspect-video justify-center [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none",
36
36
  r
37
37
  ),
38
38
  "data-chart": f,
39
- "data-hook": t,
39
+ "data-hook": n,
40
40
  "data-slot": "chart-container",
41
41
  "data-tracking-el": h,
42
42
  "data-tracking-label": g,
43
43
  ...m,
44
44
  children: [
45
- /* @__PURE__ */ s(j, { config: e, id: f }),
45
+ /* @__PURE__ */ s(T, { config: e, id: f }),
46
46
  /* @__PURE__ */ s(
47
47
  N.ResponsiveContainer,
48
48
  {
@@ -60,8 +60,8 @@ const S = k.forwardRef(
60
60
  ) });
61
61
  }
62
62
  );
63
- S.displayName = "ChartContainer";
64
- function j({ id: n, config: r }) {
63
+ j.displayName = "ChartContainer";
64
+ function T({ id: t, config: r }) {
65
65
  const l = Object.entries(r).filter(
66
66
  ([, e]) => e.theme || e.color
67
67
  );
@@ -69,15 +69,15 @@ function j({ id: n, config: r }) {
69
69
  "style",
70
70
  {
71
71
  dangerouslySetInnerHTML: {
72
- __html: l.map(([e, t]) => {
73
- const a = typeof t.color == "string" ? t.color.replace(/^hsl\((.*)\)$/, "$1") : null;
72
+ __html: l.map(([e, n]) => {
73
+ const a = typeof n.color == "string" ? n.color.replace(/^hsl\((.*)\)$/, "$1") : null;
74
74
  return a ? `
75
- [data-chart=${n}] {
75
+ [data-chart=${t}] {
76
76
  --color-${e}: ${a};
77
77
  }
78
- ` : t.theme ? Object.entries(t.theme).map(
78
+ ` : n.theme ? Object.entries(n.theme).map(
79
79
  ([o, d]) => `
80
- .${o} [data-chart=${n}] {
80
+ .${o} [data-chart=${t}] {
81
81
  --color-${e}: ${d.replace(/^hsl\((.*)\)$/, "$1")};
82
82
  }
83
83
  `
@@ -88,16 +88,19 @@ function j({ id: n, config: r }) {
88
88
  }
89
89
  ) : null;
90
90
  }
91
- function T({ ...n }) {
92
- return /* @__PURE__ */ s(N.Tooltip, { ...n });
91
+ function $(t) {
92
+ return t == null || t === "" ? !1 : typeof t == "number" ? Number.isFinite(t) : !0;
93
93
  }
94
- T.displayName = "ChartTooltip";
95
- function A({
96
- active: n,
94
+ function A({ ...t }) {
95
+ return /* @__PURE__ */ s(N.Tooltip, { ...t });
96
+ }
97
+ A.displayName = "ChartTooltip";
98
+ function W({
99
+ active: t,
97
100
  payload: r,
98
101
  className: l,
99
102
  indicator: e = "dot",
100
- hideLabel: t = !1,
103
+ hideLabel: n = !1,
101
104
  hideIndicator: a = !1,
102
105
  label: o,
103
106
  labelFormatter: d,
@@ -107,38 +110,38 @@ function A({
107
110
  nameKey: g,
108
111
  labelKey: m
109
112
  }) {
110
- const { config: C } = P(), v = k.useMemo(() => {
111
- if (t || !r?.length)
113
+ const { config: C } = P(), x = k.useMemo(() => {
114
+ if (n || !r?.length)
112
115
  return null;
113
116
  const [c] = r;
114
117
  if (!c)
115
118
  return null;
116
- const y = `${m || c.dataKey || c.name || "value"}`, L = C[y], b = !m && typeof o == "string" ? C[o]?.label || o : L?.label;
117
- return d ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: d(b, r) }) : b ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: b }) : null;
119
+ const L = `${m || c.dataKey || c.name || "value"}`, y = C[L], v = !m && typeof o == "string" ? C[o]?.label || o : y?.label;
120
+ return d ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: d(v, r) }) : v ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: v }) : null;
118
121
  }, [
119
122
  o,
120
123
  d,
121
124
  r,
122
- t,
125
+ n,
123
126
  i,
124
127
  C,
125
128
  m
126
129
  ]);
127
- if (!n || !r?.length)
130
+ if (!t || !r?.length)
128
131
  return null;
129
132
  const f = r.length === 1 && e !== "dot";
130
- return /* @__PURE__ */ x(
133
+ return /* @__PURE__ */ b(
131
134
  "div",
132
135
  {
133
136
  className: p(
134
- "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
137
+ "border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl",
135
138
  l
136
139
  ),
137
140
  "data-slot": "chart-tooltip-content",
138
141
  children: [
139
- f ? null : v,
140
- /* @__PURE__ */ s("div", { className: "grid gap-1.5", children: r.map((c, y) => {
141
- const L = `${g || c.name || c.dataKey || "value"}`, b = C[L], _ = h || c.color || c.payload.fill || `var(--color-${L})`;
142
+ f ? null : x,
143
+ /* @__PURE__ */ s("div", { className: "grid gap-1.5", children: r.map((c, L) => {
144
+ const y = `${g || c.name || c.dataKey || "value"}`, v = C[y], _ = h || c.color || c.payload.fill || `var(--color-${y})`;
142
145
  return /* @__PURE__ */ s(
143
146
  "div",
144
147
  {
@@ -146,8 +149,9 @@ function A({
146
149
  "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2",
147
150
  e === "dot" && "items-center"
148
151
  ),
149
- children: u && c?.value !== void 0 && c.name ? u(c.value, c.name, c, y, r) : /* @__PURE__ */ x(w, { children: [
150
- b?.icon && !a ? /* @__PURE__ */ s(b.icon, { size: 10 }) : !a && /* @__PURE__ */ s(
152
+ "data-slot": "chart-tooltip-item",
153
+ children: u && $(c.value) && c.name ? u(c.value, c.name, c, L, r) : /* @__PURE__ */ b(S, { children: [
154
+ v?.icon && !a ? /* @__PURE__ */ s(v.icon, { size: 10 }) : !a && /* @__PURE__ */ s(
151
155
  "div",
152
156
  {
153
157
  className: p("shrink-0 rounded-[2px]", {
@@ -162,19 +166,33 @@ function A({
162
166
  }
163
167
  }
164
168
  ),
165
- /* @__PURE__ */ x(
169
+ /* @__PURE__ */ b(
166
170
  "div",
167
171
  {
168
172
  className: p(
169
- "flex flex-1 justify-between leading-none",
173
+ "flex flex-1 justify-between gap-2 leading-none",
170
174
  f ? "items-end" : "items-center"
171
175
  ),
172
176
  children: [
173
- /* @__PURE__ */ x("div", { className: "grid gap-1.5", children: [
174
- f ? v : null,
175
- /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: b?.label || c.name })
177
+ /* @__PURE__ */ b("div", { className: "grid gap-1.5", children: [
178
+ f ? x : null,
179
+ /* @__PURE__ */ s(
180
+ "span",
181
+ {
182
+ className: "text-muted-foreground",
183
+ "data-slot": "chart-tooltip-item-name",
184
+ children: v?.label || c.name
185
+ }
186
+ )
176
187
  ] }),
177
- c.value && /* @__PURE__ */ s("span", { className: "text-foreground font-mono font-medium tabular-nums", children: typeof c.value == "number" ? c.value.toLocaleString() : c.value })
188
+ $(c.value) && /* @__PURE__ */ s(
189
+ "span",
190
+ {
191
+ className: "text-foreground tabular-nums",
192
+ "data-slot": "chart-tooltip-item-value",
193
+ children: typeof c.value == "number" ? c.value.toLocaleString() : c.value
194
+ }
195
+ )
178
196
  ]
179
197
  }
180
198
  )
@@ -187,17 +205,17 @@ function A({
187
205
  }
188
206
  );
189
207
  }
190
- A.displayName = "ChartTooltipContent";
191
- function W({ ...n }) {
192
- return /* @__PURE__ */ s(N.Legend, { ...n });
208
+ W.displayName = "ChartTooltipContent";
209
+ function D({ ...t }) {
210
+ return /* @__PURE__ */ s(N.Legend, { ...t });
193
211
  }
194
- W.displayName = "ChartLegend";
195
- function D({
196
- className: n,
212
+ D.displayName = "ChartLegend";
213
+ function G({
214
+ className: t,
197
215
  hideIcon: r = !1,
198
216
  payload: l,
199
217
  verticalAlign: e = "bottom",
200
- nameKey: t
218
+ nameKey: n
201
219
  }) {
202
220
  const { config: a } = P();
203
221
  return l?.length ? /* @__PURE__ */ s(
@@ -206,12 +224,12 @@ function D({
206
224
  className: p(
207
225
  "flex items-center justify-center gap-4",
208
226
  e === "top" ? "pb-4" : "pt-4",
209
- n
227
+ t
210
228
  ),
211
229
  "data-slot": "chart-legend-content",
212
230
  children: l.map((o) => {
213
- const d = `${t || o.dataKey || "value"}`, i = a[d];
214
- return /* @__PURE__ */ x(
231
+ const d = `${n || o.dataKey || "value"}`, i = a[d];
232
+ return /* @__PURE__ */ b(
215
233
  "div",
216
234
  {
217
235
  className: p(
@@ -236,30 +254,30 @@ function D({
236
254
  }
237
255
  ) : null;
238
256
  }
239
- D.displayName = "ChartLegendContent";
240
- function R({
241
- colorKey: n,
257
+ G.displayName = "ChartLegendContent";
258
+ function w({
259
+ colorKey: t,
242
260
  color: r,
243
261
  fill: l,
244
262
  stroke: e,
245
- payload: t
263
+ payload: n
246
264
  }) {
247
- return (n && typeof t?.[n] == "string" ? t[n] : void 0) ?? r ?? l ?? e ?? "currentColor";
265
+ return (t && typeof n?.[t] == "string" ? n[t] : void 0) ?? r ?? l ?? e ?? "currentColor";
248
266
  }
249
- function G({
250
- size: n = 8,
267
+ function M({
268
+ size: t = 8,
251
269
  custom: r = !1,
252
270
  color: l,
253
271
  colorKey: e,
254
- cx: t,
272
+ cx: n,
255
273
  cy: a,
256
274
  stroke: o,
257
275
  fill: d,
258
276
  payload: i
259
277
  }) {
260
- if (t == null || a == null)
278
+ if (n == null || a == null)
261
279
  return null;
262
- const u = R({
280
+ const u = w({
263
281
  colorKey: e,
264
282
  color: l,
265
283
  fill: d,
@@ -270,30 +288,30 @@ function G({
270
288
  "circle",
271
289
  {
272
290
  className: r ? "fill-background" : void 0,
273
- cx: t,
291
+ cx: n,
274
292
  cy: a,
275
293
  "data-slot": "chart-dot",
276
294
  fill: r ? void 0 : u,
277
- r: n / 2,
295
+ r: t / 2,
278
296
  stroke: r ? u : "none",
279
297
  strokeWidth: r ? 2 : void 0
280
298
  }
281
299
  );
282
300
  }
283
- G.displayName = "ChartDot";
284
- function M({
285
- size: n = 6,
301
+ M.displayName = "ChartDot";
302
+ function z({
303
+ size: t = 6,
286
304
  color: r,
287
305
  colorKey: l,
288
306
  cx: e,
289
- cy: t,
307
+ cy: n,
290
308
  stroke: a,
291
309
  fill: o,
292
310
  payload: d
293
311
  }) {
294
- if (e == null || t == null)
312
+ if (e == null || n == null)
295
313
  return null;
296
- const i = R({
314
+ const i = w({
297
315
  colorKey: l,
298
316
  color: r,
299
317
  fill: o,
@@ -305,26 +323,26 @@ function M({
305
323
  {
306
324
  className: "stroke-background",
307
325
  cx: e,
308
- cy: t,
326
+ cy: n,
309
327
  "data-slot": "chart-dot-on-stroke",
310
328
  fill: i,
311
- r: n / 2,
329
+ r: t / 2,
312
330
  strokeWidth: 2
313
331
  }
314
332
  );
315
333
  }
316
- M.displayName = "ChartDotOnStroke";
317
- function z({
318
- type: n = "default",
334
+ z.displayName = "ChartDotOnStroke";
335
+ function I({
336
+ type: t = "default",
319
337
  filled: r = !1,
320
338
  fillColor: l = "var(--chart-teal)",
321
339
  fillOpacity: e = 0.2,
322
- boundaryOnly: t = !1,
340
+ boundaryOnly: n = !1,
323
341
  radialLines: a,
324
342
  className: o,
325
343
  ...d
326
344
  }) {
327
- const i = n === "circle" ? "circle" : "polygon", h = t ? `[&_.${i === "circle" ? "recharts-polar-grid-concentric-circle" : "recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent` : void 0;
345
+ const i = t === "circle" ? "circle" : "polygon", h = n ? `[&_.${i === "circle" ? "recharts-polar-grid-concentric-circle" : "recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent` : void 0;
328
346
  return r ? /* @__PURE__ */ s(
329
347
  N.PolarGrid,
330
348
  {
@@ -346,35 +364,35 @@ function z({
346
364
  }
347
365
  );
348
366
  }
349
- z.displayName = "ChartRadarGrid";
350
- function I({
351
- type: n = "default",
367
+ I.displayName = "ChartRadarGrid";
368
+ function O({
369
+ type: t = "default",
352
370
  data: r,
353
371
  primaryKey: l,
354
372
  secondaryKey: e,
355
- x: t,
373
+ x: n,
356
374
  y: a,
357
375
  textAnchor: o,
358
376
  payload: d,
359
377
  index: i
360
378
  }) {
361
- const u = r != null && i != null ? r[i] : void 0, h = u && l != null ? u[l] : void 0, g = u && e != null ? u[e] : void 0, m = n === "default" && h != null ? g != null ? `${String(h)}/${String(g)}` : String(h) : null;
362
- return /* @__PURE__ */ x(
379
+ const u = r != null && i != null ? r[i] : void 0, h = u && l != null ? u[l] : void 0, g = u && e != null ? u[e] : void 0, m = t === "default" && h != null ? g != null ? `${String(h)}/${String(g)}` : String(h) : null;
380
+ return /* @__PURE__ */ b(
363
381
  "text",
364
382
  {
365
- className: "text-xs",
383
+ className: "text-body-xs",
366
384
  "data-slot": "chart-radar-label-wrapper",
367
385
  textAnchor: o,
368
- x: t,
386
+ x: n,
369
387
  y: a,
370
388
  children: [
371
- m != null && /* @__PURE__ */ s("tspan", { className: "fill-card-foreground", dy: "-0.5em", x: t, children: m }),
389
+ m != null && /* @__PURE__ */ s("tspan", { className: "fill-card-foreground", dy: "-0.5em", x: n, children: m }),
372
390
  /* @__PURE__ */ s(
373
391
  "tspan",
374
392
  {
375
393
  className: "fill-muted-foreground",
376
394
  dy: m != null ? "1.2em" : void 0,
377
- x: t,
395
+ x: n,
378
396
  children: d?.value
379
397
  }
380
398
  )
@@ -382,26 +400,26 @@ function I({
382
400
  }
383
401
  );
384
402
  }
385
- I.displayName = "ChartRadarLabelWrapper";
386
- function O({
387
- nameKey: n,
403
+ O.displayName = "ChartRadarLabelWrapper";
404
+ function B({
405
+ nameKey: t,
388
406
  config: r,
389
407
  radiusRatio: l = 0.5,
390
408
  cx: e,
391
- cy: t,
409
+ cy: n,
392
410
  midAngle: a = 0,
393
411
  innerRadius: o = 0,
394
412
  outerRadius: d = 0,
395
413
  payload: i,
396
414
  name: u
397
415
  }) {
398
- if (e == null || t == null)
416
+ if (e == null || n == null)
399
417
  return null;
400
- const h = Math.PI / 180, g = o + (d - o) * l, m = e + g * Math.cos(-a * h), C = t + g * Math.sin(-a * h), v = n != null && i != null ? i[n] : void 0, f = v != null ? String(v) : u, c = f != null ? r?.[f]?.label ?? f : f;
418
+ const h = Math.PI / 180, g = o + (d - o) * l, m = e + g * Math.cos(-a * h), C = n + g * Math.sin(-a * h), x = t != null && i != null ? i[t] : void 0, f = x != null ? String(x) : u, c = f != null ? r?.[f]?.label ?? f : f;
401
419
  return /* @__PURE__ */ s(
402
420
  "text",
403
421
  {
404
- className: "fill-foreground text-xs",
422
+ className: "fill-foreground text-body-xs",
405
423
  "data-slot": "chart-pie-label-list",
406
424
  dominantBaseline: "middle",
407
425
  textAnchor: "middle",
@@ -411,22 +429,22 @@ function O({
411
429
  }
412
430
  );
413
431
  }
414
- O.displayName = "ChartPieLabelList";
415
- function B({
416
- valueKey: n,
432
+ B.displayName = "ChartPieLabelList";
433
+ function V({
434
+ valueKey: t,
417
435
  x: r,
418
436
  y: l,
419
437
  textAnchor: e,
420
- payload: t,
438
+ payload: n,
421
439
  value: a
422
440
  }) {
423
441
  if (r == null || l == null)
424
442
  return null;
425
- const o = n != null && t != null ? t[n] : a;
443
+ const o = t != null && n != null ? n[t] : a;
426
444
  return /* @__PURE__ */ s(
427
445
  "text",
428
446
  {
429
- className: "fill-foreground text-xs",
447
+ className: "fill-foreground text-body-xs",
430
448
  "data-slot": "chart-pie-label-wrapper",
431
449
  dominantBaseline: "middle",
432
450
  textAnchor: e,
@@ -436,47 +454,44 @@ function B({
436
454
  }
437
455
  );
438
456
  }
439
- B.displayName = "ChartPieLabelWrapper";
440
- const V = {
441
- "2xl": "text-2xl leading-8",
442
- "3xl": "text-3xl",
443
- "4xl": "text-4xl leading-10"
457
+ V.displayName = "ChartPieLabelWrapper";
458
+ const q = {
459
+ "2xl": "text-metric",
460
+ "3xl": "font-sans text-3xl font-semibold",
461
+ "4xl": "font-sans text-4xl font-semibold"
444
462
  };
445
- function q({
446
- primary: n,
463
+ function E({
464
+ primary: t,
447
465
  secondary: r,
448
466
  size: l = "3xl",
449
467
  viewBox: e
450
468
  }) {
451
469
  if (e == null || typeof e != "object" || !("cx" in e) || !("cy" in e))
452
470
  return null;
453
- const { cx: t, cy: a } = e;
454
- return /* @__PURE__ */ x(
471
+ const { cx: n, cy: a } = e;
472
+ return /* @__PURE__ */ b(
455
473
  "text",
456
474
  {
457
475
  "data-slot": "chart-center-label",
458
476
  dominantBaseline: "middle",
459
477
  textAnchor: "middle",
460
- x: t,
478
+ x: n,
461
479
  y: a,
462
480
  children: [
463
481
  /* @__PURE__ */ s(
464
482
  "tspan",
465
483
  {
466
- className: p(
467
- "fill-foreground font-sans font-bold",
468
- V[l]
469
- ),
470
- x: t,
484
+ className: p("fill-foreground", q[l]),
485
+ x: n,
471
486
  y: a,
472
- children: n
487
+ children: t
473
488
  }
474
489
  ),
475
490
  r != null && /* @__PURE__ */ s(
476
491
  "tspan",
477
492
  {
478
- className: "fill-muted-foreground font-sans text-xs font-normal",
479
- x: t,
493
+ className: "fill-muted-foreground text-body-xs",
494
+ x: n,
480
495
  y: a + 24,
481
496
  children: r
482
497
  }
@@ -485,47 +500,47 @@ function q({
485
500
  }
486
501
  );
487
502
  }
488
- q.displayName = "ChartCenterLabel";
503
+ E.displayName = "ChartCenterLabel";
489
504
  export {
490
505
  J as Area,
491
506
  Q as AreaChart,
492
507
  U as Bar,
493
508
  Z as BarChart,
494
- F as CartesianGrid,
495
- K as Cell,
496
- q as ChartCenterLabel,
497
- S as ChartContainer,
498
- G as ChartDot,
499
- M as ChartDotOnStroke,
500
- ee as ChartLabel,
501
- W as ChartLegend,
502
- D as ChartLegendContent,
503
- O as ChartPieLabelList,
504
- B as ChartPieLabelWrapper,
505
- z as ChartRadarGrid,
506
- I as ChartRadarLabelWrapper,
507
- j as ChartStyle,
508
- T as ChartTooltip,
509
- A as ChartTooltipContent,
509
+ K as CartesianGrid,
510
+ ee as Cell,
511
+ E as ChartCenterLabel,
512
+ j as ChartContainer,
513
+ M as ChartDot,
514
+ z as ChartDotOnStroke,
515
+ te as ChartLabel,
516
+ D as ChartLegend,
517
+ G as ChartLegendContent,
518
+ B as ChartPieLabelList,
519
+ V as ChartPieLabelWrapper,
520
+ I as ChartRadarGrid,
521
+ O as ChartRadarLabelWrapper,
522
+ T as ChartStyle,
523
+ A as ChartTooltip,
524
+ W as ChartTooltipContent,
510
525
  re as ChartsLegend,
511
- te as ChartsTooltip,
512
- ne as Customized,
513
- ae as LabelList,
514
- le as Line,
515
- oe as LineChart,
516
- se as Pie,
517
- ie as PieChart,
518
- ce as PolarAngleAxis,
519
- de as PolarGrid,
520
- ue as PolarRadiusAxis,
521
- he as Radar,
522
- fe as RadarChart,
523
- pe as RadialBar,
524
- me as RadialBarChart,
525
- ge as Rectangle,
526
- Ce as ReferenceLine,
526
+ ne as ChartsTooltip,
527
+ ae as Customized,
528
+ le as LabelList,
529
+ oe as Line,
530
+ se as LineChart,
531
+ ie as Pie,
532
+ ce as PieChart,
533
+ de as PolarAngleAxis,
534
+ ue as PolarGrid,
535
+ he as PolarRadiusAxis,
536
+ fe as Radar,
537
+ pe as RadarChart,
538
+ me as RadialBar,
539
+ ge as RadialBarChart,
540
+ Ce as Rectangle,
541
+ be as ReferenceLine,
527
542
  xe as ResponsiveContainer,
528
543
  ve as Sector,
529
- be as XAxis,
530
- ke as YAxis
544
+ ke as XAxis,
545
+ Ne as YAxis
531
546
  };
package/dist/chip.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),R=require("react"),g=require("class-variance-authority"),S=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),N=require("@brightlocal/ui-components/spinner"),o=require("@brightlocal/ui-components/tooltip");function V(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const r=V(R),m=g.cva(["inline-flex","items-center","justify-center","gap-0.5","rounded-full","font-medium","whitespace-nowrap","shrink-0","select-none","bg-secondary","text-foreground","transition-[color,background-color,box-shadow]","duration-fast","ease-out","hover:bg-secondary/80","focus:outline-none","focus-visible:shadow-default","disabled:pointer-events-none","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:opacity-50"],{variants:{size:{md:["h-7","pl-2.5","pr-1","text-xs"],lg:["h-8","pl-4","pr-2","text-base"]}},defaultVariants:{size:"md"}}),h=g.cva(["inline-flex","items-center","justify-center","rounded-full","cursor-pointer","text-muted-foreground","hover:text-foreground","outline-none","focus-visible:text-foreground","disabled:pointer-events-none","disabled:opacity-50"],{variants:{size:{md:["size-6"],lg:["size-6"]}},defaultVariants:{size:"md"}}),x=r.forwardRef(({className:s,children:e,size:t="md",loading:i=!1,disabled:v=!1,onRemove:j,dataHook:u,trackingEl:l,trackingLabel:y,maxWidth:w=200,loadingLabel:T,removeAriaLabel:p,...z},k)=>{const f=v||i,q=t==="lg"?16:14,a=r.useRef(null),[C,O]=r.useState(!1);r.useEffect(()=>{const c=()=>{a.current&&O(a.current.scrollWidth>a.current.clientWidth)};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[e]);const b=n.jsx("span",{ref:a,className:"truncate","data-slot":"chip-label",style:{maxWidth:w},children:e});return n.jsxs("div",{ref:k,"aria-disabled":f?"true":void 0,className:d.cn(m({size:t}),s),"data-hook":u,"data-slot":"chip","data-tracking-el":l,"data-tracking-label":y,...z,children:[C?n.jsx(o.TooltipProvider,{children:n.jsxs(o.Tooltip,{children:[n.jsx(o.TooltipTrigger,{asChild:!0,children:b}),n.jsx(o.TooltipContent,{dataHook:`${u}-tooltip`,sideOffset:8,children:e})]})}):b,i?n.jsx("span",{"aria-label":T??"Loading",className:d.cn(h({size:t})),"data-slot":"chip-loading",role:"status",children:n.jsx(N.Spinner,{size:t==="lg"?"md":"sm"})}):n.jsx("button",{"aria-label":p?p.replace("{name}",typeof e=="string"?e:"chip"):`Remove ${typeof e=="string"?e:"chip"}`,className:d.cn(h({size:t})),"data-slot":"chip-delete","data-tracking-el":l?`${l}-delete`:void 0,disabled:f,tabIndex:-1,type:"button",onClick:j,children:n.jsx(S.X,{size:q})})]})});x.displayName="Chip";exports.Chip=x;exports.chipVariants=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),R=require("react"),y=require("class-variance-authority"),I=require("@brightlocal/icons"),b=require("@brightlocal/ui-components/lib/utils"),_=require("@brightlocal/ui-components/spinner"),l=require("@brightlocal/ui-components/tooltip");function $(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const c=$(R),v=y.cva(["inline-flex","items-center","justify-center","gap-0.5","rounded-full","whitespace-nowrap","shrink-0","select-none","bg-secondary","text-foreground","transition-[color,background-color,box-shadow]","duration-fast","ease-out","hover:bg-secondary/80","outline-none","focus-visible:shadow-default","disabled:pointer-events-none","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:opacity-50"],{variants:{size:{md:["h-7","pl-2.5","pr-1","text-label-sm"],lg:["h-8","pl-4","pr-2","text-label"]}},defaultVariants:{size:"md"}}),x=y.cva(["inline-flex","items-center","justify-center","rounded-full","cursor-pointer","text-muted-foreground","hover:text-foreground","outline-none","focus-visible:text-foreground","disabled:pointer-events-none","disabled:opacity-50"],{variants:{size:{md:["size-6"],lg:["size-6"]}},defaultVariants:{size:"md"}}),j=c.forwardRef(({className:s,children:e,size:t="md",loading:i=!1,disabled:w=!1,onRemove:d,dataHook:h,trackingEl:u,trackingLabel:k,maxWidth:T=200,loadingLabel:D,removeAriaLabel:m,removableAriaLabel:z,onKeyDown:S,...q},C)=>{const p=w||i,N=t==="lg"?16:14,f=typeof e=="string"||typeof e=="number"?String(e):"chip",o=d!==void 0&&!p,O=n=>{S?.(n),!(n.defaultPrevented||!o)&&(n.key==="Backspace"||n.key==="Delete")&&(n.preventDefault(),d(n))},r=c.useRef(null),[V,P]=c.useState(!1);c.useEffect(()=>{const n=()=>{r.current&&P(r.current.scrollWidth>r.current.clientWidth)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]);const g=a.jsx("span",{ref:r,className:"truncate","data-slot":"chip-label",style:{maxWidth:T},children:e});return a.jsxs("div",{ref:C,"aria-disabled":p?"true":void 0,"aria-label":o?(z??"{name}, press Delete to remove").replace("{name}",f):void 0,className:b.cn(v({size:t}),s),"data-hook":h,"data-slot":"chip","data-tracking-el":u,"data-tracking-label":k,role:o?"group":void 0,tabIndex:o?0:void 0,onKeyDown:O,...q,children:[V?a.jsx(l.TooltipProvider,{children:a.jsxs(l.Tooltip,{children:[a.jsx(l.TooltipTrigger,{asChild:!0,children:g}),a.jsx(l.TooltipContent,{dataHook:`${h}-tooltip`,sideOffset:8,children:e})]})}):g,i?a.jsx("span",{"aria-label":D??"Loading",className:b.cn(x({size:t})),"data-slot":"chip-loading",role:"status",children:a.jsx(_.Spinner,{size:t==="lg"?"md":"sm"})}):a.jsx("button",{"aria-label":m?m.replace("{name}",f):`Remove ${f}`,className:b.cn(x({size:t})),"data-slot":"chip-delete","data-tracking-el":u?`${u}-delete`:void 0,disabled:p,tabIndex:-1,type:"button",onClick:d,children:a.jsx(I.X,{size:N})})]})});j.displayName="Chip";exports.Chip=j;exports.chipVariants=v;