@brightlocal/ui-components 2.27.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 (259) hide show
  1. package/README.md +6 -1
  2. package/component-meta.json +480 -126
  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-screen.d.ts → progress-state.d.ts} +30 -18
  26. package/dist/blocks/progress-state.d.ts.map +1 -0
  27. package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts.map +1 -1
  30. package/dist/blocks/sidebar.js +160 -161
  31. package/dist/breadcrumb.cjs +1 -1
  32. package/dist/breadcrumb.js +1 -1
  33. package/dist/button.cjs +1 -1
  34. package/dist/button.js +11 -11
  35. package/dist/calendar.cjs +1 -1
  36. package/dist/calendar.d.ts.map +1 -1
  37. package/dist/calendar.js +37 -38
  38. package/dist/callout.cjs +1 -1
  39. package/dist/callout.d.ts +24 -2
  40. package/dist/callout.d.ts.map +1 -1
  41. package/dist/callout.js +57 -55
  42. package/dist/card.cjs +1 -1
  43. package/dist/card.d.ts +23 -2
  44. package/dist/card.d.ts.map +1 -1
  45. package/dist/card.js +94 -91
  46. package/dist/chart-empty.cjs +1 -0
  47. package/dist/chart-empty.d.ts +59 -0
  48. package/dist/chart-empty.d.ts.map +1 -0
  49. package/dist/chart-empty.js +29 -0
  50. package/dist/chart.cjs +6 -6
  51. package/dist/chart.d.ts +6 -1
  52. package/dist/chart.d.ts.map +1 -1
  53. package/dist/chart.js +183 -183
  54. package/dist/chip.cjs +1 -1
  55. package/dist/chip.d.ts.map +1 -1
  56. package/dist/chip.js +5 -3
  57. package/dist/combobox.cjs +2 -2
  58. package/dist/combobox.d.ts.map +1 -1
  59. package/dist/combobox.js +81 -79
  60. package/dist/command.cjs +1 -1
  61. package/dist/command.d.ts.map +1 -1
  62. package/dist/command.js +74 -77
  63. package/dist/context-menu.cjs +1 -1
  64. package/dist/context-menu.d.ts.map +1 -1
  65. package/dist/context-menu.js +26 -29
  66. package/dist/data-table.cjs +1 -1
  67. package/dist/data-table.d.ts +44 -10
  68. package/dist/data-table.d.ts.map +1 -1
  69. package/dist/data-table.js +13 -11
  70. package/dist/description.cjs +1 -1
  71. package/dist/description.js +5 -5
  72. package/dist/dialog.cjs +1 -1
  73. package/dist/dialog.js +20 -20
  74. package/dist/drawer.cjs +1 -1
  75. package/dist/drawer.d.ts.map +1 -1
  76. package/dist/drawer.js +8 -11
  77. package/dist/dropdown-menu.cjs +1 -1
  78. package/dist/dropdown-menu.d.ts.map +1 -1
  79. package/dist/dropdown-menu.js +17 -20
  80. package/dist/field.cjs +1 -1
  81. package/dist/field.d.ts.map +1 -1
  82. package/dist/field.js +29 -25
  83. package/dist/global-layout.cjs +1 -1
  84. package/dist/global-layout.d.ts +27 -1
  85. package/dist/global-layout.d.ts.map +1 -1
  86. package/dist/global-layout.js +18 -16
  87. package/dist/grid.cjs +1 -0
  88. package/dist/grid.d.ts +56 -0
  89. package/dist/grid.d.ts.map +1 -0
  90. package/dist/grid.js +32 -0
  91. package/dist/header.d.ts +13 -0
  92. package/dist/header.d.ts.map +1 -1
  93. package/dist/hooks/use-delayed-pending.cjs +1 -0
  94. package/dist/hooks/use-delayed-pending.d.ts +34 -0
  95. package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
  96. package/dist/hooks/use-delayed-pending.js +17 -0
  97. package/dist/hover-card.cjs +1 -1
  98. package/dist/hover-card.js +13 -13
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.d.ts +8 -1
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +512 -494
  103. package/dist/input-chip.cjs +1 -1
  104. package/dist/input-chip.js +25 -25
  105. package/dist/input-group.cjs +1 -1
  106. package/dist/input-group.js +9 -9
  107. package/dist/input-otp.cjs +1 -1
  108. package/dist/input-otp.js +9 -9
  109. package/dist/input-password.cjs +1 -1
  110. package/dist/input-password.js +51 -51
  111. package/dist/input.cjs +1 -1
  112. package/dist/input.js +9 -9
  113. package/dist/label.cjs +1 -1
  114. package/dist/label.d.ts.map +1 -1
  115. package/dist/label.js +25 -28
  116. package/dist/lib/block-illustration.cjs +1 -0
  117. package/dist/lib/block-illustration.d.ts +28 -0
  118. package/dist/lib/block-illustration.d.ts.map +1 -0
  119. package/dist/lib/block-illustration.js +21 -0
  120. package/dist/lib/empty-canvas.cjs +1 -0
  121. package/dist/lib/empty-canvas.d.ts +27 -0
  122. package/dist/lib/empty-canvas.d.ts.map +1 -0
  123. package/dist/lib/empty-canvas.js +62 -0
  124. package/dist/lib/optical-center.cjs +1 -0
  125. package/dist/lib/optical-center.d.ts +12 -0
  126. package/dist/lib/optical-center.d.ts.map +1 -0
  127. package/dist/lib/optical-center.js +11 -0
  128. package/dist/lib/utils.cjs +1 -1
  129. package/dist/lib/utils.d.ts.map +1 -1
  130. package/dist/lib/utils.js +28 -5
  131. package/dist/list.cjs +1 -1
  132. package/dist/list.d.ts.map +1 -1
  133. package/dist/list.js +62 -58
  134. package/dist/map.cjs +1 -1
  135. package/dist/map.d.ts +60 -2
  136. package/dist/map.d.ts.map +1 -1
  137. package/dist/map.js +187 -164
  138. package/dist/media-empty.cjs +1 -0
  139. package/dist/media-empty.d.ts +72 -0
  140. package/dist/media-empty.d.ts.map +1 -0
  141. package/dist/media-empty.js +45 -0
  142. package/dist/menubar.cjs +1 -1
  143. package/dist/menubar.d.ts.map +1 -1
  144. package/dist/menubar.js +17 -20
  145. package/dist/navigation-menu.cjs +1 -1
  146. package/dist/navigation-menu.js +7 -7
  147. package/dist/pagination.cjs +1 -1
  148. package/dist/pagination.d.ts +127 -1
  149. package/dist/pagination.d.ts.map +1 -1
  150. package/dist/pagination.js +189 -98
  151. package/dist/progress.cjs +1 -1
  152. package/dist/progress.d.ts +2 -26
  153. package/dist/progress.d.ts.map +1 -1
  154. package/dist/progress.js +79 -118
  155. package/dist/select.cjs +2 -2
  156. package/dist/select.d.ts.map +1 -1
  157. package/dist/select.js +19 -18
  158. package/dist/separator.cjs +1 -1
  159. package/dist/separator.js +8 -8
  160. package/dist/sheet.cjs +1 -1
  161. package/dist/sheet.js +2 -2
  162. package/dist/skeleton.cjs +1 -1
  163. package/dist/skeleton.d.ts +38 -3
  164. package/dist/skeleton.d.ts.map +1 -1
  165. package/dist/skeleton.js +43 -20
  166. package/dist/sonner.cjs +1 -1
  167. package/dist/sonner.js +26 -26
  168. package/dist/stepper.cjs +1 -1
  169. package/dist/stepper.js +40 -40
  170. package/dist/table.cjs +1 -1
  171. package/dist/table.d.ts.map +1 -1
  172. package/dist/table.js +31 -28
  173. package/dist/tabs.cjs +1 -1
  174. package/dist/tabs.js +1 -1
  175. package/dist/text-reveal-motion.d.ts +10 -0
  176. package/dist/text-reveal-motion.d.ts.map +1 -1
  177. package/dist/textarea.cjs +1 -1
  178. package/dist/textarea.js +11 -11
  179. package/dist/toggle.cjs +1 -1
  180. package/dist/toggle.js +8 -8
  181. package/dist/tooltip.cjs +1 -1
  182. package/dist/tooltip.js +8 -8
  183. package/dist/typography-heading.cjs +1 -0
  184. package/dist/typography-heading.d.ts +116 -0
  185. package/dist/typography-heading.d.ts.map +1 -0
  186. package/dist/typography-heading.js +84 -0
  187. package/dist/typography-text.cjs +1 -0
  188. package/dist/typography-text.d.ts +113 -0
  189. package/dist/typography-text.d.ts.map +1 -0
  190. package/dist/typography-text.js +81 -0
  191. package/dist/typography.d.ts +13 -0
  192. package/dist/typography.d.ts.map +1 -1
  193. package/package.json +35 -7
  194. package/src/blocks/empty-state.tsx +424 -0
  195. package/src/blocks/input-list.tsx +66 -36
  196. package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
  197. package/src/blocks/sidebar.tsx +25 -26
  198. package/src/components/accordion.tsx +2 -2
  199. package/src/components/alert-dialog.tsx +2 -2
  200. package/src/components/alert.tsx +27 -13
  201. package/src/components/avatar.tsx +1 -1
  202. package/src/components/badge.tsx +8 -4
  203. package/src/components/breadcrumb.tsx +1 -1
  204. package/src/components/button.tsx +3 -3
  205. package/src/components/calendar.tsx +5 -6
  206. package/src/components/callout.tsx +48 -15
  207. package/src/components/card.tsx +52 -17
  208. package/src/components/chart-empty.tsx +116 -0
  209. package/src/components/chart.tsx +43 -17
  210. package/src/components/chip.tsx +5 -3
  211. package/src/components/combobox.tsx +12 -10
  212. package/src/components/command.tsx +9 -10
  213. package/src/components/context-menu.tsx +6 -9
  214. package/src/components/data-table.tsx +72 -17
  215. package/src/components/description.tsx +1 -1
  216. package/src/components/dialog.tsx +2 -2
  217. package/src/components/drawer.tsx +2 -5
  218. package/src/components/dropdown-menu.tsx +8 -11
  219. package/src/components/field.tsx +8 -4
  220. package/src/components/global-layout.tsx +36 -3
  221. package/src/components/grid.tsx +130 -0
  222. package/src/components/header.tsx +13 -0
  223. package/src/components/hover-card.tsx +1 -1
  224. package/src/components/input-chip.tsx +1 -1
  225. package/src/components/input-group.tsx +1 -1
  226. package/src/components/input-otp.tsx +1 -1
  227. package/src/components/input-password.tsx +1 -1
  228. package/src/components/input.tsx +1 -1
  229. package/src/components/label.tsx +10 -13
  230. package/src/components/list.tsx +13 -9
  231. package/src/components/map.tsx +101 -5
  232. package/src/components/media-empty.tsx +156 -0
  233. package/src/components/menubar.tsx +7 -10
  234. package/src/components/navigation-menu.tsx +1 -1
  235. package/src/components/pagination.tsx +279 -1
  236. package/src/components/progress.tsx +35 -113
  237. package/src/components/select.tsx +5 -4
  238. package/src/components/separator.tsx +1 -1
  239. package/src/components/sheet.tsx +2 -2
  240. package/src/components/skeleton.tsx +78 -7
  241. package/src/components/sonner.tsx +2 -2
  242. package/src/components/stepper.tsx +3 -3
  243. package/src/components/table.tsx +6 -3
  244. package/src/components/tabs.tsx +1 -1
  245. package/src/components/text-reveal-motion.tsx +10 -0
  246. package/src/components/textarea.tsx +1 -1
  247. package/src/components/toggle.tsx +1 -1
  248. package/src/components/tooltip.tsx +1 -1
  249. package/src/components/typography-heading.tsx +229 -0
  250. package/src/components/typography-text.tsx +225 -0
  251. package/src/components/typography.tsx +13 -0
  252. package/src/hooks/use-delayed-pending.ts +60 -0
  253. package/src/index.ts +10 -1
  254. package/src/lib/block-illustration.tsx +88 -0
  255. package/src/lib/empty-canvas.tsx +128 -0
  256. package/src/lib/optical-center.tsx +45 -0
  257. package/src/lib/utils.ts +26 -0
  258. package/dist/blocks/progress-screen.cjs +0 -1
  259. package/dist/blocks/progress-screen.d.ts.map +0 -1
@@ -4,10 +4,15 @@ import * as React from "react";
4
4
 
5
5
  import { cn } from "@brightlocal/ui-components/lib/utils";
6
6
  import { Progress } from "../components/progress";
7
- import { TypographyH2, TypographyMuted } from "../components/typography";
7
+ import { TypographyHeading } from "../components/typography-heading";
8
+ import { TypographyText } from "../components/typography-text";
9
+ import {
10
+ BLOCK_ILLUSTRATION_SIZE,
11
+ BlockIllustration,
12
+ } from "../lib/block-illustration";
8
13
 
9
14
  /* -------------------------------------------------------------------------------------------------
10
- * ProgressScreen
15
+ * ProgressState
11
16
  *
12
17
  * The Progress screen pattern (Patterns/Loading → Progress screen) as a block:
13
18
  * the state
@@ -15,22 +20,28 @@ import { TypographyH2, TypographyMuted } from "../components/typography";
15
20
  * seconds. It answers what the person is actually asking: is it working, what is
16
21
  * it doing, can I leave?
17
22
  *
18
- * The block owns what every tool shares — the centred column, the heading and
23
+ * The block owns what every tool shares — the column, the heading and
19
24
  * description treatment, the busy semantics, the live region, and the spacing.
20
- * The tool supplies the copy, and the illustration where there is one.
25
+ * The tool supplies the copy, and the illustration where there is one. Pure
26
+ * content: WHERE the screen sits is the consumer's composition — the page
27
+ * recipe is `<Grid variant="centered">` around it, the same optical spot an
28
+ * empty page uses, so the two never shift the furniture between them.
21
29
  *
22
30
  * There are exactly two states, and `value` picks between them:
23
31
  * value set → the tool's illustration over a determinate bar showing real
24
- * backend progress, with the step named above it.
25
- * value not set → the cel loop and nothing else: no bar, and no status line
26
- * either, because the status line belongs to Progress and
27
- * goes where the bar goes. The motion says the run is alive
28
- * and the description says the rest.
32
+ * backend progress.
33
+ * value not set → the cel loop and nothing else: no bar, because there is
34
+ * nothing to measure. The motion says the run is alive and
35
+ * the description says the rest.
29
36
  * Never invent a percentage to get the first one.
37
+ *
38
+ * Neither state names the current step. A step line was tried and removed:
39
+ * `description` already carries what the run is doing, and it is the live
40
+ * region, so a second moving line beside it was two voices for one wait.
30
41
  * -----------------------------------------------------------------------------------------------*/
31
42
 
32
43
  /* -------------------------------------------------------------------------------------------------
33
- * ProgressScreenCelMotion (private)
44
+ * ProgressStateCelMotion (private)
34
45
  *
35
46
  * A hand-drawn cel loop: a sheet leaves the shop, folds into a paper plane,
36
47
  * flies across and drops into a folder, and both containers take a small knock
@@ -240,16 +251,29 @@ function CelFolder() {
240
251
  }
241
252
 
242
253
  /** The whole cel stage: an inline-size container every layer is measured in. */
243
- function ProgressScreenCelMotion() {
254
+ function ProgressStateCelMotion() {
244
255
  return (
245
256
  <div
246
257
  aria-hidden="true"
247
258
  className="text-foreground w-full max-w-lg"
248
- data-slot="progress-screen-motion"
259
+ data-slot="progress-state-motion"
249
260
  style={{ containerType: "inline-size" }}
250
261
  >
262
+ {/* The drawn composition does not fill its stage evenly — the shop
263
+ starts 6.6% in from the left edge while the folder ends 12.1% in
264
+ from the right — so the artwork's own centre sits 2.734% left of the
265
+ stage's. Left uncorrected it reads as the whole illustration being
266
+ off-axis from the title under it, since the title centres on the
267
+ stage box and the eye centres on the ink. Shifting the composition,
268
+ not the drawing: every layer keeps its coordinates relative to the
269
+ others.
270
+
271
+ A percentage, not the `cqw` the layers inside use: translateX
272
+ resolves a percentage against the element's own width, and this
273
+ element is the full stage width, so the two are the same number here
274
+ — and a percentage needs no container context to resolve. */}
251
275
  <div
252
- className="relative w-full"
276
+ className="relative w-full translate-x-[2.734%]"
253
277
  style={{ aspectRatio: CEL_STAGE_ASPECT }}
254
278
  >
255
279
  <CelStore />
@@ -262,10 +286,10 @@ function ProgressScreenCelMotion() {
262
286
  }
263
287
 
264
288
  /**
265
- * Props for the ProgressScreen block.
289
+ * Props for the ProgressState block.
266
290
  * Extends native `section` props; `title` is overridden to accept rich content.
267
291
  */
268
- export interface ProgressScreenProps extends Omit<
292
+ export interface ProgressStateProps extends Omit<
269
293
  React.ComponentPropsWithoutRef<"section">,
270
294
  "title" | "children"
271
295
  > {
@@ -282,7 +306,14 @@ export interface ProgressScreenProps extends Omit<
282
306
  * the thing being generated. The indeterminate state falls back to the cel
283
307
  * loop, which is doing the work the missing progress bar cannot — pass an
284
308
  * illustration there only if you mean to trade that motion away.
285
- * @example <MapMagnifyingGlassSearchLocation aria-hidden size={200} />
309
+ *
310
+ * Pass the illustration itself — do NOT set a size. The block renders it
311
+ * at the 130 the design specifies, whatever size the element carries, so
312
+ * there is no number to get wrong per call site. The illustration is the
313
+ * title's companion, not the subject of the screen: much larger and it
314
+ * outweighs the 24px heading under it, and the eye lands on the artwork
315
+ * instead of the words that say what is happening.
316
+ * @example <MapMagnifyingGlassSearchLocation aria-hidden />
286
317
  */
287
318
  illustration?: React.ReactNode;
288
319
  /**
@@ -317,14 +348,6 @@ export interface ProgressScreenProps extends Omit<
317
348
  * @default true
318
349
  */
319
350
  showProgressValue?: boolean;
320
- /**
321
- * The step the run is on right now, shown on its own line above the bar.
322
- * Determinate state only — it belongs to Progress, so it goes where the bar
323
- * goes. On the indeterminate state, put anything the run can say about
324
- * itself in `description`.
325
- * @example "Scanning search results across your area"
326
- */
327
- progressStatusDescription?: React.ReactNode;
328
351
  /**
329
352
  * Accessible label for the progress bar. Determinate state only.
330
353
  * @default "Generation progress"
@@ -353,24 +376,23 @@ export interface ProgressScreenProps extends Omit<
353
376
  * @example
354
377
  * ```tsx
355
378
  * // The backend reports real progress.
356
- * <ProgressScreen
379
+ * <ProgressState
357
380
  * dataHook="lsg-generating"
358
- * illustration={<MapMagnifyingGlassSearchLocation aria-hidden size={200} />}
381
+ * illustration={<MapMagnifyingGlassSearchLocation aria-hidden />}
359
382
  * title={t("reports.building.title")}
360
383
  * description={t("reports.building.description")}
361
- * progressStatusDescription={t(`reports.building.stages.${run.stage}`)}
362
384
  * value={run.percent}
363
385
  * />
364
386
  *
365
387
  * // It reports nothing, but the run is underway.
366
- * <ProgressScreen
388
+ * <ProgressState
367
389
  * dataHook="lsg-generating"
368
390
  * title={t("reports.building.title")}
369
391
  * description={t("reports.building.description")}
370
392
  * />
371
393
  * ```
372
394
  */
373
- const ProgressScreen = React.forwardRef<HTMLElement, ProgressScreenProps>(
395
+ const ProgressState = React.forwardRef<HTMLElement, ProgressStateProps>(
374
396
  (
375
397
  {
376
398
  className,
@@ -382,7 +404,6 @@ const ProgressScreen = React.forwardRef<HTMLElement, ProgressScreenProps>(
382
404
  max = 100,
383
405
  progressUnit = "%",
384
406
  showProgressValue = true,
385
- progressStatusDescription,
386
407
  progressLabel,
387
408
  trackingEl,
388
409
  trackingLabel,
@@ -397,85 +418,125 @@ const ProgressScreen = React.forwardRef<HTMLElement, ProgressScreenProps>(
397
418
  <section
398
419
  ref={ref}
399
420
  aria-busy="true"
400
- className={cn("flex flex-1 flex-col items-center", className)}
421
+ className={cn("flex w-full flex-col items-center", className)}
401
422
  data-hook={dataHook}
402
- data-slot="progress-screen"
403
- data-tracking-el={trackingEl ?? "progress-screen"}
423
+ data-slot="progress-state"
424
+ data-tracking-el={trackingEl ?? "progress-state"}
404
425
  data-tracking-label={trackingLabel}
405
426
  {...props}
406
427
  >
407
- {/* Optically centred, not mathematically. A block centred by the maths
408
- reads as sitting low, so the spacer below is the larger of the two —
409
- roughly 45/55. Both are flexible, so in a container with no room to
410
- spare they collapse together and the content simply centres rather
411
- than overflowing. */}
412
- <div aria-hidden="true" className="flex-1" />
413
-
414
- <div className="flex w-full flex-col items-center gap-8">
428
+ {/* 24px between the illustration and the text block (spacing/6 in
429
+ Figma) — the artwork needs more air than the copy; the title,
430
+ the description and the bar keep their own 16px rhythm below. */}
431
+ <div className="flex w-full flex-col items-center gap-6">
415
432
  {illustration ? (
416
- <div data-slot="progress-screen-illustration">{illustration}</div>
433
+ <BlockIllustration
434
+ size={BLOCK_ILLUSTRATION_SIZE}
435
+ slot="progress-state-illustration"
436
+ >
437
+ {illustration}
438
+ </BlockIllustration>
417
439
  ) : hasProgress ? null : (
418
- <ProgressScreenCelMotion />
440
+ <ProgressStateCelMotion />
419
441
  )}
420
442
 
421
- <div
422
- className="flex w-full max-w-xl flex-col gap-2"
423
- data-slot="progress-screen-text"
424
- >
425
- <TypographyH2 align="center" dataHook={`${dataHook}-title`}>
426
- {title}
427
- </TypographyH2>
428
- {description ? (
429
- /* Polite, not assertive: real stages are minutes apart, so this
430
- announces a handful of times across a run — never on a tick. */
431
- <div aria-live="polite" data-slot="progress-screen-description">
432
- <TypographyMuted
433
- align="center"
434
- dataHook={`${dataHook}-description`}
443
+ <div className="flex w-full flex-col items-center gap-4">
444
+ {/* The title and its description are the one pair that sits
445
+ tighter, at 8px: they are a heading and its own supporting
446
+ line, not two items in the stack. It also corrects for the
447
+ type — the 24/32 title carries 4px of leading below it and
448
+ the 14/20 description 3px above, so a 16px box gap draws 23px
449
+ and reads looser here than anywhere else in the column. 8px
450
+ lands at ~15px optical. */}
451
+ <div
452
+ className="flex w-full flex-col items-center gap-2"
453
+ data-slot="progress-state-text"
454
+ >
455
+ {/* `page` is the scale's 24px Poppins role — the size the design
456
+ specifies. Level 2, not 1: the running state is the page
457
+ body under the layout's own page header. */}
458
+ <TypographyHeading
459
+ align="center"
460
+ dataHook={`${dataHook}-title`}
461
+ level={2}
462
+ variant="page"
463
+ >
464
+ {title}
465
+ </TypographyHeading>
466
+ {description ? (
467
+ /* Polite, not assertive: real stages are minutes apart, so
468
+ this announces a handful of times across a run — never on a
469
+ tick.
470
+
471
+ Capped narrower than the bar (28rem against the bar's
472
+ 32rem), so the copy breaks into short centred lines instead
473
+ of running the full width of the indicator under it. */
474
+ <div
475
+ aria-live="polite"
476
+ className="max-w-md"
477
+ data-slot="progress-state-description"
435
478
  >
436
- {description}
437
- </TypographyMuted>
479
+ <TypographyText
480
+ align="center"
481
+ color="muted"
482
+ dataHook={`${dataHook}-description`}
483
+ variant="body-sm"
484
+ >
485
+ {description}
486
+ </TypographyText>
487
+ </div>
488
+ ) : null}
489
+ </div>
490
+
491
+ {/* The bar is the whole of the determinate state's apparatus, and
492
+ it only exists when there is a number behind it — the
493
+ indeterminate state has none, and the cel loop says the run is
494
+ alive while the description says the rest. */}
495
+ {hasProgress ? (
496
+ /* `justify-center` keeps the bar on the same axis as the title
497
+ and description above it; the value keeps its own
498
+ `text-right` against the bar. */
499
+ <div
500
+ className="flex w-full max-w-xl justify-center"
501
+ data-slot="progress-state-indicator"
502
+ >
503
+ {/* `sm` — the bar sits under a display title and a muted
504
+ description, so the roomier `md` reads as heavy here: it
505
+ outweighs the text it is meant to support. */}
506
+ <Progress
507
+ ariaLabel={progressLabel ?? "Generation progress"}
508
+ dataHook={`${dataHook}-progress`}
509
+ max={max}
510
+ showValue={showProgressValue}
511
+ size="sm"
512
+ unit={progressUnit}
513
+ value={value ?? undefined}
514
+ />
438
515
  </div>
439
516
  ) : null}
440
517
  </div>
441
-
442
- {/* The indicator is the whole of the determinate state's apparatus:
443
- the bar and the status line are one thing, and the status line is
444
- Progress's, not the block's. With no bar there is nothing to hang
445
- it on, so the indeterminate state has neither — the cel loop says
446
- the run is alive and the description says the rest. */}
447
- {hasProgress ? (
448
- /* `text-center` centres the Progress status line with the title and
449
- description above it — on this screen everything sits on one axis,
450
- where a left-aligned status reads as a misalignment. It works by
451
- inheritance: the status sets no alignment of its own, while the
452
- value keeps its explicit `text-right` against the bar. */
453
- <div
454
- className="flex w-full max-w-xl justify-center text-center"
455
- data-slot="progress-screen-indicator"
456
- >
457
- {/* `md` — this is a full page, not a metric row in a card, so the
458
- bar and its text take the roomier of the two sizes. */}
459
- <Progress
460
- ariaLabel={progressLabel ?? "Generation progress"}
461
- dataHook={`${dataHook}-progress`}
462
- max={max}
463
- showValue={showProgressValue}
464
- size="md"
465
- statusDescription={progressStatusDescription}
466
- unit={progressUnit}
467
- value={value ?? undefined}
468
- />
469
- </div>
470
- ) : null}
471
518
  </div>
472
-
473
- <div aria-hidden="true" className="flex-[1.3]" />
474
519
  </section>
475
520
  );
476
521
  }
477
522
  );
478
523
 
479
- ProgressScreen.displayName = "ProgressScreen";
524
+ ProgressState.displayName = "ProgressState";
525
+
526
+ /**
527
+ * The block's previous name.
528
+ *
529
+ * @deprecated Use `ProgressState`. The suffix says what the component owns: a
530
+ * named state of a surface, at every scope it has — and this one already served
531
+ * a section boundary as well as a page. `ProgressScreen` will be removed in the
532
+ * next major; the import path `@brightlocal/ui-components/progress-screen` still
533
+ * resolves to this file in the meantime (DS-931).
534
+ */
535
+ const ProgressScreen = ProgressState;
480
536
 
481
- export { ProgressScreen };
537
+ export { ProgressState, ProgressScreen };
538
+
539
+ /**
540
+ * @deprecated Use `ProgressStateProps`.
541
+ */
542
+ export type ProgressScreenProps = ProgressStateProps;
@@ -864,15 +864,15 @@ SidebarGroup.displayName = "SidebarGroup";
864
864
 
865
865
  const sidebarGroupLabelVariants = cva(
866
866
  [
867
- "flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-base ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
867
+ "flex h-8 shrink-0 items-center rounded-md px-2 text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-base ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
868
868
  SIDEBAR_FOCUS_RING,
869
869
  ],
870
870
  {
871
871
  variants: {
872
872
  size: {
873
- default: "text-sm",
874
- sm: "text-sm",
875
- xs: "text-xs",
873
+ default: "text-label",
874
+ sm: "text-label",
875
+ xs: "text-label-sm",
876
876
  },
877
877
  variant: {
878
878
  default: "",
@@ -1050,7 +1050,7 @@ const SidebarGroupContent = React.forwardRef<
1050
1050
  >(({ className, dataHook, ...props }, ref) => (
1051
1051
  <div
1052
1052
  ref={ref}
1053
- className={cn("w-full text-sm", className)}
1053
+ className={cn("text-body-sm w-full", className)}
1054
1054
  data-hook={dataHook}
1055
1055
  data-slot="sidebar-group-content"
1056
1056
  {...props}
@@ -1160,7 +1160,7 @@ SidebarCollapseIcon.displayName = "SidebarCollapseIcon";
1160
1160
 
1161
1161
  const sidebarMenuButtonVariants = cva(
1162
1162
  [
1163
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-full px-4 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",
1163
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-full px-4 py-2 text-left text-label outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",
1164
1164
  SIDEBAR_FOCUS_RING,
1165
1165
  ],
1166
1166
  {
@@ -1183,9 +1183,9 @@ const sidebarMenuButtonVariants = cva(
1183
1183
  "px-3 [&>[data-checkbox]]:size-4 [&>[data-checkbox]]:shrink-0 [&>[data-checkbox]]:rounded [&>[data-checkbox]]:border [&>[data-checkbox]]:border-sidebar-foreground/30 data-[checked=true]:[&>[data-checkbox]]:bg-primary data-[checked=true]:[&>[data-checkbox]]:border-primary data-[checked=true]:[&>[data-checkbox]]:text-primary-foreground",
1184
1184
  },
1185
1185
  size: {
1186
- default: "h-12 text-sm/4",
1187
- sm: "h-7 text-xs/4",
1188
- lg: "h-12 text-sm/4 group-data-[collapsible=icon]:!p-0",
1186
+ default: "h-12",
1187
+ sm: "h-7 text-label-sm",
1188
+ lg: "h-12 group-data-[collapsible=icon]:!p-0",
1189
1189
  },
1190
1190
  },
1191
1191
  defaultVariants: {
@@ -1349,7 +1349,7 @@ const SidebarMenuBadge = React.forwardRef<
1349
1349
  <div
1350
1350
  ref={ref}
1351
1351
  className={cn(
1352
- "text-sidebar-foreground pointer-events-none absolute inset-y-0 right-4 my-auto flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
1352
+ "text-sidebar-foreground text-label-sm pointer-events-none absolute inset-y-0 right-4 my-auto flex h-5 min-w-5 items-center justify-center rounded-md px-1 tabular-nums select-none",
1353
1353
  "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
1354
1354
  "group-data-[collapsible=icon]:hidden",
1355
1355
  className
@@ -1524,11 +1524,10 @@ const SidebarMenuSubButton = React.forwardRef<
1524
1524
  <Comp
1525
1525
  ref={ref}
1526
1526
  className={cn(
1527
- "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground duration-fast flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] ease-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",
1527
+ "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground text-label duration-fast flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] ease-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",
1528
1528
  SIDEBAR_FOCUS_RING,
1529
1529
  "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
1530
- size === SidebarMenuSubButtonSize.SM && "text-xs",
1531
- size === SidebarMenuSubButtonSize.MD && "text-sm",
1530
+ size === SidebarMenuSubButtonSize.SM && "text-label-sm",
1532
1531
  "group-data-[collapsible=icon]:hidden",
1533
1532
  className
1534
1533
  )}
@@ -1816,7 +1815,7 @@ const SidebarPopoverTrigger = React.forwardRef<
1816
1815
  ref={ref}
1817
1816
  aria-label={triggerAriaLabel ?? "Switch workspace"}
1818
1817
  className={cn(
1819
- "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors ease-out outline-none",
1818
+ "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast text-heading-compact flex items-center gap-2 rounded-md px-1.5 py-2 transition-colors ease-out outline-none",
1820
1819
  SIDEBAR_FOCUS_RING,
1821
1820
  className
1822
1821
  )}
@@ -1868,7 +1867,7 @@ const SidebarPopoverMenuItem = React.forwardRef<
1868
1867
  <button
1869
1868
  ref={ref}
1870
1869
  className={cn(
1871
- "text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors ease-out outline-none",
1870
+ "text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast text-label flex h-10 w-full items-center gap-2 rounded-xs p-2 transition-colors ease-out outline-none",
1872
1871
  SIDEBAR_FOCUS_RING,
1873
1872
  className
1874
1873
  )}
@@ -1884,7 +1883,7 @@ const SidebarPopoverMenuItem = React.forwardRef<
1884
1883
  )}
1885
1884
  <span className="min-w-px flex-1 truncate text-left">{children}</span>
1886
1885
  {shortcut && (
1887
- <span className="text-popover-foreground/60 shrink-0 text-xs">
1886
+ <span className="text-popover-foreground/60 text-body-xs shrink-0">
1888
1887
  {shortcut}
1889
1888
  </span>
1890
1889
  )}
@@ -1966,7 +1965,7 @@ const SidebarPopoverMenu = React.forwardRef<
1966
1965
  <div className="flex flex-col items-start p-1">
1967
1966
  {groupTitle && (
1968
1967
  <div className="flex w-full items-center px-2 py-1.5">
1969
- <span className="text-muted-foreground flex-1 text-xs font-medium">
1968
+ <span className="text-muted-foreground text-label-sm flex-1">
1970
1969
  {groupTitle}
1971
1970
  </span>
1972
1971
  </div>
@@ -2144,9 +2143,9 @@ function SidebarAccountDropdown({
2144
2143
  size={SidebarMenuButtonSize.LG}
2145
2144
  >
2146
2145
  {avatar}
2147
- <div className="flex min-w-0 flex-1 flex-col gap-0.5 leading-none">
2148
- <span className="truncate text-sm font-semibold">{name}</span>
2149
- <span className="truncate text-xs font-normal">{email}</span>
2146
+ <div className="flex min-w-0 flex-1 flex-col gap-0.5">
2147
+ <span className="text-heading-compact truncate">{name}</span>
2148
+ <span className="text-body-xs truncate">{email}</span>
2150
2149
  </div>
2151
2150
  {/* Dropdown affordance per the DS-860 Figma account row */}
2152
2151
  <ChevronsUpDown className="shrink-0" />
@@ -2163,9 +2162,9 @@ function SidebarAccountDropdown({
2163
2162
  <>
2164
2163
  <DropdownMenuLabel className="flex items-center gap-2 px-1 py-1.5">
2165
2164
  {avatar}
2166
- <div className="flex min-w-0 flex-1 flex-col gap-0.5 leading-none">
2167
- <span className="truncate text-sm font-semibold">{name}</span>
2168
- <span className="truncate text-xs font-normal">{email}</span>
2165
+ <div className="flex min-w-0 flex-1 flex-col gap-0.5">
2166
+ <span className="text-heading-compact truncate">{name}</span>
2167
+ <span className="text-body-xs truncate">{email}</span>
2169
2168
  </div>
2170
2169
  </DropdownMenuLabel>
2171
2170
  {menuGroups?.map((group, groupIndex) => (
@@ -2246,13 +2245,13 @@ const SidebarInboxItem = React.forwardRef<
2246
2245
  type="button"
2247
2246
  {...props}
2248
2247
  >
2249
- <div className="flex w-full items-center justify-between text-sm">
2248
+ <div className="text-body-sm flex w-full items-center justify-between">
2250
2249
  <span>{senderName}</span>
2251
2250
  {timestamp && <span>{timestamp}</span>}
2252
2251
  </div>
2253
- <p className="w-full text-sm font-medium">{title}</p>
2252
+ <p className="text-heading-compact w-full">{title}</p>
2254
2253
  {description && (
2255
- <p className="w-full truncate text-xs">{description}</p>
2254
+ <p className="text-body-xs w-full truncate">{description}</p>
2256
2255
  )}
2257
2256
  </button>
2258
2257
  );
@@ -178,7 +178,7 @@ const AccordionTrigger = React.forwardRef<
178
178
  <AccordionPrimitive.Trigger
179
179
  ref={ref}
180
180
  className={cn(
181
- "focus-visible:border-ring focus-visible:shadow-default duration-fast flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-shadow ease-out outline-none hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
181
+ "focus-visible:border-ring focus-visible:shadow-default duration-fast text-label flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left transition-shadow ease-out outline-none hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
182
182
  className
183
183
  )}
184
184
  data-slot="accordion-trigger"
@@ -215,7 +215,7 @@ const AccordionContent = React.forwardRef<
215
215
  >(({ className, children, ...props }, ref) => (
216
216
  <AccordionPrimitive.Content
217
217
  ref={ref}
218
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
218
+ className="text-body-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden"
219
219
  data-slot="accordion-content"
220
220
  {...props}
221
221
  >
@@ -156,7 +156,7 @@ const AlertDialogTitle = React.forwardRef<
156
156
  >(({ className, dataHook, ...props }, ref) => (
157
157
  <AlertDialogPrimitive.Title
158
158
  ref={ref}
159
- className={cn("text-lg font-semibold", className)}
159
+ className={cn("text-heading-section", className)}
160
160
  data-hook={dataHook}
161
161
  data-slot="alert-dialog-title"
162
162
  {...props}
@@ -184,7 +184,7 @@ const AlertDialogDescription = React.forwardRef<
184
184
  >(({ className, dataHook, ...props }, ref) => (
185
185
  <AlertDialogPrimitive.Description
186
186
  ref={ref}
187
- className={cn("text-muted-foreground text-sm", className)}
187
+ className={cn("text-body-sm text-muted-foreground", className)}
188
188
  data-hook={dataHook}
189
189
  data-slot="alert-dialog-description"
190
190
  {...props}
@@ -1,11 +1,12 @@
1
1
  import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
2
3
  import { cva, type VariantProps } from "class-variance-authority";
3
4
  import { CircleCheck, Info, CircleX, TriangleAlert } from "@brightlocal/icons";
4
5
 
5
6
  import { cn } from "@brightlocal/ui-components/lib/utils";
6
7
 
7
8
  const alertVariants = cva(
8
- "relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start",
9
+ "relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",
9
10
  {
10
11
  variants: {
11
12
  variant: {
@@ -37,17 +38,29 @@ const Alert = React.forwardRef<
37
38
  ));
38
39
  Alert.displayName = "Alert";
39
40
 
40
- const AlertTitle = React.forwardRef<
41
- HTMLDivElement,
42
- React.HTMLAttributes<HTMLDivElement>
43
- >(({ className, ...props }, ref) => (
44
- <div
45
- ref={ref}
46
- className={cn("leading-5 font-medium break-words", className)}
47
- data-slot="alert-title"
48
- {...props}
49
- />
50
- ));
41
+ interface AlertTitleProps extends React.HTMLAttributes<HTMLDivElement> {
42
+ /**
43
+ * Render the title as its child element (e.g. an `h2`–`h6`) so consumers
44
+ * can opt the alert title into the document outline at the level their
45
+ * page calls for.
46
+ * @default false
47
+ */
48
+ asChild?: boolean;
49
+ }
50
+
51
+ const AlertTitle = React.forwardRef<HTMLDivElement, AlertTitleProps>(
52
+ ({ className, asChild = false, ...props }, ref) => {
53
+ const Comp = asChild ? Slot : "div";
54
+ return (
55
+ <Comp
56
+ ref={ref}
57
+ className={cn("text-heading-compact break-words", className)}
58
+ data-slot="alert-title"
59
+ {...props}
60
+ />
61
+ );
62
+ }
63
+ );
51
64
  AlertTitle.displayName = "AlertTitle";
52
65
 
53
66
  const AlertDescription = React.forwardRef<
@@ -56,7 +69,7 @@ const AlertDescription = React.forwardRef<
56
69
  >(({ className, ...props }, ref) => (
57
70
  <div
58
71
  ref={ref}
59
- className={cn("text-sm leading-5 font-normal [&_p]:leading-5", className)}
72
+ className={cn("text-body-sm [&_p]:leading-5", className)}
60
73
  data-slot="alert-description"
61
74
  {...props}
62
75
  />
@@ -247,3 +260,4 @@ export {
247
260
  AlertDestructive,
248
261
  AlertWarning,
249
262
  };
263
+ export type { AlertTitleProps };
@@ -91,7 +91,7 @@ const AvatarFallback = React.forwardRef<
91
91
  <AvatarPrimitive.Fallback
92
92
  ref={ref}
93
93
  className={cn(
94
- "bg-muted text-foreground flex size-full items-center justify-center rounded-full text-sm",
94
+ "text-body-sm bg-muted text-foreground flex size-full items-center justify-center rounded-full",
95
95
  className
96
96
  )}
97
97
  data-slot="avatar-fallback"
@@ -8,10 +8,14 @@ const badgeVariants = cva(
8
8
  [
9
9
  // Layout
10
10
  "inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden",
11
- // Spacing & shape
12
- "rounded-full border px-2 py-1",
13
- // Typography
14
- "text-xs font-semibold whitespace-nowrap leading-none",
11
+ // Spacing & shape — 2px vertical padding around the 16px line box keeps the
12
+ // content box 20px, matching the Figma frame (its stroke sits inside); the
13
+ // 1px border makes the rendered box 22px, unchanged from the pre-scale
14
+ // `leading-none` + py-1 stack (DS-925)
15
+ "rounded-full border px-2 py-0.5",
16
+ // Typography — type-scale role for badges (12/16 Figma 500; the weight
17
+ // drop from the old semibold is intentional, DS-925)
18
+ "text-label-sm whitespace-nowrap",
15
19
  // Icons
16
20
  "[&>svg]:size-3 [&>svg]:pointer-events-none",
17
21
  // Transition