@brightlocal/ui-components 2.26.0 → 3.0.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 (284) hide show
  1. package/README.md +9 -2
  2. package/component-meta.json +4010 -255
  3. package/deprecations.json +189 -2
  4. package/dist/accordion.cjs +1 -1
  5. package/dist/accordion.js +2 -2
  6. package/dist/alert-dialog.cjs +1 -1
  7. package/dist/alert-dialog.js +18 -18
  8. package/dist/alert.cjs +1 -1
  9. package/dist/alert.d.ts +11 -1
  10. package/dist/alert.d.ts.map +1 -1
  11. package/dist/alert.js +31 -28
  12. package/dist/avatar.cjs +1 -1
  13. package/dist/avatar.js +4 -4
  14. package/dist/badge.cjs +1 -1
  15. package/dist/badge.d.ts.map +1 -1
  16. package/dist/badge.js +15 -11
  17. package/dist/blocks/empty-state.cjs +1 -0
  18. package/dist/blocks/empty-state.d.ts +172 -0
  19. package/dist/blocks/empty-state.d.ts.map +1 -0
  20. package/dist/blocks/empty-state.js +155 -0
  21. package/dist/blocks/input-list.cjs +2 -2
  22. package/dist/blocks/input-list.d.ts.map +1 -1
  23. package/dist/blocks/input-list.js +124 -108
  24. package/dist/blocks/progress-state.cjs +1 -0
  25. package/dist/blocks/progress-state.d.ts +121 -0
  26. package/dist/blocks/progress-state.d.ts.map +1 -0
  27. package/dist/blocks/progress-state.js +368 -0
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts.map +1 -1
  30. package/dist/blocks/sidebar.js +297 -296
  31. package/dist/brand-illustration-motif.d.ts +1 -1
  32. package/dist/breadcrumb.cjs +1 -1
  33. package/dist/breadcrumb.d.ts.map +1 -1
  34. package/dist/breadcrumb.js +44 -40
  35. package/dist/button.cjs +1 -1
  36. package/dist/button.d.ts.map +1 -1
  37. package/dist/button.js +23 -23
  38. package/dist/calendar.cjs +1 -1
  39. package/dist/calendar.d.ts.map +1 -1
  40. package/dist/calendar.js +37 -38
  41. package/dist/callout.cjs +1 -1
  42. package/dist/callout.d.ts +24 -2
  43. package/dist/callout.d.ts.map +1 -1
  44. package/dist/callout.js +57 -55
  45. package/dist/card.cjs +1 -1
  46. package/dist/card.d.ts +23 -2
  47. package/dist/card.d.ts.map +1 -1
  48. package/dist/card.js +94 -91
  49. package/dist/chart-empty.cjs +1 -0
  50. package/dist/chart-empty.d.ts +59 -0
  51. package/dist/chart-empty.d.ts.map +1 -0
  52. package/dist/chart-empty.js +29 -0
  53. package/dist/chart.cjs +6 -6
  54. package/dist/chart.d.ts +6 -1
  55. package/dist/chart.d.ts.map +1 -1
  56. package/dist/chart.js +183 -183
  57. package/dist/chip.cjs +1 -1
  58. package/dist/chip.d.ts +1 -1
  59. package/dist/chip.d.ts.map +1 -1
  60. package/dist/chip.js +47 -44
  61. package/dist/combobox.cjs +3 -3
  62. package/dist/combobox.d.ts +4 -2
  63. package/dist/combobox.d.ts.map +1 -1
  64. package/dist/combobox.js +143 -141
  65. package/dist/command.cjs +1 -1
  66. package/dist/command.d.ts.map +1 -1
  67. package/dist/command.js +74 -77
  68. package/dist/context-menu.cjs +1 -1
  69. package/dist/context-menu.d.ts.map +1 -1
  70. package/dist/context-menu.js +26 -29
  71. package/dist/data-table.cjs +1 -1
  72. package/dist/data-table.d.ts +182 -13
  73. package/dist/data-table.d.ts.map +1 -1
  74. package/dist/data-table.js +462 -314
  75. package/dist/description.cjs +1 -1
  76. package/dist/description.js +5 -5
  77. package/dist/dialog.cjs +1 -1
  78. package/dist/dialog.js +20 -20
  79. package/dist/drawer.cjs +1 -1
  80. package/dist/drawer.d.ts.map +1 -1
  81. package/dist/drawer.js +8 -11
  82. package/dist/dropdown-menu.cjs +1 -1
  83. package/dist/dropdown-menu.d.ts.map +1 -1
  84. package/dist/dropdown-menu.js +17 -20
  85. package/dist/field.cjs +1 -1
  86. package/dist/field.d.ts.map +1 -1
  87. package/dist/field.js +29 -25
  88. package/dist/global-layout.cjs +1 -1
  89. package/dist/global-layout.d.ts +58 -6
  90. package/dist/global-layout.d.ts.map +1 -1
  91. package/dist/global-layout.js +278 -194
  92. package/dist/grid.cjs +1 -0
  93. package/dist/grid.d.ts +56 -0
  94. package/dist/grid.d.ts.map +1 -0
  95. package/dist/grid.js +32 -0
  96. package/dist/header.d.ts +13 -0
  97. package/dist/header.d.ts.map +1 -1
  98. package/dist/hooks/use-delayed-pending.cjs +1 -0
  99. package/dist/hooks/use-delayed-pending.d.ts +34 -0
  100. package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
  101. package/dist/hooks/use-delayed-pending.js +17 -0
  102. package/dist/hover-card.cjs +1 -1
  103. package/dist/hover-card.js +13 -13
  104. package/dist/index.cjs +1 -1
  105. package/dist/index.d.ts +10 -0
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +523 -494
  108. package/dist/input-chip.cjs +1 -1
  109. package/dist/input-chip.js +25 -25
  110. package/dist/input-group.cjs +1 -1
  111. package/dist/input-group.js +9 -9
  112. package/dist/input-otp.cjs +1 -1
  113. package/dist/input-otp.js +9 -9
  114. package/dist/input-password.cjs +1 -1
  115. package/dist/input-password.js +51 -51
  116. package/dist/input.cjs +1 -1
  117. package/dist/input.js +9 -9
  118. package/dist/label.cjs +1 -1
  119. package/dist/label.d.ts.map +1 -1
  120. package/dist/label.js +25 -28
  121. package/dist/lib/block-illustration.cjs +1 -0
  122. package/dist/lib/block-illustration.d.ts +28 -0
  123. package/dist/lib/block-illustration.d.ts.map +1 -0
  124. package/dist/lib/block-illustration.js +21 -0
  125. package/dist/lib/empty-canvas.cjs +1 -0
  126. package/dist/lib/empty-canvas.d.ts +27 -0
  127. package/dist/lib/empty-canvas.d.ts.map +1 -0
  128. package/dist/lib/empty-canvas.js +62 -0
  129. package/dist/lib/motion.cjs +1 -1
  130. package/dist/lib/motion.js +10 -8
  131. package/dist/lib/optical-center.cjs +1 -0
  132. package/dist/lib/optical-center.d.ts +12 -0
  133. package/dist/lib/optical-center.d.ts.map +1 -0
  134. package/dist/lib/optical-center.js +11 -0
  135. package/dist/lib/utils.cjs +1 -1
  136. package/dist/lib/utils.d.ts.map +1 -1
  137. package/dist/lib/utils.js +28 -5
  138. package/dist/link.cjs +1 -1
  139. package/dist/link.d.ts +8 -6
  140. package/dist/link.d.ts.map +1 -1
  141. package/dist/link.js +52 -20
  142. package/dist/list.cjs +1 -1
  143. package/dist/list.d.ts.map +1 -1
  144. package/dist/list.js +87 -81
  145. package/dist/map.cjs +1 -1
  146. package/dist/map.d.ts +60 -2
  147. package/dist/map.d.ts.map +1 -1
  148. package/dist/map.js +187 -164
  149. package/dist/media-empty.cjs +1 -0
  150. package/dist/media-empty.d.ts +72 -0
  151. package/dist/media-empty.d.ts.map +1 -0
  152. package/dist/media-empty.js +45 -0
  153. package/dist/menubar.cjs +1 -1
  154. package/dist/menubar.d.ts.map +1 -1
  155. package/dist/menubar.js +17 -20
  156. package/dist/navigation-menu.cjs +1 -1
  157. package/dist/navigation-menu.js +7 -7
  158. package/dist/pagination.cjs +1 -1
  159. package/dist/pagination.d.ts +127 -1
  160. package/dist/pagination.d.ts.map +1 -1
  161. package/dist/pagination.js +189 -98
  162. package/dist/progress.cjs +1 -1
  163. package/dist/progress.d.ts +37 -3
  164. package/dist/progress.d.ts.map +1 -1
  165. package/dist/progress.js +102 -64
  166. package/dist/route-progress.cjs +1 -0
  167. package/dist/route-progress.d.ts +103 -0
  168. package/dist/route-progress.d.ts.map +1 -0
  169. package/dist/route-progress.js +106 -0
  170. package/dist/select.cjs +2 -2
  171. package/dist/select.d.ts.map +1 -1
  172. package/dist/select.js +19 -18
  173. package/dist/separator.cjs +1 -1
  174. package/dist/separator.js +8 -8
  175. package/dist/sheet.cjs +1 -1
  176. package/dist/sheet.d.ts +35 -2
  177. package/dist/sheet.d.ts.map +1 -1
  178. package/dist/sheet.js +103 -66
  179. package/dist/skeleton.cjs +1 -1
  180. package/dist/skeleton.d.ts +38 -3
  181. package/dist/skeleton.d.ts.map +1 -1
  182. package/dist/skeleton.js +43 -20
  183. package/dist/sonner.cjs +1 -1
  184. package/dist/sonner.d.ts.map +1 -1
  185. package/dist/sonner.js +32 -36
  186. package/dist/spinner.cjs +1 -0
  187. package/dist/spinner.d.ts +57 -0
  188. package/dist/spinner.d.ts.map +1 -0
  189. package/dist/spinner.js +35 -0
  190. package/dist/stepper.cjs +1 -1
  191. package/dist/stepper.d.ts.map +1 -1
  192. package/dist/stepper.js +23 -22
  193. package/dist/table.cjs +1 -1
  194. package/dist/table.d.ts +1 -1
  195. package/dist/table.d.ts.map +1 -1
  196. package/dist/table.js +36 -29
  197. package/dist/tabs.cjs +1 -1
  198. package/dist/tabs.js +1 -1
  199. package/dist/text-reveal-motion.d.ts +10 -0
  200. package/dist/text-reveal-motion.d.ts.map +1 -1
  201. package/dist/textarea.cjs +1 -1
  202. package/dist/textarea.js +11 -11
  203. package/dist/toggle.cjs +1 -1
  204. package/dist/toggle.js +8 -8
  205. package/dist/tooltip.cjs +1 -1
  206. package/dist/tooltip.js +8 -8
  207. package/dist/typography-heading.cjs +1 -0
  208. package/dist/typography-heading.d.ts +116 -0
  209. package/dist/typography-heading.d.ts.map +1 -0
  210. package/dist/typography-heading.js +84 -0
  211. package/dist/typography-text.cjs +1 -0
  212. package/dist/typography-text.d.ts +113 -0
  213. package/dist/typography-text.d.ts.map +1 -0
  214. package/dist/typography-text.js +81 -0
  215. package/dist/typography.d.ts +13 -0
  216. package/dist/typography.d.ts.map +1 -1
  217. package/package.json +42 -2
  218. package/src/blocks/empty-state.tsx +424 -0
  219. package/src/blocks/input-list.tsx +66 -36
  220. package/src/blocks/progress-state.tsx +542 -0
  221. package/src/blocks/sidebar.tsx +46 -40
  222. package/src/components/accordion.tsx +2 -2
  223. package/src/components/alert-dialog.tsx +2 -2
  224. package/src/components/alert.tsx +27 -13
  225. package/src/components/avatar.tsx +1 -1
  226. package/src/components/badge.tsx +8 -4
  227. package/src/components/breadcrumb.tsx +9 -4
  228. package/src/components/button.tsx +5 -8
  229. package/src/components/calendar.tsx +5 -6
  230. package/src/components/callout.tsx +48 -15
  231. package/src/components/card.tsx +52 -17
  232. package/src/components/chart-empty.tsx +116 -0
  233. package/src/components/chart.tsx +43 -17
  234. package/src/components/chip.tsx +9 -6
  235. package/src/components/combobox.tsx +21 -12
  236. package/src/components/command.tsx +9 -10
  237. package/src/components/context-menu.tsx +6 -9
  238. package/src/components/data-table.tsx +405 -31
  239. package/src/components/description.tsx +1 -1
  240. package/src/components/dialog.tsx +2 -2
  241. package/src/components/drawer.tsx +2 -5
  242. package/src/components/dropdown-menu.tsx +8 -11
  243. package/src/components/field.tsx +8 -4
  244. package/src/components/global-layout.tsx +264 -65
  245. package/src/components/grid.tsx +130 -0
  246. package/src/components/header.tsx +13 -0
  247. package/src/components/hover-card.tsx +1 -1
  248. package/src/components/input-chip.tsx +1 -1
  249. package/src/components/input-group.tsx +1 -1
  250. package/src/components/input-otp.tsx +1 -1
  251. package/src/components/input-password.tsx +1 -1
  252. package/src/components/input.tsx +1 -1
  253. package/src/components/label.tsx +10 -13
  254. package/src/components/link.tsx +39 -5
  255. package/src/components/list.tsx +18 -14
  256. package/src/components/map.tsx +101 -5
  257. package/src/components/media-empty.tsx +156 -0
  258. package/src/components/menubar.tsx +7 -10
  259. package/src/components/navigation-menu.tsx +1 -1
  260. package/src/components/pagination.tsx +279 -1
  261. package/src/components/progress.tsx +120 -11
  262. package/src/components/route-progress.tsx +354 -0
  263. package/src/components/select.tsx +5 -4
  264. package/src/components/separator.tsx +1 -1
  265. package/src/components/sheet.tsx +89 -7
  266. package/src/components/skeleton.tsx +78 -7
  267. package/src/components/sonner.tsx +5 -14
  268. package/src/components/spinner.tsx +94 -0
  269. package/src/components/stepper.tsx +6 -7
  270. package/src/components/table.tsx +11 -4
  271. package/src/components/tabs.tsx +1 -1
  272. package/src/components/text-reveal-motion.tsx +10 -0
  273. package/src/components/textarea.tsx +1 -1
  274. package/src/components/toggle.tsx +1 -1
  275. package/src/components/tooltip.tsx +1 -1
  276. package/src/components/typography-heading.tsx +229 -0
  277. package/src/components/typography-text.tsx +225 -0
  278. package/src/components/typography.tsx +13 -0
  279. package/src/hooks/use-delayed-pending.ts +60 -0
  280. package/src/index.ts +12 -0
  281. package/src/lib/block-illustration.tsx +88 -0
  282. package/src/lib/empty-canvas.tsx +128 -0
  283. package/src/lib/optical-center.tsx +45 -0
  284. package/src/lib/utils.ts +26 -0
package/dist/combobox.js CHANGED
@@ -7,7 +7,8 @@ import { defaultFilter as K } from "cmdk";
7
7
  import { cn as T } from "@brightlocal/ui-components/lib/utils";
8
8
  import { useDevWarning as H } from "@brightlocal/ui-components/lib/use-dev-warning";
9
9
  import { Popover as re, PopoverContent as ne, PopoverTrigger as ae } from "@brightlocal/ui-components/popover";
10
- import { Command as se, CommandEmpty as ie, CommandGroup as le, CommandInput as ue, CommandItem as ce, CommandList as de, CommandSeparator as fe } from "@brightlocal/ui-components/command";
10
+ import { Command as se, CommandEmpty as ie, CommandGroup as le, CommandInput as ce, CommandItem as ue, CommandList as de, CommandSeparator as fe } from "@brightlocal/ui-components/command";
11
+ import { Spinner as be } from "@brightlocal/ui-components/spinner";
11
12
  const J = e.createContext(null), Q = e.createContext(null);
12
13
  function _() {
13
14
  const t = e.useContext(J);
@@ -15,7 +16,7 @@ function _() {
15
16
  throw new Error("Combobox components must be used within a <Combobox>");
16
17
  return t;
17
18
  }
18
- function Fe({
19
+ function Te({
19
20
  value: t,
20
21
  onValueChange: r,
21
22
  open: a,
@@ -23,21 +24,21 @@ function Fe({
23
24
  onClose: s,
24
25
  shouldFilter: f = !0,
25
26
  disabled: l = !1,
26
- itemToStringValue: c,
27
+ itemToStringValue: u,
27
28
  children: m
28
29
  }) {
29
- const [v, D] = e.useState(""), [x, b] = e.useState(!1), [S, E] = e.useState(
30
+ const [v, D] = e.useState(""), [h, b] = e.useState(!1), [S, E] = e.useState(
30
31
  () => /* @__PURE__ */ new Map()
31
- ), [C, L] = e.useState(""), [V, y] = e.useState(void 0), w = t !== void 0, M = a !== void 0, R = w ? t : v, k = M ? a : x, N = e.useCallback(
32
- (h) => {
33
- h || L(""), M || b(h), o?.(h);
32
+ ), [C, L] = e.useState(""), [V, w] = e.useState(void 0), y = t !== void 0, M = a !== void 0, R = y ? t : v, k = M ? a : h, N = e.useCallback(
33
+ (x) => {
34
+ x || L(""), M || b(x), o?.(x);
34
35
  },
35
36
  [M, o]
36
37
  ), p = e.useCallback(
37
- (h) => {
38
- w || D(h), r?.(h);
38
+ (x) => {
39
+ y || D(x), r?.(x);
39
40
  },
40
- [w, r]
41
+ [y, r]
41
42
  ), I = e.useRef(s);
42
43
  e.useEffect(() => {
43
44
  I.current = s;
@@ -48,24 +49,24 @@ function Fe({
48
49
  }, [k]), e.useEffect(() => () => {
49
50
  A.current && I.current?.();
50
51
  }, []);
51
- const u = e.useRef(/* @__PURE__ */ new Map()), F = e.useRef(!1), O = e.useRef(!0);
52
+ const c = e.useRef(/* @__PURE__ */ new Map()), F = e.useRef(!1), O = e.useRef(!0);
52
53
  e.useEffect(() => () => {
53
54
  O.current = !1;
54
55
  }, []);
55
56
  const j = e.useCallback(() => {
56
57
  F.current || (F.current = !0, queueMicrotask(() => {
57
- F.current = !1, O.current && E(new Map(u.current));
58
+ F.current = !1, O.current && E(new Map(c.current));
58
59
  }));
59
60
  }, []), $ = e.useCallback(
60
- (h, n) => {
61
- u.current.get(h) !== n && (u.current.set(h, n), j());
61
+ (x, n) => {
62
+ c.current.get(x) !== n && (c.current.set(x, n), j());
62
63
  },
63
64
  [j]
64
65
  ), z = e.useCallback(
65
- (h) => {
66
- for (const [n, i] of h)
67
- u.current.set(n, i);
68
- E(new Map(u.current));
66
+ (x) => {
67
+ for (const [n, i] of x)
68
+ c.current.set(n, i);
69
+ E(new Map(c.current));
69
70
  },
70
71
  []
71
72
  ), q = e.useRef(R);
@@ -73,13 +74,13 @@ function Fe({
73
74
  q.current = R;
74
75
  }, [R]);
75
76
  const U = e.useCallback(
76
- (h) => {
77
- h !== q.current && u.current.has(h) && (u.current.delete(h), j());
77
+ (x) => {
78
+ x !== q.current && c.current.has(x) && (c.current.delete(x), j());
78
79
  },
79
80
  [j]
80
81
  ), G = e.useMemo(
81
- () => c ? (h, n, i) => K(c(h), n, i) : K,
82
- [c]
82
+ () => u ? (x, n, i) => K(u(x), n, i) : K,
83
+ [u]
83
84
  ), W = e.useMemo(
84
85
  () => ({
85
86
  open: k,
@@ -92,12 +93,12 @@ function Fe({
92
93
  registerItem: $,
93
94
  registerItemsSync: z,
94
95
  unregisterItem: U,
95
- itemToStringValue: c,
96
+ itemToStringValue: u,
96
97
  filterFn: G,
97
98
  searchValue: C,
98
99
  setSearchValue: L,
99
100
  activeDescendantId: V,
100
- setActiveDescendantId: y
101
+ setActiveDescendantId: w
101
102
  }),
102
103
  [
103
104
  k,
@@ -110,16 +111,16 @@ function Fe({
110
111
  $,
111
112
  z,
112
113
  U,
113
- c,
114
+ u,
114
115
  G,
115
116
  C,
116
117
  V,
117
- y
118
+ w
118
119
  ]
119
120
  );
120
121
  return /* @__PURE__ */ d(J.Provider, { value: W, children: /* @__PURE__ */ d(re, { open: k, onOpenChange: N, children: m }) });
121
122
  }
122
- const be = oe([
123
+ const me = oe([
123
124
  // Base layout
124
125
  "relative flex w-full items-center justify-between gap-2",
125
126
  "px-4 py-2 h-9",
@@ -128,7 +129,7 @@ const be = oe([
128
129
  "bg-neutral-50 shadow-xs",
129
130
  "dark:bg-white/5 dark:border-white/15",
130
131
  // Typography
131
- "text-base font-normal font-sans text-foreground",
132
+ "text-body text-foreground",
132
133
  // Placeholder state
133
134
  "data-[placeholder=true]:text-muted-foreground",
134
135
  // Focus state
@@ -142,7 +143,7 @@ const be = oe([
142
143
  "transition-[background-color,border-color,box-shadow] duration-fast ease-out",
143
144
  // Icon styles
144
145
  "[&_svg]:pointer-events-none [&_svg]:shrink-0"
145
- ]), me = e.forwardRef(
146
+ ]), pe = e.forwardRef(
146
147
  ({
147
148
  className: t,
148
149
  dataHook: r,
@@ -151,18 +152,18 @@ const be = oe([
151
152
  trackingLabel: s,
152
153
  children: f,
153
154
  ...l
154
- }, c) => {
155
- const { open: m, disabled: v, value: D } = _(), x = e.useId(), b = !D, S = a || l["aria-invalid"] === !0 || l["aria-invalid"] === "true";
155
+ }, u) => {
156
+ const { open: m, disabled: v, value: D } = _(), h = e.useId(), b = !D, S = a || l["aria-invalid"] === !0 || l["aria-invalid"] === "true";
156
157
  return /* @__PURE__ */ d(ae, { asChild: !0, children: /* @__PURE__ */ B(
157
158
  "button",
158
159
  {
159
- ref: c,
160
- "aria-controls": m ? x : void 0,
160
+ ref: u,
161
+ "aria-controls": m ? h : void 0,
161
162
  "aria-expanded": m,
162
163
  "aria-haspopup": "listbox",
163
164
  "aria-invalid": S ? "true" : void 0,
164
165
  className: T(
165
- be(),
166
+ me(),
166
167
  S && "border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive",
167
168
  t
168
169
  ),
@@ -190,8 +191,8 @@ const be = oe([
190
191
  ) });
191
192
  }
192
193
  );
193
- me.displayName = "ComboboxTrigger";
194
- function pe(t) {
194
+ pe.displayName = "ComboboxTrigger";
195
+ function he(t) {
195
196
  return t != null && typeof t == "object" && "value" in t && typeof t.value == "string";
196
197
  }
197
198
  function X(t, r, a) {
@@ -202,15 +203,15 @@ function X(t, r, a) {
202
203
  hasDistinctLabel: !!a
203
204
  };
204
205
  const o = t[0];
205
- if (!pe(o)) return null;
206
- const s = (c) => c.value, f = "label" in o && typeof o.label == "string";
206
+ if (!he(o)) return null;
207
+ const s = (u) => u.value, f = "label" in o && typeof o.label == "string";
207
208
  return {
208
209
  getValue: s,
209
- getLabel: a ?? (f ? (c) => String(c.label) : s),
210
+ getLabel: a ?? (f ? (u) => String(u.label) : s),
210
211
  hasDistinctLabel: f || !!a
211
212
  };
212
213
  }
213
- function Ae({
214
+ function $e({
214
215
  placeholder: t,
215
216
  className: r,
216
217
  displayValue: a,
@@ -218,7 +219,7 @@ function Ae({
218
219
  getItemValue: s,
219
220
  getItemLabel: f
220
221
  }) {
221
- const { value: l, itemLabels: c } = _(), m = e.useMemo(
222
+ const { value: l, itemLabels: u } = _(), m = e.useMemo(
222
223
  () => o ? X(o, s, f) : null,
223
224
  [o, s, f]
224
225
  );
@@ -228,13 +229,13 @@ function Ae({
228
229
  [o, m]
229
230
  );
230
231
  const v = e.useMemo(() => !o || !m ? null : new Map(
231
- o.map((x) => [m.getValue(x), m.getLabel(x)])
232
- ), [o, m]), D = l ? v?.get(l) || c.get(l) || a?.(l) || l : t;
232
+ o.map((h) => [m.getValue(h), m.getLabel(h)])
233
+ ), [o, m]), D = l ? v?.get(l) || u.get(l) || a?.(l) || l : t;
233
234
  return /* @__PURE__ */ d(
234
235
  "span",
235
236
  {
236
237
  className: T(
237
- "overflow-hidden text-base leading-normal font-medium text-ellipsis whitespace-nowrap",
238
+ "text-body overflow-hidden text-ellipsis whitespace-nowrap",
238
239
  r
239
240
  ),
240
241
  "data-slot": "combobox-value",
@@ -242,7 +243,7 @@ function Ae({
242
243
  }
243
244
  );
244
245
  }
245
- function Te({
246
+ function Oe({
246
247
  dataHook: t,
247
248
  className: r,
248
249
  children: a,
@@ -250,40 +251,40 @@ function Te({
250
251
  side: s = "bottom",
251
252
  sideOffset: f,
252
253
  avoidCollisions: l,
253
- hideList: c = !1,
254
+ hideList: u = !1,
254
255
  ariaLabel: m
255
256
  }) {
256
- const { open: v, shouldFilter: D, filterFn: x, itemToStringValue: b } = _(), [S, E] = e.useState(
257
+ const { open: v, shouldFilter: D, filterFn: h, itemToStringValue: b } = _(), [S, E] = e.useState(
257
258
  null
258
- ), C = e.useRef(null), L = e.useCallback((y) => {
259
- if (C.current?.(), C.current = null, !y) return;
260
- let w = !1;
259
+ ), C = e.useRef(null), L = e.useCallback((w) => {
260
+ if (C.current?.(), C.current = null, !w) return;
261
+ let y = !1;
261
262
  const M = (p) => {
262
- w || (p === "top" || p === "bottom") && (w = !0, R.disconnect(), E(p));
263
+ y || (p === "top" || p === "bottom") && (y = !0, R.disconnect(), E(p));
263
264
  }, R = new MutationObserver(() => {
264
- M(y.getAttribute("data-side"));
265
+ M(w.getAttribute("data-side"));
265
266
  });
266
- R.observe(y, {
267
+ R.observe(w, {
267
268
  attributes: !0,
268
269
  attributeFilter: ["data-side"]
269
270
  });
270
271
  let k = 0, N = 0;
271
272
  k = requestAnimationFrame(() => {
272
273
  N = requestAnimationFrame(() => {
273
- M(y.getAttribute("data-side"));
274
+ M(w.getAttribute("data-side"));
274
275
  });
275
276
  }), C.current = () => {
276
- w = !0, R.disconnect(), cancelAnimationFrame(k), cancelAnimationFrame(N);
277
+ y = !0, R.disconnect(), cancelAnimationFrame(k), cancelAnimationFrame(N);
277
278
  };
278
279
  }, []);
279
280
  e.useEffect(() => {
280
281
  if (!v) {
281
282
  C.current?.(), C.current = null;
282
- const y = setTimeout(() => E(null), 150);
283
- return () => clearTimeout(y);
283
+ const w = setTimeout(() => E(null), 150);
284
+ return () => clearTimeout(w);
284
285
  }
285
286
  }, [v]);
286
- const V = b ? x : void 0;
287
+ const V = b ? h : void 0;
287
288
  return /* @__PURE__ */ d(
288
289
  ne,
289
290
  {
@@ -305,7 +306,7 @@ function Te({
305
306
  className: T(
306
307
  "min-h-0 flex-1 border-0 shadow-none",
307
308
  "[&_[data-slot='command-input-wrapper']]:shrink-0",
308
- c && "[&_[data-slot='command-input-wrapper']]:border-b-0"
309
+ u && "[&_[data-slot='command-input-wrapper']]:border-b-0"
309
310
  ),
310
311
  "data-slot": "combobox-command",
311
312
  dataHook: t || "combobox-command",
@@ -318,7 +319,7 @@ function Te({
318
319
  );
319
320
  }
320
321
  const xe = e.forwardRef(({ debounceMs: t, onValueChange: r, ...a }, o) => {
321
- const { setSearchValue: s, shouldFilter: f, activeDescendantId: l } = _(), c = e.useRef(
322
+ const { setSearchValue: s, shouldFilter: f, activeDescendantId: l } = _(), u = e.useRef(
322
323
  void 0
323
324
  );
324
325
  H(
@@ -332,18 +333,18 @@ Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs fo
332
333
  "debounceMs is set on <ComboboxInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",
333
334
  [t, a.value]
334
335
  ), e.useEffect(() => () => {
335
- c.current && clearTimeout(c.current);
336
+ u.current && clearTimeout(u.current);
336
337
  }, []);
337
338
  const m = e.useCallback(
338
339
  (v) => {
339
- s(v), t && t > 0 ? (clearTimeout(c.current), c.current = setTimeout(() => {
340
+ s(v), t && t > 0 ? (clearTimeout(u.current), u.current = setTimeout(() => {
340
341
  r?.(v);
341
342
  }, t)) : r?.(v);
342
343
  },
343
344
  [t, r, s]
344
345
  );
345
346
  return /* @__PURE__ */ d(
346
- ue,
347
+ ce,
347
348
  {
348
349
  ref: o,
349
350
  "aria-activedescendant": l,
@@ -354,7 +355,7 @@ Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs fo
354
355
  );
355
356
  });
356
357
  xe.displayName = "ComboboxInput";
357
- const he = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ d(
358
+ const ge = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ d(
358
359
  de,
359
360
  {
360
361
  ref: a,
@@ -363,8 +364,8 @@ const he = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ d(
363
364
  ...r
364
365
  }
365
366
  ));
366
- he.displayName = "ComboboxList";
367
- function ge({
367
+ ge.displayName = "ComboboxList";
368
+ function ve({
368
369
  items: t,
369
370
  getItemValue: r,
370
371
  getItemLabel: a,
@@ -372,37 +373,37 @@ function ge({
372
373
  estimateSize: s = 36,
373
374
  overscan: f = 5,
374
375
  children: l,
375
- renderEmpty: c,
376
+ renderEmpty: u,
376
377
  className: m,
377
378
  dataHook: v
378
379
  }, D) {
379
- const x = e.useMemo(
380
+ const h = e.useMemo(
380
381
  () => X(t, r, a),
381
382
  [t, r, a]
382
383
  ), b = e.useMemo(
383
- () => x?.getValue ?? ((n) => {
384
+ () => h?.getValue ?? ((n) => {
384
385
  if (typeof n == "string" || typeof n == "number")
385
386
  return String(n);
386
387
  throw new Error(
387
388
  "[BrightLocal DS] ComboboxVirtualList: `getItemValue` is required for non-primitive items without a `value` property."
388
389
  );
389
390
  }),
390
- [x]
391
+ [h]
391
392
  ), S = e.useMemo(
392
- () => x?.getLabel ?? b,
393
- [x, b]
393
+ () => h?.getLabel ?? b,
394
+ [h, b]
394
395
  );
395
396
  H(
396
- () => !x && t.length > 0,
397
+ () => !h && t.length > 0,
397
398
  "ComboboxVirtualList: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",
398
- [x, t.length]
399
+ [h, t.length]
399
400
  );
400
401
  const E = e.useRef(null), {
401
402
  value: C,
402
403
  onValueChange: L,
403
404
  setOpen: V,
404
- shouldFilter: y,
405
- searchValue: w,
405
+ shouldFilter: w,
406
+ searchValue: y,
406
407
  filterFn: M,
407
408
  setActiveDescendantId: R,
408
409
  registerItemsSync: k,
@@ -418,45 +419,45 @@ function ge({
418
419
  N(b(i));
419
420
  };
420
421
  }, [t, b, S, k, N]);
421
- const u = e.useMemo(() => {
422
- if (!y || !w.trim()) return t;
422
+ const c = e.useMemo(() => {
423
+ if (!w || !y.trim()) return t;
423
424
  const n = [];
424
425
  for (const i of t) {
425
- let g = x?.hasDistinctLabel ? K(S(i), w) : M(b(i), w);
426
+ let g = h?.hasDistinctLabel ? K(S(i), y) : M(b(i), y);
426
427
  if (o)
427
428
  for (const P of o(i))
428
- g = Math.max(g, K(P, w));
429
+ g = Math.max(g, K(P, y));
429
430
  g > 0 && n.push({ item: i, score: g });
430
431
  }
431
432
  return n.sort((i, g) => g.score - i.score), n.map((i) => i.item);
432
433
  }, [
433
434
  t,
434
- y,
435
435
  w,
436
+ y,
436
437
  b,
437
438
  S,
438
439
  o,
439
440
  M,
440
- x?.hasDistinctLabel
441
+ h?.hasDistinctLabel
441
442
  ]), F = te({
442
- count: u.length,
443
+ count: c.length,
443
444
  getScrollElement: () => E.current,
444
445
  estimateSize: () => s,
445
446
  overscan: f
446
- }), O = p >= 0 && p < u.length ? b(u[p]) : null;
447
+ }), O = p >= 0 && p < c.length ? b(c[p]) : null;
447
448
  e.useEffect(() => {
448
449
  I(0);
449
- }, [w, u.length]);
450
+ }, [y, c.length]);
450
451
  const j = e.useRef(!1);
451
452
  e.useEffect(() => {
452
453
  if (j.current || !C) return;
453
- const n = u.findIndex((i) => b(i) === C);
454
+ const n = c.findIndex((i) => b(i) === C);
454
455
  n >= 0 && (I(n), F.scrollToIndex(n, { align: "center" }), j.current = !0);
455
- }, [C, u, b, F]);
456
+ }, [C, c, b, F]);
456
457
  const $ = e.useRef(!1);
457
458
  e.useEffect(() => {
458
- $.current && p >= 0 && p < u.length && F.scrollToIndex(p, { align: "auto" }), $.current = !1;
459
- }, [p, u.length, F]), e.useEffect(() => {
459
+ $.current && p >= 0 && p < c.length && F.scrollToIndex(p, { align: "auto" }), $.current = !1;
460
+ }, [p, c.length, F]), e.useEffect(() => {
460
461
  const n = E.current?.closest(
461
462
  '[data-slot="combobox-command"]'
462
463
  );
@@ -465,15 +466,15 @@ function ge({
465
466
  switch (g.key) {
466
467
  case "ArrowDown":
467
468
  g.preventDefault(), g.stopPropagation(), $.current = !0, I(
468
- (P) => P < u.length - 1 ? P + 1 : P
469
+ (P) => P < c.length - 1 ? P + 1 : P
469
470
  );
470
471
  break;
471
472
  case "ArrowUp":
472
473
  g.preventDefault(), g.stopPropagation(), $.current = !0, I((P) => P > 0 ? P - 1 : P);
473
474
  break;
474
475
  case "Enter":
475
- if (g.preventDefault(), g.stopPropagation(), p >= 0 && p < u.length) {
476
- const P = b(u[p]);
476
+ if (g.preventDefault(), g.stopPropagation(), p >= 0 && p < c.length) {
477
+ const P = b(c[p]);
477
478
  L(P === C ? "" : P), V(!1);
478
479
  }
479
480
  break;
@@ -481,18 +482,18 @@ function ge({
481
482
  g.preventDefault(), g.stopPropagation(), $.current = !0, I(0);
482
483
  break;
483
484
  case "End":
484
- g.preventDefault(), g.stopPropagation(), $.current = !0, I(u.length - 1);
485
+ g.preventDefault(), g.stopPropagation(), $.current = !0, I(c.length - 1);
485
486
  break;
486
487
  }
487
488
  };
488
489
  return n.addEventListener("keydown", i, { capture: !0 }), () => n.removeEventListener("keydown", i, { capture: !0 });
489
- }, [u, p, C, L, V, b]);
490
+ }, [c, p, C, L, V, b]);
490
491
  const z = e.useMemo(() => {
491
492
  const n = /* @__PURE__ */ new Map();
492
- return u.forEach((i, g) => {
493
+ return c.forEach((i, g) => {
493
494
  n.set(b(i), g);
494
495
  }), n;
495
- }, [u, b]), q = e.useCallback(
496
+ }, [c, b]), q = e.useCallback(
496
497
  (n) => {
497
498
  const i = z.get(n);
498
499
  i !== void 0 && I(i);
@@ -501,7 +502,7 @@ function ge({
501
502
  ), U = e.useCallback(
502
503
  (n) => (z.get(n) ?? 0) + 1,
503
504
  [z]
504
- ), G = u.length, W = e.useMemo(
505
+ ), G = c.length, W = e.useMemo(
505
506
  () => ({
506
507
  activeValue: O,
507
508
  onItemPointerMove: q,
@@ -510,8 +511,8 @@ function ge({
510
511
  getItemPosition: U
511
512
  }),
512
513
  [O, q, A, G, U]
513
- ), h = O != null ? `${A}item-${O}` : void 0;
514
- return e.useEffect(() => (R(h), () => R(void 0)), [h, R]), u.length === 0 ? /* @__PURE__ */ d(
514
+ ), x = O != null ? `${A}item-${O}` : void 0;
515
+ return e.useEffect(() => (R(x), () => R(void 0)), [x, R]), c.length === 0 ? /* @__PURE__ */ d(
515
516
  "div",
516
517
  {
517
518
  ref: E,
@@ -522,7 +523,7 @@ function ge({
522
523
  "data-hook": v,
523
524
  "data-slot": "combobox-virtual-list",
524
525
  role: "listbox",
525
- children: c
526
+ children: u
526
527
  }
527
528
  ) : /* @__PURE__ */ d(Q.Provider, { value: W, children: /* @__PURE__ */ d(
528
529
  "div",
@@ -550,9 +551,9 @@ function ge({
550
551
  transform: `translateY(${n.start}px)`
551
552
  },
552
553
  children: l(
553
- u[n.index],
554
+ c[n.index],
554
555
  n.index,
555
- w
556
+ y
556
557
  )
557
558
  },
558
559
  n.key
@@ -562,9 +563,9 @@ function ge({
562
563
  }
563
564
  ) });
564
565
  }
565
- const $e = e.forwardRef(ge), ve = e.forwardRef((t, r) => /* @__PURE__ */ d(ie, { ref: r, "data-slot": "combobox-empty", ...t }));
566
- ve.displayName = "ComboboxEmpty";
567
- const Ce = e.forwardRef(({ children: t, ...r }, a) => {
566
+ const je = e.forwardRef(ve), Ce = e.forwardRef((t, r) => /* @__PURE__ */ d(ie, { ref: r, "data-slot": "combobox-empty", ...t }));
567
+ Ce.displayName = "ComboboxEmpty";
568
+ const ye = e.forwardRef(({ children: t, ...r }, a) => {
568
569
  const o = e.useRef(null);
569
570
  return H(
570
571
  () => o.current ? o.current.querySelectorAll('[data-slot="combobox-item"]').length >= 100 : !1,
@@ -583,7 +584,7 @@ Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox
583
584
  }
584
585
  );
585
586
  });
586
- Ce.displayName = "ComboboxGroup";
587
+ ye.displayName = "ComboboxGroup";
587
588
  function we(t, r, a) {
588
589
  if (!r || !r.trim())
589
590
  return t;
@@ -595,7 +596,7 @@ function we(t, r, a) {
595
596
  (f, l) => l % 2 === 1 ? /* @__PURE__ */ d("span", { className: a, children: f }, l) : /* @__PURE__ */ d(e.Fragment, { children: f }, l)
596
597
  ) });
597
598
  }
598
- const ye = e.forwardRef(
599
+ const ke = e.forwardRef(
599
600
  ({
600
601
  value: t,
601
602
  label: r,
@@ -604,25 +605,25 @@ const ye = e.forwardRef(
604
605
  className: s,
605
606
  highlight: f,
606
607
  highlightClassName: l,
607
- keywords: c,
608
+ keywords: u,
608
609
  onSelect: m,
609
610
  ...v
610
611
  }, D) => {
611
- const { value: x, onValueChange: b, setOpen: S, registerItem: E, unregisterItem: C } = _(), L = e.useContext(Q), V = x === t, y = e.useMemo(() => r || (typeof o == "string" ? o : typeof o == "number" ? String(o) : t), [r, o, t]), w = e.useRef(E), M = e.useRef(C);
612
+ const { value: h, onValueChange: b, setOpen: S, registerItem: E, unregisterItem: C } = _(), L = e.useContext(Q), V = h === t, w = e.useMemo(() => r || (typeof o == "string" ? o : typeof o == "number" ? String(o) : t), [r, o, t]), y = e.useRef(E), M = e.useRef(C);
612
613
  e.useEffect(() => {
613
- w.current = E, M.current = C;
614
+ y.current = E, M.current = C;
614
615
  }, [E, C]);
615
616
  const R = !!L;
616
617
  e.useEffect(() => {
617
618
  if (!R)
618
- return w.current(t, y), () => M.current(t);
619
- }, [t, y, R]);
619
+ return y.current(t, w), () => M.current(t);
620
+ }, [t, w, R]);
620
621
  const k = () => {
621
- b(t === x ? "" : t), S(!1), m?.(t);
622
+ b(t === h ? "" : t), S(!1), m?.(t);
622
623
  }, N = () => f && typeof o == "string" ? we(
623
624
  o,
624
625
  f,
625
- l || "text-sm leading-normal font-semibold"
626
+ l || "text-label font-semibold"
626
627
  ) : o;
627
628
  if (L) {
628
629
  const p = L.activeValue === t, I = !!v.disabled;
@@ -635,7 +636,7 @@ const ye = e.forwardRef(
635
636
  "aria-selected": V,
636
637
  "aria-setsize": L.filteredCount,
637
638
  className: T(
638
- "data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none",
639
+ "data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 outline-hidden select-none",
639
640
  "[&_svg]:pointer-events-none [&_svg]:shrink-0",
640
641
  I && "pointer-events-none opacity-50",
641
642
  s
@@ -665,13 +666,13 @@ const ye = e.forwardRef(
665
666
  );
666
667
  }
667
668
  return /* @__PURE__ */ B(
668
- ce,
669
+ ue,
669
670
  {
670
671
  ref: D,
671
672
  className: T("justify-between", s),
672
673
  "data-slot": "combobox-item",
673
674
  dataHook: a,
674
- keywords: c ? [y, ...c] : [y],
675
+ keywords: u ? [w, ...u] : [w],
675
676
  value: t,
676
677
  onSelect: k,
677
678
  ...v,
@@ -689,10 +690,10 @@ const ye = e.forwardRef(
689
690
  );
690
691
  }
691
692
  );
692
- ye.displayName = "ComboboxItem";
693
- const ke = e.forwardRef((t, r) => /* @__PURE__ */ d(fe, { ref: r, "data-slot": "combobox-separator", ...t }));
694
- ke.displayName = "ComboboxSeparator";
695
- function Oe({
693
+ ke.displayName = "ComboboxItem";
694
+ const Ie = e.forwardRef((t, r) => /* @__PURE__ */ d(fe, { ref: r, "data-slot": "combobox-separator", ...t }));
695
+ Ie.displayName = "ComboboxSeparator";
696
+ function ze({
696
697
  className: t,
697
698
  children: r,
698
699
  loadingText: a
@@ -702,35 +703,36 @@ function Oe({
702
703
  {
703
704
  "aria-live": "polite",
704
705
  className: T(
705
- "text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",
706
+ // The entrance fade doubles as the flash-threshold appearance delay
707
+ // (`both` holds the hidden start): a fetch that resolves inside the
708
+ // flash zone never flashes a spinner, which would read slower than
709
+ // no indicator at all. flash-delay draws the delay from
710
+ // --ds-motion-flash-threshold — the same threshold useDelayedPending
711
+ // mirrors in JS.
712
+ "text-body-sm text-muted-foreground relative flex items-center justify-center gap-2 py-6",
713
+ "animate-entrance-fade flash-delay",
706
714
  t
707
715
  ),
708
716
  "data-slot": "combobox-loading",
709
717
  role: "status",
710
718
  children: r || /* @__PURE__ */ B(Z, { children: [
711
- /* @__PURE__ */ d(
712
- "div",
713
- {
714
- "aria-hidden": "true",
715
- className: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"
716
- }
717
- ),
718
- a ?? "Loading..."
719
+ /* @__PURE__ */ d(be, { size: "md" }),
720
+ /* @__PURE__ */ d("span", { className: "sr-only", children: a ?? "Loading suggestions" })
719
721
  ] })
720
722
  }
721
723
  );
722
724
  }
723
725
  export {
724
- Fe as Combobox,
725
- Te as ComboboxContent,
726
- ve as ComboboxEmpty,
727
- Ce as ComboboxGroup,
726
+ Te as Combobox,
727
+ Oe as ComboboxContent,
728
+ Ce as ComboboxEmpty,
729
+ ye as ComboboxGroup,
728
730
  xe as ComboboxInput,
729
- ye as ComboboxItem,
730
- he as ComboboxList,
731
- Oe as ComboboxLoading,
732
- ke as ComboboxSeparator,
733
- me as ComboboxTrigger,
734
- Ae as ComboboxValue,
735
- $e as ComboboxVirtualList
731
+ ke as ComboboxItem,
732
+ ge as ComboboxList,
733
+ ze as ComboboxLoading,
734
+ Ie as ComboboxSeparator,
735
+ pe as ComboboxTrigger,
736
+ $e as ComboboxValue,
737
+ je as ComboboxVirtualList
736
738
  };