@brightlocal/ui-components 3.0.0 → 3.2.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 (235) hide show
  1. package/README.md +7 -1
  2. package/component-meta.json +749 -53
  3. package/deprecations.json +114 -4
  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.d.ts +32 -3
  10. package/dist/alert-dialog.d.ts.map +1 -1
  11. package/dist/alert-dialog.js +61 -58
  12. package/dist/alert.cjs +1 -1
  13. package/dist/alert.d.ts.map +1 -1
  14. package/dist/alert.js +58 -57
  15. package/dist/badge.cjs +1 -1
  16. package/dist/badge.d.ts +9 -0
  17. package/dist/badge.d.ts.map +1 -1
  18. package/dist/badge.js +50 -30
  19. package/dist/banner.cjs +1 -0
  20. package/dist/banner.d.ts +81 -0
  21. package/dist/banner.d.ts.map +1 -0
  22. package/dist/banner.js +176 -0
  23. package/dist/blocks/empty-state.cjs +1 -1
  24. package/dist/blocks/empty-state.d.ts +4 -3
  25. package/dist/blocks/empty-state.d.ts.map +1 -1
  26. package/dist/blocks/empty-state.js +50 -57
  27. package/dist/blocks/progress-state.d.ts +2 -2
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts +17 -0
  30. package/dist/blocks/sidebar.d.ts.map +1 -1
  31. package/dist/blocks/sidebar.js +8 -2
  32. package/dist/brand-illustration-motif.d.ts +1 -1
  33. package/dist/button-group.cjs +1 -0
  34. package/dist/button-group.d.ts +36 -0
  35. package/dist/button-group.d.ts.map +1 -0
  36. package/dist/button-group.js +47 -0
  37. package/dist/button.cjs +1 -1
  38. package/dist/button.js +1 -1
  39. package/dist/card.cjs +1 -1
  40. package/dist/card.d.ts +105 -7
  41. package/dist/card.d.ts.map +1 -1
  42. package/dist/card.js +198 -101
  43. package/dist/chart.cjs +3 -3
  44. package/dist/chart.d.ts +270 -24
  45. package/dist/chart.d.ts.map +1 -1
  46. package/dist/chart.js +497 -322
  47. package/dist/checkbox.cjs +1 -1
  48. package/dist/checkbox.d.ts +1 -1
  49. package/dist/checkbox.d.ts.map +1 -1
  50. package/dist/checkbox.js +2 -1
  51. package/dist/chip.cjs +1 -1
  52. package/dist/chip.d.ts +38 -4
  53. package/dist/chip.d.ts.map +1 -1
  54. package/dist/chip.js +95 -81
  55. package/dist/combobox.cjs +1 -1
  56. package/dist/combobox.js +2 -2
  57. package/dist/command.cjs +1 -1
  58. package/dist/command.d.ts +23 -1
  59. package/dist/command.d.ts.map +1 -1
  60. package/dist/command.js +251 -225
  61. package/dist/data-table.cjs +1 -1
  62. package/dist/data-table.d.ts +201 -23
  63. package/dist/data-table.d.ts.map +1 -1
  64. package/dist/data-table.js +712 -568
  65. package/dist/date-picker.cjs +1 -1
  66. package/dist/date-picker.d.ts +13 -5
  67. package/dist/date-picker.d.ts.map +1 -1
  68. package/dist/date-picker.js +54 -53
  69. package/dist/field.cjs +1 -1
  70. package/dist/field.d.ts +8 -1
  71. package/dist/field.d.ts.map +1 -1
  72. package/dist/field.js +79 -52
  73. package/dist/global-layout.cjs +1 -1
  74. package/dist/global-layout.d.ts +105 -13
  75. package/dist/global-layout.d.ts.map +1 -1
  76. package/dist/global-layout.js +146 -129
  77. package/dist/grid.d.ts +26 -3
  78. package/dist/grid.d.ts.map +1 -1
  79. package/dist/hooks/use-breakpoint.cjs +1 -1
  80. package/dist/hooks/use-breakpoint.d.ts +1 -1
  81. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  82. package/dist/hooks/use-breakpoint.js +1 -0
  83. package/dist/hooks/use-mobile.cjs +1 -0
  84. package/dist/hooks/use-mobile.js +8 -0
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.d.ts +6 -0
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +594 -553
  89. package/dist/info-tooltip.cjs +1 -0
  90. package/dist/info-tooltip.d.ts +39 -0
  91. package/dist/info-tooltip.d.ts.map +1 -0
  92. package/dist/info-tooltip.js +41 -0
  93. package/dist/input-chip.cjs +1 -1
  94. package/dist/input-chip.js +1 -1
  95. package/dist/input-group.cjs +1 -1
  96. package/dist/input-group.d.ts +33 -2
  97. package/dist/input-group.d.ts.map +1 -1
  98. package/dist/input-group.js +167 -54
  99. package/dist/input-otp.cjs +1 -1
  100. package/dist/input-otp.js +9 -9
  101. package/dist/input-password.cjs +1 -1
  102. package/dist/input-password.d.ts +45 -15
  103. package/dist/input-password.d.ts.map +1 -1
  104. package/dist/input-password.js +31 -30
  105. package/dist/input.cjs +1 -1
  106. package/dist/input.js +10 -10
  107. package/dist/lib/block-illustration.cjs +1 -1
  108. package/dist/lib/block-illustration.d.ts +4 -1
  109. package/dist/lib/block-illustration.d.ts.map +1 -1
  110. package/dist/lib/block-illustration.js +12 -11
  111. package/dist/lib/empty-chip.cjs +1 -0
  112. package/dist/lib/empty-chip.d.ts +4 -0
  113. package/dist/lib/empty-chip.d.ts.map +1 -0
  114. package/dist/lib/empty-chip.js +13 -0
  115. package/dist/lib/utils.cjs +1 -1
  116. package/dist/lib/utils.d.ts.map +1 -1
  117. package/dist/lib/utils.js +4 -3
  118. package/dist/list.cjs +1 -1
  119. package/dist/list.js +1 -1
  120. package/dist/multi-select-filter.cjs +1 -0
  121. package/dist/multi-select-filter.d.ts +178 -0
  122. package/dist/multi-select-filter.d.ts.map +1 -0
  123. package/dist/multi-select-filter.js +463 -0
  124. package/dist/pagination.cjs +1 -1
  125. package/dist/pagination.d.ts +3 -0
  126. package/dist/pagination.d.ts.map +1 -1
  127. package/dist/pagination.js +57 -57
  128. package/dist/progress.cjs +1 -1
  129. package/dist/progress.d.ts +123 -16
  130. package/dist/progress.d.ts.map +1 -1
  131. package/dist/progress.js +89 -75
  132. package/dist/rating.cjs +1 -1
  133. package/dist/rating.js +18 -18
  134. package/dist/relative-date.cjs +1 -0
  135. package/dist/relative-date.d.ts +65 -0
  136. package/dist/relative-date.d.ts.map +1 -0
  137. package/dist/relative-date.js +128 -0
  138. package/dist/scroll-area.cjs +1 -1
  139. package/dist/scroll-area.d.ts +15 -6
  140. package/dist/scroll-area.d.ts.map +1 -1
  141. package/dist/scroll-area.js +38 -36
  142. package/dist/select.cjs +2 -2
  143. package/dist/select.d.ts +24 -3
  144. package/dist/select.d.ts.map +1 -1
  145. package/dist/select.js +130 -110
  146. package/dist/sheet.cjs +1 -1
  147. package/dist/sheet.d.ts +78 -2
  148. package/dist/sheet.d.ts.map +1 -1
  149. package/dist/sheet.js +192 -85
  150. package/dist/single-select-filter.cjs +1 -0
  151. package/dist/single-select-filter.d.ts +81 -0
  152. package/dist/single-select-filter.d.ts.map +1 -0
  153. package/dist/single-select-filter.js +226 -0
  154. package/dist/sonner.cjs +1 -1
  155. package/dist/sonner.d.ts.map +1 -1
  156. package/dist/sonner.js +22 -22
  157. package/dist/split-layout.cjs +1 -1
  158. package/dist/split-layout.d.ts +1 -1
  159. package/dist/split-layout.js +13 -13
  160. package/dist/table.cjs +1 -1
  161. package/dist/table.d.ts +45 -4
  162. package/dist/table.d.ts.map +1 -1
  163. package/dist/table.js +90 -73
  164. package/dist/tabs.cjs +1 -1
  165. package/dist/tabs.d.ts +12 -1
  166. package/dist/tabs.d.ts.map +1 -1
  167. package/dist/tabs.js +148 -126
  168. package/dist/textarea.cjs +1 -1
  169. package/dist/textarea.js +1 -1
  170. package/dist/tooltip.cjs +1 -1
  171. package/dist/tooltip.d.ts +38 -36
  172. package/dist/tooltip.d.ts.map +1 -1
  173. package/dist/tooltip.js +262 -73
  174. package/dist/typography-heading.cjs +1 -1
  175. package/dist/typography-heading.d.ts +13 -0
  176. package/dist/typography-heading.d.ts.map +1 -1
  177. package/dist/typography-heading.js +32 -21
  178. package/dist/typography-text.cjs +1 -1
  179. package/dist/typography-text.d.ts +15 -2
  180. package/dist/typography-text.d.ts.map +1 -1
  181. package/dist/typography-text.js +35 -24
  182. package/dist/typography.d.ts +1 -1
  183. package/package.json +5 -6
  184. package/src/blocks/empty-state.tsx +17 -24
  185. package/src/blocks/progress-state.tsx +2 -2
  186. package/src/blocks/sidebar.tsx +26 -2
  187. package/src/components/accordion.tsx +82 -27
  188. package/src/components/alert-dialog.tsx +50 -5
  189. package/src/components/alert.tsx +16 -8
  190. package/src/components/badge.tsx +40 -3
  191. package/src/components/banner.tsx +288 -0
  192. package/src/components/brand-illustration-motif.tsx +1 -1
  193. package/src/components/button-group.tsx +112 -0
  194. package/src/components/button.tsx +1 -1
  195. package/src/components/card.tsx +249 -27
  196. package/src/components/chart.tsx +586 -53
  197. package/src/components/checkbox.tsx +1 -1
  198. package/src/components/chip.tsx +83 -10
  199. package/src/components/combobox.tsx +2 -2
  200. package/src/components/command.tsx +56 -4
  201. package/src/components/data-table.tsx +842 -199
  202. package/src/components/date-picker.tsx +18 -7
  203. package/src/components/field.tsx +81 -12
  204. package/src/components/global-layout.tsx +176 -38
  205. package/src/components/grid.tsx +34 -3
  206. package/src/components/info-tooltip.tsx +94 -0
  207. package/src/components/input-chip.tsx +1 -1
  208. package/src/components/input-group.tsx +246 -11
  209. package/src/components/input-otp.tsx +1 -1
  210. package/src/components/input-password.tsx +56 -22
  211. package/src/components/input.tsx +1 -1
  212. package/src/components/list.tsx +1 -1
  213. package/src/components/multi-select-filter.tsx +912 -0
  214. package/src/components/pagination.tsx +10 -3
  215. package/src/components/progress.tsx +190 -31
  216. package/src/components/rating.tsx +1 -1
  217. package/src/components/relative-date.tsx +230 -0
  218. package/src/components/scroll-area.tsx +23 -10
  219. package/src/components/select.tsx +65 -11
  220. package/src/components/sheet.tsx +240 -4
  221. package/src/components/single-select-filter.tsx +443 -0
  222. package/src/components/sonner.tsx +16 -5
  223. package/src/components/split-layout.tsx +2 -2
  224. package/src/components/table.tsx +71 -11
  225. package/src/components/tabs.tsx +93 -46
  226. package/src/components/textarea.tsx +1 -1
  227. package/src/components/tooltip.tsx +440 -68
  228. package/src/components/typography-heading.tsx +24 -0
  229. package/src/components/typography-text.tsx +27 -3
  230. package/src/components/typography.tsx +1 -1
  231. package/src/hooks/use-breakpoint.ts +2 -1
  232. package/src/index.ts +6 -0
  233. package/src/lib/block-illustration.tsx +5 -1
  234. package/src/lib/empty-chip.ts +24 -0
  235. package/src/lib/utils.ts +1 -0
@@ -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 { TypographyText as E } from "./typography-text.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", _ = 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", _ = 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
- _.displayName = "GlobalLayoutSidebar";
80
- const A = 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,103 +95,117 @@ const A = 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
- A.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,
129
144
  color: "muted",
130
145
  "data-slot": "content-header-subtitle",
131
146
  dataHook: t ?? "content-header-subtitle",
132
147
  variant: "body-sm",
133
- ...a
148
+ ...e
134
149
  }
135
150
  ));
136
- k.displayName = "GlobalLayoutSubtitle";
137
- 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(
138
153
  "div",
139
154
  {
140
- ref: o,
155
+ ref: n,
141
156
  className: m(
142
157
  "aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
143
158
  t
144
159
  ),
145
- "data-hook": e ?? "content-header-image",
160
+ "data-hook": a ?? "content-header-image",
146
161
  "data-slot": "content-header-image",
147
162
  ...l,
148
- children: a
163
+ children: e
149
164
  }
150
165
  ));
151
- v.displayName = "GlobalLayoutImage";
152
- const I = r.forwardRef(
153
- ({ className: t, dataHook: e, trackingEl: a, trackingLabel: l, children: o, ...s }, d) => {
154
- const c = [], f = [], y = [], p = [], b = [], h = [];
155
- return r.Children.forEach(o, (i) => {
156
- 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);
157
- }), 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(
158
173
  "div",
159
174
  {
160
175
  className: m("w-full", x),
161
176
  "data-slot": "content-header-region",
162
- children: /* @__PURE__ */ n(
163
- g,
177
+ children: /* @__PURE__ */ o(
178
+ w,
164
179
  {
165
- ref: d,
180
+ ref: i,
166
181
  className: m(
167
182
  "mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
168
183
  t
169
184
  ),
170
185
  "data-slot": "content-header",
171
- dataHook: e,
186
+ dataHook: a,
172
187
  style: { maxWidth: "var(--ds-breakpoint-lg)" },
173
- trackingEl: a,
188
+ trackingEl: e,
174
189
  trackingLabel: l,
175
190
  ...s,
176
- children: o
191
+ children: n
177
192
  }
178
193
  )
179
194
  }
180
- ) : /* @__PURE__ */ n(
195
+ ) : /* @__PURE__ */ o(
181
196
  "div",
182
197
  {
183
198
  className: m("w-full", x),
184
199
  "data-slot": "content-header-region",
185
200
  children: /* @__PURE__ */ u(
186
- g,
201
+ w,
187
202
  {
188
- ref: d,
203
+ ref: i,
189
204
  className: m("mx-auto w-full items-start gap-4", t),
190
205
  "data-slot": "content-header",
191
- dataHook: e,
206
+ dataHook: a,
192
207
  style: { maxWidth: "var(--ds-breakpoint-lg)" },
193
- trackingEl: a,
208
+ trackingEl: e,
194
209
  trackingLabel: l,
195
210
  ...s,
196
211
  children: [
@@ -203,8 +218,8 @@ const I = r.forwardRef(
203
218
  "data-slot": "content-header-body",
204
219
  children: [
205
220
  y,
206
- b.length > 0 ? (
207
- // With a slotted GlobalLayoutContentActions the header follows
221
+ p.length > 0 ? (
222
+ // With a slotted GlobalLayoutActions the header follows
208
223
  // the Figma Page Header structure: a text block (title +
209
224
  // description) with the actions beside it — and below it on
210
225
  // mobile, so the action lands under the description.
@@ -221,16 +236,16 @@ const I = r.forwardRef(
221
236
  "data-slot": "content-header-text",
222
237
  children: [
223
238
  h,
224
- p
239
+ b
225
240
  ]
226
241
  }
227
242
  ),
228
- /* @__PURE__ */ n(N.Provider, { value: !0, children: b })
243
+ /* @__PURE__ */ o(G.Provider, { value: !0, children: p })
229
244
  ]
230
245
  }
231
246
  )
232
- ) : /* @__PURE__ */ u(G, { children: [
233
- /* @__PURE__ */ n(
247
+ ) : /* @__PURE__ */ u(H, { children: [
248
+ /* @__PURE__ */ o(
234
249
  "div",
235
250
  {
236
251
  className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
@@ -238,7 +253,7 @@ const I = r.forwardRef(
238
253
  children: h
239
254
  }
240
255
  ),
241
- p
256
+ b
242
257
  ] })
243
258
  ]
244
259
  }
@@ -250,27 +265,27 @@ const I = r.forwardRef(
250
265
  );
251
266
  }
252
267
  );
253
- I.displayName = "GlobalLayoutContentHeader";
254
- const N = r.createContext(!1), L = r.forwardRef(
255
- ({ className: t, dataHook: e, trackingEl: a, trackingLabel: l, children: o, ...s }, d) => {
256
- 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(
257
272
  "div",
258
273
  {
259
- ref: d,
274
+ ref: i,
260
275
  className: m(
261
276
  c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
262
277
  t
263
278
  ),
264
- "data-hook": e,
279
+ "data-hook": a,
265
280
  "data-slot": "content-actions",
266
- "data-tracking-el": a,
281
+ "data-tracking-el": e,
267
282
  "data-tracking-label": l,
268
283
  style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
269
284
  ...s,
270
- children: o
285
+ children: n
271
286
  }
272
287
  );
273
- return c ? f : /* @__PURE__ */ n(
288
+ return c ? f : /* @__PURE__ */ o(
274
289
  "div",
275
290
  {
276
291
  className: m("w-full", x),
@@ -280,45 +295,45 @@ const N = r.createContext(!1), L = r.forwardRef(
280
295
  );
281
296
  }
282
297
  );
283
- L.displayName = "GlobalLayoutContentActions";
284
- const M = r.forwardRef(
285
- ({ 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(
286
301
  "div",
287
302
  {
288
303
  className: m("flex w-full flex-1 flex-col", x),
289
304
  "data-slot": "content-body-region",
290
- children: /* @__PURE__ */ n(
305
+ children: /* @__PURE__ */ o(
291
306
  "div",
292
307
  {
293
- ref: d,
308
+ ref: i,
294
309
  className: m("mx-auto flex w-full flex-1 flex-col gap-6", t),
295
- "data-hook": e,
310
+ "data-hook": a,
296
311
  "data-slot": "content-body",
297
- "data-tracking-el": a,
312
+ "data-tracking-el": e,
298
313
  "data-tracking-label": l,
299
314
  style: { maxWidth: "var(--content-max-width)" },
300
315
  ...s,
301
- children: o
316
+ children: n
302
317
  }
303
318
  )
304
319
  }
305
320
  )
306
321
  );
307
- M.displayName = "GlobalLayoutContentBody";
308
- const T = r.forwardRef(
322
+ R.displayName = "GlobalLayoutBody";
323
+ const K = R, V = r.forwardRef(
309
324
  ({
310
325
  className: t,
311
- dataHook: e,
312
- ariaLabel: a,
326
+ dataHook: a,
327
+ ariaLabel: e,
313
328
  trackingEl: l,
314
- trackingLabel: o,
329
+ trackingLabel: n,
315
330
  children: s,
316
- ...d
317
- }, c) => /* @__PURE__ */ n(
331
+ ...i
332
+ }, c) => /* @__PURE__ */ o(
318
333
  "div",
319
334
  {
320
335
  ref: c,
321
- "aria-label": a ?? "Mobile navigation",
336
+ "aria-label": e ?? "Mobile navigation",
322
337
  className: m(
323
338
  // The 2px negative margin pulls a slotted SidebarTrigger's box
324
339
  // left by its icon inset so the burger glyph — not the invisible
@@ -326,26 +341,28 @@ const T = r.forwardRef(
326
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",
327
342
  t
328
343
  ),
329
- "data-hook": e,
344
+ "data-hook": a,
330
345
  "data-slot": "mobile-header",
331
346
  "data-tracking-el": l,
332
- "data-tracking-label": o,
347
+ "data-tracking-label": n,
333
348
  role: "toolbar",
334
- ...d,
349
+ ...i,
335
350
  children: s
336
351
  }
337
352
  )
338
353
  );
339
- T.displayName = "GlobalLayoutMobileHeader";
354
+ V.displayName = "GlobalLayoutMobileHeader";
340
355
  export {
341
- S as GlobalLayout,
342
- w as GlobalLayoutBackLink,
343
- A as GlobalLayoutContent,
344
- L as GlobalLayoutContentActions,
345
- M as GlobalLayoutContentBody,
346
- I as GlobalLayoutContentHeader,
347
- v as GlobalLayoutImage,
348
- T as GlobalLayoutMobileHeader,
349
- _ as GlobalLayoutSidebar,
350
- k as GlobalLayoutSubtitle
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,
365
+ V as GlobalLayoutMobileHeader,
366
+ I as GlobalLayoutSidebar,
367
+ L as GlobalLayoutSubtitle
351
368
  };
package/dist/grid.d.ts CHANGED
@@ -23,6 +23,10 @@ interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
23
23
  /**
24
24
  * One message at the page body's optical centre (38/62). Give it a page body
25
25
  * to fill — it stretches with `flex-1` — and one message to hold.
26
+ *
27
+ * Requires an unbroken flex chain: the Grid's parent, and every wrapper up to
28
+ * the page body, must be a `flex flex-1 flex-col` box. Behind a non-flex
29
+ * wrapper it centres horizontally only — fix the wrapper, do not add a margin.
26
30
  */
27
31
  interface GridCenteredProps extends GridBaseProps {
28
32
  variant: "centered";
@@ -38,16 +42,35 @@ export type GridProps = GridCenteredProps;
38
42
  *
39
43
  * @example
40
44
  * ```tsx
41
- * <GlobalLayoutContentBody dataHook="locations-body">
45
+ * <GlobalLayoutBody dataHook="locations-body">
42
46
  * <Grid dataHook="locations-empty-center" variant="centered">
43
47
  * <EmptyState
44
48
  * dataHook="locations-empty"
45
- * illustration={<BusinessLocation aria-hidden />}
49
+ * illustration={<SmallBusiness aria-hidden />}
46
50
  * size="lg"
47
51
  * title={t("locations.empty.title")}
48
52
  * />
49
53
  * </Grid>
50
- * </GlobalLayoutContentBody>
54
+ * </GlobalLayoutBody>
55
+ * ```
56
+ *
57
+ * @example
58
+ * Wrappers between the page body and the Grid must continue the flex chain:
59
+ * ```tsx
60
+ * // Broken — the plain <div> has no height to give, so the Grid collapses to
61
+ * // its content and the message hugs the top (horizontal centring only).
62
+ * <GlobalLayoutBody dataHook="search-body">
63
+ * <div>
64
+ * <Grid dataHook="search-empty-center" variant="centered">…</Grid>
65
+ * </div>
66
+ * </GlobalLayoutBody>
67
+ *
68
+ * // Fixed — the wrapper passes the height down.
69
+ * <GlobalLayoutBody dataHook="search-body">
70
+ * <div className="flex flex-1 flex-col">
71
+ * <Grid dataHook="search-empty-center" variant="centered">…</Grid>
72
+ * </div>
73
+ * </GlobalLayoutBody>
51
74
  * ```
52
75
  */
53
76
  declare const Grid: React.ForwardRefExoticComponent<GridCenteredProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +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"}
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgD/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;;;;;;;GAOG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Breakpoint name matching design token keys from `@brightlocal/tokens/breakpoints`.
3
3
  */
4
- type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl";
4
+ type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
5
5
  export declare function getBreakpointValue(size?: Breakpoint): number;
6
6
  export declare function isBelowBreakpoint(size?: Breakpoint): boolean;
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAWpD,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,UAAiB,GAAG,MAAM,CASlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,UAAiB,GAAG,OAAO,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,UAAiB,WAc3D;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAY3D,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,UAAiB,GAAG,MAAM,CASlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,UAAiB,GAAG,OAAO,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,UAAiB,WAc3D;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import * as s from "react";
2
2
  const d = {
3
+ xs: 480,
3
4
  sm: 640,
4
5
  md: 768,
5
6
  lg: 1024,
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { getBreakpointValue as i, getBreakpointValue as a, isBelowBreakpoint as s, useIsBelowBreakpoint as t, useIsBelowBreakpoint as r } from "./use-breakpoint.js";
2
+ export {
3
+ i as getBreakpointValue,
4
+ a as getMobileBreakpoint,
5
+ s as isMobileViewport,
6
+ t as useIsBelowBreakpoint,
7
+ r as useIsMobile
8
+ };