@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
@@ -195,7 +195,7 @@ const DropdownMenuItem = React.forwardRef<
195
195
  className={cn(
196
196
  [
197
197
  "relative flex cursor-default items-center gap-2 self-stretch select-none",
198
- "rounded-sm px-2 py-1.5 text-sm leading-normal outline-hidden",
198
+ "text-label rounded-sm px-2 py-1.5 outline-hidden",
199
199
  // Text truncation for child text elements
200
200
  "[&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap",
201
201
  "focus:bg-accent focus:text-accent-foreground",
@@ -263,7 +263,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
263
263
  className={cn(
264
264
  [
265
265
  "relative flex cursor-default items-center gap-2 select-none",
266
- "rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden",
266
+ "text-label rounded-sm py-1.5 pr-2 pl-8 outline-hidden",
267
267
  "focus:bg-accent focus:text-accent-foreground",
268
268
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
269
269
  // Icon styling
@@ -335,7 +335,7 @@ const DropdownMenuRadioItem = React.forwardRef<
335
335
  className={cn(
336
336
  [
337
337
  "relative flex cursor-default items-center gap-2 select-none",
338
- "rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden",
338
+ "text-label rounded-sm py-1.5 pr-2 pl-8 outline-hidden",
339
339
  "focus:bg-accent focus:text-accent-foreground",
340
340
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
341
341
  // Icon styling
@@ -387,10 +387,7 @@ const DropdownMenuLabel = React.forwardRef<
387
387
  <DropdownMenuPrimitive.Label
388
388
  ref={ref}
389
389
  className={cn(
390
- [
391
- "px-2 py-1.5 text-sm leading-normal font-semibold",
392
- "data-[inset]:pl-8",
393
- ],
390
+ ["text-label-sm px-2 py-1.5", "data-[inset]:pl-8"],
394
391
  className
395
392
  )}
396
393
  data-hook={dataHook}
@@ -432,7 +429,7 @@ function DropdownMenuShortcut({
432
429
  return (
433
430
  <span
434
431
  className={cn(
435
- ["text-popover-foreground ml-auto text-xs leading-normal opacity-60"],
432
+ ["text-popover-foreground text-body-xs ml-auto opacity-60"],
436
433
  className
437
434
  )}
438
435
  data-slot="dropdown-menu-shortcut"
@@ -500,7 +497,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
500
497
  className={cn(
501
498
  [
502
499
  "flex cursor-default items-center gap-2 select-none",
503
- "rounded-sm px-2 py-1.5 text-sm outline-hidden",
500
+ "text-label rounded-sm px-2 py-1.5 outline-hidden",
504
501
  "focus:bg-accent focus:text-accent-foreground",
505
502
  "data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
506
503
  "data-[inset]:pl-8",
@@ -634,11 +631,11 @@ const DropdownMenuTriggerAvatar = React.forwardRef<
634
631
  >
635
632
  {avatar}
636
633
  <div className="flex min-w-0 flex-1 flex-col items-start">
637
- <span className="w-full overflow-hidden text-sm leading-normal font-semibold text-ellipsis whitespace-nowrap">
634
+ <span className="text-heading-compact w-full overflow-hidden text-ellipsis whitespace-nowrap">
638
635
  {title}
639
636
  </span>
640
637
  {description && (
641
- <span className="text-muted-foreground w-full overflow-hidden text-xs leading-normal text-ellipsis whitespace-nowrap">
638
+ <span className="text-muted-foreground text-body-xs w-full overflow-hidden text-ellipsis whitespace-nowrap">
642
639
  {description}
643
640
  </span>
644
641
  )}
@@ -49,9 +49,9 @@ function FieldLegend({
49
49
  return (
50
50
  <legend
51
51
  className={cn(
52
- "mb-3 font-medium",
53
- "data-[variant=legend]:text-base",
54
- "data-[variant=label]:text-sm",
52
+ "mb-3",
53
+ "data-[variant=legend]:text-heading-subsection",
54
+ "data-[variant=label]:text-label",
55
55
  srOnly && "sr-only",
56
56
  className
57
57
  )}
@@ -98,6 +98,9 @@ const fieldVariants = cva(
98
98
  "grid grid-cols-[auto_1fr] items-center gap-x-2",
99
99
  "[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",
100
100
  "has-[>[data-slot=field-content]]:items-start",
101
+ // Top-aligned rows: a 16px control centres on the label's first line
102
+ // (text-label is 20px), never on the content box's top edge.
103
+ "has-[>[data-slot=field-content]]:[&>[role=radio]]:mt-0.5",
101
104
  // sr-only label leaves grid flow — collapse to a single column
102
105
  "has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
103
106
  "[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
@@ -107,6 +110,7 @@ const fieldVariants = cva(
107
110
  "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto",
108
111
  "@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2",
109
112
  "@md/field-group:has-[>[data-slot=field-content]]:items-start",
113
+ "@md/field-group:has-[>[data-slot=field-content]]:[&>[role=radio]]:mt-0.5",
110
114
  // sr-only label leaves grid flow — collapse to a single column
111
115
  "@md/field-group:has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
112
116
  "@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
@@ -399,7 +403,7 @@ function FieldError({
399
403
  }
400
404
 
401
405
  const baseStyles = cn(
402
- "text-destructive-foreground text-sm font-normal leading-5",
406
+ "text-body-sm text-destructive-foreground",
403
407
  "mt-2",
404
408
  "group-has-[[data-orientation=horizontal]]/field:text-balance",
405
409
  "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
@@ -2,10 +2,11 @@ import * as React from "react";
2
2
 
3
3
  import { ArrowLeft } from "@brightlocal/icons";
4
4
  import { cn } from "@brightlocal/ui-components/lib/utils";
5
+ import { Breadcrumb } from "./breadcrumb";
5
6
  import { Header } from "./header";
6
7
  import { Link } from "./link";
7
8
  import { ScrollArea } from "./scroll-area";
8
- import { TypographyMuted } from "./typography";
9
+ import { TypographyText } from "./typography-text";
9
10
 
10
11
  interface GlobalLayoutProps extends React.ComponentProps<"div"> {
11
12
  /**
@@ -21,8 +22,11 @@ interface GlobalLayoutProps extends React.ComponentProps<"div"> {
21
22
  */
22
23
  trackingLabel?: string;
23
24
  /**
24
- * Maximum width of the global container. Use `breakpoint` tokens from `@brightlocal/tokens/breakpoints`.
25
- * @default breakpoint.xl
25
+ * Maximum width of the global container. Unconstrained by default so the
26
+ * sidebar pins to the viewport edge and content centres in the remaining
27
+ * space; pass a `breakpoint` token from `@brightlocal/tokens/breakpoints`
28
+ * to cap the whole shell.
29
+ * @default "none"
26
30
  */
27
31
  maxWidth?: string | number;
28
32
  }
@@ -31,7 +35,7 @@ const GlobalLayout = React.forwardRef<HTMLDivElement, GlobalLayoutProps>(
31
35
  (
32
36
  {
33
37
  className,
34
- maxWidth = "var(--ds-breakpoint-xl)",
38
+ maxWidth = "none",
35
39
  dataHook,
36
40
  trackingEl,
37
41
  trackingLabel,
@@ -45,8 +49,11 @@ const GlobalLayout = React.forwardRef<HTMLDivElement, GlobalLayoutProps>(
45
49
 
46
50
  return (
47
51
  <ScrollArea
52
+ // The viewport's default 4px padding would inset the full-bleed
53
+ // sidebar from the viewport edge and make its 100dvh height
54
+ // overflow, so the page-level scroll region drops it.
48
55
  className={cn(
49
- "h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
56
+ "h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0! [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
50
57
  className
51
58
  )}
52
59
  dataHook={`${dataHook}-scroll`}
@@ -54,7 +61,7 @@ const GlobalLayout = React.forwardRef<HTMLDivElement, GlobalLayoutProps>(
54
61
  >
55
62
  <div
56
63
  ref={ref}
57
- className="p-section-sm flex min-h-dvh w-full flex-col"
64
+ className="flex min-h-dvh w-full flex-col"
58
65
  data-hook={dataHook}
59
66
  data-slot="global-layout"
60
67
  data-tracking-el={trackingEl}
@@ -76,7 +83,9 @@ const GlobalLayout = React.forwardRef<HTMLDivElement, GlobalLayoutProps>(
76
83
 
77
84
  GlobalLayout.displayName = "GlobalLayout";
78
85
 
79
- const SIDEBAR_WIDTH = "224px";
86
+ // Sidebar rail width per DS-860 — matches the Figma binding to `width/w-72`
87
+ // so nav labels fit without truncation on small desktop screens.
88
+ const SIDEBAR_WIDTH = "288px";
80
89
 
81
90
  interface GlobalLayoutSidebarProps extends React.ComponentProps<"aside"> {
82
91
  /**
@@ -84,7 +93,7 @@ interface GlobalLayoutSidebarProps extends React.ComponentProps<"aside"> {
84
93
  */
85
94
  dataHook?: string;
86
95
  /**
87
- * Width of the sidebar (default: 224px)
96
+ * Width of the sidebar (default: 288px)
88
97
  */
89
98
  width?: string | number;
90
99
  }
@@ -107,8 +116,8 @@ const GlobalLayoutSidebar = React.forwardRef<
107
116
  {...props}
108
117
  style={{
109
118
  width: widthStyle,
110
- top: "var(--ds-section-padding-y-sm)",
111
- height: "calc(100dvh - 2 * var(--ds-section-padding-y-sm))",
119
+ top: 0,
120
+ height: "100dvh",
112
121
  ...props.style,
113
122
  }}
114
123
  >
@@ -151,8 +160,14 @@ const GlobalLayoutContent = React.forwardRef<
151
160
  return (
152
161
  <div
153
162
  ref={ref}
163
+ // Top padding is desktop-only: below lg the mobile header bar sits
164
+ // flush at the top edge and carries its own padding. No horizontal
165
+ // padding here — each region (header, actions, body) pads itself,
166
+ // so a full-width border or sticky treatment under the header stays
167
+ // possible (Figma: Page Header Region / Content Region are separate
168
+ // full-width regions).
154
169
  className={cn(
155
- "px-section-xs flex min-w-0 flex-1 flex-col gap-6",
170
+ "pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",
156
171
  className
157
172
  )}
158
173
  data-hook={dataHook}
@@ -170,6 +185,14 @@ const GlobalLayoutContent = React.forwardRef<
170
185
 
171
186
  GlobalLayoutContent.displayName = "GlobalLayoutContent";
172
187
 
188
+ // Horizontal padding for the full-width regions inside GlobalLayoutContent
189
+ // (header, actions, body): fixed 16px mobile / 24px tablet per the DS-860
190
+ // Figma breakpoint modes; from lg the responsive section-padding token takes
191
+ // over. Applied per region — not on GlobalLayoutContent — so region-level
192
+ // treatments (a border under the header, a future sticky header) can span
193
+ // the full width.
194
+ const CONTENT_REGION_PX = "px-4 md:px-6 lg:px-section-xs";
195
+
173
196
  interface GlobalLayoutBackLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
174
197
  /**
175
198
  * Data hook for automated testing
@@ -222,27 +245,46 @@ const GlobalLayoutBackLink = React.forwardRef<
222
245
 
223
246
  GlobalLayoutBackLink.displayName = "GlobalLayoutBackLink";
224
247
 
225
- interface GlobalLayoutSubtitleProps extends React.ComponentProps<"p"> {
248
+ // The deprecated native `color` presentation attribute is omitted: the
249
+ // subtitle's colour is the type scale's muted role, not a free-form value.
250
+ interface GlobalLayoutSubtitleProps extends Omit<
251
+ React.ComponentProps<"p">,
252
+ "color"
253
+ > {
226
254
  /**
227
255
  * Data hook for automated testing
228
256
  * @default "content-header-subtitle"
229
257
  */
230
258
  dataHook?: string;
259
+ /**
260
+ * Render the subtitle as its own child element (Radix Slot) while keeping
261
+ * the muted description typography — use it for rich description rows
262
+ * (icons, rating, a status Badge) that need their own flex layout.
263
+ */
264
+ asChild?: boolean;
231
265
  }
232
266
 
233
267
  /**
234
268
  * Muted description text for the page header. Place it as a direct child of
235
269
  * `GlobalLayoutContentHeader` — the header positions it below the title row.
270
+ * For rich descriptions, pass `asChild` with your own flex row as the child.
271
+ *
272
+ * Sits on the semantic type scale's `text-body-sm` (Inter · Figma 500 · 14/20,
273
+ * rendering one CSS weight lighter per the DS-305 offset) with the muted
274
+ * colour role — de-emphasis is colour-only, never a lighter weight.
236
275
  */
237
276
  const GlobalLayoutSubtitle = React.forwardRef<
238
277
  HTMLParagraphElement,
239
278
  GlobalLayoutSubtitleProps
240
- >(({ dataHook, ...props }, ref) => {
279
+ >(({ dataHook, asChild, ...props }, ref) => {
241
280
  return (
242
- <TypographyMuted
281
+ <TypographyText
243
282
  ref={ref}
283
+ asChild={asChild}
284
+ color="muted"
244
285
  data-slot="content-header-subtitle"
245
286
  dataHook={dataHook ?? "content-header-subtitle"}
287
+ variant="body-sm"
246
288
  {...props}
247
289
  />
248
290
  );
@@ -250,6 +292,44 @@ const GlobalLayoutSubtitle = React.forwardRef<
250
292
 
251
293
  GlobalLayoutSubtitle.displayName = "GlobalLayoutSubtitle";
252
294
 
295
+ interface GlobalLayoutImageProps extends React.ComponentProps<"div"> {
296
+ /**
297
+ * Data hook for automated testing
298
+ * @default "content-header-image"
299
+ */
300
+ dataHook?: string;
301
+ }
302
+
303
+ /**
304
+ * Thumbnail frame for the page header (the Figma Page Header "Show Image"
305
+ * slot). Place it as a direct child of `GlobalLayoutContentHeader` — the
306
+ * header positions it before the breadcrumb + title column. Pass your own
307
+ * `img` (or `Avatar`) as the child; it is cropped to a rounded 3:2 frame,
308
+ * 48px tall by default (size via `className`, e.g. `h-21` for the 84px
309
+ * variant).
310
+ */
311
+ const GlobalLayoutImage = React.forwardRef<
312
+ HTMLDivElement,
313
+ GlobalLayoutImageProps
314
+ >(({ className, dataHook, children, ...props }, ref) => {
315
+ return (
316
+ <div
317
+ ref={ref}
318
+ className={cn(
319
+ "aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
320
+ className
321
+ )}
322
+ data-hook={dataHook ?? "content-header-image"}
323
+ data-slot="content-header-image"
324
+ {...props}
325
+ >
326
+ {children}
327
+ </div>
328
+ );
329
+ });
330
+
331
+ GlobalLayoutImage.displayName = "GlobalLayoutImage";
332
+
253
333
  interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header"> {
254
334
  /**
255
335
  * Data hook for automated testing (required)
@@ -265,6 +345,28 @@ interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header">
265
345
  trackingLabel?: string;
266
346
  }
267
347
 
348
+ /**
349
+ * Page header for the content area. Slots direct children (back link, image,
350
+ * breadcrumb, subtitle, actions) around the title row per the Figma Page
351
+ * Header design.
352
+ *
353
+ * The consumer-supplied page title must be `TypographyHeading level={1}
354
+ * variant="page"` so it sits on the semantic type scale's
355
+ * `text-heading-page` (DS-714) — never a hand-styled heading. Exactly one
356
+ * page title per screen: a second title is a section (`variant="section"`,
357
+ * `text-heading-section`).
358
+ *
359
+ * @example
360
+ * <GlobalLayoutContentHeader dataHook="page-header">
361
+ * <TypographyHeading level={1} variant="page" dataHook="page-title">
362
+ * All Locations
363
+ * </TypographyHeading>
364
+ * <GlobalLayoutContentActions dataHook="header-actions">
365
+ * <Button dataHook="add-location">Add Location</Button>
366
+ * </GlobalLayoutContentActions>
367
+ * <GlobalLayoutSubtitle>Manage your business locations.</GlobalLayoutSubtitle>
368
+ * </GlobalLayoutContentHeader>
369
+ */
268
370
  const GlobalLayoutContentHeader = React.forwardRef<
269
371
  HTMLElement,
270
372
  GlobalLayoutContentHeaderProps
@@ -273,37 +375,86 @@ const GlobalLayoutContentHeader = React.forwardRef<
273
375
  { className, dataHook, trackingEl, trackingLabel, children, ...props },
274
376
  ref
275
377
  ) => {
276
- // Slot the back link and subtitle out of the flat children so the
277
- // header can lay them out per the design: back link before a column of
278
- // title row + subtitle. Both must be direct children (not wrapped in
279
- // fragments or other elements).
378
+ // Slot the back link, breadcrumb, and subtitle out of the flat children
379
+ // so the header can lay them out per the design: back link before a
380
+ // column of breadcrumb + title row + subtitle. All must be direct
381
+ // children (not wrapped in fragments or other elements).
280
382
  const backLinks: React.ReactNode[] = [];
383
+ const images: React.ReactNode[] = [];
384
+ const breadcrumbs: React.ReactNode[] = [];
281
385
  const subtitles: React.ReactNode[] = [];
386
+ const actions: React.ReactNode[] = [];
282
387
  const titleChildren: React.ReactNode[] = [];
283
388
 
284
389
  React.Children.forEach(children, (child) => {
285
390
  if (React.isValidElement(child) && child.type === GlobalLayoutBackLink) {
286
391
  backLinks.push(child);
392
+ } else if (
393
+ React.isValidElement(child) &&
394
+ child.type === GlobalLayoutImage
395
+ ) {
396
+ images.push(child);
397
+ } else if (React.isValidElement(child) && child.type === Breadcrumb) {
398
+ breadcrumbs.push(child);
287
399
  } else if (
288
400
  React.isValidElement(child) &&
289
401
  child.type === GlobalLayoutSubtitle
290
402
  ) {
291
403
  subtitles.push(child);
404
+ } else if (
405
+ React.isValidElement(child) &&
406
+ child.type === GlobalLayoutContentActions
407
+ ) {
408
+ actions.push(child);
292
409
  } else {
293
410
  titleChildren.push(child);
294
411
  }
295
412
  });
296
413
 
297
- // Without a back link or subtitle the header keeps its original flat
298
- // structure — children are laid out directly by the header row.
299
- if (backLinks.length === 0 && subtitles.length === 0) {
414
+ // Without a back link, image, breadcrumb, subtitle, or actions the
415
+ // header keeps its original flat structure — children are laid out
416
+ // directly by the header row.
417
+ if (
418
+ backLinks.length === 0 &&
419
+ images.length === 0 &&
420
+ breadcrumbs.length === 0 &&
421
+ subtitles.length === 0 &&
422
+ actions.length === 0
423
+ ) {
300
424
  return (
425
+ <div
426
+ className={cn("w-full", CONTENT_REGION_PX)}
427
+ data-slot="content-header-region"
428
+ >
429
+ <Header
430
+ ref={ref}
431
+ className={cn(
432
+ "mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
433
+ className
434
+ )}
435
+ data-slot="content-header"
436
+ dataHook={dataHook}
437
+ style={{ maxWidth: "var(--ds-breakpoint-lg)" }}
438
+ trackingEl={trackingEl}
439
+ trackingLabel={trackingLabel}
440
+ {...props}
441
+ >
442
+ {children}
443
+ </Header>
444
+ </div>
445
+ );
446
+ }
447
+
448
+ return (
449
+ <div
450
+ className={cn("w-full", CONTENT_REGION_PX)}
451
+ data-slot="content-header-region"
452
+ >
301
453
  <Header
302
454
  ref={ref}
303
- className={cn(
304
- "mx-auto w-full flex-wrap justify-between gap-4",
305
- className
306
- )}
455
+ // gap-4 matches the Figma Header Row spacing between the back
456
+ // link / image and the text column.
457
+ className={cn("mx-auto w-full items-start gap-4", className)}
307
458
  data-slot="content-header"
308
459
  dataHook={dataHook}
309
460
  style={{ maxWidth: "var(--ds-breakpoint-lg)" }}
@@ -311,42 +462,58 @@ const GlobalLayoutContentHeader = React.forwardRef<
311
462
  trackingLabel={trackingLabel}
312
463
  {...props}
313
464
  >
314
- {children}
315
- </Header>
316
- );
317
- }
318
-
319
- return (
320
- <Header
321
- ref={ref}
322
- className={cn("mx-auto w-full items-start", className)}
323
- data-slot="content-header"
324
- dataHook={dataHook}
325
- style={{ maxWidth: "var(--ds-breakpoint-lg)" }}
326
- trackingEl={trackingEl}
327
- trackingLabel={trackingLabel}
328
- {...props}
329
- >
330
- {backLinks}
331
- <div
332
- className="flex min-w-0 flex-1 flex-col gap-2"
333
- data-slot="content-header-body"
334
- >
465
+ {backLinks}
466
+ {images}
335
467
  <div
336
- className="flex w-full flex-wrap items-center justify-between gap-4"
337
- data-slot="content-header-title"
468
+ className="flex min-w-0 flex-1 flex-col gap-2"
469
+ data-slot="content-header-body"
338
470
  >
339
- {titleChildren}
471
+ {breadcrumbs}
472
+ {actions.length > 0 ? (
473
+ // With a slotted GlobalLayoutContentActions the header follows
474
+ // the Figma Page Header structure: a text block (title +
475
+ // description) with the actions beside it — and below it on
476
+ // mobile, so the action lands under the description.
477
+ <div
478
+ className="flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col"
479
+ data-slot="content-header-title"
480
+ >
481
+ <div
482
+ className="flex min-w-0 flex-1 flex-col gap-2"
483
+ data-slot="content-header-text"
484
+ >
485
+ {titleChildren}
486
+ {subtitles}
487
+ </div>
488
+ <GlobalLayoutHeaderSlotContext.Provider value={true}>
489
+ {actions}
490
+ </GlobalLayoutHeaderSlotContext.Provider>
491
+ </div>
492
+ ) : (
493
+ <>
494
+ <div
495
+ className="flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start"
496
+ data-slot="content-header-title"
497
+ >
498
+ {titleChildren}
499
+ </div>
500
+ {subtitles}
501
+ </>
502
+ )}
340
503
  </div>
341
- {subtitles}
342
- </div>
343
- </Header>
504
+ </Header>
505
+ </div>
344
506
  );
345
507
  }
346
508
  );
347
509
 
348
510
  GlobalLayoutContentHeader.displayName = "GlobalLayoutContentHeader";
349
511
 
512
+ // True while rendering inside GlobalLayoutContentHeader's actions slot —
513
+ // GlobalLayoutContentActions switches from its standalone desktop-row
514
+ // styling to an inline title-row group.
515
+ const GlobalLayoutHeaderSlotContext = React.createContext(false);
516
+
350
517
  interface GlobalLayoutContentActionsProps extends React.ComponentProps<"div"> {
351
518
  /**
352
519
  * Data hook for automated testing (required)
@@ -370,23 +537,41 @@ const GlobalLayoutContentActions = React.forwardRef<
370
537
  { className, dataHook, trackingEl, trackingLabel, children, ...props },
371
538
  ref
372
539
  ) => {
373
- return (
540
+ // Slotted inside GlobalLayoutContentHeader the actions render inline in
541
+ // the title row on every breakpoint; standalone they keep the legacy
542
+ // desktop-only full-width row, wrapped in a padded full-width region.
543
+ const inHeader = React.useContext(GlobalLayoutHeaderSlotContext);
544
+
545
+ const actionsRow = (
374
546
  <div
375
547
  ref={ref}
376
548
  className={cn(
377
- "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
549
+ inHeader
550
+ ? "flex shrink-0 items-center gap-2"
551
+ : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
378
552
  className
379
553
  )}
380
554
  data-hook={dataHook}
381
555
  data-slot="content-actions"
382
556
  data-tracking-el={trackingEl}
383
557
  data-tracking-label={trackingLabel}
384
- style={{ maxWidth: "var(--ds-breakpoint-lg)" }}
558
+ style={inHeader ? undefined : { maxWidth: "var(--ds-breakpoint-lg)" }}
385
559
  {...props}
386
560
  >
387
561
  {children}
388
562
  </div>
389
563
  );
564
+
565
+ if (inHeader) return actionsRow;
566
+
567
+ return (
568
+ <div
569
+ className={cn("w-full", CONTENT_REGION_PX)}
570
+ data-slot="content-actions-region"
571
+ >
572
+ {actionsRow}
573
+ </div>
574
+ );
390
575
  }
391
576
  );
392
577
 
@@ -417,16 +602,21 @@ const GlobalLayoutContentBody = React.forwardRef<
417
602
  ) => {
418
603
  return (
419
604
  <div
420
- ref={ref}
421
- className={cn("mx-auto flex w-full flex-1 flex-col gap-6", className)}
422
- data-hook={dataHook}
423
- data-slot="content-body"
424
- data-tracking-el={trackingEl}
425
- data-tracking-label={trackingLabel}
426
- style={{ maxWidth: "var(--content-max-width)" }}
427
- {...props}
605
+ className={cn("flex w-full flex-1 flex-col", CONTENT_REGION_PX)}
606
+ data-slot="content-body-region"
428
607
  >
429
- {children}
608
+ <div
609
+ ref={ref}
610
+ className={cn("mx-auto flex w-full flex-1 flex-col gap-6", className)}
611
+ data-hook={dataHook}
612
+ data-slot="content-body"
613
+ data-tracking-el={trackingEl}
614
+ data-tracking-label={trackingLabel}
615
+ style={{ maxWidth: "var(--content-max-width)" }}
616
+ {...props}
617
+ >
618
+ {children}
619
+ </div>
430
620
  </div>
431
621
  );
432
622
  }
@@ -474,8 +664,15 @@ const GlobalLayoutMobileHeader = React.forwardRef<
474
664
  <div
475
665
  ref={ref}
476
666
  aria-label={ariaLabel ?? "Mobile navigation"}
667
+ // Carries the same region padding as the header/body regions so the
668
+ // trigger and logo align with the page header below (the bar only
669
+ // renders below lg). Vertical rhythm per the Figma Bar: 24px above
670
+ // the trigger, 8px below.
477
671
  className={cn(
478
- "flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
672
+ // The 2px negative margin pulls a slotted SidebarTrigger's box
673
+ // left by its icon inset so the burger glyph — not the invisible
674
+ // button box — sits on the content edge.
675
+ "flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5",
479
676
  className
480
677
  )}
481
678
  data-hook={dataHook}
@@ -501,6 +698,7 @@ export {
501
698
  GlobalLayoutContentHeader,
502
699
  GlobalLayoutBackLink,
503
700
  GlobalLayoutSubtitle,
701
+ GlobalLayoutImage,
504
702
  GlobalLayoutContentBody,
505
703
  GlobalLayoutMobileHeader,
506
704
  };
@@ -513,6 +711,7 @@ export type {
513
711
  GlobalLayoutContentHeaderProps,
514
712
  GlobalLayoutBackLinkProps,
515
713
  GlobalLayoutSubtitleProps,
714
+ GlobalLayoutImageProps,
516
715
  GlobalLayoutContentBodyProps,
517
716
  GlobalLayoutMobileHeaderProps,
518
717
  };