@brightlocal/ui-components 2.27.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +7 -1
  2. package/component-meta.json +568 -143
  3. package/deprecations.json +298 -1
  4. package/dist/accordion.cjs +1 -1
  5. package/dist/accordion.d.ts +36 -0
  6. package/dist/accordion.d.ts.map +1 -1
  7. package/dist/accordion.js +74 -61
  8. package/dist/alert-dialog.cjs +1 -1
  9. package/dist/alert-dialog.js +18 -18
  10. package/dist/alert.cjs +1 -1
  11. package/dist/alert.d.ts +11 -1
  12. package/dist/alert.d.ts.map +1 -1
  13. package/dist/alert.js +31 -28
  14. package/dist/avatar.cjs +1 -1
  15. package/dist/avatar.js +4 -4
  16. package/dist/badge.cjs +1 -1
  17. package/dist/badge.d.ts.map +1 -1
  18. package/dist/badge.js +15 -11
  19. package/dist/blocks/empty-state.cjs +1 -0
  20. package/dist/blocks/empty-state.d.ts +172 -0
  21. package/dist/blocks/empty-state.d.ts.map +1 -0
  22. package/dist/blocks/empty-state.js +147 -0
  23. package/dist/blocks/input-list.cjs +2 -2
  24. package/dist/blocks/input-list.d.ts.map +1 -1
  25. package/dist/blocks/input-list.js +124 -108
  26. package/dist/blocks/progress-state.cjs +1 -0
  27. package/dist/blocks/{progress-screen.d.ts → progress-state.d.ts} +30 -18
  28. package/dist/blocks/progress-state.d.ts.map +1 -0
  29. package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
  30. package/dist/blocks/sidebar.cjs +1 -1
  31. package/dist/blocks/sidebar.d.ts.map +1 -1
  32. package/dist/blocks/sidebar.js +160 -161
  33. package/dist/breadcrumb.cjs +1 -1
  34. package/dist/breadcrumb.js +1 -1
  35. package/dist/button-group.cjs +1 -0
  36. package/dist/button-group.d.ts +36 -0
  37. package/dist/button-group.d.ts.map +1 -0
  38. package/dist/button-group.js +47 -0
  39. package/dist/button.cjs +1 -1
  40. package/dist/button.js +12 -12
  41. package/dist/calendar.cjs +1 -1
  42. package/dist/calendar.d.ts.map +1 -1
  43. package/dist/calendar.js +37 -38
  44. package/dist/callout.cjs +1 -1
  45. package/dist/callout.d.ts +24 -2
  46. package/dist/callout.d.ts.map +1 -1
  47. package/dist/callout.js +57 -55
  48. package/dist/card.cjs +1 -1
  49. package/dist/card.d.ts +42 -3
  50. package/dist/card.d.ts.map +1 -1
  51. package/dist/card.js +102 -91
  52. package/dist/chart-empty.cjs +1 -0
  53. package/dist/chart-empty.d.ts +59 -0
  54. package/dist/chart-empty.d.ts.map +1 -0
  55. package/dist/chart-empty.js +29 -0
  56. package/dist/chart.cjs +6 -6
  57. package/dist/chart.d.ts +46 -13
  58. package/dist/chart.d.ts.map +1 -1
  59. package/dist/chart.js +172 -157
  60. package/dist/chip.cjs +1 -1
  61. package/dist/chip.d.ts +38 -4
  62. package/dist/chip.d.ts.map +1 -1
  63. package/dist/chip.js +100 -84
  64. package/dist/combobox.cjs +2 -2
  65. package/dist/combobox.d.ts.map +1 -1
  66. package/dist/combobox.js +81 -79
  67. package/dist/command.cjs +1 -1
  68. package/dist/command.d.ts +23 -1
  69. package/dist/command.d.ts.map +1 -1
  70. package/dist/command.js +248 -225
  71. package/dist/context-menu.cjs +1 -1
  72. package/dist/context-menu.d.ts.map +1 -1
  73. package/dist/context-menu.js +26 -29
  74. package/dist/data-table.cjs +1 -1
  75. package/dist/data-table.d.ts +75 -10
  76. package/dist/data-table.d.ts.map +1 -1
  77. package/dist/data-table.js +346 -334
  78. package/dist/date-picker.cjs +1 -1
  79. package/dist/date-picker.d.ts +13 -5
  80. package/dist/date-picker.d.ts.map +1 -1
  81. package/dist/date-picker.js +54 -53
  82. package/dist/description.cjs +1 -1
  83. package/dist/description.js +5 -5
  84. package/dist/dialog.cjs +1 -1
  85. package/dist/dialog.js +20 -20
  86. package/dist/drawer.cjs +1 -1
  87. package/dist/drawer.d.ts.map +1 -1
  88. package/dist/drawer.js +8 -11
  89. package/dist/dropdown-menu.cjs +1 -1
  90. package/dist/dropdown-menu.d.ts.map +1 -1
  91. package/dist/dropdown-menu.js +17 -20
  92. package/dist/field.cjs +1 -1
  93. package/dist/field.d.ts +8 -1
  94. package/dist/field.d.ts.map +1 -1
  95. package/dist/field.js +96 -65
  96. package/dist/global-layout.cjs +1 -1
  97. package/dist/global-layout.d.ts +130 -12
  98. package/dist/global-layout.d.ts.map +1 -1
  99. package/dist/global-layout.js +146 -127
  100. package/dist/grid.cjs +1 -0
  101. package/dist/grid.d.ts +56 -0
  102. package/dist/grid.d.ts.map +1 -0
  103. package/dist/grid.js +32 -0
  104. package/dist/header.d.ts +13 -0
  105. package/dist/header.d.ts.map +1 -1
  106. package/dist/hooks/use-delayed-pending.cjs +1 -0
  107. package/dist/hooks/use-delayed-pending.d.ts +34 -0
  108. package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
  109. package/dist/hooks/use-delayed-pending.js +17 -0
  110. package/dist/hooks/use-mobile.cjs +1 -0
  111. package/dist/hooks/use-mobile.js +8 -0
  112. package/dist/hover-card.cjs +1 -1
  113. package/dist/hover-card.js +13 -13
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.d.ts +9 -1
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +554 -527
  118. package/dist/input-chip.cjs +1 -1
  119. package/dist/input-chip.js +25 -25
  120. package/dist/input-group.cjs +1 -1
  121. package/dist/input-group.js +9 -9
  122. package/dist/input-otp.cjs +1 -1
  123. package/dist/input-otp.js +9 -9
  124. package/dist/input-password.cjs +1 -1
  125. package/dist/input-password.d.ts +17 -9
  126. package/dist/input-password.d.ts.map +1 -1
  127. package/dist/input-password.js +73 -72
  128. package/dist/input.cjs +1 -1
  129. package/dist/input.js +9 -9
  130. package/dist/label.cjs +1 -1
  131. package/dist/label.d.ts.map +1 -1
  132. package/dist/label.js +25 -28
  133. package/dist/lib/block-illustration.cjs +1 -0
  134. package/dist/lib/block-illustration.d.ts +28 -0
  135. package/dist/lib/block-illustration.d.ts.map +1 -0
  136. package/dist/lib/block-illustration.js +21 -0
  137. package/dist/lib/empty-canvas.cjs +1 -0
  138. package/dist/lib/empty-canvas.d.ts +27 -0
  139. package/dist/lib/empty-canvas.d.ts.map +1 -0
  140. package/dist/lib/empty-canvas.js +62 -0
  141. package/dist/lib/empty-chip.cjs +1 -0
  142. package/dist/lib/empty-chip.d.ts +4 -0
  143. package/dist/lib/empty-chip.d.ts.map +1 -0
  144. package/dist/lib/empty-chip.js +13 -0
  145. package/dist/lib/optical-center.cjs +1 -0
  146. package/dist/lib/optical-center.d.ts +12 -0
  147. package/dist/lib/optical-center.d.ts.map +1 -0
  148. package/dist/lib/optical-center.js +11 -0
  149. package/dist/lib/utils.cjs +1 -1
  150. package/dist/lib/utils.d.ts.map +1 -1
  151. package/dist/lib/utils.js +28 -5
  152. package/dist/list.cjs +1 -1
  153. package/dist/list.d.ts.map +1 -1
  154. package/dist/list.js +62 -58
  155. package/dist/map.cjs +1 -1
  156. package/dist/map.d.ts +60 -2
  157. package/dist/map.d.ts.map +1 -1
  158. package/dist/map.js +187 -164
  159. package/dist/media-empty.cjs +1 -0
  160. package/dist/media-empty.d.ts +72 -0
  161. package/dist/media-empty.d.ts.map +1 -0
  162. package/dist/media-empty.js +45 -0
  163. package/dist/menubar.cjs +1 -1
  164. package/dist/menubar.d.ts.map +1 -1
  165. package/dist/menubar.js +17 -20
  166. package/dist/navigation-menu.cjs +1 -1
  167. package/dist/navigation-menu.js +7 -7
  168. package/dist/pagination.cjs +1 -1
  169. package/dist/pagination.d.ts +130 -1
  170. package/dist/pagination.d.ts.map +1 -1
  171. package/dist/pagination.js +193 -102
  172. package/dist/progress.cjs +1 -1
  173. package/dist/progress.d.ts +2 -26
  174. package/dist/progress.d.ts.map +1 -1
  175. package/dist/progress.js +79 -118
  176. package/dist/scroll-area.cjs +1 -1
  177. package/dist/scroll-area.d.ts +15 -6
  178. package/dist/scroll-area.d.ts.map +1 -1
  179. package/dist/scroll-area.js +38 -36
  180. package/dist/select.cjs +2 -2
  181. package/dist/select.d.ts +13 -2
  182. package/dist/select.d.ts.map +1 -1
  183. package/dist/select.js +92 -87
  184. package/dist/separator.cjs +1 -1
  185. package/dist/separator.js +8 -8
  186. package/dist/sheet.cjs +1 -1
  187. package/dist/sheet.js +2 -2
  188. package/dist/skeleton.cjs +1 -1
  189. package/dist/skeleton.d.ts +38 -3
  190. package/dist/skeleton.d.ts.map +1 -1
  191. package/dist/skeleton.js +43 -20
  192. package/dist/sonner.cjs +1 -1
  193. package/dist/sonner.js +26 -26
  194. package/dist/stepper.cjs +1 -1
  195. package/dist/stepper.js +40 -40
  196. package/dist/table.cjs +1 -1
  197. package/dist/table.d.ts.map +1 -1
  198. package/dist/table.js +31 -28
  199. package/dist/tabs.cjs +1 -1
  200. package/dist/tabs.js +1 -1
  201. package/dist/text-reveal-motion.d.ts +10 -0
  202. package/dist/text-reveal-motion.d.ts.map +1 -1
  203. package/dist/textarea.cjs +1 -1
  204. package/dist/textarea.js +11 -11
  205. package/dist/toggle.cjs +1 -1
  206. package/dist/toggle.js +8 -8
  207. package/dist/tooltip.cjs +1 -1
  208. package/dist/tooltip.js +8 -8
  209. package/dist/typography-heading.cjs +1 -0
  210. package/dist/typography-heading.d.ts +129 -0
  211. package/dist/typography-heading.d.ts.map +1 -0
  212. package/dist/typography-heading.js +95 -0
  213. package/dist/typography-text.cjs +1 -0
  214. package/dist/typography-text.d.ts +127 -0
  215. package/dist/typography-text.d.ts.map +1 -0
  216. package/dist/typography-text.js +92 -0
  217. package/dist/typography.d.ts +13 -0
  218. package/dist/typography.d.ts.map +1 -1
  219. package/package.json +35 -7
  220. package/src/blocks/empty-state.tsx +412 -0
  221. package/src/blocks/input-list.tsx +66 -36
  222. package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
  223. package/src/blocks/sidebar.tsx +25 -26
  224. package/src/components/accordion.tsx +82 -27
  225. package/src/components/alert-dialog.tsx +2 -2
  226. package/src/components/alert.tsx +27 -13
  227. package/src/components/avatar.tsx +1 -1
  228. package/src/components/badge.tsx +8 -4
  229. package/src/components/breadcrumb.tsx +1 -1
  230. package/src/components/button-group.tsx +112 -0
  231. package/src/components/button.tsx +4 -4
  232. package/src/components/calendar.tsx +5 -6
  233. package/src/components/callout.tsx +48 -15
  234. package/src/components/card.tsx +89 -19
  235. package/src/components/chart-empty.tsx +116 -0
  236. package/src/components/chart.tsx +103 -32
  237. package/src/components/chip.tsx +88 -13
  238. package/src/components/combobox.tsx +12 -10
  239. package/src/components/command.tsx +64 -13
  240. package/src/components/context-menu.tsx +6 -9
  241. package/src/components/data-table.tsx +135 -20
  242. package/src/components/date-picker.tsx +18 -7
  243. package/src/components/description.tsx +1 -1
  244. package/src/components/dialog.tsx +2 -2
  245. package/src/components/drawer.tsx +2 -5
  246. package/src/components/dropdown-menu.tsx +8 -11
  247. package/src/components/field.tsx +89 -16
  248. package/src/components/global-layout.tsx +210 -39
  249. package/src/components/grid.tsx +130 -0
  250. package/src/components/header.tsx +13 -0
  251. package/src/components/hover-card.tsx +1 -1
  252. package/src/components/input-chip.tsx +1 -1
  253. package/src/components/input-group.tsx +1 -1
  254. package/src/components/input-otp.tsx +1 -1
  255. package/src/components/input-password.tsx +24 -12
  256. package/src/components/input.tsx +1 -1
  257. package/src/components/label.tsx +10 -13
  258. package/src/components/list.tsx +13 -9
  259. package/src/components/map.tsx +101 -5
  260. package/src/components/media-empty.tsx +156 -0
  261. package/src/components/menubar.tsx +7 -10
  262. package/src/components/navigation-menu.tsx +1 -1
  263. package/src/components/pagination.tsx +286 -1
  264. package/src/components/progress.tsx +35 -113
  265. package/src/components/scroll-area.tsx +23 -10
  266. package/src/components/select.tsx +35 -10
  267. package/src/components/separator.tsx +1 -1
  268. package/src/components/sheet.tsx +2 -2
  269. package/src/components/skeleton.tsx +78 -7
  270. package/src/components/sonner.tsx +2 -2
  271. package/src/components/stepper.tsx +3 -3
  272. package/src/components/table.tsx +6 -3
  273. package/src/components/tabs.tsx +1 -1
  274. package/src/components/text-reveal-motion.tsx +10 -0
  275. package/src/components/textarea.tsx +1 -1
  276. package/src/components/toggle.tsx +1 -1
  277. package/src/components/tooltip.tsx +1 -1
  278. package/src/components/typography-heading.tsx +253 -0
  279. package/src/components/typography-text.tsx +250 -0
  280. package/src/components/typography.tsx +13 -0
  281. package/src/hooks/use-delayed-pending.ts +60 -0
  282. package/src/index.ts +11 -1
  283. package/src/lib/block-illustration.tsx +88 -0
  284. package/src/lib/empty-canvas.tsx +128 -0
  285. package/src/lib/empty-chip.ts +24 -0
  286. package/src/lib/optical-center.tsx +45 -0
  287. package/src/lib/utils.ts +26 -0
  288. package/dist/blocks/progress-screen.cjs +0 -1
  289. package/dist/blocks/progress-screen.d.ts.map +0 -1
@@ -1,43 +1,44 @@
1
- import { jsx as n, jsxs as u, Fragment as G } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as u, Fragment as H } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
- import { ArrowLeft as C } from "@brightlocal/icons";
3
+ import { ArrowLeft as k } from "@brightlocal/icons";
4
4
  import { cn as m } from "@brightlocal/ui-components/lib/utils";
5
- import { Breadcrumb as R } from "./breadcrumb.js";
6
- import { Header as g } from "./header.js";
7
- import { Link as H } from "./link.js";
8
- import { ScrollArea as j } from "./scroll-area.js";
9
- import { TypographyMuted as E } from "./typography.js";
10
- const S = r.forwardRef(
5
+ import { Breadcrumb as C } from "./breadcrumb.js";
6
+ import { Button as j } from "./button.js";
7
+ import { Header as w } from "./header.js";
8
+ import { Link as B } from "./link.js";
9
+ import { ScrollArea as E } from "./scroll-area.js";
10
+ import { TypographyText as S } from "./typography-text.js";
11
+ const A = r.forwardRef(
11
12
  ({
12
13
  className: t,
13
- maxWidth: e = "none",
14
- dataHook: a,
14
+ maxWidth: a = "none",
15
+ dataHook: e,
15
16
  trackingEl: l,
16
- trackingLabel: o,
17
+ trackingLabel: n,
17
18
  children: s,
18
- ...d
19
+ ...i
19
20
  }, c) => {
20
- const f = typeof e == "number" ? `${e}px` : e;
21
- return /* @__PURE__ */ n(
22
- j,
21
+ const f = typeof a == "number" ? `${a}px` : a;
22
+ return /* @__PURE__ */ o(
23
+ E,
23
24
  {
24
25
  className: m(
25
26
  "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!",
26
27
  t
27
28
  ),
28
- dataHook: `${a}-scroll`,
29
+ dataHook: `${e}-scroll`,
29
30
  scrollOrientation: "both",
30
- children: /* @__PURE__ */ n(
31
+ children: /* @__PURE__ */ o(
31
32
  "div",
32
33
  {
33
34
  ref: c,
34
35
  className: "flex min-h-dvh w-full flex-col",
35
- "data-hook": a,
36
+ "data-hook": e,
36
37
  "data-slot": "global-layout",
37
38
  "data-tracking-el": l,
38
- "data-tracking-label": o,
39
- ...d,
40
- children: /* @__PURE__ */ n(
39
+ "data-tracking-label": n,
40
+ ...i,
41
+ children: /* @__PURE__ */ o(
41
42
  "div",
42
43
  {
43
44
  className: "mx-auto flex w-full flex-1",
@@ -52,10 +53,10 @@ const S = r.forwardRef(
52
53
  );
53
54
  }
54
55
  );
55
- S.displayName = "GlobalLayout";
56
- const B = "288px", M = r.forwardRef(({ className: t, width: e = B, dataHook: a, children: l, ...o }, s) => {
57
- const d = typeof e == "number" ? `${e}px` : e;
58
- return /* @__PURE__ */ n(
56
+ A.displayName = "GlobalLayout";
57
+ const _ = "288px", I = r.forwardRef(({ className: t, width: a = _, dataHook: e, children: l, ...n }, s) => {
58
+ const i = typeof a == "number" ? `${a}px` : a;
59
+ return /* @__PURE__ */ o(
59
60
  "aside",
60
61
  {
61
62
  ref: s,
@@ -63,30 +64,30 @@ const B = "288px", M = r.forwardRef(({ className: t, width: e = B, dataHook: a,
63
64
  "sticky hidden shrink-0 self-start outline-none lg:block",
64
65
  t
65
66
  ),
66
- "data-hook": a,
67
+ "data-hook": e,
67
68
  "data-slot": "sidebar-container",
68
- ...o,
69
+ ...n,
69
70
  style: {
70
- width: d,
71
+ width: i,
71
72
  top: 0,
72
73
  height: "100dvh",
73
- ...o.style
74
+ ...n.style
74
75
  },
75
76
  children: l
76
77
  }
77
78
  );
78
79
  });
79
- M.displayName = "GlobalLayoutSidebar";
80
- const _ = r.forwardRef(
80
+ I.displayName = "GlobalLayoutSidebar";
81
+ const M = r.forwardRef(
81
82
  ({
82
83
  className: t,
83
- maxWidth: e = "var(--ds-breakpoint-lg)",
84
- dataHook: a,
84
+ maxWidth: a = "var(--ds-breakpoint-lg)",
85
+ dataHook: e,
85
86
  children: l,
86
- ...o
87
+ ...n
87
88
  }, s) => {
88
- const d = typeof e == "number" ? `${e}px` : e;
89
- return /* @__PURE__ */ n(
89
+ const i = typeof a == "number" ? `${a}px` : a;
90
+ return /* @__PURE__ */ o(
90
91
  "div",
91
92
  {
92
93
  ref: s,
@@ -94,101 +95,117 @@ const _ = r.forwardRef(
94
95
  "pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",
95
96
  t
96
97
  ),
97
- "data-hook": a,
98
+ "data-hook": e,
98
99
  "data-slot": "content-wrapper",
99
- style: { "--content-max-width": d },
100
- ...o,
100
+ style: { "--content-max-width": i },
101
+ ...n,
101
102
  children: l
102
103
  }
103
104
  );
104
105
  }
105
106
  );
106
- _.displayName = "GlobalLayoutContent";
107
- const x = "px-4 md:px-6 lg:px-section-xs", w = r.forwardRef(({ dataHook: t, ariaLabel: e, href: a, onClick: l, ...o }, s) => /* @__PURE__ */ n(
108
- H,
109
- {
110
- ref: s,
111
- "aria-label": e || "Go back",
112
- "data-slot": "content-header-back-link",
113
- dataHook: t ?? "content-header-back-link",
114
- href: a ?? "#",
115
- variant: "icon",
116
- onClick: (c) => {
117
- a === void 0 && c.preventDefault(), l?.(c);
118
- },
119
- ...o,
120
- children: /* @__PURE__ */ n(C, { "aria-hidden": "true" })
107
+ M.displayName = "GlobalLayoutContent";
108
+ const x = "px-4 md:px-6 lg:px-section-xs", v = r.forwardRef((t, a) => {
109
+ if (t.href === void 0) {
110
+ const { dataHook: s, ariaLabel: i, ...c } = t;
111
+ return /* @__PURE__ */ o(
112
+ j,
113
+ {
114
+ ref: a,
115
+ ariaLabel: i || "Go back",
116
+ "data-slot": "content-header-back-link",
117
+ dataHook: s ?? "content-header-back-link",
118
+ variant: "ghost",
119
+ ...c,
120
+ children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
121
+ }
122
+ );
121
123
  }
122
- ));
123
- w.displayName = "GlobalLayoutBackLink";
124
- const k = r.forwardRef(({ dataHook: t, asChild: e, ...a }, l) => /* @__PURE__ */ n(
125
- E,
124
+ const { dataHook: e, ariaLabel: l, ...n } = t;
125
+ return /* @__PURE__ */ o(
126
+ B,
127
+ {
128
+ ref: a,
129
+ "aria-label": l || "Go back",
130
+ "data-slot": "content-header-back-link",
131
+ dataHook: e ?? "content-header-back-link",
132
+ variant: "icon",
133
+ ...n,
134
+ children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
135
+ }
136
+ );
137
+ });
138
+ v.displayName = "GlobalLayoutBackLink";
139
+ const L = r.forwardRef(({ dataHook: t, asChild: a, ...e }, l) => /* @__PURE__ */ o(
140
+ S,
126
141
  {
127
142
  ref: l,
128
- asChild: e,
143
+ asChild: a,
144
+ color: "muted",
129
145
  "data-slot": "content-header-subtitle",
130
146
  dataHook: t ?? "content-header-subtitle",
131
- ...a
147
+ variant: "body-sm",
148
+ ...e
132
149
  }
133
150
  ));
134
- k.displayName = "GlobalLayoutSubtitle";
135
- const v = r.forwardRef(({ className: t, dataHook: e, children: a, ...l }, o) => /* @__PURE__ */ n(
151
+ L.displayName = "GlobalLayoutSubtitle";
152
+ const N = r.forwardRef(({ className: t, dataHook: a, children: e, ...l }, n) => /* @__PURE__ */ o(
136
153
  "div",
137
154
  {
138
- ref: o,
155
+ ref: n,
139
156
  className: m(
140
157
  "aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
141
158
  t
142
159
  ),
143
- "data-hook": e ?? "content-header-image",
160
+ "data-hook": a ?? "content-header-image",
144
161
  "data-slot": "content-header-image",
145
162
  ...l,
146
- children: a
163
+ children: e
147
164
  }
148
165
  ));
149
- v.displayName = "GlobalLayoutImage";
150
- const A = r.forwardRef(
151
- ({ className: t, dataHook: e, trackingEl: a, trackingLabel: l, children: o, ...s }, d) => {
152
- const c = [], f = [], y = [], p = [], b = [], h = [];
153
- return r.Children.forEach(o, (i) => {
154
- r.isValidElement(i) && i.type === w ? c.push(i) : r.isValidElement(i) && i.type === v ? f.push(i) : r.isValidElement(i) && i.type === R ? y.push(i) : r.isValidElement(i) && i.type === k ? p.push(i) : r.isValidElement(i) && i.type === L ? b.push(i) : h.push(i);
155
- }), c.length === 0 && f.length === 0 && y.length === 0 && p.length === 0 && b.length === 0 ? /* @__PURE__ */ n(
166
+ N.displayName = "GlobalLayoutImage";
167
+ const T = r.forwardRef(
168
+ ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
169
+ const c = [], f = [], y = [], b = [], p = [], h = [];
170
+ return r.Children.forEach(n, (d) => {
171
+ r.isValidElement(d) && d.type === v ? c.push(d) : r.isValidElement(d) && d.type === N ? f.push(d) : r.isValidElement(d) && d.type === C ? y.push(d) : r.isValidElement(d) && d.type === L ? b.push(d) : r.isValidElement(d) && d.type === g ? p.push(d) : h.push(d);
172
+ }), c.length === 0 && f.length === 0 && y.length === 0 && b.length === 0 && p.length === 0 ? /* @__PURE__ */ o(
156
173
  "div",
157
174
  {
158
175
  className: m("w-full", x),
159
176
  "data-slot": "content-header-region",
160
- children: /* @__PURE__ */ n(
161
- g,
177
+ children: /* @__PURE__ */ o(
178
+ w,
162
179
  {
163
- ref: d,
180
+ ref: i,
164
181
  className: m(
165
182
  "mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
166
183
  t
167
184
  ),
168
185
  "data-slot": "content-header",
169
- dataHook: e,
186
+ dataHook: a,
170
187
  style: { maxWidth: "var(--ds-breakpoint-lg)" },
171
- trackingEl: a,
188
+ trackingEl: e,
172
189
  trackingLabel: l,
173
190
  ...s,
174
- children: o
191
+ children: n
175
192
  }
176
193
  )
177
194
  }
178
- ) : /* @__PURE__ */ n(
195
+ ) : /* @__PURE__ */ o(
179
196
  "div",
180
197
  {
181
198
  className: m("w-full", x),
182
199
  "data-slot": "content-header-region",
183
200
  children: /* @__PURE__ */ u(
184
- g,
201
+ w,
185
202
  {
186
- ref: d,
203
+ ref: i,
187
204
  className: m("mx-auto w-full items-start gap-4", t),
188
205
  "data-slot": "content-header",
189
- dataHook: e,
206
+ dataHook: a,
190
207
  style: { maxWidth: "var(--ds-breakpoint-lg)" },
191
- trackingEl: a,
208
+ trackingEl: e,
192
209
  trackingLabel: l,
193
210
  ...s,
194
211
  children: [
@@ -201,8 +218,8 @@ const A = r.forwardRef(
201
218
  "data-slot": "content-header-body",
202
219
  children: [
203
220
  y,
204
- b.length > 0 ? (
205
- // With a slotted GlobalLayoutContentActions the header follows
221
+ p.length > 0 ? (
222
+ // With a slotted GlobalLayoutActions the header follows
206
223
  // the Figma Page Header structure: a text block (title +
207
224
  // description) with the actions beside it — and below it on
208
225
  // mobile, so the action lands under the description.
@@ -219,16 +236,16 @@ const A = r.forwardRef(
219
236
  "data-slot": "content-header-text",
220
237
  children: [
221
238
  h,
222
- p
239
+ b
223
240
  ]
224
241
  }
225
242
  ),
226
- /* @__PURE__ */ n(N.Provider, { value: !0, children: b })
243
+ /* @__PURE__ */ o(G.Provider, { value: !0, children: p })
227
244
  ]
228
245
  }
229
246
  )
230
- ) : /* @__PURE__ */ u(G, { children: [
231
- /* @__PURE__ */ n(
247
+ ) : /* @__PURE__ */ u(H, { children: [
248
+ /* @__PURE__ */ o(
232
249
  "div",
233
250
  {
234
251
  className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
@@ -236,7 +253,7 @@ const A = r.forwardRef(
236
253
  children: h
237
254
  }
238
255
  ),
239
- p
256
+ b
240
257
  ] })
241
258
  ]
242
259
  }
@@ -248,27 +265,27 @@ const A = r.forwardRef(
248
265
  );
249
266
  }
250
267
  );
251
- A.displayName = "GlobalLayoutContentHeader";
252
- const N = r.createContext(!1), L = r.forwardRef(
253
- ({ className: t, dataHook: e, trackingEl: a, trackingLabel: l, children: o, ...s }, d) => {
254
- const c = r.useContext(N), f = /* @__PURE__ */ n(
268
+ T.displayName = "GlobalLayoutContentHeader";
269
+ const G = r.createContext(!1), g = r.forwardRef(
270
+ ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
271
+ const c = r.useContext(G), f = /* @__PURE__ */ o(
255
272
  "div",
256
273
  {
257
- ref: d,
274
+ ref: i,
258
275
  className: m(
259
276
  c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
260
277
  t
261
278
  ),
262
- "data-hook": e,
279
+ "data-hook": a,
263
280
  "data-slot": "content-actions",
264
- "data-tracking-el": a,
281
+ "data-tracking-el": e,
265
282
  "data-tracking-label": l,
266
283
  style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
267
284
  ...s,
268
- children: o
285
+ children: n
269
286
  }
270
287
  );
271
- return c ? f : /* @__PURE__ */ n(
288
+ return c ? f : /* @__PURE__ */ o(
272
289
  "div",
273
290
  {
274
291
  className: m("w-full", x),
@@ -278,45 +295,45 @@ const N = r.createContext(!1), L = r.forwardRef(
278
295
  );
279
296
  }
280
297
  );
281
- L.displayName = "GlobalLayoutContentActions";
282
- const I = r.forwardRef(
283
- ({ className: t, dataHook: e, trackingEl: a, trackingLabel: l, children: o, ...s }, d) => /* @__PURE__ */ n(
298
+ g.displayName = "GlobalLayoutActions";
299
+ const J = g, R = r.forwardRef(
300
+ ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => /* @__PURE__ */ o(
284
301
  "div",
285
302
  {
286
303
  className: m("flex w-full flex-1 flex-col", x),
287
304
  "data-slot": "content-body-region",
288
- children: /* @__PURE__ */ n(
305
+ children: /* @__PURE__ */ o(
289
306
  "div",
290
307
  {
291
- ref: d,
308
+ ref: i,
292
309
  className: m("mx-auto flex w-full flex-1 flex-col gap-6", t),
293
- "data-hook": e,
310
+ "data-hook": a,
294
311
  "data-slot": "content-body",
295
- "data-tracking-el": a,
312
+ "data-tracking-el": e,
296
313
  "data-tracking-label": l,
297
314
  style: { maxWidth: "var(--content-max-width)" },
298
315
  ...s,
299
- children: o
316
+ children: n
300
317
  }
301
318
  )
302
319
  }
303
320
  )
304
321
  );
305
- I.displayName = "GlobalLayoutContentBody";
306
- const V = r.forwardRef(
322
+ R.displayName = "GlobalLayoutBody";
323
+ const K = R, V = r.forwardRef(
307
324
  ({
308
325
  className: t,
309
- dataHook: e,
310
- ariaLabel: a,
326
+ dataHook: a,
327
+ ariaLabel: e,
311
328
  trackingEl: l,
312
- trackingLabel: o,
329
+ trackingLabel: n,
313
330
  children: s,
314
- ...d
315
- }, c) => /* @__PURE__ */ n(
331
+ ...i
332
+ }, c) => /* @__PURE__ */ o(
316
333
  "div",
317
334
  {
318
335
  ref: c,
319
- "aria-label": a ?? "Mobile navigation",
336
+ "aria-label": e ?? "Mobile navigation",
320
337
  className: m(
321
338
  // The 2px negative margin pulls a slotted SidebarTrigger's box
322
339
  // left by its icon inset so the burger glyph — not the invisible
@@ -324,26 +341,28 @@ const V = r.forwardRef(
324
341
  "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",
325
342
  t
326
343
  ),
327
- "data-hook": e,
344
+ "data-hook": a,
328
345
  "data-slot": "mobile-header",
329
346
  "data-tracking-el": l,
330
- "data-tracking-label": o,
347
+ "data-tracking-label": n,
331
348
  role: "toolbar",
332
- ...d,
349
+ ...i,
333
350
  children: s
334
351
  }
335
352
  )
336
353
  );
337
354
  V.displayName = "GlobalLayoutMobileHeader";
338
355
  export {
339
- S as GlobalLayout,
340
- w as GlobalLayoutBackLink,
341
- _ as GlobalLayoutContent,
342
- L as GlobalLayoutContentActions,
343
- I as GlobalLayoutContentBody,
344
- A as GlobalLayoutContentHeader,
345
- v as GlobalLayoutImage,
356
+ A as GlobalLayout,
357
+ g as GlobalLayoutActions,
358
+ v as GlobalLayoutBackLink,
359
+ R as GlobalLayoutBody,
360
+ M as GlobalLayoutContent,
361
+ J as GlobalLayoutContentActions,
362
+ K as GlobalLayoutContentBody,
363
+ T as GlobalLayoutContentHeader,
364
+ N as GlobalLayoutImage,
346
365
  V as GlobalLayoutMobileHeader,
347
- M as GlobalLayoutSidebar,
348
- k as GlobalLayoutSubtitle
366
+ I as GlobalLayoutSidebar,
367
+ L as GlobalLayoutSubtitle
349
368
  };
package/dist/grid.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),u=require("@brightlocal/ui-components/lib/utils"),f=require("./lib/optical-center.cjs");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const p=g(d),c=p.forwardRef(({className:e,children:r,dataHook:t,variant:a,trackingEl:i,trackingLabel:l,...o},s)=>n.jsx("div",{ref:s,className:u.cn("flex w-full flex-1 flex-col items-center",e),"data-hook":t,"data-slot":"grid","data-tracking-el":i??"grid","data-tracking-label":l,"data-variant":a,...o,children:n.jsx(f.OpticalCenter,{children:r})}));c.displayName="Grid";exports.Grid=c;
package/dist/grid.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ /**
3
+ * The named layouts. Closed on purpose — a layout the vocabulary lacks is a
4
+ * signal to add a value here, not a className at the call site.
5
+ * (`stack`, `row`, `cards` are reserved for DS-970.)
6
+ */
7
+ type GridVariant = "centered";
8
+ interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
9
+ /**
10
+ * Required data-hook attribute for automated testing.
11
+ * @example "locations-empty-center"
12
+ */
13
+ dataHook: string;
14
+ /**
15
+ * Tracking element identifier for analytics.
16
+ */
17
+ trackingEl?: string;
18
+ /**
19
+ * Tracking label for analytics context.
20
+ */
21
+ trackingLabel?: string;
22
+ }
23
+ /**
24
+ * One message at the page body's optical centre (38/62). Give it a page body
25
+ * to fill — it stretches with `flex-1` — and one message to hold.
26
+ */
27
+ interface GridCenteredProps extends GridBaseProps {
28
+ variant: "centered";
29
+ }
30
+ /**
31
+ * Props for the Grid primitive. `variant` discriminates the shapes; each
32
+ * variant carries only the modifiers it actually has.
33
+ */
34
+ export type GridProps = GridCenteredProps;
35
+ /**
36
+ * The layout primitive: a closed vocabulary of named layouts instead of
37
+ * hand-rolled flex/grid classNames.
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <GlobalLayoutBody dataHook="locations-body">
42
+ * <Grid dataHook="locations-empty-center" variant="centered">
43
+ * <EmptyState
44
+ * dataHook="locations-empty"
45
+ * illustration={<BusinessLocation aria-hidden />}
46
+ * size="lg"
47
+ * title={t("locations.empty.title")}
48
+ * />
49
+ * </Grid>
50
+ * </GlobalLayoutBody>
51
+ * ```
52
+ */
53
+ declare const Grid: React.ForwardRefExoticComponent<GridCenteredProps & React.RefAttributes<HTMLDivElement>>;
54
+ export { Grid };
55
+ export type { GridVariant };
56
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwC/B;;;;GAIG;AACH,KAAK,WAAW,GAAG,UAAU,CAAC;AAE9B,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/dist/grid.js ADDED
@@ -0,0 +1,32 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { cn as f } from "@brightlocal/ui-components/lib/utils";
4
+ import { OpticalCenter as n } from "./lib/optical-center.js";
5
+ const s = c.forwardRef(
6
+ ({
7
+ className: r,
8
+ children: t,
9
+ dataHook: e,
10
+ variant: i,
11
+ trackingEl: o,
12
+ trackingLabel: l,
13
+ ...d
14
+ }, m) => /* @__PURE__ */ a(
15
+ "div",
16
+ {
17
+ ref: m,
18
+ className: f("flex w-full flex-1 flex-col items-center", r),
19
+ "data-hook": e,
20
+ "data-slot": "grid",
21
+ "data-tracking-el": o ?? "grid",
22
+ "data-tracking-label": l,
23
+ "data-variant": i,
24
+ ...d,
25
+ children: /* @__PURE__ */ a(n, { children: t })
26
+ }
27
+ )
28
+ );
29
+ s.displayName = "Grid";
30
+ export {
31
+ s as Grid
32
+ };
package/dist/header.d.ts CHANGED
@@ -18,6 +18,19 @@ import * as React from "react";
18
18
  * <Logo dataHook="header-logo" />
19
19
  * <NavigationMenu dataHook="header-nav" />
20
20
  * </Header>
21
+ *
22
+ * @example
23
+ * // With the page title. The title is a TypographyHeading on the semantic
24
+ * // type scale (DS-714): text-heading-page — Poppins · Figma 600 · 24/32,
25
+ * // rendering one CSS weight lighter per the DS-305 offset. Never
26
+ * // hand-style it. `variant="page"` is level 1's default, written out so
27
+ * // the scale role is explicit. Exactly one page title per screen — a
28
+ * // second title is a section (`variant="section"`).
29
+ * <Header dataHook="page-header">
30
+ * <TypographyHeading level={1} variant="page" dataHook="page-title">
31
+ * All Locations
32
+ * </TypographyHeading>
33
+ * </Header>
21
34
  */
22
35
  interface HeaderProps extends React.ComponentProps<"header"> {
23
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;IAC1D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,8FA2BX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;IAC1D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,8FA2BX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),u=150;function a(e,t=u){const[n,s]=r.useState(!1);return r.useEffect(()=>{if(!e)return;const o=setTimeout(()=>s(!0),t);return()=>{clearTimeout(o),s(!1)}},[e,t]),e&&n}exports.FLASH_THRESHOLD_MS=u;exports.useDelayedPending=a;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The flash threshold — the delay before a pending state becomes visible.
3
+ * Below it an indicator registers as a flicker rather than as information.
4
+ * One shared constant so every surface flickers (or rather, doesn't) the
5
+ * same way. See the Loading pattern, "Timing".
6
+ *
7
+ * This is the JS mirror of the `--ds-motion-flash-threshold` motion token
8
+ * (the `flash-delay` CSS utility), which drives CSS-only appearance delays
9
+ * such as ComboboxLoading's — when one changes, change the other.
10
+ */
11
+ export declare const FLASH_THRESHOLD_MS = 150;
12
+ /**
13
+ * Delays entering a visible pending state by the flash threshold, and leaves
14
+ * it immediately.
15
+ *
16
+ * The two rules are deliberately asymmetric ("delay, don't hold" — see the
17
+ * Loading pattern):
18
+ * - On the way in, the returned flag turns on only after `delay` ms, so a
19
+ * wait that resolves inside the flash zone never shows an indicator at all.
20
+ * - On the way out, the flag turns off the moment `pending` does — there is
21
+ * no timer on the exit path, so a minimum display time is impossible by
22
+ * construction. Never re-add one: flicker is fixed by this entry delay,
23
+ * not by holding skeletons over content the user could already be reading.
24
+ *
25
+ * The flag gates only what is rendered. It must never gate the request or
26
+ * the content swap — data renders the moment it lands.
27
+ *
28
+ * @param pending - The raw pending state (e.g. a query's `isFetching`).
29
+ * @param delay - Delay before the pending state shows, in milliseconds
30
+ * (default `FLASH_THRESHOLD_MS`).
31
+ * @returns Whether the pending indicator should be visible.
32
+ */
33
+ export declare function useDelayedPending(pending: boolean, delay?: number): boolean;
34
+ //# sourceMappingURL=use-delayed-pending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-delayed-pending.d.ts","sourceRoot":"","sources":["../../src/hooks/use-delayed-pending.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,MAA2B,GACjC,OAAO,CAqBT"}
@@ -0,0 +1,17 @@
1
+ import { useState as o, useEffect as f } from "react";
2
+ const a = 150;
3
+ function n(e, t = a) {
4
+ const [s, r] = o(!1);
5
+ return f(() => {
6
+ if (!e)
7
+ return;
8
+ const u = setTimeout(() => r(!0), t);
9
+ return () => {
10
+ clearTimeout(u), r(!1);
11
+ };
12
+ }, [e, t]), e && s;
13
+ }
14
+ export {
15
+ a as FLASH_THRESHOLD_MS,
16
+ n as useDelayedPending
17
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-breakpoint.cjs");exports.getBreakpointValue=e.getBreakpointValue;exports.getMobileBreakpoint=e.getBreakpointValue;exports.isMobileViewport=e.isBelowBreakpoint;exports.useIsBelowBreakpoint=e.useIsBelowBreakpoint;exports.useIsMobile=e.useIsBelowBreakpoint;